@herbertgao/pi-extensions 2026.10.19 → 2026.11.0

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 (261) hide show
  1. package/README.md +19 -4
  2. package/THIRD_PARTY_NOTICES.md +53 -2
  3. package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +6 -0
  4. package/node_modules/@herbertgao/pi-subagents/README.md +142 -45
  5. package/node_modules/@herbertgao/pi-subagents/docs/rpc.md +17 -7
  6. package/node_modules/@herbertgao/pi-subagents/package.json +4 -4
  7. package/node_modules/@herbertgao/pi-subagents/src/agent-manager.ts +111 -59
  8. package/node_modules/@herbertgao/pi-subagents/src/agent-runner.ts +135 -117
  9. package/node_modules/@herbertgao/pi-subagents/src/cross-extension-rpc.ts +41 -14
  10. package/node_modules/@herbertgao/pi-subagents/src/index.ts +110 -19
  11. package/node_modules/@herbertgao/pi-subagents/src/nested-tools.ts +8 -0
  12. package/node_modules/@herbertgao/pi-subagents/src/prompts.ts +31 -0
  13. package/node_modules/@tintinweb/pi-tasks/CHANGELOG.md +270 -0
  14. package/node_modules/@tintinweb/pi-tasks/CONTRIBUTING.md +67 -0
  15. package/node_modules/@tintinweb/pi-tasks/CUSTOMIZING.md +289 -0
  16. package/node_modules/@tintinweb/pi-tasks/LICENSE +21 -0
  17. package/node_modules/@tintinweb/pi-tasks/README.md +417 -0
  18. package/node_modules/@tintinweb/pi-tasks/SECURITY.md +107 -0
  19. package/node_modules/@tintinweb/pi-tasks/dist/auto-clear.d.ts +64 -0
  20. package/node_modules/@tintinweb/pi-tasks/dist/auto-clear.js +129 -0
  21. package/node_modules/@tintinweb/pi-tasks/dist/index.d.ts +17 -0
  22. package/node_modules/@tintinweb/pi-tasks/dist/index.js +1338 -0
  23. package/node_modules/@tintinweb/pi-tasks/dist/process-tracker.d.ts +29 -0
  24. package/node_modules/@tintinweb/pi-tasks/dist/process-tracker.js +121 -0
  25. package/node_modules/@tintinweb/pi-tasks/dist/reminder-cadence.d.ts +39 -0
  26. package/node_modules/@tintinweb/pi-tasks/dist/reminder-cadence.js +61 -0
  27. package/node_modules/@tintinweb/pi-tasks/dist/task-glyphs.d.ts +48 -0
  28. package/node_modules/@tintinweb/pi-tasks/dist/task-glyphs.js +68 -0
  29. package/node_modules/@tintinweb/pi-tasks/dist/task-paths.d.ts +44 -0
  30. package/node_modules/@tintinweb/pi-tasks/dist/task-paths.js +60 -0
  31. package/node_modules/@tintinweb/pi-tasks/dist/task-sort.d.ts +23 -0
  32. package/node_modules/@tintinweb/pi-tasks/dist/task-sort.js +69 -0
  33. package/node_modules/@tintinweb/pi-tasks/dist/task-store.d.ts +61 -0
  34. package/node_modules/@tintinweb/pi-tasks/dist/task-store.js +397 -0
  35. package/node_modules/@tintinweb/pi-tasks/dist/tasks-config.d.ts +16 -0
  36. package/node_modules/@tintinweb/pi-tasks/dist/tasks-config.js +51 -0
  37. package/node_modules/@tintinweb/pi-tasks/dist/types.d.ts +36 -0
  38. package/node_modules/@tintinweb/pi-tasks/dist/types.js +4 -0
  39. package/node_modules/@tintinweb/pi-tasks/dist/ui/settings-menu.d.ts +15 -0
  40. package/node_modules/@tintinweb/pi-tasks/dist/ui/settings-menu.js +140 -0
  41. package/node_modules/@tintinweb/pi-tasks/dist/ui/task-widget.d.ts +69 -0
  42. package/node_modules/@tintinweb/pi-tasks/dist/ui/task-widget.js +278 -0
  43. package/node_modules/@tintinweb/pi-tasks/package.json +57 -0
  44. package/node_modules/@tintinweb/pi-tasks/src/auto-clear.ts +134 -0
  45. package/node_modules/@tintinweb/pi-tasks/src/index.ts +1417 -0
  46. package/node_modules/@tintinweb/pi-tasks/src/process-tracker.ts +140 -0
  47. package/node_modules/@tintinweb/pi-tasks/src/reminder-cadence.ts +90 -0
  48. package/node_modules/@tintinweb/pi-tasks/src/task-glyphs.ts +110 -0
  49. package/node_modules/@tintinweb/pi-tasks/src/task-paths.ts +65 -0
  50. package/node_modules/@tintinweb/pi-tasks/src/task-sort.ts +90 -0
  51. package/node_modules/@tintinweb/pi-tasks/src/task-store.ts +402 -0
  52. package/node_modules/@tintinweb/pi-tasks/src/tasks-config.ts +77 -0
  53. package/node_modules/@tintinweb/pi-tasks/src/types.ts +40 -0
  54. package/node_modules/@tintinweb/pi-tasks/src/ui/settings-menu.ts +174 -0
  55. package/node_modules/@tintinweb/pi-tasks/src/ui/task-widget.ts +325 -0
  56. package/node_modules/pi-commandcode-provider/CHANGELOG.md +330 -0
  57. package/node_modules/pi-commandcode-provider/CONTRIBUTING.md +192 -0
  58. package/node_modules/pi-commandcode-provider/LICENSE +21 -0
  59. package/node_modules/pi-commandcode-provider/README.md +243 -0
  60. package/node_modules/pi-commandcode-provider/RELEASE.md +194 -0
  61. package/node_modules/pi-commandcode-provider/index.ts +309 -0
  62. package/node_modules/pi-commandcode-provider/package.json +91 -0
  63. package/node_modules/pi-commandcode-provider/scripts/live-e2e-profile.mjs +87 -0
  64. package/node_modules/pi-commandcode-provider/scripts/pi-authenticated.mjs +50 -0
  65. package/node_modules/pi-commandcode-provider/scripts/pi-isolated.mjs +79 -0
  66. package/node_modules/pi-commandcode-provider/src/api-key.ts +69 -0
  67. package/node_modules/pi-commandcode-provider/src/auth-server.ts +229 -0
  68. package/node_modules/pi-commandcode-provider/src/commandcode-catalog-overrides.ts +28 -0
  69. package/node_modules/pi-commandcode-provider/src/commandcode-catalog.ts +260 -0
  70. package/node_modules/pi-commandcode-provider/src/converters.ts +477 -0
  71. package/node_modules/pi-commandcode-provider/src/core.ts +836 -0
  72. package/node_modules/pi-commandcode-provider/src/cost.ts +76 -0
  73. package/node_modules/pi-commandcode-provider/src/json-schema.ts +417 -0
  74. package/node_modules/pi-commandcode-provider/src/models.ts +515 -0
  75. package/node_modules/pi-commandcode-provider/src/oauth.ts +229 -0
  76. package/node_modules/pi-commandcode-provider/src/overflow.ts +120 -0
  77. package/node_modules/pi-commandcode-provider/src/pricing.ts +370 -0
  78. package/node_modules/pi-commandcode-provider/src/quota-command.ts +66 -0
  79. package/node_modules/pi-commandcode-provider/src/quota-format.ts +143 -0
  80. package/node_modules/pi-commandcode-provider/src/quota-types.ts +47 -0
  81. package/node_modules/pi-commandcode-provider/src/quota.ts +357 -0
  82. package/node_modules/pi-commandcode-provider/src/responses-stream.ts +249 -0
  83. package/node_modules/pi-commandcode-provider/src/runtime.ts +330 -0
  84. package/node_modules/pi-commandcode-provider/src/transcript.ts +56 -0
  85. package/node_modules/pi-commandcode-provider/src/transport.ts +147 -0
  86. package/node_modules/pi-commandcode-provider/src/types.ts +212 -0
  87. package/node_modules/pi-commandcode-provider/src/usage.ts +261 -0
  88. package/node_modules/pi-lens/CHANGELOG.md +149 -0
  89. package/node_modules/pi-lens/README.md +12 -2
  90. package/node_modules/pi-lens/config/markdownlint/run-no-fix.mjs +36 -0
  91. package/node_modules/pi-lens/dist/{chunk-WME2OQST.js → chunk-2453RRJ2.js} +11 -6
  92. package/node_modules/pi-lens/dist/{chunk-FZKFVUEC.js → chunk-2BKUFQKR.js} +276 -208
  93. package/node_modules/pi-lens/dist/chunk-2TS4GLOJ.js +31 -0
  94. package/node_modules/pi-lens/dist/{chunk-QHSNL7B2.js → chunk-2ZE3AUJQ.js} +12 -14
  95. package/node_modules/pi-lens/dist/{chunk-MPKRJBPK.js → chunk-35WKJWO5.js} +28 -30
  96. package/node_modules/pi-lens/dist/chunk-3JAHQBSY.js +27 -0
  97. package/node_modules/pi-lens/dist/{chunk-4LM3VAZH.js → chunk-3O5EII3W.js} +2 -2
  98. package/node_modules/pi-lens/dist/chunk-447YZL4S.js +25 -0
  99. package/node_modules/pi-lens/dist/{chunk-H7OR7DFZ.js → chunk-4B2YFN4U.js} +25 -21
  100. package/node_modules/pi-lens/dist/{chunk-OSTKYB55.js → chunk-4BKU7PV3.js} +1 -1
  101. package/node_modules/pi-lens/dist/{chunk-RRV3FNNM.js → chunk-4LL2VRNY.js} +27 -28
  102. package/node_modules/pi-lens/dist/{chunk-BZARLRJW.js → chunk-4NBWFYWW.js} +9 -9
  103. package/node_modules/pi-lens/dist/{chunk-KKCK636N.js → chunk-4QG55RRC.js} +12 -12
  104. package/node_modules/pi-lens/dist/{chunk-RQS4QQSD.js → chunk-4W52ZKZX.js} +2 -2
  105. package/node_modules/pi-lens/dist/{chunk-Z2XAOKHK.js → chunk-565VRUP4.js} +2 -2
  106. package/node_modules/pi-lens/dist/{chunk-HWDAVBFU.js → chunk-57X2CDRX.js} +23 -23
  107. package/node_modules/pi-lens/dist/{chunk-MB6PXBUA.js → chunk-5F3XF3SX.js} +7 -15
  108. package/node_modules/pi-lens/dist/{chunk-O4BJFESU.js → chunk-5RNB4HVK.js} +1 -1
  109. package/node_modules/pi-lens/dist/{chunk-ZMAUPOMG.js → chunk-5T5A6YAJ.js} +35 -34
  110. package/node_modules/pi-lens/dist/{chunk-4ZYJHQMB.js → chunk-6FIRFP6A.js} +12 -12
  111. package/node_modules/pi-lens/dist/{chunk-4YHYPW2G.js → chunk-6GMGEKQN.js} +9 -5
  112. package/node_modules/pi-lens/dist/{chunk-4LOE5R5P.js → chunk-6LJOJ6EO.js} +20 -15
  113. package/node_modules/pi-lens/dist/{chunk-3YY7IXIL.js → chunk-6YUNI7B5.js} +3 -3
  114. package/node_modules/pi-lens/dist/{chunk-PKES3ISE.js → chunk-7ANZ7XDD.js} +2 -2
  115. package/node_modules/pi-lens/dist/{chunk-FB5SCCPT.js → chunk-7CGIDRIK.js} +16 -15
  116. package/node_modules/pi-lens/dist/{chunk-L3CMBQMH.js → chunk-7MAD5ZAY.js} +16 -17
  117. package/node_modules/pi-lens/dist/{chunk-WDBICWH3.js → chunk-7TNILKGY.js} +1 -1
  118. package/node_modules/pi-lens/dist/{chunk-RORGS5II.js → chunk-A5GRLYPZ.js} +9 -9
  119. package/node_modules/pi-lens/dist/{chunk-MNJIXFX4.js → chunk-AGGUWKRK.js} +1 -1
  120. package/node_modules/pi-lens/dist/{chunk-ABPKUVA4.js → chunk-BBET6HD6.js} +1 -1
  121. package/node_modules/pi-lens/dist/{chunk-L5JYIU47.js → chunk-BHWW6FAX.js} +14 -13
  122. package/node_modules/pi-lens/dist/{chunk-URCQWAQ4.js → chunk-BOPDQ7AZ.js} +23 -21
  123. package/node_modules/pi-lens/dist/{chunk-KDX35VXP.js → chunk-BQG2QFVO.js} +158 -133
  124. package/node_modules/pi-lens/dist/{chunk-CB4WHS4H.js → chunk-BUZIQDFS.js} +3 -3
  125. package/node_modules/pi-lens/dist/{chunk-2PHMIAKO.js → chunk-CM73PPGD.js} +4 -4
  126. package/node_modules/pi-lens/dist/{chunk-DH5JPM3K.js → chunk-CUDD35TW.js} +10 -9
  127. package/node_modules/pi-lens/dist/{chunk-AWDSEDER.js → chunk-CZL44WFN.js} +2 -2
  128. package/node_modules/pi-lens/dist/{chunk-N5WSK2K7.js → chunk-DIWK3LBC.js} +12 -15
  129. package/node_modules/pi-lens/dist/{chunk-24BILSZW.js → chunk-DYRZGUMA.js} +2 -2
  130. package/node_modules/pi-lens/dist/{chunk-PR6PO3ES.js → chunk-FHEV6T4L.js} +22 -18
  131. package/node_modules/pi-lens/dist/{chunk-DQZFQSR5.js → chunk-FRLAUP2B.js} +4 -4
  132. package/node_modules/pi-lens/dist/{chunk-RZOXUSPC.js → chunk-G5GV2Q7K.js} +2 -2
  133. package/node_modules/pi-lens/dist/{chunk-EKWX4WD3.js → chunk-G6JKM4O7.js} +7 -7
  134. package/node_modules/pi-lens/dist/chunk-GGYOZWHW.js +27 -0
  135. package/node_modules/pi-lens/dist/{chunk-XT2HTCJ5.js → chunk-GIRBSBGL.js} +6 -5
  136. package/node_modules/pi-lens/dist/{chunk-PQJFG24Z.js → chunk-GMROJJRN.js} +1292 -946
  137. package/node_modules/pi-lens/dist/{chunk-U6VN4NVL.js → chunk-HHR7WGCI.js} +3 -3
  138. package/node_modules/pi-lens/dist/{chunk-TIQJPRDD.js → chunk-HKIL6DCL.js} +3 -2
  139. package/node_modules/pi-lens/dist/{chunk-SNDXCFRS.js → chunk-HUAM7QG3.js} +11 -11
  140. package/node_modules/pi-lens/dist/{chunk-QOE342SU.js → chunk-HXFUTMX2.js} +2 -2
  141. package/node_modules/pi-lens/dist/{chunk-U7BD2QL7.js → chunk-I22THIHI.js} +12 -12
  142. package/node_modules/pi-lens/dist/chunk-IE5D3RA5.js +58 -0
  143. package/node_modules/pi-lens/dist/{chunk-DPGEAHZT.js → chunk-IYVYZQRL.js} +10 -16
  144. package/node_modules/pi-lens/dist/{chunk-3F6BMY53.js → chunk-JBP7KESM.js} +1 -1
  145. package/node_modules/pi-lens/dist/{chunk-U5HPROLA.js → chunk-JE6HKLC7.js} +2 -2
  146. package/node_modules/pi-lens/dist/{chunk-ZE3KXHS7.js → chunk-JPRDTY5S.js} +85 -3
  147. package/node_modules/pi-lens/dist/{chunk-HO6LWE2E.js → chunk-JYLOYTZD.js} +17 -1
  148. package/node_modules/pi-lens/dist/{chunk-KW5JQPO5.js → chunk-JZRP4DGP.js} +2 -2
  149. package/node_modules/pi-lens/dist/{chunk-CPSR3AVL.js → chunk-KZ4ALBCH.js} +2 -2
  150. package/node_modules/pi-lens/dist/{chunk-6IR3ZYIB.js → chunk-L3CLUGDY.js} +3 -3
  151. package/node_modules/pi-lens/dist/{chunk-LV4UMYVH.js → chunk-L4NEVZ4T.js} +28 -27
  152. package/node_modules/pi-lens/dist/chunk-LPYTPNOJ.js +22 -0
  153. package/node_modules/pi-lens/dist/{chunk-WGRJOXED.js → chunk-LSFXZLPW.js} +1016 -636
  154. package/node_modules/pi-lens/dist/{chunk-LBLBAFG3.js → chunk-MC6VB2E5.js} +4 -4
  155. package/node_modules/pi-lens/dist/{chunk-U2SDMG7C.js → chunk-NM2NWH55.js} +5 -5
  156. package/node_modules/pi-lens/dist/{chunk-T7A2HK2B.js → chunk-NSPVR3FN.js} +19 -18
  157. package/node_modules/pi-lens/dist/{chunk-ZGSJDWQU.js → chunk-O2ARHQKF.js} +2 -2
  158. package/node_modules/pi-lens/dist/{chunk-OXOI55RU.js → chunk-O4N5BQ3T.js} +10 -10
  159. package/node_modules/pi-lens/dist/{chunk-3FRLWYBG.js → chunk-OC7VWJBZ.js} +39 -40
  160. package/node_modules/pi-lens/dist/chunk-OFNMHPBT.js +89 -0
  161. package/node_modules/pi-lens/dist/{chunk-HR3OJ3TH.js → chunk-OWTG6UMO.js} +21 -21
  162. package/node_modules/pi-lens/dist/{chunk-75GAYVNO.js → chunk-OY7WZI7Q.js} +6 -6
  163. package/node_modules/pi-lens/dist/{chunk-ZJTT47IG.js → chunk-OZWXLJMX.js} +2 -2
  164. package/node_modules/pi-lens/dist/{chunk-F6X3YJWD.js → chunk-PIQQM32Y.js} +2 -2
  165. package/node_modules/pi-lens/dist/chunk-PKLB2XJL.js +8 -0
  166. package/node_modules/pi-lens/dist/{chunk-EAOK7MIZ.js → chunk-PKSUMEPT.js} +17 -4
  167. package/node_modules/pi-lens/dist/{chunk-YISME6ON.js → chunk-PPKECBPP.js} +1 -1
  168. package/node_modules/pi-lens/dist/{chunk-4L36HG27.js → chunk-R2QQC33W.js} +14 -14
  169. package/node_modules/pi-lens/dist/{chunk-LUBPZN36.js → chunk-R4QWJQ2H.js} +11 -11
  170. package/node_modules/pi-lens/dist/{chunk-V63BC55Q.js → chunk-RGGH6M34.js} +1 -1
  171. package/node_modules/pi-lens/dist/{chunk-Y7F7IEE3.js → chunk-RZG472YW.js} +65 -7
  172. package/node_modules/pi-lens/dist/{chunk-PUZ3E2J4.js → chunk-SDFKOLSF.js} +6 -6
  173. package/node_modules/pi-lens/dist/{chunk-YHC2O2WO.js → chunk-SFLHSL5R.js} +9 -9
  174. package/node_modules/pi-lens/dist/{chunk-CCV2EU7T.js → chunk-SP4TFY5F.js} +14 -13
  175. package/node_modules/pi-lens/dist/{chunk-J6JP25XU.js → chunk-SQC7K3SP.js} +4 -3
  176. package/node_modules/pi-lens/dist/{chunk-3K2F6UDZ.js → chunk-T2S3FNNJ.js} +44 -42
  177. package/node_modules/pi-lens/dist/{chunk-2TF6RXWB.js → chunk-TV6RXRYH.js} +10 -10
  178. package/node_modules/pi-lens/dist/{chunk-GNSIWBAT.js → chunk-U3AS2FR6.js} +3 -3
  179. package/node_modules/pi-lens/dist/{chunk-F7K5IBZG.js → chunk-UHHLR2VY.js} +40 -40
  180. package/node_modules/pi-lens/dist/chunk-UYXV5NIS.js +20 -0
  181. package/node_modules/pi-lens/dist/{chunk-VSFLRN5Y.js → chunk-VLQ7UKZH.js} +1 -1
  182. package/node_modules/pi-lens/dist/{chunk-VUZWQ7UG.js → chunk-VN3L2JWZ.js} +46 -72
  183. package/node_modules/pi-lens/dist/{chunk-NA7SEXHE.js → chunk-VOP4PJKA.js} +7 -7
  184. package/node_modules/pi-lens/dist/{chunk-F5Z6URKM.js → chunk-VOXTCULR.js} +2 -2
  185. package/node_modules/pi-lens/dist/{chunk-LLS45EWB.js → chunk-VPLBLWFO.js} +6 -8
  186. package/node_modules/pi-lens/dist/chunk-W3BGKBBK.js +27 -0
  187. package/node_modules/pi-lens/dist/{chunk-ZKXQKGWZ.js → chunk-WC6WRNQT.js} +4 -3
  188. package/node_modules/pi-lens/dist/{chunk-YVHBNSME.js → chunk-WMDUT4KH.js} +1148 -1132
  189. package/node_modules/pi-lens/dist/{chunk-KXF5R4UN.js → chunk-WQV6BI4Q.js} +1 -1
  190. package/node_modules/pi-lens/dist/chunk-WXUDRAG6.js +24 -0
  191. package/node_modules/pi-lens/dist/{chunk-KPPJTH44.js → chunk-X35S7HSB.js} +28 -10
  192. package/node_modules/pi-lens/dist/{chunk-JMEKXFOL.js → chunk-X66YJ2SS.js} +40 -34
  193. package/node_modules/pi-lens/dist/{chunk-CE6VMBCB.js → chunk-XOMGO63G.js} +22 -21
  194. package/node_modules/pi-lens/dist/{chunk-LS3QJRUB.js → chunk-XWIME22V.js} +13 -13
  195. package/node_modules/pi-lens/dist/{chunk-R5MOQM2H.js → chunk-XYLC35E4.js} +119 -87
  196. package/node_modules/pi-lens/dist/{chunk-OE5ZBP7F.js → chunk-YHGYAEFH.js} +18 -18
  197. package/node_modules/pi-lens/dist/{chunk-7E2563GA.js → chunk-ZFORSIED.js} +13 -13
  198. package/node_modules/pi-lens/dist/{chunk-E7HJ56Y7.js → chunk-ZKLTNLAW.js} +64 -73
  199. package/node_modules/pi-lens/dist/chunk-ZONZ6YY3.js +74 -0
  200. package/node_modules/pi-lens/dist/chunk-ZSM35JF4.js +30 -0
  201. package/node_modules/pi-lens/dist/{chunk-RC2Z6K47.js → chunk-ZZDIOAAJ.js} +15 -6
  202. package/node_modules/pi-lens/dist/index.js +6993 -5396
  203. package/node_modules/pi-lens/dist/mcp/analyze-cli.js +10 -10
  204. package/node_modules/pi-lens/dist/mcp/cli.js +44 -42
  205. package/node_modules/pi-lens/dist/mcp/server.js +1627 -504
  206. package/node_modules/pi-lens/dist/mcp/worker.js +62 -61
  207. package/node_modules/pi-lens/dist/probes/installer.js +20 -19
  208. package/node_modules/pi-lens/docs/adr/0003-git-guard-latch-writer.md +11 -6
  209. package/node_modules/pi-lens/docs/agent-tools.md +18 -8
  210. package/node_modules/pi-lens/docs/alignment-families.md +29 -0
  211. package/node_modules/pi-lens/docs/ast-grep_rules_catalog.md +6 -4
  212. package/node_modules/pi-lens/docs/ci-bot-pr-checks.md +126 -0
  213. package/node_modules/pi-lens/docs/configuration.md +99 -3
  214. package/node_modules/pi-lens/docs/defect-shapes.md +55 -12
  215. package/node_modules/pi-lens/docs/engineering-principles.md +27 -2
  216. package/node_modules/pi-lens/docs/features.md +2 -2
  217. package/node_modules/pi-lens/docs/invariants/git-guard-host.md +7 -3
  218. package/node_modules/pi-lens/docs/invariants/language-config.md +15 -4
  219. package/node_modules/pi-lens/docs/invariants/lsp-trust-exec.md +16 -2
  220. package/node_modules/pi-lens/docs/invariants/paths-os.md +4 -2
  221. package/node_modules/pi-lens/docs/lsp-capability-matrix.md +119 -39
  222. package/node_modules/pi-lens/docs/merge-queue-rollout.md +1 -1
  223. package/node_modules/pi-lens/docs/pi-lens-fixer.md +24 -17
  224. package/node_modules/pi-lens/docs/pi-lens-merge-policy.md +20 -11
  225. package/node_modules/pi-lens/docs/pi-lens-monitor.md +9 -0
  226. package/node_modules/pi-lens/docs/pi-lens-orchestration.md +4 -1
  227. package/node_modules/pi-lens/docs/pi-lens-reviewer.md +5 -5
  228. package/node_modules/pi-lens/docs/pi-lens-subagent.md +6 -3
  229. package/node_modules/pi-lens/docs/public-api-stability.md +18 -2
  230. package/node_modules/pi-lens/docs/schema/pi-lens-config-v1.json +10 -0
  231. package/node_modules/pi-lens/docs/settings.md +10 -6
  232. package/node_modules/pi-lens/docs/word-index.md +17 -5
  233. package/node_modules/pi-lens/package.json +5 -3
  234. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-accumulating-spread-js-test.yml +37 -0
  235. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/ts-redundant-filter-map-test.yml +12 -1
  236. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-js-test.yml +12 -0
  237. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-test.yml +25 -0
  238. package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-accumulating-spread-js.yml +49 -1
  239. package/node_modules/pi-lens/rules/ast-grep-rules/rules/ts-redundant-filter-map.yml +9 -1
  240. package/node_modules/pi-lens/rules/ast-grep-rules/rules-disabled/filter-then-map-js.yml +17 -0
  241. package/node_modules/pi-lens/rules/ast-grep-rules/rules-disabled/filter-then-map.yml +36 -0
  242. package/node_modules/pi-lens/rules/ast-grep-rules/self-scan-baseline.json +1 -1
  243. package/node_modules/pi-provider-qoder/README.md +22 -0
  244. package/node_modules/pi-provider-qoder/dist/index.js +370 -11
  245. package/node_modules/pi-provider-qoder/package.json +5 -2
  246. package/package.json +11 -8
  247. package/node_modules/@tifan/pi-preferred-thinking/README.md +0 -54
  248. package/node_modules/@tifan/pi-preferred-thinking/package.json +0 -43
  249. package/node_modules/@tifan/pi-preferred-thinking/src/index.ts +0 -236
  250. package/node_modules/pi-lens/dist/chunk-46TNM7XZ.js +0 -88
  251. package/node_modules/pi-lens/dist/chunk-72OKUXSD.js +0 -31
  252. package/node_modules/pi-lens/dist/chunk-7GLOLOSH.js +0 -57
  253. package/node_modules/pi-lens/dist/chunk-AKUUMGD5.js +0 -26
  254. package/node_modules/pi-lens/dist/chunk-ASUXV767.js +0 -22
  255. package/node_modules/pi-lens/dist/chunk-CTADOKYM.js +0 -25
  256. package/node_modules/pi-lens/dist/chunk-JJ2RRESP.js +0 -58
  257. package/node_modules/pi-lens/dist/chunk-LSC3VADM.js +0 -23
  258. package/node_modules/pi-lens/dist/chunk-SHLDT3OI.js +0 -27
  259. package/node_modules/pi-lens/dist/chunk-UF7RTZSO.js +0 -27
  260. package/node_modules/pi-lens/dist/chunk-W4WP2ERB.js +0 -30
  261. 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);
