{"_id":"@benkovy/doh-protocol","_rev":"7-67d21ee3c39de30ddd38aaad643585b5","name":"@benkovy/doh-protocol","dist-tags":{"latest":"0.1.6"},"versions":{"0.1.0":{"name":"@benkovy/doh-protocol","version":"0.1.0","license":"MIT","_id":"@benkovy/doh-protocol@0.1.0","maintainers":[{"name":"benkovy","email":"benjamnkovacs@gmail.com"}],"dist":{"shasum":"954236e5f0425480d5f07f69355bf79a3820ad15","tarball":"https://registry.npmjs.org/@benkovy/doh-protocol/-/doh-protocol-0.1.0.tgz","fileCount":5,"integrity":"sha512-TuLVusZFnPOIi7AFY4wIeLb4PE+RuJfE6iirGG7s+DUeq8h2a36wTw516Ao1i85JiXUVQXdapkeMuB3N+Ta3Ag==","signatures":[{"sig":"MEQCIA3NqX0g7BniFGrb4MtYBaeXjc47/FeOTCFcRPJu5+IoAiB4nLNwz6vKwGW6KoGPPe5nW72NK4nzSAndhuDzuIzCrg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31697},"main":"dist/index.js","type":"module","_from":"file:benkovy-doh-protocol-0.1.0.tgz","types":"dist/index.d.ts","scripts":{"test":"vitest run","build":"rm -rf dist && tsc -p tsconfig.json","pack:dry":"npm pack --dry-run","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"benkovy","email":"benjamnkovacs@gmail.com"},"_resolved":"/private/var/folders/fv/sllphrqn2rx6pzy4gx4l698r0000gn/T/ee5ffd751773ab9ff80e3f6a03840c62/benkovy-doh-protocol-0.1.0.tgz","_integrity":"sha512-TuLVusZFnPOIi7AFY4wIeLb4PE+RuJfE6iirGG7s+DUeq8h2a36wTw516Ao1i85JiXUVQXdapkeMuB3N+Ta3Ag==","_npmVersion":"11.2.0","description":"Shared protocol schemas and envelope types for DOH","directories":{},"_nodeVersion":"23.7.0","dependencies":{"zod":"^4.1.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/doh-protocol_0.1.0_1772407383371_0.971822846995589","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@benkovy/doh-protocol","version":"0.1.1","license":"MIT","_id":"@benkovy/doh-protocol@0.1.1","maintainers":[{"name":"benkovy","email":"benjamnkovacs@gmail.com"}],"dist":{"shasum":"e1e4cd92911e966ae5276f59e9a2c35316273efa","tarball":"https://registry.npmjs.org/@benkovy/doh-protocol/-/doh-protocol-0.1.1.tgz","fileCount":5,"integrity":"sha512-irlNuXrsTI26w2iAv74Cq/4aTztABOJVzsNn+UvcTcDFwRMgiG8OLQInSpCIO4GTMi/BNzaAvlEEYgbLbiM9Vw==","signatures":[{"sig":"MEUCIAvE60pvfXxU/SLBlexf8rr2KXc1uIuF1OHVLYGDRAtCAiEAtOqXRjNReOqYx3npuuGFRHgmZMoNrzspH7ccC0vWMD4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32486},"main":"dist/index.js","type":"module","_from":"file:benkovy-doh-protocol-0.1.1.tgz","types":"dist/index.d.ts","scripts":{"test":"vitest run","build":"rm -rf dist && tsc -p tsconfig.json","pack:dry":"npm pack --dry-run","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"benkovy","email":"benjamnkovacs@gmail.com"},"_resolved":"/private/var/folders/fv/sllphrqn2rx6pzy4gx4l698r0000gn/T/305dfb1798cc7dc0c5a7988bff077907/benkovy-doh-protocol-0.1.1.tgz","_integrity":"sha512-irlNuXrsTI26w2iAv74Cq/4aTztABOJVzsNn+UvcTcDFwRMgiG8OLQInSpCIO4GTMi/BNzaAvlEEYgbLbiM9Vw==","_npmVersion":"11.2.0","description":"Shared protocol schemas and envelope types for DOH","directories":{},"_nodeVersion":"23.7.0","dependencies":{"zod":"^4.1.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/doh-protocol_0.1.1_1773144627702_0.9847763893889241","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@benkovy/doh-protocol","version":"0.1.2","license":"MIT","_id":"@benkovy/doh-protocol@0.1.2","maintainers":[{"name":"benkovy","email":"benjamnkovacs@gmail.com"}],"dist":{"shasum":"364b6e1d110d805979b7ecf706d605d2bf2930b6","tarball":"https://registry.npmjs.org/@benkovy/doh-protocol/-/doh-protocol-0.1.2.tgz","fileCount":5,"integrity":"sha512-QL9saryCbi3lEmrP+jr0AxYcv8bGZ0rWa9n8PvUmRyjh8z/qT8nAZOGNeeW52J8yc34HzVr+vbbx2wsn0/uAtw==","signatures":[{"sig":"MEUCIClwm1J4in0AnK8mGGyxFSMZwrNZCzSL1onruPHtsXuPAiEAlPccxtw9txAwAQqRa8r2ywTW0rroZAARjyTMuGKd2OQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":53777},"main":"dist/index.js","type":"module","_from":"file:benkovy-doh-protocol-0.1.2.tgz","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","react-native":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"rm -rf dist && tsc -p tsconfig.json","pack:dry":"npm pack --dry-run","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"benkovy","email":"benjamnkovacs@gmail.com"},"_resolved":"/private/var/folders/fv/sllphrqn2rx6pzy4gx4l698r0000gn/T/3fe1d17dbfb08bccb6a385d8a63b8757/benkovy-doh-protocol-0.1.2.tgz","_integrity":"sha512-QL9saryCbi3lEmrP+jr0AxYcv8bGZ0rWa9n8PvUmRyjh8z/qT8nAZOGNeeW52J8yc34HzVr+vbbx2wsn0/uAtw==","_npmVersion":"11.2.0","description":"Shared protocol schemas and envelope types for DOH","directories":{},"_nodeVersion":"23.7.0","dependencies":{"zod":"^4.1.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/doh-protocol_0.1.2_1773280635132_0.32320031763808044","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@benkovy/doh-protocol","version":"0.1.3","license":"MIT","_id":"@benkovy/doh-protocol@0.1.3","maintainers":[{"name":"benkovy","email":"benjamnkovacs@gmail.com"}],"dist":{"shasum":"6a210bc3a0b1b526bfdece6c8c000bf7e264c402","tarball":"https://registry.npmjs.org/@benkovy/doh-protocol/-/doh-protocol-0.1.3.tgz","fileCount":26,"integrity":"sha512-xPy8s8vtY0fURVlBcoBnzcC8DA2Ac1LLHf6BziBpEdXBzs1veDJGKSX8nzc+hICsI5tF8bbv7HG0y/NZR4Yh8Q==","signatures":[{"sig":"MEUCIQDNRjzmaGkYgAOwvGh4eZhsQBXvvEM7U6V8LrTm3Ed8IAIgBij63SsKjEoP4MjqOF12Dr6ZB26if5+SYIC8ME4BftM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":92719},"main":"dist/index.js","type":"module","_from":"file:benkovy-doh-protocol-0.1.3.tgz","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","react-native":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"rm -rf dist && tsc -p tsconfig.json","pack:dry":"npm pack --dry-run","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"benkovy","email":"benjamnkovacs@gmail.com"},"_resolved":"/private/var/folders/fv/sllphrqn2rx6pzy4gx4l698r0000gn/T/e57e2466fe7bddbb0870e5678d71a60f/benkovy-doh-protocol-0.1.3.tgz","_integrity":"sha512-xPy8s8vtY0fURVlBcoBnzcC8DA2Ac1LLHf6BziBpEdXBzs1veDJGKSX8nzc+hICsI5tF8bbv7HG0y/NZR4Yh8Q==","_npmVersion":"11.2.0","description":"Shared protocol schemas and envelope types for DOH","directories":{},"_nodeVersion":"23.7.0","dependencies":{"zod":"^4.1.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/doh-protocol_0.1.3_1774107795929_0.8236061075590542","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@benkovy/doh-protocol","version":"0.1.4","license":"MIT","_id":"@benkovy/doh-protocol@0.1.4","maintainers":[{"name":"benkovy","email":"benjamnkovacs@gmail.com"}],"dist":{"shasum":"84d2ffa23c1b090400049c8320269ae9ce146e52","tarball":"https://registry.npmjs.org/@benkovy/doh-protocol/-/doh-protocol-0.1.4.tgz","fileCount":32,"integrity":"sha512-VoQJL2hkpMwEgD3r70sTF/JUnVZdnNAIS1DB8tQNBn4Qr7IcpKeBp0laOnc6uGlBpQn2IVWaQ2mOFPSuUui0Gg==","signatures":[{"sig":"MEYCIQCeGKZrFDsbGFmqZdoMHvcKDDrYy8ebplxiBol5/RWUoQIhAK21sFL8VbijsX9OigLC7UeiaUG2fm0xqdTSGTCL1780","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":99487},"main":"dist/index.js","type":"module","_from":"file:benkovy-doh-protocol-0.1.4.tgz","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","react-native":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"rm -rf dist && tsc -p tsconfig.json","pack:dry":"npm pack --dry-run","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"benkovy","email":"benjamnkovacs@gmail.com"},"_resolved":"/private/var/folders/fv/sllphrqn2rx6pzy4gx4l698r0000gn/T/5f117e5772c1ffefcddb5e2e6ad6ef56/benkovy-doh-protocol-0.1.4.tgz","_integrity":"sha512-VoQJL2hkpMwEgD3r70sTF/JUnVZdnNAIS1DB8tQNBn4Qr7IcpKeBp0laOnc6uGlBpQn2IVWaQ2mOFPSuUui0Gg==","_npmVersion":"11.2.0","description":"Shared protocol schemas and envelope types for DOH","directories":{},"_nodeVersion":"23.7.0","dependencies":{"zod":"^4.1.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/doh-protocol_0.1.4_1775417877048_0.4252621136408343","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@benkovy/doh-protocol","version":"0.1.5","license":"MIT","_id":"@benkovy/doh-protocol@0.1.5","maintainers":[{"name":"benkovy","email":"benjamnkovacs@gmail.com"}],"dist":{"shasum":"52a9be7a4d9b05dd517256644a81ab9ad3452201","tarball":"https://registry.npmjs.org/@benkovy/doh-protocol/-/doh-protocol-0.1.5.tgz","fileCount":32,"integrity":"sha512-wtvYoULBwrXmNdmtoRpSWnBOYU2OCee5UwXheK/WugvJTd14F0yxo5GCesQZXd3tBhV1QNZNC428Emw7mRcJMw==","signatures":[{"sig":"MEUCIQCtOWYrJTArcs8w7VmINTEWYscGaWQKcsmLtNZx+ZsRbQIgGBEy6pmnwyrqjFGy/szMne0ZFZ75WK5XzbBYad1JuYg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":103238},"main":"dist/index.js","type":"module","_from":"file:benkovy-doh-protocol-0.1.5.tgz","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","react-native":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"rm -rf dist && tsc -p tsconfig.json","pack:dry":"npm pack --dry-run","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"benkovy","email":"benjamnkovacs@gmail.com"},"_resolved":"/private/var/folders/fv/sllphrqn2rx6pzy4gx4l698r0000gn/T/23ba2e37c99c5df08e066106905b78f9/benkovy-doh-protocol-0.1.5.tgz","_integrity":"sha512-wtvYoULBwrXmNdmtoRpSWnBOYU2OCee5UwXheK/WugvJTd14F0yxo5GCesQZXd3tBhV1QNZNC428Emw7mRcJMw==","_npmVersion":"11.2.0","description":"Shared protocol schemas and envelope types for DOH","directories":{},"_nodeVersion":"23.7.0","dependencies":{"zod":"^4.1.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/doh-protocol_0.1.5_1775525579784_0.39364232555226786","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@benkovy/doh-protocol","version":"0.1.6","description":"Shared protocol schemas and envelope types for DOH","license":"MIT","type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","react-native":"./dist/index.js","import":"./dist/index.js","default":"./dist/index.js"}},"publishConfig":{"access":"public"},"dependencies":{"zod":"^4.1.5"},"devDependencies":{"vitest":"^3.2.4"},"scripts":{"build":"rm -rf dist && tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","test":"vitest run","pack:dry":"npm pack --dry-run"},"_id":"@benkovy/doh-protocol@0.1.6","_integrity":"sha512-mIb11tK+wwwPRVEbu+vb8N6KjaLIQ0H9raiZxaI71v9fGAi7nyiEALb0Vc2tqkZz0gOgZmMeolB5XHONO6zfOQ==","_resolved":"/private/var/folders/fv/sllphrqn2rx6pzy4gx4l698r0000gn/T/3f014a21d109be4adce0fba290a6e282/benkovy-doh-protocol-0.1.6.tgz","_from":"file:benkovy-doh-protocol-0.1.6.tgz","_nodeVersion":"23.7.0","_npmVersion":"11.2.0","dist":{"integrity":"sha512-mIb11tK+wwwPRVEbu+vb8N6KjaLIQ0H9raiZxaI71v9fGAi7nyiEALb0Vc2tqkZz0gOgZmMeolB5XHONO6zfOQ==","shasum":"f3c868b7997d4116573bea84eb15242dd8ded4c2","tarball":"https://registry.npmjs.org/@benkovy/doh-protocol/-/doh-protocol-0.1.6.tgz","fileCount":32,"unpackedSize":94234,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCF76HneuFHaKRBPxKtDWk6fPbKh33qGaCPXpfipR6kcQIhAP1XsjjEaN+LLJfOBYds8seolW6G8apECB/SZqDl5s0f"}]},"_npmUser":{"name":"benkovy","email":"benjamnkovacs@gmail.com"},"directories":{},"maintainers":[{"name":"benkovy","email":"benjamnkovacs@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/doh-protocol_0.1.6_1775526169458_0.40349423709917676"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-01T23:23:03.248Z","modified":"2026-04-07T01:42:49.713Z","0.1.0":"2026-03-01T23:23:03.512Z","0.1.1":"2026-03-10T12:10:27.863Z","0.1.2":"2026-03-12T01:57:15.286Z","0.1.3":"2026-03-21T15:43:16.074Z","0.1.4":"2026-04-05T19:37:57.188Z","0.1.5":"2026-04-07T01:32:59.980Z","0.1.6":"2026-04-07T01:42:49.597Z"},"license":"MIT","description":"Shared protocol schemas and envelope types for DOH","maintainers":[{"name":"benkovy","email":"benjamnkovacs@gmail.com"}],"readme":"# @benkovy/doh-protocol\n\nShared protocol package for all DOH runtime components.\n\n## Purpose\n\nThis package defines wire-level message schemas and strongly-typed envelopes used by:\n\n- `@benkovy/doh-backend`\n- `@benkovy/doh-host`\n- future DOH channel clients\n\nUsing one package for contracts prevents drift between backend and host/client implementations.\n\n## Scope\n\nCurrent schema set includes:\n\n- host handshake envelopes (`host.hello`, `backend.challenge`, `host.proof`, `backend.ready`, `backend.error`)\n- relay command envelopes (`relay.send`, `relay.history.request`, `relay.conversations.request`)\n- relay stream envelopes (`relay.event`, `relay.history.response`, `relay.conversations.response`)\n- client stream control envelopes (`client.hello`, `client.subscribe`, `client.unsubscribe`)\n- backend->client stream envelopes (`backend.client.ready`, `backend.client.event`, `backend.client.error`)\n\n## Host auth handshake (P1-1)\n\nCurrent handshake sequence:\n\n1. Host sends `host.hello`\n2. Backend replies with `backend.challenge` (`challengeId`, `nonce`, `expiresAt`)\n3. Host sends `host.proof` with HMAC signature over canonical proof base\n4. Backend replies `backend.ready` on success, or `backend.error` on failure\n\n`buildHostProofBase(...)` is exported and should be used by both backend and connector to avoid signature drift.\n\n### Backend auth error codes\n\n- `AUTH_REQUIRED`\n- `AUTH_INVALID_HOST`\n- `AUTH_CHALLENGE_REQUIRED`\n- `AUTH_CHALLENGE_EXPIRED`\n- `AUTH_CHALLENGE_MISMATCH`\n- `AUTH_TIMESTAMP_SKEW`\n- `AUTH_SIGNATURE_INVALID`\n- `AUTH_REPLAY_DETECTED`\n- `BAD_ENVELOPE`\n- `INTERNAL_ERROR`\n\n## Validation approach\n\n- Runtime validation uses `zod`\n- Compile-time types are inferred from schemas\n- Envelope parsing should happen at every trust boundary\n\n## Usage\n\n```ts\nimport { parseBackendEnvelope } from \"@benkovy/doh-protocol\";\n\nconst envelope = parseBackendEnvelope(JSON.parse(raw));\n```\n\n## Design notes\n\n- Keep envelope `type` values stable and additive\n- Prefer optional fields for backward compatible evolution\n- Use explicit ids (`eventId`, `requestId`, `clientMessageId`) for idempotency and reconciliation\n","readmeFilename":"README.md"}