@avallon-labs/mcp 17.2.0 → 17.4.0-staging.409

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-GLLOOWGU.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
  };
@@ -974,24 +1003,6 @@ var getExtractorJob = async (id, options) => {
974
1003
  headers: res.headers
975
1004
  };
976
1005
  };
977
- var getUpdateExtractorJobScopeUrl = (id) => {
978
- return `/v1/extractor-jobs/${id}/scope`;
979
- };
980
- var updateExtractorJobScope = async (id, updateExtractorJobScopeBody, options) => {
981
- const res = await fetch(getUpdateExtractorJobScopeUrl(id), {
982
- ...options,
983
- method: "PATCH",
984
- headers: { "Content-Type": "application/json", ...options?.headers },
985
- body: JSON.stringify(updateExtractorJobScopeBody)
986
- });
987
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
988
- const data = body ? JSON.parse(body) : {};
989
- return {
990
- data,
991
- status: res.status,
992
- headers: res.headers
993
- };
994
- };
995
1006
  var getListWorkerRunsUrl = (params) => {
996
1007
  const normalizedParams = new URLSearchParams();
997
1008
  Object.entries(params || {}).forEach(([key, value]) => {
@@ -1084,6 +1095,24 @@ var listWorkerRunMessages = async (workerRunId, params, options) => {
1084
1095
  headers: res.headers
1085
1096
  };
1086
1097
  };
1098
+ var getUpdateWorkerRunScopeUrl = (workerRunId) => {
1099
+ return `/v1/worker-runs/${workerRunId}/scope`;
1100
+ };
1101
+ var updateWorkerRunScope = async (workerRunId, updateWorkerRunScopeBody, options) => {
1102
+ const res = await fetch(getUpdateWorkerRunScopeUrl(workerRunId), {
1103
+ ...options,
1104
+ method: "PATCH",
1105
+ headers: { "Content-Type": "application/json", ...options?.headers },
1106
+ body: JSON.stringify(updateWorkerRunScopeBody)
1107
+ });
1108
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1109
+ const data = body ? JSON.parse(body) : {};
1110
+ return {
1111
+ data,
1112
+ status: res.status,
1113
+ headers: res.headers
1114
+ };
1115
+ };
1087
1116
  var getCreateExtractorUrl = () => {
1088
1117
  return `/v1/extractors`;
1089
1118
  };
@@ -2124,8 +2153,8 @@ var getEmailHandler = async (args) => {
2124
2153
  ]
2125
2154
  };
2126
2155
  };
