9150696807
Browser consumers (kelvar) need a host-provided password prompt so the
master never appears on the command line. Exposes a single method:
WaferRepl::set_prompter(js_sys::Function) -> Result<(), JsError>
Given a JS function `(prompt: string) => string`, registers it as the
Forth word `READ-PASSWORD` with stack effect
( prompt-addr prompt-u -- pw-addr pw-u )
The returned bytes land in WAFER's PAD region. Enforces PAD_SIZE-1 as
a hard upper bound — a silent truncation would cause a derived password
to mismatch the one used during setup, which is exactly the failure
mode we are trying to avoid.
`js_sys::Function` is !Send/!Sync but `HostFn` requires both. In a
browser WASM build there is only ever one thread, so wrap it in
`send_wrapper::SendWrapper`, which panics if accessed off-thread — an
honest guard rather than a lie.
24 lines
543 B
TOML
24 lines
543 B
TOML
[package]
|
|
name = "wafer-web"
|
|
description = "WAFER browser REPL — WebAssembly Forth in the browser"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[lib]
|
|
crate-type = ["cdylib", "rlib"]
|
|
|
|
[dependencies]
|
|
wafer-core = { path = "../core", version = "0.1.0", default-features = false, features = ["crypto"] }
|
|
wasm-bindgen = "0.2"
|
|
js-sys = "0.3"
|
|
send_wrapper = { workspace = true }
|
|
wasm-encoder = { workspace = true }
|
|
anyhow = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
wasm-bindgen-test = "0.3"
|