@oh-my-pi/omptype 17.2.8 → 17.2.9

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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [17.2.9] - 2026-08-05
6
+
7
+ ### Fixed
8
+
9
+ - Fixed the TypeBox adapter emitting an invalid left-bound-only DSL for min-only numeric schemas (e.g. `Type.Integer({ minimum: 1 })`), which threw `left bound requires a corresponding right bound` and broke extension tool loading ([#7648](https://github.com/can1357/oh-my-pi/issues/7648)).
10
+
5
11
  ## [17.2.8] - 2026-08-04
6
12
 
7
13
  ### Added
@@ -123,9 +123,22 @@ function tNumber(opts, integer = false) {
123
123
  upper = { value: opts.exclusiveMaximum, exclusive: true };
124
124
  }
125
125
  const keyword = integer ? "number.integer" : "number";
126
- const lowerDsl = lower ? `${lower.value} ${lower.exclusive ? "<" : "<="} ` : "";
127
- const upperDsl = upper ? ` ${upper.exclusive ? "<" : "<="} ${upper.value}` : "";
128
- let schema = asRuntime(type.raw(`${lowerDsl}${keyword}${upperDsl}`));
126
+ // The `LO <= TYPE <= HI` range spelling requires both bounds; a min-only
127
+ // bound must use the postfix `TYPE >= LO` form (see parseBounded in ir.ts).
128
+ let src;
129
+ if (lower && upper) {
130
+ src = `${lower.value} ${lower.exclusive ? "<" : "<="} ${keyword} ${upper.exclusive ? "<" : "<="} ${upper.value}`;
131
+ }
132
+ else if (lower) {
133
+ src = `${keyword} ${lower.exclusive ? ">" : ">="} ${lower.value}`;
134
+ }
135
+ else if (upper) {
136
+ src = `${keyword} ${upper.exclusive ? "<" : "<="} ${upper.value}`;
137
+ }
138
+ else {
139
+ src = keyword;
140
+ }
141
+ let schema = asRuntime(type.raw(src));
129
142
  if (opts?.multipleOf !== undefined) {
130
143
  const divisor = opts.multipleOf;
131
144
  schema = schema.narrow((value, ctx) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/omptype",
4
- "version": "17.2.8",
4
+ "version": "17.2.9",
5
5
  "description": "ArkType-compatible runtime schema validation with lazy JIT compilation",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": "Can Boluk",
package/src/typebox.ts CHANGED
@@ -267,9 +267,19 @@ function tNumber(opts?: NumberOpts, integer = false): TNumber {
267
267
  upper = { value: opts.exclusiveMaximum, exclusive: true };
268
268
  }
269
269
  const keyword = integer ? "number.integer" : "number";
270
- const lowerDsl = lower ? `${lower.value} ${lower.exclusive ? "<" : "<="} ` : "";
271
- const upperDsl = upper ? ` ${upper.exclusive ? "<" : "<="} ${upper.value}` : "";
272
- let schema = asRuntime<number>(type.raw(`${lowerDsl}${keyword}${upperDsl}`));
270
+ // The `LO <= TYPE <= HI` range spelling requires both bounds; a min-only
271
+ // bound must use the postfix `TYPE >= LO` form (see parseBounded in ir.ts).
272
+ let src: string;
273
+ if (lower && upper) {
274
+ src = `${lower.value} ${lower.exclusive ? "<" : "<="} ${keyword} ${upper.exclusive ? "<" : "<="} ${upper.value}`;
275
+ } else if (lower) {
276
+ src = `${keyword} ${lower.exclusive ? ">" : ">="} ${lower.value}`;
277
+ } else if (upper) {
278
+ src = `${keyword} ${upper.exclusive ? "<" : "<="} ${upper.value}`;
279
+ } else {
280
+ src = keyword;
281
+ }
282
+ let schema = asRuntime<number>(type.raw(src));
273
283
  if (opts?.multipleOf !== undefined) {
274
284
  const divisor = opts.multipleOf;
275
285
  schema = schema.narrow((value, ctx) => {