{"_id":"@ascendance-hub/sapphire-json-schema","_rev":"8-5b62a73f83128d010e10b36a0477cc69","name":"@ascendance-hub/sapphire-json-schema","dist-tags":{"latest":"1.2.0","preview":"0.0.0-preview-20260531194731"},"versions":{"1.0.0":{"name":"@ascendance-hub/sapphire-json-schema","version":"1.0.0","keywords":["typescript","schema","json-schema","mcp","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","_id":"@ascendance-hub/sapphire-json-schema@1.0.0","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"dist":{"shasum":"2d7d6b75d00111b7ff90057f929fe4c8a5a6ccb1","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-json-schema/-/sapphire-json-schema-1.0.0.tgz","fileCount":7,"integrity":"sha512-TLDMJOwLwA1JFMBxv/kNVmRE97qczSZDUwBcpljuVWeQMipGLXd39ooFZ/909+UtIbOILDKuA50LExf3MUy0/Q==","signatures":[{"sig":"MEYCIQCiT/HYKxGFgOWFI7Q7Nk/K7RFTB4/bz84gH2jvCihSuQIhAJcf2CCoiJbuVtkC0yPP369hTJRsGzW9l3A1XBi+KF9V","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29979},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"7ca237cf34d7dbf4b6002e6eeb8f1948b5fa1401","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"repository":{"url":"git+https://github.com/Ascendance-Hub/Sapphire.git","type":"git","directory":"packages/json-schema"},"_npmVersion":"10.9.7","description":"JSON Schema 2020-12 adapter for Sapphire.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"ajv":"^8.17.1","@ascendance-hub/sapphire-core":"*"},"peerDependencies":{"@ascendance-hub/sapphire-core":">=1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sapphire-json-schema_1.0.0_1778967982146_0.6302196260631299","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-preview-20260518150854":{"name":"@ascendance-hub/sapphire-json-schema","version":"0.0.0-preview-20260518150854","keywords":["typescript","schema","json-schema","mcp","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","_id":"@ascendance-hub/sapphire-json-schema@0.0.0-preview-20260518150854","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"dist":{"shasum":"70cf66034d5797c7628b2f833e19fbbb4209d4a2","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-json-schema/-/sapphire-json-schema-0.0.0-preview-20260518150854.tgz","fileCount":7,"integrity":"sha512-OVHL1TPHh1nv6eCa0PRSetgwTdMint/aolZB74LckBZhfzVxPjrjdvVg3BILWN0K8EIo5HbK+zVVEw24Ae8M2g==","signatures":[{"sig":"MEQCIF25uYzJD6EdrYK7axWL5kvoO3fUpP3m6SyzrSIYi+ZlAiBoVX7F7TeOlK5eqtvOpf4CiFJUF/8ELrdtKmT8DsAoBw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30050},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"7b0ae9d5231c706543b59d36b56e9d7a73697dd8","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"repository":{"url":"git+https://github.com/Ascendance-Hub/Sapphire.git","type":"git","directory":"packages/json-schema"},"_npmVersion":"10.9.7","description":"JSON Schema 2020-12 adapter for Sapphire.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ajv":"^8.17.1","@ascendance-hub/sapphire-core":"0.0.0-preview-20260518150854"},"peerDependencies":{"@ascendance-hub/sapphire-core":"0.0.0-preview-20260518150854"},"_npmOperationalInternal":{"tmp":"tmp/sapphire-json-schema_0.0.0-preview-20260518150854_1779116938312_0.5661006007589289","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-preview-20260518153515":{"name":"@ascendance-hub/sapphire-json-schema","version":"0.0.0-preview-20260518153515","keywords":["typescript","schema","json-schema","mcp","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","_id":"@ascendance-hub/sapphire-json-schema@0.0.0-preview-20260518153515","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"dist":{"shasum":"a5c3d325f68e7ba24e46cab4bbb045a0f896a5aa","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-json-schema/-/sapphire-json-schema-0.0.0-preview-20260518153515.tgz","fileCount":7,"integrity":"sha512-/UVpd4j9SUOfELMQPbKjK7dkfht9lNmvNHm3tYZslb18hunhBFMvCxDnUG6feUROnoYCJG+lThjnrkATiix/ww==","signatures":[{"sig":"MEUCIQDALqE2qNh/raeQxkwhho7yrv+1jE9a5kZlsHTxreiNgAIgZvXtOa6uUVc/Bdh5vCIBXAZ/5ATyGRcz6vF470zvjYs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30050},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"7f07a1e46fe73ca49f03f7b373377b184481c0b2","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"repository":{"url":"git+https://github.com/Ascendance-Hub/Sapphire.git","type":"git","directory":"packages/json-schema"},"_npmVersion":"10.9.7","description":"JSON Schema 2020-12 adapter for Sapphire.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ajv":"^8.17.1","@ascendance-hub/sapphire-core":"0.0.0-preview-20260518153515"},"peerDependencies":{"@ascendance-hub/sapphire-core":"0.0.0-preview-20260518153515"},"_npmOperationalInternal":{"tmp":"tmp/sapphire-json-schema_0.0.0-preview-20260518153515_1779118519502_0.706390688993763","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@ascendance-hub/sapphire-json-schema","version":"1.1.0","keywords":["typescript","schema","json-schema","mcp","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","_id":"@ascendance-hub/sapphire-json-schema@1.1.0","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"dist":{"shasum":"a5c01da001cb89cc1c96be087cfc8bf64f8ae276","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-json-schema/-/sapphire-json-schema-1.1.0.tgz","fileCount":7,"integrity":"sha512-aEUr+I+qj8QGPQFD042TnYtVK7ilQw1oYJmWPtp5TbTj/MmjTpCuWhzzOFQYePx2wNFrB23ZQsuSQxRmkJXuQg==","signatures":[{"sig":"MEUCIQC0ESSqEYg4wqf+6VyziV+3zmIPQu/4u3FxNn5lNhA/iwIgVFoKt+IAU4wTxM179X0OxpK1xAp0k8FeYMHGXL6FOsE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29979},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"76178e21015fe89d02d149a06998178a2d956a3f","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"repository":{"url":"git+https://github.com/Ascendance-Hub/Sapphire.git","type":"git","directory":"packages/json-schema"},"_npmVersion":"10.9.7","description":"JSON Schema 2020-12 adapter for Sapphire.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"ajv":"^8.17.1","@ascendance-hub/sapphire-core":"*"},"peerDependencies":{"@ascendance-hub/sapphire-core":">=1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sapphire-json-schema_1.1.0_1779118573548_0.08736064043647707","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-preview-20260531184331":{"name":"@ascendance-hub/sapphire-json-schema","version":"0.0.0-preview-20260531184331","keywords":["typescript","schema","json-schema","mcp","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","_id":"@ascendance-hub/sapphire-json-schema@0.0.0-preview-20260531184331","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"dist":{"shasum":"6abaac14122994cff7d741eb69404ee175daf4ba","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-json-schema/-/sapphire-json-schema-0.0.0-preview-20260531184331.tgz","fileCount":7,"integrity":"sha512-yVvoH9iS1OhVQIDfj6iZTSo2emABU5Uf7lUnfDv9r1eKvsnfR0lePXmZ5x5p2SRHxEGeSLQTvRRDh/4NNfny7Q==","signatures":[{"sig":"MEYCIQDImpfifIVcrLJxOHLbvd4RrTQueYCcylMKSs+bKNDYoAIhAMcjuZxN7ZDsXT02iVc8lPKpMyOrLbOpSSt0PgqC2HZK","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30050},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"e8461b27236d5fc3b9b0810c610bc53c79e7e5fc","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"repository":{"url":"git+https://github.com/Ascendance-Hub/Sapphire.git","type":"git","directory":"packages/json-schema"},"_npmVersion":"10.9.8","description":"JSON Schema 2020-12 adapter for Sapphire.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ajv":"^8.17.1","@ascendance-hub/sapphire-core":"0.0.0-preview-20260531184331"},"peerDependencies":{"@ascendance-hub/sapphire-core":"0.0.0-preview-20260531184331"},"_npmOperationalInternal":{"tmp":"tmp/sapphire-json-schema_0.0.0-preview-20260531184331_1780253015131_0.2646744878204821","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-preview-20260531190529":{"name":"@ascendance-hub/sapphire-json-schema","version":"0.0.0-preview-20260531190529","keywords":["typescript","schema","json-schema","mcp","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","_id":"@ascendance-hub/sapphire-json-schema@0.0.0-preview-20260531190529","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"dist":{"shasum":"df4ff9f9af7e4d56dfdc6c93d2bfa45a4b8b7fe2","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-json-schema/-/sapphire-json-schema-0.0.0-preview-20260531190529.tgz","fileCount":7,"integrity":"sha512-TgW07+oCxgr7wdWDlbZ8uY/DojzGcXdb6/2TYJUjgzrFEDXwvWQMa6ghmDBKgYI305diCwIJmMwa3kMrxWoU9w==","signatures":[{"sig":"MEUCIQCaN8qGER3hxGZnCyGrR14joRsSOSydcbF8/eU47OwwVwIgecLRdRu+LUvk8xL5ViQEIkL4edvxhGuUsp09J0CAZVY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30050},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"8a9b61513b5f64c6449a6a061d9bb6e0ffe7c865","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"repository":{"url":"git+https://github.com/Ascendance-Hub/Sapphire.git","type":"git","directory":"packages/json-schema"},"_npmVersion":"10.9.8","description":"JSON Schema 2020-12 adapter for Sapphire.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ajv":"^8.17.1","@ascendance-hub/sapphire-core":"0.0.0-preview-20260531190529"},"peerDependencies":{"@ascendance-hub/sapphire-core":"0.0.0-preview-20260531190529"},"_npmOperationalInternal":{"tmp":"tmp/sapphire-json-schema_0.0.0-preview-20260531190529_1780254332866_0.06036146058818126","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-preview-20260531194731":{"name":"@ascendance-hub/sapphire-json-schema","version":"0.0.0-preview-20260531194731","keywords":["typescript","schema","json-schema","mcp","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","_id":"@ascendance-hub/sapphire-json-schema@0.0.0-preview-20260531194731","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"dist":{"shasum":"c4248f72e69295df5a6af860141e3a4586664621","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-json-schema/-/sapphire-json-schema-0.0.0-preview-20260531194731.tgz","fileCount":7,"integrity":"sha512-QYDsB6WhUL44o3OSC2j51UvDimuKXVrfXUOuzOVosnaJm+T4R9rqMMKbneCyB5bHEaVjeYvYTBoQ92ESAA+i8w==","signatures":[{"sig":"MEYCIQDs9XXKPRuPFpC6AC6eVcsrmHacBghSUoBqHG/NAwpNWwIhANOfySAtqeWQpFJU0MoLyRWM0w07SChhrc1k9loOb0Fp","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30050},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"dd7c2b94ce17eb7f2754a707b058e45e23baa1f9","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"repository":{"url":"git+https://github.com/Ascendance-Hub/Sapphire.git","type":"git","directory":"packages/json-schema"},"_npmVersion":"10.9.8","description":"JSON Schema 2020-12 adapter for Sapphire.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ajv":"^8.17.1","@ascendance-hub/sapphire-core":"0.0.0-preview-20260531194731"},"peerDependencies":{"@ascendance-hub/sapphire-core":"0.0.0-preview-20260531194731"},"_npmOperationalInternal":{"tmp":"tmp/sapphire-json-schema_0.0.0-preview-20260531194731_1780256854253_0.8721244614879278","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@ascendance-hub/sapphire-json-schema","version":"1.2.0","description":"JSON Schema 2020-12 adapter for Sapphire.","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"sideEffects":false,"scripts":{"build":"tsup","test":"vitest run","typecheck":"tsc --noEmit"},"peerDependencies":{"@ascendance-hub/sapphire-core":">=1.0.0"},"devDependencies":{"@ascendance-hub/sapphire-core":"*","ajv":"^8.17.1"},"repository":{"type":"git","url":"git+https://github.com/Ascendance-Hub/Sapphire.git","directory":"packages/json-schema"},"keywords":["typescript","schema","json-schema","mcp","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","publishConfig":{"access":"public"},"engines":{"node":">=20"},"bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","_id":"@ascendance-hub/sapphire-json-schema@1.2.0","gitHead":"c385975185892d170d5f003f45740273bfb29d15","_nodeVersion":"22.22.3","_npmVersion":"10.9.8","dist":{"integrity":"sha512-Xf+0vSoZdhKNhtvsLvAWUeIPqNo9jx19RoEIh50tdAZ/H8gj1yB7mpxNRU7BZDC/APkKUDBDHwyWlw8rQWY5/A==","shasum":"9932ef079701a81c3295fc7f15e5482566cf6a35","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-json-schema/-/sapphire-json-schema-1.2.0.tgz","fileCount":7,"unpackedSize":29979,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDVAzjPXrvmaNN/c3q0svhWc+asyo98Pq0AVB7KgkA2/gIhANkVnnX//BXvx1AJKED/8tzZLdzlD9p9mcB+rq7/Y5Ws"}]},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"directories":{},"maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sapphire-json-schema_1.2.0_1780257338476_0.15956041036758717"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-16T21:46:22.077Z","modified":"2026-05-31T19:55:38.716Z","1.0.0":"2026-05-16T21:46:22.263Z","0.0.0-preview-20260518150854":"2026-05-18T15:08:58.454Z","0.0.0-preview-20260518153515":"2026-05-18T15:35:19.645Z","1.1.0":"2026-05-18T15:36:13.700Z","0.0.0-preview-20260531184331":"2026-05-31T18:43:35.279Z","0.0.0-preview-20260531190529":"2026-05-31T19:05:33.001Z","0.0.0-preview-20260531194731":"2026-05-31T19:47:34.373Z","1.2.0":"2026-05-31T19:55:38.598Z"},"bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","keywords":["typescript","schema","json-schema","mcp","sapphire"],"repository":{"type":"git","url":"git+https://github.com/Ascendance-Hub/Sapphire.git","directory":"packages/json-schema"},"description":"JSON Schema 2020-12 adapter for Sapphire.","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"readme":"# @ascendance-hub/sapphire-json-schema\n\nJSON Schema 2020-12 adapter for [Sapphire](https://github.com/Ascendance-Hub/Sapphire). Converts a Sapphire IR (`SapphireSchemaNode`) into a JSON Schema object suitable for AJV, MCP tool input schemas, frontend form generators, and cross-language validators.\n\n## Install\n\n```bash\nnpm install @ascendance-hub/sapphire-core @ascendance-hub/sapphire-json-schema\n```\n\n`@ascendance-hub/sapphire-core` is a peer dependency. There are no other peer requirements — pick whichever JSON Schema validator you like (AJV, Hyperjump, browser-based, etc.).\n\n## Register the adapter\n\nThe adapter is **not auto-registered**. Call `registerAdapter` once in your application entry point:\n\n```ts\nimport { Sapphire, registerAdapter } from '@ascendance-hub/sapphire-core'\nimport { toJsonSchema } from '@ascendance-hub/sapphire-json-schema'\n\nregisterAdapter('json-schema', toJsonSchema)\n\nexport const a = new Sapphire({ defaultAdapter: 'json-schema' })\n```\n\n## Quickstart\n\n```ts\nimport Ajv2020 from 'ajv/dist/2020.js'\nimport { toJsonSchema } from '@ascendance-hub/sapphire-json-schema'\nimport { a } from './sapphire'\n\nconst CreateUser = a\n  .object({\n    name: a.string().min(1),\n    email: a.string().email(),\n    age: a.number().int().min(0).optional(),\n  })\n  .name('CreateUser')\n\nconst schema = toJsonSchema(CreateUser.toSchema(), {\n  $id: 'https://example.com/schemas/create-user',\n})\n\nconst ajv = new Ajv2020({ strict: false })\nconst validate = ajv.compile(schema)\nvalidate({ name: 'Ada', email: 'ada@example.com' }) // → true\n```\n\nThe output is a plain JSON Schema 2020-12 object. Use it as an MCP tool's `inputSchema`, feed it to `react-jsonschema-form`, or share it with a Python validator — same shape everywhere.\n\n## IR mapping table\n\n| IR `kind` | JSON Schema output                                         | Notes                                                                                                                                                                    |\n| --------- | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `string`  | `{ type: 'string', ... }`                                  | `format` (`email`/`uri`/`uuid`); Sapphire's `url` is emitted as `uri`. `startsWith`/`endsWith` become escaped `pattern`s; combined with `regex` they merge into `allOf`. |\n| `number`  | `{ type: 'number' \\| 'integer', ... }`                     | `int()` → `'integer'`. `min`/`max`/`exclusiveMin`/`exclusiveMax`/`multipleOf` map to JSON Schema keywords. `finite`/`safe` are no-ops (no JSON Schema equivalent).       |\n| `boolean` | `{ type: 'boolean' }`                                      | —                                                                                                                                                                        |\n| `date`    | `{ type: 'string', format: 'date-time' }`                  | `min`/`max` (Date) are no-ops; AJV requires `ajv-formats` to validate `date-time`.                                                                                       |\n| `object`  | `{ type: 'object', properties, required, ... }`            | `required` derived from `child.required === true`. Named objects emit a `$ref`; the body lives in top-level `$defs`.                                                     |\n| `array`   | `{ type: 'array', items, minItems, maxItems }`             | `nonempty()` → `minItems: 1`. `length(n)` → `minItems: maxItems: n`.                                                                                                     |\n| `tuple`   | `{ type: 'array', prefixItems, items: false, min/max }`    | 2020-12-only shape. Use `Ajv2020` for compilation.                                                                                                                       |\n| `union`   | `{ oneOf: [...] }`                                         | `oneOf` (exactly one) — semantically discriminated.                                                                                                                      |\n| `literal` | `{ const: value }`                                         | —                                                                                                                                                                        |\n| `enum`    | `{ type, enum: [...values] }`                              | `type` is `'string'` or `'number'` based on the values.                                                                                                                  |\n| `record`  | `{ type: 'object', additionalProperties, propertyNames? }` | `propertyNames` is emitted only when the key field carries real constraints.                                                                                             |\n| `ref`     | `{ $ref: '#/$defs/<target>' }`                             | Cyclic refs are supported natively in 2020-12.                                                                                                                           |\n\n### Schema-level\n\n- `ObjectField.timestamps()` and `ObjectField.index([...])` → no-op (database semantics, not validation).\n- `ObjectField.adapter('json-schema', { ... })` → see escape hatch.\n\n## `.adapter('json-schema', opts)` escape hatch\n\nAnything passed via `.adapter('json-schema', { ... })` is read from `meta['json-schema']` and merged onto the resulting schema (last-wins). Useful keys:\n\n| Key                    | Effect                                                                              |\n| ---------------------- | ----------------------------------------------------------------------------------- |\n| `format: 'ipv4'` etc.  | Custom format strings (require `ajv-formats` or equivalent to validate at runtime). |\n| `contentEncoding`      | Annotation for binary/base64 fields.                                                |\n| `additionalProperties` | Per-object override; pair with the global default in `JsonSchemaAdapterOptions`.    |\n| `examples`             | Annotation array surfaced by docs/UI generators.                                    |\n\n**Blacklist:** `type` and `$ref` cannot be overridden. They are always Sapphire-controlled.\n\n## `JsonSchemaAdapterOptions`\n\n| Option                 | Default | Effect                                                                              |\n| ---------------------- | ------- | ----------------------------------------------------------------------------------- |\n| `additionalProperties` | omitted | Default value emitted on every object schema. JSON Schema's spec default is `true`. |\n| `$id`                  | omitted | Top-level `$id`.                                                                    |\n| `defs`                 | `{}`    | Extra named schemas to include in `$defs` beyond what the walker auto-collects.     |\n| `emitSchemaUri`        | `true`  | Whether to emit `$schema: 'https://json-schema.org/draft/2020-12/schema'`.          |\n\n```ts\ntoJsonSchema(node, {\n  additionalProperties: false,\n  $id: 'https://example.com/schemas/user',\n  defs: { ExtraType: someNode },\n})\n```\n\n## Limitations\n\n- **`transforms`/`coerce` no-op.** JSON Schema is descriptive, not an engine. Apply transforms via core (`safeParse`) before persisting.\n- **`unique`/`index`/`timestamps`/composite indexes no-op.** These are database concerns, not validation.\n- **`nullable` rewrites `type` to a union** (`type: [<x>, 'null']`) for plain primitives, or `oneOf: [original, { type: 'null' }]` for composite/`$ref`/`enum`/`literal` cases.\n- **`name` characters are limited to `[A-Za-z0-9_-]+`.** JSON Pointer escaping for `/` and `~` is not performed; names with those characters throw at build time.\n- **`prefixItems` is 2020-12-only.** Compile tuples with `Ajv2020` (`ajv/dist/2020.js`); the default 8.x `Ajv` constructor uses draft-07 and will not understand them.\n- **`format` is annotation-only in AJV out-of-the-box.** Install `ajv-formats` if you want runtime checking of `email`/`uri`/`uuid`/`date-time` etc.\n- **`number.finite`/`number.safe` no-op.** No JSON Schema equivalent.\n- **Auto-register removed.** Call `registerAdapter('json-schema', toJsonSchema)` once in your entry point.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}