{"_id":"@agnishc/edb-token-tracker","_rev":"11-4298dfffc504a5e80d1200e692d37a99","name":"@agnishc/edb-token-tracker","dist-tags":{"latest":"0.21.1"},"versions":{"0.16.4":{"name":"@agnishc/edb-token-tracker","version":"0.16.4","keywords":["pi-package","pi-extension","edb","token-usage"],"author":{"name":"Agnish Chakraborty"},"license":"MIT","_id":"@agnishc/edb-token-tracker@0.16.4","maintainers":[{"name":"agnishc","email":"agnishc.dev@gmail.com"}],"homepage":"https://github.com/agnishcc/pi-extention-monorepo/tree/main/packages/edb-token-tracker#readme","bugs":{"url":"https://github.com/agnishcc/pi-extention-monorepo/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"9c98e7c50f31711f370a9981c776030ac819bd22","tarball":"https://registry.npmjs.org/@agnishc/edb-token-tracker/-/edb-token-tracker-0.16.4.tgz","fileCount":5,"integrity":"sha512-SDhIFJxEEpjXBJqA5PWX1jrfND1+itGL4eZHYIgSKFt/FPenuQld2BmR5letKX0g8aCZ/7ziaVcwZ2u8VdYIbw==","signatures":[{"sig":"MEYCIQCUXhs5vWTQjWany7Rg7d5d2MVpmFlusk72GZFXOwymGQIhAMlF/wNxbybGndBAHmLglx1x/yF+PnOjBwtix1tNxf3A","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9912},"type":"module","gitHead":"33c027989cb5559252ce4bae89d53627ac49c4d0","_npmUser":{"name":"agnishc","email":"agnishc.dev@gmail.com"},"repository":{"url":"git+https://github.com/agnishcc/pi-extention-monorepo.git","type":"git","directory":"packages/edb-token-tracker"},"_npmVersion":"11.16.0","description":"Pi extension: per-turn token usage tracker — captures main agent and subagent token usage to SQLite","directories":{},"_nodeVersion":"26.3.0","dependencies":{"sql.js":"^1.11.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/edb-token-tracker_0.16.4_1785158197040_0.03183502870534616","host":"s3://npm-registry-packages-npm-production"}},"0.16.5":{"name":"@agnishc/edb-token-tracker","version":"0.16.5","keywords":["pi-package","pi-extension","edb","token-usage"],"author":{"name":"Agnish Chakraborty"},"license":"MIT","_id":"@agnishc/edb-token-tracker@0.16.5","maintainers":[{"name":"agnishc","email":"agnishc.dev@gmail.com"}],"homepage":"https://github.com/agnishcc/pi-extention-monorepo/tree/main/packages/edb-token-tracker#readme","bugs":{"url":"https://github.com/agnishcc/pi-extention-monorepo/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"79cba4cb6172956769802fba5d434b867e57b7c4","tarball":"https://registry.npmjs.org/@agnishc/edb-token-tracker/-/edb-token-tracker-0.16.5.tgz","fileCount":5,"integrity":"sha512-vlsBcxZkxAr5WqQXBgUvqLNkrzzurDLHRfNaVMvErDZ+LC14CuD5mENG6e56OOR3mZzMo1c02jv4sMfNehIbjA==","signatures":[{"sig":"MEUCIBegBlPgqH/UrSM/K+g28UNVpdbdSa1PKshIwHq23zNhAiEAnZEUtgpQ4zSQEnIhhYEijrsJiAXL0DM8NdN9WNRNS2E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10713},"type":"module","gitHead":"d81984949d5d736fbe8de8ff74aaa772a9c2a75f","_npmUser":{"name":"agnishc","email":"agnishc.dev@gmail.com"},"repository":{"url":"git+https://github.com/agnishcc/pi-extention-monorepo.git","type":"git","directory":"packages/edb-token-tracker"},"_npmVersion":"11.16.0","description":"Pi extension: per-turn token usage tracker — captures main agent and subagent token usage to SQLite","directories":{},"_nodeVersion":"26.3.0","dependencies":{"sql.js":"^1.11.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/edb-token-tracker_0.16.5_1785171716769_0.288581954332364","host":"s3://npm-registry-packages-npm-production"}},"0.18.0":{"name":"@agnishc/edb-token-tracker","version":"0.18.0","keywords":["pi-package","pi-extension","edb","token-usage"],"author":{"name":"Agnish Chakraborty"},"license":"MIT","_id":"@agnishc/edb-token-tracker@0.18.0","maintainers":[{"name":"agnishc","email":"agnishc.dev@gmail.com"}],"homepage":"https://github.com/agnishcc/pi-extention-monorepo/tree/main/packages/edb-token-tracker#readme","bugs":{"url":"https://github.com/agnishcc/pi-extention-monorepo/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"31e75c59a9bd03470ef9810795a2712228d2115f","tarball":"https://registry.npmjs.org/@agnishc/edb-token-tracker/-/edb-token-tracker-0.18.0.tgz","fileCount":4,"integrity":"sha512-S326PZLgcxGB9ZeWC1xsYYVi1XABlJEoIUDQNYeucwT0/luYC09Pv0H4VTWJQ0Ytq5rTaj9QH2nfZnqmnnU3jw==","signatures":[{"sig":"MEQCIEQ6JPv05RlSnxGR6iPIffvoe/iejDCBos1r3jO4sk8zAiABo5Ej01fSHODIMjjkekXwT3JvrhSBAKYhGhCB2/h6hg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11889},"type":"module","gitHead":"0cb006795dab7a000f37f12ff1efb39cefd60499","_npmUser":{"name":"agnishc","email":"agnishc.dev@gmail.com"},"repository":{"url":"git+https://github.com/agnishcc/pi-extention-monorepo.git","type":"git","directory":"packages/edb-token-tracker"},"_npmVersion":"11.12.1","description":"Pi extension: per-turn token usage tracker — captures main agent and subagent token usage to SQLite","directories":{},"_nodeVersion":"24.14.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/edb-token-tracker_0.18.0_1785178844620_0.9007509505604718","host":"s3://npm-registry-packages-npm-production"}},"0.18.1":{"name":"@agnishc/edb-token-tracker","version":"0.18.1","keywords":["pi-package","pi-extension","edb","token-usage"],"author":{"name":"Agnish Chakraborty"},"license":"MIT","_id":"@agnishc/edb-token-tracker@0.18.1","maintainers":[{"name":"agnishc","email":"agnishc.dev@gmail.com"}],"homepage":"https://github.com/agnishcc/pi-extention-monorepo/tree/main/packages/edb-token-tracker#readme","bugs":{"url":"https://github.com/agnishcc/pi-extention-monorepo/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"2a1dbca9b426daca4acdf2864e58823e2738e45f","tarball":"https://registry.npmjs.org/@agnishc/edb-token-tracker/-/edb-token-tracker-0.18.1.tgz","fileCount":4,"integrity":"sha512-cqKUnGKvhTF3fguafoKtmvNwtPKdUYYu512E7VyEnCaWVg4ohXmwrybaKV7gmEZAB9UfFrsrbQrh798wcWO5Hg==","signatures":[{"sig":"MEYCIQDO2ph1j0zLKAq9xQ51DAfWoAUATMl36w7nRvrEGKNKtgIhALlkLShTsiQQGNYtvU/zCg5CFY//6LYVNrk5zp0kuOfT","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11805},"type":"module","gitHead":"f5d165b590eac4e69fe8f06fdb935328d65d6a05","_npmUser":{"name":"agnishc","email":"agnishc.dev@gmail.com"},"repository":{"url":"git+https://github.com/agnishcc/pi-extention-monorepo.git","type":"git","directory":"packages/edb-token-tracker"},"_npmVersion":"11.16.0","description":"Pi extension: per-turn token usage tracker — captures main agent and subagent token usage to SQLite","directories":{},"_nodeVersion":"26.3.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/edb-token-tracker_0.18.1_1785221963822_0.028309165011807025","host":"s3://npm-registry-packages-npm-production"}},"0.18.2":{"name":"@agnishc/edb-token-tracker","version":"0.18.2","keywords":["pi-package","pi-extension","edb","token-usage"],"author":{"name":"Agnish Chakraborty"},"license":"MIT","_id":"@agnishc/edb-token-tracker@0.18.2","maintainers":[{"name":"agnishc","email":"agnishc.dev@gmail.com"}],"homepage":"https://github.com/agnishcc/pi-extention-monorepo/tree/main/packages/edb-token-tracker#readme","bugs":{"url":"https://github.com/agnishcc/pi-extention-monorepo/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"050e6693c6fa5f9365720ab5f315d240823a4488","tarball":"https://registry.npmjs.org/@agnishc/edb-token-tracker/-/edb-token-tracker-0.18.2.tgz","fileCount":4,"integrity":"sha512-j899111/s0RLQcAr+nrwpavWbq3d7NEdAcifvLd9DfYaajUCUDxMeGZoGYcsNkt6JRPSBDfQlKw6m9X5y4OeVw==","signatures":[{"sig":"MEYCIQCQTQmewaQHiIyfMfBc5he6iQSmsNGedo/O/115Frt1zQIhAKt+nnuLnDc6A+7ApXj1287nPQ0O/Gx9s3nSvvdySFaM","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12531},"type":"module","gitHead":"18de7b7816af9883d7ff92d3df12c5a060ad45de","_npmUser":{"name":"agnishc","email":"agnishc.dev@gmail.com"},"repository":{"url":"git+https://github.com/agnishcc/pi-extention-monorepo.git","type":"git","directory":"packages/edb-token-tracker"},"_npmVersion":"11.16.0","description":"Pi extension: per-turn token usage tracker — captures main agent and subagent token usage to SQLite","directories":{},"_nodeVersion":"24.18.0","dependencies":{"pg":"^8.13.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/edb-token-tracker_0.18.2_1785270336641_0.785908129022477","host":"s3://npm-registry-packages-npm-production"}},"0.19.0":{"name":"@agnishc/edb-token-tracker","version":"0.19.0","keywords":["pi-package","pi-extension","edb","token-usage"],"author":{"name":"Agnish Chakraborty"},"license":"MIT","_id":"@agnishc/edb-token-tracker@0.19.0","maintainers":[{"name":"agnishc","email":"agnishc.dev@gmail.com"}],"homepage":"https://github.com/agnishcc/pi-extention-monorepo/tree/main/packages/edb-token-tracker#readme","bugs":{"url":"https://github.com/agnishcc/pi-extention-monorepo/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"30f2a6c27add0871d00117483497a880e6e26c28","tarball":"https://registry.npmjs.org/@agnishc/edb-token-tracker/-/edb-token-tracker-0.19.0.tgz","fileCount":4,"integrity":"sha512-2gxnto+0IBcExrUa3yB3qXqTXa2aV8k2VJPT3c0dNqS0zPPnMGpeX7rtlA2GUZIhzbfnPY703hcTTps8KfiS+w==","signatures":[{"sig":"MEUCIQDbkcoWKS2uWiYbwV6/hHdkxuduH4lUBKq0/5GSCZAnTwIgVcPGbVOA8NGnySjYesO/taX6I2tKE4x1HXgvSckb3mE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12531},"type":"module","gitHead":"0b4c0b8e3670c58e76e5b108eaabf15c68ce5b19","_npmUser":{"name":"agnishc","email":"agnishc.dev@gmail.com"},"repository":{"url":"git+https://github.com/agnishcc/pi-extention-monorepo.git","type":"git","directory":"packages/edb-token-tracker"},"_npmVersion":"11.16.0","description":"Pi extension: per-turn token usage tracker — captures main agent and subagent token usage to SQLite","directories":{},"_nodeVersion":"24.18.0","dependencies":{"pg":"^8.13.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/edb-token-tracker_0.19.0_1785738249853_0.3543897994317369","host":"s3://npm-registry-packages-npm-production"}},"0.20.0":{"name":"@agnishc/edb-token-tracker","version":"0.20.0","keywords":["pi-package","pi-extension","edb","token-usage"],"author":{"name":"Agnish Chakraborty"},"license":"MIT","_id":"@agnishc/edb-token-tracker@0.20.0","maintainers":[{"name":"agnishc","email":"agnishc.dev@gmail.com"}],"homepage":"https://github.com/agnishcc/pi-extention-monorepo/tree/main/packages/edb-token-tracker#readme","bugs":{"url":"https://github.com/agnishcc/pi-extention-monorepo/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"b6f6fce546c4022c9a2f83c4d7f62d7e3a8f6c46","tarball":"https://registry.npmjs.org/@agnishc/edb-token-tracker/-/edb-token-tracker-0.20.0.tgz","fileCount":4,"integrity":"sha512-+z/AFS/x5X+jccYsCJRnwNxpcercBbW8r7pDiTqZQdayjhWOcG/j7VlDI3e8bwkZzECZgMWEFqdklRwgZmMg4Q==","signatures":[{"sig":"MEUCIQCKPMJ1k9NCFj4+TBy3qI5WpCrLxRAeK4TzruTDQ0cuGgIgQOjTNiBUSXD3UAhi3MkxlMTAGcE1ZllhUIEl+DAG9eI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12534},"type":"module","gitHead":"6bac1e45bcd2d480c4532b7f152634e49a9a20d8","_npmUser":{"name":"agnishc","email":"agnishc.dev@gmail.com"},"repository":{"url":"git+https://github.com/agnishcc/pi-extention-monorepo.git","type":"git","directory":"packages/edb-token-tracker"},"_npmVersion":"11.16.0","description":"Pi extension: per-turn token usage tracker — captures main agent and subagent token usage to SQLite","directories":{},"_nodeVersion":"24.18.0","dependencies":{"pg":"^8.13.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/edb-token-tracker_0.20.0_1785754956993_0.2564742568387792","host":"s3://npm-registry-packages-npm-production"}},"0.20.1":{"name":"@agnishc/edb-token-tracker","version":"0.20.1","keywords":["pi-package","pi-extension","edb","token-usage"],"author":{"name":"Agnish Chakraborty"},"license":"MIT","_id":"@agnishc/edb-token-tracker@0.20.1","maintainers":[{"name":"agnishc","email":"agnishc.dev@gmail.com"}],"homepage":"https://github.com/agnishcc/pi-extention-monorepo/tree/main/packages/edb-token-tracker#readme","bugs":{"url":"https://github.com/agnishcc/pi-extention-monorepo/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"5e0b2ec2881d635fba86c19a9a302193f9feffe5","tarball":"https://registry.npmjs.org/@agnishc/edb-token-tracker/-/edb-token-tracker-0.20.1.tgz","fileCount":4,"integrity":"sha512-vexDmy0dk5Q0UC8Qf+IFGTLMOorHNRAKP3TpQ3ASNknX4pbsKAn95U8oMGhb5Bg1Af+wgkCjWVIzlpm2jKwSdQ==","signatures":[{"sig":"MEUCIG/JEBHo8ujumkw6VPtYZKrz/W29pjqZXVgahij0P3YAAiEAj4DNopWEmQnNIoV+Pgz6nIwU28orPKkyctQkDR2NhMg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12531},"type":"module","gitHead":"895c98328e98881da32da6c4b90fc33d9af07fc2","_npmUser":{"name":"agnishc","email":"agnishc.dev@gmail.com"},"repository":{"url":"git+https://github.com/agnishcc/pi-extention-monorepo.git","type":"git","directory":"packages/edb-token-tracker"},"_npmVersion":"11.16.0","description":"Pi extension: per-turn token usage tracker — captures main agent and subagent token usage to SQLite","directories":{},"_nodeVersion":"24.18.0","dependencies":{"pg":"^8.13.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/edb-token-tracker_0.20.1_1785765142713_0.4518130432905825","host":"s3://npm-registry-packages-npm-production"}},"0.20.2":{"name":"@agnishc/edb-token-tracker","version":"0.20.2","keywords":["pi-package","pi-extension","edb","token-usage"],"author":{"name":"Agnish Chakraborty"},"license":"MIT","_id":"@agnishc/edb-token-tracker@0.20.2","maintainers":[{"name":"agnishc","email":"agnishc.dev@gmail.com"}],"homepage":"https://github.com/agnishcc/pi-extention-monorepo/tree/main/packages/edb-token-tracker#readme","bugs":{"url":"https://github.com/agnishcc/pi-extention-monorepo/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"1fc41d0f2ae7d350d27c8ead815e0afd98ea0c07","tarball":"https://registry.npmjs.org/@agnishc/edb-token-tracker/-/edb-token-tracker-0.20.2.tgz","fileCount":4,"integrity":"sha512-MEPSXO2OxJxxgpYNHzqYgSp3osEDBAOMsV21dIIrj6ynr2ZRHprnaaTBu8PSl409cF0eIVeLeNnYEzHTDuxWWA==","signatures":[{"sig":"MEUCIQDy+8lkmPr/+yVlPOZFKF6a+UL1fs9m6ujx+F96ruA+kQIgENDeR4+D6OWBgMQX6U0XhsSTD6rm81E4MkwmAveSyFE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12531},"type":"module","gitHead":"754d3aeca29e36d586443f86fbde5726b2ee281c","_npmUser":{"name":"agnishc","email":"agnishc.dev@gmail.com"},"repository":{"url":"git+https://github.com/agnishcc/pi-extention-monorepo.git","type":"git","directory":"packages/edb-token-tracker"},"_npmVersion":"11.16.0","description":"Pi extension: per-turn token usage tracker — captures main agent and subagent token usage to SQLite","directories":{},"_nodeVersion":"24.18.0","dependencies":{"pg":"^8.13.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/edb-token-tracker_0.20.2_1786005243199_0.643115617754936","host":"s3://npm-registry-packages-npm-production"}},"0.21.0":{"name":"@agnishc/edb-token-tracker","version":"0.21.0","keywords":["pi-package","pi-extension","edb","token-usage"],"author":{"name":"Agnish Chakraborty"},"license":"MIT","_id":"@agnishc/edb-token-tracker@0.21.0","maintainers":[{"name":"agnishc","email":"agnishc.dev@gmail.com"}],"homepage":"https://github.com/agnishcc/pi-extention-monorepo/tree/main/packages/edb-token-tracker#readme","bugs":{"url":"https://github.com/agnishcc/pi-extention-monorepo/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"3b0f4260a7e7991aa6950ccfd1a35feb155096e1","tarball":"https://registry.npmjs.org/@agnishc/edb-token-tracker/-/edb-token-tracker-0.21.0.tgz","fileCount":4,"integrity":"sha512-UG/OkIIgqM31/ElLikKnvHzcOHm1ell/eSIxE+XKcdG3sYZd1Oxntg5vomSMpQDLhftCrbloQOywvMoINlXcMA==","signatures":[{"sig":"MEUCIQDM0ctYyxf+kwtQEtgVE5ATW8o0Bcmn+k9ILl9O34WDTwIgGRftPaUKaT0+V/FX+kPeeQcZuVPRRcE/P1nBcZCGtd0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12531},"type":"module","gitHead":"371cc0a8b60e76ecc25aaaa30cf772794630cd85","_npmUser":{"name":"agnishc","email":"agnishc.dev@gmail.com"},"repository":{"url":"git+https://github.com/agnishcc/pi-extention-monorepo.git","type":"git","directory":"packages/edb-token-tracker"},"_npmVersion":"11.16.0","description":"Pi extension: per-turn token usage tracker — captures main agent and subagent token usage to SQLite","directories":{},"_nodeVersion":"24.18.0","dependencies":{"pg":"^8.13.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/edb-token-tracker_0.21.0_1786007538819_0.25247286514441747","host":"s3://npm-registry-packages-npm-production"}},"0.21.1":{"name":"@agnishc/edb-token-tracker","version":"0.21.1","description":"Pi extension: per-turn token usage tracker — captures main agent and subagent token usage to SQLite","keywords":["pi-package","pi-extension","edb","token-usage"],"type":"module","license":"MIT","author":{"name":"Agnish Chakraborty"},"repository":{"type":"git","url":"git+https://github.com/agnishcc/pi-extention-monorepo.git","directory":"packages/edb-token-tracker"},"homepage":"https://github.com/agnishcc/pi-extention-monorepo/tree/main/packages/edb-token-tracker#readme","publishConfig":{"access":"public"},"pi":{"extensions":["./src/index.ts"]},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"dependencies":{"pg":"^8.13.1"},"gitHead":"cefb899c1203dc24bc7525a08072c8b97d6a3ab1","_id":"@agnishc/edb-token-tracker@0.21.1","bugs":{"url":"https://github.com/agnishcc/pi-extention-monorepo/issues"},"_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-AmRaVpBUOkV7rcSxl7UuqkA3en3vL4tKcqafXexhlaWj1i3P9ant5AvqdjCTmWa2+VHAjKz3Z3lDO56QQCXyGA==","shasum":"ddd5e47bd2a6414c04a4ac48c75c6c898b6ab085","tarball":"https://registry.npmjs.org/@agnishc/edb-token-tracker/-/edb-token-tracker-0.21.1.tgz","fileCount":4,"unpackedSize":12531,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICiBYarrBeZnBEeE17oBLGN1Rlafz/fIdWiSmPDfH8rwAiAP3PQCZux5d/8x3uocWl8gphHZp1w+gJPR5c5ZKbsmMA=="}]},"_npmUser":{"name":"agnishc","email":"agnishc.dev@gmail.com"},"directories":{},"maintainers":[{"name":"agnishc","email":"agnishc.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/edb-token-tracker_0.21.1_1786008170439_0.7918072772182629"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-27T13:16:36.778Z","modified":"2026-08-06T09:22:50.760Z","0.16.4":"2026-07-27T13:16:37.184Z","0.16.5":"2026-07-27T17:01:56.938Z","0.18.0":"2026-07-27T19:00:44.753Z","0.18.1":"2026-07-28T06:59:23.968Z","0.18.2":"2026-07-28T20:25:36.821Z","0.19.0":"2026-08-03T06:24:10.009Z","0.20.0":"2026-08-03T11:02:37.135Z","0.20.1":"2026-08-03T13:52:22.875Z","0.20.2":"2026-08-06T08:34:03.333Z","0.21.0":"2026-08-06T09:12:18.947Z","0.21.1":"2026-08-06T09:22:50.594Z"},"bugs":{"url":"https://github.com/agnishcc/pi-extention-monorepo/issues"},"author":{"name":"Agnish Chakraborty"},"license":"MIT","homepage":"https://github.com/agnishcc/pi-extention-monorepo/tree/main/packages/edb-token-tracker#readme","keywords":["pi-package","pi-extension","edb","token-usage"],"repository":{"type":"git","url":"git+https://github.com/agnishcc/pi-extention-monorepo.git","directory":"packages/edb-token-tracker"},"description":"Pi extension: per-turn token usage tracker — captures main agent and subagent token usage to SQLite","maintainers":[{"name":"agnishc","email":"agnishc.dev@gmail.com"}],"readme":"# @agnishc/edb-token-tracker\n\nPi extension that tracks per-turn LLM token usage for both the main agent and subagents, writing to Postgres.\n\nDesigned to work alongside [`@agnishc/edb-subagents`](https://github.com/agnishcc/pi-extention-monorepo/tree/main/packages/edb-subagents).\n\n## Install\n\n```bash\npi install npm:@agnishc/edb-token-tracker\n```\n\nOr load directly in the monorepo:\n\n```bash\npi -e ./packages/edb-token-tracker/src/index.ts\n```\n\n## Database\n\nDefault connection URL:\n\n```text\npostgres://pi_token_tracker:pi_token_tracker@localhost:5432/pi_token_usage\n```\n\nOverride with either:\n\n```bash\nexport PI_TOKEN_TRACKER_DATABASE_URL='postgres://user:pass@host:5432/dbname'\n# or\nexport DATABASE_URL='postgres://user:pass@host:5432/dbname'\n```\n\nFor local development from the repo root:\n\n```bash\ndocker compose -f docker-compose.postgres.yml --env-file .env up -d\n```\n\nUse `.env.example` as the starting point for `.env`.\n\nTo migrate existing rows from the old SQLite DB:\n\n```bash\nnpm run migrate:token-postgres\n```\n\nThe migration reads `~/.pi/token-usage.db` by default and skips rows already present in Postgres.\n\n## How it works\n\n| Source | Event | What's captured |\n|---|---|---|\n| Main agent turns | `message_end` (pi built-in) | `session_id`, `model`, `caller=\"main\"`, turn number, all token types |\n| Subagent turns | `subagents:usage` (from edb-subagents) | Same fields with `caller=\"subagent\"`, plus `agent_id` and `agent_type` |\n\n### Schema\n\n```sql\nCREATE TABLE token_detailed (\n    id          BIGSERIAL PRIMARY KEY,\n    timestamp   TEXT    NOT NULL,                  -- ISO 8601\n    session_id  TEXT    NOT NULL,                  -- pi session ID\n    caller      TEXT    NOT NULL,                  -- \"main\" | \"subagent\"\n    agent_id    TEXT,                              -- null for main\n    agent_type  TEXT,                              -- null for main\n    model       TEXT    NOT NULL,                  -- \"anthropic/claude-sonnet-4-...\"\n    turn_number INTEGER NOT NULL,                  -- 1-based per session\n    input_tokens    INTEGER NOT NULL,\n    output_tokens   INTEGER NOT NULL,\n    cache_read_tokens  INTEGER DEFAULT 0,\n    cache_write_tokens INTEGER DEFAULT 0\n);\n```\n\nAll rows use the parent pi session's `session_id`, so main + subagent tokens for a session are queryable together.\n\n## Example queries\n\n```sql\n-- Total tokens per session\nSELECT session_id, SUM(input_tokens + output_tokens) AS total_tokens\nFROM token_detailed GROUP BY session_id ORDER BY total_tokens DESC;\n\n-- Per-model breakdown\nSELECT model, caller, SUM(input_tokens), SUM(output_tokens)\nFROM token_detailed GROUP BY model, caller;\n\n-- Subagent usage by type\nSELECT agent_type, COUNT(*), SUM(input_tokens + output_tokens)\nFROM token_detailed WHERE caller = 'subagent'\nGROUP BY agent_type;\n```\n\n## CLI command\n\n```text\n/token-db\n```\n\nShows total recorded turns, input/output totals, and recent turn history from Postgres.\n\n## Requirements\n\n- A reachable Postgres database\n- `@agnishc/edb-subagents` v0.16+ for `subagents:usage` events\n\n## License\n\nMIT\n","readmeFilename":"README.md"}