pi-agent-ide 0.7.2 → 0.8.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 (683) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/README.md +65 -17
  3. package/dist/{chunk-KOVPDKSJ.js → chunk-2K65BSXS.js} +1 -1
  4. package/dist/chunk-3G54ZL2L.js +1 -0
  5. package/dist/chunk-3ZGDMTMD.js +25 -0
  6. package/dist/{chunk-ZIWPKIBZ.js → chunk-4OYVLXWD.js} +1 -1
  7. package/dist/chunk-4W7GH3T7.js +10 -0
  8. package/dist/chunk-4XPUN4QN.js +2 -0
  9. package/dist/chunk-5KFVDYCI.js +1 -0
  10. package/dist/chunk-6EDOLYOV.js +1 -0
  11. package/dist/chunk-756K3LJY.js +1 -0
  12. package/dist/chunk-75SWXD2Z.js +9 -0
  13. package/dist/chunk-7HDK3NRQ.js +1 -0
  14. package/dist/chunk-7JV4VN73.js +1 -0
  15. package/dist/chunk-7NS3QUIE.js +9 -0
  16. package/dist/chunk-7TJ6DWW3.js +2 -0
  17. package/dist/chunk-ABFCAOU5.js +1 -0
  18. package/dist/chunk-BIG45IPN.js +2 -0
  19. package/dist/chunk-BQ67M4NC.js +3 -0
  20. package/dist/chunk-BXGMMZT3.js +1 -0
  21. package/dist/chunk-CPZJPGLG.js +1 -0
  22. package/dist/chunk-CSXHCSTH.js +9 -0
  23. package/dist/chunk-CTJV77FR.js +1 -0
  24. package/dist/chunk-DUUOCBS3.js +3 -0
  25. package/dist/chunk-E4HPRLRB.js +1 -0
  26. package/dist/chunk-EY65TFHJ.js +1 -0
  27. package/dist/chunk-GW6NZQTQ.js +1 -0
  28. package/dist/chunk-HCN5W76B.js +1 -0
  29. package/dist/chunk-ICDI27GZ.js +1 -0
  30. package/dist/{chunk-SNF7PDDX.js → chunk-IH5NW5JX.js} +1 -1
  31. package/dist/chunk-IMGIDBCC.js +1 -0
  32. package/dist/chunk-IUSLSROY.js +1 -0
  33. package/dist/chunk-KL776TGR.js +1 -0
  34. package/dist/chunk-L2B4DTVS.js +1 -0
  35. package/dist/chunk-LEKC4GQK.js +5 -0
  36. package/dist/chunk-MKEC3U2M.js +4 -0
  37. package/dist/chunk-MOJ5RR35.js +1 -0
  38. package/dist/{chunk-H445SHSJ.js → chunk-MZXX353D.js} +1 -1
  39. package/dist/{chunk-ZTYWHL2F.js → chunk-N7LMRL64.js} +1 -1
  40. package/dist/chunk-NULNW6GK.js +1 -0
  41. package/dist/chunk-O36UC74T.js +1 -0
  42. package/dist/chunk-OFILFO6D.js +1 -0
  43. package/dist/chunk-OJX3RJ5A.js +1 -0
  44. package/dist/chunk-OLI3JPHJ.js +28 -0
  45. package/dist/{chunk-S6QRG3TQ.js → chunk-OM4LYD3S.js} +1 -1
  46. package/dist/chunk-PNP2KNGP.js +5 -0
  47. package/dist/chunk-QP2QSQ4U.js +2 -0
  48. package/dist/chunk-R2U5WXYR.js +1 -0
  49. package/dist/chunk-R5XJSEOE.js +3 -0
  50. package/dist/{chunk-7UGNGK7Y.js → chunk-RAZP42IQ.js} +1 -1
  51. package/dist/chunk-S72FVLUX.js +1 -0
  52. package/dist/chunk-SBLKPTL3.js +1 -0
  53. package/dist/chunk-SBNR4WZF.js +1 -0
  54. package/dist/chunk-SSWUUBIR.js +1 -0
  55. package/dist/chunk-T4FTT3U4.js +1 -0
  56. package/dist/chunk-TOYN4W4F.js +1 -0
  57. package/dist/chunk-TWWND6NI.js +1 -0
  58. package/dist/chunk-UBH6X3D3.js +1 -0
  59. package/dist/{chunk-QFTBY67N.js → chunk-UEVGZUII.js} +3 -3
  60. package/dist/chunk-UUJJRXHG.js +29 -0
  61. package/dist/chunk-VDP5CQHM.js +3 -0
  62. package/dist/chunk-WE42GBGU.js +4 -0
  63. package/dist/chunk-XZDOVPRC.js +1 -0
  64. package/dist/chunk-YJ6T3PEP.js +1 -0
  65. package/dist/chunk-Z3PGADVA.js +3 -0
  66. package/dist/{chunk-QDLTO5PH.js → chunk-ZAWRSA7N.js} +1 -1
  67. package/dist/entry-0.js +1 -1
  68. package/dist/entry-1.js +1 -1
  69. package/dist/entry-10.js +1 -1
  70. package/dist/entry-11.js +1 -1
  71. package/dist/entry-13.js +1 -1
  72. package/dist/entry-14.js +1 -1
  73. package/dist/entry-15.js +1 -1
  74. package/dist/entry-17.js +1 -1
  75. package/dist/entry-2.js +1 -1
  76. package/dist/entry-20.js +1 -1
  77. package/dist/entry-21.js +1 -1
  78. package/dist/entry-22.js +1 -1
  79. package/dist/entry-23.js +1 -1
  80. package/dist/entry-24.js +1 -1
  81. package/dist/entry-25.js +1 -2
  82. package/dist/entry-26.js +2 -1
  83. package/dist/entry-27.js +1 -2
  84. package/dist/entry-28.js +4 -1
  85. package/dist/entry-29.js +1 -1
  86. package/dist/entry-30.js +1 -1
  87. package/dist/entry-31.js +1 -17
  88. package/dist/entry-32.js +18 -1
  89. package/dist/entry-33.js +1 -2
  90. package/dist/entry-34.js +1 -1
  91. package/dist/entry-35.js +1 -1
  92. package/dist/entry-36.js +1 -4
  93. package/dist/entry-37.js +1 -9
  94. package/dist/entry-38.js +1 -1
  95. package/dist/entry-39.js +1 -1
  96. package/dist/entry-4.js +1 -1
  97. package/dist/entry-40.js +1 -1
  98. package/dist/entry-41.js +1 -1
  99. package/dist/entry-42.js +1 -1
  100. package/dist/entry-43.js +1 -1
  101. package/dist/entry-44.js +1 -1
  102. package/dist/entry-45.js +1 -25
  103. package/dist/entry-46.js +25 -1
  104. package/dist/entry-47.js +1 -1
  105. package/dist/entry-48.js +1 -1
  106. package/dist/entry-49.js +1 -1
  107. package/dist/entry-50.js +1 -3
  108. package/dist/entry-51.js +3 -13
  109. package/dist/entry-52.js +13 -1
  110. package/dist/entry-53.js +1 -1
  111. package/dist/entry-54.js +1 -1
  112. package/dist/entry-55.js +1 -1
  113. package/dist/entry-56.js +1 -1
  114. package/dist/entry-57.js +1 -1
  115. package/dist/entry-58.js +1 -1
  116. package/dist/entry-59.js +1 -1
  117. package/dist/entry-60.js +1 -1
  118. package/dist/entry-61.js +1 -0
  119. package/dist/entry-62.js +0 -1
  120. package/dist/entry-63.js +1 -0
  121. package/dist/entry-64.js +0 -1
  122. package/dist/entry-65.js +1 -1
  123. package/dist/entry-66.js +1 -1
  124. package/dist/entry-67.js +1 -1
  125. package/dist/entry-68.js +1 -1
  126. package/dist/entry-69.js +1 -1
  127. package/dist/entry-70.js +1 -1
  128. package/dist/entry-71.js +1 -0
  129. package/dist/entry-72.js +0 -1
  130. package/dist/entry-73.js +1 -0
  131. package/dist/entry-74.js +0 -1
  132. package/dist/entry-75.js +1 -1
  133. package/dist/entry-76.js +1 -1
  134. package/dist/entry-77.js +1 -75
  135. package/dist/entry-78.js +76 -14
  136. package/dist/entry-79.js +21 -2
  137. package/dist/entry-8.js +1 -1
  138. package/dist/entry-80.js +2 -1
  139. package/dist/entry-81.js +1 -1
  140. package/dist/entry-82.js +1 -5
  141. package/dist/entry-83.js +1 -3
  142. package/dist/entry-84.js +3 -1
  143. package/dist/entry-85.js +1 -1
  144. package/dist/entry-86.js +1 -1
  145. package/dist/entry-87.js +1 -0
  146. package/dist/pi-agent-ide.js +21 -21
  147. package/docs/agent-guides/debugger.md +2 -0
  148. package/docs/agent-guides/editing.md +10 -3
  149. package/docs/agent-guides/search-code.md +4 -1
  150. package/docs/agent-guides/ssh.md +58 -0
  151. package/docs/agent-guides/vision.md +6 -0
  152. package/docs/configuration.md +55 -0
  153. package/docs/development.md +4 -0
  154. package/docs/directory-operations.md +45 -0
  155. package/docs/releases.md +8 -0
  156. package/docs/research/codemode-write-context.md +56 -0
  157. package/docs/tools.md +21 -14
  158. package/docs/user-hooks.md +29 -1
  159. package/node_modules/pi-agent-doctor/package.json +6 -2
  160. package/node_modules/pi-agent-doctor/src/evidence.ts +49 -4
  161. package/node_modules/pi-agent-doctor/src/executable.ts +46 -16
  162. package/node_modules/pi-agent-doctor/src/fixtures/executable-probe.ts +78 -0
  163. package/node_modules/pi-agent-doctor/src/fixtures/probe-executable-wait.mjs +10 -0
  164. package/node_modules/pi-agent-doctor/src/plugin-protocol.ts +6 -0
  165. package/node_modules/pi-agent-doctor/src/project-probes.ts +73 -0
  166. package/node_modules/pi-agent-doctor/src/workspace.ts +106 -0
  167. package/node_modules/pi-agent-documentation/package.json +2 -2
  168. package/node_modules/pi-agent-documentation/runtime/entry-25.js +1 -0
  169. package/node_modules/pi-agent-filesystem/package.json +8 -8
  170. package/node_modules/pi-agent-filesystem/src/resolver.ts +23 -7
  171. package/node_modules/pi-agent-filesystem-image/package.json +4 -4
  172. package/node_modules/pi-agent-filesystem-jq/index.ts +33 -6
  173. package/node_modules/pi-agent-filesystem-jq/package.json +6 -6
  174. package/node_modules/pi-agent-filesystem-jq/src/jq.ts +67 -0
  175. package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
  176. package/node_modules/pi-agent-filesystem-text/package.json +4 -4
  177. package/node_modules/pi-agent-filesystem-text/runtime/entry-30.js +2 -0
  178. package/node_modules/pi-agent-ide-ast/package.json +15 -15
  179. package/node_modules/pi-agent-ide-ast/runtime/entry-31.js +0 -1
  180. package/node_modules/pi-agent-ide-ast/runtime/entry-32.js +2 -0
  181. package/node_modules/pi-agent-ide-ast/src/ast/manager.ts +2 -1
  182. package/node_modules/pi-agent-ide-ast/src/ast/outline.ts +10 -3
  183. package/node_modules/pi-agent-ide-ast/src/ast/read-text.ts +4 -1
  184. package/node_modules/pi-agent-ide-ast/src/ast/selection.ts +3 -3
  185. package/node_modules/pi-agent-ide-ast/src/doctor-plugin.ts +13 -10
  186. package/node_modules/pi-agent-ide-ast/src/extension.ts +20 -2
  187. package/node_modules/pi-agent-ide-ast/src/outline-resolver.ts +32 -4
  188. package/node_modules/pi-agent-ide-ast/src/overflow-handler.ts +9 -4
  189. package/node_modules/pi-agent-ide-ast/src/scope-handler.ts +1 -1
  190. package/node_modules/pi-agent-ide-ast/src/search-presentation.ts +4 -3
  191. package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +100 -42
  192. package/node_modules/pi-agent-ide-ast/src/select-presentation.ts +3 -2
  193. package/node_modules/pi-agent-ide-ast/src/tool-select.ts +2 -1
  194. package/node_modules/pi-agent-ide-changes/index.ts +10 -2
  195. package/node_modules/pi-agent-ide-changes/package.json +11 -10
  196. package/node_modules/pi-agent-ide-changes/runtime/entry-33.js +0 -1
  197. package/node_modules/pi-agent-ide-changes/src/change-anchor.ts +7 -2
  198. package/node_modules/pi-agent-ide-changes/src/changes/change-service.ts +18 -1
  199. package/node_modules/pi-agent-ide-changes/src/changes/change-types.ts +3 -0
  200. package/node_modules/pi-agent-ide-changes/src/changes/git-changes-backend.ts +59 -7
  201. package/node_modules/pi-agent-ide-changes/src/changes/git-paths.ts +49 -0
  202. package/node_modules/pi-agent-ide-changes/src/current-change-presenter.ts +10 -2
  203. package/node_modules/pi-agent-ide-changes/src/doctor-plugin.ts +13 -14
  204. package/node_modules/pi-agent-ide-changes/src/last-text-transaction-store.ts +2 -1
  205. package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +63 -11
  206. package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +6 -1
  207. package/node_modules/pi-agent-ide-formatter/index.ts +14 -2
  208. package/node_modules/pi-agent-ide-formatter/package.json +4 -4
  209. package/node_modules/pi-agent-ide-formatter/src/doctor-plugin.ts +47 -35
  210. package/node_modules/pi-agent-ide-formatter/src/formatter.ts +41 -11
  211. package/node_modules/pi-agent-ide-formatter/src/registry.ts +9 -28
  212. package/node_modules/pi-agent-ide-languages/package.json +3 -3
  213. package/node_modules/pi-agent-ide-lint/index.ts +35 -4
  214. package/node_modules/pi-agent-ide-lint/package.json +8 -8
  215. package/node_modules/pi-agent-ide-lint/src/command-linter.ts +14 -10
  216. package/node_modules/pi-agent-ide-lint/src/doctor-plugin.ts +47 -39
  217. package/node_modules/pi-agent-ide-lint/src/registry.ts +9 -25
  218. package/node_modules/pi-agent-ide-lsp/index.ts +108 -26
  219. package/node_modules/pi-agent-ide-lsp/package.json +10 -10
  220. package/node_modules/pi-agent-ide-lsp/runtime/entry-38.js +2 -0
  221. package/node_modules/pi-agent-ide-lsp/src/code-view-resolvers.ts +6 -2
  222. package/node_modules/pi-agent-ide-lsp/src/declaration-targets.ts +7 -2
  223. package/node_modules/pi-agent-ide-lsp/src/diagnostic-source.ts +5 -3
  224. package/node_modules/pi-agent-ide-lsp/src/doctor-plugin.ts +27 -11
  225. package/node_modules/pi-agent-ide-lsp/src/lsp/abort.ts +62 -0
  226. package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +245 -103
  227. package/node_modules/pi-agent-ide-lsp/src/lsp/code-views.ts +26 -45
  228. package/node_modules/pi-agent-ide-lsp/src/lsp/diagnostic-adapters.ts +1 -1
  229. package/node_modules/pi-agent-ide-lsp/src/lsp/document-uri.ts +40 -0
  230. package/node_modules/pi-agent-ide-lsp/src/lsp/file-watchers.ts +8 -1
  231. package/node_modules/pi-agent-ide-lsp/src/lsp/lsp-compiler.ts +24 -17
  232. package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +255 -56
  233. package/node_modules/pi-agent-ide-lsp/src/lsp/navigation.ts +51 -11
  234. package/node_modules/pi-agent-ide-lsp/src/lsp/owner-transport.ts +67 -0
  235. package/node_modules/pi-agent-ide-lsp/src/lsp/registry.ts +149 -18
  236. package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +79 -31
  237. package/node_modules/pi-agent-ide-lsp/src/lsp/symbols.ts +15 -12
  238. package/node_modules/pi-agent-ide-lsp/src/lsp/workspace-owner.ts +16 -0
  239. package/node_modules/pi-agent-ide-lsp/src/rename-plan.ts +67 -46
  240. package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +50 -19
  241. package/node_modules/pi-agent-image/package.json +3 -3
  242. package/node_modules/pi-agent-invariant/package.json +2 -2
  243. package/node_modules/pi-agent-pdf/package.json +3 -3
  244. package/node_modules/pi-agent-read/package.json +12 -12
  245. package/node_modules/pi-agent-read/runtime/entry-45.js +0 -1
  246. package/node_modules/pi-agent-read/runtime/entry-46.js +2 -0
  247. package/node_modules/pi-agent-read/src/api/tools/read.ts +4 -2
  248. package/node_modules/pi-agent-read/src/core/extension.ts +4 -1
  249. package/node_modules/pi-agent-read/src/core/tools/read/raw-read.ts +143 -69
  250. package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +25 -1
  251. package/node_modules/pi-agent-read/src/core/tools/read/result-target.ts +67 -44
  252. package/node_modules/pi-agent-read/src/core/tools/read/structured-result.ts +8 -3
  253. package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +20 -5
  254. package/node_modules/pi-agent-resource/package.json +2 -2
  255. package/node_modules/pi-agent-resource/src/content-conversion/content-host.ts +75 -16
  256. package/node_modules/pi-agent-resource/src/index.ts +3 -0
  257. package/node_modules/pi-agent-resource/src/resource-error.ts +17 -0
  258. package/node_modules/pi-agent-resource/src/resource.ts +23 -0
  259. package/node_modules/pi-agent-resource/src/result-targets.ts +16 -2
  260. package/node_modules/pi-agent-resource/src/validation.ts +2 -1
  261. package/node_modules/pi-agent-search/package.json +9 -9
  262. package/node_modules/pi-agent-search/runtime/entry-50.js +0 -1
  263. package/node_modules/pi-agent-search/src/api/plugin-protocol.ts +1 -1
  264. package/node_modules/pi-agent-search/src/api/search-parameters.ts +6 -2
  265. package/node_modules/pi-agent-search/src/api/search.ts +44 -2
  266. package/node_modules/pi-agent-search/src/core/extension.ts +2 -3
  267. package/node_modules/pi-agent-search/src/core/search-core.ts +78 -8
  268. package/node_modules/pi-agent-search-text/index.ts +35 -1
  269. package/node_modules/pi-agent-search-text/package.json +14 -12
  270. package/node_modules/pi-agent-search-text/runtime/entry-52.js +1 -0
  271. package/node_modules/pi-agent-search-text/src/doctor-plugin.ts +10 -5
  272. package/node_modules/pi-agent-search-text/src/file-search.ts +26 -3
  273. package/node_modules/pi-agent-search-text/src/fuzzy-search.ts +54 -3
  274. package/node_modules/pi-agent-search-text/src/resolvers.ts +22 -5
  275. package/node_modules/pi-agent-search-text/src/scoped-search.ts +4 -5
  276. package/node_modules/pi-agent-search-text/src/search-backend.ts +110 -12
  277. package/node_modules/pi-agent-search-text/src/search-recipe.ts +5 -1
  278. package/node_modules/pi-agent-search-text/src/search-result.ts +1 -0
  279. package/node_modules/pi-agent-search-text/src/search-session.ts +100 -24
  280. package/node_modules/pi-agent-text/package.json +3 -3
  281. package/node_modules/pi-agent-text/runtime/entry-56.js +1 -0
  282. package/node_modules/pi-agent-text/src/text-document.ts +2 -0
  283. package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
  284. package/node_modules/pi-agent-text-anchor-constant/runtime/entry-57.js +2 -0
  285. package/node_modules/pi-agent-text-anchor-exact/package.json +5 -5
  286. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-58.js +0 -1
  287. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-59.js +2 -0
  288. package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
  289. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-60.js +0 -1
  290. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-61.js +2 -0
  291. package/node_modules/pi-agent-text-anchor-line-hash/src/read-handler.ts +3 -1
  292. package/node_modules/pi-agent-text-editor/package.json +26 -26
  293. package/node_modules/pi-agent-text-editor/runtime/entry-77.js +0 -1
  294. package/node_modules/pi-agent-text-editor/src/api/delete-guard.ts +51 -0
  295. package/node_modules/pi-agent-text-editor/src/api/edit-completion.ts +3 -0
  296. package/node_modules/pi-agent-text-editor/src/api/file-operations.ts +55 -0
  297. package/node_modules/pi-agent-text-editor/src/api/file-transfers.ts +41 -0
  298. package/node_modules/pi-agent-text-editor/src/api/mutation-guard.ts +3 -0
  299. package/node_modules/pi-agent-text-editor/src/api/native-files.ts +127 -0
  300. package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +23 -1
  301. package/node_modules/pi-agent-text-editor/src/api/post-edit.ts +1 -0
  302. package/node_modules/pi-agent-text-editor/src/core/delete-policy.ts +298 -0
  303. package/node_modules/pi-agent-text-editor/src/core/extension.ts +14 -2
  304. package/node_modules/pi-agent-text-editor/src/core/file-operation-guards.ts +81 -0
  305. package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +51 -5
  306. package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +143 -57
  307. package/node_modules/pi-agent-text-editor/src/core/file-result-targets.ts +31 -2
  308. package/node_modules/pi-agent-text-editor/src/core/file-transfers.ts +206 -0
  309. package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +1 -6
  310. package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +9 -1
  311. package/node_modules/pi-agent-text-editor/src/core/mutation-result-targets.ts +91 -14
  312. package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +125 -17
  313. package/node_modules/pi-agent-text-editor/src/core/result-transfer.ts +39 -9
  314. package/node_modules/pi-agent-text-editor/src/core/structured-result.ts +7 -1
  315. package/node_modules/pi-agent-text-editor/src/core/temporary-directories.ts +116 -0
  316. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +7 -3
  317. package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +350 -25
  318. package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +132 -31
  319. package/node_modules/pi-agent-text-editor/src/core/write-agent-result.ts +69 -0
  320. package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +2 -2
  321. package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +6 -4
  322. package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +2 -2
  323. package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +6 -4
  324. package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
  325. package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +128 -23
  326. package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
  327. package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-80.js +2 -0
  328. package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
  329. package/node_modules/pi-agent-tool-ui/package.json +2 -2
  330. package/node_modules/pi-agent-tool-ui/runtime/entry-82.js +1 -0
  331. package/node_modules/pi-agent-web/index.ts +28 -4
  332. package/node_modules/pi-agent-web/package.json +8 -8
  333. package/node_modules/pi-agent-web/src/doctor-plugin.ts +21 -6
  334. package/node_modules/pi-agent-web/src/resolver.ts +12 -2
  335. package/node_modules/pi-agent-web/src/search.ts +2 -1
  336. package/node_modules/pi-agent-web-html/package.json +3 -3
  337. package/node_modules/pi-agent-web-image/package.json +4 -4
  338. package/node_modules/pi-agent-web-pdf/package.json +4 -4
  339. package/node_modules/pi-agent-web-text/package.json +4 -4
  340. package/node_modules/pi-agent-web-text/runtime/entry-87.js +2 -0
  341. package/package.json +36 -35
  342. package/src/api/doctor-runtime.ts +80 -0
  343. package/src/api/doctor.ts +6 -0
  344. package/src/api/hooks.ts +27 -0
  345. package/src/api/plugin-protocol.ts +11 -1
  346. package/src/api/tool-config.ts +143 -24
  347. package/src/backend/config.ts +85 -0
  348. package/src/backend/configured-process.ts +59 -0
  349. package/src/backend/dap-java-transport.ts +112 -0
  350. package/src/backend/dap-java-worker.py +218 -0
  351. package/src/backend/dap-node-transport.ts +112 -0
  352. package/src/backend/dap-powershell-worker.py +44 -0
  353. package/src/backend/dap-r-worker.py +210 -0
  354. package/src/backend/dap-tcp-transport.ts +42 -0
  355. package/src/backend/dap-tcp-worker.py +125 -0
  356. package/src/backend/dap-transport.ts +69 -0
  357. package/src/backend/dap-unix-worker.py +63 -0
  358. package/src/backend/debugger-registration.ts +62 -0
  359. package/src/backend/debugger-workspace-owner.ts +413 -0
  360. package/src/backend/doctor-inventory-worker.py +54 -0
  361. package/src/backend/doctor-probe-worker.py +140 -0
  362. package/src/backend/doctor-registration.ts +18 -0
  363. package/src/backend/doctor-workspace.ts +381 -0
  364. package/src/backend/file-operation-resolver.ts +58 -0
  365. package/src/backend/file-revision.ts +13 -0
  366. package/src/backend/file-transfer.ts +302 -0
  367. package/src/backend/file-watch-worker.py +119 -0
  368. package/src/backend/formatter-registration.ts +114 -0
  369. package/src/backend/git-registration.ts +60 -0
  370. package/src/backend/identity.ts +47 -0
  371. package/src/backend/index.ts +12 -0
  372. package/src/backend/lint-registration.ts +102 -0
  373. package/src/backend/lsp-file-watchers.ts +220 -0
  374. package/src/backend/lsp-registration.ts +83 -0
  375. package/src/backend/lsp-transport.ts +87 -0
  376. package/src/backend/lsp-workspace-owner.ts +50 -0
  377. package/src/backend/object-transfer.ts +299 -0
  378. package/src/backend/owned-command.ts +105 -0
  379. package/src/backend/owned-process-stop.ts +36 -0
  380. package/src/backend/owned-read-command.ts +20 -0
  381. package/src/backend/process-environment.ts +77 -0
  382. package/src/backend/process-metadata-worker.py +98 -0
  383. package/src/backend/process-metadata.ts +99 -0
  384. package/src/backend/recipe-evidence-worker.py +26 -0
  385. package/src/backend/recipe-evidence.ts +77 -0
  386. package/src/backend/registration.ts +124 -0
  387. package/src/backend/registry.ts +29 -0
  388. package/src/backend/resource-resolver.ts +147 -0
  389. package/src/backend/search-environment.ts +100 -0
  390. package/src/backend/ssh-channel-worker.py +306 -0
  391. package/src/backend/ssh-channel.ts +376 -0
  392. package/src/backend/ssh-transfer-worker.py +99 -0
  393. package/src/backend/ssh-transport.ts +54 -0
  394. package/src/backend/ssh-worker.py +730 -0
  395. package/src/backend/ssh.ts +610 -0
  396. package/src/backend/tool-config-access.ts +63 -0
  397. package/src/backend/tool-project.ts +71 -0
  398. package/src/backend/vision-capture-worker.py +319 -0
  399. package/src/backend/vision-capture.ts +165 -0
  400. package/src/backend/vision-registration.ts +104 -0
  401. package/src/backend/web-browser-worker.mjs +182 -0
  402. package/src/backend/web-browser.ts +128 -0
  403. package/src/backend/web-http-worker.py +62 -0
  404. package/src/backend/web-http.ts +79 -0
  405. package/src/backend/web-owner.ts +68 -0
  406. package/src/backend/web-registration.ts +14 -0
  407. package/src/code-view/diagnostic-view.ts +2 -2
  408. package/src/code-view/reference.ts +9 -0
  409. package/src/composite/builtin-extensions.ts +9 -14
  410. package/src/composite/module-labels.ts +1 -0
  411. package/src/composite/nested-tool-rendering.ts +130 -72
  412. package/src/core/diagnostic-store.ts +32 -10
  413. package/src/core/ide-core.ts +22 -2
  414. package/src/doctor/arguments.ts +19 -0
  415. package/src/doctor/config-writer.ts +72 -29
  416. package/src/doctor/discovery.ts +53 -15
  417. package/src/doctor/extension.ts +27 -10
  418. package/src/doctor/run.ts +42 -7
  419. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +8 -8
  420. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
  421. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/index.ts +33 -6
  422. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +6 -6
  423. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/src/jq.ts +67 -0
  424. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
  425. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
  426. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-30.js +2 -0
  427. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-26.js +2 -0
  428. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/src/resolver.ts +23 -7
  429. package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +28 -4
  430. package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -8
  431. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -3
  432. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
  433. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
  434. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
  435. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-87.js +2 -0
  436. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-83.js +2 -0
  437. package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/doctor-plugin.ts +21 -6
  438. package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/resolver.ts +12 -2
  439. package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/search.ts +2 -1
  440. package/src/extensions/pi-agent-read/package.json +12 -12
  441. package/src/extensions/pi-agent-read/runtime/entry-45.js +0 -1
  442. package/src/extensions/pi-agent-read/runtime/entry-46.js +2 -0
  443. package/src/extensions/pi-agent-read/src/api/tools/read.ts +4 -2
  444. package/src/extensions/pi-agent-read/src/core/extension.ts +4 -1
  445. package/src/extensions/pi-agent-read/src/core/tools/read/raw-read.ts +143 -69
  446. package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +25 -1
  447. package/src/extensions/pi-agent-read/src/core/tools/read/result-target.ts +67 -44
  448. package/src/extensions/pi-agent-read/src/core/tools/read/structured-result.ts +8 -3
  449. package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +20 -5
  450. package/src/extensions/pi-agent-search/package.json +9 -9
  451. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +35 -1
  452. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +14 -12
  453. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-52.js +1 -0
  454. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-55.js +1 -0
  455. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/doctor-plugin.ts +10 -5
  456. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/file-search.ts +26 -3
  457. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/fuzzy-search.ts +54 -3
  458. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +22 -5
  459. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/scoped-search.ts +4 -5
  460. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +110 -12
  461. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +5 -1
  462. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +1 -0
  463. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +100 -24
  464. package/src/extensions/pi-agent-search/runtime/entry-50.js +0 -1
  465. package/src/extensions/pi-agent-search/runtime/entry-51.js +2 -0
  466. package/src/extensions/pi-agent-search/src/api/plugin-protocol.ts +1 -1
  467. package/src/extensions/pi-agent-search/src/api/search-parameters.ts +6 -2
  468. package/src/extensions/pi-agent-search/src/api/search.ts +44 -2
  469. package/src/extensions/pi-agent-search/src/core/extension.ts +2 -3
  470. package/src/extensions/pi-agent-search/src/core/search-core.ts +78 -8
  471. package/src/extensions/pi-agent-text-editor/package.json +26 -26
  472. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
  473. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-57.js +2 -0
  474. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -5
  475. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-58.js +0 -1
  476. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-59.js +2 -0
  477. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
  478. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-60.js +0 -1
  479. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-61.js +2 -0
  480. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/read-handler.ts +3 -1
  481. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
  482. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +128 -23
  483. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -5
  484. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-80.js +2 -0
  485. package/src/extensions/pi-agent-text-editor/runtime/entry-77.js +0 -1
  486. package/src/extensions/pi-agent-text-editor/runtime/entry-78.js +2 -0
  487. package/src/extensions/pi-agent-text-editor/src/api/delete-guard.ts +51 -0
  488. package/src/extensions/pi-agent-text-editor/src/api/edit-completion.ts +3 -0
  489. package/src/extensions/pi-agent-text-editor/src/api/file-operations.ts +55 -0
  490. package/src/extensions/pi-agent-text-editor/src/api/file-transfers.ts +41 -0
  491. package/src/extensions/pi-agent-text-editor/src/api/mutation-guard.ts +3 -0
  492. package/src/extensions/pi-agent-text-editor/src/api/native-files.ts +127 -0
  493. package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +23 -1
  494. package/src/extensions/pi-agent-text-editor/src/api/post-edit.ts +1 -0
  495. package/src/extensions/pi-agent-text-editor/src/core/delete-policy.ts +298 -0
  496. package/src/extensions/pi-agent-text-editor/src/core/extension.ts +14 -2
  497. package/src/extensions/pi-agent-text-editor/src/core/file-operation-guards.ts +81 -0
  498. package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +51 -5
  499. package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +143 -57
  500. package/src/extensions/pi-agent-text-editor/src/core/file-result-targets.ts +31 -2
  501. package/src/extensions/pi-agent-text-editor/src/core/file-transfers.ts +206 -0
  502. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +1 -6
  503. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +9 -1
  504. package/src/extensions/pi-agent-text-editor/src/core/mutation-result-targets.ts +91 -14
  505. package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +125 -17
  506. package/src/extensions/pi-agent-text-editor/src/core/result-transfer.ts +39 -9
  507. package/src/extensions/pi-agent-text-editor/src/core/structured-result.ts +7 -1
  508. package/src/extensions/pi-agent-text-editor/src/core/temporary-directories.ts +116 -0
  509. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +7 -3
  510. package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +350 -25
  511. package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +132 -31
  512. package/src/extensions/pi-agent-text-editor/src/core/write-agent-result.ts +69 -0
  513. package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +2 -2
  514. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +6 -4
  515. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +2 -2
  516. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +6 -4
  517. package/src/plugins/pi-agent-ide-ast/package.json +15 -15
  518. package/src/plugins/pi-agent-ide-ast/runtime/entry-31.js +0 -1
  519. package/src/plugins/pi-agent-ide-ast/runtime/entry-32.js +2 -0
  520. package/src/plugins/pi-agent-ide-ast/src/ast/manager.ts +2 -1
  521. package/src/plugins/pi-agent-ide-ast/src/ast/outline.ts +10 -3
  522. package/src/plugins/pi-agent-ide-ast/src/ast/read-text.ts +4 -1
  523. package/src/plugins/pi-agent-ide-ast/src/ast/selection.ts +3 -3
  524. package/src/plugins/pi-agent-ide-ast/src/doctor-plugin.ts +13 -10
  525. package/src/plugins/pi-agent-ide-ast/src/extension.ts +20 -2
  526. package/src/plugins/pi-agent-ide-ast/src/outline-resolver.ts +32 -4
  527. package/src/plugins/pi-agent-ide-ast/src/overflow-handler.ts +9 -4
  528. package/src/plugins/pi-agent-ide-ast/src/scope-handler.ts +1 -1
  529. package/src/plugins/pi-agent-ide-ast/src/search-presentation.ts +4 -3
  530. package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +100 -42
  531. package/src/plugins/pi-agent-ide-ast/src/select-presentation.ts +3 -2
  532. package/src/plugins/pi-agent-ide-ast/src/tool-select.ts +2 -1
  533. package/src/plugins/pi-agent-ide-changes/index.ts +10 -2
  534. package/src/plugins/pi-agent-ide-changes/package.json +11 -10
  535. package/src/plugins/pi-agent-ide-changes/runtime/entry-33.js +0 -1
  536. package/src/plugins/pi-agent-ide-changes/src/change-anchor.ts +7 -2
  537. package/src/plugins/pi-agent-ide-changes/src/changes/change-service.ts +18 -1
  538. package/src/plugins/pi-agent-ide-changes/src/changes/change-types.ts +3 -0
  539. package/src/plugins/pi-agent-ide-changes/src/changes/git-changes-backend.ts +59 -7
  540. package/src/plugins/pi-agent-ide-changes/src/changes/git-paths.ts +49 -0
  541. package/src/plugins/pi-agent-ide-changes/src/current-change-presenter.ts +10 -2
  542. package/src/plugins/pi-agent-ide-changes/src/doctor-plugin.ts +13 -14
  543. package/src/plugins/pi-agent-ide-changes/src/last-text-transaction-store.ts +2 -1
  544. package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +63 -11
  545. package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +6 -1
  546. package/src/plugins/pi-agent-ide-debugger/index.ts +65 -26
  547. package/src/plugins/pi-agent-ide-debugger/src/adapter-executables.ts +3 -1
  548. package/src/plugins/pi-agent-ide-debugger/src/dap-client.ts +33 -0
  549. package/src/plugins/pi-agent-ide-debugger/src/doctor-plugin.ts +150 -171
  550. package/src/plugins/pi-agent-ide-debugger/src/process-provider.ts +2 -0
  551. package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +152 -58
  552. package/src/plugins/pi-agent-ide-debugger/src/workspace-owner.ts +28 -0
  553. package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +4 -1
  554. package/src/plugins/pi-agent-ide-formatter/index.ts +14 -2
  555. package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
  556. package/src/plugins/pi-agent-ide-formatter/src/doctor-plugin.ts +47 -35
  557. package/src/plugins/pi-agent-ide-formatter/src/formatter.ts +41 -11
  558. package/src/plugins/pi-agent-ide-formatter/src/registry.ts +9 -28
  559. package/src/plugins/pi-agent-ide-languages/package.json +3 -3
  560. package/src/plugins/pi-agent-ide-lint/index.ts +35 -4
  561. package/src/plugins/pi-agent-ide-lint/package.json +8 -8
  562. package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +14 -10
  563. package/src/plugins/pi-agent-ide-lint/src/doctor-plugin.ts +47 -39
  564. package/src/plugins/pi-agent-ide-lint/src/registry.ts +9 -25
  565. package/src/plugins/pi-agent-ide-lsp/index.ts +108 -26
  566. package/src/plugins/pi-agent-ide-lsp/package.json +10 -10
  567. package/src/plugins/pi-agent-ide-lsp/runtime/entry-38.js +2 -0
  568. package/src/plugins/pi-agent-ide-lsp/src/code-view-resolvers.ts +6 -2
  569. package/src/plugins/pi-agent-ide-lsp/src/declaration-targets.ts +7 -2
  570. package/src/plugins/pi-agent-ide-lsp/src/diagnostic-source.ts +5 -3
  571. package/src/plugins/pi-agent-ide-lsp/src/doctor-plugin.ts +27 -11
  572. package/src/plugins/pi-agent-ide-lsp/src/lsp/abort.ts +62 -0
  573. package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +245 -103
  574. package/src/plugins/pi-agent-ide-lsp/src/lsp/code-views.ts +26 -45
  575. package/src/plugins/pi-agent-ide-lsp/src/lsp/diagnostic-adapters.ts +1 -1
  576. package/src/plugins/pi-agent-ide-lsp/src/lsp/document-uri.ts +40 -0
  577. package/src/plugins/pi-agent-ide-lsp/src/lsp/file-watchers.ts +8 -1
  578. package/src/plugins/pi-agent-ide-lsp/src/lsp/lsp-compiler.ts +24 -17
  579. package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +255 -56
  580. package/src/plugins/pi-agent-ide-lsp/src/lsp/navigation.ts +51 -11
  581. package/src/plugins/pi-agent-ide-lsp/src/lsp/owner-transport.ts +67 -0
  582. package/src/plugins/pi-agent-ide-lsp/src/lsp/registry.ts +149 -18
  583. package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +79 -31
  584. package/src/plugins/pi-agent-ide-lsp/src/lsp/symbols.ts +15 -12
  585. package/src/plugins/pi-agent-ide-lsp/src/lsp/workspace-owner.ts +16 -0
  586. package/src/plugins/pi-agent-ide-lsp/src/rename-plan.ts +67 -46
  587. package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +50 -19
  588. package/src/plugins/pi-agent-ide-processes/src/registry.ts +8 -1
  589. package/src/plugins/pi-agent-ide-terminal/index.ts +7 -0
  590. package/src/plugins/pi-agent-ide-terminal/src/process-provider.ts +5 -1
  591. package/src/plugins/pi-agent-ide-terminal/src/resources.ts +5 -2
  592. package/src/plugins/pi-agent-ide-terminal/src/session-manager.ts +161 -42
  593. package/src/plugins/pi-agent-ide-terminal/src/shell-profile.ts +7 -0
  594. package/src/plugins/pi-agent-ide-terminal/src/shell-result.ts +11 -0
  595. package/src/plugins/pi-agent-ide-terminal/src/tools.ts +33 -8
  596. package/src/plugins/pi-agent-ide-terminal/src/types.ts +5 -0
  597. package/src/plugins/pi-agent-ide-vision/index.ts +170 -9
  598. package/src/plugins/pi-agent-ide-vision/src/doctor-plugin.ts +47 -0
  599. package/src/plugins/pi-agent-ide-vision/src/vision.ts +42 -1
  600. package/src/post-edit/gate.ts +4 -1
  601. package/src/toolchain/types.ts +2 -0
  602. package/dist/chunk-3YK4XMWB.js +0 -0
  603. package/dist/chunk-5JELU6RV.js +0 -7
  604. package/dist/chunk-6U5OU77O.js +0 -3
  605. package/dist/chunk-7LD2OQH3.js +0 -14
  606. package/dist/chunk-EURHXLN3.js +0 -2
  607. package/dist/chunk-F6IWZKOG.js +0 -25
  608. package/dist/chunk-IG56UGSO.js +0 -2
  609. package/dist/chunk-KVHDMIZS.js +0 -3
  610. package/dist/chunk-M5IVSCR2.js +0 -1
  611. package/dist/chunk-M5MJP7Z2.js +0 -1
  612. package/dist/chunk-MGCHOGQD.js +0 -1
  613. package/dist/chunk-N34ATN52.js +0 -1
  614. package/dist/chunk-OB46OPMZ.js +0 -1
  615. package/dist/chunk-PKSQT6TC.js +0 -1
  616. package/dist/chunk-Q6CZ6GBR.js +0 -3
  617. package/dist/chunk-QIK2E64R.js +0 -1
  618. package/dist/chunk-SBP3ABH4.js +0 -5
  619. package/dist/chunk-SJ4UZ4GU.js +0 -1
  620. package/dist/chunk-STBJO3Z3.js +0 -2
  621. package/dist/chunk-T6LX2RX5.js +0 -1
  622. package/dist/chunk-TQGE7RH6.js +0 -28
  623. package/dist/chunk-WZI4YC2O.js +0 -1
  624. package/dist/chunk-XDG7EQRN.js +0 -28
  625. package/dist/chunk-YWQS33DF.js +0 -1
  626. package/node_modules/pi-agent-filesystem/runtime/entry-25.js +0 -2
  627. package/node_modules/pi-agent-ide-ast/runtime/entry-30.js +0 -1
  628. package/node_modules/pi-agent-ide-changes/runtime/entry-32.js +0 -1
  629. package/node_modules/pi-agent-image/runtime/entry-38.js +0 -1
  630. package/node_modules/pi-agent-resource/runtime/entry-46.js +0 -1
  631. package/node_modules/pi-agent-text-anchor-constant/runtime/entry-56.js +0 -2
  632. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-57.js +0 -1
  633. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-59.js +0 -1
  634. package/node_modules/pi-agent-text-editor/runtime/entry-61.js +0 -1
  635. package/node_modules/pi-agent-tool-call-interception/runtime/entry-80.js +0 -1
  636. package/node_modules/pi-agent-web/runtime/entry-82.js +0 -2
  637. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-26.js +0 -2
  638. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-25.js +0 -2
  639. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-83.js +0 -2
  640. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-82.js +0 -2
  641. package/src/extensions/pi-agent-read/runtime/entry-41.js +0 -1
  642. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-51.js +0 -2
  643. package/src/extensions/pi-agent-search/runtime/entry-47.js +0 -1
  644. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-56.js +0 -2
  645. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-57.js +0 -1
  646. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-59.js +0 -1
  647. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-78.js +0 -2
  648. package/src/extensions/pi-agent-text-editor/runtime/entry-61.js +0 -1
  649. package/src/plugins/pi-agent-ide-ast/runtime/entry-30.js +0 -1
  650. package/src/plugins/pi-agent-ide-changes/runtime/entry-32.js +0 -1
  651. /package/node_modules/{pi-agent-documentation → pi-agent-doctor}/runtime/entry-24.js +0 -0
  652. /package/node_modules/{pi-agent-filesystem-image → pi-agent-filesystem}/runtime/entry-26.js +0 -0
  653. /package/node_modules/{pi-agent-filesystem-jq → pi-agent-filesystem-image}/runtime/entry-27.js +0 -0
  654. /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem-jq}/runtime/entry-28.js +0 -0
  655. /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-29.js +0 -0
  656. /package/node_modules/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-34.js +0 -0
  657. /package/node_modules/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-35.js +0 -0
  658. /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-36.js +0 -0
  659. /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-37.js +0 -0
  660. /package/node_modules/{pi-agent-invariant → pi-agent-image}/runtime/entry-39.js +0 -0
  661. /package/node_modules/{pi-agent-pdf → pi-agent-invariant}/runtime/entry-40.js +0 -0
  662. /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-41.js +0 -0
  663. /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-47.js +0 -0
  664. /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-51.js +0 -0
  665. /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-55.js +0 -0
  666. /package/node_modules/{pi-agent-text-editor-renderer → pi-agent-text-editor}/runtime/entry-78.js +0 -0
  667. /package/node_modules/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-79.js +0 -0
  668. /package/node_modules/{pi-agent-tool-ui → pi-agent-tool-call-interception}/runtime/entry-81.js +0 -0
  669. /package/node_modules/{pi-agent-web-html → pi-agent-web}/runtime/entry-83.js +0 -0
  670. /package/node_modules/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-84.js +0 -0
  671. /package/node_modules/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-85.js +0 -0
  672. /package/node_modules/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-86.js +0 -0
  673. /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-jq → pi-agent-filesystem-image}/runtime/entry-27.js +0 -0
  674. /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-pdf → pi-agent-filesystem-jq}/runtime/entry-28.js +0 -0
  675. /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-29.js +0 -0
  676. /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-84.js +0 -0
  677. /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-85.js +0 -0
  678. /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-86.js +0 -0
  679. /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-79.js +0 -0
  680. /package/src/plugins/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-34.js +0 -0
  681. /package/src/plugins/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-35.js +0 -0
  682. /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-36.js +0 -0
  683. /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-37.js +0 -0
