{"_id":"@amartinr/pi-deepseek-reasoning-chain-fix","_rev":"6-86800ea22566b0cda98ecb3b124c8001","name":"@amartinr/pi-deepseek-reasoning-chain-fix","dist-tags":{"latest":"0.2.2"},"versions":{"0.1.0":{"name":"@amartinr/pi-deepseek-reasoning-chain-fix","version":"0.1.0","keywords":["pi","pi-coding-agent","extension","deepseek","reasoning","tool-calling"],"license":"MIT","_id":"@amartinr/pi-deepseek-reasoning-chain-fix@0.1.0","maintainers":[{"name":"amartinr","email":"abel.martin.ruiz@gmail.com"}],"pi":{"extensions":["./dist/index.js"]},"dist":{"shasum":"8c7c6d8b86a39928351401807efd92b1c305a649","tarball":"https://registry.npmjs.org/@amartinr/pi-deepseek-reasoning-chain-fix/-/pi-deepseek-reasoning-chain-fix-0.1.0.tgz","fileCount":7,"integrity":"sha512-WaKu47HIsgf1J/CZHoxU/uRsZHRxnan2QTcgGZvmDMBGqFUjlt7nsiQuExK96O66LtQOHTuufQ3ubSPiFuJfPg==","signatures":[{"sig":"MEUCIQCEwmDMBATFPRGZhnKozYDnIDRIH414V31Al1VFCC9zwgIgZ0QH4IJX7OwMxp+HjeL6UX+NJZx0hLsPze7BePpvyCM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19930},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"deb3e1108879d0a64fa3beefa0456c53041348cf","scripts":{"test":"node verify-extension.mjs","build":"tsc","clean":"rm -rf dist","verify":"node verify-extension.mjs","typecheck":"tsc --noEmit","preversion":"npm run typecheck && npm run verify","postversion":"git push --tags 2>/dev/null || true","prepublishOnly":"npm run build"},"_npmUser":{"name":"amartinr","email":"abel.martin.ruiz@gmail.com"},"_npmVersion":"11.19.0","description":"Pi Coding Agent extension that fixes the DeepSeek reasoning-chaining contract on tool-calling turns: replays the real reasoning text on continuations, forces non-empty reasoning_content in tool scope, and strips the thinking:disabled kill-switch.","directories":{},"_nodeVersion":"24.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@types/node":"^20.19.43","@earendil-works/pi-coding-agent":"^0.84.3"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-deepseek-reasoning-chain-fix_0.1.0_1788294357950_0.0426712756892369","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@amartinr/pi-deepseek-reasoning-chain-fix","version":"0.1.1","keywords":["pi","pi-coding-agent","extension","deepseek","reasoning","tool-calling"],"author":{"name":"A. Martin","email":"abel.martin.ruiz@gmail.com"},"license":"MIT","_id":"@amartinr/pi-deepseek-reasoning-chain-fix@0.1.1","maintainers":[{"name":"amartinr","email":"abel.martin.ruiz@gmail.com"}],"pi":{"extensions":["./dist/index.js"]},"dist":{"shasum":"b9dcb49fde84b8dc17d024212c078869a1d6a0d7","tarball":"https://registry.npmjs.org/@amartinr/pi-deepseek-reasoning-chain-fix/-/pi-deepseek-reasoning-chain-fix-0.1.1.tgz","fileCount":7,"integrity":"sha512-x/VsUQpe2akDUz+nXgLr9ivPnEDXxihn6O+QlkX43lkAssOzxt8lcVB9SVNnTMkN72uN17hmVWmaBuoGRvFX0Q==","signatures":[{"sig":"MEYCIQDd32tjyT4R9bBGwdYsnmEC0YytM2kQ9nk3OYuRDnONmgIhAJk2ORZKzQweQX96p3oELIDdQmSG0ldCWLcXEfrpaVJE","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19941},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"fa2670338a4ac79586f868f84bafb4a96ad909c0","scripts":{"test":"node verify-extension.mjs","build":"tsc","clean":"rm -rf dist","verify":"node verify-extension.mjs","typecheck":"tsc --noEmit","preversion":"npm run typecheck && npm run verify","postversion":"git push --tags 2>/dev/null || true","prepublishOnly":"npm run build"},"_npmUser":{"name":"amartinr","email":"abel.martin.ruiz@gmail.com"},"_npmVersion":"11.19.0","description":"Pi Coding Agent extension that fixes the DeepSeek reasoning-chaining contract on tool-calling turns: replays the real reasoning text on continuations, forces non-empty reasoning_content in tool scope, and strips the thinking:disabled kill-switch.","directories":{},"_nodeVersion":"24.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@types/node":"^20.19.43","@earendil-works/pi-coding-agent":"^0.84.3"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-deepseek-reasoning-chain-fix_0.1.1_1788294634873_0.1709004812926176","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@amartinr/pi-deepseek-reasoning-chain-fix","version":"0.1.2","keywords":["pi","pi-coding-agent","extension","deepseek","reasoning","tool-calling"],"author":{"name":"A. Martin","email":"abel.martin.ruiz@gmail.com"},"license":"MIT","_id":"@amartinr/pi-deepseek-reasoning-chain-fix@0.1.2","maintainers":[{"name":"amartinr","email":"abel.martin.ruiz@gmail.com"}],"pi":{"extensions":["./dist/index.js"]},"dist":{"shasum":"9e606fb7db4d71250b20e06b22a9c677887d4cf5","tarball":"https://registry.npmjs.org/@amartinr/pi-deepseek-reasoning-chain-fix/-/pi-deepseek-reasoning-chain-fix-0.1.2.tgz","fileCount":7,"integrity":"sha512-h3H7QPVS9RsdpUgYjnjK5XfNlu3MRflstohBEgHldm29Jo/MlTHlyWBNIPLH/ToRTCOmUABhCn9J/qMVLxJxfQ==","signatures":[{"sig":"MEUCICiU4u0q8pGwwIrdNKkOVe/3C6Qwx692/7tlSo5MM8yTAiEAoRDvR5UK39MN5zeCbFWDpHbCRw4jcP2rgojjduaBdBA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":25541},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"2c4f9f54dad319975494a8e94cc5e5ed31914931","scripts":{"test":"node verify-extension.mjs","build":"tsc","clean":"rm -rf dist","verify":"node verify-extension.mjs","typecheck":"tsc --noEmit","preversion":"npm run typecheck && npm run verify","postversion":"git push --tags 2>/dev/null || true","prepublishOnly":"npm run build"},"_npmUser":{"name":"amartinr","email":"abel.martin.ruiz@gmail.com"},"_npmVersion":"11.19.0","description":"Pi Coding Agent extension that fixes the DeepSeek reasoning-chaining contract on tool-calling turns: replays the real reasoning text on continuations, forces non-empty reasoning_content in tool scope, and strips the thinking:disabled kill-switch.","directories":{},"_nodeVersion":"24.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@types/node":"^20.19.43","@earendil-works/pi-coding-agent":"^0.84.3"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-deepseek-reasoning-chain-fix_0.1.2_1788298625837_0.8474433279643825","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@amartinr/pi-deepseek-reasoning-chain-fix","version":"0.2.0","keywords":["pi","pi-coding-agent","extension","deepseek","reasoning","tool-calling"],"author":{"name":"A. Martin","email":"abel.martin.ruiz@gmail.com"},"license":"MIT","_id":"@amartinr/pi-deepseek-reasoning-chain-fix@0.2.0","maintainers":[{"name":"amartinr","email":"abel.martin.ruiz@gmail.com"}],"pi":{"extensions":["./dist/index.js"]},"dist":{"shasum":"4793a5be1a985e7ea49679a193d12ecb42f82def","tarball":"https://registry.npmjs.org/@amartinr/pi-deepseek-reasoning-chain-fix/-/pi-deepseek-reasoning-chain-fix-0.2.0.tgz","fileCount":7,"integrity":"sha512-Ge3z/19a2VAyT3XhJ0d5rbHWLp5PyWulplAxUF8FSvHZyWSFiFllIQsWufLNFkSQcidQJ1sZxX/wXwe1sbLE+Q==","signatures":[{"sig":"MEYCIQC0wBcEjk7q/wc9svh4CNtXcdX/4z1s+xTUubGHei4YuQIhAMbiFe+IdniVqa/sBUSLK7E/QyLDVKkqn8AQINfmDhqc","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27132},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"9d1a3720f7910664914c8631034cdf8628c845bc","scripts":{"test":"node verify-extension.mjs","build":"tsc","clean":"rm -rf dist","verify":"node verify-extension.mjs","typecheck":"tsc --noEmit","preversion":"npm run typecheck && npm run verify","postversion":"git push --tags 2>/dev/null || true","prepublishOnly":"npm run build"},"_npmUser":{"name":"amartinr","email":"abel.martin.ruiz@gmail.com"},"_npmVersion":"11.19.0","description":"Pi Coding Agent extension that fixes the DeepSeek reasoning-chaining contract on tool-calling turns: replays the real reasoning text on continuations, forces non-empty reasoning_content in tool scope, and strips the thinking:disabled kill-switch.","directories":{},"_nodeVersion":"24.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@types/node":"^20.19.43","@earendil-works/pi-coding-agent":"^0.84.3"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-deepseek-reasoning-chain-fix_0.2.0_1788298944012_0.29504789508731877","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@amartinr/pi-deepseek-reasoning-chain-fix","version":"0.2.1","keywords":["pi","pi-coding-agent","extension","deepseek","reasoning","tool-calling"],"author":{"name":"A. Martin","email":"abel.martin.ruiz@gmail.com"},"license":"MIT","_id":"@amartinr/pi-deepseek-reasoning-chain-fix@0.2.1","maintainers":[{"name":"amartinr","email":"abel.martin.ruiz@gmail.com"}],"pi":{"extensions":["./dist/index.js"]},"dist":{"shasum":"cc3cbeca07f2fa85d2de45956ef24f1b06d7cb3f","tarball":"https://registry.npmjs.org/@amartinr/pi-deepseek-reasoning-chain-fix/-/pi-deepseek-reasoning-chain-fix-0.2.1.tgz","fileCount":7,"integrity":"sha512-T+sPdEPg1Dxg3RDu46JYihX6Eudk4dlN0ejwKtEeVD4qy8DlDHaK4WlMyjBmlRNOnegvgnjZBHXONMiq7mqtog==","signatures":[{"sig":"MEUCIHqosr/89VA5TTVg9eMwolfpXX0pNvmIHmGeZGBPxAJsAiEAt2ltCgTCS6DGXsk7vMNijqQFdtP2AyKnVhVKb8flW1w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26438},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"0d5b2f57538ce6b4d135dfa5cb965ddc3efd76d3","scripts":{"test":"node verify-extension.mjs","build":"tsc","clean":"rm -rf dist","verify":"node verify-extension.mjs","typecheck":"tsc --noEmit","preversion":"npm run typecheck && npm run verify","postversion":"git push --tags 2>/dev/null || true","prepublishOnly":"npm run build"},"_npmUser":{"name":"amartinr","email":"abel.martin.ruiz@gmail.com"},"_npmVersion":"11.19.0","description":"Pi Coding Agent extension that fixes the DeepSeek reasoning-chaining contract on tool-calling turns: replays the real reasoning text on continuations, forces non-empty reasoning_content in tool scope, and strips the thinking:disabled kill-switch.","directories":{},"_nodeVersion":"24.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@types/node":"^20.19.43","@earendil-works/pi-coding-agent":"^0.84.3"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-deepseek-reasoning-chain-fix_0.2.1_1788299564038_0.870187561642735","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@amartinr/pi-deepseek-reasoning-chain-fix","version":"0.2.2","description":"Pi Coding Agent extension that fixes the DeepSeek reasoning-chaining contract on tool-calling turns: replays the real reasoning text on continuations, forces non-empty reasoning_content in tool scope, and strips the thinking:disabled kill-switch.","author":{"name":"A. Martin","email":"abel.martin.ruiz@gmail.com"},"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc","clean":"rm -rf dist","prepublishOnly":"npm run build","typecheck":"tsc --noEmit","verify":"node verify-extension.mjs","test":"node verify-extension.mjs","preversion":"npm run typecheck && npm run verify","postversion":"git push --tags 2>/dev/null || true"},"keywords":["pi","pi-coding-agent","extension","deepseek","reasoning","tool-calling"],"license":"MIT","publishConfig":{"access":"public"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"devDependencies":{"@earendil-works/pi-coding-agent":"^0.84.3","@types/node":"^20.19.43","typescript":"^5.9.3"},"pi":{"extensions":["./dist/index.js"]},"gitHead":"001ae6c075487c924f0bfd2d2eed3b9972df9247","_id":"@amartinr/pi-deepseek-reasoning-chain-fix@0.2.2","_nodeVersion":"24.20.0","_npmVersion":"11.19.0","dist":{"integrity":"sha512-nO8GFs5klCd5nE3S8oC+inX0V0BsFjWTxD0K7X+PguK7LGnJrzkAsZcGPnGALpufb3U7xHa+tEOzeAMPwRoPwQ==","shasum":"de0b4297946a07fac8f70dea044783259f660b65","tarball":"https://registry.npmjs.org/@amartinr/pi-deepseek-reasoning-chain-fix/-/pi-deepseek-reasoning-chain-fix-0.2.2.tgz","fileCount":7,"unpackedSize":26644,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGXq4KUNMgDqzMfIhi0RssY17QN2j2qtIVQJvNAQ7+D4AiBFQ9/xKjjvD3zEO47Dbf6gg5zKbs5B/m8DX0fPS3Kjng=="}]},"_npmUser":{"name":"amartinr","email":"abel.martin.ruiz@gmail.com"},"directories":{},"maintainers":[{"name":"amartinr","email":"abel.martin.ruiz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-deepseek-reasoning-chain-fix_0.2.2_1788302215780_0.7815617106790462"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-01T20:25:57.800Z","modified":"2026-09-01T22:36:56.129Z","0.1.0":"2026-09-01T20:25:58.075Z","0.1.1":"2026-09-01T20:30:35.016Z","0.1.2":"2026-09-01T21:37:05.973Z","0.2.0":"2026-09-01T21:42:24.140Z","0.2.1":"2026-09-01T21:52:44.177Z","0.2.2":"2026-09-01T22:36:55.938Z"},"author":{"name":"A. Martin","email":"abel.martin.ruiz@gmail.com"},"license":"MIT","keywords":["pi","pi-coding-agent","extension","deepseek","reasoning","tool-calling"],"description":"Pi Coding Agent extension that fixes the DeepSeek reasoning-chaining contract on tool-calling turns: replays the real reasoning text on continuations, forces non-empty reasoning_content in tool scope, and strips the thinking:disabled kill-switch.","maintainers":[{"name":"amartinr","email":"abel.martin.ruiz@gmail.com"}],"readme":"# pi-deepseek-reasoning-chain-fix\n\nPi extension that keeps DeepSeek reasoning working across tool-calling turns.\n\nDeepSeek requires `reasoning_content` on every assistant message once the\nhistory contains tool calls. This extension fixes outbound requests so the\nfield is always present and the real reasoning text survives between turns.\nWithout it, DeepSeek stops reasoning (blank chain) or errors after the first\ntool call.\n\n## Install\n\nFrom npm:\n\n```bash\npi install npm:@amartinr/pi-deepseek-reasoning-chain-fix@0.2.1\n```\n\nFrom GitHub:\n\n```bash\npi install git:github.com/amartinr/pi-deepseek-reasoning-chain-fix@v0.2.1\n```\n\nManual copy (single-file source, for development):\n\n```bash\ncp src/index.ts ~/.pi/agent/extensions/pi-deepseek-reasoning-chain-fix.ts\n```\n\nThen run `/reload` in pi.\n\nApply to the models you list in `config.json` — typical DeepSeek ids like\n`deepseek/deepseek-v4-flash` (direct or behind a gateway such as LiteLLM)\nwork out of the box.\n\n## Configuration\n\nThe extension applies only to the model ids listed in\n`~/.pi/agent/extensions/pi-deepseek-reasoning-chain-fix/config.json`:\n\n```json\n{\n  \"models\": [\n    \"deepseek/deepseek-v4-flash\",\n    \"deepseek/deepseek-v4-pro\"\n  ],\n  \"replayReasoning\": true\n}\n```\n\n- `models` — model ids the fix applies to; exact or prefix match\n  (case-insensitive), so `\"deepseek/\"` covers every deepseek-routed model.\n  An empty or missing list leaves the extension **inert** — the safe\n  default.\n- `replayReasoning` — `true` (default): the real reasoning text is replayed\n  on continuations (chaining). `false`: compliance only — a `\" \"`\n  placeholder is sent to satisfy DeepSeek's contract, without chaining the\n  real text.\n\nOverride the config path with `PI_DEEPSEEK_REASONING_CONFIG`. The load log\nreports the active ids and the mode.\n\n## Development\n\n```bash\nnpm install          # dev dependencies\nnpm run build        # src/ -> dist/\nnpm run verify       # unit checks against the built artifact\nnode verify-live.mjs # live A/B against a gateway\nnpm pack --dry-run   # inspect the published tarball (dist only)\n```\n\n## Versioning\n\nSemver via `npm version patch|minor|major` (commit + `vX.Y.Z` tag).\nBumps follow conventional commit types: `fix:` → patch, `feat:` → minor,\nbreaking → major (pre-1.0: minor).\n\n## License\n\nMIT\n","readmeFilename":"README.md"}