@herbertgao/pi-extensions 2026.11.3 → 2026.11.4

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 (203) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +7 -7
  3. package/THIRD_PARTY_NOTICES.md +2 -2
  4. package/node_modules/@herbertgao/pi-cc-extensions/CHANGELOG.md +6 -0
  5. package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +2 -2
  6. package/node_modules/@herbertgao/pi-cc-extensions/README.md +2 -2
  7. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +33 -5
  8. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/ccstyle-tool.ts +72 -17
  9. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +10 -2
  10. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/tool-io.ts +16 -7
  11. package/node_modules/@herbertgao/pi-cc-extensions/package.json +7 -5
  12. package/node_modules/@herbertgao/pi-cc-extensions/themes/cc-dark-hc.json +92 -0
  13. package/node_modules/@herbertgao/pi-cc-extensions/themes/cc-light-hc.json +92 -0
  14. package/node_modules/pi-commandcode-provider/CHANGELOG.md +27 -0
  15. package/node_modules/pi-commandcode-provider/CONTRIBUTING.md +64 -5
  16. package/node_modules/pi-commandcode-provider/README.md +40 -26
  17. package/node_modules/pi-commandcode-provider/RELEASE.md +25 -0
  18. package/node_modules/pi-commandcode-provider/index.ts +212 -38
  19. package/node_modules/pi-commandcode-provider/package.json +9 -8
  20. package/node_modules/pi-commandcode-provider/scripts/live-e2e-profile.mjs +6 -13
  21. package/node_modules/pi-commandcode-provider/scripts/typecheck-entrypoint.mjs +88 -0
  22. package/node_modules/pi-commandcode-provider/src/api-key.ts +43 -2
  23. package/node_modules/pi-commandcode-provider/src/commandcode-catalog-overrides.ts +1 -1
  24. package/node_modules/pi-commandcode-provider/src/commandcode-catalog.ts +9 -2
  25. package/node_modules/pi-commandcode-provider/src/cost.ts +3 -37
  26. package/node_modules/pi-commandcode-provider/src/diagnostics.ts +215 -0
  27. package/node_modules/pi-commandcode-provider/src/oauth.ts +1 -1
  28. package/node_modules/pi-commandcode-provider/src/quota-command.ts +1 -1
  29. package/node_modules/pi-commandcode-provider/src/routing.ts +166 -0
  30. package/node_modules/pi-commandcode-provider/src/runtime.ts +15 -9
  31. package/node_modules/pi-commandcode-provider/src/transport.ts +79 -85
  32. package/node_modules/pi-commandcode-provider/src/types.ts +20 -39
  33. package/node_modules/pi-commandcode-provider/src/usage.ts +1 -1
  34. package/node_modules/pi-lens/CHANGELOG-USER.md +31 -0
  35. package/node_modules/pi-lens/CHANGELOG.md +178 -0
  36. package/node_modules/pi-lens/README.md +2 -1
  37. package/node_modules/pi-lens/config/dependency-cruiser-eager-allowlist.json +1 -1
  38. package/node_modules/pi-lens/dist/{chunk-3O5EII3W.js → chunk-2VZ3VN3N.js} +2 -2
  39. package/node_modules/pi-lens/dist/{chunk-SDFKOLSF.js → chunk-3HTZDY3C.js} +8 -6
  40. package/node_modules/pi-lens/dist/{chunk-A5GRLYPZ.js → chunk-3NPWO5UO.js} +7 -13
  41. package/node_modules/pi-lens/dist/{chunk-AGGUWKRK.js → chunk-47UCC4MM.js} +1 -1
  42. package/node_modules/pi-lens/dist/chunk-4ENEJHF4.js +198 -0
  43. package/node_modules/pi-lens/dist/{chunk-WXUDRAG6.js → chunk-5GEYJJHG.js} +10 -12
  44. package/node_modules/pi-lens/dist/{chunk-HHR7WGCI.js → chunk-5YSEQHJN.js} +3 -3
  45. package/node_modules/pi-lens/dist/{chunk-L3CLUGDY.js → chunk-6GPB3JLL.js} +3 -3
  46. package/node_modules/pi-lens/dist/{chunk-5F3XF3SX.js → chunk-7R5GZIA6.js} +6 -6
  47. package/node_modules/pi-lens/dist/{chunk-CUDD35TW.js → chunk-7UTSNTWM.js} +4 -4
  48. package/node_modules/pi-lens/dist/{chunk-DYRZGUMA.js → chunk-7YTRG6YW.js} +2 -2
  49. package/node_modules/pi-lens/dist/{chunk-JZRP4DGP.js → chunk-AACN5GNE.js} +2 -2
  50. package/node_modules/pi-lens/dist/{chunk-7ANZ7XDD.js → chunk-ACRJ2GZ5.js} +2 -2
  51. package/node_modules/pi-lens/dist/{chunk-6FIRFP6A.js → chunk-C3YRO3EU.js} +10 -12
  52. package/node_modules/pi-lens/dist/{chunk-GMROJJRN.js → chunk-CB7PEVOJ.js} +9 -1
  53. package/node_modules/pi-lens/dist/{chunk-BBET6HD6.js → chunk-CDFJF5YD.js} +1 -1
  54. package/node_modules/pi-lens/dist/{chunk-NSPVR3FN.js → chunk-CJS6WE66.js} +17 -19
  55. package/node_modules/pi-lens/dist/{chunk-6YUNI7B5.js → chunk-CM6BDY4E.js} +14 -60
  56. package/node_modules/pi-lens/dist/{chunk-G5GV2Q7K.js → chunk-CZCAZVTD.js} +16 -2
  57. package/node_modules/pi-lens/dist/chunk-DGKFWQK4.js +23 -0
  58. package/node_modules/pi-lens/dist/{chunk-VOP4PJKA.js → chunk-E65WJVI5.js} +7 -9
  59. package/node_modules/pi-lens/dist/{chunk-TV6RXRYH.js → chunk-EKNYSXFB.js} +8 -10
  60. package/node_modules/pi-lens/dist/{chunk-4LL2VRNY.js → chunk-EY6LY2HO.js} +16 -18
  61. package/node_modules/pi-lens/dist/{chunk-MC6VB2E5.js → chunk-F6BEQWAK.js} +17 -5
  62. package/node_modules/pi-lens/dist/{chunk-R2QQC33W.js → chunk-FGNSESAC.js} +12 -14
  63. package/node_modules/pi-lens/dist/{chunk-OC7VWJBZ.js → chunk-FRUBVFXV.js} +35 -37
  64. package/node_modules/pi-lens/dist/{chunk-7CGIDRIK.js → chunk-G22UNQID.js} +14 -16
  65. package/node_modules/pi-lens/dist/{chunk-L4NEVZ4T.js → chunk-GQTQUNCG.js} +25 -27
  66. package/node_modules/pi-lens/dist/{chunk-ZKLTNLAW.js → chunk-H3BVMK47.js} +6 -6
  67. package/node_modules/pi-lens/dist/chunk-H6FLQ5NW.js +28 -0
  68. package/node_modules/pi-lens/dist/{chunk-2ZE3AUJQ.js → chunk-HEA3EM23.js} +13 -15
  69. package/node_modules/pi-lens/dist/{chunk-CZL44WFN.js → chunk-HSOBIN22.js} +2 -2
  70. package/node_modules/pi-lens/dist/{chunk-PKSUMEPT.js → chunk-HYSKJMZK.js} +3 -3
  71. package/node_modules/pi-lens/dist/{chunk-VN3L2JWZ.js → chunk-IICERRFF.js} +5 -5
  72. package/node_modules/pi-lens/dist/{chunk-O4N5BQ3T.js → chunk-IILEH3ZC.js} +8 -10
  73. package/node_modules/pi-lens/dist/{chunk-WC6WRNQT.js → chunk-J3Q2NYJR.js} +2 -2
  74. package/node_modules/pi-lens/dist/{chunk-SFLHSL5R.js → chunk-JUZ67QZQ.js} +18 -7
  75. package/node_modules/pi-lens/dist/chunk-KR5VGMVT.js +25 -0
  76. package/node_modules/pi-lens/dist/{chunk-UHHLR2VY.js → chunk-KV6GQOGN.js} +38 -41
  77. package/node_modules/pi-lens/dist/{chunk-HUAM7QG3.js → chunk-KXMJLOZF.js} +25 -23
  78. package/node_modules/pi-lens/dist/{chunk-BUZIQDFS.js → chunk-L4Y3ROKQ.js} +3 -3
  79. package/node_modules/pi-lens/dist/{chunk-JBP7KESM.js → chunk-L6WBJGQS.js} +1 -1
  80. package/node_modules/pi-lens/dist/{chunk-35WKJWO5.js → chunk-L7O774U7.js} +14 -14
  81. package/node_modules/pi-lens/dist/{chunk-BOPDQ7AZ.js → chunk-LAHHGNAY.js} +19 -21
  82. package/node_modules/pi-lens/dist/{chunk-RGGH6M34.js → chunk-LT62P654.js} +1 -1
  83. package/node_modules/pi-lens/dist/{chunk-5T5A6YAJ.js → chunk-LWOM6LVS.js} +33 -34
  84. package/node_modules/pi-lens/dist/{chunk-JYLOYTZD.js → chunk-MKPDIAZH.js} +5 -1
  85. package/node_modules/pi-lens/dist/{chunk-CM73PPGD.js → chunk-MN635QYA.js} +3 -4
  86. package/node_modules/pi-lens/dist/{chunk-BQG2QFVO.js → chunk-MQ4PPCJB.js} +21 -29
  87. package/node_modules/pi-lens/dist/{chunk-HXFUTMX2.js → chunk-MRLH4MYU.js} +2 -2
  88. package/node_modules/pi-lens/dist/{chunk-XOMGO63G.js → chunk-N56BNAA6.js} +19 -21
  89. package/node_modules/pi-lens/dist/{chunk-7MAD5ZAY.js → chunk-N5CEGQPG.js} +14 -16
  90. package/node_modules/pi-lens/dist/{chunk-ZFORSIED.js → chunk-NCLO6E6N.js} +13 -33
  91. package/node_modules/pi-lens/dist/{chunk-SQC7K3SP.js → chunk-NL5LSKVD.js} +2 -2
  92. package/node_modules/pi-lens/dist/{chunk-I22THIHI.js → chunk-NMUSOZ2D.js} +10 -12
  93. package/node_modules/pi-lens/dist/{chunk-4NBWFYWW.js → chunk-NOWH2VA2.js} +8 -33
  94. package/node_modules/pi-lens/dist/{chunk-NM2NWH55.js → chunk-NUSXS6YB.js} +6 -5
  95. package/node_modules/pi-lens/dist/{chunk-OZWXLJMX.js → chunk-OSEKJEUU.js} +2 -2
  96. package/node_modules/pi-lens/dist/{chunk-2BKUFQKR.js → chunk-OUYAUXAT.js} +405 -181
  97. package/node_modules/pi-lens/dist/{chunk-JPRDTY5S.js → chunk-PBZNYHMM.js} +8 -10
  98. package/node_modules/pi-lens/dist/{chunk-JE6HKLC7.js → chunk-PIIUNJIT.js} +2 -4
  99. package/node_modules/pi-lens/dist/{chunk-ZZDIOAAJ.js → chunk-PRHYIA6X.js} +6 -6
  100. package/node_modules/pi-lens/dist/{chunk-4W52ZKZX.js → chunk-PXQ45SGD.js} +2 -2
  101. package/node_modules/pi-lens/dist/chunk-Q6JQKWPK.js +25 -0
  102. package/node_modules/pi-lens/dist/{chunk-PIQQM32Y.js → chunk-QB7T2PHK.js} +2 -2
  103. package/node_modules/pi-lens/dist/{chunk-HKIL6DCL.js → chunk-QGITU23N.js} +1 -1
  104. package/node_modules/pi-lens/dist/chunk-QJJKOHLH.js +57 -0
  105. package/node_modules/pi-lens/dist/{chunk-6LJOJ6EO.js → chunk-QP33NKYC.js} +14 -16
  106. package/node_modules/pi-lens/dist/{chunk-DIWK3LBC.js → chunk-QVBOXT3L.js} +8 -10
  107. package/node_modules/pi-lens/dist/{chunk-IYVYZQRL.js → chunk-RNJFRXEN.js} +5 -7
  108. package/node_modules/pi-lens/dist/{chunk-G6JKM4O7.js → chunk-RNXOWDM6.js} +10 -10
  109. package/node_modules/pi-lens/dist/{chunk-5RNB4HVK.js → chunk-RTFMDIKV.js} +1 -1
  110. package/node_modules/pi-lens/dist/{chunk-XWIME22V.js → chunk-SIQHOB6P.js} +11 -13
  111. package/node_modules/pi-lens/dist/{chunk-T2S3FNNJ.js → chunk-SLSMJPEF.js} +41 -42
  112. package/node_modules/pi-lens/dist/chunk-T5QSLSMM.js +50 -0
  113. package/node_modules/pi-lens/dist/chunk-TGQDAG4B.js +88 -0
  114. package/node_modules/pi-lens/dist/{chunk-6GMGEKQN.js → chunk-THYHUIDR.js} +39 -12
  115. package/node_modules/pi-lens/dist/{chunk-WMDUT4KH.js → chunk-TMNUTMT5.js} +72 -89
  116. package/node_modules/pi-lens/dist/{chunk-7TNILKGY.js → chunk-TOE2RRCS.js} +1 -1
  117. package/node_modules/pi-lens/dist/chunk-TYHPVE5H.js +25 -0
  118. package/node_modules/pi-lens/dist/chunk-UAKO2M6B.js +73 -0
  119. package/node_modules/pi-lens/dist/chunk-UC5AXW5Z.js +20 -0
  120. package/node_modules/pi-lens/dist/chunk-UTJP6WOS.js +28 -0
  121. package/node_modules/pi-lens/dist/{chunk-FRLAUP2B.js → chunk-UXTQ3QPD.js} +4 -4
  122. package/node_modules/pi-lens/dist/{chunk-4QG55RRC.js → chunk-V2WDBOLZ.js} +10 -12
  123. package/node_modules/pi-lens/dist/{chunk-FHEV6T4L.js → chunk-V67D6TMU.js} +8 -10
  124. package/node_modules/pi-lens/dist/{chunk-VLQ7UKZH.js → chunk-VCRVNLE7.js} +135 -2
  125. package/node_modules/pi-lens/dist/{chunk-KZ4ALBCH.js → chunk-VO4JFPTV.js} +2 -2
  126. package/node_modules/pi-lens/dist/{chunk-GIRBSBGL.js → chunk-VWLSU3XV.js} +3 -3
  127. package/node_modules/pi-lens/dist/{chunk-2453RRJ2.js → chunk-W5E72HJA.js} +59 -22
  128. package/node_modules/pi-lens/dist/{chunk-VPLBLWFO.js → chunk-W7TY6HYX.js} +1 -1
  129. package/node_modules/pi-lens/dist/{chunk-SP4TFY5F.js → chunk-WSSLVMDA.js} +11 -13
  130. package/node_modules/pi-lens/dist/{chunk-PPKECBPP.js → chunk-WTB4GKMH.js} +10 -1
  131. package/node_modules/pi-lens/dist/{chunk-X35S7HSB.js → chunk-X5BJ3G2P.js} +41 -30
  132. package/node_modules/pi-lens/dist/{chunk-X66YJ2SS.js → chunk-XKFO2SZV.js} +33 -34
  133. package/node_modules/pi-lens/dist/{chunk-OWTG6UMO.js → chunk-XLAI7UYY.js} +75 -22
  134. package/node_modules/pi-lens/dist/{chunk-4B2YFN4U.js → chunk-XO756WE5.js} +45 -33
  135. package/node_modules/pi-lens/dist/{chunk-VOXTCULR.js → chunk-XVB3Q2PG.js} +2 -4
  136. package/node_modules/pi-lens/dist/{chunk-XYLC35E4.js → chunk-YOXCCJDF.js} +517 -308
  137. package/node_modules/pi-lens/dist/{chunk-O2ARHQKF.js → chunk-ZCQBNPRH.js} +2 -2
  138. package/node_modules/pi-lens/dist/chunk-ZD4KVFXI.js +234 -0
  139. package/node_modules/pi-lens/dist/{chunk-LSFXZLPW.js → chunk-ZDMFGACN.js} +184 -235
  140. package/node_modules/pi-lens/dist/{chunk-4BKU7PV3.js → chunk-ZMMHHXSW.js} +1 -1
  141. package/node_modules/pi-lens/dist/{chunk-OY7WZI7Q.js → chunk-ZPM7ZIFL.js} +6 -6
  142. package/node_modules/pi-lens/dist/{chunk-R4QWJQ2H.js → chunk-ZVCDHYWZ.js} +9 -11
  143. package/node_modules/pi-lens/dist/{chunk-RZG472YW.js → chunk-ZZN74OGD.js} +83 -46
  144. package/node_modules/pi-lens/dist/{chunk-BHWW6FAX.js → chunk-ZZSJAR76.js} +37 -19
  145. package/node_modules/pi-lens/dist/index.js +4910 -4218
  146. package/node_modules/pi-lens/dist/mcp/analyze-cli.js +12 -17
  147. package/node_modules/pi-lens/dist/mcp/cli.js +41 -42
  148. package/node_modules/pi-lens/dist/mcp/server.js +1451 -648
  149. package/node_modules/pi-lens/dist/mcp/worker.js +59 -60
  150. package/node_modules/pi-lens/dist/probes/installer.js +17 -19
  151. package/node_modules/pi-lens/docs/agent-tools.md +40 -8
  152. package/node_modules/pi-lens/docs/analysisall.md +1 -1
  153. package/node_modules/pi-lens/docs/ci-bot-pr-checks.md +7 -5
  154. package/node_modules/pi-lens/docs/configuration.md +51 -9
  155. package/node_modules/pi-lens/docs/defect-shapes.md +52 -3
  156. package/node_modules/pi-lens/docs/environment-variables.md +18 -1
  157. package/node_modules/pi-lens/docs/features.md +12 -5
  158. package/node_modules/pi-lens/docs/globalconfig.md +11 -3
  159. package/node_modules/pi-lens/docs/invariants/lsp-trust-exec.md +9 -2
  160. package/node_modules/pi-lens/docs/invariants/session-telemetry.md +2 -2
  161. package/node_modules/pi-lens/docs/language-coverage.md +1 -0
  162. package/node_modules/pi-lens/docs/lsp-capability-matrix.md +57 -35
  163. package/node_modules/pi-lens/docs/lsp-idle-eviction.md +4 -1
  164. package/node_modules/pi-lens/docs/merge-queue-rollout.md +10 -8
  165. package/node_modules/pi-lens/docs/module-report-read-symbol.md +34 -23
  166. package/node_modules/pi-lens/docs/pi-lens-fixer.md +11 -1
  167. package/node_modules/pi-lens/docs/pi-lens-investigator.md +3 -0
  168. package/node_modules/pi-lens/docs/pi-lens-merge-policy.md +15 -7
  169. package/node_modules/pi-lens/docs/pi-lens-reviewer.md +1 -1
  170. package/node_modules/pi-lens/docs/pi-lens-subagent.md +13 -0
  171. package/node_modules/pi-lens/docs/public-api-stability.md +39 -5
  172. package/node_modules/pi-lens/docs/release-qa-baseline.md +7 -4
  173. package/node_modules/pi-lens/docs/schema/pi-lens-config-v1.json +11 -2
  174. package/node_modules/pi-lens/docs/servercapabilities.md +3 -1
  175. package/node_modules/pi-lens/docs/settings.md +2 -2
  176. package/node_modules/pi-lens/docs/word-index.md +3 -2
  177. package/node_modules/pi-lens/package.json +8 -3
  178. package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-sql-in-code-execute-js.yml +1 -2
  179. package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-sql-in-code-execute.yml +1 -2
  180. package/node_modules/pi-lens/scripts/download-grammars.js +3 -2
  181. package/node_modules/pi-lens/skills/pi-lens-lsp-navigation/SKILL.md +5 -1
  182. package/node_modules/pi-provider-qoder/dist/index.js +473 -62
  183. package/node_modules/pi-provider-qoder/package.json +1 -1
  184. package/package.json +10 -8
  185. package/node_modules/pi-commandcode-provider/src/converters.ts +0 -419
  186. package/node_modules/pi-commandcode-provider/src/core.ts +0 -861
  187. package/node_modules/pi-commandcode-provider/src/json-schema.ts +0 -417
  188. package/node_modules/pi-commandcode-provider/src/transcript.ts +0 -56
  189. package/node_modules/pi-lens/dist/chunk-2TS4GLOJ.js +0 -31
  190. package/node_modules/pi-lens/dist/chunk-3JAHQBSY.js +0 -27
  191. package/node_modules/pi-lens/dist/chunk-447YZL4S.js +0 -25
  192. package/node_modules/pi-lens/dist/chunk-565VRUP4.js +0 -136
  193. package/node_modules/pi-lens/dist/chunk-57X2CDRX.js +0 -49
  194. package/node_modules/pi-lens/dist/chunk-GGYOZWHW.js +0 -27
  195. package/node_modules/pi-lens/dist/chunk-IE5D3RA5.js +0 -58
  196. package/node_modules/pi-lens/dist/chunk-LPYTPNOJ.js +0 -22
  197. package/node_modules/pi-lens/dist/chunk-OFNMHPBT.js +0 -89
  198. package/node_modules/pi-lens/dist/chunk-U3AS2FR6.js +0 -106
  199. package/node_modules/pi-lens/dist/chunk-W3BGKBBK.js +0 -27
  200. package/node_modules/pi-lens/dist/chunk-WQV6BI4Q.js +0 -48
  201. package/node_modules/pi-lens/dist/chunk-YHGYAEFH.js +0 -443
  202. package/node_modules/pi-lens/dist/chunk-ZONZ6YY3.js +0 -74
  203. package/node_modules/pi-lens/dist/chunk-ZSM35JF4.js +0 -30
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-provider-qoder",
3
- "version": "0.6.10",
3
+ "version": "0.6.12",
4
4
  "description": "Pi extension for Qoder AI — with OAuth authentication, COSY signatures and WAF bypass",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@herbertgao/pi-extensions",
