pi-agent-ide 0.5.0 → 0.6.0

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 (342) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +81 -23
  3. package/assets/gallery/apply-editing.png +0 -0
  4. package/assets/gallery/debugging.png +0 -0
  5. package/assets/gallery/read-web.png +0 -0
  6. package/assets/gallery/search-replace.png +0 -0
  7. package/assets/gallery/terminal.png +0 -0
  8. package/assets/gallery/tool-editing.png +0 -0
  9. package/dist/chunk-22CLOM2D.js +1 -0
  10. package/dist/{chunk-LY6U5EAD.js → chunk-2527OQ4Y.js} +1 -1
  11. package/dist/chunk-3XJ3KDPZ.js +16 -0
  12. package/dist/chunk-5JELU6RV.js +7 -0
  13. package/dist/chunk-DDKHZZDO.js +5 -0
  14. package/dist/chunk-FEDVTZJG.js +1 -0
  15. package/dist/chunk-HSM6R7IB.js +27 -0
  16. package/dist/chunk-K5G4FDXD.js +1 -0
  17. package/dist/chunk-M5IVSCR2.js +1 -0
  18. package/dist/chunk-OYWIZII6.js +1 -0
  19. package/dist/chunk-P7XO5CIP.js +2 -0
  20. package/dist/chunk-PCZH7GOX.js +26 -0
  21. package/dist/{chunk-DQXPQOF7.js → chunk-SQ7ZTGOP.js} +1 -1
  22. package/dist/entry-10.js +1 -1
  23. package/dist/entry-11.js +1 -1
  24. package/dist/entry-12.js +1 -1
  25. package/dist/entry-13.js +1 -1
  26. package/dist/entry-14.js +1 -1
  27. package/dist/entry-15.js +1 -1
  28. package/dist/entry-16.js +1 -0
  29. package/dist/entry-18.js +1 -1
  30. package/dist/entry-19.js +1 -1
  31. package/dist/entry-20.js +1 -1
  32. package/dist/entry-21.js +1 -1
  33. package/dist/entry-22.js +1 -2
  34. package/dist/entry-23.js +2 -1
  35. package/dist/entry-24.js +1 -1
  36. package/dist/entry-25.js +1 -1
  37. package/dist/entry-26.js +1 -1
  38. package/dist/entry-27.js +1 -12
  39. package/dist/entry-28.js +12 -1
  40. package/dist/entry-29.js +1 -1
  41. package/dist/entry-30.js +1 -1
  42. package/dist/entry-31.js +1 -1
  43. package/dist/entry-32.js +1 -4
  44. package/dist/entry-33.js +3 -8
  45. package/dist/entry-34.js +9 -1
  46. package/dist/entry-35.js +1 -1
  47. package/dist/entry-36.js +1 -1
  48. package/dist/entry-37.js +1 -1
  49. package/dist/entry-38.js +1 -1
  50. package/dist/entry-39.js +1 -1
  51. package/dist/entry-40.js +1 -1
  52. package/dist/entry-41.js +1 -18
  53. package/dist/entry-42.js +18 -1
  54. package/dist/entry-43.js +1 -1
  55. package/dist/entry-44.js +1 -1
  56. package/dist/entry-45.js +1 -1
  57. package/dist/entry-46.js +1 -7
  58. package/dist/entry-47.js +7 -11
  59. package/dist/entry-48.js +11 -1
  60. package/dist/entry-49.js +1 -1
  61. package/dist/entry-50.js +1 -1
  62. package/dist/entry-51.js +1 -1
  63. package/dist/entry-52.js +1 -1
  64. package/dist/entry-53.js +1 -1
  65. package/dist/entry-54.js +1 -1
  66. package/dist/entry-55.js +1 -1
  67. package/dist/entry-56.js +1 -0
  68. package/dist/entry-57.js +0 -1
  69. package/dist/entry-58.js +1 -0
  70. package/dist/entry-59.js +0 -1
  71. package/dist/entry-60.js +1 -1
  72. package/dist/entry-61.js +1 -1
  73. package/dist/entry-62.js +1 -1
  74. package/dist/entry-63.js +1 -1
  75. package/dist/entry-64.js +1 -1
  76. package/dist/entry-65.js +1 -0
  77. package/dist/entry-66.js +0 -1
  78. package/dist/entry-67.js +1 -0
  79. package/dist/entry-68.js +0 -1
  80. package/dist/entry-69.js +1 -1
  81. package/dist/entry-70.js +1 -1
  82. package/dist/entry-71.js +1 -203
  83. package/dist/entry-72.js +254 -25
  84. package/dist/entry-73.js +30 -2
  85. package/dist/entry-74.js +2 -1
  86. package/dist/entry-75.js +1 -1
  87. package/dist/entry-76.js +1 -1
  88. package/dist/entry-77.js +3 -3
  89. package/dist/entry-78.js +3 -1
  90. package/dist/entry-79.js +1 -1
  91. package/dist/entry-80.js +1 -1
  92. package/dist/entry-81.js +1 -0
  93. package/dist/pi-agent-ide.js +3 -3
  94. package/docs/configuration.md +3 -1
  95. package/docs/development.md +0 -6
  96. package/docs/tools.md +12 -0
  97. package/node_modules/pi-agent-doctor/package.json +6 -6
  98. package/node_modules/pi-agent-doctor/runtime/entry-22.js +1 -0
  99. package/node_modules/pi-agent-filesystem/package.json +7 -7
  100. package/node_modules/pi-agent-filesystem-image/package.json +4 -4
  101. package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
  102. package/node_modules/pi-agent-filesystem-text/package.json +4 -4
  103. package/node_modules/pi-agent-filesystem-text/runtime/entry-26.js +2 -0
  104. package/node_modules/pi-agent-ide-ast/package.json +12 -11
  105. package/node_modules/pi-agent-ide-ast/runtime/entry-27.js +0 -1
  106. package/node_modules/pi-agent-ide-ast/runtime/entry-28.js +2 -0
  107. package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +8 -6
  108. package/node_modules/pi-agent-ide-changes/package.json +8 -8
  109. package/node_modules/pi-agent-ide-changes/runtime/entry-29.js +0 -1
  110. package/node_modules/pi-agent-ide-formatter/package.json +4 -4
  111. package/node_modules/pi-agent-ide-languages/package.json +3 -3
  112. package/node_modules/pi-agent-ide-lint/package.json +8 -8
  113. package/node_modules/pi-agent-ide-lint/src/command-linter.ts +3 -1
  114. package/node_modules/pi-agent-ide-lsp/package.json +10 -10
  115. package/node_modules/pi-agent-ide-lsp/runtime/entry-34.js +2 -0
  116. package/node_modules/pi-agent-image/package.json +3 -3
  117. package/node_modules/pi-agent-invariant/package.json +2 -2
  118. package/node_modules/pi-agent-pdf/package.json +3 -3
  119. package/node_modules/pi-agent-read/package.json +11 -11
  120. package/node_modules/pi-agent-read/runtime/entry-41.js +0 -1
  121. package/node_modules/pi-agent-read/runtime/entry-42.js +2 -0
  122. package/node_modules/pi-agent-read/src/api/read-parameters.ts +2 -2
  123. package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +11 -6
  124. package/node_modules/pi-agent-resource/package.json +2 -2
  125. package/node_modules/pi-agent-search/package.json +7 -7
  126. package/node_modules/pi-agent-search/runtime/entry-46.js +0 -1
  127. package/node_modules/pi-agent-search-text/package.json +9 -9
  128. package/node_modules/pi-agent-search-text/runtime/entry-48.js +1 -0
  129. package/node_modules/pi-agent-search-text/src/resolvers.ts +32 -27
  130. package/node_modules/pi-agent-search-text/src/search-session.ts +27 -1
  131. package/node_modules/pi-agent-text/package.json +3 -3
  132. package/node_modules/pi-agent-text/runtime/entry-50.js +1 -0
  133. package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
  134. package/node_modules/pi-agent-text-anchor-constant/runtime/entry-51.js +2 -0
  135. package/node_modules/pi-agent-text-anchor-exact/index.ts +3 -3
  136. package/node_modules/pi-agent-text-anchor-exact/package.json +5 -5
  137. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-52.js +0 -1
  138. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-53.js +2 -0
  139. package/node_modules/pi-agent-text-anchor-exact/src/config.ts +2 -2
  140. package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
  141. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-54.js +0 -1
  142. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-55.js +2 -0
  143. package/node_modules/pi-agent-text-editor/package.json +25 -25
  144. package/node_modules/pi-agent-text-editor/runtime/entry-71.js +0 -1
  145. package/node_modules/pi-agent-text-editor/src/core/apply/execution.ts +125 -3
  146. package/node_modules/pi-agent-text-editor/src/core/apply/mixed-source.ts +1 -1
  147. package/node_modules/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +14 -0
  148. package/node_modules/pi-agent-text-editor/src/core/apply/output.ts +32 -3
  149. package/node_modules/pi-agent-text-editor/src/core/apply/prompt.ts +21 -19
  150. package/node_modules/pi-agent-text-editor/src/core/apply/renderer.ts +37 -0
  151. package/node_modules/pi-agent-text-editor/src/core/apply/runtime.ts +85 -34
  152. package/node_modules/pi-agent-text-editor/src/core/apply/tool.ts +2 -3
  153. package/node_modules/pi-agent-text-editor/src/core/apply/transaction.ts +589 -241
  154. package/node_modules/pi-agent-text-editor/src/core/post-edit-scope.ts +5 -0
  155. package/node_modules/pi-agent-text-editor/src/core/text-editor-config.ts +3 -3
  156. package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +9 -1
  157. package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +53 -0
  158. package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +11 -41
  159. package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +8 -18
  160. package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +11 -41
  161. package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +9 -19
  162. package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
  163. package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
  164. package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-74.js +2 -0
  165. package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
  166. package/node_modules/pi-agent-tool-ui/package.json +2 -2
  167. package/node_modules/pi-agent-tool-ui/runtime/entry-76.js +1 -0
  168. package/node_modules/pi-agent-web/package.json +7 -7
  169. package/node_modules/pi-agent-web/src/resolver.ts +128 -1
  170. package/node_modules/pi-agent-web-html/package.json +3 -3
  171. package/node_modules/pi-agent-web-image/package.json +4 -4
  172. package/node_modules/pi-agent-web-pdf/package.json +4 -4
  173. package/node_modules/pi-agent-web-text/package.json +4 -4
  174. package/node_modules/pi-agent-web-text/runtime/entry-81.js +2 -0
  175. package/package.json +44 -39
  176. package/src/api/path-identity.ts +15 -0
  177. package/src/composite/builtin-extensions.ts +7 -2
  178. package/src/composite/module-labels.ts +4 -0
  179. package/src/composite/module-settings.ts +34 -14
  180. package/src/composite/preferences.ts +46 -3
  181. package/src/composite/selection.ts +5 -1
  182. package/src/doctor/inventory.ts +7 -2
  183. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
  184. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
  185. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
  186. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
  187. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-26.js +2 -0
  188. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-23.js +2 -0
  189. package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +7 -7
  190. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -3
  191. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
  192. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
  193. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
  194. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-81.js +2 -0
  195. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-77.js +2 -0
  196. package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/resolver.ts +128 -1
  197. package/src/extensions/pi-agent-read/package.json +11 -11
  198. package/src/extensions/pi-agent-read/runtime/entry-41.js +0 -1
  199. package/src/extensions/pi-agent-read/runtime/entry-42.js +2 -0
  200. package/src/extensions/pi-agent-read/src/api/read-parameters.ts +2 -2
  201. package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +11 -6
  202. package/src/extensions/pi-agent-search/package.json +7 -7
  203. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +9 -9
  204. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-48.js +1 -0
  205. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-49.js +1 -0
  206. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +32 -27
  207. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +27 -1
  208. package/src/extensions/pi-agent-search/runtime/entry-46.js +0 -1
  209. package/src/extensions/pi-agent-search/runtime/entry-47.js +2 -0
  210. package/src/extensions/pi-agent-text-editor/package.json +25 -25
  211. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
  212. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-51.js +2 -0
  213. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.ts +3 -3
  214. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -5
  215. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-52.js +0 -1
  216. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-53.js +2 -0
  217. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/config.ts +2 -2
  218. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
  219. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-54.js +0 -1
  220. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-55.js +2 -0
  221. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
  222. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -5
  223. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-74.js +2 -0
  224. package/src/extensions/pi-agent-text-editor/runtime/entry-71.js +0 -1
  225. package/src/extensions/pi-agent-text-editor/runtime/entry-72.js +2 -0
  226. package/src/extensions/pi-agent-text-editor/src/core/apply/execution.ts +125 -3
  227. package/src/extensions/pi-agent-text-editor/src/core/apply/mixed-source.ts +1 -1
  228. package/src/extensions/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +14 -0
  229. package/src/extensions/pi-agent-text-editor/src/core/apply/output.ts +32 -3
  230. package/src/extensions/pi-agent-text-editor/src/core/apply/prompt.ts +21 -19
  231. package/src/extensions/pi-agent-text-editor/src/core/apply/renderer.ts +37 -0
  232. package/src/extensions/pi-agent-text-editor/src/core/apply/runtime.ts +85 -34
  233. package/src/extensions/pi-agent-text-editor/src/core/apply/tool.ts +2 -3
  234. package/src/extensions/pi-agent-text-editor/src/core/apply/transaction.ts +589 -241
  235. package/src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts +5 -0
  236. package/src/extensions/pi-agent-text-editor/src/core/text-editor-config.ts +3 -3
  237. package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +9 -1
  238. package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +53 -0
  239. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +11 -41
  240. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +8 -18
  241. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +11 -41
  242. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +9 -19
  243. package/src/pi-agent-ide.ts +15 -2
  244. package/src/plugins/pi-agent-ide-ast/package.json +12 -11
  245. package/src/plugins/pi-agent-ide-ast/runtime/entry-27.js +0 -1
  246. package/src/plugins/pi-agent-ide-ast/runtime/entry-28.js +2 -0
  247. package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +8 -6
  248. package/src/plugins/pi-agent-ide-changes/package.json +8 -8
  249. package/src/plugins/pi-agent-ide-changes/runtime/entry-29.js +0 -1
  250. package/src/plugins/pi-agent-ide-debugger/index.ts +3 -9
  251. package/src/plugins/pi-agent-ide-debugger/src/adapter-executables.ts +31 -0
  252. package/src/plugins/pi-agent-ide-debugger/src/breakpoint-view.ts +3 -1
  253. package/src/plugins/pi-agent-ide-debugger/src/catalog.ts +24 -23
  254. package/src/plugins/pi-agent-ide-debugger/src/dap-client.ts +5 -2
  255. package/src/plugins/pi-agent-ide-debugger/src/doctor-plugin.ts +55 -17
  256. package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +55 -22
  257. package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
  258. package/src/plugins/pi-agent-ide-languages/package.json +3 -3
  259. package/src/plugins/pi-agent-ide-lint/package.json +8 -8
  260. package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +3 -1
  261. package/src/plugins/pi-agent-ide-lsp/package.json +10 -10
  262. package/src/plugins/pi-agent-ide-lsp/runtime/entry-34.js +2 -0
  263. package/src/plugins/pi-agent-ide-processes/src/registry.ts +6 -0
  264. package/src/plugins/pi-agent-ide-processes/src/ui.ts +28 -11
  265. package/src/plugins/pi-agent-ide-terminal/index.ts +1 -1
  266. package/src/plugins/pi-agent-ide-terminal/src/process-provider.ts +2 -0
  267. package/src/plugins/pi-agent-ide-terminal/src/search.ts +32 -2
  268. package/src/plugins/pi-agent-ide-terminal/src/session-manager.ts +5 -4
  269. package/src/plugins/pi-agent-ide-terminal/src/tools.ts +2 -2
  270. package/src/plugins/pi-agent-ide-terminal/src/types.ts +3 -1
  271. package/src/plugins/pi-agent-ide-terminal/src/ui.ts +1 -1
  272. package/src/plugins/pi-agent-ide-vision/index.ts +232 -0
  273. package/src/plugins/pi-agent-ide-vision/src/vision.ts +530 -0
  274. package/src/plugins/pi-agent-ide-vision/src/windows-display-capture.ps1 +30 -0
  275. package/src/plugins/pi-agent-ide-vision/src/windows-window-capture.ps1 +33 -0
  276. package/dist/chunk-5PLV4HLG.js +0 -1
  277. package/dist/chunk-BGUSBUUD.js +0 -26
  278. package/dist/chunk-G725MARR.js +0 -16
  279. package/dist/chunk-HKXDP2FD.js +0 -7
  280. package/dist/chunk-J4RTW44E.js +0 -1
  281. package/dist/chunk-QH4ZUDOD.js +0 -1
  282. package/dist/chunk-WGGIQ7IJ.js +0 -1
  283. package/dist/chunk-ZG2MWXCR.js +0 -2
  284. package/dist/chunk-ZUMN6U77.js +0 -27
  285. package/dist/entry-17.js +0 -1
  286. package/docs/evaluation.md +0 -14
  287. package/node_modules/pi-agent-doctor/runtime/entry-17.js +0 -1
  288. package/node_modules/pi-agent-filesystem/runtime/entry-22.js +0 -2
  289. package/node_modules/pi-agent-ide-ast/runtime/entry-26.js +0 -1
  290. package/node_modules/pi-agent-ide-changes/runtime/entry-28.js +0 -1
  291. package/node_modules/pi-agent-image/runtime/entry-34.js +0 -1
  292. package/node_modules/pi-agent-resource/runtime/entry-42.js +0 -1
  293. package/node_modules/pi-agent-text-anchor-constant/runtime/entry-50.js +0 -2
  294. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-51.js +0 -1
  295. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-53.js +0 -1
  296. package/node_modules/pi-agent-text-editor/runtime/entry-55.js +0 -1
  297. package/node_modules/pi-agent-tool-call-interception/runtime/entry-74.js +0 -1
  298. package/node_modules/pi-agent-web/runtime/entry-76.js +0 -2
  299. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-23.js +0 -2
  300. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-22.js +0 -2
  301. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-77.js +0 -2
  302. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-76.js +0 -2
  303. package/src/extensions/pi-agent-read/runtime/entry-37.js +0 -1
  304. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-47.js +0 -2
  305. package/src/extensions/pi-agent-search/runtime/entry-43.js +0 -1
  306. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-50.js +0 -2
  307. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-51.js +0 -1
  308. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-53.js +0 -1
  309. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-72.js +0 -2
  310. package/src/extensions/pi-agent-text-editor/runtime/entry-55.js +0 -1
  311. package/src/plugins/pi-agent-ide-ast/runtime/entry-26.js +0 -1
  312. package/src/plugins/pi-agent-ide-changes/runtime/entry-28.js +0 -1
  313. /package/node_modules/{pi-agent-filesystem-image → pi-agent-filesystem}/runtime/entry-23.js +0 -0
  314. /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-24.js +0 -0
  315. /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-25.js +0 -0
  316. /package/node_modules/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-30.js +0 -0
  317. /package/node_modules/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-31.js +0 -0
  318. /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-32.js +0 -0
  319. /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-33.js +0 -0
  320. /package/node_modules/{pi-agent-invariant → pi-agent-image}/runtime/entry-35.js +0 -0
  321. /package/node_modules/{pi-agent-pdf → pi-agent-invariant}/runtime/entry-36.js +0 -0
  322. /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-37.js +0 -0
  323. /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-43.js +0 -0
  324. /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-47.js +0 -0
  325. /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-49.js +0 -0
  326. /package/node_modules/{pi-agent-text-editor-renderer → pi-agent-text-editor}/runtime/entry-72.js +0 -0
  327. /package/node_modules/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-73.js +0 -0
  328. /package/node_modules/{pi-agent-tool-ui → pi-agent-tool-call-interception}/runtime/entry-75.js +0 -0
  329. /package/node_modules/{pi-agent-web-html → pi-agent-web}/runtime/entry-77.js +0 -0
  330. /package/node_modules/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-78.js +0 -0
  331. /package/node_modules/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-79.js +0 -0
  332. /package/node_modules/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-80.js +0 -0
  333. /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-24.js +0 -0
  334. /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-25.js +0 -0
  335. /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-78.js +0 -0
  336. /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-79.js +0 -0
  337. /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-80.js +0 -0
  338. /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-73.js +0 -0
  339. /package/src/plugins/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-30.js +0 -0
  340. /package/src/plugins/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-31.js +0 -0
  341. /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-32.js +0 -0
  342. /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-33.js +0 -0
