@volter/browser-substrate 0.1.100 → 0.1.101

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.
@@ -8,7 +8,7 @@
8
8
  <link rel="icon" type="image/svg+xml" href="https://brand.volter.ai/logo/browser-substrate/svg?size=64" />
9
9
  <!-- Black glass from the first byte, before any script: the boot screen (boot-screen.js) comes on from here. Ready or failed, the page's own paper returns. -->
10
10
  <style>html:not([data-ready]):not([data-error]), html:not([data-ready]):not([data-error]) body { background: #0b0b0c; color-scheme: dark; }</style>
11
- <script type="module" crossorigin src="/assets/shell-1LFMcbJv.js"></script>
11
+ <script type="module" crossorigin src="/assets/shell-CzbWwVZ3.js"></script>
12
12
  <link rel="modulepreload" crossorigin href="/assets/page-workers-BUcWBF51.js">
13
13
  <link rel="modulepreload" crossorigin href="/assets/browser-sandbox-bridge-BRDWHeqY.js">
14
14
  <link rel="modulepreload" crossorigin href="/assets/cross-origin-container-protocol-hIp9vH-t.js">
@@ -4319,4 +4319,4 @@ function serveStore(scope3, port, loadEngine) {
4319
4319
  }
4320
4320
 
4321
4321
  // <stdin>
4322
- startExecutionFront(self, () => import("/assets/node-execution-worker-b410406bb5514b5d.js"));
4322
+ startExecutionFront(self, () => import("/assets/node-execution-worker-7a2fc3cf9f082cbe.js"));
@@ -1 +1 @@
1
- {"format":1,"pyodide":"314.0.6","engine":"sha256-OgoA3+qjSKwg+e8JkEIz0y0z9kQzlmLUrzaPiiAQ83o=","preparation":"77987879a2949714bdec4de6bae2d0431adbc3549686414e4e13e051cf23bfae","integrity":"sha256-C1CWtQV/+66TU5l7yN5FvC00NJRHdcDx6gN7PZnx1JU=","bytes":6173743}
1
+ {"format":1,"pyodide":"314.0.6","engine":"sha256-OgoA3+qjSKwg+e8JkEIz0y0z9kQzlmLUrzaPiiAQ83o=","preparation":"77987879a2949714bdec4de6bae2d0431adbc3549686414e4e13e051cf23bfae","integrity":"sha256-0KXGCN5469d6HvakXrGJWVxZBsoE6U7XrAItBCi699Q=","bytes":6220591}
@@ -11482,7 +11482,7 @@ __export(index_browser_exports, {
11482
11482
  watch: () => watch2
11483
11483
  });
11484
11484
 
11485
- // ../../node_modules/@volter/tabnode/dist/port-bridge-Cergvxli.js
11485
+ // ../../node_modules/@volter/tabnode/dist/port-bridge-jWsJfZRQ.js
11486
11486
  var __defProp2 = Object.defineProperty;
11487
11487
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11488
11488
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -11706,18 +11706,23 @@ var _PortBridge = class _PortBridge2 extends BridgeEvents {
11706
11706
  navigator.serviceWorker.addEventListener("controllerchange", () => resolve8(), { once: true });
11707
11707
  });
11708
11708
  const registration = await navigator.serviceWorker.register(swUrl, {
11709
- scope: "/"
11709
+ scope: "/",
11710
+ updateViaCache: "none"
11710
11711
  });
11711
- const sw2 = registration.active || registration.waiting || registration.installing;
11712
+ try {
11713
+ await Promise.race([registration.update(), new Promise((resolve8) => setTimeout(resolve8, 5e3))]);
11714
+ } catch {
11715
+ }
11716
+ const sw2 = registration.installing || registration.waiting || registration.active;
11712
11717
  if (!sw2) {
11713
11718
  throw new Error("Service Worker registration failed");
11714
11719
  }
