pi-agent-ide 0.8.0 → 0.8.2

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 (508) hide show
  1. package/CHANGELOG.md +70 -40
  2. package/README.md +15 -8
  3. package/dist/{chunk-ICDI27GZ.js → chunk-235QMMVA.js} +1 -1
  4. package/dist/{chunk-N7LMRL64.js → chunk-47SPPIXK.js} +1 -1
  5. package/dist/chunk-4DIUPEDF.js +2 -0
  6. package/dist/{chunk-JMVDFOTQ.js → chunk-57F5GTHO.js} +1 -1
  7. package/dist/{chunk-NULNW6GK.js → chunk-6FGLAVPJ.js} +1 -1
  8. package/dist/{chunk-KL776TGR.js → chunk-6H32W35W.js} +1 -1
  9. package/dist/{chunk-QP2QSQ4U.js → chunk-6OJ565FL.js} +1 -1
  10. package/dist/{chunk-TWWND6NI.js → chunk-6R3Y4AD3.js} +1 -1
  11. package/dist/{chunk-CPZJPGLG.js → chunk-6T7PSDQW.js} +1 -1
  12. package/dist/{chunk-4OYVLXWD.js → chunk-6TJPMBUQ.js} +1 -1
  13. package/dist/{chunk-SBLKPTL3.js → chunk-6XFUICD7.js} +1 -1
  14. package/dist/chunk-7VSVJRRF.js +28 -0
  15. package/dist/{chunk-7JV4VN73.js → chunk-AAC77UD4.js} +1 -1
  16. package/dist/chunk-ANM3Y5FO.js +11 -0
  17. package/dist/chunk-BB4A5UI3.js +5 -0
  18. package/dist/{chunk-7TJ6DWW3.js → chunk-CPELC6JE.js} +1 -1
  19. package/dist/chunk-FTPC44FP.js +33 -0
  20. package/dist/{chunk-SBNR4WZF.js → chunk-GSOYVIQS.js} +1 -1
  21. package/dist/{chunk-Z3PGADVA.js → chunk-HSRH76JN.js} +1 -1
  22. package/dist/{chunk-CSXHCSTH.js → chunk-HSZ4AQ6L.js} +1 -1
  23. package/dist/chunk-I6NPILT5.js +1 -0
  24. package/dist/chunk-K7SRNBIV.js +1 -0
  25. package/dist/{chunk-R5XJSEOE.js → chunk-LCWBVOII.js} +3 -3
  26. package/dist/{chunk-MZXX353D.js → chunk-LEJKDYCK.js} +1 -1
  27. package/dist/{chunk-3G54ZL2L.js → chunk-NJ7C4KMA.js} +1 -1
  28. package/dist/{chunk-CTJV77FR.js → chunk-NUM3YQGK.js} +1 -1
  29. package/dist/chunk-OJEIX7OZ.js +1 -0
  30. package/dist/{chunk-EY65TFHJ.js → chunk-PJL3UVMJ.js} +1 -1
  31. package/dist/{chunk-E4HPRLRB.js → chunk-QT3EAHOG.js} +1 -1
  32. package/dist/{chunk-HCN5W76B.js → chunk-RIJMXO43.js} +1 -1
  33. package/dist/chunk-RMI3NMQY.js +23 -0
  34. package/dist/chunk-RQ7JJ7GV.js +4 -0
  35. package/dist/{chunk-4XPUN4QN.js → chunk-RVU73VKN.js} +1 -1
  36. package/dist/{chunk-OJX3RJ5A.js → chunk-RW2GTYQI.js} +1 -1
  37. package/dist/{chunk-PNP2KNGP.js → chunk-SDAH3ECM.js} +1 -1
  38. package/dist/chunk-SGQWRIRJ.js +10 -0
  39. package/dist/{chunk-IUSLSROY.js → chunk-SMIFCAAX.js} +1 -1
  40. package/dist/chunk-SWBJS3U4.js +1 -0
  41. package/dist/chunk-T7MWQQIF.js +3 -0
  42. package/dist/{chunk-RAZP42IQ.js → chunk-VAXLSPPU.js} +1 -1
  43. package/dist/{chunk-XZDOVPRC.js → chunk-VMTOFEXF.js} +1 -1
  44. package/dist/{chunk-7HDK3NRQ.js → chunk-VXP5BMW7.js} +1 -1
  45. package/dist/{chunk-WE42GBGU.js → chunk-XAHU42FP.js} +3 -3
  46. package/dist/{chunk-UBH6X3D3.js → chunk-XBQR74IK.js} +1 -1
  47. package/dist/{chunk-7NS3QUIE.js → chunk-XG7QNAKW.js} +1 -1
  48. package/dist/{chunk-GW6NZQTQ.js → chunk-XLWCSJMR.js} +1 -1
  49. package/dist/{chunk-2K65BSXS.js → chunk-XXLLY66B.js} +1 -1
  50. package/dist/chunk-YFP4P2FV.js +1 -0
  51. package/dist/{chunk-75SWXD2Z.js → chunk-YIXP2ALP.js} +1 -1
  52. package/dist/{chunk-MOJ5RR35.js → chunk-ZJQRLVVV.js} +1 -1
  53. package/dist/entry-0.js +1 -1
  54. package/dist/entry-1.js +1 -1
  55. package/dist/entry-10.js +1 -1
  56. package/dist/entry-11.js +1 -1
  57. package/dist/entry-12.js +1 -1
  58. package/dist/entry-13.js +1 -1
  59. package/dist/entry-14.js +1 -1
  60. package/dist/entry-15.js +1 -1
  61. package/dist/entry-16.js +1 -1
  62. package/dist/entry-17.js +1 -1
  63. package/dist/entry-18.js +1 -0
  64. package/dist/entry-19.js +1 -1
  65. package/dist/entry-2.js +1 -1
  66. package/dist/entry-20.js +1 -1
  67. package/dist/entry-22.js +1 -1
  68. package/dist/entry-23.js +1 -1
  69. package/dist/entry-24.js +1 -1
  70. package/dist/entry-25.js +1 -1
  71. package/dist/entry-26.js +1 -2
  72. package/dist/entry-27.js +1 -1
  73. package/dist/entry-28.js +1 -4
  74. package/dist/entry-29.js +2 -1
  75. package/dist/entry-3.js +1 -1
  76. package/dist/entry-30.js +1 -1
  77. package/dist/entry-31.js +4 -1
  78. package/dist/entry-32.js +1 -18
  79. package/dist/entry-33.js +1 -1
  80. package/dist/entry-34.js +1 -1
  81. package/dist/entry-35.js +18 -1
  82. package/dist/entry-36.js +1 -1
  83. package/dist/entry-37.js +1 -1
  84. package/dist/entry-38.js +1 -1
  85. package/dist/entry-39.js +1 -1
  86. package/dist/entry-4.js +1 -1
  87. package/dist/entry-40.js +1 -1
  88. package/dist/entry-41.js +1 -1
  89. package/dist/entry-42.js +1 -1
  90. package/dist/entry-43.js +1 -1
  91. package/dist/entry-44.js +1 -1
  92. package/dist/entry-45.js +1 -1
  93. package/dist/entry-46.js +1 -25
  94. package/dist/entry-47.js +1 -1
  95. package/dist/entry-48.js +1 -1
  96. package/dist/entry-49.js +25 -1
  97. package/dist/entry-5.js +1 -1
  98. package/dist/entry-50.js +1 -1
  99. package/dist/entry-51.js +1 -3
  100. package/dist/entry-52.js +1 -13
  101. package/dist/entry-53.js +1 -1
  102. package/dist/entry-54.js +3 -1
  103. package/dist/entry-55.js +13 -1
  104. package/dist/entry-56.js +1 -1
  105. package/dist/entry-57.js +1 -1
  106. package/dist/entry-58.js +1 -1
  107. package/dist/entry-59.js +1 -1
  108. package/dist/entry-6.js +1 -1
  109. package/dist/entry-60.js +1 -1
  110. package/dist/entry-61.js +1 -1
  111. package/dist/entry-62.js +1 -0
  112. package/dist/entry-63.js +1 -1
  113. package/dist/entry-64.js +1 -0
  114. package/dist/entry-65.js +0 -1
  115. package/dist/entry-66.js +1 -1
  116. package/dist/entry-67.js +0 -1
  117. package/dist/entry-68.js +1 -1
  118. package/dist/entry-69.js +1 -1
  119. package/dist/entry-7.js +1 -1
  120. package/dist/entry-70.js +1 -1
  121. package/dist/entry-71.js +1 -1
  122. package/dist/entry-72.js +1 -0
  123. package/dist/entry-73.js +1 -1
  124. package/dist/entry-74.js +1 -0
  125. package/dist/entry-75.js +0 -1
  126. package/dist/entry-76.js +1 -1
  127. package/dist/entry-77.js +0 -1
  128. package/dist/entry-78.js +1 -80
  129. package/dist/entry-79.js +1 -21
  130. package/dist/entry-8.js +1 -1
  131. package/dist/entry-80.js +1 -2
  132. package/dist/entry-81.js +80 -1
  133. package/dist/entry-82.js +22 -1
  134. package/dist/entry-83.js +2 -1
  135. package/dist/entry-84.js +1 -3
  136. package/dist/entry-85.js +1 -1
  137. package/dist/entry-86.js +1 -1
  138. package/dist/entry-87.js +1 -1
  139. package/dist/entry-88.js +3 -0
  140. package/dist/entry-89.js +1 -0
  141. package/dist/entry-9.js +1 -1
  142. package/dist/entry-90.js +1 -0
  143. package/dist/entry-91.js +1 -0
  144. package/dist/pi-agent-ide.js +53 -31
  145. package/docs/agent-guides/debugger.md +2 -0
  146. package/docs/agent-guides/editing.md +3 -3
  147. package/docs/agent-guides/search-code.md +5 -3
  148. package/docs/agent-guides/select-code.md +9 -6
  149. package/docs/agent-guides/ssh.md +1 -1
  150. package/docs/code-review.md +5 -0
  151. package/docs/configuration.md +52 -8
  152. package/docs/development.md +9 -13
  153. package/docs/directory-operations.md +1 -1
  154. package/docs/extensions.md +99 -2
  155. package/docs/releases.md +1 -1
  156. package/docs/settings-help.md +39 -0
  157. package/docs/structured-results.md +11 -6
  158. package/docs/tools.md +1 -0
  159. package/docs/user-hooks.md +4 -2
  160. package/node_modules/pi-agent-doctor/package.json +7 -10
  161. package/node_modules/pi-agent-doctor/runtime/entry-26.js +1 -0
  162. package/node_modules/pi-agent-doctor/runtime/entry-27.js +1 -0
  163. package/node_modules/pi-agent-documentation/package.json +2 -2
  164. package/node_modules/pi-agent-documentation/runtime/entry-28.js +1 -0
  165. package/node_modules/pi-agent-filesystem/package.json +8 -8
  166. package/node_modules/pi-agent-filesystem-image/package.json +4 -4
  167. package/node_modules/pi-agent-filesystem-jq/package.json +6 -7
  168. package/node_modules/pi-agent-filesystem-jq/runtime/entry-31.js +2 -0
  169. package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
  170. package/node_modules/pi-agent-filesystem-text/package.json +4 -4
  171. package/node_modules/pi-agent-filesystem-text/runtime/entry-33.js +2 -0
  172. package/node_modules/pi-agent-ide-ast/package.json +15 -41
  173. package/node_modules/pi-agent-ide-ast/runtime/entry-34.js +1 -0
  174. package/node_modules/pi-agent-ide-ast/src/select-schema.ts +6 -5
  175. package/node_modules/pi-agent-ide-changes/package.json +10 -11
  176. package/node_modules/pi-agent-ide-changes/runtime/entry-36.js +1 -0
  177. package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +6 -5
  178. package/node_modules/pi-agent-ide-formatter/package.json +4 -4
  179. package/node_modules/pi-agent-ide-languages/package.json +3 -3
  180. package/node_modules/pi-agent-ide-languages/runtime/entry-39.js +2 -0
  181. package/node_modules/pi-agent-ide-lint/package.json +8 -8
  182. package/node_modules/pi-agent-ide-lint/runtime/entry-40.js +2 -0
  183. package/node_modules/pi-agent-ide-lsp/package.json +10 -13
  184. package/node_modules/pi-agent-ide-lsp/runtime/entry-41.js +2 -0
  185. package/node_modules/pi-agent-image/package.json +3 -3
  186. package/node_modules/pi-agent-invariant/package.json +2 -2
  187. package/node_modules/pi-agent-pdf/package.json +3 -4
  188. package/node_modules/pi-agent-read/package.json +12 -12
  189. package/node_modules/pi-agent-read/runtime/entry-46.js +0 -1
  190. package/node_modules/pi-agent-read/runtime/entry-49.js +2 -0
  191. package/node_modules/pi-agent-resource/package.json +2 -2
  192. package/node_modules/pi-agent-resource/src/resource-error.ts +11 -0
  193. package/node_modules/pi-agent-resource/src/result-targets.ts +9 -0
  194. package/node_modules/pi-agent-search/package.json +9 -9
  195. package/node_modules/pi-agent-search/runtime/entry-51.js +0 -1
  196. package/node_modules/pi-agent-search/runtime/entry-52.js +1 -0
  197. package/node_modules/pi-agent-search/runtime/entry-54.js +2 -0
  198. package/node_modules/pi-agent-search/src/api/plugin-protocol.ts +1 -1
  199. package/node_modules/pi-agent-search/src/api/presentation.ts +10 -2
  200. package/node_modules/pi-agent-search/src/api/search-parameters.ts +6 -5
  201. package/node_modules/pi-agent-search/src/api/search.ts +7 -0
  202. package/node_modules/pi-agent-search/src/core/search-core.ts +23 -3
  203. package/node_modules/pi-agent-search-text/index.ts +2 -0
  204. package/node_modules/pi-agent-search-text/package.json +14 -14
  205. package/node_modules/pi-agent-search-text/runtime/entry-55.js +1 -0
  206. package/node_modules/pi-agent-search-text/runtime/entry-57.js +1 -0
  207. package/node_modules/pi-agent-search-text/src/search-backend.ts +18 -10
  208. package/node_modules/pi-agent-search-text/src/search-session.ts +68 -9
  209. package/node_modules/pi-agent-text/package.json +3 -3
  210. package/node_modules/pi-agent-text/runtime/entry-59.js +1 -0
  211. package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
  212. package/node_modules/pi-agent-text-anchor-constant/runtime/entry-60.js +2 -0
  213. package/node_modules/pi-agent-text-anchor-exact/package.json +5 -6
  214. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-61.js +1 -0
  215. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-62.js +2 -0
  216. package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
  217. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-64.js +2 -0
  218. package/node_modules/pi-agent-text-editor/index.ts +2 -0
  219. package/node_modules/pi-agent-text-editor/package.json +26 -34
  220. package/node_modules/pi-agent-text-editor/runtime/entry-78.js +0 -1
  221. package/node_modules/pi-agent-text-editor/runtime/entry-79.js +1 -0
  222. package/node_modules/pi-agent-text-editor/runtime/entry-80.js +1 -0
  223. package/node_modules/pi-agent-text-editor/runtime/entry-81.js +2 -0
  224. package/node_modules/pi-agent-text-editor/src/api/delete-guard.ts +1 -1
  225. package/node_modules/pi-agent-text-editor/src/api/edit-completion.ts +2 -0
  226. package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +5 -0
  227. package/node_modules/pi-agent-text-editor/src/api/native-edit-batch-event.ts +2 -2
  228. package/node_modules/pi-agent-text-editor/src/core/delete-policy.ts +6 -12
  229. package/node_modules/pi-agent-text-editor/src/core/extension.ts +4 -1
  230. package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +40 -11
  231. package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +2 -0
  232. package/node_modules/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +18 -9
  233. package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +29 -20
  234. package/node_modules/pi-agent-text-editor/src/core/temporary-directories.ts +13 -9
  235. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +16 -8
  236. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +118 -36
  237. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +7 -4
  238. package/node_modules/pi-agent-text-editor/src/core/text-edit-origin.ts +38 -0
  239. package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +106 -48
  240. package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +35 -14
  241. package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +22 -1
  242. package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +39 -44
  243. package/node_modules/pi-agent-text-editor/src/core/write-agent-result.ts +3 -1
  244. package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +1 -1
  245. package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +6 -5
  246. package/node_modules/pi-agent-text-editor-renderer/package.json +6 -8
  247. package/node_modules/pi-agent-text-editor-renderer/runtime/entry-82.js +2 -0
  248. package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +35 -2
  249. package/node_modules/pi-agent-text-editor-stale-anchor/index.ts +17 -0
  250. package/node_modules/pi-agent-text-editor-stale-anchor/package.json +6 -5
  251. package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
  252. package/node_modules/pi-agent-tool-call-interception/runtime/entry-84.js +1 -0
  253. package/node_modules/pi-agent-tool-ui/package.json +6 -2
  254. package/node_modules/pi-agent-tool-ui/runtime/entry-85.js +1 -0
  255. package/node_modules/pi-agent-tool-ui/runtime/entry-86.js +1 -0
  256. package/node_modules/pi-agent-tool-ui/src/operation-approval.ts +271 -0
  257. package/node_modules/pi-agent-web/package.json +8 -11
  258. package/node_modules/pi-agent-web-html/package.json +3 -5
  259. package/node_modules/pi-agent-web-html/runtime/entry-88.js +2 -0
  260. package/node_modules/pi-agent-web-image/package.json +4 -4
  261. package/node_modules/pi-agent-web-image/runtime/entry-89.js +2 -0
  262. package/node_modules/pi-agent-web-pdf/package.json +4 -4
  263. package/node_modules/pi-agent-web-pdf/runtime/entry-90.js +2 -0
  264. package/node_modules/pi-agent-web-text/package.json +4 -4
  265. package/node_modules/pi-agent-web-text/runtime/entry-91.js +2 -0
  266. package/package.json +65 -53
  267. package/skills/configure-agent-ide/SKILL.md +38 -0
  268. package/src/api/approval.ts +5 -0
  269. package/src/api/content.ts +6 -0
  270. package/src/api/settings.ts +198 -0
  271. package/src/api/tips.ts +3 -0
  272. package/src/backend/debugger-registration.ts +5 -1
  273. package/src/code-review/extension.ts +10 -4
  274. package/src/code-review/reviewer.ts +8 -0
  275. package/src/composite/host-version.ts +29 -5
  276. package/src/composite/ide-alias-rendering.ts +97 -0
  277. package/src/composite/nested-tool-rendering.ts +90 -9
  278. package/src/composite/preferences.ts +13 -0
  279. package/src/composite/search-facts.ts +45 -0
  280. package/src/composite/settings-documentation.ts +68 -0
  281. package/src/composite/settings-help.ts +106 -0
  282. package/src/composite/settings-registry.ts +94 -0
  283. package/src/composite/text-results.ts +170 -30
  284. package/src/composite/tool-availability.ts +11 -2
  285. package/src/core/diagnostic-entry.ts +31 -8
  286. package/src/core/diagnostic-store.ts +19 -3
  287. package/src/core/extension.ts +7 -2
  288. package/src/documentation/extension.ts +12 -0
  289. package/src/documentation/registry.ts +10 -2
  290. package/src/documentation/search.ts +166 -0
  291. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +8 -8
  292. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
  293. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +6 -7
  294. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-31.js +2 -0
  295. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
  296. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-32.js +2 -0
  297. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
  298. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-33.js +2 -0
  299. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-29.js +2 -0
  300. package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -11
  301. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -5
  302. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-88.js +2 -0
  303. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
  304. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-89.js +2 -0
  305. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
  306. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-90.js +2 -0
  307. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
  308. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-91.js +2 -0
  309. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-87.js +2 -0
  310. package/src/extensions/pi-agent-read/package.json +12 -12
  311. package/src/extensions/pi-agent-read/runtime/entry-46.js +0 -1
  312. package/src/extensions/pi-agent-read/runtime/entry-47.js +1 -0
  313. package/src/extensions/pi-agent-read/runtime/entry-49.js +2 -0
  314. package/src/extensions/pi-agent-search/package.json +9 -9
  315. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +2 -0
  316. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +14 -14
  317. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-55.js +1 -0
  318. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-56.js +1 -0
  319. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-57.js +1 -0
  320. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +18 -10
  321. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +68 -9
  322. package/src/extensions/pi-agent-search/runtime/entry-51.js +0 -1
  323. package/src/extensions/pi-agent-search/runtime/entry-52.js +1 -0
  324. package/src/extensions/pi-agent-search/runtime/entry-53.js +1 -0
  325. package/src/extensions/pi-agent-search/runtime/entry-54.js +2 -0
  326. package/src/extensions/pi-agent-search/src/api/plugin-protocol.ts +1 -1
  327. package/src/extensions/pi-agent-search/src/api/presentation.ts +10 -2
  328. package/src/extensions/pi-agent-search/src/api/search-parameters.ts +6 -5
  329. package/src/extensions/pi-agent-search/src/api/search.ts +7 -0
  330. package/src/extensions/pi-agent-search/src/core/search-core.ts +23 -3
  331. package/src/extensions/pi-agent-text-editor/index.ts +2 -0
  332. package/src/extensions/pi-agent-text-editor/package.json +26 -34
  333. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
  334. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-60.js +2 -0
  335. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -6
  336. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-61.js +1 -0
  337. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-62.js +2 -0
  338. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
  339. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-63.js +1 -0
  340. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-64.js +2 -0
  341. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -8
  342. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-82.js +2 -0
  343. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +35 -2
  344. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/index.ts +17 -0
  345. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +6 -5
  346. package/src/extensions/pi-agent-text-editor/runtime/entry-78.js +0 -1
  347. package/src/extensions/pi-agent-text-editor/runtime/entry-79.js +1 -0
  348. package/src/extensions/pi-agent-text-editor/runtime/entry-80.js +1 -0
  349. package/src/extensions/pi-agent-text-editor/runtime/entry-81.js +2 -0
  350. package/src/extensions/pi-agent-text-editor/src/api/delete-guard.ts +1 -1
  351. package/src/extensions/pi-agent-text-editor/src/api/edit-completion.ts +2 -0
  352. package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +5 -0
  353. package/src/extensions/pi-agent-text-editor/src/api/native-edit-batch-event.ts +2 -2
  354. package/src/extensions/pi-agent-text-editor/src/core/delete-policy.ts +6 -12
  355. package/src/extensions/pi-agent-text-editor/src/core/extension.ts +4 -1
  356. package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +40 -11
  357. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +2 -0
  358. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +18 -9
  359. package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +29 -20
  360. package/src/extensions/pi-agent-text-editor/src/core/temporary-directories.ts +13 -9
  361. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +16 -8
  362. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +118 -36
  363. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +7 -4
  364. package/src/extensions/pi-agent-text-editor/src/core/text-edit-origin.ts +38 -0
  365. package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +106 -48
  366. package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +35 -14
  367. package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +22 -1
  368. package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +39 -44
  369. package/src/extensions/pi-agent-text-editor/src/core/write-agent-result.ts +3 -1
  370. package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +1 -1
  371. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +6 -5
  372. package/src/pi-agent-ide.ts +74 -15
  373. package/src/plugins/pi-agent-ide-ast/package.json +15 -41
  374. package/src/plugins/pi-agent-ide-ast/runtime/entry-34.js +1 -0
  375. package/src/plugins/pi-agent-ide-ast/src/select-schema.ts +6 -5
  376. package/src/plugins/pi-agent-ide-changes/package.json +10 -11
  377. package/src/plugins/pi-agent-ide-changes/runtime/entry-36.js +1 -0
  378. package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +6 -5
  379. package/src/plugins/pi-agent-ide-debugger/index.ts +158 -55
  380. package/src/plugins/pi-agent-ide-debugger/src/debugmcp-client.ts +118 -0
  381. package/src/plugins/pi-agent-ide-debugger/src/doctor-plugin.ts +47 -0
  382. package/src/plugins/pi-agent-ide-debugger/src/renderer.ts +2 -0
  383. package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +146 -1
  384. package/src/plugins/pi-agent-ide-debugger/src/ui.ts +12 -0
  385. package/src/plugins/pi-agent-ide-debugger/src/vscode-backend.ts +497 -0
  386. package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
  387. package/src/plugins/pi-agent-ide-languages/package.json +3 -3
  388. package/src/plugins/pi-agent-ide-languages/runtime/entry-39.js +2 -0
  389. package/src/plugins/pi-agent-ide-lint/package.json +8 -8
  390. package/src/plugins/pi-agent-ide-lint/runtime/entry-40.js +2 -0
  391. package/src/plugins/pi-agent-ide-lsp/package.json +10 -13
  392. package/src/plugins/pi-agent-ide-lsp/runtime/entry-41.js +2 -0
  393. package/src/plugins/pi-agent-ide-terminal/index.ts +2 -0
  394. package/src/plugins/pi-agent-ide-terminal/src/origin.ts +30 -0
  395. package/src/plugins/pi-agent-ide-terminal/src/session-manager.ts +34 -0
  396. package/src/plugins/pi-agent-ide-terminal/src/tools.ts +11 -2
  397. package/src/plugins/pi-agent-ide-terminal/src/types.ts +9 -0
  398. package/src/plugins/pi-agent-ide-terminal/src/ui.ts +72 -26
  399. package/src/tips/core.ts +5 -2
  400. package/src/tips/extension.ts +30 -2
  401. package/src/tips/persistence.ts +29 -27
  402. package/src/tips/setup-hint.ts +19 -0
  403. package/dist/chunk-3ZGDMTMD.js +0 -25
  404. package/dist/chunk-5KFVDYCI.js +0 -1
  405. package/dist/chunk-ABFCAOU5.js +0 -1
  406. package/dist/chunk-BIG45IPN.js +0 -2
  407. package/dist/chunk-BMOJTJJJ.js +0 -3
  408. package/dist/chunk-BQ67M4NC.js +0 -3
  409. package/dist/chunk-IH5NW5JX.js +0 -11
  410. package/dist/chunk-NRZO5KJT.js +0 -9
  411. package/dist/chunk-O36UC74T.js +0 -1
  412. package/dist/chunk-OLI3JPHJ.js +0 -28
  413. package/dist/chunk-SSWUUBIR.js +0 -1
  414. package/dist/chunk-UUJJRXHG.js +0 -29
  415. package/dist/entry-21.js +0 -1
  416. package/docs/research/apply-native-capability-matrix.md +0 -174
  417. package/docs/research/apply-read-latency.md +0 -221
  418. package/docs/research/codemode-write-context.md +0 -56
  419. package/docs/research/lpt-393-fuzzy-results/file.json +0 -152
  420. package/docs/research/lpt-393-fuzzy-results/repo.json +0 -122
  421. package/docs/research/lpt-393-search-fuzzy-fallback.md +0 -97
  422. package/docs/research/native-codemode-batch-decision.md +0 -31
  423. package/docs/research/native-codemode-batching.md +0 -65
  424. package/node_modules/pi-agent-doctor/runtime/entry-19.js +0 -1
  425. package/node_modules/pi-agent-doctor/runtime/entry-20.js +0 -1
  426. package/node_modules/pi-agent-doctor/runtime/entry-21.js +0 -1
  427. package/node_modules/pi-agent-filesystem/runtime/entry-26.js +0 -2
  428. package/node_modules/pi-agent-filesystem-image/runtime/entry-27.js +0 -2
  429. package/node_modules/pi-agent-filesystem-jq/runtime/entry-28.js +0 -2
  430. package/node_modules/pi-agent-ide-ast/runtime/entry-31.js +0 -1
  431. package/node_modules/pi-agent-ide-changes/runtime/entry-33.js +0 -1
  432. package/node_modules/pi-agent-ide-changes/runtime/entry-34.js +0 -2
  433. package/node_modules/pi-agent-ide-languages/runtime/entry-36.js +0 -2
  434. package/node_modules/pi-agent-image/runtime/entry-39.js +0 -1
  435. package/node_modules/pi-agent-invariant/runtime/entry-40.js +0 -1
  436. package/node_modules/pi-agent-pdf/runtime/entry-41.js +0 -1
  437. package/node_modules/pi-agent-search/runtime/entry-49.js +0 -1
  438. package/node_modules/pi-agent-search-text/runtime/entry-52.js +0 -2
  439. package/node_modules/pi-agent-search-text/runtime/entry-54.js +0 -1
  440. package/node_modules/pi-agent-text-anchor-constant/runtime/entry-57.js +0 -2
  441. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-59.js +0 -2
  442. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-60.js +0 -1
  443. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-61.js +0 -2
  444. package/node_modules/pi-agent-text-editor/runtime/entry-62.js +0 -1
  445. package/node_modules/pi-agent-text-editor/runtime/entry-64.js +0 -1
  446. package/node_modules/pi-agent-text-editor-renderer/runtime/entry-79.js +0 -2
  447. package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-80.js +0 -2
  448. package/node_modules/pi-agent-tool-call-interception/runtime/entry-81.js +0 -1
  449. package/node_modules/pi-agent-tool-ui/runtime/entry-82.js +0 -1
  450. package/node_modules/pi-agent-web-html/runtime/entry-84.js +0 -2
  451. package/node_modules/pi-agent-web-image/runtime/entry-85.js +0 -2
  452. package/node_modules/pi-agent-web-pdf/runtime/entry-86.js +0 -2
  453. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-27.js +0 -2
  454. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-28.js +0 -2
  455. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-29.js +0 -2
  456. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-26.js +0 -2
  457. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-84.js +0 -2
  458. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-85.js +0 -2
  459. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-86.js +0 -2
  460. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-87.js +0 -2
  461. package/src/extensions/pi-agent-read/runtime/entry-42.js +0 -1
  462. package/src/extensions/pi-agent-read/runtime/entry-43.js +0 -1
  463. package/src/extensions/pi-agent-read/runtime/entry-44.js +0 -1
  464. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-52.js +0 -2
  465. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-53.js +0 -1
  466. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-54.js +0 -1
  467. package/src/extensions/pi-agent-search/runtime/entry-49.js +0 -1
  468. package/src/extensions/pi-agent-search/runtime/entry-50.js +0 -1
  469. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-57.js +0 -2
  470. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-59.js +0 -2
  471. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-60.js +0 -1
  472. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-61.js +0 -2
  473. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-79.js +0 -2
  474. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-80.js +0 -2
  475. package/src/extensions/pi-agent-text-editor/runtime/entry-62.js +0 -1
  476. package/src/extensions/pi-agent-text-editor/runtime/entry-63.js +0 -1
  477. package/src/extensions/pi-agent-text-editor/runtime/entry-64.js +0 -1
  478. package/src/plugins/pi-agent-ide-ast/runtime/entry-31.js +0 -1
  479. package/src/plugins/pi-agent-ide-ast/runtime/entry-32.js +0 -2
  480. package/src/plugins/pi-agent-ide-changes/runtime/entry-33.js +0 -1
  481. package/src/plugins/pi-agent-ide-changes/runtime/entry-34.js +0 -2
  482. package/src/plugins/pi-agent-ide-languages/runtime/entry-36.js +0 -2
  483. /package/node_modules/{pi-agent-documentation → pi-agent-doctor}/runtime/entry-25.js +0 -0
  484. /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem}/runtime/entry-29.js +0 -0
  485. /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-image}/runtime/entry-30.js +0 -0
  486. /package/node_modules/{pi-agent-ide-ast → pi-agent-filesystem-pdf}/runtime/entry-32.js +0 -0
  487. /package/node_modules/{pi-agent-ide-formatter → pi-agent-ide-ast}/runtime/entry-35.js +0 -0
  488. /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-changes}/runtime/entry-37.js +0 -0
  489. /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-formatter}/runtime/entry-38.js +0 -0
  490. /package/node_modules/{pi-agent-read → pi-agent-image}/runtime/entry-42.js +0 -0
  491. /package/node_modules/{pi-agent-read → pi-agent-invariant}/runtime/entry-43.js +0 -0
  492. /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-44.js +0 -0
  493. /package/node_modules/{pi-agent-resource → pi-agent-read}/runtime/entry-47.js +0 -0
  494. /package/node_modules/{pi-agent-search → pi-agent-read}/runtime/entry-48.js +0 -0
  495. /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-50.js +0 -0
  496. /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-53.js +0 -0
  497. /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-56.js +0 -0
  498. /package/node_modules/{pi-agent-text-anchor-exact → pi-agent-search-text}/runtime/entry-58.js +0 -0
  499. /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-line-hash}/runtime/entry-63.js +0 -0
  500. /package/node_modules/{pi-agent-web → pi-agent-text-editor-stale-anchor}/runtime/entry-83.js +0 -0
  501. /package/node_modules/{pi-agent-web-text → pi-agent-web}/runtime/entry-87.js +0 -0
  502. /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-image}/runtime/entry-30.js +0 -0
  503. /package/src/extensions/{pi-agent-search → pi-agent-read}/runtime/entry-48.js +0 -0
  504. /package/src/extensions/{pi-agent-text-editor/plugins/pi-agent-text-anchor-exact → pi-agent-search/plugins/pi-agent-search-text}/runtime/entry-58.js +0 -0
  505. /package/src/extensions/{pi-agent-read/extensions/pi-agent-web → pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor}/runtime/entry-83.js +0 -0
  506. /package/src/plugins/{pi-agent-ide-formatter → pi-agent-ide-ast}/runtime/entry-35.js +0 -0
  507. /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-changes}/runtime/entry-37.js +0 -0
  508. /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-formatter}/runtime/entry-38.js +0 -0