@@ -29,13 +29,20 @@ Read results select their requested source windows. Search results select exact
29
29
  - `replace.path` replaces selected ranges. `delete.path` removes selected text but keeps the file, even for a whole-file selection.
30
30
  - `write.path` and `undo.file` require one whole-file selection. Partial and multi-file scopes are rejected, not widened.
31
31
  - `copy.path` / `move.path` select source ranges; `target` selects destination ranges. A zero-width destination inserts. Arrays pair in declared order, with equal counts and duplicates removed. Unequal counts and overlapping moves are rejected.
32
- - Ordinary destination file paths without text selectors require one whole-file source and keep byte-preserving file transfer behavior.
32
+ - Move succeeds without writes for valid empty arrays and paired zero-width selections. Empty arrays return no selection; paired points return only the unchanged destination points. The usual validation and overlap guards still apply.
33
+ - Ordinary filesystem paths without selectors copy or move one whole object: a regular file, directory tree, or symlink. Result inputs remain text selections; a directory listing does not authorize a whole-directory transfer.
33
34
  - `insert` uses line-based insertion before or after its selected containing lines.
34
35
 
35
- Replace/insert results select their resulting text, including supplied line separators. Empty replacement selects the resulting position, not removed text. Copy/move results select only destination text. Whole-file transfers and write select the whole destination; undo selects restored files. Delete and binary operations provide no reusable text selection. If a result cannot supply a verified selection, inspect the file instead.
36
+ Replace/insert results select their resulting text, including supplied line separators. Empty replacement selects the resulting position, not removed text. Copy/move results select only destination text. Whole regular-text-file transfers and write select the whole destination; undo selects restored files. Delete and binary operations provide no reusable text selection. If a result cannot supply a verified selection, inspect the file instead.
36
37
 
