motely-wasm 15.1.2 → 15.3.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 +52 -61
- package/index.mjs +2 -2
- package/jaml.schema.json +1 -4
- package/package.json +1 -1
- package/types/bindings.g.d.ts +0 -910
package/README.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# motely-wasm
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
SIMD-vectorized [Balatro](https://www.playbalatro.com/) seed search in the browser — the [Motely](https://github.com/OptimusPi/MotelyJAML) engine compiled to WebAssembly via NativeAOT-LLVM, driven by **JAML** (Jimbo's Ante Markup Language) filters.
|
|
4
|
+
|
|
5
|
+
- **Single-file ES module.** Embedded WASM binary, no sideloaded resources, no `.wasm` fetch path to configure.
|
|
6
|
+
- **Single-threaded.** No `SharedArrayBuffer`, no COOP/COEP headers required — runs on Vercel, Cloudflare Pages, GitHub Pages, MCP Apps iframes, and every other locked-down host.
|
|
7
|
+
- **Browser + Node + Deno + Bun + Edge.** Pure ES module, no Node-only APIs.
|
|
8
|
+
- **Typed.** Generated TypeScript declarations for the full Motely / JAML surface ship in `types/`.
|
|
4
9
|
|
|
5
10
|
## Install
|
|
6
11
|
|
|
@@ -8,7 +13,7 @@ Find Balatro seeds with JAML filters — Jimbo's Ante Markup Language. SIMD-vect
|
|
|
8
13
|
npm install motely-wasm
|
|
9
14
|
```
|
|
10
15
|
|
|
11
|
-
## Boot &
|
|
16
|
+
## Boot & search
|
|
12
17
|
|
|
13
18
|
```ts
|
|
14
19
|
import motely, { MotelyWasm, MotelyWasmEvents } from "motely-wasm";
|
|
@@ -27,94 +32,80 @@ should:
|
|
|
27
32
|
score: 80
|
|
28
33
|
`;
|
|
29
34
|
|
|
30
|
-
// Events are mutable handler slots — assign your callback, do
|
|
31
|
-
MotelyWasmEvents.notifyResult
|
|
35
|
+
// Events are mutable handler slots — assign your callback, do NOT call .subscribe().
|
|
36
|
+
MotelyWasmEvents.notifyResult = (seed, score, tallyColumns) => console.log(seed, score, tallyColumns);
|
|
32
37
|
MotelyWasmEvents.notifyProgress = (seedsSearched, matchingSeeds) => { /* … */ };
|
|
33
38
|
MotelyWasmEvents.notifyComplete = (status, totalSeedsSearched, matchingSeeds) => { /* … */ };
|
|
34
39
|
|
|
35
|
-
const search = MotelyWasm.startRandomSearch(jaml,
|
|
36
|
-
// later: search.cancel();
|
|
40
|
+
const search = MotelyWasm.startRandomSearch(jaml, 10_000);
|
|
41
|
+
// later: search.cancel(); search.dispose();
|
|
37
42
|
```
|
|
38
43
|
|
|
39
|
-
|
|
44
|
+
> JAML is **not** YAML — it's the Motely filter language. The schema ships at [`motely-wasm/jaml.schema.json`](./jaml.schema.json) and is also returned at runtime by `MotelyWasm.getJamlSchema()`.
|
|
40
45
|
|
|
41
|
-
|
|
46
|
+
## Search modes
|
|
42
47
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
| Method | Purpose |
|
|
49
|
+
|---|---|
|
|
50
|
+
| `startSequentialSearch(jaml, batchCharCount, startBatch, endBatch)` | Deterministic walk through a slice of the 35⁸ ≈ 2.25T seed space. |
|
|
51
|
+
| `startRandomSearch(jaml, randomSeedCount)` | Random sampling. |
|
|
52
|
+
| `startSeedListSearch(jaml, seeds[])` | Verify a known list of seeds against a JAML filter. |
|
|
53
|
+
| `startKeywordSearch(jaml, keywordsCsv, paddingChars)` | Match seeds containing keywords (CSV input, padding controls anchoring). |
|
|
54
|
+
| `startAestheticSearch(jaml, JamlAesthetic)` | Curated themed pools: `Palindrome`, `Psychosis`, `Gross`, `Nsfw`, `Funny`, `Balatro`. |
|
|
55
|
+
|
|
56
|
+
All searches return an `IMotelyWasmSearch` with `getSnapshot()`, `cancel()`, `waitForCompletion()`, `dispose()`. Hits are streamed through `MotelyWasmEvents.notifyResult`.
|
|
46
57
|
|
|
47
|
-
|
|
58
|
+
## Single-seed inspection
|
|
48
59
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
60
|
+
```ts
|
|
61
|
+
const ctx = MotelyWasm.createSearchContext("DPADD313", JamlDeck.Red, JamlStake.White);
|
|
62
|
+
const boss = ctx.getBossForAnte(1);
|
|
63
|
+
// + voucher / tag / booster / shop item / joker / tarot / spectral / planet streams,
|
|
64
|
+
// each with a *Chunk variant for batched pulls.
|
|
65
|
+
ctx.dispose();
|
|
66
|
+
```
|
|
52
67
|
|
|
53
|
-
|
|
68
|
+
## Loading without a bundler
|
|
69
|
+
|
|
70
|
+
For environments where bundling 11 MB of WASM into every deployment artifact is wrong (MCP Apps single-HTML resources, Cloudflare Workers, Vercel Functions, plain `<script type="module">`), import the package directly from a public npm CDN:
|
|
54
71
|
|
|
55
72
|
```ts
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
73
|
+
const mod = await import(
|
|
74
|
+
"https://unpkg.com/motely-wasm@15.3.0/index.mjs"
|
|
75
|
+
);
|
|
59
76
|
await mod.default.boot();
|
|
60
77
|
const { MotelyWasm, MotelyWasmEvents } = mod;
|
|
61
78
|
```
|
|
62
79
|
|
|
63
|
-
|
|
80
|
+
Equivalent jsDelivr URL: `https://cdn.jsdelivr.net/npm/motely-wasm@15.3.0/index.mjs`. **Pin the version** — `@latest` defeats long-term browser caching.
|
|
64
81
|
|
|
65
82
|
### Content Security Policy
|
|
66
83
|
|
|
67
|
-
|
|
84
|
+
For sandboxed iframes (MCP Apps), allow both script loading and fetch/import from whichever CDN you chose:
|
|
68
85
|
|
|
69
86
|
```
|
|
70
|
-
script-src https://cdn.
|
|
71
|
-
connect-src https://cdn.
|
|
87
|
+
script-src https://unpkg.com https://cdn.jsdelivr.net
|
|
88
|
+
connect-src https://unpkg.com https://cdn.jsdelivr.net
|
|
72
89
|
```
|
|
73
90
|
|
|
74
|
-
|
|
91
|
+
## Types
|
|
75
92
|
|
|
76
93
|
```ts
|
|
77
|
-
{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
## Build
|
|
88
|
-
|
|
89
|
-
NativeAOT-LLVM + SIMD. Verify "LLVM compilation to IR finished" in build output.
|
|
90
|
-
|
|
91
|
-
```xml
|
|
92
|
-
<BootsharpLlvm>true</BootsharpLlvm>
|
|
93
|
-
<WasmEnableSIMD>true</WasmEnableSIMD>
|
|
94
|
-
<EmccFlags>-msimd128</EmccFlags>
|
|
94
|
+
import type {
|
|
95
|
+
IMotelyWasmSearch,
|
|
96
|
+
IMotelyWasmSearchContext,
|
|
97
|
+
MotelyWasmSearchSnapshot,
|
|
98
|
+
MotelyWasmSearchCompletion,
|
|
99
|
+
JamlDeck, JamlStake, JamlAesthetic,
|
|
100
|
+
} from "motely-wasm";
|
|
95
101
|
```
|
|
96
102
|
|
|
97
|
-
The `
|
|
98
|
-
|
|
99
|
-
## Release Verification
|
|
100
|
-
|
|
101
|
-
Before publishing, verify the generated package, not a stale local wrapper:
|
|
102
|
-
|
|
103
|
-
```bash
|
|
104
|
-
dotnet publish Motely.Wasm/Motely.Wasm.csproj -c Release
|
|
105
|
-
cd Motely.Wasm/e2e
|
|
106
|
-
npm install ../../motely-wasm/motely-wasm-<version>.tgz
|
|
107
|
-
node release-smoke.mjs
|
|
108
|
-
node jamlyzer-preview-smoke.mjs
|
|
109
|
-
```
|
|
103
|
+
The generated `types/bindings.g.d.ts` is the source of truth — Bootsharp emits it from the C# interfaces, so it never drifts from runtime behavior.
|
|
110
104
|
|
|
111
|
-
|
|
105
|
+
## Build details
|
|
112
106
|
|
|
113
|
-
- `
|
|
114
|
-
- `MotelyWasm.getJamlSchema().version` equals the package version
|
|
115
|
-
- the schema does not expose removed aliases such as `mixedJoker`
|
|
116
|
-
- generated Bootsharp exports boot and execute from the packed artifact
|
|
107
|
+
NativeAOT-LLVM with SIMD enabled (`-msimd128`), threads explicitly disabled, binaries embedded in the single `index.mjs`. The `MONO_WASM:` prefix in console logs is Bootsharp's glue log — this is **not** a Mono runtime build.
|
|
117
108
|
|
|
118
109
|
## License
|
|
119
110
|
|
|
120
|
-
MIT
|
|
111
|
+
MIT — © pifreak
|