pi-agent-ide 0.5.1 → 0.6.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 (454) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/README.md +82 -50
  3. package/assets/social-preview.png +0 -0
  4. package/dist/{chunk-LY6U5EAD.js → chunk-2527OQ4Y.js} +1 -1
  5. package/dist/chunk-4KUFOHWP.js +2 -0
  6. package/dist/chunk-4LDOV7QS.js +28 -0
  7. package/dist/chunk-5JELU6RV.js +7 -0
  8. package/dist/chunk-FA6BKC5Y.js +1 -0
  9. package/dist/chunk-FEDVTZJG.js +1 -0
  10. package/dist/chunk-I6Y3W4X6.js +27 -0
  11. package/dist/chunk-K5G4FDXD.js +1 -0
  12. package/dist/chunk-M5IVSCR2.js +1 -0
  13. package/dist/chunk-MPT3R4BL.js +0 -0
  14. package/dist/chunk-PZFOOHY2.js +15 -0
  15. package/dist/chunk-S6QRG3TQ.js +1 -0
  16. package/dist/chunk-T7I2VX3J.js +1 -0
  17. package/dist/chunk-VCTK4JSN.js +3 -0
  18. package/dist/chunk-W7CASEO3.js +1 -0
  19. package/dist/chunk-YEQOQMU7.js +5 -0
  20. package/dist/chunk-YT42LKFV.js +16 -0
  21. package/dist/entry-10.js +1 -1
  22. package/dist/entry-11.js +1 -1
  23. package/dist/entry-12.js +1 -1
  24. package/dist/entry-13.js +1 -1
  25. package/dist/entry-14.js +1 -1
  26. package/dist/entry-15.js +1 -1
  27. package/dist/entry-16.js +1 -0
  28. package/dist/entry-17.js +1 -1
  29. package/dist/entry-19.js +1 -1
  30. package/dist/entry-20.js +1 -1
  31. package/dist/entry-21.js +1 -1
  32. package/dist/entry-22.js +1 -2
  33. package/dist/entry-23.js +1 -1
  34. package/dist/entry-24.js +1 -1
  35. package/dist/entry-25.js +2 -1
  36. package/dist/entry-26.js +1 -1
  37. package/dist/entry-27.js +2 -12
  38. package/dist/entry-28.js +1 -1
  39. package/dist/entry-29.js +1 -1
  40. package/dist/entry-30.js +1 -1
  41. package/dist/entry-31.js +12 -1
  42. package/dist/entry-32.js +1 -4
  43. package/dist/entry-33.js +1 -9
  44. package/dist/entry-34.js +1 -1
  45. package/dist/entry-35.js +1 -1
  46. package/dist/entry-36.js +4 -1
  47. package/dist/entry-37.js +9 -1
  48. package/dist/entry-38.js +1 -1
  49. package/dist/entry-39.js +1 -1
  50. package/dist/entry-40.js +1 -1
  51. package/dist/entry-41.js +1 -18
  52. package/dist/entry-42.js +1 -1
  53. package/dist/entry-43.js +1 -1
  54. package/dist/entry-44.js +1 -1
  55. package/dist/entry-45.js +17 -1
  56. package/dist/entry-46.js +1 -7
  57. package/dist/entry-47.js +1 -11
  58. package/dist/entry-48.js +1 -1
  59. package/dist/entry-49.js +1 -1
  60. package/dist/entry-50.js +6 -1
  61. package/dist/entry-51.js +11 -1
  62. package/dist/entry-52.js +1 -1
  63. package/dist/entry-53.js +1 -1
  64. package/dist/entry-54.js +1 -1
  65. package/dist/entry-55.js +1 -1
  66. package/dist/entry-56.js +1 -0
  67. package/dist/entry-57.js +1 -1
  68. package/dist/entry-58.js +1 -0
  69. package/dist/entry-59.js +1 -1
  70. package/dist/entry-60.js +0 -1
  71. package/dist/entry-61.js +1 -1
  72. package/dist/entry-62.js +0 -1
  73. package/dist/entry-63.js +1 -1
  74. package/dist/entry-64.js +1 -1
  75. package/dist/entry-65.js +1 -0
  76. package/dist/entry-66.js +1 -1
  77. package/dist/entry-67.js +1 -0
  78. package/dist/entry-68.js +1 -1
  79. package/dist/entry-69.js +0 -1
  80. package/dist/entry-70.js +1 -1
  81. package/dist/entry-71.js +0 -203
  82. package/dist/entry-72.js +1 -30
  83. package/dist/entry-73.js +1 -2
  84. package/dist/entry-74.js +1 -1
  85. package/dist/entry-75.js +315 -1
  86. package/dist/entry-76.js +30 -3
  87. package/dist/entry-77.js +2 -3
  88. package/dist/entry-78.js +1 -1
  89. package/dist/entry-79.js +1 -1
  90. package/dist/entry-80.js +3 -1
  91. package/dist/entry-81.js +3 -0
  92. package/dist/entry-82.js +1 -0
  93. package/dist/entry-83.js +1 -0
  94. package/dist/entry-84.js +1 -0
  95. package/dist/entry-9.js +1 -1
  96. package/dist/pi-agent-ide.js +3 -3
  97. package/docs/agent-guides/apply.md +333 -0
  98. package/docs/agent-guides/debugger.md +5 -0
  99. package/docs/agent-guides/diagnostics.md +5 -0
  100. package/docs/agent-guides/editing.md +44 -0
  101. package/docs/agent-guides/git-changes.md +5 -0
  102. package/docs/agent-guides/json-reading.md +41 -0
  103. package/docs/agent-guides/read-resources.md +44 -0
  104. package/docs/agent-guides/search-code.md +29 -0
  105. package/docs/agent-guides/terminal.md +7 -0
  106. package/docs/agent-guides/vision.md +5 -0
  107. package/docs/configuration.md +9 -15
  108. package/docs/research/apply-read-latency.md +219 -0
  109. package/docs/tools.md +12 -0
  110. package/node_modules/pi-agent-doctor/package.json +6 -6
  111. package/node_modules/pi-agent-doctor/runtime/entry-22.js +1 -0
  112. package/node_modules/pi-agent-doctor/runtime/entry-23.js +1 -0
  113. package/node_modules/pi-agent-documentation/package.json +15 -0
  114. package/node_modules/pi-agent-documentation/runtime/entry-24.js +1 -0
  115. package/node_modules/pi-agent-documentation/src/index.ts +69 -0
  116. package/node_modules/pi-agent-filesystem/index.ts +0 -4
  117. package/node_modules/pi-agent-filesystem/package.json +7 -7
  118. package/node_modules/pi-agent-filesystem-image/package.json +4 -4
  119. package/node_modules/pi-agent-filesystem-image/runtime/entry-26.js +2 -0
  120. package/node_modules/pi-agent-filesystem-jq/index.ts +134 -0
  121. package/node_modules/pi-agent-filesystem-jq/package.json +23 -0
  122. package/node_modules/pi-agent-filesystem-jq/src/jq.ts +107 -0
  123. package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
  124. package/node_modules/pi-agent-filesystem-pdf/runtime/entry-28.js +2 -0
  125. package/node_modules/pi-agent-filesystem-text/package.json +4 -4
  126. package/node_modules/pi-agent-ide-ast/package.json +12 -11
  127. package/node_modules/pi-agent-ide-ast/runtime/entry-30.js +1 -0
  128. package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +8 -6
  129. package/node_modules/pi-agent-ide-changes/index.ts +8 -0
  130. package/node_modules/pi-agent-ide-changes/package.json +9 -8
  131. package/node_modules/pi-agent-ide-changes/runtime/entry-32.js +1 -0
  132. package/node_modules/pi-agent-ide-formatter/package.json +4 -4
  133. package/node_modules/pi-agent-ide-formatter/runtime/entry-34.js +2 -0
  134. package/node_modules/pi-agent-ide-formatter/src/formatter.ts +1 -1
  135. package/node_modules/pi-agent-ide-languages/package.json +3 -3
  136. package/node_modules/pi-agent-ide-languages/runtime/entry-35.js +2 -0
  137. package/node_modules/pi-agent-ide-lint/index.ts +1 -1
  138. package/node_modules/pi-agent-ide-lint/package.json +8 -8
  139. package/node_modules/pi-agent-ide-lint/runtime/entry-36.js +2 -0
  140. package/node_modules/pi-agent-ide-lint/src/command-linter.ts +20 -2
  141. package/node_modules/pi-agent-ide-lsp/index.ts +0 -3
  142. package/node_modules/pi-agent-ide-lsp/package.json +10 -10
  143. package/node_modules/pi-agent-ide-lsp/runtime/entry-37.js +2 -0
  144. package/node_modules/pi-agent-image/package.json +3 -3
  145. package/node_modules/pi-agent-invariant/package.json +2 -2
  146. package/node_modules/pi-agent-pdf/package.json +3 -3
  147. package/node_modules/pi-agent-read/package.json +12 -11
  148. package/node_modules/pi-agent-read/runtime/entry-41.js +0 -1
  149. package/node_modules/pi-agent-read/runtime/entry-45.js +2 -0
  150. package/node_modules/pi-agent-read/src/api/read-parameters.ts +4 -4
  151. package/node_modules/pi-agent-read/src/core/extension.ts +16 -2
  152. package/node_modules/pi-agent-read/src/core/read-core.ts +4 -5
  153. package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +62 -8
  154. package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +29 -17
  155. package/node_modules/pi-agent-resource/package.json +2 -2
  156. package/node_modules/pi-agent-resource/runtime/entry-46.js +1 -0
  157. package/node_modules/pi-agent-search/package.json +8 -7
  158. package/node_modules/pi-agent-search/runtime/entry-47.js +1 -0
  159. package/node_modules/pi-agent-search/src/core/extension.ts +29 -10
  160. package/node_modules/pi-agent-search-text/package.json +9 -9
  161. package/node_modules/pi-agent-search-text/runtime/entry-51.js +2 -0
  162. package/node_modules/pi-agent-search-text/runtime/entry-52.js +1 -0
  163. package/node_modules/pi-agent-text/package.json +3 -3
  164. package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
  165. package/node_modules/pi-agent-text-anchor-exact/index.ts +3 -3
  166. package/node_modules/pi-agent-text-anchor-exact/package.json +5 -5
  167. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-56.js +2 -0
  168. package/node_modules/pi-agent-text-anchor-exact/src/config.ts +2 -2
  169. package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
  170. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-58.js +2 -0
  171. package/node_modules/pi-agent-text-editor/index.ts +15 -0
  172. package/node_modules/pi-agent-text-editor/package.json +26 -25
  173. package/node_modules/pi-agent-text-editor/runtime/entry-71.js +0 -1
  174. package/node_modules/pi-agent-text-editor/runtime/entry-72.js +1 -0
  175. package/node_modules/pi-agent-text-editor/runtime/entry-73.js +1 -0
  176. package/node_modules/pi-agent-text-editor/runtime/entry-75.js +2 -0
  177. package/node_modules/pi-agent-text-editor/src/core/apply/execution.ts +131 -3
  178. package/node_modules/pi-agent-text-editor/src/core/apply/mixed-source.ts +1 -1
  179. package/node_modules/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +14 -0
  180. package/node_modules/pi-agent-text-editor/src/core/apply/output.ts +36 -5
  181. package/node_modules/pi-agent-text-editor/src/core/apply/prompt.ts +5 -42
  182. package/node_modules/pi-agent-text-editor/src/core/apply/renderer.ts +50 -5
  183. package/node_modules/pi-agent-text-editor/src/core/apply/runtime.ts +187 -38
  184. package/node_modules/pi-agent-text-editor/src/core/apply/tool.ts +3 -8
  185. package/node_modules/pi-agent-text-editor/src/core/apply/transaction.ts +770 -237
  186. package/node_modules/pi-agent-text-editor/src/core/builtin-edit-filter.ts +1 -1
  187. package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +2 -2
  188. package/node_modules/pi-agent-text-editor/src/core/extension.ts +0 -11
  189. package/node_modules/pi-agent-text-editor/src/core/post-edit-scope.ts +5 -0
  190. package/node_modules/pi-agent-text-editor/src/core/text-editor-config.ts +4 -4
  191. package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +9 -1
  192. package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +0 -2
  193. package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +53 -0
  194. package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +11 -41
  195. package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +8 -18
  196. package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +11 -41
  197. package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +9 -19
  198. package/node_modules/pi-agent-text-editor-renderer/index.ts +17 -4
  199. package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
  200. package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +23 -11
  201. package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +21 -16
  202. package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
  203. package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
  204. package/node_modules/pi-agent-tool-call-interception/runtime/entry-78.js +1 -0
  205. package/node_modules/pi-agent-tool-ui/package.json +2 -2
  206. package/node_modules/pi-agent-tool-ui/runtime/entry-79.js +1 -0
  207. package/node_modules/pi-agent-web/package.json +7 -7
  208. package/node_modules/pi-agent-web-html/package.json +3 -3
  209. package/node_modules/pi-agent-web-html/runtime/entry-81.js +2 -0
  210. package/node_modules/pi-agent-web-image/package.json +4 -4
  211. package/node_modules/pi-agent-web-image/runtime/entry-82.js +2 -0
  212. package/node_modules/pi-agent-web-pdf/package.json +4 -4
  213. package/node_modules/pi-agent-web-pdf/runtime/entry-83.js +2 -0
  214. package/node_modules/pi-agent-web-text/package.json +4 -4
  215. package/node_modules/pi-agent-web-text/runtime/entry-84.js +2 -0
  216. package/package.json +112 -43
  217. package/src/api/documentation.ts +2 -0
  218. package/src/api/path-identity.ts +15 -0
  219. package/src/composite/builtin-extensions.ts +14 -2
  220. package/src/composite/extensions-config.ts +6 -0
  221. package/src/composite/module-labels.ts +9 -0
  222. package/src/composite/module-settings-store.ts +3 -0
  223. package/src/composite/module-settings.ts +71 -17
  224. package/src/composite/preferences.ts +83 -3
  225. package/src/composite/presentation.ts +14 -0
  226. package/src/composite/presets.ts +57 -0
  227. package/src/composite/selection.ts +5 -1
  228. package/src/doctor/inventory.ts +7 -2
  229. package/src/documentation/extension.ts +295 -0
  230. package/src/documentation/registry.ts +98 -0
  231. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +0 -4
  232. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
  233. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
  234. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-26.js +2 -0
  235. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/index.ts +134 -0
  236. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +23 -0
  237. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-27.js +2 -0
  238. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/src/jq.ts +107 -0
  239. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
  240. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-28.js +2 -0
  241. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
  242. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-29.js +2 -0
  243. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-25.js +2 -0
  244. package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +7 -7
  245. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -3
  246. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-81.js +2 -0
  247. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
  248. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-82.js +2 -0
  249. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
  250. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-83.js +2 -0
  251. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
  252. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-84.js +2 -0
  253. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-80.js +2 -0
  254. package/src/extensions/pi-agent-read/package.json +12 -11
  255. package/src/extensions/pi-agent-read/runtime/entry-41.js +0 -1
  256. package/src/extensions/pi-agent-read/runtime/entry-42.js +1 -0
  257. package/src/extensions/pi-agent-read/runtime/entry-45.js +2 -0
  258. package/src/extensions/pi-agent-read/src/api/read-parameters.ts +4 -4
  259. package/src/extensions/pi-agent-read/src/core/extension.ts +16 -2
  260. package/src/extensions/pi-agent-read/src/core/read-core.ts +4 -5
  261. package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +62 -8
  262. package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +29 -17
  263. package/src/extensions/pi-agent-search/package.json +8 -7
  264. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +9 -9
  265. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-51.js +2 -0
  266. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-52.js +1 -0
  267. package/src/extensions/pi-agent-search/runtime/entry-47.js +1 -0
  268. package/src/extensions/pi-agent-search/runtime/entry-48.js +1 -0
  269. package/src/extensions/pi-agent-search/runtime/entry-49.js +1 -0
  270. package/src/extensions/pi-agent-search/runtime/entry-50.js +2 -0
  271. package/src/extensions/pi-agent-search/src/core/extension.ts +29 -10
  272. package/src/extensions/pi-agent-text-editor/index.ts +15 -0
  273. package/src/extensions/pi-agent-text-editor/package.json +26 -25
  274. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
  275. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.ts +3 -3
  276. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -5
  277. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-55.js +1 -0
  278. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-56.js +2 -0
  279. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/config.ts +2 -2
  280. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
  281. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-57.js +1 -0
  282. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-58.js +2 -0
  283. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +17 -4
  284. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
  285. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +23 -11
  286. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +21 -16
  287. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -5
  288. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-77.js +2 -0
  289. package/src/extensions/pi-agent-text-editor/runtime/entry-71.js +0 -1
  290. package/src/extensions/pi-agent-text-editor/runtime/entry-72.js +1 -0
  291. package/src/extensions/pi-agent-text-editor/runtime/entry-73.js +1 -0
  292. package/src/extensions/pi-agent-text-editor/runtime/entry-74.js +1 -0
  293. package/src/extensions/pi-agent-text-editor/runtime/entry-75.js +2 -0
  294. package/src/extensions/pi-agent-text-editor/src/core/apply/execution.ts +131 -3
  295. package/src/extensions/pi-agent-text-editor/src/core/apply/mixed-source.ts +1 -1
  296. package/src/extensions/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +14 -0
  297. package/src/extensions/pi-agent-text-editor/src/core/apply/output.ts +36 -5
  298. package/src/extensions/pi-agent-text-editor/src/core/apply/prompt.ts +5 -42
  299. package/src/extensions/pi-agent-text-editor/src/core/apply/renderer.ts +50 -5
  300. package/src/extensions/pi-agent-text-editor/src/core/apply/runtime.ts +187 -38
  301. package/src/extensions/pi-agent-text-editor/src/core/apply/tool.ts +3 -8
  302. package/src/extensions/pi-agent-text-editor/src/core/apply/transaction.ts +770 -237
  303. package/src/extensions/pi-agent-text-editor/src/core/builtin-edit-filter.ts +1 -1
  304. package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +2 -2
  305. package/src/extensions/pi-agent-text-editor/src/core/extension.ts +0 -11
  306. package/src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts +5 -0
  307. package/src/extensions/pi-agent-text-editor/src/core/text-editor-config.ts +4 -4
  308. package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +9 -1
  309. package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +0 -2
  310. package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +53 -0
  311. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +11 -41
  312. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +8 -18
  313. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +11 -41
  314. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +9 -19
  315. package/src/pi-agent-ide.ts +21 -11
  316. package/src/plugins/pi-agent-ide-ast/package.json +12 -11
  317. package/src/plugins/pi-agent-ide-ast/runtime/entry-30.js +1 -0
  318. package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +8 -6
  319. package/src/plugins/pi-agent-ide-changes/index.ts +8 -0
  320. package/src/plugins/pi-agent-ide-changes/package.json +9 -8
  321. package/src/plugins/pi-agent-ide-changes/runtime/entry-32.js +1 -0
  322. package/src/plugins/pi-agent-ide-debugger/index.ts +13 -11
  323. package/src/plugins/pi-agent-ide-debugger/src/adapter-executables.ts +31 -0
  324. package/src/plugins/pi-agent-ide-debugger/src/breakpoint-view.ts +3 -1
  325. package/src/plugins/pi-agent-ide-debugger/src/catalog.ts +24 -23
  326. package/src/plugins/pi-agent-ide-debugger/src/dap-client.ts +5 -2
  327. package/src/plugins/pi-agent-ide-debugger/src/doctor-plugin.ts +55 -17
  328. package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +55 -22
  329. package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +9 -4
  330. package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
  331. package/src/plugins/pi-agent-ide-formatter/runtime/entry-34.js +2 -0
  332. package/src/plugins/pi-agent-ide-formatter/src/formatter.ts +1 -1
  333. package/src/plugins/pi-agent-ide-languages/package.json +3 -3
  334. package/src/plugins/pi-agent-ide-languages/runtime/entry-35.js +2 -0
  335. package/src/plugins/pi-agent-ide-lint/index.ts +1 -1
  336. package/src/plugins/pi-agent-ide-lint/package.json +8 -8
  337. package/src/plugins/pi-agent-ide-lint/runtime/entry-36.js +2 -0
  338. package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +20 -2
  339. package/src/plugins/pi-agent-ide-lsp/index.ts +0 -3
  340. package/src/plugins/pi-agent-ide-lsp/package.json +10 -10
  341. package/src/plugins/pi-agent-ide-lsp/runtime/entry-37.js +2 -0
  342. package/src/plugins/pi-agent-ide-processes/src/registry.ts +4 -0
  343. package/src/plugins/pi-agent-ide-processes/src/ui.ts +18 -9
  344. package/src/plugins/pi-agent-ide-terminal/index.ts +27 -2
  345. package/src/plugins/pi-agent-ide-terminal/src/process-provider.ts +1 -0
  346. package/src/plugins/pi-agent-ide-terminal/src/renderer.ts +27 -2
  347. package/src/plugins/pi-agent-ide-terminal/src/resources.ts +1 -4
  348. package/src/plugins/pi-agent-ide-terminal/src/search.ts +0 -3
  349. package/src/plugins/pi-agent-ide-terminal/src/session-manager.ts +1 -0
  350. package/src/plugins/pi-agent-ide-terminal/src/tools.ts +8 -5
  351. package/src/plugins/pi-agent-ide-terminal/src/types.ts +1 -0
  352. package/src/plugins/pi-agent-ide-vision/index.ts +234 -0
  353. package/src/plugins/pi-agent-ide-vision/src/vision.ts +530 -0
  354. package/src/plugins/pi-agent-ide-vision/src/windows-display-capture.ps1 +30 -0
  355. package/src/plugins/pi-agent-ide-vision/src/windows-window-capture.ps1 +33 -0
  356. package/dist/chunk-526E364R.js +0 -3
  357. package/dist/chunk-5PLV4HLG.js +0 -1
  358. package/dist/chunk-7ALCBKCW.js +0 -26
  359. package/dist/chunk-DQXPQOF7.js +0 -2
  360. package/dist/chunk-EJ5OACQM.js +0 -1
  361. package/dist/chunk-G725MARR.js +0 -16
  362. package/dist/chunk-HKXDP2FD.js +0 -7
  363. package/dist/chunk-IRECDTJG.js +0 -27
  364. package/dist/chunk-J4RTW44E.js +0 -1
  365. package/dist/chunk-NZYDMBM6.js +0 -1
  366. package/dist/chunk-WGGIQ7IJ.js +0 -1
  367. package/dist/entry-18.js +0 -1
  368. package/node_modules/pi-agent-doctor/runtime/entry-17.js +0 -1
  369. package/node_modules/pi-agent-doctor/runtime/entry-18.js +0 -1
  370. package/node_modules/pi-agent-filesystem/runtime/entry-22.js +0 -2
  371. package/node_modules/pi-agent-filesystem-image/runtime/entry-23.js +0 -2
  372. package/node_modules/pi-agent-filesystem-pdf/runtime/entry-24.js +0 -2
  373. package/node_modules/pi-agent-ide-ast/runtime/entry-26.js +0 -1
  374. package/node_modules/pi-agent-ide-changes/runtime/entry-28.js +0 -1
  375. package/node_modules/pi-agent-ide-formatter/runtime/entry-30.js +0 -2
  376. package/node_modules/pi-agent-ide-lint/runtime/entry-32.js +0 -2
  377. package/node_modules/pi-agent-image/runtime/entry-34.js +0 -1
  378. package/node_modules/pi-agent-invariant/runtime/entry-35.js +0 -1
  379. package/node_modules/pi-agent-pdf/runtime/entry-36.js +0 -1
  380. package/node_modules/pi-agent-read/runtime/entry-37.js +0 -1
  381. package/node_modules/pi-agent-search/runtime/entry-45.js +0 -1
  382. package/node_modules/pi-agent-search/runtime/entry-46.js +0 -2
  383. package/node_modules/pi-agent-search-text/runtime/entry-47.js +0 -2
  384. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-51.js +0 -1
  385. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-52.js +0 -2
  386. package/node_modules/pi-agent-text-editor/runtime/entry-56.js +0 -1
  387. package/node_modules/pi-agent-text-editor/runtime/entry-58.js +0 -1
  388. package/node_modules/pi-agent-text-editor-renderer/runtime/entry-72.js +0 -2
  389. package/node_modules/pi-agent-text-editor-renderer/src/config.ts +0 -73
  390. package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +0 -2
  391. package/node_modules/pi-agent-tool-ui/runtime/entry-75.js +0 -1
  392. package/node_modules/pi-agent-web-image/runtime/entry-78.js +0 -2
  393. package/node_modules/pi-agent-web-pdf/runtime/entry-79.js +0 -2
  394. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-23.js +0 -2
  395. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-24.js +0 -2
  396. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-25.js +0 -2
  397. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-22.js +0 -2
  398. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-77.js +0 -2
  399. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-78.js +0 -2
  400. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-79.js +0 -2
  401. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-80.js +0 -2
  402. package/src/extensions/pi-agent-read/runtime/entry-37.js +0 -1
  403. package/src/extensions/pi-agent-read/runtime/entry-38.js +0 -1
  404. package/src/extensions/pi-agent-read/runtime/entry-39.js +0 -1
  405. package/src/extensions/pi-agent-read/runtime/entry-40.js +0 -1
  406. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-47.js +0 -2
  407. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-48.js +0 -1
  408. package/src/extensions/pi-agent-search/runtime/entry-45.js +0 -1
  409. package/src/extensions/pi-agent-search/runtime/entry-46.js +0 -2
  410. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-50.js +0 -2
  411. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-51.js +0 -1
  412. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-52.js +0 -2
  413. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-53.js +0 -1
  414. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-72.js +0 -2
  415. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/config.ts +0 -73
  416. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +0 -2
  417. package/src/extensions/pi-agent-text-editor/runtime/entry-55.js +0 -1
  418. package/src/extensions/pi-agent-text-editor/runtime/entry-56.js +0 -1
  419. package/src/extensions/pi-agent-text-editor/runtime/entry-57.js +0 -1
  420. package/src/extensions/pi-agent-text-editor/runtime/entry-58.js +0 -1
  421. package/src/plugins/pi-agent-ide-ast/runtime/entry-26.js +0 -1
  422. package/src/plugins/pi-agent-ide-ast/runtime/entry-27.js +0 -2
  423. package/src/plugins/pi-agent-ide-changes/runtime/entry-28.js +0 -1
  424. package/src/plugins/pi-agent-ide-changes/runtime/entry-29.js +0 -2
  425. package/src/plugins/pi-agent-ide-formatter/runtime/entry-30.js +0 -2
  426. package/src/plugins/pi-agent-ide-lint/runtime/entry-32.js +0 -2
  427. /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem}/runtime/entry-25.js +0 -0
  428. /package/node_modules/{pi-agent-ide-ast → pi-agent-filesystem-jq}/runtime/entry-27.js +0 -0
  429. /package/node_modules/{pi-agent-ide-changes → pi-agent-filesystem-text}/runtime/entry-29.js +0 -0
  430. /package/node_modules/{pi-agent-ide-languages → pi-agent-ide-ast}/runtime/entry-31.js +0 -0
  431. /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-changes}/runtime/entry-33.js +0 -0
  432. /package/node_modules/{pi-agent-read → pi-agent-image}/runtime/entry-38.js +0 -0
  433. /package/node_modules/{pi-agent-read → pi-agent-invariant}/runtime/entry-39.js +0 -0
  434. /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-40.js +0 -0
  435. /package/node_modules/{pi-agent-resource → pi-agent-read}/runtime/entry-42.js +0 -0
  436. /package/node_modules/{pi-agent-search → pi-agent-read}/runtime/entry-43.js +0 -0
  437. /package/node_modules/{pi-agent-search → pi-agent-read}/runtime/entry-44.js +0 -0
  438. /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-48.js +0 -0
  439. /package/node_modules/{pi-agent-text → pi-agent-search}/runtime/entry-49.js +0 -0
  440. /package/node_modules/{pi-agent-text-anchor-constant → pi-agent-search}/runtime/entry-50.js +0 -0
  441. /package/node_modules/{pi-agent-text-anchor-line-hash → pi-agent-text}/runtime/entry-53.js +0 -0
  442. /package/node_modules/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-constant}/runtime/entry-54.js +0 -0
  443. /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-exact}/runtime/entry-55.js +0 -0
  444. /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-line-hash}/runtime/entry-57.js +0 -0
  445. /package/node_modules/{pi-agent-tool-call-interception → pi-agent-text-editor}/runtime/entry-74.js +0 -0
  446. /package/node_modules/{pi-agent-web → pi-agent-text-editor-renderer}/runtime/entry-76.js +0 -0
  447. /package/node_modules/{pi-agent-web-html → pi-agent-text-editor-stale-anchor}/runtime/entry-77.js +0 -0
  448. /package/node_modules/{pi-agent-web-text → pi-agent-web}/runtime/entry-80.js +0 -0
  449. /package/src/extensions/{pi-agent-search → pi-agent-read}/runtime/entry-43.js +0 -0
  450. /package/src/extensions/{pi-agent-search → pi-agent-read}/runtime/entry-44.js +0 -0
  451. /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-constant}/runtime/entry-54.js +0 -0
  452. /package/src/extensions/{pi-agent-read/extensions/pi-agent-web → pi-agent-text-editor/plugins/pi-agent-text-editor-renderer}/runtime/entry-76.js +0 -0
  453. /package/src/plugins/{pi-agent-ide-languages → pi-agent-ide-ast}/runtime/entry-31.js +0 -0
  454. /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-changes}/runtime/entry-33.js +0 -0
