@openephemeris/mcp-server 4.16.0 → 4.18.0

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +15 -15
  3. package/config/dev-allowlist.json +31 -19
  4. package/dist/backend/client.d.ts +57 -1
  5. package/dist/backend/client.js +125 -15
  6. package/dist/prompts.js +26 -24
  7. package/dist/server-sse.d.ts +18 -0
  8. package/dist/server-sse.js +41 -6
  9. package/dist/tools/apps/_render-token.d.ts +34 -0
  10. package/dist/tools/apps/_render-token.js +50 -0
  11. package/dist/tools/apps/bazi-app.js +36 -12
  12. package/dist/tools/apps/bi-wheel-app.d.ts +9 -2
  13. package/dist/tools/apps/bi-wheel-app.js +76 -117
  14. package/dist/tools/apps/bodygraph-app.js +88 -41
  15. package/dist/tools/apps/chart-wheel-app.js +56 -16
  16. package/dist/tools/apps/location-tools.js +10 -3
  17. package/dist/tools/apps/moon-phase-app.js +10 -2
  18. package/dist/tools/apps/transit-timeline-app.d.ts +3 -0
  19. package/dist/tools/apps/transit-timeline-app.js +77 -9
  20. package/dist/tools/apps/vedic-chart-app.js +10 -1
  21. package/dist/tools/datetime-historical.js +7 -2
  22. package/dist/tools/datetime.js +2 -1
  23. package/dist/tools/dev.js +7 -6
  24. package/dist/tools/specialized/electional.js +4 -3
  25. package/dist/tools/specialized/ephemeris_extended.js +19 -4
  26. package/dist/tools/specialized/hd_group.js +2 -2
  27. package/dist/tools/specialized/moon.d.ts +1 -1
  28. package/dist/tools/specialized/moon.js +51 -43
  29. package/dist/tools/specialized/progressed.js +2 -25
  30. package/dist/tools/specialized/transits.js +5 -5
  31. package/dist/ui/bazi.html +1523 -1522
  32. package/dist/ui/bi-wheel.html +406 -374
  33. package/dist/ui/bodygraph.html +83 -79
  34. package/dist/ui/chart-wheel.html +394 -361
  35. package/dist/ui/transit-timeline.html +3 -3
  36. package/dist/ui/vedic-chart.html +818 -818
  37. package/package.json +1 -1
@@ -7255,50 +7255,54 @@ function fv() {
7255
7255
  let e5 = Q == null ? void 0 : Q._birth_params;
7256
7256
  return typeof (e5 == null ? void 0 : e5.latitude) == "number" && typeof (e5 == null ? void 0 : e5.longitude) == "number";
7257
7257
  }
