{"_id":"@0xsarwagya/clinical-receipt","_rev":"4-945398dacdeeb95e79d7a18d4de4140c","name":"@0xsarwagya/clinical-receipt","dist-tags":{"latest":"0.2.2"},"versions":{"0.1.0":{"name":"@0xsarwagya/clinical-receipt","version":"0.1.0","keywords":["clinical-ai","provenance","audit","merkle","selective-disclosure","verification","healthcare","typescript"],"license":"Apache-2.0","_id":"@0xsarwagya/clinical-receipt@0.1.0","maintainers":[{"name":"0xsarwagya","email":"sarwagyasingh69@gmail.com"}],"homepage":"https://oss.sarwagya.wtf/clinical-receipt","bugs":{"url":"https://github.com/0xsarwagya/clinical-receipt/issues"},"bin":{"clinical-receipt":"dist/cli.js"},"dist":{"shasum":"1b2b4c956546119123e43c1eb95326a62d2510ee","tarball":"https://registry.npmjs.org/@0xsarwagya/clinical-receipt/-/clinical-receipt-0.1.0.tgz","fileCount":80,"integrity":"sha512-7TMCuT5zyEXB9wbttwwOzk5cygJlDCJQxZhrIImirUv6Uq/P41lXlOLKvWvBjn5f7Mbpw3bdh6JwcJfw8NOd4Q==","signatures":[{"sig":"MEUCIQDaM8IweO7D7UAOu8dJGHK3xcKt2DHUfgeve5HQpUdTBgIgZVwX2/UvCrVNpT36aaJ4y8oEi5D8gaVsShmJWJKW+WY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":363688},"type":"module","_from":"file:0xsarwagya-clinical-receipt-0.1.0.tgz","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./verify":{"types":"./dist/verify.d.ts","import":"./dist/verify.js"}},"scripts":{"test":"vitest run","build":"tsup && tsc -p tsconfig.build.json","test:unit":"vitest run","check-types":"tsc --noEmit"},"_npmUser":{"name":"0xsarwagya","email":"sarwagyasingh69@gmail.com"},"_resolved":"/tmp/b4980c28974c339f60467e05cf525350/0xsarwagya-clinical-receipt-0.1.0.tgz","_integrity":"sha512-7TMCuT5zyEXB9wbttwwOzk5cygJlDCJQxZhrIImirUv6Uq/P41lXlOLKvWvBjn5f7Mbpw3bdh6JwcJfw8NOd4Q==","repository":{"url":"git+https://github.com/0xsarwagya/clinical-receipt.git","type":"git"},"_npmVersion":"11.16.0","description":"Portable, independently verifiable receipts of how a clinical AI output came to exist.","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^3.0.0","typescript":"5.9.2","@types/node":"^22.15.3"},"_npmOperationalInternal":{"tmp":"tmp/clinical-receipt_0.1.0_1783386155105_0.37402777511965835","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@0xsarwagya/clinical-receipt","version":"0.2.0","keywords":["clinical-ai","provenance","audit","merkle","selective-disclosure","verification","healthcare","fhir","typescript"],"license":"Apache-2.0","_id":"@0xsarwagya/clinical-receipt@0.2.0","maintainers":[{"name":"0xsarwagya","email":"sarwagyasingh69@gmail.com"}],"homepage":"https://oss.sarwagya.wtf/clinical-receipt","bugs":{"url":"https://github.com/0xsarwagya/clinical-receipt/issues"},"bin":{"clinical-receipt":"dist/cli.js"},"dist":{"shasum":"cad9b33c6cc54afe8dff5c6d843f6fdec5e7dcf3","tarball":"https://registry.npmjs.org/@0xsarwagya/clinical-receipt/-/clinical-receipt-0.2.0.tgz","fileCount":108,"integrity":"sha512-AwHgsesaA2k8rMjTv5SsmZzV3HpL99GE4fl3oVOd5kFPTbF7vKVwzVypDhEApRuTjLRPKaMW/Mj3lvcs4fiyhA==","signatures":[{"sig":"MEQCIC+9nZFY/Ttf8qflpOl0yeIzkAx2rpEpC3hVJ82SBUuiAiBCNqQO08DM8iolTJPZqwLk0DwVOryN6d6JuGUMuTZuWg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1029762},"type":"module","_from":"file:0xsarwagya-clinical-receipt-0.2.0.tgz","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./fhir":{"types":"./dist/fhir.d.ts","import":"./dist/fhir.js"},"./verify":{"types":"./dist/verify.d.ts","import":"./dist/verify.js"}},"scripts":{"test":"vitest run","build":"tsup && tsc -p tsconfig.build.json","test:unit":"vitest run","check-types":"tsc --noEmit"},"_npmUser":{"name":"0xsarwagya","email":"sarwagyasingh69@gmail.com"},"_resolved":"/tmp/c021996a3e9f32d827bff53b607fc116/0xsarwagya-clinical-receipt-0.2.0.tgz","_integrity":"sha512-AwHgsesaA2k8rMjTv5SsmZzV3HpL99GE4fl3oVOd5kFPTbF7vKVwzVypDhEApRuTjLRPKaMW/Mj3lvcs4fiyhA==","repository":{"url":"git+https://github.com/0xsarwagya/clinical-receipt.git","type":"git"},"_npmVersion":"11.16.0","description":"Portable, independently verifiable receipts of how a clinical AI output came to exist.","directories":{},"sideEffects":["./dist/fhir.js","./dist/fhir/register.js","./dist/fhir/canonicalize.js"],"_nodeVersion":"24.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.0","tsup":"^8.3.5","vitest":"^3.0.0","typescript":"5.9.2","@types/node":"^22.15.3"},"_npmOperationalInternal":{"tmp":"tmp/clinical-receipt_0.2.0_1783418905752_0.6693230164015886","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@0xsarwagya/clinical-receipt","version":"0.2.1","keywords":["clinical-ai","provenance","audit","merkle","selective-disclosure","verification","healthcare","fhir","typescript"],"license":"Apache-2.0","_id":"@0xsarwagya/clinical-receipt@0.2.1","maintainers":[{"name":"0xsarwagya","email":"sarwagyasingh69@gmail.com"}],"homepage":"https://oss.sarwagya.wtf/clinical-receipt","bugs":{"url":"https://github.com/0xsarwagya/clinical-receipt/issues"},"bin":{"clinical-receipt":"dist/cli.js"},"dist":{"shasum":"e0218cc18926d4e23d021ad3e318d4a451103023","tarball":"https://registry.npmjs.org/@0xsarwagya/clinical-receipt/-/clinical-receipt-0.2.1.tgz","fileCount":108,"integrity":"sha512-c7AD3FkjXLupBrFAaU5dvwD+N+NNSsf+AxADhGr8bFOl7FNBI7w5JpOzTutMA4hieFZ8IEXpZoyCvn1wuUDb/Q==","signatures":[{"sig":"MEUCIQCwN0mbfj4nZ8tf4B1snk6ZAU/YInU2fH7VMSIIBGNWCgIgZkdV6kdV+uwGga4hai48DGNjGIwhfQaVBNAKfi4v9s4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1035397},"type":"module","_from":"file:0xsarwagya-clinical-receipt-0.2.1.tgz","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./fhir":{"types":"./dist/fhir.d.ts","import":"./dist/fhir.js"},"./verify":{"types":"./dist/verify.d.ts","import":"./dist/verify.js"}},"scripts":{"test":"vitest run","build":"tsup && tsc -p tsconfig.build.json","test:unit":"vitest run","check-types":"tsc --noEmit"},"_npmUser":{"name":"0xsarwagya","email":"sarwagyasingh69@gmail.com"},"_resolved":"/tmp/b650cb10d8be7fda8e779de1396af649/0xsarwagya-clinical-receipt-0.2.1.tgz","_integrity":"sha512-c7AD3FkjXLupBrFAaU5dvwD+N+NNSsf+AxADhGr8bFOl7FNBI7w5JpOzTutMA4hieFZ8IEXpZoyCvn1wuUDb/Q==","repository":{"url":"git+https://github.com/0xsarwagya/clinical-receipt.git","type":"git"},"_npmVersion":"11.16.0","description":"Portable, independently verifiable receipts of how a clinical AI output came to exist.","directories":{},"sideEffects":["./dist/fhir.js","./dist/fhir/register.js","./dist/fhir/canonicalize.js"],"_nodeVersion":"24.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.0","tsup":"^8.3.5","vitest":"^3.0.0","typescript":"5.9.2","@types/node":"^22.15.3"},"_npmOperationalInternal":{"tmp":"tmp/clinical-receipt_0.2.1_1783429614131_0.019001207957484167","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@0xsarwagya/clinical-receipt","version":"0.2.2","description":"Portable, independently verifiable receipts of how a clinical AI output came to exist.","type":"module","license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/0xsarwagya/clinical-receipt.git"},"homepage":"https://oss.sarwagya.wtf/clinical-receipt","keywords":["clinical-ai","provenance","audit","merkle","selective-disclosure","verification","healthcare","fhir","typescript"],"sideEffects":["./dist/fhir.js","./dist/fhir/register.js","./dist/fhir/canonicalize.js"],"engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./verify":{"types":"./dist/verify.d.ts","import":"./dist/verify.js"},"./fhir":{"types":"./dist/fhir.d.ts","import":"./dist/fhir.js"}},"bin":{"clinical-receipt":"dist/cli.js"},"publishConfig":{"access":"public"},"devDependencies":{"@types/node":"^22.15.3","tsup":"^8.3.5","tsx":"^4.23.0","typescript":"5.9.2","vitest":"^3.0.0"},"scripts":{"build":"tsup && tsc -p tsconfig.build.json","check-types":"tsc --noEmit","test":"vitest run","test:unit":"vitest run"},"_id":"@0xsarwagya/clinical-receipt@0.2.2","bugs":{"url":"https://github.com/0xsarwagya/clinical-receipt/issues"},"_integrity":"sha512-BCvavHYQjWjcM4FKQho9EiD1/LB1gFo62IwodVCKWN3dmD8Pog8ayaxzvNMH4niCFKYjImw/uU1BY7iYGRe9fA==","_resolved":"/tmp/0c2a30409111774b3b8b04626d4647a1/0xsarwagya-clinical-receipt-0.2.2.tgz","_from":"file:0xsarwagya-clinical-receipt-0.2.2.tgz","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-BCvavHYQjWjcM4FKQho9EiD1/LB1gFo62IwodVCKWN3dmD8Pog8ayaxzvNMH4niCFKYjImw/uU1BY7iYGRe9fA==","shasum":"228c20d071e3c99bc5c60c81d7e0115aee35cef4","tarball":"https://registry.npmjs.org/@0xsarwagya/clinical-receipt/-/clinical-receipt-0.2.2.tgz","fileCount":108,"unpackedSize":1039679,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICWI/hrt2GdJNsP8pJJM+0QJ49ez56MMSkG6jfC9ug0RAiEA3Ml48KbW9BzAMLTKvBNKi/rUQQP7PFbtf1L1LQPUEKo="}]},"_npmUser":{"name":"0xsarwagya","email":"sarwagyasingh69@gmail.com"},"directories":{},"maintainers":[{"name":"0xsarwagya","email":"sarwagyasingh69@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/clinical-receipt_0.2.2_1783431104850_0.11467232784244352"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-07T01:02:34.891Z","modified":"2026-07-07T13:31:45.162Z","0.1.0":"2026-07-07T01:02:35.258Z","0.2.0":"2026-07-07T10:08:25.953Z","0.2.1":"2026-07-07T13:06:54.395Z","0.2.2":"2026-07-07T13:31:45.050Z"},"bugs":{"url":"https://github.com/0xsarwagya/clinical-receipt/issues"},"license":"Apache-2.0","homepage":"https://oss.sarwagya.wtf/clinical-receipt","keywords":["clinical-ai","provenance","audit","merkle","selective-disclosure","verification","healthcare","fhir","typescript"],"repository":{"type":"git","url":"git+https://github.com/0xsarwagya/clinical-receipt.git"},"description":"Portable, independently verifiable receipts of how a clinical AI output came to exist.","maintainers":[{"name":"0xsarwagya","email":"sarwagyasingh69@gmail.com"}],"readme":"# clinical-receipt\n\nPortable, independently verifiable receipts of how a clinical AI output\ncame to exist.\n\nA TypeScript library that records the inputs, evidence, prompts, models,\ntools, guardrails, and human decisions behind an AI-produced clinical\noutput — then commits, signs, and lets anyone verify the record\noffline.\n\nThe package proves the committed record has not changed. It does not\nprove the original record was true. That distinction is deliberate; it\nappears in the docs, the reports, and the specification.\n\n## What it is not\n\nNot a blockchain. Not a hosted service. Not a compliance product. Not an\nLLM observability dashboard. Not a substitute for clinical validation.\n\n## Install\n\n```\nnpm install @0xsarwagya/clinical-receipt\n```\n\nNode ≥ 20 (Web Crypto with Ed25519).\n\n## Usage\n\n```ts\nimport { createReceipt, createEd25519Signer } from \"@0xsarwagya/clinical-receipt\";\n\nconst run = await createReceipt({\n  workflow: { id: \"discharge-review\", version: \"2.1.0\" },\n});\n\nawait run.input.observed({ value: patientBundle });\nawait run.evidence.retrieved({\n  value: { chunk: \"guideline text\", rank: 1 },\n  mode: \"reference\",\n  ref: { uri: \"guidelines://hf/2026\", version: \"2026-06-14\" },\n});\nawait run.prompt.rendered({ value: renderedPrompt });\nawait run.model.responded({ value: modelOutput });\nawait run.guardrail.evaluated({ value: { policy, result: \"passed\" } });\nawait run.humanReview.completed({ value: reviewRecord });\nawait run.output.committed({ value: finalOutput });\n\nconst signer = await createEd25519Signer({ generate: true });\nconst receipt = await run.finalize({ signer });\n```\n\nVerify anywhere:\n\n```ts\nimport { verifyReceipt, importVerificationKey } from \"@0xsarwagya/clinical-receipt/verify\";\n\nconst key = await importVerificationKey(publicJwk);\nconst report = await verifyReceipt(receipt, { keys: [key] });\n// report.ok, report.integrity, report.signatures, report.warnings, ...\n```\n\n## FHIR\n\nSince v0.2, wrap your FHIR access to commit which exact resource\nversions the AI saw:\n\n```ts\nimport { instrumentFHIRFetch, verifyFHIR } from \"@0xsarwagya/clinical-receipt/fhir\";\n\nconst fhirFetch = instrumentFHIRFetch(globalThis.fetch, {\n  run,\n  baseUrl: \"https://hapi.fhir.org/baseR4\",\n});\nconst patient = await fhirFetch(`${BASE}/Patient/123`).then((r) => r.json());\n// reads, searches, and writes are now part of the receipt.\n```\n\nThe wire format for the `org.hl7.fhir` extension is pinned in\n[`spec/1.0/fhir.md`](./spec/1.0/fhir.md); vectors sit under\n[`spec/1.0/vectors/fhir-*.json`](./spec/1.0/vectors/).\n\n## CLI\n\n```\nclinical-receipt verify receipt.json\nclinical-receipt verify --disclosure package.json --key public.jwk\nclinical-receipt inspect receipt.json\nclinical-receipt disclose receipt.json --event output.* --out share.json\n```\n\nExit codes: 0 ok, 1 verification failed, 2 usage or IO error.\n\n## Specification\n\nThe wire format is a versioned specification, not an implementation\ndetail. Every byte-level rule lives in [`spec/1.0/`](./spec/1.0/). Test\nvectors in [`spec/1.0/vectors/`](./spec/1.0/vectors/) are byte-pinned for\ncanonicalization, commitments, tree structure, header leaves, and full\nreceipts; signatures are pinned in the verify direction only (WebKit\nhedges Ed25519).\n\nAny implementation that speaks specification 1.0 — in any language —\nmust verify these vectors.\n\n## License\n\nApache-2.0. This is infrastructure and the patent grant matters.\n","readmeFilename":"README.md"}