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 CHANGED
@@ -1,65 +1,11 @@
1
- # Motely browser WASM (`motely-wasm` / `motely-wasm-mt`)
1
+ # motely-wasm (NativeAOT-LLVM + Bootsharp)
2
2
 
3
- ## What Bootsharp actually does
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
- **`dotnet publish Motely.BrowserWasm`** is the **entire** build. [Bootsharp](https://github.com/korif/Bootsharp) emits the **complete** npm package: `index.mjs`, WASM, TypeScript typings, and the JS interop glue. You are **not** hand-assembling an npm package.
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 output folder (`Motely.BrowserWasm/motely-wasm/` or `motely-wasm-mt/`) is a **real** package you can `npm pack`, depend on with `"file:…"`, or publish to the registry.
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
- The only extra step in this repo is **MSBuild**: it copies `Motely/package.json`, `jaml.schema.json`, README metadata, and Monaco assets **on top of** Bootsharp’s output so `name`, `description`, `exports`, and shipped files match what you want on npm. **Version** comes from `$(MotelyVersion)` in `Directory.Packages.props` via the project `Version` property not from editing `package.json` by hand for every release.
9
+ **Breaking change (vs older builds):** the exported host type was renamed from `MotelyProgram` to `MotelyWasmHost`.
10
10
 
11
- ### JavaScript: default export = boot API, **`Motely` = named export**
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).