@avallon-labs/mcp 46.0.0-staging.1054 → 46.1.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
@@ -46,5 +46,5 @@ function setupFetch() {
46
46
 
47
47
  // src/index.ts
48
48
  setupFetch();
49
- await import("./server-NM73MW7C.js");
49
+ await import("./server-MZWYBAX7.js");
50
50
  //# sourceMappingURL=index.js.map
@@ -2785,6 +2785,69 @@ var executeCode = async (id, executeCodeBody, options) => {
2785
2785
  headers: res.headers
2786
2786
  };
2787
2787
  };
2788
+ var getWorkerListToolsUrl = (params) => {
2789
+ const normalizedParams = new URLSearchParams();
2790
+ Object.entries(params || {}).forEach(([key, value]) => {
2791
+ if (value !== void 0) {
2792
+ if (typeof value === "object" && value !== null && !Array.isArray(value)) {
2793
+ for (const [sk, sv] of Object.entries(value)) {
2794
+ if (sv !== void 0) normalizedParams.append(`${key}[${sk}]`, String(sv));
2795
+ }
2796
+ } else {
2797
+ normalizedParams.append(key, value === null ? "null" : String(value));
2798
+ }
2799
+ }
2800
+ });
2801
+ const stringifiedParams = normalizedParams.toString();
2802
+ return stringifiedParams.length > 0 ? `/worker/v1/tools?${stringifiedParams}` : `/worker/v1/tools`;
2803
+ };
2804
+ var workerListTools = async (params, options) => {
2805
+ const res = await fetch(getWorkerListToolsUrl(params), {
2806
+ ...options,
2807
+ method: "GET"
2808
+ });
2809
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2810
+ const data = body ? JSON.parse(body) : {};
2811
+ return {
2812
+ data,
2813
+ status: res.status,
2814
+ headers: res.headers
2815
+ };
2816
+ };
2817
+ var getWorkerGetToolUrl = (id) => {
2818
+ return `/worker/v1/tools/${id}`;
2819
+ };
2820
+ var workerGetTool = async (id, options) => {
2821
+ const res = await fetch(getWorkerGetToolUrl(id), {
2822
+ ...options,
2823
+ method: "GET"
2824
+ });
2825
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2826
+ const data = body ? JSON.parse(body) : {};
2827
+ return {
2828
+ data,
2829
+ status: res.status,
2830
+ headers: res.headers
2831
+ };
2832
+ };
2833
+ var getWorkerExecuteToolUrl = (id) => {
2834
+ return `/worker/v1/tools/${id}/execute`;
2835
+ };
2836
+ var workerExecuteTool = async (id, workerExecuteToolBody, options) => {
2837
+ const res = await fetch(getWorkerExecuteToolUrl(id), {
2838
+ ...options,
2839
+ method: "POST",
2840
+ headers: { "Content-Type": "application/json", ...options?.headers },
2841
+ body: JSON.stringify(workerExecuteToolBody)
2842
+ });
2843
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2844
+ const data = body ? JSON.parse(body) : {};
2845
+ return {
2846
+ data,
2847
+ status: res.status,
2848
+ headers: res.headers
2849
+ };
2850
+ };
2788
2851
  var getNotifyAdminUrl = () => {
2789
2852
  return `/worker/v1/notifications`;
2790
2853
  };
@@ -4643,6 +4706,39 @@ var executeCodeHandler = async (args) => {
4643
4706
  ]
4644
4707
  };
4645
4708
  };
4709
+ var workerListToolsHandler = async (args) => {
4710
+ const res = await workerListTools(args.queryParams);
4711
+ return {
4712
+ content: [
4713
+ {
4714
+ type: "text",
4715
+ text: JSON.stringify(res)
4716
+ }
4717
+ ]
4718
+ };
4719
+ };
4720
+ var workerGetToolHandler = async (args) => {
4721
+ const res = await workerGetTool(args.pathParams.id);
4722
+ return {
4723
+ content: [
4724
+ {
4725
+ type: "text",
4726
+ text: JSON.stringify(res)
4727
+ }
4728
+ ]
4729
+ };
4730
+ };
4731
+ var workerExecuteToolHandler = async (args) => {
4732
+ const res = await workerExecuteTool(args.pathParams.id, args.bodyParams);
4733
+ return {
4734
+ content: [
4735
+ {
4736
+ type: "text",
4737
+ text: JSON.stringify(res)
4738
+ }
4739
+ ]
4740
+ };
4741
+ };
4646
4742
  var notifyAdminHandler = async (args) => {
4647
4743
  const res = await notifyAdmin(args.bodyParams);
4648
4744
  return {
@@ -9625,6 +9721,66 @@ var ExecuteCodeResponse = zod.object({
9625
9721
  }),
9626
9722
  message: zod.string()
9627
9723
  });