3
- "version": "2026.11.3",
3
+ "version": "2026.11.4",
4
4
  "description": "Aggregate installer for HerbertGao-maintained Pi extensions.",
5
5
  "keywords": [
6
6
  "extensions",
@@ -41,7 +41,7 @@
41
41
  "@dietrichgebert/ponytail": "5.3.3",
42
42
  "@herbertgao/pi-agency": "0.1.3",
43
43
  "@herbertgao/pi-bark": "0.2.2",
44
- "@herbertgao/pi-cc-extensions": "1.0.14-local.1",
44
+ "@herbertgao/pi-cc-extensions": "1.0.15-local.1",
45
45
  "@herbertgao/pi-impeccable": "0.1.1",
46
46
  "@herbertgao/pi-subagents": "0.23.1-local.1",
47
47
  "@herbertgao/sol-pi": "0.4.3",
@@ -69,14 +69,14 @@
69
69
  "jiti": "^2.7.0",
70
70
  "js-yaml": "^5.2.2",
71
71
  "linkedom": "^0.16.0",
72
- "minimatch": "^11.0.1",
72
+ "minimatch": "^11.0.4",
73
73
  "nanoid": "^5.0.0",
74
74
  "p-limit": "^6.1.0",
75
75
  "pi-antigravity": "0.11.0",
76
- "pi-commandcode-provider": "0.7.12",
77
- "pi-lens": "4.4.8",
76
+ "pi-commandcode-provider": "0.8.0",
77
+ "pi-lens": "4.4.9",
78
78
  "pi-next-cue": "1.0.8",
79
- "pi-provider-qoder": "0.6.10",
79
+ "pi-provider-qoder": "0.6.12",
80
80
  "pi-typesafe": "0.14.0",
81
81
  "pi-web-access": "0.47.0",
82
82
  "pidusage": "^4.0.1",
@@ -85,7 +85,7 @@
85
85
  "unbash": "4.0.10",
86
86
  "undici": "^8.11.2",
87
87
  "unpdf": "^1.6.2",
88
- "vscode-jsonrpc": "^9.0.0",
88
+ "vscode-jsonrpc": "^10.0.0",
89
89
  "ws": "^8.21.0",
90
90
  "zod": "^3.25.0 || ^4.0.0"
91
91
  },
