@avallon-labs/mcp 17.2.0 → 17.3.0-staging.405

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-AK737M4G.js");
57
+ await import("./server-NCO7IAGG.js");
58
58
  //# sourceMappingURL=index.js.map
@@ -893,6 +893,35 @@ var getEmail = async (emailId, options) => {
893
893
  const data = body ? JSON.parse(body) : {};
894
894
  return { data, status: res.status, headers: res.headers };
895
895
  };
896
+ var getListEmailThreadsUrl = (params) => {
897
+ const normalizedParams = new URLSearchParams();
898
+ Object.entries(params || {}).forEach(([key, value]) => {
899
+ if (value !== void 0) {
900
+ if (typeof value === "object" && value !== null && !Array.isArray(value)) {
901
+ for (const [sk, sv] of Object.entries(value)) {
902
+ if (sv !== void 0) normalizedParams.append(`${key}[${sk}]`, String(sv));
903
+ }
904
+ } else {
905
+ normalizedParams.append(key, value === null ? "null" : String(value));
906
+ }
907
+ }
908
+ });
909
+ const stringifiedParams = normalizedParams.toString();
910
+ return stringifiedParams.length > 0 ? `/v1/emails/threads?${stringifiedParams}` : `/v1/emails/threads`;
911
+ };
912
+ var listEmailThreads = async (params, options) => {
913
+ const res = await fetch(getListEmailThreadsUrl(params), {
914
+ ...options,
915
+ method: "GET"
916
+ });
917
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
918
+ const data = body ? JSON.parse(body) : {};
919
+ return {
920
+ data,
921
+ status: res.status,
922
+ headers: res.headers
923
+ };
924
+ };
896
925
  var getReplyToEmailUrl = (emailId) => {
897
926
  return `/v1/emails/${emailId}/reply`;
898
927
  };
@@ -2124,6 +2153,17 @@ var getEmailHandler = async (args) => {
2124
2153
  ]
2125
2154
  };
2126
2155
  };
2156
+ var listEmailThreadsHandler = async (args) => {
2157
+ const res = await listEmailThreads(args.queryParams);
2158
+ return {
2159
+ content: [
2160
+ {
2161
+ type: "text",
2162
+ text: JSON.stringify(res)
2163
+ }
2164
+ ]
2165
+ };
2166
+ };
2127
2167
  var replyToEmailHandler = async (args) => {
2128
2168
  const res = await replyToEmail(args.pathParams.emailId, args.bodyParams);
2129
2169
  return {
@@ -3778,6 +3818,7 @@ var listEmailsQuerySortByDefault = `created_at`;
3778
3818
  var listEmailsQuerySortOrderDefault = `desc`;
3779
3819
  var ListEmailsQueryParams = zod.object({
3780
3820
  inbox_id: zod.string().uuid().optional(),
3821
+ thread_id: zod.string().min(1).optional(),
3781
3822
  agent_id: zod.string().uuid().optional(),
3782
3823
  sender: zod.string().email().optional(),
3783
3824
  recipient: zod.string().email().optional(),
@@ -3789,6 +3830,7 @@ var ListEmailsQueryParams = zod.object({
3789
3830
  });
3790
3831
  var ListEmailsResponseItem = zod.object({
3791
3832
  id: zod.string(),
3833
+ thread_id: zod.string(),
3792
3834
  inbox_id: zod.union([zod.string(), zod.null()]),
3793
3835
  email_agent_id: zod.union([zod.string(), zod.null()]),
3794
3836
  direction: zod.enum(["inbound", "outbound"]),
@@ -3805,6 +3847,7 @@ var GetEmailParams = zod.object({
3805
3847
  });
3806
3848
  var GetEmailResponse = zod.object({
3807
3849
  id: zod.string(),
3850
+ thread_id: zod.string(),
3808
3851
  inbox_id: zod.union([zod.string(), zod.null()]),
3809
3852
  email_agent_id: zod.union([zod.string(), zod.null()]),
3810
3853
  claim_id: zod.union([zod.string(), zod.null()]),
@@ -3819,6 +3862,27 @@ var GetEmailResponse = zod.object({
3819
3862
  received_at: zod.string(),
3820
3863
  created_at: zod.string().datetime({})
3821
3864
  });
3865
+ var listEmailThreadsQueryCountDefault = 50;
3866
+ var listEmailThreadsQueryCountMax = 100;
3867
+ var listEmailThreadsQueryOffsetDefault = 0;
3868
+ var listEmailThreadsQueryOffsetMin = 0;
3869
+ var listEmailThreadsQuerySortByDefault = `last_email_at`;
3870
+ var listEmailThreadsQuerySortOrderDefault = `desc`;
3871
+ var ListEmailThreadsQueryParams = zod.object({
3872
+ inbox_id: zod.string().uuid().optional(),
3873
+ count: zod.number().min(1).max(listEmailThreadsQueryCountMax).default(listEmailThreadsQueryCountDefault),
3874
+ offset: zod.number().min(listEmailThreadsQueryOffsetMin).default(listEmailThreadsQueryOffsetDefault),
3875
+ sort_by: zod.enum(["last_email_at"]).default(listEmailThreadsQuerySortByDefault),
3876
+ sort_order: zod.enum(["asc", "desc"]).default(listEmailThreadsQuerySortOrderDefault)
3877
+ });
3878
+ var ListEmailThreadsResponseItem = zod.object({
3879
+ thread_id: zod.string(),
3880
+ subject: zod.union([zod.string(), zod.null()]),
3881
+ last_email_at: zod.string().datetime({}),
3882
+ first_sender: zod.string(),
3883
+ message_count: zod.number()
3884
+ });
3885
+ var ListEmailThreadsResponse = zod.array(ListEmailThreadsResponseItem);
3822
3886
  var ReplyToEmailParams = zod.object({
3823
3887
  emailId: zod.string().min(1)
3824
3888
  });
@@ -5040,6 +5104,14 @@ server.tool(
5040
5104
  },
5041
5105
  getEmailHandler
5042
5106
  );
5107
+ server.tool(
5108
+ "listEmailThreads",
5109
+ "List email threads",
5110
+ {
5111
+ queryParams: ListEmailThreadsQueryParams
5112
+ },
5113
+ listEmailThreadsHandler
5114
+ );
5043
5115
  server.tool(
5044
5116
  "replyToEmail",
5045
5117
  "Reply to email",
@@ -5352,4 +5424,4 @@ var transport = new StdioServerTransport();
5352
5424
  server.connect(transport).then(() => {
5353
5425
  console.error("MCP server running on stdio");
5354
5426
  }).catch(console.error);
5355
- //# sourceMappingURL=server-AK737M4G.js.map
5427
+ //# sourceMappingURL=server-NCO7IAGG.js.map