@avallon-labs/mcp 19.5.0 → 19.7.0-staging.469
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/index.js
CHANGED
|
@@ -1345,6 +1345,35 @@ var createChatAgent = async (createChatAgentBody, options) => {
|
|
|
1345
1345
|
headers: res.headers
|
|
1346
1346
|
};
|
|
1347
1347
|
};
|
|
1348
|
+
var getListChatAgentsUrl = (params) => {
|
|
1349
|
+
const normalizedParams = new URLSearchParams();
|
|
1350
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1351
|
+
if (value !== void 0) {
|
|
1352
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
1353
|
+
for (const [sk, sv] of Object.entries(value)) {
|
|
1354
|
+
if (sv !== void 0) normalizedParams.append(`${key}[${sk}]`, String(sv));
|
|
1355
|
+
}
|
|
1356
|
+
} else {
|
|
1357
|
+
normalizedParams.append(key, value === null ? "null" : String(value));
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
});
|
|
1361
|
+
const stringifiedParams = normalizedParams.toString();
|
|
1362
|
+
return stringifiedParams.length > 0 ? `/v1/chat-agents?${stringifiedParams}` : `/v1/chat-agents`;
|
|
1363
|
+
};
|
|
1364
|
+
var listChatAgents = async (params, options) => {
|
|
1365
|
+
const res = await fetch(getListChatAgentsUrl(params), {
|
|
1366
|
+
...options,
|
|
1367
|
+
method: "GET"
|
|
1368
|
+
});
|
|
1369
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1370
|
+
const data = body ? JSON.parse(body) : {};
|
|
1371
|
+
return {
|
|
1372
|
+
data,
|
|
1373
|
+
status: res.status,
|
|
1374
|
+
headers: res.headers
|
|
1375
|
+
};
|
|
1376
|
+
};
|
|
1348
1377
|
var getGetChatAgentUrl = (chatAgentId) => {
|
|
1349
1378
|
return `/v1/chat-agents/${chatAgentId}`;
|
|
1350
1379
|
};
|
|
@@ -1361,6 +1390,42 @@ var getChatAgent = async (chatAgentId, options) => {
|
|
|
1361
1390
|
headers: res.headers
|
|
1362
1391
|
};
|
|
1363
1392
|
};
|
|
1393
|
+
var getCreateChatUrl = () => {
|
|
1394
|
+
return `/public/v1/chats`;
|
|
1395
|
+
};
|
|
1396
|
+
var createChat = async (createChatBody, options) => {
|
|
1397
|
+
const res = await fetch(getCreateChatUrl(), {
|
|
1398
|
+
...options,
|
|
1399
|
+
method: "POST",
|
|
1400
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
1401
|
+
body: JSON.stringify(createChatBody)
|
|
1402
|
+
});
|
|
1403
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1404
|
+
const data = body ? JSON.parse(body) : {};
|
|
1405
|
+
return {
|
|
1406
|
+
data,
|
|
1407
|
+
status: res.status,
|
|
1408
|
+
headers: res.headers
|
|
1409
|
+
};
|
|
1410
|
+
};
|
|
1411
|
+
var getPostChatMessageUrl = (chatId) => {
|
|
1412
|
+
return `/public/v1/chats/${chatId}/messages`;
|
|
1413
|
+
};
|
|
1414
|
+
var postChatMessage = async (chatId, postChatMessageBody, options) => {
|
|
1415
|
+
const res = await fetch(getPostChatMessageUrl(chatId), {
|
|
1416
|
+
...options,
|
|
1417
|
+
method: "POST",
|
|
1418
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
1419
|
+
body: JSON.stringify(postChatMessageBody)
|
|
1420
|
+
});
|
|
1421
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1422
|
+
const data = body ? JSON.parse(body) : {};
|
|
1423
|
+
return {
|
|
1424
|
+
data,
|
|
1425
|
+
status: res.status,
|
|
1426
|
+
headers: res.headers
|
|
1427
|
+
};
|
|
1428
|
+
};
|
|
1364
1429
|
var getGetExtractUrl = (id) => {
|
|
1365
1430
|
return `/v1/extracts/${id}`;
|
|
1366
1431
|
};
|
|
@@ -2524,6 +2589,17 @@ var createChatAgentHandler = async (args) => {
|
|
|
2524
2589
|
]
|
|
2525
2590
|
};
|
|
2526
2591
|
};
|
|
2592
|
+
var listChatAgentsHandler = async (args) => {
|
|
2593
|
+
const res = await listChatAgents(args.queryParams);
|
|
2594
|
+
return {
|
|
2595
|
+
content: [
|
|
2596
|
+
{
|
|
2597
|
+
type: "text",
|
|
2598
|
+
text: JSON.stringify(res)
|
|
2599
|
+
}
|
|
2600
|
+
]
|
|
2601
|
+
};
|
|
2602
|
+
};
|
|
2527
2603
|
var getChatAgentHandler = async (args) => {
|
|
2528
2604
|
const res = await getChatAgent(args.pathParams.chatAgentId);
|
|
2529
2605
|
return {
|
|
@@ -2535,6 +2611,28 @@ var getChatAgentHandler = async (args) => {
|
|
|
2535
2611
|
]
|
|
2536
2612
|
};
|
|
2537
2613
|
};
|
|
2614
|
+
var createChatHandler = async (args) => {
|
|
2615
|
+
const res = await createChat(args.bodyParams);
|
|
2616
|
+
return {
|
|
2617
|
+
content: [
|
|
2618
|
+
{
|
|
2619
|
+
type: "text",
|
|
2620
|
+
text: JSON.stringify(res)
|
|
2621
|
+
}
|
|
2622
|
+
]
|
|
2623
|
+
};
|
|
2624
|
+
};
|
|
2625
|
+
var postChatMessageHandler = async (args) => {
|
|
2626
|
+
const res = await postChatMessage(args.pathParams.chatId, args.bodyParams);
|
|
2627
|
+
return {
|
|
2628
|
+
content: [
|
|
2629
|
+
{
|
|
2630
|
+
type: "text",
|
|
2631
|
+
text: JSON.stringify(res)
|
|
2632
|
+
}
|
|
2633
|
+
]
|
|
2634
|
+
};
|
|
2635
|
+
};
|
|
2538
2636
|
var getExtractHandler = async (args) => {
|
|
2539
2637
|
const res = await getExtract(args.pathParams.id);
|
|
2540
2638
|
return {
|
|
@@ -4861,6 +4959,25 @@ var CreateChatAgentResponse = zod.object({
|
|
|
4861
4959
|
chat_agent_id: zod.string(),
|
|
4862
4960
|
created_at: zod.string().datetime({})
|
|
4863
4961
|
});
|
|
4962
|
+
var listChatAgentsQueryCountDefault = 50;
|
|
4963
|
+
var listChatAgentsQueryCountMax = 100;
|
|
4964
|
+
var listChatAgentsQueryOffsetDefault = 0;
|
|
4965
|
+
var listChatAgentsQueryOffsetMin = 0;
|
|
4966
|
+
var listChatAgentsQuerySortByDefault = `created_at`;
|
|
4967
|
+
var listChatAgentsQuerySortOrderDefault = `desc`;
|
|
4968
|
+
var ListChatAgentsQueryParams = zod.object({
|
|
4969
|
+
count: zod.number().min(1).max(listChatAgentsQueryCountMax).default(listChatAgentsQueryCountDefault),
|
|
4970
|
+
offset: zod.number().min(listChatAgentsQueryOffsetMin).default(listChatAgentsQueryOffsetDefault),
|
|
4971
|
+
sort_by: zod.enum(["created_at", "name"]).default(listChatAgentsQuerySortByDefault),
|
|
4972
|
+
sort_order: zod.enum(["asc", "desc"]).default(listChatAgentsQuerySortOrderDefault)
|
|
4973
|
+
});
|
|
4974
|
+
var ListChatAgentsResponseItem = zod.object({
|
|
4975
|
+
id: zod.string(),
|
|
4976
|
+
name: zod.string(),
|
|
4977
|
+
created_at: zod.string().datetime({}),
|
|
4978
|
+
updated_at: zod.string().datetime({})
|
|
4979
|
+
});
|
|
4980
|
+
var ListChatAgentsResponse = zod.array(ListChatAgentsResponseItem);
|
|
4864
4981
|
var GetChatAgentParams = zod.object({
|
|
4865
4982
|
chatAgentId: zod.string().uuid()
|
|
4866
4983
|
});
|
|
@@ -4870,6 +4987,16 @@ var GetChatAgentResponse = zod.object({
|
|
|
4870
4987
|
created_at: zod.string().datetime({}),
|
|
4871
4988
|
updated_at: zod.string().datetime({})
|
|
4872
4989
|
});
|
|
4990
|
+
var CreateChatBody = zod.object({
|
|
4991
|
+
chat_agent_id: zod.string().uuid()
|
|
4992
|
+
});
|
|
4993
|
+
var PostChatMessageParams = zod.object({
|
|
4994
|
+
chatId: zod.string().uuid()
|
|
4995
|
+
});
|
|
4996
|
+
var postChatMessageBodyContentMax = 32e3;
|
|
4997
|
+
var PostChatMessageBody = zod.object({
|
|
4998
|
+
content: zod.string().min(1).max(postChatMessageBodyContentMax)
|
|
4999
|
+
});
|
|
4873
5000
|
var GetExtractParams = zod.object({
|
|
4874
5001
|
id: zod.string().uuid()
|
|
4875
5002
|
});
|
|
@@ -5932,6 +6059,14 @@ server.tool(
|
|
|
5932
6059
|
},
|
|
5933
6060
|
createChatAgentHandler
|
|
5934
6061
|
);
|
|
6062
|
+
server.tool(
|
|
6063
|
+
"listChatAgents",
|
|
6064
|
+
"List chat agents",
|
|
6065
|
+
{
|
|
6066
|
+
queryParams: ListChatAgentsQueryParams
|
|
6067
|
+
},
|
|
6068
|
+
listChatAgentsHandler
|
|
6069
|
+
);
|
|
5935
6070
|
server.tool(
|
|
5936
6071
|
"getChatAgent",
|
|
5937
6072
|
"Get chat agent",
|
|
@@ -5940,6 +6075,23 @@ server.tool(
|
|
|
5940
6075
|
},
|
|
5941
6076
|
getChatAgentHandler
|
|
5942
6077
|
);
|
|
6078
|
+
server.tool(
|
|
6079
|
+
"createChat",
|
|
6080
|
+
"Create a chat",
|
|
6081
|
+
{
|
|
6082
|
+
bodyParams: CreateChatBody
|
|
6083
|
+
},
|
|
6084
|
+
createChatHandler
|
|
6085
|
+
);
|
|
6086
|
+
server.tool(
|
|
6087
|
+
"postChatMessage",
|
|
6088
|
+
"Post a message to a chat",
|
|
6089
|
+
{
|
|
6090
|
+
pathParams: PostChatMessageParams,
|
|
6091
|
+
bodyParams: PostChatMessageBody
|
|
6092
|
+
},
|
|
6093
|
+
postChatMessageHandler
|
|
6094
|
+
);
|
|
5943
6095
|
server.tool(
|
|
5944
6096
|
"getExtract",
|
|
5945
6097
|
"Get extract",
|
|
@@ -6121,4 +6273,4 @@ var transport = new StdioServerTransport();
|
|
|
6121
6273
|
server.connect(transport).then(() => {
|
|
6122
6274
|
console.error("MCP server running on stdio");
|
|
6123
6275
|
}).catch(console.error);
|
|
6124
|
-
//# sourceMappingURL=server-
|
|
6276
|
+
//# sourceMappingURL=server-2LIFZ2N2.js.map
|