Commit Graph

11 Commits

Author SHA1 Message Date
roboomp 9286b72b4f fix(omptype): preserved TypeBox constraint keywords
Emit pattern, non-URL format, and multipleOf from the TypeBox adapter alongside the runtime narrows that enforce them. Embedded builders lowered by the legacy compatibility shim now retain identical validation constraints in the raw JSON-Schema validator.

Added adapter-level wire assertions and an end-to-end unsafe embedding regression.
2026-08-13 09:15:34 +00:00
roboomp 05aea7e8b7 fix(omptype): rejected output-changing schema overrides
- Made type.withJsonSchema reject defaults, structural morphs, and pipe steps instead of returning a Type whose runtime output silently remained the original input.
- Kept validation-only narrow/filter schemas composable, preserving the legacy Type.Unsafe use case and nested JSON Schema emission.
- Added regressions for defaulted and parsed schemas and documented the validation-only contract.

Fixes #8143
2026-08-10 08:20:23 +00:00
roboomp 5e712d176d fix(extensions): preserve nested unsafe schema keywords
- Added type.withJsonSchema so a schema emits a raw JSON document verbatim even when embedded, surviving Type.Object/Type.Optional composition.
- Routed legacy Type.Unsafe through the authoritative JSON Schema validator and the IR-level emission override so JSON-Schema-only keywords (patternProperties, propertyNames, ...) stay in the nested wire schema and runtime no longer over-rejects pattern-matched keys.
- Isolated the emitted document from validator JIT annotations via a pristine clone.
- Updated the typebox remap test to assert the serialized ark wire.

Fixes #8143
2026-08-10 08:02:04 +00:00
roboomp 0a9ff29b17 fix(omptype): emit postfix bound for min-only numeric typebox schemas
tNumber rendered a min-only bound as the left-bound-only DSL
"1 <= number.integer", which parseBounded rejects because that range
spelling requires a trailing right bound. Standard TypeBox schemas like
Type.Integer({ minimum: 1 }) therefore failed to build, breaking
extension tool loading. Emit the postfix "number.integer >= 1" form when
there is no upper bound instead.

Fixes #7648
2026-08-04 20:18:52 +00:00
can1357 90b5d8e707 feat(omptype): implemented advanced schema operators and type features
- Added support for bigint, RegExp literals, and regex execution in the string DSL alongside intersection and pipe operators.
- Enhanced error aggregation, cycle detection, and alternative branch rendering for union and collection validations.
- Updated object compilation and evaluation to support symbol and pattern indexes.
- Extended type methods with subtyping, type intersection, and scope building features.
2026-08-04 05:52:57 +02:00
can1357 f7b9170f2d test(omptype/ark): refactored test suites and validation assertions
- Cleaned up test suites by removing redundant JSON property and schema assertions.
- Updated validation error messages and assertions to adopt bracket and string formats.
- Replaced internal structure inspections with runtime evaluation and allows checks.
- Standardized type equality checks using Eq type assertion helpers.
2026-08-04 03:23:29 +02:00
can1357 0eae38c0e3 test(omptype/ark): added arktype test suites and configuration
- Add extensive test suites covering arrays, objects, keywords, and core type operations.
- Introduce ArkType development dependencies and project configuration updates.
- Configure tsconfig to exclude the new ArkType test directory from compilation.
2026-08-04 02:49:17 +02:00
can1357 b7adf21415 feat(omptype): added input and output io options for JSON schema generation
- Support `io: 'input'` and `io: 'output'` in `toJsonSchema` to control morph and default representation.
- Track `.to(target)` step output IR to drive output-side JSON schemas for piped types.
- Update string DSL inference to correctly handle input-side union members and morph sources.
2026-08-04 02:26:35 +02:00
can1357 e8f890fb16 feat(omptype): implemented standard schema interop and json schema parsing
- Added Standard Schema V1 interop via `~standard` property to enable synchronous validation across tools like tRPC and @t3-oss/env.
- Added `fromJsonSchema()` function to rebuild callable schemas from JSON Schema documents with recursive reference support.
- Added comprehensive unit test suites covering Standard Schema validation and JSON Schema round-tripping.
2026-08-04 02:12:35 +02:00
can1357 f559e7e9dc feat(omptype): introduced boolean validation caching and parser helpers
- Added `compileAllows` and specialized `.allows()` caching for boolean validation.
- Optimized parser performance with helper methods for whitespace scans and object definitions.
- Cloned path arrays in error handling to prevent internal mutation bugs.
- Updated benchmarks and added unit tests covering nested and optional property validation.
2026-08-03 23:02:52 +02:00
can1357 bc39ffa265 feat: introduced omptype validation package and migrated workspace dependencies
- Introduce `@oh-my-pi/omptype` as a new ArkType-compatible schema validation package featuring a lazy JIT runtime, JSON Schema emission, and compatibility adapters.
- Replace `arktype` across workspace packages and test utilities with `@oh-my-pi/omptype`.
- Add benchmark suites, tests, and documentation for the new validation engine and adapters.
- Update workspace build, test runner, and release configurations to include the new package.
2026-08-03 21:56:48 +02:00