@burdenoff/mcp-libs 2026.1108.1 → 2026.1110.2
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/dist/modules/botmanor/index.cjs +2018 -0
- package/dist/modules/botmanor/index.cjs.map +1 -0
- package/dist/modules/botmanor/index.d.ts +3 -0
- package/dist/modules/botmanor/index.js +1940 -0
- package/dist/modules/botmanor/index.js.map +1 -0
- package/dist/modules/botmanor/operations.d.ts +62 -0
- package/dist/modules/botmanor/prompts.d.ts +3 -0
- package/dist/modules/botmanor/resources.d.ts +3 -0
- package/dist/modules/botmanor/tool-annotations.d.ts +2 -0
- package/dist/modules/botmanor/tools/agents.d.ts +3 -0
- package/dist/modules/botmanor/tools/app-agents.d.ts +3 -0
- package/dist/modules/botmanor/tools/apps.d.ts +3 -0
- package/dist/modules/botmanor/tools/channels.d.ts +3 -0
- package/dist/modules/botmanor/tools/chat.d.ts +3 -0
- package/dist/modules/botmanor/tools/executions.d.ts +3 -0
- package/dist/modules/botmanor/tools/knowledge.d.ts +3 -0
- package/dist/modules/botmanor/tools/shared.d.ts +142 -0
- package/dist/modules/botmanor/tools/store.d.ts +3 -0
- package/dist/modules/cosmicintersection/tools/shared.d.ts +1 -1
- package/dist/modules/ggnomad/tools/shared.d.ts +1 -1
- package/dist/modules/headshotmarketing/tools/shared.d.ts +5 -5
- package/dist/modules/intelwatchtower/tools/shared.d.ts +1 -1
- package/dist/modules/mybodyshield/tools/shared.d.ts +2 -2
- package/dist/modules/planmagnet/tools/shared.d.ts +2 -2
- package/dist/modules/proserviceworld/index.cjs +59 -0
- package/dist/modules/proserviceworld/index.cjs.map +1 -1
- package/dist/modules/proserviceworld/index.js +59 -0
- package/dist/modules/proserviceworld/index.js.map +1 -1
- package/dist/modules/proserviceworld/operations.d.ts +1 -0
- package/dist/modules/proserviceworld/tools/precedents.d.ts +3 -0
- package/dist/modules/semanticfed/index.cjs +127 -20
- package/dist/modules/semanticfed/index.cjs.map +1 -1
- package/dist/modules/semanticfed/index.d.ts +1 -1
- package/dist/modules/semanticfed/index.js +110 -19
- package/dist/modules/semanticfed/index.js.map +1 -1
- package/dist/modules/semanticfed/tool-annotations.d.ts +4 -0
- package/dist/modules/subscriberbot/tools/shared.d.ts +4 -4
- package/dist/modules/theglobalfuel/index.cjs +22 -3
- package/dist/modules/theglobalfuel/index.cjs.map +1 -1
- package/dist/modules/theglobalfuel/index.js +22 -3
- package/dist/modules/theglobalfuel/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,1940 @@
|
|
|
1
|
+
import { withToolAnnotations, mcpResourceUri, mcpPromptName, mcpToolName, errorResult, jsonResult } from '../../chunk-22WYCMVS.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
// src/modules/botmanor/tool-annotations.ts
|
|
5
|
+
var READ = { readOnlyHint: true, destructiveHint: false, openWorldHint: false };
|
|
6
|
+
var WRITE = {
|
|
7
|
+
readOnlyHint: false,
|
|
8
|
+
destructiveHint: false,
|
|
9
|
+
openWorldHint: false
|
|
10
|
+
};
|
|
11
|
+
var WRITE_EXTERNAL = {
|
|
12
|
+
readOnlyHint: false,
|
|
13
|
+
destructiveHint: false,
|
|
14
|
+
openWorldHint: true
|
|
15
|
+
};
|
|
16
|
+
var DESTRUCTIVE = {
|
|
17
|
+
readOnlyHint: false,
|
|
18
|
+
destructiveHint: true,
|
|
19
|
+
openWorldHint: false
|
|
20
|
+
};
|
|
21
|
+
var BOTMANOR_TOOL_ANNOTATIONS = {
|
|
22
|
+
// Bot apps
|
|
23
|
+
list_bot_apps: READ,
|
|
24
|
+
get_bot_app: READ,
|
|
25
|
+
get_bot_app_stats: READ,
|
|
26
|
+
list_bot_app_versions: READ,
|
|
27
|
+
get_bot_app_version: READ,
|
|
28
|
+
create_bot_app: WRITE,
|
|
29
|
+
update_bot_app: WRITE,
|
|
30
|
+
delete_bot_app: DESTRUCTIVE,
|
|
31
|
+
publish_bot_app_version: DESTRUCTIVE,
|
|
32
|
+
rollback_bot_app_version: DESTRUCTIVE,
|
|
33
|
+
// Agents
|
|
34
|
+
list_agents: READ,
|
|
35
|
+
get_agent: READ,
|
|
36
|
+
get_agent_stats: READ,
|
|
37
|
+
list_agent_versions: READ,
|
|
38
|
+
get_agent_version: READ,
|
|
39
|
+
create_agent: WRITE,
|
|
40
|
+
update_agent: WRITE,
|
|
41
|
+
delete_agent: DESTRUCTIVE,
|
|
42
|
+
publish_agent_version: DESTRUCTIVE,
|
|
43
|
+
rollback_agent_version: DESTRUCTIVE,
|
|
44
|
+
// App-agent routing
|
|
45
|
+
list_app_agents: READ,
|
|
46
|
+
get_app_agent: READ,
|
|
47
|
+
create_app_agent: WRITE,
|
|
48
|
+
update_app_agent: WRITE,
|
|
49
|
+
delete_app_agent: DESTRUCTIVE,
|
|
50
|
+
// Executions
|
|
51
|
+
list_executions: READ,
|
|
52
|
+
get_execution: READ,
|
|
53
|
+
get_execution_metrics: READ,
|
|
54
|
+
create_execution: WRITE,
|
|
55
|
+
run_execution: WRITE,
|
|
56
|
+
update_execution_status: WRITE,
|
|
57
|
+
// Chat
|
|
58
|
+
chat_with_agent: WRITE_EXTERNAL,
|
|
59
|
+
list_conversations: READ,
|
|
60
|
+
list_conversation_messages: READ,
|
|
61
|
+
// Knowledge bases
|
|
62
|
+
list_knowledge_bases: READ,
|
|
63
|
+
get_knowledge_base: READ,
|
|
64
|
+
create_knowledge_base: WRITE,
|
|
65
|
+
update_knowledge_base: WRITE,
|
|
66
|
+
delete_knowledge_base: DESTRUCTIVE,
|
|
67
|
+
list_knowledge_documents: READ,
|
|
68
|
+
get_knowledge_document: READ,
|
|
69
|
+
add_knowledge_document: WRITE,
|
|
70
|
+
remove_knowledge_document: DESTRUCTIVE,
|
|
71
|
+
search_knowledge: READ,
|
|
72
|
+
// Channels: routes
|
|
73
|
+
list_channel_routes: READ,
|
|
74
|
+
get_channel_route: READ,
|
|
75
|
+
create_channel_route: WRITE,
|
|
76
|
+
update_channel_route: WRITE,
|
|
77
|
+
delete_channel_route: DESTRUCTIVE,
|
|
78
|
+
// Channels: connectors
|
|
79
|
+
list_channel_connectors: READ,
|
|
80
|
+
get_channel_connector: READ,
|
|
81
|
+
create_channel_connector: WRITE,
|
|
82
|
+
update_channel_connector: WRITE,
|
|
83
|
+
delete_channel_connector: DESTRUCTIVE,
|
|
84
|
+
// Store
|
|
85
|
+
list_store_packages: READ,
|
|
86
|
+
get_store_package: READ,
|
|
87
|
+
get_store_package_by_slug: READ,
|
|
88
|
+
list_installed_packages: READ,
|
|
89
|
+
get_installed_package: READ,
|
|
90
|
+
install_package: DESTRUCTIVE,
|
|
91
|
+
uninstall_package: DESTRUCTIVE,
|
|
92
|
+
update_installed_package: WRITE
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// src/modules/botmanor/operations.ts
|
|
96
|
+
var BOT_APP_FIELDS = `
|
|
97
|
+
id name slug description type status visibility routingStrategy
|
|
98
|
+
welcomeMessage fallbackMessage icon defaultAgentId workflowId bucketId
|
|
99
|
+
workspaceId executionCount lastExecutedAt currentVersionId draftVersionId
|
|
100
|
+
metadata tagIds createdAt updatedAt createdById updatedById
|
|
101
|
+
`;
|
|
102
|
+
var BOT_APP_VERSION_FIELDS = `
|
|
103
|
+
id botAppId version status changelog config metadata
|
|
104
|
+
createdAt createdById publishedAt publishedById
|
|
105
|
+
`;
|
|
106
|
+
var AGENT_FIELDS = `
|
|
107
|
+
id name slug description type status visibility specialization systemPrompt
|
|
108
|
+
llmModelId temperature maxTokens maxConcurrentExecutions capabilities
|
|
109
|
+
knowledgeBaseIds mcpConnectionIds workflowIds bucketId workspaceId
|
|
110
|
+
executionCount lastExecutedAt currentVersionId draftVersionId metadata tagIds
|
|
111
|
+
createdAt updatedAt createdById
|
|
112
|
+
`;
|
|
113
|
+
var AGENT_VERSION_FIELDS = `
|
|
114
|
+
id agentId version status changelog config metadata
|
|
115
|
+
createdAt createdById publishedAt publishedById
|
|
116
|
+
`;
|
|
117
|
+
var APP_AGENT_FIELDS = `
|
|
118
|
+
id appId agentId fallbackAgentId isActive priority timeout maxQueueSize
|
|
119
|
+
intentPatterns triggerKeywords routingRules metadata workspaceId
|
|
120
|
+
executionCount lastExecutedAt createdAt updatedAt
|
|
121
|
+
`;
|
|
122
|
+
var EXECUTION_FIELDS = `
|
|
123
|
+
id type status input output errorCode errorMessage errorDetails
|
|
124
|
+
conversationId agentId appId cost duration tokensUsed toolCalls metadata
|
|
125
|
+
workspaceId createdAt completedAt contentPurgedAt
|
|
126
|
+
`;
|
|
127
|
+
var EXECUTION_METRICS_FIELDS = `
|
|
128
|
+
executionId totalTokens inputTokens outputTokens toolCalls ragChunks cost
|
|
129
|
+
`;
|
|
130
|
+
var CHAT_RESPONSE_FIELDS = `
|
|
131
|
+
message executionId conversationId model tokensUsed
|
|
132
|
+
sources { chunkId documentId knowledgeBaseId reference }
|
|
133
|
+
`;
|
|
134
|
+
var KNOWLEDGE_BASE_FIELDS = `
|
|
135
|
+
id name description chunkingStrategy chunkSize chunkOverlap embeddingModel
|
|
136
|
+
embeddingDimensions vectorStoreDriver indexStatus vectorCount totalDocuments
|
|
137
|
+
totalChunks lastIndexedAt metadata workspaceId createdAt updatedAt
|
|
138
|
+
createdById updatedById
|
|
139
|
+
`;
|
|
140
|
+
var KNOWLEDGE_DOCUMENT_FIELDS = `
|
|
141
|
+
id knowledgeBaseId fileId title content status chunkCount processingError
|
|
142
|
+
metadata addedAt updatedAt addedById processedAt
|
|
143
|
+
`;
|
|
144
|
+
var KNOWLEDGE_CHUNK_FIELDS = `
|
|
145
|
+
id documentId content sequence tokenCount vectorId metadata createdAt
|
|
146
|
+
`;
|
|
147
|
+
var CHANNEL_ROUTE_FIELDS = `
|
|
148
|
+
id appId connectorId locationId formatPolicyId policyBindings
|
|
149
|
+
routingOverrides revision metadata workspaceId createdAt updatedAt
|
|
150
|
+
`;
|
|
151
|
+
var CHANNEL_CONNECTOR_FIELDS = `
|
|
152
|
+
id name description type status visibility tags credentialsRefId
|
|
153
|
+
defaultPolicyBindings revision bucketId metadata workspaceId
|
|
154
|
+
createdAt updatedAt createdById updatedById
|
|
155
|
+
`;
|
|
156
|
+
var STORE_PACKAGE_FIELDS = `
|
|
157
|
+
id slug kind version readme manifest metadata publishedAt publishedBy
|
|
158
|
+
createdAt updatedAt
|
|
159
|
+
`;
|
|
160
|
+
var INSTALLED_PACKAGE_FIELDS = `
|
|
161
|
+
id packageId installedVersion mode bindings pinnedByEnv metadata workspaceId
|
|
162
|
+
installedAt installedBy createdAt updatedAt
|
|
163
|
+
package { id slug kind version }
|
|
164
|
+
`;
|
|
165
|
+
var LIST_BOT_APPS = `
|
|
166
|
+
query ListBotApps($filters: BotAppFilterInput, $pagination: PaginationInput) {
|
|
167
|
+
listBotApps(filters: $filters, pagination: $pagination) { ${BOT_APP_FIELDS} }
|
|
168
|
+
}
|
|
169
|
+
`;
|
|
170
|
+
var GET_BOT_APP = `
|
|
171
|
+
query GetBotApp($id: ID!) {
|
|
172
|
+
getBotApp(id: $id) { ${BOT_APP_FIELDS} }
|
|
173
|
+
}
|
|
174
|
+
`;
|
|
175
|
+
var GET_BOT_APP_STATS = `
|
|
176
|
+
query GetBotAppStats($botAppId: ID!) {
|
|
177
|
+
getBotAppStats(botAppId: $botAppId) {
|
|
178
|
+
botAppId totalExecutions successfulExecutions failedExecutions
|
|
179
|
+
avgDurationMs totalCost lastExecutedAt updatedAt
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
`;
|
|
183
|
+
var LIST_BOT_APP_VERSIONS = `
|
|
184
|
+
query ListBotAppVersions($botAppId: ID!, $pagination: PaginationInput) {
|
|
185
|
+
listBotAppVersions(botAppId: $botAppId, pagination: $pagination) {
|
|
186
|
+
${BOT_APP_VERSION_FIELDS}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
`;
|
|
190
|
+
var GET_BOT_APP_VERSION = `
|
|
191
|
+
query GetBotAppVersion($id: ID!) {
|
|
192
|
+
getBotAppVersion(id: $id) { ${BOT_APP_VERSION_FIELDS} }
|
|
193
|
+
}
|
|
194
|
+
`;
|
|
195
|
+
var CREATE_BOT_APP = `
|
|
196
|
+
mutation CreateBotApp($input: CreateBotAppInput!) {
|
|
197
|
+
createBotApp(input: $input) { ${BOT_APP_FIELDS} }
|
|
198
|
+
}
|
|
199
|
+
`;
|
|
200
|
+
var UPDATE_BOT_APP = `
|
|
201
|
+
mutation UpdateBotApp($id: ID!, $input: UpdateBotAppInput!) {
|
|
202
|
+
updateBotApp(id: $id, input: $input) { ${BOT_APP_FIELDS} }
|
|
203
|
+
}
|
|
204
|
+
`;
|
|
205
|
+
var DELETE_BOT_APP = `
|
|
206
|
+
mutation DeleteBotApp($id: ID!) {
|
|
207
|
+
deleteBotApp(id: $id)
|
|
208
|
+
}
|
|
209
|
+
`;
|
|
210
|
+
var PUBLISH_BOT_APP_VERSION = `
|
|
211
|
+
mutation PublishBotAppVersion($botAppId: ID!, $versionId: ID!, $changelog: String) {
|
|
212
|
+
publishBotAppVersion(botAppId: $botAppId, versionId: $versionId, changelog: $changelog) {
|
|
213
|
+
${BOT_APP_VERSION_FIELDS}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
`;
|
|
217
|
+
var ROLLBACK_BOT_APP_VERSION = `
|
|
218
|
+
mutation RollbackBotAppVersion($botAppId: ID!, $targetVersionId: ID!) {
|
|
219
|
+
rollbackBotAppVersion(botAppId: $botAppId, targetVersionId: $targetVersionId) {
|
|
220
|
+
${BOT_APP_VERSION_FIELDS}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
`;
|
|
224
|
+
var LIST_BOTMANOR_AGENTS = `
|
|
225
|
+
query ListBotmanorAgents($filters: BotmanorAgentFilterInput, $pagination: PaginationInput) {
|
|
226
|
+
listBotmanorAgents(filters: $filters, pagination: $pagination) { ${AGENT_FIELDS} }
|
|
227
|
+
}
|
|
228
|
+
`;
|
|
229
|
+
var GET_BOTMANOR_AGENT = `
|
|
230
|
+
query GetBotmanorAgent($id: ID!) {
|
|
231
|
+
getBotmanorAgent(id: $id) { ${AGENT_FIELDS} }
|
|
232
|
+
}
|
|
233
|
+
`;
|
|
234
|
+
var GET_AGENT_STATS = `
|
|
235
|
+
query GetAgentStats($agentId: ID!) {
|
|
236
|
+
getAgentStats(agentId: $agentId) {
|
|
237
|
+
agentId totalExecutions successfulExecutions failedExecutions
|
|
238
|
+
avgDurationMs totalCost lastExecutedAt updatedAt
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
`;
|
|
242
|
+
var LIST_AGENT_VERSIONS = `
|
|
243
|
+
query ListAgentVersions($agentId: ID!, $pagination: PaginationInput) {
|
|
244
|
+
listAgentVersions(agentId: $agentId, pagination: $pagination) {
|
|
245
|
+
${AGENT_VERSION_FIELDS}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
`;
|
|
249
|
+
var GET_AGENT_VERSION = `
|
|
250
|
+
query GetAgentVersion($id: ID!) {
|
|
251
|
+
getAgentVersion(id: $id) { ${AGENT_VERSION_FIELDS} }
|
|
252
|
+
}
|
|
253
|
+
`;
|
|
254
|
+
var CREATE_BOTMANOR_AGENT = `
|
|
255
|
+
mutation CreateBotmanorAgent($input: CreateBotmanorAgentInput!) {
|
|
256
|
+
createBotmanorAgent(input: $input) { ${AGENT_FIELDS} }
|
|
257
|
+
}
|
|
258
|
+
`;
|
|
259
|
+
var UPDATE_BOTMANOR_AGENT = `
|
|
260
|
+
mutation UpdateBotmanorAgent($id: ID!, $input: UpdateBotmanorAgentInput!) {
|
|
261
|
+
updateBotmanorAgent(id: $id, input: $input) { ${AGENT_FIELDS} }
|
|
262
|
+
}
|
|
263
|
+
`;
|
|
264
|
+
var DELETE_BOTMANOR_AGENT = `
|
|
265
|
+
mutation DeleteBotmanorAgent($id: ID!) {
|
|
266
|
+
deleteBotmanorAgent(id: $id)
|
|
267
|
+
}
|
|
268
|
+
`;
|
|
269
|
+
var PUBLISH_AGENT_VERSION = `
|
|
270
|
+
mutation PublishAgentVersion($agentId: ID!, $versionId: ID!, $changelog: String) {
|
|
271
|
+
publishAgentVersion(agentId: $agentId, versionId: $versionId, changelog: $changelog) {
|
|
272
|
+
${AGENT_VERSION_FIELDS}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
`;
|
|
276
|
+
var ROLLBACK_AGENT_VERSION = `
|
|
277
|
+
mutation RollbackAgentVersion($agentId: ID!, $targetVersionId: ID!) {
|
|
278
|
+
rollbackAgentVersion(agentId: $agentId, targetVersionId: $targetVersionId) {
|
|
279
|
+
${AGENT_VERSION_FIELDS}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
`;
|
|
283
|
+
var LIST_APP_AGENTS = `
|
|
284
|
+
query ListAppAgents($filters: AppAgentFilterInput, $pagination: PaginationInput) {
|
|
285
|
+
listAppAgents(filters: $filters, pagination: $pagination) { ${APP_AGENT_FIELDS} }
|
|
286
|
+
}
|
|
287
|
+
`;
|
|
288
|
+
var GET_APP_AGENT = `
|
|
289
|
+
query GetAppAgent($id: ID!) {
|
|
290
|
+
getAppAgent(id: $id) { ${APP_AGENT_FIELDS} }
|
|
291
|
+
}
|
|
292
|
+
`;
|
|
293
|
+
var CREATE_APP_AGENT = `
|
|
294
|
+
mutation CreateAppAgent($input: CreateAppAgentInput!) {
|
|
295
|
+
createAppAgent(input: $input) { ${APP_AGENT_FIELDS} }
|
|
296
|
+
}
|
|
297
|
+
`;
|
|
298
|
+
var UPDATE_APP_AGENT = `
|
|
299
|
+
mutation UpdateAppAgent($id: ID!, $input: UpdateAppAgentInput!) {
|
|
300
|
+
updateAppAgent(id: $id, input: $input) { ${APP_AGENT_FIELDS} }
|
|
301
|
+
}
|
|
302
|
+
`;
|
|
303
|
+
var DELETE_APP_AGENT = `
|
|
304
|
+
mutation DeleteAppAgent($id: ID!) {
|
|
305
|
+
deleteAppAgent(id: $id)
|
|
306
|
+
}
|
|
307
|
+
`;
|
|
308
|
+
var LIST_EXECUTIONS = `
|
|
309
|
+
query ListExecutions($filters: ExecutionFilterInput, $pagination: PaginationInput) {
|
|
310
|
+
listExecutions(filters: $filters, pagination: $pagination) { ${EXECUTION_FIELDS} }
|
|
311
|
+
}
|
|
312
|
+
`;
|
|
313
|
+
var GET_EXECUTION = `
|
|
314
|
+
query GetExecution($id: ID!) {
|
|
315
|
+
getExecution(id: $id) { ${EXECUTION_FIELDS} }
|
|
316
|
+
}
|
|
317
|
+
`;
|
|
318
|
+
var GET_EXECUTION_METRICS = `
|
|
319
|
+
query GetExecutionMetrics($filter: ExecutionMetricsFilterInput!) {
|
|
320
|
+
getExecutionMetrics(filter: $filter) { ${EXECUTION_METRICS_FIELDS} }
|
|
321
|
+
}
|
|
322
|
+
`;
|
|
323
|
+
var CREATE_EXECUTION = `
|
|
324
|
+
mutation CreateExecution($input: CreateExecutionInput!) {
|
|
325
|
+
createExecution(input: $input) { ${EXECUTION_FIELDS} }
|
|
326
|
+
}
|
|
327
|
+
`;
|
|
328
|
+
var RUN_EXECUTION = `
|
|
329
|
+
mutation RunExecution($id: ID!) {
|
|
330
|
+
runExecution(id: $id) { ${EXECUTION_FIELDS} }
|
|
331
|
+
}
|
|
332
|
+
`;
|
|
333
|
+
var UPDATE_EXECUTION_STATUS = `
|
|
334
|
+
mutation UpdateExecutionStatus($id: ID!, $input: UpdateExecutionStatusInput!) {
|
|
335
|
+
updateExecutionStatus(id: $id, input: $input) { ${EXECUTION_FIELDS} }
|
|
336
|
+
}
|
|
337
|
+
`;
|
|
338
|
+
var CHAT_WITH_AGENT = `
|
|
339
|
+
mutation ChatWithAgent($input: ChatWithAgentInput!) {
|
|
340
|
+
chatWithAgent(input: $input) { ${CHAT_RESPONSE_FIELDS} }
|
|
341
|
+
}
|
|
342
|
+
`;
|
|
343
|
+
var MY_ASSISTANT_WORKFLOW_CONVERSATIONS = `
|
|
344
|
+
query MyAssistantWorkflowConversations($agentId: ID, $courseId: ID, $after: ID) {
|
|
345
|
+
myAssistantWorkflowConversations(agentId: $agentId, courseId: $courseId, after: $after) {
|
|
346
|
+
nodes { clientConversationId createdAt }
|
|
347
|
+
nextCursor
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
`;
|
|
351
|
+
var MY_ASSISTANT_WORKFLOW_CONVERSATION_MESSAGES = `
|
|
352
|
+
query MyAssistantWorkflowConversationMessages(
|
|
353
|
+
$clientConversationId: ID!
|
|
354
|
+
$agentId: ID
|
|
355
|
+
$courseId: ID
|
|
356
|
+
$before: String
|
|
357
|
+
) {
|
|
358
|
+
myAssistantWorkflowConversationMessages(
|
|
359
|
+
clientConversationId: $clientConversationId
|
|
360
|
+
agentId: $agentId
|
|
361
|
+
courseId: $courseId
|
|
362
|
+
before: $before
|
|
363
|
+
) {
|
|
364
|
+
turns {
|
|
365
|
+
message
|
|
366
|
+
receipt {
|
|
367
|
+
id clientTurnId status partialMessage historyDelivered usageDelivered
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
nextCursor
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
`;
|
|
374
|
+
var LIST_KNOWLEDGE_BASES = `
|
|
375
|
+
query ListKnowledgeBases($filters: KnowledgeBaseFilterInput, $pagination: PaginationInput) {
|
|
376
|
+
listKnowledgeBases(filters: $filters, pagination: $pagination) { ${KNOWLEDGE_BASE_FIELDS} }
|
|
377
|
+
}
|
|
378
|
+
`;
|
|
379
|
+
var GET_KNOWLEDGE_BASE = `
|
|
380
|
+
query GetKnowledgeBase($id: ID!) {
|
|
381
|
+
getKnowledgeBase(id: $id) { ${KNOWLEDGE_BASE_FIELDS} }
|
|
382
|
+
}
|
|
383
|
+
`;
|
|
384
|
+
var CREATE_KNOWLEDGE_BASE = `
|
|
385
|
+
mutation CreateKnowledgeBase($input: CreateKnowledgeBaseInput!) {
|
|
386
|
+
createKnowledgeBase(input: $input) { ${KNOWLEDGE_BASE_FIELDS} }
|
|
387
|
+
}
|
|
388
|
+
`;
|
|
389
|
+
var UPDATE_KNOWLEDGE_BASE = `
|
|
390
|
+
mutation UpdateKnowledgeBase($id: ID!, $input: UpdateKnowledgeBaseInput!) {
|
|
391
|
+
updateKnowledgeBase(id: $id, input: $input) { ${KNOWLEDGE_BASE_FIELDS} }
|
|
392
|
+
}
|
|
393
|
+
`;
|
|
394
|
+
var DELETE_KNOWLEDGE_BASE = `
|
|
395
|
+
mutation DeleteKnowledgeBase($id: ID!) {
|
|
396
|
+
deleteKnowledgeBase(id: $id)
|
|
397
|
+
}
|
|
398
|
+
`;
|
|
399
|
+
var LIST_KNOWLEDGE_DOCUMENTS = `
|
|
400
|
+
query ListKnowledgeDocuments($knowledgeBaseId: ID!, $pagination: PaginationInput) {
|
|
401
|
+
listKnowledgeDocuments(knowledgeBaseId: $knowledgeBaseId, pagination: $pagination) {
|
|
402
|
+
${KNOWLEDGE_DOCUMENT_FIELDS}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
`;
|
|
406
|
+
var GET_KNOWLEDGE_DOCUMENT = `
|
|
407
|
+
query GetKnowledgeDocument($id: ID!) {
|
|
408
|
+
getKnowledgeDocument(id: $id) { ${KNOWLEDGE_DOCUMENT_FIELDS} }
|
|
409
|
+
}
|
|
410
|
+
`;
|
|
411
|
+
var ADD_KNOWLEDGE_DOCUMENT = `
|
|
412
|
+
mutation AddKnowledgeDocument($input: AddKnowledgeDocumentInput!) {
|
|
413
|
+
addKnowledgeDocument(input: $input) { ${KNOWLEDGE_DOCUMENT_FIELDS} }
|
|
414
|
+
}
|
|
415
|
+
`;
|
|
416
|
+
var REMOVE_KNOWLEDGE_DOCUMENT = `
|
|
417
|
+
mutation RemoveKnowledgeDocument($id: ID!) {
|
|
418
|
+
removeKnowledgeDocument(id: $id)
|
|
419
|
+
}
|
|
420
|
+
`;
|
|
421
|
+
var SEARCH_KNOWLEDGE = `
|
|
422
|
+
query SearchKnowledge($knowledgeBaseId: ID!, $query: String!, $topK: Int) {
|
|
423
|
+
searchKnowledge(knowledgeBaseId: $knowledgeBaseId, query: $query, topK: $topK) {
|
|
424
|
+
${KNOWLEDGE_CHUNK_FIELDS}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
`;
|
|
428
|
+
var LIST_CHANNEL_ROUTES = `
|
|
429
|
+
query ListChannelRoutes($filters: ChannelRouteFilterInput, $pagination: PaginationInput) {
|
|
430
|
+
listChannelRoutes(filters: $filters, pagination: $pagination) { ${CHANNEL_ROUTE_FIELDS} }
|
|
431
|
+
}
|
|
432
|
+
`;
|
|
433
|
+
var GET_CHANNEL_ROUTE = `
|
|
434
|
+
query GetChannelRoute($id: ID!) {
|
|
435
|
+
getChannelRoute(id: $id) { ${CHANNEL_ROUTE_FIELDS} }
|
|
436
|
+
}
|
|
437
|
+
`;
|
|
438
|
+
var CREATE_CHANNEL_ROUTE = `
|
|
439
|
+
mutation CreateChannelRoute($input: CreateChannelRouteInput!) {
|
|
440
|
+
createChannelRoute(input: $input) { ${CHANNEL_ROUTE_FIELDS} }
|
|
441
|
+
}
|
|
442
|
+
`;
|
|
443
|
+
var UPDATE_CHANNEL_ROUTE = `
|
|
444
|
+
mutation UpdateChannelRoute($id: ID!, $input: UpdateChannelRouteInput!) {
|
|
445
|
+
updateChannelRoute(id: $id, input: $input) { ${CHANNEL_ROUTE_FIELDS} }
|
|
446
|
+
}
|
|
447
|
+
`;
|
|
448
|
+
var DELETE_CHANNEL_ROUTE = `
|
|
449
|
+
mutation DeleteChannelRoute($id: ID!) {
|
|
450
|
+
deleteChannelRoute(id: $id)
|
|
451
|
+
}
|
|
452
|
+
`;
|
|
453
|
+
var LIST_CHANNEL_CONNECTORS = `
|
|
454
|
+
query ListChannelConnectors($filters: ChannelConnectorFilterInput, $pagination: PaginationInput) {
|
|
455
|
+
listChannelConnectors(filters: $filters, pagination: $pagination) {
|
|
456
|
+
${CHANNEL_CONNECTOR_FIELDS}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
`;
|
|
460
|
+
var GET_CHANNEL_CONNECTOR = `
|
|
461
|
+
query GetChannelConnector($id: ID!) {
|
|
462
|
+
getChannelConnector(id: $id) { ${CHANNEL_CONNECTOR_FIELDS} }
|
|
463
|
+
}
|
|
464
|
+
`;
|
|
465
|
+
var CREATE_CHANNEL_CONNECTOR = `
|
|
466
|
+
mutation CreateChannelConnector($input: CreateChannelConnectorInput!) {
|
|
467
|
+
createChannelConnector(input: $input) { ${CHANNEL_CONNECTOR_FIELDS} }
|
|
468
|
+
}
|
|
469
|
+
`;
|
|
470
|
+
var UPDATE_CHANNEL_CONNECTOR = `
|
|
471
|
+
mutation UpdateChannelConnector($id: ID!, $input: UpdateChannelConnectorInput!) {
|
|
472
|
+
updateChannelConnector(id: $id, input: $input) { ${CHANNEL_CONNECTOR_FIELDS} }
|
|
473
|
+
}
|
|
474
|
+
`;
|
|
475
|
+
var DELETE_CHANNEL_CONNECTOR = `
|
|
476
|
+
mutation DeleteChannelConnector($id: ID!) {
|
|
477
|
+
deleteChannelConnector(id: $id)
|
|
478
|
+
}
|
|
479
|
+
`;
|
|
480
|
+
var LIST_STORE_PACKAGES = `
|
|
481
|
+
query ListStorePackages($filters: StorePackageFilterInput, $pagination: PaginationInput) {
|
|
482
|
+
listStorePackages(filters: $filters, pagination: $pagination) { ${STORE_PACKAGE_FIELDS} }
|
|
483
|
+
}
|
|
484
|
+
`;
|
|
485
|
+
var GET_STORE_PACKAGE = `
|
|
486
|
+
query GetStorePackage($id: ID!) {
|
|
487
|
+
getStorePackage(id: $id) { ${STORE_PACKAGE_FIELDS} }
|
|
488
|
+
}
|
|
489
|
+
`;
|
|
490
|
+
var GET_STORE_PACKAGE_BY_SLUG = `
|
|
491
|
+
query GetStorePackageBySlug($slug: String!) {
|
|
492
|
+
getStorePackageBySlug(slug: $slug) { ${STORE_PACKAGE_FIELDS} }
|
|
493
|
+
}
|
|
494
|
+
`;
|
|
495
|
+
var LIST_INSTALLED_PACKAGES = `
|
|
496
|
+
query ListInstalledPackages($filters: InstalledPackageFilterInput!, $pagination: PaginationInput) {
|
|
497
|
+
listInstalledPackages(filters: $filters, pagination: $pagination) {
|
|
498
|
+
${INSTALLED_PACKAGE_FIELDS}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
`;
|
|
502
|
+
var GET_INSTALLED_PACKAGE = `
|
|
503
|
+
query GetInstalledPackage($id: ID!) {
|
|
504
|
+
getInstalledPackage(id: $id) { ${INSTALLED_PACKAGE_FIELDS} }
|
|
505
|
+
}
|
|
506
|
+
`;
|
|
507
|
+
var INSTALL_PACKAGE = `
|
|
508
|
+
mutation InstallPackage($input: InstallPackageInput!) {
|
|
509
|
+
installPackage(input: $input) { ${INSTALLED_PACKAGE_FIELDS} }
|
|
510
|
+
}
|
|
511
|
+
`;
|
|
512
|
+
var UNINSTALL_PACKAGE = `
|
|
513
|
+
mutation UninstallPackage($id: ID!) {
|
|
514
|
+
uninstallPackage(id: $id)
|
|
515
|
+
}
|
|
516
|
+
`;
|
|
517
|
+
var UPDATE_INSTALLED_PACKAGE = `
|
|
518
|
+
mutation UpdateInstalledPackage($id: ID!, $input: UpdateInstalledPackageInput!) {
|
|
519
|
+
updateInstalledPackage(id: $id, input: $input) { ${INSTALLED_PACKAGE_FIELDS} }
|
|
520
|
+
}
|
|
521
|
+
`;
|
|
522
|
+
var JsonObject = z.record(z.string(), z.unknown());
|
|
523
|
+
var Id = z.string().min(1).describe("ID");
|
|
524
|
+
var BotAppStatusEnum = z.enum(["DRAFT", "ACTIVE", "PAUSED", "ARCHIVED"]);
|
|
525
|
+
var BotAppTypeEnum = z.enum(["ASSISTANT", "AUTOMATION", "ANALYST", "SPECIALIST"]);
|
|
526
|
+
var BotAppVisibilityEnum = z.enum(["PRIVATE", "WORKSPACE", "PUBLIC"]);
|
|
527
|
+
var RoutingStrategyEnum = z.enum(["SINGLE", "ROUND_ROBIN", "INTELLIGENT", "CUSTOM"]);
|
|
528
|
+
var BotmanorAgentStatusEnum = z.enum([
|
|
529
|
+
"DRAFT",
|
|
530
|
+
"ACTIVE",
|
|
531
|
+
"PAUSED",
|
|
532
|
+
"TRAINING",
|
|
533
|
+
"ARCHIVED"
|
|
534
|
+
]);
|
|
535
|
+
var BotmanorAgentTypeEnum = z.enum(["ASSISTANT", "AUTOMATION", "ANALYST", "SPECIALIST"]);
|
|
536
|
+
var AgentVisibilityEnum = z.enum(["PRIVATE", "WORKSPACE", "PUBLIC"]);
|
|
537
|
+
var BotmanorAgentCapabilityEnum = z.enum([
|
|
538
|
+
"RAG",
|
|
539
|
+
"MCP_TOOLS",
|
|
540
|
+
"MEMORY",
|
|
541
|
+
"WEB_BROWSING",
|
|
542
|
+
"CODE_EXECUTION",
|
|
543
|
+
"MULTIMODAL",
|
|
544
|
+
"REASONING",
|
|
545
|
+
"A2A"
|
|
546
|
+
]);
|
|
547
|
+
var ExecutionStatusEnum = z.enum([
|
|
548
|
+
"PENDING",
|
|
549
|
+
"RUNNING",
|
|
550
|
+
"COMPLETED",
|
|
551
|
+
"FAILED",
|
|
552
|
+
"CANCELLED",
|
|
553
|
+
"TIMEOUT"
|
|
554
|
+
]);
|
|
555
|
+
var ExecutionTypeEnum = z.enum(["AGENT", "APP", "WORKFLOW"]);
|
|
556
|
+
var IndexStatusEnum = z.enum(["EMPTY", "INDEXING", "READY", "REBUILDING", "FAILED"]);
|
|
557
|
+
var ChannelTypeEnum = z.enum([
|
|
558
|
+
"SLACK",
|
|
559
|
+
"DISCORD",
|
|
560
|
+
"WHATSAPP",
|
|
561
|
+
"TEAMS",
|
|
562
|
+
"EMAIL",
|
|
563
|
+
"SMS",
|
|
564
|
+
"WEB_WIDGET",
|
|
565
|
+
"WEBHOOK",
|
|
566
|
+
"CUSTOM"
|
|
567
|
+
]);
|
|
568
|
+
var EntityStatusEnum = z.enum(["DRAFT", "ACTIVE", "DEPRECATED", "ARCHIVED"]);
|
|
569
|
+
var ConnectorVisibilityEnum = z.enum(["PRIVATE", "WORKSPACE", "PUBLIC"]);
|
|
570
|
+
var PackageKindEnum = z.enum([
|
|
571
|
+
"AGENT",
|
|
572
|
+
"APP",
|
|
573
|
+
"KNOWLEDGE_BASE",
|
|
574
|
+
"KB_TEMPLATE",
|
|
575
|
+
"PROMPT",
|
|
576
|
+
"PROMPT_TEMPLATE",
|
|
577
|
+
"RETRIEVAL_PROFILE",
|
|
578
|
+
"SKILL",
|
|
579
|
+
"TOOL",
|
|
580
|
+
"WORKFLOW",
|
|
581
|
+
"MCP_PACK",
|
|
582
|
+
"CHANNEL_TEMPLATE",
|
|
583
|
+
"INTEGRATION",
|
|
584
|
+
"POLICY_BUNDLE",
|
|
585
|
+
"TEMPLATE",
|
|
586
|
+
"A2A_AGENT"
|
|
587
|
+
]);
|
|
588
|
+
var InstallModeEnum = z.enum(["LINKED", "FORKED"]);
|
|
589
|
+
var PaginationArgs = {
|
|
590
|
+
limit: z.number().int().optional().describe("Page size"),
|
|
591
|
+
offset: z.number().int().optional().describe("Skip results"),
|
|
592
|
+
cursor: z.string().optional().describe("Pagination cursor")
|
|
593
|
+
};
|
|
594
|
+
function paginationOf(args) {
|
|
595
|
+
const pagination = {};
|
|
596
|
+
if (args.limit !== void 0) pagination.limit = args.limit;
|
|
597
|
+
if (args.offset !== void 0) pagination.offset = args.offset;
|
|
598
|
+
if (args.cursor !== void 0) pagination.cursor = args.cursor;
|
|
599
|
+
return Object.keys(pagination).length > 0 ? pagination : void 0;
|
|
600
|
+
}
|
|
601
|
+
function listVariables(args, filterKeys) {
|
|
602
|
+
const filters = {};
|
|
603
|
+
for (const key of filterKeys) {
|
|
604
|
+
if (args[key] !== void 0) filters[key] = args[key];
|
|
605
|
+
}
|
|
606
|
+
const pagination = paginationOf(args);
|
|
607
|
+
const variables = {};
|
|
608
|
+
if (Object.keys(filters).length > 0) variables.filters = filters;
|
|
609
|
+
if (pagination !== void 0) variables.pagination = pagination;
|
|
610
|
+
return variables;
|
|
611
|
+
}
|
|
612
|
+
function buildInput(args, keys) {
|
|
613
|
+
const input = {};
|
|
614
|
+
for (const key of keys) {
|
|
615
|
+
if (args[key] !== void 0) input[key] = args[key];
|
|
616
|
+
}
|
|
617
|
+
return input;
|
|
618
|
+
}
|
|
619
|
+
function registerToolSet(server, ctx, track, specs) {
|
|
620
|
+
for (const spec of specs) {
|
|
621
|
+
server.registerTool(
|
|
622
|
+
track(mcpToolName(ctx.productName, spec.name)),
|
|
623
|
+
{
|
|
624
|
+
title: spec.title,
|
|
625
|
+
description: spec.description,
|
|
626
|
+
inputSchema: spec.inputSchema
|
|
627
|
+
},
|
|
628
|
+
async (args) => {
|
|
629
|
+
try {
|
|
630
|
+
const variables = spec.variables(args);
|
|
631
|
+
const refusal = spec.before?.(variables);
|
|
632
|
+
if (refusal !== null && refusal !== void 0) return errorResult(refusal);
|
|
633
|
+
const data = await ctx.gql.workspace.request(
|
|
634
|
+
spec.document,
|
|
635
|
+
variables
|
|
636
|
+
);
|
|
637
|
+
const payload = Object.values(data)[0];
|
|
638
|
+
if (spec.notFoundWhenNull && payload === null) {
|
|
639
|
+
return errorResult(`${spec.title}: not found`);
|
|
640
|
+
}
|
|
641
|
+
return jsonResult(payload);
|
|
642
|
+
} catch (error) {
|
|
643
|
+
ctx.logger.error(`${spec.name} failed`, { error: String(error) });
|
|
644
|
+
return errorResult(
|
|
645
|
+
`${spec.title} failed: ${error instanceof Error ? error.message : String(error)}`
|
|
646
|
+
);
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
);
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
function requireNonEmptyInput(title) {
|
|
653
|
+
return (variables) => {
|
|
654
|
+
const input = variables.input;
|
|
655
|
+
if (input === void 0 || Object.keys(input).length === 0) {
|
|
656
|
+
return `${title}: no fields to update`;
|
|
657
|
+
}
|
|
658
|
+
return null;
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
// src/modules/botmanor/tools/apps.ts
|
|
663
|
+
var CREATE_KEYS = [
|
|
664
|
+
"name",
|
|
665
|
+
"slug",
|
|
666
|
+
"type",
|
|
667
|
+
"workspaceId",
|
|
668
|
+
"description",
|
|
669
|
+
"status",
|
|
670
|
+
"visibility",
|
|
671
|
+
"routingStrategy",
|
|
672
|
+
"welcomeMessage",
|
|
673
|
+
"fallbackMessage",
|
|
674
|
+
"icon",
|
|
675
|
+
"defaultAgentId",
|
|
676
|
+
"workflowId",
|
|
677
|
+
"bucketId",
|
|
678
|
+
"metadata",
|
|
679
|
+
"tagIds",
|
|
680
|
+
"tags"
|
|
681
|
+
];
|
|
682
|
+
var UPDATE_KEYS = CREATE_KEYS.filter((key) => key !== "workspaceId");
|
|
683
|
+
var OptionalText = z.string().optional();
|
|
684
|
+
function registerBotAppTools(server, ctx, track) {
|
|
685
|
+
registerToolSet(server, ctx, track, [
|
|
686
|
+
{
|
|
687
|
+
name: "list_bot_apps",
|
|
688
|
+
title: "List Bot Apps",
|
|
689
|
+
description: "List the workspace's bot apps with optional filters (search, status, type, visibility) and paging.",
|
|
690
|
+
inputSchema: {
|
|
691
|
+
search: z.string().optional().describe("Free-text filter"),
|
|
692
|
+
status: BotAppStatusEnum.optional().describe("Lifecycle status filter"),
|
|
693
|
+
type: BotAppTypeEnum.optional().describe("Bot app type filter"),
|
|
694
|
+
visibility: BotAppVisibilityEnum.optional().describe("Visibility filter"),
|
|
695
|
+
workspaceId: Id.optional().describe("Filter by workspace ID"),
|
|
696
|
+
...PaginationArgs
|
|
697
|
+
},
|
|
698
|
+
document: LIST_BOT_APPS,
|
|
699
|
+
variables: (args) => listVariables(args, ["search", "status", "type", "visibility", "workspaceId"])
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
name: "get_bot_app",
|
|
703
|
+
title: "Get Bot App",
|
|
704
|
+
description: "Get one bot app by ID.",
|
|
705
|
+
inputSchema: { id: Id.describe("Bot app ID") },
|
|
706
|
+
document: GET_BOT_APP,
|
|
707
|
+
variables: ({ id }) => ({ id }),
|
|
708
|
+
notFoundWhenNull: true
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
name: "get_bot_app_stats",
|
|
712
|
+
title: "Get Bot App Stats",
|
|
713
|
+
description: "Aggregated execution stats for a bot app (counts, failures, cost, duration).",
|
|
714
|
+
inputSchema: { botAppId: Id.describe("Bot app ID") },
|
|
715
|
+
document: GET_BOT_APP_STATS,
|
|
716
|
+
variables: ({ botAppId }) => ({ botAppId }),
|
|
717
|
+
notFoundWhenNull: true
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
name: "list_bot_app_versions",
|
|
721
|
+
title: "List Bot App Versions",
|
|
722
|
+
description: "List the draft/published/historical versions of a bot app.",
|
|
723
|
+
inputSchema: { botAppId: Id.describe("Bot app ID"), ...PaginationArgs },
|
|
724
|
+
document: LIST_BOT_APP_VERSIONS,
|
|
725
|
+
variables: (args) => ({
|
|
726
|
+
botAppId: args.botAppId,
|
|
727
|
+
pagination: listVariables(args, []).pagination
|
|
728
|
+
})
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
name: "get_bot_app_version",
|
|
732
|
+
title: "Get Bot App Version",
|
|
733
|
+
description: "Get one bot app version by ID.",
|
|
734
|
+
inputSchema: { id: Id.describe("Bot app version ID") },
|
|
735
|
+
document: GET_BOT_APP_VERSION,
|
|
736
|
+
variables: ({ id }) => ({ id }),
|
|
737
|
+
notFoundWhenNull: true
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
name: "create_bot_app",
|
|
741
|
+
title: "Create Bot App",
|
|
742
|
+
description: "Create a bot app (metered: counts against the workspace bot quota). type/workspaceId are required.",
|
|
743
|
+
inputSchema: {
|
|
744
|
+
name: z.string().min(1).describe("Display name"),
|
|
745
|
+
slug: z.string().min(1).describe("Unique slug"),
|
|
746
|
+
type: BotAppTypeEnum.describe("Bot app type"),
|
|
747
|
+
workspaceId: Id.describe("Owning workspace ID"),
|
|
748
|
+
description: OptionalText.describe("Description"),
|
|
749
|
+
status: BotAppStatusEnum.optional().describe("Initial status (default DRAFT)"),
|
|
750
|
+
visibility: BotAppVisibilityEnum.optional().describe("Visibility (default PRIVATE)"),
|
|
751
|
+
routingStrategy: RoutingStrategyEnum.optional().describe("Agent routing strategy"),
|
|
752
|
+
welcomeMessage: OptionalText.describe("Welcome message"),
|
|
753
|
+
fallbackMessage: OptionalText.describe("Fallback message"),
|
|
754
|
+
icon: OptionalText.describe("Icon URL/emoji"),
|
|
755
|
+
defaultAgentId: Id.optional().describe("Default agent ID"),
|
|
756
|
+
workflowId: Id.optional().describe("Bound workflow ID"),
|
|
757
|
+
bucketId: Id.optional().describe("Storage bucket ID"),
|
|
758
|
+
metadata: JsonObject.optional().describe("Arbitrary metadata JSON"),
|
|
759
|
+
tagIds: z.array(z.string()).optional().describe("Legacy tag IDs"),
|
|
760
|
+
tags: JsonObject.optional().describe("Entity-owned tags JSON")
|
|
761
|
+
},
|
|
762
|
+
document: CREATE_BOT_APP,
|
|
763
|
+
variables: (args) => ({ input: buildInput(args, CREATE_KEYS) })
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
name: "update_bot_app",
|
|
767
|
+
title: "Update Bot App",
|
|
768
|
+
description: "Update a bot app; only the provided fields change.",
|
|
769
|
+
inputSchema: {
|
|
770
|
+
id: Id.describe("Bot app ID"),
|
|
771
|
+
name: z.string().min(1).optional().describe("Display name"),
|
|
772
|
+
slug: z.string().min(1).optional().describe("Unique slug"),
|
|
773
|
+
type: BotAppTypeEnum.optional().describe("Bot app type"),
|
|
774
|
+
description: OptionalText.describe("Description"),
|
|
775
|
+
status: BotAppStatusEnum.optional().describe("Lifecycle status"),
|
|
776
|
+
visibility: BotAppVisibilityEnum.optional().describe("Visibility"),
|
|
777
|
+
routingStrategy: RoutingStrategyEnum.optional().describe("Agent routing strategy"),
|
|
778
|
+
welcomeMessage: OptionalText.describe("Welcome message"),
|
|
779
|
+
fallbackMessage: OptionalText.describe("Fallback message"),
|
|
780
|
+
icon: OptionalText.describe("Icon URL/emoji"),
|
|
781
|
+
defaultAgentId: Id.optional().describe("Default agent ID"),
|
|
782
|
+
workflowId: Id.optional().describe("Bound workflow ID"),
|
|
783
|
+
bucketId: Id.optional().describe("Storage bucket ID"),
|
|
784
|
+
metadata: JsonObject.optional().describe("Arbitrary metadata JSON"),
|
|
785
|
+
tagIds: z.array(z.string()).optional().describe("Legacy tag IDs"),
|
|
786
|
+
tags: JsonObject.optional().describe("Entity-owned tags JSON")
|
|
787
|
+
},
|
|
788
|
+
document: UPDATE_BOT_APP,
|
|
789
|
+
variables: (args) => ({ id: args.id, input: buildInput(args, UPDATE_KEYS) }),
|
|
790
|
+
before: requireNonEmptyInput("Update Bot App")
|
|
791
|
+
},
|
|
792
|
+
{
|
|
793
|
+
name: "delete_bot_app",
|
|
794
|
+
title: "Delete Bot App",
|
|
795
|
+
description: "Delete a bot app. Destructive: requires confirm under an enforcing shell.",
|
|
796
|
+
inputSchema: { id: Id.describe("Bot app ID") },
|
|
797
|
+
document: DELETE_BOT_APP,
|
|
798
|
+
variables: ({ id }) => ({ id })
|
|
799
|
+
},
|
|
800
|
+
{
|
|
801
|
+
name: "publish_bot_app_version",
|
|
802
|
+
title: "Publish Bot App Version",
|
|
803
|
+
description: "Publish a draft bot app version (moves traffic to it). Destructive: requires confirm under an enforcing shell.",
|
|
804
|
+
inputSchema: {
|
|
805
|
+
botAppId: Id.describe("Bot app ID"),
|
|
806
|
+
versionId: Id.describe("Draft version ID to publish"),
|
|
807
|
+
changelog: z.string().optional().describe("Changelog entry")
|
|
808
|
+
},
|
|
809
|
+
document: PUBLISH_BOT_APP_VERSION,
|
|
810
|
+
variables: ({ botAppId, versionId, changelog }) => ({ botAppId, versionId, changelog })
|
|
811
|
+
},
|
|
812
|
+
{
|
|
813
|
+
name: "rollback_bot_app_version",
|
|
814
|
+
title: "Rollback Bot App Version",
|
|
815
|
+
description: "Roll a bot app back to a previous published version. Destructive: requires confirm under an enforcing shell.",
|
|
816
|
+
inputSchema: {
|
|
817
|
+
botAppId: Id.describe("Bot app ID"),
|
|
818
|
+
targetVersionId: Id.describe("Published version ID to restore")
|
|
819
|
+
},
|
|
820
|
+
document: ROLLBACK_BOT_APP_VERSION,
|
|
821
|
+
variables: ({ botAppId, targetVersionId }) => ({ botAppId, targetVersionId })
|
|
822
|
+
}
|
|
823
|
+
]);
|
|
824
|
+
}
|
|
825
|
+
var CREATE_KEYS2 = [
|
|
826
|
+
"name",
|
|
827
|
+
"slug",
|
|
828
|
+
"type",
|
|
829
|
+
"workspaceId",
|
|
830
|
+
"systemPrompt",
|
|
831
|
+
"description",
|
|
832
|
+
"status",
|
|
833
|
+
"visibility",
|
|
834
|
+
"specialization",
|
|
835
|
+
"llmModelId",
|
|
836
|
+
"temperature",
|
|
837
|
+
"maxTokens",
|
|
838
|
+
"maxConcurrentExecutions",
|
|
839
|
+
"capabilities",
|
|
840
|
+
"knowledgeBaseIds",
|
|
841
|
+
"mcpConnectionIds",
|
|
842
|
+
"workflowIds",
|
|
843
|
+
"metadata",
|
|
844
|
+
"tagIds",
|
|
845
|
+
"tags"
|
|
846
|
+
];
|
|
847
|
+
var UPDATE_KEYS2 = CREATE_KEYS2.filter((key) => key !== "workspaceId");
|
|
848
|
+
var OptionalText2 = z.string().optional();
|
|
849
|
+
function registerAgentTools(server, ctx, track) {
|
|
850
|
+
registerToolSet(server, ctx, track, [
|
|
851
|
+
{
|
|
852
|
+
name: "list_agents",
|
|
853
|
+
title: "List Agents",
|
|
854
|
+
description: "List the workspace's agents with optional filters (search, status, type, visibility) and paging.",
|
|
855
|
+
inputSchema: {
|
|
856
|
+
search: z.string().optional().describe("Free-text filter"),
|
|
857
|
+
status: BotmanorAgentStatusEnum.optional().describe("Lifecycle status filter"),
|
|
858
|
+
type: BotmanorAgentTypeEnum.optional().describe("Agent type filter"),
|
|
859
|
+
visibility: AgentVisibilityEnum.optional().describe("Visibility filter"),
|
|
860
|
+
workspaceId: Id.optional().describe("Filter by workspace ID"),
|
|
861
|
+
...PaginationArgs
|
|
862
|
+
},
|
|
863
|
+
document: LIST_BOTMANOR_AGENTS,
|
|
864
|
+
variables: (args) => listVariables(args, ["search", "status", "type", "visibility", "workspaceId"])
|
|
865
|
+
},
|
|
866
|
+
{
|
|
867
|
+
name: "get_agent",
|
|
868
|
+
title: "Get Agent",
|
|
869
|
+
description: "Get one agent by ID, including its prompt, model and capability config.",
|
|
870
|
+
inputSchema: { id: Id.describe("Agent ID") },
|
|
871
|
+
document: GET_BOTMANOR_AGENT,
|
|
872
|
+
variables: ({ id }) => ({ id }),
|
|
873
|
+
notFoundWhenNull: true
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
name: "get_agent_stats",
|
|
877
|
+
title: "Get Agent Stats",
|
|
878
|
+
description: "Aggregated execution stats for an agent (counts, failures, cost, duration).",
|
|
879
|
+
inputSchema: { agentId: Id.describe("Agent ID") },
|
|
880
|
+
document: GET_AGENT_STATS,
|
|
881
|
+
variables: ({ agentId }) => ({ agentId }),
|
|
882
|
+
notFoundWhenNull: true
|
|
883
|
+
},
|
|
884
|
+
{
|
|
885
|
+
name: "list_agent_versions",
|
|
886
|
+
title: "List Agent Versions",
|
|
887
|
+
description: "List the draft/published/historical versions of an agent.",
|
|
888
|
+
inputSchema: { agentId: Id.describe("Agent ID"), ...PaginationArgs },
|
|
889
|
+
document: LIST_AGENT_VERSIONS,
|
|
890
|
+
variables: (args) => ({
|
|
891
|
+
agentId: args.agentId,
|
|
892
|
+
pagination: listVariables(args, []).pagination
|
|
893
|
+
})
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
name: "get_agent_version",
|
|
897
|
+
title: "Get Agent Version",
|
|
898
|
+
description: "Get one agent version by ID.",
|
|
899
|
+
inputSchema: { id: Id.describe("Agent version ID") },
|
|
900
|
+
document: GET_AGENT_VERSION,
|
|
901
|
+
variables: ({ id }) => ({ id }),
|
|
902
|
+
notFoundWhenNull: true
|
|
903
|
+
},
|
|
904
|
+
{
|
|
905
|
+
name: "create_agent",
|
|
906
|
+
title: "Create Agent",
|
|
907
|
+
description: "Create an agent (unmetered by design, BOFF-4400). name/slug/type/workspaceId/systemPrompt are required.",
|
|
908
|
+
inputSchema: {
|
|
909
|
+
name: z.string().min(1).describe("Display name"),
|
|
910
|
+
slug: z.string().min(1).describe("Unique slug"),
|
|
911
|
+
type: BotmanorAgentTypeEnum.describe("Agent type"),
|
|
912
|
+
workspaceId: Id.describe("Owning workspace ID"),
|
|
913
|
+
systemPrompt: z.string().min(1).describe("System prompt"),
|
|
914
|
+
description: OptionalText2.describe("Description"),
|
|
915
|
+
status: BotmanorAgentStatusEnum.optional().describe("Initial status (default DRAFT)"),
|
|
916
|
+
visibility: AgentVisibilityEnum.optional().describe("Visibility (default PRIVATE)"),
|
|
917
|
+
specialization: OptionalText2.describe("Specialization"),
|
|
918
|
+
llmModelId: Id.optional().describe("LLM model ID"),
|
|
919
|
+
temperature: z.number().optional().describe("Sampling temperature"),
|
|
920
|
+
maxTokens: z.number().int().optional().describe("Max tokens per run"),
|
|
921
|
+
maxConcurrentExecutions: z.number().int().optional().describe("Concurrency limit"),
|
|
922
|
+
capabilities: z.array(BotmanorAgentCapabilityEnum).optional().describe("Enabled capabilities (RAG, MCP_TOOLS, ...)"),
|
|
923
|
+
knowledgeBaseIds: z.array(z.string()).optional().describe("Attached knowledge base IDs"),
|
|
924
|
+
mcpConnectionIds: z.array(z.string()).optional().describe("Attached MCP connection IDs"),
|
|
925
|
+
workflowIds: z.array(z.string()).optional().describe("Bound workflow IDs"),
|
|
926
|
+
metadata: JsonObject.optional().describe("Arbitrary metadata JSON"),
|
|
927
|
+
tagIds: z.array(z.string()).optional().describe("Legacy tag IDs"),
|
|
928
|
+
tags: JsonObject.optional().describe("Entity-owned tags JSON")
|
|
929
|
+
},
|
|
930
|
+
document: CREATE_BOTMANOR_AGENT,
|
|
931
|
+
variables: (args) => ({ input: buildInput(args, CREATE_KEYS2) })
|
|
932
|
+
},
|
|
933
|
+
{
|
|
934
|
+
name: "update_agent",
|
|
935
|
+
title: "Update Agent",
|
|
936
|
+
description: "Update an agent; only the provided fields change.",
|
|
937
|
+
inputSchema: {
|
|
938
|
+
id: Id.describe("Agent ID"),
|
|
939
|
+
name: z.string().min(1).optional().describe("Display name"),
|
|
940
|
+
slug: z.string().min(1).optional().describe("Unique slug"),
|
|
941
|
+
type: BotmanorAgentTypeEnum.optional().describe("Agent type"),
|
|
942
|
+
systemPrompt: z.string().min(1).optional().describe("System prompt"),
|
|
943
|
+
description: OptionalText2.describe("Description"),
|
|
944
|
+
status: BotmanorAgentStatusEnum.optional().describe("Lifecycle status"),
|
|
945
|
+
visibility: AgentVisibilityEnum.optional().describe("Visibility"),
|
|
946
|
+
specialization: OptionalText2.describe("Specialization"),
|
|
947
|
+
llmModelId: Id.optional().describe("LLM model ID"),
|
|
948
|
+
temperature: z.number().optional().describe("Sampling temperature"),
|
|
949
|
+
maxTokens: z.number().int().optional().describe("Max tokens per run"),
|
|
950
|
+
maxConcurrentExecutions: z.number().int().optional().describe("Concurrency limit"),
|
|
951
|
+
capabilities: z.array(BotmanorAgentCapabilityEnum).optional().describe("Enabled capabilities"),
|
|
952
|
+
knowledgeBaseIds: z.array(z.string()).optional().describe("Attached knowledge base IDs"),
|
|
953
|
+
mcpConnectionIds: z.array(z.string()).optional().describe("Attached MCP connection IDs"),
|
|
954
|
+
workflowIds: z.array(z.string()).optional().describe("Bound workflow IDs"),
|
|
955
|
+
metadata: JsonObject.optional().describe("Arbitrary metadata JSON"),
|
|
956
|
+
tagIds: z.array(z.string()).optional().describe("Legacy tag IDs"),
|
|
957
|
+
tags: JsonObject.optional().describe("Entity-owned tags JSON")
|
|
958
|
+
},
|
|
959
|
+
document: UPDATE_BOTMANOR_AGENT,
|
|
960
|
+
variables: (args) => ({ id: args.id, input: buildInput(args, UPDATE_KEYS2) }),
|
|
961
|
+
before: requireNonEmptyInput("Update Agent")
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
name: "delete_agent",
|
|
965
|
+
title: "Delete Agent",
|
|
966
|
+
description: "Delete an agent. Destructive: requires confirm under an enforcing shell.",
|
|
967
|
+
inputSchema: { id: Id.describe("Agent ID") },
|
|
968
|
+
document: DELETE_BOTMANOR_AGENT,
|
|
969
|
+
variables: ({ id }) => ({ id })
|
|
970
|
+
},
|
|
971
|
+
{
|
|
972
|
+
name: "publish_agent_version",
|
|
973
|
+
title: "Publish Agent Version",
|
|
974
|
+
description: "Publish a draft agent version (moves traffic to it). Destructive: requires confirm under an enforcing shell.",
|
|
975
|
+
inputSchema: {
|
|
976
|
+
agentId: Id.describe("Agent ID"),
|
|
977
|
+
versionId: Id.describe("Draft version ID to publish"),
|
|
978
|
+
changelog: z.string().optional().describe("Changelog entry")
|
|
979
|
+
},
|
|
980
|
+
document: PUBLISH_AGENT_VERSION,
|
|
981
|
+
variables: ({ agentId, versionId, changelog }) => ({ agentId, versionId, changelog })
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
name: "rollback_agent_version",
|
|
985
|
+
title: "Rollback Agent Version",
|
|
986
|
+
description: "Roll an agent back to a previous published version. Destructive: requires confirm under an enforcing shell.",
|
|
987
|
+
inputSchema: {
|
|
988
|
+
agentId: Id.describe("Agent ID"),
|
|
989
|
+
targetVersionId: Id.describe("Published version ID to restore")
|
|
990
|
+
},
|
|
991
|
+
document: ROLLBACK_AGENT_VERSION,
|
|
992
|
+
variables: ({ agentId, targetVersionId }) => ({ agentId, targetVersionId })
|
|
993
|
+
}
|
|
994
|
+
]);
|
|
995
|
+
}
|
|
996
|
+
function registerAppAgentTools(server, ctx, track) {
|
|
997
|
+
registerToolSet(server, ctx, track, [
|
|
998
|
+
{
|
|
999
|
+
name: "list_app_agents",
|
|
1000
|
+
title: "List App-Agent Bindings",
|
|
1001
|
+
description: "List app-agent routing bindings with optional filters (app, agent, active flag).",
|
|
1002
|
+
inputSchema: {
|
|
1003
|
+
appId: Id.optional().describe("Filter by bot app ID"),
|
|
1004
|
+
agentId: Id.optional().describe("Filter by agent ID"),
|
|
1005
|
+
isActive: z.boolean().optional().describe("Filter by active flag"),
|
|
1006
|
+
workspaceId: Id.optional().describe("Filter by workspace ID"),
|
|
1007
|
+
...PaginationArgs
|
|
1008
|
+
},
|
|
1009
|
+
document: LIST_APP_AGENTS,
|
|
1010
|
+
variables: (args) => listVariables(args, ["appId", "agentId", "isActive", "workspaceId"])
|
|
1011
|
+
},
|
|
1012
|
+
{
|
|
1013
|
+
name: "get_app_agent",
|
|
1014
|
+
title: "Get App-Agent Binding",
|
|
1015
|
+
description: "Get one app-agent routing binding by ID.",
|
|
1016
|
+
inputSchema: { id: Id.describe("Binding ID") },
|
|
1017
|
+
document: GET_APP_AGENT,
|
|
1018
|
+
variables: ({ id }) => ({ id }),
|
|
1019
|
+
notFoundWhenNull: true
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
name: "create_app_agent",
|
|
1023
|
+
title: "Create App-Agent Binding",
|
|
1024
|
+
description: "Bind an agent to a bot app with routing rules (priority, intent patterns, trigger keywords, fallback).",
|
|
1025
|
+
inputSchema: {
|
|
1026
|
+
appId: Id.describe("Bot app ID"),
|
|
1027
|
+
agentId: Id.describe("Agent ID"),
|
|
1028
|
+
workspaceId: Id.describe("Workspace ID"),
|
|
1029
|
+
fallbackAgentId: Id.optional().describe("Fallback agent when this one fails"),
|
|
1030
|
+
isActive: z.boolean().optional().describe("Active flag (default true)"),
|
|
1031
|
+
priority: z.number().int().optional().describe("Routing priority (lower wins)"),
|
|
1032
|
+
timeout: z.number().int().optional().describe("Timeout in seconds"),
|
|
1033
|
+
maxQueueSize: z.number().int().optional().describe("Max queued requests"),
|
|
1034
|
+
intentPatterns: z.array(z.string()).optional().describe("Intent patterns to match"),
|
|
1035
|
+
triggerKeywords: z.array(z.string()).optional().describe("Trigger keywords"),
|
|
1036
|
+
routingRules: JsonObject.optional().describe("Custom routing rules JSON"),
|
|
1037
|
+
metadata: JsonObject.optional().describe("Arbitrary metadata JSON")
|
|
1038
|
+
},
|
|
1039
|
+
document: CREATE_APP_AGENT,
|
|
1040
|
+
variables: (args) => ({
|
|
1041
|
+
input: buildInput(args, [
|
|
1042
|
+
"appId",
|
|
1043
|
+
"agentId",
|
|
1044
|
+
"workspaceId",
|
|
1045
|
+
"fallbackAgentId",
|
|
1046
|
+
"isActive",
|
|
1047
|
+
"priority",
|
|
1048
|
+
"timeout",
|
|
1049
|
+
"maxQueueSize",
|
|
1050
|
+
"intentPatterns",
|
|
1051
|
+
"triggerKeywords",
|
|
1052
|
+
"routingRules",
|
|
1053
|
+
"metadata"
|
|
1054
|
+
])
|
|
1055
|
+
})
|
|
1056
|
+
},
|
|
1057
|
+
{
|
|
1058
|
+
name: "update_app_agent",
|
|
1059
|
+
title: "Update App-Agent Binding",
|
|
1060
|
+
description: "Update a binding; only the provided fields change.",
|
|
1061
|
+
inputSchema: {
|
|
1062
|
+
id: Id.describe("Binding ID"),
|
|
1063
|
+
fallbackAgentId: Id.optional().describe("Fallback agent when this one fails"),
|
|
1064
|
+
isActive: z.boolean().optional().describe("Active flag"),
|
|
1065
|
+
priority: z.number().int().optional().describe("Routing priority (lower wins)"),
|
|
1066
|
+
timeout: z.number().int().optional().describe("Timeout in seconds"),
|
|
1067
|
+
maxQueueSize: z.number().int().optional().describe("Max queued requests"),
|
|
1068
|
+
intentPatterns: z.array(z.string()).optional().describe("Intent patterns to match"),
|
|
1069
|
+
triggerKeywords: z.array(z.string()).optional().describe("Trigger keywords"),
|
|
1070
|
+
routingRules: JsonObject.optional().describe("Custom routing rules JSON"),
|
|
1071
|
+
metadata: JsonObject.optional().describe("Arbitrary metadata JSON")
|
|
1072
|
+
},
|
|
1073
|
+
document: UPDATE_APP_AGENT,
|
|
1074
|
+
variables: (args) => ({
|
|
1075
|
+
id: args.id,
|
|
1076
|
+
input: buildInput(args, [
|
|
1077
|
+
"fallbackAgentId",
|
|
1078
|
+
"isActive",
|
|
1079
|
+
"priority",
|
|
1080
|
+
"timeout",
|
|
1081
|
+
"maxQueueSize",
|
|
1082
|
+
"intentPatterns",
|
|
1083
|
+
"triggerKeywords",
|
|
1084
|
+
"routingRules",
|
|
1085
|
+
"metadata"
|
|
1086
|
+
])
|
|
1087
|
+
}),
|
|
1088
|
+
before: requireNonEmptyInput("Update App-Agent Binding")
|
|
1089
|
+
},
|
|
1090
|
+
{
|
|
1091
|
+
name: "delete_app_agent",
|
|
1092
|
+
title: "Delete App-Agent Binding",
|
|
1093
|
+
description: "Remove an agent binding from a bot app. Destructive: requires confirm under an enforcing shell.",
|
|
1094
|
+
inputSchema: { id: Id.describe("Binding ID") },
|
|
1095
|
+
document: DELETE_APP_AGENT,
|
|
1096
|
+
variables: ({ id }) => ({ id })
|
|
1097
|
+
}
|
|
1098
|
+
]);
|
|
1099
|
+
}
|
|
1100
|
+
function registerExecutionTools(server, ctx, track) {
|
|
1101
|
+
registerToolSet(server, ctx, track, [
|
|
1102
|
+
{
|
|
1103
|
+
name: "list_executions",
|
|
1104
|
+
title: "List Executions",
|
|
1105
|
+
description: "List bot/agent/workflow executions with optional filters and paging.",
|
|
1106
|
+
inputSchema: {
|
|
1107
|
+
agentId: Id.optional().describe("Filter by agent ID"),
|
|
1108
|
+
appId: Id.optional().describe("Filter by bot app ID"),
|
|
1109
|
+
conversationId: Id.optional().describe("Filter by conversation ID"),
|
|
1110
|
+
status: ExecutionStatusEnum.optional().describe("Filter by status"),
|
|
1111
|
+
type: ExecutionTypeEnum.optional().describe("Filter by execution type"),
|
|
1112
|
+
workspaceId: Id.optional().describe("Filter by workspace ID"),
|
|
1113
|
+
...PaginationArgs
|
|
1114
|
+
},
|
|
1115
|
+
document: LIST_EXECUTIONS,
|
|
1116
|
+
variables: (args) => listVariables(args, [
|
|
1117
|
+
"agentId",
|
|
1118
|
+
"appId",
|
|
1119
|
+
"conversationId",
|
|
1120
|
+
"status",
|
|
1121
|
+
"type",
|
|
1122
|
+
"workspaceId"
|
|
1123
|
+
])
|
|
1124
|
+
},
|
|
1125
|
+
{
|
|
1126
|
+
name: "get_execution",
|
|
1127
|
+
title: "Get Execution",
|
|
1128
|
+
description: "Get one execution by ID, including input, output and error details.",
|
|
1129
|
+
inputSchema: { id: Id.describe("Execution ID") },
|
|
1130
|
+
document: GET_EXECUTION,
|
|
1131
|
+
variables: ({ id }) => ({ id }),
|
|
1132
|
+
notFoundWhenNull: true
|
|
1133
|
+
},
|
|
1134
|
+
{
|
|
1135
|
+
name: "get_execution_metrics",
|
|
1136
|
+
title: "Get Execution Metrics",
|
|
1137
|
+
description: "Token/cost metrics for executions in a window (filter by agent, app and/or date range).",
|
|
1138
|
+
inputSchema: {
|
|
1139
|
+
agentId: Id.optional().describe("Filter by agent ID"),
|
|
1140
|
+
appId: Id.optional().describe("Filter by bot app ID"),
|
|
1141
|
+
startDate: z.string().optional().describe("Window start (ISO 8601)"),
|
|
1142
|
+
endDate: z.string().optional().describe("Window end (ISO 8601)"),
|
|
1143
|
+
workspaceId: Id.optional().describe("Filter by workspace ID")
|
|
1144
|
+
},
|
|
1145
|
+
document: GET_EXECUTION_METRICS,
|
|
1146
|
+
variables: (args) => ({
|
|
1147
|
+
filter: buildInput(args, ["agentId", "appId", "startDate", "endDate", "workspaceId"])
|
|
1148
|
+
})
|
|
1149
|
+
},
|
|
1150
|
+
{
|
|
1151
|
+
name: "create_execution",
|
|
1152
|
+
title: "Create Execution",
|
|
1153
|
+
description: "Record an execution (input/type/workspaceId are required).",
|
|
1154
|
+
inputSchema: {
|
|
1155
|
+
input: z.string().min(1).describe("Execution input/prompt"),
|
|
1156
|
+
type: ExecutionTypeEnum.describe("Execution type"),
|
|
1157
|
+
workspaceId: Id.describe("Workspace ID"),
|
|
1158
|
+
agentId: Id.optional().describe("Agent ID"),
|
|
1159
|
+
appId: Id.optional().describe("Bot app ID"),
|
|
1160
|
+
conversationId: Id.optional().describe("Conversation ID"),
|
|
1161
|
+
metadata: JsonObject.optional().describe("Arbitrary metadata JSON")
|
|
1162
|
+
},
|
|
1163
|
+
document: CREATE_EXECUTION,
|
|
1164
|
+
variables: (args) => ({
|
|
1165
|
+
input: buildInput(args, [
|
|
1166
|
+
"input",
|
|
1167
|
+
"type",
|
|
1168
|
+
"workspaceId",
|
|
1169
|
+
"agentId",
|
|
1170
|
+
"appId",
|
|
1171
|
+
"conversationId",
|
|
1172
|
+
"metadata"
|
|
1173
|
+
])
|
|
1174
|
+
})
|
|
1175
|
+
},
|
|
1176
|
+
{
|
|
1177
|
+
name: "run_execution",
|
|
1178
|
+
title: "Run Execution",
|
|
1179
|
+
description: "Execute a pending execution now (metered: botmanor.runs.count). Use create_execution first if no run exists.",
|
|
1180
|
+
inputSchema: { id: Id.describe("Execution ID") },
|
|
1181
|
+
document: RUN_EXECUTION,
|
|
1182
|
+
variables: ({ id }) => ({ id })
|
|
1183
|
+
},
|
|
1184
|
+
{
|
|
1185
|
+
name: "update_execution_status",
|
|
1186
|
+
title: "Update Execution Status",
|
|
1187
|
+
description: "Resolve an execution with a status and optional output/error/token details (metered).",
|
|
1188
|
+
inputSchema: {
|
|
1189
|
+
id: Id.describe("Execution ID"),
|
|
1190
|
+
status: ExecutionStatusEnum.describe("New status"),
|
|
1191
|
+
output: z.string().optional().describe("Output text"),
|
|
1192
|
+
errorCode: z.string().optional().describe("Error code on failure"),
|
|
1193
|
+
errorMessage: z.string().optional().describe("Error message on failure"),
|
|
1194
|
+
errorDetails: JsonObject.optional().describe("Structured error details JSON"),
|
|
1195
|
+
cost: z.number().optional().describe("Run cost"),
|
|
1196
|
+
duration: z.number().int().optional().describe("Duration in ms"),
|
|
1197
|
+
tokensUsed: z.number().int().optional().describe("Total tokens used"),
|
|
1198
|
+
inputTokens: z.number().int().optional().describe("Input tokens"),
|
|
1199
|
+
outputTokens: z.number().int().optional().describe("Output tokens"),
|
|
1200
|
+
ragChunks: z.number().int().optional().describe("RAG chunks retrieved"),
|
|
1201
|
+
toolCalls: z.number().int().optional().describe("Tool call count")
|
|
1202
|
+
},
|
|
1203
|
+
document: UPDATE_EXECUTION_STATUS,
|
|
1204
|
+
variables: (args) => ({
|
|
1205
|
+
id: args.id,
|
|
1206
|
+
input: buildInput(args, [
|
|
1207
|
+
"status",
|
|
1208
|
+
"output",
|
|
1209
|
+
"errorCode",
|
|
1210
|
+
"errorMessage",
|
|
1211
|
+
"errorDetails",
|
|
1212
|
+
"cost",
|
|
1213
|
+
"duration",
|
|
1214
|
+
"tokensUsed",
|
|
1215
|
+
"inputTokens",
|
|
1216
|
+
"outputTokens",
|
|
1217
|
+
"ragChunks",
|
|
1218
|
+
"toolCalls"
|
|
1219
|
+
])
|
|
1220
|
+
})
|
|
1221
|
+
}
|
|
1222
|
+
]);
|
|
1223
|
+
}
|
|
1224
|
+
function registerChatTools(server, ctx, track) {
|
|
1225
|
+
registerToolSet(server, ctx, track, [
|
|
1226
|
+
{
|
|
1227
|
+
name: "chat_with_agent",
|
|
1228
|
+
title: "Chat With Agent",
|
|
1229
|
+
description: "Send a message to an agent and get its reply (metered: botmanor.messages.count; reaches the LLM provider).",
|
|
1230
|
+
inputSchema: {
|
|
1231
|
+
agentId: Id.describe("Agent ID"),
|
|
1232
|
+
message: z.string().min(1).describe("User message"),
|
|
1233
|
+
conversationId: z.string().optional().describe("Continue an existing conversation"),
|
|
1234
|
+
llmApiKey: z.string().optional().describe("Optional LLM API key (takes priority over configured provider credentials)")
|
|
1235
|
+
},
|
|
1236
|
+
document: CHAT_WITH_AGENT,
|
|
1237
|
+
variables: ({ agentId, message, conversationId, llmApiKey }) => ({
|
|
1238
|
+
input: { agentId, message, conversationId, llmApiKey }
|
|
1239
|
+
})
|
|
1240
|
+
},
|
|
1241
|
+
{
|
|
1242
|
+
name: "list_conversations",
|
|
1243
|
+
title: "List My Conversations",
|
|
1244
|
+
description: "List the calling user's assistant conversations (optionally filtered by agent), newest first.",
|
|
1245
|
+
inputSchema: {
|
|
1246
|
+
agentId: Id.optional().describe("Filter by agent ID"),
|
|
1247
|
+
courseId: Id.optional().describe("Filter by course ID"),
|
|
1248
|
+
after: Id.optional().describe("Cursor for the next page")
|
|
1249
|
+
},
|
|
1250
|
+
document: MY_ASSISTANT_WORKFLOW_CONVERSATIONS,
|
|
1251
|
+
variables: ({ agentId, courseId, after }) => ({ agentId, courseId, after })
|
|
1252
|
+
},
|
|
1253
|
+
{
|
|
1254
|
+
name: "list_conversation_messages",
|
|
1255
|
+
title: "List Conversation Messages",
|
|
1256
|
+
description: "Read the turns of one of the calling user's assistant conversations.",
|
|
1257
|
+
inputSchema: {
|
|
1258
|
+
clientConversationId: Id.describe("Conversation ID from list_conversations"),
|
|
1259
|
+
agentId: Id.optional().describe("Agent ID (when the conversation spans agents)"),
|
|
1260
|
+
courseId: Id.optional().describe("Course ID"),
|
|
1261
|
+
before: z.string().optional().describe("Cursor for the previous page")
|
|
1262
|
+
},
|
|
1263
|
+
document: MY_ASSISTANT_WORKFLOW_CONVERSATION_MESSAGES,
|
|
1264
|
+
variables: ({ clientConversationId, agentId, courseId, before }) => ({
|
|
1265
|
+
clientConversationId,
|
|
1266
|
+
agentId,
|
|
1267
|
+
courseId,
|
|
1268
|
+
before
|
|
1269
|
+
})
|
|
1270
|
+
}
|
|
1271
|
+
]);
|
|
1272
|
+
}
|
|
1273
|
+
var CREATE_KB_KEYS = [
|
|
1274
|
+
"name",
|
|
1275
|
+
"workspaceId",
|
|
1276
|
+
"embeddingModel",
|
|
1277
|
+
"embeddingDimensions",
|
|
1278
|
+
"description",
|
|
1279
|
+
"chunkingStrategy",
|
|
1280
|
+
"chunkSize",
|
|
1281
|
+
"chunkOverlap",
|
|
1282
|
+
"vectorStoreDriver",
|
|
1283
|
+
"metadata"
|
|
1284
|
+
];
|
|
1285
|
+
var UPDATE_KB_KEYS = CREATE_KB_KEYS.filter(
|
|
1286
|
+
(key) => key !== "workspaceId" && key !== "embeddingModel" && key !== "embeddingDimensions"
|
|
1287
|
+
);
|
|
1288
|
+
function registerKnowledgeTools(server, ctx, track) {
|
|
1289
|
+
registerToolSet(server, ctx, track, [
|
|
1290
|
+
{
|
|
1291
|
+
name: "list_knowledge_bases",
|
|
1292
|
+
title: "List Knowledge Bases",
|
|
1293
|
+
description: "List the workspace's knowledge bases with optional filters and paging.",
|
|
1294
|
+
inputSchema: {
|
|
1295
|
+
search: z.string().optional().describe("Free-text filter"),
|
|
1296
|
+
indexStatus: IndexStatusEnum.optional().describe("Filter by index status"),
|
|
1297
|
+
workspaceId: Id.optional().describe("Filter by workspace ID"),
|
|
1298
|
+
...PaginationArgs
|
|
1299
|
+
},
|
|
1300
|
+
document: LIST_KNOWLEDGE_BASES,
|
|
1301
|
+
variables: (args) => listVariables(args, ["search", "indexStatus", "workspaceId"])
|
|
1302
|
+
},
|
|
1303
|
+
{
|
|
1304
|
+
name: "get_knowledge_base",
|
|
1305
|
+
title: "Get Knowledge Base",
|
|
1306
|
+
description: "Get one knowledge base by ID, including indexing state and vector counts.",
|
|
1307
|
+
inputSchema: { id: Id.describe("Knowledge base ID") },
|
|
1308
|
+
document: GET_KNOWLEDGE_BASE,
|
|
1309
|
+
variables: ({ id }) => ({ id }),
|
|
1310
|
+
notFoundWhenNull: true
|
|
1311
|
+
},
|
|
1312
|
+
{
|
|
1313
|
+
name: "create_knowledge_base",
|
|
1314
|
+
title: "Create Knowledge Base",
|
|
1315
|
+
description: "Create a knowledge base (metered: botmanor.knowledge_bases.count). name/workspaceId/embeddingModel/embeddingDimensions are required.",
|
|
1316
|
+
inputSchema: {
|
|
1317
|
+
name: z.string().min(1).describe("Display name"),
|
|
1318
|
+
workspaceId: Id.describe("Owning workspace ID"),
|
|
1319
|
+
embeddingModel: z.string().min(1).describe("Embedding model name"),
|
|
1320
|
+
embeddingDimensions: z.number().int().positive().describe("Embedding vector dimensions"),
|
|
1321
|
+
description: z.string().optional().describe("Description"),
|
|
1322
|
+
chunkingStrategy: z.string().optional().describe("Chunking strategy (default RECURSIVE)"),
|
|
1323
|
+
chunkSize: z.number().int().optional().describe("Chunk size (default 512)"),
|
|
1324
|
+
chunkOverlap: z.number().int().optional().describe("Chunk overlap (default 50)"),
|
|
1325
|
+
vectorStoreDriver: z.string().optional().describe("Storage backend (opensearch/milvus/postgres)"),
|
|
1326
|
+
metadata: JsonObject.optional().describe("Arbitrary metadata JSON")
|
|
1327
|
+
},
|
|
1328
|
+
document: CREATE_KNOWLEDGE_BASE,
|
|
1329
|
+
variables: (args) => ({ input: buildInput(args, CREATE_KB_KEYS) })
|
|
1330
|
+
},
|
|
1331
|
+
{
|
|
1332
|
+
name: "update_knowledge_base",
|
|
1333
|
+
title: "Update Knowledge Base",
|
|
1334
|
+
description: "Update a knowledge base; only the provided fields change.",
|
|
1335
|
+
inputSchema: {
|
|
1336
|
+
id: Id.describe("Knowledge base ID"),
|
|
1337
|
+
name: z.string().min(1).optional().describe("Display name"),
|
|
1338
|
+
description: z.string().optional().describe("Description"),
|
|
1339
|
+
chunkingStrategy: z.string().optional().describe("Chunking strategy"),
|
|
1340
|
+
chunkSize: z.number().int().optional().describe("Chunk size"),
|
|
1341
|
+
chunkOverlap: z.number().int().optional().describe("Chunk overlap"),
|
|
1342
|
+
metadata: JsonObject.optional().describe("Arbitrary metadata JSON")
|
|
1343
|
+
},
|
|
1344
|
+
document: UPDATE_KNOWLEDGE_BASE,
|
|
1345
|
+
variables: (args) => ({ id: args.id, input: buildInput(args, UPDATE_KB_KEYS) }),
|
|
1346
|
+
before: requireNonEmptyInput("Update Knowledge Base")
|
|
1347
|
+
},
|
|
1348
|
+
{
|
|
1349
|
+
name: "delete_knowledge_base",
|
|
1350
|
+
title: "Delete Knowledge Base",
|
|
1351
|
+
description: "Delete a knowledge base and all its documents/vectors. Destructive: requires confirm under an enforcing shell.",
|
|
1352
|
+
inputSchema: { id: Id.describe("Knowledge base ID") },
|
|
1353
|
+
document: DELETE_KNOWLEDGE_BASE,
|
|
1354
|
+
variables: ({ id }) => ({ id })
|
|
1355
|
+
},
|
|
1356
|
+
{
|
|
1357
|
+
name: "list_knowledge_documents",
|
|
1358
|
+
title: "List Knowledge Documents",
|
|
1359
|
+
description: "List the documents of a knowledge base.",
|
|
1360
|
+
inputSchema: { knowledgeBaseId: Id.describe("Knowledge base ID"), ...PaginationArgs },
|
|
1361
|
+
document: LIST_KNOWLEDGE_DOCUMENTS,
|
|
1362
|
+
variables: (args) => ({
|
|
1363
|
+
knowledgeBaseId: args.knowledgeBaseId,
|
|
1364
|
+
pagination: listVariables(args, []).pagination
|
|
1365
|
+
})
|
|
1366
|
+
},
|
|
1367
|
+
{
|
|
1368
|
+
name: "get_knowledge_document",
|
|
1369
|
+
title: "Get Knowledge Document",
|
|
1370
|
+
description: "Get one knowledge document by ID, including content and processing state.",
|
|
1371
|
+
inputSchema: { id: Id.describe("Knowledge document ID") },
|
|
1372
|
+
document: GET_KNOWLEDGE_DOCUMENT,
|
|
1373
|
+
variables: ({ id }) => ({ id }),
|
|
1374
|
+
notFoundWhenNull: true
|
|
1375
|
+
},
|
|
1376
|
+
{
|
|
1377
|
+
name: "add_knowledge_document",
|
|
1378
|
+
title: "Add Knowledge Document",
|
|
1379
|
+
description: "Add a text document to a knowledge base (chunking/indexing runs server-side).",
|
|
1380
|
+
inputSchema: {
|
|
1381
|
+
knowledgeBaseId: Id.describe("Knowledge base ID"),
|
|
1382
|
+
title: z.string().min(1).describe("Document title"),
|
|
1383
|
+
content: z.string().min(1).describe("Document text content"),
|
|
1384
|
+
fileId: Id.describe("Backing file ID"),
|
|
1385
|
+
metadata: JsonObject.optional().describe("Arbitrary metadata JSON")
|
|
1386
|
+
},
|
|
1387
|
+
document: ADD_KNOWLEDGE_DOCUMENT,
|
|
1388
|
+
variables: ({ knowledgeBaseId, title, content, fileId, metadata }) => ({
|
|
1389
|
+
input: { knowledgeBaseId, title, content, fileId, metadata }
|
|
1390
|
+
})
|
|
1391
|
+
},
|
|
1392
|
+
{
|
|
1393
|
+
name: "remove_knowledge_document",
|
|
1394
|
+
title: "Remove Knowledge Document",
|
|
1395
|
+
description: "Remove a document (and its chunks) from a knowledge base. Destructive: requires confirm under an enforcing shell.",
|
|
1396
|
+
inputSchema: { id: Id.describe("Knowledge document ID") },
|
|
1397
|
+
document: REMOVE_KNOWLEDGE_DOCUMENT,
|
|
1398
|
+
variables: ({ id }) => ({ id })
|
|
1399
|
+
},
|
|
1400
|
+
{
|
|
1401
|
+
name: "search_knowledge",
|
|
1402
|
+
title: "Search Knowledge",
|
|
1403
|
+
description: "Vector-search a knowledge base for chunks matching a natural-language query.",
|
|
1404
|
+
inputSchema: {
|
|
1405
|
+
knowledgeBaseId: Id.describe("Knowledge base ID"),
|
|
1406
|
+
query: z.string().min(1).describe("Natural-language query"),
|
|
1407
|
+
topK: z.number().int().positive().optional().describe("Max chunks to return (default 5)")
|
|
1408
|
+
},
|
|
1409
|
+
document: SEARCH_KNOWLEDGE,
|
|
1410
|
+
variables: ({ knowledgeBaseId, query, topK }) => ({ knowledgeBaseId, query, topK })
|
|
1411
|
+
}
|
|
1412
|
+
]);
|
|
1413
|
+
}
|
|
1414
|
+
var CREATE_CONNECTOR_KEYS = [
|
|
1415
|
+
"name",
|
|
1416
|
+
"type",
|
|
1417
|
+
"workspaceId",
|
|
1418
|
+
"description",
|
|
1419
|
+
"status",
|
|
1420
|
+
"visibility",
|
|
1421
|
+
"bucketId",
|
|
1422
|
+
"credentialsRefId",
|
|
1423
|
+
"defaultPolicyBindings",
|
|
1424
|
+
"tags",
|
|
1425
|
+
"metadata"
|
|
1426
|
+
];
|
|
1427
|
+
function registerChannelTools(server, ctx, track) {
|
|
1428
|
+
registerToolSet(server, ctx, track, [
|
|
1429
|
+
// ── Routes ────────────────────────────────────────────────────────────
|
|
1430
|
+
{
|
|
1431
|
+
name: "list_channel_routes",
|
|
1432
|
+
title: "List Channel Routes",
|
|
1433
|
+
description: "List channel routes (app-on-connector bindings) with optional filters.",
|
|
1434
|
+
inputSchema: {
|
|
1435
|
+
appId: Id.optional().describe("Filter by bot app ID"),
|
|
1436
|
+
connectorId: Id.optional().describe("Filter by connector ID"),
|
|
1437
|
+
workspaceId: Id.optional().describe("Filter by workspace ID"),
|
|
1438
|
+
...PaginationArgs
|
|
1439
|
+
},
|
|
1440
|
+
document: LIST_CHANNEL_ROUTES,
|
|
1441
|
+
variables: (args) => listVariables(args, ["appId", "connectorId", "workspaceId"])
|
|
1442
|
+
},
|
|
1443
|
+
{
|
|
1444
|
+
name: "get_channel_route",
|
|
1445
|
+
title: "Get Channel Route",
|
|
1446
|
+
description: "Get one channel route by ID.",
|
|
1447
|
+
inputSchema: { id: Id.describe("Route ID") },
|
|
1448
|
+
document: GET_CHANNEL_ROUTE,
|
|
1449
|
+
variables: ({ id }) => ({ id }),
|
|
1450
|
+
notFoundWhenNull: true
|
|
1451
|
+
},
|
|
1452
|
+
{
|
|
1453
|
+
name: "create_channel_route",
|
|
1454
|
+
title: "Create Channel Route",
|
|
1455
|
+
description: "Expose a bot app on a connector location (e.g. a Slack channel or webhook path).",
|
|
1456
|
+
inputSchema: {
|
|
1457
|
+
appId: Id.describe("Bot app ID"),
|
|
1458
|
+
connectorId: Id.describe("Connector ID"),
|
|
1459
|
+
locationId: z.string().min(1).describe("Channel-specific location (channel ID, route path, ...)"),
|
|
1460
|
+
workspaceId: Id.describe("Workspace ID"),
|
|
1461
|
+
formatPolicyId: Id.optional().describe("Message format policy ID"),
|
|
1462
|
+
policyBindings: JsonObject.optional().describe("Policy bindings JSON"),
|
|
1463
|
+
routingOverrides: JsonObject.optional().describe("Routing overrides JSON"),
|
|
1464
|
+
metadata: JsonObject.optional().describe("Arbitrary metadata JSON")
|
|
1465
|
+
},
|
|
1466
|
+
document: CREATE_CHANNEL_ROUTE,
|
|
1467
|
+
variables: (args) => ({
|
|
1468
|
+
input: buildInput(args, [
|
|
1469
|
+
"appId",
|
|
1470
|
+
"connectorId",
|
|
1471
|
+
"locationId",
|
|
1472
|
+
"workspaceId",
|
|
1473
|
+
"formatPolicyId",
|
|
1474
|
+
"policyBindings",
|
|
1475
|
+
"routingOverrides",
|
|
1476
|
+
"metadata"
|
|
1477
|
+
])
|
|
1478
|
+
})
|
|
1479
|
+
},
|
|
1480
|
+
{
|
|
1481
|
+
name: "update_channel_route",
|
|
1482
|
+
title: "Update Channel Route",
|
|
1483
|
+
description: "Update a channel route; only the provided fields change.",
|
|
1484
|
+
inputSchema: {
|
|
1485
|
+
id: Id.describe("Route ID"),
|
|
1486
|
+
appId: Id.optional().describe("Bot app ID"),
|
|
1487
|
+
locationId: z.string().min(1).optional().describe("Channel-specific location"),
|
|
1488
|
+
formatPolicyId: Id.optional().describe("Message format policy ID"),
|
|
1489
|
+
policyBindings: JsonObject.optional().describe("Policy bindings JSON"),
|
|
1490
|
+
routingOverrides: JsonObject.optional().describe("Routing overrides JSON"),
|
|
1491
|
+
metadata: JsonObject.optional().describe("Arbitrary metadata JSON")
|
|
1492
|
+
},
|
|
1493
|
+
document: UPDATE_CHANNEL_ROUTE,
|
|
1494
|
+
variables: (args) => ({
|
|
1495
|
+
id: args.id,
|
|
1496
|
+
input: buildInput(args, [
|
|
1497
|
+
"appId",
|
|
1498
|
+
"locationId",
|
|
1499
|
+
"formatPolicyId",
|
|
1500
|
+
"policyBindings",
|
|
1501
|
+
"routingOverrides",
|
|
1502
|
+
"metadata"
|
|
1503
|
+
])
|
|
1504
|
+
}),
|
|
1505
|
+
before: requireNonEmptyInput("Update Channel Route")
|
|
1506
|
+
},
|
|
1507
|
+
{
|
|
1508
|
+
name: "delete_channel_route",
|
|
1509
|
+
title: "Delete Channel Route",
|
|
1510
|
+
description: "Remove a bot app from a channel location. Destructive: requires confirm under an enforcing shell.",
|
|
1511
|
+
inputSchema: { id: Id.describe("Route ID") },
|
|
1512
|
+
document: DELETE_CHANNEL_ROUTE,
|
|
1513
|
+
variables: ({ id }) => ({ id })
|
|
1514
|
+
},
|
|
1515
|
+
// ── Connectors ────────────────────────────────────────────────────────
|
|
1516
|
+
{
|
|
1517
|
+
name: "list_channel_connectors",
|
|
1518
|
+
title: "List Channel Connectors",
|
|
1519
|
+
description: "List the workspace's channel connectors with optional filters.",
|
|
1520
|
+
inputSchema: {
|
|
1521
|
+
search: z.string().optional().describe("Free-text filter"),
|
|
1522
|
+
type: ChannelTypeEnum.optional().describe("Filter by channel type"),
|
|
1523
|
+
status: EntityStatusEnum.optional().describe("Filter by status"),
|
|
1524
|
+
workspaceId: Id.optional().describe("Filter by workspace ID"),
|
|
1525
|
+
...PaginationArgs
|
|
1526
|
+
},
|
|
1527
|
+
document: LIST_CHANNEL_CONNECTORS,
|
|
1528
|
+
variables: (args) => listVariables(args, ["search", "type", "status", "workspaceId"])
|
|
1529
|
+
},
|
|
1530
|
+
{
|
|
1531
|
+
name: "get_channel_connector",
|
|
1532
|
+
title: "Get Channel Connector",
|
|
1533
|
+
description: "Get one channel connector by ID.",
|
|
1534
|
+
inputSchema: { id: Id.describe("Connector ID") },
|
|
1535
|
+
document: GET_CHANNEL_CONNECTOR,
|
|
1536
|
+
variables: ({ id }) => ({ id }),
|
|
1537
|
+
notFoundWhenNull: true
|
|
1538
|
+
},
|
|
1539
|
+
{
|
|
1540
|
+
name: "create_channel_connector",
|
|
1541
|
+
title: "Create Channel Connector",
|
|
1542
|
+
description: "Register a third-party channel account (Slack, Discord, WhatsApp, webhook, ...) that routes can bind to.",
|
|
1543
|
+
inputSchema: {
|
|
1544
|
+
name: z.string().min(1).describe("Display name"),
|
|
1545
|
+
type: ChannelTypeEnum.describe("Channel type"),
|
|
1546
|
+
workspaceId: Id.describe("Workspace ID"),
|
|
1547
|
+
description: z.string().optional().describe("Description"),
|
|
1548
|
+
status: EntityStatusEnum.optional().describe("Initial status (default DRAFT)"),
|
|
1549
|
+
visibility: ConnectorVisibilityEnum.optional().describe("Visibility (default PRIVATE)"),
|
|
1550
|
+
bucketId: Id.optional().describe("Storage bucket ID"),
|
|
1551
|
+
credentialsRefId: Id.optional().describe("Reference to stored channel credentials"),
|
|
1552
|
+
defaultPolicyBindings: JsonObject.optional().describe("Default policy bindings JSON"),
|
|
1553
|
+
tags: z.array(z.string()).optional().describe("Tags"),
|
|
1554
|
+
metadata: JsonObject.optional().describe("Arbitrary metadata JSON")
|
|
1555
|
+
},
|
|
1556
|
+
document: CREATE_CHANNEL_CONNECTOR,
|
|
1557
|
+
variables: (args) => ({ input: buildInput(args, CREATE_CONNECTOR_KEYS) })
|
|
1558
|
+
},
|
|
1559
|
+
{
|
|
1560
|
+
name: "update_channel_connector",
|
|
1561
|
+
title: "Update Channel Connector",
|
|
1562
|
+
description: "Update a channel connector; only the provided fields change.",
|
|
1563
|
+
inputSchema: {
|
|
1564
|
+
id: Id.describe("Connector ID"),
|
|
1565
|
+
name: z.string().min(1).optional().describe("Display name"),
|
|
1566
|
+
description: z.string().optional().describe("Description"),
|
|
1567
|
+
status: EntityStatusEnum.optional().describe("Status"),
|
|
1568
|
+
visibility: ConnectorVisibilityEnum.optional().describe("Visibility"),
|
|
1569
|
+
bucketId: Id.optional().describe("Storage bucket ID"),
|
|
1570
|
+
credentialsRefId: Id.optional().describe("Reference to stored channel credentials"),
|
|
1571
|
+
defaultPolicyBindings: JsonObject.optional().describe("Default policy bindings JSON"),
|
|
1572
|
+
tags: z.array(z.string()).optional().describe("Tags"),
|
|
1573
|
+
metadata: JsonObject.optional().describe("Arbitrary metadata JSON")
|
|
1574
|
+
},
|
|
1575
|
+
document: UPDATE_CHANNEL_CONNECTOR,
|
|
1576
|
+
variables: (args) => ({
|
|
1577
|
+
id: args.id,
|
|
1578
|
+
input: buildInput(
|
|
1579
|
+
args,
|
|
1580
|
+
CREATE_CONNECTOR_KEYS.filter((key) => key !== "type" && key !== "workspaceId")
|
|
1581
|
+
)
|
|
1582
|
+
}),
|
|
1583
|
+
before: requireNonEmptyInput("Update Channel Connector")
|
|
1584
|
+
},
|
|
1585
|
+
{
|
|
1586
|
+
name: "delete_channel_connector",
|
|
1587
|
+
title: "Delete Channel Connector",
|
|
1588
|
+
description: "Delete a channel connector (and its routes). Destructive: requires confirm under an enforcing shell.",
|
|
1589
|
+
inputSchema: { id: Id.describe("Connector ID") },
|
|
1590
|
+
document: DELETE_CHANNEL_CONNECTOR,
|
|
1591
|
+
variables: ({ id }) => ({ id })
|
|
1592
|
+
}
|
|
1593
|
+
]);
|
|
1594
|
+
}
|
|
1595
|
+
function registerStoreTools(server, ctx, track) {
|
|
1596
|
+
registerToolSet(server, ctx, track, [
|
|
1597
|
+
{
|
|
1598
|
+
name: "list_store_packages",
|
|
1599
|
+
title: "List Store Packages",
|
|
1600
|
+
description: "Browse the BotManor package registry with optional filters and paging.",
|
|
1601
|
+
inputSchema: {
|
|
1602
|
+
search: z.string().optional().describe("Free-text filter"),
|
|
1603
|
+
kind: PackageKindEnum.optional().describe("Filter by package kind"),
|
|
1604
|
+
...PaginationArgs
|
|
1605
|
+
},
|
|
1606
|
+
document: LIST_STORE_PACKAGES,
|
|
1607
|
+
variables: (args) => listVariables(args, ["search", "kind"])
|
|
1608
|
+
},
|
|
1609
|
+
{
|
|
1610
|
+
name: "get_store_package",
|
|
1611
|
+
title: "Get Store Package",
|
|
1612
|
+
description: "Get one package by ID, including its manifest.",
|
|
1613
|
+
inputSchema: { id: Id.describe("Package ID") },
|
|
1614
|
+
document: GET_STORE_PACKAGE,
|
|
1615
|
+
variables: ({ id }) => ({ id }),
|
|
1616
|
+
notFoundWhenNull: true
|
|
1617
|
+
},
|
|
1618
|
+
{
|
|
1619
|
+
name: "get_store_package_by_slug",
|
|
1620
|
+
title: "Get Store Package By Slug",
|
|
1621
|
+
description: "Look up a package by its unique slug.",
|
|
1622
|
+
inputSchema: { slug: z.string().min(1).describe("Package slug") },
|
|
1623
|
+
document: GET_STORE_PACKAGE_BY_SLUG,
|
|
1624
|
+
variables: ({ slug }) => ({ slug }),
|
|
1625
|
+
notFoundWhenNull: true
|
|
1626
|
+
},
|
|
1627
|
+
{
|
|
1628
|
+
name: "list_installed_packages",
|
|
1629
|
+
title: "List Installed Packages",
|
|
1630
|
+
description: "List the workspace's installed packages (workspaceId is required by the backend).",
|
|
1631
|
+
inputSchema: {
|
|
1632
|
+
workspaceId: Id.describe("Workspace ID (required filter)"),
|
|
1633
|
+
packageId: Id.optional().describe("Filter by package ID"),
|
|
1634
|
+
mode: InstallModeEnum.optional().describe("Filter by install mode"),
|
|
1635
|
+
...PaginationArgs
|
|
1636
|
+
},
|
|
1637
|
+
document: LIST_INSTALLED_PACKAGES,
|
|
1638
|
+
variables: (args) => {
|
|
1639
|
+
const variables = listVariables(args, ["packageId", "mode", "workspaceId"]);
|
|
1640
|
+
if (variables.filters === void 0) variables.filters = {};
|
|
1641
|
+
return variables;
|
|
1642
|
+
}
|
|
1643
|
+
},
|
|
1644
|
+
{
|
|
1645
|
+
name: "get_installed_package",
|
|
1646
|
+
title: "Get Installed Package",
|
|
1647
|
+
description: "Get one installation by ID, including the resolved package.",
|
|
1648
|
+
inputSchema: { id: Id.describe("Installation ID") },
|
|
1649
|
+
document: GET_INSTALLED_PACKAGE,
|
|
1650
|
+
variables: ({ id }) => ({ id }),
|
|
1651
|
+
notFoundWhenNull: true
|
|
1652
|
+
},
|
|
1653
|
+
{
|
|
1654
|
+
name: "install_package",
|
|
1655
|
+
title: "Install Package",
|
|
1656
|
+
description: "Install a package into the workspace. Destructive: requires confirm under an enforcing shell.",
|
|
1657
|
+
inputSchema: {
|
|
1658
|
+
packageId: Id.describe("Package ID"),
|
|
1659
|
+
workspaceId: Id.describe("Workspace ID"),
|
|
1660
|
+
version: z.string().optional().describe("Pin a specific version"),
|
|
1661
|
+
mode: InstallModeEnum.optional().describe("Install mode (LINKED or FORKED)"),
|
|
1662
|
+
bindings: JsonObject.optional().describe("Resource bindings JSON"),
|
|
1663
|
+
pinnedByEnv: JsonObject.optional().describe("Environment pins JSON"),
|
|
1664
|
+
metadata: JsonObject.optional().describe("Arbitrary metadata JSON")
|
|
1665
|
+
},
|
|
1666
|
+
document: INSTALL_PACKAGE,
|
|
1667
|
+
variables: (args) => ({
|
|
1668
|
+
input: buildInput(args, [
|
|
1669
|
+
"packageId",
|
|
1670
|
+
"workspaceId",
|
|
1671
|
+
"version",
|
|
1672
|
+
"mode",
|
|
1673
|
+
"bindings",
|
|
1674
|
+
"pinnedByEnv",
|
|
1675
|
+
"metadata"
|
|
1676
|
+
])
|
|
1677
|
+
})
|
|
1678
|
+
},
|
|
1679
|
+
{
|
|
1680
|
+
name: "uninstall_package",
|
|
1681
|
+
title: "Uninstall Package",
|
|
1682
|
+
description: "Uninstall a package from the workspace. Destructive: requires confirm under an enforcing shell.",
|
|
1683
|
+
inputSchema: { id: Id.describe("Installation ID") },
|
|
1684
|
+
document: UNINSTALL_PACKAGE,
|
|
1685
|
+
variables: ({ id }) => ({ id })
|
|
1686
|
+
},
|
|
1687
|
+
{
|
|
1688
|
+
name: "update_installed_package",
|
|
1689
|
+
title: "Update Installed Package",
|
|
1690
|
+
description: "Change an installation (version pin, mode, bindings, metadata).",
|
|
1691
|
+
inputSchema: {
|
|
1692
|
+
id: Id.describe("Installation ID"),
|
|
1693
|
+
installedVersion: z.string().optional().describe("Pin a different installed version"),
|
|
1694
|
+
mode: InstallModeEnum.optional().describe("Install mode"),
|
|
1695
|
+
bindings: JsonObject.optional().describe("Resource bindings JSON"),
|
|
1696
|
+
pinnedByEnv: JsonObject.optional().describe("Environment pins JSON"),
|
|
1697
|
+
metadata: JsonObject.optional().describe("Arbitrary metadata JSON")
|
|
1698
|
+
},
|
|
1699
|
+
document: UPDATE_INSTALLED_PACKAGE,
|
|
1700
|
+
variables: (args) => ({
|
|
1701
|
+
id: args.id,
|
|
1702
|
+
input: buildInput(args, [
|
|
1703
|
+
"installedVersion",
|
|
1704
|
+
"mode",
|
|
1705
|
+
"bindings",
|
|
1706
|
+
"pinnedByEnv",
|
|
1707
|
+
"metadata"
|
|
1708
|
+
])
|
|
1709
|
+
}),
|
|
1710
|
+
before: requireNonEmptyInput("Update Installed Package")
|
|
1711
|
+
}
|
|
1712
|
+
]);
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
// src/modules/botmanor/resources.ts
|
|
1716
|
+
function registerBotmanorResources(server, ctx, track) {
|
|
1717
|
+
const schemaUri = track(mcpResourceUri(ctx.productName, "schema"));
|
|
1718
|
+
const appsUri = track(mcpResourceUri(ctx.productName, "apps"));
|
|
1719
|
+
const agentsUri = track(mcpResourceUri(ctx.productName, "agents"));
|
|
1720
|
+
const knowledgeUri = track(mcpResourceUri(ctx.productName, "knowledge"));
|
|
1721
|
+
server.registerResource(
|
|
1722
|
+
"botmanor-schema",
|
|
1723
|
+
schemaUri,
|
|
1724
|
+
{
|
|
1725
|
+
title: "BotManor Domain Schema",
|
|
1726
|
+
description: "Overview of the BotManor domain \u2014 entities, enums, and the per-entity tool surface.",
|
|
1727
|
+
mimeType: "text/plain"
|
|
1728
|
+
},
|
|
1729
|
+
async () => {
|
|
1730
|
+
ctx.logger.debug(`Resource ${schemaUri} requested`);
|
|
1731
|
+
const schema = `# BotManor Domain (Overview)
|
|
1732
|
+
|
|
1733
|
+
Customer-facing bot apps backed by reusable AI agents, with RAG knowledge bases, channel delivery and an in-product package registry.
|
|
1734
|
+
|
|
1735
|
+
## Entities
|
|
1736
|
+
- BotApp \u2014 the customer-facing bot (routes to agents; priced unit)
|
|
1737
|
+
- BotAppVersion \u2014 draft/published/historical config snapshots of a bot app
|
|
1738
|
+
- BotmanorAgent \u2014 an internal reusable AI worker (prompt, model, capabilities)
|
|
1739
|
+
- AgentVersion \u2014 versioned config snapshots of an agent
|
|
1740
|
+
- AppAgent \u2014 routing binding from a bot app to an agent (priority, intents, fallback)
|
|
1741
|
+
- Execution \u2014 one bot/agent/workflow run (input, output, tokens, cost)
|
|
1742
|
+
- KnowledgeBase / KnowledgeDocument / KnowledgeChunk \u2014 RAG storage
|
|
1743
|
+
- ChannelConnector \u2014 a third-party channel account (Slack, Discord, webhook, ...)
|
|
1744
|
+
- ChannelRoute \u2014 exposes a bot app on a connector location
|
|
1745
|
+
- StorePackage / InstalledPackage \u2014 the in-product package registry + workspace installs
|
|
1746
|
+
|
|
1747
|
+
## Enums
|
|
1748
|
+
- BotAppType / BotmanorAgentType: ASSISTANT, AUTOMATION, ANALYST, SPECIALIST
|
|
1749
|
+
- BotAppStatus / BotmanorAgentStatus: DRAFT, ACTIVE, PAUSED, (TRAINING,) ARCHIVED
|
|
1750
|
+
- VersionStatus: DRAFT, PUBLISHED, HISTORICAL
|
|
1751
|
+
- RoutingStrategy: SINGLE, ROUND_ROBIN, INTELLIGENT, CUSTOM
|
|
1752
|
+
- ExecutionType: AGENT, APP, WORKFLOW
|
|
1753
|
+
- ExecutionStatus: PENDING, RUNNING, COMPLETED, FAILED, CANCELLED, TIMEOUT
|
|
1754
|
+
- IndexStatus: EMPTY, INDEXING, READY, REBUILDING, FAILED
|
|
1755
|
+
- ChannelType: SLACK, DISCORD, WHATSAPP, TEAMS, EMAIL, SMS, WEB_WIDGET, WEBHOOK, CUSTOM
|
|
1756
|
+
- PackageKind: AGENT, APP, KNOWLEDGE_BASE, PROMPT, SKILL, TOOL, WORKFLOW, MCP_PACK, ...
|
|
1757
|
+
|
|
1758
|
+
## Tool surface (63 tools)
|
|
1759
|
+
- Bot apps: <product>_list_bot_apps, get_bot_app, get_bot_app_stats, list_bot_app_versions, get_bot_app_version, create_bot_app, update_bot_app, delete_bot_app, publish_bot_app_version, rollback_bot_app_version
|
|
1760
|
+
- Agents: <product>_list_agents, get_agent, get_agent_stats, list_agent_versions, get_agent_version, create_agent, update_agent, delete_agent, publish_agent_version, rollback_agent_version
|
|
1761
|
+
- Routing: <product>_list_app_agents, get_app_agent, create_app_agent, update_app_agent, delete_app_agent
|
|
1762
|
+
- Executions: <product>_list_executions, get_execution, get_execution_metrics, create_execution, run_execution, update_execution_status
|
|
1763
|
+
- Chat: <product>_chat_with_agent, list_conversations, list_conversation_messages
|
|
1764
|
+
- Knowledge: <product>_list_knowledge_bases, get_knowledge_base, create_knowledge_base, update_knowledge_base, delete_knowledge_base, list_knowledge_documents, get_knowledge_document, add_knowledge_document, remove_knowledge_document, search_knowledge
|
|
1765
|
+
- Channels: <product>_list_channel_routes, get_channel_route, create_channel_route, update_channel_route, delete_channel_route, list_channel_connectors, get_channel_connector, create_channel_connector, update_channel_connector, delete_channel_connector
|
|
1766
|
+
- Store: <product>_list_store_packages, get_store_package, get_store_package_by_slug, list_installed_packages, get_installed_package, install_package, uninstall_package, update_installed_package
|
|
1767
|
+
|
|
1768
|
+
Destructive tools (deletes, publish/rollback, install/uninstall) carry destructiveHint and require confirm: true under a shell that enables enforceDestructiveConfirmation.
|
|
1769
|
+
`;
|
|
1770
|
+
return { contents: [{ uri: schemaUri, mimeType: "text/plain", text: schema }] };
|
|
1771
|
+
}
|
|
1772
|
+
);
|
|
1773
|
+
const readListResource = (name, uri, title, description, document) => {
|
|
1774
|
+
server.registerResource(
|
|
1775
|
+
name,
|
|
1776
|
+
uri,
|
|
1777
|
+
{ title, description, mimeType: "application/json" },
|
|
1778
|
+
async () => {
|
|
1779
|
+
ctx.logger.debug(`Resource ${uri} requested`);
|
|
1780
|
+
try {
|
|
1781
|
+
const data = await ctx.gql.workspace.request(document, {});
|
|
1782
|
+
const payload = Object.values(data)[0];
|
|
1783
|
+
return {
|
|
1784
|
+
contents: [{ uri, mimeType: "application/json", text: JSON.stringify(payload) }]
|
|
1785
|
+
};
|
|
1786
|
+
} catch (error) {
|
|
1787
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1788
|
+
return {
|
|
1789
|
+
contents: [{ uri, mimeType: "text/plain", text: `error: ${title} failed: ${message}` }]
|
|
1790
|
+
};
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1793
|
+
);
|
|
1794
|
+
};
|
|
1795
|
+
readListResource(
|
|
1796
|
+
"botmanor-apps",
|
|
1797
|
+
appsUri,
|
|
1798
|
+
"BotManor Bot Apps",
|
|
1799
|
+
"The workspace's bot apps (same payload as list_bot_apps with no filters).",
|
|
1800
|
+
LIST_BOT_APPS
|
|
1801
|
+
);
|
|
1802
|
+
readListResource(
|
|
1803
|
+
"botmanor-agents",
|
|
1804
|
+
agentsUri,
|
|
1805
|
+
"BotManor Agents",
|
|
1806
|
+
"The workspace's agents (same payload as list_agents with no filters).",
|
|
1807
|
+
LIST_BOTMANOR_AGENTS
|
|
1808
|
+
);
|
|
1809
|
+
readListResource(
|
|
1810
|
+
"botmanor-knowledge",
|
|
1811
|
+
knowledgeUri,
|
|
1812
|
+
"BotManor Knowledge Bases",
|
|
1813
|
+
"The workspace's knowledge bases (same payload as list_knowledge_bases with no filters).",
|
|
1814
|
+
LIST_KNOWLEDGE_BASES
|
|
1815
|
+
);
|
|
1816
|
+
}
|
|
1817
|
+
function registerBotmanorPrompts(server, ctx, track) {
|
|
1818
|
+
const p = ctx.productName;
|
|
1819
|
+
const promptName = track(mcpPromptName(p, "agent-system-prompt"));
|
|
1820
|
+
const kbName = track(mcpPromptName(p, "knowledge-onboarding"));
|
|
1821
|
+
server.registerPrompt(
|
|
1822
|
+
promptName,
|
|
1823
|
+
{
|
|
1824
|
+
title: "Agent System Prompt",
|
|
1825
|
+
description: "Guide for drafting a strong BotManor agent system prompt and wiring the agent end to end.",
|
|
1826
|
+
argsSchema: {
|
|
1827
|
+
type: z.enum(["ASSISTANT", "AUTOMATION", "ANALYST", "SPECIALIST"]).optional().describe("Agent type"),
|
|
1828
|
+
purpose: z.string().optional().describe("What the agent should do")
|
|
1829
|
+
}
|
|
1830
|
+
},
|
|
1831
|
+
({ type, purpose }) => {
|
|
1832
|
+
ctx.logger.debug(`Prompt ${promptName} called`, { type, purpose });
|
|
1833
|
+
const typeNote = type ? `The agent type is ${type}.` : "Pick the agent type first.";
|
|
1834
|
+
const purposeNote = purpose ? `The agent should: ${purpose}.` : "Ask the user what the agent should do.";
|
|
1835
|
+
return {
|
|
1836
|
+
messages: [
|
|
1837
|
+
{
|
|
1838
|
+
role: "user",
|
|
1839
|
+
content: {
|
|
1840
|
+
type: "text",
|
|
1841
|
+
text: `Help me design a BotManor agent.
|
|
1842
|
+
|
|
1843
|
+
1. **Draft the system prompt**: ${typeNote} ${purposeNote} A good BotManor system prompt names the role, the scope of answers, the tools/knowledge available, the tone, and the escalation behaviour when the agent does not know something. Keep it under ~800 tokens.
|
|
1844
|
+
2. **Create the agent**: Use ${p}_create_agent with a name, slug, the drafted systemPrompt, the matching type, and capabilities (RAG when it must answer from knowledge bases, MCP_TOOLS when it calls external tools).
|
|
1845
|
+
3. **Attach knowledge (optional)**: Use ${p}_list_knowledge_bases to find existing bases, then ${p}_update_agent with knowledgeBaseIds.
|
|
1846
|
+
4. **Publish carefully**: Use ${p}_publish_agent_version only when the draft version is ready \u2014 it moves traffic (destructive, needs confirm).
|
|
1847
|
+
5. **Bind to an app**: Use ${p}_create_app_agent to route a bot app to the new agent.
|
|
1848
|
+
|
|
1849
|
+
Show the drafted prompt for approval before creating anything.`
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1852
|
+
]
|
|
1853
|
+
};
|
|
1854
|
+
}
|
|
1855
|
+
);
|
|
1856
|
+
server.registerPrompt(
|
|
1857
|
+
kbName,
|
|
1858
|
+
{
|
|
1859
|
+
title: "Knowledge Base Onboarding",
|
|
1860
|
+
description: "Guide for creating a BotManor knowledge base, loading documents and verifying retrieval.",
|
|
1861
|
+
argsSchema: {
|
|
1862
|
+
purpose: z.string().optional().describe("What the knowledge base is for")
|
|
1863
|
+
}
|
|
1864
|
+
},
|
|
1865
|
+
({ purpose }) => {
|
|
1866
|
+
ctx.logger.debug(`Prompt ${kbName} called`, { purpose });
|
|
1867
|
+
const purposeNote = purpose ? `The knowledge base is for: ${purpose}.` : "";
|
|
1868
|
+
return {
|
|
1869
|
+
messages: [
|
|
1870
|
+
{
|
|
1871
|
+
role: "user",
|
|
1872
|
+
content: {
|
|
1873
|
+
type: "text",
|
|
1874
|
+
text: `Help me stand up a BotManor knowledge base. ${purposeNote}
|
|
1875
|
+
|
|
1876
|
+
1. **Create the base**: Use ${p}_create_knowledge_base with a name, the workspaceId, an embeddingModel and its embeddingDimensions (match the model \u2014 e.g. 1536 for text-embedding-3-small).
|
|
1877
|
+
2. **Add documents**: Use ${p}_add_knowledge_document per source text (title, content, and a backing fileId). Chunking and indexing run server-side.
|
|
1878
|
+
3. **Watch indexing**: Use ${p}_get_knowledge_base until indexStatus is READY (or FAILED \u2014 check the documents' processingError).
|
|
1879
|
+
4. **Verify retrieval**: Use ${p}_search_knowledge with a few natural-language questions and confirm the returned chunks are relevant.
|
|
1880
|
+
5. **Attach it**: Reference the base from an agent via ${p}_update_agent (knowledgeBaseIds).
|
|
1881
|
+
|
|
1882
|
+
Show each step's result before continuing.`
|
|
1883
|
+
}
|
|
1884
|
+
}
|
|
1885
|
+
]
|
|
1886
|
+
};
|
|
1887
|
+
}
|
|
1888
|
+
);
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
// src/modules/botmanor/index.ts
|
|
1892
|
+
function botmanorToolAnnotations(productName) {
|
|
1893
|
+
return (toolName) => {
|
|
1894
|
+
const prefix = `${productName}_`;
|
|
1895
|
+
const unprefixed = toolName.startsWith(prefix) ? toolName.slice(prefix.length) : toolName;
|
|
1896
|
+
return BOTMANOR_TOOL_ANNOTATIONS[unprefixed];
|
|
1897
|
+
};
|
|
1898
|
+
}
|
|
1899
|
+
var botmanorModule = {
|
|
1900
|
+
id: "botmanor",
|
|
1901
|
+
version: "0.0.1",
|
|
1902
|
+
displayName: "BotManor",
|
|
1903
|
+
dependsOn: ["auth"],
|
|
1904
|
+
capabilities: { tools: {}, resources: {}, prompts: {} },
|
|
1905
|
+
register(server, ctx) {
|
|
1906
|
+
const tools = [];
|
|
1907
|
+
const resources = [];
|
|
1908
|
+
const prompts = [];
|
|
1909
|
+
const trackTool = (n) => {
|
|
1910
|
+
tools.push(n);
|
|
1911
|
+
return n;
|
|
1912
|
+
};
|
|
1913
|
+
const trackResource = (uri) => {
|
|
1914
|
+
resources.push(uri);
|
|
1915
|
+
return uri;
|
|
1916
|
+
};
|
|
1917
|
+
const trackPrompt = (n) => {
|
|
1918
|
+
prompts.push(n);
|
|
1919
|
+
return n;
|
|
1920
|
+
};
|
|
1921
|
+
withToolAnnotations(server, botmanorToolAnnotations(ctx.productName), () => {
|
|
1922
|
+
registerBotAppTools(server, ctx, trackTool);
|
|
1923
|
+
registerAgentTools(server, ctx, trackTool);
|
|
1924
|
+
registerAppAgentTools(server, ctx, trackTool);
|
|
1925
|
+
registerExecutionTools(server, ctx, trackTool);
|
|
1926
|
+
registerChatTools(server, ctx, trackTool);
|
|
1927
|
+
registerKnowledgeTools(server, ctx, trackTool);
|
|
1928
|
+
registerChannelTools(server, ctx, trackTool);
|
|
1929
|
+
registerStoreTools(server, ctx, trackTool);
|
|
1930
|
+
});
|
|
1931
|
+
registerBotmanorResources(server, ctx, trackResource);
|
|
1932
|
+
registerBotmanorPrompts(server, ctx, trackPrompt);
|
|
1933
|
+
return { tools, resources, prompts };
|
|
1934
|
+
}
|
|
1935
|
+
};
|
|
1936
|
+
var botmanor_default = botmanorModule;
|
|
1937
|
+
|
|
1938
|
+
export { botmanor_default as default };
|
|
1939
|
+
//# sourceMappingURL=index.js.map
|
|
1940
|
+
//# sourceMappingURL=index.js.map
|