formlab-mcp 0.6.27 → 0.6.29

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "formlab-mcp",
3
- "version": "0.6.27",
3
+ "version": "0.6.29",
4
4
  "mcpName": "io.github.juliu1980/formlab-mcp",
5
5
  "description": "Read-only Model Context Protocol server for FormLab \u2014 lets Claude (and other MCP clients) read and analyze your FormLab data, from a local export file OR your live cloud workspace.",
6
6
  "type": "module",
package/server.json CHANGED
@@ -2,7 +2,7 @@
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 for FormLab — let Claude query your formulation lab. Free reads a local export; Pro connects to your live cloud workspace with a dedicated read-only token.",
5
- "version": "0.6.27",
5
+ "version": "0.6.29",
6
6
  "websiteUrl": "https://formvix.com/mcp",
7
7
  "repository": {
8
8
  "url": "https://github.com/juliu1980/FormLab",
@@ -13,7 +13,7 @@
13
13
  {
14
14
  "registryType": "npm",
15
15
  "identifier": "formlab-mcp",
16
- "version": "0.6.27",
16
+ "version": "0.6.29",
17
17
  "runtimeHint": "npx",
18
18
  "transport": {
19
19
  "type": "stdio"
@@ -1081,10 +1081,18 @@ const get_stability = {
1081
1081
  const n = ys.length;
1082
1082
  const out = { points: n, from: pts[0].date.toISOString().slice(0, 10), to: pts[n - 1].date.toISOString().slice(0, 10), values: ys.map(v => _round(v, 6)), latest: _round(ys[n - 1], 6) };
1083
1083
  if (n < 2) { out.note = 'Fewer than 2 points — no trend/shelf-life.'; return out; }
1084
- const fit = _ols(pts.map((_, i) => i), ys);
1084
+ // Drift on real elapsed months (not point order), like the shelf-life
1085
+ // projection and the app's Stability view: uneven ICH schedules
1086
+ // (0/1/3/6/12 mo) read true.
1087
+ const t0 = pts[0].date.getTime();
1088
+ const days = (pts[n - 1].date - pts[0].date) / 86400000;
1089
+ // 3+ distinct test dates, like the shelf-life rule: same-day repeats span
1090
+ // hours, and a slope over hours reads as an absurd monthly drift.
1091
+ const nDays = new Set(pts.map(p => p.date.toISOString().slice(0, 10))).size;
1092
+ const fit = (days > 0 && nDays >= 3) ? _ols(pts.map(p => (p.date.getTime() - t0) / 86400000 / 30.4375), ys) : null;
1093
+ if (!fit && nDays < 3) out.driftNote = `Only ${nDays} distinct test date${nDays === 1 ? '' : 's'}: no drift estimate (needs 3+).`;
1085
1094
  if (fit) {
1086
- const days = (pts[n - 1].date - pts[0].date) / 86400000;
1087
- const perMonth = days > 0 ? (fit.slope * (n - 1) / days) * 30 : 0;
1095
+ const perMonth = fit.slope;
1088
1096
  out.drift = { perMonth: _round(perMonth, 4), r2: _round(fit.r2, 3), direction: perMonth > 0 ? 'increasing' : perMonth < 0 ? 'decreasing' : 'flat' };
1089
1097
  }
1090
1098
  const ic = _iChart(ys);