@@ -0,0 +1,198 @@
1
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
+
3
+ /** Metadata shared by external settings and the built-in Agent IDE settings menu. */
4
+ interface SettingBase {
5
+ readonly id: string;
6
+ readonly name: string;
7
+ readonly description: string;
8
+ readonly group?: "features" | "ui";
9
+ }
10
+
11
+ /** Boolean settings use flags storage; choice and text settings use preferences storage. */
12
+ export type AgentIdeSetting =
13
+ | (SettingBase & {
14
+ readonly kind: "boolean";
15
+ readonly default: boolean;
16
+ readonly labels?: { readonly on: string; readonly off: string };
17
+ })
18
+ | (SettingBase & {
19
+ readonly kind: "choice";
20
+ readonly default: string;
21
+ readonly values: readonly { readonly value: string; readonly label: string }[];
22
+ })
23
+ | (SettingBase & {
24
+ readonly kind: "text";
25
+ readonly default: string;
26
+ readonly placeholder?: string;
27
+ });
28
+
29
+ /** A saved override includes explicit false; Default removes the selected scope's key. */
30
+ export interface AgentIdeSettingValue {
31
+ readonly value: boolean | string;
32
+ readonly overridden: boolean;
33
+ }
34
+
35
+ export const SETTINGS_REGISTER_EVENT = "pi-agent-ide/settings/register/v1";
36
+ export const SETTINGS_READ_EVENT = "pi-agent-ide/settings/read/v1";
37
+ export const SETTINGS_READY_EVENT = "pi-agent-ide/settings/ready/v1";
38
+
39
+ /** Synchronous acceptance keeps extension-registration errors visible to their caller. */
40
+ export interface SettingsRegistration {
41
+ readonly owner: string;
42
+ readonly definitions: readonly AgentIdeSetting[];
43
+ accept(error?: Error): void;
44
+ }
45
+
46
+ /** Reads resolve through the host so external packages do not duplicate storage policy. */
47
+ export interface SettingsReadRequest {
48
+ readonly id: string;
49
+ readonly cwd: string;
50
+ accept(result: Promise<AgentIdeSettingValue>): void;
51
+ }
52
+
53
+ /**
54
+ * Register once per extension runtime, before or after Agent IDE loads.
55
+ * IDs are unique across owners. Invalid metadata and duplicate IDs are errors.
56
+ * Boolean registrations add menu settings, not command-line flags.
57
+ */
58
+ export function registerAgentIdeSettings(
59
+ pi: Pick<ExtensionAPI, "events" | "on">,
60
+ owner: string,
61
+ definitions: readonly AgentIdeSetting[],
62
+ ): void {
63
+ validateAgentIdeSettings(owner, definitions);
64
+ const snapshot = definitions.map((definition) =>
65
+ Object.freeze({
66
+ ...definition,
67
+ ...(definition.kind === "choice"
68
+ ? { values: Object.freeze(definition.values.map((value) => Object.freeze({ ...value }))) }
69
+ : {}),
70
+ ...(definition.kind === "boolean" && definition.labels
71
+ ? { labels: Object.freeze({ ...definition.labels }) }
72
+ : {}),
73
+ }),
74
+ ) as readonly AgentIdeSetting[];
75
+ const announce = (): boolean => {
76
+ let accepted = false;
77
+ let error: Error | undefined;
78
+ pi.events.emit(SETTINGS_REGISTER_EVENT, {
79
+ owner,
80
+ definitions: snapshot,
81
+ accept(failure) {
82
+ if (accepted) throw new Error("Settings registration was accepted twice");
83
+ accepted = true;
84
+ error = failure;
85
+ },
86
+ } satisfies SettingsRegistration);
87
+ if (error) throw error;
88
+ return accepted;
89
+ };
90
+ let unsubscribe = pi.events.on(SETTINGS_READY_EVENT, () => {
91
+ if (!announce())
92
+ throw new Error("Agent IDE settings announced readiness without accepting registration");
93
+ unsubscribe();
94
+ });
95
+ pi.on("session_shutdown", unsubscribe);
96
+ if (announce()) unsubscribe();
97
+ }
98
+
99
+ /** Read saved effective configuration for this cwd; unavailable services and unknown IDs fail. */
100
+ export async function readAgentIdeSetting(
101
+ events: Pick<ExtensionAPI["events"], "emit">,
102
+ id: string,
103
+ cwd: string,
104
+ ): Promise<AgentIdeSettingValue> {
105
+ let result: Promise<AgentIdeSettingValue> | undefined;
106
+ events.emit(SETTINGS_READ_EVENT, {
107
+ id,
108
+ cwd,
109
+ accept(value) {
110
+ if (result !== undefined) throw new Error("Settings read was accepted twice");
111
+ result = value;
112
+ },
113
+ } satisfies SettingsReadRequest);
114
+ if (result === undefined) throw new Error("Agent IDE settings service is unavailable");
115
+ return result;
116
+ }
117
+
118
+ /** Validate a complete batch before it claims any setting IDs. */
119
+ export function validateAgentIdeSettings(
120
+ owner: unknown,
121
+ definitions: unknown,
122
+ ): asserts definitions is readonly AgentIdeSetting[] {
123
+ if (typeof owner !== "string" || owner.trim().length === 0)
124
+ throw new Error("Settings owner must be non-empty");
125
+ if (!Array.isArray(definitions)) throw new Error("Settings definitions must be an array");
126
+ const batch: readonly unknown[] = definitions;
127
+ const ids = new Set<string>();
128
+ for (const value of batch) {
129
+ const setting = settingRecord(value);
130
+ const id = setting.id;
131
+ if (typeof id !== "string" || !/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/u.test(id) || id === "preset")
132
+ throw new Error("Invalid setting ID");
133
+ if (ids.has(id)) throw new Error(`Duplicate setting ID: ${id}`);
134
+ ids.add(id);
135
+ if (
136
+ typeof setting.name !== "string" ||
137
+ !setting.name.trim() ||
138
+ typeof setting.description !== "string" ||
139
+ !setting.description.trim()
140
+ )
141
+ throw new Error(`Setting ${id} needs a name and description`);
142
+ if (setting.group !== undefined && setting.group !== "features" && setting.group !== "ui")
143
+ throw new Error(`Invalid setting group: ${id}`);
144
+ if (setting.kind === "boolean") {
145
+ if (typeof setting.default !== "boolean") throw new Error(`Invalid boolean default: ${id}`);
146
+ if (setting.labels !== undefined) {
147
+ const labels = settingRecord(setting.labels);
148
+ if (
149
+ typeof labels.on !== "string" ||
150
+ typeof labels.off !== "string" ||
151
+ !labels.on.trim() ||
152
+ !labels.off.trim() ||
153
+ labels.on === labels.off ||
154
+ labels.on === "default" ||
155
+ labels.off === "default"
156
+ )
157
+ throw new Error(`Invalid boolean labels: ${id}`);
158
+ }
159
+ } else if (setting.kind === "text" || setting.kind === "choice") {
160
+ if (typeof setting.default !== "string") throw new Error(`Invalid string default: ${id}`);
161
+ if (
162
+ setting.kind === "text" &&
163
+ setting.placeholder !== undefined &&
164
+ typeof setting.placeholder !== "string"
165
+ )
166
+ throw new Error(`Invalid text placeholder: ${id}`);
167
+ if (setting.kind === "choice") {
168
+ const values = new Set<string>();
169
+ const labels = new Set<string>();
170
+ if (!Array.isArray(setting.values) || setting.values.length === 0)
171
+ throw new Error(`Missing setting choices: ${id}`);
172
+ const choices: readonly unknown[] = setting.values;
173
+ for (const value of choices) {
174
+ const choice = settingRecord(value);
175
+ if (
176
+ typeof choice.value !== "string" ||
177
+ !choice.value ||
178
+ typeof choice.label !== "string" ||
179
+ !choice.label.trim() ||
180
+ choice.label === "default" ||
181
+ values.has(choice.value) ||
182
+ labels.has(choice.label)
183
+ )
184
+ throw new Error(`Invalid setting choices: ${id}`);
185
+ values.add(choice.value);
186
+ labels.add(choice.label);
187
+ }
188
+ if (!values.has(setting.default)) throw new Error(`Invalid choice default: ${id}`);
189
+ }
190
+ } else throw new Error(`Unknown setting type: ${id}`);
191
+ }
192
+ }
193
+
194
+ function settingRecord(value: unknown): Record<string, unknown> {
195
+ if (typeof value !== "object" || value === null || Array.isArray(value))
196
+ throw new Error("Invalid setting metadata");
197
+ return value as Record<string, unknown>;
198
+ }
package/src/api/tips.ts CHANGED
@@ -26,6 +26,9 @@ export interface Tip {
26
26
  readonly id: string;
27
27
  readonly title: string;
28
28
  readonly body: string;
29
+
30
+ /** Remembers the tip for this project by default, or across the installation. */
31
+ readonly scope?: "project" | "global";
29
32
  }
