@avallon-labs/mcp 43.0.0 → 43.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
|
@@ -2650,6 +2650,35 @@ var listDispatches = async (params, options) => {
|
|
|
2650
2650
|
headers: res.headers
|
|
2651
2651
|
};
|
|
2652
2652
|
};
|
|
2653
|
+
var getListNotificationsUrl = (params) => {
|
|
2654
|
+
const normalizedParams = new URLSearchParams();
|
|
2655
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
2656
|
+
if (value !== void 0) {
|
|
2657
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
2658
|
+
for (const [sk, sv] of Object.entries(value)) {
|
|
2659
|
+
if (sv !== void 0) normalizedParams.append(`${key}[${sk}]`, String(sv));
|
|
2660
|
+
}
|
|
2661
|
+
} else {
|
|
2662
|
+
normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2663
|
+
}
|
|
2664
|
+
}
|
|
2665
|
+
});
|
|
2666
|
+
const stringifiedParams = normalizedParams.toString();
|
|
2667
|
+
return stringifiedParams.length > 0 ? `/v1/notifications?${stringifiedParams}` : `/v1/notifications`;
|
|
2668
|
+
};
|
|
2669
|
+
var listNotifications = async (params, options) => {
|
|
2670
|
+
const res = await fetch(getListNotificationsUrl(params), {
|
|
2671
|
+
...options,
|
|
2672
|
+
method: "GET"
|
|
2673
|
+
});
|
|
2674
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
2675
|
+
const data = body ? JSON.parse(body) : {};
|
|
2676
|
+
return {
|
|
2677
|
+
data,
|
|
2678
|
+
status: res.status,
|
|
2679
|
+
headers: res.headers
|
|
2680
|
+
};
|
|
2681
|
+
};
|
|
2653
2682
|
var getCreateToolUrl = () => {
|
|
2654
2683
|
return `/v1/tools`;
|
|
2655
2684
|
};
|
|
@@ -2811,6 +2840,24 @@ var workerExecuteTool = async (id, workerExecuteToolBody, options) => {
|
|
|
2811
2840
|
headers: res.headers
|
|
2812
2841
|
};
|
|
2813
2842
|
};
|
|
2843
|
+
var getNotifyAdminUrl = () => {
|
|
2844
|
+
return `/worker/v1/notifications`;
|
|
2845
|
+
};
|
|
2846
|
+
var notifyAdmin = async (notifyAdminBody, options) => {
|
|
2847
|
+
const res = await fetch(getNotifyAdminUrl(), {
|
|
2848
|
+
...options,
|
|
2849
|
+
method: "POST",
|
|
2850
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
2851
|
+
body: JSON.stringify(notifyAdminBody)
|
|
2852
|
+
});
|
|
2853
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
2854
|
+
const data = body ? JSON.parse(body) : {};
|
|
2855
|
+
return {
|
|
2856
|
+
data,
|
|
2857
|
+
status: res.status,
|
|
2858
|
+
headers: res.headers
|
|
2859
|
+
};
|
|
2860
|
+
};
|
|
2814
2861
|
var getUploadFileUrl = () => {
|
|
2815
2862
|
return `/v1/upload-file`;
|
|
2816
2863
|
};
|
|
@@ -4523,6 +4570,17 @@ var listDispatchesHandler = async (args) => {
|
|
|
4523
4570
|
]
|
|
4524
4571
|
};
|
|
4525
4572
|
};
|
|
4573
|
+
var listNotificationsHandler = async (args) => {
|
|
4574
|
+
const res = await listNotifications(args.queryParams);
|
|
4575
|
+
return {
|
|
4576
|
+
content: [
|
|
4577
|
+
{
|
|
4578
|
+
type: "text",
|
|
4579
|
+
text: JSON.stringify(res)
|
|
4580
|
+
}
|
|
4581
|
+
]
|
|
4582
|
+
};
|
|
4583
|
+
};
|
|
4526
4584
|
var createToolHandler = async (args) => {
|
|
4527
4585
|
const res = await createTool(args.bodyParams);
|
|
4528
4586
|
return {
|
|
@@ -4622,6 +4680,17 @@ var workerExecuteToolHandler = async (args) => {
|
|
|
4622
4680
|
]
|
|
4623
4681
|
};
|
|
4624
4682
|
};
|
|
4683
|
+
var notifyAdminHandler = async (args) => {
|
|
4684
|
+
const res = await notifyAdmin(args.bodyParams);
|
|
4685
|
+
return {
|
|
4686
|
+
content: [
|
|
4687
|
+
{
|
|
4688
|
+
type: "text",
|
|
4689
|
+
text: JSON.stringify(res)
|
|
4690
|
+
}
|
|
4691
|
+
]
|
|
4692
|
+
};
|
|
4693
|
+
};
|
|
4625
4694
|
var uploadFileHandler = async (args) => {
|
|
4626
4695
|
const res = await uploadFile(args.bodyParams);
|
|
4627
4696
|
return {
|
|
@@ -9420,6 +9489,43 @@ var ListDispatchesResponse = zod.object({
|
|
|
9420
9489
|
total: zod.number()
|
|
9421
9490
|
})
|
|
9422
9491
|
});
|
|
9492
|
+
var listNotificationsQueryCountDefault = 50;
|
|
9493
|
+
var listNotificationsQueryCountMax = 100;
|
|
9494
|
+
var listNotificationsQueryOffsetDefault = 0;
|
|
9495
|
+
var listNotificationsQueryOffsetMin = 0;
|
|
9496
|
+
var listNotificationsQuerySortByDefault = `created_at`;
|
|
9497
|
+
var listNotificationsQuerySortOrderDefault = `desc`;
|
|
9498
|
+
var ListNotificationsQueryParams = zod.object({
|
|
9499
|
+
count: zod.number().min(1).max(listNotificationsQueryCountMax).default(listNotificationsQueryCountDefault),
|
|
9500
|
+
offset: zod.number().min(listNotificationsQueryOffsetMin).default(listNotificationsQueryOffsetDefault),
|
|
9501
|
+
sort_by: zod.enum(["created_at"]).default(listNotificationsQuerySortByDefault),
|
|
9502
|
+
sort_order: zod.enum(["asc", "desc"]).default(listNotificationsQuerySortOrderDefault)
|
|
9503
|
+
});
|
|
9504
|
+
var listNotificationsResponseDataItemCreatedByRegExp = new RegExp(
|
|
9505
|
+
"^(?:worker|user):[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
|
|
9506
|
+
);
|
|
9507
|
+
var ListNotificationsResponse = zod.object({
|
|
9508
|
+
data: zod.array(
|
|
9509
|
+
zod.object({
|
|
9510
|
+
id: zod.string(),
|
|
9511
|
+
type: zod.enum(["worker_issue_reported"]),
|
|
9512
|
+
title: zod.string().describe("Headline to display"),
|
|
9513
|
+
body: zod.string().describe("Body text to display"),
|
|
9514
|
+
data: zod.object({
|
|
9515
|
+
worker_id: zod.string(),
|
|
9516
|
+
run_id: zod.string()
|
|
9517
|
+
}).describe(
|
|
9518
|
+
"Identifiers the notification points at, for linking. Its keys depend on `type`."
|
|
9519
|
+
),
|
|
9520
|
+
created_by: zod.string().regex(listNotificationsResponseDataItemCreatedByRegExp).describe("Actor that raised the notification"),
|
|
9521
|
+
created_at: zod.string().datetime({})
|
|
9522
|
+
})
|
|
9523
|
+
),
|
|
9524
|
+
message: zod.string(),
|
|
9525
|
+
meta: zod.object({
|
|
9526
|
+
total: zod.number()
|
|
9527
|
+
})
|
|
9528
|
+
});
|
|
9423
9529
|
var CreateToolBody = zod.object({
|
|
9424
9530
|
name: zod.string().min(1),
|
|
9425
9531
|
code: zod.string().min(1),
|
|
@@ -9578,6 +9684,12 @@ var WorkerExecuteToolResponse = zod.object({
|
|
|
9578
9684
|
}),
|
|
9579
9685
|
message: zod.string()
|
|
9580
9686
|
});
|
|
9687
|
+
var notifyAdminBodyMessageMax = 2e3;
|
|
9688
|
+
var NotifyAdminBody = zod.object({
|
|
9689
|
+
message: zod.string().min(1).max(notifyAdminBodyMessageMax).describe(
|
|
9690
|
+
"What went wrong and what you need, in plain language. Write it for a person who is not watching this run: say what you were trying to do, what blocked you, and what you would need to continue."
|
|
9691
|
+
)
|
|
9692
|
+
});
|
|
9581
9693
|
var UploadFileBody = zod.object({
|
|
9582
9694
|
source_url: zod.string().describe(
|
|
9583
9695
|
"URL of the file to upload. Accepts either a public HTTPS URL or an `avallon://artifact-upload/` URL returned by the Request a pre-signed URL for direct large file upload (POST /v1/artifacts/get-upload-url) endpoint."
|
|
@@ -10977,6 +11089,14 @@ server.tool(
|
|
|
10977
11089
|
},
|
|
10978
11090
|
listDispatchesHandler
|
|
10979
11091
|
);
|
|
11092
|
+
server.tool(
|
|
11093
|
+
"listNotifications",
|
|
11094
|
+
"List notifications",
|
|
11095
|
+
{
|
|
11096
|
+
queryParams: ListNotificationsQueryParams
|
|
11097
|
+
},
|
|
11098
|
+
listNotificationsHandler
|
|
11099
|
+
);
|
|
10980
11100
|
server.tool(
|
|
10981
11101
|
"createTool",
|
|
10982
11102
|
"Create tool",
|
|
@@ -11045,6 +11165,14 @@ server.tool(
|
|
|
11045
11165
|
},
|
|
11046
11166
|
workerExecuteToolHandler
|
|
11047
11167
|
);
|
|
11168
|
+
server.tool(
|
|
11169
|
+
"notifyAdmin",
|
|
11170
|
+
"Notify an admin",
|
|
11171
|
+
{
|
|
11172
|
+
bodyParams: NotifyAdminBody
|
|
11173
|
+
},
|
|
11174
|
+
notifyAdminHandler
|
|
11175
|
+
);
|
|
11048
11176
|
server.tool(
|
|
11049
11177
|
"uploadFile",
|
|
11050
11178
|
"Upload a file for processing",
|
|
@@ -11141,4 +11269,4 @@ var transport = new StdioServerTransport();
|
|
|
11141
11269
|
server.connect(transport).then(() => {
|
|
11142
11270
|
console.error("MCP server running on stdio");
|
|
11143
11271
|
}).catch(console.error);
|
|
11144
|
-
//# sourceMappingURL=server-
|
|
11272
|
+
//# sourceMappingURL=server-LLILYP2F.js.map
|