@@ -32,7 +32,7 @@ export function registerBuiltinEditFilter(pi: ExtensionAPI): void {
32
32
  "Use the smallest useful source view: reuse sufficient content and anchors, search for known text, or inspect structure when locating a declaration. Read nearby context when boundaries are unclear; resolve ambiguity rather than guessing.",
33
33
  "Use an available anchor when it selects exactly the intended text; otherwise use minimal unique exact text. Keep the edit limited to the intended content.",
34
34
  "When search broadens to separate words, treat its results as location hints. Refine the query before using those matches for replacement.",
35
- "Submit independent mutations together in one tool-call block. They are evaluated against the original file contents. Combine overlapping changes into one mutation. A rejected mutation does not cancel other valid mutations; check each result and retry only changes that were not applied.",
35
+ "Use standalone mutation tools in one assistant-response batch when each change is known in advance and does not depend on another change. This is the default for several independent edits in one file or across files. Every call is evaluated against the original file snapshots. Combine overlapping changes into one mutation. Use Apply only when edits require computation, conditions, selection composition, checkpoints, or one coherent cross-file transaction. Check each batch result and retry only unapplied changes.",
36
36
  ],
37
37
  parameters: Type.Object({}, { additionalProperties: false }),
38
38
  execute() {
@@ -155,9 +155,9 @@ export function registerDiff(
155
155
  name: "diff",
156
156
  label: "Diff",
157
157
  parameters: diffParameters,
158
- promptSnippet: "Compare two text-readable sources without changing them",
158
+ promptSnippet: "Compare two text-readable sources",
159
159
  description:
160
- "Use diff to compare two sources without modifying them. before and after accept a source string or a read request {path, offset?, limit?, views?}. Use any source that read can resolve as text. Omit limit to compare complete resolved text; read presentation limits do not clip comparison inputs. Multiple resolved resources are joined with one newline separator in resolver order. Diff line numbers are relative to each selected text, not the original file when a window is selected. Native non-text content is rejected. Output uses the existing text diff and a shared output budget; oversized output has a full temporary reference. The same diff function is available inside Apply.",
160
+ "Use diff to compare two sources. before and after accept a source string or a read request {path, offset?, limit?, views?}. Use any source that read can resolve as text. Omit limit to compare complete resolved text; read presentation limits do not clip comparison inputs. Multiple resolved resources are joined with one newline separator in resolver order. Diff line numbers are relative to each selected text, not the original file when a window is selected. Native non-text content is rejected. Output uses the existing text diff and a shared output budget; oversized output has a full temporary reference. The same diff function is available inside Apply.",
161
161
  renderCall(_args, theme) {
162
162
  return new Text(theme.fg("toolTitle", theme.bold("Diff")), 0, 0);
163
163
  },
@@ -55,17 +55,6 @@ export default async function registerTextEditorCore(
55
55
  editor,
56
56
  registration,
57
57
  interceptionRendering,
58
- () =>
59
- [
60
- (registration.anchors?.length ?? 0) > 0
61
- ? editor.renderGeneralPromptGuideline(
62
- new Set(registration.anchors?.flatMap((anchor) => anchor.kinds)),
63
- )
64
- : undefined,
65
- editor.renderToolPromptGuideline(registration.name),
66
- ]
67
- .filter((guideline): guideline is string => guideline !== undefined)
68
- .join("\n\n") || undefined,
69
58
  () => getLastResolvedResource(pi)?.source,
70
59
  ),
71
60
  );
@@ -36,6 +36,11 @@ export function deferPostEdit(source: string, finalize: Finalize): boolean {
36
36
  export function hasDeferredPostEdit(source: string): boolean {
37
37
  return active.getStore()?.has(source) ?? false;
38
38
  }
39
+
40
+ /** Stop deferred processing when a later operation removes or moves the resource. */
41
+ export function forgetDeferredPostEdit(source: string): void {
42
+ active.getStore()?.delete(source);
43
+ }
39
44
  /** Writes stay immediate; finishing drains each surviving final resource once. */
40
45
  export function createPostEditScope() {
41
46
  const pending = new Map<string, Finalize>();
@@ -21,21 +21,21 @@ export function loadTextEditorConfig(cwd: string): LoadedTextEditorConfig {
21
21
  value = JSON.parse(readFileSync(file, "utf8"));
22
22
  } catch (error) {
23
23
  if (isMissingFile(error)) {
24
- return { contextLines: 5, timeoutMs: 2000, sections: {} };
24
+ return { contextLines: 15, timeoutMs: 2000, sections: {} };
25
25
  }
26
26
  throw new Error(`Invalid text editor config at ${file}`, { cause: error });
27
27
  }
28
28
  const root = record(value, "text editor config");
29
- assertKeys(root, ["recovery", "renderer"], "text editor config");
29
+ assertKeys(root, ["recovery"], "text editor config");
30
30
  if (root.recovery === undefined) {
31
- return { contextLines: 5, timeoutMs: 2000, sections: {} };
31
+ return { contextLines: 15, timeoutMs: 2000, sections: {} };
32
32
  }
33
33
  const recovery = record(root.recovery, "recovery");
34
34
  const sections = Object.fromEntries(
35
35
  Object.entries(recovery).filter(([key]) => key !== "contextLines" && key !== "timeoutMs"),
36
36
  );
37
37
  return {
38
- contextLines: integer(recovery.contextLines, "contextLines", 0, 20, 5),
38
+ contextLines: integer(recovery.contextLines, "contextLines", 0, 20, 15),
39
39
  timeoutMs: integer(recovery.timeoutMs, "timeoutMs", 1, 10_000, 2000),
40
40
  sections,
41
41
  };
@@ -274,6 +274,8 @@ export interface TextAnchorInTextRequest {
274
274
  readonly content: string;
275
275
  readonly value: string;
276
276
  readonly cwd: string;
277
+ /** Limit resolution to these registered anchor kinds. Omit to use all configured resolvers. */
278
+ readonly kinds?: readonly string[];
277
279
  readonly signal?: AbortSignal;
278
280
  }
279
281
 
@@ -618,7 +620,13 @@ export function createTextEditorCore(
618
620
  ...(request.signal !== undefined && { signal: request.signal }),
619
621
  };
620
622
 
621
- return anchorRegistry.snapshot().resolve(request.value, context);
623
+ return anchorRegistry
624
+ .snapshot()
625
+ .resolve(
626
+ request.value,
627
+ context,
628
+ request.kinds === undefined ? undefined : new Set(request.kinds),
629
+ );
622
630
  },
623
631
  editText<Result>(
624
632
  source: string,
@@ -81,7 +81,6 @@ export function createTextTool<TParameters extends TSchema>(
81
81
  core: TextEditorCore,
82
82
  definition: TextMutationToolRegistration<TParameters>,
83
83
  annotations: ToolCallInterceptionRenderStore,
84
- pluginPromptGuideline: () => string | undefined,
85
84
  getLastResolvedSource: () => string | undefined,
86
85
  ): ToolDefinition<TParameters, FileMutationBatchResult> {
87
86
  const renderer = core.getToolRenderer(definition.name);
@@ -178,7 +177,6 @@ export function createTextTool<TParameters extends TSchema>(
178
177
  ? `When ${definition.source.field} is omitted, the tool can reuse the file identified by the supplied anchor, the last read, or the preceding edit in the same batch.`
179
178
  : `When ${definition.source.field} is omitted, the tool can reuse the file identified by a supplied text anchor.`
180
179
  : "",
181
- pluginPromptGuideline() ?? "",
182
180
  ]
183
181
  .filter(Boolean)
184
182
  .join("\n");
@@ -0,0 +1,53 @@
1
+ import { Type } from "typebox";
2
+
3
+ /** Build the source selector shared by text mutation schemas. */
4
+ export function sourcePathProperty(description: string) {
5
+ return Type.Optional(Type.String({ description }));
6
+ }
7
+
8
+ /** Build the inclusive source-range selectors shared by text mutation schemas. */
9
+ export function sourceRangeProperties() {
10
+ return {
11
+ start: Type.Optional(
12
+ Type.String({
13
+ description:
14
+ "Anchor or unique exact text. Alone, selects that fragment; a line anchor selects only its line. Omit when path already selects text through a supported resource reference. With end, selects a whole-line range.",
15
+ }),
16
+ ),
17
+ end: Type.Optional(
18
+ Type.String({
19
+ description:
20
+ "Optional anchor or unique exact text. Range includes start's first line through end's last line, even for SEARCH :match. Mixed types allowed; boundaries must be unique, in one file, and forward-ordered. Omit when start already selects the intended content; do not repeat start. The end line is included, not a stopping point before it.",
21
+ }),
22
+ ),
23
+ };
24
+ }
25
+
26
+ /** Build the destination selectors shared by copy and move schemas. */
27
+ export function targetProperties() {
28
+ return {
29
+ target: Type.Optional(
30
+ Type.String({
31
+ description:
32
+ "Target resource reference or file path. Required for a whole-file operation; defaults to the source for selected text.",
33
+ }),
34
+ ),
35
+ targetStart: Type.Optional(
36
+ Type.String({
37
+ description:
38
+ "Registered anchor or unique exact text in the destination. Required unless target already selects one destination range. Without targetEnd, inserts after the last containing line, keeping the selected text. With targetEnd, replacement starts at the first containing line. SEARCH :match also uses these line boundaries.",
39
+ }),
40
+ ),
41
+ targetEnd: Type.Optional(
42
+ Type.String({
43
+ description:
44
+ "Optional inclusive destination end. Replaces whole lines through the last line containing this anchor, including SEARCH :match. May differ in type from targetStart; both must resolve uniquely in the target file and in forward order. Omit to insert after targetStart instead.",
45
+ }),
46
+ ),
47
+ overwrite: Type.Optional(
48
+ Type.Boolean({
49
+ description: "Allow replacing an existing regular target file. Defaults to false.",
50
+ }),
51
+ ),
52
+ };
53
+ }
@@ -1,5 +1,11 @@
1
1
  import { Type } from "typebox";
2
2
 
3
+ import {
4
+ sourcePathProperty,
5
+ sourceRangeProperties,
6
+ targetProperties,
7
+ } from "#src/tools/text-tool-schema-properties.js";
8
+
3
9
  import { TEXT_POSITION_ANCHOR_KIND, TEXT_SEARCH_ANCHOR_KIND } from "#src/api/plugin-protocol.js";
4
10
  import {
5
11
  anchorSpanRange,
@@ -11,50 +17,14 @@ import type { TextMutationToolRegistration } from "#src/api/mutation-tool.js";
11
17
 
12
18
  export const copySchema = Type.Object(
13
19
  {
14
- path: Type.Optional(
15
- Type.String({
16
- description: "Source file path, or a returned SEARCH# reference selecting the text to copy",
17
- }),
18
- ),
19
- start: Type.Optional(
20
- Type.String({
21
- description:
22
- "Anchor or unique exact text. Alone, selects that fragment; a line anchor selects only its line. Omit when path already selects text through a supported resource reference. With end, selects a whole-line range.",
23
- }),
24
- ),
25
- end: Type.Optional(
26
- Type.String({
27
- description:
28
- "Optional anchor or unique exact text. Range includes start's first line through end's last line, even for SEARCH :match. Mixed types allowed; boundaries must be unique, in one file, and forward-ordered. Omit when start already selects the intended content; do not repeat start. The end line is included, not a stopping point before it.",
29
- }),
30
- ),
31
- target: Type.Optional(
32
- Type.String({
33
- description:
34
- "Target resource reference or file path. Required for a whole-file operation; defaults to the source for selected text.",
35
- }),
36
- ),
37
- targetStart: Type.Optional(
38
- Type.String({
39
- description:
40
- "Registered anchor or unique exact text in the destination. Required unless target already selects one destination range. Without targetEnd, inserts after the last containing line, keeping the selected text. With targetEnd, replacement starts at the first containing line. SEARCH :match also uses these line boundaries.",
41
- }),
42
- ),
43
- targetEnd: Type.Optional(
44
- Type.String({
45
- description:
46
- "Optional inclusive destination end. Replaces whole lines through the last line containing this anchor, including SEARCH :match. May differ in type from targetStart; both must resolve uniquely in the target file and in forward order. Omit to insert after targetStart instead.",
47
- }),
48
- ),
49
- overwrite: Type.Optional(
50
- Type.Boolean({
51
- description: "Allow replacing an existing regular target file. Defaults to false.",
52
- }),
20
+ path: sourcePathProperty(
21
+ "Source file path, or a returned SEARCH# reference selecting the text to copy",
53
22
  ),
23
+ ...sourceRangeProperties(),
24
+ ...targetProperties(),
54
25
  },
55
26
  { additionalProperties: false },
56
27
  );
57
-
58
28
  interface CopyParameters {
59
29
  readonly path?: string;
60
30
  readonly start?: string;
@@ -68,7 +38,7 @@ export const copyMutationTool: TextMutationToolRegistration<typeof copySchema> =
68
38
  name: "copy",
69
39
  wholeFileOperation: "copy",
70
40
  description:
71
- "Use copy to copy one regular file when path and target are supplied without text selectors, or to duplicate selected text within or between files. Whole-file targets require overwrite: true when they already exist.",
41
+ "Use copy to copy one regular file, or to duplicate selected text within or between files.",
72
42
 
73
43
  promptSnippet: "Copy regular files, or copy selected text within or between files",
74
44
  parameters: copySchema,
@@ -1,5 +1,10 @@
1
1
  import { Type } from "typebox";
2
2
 
3
+ import {
4
+ sourcePathProperty,
5
+ sourceRangeProperties,
6
+ } from "#src/tools/text-tool-schema-properties.js";
7
+
3
8
  import { TEXT_POSITION_ANCHOR_KIND, TEXT_SEARCH_ANCHOR_KIND } from "#src/api/plugin-protocol.js";
4
9
  import {
5
10
  anchorSpanRange,
@@ -12,28 +17,13 @@ import type { TextMutationToolRegistration } from "#src/api/mutation-tool.js";
12
17
 
13
18
  export const deleteSchema = Type.Object(
14
19
  {
15
- path: Type.Optional(
16
- Type.String({
17
- description:
18
- "Source resource reference or file path. A returned SEARCH# reference can select deletion ranges.",
19
- }),
20
- ),
21
- start: Type.Optional(
22
- Type.String({
23
- description:
24
- "Anchor or unique exact text. Alone, selects that fragment; a line anchor selects only its line. Omit when path already selects text through a supported resource reference. With end, selects a whole-line range.",
25
- }),
26
- ),
27
- end: Type.Optional(
28
- Type.String({
29
- description:
30
- "Optional anchor or unique exact text. Range includes start's first line through end's last line, even for SEARCH :match. Mixed types allowed; boundaries must be unique, in one file, and forward-ordered. Omit when start already selects the intended content; do not repeat start. The end line is included, not a stopping point before it.",
31
- }),
20
+ path: sourcePathProperty(
21
+ "Source resource reference or file path. A returned SEARCH# reference can select deletion ranges.",
32
22
  ),
23
+ ...sourceRangeProperties(),
33
24
  },
34
25
  { additionalProperties: false },
35
26
  );
36
-
37
27
  interface DeleteParameters {
38
28
  readonly path?: string;
39
29
  readonly start?: string;
@@ -1,5 +1,11 @@
1
1
  import { Type } from "typebox";
2
2
 
3
+ import {
4
+ sourcePathProperty,
5
+ sourceRangeProperties,
6
+ targetProperties,
7
+ } from "#src/tools/text-tool-schema-properties.js";
8
+
3
9
  import { TEXT_POSITION_ANCHOR_KIND, TEXT_SEARCH_ANCHOR_KIND } from "#src/api/plugin-protocol.js";
4
10
  import {
5
11
  anchorSpanRange,
@@ -13,50 +19,14 @@ import type { TextChange } from "#src/core/text-change-engine.js";
13
19
 
14
20
  export const moveSchema = Type.Object(
15
21
  {
16
- path: Type.Optional(
17
- Type.String({
18
- description: "Source file path, or a returned SEARCH# reference selecting the text to move",
19
- }),
20
- ),
21
- start: Type.Optional(
22
- Type.String({
23
- description:
24
- "Anchor or unique exact text. Alone, selects that fragment; a line anchor selects only its line. Omit when path already selects text through a supported resource reference. With end, selects a whole-line range.",
25
- }),
26
- ),
27
- end: Type.Optional(
28
- Type.String({
29
- description:
30
- "Optional anchor or unique exact text. Range includes start's first line through end's last line, even for SEARCH :match. Mixed types allowed; boundaries must be unique, in one file, and forward-ordered. Omit when start already selects the intended content; do not repeat start. The end line is included, not a stopping point before it.",
31
- }),
32
- ),
33
- target: Type.Optional(
34
- Type.String({
35
- description:
36
- "Target resource reference or file path. Required for a whole-file operation; defaults to the source for selected text.",
37
- }),
38
- ),
39
- targetStart: Type.Optional(
40
- Type.String({
41
- description:
42
- "Registered anchor or unique exact text in the destination. Required unless target already selects one destination range. Without targetEnd, inserts after the last containing line, keeping the selected text. With targetEnd, replacement starts at the first containing line. SEARCH :match also uses these line boundaries.",
43
- }),
44
- ),
45
- targetEnd: Type.Optional(
46
- Type.String({
47
- description:
48
- "Optional inclusive destination end. Replaces whole lines through the last line containing this anchor, including SEARCH :match. May differ in type from targetStart; both must resolve uniquely in the target file and in forward order. Omit to insert after targetStart instead.",
49
- }),
50
- ),
51
- overwrite: Type.Optional(
52
- Type.Boolean({
53
- description: "Allow replacing an existing regular target file. Defaults to false.",
54
- }),
22
+ path: sourcePathProperty(
23
+ "Source file path, or a returned SEARCH# reference selecting the text to move",
55
24
  ),
25
+ ...sourceRangeProperties(),
26
+ ...targetProperties(),
56
27
  },
57
28
  { additionalProperties: false },
58
29
  );
59
-
60
30
  interface MoveParameters {
61
31
  readonly path?: string;
62
32
  readonly start?: string;
@@ -70,7 +40,7 @@ export const moveMutationTool: TextMutationToolRegistration<typeof moveSchema> =
70
40
  name: "move",
71
41
  wholeFileOperation: "move",
72
42
  description:
73
- "Use move to move or rename one regular file when path and target are supplied without text selectors, or to relocate selected text within or between files. Whole-file targets require overwrite: true when they already exist.",
43
+ "Use move to move or rename one regular file, or to relocate selected text within or between files.",
74
44
 
75
45
  promptSnippet: "Move or rename regular files, or move selected text within or between files",
76
46
  parameters: moveSchema,
@@ -1,5 +1,10 @@
1
1
  import { Type } from "typebox";
2
2
 
3
+ import {
4
+ sourcePathProperty,
5
+ sourceRangeProperties,
6
+ } from "#src/tools/text-tool-schema-properties.js";
7
+
3
8
  import { TEXT_POSITION_ANCHOR_KIND, TEXT_SEARCH_ANCHOR_KIND } from "#src/api/plugin-protocol.js";
4
9
  import {
5
10
  anchorSpanRange,
@@ -12,24 +17,10 @@ import type { TextMutationToolRegistration } from "#src/api/mutation-tool.js";
12
17
 
13
18
  export const replaceSchema = Type.Object(
14
19
  {
15
- path: Type.Optional(
16
- Type.String({
17
- description:
18
- "Source resource reference or file path. A returned SEARCH# reference can select replacement ranges.",
19
- }),
20
- ),
21
- start: Type.Optional(
22
- Type.String({
23
- description:
24
- "Anchor or unique exact text. Alone, selects that fragment; a line anchor selects only its line. Omit when path already selects text through a supported resource reference. With end, selects a whole-line range.",
25
- }),
26
- ),
27
- end: Type.Optional(
28
- Type.String({
29
- description:
30
- "Optional anchor or unique exact text. Range includes start's first line through end's last line, even for SEARCH :match. Mixed types allowed; boundaries must be unique, in one file, and forward-ordered. Omit when start already selects the intended content; do not repeat start. The end line is included, not a stopping point before it.",
31
- }),
20
+ path: sourcePathProperty(
21
+ "Source resource reference or file path. A returned SEARCH# reference can select replacement ranges.",
32
22
  ),
23
+ ...sourceRangeProperties(),
33
24
  text: Type.String({
34
25
  description:
35
26
  "Replacement text. Empty text removes the selection; a whole-line selection removes its lines without inserting a blank line. Adjacent unselected lines are kept.",
@@ -37,7 +28,6 @@ export const replaceSchema = Type.Object(
37
28
  },
38
29
  { additionalProperties: false },
39
30
  );
40
-
41
31
  interface ReplaceParameters {
42
32
  readonly path?: string;
43
33
  readonly start?: string;
@@ -48,7 +38,7 @@ interface ReplaceParameters {
48
38
  export const replaceMutationTool: TextMutationToolRegistration<typeof replaceSchema> = {
49
39
  name: "replace",
50
40
  description:
51
- "Use replace to change an existing text fragment, an inclusive line range, or every selected search match. Exact text must be unique; SEARCH#...:all:match selects every returned match for replacement.",
41
+ "Use replace to change an existing text fragment, an inclusive line range, or every selected search match.",
52
42
 
53
43
  promptSnippet: "Make precise file edits by replacing text using exact matches or anchors",
54
44
  parameters: replaceSchema,
@@ -22,7 +22,15 @@ import type { FileMutationBatchResult } from "pi-agent-text-editor/api/mutation-
22
22
 
23
23
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
24
24
 
25
- export default async function registerTextEditorRenderer(pi: ExtensionAPI): Promise<void> {
25
+ function parsePresentation(value: string | undefined): "full" | "compact" | "disabled" {
26
+ return value === "full" || value === "disabled" ? value : "compact";
27
+ }
28
+ export default async function registerTextEditorRenderer(
29
+ pi: ExtensionAPI,
30
+ context?: { readonly preferences: Readonly<Record<string, string>> },
31
+ ): Promise<void> {
32
+ const applyPresentation = parsePresentation(context?.preferences["ui.applyPreview"]);
33
+ const diffPresentation = parsePresentation(context?.preferences["ui.diffs"]);
26
34
  const animationPressure = createMutationAnimationPressure(pi);
27
35
  const plugin = {
28
36
  protocol: TEXT_EDITOR_PROTOCOL,
@@ -46,7 +54,9 @@ export default async function registerTextEditorRenderer(pi: ExtensionAPI): Prom
46
54
  );
47
55
  const panel = new MutationPanel(theme);
48
56
  panel.setBackground("toolSuccessBg");
49
- panel.setExpanded(options.expanded);
57
+ const mode = options.expanded ? "full" : diffPresentation;
58
+ panel.setExpanded(mode === "full");
59
+ panel.setDiffsVisible(mode !== "disabled");
50
60
  panel.setResourceLabelsVisible(true);
51
61
  panel.setResultResources(resolveMutationResultResources(details, undefined));
52
62
  return panel;
@@ -95,11 +105,13 @@ export default async function registerTextEditorRenderer(pi: ExtensionAPI): Prom
95
105
  ? `${display(call.before)} → ${display(call.after)}`
96
106
  : `${source}${call.target ? ` → ${display(call.target)}` : ""}`;
97
107
  return `${theme.fg("toolTitle", theme.bold(call.name))} ${theme.fg("accent", identity)}${suffix}`;
98
- }),
108
+ }, applyPresentation),
99
109
  renderResult: createApplyResultRenderer((details, theme, expanded, cwd) => {
100
110
  const panel = new MutationPanel(theme);
101
111
  panel.setBackground("toolSuccessBg");
102
- panel.setExpanded(expanded);
112
+ const mode = expanded ? "full" : diffPresentation;
113
+ panel.setExpanded(mode === "full");
114
+ panel.setDiffsVisible(mode !== "disabled");
103
115
  panel.setResourceLabelsVisible(true);
104
116
  panel.setResultResources(
105
117
  resolveMutationResultResources(details, undefined).map((resource) => ({
@@ -118,6 +130,7 @@ export default async function registerTextEditorRenderer(pi: ExtensionAPI): Prom
118
130
  api,
119
131
  animationPressure,
120
132
  () => pi.getFlag("pi-agent-ide-no-animations") !== true,
133
+ diffPresentation,
121
134
  );
122
135
  pi.on("tool_result", (event) => {
123
136
  if (
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "pi-agent-text-editor-renderer",
3
- "version": "0.5.1",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
7
7
  },
8
8
  "dependencies": {
9
9
  "diff": "^9.0.0",
10
- "pi-agent-invariant": "0.5.1",
11
- "pi-agent-text-editor": "0.5.1",
12
- "pi-agent-tool-call-interception": "0.5.1",
13
- "pi-agent-tool-ui": "0.5.1"
10
+ "pi-agent-invariant": "0.6.1",
11
+ "pi-agent-text-editor": "0.6.1",
12
+ "pi-agent-tool-call-interception": "0.6.1",
13
+ "pi-agent-tool-ui": "0.6.1"
14
14
  },
15
15
  "pi": {
16
16
  "extensions": [
17
- "./runtime/entry-72.js"
17
+ "./runtime/entry-76.js"
18
18
  ]
19
19
  },
20
20
  "peerDependencies": {
@@ -28,11 +28,13 @@ export class MutationPanel implements Component {
28
28
  private headerExpanded = false;
29
29
  private background: ToolBackground = "toolPendingBg";
30
30
  private expanded = false;
31
+ private diffsVisible = true;
31
32
  private resourceLabelsVisible = false;
32
33
  private cache:
33
34
  | {
34
35
  width: number;
35
36
  expanded: boolean;
37
+ diffsVisible: boolean;
36
38
  header: string;
37
39
  headerDetails: readonly ToolCallHeaderDetail[];
38
40
  headerExpanded: boolean;
@@ -78,6 +80,12 @@ export class MutationPanel implements Component {
78
80
  this.invalidate();
79
81
  }
80
82
 
83
+ public setDiffsVisible(visible: boolean): void {
84
+ if (this.diffsVisible === visible) return;
85
+ this.diffsVisible = visible;
86
+ this.invalidate();
87
+ }
88
+
81
89
  /** Shows each resource path inside its diff panel. */
82
90
  public setResourceLabelsVisible(visible: boolean): void {
83
91
  if (this.resourceLabelsVisible === visible) {
@@ -173,6 +181,7 @@ export class MutationPanel implements Component {
173
181
  if (
174
182
  this.cache?.width === contentWidth &&
175
183
  this.cache.expanded === this.expanded &&
184
+ this.cache.diffsVisible === this.diffsVisible &&
176
185
  this.cache.header === this.header &&
177
186
  this.cache.headerDetails === this.headerDetails &&
178
187
  this.cache.headerExpanded === this.headerExpanded &&
@@ -181,17 +190,19 @@ export class MutationPanel implements Component {
181
190
  return this.renderShell(this.cache.lines, width);
182
191
  }
183
192
 
184
- const panels = renderPanels(this.diffPanels, (resource) =>
185
- renderDiffPanel(
186
- resource,
187
- contentWidth,
188
- this.theme,
189
- this.expanded,
190
- this.background === "toolPendingBg",
191
- this.renderedRows,
192
- this.resourceLabelsVisible,
193
- ),
194
- );
193
+ const panels = this.diffsVisible
194
+ ? renderPanels(this.diffPanels, (resource) =>
195
+ renderDiffPanel(
196
+ resource,
197
+ contentWidth,
198
+ this.theme,
199
+ this.expanded,
200
+ this.background === "toolPendingBg",
201
+ this.renderedRows,
202
+ this.resourceLabelsVisible,
203
+ ),
204
+ )
205
+ : [];
195
206
  const ellipsis = `${this.theme.getBgAnsi(this.background)}...`;
196
207
  const summary =
197
208
  this.header.length === 0 ? [] : [truncateToWidth(this.header, contentWidth, ellipsis)];
@@ -208,6 +219,7 @@ export class MutationPanel implements Component {
208
219
  this.cache = {
209
220
  width: contentWidth,
210
221
  expanded: this.expanded,
222
+ diffsVisible: this.diffsVisible,
211
223
  header: this.header,
212
224
  headerDetails: this.headerDetails,
213
225
  headerExpanded: this.headerExpanded,