30
33
 
31
34
  /** Independent provider of an optional startup tip. */
@@ -29,6 +29,10 @@ export function createSshDebuggerAccess(registry: SshBackendRegistry): DebuggerW
29
29
  throw new SshBackendError("UNSUPPORTED_SOURCE", input.program, "not-applied");
30
30
  return undefined;
31
31
  }
32
+ const adapter = input.adapter;
33
+ if (adapter === undefined) {
34
+ throw new Error("Select an adapter: SSH workspaces use the native debugger backend");
35
+ }
32
36
  const program = registry.resolve(input.program, cwd.location.source);
33
37
  const source = registry.resolve(input.source ?? input.program, cwd.location.source);
34
38
  if (
@@ -42,7 +46,7 @@ export function createSshDebuggerAccess(registry: SshBackendRegistry): DebuggerW
42
46
  if (source.location.source !== program.location.source)
43
47
  await source.backend.stat(source.location.path, { signal });
44
48
  return {
45
- adapter: input.adapter,
49
+ adapter,
46
50
  program: program.location.source,
47
51
  sourceFile: source.location.source,
48
52
  cwd: cwd.location.source,
@@ -33,7 +33,12 @@ export default async function registerCodeReview(pi: ExtensionAPI): Promise<void
33
33
  customType: "ide-code-review",
34
34
  content: notice.text,
35
35
  display: true,
36
- details: { kind: notice.kind },
36
+ details: {
37
+ kind: notice.kind,
38
+ ...(notice.parentToolCallId === undefined
39
+ ? {}
40
+ : { parentToolCallId: notice.parentToolCallId }),
41
+ },
37
42
  },
38
43
  { triggerTurn: notice.kind === "findings", deliverAs: "steer" },
39
44
  ),
