@herbertgao/pi-extensions 2026.10.19 → 2026.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. package/CHANGELOG.md +759 -0
  2. package/README.md +21 -6
  3. package/THIRD_PARTY_NOTICES.md +53 -2
  4. package/extensions/clef.mjs +1 -1
  5. package/node_modules/@herbertgao/pi-agency/CHANGELOG.md +19 -0
  6. package/node_modules/@herbertgao/pi-agency/package.json +4 -2
  7. package/node_modules/@herbertgao/pi-agency/src/index.ts +1 -1
  8. package/node_modules/@herbertgao/pi-bark/CHANGELOG.md +52 -0
  9. package/node_modules/@herbertgao/pi-bark/package.json +2 -1
  10. package/node_modules/@herbertgao/pi-cc-extensions/CHANGELOG.md +207 -0
  11. package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +7 -5
  12. package/node_modules/@herbertgao/pi-cc-extensions/README.md +10 -7
  13. package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +20 -0
  14. package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +61 -6
  15. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/agent-summary/core.ts +11 -16
  16. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/agent-summary/index.ts +60 -11
  17. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/compact-thinking.ts +29 -11
  18. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/footer-layout.ts +54 -6
  19. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/footer.ts +23 -5
  20. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/session-tokens.ts +52 -0
  21. package/node_modules/@herbertgao/pi-cc-extensions/package.json +5 -4
  22. package/node_modules/@herbertgao/pi-impeccable/CHANGELOG.md +13 -0
  23. package/node_modules/@herbertgao/pi-impeccable/package.json +2 -1
  24. package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +6 -0
  25. package/node_modules/@herbertgao/pi-subagents/README.md +142 -45
  26. package/node_modules/@herbertgao/pi-subagents/docs/rpc.md +17 -7
  27. package/node_modules/@herbertgao/pi-subagents/package.json +4 -4
  28. package/node_modules/@herbertgao/pi-subagents/src/agent-manager.ts +111 -59
  29. package/node_modules/@herbertgao/pi-subagents/src/agent-runner.ts +135 -117
  30. package/node_modules/@herbertgao/pi-subagents/src/cross-extension-rpc.ts +41 -14
  31. package/node_modules/@herbertgao/pi-subagents/src/index.ts +110 -19
  32. package/node_modules/@herbertgao/pi-subagents/src/nested-tools.ts +8 -0
  33. package/node_modules/@herbertgao/pi-subagents/src/prompts.ts +31 -0
  34. package/node_modules/@herbertgao/sol-pi/CHANGELOG.md +84 -0
  35. package/node_modules/@herbertgao/sol-pi/README.md +3 -3
  36. package/node_modules/@herbertgao/sol-pi/THIRD_PARTY_NOTICES.md +4 -4
  37. package/node_modules/@herbertgao/sol-pi/agents-install.md +3 -3
  38. package/node_modules/@herbertgao/sol-pi/docs/compatibility.md +1 -1
  39. package/node_modules/@herbertgao/sol-pi/package.json +2 -1
  40. package/node_modules/@tintinweb/pi-tasks/CHANGELOG.md +270 -0
  41. package/node_modules/@tintinweb/pi-tasks/CONTRIBUTING.md +67 -0
  42. package/node_modules/@tintinweb/pi-tasks/CUSTOMIZING.md +289 -0
  43. package/node_modules/@tintinweb/pi-tasks/LICENSE +21 -0
  44. package/node_modules/@tintinweb/pi-tasks/README.md +417 -0
  45. package/node_modules/@tintinweb/pi-tasks/SECURITY.md +107 -0
  46. package/node_modules/@tintinweb/pi-tasks/dist/auto-clear.d.ts +64 -0
  47. package/node_modules/@tintinweb/pi-tasks/dist/auto-clear.js +129 -0
  48. package/node_modules/@tintinweb/pi-tasks/dist/index.d.ts +17 -0
  49. package/node_modules/@tintinweb/pi-tasks/dist/index.js +1338 -0
  50. package/node_modules/@tintinweb/pi-tasks/dist/process-tracker.d.ts +29 -0
  51. package/node_modules/@tintinweb/pi-tasks/dist/process-tracker.js +121 -0
  52. package/node_modules/@tintinweb/pi-tasks/dist/reminder-cadence.d.ts +39 -0
  53. package/node_modules/@tintinweb/pi-tasks/dist/reminder-cadence.js +61 -0
  54. package/node_modules/@tintinweb/pi-tasks/dist/task-glyphs.d.ts +48 -0
  55. package/node_modules/@tintinweb/pi-tasks/dist/task-glyphs.js +68 -0
  56. package/node_modules/@tintinweb/pi-tasks/dist/task-paths.d.ts +44 -0
  57. package/node_modules/@tintinweb/pi-tasks/dist/task-paths.js +60 -0
  58. package/node_modules/@tintinweb/pi-tasks/dist/task-sort.d.ts +23 -0
  59. package/node_modules/@tintinweb/pi-tasks/dist/task-sort.js +69 -0
  60. package/node_modules/@tintinweb/pi-tasks/dist/task-store.d.ts +61 -0
  61. package/node_modules/@tintinweb/pi-tasks/dist/task-store.js +397 -0
  62. package/node_modules/@tintinweb/pi-tasks/dist/tasks-config.d.ts +16 -0
  63. package/node_modules/@tintinweb/pi-tasks/dist/tasks-config.js +51 -0
  64. package/node_modules/@tintinweb/pi-tasks/dist/types.d.ts +36 -0
  65. package/node_modules/@tintinweb/pi-tasks/dist/types.js +4 -0
  66. package/node_modules/@tintinweb/pi-tasks/dist/ui/settings-menu.d.ts +15 -0
  67. package/node_modules/@tintinweb/pi-tasks/dist/ui/settings-menu.js +140 -0
  68. package/node_modules/@tintinweb/pi-tasks/dist/ui/task-widget.d.ts +69 -0
  69. package/node_modules/@tintinweb/pi-tasks/dist/ui/task-widget.js +278 -0
  70. package/node_modules/@tintinweb/pi-tasks/package.json +57 -0
  71. package/node_modules/@tintinweb/pi-tasks/src/auto-clear.ts +134 -0
  72. package/node_modules/@tintinweb/pi-tasks/src/index.ts +1417 -0
  73. package/node_modules/@tintinweb/pi-tasks/src/process-tracker.ts +140 -0
  74. package/node_modules/@tintinweb/pi-tasks/src/reminder-cadence.ts +90 -0
  75. package/node_modules/@tintinweb/pi-tasks/src/task-glyphs.ts +110 -0
  76. package/node_modules/@tintinweb/pi-tasks/src/task-paths.ts +65 -0
  77. package/node_modules/@tintinweb/pi-tasks/src/task-sort.ts +90 -0
  78. package/node_modules/@tintinweb/pi-tasks/src/task-store.ts +402 -0
  79. package/node_modules/@tintinweb/pi-tasks/src/tasks-config.ts +77 -0
  80. package/node_modules/@tintinweb/pi-tasks/src/types.ts +40 -0
  81. package/node_modules/@tintinweb/pi-tasks/src/ui/settings-menu.ts +174 -0
  82. package/node_modules/@tintinweb/pi-tasks/src/ui/task-widget.ts +325 -0
  83. package/node_modules/pi-commandcode-provider/CHANGELOG.md +330 -0
  84. package/node_modules/pi-commandcode-provider/CONTRIBUTING.md +192 -0
  85. package/node_modules/pi-commandcode-provider/LICENSE +21 -0
  86. package/node_modules/pi-commandcode-provider/README.md +243 -0
  87. package/node_modules/pi-commandcode-provider/RELEASE.md +194 -0
  88. package/node_modules/pi-commandcode-provider/index.ts +309 -0
  89. package/node_modules/pi-commandcode-provider/package.json +91 -0
  90. package/node_modules/pi-commandcode-provider/scripts/live-e2e-profile.mjs +87 -0
  91. package/node_modules/pi-commandcode-provider/scripts/pi-authenticated.mjs +50 -0
  92. package/node_modules/pi-commandcode-provider/scripts/pi-isolated.mjs +79 -0
  93. package/node_modules/pi-commandcode-provider/src/api-key.ts +69 -0
  94. package/node_modules/pi-commandcode-provider/src/auth-server.ts +229 -0
  95. package/node_modules/pi-commandcode-provider/src/commandcode-catalog-overrides.ts +28 -0
  96. package/node_modules/pi-commandcode-provider/src/commandcode-catalog.ts +260 -0
  97. package/node_modules/pi-commandcode-provider/src/converters.ts +477 -0
  98. package/node_modules/pi-commandcode-provider/src/core.ts +836 -0
  99. package/node_modules/pi-commandcode-provider/src/cost.ts +76 -0
  100. package/node_modules/pi-commandcode-provider/src/json-schema.ts +417 -0
  101. package/node_modules/pi-commandcode-provider/src/models.ts +515 -0
  102. package/node_modules/pi-commandcode-provider/src/oauth.ts +229 -0
  103. package/node_modules/pi-commandcode-provider/src/overflow.ts +120 -0
  104. package/node_modules/pi-commandcode-provider/src/pricing.ts +370 -0
  105. package/node_modules/pi-commandcode-provider/src/quota-command.ts +66 -0
  106. package/node_modules/pi-commandcode-provider/src/quota-format.ts +143 -0
  107. package/node_modules/pi-commandcode-provider/src/quota-types.ts +47 -0
  108. package/node_modules/pi-commandcode-provider/src/quota.ts +357 -0
  109. package/node_modules/pi-commandcode-provider/src/responses-stream.ts +249 -0
  110. package/node_modules/pi-commandcode-provider/src/runtime.ts +330 -0
  111. package/node_modules/pi-commandcode-provider/src/transcript.ts +56 -0
  112. package/node_modules/pi-commandcode-provider/src/transport.ts +147 -0
  113. package/node_modules/pi-commandcode-provider/src/types.ts +212 -0
  114. package/node_modules/pi-commandcode-provider/src/usage.ts +261 -0
  115. package/node_modules/pi-lens/CHANGELOG.md +149 -0
  116. package/node_modules/pi-lens/README.md +12 -2
  117. package/node_modules/pi-lens/config/markdownlint/run-no-fix.mjs +36 -0
  118. package/node_modules/pi-lens/dist/{chunk-WME2OQST.js → chunk-2453RRJ2.js} +11 -6
  119. package/node_modules/pi-lens/dist/{chunk-FZKFVUEC.js → chunk-2BKUFQKR.js} +276 -208
  120. package/node_modules/pi-lens/dist/chunk-2TS4GLOJ.js +31 -0
  121. package/node_modules/pi-lens/dist/{chunk-QHSNL7B2.js → chunk-2ZE3AUJQ.js} +12 -14
  122. package/node_modules/pi-lens/dist/{chunk-MPKRJBPK.js → chunk-35WKJWO5.js} +28 -30
  123. package/node_modules/pi-lens/dist/chunk-3JAHQBSY.js +27 -0
  124. package/node_modules/pi-lens/dist/{chunk-4LM3VAZH.js → chunk-3O5EII3W.js} +2 -2
  125. package/node_modules/pi-lens/dist/chunk-447YZL4S.js +25 -0
  126. package/node_modules/pi-lens/dist/{chunk-H7OR7DFZ.js → chunk-4B2YFN4U.js} +25 -21
  127. package/node_modules/pi-lens/dist/{chunk-OSTKYB55.js → chunk-4BKU7PV3.js} +1 -1
  128. package/node_modules/pi-lens/dist/{chunk-RRV3FNNM.js → chunk-4LL2VRNY.js} +27 -28
  129. package/node_modules/pi-lens/dist/{chunk-BZARLRJW.js → chunk-4NBWFYWW.js} +9 -9
  130. package/node_modules/pi-lens/dist/{chunk-KKCK636N.js → chunk-4QG55RRC.js} +12 -12
  131. package/node_modules/pi-lens/dist/{chunk-RQS4QQSD.js → chunk-4W52ZKZX.js} +2 -2
  132. package/node_modules/pi-lens/dist/{chunk-Z2XAOKHK.js → chunk-565VRUP4.js} +2 -2
  133. package/node_modules/pi-lens/dist/{chunk-HWDAVBFU.js → chunk-57X2CDRX.js} +23 -23
  134. package/node_modules/pi-lens/dist/{chunk-MB6PXBUA.js → chunk-5F3XF3SX.js} +7 -15
  135. package/node_modules/pi-lens/dist/{chunk-O4BJFESU.js → chunk-5RNB4HVK.js} +1 -1
  136. package/node_modules/pi-lens/dist/{chunk-ZMAUPOMG.js → chunk-5T5A6YAJ.js} +35 -34
  137. package/node_modules/pi-lens/dist/{chunk-4ZYJHQMB.js → chunk-6FIRFP6A.js} +12 -12
  138. package/node_modules/pi-lens/dist/{chunk-4YHYPW2G.js → chunk-6GMGEKQN.js} +9 -5
  139. package/node_modules/pi-lens/dist/{chunk-4LOE5R5P.js → chunk-6LJOJ6EO.js} +20 -15
  140. package/node_modules/pi-lens/dist/{chunk-3YY7IXIL.js → chunk-6YUNI7B5.js} +3 -3
  141. package/node_modules/pi-lens/dist/{chunk-PKES3ISE.js → chunk-7ANZ7XDD.js} +2 -2
  142. package/node_modules/pi-lens/dist/{chunk-FB5SCCPT.js → chunk-7CGIDRIK.js} +16 -15
  143. package/node_modules/pi-lens/dist/{chunk-L3CMBQMH.js → chunk-7MAD5ZAY.js} +16 -17
  144. package/node_modules/pi-lens/dist/{chunk-WDBICWH3.js → chunk-7TNILKGY.js} +1 -1
  145. package/node_modules/pi-lens/dist/{chunk-RORGS5II.js → chunk-A5GRLYPZ.js} +9 -9
  146. package/node_modules/pi-lens/dist/{chunk-MNJIXFX4.js → chunk-AGGUWKRK.js} +1 -1
  147. package/node_modules/pi-lens/dist/{chunk-ABPKUVA4.js → chunk-BBET6HD6.js} +1 -1
  148. package/node_modules/pi-lens/dist/{chunk-L5JYIU47.js → chunk-BHWW6FAX.js} +14 -13
  149. package/node_modules/pi-lens/dist/{chunk-URCQWAQ4.js → chunk-BOPDQ7AZ.js} +23 -21
  150. package/node_modules/pi-lens/dist/{chunk-KDX35VXP.js → chunk-BQG2QFVO.js} +158 -133
  151. package/node_modules/pi-lens/dist/{chunk-CB4WHS4H.js → chunk-BUZIQDFS.js} +3 -3
  152. package/node_modules/pi-lens/dist/{chunk-2PHMIAKO.js → chunk-CM73PPGD.js} +4 -4
  153. package/node_modules/pi-lens/dist/{chunk-DH5JPM3K.js → chunk-CUDD35TW.js} +10 -9
  154. package/node_modules/pi-lens/dist/{chunk-AWDSEDER.js → chunk-CZL44WFN.js} +2 -2
  155. package/node_modules/pi-lens/dist/{chunk-N5WSK2K7.js → chunk-DIWK3LBC.js} +12 -15
  156. package/node_modules/pi-lens/dist/{chunk-24BILSZW.js → chunk-DYRZGUMA.js} +2 -2
  157. package/node_modules/pi-lens/dist/{chunk-PR6PO3ES.js → chunk-FHEV6T4L.js} +22 -18
  158. package/node_modules/pi-lens/dist/{chunk-DQZFQSR5.js → chunk-FRLAUP2B.js} +4 -4
  159. package/node_modules/pi-lens/dist/{chunk-RZOXUSPC.js → chunk-G5GV2Q7K.js} +2 -2
  160. package/node_modules/pi-lens/dist/{chunk-EKWX4WD3.js → chunk-G6JKM4O7.js} +7 -7
  161. package/node_modules/pi-lens/dist/chunk-GGYOZWHW.js +27 -0
  162. package/node_modules/pi-lens/dist/{chunk-XT2HTCJ5.js → chunk-GIRBSBGL.js} +6 -5
  163. package/node_modules/pi-lens/dist/{chunk-PQJFG24Z.js → chunk-GMROJJRN.js} +1292 -946
  164. package/node_modules/pi-lens/dist/{chunk-U6VN4NVL.js → chunk-HHR7WGCI.js} +3 -3
  165. package/node_modules/pi-lens/dist/{chunk-TIQJPRDD.js → chunk-HKIL6DCL.js} +3 -2
  166. package/node_modules/pi-lens/dist/{chunk-SNDXCFRS.js → chunk-HUAM7QG3.js} +11 -11
  167. package/node_modules/pi-lens/dist/{chunk-QOE342SU.js → chunk-HXFUTMX2.js} +2 -2
  168. package/node_modules/pi-lens/dist/{chunk-U7BD2QL7.js → chunk-I22THIHI.js} +12 -12
  169. package/node_modules/pi-lens/dist/chunk-IE5D3RA5.js +58 -0
  170. package/node_modules/pi-lens/dist/{chunk-DPGEAHZT.js → chunk-IYVYZQRL.js} +10 -16
  171. package/node_modules/pi-lens/dist/{chunk-3F6BMY53.js → chunk-JBP7KESM.js} +1 -1
  172. package/node_modules/pi-lens/dist/{chunk-U5HPROLA.js → chunk-JE6HKLC7.js} +2 -2
  173. package/node_modules/pi-lens/dist/{chunk-ZE3KXHS7.js → chunk-JPRDTY5S.js} +85 -3
  174. package/node_modules/pi-lens/dist/{chunk-HO6LWE2E.js → chunk-JYLOYTZD.js} +17 -1
  175. package/node_modules/pi-lens/dist/{chunk-KW5JQPO5.js → chunk-JZRP4DGP.js} +2 -2
  176. package/node_modules/pi-lens/dist/{chunk-CPSR3AVL.js → chunk-KZ4ALBCH.js} +2 -2
  177. package/node_modules/pi-lens/dist/{chunk-6IR3ZYIB.js → chunk-L3CLUGDY.js} +3 -3
  178. package/node_modules/pi-lens/dist/{chunk-LV4UMYVH.js → chunk-L4NEVZ4T.js} +28 -27
  179. package/node_modules/pi-lens/dist/chunk-LPYTPNOJ.js +22 -0
  180. package/node_modules/pi-lens/dist/{chunk-WGRJOXED.js → chunk-LSFXZLPW.js} +1016 -636
  181. package/node_modules/pi-lens/dist/{chunk-LBLBAFG3.js → chunk-MC6VB2E5.js} +4 -4
  182. package/node_modules/pi-lens/dist/{chunk-U2SDMG7C.js → chunk-NM2NWH55.js} +5 -5
  183. package/node_modules/pi-lens/dist/{chunk-T7A2HK2B.js → chunk-NSPVR3FN.js} +19 -18
  184. package/node_modules/pi-lens/dist/{chunk-ZGSJDWQU.js → chunk-O2ARHQKF.js} +2 -2
  185. package/node_modules/pi-lens/dist/{chunk-OXOI55RU.js → chunk-O4N5BQ3T.js} +10 -10
  186. package/node_modules/pi-lens/dist/{chunk-3FRLWYBG.js → chunk-OC7VWJBZ.js} +39 -40
  187. package/node_modules/pi-lens/dist/chunk-OFNMHPBT.js +89 -0
  188. package/node_modules/pi-lens/dist/{chunk-HR3OJ3TH.js → chunk-OWTG6UMO.js} +21 -21
  189. package/node_modules/pi-lens/dist/{chunk-75GAYVNO.js → chunk-OY7WZI7Q.js} +6 -6
  190. package/node_modules/pi-lens/dist/{chunk-ZJTT47IG.js → chunk-OZWXLJMX.js} +2 -2
  191. package/node_modules/pi-lens/dist/{chunk-F6X3YJWD.js → chunk-PIQQM32Y.js} +2 -2
  192. package/node_modules/pi-lens/dist/chunk-PKLB2XJL.js +8 -0
  193. package/node_modules/pi-lens/dist/{chunk-EAOK7MIZ.js → chunk-PKSUMEPT.js} +17 -4
  194. package/node_modules/pi-lens/dist/{chunk-YISME6ON.js → chunk-PPKECBPP.js} +1 -1
  195. package/node_modules/pi-lens/dist/{chunk-4L36HG27.js → chunk-R2QQC33W.js} +14 -14
  196. package/node_modules/pi-lens/dist/{chunk-LUBPZN36.js → chunk-R4QWJQ2H.js} +11 -11
  197. package/node_modules/pi-lens/dist/{chunk-V63BC55Q.js → chunk-RGGH6M34.js} +1 -1
  198. package/node_modules/pi-lens/dist/{chunk-Y7F7IEE3.js → chunk-RZG472YW.js} +65 -7
  199. package/node_modules/pi-lens/dist/{chunk-PUZ3E2J4.js → chunk-SDFKOLSF.js} +6 -6
  200. package/node_modules/pi-lens/dist/{chunk-YHC2O2WO.js → chunk-SFLHSL5R.js} +9 -9
  201. package/node_modules/pi-lens/dist/{chunk-CCV2EU7T.js → chunk-SP4TFY5F.js} +14 -13
  202. package/node_modules/pi-lens/dist/{chunk-J6JP25XU.js → chunk-SQC7K3SP.js} +4 -3
  203. package/node_modules/pi-lens/dist/{chunk-3K2F6UDZ.js → chunk-T2S3FNNJ.js} +44 -42
  204. package/node_modules/pi-lens/dist/{chunk-2TF6RXWB.js → chunk-TV6RXRYH.js} +10 -10
  205. package/node_modules/pi-lens/dist/{chunk-GNSIWBAT.js → chunk-U3AS2FR6.js} +3 -3
  206. package/node_modules/pi-lens/dist/{chunk-F7K5IBZG.js → chunk-UHHLR2VY.js} +40 -40
  207. package/node_modules/pi-lens/dist/chunk-UYXV5NIS.js +20 -0
  208. package/node_modules/pi-lens/dist/{chunk-VSFLRN5Y.js → chunk-VLQ7UKZH.js} +1 -1
  209. package/node_modules/pi-lens/dist/{chunk-VUZWQ7UG.js → chunk-VN3L2JWZ.js} +46 -72
  210. package/node_modules/pi-lens/dist/{chunk-NA7SEXHE.js → chunk-VOP4PJKA.js} +7 -7
  211. package/node_modules/pi-lens/dist/{chunk-F5Z6URKM.js → chunk-VOXTCULR.js} +2 -2
  212. package/node_modules/pi-lens/dist/{chunk-LLS45EWB.js → chunk-VPLBLWFO.js} +6 -8
  213. package/node_modules/pi-lens/dist/chunk-W3BGKBBK.js +27 -0
  214. package/node_modules/pi-lens/dist/{chunk-ZKXQKGWZ.js → chunk-WC6WRNQT.js} +4 -3
  215. package/node_modules/pi-lens/dist/{chunk-YVHBNSME.js → chunk-WMDUT4KH.js} +1148 -1132
  216. package/node_modules/pi-lens/dist/{chunk-KXF5R4UN.js → chunk-WQV6BI4Q.js} +1 -1
  217. package/node_modules/pi-lens/dist/chunk-WXUDRAG6.js +24 -0
  218. package/node_modules/pi-lens/dist/{chunk-KPPJTH44.js → chunk-X35S7HSB.js} +28 -10
  219. package/node_modules/pi-lens/dist/{chunk-JMEKXFOL.js → chunk-X66YJ2SS.js} +40 -34
  220. package/node_modules/pi-lens/dist/{chunk-CE6VMBCB.js → chunk-XOMGO63G.js} +22 -21
  221. package/node_modules/pi-lens/dist/{chunk-LS3QJRUB.js → chunk-XWIME22V.js} +13 -13
  222. package/node_modules/pi-lens/dist/{chunk-R5MOQM2H.js → chunk-XYLC35E4.js} +119 -87
  223. package/node_modules/pi-lens/dist/{chunk-OE5ZBP7F.js → chunk-YHGYAEFH.js} +18 -18
  224. package/node_modules/pi-lens/dist/{chunk-7E2563GA.js → chunk-ZFORSIED.js} +13 -13
  225. package/node_modules/pi-lens/dist/{chunk-E7HJ56Y7.js → chunk-ZKLTNLAW.js} +64 -73
  226. package/node_modules/pi-lens/dist/chunk-ZONZ6YY3.js +74 -0
  227. package/node_modules/pi-lens/dist/chunk-ZSM35JF4.js +30 -0
  228. package/node_modules/pi-lens/dist/{chunk-RC2Z6K47.js → chunk-ZZDIOAAJ.js} +15 -6
  229. package/node_modules/pi-lens/dist/index.js +6993 -5396
  230. package/node_modules/pi-lens/dist/mcp/analyze-cli.js +10 -10
  231. package/node_modules/pi-lens/dist/mcp/cli.js +44 -42
  232. package/node_modules/pi-lens/dist/mcp/server.js +1627 -504
  233. package/node_modules/pi-lens/dist/mcp/worker.js +62 -61
  234. package/node_modules/pi-lens/dist/probes/installer.js +20 -19
  235. package/node_modules/pi-lens/docs/adr/0003-git-guard-latch-writer.md +11 -6
  236. package/node_modules/pi-lens/docs/agent-tools.md +18 -8
  237. package/node_modules/pi-lens/docs/alignment-families.md +29 -0
  238. package/node_modules/pi-lens/docs/ast-grep_rules_catalog.md +6 -4
  239. package/node_modules/pi-lens/docs/ci-bot-pr-checks.md +126 -0
  240. package/node_modules/pi-lens/docs/configuration.md +99 -3
  241. package/node_modules/pi-lens/docs/defect-shapes.md +55 -12
  242. package/node_modules/pi-lens/docs/engineering-principles.md +27 -2
  243. package/node_modules/pi-lens/docs/features.md +2 -2
  244. package/node_modules/pi-lens/docs/invariants/git-guard-host.md +7 -3
  245. package/node_modules/pi-lens/docs/invariants/language-config.md +15 -4
  246. package/node_modules/pi-lens/docs/invariants/lsp-trust-exec.md +16 -2
  247. package/node_modules/pi-lens/docs/invariants/paths-os.md +4 -2
  248. package/node_modules/pi-lens/docs/lsp-capability-matrix.md +119 -39
  249. package/node_modules/pi-lens/docs/merge-queue-rollout.md +1 -1
  250. package/node_modules/pi-lens/docs/pi-lens-fixer.md +24 -17
  251. package/node_modules/pi-lens/docs/pi-lens-merge-policy.md +20 -11
  252. package/node_modules/pi-lens/docs/pi-lens-monitor.md +9 -0
  253. package/node_modules/pi-lens/docs/pi-lens-orchestration.md +4 -1
  254. package/node_modules/pi-lens/docs/pi-lens-reviewer.md +5 -5
  255. package/node_modules/pi-lens/docs/pi-lens-subagent.md +6 -3
  256. package/node_modules/pi-lens/docs/public-api-stability.md +18 -2
  257. package/node_modules/pi-lens/docs/schema/pi-lens-config-v1.json +10 -0
  258. package/node_modules/pi-lens/docs/settings.md +10 -6
  259. package/node_modules/pi-lens/docs/word-index.md +17 -5
  260. package/node_modules/pi-lens/package.json +5 -3
  261. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-accumulating-spread-js-test.yml +37 -0
  262. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/ts-redundant-filter-map-test.yml +12 -1
  263. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-js-test.yml +12 -0
  264. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-test.yml +25 -0
  265. package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-accumulating-spread-js.yml +49 -1
  266. package/node_modules/pi-lens/rules/ast-grep-rules/rules/ts-redundant-filter-map.yml +9 -1
  267. package/node_modules/pi-lens/rules/ast-grep-rules/rules-disabled/filter-then-map-js.yml +17 -0
  268. package/node_modules/pi-lens/rules/ast-grep-rules/rules-disabled/filter-then-map.yml +36 -0
  269. package/node_modules/pi-lens/rules/ast-grep-rules/self-scan-baseline.json +1 -1
  270. package/node_modules/pi-provider-qoder/README.md +22 -0
  271. package/node_modules/pi-provider-qoder/dist/index.js +375 -12
  272. package/node_modules/pi-provider-qoder/package.json +5 -2
  273. package/package.json +17 -13
  274. package/node_modules/@tifan/pi-preferred-thinking/README.md +0 -54
  275. package/node_modules/@tifan/pi-preferred-thinking/package.json +0 -43
  276. package/node_modules/@tifan/pi-preferred-thinking/src/index.ts +0 -236
  277. package/node_modules/pi-lens/dist/chunk-46TNM7XZ.js +0 -88
  278. package/node_modules/pi-lens/dist/chunk-72OKUXSD.js +0 -31
  279. package/node_modules/pi-lens/dist/chunk-7GLOLOSH.js +0 -57
  280. package/node_modules/pi-lens/dist/chunk-AKUUMGD5.js +0 -26
  281. package/node_modules/pi-lens/dist/chunk-ASUXV767.js +0 -22
  282. package/node_modules/pi-lens/dist/chunk-CTADOKYM.js +0 -25
  283. package/node_modules/pi-lens/dist/chunk-JJ2RRESP.js +0 -58
  284. package/node_modules/pi-lens/dist/chunk-LSC3VADM.js +0 -23
  285. package/node_modules/pi-lens/dist/chunk-SHLDT3OI.js +0 -27
  286. package/node_modules/pi-lens/dist/chunk-UF7RTZSO.js +0 -27
  287. package/node_modules/pi-lens/dist/chunk-W4WP2ERB.js +0 -30
  288. package/node_modules/pi-lens/dist/chunk-YES5CACN.js +0 -73
