@volter/browser-substrate 0.1.100 → 0.1.102

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,9 +8,9 @@
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-DLIQ6jHu.js"></script>
12
12
  <link rel="modulepreload" crossorigin href="/assets/page-workers-BUcWBF51.js">
13
- <link rel="modulepreload" crossorigin href="/assets/browser-sandbox-bridge-BRDWHeqY.js">
13
+ <link rel="modulepreload" crossorigin href="/assets/browser-sandbox-bridge-BJbQoc4f.js">
14
14
  <link rel="modulepreload" crossorigin href="/assets/cross-origin-container-protocol-hIp9vH-t.js">
15
15
  <link rel="stylesheet" crossorigin href="/assets/shell-BEKXfRsE.css">
16
16
  </head>
@@ -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-7e8e0c5321ca0d10.js"));
@@ -3181,7 +3181,7 @@ function applyPythonProcessPatch(fs, patch, base) {
3181
3181
  applyProcessFilesystemPatch(pythonProcessFileSystem(fs), patch, base);
3182
3182
  }
3183
3183
  function msOf(time) {
3184
- return time instanceof Date ? time.getTime() : time;
3184
+ return typeof time === "number" ? time : Number(time);
3185
3185
  }
3186
3186
  function restorePythonSnapshot(fs, value) {
3187
3187
  clearTree(fs, PYTHON_WORKSPACE);
@@ -3277,7 +3277,7 @@ function depth2(path) {
3277
3277
  return segments;
3278
3278
  }
3279
3279
  function pythonMetadata(stat) {
3280
- const mtimeMs = stat.mtime instanceof Date ? stat.mtime.getTime() : stat.mtime;
3280
+ const mtimeMs = typeof stat.mtime === "number" ? stat.mtime : Number(stat.mtime);
3281
3281
  return {
3282
3282
  mode: stat.mode & 4095,
3283
3283
  ...typeof mtimeMs === "number" && Number.isFinite(mtimeMs) ? { mtimeMs } : {}
@@ -3497,7 +3497,7 @@ function snapshotPackWorkspace(filesystem, changes, original) {
3497
3497
  const files = original.files.filter((entry) => entry.path !== PYTHON_WORKSPACE && !entry.path.startsWith(`${PYTHON_WORKSPACE}/`));
3498
3498
  const walk2 = (path) => {
3499
3499
  const stat = filesystem.stat(path);
3500
- const mtimeMs = stat.mtime instanceof Date ? stat.mtime.getTime() : stat.mtime;
3500
+ const mtimeMs = typeof stat.mtime === "number" ? stat.mtime : Number(stat.mtime);
3501
3501
  const metadata2 = { mode: stat.mode & 4095, ...typeof mtimeMs === "number" && Number.isFinite(mtimeMs) ? { mtimeMs } : {} };
3502
3502
  if ((stat.mode & 61440) === S_IFDIR2) {
3503
3503
  files.push({ path, type: "directory", ...metadata2 });
@@ -5288,7 +5288,7 @@ var PythonSqliteCoherence = class {
5288
5288
  const stat = this.filesystem.stat(path);
5289
5289
  if ((stat.mode & 61440) === 16384)
5290
5290
  return;
5291
- const mtimeMs = stat.mtime instanceof Date ? stat.mtime.getTime() : stat.mtime;
5291
+ const mtimeMs = typeof stat.mtime === "number" ? stat.mtime : Number(stat.mtime);
5292
5292
  return {
5293
5293
  bytes: this.filesystem.readFile(path),
5294
5294
  mode: stat.mode & 4095,
@@ -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-gNV8rVjKiQ9bofGSc2vRCdwQg1MXH9nMx0KPgykyps8=","bytes":6215455}
@@ -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);
@@ -7,9 +7,9 @@
7
7
  <meta name="referrer" content="no-referrer" />
8
8
  <title>Generated application sandbox</title>
9
9
  <style>html,body,#generated-preview{border:0;height:100%;margin:0;padding:0;width:100%}body{overflow:hidden}</style>
10
- <script type="module" crossorigin src="/assets/sandbox-CLAYkibu.js"></script>
10
+ <script type="module" crossorigin src="/assets/sandbox-bMeKqKBn.js"></script>
11
11
  <link rel="modulepreload" crossorigin href="/assets/page-workers-BUcWBF51.js">
12
- <link rel="modulepreload" crossorigin href="/assets/browser-sandbox-bridge-BRDWHeqY.js">
12
+ <link rel="modulepreload" crossorigin href="/assets/browser-sandbox-bridge-BJbQoc4f.js">
13
13
  </head>
14
14
  <body>
15
15
  <!-- The containing page is already a dedicated, credential-free origin.
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.102",
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": {