37
38
  Results are strict snapshots. Changed files permanently retire their old IDs, even if the old bytes are restored later. Session changes and reloads also retire IDs. Empty selections are valid no-ops; incomplete or expired selections cannot authorize edits. Diff text and invented coordinates do not grant source authority.
38
39
 
40
+ ## Whole filesystem objects
41
+
42
+ Use ordinary paths without text selectors for whole-object Delete, Copy, and Move. Delete removes directory contents recursively and unlinks symlinks without following their targets. Copy merges directory contents into the exact target directory and keeps destination-only entries. Move replaces an existing target directory and removes destination-only entries. Both transfers create missing parents, preserve file bytes and symlink text, and reject symlink destinations, type conflicts, and overlapping trees. Relative links keep their text; moving them can change what they point to.
43
+
44
+ Directory and symlink transfers have no reusable text selection. Read their ordinary paths to inspect them. A failure before filesystem execution reports `not-applied`; a failure after execution starts reports `unknown`. Inspect both paths before retrying an unknown transfer. Recursive transfers and cross-device Move have no atomic rollback. Cancellation before execution prevents a transfer; in-flight filesystem work may finish.
45
+
39
46
  ## Line separation
40
47
 
41
48
  Use `separation: "blank-line"` for a separate paragraph or section; use default line mode for adjacent code, list items, or a continuation. Inserting `X` after `A` in `A\nB` with blank-line separation produces `A\n\nX\n\nB`.
