Skip to content

v1.23.0 — numeric range constraints in get-widget-schema

Choose a tag to compare

@BenKalsky BenKalsky released this 07 Jul 22:44
2e450a7

get-widget-schema now carries a control's own numeric bounds into the generated JSON Schema, so an agent sees valid values in one lookup.

  • numberminimum/maximum from min/max, and multipleOf from step only when an explicit min lands on the step grid (offset grids like min=1/step=2 → 1,3,5… and a stepless-base with no min are omitted rather than reject valid values).
  • slider → a unit enum (from size_units, else the range's unit keys) and, when the control offers exactly one unit, a size minimum/maximum from that unit's range. Multi-unit sliders leave size unconstrained.

Context: a source-verified pass confirmed the fork's runtime schema discovery already matches and exceeds the benchmark on widget reach (our get_full_controls() enables style/group controls outside the editor via Performance::set_use_style_controls(), which a bare get_controls() misses under Optimized Control Loading). This range enrichment closes the one remaining schema-richness delta.

Regression-tested (ControlMapperRangeTest, 10 cases). Full suite green (698). No MCP tool-surface change.