fluxy-bot 0.3.18 → 0.3.19

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.
@@ -1 +1 @@
1
- import{b as o,j as e,R as n,O as r}from"./globals-CYritkLr.js";function a(){const t=()=>{window.parent?.postMessage({type:"fluxy:onboard-complete"},"*")};return e.jsx(r,{onComplete:t,isInitialSetup:!0})}o.createRoot(document.getElementById("root")).render(e.jsx(n.StrictMode,{children:e.jsx(a,{})}));
1
+ import{b as o,j as e,R as n,O as r}from"./globals-A5sTL-kb.js";function a(){const t=()=>{window.parent?.postMessage({type:"fluxy:onboard-complete"},"*")};return e.jsx(r,{onComplete:t,isInitialSetup:!0})}o.createRoot(document.getElementById("root")).render(e.jsx(n.StrictMode,{children:e.jsx(a,{})}));
@@ -4,8 +4,8 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0, interactive-widget=resizes-content" />
6
6
  <title>Fluxy Chat</title>
7
- <script type="module" crossorigin src="/fluxy/assets/fluxy-DDgCW8m4.js"></script>
8
- <link rel="modulepreload" crossorigin href="/fluxy/assets/globals-CYritkLr.js">
7
+ <script type="module" crossorigin src="/fluxy/assets/fluxy-DmbQycIj.js"></script>
8
+ <link rel="modulepreload" crossorigin href="/fluxy/assets/globals-A5sTL-kb.js">
9
9
  <link rel="stylesheet" crossorigin href="/fluxy/assets/globals-BdY9BJIP.css">
10
10
  </head>
11
11
  <body class="bg-background text-foreground">
@@ -4,8 +4,8 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0, interactive-widget=resizes-content" />
6
6
  <title>Fluxy Setup</title>
7
- <script type="module" crossorigin src="/fluxy/assets/onboard-BnNwYTId.js"></script>
8
- <link rel="modulepreload" crossorigin href="/fluxy/assets/globals-CYritkLr.js">
7
+ <script type="module" crossorigin src="/fluxy/assets/onboard-DnbGE0aK.js"></script>
8
+ <link rel="modulepreload" crossorigin href="/fluxy/assets/globals-A5sTL-kb.js">
9
9
  <link rel="stylesheet" crossorigin href="/fluxy/assets/globals-BdY9BJIP.css">
10
10
  </head>
11
11
  <body class="bg-background text-foreground">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxy-bot",
3
- "version": "0.3.18",
3
+ "version": "0.3.19",
4
4
  "description": "Self-hosted AI bot — run your own AI assistant from anywhere",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -472,13 +472,31 @@ export default function OnboardWizard({ onComplete, isInitialSetup = false }: Pr
472
472
  portalUser: portalUser.trim(),
473
473
  portalPass,
474
474
  };
475
- console.log('[OnboardWizard] handleComplete called, payload:', JSON.stringify(payload, null, 2));
475
+ console.log('[OnboardWizard] handleComplete called');
476
+ console.log('[OnboardWizard] inIframe:', window.parent !== window, 'origin:', window.location.origin, 'href:', window.location.href);
476
477
  try {
477
- const res = await fetch('/api/onboard', {
478
- method: 'POST',
479
- headers: { 'Content-Type': 'application/json' },
480
- body: JSON.stringify(payload),
481
- });
478
+ // Try XHR as fallback if in iframe (fetch POST can fail through tunnels)
479
+ const inIframe = window.parent !== window;
480
+ let res: Response;
481
+ if (inIframe) {
482
+ console.log('[OnboardWizard] Using XHR for POST (iframe context)');
483
+ res = await new Promise<Response>((resolve, reject) => {
484
+ const xhr = new XMLHttpRequest();
485
+ xhr.open('POST', '/api/onboard');
486
+ xhr.setRequestHeader('Content-Type', 'application/json');
487
+ xhr.onload = () => resolve(new Response(xhr.responseText, { status: xhr.status, statusText: xhr.statusText }));
488
+ xhr.onerror = () => reject(new Error('XHR network error'));
489
+ xhr.ontimeout = () => reject(new Error('XHR timeout'));
490
+ xhr.timeout = 15000;
491
+ xhr.send(JSON.stringify(payload));
492
+ });
493
+ } else {
494
+ res = await fetch('/api/onboard', {
495
+ method: 'POST',
496
+ headers: { 'Content-Type': 'application/json' },
497
+ body: JSON.stringify(payload),
498
+ });
499
+ }
482
500
  console.log('[OnboardWizard] POST /api/onboard response:', res.status, res.statusText);
483
501
  const data = await res.json().catch(() => null);
484
502
  console.log('[OnboardWizard] response body:', data);