@@ -48,7 +55,7 @@ Independent calls share the original snapshots. Combine overlapping edits into o
48
55
 
49
56
  An omitted path can inherit the file identified by an anchor, the last read, or the preceding edit in the batch. Supply the path when that would be ambiguous.
50
57
 
51
- An ordinary `delete.path` without selectors deletes a complete regular file. A result input removes only selected text. Ordinary copy/move paths without selectors transfer whole files and replace an existing regular destination file.
58
+ An ordinary `delete.path` without selectors deletes a whole file, directory, or symlink. Directory and link deletion applies Git protection and may require a user dialog; no agent flag replaces approval. Links are unlinked without following their targets. A result input removes only selected text. Ordinary copy/move paths without selectors transfer whole regular files and replace an existing regular destination file.
52
59
 
53
60
  Inside Codemode, await independent edits on disjoint resources concurrently and overlapping resources in order. Pass a pending edit result directly to another source tool for dependent work; that boundary commits the batch before consuming the result.
54
61
 
@@ -26,6 +26,9 @@ If Search is interrupted or cancelled, do not treat it as zero matches or comple
26
26
 
27
27
  If a result has no local edit references, use its locations to inspect the source, not as an edit scope. For changed local files, repeat Search or Read to obtain a current selection before editing.
28
28
 
