@ohtaman/washi 0.9.0-rc.1 → 0.9.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/dist/browser/washi.js +365 -316
- package/dist/browser/washi.min.js +1 -1
- package/dist/lib/washi.js +365 -316
- package/dist/types/modeler/model.d.ts +7 -0
- package/dist/types/modeler/model.d.ts.map +1 -1
- package/docs/getting-started/ai-agents.md +9 -8
- package/docs/getting-started/coding-agents.md +38 -5
- package/docs/getting-started/runtimes.md +23 -6
- package/llms-full.txt +32 -14
- package/llms.txt +9 -8
- package/package.json +2 -2
- package/skills/washi/SKILL.md +20 -23
- package/skills/{washi-single-html/SKILL.md → washi/references/single-html.md} +3 -8
|
@@ -9,6 +9,12 @@ import { type ParsedExpr } from "./parser.js";
|
|
|
9
9
|
import { type Solver } from "./solvers/index.js";
|
|
10
10
|
import { type VerifyOptions, type VerificationReport } from "./solution-validator.js";
|
|
11
11
|
import { type BendersOptions, type BendersResult, type ColumnGenerationOptions, type ColumnGenerationResult } from "../decomposition/index.js";
|
|
12
|
+
/**
|
|
13
|
+
* Returns `true` iff an objective expression is provably integer-valued for any integer-feasible
|
|
14
|
+
* assignment (integer constant, Integer/Binary variables with integer coefficients, and recursive
|
|
15
|
+
* integer nonlinear atoms). Used to strip solver floating-point noise from `objectiveValue`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function isProvablyIntegerExpr(expr: LinExpr | QuadExpr): boolean;
|
|
12
18
|
/**
|
|
13
19
|
* Valid items that can be added as a constraint to a model.
|
|
14
20
|
* Raw mathematical expressions (LinExpr, QuadExpr) without comparisons are strictly prohibited.
|
|
@@ -475,6 +481,7 @@ export declare class Model {
|
|
|
475
481
|
private wrapSolveOptions;
|
|
476
482
|
private hasPrimalFromResult;
|
|
477
483
|
private normalizePrimalValue;
|
|
484
|
+
private normalizeObjectiveValue;
|
|
478
485
|
/**
|
|
479
486
|
* Resolves the target solver and execution options without mutating caller-owned objects,
|
|
480
487
|
* stripping the routing `solver` field from the returned `SolverOptions`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/modeler/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EAEtB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAmB,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAA8B,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE1E,OAAO,EAIL,KAAK,MAAM,EAGZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AAmBjC,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC5B,MAAM,2BAA2B,CAAC;AAEnC;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE5D,MAAM,WAAW,YAAY;IAC3B,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4FAA4F;IAC5F,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,8GAA8G;IAC9G,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B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-Restricted Pages (Inline WASM)
|
|
80
80
|
|
|
81
|
-
- **When `fetch()` is blocked (`connect-src 'none'`)**: Hosted
|
|
82
|
-
- **Dual ESM & Classic `<script>` support**: Each `*-inline.js` file has no `import`/`export` statements, so the exact same file works via ESM `import` and classic `<script src="..."
|
|
81
|
+
- **When `fetch()` is blocked (`connect-src 'none'`)**: Hosted AI sandboxes—including **Claude.ai Artifacts** (edit and published links), **ChatGPT inline visualizations**, and **Codex inline visualizations**—allow CDN scripts (`script-src`) while blocking `fetch()` via `connect-src` and blocking Web Workers via `worker-src`. Load the self-registering inline WASM packs (`solvers/highs-inline.js` / `@ohtaman/washi/browser/solvers/highs-inline` and `solvers/pumpkin-inline.js` / `@ohtaman/washi/browser/solvers/pumpkin-inline`) **before** your first `solve()`, `check()`, or `warmup*()` call—zero base64 or binary-setter boilerplate is required.
|
|
82
|
+
- **Dual ESM & Classic `<script>` support (prefer ESM)**: Each `*-inline.js` file has no `import`/`export` statements, so the exact same file works via ESM `import` and classic `<script src="...">`, and default loaders (`washi.js`, `washi.min.js`, `dist/lib/*`) never reference it. Prefer **ESM (`<script type="module">`)** in dynamically injected sandboxes (such as ChatGPT inline visualizations), where classic `<script src>` tags can race with inline scripts on cold loads.
|
|
83
83
|
- **Initialization semantics**: Load the inline pack **before** the first solver initialization (`solve()`, `check()`, or `warmup*()`). Before first initialization, load order between core (`washi.js` / `washi.min.js`) and `*-inline.js` does not matter. Once a solver's default WASM source is selected on first initialization, WaSHI latches it and does not switch on late pack loads (keeping main-thread and Worker behavior consistent). Explicit `set*WasmUrl()` / `{ wasmUrl }` still override the embedded pack when provided.
|
|
84
|
-
- **Worker behavior**:
|
|
84
|
+
- **Worker behavior & `useWorker: false` trade-offs**: WaSHI keeps `useWorker: true` as the default on `http(s):` origins (including regular web apps, Gemini Canvas, and Google Sites, where `*-inline.js` transfers embedded bytes via `postMessage` without calling `fetch()`). In Worker-restricted sandboxes (Claude Artifacts, ChatGPT/Codex inline visualizations, or `file://`), pass `{ useWorker: false }` along with a `timeLimit` (main-thread execution blocks UI rendering, prevents immediate mid-solve `AbortSignal` interruption and live `onProgress` repaints, and lacks Worker crash isolation). Embedded previews whose CSP omits `'wasm-unsafe-eval'` (such as Antigravity's HTML artifact preview) cannot compile WebAssembly; open exported HTML in Chrome/Safari or via a local server.
|
|
85
85
|
|
|
86
86
|
```html
|
|
87
|
-
<!-- ESM (
|
|
87
|
+
<!-- Recommended: ESM (<script type="module">) + { useWorker: false } -->
|
|
88
|
+
<!-- Works across Claude Artifacts, ChatGPT/Codex inline visualizations, Gemini Canvas, Google Sites & file:// -->
|
|
88
89
|
<script type="module">
|
|
89
90
|
import { Model, expr, maximize } from "https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/washi.js";
|
|
90
91
|
import "https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/solvers/highs-inline.js";
|
|
@@ -94,10 +95,10 @@ Classic `<script>` tags load immediately invoked function expression (`IIFE`) bu
|
|
|
94
95
|
const x = m.integer("x", { lb: 0 });
|
|
95
96
|
m.objective(maximize(x));
|
|
96
97
|
m.constraint(expr`${x} <= 10`, "cap");
|
|
97
|
-
await m.solve(); //
|
|
98
|
+
await m.solve({ useWorker: false, timeLimit: 5 }); // Omit useWorker: false where Workers are allowed (e.g. Gemini Canvas, self-hosted)
|
|
98
99
|
</script>
|
|
99
100
|
|
|
100
|
-
<!-- Classic <script> (
|
|
101
|
+
<!-- Classic <script> fallback (prefer ESM above in dynamically injected sandboxes) -->
|
|
101
102
|
<script src="https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/washi.min.js"></script>
|
|
102
103
|
<script src="https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/solvers/highs-inline.js"></script>
|
|
103
104
|
<script>
|
|
@@ -107,12 +108,12 @@ Classic `<script>` tags load immediately invoked function expression (`IIFE`) bu
|
|
|
107
108
|
const x = m.integer("x", { lb: 0 });
|
|
108
109
|
m.objective(maximize(x));
|
|
109
110
|
m.constraint(expr`${x} <= 10`, "cap");
|
|
110
|
-
await m.solve({ useWorker: false });
|
|
111
|
+
await m.solve({ useWorker: false, timeLimit: 5 });
|
|
111
112
|
})();
|
|
112
113
|
</script>
|
|
113
114
|
```
|
|
114
115
|
|
|
115
|
-
> **Single-file offline HTML (`file://` with npm packages)**: Use the CDN `*-inline.js` packs above for zero-build hosted CSP sandboxes (`connect-src 'none'
|
|
116
|
+
> **Single-file offline HTML (`file://` with npm packages)**: Use the CDN `*-inline.js` packs above for zero-build hosted CSP sandboxes (`connect-src 'none'`). When building a zero-network, double-clickable offline `file://` HTML app that bundles `@ohtaman/washi` (HiGHS / Pumpkin) together with third-party npm packages (React, KaTeX, Chart.js, Tailwind) via Vite + `vite-plugin-singlefile` and gzipped WASM, follow [`skills/washi/references/single-html.md`](https://github.com/ohtaman/washi/blob/main/skills/washi/references/single-html.md) (included inside the unified `washi` skill at `node_modules/@ohtaman/washi/skills/washi/references/single-html.md`).
|
|
116
117
|
|
|
117
118
|
#### Browser Security & Cross-Origin Isolation
|
|
118
119
|
|
|
@@ -29,8 +29,9 @@ Choose the integration method that matches your tool:
|
|
|
29
29
|
| **Agent Skill** *(Recommended)* | Claude Code, Cursor, Codex, Antigravity, Gemini CLI | Run `npx skills add ohtaman/washi` |
|
|
30
30
|
| **IDE `@Docs` Index** | Cursor, Windsurf | Add `https://washi.ohtaman.dev/llms.txt` or `https://washi.ohtaman.dev/llms-full.txt` |
|
|
31
31
|
| **Context7 MCP** | MCP-enabled agents | Reference library ID `/ohtaman/washi` |
|
|
32
|
+
| **Web Chat Knowledge** | Claude.ai (Projects), ChatGPT (Custom GPTs), Gemini (Gems) | Attach `skills/washi/SKILL.md` (some Web previews such as Gemini Canvas cannot fetch `llms.txt` directly) |
|
|
32
33
|
|
|
33
|
-
Installing the Agent Skill places `SKILL.md` into your agent's skills directory. It teaches your agent solver selection, `expr` modeling, and debugging with `m.toLpString()`, `m.verify()`, and `m.check()`.
|
|
34
|
+
Installing the unified `washi` Agent Skill places `SKILL.md` and `references/single-html.md` into your agent's skills directory. It teaches your agent solver selection, `expr` modeling, offline single-file HTML packaging, and debugging with `m.toLpString()`, `m.verify()`, and `m.check()`.
|
|
34
35
|
|
|
35
36
|
---
|
|
36
37
|
|
|
@@ -126,11 +127,31 @@ Include a sample test case with contradictory named rules, print res.status and
|
|
|
126
127
|
|
|
127
128
|
---
|
|
128
129
|
|
|
129
|
-
## 4. Packaging & Deployment Prompts (
|
|
130
|
+
## 4. Packaging & Deployment Prompts (Single-File HTML, Sharing, Desktop & Mobile)
|
|
130
131
|
|
|
131
|
-
Once a CLI script produces verified results
|
|
132
|
+
Once a CLI script produces verified results—or directly inside an AI HTML preview—you can package the model as a hosted single-file preview, a zero-network offline `.html` file, or a desktop/mobile app.
|
|
132
133
|
|
|
133
|
-
###
|
|
134
|
+
### Hosted AI Previews & Instant URL Sharing (`*-inline.js` + ESM)
|
|
135
|
+
|
|
136
|
+
Use WaSHI's self-registering inline WASM packs (`solvers/highs-inline.js` and `solvers/pumpkin-inline.js`) via **ESM (`<script type="module">`)** with `{ useWorker: false, timeLimit: 5 }`. This single pattern avoids both `connect-src 'none'` `.wasm` `fetch()` blocks and `worker-src` Worker blocks across **Claude.ai Artifacts**, **ChatGPT / Codex inline visualizations**, **Gemini Canvas**, and **Google Sites**:
|
|
137
|
+
|
|
138
|
+
```text
|
|
139
|
+
Create a self-contained single-file HTML optimization app using @ohtaman/washi via ESM (<script type="module">) and inline WASM packs so it runs with zero .wasm fetch() calls inside hosted AI sandboxes:
|
|
140
|
+
- Import Model, expr, maximize from "https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/washi.js".
|
|
141
|
+
- Import side-effect packs "https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/solvers/highs-inline.js" and "https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/solvers/pumpkin-inline.js" before solving.
|
|
142
|
+
- Pass { useWorker: false, timeLimit: 5 } in m.solve(...) and m.check(...), and verify every feasible solve with m.verify().
|
|
143
|
+
- Include interactive sliders/inputs, optimal results, and conflict diagnosis via await m.check({ solver: "pumpkin", useWorker: false }) when infeasible.
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Verified sharing workflows by platform**:
|
|
147
|
+
- **Claude.ai Artifacts**: Verified on both edit views and **Publish / Share** links (`*-inline.js` + `{ useWorker: false }` required); share the published URL directly or download the `.html` file.
|
|
148
|
+
- **Gemini Canvas**: Verified with both `useWorker: false` and default `useWorker: true`; click **Publish to Google Sites** for an instant shareable URL, or copy the HTML code.
|
|
149
|
+
- **ChatGPT & Codex**: Verified in inline visualizations (`*-inline.js` + `{ useWorker: false }` required; prefer ESM `<script type="module">` over classic `<script>` to avoid dynamic-injection load races); export or copy the `.html` file to share directly or deploy to static hosting.
|
|
150
|
+
- **Antigravity**: The built-in HTML artifact preview omits `'wasm-unsafe-eval'` from its CSP (so WebAssembly cannot compile inside the preview pane); preview via a local server in the built-in browser or open the exported `.html` in Chrome/Safari.
|
|
151
|
+
|
|
152
|
+
### Zero-Server Single-File `.html` Tool (`file://` Double-Click & Zero-Network Offline)
|
|
153
|
+
|
|
154
|
+
For a lightweight CDN-backed `.html` file that opens by double-clicking (`file://`):
|
|
134
155
|
|
|
135
156
|
```text
|
|
136
157
|
Package this @ohtaman/washi optimization model into a standalone .html file with inline HTML, CSS, and JavaScript so team members can open it directly by double-clicking (file://).
|
|
@@ -139,7 +160,19 @@ Package this @ohtaman/washi optimization model into a standalone .html file with
|
|
|
139
160
|
- Verify every feasible solve with m.verify().
|
|
140
161
|
```
|
|
141
162
|
|
|
142
|
-
|
|
163
|
+
For a **zero-network, completely offline** single-file `.html` bundling `@ohtaman/washi` together with third-party npm packages (React, Chart.js, KaTeX, Tailwind) so colleagues can double-click it via email or Slack even in air-gapped environments:
|
|
164
|
+
|
|
165
|
+
```text
|
|
166
|
+
Read skills/washi/references/single-html.md (or node_modules/@ohtaman/washi/skills/washi/references/single-html.md) and package this @ohtaman/washi app as a zero-network single-file dist/index.html using Vite + vite-plugin-singlefile + gzipped WASM.
|
|
167
|
+
- Bundle only the required solvers (HiGHS and/or Pumpkin), pass { useWorker: false, timeLimit: 5 }, and assert m.verify().valid === true.
|
|
168
|
+
- Verify that dist/index.html runs over file:// in headless Chromium with zero external HTTP requests and zero console errors.
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**`file://` & `useWorker` runtime notes**: Loading `washi.min.js` from an HTTPS CDN runs directly on `file://`—under `window.origin === "null"`, WaSHI automatically falls back to main-thread execution. Self-hosted `.wasm` files require `http://` or `https://`, and browser Z3 requires Cross-Origin Isolation; see [Runtime Environments](./runtimes.md) and [Cross-Origin Isolation](./cross-origin.md).
|
|
172
|
+
|
|
173
|
+
> [!TIP]
|
|
174
|
+
> **When to keep `useWorker: true` (default) vs. `{ useWorker: false }`**:
|
|
175
|
+
> Keep default `useWorker: true` on normal `http(s):` web apps, Gemini Canvas, and Google Sites so solving never freezes the UI, supports immediate `AbortSignal` termination, repaints `onProgress` live, and isolates crashes. Use `{ useWorker: false }` (alongside a `timeLimit` guardrail) only in Worker-restricted sandboxes (Claude Artifacts, ChatGPT/Codex inline visualizations) and offline `file://` builds.
|
|
143
176
|
|
|
144
177
|
### Offline Desktop & Mobile Apps (Vite + Tauri / Capacitor / PWA)
|
|
145
178
|
|
|
@@ -254,7 +254,7 @@ On standard `http://` and `https://` origins, browsers block direct `new Worker(
|
|
|
254
254
|
| **CDN scripts** | Loading `washi.min.js` from an HTTPS CDN includes both HiGHS and Pumpkin and works by double-clicking a local `.html` file (`file://`) with no local server. |
|
|
255
255
|
| **Opaque origins (`window.origin === "null"`)** | On `file://` pages or sandboxed `<iframe>` embeds without `allow-same-origin`, WaSHI runs HiGHS and Pumpkin on the main thread when `useWorker` is omitted. |
|
|
256
256
|
| **Self-hosted `.wasm` & Z3** | Local `.wasm` files require `http://` or `https://` because browsers block `fetch()` on `file://`. Z3 also requires Cross-Origin Isolation (see below). |
|
|
257
|
-
| **Offline single-file HTML + npm libs
|
|
257
|
+
| **Offline single-file HTML + npm libs** | To bundle `@ohtaman/washi` (HiGHS & Pumpkin) alongside third-party npm packages into one zero-network `index.html` for `file://`, follow [`skills/washi/references/single-html.md`](https://github.com/ohtaman/washi/blob/main/skills/washi/references/single-html.md) inside the `washi` Agent Skill. |
|
|
258
258
|
|
|
259
259
|
---
|
|
260
260
|
|
|
@@ -284,12 +284,12 @@ Copy `node_modules/@ohtaman/washi/dist/browser/` to your static origin as a comp
|
|
|
284
284
|
|
|
285
285
|
### 3. CSP-Restricted Pages Without `fetch()` (`connect-src 'none'`) {#csp-fetch-free}
|
|
286
286
|
|
|
287
|
-
|
|
287
|
+
Hosted AI sandboxes—such as **Claude.ai Artifacts** (both edit views and published share links), **ChatGPT inline visualizations**, and **Codex inline visualizations**—allow scripts from CDNs (`script-src`) while blocking `.wasm` `fetch()` (`connect-src 'none'`) and blocking Web Workers (`worker-src`). In these environments, default HiGHS and Pumpkin initialization fails because they fetch `.wasm` files.
|
|
288
288
|
|
|
289
289
|
Load the self-registering inline WASM packs (`solvers/highs-inline.js` / `@ohtaman/washi/browser/solvers/highs-inline` and `solvers/pumpkin-inline.js` / `@ohtaman/washi/browser/solvers/pumpkin-inline`) **before** your first `solve()`, `check()`, or `warmup*()` call—no manual base64 decoding or binary setter calls are required. Each inline pack contains no `import` or `export` statements, so the exact same file works in both ESM and classic `<script>` mode, and default loaders never reference it:
|
|
290
290
|
|
|
291
291
|
```html
|
|
292
|
-
<!-- Option A: ESM (<script type="module">) -->
|
|
292
|
+
<!-- Option A (Recommended): ESM (<script type="module">) + { useWorker: false } -->
|
|
293
293
|
<script type="module">
|
|
294
294
|
import { Model, expr, maximize } from "https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/washi.js";
|
|
295
295
|
import "https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/solvers/highs-inline.js";
|
|
@@ -301,10 +301,10 @@ Load the self-registering inline WASM packs (`solvers/highs-inline.js` / `@ohtam
|
|
|
301
301
|
m.objective(maximize(expr`30 * ${x} + 50 * ${y}`));
|
|
302
302
|
m.constraint(expr`${x} + 2 * ${y} <= 40`);
|
|
303
303
|
m.constraint(expr`2 * ${x} + ${y} <= 50`);
|
|
304
|
-
await m.solve(); // Works
|
|
304
|
+
await m.solve({ useWorker: false, timeLimit: 5 }); // Works across all supported AI sandboxes
|
|
305
305
|
</script>
|
|
306
306
|
|
|
307
|
-
<!-- Option B: Classic <script> (
|
|
307
|
+
<!-- Option B: Classic <script> (prefer Option A in dynamically injected sandboxes) -->
|
|
308
308
|
<script src="https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/washi.min.js"></script>
|
|
309
309
|
<script src="https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/solvers/highs-inline.js"></script>
|
|
310
310
|
<script src="https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/solvers/pumpkin-inline.js"></script>
|
|
@@ -317,15 +317,32 @@ Load the self-registering inline WASM packs (`solvers/highs-inline.js` / `@ohtam
|
|
|
317
317
|
m.objective(maximize(expr`30 * ${x} + 50 * ${y}`));
|
|
318
318
|
m.constraint(expr`${x} + 2 * ${y} <= 40`);
|
|
319
319
|
m.constraint(expr`2 * ${x} + ${y} <= 50`);
|
|
320
|
-
await m.solve({ useWorker: false }); // Zero fetch(), zero Blob URLs, zero Workers
|
|
320
|
+
await m.solve({ useWorker: false, timeLimit: 5 }); // Zero fetch(), zero Blob URLs, zero Workers
|
|
321
321
|
})();
|
|
322
322
|
</script>
|
|
323
323
|
```
|
|
324
324
|
|
|
325
|
+
#### Hosted AI Sandbox Compatibility (Empirically Verified)
|
|
326
|
+
|
|
327
|
+
| Environment | `fetch(.wasm)` | `*-inline.js` + `{ useWorker: false }` | `useWorker: true` | Recommended Setup |
|
|
328
|
+
| --- | :---: | :---: | :---: | --- |
|
|
329
|
+
| **Claude.ai Artifacts** *(edit & published links)* | Blocked | Works *(ESM & Classic)* | Blocked | Option A (ESM + `*-inline.js` + `{ useWorker: false }`) |
|
|
330
|
+
| **ChatGPT Inline Visualization** *(`codex-inline-visualization-*`)* | Blocked | Works *(ESM reliable; Classic can race on cold load)* | Blocked | Option A (ESM + `*-inline.js` + `{ useWorker: false }`) |
|
|
331
|
+
| **Codex Inline Visualization** *(`codex-sandbox://...`)* | Blocked | Works *(ESM & Classic)* | Blocked | Option A (ESM + `*-inline.js` + `{ useWorker: false }`) |
|
|
332
|
+
| **Gemini Canvas & Google Sites** *(1-click publish)* | Works | Works *(ESM & Classic)* | Works | Option A works everywhere; default `useWorker: true` also works |
|
|
333
|
+
| **Antigravity HTML Artifact Preview** | Blocked *(CDN blocked)* | Blocked *(CSP omits `'wasm-unsafe-eval'`)* | Blocked | Preview via local server + built-in browser or open `.html` in Chrome/Safari |
|
|
334
|
+
| **Local Browser `file://`** *(Chrome / Safari)* | Works via HTTPS CDN | Works *(CDN or Vite offline bundle)* | Auto main-thread | CDN Option A or offline [`skills/washi/references/single-html.md`](https://github.com/ohtaman/washi/blob/main/skills/washi/references/single-html.md) |
|
|
335
|
+
|
|
336
|
+
- **Why prefer Option A (ESM) over Option B (Classic `<script>`)**: Sandboxes that dynamically inject HTML into the DOM (such as ChatGPT inline visualizations) may evaluate inline classic `<script>` blocks before external `<script src>` downloads complete or after `window` `load` has already fired. ESM `<script type="module">` `import` statements strictly wait for all dependencies before executing.
|
|
325
337
|
- **Initialization semantics**: Load `*-inline.js` before the first solver initialization (`solve()`, `check()`, or `warmup*()`). Load order between core (`washi.js` / `washi.min.js`) and `*-inline.js` does not matter before first initialization. Once a solver's default WASM source is selected on first initialization, WaSHI latches it and ignores late pack registration so main-thread and Worker behavior stay consistent.
|
|
326
338
|
- **Web Worker mode**: When `useWorker: true`, WaSHI transfers the embedded bytes once per Worker instance via `postMessage` so Worker startup does not call `fetch()`. If `worker-src` blocks `blob:` or Workers, pass `{ useWorker: false }`.
|
|
327
339
|
- **GLPK & Z3**: **GLPK** (`solvers/glpk.js`) already embeds its WASM inline without `fetch()`. **Z3** requires `SharedArrayBuffer` and Cross-Origin Isolation headers (below).
|
|
328
340
|
|
|
341
|
+
> [!TIP]
|
|
342
|
+
> **Choosing Between `useWorker: true` and `useWorker: false`**:
|
|
343
|
+
> - **Use `useWorker: true` (default on standard `http(s):` origins)** for regular web apps, Vite/Next.js bundles, Gemini Canvas, and Google Sites. Running in a Web Worker keeps the browser UI responsive, allows immediate `AbortSignal` worker termination, supports live `onProgress` UI repaints, and isolates solver crashes.
|
|
344
|
+
> - **Use `{ useWorker: false }`** only where Web Workers are disallowed (Claude.ai Artifacts, ChatGPT/Codex inline visualizations, or `file://` pages). Main-thread solving blocks UI painting and user clicks while running, prevents mid-solve `AbortSignal` interruption and live progress updates, and shares the UI thread on crash—so always pass a sensible `timeLimit` (for example, `timeLimit: 5`) and yield a frame before showing a loading spinner.
|
|
345
|
+
|
|
329
346
|
### 4. Enable Cross-Origin Isolation (Z3 Only)
|
|
330
347
|
|
|
331
348
|
HiGHS, Pumpkin, and GLPK run in standard browser contexts without isolation headers. Z3 uses `SharedArrayBuffer` multithreading, so browsers require a **Secure Context** (`https://` or `http://localhost`). You must also serve `Cross-Origin-Opener-Policy` and `Cross-Origin-Embedder-Policy` headers (`COOP`/`COEP`); see the [Cross-Origin Isolation Guide](./cross-origin.md).
|
package/llms-full.txt
CHANGED
|
@@ -78,13 +78,14 @@ Classic `<script>` tags load immediately invoked function expression (`IIFE`) bu
|
|
|
78
78
|
|
|
79
79
|
#### Fetch-Free Loading in CSP-Restricted Pages (Inline WASM)
|
|
80
80
|
|
|
81
|
-
- **When `fetch()` is blocked (`connect-src 'none'`)**: Hosted
|
|
82
|
-
- **Dual ESM & Classic `<script>` support**: Each `*-inline.js` file has no `import`/`export` statements, so the exact same file works via ESM `import` and classic `<script src="..."
|
|
81
|
+
- **When `fetch()` is blocked (`connect-src 'none'`)**: Hosted AI sandboxes—including **Claude.ai Artifacts** (edit and published links), **ChatGPT inline visualizations**, and **Codex inline visualizations**—allow CDN scripts (`script-src`) while blocking `fetch()` via `connect-src` and blocking Web Workers via `worker-src`. Load the self-registering inline WASM packs (`solvers/highs-inline.js` / `@ohtaman/washi/browser/solvers/highs-inline` and `solvers/pumpkin-inline.js` / `@ohtaman/washi/browser/solvers/pumpkin-inline`) **before** your first `solve()`, `check()`, or `warmup*()` call—zero base64 or binary-setter boilerplate is required.
|
|
82
|
+
- **Dual ESM & Classic `<script>` support (prefer ESM)**: Each `*-inline.js` file has no `import`/`export` statements, so the exact same file works via ESM `import` and classic `<script src="...">`, and default loaders (`washi.js`, `washi.min.js`, `dist/lib/*`) never reference it. Prefer **ESM (`<script type="module">`)** in dynamically injected sandboxes (such as ChatGPT inline visualizations), where classic `<script src>` tags can race with inline scripts on cold loads.
|
|
83
83
|
- **Initialization semantics**: Load the inline pack **before** the first solver initialization (`solve()`, `check()`, or `warmup*()`). Before first initialization, load order between core (`washi.js` / `washi.min.js`) and `*-inline.js` does not matter. Once a solver's default WASM source is selected on first initialization, WaSHI latches it and does not switch on late pack loads (keeping main-thread and Worker behavior consistent). Explicit `set*WasmUrl()` / `{ wasmUrl }` still override the embedded pack when provided.
|
|
84
|
-
- **Worker behavior**:
|
|
84
|
+
- **Worker behavior & `useWorker: false` trade-offs**: WaSHI keeps `useWorker: true` as the default on `http(s):` origins (including regular web apps, Gemini Canvas, and Google Sites, where `*-inline.js` transfers embedded bytes via `postMessage` without calling `fetch()`). In Worker-restricted sandboxes (Claude Artifacts, ChatGPT/Codex inline visualizations, or `file://`), pass `{ useWorker: false }` along with a `timeLimit` (main-thread execution blocks UI rendering, prevents immediate mid-solve `AbortSignal` interruption and live `onProgress` repaints, and lacks Worker crash isolation). Embedded previews whose CSP omits `'wasm-unsafe-eval'` (such as Antigravity's HTML artifact preview) cannot compile WebAssembly; open exported HTML in Chrome/Safari or via a local server.
|
|
85
85
|
|
|
86
86
|
```html
|
|
87
|
-
<!-- ESM (
|
|
87
|
+
<!-- Recommended: ESM (<script type="module">) + { useWorker: false } -->
|
|
88
|
+
<!-- Works across Claude Artifacts, ChatGPT/Codex inline visualizations, Gemini Canvas, Google Sites & file:// -->
|
|
88
89
|
<script type="module">
|
|
89
90
|
import { Model, expr, maximize } from "https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/washi.js";
|
|
90
91
|
import "https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/solvers/highs-inline.js";
|
|
@@ -94,10 +95,10 @@ Classic `<script>` tags load immediately invoked function expression (`IIFE`) bu
|
|
|
94
95
|
const x = m.integer("x", { lb: 0 });
|
|
95
96
|
m.objective(maximize(x));
|
|
96
97
|
m.constraint(expr`${x} <= 10`, "cap");
|
|
97
|
-
await m.solve(); //
|
|
98
|
+
await m.solve({ useWorker: false, timeLimit: 5 }); // Omit useWorker: false where Workers are allowed (e.g. Gemini Canvas, self-hosted)
|
|
98
99
|
</script>
|
|
99
100
|
|
|
100
|
-
<!-- Classic <script> (
|
|
101
|
+
<!-- Classic <script> fallback (prefer ESM above in dynamically injected sandboxes) -->
|
|
101
102
|
<script src="https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/washi.min.js"></script>
|
|
102
103
|
<script src="https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/solvers/highs-inline.js"></script>
|
|
103
104
|
<script>
|
|
@@ -107,12 +108,12 @@ Classic `<script>` tags load immediately invoked function expression (`IIFE`) bu
|
|
|
107
108
|
const x = m.integer("x", { lb: 0 });
|
|
108
109
|
m.objective(maximize(x));
|
|
109
110
|
m.constraint(expr`${x} <= 10`, "cap");
|
|
110
|
-
await m.solve({ useWorker: false });
|
|
111
|
+
await m.solve({ useWorker: false, timeLimit: 5 });
|
|
111
112
|
})();
|
|
112
113
|
</script>
|
|
113
114
|
```
|
|
114
115
|
|
|
115
|
-
> **Single-file offline HTML (`file://` with npm packages)**: Use the CDN `*-inline.js` packs above for zero-build hosted CSP sandboxes (`connect-src 'none'
|
|
116
|
+
> **Single-file offline HTML (`file://` with npm packages)**: Use the CDN `*-inline.js` packs above for zero-build hosted CSP sandboxes (`connect-src 'none'`). When building a zero-network, double-clickable offline `file://` HTML app that bundles `@ohtaman/washi` (HiGHS / Pumpkin) together with third-party npm packages (React, KaTeX, Chart.js, Tailwind) via Vite + `vite-plugin-singlefile` and gzipped WASM, follow [`skills/washi/references/single-html.md`](https://github.com/ohtaman/washi/blob/main/skills/washi/references/single-html.md) (included inside the unified `washi` skill at `node_modules/@ohtaman/washi/skills/washi/references/single-html.md`).
|
|
116
117
|
|
|
117
118
|
#### Browser Security & Cross-Origin Isolation
|
|
118
119
|
|
|
@@ -793,7 +794,7 @@ On standard `http://` and `https://` origins, browsers block direct `new Worker(
|
|
|
793
794
|
| **CDN scripts** | Loading `washi.min.js` from an HTTPS CDN includes both HiGHS and Pumpkin and works by double-clicking a local `.html` file (`file://`) with no local server. |
|
|
794
795
|
| **Opaque origins (`window.origin === "null"`)** | On `file://` pages or sandboxed `<iframe>` embeds without `allow-same-origin`, WaSHI runs HiGHS and Pumpkin on the main thread when `useWorker` is omitted. |
|
|
795
796
|
| **Self-hosted `.wasm` & Z3** | Local `.wasm` files require `http://` or `https://` because browsers block `fetch()` on `file://`. Z3 also requires Cross-Origin Isolation (see below). |
|
|
796
|
-
| **Offline single-file HTML + npm libs
|
|
797
|
+
| **Offline single-file HTML + npm libs** | To bundle `@ohtaman/washi` (HiGHS & Pumpkin) alongside third-party npm packages into one zero-network `index.html` for `file://`, follow [`skills/washi/references/single-html.md`](https://github.com/ohtaman/washi/blob/main/skills/washi/references/single-html.md) inside the `washi` Agent Skill. |
|
|
797
798
|
|
|
798
799
|
---
|
|
799
800
|
|
|
@@ -823,12 +824,12 @@ Copy `node_modules/@ohtaman/washi/dist/browser/` to your static origin as a comp
|
|
|
823
824
|
|
|
824
825
|
### 3. CSP-Restricted Pages Without `fetch()` (`connect-src 'none'`) {#csp-fetch-free}
|
|
825
826
|
|
|
826
|
-
|
|
827
|
+
Hosted AI sandboxes—such as **Claude.ai Artifacts** (both edit views and published share links), **ChatGPT inline visualizations**, and **Codex inline visualizations**—allow scripts from CDNs (`script-src`) while blocking `.wasm` `fetch()` (`connect-src 'none'`) and blocking Web Workers (`worker-src`). In these environments, default HiGHS and Pumpkin initialization fails because they fetch `.wasm` files.
|
|
827
828
|
|
|
828
829
|
Load the self-registering inline WASM packs (`solvers/highs-inline.js` / `@ohtaman/washi/browser/solvers/highs-inline` and `solvers/pumpkin-inline.js` / `@ohtaman/washi/browser/solvers/pumpkin-inline`) **before** your first `solve()`, `check()`, or `warmup*()` call—no manual base64 decoding or binary setter calls are required. Each inline pack contains no `import` or `export` statements, so the exact same file works in both ESM and classic `<script>` mode, and default loaders never reference it:
|
|
829
830
|
|
|
830
831
|
```html
|
|
831
|
-
<!-- Option A: ESM (<script type="module">) -->
|
|
832
|
+
<!-- Option A (Recommended): ESM (<script type="module">) + { useWorker: false } -->
|
|
832
833
|
<script type="module">
|
|
833
834
|
import { Model, expr, maximize } from "https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/washi.js";
|
|
834
835
|
import "https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/solvers/highs-inline.js";
|
|
@@ -840,10 +841,10 @@ Load the self-registering inline WASM packs (`solvers/highs-inline.js` / `@ohtam
|
|
|
840
841
|
m.objective(maximize(expr`30 * ${x} + 50 * ${y}`));
|
|
841
842
|
m.constraint(expr`${x} + 2 * ${y} <= 40`);
|
|
842
843
|
m.constraint(expr`2 * ${x} + ${y} <= 50`);
|
|
843
|
-
await m.solve(); // Works
|
|
844
|
+
await m.solve({ useWorker: false, timeLimit: 5 }); // Works across all supported AI sandboxes
|
|
844
845
|
</script>
|
|
845
846
|
|
|
846
|
-
<!-- Option B: Classic <script> (
|
|
847
|
+
<!-- Option B: Classic <script> (prefer Option A in dynamically injected sandboxes) -->
|
|
847
848
|
<script src="https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/washi.min.js"></script>
|
|
848
849
|
<script src="https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/solvers/highs-inline.js"></script>
|
|
849
850
|
<script src="https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/solvers/pumpkin-inline.js"></script>
|
|
@@ -856,15 +857,32 @@ Load the self-registering inline WASM packs (`solvers/highs-inline.js` / `@ohtam
|
|
|
856
857
|
m.objective(maximize(expr`30 * ${x} + 50 * ${y}`));
|
|
857
858
|
m.constraint(expr`${x} + 2 * ${y} <= 40`);
|
|
858
859
|
m.constraint(expr`2 * ${x} + ${y} <= 50`);
|
|
859
|
-
await m.solve({ useWorker: false }); // Zero fetch(), zero Blob URLs, zero Workers
|
|
860
|
+
await m.solve({ useWorker: false, timeLimit: 5 }); // Zero fetch(), zero Blob URLs, zero Workers
|
|
860
861
|
})();
|
|
861
862
|
</script>
|
|
862
863
|
```
|
|
863
864
|
|
|
865
|
+
#### Hosted AI Sandbox Compatibility (Empirically Verified)
|
|
866
|
+
|
|
867
|
+
| Environment | `fetch(.wasm)` | `*-inline.js` + `{ useWorker: false }` | `useWorker: true` | Recommended Setup |
|
|
868
|
+
| --- | :---: | :---: | :---: | --- |
|
|
869
|
+
| **Claude.ai Artifacts** *(edit & published links)* | Blocked | Works *(ESM & Classic)* | Blocked | Option A (ESM + `*-inline.js` + `{ useWorker: false }`) |
|
|
870
|
+
| **ChatGPT Inline Visualization** *(`codex-inline-visualization-*`)* | Blocked | Works *(ESM reliable; Classic can race on cold load)* | Blocked | Option A (ESM + `*-inline.js` + `{ useWorker: false }`) |
|
|
871
|
+
| **Codex Inline Visualization** *(`codex-sandbox://...`)* | Blocked | Works *(ESM & Classic)* | Blocked | Option A (ESM + `*-inline.js` + `{ useWorker: false }`) |
|
|
872
|
+
| **Gemini Canvas & Google Sites** *(1-click publish)* | Works | Works *(ESM & Classic)* | Works | Option A works everywhere; default `useWorker: true` also works |
|
|
873
|
+
| **Antigravity HTML Artifact Preview** | Blocked *(CDN blocked)* | Blocked *(CSP omits `'wasm-unsafe-eval'`)* | Blocked | Preview via local server + built-in browser or open `.html` in Chrome/Safari |
|
|
874
|
+
| **Local Browser `file://`** *(Chrome / Safari)* | Works via HTTPS CDN | Works *(CDN or Vite offline bundle)* | Auto main-thread | CDN Option A or offline [`skills/washi/references/single-html.md`](https://github.com/ohtaman/washi/blob/main/skills/washi/references/single-html.md) |
|
|
875
|
+
|
|
876
|
+
- **Why prefer Option A (ESM) over Option B (Classic `<script>`)**: Sandboxes that dynamically inject HTML into the DOM (such as ChatGPT inline visualizations) may evaluate inline classic `<script>` blocks before external `<script src>` downloads complete or after `window` `load` has already fired. ESM `<script type="module">` `import` statements strictly wait for all dependencies before executing.
|
|
864
877
|
- **Initialization semantics**: Load `*-inline.js` before the first solver initialization (`solve()`, `check()`, or `warmup*()`). Load order between core (`washi.js` / `washi.min.js`) and `*-inline.js` does not matter before first initialization. Once a solver's default WASM source is selected on first initialization, WaSHI latches it and ignores late pack registration so main-thread and Worker behavior stay consistent.
|
|
865
878
|
- **Web Worker mode**: When `useWorker: true`, WaSHI transfers the embedded bytes once per Worker instance via `postMessage` so Worker startup does not call `fetch()`. If `worker-src` blocks `blob:` or Workers, pass `{ useWorker: false }`.
|
|
866
879
|
- **GLPK & Z3**: **GLPK** (`solvers/glpk.js`) already embeds its WASM inline without `fetch()`. **Z3** requires `SharedArrayBuffer` and Cross-Origin Isolation headers (below).
|
|
867
880
|
|
|
881
|
+
> [!TIP]
|
|
882
|
+
> **Choosing Between `useWorker: true` and `useWorker: false`**:
|
|
883
|
+
> - **Use `useWorker: true` (default on standard `http(s):` origins)** for regular web apps, Vite/Next.js bundles, Gemini Canvas, and Google Sites. Running in a Web Worker keeps the browser UI responsive, allows immediate `AbortSignal` worker termination, supports live `onProgress` UI repaints, and isolates solver crashes.
|
|
884
|
+
> - **Use `{ useWorker: false }`** only where Web Workers are disallowed (Claude.ai Artifacts, ChatGPT/Codex inline visualizations, or `file://` pages). Main-thread solving blocks UI painting and user clicks while running, prevents mid-solve `AbortSignal` interruption and live progress updates, and shares the UI thread on crash—so always pass a sensible `timeLimit` (for example, `timeLimit: 5`) and yield a frame before showing a loading spinner.
|
|
885
|
+
|
|
868
886
|
### 4. Enable Cross-Origin Isolation (Z3 Only)
|
|
869
887
|
|
|
870
888
|
HiGHS, Pumpkin, and GLPK run in standard browser contexts without isolation headers. Z3 uses `SharedArrayBuffer` multithreading, so browsers require a **Secure Context** (`https://` or `http://localhost`). You must also serve `Cross-Origin-Opener-Policy` and `Cross-Origin-Embedder-Policy` headers (`COOP`/`COEP`); see the [Cross-Origin Isolation Guide](docs/getting-started/cross-origin.md).
|
package/llms.txt
CHANGED
|
@@ -72,13 +72,14 @@ Classic `<script>` tags load immediately invoked function expression (`IIFE`) bu
|
|
|
72
72
|
|
|
73
73
|
#### Fetch-Free Loading in CSP-Restricted Pages (Inline WASM)
|
|
74
74
|
|
|
75
|
-
- **When `fetch()` is blocked (`connect-src 'none'`)**: Hosted
|
|
76
|
-
- **Dual ESM & Classic `<script>` support**: Each `*-inline.js` file has no `import`/`export` statements, so the exact same file works via ESM `import` and classic `<script src="..."
|
|
75
|
+
- **When `fetch()` is blocked (`connect-src 'none'`)**: Hosted AI sandboxes—including **Claude.ai Artifacts** (edit and published links), **ChatGPT inline visualizations**, and **Codex inline visualizations**—allow CDN scripts (`script-src`) while blocking `fetch()` via `connect-src` and blocking Web Workers via `worker-src`. Load the self-registering inline WASM packs (`solvers/highs-inline.js` / `@ohtaman/washi/browser/solvers/highs-inline` and `solvers/pumpkin-inline.js` / `@ohtaman/washi/browser/solvers/pumpkin-inline`) **before** your first `solve()`, `check()`, or `warmup*()` call—zero base64 or binary-setter boilerplate is required.
|
|
76
|
+
- **Dual ESM & Classic `<script>` support (prefer ESM)**: Each `*-inline.js` file has no `import`/`export` statements, so the exact same file works via ESM `import` and classic `<script src="...">`, and default loaders (`washi.js`, `washi.min.js`, `dist/lib/*`) never reference it. Prefer **ESM (`<script type="module">`)** in dynamically injected sandboxes (such as ChatGPT inline visualizations), where classic `<script src>` tags can race with inline scripts on cold loads.
|
|
77
77
|
- **Initialization semantics**: Load the inline pack **before** the first solver initialization (`solve()`, `check()`, or `warmup*()`). Before first initialization, load order between core (`washi.js` / `washi.min.js`) and `*-inline.js` does not matter. Once a solver's default WASM source is selected on first initialization, WaSHI latches it and does not switch on late pack loads (keeping main-thread and Worker behavior consistent). Explicit `set*WasmUrl()` / `{ wasmUrl }` still override the embedded pack when provided.
|
|
78
|
-
- **Worker behavior**:
|
|
78
|
+
- **Worker behavior & `useWorker: false` trade-offs**: WaSHI keeps `useWorker: true` as the default on `http(s):` origins (including regular web apps, Gemini Canvas, and Google Sites, where `*-inline.js` transfers embedded bytes via `postMessage` without calling `fetch()`). In Worker-restricted sandboxes (Claude Artifacts, ChatGPT/Codex inline visualizations, or `file://`), pass `{ useWorker: false }` along with a `timeLimit` (main-thread execution blocks UI rendering, prevents immediate mid-solve `AbortSignal` interruption and live `onProgress` repaints, and lacks Worker crash isolation). Embedded previews whose CSP omits `'wasm-unsafe-eval'` (such as Antigravity's HTML artifact preview) cannot compile WebAssembly; open exported HTML in Chrome/Safari or via a local server.
|
|
79
79
|
|
|
80
80
|
```html
|
|
81
|
-
<!-- ESM (
|
|
81
|
+
<!-- Recommended: ESM (<script type="module">) + { useWorker: false } -->
|
|
82
|
+
<!-- Works across Claude Artifacts, ChatGPT/Codex inline visualizations, Gemini Canvas, Google Sites & file:// -->
|
|
82
83
|
<script type="module">
|
|
83
84
|
import { Model, expr, maximize } from "https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/washi.js";
|
|
84
85
|
import "https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/solvers/highs-inline.js";
|
|
@@ -88,10 +89,10 @@ Classic `<script>` tags load immediately invoked function expression (`IIFE`) bu
|
|
|
88
89
|
const x = m.integer("x", { lb: 0 });
|
|
89
90
|
m.objective(maximize(x));
|
|
90
91
|
m.constraint(expr`${x} <= 10`, "cap");
|
|
91
|
-
await m.solve(); //
|
|
92
|
+
await m.solve({ useWorker: false, timeLimit: 5 }); // Omit useWorker: false where Workers are allowed (e.g. Gemini Canvas, self-hosted)
|
|
92
93
|
</script>
|
|
93
94
|
|
|
94
|
-
<!-- Classic <script> (
|
|
95
|
+
<!-- Classic <script> fallback (prefer ESM above in dynamically injected sandboxes) -->
|
|
95
96
|
<script src="https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/washi.min.js"></script>
|
|
96
97
|
<script src="https://cdn.jsdelivr.net/npm/@ohtaman/washi/dist/browser/solvers/highs-inline.js"></script>
|
|
97
98
|
<script>
|
|
@@ -101,12 +102,12 @@ Classic `<script>` tags load immediately invoked function expression (`IIFE`) bu
|
|
|
101
102
|
const x = m.integer("x", { lb: 0 });
|
|
102
103
|
m.objective(maximize(x));
|
|
103
104
|
m.constraint(expr`${x} <= 10`, "cap");
|
|
104
|
-
await m.solve({ useWorker: false });
|
|
105
|
+
await m.solve({ useWorker: false, timeLimit: 5 });
|
|
105
106
|
})();
|
|
106
107
|
</script>
|
|
107
108
|
```
|
|
108
109
|
|
|
109
|
-
> **Single-file offline HTML (`file://` with npm packages)**: Use the CDN `*-inline.js` packs above for zero-build hosted CSP sandboxes (`connect-src 'none'
|
|
110
|
+
> **Single-file offline HTML (`file://` with npm packages)**: Use the CDN `*-inline.js` packs above for zero-build hosted CSP sandboxes (`connect-src 'none'`). When building a zero-network, double-clickable offline `file://` HTML app that bundles `@ohtaman/washi` (HiGHS / Pumpkin) together with third-party npm packages (React, KaTeX, Chart.js, Tailwind) via Vite + `vite-plugin-singlefile` and gzipped WASM, follow [`skills/washi/references/single-html.md`](https://github.com/ohtaman/washi/blob/main/skills/washi/references/single-html.md) (included inside the unified `washi` skill at `node_modules/@ohtaman/washi/skills/washi/references/single-html.md`).
|
|
110
111
|
|
|
111
112
|
#### Browser Security & Cross-Origin Isolation
|
|
112
113
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ohtaman/washi",
|
|
3
|
-
"version": "0.9.0
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "WaSHI: TypeScript & JavaScript algebraic modeler for Mathematical Optimization & Constraint Programming (LP, MILP, QP, CP, SMT) powered by WebAssembly (HiGHS, Pumpkin, Z3, GLPK)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/lib/washi.js",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"docs/solvers",
|
|
86
86
|
"docs/examples",
|
|
87
87
|
"skills/washi/SKILL.md",
|
|
88
|
-
"skills/washi
|
|
88
|
+
"skills/washi/references/single-html.md",
|
|
89
89
|
"llms.txt",
|
|
90
90
|
"llms-full.txt",
|
|
91
91
|
"README.md",
|