ai-ebm-assistant-v4 0.2.20 → 0.2.21

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/dist/index.es.js CHANGED
@@ -132884,35 +132884,55 @@ function AiChatProvider({ children: en }) {
132884
132884
  function useAiChat() {
132885
132885
  return React.useContext(AiChatContext);
132886
132886
  }
132887
+ var define_process_env_default = {};
132887
132888
  const createFetchWithOptionalSSL = (en) => async (Ye, tn = {}) => {
132888
- if (typeof window < "u")
132889
- return fetch(Ye, tn);
132890
- if (typeof require < "u" && en?.SSL_DISABLE === !0)
132889
+ const nn = define_process_env_default.NODE_TLS_REJECT_UNAUTHORIZED === "0" || define_process_env_default.REACT_APP_SSL_DISABLE === "true", an = en?.SSL_DISABLE === !0 || nn, rn = typeof window < "u" && window.process && window.process.type, on = typeof require < "u", sn = rn || typeof window > "u" && on;
132890
+ if (console.log("🔒 SSL Configuration Check:", {
132891
+ SSL_DISABLE: en?.SSL_DISABLE,
132892
+ envSSLDisable: nn,
132893
+ NODE_TLS_REJECT_UNAUTHORIZED: define_process_env_default.NODE_TLS_REJECT_UNAUTHORIZED,
132894
+ REACT_APP_SSL_DISABLE: define_process_env_default.REACT_APP_SSL_DISABLE,
132895
+ finalSSLDisabled: an,
132896
+ isElectron: rn,
132897
+ isNodeJS: on,
132898
+ canUseNodeSSL: sn,
132899
+ environment: rn ? "electron" : typeof window < "u" ? "browser" : "nodejs",
132900
+ url: Ye,
132901
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
132902
+ }), sn && an) {
132903
+ console.log(
132904
+ "🚫 SSL verification DISABLED - using axios with rejectUnauthorized: false (Electron/Node.js)"
132905
+ );
132891
132906
  try {
132892
- const nn = require("axios"), an = require("https"), rn = new an.Agent({
132907
+ const An = require("axios"), un = require("https"), dn = new un.Agent({
132893
132908
  rejectUnauthorized: !1
132894
132909
  // Disable SSL certificate validation
132895
- }), on = {
132910
+ }), pn = {
132896
132911
  method: tn.method || "GET",
132897
132912
  url: Ye,
132898
132913
  headers: tn.headers || {},
132899
132914
  data: tn.body,
132900
- httpsAgent: rn,
132901
- // Add this line to disable SSL
132915
+ httpsAgent: dn,
132902
132916
  maxBodyLength: 1 / 0
132903
- }, sn = await nn.request(on);
132904
- return {
132905
- ok: sn.status >= 200 && sn.status < 300,
132906
- status: sn.status,
132907
- statusText: sn.statusText,
132908
- headers: sn.headers,
132909
- json: async () => sn.data,
132910
- text: async () => JSON.stringify(sn.data)
132917
+ }, mn = await An.request(pn);
132918
+ return console.log("✅ SSL-disabled request successful:", mn.status), {
132919
+ ok: mn.status >= 200 && mn.status < 300,
132920
+ status: mn.status,
132921
+ statusText: mn.statusText,
132922
+ headers: mn.headers,
132923
+ json: async () => mn.data,
132924
+ text: async () => JSON.stringify(mn.data)
132911
132925
  };
132912
- } catch (nn) {
132913
- return console.warn("Axios request failed, falling back to fetch:", nn), fetch(Ye, tn);
132926
+ } catch (An) {
132927
+ return console.warn(
132928
+ "⚠️ Axios request failed, falling back to fetch:",
132929
+ An.message
132930
+ ), fetch(Ye, tn);
132914
132931
  }
132915
- return fetch(Ye, tn);
132932
+ }
132933
+ return console.log(
132934
+ `🌐 Using regular fetch (${rn ? "Electron" : "browser"} environment${an ? " - SSL disable not needed" : ""})`
132935
+ ), fetch(Ye, tn);
132916
132936
  };
132917
132937
  function OutputSTepper({
132918
132938
  getInputData: en,
@@ -132933,7 +132953,12 @@ function OutputSTepper({
132933
132953
  const hn = useTheme$1(), fn = Ye, { setChatBody: yn } = useAiChat(), bn = !1, [wn, Cn] = React.useState(0), [vn, En] = React.useState(0), [kn, Bn] = React.useState([]), [_n, xn] = React.useState({}), [Dn, Sn] = React.useState({}), [Tn, Ln] = React.useState([
132934
132954
  "Diagnosis Findings",
132935
132955
  "Individual Guideline"
132936
- ]), [Qn, Rn] = React.useState(), [Fn, $n] = React.useState(), In = React.useMemo(() => createFetchWithOptionalSSL(fn), [fn]), Nn = [
132956
+ ]), [Qn, Rn] = React.useState(), [Fn, $n] = React.useState(), In = React.useMemo(() => (console.log("🔧 Creating fetch function with SSL config:", {
132957
+ SSL_DISABLE: fn?.SSL_DISABLE,
132958
+ userDataKeys: Object.keys(fn || {}),
132959
+ component: "OutputStepper",
132960
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
132961
+ }), createFetchWithOptionalSSL(fn)), [fn]), Nn = [
132937
132962
  "Analyzing patient records to identify possible diagnoses...",
132938
132963
  "Checking clinical data against medical guidelines...",
132939
132964
  "Reviewing symptoms, vitals, and history for primary conditions...",