@@ -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
29
  assertKeys(root, ["recovery", "renderer"], "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,
@@ -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,
@@ -43,6 +43,20 @@ export default async function registerUnifiedPiAgentIde(pi: ExtensionAPI): Promi
43
43
  "Skip automatic formatting and diagnostics after edits. Explicit diagnostic reads still work.",
44
44
  default: false,
45
45
  });
46
+ flags.register({
47
+ id: "pi-agent-ide-vision-arbitrary-windows",
48
+ name: "Capture arbitrary windows",
49
+ description:
50
+ "Allow window:PID capture for processes not owned by Agent IDE. Keep disabled unless the agent may inspect other desktop apps.",
51
+ default: false,
52
+ });
53
+ flags.register({
54
+ id: "pi-agent-ide-vision-displays",
55
+ name: "Capture full displays",
56
+ description:
57
+ "Allow display screenshots through display: and display:#N resources. Keep disabled unless the agent may inspect the full desktop.",
58
+ default: false,
59
+ });
46
60
  flags.register({
47
61
  id: "pi-agent-ide-no-apply",
48
62
  name: "Disable Apply",
@@ -68,8 +82,7 @@ export default async function registerUnifiedPiAgentIde(pi: ExtensionAPI): Promi
68
82
  });
69
83
  registerModuleSettings(pi, flags.definitions, AGENT_IDE_PREFERENCES);
