@formfeed/mcp 0.3.2 → 0.3.3

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.
@@ -77504,6 +77504,7 @@ function toDate2(value, tz) {
77504
77504
  function escapeHtml(value) {
77505
77505
  return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
77506
77506
  }
77507
+ var isNamedArgs = (v2) => !!v2 && typeof v2 === "object" && !Array.isArray(v2) && !(v2 instanceof Date);
77507
77508
  var str = (v2) => v2 === void 0 || v2 === null ? "" : String(v2);
77508
77509
  var opt = (v2, fallback) => v2 === void 0 || v2 === null || v2 === "" ? fallback : v2;
77509
77510
  var wordsByLang = {
@@ -77538,7 +77539,7 @@ var formatHelpers = [
77538
77539
  name: "number",
77539
77540
  doc: {
77540
77541
  signature: "number(value, decimals?, locale?)",
77541
- description: "Formats a number with grouping and a fixed number of decimals.",
77542
+ description: "Formats a number with grouping. With decimals, exactly that many (rounded half away from zero); without, the decimals the number has, at most three, so 1234.5 \u2192 1.234,5 and 2.34567 \u2192 2,346. Use number(0) for whole numbers.",
77542
77543
  example: "{{ qty | number(2) }} \u2192 1.234,00",
77543
77544
  category: "format"
77544
77545
  },
@@ -77632,15 +77633,26 @@ var formatHelpers = [
77632
77633
  {
77633
77634
  name: "round",
77634
77635
  doc: {
77635
- signature: "round(value, decimals = 0)",
77636
- description: "Rounds half away from zero.",
77637
- example: "{{ 2.345 | round(2) }} gives 2.35",
77636
+ signature: "round(value, decimals = 0, method = 'common')",
77637
+ description: "Rounds to the given decimals, as Jinja2's round does: 'common' rounds half away from zero, 'floor' always down and 'ceil' always up.",
77638
+ example: "{{ 2.345 | round(2) }} gives 2.35, {{ 2.349 | round(2, 'floor') }} gives 2.34",
77638
77639
  category: "format"
77639
77640
  },
77640
- fn: (_ctx, value, decimals) => {
77641
+ // `round(2, method='floor')` (Jinja2) and `round: 2, method: 'floor'` (Liquid) arrive as a
77642
+ // trailing object, as does a Handlebars hash
77643
+ fn: (_ctx, value, ...args2) => {
77641
77644
  const n = toNumber(value);
77642
- const f2 = 10 ** (decimals === void 0 || decimals === null ? 0 : Number(decimals));
77643
- return Number.isNaN(n) ? "" : Math.round((Math.abs(n) + Number.EPSILON) * f2) / f2 * Math.sign(n);
77645
+ if (Number.isNaN(n)) return "";
77646
+ const named = args2.find(isNamedArgs) ?? {};
77647
+ const [decimals, method] = args2.filter((a) => !isNamedArgs(a));
77648
+ const places = Number(opt(decimals, opt(named["precision"], opt(named["decimals"], 0))));
77649
+ const how = String(opt(method, opt(named["method"], "common")));
77650
+ const f2 = 10 ** places;
77651
+ const scaled = Number((Math.abs(n) * f2).toPrecision(15));
77652
+ if (how === "floor") return (n < 0 ? -Math.ceil(scaled) : Math.floor(scaled)) / f2;
77653
+ if (how === "ceil") return (n < 0 ? -Math.floor(scaled) : Math.ceil(scaled)) / f2;
77654
+ if (how !== "common") throw new Error(`round: method must be 'common', 'floor' or 'ceil', not '${how}'`);
77655
+ return Math.round(scaled + Number.EPSILON) / f2 * Math.sign(n);
77644
77656
  }
77645
77657
  },
77646
77658
  {
@@ -82780,7 +82792,7 @@ var encoder2 = new TextEncoder();
82780
82792
  // packages/mcp/src/lib/server.ts
82781
82793
  import { z as z2 } from "zod";
82782
82794
  var CONVERT_LIMIT_BYTES = 20 * 1024 * 1024;
82783
- var SERVER_INFO = { name: "formfeed", version: "0.3.2" };
82795
+ var SERVER_INFO = { name: "formfeed", version: "0.3.3" };
82784
82796
  var engineSchema = z2.enum(["jinja2", "liquid", "handlebars"]);
82785
82797
  var outputSchema = z2.enum(outputFormats);
82786
82798
  var kindSchema = z2.enum(["pdf", "image", "docx", "pptx"]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formfeed/mcp",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Model Context Protocol server for Formfeed: list templates, read data schemas, validate and render documents from AI agents.",
5
5
  "license": "MIT",
6
6
  "author": {