@avallon-labs/mcp 37.3.0-staging.935 → 37.4.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-7FBI6ZUL.js");
57
+ await import("./server-WAY4EMQV.js");
58
58
  //# sourceMappingURL=index.js.map
@@ -2490,6 +2490,35 @@ var deleteSchedule = async (scheduleId, options) => {
2490
2490
  headers: res.headers
2491
2491
  };
2492
2492
  };
2493
+ var getListDispatchesUrl = (params) => {
2494
+ const normalizedParams = new URLSearchParams();
2495
+ Object.entries(params || {}).forEach(([key, value]) => {
2496
+ if (value !== void 0) {
2497
+ if (typeof value === "object" && value !== null && !Array.isArray(value)) {
2498
+ for (const [sk, sv] of Object.entries(value)) {
2499
+ if (sv !== void 0) normalizedParams.append(`${key}[${sk}]`, String(sv));
2500
+ }
2501
+ } else {
2502
+ normalizedParams.append(key, value === null ? "null" : String(value));
2503
+ }
2504
+ }
2505
+ });
2506
+ const stringifiedParams = normalizedParams.toString();
2507
+ return stringifiedParams.length > 0 ? `/v1/dispatches?${stringifiedParams}` : `/v1/dispatches`;
2508
+ };
2509
+ var listDispatches = async (params, options) => {
2510
+ const res = await fetch(getListDispatchesUrl(params), {
2511
+ ...options,
2512
+ method: "GET"
2513
+ });
2514
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2515
+ const data = body ? JSON.parse(body) : {};
2516
+ return {
2517
+ data,
2518
+ status: res.status,
2519
+ headers: res.headers
2520
+ };
2521
+ };
2493
2522
  var getCreateToolUrl = () => {
2494
2523
  return `/v1/tools`;
2495
2524
  };
@@ -4273,6 +4302,17 @@ var deleteScheduleHandler = async (args) => {
4273
4302
  ]
4274
4303
  };
4275
4304
  };
4305
+ var listDispatchesHandler = async (args) => {
4306
+ const res = await listDispatches(args.queryParams);
4307
+ return {
4308
+ content: [
4309
+ {
4310
+ type: "text",
4311
+ text: JSON.stringify(res)
4312
+ }
4313
+ ]
4314
+ };
4315
+ };
4276
4316
  var createToolHandler = async (args) => {
4277
4317
  const res = await createTool(args.bodyParams);
4278
4318
  return {
@@ -8182,6 +8222,43 @@ var DeleteScheduleParams = zod.object({
8182
8222
  scheduleId: zod.string().uuid()
8183
8223
  });
8184
8224
  var DeleteScheduleResponse = zod.object({});
8225
+ var listDispatchesQueryCountDefault = 50;
8226
+ var listDispatchesQueryCountMax = 100;
8227
+ var listDispatchesQueryOffsetDefault = 0;
8228
+ var listDispatchesQueryOffsetMin = 0;
8229
+ var listDispatchesQuerySortByDefault = `due_at`;
8230
+ var listDispatchesQuerySortOrderDefault = `desc`;
8231
+ var ListDispatchesQueryParams = zod.object({
8232
+ trigger_type: zod.enum(["schedule"]).optional().describe("Only dispatches produced by this kind of trigger"),
8233
+ trigger_id: zod.string().uuid().optional().describe(
8234
+ "Only dispatches produced by this trigger. Requires `trigger_type`."
8235
+ ),
8236
+ count: zod.number().min(1).max(listDispatchesQueryCountMax).default(listDispatchesQueryCountDefault),
8237
+ offset: zod.number().min(listDispatchesQueryOffsetMin).default(listDispatchesQueryOffsetDefault),
8238
+ sort_by: zod.enum(["due_at"]).default(listDispatchesQuerySortByDefault),
8239
+ sort_order: zod.enum(["asc", "desc"]).default(listDispatchesQuerySortOrderDefault)
8240
+ });
8241
+ var listDispatchesResponseAttemptsMin = -9007199254740991;
8242
+ var listDispatchesResponseAttemptsMax = 9007199254740991;
8243
+ var ListDispatchesResponseItem = zod.object({
8244
+ id: zod.string(),
8245
+ trigger: zod.object({
8246
+ type: zod.enum(["schedule"]),
8247
+ id: zod.string()
8248
+ }),
8249
+ target: zod.union([
8250
+ zod.object({
8251
+ type: zod.enum(["worker_run"]),
8252
+ id: zod.string()
8253
+ }),
8254
+ zod.null()
8255
+ ]),
8256
+ due_at: zod.string().datetime({}),
8257
+ expires_at: zod.string().datetime({}),
8258
+ status: zod.enum(["pending", "dispatched", "abandoned"]),
8259
+ attempts: zod.number().min(listDispatchesResponseAttemptsMin).max(listDispatchesResponseAttemptsMax)
8260
+ });
8261
+ var ListDispatchesResponse = zod.array(ListDispatchesResponseItem);
8185
8262
  var CreateToolBody = zod.object({
8186
8263
  name: zod.string().min(1),
8187
8264
  code: zod.string().min(1),
@@ -9613,6 +9690,14 @@ server.tool(
9613
9690
  },
9614
9691
  deleteScheduleHandler
9615
9692
  );
9693
+ server.tool(
9694
+ "listDispatches",
9695
+ "List dispatches",
9696
+ {
9697
+ queryParams: ListDispatchesQueryParams
9698
+ },
9699
+ listDispatchesHandler
9700
+ );
9616
9701
  server.tool(
9617
9702
  "createTool",
9618
9703
  "Create tool",
@@ -9777,4 +9862,4 @@ var transport = new StdioServerTransport();
9777
9862
  server.connect(transport).then(() => {
9778
9863
  console.error("MCP server running on stdio");
9779
9864
  }).catch(console.error);
9780
- //# sourceMappingURL=server-7FBI6ZUL.js.map
9865
+ //# sourceMappingURL=server-WAY4EMQV.js.map