motely-wasm 6.0.1 → 7.0.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/README.md +6 -60
- package/index.mjs +95 -191
- package/jaml.schema.json +1 -1
- package/package.json +2 -2
- package/test.mjs +23 -0
- package/types/bindings.g.d.ts +321 -115
- package/bin/dotnet.js +0 -4
- package/bin/dotnet.native.js +0 -16
- package/bin/dotnet.native.wasm +0 -0
- package/bin/dotnet.runtime.js +0 -3
package/README.md
CHANGED
|
@@ -1,65 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# motely-wasm (NativeAOT-LLVM + Bootsharp)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This project compiles Motely to **browser WASM** with **Bootsharp** interop. The embeddable API is **`MotelyWasmHost`** (not a CLI): JavaScript imports it, calls `getVersion()`, `loadJaml`, `startSequentialSearch`, `startSequentialSearchBySearchIndex`, etc., and receives progress/results via **`SearchEvents`**.
|
|
4
4
|
|
|
5
|
-
**`
|
|
5
|
+
The **`Program`** class here is only the **runtime bootstrap** (`Main` → `RunBootsharp()`). Do not confuse it with `Motely.CLI`.
|
|
6
6
|
|
|
7
|
-
After publish, the
|
|
7
|
+
After `dotnet publish` on this project, the npm package is emitted under `motely-wasm/` (and `motely-wasm-compat/` is built by the csproj target).
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
**Breaking change (vs older builds):** the exported host type was renamed from `MotelyProgram` to `MotelyWasmHost`.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Bootsharp’s `index.mjs` ends with something like `export { Event, Motely, … as default }`. Use it like this:
|
|
14
|
-
|
|
15
|
-
```js
|
|
16
|
-
import dotnet, { Motely } from "motely-wasm";
|
|
17
|
-
|
|
18
|
-
await dotnet.boot(); // or dotnet.boot({ root: "/path/to/motely-wasm-mt/bin" } for threaded)
|
|
19
|
-
|
|
20
|
-
const Program = Motely.BrowserWasm.MotelyProgram;
|
|
21
|
-
const ver = Program.getVersion();
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
Types are under `motely-wasm/types/`; `Motely` holds enums (`MotelyDeck`, `MotelyStake`) and namespaces (`Motely.BrowserWasm.MotelyProgram`, `Motely.BrowserWasm.SearchEvents`).
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## Commands (from repo root `MotelyJAML`)
|
|
29
|
-
|
|
30
|
-
### Single-thread package (default)
|
|
31
|
-
|
|
32
|
-
```powershell
|
|
33
|
-
dotnet publish Motely.BrowserWasm -c Release
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Output: **`Motely.BrowserWasm/motely-wasm/`**
|
|
37
|
-
|
|
38
|
-
### Multi-thread (pthread) package
|
|
39
|
-
|
|
40
|
-
Some LLVM/SDK combos fail to link threaded WASM — only ship after a **successful** local publish.
|
|
41
|
-
|
|
42
|
-
```powershell
|
|
43
|
-
dotnet publish Motely.BrowserWasm/Motely.BrowserWasm.csproj -c Release /p:MotelyWasmThreads=true
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Output: **`Motely.BrowserWasm/motely-wasm-mt/`** (includes `bin/` with `*.wasm` for the threaded loader).
|
|
47
|
-
|
|
48
|
-
Threaded WASM in the browser needs **cross-origin isolation** (`COOP: same-origin`, `COEP: require-corp` or similar). The default single-thread package does **not** require these.
|
|
49
|
-
|
|
50
|
-
### Optional: `npm pack` / `npm publish`
|
|
51
|
-
|
|
52
|
-
Tarball verification or registry publish still use the **npm CLI** (requires Node on that machine, or run in CI):
|
|
53
|
-
|
|
54
|
-
```powershell
|
|
55
|
-
cd Motely.BrowserWasm/motely-wasm
|
|
56
|
-
npm pack --dry-run
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
From repo root, **`./publish.ps1`** regenerates schema + language tooling, runs `dotnet publish`, then runs `npm pack` / `npm publish`.
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
## SeedSearcherWebsite
|
|
64
|
-
|
|
65
|
-
Static QA: **`build-website.sh`** / **`Build-Website.ps1`** copy `motely-wasm/`, `motely-wasm-mt/`, and the HTML/JS harness into `dist/` (no bundler). Deploy `dist/` with Vercel or any host that serves `*.wasm` with the right `Content-Type` and COOP/COEP where needed.
|
|
11
|
+
**Sequential batch size:** `batchCharCount` applies only to **sequential** search (`startSequentialSearch*`, and `startConfiguredSearch` when the JAML has **no** `aesthetics`). Keyword/random/aesthetic/seed-list modes are **provider** searches and do **not** take `batchCharCount` (the engine uses fixed vector-width batches).
|