29
+ Use unchanged Read/Search/Select result text, its UUID, returned items, or `RESULT#` targets as Search scopes. These inputs keep exact source ranges and sparse gaps. Reconstructed coordinates do not grant access. Refresh stale snapshots before searching again.
30
+
31
+ Use `navigation: "references"` only for symbol searches that must follow declarations outside the input scope. Without navigation, symbol results stay inside the supplied ranges. Reference results retain the originating declaration identity; equal names do not establish that identity.
29
32
  Local text results expose `SEARCH#HASH:N:line` for its containing line and `SEARCH#HASH:N:match` for the exact match. Complete selections use `:all:line` or `:all:match`. Pass these references directly to read or editing tools; omit the file path when an all-selection spans files.
30
33
 
31
34
  A single-result reference becomes stale after its file changes. Re-run the search before reuse. A complete `:all` reference refreshes its original query when selected files change. Compacted output retains complete all-selections.
@@ -66,6 +69,6 @@ Append `#name` to an exact symbol resource only for a native language-server ren
66
69
 
67
70
  ## Other search protocols
68
71
 
69
- Use an HTTP(S) URL as `path` to search converted page text with a literal or `regex:` query. No prior Read is needed. Web results keep the requested URL and do not expose editable `SEARCH#` references. Use Read on that URL for more context.
72
+ Use an HTTP(S) URL as `path` for local web execution, or `web:ssh://target/https://example.com/page` for explicit target execution. Search converted page text with a literal or `regex:` query; no prior Read is needed. Web results keep the requested source and do not expose editable `SEARCH#` references. Use Read on that source for more context.
70
73
 
71
74
  Use `process:<query>` for running processes. Use `path: "shell:<session>"` to search retained terminal output beyond its current tail.
@@ -0,0 +1,58 @@
1
+ # SSH resources
2
+
3
+ ## Set up a target
4
+
5
+ When the user asks to connect to or work on a remote device or environment over SSH, set up a target before using remote resources. Use the existing tools; no separate SSH tool is needed.
6
+
7
+ 1. Read the current project's `.pi/pi-agent-ide/ssh.json` and reuse a matching target. If the file is missing, create it. Preserve unrelated targets and settings. Use project settings by default; use global settings only when the user explicitly asks. The global file is `~/.pi/agent/pi-agent-ide/ssh.json`, or `$PI_CODING_AGENT_DIR/pi-agent-ide/ssh.json` when that variable is set.
8
+ 2. Resolve the host from the user's request and existing OpenSSH configuration. Ask only for missing connection details or the remote workspace path when they cannot be established from the request or existing configuration. Keep keys, passwords and host-key trust in OpenSSH, not in IDE settings. Do not print credentials or disable host-key checks. Ask before changing authentication or trusting a new host key.
9
+ 3. Check access with local Bash: `ssh -o BatchMode=yes -o StrictHostKeyChecking=yes -o ConnectTimeout=10 HOST 'pwd; python3 --version'`. Add `-F /path/to/config` when using a custom OpenSSH config. Require Python 3 on the target. Inspect a failed connection before editing IDE settings; a target record cannot fix missing authentication or host trust.
10
+ 4. Add a target record with a unique `id`, a trusted OpenSSH `host` alias (optionally `user@alias`), and an absolute Linux `workspace` path. Use an existing workspace unless the task needs a new one. Use a short stable ID, such as `vps`. Optional `configFile` selects a local OpenSSH config; relative paths resolve beside `ssh.json`.
11
+ 5. Reload Pi extensions after adding or changing a target. Use the reload tool when available, or ask the user to run `/reload`. Reload can reset extension state; finish or stop owned live sessions first. Read `docs:ssh` again after reload to see the configured workspaces.
12
+ 6. Verify the target with `read` on its `ssh://` workspace and `bash` with that SSH `cwd`, for example `hostname; pwd`. Report the actual tool results. Do not claim remote IDE access from a successful plain SSH command alone.
13
+
14
+ Example project `.pi/pi-agent-ide/ssh.json`:
15
+
16
+ ```json
17
+ {
18
+ "targets": [{ "id": "vps", "host": "vps", "workspace": "/root" }]
19
+ }
20
+ ```
21
+
22
+ Project records replace complete global records with the same ID. Duplicate IDs in one file, unknown fields and invalid records fail startup. Keep machine-specific target settings out of shared Git history unless the user asks to share them.
23
+
24
+ ## Use remote resources
25
+
26
+ Use the existing read and text-editing tools with `ssh://target/absolute/path`. Select a target from the configured workspaces below. Unknown targets fail without falling back to local files. The workspace is a relative-path base, not a sandbox; absolute paths use the remote account's permissions.
27
+
28
+ Use `raw:ssh://target/absolute/path` to read original bytes with `offset` and `limit`. Raw reads do not convert content or accept views. Text snapshots have a 32 MiB transport limit; raw reads fetch bounded chunks instead. Separate byte windows are not an immutable snapshot.
29
+
30
+ Use `search` with an SSH `path` for text, `regex:` and `files:` queries. Ripgrep runs on that target; include/exclude globs, Boolean queries and fallback rules stay the same. Results use canonical SSH paths. `SEARCH#` selections keep their owning backend for stale checks, complete-selection refresh and observation after editing. Remote text snapshots for anchors have the same 32 MiB limit.
31
+
32
+ Use `search` with `ast:<pattern>` and an SSH `path` for structural matches. It needs `ast-grep` on that target. Returned `SEARCH#` ranges use the same owned snapshots and refresh rules as text search. Use `read` with `ast:ssh://target/path` for a compact outline, or `views: ["ast"]` for scope anchors on source text. These presentations parse the fetched snapshot locally; they do not read a local copy of the remote path. Explicit outlines keep the existing 256 KiB source limit.
33
+
34
+ Use `read` with `views: ["changes"]` on a tracked SSH file to get `CHANGE#` anchors. Use `stage` and `unstage` with that file and anchor to change its remote index; the worktree is kept. Use `undo` with a `CHANGE#` anchor to restore that change in worktree and index. Git must be installed on the target. Index publication holds Git’s index lock and checks HEAD, the index entry and expected worktree text before publishing. Worktree and index restoration are not one atomic operation; inspect both after a failure or an unknown effect.
35
+
36
+ Use whole-object `copy` and `move` with SSH paths, including local/SSH and target/target transfers. Regular files keep their original bytes; directory trees and source links are supported too. Copy merges compatible directories; Move replaces a compatible destination after removal checks. Destination symlinks, mismatched types, same-object transfers and overlapping trees are refused. Link bytes are preserved without following their targets. Directory and link receipts have no reusable text selection. Missing destination parents are created after endpoint checks. Directory/link Move checks both owners' Git protection, hooks and required user dialogs, then rechecks both trees after approval. Same-target, same-filesystem moves keep the inode. Other moves publish the destination before rechecking and removing the source. Partial copies and interrupted moves have no rollback and can leave unknown effects.
37
+
38
+ Whole-object `delete` also supports SSH directories and symlinks, including broken links. Directories are removed recursively; links are unlinked without following their targets. The safety check uses the selected target's Git worktree, never the controller's Git state. Hooks and user dialogs name canonical SSH paths. Tracked or staged directories and links and failed Git checks inside the project require a user dialog. External targets and missing Git worktrees require a dialog unless a temporary-directory exception applies. An unavailable required dialog blocks removal. Project roots, ancestors, filesystem roots, and Git control paths are always protected. The target identity and policy are checked again after approval. Changed targets need a new request. Recursive deletion has no rollback; a failure after removal starts can leave unknown effects.
39
+
40
+ Temporary-directory exceptions use the selected SSH account's home, system temp and `PI_CODING_AGENT_DIR`, plus that project's `.pi/pi-agent-ide/deletion.json`. Controller settings never grant remote permission. Only descendants of configured temporary roots qualify; the roots themselves stay guarded. Git-tracked entries, failed Git checks inside the project, protected paths, and hooks still block or require approval. Delete reloads the target settings during its final safety check. Move does not use temporary exceptions.
41
+
42
+ Use the standalone editing tools with writable SSH text resources and mixed local/SSH files. Use Codemode to compose those tools; Apply and Flush are not available. Check each operation's reported effect. Use `undo` with `last` for a saved text-editor transaction or a `CHANGE#` anchor for a Git change. Cross-backend writes and compensation are not distributed atomic operations.
43
+
44
+ Use `bash` with an SSH `cwd` to run Bash in the remote account's environment. Use the returned `shell:` resource for input, output and cleanup. Read `docs:terminal` before interacting with a session. Remote process IDs belong to the named target, not the local machine.
45
+
46
+ Use `search` with `process:<query>` and an SSH `path` for process discovery on a configured Linux target. Use each returned `process:ssh://target/PID` resource for metadata. Its kernel identity combines the target boot ID and native start ticks; discovery does not grant process control or controller window capture. Keep target PIDs separate from local PIDs. A missing native process facility fails without controller fallback.
47
+
48
+ Use `debug` with an SSH `cwd` for a target-owned debugger session. Read `docs:debugger` before setting anchored breakpoints or starting the program. Adapter source paths map to canonical SSH resources; document text and evaluation values are not rewritten. A missing or unsupported native adapter fails without controller fallback. Delete the session resource to stop its owned transport.
49
+
50
+ Use `read` or `search` with `web:ssh://target/https://example.com/page` for explicit target HTTP/browser execution. Ordinary HTTP(S) URLs still execute locally, regardless of the current SSH workspace. The target uses its own DNS and proxy environment. Read tries direct HTTP first, then rendered browser content when needed; web text has no editable file anchors. Image and PDF conversion uses the fetched bytes and existing local converters.
51
+
52
+ Use `image` or `sequence` views on the explicit web source for target browser screenshots, with the existing region, scale and grid parameters. Browser fallback and capture require Node, `playwright-core` and Chrome/Chromium on the target. They use a fresh temporary profile, enable page JavaScript and disable the Chromium sandbox, matching ordinary browser reads. Missing dependencies fail without launching a controller browser. No dependency is installed automatically. Capture is limited to 16 million pixels and 20 MiB of PNG per frame; requests have a 30-second deadline and cancellation waits for owned cleanup.
53
+
54
+ Use `/pi-agent-ide-doctor ssh://target/path` to inspect an explicitly selected target project. Target-sensitive checks use its native tools and project/user-global config; pure-content checks stay on the controller. Use `--no-apply` to inspect without suggested writes. `--apply` publishes suggested mappings only in that project's `.pi/pi-agent-ide/`, preserving existing entries. Agent setup and its recheck retain that same target. Ordinary startup tips remain local; an unused target is not probed.
55
+
56
+ Read the current source before editing it. A stale snapshot fails without overwriting the changed file. Check the reported effect after interrupted writes; do not replay a write whose effect is unknown. IDE writes are serialized, but external writers can still race the final check.
57
+
58
+ Do not assume that choosing an SSH resource routes every other IDE provider remotely. Check each provider's supported sources and errors before using it.
@@ -1,5 +1,11 @@
1
1
  # Visual capture workflow
