{"_id":"@1nder-labs/schemalint","_rev":"3-dff6789a70208213ff1fb8ba83857175","name":"@1nder-labs/schemalint","dist-tags":{"latest":"1.3.2"},"versions":{"1.0.1":{"name":"@1nder-labs/schemalint","version":"1.0.1","keywords":["json-schema","zod","openai","anthropic","structured-output","llm","schema","lint","validation","pydantic"],"author":{"name":"Lahfir"},"license":"MIT OR Apache-2.0","_id":"@1nder-labs/schemalint@1.0.1","maintainers":[{"name":"lahfir","email":"nmhlahfir2@gmail.com"}],"homepage":"https://1nder-labs.github.io/schemalint","bugs":{"url":"https://github.com/1nder-labs/schemalint/issues"},"bin":{"schemalint":"index.cjs"},"dist":{"shasum":"258f51bf35b34573e7d672db13a290fb615677d5","tarball":"https://registry.npmjs.org/@1nder-labs/schemalint/-/schemalint-1.0.1.tgz","fileCount":46,"integrity":"sha512-Ha4lY+LHemh3nDIv7nHT3r0j7BZIk0ieX0haTWcsydzEwjaNNrT1FunqOYs2aoZ8XGlOUZRoA7z6Fc0OyEPp/Q==","signatures":[{"sig":"MEYCIQC/5OGCkJJYTslXbWZQ6nr4Ynmkb1vIVFTIGFnQqetKMgIhAIhOGWNBnu25fviNKIYTNapJBPy8qYBHSRp15OQBZBvQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":124239},"type":"module","engines":{"node":">=18"},"gitHead":"f113c1e9bd54073a02c537d37a7b57e936d7e0f2","scripts":{"test":"vitest run","build":"tsc"},"_npmUser":{"name":"lahfir","email":"nmhlahfir2@gmail.com"},"repository":{"url":"git+https://github.com/1nder-labs/schemalint.git","type":"git","directory":"npm/schemalint"},"_npmVersion":"10.9.7","description":"Lint JSON Schema and Zod schemas before OpenAI or Anthropic structured-output APIs reject them.","directories":{},"_nodeVersion":"22.22.2","dependencies":{"picomatch":"^4.0.0","zod-to-json-schema":"^3.24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","zod":"^3.23.0","vitest":"^2.0.0","typescript":"^5.5.0","@types/node":"^25.6.0"},"peerDependencies":{"zod":">=3.20","typescript":">=4.9"},"peerDependenciesMeta":{"zod":{"optional":true},"typescript":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/schemalint_1.0.1_1782698564175_0.40792867066926375","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@1nder-labs/schemalint","version":"1.1.0","keywords":["json-schema","zod","openai","anthropic","structured-output","llm","schema","lint","validation","pydantic"],"author":{"name":"Lahfir"},"license":"MIT OR Apache-2.0","_id":"@1nder-labs/schemalint@1.1.0","maintainers":[{"name":"lahfir","email":"nmhlahfir2@gmail.com"}],"homepage":"https://1nder-labs.github.io/schemalint","bugs":{"url":"https://github.com/1nder-labs/schemalint/issues"},"bin":{"schemalint":"index.cjs"},"dist":{"shasum":"d4dbb060395ad2350479454d19df98b6d340d6d1","tarball":"https://registry.npmjs.org/@1nder-labs/schemalint/-/schemalint-1.1.0.tgz","fileCount":46,"integrity":"sha512-gJlzGgQlvaTx7Wi1SvdC9h2MCjDVXiDWzFMb9FQvwqgY0M7KzwaSfrTymGbkOmcIp2+C75/XVtIN2wQu4Hbp0g==","signatures":[{"sig":"MEUCIQCyo1Qq15IoQUbsWZq0JHyYB8SUEMFvZmPX27RxAsrp8QIgUIVJQZ3Gmx1FTYc98DfMUwIBysO8U2w5Zo0PZrfoTik=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@1nder-labs%2fschemalint@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":125633},"type":"module","engines":{"node":">=18"},"gitHead":"5c2ad30611e22fbe62cc9aedc7f878723de1beea","scripts":{"test":"vitest run","build":"tsc"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6b8b9fa0-1fcb-4967-ac66-7d3fe1bb4ccf"}},"repository":{"url":"git+https://github.com/1nder-labs/schemalint.git","type":"git","directory":"npm/schemalint"},"_npmVersion":"11.18.0","description":"Lint JSON Schema and Zod schemas before OpenAI or Anthropic structured-output APIs reject them.","directories":{},"_nodeVersion":"22.23.1","dependencies":{"picomatch":"^4.0.0","zod-to-json-schema":"^3.24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","zod":"^3.23.0","vitest":"^2.0.0","typescript":"^5.5.0","@types/node":"^25.6.0"},"peerDependencies":{"zod":">=3.20","typescript":">=4.9"},"peerDependenciesMeta":{"zod":{"optional":true},"typescript":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/schemalint_1.1.0_1783076303380_0.34722748401607384","host":"s3://npm-registry-packages-npm-production"}},"1.3.2":{"_id":"@1nder-labs/schemalint@1.3.2","bin":{"schemalint":"index.cjs"},"bugs":{"url":"https://github.com/1nder-labs/schemalint/issues"},"dist":{"shasum":"b48055acca6b96bdbc3ad690a06c2e1a92cb56b0","tarball":"https://registry.npmjs.org/@1nder-labs/schemalint/-/schemalint-1.3.2.tgz","fileCount":88,"integrity":"sha512-a7jFizYGfVBp+JZ12BP4KwZAhj2J294zH/n6EAPkUoYoyFoU+gO+TbSBf+Nwtzfu9fNyg0JIzTeJ3Ho2MMC48A==","signatures":[{"sig":"MEYCIQDmVPjISU78VQtBOfd25+1aPlDPcCVJBbp7f+FhymM/5AIhAIHHBR3zKjuGZZudd/jYAicmdNswD8IlFGNUu0zfWts3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCF4HhtAzOT5nqRcH4CwP82Oy31Xm4OLqGzCZ8N4tfRMgIhALD0fX1AsnXNdWcnzRc+IpjifaISO0vViyumAPjHmkjw"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@1nder-labs%2fschemalint@1.3.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":236993},"name":"@1nder-labs/schemalint","type":"module","_from":"file:release-bundle/1nder-labs-schemalint-1.3.2.tgz","author":{"name":"Lahfir"},"engines":{"node":">=18"},"license":"MIT OR Apache-2.0","scripts":{"test":"vitest run && npm run test:launcher","build":"tsc","prepack":"node scripts/validate-native-manifest.cjs --release","test:launcher":"node --test launcher/__tests__/*.test.cjs","generate:native-manifest":"node scripts/generate-native-manifest.cjs"},"version":"1.3.2","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"6b8b9fa0-1fcb-4967-ac66-7d3fe1bb4ccf"}},"homepage":"https://1nder-labs.github.io/schemalint","keywords":["json-schema","zod","openai","anthropic","structured-output","llm","schema","lint","validation","pydantic"],"_resolved":"/home/runner/work/schemalint/schemalint/release-bundle/1nder-labs-schemalint-1.3.2.tgz","_integrity":"sha512-a7jFizYGfVBp+JZ12BP4KwZAhj2J294zH/n6EAPkUoYoyFoU+gO+TbSBf+Nwtzfu9fNyg0JIzTeJ3Ho2MMC48A==","repository":{"url":"git+https://github.com/1nder-labs/schemalint.git","type":"git","directory":"npm/schemalint"},"_npmVersion":"11.6.2","description":"Lint JSON Schema and Zod schemas before OpenAI or Anthropic structured-output APIs reject them.","directories":{},"maintainers":[{"name":"lahfir","email":"nmhlahfir2@gmail.com"}],"_nodeVersion":"22.23.2","dependencies":{"tsx":"^4.21.0","picomatch":"^4.0.0","typescript":"^5.5.0","zod-to-json-schema":"^3.24.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.23.0","vitest":"^2.0.0","@types/node":"^25.6.0"},"peerDependencies":{"zod":">=3.20"},"peerDependenciesMeta":{"zod":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/schemalint_1.3.2_1790656650589_0.7649271868337466"}}},"time":{"created":"2026-06-29T02:02:44.049Z","modified":"2026-09-29T04:37:31.101Z","1.0.1":"2026-06-29T02:02:44.303Z","1.1.0":"2026-07-03T10:58:23.549Z","1.3.2":"2026-09-29T04:37:30.683Z"},"bugs":{"url":"https://github.com/1nder-labs/schemalint/issues"},"author":{"name":"Lahfir"},"license":"MIT OR Apache-2.0","homepage":"https://1nder-labs.github.io/schemalint","keywords":["json-schema","zod","openai","anthropic","structured-output","llm","schema","lint","validation","pydantic"],"repository":{"url":"git+https://github.com/1nder-labs/schemalint.git","type":"git","directory":"npm/schemalint"},"description":"Lint JSON Schema and Zod schemas before OpenAI or Anthropic structured-output APIs reject them.","maintainers":[{"name":"lahfir","email":"nmhlahfir2@gmail.com"}],"readme":"<p align=\"center\">\n  <img src=\"https://raw.githubusercontent.com/1nder-labs/schemalint/main/assets/schemalint-header.png\" alt=\"schemalint\" width=\"100%\">\n</p>\n\n<h1 align=\"center\">@1nder-labs/schemalint</h1>\n\n<p align=\"center\">\n  <b>Catch provider-incompatible schemas before OpenAI or Anthropic reject them at runtime.</b>\n</p>\n\n<p align=\"center\">\n  <img src=\"https://raw.githubusercontent.com/1nder-labs/schemalint/main/assets/Schemalint.gif\" alt=\"schemalint catching a provider-incompatible schema\" width=\"90%\">\n</p>\n\nOpenAI and Anthropic structured-output APIs accept only a strict subset of JSON Schema. Ship one with an unsupported keyword, a missing `required` entry, or the wrong `additionalProperties`, and the API rejects it in production as a `400`. **schemalint catches those errors at build time** — so a bad schema fails your CI instead of your users' requests.\n\nOne package, one `schemalint` command — JSON Schema, Zod, and Pydantic all in the box.\n\n## Install\n\n```bash\nnpm install -D @1nder-labs/schemalint\n# or globally:  npm install -g @1nder-labs/schemalint\n# or with bun:  bun add -d @1nder-labs/schemalint\n```\n\n## Quick start\n\n```bash\nschemalint check --profile openai.so.2026-04-30 schema.json\n```\n\n```text\nerror[OAI-K-allOf]: keyword 'allOf' is not supported by openai.so.2026-04-30\n  --> schema.json\n\n1 issue found (1 error, 0 warnings) across 1 schema\n```\n\nCheck a directory for both providers at once:\n\n```bash\nschemalint check \\\n  --profile openai.so.2026-04-30 \\\n  --profile anthropic.so.2026-04-30 \\\n  schemas/\n```\n\n## Lint Zod directly\n\nSchemas live in TypeScript? schemalint reads them straight from your Zod definitions — no JSON Schema export needed:\n\n```jsonc\n// package.json\n{\n  \"scripts\": { \"lint:schemas\": \"schemalint check-node\" },\n  \"schemalint\": {\n    \"profiles\": [\"openai.so.2026-04-30\"],\n    \"include\": [\"src/**/*.ts\"]\n  }\n}\n```\n\n```bash\nnpm run lint:schemas\n```\n\nExit `0` means every discovered in-scope target was evaluated and checked and\nthere were no error diagnostics. Import/evaluation/conversion\nfailures, unresolved required SDK metadata, and partial batches exit `1`; empty\ndiscovery (nothing checked) exits `3`.\n`--continue-on-discovery-error` collects later targets but never hides partial\ncoverage. JSON output uses schema version `1.1` and reports the authoritative\nstatus in `report.coverage`.\n\n## SDK and runtime compatibility\n\nSchemaLint matches canonical, aliased, and namespace imports by their exact\nmodule/export surface; it does not guess from a package version string. The\nregistry-tarball endpoints below were verified on 2026-07-09 and are retained\nin `src/__tests__/fixtures/sdk-version-matrix.json` so future updates are\nexplicit rather than silently redefining \"current\".\n\n| SDK surface | Verified versions | Recognized schema call |\n| --- | --- | --- |\n| AI SDK | Floor `ai@6.0.0`; current `ai@7.0.19` | `Output.object({ schema })`, `Output.array({ element })`, `dynamicTool({ inputSchema })` |\n| AI SDK legacy | Deprecated in AI SDK 6; retained by SchemaLint 1.x | `generateObject({ schema })`, `streamObject({ schema })`, `tool({ inputSchema \\| parameters })` |\n| OpenAI JavaScript SDK | `zodTextFormat` floor `openai@4.87.0`; current `6.46.0` | `zodTextFormat(schema, name)` from `openai/helpers/zod` |\n| OpenAI JavaScript SDK | `zodResponseFormat` floor `openai@4.55.0`; current `6.46.0` | `zodResponseFormat(schema, name)` from `openai/helpers/zod` |\n| OpenAI JavaScript SDK legacy | `zodFunction` floor `openai@4.55.0`; retained by SchemaLint 1.x | `zodFunction({ name, parameters })` from `openai/helpers/zod` |\n| Anthropic TypeScript SDK | `zodOutputFormat` floor `0.72.0`; current `0.110.0` | `zodOutputFormat(schema)` from `@anthropic-ai/sdk/helpers/zod` |\n| Anthropic TypeScript SDK legacy | `betaZodTool` floor `0.63.0`; retained by SchemaLint 1.x | `betaZodTool({ name, inputSchema })` from `@anthropic-ai/sdk/helpers/beta/zod` |\n\nLegacy rows are deprecated in SchemaLint and will be removed in SchemaLint 2.0.\n\nThe runtime supports Node 18, 20, and 22 and bundles its TypeScript loader.\nZod `>=3.20` is supported across v3, v4 from `4.0.1` through current `4.4.3`, and\n`zod/mini`; no global `tsx`, TypeScript, or repository dev dependency is used.\nGeneric AI SDK targets are provider-ambiguous, so select the intended profile\nexplicitly when package/source evidence cannot do so.\n\n## Providers\n\n| Provider | Profile |\n| --- | --- |\n| OpenAI Structured Outputs | `openai.so.2026-04-30` |\n| Anthropic Structured Outputs | `anthropic.so.2026-04-30` |\n\nschemalint exits non-zero on errors, so it fails the build before a broken schema ships. Output formats: `human` (default), `json`, `sarif`, `gha`.\n\nIngestion and JSON-RPC caches are bounded and process-local. SchemaLint does\nnot persist source schemas or normalized schema data to disk.\n\n## For AI agents\n\nCoding agents (Claude Code, Codex, Cursor, ...) should start with the usage guide that ships inside the binary, so it always matches the installed version:\n\n```bash\nschemalint skills get core          # workflow, monorepo usage, exit codes, common fixes\nschemalint skills get core --full   # plus the full command reference\n```\n\n## Documentation\n\nFull guide, profile reference, and CI recipes: **https://1nder-labs.github.io/schemalint**\n\n## License\n\nDual-licensed under MIT or Apache-2.0, at your option.\n","readmeFilename":"README.md"}