@blazingagents/sdk 0.7.0 → 0.9.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 +55 -1
- package/dist/client.d.ts +2 -1
- package/dist/client.js +3 -0
- package/dist/contracts/entities/agent-approval.d.ts +72 -0
- package/dist/contracts/entities/agent-approval.js +54 -0
- package/dist/contracts/entities/agents.d.ts +547 -1
- package/dist/contracts/entities/agents.js +16 -0
- package/dist/contracts/entities/chat-connections.d.ts +202 -0
- package/dist/contracts/entities/chat-connections.js +142 -0
- package/dist/contracts/entities/sessions.d.ts +52 -0
- package/dist/contracts/entities/sessions.js +5 -0
- package/dist/contracts/ids.d.ts +1 -0
- package/dist/contracts/ids.js +1 -0
- package/dist/contracts/index.d.ts +3 -0
- package/dist/contracts/index.js +2 -0
- package/dist/index.d.ts +4 -1
- package/dist/resources/agents.js +2 -0
- package/dist/resources/chat-connections.d.ts +2 -0
- package/dist/resources/chat-connections.js +33 -0
- package/dist/types.d.ts +26 -0
- package/package.json +1 -1
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const chatCredentialsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
platform: z.ZodLiteral<"slack">;
|
|
4
|
+
botToken: z.ZodString;
|
|
5
|
+
signingSecret: z.ZodString;
|
|
6
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
7
|
+
platform: z.ZodLiteral<"telegram">;
|
|
8
|
+
botToken: z.ZodString;
|
|
9
|
+
webhookSecret: z.ZodString;
|
|
10
|
+
}, z.core.$strict>], "platform">;
|
|
11
|
+
export declare const chatConfigurationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
12
|
+
teamId: z.ZodString;
|
|
13
|
+
appId: z.ZodString;
|
|
14
|
+
webhookUrl: z.ZodURL;
|
|
15
|
+
channelIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
16
|
+
platform: z.ZodLiteral<"slack">;
|
|
17
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
18
|
+
botId: z.ZodString;
|
|
19
|
+
webhookUrl: z.ZodURL;
|
|
20
|
+
chatIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
21
|
+
platform: z.ZodLiteral<"telegram">;
|
|
22
|
+
}, z.core.$strict>], "platform">;
|
|
23
|
+
export declare const createChatConnectionBodySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
24
|
+
agentId: z.ZodString;
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
27
|
+
platform: z.ZodLiteral<"slack">;
|
|
28
|
+
configuration: z.ZodObject<{
|
|
29
|
+
teamId: z.ZodString;
|
|
30
|
+
appId: z.ZodString;
|
|
31
|
+
webhookUrl: z.ZodURL;
|
|
32
|
+
channelIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
33
|
+
}, z.core.$strict>;
|
|
34
|
+
credentials: z.ZodObject<{
|
|
35
|
+
botToken: z.ZodString;
|
|
36
|
+
signingSecret: z.ZodString;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
39
|
+
agentId: z.ZodString;
|
|
40
|
+
name: z.ZodString;
|
|
41
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
42
|
+
platform: z.ZodLiteral<"telegram">;
|
|
43
|
+
configuration: z.ZodObject<{
|
|
44
|
+
botId: z.ZodString;
|
|
45
|
+
webhookUrl: z.ZodURL;
|
|
46
|
+
chatIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
47
|
+
}, z.core.$strict>;
|
|
48
|
+
credentials: z.ZodObject<{
|
|
49
|
+
botToken: z.ZodString;
|
|
50
|
+
webhookSecret: z.ZodString;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
}, z.core.$strict>], "platform">;
|
|
53
|
+
export declare const rotateChatConnectionBodySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
54
|
+
platform: z.ZodLiteral<"slack">;
|
|
55
|
+
botToken: z.ZodString;
|
|
56
|
+
signingSecret: z.ZodString;
|
|
57
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
58
|
+
platform: z.ZodLiteral<"telegram">;
|
|
59
|
+
botToken: z.ZodString;
|
|
60
|
+
webhookSecret: z.ZodString;
|
|
61
|
+
}, z.core.$strict>], "platform">;
|
|
62
|
+
export declare const updateChatConnectionBodySchema: z.ZodObject<{
|
|
63
|
+
name: z.ZodOptional<z.ZodString>;
|
|
64
|
+
webhookUrl: z.ZodOptional<z.ZodURL>;
|
|
65
|
+
}, z.core.$strict>;
|
|
66
|
+
export declare const chatConnectionParamsSchema: z.ZodObject<{
|
|
67
|
+
id: z.ZodString;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
export declare const chatHealthCheckSchema: z.ZodObject<{
|
|
70
|
+
code: z.ZodString;
|
|
71
|
+
status: z.ZodEnum<{
|
|
72
|
+
fail: "fail";
|
|
73
|
+
pass: "pass";
|
|
74
|
+
unknown: "unknown";
|
|
75
|
+
}>;
|
|
76
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
export declare const chatHealthSchema: z.ZodObject<{
|
|
79
|
+
checkedAt: z.ZodString;
|
|
80
|
+
tokenValid: z.ZodBoolean;
|
|
81
|
+
identityVerified: z.ZodBoolean;
|
|
82
|
+
checks: z.ZodArray<z.ZodObject<{
|
|
83
|
+
code: z.ZodString;
|
|
84
|
+
status: z.ZodEnum<{
|
|
85
|
+
fail: "fail";
|
|
86
|
+
pass: "pass";
|
|
87
|
+
unknown: "unknown";
|
|
88
|
+
}>;
|
|
89
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
90
|
+
}, z.core.$strip>>;
|
|
91
|
+
}, z.core.$strip>;
|
|
92
|
+
export declare const chatIdentitySchema: z.ZodObject<{
|
|
93
|
+
botId: z.ZodString;
|
|
94
|
+
botUserId: z.ZodString;
|
|
95
|
+
teamId: z.ZodNullable<z.ZodString>;
|
|
96
|
+
appId: z.ZodNullable<z.ZodString>;
|
|
97
|
+
}, z.core.$strip>;
|
|
98
|
+
export declare const chatConnectionSchema: z.ZodObject<{
|
|
99
|
+
id: z.ZodString;
|
|
100
|
+
tenantId: z.ZodString;
|
|
101
|
+
agentId: z.ZodString;
|
|
102
|
+
name: z.ZodString;
|
|
103
|
+
platform: z.ZodEnum<{
|
|
104
|
+
slack: "slack";
|
|
105
|
+
telegram: "telegram";
|
|
106
|
+
}>;
|
|
107
|
+
enabled: z.ZodBoolean;
|
|
108
|
+
configuration: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
109
|
+
teamId: z.ZodString;
|
|
110
|
+
appId: z.ZodString;
|
|
111
|
+
webhookUrl: z.ZodURL;
|
|
112
|
+
channelIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
113
|
+
platform: z.ZodLiteral<"slack">;
|
|
114
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
115
|
+
botId: z.ZodString;
|
|
116
|
+
webhookUrl: z.ZodURL;
|
|
117
|
+
chatIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
118
|
+
platform: z.ZodLiteral<"telegram">;
|
|
119
|
+
}, z.core.$strip>], "platform">;
|
|
120
|
+
identity: z.ZodObject<{
|
|
121
|
+
botId: z.ZodString;
|
|
122
|
+
botUserId: z.ZodString;
|
|
123
|
+
teamId: z.ZodNullable<z.ZodString>;
|
|
124
|
+
appId: z.ZodNullable<z.ZodString>;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
health: z.ZodObject<{
|
|
127
|
+
checkedAt: z.ZodString;
|
|
128
|
+
tokenValid: z.ZodBoolean;
|
|
129
|
+
identityVerified: z.ZodBoolean;
|
|
130
|
+
checks: z.ZodArray<z.ZodObject<{
|
|
131
|
+
code: z.ZodString;
|
|
132
|
+
status: z.ZodEnum<{
|
|
133
|
+
fail: "fail";
|
|
134
|
+
pass: "pass";
|
|
135
|
+
unknown: "unknown";
|
|
136
|
+
}>;
|
|
137
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
138
|
+
}, z.core.$strip>>;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
credentialFragment: z.ZodString;
|
|
141
|
+
credentialVersion: z.ZodNumber;
|
|
142
|
+
createdAt: z.ZodString;
|
|
143
|
+
updatedAt: z.ZodString;
|
|
144
|
+
}, z.core.$strip>;
|
|
145
|
+
export type CreateChatConnectionBody = z.input<typeof createChatConnectionBodySchema>;
|
|
146
|
+
export type ChatCredentials = z.output<typeof chatCredentialsSchema>;
|
|
147
|
+
export type ChatConfiguration = z.output<typeof chatConfigurationSchema>;
|
|
148
|
+
export type ChatHealth = z.output<typeof chatHealthSchema>;
|
|
149
|
+
export type ChatIdentity = z.output<typeof chatIdentitySchema>;
|
|
150
|
+
export type ChatConnection = z.output<typeof chatConnectionSchema>;
|
|
151
|
+
export type UpdateChatConnectionBody = z.output<typeof updateChatConnectionBodySchema>;
|
|
152
|
+
export declare const chatConnectionsResponseSchema: z.ZodObject<{
|
|
153
|
+
chatConnections: z.ZodArray<z.ZodObject<{
|
|
154
|
+
id: z.ZodString;
|
|
155
|
+
tenantId: z.ZodString;
|
|
156
|
+
agentId: z.ZodString;
|
|
157
|
+
name: z.ZodString;
|
|
158
|
+
platform: z.ZodEnum<{
|
|
159
|
+
slack: "slack";
|
|
160
|
+
telegram: "telegram";
|
|
161
|
+
}>;
|
|
162
|
+
enabled: z.ZodBoolean;
|
|
163
|
+
configuration: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
164
|
+
teamId: z.ZodString;
|
|
165
|
+
appId: z.ZodString;
|
|
166
|
+
webhookUrl: z.ZodURL;
|
|
167
|
+
channelIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
168
|
+
platform: z.ZodLiteral<"slack">;
|
|
169
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
170
|
+
botId: z.ZodString;
|
|
171
|
+
webhookUrl: z.ZodURL;
|
|
172
|
+
chatIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
173
|
+
platform: z.ZodLiteral<"telegram">;
|
|
174
|
+
}, z.core.$strip>], "platform">;
|
|
175
|
+
identity: z.ZodObject<{
|
|
176
|
+
botId: z.ZodString;
|
|
177
|
+
botUserId: z.ZodString;
|
|
178
|
+
teamId: z.ZodNullable<z.ZodString>;
|
|
179
|
+
appId: z.ZodNullable<z.ZodString>;
|
|
180
|
+
}, z.core.$strip>;
|
|
181
|
+
health: z.ZodObject<{
|
|
182
|
+
checkedAt: z.ZodString;
|
|
183
|
+
tokenValid: z.ZodBoolean;
|
|
184
|
+
identityVerified: z.ZodBoolean;
|
|
185
|
+
checks: z.ZodArray<z.ZodObject<{
|
|
186
|
+
code: z.ZodString;
|
|
187
|
+
status: z.ZodEnum<{
|
|
188
|
+
fail: "fail";
|
|
189
|
+
pass: "pass";
|
|
190
|
+
unknown: "unknown";
|
|
191
|
+
}>;
|
|
192
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
193
|
+
}, z.core.$strip>>;
|
|
194
|
+
}, z.core.$strip>;
|
|
195
|
+
credentialFragment: z.ZodString;
|
|
196
|
+
credentialVersion: z.ZodNumber;
|
|
197
|
+
createdAt: z.ZodString;
|
|
198
|
+
updatedAt: z.ZodString;
|
|
199
|
+
}, z.core.$strip>>;
|
|
200
|
+
}, z.core.$strip>;
|
|
201
|
+
export type ChatConnectionsResponse = z.output<typeof chatConnectionsResponseSchema>;
|
|
202
|
+
export type RotateChatConnectionBody = z.input<typeof rotateChatConnectionBodySchema>;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { agentIdSchema, chatConnectionIdSchema, tenantIdSchema, } from "../ids.js";
|
|
3
|
+
const webhookUrl = z
|
|
4
|
+
.url()
|
|
5
|
+
.max(2048)
|
|
6
|
+
.refine((value) => {
|
|
7
|
+
const url = new URL(value);
|
|
8
|
+
return (url.protocol === "https:" &&
|
|
9
|
+
!url.username &&
|
|
10
|
+
!url.password &&
|
|
11
|
+
!url.search &&
|
|
12
|
+
!url.hash);
|
|
13
|
+
}, "Use an HTTPS callback URL without credentials, query or fragment");
|
|
14
|
+
const secret = z
|
|
15
|
+
.string()
|
|
16
|
+
.min(8)
|
|
17
|
+
.max(8192)
|
|
18
|
+
.regex(/^[!-~]+$/);
|
|
19
|
+
export const chatCredentialsSchema = z.discriminatedUnion("platform", [
|
|
20
|
+
z
|
|
21
|
+
.object({
|
|
22
|
+
platform: z.literal("slack"),
|
|
23
|
+
botToken: secret,
|
|
24
|
+
signingSecret: z.string().regex(/^[0-9a-f]{32}$/),
|
|
25
|
+
})
|
|
26
|
+
.strict(),
|
|
27
|
+
z
|
|
28
|
+
.object({
|
|
29
|
+
platform: z.literal("telegram"),
|
|
30
|
+
botToken: z.string().regex(/^\d+:[A-Za-z0-9_-]+$/),
|
|
31
|
+
webhookSecret: z
|
|
32
|
+
.string()
|
|
33
|
+
.min(1)
|
|
34
|
+
.max(256)
|
|
35
|
+
.regex(/^[A-Za-z0-9_-]+$/),
|
|
36
|
+
})
|
|
37
|
+
.strict(),
|
|
38
|
+
]);
|
|
39
|
+
const slackConfiguration = z
|
|
40
|
+
.object({
|
|
41
|
+
teamId: z.string().regex(/^T[A-Z0-9]+$/),
|
|
42
|
+
appId: z.string().regex(/^A[A-Z0-9]+$/),
|
|
43
|
+
webhookUrl,
|
|
44
|
+
channelIds: z
|
|
45
|
+
.array(z.string().regex(/^[CG][A-Z0-9]+$/))
|
|
46
|
+
.max(20)
|
|
47
|
+
.default([]),
|
|
48
|
+
})
|
|
49
|
+
.strict();
|
|
50
|
+
const telegramConfiguration = z
|
|
51
|
+
.object({
|
|
52
|
+
botId: z.string().regex(/^\d+$/),
|
|
53
|
+
webhookUrl,
|
|
54
|
+
chatIds: z
|
|
55
|
+
.array(z.string().regex(/^-?\d+$/))
|
|
56
|
+
.max(20)
|
|
57
|
+
.default([]),
|
|
58
|
+
})
|
|
59
|
+
.strict();
|
|
60
|
+
export const chatConfigurationSchema = z.discriminatedUnion("platform", [
|
|
61
|
+
slackConfiguration.extend({ platform: z.literal("slack") }),
|
|
62
|
+
telegramConfiguration.extend({ platform: z.literal("telegram") }),
|
|
63
|
+
]);
|
|
64
|
+
const common = {
|
|
65
|
+
agentId: agentIdSchema,
|
|
66
|
+
name: z.string().trim().min(1).max(80),
|
|
67
|
+
enabled: z.boolean().default(true),
|
|
68
|
+
};
|
|
69
|
+
export const createChatConnectionBodySchema = z.discriminatedUnion("platform", [
|
|
70
|
+
z
|
|
71
|
+
.object({
|
|
72
|
+
...common,
|
|
73
|
+
platform: z.literal("slack"),
|
|
74
|
+
configuration: slackConfiguration,
|
|
75
|
+
credentials: chatCredentialsSchema.options[0].omit({ platform: true }),
|
|
76
|
+
})
|
|
77
|
+
.strict(),
|
|
78
|
+
z
|
|
79
|
+
.object({
|
|
80
|
+
...common,
|
|
81
|
+
platform: z.literal("telegram"),
|
|
82
|
+
configuration: telegramConfiguration,
|
|
83
|
+
credentials: chatCredentialsSchema.options[1].omit({ platform: true }),
|
|
84
|
+
})
|
|
85
|
+
.strict(),
|
|
86
|
+
]);
|
|
87
|
+
export const rotateChatConnectionBodySchema = chatCredentialsSchema;
|
|
88
|
+
export const updateChatConnectionBodySchema = z
|
|
89
|
+
.object({ name: common.name.optional(), webhookUrl: webhookUrl.optional() })
|
|
90
|
+
.strict()
|
|
91
|
+
.refine((body) => body.name !== undefined || body.webhookUrl !== undefined, {
|
|
92
|
+
message: "Provide a name or webhook URL",
|
|
93
|
+
});
|
|
94
|
+
export const chatConnectionParamsSchema = z.object({
|
|
95
|
+
id: chatConnectionIdSchema,
|
|
96
|
+
});
|
|
97
|
+
export const chatHealthCheckSchema = z
|
|
98
|
+
.object({
|
|
99
|
+
code: z.string(),
|
|
100
|
+
status: z.enum(["pass", "fail", "unknown"]),
|
|
101
|
+
subject: z.string().optional(),
|
|
102
|
+
})
|
|
103
|
+
.strip();
|
|
104
|
+
export const chatHealthSchema = z
|
|
105
|
+
.object({
|
|
106
|
+
checkedAt: z.string(),
|
|
107
|
+
tokenValid: z.boolean(),
|
|
108
|
+
identityVerified: z.boolean(),
|
|
109
|
+
checks: z.array(chatHealthCheckSchema),
|
|
110
|
+
})
|
|
111
|
+
.strip();
|
|
112
|
+
export const chatIdentitySchema = z
|
|
113
|
+
.object({
|
|
114
|
+
botId: z.string(),
|
|
115
|
+
botUserId: z.string(),
|
|
116
|
+
teamId: z.string().nullable(),
|
|
117
|
+
appId: z.string().nullable(),
|
|
118
|
+
})
|
|
119
|
+
.strip();
|
|
120
|
+
export const chatConnectionSchema = z
|
|
121
|
+
.object({
|
|
122
|
+
id: chatConnectionIdSchema,
|
|
123
|
+
tenantId: tenantIdSchema,
|
|
124
|
+
agentId: agentIdSchema,
|
|
125
|
+
name: common.name,
|
|
126
|
+
platform: z.enum(["slack", "telegram"]),
|
|
127
|
+
enabled: z.boolean(),
|
|
128
|
+
configuration: z.discriminatedUnion("platform", [
|
|
129
|
+
chatConfigurationSchema.options[0].strip(),
|
|
130
|
+
chatConfigurationSchema.options[1].strip(),
|
|
131
|
+
]),
|
|
132
|
+
identity: chatIdentitySchema,
|
|
133
|
+
health: chatHealthSchema,
|
|
134
|
+
credentialFragment: z.string().max(4),
|
|
135
|
+
credentialVersion: z.number().int().nonnegative(),
|
|
136
|
+
createdAt: z.string(),
|
|
137
|
+
updatedAt: z.string(),
|
|
138
|
+
})
|
|
139
|
+
.strip();
|
|
140
|
+
export const chatConnectionsResponseSchema = z
|
|
141
|
+
.object({ chatConnections: z.array(chatConnectionSchema) })
|
|
142
|
+
.strip();
|
|
@@ -132,6 +132,32 @@ export declare const toolApprovalContinuationStateSchema: z.ZodEnum<{
|
|
|
132
132
|
waiting: "waiting";
|
|
133
133
|
}>;
|
|
134
134
|
export declare const toolApprovalStateSchema: z.ZodObject<{
|
|
135
|
+
tool: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
136
|
+
type: z.ZodLiteral<"builtin">;
|
|
137
|
+
name: z.ZodEnum<{
|
|
138
|
+
activate_skill: "activate_skill";
|
|
139
|
+
bash: "bash";
|
|
140
|
+
delete_memory: "delete_memory";
|
|
141
|
+
edit: "edit";
|
|
142
|
+
get_memory: "get_memory";
|
|
143
|
+
glob: "glob";
|
|
144
|
+
grep: "grep";
|
|
145
|
+
publish_artifacts: "publish_artifacts";
|
|
146
|
+
read: "read";
|
|
147
|
+
save_memory: "save_memory";
|
|
148
|
+
search_memories: "search_memories";
|
|
149
|
+
update_memory: "update_memory";
|
|
150
|
+
write: "write";
|
|
151
|
+
write_todos: "write_todos";
|
|
152
|
+
}>;
|
|
153
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
154
|
+
type: z.ZodLiteral<"mcp">;
|
|
155
|
+
connectionId: z.ZodString;
|
|
156
|
+
name: z.ZodString;
|
|
157
|
+
}, z.core.$strict>], "type">>>;
|
|
158
|
+
assistantMessageId: z.ZodOptional<z.ZodString>;
|
|
159
|
+
createdAt: z.ZodOptional<z.ZodISODateTime>;
|
|
160
|
+
decidedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
135
161
|
approvalId: z.ZodString;
|
|
136
162
|
decision: z.ZodEnum<{
|
|
137
163
|
approved: "approved";
|
|
@@ -155,6 +181,32 @@ export declare const toolApprovalContinuationSchema: z.ZodObject<{
|
|
|
155
181
|
}, z.core.$strip>;
|
|
156
182
|
export declare const toolApprovalsResponseSchema: z.ZodObject<{
|
|
157
183
|
data: z.ZodArray<z.ZodObject<{
|
|
184
|
+
tool: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
185
|
+
type: z.ZodLiteral<"builtin">;
|
|
186
|
+
name: z.ZodEnum<{
|
|
187
|
+
activate_skill: "activate_skill";
|
|
188
|
+
bash: "bash";
|
|
189
|
+
delete_memory: "delete_memory";
|
|
190
|
+
edit: "edit";
|
|
191
|
+
get_memory: "get_memory";
|
|
192
|
+
glob: "glob";
|
|
193
|
+
grep: "grep";
|
|
194
|
+
publish_artifacts: "publish_artifacts";
|
|
195
|
+
read: "read";
|
|
196
|
+
save_memory: "save_memory";
|
|
197
|
+
search_memories: "search_memories";
|
|
198
|
+
update_memory: "update_memory";
|
|
199
|
+
write: "write";
|
|
200
|
+
write_todos: "write_todos";
|
|
201
|
+
}>;
|
|
202
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
203
|
+
type: z.ZodLiteral<"mcp">;
|
|
204
|
+
connectionId: z.ZodString;
|
|
205
|
+
name: z.ZodString;
|
|
206
|
+
}, z.core.$strict>], "type">>>;
|
|
207
|
+
assistantMessageId: z.ZodOptional<z.ZodString>;
|
|
208
|
+
createdAt: z.ZodOptional<z.ZodISODateTime>;
|
|
209
|
+
decidedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
158
210
|
approvalId: z.ZodString;
|
|
159
211
|
decision: z.ZodEnum<{
|
|
160
212
|
approved: "approved";
|
|
@@ -2,6 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { paginatedResponseSchema } from "../api.js";
|
|
3
3
|
import { agentIdSchema, sessionIdSchema } from "../ids.js";
|
|
4
4
|
import { DEFAULT_SESSION_MESSAGES_LIMIT, MAX_SESSION_MESSAGES_LIMIT, } from "../limitations.js";
|
|
5
|
+
import { toolReferenceSchema } from "./agent-approval.js";
|
|
5
6
|
import { agentSchema, agentVersionNumberSchema } from "./agents.js";
|
|
6
7
|
import { metadataSchema, userIdSchema } from "./attribution.js";
|
|
7
8
|
/**
|
|
@@ -107,6 +108,10 @@ export const toolApprovalContinuationStateSchema = z.enum([
|
|
|
107
108
|
]);
|
|
108
109
|
export const toolApprovalStateSchema = z
|
|
109
110
|
.object({
|
|
111
|
+
tool: toolReferenceSchema.nullable().optional(),
|
|
112
|
+
assistantMessageId: z.string().min(1).optional(),
|
|
113
|
+
createdAt: z.iso.datetime({ offset: true }).optional(),
|
|
114
|
+
decidedAt: z.iso.datetime({ offset: true }).nullable().optional(),
|
|
110
115
|
approvalId: z.string().min(1),
|
|
111
116
|
decision: z.enum(["pending", "approved", "denied"]),
|
|
112
117
|
input: z.json(),
|
package/dist/contracts/ids.d.ts
CHANGED
|
@@ -55,3 +55,4 @@ export declare const apiKeyDigestSchema: z.ZodString;
|
|
|
55
55
|
export declare const apiKeyFragmentSchema: z.ZodString;
|
|
56
56
|
export declare const providerKeyFragmentSchema: z.ZodString;
|
|
57
57
|
export type TurnId = z.infer<typeof turnIdSchema>;
|
|
58
|
+
export declare const chatConnectionIdSchema: z.ZodString;
|
package/dist/contracts/ids.js
CHANGED
|
@@ -77,3 +77,4 @@ export const apiKeyDigestSchema = z.string().regex(/^[0-9a-f]{64}$/);
|
|
|
77
77
|
export const apiKeyFragmentSchema = z.string().regex(/^ba_[0-9A-Za-z]{2}$/);
|
|
78
78
|
// Provider key fragment — last 4 chars of the secret, display-only.
|
|
79
79
|
export const providerKeyFragmentSchema = z.string().min(1).max(4);
|
|
80
|
+
export const chatConnectionIdSchema = z.string().regex(/^cc_[0-9A-Za-z]{16}$/);
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/** Public runtime schemas for the Blazing Agents HTTP API. */
|
|
2
2
|
export { receivedApiErrorResponseSchema } from "./api.ts";
|
|
3
|
+
export type { ApprovalDecision, ApprovalPolicy, ToolReference, } from "./entities/agent-approval.ts";
|
|
4
|
+
export { approvalDecisionSchema, approvalPolicySchema, toolReferenceSchema, } from "./entities/agent-approval.ts";
|
|
3
5
|
export { agentResponseSchema, agentSchema, agentStatusSchema, agentsResponseSchema, agentVersionSchema, agentVersionsResponseSchema, createAgentBodySchema, updateAgentBodySchema, } from "./entities/agents.ts";
|
|
4
6
|
export { artifactDownloadUrlResponseSchema, artifactListItemSchema, artifactsListResponseSchema, } from "./entities/artifacts.ts";
|
|
5
7
|
export { attributionCreateInputSchema, metadataSchema, } from "./entities/attribution.ts";
|
|
6
8
|
export type { PromptVariables, UsageSummary } from "./entities/chat.ts";
|
|
7
9
|
export { blazingAgentsChatMessageMetadataSchema, chatModeSchema, chatRequestBodySchema, chatTriggerSchema, generationRequestBodySchema, jsonSchemaShapeSchema, promptVariablesSchema, usageSummarySchema, } from "./entities/chat.ts";
|
|
10
|
+
export { chatConfigurationSchema, chatConnectionSchema, chatConnectionsResponseSchema, chatCredentialsSchema, chatHealthCheckSchema, chatHealthSchema, chatIdentitySchema, createChatConnectionBodySchema, rotateChatConnectionBodySchema, updateChatConnectionBodySchema, } from "./entities/chat-connections.ts";
|
|
8
11
|
export { approveMcpOauthAuthorizationBodySchema, createMcpConnectionBodySchema, mcpAttachmentResponseSchema, mcpAttachmentsResponseSchema, mcpConnectionAuthTypeSchema, mcpConnectionOauthConnectResponseSchema, mcpConnectionReconnectResultSchema, mcpConnectionResponseSchema, mcpConnectionStatusSchema, mcpConnectionsResponseSchema, mcpConnectionTestErrorCodeSchema, mcpConnectionTestResponseSchema, mcpOauthAuthorizationLaunchResponseSchema, reconnectMcpConnectionBodySchema, updateMcpAttachmentBodySchema, updateMcpConnectionBodySchema, } from "./entities/mcp-connections.ts";
|
|
9
12
|
export { createMemoryBodySchema, memoriesListResponseSchema, memoryResponseSchema, memorySchema, updateMemoryBodySchema, } from "./entities/memories.ts";
|
|
10
13
|
export { createPromptBodySchema, promptResponseSchema, promptSchema, promptsResponseSchema, updatePromptBodySchema, } from "./entities/prompts.ts";
|
package/dist/contracts/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/** Public runtime schemas for the Blazing Agents HTTP API. */
|
|
2
2
|
// biome-ignore lint/performance/noBarrelFile: public contract entry point
|
|
3
3
|
export { receivedApiErrorResponseSchema } from "./api.js";
|
|
4
|
+
export { approvalDecisionSchema, approvalPolicySchema, toolReferenceSchema, } from "./entities/agent-approval.js";
|
|
4
5
|
export { agentResponseSchema, agentSchema, agentStatusSchema, agentsResponseSchema, agentVersionSchema, agentVersionsResponseSchema, createAgentBodySchema, updateAgentBodySchema, } from "./entities/agents.js";
|
|
5
6
|
export { artifactDownloadUrlResponseSchema, artifactListItemSchema, artifactsListResponseSchema, } from "./entities/artifacts.js";
|
|
6
7
|
export { attributionCreateInputSchema, metadataSchema, } from "./entities/attribution.js";
|
|
7
8
|
export { blazingAgentsChatMessageMetadataSchema, chatModeSchema, chatRequestBodySchema, chatTriggerSchema, generationRequestBodySchema, jsonSchemaShapeSchema, promptVariablesSchema, usageSummarySchema, } from "./entities/chat.js";
|
|
9
|
+
export { chatConfigurationSchema, chatConnectionSchema, chatConnectionsResponseSchema, chatCredentialsSchema, chatHealthCheckSchema, chatHealthSchema, chatIdentitySchema, createChatConnectionBodySchema, rotateChatConnectionBodySchema, updateChatConnectionBodySchema, } from "./entities/chat-connections.js";
|
|
8
10
|
export { approveMcpOauthAuthorizationBodySchema, createMcpConnectionBodySchema, mcpAttachmentResponseSchema, mcpAttachmentsResponseSchema, mcpConnectionAuthTypeSchema, mcpConnectionOauthConnectResponseSchema, mcpConnectionReconnectResultSchema, mcpConnectionResponseSchema, mcpConnectionStatusSchema, mcpConnectionsResponseSchema, mcpConnectionTestErrorCodeSchema, mcpConnectionTestResponseSchema, mcpOauthAuthorizationLaunchResponseSchema, reconnectMcpConnectionBodySchema, updateMcpAttachmentBodySchema, updateMcpConnectionBodySchema, } from "./entities/mcp-connections.js";
|
|
9
11
|
export { createMemoryBodySchema, memoriesListResponseSchema, memoryResponseSchema, memorySchema, updateMemoryBodySchema, } from "./entities/memories.js";
|
|
10
12
|
export { createPromptBodySchema, promptResponseSchema, promptSchema, promptsResponseSchema, updatePromptBodySchema, } from "./entities/prompts.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -9,13 +9,16 @@
|
|
|
9
9
|
export type { UIMessage } from "ai";
|
|
10
10
|
export { BlazingAgentsChatTransport, type BlazingAgentsChatTransportOptions, } from "./chat-transport.ts";
|
|
11
11
|
export { BlazingAgents } from "./client.ts";
|
|
12
|
+
export type { ApprovalDecision, ApprovalPolicy, ToolReference, } from "./contracts/entities/agent-approval.ts";
|
|
12
13
|
export type { Agent, AgentResponse, AgentsResponse, AgentVersion, AgentVersionsListQuery, AgentVersionsResponse, CreateAgentBody, UpdateAgentBody, } from "./contracts/entities/agents.ts";
|
|
13
14
|
export type { ArtifactDownloadUrlResponse, ArtifactListItem, ArtifactsListResponse, } from "./contracts/entities/artifacts.ts";
|
|
15
|
+
export type { ChatConfiguration, ChatConnection, ChatConnectionsResponse, ChatCredentials, ChatHealth, ChatIdentity, CreateChatConnectionBody, RotateChatConnectionBody, UpdateChatConnectionBody, } from "./contracts/entities/chat-connections.ts";
|
|
14
16
|
export type { CreateMcpConnectionBody, McpAttachmentResponse, McpAttachmentsResponse, McpConnectionAuthType, McpConnectionOauthConnectResponse, McpConnectionReconnectResult, McpConnectionResponse, McpConnectionStatus, McpConnectionTestResponse, ReconnectMcpConnectionBody, UpdateMcpAttachmentBody, UpdateMcpConnectionBody, } from "./contracts/entities/mcp-connections.ts";
|
|
15
17
|
export type { CreateProviderBody, ProviderListItem, ProviderModel, ProviderModelsResponse, ProviderResponse, ProvidersResponse, ProviderType, ThinkingLevelsResponse, UpdateProviderBody, } from "./contracts/entities/providers.ts";
|
|
18
|
+
export type { ToolApprovalDecisionResponse, ToolApprovalState, ToolApprovalsResponse, } from "./contracts/entities/sessions.ts";
|
|
16
19
|
export type { CreateSkillBody, Skill, SkillArchiveType, SkillCopyResult, SkillCopyResults, SkillDetail, SkillFile, SkillsListResponse, } from "./contracts/entities/skills.ts";
|
|
17
20
|
export type { CreateWorkspaceBody, UpdateWorkspaceBody, Workspace, WorkspaceNetworkPolicy, WorkspacesListResponse, } from "./contracts/entities/workspaces.ts";
|
|
18
21
|
export { BlazingAgentsDirectChatTransport, type BlazingAgentsDirectChatTransportOptions, } from "./direct-chat-transport.ts";
|
|
19
22
|
export { BlazingAgentsError } from "./errors.ts";
|
|
20
23
|
export { createChatRelay, createCompletionRelay, type RelayContext, type SessionOwnershipStore, } from "./relay.ts";
|
|
21
|
-
export type { AgentClient, AgentSkillsResource, AgentsListOptions, AgentsResource, AgentVersionsListOptions, ArtifactsResource, AttributionInput, BlazingAgentsErrorCode, BlazingAgentsOptions, BlazingAgentsRequestOptions, BlazingAgentsUIMessage, BlazingAgentsUIMessageChunk, ChatInput, ChatMessageInput, ChatPromptInput, ChatResult, ChatTrigger, CompletionInput, CompletionPromptIdInput, CompletionPromptInput, CompletionResult, KnownBlazingAgentsErrorCode, LatestSessionsListOptions, McpConnectionsResource, MemoriesListOptions, MemoriesResource, ObjectInput, ObjectPromptIdInput, ObjectPromptInput, ObjectResult, PromptsResource, ProvidersResource, ResourceRequestOptions, ResponseObservation, SessionsResource, SkillsListOptions, TasksResource, TenantResource, TerminalStreamResult, UsageResource, WorkspacesListOptions, WorkspacesResource, } from "./types.ts";
|
|
24
|
+
export type { AgentClient, AgentSkillsResource, AgentsListOptions, AgentsResource, AgentVersionsListOptions, ArtifactsResource, AttributionInput, BlazingAgentsErrorCode, BlazingAgentsOptions, BlazingAgentsRequestOptions, BlazingAgentsUIMessage, BlazingAgentsUIMessageChunk, ChatConnectionsResource, ChatInput, ChatMessageInput, ChatPromptInput, ChatResult, ChatTrigger, CompletionInput, CompletionPromptIdInput, CompletionPromptInput, CompletionResult, KnownBlazingAgentsErrorCode, LatestSessionsListOptions, McpConnectionsResource, MemoriesListOptions, MemoriesResource, ObjectInput, ObjectPromptIdInput, ObjectPromptInput, ObjectResult, PromptsResource, ProvidersResource, ResourceRequestOptions, ResponseObservation, SessionsResource, SkillsListOptions, TasksResource, TenantResource, TerminalStreamResult, UsageResource, WorkspacesListOptions, WorkspacesResource, } from "./types.ts";
|
package/dist/resources/agents.js
CHANGED
|
@@ -59,6 +59,8 @@ export function createAgentsResource(config) {
|
|
|
59
59
|
return update({
|
|
60
60
|
agentId,
|
|
61
61
|
abortSignal,
|
|
62
|
+
approvalInChat: version.approvalInChat,
|
|
63
|
+
approvalInTasks: version.approvalInTasks,
|
|
62
64
|
name: version.name,
|
|
63
65
|
model: version.model,
|
|
64
66
|
thinkingLevel: version.thinkingLevel,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { chatConnectionSchema, chatConnectionsResponseSchema, } from "../contracts/entities/chat-connections.js";
|
|
2
|
+
import { requestJson } from "../http.js";
|
|
3
|
+
export function createChatConnectionsResource(config) {
|
|
4
|
+
return {
|
|
5
|
+
async list({ abortSignal } = {}) {
|
|
6
|
+
return await requestJson(config, "/v1/chat-connections", { signal: abortSignal }, chatConnectionsResponseSchema);
|
|
7
|
+
},
|
|
8
|
+
async create({ abortSignal, ...body }) {
|
|
9
|
+
return await requestJson(config, "/v1/chat-connections", { signal: abortSignal, method: "POST", json: body }, chatConnectionSchema);
|
|
10
|
+
},
|
|
11
|
+
async get({ chatConnectionId, abortSignal }) {
|
|
12
|
+
return await requestJson(config, `/v1/chat-connections/${encodeURIComponent(chatConnectionId)}`, { signal: abortSignal, method: "GET" }, chatConnectionSchema);
|
|
13
|
+
},
|
|
14
|
+
async update({ chatConnectionId, abortSignal, ...body }) {
|
|
15
|
+
return await requestJson(config, `/v1/chat-connections/${encodeURIComponent(chatConnectionId)}`, { signal: abortSignal, method: "PATCH", json: body }, chatConnectionSchema);
|
|
16
|
+
},
|
|
17
|
+
async rotateCredentials({ chatConnectionId, abortSignal, ...body }) {
|
|
18
|
+
return await requestJson(config, `/v1/chat-connections/${encodeURIComponent(chatConnectionId)}/credentials`, { signal: abortSignal, method: "POST", json: body }, chatConnectionSchema);
|
|
19
|
+
},
|
|
20
|
+
async checkHealth({ chatConnectionId, abortSignal }) {
|
|
21
|
+
return await requestJson(config, `/v1/chat-connections/${encodeURIComponent(chatConnectionId)}/health`, { signal: abortSignal, method: "POST" }, chatConnectionSchema);
|
|
22
|
+
},
|
|
23
|
+
async enable({ chatConnectionId, abortSignal }) {
|
|
24
|
+
return await requestJson(config, `/v1/chat-connections/${encodeURIComponent(chatConnectionId)}/enable`, { signal: abortSignal, method: "POST" }, chatConnectionSchema);
|
|
25
|
+
},
|
|
26
|
+
async disable({ chatConnectionId, abortSignal }) {
|
|
27
|
+
return await requestJson(config, `/v1/chat-connections/${encodeURIComponent(chatConnectionId)}/disable`, { signal: abortSignal, method: "POST" }, chatConnectionSchema);
|
|
28
|
+
},
|
|
29
|
+
async delete({ chatConnectionId, abortSignal }) {
|
|
30
|
+
await requestJson(config, `/v1/chat-connections/${encodeURIComponent(chatConnectionId)}`, { signal: abortSignal, method: "DELETE" });
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
package/dist/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { ApiErrorCode } from "./contracts/api.ts";
|
|
|
3
3
|
import type { Agent, AgentsResponse, AgentVersion, AgentVersionsResponse, CreateAgentBody, UpdateAgentBody } from "./contracts/entities/agents.ts";
|
|
4
4
|
import type { ArtifactDownloadUrlResponse, ArtifactListItem, ArtifactsListResponse } from "./contracts/entities/artifacts.ts";
|
|
5
5
|
import type { BlazingAgentsChatMessageMetadata } from "./contracts/entities/chat.ts";
|
|
6
|
+
import type { ChatConnection, ChatConnectionsResponse, CreateChatConnectionBody, RotateChatConnectionBody, UpdateChatConnectionBody } from "./contracts/entities/chat-connections.ts";
|
|
6
7
|
import type { CreateMcpConnectionBody, McpAttachmentResponse, McpAttachmentsResponse, McpConnectionOauthConnectResponse, McpConnectionReconnectResult, McpConnectionResponse, McpConnectionsResponse, McpConnectionTestResponse, ReconnectMcpConnectionBody, UpdateMcpAttachmentBody, UpdateMcpConnectionBody } from "./contracts/entities/mcp-connections.ts";
|
|
7
8
|
import type { CreateMemoryBody, MemoriesListResponse, MemoryResponse, UpdateMemoryBody } from "./contracts/entities/memories.ts";
|
|
8
9
|
import type { CreatePromptBody, PromptResponse, PromptsResponse, UpdatePromptBody } from "./contracts/entities/prompts.ts";
|
|
@@ -511,4 +512,29 @@ export interface UsageResource {
|
|
|
511
512
|
agentId: string;
|
|
512
513
|
} & ResourceRequestOptions): Promise<UsageResponse>;
|
|
513
514
|
}
|
|
515
|
+
export interface ChatConnectionsResource {
|
|
516
|
+
checkHealth(input: {
|
|
517
|
+
chatConnectionId: string;
|
|
518
|
+
} & ResourceRequestOptions): Promise<ChatConnection>;
|
|
519
|
+
create(input: CreateChatConnectionBody & ResourceRequestOptions): Promise<ChatConnection>;
|
|
520
|
+
delete(input: {
|
|
521
|
+
chatConnectionId: string;
|
|
522
|
+
} & ResourceRequestOptions): Promise<void>;
|
|
523
|
+
disable(input: {
|
|
524
|
+
chatConnectionId: string;
|
|
525
|
+
} & ResourceRequestOptions): Promise<ChatConnection>;
|
|
526
|
+
enable(input: {
|
|
527
|
+
chatConnectionId: string;
|
|
528
|
+
} & ResourceRequestOptions): Promise<ChatConnection>;
|
|
529
|
+
get(input: {
|
|
530
|
+
chatConnectionId: string;
|
|
531
|
+
} & ResourceRequestOptions): Promise<ChatConnection>;
|
|
532
|
+
list(input?: ResourceRequestOptions): Promise<ChatConnectionsResponse>;
|
|
533
|
+
rotateCredentials(input: RotateChatConnectionBody & {
|
|
534
|
+
chatConnectionId: string;
|
|
535
|
+
} & ResourceRequestOptions): Promise<ChatConnection>;
|
|
536
|
+
update(input: UpdateChatConnectionBody & {
|
|
537
|
+
chatConnectionId: string;
|
|
538
|
+
} & ResourceRequestOptions): Promise<ChatConnection>;
|
|
539
|
+
}
|
|
514
540
|
export {};
|