@avallon-labs/mcp 19.5.0 → 19.6.0-staging.467

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
@@ -54,5 +54,5 @@ function setupFetch() {
54
54
 
55
55
  // src/index.ts
56
56
  setupFetch();
57
- await import("./server-T4IFGZIC.js");
57
+ await import("./server-Q5ER67O5.js");
58
58
  //# sourceMappingURL=index.js.map
@@ -1361,6 +1361,42 @@ var getChatAgent = async (chatAgentId, options) => {
1361
1361
  headers: res.headers
1362
1362
  };
1363
1363
  };
1364
+ var getCreateChatUrl = () => {
1365
+ return `/public/v1/chats`;
1366
+ };
1367
+ var createChat = async (createChatBody, options) => {
1368
+ const res = await fetch(getCreateChatUrl(), {
1369
+ ...options,
1370
+ method: "POST",
1371
+ headers: { "Content-Type": "application/json", ...options?.headers },
1372
+ body: JSON.stringify(createChatBody)
1373
+ });
1374
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1375
+ const data = body ? JSON.parse(body) : {};
1376
+ return {
1377
+ data,
1378
+ status: res.status,
1379
+ headers: res.headers
1380
+ };
1381
+ };
1382
+ var getPostChatMessageUrl = (chatId) => {
1383
+ return `/public/v1/chats/${chatId}/messages`;
1384
+ };
1385
+ var postChatMessage = async (chatId, postChatMessageBody, options) => {
1386
+ const res = await fetch(getPostChatMessageUrl(chatId), {
1387
+ ...options,
1388
+ method: "POST",
1389
+ headers: { "Content-Type": "application/json", ...options?.headers },
1390
+ body: JSON.stringify(postChatMessageBody)
1391
+ });
1392
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1393
+ const data = body ? JSON.parse(body) : {};
1394
+ return {
1395
+ data,
1396
+ status: res.status,
1397
+ headers: res.headers
1398
+ };
1399
+ };
1364
1400
  var getGetExtractUrl = (id) => {
1365
1401
  return `/v1/extracts/${id}`;
1366
1402
  };
@@ -2535,6 +2571,28 @@ var getChatAgentHandler = async (args) => {
2535
2571
  ]
2536
2572
  };
2537
2573
  };
2574
+ var createChatHandler = async (args) => {
2575
+ const res = await createChat(args.bodyParams);
2576
+ return {
2577
+ content: [
2578
+ {
2579
+ type: "text",
2580
+ text: JSON.stringify(res)
2581
+ }
2582
+ ]
2583
+ };
2584
+ };
2585
+ var postChatMessageHandler = async (args) => {
2586
+ const res = await postChatMessage(args.pathParams.chatId, args.bodyParams);
2587
+ return {
2588
+ content: [
2589
+ {
2590
+ type: "text",
2591
+ text: JSON.stringify(res)
2592
+ }
2593
+ ]
2594
+ };
2595
+ };
2538
2596
  var getExtractHandler = async (args) => {
2539
2597
  const res = await getExtract(args.pathParams.id);
2540
2598
  return {
@@ -4870,6 +4928,16 @@ var GetChatAgentResponse = zod.object({
4870
4928
  created_at: zod.string().datetime({}),
4871
4929
  updated_at: zod.string().datetime({})
4872
4930
  });
4931
+ var CreateChatBody = zod.object({
4932
+ chat_agent_id: zod.string().uuid()
4933
+ });
4934
+ var PostChatMessageParams = zod.object({
4935
+ chatId: zod.string().uuid()
4936
+ });
4937
+ var postChatMessageBodyContentMax = 32e3;
4938
+ var PostChatMessageBody = zod.object({
4939
+ content: zod.string().min(1).max(postChatMessageBodyContentMax)
4940
+ });
4873
4941
  var GetExtractParams = zod.object({
4874
4942
  id: zod.string().uuid()
4875
4943
  });
@@ -5940,6 +6008,23 @@ server.tool(
5940
6008
  },
5941
6009
  getChatAgentHandler
5942
6010
  );
6011
+ server.tool(
6012
+ "createChat",
6013
+ "Create a chat",
6014
+ {
6015
+ bodyParams: CreateChatBody
6016
+ },
6017
+ createChatHandler
6018
+ );
6019
+ server.tool(
6020
+ "postChatMessage",
6021
+ "Post a message to a chat",
6022
+ {
6023
+ pathParams: PostChatMessageParams,
6024
+ bodyParams: PostChatMessageBody
6025
+ },
6026
+ postChatMessageHandler
6027
+ );
5943
6028
  server.tool(
5944
6029
  "getExtract",
5945
6030
  "Get extract",
@@ -6121,4 +6206,4 @@ var transport = new StdioServerTransport();
6121
6206
  server.connect(transport).then(() => {
6122
6207
  console.error("MCP server running on stdio");
6123
6208
  }).catch(console.error);
6124
- //# sourceMappingURL=server-T4IFGZIC.js.map
6209
+ //# sourceMappingURL=server-Q5ER67O5.js.map