@@ -56,6 +56,18 @@ Context uses the largest live catalog option (often 1M). Output is 128K.
56
56
  | Usage | `https://openapi.qoder.sh/api/v2/quota/usage` | `https://openapi.qoder.com.cn/api/v2/quota/usage` |
57
57
  | Chat gateway | `https://api3.qoder.sh/` | `https://gateway.qoder.com.cn/` |
58
58
 
59
+ Agent chat is not bound to the node in this table. At startup the extension asks
60
+ `region/endpoints` for the account's node map and routes chat to the remote-agent node
61
+ (`dataNodeMap.remote_agent`), which is the node Qoder's own CLI uses; the model catalog
62
+ stays on the inference node. The resolved node is cached in
63
+ `~/.pi/agent/qoder-endpoints-cache.json` for one hour.
64
+
65
+ If a chat request is rejected with `403 code 110 "Billing daily count exceeded"`, the
66
+ account has exhausted that node's daily chat allowance — Qoder counts it per node, so
67
+ another node in the map can still serve the same account. The extension then switches to
68
+ the next candidate (remote-agent, then inference, then security), retries, and persists
69
+ whichever node served the request. Discovery failures fall back to the table above.
70
+
59
71
  ## Request and account Credits
60
72
 
61
73
  The footer shows **actual session deductions in Credits**, accumulated from Qoder's
