@formfeed/mcp 0.3.21 → 0.3.23
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/bin/formfeed-mcp.mjs +21 -3
- package/package.json +1 -1
package/bin/formfeed-mcp.mjs
CHANGED
|
@@ -70732,7 +70732,7 @@ function toNumber(value) {
|
|
|
70732
70732
|
// packages/engine/src/lib/codes/epc.ts
|
|
70733
70733
|
function epcPayload(input) {
|
|
70734
70734
|
const amount = input.amount === void 0 || input.amount === "" ? "" : `EUR${toNumber(input.amount).toFixed(2)}`;
|
|
70735
|
-
|
|
70735
|
+
const elements = [
|
|
70736
70736
|
"BCD",
|
|
70737
70737
|
"002",
|
|
70738
70738
|
"1",
|
|
@@ -70744,8 +70744,12 @@ function epcPayload(input) {
|
|
|
70744
70744
|
(input.purpose ?? "").slice(0, 4),
|
|
70745
70745
|
(input.reference ?? "").slice(0, 35),
|
|
70746
70746
|
input.reference ? "" : (input.text ?? "").slice(0, 140),
|
|
70747
|
+
// the beneficiary to originator information, which a payment here has no field for
|
|
70747
70748
|
""
|
|
70748
|
-
]
|
|
70749
|
+
];
|
|
70750
|
+
while (elements.length > 0 && elements[elements.length - 1] === "")
|
|
70751
|
+
elements.pop();
|
|
70752
|
+
return elements.join("\n");
|
|
70749
70753
|
}
|
|
70750
70754
|
var normaliseIban = (iban2) => iban2.replace(/\s/g, "").toUpperCase();
|
|
70751
70755
|
function ibanChecksum(iban2) {
|
|
@@ -83878,7 +83882,7 @@ function base64(bytes) {
|
|
|
83878
83882
|
binary += String.fromCharCode(...bytes.subarray(i, i + 32768));
|
|
83879
83883
|
return btoa(binary);
|
|
83880
83884
|
}
|
|
83881
|
-
var SERVER_INFO = { name: "formfeed", version: "0.3.
|
|
83885
|
+
var SERVER_INFO = { name: "formfeed", version: "0.3.23" };
|
|
83882
83886
|
var READS = {
|
|
83883
83887
|
readOnlyHint: true,
|
|
83884
83888
|
destructiveHint: false,
|
|
@@ -83912,6 +83916,9 @@ var renderOutput = {
|
|
|
83912
83916
|
),
|
|
83913
83917
|
error: z3.object({ code: z3.string().optional(), message: z3.string().optional() }).nullable().describe("Why a failed render failed"),
|
|
83914
83918
|
accessibility: z3.record(z3.string(), z3.unknown()).optional().describe("The PDF/UA-1 verdict, when the template declares it"),
|
|
83919
|
+
pdfa: z3.record(z3.string(), z3.unknown()).optional().describe(
|
|
83920
|
+
"The PDF/A verdict (PDF/A-2b or PDF/A-3b), when the template declares it"
|
|
83921
|
+
),
|
|
83915
83922
|
einvoice: z3.record(z3.string(), z3.unknown()).optional().describe("The e-invoice report, when the render made one")
|
|
83916
83923
|
};
|
|
83917
83924
|
var diagnosticOutput = z3.object({
|
|
@@ -83948,6 +83955,8 @@ var renderSummary = (r) => ({
|
|
|
83948
83955
|
// the validator's verdict of a render whose template declares PDF/UA-1 (plan 21): whether the
|
|
83949
83956
|
// file passed, and for each failed rule what to change and in which elements
|
|
83950
83957
|
...r.accessibility ? { accessibility: r.accessibility } : {},
|
|
83958
|
+
// the verdict of a render whose template declares PDF/A (plan 26): the level and the validator
|
|
83959
|
+
...r.pdfa ? { pdfa: r.pdfa } : {},
|
|
83951
83960
|
// the report of an e-invoice (spec 17): valid, the findings, the XML's link, the hashes it checked
|
|
83952
83961
|
...r.einvoice ? { einvoice: r.einvoice } : {}
|
|
83953
83962
|
});
|
|
@@ -83995,6 +84004,7 @@ function slugIn(account, part) {
|
|
|
83995
84004
|
var EINVOICE_PROBLEMS = /* @__PURE__ */ new Set([
|
|
83996
84005
|
"einvoice_data_invalid",
|
|
83997
84006
|
"einvoice_display_mismatch",
|
|
84007
|
+
"pdfa_validation_failed",
|
|
83998
84008
|
"pdfa_conversion_failed",
|
|
83999
84009
|
"einvoice_validator_error"
|
|
84000
84010
|
]);
|
|
@@ -84007,11 +84017,13 @@ function text3(data) {
|
|
|
84007
84017
|
function failure(e) {
|
|
84008
84018
|
const message2 = e instanceof FormfeedError ? `${e.code}: ${e.message}` : e instanceof Error ? e.message : String(e);
|
|
84009
84019
|
const verdict = e instanceof FormfeedError && e.code === "pdfua_validation_failed" ? e.problem?.["accessibility"] : void 0;
|
|
84020
|
+
const pdfa = e instanceof FormfeedError && (e.code === "pdfa_validation_failed" || e.code === "pdfa_conversion_failed" || e.code === "pdfua_validation_failed") ? e.problem?.["pdfa"] : void 0;
|
|
84010
84021
|
const invoice = e instanceof FormfeedError && EINVOICE_PROBLEMS.has(e.code) ? Object.fromEntries(
|
|
84011
84022
|
["errors", "einvoice"].filter((key) => e.problem?.[key] !== void 0).map((key) => [key, e.problem?.[key]])
|
|
84012
84023
|
) : {};
|
|
84013
84024
|
const details = {
|
|
84014
84025
|
...verdict ? { accessibility: verdict } : {},
|
|
84026
|
+
...pdfa ? { pdfa } : {},
|
|
84015
84027
|
...invoice
|
|
84016
84028
|
};
|
|
84017
84029
|
return {
|
|
@@ -85008,6 +85020,12 @@ function mcpFetchHandler(options = {}) {
|
|
|
85008
85020
|
challenge(metadata, "the access token expired")
|
|
85009
85021
|
);
|
|
85010
85022
|
}
|
|
85023
|
+
if (request.method !== "POST")
|
|
85024
|
+
return json(
|
|
85025
|
+
{ error: "This endpoint takes POST only; it opens no stream" },
|
|
85026
|
+
405,
|
|
85027
|
+
{ allow: "POST" }
|
|
85028
|
+
);
|
|
85011
85029
|
const mcp = createFormfeedServer({
|
|
85012
85030
|
apiKey: credential,
|
|
85013
85031
|
...workspaceId ? { workspaceId } : {},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formfeed/mcp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.23",
|
|
4
4
|
"mcpName": "io.github.formfeed-dev/formfeed",
|
|
5
5
|
"description": "Model Context Protocol server for Formfeed: list templates, read data schemas, validate and render documents from AI agents.",
|
|
6
6
|
"license": "MIT",
|