{"_id":"@bwthomas/ibid","_rev":"5-f21cc9ca7e4fa403a8fd09b85ff120a6","name":"@bwthomas/ibid","dist-tags":{"latest":"0.6.0"},"versions":{"0.0.1":{"name":"@bwthomas/ibid","version":"0.0.1","keywords":["citation","bibliography","metadata"],"author":{"name":"Blake Thomas","email":"blake@scrible.com"},"license":"MIT","_id":"@bwthomas/ibid@0.0.1","maintainers":[{"name":"bwthomas","email":"bwthomas@gmail.com"}],"homepage":"https://github.com/bwthomas/ibid","bugs":{"url":"https://github.com/bwthomas/ibid/issues"},"dist":{"shasum":"575eec2708472c2a37c8e37b3ea2391d202907c0","tarball":"https://registry.npmjs.org/@bwthomas/ibid/-/ibid-0.0.1.tgz","fileCount":4,"integrity":"sha512-RqU95vWI+xBHdK60c6iNA1Y8Xi/NvNsyR3bdEeNEEZBXxDRpIhCc+SdllmCTMh03Asd+tZKkbikXBmU87W/+cQ==","signatures":[{"sig":"MEQCIGUY4Xn9fJxr33/txWYsjA2AykhE5R/ye5Q7mFn6ppoxAiA/V2AVQdIXz65jd1ofoeBlXV/zEb3Ko5uFR2Q7QFcblg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1985},"main":"index.js","type":"module","engines":{"node":">=18"},"_npmUser":{"name":"bwthomas","email":"bwthomas@gmail.com"},"deprecated":"Renamed to `citare` (unscoped). Install: `npm install citare`.","repository":{"url":"git+https://github.com/bwthomas/ibid.git","type":"git"},"_npmVersion":"10.2.4","description":"Extracts and normalizes citation metadata.","directories":{},"_nodeVersion":"18.19.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ibid_0.0.1_1776435417809_0.6454199394605091","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@bwthomas/ibid","version":"0.2.0","keywords":["citation","bibliography","metadata"],"author":{"name":"Blake Thomas","email":"bwthomas@users.noreply.github.com"},"license":"MIT","_id":"@bwthomas/ibid@0.2.0","maintainers":[{"name":"bwthomas","email":"bwthomas@gmail.com"}],"homepage":"https://github.com/bwthomas/ibid","bugs":{"url":"https://github.com/bwthomas/ibid/issues"},"dist":{"shasum":"893a254cd23e18c74d35c27a7507cecf55a7a5eb","tarball":"https://registry.npmjs.org/@bwthomas/ibid/-/ibid-0.2.0.tgz","fileCount":45,"integrity":"sha512-haKnTweFwceURVCHpOaxXfYywLx6nVQgh1vzxQr6zHsM8ynxidJ5RBJ6sc2ugXxTtpWRtDXprGZ1xiB+VLwL+Q==","signatures":[{"sig":"MEUCIQDzud1sdjbMQmhljke2UjIvVSn6qYDW+D0BCTpJOzVdUAIgaHFS3AsXyPkYiuEgFbgUzF6Fi8OuPMAMClz1eokuxcw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2648677},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./types":{"types":"./dist/types.d.ts","import":"./dist/types.js","require":"./dist/types.cjs"},"./vendors":{"types":"./dist/vendors.d.ts","import":"./dist/vendors.js","require":"./dist/vendors.cjs"},"./strategies":{"types":"./dist/strategies.d.ts","import":"./dist/strategies.js","require":"./dist/strategies.cjs"},"./llm-bedrock":{"types":"./dist/llm-bedrock.d.ts","import":"./dist/llm-bedrock.js","require":"./dist/llm-bedrock.cjs"},"./dom-linkedom":{"types":"./dist/dom-linkedom.d.ts","import":"./dist/dom-linkedom.js","require":"./dist/dom-linkedom.cjs"},"./llm-anthropic":{"types":"./dist/llm-anthropic.d.ts","import":"./dist/llm-anthropic.js","require":"./dist/llm-anthropic.cjs"}},"gitHead":"02ab2502ad0160b63baf7d48978694da70eb2480","scripts":{"ci":"npm run typecheck && npm run test && npm run build","test":"vitest run","build":"tsup","prepare":"npm run build","typecheck":"tsc --noEmit","test:watch":"vitest","test:browser":"vitest run --config vitest.browser.config.ts"},"_npmUser":{"name":"bwthomas","email":"bwthomas@gmail.com"},"repository":{"url":"git+https://github.com/bwthomas/ibid.git","type":"git"},"_npmVersion":"11.12.1","description":"Extracts and normalizes citation metadata.","directories":{},"_nodeVersion":"25.9.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8","vitest":"^3","linkedom":"*","playwright":"^1.59.1","typescript":"^5","@types/node":"^20","@vitest/browser":"^3.2.4","@vitest/coverage-v8":"^3"},"peerDependencies":{"linkedom":"^0.18.12"},"peerDependenciesMeta":{"linkedom":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ibid_0.2.0_1776811169440_0.224605571319356","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to `citare` (unscoped). Install: `npm install citare`."},"0.6.0":{"name":"@bwthomas/ibid","version":"0.6.0","keywords":["citation","bibliography","metadata"],"author":{"name":"Blake Thomas","email":"bwthomas@users.noreply.github.com"},"license":"MIT","_id":"@bwthomas/ibid@0.6.0","maintainers":[{"name":"bwthomas","email":"bwthomas@gmail.com"}],"homepage":"https://github.com/bwthomas/ibid","bugs":{"url":"https://github.com/bwthomas/ibid/issues"},"dist":{"shasum":"816f5b47c15b7b240011171a583fec986addc9b2","tarball":"https://registry.npmjs.org/@bwthomas/ibid/-/ibid-0.6.0.tgz","fileCount":63,"integrity":"sha512-+ohxY0bXvSSS1g4ZXi4rh1iK8zqa3fJCehBxrpkS0scpWfdqt8ZBxRyvvABvY06LnqK7rhAh2nbm689qUN++5Q==","signatures":[{"sig":"MEUCIQCkT5UghJCrhAzH+Q8eH4yUR/umwBZ6GNVPWSZR8vcXNAIgMJy+9BGRfB4hZxk/w5jTSS4tJ1sbfzAD1nBmUOIiTzs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3169993},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./types":{"types":"./dist/types.d.ts","import":"./dist/types.js","require":"./dist/types.cjs"},"./vendors":{"types":"./dist/vendors.d.ts","import":"./dist/vendors.js","require":"./dist/vendors.cjs"},"./strategies":{"types":"./dist/strategies.d.ts","import":"./dist/strategies.js","require":"./dist/strategies.cjs"},"./isbn-isbndb":{"types":"./dist/isbn-isbndb.d.ts","import":"./dist/isbn-isbndb.js","require":"./dist/isbn-isbndb.cjs"},"./llm-bedrock":{"types":"./dist/llm-bedrock.d.ts","import":"./dist/llm-bedrock.js","require":"./dist/llm-bedrock.cjs"},"./dom-linkedom":{"types":"./dist/dom-linkedom.d.ts","import":"./dist/dom-linkedom.js","require":"./dist/dom-linkedom.cjs"},"./llm-anthropic":{"types":"./dist/llm-anthropic.d.ts","import":"./dist/llm-anthropic.js","require":"./dist/llm-anthropic.cjs"},"./isbn-google-books":{"types":"./dist/isbn-google-books.d.ts","import":"./dist/isbn-google-books.js","require":"./dist/isbn-google-books.cjs"},"./article-crossref-freetext":{"types":"./dist/article-crossref-freetext.d.ts","import":"./dist/article-crossref-freetext.js","require":"./dist/article-crossref-freetext.cjs"}},"gitHead":"a493e87372675d52bb40be7c0672eee8b8957aba","scripts":{"ci":"npm run typecheck && npm run test && npm run build","test":"vitest run","build":"tsup","prepare":"npm run build","typecheck":"tsc --noEmit","test:watch":"vitest","test:browser":"vitest run --config vitest.browser.config.ts"},"_npmUser":{"name":"bwthomas","email":"bwthomas@gmail.com"},"repository":{"url":"git+https://github.com/bwthomas/ibid.git","type":"git"},"_npmVersion":"11.12.1","description":"Extracts and normalizes citation metadata.","directories":{},"_nodeVersion":"25.9.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8","vitest":"^3","linkedom":"*","playwright":"^1.59.1","typescript":"^5","@types/node":"^20","@vitest/browser":"^3.2.4","@vitest/coverage-v8":"^3"},"peerDependencies":{"linkedom":"^0.18.12"},"peerDependenciesMeta":{"linkedom":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ibid_0.6.0_1776968094262_0.5977703708299551","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to `citare` (unscoped). Install: `npm install citare`."}},"time":{"created":"2026-04-17T14:16:57.686Z","modified":"2026-05-15T15:31:29.622Z","0.0.1":"2026-04-17T14:16:57.941Z","0.2.0":"2026-04-21T22:39:29.612Z","0.6.0":"2026-04-23T18:14:54.449Z"},"bugs":{"url":"https://github.com/bwthomas/ibid/issues"},"author":{"name":"Blake Thomas","email":"bwthomas@users.noreply.github.com"},"license":"MIT","homepage":"https://github.com/bwthomas/ibid","keywords":["citation","bibliography","metadata"],"repository":{"url":"git+https://github.com/bwthomas/ibid.git","type":"git"},"description":"Extracts and normalizes citation metadata.","maintainers":[{"name":"bwthomas","email":"bwthomas@gmail.com"}],"readme":"# ibid\n\nTools for extracting and normalizing citation metadata in JavaScript. Designed to run in both browser and server contexts.\n\nSee [`SPEC.md`](./SPEC.md) for the authoritative behavioral contract.\n\n## Tuning for latency and cost\n\nSeveral knobs control the latency/cost/quality trade-off. The defaults are tuned\nfor a representative mixed-input corpus; consumers with narrower inputs or\ntighter latency budgets can adjust:\n\n- **Per-strategy overrides** ([SPEC §8.1.1.1](./SPEC.md#8111-per-strategy-overrides-optionsstrategyoverrides)).\n  `IbidOptions.strategyOverrides` takes a `{ [strategyName]: { enabled?, fallback?, minCurrentBestConfidence? } }`\n  map. `enabled: false` removes a built-in from the pipeline; `fallback: true`\n  promotes it to the post-primary tier where `ctx.currentBest` is visible;\n  `minCurrentBestConfidence: N` layers a tighter gate on top of the strategy's\n  own `shouldRun`. Canonical use: `{ CitoidUrl: { fallback: true } }` — in one\n  measurement this cut mean URL-extraction latency ~8× at a −1.3pp quality cost.\n- **LLM fallback threshold** ([SPEC §9.3](./SPEC.md#93-llm-strategy-prompt-contract)).\n  The built-in `Llm` strategy fires only when folded primary-tier confidence is\n  below `options.llmPrompts.fallbackConfidenceThreshold`. **Default changed from\n  75 → 50 on 2026-04-23**: the prior default caused the LLM to fire on nearly\n  every URL for marginal gain. Consumers with unusually sparse-metadata corpora\n  can raise it.\n- **Bedrock streaming on by default** ([SPEC §9.2.1](./SPEC.md#921-streaming-by-default)).\n  `createBedrockLlm({ useStreaming })` defaults to `true`, using\n  `InvokeModelWithResponseStream` under the hood. Measured 51% wall-clock\n  improvement on small outputs (≤200 tokens, where most ibid calls land); the\n  public `LlmResponse` shape is unchanged. Opt out with `useStreaming: false`\n  for ≥1000-token responses where the buffered path is faster.\n- **CrossRefFreetext LLM rescue** ([SPEC §8.1.2](./SPEC.md#812-crossrefreetext--optional-llm-rescue)).\n  Pass an `LlmAdapter` to the `CrossRefFreetext` adapter (subpath\n  `/article-crossref-freetext`) and it will re-rank weak CrossRef top-1 results\n  via the LLM. Rescue fires only when raw CrossRef score is low or title-token\n  overlap is thin, so cost is bounded to the tail of genuinely ambiguous\n  queries. Failures degrade to the original CrossRef order.\n\n### Production config recommendation\n\nFor a web-reader/toolbar-style consumer with mixed URL/DOI/ISBN/RIS input and a\nlow-latency budget, a measurement on 2026-04-23 ([analysis, not in-repo](../../Documents/Claude/Analysis/ibid-quality-bar-2026-04-23/FINAL-REPORT.md))\nfound the best latency/quality balance from:\n\n- `strategyOverrides: { CitoidUrl: { fallback: true } }`\n- `createBedrockLlm(...)` with default `useStreaming: true`\n- `llmPrompts.fallbackConfidenceThreshold: 50` (the new default)\n- `CrossRefFreetext` adapter wired with an LLM for rescue\n\n## License\n\nMIT — see [LICENSE](./LICENSE).\n","readmeFilename":"README.md"}