@blazingagents/sdk 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +115 -344
- package/dist/client.d.ts +3 -1
- package/dist/client.js +1 -1
- package/dist/contracts/api.d.ts +1 -1
- package/dist/contracts/api.js +1 -1
- package/dist/contracts/entities/agents.d.ts +14 -7
- package/dist/contracts/entities/agents.js +7 -3
- package/dist/contracts/entities/artifacts.d.ts +9 -9
- package/dist/contracts/entities/artifacts.js +5 -5
- package/dist/contracts/entities/chat.d.ts +7 -7
- package/dist/contracts/entities/chat.js +5 -5
- package/dist/contracts/entities/mcp-connections.d.ts +18 -18
- package/dist/contracts/entities/mcp-connections.js +13 -13
- package/dist/contracts/entities/memories.d.ts +5 -5
- package/dist/contracts/entities/memories.js +2 -2
- package/dist/contracts/entities/prompts.d.ts +4 -4
- package/dist/contracts/entities/prompts.js +2 -2
- package/dist/contracts/entities/providers.d.ts +12 -7
- package/dist/contracts/entities/providers.js +12 -6
- package/dist/contracts/entities/sessions.d.ts +10 -10
- package/dist/contracts/entities/sessions.js +6 -6
- package/dist/contracts/entities/skills.d.ts +18 -18
- package/dist/contracts/entities/skills.js +6 -6
- package/dist/contracts/entities/tasks.d.ts +56 -46
- package/dist/contracts/entities/tasks.js +25 -16
- package/dist/contracts/entities/tenants.d.ts +6 -6
- package/dist/contracts/entities/tenants.js +4 -4
- package/dist/contracts/entities/usage.d.ts +5 -5
- package/dist/contracts/entities/usage.js +3 -3
- package/dist/contracts/entities/workspaces.d.ts +9 -9
- package/dist/contracts/entities/workspaces.js +7 -2
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/index.js +1 -1
- package/dist/direct-chat-transport.d.ts +16 -0
- package/dist/direct-chat-transport.js +49 -0
- package/dist/generation.js +4 -3
- package/dist/http.d.ts +2 -0
- package/dist/http.js +2 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -0
- package/dist/relay.js +2 -2
- package/dist/resources/agents.js +37 -22
- package/dist/resources/artifacts.js +8 -6
- package/dist/resources/mcp-connections.js +19 -15
- package/dist/resources/memories.js +10 -9
- package/dist/resources/prompts.js +10 -6
- package/dist/resources/providers.js +18 -12
- package/dist/resources/sessions.js +12 -10
- package/dist/resources/skills.js +33 -21
- package/dist/resources/tasks.js +22 -14
- package/dist/resources/tenant.js +4 -3
- package/dist/resources/usage.js +4 -3
- package/dist/resources/workspaces.js +10 -8
- package/dist/types.d.ts +225 -104
- package/package.json +2 -2
|
@@ -38,6 +38,7 @@ export const agentSchema = z
|
|
|
38
38
|
tenantId: tenantIdSchema,
|
|
39
39
|
name: agentNameSchema,
|
|
40
40
|
model: agentModelIdSchema.nullable(),
|
|
41
|
+
thinkingLevel: z.string().min(1).nullable(),
|
|
41
42
|
providerId: providerIdSchema.nullable(),
|
|
42
43
|
workspaceId: workspaceIdSchema,
|
|
43
44
|
memoryInjectionEnabled: z.boolean(),
|
|
@@ -53,7 +54,7 @@ export const agentSchema = z
|
|
|
53
54
|
version: agentVersionNumberSchema,
|
|
54
55
|
status: agentStatusSchema,
|
|
55
56
|
})
|
|
56
|
-
.
|
|
57
|
+
.strip()
|
|
57
58
|
.refine(hasProviderModelPair, {
|
|
58
59
|
message: providerModelPairMessage,
|
|
59
60
|
path: ["providerId"],
|
|
@@ -62,7 +63,7 @@ export const agentsResponseSchema = z
|
|
|
62
63
|
.object({
|
|
63
64
|
agents: z.array(agentSchema),
|
|
64
65
|
})
|
|
65
|
-
.
|
|
66
|
+
.strip();
|
|
66
67
|
export const agentResponseSchema = agentSchema;
|
|
67
68
|
export const agentsListQuerySchema = z
|
|
68
69
|
.object({
|
|
@@ -77,6 +78,7 @@ export const agentVersionSchema = z
|
|
|
77
78
|
version: agentVersionNumberSchema,
|
|
78
79
|
name: agentSchema.shape.name,
|
|
79
80
|
model: agentSchema.shape.model,
|
|
81
|
+
thinkingLevel: agentSchema.shape.thinkingLevel,
|
|
80
82
|
providerId: agentSchema.shape.providerId,
|
|
81
83
|
memoryInjectionEnabled: agentSchema.shape.memoryInjectionEnabled,
|
|
82
84
|
tools: agentSchema.shape.tools,
|
|
@@ -85,7 +87,7 @@ export const agentVersionSchema = z
|
|
|
85
87
|
mcpConnectionIds: agentSchema.shape.mcpConnectionIds,
|
|
86
88
|
createdAt: agentSchema.shape.createdAt,
|
|
87
89
|
})
|
|
88
|
-
.
|
|
90
|
+
.strip()
|
|
89
91
|
.refine(hasProviderModelPair, {
|
|
90
92
|
message: providerModelPairMessage,
|
|
91
93
|
path: ["providerId"],
|
|
@@ -106,6 +108,7 @@ export const createAgentBodySchema = z
|
|
|
106
108
|
.object({
|
|
107
109
|
name: agentNameSchema,
|
|
108
110
|
model: agentModelIdSchema.nullable().default(null),
|
|
111
|
+
thinkingLevel: z.string().min(1).nullable().default(null),
|
|
109
112
|
providerId: providerIdSchema.nullable().default(null),
|
|
110
113
|
workspaceId: workspaceIdSchema.optional(),
|
|
111
114
|
memoryInjectionEnabled: z.boolean().default(false),
|
|
@@ -124,6 +127,7 @@ export const updateAgentBodySchema = z
|
|
|
124
127
|
.object({
|
|
125
128
|
name: agentNameSchema.optional(),
|
|
126
129
|
model: agentModelIdSchema.nullable().optional(),
|
|
130
|
+
thinkingLevel: z.string().min(1).nullable().optional(),
|
|
127
131
|
providerId: providerIdSchema.nullable().optional(),
|
|
128
132
|
workspaceId: workspaceIdSchema.optional(),
|
|
129
133
|
memoryInjectionEnabled: z.boolean().optional(),
|
|
@@ -15,7 +15,7 @@ export declare const artifactListItemSchema: z.ZodObject<{
|
|
|
15
15
|
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
16
16
|
createdAt: z.ZodISODateTime;
|
|
17
17
|
updatedAt: z.ZodISODateTime;
|
|
18
|
-
}, z.core.$
|
|
18
|
+
}, z.core.$strip>;
|
|
19
19
|
export declare const artifactsListResponseSchema: z.ZodObject<{
|
|
20
20
|
data: z.ZodArray<z.ZodObject<{
|
|
21
21
|
artifactId: z.ZodString;
|
|
@@ -29,9 +29,9 @@ export declare const artifactsListResponseSchema: z.ZodObject<{
|
|
|
29
29
|
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
30
30
|
createdAt: z.ZodISODateTime;
|
|
31
31
|
updatedAt: z.ZodISODateTime;
|
|
32
|
-
}, z.core.$
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
33
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
34
|
-
}, z.core.$
|
|
34
|
+
}, z.core.$strip>;
|
|
35
35
|
export declare const artifactsListQuerySchema: z.ZodObject<{
|
|
36
36
|
agentId: z.ZodOptional<z.ZodString>;
|
|
37
37
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
@@ -43,25 +43,25 @@ export declare const publishArtifactsInputSchema: z.ZodObject<{
|
|
|
43
43
|
export declare const publishArtifactResultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
44
44
|
artifactId: z.ZodString;
|
|
45
45
|
path: z.ZodString;
|
|
46
|
-
}, z.core.$
|
|
46
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
47
47
|
error: z.ZodLiteral<true>;
|
|
48
48
|
message: z.ZodString;
|
|
49
49
|
path: z.ZodString;
|
|
50
|
-
}, z.core.$
|
|
50
|
+
}, z.core.$strip>]>;
|
|
51
51
|
export declare const publishArtifactsOutputSchema: z.ZodObject<{
|
|
52
52
|
results: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
53
53
|
artifactId: z.ZodString;
|
|
54
54
|
path: z.ZodString;
|
|
55
|
-
}, z.core.$
|
|
55
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
56
56
|
error: z.ZodLiteral<true>;
|
|
57
57
|
message: z.ZodString;
|
|
58
58
|
path: z.ZodString;
|
|
59
|
-
}, z.core.$
|
|
60
|
-
}, z.core.$
|
|
59
|
+
}, z.core.$strip>]>>;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
61
|
export declare const artifactDownloadUrlResponseSchema: z.ZodObject<{
|
|
62
62
|
url: z.ZodURL;
|
|
63
63
|
expiresAt: z.ZodISODateTime;
|
|
64
|
-
}, z.core.$
|
|
64
|
+
}, z.core.$strip>;
|
|
65
65
|
export type ArtifactListItem = z.infer<typeof artifactListItemSchema>;
|
|
66
66
|
export type ArtifactsListResponse = z.infer<typeof artifactsListResponseSchema>;
|
|
67
67
|
export type ArtifactsListQuery = z.infer<typeof artifactsListQuerySchema>;
|
|
@@ -26,7 +26,7 @@ export const artifactListItemSchema = z
|
|
|
26
26
|
createdAt: z.iso.datetime({ offset: true }),
|
|
27
27
|
updatedAt: z.iso.datetime({ offset: true }),
|
|
28
28
|
})
|
|
29
|
-
.
|
|
29
|
+
.strip();
|
|
30
30
|
export const artifactsListResponseSchema = paginatedResponseSchema(artifactListItemSchema);
|
|
31
31
|
export const artifactsListQuerySchema = z
|
|
32
32
|
.object({
|
|
@@ -49,23 +49,23 @@ export const publishArtifactResultSchema = z.union([
|
|
|
49
49
|
artifactId: artifactIdSchema,
|
|
50
50
|
path: z.string().trim().min(1),
|
|
51
51
|
})
|
|
52
|
-
.
|
|
52
|
+
.strip(),
|
|
53
53
|
z
|
|
54
54
|
.object({
|
|
55
55
|
error: z.literal(true),
|
|
56
56
|
message: z.string().trim().min(1),
|
|
57
57
|
path: z.string().trim().min(1),
|
|
58
58
|
})
|
|
59
|
-
.
|
|
59
|
+
.strip(),
|
|
60
60
|
]);
|
|
61
61
|
export const publishArtifactsOutputSchema = z
|
|
62
62
|
.object({
|
|
63
63
|
results: z.array(publishArtifactResultSchema).min(1),
|
|
64
64
|
})
|
|
65
|
-
.
|
|
65
|
+
.strip();
|
|
66
66
|
export const artifactDownloadUrlResponseSchema = z
|
|
67
67
|
.object({
|
|
68
68
|
url: z.url(),
|
|
69
69
|
expiresAt: z.iso.datetime({ offset: true }),
|
|
70
70
|
})
|
|
71
|
-
.
|
|
71
|
+
.strip();
|
|
@@ -35,7 +35,7 @@ export declare const usageSummarySchema: z.ZodObject<{
|
|
|
35
35
|
inputTokens: z.ZodNumber;
|
|
36
36
|
outputTokens: z.ZodNumber;
|
|
37
37
|
stepNumber: z.ZodNumber;
|
|
38
|
-
}, z.core.$
|
|
38
|
+
}, z.core.$strip>>;
|
|
39
39
|
startedAt: z.ZodISODateTime;
|
|
40
40
|
status: z.ZodEnum<{
|
|
41
41
|
cancelled: "cancelled";
|
|
@@ -44,7 +44,7 @@ export declare const usageSummarySchema: z.ZodObject<{
|
|
|
44
44
|
}>;
|
|
45
45
|
tenantId: z.ZodString;
|
|
46
46
|
userId: z.ZodString;
|
|
47
|
-
}, z.core.$
|
|
47
|
+
}, z.core.$strip>;
|
|
48
48
|
export declare const blazingAgentsChatMessageMetadataSchema: z.ZodObject<{
|
|
49
49
|
blazingAgents: z.ZodObject<{
|
|
50
50
|
usage: z.ZodObject<{
|
|
@@ -65,7 +65,7 @@ export declare const blazingAgentsChatMessageMetadataSchema: z.ZodObject<{
|
|
|
65
65
|
inputTokens: z.ZodNumber;
|
|
66
66
|
outputTokens: z.ZodNumber;
|
|
67
67
|
stepNumber: z.ZodNumber;
|
|
68
|
-
}, z.core.$
|
|
68
|
+
}, z.core.$strip>>;
|
|
69
69
|
startedAt: z.ZodISODateTime;
|
|
70
70
|
status: z.ZodEnum<{
|
|
71
71
|
cancelled: "cancelled";
|
|
@@ -74,9 +74,9 @@ export declare const blazingAgentsChatMessageMetadataSchema: z.ZodObject<{
|
|
|
74
74
|
}>;
|
|
75
75
|
tenantId: z.ZodString;
|
|
76
76
|
userId: z.ZodString;
|
|
77
|
-
}, z.core.$
|
|
78
|
-
}, z.core.$
|
|
79
|
-
}, z.core.$
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
80
|
/**
|
|
81
81
|
* `variables` for the prompt-invocation path — a flat map of string→string.
|
|
82
82
|
* The prompt template's derived variables are the required keys; this is
|
|
@@ -258,7 +258,7 @@ export declare const generationRequestBodySchema: z.ZodObject<{
|
|
|
258
258
|
export declare const chatStreamErrorChunkSchema: z.ZodObject<{
|
|
259
259
|
type: z.ZodLiteral<"error">;
|
|
260
260
|
errorText: z.ZodString;
|
|
261
|
-
}, z.core.$
|
|
261
|
+
}, z.core.$strip>;
|
|
262
262
|
export type ChatMode = z.infer<typeof chatModeSchema>;
|
|
263
263
|
export type ChatTrigger = z.infer<typeof chatTriggerSchema>;
|
|
264
264
|
export type UsageSummary = z.infer<typeof usageSummarySchema>;
|
|
@@ -33,18 +33,18 @@ export const usageSummarySchema = z
|
|
|
33
33
|
outputTokens: z.number().int().min(0),
|
|
34
34
|
stepNumber: z.number().int().min(0),
|
|
35
35
|
})
|
|
36
|
-
.
|
|
36
|
+
.strip()),
|
|
37
37
|
startedAt: z.iso.datetime({ offset: true }),
|
|
38
38
|
status: z.enum(["succeeded", "cancelled", "failed"]),
|
|
39
39
|
tenantId: tenantIdSchema,
|
|
40
40
|
userId: z.string(),
|
|
41
41
|
})
|
|
42
|
-
.
|
|
42
|
+
.strip();
|
|
43
43
|
export const blazingAgentsChatMessageMetadataSchema = z
|
|
44
44
|
.object({
|
|
45
|
-
blazingAgents: z.object({ usage: usageSummarySchema }).
|
|
45
|
+
blazingAgents: z.object({ usage: usageSummarySchema }).strip(),
|
|
46
46
|
})
|
|
47
|
-
.
|
|
47
|
+
.strip();
|
|
48
48
|
/**
|
|
49
49
|
* `variables` for the prompt-invocation path — a flat map of string→string.
|
|
50
50
|
* The prompt template's derived variables are the required keys; this is
|
|
@@ -195,4 +195,4 @@ export const chatStreamErrorChunkSchema = z
|
|
|
195
195
|
type: z.literal("error"),
|
|
196
196
|
errorText: z.string(),
|
|
197
197
|
})
|
|
198
|
-
.
|
|
198
|
+
.strip();
|
|
@@ -200,7 +200,7 @@ export declare const mcpConnectionResponseSchema: z.ZodObject<{
|
|
|
200
200
|
tokenExpiresAt: z.ZodNullable<z.ZodISODateTime>;
|
|
201
201
|
createdAt: z.ZodISODateTime;
|
|
202
202
|
updatedAt: z.ZodISODateTime;
|
|
203
|
-
}, z.core.$
|
|
203
|
+
}, z.core.$strip>;
|
|
204
204
|
export declare const mcpConnectionsResponseSchema: z.ZodObject<{
|
|
205
205
|
mcpConnections: z.ZodArray<z.ZodObject<{
|
|
206
206
|
id: z.ZodString;
|
|
@@ -229,8 +229,8 @@ export declare const mcpConnectionsResponseSchema: z.ZodObject<{
|
|
|
229
229
|
tokenExpiresAt: z.ZodNullable<z.ZodISODateTime>;
|
|
230
230
|
createdAt: z.ZodISODateTime;
|
|
231
231
|
updatedAt: z.ZodISODateTime;
|
|
232
|
-
}, z.core.$
|
|
233
|
-
}, z.core.$
|
|
232
|
+
}, z.core.$strip>>;
|
|
233
|
+
}, z.core.$strip>;
|
|
234
234
|
export declare const forwardedMetadataKeysSchema: z.ZodArray<z.ZodString>;
|
|
235
235
|
export declare const mcpAttachmentResponseSchema: z.ZodObject<{
|
|
236
236
|
mcpConnectionId: z.ZodString;
|
|
@@ -238,7 +238,7 @@ export declare const mcpAttachmentResponseSchema: z.ZodObject<{
|
|
|
238
238
|
forwardedMetadataKeys: z.ZodArray<z.ZodString>;
|
|
239
239
|
createdAt: z.ZodISODateTime;
|
|
240
240
|
updatedAt: z.ZodISODateTime;
|
|
241
|
-
}, z.core.$
|
|
241
|
+
}, z.core.$strip>;
|
|
242
242
|
export declare const mcpAttachmentsResponseSchema: z.ZodObject<{
|
|
243
243
|
mcpAttachments: z.ZodArray<z.ZodObject<{
|
|
244
244
|
mcpConnectionId: z.ZodString;
|
|
@@ -246,8 +246,8 @@ export declare const mcpAttachmentsResponseSchema: z.ZodObject<{
|
|
|
246
246
|
forwardedMetadataKeys: z.ZodArray<z.ZodString>;
|
|
247
247
|
createdAt: z.ZodISODateTime;
|
|
248
248
|
updatedAt: z.ZodISODateTime;
|
|
249
|
-
}, z.core.$
|
|
250
|
-
}, z.core.$
|
|
249
|
+
}, z.core.$strip>>;
|
|
250
|
+
}, z.core.$strip>;
|
|
251
251
|
export declare const updateMcpAttachmentBodySchema: z.ZodObject<{
|
|
252
252
|
forwardUserId: z.ZodOptional<z.ZodBoolean>;
|
|
253
253
|
forwardedMetadataKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -301,10 +301,10 @@ export declare const reconnectMcpConnectionBodySchema: z.ZodDiscriminatedUnion<[
|
|
|
301
301
|
}, z.core.$strict>], "authType">;
|
|
302
302
|
export declare const mcpConnectionOauthConnectResponseSchema: z.ZodObject<{
|
|
303
303
|
authorizationUrl: z.ZodString;
|
|
304
|
-
}, z.core.$
|
|
304
|
+
}, z.core.$strip>;
|
|
305
305
|
export declare const mcpOauthAuthorizationLaunchResponseSchema: z.ZodObject<{
|
|
306
306
|
authorizationUrl: z.ZodString;
|
|
307
|
-
}, z.core.$
|
|
307
|
+
}, z.core.$strip>;
|
|
308
308
|
export declare const approveMcpOauthAuthorizationBodySchema: z.ZodObject<{
|
|
309
309
|
setupToken: z.ZodString;
|
|
310
310
|
}, z.core.$strict>;
|
|
@@ -312,19 +312,19 @@ export declare const mcpConnectionLiveDetailsSchema: z.ZodObject<{
|
|
|
312
312
|
server: z.ZodObject<{
|
|
313
313
|
name: z.ZodString;
|
|
314
314
|
version: z.ZodString;
|
|
315
|
-
}, z.core.$
|
|
315
|
+
}, z.core.$strip>;
|
|
316
316
|
toolNames: z.ZodArray<z.ZodString>;
|
|
317
|
-
}, z.core.$
|
|
317
|
+
}, z.core.$strip>;
|
|
318
318
|
export declare const mcpConnectionTestResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
319
319
|
server: z.ZodObject<{
|
|
320
320
|
name: z.ZodString;
|
|
321
321
|
version: z.ZodString;
|
|
322
|
-
}, z.core.$
|
|
322
|
+
}, z.core.$strip>;
|
|
323
323
|
toolNames: z.ZodArray<z.ZodString>;
|
|
324
324
|
ok: z.ZodLiteral<true>;
|
|
325
325
|
latencyMs: z.ZodNumber;
|
|
326
326
|
toolCount: z.ZodNumber;
|
|
327
|
-
}, z.core.$
|
|
327
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
328
328
|
ok: z.ZodLiteral<false>;
|
|
329
329
|
error: z.ZodObject<{
|
|
330
330
|
code: z.ZodEnum<{
|
|
@@ -334,8 +334,8 @@ export declare const mcpConnectionTestResponseSchema: z.ZodDiscriminatedUnion<[z
|
|
|
334
334
|
MCP_CONNECTION_UNREACHABLE: "MCP_CONNECTION_UNREACHABLE";
|
|
335
335
|
}>;
|
|
336
336
|
message: z.ZodString;
|
|
337
|
-
}, z.core.$
|
|
338
|
-
}, z.core.$
|
|
337
|
+
}, z.core.$strip>;
|
|
338
|
+
}, z.core.$strip>], "ok">;
|
|
339
339
|
export declare const mcpConnectionReconnectResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
340
340
|
status: z.ZodLiteral<"connected">;
|
|
341
341
|
connection: z.ZodObject<{
|
|
@@ -365,8 +365,8 @@ export declare const mcpConnectionReconnectResultSchema: z.ZodDiscriminatedUnion
|
|
|
365
365
|
tokenExpiresAt: z.ZodNullable<z.ZodISODateTime>;
|
|
366
366
|
createdAt: z.ZodISODateTime;
|
|
367
367
|
updatedAt: z.ZodISODateTime;
|
|
368
|
-
}, z.core.$
|
|
369
|
-
}, z.core.$
|
|
368
|
+
}, z.core.$strip>;
|
|
369
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
370
370
|
status: z.ZodLiteral<"needs_auth">;
|
|
371
371
|
connection: z.ZodObject<{
|
|
372
372
|
id: z.ZodString;
|
|
@@ -395,8 +395,8 @@ export declare const mcpConnectionReconnectResultSchema: z.ZodDiscriminatedUnion
|
|
|
395
395
|
tokenExpiresAt: z.ZodNullable<z.ZodISODateTime>;
|
|
396
396
|
createdAt: z.ZodISODateTime;
|
|
397
397
|
updatedAt: z.ZodISODateTime;
|
|
398
|
-
}, z.core.$
|
|
399
|
-
}, z.core.$
|
|
398
|
+
}, z.core.$strip>;
|
|
399
|
+
}, z.core.$strip>], "status">;
|
|
400
400
|
export type McpConnectionAuthType = z.infer<typeof mcpConnectionAuthTypeSchema>;
|
|
401
401
|
export type McpCredentialBundle = z.infer<typeof mcpCredentialBundleSchema>;
|
|
402
402
|
export type McpOauthClientCredentialsBundle = z.infer<typeof mcpOauthClientCredentialsBundleSchema>;
|
|
@@ -251,12 +251,12 @@ export const mcpConnectionResponseSchema = z
|
|
|
251
251
|
createdAt: z.iso.datetime({ offset: true }),
|
|
252
252
|
updatedAt: z.iso.datetime({ offset: true }),
|
|
253
253
|
})
|
|
254
|
-
.
|
|
254
|
+
.strip();
|
|
255
255
|
export const mcpConnectionsResponseSchema = z
|
|
256
256
|
.object({
|
|
257
257
|
mcpConnections: z.array(mcpConnectionResponseSchema),
|
|
258
258
|
})
|
|
259
|
-
.
|
|
259
|
+
.strip();
|
|
260
260
|
export const forwardedMetadataKeysSchema = z
|
|
261
261
|
.array(z.string().min(1).max(MAX_MCP_ATTACHMENT_METADATA_KEY_LENGTH))
|
|
262
262
|
.max(MAX_MCP_ATTACHMENT_METADATA_KEYS)
|
|
@@ -271,12 +271,12 @@ export const mcpAttachmentResponseSchema = z
|
|
|
271
271
|
createdAt: z.iso.datetime({ offset: true }),
|
|
272
272
|
updatedAt: z.iso.datetime({ offset: true }),
|
|
273
273
|
})
|
|
274
|
-
.
|
|
274
|
+
.strip();
|
|
275
275
|
export const mcpAttachmentsResponseSchema = z
|
|
276
276
|
.object({
|
|
277
277
|
mcpAttachments: z.array(mcpAttachmentResponseSchema),
|
|
278
278
|
})
|
|
279
|
-
.
|
|
279
|
+
.strip();
|
|
280
280
|
export const updateMcpAttachmentBodySchema = z
|
|
281
281
|
.object({
|
|
282
282
|
forwardUserId: z.boolean().optional(),
|
|
@@ -395,7 +395,7 @@ export const mcpConnectionOauthConnectResponseSchema = z
|
|
|
395
395
|
OPAQUE_MCP_OAUTH_TOKEN_PATTERN.test(url.searchParams.get("mcpOAuthSetup") ?? ""));
|
|
396
396
|
}),
|
|
397
397
|
})
|
|
398
|
-
.
|
|
398
|
+
.strip();
|
|
399
399
|
export const mcpOauthAuthorizationLaunchResponseSchema = z
|
|
400
400
|
.object({
|
|
401
401
|
authorizationUrl: z
|
|
@@ -411,7 +411,7 @@ export const mcpOauthAuthorizationLaunchResponseSchema = z
|
|
|
411
411
|
OPAQUE_MCP_OAUTH_TOKEN_PATTERN.test(url.searchParams.get("setup") ?? ""));
|
|
412
412
|
}),
|
|
413
413
|
})
|
|
414
|
-
.
|
|
414
|
+
.strip();
|
|
415
415
|
export const approveMcpOauthAuthorizationBodySchema = z
|
|
416
416
|
.object({ setupToken: z.string().regex(OPAQUE_MCP_OAUTH_TOKEN_PATTERN) })
|
|
417
417
|
.strict();
|
|
@@ -422,12 +422,12 @@ export const mcpConnectionLiveDetailsSchema = z
|
|
|
422
422
|
name: z.string().trim().min(1).max(MAX_MCP_SERVER_NAME_LENGTH),
|
|
423
423
|
version: z.string().trim().min(1).max(MAX_MCP_SERVER_VERSION_LENGTH),
|
|
424
424
|
})
|
|
425
|
-
.
|
|
425
|
+
.strip(),
|
|
426
426
|
toolNames: z
|
|
427
427
|
.array(z.string().trim().min(1).max(MAX_MCP_TOOL_NAME_LENGTH))
|
|
428
428
|
.max(MAX_MCP_TOOLS_PER_CONNECTION),
|
|
429
429
|
})
|
|
430
|
-
.
|
|
430
|
+
.strip();
|
|
431
431
|
const mcpConnectionTestOkResponseSchema = mcpConnectionLiveDetailsSchema
|
|
432
432
|
.extend({
|
|
433
433
|
ok: z.literal(true),
|
|
@@ -438,7 +438,7 @@ const mcpConnectionTestOkResponseSchema = mcpConnectionLiveDetailsSchema
|
|
|
438
438
|
.max(MAX_MCP_CONNECTION_TEST_LATENCY_MS),
|
|
439
439
|
toolCount: z.number().int().nonnegative().max(MAX_MCP_TOOLS_PER_CONNECTION),
|
|
440
440
|
})
|
|
441
|
-
.
|
|
441
|
+
.strip()
|
|
442
442
|
.refine((result) => result.toolCount === result.toolNames.length, {
|
|
443
443
|
message: "toolCount must match toolNames length",
|
|
444
444
|
});
|
|
@@ -450,9 +450,9 @@ const mcpConnectionTestFailResponseSchema = z
|
|
|
450
450
|
code: mcpConnectionTestErrorCodeSchema,
|
|
451
451
|
message: z.string().trim().min(1).max(200),
|
|
452
452
|
})
|
|
453
|
-
.
|
|
453
|
+
.strip(),
|
|
454
454
|
})
|
|
455
|
-
.
|
|
455
|
+
.strip();
|
|
456
456
|
export const mcpConnectionTestResponseSchema = z.discriminatedUnion("ok", [
|
|
457
457
|
mcpConnectionTestOkResponseSchema,
|
|
458
458
|
mcpConnectionTestFailResponseSchema,
|
|
@@ -463,11 +463,11 @@ export const mcpConnectionReconnectResultSchema = z.discriminatedUnion("status",
|
|
|
463
463
|
status: z.literal("connected"),
|
|
464
464
|
connection: mcpConnectionResponseSchema,
|
|
465
465
|
})
|
|
466
|
-
.
|
|
466
|
+
.strip(),
|
|
467
467
|
z
|
|
468
468
|
.object({
|
|
469
469
|
status: z.literal("needs_auth"),
|
|
470
470
|
connection: mcpConnectionResponseSchema,
|
|
471
471
|
})
|
|
472
|
-
.
|
|
472
|
+
.strip(),
|
|
473
473
|
]);
|
|
@@ -9,7 +9,7 @@ export declare const memorySchema: z.ZodObject<{
|
|
|
9
9
|
createdAt: z.ZodISODateTime;
|
|
10
10
|
updatedAt: z.ZodISODateTime;
|
|
11
11
|
lastAccessedAt: z.ZodISODateTime;
|
|
12
|
-
}, z.core.$
|
|
12
|
+
}, z.core.$strip>;
|
|
13
13
|
export declare const memoryResponseSchema: z.ZodObject<{
|
|
14
14
|
memory: z.ZodObject<{
|
|
15
15
|
id: z.ZodString;
|
|
@@ -20,8 +20,8 @@ export declare const memoryResponseSchema: z.ZodObject<{
|
|
|
20
20
|
createdAt: z.ZodISODateTime;
|
|
21
21
|
updatedAt: z.ZodISODateTime;
|
|
22
22
|
lastAccessedAt: z.ZodISODateTime;
|
|
23
|
-
}, z.core.$
|
|
24
|
-
}, z.core.$
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
25
|
export declare const memoriesListResponseSchema: z.ZodObject<{
|
|
26
26
|
data: z.ZodArray<z.ZodObject<{
|
|
27
27
|
id: z.ZodString;
|
|
@@ -32,9 +32,9 @@ export declare const memoriesListResponseSchema: z.ZodObject<{
|
|
|
32
32
|
createdAt: z.ZodISODateTime;
|
|
33
33
|
updatedAt: z.ZodISODateTime;
|
|
34
34
|
lastAccessedAt: z.ZodISODateTime;
|
|
35
|
-
}, z.core.$
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
36
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
37
|
-
}, z.core.$
|
|
37
|
+
}, z.core.$strip>;
|
|
38
38
|
export declare const memoriesListQuerySchema: z.ZodObject<{
|
|
39
39
|
userId: z.ZodOptional<z.ZodString>;
|
|
40
40
|
search: z.ZodOptional<z.ZodString>;
|
|
@@ -29,12 +29,12 @@ export const memorySchema = z
|
|
|
29
29
|
updatedAt: z.iso.datetime({ offset: true }),
|
|
30
30
|
lastAccessedAt: z.iso.datetime({ offset: true }),
|
|
31
31
|
})
|
|
32
|
-
.
|
|
32
|
+
.strip();
|
|
33
33
|
export const memoryResponseSchema = z
|
|
34
34
|
.object({
|
|
35
35
|
memory: memorySchema,
|
|
36
36
|
})
|
|
37
|
-
.
|
|
37
|
+
.strip();
|
|
38
38
|
export const memoriesListResponseSchema = paginatedResponseSchema(memorySchema);
|
|
39
39
|
export const memoriesListQuerySchema = z
|
|
40
40
|
.object({
|
|
@@ -17,7 +17,7 @@ export declare const promptSchema: z.ZodObject<{
|
|
|
17
17
|
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
18
18
|
createdAt: z.ZodISODateTime;
|
|
19
19
|
updatedAt: z.ZodISODateTime;
|
|
20
|
-
}, z.core.$
|
|
20
|
+
}, z.core.$strip>;
|
|
21
21
|
export declare const promptsResponseSchema: z.ZodObject<{
|
|
22
22
|
prompts: z.ZodArray<z.ZodObject<{
|
|
23
23
|
id: z.ZodString;
|
|
@@ -29,8 +29,8 @@ export declare const promptsResponseSchema: z.ZodObject<{
|
|
|
29
29
|
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
30
30
|
createdAt: z.ZodISODateTime;
|
|
31
31
|
updatedAt: z.ZodISODateTime;
|
|
32
|
-
}, z.core.$
|
|
33
|
-
}, z.core.$
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
34
|
export declare const promptResponseSchema: z.ZodObject<{
|
|
35
35
|
id: z.ZodString;
|
|
36
36
|
tenantId: z.ZodString;
|
|
@@ -41,7 +41,7 @@ export declare const promptResponseSchema: z.ZodObject<{
|
|
|
41
41
|
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
42
42
|
createdAt: z.ZodISODateTime;
|
|
43
43
|
updatedAt: z.ZodISODateTime;
|
|
44
|
-
}, z.core.$
|
|
44
|
+
}, z.core.$strip>;
|
|
45
45
|
export declare const createPromptBodySchema: z.ZodObject<{
|
|
46
46
|
name: z.ZodString;
|
|
47
47
|
template: z.ZodString;
|
|
@@ -57,12 +57,12 @@ export const promptSchema = z
|
|
|
57
57
|
createdAt: z.iso.datetime({ offset: true }),
|
|
58
58
|
updatedAt: z.iso.datetime({ offset: true }),
|
|
59
59
|
})
|
|
60
|
-
.
|
|
60
|
+
.strip();
|
|
61
61
|
export const promptsResponseSchema = z
|
|
62
62
|
.object({
|
|
63
63
|
prompts: z.array(promptSchema),
|
|
64
64
|
})
|
|
65
|
-
.
|
|
65
|
+
.strip();
|
|
66
66
|
export const promptResponseSchema = promptSchema;
|
|
67
67
|
export const createPromptBodySchema = z
|
|
68
68
|
.object({
|
|
@@ -55,7 +55,7 @@ export declare const providerResponseSchema: z.ZodObject<{
|
|
|
55
55
|
keyFragment: z.ZodString;
|
|
56
56
|
createdAt: z.ZodISODateTime;
|
|
57
57
|
updatedAt: z.ZodISODateTime;
|
|
58
|
-
}, z.core.$
|
|
58
|
+
}, z.core.$strip>;
|
|
59
59
|
export declare const providersResponseSchema: z.ZodObject<{
|
|
60
60
|
providers: z.ZodArray<z.ZodObject<{
|
|
61
61
|
id: z.ZodString;
|
|
@@ -72,21 +72,21 @@ export declare const providersResponseSchema: z.ZodObject<{
|
|
|
72
72
|
keyFragment: z.ZodString;
|
|
73
73
|
createdAt: z.ZodISODateTime;
|
|
74
74
|
updatedAt: z.ZodISODateTime;
|
|
75
|
-
}, z.core.$
|
|
76
|
-
}, z.core.$
|
|
75
|
+
}, z.core.$strip>>;
|
|
76
|
+
}, z.core.$strip>;
|
|
77
77
|
export declare const providerModelsResponseSchema: z.ZodObject<{
|
|
78
78
|
models: z.ZodArray<z.ZodObject<{
|
|
79
79
|
id: z.ZodString;
|
|
80
|
-
}, z.core.$
|
|
81
|
-
}, z.core.$
|
|
80
|
+
}, z.core.$strip>>;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
82
|
export declare const providerHistoricalUseDetailsSchema: z.ZodObject<{
|
|
83
83
|
agentVersions: z.ZodArray<z.ZodObject<{
|
|
84
84
|
agentId: z.ZodString;
|
|
85
85
|
version: z.ZodNumber;
|
|
86
|
-
}, z.core.$
|
|
86
|
+
}, z.core.$strip>>;
|
|
87
87
|
sessionIds: z.ZodArray<z.ZodString>;
|
|
88
88
|
taskIds: z.ZodArray<z.ZodString>;
|
|
89
|
-
}, z.core.$
|
|
89
|
+
}, z.core.$strip>;
|
|
90
90
|
/**
|
|
91
91
|
* `POST /v1/providers` — name, type, optional base URL, and the API key
|
|
92
92
|
* (plaintext, never stored — goes to Vault). `custom` providers require a
|
|
@@ -121,3 +121,8 @@ export interface DeleteProviderOptions {
|
|
|
121
121
|
export type ProviderResponse = z.infer<typeof providerResponseSchema>;
|
|
122
122
|
export type CreateProviderBody = z.infer<typeof createProviderBodySchema>;
|
|
123
123
|
export type UpdateProviderBody = z.infer<typeof updateProviderBodySchema>;
|
|
124
|
+
export declare const thinkingLevelsResponseSchema: z.ZodObject<{
|
|
125
|
+
known: z.ZodBoolean;
|
|
126
|
+
levels: z.ZodArray<z.ZodString>;
|
|
127
|
+
}, z.core.$strip>;
|
|
128
|
+
export type ThinkingLevelsResponse = z.infer<typeof thinkingLevelsResponseSchema>;
|
|
@@ -53,21 +53,21 @@ export const providerResponseSchema = z
|
|
|
53
53
|
createdAt: z.iso.datetime({ offset: true }),
|
|
54
54
|
updatedAt: z.iso.datetime({ offset: true }),
|
|
55
55
|
})
|
|
56
|
-
.
|
|
56
|
+
.strip();
|
|
57
57
|
export const providersResponseSchema = z
|
|
58
58
|
.object({
|
|
59
59
|
providers: z.array(providerResponseSchema),
|
|
60
60
|
})
|
|
61
|
-
.
|
|
61
|
+
.strip();
|
|
62
62
|
export const providerModelsResponseSchema = z
|
|
63
63
|
.object({
|
|
64
64
|
models: z.array(z
|
|
65
65
|
.object({
|
|
66
66
|
id: z.string().trim().min(1),
|
|
67
67
|
})
|
|
68
|
-
.
|
|
68
|
+
.strip()),
|
|
69
69
|
})
|
|
70
|
-
.
|
|
70
|
+
.strip();
|
|
71
71
|
export const providerHistoricalUseDetailsSchema = z
|
|
72
72
|
.object({
|
|
73
73
|
agentVersions: z.array(z
|
|
@@ -75,11 +75,11 @@ export const providerHistoricalUseDetailsSchema = z
|
|
|
75
75
|
agentId: agentIdSchema,
|
|
76
76
|
version: agentVersionNumberSchema,
|
|
77
77
|
})
|
|
78
|
-
.
|
|
78
|
+
.strip()),
|
|
79
79
|
sessionIds: z.array(sessionIdSchema),
|
|
80
80
|
taskIds: z.array(taskIdSchema),
|
|
81
81
|
})
|
|
82
|
-
.
|
|
82
|
+
.strip();
|
|
83
83
|
/**
|
|
84
84
|
* `POST /v1/providers` — name, type, optional base URL, and the API key
|
|
85
85
|
* (plaintext, never stored — goes to Vault). `custom` providers require a
|
|
@@ -109,3 +109,9 @@ export const updateProviderBodySchema = z
|
|
|
109
109
|
name: providerNameSchema,
|
|
110
110
|
})
|
|
111
111
|
.strict();
|
|
112
|
+
export const thinkingLevelsResponseSchema = z
|
|
113
|
+
.object({
|
|
114
|
+
known: z.boolean(),
|
|
115
|
+
levels: z.array(z.string().min(1)),
|
|
116
|
+
})
|
|
117
|
+
.strip();
|