@@ -47,9 +52,7 @@ export default async function registerCodeReview(pi: ExtensionAPI): Promise<void
47
52
  });
48
53
  pi.on("before_agent_start", (event) => {
49
54
  if (pi.getFlag("pi-agent-ide-code-review-capture") !== true) return;
50
- return {
51
- systemPrompt: `${event.systemPrompt}\n\nJev rule capture: enabled. Use the capture-code-review-rule skill when the user gives a reusable code-review requirement. Propose the rule and wait for confirmation before saving it to ${REVIEW_RULES_PATH}.`,
52
- };
55
+ event.systemPromptOptions.sections.ide_rule_capture = `Jev rule capture: enabled. Use the capture-code-review-rule skill when the user gives a reusable code-review requirement. Propose the rule and wait for confirmation before saving it to ${REVIEW_RULES_PATH}.`;
53
56
  });
54
57
  pi.registerMessageRenderer("ide-code-review", (message, options, theme) => {
55
58
  const content =
@@ -97,6 +100,9 @@ export default async function registerCodeReview(pi: ExtensionAPI): Promise<void
97
100
  cwd: completion.cwd,
98
101
  before,
99
102
  after: completion.after.content,
103
+ ...(completion.parentToolCallId === undefined
104
+ ? {}
105
+ : { parentToolCallId: completion.parentToolCallId }),
100
106
  }),