@@ -162,7 +162,9 @@
162
162
  ],
163
163
  "themes": [
164
164
  "./node_modules/@herbertgao/pi-cc-extensions/themes/cc-dark.json",
165
- "./node_modules/@herbertgao/pi-cc-extensions/themes/cc-light.json"
165
+ "./node_modules/@herbertgao/pi-cc-extensions/themes/cc-light.json",
166
+ "./node_modules/@herbertgao/pi-cc-extensions/themes/cc-dark-hc.json",
167
+ "./node_modules/@herbertgao/pi-cc-extensions/themes/cc-light-hc.json"
166
168
  ],
167
169
  "skills": [
168
170
  "./node_modules/@dietrichgebert/ponytail/skills",
@@ -1,419 +0,0 @@
1
- import { createHash } from "node:crypto"
2
-
3
- import type { MessageLike, StopReason, ToolLike } from "./types.ts"
4
- import { geminiSafeJsonSchema, toJsonSchema } from "./json-schema.ts"
5
-
6
- export { toJsonSchema } from "./json-schema.ts"
7
- // The generate transport reads ambient credentials through the same reader
8
- // as the Provider API path and the quota commands (README "Auth file" order).
9
- export { getConfiguredApiKey as getApiKey } from "./api-key.ts"
10
-
11
- export function isRecord(value: unknown): value is Record<string, unknown> {
12
- return typeof value === "object" && value !== null && !Array.isArray(value)
13
- }
14
-
15
- export function stringValue(value: unknown): string | undefined {
16
- return typeof value === "string" ? value : undefined
17
- }
18
-
19
- export function recordArray(value: unknown): readonly Record<string, unknown>[] {
20
- if (!Array.isArray(value)) return []
21
- return value.filter(isRecord)
22
- }
23
-
24
- export function recordOrEmpty(value: unknown): Record<string, unknown> {
25
- if (isRecord(value)) return value
26
- if (typeof value === "string") {
27
- try {
28
- const parsed: unknown = JSON.parse(value)
29
- if (isRecord(parsed)) return parsed
30
- } catch {
31
- // Some providers stream incomplete JSON argument fragments.
32
- }
33
- }
34
- return {}
35
- }
36
-
37
- export function numberValue(value: unknown): number | undefined {
38
- return typeof value === "number" && Number.isFinite(value) ? value : undefined
39
- }
40
-
41
- function imageParts(value: unknown): readonly Record<string, unknown>[] {
42
- if (isRecord(value)) return value.type === "image" ? [value] : []
43
- return recordArray(value).filter((part) => part.type === "image")
44
- }
45
-
46
- function imageContentError(role: string): Error {
47
- return new Error(`Selected Command Code model does not support image content in ${role}`)
48
- }
49
-
50
- export function assertTextOnlyMessages(messages?: readonly MessageLike[]): void {
51
- for (const message of messages ?? []) {
52
- if (message.role !== "toolResult" && imageParts(message.content).length > 0) {
53
- throw imageContentError(`${message.role} messages`)
54
- }
55
- }
56
- }
57
-
58
- function imageToCommandCode(part: Record<string, unknown>): Record<string, string> {
59
- const data = stringValue(part.data)
60
- const mimeType = stringValue(part.mimeType)
61
- if (!data || !mimeType)
62
- throw new Error("Invalid image content: expected base64 data and mimeType")
63
-
64
- return {
65
- type: "image",
66
- image: `data:${mimeType};base64,${data}`,
67
- mimeType,
68
- }
69
- }
70
-
71
- function userContentToCommandCode(content: unknown, allowImages: boolean): unknown {
72
- if (typeof content === "string") return content
73
-
74
- return recordArray(content).flatMap((part) => {
75
- if (part.type === "text") return [{ type: "text", text: stringValue(part.text) ?? "" }]
76
- if (part.type === "image") {
77
- if (!allowImages) throw imageContentError("user messages")
78
- return [imageToCommandCode(part)]
79
- }
80
- return []
81
- })
82
- }
83
-
84
- // Hosts such as OMP may pass a literal env-var name as the "resolved" registry
85
- // key instead of the actual credential. Treat those as unresolved.
86
- export const COMMAND_CODE_PLACEHOLDER_KEYS = new Set([
87
- "$COMMAND_CODE_API_KEY",
88
- "COMMAND_CODE_API_KEY",
89
- "$COMMANDCODE_API_KEY",
90
- "COMMANDCODE_API_KEY",
91
- ])
92
-
93
- function usableCommandCodeApiKey(value: string | undefined): string | undefined {
94
- const trimmed = typeof value === "string" ? value.trim() : undefined
95
- if (!trimmed) return undefined
96
- if (COMMAND_CODE_PLACEHOLDER_KEYS.has(trimmed)) return undefined
97
- return trimmed
98
- }
99
-
100
- /**
101
- * Pick the real API key from a host registry value and/or the env/auth-file
102
- * fallback, never returning a literal placeholder or an empty/whitespace value.
103
- * Pure/testable.
104
- */
105
- export function pickCommandCodeApiKey(
106
- registryKey: string | undefined,
107
- hostKey: string | undefined,
108
- ): string | undefined {
109
- return usableCommandCodeApiKey(registryKey) ?? usableCommandCodeApiKey(hostKey)
110
- }
111
-
112
- /**
113
- * Replace a host-supplied placeholder (or missing key) with the configured
114
- * fallback. Used for both registerProvider and the Provider API stream path.
115
- */
116
- export function withResolvedCommandCodeApiKey<T extends { apiKey?: string }>(
117
- options: T | undefined,
118
- configuredKey: string | undefined,
119
- ): T | { apiKey?: string } {
120
- const apiKey = pickCommandCodeApiKey(options?.apiKey, configuredKey)
121
- if (options && apiKey === options.apiKey) return options
122
- return { ...options, apiKey }
123
- }
124
-
125
- export function textContent(message: { content?: unknown }): string {
126
- if (typeof message.content === "string") return message.content
127
- if (message.content === null || message.content === undefined) return ""
128
- if (!Array.isArray(message.content)) {
129
- try {
130
- return JSON.stringify(message.content) ?? String(message.content)
131
- } catch {
132
- return String(message.content)
133
- }
134
- }
135
-
136
- return recordArray(message.content)
137
- .filter((part) => part.type === "text")
138
- .map((part) => stringValue(part.text) ?? "")
139
- .join("\n")
140
- }
141
-
142
- export function getEnvironmentInfo(): string {
143
- return `${process.platform}-${process.arch}, Node.js ${process.version}`
144
- }
145
-
146
- export function toolsToJson(tools?: readonly ToolLike[], modelId?: string): unknown[] {
147
- if (!tools) return []
148
- const geminiSafe = modelId !== undefined && modelId.startsWith("google/gemini-")
149
- return tools.map((tool) => {
150
- const schema = tool.parameters ? toJsonSchema(tool.parameters) : {}
151
- return {
152
- type: "function",
153
- name: tool.name,
154
- description: tool.description,
155
- input_schema: geminiSafe ? geminiSafeJsonSchema(schema) : schema,
156
- }
157
- })
158
- }
159
-
160
- interface ToolCallState {
161
- callIds: ReadonlySet<string>
162
- resultIds: ReadonlySet<string>
163
- }
164
-
165
- /**
166
- * Bound for tool-call ids on the `/alpha/generate` wire (#141).
167
- *
168
- * Hosts store Responses tool-call ids compounded as `<call_id>|<item_id>`
169
- * (73 characters for the observed `call_<32hex>|fc_<32hex>` shape). The
170
- * generate backend rejects `call_id` values longer than 64 characters with
171
- * `400 input[N].call_id`, so compound ids must be shortened before sending.
172
- * The mapping is deterministic per request and shared by calls and results,
173
- * so pairing is preserved and distinct ids never collide.
174
- */
175
- const GENERATE_TOOL_CALL_ID_LIMIT = 64
176
-
177
- function generateToolCallIdHash(value: string): string {
178
- return createHash("sha256").update(value, "utf8").digest("hex").slice(0, 8)
179
- }
180
-
181
- function shortenGenerateToolCallId(value: string): string {
182
- if (value.length <= GENERATE_TOOL_CALL_ID_LIMIT) return value
183
- const suffix = generateToolCallIdHash(value)
184
- const head = value.replace(/[^a-zA-Z0-9_-]/g, "_").replace(/_+$/, "")
185
- const keep = GENERATE_TOOL_CALL_ID_LIMIT - suffix.length - 1
186
- const truncated = head.slice(0, Math.max(0, keep)).replace(/_+$/, "")
187
- // Fall back to the raw hash when sanitizing leaves nothing usable.
188
- return truncated ? `${truncated}_${suffix}` : suffix
189
- }
190
-
191
- /**
192
- * Map every tool-call id referenced in this request to its generate-wire
193
- * form. Short ids are reserved first and pass through unchanged; overlong
194
- * ids are shortened deterministically, and on collision receive the next
195
- * free `_<hash>` suffix so every distinct id still maps to a distinct value.
196
- */
197
- function generateToolCallIdMap(messages?: readonly MessageLike[]): Map<string, string> {
198
- const referenced = new Set<string>()
199
- for (const message of messages ?? []) {
200
- if (message.role === "assistant") {
201
- for (const content of recordArray(message.content)) {
202
- if (content.type === "toolCall") {
203
- const id = stringValue(content.id)
204
- if (id) referenced.add(id)
205
- }
206
- }
207
- } else if (message.role === "toolResult" && message.toolCallId) {
208
- referenced.add(message.toolCallId)
209
- }
210
- }
211
-
212
- const used = new Set<string>()
213
- const mapped = new Map<string, string>()
214
- // Reserve existing short ids before any long id can claim their wire value.
215
- for (const id of referenced) {
216
- if (id.length <= GENERATE_TOOL_CALL_ID_LIMIT) {
217
- mapped.set(id, id)
218
- used.add(id)
219
- }
220
- }
221
- for (const id of referenced) {
222
- if (mapped.has(id)) continue
223
- let candidate = shortenGenerateToolCallId(id)
224
- if (used.has(candidate)) {
225
- const base = candidate.replace(/_+$/, "")
226
- let attempt = 0
227
- do {
228
- const suffix = generateToolCallIdHash(`${id}#${attempt}`)
229
- const keep = GENERATE_TOOL_CALL_ID_LIMIT - suffix.length - 1
230
- const head = base.slice(0, Math.max(0, keep)).replace(/_+$/, "")
231
- candidate = head ? `${head}_${suffix}` : suffix
232
- attempt += 1
233
- } while (used.has(candidate))
234
- }
235
- mapped.set(id, candidate)
236
- used.add(candidate)
237
- }
238
- return mapped
239
- }
240
-
241
- function toolCallState(messages?: readonly MessageLike[]): ToolCallState {
242
- const callIds = new Set<string>()
243
- const resultIds = new Set<string>()
244
-
245
- for (const message of messages ?? []) {
246
- if (message.role === "assistant") {
247
- for (const content of recordArray(message.content)) {
248
- if (content.type === "toolCall") {
249
- const id = stringValue(content.id)
250
- if (id) callIds.add(id)
251
- }
252
- }
253
- } else if (message.role === "toolResult" && message.toolCallId) {
254
- resultIds.add(message.toolCallId)
255
- }
256
- }
257
-
258
- return { callIds, resultIds }
259
- }
260
-
261
- export function messagesToCC(
262
- messages?: readonly MessageLike[],
263
- options: { allowImages?: boolean } = {},
264
- ): unknown[] {
265
- const allowImages = options.allowImages ?? false
266
- if (!allowImages) assertTextOnlyMessages(messages)
267
-
268
- const out: unknown[] = []
269
- const { callIds, resultIds } = toolCallState(messages)
270
- const wireIds = generateToolCallIdMap(messages)
271
- const wireId = (id: string): string => wireIds.get(id) ?? id
272
-
273
- const rawMessages = messages ?? []
274
- for (let i = 0; i < rawMessages.length; i++) {
275
- const message = rawMessages[i]
276
- if (message.role === "user" || message.role === "developer") {
277
- // Hosts such as OMP steer the agent by injecting developer-role messages
278
- // (advisor notes, reminders, nudges) mid-conversation. /alpha/generate
279
- // only accepts user, assistant, and tool roles, so degrade the role to
280
- // user instead of dropping the message. Content and chronological
281
- // position are preserved; system-prompt hoisting would change semantics.
282
- out.push({
283
- role: "user",
284
- content: userContentToCommandCode(message.content, allowImages),
285
- })
286
- } else if (message.role === "assistant") {
287
- const parts: unknown[] = []
288
- const missingResults: unknown[] = []
289
- for (const content of recordArray(message.content)) {
290
- if (content.type === "text") {
291
- parts.push({ type: "text", text: stringValue(content.text) ?? "" })
292
- } else if (content.type === "thinking") {
293
- // The official Command Code CLI replays prior assistant reasoning as
294
- // `reasoning` parts (toWireMessages), and dropping it leaves the model
295
- // unable to see its own earlier thinking on follow-up turns.
296
- parts.push({ type: "reasoning", text: stringValue(content.thinking) ?? "" })
297
- } else if (content.type === "toolCall") {
298
- const rawToolCallId = stringValue(content.id) ?? ""
299
- const toolName = stringValue(content.name) ?? ""
300
- if (!rawToolCallId) continue
301
- const toolCallId = wireId(rawToolCallId)
302
- parts.push({
303
- type: "tool-call",
304
- toolCallId,
305
- toolName,
306
- input: recordOrEmpty(content.arguments),
307
- })
308
- if (!resultIds.has(rawToolCallId)) {
309
- missingResults.push({
310
- type: "tool-result",
311
- toolCallId,
312
- toolName,
313
- output: {
314
- type: "error-text",
315
- value: "No result — the tool call did not complete (interrupted or lost).",
316
- },
317
- })
318
- }
319
- }
320
- }
321
- if (parts.length > 0) out.push({ role: "assistant", content: parts })
322
- if (missingResults.length > 0) out.push({ role: "tool", content: missingResults })
323
- } else if (message.role === "toolResult") {
324
- const pendingImages: Record<string, string>[] = []
325
- let j = i
326
- for (; j < rawMessages.length && rawMessages[j].role === "toolResult"; j++) {
327
- const toolMsg = rawMessages[j]
328
- if (!toolMsg.toolCallId || !callIds.has(toolMsg.toolCallId)) continue
329
- const images = imageParts(toolMsg.content)
330
- const text = textContent(toolMsg)
331
- const outputText =
332
- text ||
333
- (images.length > 0 && !allowImages
334
- ? "[Image omitted: model does not support images]"
335
- : "")
336
- out.push({
337
- role: "tool",
338
- content: [
339
- {
340
- type: "tool-result",
341
- toolCallId: wireId(toolMsg.toolCallId),
342
- toolName: toolMsg.toolName,
343
- output: toolMsg.isError
344
- ? { type: "error-text", value: outputText }
345
- : { type: "text", value: outputText },
346
- },
347
- ],
348
- })
349
-
350
- if (images.length > 0 && allowImages) {
351
- pendingImages.push(...images.map(imageToCommandCode))
352
- }
353
- }
354
- i = j - 1
355
-
356
- if (pendingImages.length > 0) {
357
- out.push({
358
- role: "user",
359
- content: pendingImages,
360
- })
361
- }
362
- }
363
- }
364
- return out
365
- }
366
-
367
- export function parseStreamEventLine(line: string): unknown | undefined {
368
- let trimmed = line.trim()
369
- if (!trimmed || trimmed.startsWith(":") || trimmed.startsWith("event:")) return undefined
370
- if (trimmed.startsWith("data:")) trimmed = trimmed.slice(5).trim()
371
- if (!trimmed || trimmed === "[DONE]") return undefined
372
-
373
- try {
374
- const parsed: unknown = JSON.parse(trimmed)
375
- return parsed
376
- } catch {
377
- return undefined
378
- }
379
- }
380
-
381
- export function mapFinishReason(reason: unknown): StopReason {
382
- if (reason === "tool-calls") return "toolUse"
383
- if (
384
- reason === "length" ||
385
- reason === "max_tokens" ||
386
- reason === "max-tokens" ||
387
- reason === "max_output_tokens"
388
- ) {
389
- return "length"
390
- }
391
- return "stop"
392
- }
393
-
394
- function promptPartToText(value: unknown, depth = 0): string {
395
- if (depth > 10) return ""
396
- if (typeof value === "string") return value
397
- if (Array.isArray(value))
398
- return value
399
- .map((v) => promptPartToText(v, depth + 1))
400
- .filter(Boolean)
401
- .join("\n")
402
- if (!isRecord(value)) return ""
403
- const text = stringValue(value.text)
404
- if (text) return text
405
- const content = promptPartToText(value.content, depth + 1)
406
- if (content) return content
407
- return ""
408
- }
409
-
410
- export function systemPromptToText(value: unknown): string {
411
- if (value === undefined || value === null) return ""
412
- if (typeof value === "string") return value
413
- if (Array.isArray(value))
414
- return value
415
- .map((v) => promptPartToText(v, 0))
416
- .filter(Boolean)
417
- .join("\n\n")
418
- return promptPartToText(value, 0)
419
- }