@@ -10213,7 +10437,10 @@ function streamQoder(model, context, options) {
10213
10437
  begin_at: Date.now()
10214
10438
  }
10215
10439
  };
10216
- const chatURL = getQoderChatURL(providerMode);
10440
+ let chatURL = getQoderChatURL(providerMode);
10441
+ const attemptedChatBases = /* @__PURE__ */ new Set();
10442
+ let switchedChatEndpoint = false;
10443
+ let chatEndpointSwitches = 0;
10217
10444
  const modelSource = modelConfig.source || "system";
10218
10445
  const requestedRetries = options?.maxRetries;
10219
10446
  const modelBusyRetries = Math.min(
@@ -10265,6 +10492,9 @@ function streamQoder(model, context, options) {
10265
10492
  });
10266
10493
  if (!response.ok) {
10267
10494
  const errText = await response.text();
10495
+ if (isDailyChatLimitRejection(errText)) {
10496
+ throw new QoderDailyChatLimitError(`Upstream status ${response.status}: ${errText}`, false);
10497
+ }
10268
10498
  throw new Error(`Qoder API request failed: ${response.status} ${response.statusText}. Response: ${errText}`);
10269
10499
  }
10270
10500
  const reader = response.body?.getReader();
@@ -10316,6 +10546,12 @@ function streamQoder(model, context, options) {
10316
10546
  }
