{"_id":"@deepseek-ai/dsh-session","_rev":"6052453-6a7db5805d87649b71299aa2","dist-tags":{"latest":"0.0.1-rc.1","next":"0.1.1-rc.2"},"name":"@deepseek-ai/dsh-session","time":{"created":"2026-08-13T12:16:00.820Z","modified":"2026-08-21T12:30:27.898Z","0.1.0-rc.3":"2026-08-13T11:05:05.466Z","0.0.1-rc.1":"2026-08-10T19:35:50.717Z","0.0.1-rc.5":"2026-08-12T22:29:55.400Z","0.0.1-rc.3":"2026-08-12T20:32:28.474Z","0.1.0-rc.6":"2026-08-13T12:15:46.884Z","0.0.1-rc.2":"2026-08-11T15:17:39.514Z","0.1.0-rc.2":"2026-08-13T09:38:05.352Z","0.1.0-rc.7":"2026-08-17T11:35:06.509Z","0.1.0-rc.8":"2026-08-19T15:27:25.660Z","0.1.1-rc.1":"2026-08-21T06:37:03.633Z","0.1.1-rc.2":"2026-08-21T12:30:07.578Z"},"versions":{"0.1.0-rc.3":{"name":"@deepseek-ai/dsh-session","version":"0.1.0-rc.3","license":"MIT","_id":"@deepseek-ai/dsh-session@0.1.0-rc.3","maintainers":[{"name":"imccyu","email":"imccyu@gmail.com"},{"name":"tianyicui-deepseek","email":"tianyi@deepseek.com"}],"homepage":"https://github.com/deepseek-ai/deepseek-harness#readme","bugs":{"url":"https://github.com/deepseek-ai/deepseek-harness/issues"},"dist":{"shasum":"01068261e6408db1b2e8e7632b2ca3b639e948f9","tarball":"https://registry.npmmirror.com/@deepseek-ai/dsh-session/-/dsh-session-0.1.0-rc.3.tgz","fileCount":27,"integrity":"sha512-gYWTelny6wRhYbO5hXLUarv7Re5L2j9eCXfARwMwhbU/hltPfXVnnseCBV6uQvzcpCLGGjwlwiYCT7aoXNsHUA==","signatures":[{"sig":"MEYCIQDScixAbRxCTDYAxqg6ceN7Cmq47+jen6VM3fyZ2qwngQIhANEQsRacl9ilBIJ9nzfHbQTbbj9i1zUUEwGQ2EV7Nr4p","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":289853,"size":87454},"main":"lib/index.js","type":"module","_from":"file:/home/runner/work/deepseek-harness/deepseek-harness/dist/npm/deepseek-ai-dsh-session-0.1.0-rc.3.tgz","types":"lib/types/index.d.ts","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./src/*":"./src/*","./types":{"types":"./lib/types/types.d.ts","default":"./lib/types/types.js"},"./surface":{"types":"./lib/types/surface.d.ts","default":"./lib/types/surface.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./package.json":"./package.json"},"_npmUser":{"name":"imccyu","email":"imccyu@gmail.com"},"_resolved":"/home/runner/work/deepseek-harness/deepseek-harness/dist/npm/deepseek-ai-dsh-session-0.1.0-rc.3.tgz","_integrity":"sha512-gYWTelny6wRhYbO5hXLUarv7Re5L2j9eCXfARwMwhbU/hltPfXVnnseCBV6uQvzcpCLGGjwlwiYCT7aoXNsHUA==","repository":{"url":"git+https://github.com/deepseek-ai/deepseek-harness.git","type":"git","directory":"packages/core/session"},"_npmVersion":"11.16.0","description":"Event-sourced session store for the DeepSeek Harness","directories":{},"_nodeVersion":"24.18.0","publishConfig":{"access":"restricted"},"_hasShrinkwrap":false,"readmeFilename":"README.zh.md","devDependencies":{"@deepseek-ai/cordis":"^4.0.1","@deepseek-ai/dsh-llm":"^0.1.0-rc.3","@deepseek-ai/dsh-brand":"^0.1.0-rc.3","@deepseek-ai/dsh-scope":"^0.1.0-rc.3","@deepseek-ai/dsh-invariants":"^0.1.0-rc.3","@deepseek-ai/dsh-typert-protocol":"^0.1.0-rc.3","@deepseek-ai/dsh-typert-registry":"^0.1.0-rc.3"},"peerDependencies":{"@deepseek-ai/cordis":"^4.0.1","@deepseek-ai/dsh-llm":"^0.1.0-rc.3","@deepseek-ai/dsh-brand":"^0.1.0-rc.3","@deepseek-ai/dsh-scope":"^0.1.0-rc.3","@deepseek-ai/dsh-invariants":"^0.1.0-rc.3","@deepseek-ai/dsh-typert-protocol":"^0.1.0-rc.3"},"_npmOperationalInternal":{"tmp":"tmp/dsh-session_0.1.0-rc.3_1786619105316_0.5490801563479923","host":"s3://npm-registry-packages-npm-production"},"_cnpmcore_publish_time":"2026-08-13T11:05:05.466Z","publish_time":1786619105466,"_source_registry_name":"default"},"0.0.1-rc.1":{"name":"@deepseek-ai/dsh-session","version":"0.0.1-rc.1","license":"BSD-3-Clause","_id":"@deepseek-ai/dsh-session@0.0.1-rc.1","maintainers":[{"name":"imccyu","email":"imccyu@gmail.com"},{"name":"tianyicui-deepseek","email":"tianyi@deepseek.com"}],"homepage":"https://github.com/deepseek-ai/deepseek-harness#readme","bugs":{"url":"https://github.com/deepseek-ai/deepseek-harness/issues"},"dist":{"shasum":"ffa708efabf2a0b0d6b168240316046692811c95","tarball":"https://registry.npmmirror.com/@deepseek-ai/dsh-session/-/dsh-session-0.0.1-rc.1.tgz","fileCount":25,"integrity":"sha512-P3xE+0jDPMImdWhRi3e5ByhkA6LFTiabQwcK+Ofy763tWajDsadWpvONkc5Imd61thpVtXzH3uu25rZFvT5cfw==","signatures":[{"sig":"MEYCIQCEcujtfO7q9MyTlBEPBgbEEfDiDzD/mToDEqPbOW+ROQIhAMHg/JfgbTwb2LPFkYUQcZ1Ofh5rPt1nD7x7Si70bWdK","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":284484,"size":85312},"main":"lib/index.js","type":"module","_from":"file:/home/runner/work/deepseek-harness/deepseek-harness/dist/npm/deepseek-ai-dsh-session-0.0.1-rc.1.tgz","types":"lib/types/index.d.ts","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./src/*":"./src/*","./types":{"types":"./lib/types/types.d.ts","default":"./lib/types/types.js"},"./surface":{"types":"./lib/types/surface.d.ts","default":"./lib/types/surface.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./package.json":"./package.json"},"_npmUser":{"name":"imccyu","email":"imccyu@gmail.com"},"_resolved":"/home/runner/work/deepseek-harness/deepseek-harness/dist/npm/deepseek-ai-dsh-session-0.0.1-rc.1.tgz","_integrity":"sha512-P3xE+0jDPMImdWhRi3e5ByhkA6LFTiabQwcK+Ofy763tWajDsadWpvONkc5Imd61thpVtXzH3uu25rZFvT5cfw==","repository":{"url":"git+https://github.com/deepseek-ai/deepseek-harness.git","type":"git","directory":"packages/core/session"},"_npmVersion":"11.16.0","description":"Event-sourced session store for the DeepSeek Harness","directories":{},"_nodeVersion":"24.18.0","publishConfig":{"access":"restricted"},"_hasShrinkwrap":false,"devDependencies":{"@deepseek-ai/cordis":"^4.0.1-rc.1","@deepseek-ai/dsh-llm":"^0.0.1-rc.1","@deepseek-ai/dsh-brand":"^0.0.1-rc.1","@deepseek-ai/dsh-scope":"^0.0.1-rc.1","@deepseek-ai/dsh-type-meta":"^0.0.1-rc.1","@deepseek-ai/dsh-invariants":"^0.0.1-rc.1","@deepseek-ai/dsh-typert-registry":"^0.0.1-rc.1"},"peerDependencies":{"@deepseek-ai/cordis":"^4.0.1-rc.1","@deepseek-ai/dsh-llm":"^0.0.1-rc.1","@deepseek-ai/dsh-brand":"^0.0.1-rc.1","@deepseek-ai/dsh-scope":"^0.0.1-rc.1","@deepseek-ai/dsh-type-meta":"^0.0.1-rc.1","@deepseek-ai/dsh-invariants":"^0.0.1-rc.1"},"_npmOperationalInternal":{"tmp":"tmp/dsh-session_0.0.1-rc.1_1786390550530_0.45558927186636144","host":"s3://npm-registry-packages-npm-production"},"_cnpmcore_publish_time":"2026-08-10T19:35:50.717Z","publish_time":1786390550717,"_source_registry_name":"default"},"0.0.1-rc.5":{"name":"@deepseek-ai/dsh-session","version":"0.0.1-rc.5","license":"BSD-3-Clause","_id":"@deepseek-ai/dsh-session@0.0.1-rc.5","maintainers":[{"name":"imccyu","email":"imccyu@gmail.com"},{"name":"tianyicui-deepseek","email":"tianyi@deepseek.com"}],"homepage":"https://github.com/deepseek-ai/deepseek-harness#readme","bugs":{"url":"https://github.com/deepseek-ai/deepseek-harness/issues"},"dist":{"shasum":"aa95ba708a416b491ab145e8ac2ccacdba323680","tarball":"https://registry.npmmirror.com/@deepseek-ai/dsh-session/-/dsh-session-0.0.1-rc.5.tgz","fileCount":27,"integrity":"sha512-/xFNk3scb0KXGKW9vjpW4drNTHVJYEw5gdW8xOPbgO+8/4AEtrS2m69P5ancdgcpufheLgJQ1H6sacFUAP1IpQ==","signatures":[{"sig":"MEQCIGh9hAzNF4eUutDXH7CcTfoO0tmtK67hGfSH0Gmmiu6WAiAt0TvT/wWMtAc+dCkR2tn3RydBDPBpk3v/7gxnWHeLEA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":293303,"size":88719},"main":"lib/index.js","type":"module","_from":"file:/home/runner/work/deepseek-harness/deepseek-harness/dist/npm/deepseek-ai-dsh-session-0.0.1-rc.5.tgz","types":"lib/types/index.d.ts","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./src/*":"./src/*","./types":{"types":"./lib/types/types.d.ts","default":"./lib/types/types.js"},"./surface":{"types":"./lib/types/surface.d.ts","default":"./lib/types/surface.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./package.json":"./package.json"},"_npmUser":{"name":"imccyu","email":"imccyu@gmail.com"},"_resolved":"/home/runner/work/deepseek-harness/deepseek-harness/dist/npm/deepseek-ai-dsh-session-0.0.1-rc.5.tgz","_integrity":"sha512-/xFNk3scb0KXGKW9vjpW4drNTHVJYEw5gdW8xOPbgO+8/4AEtrS2m69P5ancdgcpufheLgJQ1H6sacFUAP1IpQ==","repository":{"url":"git+https://github.com/deepseek-ai/deepseek-harness.git","type":"git","directory":"packages/core/session"},"_npmVersion":"11.16.0","description":"Event-sourced session store for the DeepSeek Harness","directories":{},"_nodeVersion":"24.18.0","publishConfig":{"access":"restricted"},"_hasShrinkwrap":false,"readmeFilename":"README.zh.md","devDependencies":{"@deepseek-ai/cordis":"^4.0.1-rc.4","@deepseek-ai/dsh-llm":"^0.0.1-rc.5","@deepseek-ai/dsh-brand":"^0.0.1-rc.5","@deepseek-ai/dsh-scope":"^0.0.1-rc.5","@deepseek-ai/dsh-invariants":"^0.0.1-rc.5","@deepseek-ai/dsh-typert-protocol":"^0.0.1-rc.5","@deepseek-ai/dsh-typert-registry":"^0.0.1-rc.5"},"peerDependencies":{"@deepseek-ai/cordis":"^4.0.1-rc.4","@deepseek-ai/dsh-llm":"^0.0.1-rc.5","@deepseek-ai/dsh-brand":"^0.0.1-rc.5","@deepseek-ai/dsh-scope":"^0.0.1-rc.5","@deepseek-ai/dsh-invariants":"^0.0.1-rc.5","@deepseek-ai/dsh-typert-protocol":"^0.0.1-rc.5"},"_npmOperationalInternal":{"tmp":"tmp/dsh-session_0.0.1-rc.5_1786573795255_0.6832558000067068","host":"s3://npm-registry-packages-npm-production"},"_cnpmcore_publish_time":"2026-08-12T22:29:55.400Z","publish_time":1786573795400,"_source_registry_name":"default"},"0.0.1-rc.3":{"name":"@deepseek-ai/dsh-session","version":"0.0.1-rc.3","license":"BSD-3-Clause","_id":"@deepseek-ai/dsh-session@0.0.1-rc.3","maintainers":[{"name":"imccyu","email":"imccyu@gmail.com"},{"name":"tianyicui-deepseek","email":"tianyi@deepseek.com"}],"homepage":"https://github.com/deepseek-ai/deepseek-harness#readme","bugs":{"url":"https://github.com/deepseek-ai/deepseek-harness/issues"},"dist":{"shasum":"ad4324e854d171d5efb27ee5cf57fa37a95d2ad9","tarball":"https://registry.npmmirror.com/@deepseek-ai/dsh-session/-/dsh-session-0.0.1-rc.3.tgz","fileCount":27,"integrity":"sha512-dND5WhjGxjkSDpiPONw39qkeCe4Wvh25A+cNOGE0K81jFPEvWU/f06UHP++nRr+7R9q3EpFn++Fgp5yij6ky9w==","signatures":[{"sig":"MEUCIQCDVWE1B0LveyC1Cq3TKx/r0wLXI5ioN3vOMp5vylDncgIgFzLariF/nbjtcsB36hUB8MvdMx3iNnhvIQksp+ZsGoY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":293303,"size":88711},"main":"lib/index.js","type":"module","_from":"file:/home/runner/work/deepseek-harness/deepseek-harness/dist/npm/deepseek-ai-dsh-session-0.0.1-rc.3.tgz","types":"lib/types/index.d.ts","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./src/*":"./src/*","./types":{"types":"./lib/types/types.d.ts","default":"./lib/types/types.js"},"./surface":{"types":"./lib/types/surface.d.ts","default":"./lib/types/surface.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./package.json":"./package.json"},"_npmUser":{"name":"imccyu","email":"imccyu@gmail.com"},"_resolved":"/home/runner/work/deepseek-harness/deepseek-harness/dist/npm/deepseek-ai-dsh-session-0.0.1-rc.3.tgz","_integrity":"sha512-dND5WhjGxjkSDpiPONw39qkeCe4Wvh25A+cNOGE0K81jFPEvWU/f06UHP++nRr+7R9q3EpFn++Fgp5yij6ky9w==","repository":{"url":"git+https://github.com/deepseek-ai/deepseek-harness.git","type":"git","directory":"packages/core/session"},"_npmVersion":"11.16.0","description":"Event-sourced session store for the DeepSeek Harness","directories":{},"_nodeVersion":"24.18.0","publishConfig":{"access":"restricted"},"_hasShrinkwrap":false,"readmeFilename":"README.zh.md","devDependencies":{"@deepseek-ai/cordis":"^4.0.1-rc.1","@deepseek-ai/dsh-llm":"^0.0.1-rc.3","@deepseek-ai/dsh-brand":"^0.0.1-rc.3","@deepseek-ai/dsh-scope":"^0.0.1-rc.3","@deepseek-ai/dsh-invariants":"^0.0.1-rc.3","@deepseek-ai/dsh-typert-protocol":"^0.0.1-rc.3","@deepseek-ai/dsh-typert-registry":"^0.0.1-rc.3"},"peerDependencies":{"@deepseek-ai/cordis":"^4.0.1-rc.1","@deepseek-ai/dsh-llm":"^0.0.1-rc.3","@deepseek-ai/dsh-brand":"^0.0.1-rc.3","@deepseek-ai/dsh-scope":"^0.0.1-rc.3","@deepseek-ai/dsh-invariants":"^0.0.1-rc.3","@deepseek-ai/dsh-typert-protocol":"^0.0.1-rc.3"},"_npmOperationalInternal":{"tmp":"tmp/dsh-session_0.0.1-rc.3_1786566748282_0.5218414781063405","host":"s3://npm-registry-packages-npm-production"},"_cnpmcore_publish_time":"2026-08-12T20:32:28.474Z","publish_time":1786566748474,"_source_registry_name":"default"},"0.1.0-rc.6":{"name":"@deepseek-ai/dsh-session","description":"Event-sourced session store for the DeepSeek Harness","version":"0.1.0-rc.6","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/deepseek-ai/deepseek-harness.git","directory":"packages/core/session"},"type":"module","main":"lib/index.js","types":"lib/types/index.d.ts","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./types":{"types":"./lib/types/types.d.ts","default":"./lib/types/types.js"},"./src/*":"./src/*","./package.json":"./package.json","./surface":{"types":"./lib/types/surface.d.ts","default":"./lib/types/surface.js"}},"license":"MIT","peerDependencies":{"@deepseek-ai/dsh-invariants":"^0.1.0-rc.6","@deepseek-ai/dsh-brand":"^0.1.0-rc.6","@deepseek-ai/dsh-llm":"^0.1.0-rc.6","@deepseek-ai/dsh-scope":"^0.1.0-rc.6","@deepseek-ai/dsh-typert-protocol":"^0.1.0-rc.6","@deepseek-ai/cordis":"^4.0.1"},"devDependencies":{"@deepseek-ai/dsh-invariants":"^0.1.0-rc.6","@deepseek-ai/dsh-llm":"^0.1.0-rc.6","@deepseek-ai/dsh-scope":"^0.1.0-rc.6","@deepseek-ai/dsh-typert-protocol":"^0.1.0-rc.6","@deepseek-ai/dsh-typert-registry":"^0.1.0-rc.6","@deepseek-ai/cordis":"^4.0.1","@deepseek-ai/dsh-brand":"^0.1.0-rc.6"},"readmeFilename":"README.zh.md","_id":"@deepseek-ai/dsh-session@0.1.0-rc.6","bugs":{"url":"https://github.com/deepseek-ai/deepseek-harness/issues"},"homepage":"https://github.com/deepseek-ai/deepseek-harness#readme","_integrity":"sha512-8tu8I6VWC7050GAUXWhcEWQw4pakALQc8TlhKr52m7Y4+kIKeNt3FBgP86PaGPBtpK0p5zUPRQNkFpzZbBdxyw==","_resolved":"/home/runner/work/deepseek-harness/deepseek-harness/dist/npm/deepseek-ai-dsh-session-0.1.0-rc.6.tgz","_from":"file:/home/runner/work/deepseek-harness/deepseek-harness/dist/npm/deepseek-ai-dsh-session-0.1.0-rc.6.tgz","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-8tu8I6VWC7050GAUXWhcEWQw4pakALQc8TlhKr52m7Y4+kIKeNt3FBgP86PaGPBtpK0p5zUPRQNkFpzZbBdxyw==","shasum":"94e1b6931fd062c2311c2f1f80d0105240cf2602","tarball":"https://registry.npmmirror.com/@deepseek-ai/dsh-session/-/dsh-session-0.1.0-rc.6.tgz","fileCount":27,"unpackedSize":289849,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIB/QJp4x8igA1kg3rMejidxmU3Q7EFhtKOpTcxBGYv/sAiBQBQvVZ955L3BelQuHp0S3s2kPH/FdFf+sm5cVqDc8rg=="}],"size":87442},"_npmUser":{"name":"imccyu","email":"imccyu@gmail.com"},"directories":{},"maintainers":[{"name":"imccyu","email":"imccyu@gmail.com"},{"name":"tianyicui-deepseek","email":"tianyi@deepseek.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-session_0.1.0-rc.6_1786623346744_0.8912990549706936"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-08-13T12:15:46.884Z","publish_time":1786623346884,"_source_registry_name":"default"},"0.0.1-rc.2":{"name":"@deepseek-ai/dsh-session","version":"0.0.1-rc.2","license":"BSD-3-Clause","_id":"@deepseek-ai/dsh-session@0.0.1-rc.2","maintainers":[{"name":"imccyu","email":"imccyu@gmail.com"},{"name":"tianyicui-deepseek","email":"tianyi@deepseek.com"}],"homepage":"https://github.com/deepseek-ai/deepseek-harness#readme","bugs":{"url":"https://github.com/deepseek-ai/deepseek-harness/issues"},"dist":{"shasum":"9db5772790bc76b424ac6e9cd559d17a18b681cf","tarball":"https://registry.npmmirror.com/@deepseek-ai/dsh-session/-/dsh-session-0.0.1-rc.2.tgz","fileCount":27,"integrity":"sha512-oM+KXkxCzzkq+iJKM4NIHW/VGtPgkwMhMnlXSazdF29wwFtHocmFquqiDj0xksCDx4QoIjqRdHmi9Nu+KMkqiQ==","signatures":[{"sig":"MEQCIF/0nfy8G5dPVjR5zE/qnolOVqnJi4cknG0B9T06a76LAiBMRst3LjpHAM1jntMkqSJbpRfnZvd9ZI9ipo/uYr856A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":293200,"size":88673},"main":"lib/index.js","type":"module","_from":"file:/home/runner/work/deepseek-harness/deepseek-harness/dist/npm/deepseek-ai-dsh-session-0.0.1-rc.2.tgz","types":"lib/types/index.d.ts","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./src/*":"./src/*","./types":{"types":"./lib/types/types.d.ts","default":"./lib/types/types.js"},"./surface":{"types":"./lib/types/surface.d.ts","default":"./lib/types/surface.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./package.json":"./package.json"},"_npmUser":{"name":"imccyu","email":"imccyu@gmail.com"},"_resolved":"/home/runner/work/deepseek-harness/deepseek-harness/dist/npm/deepseek-ai-dsh-session-0.0.1-rc.2.tgz","_integrity":"sha512-oM+KXkxCzzkq+iJKM4NIHW/VGtPgkwMhMnlXSazdF29wwFtHocmFquqiDj0xksCDx4QoIjqRdHmi9Nu+KMkqiQ==","repository":{"url":"git+https://github.com/deepseek-ai/deepseek-harness.git","type":"git","directory":"packages/core/session"},"_npmVersion":"11.16.0","description":"Event-sourced session store for the DeepSeek Harness","directories":{},"_nodeVersion":"24.18.0","publishConfig":{"access":"restricted"},"_hasShrinkwrap":false,"readmeFilename":"README.zh.md","devDependencies":{"@deepseek-ai/cordis":"^4.0.1-rc.1","@deepseek-ai/dsh-llm":"^0.0.1-rc.2","@deepseek-ai/dsh-brand":"^0.0.1-rc.2","@deepseek-ai/dsh-scope":"^0.0.1-rc.2","@deepseek-ai/dsh-type-meta":"^0.0.1-rc.2","@deepseek-ai/dsh-invariants":"^0.0.1-rc.2","@deepseek-ai/dsh-typert-registry":"^0.0.1-rc.2"},"peerDependencies":{"@deepseek-ai/cordis":"^4.0.1-rc.1","@deepseek-ai/dsh-llm":"^0.0.1-rc.2","@deepseek-ai/dsh-brand":"^0.0.1-rc.2","@deepseek-ai/dsh-scope":"^0.0.1-rc.2","@deepseek-ai/dsh-type-meta":"^0.0.1-rc.2","@deepseek-ai/dsh-invariants":"^0.0.1-rc.2"},"_npmOperationalInternal":{"tmp":"tmp/dsh-session_0.0.1-rc.2_1786461459344_0.2613787365769893","host":"s3://npm-registry-packages-npm-production"},"_cnpmcore_publish_time":"2026-08-11T15:17:39.514Z","publish_time":1786461459514,"_source_registry_name":"default"},"0.1.0-rc.2":{"name":"@deepseek-ai/dsh-session","version":"0.1.0-rc.2","license":"MIT","_id":"@deepseek-ai/dsh-session@0.1.0-rc.2","maintainers":[{"name":"imccyu","email":"imccyu@gmail.com"},{"name":"tianyicui-deepseek","email":"tianyi@deepseek.com"}],"homepage":"https://github.com/deepseek-ai/deepseek-harness#readme","bugs":{"url":"https://github.com/deepseek-ai/deepseek-harness/issues"},"dist":{"shasum":"08b0d0048e24447a731b7fc1c4ee1eabdf6b8757","tarball":"https://registry.npmmirror.com/@deepseek-ai/dsh-session/-/dsh-session-0.1.0-rc.2.tgz","fileCount":27,"integrity":"sha512-e1hCWExCxJTxl+sims3dPkbj94Ma1BSwqp0cEVlt2fCsqF/wmsQNv7VC6z9awezRpsXWiYXnHj25CUYcdM631Q==","signatures":[{"sig":"MEUCIE6T1eseaUsBjiEtfLQGnAlrv1flHPPOP37hAtCnEvXGAiEAom3g5lbKMS+tmIygKh9fqxASmxIbhq4wTtGz0H3r+To=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":289853,"size":87444},"main":"lib/index.js","type":"module","_from":"file:/home/runner/work/deepseek-harness/deepseek-harness/dist/npm/deepseek-ai-dsh-session-0.1.0-rc.2.tgz","types":"lib/types/index.d.ts","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./src/*":"./src/*","./types":{"types":"./lib/types/types.d.ts","default":"./lib/types/types.js"},"./surface":{"types":"./lib/types/surface.d.ts","default":"./lib/types/surface.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./package.json":"./package.json"},"_npmUser":{"name":"imccyu","email":"imccyu@gmail.com"},"_resolved":"/home/runner/work/deepseek-harness/deepseek-harness/dist/npm/deepseek-ai-dsh-session-0.1.0-rc.2.tgz","_integrity":"sha512-e1hCWExCxJTxl+sims3dPkbj94Ma1BSwqp0cEVlt2fCsqF/wmsQNv7VC6z9awezRpsXWiYXnHj25CUYcdM631Q==","repository":{"url":"git+https://github.com/deepseek-ai/deepseek-harness.git","type":"git","directory":"packages/core/session"},"_npmVersion":"11.16.0","description":"Event-sourced session store for the DeepSeek Harness","directories":{},"_nodeVersion":"24.18.0","publishConfig":{"access":"restricted"},"_hasShrinkwrap":false,"readmeFilename":"README.zh.md","devDependencies":{"@deepseek-ai/cordis":"^4.0.1","@deepseek-ai/dsh-llm":"^0.1.0-rc.2","@deepseek-ai/dsh-brand":"^0.1.0-rc.2","@deepseek-ai/dsh-scope":"^0.1.0-rc.2","@deepseek-ai/dsh-invariants":"^0.1.0-rc.2","@deepseek-ai/dsh-typert-protocol":"^0.1.0-rc.2","@deepseek-ai/dsh-typert-registry":"^0.1.0-rc.2"},"peerDependencies":{"@deepseek-ai/cordis":"^4.0.1","@deepseek-ai/dsh-llm":"^0.1.0-rc.2","@deepseek-ai/dsh-brand":"^0.1.0-rc.2","@deepseek-ai/dsh-scope":"^0.1.0-rc.2","@deepseek-ai/dsh-invariants":"^0.1.0-rc.2","@deepseek-ai/dsh-typert-protocol":"^0.1.0-rc.2"},"_npmOperationalInternal":{"tmp":"tmp/dsh-session_0.1.0-rc.2_1786613885232_0.8973977134719884","host":"s3://npm-registry-packages-npm-production"},"_cnpmcore_publish_time":"2026-08-13T09:38:05.352Z","publish_time":1786613885352,"_source_registry_name":"default"},"0.1.0-rc.7":{"name":"@deepseek-ai/dsh-session","description":"Event-sourced session store for the DeepSeek Harness","version":"0.1.0-rc.7","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/deepseek-ai/deepseek-harness.git","directory":"packages/core/session"},"type":"module","main":"lib/index.js","types":"lib/types/index.d.ts","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./types":{"types":"./lib/types/types.d.ts","default":"./lib/types/types.js"},"./src/*":"./src/*","./package.json":"./package.json","./surface":{"types":"./lib/types/surface.d.ts","default":"./lib/types/surface.js"}},"license":"MIT","peerDependencies":{"@deepseek-ai/dsh-brand":"^0.1.0-rc.7","@deepseek-ai/dsh-invariants":"^0.1.0-rc.7","@deepseek-ai/dsh-llm":"^0.1.0-rc.7","@deepseek-ai/dsh-scope":"^0.1.0-rc.7","@deepseek-ai/dsh-typert-protocol":"^0.1.0-rc.7","@deepseek-ai/cordis":"^4.0.1"},"devDependencies":{"@deepseek-ai/dsh-brand":"^0.1.0-rc.7","@deepseek-ai/dsh-invariants":"^0.1.0-rc.7","@deepseek-ai/dsh-llm":"^0.1.0-rc.7","@deepseek-ai/dsh-scope":"^0.1.0-rc.7","@deepseek-ai/dsh-typert-protocol":"^0.1.0-rc.7","@deepseek-ai/dsh-typert-registry":"^0.1.0-rc.7","@deepseek-ai/cordis":"^4.0.1"},"readmeFilename":"README.zh.md","_id":"@deepseek-ai/dsh-session@0.1.0-rc.7","bugs":{"url":"https://github.com/deepseek-ai/deepseek-harness/issues"},"homepage":"https://github.com/deepseek-ai/deepseek-harness#readme","_integrity":"sha512-02WVTkqIH+TyDL7dhMN3Hm+qcTEdhD0fVDC0aIAyND2fBdXj3CagEXXvpmt3mzwWfKwOTGL1RdxtC6pMA4Bl1A==","_resolved":"/home/runner/work/deepseek-harness/deepseek-harness/dist/npm/deepseek-ai-dsh-session-0.1.0-rc.7.tgz","_from":"file:/home/runner/work/deepseek-harness/deepseek-harness/dist/npm/deepseek-ai-dsh-session-0.1.0-rc.7.tgz","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-02WVTkqIH+TyDL7dhMN3Hm+qcTEdhD0fVDC0aIAyND2fBdXj3CagEXXvpmt3mzwWfKwOTGL1RdxtC6pMA4Bl1A==","shasum":"e039ae55545cc4105f5254eaa1eac854c53fdba6","tarball":"https://registry.npmmirror.com/@deepseek-ai/dsh-session/-/dsh-session-0.1.0-rc.7.tgz","fileCount":27,"unpackedSize":289849,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDnHJzw7JneJFtYuMPGgvPSsI3PWXBbxnHymYoLs4qY8AiBioB1BmrxV4ReUyA9hL6R82a5gY3+3hb2bt7NCix88cg=="}],"size":87435},"_npmUser":{"name":"imccyu","email":"imccyu@gmail.com"},"directories":{},"maintainers":[{"name":"imccyu","email":"imccyu@gmail.com"},{"name":"tianyicui-deepseek","email":"tianyi@deepseek.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-session_0.1.0-rc.7_1786966506356_0.07352756431081242"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-08-17T11:35:06.509Z","publish_time":1786966506509,"_source_registry_name":"default"},"0.1.0-rc.8":{"name":"@deepseek-ai/dsh-session","description":"Event-sourced session store for the DeepSeek Harness","version":"0.1.0-rc.8","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/deepseek-ai/deepseek-harness.git","directory":"packages/core/session"},"type":"module","main":"lib/index.js","types":"lib/types/index.d.ts","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./types":{"types":"./lib/types/types.d.ts","default":"./lib/types/types.js"},"./src/*":"./src/*","./package.json":"./package.json","./surface":{"types":"./lib/types/surface.d.ts","default":"./lib/types/surface.js"}},"license":"MIT","peerDependencies":{"@deepseek-ai/dsh-brand":"^0.1.0-rc.8","@deepseek-ai/dsh-invariants":"^0.1.0-rc.8","@deepseek-ai/dsh-llm":"^0.1.0-rc.8","@deepseek-ai/dsh-scope":"^0.1.0-rc.8","@deepseek-ai/dsh-typert-protocol":"^0.1.0-rc.8","@deepseek-ai/cordis":"^4.0.1"},"devDependencies":{"@deepseek-ai/dsh-brand":"^0.1.0-rc.8","@deepseek-ai/dsh-invariants":"^0.1.0-rc.8","@deepseek-ai/dsh-typert-protocol":"^0.1.0-rc.8","@deepseek-ai/dsh-typert-registry":"^0.1.0-rc.8","@deepseek-ai/dsh-llm":"^0.1.0-rc.8","@deepseek-ai/dsh-scope":"^0.1.0-rc.8","@deepseek-ai/cordis":"^4.0.1"},"readmeFilename":"README.zh.md","_id":"@deepseek-ai/dsh-session@0.1.0-rc.8","bugs":{"url":"https://github.com/deepseek-ai/deepseek-harness/issues"},"homepage":"https://github.com/deepseek-ai/deepseek-harness#readme","_integrity":"sha512-Qs5Mgn32WPPVB4rKHjsZBgLOkh0TQurUAcc9GaDVudK4dUkpno2HDh++qu/PrwRA3CZ/iwPAoFHCpB3AMMaoLg==","_resolved":"/home/runner/work/deepseek-harness/deepseek-harness/dist/npm/deepseek-ai-dsh-session-0.1.0-rc.8.tgz","_from":"file:/home/runner/work/deepseek-harness/deepseek-harness/dist/npm/deepseek-ai-dsh-session-0.1.0-rc.8.tgz","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-Qs5Mgn32WPPVB4rKHjsZBgLOkh0TQurUAcc9GaDVudK4dUkpno2HDh++qu/PrwRA3CZ/iwPAoFHCpB3AMMaoLg==","shasum":"982301cc69d65c63e6abd82cbc8f7ae7e60ef978","tarball":"https://registry.npmmirror.com/@deepseek-ai/dsh-session/-/dsh-session-0.1.0-rc.8.tgz","fileCount":27,"unpackedSize":290618,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEb8H/8kxCrNvCoTqn2EEGxRUHvhwgLRY0YOZ2HiF17AAiEAvy/sIUTGwKzgHj3OkbwVnVNLIAvcSqri1fp0+TemQwA="}],"size":87701},"_npmUser":{"name":"imccyu","email":"imccyu@gmail.com"},"directories":{},"maintainers":[{"name":"imccyu","email":"imccyu@gmail.com"},{"name":"tianyicui-deepseek","email":"tianyi@deepseek.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-session_0.1.0-rc.8_1787153245504_0.7869161478985274"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-08-19T15:27:25.660Z","publish_time":1787153245660,"_source_registry_name":"default"},"0.1.1-rc.1":{"name":"@deepseek-ai/dsh-session","description":"Event-sourced session store for the DeepSeek Harness","version":"0.1.1-rc.1","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/deepseek-ai/deepseek-harness.git","directory":"packages/core/session"},"type":"module","main":"lib/index.js","types":"lib/types/index.d.ts","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./types":{"types":"./lib/types/types.d.ts","default":"./lib/types/types.js"},"./src/*":"./src/*","./package.json":"./package.json","./surface":{"types":"./lib/types/surface.d.ts","default":"./lib/types/surface.js"}},"license":"MIT","peerDependencies":{"@deepseek-ai/dsh-invariants":"^0.1.1-rc.1","@deepseek-ai/dsh-llm":"^0.1.1-rc.1","@deepseek-ai/dsh-brand":"^0.1.1-rc.1","@deepseek-ai/dsh-scope":"^0.1.1-rc.1","@deepseek-ai/dsh-typert-protocol":"^0.1.1-rc.1","@deepseek-ai/cordis":"^4.0.1"},"devDependencies":{"@deepseek-ai/dsh-invariants":"^0.1.1-rc.1","@deepseek-ai/dsh-llm":"^0.1.1-rc.1","@deepseek-ai/dsh-scope":"^0.1.1-rc.1","@deepseek-ai/dsh-typert-protocol":"^0.1.1-rc.1","@deepseek-ai/dsh-brand":"^0.1.1-rc.1","@deepseek-ai/dsh-typert-registry":"^0.1.1-rc.1","@deepseek-ai/cordis":"^4.0.1"},"readmeFilename":"README.zh.md","_id":"@deepseek-ai/dsh-session@0.1.1-rc.1","bugs":{"url":"https://github.com/deepseek-ai/deepseek-harness/issues"},"homepage":"https://github.com/deepseek-ai/deepseek-harness#readme","_integrity":"sha512-TypXRsDxHQzms8H44DYFOs3sD/1fVvpFcyPMtOSP0SY+u/e+P/xg/0PgCvEt1epigHkBXtHddjHNLMlhzy9mbQ==","_resolved":"/home/runner/work/deepseek-harness/deepseek-harness/dist/npm/deepseek-ai-dsh-session-0.1.1-rc.1.tgz","_from":"file:/home/runner/work/deepseek-harness/deepseek-harness/dist/npm/deepseek-ai-dsh-session-0.1.1-rc.1.tgz","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-TypXRsDxHQzms8H44DYFOs3sD/1fVvpFcyPMtOSP0SY+u/e+P/xg/0PgCvEt1epigHkBXtHddjHNLMlhzy9mbQ==","shasum":"c5bb5380d8bfe7afed2a197fbfb460c416ae6eb6","tarball":"https://registry.npmmirror.com/@deepseek-ai/dsh-session/-/dsh-session-0.1.1-rc.1.tgz","fileCount":27,"unpackedSize":290651,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDZfV5Qn6kf4KpfKw1+/nXNCwNBqz3eBgMgQzRgNdQERAiBZ9ifQjhpF7q8orvdNnuMdozM/M62PgXJq3w/ES7Hvqg=="}],"size":87714},"_npmUser":{"name":"imccyu","email":"imccyu@gmail.com"},"directories":{},"maintainers":[{"name":"imccyu","email":"imccyu@gmail.com"},{"name":"tianyicui-deepseek","email":"tianyi@deepseek.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-session_0.1.1-rc.1_1787294223432_0.894749617413426"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-08-21T06:37:03.633Z","publish_time":1787294223633,"_source_registry_name":"default"},"0.1.1-rc.2":{"name":"@deepseek-ai/dsh-session","description":"Event-sourced session store for the DeepSeek Harness","version":"0.1.1-rc.2","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/deepseek-ai/deepseek-harness.git","directory":"packages/core/session"},"type":"module","main":"lib/index.js","types":"lib/types/index.d.ts","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./types":{"types":"./lib/types/types.d.ts","default":"./lib/types/types.js"},"./src/*":"./src/*","./package.json":"./package.json","./surface":{"types":"./lib/types/surface.d.ts","default":"./lib/types/surface.js"}},"license":"MIT","peerDependencies":{"@deepseek-ai/dsh-brand":"^0.1.1-rc.2","@deepseek-ai/dsh-invariants":"^0.1.1-rc.2","@deepseek-ai/dsh-llm":"^0.1.1-rc.2","@deepseek-ai/dsh-scope":"^0.1.1-rc.2","@deepseek-ai/dsh-typert-protocol":"^0.1.1-rc.2","@deepseek-ai/cordis":"^4.0.1"},"devDependencies":{"@deepseek-ai/dsh-invariants":"^0.1.1-rc.2","@deepseek-ai/dsh-llm":"^0.1.1-rc.2","@deepseek-ai/dsh-scope":"^0.1.1-rc.2","@deepseek-ai/dsh-typert-protocol":"^0.1.1-rc.2","@deepseek-ai/dsh-typert-registry":"^0.1.1-rc.2","@deepseek-ai/dsh-brand":"^0.1.1-rc.2","@deepseek-ai/cordis":"^4.0.1"},"readmeFilename":"README.zh.md","_id":"@deepseek-ai/dsh-session@0.1.1-rc.2","bugs":{"url":"https://github.com/deepseek-ai/deepseek-harness/issues"},"homepage":"https://github.com/deepseek-ai/deepseek-harness#readme","_integrity":"sha512-4/cv6X9HPhm47eyRhCu/WZwzrtJKegk5J+0xaxcZ9i8S0smdxP57tqy8a0jkSshLQn7BzMFxneQrlYExrLrDhQ==","_resolved":"/home/runner/work/deepseek-harness/deepseek-harness/dist/npm/deepseek-ai-dsh-session-0.1.1-rc.2.tgz","_from":"file:/home/runner/work/deepseek-harness/deepseek-harness/dist/npm/deepseek-ai-dsh-session-0.1.1-rc.2.tgz","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-4/cv6X9HPhm47eyRhCu/WZwzrtJKegk5J+0xaxcZ9i8S0smdxP57tqy8a0jkSshLQn7BzMFxneQrlYExrLrDhQ==","shasum":"9c9335ab55aa9e3ea54102cc986e567bbf877b10","tarball":"https://registry.npmmirror.com/@deepseek-ai/dsh-session/-/dsh-session-0.1.1-rc.2.tgz","fileCount":27,"unpackedSize":290651,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIA1iSgLFj4uisKzvrmFqNyIOdE5dEbZl+vo2Ca5jbFuVAiEAplfBUPmEYbtSHu8eDtqVI9lTqPSpjJLoJIfwbY4yxOw="}],"size":87716},"_npmUser":{"name":"imccyu","email":"imccyu@gmail.com"},"directories":{},"maintainers":[{"name":"imccyu","email":"imccyu@gmail.com"},{"name":"tianyicui-deepseek","email":"tianyi@deepseek.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-session_0.1.1-rc.2_1787315407371_0.8759988323881283"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-08-21T12:30:07.578Z","publish_time":1787315407578,"_source_registry_name":"default"}},"bugs":{"url":"https://github.com/deepseek-ai/deepseek-harness/issues"},"description":"Event-sourced session store for the DeepSeek Harness","homepage":"https://github.com/deepseek-ai/deepseek-harness#readme","license":"BSD-3-Clause","maintainers":[{"name":"tianyicui-deepseek","email":"tianyi@deepseek.com"},{"name":"imccyu","email":"imccyu@gmail.com"}],"readme":"# dsh-session\n\nEnglish | [中文](README.zh.md)\n\nEvent-sourced session log and in-memory store. A `Session` is the append-only source of truth for an agent's whole interaction history — the LLM message history is *derived* from it. A **surface** layer (an ordered projection of message-producing events) is maintained on top of the raw log for efficient derivation and compaction.\n\nThe optional `@deepseek-ai/dsh-session/invariant` companion registers this package's relational trace checks with `ctx.invariants`: monotonic sequence numbers, turn/step enclosure, and same-step tool call/result pairing. It replays existing sessions when loaded or reloaded; storage validation, snapshotting, freezing, cited source-event validation, and surface acceptance remain always-on responsibilities of the root session package.\n\n## Service: `SessionStore` (ctx key: `sessions`)\n\nCreates and holds event-sourced `Session` instances. Persistence is intentionally not implemented here — plugins subscribe to `session/event`, flush on `session/flush`, and may mirror the paired `session/created`/`session/disposed` lifecycle.\n\n### Public API\n\n- `ctx.sessions.create(id?, { seed?, meta? }?)` validates and detaches durable seed/header data, fills the version and id, defaults `createdAt` to now, publishes the session, and binds it to the calling fiber. Persisted reconstruction supplies its original `createdAt`, `seedLength`, and `delegationDepth`.\n- `ctx.sessions.flush(session)` dispatches the awaited parallel durability checkpoint through the session's captured scope. Every listener starts and the call waits for all to settle before reporting failure; unpublished, detached, and stale objects reject.\n- `ctx.sessions.fork(source, boundary?, childSessionId?): Session` — Resolve a live session object or id, select a seed through the inclusive `boundary` event seq (default: current last event), require that prefix to end outside an open turn, and create a live child session with lineage metadata.\n- `ctx.sessions.get(id: SessionId): Session | undefined`\n- `ctx.sessions.list(): Session[]`\n\n#### Advanced: ordered-teardown lifecycle primitives\n\nUse the split lifecycle only when teardown must be ordered with another resource:\n\n- `prepare(id?, options?)` validates and constructs without publication.\n- `enter(session)` performs the collision check, publishes without announcing, and returns an entry-bound idempotent detach. Concurrent same-id preparations are allowed, but only one entry succeeds; a stale detach cannot remove its replacement.\n- `announce(session)` emits the single creation edge and rejects repeat or reentrant announcements. Detach during that dispatch is deferred and later emits the paired disposal edge; an unannounced entry emits neither lifecycle edge.\n\n`dsh-agent-loop` uses this split so final loop flush precedes session detach; see the [ownership Agent Note](../../../.agents/notes/implemented/architecture/2026-06-18-agent-lifecycle-and-ownership-contracts.md).\n\n### Live service events\n\nThe store pairs announced creation with disposal, publishes post-commit append notifications with per-listener containment, and provides an awaited durability checkpoint. Exact signatures and scope behavior live in the generated region of [session.md](../../../docs/subsystems/session.md#cordis-surface); payloads live in the [persistence catalog](../../../docs/persistence-catalog.md).\n\n### Class: `Session`\n\nPlain class (not a Cordis Service). Create live sessions through `ctx.sessions.create()` and detached replay or inspection sessions through `Session.create()`; the detached factory does not publish lifecycle events or bind the session to a fiber.\n\n- `session.append(type, data, opts?)` snapshots and freezes durable data and surface metadata, validates marker shape, cited source-event seqs, complete replacement coverage, and content-only single-result `tool/result` rewrites, commits synchronously, then notifies observers with independent failure containment. Reentrant attached-session appends reject, and runtime checks cover widened unions and loaded logs.\n- `session.deriveMessages()` incrementally projects each new surface entry once and returns a fresh array over the complete identified, frozen messages stored by those entries. Assistant messages preserve the provider and model that produced them plus adapter-private replay state in their model source. A surface rewrite rebuilds the projection; there is no raw-log fallback.\n- `session.deriveEventMessage(event)` is the canonical per-event projection used by reconstruction and request checks.\n- `session.surface` exposes the readonly `SessionSurface` view owned by the session's single incremental surface manager; `replaceGeneration` changes on every committed rewrite.\n- `session.events` is a cached frozen snapshot invalidated by append; accepted events remain deeply frozen.\n- `session.seq`, `session.id` — current sequence and readonly typed identity.\n- `session.header: SessionHeader` — detached, deep-frozen creation metadata (`version`, `id`, `createdAt`, optional `cwd`/`parentSession`/`seedLength`/`delegationDepth`). Construction validates the durable record and requires its id to match `session.id`.\n\n### Lossless JSON utilities\n\nDurable values need one accepted representation, not a check followed by a second read. `isJsonValue(value)` is the boolean predicate; `snapshotJsonValue(value)` iteratively validates and copies a plain value in one pass, returning `undefined` for invalid input and propagating a throwing getter. The snapshot helper accepts finite JSON numbers except `-0` (JSON rewrites it to `0`), dense ordinary arrays, and plain or null-prototype objects; it rejects cycles, unsupported scalars, and exotic prototypes before normalization without imposing a call-stack depth limit.\n\nSession-event import separates ownership from message validation. `snapshotSessionEvent(event)` clones a borrowed event before validating and freezing its identified message. `adoptSessionEvent(event)` performs the same message work in place and returns the original event; callers may use it only when they transfer an exclusively owned object graph with no mutable child shared with another event.\n\n### Chunk-row storage codec (`chunk-rows.ts`)\n\nThe shared [storage codec](src/chunk-rows.ts) losslessly converts event sequences to compact rows and back. It preserves unrecognized events verbatim and rejects malformed encoded rows; persistence backends decide whether to enable packed writes.\n\n### Surface types\n\nThis package owns ordered surface projection, replacement validation, replay, and the type guards that distinguish append-origin from replacement events. The [surface type catalog](../../../docs/subsystems/session.md#surface-types) owns the exact shapes and field semantics. A human transcript must project append-origin events rather than `session.surface`, because landed replacements shadow history the reader already saw; model-facing consumers continue to read `session.surface`.\n\n### Request-header reconstruction (`request-header.ts`)\n\n`request/header` records a full canonical snapshot of the non-history request envelope with reason `initial`, `resume`, or `change`. Its optional `adapterDefaults` map marks effective `reasoningEffort` or `maxTokens` values materialized by exact-model resolution, allowing the next request proposal to distinguish them from explicit conversation settings. `foldRequestHeader()` selects the latest snapshot; legacy delta events and the removed `fallback` reason are rejected. See the [reconstructable-requests Agent Note](../../../.agents/notes/implemented/architecture/2026-07-05-reconstructable-requests.md).\n\nA `user/message` stores the complete `UserMessage` directly, including the identity created before inbox routing or step entry. It renders its `content` verbatim whether it is a direct human prompt, a synthetic injection, or an entered goal round; its typed `source` is the only channel that tells them apart and carries any domain-specific durable facts. `assistant/message` and `tool/result` likewise store complete message values. Turn execution remains enclosed by `turn/start` and `turn/end`; `agent.inject()` queues input until a later pre-step claims it and returns it in an enter decision.\n\n`tool/result` persists one identified user-role tool-result message, optional internal failure identity, and optional presentation metadata. A tool's successful canonical `value` and human-readable canonical failure message remain execution-local; rendered error content is the replay-authoritative message.\n\n### Session event vocabulary (`types.ts`)\n\nThe generated [persistence log event catalog](../../../docs/persistence-catalog.md) enumerates each append-only event type with its payload, surface badge, and declaration site. Token accounting reads per-step `assistant/chunk { type: 'usage' }` records and treats `assistant/message.usage` as the committed-step fallback when no usage chunk exists; failed model-request attempts have no assistant message. Each `assistant/message` records the provider, model, and optional replay state.\n\nMerge-extensible via `SessionEventMap` — a plugin declaration-merges its own types (the compaction seam's `compact/*`, bounded recovery's non-surface `llm/retry`, the hook bridges' `hook/*`); merged members appear in the same catalog. A plugin owns the relational invariant for its merged events, including whether a log-only event may appear between turns. A producer that requires durability appends through `Session` and then awaits `ctx.sessions.flush(session)` without fabricating an execution turn.\n\nAlso defines `TurnEndReasonMap`, the merge-extensible `kind`-tagged sum type for turn endings. `turn/start` carries only the turn number; the following entered `user/message` batch records its input, while `llm/retry` records request recovery.\n\nAn interrupted live turn ends with `{ kind: 'aborted', reason: AgentCancelCause }`, preserving the typed cancellation cause in the durable transcript. Persistence imports the coarse aborted outcome from the supported older format as `{ kind: 'aborted', reason: { kind: 'legacy' } }`, because that record did not retain its caller. A turn failure carries `{ kind: 'error', error }`; crash recovery alone synthesizes `{ kind: 'interrupted' }`.\n\nEvery `SessionEvent` carries two optional top-level fields (structural metadata):\n\n- `sourceEventSeqs?: number[]` — seq numbers of earlier events cited as sources (e.g., the `assistant/chunk` seqs behind an `assistant/message`, or the shadowed entries behind a compaction replacement entry). On `assistant/message`, a present `[]` records a known empty provider stream, while omission means a legacy or foreign event did not record the source stream; other surface events require a non-empty list when this field is present.\n- `surfaceOp?: SurfaceOp` — how this event entered the surface. Absent for non-surface events (boundaries, chunks, usage, errors).\n\n### Metadata types (`types.ts`)\n\n- `SessionHeader` — session metadata written once when published as `Session.header`, where detachment and deep-freezing enforce immutability at runtime: `{ version, id, createdAt, cwd?, parentSession?, seedLength?, delegationDepth? }`. Persistence loaders may return mutable detached copies of the same data type. Owned here (beside `SessionId`) because `Session.header` is typed by it; persistence backends re-export it rather than own it (which would force a package cycle).\n\n### Extension points\n\n- Persistence plugins: subscribe to `session/event` (write-behind) and drain on `session/flush` (awaited) and fiber dispose. A durable backend reads the log and reloads it into a live session; the metadata contract (`SessionHeader`, `session.header`) is what such a backend stores beside the log.\n- Replay/fork: `create(id, { seed })` validates and freezes a contiguous current-format log and rebuilds its surface; request headers require provider/model, and assistant messages require provider/model provenance. Persistence owns read compatibility before constructing this current-format seed. `fork(source, boundary?, childSessionId?)` selects a completed-turn prefix and records lineage.\n- Compaction: `dsh-compact-basic` appends a `user/message` replacement for summary checkpoints, while `dsh-compact-tool-result-prune` appends a content-only `tool/result` replacement. Tool-pairing boundary policy and its cache belong to the [`dsh-compact` seam](../../compact/compact/README.md), while this package owns ordered surface membership, replacement validation, and `replaceGeneration`.\n\n## Model Experience\n\n### Derived message history\n\n#### What the model sees\n\nThe model receives the complete messages from `user/message`, `assistant/message`, and `tool/result` surface entries verbatim. Their identities, roles, sources, and content blocks are the same values established at creation; projections do not mint identities. A prompt envelope changes only human presentation; its prefix context and request delimiter are already present in the event content. Tool calls live inside assistant messages. Chunks, boundaries, usage, hook records, todo records, and other log-only events add no message.\n\n#### Token effect\n\nAppended surface entries are resent on later steps. A `replace` surface operation removes the shadowed entries from future inputs without deleting their raw log records.\n\n#### KV Cache effect\n\nAppended surface entries preserve reusable prefixes. A `replace` operation invalidates reuse from the first shadowed message even though the underlying event log stays append-only.\n\n### Crash-repair result\n\n#### What the model sees\n\nIf recovery finds an assistant tool request with no durable `tool/call`, its synthetic `TOOL_NOT_STARTED` result says `The tool call was interrupted before the Harness recorded it as started. Retry it if it is still needed.` If a durable `tool/call` has no result, its `TOOL_OUTCOME_UNKNOWN` result says `The tool call was interrupted after it was recorded, but no result was durably recorded. Its outcome is unknown. Decide whether to retry from the tool semantics: retry only if the operation is read-only or idempotent; if it may have side effects, first verify external state or ask the user. Do not retry blindly.`\n\n#### Token effect\n\nZero tokens in an intact session. Each repaired call adds its retained risk-specific error text on resume.\n\n#### KV Cache effect\n\nAppend-only; newly visible content follows the reusable request prefix and does not invalidate existing KV-cache entries.\n\n### Logged request header\n\n#### What the model sees\n\nThe session reconstructs the system prompt, tool schemas, call config, and session prefix that the loop actually sent. Header events do not add a second copy to message history; the prefix is prepended outside `deriveMessages()`.\n\n#### Token effect\n\nZero duplicate tokens from logging. The reconstructed prefix, system text, and schemas still incur their normal per-request cost.\n\n#### KV Cache effect\n\nLogging causes no invalidation, and exact reconstruction preserves request-prefix identity. A later header with changed prefix, prompt, or schemas may invalidate reuse from its first difference.\n\n## Known Limitations and Deferred Work\n\n- **Session branching/tree** (pi-style entry tree) — deferred unless needed beyond boundary-based `fork()`.\n- **`fork()` cuts only at stable boundaries of live sessions** — the selected prefix must end outside an open turn and the source must be in the store; forking a persisted-but-unloaded session is excluded from the [fork API](../../../.agents/notes/implemented/feature/2026-06-30-session-store-fork-api.md).\n- **`SESSION_FORMAT_VERSION` stays pinned at `0`** — pre-release, no broad compatibility implied: `Session` accepts only current seed shapes and a backend rejects any other version. Narrow storage import upgrades belong to the persistence boundary ([policy](../../../AGENTS.md), [pre-identity message recovery](../../../.agents/notes/implemented/bug-fix/2026-07-28-load-pre-identity-session-messages.md)).\n- **`TurnEndReasonMap` omits the ACP-named `refusal` / `max_turn_requests` variants** — producer-gated: they land when an adapter or the loop first emits them.\n","readmeFilename":"README.zh.md","repository":{"url":"git+https://github.com/deepseek-ai/deepseek-harness.git","type":"git","directory":"packages/core/session"},"_source_registry_name":"default"}