@@ -119,6 +131,16 @@ already-selected model, run `/qoder-usage`; otherwise the next supported lifecyc
119
131
  rechecks identity. No account quota is written to disk. Per-request Credits are stored
120
132
  with the assistant usage in the host's session log.
121
133
 
134
+ ### `omp usage`
135
+
136
+ OMP's built-in usage view reads a provider-level `usage` slot, so a logged-in Qoder
137
+ account appears there with the same account quota: one row per Credit bucket (user,
138
+ add-on, organization), the numeric used/limit/remaining amounts, the plan expiry when
139
+ one exists, and the account kind. The read reuses the quota endpoint behind
140
+ `/qoder-usage` and is account-wide; a failed quota read shows as missing data and never
141
+ marks the credential unhealthy. pi has no such slot, so there `/qoder-usage` remains the
142
+ quota view.
143
+
122
144
  ### Offline visual preview
123
145
 
124
146
  ```bash
@@ -276,11 +276,22 @@ function getQoderRegionConfig(mode) {
276
276
  function getQoderBaseUrl(mode) {
277
277
  return getQoderRegionConfig(mode).baseUrl;
278
278
  }
279
+ var chatBaseUrlOverrides = /* @__PURE__ */ new Map();
280
+ function getQoderChatBaseUrl(mode) {
281
+ return chatBaseUrlOverrides.get(mode) ?? getQoderBaseUrl(mode);
282
+ }
283
+ function setQoderChatBaseUrl(mode, url) {
284
+ if (!url) {
285
+ chatBaseUrlOverrides.delete(mode);
286
+ return;
287
+ }
288
+ chatBaseUrlOverrides.set(mode, url.endsWith("/") ? url : `${url}/`);
289
+ }
279
290
  function getQoderModelListURL(mode) {
280
291
  return `${getQoderBaseUrl(mode)}algo/api/v2/model/list?Encode=1`;
281
292
  }
282
293
  function getQoderChatURL(mode) {
283
- return `${getQoderBaseUrl(mode)}algo/api/v2/service/pro/sse/agent_chat_generation?FetchKeys=llm_model_result&AgentId=agent_common&Encode=1`;
294
+ return `${getQoderChatBaseUrl(mode)}algo/api/v2/service/pro/sse/agent_chat_generation?FetchKeys=llm_model_result&AgentId=agent_common&Encode=1`;
284
295
  }
285
296
  function getQoderExchangeURL(mode) {
286
297
  return `${getQoderRegionConfig(mode).openApiUrl}/api/v1/jobToken/exchange`;
@@ -9433,12 +9444,10 @@ function registerQoderCreditDisplay(pi, service = new QoderQuotaService()) {
9433
9444
  });
9434
9445
  }
9435
9446
 
9436
- // src/protocol/stream.ts
9437
- import crypto3 from "node:crypto";
9438
- import * as PiAi from "@earendil-works/pi-ai";
9439
- import {
9440
- clampThinkingLevel
9441
- } from "@earendil-works/pi-ai";
9447
+ // src/endpoints.ts
9448
+ import { existsSync as existsSync5, mkdirSync as mkdirSync5, readFileSync as readFileSync5, writeFileSync as writeFileSync5 } from "node:fs";
9449
+ import { homedir as homedir5 } from "node:os";
9450
+ import { dirname as dirname5, join as join5 } from "node:path";
9442
9451
 
9443
9452
  // src/protocol/encoding.ts
9444
9453
  var qoderCustomAlphabet = "_doRTgHZBKcGVjlvpC,@aFSx#DPuNJme&i*MzLOEn)sUrthbf%Y^w.(kIQyXqWA!";
@@ -9451,6 +9460,14 @@ for (let i = 0; i < qoderStdAlphabet.length; i++) {
9451
9460
  encodeTable[qoderStdAlphabet.charCodeAt(i)] = qoderCustomAlphabet.charCodeAt(i);
9452
9461
  }
9453
9462
  encodeTable["=".charCodeAt(0)] = "$".charCodeAt(0);
9463
+ var decodeTable = new Uint8Array(256);
9464
+ for (let i = 0; i < decodeTable.length; i++) {
9465
+ decodeTable[i] = i;
9466
+ }
9467
+ for (let i = 0; i < qoderStdAlphabet.length; i++) {
9468
+ decodeTable[qoderCustomAlphabet.charCodeAt(i)] = qoderStdAlphabet.charCodeAt(i);
9469
+ }
9470
+ decodeTable["$".charCodeAt(0)] = "=".charCodeAt(0);
9454
9471
  function qoderEncodeBody(plaintext) {
9455
9472
  const std = Buffer.isBuffer(plaintext) ? plaintext.toString("base64") : Buffer.from(plaintext).toString("base64");
9456
9473
  const n = std.length;
@@ -9468,6 +9485,197 @@ function qoderEncodeBody(plaintext) {
9468
9485
  }
9469
9486
  return out;
9470
9487
  }
9488
+ function qoderDecodeBody(encoded) {
9489
+ const src = Buffer.isBuffer(encoded) ? encoded : Buffer.from(encoded, "ascii");
9490
+ const n = src.length;
9491
+ if (n === 0) return "";
9492
+ const a = Math.floor(n / 3);
9493
+ const std = Buffer.allocUnsafe(n);
9494
+ for (let i = 0; i < a; i++) {
9495
+ std[n - a + i] = decodeTable[src[i]];
9496
+ }
9497
+ for (let i = a; i < n - a; i++) {
9498
+ std[i] = decodeTable[src[i]];
9499
+ }
9500
+ for (let i = n - a; i < n; i++) {
9501
+ std[i - (n - a)] = decodeTable[src[i]];
9502
+ }
9503
+ return Buffer.from(std.toString("latin1"), "base64").toString("utf8");
9504
+ }
9505
+
9506
+ // src/endpoints.ts
9507
+ var CACHE_VERSION = 1;
9508
+ var CACHE_TTL_MS = 60 * 60 * 1e3;
9509
+ var discovered = /* @__PURE__ */ new Map();
9510
+ function getHomeDir5() {
9511
+ return process.env.HOME || process.env.USERPROFILE || homedir5();
9512
+ }
9513
+ function getCachePath() {
9514
+ return process.env.QODER_ENDPOINTS_CACHE_PATH || join5(getHomeDir5(), ".pi", "agent", "qoder-endpoints-cache.json");
9515
+ }
9516
+ function normalizeBaseUrl(url) {
9517
+ const trimmed = url.trim();
9518
+ if (!trimmed) return void 0;
9519
+ const withScheme = /^[a-z][a-z0-9+.-]*:\/\//i.test(trimmed) ? trimmed : `https://${trimmed}`;
9520
+ return withScheme.endsWith("/") ? withScheme : `${withScheme}/`;
9521
+ }
9522
+ function asRecord2(value) {
9523
+ return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
9524
+ }
9525
+ function stringArray(value) {
9526
+ if (!Array.isArray(value)) return [];
9527
+ const out = [];
9528
+ for (const item of value) {
9529
+ if (typeof item !== "string") continue;
9530
+ const normalized = normalizeBaseUrl(item);
9531
+ if (normalized) out.push(normalized);
9532
+ }
9533
+ return out;
9534
+ }
9535
+ function parseQoderRegionEndpoints(payload) {
9536
+ const root = asRecord2(payload);
9537
+ if (!root) return void 0;
9538
+ const dataNodes = asRecord2(root.dataNodeMap) ?? {};
9539
+ const endpoints = {
9540
+ inferNodes: stringArray(root.inferNodes),
9541
+ remoteAgentNodes: stringArray(dataNodes.remote_agent),
9542
+ securityNodes: stringArray(root.security),
9543
+ centerNodes: stringArray(root.centerNodes)
9544
+ };
9545
+ if (endpoints.inferNodes.length === 0 && endpoints.remoteAgentNodes.length === 0 && endpoints.securityNodes.length === 0) {
9546
+ return void 0;
9547
+ }
9548
+ return endpoints;
9549
+ }
9550
+ function chatEndpointCandidates(endpoints, fallback) {
9551
+ const seen = /* @__PURE__ */ new Set();
9552
+ const out = [];
9553
+ const push = (url) => {
9554
+ if (!url) return;
9555
+ const normalized = normalizeBaseUrl(url);
9556
+ if (!normalized || seen.has(normalized)) return;
9557
+ seen.add(normalized);
9558
+ out.push(normalized);
9559
+ };
9560
+ push(fallback);
9561
+ for (const url of endpoints?.remoteAgentNodes ?? []) push(url);
9562
+ for (const url of endpoints?.inferNodes ?? []) push(url);
9563
+ for (const url of endpoints?.securityNodes ?? []) push(url);
9564
+ return out;
9565
+ }
9566
+ function readCacheFile() {
9567
+ const path = getCachePath();
9568
+ if (!existsSync5(path)) return { version: CACHE_VERSION, modes: {} };
9569
+ try {
9570
+ const parsed = JSON.parse(readFileSync5(path, "utf8"));
9571
+ const modes = asRecord2(parsed.modes) ?? {};
9572
+ const clean = {};
9573
+ for (const [key, value] of Object.entries(modes)) {
9574
+ const entry = asRecord2(value);
9575
+ if (!entry) continue;
9576
+ const chatBaseUrl = typeof entry.chatBaseUrl === "string" ? normalizeBaseUrl(entry.chatBaseUrl) : void 0;
9577
+ const updatedAt = typeof entry.updatedAt === "number" ? entry.updatedAt : 0;
9578
+ if (chatBaseUrl) clean[key] = { chatBaseUrl, updatedAt };
9579
+ }
9580
+ return { version: CACHE_VERSION, modes: clean };
9581
+ } catch {
9582
+ return { version: CACHE_VERSION, modes: {} };
9583
+ }
9584
+ }
9585
+ function writeCacheFile(file) {
9586
+ const path = getCachePath();
9587
+ try {
9588
+ mkdirSync5(dirname5(path), { recursive: true });
9589
+ writeFileSync5(path, JSON.stringify({ ...file, version: CACHE_VERSION }, null, 2), { encoding: "utf8", mode: 384 });
9590
+ } catch {
9591
+ }
9592
+ }
9593
+ function getCachedChatBaseUrl(mode, now = Date.now()) {
9594
+ const entry = readCacheFile().modes[mode];
9595
+ if (!entry) return void 0;
9596
+ if (now - entry.updatedAt > CACHE_TTL_MS) return void 0;
9597
+ return entry.chatBaseUrl;
9598
+ }
9599
+ function rememberChatBaseUrl(mode, chatBaseUrl, now = Date.now()) {
9600
+ const normalized = normalizeBaseUrl(chatBaseUrl);
9601
+ if (!normalized) return;
9602
+ const file = readCacheFile();
9603
+ file.modes[mode] = { chatBaseUrl: normalized, updatedAt: now };
9604
+ writeCacheFile(file);
9605
+ }
9606
+ function applyCachedChatEndpoint(mode) {
9607
+ const cached = getCachedChatBaseUrl(mode);
9608
+ if (!cached) return void 0;
9609
+ setQoderChatBaseUrl(mode, cached);
9610
+ return cached;
9611
+ }
9612
+ function getRegionEndpointsURL(mode) {
9613
+ return `${getQoderRegionConfig(mode).centerUrl}/algo/api/v3/service/region/endpoints`;
9614
+ }
9615
+ async function fetchQoderRegionEndpoints(mode, credentials) {
9616
+ const url = getRegionEndpointsURL(mode);
9617
+ try {
9618
+ const headers = buildAuthHeaders(null, url, {
9619
+ userID: credentials.userID,
9620
+ authToken: credentials.authToken,
9621
+ name: credentials.name ?? "",
9622
+ email: credentials.email ?? "",
9623
+ machineID: credentials.machineID
9624
+ });
9625
+ const response = await fetch(url, {
9626
+ method: "GET",
9627
+ headers: { Accept: "application/json", ...headers }
9628
+ });
9629
+ if (!response.ok) return void 0;
9630
+ const text = await response.text();
9631
+ let payload;
9632
+ try {
9633
+ payload = JSON.parse(text);
9634
+ } catch {
9635
+ payload = JSON.parse(qoderDecodeBody(text));
9636
+ }
9637
+ return parseQoderRegionEndpoints(payload);
9638
+ } catch {
9639
+ return void 0;
9640
+ }
9641
+ }
9642
+ async function getRegionEndpoints(mode, credentials) {
9643
+ const cached = discovered.get(mode);
9644
+ if (cached && Date.now() - cached.at <= CACHE_TTL_MS) return cached.endpoints;
9645
+ const endpoints = await fetchQoderRegionEndpoints(mode, credentials);
9646
+ if (!endpoints) return cached?.endpoints;
9647
+ discovered.set(mode, { at: Date.now(), endpoints });
9648
+ return endpoints;
9649
+ }
9650
+ async function refreshChatEndpoint(mode, credentials) {
9651
+ if (!credentials?.authToken) return void 0;
9652
+ const endpoints = await getRegionEndpoints(mode, credentials);
9653
+ if (!endpoints) return void 0;
9654
+ const candidates = chatEndpointCandidates(endpoints, getQoderBaseUrl(mode));
9655
+ const preferred = candidates.find((url) => endpoints.remoteAgentNodes.includes(url)) ?? candidates[0];
9656
+ if (!preferred) return void 0;
9657
+ setQoderChatBaseUrl(mode, preferred);
9658
+ rememberChatBaseUrl(mode, preferred);
9659
+ return preferred;
9660
+ }
9661
+ async function rotateChatEndpoint(mode, credentials, attempted) {
9662
+ const current = normalizeBaseUrl(getQoderChatBaseUrl(mode));
9663
+ if (current) attempted.add(current);
9664
+ const endpoints = credentials ? await getRegionEndpoints(mode, credentials) : void 0;
9665
+ const candidates = chatEndpointCandidates(endpoints, getQoderBaseUrl(mode));
9666
+ const next = candidates.find((url) => !attempted.has(url));
9667
+ if (!next) return void 0;
9668
+ attempted.add(next);
9669
+ setQoderChatBaseUrl(mode, next);
9670
+ return next;
9671
+ }
9672
+
9673
+ // src/protocol/stream.ts
9674
+ import crypto3 from "node:crypto";
9675
+ import * as PiAi from "@earendil-works/pi-ai";
9676
+ import {
9677
+ clampThinkingLevel
9678
+ } from "@earendil-works/pi-ai";
9471
9679
 
