{"_id":"@drishtiai/sdk-core","name":"@drishtiai/sdk-core","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@drishtiai/sdk-core","version":"1.0.0","description":"Shared on-device image quality scoring logic for DrishtiAI Capture SDK (platform-agnostic TypeScript reference implementation)","main":"dist/index.js","types":"dist/index.d.ts","publishConfig":{"access":"public"},"scripts":{"build":"tsc -p tsconfig.json","clean":"rimraf dist dist-test","test":"tsc -p tsconfig.test.json && node --test dist-test/tests/*.test.js"},"dependencies":{},"devDependencies":{"@types/node":"^20.14.2","rimraf":"^5.0.5","typescript":"^5.5.4"},"license":"MIT","licenseNotes":"Zero runtime dependencies. All scoring math (grayscale, mean/std-dev brightness, Laplacian-variance blur detection, overexposure ratio) is implemented from scratch using plain arithmetic on pixel buffers - no GPL/AGPL or paid libraries involved. Tests use Node's built-in test runner (node:test) instead of a test framework dependency.","_id":"@drishtiai/sdk-core@1.0.0","gitHead":"8a4efbb7481657ce7659c4ed62cfc9b6c6521529","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-2QRL1hOylEv7heVCm6vntIQ2Y3x5F3JIN5P3CzQ5A5A3e5H/yLwPWZsHUYZZYNbsWNIU6uJ987zpUifeyY4NlQ==","shasum":"ab503a499302eb73e85be5f18c8e83076bd16ca3","tarball":"https://registry.npmjs.org/@drishtiai/sdk-core/-/sdk-core-1.0.0.tgz","fileCount":107,"unpackedSize":99746,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDeD2Npi7RJe9PCGfG3exMkD4btzcjF82NknbEfNuz9vAIgTUJIUtGBrdH8m6BaSfI+erzLB1RnpuwZvb1lYjXinJk="}]},"_npmUser":{"name":"erprateek9","email":"erprateek9@gmail.com"},"directories":{},"maintainers":[{"name":"erprateek9","email":"erprateek9@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk-core_1.0.0_1783096171214_0.5695415144209213"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-03T16:29:31.103Z","1.0.0":"2026-07-03T16:29:31.356Z","modified":"2026-07-03T16:29:31.603Z"},"maintainers":[{"name":"erprateek9","email":"erprateek9@gmail.com"}],"description":"Shared on-device image quality scoring logic for DrishtiAI Capture SDK (platform-agnostic TypeScript reference implementation)","license":"MIT","readme":"# @drishtiai/sdk-core\n\nPlatform-agnostic TypeScript reference implementation of the DrishtiAI image\nquality scoring logic. Zero runtime dependencies - every check is plain\narithmetic over an RGBA pixel buffer (`ImageBuffer`).\n\nUsed directly by:\n- `sdk-web` (browser SDK)\n- `backend` (to score uploaded training images)\n- `trainer-app`'s prediction preview (via the backend `/dataset/:id/predict` route)\n\n`sdk-android` and `sdk-ios` cannot import TypeScript directly - they carry\nnative Kotlin/Swift ports of the same algorithms (see `ScoringEngine.kt` /\n`ScoringEngine.swift`). Keeping the math here simple and dependency-free\nmakes those ports easy to keep in sync.\n\n## What's implemented\n\n| Check | File | Type |\n|---|---|---|\n| Brightness | `scoring/brightness.ts` | lenient range |\n| Black frame | `scoring/blackFrame.ts` | hard gate |\n| Blur (variance of Laplacian) | `scoring/blur.ts` | lenient threshold |\n| Overexposure | `scoring/overexposure.ts` | lenient threshold |\n| Contrast (std-dev) | `scoring/contrast.ts` | lenient threshold |\n| Object presence | `scoring/objectPresence.ts` | placeholder, always passes |\n| Stability | `scoring/stability.ts` | placeholder, multi-frame ready |\n\nEvery check besides `blackFrame` decays its score smoothly around the\nconfigured threshold instead of hard-cutting to 0/100 - this is the\n\"leniency\" the product spec calls for. Thresholds and weights are 100%\nconfig-driven (`QualityConfig`), never hardcoded per-platform.\n\n## Build\n\n```bash\nnpm install\nnpm run build\n```\n\n## License\n\nMIT. No third-party runtime dependencies.\n","readmeFilename":"README.md","_rev":"1-641159791a7a380b70f231e5895d8aa6"}