@dc99-tech/pi-schema 1.8.0 → 1.8.1

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/CHANGELOG.md +1 -1
  2. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -36,7 +36,7 @@
36
36
 
37
37
  ### Added
38
38
 
39
- - Initial release: `compile(schema, options)` validates JSON Schema drafts 2020-12 and 7 without `eval` or `new Function`, compiling a schema once into plain closures. `Validator.check` is the boolean check (a type guard for schemas built with the builders), `Validator.errors` reports each failure with a JSON Pointer path. Format checks are in the optional `@dc99-tech/pi-schema/formats` entry point.
39
+ - Initial release: `compile(schema, options)` validates JSON Schema drafts 2020-12 and 7 without `eval` or `new Function`, compiling a schema once into plain closures. `Validator.check` is the boolean check (a type guard for schemas built with the builders), `Validator.errors` reports each failure with a JSON Pointer path. Format checks are in the optional `@earendil-works/pi-schema/formats` entry point.
40
40
  - Schema builders (`str`, `num`, `int`, `bool`, `nul`, `unknown`, `lit`, `oneOf`, `obj`, `opt`, `arr`, `tuple`, `map`, `union`, `nullable`, `bytes`) that return plain JSON Schema typed with the values it accepts (`Static<typeof schema>`).
41
41
  - `compile(schema, { coerce: true })` adds `coerce(value)` and `parse(value)` for loosely typed input such as a model's tool call arguments: optional `null`s dropped, TypeBox 1.3.27's `Value.Convert` rules keyed on JSON Schema keywords (numeric strings, `"true"`, single values to arrays, `const`/`enum` members, union branches), then Ajv-style primitive coercion by `type`. `coerce` copies only the paths it changes and returns the input itself when nothing changes; `parse` coerces, then checks. Validators compiled without the option have neither; the README lists every rule.
42
42
  - `Static` also types TypeBox-built schemas, from TypeBox 1.x's type shapes and without importing TypeBox: String, Number, Integer, Boolean, Null, Literal, Array, Object (with `Type.Optional` and `Type.Readonly` properties), Union, Record, Unsafe, Unknown and Any give TypeBox's static type; other TypeBox kinds give `unknown`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dc99-tech/pi-schema",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "JSON Schema validation without eval: drafts 2020-12 and 7, compiled into plain closures",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -41,11 +41,11 @@
41
41
  "license": "MIT",
42
42
  "repository": {
43
43
  "type": "git",
44
- "url": "git+https://github.com/earendil-works/pi.git",
44
+ "url": "git+https://github.com/jidzhang/pi-agent-port.git",
45
45
  "directory": "packages/schema"
46
46
  },
47
47
  "engines": {
48
- "node": ">=22.19.0"
48
+ "node": ">=20.6.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@cfworker/json-schema": "4.1.1",