fh-library 0.2.13 → 0.2.15

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ![Version 0.1.3](https://img.shields.io/badge/Version-0.2.13-green.svg)
1
+ ![Version 0.1.3](https://img.shields.io/badge/Version-0.2.15-green.svg)
2
2
  ![License MIT](https://img.shields.io/badge/License-MIT-yellow.svg)
3
3
  [![Forever Healthy](https://img.shields.io/badge/(c)_2026-Forever_Healthy-573D7D.svg)](https://forever-healthy.org)
4
4
  [![npm](https://img.shields.io/badge/npm-fh--library-cb3837.svg)](https://www.npmjs.com/package/fh-library)
package/dist/index.js CHANGED
@@ -4140,7 +4140,7 @@ async function searchTrials(raw, libraryDir = FH_LIBRARY_DIR, fetchImpl = liveFe
4140
4140
  return { ok: true, result, cached: false };
4141
4141
  }
4142
4142
  function trialsLogId(q) {
4143
- const s = (q.intervention ?? q.condition ?? q.query ?? "").replace(/\s+/g, " ");
4143
+ const s = (q.intervention ?? q.condition ?? q.query ?? "").replace(/\s+/g, "_");
4144
4144
  return s.length > 10 ? s.slice(0, 9) + "\u2026" : s || "-";
4145
4145
  }
4146
4146
 
@@ -4257,7 +4257,7 @@ async function searchArticles(raw, libraryDir = FH_LIBRARY_DIR, fetchImpl = live
4257
4257
  return { ok: true, result, cached: false };
4258
4258
  }
4259
4259
  function logId2(q) {
4260
- const s = q.query.replace(/\s+/g, " ");
4260
+ const s = q.query.replace(/\s+/g, "_");
4261
4261
  return s.length > 10 ? s.slice(0, 9) + "\u2026" : s;
4262
4262
  }
4263
4263
 
@@ -4384,7 +4384,7 @@ function splitArticles(xml) {
4384
4384
  }
4385
4385
  var row2 = (pmid, s, level) => s ? [pmid, s.title, s.first_author, s.year, s.publication_types.length ? s.publication_types.join("; ") : null, s.retracted, level] : [pmid, null, null, null, null, null, level];
4386
4386
  async function fetchArticles(ids, libraryDir = FH_LIBRARY_DIR, converter = "fh-library", fetchImpl = fetchText) {
4387
- const result = { columns: COLUMNS3, rows: [], stored: 0, cached: 0, not_found: 0, invalid: 0 };
4387
+ const result = { columns: COLUMNS3, rows: [], new: 0, cached: 0, not_found: 0, invalid: 0 };
4388
4388
  const order2 = [];
4389
4389
  const invalid = /* @__PURE__ */ new Map();
4390
4390
  for (const raw of ids.slice(0, MAX_PMIDS)) {
@@ -4437,7 +4437,7 @@ async function fetchArticles(ids, libraryDir = FH_LIBRARY_DIR, converter = "fh-l
4437
4437
  if (!entryExists(paths)) writeEntry(paths, record, xml, converter);
4438
4438
  s = status(k);
4439
4439
  result.rows.push(row2(k, s, String(s.level)));
4440
- result.stored++;
4440
+ result.new++;
4441
4441
  }
4442
4442
  return result;
4443
4443
  }
@@ -4971,9 +4971,9 @@ function registerTools(server2) {
4971
4971
  const t0 = Date.now();
4972
4972
  const r = await fetchArticles(pmids, FH_LIBRARY_DIR, `${pkg.name} ${pkg.version}`);
4973
4973
  if (r.cached) bump("pubmed", true, r.cached);
4974
- if (r.stored) bump("pubmed", false, r.stored);
4974
+ if (r.new) bump("pubmed", false, r.new);
4975
4975
  const secs = ((Date.now() - t0) / 1e3).toFixed(1).padStart(4, "0") + "s";
4976
- log("library_pubmed", `pmids:${r.rows.length}`, `fetch_articles ${secs} cached=${r.cached} stored=${r.stored}${r.not_found ? ` not_found=${r.not_found}` : ""}${r.invalid ? ` invalid=${r.invalid}` : ""}`);
4976
+ log("library_pubmed", `pmids:${r.rows.length}`, `articles ${secs} cached=${r.cached} new=${r.new}${r.not_found ? ` not_found=${r.not_found}` : ""}${r.invalid ? ` invalid=${r.invalid}` : ""}`);
4977
4977
  return { content: [{ type: "text", text: leanJson(r) }] };
4978
4978
  }
4979
4979
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fh-library",
3
- "version": "0.2.13",
3
+ "version": "0.2.15",
4
4
  "mcpName": "io.github.forever-healthy/fh-library",
5
5
  "description": "MCP Server that builds a local Markdown library of the scientific papers cited by evidence reviews — fetches metadata, abstract and full text per PubMed ID through a configurable cascade of retrieval services",
6
6
  "type": "module",