@ferscloud/fers-mcp 2.105.0 → 2.107.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.
Files changed (2) hide show
  1. package/dist/fers-mcp.cjs +29 -10
  2. package/package.json +2 -2
package/dist/fers-mcp.cjs CHANGED
@@ -21940,7 +21940,7 @@ var openapi_default = {
21940
21940
  name: "PolyForm-Strict-1.0.0",
21941
21941
  url: "https://polyformproject.org/licenses/strict/1.0.0"
21942
21942
  },
21943
- version: "0.2.105"
21943
+ version: "0.2.107"
21944
21944
  },
21945
21945
  paths: {},
21946
21946
  components: {
@@ -82388,11 +82388,30 @@ var VALIDATION_REWRITES = [
82388
82388
  rewrite: "a member references a node that no longer exists \u2014 check Structure \u2192 Members"
82389
82389
  }
82390
82390
  ];
82391
- function classifySolverError(err) {
82391
+ function classifySolverError(err, model) {
82392
82392
  const code = err?.code ?? "";
82393
82393
  const message = err instanceof Error ? err.message : String(err ?? "");
82394
82394
  const lower = message.toLowerCase();
82395
82395
  const fatalTrap = lower.includes("unreachable") || lower.includes("runtimeerror") || lower.includes("recursion") || lower.includes("memory access") || lower.includes("out of bounds");
82396
+ if (code === "OutOfMemory") {
82397
+ const advice = "It is too large to calculate in the browser: use a coarser mesh or fewer nodes, then calculate again.";
82398
+ if (model?.nodes) {
82399
+ return {
82400
+ kind: "trap",
82401
+ fatalTrap: true,
82402
+ messageKey: "solverError.outOfMemoryNodes",
82403
+ // A number: the translations format it for their own locale.
82404
+ messageParams: { nodes: model.nodes },
82405
+ message: `The solver ran out of memory on this model (${model.nodes.toLocaleString("en-US")} nodes) and was reset. ${advice}`
82406
+ };
82407
+ }
82408
+ return {
82409
+ kind: "trap",
82410
+ fatalTrap: true,
82411
+ messageKey: "solverError.outOfMemory",
82412
+ message: `The solver ran out of memory on this model and was reset. ${advice}`
82413
+ };
82414
+ }
82396
82415
  if (code === "Timeout") {
82397
82416
  return {
82398
82417
  kind: "timeout",
@@ -85823,7 +85842,7 @@ function setMemberDesign(args) {
85823
85842
 
85824
85843
  // src/lib/mcpPlates.ts
85825
85844
  var fail4 = (error2) => ({ ok: false, error: error2 });
85826
- var MAX_TOTAL_NODES = 2e3;
85845
+ var MAX_TOTAL_NODES = 2e4;
85827
85846
  var THIN_PLATE_RATIO = 20;
85828
85847
  var DELAUNAY_NODES_PER_CELL = 1.7;
85829
85848
  function delaunayNodeEstimate(area, target, ringPoints) {
@@ -86171,7 +86190,7 @@ function ringFromNodeIds(model, ids, what) {
86171
86190
  }
86172
86191
  return { ok: true, points: ids.map((id) => nodeXYZ(byId.get(id))) };
86173
86192
  }
86174
- var ADD_PLATE_SURFACE_TOOL_DOC = 'Add a meshed plate/shell surface (slab, wall, deck, panel) to a FERS model. You give the corner points; the tool creates the boundary nodes, optionally the full edge-node grid with a support, and appends the PlateSurface to model.plate_surfaces. The SOLVER meshes it at solve time \u2014 never author plate_elements for a surface yourself. Load it with add_load kind:"plate_pressure" (surface_id), not with distributed_loads.\n\nMESHING DECIDES WHETHER YOUR MODEL IS CORRECT. The mesher only ever creates NODES and PLATE ELEMENTS: it never splits members and never adds supports, so a plate connects to the rest of the structure ONLY through nodes it shares by exact coordinate. (1) Leave the mesh unset and the surface becomes TWO TRIANGLES spanning the corners \u2014 it still solves and reactions still equal q x A, so nothing looks wrong; this tool rejects that instead. (2) A supported or member-connected EDGE only exists where a node sits at an exact mesh-grid coordinate: structured meshing has predictable positions so edge_support can pre-create them, unstructured/Delaunay does not, so edge_support with unstructured meshing is rejected. (3) If a beam runs along a plate edge, split that beam into segments ending on the grid, or the plate hangs off its two end nodes only (measured 4.2x too flexible, beam moment 2.5x too low) with no warning.\n\nTHEORY \u2014 THE ENGINE DEFAULT IS WRONG FOR THIN PLATES. PlateTheory "Auto" is resolved unconditionally to Mindlin (the OpenAPI text claiming otherwise is stale). Mindlin (DSG3) shear-locks: on a simply-supported square slab at span/thickness 80 the centre-deflection error was -86.1% / -55.2% / -8.1% / -0.4% at 4x4 / 8x8 / 16x16 / 32x32, where Kirchhoff (DKT, rewritten and patch-test-exact in 0.2.44) gave -5.5% / -1.4% / -0.3% / -0.03%. So: span/thickness >= 20 -> "kirchhoff"; span/thickness < 10 -> "mindlin" plus a fine mesh (it correctly adds the ~10% shear deflection Kirchhoff misses). theory:"auto" (the default) makes that choice from the SMALLER IN-PLANE DIMENSION of your boundary (not its shortest edge, which collapses the moment an edge carries intermediate nodes) and tells you which it picked and why.\n\nBOUNDARY POINTS: give the ring OPEN. A closing point that repeats the first is dropped for you (and said so in the notes); any other repeated point is refused, because coincident points collapse onto one node and leave boundary_node_ids with a duplicate id \u2014 measured, that solves with no error, balances the load to exactly q x A, and is 513% wrong on deflection.\n\nALSO TRUE OF EVERY PLATE: plates carry NO self-weight (enable_self_weight loops over members only) \u2014 add density x thickness x g as a pressure. Plates contribute NO geometric stiffness, so alpha_cr from a model where plate stability governs is unconservative. behavior "membrane" does not remove bending stiffness, it scales it by 1e-6, so an out-of-plane load on a membrane plate returns absurd deflections rather than an error. Boundary point ORDER sets the element normal and therefore the sign of mx/my/mxy. Keep total model nodes under ~2000: the engine allocates a dense (7 x nodes)^2 block and aborts above that with a raw wasm trap, so both meshers are rejected here once the projected node count crosses it (Delaunay produces ~1.7 nodes per target_size^2 of area, measured, so target_size 0.1 on a 4 m x 4 m slab is already fatal).';
86193
+ var ADD_PLATE_SURFACE_TOOL_DOC = 'Add a meshed plate/shell surface (slab, wall, deck, panel) to a FERS model. You give the corner points; the tool creates the boundary nodes, optionally the full edge-node grid with a support, and appends the PlateSurface to model.plate_surfaces. The SOLVER meshes it at solve time \u2014 never author plate_elements for a surface yourself. Load it with add_load kind:"plate_pressure" (surface_id), not with distributed_loads.\n\nMESHING DECIDES WHETHER YOUR MODEL IS CORRECT. The mesher only ever creates NODES and PLATE ELEMENTS: it never splits members and never adds supports, so a plate connects to the rest of the structure ONLY through nodes it shares by exact coordinate. (1) Leave the mesh unset and the surface becomes TWO TRIANGLES spanning the corners \u2014 it still solves and reactions still equal q x A, so nothing looks wrong; this tool rejects that instead. (2) A supported or member-connected EDGE only exists where a node sits at an exact mesh-grid coordinate: structured meshing has predictable positions so edge_support can pre-create them, unstructured/Delaunay does not, so edge_support with unstructured meshing is rejected. (3) If a beam runs along a plate edge, split that beam into segments ending on the grid, or the plate hangs off its two end nodes only (measured 4.2x too flexible, beam moment 2.5x too low) with no warning.\n\nTHEORY \u2014 THE ENGINE DEFAULT IS WRONG FOR THIN PLATES. PlateTheory "Auto" is resolved unconditionally to Mindlin (the OpenAPI text claiming otherwise is stale). Mindlin (DSG3) shear-locks: on a simply-supported square slab at span/thickness 80 the centre-deflection error was -86.1% / -55.2% / -8.1% / -0.4% at 4x4 / 8x8 / 16x16 / 32x32, where Kirchhoff (DKT, rewritten and patch-test-exact in 0.2.44) gave -5.5% / -1.4% / -0.3% / -0.03%. So: span/thickness >= 20 -> "kirchhoff"; span/thickness < 10 -> "mindlin" plus a fine mesh (it correctly adds the ~10% shear deflection Kirchhoff misses). theory:"auto" (the default) makes that choice from the SMALLER IN-PLANE DIMENSION of your boundary (not its shortest edge, which collapses the moment an edge carries intermediate nodes) and tells you which it picked and why.\n\nBOUNDARY POINTS: give the ring OPEN. A closing point that repeats the first is dropped for you (and said so in the notes); any other repeated point is refused, because coincident points collapse onto one node and leave boundary_node_ids with a duplicate id \u2014 measured, that solves with no error, balances the load to exactly q x A, and is 513% wrong on deflection.\n\nALSO TRUE OF EVERY PLATE: plates carry NO self-weight (enable_self_weight loops over members only) \u2014 add density x thickness x g as a pressure. Plates contribute NO geometric stiffness, so alpha_cr from a model where plate stability governs is unconservative. behavior "membrane" does not remove bending stiffness, it scales it by 1e-6, so an out-of-plane load on a membrane plate returns absurd deflections rather than an error. Boundary point ORDER sets the element normal and therefore the sign of mx/my/mxy. Keep total model nodes under 20,000: much larger models run the engine out of its 4 GB of wasm32 memory (40,000 shell nodes take 3.1 GB), and it then aborts with a raw wasm trap, so both meshers are rejected here once the projected node count crosses 20,000 (Delaunay produces ~1.7 nodes per target_size^2 of area, measured, so target_size 0.035 on a 4 m x 4 m slab already crosses it).';
86175
86194
  function addPlateSurface(args) {
86176
86195
  const parsed = parseModel(args.model);
86177
86196
  if (!parsed.ok) return parsed;
@@ -86328,7 +86347,7 @@ function addPlateSurface(args) {
86328
86347
  if (projected > MAX_TOTAL_NODES) {
86329
86348
  const how = method === "Structured" ? `a ${mesh.divisions.u}x${mesh.divisions.v} grid` : `Delaunay meshing at target_size ${targetSize} (about ${DELAUNAY_NODES_PER_CELL} nodes per target_size^2 of area, measured)`;
86330
86349
  return fail4(
86331
- `This mesh would put the model at about ${projected} nodes (${existingNodes} existing + ${estimatedMeshNodes} from ${how}). The engine allocates a DENSE (7 x nodes)^2 f64 block, so it aborts above ~2300 nodes with a raw "unreachable" wasm trap rather than an error you can act on. Keep it under ${MAX_TOTAL_NODES}: ${method === "Structured" ? "coarsen the mesh" : `raise target_size to at least ${safeDelaunayTarget(polygonArea(ring), MAX_TOTAL_NODES - existingNodes - ring.length).toFixed(3)}`}, or use Kirchhoff, which is already within 0.3% at 16x16 where Mindlin needs 32x32.`
86350
+ `This mesh would put the model at about ${projected} nodes (${existingNodes} existing + ${estimatedMeshNodes} from ${how}). Much larger models run the engine out of wasm32's 4 GB (40,000 shell nodes take 3.1 GB), and it then aborts with a raw "unreachable" wasm trap rather than an error you can act on. Keep it under ${MAX_TOTAL_NODES}: ${method === "Structured" ? "coarsen the mesh" : `raise target_size to at least ${safeDelaunayTarget(polygonArea(ring), MAX_TOTAL_NODES - existingNodes - ring.length).toFixed(3)}`}, or use Kirchhoff, which is already within 0.3% at 16x16 where Mindlin needs 32x32.`
86332
86351
  );
86333
86352
  }
86334
86353
  const th = pickEnum(args.theory, THEORY, "theory");
@@ -86597,7 +86616,7 @@ function addPlateOpening(args) {
86597
86616
  if (target < minSafeTarget) {
86598
86617
  if (requestedTarget !== void 0) {
86599
86618
  return fail4(
86600
- `target_size ${requestedTarget} would mesh plate surface ${surfaceId} (${surfaceArea.toFixed(3)} area units) into about ${delaunayNodeEstimate(surfaceArea, requestedTarget, outerIds.length)} nodes, taking the model past the engine's dense-matrix ceiling \u2014 it aborts there with a raw "unreachable" wasm trap, not an error. Use target_size >= ${minSafeTarget.toFixed(3)}, or model the perforated region as its own smaller surface.`
86619
+ `target_size ${requestedTarget} would mesh plate surface ${surfaceId} (${surfaceArea.toFixed(3)} area units) into about ${delaunayNodeEstimate(surfaceArea, requestedTarget, outerIds.length)} nodes, taking the model past ${MAX_TOTAL_NODES} nodes; further on the engine runs out of memory and aborts with a raw "unreachable" wasm trap, not an error. Use target_size >= ${minSafeTarget.toFixed(3)}, or model the perforated region as its own smaller surface.`
86601
86620
  );
86602
86621
  }
86603
86622
  target = Math.ceil(minSafeTarget * 1e6) / 1e6;
@@ -86631,7 +86650,7 @@ function addPlateOpening(args) {
86631
86650
  }
86632
86651
  if (targetClamped) {
86633
86652
  notes.push(
86634
- `target_size was CLAMPED to ${target} \u2014 half the shortest hole edge would have been ${defaultTarget}, which applied to the whole ${surfaceArea.toFixed(3)}-unit surface is roughly ${delaunayNodeEstimate(surfaceArea, defaultTarget, outerIds.length)} mesh nodes and the engine aborts on that with a raw "unreachable" wasm trap. The hole is therefore resolved COARSELY: its stress concentration is not converged. If you need it sharp, model the region around the opening as its own smaller surface.`
86653
+ `target_size was CLAMPED to ${target} \u2014 half the shortest hole edge would have been ${defaultTarget}, which applied to the whole ${surfaceArea.toFixed(3)}-unit surface is roughly ${delaunayNodeEstimate(surfaceArea, defaultTarget, outerIds.length)} mesh nodes, past the ${MAX_TOTAL_NODES}-node ceiling (further on, the engine runs out of memory and aborts with a raw "unreachable" wasm trap). The hole is therefore resolved COARSELY: its stress concentration is not converged. If you need it sharp, model the region around the opening as its own smaller surface.`
86635
86654
  );
86636
86655
  } else if (requestedTarget === void 0) {
86637
86656
  notes.push(
@@ -86665,7 +86684,7 @@ function addPlateOpening(args) {
86665
86684
  }
86666
86685
  };
86667
86686
  }
86668
- var ADD_PLATE_GRID_ELEMENTS_TOOL_DOC = 'Author plate elements EXPLICITLY (model.plate_elements) as a regular quad grid over four corner points, instead of letting the solver mesh a PlateSurface. Creates the nodes, optionally supports the perimeter, and writes one 4-node PlateElement per cell. Verified to give bit-identical results to the equivalent structured surface mesh (16x16: max|dz| 4.31048e-3 m either way).\n\nUSE THIS WHEN YOU NEED PLATE UNITY CHECKS. In engine 0.2.52 a unity check targeting plates (AllPlates / PlateSurfaces / PlateElements with a PlateStress variable) returns an EMPTY per_entity for anything meshed from a PlateSurface \u2014 status "Green", max_utilization 0, no warning \u2014 because the mesh is generated on an internal working copy while the checks run against the original document. Explicit plate elements survive in that document and are checked normally (verified 256/256 entities).\n\nALSO USE IT when you need stable, known plate element ids: mesh-generated ids start at max(explicit id)+1 and are never echoed back, so an element-targeted pressure on a generated id is a silent no-op.\n\nCOST: verbosity. An N x N grid emits (N+1)^2 nodes and N^2 elements inline, and the engine allocates a dense (7 x nodes)^2 block, so keep total model nodes under ~2000. Load the grid with ONE add_load kind:"surface" whose polygon covers it, rather than N^2 individual pressures. Same theory guidance as add_plate_surface: PlateTheory "Auto" resolves to Mindlin, which shear-locks (-55% at 8x8 on a span/thickness 80 slab), so prefer "kirchhoff" at span/thickness >= 20.';
86687
+ var ADD_PLATE_GRID_ELEMENTS_TOOL_DOC = 'Author plate elements EXPLICITLY (model.plate_elements) as a regular quad grid over four corner points, instead of letting the solver mesh a PlateSurface. Creates the nodes, optionally supports the perimeter, and writes one 4-node PlateElement per cell. Verified to give bit-identical results to the equivalent structured surface mesh (16x16: max|dz| 4.31048e-3 m either way).\n\nUSE THIS WHEN YOU NEED PLATE UNITY CHECKS. In engine 0.2.52 a unity check targeting plates (AllPlates / PlateSurfaces / PlateElements with a PlateStress variable) returns an EMPTY per_entity for anything meshed from a PlateSurface \u2014 status "Green", max_utilization 0, no warning \u2014 because the mesh is generated on an internal working copy while the checks run against the original document. Explicit plate elements survive in that document and are checked normally (verified 256/256 entities).\n\nALSO USE IT when you need stable, known plate element ids: mesh-generated ids start at max(explicit id)+1 and are never echoed back, so an element-targeted pressure on a generated id is a silent no-op.\n\nCOST: verbosity. An N x N grid emits (N+1)^2 nodes and N^2 elements inline, so keep total model nodes under 20,000 (much larger models run the engine out of memory). Load the grid with ONE add_load kind:"surface" whose polygon covers it, rather than N^2 individual pressures. Same theory guidance as add_plate_surface: PlateTheory "Auto" resolves to Mindlin, which shear-locks (-55% at 8x8 on a span/thickness 80 slab), so prefer "kirchhoff" at span/thickness >= 20.';
86669
86688
  function addPlateGridElements(args) {
86670
86689
  const parsed = parseModel(args.model);
86671
86690
  if (!parsed.ok) return parsed;
@@ -86706,7 +86725,7 @@ function addPlateGridElements(args) {
86706
86725
  const existingNodes = nodesOf2(model).length;
86707
86726
  if (existingNodes + nodeCount > MAX_TOTAL_NODES) {
86708
86727
  return fail4(
86709
- `A ${u}x${v} grid adds ${nodeCount} nodes, taking the model to about ${existingNodes + nodeCount}. The engine allocates a dense (7 x nodes)^2 f64 block and aborts above ~2300 nodes with a raw "unreachable" wasm trap. Keep it under ${MAX_TOTAL_NODES}.`
86728
+ `A ${u}x${v} grid adds ${nodeCount} nodes, taking the model to about ${existingNodes + nodeCount}. Much larger models run the engine out of wasm32's 4 GB, and it then aborts with a raw "unreachable" wasm trap. Keep it under ${MAX_TOTAL_NODES}.`
86710
86729
  );
86711
86730
  }
86712
86731
  const th = pickEnum(args.theory, THEORY, "theory");
@@ -87127,7 +87146,7 @@ function shareSlugOf(urlOrSlug) {
87127
87146
 
87128
87147
  // src/lib/mcp-core/server.ts
87129
87148
  var isDraftRef = (x) => typeof x === "string" && x.startsWith("draft_");
87130
- var SERVER_VERSION = "2.105.0";
87149
+ var SERVER_VERSION = "2.107.0";
87131
87150
  function tooLarge(model) {
87132
87151
  return typeof model !== "string" || model.length > MODEL_JSON_MAX_BYTES;
87133
87152
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ferscloud/fers-mcp",
3
- "version": "2.105.0",
3
+ "version": "2.107.0",
4
4
  "description": "FERS structural finite-element tools for MCP clients (Claude Desktop, Claude Code, Cursor, VS Code, Codex, ChatGPT desktop), solving on your own machine.",
5
5
  "mcpName": "com.ferscloud/fers",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -30,6 +30,6 @@
30
30
  "node": ">=18"
31
31
  },
32
32
  "dependencies": {
33
- "@ferscloud/fers-calculation": "0.2.105"
33
+ "@ferscloud/fers-calculation": "0.2.107"
34
34
  }
35
35
  }