@chrischall/myatriumhealth-mcp 1.3.0 → 1.3.1

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.
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "metadata": {
9
9
  "description": "MCP server for Angi — find home-service pros by trade and city, read ratings, reviews and pro profiles. Angi serves its pages only to a real browser, so requests route through the user's own angi.com tab via the fetchproxy browser extension, reusing their existing session. The trade/city taxonomy is read from Angi's public sitemaps directly.",
10
- "version": "1.3.0"
10
+ "version": "1.3.1"
11
11
  },
12
12
  "plugins": [
13
13
  {
@@ -15,7 +15,7 @@
15
15
  "displayName": "MyAtriumHealth",
16
16
  "source": "./",
17
17
  "description": "Read MyAtriumHealth (Epic MyChart) records — test results, medications, allergies, immunizations, health issues, visits — by relaying requests through the user's signed-in browser tab via the fetchproxy bridge.",
18
- "version": "1.3.0",
18
+ "version": "1.3.1",
19
19
  "author": {
20
20
  "name": "Chris Hall"
21
21
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "myatriumhealth-mcp",
3
3
  "displayName": "MyAtriumHealth",
4
- "version": "1.3.0",
4
+ "version": "1.3.1",
5
5
  "description": "MyAtriumHealth (Epic MyChart) access for Claude — test results, medications, allergies, immunizations, visits",
6
6
  "author": {
7
7
  "name": "Chris Hall",
package/README.md CHANGED
@@ -167,7 +167,9 @@ Every other reader gets the URL strip only. That field list is applied where one
167
167
  actually established and nowhere else — the list above is generated from
168
168
  `PROJECTED_ENDPOINTS` and checked against the `project()` call sites by a test, so it
169
169
  cannot quietly drift out of step with the code. If the portal's shape drifts, the
170
- projection warns to stderr and returns the raw response rather than an empty list.
170
+ projection warns to stderr and returns `{ projectionFailed: true, endpoint, topLevelKeys,
171
+ note }` rather than an empty list — key names only, never the raw health record; ask for
172
+ `view: 'full'` to see the portal's payload.
171
173
 
172
174
  ## Sessions expire, and they do it quietly
173
175
 
package/dist/bundle.js CHANGED
@@ -23312,399 +23312,388 @@ var require_v4 = __commonJS({
23312
23312
  // node_modules/dotenv/dist/index.cjs
23313
23313
  var require_dist2 = __commonJS({
23314
23314
  "node_modules/dotenv/dist/index.cjs"(exports, module) {
23315
- var O = (e, o) => () => {
23315
+ var D = (e, n) => () => {
23316
23316
  try {
23317
- return o || e((o = { exports: {} }).exports, o), o.exports;
23317
+ return n || e((n = { exports: {} }).exports, n), n.exports;
23318
23318
  } catch (t) {
23319
- throw o = 0, t;
23319
+ throw n = 0, t;
23320
23320
  }
23321
23321
  };
23322
- var q = O((Ce, j) => {
23323
- function I(e) {
23322
+ var I = D((qe, G) => {
23323
+ function F(e) {
23324
23324
  return typeof e == "string" ? !["false", "0", "no", "off", ""].includes(e.toLowerCase()) : !!e;
23325
23325
  }
23326
- function B() {
23326
+ function J() {
23327
23327
  let e = {};
23328
- for (let o of ["ENCODING", "PATH", "QUIET", "DEBUG", "OVERRIDE", "FAST"]) {
23329
- let t = process.env[`DOTENV_${o}`] != null ? process.env[`DOTENV_${o}`] : process.env[`DOTENV_CONFIG_${o}`];
23330
- t != null && (e[o.toLowerCase()] = o === "ENCODING" || o === "PATH" ? t : I(t));
23328
+ for (let n of ["ENCODING", "PATH", "QUIET", "DEBUG", "OVERRIDE", "FAST"]) {
23329
+ let t = process.env[`DOTENV_${n}`] != null ? process.env[`DOTENV_${n}`] : process.env[`DOTENV_CONFIG_${n}`];
23330
+ t != null && (e[n.toLowerCase()] = n === "ENCODING" || n === "PATH" ? t : F(t));
23331
23331
  }
23332
23332
  return e;
23333
23333
  }
23334
- j.exports = { parseBoolean: I, optionsFromEnv: B };
23334
+ G.exports = { parseBoolean: F, optionsFromEnv: J };
23335
23335
  });
23336
- var y = O((we, C) => {
23337
- var H = __require("fs"), x = __require("path"), L = __require("os"), { URL: M, fileURLToPath: W } = __require("url"), { parseBoolean: T, optionsFromEnv: Q } = q(), J = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg, v = new Uint8Array(256);
23338
- for (let e = 48; e <= 57; e++) v[e] = 1;
23339
- for (let e = 65; e <= 90; e++) v[e] = 1;
23340
- for (let e = 97; e <= 122; e++) v[e] = 1;
23341
- v[45] = 1;
23342
- v[46] = 1;
23343
- v[95] = 1;
23344
- function K(e) {
23345
- let o = {}, t = e.toString();
23336
+ var k = D((xe, x) => {
23337
+ var K = __require("fs"), S = __require("path"), X = __require("os"), { URL: Y, fileURLToPath: z4 } = __require("url"), { parseBoolean: j, optionsFromEnv: Z } = I(), ee = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg, b = new Uint8Array(256);
23338
+ for (let e = 48; e <= 57; e++) b[e] = 1;
23339
+ for (let e = 65; e <= 90; e++) b[e] = 1;
23340
+ for (let e = 97; e <= 122; e++) b[e] = 1;
23341
+ b[45] = 1;
23342
+ b[46] = 1;
23343
+ b[95] = 1;
23344
+ function te(e) {
23345
+ let n = {}, t = e.toString();
23346
23346
  t = t.replace(/\r\n?/mg, `
23347
23347
  `);
23348
- let n;
23349
- for (; (n = J.exec(t)) != null; ) {
23350
- let r = n[1], s = n[2] || "";
23351
- s = s.trim();
23352
- let i = s[0];
23353
- s = s.replace(/^(['"`])([\s\S]*)\1$/mg, "$2"), i === '"' && (s = s.replace(/\\n/g, `
23354
- `), s = s.replace(/\\r/g, "\r")), o[r] = s;
23355
- }
23356
- return o;
23357
- }
23358
- function X(e) {
23359
- let o = {}, t = typeof e == "string" ? e : e.toString();
23348
+ let o;
23349
+ for (; (o = ee.exec(t)) != null; ) {
23350
+ let r = o[1], i = o[2] || "";
23351
+ i = i.trim();
23352
+ let s = i[0];
23353
+ i = i.replace(/^(['"`])([\s\S]*)\1$/mg, "$2"), s === '"' && (i = i.replace(/\\n/g, `
23354
+ `), i = i.replace(/\\r/g, "\r")), n[r] = i;
23355
+ }
23356
+ return n;
23357
+ }
23358
+ function w(e) {
23359
+ return e <= 32 ? e === 32 || e >= 9 && e <= 13 : e >= 160 && (e === 160 || e === 5760 || e >= 8192 && e <= 8202 || e === 8232 || e === 8233 || e === 8239 || e === 8287 || e === 12288 || e === 65279);
23360
+ }
23361
+ function O(e) {
23362
+ return e === 10 || e === 8232 || e === 8233;
23363
+ }
23364
+ function re(e) {
23365
+ let n = {}, t = typeof e == "string" ? e : e.toString();
23360
23366
  t.indexOf("\r") !== -1 && (t = t.replace(/\r\n?/g, `
23361
23367
  `));
23362
- let n = t.length, r = 0;
23363
- for (; r < n; ) {
23364
- let s = t.charCodeAt(r);
23365
- for (; r < n && (s === 32 || s === 9 || s === 10 || s === 65279); ) r++, s = t.charCodeAt(r);
23366
- if (r >= n) break;
23367
- if (s === 35) {
23368
- for (; r < n && t.charCodeAt(r) !== 10; ) r++;
23368
+ let o = t.length, r = 0;
23369
+ for (; r < o; ) {
23370
+ let i = t.charCodeAt(r);
23371
+ for (; r < o && w(i); ) r++, i = t.charCodeAt(r);
23372
+ if (r >= o) break;
23373
+ if (i === 35) {
23374
+ for (; r < o && !O(t.charCodeAt(r)); ) r++;
23369
23375
  continue;
23370
23376
  }
23371
- if (s === 101 && r + 6 < n && t.charCodeAt(r + 1) === 120 && t.charCodeAt(r + 2) === 112 && t.charCodeAt(r + 3) === 111 && t.charCodeAt(r + 4) === 114 && t.charCodeAt(r + 5) === 116) {
23372
- let f = t.charCodeAt(r + 6);
23373
- if (f === 32 || f === 9) for (r += 7; r < n && ((s = t.charCodeAt(r)) === 32 || s === 9); ) r++;
23374
- else s = t.charCodeAt(r);
23375
- }
23376
- let i = r, l = 0;
23377
- for (; r < n && (l = t.charCodeAt(r), v[l]); ) r++;
23378
- if (r === i) {
23379
- for (; r < n && t.charCodeAt(r) !== 10; ) r++;
23377
+ if (i === 101 && r + 6 < o && t.charCodeAt(r + 1) === 120 && t.charCodeAt(r + 2) === 112 && t.charCodeAt(r + 3) === 111 && t.charCodeAt(r + 4) === 114 && t.charCodeAt(r + 5) === 116) {
23378
+ let g = t.charCodeAt(r + 6);
23379
+ if (w(g)) {
23380
+ let u = r + 7;
23381
+ for (; u < o && w(t.charCodeAt(u)); ) u++;
23382
+ b[t.charCodeAt(u)] && (r = u);
23383
+ } else i = t.charCodeAt(r);
23384
+ }
23385
+ let s = r, a = 0;
23386
+ for (; r < o && (a = t.charCodeAt(r), b[a]); ) r++;
23387
+ if (r === s) {
23388
+ for (; r < o && !O(t.charCodeAt(r)); ) r++;
23380
23389
  continue;
23381
23390
  }
23382
- let h = t.slice(i, r);
23383
- if (r >= n && (l = 0), l === 32 || l === 9) do
23384
- r++, l = r < n ? t.charCodeAt(r) : 0;
23385
- while (l === 32 || l === 9);
23386
- if (l === 61) r++;
23387
- else if (l === 58 && r + 1 < n && (t.charCodeAt(r + 1) === 32 || t.charCodeAt(r + 1) === 9)) r++;
23391
+ let d = t.slice(s, r), p = r;
23392
+ if (r >= o && (a = 0), w(a)) do
23393
+ r++, a = r < o ? t.charCodeAt(r) : 0;
23394
+ while (w(a));
23395
+ if (a === 61) r++;
23396
+ else if (a === 58 && r === p && r + 1 < o && w(t.charCodeAt(r + 1))) r += 2;
23388
23397
  else {
23389
- for (; r < n && t.charCodeAt(r) !== 10; ) r++;
23398
+ for (r = p; r < o && !O(t.charCodeAt(r)); ) r++;
23390
23399
  continue;
23391
23400
  }
23392
- for (; r < n && ((s = t.charCodeAt(r)) === 32 || s === 9); ) r++;
23393
- let u;
23394
- if (s = r < n ? t.charCodeAt(r) : 0, s === 39 || s === 34 || s === 96) {
23395
- let f = s, c = r + 1, a = c;
23396
- for (; a < n; ) {
23397
- let d = t.charCodeAt(a);
23398
- if (d === 92 && a + 1 < n) {
23399
- let p = t.charCodeAt(a + 1);
23400
- if (p === f || p === 92) {
23401
- a += 2;
23402
- continue;
23403
- }
23404
- }
23405
- if (d === f) break;
23406
- a++;
23407
- }
23408
- if (a >= n) {
23409
- let d = r, p = r;
23410
- for (; p < n; ) {
23411
- let w = t.charCodeAt(p);
23412
- if (w === 35 || w === 10) break;
23413
- p++;
23414
- }
23415
- let m = p;
23416
- for (; m > d; ) {
23417
- let w = t.charCodeAt(m - 1);
23418
- if (w === 32 || w === 9) m--;
23419
- else break;
23420
- }
23421
- if (u = t.slice(d, m), r = p, r < n && t.charCodeAt(r) === 35) for (; r < n && t.charCodeAt(r) !== 10; ) r++;
23422
- } else {
23423
- for (u = t.slice(c, a), r = a + 1, f === 34 && u.indexOf("\\") !== -1 && (u = u.replace(/\\n/g, `
23424
- `).replace(/\\r/g, "\r")); r < n && ((s = t.charCodeAt(r)) === 32 || s === 9); ) r++;
23425
- if (r < n && t.charCodeAt(r) === 35) for (; r < n && t.charCodeAt(r) !== 10; ) r++;
23401
+ let l = r, c = r;
23402
+ for (; c < o && w(t.charCodeAt(c)); ) c++;
23403
+ let f = t.charCodeAt(c), h, m = false;
23404
+ if (f === 39 || f === 34 || f === 96) {
23405
+ let g = t[c], u = t.indexOf(g, c + 1), v = -1, C = -1;
23406
+ for (; u !== -1; ) {
23407
+ let q = t.charCodeAt(u - 1) === 92, E = u + 1;
23408
+ for (; E < o && !O(t.charCodeAt(E)) && w(t.charCodeAt(E)); ) E++;
23409
+ if ((E === o || O(t.charCodeAt(E)) || t.charCodeAt(E) === 35) && (v = u, C = E), !q) break;
23410
+ u = t.indexOf(g, u + 1);
23426
23411
  }
23427
- } else {
23428
- let f = r, c = t.indexOf(`
23429
- `, r);
23430
- c === -1 && (c = n);
23431
- let a = t.indexOf("#", r);
23432
- (a === -1 || a > c) && (a = c);
23433
- let d = a;
23434
- for (; d > f; ) {
23435
- let p = t.charCodeAt(d - 1);
23436
- if (p === 32 || p === 9) d--;
23437
- else break;
23412
+ if (v !== -1) {
23413
+ if (h = t.slice(c + 1, v), r = C, t.charCodeAt(r) === 35) for (; r < o && !O(t.charCodeAt(r)); ) r++;
23414
+ m = true;
23438
23415
  }
23439
- u = f === d ? "" : t.slice(f, d), r = a === c ? a : c;
23440
23416
  }
23441
- o[h] = u;
23417
+ if (!m) {
23418
+ let g = t.indexOf(`
23419
+ `, l);
23420
+ g === -1 && (g = o);
23421
+ let u = t.indexOf("#", l);
23422
+ (u === -1 || u > g) && (u = g);
23423
+ let v = l, C = u;
23424
+ for (; v < C && w(t.charCodeAt(v)); ) v++;
23425
+ for (; C > v && w(t.charCodeAt(C - 1)); ) C--;
23426
+ let q = t.charCodeAt(v);
23427
+ if (C - v >= 2 && (q === 39 || q === 34 || q === 96) && t.charCodeAt(C - 1) === q ? h = t.slice(v + 1, C - 1) : h = t.slice(v, C), r = u, u < g) for (; r < o && !O(t.charCodeAt(r)); ) r++;
23428
+ }
23429
+ f === 34 && (m || c < r) && h.indexOf("\\") !== -1 && (h = h.replace(/\\n/g, `
23430
+ `).replace(/\\r/g, "\r")), n[d] = h;
23442
23431
  }
23443
- return o;
23432
+ return n;
23444
23433
  }
23445
- function Y(e, o) {
23446
- return o && T(o.fast) ? X(e) : K(e);
23434
+ function ne(e, n) {
23435
+ return n && j(n.fast) ? re(e) : te(e);
23447
23436
  }
23448
- function b(e) {
23437
+ function y(e) {
23449
23438
  console.log(`\u2506 ${e}`);
23450
23439
  }
23451
- function z4(e) {
23440
+ function oe(e) {
23452
23441
  console.error(`\u25C7 ${e}`);
23453
23442
  }
23454
- function N(e) {
23455
- return e[0] === "~" ? x.join(L.homedir(), e.slice(1)) : e;
23456
- }
23457
- function Z(e = {}) {
23458
- return { ...Q(), ...e };
23459
- }
23460
- function ee(e) {
23461
- e = Z(e);
23462
- let o = x.resolve(process.cwd(), ".env"), t = "utf8", n = process.env;
23463
- e && e.processEnv != null && (n = e.processEnv);
23464
- let r = T(e && e.debug), s = T(e && e.quiet);
23465
- e && e.encoding ? t = e.encoding : r && b("no encoding is specified (UTF-8 is used by default)");
23466
- let i = [o];
23467
- if (e && e.path) if (!Array.isArray(e.path)) i = [N(e.path)];
23443
+ function U(e) {
23444
+ return e[0] === "~" ? S.join(X.homedir(), e.slice(1)) : e;
23445
+ }
23446
+ function se(e = {}) {
23447
+ return { ...Z(), ...e };
23448
+ }
23449
+ function ie(e) {
23450
+ e = se(e);
23451
+ let n = S.resolve(process.cwd(), ".env"), t = "utf8", o = process.env;
23452
+ e && e.processEnv != null && (o = e.processEnv);
23453
+ let r = j(e && e.debug), i = j(e && e.quiet);
23454
+ e && e.encoding ? t = e.encoding : r && y("no encoding is specified (UTF-8 is used by default)");
23455
+ let s = [n];
23456
+ if (e && e.path) if (!Array.isArray(e.path)) s = [U(e.path)];
23468
23457
  else {
23469
- i = [];
23470
- for (let c of e.path) i.push(N(c));
23471
- }
23472
- let l, h = {}, u = { fast: e.fast };
23473
- for (let c of i) try {
23474
- let a = g.parse(H.readFileSync(c, { encoding: t }), u);
23475
- g.populate(h, a, e);
23476
- } catch (a) {
23477
- r && b(`failed to load ${c} ${a.message}`), l = a;
23478
- }
23479
- let f = g.populate(n, h, e);
23480
- if (r || !s) {
23481
- let c = Object.keys(f).length, a = [];
23482
- for (let d of i) try {
23483
- let p = x.relative(process.cwd(), d instanceof M ? W(d) : d);
23484
- a.push(p);
23485
- } catch (p) {
23486
- r && b(`failed to load ${d} ${p.message}`), l = p;
23487
- }
23488
- z4(`injected env (${c}) from ${a.join(",")}`);
23489
- }
23490
- return l ? { parsed: h, error: l } : { parsed: h };
23491
- }
23492
- function te(e) {
23493
- return g.configDotenv(e);
23494
- }
23495
- function re(e, o, t = {}) {
23496
- let n = !!(t && t.debug), r = !!(t && t.override), s = {};
23497
- if (e === null || typeof e != "object" || o === null || typeof o != "object") {
23498
- let i = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
23499
- throw i.code = "OBJECT_REQUIRED", i;
23500
- }
23501
- for (let i of Object.keys(o)) Object.prototype.hasOwnProperty.call(e, i) ? (r === true && (e[i] = o[i], s[i] = o[i]), n && b(r === true ? `"${i}" is already defined and WAS overwritten` : `"${i}" is already defined and was NOT overwritten`)) : (e[i] = o[i], s[i] = o[i]);
23502
- return s;
23503
- }
23504
- var g = { configDotenv: ee, config: te, parse: Y, populate: re };
23505
- C.exports.configDotenv = g.configDotenv;
23506
- C.exports.config = g.config;
23507
- C.exports.parse = g.parse;
23508
- C.exports.populate = g.populate;
23509
- C.exports = g;
23458
+ s = [];
23459
+ for (let c of e.path) s.push(U(c));
23460
+ }
23461
+ let a, d = {}, p = { fast: e.fast };
23462
+ for (let c of s) try {
23463
+ let f = A.parse(K.readFileSync(c, { encoding: t }), p);
23464
+ A.populate(d, f, e);
23465
+ } catch (f) {
23466
+ r && y(`failed to load ${c} ${f.message}`), a = f;
23467
+ }
23468
+ let l = A.populate(o, d, e);
23469
+ if (r || !i) {
23470
+ let c = Object.keys(l).length, f = [];
23471
+ for (let h of s) try {
23472
+ let m = S.relative(process.cwd(), h instanceof Y ? z4(h) : h);
23473
+ f.push(m);
23474
+ } catch (m) {
23475
+ r && y(`failed to load ${h} ${m.message}`), a = m;
23476
+ }
23477
+ oe(`injected env (${c}) from ${f.join(",")}`);
23478
+ }
23479
+ return a ? { parsed: d, error: a } : { parsed: d };
23480
+ }
23481
+ function ce(e) {
23482
+ return A.configDotenv(e);
23483
+ }
23484
+ function ae(e, n, t = {}) {
23485
+ let o = !!(t && t.debug), r = !!(t && t.override), i = {};
23486
+ if (e === null || typeof e != "object" || n === null || typeof n != "object") {
23487
+ let s = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
23488
+ throw s.code = "OBJECT_REQUIRED", s;
23489
+ }
23490
+ for (let s of Object.keys(n)) Object.prototype.hasOwnProperty.call(e, s) ? (r === true && (e[s] = n[s], i[s] = n[s]), o && y(r === true ? `"${s}" is already defined and WAS overwritten` : `"${s}" is already defined and was NOT overwritten`)) : (e[s] = n[s], i[s] = n[s]);
23491
+ return i;
23492
+ }
23493
+ var A = { configDotenv: ie, config: ce, parse: ne, populate: ae };
23494
+ x.exports.configDotenv = A.configDotenv;
23495
+ x.exports.config = A.config;
23496
+ x.exports.parse = A.parse;
23497
+ x.exports.populate = A.populate;
23498
+ x.exports = A;
23510
23499
  });
23511
- var F = O((be, R) => {
23512
- var $ = __require("child_process"), oe = __require("fs"), P = __require("path");
23513
- function ne(e) {
23514
- let o = ['"'], t = 0;
23515
- for (let n of e) {
23516
- if (n === "\\") {
23500
+ var L = D((ye, H) => {
23501
+ var N = __require("child_process"), le = __require("fs"), B = __require("path");
23502
+ function fe(e) {
23503
+ let n = ['"'], t = 0;
23504
+ for (let o of e) {
23505
+ if (o === "\\") {
23517
23506
  t++;
23518
23507
  continue;
23519
23508
  }
23520
- n === '"' ? o.push("\\".repeat(t * 2 + 1), '"') : o.push("\\".repeat(t), n), t = 0;
23509
+ o === '"' ? n.push("\\".repeat(t * 2 + 1), '"') : n.push("\\".repeat(t), o), t = 0;
23521
23510
  }
23522
- return o.push("\\".repeat(t * 2), '"'), o.join("");
23511
+ return n.push("\\".repeat(t * 2), '"'), n.join("");
23523
23512
  }
23524
- function _(e, o = 1) {
23525
- for (let t = 0; t < o; t++) {
23526
- let n = [];
23513
+ function V(e, n = 1) {
23514
+ for (let t = 0; t < n; t++) {
23515
+ let o = [];
23527
23516
  for (let r of e) {
23528
- let s = r.charCodeAt(0), i = s >= 48 && s <= 57 || s >= 65 && s <= 90 || s >= 97 && s <= 122, l = "\\/:._-".includes(r);
23529
- !i && !l && s < 128 && n.push("^"), n.push(r);
23517
+ let i = r.charCodeAt(0), s = i >= 48 && i <= 57 || i >= 65 && i <= 90 || i >= 97 && i <= 122, a = "\\/:._-".includes(r);
23518
+ !s && !a && i < 128 && o.push("^"), o.push(r);
23530
23519
  }
23531
- e = n.join("");
23520
+ e = o.join("");
23532
23521
  }
23533
23522
  return e;
23534
23523
  }
23535
- function D(e, o) {
23536
- let t = Object.keys(e).reverse().find((n) => n.toUpperCase() === o);
23524
+ function _(e, n) {
23525
+ let t = Object.keys(e).reverse().find((o) => o.toUpperCase() === n);
23537
23526
  return t === void 0 ? void 0 : e[t];
23538
23527
  }
23539
- function se(e, o, t) {
23540
- let n = (D(o, "PATHEXT") || ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean), s = n.some((l) => e.toLowerCase().endsWith(l.toLowerCase())) ? ["", ...n] : [...n, ""], i = /[\\/]/.test(e) ? [t] : [t, ...(D(o, "PATH") || "").split(";")];
23541
- for (let l of i) for (let h of s) {
23542
- let u = P.resolve(t, l.replace(/^"|"$/g, ""), e + h);
23528
+ function ue(e, n, t) {
23529
+ let o = (_(n, "PATHEXT") || ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean), i = o.some((a) => e.toLowerCase().endsWith(a.toLowerCase())) ? ["", ...o] : [...o, ""], s = /[\\/]/.test(e) ? [t] : [t, ...(_(n, "PATH") || "").split(";")];
23530
+ for (let a of s) for (let d of i) {
23531
+ let p = B.resolve(t, a.replace(/^"|"$/g, ""), e + d);
23543
23532
  try {
23544
- if (oe.statSync(u).isFile()) return u;
23533
+ if (le.statSync(p).isFile()) return p;
23545
23534
  } catch {
23546
23535
  }
23547
23536
  }
23548
23537
  }
23549
- function ie(e, o, t) {
23550
- if (process.platform !== "win32") return $.spawn(e, o, t);
23551
- let n = t.env || process.env, r = se(e, n, t.cwd || process.cwd());
23552
- if (r && /\.(?:exe|com)$/i.test(r)) return $.spawn(r, o, t);
23553
- let s = /\.(?:bat|cmd)$/i.test(r || e), i = [_(P.normalize(r || e))];
23554
- for (let h of o) i.push(_(ne(h), s ? 2 : 1));
23555
- let l = i.join(" ");
23556
- return $.spawn(D(n, "COMSPEC") || "cmd.exe", ["/d", "/v:off", "/s", "/c", `"${l}"`], { ...t, windowsVerbatimArguments: true });
23538
+ function de(e, n, t) {
23539
+ if (process.platform !== "win32") return N.spawn(e, n, t);
23540
+ let o = t.env || process.env, r = ue(e, o, t.cwd || process.cwd());
23541
+ if (r && /\.(?:exe|com)$/i.test(r)) return N.spawn(r, n, t);
23542
+ let i = /\.(?:bat|cmd)$/i.test(r || e), s = [V(B.normalize(r || e))];
23543
+ for (let d of n) s.push(V(fe(d), i ? 2 : 1));
23544
+ let a = s.join(" ");
23545
+ return N.spawn(_(o, "COMSPEC") || "cmd.exe", ["/d", "/v:off", "/s", "/c", `"${a}"`], { ...t, windowsVerbatimArguments: true });
23557
23546
  }
23558
- R.exports = ie;
23547
+ H.exports = de;
23559
23548
  });
23560
- var V = O((Ae, S) => {
23561
- var ce = __require("fs"), ae = __require("os"), G = __require("path"), le = __require("child_process"), fe = F(), k = y(), { optionsFromEnv: ue } = q();
23562
- function A() {
23549
+ var Q = D((Te, R) => {
23550
+ var pe = __require("fs"), he = __require("os"), W = __require("path"), ge = __require("child_process"), ve = L(), P = k(), { optionsFromEnv: me } = I();
23551
+ function T() {
23563
23552
  console.log(["Usage: dotenv run [--help] [-q|--quiet] [--debug] [--override] [--fast] [-f|--file <paths>] [--] <command> [args...]", "", "Run a command with environment variables from a .env file.", "Place dotenv options before the command; all following arguments go to the command.", "", "Options:", " -f, --file <paths> .env paths, comma-separated or repeated (default: .env)", " -q, --quiet suppress the injected env message", " --debug enable debug logging", " --override override existing environment variables", " --fast use the faster character-scanner parser", "", "Environment variables (DOTENV_CONFIG_* names remain as fallbacks):", " DOTENV_PATH, DOTENV_ENCODING, DOTENV_QUIET,", " DOTENV_DEBUG, DOTENV_OVERRIDE,", " DOTENV_FAST"].join(`
23564
23553
  `));
23565
23554
  }
23566
- function de(e) {
23567
- let o = [], t = false, n, r, s, i, l = -1;
23568
- for (let u = 0; u < e.length; u++) {
23569
- let f = e[u];
23570
- if (f === "--") {
23571
- l = u + 1;
23555
+ function Ce(e) {
23556
+ let n = [], t = false, o, r, i, s, a = -1;
23557
+ for (let p = 0; p < e.length; p++) {
23558
+ let l = e[p];
23559
+ if (l === "--") {
23560
+ a = p + 1;
23572
23561
  break;
23573
23562
  }
23574
- if (f === "--help" || f === "-h") return { help: true };
23575
- if (f === "--quiet" || f === "-q") {
23576
- n = true;
23563
+ if (l === "--help" || l === "-h") return { help: true };
23564
+ if (l === "--quiet" || l === "-q") {
23565
+ o = true;
23577
23566
  continue;
23578
23567
  }
23579
- if (f === "--debug") {
23568
+ if (l === "--debug") {
23580
23569
  r = true;
23581
23570
  continue;
23582
23571
  }
23583
- if (f === "--override") {
23584
- s = true;
23572
+ if (l === "--override") {
23573
+ i = true;
23585
23574
  continue;
23586
23575
  }
23587
- if (f === "--fast") {
23588
- i = true;
23576
+ if (l === "--fast") {
23577
+ s = true;
23589
23578
  continue;
23590
23579
  }
23591
- if (f === "-f" || f === "--file" || f.startsWith("-f=") || f.startsWith("--file=")) {
23592
- let c = f.indexOf("="), a = c === -1 ? f : f.slice(0, c), d = c === -1 ? e[++u] : f.slice(c + 1);
23593
- if (!d || d === "--") return { error: `${a} requires a path` };
23594
- let p = d.split(",").map((m) => m.trim()).filter(Boolean);
23595
- if (p.length === 0) return { error: `${a} requires a path` };
23596
- o.push(...p), t = true;
23580
+ if (l === "-f" || l === "--file" || l.startsWith("-f=") || l.startsWith("--file=")) {
23581
+ let c = l.indexOf("="), f = c === -1 ? l : l.slice(0, c), h = c === -1 ? e[++p] : l.slice(c + 1);
23582
+ if (!h || h === "--") return { error: `${f} requires a path` };
23583
+ let m = h.split(",").map((g) => g.trim()).filter(Boolean);
23584
+ if (m.length === 0) return { error: `${f} requires a path` };
23585
+ n.push(...m), t = true;
23597
23586
  continue;
23598
23587
  }
23599
- if (f.startsWith("-")) return { error: `unknown option: ${f}` };
23600
- l = u;
23588
+ if (l.startsWith("-")) return { error: `unknown option: ${l}` };
23589
+ a = p;
23601
23590
  break;
23602
23591
  }
23603
- let h = l === -1 ? [] : e.slice(l);
23604
- return { paths: o, pathSet: t, quiet: n, debug: r, override: s, fast: i, command: h };
23592
+ let d = a === -1 ? [] : e.slice(a);
23593
+ return { paths: n, pathSet: t, quiet: o, debug: r, override: i, fast: s, command: d };
23605
23594
  }
23606
- function pe(e) {
23607
- return e[0] === "~" ? G.join(ae.homedir(), e.slice(1)) : e;
23595
+ function we(e) {
23596
+ return e[0] === "~" ? W.join(he.homedir(), e.slice(1)) : e;
23608
23597
  }
23609
- function he(e) {
23610
- let o = ue(), t = { encoding: o.encoding || "utf8", quiet: o.quiet === true, debug: o.debug === true, override: o.override === true, fast: o.fast === true, paths: [".env"], defaultPath: true };
23611
- return o.path != null && (t.paths = [o.path], t.defaultPath = false), e.pathSet && (t.paths = e.paths, t.defaultPath = false), e.quiet != null && (t.quiet = e.quiet), e.debug != null && (t.debug = e.debug), e.override != null && (t.override = e.override), e.fast != null && (t.fast = e.fast), t;
23598
+ function Ae(e) {
23599
+ let n = me(), t = { encoding: n.encoding || "utf8", quiet: n.quiet === true, debug: n.debug === true, override: n.override === true, fast: n.fast === true, paths: [".env"], defaultPath: true };
23600
+ return n.path != null && (t.paths = [n.path], t.defaultPath = false), e.pathSet && (t.paths = e.paths, t.defaultPath = false), e.quiet != null && (t.quiet = e.quiet), e.debug != null && (t.debug = e.debug), e.override != null && (t.override = e.override), e.fast != null && (t.fast = e.fast), t;
23612
23601
  }
23613
- function ge(e) {
23614
- let o = {}, t = [], n = { override: e.override, debug: e.debug };
23615
- for (let s of e.paths) {
23616
- let i = G.resolve(process.cwd(), pe(s));
23602
+ function Ee(e) {
23603
+ let n = {}, t = [], o = { override: e.override, debug: e.debug };
23604
+ for (let i of e.paths) {
23605
+ let s = W.resolve(process.cwd(), we(i));
23617
23606
  try {
23618
- let l = k.parse(ce.readFileSync(i, { encoding: e.encoding }), { fast: e.fast });
23619
- k.populate(o, l, n), t.push(s);
23620
- } catch (l) {
23621
- if (e.debug && console.log(`\u2506 failed to load ${s} ${l.message}`), !(e.defaultPath && l.code === "ENOENT")) throw l;
23607
+ let a = P.parse(pe.readFileSync(s, { encoding: e.encoding }), { fast: e.fast });
23608
+ P.populate(n, a, o), t.push(i);
23609
+ } catch (a) {
23610
+ if (e.debug && console.log(`\u2506 failed to load ${i} ${a.message}`), !(e.defaultPath && a.code === "ENOENT")) throw a;
23622
23611
  }
23623
23612
  }
23624
- return { injected: k.populate(process.env, o, n), loadedPaths: t };
23613
+ return { injected: P.populate(process.env, n, o), loadedPaths: t };
23625
23614
  }
23626
- function U(e) {
23627
- let o = e[0];
23628
- if (o === "--help" || o === "-h") {
23629
- A();
23615
+ function M(e) {
23616
+ let n = e[0];
23617
+ if (n === "--help" || n === "-h") {
23618
+ T();
23630
23619
  return;
23631
23620
  }
23632
- if (o !== "run") {
23633
- A(), process.exitCode = 1;
23621
+ if (n !== "run") {
23622
+ T(), process.exitCode = 1;
23634
23623
  return;
23635
23624
  }
23636
- let t = de(e.slice(1));
23625
+ let t = Ce(e.slice(1));
23637
23626
  if (t.help) {
23638
- A();
23627
+ T();
23639
23628
  return;
23640
23629
  }
23641
23630
  if (t.error) {
23642
- console.error(`dotenv: ${t.error}`), A(), process.exitCode = 1;
23631
+ console.error(`dotenv: ${t.error}`), T(), process.exitCode = 1;
23643
23632
  return;
23644
23633
  }
23645
23634
  if (t.command.length === 0) {
23646
- A(), process.exitCode = 1;
23635
+ T(), process.exitCode = 1;
23647
23636
  return;
23648
23637
  }
23649
- let n = he(t);
23638
+ let o = Ae(t);
23650
23639
  try {
23651
- let c = ge(n);
23652
- if (!n.quiet) {
23653
- let a = `\u25C7 injected env (${Object.keys(c.injected).length})`;
23654
- c.loadedPaths.length > 0 && (a += ` from ${c.loadedPaths.join(", ")}`), console.error(a);
23640
+ let c = Ee(o);
23641
+ if (!o.quiet) {
23642
+ let f = `\u25C7 injected env (${Object.keys(c.injected).length})`;
23643
+ c.loadedPaths.length > 0 && (f += ` from ${c.loadedPaths.join(", ")}`), console.error(f);
23655
23644
  }
23656
23645
  } catch (c) {
23657
23646
  console.error(`dotenv: ${c.message}`), process.exitCode = 1;
23658
23647
  return;
23659
23648
  }
23660
- let r = !!process.stdin.isTTY, s = process.platform !== "win32" && !r, i = fe(t.command[0], t.command.slice(1), { stdio: "inherit", detached: s }), l = /* @__PURE__ */ new Map(), h = 0;
23661
- function u(c) {
23662
- if (!(!i.pid || i.exitCode !== null || i.signalCode !== null)) {
23649
+ let r = !!process.stdin.isTTY, i = process.platform !== "win32" && !r, s = ve(t.command[0], t.command.slice(1), { stdio: "inherit", detached: i }), a = /* @__PURE__ */ new Map(), d = 0;
23650
+ function p(c) {
23651
+ if (!(!s.pid || s.exitCode !== null || s.signalCode !== null)) {
23663
23652
  if (process.platform === "win32") {
23664
- le.spawnSync("taskkill", ["/pid", String(i.pid), "/T", "/F"], { stdio: "ignore" });
23653
+ ge.spawnSync("taskkill", ["/pid", String(s.pid), "/T", "/F"], { stdio: "ignore" });
23665
23654
  return;
23666
23655
  }
23667
23656
  try {
23668
- process.kill(s ? -i.pid : i.pid, c);
23669
- } catch (a) {
23670
- if (a.code !== "ESRCH") throw a;
23657
+ process.kill(i ? -s.pid : s.pid, c);
23658
+ } catch (f) {
23659
+ if (f.code !== "ESRCH") throw f;
23671
23660
  }
23672
23661
  }
23673
23662
  }
23674
- function f() {
23675
- for (let [c, a] of l) process.removeListener(c, a);
23663
+ function l() {
23664
+ for (let [c, f] of a) process.removeListener(c, f);
23676
23665
  }
23677
23666
  for (let c of ["SIGINT", "SIGTERM", "SIGHUP", "SIGQUIT"]) {
23678
- let a = () => {
23667
+ let f = () => {
23679
23668
  if (c === "SIGINT") {
23680
- if (h++, r && process.platform !== "win32" && h === 1) return;
23681
- if (h > 1) {
23682
- u(h === 2 ? "SIGTERM" : "SIGKILL");
23669
+ if (d++, r && process.platform !== "win32" && d === 1) return;
23670
+ if (d > 1) {
23671
+ p(d === 2 ? "SIGTERM" : "SIGKILL");
23683
23672
  return;
23684
23673
  }
23685
23674
  }
23686
- u(c);
23675
+ p(c);
23687
23676
  };
23688
- l.set(c, a), process.on(c, a);
23677
+ a.set(c, f), process.on(c, f);
23689
23678
  }
23690
- i.on("error", function(c) {
23691
- f(), console.error(`dotenv: ${c.message}`), process.exitCode = 1;
23692
- }), i.on("exit", function(c, a) {
23693
- f(), typeof c == "number" ? process.exit(c) : (setInterval(() => {
23694
- }, 1e3), process.kill(process.pid, a));
23679
+ s.on("error", function(c) {
23680
+ l(), console.error(`dotenv: ${c.message}`), process.exitCode = 1;
23681
+ }), s.on("exit", function(c, f) {
23682
+ l(), typeof c == "number" ? process.exit(c) : (setInterval(() => {
23683
+ }, 1e3), process.kill(process.pid, f));
23695
23684
  });
23696
23685
  }
23697
- S.exports = U;
23698
- __require.main === S && U(process.argv.slice(2));
23686
+ R.exports = M;
23687
+ __require.main === R && M(process.argv.slice(2));
23699
23688
  });
23700
- var E = y();
23701
- var ve = V();
23702
- module.exports = E;
23703
- module.exports.config = E.config;
23704
- module.exports.configDotenv = E.configDotenv;
23705
- module.exports.parse = E.parse;
23706
- module.exports.populate = E.populate;
23707
- __require.main === module && ve(process.argv.slice(2));
23689
+ var $ = k();
23690
+ var be = Q();
23691
+ module.exports = $;
23692
+ module.exports.config = $.config;
23693
+ module.exports.configDotenv = $.configDotenv;
23694
+ module.exports.parse = $.parse;
23695
+ module.exports.populate = $.populate;
23696
+ __require.main === module && be(process.argv.slice(2));
23708
23697
  }
23709
23698
  });
23710
23699
 
@@ -69604,7 +69593,45 @@ var FetchproxyTransport = class {
69604
69593
  }
69605
69594
  };
69606
69595
 
69596
+ // src/view.ts
69597
+ var MAH_VIEWS = ["compact", "full"];
69598
+ var PROJECTED_ENDPOINTS = {
69599
+ "allergies/LoadAllergies": "mah_list_allergies",
69600
+ "HealthIssues/LoadHealthIssuesData": "mah_list_health_issues",
69601
+ "immunizations/LoadImmunizations": "mah_list_immunizations",
69602
+ "medications/LoadMedicationsPage": "mah_list_medications",
69603
+ "Clinical/CareTeam/Load": "mah_list_care_team",
69604
+ "goals/LoadPatientGoals": "mah_list_goals",
69605
+ "test-results/GetList": "mah_list_test_results",
69606
+ "Visits/VisitsList/LoadPast": "mah_list_past_visits",
69607
+ "Insurance/Coverages/GetCoverages": "mah_list_insurance",
69608
+ "conversations/GetConversationList": "mah_list_messages"
69609
+ };
69610
+ var PROJECTED_TOOLS = Object.values(PROJECTED_ENDPOINTS).join(", ");
69611
+ var NOTE = `compact strips image/avatar URLs from every response, and on the readers with a projection derived from a captured payload (${PROJECTED_TOOLS}) also reduces each record to its clinically meaningful fields; "full" returns MyAtriumHealth's payload untouched. Every other reader gets the URL strip only, rather than a field list nobody verified.`;
69612
+ var viewArg = () => viewParam(MAH_VIEWS, { note: NOTE });
69613
+ function isCompact(view) {
69614
+ return resolveView(view, MAH_VIEWS) === "compact";
69615
+ }
69616
+ function viewResponse(view, data) {
69617
+ const rung = resolveView(view, MAH_VIEWS);
69618
+ return minifiedResult(rung === "compact" ? stripMediaUrls(data) : data);
69619
+ }
69620
+
69607
69621
  // src/tools/_project.ts
69622
+ function projectionFailure(raw, endpoint) {
69623
+ const tool = PROJECTED_ENDPOINTS[endpoint];
69624
+ const again = tool ? `call ${tool} again with view: 'full'` : "call again with view: 'full'";
69625
+ const out = {
69626
+ projectionFailed: true,
69627
+ endpoint,
69628
+ note: `The portal response no longer matches the expected shape, so the compact projection could not be applied and the record was withheld. To see the portal's payload, ${again}.`
69629
+ };
69630
+ if (raw !== null && typeof raw === "object" && !Array.isArray(raw)) {
69631
+ out.topLevelKeys = Object.keys(raw);
69632
+ }
69633
+ return out;
69634
+ }
69608
69635
  function project(raw, compact, endpoint, pick2, completeness) {
69609
69636
  if (!compact) return raw;
69610
69637
  let out;
@@ -69615,9 +69642,9 @@ function project(raw, compact, endpoint, pick2, completeness) {
69615
69642
  }
69616
69643
  if (out === void 0) {
69617
69644
  console.error(
69618
- `[myatriumhealth-mcp] ${endpoint}: expected shape missing \u2014 returning the raw response. The portal may have changed; see docs/MYATRIUMHEALTH-API.md.`
69645
+ `[myatriumhealth-mcp] ${endpoint}: expected shape missing \u2014 withholding the record; view: 'full' returns it raw. The portal may have changed; see docs/MYATRIUMHEALTH-API.md.`
69619
69646
  );
69620
- return raw;
69647
+ return projectionFailure(raw, endpoint);
69621
69648
  }
69622
69649
  if (completeness === void 0) return out;
69623
69650
  let c = {};
@@ -69636,31 +69663,6 @@ function tidy(o) {
69636
69663
  return out;
69637
69664
  }
69638
69665
 
69639
- // src/view.ts
69640
- var MAH_VIEWS = ["compact", "full"];
69641
- var PROJECTED_ENDPOINTS = {
69642
- "allergies/LoadAllergies": "mah_list_allergies",
69643
- "HealthIssues/LoadHealthIssuesData": "mah_list_health_issues",
69644
- "immunizations/LoadImmunizations": "mah_list_immunizations",
69645
- "medications/LoadMedicationsPage": "mah_list_medications",
69646
- "Clinical/CareTeam/Load": "mah_list_care_team",
69647
- "goals/LoadPatientGoals": "mah_list_goals",
69648
- "test-results/GetList": "mah_list_test_results",
69649
- "Visits/VisitsList/LoadPast": "mah_list_past_visits",
69650
- "Insurance/Coverages/GetCoverages": "mah_list_insurance",
69651
- "conversations/GetConversationList": "mah_list_messages"
69652
- };
69653
- var PROJECTED_TOOLS = Object.values(PROJECTED_ENDPOINTS).join(", ");
69654
- var NOTE = `compact strips image/avatar URLs from every response, and on the readers with a projection derived from a captured payload (${PROJECTED_TOOLS}) also reduces each record to its clinically meaningful fields; "full" returns MyAtriumHealth's payload untouched. Every other reader gets the URL strip only, rather than a field list nobody verified.`;
69655
- var viewArg = () => viewParam(MAH_VIEWS, { note: NOTE });
69656
- function isCompact(view) {
69657
- return resolveView(view, MAH_VIEWS) === "compact";
69658
- }
69659
- function viewResponse(view, data) {
69660
- const rung = resolveView(view, MAH_VIEWS);
69661
- return minifiedResult(rung === "compact" ? stripMediaUrls(data) : data);
69662
- }
69663
-
69664
69666
  // src/tools/account.ts
69665
69667
  function registerAccountTools(server, client2, patients2) {
69666
69668
  server.registerTool(
@@ -74833,7 +74835,7 @@ function registerVisitTools(server, client2, patients2) {
74833
74835
  }
74834
74836
 
74835
74837
  // src/version.ts
74836
- var VERSION = "1.3.0";
74838
+ var VERSION = "1.3.1";
74837
74839
 
74838
74840
  // src/index.ts
74839
74841
  var dotenvCandidates = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrischall/myatriumhealth-mcp",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "MCP server for MyAtriumHealth (Atrium Health's Epic MyChart patient portal) via the fetchproxy browser bridge.",
5
5
  "type": "module",
6
6
  "bin": {
package/server.json CHANGED
@@ -6,12 +6,12 @@
6
6
  "url": "https://github.com/chrischall/myatriumhealth-mcp",
7
7
  "source": "github"
8
8
  },
9
- "version": "1.3.0",
9
+ "version": "1.3.1",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "@chrischall/myatriumhealth-mcp",
14
- "version": "1.3.0",
14
+ "version": "1.3.1",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  },