9472
9680
  // src/protocol/thinking.ts
9473
9681
  var THINKING_TAG_VARIANTS = [
@@ -9854,6 +10062,16 @@ var MODEL_BUSY_CODE = "10605";
9854
10062
  var DEFAULT_MODEL_BUSY_RETRIES = 2;
9855
10063
  var MAX_MODEL_BUSY_RETRIES = 10;
9856
10064
  var MODEL_BUSY_MAX_WAIT_MS = 5e3;
10065
+ var DAILY_CHAT_LIMIT_CODE = "110";
10066
+ var MAX_CHAT_ENDPOINT_SWITCHES = 3;
10067
+ var QoderDailyChatLimitError = class extends Error {
10068
+ constructor(message, sawModelOutput = false) {
10069
+ super(message);
10070
+ this.sawModelOutput = sawModelOutput;
10071
+ this.name = "QoderDailyChatLimitError";
10072
+ }
10073
+ sawModelOutput;
10074
+ };
9857
10075
  var QoderModelBusyError = class extends Error {
9858
10076
  constructor(message, retryAfterMs, sawModelOutput = false) {
9859
10077
  super(message);
@@ -9875,6 +10093,12 @@ function parseJsonObject(value, depth = 0) {
9875
10093
  }
9876
10094
  return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
9877
10095
  }
10096
+ function isDailyChatLimitRejection(body) {
10097
+ const root = parseJsonObject(body);
10098
+ if (!root) return false;
10099
+ const code = root.code;
10100
+ return code === DAILY_CHAT_LIMIT_CODE || code === Number(DAILY_CHAT_LIMIT_CODE);
10101
+ }
9878
10102
  function parseModelBusyRejection(body) {
9879
10103
  const outer = parseJsonObject(body);
9880
10104
  const busy = parseJsonObject(outer?.message);
@@ -9882,7 +10106,11 @@ function parseModelBusyRejection(body) {
9882
10106
  const queue = parseJsonObject(busy.message);
9883
10107
  if (!queue) return void 0;
9884
10108
  if (queue.serviceAvailable !== true) return void 0;
9885
- const seconds = (value) => typeof value === "number" && Number.isFinite(value) && value > 0 ? Math.round(value * 1e3) : 0;
10109
+ const seconds = (value) => {
10110
+ if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return 0;
10111
+ const milliseconds = Math.round(value * 1e3);
10112
+ return Number.isSafeInteger(milliseconds) && milliseconds > 0 ? milliseconds : 0;
10113
+ };
9886
10114
  if (queue.isQueued === false) {
9887
10115
  return { kind: "ready", retryAfterMs: seconds(queue.retryAfterSeconds) };
9888
10116
  }
@@ -10213,7 +10441,10 @@ function streamQoder(model, context, options) {
10213
10441
  begin_at: Date.now()
10214
10442
  }
10215
10443
  };
10216
- const chatURL = getQoderChatURL(providerMode);
10444
+ let chatURL = getQoderChatURL(providerMode);
10445
+ const attemptedChatBases = /* @__PURE__ */ new Set();
10446
+ let switchedChatEndpoint = false;
10447
+ let chatEndpointSwitches = 0;
10217
10448
  const modelSource = modelConfig.source || "system";
10218
10449
  const requestedRetries = options?.maxRetries;
10219
10450
  const modelBusyRetries = Math.min(
@@ -10265,6 +10496,9 @@ function streamQoder(model, context, options) {
10265
10496
  });
10266
10497
  if (!response.ok) {
10267
10498
  const errText = await response.text();
10499
+ if (isDailyChatLimitRejection(errText)) {
10500
+ throw new QoderDailyChatLimitError(`Upstream status ${response.status}: ${errText}`, false);
10501
+ }
10268
10502
  throw new Error(`Qoder API request failed: ${response.status} ${response.statusText}. Response: ${errText}`);
10269
10503
  }
10270
10504
  const reader = response.body?.getReader();
@@ -10316,6 +10550,12 @@ function streamQoder(model, context, options) {
10316
10550
  }
10317
10551
  throw formatQueuedBusyError(busy);
10318
10552
  }
10553
+ if (isDailyChatLimitRejection(envelope.body)) {
10554
+ throw new QoderDailyChatLimitError(
10555
+ `Upstream status ${envelope.statusCodeValue}: ${envelope.body}`,
10556
+ sawModelOutput
10557
+ );
10558
+ }
10319
10559
  throw new Error(`Upstream status ${envelope.statusCodeValue}: ${envelope.body}`);
10320
10560
  }
10321
10561
  const innerStr = envelope.body;
@@ -10580,8 +10820,34 @@ function streamQoder(model, context, options) {
10580
10820
  for (let attempt = 0; ; attempt++) {
10581
10821
  try {
10582
10822
  await runAttempt();
10823
+ if (switchedChatEndpoint) {
10824
+ rememberChatBaseUrl(providerMode, getQoderChatBaseUrl(providerMode));
10825
+ }
10583
10826
  return;
10584
10827
  } catch (e) {
10828
+ if (e instanceof QoderDailyChatLimitError) {
10829
+ if (!e.sawModelOutput && chatEndpointSwitches < MAX_CHAT_ENDPOINT_SWITCHES) {
10830
+ const nextBase = await rotateChatEndpoint(
10831
+ providerMode,
10832
+ { userID, authToken: accessToken, name, email, machineID },
10833
+ attemptedChatBases
10834
+ );
10835
+ if (nextBase) {
10836
+ chatEndpointSwitches++;
10837
+ switchedChatEndpoint = true;
10838
+ chatURL = getQoderChatURL(providerMode);
10839
+ headers = buildAuthHeaders(encodedBytes, chatURL, {
10840
+ userID,
10841
+ authToken: accessToken,
10842
+ name,
10843
+ email,
10844
+ machineID
10845
+ });
10846
+ continue;
10847
+ }
10848
+ }
10849
+ throw e;
10850
+ }
10585
10851
  if (!(e instanceof QoderModelBusyError)) throw e;
10586
10852
  if (e.sawModelOutput || output.content.length > 0) {
10587
10853
  throw new Error("Qoder model rejected the request after partial output (10605 RESOURCE_LIMIT)");
@@ -10627,6 +10893,90 @@ function streamQoder(model, context, options) {
10627
10893
  return stream;
10628
10894
  }
10629
10895
 
10896
+ // src/usage-provider.ts
10897
+ var KNOWN_UNITS = {
10898
+ percent: true,
10899
+ tokens: true,
10900
+ requests: true,
10901
+ credits: true,
10902
+ usd: true,
10903
+ minutes: true,
10904
+ bytes: true
10905
+ };
10906
+ function unitFor(raw) {
10907
+ const lowered = raw?.toLowerCase();
10908
+ if (!lowered) return "credits";
10909
+ return KNOWN_UNITS[lowered] === true ? lowered : "unknown";
10910
+ }
10911
+ function statusFor(usedFraction, remaining, exceeded) {
10912
+ if (exceeded || remaining !== void 0 && remaining <= 0) return "exhausted";
10913
+ if (usedFraction !== void 0 && usedFraction >= 0.9) return "warning";
10914
+ return "ok";
10915
+ }
10916
+ var NO_EXPIRY_FROM_MS = Date.UTC(3e3, 0, 1);
10917
+ function toUsageReport(usage, providerID, fetchedAt = Date.now()) {
10918
+ const buckets = usage.usageBuckets ?? [];
10919
+ if (buckets.length === 0) return null;
10920
+ const parsedReset = usage.resetAt === void 0 ? Number.NaN : Date.parse(usage.resetAt);
10921
+ const resetsAt = Number.isFinite(parsedReset) && parsedReset < NO_EXPIRY_FROM_MS ? parsedReset : void 0;
10922
+ const raw = usage.raw;
10923
+ const exceeded = raw?.isQuotaExceeded === true;
10924
+ const snapshot = normalizeQoderQuotaSnapshot(usage.raw);
10925
+ const amountsFor = (id) => {
10926
+ if (id === "user-quota") return snapshot?.userQuota;
10927
+ if (id === "add-on-quota") return snapshot?.addOnQuota;
10928
+ if (id === "org-resource-package") return snapshot?.orgResourcePackage;
10929
+ return void 0;
10930
+ };
10931
+ const limits = buckets.map((bucket) => {
10932
+ const amounts = amountsFor(bucket.id);
10933
+ const usedFraction = amounts?.used !== void 0 && amounts.total !== void 0 && amounts.total > 0 ? amounts.used / amounts.total : void 0;
10934
+ return {
10935
+ id: bucket.id,
10936
+ label: bucket.label,
10937
+ scope: { provider: providerID },
10938
+ ...resetsAt !== void 0 ? {
10939
+ window: {
10940
+ id: "period",
10941
+ label: usage.subscriptionTitle ?? "Billing period",
10942
+ resetsAt,
10943
+ resetLabel: usage.subscriptionTitle ? "plan expires" : "resets"
10944
+ }
10945
+ } : {},
10946
+ amount: {
10947
+ unit: unitFor(amounts?.unit ?? bucket.unit),
10948
+ ...amounts?.used !== void 0 ? { used: amounts.used } : {},
10949
+ ...amounts?.total !== void 0 ? { limit: amounts.total } : {},
10950
+ ...amounts?.remaining !== void 0 ? { remaining: amounts.remaining } : {},
10951
+ ...usedFraction !== void 0 ? { usedFraction: Math.min(1, Math.max(0, usedFraction)) } : {}
10952
+ },
10953
+ status: statusFor(usedFraction, amounts?.remaining, exceeded)
10954
+ };
10955
+ });
10956
+ const notes = [];
10957
+ if (typeof raw?.userType === "string" && raw.userType) notes.push(`Account kind: ${raw.userType}`);
10958
+ if (usage.summary) notes.push(usage.summary);
10959
+ if (usage.manageUrl) notes.push(`Manage: ${usage.manageUrl}`);
10960
+ return { provider: providerID, fetchedAt, limits, ...notes.length > 0 ? { notes } : {} };
10961
+ }
10962
+ function createQoderUsageProvider(mode, providerID) {
10963
+ return {
10964
+ id: providerID,
10965
+ validatesCredentials: false,
10966
+ async fetchUsage(params) {
10967
+ const cred = params.credential;
10968
+ const access = typeof cred?.accessToken === "string" ? cred.accessToken : cred?.access;
10969
+ if (typeof access !== "string" || access.length === 0) return null;
10970
+ try {
10971
+ const usage = await fetchQoderUsageForMode({ ...cred, access }, mode, params.signal);
10972
+ return toUsageReport(usage, providerID);
10973
+ } catch {
10974
+ return null;
10975
+ }
10976
+ }
10977
+ };
10978
+ }
10979
+
10630
10980
  // src/index.ts
10631
10981
  var QODER_API = "qoder-api";
10632
10982
  async function registerQoderApi() {
@@ -10668,15 +11018,17 @@ function createQoderOAuth(mode) {
10668
11018
  function registerQoderProvider(pi, mode) {
10669
11019
  const providerID = getQoderRegionConfig(mode).providerID;
10670
11020
  const oauth = createQoderOAuth(mode);
10671
- pi.registerProvider(providerID, {
11021
+ const config = {
10672
11022
  baseUrl: getQoderBaseUrl(mode),
10673
11023
  api: QODER_API,
10674
11024
  models: modelsForProvider(mode, providerID),
10675
11025
  oauth,
10676
11026
  // pi-coding-agent resolves its own nested @earendil-works/pi-ai copy, so the
10677
11027
  // structurally identical Model/Context types are nominally distinct here.
10678
- streamSimple: streamQoder
10679
- });
11028
+ streamSimple: streamQoder,
11029
+ usage: createQoderUsageProvider(mode, providerID)
11030
+ };
11031
+ pi.registerProvider(providerID, config);
10680
11032
  }
10681
11033
  async function refreshModelsAtStartup(mode) {
10682
11034
  const providerID = getQoderRegionConfig(mode).providerID;
@@ -10696,8 +11048,19 @@ async function index_default(pi) {
10696
11048
  await registerQoderApi();
10697
11049
  for (const mode of QODER_MODES) {
10698
11050
  const providerID = getQoderRegionConfig(mode).providerID;
11051
+ applyCachedChatEndpoint(mode);
10699
11052
  try {
10700
11053
  await autoLoginQoderFromEnvironment(providerID, mode);
11054
+ const credentials = getCachedCredentials("", providerID);
11055
+ if (credentials?.access) {
11056
+ await refreshChatEndpoint(mode, {
11057
+ userID: credentials.userID || "qoder-user",
11058
+ authToken: credentials.access,
11059
+ name: credentials.name,
11060
+ email: credentials.email,
11061
+ machineID: credentials.machineID
11062
+ });
11063
+ }
10701
11064
  await refreshModelsAtStartup(mode);
10702
11065
  } catch (error) {
10703
11066
  const message = error instanceof Error ? error.message : String(error);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-provider-qoder",
3
- "version": "0.6.6",
3
+ "version": "0.6.9",
4
4
  "description": "Pi extension for Qoder AI — with OAuth authentication, COSY signatures and WAF bypass",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -53,5 +53,8 @@
53
53
  "bugs": {
54
54
  "url": "https://github.com/simonsmh/pi-provider-qoder/issues"
55
55
  },
56
- "homepage": "https://github.com/simonsmh/pi-provider-qoder#readme"
56
+ "homepage": "https://github.com/simonsmh/pi-provider-qoder#readme",
57
+ "overrides": {
58
+ "undici": "8.12.2"
59
+ }
57
60
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@herbertgao/pi-extensions",
3
- "version": "2026.10.19",
3
+ "version": "2026.11.1",
4
4
  "description": "Aggregate installer for HerbertGao-maintained Pi extensions.",
5
5
  "keywords": [
6
6
  "extensions",
@@ -21,6 +21,7 @@
21
21
  },
22
22
  "files": [
23
23
  "README.md",
24
+ "CHANGELOG.md",
24
25
  "LICENSE",
25
26
  "THIRD_PARTY_NOTICES.md",
26
27
  "extensions"
@@ -38,12 +39,12 @@
38
39
  "@ast-grep/cli": "0.51.0",
39
40
  "@ast-grep/napi": "^0.51.0",
40
41
  "@dietrichgebert/ponytail": "5.3.3",
41
- "@herbertgao/pi-agency": "0.1.2",
42
- "@herbertgao/pi-bark": "0.2.1",
43
- "@herbertgao/pi-cc-extensions": "1.0.12-local.1",
44
- "@herbertgao/pi-impeccable": "0.1.0",
45
- "@herbertgao/pi-subagents": "0.22.0-local.2",
46
- "@herbertgao/sol-pi": "0.4.2",
42
+ "@herbertgao/pi-agency": "0.1.3",
43
+ "@herbertgao/pi-bark": "0.2.2",
44
+ "@herbertgao/pi-cc-extensions": "1.0.13-local.1",
45
+ "@herbertgao/pi-impeccable": "0.1.1",
46
+ "@herbertgao/pi-subagents": "0.22.1-local.1",
47
+ "@herbertgao/sol-pi": "0.4.3",
47
48
  "@juicesharp/rpiv-ask-user-question": "2.15.0",
48
49
  "@juicesharp/rpiv-config": "^2.15.0",
49
50
  "@modelcontextprotocol/sdk": "^1.32.1",
@@ -57,9 +58,9 @@
57
58
  "@tifan/pi-copy-response": "0.2.7",
58
59
  "@tifan/pi-handoff": "2.2.2",
59
60
  "@tifan/pi-mermaid-open": "0.2.2",
60
- "@tifan/pi-preferred-thinking": "1.0.2",
61
61
  "@tifan/pi-recap": "0.4.8",
62
62
  "@tifan/pi-rename": "0.6.0",
63
+ "@tintinweb/pi-tasks": "0.9.1",
63
64
  "@typesafe-ai/sdk": "0.7.0",
64
65
  "croner": "^10.0.1",
65
66
  "dbus-native": "^0.16.2",
@@ -68,13 +69,14 @@
68
69
  "jiti": "^2.7.0",
69
70
  "js-yaml": "^5.2.2",
70
71
  "linkedom": "^0.16.0",
71
- "minimatch": "^10.2.6",
72
+ "minimatch": "^11.0.1",
72
73
  "nanoid": "^5.0.0",
73
74
  "p-limit": "^6.1.0",
74
75
  "pi-antigravity": "0.11.0",
75
- "pi-lens": "4.4.7",
76
+ "pi-commandcode-provider": "0.7.11",
77
+ "pi-lens": "4.4.8",
76
78
  "pi-next-cue": "1.0.8",
77
- "pi-provider-qoder": "0.6.6",
79
+ "pi-provider-qoder": "0.6.9",
78
80
  "pi-typesafe": "0.13.1",
79
81
  "pi-web-access": "0.46.0",
80
82
  "pidusage": "^4.0.1",
@@ -113,11 +115,12 @@
113
115
  "@tifan/pi-copy-response",
114
116
  "@tifan/pi-handoff",
115
117
  "@tifan/pi-mermaid-open",
116
- "@tifan/pi-preferred-thinking",
117
118
  "@tifan/pi-recap",
118
119
  "@tifan/pi-rename",
120
+ "@tintinweb/pi-tasks",
119
121
  "grok-mermaid",
120
122
  "pi-antigravity",
123
+ "pi-commandcode-provider",
121
124
  "pi-lens",
122
125
  "pi-next-cue",
123
126
  "pi-provider-qoder",
@@ -136,10 +139,10 @@
136
139
  "./node_modules/@tifan/pi-handoff/src/index.ts",
137
140
  "./node_modules/@tifan/pi-handoff/src/session-query.ts",
138
141
  "./node_modules/@tifan/pi-mermaid-open/src/index.ts",
139
- "./node_modules/@tifan/pi-preferred-thinking/src/index.ts",
140
142
  "./node_modules/@tifan/pi-recap/src/index.ts",
141
143
  "./node_modules/@tifan/pi-rename/src/index.ts",
142
144
  "./node_modules/@herbertgao/pi-subagents/src/index.ts",
145
+ "./node_modules/@tintinweb/pi-tasks/src/index.ts",
143
146
  "./node_modules/@herbertgao/pi-agency/src/index.ts",
144
147
  "./node_modules/@juicesharp/rpiv-ask-user-question/index.ts",
145
148
  "./node_modules/@herbertgao/pi-bark/src/index.ts",
@@ -153,6 +156,7 @@
153
156
  "./node_modules/pi-antigravity/src/features/google-search.ts",
154
157
  "./node_modules/pi-antigravity/src/features/generate-image.ts",
155
158
  "./node_modules/pi-provider-qoder/dist/index.js",
159
+ "./node_modules/pi-commandcode-provider/index.ts",
156
160
  "./node_modules/pi-typesafe/extensions/index.js",
157
161
  "./extensions/clef.mjs"
158
162
  ],