@elaraai/e3-web 0.0.0-stage → 1.0.86
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/LICENSE.md +54 -0
- package/README.md +395 -2
- package/dist/src/app.d.ts +91 -0
- package/dist/src/app.d.ts.map +1 -0
- package/dist/src/app.js +112 -0
- package/dist/src/app.js.map +1 -0
- package/dist/src/bridge/bridge.spec.d.ts +6 -0
- package/dist/src/bridge/bridge.spec.d.ts.map +1 -0
- package/dist/src/bridge/bridge.spec.js +56 -0
- package/dist/src/bridge/bridge.spec.js.map +1 -0
- package/dist/src/bridge/page.d.ts +149 -0
- package/dist/src/bridge/page.d.ts.map +1 -0
- package/dist/src/bridge/page.js +328 -0
- package/dist/src/bridge/page.js.map +1 -0
- package/dist/src/bridge/protocol.d.ts +181 -0
- package/dist/src/bridge/protocol.d.ts.map +1 -0
- package/dist/src/bridge/protocol.js +113 -0
- package/dist/src/bridge/protocol.js.map +1 -0
- package/dist/src/bridge/worker.d.ts +124 -0
- package/dist/src/bridge/worker.d.ts.map +1 -0
- package/dist/src/bridge/worker.js +185 -0
- package/dist/src/bridge/worker.js.map +1 -0
- package/dist/src/browser/bridge.page.d.ts +12 -0
- package/dist/src/browser/bridge.page.d.ts.map +1 -0
- package/dist/src/browser/bridge.page.js +79 -0
- package/dist/src/browser/bridge.page.js.map +1 -0
- package/dist/src/browser/bridge.spec.d.ts +6 -0
- package/dist/src/browser/bridge.spec.d.ts.map +1 -0
- package/dist/src/browser/bridge.spec.js +105 -0
- package/dist/src/browser/bridge.spec.js.map +1 -0
- package/dist/src/browser/bridge.worker.d.ts +6 -0
- package/dist/src/browser/bridge.worker.d.ts.map +1 -0
- package/dist/src/browser/bridge.worker.js +35 -0
- package/dist/src/browser/bridge.worker.js.map +1 -0
- package/dist/src/browser/compliance.d.ts +68 -0
- package/dist/src/browser/compliance.d.ts.map +1 -0
- package/dist/src/browser/compliance.js +30 -0
- package/dist/src/browser/compliance.js.map +1 -0
- package/dist/src/browser/compliance.page.d.ts +6 -0
- package/dist/src/browser/compliance.page.d.ts.map +1 -0
- package/dist/src/browser/compliance.page.js +204 -0
- package/dist/src/browser/compliance.page.js.map +1 -0
- package/dist/src/browser/compliance.spec.d.ts +6 -0
- package/dist/src/browser/compliance.spec.d.ts.map +1 -0
- package/dist/src/browser/compliance.spec.js +147 -0
- package/dist/src/browser/compliance.spec.js.map +1 -0
- package/dist/src/browser/e3-api-1.spec.d.ts +6 -0
- package/dist/src/browser/e3-api-1.spec.d.ts.map +1 -0
- package/dist/src/browser/e3-api-1.spec.js +12 -0
- package/dist/src/browser/e3-api-1.spec.js.map +1 -0
- package/dist/src/browser/e3-api-2.spec.d.ts +6 -0
- package/dist/src/browser/e3-api-2.spec.d.ts.map +1 -0
- package/dist/src/browser/e3-api-2.spec.js +12 -0
- package/dist/src/browser/e3-api-2.spec.js.map +1 -0
- package/dist/src/browser/e3-api-3.spec.d.ts +6 -0
- package/dist/src/browser/e3-api-3.spec.d.ts.map +1 -0
- package/dist/src/browser/e3-api-3.spec.js +12 -0
- package/dist/src/browser/e3-api-3.spec.js.map +1 -0
- package/dist/src/browser/e3-api-parts.spec.d.ts +6 -0
- package/dist/src/browser/e3-api-parts.spec.d.ts.map +1 -0
- package/dist/src/browser/e3-api-parts.spec.js +45 -0
- package/dist/src/browser/e3-api-parts.spec.js.map +1 -0
- package/dist/src/browser/e3-api.d.ts +28 -0
- package/dist/src/browser/e3-api.d.ts.map +1 -0
- package/dist/src/browser/e3-api.js +144 -0
- package/dist/src/browser/e3-api.js.map +1 -0
- package/dist/src/browser/e3-client.worker.d.ts +6 -0
- package/dist/src/browser/e3-client.worker.d.ts.map +1 -0
- package/dist/src/browser/e3-client.worker.js +19 -0
- package/dist/src/browser/e3-client.worker.js.map +1 -0
- package/dist/src/browser/e3-forward.d.ts +27 -0
- package/dist/src/browser/e3-forward.d.ts.map +1 -0
- package/dist/src/browser/e3-forward.js +81 -0
- package/dist/src/browser/e3-forward.js.map +1 -0
- package/dist/src/browser/e3-forward.spec.d.ts +6 -0
- package/dist/src/browser/e3-forward.spec.d.ts.map +1 -0
- package/dist/src/browser/e3-forward.spec.js +84 -0
- package/dist/src/browser/e3-forward.spec.js.map +1 -0
- package/dist/src/browser/e3-port.worker.d.ts +6 -0
- package/dist/src/browser/e3-port.worker.d.ts.map +1 -0
- package/dist/src/browser/e3-port.worker.js +21 -0
- package/dist/src/browser/e3-port.worker.js.map +1 -0
- package/dist/src/browser/e3-unit.worker.d.ts +6 -0
- package/dist/src/browser/e3-unit.worker.d.ts.map +1 -0
- package/dist/src/browser/e3-unit.worker.js +18 -0
- package/dist/src/browser/e3-unit.worker.js.map +1 -0
- package/dist/src/browser/e3-wire.d.ts +43 -0
- package/dist/src/browser/e3-wire.d.ts.map +1 -0
- package/dist/src/browser/e3-wire.js +32 -0
- package/dist/src/browser/e3-wire.js.map +1 -0
- package/dist/src/browser/e3.page.d.ts +21 -0
- package/dist/src/browser/e3.page.d.ts.map +1 -0
- package/dist/src/browser/e3.page.js +119 -0
- package/dist/src/browser/e3.page.js.map +1 -0
- package/dist/src/browser/e3.spec.d.ts +6 -0
- package/dist/src/browser/e3.spec.d.ts.map +1 -0
- package/dist/src/browser/e3.spec.js +358 -0
- package/dist/src/browser/e3.spec.js.map +1 -0
- package/dist/src/browser/e3.worker.d.ts +6 -0
- package/dist/src/browser/e3.worker.d.ts.map +1 -0
- package/dist/src/browser/e3.worker.js +38 -0
- package/dist/src/browser/e3.worker.js.map +1 -0
- package/dist/src/browser/harness.d.ts +175 -0
- package/dist/src/browser/harness.d.ts.map +1 -0
- package/dist/src/browser/harness.js +375 -0
- package/dist/src/browser/harness.js.map +1 -0
- package/dist/src/browser/page.d.ts +47 -0
- package/dist/src/browser/page.d.ts.map +1 -0
- package/dist/src/browser/page.js +47 -0
- package/dist/src/browser/page.js.map +1 -0
- package/dist/src/browser/repository.page.d.ts +85 -0
- package/dist/src/browser/repository.page.d.ts.map +1 -0
- package/dist/src/browser/repository.page.js +271 -0
- package/dist/src/browser/repository.page.js.map +1 -0
- package/dist/src/browser/runner.page.d.ts +6 -0
- package/dist/src/browser/runner.page.d.ts.map +1 -0
- package/dist/src/browser/runner.page.js +62 -0
- package/dist/src/browser/runner.page.js.map +1 -0
- package/dist/src/browser/runner.spec.d.ts +6 -0
- package/dist/src/browser/runner.spec.d.ts.map +1 -0
- package/dist/src/browser/runner.spec.js +46 -0
- package/dist/src/browser/runner.spec.js.map +1 -0
- package/dist/src/browser/storage.page.d.ts +6 -0
- package/dist/src/browser/storage.page.d.ts.map +1 -0
- package/dist/src/browser/storage.page.js +289 -0
- package/dist/src/browser/storage.page.js.map +1 -0
- package/dist/src/browser/storage.spec.d.ts +6 -0
- package/dist/src/browser/storage.spec.d.ts.map +1 -0
- package/dist/src/browser/storage.spec.js +211 -0
- package/dist/src/browser/storage.spec.js.map +1 -0
- package/dist/src/browser/unit.worker.d.ts +6 -0
- package/dist/src/browser/unit.worker.d.ts.map +1 -0
- package/dist/src/browser/unit.worker.js +17 -0
- package/dist/src/browser/unit.worker.js.map +1 -0
- package/dist/src/execution/WebTaskRunner.d.ts +159 -0
- package/dist/src/execution/WebTaskRunner.d.ts.map +1 -0
- package/dist/src/execution/WebTaskRunner.js +581 -0
- package/dist/src/execution/WebTaskRunner.js.map +1 -0
- package/dist/src/execution/WebTaskRunner.spec.d.ts +6 -0
- package/dist/src/execution/WebTaskRunner.spec.d.ts.map +1 -0
- package/dist/src/execution/WebTaskRunner.spec.js +91 -0
- package/dist/src/execution/WebTaskRunner.spec.js.map +1 -0
- package/dist/src/execution/e3-platform.d.ts +41 -0
- package/dist/src/execution/e3-platform.d.ts.map +1 -0
- package/dist/src/execution/e3-platform.js +52 -0
- package/dist/src/execution/e3-platform.js.map +1 -0
- package/dist/src/execution/in-process.d.ts +32 -0
- package/dist/src/execution/in-process.d.ts.map +1 -0
- package/dist/src/execution/in-process.js +89 -0
- package/dist/src/execution/in-process.js.map +1 -0
- package/dist/src/execution/pool.d.ts +172 -0
- package/dist/src/execution/pool.d.ts.map +1 -0
- package/dist/src/execution/pool.js +352 -0
- package/dist/src/execution/pool.js.map +1 -0
- package/dist/src/execution/pool.spec.d.ts +6 -0
- package/dist/src/execution/pool.spec.d.ts.map +1 -0
- package/dist/src/execution/pool.spec.js +252 -0
- package/dist/src/execution/pool.spec.js.map +1 -0
- package/dist/src/execution/protocol.d.ts +108 -0
- package/dist/src/execution/protocol.d.ts.map +1 -0
- package/dist/src/execution/protocol.js +27 -0
- package/dist/src/execution/protocol.js.map +1 -0
- package/dist/src/execution/unit-server.d.ts +131 -0
- package/dist/src/execution/unit-server.d.ts.map +1 -0
- package/dist/src/execution/unit-server.js +142 -0
- package/dist/src/execution/unit-server.js.map +1 -0
- package/dist/src/index.d.ts +39 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +37 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/index.spec.d.ts +6 -0
- package/dist/src/index.spec.d.ts.map +1 -0
- package/dist/src/index.spec.js +212 -0
- package/dist/src/index.spec.js.map +1 -0
- package/dist/src/node.d.ts +12 -0
- package/dist/src/node.d.ts.map +1 -0
- package/dist/src/node.js +12 -0
- package/dist/src/node.js.map +1 -0
- package/dist/src/storage/WebStateStore.d.ts +64 -0
- package/dist/src/storage/WebStateStore.d.ts.map +1 -0
- package/dist/src/storage/WebStateStore.js +237 -0
- package/dist/src/storage/WebStateStore.js.map +1 -0
- package/dist/src/storage/WebStorage.d.ts +225 -0
- package/dist/src/storage/WebStorage.d.ts.map +1 -0
- package/dist/src/storage/WebStorage.js +1462 -0
- package/dist/src/storage/WebStorage.js.map +1 -0
- package/dist/src/storage/adapters.d.ts +610 -0
- package/dist/src/storage/adapters.d.ts.map +1 -0
- package/dist/src/storage/adapters.js +246 -0
- package/dist/src/storage/adapters.js.map +1 -0
- package/dist/src/storage/indexeddb.d.ts +93 -0
- package/dist/src/storage/indexeddb.d.ts.map +1 -0
- package/dist/src/storage/indexeddb.js +384 -0
- package/dist/src/storage/indexeddb.js.map +1 -0
- package/dist/src/storage/indexeddb.spec.d.ts +6 -0
- package/dist/src/storage/indexeddb.spec.d.ts.map +1 -0
- package/dist/src/storage/indexeddb.spec.js +77 -0
- package/dist/src/storage/indexeddb.spec.js.map +1 -0
- package/dist/src/storage/memory.d.ts +275 -0
- package/dist/src/storage/memory.d.ts.map +1 -0
- package/dist/src/storage/memory.js +724 -0
- package/dist/src/storage/memory.js.map +1 -0
- package/dist/src/storage/memory.spec.d.ts +6 -0
- package/dist/src/storage/memory.spec.d.ts.map +1 -0
- package/dist/src/storage/memory.spec.js +71 -0
- package/dist/src/storage/memory.spec.js.map +1 -0
- package/dist/src/storage/node-files.d.ts +38 -0
- package/dist/src/storage/node-files.d.ts.map +1 -0
- package/dist/src/storage/node-files.js +148 -0
- package/dist/src/storage/node-files.js.map +1 -0
- package/dist/src/storage/node-files.spec.d.ts +6 -0
- package/dist/src/storage/node-files.spec.d.ts.map +1 -0
- package/dist/src/storage/node-files.spec.js +40 -0
- package/dist/src/storage/node-files.spec.js.map +1 -0
- package/dist/src/storage/opfs.d.ts +145 -0
- package/dist/src/storage/opfs.d.ts.map +1 -0
- package/dist/src/storage/opfs.js +514 -0
- package/dist/src/storage/opfs.js.map +1 -0
- package/dist/src/storage/opfs.spec.d.ts +6 -0
- package/dist/src/storage/opfs.spec.d.ts.map +1 -0
- package/dist/src/storage/opfs.spec.js +51 -0
- package/dist/src/storage/opfs.spec.js.map +1 -0
- package/dist/src/storage/record-keys.d.ts +78 -0
- package/dist/src/storage/record-keys.d.ts.map +1 -0
- package/dist/src/storage/record-keys.js +71 -0
- package/dist/src/storage/record-keys.js.map +1 -0
- package/dist/src/storage/stores.spec.d.ts +6 -0
- package/dist/src/storage/stores.spec.d.ts.map +1 -0
- package/dist/src/storage/stores.spec.js +326 -0
- package/dist/src/storage/stores.spec.js.map +1 -0
- package/dist/src/storage/web-locks.d.ts +103 -0
- package/dist/src/storage/web-locks.d.ts.map +1 -0
- package/dist/src/storage/web-locks.js +228 -0
- package/dist/src/storage/web-locks.js.map +1 -0
- package/dist/src/testing/adapter-contract.d.ts +116 -0
- package/dist/src/testing/adapter-contract.d.ts.map +1 -0
- package/dist/src/testing/adapter-contract.js +769 -0
- package/dist/src/testing/adapter-contract.js.map +1 -0
- package/dist/src/testing/assert.d.ts +75 -0
- package/dist/src/testing/assert.d.ts.map +1 -0
- package/dist/src/testing/assert.js +146 -0
- package/dist/src/testing/assert.js.map +1 -0
- package/dist/src/testing/assert.spec.d.ts +6 -0
- package/dist/src/testing/assert.spec.d.ts.map +1 -0
- package/dist/src/testing/assert.spec.js +62 -0
- package/dist/src/testing/assert.spec.js.map +1 -0
- package/dist/src/testing/bridge-contract.d.ts +55 -0
- package/dist/src/testing/bridge-contract.d.ts.map +1 -0
- package/dist/src/testing/bridge-contract.js +376 -0
- package/dist/src/testing/bridge-contract.js.map +1 -0
- package/dist/src/testing/bridge-handler.d.ts +35 -0
- package/dist/src/testing/bridge-handler.d.ts.map +1 -0
- package/dist/src/testing/bridge-handler.js +108 -0
- package/dist/src/testing/bridge-handler.js.map +1 -0
- package/dist/src/testing/callers.d.ts +29 -0
- package/dist/src/testing/callers.d.ts.map +1 -0
- package/dist/src/testing/callers.js +24 -0
- package/dist/src/testing/callers.js.map +1 -0
- package/dist/src/testing/e3-fixtures.d.ts +38 -0
- package/dist/src/testing/e3-fixtures.d.ts.map +1 -0
- package/dist/src/testing/e3-fixtures.js +126 -0
- package/dist/src/testing/e3-fixtures.js.map +1 -0
- package/dist/src/testing/hold-platform.d.ts +33 -0
- package/dist/src/testing/hold-platform.d.ts.map +1 -0
- package/dist/src/testing/hold-platform.js +41 -0
- package/dist/src/testing/hold-platform.js.map +1 -0
- package/dist/src/testing/runner-cases.d.ts +112 -0
- package/dist/src/testing/runner-cases.d.ts.map +1 -0
- package/dist/src/testing/runner-cases.js +959 -0
- package/dist/src/testing/runner-cases.js.map +1 -0
- package/dist/src/testing/runner-fixtures.d.ts +13 -0
- package/dist/src/testing/runner-fixtures.d.ts.map +1 -0
- package/dist/src/testing/runner-fixtures.js +173 -0
- package/dist/src/testing/runner-fixtures.js.map +1 -0
- package/dist/src/testing/test-platform.d.ts +73 -0
- package/dist/src/testing/test-platform.d.ts.map +1 -0
- package/dist/src/testing/test-platform.js +143 -0
- package/dist/src/testing/test-platform.js.map +1 -0
- package/dist/src/transfer/WebTransferBackend.d.ts +780 -0
- package/dist/src/transfer/WebTransferBackend.d.ts.map +1 -0
- package/dist/src/transfer/WebTransferBackend.js +1140 -0
- package/dist/src/transfer/WebTransferBackend.js.map +1 -0
- package/dist/src/transfer/WebTransferBackend.spec.d.ts +6 -0
- package/dist/src/transfer/WebTransferBackend.spec.d.ts.map +1 -0
- package/dist/src/transfer/WebTransferBackend.spec.js +582 -0
- package/dist/src/transfer/WebTransferBackend.spec.js.map +1 -0
- package/dist/src/transfer/endpoints.d.ts +46 -0
- package/dist/src/transfer/endpoints.d.ts.map +1 -0
- package/dist/src/transfer/endpoints.js +157 -0
- package/dist/src/transfer/endpoints.js.map +1 -0
- package/dist/src/units.d.ts +51 -0
- package/dist/src/units.d.ts.map +1 -0
- package/dist/src/units.js +74 -0
- package/dist/src/units.js.map +1 -0
- package/dist/src/worker.d.ts +126 -0
- package/dist/src/worker.d.ts.map +1 -0
- package/dist/src/worker.js +186 -0
- package/dist/src/worker.js.map +1 -0
- package/dist/src/worker.spec.d.ts +6 -0
- package/dist/src/worker.spec.d.ts.map +1 -0
- package/dist/src/worker.spec.js +195 -0
- package/dist/src/worker.spec.js.map +1 -0
- package/package.json +76 -3
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/** How many bytes are turned to characters at a time. */
|
|
6
|
+
const CHUNK = 0x8000;
|
|
7
|
+
/**
|
|
8
|
+
* Bytes as base64 text.
|
|
9
|
+
*
|
|
10
|
+
* @param bytes - The bytes
|
|
11
|
+
* @returns Their base64
|
|
12
|
+
*/
|
|
13
|
+
export function toBase64(bytes) {
|
|
14
|
+
let text = '';
|
|
15
|
+
for (let at = 0; at < bytes.length; at += CHUNK)
|
|
16
|
+
text += String.fromCharCode(...bytes.subarray(at, at + CHUNK));
|
|
17
|
+
return btoa(text);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Base64 text as bytes.
|
|
21
|
+
*
|
|
22
|
+
* @param text - The base64
|
|
23
|
+
* @returns The bytes
|
|
24
|
+
*/
|
|
25
|
+
export function fromBase64(text) {
|
|
26
|
+
const binary = atob(text);
|
|
27
|
+
const bytes = new Uint8Array(binary.length);
|
|
28
|
+
for (let at = 0; at < binary.length; at++)
|
|
29
|
+
bytes[at] = binary.charCodeAt(at);
|
|
30
|
+
return bytes;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=e3-wire.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e3-wire.js","sourceRoot":"","sources":["../../../src/browser/e3-wire.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA6BH,yDAAyD;AACzD,MAAM,KAAK,GAAG,MAAM,CAAC;AAErB;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAiB;IACxC,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,KAAK,CAAC,MAAM,EAAE,EAAE,IAAI,KAAK;QAAE,IAAI,IAAI,MAAM,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC;IAChH,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5C,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,EAAE;QAAE,KAAK,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAC7E,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/** How the page's e3 worker runs. */
|
|
6
|
+
export interface E3PageOptions {
|
|
7
|
+
/** What its storage is named after: the IndexedDB database and the OPFS
|
|
8
|
+
* directory its repositories are kept in */
|
|
9
|
+
readonly name: string;
|
|
10
|
+
/** Whether its units hold in `test_hold` until the page closes */
|
|
11
|
+
readonly hold: boolean;
|
|
12
|
+
/** The piece size its split tasks are planned with, as
|
|
13
|
+
* `E3_TEST_PIECE_BYTES` sets it, or `null` for the platform's */
|
|
14
|
+
readonly pieceBytes: number | null;
|
|
15
|
+
}
|
|
16
|
+
/** What the page's e3 says as it connects. */
|
|
17
|
+
export interface E3PageStarted {
|
|
18
|
+
readonly apiUrl: string;
|
|
19
|
+
readonly persisted: boolean;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=e3.page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e3.page.d.ts","sourceRoot":"","sources":["../../../src/browser/e3.page.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuBH,qCAAqC;AACrC,MAAM,WAAW,aAAa;IAC5B;iDAC6C;IAC7C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB;sEACkE;IAClE,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAED,8CAA8C;AAC9C,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The test page of e3-web's specs of the whole e3: a page of an app, which
|
|
7
|
+
* starts its e3 worker (`e3.worker.ts`) and connects with `createWebE3`, and
|
|
8
|
+
* answers each request Node forwards with its `e3.fetch` — so the shared API
|
|
9
|
+
* suites, run in Node, are answered by e3 in Chromium, over IndexedDB, OPFS,
|
|
10
|
+
* Web Workers and Web Locks. It also serves e3 over a `MessagePort`, from a
|
|
11
|
+
* worker of its own (`e3-port.worker.ts`), connected to by the page or by a
|
|
12
|
+
* stand-in for another page (`e3-client.worker.ts`), and says which Web Locks
|
|
13
|
+
* its origin holds.
|
|
14
|
+
*
|
|
15
|
+
* The harness bundles it for Chromium; `e3-api.spec.ts` and `e3.spec.ts`
|
|
16
|
+
* drive it.
|
|
17
|
+
*
|
|
18
|
+
* @packageDocumentation
|
|
19
|
+
*/
|
|
20
|
+
import { connectWebE3, createWebE3 } from '../bridge/page.js';
|
|
21
|
+
import { deleteIndexedDbRecords } from '../storage/indexeddb.js';
|
|
22
|
+
import { fromBase64, toBase64 } from './e3-wire.js';
|
|
23
|
+
import { servePage } from './page.js';
|
|
24
|
+
/** The page's e3, once started. */
|
|
25
|
+
let e3 = null;
|
|
26
|
+
/** The requests in flight, by the number Node gave each: what aborts each. */
|
|
27
|
+
const inFlight = new Map();
|
|
28
|
+
/** The stand-in for another page, connected to an e3 over a port. */
|
|
29
|
+
let client = null;
|
|
30
|
+
/** Starts an e3 worker that serves e3 over a port, under a storage's name, and
|
|
31
|
+
* answers the other end of the port. */
|
|
32
|
+
function servedOverPort(name) {
|
|
33
|
+
const { port1, port2 } = new MessageChannel();
|
|
34
|
+
const worker = new Worker('/e3-port-worker.js', { type: 'module' });
|
|
35
|
+
worker.postMessage({ port: port1, name }, [port1]);
|
|
36
|
+
return port2;
|
|
37
|
+
}
|
|
38
|
+
servePage({
|
|
39
|
+
/** Starts the page's e3 worker, and connects to it. */
|
|
40
|
+
async start(options) {
|
|
41
|
+
if (e3 !== null)
|
|
42
|
+
throw new Error('the page has started its e3 already');
|
|
43
|
+
const params = new URLSearchParams({ name: options.name, hold: options.hold ? '1' : '0' });
|
|
44
|
+
if (options.pieceBytes !== null)
|
|
45
|
+
params.set('pieceBytes', String(options.pieceBytes));
|
|
46
|
+
e3 = await createWebE3(new Worker(`/e3-worker.js?${params}`, { type: 'module' }));
|
|
47
|
+
return { apiUrl: e3.apiUrl, persisted: e3.persisted };
|
|
48
|
+
},
|
|
49
|
+
/** Answers a request Node forwards, with the page's `e3.fetch`. */
|
|
50
|
+
async fetch(id, request) {
|
|
51
|
+
if (e3 === null)
|
|
52
|
+
throw new Error('the page has started no e3');
|
|
53
|
+
const abort = new AbortController();
|
|
54
|
+
inFlight.set(id, abort);
|
|
55
|
+
try {
|
|
56
|
+
const response = await e3.fetch(request.url, {
|
|
57
|
+
method: request.method,
|
|
58
|
+
headers: request.headers.map(([name, value]) => [name, value]),
|
|
59
|
+
body: request.body === null ? null : fromBase64(request.body),
|
|
60
|
+
signal: abort.signal,
|
|
61
|
+
});
|
|
62
|
+
const body = new Uint8Array(await response.arrayBuffer());
|
|
63
|
+
return { status: response.status, statusText: response.statusText, headers: [...response.headers], body: toBase64(body) };
|
|
64
|
+
}
|
|
65
|
+
finally {
|
|
66
|
+
inFlight.delete(id);
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
/** Starts an e3 served over a port, and connects the page to it: holding a
|
|
70
|
+
* lifeline, unless told not to. */
|
|
71
|
+
async startOverPort(name, lifeline) {
|
|
72
|
+
if (e3 !== null)
|
|
73
|
+
throw new Error('the page has started its e3 already');
|
|
74
|
+
e3 = await connectWebE3(servedOverPort(name), { requestPersistence: false, lifeline });
|
|
75
|
+
},
|
|
76
|
+
/** Starts an e3 served over a port, and connects a stand-in for another
|
|
77
|
+
* page to it, holding its lifeline. */
|
|
78
|
+
async startClientOverPort(name) {
|
|
79
|
+
if (client !== null)
|
|
80
|
+
throw new Error('the page has started its client already');
|
|
81
|
+
const port = servedOverPort(name);
|
|
82
|
+
const started = new Worker('/e3-client-worker.js', { type: 'module' });
|
|
83
|
+
client = started;
|
|
84
|
+
const said = await new Promise((resolve) => {
|
|
85
|
+
started.onmessage = (event) => resolve(event.data);
|
|
86
|
+
started.postMessage(port, [port]);
|
|
87
|
+
});
|
|
88
|
+
if (said !== 'connected')
|
|
89
|
+
throw new Error(`the client did not connect: ${said}`);
|
|
90
|
+
},
|
|
91
|
+
/** Stops the stand-in for another page, as a tab closes: nothing is told. */
|
|
92
|
+
endClient() {
|
|
93
|
+
client?.terminate();
|
|
94
|
+
client = null;
|
|
95
|
+
},
|
|
96
|
+
/** The names of the Web Locks the page's origin holds. */
|
|
97
|
+
async locks() {
|
|
98
|
+
return ((await navigator.locks.query()).held ?? []).map((lock) => lock.name ?? '');
|
|
99
|
+
},
|
|
100
|
+
/** Gives up a request Node forwarded. */
|
|
101
|
+
abort(id) {
|
|
102
|
+
inFlight.get(id)?.abort();
|
|
103
|
+
},
|
|
104
|
+
/** Closes the page's e3 worker. */
|
|
105
|
+
close() {
|
|
106
|
+
e3?.close();
|
|
107
|
+
e3 = null;
|
|
108
|
+
},
|
|
109
|
+
/** Removes what a storage of a name kept: its IndexedDB database and its
|
|
110
|
+
* OPFS directory. */
|
|
111
|
+
async clear(name) {
|
|
112
|
+
await deleteIndexedDbRecords(name);
|
|
113
|
+
await (await navigator.storage.getDirectory()).removeEntry(name, { recursive: true }).catch((err) => {
|
|
114
|
+
if (!(err instanceof DOMException && err.name === 'NotFoundError'))
|
|
115
|
+
throw err;
|
|
116
|
+
});
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
//# sourceMappingURL=e3.page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e3.page.js","sourceRoot":"","sources":["../../../src/browser/e3.page.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAc,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAuC,MAAM,cAAc,CAAC;AACzF,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAoBtC,mCAAmC;AACnC,IAAI,EAAE,GAAiB,IAAI,CAAC;AAE5B,8EAA8E;AAC9E,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA2B,CAAC;AAEpD,qEAAqE;AACrE,IAAI,MAAM,GAAkB,IAAI,CAAC;AAEjC;yCACyC;AACzC,SAAS,cAAc,CAAC,IAAY;IAClC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI,cAAc,EAAE,CAAC;IAC9C,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACpE,MAAM,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IACnD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,CAAC;IACR,uDAAuD;IACvD,KAAK,CAAC,KAAK,CAAC,OAAsB;QAChC,IAAI,EAAE,KAAK,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACxE,MAAM,MAAM,GA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"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* e3 in Chromium, as an app's pages run it: e3's own platform functions
|
|
7
|
+
* called from a unit worker, a dataflow interrupted by closing its page, the
|
|
8
|
+
* Web Locks it holds across runs whose unit workers are terminated, what a
|
|
9
|
+
* terminated unit worker asked of it given up, and an e3 served over a port
|
|
10
|
+
* closed once its page has gone, which a browser's port does not say.
|
|
11
|
+
*
|
|
12
|
+
* Each case drives pages running e3 (`e3.page.ts`) from Node, through e3's
|
|
13
|
+
* client and a fetch forwarded into the page. The packages are exported here,
|
|
14
|
+
* in Node, with e3's SDK, and imported through e3's API, as an app imports
|
|
15
|
+
* the zip its build exported.
|
|
16
|
+
*/
|
|
17
|
+
import { after, before, describe, it } from 'node:test';
|
|
18
|
+
import assert from 'node:assert/strict';
|
|
19
|
+
import { fileURLToPath } from 'node:url';
|
|
20
|
+
import { ArrayType, East, IntegerType, NullType, OptionType, StringType, decodeBeast2For, encodeBeast2For, encodeEastIR, equalFor, none, some, variant, } from '@elaraai/east';
|
|
21
|
+
import { ApiError, Platform, dataflowExecute, dataflowExecuteLaunch, datasetGet, datasetSet, oneShotExecute, packageImport, repoCreate, taskLogs, workspaceCreate, workspaceDeploy, workspaceStatus, } from '@elaraai/e3-api-client';
|
|
22
|
+
import { ExecuteResultType, OneShotRequestType } from '@elaraai/e3-types';
|
|
23
|
+
import { assertDataflowSucceeded } from '@elaraai/e3-api-tests';
|
|
24
|
+
import { WEB_E3_ORIGIN } from '../bridge/protocol.js';
|
|
25
|
+
import { E3_PLATFORM } from '../execution/e3-platform.js';
|
|
26
|
+
import { ADMIN_TOKEN } from '../testing/callers.js';
|
|
27
|
+
import { HOLD_PLATFORM, test_hold } from '../testing/hold-platform.js';
|
|
28
|
+
import { FIXTURE_VERSION, HELD_PACKAGE, PLATFORM_PACKAGE, RowsType, buildE3Fixtures, heldOutput, heldRows, } from '../testing/e3-fixtures.js';
|
|
29
|
+
import { forwardInto } from './e3-forward.js';
|
|
30
|
+
import { Harness } from './harness.js';
|
|
31
|
+
const entries = {
|
|
32
|
+
e3: fileURLToPath(new URL('./e3.page.js', import.meta.url)),
|
|
33
|
+
'e3-worker': fileURLToPath(new URL('./e3.worker.js', import.meta.url)),
|
|
34
|
+
'e3-unit-worker': fileURLToPath(new URL('./e3-unit.worker.js', import.meta.url)),
|
|
35
|
+
'e3-port-worker': fileURLToPath(new URL('./e3-port.worker.js', import.meta.url)),
|
|
36
|
+
'e3-client-worker': fileURLToPath(new URL('./e3-client.worker.js', import.meta.url)),
|
|
37
|
+
};
|
|
38
|
+
const REPO = 'default';
|
|
39
|
+
const WORKSPACE = 'main';
|
|
40
|
+
/** The piece size the held task is planned with: each of its input's
|
|
41
|
+
* segments a piece. */
|
|
42
|
+
const PIECE_BYTES = 64;
|
|
43
|
+
/** A line the engine writes to a split task's log as a piece settles. */
|
|
44
|
+
const PIECE_LINE = /^piece (\d+)\/(\d+) (completed|cached|failed|cancelled) /;
|
|
45
|
+
/** What a split task's log says of its pieces. */
|
|
46
|
+
function piecesOf(log) {
|
|
47
|
+
let total = null;
|
|
48
|
+
const completed = [];
|
|
49
|
+
const cached = [];
|
|
50
|
+
for (const line of log.split('\n')) {
|
|
51
|
+
const match = PIECE_LINE.exec(line);
|
|
52
|
+
if (match === null)
|
|
53
|
+
continue;
|
|
54
|
+
total = Number(match[2]);
|
|
55
|
+
if (match[3] === 'completed')
|
|
56
|
+
completed.push(Number(match[1]));
|
|
57
|
+
if (match[3] === 'cached')
|
|
58
|
+
cached.push(Number(match[1]));
|
|
59
|
+
}
|
|
60
|
+
return { total, completed, cached };
|
|
61
|
+
}
|
|
62
|
+
/** Waits for a condition read through e3, failing with what it waits for. */
|
|
63
|
+
async function until(read, what, ms = 60_000) {
|
|
64
|
+
const deadline = Date.now() + ms;
|
|
65
|
+
for (;;) {
|
|
66
|
+
const found = await read();
|
|
67
|
+
if (found !== null)
|
|
68
|
+
return found;
|
|
69
|
+
if (Date.now() > deadline)
|
|
70
|
+
assert.fail(`waited ${ms / 1000} s for ${what}`);
|
|
71
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/** A task's status in a workspace's status. */
|
|
75
|
+
function taskStatus(status, task) {
|
|
76
|
+
const found = status.tasks.find((info) => info.name === task);
|
|
77
|
+
if (found === undefined)
|
|
78
|
+
assert.fail(`the workspace has no task '${task}'`);
|
|
79
|
+
return found.status;
|
|
80
|
+
}
|
|
81
|
+
const sameRows = equalFor(RowsType);
|
|
82
|
+
const samePid = equalFor(OptionType(IntegerType));
|
|
83
|
+
/** A one-shot's program that holds its unit worker's thread, in a page whose
|
|
84
|
+
* units hold. */
|
|
85
|
+
const holding = East.function([], NullType, ($) => {
|
|
86
|
+
$(test_hold());
|
|
87
|
+
});
|
|
88
|
+
/** A one-shot's program that reaches the e3 it runs in — its unit worker
|
|
89
|
+
* connects to it — and then holds its unit worker's thread. */
|
|
90
|
+
const connectedHolding = East.asyncFunction([], NullType, ($) => {
|
|
91
|
+
$(Platform.workspaceList(WEB_E3_ORIGIN, REPO, ADMIN_TOKEN));
|
|
92
|
+
$(test_hold());
|
|
93
|
+
});
|
|
94
|
+
/** A one-shot's program that reaches the e3 it runs in, and answers. */
|
|
95
|
+
const connectedAnswering = East.asyncFunction([], IntegerType, ($) => {
|
|
96
|
+
$(Platform.workspaceList(WEB_E3_ORIGIN, REPO, ADMIN_TOKEN));
|
|
97
|
+
return 1n;
|
|
98
|
+
});
|
|
99
|
+
/** A one-shot's program that asks the e3 it runs in for a one-shot, through
|
|
100
|
+
* e3's own platform functions, and answers what it answered. */
|
|
101
|
+
const asking = East.asyncFunction([OneShotRequestType], ExecuteResultType, ($, request) => Platform.oneShotExecute(WEB_E3_ORIGIN, REPO, WORKSPACE, request, ADMIN_TOKEN));
|
|
102
|
+
/** A runner given platform packages. */
|
|
103
|
+
function runnerWith(...platforms) {
|
|
104
|
+
return variant('east_node', { platforms, decode: variant('lazy', null) });
|
|
105
|
+
}
|
|
106
|
+
/** A one-shot's limits: a timeout, and the rest as the e3's defaults. */
|
|
107
|
+
function timeout(ms) {
|
|
108
|
+
return some({ timeoutMs: some(BigInt(ms)), maxResultBytes: none, maxLogBytes: none });
|
|
109
|
+
}
|
|
110
|
+
/** The Web Locks a page's origin holds, by name. */
|
|
111
|
+
function heldLocks(page) {
|
|
112
|
+
return page.call('locks');
|
|
113
|
+
}
|
|
114
|
+
/** The lifelines among locks: a unit worker's, or a worker's of `e3.fetch`. */
|
|
115
|
+
function lifelines(locks, of) {
|
|
116
|
+
return locks.filter((name) => name.startsWith(`e3-web:${of}:`));
|
|
117
|
+
}
|
|
118
|
+
/** The session locks of a storage's name among locks. */
|
|
119
|
+
function sessions(locks, name) {
|
|
120
|
+
return locks.filter((lock) => lock.startsWith(`${name}:session:`));
|
|
121
|
+
}
|
|
122
|
+
/** Asserts a page has raised nothing since it opened, a call's answer saying
|
|
123
|
+
* so or not. */
|
|
124
|
+
function raisedNothing(page) {
|
|
125
|
+
assert.deepEqual(page.raisedErrors.map((error) => error.stack ?? error.message), [], 'the page raised nothing');
|
|
126
|
+
}
|
|
127
|
+
describe('e3 in Chromium, as an app\'s pages run it', () => {
|
|
128
|
+
let harness;
|
|
129
|
+
let fixtures;
|
|
130
|
+
/** The storages the cases kept, removed once they have run */
|
|
131
|
+
const names = [];
|
|
132
|
+
before(async () => {
|
|
133
|
+
fixtures = await buildE3Fixtures();
|
|
134
|
+
harness = await Harness.open({ entries });
|
|
135
|
+
});
|
|
136
|
+
after(async () => {
|
|
137
|
+
try {
|
|
138
|
+
// Every page that ran e3 is closed by now, and its connections with it.
|
|
139
|
+
if (harness !== undefined && names.length > 0) {
|
|
140
|
+
const cleaner = await harness.newPage('e3');
|
|
141
|
+
for (const name of names)
|
|
142
|
+
await cleaner.call('clear', name);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
finally {
|
|
146
|
+
await harness?.close();
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
/** Opens a page whose e3 keeps its repositories under a name. */
|
|
150
|
+
async function openE3(name, hold) {
|
|
151
|
+
if (!names.includes(name))
|
|
152
|
+
names.push(name);
|
|
153
|
+
const page = await harness.newPage('e3');
|
|
154
|
+
const options = { name, hold, pieceBytes: PIECE_BYTES };
|
|
155
|
+
await page.call('start', options);
|
|
156
|
+
return { page, opts: { token: ADMIN_TOKEN, fetch: forwardInto(page) } };
|
|
157
|
+
}
|
|
158
|
+
/** Makes the repository and the workspace, and deploys a package to it. */
|
|
159
|
+
async function deploy(opts, zip, pkg) {
|
|
160
|
+
await repoCreate(WEB_E3_ORIGIN, REPO, opts);
|
|
161
|
+
await packageImport(WEB_E3_ORIGIN, REPO, zip, opts);
|
|
162
|
+
await workspaceCreate(WEB_E3_ORIGIN, REPO, WORKSPACE, opts);
|
|
163
|
+
await workspaceDeploy(WEB_E3_ORIGIN, REPO, WORKSPACE, `${pkg}@${FIXTURE_VERSION}`, opts);
|
|
164
|
+
}
|
|
165
|
+
it('runs e3\'s own platform functions in a unit worker: Platform.workspaceList lists the workspaces of the e3 in its page', async () => {
|
|
166
|
+
const { page, opts } = await openE3(`e3-web-platform-${crypto.randomUUID()}`, false);
|
|
167
|
+
try {
|
|
168
|
+
await deploy(opts, fixtures.platform, PLATFORM_PACKAGE);
|
|
169
|
+
await workspaceCreate(WEB_E3_ORIGIN, REPO, 'other', opts);
|
|
170
|
+
await datasetSet(WEB_E3_ORIGIN, REPO, WORKSPACE, [variant('field', 'inputs'), variant('field', 'repo')], encodeBeast2For(StringType)(REPO), opts);
|
|
171
|
+
assertDataflowSucceeded(await dataflowExecute(WEB_E3_ORIGIN, REPO, WORKSPACE, {}, opts));
|
|
172
|
+
const { data } = await datasetGet(WEB_E3_ORIGIN, REPO, WORKSPACE, [variant('field', 'tasks'), variant('field', 'workspaces'), variant('field', 'output')], opts);
|
|
173
|
+
assert.deepEqual(decodeBeast2For(ArrayType(StringType))(data), [WORKSPACE, 'other'], 'the workspaces of the e3 the unit runs in');
|
|
174
|
+
raisedNothing(page);
|
|
175
|
+
}
|
|
176
|
+
finally {
|
|
177
|
+
// Closing the tab stops its e3 worker, and its units with it.
|
|
178
|
+
await page.close();
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
it('reports a dataflow interrupted by closing its page as the local server reports a run whose process died, and serves a new run the pieces that finished from the execution cache', async () => {
|
|
182
|
+
const name = `e3-web-interrupted-${crypto.randomUUID()}`;
|
|
183
|
+
const rowsPath = [variant('field', 'inputs'), variant('field', 'rows')];
|
|
184
|
+
const outputPath = [variant('field', 'tasks'), variant('field', 'held'), variant('field', 'output')];
|
|
185
|
+
// The first page runs the dataflow: every piece of the held task but its
|
|
186
|
+
// last, which holds its unit worker, finishes. Then the page closes.
|
|
187
|
+
const first = await openE3(name, true);
|
|
188
|
+
let total;
|
|
189
|
+
try {
|
|
190
|
+
await deploy(first.opts, fixtures.held, HELD_PACKAGE);
|
|
191
|
+
await datasetSet(WEB_E3_ORIGIN, REPO, WORKSPACE, rowsPath, encodeBeast2For(RowsType)(heldRows()), first.opts);
|
|
192
|
+
await dataflowExecuteLaunch(WEB_E3_ORIGIN, REPO, WORKSPACE, {}, first.opts);
|
|
193
|
+
const ran = await until(async () => {
|
|
194
|
+
let log;
|
|
195
|
+
try {
|
|
196
|
+
log = (await taskLogs(WEB_E3_ORIGIN, REPO, WORKSPACE, 'held', { stream: 'stdout' }, first.opts)).data;
|
|
197
|
+
}
|
|
198
|
+
catch (err) {
|
|
199
|
+
// Asked before the run has recorded the task's execution.
|
|
200
|
+
if (err instanceof ApiError && err.code === 'execution_not_found')
|
|
201
|
+
return null;
|
|
202
|
+
throw err;
|
|
203
|
+
}
|
|
204
|
+
const pieces = piecesOf(log);
|
|
205
|
+
return pieces.total !== null && pieces.completed.length === pieces.total - 1 ? pieces : null;
|
|
206
|
+
}, 'every piece of the held task but the one that holds to finish');
|
|
207
|
+
total = ran.total;
|
|
208
|
+
assert.ok(total > 1, `the held task was split into pieces: ${total}`);
|
|
209
|
+
assert.deepEqual([...ran.completed].sort((a, b) => a - b), Array.from({ length: total - 1 }, (_, i) => i + 1), 'the pieces that finished are every one but the last, which holds');
|
|
210
|
+
// While its page lives, the task is in progress, under the tab's pid, 0.
|
|
211
|
+
const running = taskStatus(await workspaceStatus(WEB_E3_ORIGIN, REPO, WORKSPACE, first.opts), 'held');
|
|
212
|
+
if (running.type !== 'in-progress')
|
|
213
|
+
assert.fail(`the running task is in progress while its page lives, not ${running.type}`);
|
|
214
|
+
assert.ok(samePid(running.value.pid, some(0n)), 'under the tab\'s pid, 0');
|
|
215
|
+
raisedNothing(first.page);
|
|
216
|
+
}
|
|
217
|
+
finally {
|
|
218
|
+
// As a tab closes: its e3 worker and its unit workers stop, mid-run.
|
|
219
|
+
await first.page.close();
|
|
220
|
+
}
|
|
221
|
+
// The next page reports it as the local server reports a task whose
|
|
222
|
+
// process died: stale-running, under the pid it was recorded with — a
|
|
223
|
+
// tab's, 0 — and nothing holds the workspace.
|
|
224
|
+
const second = await openE3(name, false);
|
|
225
|
+
try {
|
|
226
|
+
const stale = await until(async () => {
|
|
227
|
+
const status = await workspaceStatus(WEB_E3_ORIGIN, REPO, WORKSPACE, second.opts);
|
|
228
|
+
return taskStatus(status, 'held').type === 'stale-running' ? status : null;
|
|
229
|
+
}, 'the next page to report the held task stale-running');
|
|
230
|
+
const held = taskStatus(stale, 'held');
|
|
231
|
+
assert.ok(held.type === 'stale-running' && samePid(held.value.pid, some(0n)), 'recorded under a tab\'s pid, 0');
|
|
232
|
+
assert.equal(stale.lock.type, 'none', 'nothing holds the workspace');
|
|
233
|
+
// A new run is served the pieces that finished from the execution cache,
|
|
234
|
+
// and runs the one that did not.
|
|
235
|
+
assertDataflowSucceeded(await dataflowExecute(WEB_E3_ORIGIN, REPO, WORKSPACE, {}, second.opts));
|
|
236
|
+
const rerun = piecesOf((await taskLogs(WEB_E3_ORIGIN, REPO, WORKSPACE, 'held', { stream: 'stdout' }, second.opts)).data);
|
|
237
|
+
assert.equal(rerun.total, total, 'the new run planned the same pieces');
|
|
238
|
+
assert.deepEqual([...rerun.cached].sort((a, b) => a - b), Array.from({ length: total - 1 }, (_, i) => i + 1), 'the pieces that finished are served from the execution cache');
|
|
239
|
+
assert.deepEqual(rerun.completed, [total], 'the piece that was running runs again, alone');
|
|
240
|
+
const { data } = await datasetGet(WEB_E3_ORIGIN, REPO, WORKSPACE, outputPath, second.opts);
|
|
241
|
+
assert.ok(sameRows(decodeBeast2For(RowsType)(data), heldOutput()), 'the task\'s output is every amount doubled');
|
|
242
|
+
raisedNothing(second.page);
|
|
243
|
+
}
|
|
244
|
+
finally {
|
|
245
|
+
await second.page.close();
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
it('holds a bounded set of Web Locks across runs whose unit workers the pool terminates', async () => {
|
|
249
|
+
const { page, opts } = await openE3(`e3-web-locks-${crypto.randomUUID()}`, true);
|
|
250
|
+
try {
|
|
251
|
+
await deploy(opts, fixtures.platform, PLATFORM_PACKAGE);
|
|
252
|
+
// Each run's unit worker connects to the e3, over the port it was
|
|
253
|
+
// handed, and holds until its timeout terminates it.
|
|
254
|
+
const held = {
|
|
255
|
+
bodyIr: encodeEastIR(connectedHolding.toIR()),
|
|
256
|
+
args: [],
|
|
257
|
+
runner: runnerWith(E3_PLATFORM, HOLD_PLATFORM),
|
|
258
|
+
limits: timeout(1_000),
|
|
259
|
+
};
|
|
260
|
+
let first = null;
|
|
261
|
+
for (let run = 1; run <= 6; run++) {
|
|
262
|
+
const result = await oneShotExecute(WEB_E3_ORIGIN, REPO, WORKSPACE, held, opts);
|
|
263
|
+
assert.equal(result.outcome.type, 'timed_out', `run ${run} held its unit worker past its timeout, which terminated it: ${result.stderr}`);
|
|
264
|
+
// Its worker is gone once the browser has freed the worker's lifeline.
|
|
265
|
+
const locks = await until(async () => {
|
|
266
|
+
const now = await heldLocks(page);
|
|
267
|
+
return lifelines(now, 'unit').length === 0 ? now : null;
|
|
268
|
+
}, `run ${run}'s unit worker to have gone`);
|
|
269
|
+
assert.equal(lifelines(locks, 'worker').length, 1, `after run ${run}, one worker of e3.fetch holds a lifeline — the page's e3 worker — and no port a unit worker was handed: ${locks.join(', ')}`);
|
|
270
|
+
first ??= [...locks].sort();
|
|
271
|
+
assert.deepEqual([...locks].sort(), first, `after run ${run}, the origin holds the locks it held after the first`);
|
|
272
|
+
}
|
|
273
|
+
// A unit worker that finishes stays, idle, connected to the e3: its port
|
|
274
|
+
// holds no lifeline either.
|
|
275
|
+
const quick = { bodyIr: encodeEastIR(connectedAnswering.toIR()), args: [], runner: runnerWith(E3_PLATFORM), limits: none };
|
|
276
|
+
const answered = await oneShotExecute(WEB_E3_ORIGIN, REPO, WORKSPACE, quick, opts);
|
|
277
|
+
assert.equal(answered.outcome.type, 'success', answered.stderr);
|
|
278
|
+
const idle = await heldLocks(page);
|
|
279
|
+
assert.equal(lifelines(idle, 'unit').length, 1, `a unit worker is idle: ${idle.join(', ')}`);
|
|
280
|
+
assert.equal(lifelines(idle, 'worker').length, 1, `and only the page's e3 worker holds a lifeline of e3.fetch: ${idle.join(', ')}`);
|
|
281
|
+
raisedNothing(page);
|
|
282
|
+
}
|
|
283
|
+
finally {
|
|
284
|
+
await page.close();
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
it('gives up, in the e3, what a unit worker the pool terminated was asking of it: the one-shot it was waiting on stops', async () => {
|
|
288
|
+
const { page, opts } = await openE3(`e3-web-abandoned-${crypto.randomUUID()}`, true);
|
|
289
|
+
try {
|
|
290
|
+
await deploy(opts, fixtures.platform, PLATFORM_PACKAGE);
|
|
291
|
+
assert.deepEqual(lifelines(await heldLocks(page), 'unit'), [], 'no unit worker runs yet');
|
|
292
|
+
// The inner one-shot holds its unit worker, for longer than the case
|
|
293
|
+
// waits; the outer one waits on it, and runs past its own timeout.
|
|
294
|
+
const inner = { bodyIr: encodeEastIR(holding.toIR()), args: [], runner: runnerWith(HOLD_PLATFORM), limits: timeout(120_000) };
|
|
295
|
+
const outer = {
|
|
296
|
+
bodyIr: encodeEastIR(asking.toIR()),
|
|
297
|
+
args: [variant('value', encodeBeast2For(OneShotRequestType)(inner))],
|
|
298
|
+
runner: runnerWith(E3_PLATFORM),
|
|
299
|
+
limits: timeout(3_000),
|
|
300
|
+
};
|
|
301
|
+
const asked = oneShotExecute(WEB_E3_ORIGIN, REPO, WORKSPACE, outer, opts);
|
|
302
|
+
// An outer call that ends before both run says why.
|
|
303
|
+
let early = null;
|
|
304
|
+
void asked.then((ended) => {
|
|
305
|
+
early = `${ended.outcome.type}: ${ended.stderr}`;
|
|
306
|
+
}, (err) => {
|
|
307
|
+
early = `rejected: ${err instanceof Error ? err.message : String(err)}`;
|
|
308
|
+
});
|
|
309
|
+
await until(async () => {
|
|
310
|
+
const locks = await heldLocks(page);
|
|
311
|
+
if (lifelines(locks, 'unit').length === 2)
|
|
312
|
+
return true;
|
|
313
|
+
if (early !== null)
|
|
314
|
+
assert.fail(`the unit that asks ended before the one it asked for ran: ${early} (locks: ${locks.join(', ')})`);
|
|
315
|
+
return null;
|
|
316
|
+
}, 'the unit that asks, and the one it asked for, to run');
|
|
317
|
+
const result = await asked;
|
|
318
|
+
assert.equal(result.outcome.type, 'timed_out', 'the unit that asked ran past its timeout, and its worker was terminated');
|
|
319
|
+
await until(async () => (lifelines(await heldLocks(page), 'unit').length === 0 ? true : null), 'the one-shot the terminated unit asked for to stop, its worker terminated', 30_000);
|
|
320
|
+
raisedNothing(page);
|
|
321
|
+
}
|
|
322
|
+
finally {
|
|
323
|
+
await page.close();
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
it('closes an e3 served over a port once its page closes its connection, as the page tells it, which a browser\'s port does not say: its session is freed', async () => {
|
|
327
|
+
const name = `e3-web-port-${crypto.randomUUID()}`;
|
|
328
|
+
names.push(name);
|
|
329
|
+
const page = await harness.newPage('e3');
|
|
330
|
+
try {
|
|
331
|
+
// With no lifeline, only the page's word closes the e3.
|
|
332
|
+
await page.call('startOverPort', name, false);
|
|
333
|
+
assert.equal(sessions(await heldLocks(page), name).length, 1, 'the e3 holds its session');
|
|
334
|
+
await page.call('close');
|
|
335
|
+
await until(async () => (sessions(await heldLocks(page), name).length === 0 ? true : null), 'the e3 to close, freeing its session', 30_000);
|
|
336
|
+
raisedNothing(page);
|
|
337
|
+
}
|
|
338
|
+
finally {
|
|
339
|
+
await page.close();
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
it('closes an e3 served over a port once the page connected over it has gone, which nothing says: its session is freed', async () => {
|
|
343
|
+
const name = `e3-web-gone-${crypto.randomUUID()}`;
|
|
344
|
+
names.push(name);
|
|
345
|
+
const page = await harness.newPage('e3');
|
|
346
|
+
try {
|
|
347
|
+
await page.call('startClientOverPort', name);
|
|
348
|
+
assert.equal(sessions(await heldLocks(page), name).length, 1, 'the e3 holds its session');
|
|
349
|
+
await page.call('endClient');
|
|
350
|
+
await until(async () => (sessions(await heldLocks(page), name).length === 0 ? true : null), 'the e3 to close, freeing its session', 30_000);
|
|
351
|
+
raisedNothing(page);
|
|
352
|
+
}
|
|
353
|
+
finally {
|
|
354
|
+
await page.close();
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
});
|
|
358
|
+
//# sourceMappingURL=e3.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e3.spec.js","sourceRoot":"","sources":["../../../src/browser/e3.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,a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CAAC,CAAC,QAAQ,CAAC,MAAM,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,sCAAsC,EAAE,MAAM,CAAC,CAAC;YAC5I,aAAa,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC;gBAAS,CAAC;YACT,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QACrB,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e3.worker.d.ts","sourceRoot":"","sources":["../../../src/browser/e3.worker.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The e3 worker the specs' e3 page starts: `serveE3`, as an app's e3 worker
|
|
7
|
+
* script calls it, over persisted repositories of the name its URL gives,
|
|
8
|
+
* with the specs' callers known by their tokens and granted by their roles.
|
|
9
|
+
* Its unit workers run `e3-unit.worker.ts`, holding when its URL says.
|
|
10
|
+
*
|
|
11
|
+
* Small upload parts, no commit wait and small export rounds, as the local
|
|
12
|
+
* server's compliance run has, so the suites' uploads go through the
|
|
13
|
+
* protocol's multi-part path and a polled commit, and an export resumes from
|
|
14
|
+
* its checkpoint round after round. A piece size its URL gives is the one
|
|
15
|
+
* split tasks are planned with, as `E3_TEST_PIECE_BYTES` sets the local
|
|
16
|
+
* runner's.
|
|
17
|
+
*
|
|
18
|
+
* The harness bundles it for Chromium; `e3.page.ts` starts it.
|
|
19
|
+
*
|
|
20
|
+
* @packageDocumentation
|
|
21
|
+
*/
|
|
22
|
+
import { readTestPieceBytesFrom } from '@elaraai/e3-core/portable';
|
|
23
|
+
import { identifyCaller } from '../testing/callers.js';
|
|
24
|
+
import { oneShotAccessByRoles, serveE3 } from '../worker.js';
|
|
25
|
+
const params = new URL(self.location.href).searchParams;
|
|
26
|
+
const pieceBytes = params.get('pieceBytes') ?? undefined;
|
|
27
|
+
readTestPieceBytesFrom(() => pieceBytes);
|
|
28
|
+
const hold = params.get('hold') === '1' ? '1' : '0';
|
|
29
|
+
serveE3({
|
|
30
|
+
units: () => new Worker(`/e3-unit-worker.js?hold=${hold}`, { type: 'module' }),
|
|
31
|
+
name: params.get('name') ?? 'e3',
|
|
32
|
+
identify: identifyCaller,
|
|
33
|
+
access: oneShotAccessByRoles(),
|
|
34
|
+
transferPartBytes: 256 * 1024,
|
|
35
|
+
transferCommitWaitMs: 0,
|
|
36
|
+
transferExportRoundBytes: 64 * 1024,
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=e3.worker.js.map
|