{"_id":"ai-assert-schema","_rev":"10-bc87be27cf7e5e04da84b4e933a8b422","name":"ai-assert-schema","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"ai-assert-schema","version":"1.0.0","keywords":["ai","schema","validation","zod","json-schema","openai","structured-output","standard-schema"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-assert-schema@1.0.0","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-assert-schema#readme","bugs":{"url":"https://github.com/zirkelc/ai-assert-schema/issues"},"dist":{"shasum":"5f6151d597a855f81492878e7242ebf144f54e7c","tarball":"https://registry.npmjs.org/ai-assert-schema/-/ai-assert-schema-1.0.0.tgz","fileCount":5,"integrity":"sha512-QrNxop3E8I563NHSX0/i9u98hQyc7Z5zwtOp/YUmTNed7U1cXhxPIDKTepOUiKh+5YJdHndNhBw59cHIUalpFA==","signatures":[{"sig":"MEUCIQCxu0wBby+tPzG9wldHJn0q5L3gpuIrWIsGt4cIOU54pwIgDXAS2BrrjKDyWKz1jj0ytLOalgDyWOZhYd4ASEZU6YU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":42105},"type":"module","_from":"file:ai-assert-schema-1.0.0.tgz","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./package.json":"./package.json"},"scripts":{"lint":"biome check . --write","test":"vitest","build":"tsdown"},"_npmUser":{"name":"chriszirkel","email":"chris.zirkel@gmail.com"},"_resolved":"/private/var/folders/_y/_4h8lsmx5053g1g2x562lt0m0000gn/T/5588eccf242f5b3426a36ca0325bcb17/ai-assert-schema-1.0.0.tgz","_integrity":"sha512-QrNxop3E8I563NHSX0/i9u98hQyc7Z5zwtOp/YUmTNed7U1cXhxPIDKTepOUiKh+5YJdHndNhBw59cHIUalpFA==","repository":{"url":"git+https://github.com/zirkelc/ai-assert-schema.git","type":"git"},"_npmVersion":"11.6.2","description":"Assert schemas for compatibility against your AI models","directories":{},"_nodeVersion":"24.11.1","dependencies":{"@standard-schema/spec":"^1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.24","tsx":"^4.21.0","zod":"^4.3.5","chalk":"^5.6.2","husky":"^9.1.7","tsdown":"0.19.0-beta.5","vitest":"^4.0.16","publint":"^0.3.16","pkg-pr-new":"^0.0.62","typescript":"^5.9.3","@types/node":"^25.0.3","@ai-sdk/openai":"^3.0.7","@biomejs/biome":"^2.3.11","@types/json-schema":"^7.0.15","@arethetypeswrong/cli":"^0.18.2","@total-typescript/tsconfig":"^1.0.4"},"_npmOperationalInternal":{"tmp":"tmp/ai-assert-schema_1.0.0_1767973357473_0.7033697416473808","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"ai-assert-schema","version":"1.0.1","keywords":["ai","schema","validation","zod","json-schema","openai","structured-output","standard-schema"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-assert-schema@1.0.1","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-assert-schema#readme","bugs":{"url":"https://github.com/zirkelc/ai-assert-schema/issues"},"dist":{"shasum":"22c63fded2c570f458452c4415ed6d6f991b5bd5","tarball":"https://registry.npmjs.org/ai-assert-schema/-/ai-assert-schema-1.0.1.tgz","fileCount":5,"integrity":"sha512-yPyVJ02Lkx1ZlnbFsQdtITJFbIQnKrUasB8uXaf1S7kWxyXRWryzBJdd0EqGnKYXFsJ/0ZrHmWVjUtf0DkIJ+A==","signatures":[{"sig":"MEQCIHVnCJi1z3wh9GG/KAqCVqUgeO6Tf6U4Ij8M0BvVnMrFAiAcULwHQRQtXE9oEydsIAKDe+UzDGT/UFkl4jFmc0jOCw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34839},"type":"module","_from":"file:ai-assert-schema-1.0.1.tgz","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./package.json":"./package.json"},"scripts":{"lint":"biome check . --write","test":"vitest","build":"tsdown"},"_npmUser":{"name":"chriszirkel","email":"chris.zirkel@gmail.com"},"_resolved":"/private/var/folders/_y/_4h8lsmx5053g1g2x562lt0m0000gn/T/c5799b6547e41b82c00cdced7914fb23/ai-assert-schema-1.0.1.tgz","_integrity":"sha512-yPyVJ02Lkx1ZlnbFsQdtITJFbIQnKrUasB8uXaf1S7kWxyXRWryzBJdd0EqGnKYXFsJ/0ZrHmWVjUtf0DkIJ+A==","repository":{"url":"git+https://github.com/zirkelc/ai-assert-schema.git","type":"git"},"_npmVersion":"11.6.2","description":"Assert schemas for compatibility against your AI models","directories":{},"_nodeVersion":"24.11.1","dependencies":{"@standard-schema/spec":"^1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.24","tsx":"^4.21.0","zod":"^4.3.5","chalk":"^5.6.2","husky":"^9.1.7","tsdown":"0.19.0-beta.5","vitest":"^4.0.16","publint":"^0.3.16","pkg-pr-new":"^0.0.62","typescript":"^5.9.3","@types/node":"^25.0.3","@ai-sdk/openai":"^3.0.7","@biomejs/biome":"^2.3.11","@types/json-schema":"^7.0.15","@arethetypeswrong/cli":"^0.18.2","@total-typescript/tsconfig":"^1.0.4"},"_npmOperationalInternal":{"tmp":"tmp/ai-assert-schema_1.0.1_1767975143103_0.9387779481699563","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"ai-assert-schema","version":"1.0.2","keywords":["ai","schema","validation","zod","json-schema","openai","structured-output","standard-schema"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-assert-schema@1.0.2","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-assert-schema#readme","bugs":{"url":"https://github.com/zirkelc/ai-assert-schema/issues"},"dist":{"shasum":"0009f9271ef3145100c4186089d8480d44938b7e","tarball":"https://registry.npmjs.org/ai-assert-schema/-/ai-assert-schema-1.0.2.tgz","fileCount":5,"integrity":"sha512-rGa6HqDtgwvqQo1xi4XMD0a54bGvgJzW3vKqhEd94ZeWIiZr3gyexiW8Gw46OM61UFJW/cnTV3SEGhd/REdcrA==","signatures":[{"sig":"MEQCICSGnlqQn30MR2cgtKnwG40esGsb8fYuSJhbykOGfIpwAiBwrhJwb44hW9nx3w4Gv5xzul6yZRQqX0VezGprhkX+jQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34839},"type":"module","_from":"file:ai-assert-schema-1.0.2.tgz","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./package.json":"./package.json"},"scripts":{"lint":"biome check . --write","test":"vitest","build":"tsdown"},"_npmUser":{"name":"chriszirkel","email":"chris.zirkel@gmail.com"},"_resolved":"/private/var/folders/_y/_4h8lsmx5053g1g2x562lt0m0000gn/T/999bf6d13d39b7ce15a058fa5bc4dd76/ai-assert-schema-1.0.2.tgz","_integrity":"sha512-rGa6HqDtgwvqQo1xi4XMD0a54bGvgJzW3vKqhEd94ZeWIiZr3gyexiW8Gw46OM61UFJW/cnTV3SEGhd/REdcrA==","repository":{"url":"git+https://github.com/zirkelc/ai-assert-schema.git","type":"git"},"_npmVersion":"11.6.2","description":"Assert schemas for compatibility against your AI models","directories":{},"_nodeVersion":"24.11.1","dependencies":{"@standard-schema/spec":"^1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.24","tsx":"^4.21.0","zod":"^4.3.5","chalk":"^5.6.2","husky":"^9.1.7","tsdown":"0.19.0-beta.5","vitest":"^4.0.16","publint":"^0.3.16","pkg-pr-new":"^0.0.62","typescript":"^5.9.3","@types/node":"^25.0.3","@ai-sdk/openai":"^3.0.7","@biomejs/biome":"^2.3.11","@types/json-schema":"^7.0.15","@arethetypeswrong/cli":"^0.18.2","@total-typescript/tsconfig":"^1.0.4"},"_npmOperationalInternal":{"tmp":"tmp/ai-assert-schema_1.0.2_1767975715126_0.5722630292307356","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"ai-assert-schema","version":"1.0.3","keywords":["ai","schema","validation","zod","json-schema","openai","structured-output","standard-schema"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-assert-schema@1.0.3","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-assert-schema#readme","bugs":{"url":"https://github.com/zirkelc/ai-assert-schema/issues"},"dist":{"shasum":"9d6e4533360379dfddf9dc36f060fbee28e0265f","tarball":"https://registry.npmjs.org/ai-assert-schema/-/ai-assert-schema-1.0.3.tgz","fileCount":5,"integrity":"sha512-q1lEI3t+Ov5SdB/2prBIAjwflPs48tj6IVfjC9fL6smYyUol3xm+6EbTTTtTIeXGksnxAlGFS++mkyYeq7iXMg==","signatures":[{"sig":"MEYCIQDxq45i7SWCdlf9gFiRuk11ql0eSl3ngqRI2yqSh7lccAIhAK4w+BZ8C7KBzxX4vC9hy8WAimjy/bzaiuMrlJSes1a2","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ai-assert-schema@1.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":35004},"type":"module","_from":"file:ai-assert-schema-1.0.3.tgz","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./package.json":"./package.json"},"scripts":{"lint":"biome check . --write","test":"vitest","build":"tsdown"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e7493b2e-5499-4194-9d93-08623a2aa395"}},"_resolved":"/tmp/6364e4944a1213830e0ca349184006d6/ai-assert-schema-1.0.3.tgz","_integrity":"sha512-q1lEI3t+Ov5SdB/2prBIAjwflPs48tj6IVfjC9fL6smYyUol3xm+6EbTTTtTIeXGksnxAlGFS++mkyYeq7iXMg==","repository":{"url":"git+https://github.com/zirkelc/ai-assert-schema.git","type":"git"},"_npmVersion":"11.6.2","description":"Assert schemas for compatibility against your AI models","directories":{},"_nodeVersion":"24.12.0","dependencies":{"@standard-schema/spec":"^1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.24","tsx":"^4.21.0","zod":"^4.3.5","chalk":"^5.6.2","husky":"^9.1.7","tsdown":"0.19.0-beta.5","vitest":"^4.0.16","publint":"^0.3.16","pkg-pr-new":"^0.0.62","typescript":"^5.9.3","@types/node":"^25.0.3","@ai-sdk/openai":"^3.0.7","@biomejs/biome":"^2.3.11","@types/json-schema":"^7.0.15","@arethetypeswrong/cli":"^0.18.2","@total-typescript/tsconfig":"^1.0.4"},"_npmOperationalInternal":{"tmp":"tmp/ai-assert-schema_1.0.3_1768046324693_0.0938084439820952","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"ai-assert-schema","version":"1.1.0","keywords":["ai","schema","validation","zod","json-schema","openai","structured-output","standard-schema"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-assert-schema@1.1.0","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-assert-schema#readme","bugs":{"url":"https://github.com/zirkelc/ai-assert-schema/issues"},"dist":{"shasum":"9197a4cc2cb7ac42811081bf26baa0870a37fca5","tarball":"https://registry.npmjs.org/ai-assert-schema/-/ai-assert-schema-1.1.0.tgz","fileCount":9,"integrity":"sha512-lkHdc3TJ3GPWTxRZlAwlibaXeFenZt8XTFTv+X0eaEsfitC2Hm7VJp63sjHrxE+fbq9sSbcfHzPn3iaTEaZfmg==","signatures":[{"sig":"MEUCIQDFU2ebp7dTNzNQvTfRLqIwQUCB2B7c/IyfQg2gqS2hugIgFrXXmxP9r+adkTwlyQ4frGXqGl24vM958Lq04y0Ur6w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ai-assert-schema@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":48869},"type":"module","_from":"file:ai-assert-schema-1.1.0.tgz","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./package.json":"./package.json","./constraints/openai":"./dist/constraints/openai/index.mjs"},"scripts":{"lint":"biome check . --write","test":"vitest","build":"tsdown"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e7493b2e-5499-4194-9d93-08623a2aa395"}},"_resolved":"/tmp/7a9fa3fc0b2beef744bfdd763ccce2c2/ai-assert-schema-1.1.0.tgz","_integrity":"sha512-lkHdc3TJ3GPWTxRZlAwlibaXeFenZt8XTFTv+X0eaEsfitC2Hm7VJp63sjHrxE+fbq9sSbcfHzPn3iaTEaZfmg==","repository":{"url":"git+https://github.com/zirkelc/ai-assert-schema.git","type":"git"},"_npmVersion":"11.6.2","description":"Assert schemas for compatibility against your AI models","directories":{},"_nodeVersion":"24.12.0","dependencies":{"@standard-schema/spec":"^1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.24","tsx":"^4.21.0","zod":"^4.3.5","chalk":"^5.6.2","husky":"^9.1.7","tsdown":"0.19.0-beta.5","vitest":"^4.0.16","publint":"^0.3.16","pkg-pr-new":"^0.0.62","typescript":"^5.9.3","@types/node":"^25.0.3","@ai-sdk/openai":"^3.0.7","@biomejs/biome":"^2.3.11","@types/json-schema":"^7.0.15","@arethetypeswrong/cli":"^0.18.2","@total-typescript/tsconfig":"^1.0.4"},"_npmOperationalInternal":{"tmp":"tmp/ai-assert-schema_1.1.0_1768049919081_0.7621526538371954","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"ai-assert-schema","version":"1.2.0","keywords":["ai","schema","validation","zod","json-schema","openai","structured-output","standard-schema"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-assert-schema@1.2.0","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-assert-schema#readme","bugs":{"url":"https://github.com/zirkelc/ai-assert-schema/issues"},"dist":{"shasum":"3b5b31a26e6690da018d6993a133495268d9de4d","tarball":"https://registry.npmjs.org/ai-assert-schema/-/ai-assert-schema-1.2.0.tgz","fileCount":12,"integrity":"sha512-aRvXbj0TPHgfUAEx+p2ZMa+TLcYAGIooyqH0ZImOZtMHHE9vS5YsbDcspYzk8hGK4oF3nl3is9yYGhwia1kmug==","signatures":[{"sig":"MEQCIBjV48MpUwWLs+ySunY9Ycosuvnm/fNd6BlhKXYV0p7TAiAiSdXyaDhxEjKPbThFwukS/HCbLHOnlBthlOaM5vOHXw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ai-assert-schema@1.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":56771},"type":"module","_from":"file:ai-assert-schema-1.2.0.tgz","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./package.json":"./package.json","./constraints/openai":"./dist/constraints/openai/index.mjs","./constraints/anthropic":"./dist/constraints/anthropic/index.mjs"},"scripts":{"lint":"biome check . --write","test":"vitest","build":"tsdown"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e7493b2e-5499-4194-9d93-08623a2aa395"}},"_resolved":"/tmp/7eb37f9f551c45b96f5aa015a7654118/ai-assert-schema-1.2.0.tgz","_integrity":"sha512-aRvXbj0TPHgfUAEx+p2ZMa+TLcYAGIooyqH0ZImOZtMHHE9vS5YsbDcspYzk8hGK4oF3nl3is9yYGhwia1kmug==","repository":{"url":"git+https://github.com/zirkelc/ai-assert-schema.git","type":"git"},"_npmVersion":"11.6.2","description":"Assert schemas for compatibility against your AI models","directories":{},"_nodeVersion":"24.12.0","dependencies":{"@standard-schema/spec":"^1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.24","tsx":"^4.21.0","zod":"^4.3.5","chalk":"^5.6.2","husky":"^9.1.7","tsdown":"0.19.0-beta.5","vitest":"^4.0.16","publint":"^0.3.16","pkg-pr-new":"^0.0.62","typescript":"^5.9.3","@types/node":"^25.0.3","@ai-sdk/openai":"^3.0.7","@biomejs/biome":"^2.3.11","@types/json-schema":"^7.0.15","@arethetypeswrong/cli":"^0.18.2","@total-typescript/tsconfig":"^1.0.4"},"_npmOperationalInternal":{"tmp":"tmp/ai-assert-schema_1.2.0_1768139077525_0.3518905578786726","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"ai-assert-schema","version":"1.3.0","keywords":["ai","schema","validation","zod","json-schema","openai","structured-output","standard-schema"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-assert-schema@1.3.0","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-assert-schema#readme","bugs":{"url":"https://github.com/zirkelc/ai-assert-schema/issues"},"dist":{"shasum":"c3af74915b038c3c691d16e69a10d7a0514bdad3","tarball":"https://registry.npmjs.org/ai-assert-schema/-/ai-assert-schema-1.3.0.tgz","fileCount":12,"integrity":"sha512-8BKl4t094iVoWYEyNcwMjon12Nd7dE384W+dfIBSk2SeU/4oXkrQ+B5UQPzSablrvyIGCuSrOLXMJ7wp94iUZA==","signatures":[{"sig":"MEUCIQCD3Rnn1kc3It/7Tx1wYAfYBxOd/CG4Gi0MbrO5H4o1iQIgH4dgmK5fWISpP2OLmBxcMFq3bW/8EsIjyeppHRrBEI8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ai-assert-schema@1.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":58741},"type":"module","_from":"file:ai-assert-schema-1.3.0.tgz","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./package.json":"./package.json","./constraints/openai":"./dist/constraints/openai/index.mjs","./constraints/anthropic":"./dist/constraints/anthropic/index.mjs"},"scripts":{"lint":"biome check . --write","test":"vitest","build":"tsdown"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e7493b2e-5499-4194-9d93-08623a2aa395"}},"_resolved":"/tmp/a053ec78cc2f24814070ff215b48b132/ai-assert-schema-1.3.0.tgz","_integrity":"sha512-8BKl4t094iVoWYEyNcwMjon12Nd7dE384W+dfIBSk2SeU/4oXkrQ+B5UQPzSablrvyIGCuSrOLXMJ7wp94iUZA==","repository":{"url":"git+https://github.com/zirkelc/ai-assert-schema.git","type":"git"},"_npmVersion":"11.6.2","description":"Assert schemas for compatibility against your AI models","directories":{},"_nodeVersion":"24.12.0","dependencies":{"@standard-schema/spec":"^1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.24","tsx":"^4.21.0","zod":"^4.3.5","chalk":"^5.6.2","husky":"^9.1.7","tsdown":"0.19.0-beta.5","vitest":"^4.0.16","publint":"^0.3.16","pkg-pr-new":"^0.0.62","typescript":"^5.9.3","@types/node":"^25.0.3","@ai-sdk/openai":"^3.0.7","@biomejs/biome":"^2.3.11","@types/json-schema":"^7.0.15","@arethetypeswrong/cli":"^0.18.2","@total-typescript/tsconfig":"^1.0.4"},"_npmOperationalInternal":{"tmp":"tmp/ai-assert-schema_1.3.0_1768201267572_0.8391207297635657","host":"s3://npm-registry-packages-npm-production"}},"1.4.0":{"name":"ai-assert-schema","version":"1.4.0","keywords":["ai","schema","validation","zod","json-schema","openai","structured-output","standard-schema"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-assert-schema@1.4.0","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-assert-schema#readme","bugs":{"url":"https://github.com/zirkelc/ai-assert-schema/issues"},"dist":{"shasum":"fc944069ada17d3865b76e5a4e7e95aff4274cb2","tarball":"https://registry.npmjs.org/ai-assert-schema/-/ai-assert-schema-1.4.0.tgz","fileCount":15,"integrity":"sha512-OhepX3VrGhx3RvauD+qZhZfYg4O+cBtdl0aEmzoAmOI5HpCeMgC2gblkWf5XYASKVZnIvzTr57xh2v9+tghSow==","signatures":[{"sig":"MEQCIAGz4ezRqUZfTae7MON+GNWv5GnsGTYvVq9sWadK1n+lAiAna962uKP/obvLFJmOb9VCEERonvE7FXdO7DwLQL6w/w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ai-assert-schema@1.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":65332},"type":"module","_from":"file:ai-assert-schema-1.4.0.tgz","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./package.json":"./package.json","./constraints/google":"./dist/constraints/google/index.mjs","./constraints/openai":"./dist/constraints/openai/index.mjs","./constraints/anthropic":"./dist/constraints/anthropic/index.mjs"},"scripts":{"lint":"biome check . --write","test":"vitest","build":"tsdown"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e7493b2e-5499-4194-9d93-08623a2aa395"}},"_resolved":"/tmp/270d9fec279e6a335c1f7f0f95ca4b58/ai-assert-schema-1.4.0.tgz","_integrity":"sha512-OhepX3VrGhx3RvauD+qZhZfYg4O+cBtdl0aEmzoAmOI5HpCeMgC2gblkWf5XYASKVZnIvzTr57xh2v9+tghSow==","repository":{"url":"git+https://github.com/zirkelc/ai-assert-schema.git","type":"git"},"_npmVersion":"11.6.2","description":"Assert schemas for compatibility against your AI models","directories":{},"_nodeVersion":"24.12.0","dependencies":{"@standard-schema/spec":"^1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.24","tsx":"^4.21.0","zod":"^4.3.5","chalk":"^5.6.2","husky":"^9.1.7","tsdown":"0.19.0-beta.5","vitest":"^4.0.16","publint":"^0.3.16","pkg-pr-new":"^0.0.62","typescript":"^5.9.3","@types/node":"^25.0.3","@ai-sdk/openai":"^3.0.7","@biomejs/biome":"^2.3.11","@types/json-schema":"^7.0.15","@arethetypeswrong/cli":"^0.18.2","@total-typescript/tsconfig":"^1.0.4"},"_npmOperationalInternal":{"tmp":"tmp/ai-assert-schema_1.4.0_1768382091342_0.34696651284192614","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"ai-assert-schema","version":"2.0.0","keywords":["ai","schema","validation","zod","json-schema","openai","structured-output","standard-schema"],"author":{"name":"Chris Cook"},"license":"MIT","_id":"ai-assert-schema@2.0.0","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"homepage":"https://github.com/zirkelc/ai-assert-schema#readme","bugs":{"url":"https://github.com/zirkelc/ai-assert-schema/issues"},"dist":{"shasum":"71cb20949f92de85e5a5f40f2dec9de6e62d6b29","tarball":"https://registry.npmjs.org/ai-assert-schema/-/ai-assert-schema-2.0.0.tgz","fileCount":15,"integrity":"sha512-wyGXUvLej6ENUuI/xY28ni1g8Np44kwiSOebc0AB/8/m98Ec8tk3KkAuWucmpDD3bdwYl9IeIOBxgwbDloroFQ==","signatures":[{"sig":"MEUCIHT5I0FwKdyDEfvBxcbtD3xUnd3eutPlczELW3puuiCRAiEAoQ/jocEqtuayWBupOza9vxWCLai3oiL1fRniPlaeXsU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ai-assert-schema@2.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":67346},"type":"module","_from":"file:ai-assert-schema-2.0.0.tgz","types":"./dist/index.d.mts","exports":{".":"./dist/index.mjs","./package.json":"./package.json","./constraints/google":"./dist/constraints/google/index.mjs","./constraints/openai":"./dist/constraints/openai/index.mjs","./constraints/anthropic":"./dist/constraints/anthropic/index.mjs"},"scripts":{"lint":"biome check . --write","test":"vitest","build":"tsdown"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e7493b2e-5499-4194-9d93-08623a2aa395"}},"_resolved":"/tmp/1b07c2ef067425d68ac0a7f41527eebb/ai-assert-schema-2.0.0.tgz","_integrity":"sha512-wyGXUvLej6ENUuI/xY28ni1g8Np44kwiSOebc0AB/8/m98Ec8tk3KkAuWucmpDD3bdwYl9IeIOBxgwbDloroFQ==","repository":{"url":"git+https://github.com/zirkelc/ai-assert-schema.git","type":"git"},"_npmVersion":"11.9.0","description":"Assert schemas for compatibility against your AI models","directories":{},"_nodeVersion":"24.14.0","dependencies":{"@standard-schema/spec":"^1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.24","tsx":"^4.21.0","zod":"^4.3.5","chalk":"^5.6.2","husky":"^9.1.7","tsdown":"0.19.0-beta.5","vitest":"^4.0.16","publint":"^0.3.16","pkg-pr-new":"^0.0.62","typescript":"^5.9.3","@types/node":"^25.0.3","@ai-sdk/openai":"^3.0.7","@biomejs/biome":"^2.3.11","@types/json-schema":"^7.0.15","@arethetypeswrong/cli":"^0.18.2","@total-typescript/tsconfig":"^1.0.4"},"_npmOperationalInternal":{"tmp":"tmp/ai-assert-schema_2.0.0_1772794116911_0.04499026629895475","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"_id":"ai-assert-schema@2.0.1","bugs":{"url":"https://github.com/zirkelc/ai-assert-schema/issues"},"dist":{"shasum":"add6eed49ec368648992528c1979c24a495ef896","tarball":"https://registry.npmjs.org/ai-assert-schema/-/ai-assert-schema-2.0.1.tgz","fileCount":15,"integrity":"sha512-jFogYaBdb3olyyfQgUwOmF/7zkQIbv6TrQ3bXsYc3yYnhZwCDee4Q0G9qBnXFMgUV363cN7AKmlRzzfRjVdYPw==","signatures":[{"sig":"MEYCIQCK0G0Bs+r3ZPqzp2amTvGCPYlLs0DlIQk3MQEdJrP5JgIhAJ3obBddbmv7sJvCKFrtr05Zyu5u+Gqrp6B03MjZninu","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDHNNK/+ZXaMbYZuuU3zzTMmfwRCqRYhNqZid6chNzT6AiBkwkePCVOuV3KU3ZBLf67wPsi3p9oH5JtIdS+sfQsrsA=="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ai-assert-schema@2.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":69170},"name":"ai-assert-schema","type":"module","_from":"file:ai-assert-schema-2.0.1.tgz","types":"./dist/index.d.mts","author":{"name":"Chris Cook"},"exports":{".":"./dist/index.mjs","./package.json":"./package.json","./constraints/google":"./dist/constraints/google/index.mjs","./constraints/openai":"./dist/constraints/openai/index.mjs","./constraints/anthropic":"./dist/constraints/anthropic/index.mjs"},"license":"MIT","scripts":{"lint":"oxlint --fix --quiet","test":"vitest","build":"tsdown","format":"oxfmt","lint:ci":"oxlint --format=github","format:ci":"oxfmt --check"},"version":"2.0.1","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e7493b2e-5499-4194-9d93-08623a2aa395"}},"homepage":"https://github.com/zirkelc/ai-assert-schema#readme","keywords":["ai","json-schema","openai","schema","standard-schema","structured-output","validation","zod"],"_resolved":"/tmp/98884ce8932c5000ce59cdf1fe4a16b2/ai-assert-schema-2.0.1.tgz","_integrity":"sha512-jFogYaBdb3olyyfQgUwOmF/7zkQIbv6TrQ3bXsYc3yYnhZwCDee4Q0G9qBnXFMgUV363cN7AKmlRzzfRjVdYPw==","repository":{"url":"git+https://github.com/zirkelc/ai-assert-schema.git","type":"git"},"_npmVersion":"11.19.0","description":"Assert schemas for compatibility against your AI models","directories":{},"lint-staged":{"*":"pnpm run format --no-error-on-unmatched-pattern","*.{js,jsx,ts,tsx,mjs,cjs}":"pnpm run lint"},"maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"_nodeVersion":"24.20.0","dependencies":{"@standard-schema/spec":"^1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.24","tsx":"^4.21.0","zod":"^4.3.5","chalk":"^5.6.2","husky":"^9.1.7","oxfmt":"^0.41.0","oxlint":"^1.56.0","tsdown":"0.19.0-beta.5","vitest":"^4.0.16","publint":"^0.3.16","pkg-pr-new":"^0.0.62","typescript":"^5.9.3","@types/node":"^25.0.3","lint-staged":"^16.4.0","@ai-sdk/openai":"^3.0.7","@types/json-schema":"^7.0.15","@arethetypeswrong/cli":"^0.18.2","@total-typescript/tsconfig":"^1.0.4"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ai-assert-schema_2.0.1_1789723227731_0.7641665230982189"}}},"time":{"created":"2026-01-09T15:42:37.473Z","modified":"2026-09-18T09:20:28.187Z","1.0.0":"2026-01-09T15:42:37.648Z","1.0.1":"2026-01-09T16:12:23.287Z","1.0.2":"2026-01-09T16:21:55.257Z","1.0.3":"2026-01-10T11:58:44.858Z","1.1.0":"2026-01-10T12:58:39.233Z","1.2.0":"2026-01-11T13:44:37.681Z","1.3.0":"2026-01-12T07:01:07.724Z","1.4.0":"2026-01-14T09:14:51.491Z","2.0.0":"2026-03-06T10:48:37.071Z","2.0.1":"2026-09-18T09:20:27.832Z"},"bugs":{"url":"https://github.com/zirkelc/ai-assert-schema/issues"},"author":{"name":"Chris Cook"},"license":"MIT","homepage":"https://github.com/zirkelc/ai-assert-schema#readme","keywords":["ai","json-schema","openai","schema","standard-schema","structured-output","validation","zod"],"repository":{"url":"git+https://github.com/zirkelc/ai-assert-schema.git","type":"git"},"description":"Assert schemas for compatibility against your AI models","maintainers":[{"name":"chriszirkel","email":"chris.zirkel@gmail.com"}],"readme":"<div align='center'>\n\n# ai-assert-schema\n\n<p align=\"center\">Assert schemas for compatibility against your AI models</p>\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/ai-assert-schema\" alt=\"ai-assert-schema\"><img src=\"https://img.shields.io/npm/dt/ai-assert-schema?label=ai-assert-schema\"></a> <a href=\"https://github.com/zirkelc/ai-assert-schema/actions/workflows/ci.yml\" alt=\"CI\"><img src=\"https://img.shields.io/github/actions/workflow/status/zirkelc/ai-assert-schema/ci.yml?branch=main\"></a>\n</p>\n\n</div>\n\n## Why?\n\nAI providers like OpenAI only support a [subset of JSON Schema](https://developers.openai.com/api/docs/guides/structured-outputs#supported-schemas) for structured outputs and tool calling. If you use unsupported features, you may get invalid data not matching your schema or an error at runtime. This library validates your schemas against the constraints of your chosen AI model, so you can catch issues early and transparently.\n\n### Examples\n\nTwo typical examples of unsupported JSON schema features are optional properties and discriminated unions.\n\n> [!TIP] \n> The following examples use Zod for schema definitions, but the same concepts apply to other JSON Schema libraries or raw JSON Schema objects.\n\n**Optional vs Nullable**\n\nUsing `z.optional()` removes the property from the `required` array, which is **not supported** by OpenAI. Use `z.nullable()` instead, which keeps the property required but allows `null` as a valid type.\n\n```typescript\nz.object({\n  optional: z.string().optional(),\n  nullable: z.string().nullable(),\n});\n```\n\n```jsonc\n{\n  \"properties\": {\n    \"optional\": { \"type\": \"string\" },\n    \"nullable\": { \"type\": [\"string\", \"null\"] }\n  },\n  \"required\": [\"nullable\"] // 'optional' is not required, 'nullable' is required\n}\n```\n\n**Discriminated Union vs Union**\n\nDiscriminated unions created with `z.discriminatedUnion()` convert to `oneOf` in JSON Schema, which is **not supported** by OpenAI. Use `z.union()` instead, which converts to `anyOf` and is supported.\n\n```typescript\nconst Dog = z.object({ type: z.literal('dog'), bark: z.boolean() });\nconst Cat = z.object({ type: z.literal('cat'), meow: z.boolean() });\n\nz.object({\n  discriminatedUnion: z.discriminatedUnion('type', [Dog, Cat]),\n  union: z.union([Dog, Cat]),\n});\n```\n\n```jsonc\n{\n  \"properties\": {\n    \"discriminatedUnion\": {\n      // 'oneOf' is not supported by OpenAI \n      \"oneOf\": [{ \"type\": \"object\", ... }, { \"type\": \"object\", ... }]\n    },\n    \"union\": {\n      // 'anyOf' is supported by OpenAI\n      \"anyOf\": [{ \"type\": \"object\", ... }, { \"type\": \"object\", ... }]\n    }\n  }\n}\n```\n\n## Installation\n\n```bash\nnpm install ai-assert-schema\n```\n\n## Usage\n\nThis library works with any [Standard JSON Schema](https://standardschema.dev/json-schema) library (Zod, ArkType, Valibot) or raw JSON Schema objects. It can be used at run-time or test-time in your unit tests.\n\n```typescript\nimport { assertSchema } from 'ai-assert-schema';\nimport { z } from 'zod';\n\nconst Dog = z.object({ type: z.literal('dog'), bark: z.boolean() });\nconst Cat = z.object({ type: z.literal('cat'), meow: z.boolean() });\n\nconst validSchema = z.object({\n  // Nullable is allowed\n  name: z.string().nullable(),\n  // z.union() produces anyOf\n  animal: z.union([Dog, Cat]),\n});\n\nconst invalidSchema = z.object({\n  // Optional is not allowed\n  name: z.string().optional(),\n  // z.discriminatedUnion() produces oneOf\n  animal: z.discriminatedUnion('type', [Dog, Cat]),\n});\n\n// Returns the schema if valid\nassertSchema({ schema: validSchema, model: 'openai/gpt-4o-mini' });\nassertSchema({ schema: validSchema, model: { provider: 'openai', modelId: 'gpt-4o-mini' } });\n\n// Throws an error if invalid\nassertSchema({ schema: invalidSchema, model: 'openai/gpt-4o-mini' });\nassertSchema({ schema: invalidSchema, model: { provider: 'openai', modelId: 'gpt-4o-mini' } });\n```\n\n### Assert at Run-time\n\nWrap your schema and model with `assertSchema({ schema, model })`. If the schema is valid, it will be returned unchanged. Otherwise, an error will be thrown before making the API call.\n\n> [!TIP] \n> This example uses the [AI SDK](https://www.npmjs.com/package/ai) to pass the model, but you can also provide a string or plain object.\n\n```typescript\nimport { openai } from '@ai-sdk/openai';\nimport { generateText, Output } from 'ai';\nimport { assertSchema } from 'ai-assert-schema';\nimport { z } from 'zod';\n\nconst model = openai('gpt-4o-mini');\n\nconst result = await generateText({\n  model,\n  prompt: 'Describe a dog that barks',\n  output: Output.object({\n    schema: assertSchema({ schema, model }),\n  }),\n});\n```\n\n### Assert at Test-time\n\nValidate schemas in your test suite to catch issues during CI:\n\n```typescript\nimport { expect, test } from 'vitest';\nimport { assertSchema } from 'ai-assert-schema';\n\n// Import your schema and model to test\nimport { yourSchema, yourModel } from './your-schema-file';\n\ntest('schema should be compatible with the model', () => {\n  expect(() =>\n    assertSchema({ schema: yourSchema, model: yourModel })\n  ).not.toThrow();\n});\n```\n\n### Validate without Throwing\n\nUse `assertSchema.validate()` to check schema compatibility without throwing an error:\n\n```typescript\nimport { assertSchema } from 'ai-assert-schema';\n\nconst result = assertSchema.validate({\n  schema: mySchema,\n  model: 'openai/gpt-4o',\n});\n\nif (!result.success) {\n  // List compatibility issues for each model\n  console.warn('Schema has compatibility issues:');\n  for (const model of result.models) {\n    console.warn(`${model.provider}/${model.modelId}:`);\n\n    for (const issue of model.issues) {\n      console.warn(`- ${issue.message}`);\n    }\n  }\n\n  // Or create a SchemaAssertionError for automatic error formatting\n  console.error(new SchemaAssertionError(result));\n}\n```\n\n### Multi-Model Validation\n\nValidate a schema against multiple AI providers at once by passing an array of models:\n\n```typescript\nimport { assertSchema } from 'ai-assert-schema';\nimport { z } from 'zod';\n\nconst schema = z.object({\n  name: z.string(),\n  age: z.number().min(0).max(150),\n  nickname: z.string().optional(),\n}).strict();\n\ntry {\n  assertSchema({\n    schema,\n    model: ['openai/gpt-4o', 'anthropic/claude-sonnet-4-20250514'],\n  });\n} catch (error) {\n  console.error(error.message);\n}\n```\n\nWhen validation fails, the error message lists each model with its specific issues:\n\n```\nThe schema contains unsupported components:\n- openai/gpt-4o (1 issue):\n  1. optionalProperties\n- anthropic/claude-sonnet-4-20250514 (2 issues):\n  1. minimum at \"properties.age\"\n  2. maximum at \"properties.age\"\n```\n\n### Inline Constraints\n\nPass constraints directly instead of relying on the provider registry:\n\n```typescript\nimport { assertSchema } from 'ai-assert-schema';\nimport { openaiConstraints } from 'ai-assert-schema/constraints/openai';\n\n// Use OpenAI constraints with a custom or unknown provider\nassertSchema({\n  schema: mySchema,\n  model: 'my-custom-provider/model',\n  constraints: openaiConstraints,\n});\n```\n\n## Providers\n\nCurrently supported providers: OpenAI, Anthropic, Google.\n\n### Register Custom Providers\n\nRegister custom providers using `assertSchema.registry`:\n\n```typescript\nimport { assertSchema } from 'ai-assert-schema';\n\n// Register constraints for a custom provider\nassertSchema.registry.register({\n  // Matching 'my-provider/*' models\n  pattern: /^my-provider\\/.+$/,\n  constraints: {\n    provider: 'my-provider',\n    unsupported: [\n      { feature: 'anyOf', message: 'anyOf is not supported' },\n      { feature: 'oneOf', message: 'oneOf is not supported' },\n    ],\n  },\n});\n\n// Now assertSchema will use these constraints for matching models\nassertSchema({\n  schema: mySchema,\n  model: 'my-provider/my-model',\n});\n```\n\n#### Provider Aliases\n\nYou can also register aliases that reference built-in providers (`'openai'`, `'anthropic'`, or `'google'`) instead of providing full constraints:\n\n```typescript\nimport { assertSchema } from 'ai-assert-schema';\n\n// Register an alias that uses OpenAI constraints\nassertSchema.registry.register({\n  pattern: /^my-openai-compatible\\/.+$/,\n  provider: 'openai',  // Uses built-in OpenAI constraints\n});\n\n// Register an alias that uses Anthropic constraints\nassertSchema.registry.register({\n  pattern: /^my-anthropic-compatible\\/.+$/,\n  provider: 'anthropic',  // Uses built-in Anthropic constraints\n});\n```\n\n#### Pattern Matching\n\nPatterns can be strings or regular expressions. The registry will always match exact strings first, then iterate over all regex patterns with later registrations taking precedence over earlier ones.\n\n```typescript\nimport { assertSchema } from 'ai-assert-schema';\n\nassertSchema.registry.register({\n  // Exact match for 'anthropic/claude-4'\n  pattern: 'anthropic/claude-4',\n  constraints: {},\n});\n\nassertSchema.registry.register({\n  // Matching all 'anthropic/*' models\n  pattern: /anthropic\\/.+$/,\n  constraints: {},\n});\n\n// Matches exact string first\nassertSchema({\n  schema: mySchema,\n  model: 'anthropic/claude-4',\n});\n```\n\n### OpenAI\n\nThe built-in registry resolves OpenAI models using the following patterns:\n\n- `'openai/*'`\n- `'openai.chat/*'`\n- `'openai.responses/*'`\n\n#### Constraints\n\nOpenAI's Structured Outputs have specific [JSON Schema constraints](https://developers.openai.com/api/docs/guides/structured-outputs#supported-schemas). See the full constraint implementation in [`src/constraints/openai/openai.ts`](src/constraints/openai/openai.ts).\n\n> [!WARNING] \n> The constraints were implemented following the official documentation. If you find any discrepancies with actual behavior, please open an issue.\n\n**Unsupported JSON Schema features:**\n- `oneOf`\n- `allOf`\n- `not`\n- `anyOf` at root level\n- `if/then/else` conditionals\n- `dependentRequired`, `dependentSchemas`\n- `patternProperties`\n- `minLength`, `maxLength` (string constraints)\n\n**Required constraints:**\n- All properties must be required\n- Must use `additionalProperties: false`\n\n##### Register OpenAI-Compatible Providers\n\n```typescript\nimport { assertSchema } from 'ai-assert-schema';\n\nassertSchema.registry.register({\n  // Match your custom provider\n  pattern: 'my-provider/openai-compatible',\n  // Use built-in OpenAI constraints\n  provider: 'openai',\n});\n```\n\n### Azure OpenAI\n\nAzure OpenAI uses the same constraints as OpenAI. The built-in registry resolves Azure models using the following patterns:\n\n- `'azure/*openai*'`\n- `'azure.chat/*openai*'`\n- `'azure.responses/*openai*'`\n\nIf your deployment names do not follow this pattern, you can register custom patterns using `assertSchema.registry.register()`:\n\n```typescript\nimport { assertSchema } from 'ai-assert-schema';\n\nassertSchema.registry.register({\n  // Match your custom Azure deployment name\n  pattern: 'azure/my-deployment-name',\n  // Use built-in OpenAI constraints\n  provider: 'openai',\n});\n```\n\n### Anthropic\n\nThe built-in registry resolves Anthropic models using the following patterns:\n\n- `'anthropic/*'`\n- `'anthropic.messages/*'`\n\n#### Constraints\n\nAnthropic's Structured Outputs have specific [JSON Schema constraints](https://platform.claude.com/docs/en/build-with-claude/structured-outputs#json-schema-limitations). See the full constraint implementation in [`src/constraints/anthropic/anthropic.ts`](src/constraints/anthropic/anthropic.ts).\n\n> [!WARNING] \n> The constraints were implemented following the official documentation. If you find any discrepancies with actual behavior, please open an issue.\n\n**Unsupported JSON Schema features:**\n- Recursive schemas\n- Numerical constraints (`minimum`, `maximum`, `exclusiveMinimum`, `exclusiveMaximum`, `multipleOf`)\n- String constraints (`minLength`, `maxLength`)\n- Array constraints (`maxItems`, `uniqueItems`, `contains`, `minItems` > 1)\n\n**Required constraints:**\n- Must use `additionalProperties: false`\n\n##### Register Anthropic-Compatible Providers\n\n```typescript\nimport { assertSchema } from 'ai-assert-schema';\n\nassertSchema.registry.register({\n  // Match your custom provider\n  pattern: 'my-provider/claude-compatible',\n  // Use built-in Anthropic constraints\n  provider: 'anthropic',\n});\n```\n\n### Google\n\nThe built-in registry resolves Google models using the following patterns:\n\n- `'google.generative-ai/*'`\n- `'google.vertex.chat/*'`\n- `'google.vertex/*'`\n\n#### Constraints\n\nGoogle Gemini's Structured Outputs (Gemini 2.0+) have specific [JSON Schema constraints](https://ai.google.dev/gemini-api/docs/structured-output#json_schema_support). See the full constraint implementation in [`src/constraints/google/google.ts`](src/constraints/google/google.ts).\n\n> [!WARNING] \n> The constraints were implemented following the official documentation. If you find any discrepancies with actual behavior, please open an issue.\n\n**Unsupported JSON Schema features:**\n- `oneOf`\n- `allOf`\n- `not`\n- `if/then/else` conditionals\n- `pattern`, `minLength`, `maxLength` (string constraints)\n- `exclusiveMinimum`, `exclusiveMaximum`, `multipleOf` (numerical constraints)\n- `dependentRequired`, `dependentSchemas`\n- `patternProperties`, `propertyNames`\n- `uniqueItems`, `contains`, `additionalItems` (array constraints)\n- Recursive schemas\n\n##### Register Google-Compatible Providers\n\n```typescript\nimport { assertSchema } from 'ai-assert-schema';\n\nassertSchema.registry.register({\n  // Match your custom provider\n  pattern: 'my-provider/google-compatible',\n  // Use built-in Google constraints\n  provider: 'google',\n});\n```\n\n## Contributing\n\nContributions are welcome!\n\n- **Add new providers**: Submit a PR with constraints for other AI providers\n- **Fix constraints**: If you find incorrect constraints, please open an issue or PR\n- **Provider implementations**: See [`src/constraints/openai/`](src/constraints/openai/) for examples\n\n## API\n\n### `assertSchema(options)`\n\n```typescript\nfunction assertSchema<SCHEMA extends SchemaInput>(\n  options: AssertSchemaOptions<SCHEMA>\n): SCHEMA\n```\n\n**Parameters:**\n- `model` - Model identifier as `'provider/model-id'` string, `{ provider, modelId }` object, or an array of either\n- `schema` - Your schema (Zod, Standard Schema, or JSON Schema object)\n- `constraints` - (optional) Custom constraints to use instead of looking up from registry\n\n**Returns:** The input schema unchanged (for chaining)\n\n**Throws:** `SchemaAssertionError` when the schema contains unsupported features\n\n### `assertSchema.validate(options)`\n\nSame parameters as `assertSchema`, but returns a result object instead of throwing:\n\n```typescript\ninterface SchemaValidationResult {\n  success: boolean;\n  models: Array<{\n    modelId: string;\n    provider: string;\n    issues: ValidationIssue[];\n    jsonSchema: JSONSchema;\n  }>;\n}\n```\n\n### `assertSchema.registry`\n\nThe provider registry for registering custom constraints:\n\n- `register({ pattern, provider })` - Register a pattern using built-in provider constraints (`'openai'` or `'anthropic'`)\n- `register({ pattern, constraints })` - Register a pattern with custom constraints\n- `resolve(model)` - Resolve constraints for a model\n- `getAll()` - Get all registered patterns with their resolved constraints\n\n## License\n\nMIT\n","readmeFilename":"README.md"}