@avallon-labs/mcp 12.2.0 → 12.3.0

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-CL6KHMHQ.js");
57
+ await import("./server-WTSWVDNR.js");
58
58
  //# sourceMappingURL=index.js.map
@@ -1145,6 +1145,40 @@ var getWorker = async (workerId, options) => {
1145
1145
  headers: res.headers
1146
1146
  };
1147
1147
  };
1148
+ var getCreateWorkerWebhookUrl = (workerId) => {
1149
+ return `/v1/workers/${workerId}/webhooks`;
1150
+ };
1151
+ var createWorkerWebhook = async (workerId, createWorkerWebhookBody, options) => {
1152
+ const res = await fetch(getCreateWorkerWebhookUrl(workerId), {
1153
+ ...options,
1154
+ method: "POST",
1155
+ headers: { "Content-Type": "application/json", ...options?.headers },
1156
+ body: JSON.stringify(createWorkerWebhookBody)
1157
+ });
1158
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1159
+ const data = body ? JSON.parse(body) : {};
1160
+ return {
1161
+ data,
1162
+ status: res.status,
1163
+ headers: res.headers
1164
+ };
1165
+ };
1166
+ var getListWorkerWebhooksUrl = (workerId) => {
1167
+ return `/v1/workers/${workerId}/webhooks`;
1168
+ };
1169
+ var listWorkerWebhooks = async (workerId, options) => {
1170
+ const res = await fetch(getListWorkerWebhooksUrl(workerId), {
1171
+ ...options,
1172
+ method: "GET"
1173
+ });
1174
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1175
+ const data = body ? JSON.parse(body) : {};
1176
+ return {
1177
+ data,
1178
+ status: res.status,
1179
+ headers: res.headers
1180
+ };
1181
+ };
1148
1182
  var getGetExtractUrl = (id) => {
1149
1183
  return `/v1/extracts/${id}`;
1150
1184
  };
@@ -2142,6 +2176,31 @@ var getWorkerHandler = async (args) => {
2142
2176
  ]
2143
2177
  };
2144
2178
  };
2179
+ var createWorkerWebhookHandler = async (args) => {
2180
+ const res = await createWorkerWebhook(
2181
+ args.pathParams.workerId,
2182
+ args.bodyParams
2183
+ );
2184
+ return {
2185
+ content: [
2186
+ {
2187
+ type: "text",
2188
+ text: JSON.stringify(res)
2189
+ }
2190
+ ]
2191
+ };
2192
+ };
2193
+ var listWorkerWebhooksHandler = async (args) => {
2194
+ const res = await listWorkerWebhooks(args.pathParams.workerId);
2195
+ return {
2196
+ content: [
2197
+ {
2198
+ type: "text",
2199
+ text: JSON.stringify(res)
2200
+ }
2201
+ ]
2202
+ };
2203
+ };
2145
2204
  var getExtractHandler = async (args) => {
2146
2205
  const res = await getExtract(args.pathParams.id);
2147
2206
  return {
@@ -3747,6 +3806,74 @@ var GetWorkerResponse = zod.object({
3747
3806
  created_at: zod.string().datetime({}),
3748
3807
  updated_at: zod.string().datetime({})
3749
3808
  });
3809
+ var CreateWorkerWebhookParams = zod.object({
3810
+ workerId: zod.string().min(1)
3811
+ });
3812
+ var createWorkerWebhookBodyNameMax = 256;
3813
+ var createWorkerWebhookBodyUrlMax = 2048;
3814
+ var createWorkerWebhookBodyAuthHeaderNameOneMax = 256;
3815
+ var createWorkerWebhookBodyAuthHeaderValueOneMax = 2048;
3816
+ var CreateWorkerWebhookBody = zod.object({
3817
+ name: zod.string().min(1).max(createWorkerWebhookBodyNameMax),
3818
+ url: zod.string().url().max(createWorkerWebhookBodyUrlMax),
3819
+ auth_header_name: zod.union([
3820
+ zod.string().max(createWorkerWebhookBodyAuthHeaderNameOneMax),
3821
+ zod.null()
3822
+ ]).optional(),
3823
+ auth_header_value: zod.union([
3824
+ zod.string().max(createWorkerWebhookBodyAuthHeaderValueOneMax),
3825
+ zod.null()
3826
+ ]).optional(),
3827
+ enabled: zod.boolean().optional()
3828
+ });
3829
+ var CreateWorkerWebhookResponse = zod.object({
3830
+ id: zod.string(),
3831
+ scope: zod.union([
3832
+ zod.object({
3833
+ extractor_id: zod.string()
3834
+ }),
3835
+ zod.object({
3836
+ call_agent_id: zod.string()
3837
+ }),
3838
+ zod.object({
3839
+ inbox_id: zod.string()
3840
+ })
3841
+ ]),
3842
+ name: zod.string(),
3843
+ url: zod.string(),
3844
+ auth_header_name: zod.union([zod.string(), zod.null()]),
3845
+ has_auth: zod.boolean(),
3846
+ enabled: zod.boolean(),
3847
+ created_at: zod.string().datetime({}),
3848
+ updated_at: zod.string().datetime({})
3849
+ });
3850
+ var ListWorkerWebhooksParams = zod.object({
3851
+ workerId: zod.string().min(1)
3852
+ });
3853
+ var ListWorkerWebhooksResponseItem = zod.object({
3854
+ id: zod.string(),
3855
+ scope: zod.union([
3856
+ zod.object({
3857
+ extractor_id: zod.string()
3858
+ }),
3859
+ zod.object({
3860
+ call_agent_id: zod.string()
3861
+ }),
3862
+ zod.object({
3863
+ inbox_id: zod.string()
3864
+ })
3865
+ ]),
3866
+ name: zod.string(),
3867
+ url: zod.string(),
3868
+ auth_header_name: zod.union([zod.string(), zod.null()]),
3869
+ has_auth: zod.boolean(),
3870
+ enabled: zod.boolean(),
3871
+ created_at: zod.string().datetime({}),
3872
+ updated_at: zod.string().datetime({})
3873
+ });
3874
+ var ListWorkerWebhooksResponse = zod.array(
3875
+ ListWorkerWebhooksResponseItem
3876
+ );
3750
3877
  var GetExtractParams = zod.object({
3751
3878
  id: zod.string().uuid()
3752
3879
  });
@@ -4646,6 +4773,23 @@ server.tool(
4646
4773
  },
4647
4774
  getWorkerHandler
4648
4775
  );
4776
+ server.tool(
4777
+ "createWorkerWebhook",
4778
+ "Create worker webhook",
4779
+ {
4780
+ pathParams: CreateWorkerWebhookParams,
4781
+ bodyParams: CreateWorkerWebhookBody
4782
+ },
4783
+ createWorkerWebhookHandler
4784
+ );
4785
+ server.tool(
4786
+ "listWorkerWebhooks",
4787
+ "List worker webhooks",
4788
+ {
4789
+ pathParams: ListWorkerWebhooksParams
4790
+ },
4791
+ listWorkerWebhooksHandler
4792
+ );
4649
4793
  server.tool(
4650
4794
  "getExtract",
4651
4795
  "Get extract",
@@ -4809,4 +4953,4 @@ var transport = new StdioServerTransport();
4809
4953
  server.connect(transport).then(() => {
4810
4954
  console.error("MCP server running on stdio");
4811
4955
  }).catch(console.error);
4812
- //# sourceMappingURL=server-CL6KHMHQ.js.map
4956
+ //# sourceMappingURL=server-WTSWVDNR.js.map