@awacloud/fw 0.1.0
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/CHANGELOG.md +79 -0
- package/LICENSE +176 -0
- package/NOTICE +12 -0
- package/README.md +355 -0
- package/dist/build/fw.core.pure.meta.json +29 -0
- package/dist/build/fw.core.pure.min.js +26 -0
- package/dist/build/fw.full.pure.meta.json +224 -0
- package/dist/build/fw.full.pure.min.js +60 -0
- package/dist/build/fw.minimal.pure.meta.json +21 -0
- package/dist/build/fw.minimal.pure.min.js +26 -0
- package/dist/build/fw.pack.compress-heavy.pure.meta.json +29 -0
- package/dist/build/fw.pack.compress-heavy.pure.min.js +8 -0
- package/dist/build/fw.pack.crypto-advanced.pure.meta.json +38 -0
- package/dist/build/fw.pack.crypto-advanced.pure.min.js +6 -0
- package/dist/build/fw.pack.crypto-basic.pure.meta.json +29 -0
- package/dist/build/fw.pack.crypto-basic.pure.min.js +6 -0
- package/dist/build/fw.pack.crypto-identity.pure.meta.json +29 -0
- package/dist/build/fw.pack.crypto-identity.pure.min.js +9 -0
- package/dist/build/fw.pack.realtime.pure.meta.json +21 -0
- package/dist/build/fw.pack.realtime.pure.min.js +6 -0
- package/dist/build/fw.pack.sensors.pure.meta.json +21 -0
- package/dist/build/fw.pack.sensors.pure.min.js +6 -0
- package/dist/build/fw.pack.structures-advanced.pure.meta.json +20 -0
- package/dist/build/fw.pack.structures-advanced.pure.min.js +6 -0
- package/dist/build/fw.pack.text-advanced.pure.meta.json +20 -0
- package/dist/build/fw.pack.text-advanced.pure.min.js +6 -0
- package/dist/build/fw.pwa.pure.meta.json +127 -0
- package/dist/build/fw.pwa.pure.min.js +55 -0
- package/dist/build/fw.site-interactive.pure.meta.json +81 -0
- package/dist/build/fw.site-interactive.pure.min.js +52 -0
- package/dist/build/fw.site.pure.meta.json +51 -0
- package/dist/build/fw.site.pure.min.js +35 -0
- package/dist/build/fw.spa.pure.meta.json +108 -0
- package/dist/build/fw.spa.pure.min.js +55 -0
- package/dist/build/io/compress/brotli_dict.bin +432 -0
- package/dist/build/sanity-base-classic.min.js +6 -0
- package/dist/build/sanity-community-classic.min.js +6 -0
- package/dist/build/sanity.min.js +6 -0
- package/dist/types/core/logger.d.ts +71 -0
- package/dist/types/core/logger.d.ts.map +1 -0
- package/dist/types/core/modules.d.ts +3962 -0
- package/dist/types/core/modules.d.ts.map +1 -0
- package/dist/types/core/readyState.d.ts +14 -0
- package/dist/types/core/readyState.d.ts.map +1 -0
- package/dist/types/core/runtime.d.ts +625 -0
- package/dist/types/core/runtime.d.ts.map +1 -0
- package/dist/types/core/worker-helper.d.ts +153 -0
- package/dist/types/core/worker-helper.d.ts.map +1 -0
- package/dist/types/crypto/cipher/aes.d.ts +55 -0
- package/dist/types/crypto/cipher/aes.d.ts.map +1 -0
- package/dist/types/crypto/cipher/chacha20.d.ts +33 -0
- package/dist/types/crypto/cipher/chacha20.d.ts.map +1 -0
- package/dist/types/crypto/hash/adf.d.ts +65 -0
- package/dist/types/crypto/hash/adf.d.ts.map +1 -0
- package/dist/types/crypto/hash/argon2.d.ts +79 -0
- package/dist/types/crypto/hash/argon2.d.ts.map +1 -0
- package/dist/types/crypto/hash/blake2b.d.ts +40 -0
- package/dist/types/crypto/hash/blake2b.d.ts.map +1 -0
- package/dist/types/crypto/hash/hkdf.d.ts +88 -0
- package/dist/types/crypto/hash/hkdf.d.ts.map +1 -0
- package/dist/types/crypto/hash/hmac.d.ts +85 -0
- package/dist/types/crypto/hash/hmac.d.ts.map +1 -0
- package/dist/types/crypto/hash/pbkdf2.d.ts +80 -0
- package/dist/types/crypto/hash/pbkdf2.d.ts.map +1 -0
- package/dist/types/crypto/hash/poly1305.d.ts +31 -0
- package/dist/types/crypto/hash/poly1305.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha224.d.ts +80 -0
- package/dist/types/crypto/hash/sha224.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha256.d.ts +82 -0
- package/dist/types/crypto/hash/sha256.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha3.d.ts +111 -0
- package/dist/types/crypto/hash/sha3.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha384.d.ts +84 -0
- package/dist/types/crypto/hash/sha384.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha512.d.ts +87 -0
- package/dist/types/crypto/hash/sha512.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha512_224.d.ts +84 -0
- package/dist/types/crypto/hash/sha512_224.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha512_256.d.ts +84 -0
- package/dist/types/crypto/hash/sha512_256.d.ts.map +1 -0
- package/dist/types/crypto/mode/cbc.d.ts +38 -0
- package/dist/types/crypto/mode/cbc.d.ts.map +1 -0
- package/dist/types/crypto/mode/chacha20poly1305.d.ts +71 -0
- package/dist/types/crypto/mode/chacha20poly1305.d.ts.map +1 -0
- package/dist/types/crypto/mode/cmac.d.ts +56 -0
- package/dist/types/crypto/mode/cmac.d.ts.map +1 -0
- package/dist/types/crypto/mode/ctr.d.ts +52 -0
- package/dist/types/crypto/mode/ctr.d.ts.map +1 -0
- package/dist/types/crypto/mode/gcm.d.ts +88 -0
- package/dist/types/crypto/mode/gcm.d.ts.map +1 -0
- package/dist/types/crypto/mode/kw.d.ts +60 -0
- package/dist/types/crypto/mode/kw.d.ts.map +1 -0
- package/dist/types/crypto/pkc/ecc.d.ts +284 -0
- package/dist/types/crypto/pkc/ecc.d.ts.map +1 -0
- package/dist/types/crypto/pkc/ed25519.d.ts +107 -0
- package/dist/types/crypto/pkc/ed25519.d.ts.map +1 -0
- package/dist/types/crypto/pkc/hybridKem.d.ts +154 -0
- package/dist/types/crypto/pkc/hybridKem.d.ts.map +1 -0
- package/dist/types/crypto/pkc/hybridSign.d.ts +383 -0
- package/dist/types/crypto/pkc/hybridSign.d.ts.map +1 -0
- package/dist/types/crypto/pkc/ml_dsa.d.ts +174 -0
- package/dist/types/crypto/pkc/ml_dsa.d.ts.map +1 -0
- package/dist/types/crypto/pkc/ml_kem.d.ts +194 -0
- package/dist/types/crypto/pkc/ml_kem.d.ts.map +1 -0
- package/dist/types/crypto/pkc/rsa.d.ts +175 -0
- package/dist/types/crypto/pkc/rsa.d.ts.map +1 -0
- package/dist/types/crypto/pkc/slh_dsa.d.ts +232 -0
- package/dist/types/crypto/pkc/slh_dsa.d.ts.map +1 -0
- package/dist/types/crypto/pkc/x25519.d.ts +37 -0
- package/dist/types/crypto/pkc/x25519.d.ts.map +1 -0
- package/dist/types/crypto/utils/aes_ctr.d.ts +84 -0
- package/dist/types/crypto/utils/aes_ctr.d.ts.map +1 -0
- package/dist/types/crypto/utils/aes_modes.d.ts +128 -0
- package/dist/types/crypto/utils/aes_modes.d.ts.map +1 -0
- package/dist/types/crypto/utils/asn1-oid.d.ts +45 -0
- package/dist/types/crypto/utils/asn1-oid.d.ts.map +1 -0
- package/dist/types/crypto/utils/asn1.d.ts +115 -0
- package/dist/types/crypto/utils/asn1.d.ts.map +1 -0
- package/dist/types/crypto/utils/bitArray.d.ts +75 -0
- package/dist/types/crypto/utils/bitArray.d.ts.map +1 -0
- package/dist/types/crypto/utils/bn.d.ts +214 -0
- package/dist/types/crypto/utils/bn.d.ts.map +1 -0
- package/dist/types/crypto/utils/jws.d.ts +159 -0
- package/dist/types/crypto/utils/jws.d.ts.map +1 -0
- package/dist/types/crypto/utils/keyformat.d.ts +100 -0
- package/dist/types/crypto/utils/keyformat.d.ts.map +1 -0
- package/dist/types/crypto/utils/pad.d.ts +44 -0
- package/dist/types/crypto/utils/pad.d.ts.map +1 -0
- package/dist/types/crypto/utils/pem.d.ts +41 -0
- package/dist/types/crypto/utils/pem.d.ts.map +1 -0
- package/dist/types/crypto/utils/random.d.ts +203 -0
- package/dist/types/crypto/utils/random.d.ts.map +1 -0
- package/dist/types/crypto/utils/rsaKeygen.d.ts +162 -0
- package/dist/types/crypto/utils/rsaKeygen.d.ts.map +1 -0
- package/dist/types/crypto/utils/totp.d.ts +183 -0
- package/dist/types/crypto/utils/totp.d.ts.map +1 -0
- package/dist/types/crypto/utils/uuid.d.ts +29 -0
- package/dist/types/crypto/utils/uuid.d.ts.map +1 -0
- package/dist/types/crypto/wasm/aes.d.ts +59 -0
- package/dist/types/crypto/wasm/aes.d.ts.map +1 -0
- package/dist/types/crypto/wasm/argon2.d.ts +70 -0
- package/dist/types/crypto/wasm/argon2.d.ts.map +1 -0
- package/dist/types/crypto/wasm/blake2b.d.ts +59 -0
- package/dist/types/crypto/wasm/blake2b.d.ts.map +1 -0
- package/dist/types/crypto/wasm/chacha20poly1305.d.ts +43 -0
- package/dist/types/crypto/wasm/chacha20poly1305.d.ts.map +1 -0
- package/dist/types/crypto/wasm/cmac.d.ts +42 -0
- package/dist/types/crypto/wasm/cmac.d.ts.map +1 -0
- package/dist/types/crypto/wasm/ecc.d.ts +56 -0
- package/dist/types/crypto/wasm/ecc.d.ts.map +1 -0
- package/dist/types/crypto/wasm/ed25519.d.ts +52 -0
- package/dist/types/crypto/wasm/ed25519.d.ts.map +1 -0
- package/dist/types/crypto/wasm/hkdf.d.ts +40 -0
- package/dist/types/crypto/wasm/hkdf.d.ts.map +1 -0
- package/dist/types/crypto/wasm/hmac.d.ts +42 -0
- package/dist/types/crypto/wasm/hmac.d.ts.map +1 -0
- package/dist/types/crypto/wasm/ml_dsa.d.ts +48 -0
- package/dist/types/crypto/wasm/ml_dsa.d.ts.map +1 -0
- package/dist/types/crypto/wasm/ml_kem.d.ts +58 -0
- package/dist/types/crypto/wasm/ml_kem.d.ts.map +1 -0
- package/dist/types/crypto/wasm/pbkdf2.d.ts +38 -0
- package/dist/types/crypto/wasm/pbkdf2.d.ts.map +1 -0
- package/dist/types/crypto/wasm/rsa.d.ts +56 -0
- package/dist/types/crypto/wasm/rsa.d.ts.map +1 -0
- package/dist/types/crypto/wasm/runtime.d.ts +99 -0
- package/dist/types/crypto/wasm/runtime.d.ts.map +1 -0
- package/dist/types/crypto/wasm/sha2.d.ts +45 -0
- package/dist/types/crypto/wasm/sha2.d.ts.map +1 -0
- package/dist/types/crypto/wasm/sha3.d.ts +57 -0
- package/dist/types/crypto/wasm/sha3.d.ts.map +1 -0
- package/dist/types/crypto/wasm/slh_dsa.d.ts +62 -0
- package/dist/types/crypto/wasm/slh_dsa.d.ts.map +1 -0
- package/dist/types/crypto/wasm/x25519.d.ts +53 -0
- package/dist/types/crypto/wasm/x25519.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/aes.d.ts +59 -0
- package/dist/types/crypto/webcrypto/aes.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/aeskw.d.ts +40 -0
- package/dist/types/crypto/webcrypto/aeskw.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/digest.d.ts +43 -0
- package/dist/types/crypto/webcrypto/digest.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/ecc.d.ts +51 -0
- package/dist/types/crypto/webcrypto/ecc.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/ed25519.d.ts +43 -0
- package/dist/types/crypto/webcrypto/ed25519.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/hkdf.d.ts +18 -0
- package/dist/types/crypto/webcrypto/hkdf.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/hmac.d.ts +43 -0
- package/dist/types/crypto/webcrypto/hmac.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/pbkdf2.d.ts +18 -0
- package/dist/types/crypto/webcrypto/pbkdf2.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/rsa.d.ts +51 -0
- package/dist/types/crypto/webcrypto/rsa.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/x25519.d.ts +43 -0
- package/dist/types/crypto/webcrypto/x25519.d.ts.map +1 -0
- package/dist/types/dom/display/animate.d.ts +35 -0
- package/dist/types/dom/display/animate.d.ts.map +1 -0
- package/dist/types/dom/display/fullscreen.d.ts +59 -0
- package/dist/types/dom/display/fullscreen.d.ts.map +1 -0
- package/dist/types/dom/fs/download.d.ts +36 -0
- package/dist/types/dom/fs/download.d.ts.map +1 -0
- package/dist/types/dom/fs/fsAccess.d.ts +107 -0
- package/dist/types/dom/fs/fsAccess.d.ts.map +1 -0
- package/dist/types/dom/fs/indexedDB.d.ts +62 -0
- package/dist/types/dom/fs/indexedDB.d.ts.map +1 -0
- package/dist/types/dom/fs/remoteStore.d.ts +64 -0
- package/dist/types/dom/fs/remoteStore.d.ts.map +1 -0
- package/dist/types/dom/fs/storage.d.ts +56 -0
- package/dist/types/dom/fs/storage.d.ts.map +1 -0
- package/dist/types/dom/lifecycle/idle.d.ts +91 -0
- package/dist/types/dom/lifecycle/idle.d.ts.map +1 -0
- package/dist/types/dom/lifecycle/visibility.d.ts +49 -0
- package/dist/types/dom/lifecycle/visibility.d.ts.map +1 -0
- package/dist/types/dom/lifecycle/wakeLock.d.ts +69 -0
- package/dist/types/dom/lifecycle/wakeLock.d.ts.map +1 -0
- package/dist/types/dom/net/ajax.d.ts +27 -0
- package/dist/types/dom/net/ajax.d.ts.map +1 -0
- package/dist/types/dom/net/broadcastChannel.d.ts +51 -0
- package/dist/types/dom/net/broadcastChannel.d.ts.map +1 -0
- package/dist/types/dom/net/network.d.ts +80 -0
- package/dist/types/dom/net/network.d.ts.map +1 -0
- package/dist/types/dom/net/sse.d.ts +72 -0
- package/dist/types/dom/net/sse.d.ts.map +1 -0
- package/dist/types/dom/net/webrtc.d.ts +149 -0
- package/dist/types/dom/net/webrtc.d.ts.map +1 -0
- package/dist/types/dom/net/ws.d.ts +70 -0
- package/dist/types/dom/net/ws.d.ts.map +1 -0
- package/dist/types/dom/query/dnd.d.ts +86 -0
- package/dist/types/dom/query/dnd.d.ts.map +1 -0
- package/dist/types/dom/query/dom.d.ts +194 -0
- package/dist/types/dom/query/dom.d.ts.map +1 -0
- package/dist/types/dom/query/events.d.ts +135 -0
- package/dist/types/dom/query/events.d.ts.map +1 -0
- package/dist/types/dom/query/gesture.d.ts +59 -0
- package/dist/types/dom/query/gesture.d.ts.map +1 -0
- package/dist/types/dom/query/media.d.ts +156 -0
- package/dist/types/dom/query/media.d.ts.map +1 -0
- package/dist/types/dom/rendering/chart.d.ts +143 -0
- package/dist/types/dom/rendering/chart.d.ts.map +1 -0
- package/dist/types/dom/rendering/component.d.ts +92 -0
- package/dist/types/dom/rendering/component.d.ts.map +1 -0
- package/dist/types/dom/rendering/devtools-ui.d.ts +83 -0
- package/dist/types/dom/rendering/devtools-ui.d.ts.map +1 -0
- package/dist/types/dom/rendering/devtools.d.ts +68 -0
- package/dist/types/dom/rendering/devtools.d.ts.map +1 -0
- package/dist/types/dom/rendering/parser.d.ts +216 -0
- package/dist/types/dom/rendering/parser.d.ts.map +1 -0
- package/dist/types/dom/rendering/reactiveBind.d.ts +101 -0
- package/dist/types/dom/rendering/reactiveBind.d.ts.map +1 -0
- package/dist/types/dom/rendering/render.d.ts +121 -0
- package/dist/types/dom/rendering/render.d.ts.map +1 -0
- package/dist/types/dom/rendering/sanitize.d.ts +48 -0
- package/dist/types/dom/rendering/sanitize.d.ts.map +1 -0
- package/dist/types/dom/rendering/secPolicy.d.ts +89 -0
- package/dist/types/dom/rendering/secPolicy.d.ts.map +1 -0
- package/dist/types/dom/rendering/template.d.ts +251 -0
- package/dist/types/dom/rendering/template.d.ts.map +1 -0
- package/dist/types/dom/rendering/themeTokens.d.ts +61 -0
- package/dist/types/dom/rendering/themeTokens.d.ts.map +1 -0
- package/dist/types/dom/rendering/uiSession-core.d.ts +192 -0
- package/dist/types/dom/rendering/uiSession-core.d.ts.map +1 -0
- package/dist/types/dom/rendering/uiSession-direct.d.ts +63 -0
- package/dist/types/dom/rendering/uiSession-direct.d.ts.map +1 -0
- package/dist/types/dom/rendering/uiSession-list.d.ts +205 -0
- package/dist/types/dom/rendering/uiSession-list.d.ts.map +1 -0
- package/dist/types/dom/rendering/uiSession.d.ts +285 -0
- package/dist/types/dom/rendering/uiSession.d.ts.map +1 -0
- package/dist/types/dom/rendering/virtualScroll.d.ts +80 -0
- package/dist/types/dom/rendering/virtualScroll.d.ts.map +1 -0
- package/dist/types/dom/sensors/battery.d.ts +71 -0
- package/dist/types/dom/sensors/battery.d.ts.map +1 -0
- package/dist/types/dom/sensors/geolocation.d.ts +83 -0
- package/dist/types/dom/sensors/geolocation.d.ts.map +1 -0
- package/dist/types/dom/sensors/networkInfo.d.ts +82 -0
- package/dist/types/dom/sensors/networkInfo.d.ts.map +1 -0
- package/dist/types/dom/sensors/sensors.d.ts +191 -0
- package/dist/types/dom/sensors/sensors.d.ts.map +1 -0
- package/dist/types/dom/sw/backgroundSync.d.ts +48 -0
- package/dist/types/dom/sw/backgroundSync.d.ts.map +1 -0
- package/dist/types/dom/sw/cache.d.ts +71 -0
- package/dist/types/dom/sw/cache.d.ts.map +1 -0
- package/dist/types/dom/sw/push.d.ts +77 -0
- package/dist/types/dom/sw/push.d.ts.map +1 -0
- package/dist/types/dom/sw/serviceWorker.d.ts +57 -0
- package/dist/types/dom/sw/serviceWorker.d.ts.map +1 -0
- package/dist/types/dom/sw/sharedWorker.d.ts +81 -0
- package/dist/types/dom/sw/sharedWorker.d.ts.map +1 -0
- package/dist/types/dom/utils/a11y.d.ts +53 -0
- package/dist/types/dom/utils/a11y.d.ts.map +1 -0
- package/dist/types/dom/utils/clipboard.d.ts +44 -0
- package/dist/types/dom/utils/clipboard.d.ts.map +1 -0
- package/dist/types/dom/utils/entropyCollector.d.ts +58 -0
- package/dist/types/dom/utils/entropyCollector.d.ts.map +1 -0
- package/dist/types/dom/utils/focus.d.ts +123 -0
- package/dist/types/dom/utils/focus.d.ts.map +1 -0
- package/dist/types/dom/utils/form.d.ts +227 -0
- package/dist/types/dom/utils/form.d.ts.map +1 -0
- package/dist/types/dom/utils/formKit.d.ts +206 -0
- package/dist/types/dom/utils/formKit.d.ts.map +1 -0
- package/dist/types/dom/utils/keybindings.d.ts +53 -0
- package/dist/types/dom/utils/keybindings.d.ts.map +1 -0
- package/dist/types/dom/utils/leaderElection.d.ts +70 -0
- package/dist/types/dom/utils/leaderElection.d.ts.map +1 -0
- package/dist/types/dom/utils/notifications.d.ts +164 -0
- package/dist/types/dom/utils/notifications.d.ts.map +1 -0
- package/dist/types/dom/utils/permissions.d.ts +35 -0
- package/dist/types/dom/utils/permissions.d.ts.map +1 -0
- package/dist/types/dom/utils/route.d.ts +117 -0
- package/dist/types/dom/utils/route.d.ts.map +1 -0
- package/dist/types/dom/utils/ua.d.ts +35 -0
- package/dist/types/dom/utils/ua.d.ts.map +1 -0
- package/dist/types/dom/utils/webauthn.d.ts +98 -0
- package/dist/types/dom/utils/webauthn.d.ts.map +1 -0
- package/dist/types/io/binary/reader.d.ts +59 -0
- package/dist/types/io/binary/reader.d.ts.map +1 -0
- package/dist/types/io/binary/writer.d.ts +56 -0
- package/dist/types/io/binary/writer.d.ts.map +1 -0
- package/dist/types/io/calc/adler32.d.ts +31 -0
- package/dist/types/io/calc/adler32.d.ts.map +1 -0
- package/dist/types/io/calc/bigint.d.ts +74 -0
- package/dist/types/io/calc/bigint.d.ts.map +1 -0
- package/dist/types/io/calc/crc32.d.ts +36 -0
- package/dist/types/io/calc/crc32.d.ts.map +1 -0
- package/dist/types/io/calc/easing.d.ts +60 -0
- package/dist/types/io/calc/easing.d.ts.map +1 -0
- package/dist/types/io/codec/b64.d.ts +28 -0
- package/dist/types/io/codec/b64.d.ts.map +1 -0
- package/dist/types/io/codec/base32.d.ts +28 -0
- package/dist/types/io/codec/base32.d.ts.map +1 -0
- package/dist/types/io/codec/base58.d.ts +28 -0
- package/dist/types/io/codec/base58.d.ts.map +1 -0
- package/dist/types/io/codec/buffer.d.ts +66 -0
- package/dist/types/io/codec/buffer.d.ts.map +1 -0
- package/dist/types/io/codec/cbor.d.ts +43 -0
- package/dist/types/io/codec/cbor.d.ts.map +1 -0
- package/dist/types/io/codec/csv.d.ts +35 -0
- package/dist/types/io/codec/csv.d.ts.map +1 -0
- package/dist/types/io/codec/hex.d.ts +28 -0
- package/dist/types/io/codec/hex.d.ts.map +1 -0
- package/dist/types/io/codec/mime.d.ts +100 -0
- package/dist/types/io/codec/mime.d.ts.map +1 -0
- package/dist/types/io/codec/msgpack.d.ts +36 -0
- package/dist/types/io/codec/msgpack.d.ts.map +1 -0
- package/dist/types/io/codec/url.d.ts +52 -0
- package/dist/types/io/codec/url.d.ts.map +1 -0
- package/dist/types/io/codec/utf8.d.ts +22 -0
- package/dist/types/io/codec/utf8.d.ts.map +1 -0
- package/dist/types/io/codec/xml.d.ts +91 -0
- package/dist/types/io/codec/xml.d.ts.map +1 -0
- package/dist/types/io/compress/bitstream.d.ts +51 -0
- package/dist/types/io/compress/bitstream.d.ts.map +1 -0
- package/dist/types/io/compress/brotli.d.ts +86 -0
- package/dist/types/io/compress/brotli.d.ts.map +1 -0
- package/dist/types/io/compress/brotli_dict.d.ts +76 -0
- package/dist/types/io/compress/brotli_dict.d.ts.map +1 -0
- package/dist/types/io/compress/brotli_dict_words.d.ts +43 -0
- package/dist/types/io/compress/brotli_dict_words.d.ts.map +1 -0
- package/dist/types/io/compress/brotli_frame.d.ts +166 -0
- package/dist/types/io/compress/brotli_frame.d.ts.map +1 -0
- package/dist/types/io/compress/brotli_shared.d.ts +165 -0
- package/dist/types/io/compress/brotli_shared.d.ts.map +1 -0
- package/dist/types/io/compress/deflate.d.ts +89 -0
- package/dist/types/io/compress/deflate.d.ts.map +1 -0
- package/dist/types/io/compress/gzip.d.ts +100 -0
- package/dist/types/io/compress/gzip.d.ts.map +1 -0
- package/dist/types/io/compress/huffman.d.ts +37 -0
- package/dist/types/io/compress/huffman.d.ts.map +1 -0
- package/dist/types/io/compress/lz4.d.ts +45 -0
- package/dist/types/io/compress/lz4.d.ts.map +1 -0
- package/dist/types/io/compress/lz77.d.ts +66 -0
- package/dist/types/io/compress/lz77.d.ts.map +1 -0
- package/dist/types/io/compress/lzw.d.ts +37 -0
- package/dist/types/io/compress/lzw.d.ts.map +1 -0
- package/dist/types/io/compress/zip.d.ts +112 -0
- package/dist/types/io/compress/zip.d.ts.map +1 -0
- package/dist/types/io/compress/zlib.d.ts +97 -0
- package/dist/types/io/compress/zlib.d.ts.map +1 -0
- package/dist/types/io/i18n/i18n.d.ts +64 -0
- package/dist/types/io/i18n/i18n.d.ts.map +1 -0
- package/dist/types/io/math/fixed-point.d.ts +30 -0
- package/dist/types/io/math/fixed-point.d.ts.map +1 -0
- package/dist/types/io/math/geom.d.ts +125 -0
- package/dist/types/io/math/geom.d.ts.map +1 -0
- package/dist/types/io/math/interp.d.ts +48 -0
- package/dist/types/io/math/interp.d.ts.map +1 -0
- package/dist/types/io/math/linalg.d.ts +117 -0
- package/dist/types/io/math/linalg.d.ts.map +1 -0
- package/dist/types/io/math/stats.d.ts +45 -0
- package/dist/types/io/math/stats.d.ts.map +1 -0
- package/dist/types/io/structures/btree.d.ts +84 -0
- package/dist/types/io/structures/btree.d.ts.map +1 -0
- package/dist/types/io/structures/heap.d.ts +75 -0
- package/dist/types/io/structures/heap.d.ts.map +1 -0
- package/dist/types/io/structures/lruCache.d.ts +88 -0
- package/dist/types/io/structures/lruCache.d.ts.map +1 -0
- package/dist/types/io/structures/ringBuffer.d.ts +82 -0
- package/dist/types/io/structures/ringBuffer.d.ts.map +1 -0
- package/dist/types/io/structures/tree-walker.d.ts +95 -0
- package/dist/types/io/structures/tree-walker.d.ts.map +1 -0
- package/dist/types/io/structures/trie.d.ts +71 -0
- package/dist/types/io/structures/trie.d.ts.map +1 -0
- package/dist/types/io/sync/abort.d.ts +59 -0
- package/dist/types/io/sync/abort.d.ts.map +1 -0
- package/dist/types/io/sync/atomics.d.ts +107 -0
- package/dist/types/io/sync/atomics.d.ts.map +1 -0
- package/dist/types/io/sync/cancellable.d.ts +69 -0
- package/dist/types/io/sync/cancellable.d.ts.map +1 -0
- package/dist/types/io/sync/channel.d.ts +70 -0
- package/dist/types/io/sync/channel.d.ts.map +1 -0
- package/dist/types/io/sync/mutex.d.ts +39 -0
- package/dist/types/io/sync/mutex.d.ts.map +1 -0
- package/dist/types/io/sync/semaphore.d.ts +40 -0
- package/dist/types/io/sync/semaphore.d.ts.map +1 -0
- package/dist/types/io/sync/tokenBucket.d.ts +53 -0
- package/dist/types/io/sync/tokenBucket.d.ts.map +1 -0
- package/dist/types/io/text/ansi.d.ts +125 -0
- package/dist/types/io/text/ansi.d.ts.map +1 -0
- package/dist/types/io/text/html-entities.d.ts +35 -0
- package/dist/types/io/text/html-entities.d.ts.map +1 -0
- package/dist/types/io/text/semver.d.ts +75 -0
- package/dist/types/io/text/semver.d.ts.map +1 -0
- package/dist/types/io/text/str.d.ts +88 -0
- package/dist/types/io/text/str.d.ts.map +1 -0
- package/dist/types/io/text/unicode.d.ts +70 -0
- package/dist/types/io/text/unicode.d.ts.map +1 -0
- package/dist/types/io/time/date.d.ts +73 -0
- package/dist/types/io/time/date.d.ts.map +1 -0
- package/dist/types/io/timing/clock.d.ts +39 -0
- package/dist/types/io/timing/clock.d.ts.map +1 -0
- package/dist/types/io/timing/rateLimit.d.ts +40 -0
- package/dist/types/io/timing/rateLimit.d.ts.map +1 -0
- package/dist/types/io/timing/scheduler.d.ts +122 -0
- package/dist/types/io/timing/scheduler.d.ts.map +1 -0
- package/dist/types/io/utils/bitmap.d.ts +34 -0
- package/dist/types/io/utils/bitmap.d.ts.map +1 -0
- package/dist/types/io/utils/errors.d.ts +94 -0
- package/dist/types/io/utils/errors.d.ts.map +1 -0
- package/dist/types/io/utils/eventBus.d.ts +68 -0
- package/dist/types/io/utils/eventBus.d.ts.map +1 -0
- package/dist/types/io/utils/queue.d.ts +69 -0
- package/dist/types/io/utils/queue.d.ts.map +1 -0
- package/dist/types/io/utils/signal.d.ts +362 -0
- package/dist/types/io/utils/signal.d.ts.map +1 -0
- package/dist/types/io/utils/ui8.d.ts +34 -0
- package/dist/types/io/utils/ui8.d.ts.map +1 -0
- package/dist/types/io/utils/valid.d.ts +130 -0
- package/dist/types/io/utils/valid.d.ts.map +1 -0
- package/dist/types/main.d.ts +25 -0
- package/dist/types/main.d.ts.map +1 -0
- package/dist/types/process/message.d.ts +64 -0
- package/dist/types/process/message.d.ts.map +1 -0
- package/dist/types/process/rpc.d.ts +35 -0
- package/dist/types/process/rpc.d.ts.map +1 -0
- package/dist/types/process/workerPool.d.ts +62 -0
- package/dist/types/process/workerPool.d.ts.map +1 -0
- package/dist/types/sanity/base.d.ts +28 -0
- package/dist/types/sanity/base.d.ts.map +1 -0
- package/dist/types/sanity/community.d.ts +20 -0
- package/dist/types/sanity/community.d.ts.map +1 -0
- package/dist/types/sanity/lockdown-apply.d.ts +7 -0
- package/dist/types/sanity/lockdown-apply.d.ts.map +1 -0
- package/dist/types/sanity/lockdown.d.ts +43 -0
- package/dist/types/sanity/lockdown.d.ts.map +1 -0
- package/dist/types/sanity/wasm-gate.d.ts +128 -0
- package/dist/types/sanity/wasm-gate.d.ts.map +1 -0
- package/docs/README.md +301 -0
- package/docs/api/README.md +33 -0
- package/docs/api/core/README.md +14 -0
- package/docs/api/core/logger.md +151 -0
- package/docs/api/core/main.md +105 -0
- package/docs/api/core/modules.md +123 -0
- package/docs/api/core/readyState.md +94 -0
- package/docs/api/core/runtime.md +499 -0
- package/docs/api/core/worker-helper.md +180 -0
- package/docs/api/crypto/README.md +39 -0
- package/docs/api/crypto/cipher/README.md +24 -0
- package/docs/api/crypto/cipher/aes.md +101 -0
- package/docs/api/crypto/cipher/chacha20.md +85 -0
- package/docs/api/crypto/hash/README.md +49 -0
- package/docs/api/crypto/hash/adf.md +61 -0
- package/docs/api/crypto/hash/argon2.md +92 -0
- package/docs/api/crypto/hash/blake2b.md +88 -0
- package/docs/api/crypto/hash/hkdf.md +82 -0
- package/docs/api/crypto/hash/hmac.md +90 -0
- package/docs/api/crypto/hash/pbkdf2.md +93 -0
- package/docs/api/crypto/hash/poly1305.md +71 -0
- package/docs/api/crypto/hash/sha224.md +61 -0
- package/docs/api/crypto/hash/sha256.md +84 -0
- package/docs/api/crypto/hash/sha3.md +89 -0
- package/docs/api/crypto/hash/sha384.md +58 -0
- package/docs/api/crypto/hash/sha512.md +73 -0
- package/docs/api/crypto/hash/sha512_224.md +59 -0
- package/docs/api/crypto/hash/sha512_256.md +58 -0
- package/docs/api/crypto/mode/README.md +33 -0
- package/docs/api/crypto/mode/cbc.md +69 -0
- package/docs/api/crypto/mode/chacha20poly1305.md +77 -0
- package/docs/api/crypto/mode/cmac.md +79 -0
- package/docs/api/crypto/mode/ctr.md +66 -0
- package/docs/api/crypto/mode/gcm.md +93 -0
- package/docs/api/crypto/mode/kw.md +84 -0
- package/docs/api/crypto/pkc/README.md +48 -0
- package/docs/api/crypto/pkc/ecc.md +91 -0
- package/docs/api/crypto/pkc/ed25519.md +99 -0
- package/docs/api/crypto/pkc/hybridKem.md +178 -0
- package/docs/api/crypto/pkc/hybridSign.md +192 -0
- package/docs/api/crypto/pkc/ml_dsa.md +99 -0
- package/docs/api/crypto/pkc/ml_kem.md +90 -0
- package/docs/api/crypto/pkc/rsa.md +87 -0
- package/docs/api/crypto/pkc/slh_dsa.md +86 -0
- package/docs/api/crypto/pkc/x25519.md +84 -0
- package/docs/api/crypto/utils/README.md +39 -0
- package/docs/api/crypto/utils/aes_ctr.md +71 -0
- package/docs/api/crypto/utils/aes_modes.md +81 -0
- package/docs/api/crypto/utils/asn1-oid.md +130 -0
- package/docs/api/crypto/utils/asn1.md +69 -0
- package/docs/api/crypto/utils/bitArray.md +77 -0
- package/docs/api/crypto/utils/bn.md +67 -0
- package/docs/api/crypto/utils/jws.md +94 -0
- package/docs/api/crypto/utils/keyformat.md +78 -0
- package/docs/api/crypto/utils/pad.md +66 -0
- package/docs/api/crypto/utils/pem.md +63 -0
- package/docs/api/crypto/utils/random.md +103 -0
- package/docs/api/crypto/utils/rsaKeygen.md +118 -0
- package/docs/api/crypto/utils/totp.md +159 -0
- package/docs/api/crypto/utils/uuid.md +98 -0
- package/docs/api/crypto/wasm/README.md +76 -0
- package/docs/api/crypto/wasm/aes.md +128 -0
- package/docs/api/crypto/wasm/argon2.md +110 -0
- package/docs/api/crypto/wasm/blake2b.md +103 -0
- package/docs/api/crypto/wasm/chacha20poly1305.md +120 -0
- package/docs/api/crypto/wasm/cmac.md +119 -0
- package/docs/api/crypto/wasm/ecc.md +114 -0
- package/docs/api/crypto/wasm/ed25519.md +117 -0
- package/docs/api/crypto/wasm/hkdf.md +163 -0
- package/docs/api/crypto/wasm/hmac.md +129 -0
- package/docs/api/crypto/wasm/ml_dsa.md +99 -0
- package/docs/api/crypto/wasm/ml_kem.md +91 -0
- package/docs/api/crypto/wasm/pbkdf2.md +111 -0
- package/docs/api/crypto/wasm/rsa.md +113 -0
- package/docs/api/crypto/wasm/runtime.md +172 -0
- package/docs/api/crypto/wasm/sha2.md +95 -0
- package/docs/api/crypto/wasm/sha3.md +127 -0
- package/docs/api/crypto/wasm/slh_dsa.md +89 -0
- package/docs/api/crypto/wasm/x25519.md +116 -0
- package/docs/api/crypto/webcrypto/README.md +56 -0
- package/docs/api/crypto/webcrypto/aes.md +140 -0
- package/docs/api/crypto/webcrypto/aeskw.md +120 -0
- package/docs/api/crypto/webcrypto/digest.md +103 -0
- package/docs/api/crypto/webcrypto/ecc.md +122 -0
- package/docs/api/crypto/webcrypto/ed25519.md +121 -0
- package/docs/api/crypto/webcrypto/hkdf.md +141 -0
- package/docs/api/crypto/webcrypto/hmac.md +112 -0
- package/docs/api/crypto/webcrypto/pbkdf2.md +140 -0
- package/docs/api/crypto/webcrypto/rsa.md +149 -0
- package/docs/api/crypto/webcrypto/x25519.md +96 -0
- package/docs/api/dom/README.md +117 -0
- package/docs/api/dom/display/README.md +27 -0
- package/docs/api/dom/display/animate.md +113 -0
- package/docs/api/dom/display/fullscreen.md +121 -0
- package/docs/api/dom/fs/README.md +36 -0
- package/docs/api/dom/fs/download.md +108 -0
- package/docs/api/dom/fs/fsAccess.md +200 -0
- package/docs/api/dom/fs/indexedDB.md +219 -0
- package/docs/api/dom/fs/remoteStore.md +158 -0
- package/docs/api/dom/fs/storage.md +197 -0
- package/docs/api/dom/lifecycle/README.md +11 -0
- package/docs/api/dom/lifecycle/idle.md +89 -0
- package/docs/api/dom/lifecycle/visibility.md +73 -0
- package/docs/api/dom/lifecycle/wakeLock.md +94 -0
- package/docs/api/dom/net/README.md +31 -0
- package/docs/api/dom/net/ajax.md +176 -0
- package/docs/api/dom/net/broadcastChannel.md +110 -0
- package/docs/api/dom/net/network.md +137 -0
- package/docs/api/dom/net/sse.md +141 -0
- package/docs/api/dom/net/webrtc.md +158 -0
- package/docs/api/dom/net/ws.md +168 -0
- package/docs/api/dom/query/README.md +30 -0
- package/docs/api/dom/query/dnd.md +137 -0
- package/docs/api/dom/query/dom.md +275 -0
- package/docs/api/dom/query/events.md +211 -0
- package/docs/api/dom/query/gesture.md +137 -0
- package/docs/api/dom/query/media.md +188 -0
- package/docs/api/dom/rendering/README.md +41 -0
- package/docs/api/dom/rendering/chart.md +149 -0
- package/docs/api/dom/rendering/component.md +287 -0
- package/docs/api/dom/rendering/devtools-ui.md +129 -0
- package/docs/api/dom/rendering/devtools.md +157 -0
- package/docs/api/dom/rendering/parser.md +200 -0
- package/docs/api/dom/rendering/reactiveBind.md +234 -0
- package/docs/api/dom/rendering/render.md +219 -0
- package/docs/api/dom/rendering/sanitize.md +97 -0
- package/docs/api/dom/rendering/secPolicy.md +155 -0
- package/docs/api/dom/rendering/template.md +301 -0
- package/docs/api/dom/rendering/themeTokens.md +175 -0
- package/docs/api/dom/rendering/uiSession.md +546 -0
- package/docs/api/dom/rendering/virtualScroll.md +126 -0
- package/docs/api/dom/sensors/README.md +12 -0
- package/docs/api/dom/sensors/battery.md +70 -0
- package/docs/api/dom/sensors/geolocation.md +115 -0
- package/docs/api/dom/sensors/networkInfo.md +73 -0
- package/docs/api/dom/sensors/sensors.md +123 -0
- package/docs/api/dom/sw/README.md +31 -0
- package/docs/api/dom/sw/backgroundSync.md +145 -0
- package/docs/api/dom/sw/cache.md +116 -0
- package/docs/api/dom/sw/push.md +114 -0
- package/docs/api/dom/sw/serviceWorker.md +90 -0
- package/docs/api/dom/sw/sharedWorker.md +131 -0
- package/docs/api/dom/utils/README.md +25 -0
- package/docs/api/dom/utils/a11y.md +143 -0
- package/docs/api/dom/utils/clipboard.md +146 -0
- package/docs/api/dom/utils/entropyCollector.md +175 -0
- package/docs/api/dom/utils/focus.md +140 -0
- package/docs/api/dom/utils/form.md +196 -0
- package/docs/api/dom/utils/formKit.md +181 -0
- package/docs/api/dom/utils/keybindings.md +138 -0
- package/docs/api/dom/utils/leaderElection.md +130 -0
- package/docs/api/dom/utils/notifications.md +106 -0
- package/docs/api/dom/utils/permissions.md +82 -0
- package/docs/api/dom/utils/route.md +112 -0
- package/docs/api/dom/utils/ua.md +119 -0
- package/docs/api/dom/utils/webauthn.md +190 -0
- package/docs/api/io/README.md +20 -0
- package/docs/api/io/binary/README.md +29 -0
- package/docs/api/io/binary/reader.md +126 -0
- package/docs/api/io/binary/writer.md +127 -0
- package/docs/api/io/calc/README.md +22 -0
- package/docs/api/io/calc/adler32.md +75 -0
- package/docs/api/io/calc/bigint.md +105 -0
- package/docs/api/io/calc/crc32.md +74 -0
- package/docs/api/io/calc/easing.md +118 -0
- package/docs/api/io/codec/README.md +35 -0
- package/docs/api/io/codec/b64.md +92 -0
- package/docs/api/io/codec/base32.md +98 -0
- package/docs/api/io/codec/base58.md +104 -0
- package/docs/api/io/codec/buffer.md +144 -0
- package/docs/api/io/codec/cbor.md +179 -0
- package/docs/api/io/codec/csv.md +178 -0
- package/docs/api/io/codec/hex.md +75 -0
- package/docs/api/io/codec/mime.md +156 -0
- package/docs/api/io/codec/msgpack.md +142 -0
- package/docs/api/io/codec/url.md +265 -0
- package/docs/api/io/codec/utf8.md +84 -0
- package/docs/api/io/codec/xml.md +87 -0
- package/docs/api/io/compress/README.md +62 -0
- package/docs/api/io/compress/bitstream.md +131 -0
- package/docs/api/io/compress/brotli.md +232 -0
- package/docs/api/io/compress/brotli_dict.md +119 -0
- package/docs/api/io/compress/brotli_dict_words.md +142 -0
- package/docs/api/io/compress/brotli_frame.md +214 -0
- package/docs/api/io/compress/brotli_shared.md +144 -0
- package/docs/api/io/compress/deflate.md +474 -0
- package/docs/api/io/compress/gzip.md +130 -0
- package/docs/api/io/compress/huffman.md +210 -0
- package/docs/api/io/compress/lz4.md +278 -0
- package/docs/api/io/compress/lz77.md +180 -0
- package/docs/api/io/compress/lzw.md +121 -0
- package/docs/api/io/compress/zip.md +209 -0
- package/docs/api/io/compress/zlib.md +125 -0
- package/docs/api/io/i18n/README.md +23 -0
- package/docs/api/io/i18n/i18n.md +128 -0
- package/docs/api/io/math/README.md +24 -0
- package/docs/api/io/math/fixed-point.md +115 -0
- package/docs/api/io/math/geom.md +144 -0
- package/docs/api/io/math/interp.md +115 -0
- package/docs/api/io/math/linalg.md +138 -0
- package/docs/api/io/math/stats.md +109 -0
- package/docs/api/io/structures/README.md +31 -0
- package/docs/api/io/structures/btree.md +155 -0
- package/docs/api/io/structures/heap.md +166 -0
- package/docs/api/io/structures/lruCache.md +156 -0
- package/docs/api/io/structures/ringBuffer.md +188 -0
- package/docs/api/io/structures/tree-walker.md +132 -0
- package/docs/api/io/structures/trie.md +138 -0
- package/docs/api/io/sync/README.md +29 -0
- package/docs/api/io/sync/abort.md +129 -0
- package/docs/api/io/sync/atomics.md +159 -0
- package/docs/api/io/sync/cancellable.md +176 -0
- package/docs/api/io/sync/channel.md +125 -0
- package/docs/api/io/sync/mutex.md +93 -0
- package/docs/api/io/sync/semaphore.md +106 -0
- package/docs/api/io/sync/tokenBucket.md +139 -0
- package/docs/api/io/text/README.md +23 -0
- package/docs/api/io/text/ansi.md +182 -0
- package/docs/api/io/text/html-entities.md +79 -0
- package/docs/api/io/text/semver.md +158 -0
- package/docs/api/io/text/str.md +129 -0
- package/docs/api/io/text/unicode.md +89 -0
- package/docs/api/io/time/README.md +22 -0
- package/docs/api/io/time/date.md +128 -0
- package/docs/api/io/timing/README.md +32 -0
- package/docs/api/io/timing/clock.md +102 -0
- package/docs/api/io/timing/rateLimit.md +137 -0
- package/docs/api/io/timing/scheduler.md +163 -0
- package/docs/api/io/utils/README.md +30 -0
- package/docs/api/io/utils/bitmap.md +96 -0
- package/docs/api/io/utils/errors.md +165 -0
- package/docs/api/io/utils/eventBus.md +162 -0
- package/docs/api/io/utils/queue.md +141 -0
- package/docs/api/io/utils/signal.md +388 -0
- package/docs/api/io/utils/ui8.md +111 -0
- package/docs/api/io/utils/valid.md +272 -0
- package/docs/api/process/README.md +18 -0
- package/docs/api/process/message.md +166 -0
- package/docs/api/process/rpc.md +161 -0
- package/docs/api/process/workerPool.md +130 -0
- package/docs/api/sanity/base.md +132 -0
- package/docs/api/sanity/community.md +96 -0
- package/docs/api/sanity/lockdown.md +128 -0
- package/docs/api/typed.md +85 -0
- package/docs/dev/README.md +25 -0
- package/docs/dev/provenance.md +80 -0
- package/docs/dev/publishing.md +31 -0
- package/docs/dev/runtime.md +64 -0
- package/docs/dev/testing.md +61 -0
- package/docs/dev/types.md +35 -0
- package/docs/evidence/pqc-hybrid-evidence.md +438 -0
- package/docs/guide/README.md +38 -0
- package/docs/guide/_QUICK_REF.md +341 -0
- package/docs/guide/by-use-case.md +160 -0
- package/docs/guide/doc-format.md +306 -0
- package/docs/guide/gesture-dnd-side-channel.md +119 -0
- package/docs/guide/getting-started.md +134 -0
- package/docs/guide/hmr.md +187 -0
- package/docs/guide/integration-bundlers.md +193 -0
- package/docs/guide/integrations-hmr.md +103 -0
- package/docs/guide/module-creation-workflow.md +342 -0
- package/docs/guide/module-pattern.md +244 -0
- package/docs/guide/rendering-pipeline.md +422 -0
- package/docs/guide/security.md +346 -0
- package/docs/guide/test-format.md +190 -0
- package/docs/guide/tutorial-todo.md +298 -0
- package/docs/guide/typescript.md +215 -0
- package/docs/guide/worker-confinement.md +301 -0
- package/docs/guide/workers.md +168 -0
- package/docs/notes/lz77-deflate-factorization.md +96 -0
- package/docs/notes/worker-confinement-spike.md +302 -0
- package/docs/tools/README.md +56 -0
- package/docs/tools/aot.md +108 -0
- package/docs/tools/audit.md +61 -0
- package/docs/tools/bundler.md +215 -0
- package/docs/tools/codegen.md +64 -0
- package/docs/tools/jsx.md +236 -0
- package/docs/tools/precompilation.md +88 -0
- package/docs/tools/standalone.md +107 -0
- package/fw.config.json +129 -0
- package/integrations/README.md +52 -0
- package/integrations/_shared/catalog.generated.json +207 -0
- package/integrations/_shared/config-resolve.js +201 -0
- package/integrations/_shared/core.js +362 -0
- package/integrations/astro/README.md +96 -0
- package/integrations/astro/index.d.ts +42 -0
- package/integrations/astro/index.js +94 -0
- package/integrations/bun/README.md +62 -0
- package/integrations/bun/index.d.ts +30 -0
- package/integrations/bun/index.js +134 -0
- package/integrations/deno/README.md +55 -0
- package/integrations/deno/deno.json +10 -0
- package/integrations/esbuild/README.md +75 -0
- package/integrations/esbuild/backend.js +147 -0
- package/integrations/esbuild/index.d.ts +32 -0
- package/integrations/esbuild/index.js +147 -0
- package/integrations/eslint/README.md +27 -0
- package/integrations/eslint/no-factory-capture.js +99 -0
- package/integrations/jest/README.md +45 -0
- package/integrations/jest/bun-test-shim.js +43 -0
- package/integrations/nestjs/README.md +68 -0
- package/integrations/nestjs/index.d.ts +38 -0
- package/integrations/nestjs/index.js +99 -0
- package/integrations/nextjs/README.md +149 -0
- package/integrations/nextjs/index.d.ts +30 -0
- package/integrations/nextjs/index.js +98 -0
- package/integrations/nodejs/README.md +46 -0
- package/integrations/nodejs/package.node.example.json +31 -0
- package/integrations/rollup/README.md +65 -0
- package/integrations/rollup/backend.js +132 -0
- package/integrations/rollup/index.d.ts +32 -0
- package/integrations/rollup/index.js +84 -0
- package/integrations/turbopack/README.md +56 -0
- package/integrations/turbopack/index.d.ts +47 -0
- package/integrations/turbopack/index.js +164 -0
- package/integrations/typedoc/README.md +57 -0
- package/integrations/typedoc/categorize.js +121 -0
- package/integrations/typedoc/tsconfig.typedoc.json +14 -0
- package/integrations/typedoc/typedoc.json +19 -0
- package/integrations/vite/README.md +115 -0
- package/integrations/vite/index.d.ts +29 -0
- package/integrations/vite/index.js +182 -0
- package/integrations/vite/package.json +8 -0
- package/integrations/vite/vite-env.d.ts +36 -0
- package/integrations/vitest/README.md +77 -0
- package/integrations/vitest/bun-test-shim.js +92 -0
- package/integrations/vitest/vitest.config.js +41 -0
- package/integrations/webpack/README.md +53 -0
- package/integrations/webpack/index.d.ts +29 -0
- package/integrations/webpack/index.js +182 -0
- package/package.json +303 -0
- package/src/core/logger.js +373 -0
- package/src/core/modules.js +289 -0
- package/src/core/readyState.js +119 -0
- package/src/core/runtime.js +929 -0
- package/src/core/worker-helper.js +261 -0
- package/src/crypto/NIST_CONFORMANCE.md +249 -0
- package/src/crypto/cipher/aes.acvp.md +74 -0
- package/src/crypto/cipher/aes.js +512 -0
- package/src/crypto/cipher/chacha20.acvp.md +117 -0
- package/src/crypto/cipher/chacha20.js +147 -0
- package/src/crypto/hash/adf.acvp.md +144 -0
- package/src/crypto/hash/adf.js +127 -0
- package/src/crypto/hash/argon2.acvp.md +144 -0
- package/src/crypto/hash/argon2.js +517 -0
- package/src/crypto/hash/blake2b.acvp.md +122 -0
- package/src/crypto/hash/blake2b.js +367 -0
- package/src/crypto/hash/hkdf.acvp.md +128 -0
- package/src/crypto/hash/hkdf.js +145 -0
- package/src/crypto/hash/hmac.acvp.md +110 -0
- package/src/crypto/hash/hmac.js +177 -0
- package/src/crypto/hash/pbkdf2.acvp.md +122 -0
- package/src/crypto/hash/pbkdf2.js +120 -0
- package/src/crypto/hash/poly1305.acvp.md +111 -0
- package/src/crypto/hash/poly1305.js +126 -0
- package/src/crypto/hash/sha224.acvp.md +81 -0
- package/src/crypto/hash/sha224.js +60 -0
- package/src/crypto/hash/sha256.acvp.md +75 -0
- package/src/crypto/hash/sha256.js +217 -0
- package/src/crypto/hash/sha3.acvp.md +133 -0
- package/src/crypto/hash/sha3.js +391 -0
- package/src/crypto/hash/sha384.acvp.md +82 -0
- package/src/crypto/hash/sha384.js +61 -0
- package/src/crypto/hash/sha512.acvp.md +84 -0
- package/src/crypto/hash/sha512.js +314 -0
- package/src/crypto/hash/sha512_224.acvp.md +90 -0
- package/src/crypto/hash/sha512_224.js +66 -0
- package/src/crypto/hash/sha512_256.acvp.md +96 -0
- package/src/crypto/hash/sha512_256.js +75 -0
- package/src/crypto/mode/cbc.acvp.md +105 -0
- package/src/crypto/mode/cbc.js +136 -0
- package/src/crypto/mode/chacha20poly1305.acvp.md +116 -0
- package/src/crypto/mode/chacha20poly1305.js +190 -0
- package/src/crypto/mode/cmac.acvp.md +106 -0
- package/src/crypto/mode/cmac.js +172 -0
- package/src/crypto/mode/ctr.acvp.md +110 -0
- package/src/crypto/mode/ctr.js +174 -0
- package/src/crypto/mode/gcm.acvp.md +129 -0
- package/src/crypto/mode/gcm.js +333 -0
- package/src/crypto/mode/kw.acvp.md +145 -0
- package/src/crypto/mode/kw.js +323 -0
- package/src/crypto/pkc/ecc.acvp.md +181 -0
- package/src/crypto/pkc/ecc.js +941 -0
- package/src/crypto/pkc/ed25519.acvp.md +172 -0
- package/src/crypto/pkc/ed25519.js +582 -0
- package/src/crypto/pkc/hybrid-kat.provenance.md +89 -0
- package/src/crypto/pkc/hybridKem.js +255 -0
- package/src/crypto/pkc/hybridSign.js +437 -0
- package/src/crypto/pkc/ml_dsa.acvp.md +146 -0
- package/src/crypto/pkc/ml_dsa.js +984 -0
- package/src/crypto/pkc/ml_kem.acvp.md +117 -0
- package/src/crypto/pkc/ml_kem.js +596 -0
- package/src/crypto/pkc/rsa.acvp.md +187 -0
- package/src/crypto/pkc/rsa.js +470 -0
- package/src/crypto/pkc/slh_dsa.acvp.md +155 -0
- package/src/crypto/pkc/slh_dsa.js +820 -0
- package/src/crypto/pkc/x25519.acvp.md +113 -0
- package/src/crypto/pkc/x25519.js +290 -0
- package/src/crypto/utils/aes_ctr.acvp.md +67 -0
- package/src/crypto/utils/aes_ctr.js +134 -0
- package/src/crypto/utils/aes_modes.acvp.md +66 -0
- package/src/crypto/utils/aes_modes.js +241 -0
- package/src/crypto/utils/asn1-oid.js +369 -0
- package/src/crypto/utils/asn1.js +343 -0
- package/src/crypto/utils/bitArray.js +312 -0
- package/src/crypto/utils/bn.js +825 -0
- package/src/crypto/utils/jws.js +222 -0
- package/src/crypto/utils/keyformat.js +303 -0
- package/src/crypto/utils/pad.js +198 -0
- package/src/crypto/utils/pem.js +90 -0
- package/src/crypto/utils/random.acvp.md +167 -0
- package/src/crypto/utils/random.js +846 -0
- package/src/crypto/utils/rsaKeygen.acvp.md +158 -0
- package/src/crypto/utils/rsaKeygen.js +448 -0
- package/src/crypto/utils/totp.js +409 -0
- package/src/crypto/utils/uuid.acvp.md +137 -0
- package/src/crypto/utils/uuid.js +176 -0
- package/src/crypto/wasm/aes.js +494 -0
- package/src/crypto/wasm/argon2.js +236 -0
- package/src/crypto/wasm/blake2b.js +213 -0
- package/src/crypto/wasm/chacha20poly1305.js +238 -0
- package/src/crypto/wasm/cmac.js +207 -0
- package/src/crypto/wasm/ecc.js +437 -0
- package/src/crypto/wasm/ed25519.js +307 -0
- package/src/crypto/wasm/hkdf.js +183 -0
- package/src/crypto/wasm/hmac.js +215 -0
- package/src/crypto/wasm/ml_dsa.js +375 -0
- package/src/crypto/wasm/ml_kem.js +313 -0
- package/src/crypto/wasm/pbkdf2.js +205 -0
- package/src/crypto/wasm/rsa.js +674 -0
- package/src/crypto/wasm/runtime.js +400 -0
- package/src/crypto/wasm/sha2.js +183 -0
- package/src/crypto/wasm/sha3.js +221 -0
- package/src/crypto/wasm/slh_dsa.js +397 -0
- package/src/crypto/wasm/x25519.js +241 -0
- package/src/crypto/webcrypto/aes.js +370 -0
- package/src/crypto/webcrypto/aeskw.js +185 -0
- package/src/crypto/webcrypto/digest.js +136 -0
- package/src/crypto/webcrypto/ecc.js +371 -0
- package/src/crypto/webcrypto/ed25519.js +248 -0
- package/src/crypto/webcrypto/hkdf.js +132 -0
- package/src/crypto/webcrypto/hmac.js +213 -0
- package/src/crypto/webcrypto/pbkdf2.js +146 -0
- package/src/crypto/webcrypto/rsa.js +415 -0
- package/src/crypto/webcrypto/x25519.js +250 -0
- package/src/dom/display/animate.js +154 -0
- package/src/dom/display/fullscreen.js +305 -0
- package/src/dom/fs/download.js +118 -0
- package/src/dom/fs/fsAccess.js +307 -0
- package/src/dom/fs/indexedDB.js +465 -0
- package/src/dom/fs/remoteStore.js +484 -0
- package/src/dom/fs/storage.js +440 -0
- package/src/dom/lifecycle/idle.js +133 -0
- package/src/dom/lifecycle/visibility.js +140 -0
- package/src/dom/lifecycle/wakeLock.js +187 -0
- package/src/dom/net/ajax.js +303 -0
- package/src/dom/net/broadcastChannel.js +89 -0
- package/src/dom/net/network.js +260 -0
- package/src/dom/net/sse.js +295 -0
- package/src/dom/net/webrtc.js +381 -0
- package/src/dom/net/ws.js +290 -0
- package/src/dom/query/dnd.js +409 -0
- package/src/dom/query/dom.js +831 -0
- package/src/dom/query/events.js +425 -0
- package/src/dom/query/gesture.js +396 -0
- package/src/dom/query/media.js +616 -0
- package/src/dom/rendering/chart.js +663 -0
- package/src/dom/rendering/component.js +469 -0
- package/src/dom/rendering/devtools-ui.js +399 -0
- package/src/dom/rendering/devtools.js +352 -0
- package/src/dom/rendering/parser.js +1055 -0
- package/src/dom/rendering/reactiveBind.js +341 -0
- package/src/dom/rendering/render.js +601 -0
- package/src/dom/rendering/sanitize.js +364 -0
- package/src/dom/rendering/secPolicy.js +281 -0
- package/src/dom/rendering/template.js +1031 -0
- package/src/dom/rendering/themeTokens.js +522 -0
- package/src/dom/rendering/uiSession-core.js +597 -0
- package/src/dom/rendering/uiSession-direct.js +251 -0
- package/src/dom/rendering/uiSession-list.js +751 -0
- package/src/dom/rendering/uiSession.js +145 -0
- package/src/dom/rendering/virtualScroll.js +341 -0
- package/src/dom/sensors/battery.js +153 -0
- package/src/dom/sensors/geolocation.js +156 -0
- package/src/dom/sensors/networkInfo.js +136 -0
- package/src/dom/sensors/sensors.js +340 -0
- package/src/dom/sw/backgroundSync.js +113 -0
- package/src/dom/sw/cache.js +139 -0
- package/src/dom/sw/push.js +181 -0
- package/src/dom/sw/serviceWorker.js +193 -0
- package/src/dom/sw/sharedWorker.js +192 -0
- package/src/dom/utils/a11y.js +244 -0
- package/src/dom/utils/clipboard.js +113 -0
- package/src/dom/utils/entropyCollector.js +344 -0
- package/src/dom/utils/focus.js +421 -0
- package/src/dom/utils/form.js +535 -0
- package/src/dom/utils/formKit.js +427 -0
- package/src/dom/utils/keybindings.js +574 -0
- package/src/dom/utils/leaderElection.js +280 -0
- package/src/dom/utils/notifications.js +218 -0
- package/src/dom/utils/permissions.js +107 -0
- package/src/dom/utils/route.js +482 -0
- package/src/dom/utils/ua.js +109 -0
- package/src/dom/utils/webauthn.js +369 -0
- package/src/external/README.md +15 -0
- package/src/io/binary/reader.js +374 -0
- package/src/io/binary/writer.js +351 -0
- package/src/io/calc/adler32.js +94 -0
- package/src/io/calc/bigint.js +276 -0
- package/src/io/calc/crc32.js +111 -0
- package/src/io/calc/easing.js +514 -0
- package/src/io/codec/b64.js +235 -0
- package/src/io/codec/base32.js +147 -0
- package/src/io/codec/base58.js +167 -0
- package/src/io/codec/buffer.js +630 -0
- package/src/io/codec/cbor.js +550 -0
- package/src/io/codec/csv.js +299 -0
- package/src/io/codec/hex.js +129 -0
- package/src/io/codec/mime.js +398 -0
- package/src/io/codec/msgpack.js +491 -0
- package/src/io/codec/url.js +530 -0
- package/src/io/codec/utf8.js +181 -0
- package/src/io/codec/xml.js +428 -0
- package/src/io/compress/bitstream.js +199 -0
- package/src/io/compress/brotli.js +3073 -0
- package/src/io/compress/brotli_dict.bin +432 -0
- package/src/io/compress/brotli_dict.js +356 -0
- package/src/io/compress/brotli_dict_words.js +157 -0
- package/src/io/compress/brotli_frame.js +420 -0
- package/src/io/compress/brotli_shared.js +715 -0
- package/src/io/compress/deflate.js +1432 -0
- package/src/io/compress/gzip.js +406 -0
- package/src/io/compress/huffman.js +322 -0
- package/src/io/compress/lz4.js +451 -0
- package/src/io/compress/lz77.js +408 -0
- package/src/io/compress/lzw.js +332 -0
- package/src/io/compress/zip.js +815 -0
- package/src/io/compress/zlib.js +340 -0
- package/src/io/i18n/i18n.js +236 -0
- package/src/io/math/fixed-point.js +269 -0
- package/src/io/math/geom.js +350 -0
- package/src/io/math/interp.js +263 -0
- package/src/io/math/linalg.js +472 -0
- package/src/io/math/stats.js +339 -0
- package/src/io/structures/btree.js +357 -0
- package/src/io/structures/heap.js +249 -0
- package/src/io/structures/lruCache.js +219 -0
- package/src/io/structures/ringBuffer.js +208 -0
- package/src/io/structures/tree-walker.js +413 -0
- package/src/io/structures/trie.js +219 -0
- package/src/io/sync/abort.js +196 -0
- package/src/io/sync/atomics.js +342 -0
- package/src/io/sync/cancellable.js +279 -0
- package/src/io/sync/channel.js +301 -0
- package/src/io/sync/mutex.js +148 -0
- package/src/io/sync/semaphore.js +156 -0
- package/src/io/sync/tokenBucket.js +208 -0
- package/src/io/text/ansi.js +536 -0
- package/src/io/text/html-entities.js +143 -0
- package/src/io/text/semver.js +375 -0
- package/src/io/text/str.js +243 -0
- package/src/io/text/unicode.js +188 -0
- package/src/io/time/date.js +355 -0
- package/src/io/timing/clock.js +79 -0
- package/src/io/timing/rateLimit.js +264 -0
- package/src/io/timing/scheduler.js +351 -0
- package/src/io/utils/bitmap.js +94 -0
- package/src/io/utils/errors.js +269 -0
- package/src/io/utils/eventBus.js +315 -0
- package/src/io/utils/queue.js +223 -0
- package/src/io/utils/signal.js +858 -0
- package/src/io/utils/ui8.js +99 -0
- package/src/io/utils/valid.js +556 -0
- package/src/main.js +41 -0
- package/src/polyfill/README.md +9 -0
- package/src/process/message.js +257 -0
- package/src/process/rpc.js +286 -0
- package/src/process/workerPool.js +392 -0
- package/src/sanity/base.js +374 -0
- package/src/sanity/community.js +254 -0
- package/src/sanity/lockdown-apply.js +58 -0
- package/src/sanity/lockdown.js +408 -0
- package/src/sanity/wasm-gate.js +316 -0
- package/src/typed.js +53 -0
- package/third-party/NOTICE-penner-easing +88 -0
- package/third-party/NOTICE-sjcl +50 -0
- package/tools/_lib/cli-help.js +55 -0
- package/tools/rendering/aot/index.js +148 -0
- package/tools/rendering/aot/lib/dom-codegen.js +295 -0
- package/tools/rendering/jsx/index.js +654 -0
- package/tools/rendering/precompilation/index.js +368 -0
- package/types/registry.generated.d.ts +217 -0
- package/types/typed.d.ts +106 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
---
|
|
2
|
+
module: workerPool
|
|
3
|
+
category: process
|
|
4
|
+
dependencies: []
|
|
5
|
+
returns: object
|
|
6
|
+
worker-safe: partial
|
|
7
|
+
status: complete
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# workerPool
|
|
11
|
+
|
|
12
|
+
> Homogeneous pool of N workers — distributes jobs FIFO, respawns on crash, cancellable.
|
|
13
|
+
|
|
14
|
+
**Module** `workerPool` | **Source** `packages/front/fw/src/process/workerPool.js` | **Deps** none | **Worker-safe** partial
|
|
15
|
+
|
|
16
|
+
The pool runs on the main thread and manages N identical workers created by a supplied factory. Each job is dispatched to the first idle worker; if none is available, the job is queued. An `AbortSignal` allows cancelling a queued or in-progress job. On worker crash (`onerror`), the current job is rejected and a replacement is created if `respawnOnCrash` is active.
|
|
17
|
+
|
|
18
|
+
## Resolve
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
const workerPool = runtime.resolve('workerPool');
|
|
22
|
+
// Returns: { create }
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## API
|
|
26
|
+
|
|
27
|
+
### `workerPool.create(opts)`
|
|
28
|
+
|
|
29
|
+
| Option | Type | Default | Description |
|
|
30
|
+
|--------|------|--------|-------------|
|
|
31
|
+
| `factory` | `() => Worker\|WorkerLike` | **required** | Function called to create each pool worker |
|
|
32
|
+
| `size` | `number` | `navigator.hardwareConcurrency \|\| 4` | Initial number of workers |
|
|
33
|
+
| `maxQueue` | `number` | `Infinity` | Max queue size — `run()` throws beyond this |
|
|
34
|
+
| `respawnOnCrash` | `boolean` | `true` | Re-creates a replacement worker after a crash |
|
|
35
|
+
|
|
36
|
+
Returns a pool object:
|
|
37
|
+
|
|
38
|
+
| Method | Signature | Description |
|
|
39
|
+
|---------|-----------|-------------|
|
|
40
|
+
| `run` | `(job: any, opts?: {transfer?, signal?}) => Promise<any>` | Submits a job. `transfer` = Transferables. `signal` = AbortSignal |
|
|
41
|
+
| `size` | `() => number` | Effective pool size |
|
|
42
|
+
| `idle` | `() => number` | Idle workers |
|
|
43
|
+
| `pending` | `() => number` | Queued jobs |
|
|
44
|
+
| `resize` | `(n: number) => void` | Adjusts the pool up or down |
|
|
45
|
+
| `terminate` | `() => void` | Terminates all workers; queued jobs are rejected |
|
|
46
|
+
|
|
47
|
+
### `pool.run(job, opts?)`
|
|
48
|
+
|
|
49
|
+
Returns a `Promise` resolved with the value of `event.data` from the worker's response message.
|
|
50
|
+
|
|
51
|
+
- If all workers are busy, the job is queued (FIFO).
|
|
52
|
+
- If `maxQueue` is reached: throws `'workerPool: queue is full'`.
|
|
53
|
+
- If the signal is already aborted: immediate rejection with `AbortError`.
|
|
54
|
+
|
|
55
|
+
**Abort behaviour during execution:** if `signal.abort()` is called while a job is already dispatched to a worker, that worker is `terminate()`d immediately (it is impossible to cancel a worker without killing it). If `respawnOnCrash` is active, a replacement is created. The job is rejected with `AbortError`.
|
|
56
|
+
|
|
57
|
+
### `pool.resize(n)`
|
|
58
|
+
|
|
59
|
+
- Increase: creates missing workers immediately and drains the queue.
|
|
60
|
+
- Decrease: removes idle workers first. Busy workers are removed from the pool but finish their current job before being destroyed (no respawn).
|
|
61
|
+
|
|
62
|
+
## Examples
|
|
63
|
+
|
|
64
|
+
### Basic usage
|
|
65
|
+
|
|
66
|
+
```js
|
|
67
|
+
const workerPool = runtime.resolve('workerPool');
|
|
68
|
+
|
|
69
|
+
const pool = workerPool.create({
|
|
70
|
+
factory: () => fw.createWorker(
|
|
71
|
+
function({ libs, args }) {
|
|
72
|
+
const [data] = args;
|
|
73
|
+
self.postMessage(libs.hex.fromBytes(new Uint8Array(data)));
|
|
74
|
+
},
|
|
75
|
+
{ dependencies: ['hex'] }
|
|
76
|
+
),
|
|
77
|
+
size: 4
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
const result = await pool.run([72, 101, 108]);
|
|
81
|
+
// → "48656c"
|
|
82
|
+
|
|
83
|
+
pool.terminate();
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Cancelling a job
|
|
87
|
+
|
|
88
|
+
```js
|
|
89
|
+
const ctrl = new AbortController();
|
|
90
|
+
|
|
91
|
+
// Cancel if the result doesn't arrive within 500 ms
|
|
92
|
+
setTimeout(() => ctrl.abort(), 500);
|
|
93
|
+
|
|
94
|
+
try {
|
|
95
|
+
const result = await pool.run(heavyPayload, { signal: ctrl.signal });
|
|
96
|
+
} catch (e) {
|
|
97
|
+
if (e.name === 'AbortError') console.log('Job cancelled');
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Transferables (ArrayBuffer)
|
|
102
|
+
|
|
103
|
+
```js
|
|
104
|
+
const buffer = new ArrayBuffer(1024 * 1024);
|
|
105
|
+
const result = await pool.run(buffer, { transfer: [buffer] });
|
|
106
|
+
// buffer is transferred to the worker (zero-copy)
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Dynamic resizing
|
|
110
|
+
|
|
111
|
+
```js
|
|
112
|
+
// Reduce during idle
|
|
113
|
+
pool.resize(1);
|
|
114
|
+
|
|
115
|
+
// Resume at full capacity
|
|
116
|
+
pool.resize(navigator.hardwareConcurrency || 4);
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Notes
|
|
120
|
+
|
|
121
|
+
- A worker is considered "busy" from the moment a job is dispatched to it until its `onmessage` is received.
|
|
122
|
+
- Communication with the worker is unconstrained: the pool simply relays `postMessage` and waits for the response via `onmessage`. Compatible with `processRPC` or `processMessage.workerFramework`.
|
|
123
|
+
- `terminate()` is idempotent.
|
|
124
|
+
- Aborting an in-progress job terminates the worker (documented behaviour) — size the pool accordingly for use cases with frequent cancellations.
|
|
125
|
+
|
|
126
|
+
## See also
|
|
127
|
+
|
|
128
|
+
- [processMessage](./message.md) — inter-worker message routing
|
|
129
|
+
- [processRPC](./rpc.md) — Promise-based RPC over MessageChannel
|
|
130
|
+
- [workers](../../guide/workers.md) — Web Workers usage guide
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
---
|
|
2
|
+
module: sanity/base
|
|
3
|
+
category: sanity
|
|
4
|
+
dependencies: []
|
|
5
|
+
returns: "{ applied, reason, steps }"
|
|
6
|
+
worker-safe: false
|
|
7
|
+
status: complete
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# sanity/base
|
|
11
|
+
|
|
12
|
+
> Security lockdown — explicit-call ES module. Blocks dangerous APIs on `window` and `document`, redirects `innerHTML` to `innerText`, freezes native prototypes.
|
|
13
|
+
|
|
14
|
+
**Source** `packages/front/fw/src/sanity/base.js` | **Type** ES module, explicit call | **Worker-safe** no
|
|
15
|
+
|
|
16
|
+
ES module exporting `applyBase()`, an explicit-call function. It is not imported via `runtime.resolve()` and does not auto-apply on import. Call `applyBase()` once before any application code to lock down the realm.
|
|
17
|
+
|
|
18
|
+
## Resolve
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
import { applyBase } from '@awacloud/fw/sanity/base';
|
|
22
|
+
applyBase(); // must be called before all application code
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
For zero-bundler deployment (static HTML), load the built classic artifact instead, which self-applies on load:
|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<script src="packages/front/fw/dist/build/sanity-base-classic.min.js"></script>
|
|
29
|
+
<script type="module" src="src/main.js"></script>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## API
|
|
33
|
+
|
|
34
|
+
`applyBase()` applies 15 sequential steps that lock down the realm. Returns `{ applied: boolean, reason?: string, steps: string[] }` — the step list records the order and is useful for debugging.
|
|
35
|
+
|
|
36
|
+
| Section | Method / Property | Effect |
|
|
37
|
+
|---------|-------------------|--------|
|
|
38
|
+
| **window** | `eval`, `Function`, `Reflect` | Throws `'not allowed'` |
|
|
39
|
+
| **window** | `alert`, `confirm`, `prompt`, `open` | Throws `'not allowed'` |
|
|
40
|
+
| **window** | `importScripts` | Throws `'not allowed'` |
|
|
41
|
+
| **window** | `import()` (dynamic) | **Not intercepted** — the `window.import` property throws on access, but the syntactic `import()` form is language syntax, not a property, so it cannot be poisoned by slot replacement. Closed by a server CSP (`script-src`) or a Worker, not this tier. |
|
|
42
|
+
| **window** | `Math.random` | Throws `'not allowed: use crypto.getRandomValues instead'` |
|
|
43
|
+
| **window** | `crypto.randomUUID` | Throws `'not allowed'` |
|
|
44
|
+
| **window** | `performance.now`, `performance.mark`, `performance.measure`, `performance.getEntries` | Throws `'not allowed'` |
|
|
45
|
+
| **document** | `write`, `writeln`, `open`, `close`, `execCommand`, `execScript`, `evaluate`, `implementation`, `createContextualFragment` | Throws `'not allowed'` |
|
|
46
|
+
| **document** | `domain` (set) | Throws `'not allowed'` |
|
|
47
|
+
| **history** | `pushState`, `replaceState`, `go`, `back`, `forward` | Throws `'not allowed'` |
|
|
48
|
+
| **Element.prototype** | `innerHTML` (set), `outerHTML` (set), `insertAdjacentHTML` (set) | Redirected to `innerText` / `outerText` / `insertAdjacentText` — no exception raised |
|
|
49
|
+
| **Date** | `Date.now` | Rounded to 100 ms (`Math.floor(ts / 100) * 100`) |
|
|
50
|
+
| **Timing** | `setTimeout`, `setInterval`, `requestAnimationFrame` with a string | Throws `'not allowed'` |
|
|
51
|
+
| **JSON** | `JSON.parse(text, reviver)` | Throws `'not allowed'` if reviver is present |
|
|
52
|
+
| **JSON** | `JSON.stringify(val, replacer)` when replacer is a function | Throws `'not allowed'` |
|
|
53
|
+
| **iframe / object / embed** | `src`, `srcdoc`, `data`, `href`, `innerHTML`, `codebase`, `archive` (set) | Throws `'not allowed'` |
|
|
54
|
+
|
|
55
|
+
## Frozen prototypes
|
|
56
|
+
|
|
57
|
+
`Object.freeze()` applied to:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
Object.prototype Array.prototype Function.prototype
|
|
61
|
+
String.prototype Number.prototype Boolean.prototype
|
|
62
|
+
Date.prototype RegExp.prototype Error.prototype
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
On each prototype, `__proto__` (set) → throws, `constructor` → non-writable / non-configurable.
|
|
66
|
+
|
|
67
|
+
## Examples
|
|
68
|
+
|
|
69
|
+
### Correct loading
|
|
70
|
+
|
|
71
|
+
```js
|
|
72
|
+
// app.js — first import
|
|
73
|
+
import { applyBase } from '@awacloud/fw/sanity/base';
|
|
74
|
+
const result = applyBase(); // → { applied: true, steps: ['freezePrototypes', 'window', ...] }
|
|
75
|
+
// Now safe to import and use the framework
|
|
76
|
+
import { runtime } from '@awacloud/fw';
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Or for zero-bundler deployment:
|
|
80
|
+
|
|
81
|
+
```html
|
|
82
|
+
<!doctype html>
|
|
83
|
+
<html>
|
|
84
|
+
<head>
|
|
85
|
+
<script src="packages/front/fw/dist/build/sanity-base-classic.min.js"></script>
|
|
86
|
+
<script type="module" src="app.js"></script>
|
|
87
|
+
</head>
|
|
88
|
+
</html>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Verify that a block is active
|
|
92
|
+
|
|
93
|
+
```js
|
|
94
|
+
try {
|
|
95
|
+
eval('1+1');
|
|
96
|
+
} catch (e) {
|
|
97
|
+
console.warn('eval blocked:', e.message); // "not allowed"
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
try {
|
|
101
|
+
Math.random();
|
|
102
|
+
} catch (e) {
|
|
103
|
+
console.warn('Math.random blocked:', e.message); // "not allowed: use crypto.getRandomValues instead"
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Math.random replacement
|
|
108
|
+
|
|
109
|
+
```js
|
|
110
|
+
// Math.random() throws — use the framework's random module instead:
|
|
111
|
+
const random = runtime.resolve('random');
|
|
112
|
+
const buf = new Uint8Array(4);
|
|
113
|
+
random.bytes(buf); // CTR_DRBG-AES-256
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Notes
|
|
117
|
+
|
|
118
|
+
- The ES module source `src/sanity/base.js` must be imported and `applyBase()` must be called. Bare import (without calling) has no effect.
|
|
119
|
+
- For zero-bundler deployment, use the built classic artifact `dist/build/sanity-base-classic.min.js`, which self-applies on load via `<script src>`.
|
|
120
|
+
- `innerHTML` → `innerText` redirections are silent — no exception is raised on assignment.
|
|
121
|
+
- `LOG_ATTEMPTS = true` (current source value): each blocked attempt produces a `console.warn` with stack trace.
|
|
122
|
+
- `Date.now` is rounded to 100 ms to reduce timing precision (fingerprinting / timing attacks). `community.js` adopts a more lenient rounding (framework-friendly degraded layer).
|
|
123
|
+
- Prototype freezing is irreversible for the duration of the session — call `applyBase()` before any library that attempts to modify prototypes.
|
|
124
|
+
- Dangerous elements covered: `iframe`, `object`, `embed`. `community.js` covers the same set with relaxed restrictions to remain compatible with popular frameworks.
|
|
125
|
+
- **Playwright drivability consequence**: Observe a hardened realm over the network, never through the evaluation channel. `applyBase()` makes a page undrivable by Playwright — its blocked-property getter (at `base.js:100`) throws inside the injected UtilityScript in both Chromium and Firefox engines (measured). End-to-end test legs must use network observation with a barrier request afterwards to confirm confinement, never via `page.evaluate()` on an applyBase'd page; absent requests and unobserved requests are indistinguishable without the barrier.
|
|
126
|
+
- **Dynamic `import()` survives `applyBase()` (measured)**: `src/crypto/wasm/runtime.js` performs a live in-factory dynamic import after `applyBase()` has already run, in the same realm — direct proof that the syntactic form is not intercepted by this tier's property poisoning (see the `import()` row above).
|
|
127
|
+
|
|
128
|
+
## See also
|
|
129
|
+
|
|
130
|
+
- [sanity/community](./community.md) — framework-friendly variant (degraded layer for framework-hosted apps)
|
|
131
|
+
- [Security Guide](../../guide/security.md) — rationale and threat model
|
|
132
|
+
- [uuid](../crypto/utils/uuid.md) — safe replacement for `crypto.randomUUID`
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
module: sanity/community
|
|
3
|
+
category: sanity
|
|
4
|
+
dependencies: []
|
|
5
|
+
returns: "{ applied, reason, steps }"
|
|
6
|
+
worker-safe: false
|
|
7
|
+
status: complete
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# sanity/community
|
|
11
|
+
|
|
12
|
+
> Community-friendly degraded lockdown — explicit-call ES module. Drop-in for mainstream tooling (Next.js, Astro, Vite, webpack) with no special configuration. A subset of `base.js` that omits the lockdowns incompatible with framework runtimes.
|
|
13
|
+
|
|
14
|
+
**Source** `packages/front/fw/src/sanity/community.js` | **Type** ES module, explicit call | **Worker-safe** no
|
|
15
|
+
|
|
16
|
+
ES module exporting `applyCommunity()`, an explicit-call function. It does not resolve via `runtime.resolve()`. Call it before application code to apply framework-tolerant restrictions. Unlike `base.js` it leaves framework-critical globals (`Math.random`, `history`, `performance`, `JSON`, `innerHTML`, prototypes) untouched so that Next.js, Astro, and other mainstream tools run unmodified.
|
|
17
|
+
|
|
18
|
+
For untrusted-code or hostile-environment hardening, use `base.js` instead.
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
import { applyCommunity } from '@awacloud/fw/sanity/community';
|
|
24
|
+
applyCommunity(); // must be called before all application code
|
|
25
|
+
|
|
26
|
+
import { runtime } from '@awacloud/fw';
|
|
27
|
+
import modules from '@awacloud/fw/core/modules';
|
|
28
|
+
runtime.registerAll(modules);
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
For zero-bundler deployment:
|
|
32
|
+
|
|
33
|
+
```html
|
|
34
|
+
<script src="packages/front/fw/dist/build/sanity-community-classic.min.js"></script>
|
|
35
|
+
<script type="module" src="src/main.js"></script>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## API
|
|
39
|
+
|
|
40
|
+
`applyCommunity()` applies a subset of the `base.js` measures, omitting those incompatible with framework runtimes. Returns `{ applied: boolean, reason?: string, steps: string[] }` — the step list records which measures ran.
|
|
41
|
+
|
|
42
|
+
## KEEP vs DROP table
|
|
43
|
+
|
|
44
|
+
| `base.js` measure | community | Why |
|
|
45
|
+
|---|---|---|
|
|
46
|
+
| Block window `eval`, `alert`, `confirm`, `prompt`, `open` | **KEEP** | XSS / unwanted-dialog hardening; frameworks don't use these at runtime |
|
|
47
|
+
| Block window `Function`, `import`, `importScripts`, `Reflect` | **DROP** | Bundler runtimes / libs rely on dynamic `import`, `Function`, `Reflect` |
|
|
48
|
+
| Block document `write`, `writeln`, `open`, `close`, `execCommand`, `execScript`, `evaluate`, `createContextualFragment` | **KEEP** | `document.write`-style injection; not used by Next/Astro hydration |
|
|
49
|
+
| Block document `implementation` | **DROP** | Some libs read `document.implementation`; low XSS value |
|
|
50
|
+
| Block `Element.prototype` `setHTML`, `evaluate` | **KEEP** | Harmless to frameworks |
|
|
51
|
+
| Block `document.domain` (set) | **KEEP** | Harmless, good hardening |
|
|
52
|
+
| `wrapTimingFunctions` (reject string `setTimeout`/`setInterval`/`rAF`) | **KEEP** | Pure string-eval XSS; frameworks always pass functions |
|
|
53
|
+
| `blockDangerousElements` (iframe/object/embed `src`/`srcdoc`/… set → throw) | **KEEP** | Retained XSS hardening |
|
|
54
|
+
| `disableDebugger` (`window.debugger` shim, `stackTraceLimit`) | **KEEP** | Harmless |
|
|
55
|
+
| `freezePrototypes()` | **DROP** | Frozen `Object/Array/Function/…prototype` + non-writable `constructor` breaks framework hydration/instanceof/subclassing |
|
|
56
|
+
| Block `history.pushState`/`replaceState`/`go`/`back`/`forward` | **DROP** | Breaks Next.js `<Link>` / Astro SPA navigation |
|
|
57
|
+
| Block `performance.now`/`mark`/`measure`/`getEntries` | **DROP** | React scheduler and framework perf marks depend on these |
|
|
58
|
+
| Block `crypto.randomUUID` | **DROP** | Used by some libs/frameworks |
|
|
59
|
+
| `redirectPropertySetter` (`innerHTML` → `innerText`, …) | **DROP** | Corrupts hydration / `dangerouslySetInnerHTML` / templating |
|
|
60
|
+
| `blockJSONParsing` (reviver/replacer-fn + freeze `JSON`) | **DROP** | Framework data serialization uses JSON heavily |
|
|
61
|
+
| `blockPerformanceAPIs` (`Date.now` rounding) | **DROP** | Coarse `Date.now` breaks timing/animation/scheduler |
|
|
62
|
+
| `blockMathRandom` (`Math.random` → throw) | **DROP** | Countless libs call `Math.random`; throwing breaks them |
|
|
63
|
+
|
|
64
|
+
Result: `community.js` keeps a meaningful injection-hardening posture (no `eval`, no string-timer eval, no `document.write`/`execCommand`, no dangerous element `src` injection) while leaving intact every runtime semantic Next/Astro rely on (prototypes, history, performance, `Math.random`, `JSON`, `Date.now`, `innerHTML`).
|
|
65
|
+
|
|
66
|
+
## SSR / Server-side rendering
|
|
67
|
+
|
|
68
|
+
`community.js` is browser-only. When evaluated in a non-browser environment (Node.js, Bun, edge workers, Next.js / Astro prerender) the SSR guard fires immediately and the entire body is skipped:
|
|
69
|
+
|
|
70
|
+
```js
|
|
71
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') return;
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
This makes it safe to bundle and import in universal (isomorphic) code without wrapping in a `typeof window !== 'undefined'` check at the call site.
|
|
75
|
+
|
|
76
|
+
## When to use base.js instead
|
|
77
|
+
|
|
78
|
+
Use `base.js` when:
|
|
79
|
+
- Running in a controlled environment (SDE/SDC runtime) where framework compatibility is not required.
|
|
80
|
+
- Evaluating untrusted user code and you need the full lockdown (frozen prototypes, blocked `Math.random`, blocked `history`, restricted JSON).
|
|
81
|
+
- You need the `paranoia.js` superset for complete hostile-environment hardening.
|
|
82
|
+
|
|
83
|
+
`community.js` is intentionally weaker than `base.js`. The tradeoff is explicit: you gain framework compatibility at the cost of a reduced attack surface.
|
|
84
|
+
|
|
85
|
+
## Notes
|
|
86
|
+
|
|
87
|
+
- The ES module source `src/sanity/community.js` must be imported and `applyCommunity()` must be called. Bare import (without calling) has no effect.
|
|
88
|
+
- For zero-bundler deployment, use the built classic artifact `dist/build/sanity-community-classic.min.js`, which self-applies on load via `<script src>`.
|
|
89
|
+
- `LOG_ATTEMPTS = true` (current source value): each blocked attempt produces a `console.warn` with stack trace.
|
|
90
|
+
- `STACK_TRACE_LIMIT = 10`: `Error.stackTraceLimit` is reduced to 10 frames (V8/Chrome only).
|
|
91
|
+
- SSR / Server-side rendering: `applyCommunity()` includes the SSR guard internally — calling it in a non-browser environment (Node.js, Bun, edge workers) returns `{applied: false, reason: 'non-browser-realm'}` and makes no changes.
|
|
92
|
+
|
|
93
|
+
## See also
|
|
94
|
+
|
|
95
|
+
- [sanity/base](./base.md) — full strict lockdown (use for untrusted-code / hostile environments)
|
|
96
|
+
- [Security guide](../../guide/security.md) — threat model and lockdown rationale
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
module: sanity/lockdown
|
|
3
|
+
category: sanity
|
|
4
|
+
dependencies: []
|
|
5
|
+
returns: "{ lockdown, harden }"
|
|
6
|
+
worker-safe: partial
|
|
7
|
+
status: complete
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# sanity/lockdown
|
|
11
|
+
|
|
12
|
+
> Strict integrity tier — tame Function constructors, remove evaluators, transitively freeze intrinsics. SES-grade integrity, not confinement.
|
|
13
|
+
|
|
14
|
+
**Source** `packages/front/fw/src/sanity/lockdown.js` | **Type** ES module (`export { lockdown, harden }`) | **Worker-safe** partial
|
|
15
|
+
|
|
16
|
+
Unlike [`sanity/base`](./base.md) and [`sanity/community`](./community.md) — explicit-call ES modules — `lockdown.js` is the **strict integrity tier** exporting `lockdown()` and `harden()`. Integrity is **opt-in** and invoked once; it is **never** auto-applied on bare import. Auto-freezing the realm's intrinsics at import time would break SSR (Next/Astro prerender re-evaluates client modules server-side) and is untestable, so the tier follows the SES discipline: import the module freely, call `lockdown()` exactly once at startup, before any application code.
|
|
17
|
+
|
|
18
|
+
## Resolve
|
|
19
|
+
|
|
20
|
+
`lockdown` is **not** a DI module (no `runtime.resolve`, not in `core/modules.js`). Import the subpath and call it once, as early as possible:
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
import { lockdown, harden } from '@awacloud/fw/sanity/lockdown';
|
|
24
|
+
|
|
25
|
+
lockdown(); // freeze this realm's intrinsics, sever evaluators
|
|
26
|
+
|
|
27
|
+
// Application's own object graphs can be hardened on demand:
|
|
28
|
+
const config = harden({ apiBase: '/v1', limits: { rps: 10 } });
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## API
|
|
32
|
+
|
|
33
|
+
| Method | Signature | Returns |
|
|
34
|
+
|--------|-----------|---------|
|
|
35
|
+
| `lockdown` | `(options?: object) => void` | Apply the integrity lockdown to the current realm. Idempotent. |
|
|
36
|
+
| `harden` | `<T>(target: T) => T` | Transitively `Object.freeze` an object graph; returns `target`. |
|
|
37
|
+
|
|
38
|
+
### `lockdown(options?)`
|
|
39
|
+
|
|
40
|
+
Idempotent (a module-level guard short-circuits repeat calls). Performs, in order:
|
|
41
|
+
|
|
42
|
+
1. **`tameFunctionConstructors()`** — replaces `constructor` on `Function.prototype` and on the three hidden function-constructor prototypes (`%GeneratorFunction%`, `%AsyncFunction%`, `%AsyncGeneratorFunction%`) with a throwing shim. This closes the `({}).constructor.constructor('code')` escape — **the single most important measure**: without it any object can reach `Function.prototype.constructor` (= `Function`) and rebuild an evaluator, bypassing everything else.
|
|
43
|
+
2. **Capture real WebAssembly evaluators** — the gate seam in `wasm-gate.js` captures the genuine `compile`, `compileStreaming`, `instantiate`, and `instantiateStreaming` functions before they are poisoned.
|
|
44
|
+
3. **Remove ambient evaluators** — `globalThis.eval` and `globalThis.Function` are replaced with a throwing shim, as are the WebAssembly evaluators (steps 2 captured the real ones for gated holders).
|
|
45
|
+
4. **Poison sync WebAssembly constructors** — `new WebAssembly.Module` and `new WebAssembly.Instance` are wrapped with throwing shims to close the synchronous-constructor escape (caller-supplied bytes cannot execute). This runs **before** the intrinsic freeze (`lockdown.js:371-375`) so a future hardening of the `WebAssembly` namespace cannot silently defeat the poison.
|
|
46
|
+
5. **`harden(intrinsics)`** — transitive `Object.freeze` over the standard intrinsic graph (own props + accessor functions + `[[Prototype]]`, WeakSet-guarded against cycles), starting from an exhaustive enumerated root set (see Notes).
|
|
47
|
+
6. **DOM/XSS hardening (browser realm only)** — when `window` and `document` are present, `lockdown()` calls `applyBase()` to compose its DOM denylist (`innerHTML`→`innerText` redirect, dangerous `iframe`/`object`/`embed` setters, `document.write`/`execCommand`, …). Steps 1–5 target pure-JS intrinsics and run in **any** realm (main thread, Worker, SSR); step 6 is gated so non-browser realms never apply the DOM layer.
|
|
48
|
+
7. **Arm the WebAssembly capability gate** — finalize the seam so `wasmRuntime` can obtain the capability and load fw's vendored binaries under the locked realm.
|
|
49
|
+
|
|
50
|
+
`options` is currently reserved (unused).
|
|
51
|
+
|
|
52
|
+
### `harden(target)`
|
|
53
|
+
|
|
54
|
+
Depth-first transitive freeze: visits `target`'s own property *values* (data values plus getter/setter functions, by descriptor — getters are **not** invoked) and its `[[Prototype]]`, calling `Object.freeze` on each object/function exactly once (a `WeakSet` guards cycles and re-visits). Primitives are skipped; host objects that refuse freezing are tolerated best-effort. Returns the same `target`. Mirrors SES `harden` for application use.
|
|
55
|
+
|
|
56
|
+
## Examples
|
|
57
|
+
|
|
58
|
+
### Startup lockdown
|
|
59
|
+
|
|
60
|
+
```js
|
|
61
|
+
// main.js — first line of the app, before any module registration.
|
|
62
|
+
import { lockdown } from '@awacloud/fw/sanity/lockdown';
|
|
63
|
+
lockdown();
|
|
64
|
+
|
|
65
|
+
import { runtime } from '@awacloud/fw';
|
|
66
|
+
import modules from '@awacloud/fw/core/modules';
|
|
67
|
+
runtime.registerAll(modules);
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### The escape is closed
|
|
71
|
+
|
|
72
|
+
```js
|
|
73
|
+
lockdown();
|
|
74
|
+
|
|
75
|
+
// All four constructor kinds resolve to the throwing shim:
|
|
76
|
+
({}).constructor.constructor('return globalThis'); // throws TypeError
|
|
77
|
+
(function () {}).constructor('return 1'); // throws
|
|
78
|
+
(async () => {}).constructor('return 1'); // throws
|
|
79
|
+
(function* () {}).constructor('return 1'); // throws
|
|
80
|
+
|
|
81
|
+
globalThis.eval('1 + 1'); // throws
|
|
82
|
+
globalThis.Function('return 1'); // throws
|
|
83
|
+
|
|
84
|
+
Object.isFrozen(Object.prototype); // true
|
|
85
|
+
Object.prototype.polluted = 1; // throws in strict mode
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Hardening an application object graph
|
|
89
|
+
|
|
90
|
+
```js
|
|
91
|
+
const policy = harden({
|
|
92
|
+
roles: { admin: ['read', 'write'], guest: ['read'] },
|
|
93
|
+
});
|
|
94
|
+
policy.roles.admin.push('delete'); // throws — frozen transitively
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Notes
|
|
98
|
+
|
|
99
|
+
- **Intrinsic root set** (exhaustive by design — a missing intrinsic is a hole): every standard global constructor/namespace (`Object, Function, Array, String, Number, Boolean, BigInt, Symbol, Date, RegExp, JSON, Math, Promise, Map, Set, WeakMap, WeakSet, WeakRef, FinalizationRegistry, Reflect, Proxy, Atomics, ArrayBuffer, SharedArrayBuffer, DataView`, every concrete TypedArray), the full `Error` hierarchy (`Error, TypeError, RangeError, ReferenceError, SyntaxError, EvalError, URIError, AggregateError`), each root's `.prototype`, and the **hidden intrinsics** reached structurally: `%TypedArray%`, `%IteratorPrototype%`, `%AsyncIteratorPrototype%`, `%GeneratorFunction%`/`%AsyncFunction%`/`%AsyncGeneratorFunction%` (+ prototypes), and the `%ThrowTypeError%` poison pill. Every access is `typeof`/`try`-guarded so frozen-but-missing hosts never throw.
|
|
100
|
+
- **What the WebAssembly surface deliberately leaves open.** `WebAssembly.validate` is **not** poisoned — the simd128 feature probe must keep working under a locked realm — and neither are `WebAssembly.Memory`, `Table` and `Global`. `WebAssembly` is also absent from the intrinsic root set above, so the namespace itself is never frozen. That is deliberate, not an oversight: none of them can compile or instantiate a module, so closing them would buy no confinement while breaking capability detection. Treat this as the surface's contract — do not "open" what was never closed, and do not add these to a hardening sweep. The corollary for the sync-constructor poison of step 4: it is installed with `defineProperty` and only works while `WebAssembly` stays unhardened, which is why the step **asserts its own effect and throws** rather than silently tolerating a failed write.
|
|
101
|
+
- **Idempotent**: a second `lockdown()` call is a no-op (guard flag), and every individual step tolerates already-frozen / already-poisoned slots.
|
|
102
|
+
- **Default tier.** New applications call `lockdown()` once at startup. In a browser realm it also applies the `base` DOM/XSS denylist (step 6), so `lockdown()` is a superset of `applyBase()`. Choose `community`/`base` alone only when a host framework patches prototypes (Next/Astro dev toolbars). See [Security guide § Recommended default](../../guide/security.md#recommended-default) — including the zero-bundler caveat: no `sanity-lockdown-classic.min.js` artifact is built today.
|
|
103
|
+
- **Worker-safe: partial** — the integrity routine (steps 1–5) runs in any realm including Workers and SSR; the composed DOM hardening (step 6) is browser-only and gated (`lockdown.js:383`). fw does **not** apply `lockdown()` inside the workers it spawns — see [Worker confinement](../../guide/worker-confinement.md) § Applying lockdown inside the worker.
|
|
104
|
+
- **Two import forms — choose by whether you control the call site.**
|
|
105
|
+
- `@awacloud/fw/sanity/lockdown` (source `src/sanity/lockdown.js`) is the tier itself: an **explicit-call** ES module. A bare import of it hardens **nothing** — you call `lockdown()` yourself. This is the correct form everywhere you can write a statement: application entry points, and the bundler integrations that have a snippet-injection seam (Vite, esbuild, Rollup, Bun — driven by `core.sanityImportLine`, which emits `import {lockdown} …; lockdown();`). It is also the only form exporting `harden()`.
|
|
106
|
+
- `@awacloud/fw/sanity/lockdown.apply` (source `src/sanity/lockdown-apply.js`) is a thin **self-applying** wrapper: importing it calls `lockdown()`. Side effect at import **by design** — the same sanctioned exception as the built `.classic` artifacts of the other two tiers, which self-apply on import for the same reason. It exports nothing; importing it *is* the API. Use it **only** where a host can prepend a module specifier but cannot inject a call — the Webpack plugin's entry-import prepend is exactly that case, and `sanity: 'lockdown'` there was a silent no-op until this wrapper landed, because the specifier it prepended was the inert explicit-call source.
|
|
107
|
+
- Both spellings resolve to one module instance, so `lockdown()`'s guard makes them idempotent in either order (whichever runs first applies; the other is a no-op). The wrapper's worker-safety is `partial`, inherited verbatim: it applies wherever `lockdown()` applies and adds no realm requirement of its own. Being side-effect-only, it is listed in the package's `sideEffects` array — without that entry a production bundler flags it pure and deletes the prepended import, silently re-opening that silent no-op.
|
|
108
|
+
|
|
109
|
+
### Comparison to SES (honest)
|
|
110
|
+
|
|
111
|
+
**What this tier matches:**
|
|
112
|
+
|
|
113
|
+
- **Integrity** — tamper-proof primordials (frozen intrinsics, no prototype poisoning) and **escape-closure**: `eval`/`Function` cannot be reconstructed via `f.constructor`. This is the core of what SES `lockdown()` provides.
|
|
114
|
+
- A standalone **`harden`** with the same transitive-freeze semantics for application object graphs.
|
|
115
|
+
|
|
116
|
+
**What this tier does NOT do (deviations — by design):**
|
|
117
|
+
|
|
118
|
+
- **No confinement / no `Compartment`.** This tier provides **integrity only**. It does not give you isolated evaluation of untrusted code. Untrusted code is isolated via **Workers** (a separate realm behind a structured-clone boundary) — see the [Worker confinement guide](../../guide/worker-confinement.md). Do not run untrusted code in the main realm and rely on this tier to contain it; it cannot.
|
|
119
|
+
- **`globalThis` is left extensible by design.** The app realm must stay open to add globals, so only the named evaluators are removed — `globalThis` itself is not sealed/frozen. This is weaker than SES's sealed Compartment global.
|
|
120
|
+
- **Not a SES *permits* allowlist.** This is a pragmatic transitive freeze over an enumerated root set, **not** SES's audited, per-property *permits* allowlist (which whitelists exactly the standard properties and removes the rest). It freezes what is reachable; it does not certify the shape of each intrinsic.
|
|
121
|
+
- **Residual code-loading vectors are NOT closed by property taming.** Dynamic `import()` is *syntax*, not a property — it cannot be poisoned by replacing a slot — and `<script>` injection is a DOM/network vector. Close these with a server **CSP** (`script-src`) or by running in a Worker without those powers. The DOM step (browser realm) blocks `innerHTML`/dangerous-element vectors but does not replace a CSP.
|
|
122
|
+
|
|
123
|
+
## See also
|
|
124
|
+
|
|
125
|
+
- [sanity/base](./base.md) — composed DOM/XSS denylist (browser realm) and the prototype freeze it shares
|
|
126
|
+
- [sanity/community](./community.md) — framework-friendly degraded denylist
|
|
127
|
+
- [Security Guide](../../guide/security.md) — threat model and non-guarantees of the sanity layer
|
|
128
|
+
- [Worker confinement](../../guide/worker-confinement.md) — isolated evaluation of untrusted code, the confinement complement to this integrity tier (the 2026-06-15 spike record it supersedes is [`docs/notes/worker-confinement-spike.md`](../../notes/worker-confinement-spike.md))
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
module: typed
|
|
3
|
+
category: (root)
|
|
4
|
+
dependencies: [runtime]
|
|
5
|
+
returns: object
|
|
6
|
+
worker-safe: true
|
|
7
|
+
status: complete
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# typed — typed-runtime facade (`@awacloud/fw/typed`)
|
|
11
|
+
|
|
12
|
+
> Two entry points giving `resolve`/`resolveAll` a type narrowed by module
|
|
13
|
+
> name, without changing the runtime's actual behavior.
|
|
14
|
+
|
|
15
|
+
**Module** `typed` | **Source** `packages/front/fw/src/typed.js` | **Deps** `runtime` | **Worker-safe** yes (pure functions; `createRuntime` only constructs a `ModuleRuntime`)
|
|
16
|
+
|
|
17
|
+
## Resolve
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
import { asTyped, createRuntime } from '@awacloud/fw/typed';
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Not a DI module — imported directly by subpath, like `sanity/lockdown`.
|
|
24
|
+
|
|
25
|
+
## API
|
|
26
|
+
|
|
27
|
+
Exactly the two exports of `src/typed.js`:
|
|
28
|
+
|
|
29
|
+
| Export | Signature | Returns |
|
|
30
|
+
|---|---|---|
|
|
31
|
+
| `asTyped` | `(runtime: *) => *` | identity cast — re-types an existing `ModuleRuntime` at the type level; no runtime effect |
|
|
32
|
+
| `createRuntime` | `(modules?: *) => *` | builds a fresh `ModuleRuntime`, deep-registers `modules` (via `registerAllDeep`, so transitive `deps` come along) when provided, and returns it typed |
|
|
33
|
+
|
|
34
|
+
`createRuntime`'s `modules` argument accepts either an array of module
|
|
35
|
+
definitions or a namespace object whose values are module definitions (the
|
|
36
|
+
shape of `@awacloud/fw/core/modules`).
|
|
37
|
+
|
|
38
|
+
**Narrowing caveat** (quoted from `src/typed.js`'s file header): *"`resolve`
|
|
39
|
+
is typed against the FULL catalog, not against what you actually
|
|
40
|
+
registered (module `name` is `string` in the emitted `.d.ts`, not a
|
|
41
|
+
literal, so the registered set can't be tracked at the type level). Only
|
|
42
|
+
call `resolve(name)` for modules you injected — resolving an unregistered
|
|
43
|
+
name type-checks but throws 'Module not found' at runtime."*
|
|
44
|
+
|
|
45
|
+
## Types
|
|
46
|
+
|
|
47
|
+
The precise return types live in `types/typed.d.ts` plus the generated
|
|
48
|
+
`types/registry.generated.d.ts` (module-name → instance-shape map), rebuilt
|
|
49
|
+
with:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
bun run types:registry
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Examples
|
|
56
|
+
|
|
57
|
+
```js
|
|
58
|
+
import { createRuntime } from '@awacloud/fw/typed';
|
|
59
|
+
import modules from '@awacloud/fw/core/modules';
|
|
60
|
+
|
|
61
|
+
const rt = createRuntime(modules);
|
|
62
|
+
const hex = rt.resolve('hex'); // narrowed to hex's instance shape
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
```js
|
|
66
|
+
import { runtime } from '@awacloud/fw';
|
|
67
|
+
import { asTyped } from '@awacloud/fw/typed';
|
|
68
|
+
|
|
69
|
+
const typedRuntime = asTyped(runtime); // same instance, typed
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Notes
|
|
73
|
+
|
|
74
|
+
- `asTyped` imports nothing; `createRuntime` pulls in `ModuleRuntime`.
|
|
75
|
+
Consumers using only `asTyped` tree-shake `createRuntime` (and
|
|
76
|
+
`ModuleRuntime`) away.
|
|
77
|
+
- Both exports are runtime no-ops beyond `createRuntime`'s actual
|
|
78
|
+
registration work — the typing value is entirely at the TypeScript level,
|
|
79
|
+
resolved via `types/typed.d.ts` and the generated registry map.
|
|
80
|
+
|
|
81
|
+
## See also
|
|
82
|
+
|
|
83
|
+
- [TypeScript guide](../guide/typescript.md)
|
|
84
|
+
- [runtime](./core/runtime.md) — the `ModuleRuntime` class both exports wrap
|
|
85
|
+
- [main](./core/main.md) — the default `@awacloud/fw` entry point
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Development — DX sheets
|
|
2
|
+
|
|
3
|
+
Practical sheets for **operating** the `@awacloud/fw` repo (running, building, generating), distinct from the *writing* guides (`../guide/`). `fw` is self-contained: it can be cloned and developed standalone, under **bun** (default) or **Node**.
|
|
4
|
+
|
|
5
|
+
| Sheet | Subject |
|
|
6
|
+
|---|---|
|
|
7
|
+
| [runtime.md](./runtime.md) | Dev runtime choice: bun by default vs Node — which task, which prerequisites, lean install policy. |
|
|
8
|
+
| [testing.md](./testing.md) | Running the suite (bun / Node-vitest), categories, extended crypto, KAT/ACVP vectors. |
|
|
9
|
+
| [types.md](./types.md) | Generating `.d.ts`, typed registry, audit. |
|
|
10
|
+
| [provenance.md](./provenance.md) | Origin of third-party-derived code (SJCL, BSD-2-Clause; TweetNaCl, public domain; Penner easing equations, BSD); the notices shipped out of prudence live under `third-party/`. |
|
|
11
|
+
| [publishing.md](./publishing.md) | **Lean** npm package (consumer) + transparency via git/CDN-git + CDN usage. |
|
|
12
|
+
|
|
13
|
+
Quick start (mono-repo **or** standalone clone):
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
cd packages/front/fw
|
|
17
|
+
bun install
|
|
18
|
+
bun run test # tests under bun
|
|
19
|
+
bun run prebuild # build bundles
|
|
20
|
+
# Node variant:
|
|
21
|
+
bun run setup:vitest && bun run test:vitest
|
|
22
|
+
bun run prebuild:node
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
See also: [writing tests](../guide/test-format.md) · [internal tooling](../tools/README.md) · [integrations](../../integrations/README.md).
|