@vulcan-energy/mcp-helper 0.1.8 → 0.2.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vulcan-energy/mcp-helper",
3
- "version": "0.1.8",
3
+ "version": "0.2.3",
4
4
  "description": "Vulcan MCP Helper Service for Cursor, Claude Desktop, and other local MCP clients",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,7 @@
16
16
  "scripts": {
17
17
  "build": "tsup --config tsup.config.ts",
18
18
  "dev": "tsx watch bin/vulcan-mcp-helper.ts",
19
- "test:security": "node --import tsx --test src/engine/requestAuth.test.ts",
19
+ "test:security": "node --import tsx --test src/engine/requestAuth.test.ts src/engine/licenseToken.test.ts",
20
20
  "start": "node dist/bin/vulcan-mcp-helper.js",
21
21
  "prepublishOnly": "npm run build && npm run clean",
22
22
  "clean": "echo 'Package is ready for publishing'"
@@ -35,7 +35,8 @@
35
35
  "cors": "^2.8.5",
36
36
  "express": "^4.18.2",
37
37
  "jose": "^6.1.2",
38
- "zod": "^4.1.12"
38
+ "zod": "^4.1.12",
39
+ "playwright-core": "^1.59.1"
39
40
  },
40
41
  "devDependencies": {
41
42
  "@types/cors": "^2.8.17",
@@ -1,9 +1,17 @@
1
1
  {
2
- "build_id": "20260715-122627",
3
- "sha256": "feca0f78e3e6ef49282aa38071359d171ca3e5d200060de2631a9b5c86a26e6e",
4
- "timestamp": "2026-07-15T12:26:27+00:00",
2
+ "build_id": "20261008-233909",
3
+ "variant": "free",
4
+ "sha256": "e243acc7ec7a12dcdccd8737bc9c94c9c6615d4283085387583a8f2c09570f27",
5
+ "js_sha256": "f6e22d12f8386b779fd917765d283f81755c317fa423b683e83d052e9f3959d3",
6
+ "source_git_commit": "1421ba5feead2eb63a3a4794d8f7e0362136ba7e",
7
+ "source_tree_sha256": "7a6edbb85fb6c06df127e2d33348792eb212565117bf0c638aa42d7232b5494d",
8
+ "source_tree_dirty": false,
9
+ "timestamp": "2026-10-08T23:45:09.757Z",
5
10
  "runtime_origin": "Vulcan browser HEM runtime; source origin: Home Energy Foundry Limited; marker: HEF-VULCAN-RUNTIME-2026",
6
- "size_bytes": 15968878,
11
+ "size_bytes": 17761305,
12
+ "js_size_bytes": 50393,
7
13
  "wasm_filename": "wasm_wrapper_bg.wasm",
8
- "js_filename": "wasm_wrapper.js"
14
+ "js_filename": "wasm_wrapper.js",
15
+ "hashed_wasm_filename": "wasm_wrapper_bg.e243acc7.wasm",
16
+ "hashed_js_filename": "wasm_wrapper.f6e22d12.js"
9
17
  }
@@ -1,22 +1,22 @@
1
1
  /**
2
2
  * PROPRIETARY SOFTWARE LICENSE
3
- *
3
+ *
4
4
  * Copyright (c) 2026 Home Energy Foundry Limited
5
5
  * Runtime origin marker: HEF-VULCAN-RUNTIME-2026
6
- *
7
- * This software and associated documentation files (the "Software") are the
8
- * proprietary and confidential information of Home Energy Foundry Limited.
6
+ *
7
+ * This software and associated documentation files (the "Software") are the
8
+ * proprietary and confidential information of Home Energy Foundry Limited.
9
9
  * The Software is licensed, not sold.
10
- *
11
- * All rights reserved. No part of this Software may be reproduced, distributed,
12
- * or transmitted in any form or by any means, including photocopying, recording,
13
- * or other electronic or mechanical methods, without the prior written permission
10
+ *
11
+ * All rights reserved. No part of this Software may be reproduced, distributed,
12
+ * or transmitted in any form or by any means, including photocopying, recording,
13
+ * or other electronic or mechanical methods, without the prior written permission
14
14
  * of Home Energy Foundry Limited.
15
- *
16
- * This Software is provided "AS IS" without warranty of any kind, either express
17
- * or implied, including but not limited to the implied warranties of
15
+ *
16
+ * This Software is provided "AS IS" without warranty of any kind, either express
17
+ * or implied, including but not limited to the implied warranties of
18
18
  * merchantability and fitness for a particular purpose.
19
- *
19
+ *
20
20
  * For licensing inquiries, contact: info@usevulcan.app
21
21
  */
22
22
 
@@ -228,7 +228,12 @@ export function hem_pv_micro_timestep_kwh(peak_power_kw, ventilation_code, simul
228
228
  }
229
229
 
230
230
  /**
231
- * Initialize the thread pool for rayon multi-threading
231
+ * Initialize the WASM module without starting Rayon implicitly.
232
+ *
233
+ * Browser contexts that run HEM workloads must explicitly await
234
+ * `initialize_rayon_thread_pool`. SAP XML calculation is single-threaded and
235
+ * deliberately does not start Rayon, which keeps its verified Blob worker
236
+ * clear of wasm-bindgen-rayon's dynamic main-module import.
232
237
  */
233
238
  export function init() {
234
239
  wasm.init();
@@ -243,6 +248,18 @@ export function initThreadPool(num_threads) {
243
248
  return ret;
244
249
  }
245
250
 
251
+ /**
252
+ * Explicitly initialize and await the Rayon worker pool for HEM workloads.
253
+ * This must be called from a same-origin module URL, never the verified SAP
254
+ * Blob child runtime.
255
+ * @param {number} num_threads
256
+ * @returns {Promise<any>}
257
+ */
258
+ export function initialize_rayon_thread_pool(num_threads) {
259
+ const ret = wasm.initialize_rayon_thread_pool(num_threads);
260
+ return ret;
261
+ }
262
+
246
263
  /**
247
264
  * List files in a directory using the JavaScript fileService
248
265
  * @param {string} _path
@@ -294,6 +311,31 @@ export function metadata_hem_core_version() {
294
311
  }
295
312
  }
296
313
 
314
+ /**
315
+ * Prepare a single effective target scenario without starting a calculation.
316
+ * request_json is the explicit Community TransformRequest; snippets_json is an
317
+ * ordered array of [category, JSON] pairs using the existing batch merge policy.
318
+ * @param {string} request_json
319
+ * @param {string} snippets_json
320
+ * @returns {string}
321
+ */
322
+ export function prepare_target_scenario(request_json, snippets_json) {
323
+ let deferred3_0;
324
+ let deferred3_1;
325
+ try {
326
+ const ptr0 = passStringToWasm0(request_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
327
+ const len0 = WASM_VECTOR_LEN;
328
+ const ptr1 = passStringToWasm0(snippets_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
329
+ const len1 = WASM_VECTOR_LEN;
330
+ const ret = wasm.prepare_target_scenario(ptr0, len0, ptr1, len1);
331
+ deferred3_0 = ret[0];
332
+ deferred3_1 = ret[1];
333
+ return getStringFromWasm0(ret[0], ret[1]);
334
+ } finally {
335
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
336
+ }
337
+ }
338
+
297
339
  /**
298
340
  * Process a batch configuration using the existing hem-batch-core logic
299
341
  * This function uses the same run_batch_from_config function as the desktop version
@@ -434,6 +476,101 @@ export function run_batch_simulation(config_json, base_params_json, weather_cont
434
476
  }
435
477
  }
436
478
 
479
+ /**
480
+ * Run HEM for the h3 browser demo and return its output files.
481
+ *
482
+ * h3 consumes HEM's CSV *output files* rather than a metrics summary, so this
483
+ * returns them as JSON `{ "<filename>": "<contents>" }` for the caller to
484
+ * write into its own filesystem (Pyodide's, in the demo).
485
+ *
486
+ * Deliberately not argv-shaped: the CLI's argument layout is an
487
+ * implementation detail of the native binary and threading it through WASM
488
+ * buys nothing.
489
+ *
490
+ * `weather_epw` may be empty, in which case the model is expected to carry its
491
+ * own `ExternalConditions`.
492
+ *
493
+ * `fhs_assumptions` selects the Future Homes Standard wrapper rather than the
494
+ * core engine, matching `h3 run --fhs-assumptions`, which is the CLI default.
495
+ * This is not cosmetic: the wrapper imposes standardised occupancy, gains and
496
+ * heating patterns, so a core run and an FHS run of the same model give
497
+ * materially different HTC. It also selects the FHS input schema — models
498
+ * authored for FHS (`BuildingLength`, `General.storeys_in_dwelling` and the
499
+ * rest) will not validate against the core schema at all.
500
+ *
501
+ * `preprocess_only` stops after the wrapper has applied its preprocessing and
502
+ * returns the resulting model as `<calculation key>__preproc.json` instead of
503
+ * running the simulation. Only meaningful with `fhs_assumptions`; the core
504
+ * path has no preprocessing step to stop after.
505
+ *
506
+ * This exists for h3. `h3 run` disables the FHS heating schedule, which it
507
+ * does natively through `HEM_FHS_DISABLE_HEATING_SCHEDULE` — an environment
508
+ * variable, and therefore unavailable here. With the preprocessed model in
509
+ * hand h3 can flatten the heating controls itself and run the core engine on
510
+ * the result, reaching the same place without a patched wrapper.
511
+ *
512
+ * Note: h3's `HEM_ACH_CAL_FACTOR` and `HEM_FHS_DISABLE_HEATING_SCHEDULE` hooks
513
+ * read process environment variables, which are not settable in a
514
+ * wasm32-unknown-unknown build. They are therefore inert here, which is why
515
+ * h3's `calibrate` is not available in the browser. Plain `run` does not need
516
+ * them, because the patches are default-inert.
517
+ *
518
+ * On failure returns `{ "error": "<report>" }`.
519
+ * @param {string} model_json
520
+ * @param {string} weather_epw
521
+ * @param {boolean} heat_balance
522
+ * @param {boolean} fhs_assumptions
523
+ * @param {boolean} preprocess_only
524
+ * @returns {string}
525
+ */
526
+ export function run_hem_for_h3(model_json, weather_epw, heat_balance, fhs_assumptions, preprocess_only) {
527
+ let deferred3_0;
528
+ let deferred3_1;
529
+ try {
530
+ const ptr0 = passStringToWasm0(model_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
531
+ const len0 = WASM_VECTOR_LEN;
532
+ const ptr1 = passStringToWasm0(weather_epw, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
533
+ const len1 = WASM_VECTOR_LEN;
534
+ const ret = wasm.run_hem_for_h3(ptr0, len0, ptr1, len1, heat_balance, fhs_assumptions, preprocess_only);
535
+ deferred3_0 = ret[0];
536
+ deferred3_1 = ret[1];
537
+ return getStringFromWasm0(ret[0], ret[1]);
538
+ } finally {
539
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
540
+ }
541
+ }
542
+
543
+ /**
544
+ * Execute an already prepared input through the pinned Rust FHS wrapper.
545
+ * Returned files are calculation output, not a persistence acknowledgement:
546
+ * the worker must wait for workspace writes before declaring completion.
547
+ * @param {string} model_json
548
+ * @param {string} output_dir
549
+ * @param {string} modes_json
550
+ * @param {string | null} [weather_epw]
551
+ * @returns {string}
552
+ */
553
+ export function run_target_input(model_json, output_dir, modes_json, weather_epw) {
554
+ let deferred5_0;
555
+ let deferred5_1;
556
+ try {
557
+ const ptr0 = passStringToWasm0(model_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
558
+ const len0 = WASM_VECTOR_LEN;
559
+ const ptr1 = passStringToWasm0(output_dir, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
560
+ const len1 = WASM_VECTOR_LEN;
561
+ const ptr2 = passStringToWasm0(modes_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
562
+ const len2 = WASM_VECTOR_LEN;
563
+ var ptr3 = isLikeNone(weather_epw) ? 0 : passStringToWasm0(weather_epw, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
564
+ var len3 = WASM_VECTOR_LEN;
565
+ const ret = wasm.run_target_input(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
566
+ deferred5_0 = ret[0];
567
+ deferred5_1 = ret[1];
568
+ return getStringFromWasm0(ret[0], ret[1]);
569
+ } finally {
570
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
571
+ }
572
+ }
573
+
437
574
  /**
438
575
  * Stable runtime provenance marker for copied browser/WASM artifacts.
439
576
  * @returns {string}
@@ -459,29 +596,12 @@ export function setup_panic_hook() {
459
596
  }
460
597
 
461
598
  /**
462
- * Solve a thermal bridge FEM problem in the browser and return the core solution JSON.
463
- * @param {string} problem_json
464
- * @returns {string}
599
+ * Versioned capability: old JavaScript glue silently ignores extra arguments.
600
+ * @returns {number}
465
601
  */
466
- export function solve_thermal_bridge_problem(problem_json) {
467
- let deferred3_0;
468
- let deferred3_1;
469
- try {
470
- const ptr0 = passStringToWasm0(problem_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
471
- const len0 = WASM_VECTOR_LEN;
472
- const ret = wasm.solve_thermal_bridge_problem(ptr0, len0);
473
- var ptr2 = ret[0];
474
- var len2 = ret[1];
475
- if (ret[3]) {
476
- ptr2 = 0; len2 = 0;
477
- throw takeFromExternrefTable0(ret[2]);
478
- }
479
- deferred3_0 = ptr2;
480
- deferred3_1 = len2;
481
- return getStringFromWasm0(ptr2, len2);
482
- } finally {
483
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
484
- }
602
+ export function target_weather_protocol_version() {
603
+ const ret = wasm.target_weather_protocol_version();
604
+ return ret >>> 0;
485
605
  }
486
606
 
487
607
  /**
@@ -787,10 +907,6 @@ function __wbg_get_imports(memory) {
787
907
  __wbg_getRandomValues_b2176991427f6db8: function() { return handleError(function (arg0) {
788
908
  globalThis.crypto.getRandomValues(arg0);
789
909
  }, arguments); },
790
- __wbg_getTime_7a770f8a2ec8d634: function(arg0) {
791
- const ret = arg0.getTime();
792
- return ret;
793
- },
794
910
  __wbg_get_197a3fe98f169e38: function(arg0, arg1) {
795
911
  const ret = arg0[arg1 >>> 0];
796
912
  return ret;
@@ -803,10 +919,6 @@ function __wbg_get_imports(memory) {
803
919
  const ret = Reflect.get(arg0, arg1);
804
920
  return ret;
805
921
  }, arguments); },
806
- __wbg_hardwareConcurrency_39543e75ca857dac: function(arg0) {
807
- const ret = arg0.hardwareConcurrency;
808
- return ret;
809
- },
810
922
  __wbg_has_4f060fe202ad7e87: function() { return handleError(function (arg0, arg1) {
811
923
  const ret = Reflect.has(arg0, arg1);
812
924
  return ret;
@@ -836,14 +948,6 @@ function __wbg_get_imports(memory) {
836
948
  __wbg_log_6b5af08dd293697f: function(arg0) {
837
949
  console.log(arg0);
838
950
  },
839
- __wbg_navigator_935098efd1dc7fe5: function(arg0) {
840
- const ret = arg0.navigator;
841
- return ret;
842
- },
843
- __wbg_new_0_1b32bedde98fef4b: function() {
844
- const ret = new Date();
845
- return ret;
846
- },
847
951
  __wbg_new_2e117a478906f062: function() {
848
952
  const ret = new Object();
849
953
  return ret;
@@ -926,7 +1030,7 @@ function __wbg_get_imports(memory) {
926
1030
  table.set(offset + 2, true);
927
1031
  table.set(offset + 3, false);
928
1032
  },
929
- memory: memory || new WebAssembly.Memory({initial:118,maximum:16384,shared:true}),
1033
+ memory: memory || new WebAssembly.Memory({initial:141,maximum:16384,shared:true}),
930
1034
  };
931
1035
  return {
932
1036
  __proto__: null,
@@ -1251,19 +1355,22 @@ async function __wbg_init(module_or_path, memory) {
1251
1355
  export { initSync, __wbg_init as default };
1252
1356
 
1253
1357
  // Build hash injected at build time
1254
- export const BUILD_HASH = "feca0f78e3e6ef49282aa38071359d171ca3e5d200060de2631a9b5c86a26e6e";
1255
- export const BUILD_ID = "20260715-122627";
1358
+ export const BUILD_HASH = "e243acc7ec7a12dcdccd8737bc9c94c9c6615d4283085387583a8f2c09570f27";
1359
+ export const BUILD_ID = "20261008-233909";
1360
+ export const SOURCE_GIT_COMMIT = "1421ba5feead2eb63a3a4794d8f7e0362136ba7e";
1361
+ export const SOURCE_TREE_SHA256 = "7a6edbb85fb6c06df127e2d33348792eb212565117bf0c638aa42d7232b5494d";
1362
+ export const SOURCE_TREE_DIRTY = false;
1256
1363
  export const WASM_FILENAME = "wasm_wrapper_bg.wasm";
1257
1364
  export const JS_FILENAME = "wasm_wrapper.js";
1258
1365
 
1259
1366
  // Function to get the current build hash
1260
1367
  export function getBuildHash() {
1261
- return "feca0f78e3e6ef49282aa38071359d171ca3e5d200060de2631a9b5c86a26e6e";
1368
+ return "e243acc7ec7a12dcdccd8737bc9c94c9c6615d4283085387583a8f2c09570f27";
1262
1369
  }
1263
1370
 
1264
1371
  // Function to get the current build ID
1265
1372
  export function getBuildId() {
1266
- return "20260715-122627";
1373
+ return "20261008-233909";
1267
1374
  }
1268
1375
 
1269
1376
  // Function to get the WASM filename
Binary file