101
107
  );
102
108
  });
@@ -21,6 +21,8 @@ export interface ReviewRuntime {
21
21
 
22
22
  /** Saved snapshots from the edit-completion boundary, after formatting. */
23
23
  export interface ReviewEdit {
24
+ /** Real visible execution owning this saved version; absent for external edits. */
25
+ readonly parentToolCallId?: string;
24
26
  readonly file: string;
25
27
  readonly cwd: string;
26
28
  readonly before: string;
@@ -29,6 +31,8 @@ export interface ReviewEdit {
29
31
 
30
32
  /** Advisory output: failures and missing context are never a successful clean check. */
31
33
  export interface ReviewNotice {
34
+ /** Same visible owner as the checked saved version, never the delivery-time call. */
35
+ readonly parentToolCallId?: string;
32
36
  readonly kind: "findings" | "incomplete" | "unavailable";
33
37
  readonly text: string;
34
38
  }
@@ -149,12 +153,16 @@ export function createCodeReview(
149
153
  const snapshot = createHash("sha256").update(edit.after).digest("hex").slice(0, 12);
150
154
  dependencies.report({
151
155
  kind: hasFindings ? "findings" : "incomplete",
156
+ ...(edit.parentToolCallId === undefined ? {} : { parentToolCallId: edit.parentToolCallId }),
152
157
  text: `Jev code review: ${edit.file}\nSnapshot: ${snapshot}; model: ${model.provider}/${model.id}\nTreat classifications as review hints, not proven defects.${tokens ? `\nClassifier usage: ${tokens} tokens; $${cost.toFixed(6)}.` : ""}\n${sections.join("\n\n")}${incomplete ? "\nSome rules could not be decided from this fragment. This is not a clean review." : ""}`,
153
158
  });
154
159
  } catch (error) {
155
160
  if (await fresh(job))
156
161
  dependencies.report({
157
162
  kind: "unavailable",
163
+ ...(edit.parentToolCallId === undefined
164
+ ? {}
165
+ : { parentToolCallId: edit.parentToolCallId }),
158
166
  text: `Jev code review unavailable: ${edit.file}\n${error instanceof Error ? error.message : String(error)}\nThe edit remains saved. This is not a clean review.`,
159
167
  });
160
168
  } finally {
@@ -1,13 +1,37 @@
1
1
  /** Rejects older or unknown hosts before registering IDE capabilities. Star peers describe host ownership, not compatibility. */
2
2
  export function assertSupportedHost(version: string): void {
3
3
  const match = /^(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/u.exec(version);
4
- const minimum = [0, 99, 1];
5
- const parts = match?.slice(1, 4).map(Number);
6
- const difference =
7
- parts?.map((part, index) => part - (minimum[index] ?? 0)).find((part) => part !== 0) ?? 0;
8
- if (match === null || difference < 0 || (difference === 0 && match[4] !== undefined)) {
4
+ if (
5
+ match === null ||
6
+ compareVersion(match, [0, 99, 1]) < 0 ||
7
+ isPrereleaseOf(match, [0, 99, 1])
8
+ ) {
9
9
  throw new Error(
10
10
  `Pi Agent IDE requires Pi 0.99.1 or newer; this host is ${version}. Update Pi before loading the extension.`,
11
11
  );
12
12
  }
13
13
  }
14
+
15
+ /**
16
+ * Pi 1.3.0 and newer restore a resumed session's tools from its transcript and apply defaultTools
17
+ * and CLI `+name`/`-name` selections before extensions start, so the IDE must not reapply them.
18
+ */
19
+ export function hostOwnsToolLoadout(version: string): boolean {
20
+ const match = /^(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z.-]+)?/u.exec(version);
21
+ return (
22
+ match !== null && compareVersion(match, [1, 3, 0]) >= 0 && !isPrereleaseOf(match, [1, 3, 0])
23
+ );
24
+ }
25
+
26
+ function compareVersion(match: RegExpExecArray, target: readonly number[]): number {
27
+ return (
28
+ match
29
+ .slice(1, 4)
30
+ .map((part, index) => Number(part) - (target[index] ?? 0))
31
+ .find((part) => part !== 0) ?? 0
32
+ );
33
+ }
34
+
35
+ function isPrereleaseOf(match: RegExpExecArray, target: readonly number[]): boolean {
36
+ return compareVersion(match, target) === 0 && match[4] !== undefined;
37
+ }
@@ -0,0 +1,97 @@
1
+ import { isDeepStrictEqual } from "node:util";
2
+ import {
3
+ createCodemodeExtension,
4
+ type ExtensionAPI,
5
+ type ToolDefinition,
6
+ type ToolRenderers,
7
+ } from "@earendil-works/pi-coding-agent";
8
+
9
+ /**
10
+ * Preserve native IDE contracts and presentation for matching local MCP forwarding aliases.
11
+ * Unnamespaced aliases opt into this contract by copying one IDE tool's description and schema.
12
+ * Local wrappers with conflicting behavior must not advertise that same contract.
13
+ * Load IDE before the alias owner: Pi keeps the first extension's executable definition.
14
+ * Builtin Codemode aliases reuse Pi's shipped renderer only; execution and custom renderer overrides
15
+ * are not captured or replaced.
16
+ */
17
+ export function registerIdeAliasCompatibility(
18
+ pi: ExtensionAPI,
19
+ definitions: ReadonlyMap<string, ToolDefinition>,
20
+ ): (name: string) => string | undefined {
21
+ const source = (name: string): string | undefined => {
22
+ if (!name.startsWith("mcp__")) return undefined;
23
+ const tools = pi.getAllTools();
24
+ const alias = tools.find((tool) => tool.name === name);
25
+ // Real MCP servers own their namespace. A matching suffix alone proves nothing.
26
+ if (!alias || alias.namespace || alias.exposure === "hidden") return undefined;
27
+ const matches = tools.filter(
28
+ (tool) =>
29
+ ((definitions.has(tool.name) && tool.namespace?.name.startsWith("ide_") === true) ||
30
+ (tool.name === "codemode" &&
31
+ tool.sourceInfo.source === "builtin" &&
32
+ tool.sourceInfo.path === "builtin:codemode")) &&
33
+ tool.exposure !== "hidden" &&
34
+ tool.description === alias.description &&
35
+ isDeepStrictEqual(tool.parameters, alias.parameters),
36
+ );
37
+ return matches.length === 1 ? matches[0]?.name : undefined;
38
+ };
39
+ let codemodeRenderers: ToolRenderers | undefined;
40
+ pi.registerToolRenderer((name, next) => {
41
+ const native = source(name);
42
+ if (native !== "codemode") return native === undefined ? next() : definitions.get(native);
43
+ if (!codemodeRenderers) {
44
+ // Capture Pi's shipped presentation through its public factory, never its execution/ownership.
45
+ // The factory only registers a definition; none of its executor/settings closures run here.
46
+ void createCodemodeExtension()({
47
+ ...pi,
48
+ registerTool: (definition) => {
49
+ const { renderShell, renderCall, renderResult } = definition as ToolDefinition;
50
+ codemodeRenderers = { renderShell, renderCall, renderResult };
51
+ },
52
+ });
53
+ }
54
+ return codemodeRenderers ?? next();
55
+ });
56
+ pi.on("before_agent_start", () => {
57
+ for (const alias of pi.getAllTools()) {
58
+ const native = source(alias.name);
59
+ const definition = native === undefined ? undefined : definitions.get(native);
60
+ if (!definition) continue;
61
+ const descriptors = Object.getOwnPropertyDescriptors(definition);
62
+ // Preserve live metadata getters and outputSchema, but keep the alias's exposure and identity.
63
+ delete descriptors.namespace;
64
+ descriptors.name = {
65
+ value: alias.name,
66
+ enumerable: true,
67
+ configurable: true,
68
+ writable: true,
69
+ };
70
+ descriptors.exposure = {
71
+ value: alias.exposure,
72
+ enumerable: true,
73
+ configurable: true,
74
+ writable: true,
75
+ };
76
+ const execute: ToolDefinition["execute"] = async (_id, args, signal, onUpdate, ctx) => {
77
+ const { result, isError } = await ctx.executeTool(definition.name, args, {
78
+ signal,
79
+ onUpdate,
80
+ });
81
+ // Pi already charges nested usage to the parent call.
82
+ const { usage: _nestedUsage, ...own } = result;
83
+ return { ...own, isError };
84
+ };
85
+ descriptors.execute = {
86
+ value: execute,
87
+ enumerable: true,
88
+ configurable: true,
89
+ writable: true,
90
+ };
91
+ const forwarded = Object.defineProperties({}, descriptors) as ToolDefinition;
92
+ // Same-name registration preserves activation; do not enable an inactive source or alias.
93
+ pi.registerTool(forwarded);
94
+ }
95
+ });
96
+ return source;
97
+ }
@@ -4,13 +4,14 @@ import {
4
4
  type ToolDefinition,
5
5
  type AgentToolResult,
6
6
  } from "@earendil-works/pi-coding-agent";
7
- import { Container, Spacer, Text, type TUI } from "@earendil-works/pi-tui";
7
+ import { Container, Spacer, Text, type Component, type TUI } from "@earendil-works/pi-tui";
8
8
  import {
9
9
  NATIVE_EDIT_BATCH_EVENT,
10
10
  type NativeEditBatchEvent,
11
11
  } from "#src/extensions/pi-agent-text-editor/src/api/native-edit-batch-event.js";
12
12
  import { compactMutationDetails } from "#src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/persisted-result.js";
13
13
  import type { FileMutationBatchResult } from "pi-agent-text-editor/api/mutation-result";
14
+ import { registerIdeAliasCompatibility } from "./ide-alias-rendering.js";
14
15
 
15
16
  const ENTRY_TYPE = "ide-nested-results";
16
17
  const MAX_CALLS = 256;
@@ -32,6 +33,10 @@ interface ChildPanel {
32
33
  postWriteFailure?: boolean;
33
34
  unchangedCopy?: boolean;
34
35
  copyRollback?: "restored" | "failed";
36
+ /** The call's host-recorded execution time; absent in older history or when it did not run. */
37
+ durationMs?: number;
38
+ /** This call's panel shows the combined diff of several calls, so no single time applies. */
39
+ groupedResult?: boolean;
35
40
  result?: { content: AgentToolResult<unknown>["content"]; details: unknown; isError: boolean };
36
41
  }
37
42
  interface BatchReport {
@@ -39,6 +44,7 @@ interface BatchReport {
39
44
  }
40
45
  interface PanelGroup {
41
46
  parentToolCallId: string;
47
+ parentToolName?: string;
42
48
  cwd: string;
43
49
  calls: ChildPanel[];
44
50
  retention: RetentionReasons;
@@ -79,13 +85,58 @@ function retentionWarning(group: SavedPanelGroup): string | undefined {
79
85
  return undefined;
80
86
  }
81
87
 
88
+ /** Format a duration like native tool rows: `4.2s` below a minute, then `1m 30s` and `2h 3m 4s`. */
89
+ export function formatToolDuration(ms: number): string {
90
+ const seconds = ms / 1000;
91
+ if (seconds < 60) return `${seconds.toFixed(1)}s`;
92
+ const totalSeconds = Math.floor(seconds);
93
+ const minutes = Math.floor(totalSeconds / 60);
94
+ if (minutes < 60) return `${minutes}m ${totalSeconds % 60}s`;
95
+ return `${Math.floor(minutes / 60)}h ${minutes % 60}m ${totalSeconds % 60}s`;
96
+ }
97
+
82
98
  /** Keep bounded display data for nested IDE tools, separate from model context and usage. */
83
- export function createNestedIdeRendering(pi: ExtensionAPI) {
99
+ export function createNestedIdeRendering(pi: ExtensionAPI, hideCodemodeToolResults = false) {
84
100
  const definitions = new Map<string, ToolDefinition>();
101
+ const aliasSource = registerIdeAliasCompatibility(pi, definitions);
102
+ const aliasRoots = new Map<string, string>();
85
103
  const parents = new Map<string, string>();
86
104
  const groups = new Map<string, PanelGroup>();
87
105
  let tui: TUI | undefined;
88
106
  const components = new WeakMap<object, Container>();
107
+ const timedDefinitions = new WeakMap<ToolDefinition, ToolDefinition>();
108
+ /** Wrap a tool's result renderer so a final nested panel ends with its recorded time. */
109
+ const timedDefinition = (name: string): ToolDefinition | undefined => {
110
+ const definition = definitions.get(name);
111
+ const renderResult = definition?.renderResult;
112
+ if (!definition || !renderResult) return definition;
113
+ let timed = timedDefinitions.get(definition);
114
+ if (!timed) {
115
+ const inner = new WeakMap<object, Component>();
116
+ timed = {
117
+ ...definition,
118
+ renderResult(result, options, theme, context) {
119
+ // Give the tool its own previous component, not the timing wrapper around it.
120
+ const previous = context.lastComponent && inner.get(context.lastComponent);
121
+ const rendered = renderResult.call(definition, result, options, theme, {
122
+ ...context,
123
+ lastComponent: previous ?? context.lastComponent,
124
+ });
125
+ if (options.isPartial || context.durationMs === undefined) return rendered;
126
+ const container = new Container();
127
+ container.addChild(rendered);
128
+ container.addChild(new Spacer(1));
129
+ container.addChild(
130
+ new Text(theme.fg("muted", `Took ${formatToolDuration(context.durationMs)}`), 0, 0),
131
+ );
132
+ inner.set(container, rendered);
133
+ return container;
134
+ },
135
+ };
136
+ timedDefinitions.set(definition, timed);
137
+ }
138
+ return timed;
139
+ };
89
140
  const retainResult = (
90
141
  group: PanelGroup,
91
142
  call: ChildPanel,
@@ -128,6 +179,7 @@ export function createNestedIdeRendering(pi: ExtensionAPI) {
128
179
  call.resultOmitted = true;
129
180
  };
130
181
  const clear = () => {
182
+ aliasRoots.clear();
131
183
  parents.clear();
132
184
  groups.clear();
133
185
  };
@@ -146,9 +198,15 @@ export function createNestedIdeRendering(pi: ExtensionAPI) {
146
198
  pi.on("session_tree", clear);
147
199
  pi.on("session_shutdown", clear);
148
200
  pi.on("tool_execution_start", (event, context) => {
149
- if (event.parentToolCallId === undefined) return;
201
+ if (event.parentToolCallId === undefined) {
202
+ const source = aliasSource(event.toolName);
203
+ if (source !== undefined) aliasRoots.set(event.toolCallId, source);
204
+ return;
205
+ }
150
206
  const root = parents.get(event.parentToolCallId) ?? event.parentToolCallId;
151
207
  parents.set(event.toolCallId, root);
208
+ // A direct alias already draws the native panel; its forwarding child must not duplicate it.
209
+ if (aliasRoots.get(root) === event.toolName) return;
152
210
  if (!definitions.has(event.toolName)) return;
153
211
  let group = groups.get(root);
154
212
  if (!group) {
@@ -188,12 +246,15 @@ export function createNestedIdeRendering(pi: ExtensionAPI) {
188
246
  });
189
247
  });
190
248
  pi.on("tool_execution_end", (event) => {
249
+ aliasRoots.delete(event.toolCallId);
191
250
  const root = parents.get(event.toolCallId);
192
251
  if (root === undefined) return;
193
252
  parents.delete(event.toolCallId);
194
253
  const group = groups.get(root);
195
254
  const call = group?.calls.find((call) => call.id === event.toolCallId);
196
255
  if (group && call) {
256
+ if (typeof event.durationMs === "number" && Number.isFinite(event.durationMs))
257
+ call.durationMs = event.durationMs;
197
258
  // Hooks have already prepared compact renderer details. Never copy structuredContent or usage.
198
259
  const result = event.result as AgentToolResult<unknown>;
199
260
  retainResult(group, call, {
@@ -215,6 +276,7 @@ export function createNestedIdeRendering(pi: ExtensionAPI) {
215
276
  const calls = group.calls.filter((call) => !call.batched);
216
277
  const saved: PanelGroup = {
217
278
  ...group,
279
+ parentToolName: event.message.toolName,
218
280
  calls: [],
219
281
  retention: {
220
282
  ...group.retention,
@@ -240,6 +302,15 @@ export function createNestedIdeRendering(pi: ExtensionAPI) {
240
302
  ENTRY_TYPE,
241
303
  function renderEntry(entry, options, theme) {
242
304
  if (!Array.isArray(entry.data?.calls)) return undefined;
305
+ const compact =
306
+ hideCodemodeToolResults && entry.data.parentToolName === "codemode" && !options.expanded;
307
+ const calls = compact
308
+ ? entry.data.calls.filter((call) => call.result?.isError)
309
+ : entry.data.calls;
310
+ if (compact && calls.length === 0) {
311
+ const warning = retentionWarning(entry.data);
312
+ return warning ? new Text(theme.fg("warning", warning), 0, 0) : new Container();
313
+ }
243
314
  // Pi rebuilds resumed history before session_start binds the public UI.
244
315
  // Keep the entry mounted and resolve its tool components on the next render.
245
316
  if (!tui)
@@ -251,10 +322,10 @@ export function createNestedIdeRendering(pi: ExtensionAPI) {
251
322
  },
252
323
  };
253
324
  const warningText = retentionWarning(entry.data);
254
- let panel = components.get(entry.data);
325
+ let panel = compact ? undefined : components.get(entry.data);
255
326
  if (!panel) {
256
327
  panel = new Container();
257
- for (const call of entry.data.calls) {
328
+ for (const call of calls) {
258
329
  const component = new ToolExecutionComponent(
259
330
  call.name,
260
331
  call.id,
@@ -262,11 +333,17 @@ export function createNestedIdeRendering(pi: ExtensionAPI) {
262
333
  { showImages: true },
263
334
  call.resultOmitted || call.omitted || !call.result
264
335
  ? undefined
265
- : definitions.get(call.name),
336
+ : timedDefinition(call.name),
266
337
  tui,
267
338
  entry.data.cwd,
268
339
  );
269
- if (call.result) component.updateResult(call.result);
340
+ if (call.result)
341
+ component.updateResult({
342
+ ...call.result,
343
+ ...(call.durationMs === undefined || call.groupedResult === true
344
+ ? {}
345
+ : { durationMs: call.durationMs }),
346
+ });
270
347
  else
271
348
  component.updateResult({
272
349
  content: [{ type: "text", text: "Result unavailable in this saved display." }],
@@ -276,7 +353,7 @@ export function createNestedIdeRendering(pi: ExtensionAPI) {
276
353
  panel.addChild(component);
277
354
  }
278
355
  if (warningText) panel.addChild(new Text(theme.fg("warning", warningText), 0, 0));
279
- components.set(entry.data, panel);
356
+ if (!compact) components.set(entry.data, panel);
280
357
  }
281
358
  const warning = panel.children.at(-1);
282
359
  if (warningText && warning instanceof Text) warning.setText(theme.fg("warning", warningText));
@@ -319,7 +396,7 @@ export function createNestedIdeRendering(pi: ExtensionAPI) {
319
396
  });
320
397
  continue;
321
398
  }
322
- const copyResult = batch.copyResults?.get(id);
399
+ const copyResult = batch.mutationResults?.get(id);
323
400
  const rollback = copyResult?.details.metadata?.copyRollback;
324
401
  if (
325
402
  call.name === "copy" &&
@@ -339,6 +416,10 @@ export function createNestedIdeRendering(pi: ExtensionAPI) {
339
416
  call.unchangedCopy =
340
417
  call.name === "copy" && batch.unchangedCopyCalls?.includes(id) === true;
341
418
  call.batched = !call.unchangedCopy && id !== lastChangedCall;
419
+ call.groupedResult =
420
+ !call.batched &&
421
+ !call.unchangedCopy &&
422
+ batch.calls.filter((other) => !batch.unchangedCopyCalls?.includes(other)).length > 1;
342
423
  if (call.unchangedCopy) {
343
424
  retainResult(group, call, {
344
425
  content: [{ type: "text", text: "No changes: destination already has this text." }],
@@ -32,6 +32,19 @@ function presentationPreference(id: string, name: string, description: string):
32
32
 
33
33
  /** Registered presentation preferences. */
34
34
  export const AGENT_IDE_PREFERENCES: readonly AgentIdePreference[] = [
35
+ {
36
+ kind: "choice",
37
+ id: "ui.codemode",
38
+ name: "Show tool results from Codemode",
39
+ description:
40
+ "Show extra Agent IDE result panels using each tool's presentation setting. Off hides successful panels; errors stay visible. Codemode's own output and other tools are unchanged.",
41
+ default: "off",
42
+ group: "ui",
43
+ values: [
44
+ { value: "off", label: "Off" },
45
+ { value: "on", label: "On" },
46
+ ],
47
+ },
35
48
  presentationPreference(
36
49
  "ui.diffs",
37
50
  "Diffs",