10317
10547
  throw formatQueuedBusyError(busy);
10318
10548
  }
10549
+ if (isDailyChatLimitRejection(envelope.body)) {
10550
+ throw new QoderDailyChatLimitError(
10551
+ `Upstream status ${envelope.statusCodeValue}: ${envelope.body}`,
10552
+ sawModelOutput
10553
+ );
10554
+ }
10319
10555
  throw new Error(`Upstream status ${envelope.statusCodeValue}: ${envelope.body}`);
10320
10556
  }
10321
10557
  const innerStr = envelope.body;
@@ -10580,8 +10816,34 @@ function streamQoder(model, context, options) {
10580
10816
  for (let attempt = 0; ; attempt++) {
10581
10817
  try {
10582
10818
  await runAttempt();
10819
+ if (switchedChatEndpoint) {
10820
+ rememberChatBaseUrl(providerMode, getQoderChatBaseUrl(providerMode));
10821
+ }
10583
10822
  return;
10584
10823
  } catch (e) {
10824
+ if (e instanceof QoderDailyChatLimitError) {
10825
+ if (!e.sawModelOutput && chatEndpointSwitches < MAX_CHAT_ENDPOINT_SWITCHES) {
10826
+ const nextBase = await rotateChatEndpoint(
10827
+ providerMode,
10828
+ { userID, authToken: accessToken, name, email, machineID },
10829
+ attemptedChatBases
10830
+ );
10831
+ if (nextBase) {
10832
+ chatEndpointSwitches++;
10833
+ switchedChatEndpoint = true;
10834
+ chatURL = getQoderChatURL(providerMode);
10835
+ headers = buildAuthHeaders(encodedBytes, chatURL, {
10836
+ userID,
10837
+ authToken: accessToken,
10838
+ name,
10839
+ email,
10840
+ machineID
10841
+ });
10842
+ continue;
10843
+ }
10844
+ }
10845
+ throw e;
10846
+ }
10585
10847
  if (!(e instanceof QoderModelBusyError)) throw e;
10586
10848
  if (e.sawModelOutput || output.content.length > 0) {
10587
10849
  throw new Error("Qoder model rejected the request after partial output (10605 RESOURCE_LIMIT)");
@@ -10627,6 +10889,90 @@ function streamQoder(model, context, options) {
10627
10889
  return stream;
10628
10890
  }
10629
10891
 
10892
+ // src/usage-provider.ts
10893
+ var KNOWN_UNITS = {
10894
+ percent: true,
10895
+ tokens: true,
10896
+ requests: true,
10897
+ credits: true,
10898
+ usd: true,
10899
+ minutes: true,
10900
+ bytes: true
10901
+ };
10902
+ function unitFor(raw) {
10903
+ const lowered = raw?.toLowerCase();
10904
+ if (!lowered) return "credits";
10905
+ return KNOWN_UNITS[lowered] === true ? lowered : "unknown";
10906
+ }
10907
+ function statusFor(usedFraction, remaining, exceeded) {
10908
+ if (exceeded || remaining !== void 0 && remaining <= 0) return "exhausted";
10909
+ if (usedFraction !== void 0 && usedFraction >= 0.9) return "warning";
10910
+ return "ok";
10911
+ }
10912
+ var NO_EXPIRY_FROM_MS = Date.UTC(3e3, 0, 1);
10913
+ function toUsageReport(usage, providerID, fetchedAt = Date.now()) {
10914
+ const buckets = usage.usageBuckets ?? [];
10915
+ if (buckets.length === 0) return null;
10916
+ const parsedReset = usage.resetAt === void 0 ? Number.NaN : Date.parse(usage.resetAt);
10917
+ const resetsAt = Number.isFinite(parsedReset) && parsedReset < NO_EXPIRY_FROM_MS ? parsedReset : void 0;
10918
+ const raw = usage.raw;
10919
+ const exceeded = raw?.isQuotaExceeded === true;
10920
+ const snapshot = normalizeQoderQuotaSnapshot(usage.raw);
10921
+ const amountsFor = (id) => {
10922
+ if (id === "user-quota") return snapshot?.userQuota;
10923
+ if (id === "add-on-quota") return snapshot?.addOnQuota;
10924
+ if (id === "org-resource-package") return snapshot?.orgResourcePackage;
10925
+ return void 0;
10926
+ };
10927
+ const limits = buckets.map((bucket) => {
10928
+ const amounts = amountsFor(bucket.id);
10929
+ const usedFraction = amounts?.used !== void 0 && amounts.total !== void 0 && amounts.total > 0 ? amounts.used / amounts.total : void 0;
10930
+ return {
10931
+ id: bucket.id,
10932
+ label: bucket.label,
10933
+ scope: { provider: providerID },
10934
+ ...resetsAt !== void 0 ? {
10935
+ window: {
10936
+ id: "period",
10937
+ label: usage.subscriptionTitle ?? "Billing period",
10938
+ resetsAt,
10939
+ resetLabel: usage.subscriptionTitle ? "plan expires" : "resets"
10940
+ }
10941
+ } : {},
10942
+ amount: {
10943
+ unit: unitFor(amounts?.unit ?? bucket.unit),
10944
+ ...amounts?.used !== void 0 ? { used: amounts.used } : {},
10945
+ ...amounts?.total !== void 0 ? { limit: amounts.total } : {},
10946
+ ...amounts?.remaining !== void 0 ? { remaining: amounts.remaining } : {},
10947
+ ...usedFraction !== void 0 ? { usedFraction: Math.min(1, Math.max(0, usedFraction)) } : {}
10948
+ },
10949
+ status: statusFor(usedFraction, amounts?.remaining, exceeded)
10950
+ };
10951
+ });
10952
+ const notes = [];
10953
+ if (typeof raw?.userType === "string" && raw.userType) notes.push(`Account kind: ${raw.userType}`);
10954
+ if (usage.summary) notes.push(usage.summary);
10955
+ if (usage.manageUrl) notes.push(`Manage: ${usage.manageUrl}`);
10956
+ return { provider: providerID, fetchedAt, limits, ...notes.length > 0 ? { notes } : {} };
10957
+ }
10958
+ function createQoderUsageProvider(mode, providerID) {
10959
+ return {
10960
+ id: providerID,
10961
+ validatesCredentials: false,
10962
+ async fetchUsage(params) {
10963
+ const cred = params.credential;
10964
+ const access = typeof cred?.accessToken === "string" ? cred.accessToken : cred?.access;
10965
+ if (typeof access !== "string" || access.length === 0) return null;
10966
+ try {
10967
+ const usage = await fetchQoderUsageForMode({ ...cred, access }, mode, params.signal);
10968
+ return toUsageReport(usage, providerID);
10969
+ } catch {
10970
+ return null;
10971
+ }
10972
+ }
10973
+ };
10974
+ }
10975
+
10630
10976
  // src/index.ts
10631
10977
  var QODER_API = "qoder-api";
10632
10978
  async function registerQoderApi() {
@@ -10668,15 +11014,17 @@ function createQoderOAuth(mode) {
10668
11014
  function registerQoderProvider(pi, mode) {
10669
11015
  const providerID = getQoderRegionConfig(mode).providerID;
10670
11016
  const oauth = createQoderOAuth(mode);
10671
- pi.registerProvider(providerID, {
11017
+ const config = {
10672
11018
  baseUrl: getQoderBaseUrl(mode),
10673
11019
  api: QODER_API,
10674
11020
  models: modelsForProvider(mode, providerID),
10675
11021
  oauth,
10676
11022
  // pi-coding-agent resolves its own nested @earendil-works/pi-ai copy, so the
10677
11023
  // structurally identical Model/Context types are nominally distinct here.
10678
- streamSimple: streamQoder
10679
- });
11024
+ streamSimple: streamQoder,
11025
+ usage: createQoderUsageProvider(mode, providerID)
11026
+ };
11027
+ pi.registerProvider(providerID, config);
10680
11028
  }
10681
11029
  async function refreshModelsAtStartup(mode) {
10682
11030
  const providerID = getQoderRegionConfig(mode).providerID;
@@ -10696,8 +11044,19 @@ async function index_default(pi) {
10696
11044
  await registerQoderApi();
10697
11045
  for (const mode of QODER_MODES) {
10698
11046
  const providerID = getQoderRegionConfig(mode).providerID;
11047
+ applyCachedChatEndpoint(mode);
10699
11048
  try {
10700
11049
  await autoLoginQoderFromEnvironment(providerID, mode);
11050
+ const credentials = getCachedCredentials("", providerID);
11051
+ if (credentials?.access) {
11052
+ await refreshChatEndpoint(mode, {
11053
+ userID: credentials.userID || "qoder-user",
11054
+ authToken: credentials.access,
11055
+ name: credentials.name,
11056
+ email: credentials.email,
11057
+ machineID: credentials.machineID
11058
+ });
11059
+ }
10701
11060
  await refreshModelsAtStartup(mode);
10702
11061
  } catch (error) {
10703
11062
  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.8",
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.0",
4
4
  "description": "Aggregate installer for HerbertGao-maintained Pi extensions.",
5
5
  "keywords": [
6
6
  "extensions",
@@ -42,7 +42,7 @@
42
42
  "@herbertgao/pi-bark": "0.2.1",
43
43
  "@herbertgao/pi-cc-extensions": "1.0.12-local.1",
44
44
  "@herbertgao/pi-impeccable": "0.1.0",
45
- "@herbertgao/pi-subagents": "0.22.0-local.2",
45
+ "@herbertgao/pi-subagents": "0.22.1-local.1",
46
46
  "@herbertgao/sol-pi": "0.4.2",
47
47
  "@juicesharp/rpiv-ask-user-question": "2.15.0",
48
48
  "@juicesharp/rpiv-config": "^2.15.0",
@@ -57,9 +57,9 @@
57
57
  "@tifan/pi-copy-response": "0.2.7",
58
58
  "@tifan/pi-handoff": "2.2.2",
59
59
  "@tifan/pi-mermaid-open": "0.2.2",
60
- "@tifan/pi-preferred-thinking": "1.0.2",
61
60
  "@tifan/pi-recap": "0.4.8",
62
61
  "@tifan/pi-rename": "0.6.0",
62
+ "@tintinweb/pi-tasks": "0.9.1",
63
63
  "@typesafe-ai/sdk": "0.7.0",
64
64
  "croner": "^10.0.1",
65
65
  "dbus-native": "^0.16.2",
@@ -68,13 +68,14 @@
68
68
  "jiti": "^2.7.0",
69
69
  "js-yaml": "^5.2.2",
70
70
  "linkedom": "^0.16.0",
71
- "minimatch": "^10.2.6",
71
+ "minimatch": "^11.0.1",
72
72
  "nanoid": "^5.0.0",
73
73
  "p-limit": "^6.1.0",
74
74
  "pi-antigravity": "0.11.0",
75
- "pi-lens": "4.4.7",
75
+ "pi-commandcode-provider": "0.7.11",
76
+ "pi-lens": "4.4.8",
76
77
  "pi-next-cue": "1.0.8",
77
- "pi-provider-qoder": "0.6.6",
78
+ "pi-provider-qoder": "0.6.8",
78
79
  "pi-typesafe": "0.13.1",
79
80
  "pi-web-access": "0.46.0",
80
81
  "pidusage": "^4.0.1",
@@ -113,11 +114,12 @@
113
114
  "@tifan/pi-copy-response",
114
115
  "@tifan/pi-handoff",
115
116
  "@tifan/pi-mermaid-open",
116
- "@tifan/pi-preferred-thinking",
117
117
  "@tifan/pi-recap",
118
118
  "@tifan/pi-rename",
119
+ "@tintinweb/pi-tasks",
119
120
  "grok-mermaid",
120
121
  "pi-antigravity",
122
+ "pi-commandcode-provider",
121
123
  "pi-lens",
122
124
  "pi-next-cue",
123
125
  "pi-provider-qoder",
@@ -136,10 +138,10 @@
136
138
  "./node_modules/@tifan/pi-handoff/src/index.ts",
137
139
  "./node_modules/@tifan/pi-handoff/src/session-query.ts",
138
140
  "./node_modules/@tifan/pi-mermaid-open/src/index.ts",
139
- "./node_modules/@tifan/pi-preferred-thinking/src/index.ts",
140
141
  "./node_modules/@tifan/pi-recap/src/index.ts",
141
142
  "./node_modules/@tifan/pi-rename/src/index.ts",
142
143
  "./node_modules/@herbertgao/pi-subagents/src/index.ts",
144
+ "./node_modules/@tintinweb/pi-tasks/src/index.ts",
143
145
  "./node_modules/@herbertgao/pi-agency/src/index.ts",
144
146
  "./node_modules/@juicesharp/rpiv-ask-user-question/index.ts",
145
147
  "./node_modules/@herbertgao/pi-bark/src/index.ts",
@@ -153,6 +155,7 @@
153
155
  "./node_modules/pi-antigravity/src/features/google-search.ts",
154
156
  "./node_modules/pi-antigravity/src/features/generate-image.ts",
155
157
  "./node_modules/pi-provider-qoder/dist/index.js",
158
+ "./node_modules/pi-commandcode-provider/index.ts",
156
159
  "./node_modules/pi-typesafe/extensions/index.js",
157
160
  "./extensions/clef.mjs"
158
161
  ],
@@ -1,54 +0,0 @@
1
- # @tifan/pi-preferred-thinking
2
-
3
- Set and apply per-model thinking levels from Pi's native `enabledModels` setting.
4
-
5
- ## Install
6
-
7
- ```bash
8
- pi install npm:@tifan/pi-preferred-thinking
9
- ```
10
-
11
- This package requires Pi 0.84.2 or newer.
12
-
13
- ## How it works
14
-
15
- Run `/preferred-thinking` to choose a thinking level for the current model. The
16
- extension writes the model pin to Pi's `settings.json` and reloads Pi so the
17
- native model scope uses it.
18
-
19
- When Pi selects a scoped model, the extension applies its native thinking pin.
20
- It also applies the pin when the model picker is used, which keeps model cycling
21
- and model selection consistent.
22
-
23
- If a reasoning model has no saved pin, the extension shows a short hint above
24
- the editor. It does not change the current thinking level in that case.
25
-
26
- ## Configuration
27
-
28
- Add models to Pi's `enabledModels` setting. The extension preserves other
29
- entries and updates only the selected model:
30
-
31
- ```json
32
- {
33
- "enabledModels": [
34
- "openai-codex/gpt-5.6-luna:xhigh",
35
- "openai-codex/gpt-5.6-terra:high"
36
- ]
37
- }
38
- ```
39
-
40
- The extension requires `enabledModels` to exist before it can save a pin. If
41
- the selected model is not listed, it adds an exact entry without removing other
42
- models or patterns.
43
-
44
- The old `$PI_CODING_AGENT_DIR/extensions/pi-preferred-thinking.json` file is no longer
45
- read. Existing users must move preferences to `enabledModels` or set them with
46
- `/preferred-thinking`.
47
-
48
- ## Release notes
49
-
50
- See [CHANGELOG.md](https://github.com/tifandotme/pi-extensions/blob/master/packages/pi-preferred-thinking/CHANGELOG.md)
51
-
52
- ## License
53
-
54
- [MIT](https://github.com/tifandotme/pi-extensions/blob/master/LICENSE)