@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,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The unit protocol: the messages the e3 worker and a unit worker speak.
|
|
7
|
+
*
|
|
8
|
+
* The e3 worker starts each unit worker with `start`, handing it the port of
|
|
9
|
+
* the services it serves units, and the worker answers `ready` once it serves
|
|
10
|
+
* units, naming the Web Lock it holds while it lives, which the pool waits on
|
|
11
|
+
* to learn it has stopped on its own. A unit is sent with `run`: the unit,
|
|
12
|
+
* encoded, and every file it
|
|
13
|
+
* names, their buffers transferred rather than copied. The worker answers a
|
|
14
|
+
* run with what the unit's console writes, as it writes it (`log`), and then
|
|
15
|
+
* `done` — the unit's result, encoded, and every file it wrote — or `broken`,
|
|
16
|
+
* when it could not run the unit at all.
|
|
17
|
+
*
|
|
18
|
+
* A dedicated Web Worker speaks it through its global scope's `postMessage`,
|
|
19
|
+
* and the in-process host through a `MessageChannel` (`in-process.ts`), so a
|
|
20
|
+
* test in Node sends the messages a browser does, through the same
|
|
21
|
+
* structured clone and the same transfers.
|
|
22
|
+
*
|
|
23
|
+
* @packageDocumentation
|
|
24
|
+
*/
|
|
25
|
+
/** A file a unit names, by its path, and its bytes. */
|
|
26
|
+
export type UnitFile = readonly [path: string, bytes: Uint8Array];
|
|
27
|
+
/** A message the e3 worker sends a unit worker. */
|
|
28
|
+
export type HostMessage =
|
|
29
|
+
/** The first message a unit worker is sent: the port of the services its
|
|
30
|
+
* host serves units, or `null` for none. */
|
|
31
|
+
{
|
|
32
|
+
readonly kind: 'start';
|
|
33
|
+
readonly port: MessagePort | null;
|
|
34
|
+
}
|
|
35
|
+
/** Runs a unit: the `UnitType` value's beast2 bytes, and the files it names,
|
|
36
|
+
* relative to the unit. */
|
|
37
|
+
| {
|
|
38
|
+
readonly kind: 'run';
|
|
39
|
+
readonly id: number;
|
|
40
|
+
readonly unit: Uint8Array;
|
|
41
|
+
readonly files: readonly UnitFile[];
|
|
42
|
+
};
|
|
43
|
+
/** A message a unit worker sends the e3 worker. */
|
|
44
|
+
export type WorkerMessage =
|
|
45
|
+
/** The worker serves units: what it answers `start` with. `lifeline` is
|
|
46
|
+
* the Web Lock it holds while it lives — the browser frees it once the
|
|
47
|
+
* worker has stopped, however it stopped — or `null` when it holds none. */
|
|
48
|
+
{
|
|
49
|
+
readonly kind: 'ready';
|
|
50
|
+
readonly lifeline: string | null;
|
|
51
|
+
}
|
|
52
|
+
/** Text a running unit's console wrote, as it wrote it. */
|
|
53
|
+
| {
|
|
54
|
+
readonly kind: 'log';
|
|
55
|
+
readonly id: number;
|
|
56
|
+
readonly stream: 'stdout' | 'stderr';
|
|
57
|
+
readonly text: string;
|
|
58
|
+
}
|
|
59
|
+
/** A unit ran: its `UnitResultType` value's beast2 bytes, and every file it
|
|
60
|
+
* wrote, relative to the unit. */
|
|
61
|
+
| {
|
|
62
|
+
readonly kind: 'done';
|
|
63
|
+
readonly id: number;
|
|
64
|
+
readonly result: Uint8Array;
|
|
65
|
+
readonly files: readonly UnitFile[];
|
|
66
|
+
}
|
|
67
|
+
/** The worker could not run a unit at all, and says why. */
|
|
68
|
+
| {
|
|
69
|
+
readonly kind: 'broken';
|
|
70
|
+
readonly id: number;
|
|
71
|
+
readonly message: string;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* A unit worker, as the pool drives it: what it needs of a dedicated Web
|
|
75
|
+
* Worker, which the in-process host gives too.
|
|
76
|
+
*/
|
|
77
|
+
export interface UnitWorker {
|
|
78
|
+
/**
|
|
79
|
+
* Sends the worker a message.
|
|
80
|
+
*
|
|
81
|
+
* @param message - The message
|
|
82
|
+
* @param transfer - The buffers it moves to the worker rather than copies:
|
|
83
|
+
* they are the worker's once sent
|
|
84
|
+
*/
|
|
85
|
+
postMessage(message: HostMessage, transfer: Transferable[]): void;
|
|
86
|
+
/** Hears each message the worker sends. */
|
|
87
|
+
onmessage: ((event: MessageEvent) => void) | null;
|
|
88
|
+
/** Hears the worker fail: a script that does not load, or an error nothing
|
|
89
|
+
* in the worker caught. */
|
|
90
|
+
onerror: ((event: ErrorEvent) => void) | null;
|
|
91
|
+
/** Ends the worker at once, whatever it is running. */
|
|
92
|
+
terminate(): void;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The buffers of a message's files that it moves rather than copies: each
|
|
96
|
+
* buffer a file's bytes are the whole of, once.
|
|
97
|
+
*
|
|
98
|
+
* @remarks
|
|
99
|
+
* Moving a buffer leaves the sender none of it, so only bytes the sender owns
|
|
100
|
+
* whole are moved. Bytes that are part of a larger buffer — a slice of a pool,
|
|
101
|
+
* say, whose other parts the sender's code still reads — are copied with the
|
|
102
|
+
* message instead, as is a view of shared memory.
|
|
103
|
+
*
|
|
104
|
+
* @param files - The message's files
|
|
105
|
+
* @returns The buffers to move
|
|
106
|
+
*/
|
|
107
|
+
export declare function transferOf(files: Iterable<UnitFile>): ArrayBuffer[];
|
|
108
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/execution/protocol.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,uDAAuD;AACvD,MAAM,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;AAElE,mDAAmD;AACnD,MAAM,MAAM,WAAW;AACrB;6CAC6C;AAC3C;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;CAAE;AAC/D;4BAC4B;GAC1B;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAA;CAAE,CAAC;AAElH,mDAAmD;AACnD,MAAM,MAAM,aAAa;AACvB;;6EAE6E;AAC3E;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,QAA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|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The buffers of a message's files that it moves rather than copies: each
|
|
7
|
+
* buffer a file's bytes are the whole of, once.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* Moving a buffer leaves the sender none of it, so only bytes the sender owns
|
|
11
|
+
* whole are moved. Bytes that are part of a larger buffer — a slice of a pool,
|
|
12
|
+
* say, whose other parts the sender's code still reads — are copied with the
|
|
13
|
+
* message instead, as is a view of shared memory.
|
|
14
|
+
*
|
|
15
|
+
* @param files - The message's files
|
|
16
|
+
* @returns The buffers to move
|
|
17
|
+
*/
|
|
18
|
+
export function transferOf(files) {
|
|
19
|
+
const buffers = new Set();
|
|
20
|
+
for (const [, bytes] of files) {
|
|
21
|
+
if (bytes.buffer instanceof ArrayBuffer && bytes.byteOffset === 0 && bytes.byteLength === bytes.buffer.byteLength) {
|
|
22
|
+
buffers.add(bytes.buffer);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return [...buffers];
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../../src/execution/protocol.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuEH;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,UAAU,CAAC,KAAyB;IAClD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAe,CAAC;IACvC,KAAK,MAAM,CAAC,EAAE,KAAK,CAAC,IAAI,KAAK,EAAE,CAAC;QAC9B,IAAI,KAAK,CAAC,MAAM,YAAY,WAAW,IAAI,KAAK,CAAC,UAAU,KAAK,CAAC,IAAI,KAAK,CAAC,UAAU,KAAK,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;YAClH,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
import type { PlatformFunction } from '@elaraai/east/internal';
|
|
6
|
+
import { type ConsoleSink } from '@elaraai/east-web-std';
|
|
7
|
+
import { type HostMessage, type WorkerMessage } from './protocol.js';
|
|
8
|
+
/**
|
|
9
|
+
* What a unit's platform package is given when it is resolved for a unit: its
|
|
10
|
+
* console, the port of the services the unit's host serves, and what stops
|
|
11
|
+
* the unit where its host cannot end its thread.
|
|
12
|
+
*/
|
|
13
|
+
export interface UnitPlatformContext {
|
|
14
|
+
/** Where the unit's console output goes: the execution's logs, as it is
|
|
15
|
+
* written. */
|
|
16
|
+
readonly console: ConsoleSink;
|
|
17
|
+
/**
|
|
18
|
+
* Aborted once the host stops the unit without ending its thread — the
|
|
19
|
+
* in-process host's terminate — so a package stops what the unit left
|
|
20
|
+
* waiting, its timers cleared; `null` where stopping a unit ends its thread,
|
|
21
|
+
* as terminating a Web Worker does.
|
|
22
|
+
*/
|
|
23
|
+
readonly signal: AbortSignal | null;
|
|
24
|
+
/**
|
|
25
|
+
* The port the e3 worker handed this unit worker as it started it, or
|
|
26
|
+
* `null` when it handed none: what a package that reaches back to its host
|
|
27
|
+
* — e3's own platform functions, bound to a fetch into the e3 worker — talks
|
|
28
|
+
* to it through.
|
|
29
|
+
*/
|
|
30
|
+
readonly port: MessagePort | null;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A platform package a unit worker serves: its platform functions, or what
|
|
34
|
+
* makes them for each unit from the unit's context.
|
|
35
|
+
*/
|
|
36
|
+
export type UnitPlatformPackage = readonly PlatformFunction[] | ((context: UnitPlatformContext) => readonly PlatformFunction[] | Promise<readonly PlatformFunction[]>);
|
|
37
|
+
/** The platform packages a unit worker serves, by the name a runner lists
|
|
38
|
+
* each under in a unit. */
|
|
39
|
+
export type UnitPlatforms = Readonly<Record<string, UnitPlatformPackage>>;
|
|
40
|
+
/** The name a runner lists east-node-std's platform functions under. */
|
|
41
|
+
export declare const EAST_NODE_STD = "@elaraai/east-node-std";
|
|
42
|
+
/**
|
|
43
|
+
* The packages every unit worker serves:
|
|
44
|
+
* - east-node-std's name, answered by east-web-std's platform, so a task
|
|
45
|
+
* written for east-node runs unchanged in a browser. Its console writes to
|
|
46
|
+
* the unit's logs, each unit has a Random generator of its own, and its
|
|
47
|
+
* sleeps stop with the unit where the host cannot end the unit's thread;
|
|
48
|
+
* - e3-api-client's name ({@link E3_PLATFORM}), answered by e3's own platform
|
|
49
|
+
* functions bound to the e3 worker that started the unit worker, so a task
|
|
50
|
+
* that calls `Platform.workspaceList` lists the in-page e3's workspaces.
|
|
51
|
+
*/
|
|
52
|
+
export declare const STANDARD_PLATFORMS: UnitPlatforms;
|
|
53
|
+
/** Where a unit server's messages go: a worker's global scope, or a port. */
|
|
54
|
+
export interface UnitEndpoint {
|
|
55
|
+
/**
|
|
56
|
+
* Sends the host a message.
|
|
57
|
+
*
|
|
58
|
+
* @param message - The message
|
|
59
|
+
* @param transfer - The buffers it moves rather than copies
|
|
60
|
+
*/
|
|
61
|
+
postMessage(message: WorkerMessage, transfer: Transferable[]): void;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Wraps a unit's platform functions as a host that cannot end a unit's
|
|
65
|
+
* thread stops them: see {@link UnitServerOptions.guard}.
|
|
66
|
+
*/
|
|
67
|
+
export type PlatformGuard = (functions: readonly PlatformFunction[]) => readonly PlatformFunction[];
|
|
68
|
+
/** How a {@link UnitServer} runs units. */
|
|
69
|
+
export interface UnitServerOptions {
|
|
70
|
+
/** The platform packages it serves, by name */
|
|
71
|
+
readonly platforms: UnitPlatforms;
|
|
72
|
+
/**
|
|
73
|
+
* Takes the lifeline its `ready` names: a Web Lock its worker holds while it
|
|
74
|
+
* lives, which the pool waits on to learn the worker has stopped on its own.
|
|
75
|
+
* A Web Worker's server takes one; the in-process host's, which shares the
|
|
76
|
+
* e3 worker's thread, takes none, and names `null`.
|
|
77
|
+
*/
|
|
78
|
+
readonly lifeline?: () => Promise<string | null>;
|
|
79
|
+
/**
|
|
80
|
+
* Wraps each package's platform functions before a unit is compiled with
|
|
81
|
+
* them: the in-process host's, which shares the e3 worker's thread and so
|
|
82
|
+
* cannot terminate it, stops a unit at its next platform call this way.
|
|
83
|
+
*/
|
|
84
|
+
readonly guard?: PlatformGuard;
|
|
85
|
+
/**
|
|
86
|
+
* Aborted once the host stops its units without ending their thread: each
|
|
87
|
+
* unit's packages are given it ({@link UnitPlatformContext.signal}), so what
|
|
88
|
+
* a unit left waiting stops with it.
|
|
89
|
+
*/
|
|
90
|
+
readonly signal?: AbortSignal;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Runs the units its host sends, one at a time as the host sends them, and
|
|
94
|
+
* answers each with its result and the files it wrote.
|
|
95
|
+
*/
|
|
96
|
+
export declare class UnitServer {
|
|
97
|
+
private readonly endpoint;
|
|
98
|
+
private readonly options;
|
|
99
|
+
/** The port the host handed at start, for the platform packages that reach
|
|
100
|
+
* back to it */
|
|
101
|
+
private port;
|
|
102
|
+
/**
|
|
103
|
+
* @param endpoint - Where its messages go
|
|
104
|
+
* @param options - The packages it serves, and the guard of a host that
|
|
105
|
+
* cannot end its thread
|
|
106
|
+
*/
|
|
107
|
+
constructor(endpoint: UnitEndpoint, options: UnitServerOptions);
|
|
108
|
+
/**
|
|
109
|
+
* Handles a message from the host: `start` is answered `ready`, and a unit
|
|
110
|
+
* is run and answered with its result.
|
|
111
|
+
*
|
|
112
|
+
* @param message - The message
|
|
113
|
+
*/
|
|
114
|
+
receive(message: HostMessage): Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* Runs a unit over its files, and answers with its result and the files it
|
|
117
|
+
* wrote.
|
|
118
|
+
*
|
|
119
|
+
* @throws {Error} When the unit does not decode, or its answer cannot be
|
|
120
|
+
* sent: the unit was never run, or its result is lost.
|
|
121
|
+
*/
|
|
122
|
+
private run;
|
|
123
|
+
/**
|
|
124
|
+
* The platform functions of a package the unit lists.
|
|
125
|
+
*
|
|
126
|
+
* @throws {Error} When the worker serves no package of that name: the unit
|
|
127
|
+
* fails, naming it.
|
|
128
|
+
*/
|
|
129
|
+
private platforms;
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=unit-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unit-server.d.ts","sourceRoot":"","sources":["../../../src/execution/unit-server.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiCH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE5E,OAAO,EAAc,KAAK,WAAW,EAAiB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAEhG;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC;mBACe;IACf,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IACpC;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAC3B,SAAS,gBAAgB,EAAE,GAC3B,CAAC,CAAC,OAAO,EAAE,mBAAmB,KAAK,SAAS,gBAAgB,EAAE,GAAG,OAAO,CAAC,SAAS,gBAAgB,EAAE,CAAC,CAAC,CAAC;AAE3G;4BAC4B;AAC5B,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC;AAE1E,wEAAwE;AACxE,eAAO,MAAM,aAAa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it worker's side of the unit protocol: it runs each unit it is sent with
|
|
7
|
+
* east's `executeUnit` over the unit's files in memory, as east-node's `exec`
|
|
8
|
+
* runs one over a directory.
|
|
9
|
+
*
|
|
10
|
+
* The platform functions a unit lists are resolved by package name, from the
|
|
11
|
+
* packages its worker serves: east-node-std's name is answered by
|
|
12
|
+
* east-web-std's platform, whose console writes to the unit's logs as it
|
|
13
|
+
* writes; e3-api-client's by e3's own platform functions, bound to the e3
|
|
14
|
+
* worker that started the unit worker; and an app adds its own packages. A
|
|
15
|
+
* package the worker does not serve fails the unit, naming the package; a
|
|
16
|
+
* platform function a package does not provide fails it at compile, naming
|
|
17
|
+
* the function, as east's compile names it. A failed unit's message and
|
|
18
|
+
* locations are written to its stderr, as east-node's `exec` writes them.
|
|
19
|
+
*
|
|
20
|
+
* `serveUnits` (`../units.ts`) serves this in a dedicated Web Worker, and the
|
|
21
|
+
* in-process host (`in-process.ts`) over a `MessageChannel` in the e3
|
|
22
|
+
* worker's own thread.
|
|
23
|
+
*
|
|
24
|
+
* @packageDocumentation
|
|
25
|
+
*/
|
|
26
|
+
import { InMemoryUnitIO, UnitResultType, UnitType, decodeBeast2For, encodeBeast2For, executeUnit, } from '@elaraai/east';
|
|
27
|
+
import { createWebPlatform } from '@elaraai/east-web-std';
|
|
28
|
+
import { E3_PLATFORM, e3Platform } from './e3-platform.js';
|
|
29
|
+
import { transferOf } from './protocol.js';
|
|
30
|
+
/** The name a runner lists east-node-std's platform functions under. */
|
|
31
|
+
export const EAST_NODE_STD = '@elaraai/east-node-std';
|
|
32
|
+
/**
|
|
33
|
+
* The packages every unit worker serves:
|
|
34
|
+
* - east-node-std's name, answered by east-web-std's platform, so a task
|
|
35
|
+
* written for east-node runs unchanged in a browser. Its console writes to
|
|
36
|
+
* the unit's logs, each unit has a Random generator of its own, and its
|
|
37
|
+
* sleeps stop with the unit where the host cannot end the unit's thread;
|
|
38
|
+
* - e3-api-client's name ({@link E3_PLATFORM}), answered by e3's own platform
|
|
39
|
+
* functions bound to the e3 worker that started the unit worker, so a task
|
|
40
|
+
* that calls `Platform.workspaceList` lists the in-page e3's workspaces.
|
|
41
|
+
*/
|
|
42
|
+
export const STANDARD_PLATFORMS = {
|
|
43
|
+
[EAST_NODE_STD]: (context) => createWebPlatform({ console: context.console, ...(context.signal !== null && { signal: context.signal }) }),
|
|
44
|
+
[E3_PLATFORM]: e3Platform,
|
|
45
|
+
};
|
|
46
|
+
/** An error's message. */
|
|
47
|
+
function messageOf(err) {
|
|
48
|
+
return err instanceof Error ? err.message : String(err);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Runs the units its host sends, one at a time as the host sends them, and
|
|
52
|
+
* answers each with its result and the files it wrote.
|
|
53
|
+
*/
|
|
54
|
+
export class UnitServer {
|
|
55
|
+
endpoint;
|
|
56
|
+
options;
|
|
57
|
+
/** The port the host handed at start, for the platform packages that reach
|
|
58
|
+
* back to it */
|
|
59
|
+
port = null;
|
|
60
|
+
/**
|
|
61
|
+
* @param endpoint - Where its messages go
|
|
62
|
+
* @param options - The packages it serves, and the guard of a host that
|
|
63
|
+
* cannot end its thread
|
|
64
|
+
*/
|
|
65
|
+
constructor(endpoint, options) {
|
|
66
|
+
this.endpoint = endpoint;
|
|
67
|
+
this.options = options;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Handles a message from the host: `start` is answered `ready`, and a unit
|
|
71
|
+
* is run and answered with its result.
|
|
72
|
+
*
|
|
73
|
+
* @param message - The message
|
|
74
|
+
*/
|
|
75
|
+
async receive(message) {
|
|
76
|
+
if (message.kind === 'start') {
|
|
77
|
+
this.port = message.port;
|
|
78
|
+
const lifeline = this.options.lifeline === undefined ? null : await this.options.lifeline();
|
|
79
|
+
this.endpoint.postMessage({ kind: 'ready', lifeline }, []);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
try {
|
|
83
|
+
await this.run(message.id, message.unit, message.files);
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
this.endpoint.postMessage({ kind: 'broken', id: message.id, message: messageOf(err) }, []);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Runs a unit over its files, and answers with its result and the files it
|
|
91
|
+
* wrote.
|
|
92
|
+
*
|
|
93
|
+
* @throws {Error} When the unit does not decode, or its answer cannot be
|
|
94
|
+
* sent: the unit was never run, or its result is lost.
|
|
95
|
+
*/
|
|
96
|
+
async run(id, encoded, files) {
|
|
97
|
+
let unit;
|
|
98
|
+
try {
|
|
99
|
+
unit = decodeBeast2For(UnitType)(encoded);
|
|
100
|
+
}
|
|
101
|
+
catch (err) {
|
|
102
|
+
throw new Error(`the unit does not decode: ${messageOf(err)}`);
|
|
103
|
+
}
|
|
104
|
+
const io = new InMemoryUnitIO(files);
|
|
105
|
+
// What the unit was given, by the paths the IO holds it under: what it
|
|
106
|
+
// wrote is everything else.
|
|
107
|
+
const given = new Set(io.files.keys());
|
|
108
|
+
const write = (stream) => (text) => {
|
|
109
|
+
this.endpoint.postMessage({ kind: 'log', id, stream, text }, []);
|
|
110
|
+
};
|
|
111
|
+
const context = {
|
|
112
|
+
console: { stdout: write('stdout'), stderr: write('stderr') },
|
|
113
|
+
port: this.port,
|
|
114
|
+
signal: this.options.signal ?? null,
|
|
115
|
+
};
|
|
116
|
+
const result = await executeUnit(unit, io, { platforms: (name) => this.platforms(name, context) });
|
|
117
|
+
if (result.outcome.type === 'failed') {
|
|
118
|
+
// A failed unit's message and its source locations, written to its
|
|
119
|
+
// stderr as east-node's `exec` writes them.
|
|
120
|
+
const { message, locations } = result.outcome.value;
|
|
121
|
+
context.console.stderr(`${['Error: ' + message, ...locations.map((l) => ` at ${l.filename}:${l.line}:${l.column}`)].join('\n')}\n`);
|
|
122
|
+
}
|
|
123
|
+
const written = [...io.files].filter(([path]) => !given.has(path));
|
|
124
|
+
this.endpoint.postMessage({ kind: 'done', id, result: encodeBeast2For(UnitResultType)(result), files: written }, transferOf(written));
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* The platform functions of a package the unit lists.
|
|
128
|
+
*
|
|
129
|
+
* @throws {Error} When the worker serves no package of that name: the unit
|
|
130
|
+
* fails, naming it.
|
|
131
|
+
*/
|
|
132
|
+
async platforms(name, context) {
|
|
133
|
+
const served = this.options.platforms;
|
|
134
|
+
if (!Object.hasOwn(served, name)) {
|
|
135
|
+
throw new Error(`the platform package ${name} is not served to units in this browser: serveUnits({ platforms }) adds an app's own`);
|
|
136
|
+
}
|
|
137
|
+
const entry = served[name];
|
|
138
|
+
const functions = typeof entry === 'function' ? await entry(context) : entry;
|
|
139
|
+
return this.options.guard === undefined ? functions : this.options.guard(functions);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=unit-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unit-server.js","sourceRoot":"","sources":["../../../src/execution/unit-server.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EACL,cAAc,EACd,cAAc,EACd,QAAQ,EACR,eAAe,EACf,eAAe,EACf,WAAW,GAEZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,iBAAiB,EAAoB,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAuD,MAAM,eAAe,CAAC;AAuChG,wEAAwE;AACxE,MAAM,CAAC,MAAM,aAAa,GAAG,wBAAwB,CAAC;AAEtD;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAkB;IAC/C,CAAC,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,MAAM,KAAK,IAAI,IAAI,EAAE,MAAM,EAAE,O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,GAAG,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAC7E,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACtF,CAAC;CACF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* e3 in a browser: the page's connection to its e3 worker, and the seams the
|
|
7
|
+
* e3 worker runs e3 over — its storage over IndexedDB, OPFS and Web Locks,
|
|
8
|
+
* its runner over a pool of Web Workers, and its transfers.
|
|
9
|
+
*
|
|
10
|
+
* `createWebE3` connects a page to its e3 worker, whose script calls
|
|
11
|
+
* `serveE3()` from `@elaraai/e3-web/worker`, and gives the page the `fetch`
|
|
12
|
+
* the worker answers, with the URL e3's client is given. The seams the e3
|
|
13
|
+
* worker runs: `openWebStorage` opens e3's storage backend — `WebStorage`,
|
|
14
|
+
* over the four adapters below — and `WebStateStore` keeps a dataflow run's
|
|
15
|
+
* state beside it; `WebTaskRunner` runs a repository's units on the workers of
|
|
16
|
+
* a `UnitPool`: Web Workers whose script calls `serveUnits()` from
|
|
17
|
+
* `@elaraai/e3-web/units`, or, for a test in Node, workers in this thread
|
|
18
|
+
* (`inProcessUnits`); and `WebTransferBackend` stages uploads and runs the
|
|
19
|
+
* jobs, and `createWebDataEndpoints` answers the byte URLs it gives. This entry reaches nothing of Node, so a page or a worker bundles it.
|
|
20
|
+
* The files adapter over the machine's files is `@elaraai/e3-web/node`.
|
|
21
|
+
*
|
|
22
|
+
* @packageDocumentation
|
|
23
|
+
*/
|
|
24
|
+
export { createWebE3, type WebE3, type WebE3Options } from './bridge/page.js';
|
|
25
|
+
export { DEFAULT_EXPORT_ROUND_BYTES, DEFAULT_RECORD_RETENTION_MS, DEFAULT_RESULT_TTL_MS, DEFAULT_RETENTION_INTERVAL_MS, DEFAULT_WEB_PART_BYTES, WebTransferBackend, type TransferKind, type WebTransferBackendOptions, } from './transfer/WebTransferBackend.js';
|
|
26
|
+
export { createWebDataEndpoints, type WebDataEndpoints } from './transfer/endpoints.js';
|
|
27
|
+
export { DEFAULT_WHOLE_INTAKE_LIMIT, NO_COMMANDS, WEB_RUNNER, WebTaskRunner, type WebTaskRunnerOptions, } from './execution/WebTaskRunner.js';
|
|
28
|
+
export { UnitPool, type UnitConnection, type UnitPoolOptions, type UnitRun, type UnitRunOptions } from './execution/pool.js';
|
|
29
|
+
export { inProcessUnits, type InProcessUnitsOptions } from './execution/in-process.js';
|
|
30
|
+
export type { HostMessage, UnitFile, UnitWorker, WorkerMessage } from './execution/protocol.js';
|
|
31
|
+
export type { UnitPlatformContext, UnitPlatformPackage, UnitPlatforms } from './execution/unit-server.js';
|
|
32
|
+
export { WEB_REPOSITORY_UPGRADES, WebStorage, openWebStorage, type WebAdapters, type WebStorageOptions, } from './storage/WebStorage.js';
|
|
33
|
+
export { WebStateStore } from './storage/WebStateStore.js';
|
|
34
|
+
export { AdapterClosedError, FILE_READ_CHUNK, FileNotFoundError, RecordsTransactionError, compareKeys, isUnder, type BlobInfo, type BlobKey, type BlobStat, type BlobSweepResult, type BlobsAdapter, type ByteSource, type FileStat, type FilesAdapter, type FilesOptions, type LockHold, type LockMode, type LockRequest, type LocksAdapter, type RecordEntry, type RecordKey, type RecordScan, type RecordsAdapter, type RecordsRead, type RecordsTransaction, } from './storage/adapters.js';
|
|
35
|
+
export { MemoryBlobs, MemoryFiles, MemoryLockSpace, MemoryLocks, MemoryRecordStore, MemoryRecords, openMemoryRecords, } from './storage/memory.js';
|
|
36
|
+
export { IndexedDbRecords, deleteIndexedDbRecords, openIndexedDbRecords, type IndexedDbOptions, } from './storage/indexeddb.js';
|
|
37
|
+
export { OpfsBlobs, OpfsFiles, opfsDirectory } from './storage/opfs.js';
|
|
38
|
+
export { WebLocks, openWebLocks, sessionLockName, type WebLocksOptions } from './storage/web-locks.js';
|
|
39
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,KAAK,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE9E,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,qBAAqB,EACrB,6BAA6B,EAC7B,sBAAsB,EACtB,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,yBAAyB,GAC/B,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,sBAAsB,EAAE,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAExF,OAAO,EACL,0BAA0B,EAC1B,WAAW,EACX,UAAU,EACV,aAAa,EACb,KAAK,oBAAoB,GAC1B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,KAAK,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE7H,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvF,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAEhG,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE1G,OAAO,EACL,uBAAuB,EACvB,UAAU,EACV,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,iBAAiB,GACvB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EACvB,WAAW,EACX,OAAO,EACP,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,kBAAkB,GACxB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,WAAW,EACX,WAAW,EACX,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,KAAK,gBAAgB,GACtB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAExE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* e3 in a browser: the page's connection to its e3 worker, and the seams the
|
|
7
|
+
* e3 worker runs e3 over — its storage over IndexedDB, OPFS and Web Locks,
|
|
8
|
+
* its runner over a pool of Web Workers, and its transfers.
|
|
9
|
+
*
|
|
10
|
+
* `createWebE3` connects a page to its e3 worker, whose script calls
|
|
11
|
+
* `serveE3()` from `@elaraai/e3-web/worker`, and gives the page the `fetch`
|
|
12
|
+
* the worker answers, with the URL e3's client is given. The seams the e3
|
|
13
|
+
* worker runs: `openWebStorage` opens e3's storage backend — `WebStorage`,
|
|
14
|
+
* over the four adapters below — and `WebStateStore` keeps a dataflow run's
|
|
15
|
+
* state beside it; `WebTaskRunner` runs a repository's units on the workers of
|
|
16
|
+
* a `UnitPool`: Web Workers whose script calls `serveUnits()` from
|
|
17
|
+
* `@elaraai/e3-web/units`, or, for a test in Node, workers in this thread
|
|
18
|
+
* (`inProcessUnits`); and `WebTransferBackend` stages uploads and runs the
|
|
19
|
+
* jobs, and `createWebDataEndpoints` answers the byte URLs it gives. This entry reaches nothing of Node, so a page or a worker bundles it.
|
|
20
|
+
* The files adapter over the machine's files is `@elaraai/e3-web/node`.
|
|
21
|
+
*
|
|
22
|
+
* @packageDocumentation
|
|
23
|
+
*/
|
|
24
|
+
export { createWebE3 } from './bridge/page.js';
|
|
25
|
+
export { DEFAULT_EXPORT_ROUND_BYTES, DEFAULT_RECORD_RETENTION_MS, DEFAULT_RESULT_TTL_MS, DEFAULT_RETENTION_INTERVAL_MS, DEFAULT_WEB_PART_BYTES, WebTransferBackend, } from './transfer/WebTransferBackend.js';
|
|
26
|
+
export { createWebDataEndpoints } from './transfer/endpoints.js';
|
|
27
|
+
export { DEFAULT_WHOLE_INTAKE_LIMIT, NO_COMMANDS, WEB_RUNNER, WebTaskRunner, } from './execution/WebTaskRunner.js';
|
|
28
|
+
export { UnitPool } from './execution/pool.js';
|
|
29
|
+
export { inProcessUnits } from './execution/in-process.js';
|
|
30
|
+
export { WEB_REPOSITORY_UPGRADES, WebStorage, openWebStorage, } from './storage/WebStorage.js';
|
|
31
|
+
export { WebStateStore } from './storage/WebStateStore.js';
|
|
32
|
+
export { AdapterClosedError, FILE_READ_CHUNK, FileNotFoundError, RecordsTransactionError, compareKeys, isUnder, } from './storage/adapters.js';
|
|
33
|
+
export { MemoryBlobs, MemoryFiles, MemoryLockSpace, MemoryLocks, MemoryRecordStore, MemoryRecords, openMemoryRecords, } from './storage/memory.js';
|
|
34
|
+
export { IndexedDbRecords, deleteIndexedDbRecords, openIndexedDbRecords, } from './storage/indexeddb.js';
|
|
35
|
+
export { OpfsBlobs, OpfsFiles, opfsDirectory } from './storage/opfs.js';
|
|
36
|
+
export { WebLocks, openWebLocks, sessionLockName } from './storage/web-locks.js';
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,WAAW,EAAiC,MAAM,kBAAkB,CAAC;AAE9E,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,qBAAqB,EACrB,6BAA6B,EAC7B,sBAAsB,EACtB,kBAAkB,GAGnB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,sBAAsB,EAAyB,MAAM,yBAAyB,CAAC;AAExF,OAAO,EACL,0BAA0B,EAC1B,WAAW,EACX,UAAU,EACV,aAAa,GAEd,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAgF,MAAM,qBAAqB,CAAC;AAE7H,OAAO,EAAE,cAAc,EAA8B,MAAM,2BAA2B,CAAC;AAMvF,OAAO,EACL,uBAAuB,EACvB,UAAU,EACV,cAAc,GAGf,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EACvB,WAAW,EACX,OAAO,GAoBR,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,WAAW,EACX,WAAW,EACX,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,GAErB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAExE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAwB,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../src/index.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|