pi-agent-ide 0.9.0 → 0.9.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 (317) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/{chunk-TVH2ND35.js → chunk-35LZOKEW.js} +1 -1
  3. package/dist/chunk-3LVBARLW.js +33 -0
  4. package/dist/chunk-4GBFIGH3.js +1 -1
  5. package/dist/{chunk-64JTD2DJ.js → chunk-5PC5INOL.js} +1 -1
  6. package/dist/{chunk-FKKAHI62.js → chunk-BT2CFM7D.js} +1 -1
  7. package/dist/{chunk-VN3XBH2Q.js → chunk-DVNL5NZE.js} +1 -1
  8. package/dist/{chunk-PLMHBXWI.js → chunk-FXPY3V4L.js} +1 -1
  9. package/dist/{chunk-AJZVKDYC.js → chunk-HGCJDIRR.js} +1 -1
  10. package/dist/{chunk-RVFMH77U.js → chunk-HISGZD3C.js} +43 -44
  11. package/dist/{chunk-KFBRL2V4.js → chunk-HKYVP2Q6.js} +1 -1
  12. package/dist/{chunk-TVXZE4KW.js → chunk-HRBUY2FF.js} +1 -1
  13. package/dist/{chunk-QM5WDEFI.js → chunk-IOGWZNWT.js} +1 -1
  14. package/dist/{chunk-HT7LZN5A.js → chunk-IUJUECXH.js} +1 -1
  15. package/dist/chunk-LXDF2NWX.js +1 -0
  16. package/dist/{chunk-TVSZYABY.js → chunk-MPNE25CY.js} +1 -1
  17. package/dist/{chunk-Y74EKJOY.js → chunk-O7V6G3OO.js} +1 -1
  18. package/dist/chunk-OUCVZBOR.js +28 -0
  19. package/dist/{chunk-WUO3UW4J.js → chunk-PCGBM2D6.js} +1 -1
  20. package/dist/{chunk-V4J3TLCV.js → chunk-RIZARTUM.js} +1 -1
  21. package/dist/{chunk-LTADNZKW.js → chunk-T3Z4KXOX.js} +1 -1
  22. package/dist/chunk-TSQ6FBTB.js +1 -0
  23. package/dist/{chunk-CVOYSEBE.js → chunk-VNWGT367.js} +1 -1
  24. package/dist/{chunk-FS3KCKFX.js → chunk-X2WFNMQR.js} +1 -1
  25. package/dist/{chunk-7SG756UO.js → chunk-XCPIIDFS.js} +1 -1
  26. package/dist/entry-0.js +1 -1
  27. package/dist/entry-1.js +1 -1
  28. package/dist/entry-10.js +1 -1
  29. package/dist/entry-11.js +1 -1
  30. package/dist/entry-12.js +1 -1
  31. package/dist/entry-13.js +1 -1
  32. package/dist/entry-14.js +1 -1
  33. package/dist/entry-15.js +1 -1
  34. package/dist/entry-16.js +1 -1
  35. package/dist/entry-17.js +1 -1
  36. package/dist/entry-18.js +1 -1
  37. package/dist/entry-19.js +1 -1
  38. package/dist/entry-2.js +1 -1
  39. package/dist/entry-20.js +1 -1
  40. package/dist/entry-21.js +1 -1
  41. package/dist/entry-22.js +1 -0
  42. package/dist/entry-24.js +1 -1
  43. package/dist/entry-25.js +1 -1
  44. package/dist/entry-26.js +1 -1
  45. package/dist/entry-27.js +1 -1
  46. package/dist/entry-28.js +1 -1
  47. package/dist/entry-29.js +1 -1
  48. package/dist/entry-3.js +1 -1
  49. package/dist/entry-30.js +1 -2
  50. package/dist/entry-31.js +2 -1
  51. package/dist/entry-32.js +1 -1
  52. package/dist/entry-33.js +1 -1
  53. package/dist/entry-34.js +1 -1
  54. package/dist/entry-35.js +1 -1
  55. package/dist/entry-36.js +1 -1
  56. package/dist/entry-37.js +1 -15
  57. package/dist/entry-38.js +15 -1
  58. package/dist/entry-39.js +1 -1
  59. package/dist/entry-4.js +1 -1
  60. package/dist/entry-40.js +1 -1
  61. package/dist/entry-41.js +1 -1
  62. package/dist/entry-42.js +1 -1
  63. package/dist/entry-43.js +1 -1
  64. package/dist/entry-44.js +1 -1
  65. package/dist/entry-45.js +1 -1
  66. package/dist/entry-46.js +1 -1
  67. package/dist/entry-47.js +1 -1
  68. package/dist/entry-48.js +1 -1
  69. package/dist/entry-49.js +1 -1
  70. package/dist/entry-5.js +1 -1
  71. package/dist/entry-50.js +1 -1
  72. package/dist/entry-51.js +1 -1
  73. package/dist/entry-52.js +1 -1
  74. package/dist/entry-53.js +1 -1
  75. package/dist/entry-54.js +1 -1
  76. package/dist/entry-55.js +1 -1
  77. package/dist/entry-56.js +1 -1
  78. package/dist/entry-57.js +1 -1
  79. package/dist/entry-58.js +1 -1
  80. package/dist/entry-59.js +1 -1
  81. package/dist/entry-6.js +1 -1
  82. package/dist/entry-60.js +1 -1
  83. package/dist/entry-61.js +1 -1
  84. package/dist/entry-62.js +1 -1
  85. package/dist/entry-63.js +1 -1
  86. package/dist/entry-64.js +1 -1
  87. package/dist/entry-65.js +1 -1
  88. package/dist/entry-66.js +1 -1
  89. package/dist/entry-67.js +1 -0
  90. package/dist/entry-68.js +0 -1
  91. package/dist/entry-69.js +1 -0
  92. package/dist/entry-7.js +1 -1
  93. package/dist/entry-70.js +0 -1
  94. package/dist/entry-71.js +1 -1
  95. package/dist/entry-72.js +1 -1
  96. package/dist/entry-73.js +1 -1
  97. package/dist/entry-74.js +1 -1
  98. package/dist/entry-75.js +1 -1
  99. package/dist/entry-76.js +1 -1
  100. package/dist/entry-77.js +1 -0
  101. package/dist/entry-78.js +0 -1
  102. package/dist/entry-79.js +1 -0
  103. package/dist/entry-8.js +1 -1
  104. package/dist/entry-80.js +0 -1
  105. package/dist/entry-81.js +1 -1
  106. package/dist/entry-82.js +1 -1
  107. package/dist/entry-83.js +1 -1
  108. package/dist/entry-84.js +1 -1
  109. package/dist/entry-85.js +1 -2
  110. package/dist/entry-86.js +2 -1
  111. package/dist/entry-87.js +1 -1
  112. package/dist/entry-88.js +1 -1
  113. package/dist/entry-89.js +1 -1
  114. package/dist/entry-9.js +1 -1
  115. package/dist/entry-90.js +1 -3
  116. package/dist/entry-91.js +3 -1
  117. package/dist/entry-92.js +1 -1
  118. package/dist/entry-93.js +1 -1
  119. package/dist/entry-94.js +1 -0
  120. package/dist/pi-agent-ide.js +13 -10
  121. package/docs/agent-guides/editing.md +3 -0
  122. package/docs/tools.md +2 -2
  123. package/node_modules/pi-agent-doctor/package.json +7 -7
  124. package/node_modules/pi-agent-documentation/package.json +2 -2
  125. package/node_modules/pi-agent-documentation/runtime/entry-30.js +1 -0
  126. package/node_modules/pi-agent-filesystem/package.json +8 -8
  127. package/node_modules/pi-agent-filesystem-image/package.json +4 -4
  128. package/node_modules/pi-agent-filesystem-image/runtime/entry-32.js +2 -0
  129. package/node_modules/pi-agent-filesystem-jq/package.json +7 -7
  130. package/node_modules/pi-agent-filesystem-jq/runtime/entry-33.js +0 -1
  131. package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
  132. package/node_modules/pi-agent-filesystem-text/package.json +4 -4
  133. package/node_modules/pi-agent-filesystem-text/runtime/entry-36.js +2 -0
  134. package/node_modules/pi-agent-ide-ast/package.json +15 -15
  135. package/node_modules/pi-agent-ide-ast/runtime/entry-37.js +0 -1
  136. package/node_modules/pi-agent-ide-ast/runtime/entry-38.js +2 -0
  137. package/node_modules/pi-agent-ide-changes/package.json +10 -10
  138. package/node_modules/pi-agent-ide-changes/runtime/entry-39.js +0 -1
  139. package/node_modules/pi-agent-ide-formatter/package.json +4 -4
  140. package/node_modules/pi-agent-ide-languages/package.json +3 -3
  141. package/node_modules/pi-agent-ide-lint/package.json +8 -8
  142. package/node_modules/pi-agent-ide-lsp/package.json +13 -13
  143. package/node_modules/pi-agent-ide-lsp/runtime/entry-44.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 -12
  148. package/node_modules/pi-agent-read/runtime/entry-51.js +0 -1
  149. package/node_modules/pi-agent-read/runtime/entry-52.js +2 -0
  150. package/node_modules/pi-agent-resource/package.json +2 -2
  151. package/node_modules/pi-agent-search/package.json +9 -9
  152. package/node_modules/pi-agent-search/runtime/entry-56.js +0 -1
  153. package/node_modules/pi-agent-search-text/package.json +15 -15
  154. package/node_modules/pi-agent-search-text/runtime/entry-58.js +1 -0
  155. package/node_modules/pi-agent-text/package.json +3 -3
  156. package/node_modules/pi-agent-text/runtime/entry-62.js +1 -0
  157. package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
  158. package/node_modules/pi-agent-text-anchor-constant/runtime/entry-63.js +2 -0
  159. package/node_modules/pi-agent-text-anchor-exact/package.json +5 -5
  160. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-64.js +0 -1
  161. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-65.js +2 -0
  162. package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
  163. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-66.js +0 -1
  164. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-67.js +2 -0
  165. package/node_modules/pi-agent-text-editor/package.json +26 -26
  166. package/node_modules/pi-agent-text-editor/runtime/entry-83.js +0 -1
  167. package/node_modules/pi-agent-text-editor/src/core/result-transfer.ts +2 -6
  168. package/node_modules/pi-agent-text-editor/src/core/text-change-engine.ts +17 -36
  169. package/node_modules/pi-agent-text-editor/src/tools/text-selection.ts +40 -82
  170. package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +1 -1
  171. package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +5 -9
  172. package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +1 -3
  173. package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +7 -5
  174. package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +2 -8
  175. package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
  176. package/node_modules/pi-agent-text-editor-stale-anchor/package.json +6 -6
  177. package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-86.js +2 -0
  178. package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
  179. package/node_modules/pi-agent-tool-ui/package.json +3 -3
  180. package/node_modules/pi-agent-tool-ui/runtime/entry-89.js +1 -0
  181. package/node_modules/pi-agent-web/package.json +8 -8
  182. package/node_modules/pi-agent-web-html/package.json +3 -3
  183. package/node_modules/pi-agent-web-image/package.json +4 -4
  184. package/node_modules/pi-agent-web-pdf/package.json +4 -4
  185. package/node_modules/pi-agent-web-text/package.json +4 -4
  186. package/node_modules/pi-agent-web-text/runtime/entry-94.js +2 -0
  187. package/package.json +61 -57
  188. package/src/api/capabilities.ts +60 -0
  189. package/src/composite/capabilities.ts +252 -0
  190. package/src/composite/capability-schemas.ts +53 -0
  191. package/src/composite/responses-tools.ts +27 -9
  192. package/src/composite/tool-availability.ts +28 -13
  193. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +8 -8
  194. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
  195. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-32.js +2 -0
  196. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +7 -7
  197. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-33.js +0 -1
  198. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
  199. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
  200. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-36.js +2 -0
  201. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-31.js +2 -0
  202. package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -8
  203. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -3
  204. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
  205. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
  206. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
  207. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-94.js +2 -0
  208. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-90.js +2 -0
  209. package/src/extensions/pi-agent-read/package.json +12 -12
  210. package/src/extensions/pi-agent-read/runtime/entry-51.js +0 -1
  211. package/src/extensions/pi-agent-read/runtime/entry-52.js +2 -0
  212. package/src/extensions/pi-agent-search/package.json +9 -9
  213. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +15 -15
  214. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-58.js +1 -0
  215. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-61.js +1 -0
  216. package/src/extensions/pi-agent-search/runtime/entry-56.js +0 -1
  217. package/src/extensions/pi-agent-search/runtime/entry-57.js +2 -0
  218. package/src/extensions/pi-agent-text-editor/package.json +26 -26
  219. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
  220. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-63.js +2 -0
  221. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -5
  222. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-64.js +0 -1
  223. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-65.js +2 -0
  224. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
  225. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-66.js +0 -1
  226. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-67.js +2 -0
  227. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
  228. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +6 -6
  229. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-86.js +2 -0
  230. package/src/extensions/pi-agent-text-editor/runtime/entry-83.js +0 -1
  231. package/src/extensions/pi-agent-text-editor/runtime/entry-84.js +2 -0
  232. package/src/extensions/pi-agent-text-editor/src/core/result-transfer.ts +2 -6
  233. package/src/extensions/pi-agent-text-editor/src/core/text-change-engine.ts +17 -36
  234. package/src/extensions/pi-agent-text-editor/src/tools/text-selection.ts +40 -82
  235. package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +1 -1
  236. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +5 -9
  237. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +1 -3
  238. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +7 -5
  239. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +2 -8
  240. package/src/pi-agent-ide.ts +4 -1
  241. package/src/plugins/pi-agent-ide-ast/package.json +15 -15
  242. package/src/plugins/pi-agent-ide-ast/runtime/entry-37.js +0 -1
  243. package/src/plugins/pi-agent-ide-ast/runtime/entry-38.js +2 -0
  244. package/src/plugins/pi-agent-ide-changes/package.json +10 -10
  245. package/src/plugins/pi-agent-ide-changes/runtime/entry-39.js +0 -1
  246. package/src/plugins/pi-agent-ide-debugger/index.ts +31 -26
  247. package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
  248. package/src/plugins/pi-agent-ide-languages/package.json +3 -3
  249. package/src/plugins/pi-agent-ide-lint/package.json +8 -8
  250. package/src/plugins/pi-agent-ide-lsp/package.json +13 -13
  251. package/src/plugins/pi-agent-ide-lsp/runtime/entry-44.js +2 -0
  252. package/src/plugins/pi-agent-ide-terminal/index.ts +42 -0
  253. package/src/plugins/pi-agent-ide-terminal/src/resources.ts +0 -21
  254. package/src/plugins/pi-agent-ide-terminal/src/search.ts +0 -3
  255. package/dist/chunk-7URANI6I.js +0 -28
  256. package/dist/chunk-K4UTEMDU.js +0 -1
  257. package/dist/chunk-TNAUCNUT.js +0 -33
  258. package/dist/entry-23.js +0 -1
  259. package/node_modules/pi-agent-doctor/runtime/entry-23.js +0 -1
  260. package/node_modules/pi-agent-filesystem/runtime/entry-30.js +0 -2
  261. package/node_modules/pi-agent-filesystem-jq/runtime/entry-32.js +0 -1
  262. package/node_modules/pi-agent-ide-ast/runtime/entry-36.js +0 -1
  263. package/node_modules/pi-agent-ide-changes/runtime/entry-38.js +0 -1
  264. package/node_modules/pi-agent-image/runtime/entry-44.js +0 -1
  265. package/node_modules/pi-agent-resource/runtime/entry-52.js +0 -1
  266. package/node_modules/pi-agent-text-anchor-constant/runtime/entry-62.js +0 -2
  267. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-63.js +0 -1
  268. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-65.js +0 -1
  269. package/node_modules/pi-agent-text-editor/runtime/entry-67.js +0 -1
  270. package/node_modules/pi-agent-tool-call-interception/runtime/entry-86.js +0 -1
  271. package/node_modules/pi-agent-web/runtime/entry-89.js +0 -2
  272. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-31.js +0 -2
  273. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-32.js +0 -1
  274. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-30.js +0 -2
  275. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-90.js +0 -2
  276. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-89.js +0 -2
  277. package/src/extensions/pi-agent-read/runtime/entry-47.js +0 -1
  278. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-57.js +0 -2
  279. package/src/extensions/pi-agent-search/runtime/entry-53.js +0 -1
  280. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-62.js +0 -2
  281. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-63.js +0 -1
  282. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-65.js +0 -1
  283. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-84.js +0 -2
  284. package/src/extensions/pi-agent-text-editor/runtime/entry-67.js +0 -1
  285. package/src/plugins/pi-agent-ide-ast/runtime/entry-36.js +0 -1
  286. package/src/plugins/pi-agent-ide-changes/runtime/entry-38.js +0 -1
  287. /package/node_modules/{pi-agent-documentation → pi-agent-doctor}/runtime/entry-29.js +0 -0
  288. /package/node_modules/{pi-agent-filesystem-image → pi-agent-filesystem}/runtime/entry-31.js +0 -0
  289. /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem-jq}/runtime/entry-34.js +0 -0
  290. /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-35.js +0 -0
  291. /package/node_modules/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-40.js +0 -0
  292. /package/node_modules/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-41.js +0 -0
  293. /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-42.js +0 -0
  294. /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-43.js +0 -0
  295. /package/node_modules/{pi-agent-invariant → pi-agent-image}/runtime/entry-45.js +0 -0
  296. /package/node_modules/{pi-agent-pdf → pi-agent-invariant}/runtime/entry-46.js +0 -0
  297. /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-47.js +0 -0
  298. /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-53.js +0 -0
  299. /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-57.js +0 -0
  300. /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-61.js +0 -0
  301. /package/node_modules/{pi-agent-text-editor-renderer → pi-agent-text-editor}/runtime/entry-84.js +0 -0
  302. /package/node_modules/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-85.js +0 -0
  303. /package/node_modules/{pi-agent-tool-ui → pi-agent-tool-call-interception}/runtime/entry-87.js +0 -0
  304. /package/node_modules/{pi-agent-web-html → pi-agent-web}/runtime/entry-90.js +0 -0
  305. /package/node_modules/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-91.js +0 -0
  306. /package/node_modules/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-92.js +0 -0
  307. /package/node_modules/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-93.js +0 -0
  308. /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-pdf → pi-agent-filesystem-jq}/runtime/entry-34.js +0 -0
  309. /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-35.js +0 -0
  310. /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-91.js +0 -0
  311. /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-92.js +0 -0
  312. /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-93.js +0 -0
  313. /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-85.js +0 -0
  314. /package/src/plugins/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-40.js +0 -0
  315. /package/src/plugins/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-41.js +0 -0
  316. /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-42.js +0 -0
  317. /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-43.js +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-text-editor",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
