{"versions":{"0.0.0-stage":{"name":"dsh-auth-cookie-guard","version":"0.0.0-stage","description":"Temporary package placeholder for staged publishing","stub":true,"_id":"dsh-auth-cookie-guard@0.0.0-stage","dist":{"integrity":"sha512-juyjjSR6HAsfV8VmH9Eg8YN64o2qsjvtGCqXbdpoxY0sMdlnkEu2hOUZJG4unwSi3ni4DeW983BlQFJoiSXNpw==","shasum":"6c86648d6de360a2ffb775492a1e2492005bbc35","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dsh-auth-cookie-guard/-/dsh-auth-cookie-guard-0.0.0-stage.tgz","fileCount":2,"unpackedSize":343,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGyxrlb+t9WGfJuvzkGUisH4ieb/YixTFATYxLFg38J5AiEAwfpICPX3MYyhWmL0UtNaaK6vKgWDWa7XCJr23jFz56E="}],"size":371},"_npmUser":{"name":"anonymous","email":"2168496262@qq.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"2168496262@qq.com"}],"_cnpmcore_publish_time":"2026-10-30T10:59:36.267Z","publish_time":1793357976267,"_hasShrinkwrap":false,"_source_registry_name":"default","contributors":[]},"1.0.0":{"_id":"dsh-auth-cookie-guard@1.0.0","dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"bugs":{"url":"https://github.com/jitianjiyan/dsh-auth-cookie-guard/issues"},"dist":{"shasum":"f405bfb4d954bea1e400b12e57c8dd187ec198bd","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dsh-auth-cookie-guard/-/dsh-auth-cookie-guard-1.0.0.tgz","fileCount":8,"integrity":"sha512-3ZN7ftwRNqeGwZtG9QuJozZU4zYJ6mQTgaNwuWQABnnJjjr0K2Ki9bavnm1weeGByWDyhjieFD2PO1PxIXFlew==","signatures":[{"sig":"MEQCICxUQfxQxw/YmnXXtV1IQ5vwFXc+/CbJflpw6vWzmkLfAiA5/euMJECjdKqZV6oBBRctU7Ogdop0y3fDwFzuhT0M3w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICX51ofj8r8pWk5s4NbmGZdAJijGrrjDaHUdwP5vhM+hAiAaQtiOcvtrRpJCIlFHyDqx6NcxRbF7lSCrXhbFPpMsCg=="}],"unpackedSize":20669,"size":9778},"main":"index.js","name":"dsh-auth-cookie-guard","type":"module","engines":{"node":"^22.19.0 || >=24.0.0"},"exports":{".":"./index.js","./icon":"./icon.svg","./locale/*.json":"./locale/*.json"},"gitHead":"c323ff7f1b5d094db94a0b80a7250d324552232e","license":"MIT","version":"1.0.0","_npmUser":{"name":"anonymous","email":"2168496262@qq.com"},"homepage":"https://github.com/jitianjiyan/dsh-auth-cookie-guard#readme","keywords":["dsh","deepseek-harness","dsh-plugin","cookie","startup","guard"],"repository":{"url":"git+https://github.com/jitianjiyan/dsh-auth-cookie-guard.git","type":"git"},"_npmVersion":"11.16.0","description":"Give the local listener a header budget large enough for its own launch cookies, and retire the cookies of every earlier start, so the desktop welcome handshake cannot lock a profile out after ~72 restarts.","directories":{},"maintainers":[{"name":"anonymous","email":"2168496262@qq.com"}],"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"packageManager":"pnpm@11.7.0","_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-auth-cookie-guard_1.0.0_1793358051969_0.766271019903177"},"_cnpmcore_publish_time":"2026-10-30T11:00:52.052Z","publish_time":1793358052052,"_source_registry_name":"default","contributors":[]},"1.0.1":{"_id":"dsh-auth-cookie-guard@1.0.1","dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"bugs":{"url":"https://github.com/jitianjiyan/dsh-auth-cookie-guard/issues"},"dist":{"shasum":"53a4aa094c983ad68e2151cb3e8300c205e0b460","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dsh-auth-cookie-guard/-/dsh-auth-cookie-guard-1.0.1.tgz","fileCount":8,"integrity":"sha512-N6Op9mL4t5YLRTNyzaTjBnnn6Fi1iIuJYMn4VqMFqxqXxuqyrGWOjOIZs2h/th2WSHXwGq/SJoKkaUpP1xW/hg==","signatures":[{"sig":"MEUCICjgmmt+ny7222XMF+KEjg9AkABvhxAVdY+fmDjgJB0IAiEA2SIMd8lXP4YSxcsLDU2CLLSOWfnOjZkt/GTo/GfbkFI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFo8lriIsiKk4JrrMeaRy7g8uoGDQpE9RZiWKmb7TPpVAiEApeI2FZLw82jHxTEqwS7VOiYIDWcVk8x3e6cdQIq0W7E="}],"unpackedSize":22702,"size":10534},"main":"index.js","name":"dsh-auth-cookie-guard","type":"module","engines":{"node":"^22.19.0 || >=24.0.0"},"exports":{".":"./index.js","./icon":"./icon.svg","./locale/*.json":"./locale/*.json"},"gitHead":"0179d55cdaa09dfbe8861f3fccb1032d73a43eaa","license":"MIT","scripts":{"test":"node --test test/handshake.test.js"},"version":"1.0.1","_npmUser":{"name":"anonymous","email":"2168496262@qq.com"},"homepage":"https://github.com/jitianjiyan/dsh-auth-cookie-guard#readme","keywords":["dsh","deepseek-harness","dsh-plugin","cookie","startup","guard"],"repository":{"url":"git+https://github.com/jitianjiyan/dsh-auth-cookie-guard.git","type":"git"},"_npmVersion":"11.16.0","description":"Give the local listener a header budget large enough for its own launch cookies, and retire the cookies of every earlier start, so the desktop welcome handshake cannot lock a profile out after ~72 restarts.","directories":{},"maintainers":[{"name":"anonymous","email":"2168496262@qq.com"}],"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"packageManager":"pnpm@11.7.0","_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-auth-cookie-guard_1.0.1_1793363812084_0.21731606844779394"},"_cnpmcore_publish_time":"2026-10-30T12:36:52.166Z","publish_time":1793363812166,"_source_registry_name":"default","contributors":[]},"1.0.2":{"_id":"dsh-auth-cookie-guard@1.0.2","dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"bugs":{"url":"https://github.com/jitianjiyan/dsh-auth-cookie-guard/issues"},"dist":{"shasum":"0391fb825427099a75cf98ed606b5d97da9e6947","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dsh-auth-cookie-guard/-/dsh-auth-cookie-guard-1.0.2.tgz","fileCount":8,"integrity":"sha512-cIi/yWgO9WRdzPA8hCl9l4GdpXmbQjCX1VwIzvF5WRxgtBtT3WVxGBEf9aTdXYMga6zbv7+FAYXN9zhIXo0svA==","signatures":[{"sig":"MEUCIH7+WidHW9bXsaLCIzqavCe/1nJ72aRViEqIl6Z3Qv8wAiEAlEgzirr7Ae1oUeGoeD1/jfcvI7fkqDn7qPOIN5fT6XE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHo+HecyWk0lGZo3IBvi1HZnUMJWpgQ34ACSQX1I71L1AiEAstBGLEWWSl3IedM9Rnij6BfiE4drA5ITr6tZDi12eVE="}],"unpackedSize":23700,"size":11018},"main":"index.js","name":"dsh-auth-cookie-guard","type":"module","engines":{"node":"^22.19.0 || >=24.0.0"},"exports":{".":"./index.js","./icon":"./icon.svg","./locale/*.json":"./locale/*.json"},"gitHead":"0179d55cdaa09dfbe8861f3fccb1032d73a43eaa","license":"MIT","scripts":{"test":"node --test test/handshake.test.js"},"version":"1.0.2","_npmUser":{"name":"anonymous","email":"2168496262@qq.com"},"homepage":"https://github.com/jitianjiyan/dsh-auth-cookie-guard#readme","keywords":["dsh","deepseek-harness","dsh-plugin","cookie","startup","guard"],"repository":{"url":"git+https://github.com/jitianjiyan/dsh-auth-cookie-guard.git","type":"git"},"_npmVersion":"11.16.0","description":"Give the local listener a header budget large enough for its own launch cookies, and retire the cookies of every earlier start, so the desktop welcome handshake cannot lock a profile out after ~72 restarts.","directories":{},"maintainers":[{"name":"anonymous","email":"2168496262@qq.com"}],"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"packageManager":"pnpm@11.7.0","_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-auth-cookie-guard_1.0.2_1793364766165_0.0494933324778678"},"_cnpmcore_publish_time":"2026-10-30T12:52:46.264Z","publish_time":1793364766264,"_source_registry_name":"default","contributors":[]},"1.0.3":{"_id":"dsh-auth-cookie-guard@1.0.3","dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"bugs":{"url":"https://github.com/jitianjiyan/dsh-auth-cookie-guard/issues"},"dist":{"shasum":"d620cee21b8a0826dda8a3b4aa8319e533130625","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dsh-auth-cookie-guard/-/dsh-auth-cookie-guard-1.0.3.tgz","fileCount":8,"integrity":"sha512-VDU/xJ6pPzhp/D0TXzpWyxMBiW/IjTRQROsY/upujsw88SRu6rGCx5em8aYOKS5w68Pw9WUzmwuHjU6ZxXXztw==","signatures":[{"sig":"MEYCIQD0MaGyq3NAd0K/BbI5EsNZaVjeopJqhFUz2Md7czJ9ugIhAMwYhf4JKhDncYl7MzqlZvW+/uhrgxT8smP5Ev5sUxa0","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEh9pvHwyJOVsGex9Fd4G47jjEza3+63jLXcWI1z4reMAiAEg41iYplGWDi2vX2Tp/WWI7az6WsXKcE2gL6QEpQ5WA=="}],"unpackedSize":23700,"size":11017},"main":"index.js","name":"dsh-auth-cookie-guard","type":"module","engines":{"node":"^22.19.0 || >=24.0.0"},"exports":{".":"./index.js","./icon":"./icon.svg","./locale/*.json":"./locale/*.json"},"gitHead":"253345cf00f045563a8211ab20e00f86018a75d6","license":"MIT","scripts":{"test":"node --test test/handshake.test.js"},"version":"1.0.3","_npmUser":{"name":"anonymous","email":"2168496262@qq.com"},"homepage":"https://github.com/jitianjiyan/dsh-auth-cookie-guard#readme","keywords":["dsh","deepseek-harness","dsh-plugin","cookie","startup","guard"],"repository":{"url":"git+https://github.com/jitianjiyan/dsh-auth-cookie-guard.git","type":"git"},"_npmVersion":"11.16.0","description":"Give the local listener a header budget large enough for its own launch cookies, and retire the cookies of every earlier start, so the desktop welcome handshake cannot lock a profile out after ~72 restarts.","directories":{},"maintainers":[{"name":"anonymous","email":"2168496262@qq.com"}],"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"packageManager":"pnpm@11.7.0","_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-auth-cookie-guard_1.0.3_1793364999711_0.9152809890909095"},"_cnpmcore_publish_time":"2026-10-30T12:56:39.809Z","publish_time":1793364999809,"_source_registry_name":"default","contributors":[]},"1.0.4":{"_id":"dsh-auth-cookie-guard@1.0.4","dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"bugs":{"url":"https://github.com/jitianjiyan/dsh-auth-cookie-guard/issues"},"dist":{"shasum":"8233d51cd5b91706fe8203d8c71fe43b9da9e718","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dsh-auth-cookie-guard/-/dsh-auth-cookie-guard-1.0.4.tgz","fileCount":8,"integrity":"sha512-tbHULJTh6JH4TtfxUesAHOsUJ899jV+6EG+slbx0VjPFxe/Qr/rUXBI2S9cQJyk3K2jiEwgCe27NLirbu478Jg==","signatures":[{"sig":"MEUCIBitK/be8MYM3t+Pu8s9LdF419pe+6Muejverz/oFDgrAiEAo24sK5GTl0Ed77lJx34+rVRMKUj7yk363OZovC/o7zI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC2xAXnaICYtB1ixEr6r5nDgEIjvABXma9B61gtjBKKGgIgPKN4FBlroWpAhkgAesJhIlxTX9QEU8PUOSQ2p1Yn9O8="}],"unpackedSize":24814,"size":11661},"main":"index.js","name":"dsh-auth-cookie-guard","type":"module","engines":{"node":"^22.19.0 || >=24.0.0"},"exports":{".":"./index.js","./icon":"./icon.svg","./locale/*.json":"./locale/*.json"},"gitHead":"1e5758f7979acc27d1d3ab3c0f144a2377813a0c","license":"MIT","scripts":{"test":"node --test test/handshake.test.js"},"version":"1.0.4","_npmUser":{"name":"anonymous","email":"2168496262@qq.com"},"homepage":"https://github.com/jitianjiyan/dsh-auth-cookie-guard#readme","keywords":["dsh","deepseek-harness","dsh-plugin","cookie","startup","guard"],"repository":{"url":"git+https://github.com/jitianjiyan/dsh-auth-cookie-guard.git","type":"git"},"_npmVersion":"11.16.0","description":"Give the local listener a header budget large enough for its own launch cookies, and retire the cookies of every earlier start, so the desktop welcome handshake cannot lock a profile out after ~72 restarts.","directories":{},"maintainers":[{"name":"anonymous","email":"2168496262@qq.com"}],"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"packageManager":"pnpm@11.7.0","_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-auth-cookie-guard_1.0.4_1793412688082_0.5146016648206799"},"_cnpmcore_publish_time":"2026-10-31T02:11:28.163Z","publish_time":1793412688163,"_source_registry_name":"default","contributors":[]},"1.0.5":{"_id":"dsh-auth-cookie-guard@1.0.5","dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"bugs":{"url":"https://github.com/jitianjiyan/dsh-auth-cookie-guard/issues"},"dist":{"shasum":"8c9a7701e54543f85045c91c73946ec53df72692","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dsh-auth-cookie-guard/-/dsh-auth-cookie-guard-1.0.5.tgz","fileCount":9,"integrity":"sha512-A06YFQMDaaOowd4wtfrfVuk9LAgLMcqVJTEYxGaIvRBOfTrzXZ7y9syIXoz9oYdStoAGgowlMkLmK0z4CP2KLQ==","signatures":[{"sig":"MEYCIQCa1bfvjU7FGWqteuA8VCFea4NvRb6jmY84uphla0yrkgIhAM/qNeTETZV51krpCZewcwH4lDT+a77x9MBBLDpZWpDZ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAj40wqkVk5qqhBr7AXXmGCT8FkLiKf749Nh5MSxhvL4AiEAjam+i7d3ZdgbX0K5IRlm4RY314mZX+4Z5ANhJ4Y++rQ="}],"unpackedSize":32022,"size":14546},"main":"index.js","name":"dsh-auth-cookie-guard","type":"module","engines":{"node":"^22.19.0 || >=24.0.0"},"exports":{".":"./index.js","./icon":"./icon.svg","./locale/*.json":"./locale/*.json"},"gitHead":"44e34e02d7b755f04b3aa25fa9c6eebe583b6513","license":"MIT","scripts":{"test":"node --test"},"version":"1.0.5","_npmUser":{"name":"anonymous","email":"2168496262@qq.com"},"homepage":"https://github.com/jitianjiyan/dsh-auth-cookie-guard#readme","keywords":["dsh","deepseek-harness","dsh-plugin","cookie","startup","guard"],"repository":{"url":"git+https://github.com/jitianjiyan/dsh-auth-cookie-guard.git","type":"git"},"_npmVersion":"11.16.0","description":"Give the local listener a header budget large enough for its own launch cookies, and retire the cookies of every earlier start, so the desktop welcome handshake cannot lock a profile out after ~72 restarts.","directories":{},"maintainers":[{"name":"anonymous","email":"2168496262@qq.com"}],"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"packageManager":"pnpm@11.7.0","_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-auth-cookie-guard_1.0.5_1793451368066_0.03181110425480871"},"_cnpmcore_publish_time":"2026-10-31T12:56:08.147Z","publish_time":1793451368147,"_source_registry_name":"default","contributors":[]},"1.0.6":{"_id":"dsh-auth-cookie-guard@1.0.6","dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"bugs":{"url":"https://github.com/jitianjiyan/dsh-auth-cookie-guard/issues"},"dist":{"shasum":"83a2565f3b3427f5a94fbf868ec07e24e326e9c2","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dsh-auth-cookie-guard/-/dsh-auth-cookie-guard-1.0.6.tgz","fileCount":8,"integrity":"sha512-5gPDs2JsNBjPXtnA3f8kaJIW9dQVMRmyAFWpChN74jS+pKix4qAZMVieWuq/0Uhw/9uJCPbnVrhHqBobSfR0Aw==","signatures":[{"sig":"MEUCIQDCPzKDXBiOd0MbBI23ahqNiw+qUj9XGWCAGbKnAjRpDQIgC0Hw38upptt4Sme7NawRxHU4Bbiv0dcX7QFg2OGhPio=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFBCWkOD1zd7X5fJ3MlOPR5CPZoB+uL2JqFcgZNHYgxAAiEApmDyMs+Nr4052nTk802WMG6+Tlty46sqiyfspQ4TRHk="}],"unpackedSize":24783,"size":11656},"main":"index.js","name":"dsh-auth-cookie-guard","type":"module","engines":{"node":"^22.19.0 || >=24.0.0"},"exports":{".":"./index.js","./icon":"./icon.svg","./locale/*.json":"./locale/*.json"},"gitHead":"1768ac7720cf312472cbc9b3f70d782931756bad","license":"MIT","scripts":{"test":"node --test test/handshake.test.js"},"version":"1.0.6","_npmUser":{"name":"anonymous","email":"2168496262@qq.com"},"homepage":"https://github.com/jitianjiyan/dsh-auth-cookie-guard#readme","keywords":["dsh","deepseek-harness","dsh-plugin","cookie","startup","guard"],"repository":{"url":"git+https://github.com/jitianjiyan/dsh-auth-cookie-guard.git","type":"git"},"_npmVersion":"11.16.0","description":"Give the local listener a header budget large enough for its own launch cookies, and retire the cookies of every earlier start, so the desktop welcome handshake cannot lock a profile out after ~72 restarts.","directories":{},"maintainers":[{"name":"anonymous","email":"2168496262@qq.com"}],"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"packageManager":"pnpm@11.7.0","_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-auth-cookie-guard_1.0.6_1793452469176_0.004748746153937722"},"_cnpmcore_publish_time":"2026-10-31T13:14:29.270Z","publish_time":1793452469270,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"1.0.6"},"name":"dsh-auth-cookie-guard","time":{"created":"2026-10-30T10:59:52.324Z","modified":"2026-10-31T13:14:47.546Z","0.0.0-stage":"2026-10-30T10:59:36.267Z","1.0.0":"2026-10-30T11:00:52.052Z","1.0.1":"2026-10-30T12:36:52.166Z","1.0.2":"2026-10-30T12:52:46.264Z","1.0.3":"2026-10-30T12:56:39.809Z","1.0.4":"2026-10-31T02:11:28.163Z","1.0.5":"2026-10-31T12:56:08.147Z","1.0.6":"2026-10-31T13:14:29.270Z"},"readme":"# 启动 Cookie 守护（dsh-auth-cookie-guard）\n\n修复 DSH 桌面版「固定 profile 启动约 72 次后永久报 `desktop welcome: Web authentication failed`」的问题。\n\n## 症状\n\n- 固定 profile（固定 `userData`）连续启动约 72 次之后，桌面端再也进不去，日志里是 `desktop welcome: Web authentication failed`（`app.asar/lib/main.js:8886` 的 `connectDesktopWelcome`）。\n- 重启、撤销授权、重装都无效，只有换掉整个 profile（也就是换掉 Chromium 的 cookie 库）才能恢复。\n\n## 根因\n\n1. Host 每次启动都绑定随机端口；浏览器会话 cookie 按授权方命名：\n   `dsh-auth-<base64url(sha256(host:port))>`（`dsh-client-connection/lib/index.js:277`、`:335-337`）。\n2. 浏览器按**域名**存 cookie，端口不进键。于是每启动一次，`127.0.0.1` 上就多一条约 173 字符、`Max-Age` 30 天的持久 cookie，且没有任何代码删除它们。\n3. Host 建监听器时没有覆盖头部预算——`createServer(listener)`（`dsh-host-webserver/lib/index.js:412`）——因此沿用 Node 默认的 `maxHeaderSize = 16384` 字节。\n4. 第 71 条累积后 `Cookie` 头约 16184 字节，本轮再下发 1 条即约 16411 字节，超过 16384，Node 直接返回 `431`；客户端把它当成认证失败。此后每次启动都超过上限，而 431 的请求根本到不了应用层，也就没有任何机会清理——故障是纯累积型且不可自愈的。\n\n## 插件做了什么\n\n两层防护，缺一不可：\n\n| 层 | 行为 | 默认值 |\n| --- | --- | --- |\n| 头部预算 | 在 `webServer` 服务就绪后把 `server.maxHeaderSize` 提升到 64 KiB | `maxHeaderBytes: 65536` |\n| 退休旧 cookie | 每个请求只读取 `Cookie` 头里的名字（必须是 `dsh-auth-<43 位 base64url>`）；按浏览器发送顺序（旧→新）保留最后 `keep` 条 + 当前端口那一条，其余用 `Max-Age=0; Path=/` 从浏览器 jar 删除（每个响应最多 96 条，约 12 KiB） | `keep: 4` |\n\n几点设计取舍：\n\n- **为什么两层都要**：只提升预算，约 350 次启动后依旧会撞墙（只是把 72 次变成 350 次）；只清理而不提升预算，则清理逻辑永远跑不到——431 在 Node 的 HTTP 解析层就被拒了，请求不会进入监听器。\n- **为什么只读名字、不解码 cookie 值**：cookie 值是 DSH 的签名会话载荷（`authority`/`issuedAt`/`expiresAt`）。这些 cookie 都是 `Path=/`，浏览器按创建时间从旧到新发送（RFC 6265 §5.4），所以位置本身就能排出新旧；名字足够定位，值既不参与认证判断，也不再被解析、记录或使用。\n- **为什么保留当前端口那条**：即使 `keep` 配得很小、或系统时钟回拨，也不会把正在使用的那条 cookie 删掉。\n- **为什么用 `Max-Age=0` 而不是改名或重写**：cookie 名与端口/协议绑定（`requestAudience`），改名会让认证查不到；重签名需要密钥。删除是唯一不改变语义的收敛方式。\n- **对异常格式零影响**：只匹配 `dsh-auth-` + 43 位 base64url 的精确形状；cookie 值里带什么（包括伪造的 `issuedAt`）都不影响保留/删除结果。若未来 cookie 名字格式变化，退化结果是「预算提升、不再清理」，而不是破坏会话。\n- **不会越界**：只处理 `webServer` 自己的局域网/本机监听器；其它 profile 的 host 有独立 cookie 库，互不影响。\n- **为什么单响应最多删 96 条**：删除行长度由固定名字形状决定（约 125 字节/条），96 条约 12 KiB，留在 Node HTTP 客户端默认 16 KiB 响应头预算之内——实测 128 条（约 16 KiB）会让 `fetch` 解码握手直接失败。更大的 jar 不会丢清理，只是在后续请求里分批删完，绝不会用一条超大的响应头去赌客户端容忍度。\n- **64 KiB 为什么够**：Chromium 对单域名有条数上限（180 条），每条 minted cookie 约 173 字符，理论上限约 33 KB，已经落在 64 KiB 之内。即使一个已经被锁死的 jar 条数拉满，也能在第一次握手时被放行，并当场收敛。\n\n## 安全边界\n\n- **只看请求自己的 cookie**：插件在 Host 进程内只能看到发往本监听的请求所携带的 Cookie，也就是请求者自己浏览器的那一份；不跨用户、不读取磁盘上的其他 cookie 库。\n- **只读名字与顺序**：从 1.0.4 起不解码 cookie 值、不记录任何 cookie 名字或值；整个包只 import `node:crypto`，没有网络、文件、子进程调用。回归测试里有一例专门守着「名字和值不进日志」。\n- **不参与认证**：它从不改写、重签或保留认证凭据，也不做登录判断；删除指令只是把请求者自己 jar 里本次实例不再用的启动 cookie 清掉，认证仍由 DSH 自己的签名校验负责。\n- **头部预算的副作用**：默认把监听器的 `maxHeaderSize` 提到 64 KiB。默认回环监听下这只影响本机；如果把 DSH 绑到回环之外，远端请求可以多占每连接头部内存——对外暴露时应加反向代理/访问控制，或把 `maxHeaderBytes` 调低。\n- **同 host 多实例**：浏览器 cookie 按 host 共享，插件会退休「最新 `keep` 条 + 当前端口」之外的启动 cookie；同一份 profile 同时跑多个实例时，较旧实例的登录可能被清理，需要重新走一次欢迎页握手。当前实例自己的 cookie 始终保留。\n\n## 配置\n\n在 profile 的 patch 层给这一行加 `config` 即可（`maxHeaderBytes` 会被夹到 16 KiB–1 MiB，`keep` 到 1–64）：\n\n```yaml\n- id: auth-cookie-guard\n  name: dsh-auth-cookie-guard\n  config:\n    maxHeaderBytes: 131072\n    keep: 4\n```\n\n一般不需要改。若某台机器上 cookie 已经多到超过 64 KiB（约 350 次启动），把 `maxHeaderBytes` 临时调到 `262144`，启动一次让清理跑完，再调回默认值即可。\n\n## 安装与卸载\n\n- 安装：在 DSH 插件页填入 `dsh-auth-cookie-guard` 安装（或执行 `dsh plugin add dsh-auth-cookie-guard`）。工具会把它写进 profile 的 `package.json`（`dsh.profile.bundles` 与 npm 依赖）；本 bundle 自带的 `cordis.patch.yml` 作为独立层插入那一行，profile 自己的 `cordis.patch.yml` 不需要任何改动。不要手改 profile 文件。\n- 生效方式：安装时宿主会重载组合，插件当场 apply，无需重启桌面端；之后每次启动同样自动生效。\n- 卸载：在插件管理中移除该 bundle，重启桌面端；卸载后会恢复监听器的原始头部预算（插件在 dispose 时还原）。\n- 本插件只有 Host 端，没有浏览器端资源，也没有 service / tool / event。\n- 开发时也可以直接安装本仓库源码目录（工具会以 `link:` 方式引入），发布版走 npm 包 `dsh-auth-cookie-guard`。\n\n## 验证\n\n用一个真实的 `node:http` 服务器模拟 71 条旧 cookie + 本轮 1 条（构造方式与报告一致）：\n\n```\ncookie header bytes: 16414\nBEFORE: {\"status\":431}                       # 安装前：与线上故障同因\n[info] auth-cookie-guard: listener header budget 65536 bytes, keeping 4 launch cookie(s)\n[info] auth-cookie-guard: retired 68 launch cookie(s), kept 4\nAFTER: status 200 deletions 68               # 安装后：握手通过，并当场清掉 68 条\nkept names: 4 (current kept)                 # 最新 4 条保留，当前端口那一条保留\nmaxHeaderSize now: 65536\nAFTER PRUNE: 200 deletions 0                 # 第二次请求不再产生删除头（幂等）\nmaxHeaderSize restored: undefined            # dispose 后还原\n```\n\n线上验证（对本机已安装、正在运行的宿主直接探测，插件安装后即时生效）：\n\n```\nbig header 20KB:  {\"status\":401}            # 提升预算前这里是 431\n71 cookies:       401 deletions: 68         # 当场退休 68 条，保留最新 4 条\n```\n\n第一行说明请求已经进入应用层（401 是未认证的正常响应，而不是 Node 在解析层回的 431），即 `maxHeaderSize` 已抬到 64 KiB；第二行说明裁剪逻辑在真实请求上生效。宿主日志同时会打印\n`auth-cookie-guard: listener header budget 65536 bytes, keeping 4 launch cookie(s)` 与\n`auth-cookie-guard: retired N launch cookie(s), kept 4`，此后无论重启多少次都不再累积。\n\n回归测试 `npm test`（14 例）覆盖：303 对象写头（真实握手路径）、隐式 200、三参数写头、平铺数组写头、`appendHeader` 多值、无清理时不包装 `writeHead`、64 KiB 预算下 200 条 cookie（约 19 KiB）仍能握手、400 条 jar 分 5 轮各 ≤96 条收敛且客户端不报错、按顺序而非 cookie 值排序、名字和值不进日志——旧实现会在 303 上丢掉全部删除指令，128 条的上限也会让 `fetch` 解码失败。\n\n## 环境\n\nWindows 11、DSH 0.2.1-rc.3、Electron 44.7.0、Node 24.21.0（本机复现用 Node 24.18.0）。`server.maxHeaderSize` 在运行时赋值即对后续连接生效，这一点已在 Node 24 上实测（431 → 200，70000 字节 → 431）。","users":{}}