@herbertgao/pi-extensions 2026.9.20 → 2026.10.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 (357) hide show
  1. package/README.md +18 -13
  2. package/THIRD_PARTY_NOTICES.md +31 -5
  3. package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-audit.md +1 -1
  4. package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-debt.md +1 -1
  5. package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-gain.md +1 -1
  6. package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-review.md +1 -1
  7. package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail.md +1 -1
  8. package/node_modules/@dietrichgebert/ponytail/.opencode/plugins/index.js +4 -0
  9. package/node_modules/@dietrichgebert/ponytail/.opencode/plugins/ponytail-frontmatter.cjs +43 -3
  10. package/node_modules/@dietrichgebert/ponytail/.opencode/plugins/ponytail.mjs +142 -59
  11. package/node_modules/@dietrichgebert/ponytail/.qoder-plugin/plugin.json +1 -1
  12. package/node_modules/@dietrichgebert/ponytail/README.es.md +87 -204
  13. package/node_modules/@dietrichgebert/ponytail/README.ja.md +212 -0
  14. package/node_modules/@dietrichgebert/ponytail/README.ko.md +92 -226
  15. package/node_modules/@dietrichgebert/ponytail/README.md +58 -244
  16. package/node_modules/@dietrichgebert/ponytail/README.zh-CN.md +212 -0
  17. package/node_modules/@dietrichgebert/ponytail/hooks/claude-codex-hooks.json +3 -3
  18. package/node_modules/@dietrichgebert/ponytail/hooks/copilot-hooks.json +4 -4
  19. package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-activate.js +63 -16
  20. package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-config.js +8 -7
  21. package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-mode-tracker.js +46 -23
  22. package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-runtime.js +39 -7
  23. package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-subagent.js +20 -3
  24. package/node_modules/@dietrichgebert/ponytail/hooks/qoder-hooks.json +3 -3
  25. package/node_modules/@dietrichgebert/ponytail/package.json +2 -2
  26. package/node_modules/@dietrichgebert/ponytail/pi-extension/index.js +47 -17
  27. package/node_modules/@dietrichgebert/ponytail/scripts/uninstall.js +21 -7
  28. package/node_modules/@dietrichgebert/ponytail/skills/plugin.json +5 -0
  29. package/node_modules/@dietrichgebert/ponytail/skills/ponytail-audit/SKILL.md +7 -2
  30. package/node_modules/@dietrichgebert/ponytail/skills/ponytail-debt/SKILL.md +1 -1
  31. package/node_modules/@dietrichgebert/ponytail/skills/ponytail-gain/SKILL.md +16 -14
  32. package/node_modules/@dietrichgebert/ponytail/skills/ponytail-help/SKILL.md +3 -3
  33. package/node_modules/@dietrichgebert/ponytail/skills/ponytail-review/SKILL.md +12 -7
  34. package/node_modules/@herbertgao/pi-bark/README.md +39 -3
  35. package/node_modules/@herbertgao/pi-bark/package.json +1 -1
  36. package/node_modules/@herbertgao/pi-bark/src/index.ts +275 -15
  37. package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +50 -50
  38. package/node_modules/@herbertgao/pi-cc-extensions/README.md +7 -7
  39. package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +25 -2
  40. package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +24 -1
  41. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/compact-thinking.ts +7 -4
  42. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/footer.ts +47 -5
  43. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/mcp-chip.ts +136 -0
  44. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +56 -11
  45. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/default-mode.ts +36 -4
  46. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +11 -2
  47. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/codemode.ts +303 -0
  48. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-header.ts +1 -1
  49. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-highlight.ts +36 -0
  50. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-presentation.ts +2 -2
  51. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-write-render.ts +2 -2
  52. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/index.ts +88 -34
  53. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/line-width-safety.ts +6 -5
  54. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/write-execution.ts +1 -1
  55. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +31 -6
  56. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/message-display.ts +3 -3
  57. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/names.ts +3 -0
  58. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/result.ts +173 -36
  59. package/node_modules/@herbertgao/pi-cc-extensions/extensions/utils/ansi-text.ts +1 -0
  60. package/node_modules/@herbertgao/pi-cc-extensions/package.json +6 -4
  61. package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +6 -0
  62. package/node_modules/@herbertgao/pi-subagents/package.json +1 -1
  63. package/node_modules/@herbertgao/pi-subagents/src/mention-clone.ts +3 -2
  64. package/node_modules/@herbertgao/sol-pi/CONTRIBUTING.md +22 -0
  65. package/node_modules/@herbertgao/sol-pi/README.md +36 -17
  66. package/node_modules/@herbertgao/sol-pi/THIRD_PARTY_NOTICES.md +10 -6
  67. package/node_modules/@herbertgao/sol-pi/agents-install.md +15 -12
  68. package/node_modules/@herbertgao/sol-pi/docs/compatibility.md +24 -8
  69. package/node_modules/@herbertgao/sol-pi/docs/configuration.md +2 -2
  70. package/node_modules/@herbertgao/sol-pi/docs/star-history.md +18 -0
  71. package/node_modules/@herbertgao/sol-pi/package.json +4 -2
  72. package/node_modules/@herbertgao/sol-pi/scripts/check-sol-pi-config.mjs +1 -1
  73. package/node_modules/@herbertgao/sol-pi/src/sol-pi/config.ts +1 -1
  74. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/file-queue.ts +23 -4
  75. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/index.ts +32 -1
  76. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/then-run.ts +3 -2
  77. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/observation-pack/observation.ts +1 -1
  78. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/economics.ts +27 -7
  79. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/extension.ts +137 -41
  80. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/index.ts +1 -0
  81. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/plan.ts +2 -1
  82. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/projection.ts +58 -0
  83. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/state.ts +28 -6
  84. package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/tools.ts +2 -1
  85. package/node_modules/@herbertgao/sol-pi/src/sol-pi/runtime-paths.ts +15 -2
  86. package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +2 -2
  87. package/node_modules/@narumitw/pi-caffeinate/package.json +4 -4
  88. package/node_modules/@pi-plugins/fast-mode/README.md +7 -1
  89. package/node_modules/@pi-plugins/fast-mode/dist/index.d.mts.map +1 -1
  90. package/node_modules/@pi-plugins/fast-mode/dist/index.mjs +7 -1
  91. package/node_modules/@pi-plugins/fast-mode/dist/index.mjs.map +1 -1
  92. package/node_modules/@pi-plugins/fast-mode/package.json +5 -5
  93. package/node_modules/pi-antigravity/README.md +3 -0
  94. package/node_modules/pi-antigravity/package.json +8 -8
  95. package/node_modules/pi-antigravity/src/auth/oauth.ts +6 -3
  96. package/node_modules/pi-antigravity/src/index.ts +114 -110
  97. package/node_modules/pi-antigravity/src/stream/stream.ts +1 -1
  98. package/node_modules/pi-antigravity/src/utils/util.ts +18 -1
  99. package/node_modules/pi-multi-account/CHANGELOG.md +20 -0
  100. package/node_modules/pi-multi-account/README.md +46 -8
  101. package/node_modules/pi-multi-account/config-file-transaction.ts +42 -0
  102. package/node_modules/pi-multi-account/index.ts +255 -269
  103. package/node_modules/pi-multi-account/model-pins.ts +36 -0
  104. package/node_modules/pi-multi-account/package.json +9 -7
  105. package/node_modules/pi-multi-account/slot-proxy-auth.ts +12 -2
  106. package/node_modules/pi-multi-account/slot-proxy.ts +27 -5
  107. package/node_modules/pi-typesafe/README.md +1 -1
  108. package/node_modules/pi-typesafe/dist/backends.d.ts +15 -5
  109. package/node_modules/pi-typesafe/dist/backends.js +18 -0
  110. package/node_modules/pi-typesafe/dist/client.d.ts +4 -3
  111. package/node_modules/pi-typesafe/dist/client.js +22 -7
  112. package/node_modules/pi-typesafe/dist/index.d.ts +2 -2
  113. package/node_modules/pi-typesafe/dist/index.js +1 -1
  114. package/node_modules/pi-typesafe/dist/usage.d.ts +14 -4
  115. package/node_modules/pi-typesafe/dist/usage.js +147 -42
  116. package/node_modules/pi-typesafe/package.json +1 -1
  117. package/node_modules/pi-web-access/CHANGELOG.md +65 -0
  118. package/node_modules/pi-web-access/README.md +63 -14
  119. package/node_modules/pi-web-access/brave-rate-limit.ts +176 -0
  120. package/node_modules/pi-web-access/brave.ts +28 -11
  121. package/node_modules/pi-web-access/curator-page.ts +5 -1
  122. package/node_modules/pi-web-access/curator-server.ts +2 -0
  123. package/node_modules/pi-web-access/declared-web-links.ts +2 -2
  124. package/node_modules/pi-web-access/degoog.ts +323 -0
  125. package/node_modules/pi-web-access/dist/index.js +3647 -2740
  126. package/node_modules/pi-web-access/dist/mcp-cli.js +27443 -0
  127. package/node_modules/pi-web-access/exa.ts +5 -1
  128. package/node_modules/pi-web-access/extract.ts +41 -3
  129. package/node_modules/pi-web-access/firecrawl.ts +35 -4
  130. package/node_modules/pi-web-access/gemini-search.ts +36 -16
  131. package/node_modules/pi-web-access/gemini-web.ts +14 -9
  132. package/node_modules/pi-web-access/index.ts +164 -1207
  133. package/node_modules/pi-web-access/keenable.ts +221 -0
  134. package/node_modules/pi-web-access/mcp-cli.ts +40 -0
  135. package/node_modules/pi-web-access/mcp-server.ts +81 -0
  136. package/node_modules/pi-web-access/mcp-tool-definitions.ts +117 -0
  137. package/node_modules/pi-web-access/openai-search.ts +58 -11
  138. package/node_modules/pi-web-access/package.json +23 -5
  139. package/node_modules/pi-web-access/perplexity.ts +64 -56
  140. package/node_modules/pi-web-access/summary-review.ts +8 -2
  141. package/node_modules/pi-web-access/tool-arguments.ts +20 -0
  142. package/node_modules/pi-web-access/video-extract.ts +1 -1
  143. package/node_modules/pi-web-access/web-tool-contract.ts +86 -0
  144. package/node_modules/pi-web-access/web-tool-core.ts +1502 -0
  145. package/node_modules/pi-web-access/youtube-extract.ts +2 -5
  146. package/node_modules/{@herbertgao/resume-from → resume-from}/README.md +16 -12
  147. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/adapter.d.ts +0 -5
  148. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/adapter.js +2 -3
  149. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/contract.d.ts +2 -2
  150. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/reader.d.ts +3 -0
  151. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/reader.js +27 -15
  152. package/node_modules/{@herbertgao/resume-from/dist/adapters/codex → resume-from/dist/adapters/claude-code}/redaction.js +16 -3
  153. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/writer.d.ts +2 -4
  154. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/writer.js +1 -1
  155. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/contract.d.ts +2 -4
  156. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/index.js +1 -2
  157. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/read.d.ts +16 -0
  158. package/node_modules/resume-from/dist/adapters/codex/read.js +723 -0
  159. package/node_modules/{@herbertgao/resume-from/dist/adapters/pi → resume-from/dist/adapters/codex}/redaction.js +16 -3
  160. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/rollout.d.ts +44 -4
  161. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/rollout.js +88 -4
  162. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/write.d.ts +2 -2
  163. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/write.js +2 -2
  164. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/contract.d.ts +5 -1
  165. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/adapter.js +10 -6
  166. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/contract.d.ts +2 -2
  167. package/node_modules/{@herbertgao/resume-from/dist/adapters/claude-code → resume-from/dist/adapters/pi}/redaction.js +16 -3
  168. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/serialize.d.ts +2 -4
  169. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/serialize.js +2 -2
  170. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/render.d.ts +1 -1
  171. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/render.js +4 -4
  172. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/runner.js +2 -2
  173. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/contract.d.ts +2 -2
  174. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/command.js +31 -8
  175. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/wiring.d.ts +1 -1
  176. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/wiring.js +1 -2
  177. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/confirmation.d.ts +4 -1
  178. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/confirmation.js +2 -2
  179. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/contract.d.ts +8 -6
  180. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/discovery/contract.d.ts +10 -5
  181. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/discovery/finder.d.ts +2 -1
  182. package/node_modules/resume-from/dist/import/discovery/finder.js +269 -0
  183. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/contract.d.ts +3 -3
  184. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/lander.js +3 -3
  185. package/node_modules/resume-from/dist/import/pipeline.d.ts +28 -0
  186. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/pipeline.js +31 -11
  187. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/preview/builder.d.ts +2 -2
  188. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/preview/builder.js +9 -5
  189. package/node_modules/resume-from/dist/import/preview/warnings.d.ts +14 -0
  190. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/preview/warnings.js +26 -20
  191. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/wiring.js +12 -2
  192. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/repo/contract.d.ts +9 -3
  193. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/repo/git.d.ts +4 -4
  194. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/repo/git.js +7 -4
  195. package/node_modules/resume-from/dist/platform/repo/reader.d.ts +3 -0
  196. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/repo/reader.js +60 -20
  197. package/node_modules/{@herbertgao/resume-from → resume-from}/dist/session/contract.d.ts +8 -1
  198. package/node_modules/{@herbertgao/resume-from → resume-from}/package.json +19 -32
  199. package/node_modules/{@herbertgao/resume-from → resume-from}/shims/pi/extensions/resume-from.js +2 -2
  200. package/package.json +21 -21
  201. package/node_modules/@dietrichgebert/ponytail/assets/benchmark-3model.svg +0 -21
  202. package/node_modules/@dietrichgebert/ponytail/assets/benchmark-agentic.svg +0 -62
  203. package/node_modules/@dietrichgebert/ponytail/assets/logo-dark.png +0 -0
  204. package/node_modules/@dietrichgebert/ponytail/assets/logo-dark.svg +0 -115
  205. package/node_modules/@dietrichgebert/ponytail/assets/logo-greenpt-dark.svg +0 -27
  206. package/node_modules/@dietrichgebert/ponytail/assets/logo-greenpt.svg +0 -27
  207. package/node_modules/@dietrichgebert/ponytail/assets/logo.png +0 -0
  208. package/node_modules/@dietrichgebert/ponytail/assets/retriever-icon.png +0 -0
  209. package/node_modules/@dietrichgebert/ponytail/assets/retriever-logo-dark.svg +0 -4
  210. package/node_modules/@dietrichgebert/ponytail/assets/retriever-logo-light.svg +0 -4
  211. package/node_modules/@dietrichgebert/ponytail/assets/social-preview.png +0 -0
  212. package/node_modules/@dietrichgebert/ponytail/assets/waitlist-banner-es.png +0 -0
  213. package/node_modules/@dietrichgebert/ponytail/assets/waitlist-banner-ko.png +0 -0
  214. package/node_modules/@dietrichgebert/ponytail/assets/waitlist-banner.png +0 -0
  215. package/node_modules/@herbertgao/resume-from/dist/adapters/codex/read.js +0 -270
  216. package/node_modules/@herbertgao/resume-from/dist/import/discovery/finder.js +0 -129
  217. package/node_modules/@herbertgao/resume-from/dist/import/pipeline.d.ts +0 -17
  218. package/node_modules/@herbertgao/resume-from/dist/import/preview/warnings.d.ts +0 -11
  219. package/node_modules/@herbertgao/resume-from/dist/platform/repo/reader.d.ts +0 -8
  220. /package/node_modules/{@herbertgao/resume-from → resume-from}/LICENSE +0 -0
  221. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/contract.js +0 -0
  222. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/entries.d.ts +0 -0
  223. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/entries.js +0 -0
  224. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/index.d.ts +0 -0
  225. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/index.js +0 -0
  226. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/layout.d.ts +0 -0
  227. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/layout.js +0 -0
  228. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/readback.d.ts +0 -0
  229. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/readback.js +0 -0
  230. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/redaction.d.ts +0 -0
  231. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/validation.d.ts +0 -0
  232. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/claude-code/validation.js +0 -0
  233. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/contract.js +0 -0
  234. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/index.d.ts +0 -0
  235. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/readback.d.ts +0 -0
  236. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/readback.js +0 -0
  237. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/redaction.d.ts +0 -0
  238. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/validation.d.ts +0 -0
  239. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/codex/validation.js +0 -0
  240. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/contract.js +0 -0
  241. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/adapter.d.ts +0 -0
  242. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/contract.js +0 -0
  243. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/format.d.ts +0 -0
  244. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/format.js +0 -0
  245. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/index.d.ts +0 -0
  246. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/index.js +0 -0
  247. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/parse.d.ts +0 -0
  248. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/parse.js +0 -0
  249. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/redaction.d.ts +0 -0
  250. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/validate.d.ts +0 -0
  251. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/adapters/pi/validate.js +0 -0
  252. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/bin.d.ts +0 -0
  253. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/bin.js +0 -0
  254. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/contract.d.ts +0 -0
  255. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/contract.js +0 -0
  256. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/agents.d.ts +0 -0
  257. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/agents.js +0 -0
  258. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/args.d.ts +0 -0
  259. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/args.js +0 -0
  260. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/contract.d.ts +0 -0
  261. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/contract.js +0 -0
  262. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/index.d.ts +0 -0
  263. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/index.js +0 -0
  264. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/presentation.d.ts +0 -0
  265. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/presentation.js +0 -0
  266. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/cli/runner.d.ts +0 -0
  267. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/contract.js +0 -0
  268. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/entry.d.ts +0 -0
  269. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/entry.js +0 -0
  270. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/index.d.ts +0 -0
  271. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/index.js +0 -0
  272. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/command.d.ts +0 -0
  273. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/contract.d.ts +0 -0
  274. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/contract.js +0 -0
  275. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/index.d.ts +0 -0
  276. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/index.js +0 -0
  277. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/picker.d.ts +0 -0
  278. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/picker.js +0 -0
  279. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/presentation.d.ts +0 -0
  280. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/presentation.js +0 -0
  281. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/register.d.ts +0 -0
  282. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/register.js +0 -0
  283. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/ui.d.ts +0 -0
  284. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/pi-extension/ui.js +0 -0
  285. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/profile.d.ts +0 -0
  286. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/profile.js +0 -0
  287. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/registry.d.ts +0 -0
  288. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/host/registry.js +0 -0
  289. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/contract.js +0 -0
  290. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/discovery/contract.js +0 -0
  291. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/discovery/errors.d.ts +0 -0
  292. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/discovery/errors.js +0 -0
  293. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/discovery/homes.d.ts +0 -0
  294. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/discovery/homes.js +0 -0
  295. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/discovery/index.d.ts +0 -0
  296. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/discovery/index.js +0 -0
  297. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/discovery/ordering.d.ts +0 -0
  298. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/discovery/ordering.js +0 -0
  299. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/errors.d.ts +0 -0
  300. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/errors.js +0 -0
  301. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/index.d.ts +0 -0
  302. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/index.js +0 -0
  303. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/contract.js +0 -0
  304. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/errors.d.ts +0 -0
  305. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/errors.js +0 -0
  306. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/handover.d.ts +0 -0
  307. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/handover.js +0 -0
  308. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/index.d.ts +0 -0
  309. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/index.js +0 -0
  310. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/lander.d.ts +0 -0
  311. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/marker.d.ts +0 -0
  312. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/landing/marker.js +0 -0
  313. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/preview/contract.d.ts +0 -0
  314. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/preview/contract.js +0 -0
  315. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/preview/format.d.ts +0 -0
  316. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/preview/format.js +0 -0
  317. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/preview/index.d.ts +0 -0
  318. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/preview/index.js +0 -0
  319. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/transfer/contract.d.ts +0 -0
  320. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/transfer/contract.js +0 -0
  321. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/transfer/index.d.ts +0 -0
  322. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/transfer/index.js +0 -0
  323. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/transfer/rules.d.ts +0 -0
  324. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/transfer/rules.js +0 -0
  325. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/import/wiring.d.ts +0 -0
  326. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/index.d.ts +0 -0
  327. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/index.js +0 -0
  328. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/contract.d.ts +0 -0
  329. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/contract.js +0 -0
  330. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/defaults.d.ts +0 -0
  331. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/defaults.js +0 -0
  332. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/errors.d.ts +0 -0
  333. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/errors.js +0 -0
  334. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/index.d.ts +0 -0
  335. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/index.js +0 -0
  336. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/loader.d.ts +0 -0
  337. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/loader.js +0 -0
  338. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/paths.d.ts +0 -0
  339. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/paths.js +0 -0
  340. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/validate.d.ts +0 -0
  341. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/config/validate.js +0 -0
  342. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/repo/contract.js +0 -0
  343. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/repo/index.d.ts +0 -0
  344. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/repo/index.js +0 -0
  345. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/store/contract.d.ts +0 -0
  346. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/store/contract.js +0 -0
  347. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/store/file-committer.d.ts +0 -0
  348. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/store/file-committer.js +0 -0
  349. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/store/index.d.ts +0 -0
  350. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/store/index.js +0 -0
  351. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/tokens/contract.d.ts +0 -0
  352. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/tokens/contract.js +0 -0
  353. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/tokens/estimator.d.ts +0 -0
  354. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/tokens/estimator.js +0 -0
  355. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/tokens/index.d.ts +0 -0
  356. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/platform/tokens/index.js +0 -0
  357. /package/node_modules/{@herbertgao/resume-from → resume-from}/dist/session/contract.js +0 -0
