@kent-tokyo/chematic 1.0.30 → 1.0.32

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
@@ -4,7 +4,7 @@ WebAssembly bindings for [chematic](https://github.com/kent-tokyo/chematic), a p
4
4
 
5
5
  Published to npm as [`@kent-tokyo/chematic`](https://www.npmjs.com/package/@kent-tokyo/chematic).
6
6
 
7
- The current workspace line is 1.0.30. The binding keeps bounded parsing,
7
+ The current workspace line is 1.0.32. The binding keeps bounded parsing,
8
8
  typed failures, and opt-in `embed_pipeline_v2_json`; 3D/MMFF94 behavior remains
9
9
  Experimental and is not a claim of full RDKit parity.
10
10
 
@@ -2454,6 +2454,25 @@ export function roundtrip_mol_v3000_block(block: string): string;
2454
2454
  */
2455
2455
  export function run_reactants(smirks: string, reactants_smiles: string): string;
2456
2456
 
2457
+ /**
2458
+ * Apply a SMIRKS template with explicit outcome accounting as a JSON string.
2459
+ *
2460
+ * `reactants_smiles` is pipe-separated, as for [`run_reactants`]. With
2461
+ * `rdkit_compat = true`, tetrahedral reactant-side `@`/`@@` templates that
2462
+ * differ from pinned RDKit 2026.03.6 return `typed_unsupported` and a stable
2463
+ * reason code instead of an apparently compatible product. Native semantics
2464
+ * and the existing [`run_reactants`] API are unchanged. Product graph/origin/
2465
+ * template-map parity remains a separate oracle gate. Source indices and
2466
+ * product-template map labels are returned alongside the product SMILES;
2467
+ * their atom positions match the canonical SMILES parse order.
2468
+ *
2469
+ * The JSON fields mirror Python's `run_smirks_checked`: `status`, `reason`,
2470
+ * `detail`, `products`, `accepted_matches`, `applied_products`,
2471
+ * `valence_rejected_matches`, and `truncated_matches`, plus `profile`,
2472
+ * `product_atom_sources`, and `product_template_maps`.
2473
+ */
2474
+ export function run_reactants_checked(smirks: string, reactants_smiles: string, rdkit_compat: boolean): string;
2475
+
2457
2476
  /**
2458
2477
  * Parse an MDL RXN V2000 file into the typed reaction-document JSON
2459
2478
  * contract shared with the Rust and Python bindings.
@@ -3322,6 +3341,7 @@ export interface InitOutput {
3322
3341
  readonly ring_families_json: (a: number) => [number, number, number, number];
3323
3342
  readonly roundtrip_mol_v3000_block: (a: number, b: number) => [number, number, number, number];
3324
3343
  readonly run_reactants: (a: number, b: number, c: number, d: number) => [number, number, number, number];
3344
+ readonly run_reactants_checked: (a: number, b: number, c: number, d: number, e: number) => [number, number];
3325
3345
  readonly rxn_document_from_rxn: (a: number, b: number) => [number, number, number, number];
3326
3346
  readonly rxn_document_to_rxn: (a: number, b: number) => [number, number, number, number];
3327
3347
  readonly sa_score: (a: number) => number;
package/chematic_wasm.js CHANGED
@@ -6311,6 +6311,44 @@ export function run_reactants(smirks, reactants_smiles) {
6311
6311
  }
6312
6312
  }
6313
6313
 
6314
+ /**
6315
+ * Apply a SMIRKS template with explicit outcome accounting as a JSON string.
6316
+ *
6317
+ * `reactants_smiles` is pipe-separated, as for [`run_reactants`]. With
6318
+ * `rdkit_compat = true`, tetrahedral reactant-side `@`/`@@` templates that
6319
+ * differ from pinned RDKit 2026.03.6 return `typed_unsupported` and a stable
6320
+ * reason code instead of an apparently compatible product. Native semantics
6321
+ * and the existing [`run_reactants`] API are unchanged. Product graph/origin/
6322
+ * template-map parity remains a separate oracle gate. Source indices and
6323
+ * product-template map labels are returned alongside the product SMILES;
6324
+ * their atom positions match the canonical SMILES parse order.
6325
+ *
6326
+ * The JSON fields mirror Python's `run_smirks_checked`: `status`, `reason`,
6327
+ * `detail`, `products`, `accepted_matches`, `applied_products`,
6328
+ * `valence_rejected_matches`, and `truncated_matches`, plus `profile`,
6329
+ * `product_atom_sources`, and `product_template_maps`.
6330
+ * @param {string} smirks
6331
+ * @param {string} reactants_smiles
6332
+ * @param {boolean} rdkit_compat
6333
+ * @returns {string}
6334
+ */
6335
+ export function run_reactants_checked(smirks, reactants_smiles, rdkit_compat) {
6336
+ let deferred3_0;
6337
+ let deferred3_1;
6338
+ try {
6339
+ const ptr0 = passStringToWasm0(smirks, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6340
+ const len0 = WASM_VECTOR_LEN;
6341
+ const ptr1 = passStringToWasm0(reactants_smiles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6342
+ const len1 = WASM_VECTOR_LEN;
6343
+ const ret = wasm.run_reactants_checked(ptr0, len0, ptr1, len1, rdkit_compat);
6344
+ deferred3_0 = ret[0];
6345
+ deferred3_1 = ret[1];
6346
+ return getStringFromWasm0(ret[0], ret[1]);
6347
+ } finally {
6348
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
6349
+ }
6350
+ }
6351
+
6314
6352
  /**
6315
6353
  * Parse an MDL RXN V2000 file into the typed reaction-document JSON
6316
6354
  * contract shared with the Rust and Python bindings.
Binary file
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "Kentaro Tanabe (kent-tokyo) <kent-tokyo@users.noreply.github.com>"
6
6
  ],
7
7
  "description": "WebAssembly bindings for chematic — use chematic from JavaScript/TypeScript",
8
- "version": "1.0.30",
8
+ "version": "1.0.32",
9
9
  "license": "MIT OR Apache-2.0",
10
10
  "repository": {
11
11
  "type": "git",