{"_id":"@bwthomas/ibid-service","_rev":"4-1c1d24ddd4a0f19150dc150f361f5b2b","name":"@bwthomas/ibid-service","dist-tags":{"latest":"0.5.1"},"versions":{"0.4.0":{"name":"@bwthomas/ibid-service","version":"0.4.0","author":{"name":"Blake Thomas","email":"bwthomas@users.noreply.github.com"},"license":"MIT","_id":"@bwthomas/ibid-service@0.4.0","maintainers":[{"name":"bwthomas","email":"bwthomas@gmail.com"}],"homepage":"https://github.com/bwthomas/ibid-service#readme","bugs":{"url":"https://github.com/bwthomas/ibid-service/issues"},"dist":{"shasum":"8de0e5cb632c9b665842865797bff6d749fcb59c","tarball":"https://registry.npmjs.org/@bwthomas/ibid-service/-/ibid-service-0.4.0.tgz","fileCount":44,"integrity":"sha512-uY+lsy5BpGp4WaAGyiWbKvmWRnMWQEmcAUOydLIVPkgtXqA23d9WqENUPGFYzKccI9WRTeg0SmxlZjYxqS88NQ==","signatures":[{"sig":"MEUCIETJ/kYapEZNtLHqqg7rSH2OqUHe8Yvo7qQKHrziiMq5AiEA4kVWeRwm/+NjC9z0E0FaT42VxRHewlfwy+XrbQ8tdfg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":197035},"type":"module","engines":{"node":">=18"},"gitHead":"4548231217bb46ff5ccbabd6349f517e075b7c5e","scripts":{"ci":"npm run typecheck && npm run test && npm run build","dev":"tsup --watch --onSuccess 'node dist/server.js'","test":"vitest run","build":"tsup","start":"node dist/server.js","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"bwthomas","email":"bwthomas@gmail.com"},"repository":{"url":"git+https://github.com/bwthomas/ibid-service.git","type":"git"},"_npmVersion":"11.12.1","description":"HTTP wrapper around @bwthomas/ibid for non-TypeScript consumers","directories":{},"_nodeVersion":"25.9.0","dependencies":{"zod":"^3.23.8","pino":"^9.0.0","fastify":"^5.0.0","linkedom":"^0.18.12","lru-cache":"^11.0.0","pino-pretty":"^11.0.0","prom-client":"^15.1.3","@bwthomas/ibid":"file:../ibid"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","tsup":"^8.0.2","vitest":"^3.0.0","typescript":"^5.4.5","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ibid-service_0.4.0_1776968102989_0.8415610767299644","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to `citare-service` (unscoped). Install: `npm install citare-service`."},"0.5.0":{"name":"@bwthomas/ibid-service","version":"0.5.0","author":{"name":"Blake Thomas","email":"bwthomas@users.noreply.github.com"},"license":"MIT","_id":"@bwthomas/ibid-service@0.5.0","maintainers":[{"name":"bwthomas","email":"bwthomas@gmail.com"}],"homepage":"https://github.com/bwthomas/ibid-service#readme","bugs":{"url":"https://github.com/bwthomas/ibid-service/issues"},"dist":{"shasum":"5b3fb63ee676b4f9549162a37f4d066a04effbef","tarball":"https://registry.npmjs.org/@bwthomas/ibid-service/-/ibid-service-0.5.0.tgz","fileCount":44,"integrity":"sha512-GPOW3KGMX2+UQv1vvywhrnnBp79bQmhRiUQ802bn2a9IGlM1iRROJhKIPnE5Sp2NMPbtYPNDkanOQYAEWb8ygg==","signatures":[{"sig":"MEUCICR0wDJIs/r2fTO0nl57TmyKChzjCCKVp1j0ATgD6py3AiEA92u4GPxqSwE1UgM/0zSWY+N/ww6atMHWzUS8CCAn1is=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":204285},"type":"module","engines":{"node":">=18"},"gitHead":"279d020c3bf1a1047991ca202c3f11aabb7871da","scripts":{"ci":"npm run typecheck && npm run test && npm run build","dev":"tsup --watch --onSuccess 'node dist/server.js'","test":"vitest run","build":"tsup","start":"node dist/server.js","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"bwthomas","email":"bwthomas@gmail.com"},"repository":{"url":"git+https://github.com/bwthomas/ibid-service.git","type":"git"},"_npmVersion":"11.12.1","description":"HTTP wrapper around @bwthomas/ibid for non-TypeScript consumers","directories":{},"_nodeVersion":"25.9.0","dependencies":{"zod":"^3.23.8","pino":"^9.0.0","fastify":"^5.0.0","linkedom":"^0.18.12","lru-cache":"^11.0.0","pino-pretty":"^11.0.0","prom-client":"^15.1.3","@bwthomas/ibid":"file:../ibid"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","tsup":"^8.0.2","vitest":"^3.0.0","typescript":"^5.4.5","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ibid-service_0.5.0_1776969166456_0.965614495059832","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to `citare-service` (unscoped). Install: `npm install citare-service`."},"0.5.1":{"name":"@bwthomas/ibid-service","version":"0.5.1","author":{"name":"Blake Thomas","email":"bwthomas@users.noreply.github.com"},"license":"MIT","_id":"@bwthomas/ibid-service@0.5.1","maintainers":[{"name":"bwthomas","email":"bwthomas@gmail.com"}],"homepage":"https://github.com/bwthomas/ibid-service#readme","bugs":{"url":"https://github.com/bwthomas/ibid-service/issues"},"dist":{"shasum":"79534c6a6f28fd560ec76a1c50c26d69196cb067","tarball":"https://registry.npmjs.org/@bwthomas/ibid-service/-/ibid-service-0.5.1.tgz","fileCount":44,"integrity":"sha512-fPkzNIvzWlu2SJoAwnvH74BnsSUzrGAuSrQXnVtwwThKKc7Nyiqcv+RPTvNf3FTvLH61q2IAXU1OffGAcB4Qlw==","signatures":[{"sig":"MEUCIQDYp6bgp4j3cyg8G8qV3+IS4Q8ItQsGpV/LrF3c+d2rMAIgWLUadoNciV/rcmm5Vdm+vbz0zh2HlBq6GibgfHgyFGM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":213472},"type":"module","engines":{"node":">=18"},"gitHead":"279582b87cf3064c94fa8bb91d76b75b3d081b71","scripts":{"ci":"npm run typecheck && npm run test && npm run build","dev":"tsup --watch --onSuccess 'node dist/server.js'","test":"vitest run","build":"tsup","start":"node dist/server.js","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"bwthomas","email":"bwthomas@gmail.com"},"repository":{"url":"git+https://github.com/bwthomas/ibid-service.git","type":"git"},"_npmVersion":"11.12.1","description":"HTTP wrapper around @bwthomas/ibid for non-TypeScript consumers","directories":{},"_nodeVersion":"25.9.0","dependencies":{"zod":"^3.23.8","pino":"^9.0.0","fastify":"^5.0.0","linkedom":"^0.18.12","lru-cache":"^11.0.0","pino-pretty":"^11.0.0","prom-client":"^15.1.3","@bwthomas/ibid":"file:../ibid"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","tsup":"^8.0.2","vitest":"^3.0.0","typescript":"^5.4.5","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ibid-service_0.5.1_1776969925717_0.15341260957731895","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to `citare-service` (unscoped). Install: `npm install citare-service`."}},"time":{"created":"2026-04-23T18:15:02.864Z","modified":"2026-05-15T17:35:59.100Z","0.4.0":"2026-04-23T18:15:03.145Z","0.5.0":"2026-04-23T18:32:46.593Z","0.5.1":"2026-04-23T18:45:25.839Z"},"bugs":{"url":"https://github.com/bwthomas/ibid-service/issues"},"author":{"name":"Blake Thomas","email":"bwthomas@users.noreply.github.com"},"license":"MIT","homepage":"https://github.com/bwthomas/ibid-service#readme","repository":{"url":"git+https://github.com/bwthomas/ibid-service.git","type":"git"},"description":"HTTP wrapper around @bwthomas/ibid for non-TypeScript consumers","maintainers":[{"name":"bwthomas","email":"bwthomas@gmail.com"}],"readme":"# ibid-service\n\nHTTP wrapper around [`@bwthomas/ibid`](https://github.com/bwthomas/ibid) for\nnon-TypeScript consumers (Ruby, Java, browser toolbars without the npm\ndependency, etc.).\n\n## Quick start\n\n```bash\n# Requires node 18+ and npm.\nnpm install\nnpm test\n\n# Dev server (auto-rebuilds on src changes):\nIBID_SERVICE_AUTH=dev-secret-please-replace-32-chars npm run dev\n\n# Or via Docker:\nIBID_SERVICE_AUTH=dev-secret-please-replace-32-chars docker compose up --build\n```\n\nThe service listens on `:3000`. Health check at `GET /health` (no auth).\n\n## Endpoints (all require `X-Ibid-Auth` header)\n\n- `POST /extract` — run the full ibid pipeline on a URL / DOI / ISBN / HTML / RIS / EasyBib / free text input.\n- `POST /normalize` — post-process an existing CSL item.\n- `POST /parse-ris`, `/parse-easybib`, `/upgrade-bib` — pure parsers.\n- `POST /parse-authors`, `/parse-date` — utility parsers.\n- `GET /metrics` — Prometheus text format.\n\nFull contract: [`SPEC.md`](SPEC.md). Integration checklist: [`INTEGRATION.md`](INTEGRATION.md).\n\n## Configuration\n\nVia environment variables. See [`SPEC.md` §7](SPEC.md#7-configuration) for the\nfull catalog. Minimum required: `IBID_SERVICE_AUTH` (16+ char random secret).\n\nOptional: `IBID_LLM_ANTHROPIC_API_KEY` (or AWS creds picked up by the Bedrock\nadapter) registers the LLM fallback strategy. When set, the freetext-search\nCrossRef adapter is also auto-wired with LLM rescue (see ibid\n[SPEC §8.1.2](../ibid/SPEC.md#812-crossrefreetext--optional-llm-rescue)).\n\n### Recommended latency-first config\n\nA reasonable starting point for a latency-sensitive mixed-input consumer:\n\n```\nIBID_SERVICE_AUTH=<16+ char secret>\nIBID_LLM_ANTHROPIC_API_KEY=<anthropic key>   # or AWS creds for Bedrock\nIBID_STRATEGY_CITOID_URL_ENABLED=false       # drop ibid's slowest built-in\nIBID_STRATEGY_LLM_ENABLED=false              # no URL-extraction LLM rescue\n# optional: IBID_LLM_ANTHROPIC_MODEL=us.amazon.nova-lite-v1:0  # Bedrock Converse\n# optional: IBID_CACHE_ENABLED=false         # disable in-memory LRU during ops\n```\n\nDisabling `CitoidUrl` drops ibid's slowest built-in strategy from the pipeline.\nDisabling the `Llm` strategy turns off URL-extraction LLM rescue — measurement\non a K-12 research corpus (2026-04-23) showed it regresses quality at corpus\nscale while adding 500–1700ms per call. The freetext LLM rescue remains on\nindependently (via `articleSearchAdapters`, not the `Llm` strategy), so messy\nauthor/title queries still benefit from LLM re-ranking at negligible cost.\n\n### Strategy overrides (`IBID_STRATEGY_*`)\n\nEach built-in strategy in the underlying package can be tuned per env-var.\nPattern (strategy names are upper-snake-cased — e.g. `CitoidUrl` → `CITOID_URL`):\n\n| Env var | Default | Effect |\n|---|---|---|\n| `IBID_STRATEGY_<NAME>_ENABLED` | unset (strategy runs) | `false` removes the strategy from the pipeline entirely. |\n| `IBID_STRATEGY_<NAME>_FALLBACK` | unset (SPEC-defined tier) | `true` promotes the strategy into the post-primary fallback tier so it only runs after primary-tier fold, with `ctx.currentBest` visible. |\n| `IBID_STRATEGY_<NAME>_MIN_CURRENT_BEST_CONFIDENCE` | unset (strategy's own gate only) | Integer N — layers an extra `ctx.currentBest?.confidence < N` gate on top of the strategy's own `shouldRun`. Only meaningful in the fallback tier. |\n\nUnrecognized strategy names are logged at `warn` and ignored. The full\nmechanism (tiers, folding, gating semantics) lives in ibid\n[SPEC §8.1.1.1](../ibid/SPEC.md#8111-per-strategy-overrides-optionsstrategyoverrides).\n\nStrategy names available as of this writing: `CitoidDoi`, `CitoidUrl`,\n`CrossRefDoi`, `DoiInHtml`, `Highwire`, `ImageExtractor`, `IsbnAdapterChain`,\n`Llm`, `MetaTagFallback`, `OpenLibraryIsbn`, `SchemaOrgLdJson`,\n`SchemaOrgMicrodata`, `TranslationServer`, `UrlFallback`, plus the vendor\nfamily (`Gale*`, `Proquest*`, `Ebsco*`, `Credo*`, `Britannica`, `Wikipedia`,\n`WorldBook`, etc.).\n\n### Cost and latency guidance\n\nCitoidUrl disabled saves roughly 1s per URL extraction at negligible quality\ncost; leaving the LLM wired enables freetext rescue at ~$0.12/month per 100k\noperations.\n\n## Eval harness\n\nThe [`eval/`](eval/) directory ships a config-driven quality-and-cost\ncomparison harness (baseline vs. ibid-solo vs. ibid-post-LLM) over a\nfew-hundred-item JSONL corpus. See [`eval/README.md`](eval/README.md) for\ncorpus shape, config keys, and LLM-variant sweep.\n\n## License\n\nMIT. See [`AUTHORSHIP.md`](AUTHORSHIP.md) for provenance conventions.\n","readmeFilename":"README.md"}