@@ -1,6 +1,7 @@
1
1
  import { Text, truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@earendil-works/pi-tui";
2
2
  import { inspect } from "node:util";
3
3
  import { config } from "../../config/config.ts";
4
+ import { createCodeBlockHighlighter } from "./diff/diff-highlight.ts";
4
5
  import { showMoreHintText } from "./show-more-hint.ts";
5
6
  import { TOOL_LOADING_INTERVAL_MS, toolLoadingIcon } from "../../utils/tool-loading-icon.ts";
6
7
  import { getToolMouseTui } from "../mouse/scroll.ts";
@@ -231,7 +232,7 @@ export class ExpandedToolResultText {
231
232
  }
232
233
 
233
234
  /** 截断体末行 `… +N more lines` 旁的展开提示,点击打开全量预览。 */
234
- export const SHOW_MORE_LABEL = "• click to show more";
235
+ export const SHOW_MORE_LABEL = "· click to show more";
235
236
 
236
237
  export type ToolIoSection = "input" | "output";
237
238
 
@@ -268,6 +269,17 @@ export class ExpandedToolIoView {
268
269
  private truncated: { input: boolean; output: boolean } = { input: false, output: false };
269
270
  /** 0-based header line indexes that carry show-more after last render. */
270
271
  private showMoreHeaderRows: { input?: number; output?: number } = {};
272
+ /** Input 里的代码块(codemode 的 `code`):着色行覆盖默认 dim/muted 样式。 */
273
+ private inputCode?:
274
+ | {
275
+ startLine: number;
276
+ language: string;
277
+ standalone: boolean;
278
+ code: string;
279
+ theme: unknown;
280
+ rows: () => string[];
281
+ }
282
+ | undefined;
271
283
 
272
284
  /** flushLeft:贴左渲染(mode=on 展开卡);默认 false 保留前导空格(compact 等共用路径)。 */
273
285
  private flushLeft: boolean;
@@ -325,6 +337,57 @@ export class ExpandedToolIoView {
325
337
  return this.inputBody;
326
338
  }
327
339
 
340
+ /**
341
+ * 登记 Input 里的代码块:同步 cli-highlight 打底,shiki 异步升级,落地后
342
+ * 经 invalidate 重画。同一份代码与主题只建一次(视图按宽度缓存行)。
343
+ */
344
+ setInputCode(block: InputCodeBlock | undefined): void {
345
+ if (!block) {
346
+ if (this.inputCode) {
347
+ this.inputCode = undefined;
348
+ this.invalidate();
349
+ }
350
+ return;
351
+ }
352
+ if (this.inputCode?.code === block.code && this.inputCode.theme === this.theme) {
353
+ this.inputCode.startLine = block.startLine;
354
+ this.inputCode.standalone = block.standalone;
355
+ return;
356
+ }
357
+ this.inputCode = {
358
+ startLine: block.startLine,
359
+ language: block.language,
360
+ standalone: block.standalone,
361
+ code: block.code,
362
+ theme: this.theme,
363
+ rows: createCodeBlockHighlighter(block.code, block.language, this.theme, () => {
364
+ // 视图自己的行缓存 + 外层工具卡(清 paint 缓存并 requestRender)
365
+ this.invalidate();
366
+ invalidateIoView(this);
367
+ }),
368
+ };
369
+ this.invalidate();
370
+ }
371
+
372
+ /**
373
+ * 整段 Input 就是代码块时给出语言与代码,供全量预览包一层围栏(弹框按 Markdown
374
+ * 渲染,围栏代码块由 pi 的 highlightCode 着色)。混了别的字段时返回 undefined。
375
+ */
376
+ getInputCodeFence(): { language: string; code: string } | undefined {
377
+ const block = this.inputCode;
378
+ return block?.standalone ? { language: block.language, code: block.code } : undefined;
379
+ }
380
+
381
+ /** 代码块里某一源行的着色内容(已剥掉行首缩进);不在块内时为 undefined。 */
382
+ private inputCodeLine(sourceIndex: number): string | undefined {
383
+ const block = this.inputCode;
384
+ if (!block) return undefined;
385
+ const offset = sourceIndex - block.startLine;
386
+ if (offset < 0) return undefined;
387
+ const rows = block.rows();
388
+ return offset < rows.length ? rows[offset] : undefined;
389
+ }
390
+
328
391
  getOutputBody(): string {
329
392
  return this.outputBody.trim() ? this.outputBody : "Done";
330
393
  }
@@ -342,7 +405,7 @@ export class ExpandedToolIoView {
342
405
  /** True when the plain truncation footer carries show-more. Input 续行带 │,Output 不带。 */
343
406
  matchShowMoreLine(plainLine: string): ToolIoSection | null {
344
407
  const line = plainLine.replace(/\x1b\[[0-9;]*m/g, "");
345
- if (!line.includes(` • ${showMoreHintText()}`) || !/\+\d+ more lines/.test(line)) return null;
408
+ if (!line.includes(` · ${showMoreHintText()}`) || !/\+\d+ more lines/.test(line)) return null;
346
409
  if (this.truncated.input && line.includes("│")) return "input";
347
410
  if (this.truncated.output) return "output";
348
411
  return null;
@@ -363,7 +426,7 @@ export class ExpandedToolIoView {
363
426
  /** Column range (1-based, visible cells) of show-more on a rendered header, if present. */
364
427
  showMoreHitbox(plainLine: string): { startCol: number; endCol: number } | null {
365
428
  const line = plainLine.replace(/\x1b\[[0-9;]*m/g, "");
366
- const label = ` • ${showMoreHintText()}`;
429
+ const label = ` · ${showMoreHintText()}`;
367
430
  const idx = line.lastIndexOf(label);
368
431
  if (idx < 0) return null;
369
432
  const before = line.slice(0, idx);
@@ -409,14 +472,6 @@ export class ExpandedToolIoView {
409
472
  lines.push(truncateToWidth(theme.fg("dim", `${lead}│`), safeWidth, ""));
410
473
  };
411
474
 
412
- /** Style `key: value` input rows — dim keys, readable values. */
413
- const styleInputLine = (rawLine: string): string => {
414
- const match = rawLine.match(/^([A-Za-z_][\w.-]*)(:\s*)(.*)$/);
415
- if (!match) return theme.fg("muted", rawLine);
416
- const [, key, sep, rest] = match;
417
- return theme.fg("dim", key + sep) + theme.fg("muted", rest ?? "");
418
- };
419
-
420
475
  const pushBody = (
421
476
  body: string,
422
477
  opts: { input?: boolean; limit: number; continued?: boolean; section: ToolIoSection },
@@ -428,8 +483,13 @@ export class ExpandedToolIoView {
428
483
  }
429
484
  const sourceLines = raw.split("\n");
430
485
  const wrapped: string[] = [];
431
- for (const source of sourceLines) {
432
- const styled = opts.input ? styleInputLine(source) : theme.fg(bodyColor, source);
486
+ for (const [index, source] of sourceLines.entries()) {
487
+ if (opts.input) {
488
+ // 代码块的行用着色版本(已剥缩进),其余走默认 dim/muted
489
+ wrapped.push(...wrapInputLine(source, contentWidth, theme, this.inputCodeLine(index)));
490
+ continue;
491
+ }
492
+ const styled = theme.fg(bodyColor, source);
433
493
  const parts = wrapTextWithAnsi(styled, contentWidth);
434
494
  if (parts.length === 0) wrapped.push(styled);
435
495
  else wrapped.push(...parts);
@@ -444,7 +504,7 @@ export class ExpandedToolIoView {
444
504
  if (hidden > 0) {
445
505
  // hover 只高亮文字,圆点保持 dim(与 group hint 一致)。
446
506
  const more =
447
- theme.fg("dim", " •") +
507
+ theme.fg("dim", " ·") +
448
508
  theme.fg(
449
509
  this.hoveredSection === opts.section ? "text" : "dim",
450
510
  ` ${showMoreHintText()}`,
@@ -462,7 +522,15 @@ export class ExpandedToolIoView {
462
522
  // Decide show-more from the same truncation rules as pushBody.
463
523
  const inputWouldTruncate =
464
524
  hasInput &&
465
- bodyExceedsLineLimit(this.inputBody, this.maxInputLines, contentWidth, true, theme);
525
+ bodyExceedsLineLimit(
526
+ this.inputBody,
527
+ this.maxInputLines,
528
+ contentWidth,
529
+ true,
530
+ theme,
531
+ bodyColor,
532
+ (inputIndex: number) => this.inputCodeLine(inputIndex),
533
+ );
466
534
  const outputWouldTruncate = bodyExceedsLineLimit(
467
535
  outputText,
468
536
  this.maxOutputLines,
@@ -522,6 +590,40 @@ export function isExpandedToolIoView(value: unknown): value is ExpandedToolIoVie
522
590
  );
523
591
  }
524
592
 
593
+ /** Input 行着色:`key: value` 拆成 dim 键 + muted 值,其余整行 muted。 */
594
+ function styleInputSourceLine(line: string, theme: any): string {
595
+ const match = line.match(/^([A-Za-z_][\w.-]*)(:\s*)(.*)$/);
596
+ if (!match) return theme.fg("muted", line);
597
+ const [, key, sep, rest] = match;
598
+ return theme.fg("dim", key + sep) + theme.fg("muted", rest ?? "");
599
+ }
600
+
601
+ /**
602
+ * 折一行 Input 源码。不带 styledBody 时与改动前完全一致(其他工具不受影响);
603
+ * 代码块(styledBody = 已着色且已剥缩进的行)续行跟着源码前导缩进:顶到 rail
604
+ * 会被读成新的一行,所以缩进先剥掉、折行宽度相应扣减,再给每一行加回去。
605
+ * 行数判断(bodyExceedsLineLimit)与实际渲染共用这一套,展开提示才对得上。
606
+ */
607
+ function wrapInputLine(
608
+ source: string,
609
+ contentWidth: number,
610
+ theme: any,
611
+ styledBody?: string,
612
+ ): string[] {
613
+ if (styledBody === undefined) {
614
+ const styled = styleInputSourceLine(source, theme);
615
+ const parts = wrapTextWithAnsi(styled, contentWidth);
616
+ return parts.length ? parts : [styled];
617
+ }
618
+ const lead = /^[ \t]*/.exec(source)?.[0] ?? "";
619
+ const leadWidth = visibleWidth(lead);
620
+ const parts = wrapTextWithAnsi(styledBody, Math.max(1, contentWidth - leadWidth));
621
+ const rows = parts.length ? parts : [styledBody];
622
+ if (!leadWidth) return rows;
623
+ const prefix = theme.fg("muted", lead);
624
+ return rows.map((row) => prefix + row);
625
+ }
626
+
525
627
  /** True when body needs truncation at the given line limit (source lines or wrapped rows). */
526
628
  function bodyExceedsLineLimit(
527
629
  body: string,
@@ -530,23 +632,18 @@ function bodyExceedsLineLimit(
530
632
  asInput: boolean,
531
633
  theme: any,
532
634
  bodyColor = "toolOutput",
635
+ /** 代码块的源行取着色内容,行数判断与实际渲染保持同一套规则。 */
636
+ codeLine?: (sourceIndex: number) => string | undefined,
533
637
  ): boolean {
534
638
  const raw = body.replace(/\t/g, " ").replace(/\n+$/, "");
535
639
  if (!raw.trim()) return false;
536
640
  const sourceLines = raw.split("\n");
537
641
  if (sourceLines.length > limit) return true;
538
642
  let total = 0;
539
- for (const source of sourceLines) {
540
- let styled: string;
541
- if (asInput) {
542
- const match = source.match(/^([A-Za-z_][\w.-]*)(:\s*)(.*)$/);
543
- styled = match
544
- ? theme.fg("dim", match[1] + match[2]) + theme.fg("muted", match[3] ?? "")
545
- : theme.fg("muted", source);
546
- } else {
547
- styled = theme.fg(bodyColor, source);
548
- }
549
- const parts = wrapTextWithAnsi(styled, contentWidth);
643
+ for (const [index, source] of sourceLines.entries()) {
644
+ const parts = asInput
645
+ ? wrapInputLine(source, contentWidth, theme, codeLine?.(index))
646
+ : wrapTextWithAnsi(theme.fg(bodyColor, source), contentWidth);
550
647
  total += Math.max(1, parts.length);
551
648
  if (total > limit) return true;
552
649
  }
@@ -603,26 +700,42 @@ export function middleTruncateToWidth(text: string, width: number): string {
603
700
  return `${left}…${right}`;
604
701
  }
605
702
 
703
+ /**
704
+ * 展开卡 Input 的代码块:源行起始下标(相对 text)+ 语言 + 剥掉行首缩进的代码。
705
+ * standalone = 整段 Input 就是这块代码(没有 `code:` 标签),全量预览可以整段包围栏。
706
+ */
707
+ export type InputCodeBlock = {
708
+ startLine: number;
709
+ language: string;
710
+ code: string;
711
+ standalone: boolean;
712
+ };
713
+
714
+ export type ToolInputBody = { text: string; codeBlock?: InputCodeBlock };
715
+
716
+ /** 按字段名判定可着色的入参:codemode / mcpscript 的 `code` 都是 JS 脚本。 */
717
+ const INPUT_CODE_LANGUAGES: Record<string, string> = { code: "javascript" };
718
+
606
719
  /** Pretty-print tool call args for the expanded Input section. */
607
- export function formatToolInputArgs(args: unknown, maxChars = 8_000): string {
608
- if (args === undefined || args === null) return "";
720
+ export function formatToolInputBody(args: unknown, maxChars = 8_000): ToolInputBody {
721
+ if (args === undefined || args === null) return { text: "" };
609
722
  if (typeof args !== "object") {
610
723
  const text = sanitizeToolResultText(String(args));
611
- return text.length > maxChars ? `${text.slice(0, maxChars)}…` : text;
724
+ return { text: text.length > maxChars ? `${text.slice(0, maxChars)}…` : text };
612
725
  }
613
726
  if (Array.isArray(args)) {
614
727
  try {
615
728
  const json = JSON.stringify(args, null, 2);
616
- return json.length > maxChars ? `${json.slice(0, maxChars)}…` : json;
729
+ return { text: json.length > maxChars ? `${json.slice(0, maxChars)}…` : json };
617
730
  } catch {
618
- return sanitizeToolResultText(String(args));
731
+ return { text: sanitizeToolResultText(String(args)) };
619
732
  }
620
733
  }
621
734
 
622
735
  const entries = Object.entries(args as Record<string, unknown>).filter(
623
736
  ([, value]) => value !== undefined,
624
737
  );
625
- if (entries.length === 0) return "";
738
+ if (entries.length === 0) return { text: "" };
626
739
 
627
740
  // Stable, human-first field order for common tools.
628
741
  const preferred = [
@@ -648,13 +761,30 @@ export function formatToolInputArgs(args: unknown, maxChars = 8_000): string {
648
761
  });
649
762
 
650
763
  const lines: string[] = [];
764
+ let codeBlock: InputCodeBlock | undefined;
651
765
  for (const [rawKey, value] of entries) {
652
766
  const key = sanitizeToolResultText(rawKey);
653
767
  if (typeof value === "string") {
654
768
  const safeValue = sanitizeToolResultText(value);
655
769
  if (safeValue.includes("\n")) {
656
- lines.push(`${key}:`);
657
- for (const line of safeValue.replace(/\t/g, " ").split("\n")) {
770
+ const expanded = safeValue.replace(/\t/g, " ");
771
+ const language = INPUT_CODE_LANGUAGES[key];
772
+ // 只有一个 code 字段时(codemode 等)整块 Input 就是脚本,`code:` 标签是噪音
773
+ const standaloneCode = Boolean(language) && entries.length === 1;
774
+ if (!standaloneCode) lines.push(`${key}:`);
775
+ if (language) {
776
+ // 缩进由 wrapInputLine 负责,着色只喂剥掉行首缩进的正文
777
+ codeBlock = {
778
+ startLine: lines.length,
779
+ language,
780
+ code: expanded
781
+ .split("\n")
782
+ .map((line) => line.replace(/^[ \t]*/, ""))
783
+ .join("\n"),
784
+ standalone: standaloneCode,
785
+ };
786
+ }
787
+ for (const line of expanded.split("\n")) {
658
788
  lines.push(` ${line}`);
659
789
  }
660
790
  } else {
@@ -679,7 +809,13 @@ export function formatToolInputArgs(args: unknown, maxChars = 8_000): string {
679
809
  }
680
810
  }
681
811
  const text = lines.join("\n");
682
- return text.length > maxChars ? `${text.slice(0, maxChars)}…` : text;
812
+ // 截断后的行号与着色行不再对齐,这时只给纯文本
813
+ if (text.length > maxChars) return { text: `${text.slice(0, maxChars)}…` };
814
+ return codeBlock ? { text, codeBlock } : { text };
815
+ }
816
+
817
+ export function formatToolInputArgs(args: unknown, maxChars = 8_000): string {
818
+ return formatToolInputBody(args, maxChars).text;
683
819
  }
684
820
 
685
821
  export function hasExpandableDetail(outputText: string, args: unknown): boolean {
@@ -697,7 +833,7 @@ export function renderExpandedToolResult(
697
833
  /** mode=on 展开卡贴左;compact 等保持默认前导空格 */
698
834
  flushLeft = false,
699
835
  ): ExpandedToolIoView | ExpandedToolResultText | Text {
700
- const inputBody = formatToolInputArgs(args);
836
+ const { text: inputBody, codeBlock } = formatToolInputBody(args);
701
837
  const outputBody = body;
702
838
  const maxOutputLines = config.expandedOutputMaxLines;
703
839
  const maxInputLines = config.expandedInputMaxLines;
@@ -726,6 +862,7 @@ export function renderExpandedToolResult(
726
862
  flushLeft,
727
863
  );
728
864
  }
865
+ view.setInputCode(codeBlock);
729
866
  if (context) rememberIoView(context, view);
730
867
  return view;
731
868
  }
@@ -41,6 +41,7 @@ export function stripBackgroundAnsi(line: string): string {
41
41
  /** 剥离行首状态图标(展开组内工具首行复用)。 */
42
42
  export function stripLeadingStatusIcon(line: string): string {
43
43
  return line.replace(
44
+ // 行首图标:ccstyle 用 `·`,pi 原生输出里还有 `•`,两种都要剥
44
45
  /^((?:\x1b\[[0-9;]*m|[ \t]|[├└│─])*)(?:\x1b\[[0-9;]*m)*(?:[✓✗●○■⬤•·])(?:\x1b\[[0-9;]*m)*\s+/,
45
46
  "$1",
46
47
  );
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@herbertgao/pi-cc-extensions",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "license": "MIT",
5
5
  "description": "A Pi productivity suite with Claude Code-style UI, context inspection, and agent/session references",
6
6
  "type": "module",
@@ -41,6 +41,8 @@
41
41
  },
42
42
  "scripts": {
43
43
  "test": "node scripts/test.mjs",
44
+ "coverage": "node scripts/test.mjs --experimental-test-coverage --test-coverage-include=extensions/**/*.ts",
45
+ "docs:tool-render": "node --experimental-strip-types scripts/generate-tool-render-examples.ts",
44
46
  "typecheck": "tsc --noEmit",
45
47
  "format": "biome format --write .",
46
48
  "format:check": "biome format ."
@@ -69,9 +71,9 @@
69
71
  },
70
72
  "x-upstream": {
71
73
  "package": "pi-cc-extensions",
72
- "version": "0.9.9",
73
- "reviewedVersion": "0.9.9",
74
+ "version": "0.9.10",
75
+ "reviewedVersion": "0.9.10",
74
76
  "repository": "https://github.com/minuque/pi-cc-extensions",
75
- "commit": "17d294bcdc5e9a7e68771f0c550440ed22738457"
77
+ "commit": "2b72669cafefe0771b2e3e63b0db5c478314d2d4"
76
78
  }
77
79
  }
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.18.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#258](https://github.com/HerbertGao/pi-extensions/pull/258) [`4f505b1`](https://github.com/HerbertGao/pi-extensions/commit/4f505b1456c5ea766121ee915f14ad29e48973e7) Thanks [@HerbertGao](https://github.com/HerbertGao)! - Keep Pi 1.x tool-call capabilities when starting a mentioned agent through a conversation clone, while preserving attribution to the main session.
8
+
3
9
  ## 0.18.4
4
10
 
5
11
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@herbertgao/pi-subagents",
3
- "version": "0.18.4",
3
+ "version": "0.18.5",
4
4
  "description": "Claude Code-style autonomous subagents and workflow orchestration for Pi, with HerbertGao-maintained UI extensions.",
5
5
  "keywords": [
6
6
  "agent",
@@ -108,7 +108,7 @@ export async function runMentionClone(
108
108
  let spawned = false
109
109
  const cloneAgentTool: ToolDefinition = {
110
110
  ...agentTool,
111
- execute: (_cloneToolCallId, params, signal, onUpdate, _cloneCtx) => {
111
+ execute: (_cloneToolCallId, params, signal, onUpdate, cloneCtx) => {
112
112
  // One spawn per mention. The clone has a single tool and every reason to
113
113
  // stop after using it, but a model that decides to "also" launch a second
114
114
  // agent would do it where nobody can see and nobody asked.
@@ -138,7 +138,8 @@ export async function runMentionClone(
138
138
  } as typeof params,
139
139
  signal,
140
140
  onUpdate,
141
- ctx,
141
+ // Keep Pi's tool-call capabilities, but attribute the spawn to the main session.
142
+ { ...ctx, tools: cloneCtx.tools, executeTool: cloneCtx.executeTool },
142
143
  )
143
144
  },
144
145
  }
@@ -0,0 +1,22 @@
1
+ # Contributing
2
+
3
+ We welcome external pull requests that improve token efficiency and reduce token cost through Pi-compatible extensions.
4
+
5
+ ## Pull Request Requirements
6
+
7
+ Your PR should:
8
+
9
+ - Implement a Pi-compatible extension using Pi's public extension APIs, without modifying Pi's core.
10
+ - Be tested before submission, with relevant automated tests and reproducible validation steps.
11
+ - Clearly explain how the extension reduces token cost or improves token efficiency, including local measurements where available.
12
+ - Document its configuration, expected behavior, and any trade-offs. Efficiency improvements will be evaluated alongside correctness and task performance.
13
+
14
+ ## Benchmarking and Reports
15
+
16
+ Our team will help benchmark submitted extensions to evaluate token usage, model cost, and task performance.
17
+
18
+ We will publish updated benchmark reports on a regular reporting cycle, sharing evaluated changes, results, and any observed trade-offs.
19
+
20
+ ## Contributor Recognition
21
+
22
+ Authors of accepted PRs will be credited as Contributors in the project documentation and the relevant benchmark reports.
@@ -1,10 +1,11 @@
1
1
  <p align="center">
2
- <img src="assets/sol-pi-hero.png" width="100%" alt="SoL-Pi: Scaling Auto-Research Loops for Efficient Agent Harnesses" />
2
+ <img src="https://raw.githubusercontent.com/HerbertGao/pi-extensions/refs/heads/master/packages/sol-pi/assets/sol-pi-hero.png" width="100%" alt="SoL-Pi: Scaling Auto-Research Loops for Efficient Agent Harnesses" />
3
3
  </p>
4
4
 
5
5
  # ⚡ SoL-Pi: Scaling Auto-Research Loops for Efficient Agent Harnesses
6
6
 
7
7
  <p align="center">
8
+ <a href="https://arxiv.org/abs/2609.20519"><img src="https://img.shields.io/badge/arXiv-2609.20519-B31B1B?logo=arxiv&amp;logoColor=white" alt="arXiv: 2609.20519" /></a>
8
9
  <a href="#getting-started"><img src="https://img.shields.io/badge/Getting%20Started-Install-76B900" alt="Getting Started" /></a>
9
10
  <a href="docs/configuration.md"><img src="https://img.shields.io/badge/Docs-Configuration-555555" alt="Configuration" /></a>
10
11
  <a href="https://nvlabs.github.io/SoL-Pi/"><img src="https://img.shields.io/badge/Blog-SoL--Pi-76B900" alt="SoL-Pi Blog" /></a>
@@ -52,32 +53,36 @@ The mechanisms share four rules:
52
53
 
53
54
  Read the [SoL-Pi blog](https://nvlabs.github.io/SoL-Pi/) for a deeper look at the technical details, design rationale, and core insights behind SoL-Pi, including how auto-research led to the four efficiency mechanisms and how they work.
54
55
 
56
+ ## Paper
57
+
58
+ Read our paper: [SoL-Pi: Recursively Scaling Auto-Research Loops for Efficient Agent Harness](https://arxiv.org/abs/2609.20519).
59
+
55
60
  ## Getting Started
56
61
 
57
62
  ### Requirements
58
63
 
59
64
  - Node.js 24 or newer
60
65
  - npm
61
- - `@earendil-works/pi-coding-agent` 0.85.1
66
+ - `@earendil-works/pi-coding-agent` 1.0.4 (the monorepo's tested host; runtime peers remain `*`)
62
67
 
63
68
  ### Install
64
69
 
65
70
  Install the tested Pi release:
66
71
 
67
72
  ```bash
68
- npm install --global @earendil-works/pi-coding-agent@0.85.1
73
+ npm install --global @earendil-works/pi-coding-agent@1.0.4
69
74
  ```
70
75
 
71
- Then install SoL-Pi directly from [NVlabs/SoL-Pi](https://github.com/NVlabs/SoL-Pi):
76
+ Install this independently maintained package, or use `@herbertgao/pi-extensions` for the collection:
72
77
 
73
78
  ```bash
74
- pi install git:github.com/NVlabs/SoL-Pi
79
+ pi install npm:@herbertgao/sol-pi
75
80
  ```
76
81
 
77
82
  To install it only for the current project, use the project-local scope:
78
83
 
79
84
  ```bash
80
- pi install git:github.com/NVlabs/SoL-Pi --local --approve
85
+ pi install npm:@herbertgao/sol-pi --local --approve
81
86
  ```
82
87
 
83
88
  ### Configure
@@ -102,9 +107,9 @@ The following conservative configuration enables only the two local mechanisms t
102
107
  }
103
108
  ```
104
109
 
105
- Enable additional mechanisms only after reviewing their configuration and security implications. SoL-Pi uses no dedicated environment variables; feature flags, the reducer provider/model route, and the compaction ratio are configured in `sol-pi.json`.
110
+ Enable additional mechanisms only after reviewing their configuration and security implications. SoL-Pi uses no dedicated environment variables; feature flags, the reducer provider/model route, and the compaction ratio are configured in `sol-pi.json`. See [sol-pi.example.json](sol-pi.example.json) for a template listing every key.
106
111
 
107
- For the complete schema, see [Configuration](docs/configuration.md). Coding agents and automated environments should follow the canonical [agent installation and configuration protocol](agents-install.md). Its all-enabled profile is checked with `scripts/check-sol-pi-config.mjs --require-all-enabled`.
112
+ For the complete schema, see [Configuration](docs/configuration.md). Coding agents and automated environments should follow the canonical [agent installation and configuration protocol](agents-install.md), which describes an all-enabled configuration checked with `scripts/check-sol-pi-config.mjs --require-all-enabled`.
108
113
 
109
114
  ## Storage and Security
110
115
 
@@ -118,7 +123,9 @@ ObservationPack and Evidence-Preserving Reducer store session-specific archives
118
123
 
119
124
  They archive eligible source material in this directory. The archived copies remain local and are not automatically deleted when the Pi session ends.
120
125
 
121
- Online Context Compact stores its state in Pi's session log. After a successful compaction, it starts a new turn and automatically continues the active task. Cancelling the run or exiting Pi does not trigger automatic continuation.
126
+ With `pi --no-session` or `SessionManager.inMemory()`, Pi provides no session directory. SoL-Pi instead creates a private directory named `sol-pi-<session-id>-<random>/` under the operating system's temporary directory. ObservationPack and Evidence-Preserving Reducer share this directory for the lifetime of the loaded extension. These modes disable Pi's session-log persistence; SoL-Pi still writes archive files for exact recall. Temporary archives are also retained after the session or worker exits so callers can read referenced evidence. Their eventual cleanup follows the host's temporary-file policy or the caller's cleanup, and they are not guaranteed to survive system cleanup or support session recovery.
127
+
128
+ Online Context Compact stores its state in Pi's session log. After a successful compaction, or a recoverable native refusal (session too small, already compacted, or an incomplete summary at the token cap), it automatically continues the active task. A refused attempt retains the existing context and adds no cache debt; plan-only turns cannot repeatedly retry it. Cancelling the run or exiting Pi does not trigger automatic continuation.
122
129
 
123
130
  Evidence-Preserving Reducer may send eligible diagnostic-log content to its configured reducer model using Pi-managed authentication. Review [SECURITY.md](SECURITY.md) before enabling it. Do not enable remote reduction for logs that must remain local.
124
131
 
@@ -133,22 +140,22 @@ Evidence-Preserving Reducer may send eligible diagnostic-log content to its conf
133
140
 
134
141
  ## Development
135
142
 
136
- Install from the lockfile and run the complete source checks:
143
+ From the monorepo root, install from its Bun lockfile and run the complete source checks:
137
144
 
138
145
  ```bash
139
- npm ci --ignore-scripts
140
- npm run check
141
- npm audit --audit-level=high
142
- node scripts/check-pi-compat.mjs
146
+ bun install --frozen-lockfile
147
+ bun run check
148
+ bun audit
149
+ node packages/sol-pi/scripts/check-pi-compat.mjs
143
150
  ```
144
151
 
145
- `npm run check` covers TypeScript, the complete test suite, and package inspection. The development dependency set is pinned to Pi 0.84.2; runtime Pi packages remain peer dependencies so Pi owns their installation and upgrades.
152
+ For package-only checks, run `bun run --cwd packages/sol-pi typecheck` and `bun run --cwd packages/sol-pi test`, then inspect the package with `npm pack --dry-run` from `packages/sol-pi`. Root development dependencies provide Pi 1.0.4; runtime Pi packages remain peer dependencies so Pi owns their installation and upgrades.
146
153
 
147
154
  ## Project Status
148
155
 
149
- SoL-Pi is developed and maintained by NVIDIA as a standalone extension for Pi.
156
+ The original SoL-Pi project is developed by NVIDIA as a standalone extension for Pi. This package is independently maintained in HerbertGao/pi-extensions.
150
157
 
151
- External code contributions are not accepted at this time. Bug reports and private security reports remain welcome through the channels described in [CONTRIBUTING.md](CONTRIBUTING.md) and [SECURITY.md](SECURITY.md).
158
+ For upstream contributions, see [CONTRIBUTING.md](CONTRIBUTING.md). Report collection-specific issues to [HerbertGao/pi-extensions](https://github.com/HerbertGao/pi-extensions/issues); upstream private security channels remain described in [SECURITY.md](SECURITY.md).
152
159
 
153
160
  ## Acknowledgements
154
161
 
@@ -157,3 +164,15 @@ SoL-Pi builds on the public extension interfaces provided by [Pi](https://github
157
164
  ## License
158
165
 
159
166
  SoL-Pi is released under the [MIT License](LICENSE).
167
+
168
+ ## Star History
169
+
170
+ This chart tracks the original NVIDIA project. Its generator and tests are retained as development-only references; publication stays in the [upstream workflow](docs/star-history.md), not this monorepo.
171
+
172
+ <a href="https://www.star-history.com/?repos=NVlabs%2FSoL-Pi&amp;type=date">
173
+ <picture>
174
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/NVlabs/SoL-Pi/star-history/star-history-dark.svg" />
175
+ <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/NVlabs/SoL-Pi/star-history/star-history-light.svg" />
176
+ <img alt="SoL-Pi star history chart" src="https://raw.githubusercontent.com/NVlabs/SoL-Pi/star-history/star-history-light.svg" width="100%" />
177
+ </picture>
178
+ </a>
@@ -1,6 +1,6 @@
1
1
  # Third-Party Notices
2
2
 
3
- SoL-Pi does not vendor third-party source code. Its npm tarball contains only SoL-Pi source, documentation, tests-excluded assets, and project metadata.
3
+ This independently maintained package imports the MIT-licensed SoL-Pi source from [NVlabs/SoL-Pi](https://github.com/NVlabs/SoL-Pi). Original NVIDIA copyright and MIT notices are preserved; `package.json` records the imported baseline in `x-upstream`. Its npm tarball contains only SoL-Pi source, documentation, assets, and project metadata, without vendored Pi or Star History source.
4
4
 
5
5
  ## Runtime peer dependencies
6
6
 
@@ -8,12 +8,16 @@ The following packages are supplied by the user's Pi installation and retain the
8
8
 
9
9
  | Package | Development-tested version | License | Source |
10
10
  | --- | ---: | --- | --- |
11
- | `@earendil-works/pi-agent-core` | 0.85.1 | MIT | <https://github.com/earendil-works/pi> |
12
- | `@earendil-works/pi-ai` | 0.85.1 | MIT | <https://github.com/earendil-works/pi> |
13
- | `@earendil-works/pi-coding-agent` | 0.85.1 | MIT | <https://github.com/earendil-works/pi> |
14
- | `@earendil-works/pi-tui` | 0.85.1 | MIT | <https://github.com/earendil-works/pi> |
11
+ | `@earendil-works/pi-agent-core` | 1.0.4 | MIT | <https://github.com/earendil-works/pi> |
12
+ | `@earendil-works/pi-ai` | 1.0.4 | MIT | <https://github.com/earendil-works/pi> |
13
+ | `@earendil-works/pi-coding-agent` | 1.0.4 | MIT | <https://github.com/earendil-works/pi> |
14
+ | `@earendil-works/pi-tui` | 1.0.4 | MIT | <https://github.com/earendil-works/pi> |
15
15
  | `typebox` | 1.3.7 | MIT | <https://github.com/sinclairzx81/typebox> |
16
16
 
17
17
  ## Development-only dependencies
18
18
 
19
- `@types/node` (MIT), TypeScript (Apache-2.0), and Vitest (MIT) are used to type-check and test the repository. They are not included in the SoL-Pi npm tarball. Exact versions and transitive dependency metadata are recorded in `package-lock.json`.
19
+ `@types/node` (MIT), TypeScript (Apache-2.0), and Vitest (MIT) are used to type-check and test the repository. They are not included in the SoL-Pi npm tarball. Exact versions and transitive dependency metadata are recorded in the monorepo root's `bun.lock`.
20
+
21
+ ## Star history chart generation
22
+
23
+ The upstream documentation workflow (not enabled in this monorepo) checks out the MIT-licensed [Star History renderer](https://github.com/star-history/star-history/tree/c326eac651bc5afb4cd40d354223dd419e1e2ae6) to preserve its chart design. Its source and dependencies are installed only for chart generation and are not included in the SoL-Pi npm tarball. The generated chart branch includes the upstream MIT license as `LICENSE-star-history.txt`.