9724
+ var workerListToolsQuerySortByDefault = `created_at`;
9725
+ var workerListToolsQuerySortOrderDefault = `desc`;
9726
+ var WorkerListToolsQueryParams = zod.object({
9727
+ sort_by: zod.enum(["created_at", "updated_at", "name"]).default(workerListToolsQuerySortByDefault),
9728
+ sort_order: zod.enum(["asc", "desc"]).default(workerListToolsQuerySortOrderDefault),
9729
+ call_agent_id: zod.string().uuid().optional()
9730
+ });
9731
+ var WorkerListToolsResponse = zod.object({
9732
+ data: zod.object({
9733
+ tools: zod.array(
9734
+ zod.object({
9735
+ id: zod.string(),
9736
+ name: zod.string(),
9737
+ description: zod.string().optional()
9738
+ })
9739
+ )
9740
+ }),
9741
+ message: zod.string()
9742
+ });
9743
+ var WorkerGetToolParams = zod.object({
9744
+ id: zod.string().uuid()
9745
+ });
9746
+ var WorkerGetToolResponse = zod.object({
9747
+ data: zod.object({
9748
+ tool: zod.object({
9749
+ id: zod.string(),
9750
+ name: zod.string(),
9751
+ description: zod.string().optional(),
9752
+ code: zod.string(),
9753
+ schema: zod.record(zod.string(), zod.unknown()),
9754
+ secret_ids: zod.array(zod.string()).describe(
9755
+ "Secrets attached to the tool. A tool with attached secrets takes its execution environment exclusively from the secret store, each secret arriving under its own env key."
9756
+ )
9757
+ })
9758
+ }),
9759
+ message: zod.string()
9760
+ });
9761
+ var WorkerExecuteToolParams = zod.object({
9762
+ id: zod.string().uuid()
9763
+ });
9764
+ var workerExecuteToolBodyParamsDefault = {};
9765
+ var WorkerExecuteToolBody = zod.object({
9766
+ params: zod.record(zod.string(), zod.unknown()).default(workerExecuteToolBodyParamsDefault)
9767
+ });
9768
+ var WorkerExecuteToolResponse = zod.object({
9769
+ data: zod.object({
9770
+ result: zod.string().optional(),
9771
+ error: zod.object({
9772
+ name: zod.string(),
9773
+ message: zod.string()
9774
+ }).optional(),
9775
+ traces: zod.array(
9776
+ zod.object({
9777
+ text: zod.string(),
9778
+ timestamp: zod.string()
9779
+ })
9780
+ )
9781
+ }),
9782
+ message: zod.string()
9783
+ });
9628
9784
  var notifyAdminBodyMessageMax = 2e3;
9629
9785
  var NotifyAdminBody = zod.object({
9630
9786
  message: zod.string().min(1).max(notifyAdminBodyMessageMax).describe(
@@ -11158,6 +11314,31 @@ server.tool(
11158
11314
  },
11159
11315
  executeCodeHandler
11160
11316
  );
11317
+ server.tool(
11318
+ "workerListTools",
11319
+ "List tools",
11320
+ {
11321
+ queryParams: WorkerListToolsQueryParams
11322
+ },
11323
+ workerListToolsHandler
11324
+ );
11325
+ server.tool(
11326
+ "workerGetTool",
11327
+ "Get tool",
11328
+ {
11329
+ pathParams: WorkerGetToolParams
11330
+ },
11331
+ workerGetToolHandler
11332
+ );
11333
+ server.tool(
11334
+ "workerExecuteTool",
11335
+ "Execute tool",
11336
+ {
11337
+ pathParams: WorkerExecuteToolParams,
11338
+ bodyParams: WorkerExecuteToolBody
11339
+ },
11340
+ workerExecuteToolHandler
11341
+ );
11161
11342
  server.tool(
11162
11343
  "notifyAdmin",
11163
11344
  "Notify an admin",
@@ -11275,4 +11456,4 @@ var transport = new StdioServerTransport();
11275
11456
  server.connect(transport).then(() => {
11276
11457
  console.error("MCP server running on stdio");
11277
11458
  }).catch(console.error);
11278
- //# sourceMappingURL=server-NM73MW7C.js.map
11459
+ //# sourceMappingURL=server-MZWYBAX7.js.map