2
2
 
3
+ Use `search` with `process:<query>` and an SSH `path` to inspect a configured Linux target. Read its returned `process:ssh://target/PID` for target metadata and kernel start identity. Use `window:ssh://target/PID` for that target's application window; never put a remote PID into local `window:PID`. Window capture requires an active IDE-owned process, an exact native executable allowlist match, or the arbitrary-window opt-in. Each frame checks the current target process and start identity, then verifies the X server's local client PID before reading pixels. A window's advertised PID alone never authorizes capture.
4
+
5
+ Use `display:ssh://target/` or `display:ssh://target/#N` for a target X11 screen only when display capture is enabled. Target capture needs Python and an accessible X11 session with libX11. Window capture also needs libX11-xcb, libxcb and X-Resource 1.2 native client identity support. A headless, inaccessible, ambiguous or obscured window fails without controller or root-image fallback. Target acquisition is bounded to 16 million pixels per frame and 20MB of PNG data. The ordinary region, scale, grid and sequence rules below still apply; transformations happen locally after target acquisition.
6
+
7
+ Use `web:ssh://target/https://example.com/page` with `image` or `sequence` views for target browser screenshots. Ordinary HTTP(S) sources still capture locally. The target needs Node, `playwright-core` and Chrome/Chromium; missing dependencies never select a controller browser. Browser capture uses a fresh profile with JavaScript enabled and the Chromium sandbox disabled. Crop, scale and grid apply to the fetched full-page PNG, just as for local URL capture.
8
+
3
9
  Discover a process first with `process:<query>`, then read `window:<PID>` for an allowed application window. Use `display:` or `display:#N` only when display capture is enabled. Add `views: ["image"]` for a still image or `views: ["sequence"]` when motion or timing requires multiple frames.
4
10
 
5
11
  Tune sequence duration, interval, scale, and region only when defaults do not fit. Region uses normalized `x,y,width,height` and is applied before scaling. For image grids, use `limit` as the square cell size and `offset` as a zero-based row-major cell index. Avoid capturing unrelated desktop content.
@@ -73,6 +73,34 @@ Restart Pi or use `/reload` after changing extension selection. Search timeout s
73
73
 
74
74
  Built-in entry modules are imported only after selection. Disabled built-ins, including those disabled through a dependency, are not imported by the catalog. Selected built-ins still register in catalog order. Shared libraries used by a selected built-in may still load.
75
75
 
76
+ ## SSH targets
77
+
78
+ The **SSH files** module (`read.ssh`) reads a separate `ssh.json` beside each `extensions.json`. The global file follows `PI_CODING_AGENT_DIR`. Missing files configure no targets and open no connections. Project targets replace complete global records with the same `id`; other global targets remain available.
79
+
80
+ Configure targets in the current project's `.pi/pi-agent-ide/ssh.json` by default. Use `~/.pi/agent/pi-agent-ide/ssh.json`, or `$PI_CODING_AGENT_DIR/pi-agent-ide/ssh.json`, only when global access is wanted. Keep personal target records out of shared Git history. Reload Pi after changing targets.
81
+
82
+ ```json
83
+ {
84
+ "targets": [{ "id": "sandbox", "host": "vps", "workspace": "/srv/work" }]
85
+ }
86
+ ```
87
+
88
+ `host` is a trusted OpenSSH alias, optionally `user@alias`. Keys, passwords, host-key trust and agent access stay in OpenSSH configuration, not this file. Optional `configFile` selects a local OpenSSH config; relative paths resolve beside that `ssh.json`. Duplicate IDs within one scope, unknown fields and malformed records stop startup rather than silently enabling a different target.
89
+
90
+ Use `ssh://sandbox/srv/work/file.txt` with the existing read and text mutation tools. Workspace is the remote path base, not an access boundary; the account's permissions control access. Connections use batch mode and strict host-key verification. Python 3 must be available remotely; no permanent helper is installed.
91
+
92
+ Remote command channels use Linux child-subreaper support and Python's standard `ctypes` module. The kernel keeps orphaned descendants with their owning channel, including children that open new sessions. Cleanup waits for those children to exit and be reaped; it does not scan or signal unrelated processes. A denied signal or a cleanup deadline remains an explicit unknown result, not proof that the whole tree stopped.
93
+
94
+ The terminal module reads the same targets. Set `bash`'s `cwd` to `ssh://sandbox/srv/work` to run remote Bash with a PTY. Existing shell resources support input and session cleanup. Remote process identity includes its target; it is never treated as a local PID.
95
+
96
+ Use `raw:ssh://sandbox/path/file.bin` for original bytes. Offsets and limits count bytes; raw reads do not use text converters or accept views. Byte ranges can cross the text snapshot limit.
97
+
98
+ Remote resources also support Search, selections, text undo, Git changes and index operations, local/remote transfers, language servers, diagnostics, formatters, linters, and debugger sessions. These providers use the selected Linux target's tools and configuration. Run `/pi-agent-ide-doctor ssh://sandbox/srv/work --no-apply` to inspect an explicitly selected remote project without suggested writes.
99
+
100
+ For target-native web access, use `web:ssh://sandbox/https://example.com`; ordinary HTTP(S) URLs execute locally. Browser rendering and captures require Node, `playwright-core`, and Chrome or Chromium on the target. Remote process metadata and window/display capture use target-owned resources; native capture also needs a supported graphical environment and the existing vision permissions. Missing dependencies fail without a local fallback.
101
+
102
+ Text snapshots are limited to 32 MiB. Directory transfers and interrupted remote writes have no distributed rollback; inspect reported effects and both endpoints before retrying an uncertain operation. The settings UI can enable or disable SSH file support; target records are edited in JSON. The agent setup and resource workflow is in the [SSH guide](./agent-guides/ssh.md), available through `read` as `docs:ssh` even before a target is configured.
103
+
76
104
  ## Animations and post-edit processing
77
105
 
78
106
  Standalone editing tools validate source snapshots before writing. Native Codemode commits eligible pending local edits before a dependent tool or when the script ends. Accepted child calls are not proof of persistence. Ordinary script errors keep accepted edits; aborts discard only pending work. Batched edits finish formatting and diagnostics at script end. Write commits earlier pending edits and finishes its own post-edit processing before returning. Text copy/move destinations receive post-processing; binary contents stay unchanged.
@@ -193,6 +221,10 @@ Create the session with `adapter: "java"` and the fully qualified `mainClass`. U
193
221
 
194
222
  Run `/pi-agent-ide-doctor` to check the effective tools for the current project. Doctor uses the same layered entries as runtime. For each applicable entry it shows the stable ID, source layer, command, and real probe result. A missing or failing command is reported instead of falling back to a lower layer.
195
223
 
224
+ Use `/pi-agent-ide-doctor ssh://target/path` for an explicitly configured Linux SSH project. Its inventory, project/user-global config and target-sensitive probes belong to that target. Native managed debugger path overrides are read from the target, not the controller. Pure-content adapters, such as jq and fetched-source parsers, stay local. Without a source, the command and passive startup tips keep their local scope. An unused target is not probed.
225
+
226
+ For an SSH project with vision enabled, Doctor checks the native X11 connection and trusted X-Resource 1.2 support without taking a screenshot or grabbing the desktop. It reports display access and trusted window identity separately. Headless sessions and missing libraries remain warnings. This readiness check does not authorize any particular window or enable capture flags; each real capture still checks opt-in and the selected process.
227
+
196
228
  Doctor can still suggest a project override when project evidence points to a better installed tool. It shows the report before changing anything. `--apply` writes only to `<project>/.pi/pi-agent-ide/`; it never changes the global directory or built-in files. `--agent` delegates remaining setup work, and `--no-apply` skips suggested writes.
197
229
 
198
230
  The project directory may also contain extension and editor settings:
@@ -229,6 +261,29 @@ No tip appears when built-in mappings already cover the project. Empty projects,
229
261
 
