{"_id":"@eissar/pi-openrouter-session","_rev":"5-29e4a0cb121a0e8428bd3684f0ab1cfc","name":"@eissar/pi-openrouter-session","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@eissar/pi-openrouter-session","version":"0.1.0","keywords":["pi-package"],"author":{"name":"eissar"},"license":"Unlicense","_id":"@eissar/pi-openrouter-session@0.1.0","maintainers":[{"name":"eissar","email":"eshaanissar@outlook.com"}],"homepage":"https://github.com/eissar/pi-openrouter-session#readme","bugs":{"url":"https://github.com/eissar/pi-openrouter-session/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"ee21127aebe45ccc6c0f1a37ac17d2f55192c414","tarball":"https://registry.npmjs.org/@eissar/pi-openrouter-session/-/pi-openrouter-session-0.1.0.tgz","fileCount":3,"integrity":"sha512-XT/Mph3l6BUN8HHiu1uDoAGN93IAHNlNKy1e1G6+jEEND2iQiooOh62VgIw7OEZtoIJAsH3EdOsHs9xBMKp+5w==","signatures":[{"sig":"MEUCIAiFggR9YZvUfEQW2dgLH4vF7gliH3o7cjM41q6Bf0EwAiEAmCQxNGb4K0HuAd0PR4LooIPISrOiv5iDyzcqSPE8M4A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1471},"type":"module","_npmUser":{"name":"eissar","email":"eshaanissar@outlook.com"},"repository":{"url":"git+https://github.com/eissar/pi-openrouter-session.git","type":"git"},"_npmVersion":"10.8.2","description":"Pi extension that sends the session ID to OpenRouter via before_provider_request","directories":{},"_nodeVersion":"20.19.5","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-openrouter-session_0.1.0_1778796925598_0.42474030781097794","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@eissar/pi-openrouter-session","version":"0.1.1","keywords":["pi-package"],"author":{"name":"eissar"},"license":"Unlicense","_id":"@eissar/pi-openrouter-session@0.1.1","maintainers":[{"name":"eissar","email":"eshaanissar@outlook.com"}],"homepage":"https://github.com/eissar/pi-openrouter-session#readme","bugs":{"url":"https://github.com/eissar/pi-openrouter-session/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"48558afce74fe10b15387fb6bfd70c1ac5ac067a","tarball":"https://registry.npmjs.org/@eissar/pi-openrouter-session/-/pi-openrouter-session-0.1.1.tgz","fileCount":3,"integrity":"sha512-65cJ9DKX4ePDyHVbmumYbT54p1G8BiXKurSRklRk94hNPLSqSrrsNasoteiRkUHzicMYs06C119N6/YBLr97RQ==","signatures":[{"sig":"MEUCIQDoStU2YI4gKYT/0qG7hXMs16cOP7uTwpy17PE/LDKEiQIgLhbSp7aOE0ivQgYrrT3dw5ID+qPcCuh0tml0Amo9/fU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2636},"type":"module","gitHead":"2ac0e71a1cedef4435538bb0cf9838ddf028e63a","_npmUser":{"name":"eissar","email":"eshaanissar@outlook.com"},"repository":{"url":"git+https://github.com/eissar/pi-openrouter-session.git","type":"git"},"_npmVersion":"10.8.2","description":"Pi extension that sends the session ID to OpenRouter via before_provider_request","directories":{},"_nodeVersion":"20.19.5","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-openrouter-session_0.1.1_1778797319720_0.6978301051832903","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@eissar/pi-openrouter-session","version":"0.1.2","keywords":["pi-package"],"author":{"name":"eissar"},"license":"Unlicense","_id":"@eissar/pi-openrouter-session@0.1.2","maintainers":[{"name":"eissar","email":"eshaanissar@outlook.com"}],"homepage":"https://github.com/eissar/pi-openrouter-session#readme","bugs":{"url":"https://github.com/eissar/pi-openrouter-session/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"29c72b639e777a6fcd42d9164b7943f7b9f3f89e","tarball":"https://registry.npmjs.org/@eissar/pi-openrouter-session/-/pi-openrouter-session-0.1.2.tgz","fileCount":3,"integrity":"sha512-3RqFxnsrO9teOSgpU37XVVZ8jJCDbGnnl0J3TN3yNFEt9qRITrDJxrGyITftSP7hXvfr+lW7FmoHPNJVrCScTw==","signatures":[{"sig":"MEUCIQCZ7ty0ITTkQaK06pw0pPZ/PedWJQSgapX8m32LVf577gIgSIOOetusv0B9tnG6fIadJCNGhWRYyYRo0i/AcOc0oSE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2617},"type":"module","gitHead":"9002c221e28c862b19b3a6d5297bd58b463747ab","_npmUser":{"name":"eissar","email":"eshaanissar@outlook.com"},"repository":{"url":"git+https://github.com/eissar/pi-openrouter-session.git","type":"git"},"_npmVersion":"10.8.2","description":"highly minimal extension to send the session ID to OpenRouter","directories":{},"_nodeVersion":"20.19.5","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-openrouter-session_0.1.2_1778798152764_0.004003446930026078","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@eissar/pi-openrouter-session","version":"0.1.3","keywords":["pi-package"],"author":{"name":"eissar"},"license":"Unlicense","_id":"@eissar/pi-openrouter-session@0.1.3","maintainers":[{"name":"eissar","email":"eshaanissar@outlook.com"}],"homepage":"https://github.com/eissar/pi-openrouter-session#readme","bugs":{"url":"https://github.com/eissar/pi-openrouter-session/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"3276611e0963c043070635672498ce4e29d3f2bf","tarball":"https://registry.npmjs.org/@eissar/pi-openrouter-session/-/pi-openrouter-session-0.1.3.tgz","fileCount":3,"integrity":"sha512-KU9EhM9gXHPOAnoWATm9OffoYzIt3KuKokyl29d5Aqdy1PT7Si78TfFMZzNwHDY3Gd2t1NUUmKPZoMMbDkENVA==","signatures":[{"sig":"MEQCIFOfAT5FuVQH2nfscldeEbgAh3C55ujv5QgfyFlz9QHwAiADbLHC9uqKZt29c54py3bIFdm0faNuxRFgpf2WT7qA7Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2626},"type":"module","gitHead":"ed6c7c3e281dab7741ee5838ec62a9c3af375b4d","_npmUser":{"name":"eissar","email":"eshaanissar@outlook.com"},"repository":{"url":"git+https://github.com/eissar/pi-openrouter-session.git","type":"git"},"_npmVersion":"10.8.2","description":"highly minimal extension to send pi agent session ID to OpenRouter","directories":{},"_nodeVersion":"20.19.5","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-openrouter-session_0.1.3_1778798501484_0.6637088641346336","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@eissar/pi-openrouter-session","author":{"name":"eissar"},"version":"0.2.0","license":"Unlicense","description":"highly minimal extension to send pi agent session ID to OpenRouter","keywords":["pi-package"],"type":"module","repository":{"type":"git","url":"git+https://github.com/eissar/pi-openrouter-session.git"},"publishConfig":{"access":"public"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"pi":{"extensions":["./src/index.ts"]},"gitHead":"fc2e76e3e8675eb4192ae01c7858c6071c51cf2f","_id":"@eissar/pi-openrouter-session@0.2.0","bugs":{"url":"https://github.com/eissar/pi-openrouter-session/issues"},"homepage":"https://github.com/eissar/pi-openrouter-session#readme","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-PZkdZlcG6JcW8fLU0akDgafR7WVUxiagFVOQtjMWvEQ+AaNYRBGxqqofIi5d1lmH1hZWUqHMB7YggcFutWa6kA==","shasum":"2366059f11cf5ffd02eda3eea67329d47b0b8632","tarball":"https://registry.npmjs.org/@eissar/pi-openrouter-session/-/pi-openrouter-session-0.2.0.tgz","fileCount":3,"unpackedSize":2764,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDr2UM872xWT6oZ+nhKtOrMRbX/+m6+t2qdEJedXwrrQwIgLglfQUrIASQtUCiXA3qJ2zhHSRENJqjvE5sJpAoygRE="}]},"_npmUser":{"name":"eissar","email":"eshaanissar@outlook.com"},"directories":{},"maintainers":[{"name":"eissar","email":"eshaanissar@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-openrouter-session_0.2.0_1780086813547_0.4990401756420211"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-14T22:15:25.469Z","modified":"2026-05-29T20:33:33.819Z","0.1.0":"2026-05-14T22:15:25.741Z","0.1.1":"2026-05-14T22:21:59.865Z","0.1.2":"2026-05-14T22:35:52.904Z","0.1.3":"2026-05-14T22:41:41.629Z","0.2.0":"2026-05-29T20:33:33.714Z"},"bugs":{"url":"https://github.com/eissar/pi-openrouter-session/issues"},"author":{"name":"eissar"},"license":"Unlicense","homepage":"https://github.com/eissar/pi-openrouter-session#readme","keywords":["pi-package"],"repository":{"type":"git","url":"git+https://github.com/eissar/pi-openrouter-session.git"},"description":"highly minimal extension to send pi agent session ID to OpenRouter","maintainers":[{"name":"eissar","email":"eshaanissar@outlook.com"}],"readme":"# pi-openrouter-session\n\n[![npm version](https://img.shields.io/npm/v/@eissar/pi-openrouter-session)](https://www.npmjs.com/package/@eissar/pi-openrouter-session)\n[![License: Unlicense](https://img.shields.io/badge/license-Unlicense-blue)](LICENSE)\n\nInjects the current Pi session ID as `session_id` into every OpenRouter provider request.\n\nOpenRouter can use this to correlate sessions across requests for analytics, debugging, or per-session rate limiting.\n\n## Install\n\n```bash\npi install npm:@eissar/pi-openrouter-session\n```\n\nThen `/reload` in Pi (or restart).\n\n## How It Works\n\nThis Pi extension listens for the `before_provider_request` event and patches the outgoing request payload with the current Pi session ID (`session_id`). The session ID is obtained from `ctx.sessionManager.getSessionId()`.\n\nOpenRouter receives the `session_id` field and can use it to group related requests — useful for tracking conversation flows, debugging API usage, or applying per-session rate limits.\nyou can read about how openrouter handles that here: <https://openrouter.ai/docs/guides/features/broadcast/overview#optional-trace-data>\n\n## Source\n\n- **npm:** [@eissar/pi-openrouter-session](https://www.npmjs.com/package/@eissar/pi-openrouter-session)\n- **GitHub:** [eissar/pi-openrouter-session](https://github.com/eissar/pi-openrouter-session)\n\nInstall from GitHub directly:\n\n```bash\npi install git:github.com/eissar/pi-openrouter-session\n```\n\n## License\n\n[Unlicense](LICENSE) — public domain.\n","readmeFilename":"README.md"}