@elaraai/e3-web 0.0.0-stage → 1.0.85
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,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
import { type DetachedResult, type DetachedRunOptions, type DetachedSpec, type IntakeOptions, type IntakeResult, type IntakeSpec, type RunningExecution, type SplitUnit, type StorageBackend, type TaskExecuteOptions, type TaskResult, type TaskRunner } from '@elaraai/e3-core/portable';
|
|
6
|
+
import type { LocksAdapter } from '../storage/adapters.js';
|
|
7
|
+
import type { UnitPool } from './pool.js';
|
|
8
|
+
/** What a browser records a command with: it runs none. */
|
|
9
|
+
export declare const NO_COMMANDS = "a browser runs no commands";
|
|
10
|
+
/** The largest delivery a browser's runner takes in whole, unless its host
|
|
11
|
+
* sets one: 256 MiB, since a unit holds its delivery in memory. */
|
|
12
|
+
export declare const DEFAULT_WHOLE_INTAKE_LIMIT: number;
|
|
13
|
+
/**
|
|
14
|
+
* A whole-intake limit, as a runner takes it: what a host that makes its
|
|
15
|
+
* runners as it needs them checks as it starts.
|
|
16
|
+
*
|
|
17
|
+
* @param limit - The limit the host gives, in bytes:
|
|
18
|
+
* {@link DEFAULT_WHOLE_INTAKE_LIMIT} unless given
|
|
19
|
+
* @returns The limit
|
|
20
|
+
* @throws {RangeError} When it is not a whole number of bytes, zero or more
|
|
21
|
+
*/
|
|
22
|
+
export declare function wholeIntakeLimitOf(limit?: number): number;
|
|
23
|
+
/** The runner a browser's units run on, as an intake names it. */
|
|
24
|
+
export declare const WEB_RUNNER = "east-web";
|
|
25
|
+
/**
|
|
26
|
+
* How a {@link WebTaskRunner} runs its repository's units.
|
|
27
|
+
*/
|
|
28
|
+
export interface WebTaskRunnerOptions {
|
|
29
|
+
/** The repository whose tasks it runs */
|
|
30
|
+
readonly repo: string;
|
|
31
|
+
/** The pool its units run on, which the runners of a page's repositories
|
|
32
|
+
* share */
|
|
33
|
+
readonly pool: UnitPool;
|
|
34
|
+
/** The tab's session: `WebStorage`'s locks (`storage.adapters.locks`). Its
|
|
35
|
+
* session owns every execution the runner records, and its liveness judges
|
|
36
|
+
* whether one recorded `running` can still finish */
|
|
37
|
+
readonly locks: LocksAdapter;
|
|
38
|
+
/** The largest delivery one intake unit takes in whole, in bytes:
|
|
39
|
+
* {@link DEFAULT_WHOLE_INTAKE_LIMIT} unless set */
|
|
40
|
+
readonly wholeIntakeLimit?: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* e3's {@link TaskRunner} in a browser: every unit on a worker of a pool,
|
|
44
|
+
* with east's `executeUnit`.
|
|
45
|
+
*
|
|
46
|
+
* @remarks
|
|
47
|
+
* Runtime-only options a browser has no use for are not used: `verbose`, the
|
|
48
|
+
* budget's `expectedPeakBytes` and `onRequeued` (no unit is requeued), and
|
|
49
|
+
* `extraEnv` (a browser's units have no environment to read). A unit waiting
|
|
50
|
+
* for a worker reports `onWaiting(0)`, a wait for a core alone. An execution
|
|
51
|
+
* environment is the app's: its unit workers' platform packages, so a task's
|
|
52
|
+
* `environment` is not materialized.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const storage = await openWebStorage();
|
|
57
|
+
* const pool = new UnitPool({ units: () => new Worker(new URL('./unit.worker.js', import.meta.url), { type: 'module' }) });
|
|
58
|
+
* const runner = new WebTaskRunner({ repo: 'default', pool, locks: storage.adapters.locks });
|
|
59
|
+
* const result = await runner.execute(storage, taskHash, inputHashes);
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export declare class WebTaskRunner implements TaskRunner {
|
|
63
|
+
readonly wholeIntakeLimit: number;
|
|
64
|
+
private readonly repo;
|
|
65
|
+
private readonly pool;
|
|
66
|
+
private readonly locks;
|
|
67
|
+
/** The owner every execution it records names: the tab's session */
|
|
68
|
+
private readonly owner;
|
|
69
|
+
/** Its judgement of whether an execution recorded running can finish, for
|
|
70
|
+
* the cache's probes */
|
|
71
|
+
private readonly liveness;
|
|
72
|
+
/**
|
|
73
|
+
* @param options - Its repository, its pool, the tab's session, and the
|
|
74
|
+
* largest delivery it takes in whole
|
|
75
|
+
* @throws {RangeError} When the whole-intake limit is not a whole number of
|
|
76
|
+
* bytes, zero or more
|
|
77
|
+
*/
|
|
78
|
+
constructor(options: WebTaskRunnerOptions);
|
|
79
|
+
execute(storage: StorageBackend, taskHash: string, inputHashes: string[], options?: TaskExecuteOptions): Promise<TaskResult>;
|
|
80
|
+
executeUnit(storage: StorageBackend, taskHash: string, unit: SplitUnit, options?: TaskExecuteOptions): Promise<TaskResult>;
|
|
81
|
+
/**
|
|
82
|
+
* Whether an execution recorded `running` can still finish: while the
|
|
83
|
+
* session its owner names lives — its Web Lock is held. An execution with no
|
|
84
|
+
* owner recorded, or owned by anything but a tab's session, cannot.
|
|
85
|
+
*/
|
|
86
|
+
executionAlive(storage: StorageBackend, taskHash: string, inputsHash: string, running: RunningExecution): Promise<boolean>;
|
|
87
|
+
/**
|
|
88
|
+
* Runs a function or one-shot call on a worker: its program and its
|
|
89
|
+
* arguments staged whole, its value returned inline, and nothing durable
|
|
90
|
+
* written.
|
|
91
|
+
*
|
|
92
|
+
* @remarks
|
|
93
|
+
* Its limits hold as a local call's do: past `timeoutMs` its worker is
|
|
94
|
+
* terminated, and replaced, and the call is `timed_out`; a value over
|
|
95
|
+
* `maxResultBytes` is `too_large`; each log stream keeps its last
|
|
96
|
+
* `maxLogBytes`. An aborted call is `failed` with exit code -1, as is a call
|
|
97
|
+
* on the custom runtime, which a browser cannot run: its stderr says so.
|
|
98
|
+
*
|
|
99
|
+
* @throws {Error} When an argument is a stored dataset and `options` gives no
|
|
100
|
+
* `storage` to stage it from.
|
|
101
|
+
*/
|
|
102
|
+
runDetached(spec: DetachedSpec, options?: DetachedRunOptions): Promise<DetachedResult>;
|
|
103
|
+
/**
|
|
104
|
+
* Takes a delivery the store holds in, or a run of its segments, through an
|
|
105
|
+
* intake unit on a worker, and stores what it wrote through the store's
|
|
106
|
+
* door.
|
|
107
|
+
*
|
|
108
|
+
* @remarks
|
|
109
|
+
* A run of a delivery's segments is staged as a blob of its own, read by
|
|
110
|
+
* ranges ({@link deliveryPiece}), so the unit holds its piece rather than
|
|
111
|
+
* the delivery; a delivery taken in whole is staged whole, which the shared
|
|
112
|
+
* intake bounds by {@link wholeIntakeLimit}.
|
|
113
|
+
*
|
|
114
|
+
* @throws {DeliveryRefusedError} When the unit refuses the delivery.
|
|
115
|
+
* @throws {Error} When the delivery is a file, which a browser's runner
|
|
116
|
+
* cannot read; when the unit's worker could not run it; or, as an
|
|
117
|
+
* `AbortError`, when the intake was aborted.
|
|
118
|
+
*/
|
|
119
|
+
intake(storage: StorageBackend, spec: IntakeSpec, options?: IntakeOptions): Promise<IntakeResult>;
|
|
120
|
+
/**
|
|
121
|
+
* Runs one execution's unit — a task's own, a piece of a split task, or a
|
|
122
|
+
* merge of its pieces' outputs — on a worker, and records it.
|
|
123
|
+
*
|
|
124
|
+
* @remarks
|
|
125
|
+
* A command is recorded `error`: a browser runs none. Otherwise the unit is
|
|
126
|
+
* staged — its program, the files its output kind folds with and its
|
|
127
|
+
* inputs, read from the store — and recorded `running` once a worker serves
|
|
128
|
+
* it, owned by the tab's session. What its console writes goes to the
|
|
129
|
+
* execution's log as it writes it. A set or a dict it left in several runs
|
|
130
|
+
* is merged into one by a second unit. Its end is recorded: `success` with
|
|
131
|
+
* its output stored through the store's door; `failed`, exit code 1, when
|
|
132
|
+
* its outcome is a failure, whose message and locations end its stderr;
|
|
133
|
+
* `cancelled` when the run was aborted, which terminated its worker; or
|
|
134
|
+
* `error` when e3 could not run it.
|
|
135
|
+
*
|
|
136
|
+
* @throws What staging a unit or recording its owner throws: an input the
|
|
137
|
+
* store no longer holds, say.
|
|
138
|
+
*/
|
|
139
|
+
private runUnit;
|
|
140
|
+
/**
|
|
141
|
+
* Stores a finished unit's output through the store's door: the file it is
|
|
142
|
+
* in, or the empty collection of a set or a dict that emitted nothing.
|
|
143
|
+
*/
|
|
144
|
+
private storeOutput;
|
|
145
|
+
/**
|
|
146
|
+
* Stages datasets as a unit's inputs, `input-<i>.beast2`, in order.
|
|
147
|
+
*
|
|
148
|
+
* @returns Their files, as the unit names them
|
|
149
|
+
*/
|
|
150
|
+
private stageDatasets;
|
|
151
|
+
/**
|
|
152
|
+
* Stages a stored dataset whole at a file a unit names: a collection as its
|
|
153
|
+
* manifest, with every segment it names beside it
|
|
154
|
+
* (`<file>.segments/<hash>.beast2`, the runner protocol's layout), and any
|
|
155
|
+
* other value as its object.
|
|
156
|
+
*/
|
|
157
|
+
private stageDataset;
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=WebTaskRunner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebTaskRunner.d.ts","sourceRoot":"","sources":["../../../src/execution/WebTaskRunner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgDH,OAAO,EA4BL,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EAIjB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,UAAU,EAEf,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,UAAU,EAEhB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAW,MAAM,WAAW,CAAC;AAGnD,2DAA2D;AAC3D,eAAO,MAAM,WAAW,+BAA+B,CAAC;AAExD;oEACoE;AACpE,eAAO,MAAM,0BAA0B,QAAgB,CAAC;AAExD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,GAAE,MAAmC,GAAG,MAAM,CAKrF;AAED,kEAAkE;AAClE,eAAO,MAAM,UAAU,aAAa,CAAC;AA2GrC;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;gBACY;IACZ,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB;;0DAEsD;IACtD,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B;wDACoD;IACpD,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACpC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,aAAc,YAAW,UAAU;IAC9C,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAW;IAChC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;IACrC,oEAAoE;IACpE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiB;IACvC;6BACyB;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoB;IAE7C;;;;;OAKG;gBACS,OAAO,EAAE,oBAAoB;IASnC,OAAO,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC;IAwBhI,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC;IAYpI;;;;OAIG;IACG,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IAMhI;;;;;;;;;;;;;;OAcG;IACG,WAAW,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,cAAc,CAAC;IA2DhG;;;;;;;;;;;;;;;OAeG;IACG,MAAM,CAAC,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;IAuC3G;;;;;;;;;;;;;;;;;;OAkBG;YACW,OAAO;IA6GrB;;;OAGG;YACW,WAAW;IAczB;;;;OAIG;YACW,aAAa;IAU3B;;;;;OAKG;YACW,YAAY;CAU3B"}
|