@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 @@
|
|
|
1
|
+
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../src/browser/page.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH,gDAAgD;AAChD,MAAM,CAAC,MAAM,MAAM,GAAG,gBAAgB,CAAC;AAevC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,SAAS,CAAC,SAAiD;IACzE,MAAM,MAAM,GAAe;QACzB,KAAK,EAAE,IAAI;QACX,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI;YACnB,MAAM,EAAE,GAAG,SAAS,CAAC,IAAI,CAA2D,CAAC;YACrF,IAAI,EAAE,KAAK,SAAS;gBAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,IAAI,GAAG,CAAC,CAAC;YAC/E,OAAO,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QAC3B,CAAC;KACF,CAAC;IACD,UAAsC,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
import { type LogChunk } from '@elaraai/e3-core/portable';
|
|
6
|
+
/**
|
|
7
|
+
* What {@link writeRepository} wrote: the objects' hashes, and the ids and
|
|
8
|
+
* the revision it minted.
|
|
9
|
+
*/
|
|
10
|
+
export interface Written {
|
|
11
|
+
/** The greeting, an object a package and an execution name */
|
|
12
|
+
readonly value: string;
|
|
13
|
+
/** The package object, which a package ref names */
|
|
14
|
+
readonly pkg: string;
|
|
15
|
+
/** An object nothing names */
|
|
16
|
+
readonly orphan: string;
|
|
17
|
+
/** The execution attempt's id */
|
|
18
|
+
readonly executionId: string;
|
|
19
|
+
/** The run whose state was written */
|
|
20
|
+
readonly runId: string;
|
|
21
|
+
/** The revision the dataset ref's write minted */
|
|
22
|
+
readonly revision: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* What {@link readRepository} reads of what {@link writeRepository} wrote,
|
|
26
|
+
* each East value compared, in the page, with what was written.
|
|
27
|
+
*/
|
|
28
|
+
export interface RepositoryRead {
|
|
29
|
+
readonly repositories: string[];
|
|
30
|
+
readonly status: string | null;
|
|
31
|
+
/** Whether the repository opens naming this release */
|
|
32
|
+
readonly release: boolean;
|
|
33
|
+
readonly greeting: string;
|
|
34
|
+
/** Bytes 3 to 9 of the object nothing names */
|
|
35
|
+
readonly range: string;
|
|
36
|
+
readonly size: number;
|
|
37
|
+
readonly objects: string[];
|
|
38
|
+
readonly packages: string[];
|
|
39
|
+
readonly resolved: string | null;
|
|
40
|
+
readonly workspaces: string[];
|
|
41
|
+
/** Whether the dataset ref, and its revision, are the ones written */
|
|
42
|
+
readonly dataset: boolean;
|
|
43
|
+
/** Whether the execution attempt is the one written */
|
|
44
|
+
readonly execution: boolean;
|
|
45
|
+
/** A window of the attempt's log that a split character bounds */
|
|
46
|
+
readonly log: LogChunk;
|
|
47
|
+
readonly run: {
|
|
48
|
+
readonly id: string;
|
|
49
|
+
readonly status: string;
|
|
50
|
+
} | null;
|
|
51
|
+
}
|
|
52
|
+
/** What gc did, and which objects it left. */
|
|
53
|
+
export interface Collected {
|
|
54
|
+
readonly deletedObjects: number;
|
|
55
|
+
readonly retainedObjects: number;
|
|
56
|
+
readonly deletedPartials: number;
|
|
57
|
+
readonly exists: {
|
|
58
|
+
readonly value: boolean;
|
|
59
|
+
readonly pkg: boolean;
|
|
60
|
+
readonly orphan: boolean;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/** A workspace's lock as a page sees it. */
|
|
64
|
+
export interface LockSeen {
|
|
65
|
+
/** Its holder, by the session the state names, while one holds it */
|
|
66
|
+
readonly holder: {
|
|
67
|
+
readonly operation: string;
|
|
68
|
+
readonly session: string | null;
|
|
69
|
+
readonly alive: boolean;
|
|
70
|
+
} | null;
|
|
71
|
+
/** Whether what the holder reported is the deploy's progress */
|
|
72
|
+
readonly progress: boolean | null;
|
|
73
|
+
/** Whether a state of the lock is recorded, whoever's it was */
|
|
74
|
+
readonly recorded: boolean;
|
|
75
|
+
}
|
|
76
|
+
/** What a storage refused at its opening left of itself. */
|
|
77
|
+
export interface Refused {
|
|
78
|
+
/** The refusal's message, or `null` when the storage opened */
|
|
79
|
+
readonly refusal: string | null;
|
|
80
|
+
/** Whether the storage's IndexedDB database is there */
|
|
81
|
+
readonly database: boolean;
|
|
82
|
+
/** Whether the storage's OPFS directory is there */
|
|
83
|
+
readonly directory: boolean;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=repository.page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.page.d.ts","sourceRoot":"","sources":["../../../src/browser/repository.page.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA4BH,OAAO,EAAgF,KAAK,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAuDxI;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,oDAAoD;IACpD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,8BAA8B;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,iCAAiC;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,sCAAsC;IACtC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,kDAAkD;IAClD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,uDAAuD;IACvD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,+CAA+C;IAC/C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,CAAC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WAAW,OAAO;IACtB,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,wDAAwD;IACxD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,oDAAoD;IACpD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B"}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The repository specs' test page: e3's storage over IndexedDB, OPFS and Web
|
|
7
|
+
* Locks, through `WebStorage`'s stores and `WebStateStore` — a repository one
|
|
8
|
+
* page writes, read again after a reload and by another page, and collected;
|
|
9
|
+
* a workspace's lock as another page sees it, while its holder lives and once
|
|
10
|
+
* its page has closed; a repository kept in memory, which a reload empties;
|
|
11
|
+
* and a persisted storage refused in a page without an API it needs.
|
|
12
|
+
*
|
|
13
|
+
* The harness bundles it for Chromium; `storage.spec.ts` drives it.
|
|
14
|
+
*
|
|
15
|
+
* @packageDocumentation
|
|
16
|
+
*/
|
|
17
|
+
import { StringType, decodeBeast2For, encodeBeast2For, equalFor, none, some, variant } from '@elaraai/east';
|
|
18
|
+
import { DatasetRefType, E3_RELEASE, ExecutionStatusType, LockProgressType, PackageObjectType, WorkspaceRecordType, dataflowForce, } from '@elaraai/e3-types';
|
|
19
|
+
import { repoGc, repositoryOpen, uuidv7 } from '@elaraai/e3-core/portable';
|
|
20
|
+
import { WebStateStore } from '../storage/WebStateStore.js';
|
|
21
|
+
import { openWebStorage, recordKeys } from '../storage/WebStorage.js';
|
|
22
|
+
import { sessionLockName } from '../storage/web-locks.js';
|
|
23
|
+
import { servePage } from './page.js';
|
|
24
|
+
/** The repository the cases write. */
|
|
25
|
+
const REPO = 'default';
|
|
26
|
+
/** The workspace the cases write, and lock. */
|
|
27
|
+
const WORKSPACE = 'main';
|
|
28
|
+
/** The dataset path the workspace's one ref is at. */
|
|
29
|
+
const GREETING = 'inputs/greeting';
|
|
30
|
+
const TASK = 'a'.repeat(64);
|
|
31
|
+
const INPUTS = 'b'.repeat(64);
|
|
32
|
+
const AT = new Date('2026-10-01T00:00:00.000Z');
|
|
33
|
+
const encoder = new TextEncoder();
|
|
34
|
+
const decoder = new TextDecoder();
|
|
35
|
+
const encodeText = encodeBeast2For(StringType);
|
|
36
|
+
const decodeText = decodeBeast2For(StringType);
|
|
37
|
+
/** The ref of the workspace's one dataset: the greeting, at its own version. */
|
|
38
|
+
function greetingRef(value) {
|
|
39
|
+
return variant('value', { hash: value, versions: new Map([[GREETING, value]]) });
|
|
40
|
+
}
|
|
41
|
+
/** The success recorded of the task over its inputs, which wrote `output`. */
|
|
42
|
+
function succeeded(executionId, output) {
|
|
43
|
+
return variant('success', {
|
|
44
|
+
executionId, inputHashes: [], outputHash: output, startedAt: AT, completedAt: AT, peakBytes: some(1024n), plan: none, unit: false,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/** A run of the workspace's one task, under way. */
|
|
48
|
+
function runState(id) {
|
|
49
|
+
return {
|
|
50
|
+
release: E3_RELEASE, id, repo: REPO, workspace: WORKSPACE, startedAt: AT, force: dataflowForce(false), filter: none,
|
|
51
|
+
graph: none, graphHash: none,
|
|
52
|
+
tasks: new Map([['greet', {
|
|
53
|
+
name: 'greet', status: 'pending', cached: none, outputHash: none, error: none, exitCode: none,
|
|
54
|
+
startedAt: none, completedAt: none, duration: none, plan: none, execution: none,
|
|
55
|
+
}]]),
|
|
56
|
+
executed: 0n, cached: 0n, failed: 0n, skipped: 0n, status: 'running', completedAt: none, error: none,
|
|
57
|
+
versionVectors: new Map(), inputSnapshot: new Map(), taskOutputPaths: [], reexecuted: 0n, events: [], eventSeq: 0n,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/** What a deploy holding the workspace reports. */
|
|
61
|
+
const PROGRESS = variant('deployment', {
|
|
62
|
+
package: { name: 'greeting', version: '1.0.0' },
|
|
63
|
+
startedAt: AT,
|
|
64
|
+
files: [],
|
|
65
|
+
records: [],
|
|
66
|
+
});
|
|
67
|
+
/** The storage, and the hold, of a page holding the workspace's lock until
|
|
68
|
+
* it closes. */
|
|
69
|
+
let holding;
|
|
70
|
+
/** The storage this page opened with `persist: false`, while it lives. */
|
|
71
|
+
let memory;
|
|
72
|
+
/** Runs `use` over the storage of a name, closed once it has run. */
|
|
73
|
+
async function withStorage(name, use) {
|
|
74
|
+
const storage = await openWebStorage({ name });
|
|
75
|
+
try {
|
|
76
|
+
return await use(storage);
|
|
77
|
+
}
|
|
78
|
+
finally {
|
|
79
|
+
await storage.close();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/** Whether the origin's OPFS root holds a directory of a name. */
|
|
83
|
+
async function opfsHas(name) {
|
|
84
|
+
try {
|
|
85
|
+
await (await navigator.storage.getDirectory()).getDirectoryHandle(name);
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
if (err instanceof DOMException && err.name === 'NotFoundError')
|
|
90
|
+
return false;
|
|
91
|
+
throw err;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
servePage({
|
|
95
|
+
/** Writes a repository through the stores: objects, refs, a dataset ref, an
|
|
96
|
+
* execution with its log, and a run's state. */
|
|
97
|
+
writeRepository(name) {
|
|
98
|
+
return withStorage(name, async (storage) => {
|
|
99
|
+
await storage.repos.create(REPO);
|
|
100
|
+
const value = await storage.objects.write(REPO, encodeText('hello from a page'));
|
|
101
|
+
const pkg = await storage.objects.write(REPO, encodeBeast2For(PackageObjectType)({
|
|
102
|
+
tasks: new Map(),
|
|
103
|
+
data: { structure: variant('struct', new Map()), refs: new Map([[GREETING, variant('value', { hash: value, versions: new Map() })]]) },
|
|
104
|
+
functions: new Map(), records: new Map(), sources: new Map(),
|
|
105
|
+
}));
|
|
106
|
+
await storage.refs.packageWrite(REPO, 'greeting', '1.0.0', pkg);
|
|
107
|
+
const orphan = await storage.objects.write(REPO, encoder.encode('an object nothing names'));
|
|
108
|
+
await storage.refs.workspaceWrite(REPO, WORKSPACE, encodeBeast2For(WorkspaceRecordType)(none));
|
|
109
|
+
const { revision } = await storage.datasets.writeIf(REPO, WORKSPACE, GREETING, greetingRef(value), null);
|
|
110
|
+
const executionId = uuidv7();
|
|
111
|
+
await storage.refs.executionWrite(REPO, TASK, INPUTS, executionId, succeeded(executionId, value));
|
|
112
|
+
// 'a' is one byte in UTF-8, 'é' two, '€' three and 'b' one.
|
|
113
|
+
await storage.logs.append(REPO, TASK, INPUTS, executionId, 'stdout', 'aé');
|
|
114
|
+
await storage.logs.append(REPO, TASK, INPUTS, executionId, 'stdout', '€b');
|
|
115
|
+
const runId = uuidv7();
|
|
116
|
+
await new WebStateStore(storage.adapters.records).create(runState(runId));
|
|
117
|
+
return { value, pkg, orphan, executionId, runId, revision };
|
|
118
|
+
});
|
|
119
|
+
},
|
|
120
|
+
/** Reads through the stores what {@link writeRepository} wrote. */
|
|
121
|
+
readRepository(name, written) {
|
|
122
|
+
return withStorage(name, async (storage) => {
|
|
123
|
+
const record = await repositoryOpen(storage, REPO);
|
|
124
|
+
const versioned = await storage.datasets.readVersioned(REPO, WORKSPACE, GREETING);
|
|
125
|
+
const execution = await storage.refs.executionGet(REPO, TASK, INPUTS, written.executionId);
|
|
126
|
+
const state = await new WebStateStore(storage.adapters.records).readLatest(REPO, WORKSPACE);
|
|
127
|
+
return {
|
|
128
|
+
repositories: await storage.repos.list(),
|
|
129
|
+
status: (await storage.repos.getMetadata(REPO))?.status.type ?? null,
|
|
130
|
+
release: record.release === E3_RELEASE,
|
|
131
|
+
greeting: decodeText(await storage.objects.read(REPO, written.value)),
|
|
132
|
+
range: decoder.decode(await storage.objects.readRange(REPO, written.orphan, 3, 6)),
|
|
133
|
+
size: (await storage.objects.stat(REPO, written.orphan)).size,
|
|
134
|
+
objects: (await storage.objects.list(REPO)).sort(),
|
|
135
|
+
packages: (await storage.refs.packageList(REPO)).map(({ name: pkg, version }) => `${pkg}@${version}`),
|
|
136
|
+
resolved: await storage.refs.packageResolve(REPO, 'greeting', '1.0.0'),
|
|
137
|
+
workspaces: await storage.refs.workspaceList(REPO),
|
|
138
|
+
dataset: versioned !== null && versioned.revision === written.revision && equalFor(DatasetRefType)(versioned.ref, greetingRef(written.value)),
|
|
139
|
+
execution: execution !== null && equalFor(ExecutionStatusType)(execution, succeeded(written.executionId, written.value)),
|
|
140
|
+
log: await storage.logs.read(REPO, TASK, INPUTS, written.executionId, 'stdout', { offset: 1, limit: 5 }),
|
|
141
|
+
run: state === null ? null : { id: state.id, status: state.status },
|
|
142
|
+
};
|
|
143
|
+
});
|
|
144
|
+
},
|
|
145
|
+
/** The objects the repository holds, in order. */
|
|
146
|
+
listObjects(name) {
|
|
147
|
+
return withStorage(name, async (storage) => (await storage.objects.list(REPO)).sort());
|
|
148
|
+
},
|
|
149
|
+
/** Collects the repository's garbage, holding it still, and answers what
|
|
150
|
+
* gc did and which objects it left. */
|
|
151
|
+
collectRepository(name, written) {
|
|
152
|
+
return withStorage(name, async (storage) => {
|
|
153
|
+
const result = await repoGc(storage, REPO, { minAge: 0 });
|
|
154
|
+
return {
|
|
155
|
+
deletedObjects: result.deletedObjects,
|
|
156
|
+
retainedObjects: result.retainedObjects,
|
|
157
|
+
deletedPartials: result.deletedPartials,
|
|
158
|
+
exists: {
|
|
159
|
+
value: await storage.objects.exists(REPO, written.value),
|
|
160
|
+
pkg: await storage.objects.exists(REPO, written.pkg),
|
|
161
|
+
orphan: await storage.objects.exists(REPO, written.orphan),
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
});
|
|
165
|
+
},
|
|
166
|
+
/** Takes the workspace's exclusive lock for a deploy, and holds it, having
|
|
167
|
+
* reported its progress, until the page closes; answers the session. */
|
|
168
|
+
async holdWorkspace(name) {
|
|
169
|
+
if (holding !== undefined)
|
|
170
|
+
throw new Error('this page holds the workspace already');
|
|
171
|
+
const storage = await openWebStorage({ name });
|
|
172
|
+
const handle = await storage.locks.acquire(REPO, WORKSPACE, variant('deployment', null));
|
|
173
|
+
if (handle === null) {
|
|
174
|
+
await storage.close();
|
|
175
|
+
throw new Error('another page holds the workspace');
|
|
176
|
+
}
|
|
177
|
+
await handle.report(PROGRESS);
|
|
178
|
+
holding = { storage, handle };
|
|
179
|
+
return storage.adapters.locks.session;
|
|
180
|
+
},
|
|
181
|
+
/** How the workspace's lock is held, as this page sees it. */
|
|
182
|
+
readLock(name) {
|
|
183
|
+
return withStorage(name, async (storage) => {
|
|
184
|
+
const state = await storage.locks.getState(REPO, WORKSPACE);
|
|
185
|
+
const progress = await storage.locks.getProgress(REPO, WORKSPACE);
|
|
186
|
+
return {
|
|
187
|
+
holder: state === null ? null : {
|
|
188
|
+
operation: state.operation.type,
|
|
189
|
+
session: state.holder.type === 'process' ? state.holder.value.bootId : null,
|
|
190
|
+
alive: await storage.locks.isHolderAlive(state.holder),
|
|
191
|
+
},
|
|
192
|
+
progress: progress === null ? null : equalFor(LockProgressType)(progress, PROGRESS),
|
|
193
|
+
recorded: (await storage.adapters.records.get(recordKeys.lock(REPO, WORKSPACE))) !== null,
|
|
194
|
+
};
|
|
195
|
+
});
|
|
196
|
+
},
|
|
197
|
+
/** Takes the workspace's exclusive lock, waiting for it when asked, and
|
|
198
|
+
* lets it go; answers whether it took it, whether the lock's state then
|
|
199
|
+
* named this page's session, and whether the release took the state
|
|
200
|
+
* away. */
|
|
201
|
+
tryWorkspace(name, wait) {
|
|
202
|
+
return withStorage(name, async (storage) => {
|
|
203
|
+
const handle = await storage.locks.acquire(REPO, WORKSPACE, variant('deployment', null), wait ? { wait: true, timeout: 10_000 } : {});
|
|
204
|
+
if (handle === null)
|
|
205
|
+
return { taken: false, own: false, cleared: false };
|
|
206
|
+
let own;
|
|
207
|
+
try {
|
|
208
|
+
const state = await storage.locks.getState(REPO, WORKSPACE);
|
|
209
|
+
own = state !== null && state.holder.type === 'process' && state.holder.value.bootId === storage.adapters.locks.session;
|
|
210
|
+
}
|
|
211
|
+
finally {
|
|
212
|
+
await handle.release();
|
|
213
|
+
}
|
|
214
|
+
return { taken: true, own, cleared: (await storage.adapters.records.get(recordKeys.lock(REPO, WORKSPACE))) === null };
|
|
215
|
+
});
|
|
216
|
+
},
|
|
217
|
+
/** Waits until a session of the storage of a name has ended: its Web Lock
|
|
218
|
+
* is free, and taken and let go at once. */
|
|
219
|
+
async awaitSessionEnded(name, session) {
|
|
220
|
+
await navigator.locks.request(sessionLockName(`${name}:`, session), { mode: 'exclusive' }, () => undefined);
|
|
221
|
+
},
|
|
222
|
+
/** Writes a repository into the storage this page keeps in memory, and
|
|
223
|
+
* answers its repositories. */
|
|
224
|
+
async writeInMemory() {
|
|
225
|
+
memory ??= await openWebStorage({ persist: false });
|
|
226
|
+
await memory.repos.create(REPO);
|
|
227
|
+
await memory.objects.write(REPO, encoder.encode('kept while the page lives'));
|
|
228
|
+
return memory.repos.list();
|
|
229
|
+
},
|
|
230
|
+
/** What the storage this page keeps in memory holds, and whether anything
|
|
231
|
+
* of e3's default storage was persisted. */
|
|
232
|
+
async readInMemory() {
|
|
233
|
+
memory ??= await openWebStorage({ persist: false });
|
|
234
|
+
const repositories = await memory.repos.list();
|
|
235
|
+
const databases = (await indexedDB.databases()).map((database) => database.name);
|
|
236
|
+
return {
|
|
237
|
+
repositories,
|
|
238
|
+
objects: repositories.includes(REPO) ? await memory.objects.count(REPO) : 0,
|
|
239
|
+
persisted: databases.includes('e3') || await opfsHas('e3'),
|
|
240
|
+
};
|
|
241
|
+
},
|
|
242
|
+
/** Opens the storage of a name with a file handle's `move` taken away, as
|
|
243
|
+
* in a browser whose OPFS cannot move a file, and answers its refusal and
|
|
244
|
+
* what it left of itself; `move` is put back after. */
|
|
245
|
+
async openWithoutMove(name) {
|
|
246
|
+
// The prototype that defines it: FileSystemFileHandle's in Chromium
|
|
247
|
+
let owner = FileSystemFileHandle.prototype;
|
|
248
|
+
while (owner !== null && !Object.prototype.hasOwnProperty.call(owner, 'move'))
|
|
249
|
+
owner = Object.getPrototypeOf(owner);
|
|
250
|
+
const move = owner === null ? undefined : Object.getOwnPropertyDescriptor(owner, 'move');
|
|
251
|
+
if (owner === null || move === undefined)
|
|
252
|
+
throw new Error('this browser\'s file handles have no move to take away');
|
|
253
|
+
Reflect.deleteProperty(owner, 'move');
|
|
254
|
+
let refusal = null;
|
|
255
|
+
try {
|
|
256
|
+
await (await openWebStorage({ name })).close();
|
|
257
|
+
}
|
|
258
|
+
catch (err) {
|
|
259
|
+
refusal = err instanceof Error ? err.message : `${err}`;
|
|
260
|
+
}
|
|
261
|
+
finally {
|
|
262
|
+
Object.defineProperty(owner, 'move', move);
|
|
263
|
+
}
|
|
264
|
+
return {
|
|
265
|
+
refusal,
|
|
266
|
+
database: (await indexedDB.databases()).some((database) => database.name === name),
|
|
267
|
+
directory: await opfsHas(name),
|
|
268
|
+
};
|
|
269
|
+
},
|
|
270
|
+
});
|
|
271
|
+
//# sourceMappingURL=repository.page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.page.js","sourceRoot":"","sources":["../../../src/browser/repository.page.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC5G,OAAO,EACL,cAAc,EACd,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,GAId,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAA+D,MAAM,2BAA2B,CAAC;AACxI,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,UAAU,EAAmB,MA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AC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,GAAa,EAAE,CAAC;QACpE,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO;YACL,OAAO;YACP,QAAQ,EAAE,CAAC,MAAM,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,IAAI,CAAC;YAClF,SAAS,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC;SAC/B,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.page.d.ts","sourceRoot":"","sources":["../../../src/browser/runner.page.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
import { deleteIndexedDbRecords } from '../storage/indexeddb.js';
|
|
6
|
+
import { openWebLocks } from '../storage/web-locks.js';
|
|
7
|
+
import { openWebStorage } from '../storage/WebStorage.js';
|
|
8
|
+
import { caseNamed, runAdapterCase } from '../testing/adapter-contract.js';
|
|
9
|
+
import { fixturesFromWire, runnerCases, runnerSetup, threadCases, } from '../testing/runner-cases.js';
|
|
10
|
+
import { servePage } from './page.js';
|
|
11
|
+
/** The fixture package, once the Node side has handed it over. */
|
|
12
|
+
let fixtures;
|
|
13
|
+
/** Starts a unit worker: a Web Worker running the specs' unit worker script. */
|
|
14
|
+
function units() {
|
|
15
|
+
return new Worker('/unit-worker.js', { type: 'module' });
|
|
16
|
+
}
|
|
17
|
+
/** Removes what a storage of a name kept: its IndexedDB database and its OPFS
|
|
18
|
+
* directory. */
|
|
19
|
+
async function clear(name) {
|
|
20
|
+
await deleteIndexedDbRecords(name);
|
|
21
|
+
await (await navigator.storage.getDirectory()).removeEntry(name, { recursive: true }).catch((err) => {
|
|
22
|
+
if (!(err instanceof DOMException && err.name === 'NotFoundError'))
|
|
23
|
+
throw err;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* What a case's setup is made of in a page: a tab's storage over IndexedDB,
|
|
28
|
+
* OPFS and Web Locks under a name no other case's has, removed once the case
|
|
29
|
+
* has run, its origin's other sessions over Web Locks of the same name, and
|
|
30
|
+
* Web Workers.
|
|
31
|
+
*/
|
|
32
|
+
function environment() {
|
|
33
|
+
if (fixtures === undefined)
|
|
34
|
+
throw new Error('the page was handed no fixture package: call setFixtures first');
|
|
35
|
+
return {
|
|
36
|
+
fixtures,
|
|
37
|
+
units,
|
|
38
|
+
openStorage: async (cleanup) => {
|
|
39
|
+
const name = `e3-web-runner-${crypto.randomUUID()}`;
|
|
40
|
+
// Registered first, so it runs last: once the storage has closed.
|
|
41
|
+
cleanup(() => clear(name));
|
|
42
|
+
const storage = await openWebStorage({ name });
|
|
43
|
+
cleanup(() => storage.close());
|
|
44
|
+
return { storage, openSession: () => openWebLocks({ prefix: `${name}:` }) };
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
servePage({
|
|
49
|
+
/** Takes the fixture package the Node side exported. */
|
|
50
|
+
setFixtures(wire) {
|
|
51
|
+
fixtures = fixturesFromWire(wire);
|
|
52
|
+
},
|
|
53
|
+
/** Runs a runner case. */
|
|
54
|
+
runCase(name) {
|
|
55
|
+
return runAdapterCase(caseNamed(runnerCases, name), runnerSetup(environment()));
|
|
56
|
+
},
|
|
57
|
+
/** Runs a case only workers on threads of their own pass. */
|
|
58
|
+
runThreadCase(name) {
|
|
59
|
+
return runAdapterCase(caseNamed(threadCases, name), runnerSetup(environment()));
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=runner.page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.page.js","sourceRoot":"","sources":["../../../src/browser/runner.page.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgBH,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,WAAW,GAIZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,kEAAkE;AAClE,IAAI,QAAoC,CAAC;AAEzC,gFAAgF;AAChF,SAAS,KAAK;IACZ,OAAO,IAAI,MAAM,CAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC3D,CAAC;AAED;iBACiB;AACjB,KAAK,UAAU,KAAK,CAAC,IAAY;IAC/B,MAAM,sBAAsB,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,CAAC,MAAM,SAAS,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;QAC3G,IAAI,CAAC,CAAC,GAAG,YAAY,YAAY,IAAI,GAAG,CAAC,IAAI,KAAK,eAAe,CAAC;YAAE,MAAM,GAAG,CAAC;IAChF,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,SAAS,WAAW;IAClB,IAAI,QAAQ,KAAK,SAAS;QAAE,MAAM,IAAI,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right (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* `WebTaskRunner` in Chromium: every runner case, each a test of its own,
|
|
7
|
+
* run in a page over Web Workers, IndexedDB, OPFS and Web Locks — the cases
|
|
8
|
+
* `../execution/WebTaskRunner.spec.ts` runs in Node over the in-process
|
|
9
|
+
* workers — and the cases only workers on threads of their own pass: a call
|
|
10
|
+
* that never yields its thread is ended by terminating its worker.
|
|
11
|
+
*
|
|
12
|
+
* The fixture package is exported here, in Node, with e3's SDK, and handed to
|
|
13
|
+
* the page as data.
|
|
14
|
+
*/
|
|
15
|
+
import { after, before, describe, it } from 'node:test';
|
|
16
|
+
import { fileURLToPath } from 'node:url';
|
|
17
|
+
import { fixturesToWire, runnerCases, threadCases } from '../testing/runner-cases.js';
|
|
18
|
+
import { buildRunnerFixtures } from '../testing/runner-fixtures.js';
|
|
19
|
+
import { Harness } from './harness.js';
|
|
20
|
+
const entries = {
|
|
21
|
+
runner: fileURLToPath(new URL('./runner.page.js', import.meta.url)),
|
|
22
|
+
'unit-worker': fileURLToPath(new URL('./unit.worker.js', import.meta.url)),
|
|
23
|
+
};
|
|
24
|
+
describe('WebTaskRunner in Chromium, over Web Workers, IndexedDB, OPFS and Web Locks', () => {
|
|
25
|
+
let harness;
|
|
26
|
+
/** The page each case runs in */
|
|
27
|
+
let page;
|
|
28
|
+
before(async () => {
|
|
29
|
+
const fixtures = await buildRunnerFixtures();
|
|
30
|
+
harness = await Harness.open({ entries });
|
|
31
|
+
page = await harness.newPage('runner');
|
|
32
|
+
await page.call('setFixtures', fixturesToWire(fixtures));
|
|
33
|
+
});
|
|
34
|
+
after(async () => {
|
|
35
|
+
await harness?.close();
|
|
36
|
+
});
|
|
37
|
+
for (const { name } of runnerCases) {
|
|
38
|
+
it(name, () => page.call('runCase', name));
|
|
39
|
+
}
|
|
40
|
+
describe('on workers of threads of their own', () => {
|
|
41
|
+
for (const { name } of threadCases) {
|
|
42
|
+
it(name, () => page.call('runThreadCase', name));
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=runner.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.spec.js","sourceRoot":"","sources":["../../../src/browser/runner.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;GASG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,OAAO,EAAoB,MAAM,cAAc,CAAC;AAEzD,MAAM,OAAO,GAAG;IACd,MAAM,EAAE,aAAa,CAAC,IAAI,GAAG,CAAC,kBAAkB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACnE,aAAa,EAAE,aAAa,CAAC,IAAI,GAAG,CAAC,kBAAkB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;CAC3E,CAAC;AAEF,QAAQ,CAAC,4EAA4E,EAAE,GAAG,EAAE;IAC1F,IAAI,OAA4B,CAAC;IACjC,iCAAiC;IACjC,IAAI,IAAiB,CAAC;IAEtB,MAAM,CAAC,KAAK,IAAI,EAAE;QAChB,MAAM,QAAQ,GAAG,MAAM,mBAAmB,EAAE,CAAC;QAC7C,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;QAC1C,IAAI,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACvC,MAAM,IAAI,CAAC,IAAI,CAAC,aAAa,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