@@ -8,82 +8,82 @@
8
8
  "exports": {
9
9
  "./api/anchor-inspection": {
10
10
  "types": "./src/api/anchor-inspection.ts",
11
- "default": "./runtime/entry-67.js"
11
+ "default": "./runtime/entry-68.js"
12
12
  },
13
13
  "./api/connect-plugin": {
14
14
  "types": "./src/api/connect-plugin.ts",
15
- "default": "./runtime/entry-68.js"
15
+ "default": "./runtime/entry-69.js"
16
16
  },
17
17
  "./api/edit-completion": {
18
18
  "types": "./src/api/edit-completion.ts",
19
- "default": "./runtime/entry-69.js"
19
+ "default": "./runtime/entry-70.js"
20
20
  },
21
21
  "./api/edit-pipeline": {
22
22
  "types": "./src/api/edit-pipeline.ts",
23
- "default": "./runtime/entry-70.js"
23
+ "default": "./runtime/entry-71.js"
24
24
  },
25
25
  "./api/plugin-protocol": {
26
26
  "types": "./src/api/plugin-protocol.ts",
27
- "default": "./runtime/entry-71.js"
27
+ "default": "./runtime/entry-72.js"
28
28
  },
29
29
  "./api/stale-anchor-message": {
30
30
  "types": "./src/api/stale-anchor-message.ts",
31
- "default": "./runtime/entry-72.js"
31
+ "default": "./runtime/entry-73.js"
32
32
  },
33
33
  "./api/text-selection-anchor": {
34
34
  "types": "./src/api/text-selection-anchor.ts",
35
- "default": "./runtime/entry-73.js"
35
+ "default": "./runtime/entry-74.js"
36
36
  },
37
37
  "./api/post-edit": {
38
38
  "types": "./src/api/post-edit.ts",
39
- "default": "./runtime/entry-74.js"
39
+ "default": "./runtime/entry-75.js"
40
40
  },
41
41
  "./api/native-edit-batch-event": {
42
42
  "types": "./src/api/native-edit-batch-event.ts",
43
- "default": "./runtime/entry-75.js"
43
+ "default": "./runtime/entry-76.js"
44
44
  },
45
45
  "./api/mutation-result": {
46
46
  "types": "./src/api/mutation-result.ts",
47
- "default": "./runtime/entry-76.js"
47
+ "default": "./runtime/entry-77.js"
48
48
  },
49
49
  "./api/mutation-guard": {
50
50
  "types": "./src/api/mutation-guard.ts",
51
- "default": "./runtime/entry-77.js"
51
+ "default": "./runtime/entry-78.js"
52
52
  },
53
53
  "./api/mutation-tool": {
54
54
  "types": "./src/api/mutation-tool.ts",
55
- "default": "./runtime/entry-78.js"
55
+ "default": "./runtime/entry-79.js"
56
56
  },
57
57
  "./api/mutation-preview": {
58
58
  "types": "./src/api/mutation-preview.ts",
59
- "default": "./runtime/entry-79.js"
59
+ "default": "./runtime/entry-80.js"
60
60
  },
61
61
  "./api/last-resolved-resource": {
62
62
  "types": "./src/api/last-resolved-resource.ts",
63
- "default": "./runtime/entry-80.js"
63
+ "default": "./runtime/entry-81.js"
64
64
  },
65
65
  "./api/tool-call-interceptor": {
66
66
  "types": "./src/api/tool-call-interceptor.ts",
67
- "default": "./runtime/entry-81.js"
67
+ "default": "./runtime/entry-82.js"
68
68
  },
69
69
  "./api/tool-renderer": {
70
70
  "types": "./src/api/tool-renderer.ts",
71
- "default": "./runtime/entry-82.js"
71
+ "default": "./runtime/entry-83.js"
72
72
  }
73
73
  },
