motely-wasm 6.1.0 → 7.0.2
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 +10 -67
- package/index.mjs +57 -36
- package/jaml.schema.json +64 -30
- package/monaco/index.js +1 -1
- package/package.json +2 -2
- package/test.mjs +23 -0
- package/types/bindings.g.d.ts +47 -827
package/README.md
CHANGED
|
@@ -1,76 +1,19 @@
|
|
|
1
|
-
#
|
|
1
|
+
# motely-wasm (NativeAOT-LLVM + Bootsharp)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This project compiles Motely to **browser WASM** with **Bootsharp** interop. Prefer **`createPlan` → chain on `settings` (same as `JamlSearchBuilder` / `IMotelySearchSettings` in C#) → `runSearch`**; the `start*` helpers are optional shortcuts. Progress/results go through **`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
|
-
|
|
7
|
+
**Bootsharp glue** (`JSExport` / `JSImport` / `JSPreferences`) is isolated in **`BootsharpInterop.cs`** so you can ignore it while working in C#. **MotelyWasmHost.cs** is the real API surface.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
After `dotnet publish` on this project, the npm package is emitted under `motely-wasm/` (and `motely-wasm-compat/` is built by the csproj target).
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
**Breaking change (vs older builds):** the exported host type was renamed from `MotelyProgram` to `MotelyWasmHost`.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
**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).
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
import bootsharp, {
|
|
17
|
-
MotelyProgram,
|
|
18
|
-
SearchEvents,
|
|
19
|
-
MotelyDeck,
|
|
20
|
-
MotelyStake,
|
|
21
|
-
} from "motely-wasm";
|
|
15
|
+
**Threads:** the browser host runs search with **one** worker (`threadCount` is not a parameter). Use the CLI/TUI for configurable parallelism.
|
|
22
16
|
|
|
23
|
-
|
|
17
|
+
**Seed list:** `startSeedListSearch` takes **`string[]` seeds** (trimmed, empties dropped), not a CSV string.
|
|
24
18
|
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Types are under `motely-wasm/types/`; the generated API is exported directly as named exports such as `MotelyProgram`, `SearchEvents`, `MotelyDeck`, and `MotelyStake`.
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## Commands (from repo root `MotelyJAML`)
|
|
33
|
-
|
|
34
|
-
### Default package
|
|
35
|
-
|
|
36
|
-
```powershell
|
|
37
|
-
dotnet publish Motely.BrowserWasm -c Release
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Output: **`Motely.BrowserWasm/motely-wasm/`**. With embedded binaries enabled, this is the low-friction package shape for browser and bundler consumers.
|
|
41
|
-
|
|
42
|
-
### Parallelism: Web Workers (not pthread WASM)
|
|
43
|
-
|
|
44
|
-
This project does **not** ship or promise a pthread / multi-threaded Emscripten WASM build. Combining **.NET WASM + NativeAOT-LLVM + pthreads** is a separate, poorly documented matrix; there is no reproducible “proof script” checked in here that threaded AOT-LLVM WASM is a supported combination—so we do not bet the browser story on it.
|
|
45
|
-
|
|
46
|
-
**What we actually use:** scale in the browser by spawning **Web Workers**, importing `motely-wasm` in each worker, and calling `bootsharp.boot()` once per worker. Workers are a normal, well-defined browser API; each worker is its own isolate—no `motely-wasm-mt` package, no COOP/COEP requirement for that pattern.
|
|
47
|
-
|
|
48
|
-
**Proof:** after `dotnet publish`, run **`Motely.TestWebsite`** (or your app) locally and confirm behavior. Treat any WASM path as “works on my machine / CI” until you’ve verified it for your SDK and host.
|
|
49
|
-
|
|
50
|
-
### Optional: `npm pack` / `npm publish`
|
|
51
|
-
|
|
52
|
-
Tarball verification or registry publish still use the **npm CLI** on the publishing machine or in CI:
|
|
53
|
-
|
|
54
|
-
```powershell
|
|
55
|
-
cd Motely.BrowserWasm/motely-wasm
|
|
56
|
-
npm pack --dry-run
|
|
57
|
-
cd ../motely-wasm-compat
|
|
58
|
-
npm pack --dry-run
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
From repo root, **`Build-Release.ps1`** does the full pipeline (solution build, schema, jaml-language, `dotnet publish`, optional npm). **`publish.ps1`** is a shortcut for `Build-Release.ps1 -Npm Publish` (use `-DryRun` on `publish.ps1` for `npm pack --dry-run`).
|
|
62
|
-
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
## Test website (`Motely.TestWebsite`)
|
|
66
|
-
|
|
67
|
-
Vite harness that loads **`motely-wasm`** on `/` and **`motely-wasm-compat`** on `/compat.html` (separate pages so each bundle calls `bootsharp.boot()` once).
|
|
68
|
-
|
|
69
|
-
```powershell
|
|
70
|
-
dotnet publish Motely.BrowserWasm -c Release
|
|
71
|
-
cd Motely.TestWebsite
|
|
72
|
-
npm install
|
|
73
|
-
npm run dev
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Production static output: `npm run build` → `dist/`. Deploy with any static host; ensure `*.wasm` is served with `application/wasm` (Vite preview/dev handles this for local QA).
|
|
19
|
+
**Cancel:** `runSearch` / each `start*` returns **`IMotelySearch`** — call **`cancel()`** on that object. There is no host-level “current search” slot.
|