2127
- var replyToEmailHandler = async (args) => {
2128
- const res = await replyToEmail(args.pathParams.emailId, args.bodyParams);
2156
+ var listEmailThreadsHandler = async (args) => {
2157
+ const res = await listEmailThreads(args.queryParams);
2129
2158
  return {
2130
2159
  content: [
2131
2160
  {
@@ -2135,8 +2164,8 @@ var replyToEmailHandler = async (args) => {
2135
2164
  ]
2136
2165
  };
2137
2166
  };
2138
- var listExtractorJobsHandler = async (args) => {
2139
- const res = await listExtractorJobs(args.queryParams);
2167
+ var replyToEmailHandler = async (args) => {
2168
+ const res = await replyToEmail(args.pathParams.emailId, args.bodyParams);
2140
2169
  return {
2141
2170
  content: [
2142
2171
  {
@@ -2146,8 +2175,8 @@ var listExtractorJobsHandler = async (args) => {
2146
2175
  ]
2147
2176
  };
2148
2177
  };
2149
- var createExtractorJobHandler = async (args) => {
2150
- const res = await createExtractorJob(args.bodyParams);
2178
+ var listExtractorJobsHandler = async (args) => {
2179
+ const res = await listExtractorJobs(args.queryParams);
2151
2180
  return {
2152
2181
  content: [
2153
2182
  {
@@ -2157,8 +2186,8 @@ var createExtractorJobHandler = async (args) => {
2157
2186
  ]
2158
2187
  };
2159
2188
  };
2160
- var getExtractorJobHandler = async (args) => {
2161
- const res = await getExtractorJob(args.pathParams.id);
2189
+ var createExtractorJobHandler = async (args) => {
2190
+ const res = await createExtractorJob(args.bodyParams);
2162
2191
  return {
2163
2192
  content: [
2164
2193
  {
@@ -2168,11 +2197,8 @@ var getExtractorJobHandler = async (args) => {
2168
2197
  ]
2169
2198
  };
2170
2199
  };
2171
- var updateExtractorJobScopeHandler = async (args) => {
2172
- const res = await updateExtractorJobScope(
2173
- args.pathParams.id,
2174
- args.bodyParams
2175
- );
2200
+ var getExtractorJobHandler = async (args) => {
2201
+ const res = await getExtractorJob(args.pathParams.id);
2176
2202
  return {
2177
2203
  content: [
2178
2204
  {
@@ -2229,6 +2255,20 @@ var listWorkerRunMessagesHandler = async (args) => {
2229
2255
  ]
2230
2256
  };
2231
2257
  };
2258
+ var updateWorkerRunScopeHandler = async (args) => {
2259
+ const res = await updateWorkerRunScope(
2260
+ args.pathParams.workerRunId,
2261
+ args.bodyParams
2262
+ );
2263
+ return {
2264
+ content: [
2265
+ {
2266
+ type: "text",
2267
+ text: JSON.stringify(res)
2268
+ }
2269
+ ]
2270
+ };
2271
+ };
2232
2272
  var createExtractorHandler = async (args) => {
2233
2273
  const res = await createExtractor(args.bodyParams);
2234
2274
  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
  });
@@ -3900,26 +3964,6 @@ var GetExtractorJobResponse = zod.object({
3900
3964
  error: zod.union([zod.string(), zod.null()])
3901
3965
  })
3902
3966
  });
3903
- var UpdateExtractorJobScopeParams = zod.object({
3904
- id: zod.string().uuid()
3905
- });
3906
- var UpdateExtractorJobScopeBody = zod.object({
3907
- scope: zod.record(zod.string(), zod.unknown())
3908
- });
3909
- var UpdateExtractorJobScopeResponse = zod.object({
3910
- id: zod.string(),
3911
- extractor_id: zod.string(),
3912
- extractor_version: zod.number(),
3913
- extractor_name: zod.string(),
3914
- status: zod.string(),
3915
- scope: zod.record(zod.string(), zod.unknown()),
3916
- created_at: zod.string().datetime({}),
3917
- started_at: zod.union([zod.string().datetime({}), zod.null()]),
3918
- completed_at: zod.union([zod.string(), zod.null()]),
3919
- processing_duration_ms: zod.union([zod.number(), zod.null()]),
3920
- extract_id: zod.union([zod.string(), zod.null()]),
3921
- error: zod.union([zod.string(), zod.null()])
3922
- });
3923
3967
  var listWorkerRunsQueryCountDefault = 50;
3924
3968
  var listWorkerRunsQueryCountMax = 100;
3925
3969
  var listWorkerRunsQueryOffsetDefault = 0;
@@ -4003,6 +4047,30 @@ var ListWorkerRunMessagesResponseItem = zod.object({
4003
4047
  var ListWorkerRunMessagesResponse = zod.array(
4004
4048
  ListWorkerRunMessagesResponseItem
4005
4049
  );
4050
+ var UpdateWorkerRunScopeParams = zod.object({
4051
+ workerRunId: zod.string().uuid()
4052
+ });
4053
+ var UpdateWorkerRunScopeBody = zod.object({
4054
+ scope: zod.record(zod.string(), zod.unknown())
4055
+ });
4056
+ var updateWorkerRunScopeResponseWorkerVersionMin = -9007199254740991;
4057
+ var updateWorkerRunScopeResponseWorkerVersionMax = 9007199254740991;
4058
+ var UpdateWorkerRunScopeResponse = zod.object({
4059
+ id: zod.string().describe("Unique run identifier"),
4060
+ worker_id: zod.string().describe("ID of the worker"),
4061
+ worker_version: zod.number().min(updateWorkerRunScopeResponseWorkerVersionMin).max(updateWorkerRunScopeResponseWorkerVersionMax).describe("Version of the worker at run creation time"),
4062
+ worker_name: zod.string().describe("Name of the worker"),
4063
+ status: zod.string().describe("Current run status"),
4064
+ scope: zod.record(zod.string(), zod.unknown()).describe("Run scope metadata (e.g. claim_id, email_id)"),
4065
+ created_at: zod.string().datetime({}).describe("ISO 8601 timestamp when the run was created"),
4066
+ started_at: zod.union([zod.string().datetime({}), zod.null()]).describe("ISO 8601 timestamp when processing started"),
4067
+ completed_at: zod.union([zod.string().datetime({}), zod.null()]).describe("ISO 8601 timestamp when processing finished"),
4068
+ processing_duration_ms: zod.union([zod.number(), zod.null()]).describe("Processing duration in milliseconds"),
4069
+ extract_id: zod.union([zod.string().uuid(), zod.null()]).describe(
4070
+ "Optional extract ID, set only if the worker run created an extract."
4071
+ ),
4072
+ error: zod.union([zod.string(), zod.null()])
4073
+ });
4006
4074
  var CreateExtractorBody = zod.object({
4007
4075
  name: zod.string().min(1),
4008
4076
  schema: zod.record(zod.string(), zod.unknown())
@@ -5040,6 +5108,14 @@ server.tool(
5040
5108
  },
5041
5109
  getEmailHandler
5042
5110
  );
5111
+ server.tool(
5112
+ "listEmailThreads",
5113
+ "List email threads",
5114
+ {
5115
+ queryParams: ListEmailThreadsQueryParams
5116
+ },
5117
+ listEmailThreadsHandler
5118
+ );
5043
5119
  server.tool(
5044
5120
  "replyToEmail",
5045
5121
  "Reply to email",
@@ -5073,15 +5149,6 @@ server.tool(
5073
5149
  },
5074
5150
  getExtractorJobHandler
5075
5151
  );
5076
- server.tool(
5077
- "updateExtractorJobScope",
5078
- "Update extractor job scope (deprecated)",
5079
- {
5080
- pathParams: UpdateExtractorJobScopeParams,
5081
- bodyParams: UpdateExtractorJobScopeBody
5082
- },
5083
- updateExtractorJobScopeHandler
5084
- );
5085
5152
  server.tool(
5086
5153
  "listWorkerRuns",
5087
5154
  "List worker runs",
@@ -5115,6 +5182,15 @@ server.tool(
5115
5182
  },
5116
5183
  listWorkerRunMessagesHandler
5117
5184
  );
5185
+ server.tool(
5186
+ "updateWorkerRunScope",
5187
+ "Update worker run scope",
5188
+ {
5189
+ pathParams: UpdateWorkerRunScopeParams,
5190
+ bodyParams: UpdateWorkerRunScopeBody
5191
+ },
5192
+ updateWorkerRunScopeHandler
5193
+ );
5118
5194
  server.tool(
5119
5195
  "createExtractor",
5120
5196
  "Create extractor",
@@ -5352,4 +5428,4 @@ var transport = new StdioServerTransport();
5352
5428
  server.connect(transport).then(() => {
5353
5429
  console.error("MCP server running on stdio");
5354
5430
  }).catch(console.error);
5355
- //# sourceMappingURL=server-AK737M4G.js.map
5431
+ //# sourceMappingURL=server-GLLOOWGU.js.map