formlab-mcp 0.6.84 → 0.6.85
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/package.json +1 -1
- package/server.json +2 -2
- package/vendor/nutrition-label.js +9 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "formlab-mcp",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.85",
|
|
4
4
|
"mcpName": "io.github.juliu1980/formlab-mcp",
|
|
5
5
|
"description": "Read-only Model Context Protocol server for FormLab. Lets Claude and other MCP clients read and analyze your FormLab data, from a local export file or your live cloud workspace.",
|
|
6
6
|
"homepage": "https://formvix.com/mcp",
|
package/server.json
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
3
|
"name": "io.github.juliu1980/formlab-mcp",
|
|
4
4
|
"description": "Read-only MCP server for FormLab formulation data: a local export file or your live cloud workspace.",
|
|
5
|
-
"version": "0.6.
|
|
5
|
+
"version": "0.6.85",
|
|
6
6
|
"websiteUrl": "https://formvix.com/mcp",
|
|
7
7
|
"packages": [
|
|
8
8
|
{
|
|
9
9
|
"registryType": "npm",
|
|
10
10
|
"identifier": "formlab-mcp",
|
|
11
|
-
"version": "0.6.
|
|
11
|
+
"version": "0.6.85",
|
|
12
12
|
"runtimeHint": "npx",
|
|
13
13
|
"transport": {
|
|
14
14
|
"type": "stdio"
|
|
@@ -119,7 +119,9 @@ function flNlCompute(f) {
|
|
|
119
119
|
FL_NL_NUTRIENTS.forEach((n, j) => {
|
|
120
120
|
let sum = 0; const miss = [];
|
|
121
121
|
rows.forEach((r, i) => { const v = vals[i][j]; if (v == null) { if (vals[i].some(x => x != null)) miss.push(_nlRowName(r)); } else sum += r.amount * v; });
|
|
122
|
-
|
|
122
|
+
// An impossible figure (an amount or a field near 1e308 overflows to Infinity) counts as 0, not "Infinity%" (QA, 17 Nov).
|
|
123
|
+
const v = sum / total;
|
|
124
|
+
out.per100[n.key] = Number.isFinite(v) && v <= 1e9 ? v : 0;
|
|
123
125
|
if (miss.length) out.missing[n.key] = miss;
|
|
124
126
|
});
|
|
125
127
|
out.ok = out.withData > 0;
|
|
@@ -144,10 +146,12 @@ function flNlHasFoodData(f) {
|
|
|
144
146
|
}
|
|
145
147
|
|
|
146
148
|
const FL_NL_MAX_SERVING = 5000; // g; a larger serving is a typo
|
|
149
|
+
// Typed text only: a stored object or array is not a household measure ("[object Object]"; QA, 17 Nov).
|
|
150
|
+
const _nlStr = (v) => (typeof v === 'string' || typeof v === 'number') ? String(v).trim() : '';
|
|
147
151
|
function _nlSettings(f) {
|
|
148
152
|
const l = (f && f.label) || {};
|
|
149
153
|
const s = parseFloat(l.serving), y = parseFloat(l.yield);
|
|
150
|
-
return { yield: Number.isFinite(y) && y >= FL_NL_YIELD[0] && y <= FL_NL_YIELD[1] && y !== 100 ? y : null, serving: Number.isFinite(s) && s > 0 && s <= FL_NL_MAX_SERVING ? s : null, unit: l.unit === 'mL' ? 'mL' : 'g', region: l.region === 'eu' ? 'eu' : 'us', format: ['simplified', 'tabular', 'linear', 'dual'].includes(l.format) ? l.format : 'standard', household:
|
|
154
|
+
return { yield: Number.isFinite(y) && y >= FL_NL_YIELD[0] && y <= FL_NL_YIELD[1] && y !== 100 ? y : null, serving: Number.isFinite(s) && s > 0 && s <= FL_NL_MAX_SERVING ? s : null, unit: l.unit === 'mL' ? 'mL' : 'g', region: l.region === 'eu' ? 'eu' : 'us', format: ['simplified', 'tabular', 'linear', 'dual'].includes(l.format) ? l.format : 'standard', household: _nlStr(l.household), servings: _nlStr(l.servings) };
|
|
151
155
|
}
|
|
152
156
|
// A serving in grams. A drink's serving is in mL (61r): grams = mL × the formula's density, the finished density
|
|
153
157
|
// when it has one, else the ideal-mix estimate; with neither, 1 g/mL and `noDensity` so the tab can say so.
|
|
@@ -296,7 +300,8 @@ function flNlEuStatement(f) {
|
|
|
296
300
|
const one = (it, mark, safe) => {
|
|
297
301
|
const spans = [], add = [];
|
|
298
302
|
it.allergens.forEach(k => {
|
|
299
|
-
|
|
303
|
+
// Own keys only: a stored chip named "constructor" found Object's own and took the tab down (QA, 17 Nov).
|
|
304
|
+
const d = typeof k === 'string' && Object.prototype.hasOwnProperty.call(FL_NL_EU_ALLERGENS, k) ? FL_NL_EU_ALLERGENS[k] : null;
|
|
300
305
|
if (!d) return;
|
|
301
306
|
if (!found.includes(d[0])) found.push(d[0]);
|
|
302
307
|
const m = new RegExp('\\b(?:' + d[1].source + ')\\b', 'i').exec(it.name);
|
|
@@ -642,6 +647,7 @@ const FL_NL_PANEL_CSS = `.nl-panel{box-sizing:border-box;width:280px;padding:4px
|
|
|
642
647
|
.nl-panel.nl-eu{width:316px;padding:0;border-width:1px}
|
|
643
648
|
.nl-eu table{width:100%;table-layout:fixed;border-collapse:collapse;margin:0;background:none;font:400 11.5px/1.25 Helvetica,Arial,sans-serif}
|
|
644
649
|
.nl-eu th,.nl-eu td{padding:3px 5px;border:0;border-bottom:1px solid #000;background:none;color:#000;font:400 11.5px/1.25 Helvetica,Arial,sans-serif;text-align:right;vertical-align:bottom;text-transform:none;letter-spacing:0;white-space:nowrap}
|
|
650
|
+
.nl-panel.nl-eu th,.nl-panel.nl-eu td{background:rgb(255,255,255)!important;color:#000!important}
|
|
645
651
|
.nl-eu th{font-weight:700;border-bottom-width:1.5px;white-space:normal}.nl-eu th:first-child{width:38%}.nl-eu th:first-child,.nl-eu td:first-child{text-align:left}
|
|
646
652
|
.nl-eu th + th,.nl-eu td + td{border-left:1px solid #000}
|
|
647
653
|
.nl-eu tr:last-child td{border-bottom:0}.nl-eu .nl-e-in td:first-child{padding-left:16px}`;
|