@kent-tokyo/chematic 0.18.0 → 0.19.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.
@@ -593,6 +593,15 @@ export function canonical_tautomer_with_blocked_atoms_json(mol: MolHandle, block
593
593
  */
594
594
  export function cdxml_to_smiles_json(cdxml: string): string;
595
595
 
596
+ /**
597
+ * The `chematic-wasm` crate version (matches the workspace release version).
598
+ *
599
+ * Lets callers (e.g. the browser playground demo) display the running
600
+ * version without hardcoding it — `demo/index.html` previously had a
601
+ * static version string that silently went stale across releases.
602
+ */
603
+ export function chematic_version(): string;
604
+
596
605
  /**
597
606
  * CIP stereo assignments via the accurate hierarchical-digraph engine, as a JSON
598
607
  * array of `{atomIdx, cipCode}` objects -- same shape as [`cip_assignments_json`],
@@ -1349,8 +1358,13 @@ export function minimize_mmff94_lbfgs_json(mol: MolHandle, max_iter: number): st
1349
1358
  * `coords_json` — JSON array of `[x,y,z]` arrays (Å), one per atom.
1350
1359
  * `max_iter` — maximum iterations (0 = default 500).
1351
1360
  *
1352
- * Returns JSON: `{"coords":[[x,y,z],...], "energy":float, "iterations":int, "converged":bool}`
1353
- * or `{"error":"<msg>"}` on failure.
1361
+ * Returns JSON: `{"coords":[[x,y,z],...], "energy":float, "iterations":int, "converged":bool, "sound":bool}`
1362
+ * or `{"error":"<msg>"}` on failure. `sound` is all-finite coordinates and
1363
+ * no bond stretched past a sane covalent-bond length — independent of
1364
+ * `converged`, since steepest descent often reports `converged:false` on
1365
+ * geometries that are perfectly fine but simply haven't hit the tight
1366
+ * RMS-gradient threshold yet. Check `sound`, not just `converged`, before
1367
+ * trusting a result.
1354
1368
  */
1355
1369
  export function minimize_uff_json(smiles: string, coords_json: string, max_iter: number): string;
1356
1370
 
@@ -2480,6 +2494,7 @@ export interface InitOutput {
2480
2494
  readonly canonical_tautomer: (a: number) => number;
2481
2495
  readonly canonical_tautomer_with_blocked_atoms_json: (a: number, b: number, c: number) => [number, number];
2482
2496
  readonly cdxml_to_smiles_json: (a: number, b: number) => [number, number, number, number];
2497
+ readonly chematic_version: () => [number, number];
2483
2498
  readonly cip_assignments_accurate_json: (a: number) => [number, number];
2484
2499
  readonly cip_assignments_json: (a: number) => [number, number];
2485
2500
  readonly cip_unresolved_json: (a: number) => [number, number];
package/chematic_wasm.js CHANGED
@@ -1398,6 +1398,27 @@ export function cdxml_to_smiles_json(cdxml) {
1398
1398
  }
1399
1399
  }
1400
1400
 
1401
+ /**
1402
+ * The `chematic-wasm` crate version (matches the workspace release version).
1403
+ *
1404
+ * Lets callers (e.g. the browser playground demo) display the running
1405
+ * version without hardcoding it — `demo/index.html` previously had a
1406
+ * static version string that silently went stale across releases.
1407
+ * @returns {string}
1408
+ */
1409
+ export function chematic_version() {
1410
+ let deferred1_0;
1411
+ let deferred1_1;
1412
+ try {
1413
+ const ret = wasm.chematic_version();
1414
+ deferred1_0 = ret[0];
1415
+ deferred1_1 = ret[1];
1416
+ return getStringFromWasm0(ret[0], ret[1]);
1417
+ } finally {
1418
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1419
+ }
1420
+ }
1421
+
1401
1422
  /**
1402
1423
  * CIP stereo assignments via the accurate hierarchical-digraph engine, as a JSON
1403
1424
  * array of `{atomIdx, cipCode}` objects -- same shape as [`cip_assignments_json`],
@@ -3259,8 +3280,13 @@ export function minimize_mmff94_lbfgs_json(mol, max_iter) {
3259
3280
  * `coords_json` — JSON array of `[x,y,z]` arrays (Å), one per atom.
3260
3281
  * `max_iter` — maximum iterations (0 = default 500).
3261
3282
  *
3262
- * Returns JSON: `{"coords":[[x,y,z],...], "energy":float, "iterations":int, "converged":bool}`
3263
- * or `{"error":"<msg>"}` on failure.
3283
+ * Returns JSON: `{"coords":[[x,y,z],...], "energy":float, "iterations":int, "converged":bool, "sound":bool}`
3284
+ * or `{"error":"<msg>"}` on failure. `sound` is all-finite coordinates and
3285
+ * no bond stretched past a sane covalent-bond length — independent of
3286
+ * `converged`, since steepest descent often reports `converged:false` on
3287
+ * geometries that are perfectly fine but simply haven't hit the tight
3288
+ * RMS-gradient threshold yet. Check `sound`, not just `converged`, before
3289
+ * trusting a result.
3264
3290
  * @param {string} smiles
3265
3291
  * @param {string} coords_json
3266
3292
  * @param {number} max_iter
Binary file
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "kent-tokyo <kent-tokyo@users.noreply.github.com>"
6
6
  ],
7
7
  "description": "WebAssembly bindings for chematic — use chematic from JavaScript/TypeScript",
8
- "version": "0.18.0",
8
+ "version": "0.19.0",
9
9
  "license": "MIT OR Apache-2.0",
10
10
  "repository": {
11
11
  "type": "git",