70
84
  const { enabled } = selectBuiltinExtensions(BUILTIN_EXTENSIONS, config.disabled, config.enabled);
71
-
72
85
  for (const extension of enabled) {
73
- await extension.register(pi);
86
+ await extension.register(pi, { preferences: config.preferences ?? {} });
74
87
  }
75
88
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-ide-ast",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
@@ -8,7 +8,7 @@
8
8
  "exports": {
9
9
  "./api/scope": {
10
10
  "types": "./src/api/scope.ts",
11
- "default": "./runtime/entry-26.js"
11
+ "default": "./runtime/entry-27.js"
12
12
  }
13
13
  },
14
14
  "dependencies": {
@@ -30,13 +30,14 @@
30
30
  "@ast-grep/napi": "^0.42.3",
31
31
  "@tree-sitter-grammars/tree-sitter-toml": "^0.7.0",
32
32
  "@tree-sitter-grammars/tree-sitter-yaml": "^0.7.1",
33
- "pi-agent-doctor": "0.5.0",
34
- "pi-agent-invariant": "0.5.0",
35
- "pi-agent-read": "0.5.0",
36
- "pi-agent-resource": "0.5.0",
37
- "pi-agent-search": "0.5.0",
38
- "pi-agent-text": "0.5.0",
39
- "pi-agent-text-editor": "0.5.0",
33
+ "cross-spawn": "^7.0.6",
34
+ "pi-agent-doctor": "0.6.0",
35
+ "pi-agent-invariant": "0.6.0",
36
+ "pi-agent-read": "0.6.0",
37
+ "pi-agent-resource": "0.6.0",
38
+ "pi-agent-search": "0.6.0",
39
+ "pi-agent-text": "0.6.0",
40
+ "pi-agent-text-editor": "0.6.0",
40
41
  "tree-sitter-cpp": "^0.23.4",
41
42
  "tree-sitter-javascript": "^0.25.0",
42
43
  "tree-sitter-json": "^0.24.8",
@@ -47,12 +48,12 @@
47
48
  },