11715
11720
  await new Promise((resolve8) => {
11716
- if (sw2.state === "activated") {
11721
+ if (sw2.state === "activated" || sw2.state === "redundant") {
11717
11722
  resolve8();
11718
11723
  } else {
11719
11724
  const handler = () => {
11720
- if (sw2.state === "activated") {
11725
+ if (sw2.state === "activated" || sw2.state === "redundant") {
11721
11726
  sw2.removeEventListener("statechange", handler);
11722
11727
  resolve8();
11723
11728
  }
@@ -11725,10 +11730,30 @@ var _PortBridge = class _PortBridge2 extends BridgeEvents {
11725
11730
  sw2.addEventListener("statechange", handler);
11726
11731
  }
11727
11732
  });
11733
+ const controlling = sw2.state === "redundant" ? registration.active : sw2;
11734
+ if (!controlling) throw new Error("Service Worker failed to install");
11735
+ if (navigator.serviceWorker.controller && navigator.serviceWorker.controller !== controlling) {
11736
+ await new Promise((resolve8) => {
11737
+ const timer = setTimeout(() => {
11738
+ console.warn("tabnode: the new service worker did not take control within 10 s; starting under the one in control");
11739
+ done();
11740
+ }, 1e4);
11741
+ function done() {
11742
+ clearTimeout(timer);
11743
+ navigator.serviceWorker.removeEventListener("controllerchange", changed);
11744
+ resolve8();
11745
+ }
11746
+ function changed() {
11747
+ if (navigator.serviceWorker.controller === controlling) done();
11748
+ }
11749
+ navigator.serviceWorker.addEventListener("controllerchange", changed);
11750
+ changed();
11751
+ });
11752
+ }
11728
11753
  this.messageChannel = new MessageChannel();
11729
11754
  this.messageChannel.port1.onmessage = this.handleServiceWorkerMessage.bind(this);
11730
11755
  this.ownDocuments = options == null ? void 0 : options.ownDocuments;
11731
- sw2.postMessage({ type: "init", port: this.messageChannel.port2, data: { ownDocuments: this.ownDocuments ?? [] } }, [
11756
+ controlling.postMessage({ type: "init", port: this.messageChannel.port2, data: { ownDocuments: this.ownDocuments ?? [] } }, [
11732
11757
  this.messageChannel.port2
11733
11758
  ]);
11734
11759
  await controllerReady;
@@ -95901,10 +95926,17 @@ var implementation$1 = function bind2(that) {
95901
95926
  var implementation = implementation$1;
95902
95927
  var functionBind = Function.prototype.bind || implementation;
95903
95928
  var functionCall = Function.prototype.call;
95904
- var functionApply = Function.prototype.apply;
95929
+ var functionApply;
95930
+ var hasRequiredFunctionApply;
95931
+ function requireFunctionApply() {
95932
+ if (hasRequiredFunctionApply) return functionApply;
95933
+ hasRequiredFunctionApply = 1;
95934
+ functionApply = Function.prototype.apply;
95935
+ return functionApply;
95936
+ }
95905
95937
  var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
95906
95938
  var bind$2 = functionBind;
95907
- var $apply$1 = functionApply;
95939
+ var $apply$1 = requireFunctionApply();
95908
95940
  var $call$2 = functionCall;
95909
95941
  var $reflectApply = reflectApply;
95910
95942
  var actualApply = $reflectApply || bind$2.call($call$2, $apply$1);
@@ -96024,7 +96056,7 @@ var hasSymbols = requireHasSymbols()();
96024
96056
  var getProto = requireGetProto();
96025
96057
  var $ObjectGPO = requireObject_getPrototypeOf();
96026
96058
  var $ReflectGPO = requireReflect_getPrototypeOf();
96027
- var $apply = functionApply;
96059
+ var $apply = requireFunctionApply();
96028
96060
  var $call = functionCall;
96029
96061
  var needsEval = {};
96030
96062
  var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
@@ -96666,7 +96698,7 @@ function requireApplyBind() {
96666
96698
  if (hasRequiredApplyBind) return applyBind;
96667
96699
  hasRequiredApplyBind = 1;
96668
96700
  var bind3 = functionBind;
96669
- var $apply2 = functionApply;
96701
+ var $apply2 = requireFunctionApply();
96670
96702
  var actualApply$1 = actualApply;
96671
96703
  applyBind = function applyBind2() {
96672
96704
  return actualApply$1(bind3, $apply2, arguments);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/browser-substrate",
3
- "version": "0.1.100",
3
+ "version": "0.1.101",
4
4
  "description": "Run a folder in a browser tab: one command, a Dockerfile as the config, static files out",
5
5
  "license": "MIT",
6
6
  "repository": {