aether-mrralex-demo 1.0.0 → 1.0.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.
- package/NOTICE.md +1 -1
- package/README.md +1 -1
- package/app.html +12 -11
- package/baremux/index.js +1 -1
- package/baremux/index.mjs +1 -1
- package/baremux/worker.js +1 -1
- package/games/index.html +11 -10
- package/games/list.json +1 -1
- package/games/play.html +9 -9
- package/index.html +20 -19
- package/js/assistant.js +3 -3
- package/js/boot-screen.js +2 -2
- package/js/browser.js +25 -40
- package/js/landing.js +2 -2
- package/js/shortcuts.js +5 -5
- package/js/space.js +1 -1
- package/js/static-engine.js +2 -2
- package/js/tab-identity.js +9 -0
- package/js/theme.js +2 -2
- package/js/transport-core.js +1 -1
- package/package.json +1 -1
- package/scramjet/scramjet.all.js +3 -3
- package/shared.js +9 -9
- package/source/public/app.html +3 -2
- package/source/public/games/index.html +3 -2
- package/source/public/games/play.html +3 -3
- package/source/public/index.html +1 -0
- package/source/public/js/browser.js +1 -16
- package/source/public/js/tab-identity.js +9 -0
- package/source/scripts/build-unpkg.mjs +1 -1
- package/sw.js +4 -4
package/NOTICE.md
CHANGED
|
@@ -6,6 +6,6 @@ Bundled components retain their respective licenses:
|
|
|
6
6
|
- BareMux 2.1.9, MIT: https://github.com/MercuryWorkshop/bare-mux
|
|
7
7
|
- libcurl.js 0.7.5, LGPL-3.0-or-later: https://github.com/ading2210/libcurl.js (source and build instructions). The libcurl module is unmodified and dynamically imported.
|
|
8
8
|
|
|
9
|
-
License texts are in licenses/. Scramjet and BareMux JS bundles have only their storage/channel names changed to isolate this package on a shared origin. Editable frontend source, the modification/build script, and the dependency lockfile are included in source/. To reproduce: cd source, npm ci, then npm run build:unpkg -- aether-mrralex-demo 1.0.
|
|
9
|
+
License texts are in licenses/. Scramjet and BareMux JS bundles have only their storage/channel names changed to isolate this package on a shared origin. Editable frontend source, the modification/build script, and the dependency lockfile are included in source/. To reproduce: cd source, npm ci, then npm run build:unpkg -- aether-mrralex-demo 1.0.1. Upstream component source is available from the linked repositories and the exact versions in source/package-lock.json.
|
|
10
10
|
|
|
11
11
|
Game catalogue metadata comes from https://github.com/gn-math/assets; game files remain upstream and are not bundled.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Aether demo
|
|
2
2
|
|
|
3
|
-
Open https://unpkg.com/aether-mrralex-demo@1.0.
|
|
3
|
+
Open https://unpkg.com/aether-mrralex-demo@1.0.1/index.html
|
|
4
4
|
|
|
5
5
|
Static frontend with bundled browser runtimes. Uses wisp.mercurywork.shop first, then anura.pro; stops if both are unavailable. Community relays have no uptime guarantee. Game files are fetched on demand through Wisp. The optional assistant is unavailable without a separate API.
|
|
6
6
|
|
package/app.html
CHANGED
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
6
6
|
<meta name="color-scheme" content="dark light">
|
|
7
|
-
<title>
|
|
8
|
-
<link rel="icon" href="/aether-mrralex-demo@1.0.
|
|
9
|
-
<
|
|
7
|
+
<title>Aether</title>
|
|
8
|
+
<link rel="icon" href="/aether-mrralex-demo@1.0.1/favicon.svg" type="image/svg+xml">
|
|
9
|
+
<script src="/aether-mrralex-demo@1.0.1/js/tab-identity.js"></script>
|
|
10
|
+
<link rel="stylesheet" href="/aether-mrralex-demo@1.0.1/css/app.css">
|
|
10
11
|
<script>
|
|
11
12
|
(function () {
|
|
12
13
|
try {
|
|
13
|
-
var theme = localStorage.getItem("aether-mrralex-demo@1.0.
|
|
14
|
+
var theme = localStorage.getItem("aether-mrralex-demo@1.0.1:theme");
|
|
14
15
|
if (theme === "light" || theme === "dark") document.documentElement.dataset.theme = theme;
|
|
15
16
|
} catch (error) {}
|
|
16
17
|
})();
|
|
@@ -304,12 +305,12 @@
|
|
|
304
305
|
<div class="toast" id="toast" role="status" aria-live="polite"></div>
|
|
305
306
|
</div>
|
|
306
307
|
|
|
307
|
-
<script src="/aether-mrralex-demo@1.0.
|
|
308
|
-
<script src="/aether-mrralex-demo@1.0.
|
|
309
|
-
<script src="/aether-mrralex-demo@1.0.
|
|
310
|
-
<script src="/aether-mrralex-demo@1.0.
|
|
311
|
-
<script src="/aether-mrralex-demo@1.0.
|
|
312
|
-
<script src="/aether-mrralex-demo@1.0.
|
|
313
|
-
<script type="module" src="/aether-mrralex-demo@1.0.
|
|
308
|
+
<script src="/aether-mrralex-demo@1.0.1/shared.js"></script>
|
|
309
|
+
<script src="/aether-mrralex-demo@1.0.1/scramjet/scramjet.all.js"></script>
|
|
310
|
+
<script src="/aether-mrralex-demo@1.0.1/js/config.js"></script>
|
|
311
|
+
<script src="/aether-mrralex-demo@1.0.1/js/theme.js"></script>
|
|
312
|
+
<script src="/aether-mrralex-demo@1.0.1/js/url.js"></script>
|
|
313
|
+
<script src="/aether-mrralex-demo@1.0.1/js/shortcuts.js"></script>
|
|
314
|
+
<script type="module" src="/aether-mrralex-demo@1.0.1/js/browser.js"></script>
|
|
314
315
|
</body>
|
|
315
316
|
</html>
|
package/baremux/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).BareMux={})}(this,(function(e){"use strict";const t=globalThis.fetch,r=globalThis.SharedWorker,a=globalThis.localStorage,s=globalThis.navigator.serviceWorker,o=MessagePort.prototype.postMessage,n={prototype:{send:WebSocket.prototype.send},CLOSED:WebSocket.CLOSED,CLOSING:WebSocket.CLOSING,CONNECTING:WebSocket.CONNECTING,OPEN:WebSocket.OPEN};async function c(){const e=(await self.clients.matchAll({type:"window",includeUncontrolled:!0})).map((async e=>{const t=await function(e){let t=new MessageChannel;return new Promise((r=>{e.postMessage({type:"getPort:aether-mrralex-demo@1.0.
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).BareMux={})}(this,(function(e){"use strict";const t=globalThis.fetch,r=globalThis.SharedWorker,a=globalThis.localStorage,s=globalThis.navigator.serviceWorker,o=MessagePort.prototype.postMessage,n={prototype:{send:WebSocket.prototype.send},CLOSED:WebSocket.CLOSED,CLOSING:WebSocket.CLOSING,CONNECTING:WebSocket.CONNECTING,OPEN:WebSocket.OPEN};async function c(){const e=(await self.clients.matchAll({type:"window",includeUncontrolled:!0})).map((async e=>{const t=await function(e){let t=new MessageChannel;return new Promise((r=>{e.postMessage({type:"getPort:aether-mrralex-demo@1.0.1",port:t.port2},[t.port2]),t.port1.onmessage=e=>{r(e.data)}}))}(e);return await i(t),t})),t=Promise.race([Promise.any(e),new Promise(((e,t)=>setTimeout(t,1e3,new TypeError("timeout"))))]);try{return await t}catch(e){if(e instanceof AggregateError)throw console.error("bare-mux: failed to get a bare-mux SharedWorker MessagePort as all clients returned an invalid MessagePort."),new Error("All clients returned an invalid MessagePort.",{cause:e});return console.warn("bare-mux: failed to get a bare-mux SharedWorker MessagePort within 1s, retrying"),await c()}}function i(e){const t=new MessageChannel,r=new Promise(((e,r)=>{t.port1.onmessage=t=>{"pong"===t.data.type&&e()},setTimeout(r,1500)}));return o.call(e,{message:{type:"ping"},port:t.port2},[t.port2]),r}function l(e,t){const a=new r(e,"bare-mux-worker:aether-mrralex-demo@1.0.1");return t&&s.addEventListener("message",(t=>{if("getPort:aether-mrralex-demo@1.0.1"===t.data.type&&t.data.port){console.debug("bare-mux: recieved request for port from sw");const a=new r(e,"bare-mux-worker:aether-mrralex-demo@1.0.1");o.call(t.data.port,a.port,[a.port])}})),a.port}let h=null;function d(){if(null===h){const e=new MessageChannel,t=new ReadableStream;let r;try{o.call(e.port1,t,[t]),r=!0}catch(e){r=!1}return h=r,r}return h}class p{channel;port;workerPath;constructor(e){this.channel=new BroadcastChannel("bare-mux:aether-mrralex-demo@1.0.1"),e instanceof MessagePort||e instanceof Promise?this.port=e:this.createChannel(e,!0)}createChannel(e,t){if(self.clients)this.port=c(),this.channel.onmessage=e=>{"refreshPort"===e.data.type&&(this.port=c())};else if(e&&SharedWorker){if(!e.startsWith("/")&&!e.includes(":"))throw new Error("Invalid URL. Must be absolute or start at the root.");this.port=l(e,t),console.debug("bare-mux: setting localStorage bare-mux-path to",e),a["bare-mux-path:aether-mrralex-demo@1.0.1"]=e}else{if(!SharedWorker)throw new Error("Unable to get a channel to the SharedWorker.");{const e=a["bare-mux-path:aether-mrralex-demo@1.0.1"];if(console.debug("bare-mux: got localStorage bare-mux-path:",e),!e)throw new Error("Unable to get bare-mux workerPath from localStorage.");this.port=l(e,t)}}}async sendMessage(e,t){this.port instanceof Promise&&(this.port=await this.port);try{await i(this.port)}catch{return console.warn("bare-mux: Failed to get a ping response from the worker within 1.5s. Assuming port is dead."),this.createChannel(),await this.sendMessage(e,t)}const r=new MessageChannel,a=[r.port2,...t||[]],s=new Promise(((e,t)=>{r.port1.onmessage=r=>{const a=r.data;"error"===a.type?t(a.error):e(a)}}));return o.call(this.port,{message:e,port:r.port2},a),await s}}class u extends EventTarget{protocols;url;readyState=n.CONNECTING;channel;constructor(e,t=[],r,a){super(),this.protocols=t,this.url=e.toString(),this.protocols=t;const s=e=>{this.protocols=e,this.readyState=n.OPEN;const t=new Event("open");this.dispatchEvent(t)},o=async e=>{const t=new MessageEvent("message",{data:e});this.dispatchEvent(t)},c=(e,t)=>{this.readyState=n.CLOSED;const r=new CloseEvent("close",{code:e,reason:t});this.dispatchEvent(r)},i=()=>{this.readyState=n.CLOSED;const e=new Event("error");this.dispatchEvent(e)};this.channel=new MessageChannel,this.channel.port1.onmessage=e=>{"open"===e.data.type?s(e.data.args[0]):"message"===e.data.type?o(e.data.args[0]):"close"===e.data.type?c(e.data.args[0],e.data.args[1]):"error"===e.data.type&&i()},r.sendMessage({type:"websocket",websocket:{url:e.toString(),protocols:t,requestHeaders:a,channel:this.channel.port2}},[this.channel.port2])}send(...e){if(this.readyState===n.CONNECTING)throw new DOMException("Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.");let t=e[0];t.buffer&&(t=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)),o.call(this.channel.port1,{type:"data",data:t},t instanceof ArrayBuffer?[t]:[])}close(e,t){o.call(this.channel.port1,{type:"close",closeCode:e,closeReason:t})}}function w(e,t,r){console.error(`error while processing '${r}': `,t),e.postMessage({type:"error",error:t})}function f(e){for(let t=0;t<e.length;t++){const r=e[t];if(!"!#$%&'*+-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`abcdefghijklmnopqrstuvwxyz|~".includes(r))return!1}return!0}const g=["ws:","wss:"],b=[101,204,205,304],y=[301,302,303,307,308];class m{worker;constructor(e){this.worker=new p(e)}createWebSocket(e,t=[],r,a){try{e=new URL(e)}catch(t){throw new DOMException(`Faiiled to construct 'WebSocket': The URL '${e}' is invalid.`)}if(!g.includes(e.protocol))throw new DOMException(`Failed to construct 'WebSocket': The URL's scheme must be either 'ws' or 'wss'. '${e.protocol}' is not allowed.`);Array.isArray(t)||(t=[t]),t=t.map(String);for(const e of t)if(!f(e))throw new DOMException(`Failed to construct 'WebSocket': The subprotocol '${e}' is invalid.`);a=a||{};return new u(e,t,this.worker,a)}async fetch(e,r){const a=new Request(e,r),s=r?.headers||a.headers,o=s instanceof Headers?Object.fromEntries(s):s,n=a.body;let c=new URL(a.url);if(c.protocol.startsWith("blob:")){const e=await t(c),r=new Response(e.body,e);return r.rawHeaders=Object.fromEntries(e.headers),r.rawResponse={body:e.body,headers:Object.fromEntries(e.headers),status:e.status,statusText:e.statusText},r.finalURL=c.toString(),r}for(let e=0;;e++){let t=(await this.worker.sendMessage({type:"fetch",fetch:{remote:c.toString(),method:a.method,headers:o,body:n||void 0}},n?[n]:[])).fetch,s=new Response(b.includes(t.status)?void 0:t.body,{headers:new Headers(t.headers),status:t.status,statusText:t.statusText});s.rawHeaders=t.headers,s.rawResponse=t,s.finalURL=c.toString();const i=r?.redirect||a.redirect;if(!y.includes(s.status))return s;switch(i){case"follow":{const t=s.headers.get("location");if(20>e&&null!==t){c=new URL(t,c);continue}throw new TypeError("Failed to fetch")}case"error":throw new TypeError("Failed to fetch");case"manual":return s}}}}console.debug("bare-mux: running v2.1.9 (build dc9dc6e)"),e.BareClient=m,e.BareMuxConnection=class{worker;constructor(e){this.worker=new p(e)}async getTransport(){return(await this.worker.sendMessage({type:"get"})).name}async setTransport(e,t,r){await this.setManualTransport(`\n\t\t\tconst { default: BareTransport } = await import("${e}");\n\t\t\treturn [BareTransport, "${e}"];\n\t\t`,t,r)}async setManualTransport(e,t,r){if("bare-mux-remote"===e)throw new Error("Use setRemoteTransport.");await this.worker.sendMessage({type:"set",client:{function:e,args:t}},r)}async setRemoteTransport(e,t){const r=new MessageChannel;r.port1.onmessage=async t=>{const r=t.data.port,a=t.data.message;if("fetch"===a.type)try{e.ready||await e.init(),await async function(e,t,r){const a=await r.request(new URL(e.fetch.remote),e.fetch.method,e.fetch.body,e.fetch.headers,null);if(!d()&&a.body instanceof ReadableStream){const e=new Response(a.body);a.body=await e.arrayBuffer()}a.body instanceof ReadableStream||a.body instanceof ArrayBuffer?o.call(t,{type:"fetch",fetch:a},[a.body]):o.call(t,{type:"fetch",fetch:a})}(a,r,e)}catch(e){w(r,e,"fetch")}else if("websocket"===a.type)try{e.ready||await e.init(),await async function(e,t,r){const[a,s]=r.connect(new URL(e.websocket.url),e.websocket.protocols,e.websocket.requestHeaders,(t=>{o.call(e.websocket.channel,{type:"open",args:[t]})}),(t=>{t instanceof ArrayBuffer?o.call(e.websocket.channel,{type:"message",args:[t]},[t]):o.call(e.websocket.channel,{type:"message",args:[t]})}),((t,r)=>{o.call(e.websocket.channel,{type:"close",args:[t,r]})}),(t=>{o.call(e.websocket.channel,{type:"error",args:[t]})}));e.websocket.channel.onmessage=e=>{"data"===e.data.type?a(e.data.data):"close"===e.data.type&&s(e.data.closeCode,e.data.closeReason)},o.call(t,{type:"websocket"})}(a,r,e)}catch(e){w(r,e,"websocket")}},await this.worker.sendMessage({type:"set",client:{function:"bare-mux-remote",args:[r.port2,t]}},[r.port2])}getInnerPort(){return this.worker.port}},e.BareWebSocket=u,e.WebSocketFields=n,e.WorkerConnection=p,e.browserSupportsTransferringStreams=d,e.default=m,e.maxRedirects=20,e.validProtocol=f,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/baremux/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=20,t=globalThis.fetch,r=globalThis.SharedWorker,a=globalThis.localStorage,s=globalThis.navigator.serviceWorker,o=MessagePort.prototype.postMessage,n={prototype:{send:WebSocket.prototype.send},CLOSED:WebSocket.CLOSED,CLOSING:WebSocket.CLOSING,CONNECTING:WebSocket.CONNECTING,OPEN:WebSocket.OPEN};async function c(){const e=(await self.clients.matchAll({type:"window",includeUncontrolled:!0})).map((async e=>{const t=await function(e){let t=new MessageChannel;return new Promise((r=>{e.postMessage({type:"getPort:aether-mrralex-demo@1.0.
|
|
1
|
+
const e=20,t=globalThis.fetch,r=globalThis.SharedWorker,a=globalThis.localStorage,s=globalThis.navigator.serviceWorker,o=MessagePort.prototype.postMessage,n={prototype:{send:WebSocket.prototype.send},CLOSED:WebSocket.CLOSED,CLOSING:WebSocket.CLOSING,CONNECTING:WebSocket.CONNECTING,OPEN:WebSocket.OPEN};async function c(){const e=(await self.clients.matchAll({type:"window",includeUncontrolled:!0})).map((async e=>{const t=await function(e){let t=new MessageChannel;return new Promise((r=>{e.postMessage({type:"getPort:aether-mrralex-demo@1.0.1",port:t.port2},[t.port2]),t.port1.onmessage=e=>{r(e.data)}}))}(e);return await i(t),t})),t=Promise.race([Promise.any(e),new Promise(((e,t)=>setTimeout(t,1e3,new TypeError("timeout"))))]);try{return await t}catch(e){if(e instanceof AggregateError)throw console.error("bare-mux: failed to get a bare-mux SharedWorker MessagePort as all clients returned an invalid MessagePort."),new Error("All clients returned an invalid MessagePort.",{cause:e});return console.warn("bare-mux: failed to get a bare-mux SharedWorker MessagePort within 1s, retrying"),await c()}}function i(e){const t=new MessageChannel,r=new Promise(((e,r)=>{t.port1.onmessage=t=>{"pong"===t.data.type&&e()},setTimeout(r,1500)}));return o.call(e,{message:{type:"ping"},port:t.port2},[t.port2]),r}function l(e,t){const a=new r(e,"bare-mux-worker:aether-mrralex-demo@1.0.1");return t&&s.addEventListener("message",(t=>{if("getPort:aether-mrralex-demo@1.0.1"===t.data.type&&t.data.port){console.debug("bare-mux: recieved request for port from sw");const a=new r(e,"bare-mux-worker:aether-mrralex-demo@1.0.1");o.call(t.data.port,a.port,[a.port])}})),a.port}let h=null;function d(){if(null===h){const e=new MessageChannel,t=new ReadableStream;let r;try{o.call(e.port1,t,[t]),r=!0}catch(e){r=!1}return h=r,r}return h}class p{channel;port;workerPath;constructor(e){this.channel=new BroadcastChannel("bare-mux:aether-mrralex-demo@1.0.1"),e instanceof MessagePort||e instanceof Promise?this.port=e:this.createChannel(e,!0)}createChannel(e,t){if(self.clients)this.port=c(),this.channel.onmessage=e=>{"refreshPort"===e.data.type&&(this.port=c())};else if(e&&SharedWorker){if(!e.startsWith("/")&&!e.includes(":"))throw new Error("Invalid URL. Must be absolute or start at the root.");this.port=l(e,t),console.debug("bare-mux: setting localStorage bare-mux-path to",e),a["bare-mux-path:aether-mrralex-demo@1.0.1"]=e}else{if(!SharedWorker)throw new Error("Unable to get a channel to the SharedWorker.");{const e=a["bare-mux-path:aether-mrralex-demo@1.0.1"];if(console.debug("bare-mux: got localStorage bare-mux-path:",e),!e)throw new Error("Unable to get bare-mux workerPath from localStorage.");this.port=l(e,t)}}}async sendMessage(e,t){this.port instanceof Promise&&(this.port=await this.port);try{await i(this.port)}catch{return console.warn("bare-mux: Failed to get a ping response from the worker within 1.5s. Assuming port is dead."),this.createChannel(),await this.sendMessage(e,t)}const r=new MessageChannel,a=[r.port2,...t||[]],s=new Promise(((e,t)=>{r.port1.onmessage=r=>{const a=r.data;"error"===a.type?t(a.error):e(a)}}));return o.call(this.port,{message:e,port:r.port2},a),await s}}class w extends EventTarget{protocols;url;readyState=n.CONNECTING;channel;constructor(e,t=[],r,a){super(),this.protocols=t,this.url=e.toString(),this.protocols=t;const s=e=>{this.protocols=e,this.readyState=n.OPEN;const t=new Event("open");this.dispatchEvent(t)},o=async e=>{const t=new MessageEvent("message",{data:e});this.dispatchEvent(t)},c=(e,t)=>{this.readyState=n.CLOSED;const r=new CloseEvent("close",{code:e,reason:t});this.dispatchEvent(r)},i=()=>{this.readyState=n.CLOSED;const e=new Event("error");this.dispatchEvent(e)};this.channel=new MessageChannel,this.channel.port1.onmessage=e=>{"open"===e.data.type?s(e.data.args[0]):"message"===e.data.type?o(e.data.args[0]):"close"===e.data.type?c(e.data.args[0],e.data.args[1]):"error"===e.data.type&&i()},r.sendMessage({type:"websocket",websocket:{url:e.toString(),protocols:t,requestHeaders:a,channel:this.channel.port2}},[this.channel.port2])}send(...e){if(this.readyState===n.CONNECTING)throw new DOMException("Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.");let t=e[0];t.buffer&&(t=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)),o.call(this.channel.port1,{type:"data",data:t},t instanceof ArrayBuffer?[t]:[])}close(e,t){o.call(this.channel.port1,{type:"close",closeCode:e,closeReason:t})}}function u(e,t,r){console.error(`error while processing '${r}': `,t),e.postMessage({type:"error",error:t})}function f(e){for(let t=0;t<e.length;t++){const r=e[t];if(!"!#$%&'*+-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`abcdefghijklmnopqrstuvwxyz|~".includes(r))return!1}return!0}const g=["ws:","wss:"],y=[101,204,205,304],b=[301,302,303,307,308];class m{worker;constructor(e){this.worker=new p(e)}async getTransport(){return(await this.worker.sendMessage({type:"get"})).name}async setTransport(e,t,r){await this.setManualTransport(`\n\t\t\tconst { default: BareTransport } = await import("${e}");\n\t\t\treturn [BareTransport, "${e}"];\n\t\t`,t,r)}async setManualTransport(e,t,r){if("bare-mux-remote"===e)throw new Error("Use setRemoteTransport.");await this.worker.sendMessage({type:"set",client:{function:e,args:t}},r)}async setRemoteTransport(e,t){const r=new MessageChannel;r.port1.onmessage=async t=>{const r=t.data.port,a=t.data.message;if("fetch"===a.type)try{e.ready||await e.init(),await async function(e,t,r){const a=await r.request(new URL(e.fetch.remote),e.fetch.method,e.fetch.body,e.fetch.headers,null);if(!d()&&a.body instanceof ReadableStream){const e=new Response(a.body);a.body=await e.arrayBuffer()}a.body instanceof ReadableStream||a.body instanceof ArrayBuffer?o.call(t,{type:"fetch",fetch:a},[a.body]):o.call(t,{type:"fetch",fetch:a})}(a,r,e)}catch(e){u(r,e,"fetch")}else if("websocket"===a.type)try{e.ready||await e.init(),await async function(e,t,r){const[a,s]=r.connect(new URL(e.websocket.url),e.websocket.protocols,e.websocket.requestHeaders,(t=>{o.call(e.websocket.channel,{type:"open",args:[t]})}),(t=>{t instanceof ArrayBuffer?o.call(e.websocket.channel,{type:"message",args:[t]},[t]):o.call(e.websocket.channel,{type:"message",args:[t]})}),((t,r)=>{o.call(e.websocket.channel,{type:"close",args:[t,r]})}),(t=>{o.call(e.websocket.channel,{type:"error",args:[t]})}));e.websocket.channel.onmessage=e=>{"data"===e.data.type?a(e.data.data):"close"===e.data.type&&s(e.data.closeCode,e.data.closeReason)},o.call(t,{type:"websocket"})}(a,r,e)}catch(e){u(r,e,"websocket")}},await this.worker.sendMessage({type:"set",client:{function:"bare-mux-remote",args:[r.port2,t]}},[r.port2])}getInnerPort(){return this.worker.port}}class k{worker;constructor(e){this.worker=new p(e)}createWebSocket(e,t=[],r,a){try{e=new URL(e)}catch(t){throw new DOMException(`Faiiled to construct 'WebSocket': The URL '${e}' is invalid.`)}if(!g.includes(e.protocol))throw new DOMException(`Failed to construct 'WebSocket': The URL's scheme must be either 'ws' or 'wss'. '${e.protocol}' is not allowed.`);Array.isArray(t)||(t=[t]),t=t.map(String);for(const e of t)if(!f(e))throw new DOMException(`Failed to construct 'WebSocket': The subprotocol '${e}' is invalid.`);a=a||{};return new w(e,t,this.worker,a)}async fetch(e,r){const a=new Request(e,r),s=r?.headers||a.headers,o=s instanceof Headers?Object.fromEntries(s):s,n=a.body;let c=new URL(a.url);if(c.protocol.startsWith("blob:")){const e=await t(c),r=new Response(e.body,e);return r.rawHeaders=Object.fromEntries(e.headers),r.rawResponse={body:e.body,headers:Object.fromEntries(e.headers),status:e.status,statusText:e.statusText},r.finalURL=c.toString(),r}for(let e=0;;e++){let t=(await this.worker.sendMessage({type:"fetch",fetch:{remote:c.toString(),method:a.method,headers:o,body:n||void 0}},n?[n]:[])).fetch,s=new Response(y.includes(t.status)?void 0:t.body,{headers:new Headers(t.headers),status:t.status,statusText:t.statusText});s.rawHeaders=t.headers,s.rawResponse=t,s.finalURL=c.toString();const i=r?.redirect||a.redirect;if(!b.includes(s.status))return s;switch(i){case"follow":{const t=s.headers.get("location");if(20>e&&null!==t){c=new URL(t,c);continue}throw new TypeError("Failed to fetch")}case"error":throw new TypeError("Failed to fetch");case"manual":return s}}}}console.debug("bare-mux: running v2.1.9 (build dc9dc6e)");export{k as BareClient,m as BareMuxConnection,w as BareWebSocket,n as WebSocketFields,p as WorkerConnection,d as browserSupportsTransferringStreams,k as default,e as maxRedirects,f as validProtocol};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/baremux/worker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";const e=MessagePort.prototype.postMessage;let t=null;function a(e,t,a){console.error(`error while processing '${a}': `,t),e.postMessage({type:"error",error:t})}async function n(a,n,s){const o=await s.request(new URL(a.fetch.remote),a.fetch.method,a.fetch.body,a.fetch.headers,null);if(!function(){if(null===t){const a=new MessageChannel,n=new ReadableStream;let s;try{e.call(a.port1,n,[n]),s=!0}catch(e){s=!1}return t=s,s}return t}()&&o.body instanceof ReadableStream){const e=new Response(o.body);o.body=await e.arrayBuffer()}o.body instanceof ReadableStream||o.body instanceof ArrayBuffer?e.call(n,{type:"fetch",fetch:o},[o.body]):e.call(n,{type:"fetch",fetch:o})}let s=null,o="";function c(){return new Error("there are no bare clients",{cause:"No BareTransport was set. Try creating a BareMuxConnection and calling `setTransport()` or `setManualTransport()` on it before using BareClient."})}function r(t,a){const n=s;let o=[a];t.fetch?.body&&o.push(t.fetch.body),t.websocket?.channel&&o.push(t.websocket.channel),e.call(n,{message:t,port:a},o)}function l(t){t.onmessage=async t=>{const l=t.data.port,i=t.data.message;if("ping"===i.type)e.call(l,{type:"pong"});else if("set"===i.type)try{const t=async function(){}.constructor;if("bare-mux-remote"===i.client.function)s=i.client.args[0],o=`bare-mux-remote (${i.client.args[1]})`;else try{const e=new t(i.client.function),[a,n]=await e();s=new a(...i.client.args),o=n}catch(e){throw e.cause="The BareTransport provided was invalid. Common causes of this are a default export that is not a class that implements BareTransport if you are using `setTransport()`",e}console.log("set transport to ",s,o),e.call(l,{type:"set"})}catch(e){a(l,e,"set")}else if("get"===i.type)l.postMessage({type:"get",name:o});else if("fetch"===i.type)try{if(!s)throw c();if(s instanceof MessagePort)return void r(i,l);s.ready||await s.init(),await n(i,l,s)}catch(e){a(l,e,"fetch")}else if("websocket"===i.type)try{if(!s)throw c();if(s instanceof MessagePort)return void r(i,l);s.ready||await s.init(),await async function(t,a,n){const[s,o]=n.connect(new URL(t.websocket.url),t.websocket.protocols,t.websocket.requestHeaders,(a=>{e.call(t.websocket.channel,{type:"open",args:[a]})}),(a=>{a instanceof ArrayBuffer?e.call(t.websocket.channel,{type:"message",args:[a]},[a]):e.call(t.websocket.channel,{type:"message",args:[a]})}),((a,n)=>{e.call(t.websocket.channel,{type:"close",args:[a,n]})}),(a=>{e.call(t.websocket.channel,{type:"error",args:[a]})}));t.websocket.channel.onmessage=e=>{"data"===e.data.type?s(e.data.data):"close"===e.data.type&&o(e.data.closeCode,e.data.closeReason)},e.call(a,{type:"websocket"})}(i,l,s)}catch(e){a(l,e,"websocket")}}}new BroadcastChannel("bare-mux:aether-mrralex-demo@1.0.
|
|
1
|
+
!function(){"use strict";const e=MessagePort.prototype.postMessage;let t=null;function a(e,t,a){console.error(`error while processing '${a}': `,t),e.postMessage({type:"error",error:t})}async function n(a,n,s){const o=await s.request(new URL(a.fetch.remote),a.fetch.method,a.fetch.body,a.fetch.headers,null);if(!function(){if(null===t){const a=new MessageChannel,n=new ReadableStream;let s;try{e.call(a.port1,n,[n]),s=!0}catch(e){s=!1}return t=s,s}return t}()&&o.body instanceof ReadableStream){const e=new Response(o.body);o.body=await e.arrayBuffer()}o.body instanceof ReadableStream||o.body instanceof ArrayBuffer?e.call(n,{type:"fetch",fetch:o},[o.body]):e.call(n,{type:"fetch",fetch:o})}let s=null,o="";function c(){return new Error("there are no bare clients",{cause:"No BareTransport was set. Try creating a BareMuxConnection and calling `setTransport()` or `setManualTransport()` on it before using BareClient."})}function r(t,a){const n=s;let o=[a];t.fetch?.body&&o.push(t.fetch.body),t.websocket?.channel&&o.push(t.websocket.channel),e.call(n,{message:t,port:a},o)}function l(t){t.onmessage=async t=>{const l=t.data.port,i=t.data.message;if("ping"===i.type)e.call(l,{type:"pong"});else if("set"===i.type)try{const t=async function(){}.constructor;if("bare-mux-remote"===i.client.function)s=i.client.args[0],o=`bare-mux-remote (${i.client.args[1]})`;else try{const e=new t(i.client.function),[a,n]=await e();s=new a(...i.client.args),o=n}catch(e){throw e.cause="The BareTransport provided was invalid. Common causes of this are a default export that is not a class that implements BareTransport if you are using `setTransport()`",e}console.log("set transport to ",s,o),e.call(l,{type:"set"})}catch(e){a(l,e,"set")}else if("get"===i.type)l.postMessage({type:"get",name:o});else if("fetch"===i.type)try{if(!s)throw c();if(s instanceof MessagePort)return void r(i,l);s.ready||await s.init(),await n(i,l,s)}catch(e){a(l,e,"fetch")}else if("websocket"===i.type)try{if(!s)throw c();if(s instanceof MessagePort)return void r(i,l);s.ready||await s.init(),await async function(t,a,n){const[s,o]=n.connect(new URL(t.websocket.url),t.websocket.protocols,t.websocket.requestHeaders,(a=>{e.call(t.websocket.channel,{type:"open",args:[a]})}),(a=>{a instanceof ArrayBuffer?e.call(t.websocket.channel,{type:"message",args:[a]},[a]):e.call(t.websocket.channel,{type:"message",args:[a]})}),((a,n)=>{e.call(t.websocket.channel,{type:"close",args:[a,n]})}),(a=>{e.call(t.websocket.channel,{type:"error",args:[a]})}));t.websocket.channel.onmessage=e=>{"data"===e.data.type?s(e.data.data):"close"===e.data.type&&o(e.data.closeCode,e.data.closeReason)},e.call(a,{type:"websocket"})}(i,l,s)}catch(e){a(l,e,"websocket")}}}new BroadcastChannel("bare-mux:aether-mrralex-demo@1.0.1").postMessage({type:"refreshPort"}),self.onconnect=e=>{l(e.ports[0])},console.debug("bare-mux: running v2.1.9 (build dc9dc6e)")}();
|
|
2
2
|
//# sourceMappingURL=worker.js.map
|
package/games/index.html
CHANGED
|
@@ -4,19 +4,20 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
6
6
|
<meta name="color-scheme" content="dark light">
|
|
7
|
-
<title>
|
|
8
|
-
<link rel="icon" href="/aether-mrralex-demo@1.0.
|
|
9
|
-
<
|
|
10
|
-
<link rel="stylesheet" href="/aether-mrralex-demo@1.0.
|
|
7
|
+
<title>Aether</title>
|
|
8
|
+
<link rel="icon" href="/aether-mrralex-demo@1.0.1/favicon.svg" type="image/svg+xml">
|
|
9
|
+
<script src="/aether-mrralex-demo@1.0.1/js/tab-identity.js"></script>
|
|
10
|
+
<link rel="stylesheet" href="/aether-mrralex-demo@1.0.1/css/app.css">
|
|
11
|
+
<link rel="stylesheet" href="/aether-mrralex-demo@1.0.1/games/game.css">
|
|
11
12
|
<script>
|
|
12
13
|
(function () {
|
|
13
14
|
try {
|
|
14
|
-
var theme = localStorage.getItem("aether-mrralex-demo@1.0.
|
|
15
|
+
var theme = localStorage.getItem("aether-mrralex-demo@1.0.1:theme");
|
|
15
16
|
if (theme === "light" || theme === "dark") document.documentElement.dataset.theme = theme;
|
|
16
17
|
} catch (error) {}
|
|
17
18
|
})();
|
|
18
19
|
</script>
|
|
19
|
-
<script src="/aether-mrralex-demo@1.0.
|
|
20
|
+
<script src="/aether-mrralex-demo@1.0.1/shared.js"></script><script src="/aether-mrralex-demo@1.0.1/js/config.js"></script>
|
|
20
21
|
</head>
|
|
21
22
|
<body class="game hub-page">
|
|
22
23
|
<main class="hub">
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
<button class="btn btn-quiet hub-more" id="more" type="button" hidden>Load more</button>
|
|
33
34
|
</main>
|
|
34
35
|
|
|
35
|
-
<a class="launcher-trigger hub-home" href="/aether-mrralex-demo@1.0.
|
|
36
|
+
<a class="launcher-trigger hub-home" href="/aether-mrralex-demo@1.0.1/index.html" aria-label="Back to Aether" title="Back to Aether">
|
|
36
37
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m3 10 9-7 9 7"/><path d="M5 8.5V21h5v-7h4v7h5V8.5"/></svg>
|
|
37
38
|
</a>
|
|
38
39
|
|
|
@@ -69,14 +70,14 @@
|
|
|
69
70
|
function card(game) {
|
|
70
71
|
const link = document.createElement("a");
|
|
71
72
|
link.className = "hub-card";
|
|
72
|
-
link.href = `/aether-mrralex-demo@1.0.
|
|
73
|
+
link.href = `/aether-mrralex-demo@1.0.1/games/play.html?g=${game.id}`;
|
|
73
74
|
link.title = game.author ? `${game.name} — ${game.author}` : game.name;
|
|
74
75
|
|
|
75
76
|
const art = document.createElement("img");
|
|
76
77
|
art.loading = "lazy";
|
|
77
78
|
art.decoding = "async";
|
|
78
79
|
art.alt = "";
|
|
79
|
-
art.src = game.cover || "/aether-mrralex-demo@1.0.
|
|
80
|
+
art.src = game.cover || "/aether-mrralex-demo@1.0.1/favicon.svg";
|
|
80
81
|
|
|
81
82
|
const label = document.createElement("span");
|
|
82
83
|
label.className = "hub-name";
|
|
@@ -110,7 +111,7 @@
|
|
|
110
111
|
}, 120);
|
|
111
112
|
});
|
|
112
113
|
|
|
113
|
-
import("../js/static-engine.js").then(module => module.startStaticEngine()).then(() => fetch("/aether-mrralex-demo@1.0.
|
|
114
|
+
import("../js/static-engine.js").then(module => module.startStaticEngine()).then(() => fetch("/aether-mrralex-demo@1.0.1/games/list.json"))
|
|
114
115
|
.then((response) => (response.ok ? response.json() : Promise.reject(new Error("no catalogue"))))
|
|
115
116
|
.then((list) => {
|
|
116
117
|
all = pinFirst(Array.isArray(list) ? list : []);
|