From 586d28c745b1bbe4343ce4eb7674818dade339b6 Mon Sep 17 00:00:00 2001 From: sepehr Date: Sun, 19 Jul 2026 16:54:21 +0200 Subject: [PATCH] Expose solved_variables on the web SimulationResult type. Align the TypeScript API with the Rust SolvedVariable payload so z_dp and other free actuators can be displayed after solve. Co-authored-by: Cursor --- apps/web/src/lib/api.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/apps/web/src/lib/api.ts b/apps/web/src/lib/api.ts index 67802a8..b87d580 100644 --- a/apps/web/src/lib/api.ts +++ b/apps/web/src/lib/api.ts @@ -76,6 +76,25 @@ export interface SimulationResult { } | null; /** Degrees-of-freedom summary after topology finalize (CLI hard gate). */ dof?: DofSummary | null; + /** + * Named solver-computed unknowns (free actuators + calibration factors like + * `z_ua`, `opening`, `z_dp`) read out of the raw Newton state vector. + * Absent/empty for systems with no bounded control variables. + */ + solved_variables?: SolvedVariable[]; +} + +/** A named solver-computed unknown with its converged value and bounds. */ +export interface SolvedVariable { + /** Stable id, e.g. "exv__opening". */ + id: string; + /** Owning component name, or null for globals. */ + component: string | null; + /** Short human label, e.g. "opening", "z_ua", "z_dp". */ + variable: string; + value: number; + min: number; + max: number; } /** Degrees-of-freedom summary returned by the CLI after finalize. */