motely-wasm 9.0.0 → 9.9.9

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,14 +1,21 @@
1
1
  # motely-wasm (NativeAOT-LLVM + Bootsharp)
2
2
 
3
- This project compiles Motely to **browser WASM** with **Bootsharp** interop. Prefer **`MotelyJamlSearchBuilder`** for new code (`loadJaml`/`compileJummy` → search mode → `run`). The legacy **`MotelyWasmHost`** `start*` helpers are still exported for compatibility. Progress/results go through **`SearchEvents`**.
3
+ This project compiles Motely to **browser WASM** with **Bootsharp** interop. Two complementary APIs are exported, both first-class:
4
+
5
+ - **`MotelyWasmHost`** — one-call host. `loadJaml` / `compileJummy` parse JAML; `startRandomSearchFromJaml(jaml, count)`, `startConfiguredSearchFromJaml(...)`, `startSeedListSearchFromJaml(...)` start a search in a single call. The host owns `_currentSearch`; `stopSearch()` cancels it.
6
+ - **`MotelyJamlSearchBuilder`** — fluent multi-step builder. Chain `loadJaml(jaml) → random(n) | sequential(...) | seedList(...) | aesthetic(a) | keywords(...) → run()` when you need fine-grained control over the search pipeline.
7
+
8
+ Both call into the same engine. Pick whichever shape matches your call site; neither is deprecated.
9
+
10
+ Progress and results go through **`SearchEvents`** (`onProgress`, `onResult`, `onComplete` — JS subscribes; C# notifies). Single-seed inspection lives on **`MotelyWasmHost`** (`singleGetBossForAnte`, `singleGetAnteFirstVoucher`, etc.) — these take `seed/deck/stake` on every call so JS does not have to hold a stateful per-instance handle.
4
11
 
5
12
  The **`Program`** class here is only the **runtime bootstrap** (`Main` → `RunBootsharp()`). Do not confuse it with `Motely.CLI`.
6
13
 
7
- **Bootsharp glue** (`JSExport` / `JSImport` / `JSPreferences`) is isolated in **`BootsharpInterop.cs`** so you can ignore it while working in C#. **`MotelyJamlSearchBuilder`** (preferred search API), **`MotelyWasmHost`** (compatibility wrapper), **`MotelySingleSearchContext`** (seed inspection), and **`SearchEvents`** (progress/results) are the real API surface.
14
+ **Bootsharp glue** (`JSExport` / `JSImport` / `JSPreferences`) is isolated in **`BootsharpInterop.cs`** so you can ignore it while working in C#. The public API surface is **`MotelyWasmHost`**, **`MotelyJamlSearchBuilder`**, **`MotelySingleSearchContext`** (seed inspection), and **`SearchEvents`** (progress/results).
8
15
 
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). **Monaco** is not part of these packages — use `tools/jaml-language/monaco` (`@motely/jaml-monaco`) for editor assets.
16
+ After `dotnet publish` on this project, the npm package is emitted under `motely-wasm/` (single package, binaries always embedded). **Monaco** is not part of these packages — use `tools/jaml-language/monaco` (`@motely/jaml-monaco`) for editor assets.
10
17
 
11
- **API note:** `MotelyJamlSearchBuilder` is the preferred API (`loadJaml` `random`/`sequential`/etc `run`), but `MotelyWasmHost` remains available for older callers (`loadJaml`, `startRandomSearch`, `stopSearch`, etc.).
18
+ **Bootsharp interop rule (9.0.0+):** a `[JSExport]` interface method on `MotelyWasmHost` must NOT call another `[JSExport]` interface method on `this`. Mono WASM rejects the resulting managed→`[UnmanagedCallersOnly]` dispatch with `Fatal error. Invalid Program: attempted to call a UnmanagedCallersOnly method from managed code.` Inline shared logic into a `private static` helper (see `LoadJamlCore`) and call the helper from each public method.
12
19
 
13
20
  **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
21
 
package/package.json CHANGED
@@ -1,40 +1,37 @@
1
1
  {
2
- "name": "motely-wasm",
3
- "version": "9.0.0",
4
- "description": "MotelyJAML — Balatro seed search engine (browser WASM / NativeAOT-LLVM). Import: import bootsharp, { MotelyJamlSearchBuilder, MotelyWasmHost, SearchEvents, Motely } from \"motely-wasm\"; await bootsharp.boot();",
5
- "type": "module",
6
- "main": "./index.mjs",
7
- "types": "./types/index.d.ts",
8
- "browser": {
9
- "fs/promises": false
10
- },
11
- "exports": {
12
- ".": {
13
- "types": "./types/index.d.ts",
14
- "import": "./index.mjs",
15
- "default": "./index.mjs"
16
- },
17
- "./jaml.schema.json": "./jaml.schema.json"
18
- },
19
- "files": [
20
- "**/*",
21
- "!test.html",
22
- "!index.html",
23
- "!**/*.pdb",
24
- "!**/*.tgz"
25
- ],
26
- "keywords": [
27
- "balatro",
28
- "seed",
29
- "wasm",
30
- "bootsharp",
31
- "nativeaot-llvm",
32
- "jaml"
33
- ],
34
- "repository": {
35
- "type": "git",
36
- "url": "git+https://github.com/OptimusPi/MotelyJAML.git",
37
- "directory": "Motely"
38
- },
39
- "license": "MIT"
2
+ "name": "motely-wasm",
3
+ "version": "9.9.9",
4
+ "description": "MotelyJAML — Balatro seed search engine (browser WASM / NativeAOT-LLVM). Import: import bootsharp, { MotelyJamlSearchBuilder, MotelyWasmHost, SearchEvents, Motely } from \"motely-wasm\"; await bootsharp.boot();",
5
+ "type": "module",
6
+ "main": "../motely-wasm/index.mjs",
7
+ "types": "../motely-wasm/types/index.d.ts",
8
+ "browser": {
9
+ "fs/promises": false
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "types": "../motely-wasm/types/index.d.ts",
14
+ "import": "../motely-wasm/index.mjs",
15
+ "default": "../motely-wasm/index.mjs"
16
+ }
17
+ },
18
+ "files": [
19
+ "../motely-wasm/**/*",
20
+ "!**/*.pdb",
21
+ "!**/*.tgz"
22
+ ],
23
+ "keywords": [
24
+ "balatro",
25
+ "seed",
26
+ "wasm",
27
+ "bootsharp",
28
+ "nativeaot-llvm",
29
+ "jaml"
30
+ ],
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/OptimusPi/MotelyJAML.git",
34
+ "directory": "Motely"
35
+ },
36
+ "license": "MIT"
40
37
  }
package/favicon.ico DELETED
Binary file