@polyengine/runtime 0.1.0-pre.g633468a
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 +202 -0
- package/README.md +23 -0
- package/esm/cabi/async_values.js +162 -0
- package/esm/cabi/bulk_lists.js +198 -0
- package/esm/cabi/context.js +42 -0
- package/esm/cabi/flatten.js +145 -0
- package/esm/cabi/float.js +67 -0
- package/esm/cabi/handles.js +253 -0
- package/esm/cabi/layout.js +149 -0
- package/esm/cabi/lift.js +196 -0
- package/esm/cabi/load.js +146 -0
- package/esm/cabi/lower.js +141 -0
- package/esm/cabi/memory.js +182 -0
- package/esm/cabi/mod.js +22 -0
- package/esm/cabi/store.js +186 -0
- package/esm/cabi/strings.js +336 -0
- package/esm/cabi/trap.js +38 -0
- package/esm/cabi/types.js +264 -0
- package/esm/cabi/values.js +64 -0
- package/esm/cache/core.js +156 -0
- package/esm/cache/dir.js +170 -0
- package/esm/cache/mod.js +4 -0
- package/esm/cache/web.js +136 -0
- package/esm/digest/digest.js +332 -0
- package/esm/digest/mod.js +3 -0
- package/esm/digest/verify.js +129 -0
- package/esm/embedder/casing.js +56 -0
- package/esm/embedder/copy.js +42 -0
- package/esm/embedder/errors.js +26 -0
- package/esm/embedder/imports.js +63 -0
- package/esm/embedder/instantiate.js +978 -0
- package/esm/embedder/mod.js +40 -0
- package/esm/embedder/resources.js +406 -0
- package/esm/embedder/streams.js +770 -0
- package/esm/embedder/values.js +450 -0
- package/esm/embedder/version.js +273 -0
- package/esm/exec/boundary.js +1902 -0
- package/esm/exec/executor.js +1004 -0
- package/esm/exec/host_streams.js +818 -0
- package/esm/exec/mod.js +4 -0
- package/esm/intrinsics/async_builtins.js +510 -0
- package/esm/intrinsics/context.js +90 -0
- package/esm/intrinsics/errors.js +13 -0
- package/esm/intrinsics/fact_calls.js +865 -0
- package/esm/intrinsics/mod.js +564 -0
- package/esm/intrinsics/stream_builtins.js +578 -0
- package/esm/intrinsics/transcode.js +443 -0
- package/esm/jspi/bridge.js +579 -0
- package/esm/jspi/mechanics.js +89 -0
- package/esm/jspi/mod.js +5 -0
- package/esm/jspi/suspending.js +15 -0
- package/esm/jspi/types.js +29 -0
- package/esm/package.json +3 -0
- package/esm/plan/format.js +5 -0
- package/esm/plan/loader.js +657 -0
- package/esm/plan/mod.js +3 -0
- package/esm/shim/mod.js +2 -0
- package/esm/shim/translator.js +94 -0
- package/esm/task/mod.js +483 -0
- package/esm/task/scheduler.js +1028 -0
- package/esm/task/streams.js +786 -0
- package/esm/task/subtask.js +135 -0
- package/esm/task/thread.js +255 -0
- package/esm/task/waitable.js +144 -0
- package/package.json +91 -0
- package/types/cabi/async_values.d.ts +35 -0
- package/types/cabi/bulk_lists.d.ts +18 -0
- package/types/cabi/context.d.ts +59 -0
- package/types/cabi/flatten.d.ts +14 -0
- package/types/cabi/float.d.ts +14 -0
- package/types/cabi/handles.d.ts +70 -0
- package/types/cabi/layout.d.ts +13 -0
- package/types/cabi/lift.d.ts +25 -0
- package/types/cabi/load.d.ts +14 -0
- package/types/cabi/lower.d.ts +10 -0
- package/types/cabi/memory.d.ts +58 -0
- package/types/cabi/mod.d.ts +15 -0
- package/types/cabi/store.d.ts +12 -0
- package/types/cabi/strings.d.ts +23 -0
- package/types/cabi/trap.d.ts +11 -0
- package/types/cabi/types.d.ts +206 -0
- package/types/cabi/values.d.ts +5 -0
- package/types/cache/core.d.ts +97 -0
- package/types/cache/dir.d.ts +6 -0
- package/types/cache/mod.d.ts +3 -0
- package/types/cache/web.d.ts +10 -0
- package/types/digest/digest.d.ts +17 -0
- package/types/digest/mod.d.ts +2 -0
- package/types/digest/verify.d.ts +48 -0
- package/types/embedder/casing.d.ts +40 -0
- package/types/embedder/copy.d.ts +24 -0
- package/types/embedder/errors.d.ts +11 -0
- package/types/embedder/imports.d.ts +47 -0
- package/types/embedder/instantiate.d.ts +88 -0
- package/types/embedder/mod.d.ts +11 -0
- package/types/embedder/resources.d.ts +158 -0
- package/types/embedder/streams.d.ts +202 -0
- package/types/embedder/values.d.ts +70 -0
- package/types/embedder/version.d.ts +85 -0
- package/types/exec/boundary.d.ts +360 -0
- package/types/exec/executor.d.ts +125 -0
- package/types/exec/host_streams.d.ts +165 -0
- package/types/exec/mod.d.ts +3 -0
- package/types/intrinsics/async_builtins.d.ts +69 -0
- package/types/intrinsics/context.d.ts +28 -0
- package/types/intrinsics/errors.d.ts +5 -0
- package/types/intrinsics/fact_calls.d.ts +120 -0
- package/types/intrinsics/mod.d.ts +187 -0
- package/types/intrinsics/stream_builtins.d.ts +113 -0
- package/types/intrinsics/transcode.d.ts +21 -0
- package/types/jspi/bridge.d.ts +227 -0
- package/types/jspi/mechanics.d.ts +50 -0
- package/types/jspi/mod.d.ts +3 -0
- package/types/jspi/suspending.d.ts +1 -0
- package/types/jspi/types.d.ts +26 -0
- package/types/plan/format.d.ts +369 -0
- package/types/plan/loader.d.ts +113 -0
- package/types/plan/mod.d.ts +2 -0
- package/types/shim/mod.d.ts +1 -0
- package/types/shim/translator.d.ts +55 -0
- package/types/task/mod.d.ts +257 -0
- package/types/task/scheduler.d.ts +421 -0
- package/types/task/streams.d.ts +370 -0
- package/types/task/subtask.d.ts +96 -0
- package/types/task/thread.d.ts +73 -0
- package/types/task/waitable.d.ts +67 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// The per-declaration suspendability marker (contracts/embedder-api.md
|
|
2
|
+
// §"Functions and async", amendments A1/A2; docs/architecture.md §5).
|
|
3
|
+
//
|
|
4
|
+
// The canonical definitions live in `@polyengine/protocol` since amendment A9:
|
|
5
|
+
// the mark is a process-global `Symbol.for("polyengine.suspending/1")` brand, so
|
|
6
|
+
// a function marked by ANY runtime copy is honored by every other copy
|
|
7
|
+
// (issue #83 — a module-local symbol made a copy-B mark invisible to copy A's
|
|
8
|
+
// `anySuspendingImport`, silently downgrading the calling convention and
|
|
9
|
+
// surfacing far away as `NeedsJspi`).
|
|
10
|
+
//
|
|
11
|
+
// Layering: this module was import-free on purpose (jspi/ stays standalone);
|
|
12
|
+
// A9 relaxes that to "imports `@polyengine/protocol` only" — the protocol package
|
|
13
|
+
// is itself dependency-free, so jspi/ still pulls in no runtime machinery.
|
|
14
|
+
// The embedder surface re-exports `suspending` from `@polyengine/runtime/embedder`.
|
|
15
|
+
export { anySuspendingImport, isSuspending, suspending } from "@polyengine/protocol";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Module-scoped types + accessor for the JS Promise Integration (JSPI) API.
|
|
2
|
+
//
|
|
3
|
+
// JSPI is phase 4 (docs/architecture.md §3) and not yet part of TypeScript's/Deno's
|
|
4
|
+
// built-in `lib.dom`/`lib.deno` typings. These declarations match the shape
|
|
5
|
+
// implemented by V8 (observed via Deno 2.9.5 / V8 15.0.245.2-rusty) and
|
|
6
|
+
// described by the js-promise-integration proposal Overview
|
|
7
|
+
// (https://github.com/WebAssembly/js-promise-integration).
|
|
8
|
+
//
|
|
9
|
+
// Deliberately NOT a `declare global` augmentation (it was one until JSR's
|
|
10
|
+
// server-side validation refused the package: "modifying global types is
|
|
11
|
+
// not allowed"). The registry policy and the truth agree here: JSPI is an
|
|
12
|
+
// OPTIONAL engine capability this runtime probes at runtime, and a global
|
|
13
|
+
// augmentation asserted it unconditionally for every downstream consumer.
|
|
14
|
+
// The module-scoped view keeps the assertion where the evidence is —
|
|
15
|
+
// `jspiApi()` returns the surface only when the engine actually has it.
|
|
16
|
+
// (Tests keep their own ambient declarations in
|
|
17
|
+
// runtime/tests/jspi/global_types.ts; test files are never published.)
|
|
18
|
+
/**
|
|
19
|
+
* The engine's JSPI API, or `null` where the proposal is not implemented.
|
|
20
|
+
* The one sanctioned way to reach `WebAssembly.Suspending`/`promising`
|
|
21
|
+
* from this codebase's published modules.
|
|
22
|
+
*/
|
|
23
|
+
export function jspiApi() {
|
|
24
|
+
const wa = WebAssembly;
|
|
25
|
+
return typeof wa.promising === "function" &&
|
|
26
|
+
typeof wa.Suspending === "function"
|
|
27
|
+
? wa
|
|
28
|
+
: null;
|
|
29
|
+
}
|
package/esm/package.json
ADDED