74
74
  "dependencies": {
75
- "pi-agent-documentation": "0.9.0",
76
- "pi-agent-invariant": "0.9.0",
77
- "pi-agent-read": "0.9.0",
78
- "pi-agent-resource": "0.9.0",
79
- "pi-agent-search": "0.9.0",
80
- "pi-agent-text": "0.9.0",
81
- "pi-agent-tool-call-interception": "0.9.0",
82
- "pi-agent-tool-ui": "0.9.0"
75
+ "pi-agent-documentation": "0.9.2",
76
+ "pi-agent-invariant": "0.9.2",
77
+ "pi-agent-read": "0.9.2",
78
+ "pi-agent-resource": "0.9.2",
79
+ "pi-agent-search": "0.9.2",
80
+ "pi-agent-text": "0.9.2",
81
+ "pi-agent-tool-call-interception": "0.9.2",
82
+ "pi-agent-tool-ui": "0.9.2"
83
83
  },
84
84
  "pi": {
85
85
  "extensions": [
86
- "./runtime/entry-83.js"
86
+ "./runtime/entry-84.js"
87
87
  ]
88
88
  },
89
89
  "peerDependencies": {
@@ -1,2 +1 @@
1
1
  export * from "../../../dist/entry-83.js";
2
- export { default } from "../../../dist/entry-83.js";
@@ -5,11 +5,7 @@ import type {
5
5
  TextMutationEdit,
6
6
  } from "#src/api/mutation-tool.js";
7
7
  import { TextChangeDocument, type TextChange } from "./text-change-engine.js";
8
- import {
9
- anchorSpanRange,
10
- insertionAfterAnchor,
11
- replaceAnchorSpan,
12
- } from "#src/tools/text-selection.js";
8
+ import { anchorSpanRange, insertionAfterAnchor } from "#src/tools/text-selection.js";
13
9
  import { wholeFileResultSource } from "./result-input.js";
14
10
 
15
11
  /** Distinguish structured source authority from ordinary paths and legacy anchors. */
@@ -176,7 +172,7 @@ export async function prepareResultTransfer(
176
172
  );
177
173
  planned.push({
178
174
  target,
179
- change: replaceAnchorSpan(context, target, copied),
175
+ change: { from: target.from, to: target.to, insert: copied },
180
176
  });
181
177
  }