48
49
  "pi": {
49
50
  "extensions": [
50
- "./runtime/entry-27.js"
51
+ "./runtime/entry-28.js"
51
52
  ]
52
53
  },
53
54
  "peerDependencies": {
54
55
  "@earendil-works/pi-coding-agent": "*",
55
- "pi-agent-ide": "0.5.0"
56
+ "pi-agent-ide": "0.6.0"
56
57
  },
57
58
  "peerDependenciesMeta": {
58
59
  "pi-agent-ide": {
@@ -1,2 +1 @@
1
1
  export * from "../../../../dist/entry-27.js";
2
- export { default } from "../../../../dist/entry-27.js";
@@ -0,0 +1,2 @@
1
+ export * from "../../../../dist/entry-28.js";
2
+ export { default } from "../../../../dist/entry-28.js";
@@ -1,4 +1,5 @@
1
- import { spawn } from "node:child_process";
1
+ import spawn from "cross-spawn";
2
+ import type { ChildProcessWithoutNullStreams } from "node:child_process";
2
3
  import { readFile, stat } from "node:fs/promises";
3
4
  import path from "node:path";
4
5
  import type { SearchPluginApi, SearchSelectionMatch } from "pi-agent-search/api/search";
@@ -35,7 +36,6 @@ export function createAstSearchResolver(
35
36
  }
36
37
 
37
38
  const collect = async (signal?: AbortSignal) => {
38
- const started = Date.now();
39
39
  const found = await runAstGrep(pattern, request, context.cwd, signal);
40
40
  found.sort(
41
41
  (a, b) =>
@@ -46,7 +46,7 @@ export function createAstSearchResolver(
46
46
  const raw = found.slice(0, request.limit ?? 100);
47
47
  return {
48
48
  raw,
49
- matches: await selectionMatches(raw, context.cwd, started, signal),
49
+ matches: await selectionMatches(raw, context.cwd, signal),
50
50
  complete: found.length <= (request.limit ?? 100),
51
51
  };
52
52
  };
@@ -101,7 +101,6 @@ export function createAstSearchResolver(
101
101
  async function selectionMatches(
102
102
  matches: readonly AstGrepMatch[],
103
103
  cwd: string,
104
- started: number,
105
104
  signal?: AbortSignal,
106
105
  ): Promise<SearchSelectionMatch[]> {
107
106
  const sources = new Map<string, Buffer>();
@@ -111,7 +110,7 @@ async function selectionMatches(
111
110
  const before = await stat(source);
112
111
  const bytes = await readFile(source, { signal });
113
112
  const after = await stat(source);
114
- if (before.mtimeMs > started || before.mtimeMs !== after.mtimeMs || before.size !== after.size)
113
+ if (before.mtimeMs !== after.mtimeMs || before.size !== after.size)
115
114
  throw new Error("AST source changed during search. Run the structural query again.");
116
115
  sources.set(source, bytes);
117
116
  }
@@ -161,7 +160,10 @@ function runAstGrep(
161
160
 
162
161
  arguments_.push(request.path ?? ".");
163
162
  return new Promise((resolve, reject) => {
164
- const child = spawn("ast-grep", arguments_, { cwd, stdio: ["ignore", "pipe", "pipe"] });
163
+ const child = spawn("ast-grep", arguments_, {
164
+ cwd,
165
+ stdio: ["ignore", "pipe", "pipe"],
166
+ }) as ChildProcessWithoutNullStreams;
165
167
  let stdout = "";
166
168
  let stderr = "";
167
169
  child.stdout.setEncoding("utf8");
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-ide-changes",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
@@ -8,20 +8,20 @@
8
8
  "exports": {
9
9
  "./changes/change-groups": {
10
10
  "types": "./src/changes/change-groups.ts",
11
- "default": "./runtime/entry-28.js"
11
+ "default": "./runtime/entry-29.js"
12
12
  }
13
13
  },
14
14
  "dependencies": {
15
15
  "diff": "^9.0.0",
16
- "pi-agent-doctor": "0.5.0",
17
- "pi-agent-invariant": "0.5.0",
18
- "pi-agent-read": "0.5.0",
19
- "pi-agent-text": "0.5.0",
20
- "pi-agent-text-editor": "0.5.0"
16
+ "pi-agent-doctor": "0.6.0",
17
+ "pi-agent-invariant": "0.6.0",
18
+ "pi-agent-read": "0.6.0",
19
+ "pi-agent-text": "0.6.0",
20
+ "pi-agent-text-editor": "0.6.0"
21
21
  },
22
22
  "pi": {
23
23
  "extensions": [
24
- "./runtime/entry-29.js"
24
+ "./runtime/entry-30.js"
25
25
  ]
26
26
  },
27
27
  "peerDependencies": {
@@ -1,2 +1 @@
1
1
  export * from "../../../../dist/entry-29.js";
2
- export { default } from "../../../../dist/entry-29.js";
@@ -178,7 +178,7 @@ export default async function registerDebugger(pi: ExtensionAPI): Promise<void>
178
178
  'views: ["breakpoints"] — show current debugger breakpoints beside source lines. On a normal file, all current sessions are included; on a debug source, results are session-scoped. debug:<session> — debugger state. Read the returned debug source before selecting a breakpoint line.',
179
179
  );
180
180
  api.addPromptGuideline(
181
- 'Use views: ["breakpoints"] when current breakpoint locations matter. Create a debug session with debug. Set adapter to elixir for Elixir or r for R. Read the returned debug source to get current anchors, insert text "breakpoint" at one source anchor, then insert "start" on the session. Use read for the latest stop and delete for a breakpoint or the session.',
181
+ 'Use views: ["breakpoints"] when current breakpoint locations matter. Create a debug session with debug. Read the returned debug source to get current anchors, insert text "breakpoint" at one source anchor, then insert "start" on the session. Use read for the latest stop and delete for a breakpoint or the session.',
182
182
  );
183
183
  },
184
184
  } satisfies ReadPlugin;
@@ -324,14 +324,8 @@ export default async function registerDebugger(pi: ExtensionAPI): Promise<void>
324
324
  name: "debug",
325
325
  label: "Debug session",
326
326
  promptSnippet: "Create a local DAP debug session before setting anchored breakpoints",
327
- promptGuidelines: [
328
- "Use the returned debug source resource rather than the filesystem path when setting breakpoints; its anchors are checked against fresh text without editing that text.",
329
- "Use java for Java, kotlin for Kotlin, lldb-dap for C, C++, Rust, Swift, or Zig, and julia for Julia.",
330
- "Use lldb-dap for C, C++, Rust, Swift, or Zig; use julia for Julia.",
331
- "Use elixir for Elixir; use r for R.",
332
- ],
333
327
  description:
334
- "Use debug to create a configured local debugger session. This does not launch the program yet. Sessions survive extension reloads and keep the same debug: resources. Read the returned debug source, set breakpoints with insert, then start and control execution by inserting commands on the session resource.",
328
+ "Use debug to create a configured local debugger session. This does not launch the program yet. The returned debug: resource survives extension reloads.",
335
329
  parameters: debugParameters,
336
330
  async execute(_toolCallId, input, _signal, _onUpdate, context) {
337
331
  const cwd = path.resolve(context.cwd, input.cwd ?? ".");
@@ -396,7 +390,7 @@ export default async function registerDebugger(pi: ExtensionAPI): Promise<void>
396
390
 
397
391
  pi.on("session_shutdown", (event) => {
398
392
  removeProcessProvider();
399
- if (event.reason === "reload") {
393
+ if (event.reason !== "quit") {
400
394
  retainReloadResource("debugger", manager);
401
395
  return;
402
396
  }
@@ -0,0 +1,31 @@
1
+ import { isExecutableAvailable } from "pi-agent-doctor/api/executable";
2
+
3
+ /** A debugger runtime command and arguments that precede adapter-specific arguments. */
4
+ export interface DebuggerRuntimeCommand {
5
+ readonly command: string;
6
+ readonly args: readonly string[];
7
+ }
8
+
9
+ /** Resolve the first available Python 3 interpreter for debugger launch and Doctor probes. */
10
+ export async function resolvePythonDebuggerCommand(
11
+ cwd: string,
12
+ env: NodeJS.ProcessEnv = process.env,
13
+ platform: NodeJS.Platform = process.platform,
14
+ ): Promise<DebuggerRuntimeCommand> {
15
+ if (env.PI_PYTHON_PATH !== undefined) return { command: env.PI_PYTHON_PATH, args: [] };
16
+ const candidates: readonly DebuggerRuntimeCommand[] =
17
+ platform === "win32"
18
+ ? [
19
+ { command: "python", args: [] },
20
+ { command: "python3", args: [] },
21
+ { command: "py", args: ["-3"] },
22
+ ]
23
+ : [
24
+ { command: "python3", args: [] },
25
+ { command: "python", args: [] },
26
+ ];
27
+ for (const candidate of candidates) {
28
+ if (await isExecutableAvailable(candidate.command, cwd, env)) return candidate;
29
+ }
30
+ return candidates[0] as DebuggerRuntimeCommand;
31
+ }
@@ -15,7 +15,9 @@ export function createBreakpointPresenter(manager: DebugSessionManager): TextLin
15
15
  present(document, context) {
16
16
  const debugSession = manager.get(context.source);
17
17
  const sourceFile =
18
- manager.sourceFile(context.source) ?? filesystemSource(document.source, context.cwd);
18
+ manager.sourceFile(context.source) ??
19
+ filesystemSource(context.source, context.cwd) ??
20
+ filesystemSource(document.source, context.cwd);
19
21
  if (sourceFile === undefined) return document;
20
22
  const breakpoints = manager.breakpointsForFile(sourceFile, debugSession?.source);
21
23
  if (breakpoints.length === 0) return document;