7258
- function pv(e5 = $, t2 = dv(e5)) {
7258
+ function pv() {
7259
+ let e5 = Q == null ? void 0 : Q._render_token;
7260
+ return e5 ? { render_token: e5 } : {};
7261
+ }
7262
+ function mv(e5 = $, t2 = dv(e5)) {
7259
7263
  return e5 === "mandala" ? { layout: e5, rings: t2 ? "".concat(uv, ",houses") : uv } : { layout: e5 };
7260
7264
  }
7261
- var mv = {};
7262
- function hv(e5, t2, n2) {
7265
+ var hv = {};
7266
+ function gv(e5, t2, n2) {
7263
7267
  return "".concat(e5, ":").concat(t2, ":").concat(n2);
7264
7268
  }
7265
- function gv() {
7266
- for (let e5 of Object.keys(mv)) delete mv[e5];
7267
- }
7268
7269
  function _v() {
7270
+ for (let e5 of Object.keys(hv)) delete hv[e5];
7271
+ }
7272
+ function vv() {
7269
7273
  return W_();
7270
7274
  }
7271
- G_((e5) => void vv(e5));
7272
- async function vv(e5) {
7275
+ G_((e5) => void yv(e5));
7276
+ async function yv(e5) {
7273
7277
  if (e5 === av || ov || !Q) return;
7274
- let t2 = mv[hv($, e5, dv($))];
7278
+ let t2 = hv[gv($, e5, dv($))];
7275
7279
  if (t2) {
7276
- av = e5, jv(t2);
7280
+ av = e5, Mv(t2);
7277
7281
  return;
7278
7282
  }
7279
7283
  ov = true;
7280
7284
  let n2 = Q._refetch;
7281
7285
  try {
7282
7286
  let t3;
7283
- if (n2) t3 = await Z.callServerTool({ name: n2.tool, arguments: { ...n2.args, theme: e5 } });
7287
+ if (n2) t3 = await Z.callServerTool({ name: n2.tool, arguments: { ...n2.args, theme: e5, ...pv() } });
7284
7288
  else {
7285
7289
  var r2, i2, a2, o2, s2;
7286
7290
  let n3 = (r2 = Q._birth_params) == null ? { datetime: "" } : r2;
7287
- t3 = await Z.callServerTool({ name: "bodygraph_recalculate", arguments: { datetime: n3.datetime, latitude: (i2 = n3.latitude) == null ? void 0 : i2, longitude: (a2 = n3.longitude) == null ? void 0 : a2, timezone: (o2 = n3.timezone) == null ? void 0 : o2, location: (s2 = n3.location) == null ? void 0 : s2, theme: e5, ...pv() } });
7291
+ t3 = await Z.callServerTool({ name: "bodygraph_recalculate", arguments: { datetime: n3.datetime, latitude: (i2 = n3.latitude) == null ? void 0 : i2, longitude: (a2 = n3.longitude) == null ? void 0 : a2, timezone: (o2 = n3.timezone) == null ? void 0 : o2, location: (s2 = n3.location) == null ? void 0 : s2, theme: e5, ...mv(), ...pv() } });
7288
7292
  }
7289
- let c2 = Lv(z_(t3));
7290
- c2 && (c2.type || c2.centers) ? (av = e5, mv[hv($, e5, dv($))] = c2, jv(c2)) : (console.error("[Bodygraph] Theme re-fetch returned no usable payload"), Cv("Couldn't switch theme \u2014 showing previous colors"));
7293
+ let c2 = Rv(z_(t3));
7294
+ c2 && (c2.type || c2.centers) ? (av = e5, hv[gv($, e5, dv($))] = c2, Mv(c2)) : (console.error("[Bodygraph] Theme re-fetch returned no usable payload"), wv("Couldn't switch theme \u2014 showing previous colors"));
7291
7295
  } catch (e6) {
7292
- console.error("[Bodygraph] Theme re-fetch failed:", e6), Cv("Couldn't switch theme \u2014 showing previous colors");
7296
+ console.error("[Bodygraph] Theme re-fetch failed:", e6), wv("Couldn't switch theme \u2014 showing previous colors");
7293
7297
  } finally {
7294
7298
  ov = false;
7295
7299
  }
7296
7300
  }
7297
- async function yv() {
7301
+ async function bv() {
7298
7302
  if (!Q || sv || ov) return;
7299
- let e5 = $ === "graph" ? "mandala" : "graph", t2 = mv[hv(e5, av, dv(e5))];
7303
+ let e5 = $ === "graph" ? "mandala" : "graph", t2 = hv[gv(e5, av, dv(e5))];
7300
7304
  if (t2) {
7301
- $ = e5, jv(t2);
7305
+ $ = e5, Mv(t2);
7302
7306
  return;
7303
7307
  }
7304
7308
  sv = true;
@@ -7306,47 +7310,47 @@ async function yv() {
7306
7310
  n2 && (n2.disabled = true);
7307
7311
  try {
7308
7312
  let t3 = Q._refetch, n3;
7309
- if (t3 != null && t3.tool) n3 = { name: t3.tool, arguments: { ...t3.args, theme: av, layout: e5 } };
7313
+ if (t3 != null && t3.tool) n3 = { name: t3.tool, arguments: { ...t3.args, theme: av, layout: e5, ...pv() } };
7310
7314
  else {
7311
7315
  var r2, i2, a2, o2, s2;
7312
7316
  let t4 = (r2 = Q._birth_params) == null ? { datetime: "" } : r2;
7313
- n3 = { name: "bodygraph_recalculate", arguments: { datetime: t4.datetime, latitude: (i2 = t4.latitude) == null ? void 0 : i2, longitude: (a2 = t4.longitude) == null ? void 0 : a2, timezone: (o2 = t4.timezone) == null ? void 0 : o2, location: (s2 = t4.location) == null ? void 0 : s2, theme: av, ...pv(e5) } };
7317
+ n3 = { name: "bodygraph_recalculate", arguments: { datetime: t4.datetime, latitude: (i2 = t4.latitude) == null ? void 0 : i2, longitude: (a2 = t4.longitude) == null ? void 0 : a2, timezone: (o2 = t4.timezone) == null ? void 0 : o2, location: (s2 = t4.location) == null ? void 0 : s2, theme: av, ...mv(e5), ...pv() } };
7314
7318
  }
7315
- let c2 = Lv(z_(await Z.callServerTool(n3)));
7316
- c2 && (c2.type || c2.centers) ? ($ = e5, mv[hv($, av, dv($))] = c2, jv(c2)) : (console.error("[Bodygraph] Layout toggle returned no usable payload"), Cv("Couldn't switch layout \u2014 try again or check credits"));
7319
+ let c2 = Rv(z_(await Z.callServerTool(n3)));
7320
+ c2 && (c2.type || c2.centers) ? ($ = e5, hv[gv($, av, dv($))] = c2, Mv(c2)) : (console.error("[Bodygraph] Layout toggle returned no usable payload"), wv("Couldn't switch layout \u2014 try again or check credits"));
7317
7321
  } catch (e6) {
7318
- console.error("[Bodygraph] Layout toggle failed:", e6), Cv("Couldn't switch layout \u2014 try again or check credits");
7322
+ console.error("[Bodygraph] Layout toggle failed:", e6), wv("Couldn't switch layout \u2014 try again or check credits");
7319
7323
  } finally {
7320
7324
  sv = false;
7321
7325
  let e6 = document.getElementById("hd-layout-btn");
7322
7326
  e6 && (e6.disabled = false);
7323
7327
  }
7324
7328
  }
7325
- function bv() {
7329
+ function xv() {
7326
7330
  cv && !fv() && (cv = false), rv == null || rv.syncExtraToggle({ checked: cv, available: $ === "mandala" && fv(), disabledTitle: $ === "mandala" ? "Add a birth location to draw houses" : "Switch to Mandala view to add house rings" });
7327
7331
  }
7328
- async function xv(e5) {
7332
+ async function Sv(e5) {
7329
7333
  if (!Q || $ !== "mandala" || lv) {
7330
- bv();
7334
+ xv();
7331
7335
  return;
7332
7336
  }
7333
- let t2 = mv[hv($, av, e5)];
7337
+ let t2 = hv[gv($, av, e5)];
7334
7338
  if (t2) {
7335
- cv = e5, jv(t2);
7339
+ cv = e5, Mv(t2);
7336
7340
  return;
7337
7341
  }
7338
7342
  lv = true, rv == null || rv.syncExtraToggle({ available: false });
7339
7343
  try {
7340
7344
  var n2, r2, i2, a2, o2;
7341
- let t3 = (n2 = Q._birth_params) == null ? { datetime: "" } : n2, s2 = Lv(z_(await Z.callServerTool({ name: "bodygraph_recalculate", arguments: { datetime: t3.datetime, latitude: (r2 = t3.latitude) == null ? void 0 : r2, longitude: (i2 = t3.longitude) == null ? void 0 : i2, timezone: (a2 = t3.timezone) == null ? void 0 : a2, location: (o2 = t3.location) == null ? void 0 : o2, theme: av, ...pv($, e5) } })));
7342
- s2 && (s2.type || s2.centers) ? (cv = e5, mv[hv($, av, e5)] = s2, jv(s2)) : (console.error("[Bodygraph] House ring toggle returned no usable payload"), Cv("Couldn't update house rings \u2014 try again or check credits"));
7345
+ let t3 = (n2 = Q._birth_params) == null ? { datetime: "" } : n2, s2 = Rv(z_(await Z.callServerTool({ name: "bodygraph_recalculate", arguments: { datetime: t3.datetime, latitude: (r2 = t3.latitude) == null ? void 0 : r2, longitude: (i2 = t3.longitude) == null ? void 0 : i2, timezone: (a2 = t3.timezone) == null ? void 0 : a2, location: (o2 = t3.location) == null ? void 0 : o2, theme: av, ...mv($, e5), ...pv() } })));
7346
+ s2 && (s2.type || s2.centers) ? (cv = e5, hv[gv($, av, e5)] = s2, Mv(s2)) : (console.error("[Bodygraph] House ring toggle returned no usable payload"), wv("Couldn't update house rings \u2014 try again or check credits"));
7343
7347
  } catch (e6) {
7344
- console.error("[Bodygraph] House ring toggle failed:", e6), Cv("Couldn't update house rings \u2014 try again or check credits");
7348
+ console.error("[Bodygraph] House ring toggle failed:", e6), wv("Couldn't update house rings \u2014 try again or check credits");
7345
7349
  } finally {
7346
- lv = false, bv();
7350
+ lv = false, xv();
7347
7351
  }
7348
7352
  }
7349
- async function Sv(e5) {
7353
+ async function Cv(e5) {
7350
7354
  e5 = A_(e5, Q == null ? void 0 : Q._birth_params, "Human Design chart");
7351
7355
  try {
7352
7356
  (await Z.sendMessage({ role: "user", content: [{ type: "text", text: e5 }] })).isError && console.error("[Bodygraph] Host rejected sendMessage");
@@ -7354,7 +7358,7 @@ async function Sv(e5) {
7354
7358
  console.error("[Bodygraph] sendMessage failed:", e6);
7355
7359
  }
7356
7360
  }
7357
- function Cv(e5) {
7361
+ function wv(e5) {
7358
7362
  if (tv) {
7359
7363
  if (!e5) {
7360
7364
  tv.classList.remove("visible");
@@ -7363,8 +7367,8 @@ function Cv(e5) {
7363
7367
  tv.textContent = "\xB7 ".concat(e5), tv.classList.add("visible");
7364
7368
  }
7365
7369
  }
7366
- r_(Cv);
7367
- async function wv(e5) {
7370
+ r_(wv);
7371
+ async function Tv(e5) {
7368
7372
  var t2, n2, r2, i2;
7369
7373
  if (!Q) return;
7370
7374
  let a2 = (t2 = Q.type) == null ? "Unknown" : t2, o2 = (n2 = Q.profile) == null ? "" : n2, s2 = (r2 = Q.authority) == null ? "" : r2, c2 = (i2 = Q.incarnation_cross) == null ? "" : i2, l2 = "";
@@ -7401,24 +7405,24 @@ async function wv(e5) {
7401
7405
  }
7402
7406
  return;
7403
7407
  }
7404
- l2 && await Sv(l2);
7408
+ l2 && await Cv(l2);
7405
7409
  }
7406
- async function Tv() {
7410
+ async function Ev() {
7407
7411
  var e5, t2, n2, r2, i2, a2, o2;
7408
7412
  if (!Q) return;
7409
7413
  let s2 = Q, c2 = (e5 = s2.type) == null ? "Unknown" : e5, l2 = (t2 = s2.profile) == null ? "" : t2, u2 = (n2 = s2.authority) == null ? "" : n2, d2 = (r2 = s2.incarnation_cross) == null ? "" : r2, f2 = (i2 = s2.definition) == null ? "" : i2, p2 = ((a2 = s2.centers) == null ? [] : a2).filter((e6) => e6.defined).map((e6) => e6.name).join(", ") || "none", m2 = ((o2 = s2.active_channels) == null ? [] : o2).join(", ") || "none";
7410
- await Sv("Please give me a complete Human Design reading for this chart.\n\nType: ".concat(c2, "\n") + (l2 ? "Profile: ".concat(l2, "\n") : "") + (u2 ? "Authority: ".concat(u2, "\n") : "") + (f2 ? "Definition: ".concat(f2, "\n") : "") + (d2 ? "Incarnation Cross: ".concat(d2, "\n") : "") + "Defined Centers: ".concat(p2, "\nDefined Channels: ").concat(m2, "\n\nCover: (1) Life theme and purpose of this Type, (2) Strategy and how it works practically, (3) Authority and how to make aligned decisions, (4) The defined channels as core personality traits, (5) Key shadows and conditioning to watch for, (6) A practical summary of how to live this design."));
7414
+ await Cv("Please give me a complete Human Design reading for this chart.\n\nType: ".concat(c2, "\n") + (l2 ? "Profile: ".concat(l2, "\n") : "") + (u2 ? "Authority: ".concat(u2, "\n") : "") + (f2 ? "Definition: ".concat(f2, "\n") : "") + (d2 ? "Incarnation Cross: ".concat(d2, "\n") : "") + "Defined Centers: ".concat(p2, "\nDefined Channels: ").concat(m2, "\n\nCover: (1) Life theme and purpose of this Type, (2) Strategy and how it works practically, (3) Authority and how to make aligned decisions, (4) The defined channels as core personality traits, (5) Key shadows and conditioning to watch for, (6) A practical summary of how to live this design."));
7411
7415
  }
7412
- async function Ev() {
7416
+ async function Dv() {
7413
7417
  var e5, t2, n2, r2, i2;
7414
7418
  if (!Q) return;
7415
7419
  let a2 = Q, o2 = (e5 = a2.type) == null ? "Unknown" : e5, s2 = (t2 = a2.profile) == null ? "" : t2, c2 = (n2 = a2.authority) == null ? "" : n2, l2 = [...(r2 = a2.personality_gates) == null ? [] : r2, ...(i2 = a2.design_gates) == null ? [] : i2].slice(0, 6).map((e6) => {
7416
7420
  var t3;
7417
7421
  return typeof e6 == "number" ? "Gate ".concat(e6) : "Gate ".concat((t3 = e6.gate) == null ? e6 : t3);
7418
7422
  }).join(", ") || "none";
7419
- await Sv("I'm exploring a Human Design Bodygraph for a ".concat(o2) + (s2 ? " with Profile ".concat(s2) : "") + (c2 ? " and ".concat(c2, " authority") : "") + ". Active gates include: ".concat(l2, ".\n\nBased on this design, please suggest 3-4 specific, insightful questions I could ask to understand this chart more deeply \u2014 such as how the type and authority work in daily life, what specific gates or channels mean, or how to live in alignment with this design. Present each as a tappable question I can ask you."));
7423
+ await Cv("I'm exploring a Human Design Bodygraph for a ".concat(o2) + (s2 ? " with Profile ".concat(s2) : "") + (c2 ? " and ".concat(c2, " authority") : "") + ". Active gates include: ".concat(l2, ".\n\nBased on this design, please suggest 3-4 specific, insightful questions I could ask to understand this chart more deeply \u2014 such as how the type and authority work in daily life, what specific gates or channels mean, or how to live in alignment with this design. Present each as a tappable question I can ask you."));
7420
7424
  }
7421
- async function Dv(e5) {
7425
+ async function Ov(e5) {
7422
7426
  iv && setTimeout(async () => {
7423
7427
  try {
7424
7428
  var t2, n2, r2;
@@ -7429,25 +7433,25 @@ async function Dv(e5) {
7429
7433
  }
7430
7434
  }, 0);
7431
7435
  }
7432
- async function Ov(e5, t2, n2) {
7433
- Cv("".concat(t2 ? "\u25C9" : "\u25CB", " ").concat(e5, " Center (").concat(t2 ? "defined" : "undefined", ")")), Dv({ type: "center", data: { center_name: e5, defined: t2, active_gates: n2 } });
7434
- }
7435
7436
  async function kv(e5, t2, n2) {
7436
- Cv("Gate ".concat(e5, " \xB7 ").concat(n2, " \xB7 ").concat(t2 === true ? "Conscious" : t2 === false ? "Unconscious" : "Both")), Dv({ type: "gate", data: { gate: e5, conscious: t2, center: n2 } });
7437
+ wv("".concat(t2 ? "\u25C9" : "\u25CB", " ").concat(e5, " Center (").concat(t2 ? "defined" : "undefined", ")")), Ov({ type: "center", data: { center_name: e5, defined: t2, active_gates: n2 } });
7438
+ }
7439
+ async function Av(e5, t2, n2) {
7440
+ wv("Gate ".concat(e5, " \xB7 ").concat(n2, " \xB7 ").concat(t2 === true ? "Conscious" : t2 === false ? "Unconscious" : "Both")), Ov({ type: "gate", data: { gate: e5, conscious: t2, center: n2 } });
7437
7441
  }
7438
- async function Av(e5, t2, n2, r2, i2, a2) {
7439
- Cv(r2 && i2 ? "Channel ".concat(e5, " \xB7 ").concat(r2, "\u2013").concat(i2) : "Channel ".concat(e5)), Dv({ type: "channel", data: { channel: e5, gate1: t2, gate2: n2, center1: r2, center2: i2, color_type: a2 } });
7442
+ async function jv(e5, t2, n2, r2, i2, a2) {
7443
+ wv(r2 && i2 ? "Channel ".concat(e5, " \xB7 ").concat(r2, "\u2013").concat(i2) : "Channel ".concat(e5)), Ov({ type: "channel", data: { channel: e5, gate1: t2, gate2: n2, center1: r2, center2: i2, color_type: a2 } });
7440
7444
  }
7441
- function jv(e5) {
7445
+ function Mv(e5) {
7442
7446
  var t2, n2, r2, i2, a2, o2, s2;
7443
- Q = e5, Z_.setAttribute("hidden", ""), Q_.removeAttribute("hidden"), document.body.classList.toggle("layout-mandala", $ === "mandala"), bv();
7447
+ Q = e5, Z_.setAttribute("hidden", ""), Q_.removeAttribute("hidden"), document.body.classList.toggle("layout-mandala", $ === "mandala"), xv();
7444
7448
  let c2 = e5._svg;
7445
7449
  if (!c2) {
7446
- Pv("Bodygraph render unavailable \u2014 the server did not return an SVG.", Fv);
7450
+ Fv("Bodygraph render unavailable \u2014 the server did not return an SVG.", Iv);
7447
7451
  return;
7448
7452
  }
7449
- let l2 = C_(Q_, c2, e5, { onCenterClick: Ov, onGateClick: kv, onChannelClick: Av, onAskClaude: wv });
7450
- l2 && new URLSearchParams(window.location.search).has("debugHighlight") && Iv(l2);
7453
+ let l2 = C_(Q_, c2, e5, { onCenterClick: kv, onGateClick: Av, onChannelClick: jv, onAskClaude: Tv });
7454
+ l2 && new URLSearchParams(window.location.search).has("debugHighlight") && Lv(l2);
7451
7455
  let u2 = document.getElementById("hd-action-bar");
7452
7456
  if (!u2) {
7453
7457
  u2 = document.createElement("div"), u2.id = "hd-action-bar", u2.className = "hd-action-bar";
@@ -7458,8 +7462,8 @@ function jv(e5) {
7458
7462
  (d2 = Q_.parentElement) == null || d2.insertBefore(u2, Q_);
7459
7463
  }
7460
7464
  }
7461
- let f2 = $ === "graph" ? "mandala" : "graph", p2 = !!mv[hv(f2, av, dv(f2))];
7462
- u2.innerHTML = '\n <button class="action-btn action-btn--primary" id="hd-interpret-btn">\u2728 Interpret this chart</button>\n <button class="action-btn" id="hd-questions-btn">\u{1F52E} What should I ask?</button>\n '.concat('<button class="action-btn" id="hd-layout-btn" title="'.concat(p2 ? "Already rendered this session \u2014 free to switch" : "Re-renders on the server (~2 credits)", '">').concat($ === "mandala" ? "\u2726 Graph view" : "\u2726 Mandala view").concat(p2 ? "" : " (~2 credits)", "</button>"), "\n "), (t2 = u2.querySelector("#hd-interpret-btn")) == null || t2.addEventListener("click", () => void Tv()), (n2 = u2.querySelector("#hd-questions-btn")) == null || n2.addEventListener("click", () => void Ev()), (r2 = u2.querySelector("#hd-layout-btn")) == null || r2.addEventListener("click", () => void yv());
7465
+ let f2 = $ === "graph" ? "mandala" : "graph", p2 = !!hv[gv(f2, av, dv(f2))];
7466
+ u2.innerHTML = '\n <button class="action-btn action-btn--primary" id="hd-interpret-btn">\u2728 Interpret this chart</button>\n <button class="action-btn" id="hd-questions-btn">\u{1F52E} What should I ask?</button>\n '.concat('<button class="action-btn" id="hd-layout-btn" title="'.concat(p2 ? "Already rendered this session \u2014 free to switch" : "Re-renders on the server (~2 credits)", '">').concat($ === "mandala" ? "\u2726 Graph view" : "\u2726 Mandala view").concat(p2 ? "" : " (~2 credits)", "</button>"), "\n "), (t2 = u2.querySelector("#hd-interpret-btn")) == null || t2.addEventListener("click", () => void Ev()), (n2 = u2.querySelector("#hd-questions-btn")) == null || n2.addEventListener("click", () => void Dv()), (r2 = u2.querySelector("#hd-layout-btn")) == null || r2.addEventListener("click", () => void bv());
7463
7467
  let m2 = ((i2 = (a2 = e5.personality_gates) == null ? void 0 : a2.length) == null ? 0 : i2) > 0 || ((o2 = (s2 = e5.design_gates) == null ? void 0 : s2.length) == null ? 0 : o2) > 0, h2 = document.querySelector(".channel-legend");
7464
7468
  if (m2 && !h2) {
7465
7469
  let e6 = document.createElement("div");
@@ -7477,27 +7481,27 @@ function jv(e5) {
7477
7481
  $_.removeAttribute("hidden"), $_.querySelectorAll(".interactive-text").forEach((e6) => {
7478
7482
  e6.addEventListener("click", () => {
7479
7483
  let t3 = e6.getAttribute("data-topic"), n3 = e6.getAttribute("data-val");
7480
- t3 && n3 && wv({ type: "attribute", data: { topic: t3, val: n3 } });
7484
+ t3 && n3 && Tv({ type: "attribute", data: { topic: t3, val: n3 } });
7481
7485
  }), e6.addEventListener("keydown", (t3) => {
7482
7486
  let n3 = t3;
7483
7487
  (n3.key === "Enter" || n3.key === " ") && (n3.preventDefault(), e6.dispatchEvent(new MouseEvent("click", { bubbles: true, cancelable: true })));
7484
7488
  });
7485
7489
  }), ev.setAttribute("hidden", ""), nv.removeAttribute("hidden"), R_("bodygraph");
7486
7490
  }
7487
- var Mv;
7488
- function Nv() {
7489
- Mv && (clearTimeout(Mv), Mv = void 0);
7491
+ var Nv;
7492
+ function Pv() {
7493
+ Nv && (clearTimeout(Nv), Nv = void 0);
7490
7494
  }
7491
- function Pv(e5, t2) {
7492
- Nv(), Z_.setAttribute("hidden", ""), V_({ container: Q_, message: e5, onRetry: t2 });
7495
+ function Fv(e5, t2) {
7496
+ Pv(), Z_.setAttribute("hidden", ""), V_({ container: Q_, message: e5, onRetry: t2 });
7493
7497
  }
7494
- function Fv() {
7495
- Nv(), Q_.setAttribute("hidden", ""), Z_.removeAttribute("hidden"), Mv = setTimeout(() => {
7496
- Pv("The bodygraph didn't load. Tap to try again.", Fv);
7498
+ function Iv() {
7499
+ Pv(), Q_.setAttribute("hidden", ""), Z_.removeAttribute("hidden"), Nv = setTimeout(() => {
7500
+ Fv("The bodygraph didn't load. Tap to try again.", Iv);
7497
7501
  }, 3e4), Z.sendMessage({ role: "user", content: [{ type: "text", text: "Please regenerate the Human Design bodygraph." }] }).catch(() => {
7498
7502
  });
7499
7503
  }
7500
- function Iv(e5) {
7504
+ function Lv(e5) {
7501
7505
  e5.addEventListener("click", (t2) => {
7502
7506
  let n2 = t2.target;
7503
7507
  for (; n2 && n2 !== e5; ) {
@@ -7513,27 +7517,27 @@ function Iv(e5) {
7513
7517
  w_(e5, {});
7514
7518
  });
7515
7519
  }
7516
- function Lv(e5) {
7520
+ function Rv(e5) {
7517
7521
  var t2;
7518
7522
  if (!e5) return null;
7519
7523
  if (e5.type || e5.centers) return e5;
7520
7524
  let n2 = e5, r2 = (t2 = n2.natal) == null ? n2.composite_chart : t2;
7521
7525
  if (r2 && (r2.type || r2.centers)) {
7522
7526
  var i2, a2, o2, s2;
7523
- let e6 = (i2 = n2.metadata) == null ? void 0 : i2.subject_1_summary, t3 = (a2 = n2.metadata) == null ? void 0 : a2.subject_2_summary, c2 = { ...r2, _svg: (o2 = n2._svg) == null ? r2._svg : o2, _birth_params: (s2 = n2._birth_params) == null ? r2._birth_params : s2, _refetch: n2._refetch, _theme: n2._theme, _connectionSubjects: e6 && t3 ? { a: e6, b: t3 } : void 0 };
7527
+ let e6 = (i2 = n2.metadata) == null ? void 0 : i2.subject_1_summary, t3 = (a2 = n2.metadata) == null ? void 0 : a2.subject_2_summary, c2 = { ...r2, _svg: (o2 = n2._svg) == null ? r2._svg : o2, _birth_params: (s2 = n2._birth_params) == null ? r2._birth_params : s2, _refetch: n2._refetch, _theme: n2._theme, _render_token: n2._render_token, _connectionSubjects: e6 && t3 ? { a: e6, b: t3 } : void 0 };
7524
7528
  return !c2.centers && Array.isArray(r2.defined_centers) ? c2.centers = r2.defined_centers.map((e7) => ({ name: e7, defined: true })) : c2.centers && !Array.isArray(c2.centers) && (c2.centers = Object.entries(c2.centers).map(([e7, t4]) => ({ name: e7, defined: !!t4 }))), c2;
7525
7529
  }
7526
7530
  return null;
7527
7531
  }
7528
7532
  Z.ontoolresult = (e5) => {
7529
- Nv();
7533
+ Pv();
7530
7534
  try {
7531
- let a2 = Lv(z_(e5)), o2 = a2 == null ? void 0 : a2._theme;
7535
+ let a2 = Rv(z_(e5)), o2 = a2 == null ? void 0 : a2._theme;
7532
7536
  if ((o2 === "light" || o2 === "dark") && (av = o2), !a2) {
7533
- Pv("Bodygraph data could not be parsed from the server response.", Fv);
7537
+ Fv("Bodygraph data could not be parsed from the server response.", Iv);
7534
7538
  return;
7535
7539
  }
7536
- if ($ = "graph", cv = false, gv(), mv[hv($, av, false)] = a2, !rv && a2._birth_params) {
7540
+ if ($ = "graph", cv = false, _v(), hv[gv($, av, false)] = a2, !rv && a2._birth_params) {
7537
7541
  var t2, n2, r2, i2;
7538
7542
  let e6 = (t2 = a2._birth_params) == null ? {} : t2, o3 = (n2 = e6.datetime) == null ? "" : n2, s2 = (r2 = e6.location) == null ? "" : r2, c2 = (i2 = e6.timezone) == null ? "" : i2, l2 = e6.latitude, u2 = e6.longitude, d2 = "", f2 = "12:00";
7539
7543
  if (o3) try {
@@ -7545,12 +7549,12 @@ Z.ontoolresult = (e5) => {
7545
7549
  } catch (e7) {
7546
7550
  o3.includes("T") && (d2 = o3.split("T")[0], f2 = o3.split("T")[1].substring(0, 5));
7547
7551
  }
7548
- rv = new E_({ app: Z, container: nv, initialParams: { date: d2, time: f2, locationName: s2, timezone: c2, latitude: typeof l2 == "number" ? l2 : null, longitude: typeof u2 == "number" ? u2 : null }, showStepControls: false, costHint: "~2 credits", extraToggle: { label: "Add house rings (+1 credit)", initialChecked: false, initialDisabled: true, disabledTitle: "Switch to Mandala view to add house rings", onChange: (e7) => void xv(e7) }, onRefresh: async (e7) => {
7552
+ rv = new E_({ app: Z, container: nv, initialParams: { date: d2, time: f2, locationName: s2, timezone: c2, latitude: typeof l2 == "number" ? l2 : null, longitude: typeof u2 == "number" ? u2 : null }, showStepControls: false, costHint: "~2 credits", extraToggle: { label: "Add house rings (+1 credit)", initialChecked: false, initialDisabled: true, disabledTitle: "Switch to Mandala view to add house rings", onChange: (e7) => void Sv(e7) }, onRefresh: async (e7) => {
7549
7553
  rv == null || rv.setBusy(true), Z_.removeAttribute("hidden"), Q_.setAttribute("hidden", "");
7550
7554
  try {
7551
7555
  var t3, n3, r3, i3;
7552
- let a3 = "".concat(e7.date, "T").concat(e7.time, ":00"), o4 = e7.timezone ? a3 : "".concat(a3, "Z"), s3 = new Promise((e8, t4) => setTimeout(() => t4(Error("Bodygraph recalculate timed out after 30s")), 3e4)), c3 = z_(await Promise.race([Z.callServerTool({ name: "bodygraph_recalculate", arguments: { datetime: o4, latitude: (t3 = e7.latitude) == null ? void 0 : t3, longitude: (n3 = e7.longitude) == null ? void 0 : n3, timezone: (r3 = e7.timezone) == null ? void 0 : r3, location: (i3 = e7.locationName) == null ? void 0 : i3, theme: av, ...pv() } }), s3])), l3 = c3 && (c3.type || c3.centers) ? c3 : null;
7553
- l3 ? (gv(), mv[hv($, av, dv($))] = l3, jv(l3)) : Q && (Z_.setAttribute("hidden", ""), Q_.removeAttribute("hidden"));
7556
+ let a3 = "".concat(e7.date, "T").concat(e7.time, ":00"), o4 = e7.timezone ? a3 : "".concat(a3, "Z"), s3 = new Promise((e8, t4) => setTimeout(() => t4(Error("Bodygraph recalculate timed out after 30s")), 3e4)), c3 = z_(await Promise.race([Z.callServerTool({ name: "bodygraph_recalculate", arguments: { datetime: o4, latitude: (t3 = e7.latitude) == null ? void 0 : t3, longitude: (n3 = e7.longitude) == null ? void 0 : n3, timezone: (r3 = e7.timezone) == null ? void 0 : r3, location: (i3 = e7.locationName) == null ? void 0 : i3, theme: av, ...mv() } }), s3])), l3 = c3 && (c3.type || c3.centers) ? c3 : null;
7557
+ l3 ? (_v(), hv[gv($, av, dv($))] = l3, Mv(l3)) : Q && (Z_.setAttribute("hidden", ""), Q_.removeAttribute("hidden"));
7554
7558
  } catch (e8) {
7555
7559
  console.error("[Bodygraph] Recalculate failed or timed out:", e8), Q && (Z_.setAttribute("hidden", ""), Q_.removeAttribute("hidden"));
7556
7560
  } finally {
@@ -7558,17 +7562,17 @@ Z.ontoolresult = (e5) => {
7558
7562
  }
7559
7563
  } });
7560
7564
  }
7561
- jv(a2), vv(_v());
7565
+ Mv(a2), yv(vv());
7562
7566
  } catch (e6) {
7563
- Pv("An error occurred while rendering the bodygraph.", Fv), console.error("[Bodygraph] Render error:", e6);
7567
+ Fv("An error occurred while rendering the bodygraph.", Iv), console.error("[Bodygraph] Render error:", e6);
7564
7568
  }
7565
- }, J_(Z, { loadingEl: Z_, contentEl: Q_, statusFn: Cv, paramControls: () => rv }), Mv = setTimeout(() => {
7566
- Pv("Bodygraph data is taking longer than expected.", Fv);
7569
+ }, J_(Z, { loadingEl: Z_, contentEl: Q_, statusFn: wv, paramControls: () => rv }), Nv = setTimeout(() => {
7570
+ Fv("Bodygraph data is taking longer than expected.", Iv);
7567
7571
  }, 3e4), (async () => {
7568
7572
  try {
7569
7573
  await Z.connect();
7570
7574
  let e5 = Z.getHostCapabilities();
7571
- iv = !!(e5 != null && e5.modelContext), e5 == null || e5.sampling, q_(Z, document.getElementById("pan-zoom-controls"), ["param-controls-container", "controls-panel", "info-panel", "hd-action-bar"]), X_(Z), K_(Z, (e6) => void vv(e6));
7575
+ iv = !!(e5 != null && e5.modelContext), e5 == null || e5.sampling, q_(Z, document.getElementById("pan-zoom-controls"), ["param-controls-container", "controls-panel", "info-panel", "hd-action-bar"]), X_(Z), K_(Z, (e6) => void yv(e6));
7572
7576
  } catch (e5) {
7573
7577
  console.error("[Bodygraph] connect() failed:", e5);
7574
7578
  }