{"_id":"@amaster.ai/dsh-storage","_rev":"4-05b212fa785f5f9df81ba8361ecfd780","name":"@amaster.ai/dsh-storage","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"@amaster.ai/dsh-storage","version":"0.1.0","license":"MIT","_id":"@amaster.ai/dsh-storage@0.1.0","maintainers":[{"name":"qianchuan","email":"qdgemi@gmail.com"},{"name":"thornhill","email":"gpyx529@gmail.com"},{"name":"licy_mail","email":"licy_mail@qq.com"},{"name":"weaxs","email":"459312872@qq.com"},{"name":"2betop","email":"2betop.cn@gmail.com"},{"name":"lmaomaoz","email":"lmaomaoz@live.com"},{"name":"xiaojiaolv","email":"dfsq757@sina.com"},{"name":"xudong.ray","email":"xudzhang0914@gmail.com"}],"homepage":"https://github.com/TGYD-helige/dsh-plugins#readme","bugs":{"url":"https://github.com/TGYD-helige/dsh-plugins/issues"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"dist":{"shasum":"f537d5c93451d3fcca4a487e728f28290246a112","tarball":"https://registry.npmjs.org/@amaster.ai/dsh-storage/-/dsh-storage-0.1.0.tgz","fileCount":97,"integrity":"sha512-svA0Mwuz2qXUO6U/GZKAG4+yaTZ2U35MYdiriKRHur5yYx+ig/obNz1a1gMm3g5Bd50Ix5FYmxl6NhK1HqDoIw==","signatures":[{"sig":"MEQCICeMJnOSAoolW0CmHxPjWk9YpPPVDY5ylUGufqtO03lpAiAU6HRLNQyglf+uUifM+w8hSbpy/1wARiENJBruW7UExw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2578263},"main":"lib/index.js","type":"module","_from":"file:amaster.ai-dsh-storage-0.1.0.tgz","types":"lib/types/index.d.ts","engines":{"node":"^20.19 || ^22.12 || >=24.0"},"exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./package.json":"./package.json"},"scripts":{"test":"vitest run","build":"node scripts/prisma-generate.mjs && tsc -p tsconfig.build.json","generate":"node scripts/prisma-generate.mjs","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"xiaojiaolv","email":"dfsq757@sina.com"},"_resolved":"/tmp/220308dd91e811e962528a05dc8f338e/amaster.ai-dsh-storage-0.1.0.tgz","_integrity":"sha512-svA0Mwuz2qXUO6U/GZKAG4+yaTZ2U35MYdiriKRHur5yYx+ig/obNz1a1gMm3g5Bd50Ix5FYmxl6NhK1HqDoIw==","repository":{"url":"git+https://github.com/TGYD-helige/dsh-plugins.git","type":"git","directory":"packages/dsh-storage"},"_npmVersion":"10.9.8","description":"Session storage mirror for DeepSeek Harness: projects the session event stream into MySQL/PostgreSQL/SQLite/SQL Server (ai_messages / ai_chat_histories) without replacing dsh's local persistence.","directories":{},"_nodeVersion":"22.23.2","dependencies":{"@deepseek-ai/schemastery":"^3.18.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"prisma":"^7.9.1","vitest":"^4.1.11","typescript":"^5.6.3","@types/node":"^22.0.0","@prisma/client":"^7.9.1","@prisma/adapter-pg":"^7.9.1","@deepseek-ai/cordis":"^4.0.1","@prisma/adapter-mssql":"^7.9.1","@prisma/adapter-libsql":"^7.9.1","@prisma/adapter-mariadb":"^7.9.1"},"peerDependencies":{"@prisma/client":"^7.9.1","@prisma/adapter-pg":"^7.9.1","@deepseek-ai/cordis":"^4.0.1","@prisma/adapter-mssql":"^7.9.1","@prisma/adapter-libsql":"^7.9.1","@prisma/adapter-mariadb":"^7.9.1","@deepseek-ai/dsh-session":"0.1.0-rc.7"},"peerDependenciesMeta":{"@prisma/client":{"optional":true},"@prisma/adapter-pg":{"optional":true},"@prisma/adapter-mssql":{"optional":true},"@prisma/adapter-libsql":{"optional":true},"@prisma/adapter-mariadb":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dsh-storage_0.1.0_1787917864020_0.5411071145423196","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@amaster.ai/dsh-storage","version":"0.1.1","license":"MIT","_id":"@amaster.ai/dsh-storage@0.1.1","maintainers":[{"name":"qianchuan","email":"qdgemi@gmail.com"},{"name":"thornhill","email":"gpyx529@gmail.com"},{"name":"licy_mail","email":"licy_mail@qq.com"},{"name":"weaxs","email":"459312872@qq.com"},{"name":"2betop","email":"2betop.cn@gmail.com"},{"name":"lmaomaoz","email":"lmaomaoz@live.com"},{"name":"xiaojiaolv","email":"dfsq757@sina.com"},{"name":"xudong.ray","email":"xudzhang0914@gmail.com"}],"homepage":"https://github.com/TGYD-helige/dsh-plugins#readme","bugs":{"url":"https://github.com/TGYD-helige/dsh-plugins/issues"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"dist":{"shasum":"9b309de94d73a2f7427d4d5bd192a7ec8465dd8a","tarball":"https://registry.npmjs.org/@amaster.ai/dsh-storage/-/dsh-storage-0.1.1.tgz","fileCount":97,"integrity":"sha512-IzRBM0XZtQwiLUJituqRB5XQPKIN3ZJcfEApuoeeZCA2pFWNpJzMC7eRK1JO60YfuOEWbo43+2mSUmk3vHTVOQ==","signatures":[{"sig":"MEUCIQDm3088AcXLfx+AeRbyXnd/SaI7XeJUlyl8wPBQDbUQYwIgBJ4tt3SL8JjduaO8/l891YIihkRJhpxjDu4gJDixwMo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2578263},"main":"lib/index.js","type":"module","_from":"file:amaster.ai-dsh-storage-0.1.1.tgz","types":"lib/types/index.d.ts","engines":{"node":"^20.19 || ^22.12 || >=24.0"},"exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./package.json":"./package.json"},"scripts":{"test":"vitest run","build":"node scripts/prisma-generate.mjs && tsc -p tsconfig.build.json","generate":"node scripts/prisma-generate.mjs","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"xiaojiaolv","email":"dfsq757@sina.com"},"_resolved":"/tmp/ef9617f2bcfd91d2c495c046e45c3a0b/amaster.ai-dsh-storage-0.1.1.tgz","_integrity":"sha512-IzRBM0XZtQwiLUJituqRB5XQPKIN3ZJcfEApuoeeZCA2pFWNpJzMC7eRK1JO60YfuOEWbo43+2mSUmk3vHTVOQ==","repository":{"url":"git+https://github.com/TGYD-helige/dsh-plugins.git","type":"git","directory":"packages/dsh-storage"},"_npmVersion":"10.9.8","description":"Session storage mirror for DeepSeek Harness: projects the session event stream into MySQL/PostgreSQL/SQLite/SQL Server (ai_messages / ai_chat_histories) without replacing dsh's local persistence.","directories":{},"_nodeVersion":"22.23.2","dependencies":{"@deepseek-ai/schemastery":"^3.18.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"prisma":"^7.9.1","vitest":"^4.1.11","typescript":"^5.6.3","@types/node":"^22.0.0","@prisma/client":"^7.9.1","@prisma/adapter-pg":"^7.9.1","@deepseek-ai/cordis":"^4.0.1","@prisma/adapter-mssql":"^7.9.1","@prisma/adapter-libsql":"^7.9.1","@prisma/adapter-mariadb":"^7.9.1"},"peerDependencies":{"@prisma/client":"^7.9.1","@prisma/adapter-pg":"^7.9.1","@deepseek-ai/cordis":"^4.0.1","@prisma/adapter-mssql":"^7.9.1","@prisma/adapter-libsql":"^7.9.1","@prisma/adapter-mariadb":"^7.9.1","@deepseek-ai/dsh-session":"0.1.2-rc.1"},"peerDependenciesMeta":{"@prisma/client":{"optional":true},"@prisma/adapter-pg":{"optional":true},"@prisma/adapter-mssql":{"optional":true},"@prisma/adapter-libsql":{"optional":true},"@prisma/adapter-mariadb":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dsh-storage_0.1.1_1788596564211_0.7484286033808436","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@amaster.ai/dsh-storage","version":"0.1.2","license":"MIT","_id":"@amaster.ai/dsh-storage@0.1.2","maintainers":[{"name":"qianchuan","email":"qdgemi@gmail.com"},{"name":"thornhill","email":"gpyx529@gmail.com"},{"name":"licy_mail","email":"licy_mail@qq.com"},{"name":"weaxs","email":"459312872@qq.com"},{"name":"2betop","email":"2betop.cn@gmail.com"},{"name":"lmaomaoz","email":"lmaomaoz@live.com"},{"name":"xiaojiaolv","email":"dfsq757@sina.com"},{"name":"xudong.ray","email":"xudzhang0914@gmail.com"}],"homepage":"https://github.com/TGYD-helige/dsh-plugins#readme","bugs":{"url":"https://github.com/TGYD-helige/dsh-plugins/issues"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"dist":{"shasum":"0e67a35cf8fe461d99cea9156ecebc73576edf7f","tarball":"https://registry.npmjs.org/@amaster.ai/dsh-storage/-/dsh-storage-0.1.2.tgz","fileCount":97,"integrity":"sha512-fjgL6cSTVmc8BDVr0QzWetMbeqrZMzlTasBsid9KU0nGrualYqN02lDqSFxz0N+K9npSwRZILS2pqmUJDixkXg==","signatures":[{"sig":"MEUCIEP/FwWE47WhiqkU4X2TqOobO9W2SjVLMLTAWPvQ+ldpAiEAghHgtbEtItCGdpzFEV+Qfs3PgljpKnRMSGwi+Y1HfEs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2578607},"main":"lib/index.js","type":"module","_from":"file:amaster.ai-dsh-storage-0.1.2.tgz","types":"lib/types/index.d.ts","engines":{"node":"^20.19 || ^22.12 || >=24.0"},"exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./package.json":"./package.json"},"scripts":{"test":"vitest run","build":"node scripts/prisma-generate.mjs && tsc -p tsconfig.build.json","generate":"node scripts/prisma-generate.mjs","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"xiaojiaolv","email":"dfsq757@sina.com"},"_resolved":"/tmp/b77b0e7eb09f9a80b9324bf7e958d385/amaster.ai-dsh-storage-0.1.2.tgz","_integrity":"sha512-fjgL6cSTVmc8BDVr0QzWetMbeqrZMzlTasBsid9KU0nGrualYqN02lDqSFxz0N+K9npSwRZILS2pqmUJDixkXg==","repository":{"url":"git+https://github.com/TGYD-helige/dsh-plugins.git","type":"git","directory":"packages/dsh-storage"},"_npmVersion":"10.9.8","description":"Session storage mirror for DeepSeek Harness: projects the session event stream into MySQL/PostgreSQL/SQLite/SQL Server (ai_messages / ai_chat_histories) without replacing dsh's local persistence.","directories":{},"_nodeVersion":"22.23.2","dependencies":{"@deepseek-ai/schemastery":"^3.18.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"prisma":"^7.9.1","vitest":"^4.1.11","typescript":"^5.6.3","@types/node":"^22.0.0","@prisma/client":"^7.9.1","@prisma/adapter-pg":"^7.9.1","@deepseek-ai/cordis":"^4.0.1","@prisma/adapter-mssql":"^7.9.1","@prisma/adapter-libsql":"^7.9.1","@prisma/adapter-mariadb":"^7.9.1"},"peerDependencies":{"@prisma/client":"^7.9.1","@prisma/adapter-pg":"^7.9.1","@deepseek-ai/cordis":"^4.0.1","@prisma/adapter-mssql":"^7.9.1","@prisma/adapter-libsql":"^7.9.1","@prisma/adapter-mariadb":"^7.9.1","@deepseek-ai/dsh-session":"0.1.5-rc.1"},"peerDependenciesMeta":{"@prisma/client":{"optional":true},"@prisma/adapter-pg":{"optional":true},"@prisma/adapter-mssql":{"optional":true},"@prisma/adapter-libsql":{"optional":true},"@prisma/adapter-mariadb":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dsh-storage_0.1.2_1789115240030_0.47562781043627056","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"_id":"@amaster.ai/dsh-storage@0.1.3","dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"bugs":{"url":"https://github.com/TGYD-helige/dsh-plugins/issues"},"dist":{"shasum":"c74909c7211668d33b92380056e0653a16a517e4","tarball":"https://registry.npmjs.org/@amaster.ai/dsh-storage/-/dsh-storage-0.1.3.tgz","fileCount":97,"integrity":"sha512-ooBYF3cTcxXnMVGUfFmlheDIfMU7NKPIrGxh6f5H9yj/T5SKf7wIYnYU7AlHN3ajCyoC6uYrCDMW2g457ZnRig==","signatures":[{"sig":"MEUCIGvaJVM4UGfQvbhifpK8q4mKTOxUIJ4w89cp+9snJXrGAiEAlEFy7lwfjKjZy/7wTu0+a1mbRYD/L5ZfRhDyu01ujZg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDooYSPb0J7LPmtosNQhjo+Jr44WxDJVsFlQneZoIgQhwIhAImuyu9TIuieZkp8cuJgyHFgHpJqKNfV4nYB3HkKrLKx"}],"unpackedSize":2578608},"main":"lib/index.js","name":"@amaster.ai/dsh-storage","type":"module","_from":"file:amaster.ai-dsh-storage-0.1.3.tgz","types":"lib/types/index.d.ts","engines":{"node":"^20.19 || ^22.12 || >=24.0"},"exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./package.json":"./package.json"},"license":"MIT","scripts":{"test":"vitest run","build":"node scripts/prisma-generate.mjs && tsc -p tsconfig.build.json","generate":"node scripts/prisma-generate.mjs","typecheck":"tsc -p tsconfig.json --noEmit"},"version":"0.1.3","_npmUser":{"name":"xiaojiaolv","email":"dfsq757@sina.com"},"homepage":"https://github.com/TGYD-helige/dsh-plugins#readme","_resolved":"/tmp/bc2f85ec599376655252490b5013b697/amaster.ai-dsh-storage-0.1.3.tgz","_integrity":"sha512-ooBYF3cTcxXnMVGUfFmlheDIfMU7NKPIrGxh6f5H9yj/T5SKf7wIYnYU7AlHN3ajCyoC6uYrCDMW2g457ZnRig==","repository":{"url":"git+https://github.com/TGYD-helige/dsh-plugins.git","type":"git","directory":"packages/dsh-storage"},"_npmVersion":"10.9.8","description":"Session storage mirror for DeepSeek Harness: projects the session event stream into MySQL/PostgreSQL/SQLite/SQL Server (ai_messages / ai_chat_histories) without replacing dsh's local persistence.","directories":{},"maintainers":[{"name":"qianchuan","email":"qdgemi@gmail.com"},{"name":"thornhill","email":"gpyx529@gmail.com"},{"name":"licy_mail","email":"licy_mail@qq.com"},{"name":"weaxs","email":"459312872@qq.com"},{"name":"2betop","email":"2betop.cn@gmail.com"},{"name":"lmaomaoz","email":"lmaomaoz@live.com"},{"name":"xiaojiaolv","email":"dfsq757@sina.com"},{"name":"xudong.ray","email":"xudzhang0914@gmail.com"}],"_nodeVersion":"22.23.2","dependencies":{"@deepseek-ai/schemastery":"^3.18.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"prisma":"^7.9.1","vitest":"^4.1.11","typescript":"^5.6.3","@types/node":"^22.0.0","@prisma/client":"^7.9.1","@prisma/adapter-pg":"^7.9.1","@deepseek-ai/cordis":"^4.0.1","@prisma/adapter-mssql":"^7.9.1","@prisma/adapter-libsql":"^7.9.1","@prisma/adapter-mariadb":"^7.9.1"},"peerDependencies":{"@prisma/client":"^7.9.1","@prisma/adapter-pg":"^7.9.1","@deepseek-ai/cordis":"^4.0.1","@prisma/adapter-mssql":"^7.9.1","@prisma/adapter-libsql":"^7.9.1","@prisma/adapter-mariadb":"^7.9.1","@deepseek-ai/dsh-session":"^0.1.5-rc.1"},"peerDependenciesMeta":{"@prisma/client":{"optional":true},"@prisma/adapter-pg":{"optional":true},"@prisma/adapter-mssql":{"optional":true},"@prisma/adapter-libsql":{"optional":true},"@prisma/adapter-mariadb":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-storage_0.1.3_1789442976329_0.9789702222408836"}}},"time":{"created":"2026-08-28T11:51:03.756Z","modified":"2026-09-15T03:29:36.631Z","0.1.0":"2026-08-28T11:51:04.189Z","0.1.1":"2026-09-05T08:22:44.381Z","0.1.2":"2026-09-11T08:27:20.187Z","0.1.3":"2026-09-15T03:29:36.454Z"},"bugs":{"url":"https://github.com/TGYD-helige/dsh-plugins/issues"},"license":"MIT","homepage":"https://github.com/TGYD-helige/dsh-plugins#readme","repository":{"url":"git+https://github.com/TGYD-helige/dsh-plugins.git","type":"git","directory":"packages/dsh-storage"},"description":"Session storage mirror for DeepSeek Harness: projects the session event stream into MySQL/PostgreSQL/SQLite/SQL Server (ai_messages / ai_chat_histories) without replacing dsh's local persistence.","maintainers":[{"name":"qianchuan","email":"qdgemi@gmail.com"},{"name":"thornhill","email":"gpyx529@gmail.com"},{"name":"licy_mail","email":"licy_mail@qq.com"},{"name":"weaxs","email":"459312872@qq.com"},{"name":"2betop","email":"2betop.cn@gmail.com"},{"name":"lmaomaoz","email":"lmaomaoz@live.com"},{"name":"xiaojiaolv","email":"dfsq757@sina.com"},{"name":"xudong.ray","email":"xudzhang0914@gmail.com"}],"readme":"# @amaster.ai/dsh-storage\n\n![dsh-storage preview](preview.png)\n\nSession storage mirror for [DeepSeek Harness (dsh)](https://github.com/deepseek-ai/deepseek-harness): projects the `session/event` stream into MySQL/PostgreSQL/SQLite/SQL Server (`ai_messages` / `ai_chat_histories`, same tables as the source project) without replacing dsh's local persistence — local files stay authoritative, this is a mirror.\n\nUse it when a dsh profile needs durable, queryable session data in an existing relational database while preserving the runtime's local session store as the source of truth.\n\n## Install\n\n```sh\ndsh plugin --profile my-agent add @amaster.ai/dsh-storage\n```\n\nRuntime peers: `@prisma/client` (**Prisma 7**) plus the driver adapter for your database:\n\n| Provider | Adapter peer |\n| --- | --- |\n| `mysql` | `@prisma/adapter-mariadb` |\n| `postgresql` | `@prisma/adapter-pg` |\n| `sqlite` | `@prisma/adapter-libsql` |\n| `sqlserver` | `@prisma/adapter-mssql` |\n\nThe PrismaClient is pre-generated per provider and shipped in the package — **no `prisma generate` step** for consumers.\n\n## Configuration\n\nDisabled by default. Configure via the profile's `cordis.patch.yml`:\n\n```yaml\n- insert:\n    - id: storage-mirror\n      name: '@amaster.ai/dsh-storage'\n      config:\n        enabled: true\n        database:\n          enabled: true\n          provider: mysql   # mysql | postgresql | sqlite | sqlserver\n          url: mysql://user:pass@host:3306/agent\n```\n\nCreate or upgrade the tables with the shipped schema variant:\n\n```sh\nnpx prisma db push --schema node_modules/@amaster.ai/dsh-storage/prisma/schema.mysql.prisma --url \"mysql://user:pass@host:3306/agent\"\n# schema.postgresql.prisma / schema.sqlite.prisma / schema.sqlserver.prisma work the same way\n```\n\n## Data model\n\n- **`ai_messages`** — one row per projected session event (user / model / tool), with `thoughts`, `tokens`, `tool_calls`, `agent_id`, `metadata` JSON columns and soft-delete.\n- **`ai_chat_histories`** — per-session rollup (message count, total tokens, first/last message timestamps).\n\nThe logical message id rides in `metadata.id`; message rows use a deterministic hash of `(session_id, message id)` as their primary key, so re-projected events upsert in place rather than duplicate — on every connector. Session rows are matched by `session_id` and keep their cuid primary keys. One deviation from the source project: no `user_id` column — tenancy rides on `session_id`.\n\nSQL Server note: Prisma's sqlserver connector has no `Json` type, so its variant maps the JSON columns to text — the backend serializes them on write automatically (SQL Server's `ISJSON` / `JSON_VALUE` still query the text as JSON).\n\nMirroring is a no-throw seam: backend errors are logged with a `[dsh-storage]` prefix and never escape into the agent loop.\n\n## Compatibility\n\nPinned dsh/cordis versions live in the [root compat matrix](../../README.md#compatibility). Event payloads ride pre-release dsh APIs — check the `TODO(verify)` markers in `src/` before upgrading dsh.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}