182
178
  }
@@ -80,13 +80,21 @@ export class TextChangeDocument {
80
80
  }
81
81
 
82
82
  public deleteLines(firstLine: number, lastLine: number): TextChange {
83
- const range = this.lineRange(firstLine, lastLine);
84
-
85
- if (range.to === this.content.length && range.from > 0 && !endsWithLineBreak(this.content)) {
86
- return { from: previousLineBreakStart(this.content, range.from), to: range.to, insert: "" };
87
- }
83
+ return this.replaceLines(firstLine, lastLine, "");
84
+ }
88
85
 
89
- return { ...range, insert: "" };
86
+ /** Insert at a character boundary; separators are added only when requested. */
87
+ public insertAt(from: number, text: string, separation?: LineSeparation): TextChange {
88
+ this.#assertRange({ from, to: from });
89
+ if (text.length === 0) throw new Error("Insert text must not be empty.");
90
+ if (separation === undefined) return { from, to: from, insert: text };
91
+ const prefix =
92
+ from > 0 && !endsWithLineBreak(this.content.slice(0, from)) ? this.#separator : "";
93
+ return {
94
+ from,
95
+ to: from,
96
+ insert: this.#lineInsertion(from, text, separation, from < this.content.length, prefix),
97
+ };
90
98
  }
