airloom 0.1.0 → 0.1.3

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.js CHANGED
@@ -1211,6 +1211,7 @@ Environment variables:
1211
1211
  OPENAI_API_KEY API key for the OpenAI adapter.
1212
1212
  ABLY_API_KEY Your own Ably key (overrides default community relay).
1213
1213
  RELAY_URL Self-hosted WebSocket relay URL (disables Ably).
1214
+ VIEWER_URL Public viewer URL (default: GitHub Pages).
1214
1215
  HOST_PORT Same as --port (CLI flag takes precedence).
1215
1216
  `.trimStart());
1216
1217
  }
@@ -1220,6 +1221,8 @@ if (cliArgs.help) {
1220
1221
  process.exit(0);
1221
1222
  }
1222
1223
  var DEFAULT_ABLY_KEY = "SfHSAQ.IRTOQQ:FBbi9a7ZV6jIu0Gdo_UeYhIN4rzpMrud5-LldURNh9s";
1224
+ var DEFAULT_VIEWER_URL = "https://bobstrogg.github.io/Airloom/";
1225
+ var VIEWER_URL = process.env.VIEWER_URL ?? DEFAULT_VIEWER_URL;
1223
1226
  var RELAY_URL = process.env.RELAY_URL;
1224
1227
  var ABLY_API_KEY = process.env.ABLY_API_KEY ?? (RELAY_URL ? void 0 : DEFAULT_ABLY_KEY);
1225
1228
  var ABLY_TOKEN_TTL = parseInt(process.env.ABLY_TOKEN_TTL ?? String(24 * 60 * 60 * 1e3), 10);
@@ -1360,24 +1363,22 @@ async function main() {
1360
1363
  console.log("[host] Viewer dist not found \u2014 QR will open raw JSON fallback");
1361
1364
  }
1362
1365
  const { server, broadcast, port } = await createHostServer({ port: HOST_PORT, state, viewerDir });
1366
+ const pairingBase64 = Buffer.from(pairingJSON).toString("base64url");
1367
+ const viewerBase = VIEWER_URL.replace(/\/+$/, "");
1368
+ const qrContent = `${viewerBase}/#${pairingBase64}`;
1363
1369
  const lanIP = getLanIP();
1364
- const host = lanIP ?? "localhost";
1365
- const baseUrl = `http://${host}:${port}`;
1366
- let qrContent;
1367
- if (viewerDir) {
1368
- const pairingBase64 = Buffer.from(pairingJSON).toString("base64url");
1369
- qrContent = `${baseUrl}/viewer/#${pairingBase64}`;
1370
- } else {
1371
- qrContent = pairingJSON;
1372
- }
1370
+ const lanHost = lanIP ?? "localhost";
1371
+ const lanBaseUrl = `http://${lanHost}:${port}`;
1372
+ const lanViewerUrl = viewerDir ? `${lanBaseUrl}/viewer/#${pairingBase64}` : null;
1373
1373
  const qrDataUrl = await QRCode.toDataURL(qrContent, { width: 300, margin: 2 });
1374
1374
  const qrTerminal = await QRCode.toString(qrContent, { type: "terminal", small: true });
1375
1375
  state.pairingQR = qrDataUrl;
1376
1376
  console.log("\nPairing QR Code:");
1377
1377
  console.log(qrTerminal);
1378
1378
  console.log(`Pairing Code: ${displayCode}`);
1379
- if (viewerDir && lanIP) {
1380
- console.log(`Viewer URL: ${qrContent}`);
1379
+ console.log(`Viewer URL: ${qrContent}`);
1380
+ if (lanViewerUrl) {
1381
+ console.log(`LAN Viewer: ${lanViewerUrl}`);
1381
1382
  }
1382
1383
  if (!useAbly) console.log(`Relay: ${RELAY_URL}`);
1383
1384
  const localUrl = `http://localhost:${port}`;
@@ -0,0 +1 @@
1
+ import{g as c}from"./index-BoCit9Kx.js";function f(t,i){for(var o=0;o<i.length;o++){const e=i[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(e,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var n,a;function b(){return a||(a=1,n=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}),n}var u=b();const w=c(u),p=f({__proto__:null,default:w},[u]);export{p as b};