230
262
  Each actionable state has its own stable fingerprint. The same state is shown once per project, while a materially different later problem can produce a new tip. Like other startup tips, it never enters model context. See [Startup tip provider](./extensions.md#startup-tip-provider) for the provider contract and persistence behavior.
231
263
 
264
+ ### Temporary-directory deletion
265
+
266
+ For SSH Delete, all paths and settings belong to the selected target: its account home, system temp, `PI_CODING_AGENT_DIR`, and project config. Local settings do not grant permission to remote paths.
267
+
268
+ Delete skips the external/non-Git confirmation for descendants of temporary roots. Defaults are `tmp`, `.tmp`, `temp`, and `.temp` under the current Git worktree root (or cwd without Git) and your home directory, plus the system temporary directory. The system root follows the OS environment, such as `TMPDIR` on Linux or `TEMP`/`TMP` on Windows.
269
+
270
+ Configure this in `<agent-dir>/pi-agent-ide/deletion.json` globally, or `<project>/.pi/pi-agent-ide/deletion.json` for one project. `<agent-dir>` defaults to `~/.pi/agent` and follows `PI_CODING_AGENT_DIR`.
271
+
272
+ ```json
273
+ {
274
+ "temporaryDirectories": {
275
+ "mode": "extend",
276
+ "paths": ["scratch", "~/build-scratch"]
277
+ }
278
+ }
279
+ ```
280
+
281
+ `extend` adds to the lower layer; `replace` replaces it. Layers apply in this order: defaults, global, project. A project replacement overrides both defaults and global settings. Use `{"temporaryDirectories":{"mode":"replace","paths":[]}}` to disable the exception.
282
+
283
+ Relative global paths start at your home directory; relative project paths start at the worktree root, or cwd without Git. Absolute paths and a leading `~/` are supported. Globs and other shell expansion are not supported. Custom roots resolve symlinks; named defaults do not grant access to a redirected root's destination. Missing roots are skipped. Settings are read for each deletion and checked again before removal. Invalid settings block directory/symlink deletion rather than falling back.
284
+
285
+ The exception does not apply to the temporary roots themselves, tracked/staged contents, failed Git checks inside the current project, or protected project/Git/filesystem paths. Parent links must resolve inside an allowed root. Unlinking the final symlink leaves its destination alone. Hooks still apply. Copy and Move keep their existing safeguards, and regular-file deletion is unchanged.
286
+
232
287
  ### Exact text recovery
233
288
 
234
289
  Exact text anchors work without configuration. Optional recovery settings live in `.pi/pi-agent-ide/text-editor.json`:
@@ -63,6 +63,10 @@ CI uses the same four shards without changing test or job timeouts. Set `REPORT_
63
63
 
64
64
  `--no-extensions` also disables Pi's native built-ins. Native fixtures explicitly load `builtin:codemode`, `builtin:tool-search`, and `builtin:mcp`; ordinary fixtures do not. `native-host.integration.test.ts` checks the version inside the launched process, deferred discovery, nested execution, and isolation from personal MCP servers.
65
65
 
66
+ ### Paid model capability checks
67
+
68
+ Tool changes also require reviewing the matrix and supported tool chains in `benchmarks/tool-capabilities/README.md` in the checkout. Run `pnpm check:capabilities` for its free schema/coverage gate; it is included in `pnpm check`. The real-model suite uses `pnpm validate:tools:models --run --model PROFILE_ID` only with explicit paid permission. It runs isolated cases and checks both outcomes and actual routes. It is not part of ordinary tests or CI.
69
+
66
70
  ### Watch integration tests live
67
71
 
68
72
  Use the project command to watch every test in one file:
@@ -0,0 +1,45 @@
1
+ # Directory and symlink operations
2
+
3
+ Delete, Copy, and Move accept ordinary filesystem paths without text selectors. The same implementation runs for standalone calls and calls nested in native Codemode. Read results, directory listings, and other registered selections do not become whole-directory authority.
4
+
5
+ ## Capability table
6
+
7
+ | Operation | Directory behavior | Symlink behavior | Guards and failure effects |
8
+ | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
9
+ | Delete | Remove the directory and all contents recursively. | Unlink only the link, including a broken link. Never follow links inside a removed tree. | Existing before-delete hooks, protected paths, and host approval policy apply. Refusal is `not-applied`; a filesystem failure after removal starts is `unknown`. |
10
+ | Copy | Copy into the exact target path. Create missing parents. Merge into an existing directory, overwrite matching regular files, and keep destination-only entries. | Copy link text without following the target, including standalone and broken links. | Preflight the source tree and matching destination entries. Refuse aliases, overlapping trees, symlink destinations, unsupported object types, and type conflicts before writes. Protect project roots, ancestors, and current Git control data from recursive overwrites. After-start failure is `unknown`. |
11
+ | Move | Move into the exact target path. Create missing parents. Replace an existing directory, removing its old destination-only entries. | Move the link object without following its target, including standalone and broken links. | Apply Copy's top-level transfer checks and Delete's safety policy to directory/link source removal and existing destination removal. Recheck both approved objects before execution. After-start failure is `unknown`. |
12
+
13
+ A target names the resulting object, not a containing directory with an implicit source-name child. For example, Copy from `source` to `new/target` produces `new/target/nested`, not `new/target/source/nested`.
14
+
15
+ Symlink text is preserved exactly. A relative link can point somewhere different after relocation. Existing symlink destinations are rejected, even if their referents match. Copy also rejects a conflicting link at any matching destination entry. Destination-only links are left alone by Copy; replacing a Move destination removes the links, not their referents. File/directory/link type conflicts are refused rather than converted.
16
+
17
+ Only regular files, directories, and symlink objects are supported within source trees. Recursive transfers preserve file bytes and empty directories; they do not promise preserved timestamps, ownership, or hard-link relationships. Directory and link targets are not post-processed as text and have no reusable text selection. Inspect their ordinary paths with Read.
18
+
19
+ ## Move safety policy
20
+
21
+ For directory and symlink Move sources, and existing directory destinations, the same before-delete hook runs before any removal or dialog. Denial or a thrown hook error blocks the transfer. Tracked or newly staged entries, external targets, missing Git worktrees, and failed Git checks require host approval. No available dialog means no transfer. Untracked internal targets need no dialog. There is no agent approval argument.
22
+
23
+ Protected project roots, ancestors, filesystem roots, and current Git control paths cannot be moved or recursively overwritten. Parent symlinks are resolved for identity, containment, and project-boundary checks; the final link object is not dereferenced. The project boundary is the Git worktree containing Pi's cwd. Without Git, cwd and its ancestors remain protected.
24
+
25
+ Move obtains all required approvals and rechecks each object afterwards. Changes to identity, Git classification, source-tree entries, or matching destination entries during preflight prevent dispatch. These checks are not an atomic filesystem lock against other processes. Ordinary-file overwrite behavior and selected-text editing remain unchanged.
26
+
27
+ For hook setup and the existing Delete policy, see [File hooks](user-hooks.md).
28
+
29
+ ## Cross-device moves, cancellation, and partial failure
30
+
31
+ Move first attempts a filesystem rename. On a cross-device error, the filesystem library copies the object and then removes the source. The copy and removal phases can fail separately. Replacement may already have removed destination contents when a later phase fails.
32
+
33
+ Cancellation before filesystem execution prevents the transfer. The recursive filesystem primitives are not interruptible through the tool's abort signal once dispatched; in-flight work may finish. A failed filesystem call after dispatch reports `unknown`, even when the precise effects cannot be established.
34
+
35
+ There is no recursive undo or atomic rollback. After an unknown result, inspect both source and target before deciding whether to retry. Earlier successful operations in the same Codemode script are not rolled back when a later operation fails.
36
+
37
+ ## Executable checks
38
+
39
+ - [Transfer unit tests](https://github.com/alexshpunt/pi-agent-ide/blob/develop/src/extensions/pi-agent-text-editor/tests/core/directory-transfers.test.ts): binary bytes, empty directories, link text, merge/replace behavior, aliases, nested destinations, conflicts, hooks/approvals, changed objects, cancellation, real Linux cross-device moves, and controlled partial failures.
40
+ - [Delete policy unit tests](https://github.com/alexshpunt/pi-agent-ide/blob/develop/src/extensions/pi-agent-text-editor/tests/core/delete-policy.test.ts): deletion guards and uncertain recursive effects.
41
+ - [Real-Pi transfer cases](https://github.com/alexshpunt/pi-agent-ide/blob/develop/tests/integration/directory-transfers.integration.test.ts): direct and native Codemode transfers, preserved source/sentinel bytes, host approval, and refusal paths.
42
+ - [Real-Pi Delete cases](https://github.com/alexshpunt/pi-agent-ide/blob/develop/tests/integration/delete-objects.integration.test.ts): both call routes and fail-closed host guards.
43
+ - [Paid capability matrix](https://github.com/alexshpunt/pi-agent-ide/blob/develop/benchmarks/tool-capabilities/README.md): executable `directory-transfers` and `directory-transfer-gates` cases have direct and Codemode routes. They are not model-verified until explicitly run with paid permission. Free coverage checks do not prove model execution.
44
+
45
+ These contracts are checked on Linux/WSL. The cross-device test uses `/dev/shm` and runs only on Linux. Other operating systems are not verified by that test.
package/docs/releases.md CHANGED
@@ -18,6 +18,14 @@ See [Develop nightly](nightly.md). Nightlies test a pinned `develop` commit and
18
18
 
19
19
  Real debugger integration tests and adapter/platform jobs still run, but their results are non-blocking and kept outside the shared CI test totals and badges. They have separate jobs and reports marked flaky. A failed debugger job does not reject a release candidate. Pure debugger unit tests, other source/runtime checks, and editor tests remain blocking. In particular, Delete is not part of this exception.
20
20
 
21
+ ## Reuse full CI evidence
22
+
23
+ A release has two full test gates: the pinned promotion PR and the versioned candidate PR. Every other PR and every nightly also runs fully. A later push to `main` or `develop` can reuse a successful full CI run only when its exact Git tree, CI workflow, Node/npm/pnpm pins, and Linux/Windows runner image identities match.
24
+
25
+ CI checks the source run and attempt through GitHub, including the actual tested commit and both successful core jobs. Their results must be no older than 24 hours. Missing, failed, expired or incompatible evidence means a full run. A reused run never creates new evidence or extends its lifetime. New develop combinations and changed verification conditions therefore still get fresh tests.
26
+
27
+ The required `Validate` check and commit-range security scan still run on reused pushes. The CI summary links to the full source run rather than reporting new test counts. Reused pushes do not update test badges. Candidate packaging, installed-runtime tests, branch protection and exact-archive publication checks stay unchanged.
28
+
21
29
  ## Start a release
22
30
 
23
31
  Choose a release cut by its full commit SHA. If that commit is not yet on main, promote it through a separate pinned branch such as `chore/promote-X.Y.Z`, not a PR whose head is the moving `develop` branch. Keep that promotion head unchanged while CI runs. New develop merges do not join the release unless its scope is explicitly changed. After promotion and main-to-develop synchronization succeed, start the versioned release below. See `.pi/skills/publish-pi-agent-ide/SKILL.md` for the agent runbook.
@@ -0,0 +1,56 @@
1
+ # Codemode Write context verification
2
+
3
+ [LPT-666](https://linear.app/alexshpunt/issue/LPT-666/verify-codemode-write-results-do-not-duplicate-file-content-in-model)
4
+
5
+ ## Finding
6
+
7
+ Silent nested Write did duplicate file text into the next provider request. The IDE's native editor-batch hook appended the final Write presentation to Codemode output, even when the script printed nothing. That extra presentation also bypassed Codemode's output limit.
8
+
9
+ The deterministic fixture writes 400 distinct marked lines (60,400 bytes). Its baseline includes the same content in script arguments but never calls Write.
10
+
11
+ | Following provider result | Before the fix | After the fix |
12
+ | -------------------------------------- | ----------------------------------------------- | ------------------------------------------------- |
13
+ | Baseline | 47 text characters, no file-body markers | Same |
14
+ | Silent Write | 57,776 text characters, 337 file-body markers | 47 script-output characters, no file-body markers |
15
+ | Explicit Write output, 1,000-token cap | An extra file fragment appeared outside the cap | Compact receipt only; no file text |
16
+
17
+ These are character counts, not billed token measurements. The pre-fix result counts include the attached editing guide. After-fix output-size assertions exclude that separate guide; the saved request keeps it unchanged (6,345 characters in the captured run).
18
+
19
+ ## Boundaries
20
+
21
+ - Script arguments legitimately contain the file content. The tests check them separately from subsequent tool-result content.
22
+ - `providerRequests` captures the exact input to the deterministic provider, not a paid HTTP request. It includes native SDK metadata as well as model-facing content.
23
+ - Native `details.calls` keeps a short argument preview. Native `nestedCalls` keeps call identity, status, timing, and bounded arguments or byte counts. These are not display-only IDE panels, and this change does not remove them.
24
+ - The inspected OpenAI Responses serializer converts tool results from `msg.content`; it does not send `details` or `nestedCalls` as tool output. Arbitrary custom providers can choose differently. We do not claim that the raw context object contains zero copied argument bytes.
25
+ - `ide-nested-results` is a saved custom entry for human-facing panels, not another model message. The fixture checks saved Write presentations and the rendered diff separately.
26
+
27
+ The fixtures use the pinned Pi 1.0.0 host. Live worktree verification uses installed Pi 1.1.0. Pi itself is unchanged.
28
+
29
+ Final live verification after reload covered direct Write, no-op Write, explicit nested output, silent 400-line Write, a directory-target failure, and Write-result reuse through Read. Direct and explicit Write output contained only status, one path, and the Read reminder; the failure added a short reason. Silent output stayed empty. Only the explicit Read exposed file content. `inspect_tui` captured Herdr `w3Q9:p1`, 105×108 cells, revision 344: the direct Write diff and the large nested diff's final rows/+400 count stayed visible. Existing argument-retention limits were labelled honestly.
30
+
31
+ Nineteen focused integration checks and ten capability-route unit checks passed. Final one-path and notice refinements were rechecked with three direct/error/Read cases and two notice/interruption cases. Typecheck, targeted lint, free capability coverage, and configured startup passed. No broad suites or paid inference ran.
32
+
33
+ ## Compact Write contract
34
+
35
+ A later direct-call probe also returned a `Final text` file fragment. The user expanded the scope: Write must return only a write status, path, and a reminder to Read the file. Problems get a short reason, not file text or detailed diagnostics. Human-facing diffs stay visible.
36
+
37
+ Direct Write and explicit `text(result)` / `return result` now share that compact receipt. Small, large, and unchanged files do not produce content previews. Formatter availability, diff counts, source lines, and successful formatting details are not part of the agent receipt.
38
+
39
+ Keep full mutation data for the renderer and whole-file source targets. Read still consumes the unchanged Write result, including formatted and no-op snapshots. Explicit Read is the positive control for obtaining content; Codemode still owns that output's truncation and recovery file.
40
+
41
+ Silent native Write still does not append a second receipt or file body to the parent result. It keeps short problem notices when processing failed or was interrupted, native editor-batch metadata, and unrelated pending-edit receipts.
42
+
43
+ ## Reproduce
44
+
45
+ ```sh
46
+ pnpm exec pi-test run -- vitest run --config vitest.integration.config.mjs \
47
+ tests/integration/native-codemode-write-context.integration.test.ts
48
+ pnpm exec vitest run scripts/tool-capability-matrix.test.ts -t 'capability route evidence'
49
+ pnpm check:capabilities
50
+ ```
51
+
52
+ Each context case saves `following-provider-request.json` beside `run.jsonl` under `.tmp/test-runs/tests/integration/native-codemode-write-context.integration.test.ts/`. The test source regenerates these local captures; they are not committed.
53
+
54
+ Coverage includes direct small/large/no-op and failed Writes, silent and repeated Writes, explicit compact text/return, Read output truncation, short problem notices, native metadata, persisted panels, and the executable silent-Write capability case. Related Write target, formatting, batch-boundary, and after-save interruption checks protect result reuse and honest recovery.
55
+
56
+ The paid matrix declares `codemode.silent-write` and `edit.write-receipt`. It checks both the completed parent's output and the Write child's own content, not just tool names. No paid matrix routes were run; real-model execution remains unverified.
package/docs/tools.md CHANGED
@@ -35,11 +35,17 @@ replace({ path: "src/file.ts:SEARCH#19AF:all:match", text: "new" }); // wrong
35
35
 
36
36
  A source field such as `path` or mutation `target` is therefore a resource field even when its name reflects the familiar filesystem case.
37
37
 
38
+ ## SSH resources
39
+
40
+ Configure a Linux SSH target, then use `ssh://target/path` with the supported existing tools. The resource keeps its target owner through Read, Search, Select, editing and transfers, Git, language tools, terminal and debugger sessions. Target-native web reads and capture use explicit remote sources rather than changing where ordinary URLs execute.
41
+
42
+ Authentication stays in OpenSSH. Target programs require their dependencies on that machine; missing support does not fall back to local execution. See [SSH configuration](./configuration.md#ssh-targets) and the [SSH guide](./agent-guides/ssh.md) for setup, prerequisites and supported sources.
43
+
38
44
  ## Read
39
45
 
40
46
  `read` resolves a source and returns agent-ready content. Built-in resolvers currently cover:
41
47
 
42
- - local text files and directories;
48
+ - local and configured SSH text files and directories;
43
49
  - images and PDFs;
44
50
  - HTTP and HTTPS resources;
45
51
  - HTML converted to readable Markdown;
@@ -58,7 +64,7 @@ When `path` is a typed text resource, `read` returns one independent chunk for e
58
64
 
59
65
  ### Original bytes
60
66
 
61
- Use `read({path: "raw:sample.bin", offset: 0, limit: 64})` to inspect original local file bytes, including PDF and image headers. In `raw:` mode only, offset is zero-based in bytes (negative from EOF), and limit is a non-negative byte count. The output shows hexadecimal offsets, hex bytes, and printable ASCII. Follow its returned byte offset to continue. No views or text anchors apply.
67
+ Use `read({path: "raw:sample.bin", offset: 0, limit: 64})` to inspect original file bytes, including PDF and image headers. For remote bytes, use `raw:ssh://target/path`. In `raw:` mode only, offset is zero-based in bytes (negative from EOF), and limit is a non-negative byte count. The output shows hexadecimal offsets, hex bytes, and printable ASCII. Follow its returned byte offset to continue. No views or text anchors apply.
62
68
 
63
69
  Codemode receives the same bounded hex view as a direct call. Use `text(result)` or return it to display that view. Follow the displayed offset or continuation reference. This is read-only; byte editing and byte diff are not included.
64
70
 
@@ -137,6 +143,12 @@ A `:line` range includes its LF or CRLF line ending. A whole-line replacement pr
137
143
 
138
144
  Per-result forms keep the search-time snapshot and fail as stale after their matched file changes. Complete `:all` forms rerun the original search recipe when a matched file changes, then select the current complete result set. Limited or otherwise incomplete searches omit the `:all` forms. A forged `:all` value for an incomplete search is rejected.
139
145
 
146
+ ## Select
147
+
148
+ `select` derives source-backed ranges or positions without editing. Text operations include lines, slices, marker pairs, columns and insertion positions. Selection-set operations keep, intersect, subtract or merge ranges within each source. JavaScript and TypeScript AST operations can find enclosing constructs, their named parts and related nodes; JSX/TSX is not supported by these structural selections.
149
+
150
+ Pass the returned result to Read, Search or an editing tool. Explicit boundary operations can expand a match to its containing line or construct, but displayed context alone does not expand its edit selection. See the [selection guide](./agent-guides/select-code.md).
151
+
140
152
  ## Editing
141
153
 
142
154
  Pi's built-in `edit` tool identifies a replacement with `oldText` and `newText`. Pi Agent IDE uses explicit mutation operations that can target snapshot, search, structural, and other registered anchors.
@@ -152,24 +164,19 @@ The text editor currently provides these mutation tools:
152
164
 
153
165
  They share the same Resource and anchor contracts. A mutation can resolve one or more Resources, validate its anchors against the current text, preview changes, run guards, write the result, and trigger post-edit feedback.
154
166
 
155
- A plain filesystem `path` names the Resource in which anchors are resolved. It is a scope, not an instruction to mutate the whole file. When an explicit anchor selects several Resources, a matching plain path limits the operation to that Resource; omitting the path applies it to the complete selection. A path outside the selection is rejected. `replace`, `delete`, and `insert` still need an anchor unless `path` is a typed text resource that already supplies ranges.
156
-
157
- A typed path applies the operation to its selected ranges:
167
+ Use an ordinary path without text selectors for whole-file Write or whole-object Delete, Copy, and Move. Copy and Move require an explicit destination path. They support regular files, directories and symlink objects, including local/SSH transfers. Directory merge/replace behavior, safety checks and uncertain effects are described in [directory operations](./directory-operations.md).
158
168
 
159
- - `replace` replaces every range;
160
- - `delete` deletes every range;
161
- - `insert` inserts after every range by default, or before every range with `before: true`;
162
- - `copy` and `move` may use one selected range as their source span.
169
+ For selected-text work, a path identifies the source and anchors identify the span. Pass an unchanged Read, Search, Select or mutation result when it already selects the wanted text. `replace` changes each selected range; `delete` removes those ranges while keeping the file; `insert` adds text around the selected lines. A directory listing or read-only view does not grant text-edit authority.
163
170
 
164
- An explicit compatible anchor can be combined with a typed path. The editor resolves it in every selected Resource and unions its range with the path ranges. Position anchors such as `begin`, `end`, and line hashes contribute their natural whole-line range. Different Resource sets, incompatible selection shapes, overlaps, reversed spans, ambiguous values, and stale values are rejected before any write.
171
+ Use Select to derive new boundaries rather than reconstructing them from previews. Copy and Move can pair source and destination selections, with equal counts. With ordinary file paths, text transfers use `targetStart` as the insertion anchor or `targetStart`/`targetEnd` as the replacement range. These selectors do not apply to whole-object transfers.
165
172
 
166
- When both `start` and `end` are supplied, they define one natural span from the start selection's left edge through the end selection's right edge. They must resolve to one Resource and one usable range at each endpoint. Without `end`, a search selection can apply independently to several ranges and Resources.
173
+ Use `start` alone for an exact fragment or one line anchor. With `end`, the range includes complete lines from the first containing line through the last. Snapshot-backed selectors reject changed files; missing or ambiguous exact text is rejected rather than guessed.
167
174
 
168
- `copy` and `move` always need a destination selection. `target` is only the destination Resource scope and defaults to the source scope. `targetStart`, or a typed `target` that supplies its range, selects the destination. Without `targetEnd`, content is inserted after that selection. With `targetEnd`, the inclusive natural destination span is replaced.
175
+ Independent standalone edits in one tool-call batch use their original snapshots. Inside native Codemode, run dependent edits in order and independent resources concurrently. Dependent source-tool calls commit eligible pending edits before consuming their results; script completion saves the remaining batch. Write saves its file and finishes post-edit processing before returning. No Apply or Flush tool is needed.
169
176
 
170
- The editor resolves and reads every Resource, resolves every anchor, applies every change in memory, and runs guards before the first write. A failure in those steps writes nothing. If a later Resource write fails, the editor attempts to restore every Resource already touched and reports any rollback failure. There is no silent partial success.
177
+ Check the final reported effects after failures or interruptions. An error does not prove rollback: earlier accepted edits can remain, and recursive operations have no atomic undo. Use text undo or Git-change undo deliberately; neither is a script-wide transaction. See [result composition](./structured-results.md) and the [editing guide](./agent-guides/editing.md) for reference lifetime and recovery.
171
178
 
172
- Path inheritance lets a later mutation reuse the most recently resolved Resource when the operation is unambiguous. Batched tool calls use the same mutation contracts as direct calls.
179
+ An omitted path can reuse the last resolved source when it is unambiguous. Supply the path when several resources could be meant.
173
180
 
174
181
  ## Anchors
175
182
 
@@ -45,6 +45,34 @@ export default function (pi: ExtensionAPI) {
45
45
 
46
46
  The hook receives one complete plan after Resource and anchor resolution but before the first write. It covers standalone mutation tools, including calls through native Codemode. A denial or thrown error leaves every Resource unchanged.
47
47
 
48
+ Whole-file move plans include both the source removal and the destination replacement. Copy plans include the modified destination. For non-UTF-8 files, `resource.binary.before` and `resource.binary.after` contain exact bytes; the text documents are empty instead of showing a lossy conversion. The guard runs before publication or source removal, and changed participants are rejected before effects.
49
+
50
+ ## Protect whole objects from deletion
51
+
52
+ ```ts
53
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
54
+ import { connectBeforeDeleteHook } from "pi-agent-ide/api/hooks";
55
+
56
+ export default function (pi: ExtensionAPI) {
57
+ connectBeforeDeleteHook(pi, {
58
+ id: "protect-data",
59
+ run(event) {
60
+ return event.resolvedPath.endsWith("/data")
61
+ ? { decision: "deny", reason: "Keep the data directory" }
62
+ : { decision: "allow" };
63
+ },
64
+ });
65
+ }
66
+ ```
67
+
68
+ This hook covers whole-object Delete calls for regular files, directories, and symlinks, plus directory/symlink Move source removal and existing destination removal. Both standalone and native Codemode calls use it. It does not cover selected-text removal, terminal/debugger actions, Copy, or ordinary-file Move. The event provides `path` (absolute requested path, or canonical SSH URI), `resolvedPath` (parent symlinks resolved, final symlink left alone), `cwd`, `kind`, `recursive`, and an optional abort `signal`. SSH events keep the target owner on all three paths; filesystem and Git checks run on that target. It runs once before removal and any user dialog. A denial or thrown error blocks removal; allowing does not override another hook or built-in protection.
69
+
70
+ Delete removes directories recursively and unlinks symlinks, including broken ones, without traversing their targets. The built-in policy uses the Git worktree containing Pi's cwd. For SSH it uses the selected target's project directory, not the controller's cwd. Tracked or newly staged targets require a user dialog. External directories and symlinks and targets without a Git worktree require a dialog unless they are eligible descendants of a [temporary root](./configuration.md#temporary-directory-deletion). SSH temporary roots and settings come from that target's account and project. Failed Git checks inside the current project still require a dialog. Untracked directories and symlinks inside that worktree need no dialog. Ordinary files keep their existing policy.
71
+
72
+ The dialog names the exact target, reason, and operation. Refusal, dismissal, cancellation, or an unavailable dialog prevents removal. Project roots, their ancestors, filesystem roots, and current Git control paths are always blocked, even when a hook allows. Git control protection also covers regular-file `.git` markers. Without Git, cwd and its ancestors are protected.
73
+
74
+ Delete checks the target identity and policy again after hooks and confirmation. Changed targets need a new request; there is no agent approval flag. These checks are not an atomic lock against other processes changing the filesystem. Recursive deletion has no rollback: a filesystem error after removal begins reports `unknown` effects, because some entries may already be gone.
75
+
48
76
  ## Check saved edits
49
77
 
50
78
  ```ts
@@ -63,6 +91,6 @@ export default function (pi: ExtensionAPI) {
63
91
  }
64
92
  ```
65
93
 
66
- This hook runs after post-processing and the final reread. Feedback appears in the agent result and beside the diff. Errors are reported as feedback; a successful write is never rolled back.
94
+ This hook runs after post-processing and the final reread. Feedback appears in the agent result and beside the diff, including in compact Write receipts and silent Codemode writes. A remark does not mean processing was interrupted. Errors are reported as feedback; a successful write is never rolled back. Write still leaves file text, diffs, and successful formatting details out of the agent receipt; use Read for the saved content.
67
95
 
68
96
  Hooks run in registration order. The first denial stops a before hook chain. IDs must be unique within each hook kind. Registrations belong to the Pi session and are removed on shutdown or reload.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-doctor",
3
- "version": "0.7.2",
3
+ "version": "0.8.0",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
@@ -22,9 +22,13 @@
22
22
  "types": "./src/executable.ts",
23
23
  "default": "./runtime/entry-22.js"
24
24
  },
25
+ "./api/project-probes": {
26
+ "types": "./src/project-probes.ts",
27
+ "default": "./runtime/entry-23.js"
28
+ },
25
29
  "./api/plugin-protocol": {
26
30
  "types": "./src/plugin-protocol.ts",
27
- "default": "./runtime/entry-23.js"
31
+ "default": "./runtime/entry-24.js"
28
32
  }
29
33
  },
30
34
  "dependencies": {