91
99
 
92
100
  public insertBeforeLine(
@@ -94,13 +102,7 @@ export class TextChangeDocument {
94
102
  text: string,
95
103
  separation: LineSeparation = "line",
96
104
  ): TextChange {
97
- this.#assertLine(lineNumber);
98
- const from = requiredValue(this.#lineStarts[lineNumber - 1]);
99
- return {
100
- from,
101
- to: from,
102
- insert: this.#lineInsertion(from, text, separation, from < this.content.length),
103
- };
105
+ return this.insertAt(this.lineRange(lineNumber, lineNumber).from, text, separation);
104
106
  }
105
107
 
106
108
  public insertAfterLine(
@@ -108,24 +110,7 @@ export class TextChangeDocument {
108
110
  text: string,
109
111
  separation: LineSeparation = "line",
110
112
  ): TextChange {
111
- this.#assertLine(lineNumber);
112
- const nextLine = this.#lineStarts[lineNumber];
113
-
114
- if (nextLine !== undefined) {
115
- return {
116
- from: nextLine,
117
- to: nextLine,
118
- insert: this.#lineInsertion(nextLine, text, separation, nextLine < this.content.length),
119
- };
120
- }
121
-
122
- const prefix =
123
- this.content.length > 0 && !endsWithLineBreak(this.content) ? this.#separator : "";
124
- return {
125
- from: this.content.length,
126
- to: this.content.length,
127
- insert: this.#lineInsertion(this.content.length, text, separation, false, prefix),
128
- };
113
+ return this.insertAt(this.lineRange(lineNumber, lineNumber).to, text, separation);
129
114
  }
130
115
 
131
116
  public replaceAll(text: string): TextChange {
@@ -134,7 +119,7 @@ export class TextChangeDocument {
134
119
 
135
120
  #replacementText(range: TextRange, text: string): string {
136
121
  const selected = this.text(range);
137
- return endsWithLineBreak(selected) && !endsWithLineBreak(text)
122
+ return text.length > 0 && endsWithLineBreak(selected) && !endsWithLineBreak(text)
138
123
  ? text + requiredValue(lineBreakOf(selected))
139
124
  : text;
140
125
  }
@@ -290,7 +275,3 @@ function endsWithLineBreak(text: string): boolean {
290
275
  function lineBreakOf(text: string): "\n" | "\r\n" | undefined {
291
276
  return text.endsWith("\r\n") ? "\r\n" : text.endsWith("\n") ? "\n" : undefined;
292
277
  }
293
-
294
- function previousLineBreakStart(text: string, offset: number): number {
295
- return text[offset - 2] === "\r" && text[offset - 1] === "\n" ? offset - 2 : offset - 1;
296
- }
@@ -39,10 +39,6 @@ export interface TextAnchorSpan {
39
39
  readonly to: number;
40
40
  readonly selection: boolean;
41
41
  readonly preservesTrailingLineBreak: boolean;
42
- /** First selected line when this span represents whole lines. */
43
- readonly linewiseStartLine?: number;
44
- /** Last selected line when this span represents whole lines. */
45
- readonly linewiseEndLine?: number;
46
42
  }
47
43
 
48
44
  /** Resolves one anchor to one character span, converting line anchors to whole-line spans. */
@@ -50,7 +46,6 @@ export function singleAnchorSpan(
50
46
  context: TextMutationContext,
51
47
  anchors: ReadonlyMap<string, TextAnchor>,
52
48
  field: string,
53
- wholeLines = false,
54
49
  rangeEndpoint = false,
55
50
  ): TextAnchorSpan {
56
51
  if (anchors.size !== 1) {
@@ -67,9 +62,7 @@ export function singleAnchorSpan(
67
62
  );
68
63
  const document = context.documentFor(source);
69
64
  const exactRange = selectionRange(context, source, selectedRange);
70
- const endLine = wholeLines
71
- ? containingEndLine(selectedRange)
72
- : linewiseSelectionEndLine(selectedRange);
65
+ const endLine = linewiseSelectionEndLine(selectedRange);
73
66
  if (endLine !== undefined) {
74
67
  const range = document.lineRange(selectedRange.start.lineNumber, endLine);
75
68
  return {
@@ -77,8 +70,6 @@ export function singleAnchorSpan(
77
70
  ...range,
78
71
  selection: false,
79
72
  preservesTrailingLineBreak: true,
80
- linewiseStartLine: selectedRange.start.lineNumber,
81
- linewiseEndLine: endLine,
82
73
  };
83
74
  }
84
75
  return { source, ...exactRange, selection: true, preservesTrailingLineBreak: false };
@@ -90,29 +81,9 @@ export function singleAnchorSpan(
90
81
  ...range,
91
82
  selection: false,
92
83
  preservesTrailingLineBreak: true,
93
- linewiseStartLine: anchor.lineNumber,
94
- linewiseEndLine: anchor.lineNumber,
95
84
  };
96
85
  }
97
86
 
98
- /**
99
- * Text to transfer into a destination. A whole-line literal source selects its line, but an
100
- * exact character destination receives the literal itself, so no extra line break is added.
101
- */
102
- export function transferText(
103
- context: TextMutationContext,
104
- starts: ReadonlyMap<string, TextAnchor>,
105
- ends: ReadonlyMap<string, TextAnchor> | undefined,
106
- sourceSpan: TextAnchorSpan,
107
- targetSpan: TextAnchorSpan | undefined,
108
- ): string {
109
- const span =
110
- ends === undefined && targetSpan?.selection === true && !sourceSpan.selection
111
- ? singleAnchorSpan(context, starts, "start", false, true)
112
- : sourceSpan;
113
- return context.documentFor(span.source).text(span);
114
- }
115
-
116
87
  /** Whether an endpoint selects complete lines: a line anchor or text matching a whole line. */
117
88
  function selectsWholeLines(anchors: ReadonlyMap<string, TextAnchor>): boolean {
118
89
  const anchor = anchors.values().next().value;
@@ -134,8 +105,8 @@ export function anchorSpanRange(
134
105
  ): TextAnchorSpan {
135
106
  if (ends === undefined) return singleAnchorSpan(context, starts, startField);
136
107
  const exactEndpoints = !(selectsWholeLines(starts) && selectsWholeLines(ends));
137
- const start = singleAnchorSpan(context, starts, startField, false, exactEndpoints);
138
- const end = singleAnchorSpan(context, ends, endField, false, exactEndpoints);
108
+ const start = singleAnchorSpan(context, starts, startField, exactEndpoints);
109
+ const end = singleAnchorSpan(context, ends, endField, exactEndpoints);
139
110
  if (start.source !== end.source) {
140
111
  throw new Error(`Anchors ${startField} and ${endField} must resolve in one resource.`);
141
112
  }
@@ -163,7 +134,7 @@ export function replaceAnchorSpan(
163
134
  span: TextAnchorSpan,
164
135
  text: string,
165
136
  ): { readonly from: number; readonly to: number; readonly insert: string } {
166
- if (text === "") return deleteAnchorSpan(context, span);
137
+ if (text === "") return deleteAnchorSpan(span);
167
138
  const document = context.documentFor(span.source);
168
139
  let insert = targetText(context, span.source, text);
169
140
  const selected = document.text(span);
@@ -176,28 +147,32 @@ export function replaceAnchorSpan(
176
147
  return { from: span.from, to: span.to, insert };
177
148
  }
178
149
 
179
- /** Creates a deletion while keeping whole-line deletion behavior at EOF. */
180
- export function deleteAnchorSpan(
181
- context: TextMutationContext,
182
- span: TextAnchorSpan,
183
- ): { readonly from: number; readonly to: number; readonly insert: "" } {
184
- const content = context.documentFor(span.source).content;
185
- if (
186
- !span.selection &&
187
- span.to === content.length &&
188
- span.from > 0 &&
189
- !/(?:\r\n|\r|\n)$/u.test(content)
190
- ) {
191
- const prefix = content.slice(0, span.from);
192
- const match = /(?:\r\n|\r|\n)$/u.exec(prefix);
193
- if (match !== null) {
194
- return { from: span.from - match[0].length, to: span.to, insert: "" };
195
- }
196
- }
150
+ /** Deletes exactly the resolved extent, including only its own line separator. */
151
+ export function deleteAnchorSpan(span: TextAnchorSpan): {
152
+ readonly from: number;
153
+ readonly to: number;
154
+ readonly insert: "";
155
+ } {
197
156
  return { from: span.from, to: span.to, insert: "" };
198
157
  }
199
158
 
200
- /** Inserts after the last containing line of one resolved anchor. */
159
+ function insertionAtSpan(
160
+ context: TextMutationContext,
161
+ span: Pick<TextAnchorSpan, "source" | "from" | "to" | "selection">,
162
+ insert: string,
163
+ before: boolean,
164
+ separation: "line" | "blank-line",
165
+ ) {
166
+ return context
167
+ .documentFor(span.source)
168
+ .insertAt(
169
+ before ? span.from : span.to,
170
+ insert,
171
+ !span.selection || separation === "blank-line" ? separation : undefined,
172
+ );
173
+ }
174
+
175
+ /** Inserts transferred text after the resolved selection without normalizing its bytes. */
201
176
  export function insertionAfterAnchor(
202
177
  context: TextMutationContext,
203
178
  anchors: ReadonlyMap<string, TextAnchor>,
@@ -205,17 +180,11 @@ export function insertionAfterAnchor(
205
180
  insert: string,
206
181
  separation: "line" | "blank-line" = "line",
207
182
  ): readonly [string, { readonly from: number; readonly to: number; readonly insert: string }] {
208
- const span = singleAnchorSpan(context, anchors, field, true);
209
- const normalizedInsert = targetText(context, span.source, insert);
210
-
211
- const lineNumber = span.linewiseEndLine ?? lineAnchor(anchors, field).lineNumber;
212
- return [
213
- span.source,
214
- context.documentFor(span.source).insertAfterLine(lineNumber, normalizedInsert, separation),
215
- ];
183
+ const span = singleAnchorSpan(context, anchors, field);
184
+ return [span.source, insertionAtSpan(context, span, insert, false, separation)];
216
185
  }
217
186
 
218
- /** Inserts before the first containing line of one resolved anchor. */
187
+ /** Inserts transferred text before the resolved selection without normalizing its bytes. */
219
188
  export function insertionBeforeAnchor(
220
189
  context: TextMutationContext,
221
190
  anchors: ReadonlyMap<string, TextAnchor>,
@@ -223,14 +192,8 @@ export function insertionBeforeAnchor(
223
192
  insert: string,
224
193
  separation: "line" | "blank-line" = "line",
225
194
  ): readonly [string, { readonly from: number; readonly to: number; readonly insert: string }] {
226
- const span = singleAnchorSpan(context, anchors, field, true);
227
- const normalizedInsert = targetText(context, span.source, insert);
228
-
229
- const lineNumber = span.linewiseStartLine ?? lineAnchor(anchors, field).lineNumber;
230
- return [
231
- span.source,
232
- context.documentFor(span.source).insertBeforeLine(lineNumber, normalizedInsert, separation),
233
- ];
195
+ const span = singleAnchorSpan(context, anchors, field);
196
+ return [span.source, insertionAtSpan(context, span, insert, true, separation)];
234
197
  }
235
198
 
236
199
  function coalesceAdjacentLinewiseRanges(
@@ -297,20 +260,15 @@ export function insertionChanges(
297
260
  return new Map(
298
261
  [...selections].map(([source, anchor]) => [
299
262
  source,
300
- [
301
- ...new Set(
302
- anchor.ranges.map((range) => {
303
- selectionRange(context, source, range);
304
- return before ? range.start.lineNumber : containingEndLine(range);
305
- }),
263
+ anchor.ranges.map((range) =>
264
+ insertionAtSpan(
265
+ context,
266
+ { source, ...selectionRange(context, source, range), selection: range.linewise !== true },
267
+ targetText(context, source, insert),
268
+ before,
269
+ separation,
306
270
  ),
307
- ].map((line) => {
308
- const document = context.documentFor(source);
309
- const normalizedInsert = targetText(context, source, insert);
310
- return before
311
- ? document.insertBeforeLine(line, normalizedInsert, separation)
312
- : document.insertAfterLine(line, normalizedInsert, separation);
313
- }),
271
+ ),
314
272
  ]),
315
273
  );
316
274
  }
@@ -40,7 +40,7 @@ export function targetProperties(directorySemantics: string) {
40
40
  targetStart: Type.Optional(
41
41
  Type.String({
42
42
  description:
43
- "Anchor or unique exact text in the destination file; the text goes after its line. Required when the text goes into a file path.",
43
+ "Anchor or unique exact text in the destination file; the text goes after its selected extent. Required when the text goes into a file path.",
44
44
  }),
45
45
  ),
46
46
  targetEnd: Type.Optional(
@@ -7,12 +7,7 @@ import {
7
7
  } from "#src/tools/text-tool-schema-properties.js";
8
8
 
9
9
  import { TEXT_POSITION_ANCHOR_KIND, TEXT_SEARCH_ANCHOR_KIND } from "#src/api/plugin-protocol.js";
10
- import {
11
- anchorSpanRange,
12
- transferText,
13
- insertionAfterAnchor,
14
- replaceAnchorSpan,
15
- } from "#src/tools/text-selection.js";
10
+ import { anchorSpanRange, insertionAfterAnchor } from "#src/tools/text-selection.js";
16
11
 
17
12
  import type { TextMutationToolRegistration } from "#src/api/mutation-tool.js";
18
13
 
@@ -74,10 +69,10 @@ export const copyMutationTool: TextMutationToolRegistration<typeof copySchema> =
74
69
  const starts = await context.resolveAnchors("start");
75
70
  const ends = parameters.end === undefined ? undefined : await context.resolveAnchors("end");
76
71
  const sourceSpan = anchorSpanRange(context, starts, ends, "start", "end");
72
+ const copied = context.documentFor(sourceSpan.source).text(sourceSpan);
77
73
 
78
74
  const targetStarts = await context.resolveAnchors("targetStart");
79
75
  if (parameters.targetEnd === undefined) {
80
- const copied = context.documentFor(sourceSpan.source).text(sourceSpan);
81
76
  const [target, change] = insertionAfterAnchor(context, targetStarts, "targetStart", copied);
82
77
  return {
83
78
  edits: new Map([
@@ -94,13 +89,14 @@ export const copyMutationTool: TextMutationToolRegistration<typeof copySchema> =
94
89
  "targetStart",
95
90
  "targetEnd",
96
91
  );
97
- const copied = transferText(context, starts, ends, sourceSpan, targetSpan);
98
92
  return {
99
93
  edits: new Map([
100
94
  [
101
95
  targetSpan.source,
102
96
  {
103
- changes: [{ ...replaceAnchorSpan(context, targetSpan, copied), allowUnchanged: true }],
97
+ changes: [
98
+ { from: targetSpan.from, to: targetSpan.to, insert: copied, allowUnchanged: true },
99
+ ],
104
100
  action: "edited",
105
101
  },
106
102
  ],
@@ -73,9 +73,7 @@ export const deleteMutationTool: TextMutationToolRegistration<typeof deleteSchem
73
73
  const ends = parameters.end === undefined ? undefined : await context.resolveAnchors("end");
74
74
  const span = anchorSpanRange(context, starts, ends, "start", "end");
75
75
  return {
76
- edits: new Map([
77
- [span.source, { changes: [deleteAnchorSpan(context, span)], action: "edited" }],
78
- ]),
76
+ edits: new Map([[span.source, { changes: [deleteAnchorSpan(span)], action: "edited" }]]),
79
77
  };
80
78
  },
81
79
  };
@@ -6,6 +6,7 @@ import {
6
6
  insertionBeforeAnchor,
7
7
  insertionChanges,
8
8
  textSelections,
9
+ targetText,
9
10
  } from "#src/tools/text-selection.js";
10
11
 
11
12
  import type { TextMutationToolRegistration } from "#src/api/mutation-tool.js";
@@ -21,12 +22,13 @@ export const insertSchema = Type.Object(
21
22
  anchor: Type.Optional(
22
23
  Type.String({
23
24
  description:
24
- "Line anchor or unique exact text; insertion is always whole-line. Omit when path already selects the lines.",
25
+ "Line anchor or unique exact text. Insert at the selection boundary: whole lines include their own separator; partial or multiline exact matches keep character boundaries. Omit when path already selects text.",
25
26
  }),
26
27
  ),
27
28
  text: Type.String({
28
29
  minLength: 1,
29
- description: "Non-empty text to insert; line breaks around it are added for you.",
30
+ description:
31
+ "Non-empty text to insert, using the target line-ending style. Whole-line selections add needed separators; exact fragments do not.",
30
32
  }),
31
33
  separation: Type.Optional(
32
34
  Type.Union([Type.Literal("line"), Type.Literal("blank-line")], {
@@ -36,7 +38,7 @@ export const insertSchema = Type.Object(
36
38
  before: Type.Optional(
37
39
  Type.Boolean({
38
40
  description:
39
- "true inserts before the first selected line; default false inserts after the last.",
41
+ "true inserts at the start of the selection; default false inserts at its end.",
40
42
  }),
41
43
  ),
42
44
  },
@@ -54,7 +56,7 @@ interface InsertParameters {
54
56
  export const insertMutationTool: TextMutationToolRegistration<typeof insertSchema> = {
55
57
  name: "insert",
56
58
  description:
57
- "Use insert to add text before or after lines without changing them, to send keys to a terminal session, or to control a debugger.",
59
+ "Use insert to add text at a selection boundary without changing selected text, to send keys to a terminal session, or to control a debugger.",
58
60
 
59
61
  promptSnippet: "Insert file text, send terminal keys, or perform debugger actions",
60
62
  parameters: insertSchema,
@@ -94,7 +96,7 @@ export const insertMutationTool: TextMutationToolRegistration<typeof insertSchem
94
96
  context,
95
97
  anchors,
96
98
  "anchor",
97
- parameters.text,
99
+ targetText(context, context.sourceFor("path"), parameters.text),
98
100
  parameters.separation,
99
101
  );
100
102
  return {
@@ -9,10 +9,8 @@ import {
9
9
  import { TEXT_POSITION_ANCHOR_KIND, TEXT_SEARCH_ANCHOR_KIND } from "#src/api/plugin-protocol.js";
10
10
  import {
11
11
  anchorSpanRange,
12
- transferText,
13
12
  deleteAnchorSpan,
14
13
  insertionAfterAnchor,
15
- replaceAnchorSpan,
16
14
  } from "#src/tools/text-selection.js";
17
15
 
18
16
  import type { TextMutationToolRegistration } from "#src/api/mutation-tool.js";
@@ -76,7 +74,7 @@ export const moveMutationTool: TextMutationToolRegistration<typeof moveSchema> =
76
74
  const ends = parameters.end === undefined ? undefined : await context.resolveAnchors("end");
77
75
  const sourceSpan = anchorSpanRange(context, starts, ends, "start", "end");
78
76
  const copied = context.documentFor(sourceSpan.source).text(sourceSpan);
79
- const deletion = deleteAnchorSpan(context, sourceSpan);
77
+ const deletion = deleteAnchorSpan(sourceSpan);
80
78
 
81
79
  const targetStarts = await context.resolveAnchors("targetStart");
82
80
  let target: string;
@@ -93,11 +91,7 @@ export const moveMutationTool: TextMutationToolRegistration<typeof moveSchema> =
93
91
  "targetEnd",
94
92
  );
95
93
  target = targetSpan.source;
96
- targetChange = replaceAnchorSpan(
97
- context,
98
- targetSpan,
99
- transferText(context, starts, ends, sourceSpan, targetSpan),
100
- );
94
+ targetChange = { from: targetSpan.from, to: targetSpan.to, insert: copied };
101
95
  }
102
96
 
103
97
  if (sourceSpan.source === target && rangesTouch(deletion, targetChange)) {
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "pi-agent-text-editor-renderer",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
7
7
  },
8
8
  "dependencies": {
9
- "pi-agent-invariant": "0.9.0",
10
- "pi-agent-text-editor": "0.9.0",
11
- "pi-agent-tool-call-interception": "0.9.0",
12
- "pi-agent-tool-ui": "0.9.0"
9
+ "pi-agent-invariant": "0.9.2",
10
+ "pi-agent-text-editor": "0.9.2",
11
+ "pi-agent-tool-call-interception": "0.9.2",
12
+ "pi-agent-tool-ui": "0.9.2"
13
13
  },
14
14
  "pi": {
15
15
  "extensions": [
16
- "./runtime/entry-84.js"
16
+ "./runtime/entry-85.js"
17
17
  ]
18
18
  },
19
19
  "peerDependencies": {
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "pi-agent-text-editor-stale-anchor",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "pi-agent-invariant": "0.9.0",
7
- "pi-agent-read": "0.9.0",
8
- "pi-agent-resource": "0.9.0",
9
- "pi-agent-text-editor": "0.9.0"
6
+ "pi-agent-invariant": "0.9.2",
7
+ "pi-agent-read": "0.9.2",
8
+ "pi-agent-resource": "0.9.2",
9
+ "pi-agent-text-editor": "0.9.2"
10
10
  },
11
11
  "pi": {
12
12
  "extensions": [
13
- "./runtime/entry-85.js"
13
+ "./runtime/entry-86.js"
14
14
  ]
15
15
  },
16
16
  "peerDependencies": {
@@ -0,0 +1,2 @@
1
+ export * from "../../../dist/entry-86.js";
2
+ export { default } from "../../../dist/entry-86.js";
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "pi-agent-tool-call-interception",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "type": "module",
5
5
  "types": "./src/index.ts",
6
6
  "exports": {
7
7
  ".": {
8
8
  "types": "./src/index.ts",
9
- "default": "./runtime/entry-86.js"
9
+ "default": "./runtime/entry-87.js"
10
10
  }
11
11
  },
12
12
  "dependencies": {
13
- "pi-agent-tool-ui": "0.9.0"
13
+ "pi-agent-tool-ui": "0.9.2"
14
14
  },
15
15
  "peerDependencies": {
16
16
  "@earendil-works/pi-coding-agent": "*",