@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
@@ -0,0 +1,370 @@
1
+ export interface CommandCodeModelCostRates {
2
+ input: number
3
+ output: number
4
+ cacheRead: number
5
+ cacheWrite: number
6
+ }
7
+
8
+ export interface CommandCodeModelCostTier extends CommandCodeModelCostRates {
9
+ inputTokensAbove: number
10
+ }
11
+
12
+ export interface CommandCodeModelCost extends CommandCodeModelCostRates {
13
+ tiers?: readonly CommandCodeModelCostTier[]
14
+ }
15
+
16
+ export interface TemporaryPricing {
17
+ models: readonly string[]
18
+ expiresOn: string
19
+ description: string
20
+ }
21
+
22
+ export const PRICING_SOURCE_URL = "https://commandcode.ai/docs/resources/pricing-limits"
23
+ export const PRICING_LAST_VERIFIED = "2026-10-28"
24
+
25
+ export const ZERO_MODEL_COST: CommandCodeModelCost = {
26
+ input: 0,
27
+ output: 0,
28
+ cacheRead: 0,
29
+ cacheWrite: 0,
30
+ }
31
+
32
+ /**
33
+ * Display prices in USD per million tokens.
34
+ *
35
+ * Context-dependent rates use pi's request-wide input pricing tiers. The
36
+ * highest threshold exceeded by input + cache reads + cache writes applies to
37
+ * the full request. The Command Code usage page remains authoritative for the
38
+ * amount billed for an individual request.
39
+ */
40
+ export const MODEL_COSTS: Readonly<Record<string, CommandCodeModelCost>> = {
41
+ // Free models
42
+ "poolside/laguna-s-2.1-free": { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
43
+ "stealth/glyph-cluster:free": { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
44
+ // Free while capacity lasts; no fixed expiry is published.
45
+ "reflection/beam:free": { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
46
+
47
+ // Open and open-weight models
48
+ "ornith/ornith-1.5-122b": { input: 0.16, output: 0.64, cacheRead: 0.02, cacheWrite: 0 },
49
+ "inclusionai/ling-3.1-flash": { input: 0.3, output: 0.9, cacheRead: 0.06, cacheWrite: 0 },
50
+ "mistral/mistral-large-4": { input: 1.36, output: 4.18, cacheRead: 0.14, cacheWrite: 0 },
51
+ "tencent/hy3-paid": { input: 0.14, output: 0.58, cacheRead: 0.035, cacheWrite: 0 },
52
+ "tencent/hy4-preview": { input: 0.834, output: 2.501, cacheRead: 0.042, cacheWrite: 0 },
53
+ "moonshotai/Kimi-K3.1-Pro": { input: 2, output: 10, cacheRead: 0.2, cacheWrite: 0 },
54
+ "moonshotai/Kimi-K3": { input: 3, output: 15, cacheRead: 0.3, cacheWrite: 0 },
55
+ "moonshotai/Kimi-K2.7-Code": { input: 0.95, output: 4, cacheRead: 0.19, cacheWrite: 0 },
56
+ "moonshotai/Kimi-K2.7-Code-Highspeed": {
57
+ input: 1.9,
58
+ output: 8,
59
+ cacheRead: 0.38,
60
+ cacheWrite: 0,
61
+ },
62
+ "moonshotai/Kimi-K2.6": { input: 0.95, output: 4, cacheRead: 0.16, cacheWrite: 0 },
63
+ "moonshotai/Kimi-K2.5": { input: 0.6, output: 3, cacheRead: 0.1, cacheWrite: 0 },
64
+ "z-ai/glm-5.3-flash": { input: 0.15, output: 0.5, cacheRead: 0.03, cacheWrite: 0 },
65
+ "z-ai/glm-5.3-flashx": { input: 0.37, output: 1.25, cacheRead: 0.075, cacheWrite: 0 },
66
+ "zai-org/GLM-5.3": { input: 1.4, output: 4.4, cacheRead: 0.26, cacheWrite: 0 },
67
+ "zai-org/GLM-5.2": { input: 1.4, output: 4.4, cacheRead: 0.26, cacheWrite: 0 },
68
+ "zai-org/GLM-5.2-Fast": { input: 3, output: 10.25, cacheRead: 0.5, cacheWrite: 0 },
69
+ "zai-org/GLM-5.1": { input: 1.4, output: 4.4, cacheRead: 0.26, cacheWrite: 0 },
70
+ "zai-org/GLM-5": { input: 1, output: 3.2, cacheRead: 0.2, cacheWrite: 0 },
71
+ "minimax/minimax-m3.1-flash": { input: 0.15, output: 0.6, cacheRead: 0.015, cacheWrite: 0 },
72
+ "MiniMaxAI/MiniMax-M3": { input: 0.3, output: 1.2, cacheRead: 0.06, cacheWrite: 0 },
73
+ "MiniMaxAI/MiniMax-M2.7": { input: 0.3, output: 1.2, cacheRead: 0.06, cacheWrite: 0 },
74
+ "MiniMaxAI/MiniMax-M2.5": { input: 0.3, output: 1.2, cacheRead: 0.03, cacheWrite: 0 },
75
+ // DeepSeek V4 uses time-dependent rates. Display the documented off-peak
76
+ // rates, which apply for 17 hours per day; the Usage page remains authoritative.
77
+ "deepseek/deepseek-v4-pro": {
78
+ input: 0.66,
79
+ output: 1.98,
80
+ cacheRead: 0.022,
81
+ cacheWrite: 0,
82
+ },
83
+ "deepseek/deepseek-v4-flash": {
84
+ input: 0.15,
85
+ output: 0.6,
86
+ cacheRead: 0.003,
87
+ cacheWrite: 0,
88
+ },
89
+ "deepseek/deepseek-v4-flash-vision-exp": {
90
+ input: 0.15,
91
+ output: 0.6,
92
+ cacheRead: 0.003,
93
+ cacheWrite: 0,
94
+ },
95
+ "deepseek/deepseek-v4-flash-fast": {
96
+ input: 0.28,
97
+ output: 0.56,
98
+ cacheRead: 0.07,
99
+ cacheWrite: 0,
100
+ },
101
+ "deepseek/deepseek-v4.1-flash": {
102
+ input: 0.15,
103
+ output: 0.6,
104
+ cacheRead: 0.003,
105
+ cacheWrite: 0,
106
+ },
107
+ "deepseek/deepseek-v4.1-flash-fast": {
108
+ input: 0.16,
109
+ output: 0.58,
110
+ cacheRead: 0.016,
111
+ cacheWrite: 0,
112
+ },
113
+ "Qwen/Qwen3.8-Max-Prime": { input: 4, output: 12, cacheRead: 0.5, cacheWrite: 5 },
114
+ "Qwen/Qwen3.8-Max": { input: 2, output: 6, cacheRead: 0.25, cacheWrite: 2.5 },
115
+ "Qwen/Qwen3.8-Max-0902": { input: 2, output: 6, cacheRead: 0.25, cacheWrite: 0 },
116
+ "Qwen/Qwen3.8-27B": { input: 0.4, output: 3, cacheRead: 0.04, cacheWrite: 0 },
117
+ "Qwen/Qwen3.8-Flash": { input: 0.16, output: 0.47, cacheRead: 0.016, cacheWrite: 0 },
118
+ "Qwen/Qwen3.8-Omni-Flash": { input: 0.15, output: 0.47, cacheRead: 0.016, cacheWrite: 0 },
119
+ "Qwen/Qwen3.7-Max": { input: 2.5, output: 7.5, cacheRead: 0.5, cacheWrite: 3.13 },
120
+ "Qwen/Qwen3.7-Plus": {
121
+ input: 0.4,
122
+ output: 1.6,
123
+ cacheRead: 0.08,
124
+ cacheWrite: 0.5,
125
+ tiers: [
126
+ {
127
+ inputTokensAbove: 256_000,
128
+ input: 1.2,
129
+ output: 4.8,
130
+ cacheRead: 0.24,
131
+ cacheWrite: 1.5,
132
+ },
133
+ ],
134
+ },
135
+ "Qwen/Qwen3.7-Flash": {
136
+ input: 0.03,
137
+ output: 0.13,
138
+ cacheRead: 0.006,
139
+ cacheWrite: 0.038,
140
+ tiers: [
141
+ {
142
+ inputTokensAbove: 32_000,
143
+ input: 0.1,
144
+ output: 0.4,
145
+ cacheRead: 0.02,
146
+ cacheWrite: 0.125,
147
+ },
148
+ {
149
+ inputTokensAbove: 256_000,
150
+ input: 0.2,
151
+ output: 0.8,
152
+ cacheRead: 0.04,
153
+ cacheWrite: 0.25,
154
+ },
155
+ ],
156
+ },
157
+ "Qwen/Qwen3.6-Max-Preview": {
158
+ input: 1.3,
159
+ output: 7.8,
160
+ cacheRead: 0.26,
161
+ cacheWrite: 1.63,
162
+ },
163
+ "Qwen/Qwen3.6-Plus": {
164
+ input: 0.5,
165
+ output: 3,
166
+ cacheRead: 0.1,
167
+ cacheWrite: 0,
168
+ tiers: [{ inputTokensAbove: 256_000, input: 2, output: 6, cacheRead: 0.2, cacheWrite: 0 }],
169
+ },
170
+ "meituan/LongCat-2.0": { input: 0.3, output: 1.2, cacheRead: 0.006, cacheWrite: 0 },
171
+ "stepfun/Step-5-Preview": { input: 1, output: 2.7, cacheRead: 0.05, cacheWrite: 0 },
172
+ "stepfun/Step-3.7-Flash": { input: 0.2, output: 1.15, cacheRead: 0.04, cacheWrite: 0 },
173
+ "stepfun/Step-3.5-Flash": { input: 0.09, output: 0.3, cacheRead: 0.02, cacheWrite: 0 },
174
+ // Permanent discounted rates.
175
+ "xiaomi/mimo-v2.6-pro": { input: 0.435, output: 0.87, cacheRead: 0.0036, cacheWrite: 0 },
176
+ "xiaomi/mimo-v2.6-pro-ultraspeed": {
177
+ input: 4.35,
178
+ output: 8.7,
179
+ cacheRead: 0.036,
180
+ cacheWrite: 0,
181
+ },
182
+ "xiaomi/mimo-v2.6-flash": { input: 0.14, output: 0.28, cacheRead: 0.0028, cacheWrite: 0 },
183
+ "nvidia/nemotron-3.5-super-vl": { input: 0.2, output: 0.5, cacheRead: 0.04, cacheWrite: 0 },
184
+ "nvidia/nemotron-3-ultra-550b-a55b": {
185
+ input: 0.6,
186
+ output: 2.4,
187
+ cacheRead: 0.12,
188
+ cacheWrite: 0,
189
+ },
190
+ "sakana/fugu-ultra": { input: 5, output: 30, cacheRead: 0.5, cacheWrite: 0 },
191
+ "thinkingmachines/inkling": { input: 1, output: 4.05, cacheRead: 0.17, cacheWrite: 0 },
192
+ "thinkingmachines/inkling-small": {
193
+ input: 0.5,
194
+ output: 1.2,
195
+ cacheRead: 0.1,
196
+ cacheWrite: 0,
197
+ },
198
+ "meta/muse-spark-1.1": { input: 1.25, output: 4.25, cacheRead: 0.15, cacheWrite: 0 },
199
+ "meta/muse-spark-1.2": { input: 1.25, output: 4.25, cacheRead: 0.15, cacheWrite: 0 },
200
+ "meta/muse-spark-1.3": { input: 1.25, output: 4.25, cacheRead: 0.15, cacheWrite: 0 },
201
+ "meta/muse-spark-open": { input: 1.25, output: 4.25, cacheRead: 0.15, cacheWrite: 0 },
202
+ "meta/muse-wonder-1.0": { input: 4, output: 20, cacheRead: 0.2, cacheWrite: 0 },
203
+ "meta/muse-spark-1.2-contributor": {
204
+ input: 0.1,
205
+ output: 0.2,
206
+ cacheRead: 0.002,
207
+ cacheWrite: 0,
208
+ },
209
+ "meta/muse-spark-1.3-contributor": {
210
+ input: 0.1,
211
+ output: 0.2,
212
+ cacheRead: 0.002,
213
+ cacheWrite: 0,
214
+ },
215
+
216
+ // Anthropic
217
+ "claude-sonnet-5-5": { input: 2, output: 10, cacheRead: 0.1, cacheWrite: 2.5 },
218
+ "claude-sonnet-5": { input: 2, output: 10, cacheRead: 0.2, cacheWrite: 2.5 },
219
+ "claude-sonnet-4-6": { input: 3, output: 15, cacheRead: 0.3, cacheWrite: 3.75 },
220
+ "claude-fable-5-1": { input: 10, output: 50, cacheRead: 0.25, cacheWrite: 12.5 },
221
+ "claude-fable-5": { input: 10, output: 50, cacheRead: 1, cacheWrite: 12.5 },
222
+ "claude-opus-5-5": { input: 4, output: 20, cacheRead: 0.2, cacheWrite: 5 },
223
+ "claude-opus-5": { input: 5, output: 25, cacheRead: 0.5, cacheWrite: 6.25 },
224
+ "claude-opus-4-8": { input: 5, output: 25, cacheRead: 0.5, cacheWrite: 6.25 },
225
+ "claude-opus-4-7": { input: 5, output: 25, cacheRead: 0.5, cacheWrite: 6.25 },
226
+ "claude-haiku-5-5": {
227
+ input: 0.1,
228
+ output: 0.5,
229
+ cacheRead: 0.01,
230
+ cacheWrite: 0.125,
231
+ tiers: [
232
+ {
233
+ inputTokensAbove: 100_000,
234
+ input: 0.5,
235
+ output: 2.5,
236
+ cacheRead: 0.05,
237
+ cacheWrite: 0.625,
238
+ },
239
+ ],
240
+ },
241
+ "claude-haiku-4-5-20251001": {
242
+ input: 1,
243
+ output: 5,
244
+ cacheRead: 0.1,
245
+ cacheWrite: 1.25,
246
+ },
247
+
248
+ // OpenAI
249
+ "gpt-6-astra": {
250
+ input: 10,
251
+ output: 50,
252
+ cacheRead: 1,
253
+ cacheWrite: 12.5,
254
+ tiers: [{ inputTokensAbove: 272_000, input: 20, output: 75, cacheRead: 2, cacheWrite: 25 }],
255
+ },
256
+ "gpt-6.1-sol": {
257
+ input: 2,
258
+ output: 10,
259
+ cacheRead: 0.1,
260
+ cacheWrite: 2.5,
261
+ tiers: [{ inputTokensAbove: 272_000, input: 4, output: 15, cacheRead: 0.2, cacheWrite: 5 }],
262
+ },
263
+ "gpt-6.1-terra": {
264
+ input: 1,
265
+ output: 5,
266
+ cacheRead: 0.05,
267
+ cacheWrite: 1.25,
268
+ tiers: [{ inputTokensAbove: 272_000, input: 2, output: 7.5, cacheRead: 0.1, cacheWrite: 2.5 }],
269
+ },
270
+ "gpt-6-sol": {
271
+ input: 2,
272
+ output: 10,
273
+ cacheRead: 0.2,
274
+ cacheWrite: 2.5,
275
+ tiers: [{ inputTokensAbove: 272_000, input: 4, output: 15, cacheRead: 0.4, cacheWrite: 5 }],
276
+ },
277
+ "gpt-6-luna": {
278
+ input: 0.1,
279
+ output: 0.5,
280
+ cacheRead: 0.01,
281
+ cacheWrite: 0.125,
282
+ tiers: [
283
+ { inputTokensAbove: 272_000, input: 0.2, output: 0.75, cacheRead: 0.02, cacheWrite: 0.25 },
284
+ ],
285
+ },
286
+ "gpt-5.6-sol": {
287
+ input: 5,
288
+ output: 30,
289
+ cacheRead: 0.5,
290
+ cacheWrite: 6.25,
291
+ tiers: [{ inputTokensAbove: 272_000, input: 10, output: 45, cacheRead: 1, cacheWrite: 12.5 }],
292
+ },
293
+ "gpt-5.6-terra": {
294
+ input: 2,
295
+ output: 12,
296
+ cacheRead: 0.2,
297
+ cacheWrite: 2.5,
298
+ tiers: [{ inputTokensAbove: 272_000, input: 4, output: 18, cacheRead: 0.4, cacheWrite: 5 }],
299
+ },
300
+ "gpt-5.6-luna": {
301
+ input: 0.2,
302
+ output: 1.2,
303
+ cacheRead: 0.02,
304
+ cacheWrite: 0.25,
305
+ tiers: [
306
+ { inputTokensAbove: 272_000, input: 0.4, output: 1.8, cacheRead: 0.04, cacheWrite: 0.5 },
307
+ ],
308
+ },
309
+ "gpt-5.5": { input: 5, output: 30, cacheRead: 0.5, cacheWrite: 0 },
310
+ "gpt-5.4": { input: 2.5, output: 15, cacheRead: 0.25, cacheWrite: 0 },
311
+ "gpt-5.3-codex": { input: 2, output: 8, cacheRead: 0.5, cacheWrite: 0 },
312
+ "gpt-5.4-mini": { input: 0.75, output: 4.5, cacheRead: 0.075, cacheWrite: 0 },
313
+
314
+ // Google and xAI
315
+ "google/gemini-3.7-flash": {
316
+ input: 1.5,
317
+ output: 7.5,
318
+ cacheRead: 0.15,
319
+ cacheWrite: 0.08334,
320
+ },
321
+ "google/gemini-4-argon": { input: 2, output: 10, cacheRead: 0.1, cacheWrite: 0 },
322
+ "google/gemini-3.8-flash": {
323
+ input: 1.5,
324
+ output: 7.5,
325
+ cacheRead: 0.15,
326
+ cacheWrite: 0,
327
+ },
328
+ "google/gemini-3.6-flash": { input: 1.5, output: 7.5, cacheRead: 0.15, cacheWrite: 0 },
329
+ "google/gemini-3.5-flash": { input: 1.5, output: 9, cacheRead: 0.15, cacheWrite: 0 },
330
+ "google/gemini-3.5-flash-lite": {
331
+ input: 0.3,
332
+ output: 2.5,
333
+ cacheRead: 0.03,
334
+ cacheWrite: 0,
335
+ },
336
+ "google/gemini-3.1-flash-lite": {
337
+ input: 0.25,
338
+ output: 1.5,
339
+ cacheRead: 0.03,
340
+ cacheWrite: 0,
341
+ },
342
+ "xai/grok-4.5": { input: 2, output: 6, cacheRead: 0.5, cacheWrite: 0 },
343
+ "xai/grok-4.6": {
344
+ input: 2,
345
+ output: 6,
346
+ cacheRead: 0.5,
347
+ cacheWrite: 0,
348
+ tiers: [
349
+ {
350
+ inputTokensAbove: 200_000,
351
+ input: 4,
352
+ output: 12,
353
+ cacheRead: 1,
354
+ cacheWrite: 0,
355
+ },
356
+ ],
357
+ },
358
+ // Post-promo list price; rates double above 200K.
359
+ "xai/grok-4.7": {
360
+ input: 2,
361
+ output: 6,
362
+ cacheRead: 0.5,
363
+ cacheWrite: 0,
364
+ tiers: [{ inputTokensAbove: 200_000, input: 4, output: 12, cacheRead: 1, cacheWrite: 0 }],
365
+ },
366
+ }
367
+
368
+ // No dated promotions are active. Add an entry here when the pricing page
369
+ // publishes a promotion end date, so tests fail when it needs review.
370
+ export const TEMPORARY_PRICING: readonly TemporaryPricing[] = []
@@ -0,0 +1,66 @@
1
+ import { getConfiguredApiKey } from "./api-key.ts"
2
+ import { pickCommandCodeApiKey } from "./converters.ts"
3
+ import { fetchCommandCodeQuota, redactValue } from "./quota.ts"
4
+ import { formatQuota } from "./quota-format.ts"
5
+
6
+ export interface QuotaCommandContext {
7
+ waitForIdle?: () => Promise<void>
8
+ modelRegistry?: {
9
+ getApiKeyForProvider?: (provider: string) => Promise<string | undefined>
10
+ }
11
+ ui: {
12
+ notify(message: string, type?: "info" | "warning" | "error"): void
13
+ }
14
+ }
15
+
16
+ interface QuotaCommandApi {
17
+ registerCommand(
18
+ name: string,
19
+ options: {
20
+ description: string
21
+ handler: (args: string, ctx: QuotaCommandContext) => Promise<void>
22
+ },
23
+ ): void
24
+ }
25
+
26
+ interface RegisterQuotaCommandOptions {
27
+ apiBase: string
28
+ headers?: Record<string, string>
29
+ getConfiguredKey?: () => string | undefined
30
+ fetchQuota?: typeof fetchCommandCodeQuota
31
+ }
32
+
33
+ export function registerCommandCodeQuota(
34
+ pi: QuotaCommandApi,
35
+ options: RegisterQuotaCommandOptions,
36
+ ): void {
37
+ const getConfiguredKey = options.getConfiguredKey ?? getConfiguredApiKey
38
+ const fetchQuota = options.fetchQuota ?? fetchCommandCodeQuota
39
+
40
+ pi.registerCommand("commandcode-quota", {
41
+ description: "Show Command Code account usage and quota",
42
+ handler: async (_args, ctx) => {
43
+ await ctx.waitForIdle?.()
44
+ const registryKey = await ctx.modelRegistry?.getApiKeyForProvider?.("commandcode")
45
+ const apiKey = pickCommandCodeApiKey(registryKey, getConfiguredKey())
46
+ if (!apiKey) {
47
+ ctx.ui.notify(
48
+ "Command Code quota requires an API key. Run /login and select Command Code, or set COMMAND_CODE_API_KEY.",
49
+ "warning",
50
+ )
51
+ return
52
+ }
53
+
54
+ const result = await fetchQuota({
55
+ apiKey,
56
+ baseUrl: options.apiBase,
57
+ extraHeaders: options.headers,
58
+ })
59
+ if (!result.ok) {
60
+ ctx.ui.notify(redactValue(result.error.message), "error")
61
+ return
62
+ }
63
+ ctx.ui.notify(formatQuota(result.quota), "info")
64
+ },
65
+ })
66
+ }
@@ -0,0 +1,143 @@
1
+ import type {
2
+ CommandCodeCredits,
3
+ CommandCodeQuota,
4
+ CommandCodeSubscription,
5
+ CommandCodeWindowLimit,
6
+ } from "./quota-types.ts"
7
+
8
+ export function formatWindowLimits(
9
+ limits: readonly CommandCodeWindowLimit[],
10
+ now: () => number = Date.now,
11
+ ): string[] {
12
+ const labels: Record<CommandCodeWindowLimit["window"], string> = {
13
+ fiveHour: "5-hour",
14
+ weekly: "Weekly",
15
+ }
16
+
17
+ return limits.map((limit) => {
18
+ const used = limit.used.toFixed(2)
19
+ const cap = limit.cap.toFixed(2)
20
+ const percent = limit.cap > 0 ? Math.round((limit.used / limit.cap) * 100) : 0
21
+ const reset = limit.resetAt === null ? "" : ` (resets ${formatResetClock(limit.resetAt, now)})`
22
+ return `${labels[limit.window]}: ${used} / ${cap} credits (${percent}% used)${reset}`
23
+ })
24
+ }
25
+
26
+ function formatResetClock(resetAtSeconds: number, now: () => number): string {
27
+ const date = new Date(resetAtSeconds * 1000)
28
+ if (Number.isNaN(date.getTime())) return "unknown"
29
+ const diffMs = date.getTime() - now()
30
+ if (diffMs <= 0) return "soon"
31
+ const minutes = Math.ceil(diffMs / 60_000)
32
+ if (minutes < 60) return `in ${minutes}m`
33
+ const hours = Math.floor(minutes / 60)
34
+ const remainingMinutes = minutes % 60
35
+ if (hours < 24) {
36
+ return remainingMinutes > 0 ? `in ${hours}h ${remainingMinutes}m` : `in ${hours}h`
37
+ }
38
+ const days = Math.floor(hours / 24)
39
+ return days === 1 ? "in 1 day" : `in ${days} days`
40
+ }
41
+
42
+ function creditsDetail(credits: CommandCodeCredits | null): string | undefined {
43
+ if (!credits) return undefined
44
+ const parts = [
45
+ `monthly $${credits.monthlyCredits.toFixed(2)}`,
46
+ `purchased $${credits.purchasedCredits.toFixed(2)}`,
47
+ ]
48
+ if (credits.freeCredits > 0) parts.push(`free $${credits.freeCredits.toFixed(2)}`)
49
+ return `Sources: ${parts.join(" / ")}`
50
+ }
51
+
52
+ function parsePeriodEnd(value: string): Date | null {
53
+ const trimmed = value.trim()
54
+ const timestamp = /^\d+$/.test(trimmed) ? Number(trimmed) : Date.parse(trimmed)
55
+ if (!Number.isFinite(timestamp) || timestamp < 0) return null
56
+ const milliseconds = timestamp >= 1e12 ? timestamp : timestamp * 1000
57
+ const date = new Date(milliseconds)
58
+ return Number.isNaN(date.getTime()) ? null : date
59
+ }
60
+
61
+ function subscriptionLine(
62
+ subscription: CommandCodeSubscription,
63
+ now: () => number = Date.now,
64
+ ): string {
65
+ const plan = (subscription.planId ?? "Unknown").replace(/[_-]+/g, " ").trim()
66
+ const status = subscription.status ? ` (${subscription.status})` : ""
67
+ let renewal = ""
68
+ if (subscription.currentPeriodEnd) {
69
+ const end = parsePeriodEnd(subscription.currentPeriodEnd)
70
+ if (end) {
71
+ const diffMs = end.getTime() - now()
72
+ const days = Math.ceil(diffMs / 86_400_000)
73
+ const dateStr = end.toLocaleDateString("en-US", {
74
+ month: "short",
75
+ day: "numeric",
76
+ timeZone: "UTC",
77
+ })
78
+ if (days > 0) {
79
+ renewal = ` · renews ${dateStr} (${days}d)`
80
+ } else if (days === 0) {
81
+ renewal = ` · renews ${dateStr} (today)`
82
+ } else {
83
+ renewal = ` · renewed ${dateStr}`
84
+ }
85
+ }
86
+ }
87
+ return `Plan: ${plan}${status}${renewal}`
88
+ }
89
+
90
+ function formatTokens(tokens: number): string {
91
+ if (tokens >= 1_000_000_000) return `${(tokens / 1_000_000_000).toFixed(1)}B`
92
+ if (tokens >= 1_000_000) return `${(tokens / 1_000_000).toFixed(1)}M`
93
+ if (tokens >= 1_000) return `${(tokens / 1_000).toFixed(1)}k`
94
+ return String(tokens)
95
+ }
96
+
97
+ export function formatQuota(quota: CommandCodeQuota, now: () => number = Date.now): string {
98
+ const lines: string[] = []
99
+ const remaining = quota.credits?.remainingCredits ?? 0
100
+ const spent = quota.summary?.totalCost ?? 0
101
+ const pool = remaining + spent
102
+
103
+ if (quota.credits || quota.summary) {
104
+ lines.push("Credits")
105
+ lines.push(` Remaining: $${remaining.toFixed(2)} of $${pool.toFixed(2)}`)
106
+ lines.push(` Used: $${spent.toFixed(2)}`)
107
+ lines.push(` ${pool > 0 ? Math.round((spent / pool) * 100) : 0}% used`)
108
+ }
109
+
110
+ const detail = creditsDetail(quota.credits)
111
+ if (detail) lines.push(detail)
112
+ if (quota.subscription) lines.push(subscriptionLine(quota.subscription, now))
113
+
114
+ if (quota.summary) {
115
+ lines.push("")
116
+ lines.push(quota.subscription?.currentPeriodStart ? "Usage (billing period)" : "Usage")
117
+ lines.push(` Cost: $${quota.summary.totalCost.toFixed(2)}`)
118
+ lines.push(` Requests: ${quota.summary.totalCount.toLocaleString("en-US")}`)
119
+ if (quota.summary.totalTokens !== undefined) {
120
+ lines.push(` Tokens: ${formatTokens(quota.summary.totalTokens)}`)
121
+ }
122
+ }
123
+
124
+ lines.push("")
125
+ lines.push("Account")
126
+ lines.push(` ${quota.account.keyName ?? quota.account.login}`)
127
+
128
+ const limits = quota.credits?.windowLimits ?? []
129
+ if (limits.length > 0) {
130
+ lines.push("")
131
+ lines.push("Usage windows:")
132
+ lines.push(...formatWindowLimits(limits, now).map((line) => ` ${line}`))
133
+ }
134
+
135
+ if ((quota.unavailable?.length ?? 0) > 0) {
136
+ lines.push("")
137
+ lines.push(`Unavailable: ${quota.unavailable?.join(", ")}`)
138
+ }
139
+
140
+ lines.push("")
141
+ lines.push("Full detail: https://commandcode.ai/usage")
142
+ return lines.join("\n")
143
+ }
@@ -0,0 +1,47 @@
1
+ export interface CommandCodeWindowLimit {
2
+ window: "fiveHour" | "weekly"
3
+ used: number
4
+ cap: number
5
+ resetAt: number | null
6
+ }
7
+
8
+ export interface CommandCodeCredits {
9
+ monthlyCredits: number
10
+ purchasedCredits: number
11
+ freeCredits: number
12
+ remainingCredits: number
13
+ windowLimits: CommandCodeWindowLimit[]
14
+ }
15
+
16
+ export interface CommandCodeSubscription {
17
+ planId: string | null
18
+ status: string | null
19
+ currentPeriodStart: string | null
20
+ currentPeriodEnd: string | null
21
+ }
22
+
23
+ export interface CommandCodeUsageSummary {
24
+ totalCost: number
25
+ totalCount: number
26
+ totalTokens?: number
27
+ }
28
+
29
+ export type CommandCodeQuotaSection = "credits" | "subscription" | "usage"
30
+
31
+ export interface CommandCodeQuota {
32
+ account: {
33
+ login: string
34
+ orgId: string | null
35
+ keyName?: string
36
+ }
37
+ credits: CommandCodeCredits | null
38
+ subscription: CommandCodeSubscription | null
39
+ summary: CommandCodeUsageSummary | null
40
+ unavailable?: readonly CommandCodeQuotaSection[]
41
+ }
42
+
43
+ export type CommandCodeQuotaErrorKind = "config" | "http" | "network" | "timeout"
44
+
45
+ export type CommandCodeQuotaResult =
46
+ | { ok: true; quota: CommandCodeQuota }
47
+ | { ok: false; error: { message: string; kind: CommandCodeQuotaErrorKind } }