@avallon-labs/mcp 61.0.0 → 61.1.0-staging.1331
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
|
@@ -2709,6 +2709,21 @@ var createFormSubmission = async (createFormSubmissionBody, options) => {
|
|
|
2709
2709
|
const data = body ? JSON.parse(body) : {};
|
|
2710
2710
|
return { data, status: res.status, headers: res.headers };
|
|
2711
2711
|
};
|
|
2712
|
+
var getGetFormSubmissionUrl = (id) => {
|
|
2713
|
+
return `/v1/form-submissions/${id}`;
|
|
2714
|
+
};
|
|
2715
|
+
var getFormSubmission = async (id, options) => {
|
|
2716
|
+
const res = await fetch(
|
|
2717
|
+
getGetFormSubmissionUrl(id),
|
|
2718
|
+
{
|
|
2719
|
+
...options,
|
|
2720
|
+
method: "GET"
|
|
2721
|
+
}
|
|
2722
|
+
);
|
|
2723
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
2724
|
+
const data = body ? JSON.parse(body) : {};
|
|
2725
|
+
return { data, status: res.status, headers: res.headers };
|
|
2726
|
+
};
|
|
2712
2727
|
var getGetExtractUrl = (id) => {
|
|
2713
2728
|
return `/v1/extracts/${id}`;
|
|
2714
2729
|
};
|
|
@@ -7080,6 +7095,29 @@ var createFormSubmissionHandler = async (args, options) => {
|
|
|
7080
7095
|
structuredContent: res.data
|
|
7081
7096
|
};
|
|
7082
7097
|
};
|
|
7098
|
+
var getFormSubmissionHandler = async (args, options) => {
|
|
7099
|
+
const res = await getFormSubmission(args.pathParams.id, options);
|
|
7100
|
+
if (res.status >= 400) {
|
|
7101
|
+
return {
|
|
7102
|
+
content: [
|
|
7103
|
+
{
|
|
7104
|
+
type: "text",
|
|
7105
|
+
text: JSON.stringify(res.data ?? null)
|
|
7106
|
+
}
|
|
7107
|
+
],
|
|
7108
|
+
isError: true
|
|
7109
|
+
};
|
|
7110
|
+
}
|
|
7111
|
+
return {
|
|
7112
|
+
content: [
|
|
7113
|
+
{
|
|
7114
|
+
type: "text",
|
|
7115
|
+
text: JSON.stringify(res.data ?? null)
|
|
7116
|
+
}
|
|
7117
|
+
],
|
|
7118
|
+
structuredContent: res.data
|
|
7119
|
+
};
|
|
7120
|
+
};
|
|
7083
7121
|
var getExtractHandler = async (args, options) => {
|
|
7084
7122
|
const res = await getExtract(args.pathParams.id, options);
|
|
7085
7123
|
if (res.status >= 400) {
|
|
@@ -12548,6 +12586,22 @@ var CreateFormSubmissionResponse = zod.object({
|
|
|
12548
12586
|
"form_id": zod.string().uuid(),
|
|
12549
12587
|
"form_version": zod.number(),
|
|
12550
12588
|
"environment": zod.enum(["live", "test"]),
|
|
12589
|
+
"submission": zod.union([zod.record(zod.string(), zod.unknown()), zod.null()]).describe("Answers keyed by form field; null until submitted"),
|
|
12590
|
+
"created_at": zod.string().datetime({ "offset": true }),
|
|
12591
|
+
"submitted_at": zod.union([zod.string().datetime({ "offset": true }), zod.null()])
|
|
12592
|
+
}),
|
|
12593
|
+
"message": zod.string()
|
|
12594
|
+
});
|
|
12595
|
+
var GetFormSubmissionParams = zod.object({
|
|
12596
|
+
"id": zod.string().uuid()
|
|
12597
|
+
});
|
|
12598
|
+
var GetFormSubmissionResponse = zod.object({
|
|
12599
|
+
"data": zod.object({
|
|
12600
|
+
"id": zod.string().describe("Unguessable id that is the link: the renderer opens `/public/v1/form-submissions/{id}`."),
|
|
12601
|
+
"form_id": zod.string().uuid(),
|
|
12602
|
+
"form_version": zod.number(),
|
|
12603
|
+
"environment": zod.enum(["live", "test"]),
|
|
12604
|
+
"submission": zod.union([zod.record(zod.string(), zod.unknown()), zod.null()]).describe("Answers keyed by form field; null until submitted"),
|
|
12551
12605
|
"created_at": zod.string().datetime({ "offset": true }),
|
|
12552
12606
|
"submitted_at": zod.union([zod.string().datetime({ "offset": true }), zod.null()])
|
|
12553
12607
|
}),
|
|
@@ -16793,6 +16847,22 @@ var createMcpServer = (options) => {
|
|
|
16793
16847
|
signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
|
|
16794
16848
|
})
|
|
16795
16849
|
);
|
|
16850
|
+
tools.getFormSubmission = server2.registerTool(
|
|
16851
|
+
"getFormSubmission",
|
|
16852
|
+
{
|
|
16853
|
+
title: "Get form submission",
|
|
16854
|
+
description: "Retrieve a submission link and, once it was submitted, the answers. Used by the form's worker and the studio; respondents use the public endpoint instead.",
|
|
16855
|
+
inputSchema: {
|
|
16856
|
+
pathParams: GetFormSubmissionParams
|
|
16857
|
+
},
|
|
16858
|
+
outputSchema: GetFormSubmissionResponse,
|
|
16859
|
+
annotations: { readOnlyHint: true }
|
|
16860
|
+
},
|
|
16861
|
+
(args, ctx) => getFormSubmissionHandler(args, {
|
|
16862
|
+
...options,
|
|
16863
|
+
signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
|
|
16864
|
+
})
|
|
16865
|
+
);
|
|
16796
16866
|
tools.getExtract = server2.registerTool(
|
|
16797
16867
|
"getExtract",
|
|
16798
16868
|
{
|
|
@@ -17942,4 +18012,4 @@ var transport = new StdioServerTransport();
|
|
|
17942
18012
|
server.connect(transport).then(() => {
|
|
17943
18013
|
console.error("MCP server running on stdio");
|
|
17944
18014
|
}).catch(console.error);
|
|
17945
|
-
//# sourceMappingURL=server-
|
|
18015
|
+
//# sourceMappingURL=server-GLJAJBOR.js.map
|