pi-agent-ide 0.9.7 → 1.0.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 (900) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/README.md +5 -3
  3. package/dist/chunk-2EY3LEZ7.js +1 -0
  4. package/dist/chunk-2QCE7GOV.js +1 -0
  5. package/dist/chunk-3V3OQO5S.js +118 -0
  6. package/dist/chunk-45EJ4762.js +33 -0
  7. package/dist/chunk-4AEYLVSR.js +5 -0
  8. package/dist/chunk-4DLSZYUO.js +1 -0
  9. package/dist/chunk-54EFJYUB.js +1 -0
  10. package/dist/{chunk-5DN2XBVI.js → chunk-5TPYHUJV.js} +1 -1
  11. package/dist/{chunk-KQV2ZXLP.js → chunk-6DC2Q5BI.js} +1 -1
  12. package/dist/chunk-72WO7H5T.js +1 -0
  13. package/dist/chunk-72X24ARV.js +2 -0
  14. package/dist/chunk-AB6RSWMB.js +23 -0
  15. package/dist/chunk-AKUBFJAR.js +1 -0
  16. package/dist/chunk-ASVMQMPX.js +10 -0
  17. package/dist/chunk-BW3XONMZ.js +1 -0
  18. package/dist/{chunk-R2U5WXYR.js → chunk-D23NS4VV.js} +1 -1
  19. package/dist/chunk-DSB6A5P5.js +53 -0
  20. package/dist/chunk-E4V4VNRM.js +3 -0
  21. package/dist/chunk-E6G3UVS7.js +1 -0
  22. package/dist/chunk-E7JBYW43.js +1 -0
  23. package/dist/chunk-FVWMI4GP.js +1 -0
  24. package/dist/chunk-GDIF3WT6.js +12 -0
  25. package/dist/chunk-GNYFA6FS.js +2 -0
  26. package/dist/{chunk-DHOIQZUF.js → chunk-GQXZEOND.js} +1 -1
  27. package/dist/chunk-GT2JPOBM.js +1 -0
  28. package/dist/chunk-GTZOIJCH.js +1 -0
  29. package/dist/chunk-HRZAIZGR.js +1 -0
  30. package/dist/{chunk-H6FEBUAP.js → chunk-HSAGZWPO.js} +1 -1
  31. package/dist/chunk-HUICUICD.js +3 -0
  32. package/dist/{chunk-2DSY4U73.js → chunk-I3G6K7QU.js} +1 -1
  33. package/dist/chunk-IRLWXPL4.js +7 -0
  34. package/dist/chunk-IZTOXSTR.js +6 -0
  35. package/dist/chunk-J5CKSIH7.js +1 -0
  36. package/dist/chunk-JKM4E5VB.js +5 -0
  37. package/dist/chunk-JMCI2ZE2.js +3 -0
  38. package/dist/{chunk-YZTVC7ME.js → chunk-JY63UUC2.js} +1 -1
  39. package/dist/chunk-KJ6HZC6L.js +7 -0
  40. package/dist/chunk-LG22ELG4.js +2 -0
  41. package/dist/chunk-LRAMFOUP.js +37 -0
  42. package/dist/chunk-MJMRV76H.js +1 -0
  43. package/dist/chunk-MMQIHUU5.js +1 -0
  44. package/dist/chunk-MNAIMZRO.js +9 -0
  45. package/dist/chunk-NGWQRV25.js +13 -0
  46. package/dist/chunk-NKI4TZSS.js +2 -0
  47. package/dist/chunk-NWCTAVGR.js +4 -0
  48. package/dist/chunk-O2C3F3MA.js +1 -0
  49. package/dist/chunk-OA26FH5G.js +1 -0
  50. package/dist/chunk-OEEE5BLN.js +16 -0
  51. package/dist/chunk-OLMACWQX.js +11 -0
  52. package/dist/{chunk-72FL5FHZ.js → chunk-PBMHSK6J.js} +1 -1
  53. package/dist/chunk-QC6VFZSB.js +2 -0
  54. package/dist/chunk-QCAGAJHJ.js +1 -0
  55. package/dist/{chunk-P7FUD4WY.js → chunk-QR7JR3P2.js} +1 -1
  56. package/dist/chunk-QSU5AEKW.js +1 -0
  57. package/dist/chunk-R7576HPO.js +25 -0
  58. package/dist/{chunk-B5UJCNQU.js → chunk-RNDSWVJF.js} +1 -1
  59. package/dist/chunk-S4GTWS2J.js +6 -0
  60. package/dist/chunk-SF44YQCB.js +2 -0
  61. package/dist/chunk-SJQGFUXR.js +6 -0
  62. package/dist/chunk-SKHD2QIT.js +1 -0
  63. package/dist/chunk-SKZTIAE4.js +4 -0
  64. package/dist/chunk-SZRC24OB.js +1 -0
  65. package/dist/chunk-T5PXAYWC.js +1 -0
  66. package/dist/chunk-TIZ4QDF3.js +1 -0
  67. package/dist/chunk-UHGHVYAW.js +4 -0
  68. package/dist/chunk-V2LLMBTA.js +1 -0
  69. package/dist/chunk-VB5P3TXJ.js +111 -0
  70. package/dist/chunk-VNG4QPPT.js +12 -0
  71. package/dist/chunk-VNNAVC4S.js +15 -0
  72. package/dist/chunk-VPBGKSFI.js +3 -0
  73. package/dist/chunk-WZ7MNISG.js +5 -0
  74. package/dist/chunk-X4CU7CMR.js +19 -0
  75. package/dist/chunk-X7CHS7JB.js +1 -0
  76. package/dist/chunk-XEPCURYZ.js +1 -0
  77. package/dist/chunk-XKVU6AAS.js +7 -0
  78. package/dist/chunk-XLTAP5YC.js +24 -0
  79. package/dist/chunk-XQMNVPNS.js +1 -0
  80. package/dist/chunk-YI32H7Z2.js +4 -0
  81. package/dist/chunk-YSGPCH52.js +18 -0
  82. package/dist/chunk-ZYG5E3DI.js +9 -0
  83. package/dist/entry-0.js +1 -1
  84. package/dist/entry-12.js +1 -1
  85. package/dist/entry-15.js +1 -1
  86. package/dist/entry-17.js +1 -1
  87. package/dist/entry-18.js +1 -1
  88. package/dist/entry-19.js +1 -1
  89. package/dist/entry-20.js +1 -1
  90. package/dist/entry-21.js +1 -1
  91. package/dist/entry-22.js +1 -1
  92. package/dist/entry-27.js +1 -1
  93. package/dist/entry-28.js +1 -1
  94. package/dist/entry-31.js +2 -2
  95. package/dist/entry-32.js +1 -1
  96. package/dist/entry-33.js +1 -1
  97. package/dist/entry-34.js +1 -1
  98. package/dist/entry-35.js +1 -1
  99. package/dist/entry-36.js +1 -1
  100. package/dist/entry-37.js +1 -1
  101. package/dist/entry-38.js +19 -13
  102. package/dist/entry-4.js +1 -1
  103. package/dist/entry-40.js +1 -1
  104. package/dist/entry-41.js +1 -1
  105. package/dist/entry-43.js +1 -1
  106. package/dist/entry-44.js +1 -1
  107. package/dist/entry-45.js +1 -1
  108. package/dist/entry-48.js +1 -1
  109. package/dist/entry-49.js +1 -1
  110. package/dist/entry-50.js +1 -1
  111. package/dist/entry-51.js +1 -1
  112. package/dist/entry-52.js +1 -1
  113. package/dist/entry-53.js +1 -1
  114. package/dist/entry-54.js +1 -1
  115. package/dist/entry-55.js +1 -1
  116. package/dist/entry-56.js +1 -1
  117. package/dist/entry-57.js +1 -1
  118. package/dist/entry-58.js +1 -1
  119. package/dist/entry-59.js +1 -1
  120. package/dist/entry-60.js +1 -1
  121. package/dist/entry-61.js +1 -1
  122. package/dist/entry-62.js +1 -1
  123. package/dist/entry-63.js +1 -1
  124. package/dist/entry-64.js +1 -1
  125. package/dist/entry-65.js +1 -1
  126. package/dist/entry-66.js +1 -1
  127. package/dist/entry-67.js +1 -1
  128. package/dist/entry-68.js +1 -0
  129. package/dist/entry-69.js +1 -1
  130. package/dist/entry-71.js +1 -1
  131. package/dist/entry-72.js +0 -1
  132. package/dist/entry-73.js +1 -1
  133. package/dist/entry-74.js +1 -1
  134. package/dist/entry-75.js +1 -1
  135. package/dist/entry-76.js +1 -1
  136. package/dist/entry-77.js +1 -1
  137. package/dist/entry-78.js +1 -0
  138. package/dist/entry-79.js +1 -1
  139. package/dist/entry-8.js +1 -1
  140. package/dist/entry-80.js +1 -0
  141. package/dist/entry-81.js +0 -1
  142. package/dist/entry-82.js +1 -1
  143. package/dist/entry-83.js +1 -1
  144. package/dist/entry-84.js +0 -1
  145. package/dist/entry-85.js +1 -1
  146. package/dist/entry-86.js +1 -2
  147. package/dist/entry-87.js +1 -1
  148. package/dist/entry-88.js +1 -1
  149. package/dist/entry-89.js +1 -1
  150. package/dist/entry-90.js +1 -1
  151. package/dist/entry-91.js +1 -3
  152. package/dist/entry-92.js +1 -1
  153. package/dist/entry-93.js +1 -1
  154. package/dist/entry-94.js +1 -1
  155. package/dist/entry-95.js +3 -0
  156. package/dist/entry-96.js +1 -0
  157. package/dist/entry-97.js +1 -0
  158. package/dist/entry-98.js +1 -0
  159. package/dist/pi-agent-ide.js +26 -13
  160. package/docs/agent-guides/ast-search.md +15 -4
  161. package/docs/agent-guides/debugger.md +1 -1
  162. package/docs/agent-guides/git-changes.md +1 -0
  163. package/docs/agent-guides/ssh.md +27 -7
  164. package/docs/agent-guides/terminal.md +4 -0
  165. package/docs/configuration.md +65 -11
  166. package/docs/development.md +4 -0
  167. package/docs/extensions.md +6 -4
  168. package/docs/structured-results.md +29 -15
  169. package/docs/tools.md +95 -29
  170. package/docs/user-hooks.md +1 -1
  171. package/node_modules/pi-agent-doctor/package.json +1 -1
  172. package/node_modules/pi-agent-doctor/src/catalog.ts +2 -0
  173. package/node_modules/pi-agent-doctor/src/executable.ts +1 -1
  174. package/node_modules/pi-agent-documentation/package.json +1 -1
  175. package/node_modules/pi-agent-filesystem/package.json +7 -7
  176. package/node_modules/pi-agent-filesystem/src/file-write-lock.ts +6 -4
  177. package/node_modules/pi-agent-filesystem/src/replace-file.ts +5 -2
  178. package/node_modules/pi-agent-filesystem/src/resolver.ts +26 -10
  179. package/node_modules/pi-agent-filesystem-image/package.json +3 -3
  180. package/node_modules/pi-agent-filesystem-jq/package.json +5 -5
  181. package/node_modules/pi-agent-filesystem-pdf/package.json +3 -3
  182. package/node_modules/pi-agent-filesystem-text/package.json +3 -3
  183. package/node_modules/pi-agent-ide-ast/package.json +13 -13
  184. package/node_modules/pi-agent-ide-ast/src/ast/manager.ts +56 -65
  185. package/node_modules/pi-agent-ide-ast/src/ast/outline.ts +197 -130
  186. package/node_modules/pi-agent-ide-ast/src/ast/read-text.ts +2 -1
  187. package/node_modules/pi-agent-ide-ast/src/ast-grep-binary.ts +46 -0
  188. package/node_modules/pi-agent-ide-ast/src/doctor-plugin.ts +119 -97
  189. package/node_modules/pi-agent-ide-ast/src/extension.ts +9 -24
  190. package/node_modules/pi-agent-ide-ast/src/outline-page.ts +96 -0
  191. package/node_modules/pi-agent-ide-ast/src/outline-resolver.ts +42 -78
  192. package/node_modules/pi-agent-ide-ast/src/overflow-handler.ts +5 -1
  193. package/node_modules/pi-agent-ide-ast/src/scope-handler.ts +2 -1
  194. package/node_modules/pi-agent-ide-ast/src/scope-resolver.ts +24 -5
  195. package/node_modules/pi-agent-ide-ast/src/search-presentation.ts +2 -1
  196. package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +406 -200
  197. package/node_modules/pi-agent-ide-ast/src/tool-ast-search.ts +27 -9
  198. package/node_modules/pi-agent-ide-ast/src/tool-outline.ts +191 -0
  199. package/node_modules/pi-agent-ide-changes/package.json +8 -8
  200. package/node_modules/pi-agent-ide-changes/src/changes/change-service.ts +63 -20
  201. package/node_modules/pi-agent-ide-changes/src/changes/change-types.ts +1 -0
  202. package/node_modules/pi-agent-ide-changes/src/changes/git-changes-backend.ts +25 -0
  203. package/node_modules/pi-agent-ide-changes/src/changes/git-paths.ts +13 -6
  204. package/node_modules/pi-agent-ide-changes/src/index-mutation-queue.ts +12 -8
  205. package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +88 -78
  206. package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +29 -3
  207. package/node_modules/pi-agent-ide-formatter/package.json +3 -3
  208. package/node_modules/pi-agent-ide-formatter/src/formatter.ts +39 -3
  209. package/node_modules/pi-agent-ide-formatter/src/rustfmt.ts +101 -0
  210. package/node_modules/pi-agent-ide-languages/package.json +2 -2
  211. package/node_modules/pi-agent-ide-lint/package.json +7 -7
  212. package/node_modules/pi-agent-ide-lint/src/catalog.ts +20 -14
  213. package/node_modules/pi-agent-ide-lint/src/registry.ts +2 -2
  214. package/node_modules/pi-agent-ide-lsp/index.ts +15 -88
  215. package/node_modules/pi-agent-ide-lsp/package.json +12 -12
  216. package/node_modules/pi-agent-ide-lsp/src/catalog.ts +21 -9
  217. package/node_modules/pi-agent-ide-lsp/src/lsp/clang-coverage.ts +265 -0
  218. package/node_modules/pi-agent-ide-lsp/src/lsp/clangd-launch.ts +48 -0
  219. package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +66 -11
  220. package/node_modules/pi-agent-ide-lsp/src/lsp/code-views.ts +514 -207
  221. package/node_modules/pi-agent-ide-lsp/src/lsp/corrected-names.ts +211 -0
  222. package/node_modules/pi-agent-ide-lsp/src/lsp/diagnostics.ts +20 -1
  223. package/node_modules/pi-agent-ide-lsp/src/lsp/files-containing.ts +70 -0
  224. package/node_modules/pi-agent-ide-lsp/src/lsp/index.ts +1 -1
  225. package/node_modules/pi-agent-ide-lsp/src/lsp/line-breaks.ts +16 -0
  226. package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +60 -16
  227. package/node_modules/pi-agent-ide-lsp/src/lsp/missing-sources.ts +21 -0
  228. package/node_modules/pi-agent-ide-lsp/src/lsp/navigation.ts +44 -0
  229. package/node_modules/pi-agent-ide-lsp/src/lsp/position-map.ts +17 -0
  230. package/node_modules/pi-agent-ide-lsp/src/lsp/range-match.ts +49 -0
  231. package/node_modules/pi-agent-ide-lsp/src/lsp/rename.ts +16 -5
  232. package/node_modules/pi-agent-ide-lsp/src/lsp/server-request-handlers.mjs +7 -1
  233. package/node_modules/pi-agent-ide-lsp/src/lsp/shared-server-host.mjs +133 -37
  234. package/node_modules/pi-agent-ide-lsp/src/lsp/shared-servers.ts +164 -13
  235. package/node_modules/pi-agent-ide-lsp/src/lsp/source-changes.ts +18 -6
  236. package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +346 -164
  237. package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-selectors.ts +376 -0
  238. package/node_modules/pi-agent-ide-lsp/src/lsp/symbols.ts +6 -0
  239. package/node_modules/pi-agent-ide-lsp/src/lsp/workspace-owner.ts +10 -0
  240. package/node_modules/pi-agent-ide-lsp/src/name-captures.ts +66 -0
  241. package/node_modules/pi-agent-ide-lsp/src/rename-plan.ts +383 -92
  242. package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +305 -77
  243. package/node_modules/pi-agent-ide-lsp/src/tool-lsp-search.ts +33 -11
  244. package/node_modules/pi-agent-image/package.json +2 -2
  245. package/node_modules/pi-agent-image/src/image-converter.ts +13 -2
  246. package/node_modules/pi-agent-invariant/package.json +1 -1
  247. package/node_modules/pi-agent-pdf/package.json +2 -2
  248. package/node_modules/pi-agent-read/package.json +7 -7
  249. package/node_modules/pi-agent-read/src/api/plugin-protocol.ts +1 -1
  250. package/node_modules/pi-agent-read/src/api/read-parameters.ts +51 -12
  251. package/node_modules/pi-agent-read/src/api/tools/read.ts +39 -3
  252. package/node_modules/pi-agent-read/src/core/extension.ts +80 -3
  253. package/node_modules/pi-agent-read/src/core/read-core.ts +6 -0
  254. package/node_modules/pi-agent-read/src/core/tools/read/list-result.ts +79 -0
  255. package/node_modules/pi-agent-read/src/core/tools/read/output-truncation.ts +45 -4
  256. package/node_modules/pi-agent-read/src/core/tools/read/raw-read.ts +18 -9
  257. package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +16 -3
  258. package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +37 -9
  259. package/node_modules/pi-agent-read/src/core/tools/read/result-target.ts +15 -4
  260. package/node_modules/pi-agent-read/src/core/tools/read/structured-result.ts +49 -18
  261. package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +158 -51
  262. package/node_modules/pi-agent-resource/package.json +5 -1
  263. package/node_modules/pi-agent-resource/src/file-text-read.ts +86 -0
  264. package/node_modules/pi-agent-resource/src/index.ts +54 -0
  265. package/node_modules/pi-agent-resource/src/json-structured-arguments.ts +131 -0
  266. package/node_modules/pi-agent-resource/src/line-map.ts +750 -0
  267. package/node_modules/pi-agent-resource/src/resolver.ts +2 -0
  268. package/node_modules/pi-agent-resource/src/resource-scheduler.ts +63 -23
  269. package/node_modules/pi-agent-resource/src/resource.ts +5 -0
  270. package/node_modules/pi-agent-resource/src/result-targets.ts +693 -66
  271. package/node_modules/pi-agent-resource/src/script-calls.ts +21 -0
  272. package/node_modules/pi-agent-resource/src/tool-deadline.ts +199 -0
  273. package/node_modules/pi-agent-resource/src/tool-result.ts +14 -5
  274. package/node_modules/pi-agent-resource/src/unchanged-read.ts +62 -0
  275. package/node_modules/pi-agent-search/package.json +8 -9
  276. package/node_modules/pi-agent-search/runtime/entry-57.js +0 -1
  277. package/node_modules/pi-agent-search/src/api/fuzzy.ts +2 -1
  278. package/node_modules/pi-agent-search/src/api/null-fields.ts +50 -0
  279. package/node_modules/pi-agent-search/src/api/path-list.ts +68 -0
  280. package/node_modules/pi-agent-search/src/api/presentation.ts +2 -1
  281. package/node_modules/pi-agent-search/src/api/search-call-policy.ts +16 -0
  282. package/node_modules/pi-agent-search/src/api/search-capture.ts +56 -0
  283. package/node_modules/pi-agent-search/src/api/search-parameters.ts +26 -4
  284. package/node_modules/pi-agent-search/src/api/search-scope.ts +38 -2
  285. package/node_modules/pi-agent-search/src/api/search.ts +46 -3
  286. package/node_modules/pi-agent-search/src/api/structured-result.ts +96 -25
  287. package/node_modules/pi-agent-search/src/core/extension.ts +75 -42
  288. package/node_modules/pi-agent-search/src/core/search-config.ts +2 -2
  289. package/node_modules/pi-agent-search/src/core/search-core.ts +103 -39
  290. package/node_modules/pi-agent-search-text/index.ts +62 -20
  291. package/node_modules/pi-agent-search-text/package.json +15 -15
  292. package/node_modules/pi-agent-search-text/runtime/entry-59.js +1 -0
  293. package/node_modules/pi-agent-search-text/src/current-matches.ts +314 -0
  294. package/node_modules/pi-agent-search-text/src/file-search.ts +178 -99
  295. package/node_modules/pi-agent-search-text/src/fuzzy-search.ts +40 -17
  296. package/node_modules/pi-agent-search-text/src/persisted-result.ts +3 -8
  297. package/node_modules/pi-agent-search-text/src/resolvers.ts +395 -103
  298. package/node_modules/pi-agent-search-text/src/ripgrep.ts +142 -0
  299. package/node_modules/pi-agent-search-text/src/scoped-search.ts +24 -12
  300. package/node_modules/pi-agent-search-text/src/search-backend.ts +333 -108
  301. package/node_modules/pi-agent-search-text/src/search-presentation.ts +6 -0
  302. package/node_modules/pi-agent-search-text/src/search-query.ts +69 -34
  303. package/node_modules/pi-agent-search-text/src/search-recipe.ts +80 -8
  304. package/node_modules/pi-agent-search-text/src/search-renderer.ts +2 -1
  305. package/node_modules/pi-agent-search-text/src/search-result.ts +10 -1
  306. package/node_modules/pi-agent-search-text/src/search-session.ts +449 -58
  307. package/node_modules/pi-agent-search-text/src/tool-file-search.ts +51 -6
  308. package/node_modules/pi-agent-text/package.json +3 -3
  309. package/node_modules/pi-agent-text/runtime/entry-63.js +1 -0
  310. package/node_modules/pi-agent-text/src/index.ts +18 -0
  311. package/node_modules/pi-agent-text/src/line-anchors.ts +211 -0
  312. package/node_modules/pi-agent-text/src/no-final-line-break.ts +12 -0
  313. package/node_modules/pi-agent-text/src/search-highlight.ts +8 -0
  314. package/node_modules/pi-agent-text/src/source-line.ts +7 -1
  315. package/node_modules/pi-agent-text/src/text-anchor.ts +34 -3
  316. package/node_modules/pi-agent-text/src/text-converter.ts +2 -1
  317. package/node_modules/pi-agent-text/src/text-document.ts +9 -23
  318. package/node_modules/pi-agent-text/src/text-target.ts +14 -6
  319. package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
  320. package/node_modules/pi-agent-text-anchor-constant/runtime/entry-64.js +2 -0
  321. package/node_modules/pi-agent-text-anchor-exact/index.ts +1 -65
  322. package/node_modules/pi-agent-text-anchor-exact/package.json +5 -5
  323. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-65.js +0 -1
  324. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-66.js +2 -0
  325. package/node_modules/pi-agent-text-anchor-exact/src/anchor.ts +185 -184
  326. package/node_modules/pi-agent-text-anchor-exact/src/anchored-literal-view.ts +122 -0
  327. package/node_modules/pi-agent-text-anchor-exact/src/fuzzy-worker.ts +2 -1
  328. package/node_modules/pi-agent-text-anchor-exact/src/literal-match.ts +359 -0
  329. package/node_modules/pi-agent-text-anchor-exact/src/recovery.ts +1 -0
  330. package/node_modules/pi-agent-text-anchor-line-hash/index.ts +5 -3
  331. package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
  332. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-67.js +0 -1
  333. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-68.js +2 -0
  334. package/node_modules/pi-agent-text-anchor-line-hash/src/anchor.ts +92 -67
  335. package/node_modules/pi-agent-text-anchor-line-hash/src/range-history.ts +105 -0
  336. package/node_modules/pi-agent-text-anchor-line-hash/src/read-handler.ts +22 -17
  337. package/node_modules/pi-agent-text-editor/index.ts +0 -10
  338. package/node_modules/pi-agent-text-editor/package.json +37 -26
  339. package/node_modules/pi-agent-text-editor/runtime/entry-84.js +0 -1
  340. package/node_modules/pi-agent-text-editor/runtime/entry-85.js +1 -0
  341. package/node_modules/pi-agent-text-editor/runtime/entry-86.js +1 -0
  342. package/node_modules/pi-agent-text-editor/runtime/entry-88.js +2 -0
  343. package/node_modules/pi-agent-text-editor/src/api/anchor-excerpt.ts +7 -0
  344. package/node_modules/pi-agent-text-editor/src/api/anchor-inspection.ts +2 -1
  345. package/node_modules/pi-agent-text-editor/src/api/delete-guard.ts +2 -0
  346. package/node_modules/pi-agent-text-editor/src/api/edit-pipeline.ts +40 -8
  347. package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +6 -1
  348. package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +37 -2
  349. package/node_modules/pi-agent-text-editor/src/api/native-edit-batch-event.ts +2 -2
  350. package/node_modules/pi-agent-text-editor/src/api/native-files.ts +16 -2
  351. package/node_modules/pi-agent-text-editor/src/api/pi-edit-text.ts +82 -0
  352. package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +9 -2
  353. package/node_modules/pi-agent-text-editor/src/api/post-edit.ts +1 -0
  354. package/node_modules/pi-agent-text-editor/src/api/stale-anchor-message.ts +13 -2
  355. package/node_modules/pi-agent-text-editor/src/api/text-selector-fields.ts +210 -0
  356. package/node_modules/pi-agent-text-editor/src/api/tool-call-interceptor.ts +1 -0
  357. package/node_modules/pi-agent-text-editor/src/api/tool-renderer.ts +3 -0
  358. package/node_modules/pi-agent-text-editor/src/core/already-done.ts +123 -0
  359. package/node_modules/pi-agent-text-editor/src/core/anchor-candidates.ts +116 -0
  360. package/node_modules/pi-agent-text-editor/src/core/anchor-preview.ts +32 -0
  361. package/node_modules/pi-agent-text-editor/src/core/delete-policy.ts +109 -23
  362. package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +19 -5
  363. package/node_modules/pi-agent-text-editor/src/core/editing-guidelines.ts +6 -5
  364. package/node_modules/pi-agent-text-editor/src/core/extension.ts +54 -21
  365. package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +7 -3
  366. package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +14 -5
  367. package/node_modules/pi-agent-text-editor/src/core/file-result-targets.ts +32 -11
  368. package/node_modules/pi-agent-text-editor/src/core/file-transfers.ts +67 -38
  369. package/node_modules/pi-agent-text-editor/src/core/file-write-observations.ts +287 -0
  370. package/node_modules/pi-agent-text-editor/src/core/image-write.ts +16 -4
  371. package/node_modules/pi-agent-text-editor/src/core/lookalike-bytes.ts +254 -0
  372. package/node_modules/pi-agent-text-editor/src/core/mutation-result/agent-diff.ts +29 -12
  373. package/node_modules/pi-agent-text-editor/src/core/mutation-result/compact-receipt.ts +48 -0
  374. package/node_modules/pi-agent-text-editor/src/core/mutation-result/diff.ts +2 -1
  375. package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +24 -34
  376. package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +13 -20
  377. package/node_modules/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +32 -3
  378. package/node_modules/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +36 -2
  379. package/node_modules/pi-agent-text-editor/src/core/mutation-result-targets.ts +26 -19
  380. package/node_modules/pi-agent-text-editor/src/core/native-snapshot-source.ts +13 -0
  381. package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +526 -148
  382. package/node_modules/pi-agent-text-editor/src/core/post-edit-scope.ts +28 -3
  383. package/node_modules/pi-agent-text-editor/src/core/read-fragment-resolver.ts +34 -14
  384. package/node_modules/pi-agent-text-editor/src/core/reference-list.ts +95 -0
  385. package/node_modules/pi-agent-text-editor/src/core/result-scope.ts +129 -0
  386. package/node_modules/pi-agent-text-editor/src/core/result-target-anchors.ts +20 -8
  387. package/node_modules/pi-agent-text-editor/src/core/result-transfer.ts +86 -69
  388. package/node_modules/pi-agent-text-editor/src/core/source-aliases.ts +92 -0
  389. package/node_modules/pi-agent-text-editor/src/core/source-change-retry.ts +92 -7
  390. package/node_modules/pi-agent-text-editor/src/core/structured-result.ts +2 -0
  391. package/node_modules/pi-agent-text-editor/src/core/text-anchor-registry.ts +162 -47
  392. package/node_modules/pi-agent-text-editor/src/core/text-change-engine.ts +321 -101
  393. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +206 -134
  394. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +4 -2
  395. package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +133 -18
  396. package/node_modules/pi-agent-text-editor/src/core/text-mutation-anchor-error.ts +13 -0
  397. package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +823 -226
  398. package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +51 -1
  399. package/node_modules/pi-agent-text-editor/src/core/write-agent-result.ts +7 -4
  400. package/node_modules/pi-agent-text-editor/src/tools/display-marker.ts +15 -0
  401. package/node_modules/pi-agent-text-editor/src/tools/text-selection.ts +268 -159
  402. package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +37 -32
  403. package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +24 -70
  404. package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +23 -36
  405. package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +31 -45
  406. package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +33 -65
  407. package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +80 -42
  408. package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +27 -16
  409. package/node_modules/pi-agent-text-editor-renderer/index.ts +0 -14
  410. package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
  411. package/node_modules/pi-agent-text-editor-renderer/runtime/entry-89.js +2 -0
  412. package/node_modules/pi-agent-text-editor-renderer/src/diff-model.ts +204 -78
  413. package/node_modules/pi-agent-text-editor-renderer/src/diff-renderer.ts +75 -8
  414. package/node_modules/pi-agent-text-editor-renderer/src/frozen-viewport.ts +4 -1
  415. package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +4 -3
  416. package/node_modules/pi-agent-text-editor-renderer/src/persisted-result.ts +44 -30
  417. package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +170 -26
  418. package/node_modules/pi-agent-text-editor-stale-anchor/index.ts +83 -83
  419. package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -6
  420. package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
  421. package/node_modules/pi-agent-tool-call-interception/runtime/entry-91.js +1 -0
  422. package/node_modules/pi-agent-tool-ui/package.json +3 -3
  423. package/node_modules/pi-agent-tool-ui/runtime/entry-92.js +1 -0
  424. package/node_modules/pi-agent-tool-ui/runtime/entry-93.js +1 -0
  425. package/node_modules/pi-agent-web/index.ts +0 -3
  426. package/node_modules/pi-agent-web/package.json +8 -8
  427. package/node_modules/pi-agent-web/src/search.ts +1 -2
  428. package/node_modules/pi-agent-web-html/package.json +3 -3
  429. package/node_modules/pi-agent-web-html/runtime/entry-95.js +2 -0
  430. package/node_modules/pi-agent-web-image/package.json +4 -4
  431. package/node_modules/pi-agent-web-image/runtime/entry-96.js +2 -0
  432. package/node_modules/pi-agent-web-pdf/package.json +4 -4
  433. package/node_modules/pi-agent-web-pdf/runtime/entry-97.js +2 -0
  434. package/node_modules/pi-agent-web-text/package.json +4 -4
  435. package/node_modules/pi-agent-web-text/runtime/entry-98.js +2 -0
  436. package/package.json +39 -38
  437. package/skills/capture-code-review-rule/SKILL.md +1 -1
  438. package/skills/configure-agent-ide/SKILL.md +1 -1
  439. package/src/api/code-view.ts +0 -2
  440. package/src/api/tool-config/linters.json +1 -0
  441. package/src/api/tool-config/lsp-servers.json +5 -0
  442. package/src/api/tool-config.ts +23 -2
  443. package/src/backend/config.ts +2 -0
  444. package/src/backend/configured-process.ts +1 -0
  445. package/src/backend/dap-java-transport.ts +4 -2
  446. package/src/backend/dap-java-worker.py +11 -4
  447. package/src/backend/dap-node-transport.ts +4 -2
  448. package/src/backend/dap-tcp-transport.ts +2 -3
  449. package/src/backend/debugger-workspace-owner.ts +6 -6
  450. package/src/backend/doctor-probe-worker.py +23 -15
  451. package/src/backend/doctor-workspace.ts +19 -18
  452. package/src/backend/file-transfer.ts +160 -56
  453. package/src/backend/formatter-registration.ts +54 -2
  454. package/src/backend/identity.ts +81 -12
  455. package/src/backend/lsp-file-watchers.ts +7 -9
  456. package/src/backend/lsp-workspace-owner.ts +25 -1
  457. package/src/backend/object-transfer.ts +28 -15
  458. package/src/backend/owned-command.ts +2 -1
  459. package/src/backend/owned-read-command.ts +2 -1
  460. package/src/backend/packaged-source.ts +12 -0
  461. package/src/backend/process-environment.ts +7 -9
  462. package/src/backend/process-metadata.ts +5 -5
  463. package/src/backend/recipe-evidence-worker.py +2 -0
  464. package/src/backend/recipe-evidence.ts +7 -8
  465. package/src/backend/registration.ts +2 -1
  466. package/src/backend/registry.ts +12 -2
  467. package/src/backend/resource-resolver.ts +11 -32
  468. package/src/backend/search-environment.ts +61 -4
  469. package/src/backend/ssh-channel-worker.py +6 -304
  470. package/src/backend/ssh-channel.ts +287 -36
  471. package/src/backend/ssh-connection-loss.ts +123 -0
  472. package/src/backend/ssh-file-stream.ts +216 -0
  473. package/src/backend/ssh-master.ts +443 -0
  474. package/src/backend/ssh-transfer-worker-windows.py +84 -0
  475. package/src/backend/ssh-transfer-worker.py +43 -10
  476. package/src/backend/ssh-transport.ts +238 -24
  477. package/src/backend/ssh-worker.py +7 -728
  478. package/src/backend/ssh.ts +83 -35
  479. package/src/backend/ssh_channel_common.py +68 -0
  480. package/src/backend/ssh_channel_posix.py +324 -0
  481. package/src/backend/ssh_channel_windows.py +527 -0
  482. package/src/backend/ssh_paths.py +23 -0
  483. package/src/backend/ssh_windows_files.py +254 -0
  484. package/src/backend/ssh_worker_common.py +96 -0
  485. package/src/backend/ssh_worker_posix.py +780 -0
  486. package/src/backend/ssh_worker_windows.py +687 -0
  487. package/src/backend/tool-config-access.ts +14 -11
  488. package/src/backend/tool-project.ts +4 -3
  489. package/src/backend/web-browser.ts +2 -3
  490. package/src/backend/web-http.ts +5 -5
  491. package/src/code-view/diagnostic-view.ts +12 -30
  492. package/src/code-view/reference.ts +9 -18
  493. package/src/code-view/source-view.ts +2 -1
  494. package/src/composite/codemode-tool-names.ts +79 -0
  495. package/src/composite/detached-results.ts +25 -6
  496. package/src/composite/ide-alias-rendering.ts +26 -4
  497. package/src/composite/module-labels.ts +2 -2
  498. package/src/composite/module-settings.ts +1 -0
  499. package/src/composite/nested-tool-rendering.ts +70 -24
  500. package/src/composite/output-limits.ts +12 -5
  501. package/src/composite/parallel-tool-guidance.ts +38 -0
  502. package/src/composite/script-values/ast-search.ts +56 -0
  503. package/src/composite/script-values/copy.ts +8 -0
  504. package/src/composite/script-values/delete.ts +5 -0
  505. package/src/composite/script-values/diff.ts +28 -0
  506. package/src/composite/script-values/edit-selection.ts +48 -0
  507. package/src/composite/script-values/failures.ts +170 -0
  508. package/src/composite/script-values/file-receipts.ts +63 -0
  509. package/src/composite/script-values/file-search.ts +10 -0
  510. package/src/composite/script-values/index.ts +55 -0
  511. package/src/composite/script-values/insert.ts +5 -0
  512. package/src/composite/script-values/lsp-search.ts +92 -0
  513. package/src/composite/script-values/match.ts +53 -0
  514. package/src/composite/script-values/move.ts +8 -0
  515. package/src/composite/script-values/path-list.ts +25 -0
  516. package/src/composite/script-values/provider-value.ts +21 -0
  517. package/src/composite/script-values/read.ts +206 -0
  518. package/src/composite/script-values/replace.ts +5 -0
  519. package/src/composite/script-values/result-reference.ts +9 -0
  520. package/src/composite/script-values/search-matches.ts +113 -0
  521. package/src/composite/script-values/search.ts +64 -0
  522. package/src/composite/script-values/semantic-search.ts +8 -0
  523. package/src/composite/script-values/terminal.ts +112 -0
  524. package/src/composite/script-values/text.ts +7 -0
  525. package/src/composite/script-values/types.ts +56 -0
  526. package/src/composite/script-values/undo.ts +5 -0
  527. package/src/composite/script-values/write.ts +8 -0
  528. package/src/composite/settings-panel.ts +18 -2
  529. package/src/composite/text-results.ts +488 -175
  530. package/src/composite/tool-availability.ts +29 -16
  531. package/src/composite/tool-discovery-guidance.ts +97 -0
  532. package/src/documentation/attachment.ts +31 -0
  533. package/src/documentation/extension.ts +6 -2
  534. package/src/documentation/search.ts +1 -7
  535. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
  536. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +3 -3
  537. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +5 -5
  538. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +3 -3
  539. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +3 -3
  540. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/src/file-write-lock.ts +6 -4
  541. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/src/replace-file.ts +5 -2
  542. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/src/resolver.ts +26 -10
  543. package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +0 -3
  544. package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -8
  545. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -3
  546. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-95.js +2 -0
  547. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
  548. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-96.js +2 -0
  549. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
  550. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-97.js +2 -0
  551. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
  552. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-98.js +2 -0
  553. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-94.js +2 -0
  554. package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/search.ts +1 -2
  555. package/src/extensions/pi-agent-read/package.json +7 -7
  556. package/src/extensions/pi-agent-read/src/api/plugin-protocol.ts +1 -1
  557. package/src/extensions/pi-agent-read/src/api/read-parameters.ts +51 -12
  558. package/src/extensions/pi-agent-read/src/api/tools/read.ts +39 -3
  559. package/src/extensions/pi-agent-read/src/core/extension.ts +80 -3
  560. package/src/extensions/pi-agent-read/src/core/read-core.ts +6 -0
  561. package/src/extensions/pi-agent-read/src/core/tools/read/list-result.ts +79 -0
  562. package/src/extensions/pi-agent-read/src/core/tools/read/output-truncation.ts +45 -4
  563. package/src/extensions/pi-agent-read/src/core/tools/read/raw-read.ts +18 -9
  564. package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +16 -3
  565. package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +37 -9
  566. package/src/extensions/pi-agent-read/src/core/tools/read/result-target.ts +15 -4
  567. package/src/extensions/pi-agent-read/src/core/tools/read/structured-result.ts +49 -18
  568. package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +158 -51
  569. package/src/extensions/pi-agent-search/package.json +8 -9
  570. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +62 -20
  571. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +15 -15
  572. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-59.js +1 -0
  573. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-62.js +1 -0
  574. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/current-matches.ts +314 -0
  575. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/file-search.ts +178 -99
  576. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/fuzzy-search.ts +40 -17
  577. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/persisted-result.ts +3 -8
  578. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +395 -103
  579. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/ripgrep.ts +142 -0
  580. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/scoped-search.ts +24 -12
  581. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +333 -108
  582. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-presentation.ts +6 -0
  583. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-query.ts +69 -34
  584. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +80 -8
  585. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +2 -1
  586. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +10 -1
  587. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +449 -58
  588. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/tool-file-search.ts +51 -6
  589. package/src/extensions/pi-agent-search/runtime/entry-57.js +0 -1
  590. package/src/extensions/pi-agent-search/runtime/entry-58.js +2 -0
  591. package/src/extensions/pi-agent-search/src/api/fuzzy.ts +2 -1
  592. package/src/extensions/pi-agent-search/src/api/null-fields.ts +50 -0
  593. package/src/extensions/pi-agent-search/src/api/path-list.ts +68 -0
  594. package/src/extensions/pi-agent-search/src/api/presentation.ts +2 -1
  595. package/src/extensions/pi-agent-search/src/api/search-call-policy.ts +16 -0
  596. package/src/extensions/pi-agent-search/src/api/search-capture.ts +56 -0
  597. package/src/extensions/pi-agent-search/src/api/search-parameters.ts +26 -4
  598. package/src/extensions/pi-agent-search/src/api/search-scope.ts +38 -2
  599. package/src/extensions/pi-agent-search/src/api/search.ts +46 -3
  600. package/src/extensions/pi-agent-search/src/api/structured-result.ts +96 -25
  601. package/src/extensions/pi-agent-search/src/core/extension.ts +75 -42
  602. package/src/extensions/pi-agent-search/src/core/search-config.ts +2 -2
  603. package/src/extensions/pi-agent-search/src/core/search-core.ts +103 -39
  604. package/src/extensions/pi-agent-text-editor/index.ts +0 -10
  605. package/src/extensions/pi-agent-text-editor/package.json +37 -26
  606. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
  607. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-64.js +2 -0
  608. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.ts +1 -65
  609. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -5
  610. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-65.js +0 -1
  611. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-66.js +2 -0
  612. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/anchor.ts +185 -184
  613. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/anchored-literal-view.ts +122 -0
  614. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/fuzzy-worker.ts +2 -1
  615. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/literal-match.ts +359 -0
  616. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/recovery.ts +1 -0
  617. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +5 -3
  618. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
  619. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-67.js +0 -1
  620. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-68.js +2 -0
  621. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/anchor.ts +92 -67
  622. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/range-history.ts +105 -0
  623. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/read-handler.ts +22 -17
  624. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +0 -14
  625. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
  626. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-89.js +2 -0
  627. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-model.ts +204 -78
  628. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-renderer.ts +75 -8
  629. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/frozen-viewport.ts +4 -1
  630. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +4 -3
  631. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/persisted-result.ts +44 -30
  632. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +170 -26
  633. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/index.ts +83 -83
  634. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -6
  635. package/src/extensions/pi-agent-text-editor/runtime/entry-84.js +0 -1
  636. package/src/extensions/pi-agent-text-editor/runtime/entry-85.js +1 -0
  637. package/src/extensions/pi-agent-text-editor/runtime/entry-86.js +1 -0
  638. package/src/extensions/pi-agent-text-editor/runtime/entry-87.js +1 -0
  639. package/src/extensions/pi-agent-text-editor/runtime/entry-88.js +2 -0
  640. package/src/extensions/pi-agent-text-editor/src/api/anchor-excerpt.ts +7 -0
  641. package/src/extensions/pi-agent-text-editor/src/api/anchor-inspection.ts +2 -1
  642. package/src/extensions/pi-agent-text-editor/src/api/delete-guard.ts +2 -0
  643. package/src/extensions/pi-agent-text-editor/src/api/edit-pipeline.ts +40 -8
  644. package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +6 -1
  645. package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +37 -2
  646. package/src/extensions/pi-agent-text-editor/src/api/native-edit-batch-event.ts +2 -2
  647. package/src/extensions/pi-agent-text-editor/src/api/native-files.ts +16 -2
  648. package/src/extensions/pi-agent-text-editor/src/api/pi-edit-text.ts +82 -0
  649. package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +9 -2
  650. package/src/extensions/pi-agent-text-editor/src/api/post-edit.ts +1 -0
  651. package/src/extensions/pi-agent-text-editor/src/api/stale-anchor-message.ts +13 -2
  652. package/src/extensions/pi-agent-text-editor/src/api/text-selector-fields.ts +210 -0
  653. package/src/extensions/pi-agent-text-editor/src/api/tool-call-interceptor.ts +1 -0
  654. package/src/extensions/pi-agent-text-editor/src/api/tool-renderer.ts +3 -0
  655. package/src/extensions/pi-agent-text-editor/src/core/already-done.ts +123 -0
  656. package/src/extensions/pi-agent-text-editor/src/core/anchor-candidates.ts +116 -0
  657. package/src/extensions/pi-agent-text-editor/src/core/anchor-preview.ts +32 -0
  658. package/src/extensions/pi-agent-text-editor/src/core/delete-policy.ts +109 -23
  659. package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +19 -5
  660. package/src/extensions/pi-agent-text-editor/src/core/editing-guidelines.ts +6 -5
  661. package/src/extensions/pi-agent-text-editor/src/core/extension.ts +54 -21
  662. package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +7 -3
  663. package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +14 -5
  664. package/src/extensions/pi-agent-text-editor/src/core/file-result-targets.ts +32 -11
  665. package/src/extensions/pi-agent-text-editor/src/core/file-transfers.ts +67 -38
  666. package/src/extensions/pi-agent-text-editor/src/core/file-write-observations.ts +287 -0
  667. package/src/extensions/pi-agent-text-editor/src/core/image-write.ts +16 -4
  668. package/src/extensions/pi-agent-text-editor/src/core/lookalike-bytes.ts +254 -0
  669. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/agent-diff.ts +29 -12
  670. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/compact-receipt.ts +48 -0
  671. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/diff.ts +2 -1
  672. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +24 -34
  673. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +13 -20
  674. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +32 -3
  675. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +36 -2
  676. package/src/extensions/pi-agent-text-editor/src/core/mutation-result-targets.ts +26 -19
  677. package/src/extensions/pi-agent-text-editor/src/core/native-snapshot-source.ts +13 -0
  678. package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +526 -148
  679. package/src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts +28 -3
  680. package/src/extensions/pi-agent-text-editor/src/core/read-fragment-resolver.ts +34 -14
  681. package/src/extensions/pi-agent-text-editor/src/core/reference-list.ts +95 -0
  682. package/src/extensions/pi-agent-text-editor/src/core/result-scope.ts +129 -0
  683. package/src/extensions/pi-agent-text-editor/src/core/result-target-anchors.ts +20 -8
  684. package/src/extensions/pi-agent-text-editor/src/core/result-transfer.ts +86 -69
  685. package/src/extensions/pi-agent-text-editor/src/core/source-aliases.ts +92 -0
  686. package/src/extensions/pi-agent-text-editor/src/core/source-change-retry.ts +92 -7
  687. package/src/extensions/pi-agent-text-editor/src/core/structured-result.ts +2 -0
  688. package/src/extensions/pi-agent-text-editor/src/core/text-anchor-registry.ts +162 -47
  689. package/src/extensions/pi-agent-text-editor/src/core/text-change-engine.ts +321 -101
  690. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +206 -134
  691. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +4 -2
  692. package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +133 -18
  693. package/src/extensions/pi-agent-text-editor/src/core/text-mutation-anchor-error.ts +13 -0
  694. package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +823 -226
  695. package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +51 -1
  696. package/src/extensions/pi-agent-text-editor/src/core/write-agent-result.ts +7 -4
  697. package/src/extensions/pi-agent-text-editor/src/tools/display-marker.ts +15 -0
  698. package/src/extensions/pi-agent-text-editor/src/tools/text-selection.ts +268 -159
  699. package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +37 -32
  700. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +24 -70
  701. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +23 -36
  702. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +31 -45
  703. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +33 -65
  704. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +80 -42
  705. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +27 -16
  706. package/src/pi-agent-ide.ts +41 -32
  707. package/src/plugins/pi-agent-ide-ast/package.json +13 -13
  708. package/src/plugins/pi-agent-ide-ast/src/ast/manager.ts +56 -65
  709. package/src/plugins/pi-agent-ide-ast/src/ast/outline.ts +197 -130
  710. package/src/plugins/pi-agent-ide-ast/src/ast/read-text.ts +2 -1
  711. package/src/plugins/pi-agent-ide-ast/src/ast-grep-binary.ts +46 -0
  712. package/src/plugins/pi-agent-ide-ast/src/doctor-plugin.ts +119 -97
  713. package/src/plugins/pi-agent-ide-ast/src/extension.ts +9 -24
  714. package/src/plugins/pi-agent-ide-ast/src/outline-page.ts +96 -0
  715. package/src/plugins/pi-agent-ide-ast/src/outline-resolver.ts +42 -78
  716. package/src/plugins/pi-agent-ide-ast/src/overflow-handler.ts +5 -1
  717. package/src/plugins/pi-agent-ide-ast/src/scope-handler.ts +2 -1
  718. package/src/plugins/pi-agent-ide-ast/src/scope-resolver.ts +24 -5
  719. package/src/plugins/pi-agent-ide-ast/src/search-presentation.ts +2 -1
  720. package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +406 -200
  721. package/src/plugins/pi-agent-ide-ast/src/tool-ast-search.ts +27 -9
  722. package/src/plugins/pi-agent-ide-ast/src/tool-outline.ts +191 -0
  723. package/src/plugins/pi-agent-ide-changes/package.json +8 -8
  724. package/src/plugins/pi-agent-ide-changes/src/changes/change-service.ts +63 -20
  725. package/src/plugins/pi-agent-ide-changes/src/changes/change-types.ts +1 -0
  726. package/src/plugins/pi-agent-ide-changes/src/changes/git-changes-backend.ts +25 -0
  727. package/src/plugins/pi-agent-ide-changes/src/changes/git-paths.ts +13 -6
  728. package/src/plugins/pi-agent-ide-changes/src/index-mutation-queue.ts +12 -8
  729. package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +88 -78
  730. package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +29 -3
  731. package/src/plugins/pi-agent-ide-debugger/index.ts +42 -32
  732. package/src/plugins/pi-agent-ide-debugger/src/string-enum.ts +14 -0
  733. package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +124 -79
  734. package/src/plugins/pi-agent-ide-formatter/package.json +3 -3
  735. package/src/plugins/pi-agent-ide-formatter/src/formatter.ts +39 -3
  736. package/src/plugins/pi-agent-ide-formatter/src/rustfmt.ts +101 -0
  737. package/src/plugins/pi-agent-ide-languages/package.json +2 -2
  738. package/src/plugins/pi-agent-ide-lint/package.json +7 -7
  739. package/src/plugins/pi-agent-ide-lint/src/catalog.ts +20 -14
  740. package/src/plugins/pi-agent-ide-lint/src/registry.ts +2 -2
  741. package/src/plugins/pi-agent-ide-lsp/index.ts +15 -88
  742. package/src/plugins/pi-agent-ide-lsp/package.json +12 -12
  743. package/src/plugins/pi-agent-ide-lsp/src/catalog.ts +21 -9
  744. package/src/plugins/pi-agent-ide-lsp/src/lsp/clang-coverage.ts +265 -0
  745. package/src/plugins/pi-agent-ide-lsp/src/lsp/clangd-launch.ts +48 -0
  746. package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +66 -11
  747. package/src/plugins/pi-agent-ide-lsp/src/lsp/code-views.ts +514 -207
  748. package/src/plugins/pi-agent-ide-lsp/src/lsp/corrected-names.ts +211 -0
  749. package/src/plugins/pi-agent-ide-lsp/src/lsp/diagnostics.ts +20 -1
  750. package/src/plugins/pi-agent-ide-lsp/src/lsp/files-containing.ts +70 -0
  751. package/src/plugins/pi-agent-ide-lsp/src/lsp/index.ts +1 -1
  752. package/src/plugins/pi-agent-ide-lsp/src/lsp/line-breaks.ts +16 -0
  753. package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +60 -16
  754. package/src/plugins/pi-agent-ide-lsp/src/lsp/missing-sources.ts +21 -0
  755. package/src/plugins/pi-agent-ide-lsp/src/lsp/navigation.ts +44 -0
  756. package/src/plugins/pi-agent-ide-lsp/src/lsp/position-map.ts +17 -0
  757. package/src/plugins/pi-agent-ide-lsp/src/lsp/range-match.ts +49 -0
  758. package/src/plugins/pi-agent-ide-lsp/src/lsp/rename.ts +16 -5
  759. package/src/plugins/pi-agent-ide-lsp/src/lsp/server-request-handlers.mjs +7 -1
  760. package/src/plugins/pi-agent-ide-lsp/src/lsp/shared-server-host.mjs +133 -37
  761. package/src/plugins/pi-agent-ide-lsp/src/lsp/shared-servers.ts +164 -13
  762. package/src/plugins/pi-agent-ide-lsp/src/lsp/source-changes.ts +18 -6
  763. package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +346 -164
  764. package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-selectors.ts +376 -0
  765. package/src/plugins/pi-agent-ide-lsp/src/lsp/symbols.ts +6 -0
  766. package/src/plugins/pi-agent-ide-lsp/src/lsp/workspace-owner.ts +10 -0
  767. package/src/plugins/pi-agent-ide-lsp/src/name-captures.ts +66 -0
  768. package/src/plugins/pi-agent-ide-lsp/src/rename-plan.ts +383 -92
  769. package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +305 -77
  770. package/src/plugins/pi-agent-ide-lsp/src/tool-lsp-search.ts +33 -11
  771. package/src/plugins/pi-agent-ide-processes/src/registry.ts +64 -3
  772. package/src/plugins/pi-agent-ide-processes/src/ui.ts +57 -1
  773. package/src/plugins/pi-agent-ide-semantic/src/backend.ts +18 -6
  774. package/src/plugins/pi-agent-ide-semantic/src/vera-backend.ts +16 -9
  775. package/src/plugins/pi-agent-ide-terminal/index.ts +23 -7
  776. package/src/plugins/pi-agent-ide-terminal/src/list.ts +79 -0
  777. package/src/plugins/pi-agent-ide-terminal/src/output-limits.ts +22 -0
  778. package/src/plugins/pi-agent-ide-terminal/src/process-provider.ts +3 -0
  779. package/src/plugins/pi-agent-ide-terminal/src/renderer.ts +18 -6
  780. package/src/plugins/pi-agent-ide-terminal/src/resources.ts +132 -18
  781. package/src/plugins/pi-agent-ide-terminal/src/search.ts +117 -50
  782. package/src/plugins/pi-agent-ide-terminal/src/session-manager.ts +94 -10
  783. package/src/plugins/pi-agent-ide-terminal/src/shell-profile.ts +24 -1
  784. package/src/plugins/pi-agent-ide-terminal/src/shell-result.ts +5 -2
  785. package/src/plugins/pi-agent-ide-terminal/src/terminal-text.ts +173 -0
  786. package/src/plugins/pi-agent-ide-terminal/src/tools.ts +266 -112
  787. package/src/plugins/pi-agent-ide-terminal/src/types.ts +6 -1
  788. package/src/plugins/pi-agent-ide-terminal/src/ui.ts +11 -6
  789. package/src/plugins/pi-agent-ide-terminal/src/unix-pty-output.ts +47 -0
  790. package/src/post-edit/gate.ts +16 -1
  791. package/src/semantic/extension.ts +8 -2
  792. package/src/standalone/scoped-api.ts +85 -18
  793. package/src/toolchain/types.ts +4 -0
  794. package/dist/chunk-2AANEKFS.js +0 -1
  795. package/dist/chunk-33U3RUM3.js +0 -12
  796. package/dist/chunk-34IYWKY5.js +0 -1
  797. package/dist/chunk-4CSNQX54.js +0 -23
  798. package/dist/chunk-53IV6EKV.js +0 -1
  799. package/dist/chunk-5AROEOJB.js +0 -1
  800. package/dist/chunk-5D4C225L.js +0 -1
  801. package/dist/chunk-5W6QQZFI.js +0 -2
  802. package/dist/chunk-6W4OJLCJ.js +0 -1
  803. package/dist/chunk-6ZYCTWQE.js +0 -1
  804. package/dist/chunk-756K3LJY.js +0 -1
  805. package/dist/chunk-AMSNDWBT.js +0 -2
  806. package/dist/chunk-APWMLLSE.js +0 -17
  807. package/dist/chunk-BMSAVDRD.js +0 -13
  808. package/dist/chunk-BRJIXNFU.js +0 -5
  809. package/dist/chunk-C2GZLLSP.js +0 -5
  810. package/dist/chunk-ECSMTGVM.js +0 -6
  811. package/dist/chunk-EWTVVPUA.js +0 -11
  812. package/dist/chunk-FBR7ZLLN.js +0 -1
  813. package/dist/chunk-FGN2ZMEN.js +0 -1
  814. package/dist/chunk-FJSYWOE6.js +0 -1
  815. package/dist/chunk-FTECKRK6.js +0 -1
  816. package/dist/chunk-GRZTKMXQ.js +0 -1
  817. package/dist/chunk-HFCHOFLV.js +0 -2
  818. package/dist/chunk-HFF4GY7R.js +0 -3
  819. package/dist/chunk-HJXSEPO7.js +0 -111
  820. package/dist/chunk-HSEDKYH4.js +0 -1
  821. package/dist/chunk-II7AOJNH.js +0 -9
  822. package/dist/chunk-J34VKQGJ.js +0 -1
  823. package/dist/chunk-J6CDIH3S.js +0 -84
  824. package/dist/chunk-JHWLRL4U.js +0 -1
  825. package/dist/chunk-JMQ67UNK.js +0 -3
  826. package/dist/chunk-JRIP33PC.js +0 -13
  827. package/dist/chunk-K5M65CAF.js +0 -1
  828. package/dist/chunk-KJAR2WDO.js +0 -1
  829. package/dist/chunk-KX7MG72M.js +0 -1
  830. package/dist/chunk-L2B4DTVS.js +0 -1
  831. package/dist/chunk-LEKC4GQK.js +0 -5
  832. package/dist/chunk-LIGOOMJS.js +0 -10
  833. package/dist/chunk-LY2UANKU.js +0 -6
  834. package/dist/chunk-M7P7V4WI.js +0 -25
  835. package/dist/chunk-MXLSGMRZ.js +0 -3
  836. package/dist/chunk-N2NEFXHB.js +0 -13
  837. package/dist/chunk-NF74ITWT.js +0 -2
  838. package/dist/chunk-NQYUIQRH.js +0 -1
  839. package/dist/chunk-OCU6NW5Y.js +0 -1
  840. package/dist/chunk-OIEA4QWF.js +0 -4
  841. package/dist/chunk-ON5HDFNL.js +0 -10
  842. package/dist/chunk-P43GGKUC.js +0 -28
  843. package/dist/chunk-PPCWY4BB.js +0 -1
  844. package/dist/chunk-QGXZ4RWX.js +0 -1
  845. package/dist/chunk-S3T5NOSL.js +0 -1
  846. package/dist/chunk-S7E2D5K7.js +0 -5
  847. package/dist/chunk-SIYPD5MM.js +0 -3
  848. package/dist/chunk-STUZZM5B.js +0 -1
  849. package/dist/chunk-T4FTT3U4.js +0 -1
  850. package/dist/chunk-T5ACAOKJ.js +0 -4
  851. package/dist/chunk-TILMPAF2.js +0 -1
  852. package/dist/chunk-TSNY2FSU.js +0 -1
  853. package/dist/chunk-TWJINFQB.js +0 -9
  854. package/dist/chunk-TWQ6ACOI.js +0 -1
  855. package/dist/chunk-UDVVKVG4.js +0 -1
  856. package/dist/chunk-V2D5MLGE.js +0 -1
  857. package/dist/chunk-VDSSAP6Y.js +0 -1
  858. package/dist/chunk-VHYJTAXX.js +0 -1
  859. package/dist/chunk-WCSWQDJ2.js +0 -22
  860. package/dist/chunk-WQTF6Q2X.js +0 -3
  861. package/dist/chunk-XE4W5YTE.js +0 -2
  862. package/dist/chunk-YFPU2LRR.js +0 -23
  863. package/dist/chunk-YLEERRX3.js +0 -33
  864. package/dist/chunk-YOJHCARZ.js +0 -1
  865. package/dist/chunk-YPTDPMK5.js +0 -1
  866. package/docs/agent-guides/editing.md +0 -43
  867. package/docs/agent-guides/search.md +0 -38
  868. package/node_modules/pi-agent-ide-lsp/src/declaration-targets.ts +0 -73
  869. package/node_modules/pi-agent-text-anchor-constant/runtime/entry-63.js +0 -2
  870. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-64.js +0 -1
  871. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-66.js +0 -1
  872. package/node_modules/pi-agent-text-editor/runtime/entry-68.js +0 -1
  873. package/node_modules/pi-agent-text-editor-renderer/runtime/entry-85.js +0 -2
  874. package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-86.js +0 -2
  875. package/node_modules/pi-agent-tool-ui/runtime/entry-88.js +0 -1
  876. package/node_modules/pi-agent-tool-ui/runtime/entry-89.js +0 -1
  877. package/node_modules/pi-agent-web-html/runtime/entry-91.js +0 -2
  878. package/node_modules/pi-agent-web-image/runtime/entry-92.js +0 -2
  879. package/node_modules/pi-agent-web-pdf/runtime/entry-93.js +0 -2
  880. package/src/composite/search-facts.ts +0 -45
  881. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-91.js +0 -2
  882. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-92.js +0 -2
  883. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-93.js +0 -2
  884. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-94.js +0 -2
  885. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-58.js +0 -2
  886. package/src/extensions/pi-agent-search/runtime/entry-54.js +0 -1
  887. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-63.js +0 -2
  888. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-64.js +0 -1
  889. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-66.js +0 -1
  890. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-85.js +0 -2
  891. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-86.js +0 -2
  892. package/src/extensions/pi-agent-text-editor/runtime/entry-68.js +0 -1
  893. package/src/plugins/pi-agent-ide-lsp/src/declaration-targets.ts +0 -73
  894. /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-54.js +0 -0
  895. /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-58.js +0 -0
  896. /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-62.js +0 -0
  897. /package/node_modules/{pi-agent-tool-call-interception → pi-agent-text-editor}/runtime/entry-87.js +0 -0
  898. /package/node_modules/{pi-agent-web → pi-agent-text-editor-stale-anchor}/runtime/entry-90.js +0 -0
  899. /package/node_modules/{pi-agent-web-text → pi-agent-web}/runtime/entry-94.js +0 -0
  900. /package/src/extensions/{pi-agent-read/extensions/pi-agent-web → pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor}/runtime/entry-90.js +0 -0
package/docs/tools.md CHANGED
@@ -4,13 +4,23 @@ Pi Agent IDE explores a small tool surface for coding agents. The goal is to kee
4
4
 
5
5
  The project is experimental. The behavior below describes the current implementation, not a performance guarantee.
6
6
 
7
+ ## Tool discovery
8
+
9
+ Read, Diagnostics, Search, File Search and the common editing and terminal tools are declared initially. AST Search, LSP Search, Diff and Undo are deferred, alongside Stage, Unstage and Debug. Use `tool_search({ query })` for direct calls. Inside Codemode, call known tools through `tools`, such as `tools.ast_search(args)`, without loading them first. Use `await searchTools(query)` to find other script tools and `await describeTool(name)` to see their arguments.
10
+
11
+ Use AST Search for syntax patterns, captures and enclosing code. Use LSP Search for symbol definitions, references and call graphs through language servers.
12
+
7
13
  ## Readable results and composition
8
14
 
9
- IDE tools return readable text in direct calls and Codemode. A leading system-result envelope carries a registered UUID; it is not file content. Pass the unchanged result to another source parameter, or use its UUID in a direct call. The system resolves the private source records. Check the readable file effects before retrying failed edits. See [IDE result composition](./structured-results.md) for reference lifetime and automatic commit boundaries.
15
+ IDE tools return readable text in direct calls. A leading system-result envelope carries a registered UUID; it is not file content. Pass the unchanged result to another source parameter, or use its UUID in a direct call. In Codemode, several tools return values instead, such as Read's `{ text, id }`. Source parameters take any object whose `id` is such a reference, including these values; its other fields are ignored. The system resolves the private source records. Check the readable file effects before retrying failed edits. See [IDE result composition](./structured-results.md) for reference lifetime and automatic commit boundaries.
10
16
 
11
17
  ## Shared output limits
12
18
 
13
- Every IDE tool, including nested calls and the combined Codemode result, shares a useful-text limit of 50 KiB or 2,000 lines. Images share a limit of 20 frames, 4,000,000 pixels and 20 MiB of image bytes per result. Notices, guides and composition references are added afterward and are not part of these budgets.
19
+ Readable IDE results, including nested panels and the combined Codemode result, share a useful-text limit of 50 KiB or 2,000 lines. Images share a limit of 20 frames, 4,000,000 pixels and 20 MiB of image bytes per result. Notices, guides and composition references are added afterward and are not part of these budgets. Codemode values can contain more than a readable result: Search returns every match it found, for example, and file_search returns all paths unless given a limit.
20
+
21
+ A text Read inside a Codemode script likewise returns its complete requested text: the script receives `{ text, id }` with the whole requested text, so it can parse a large file or write it back. Explicit `offset` and `limit` select exactly that window. Notices and continuation hints stay out of `text`, and large files are not replaced with a code overview. The script's own output is still bounded: the combined Codemode result shares the limit above. The Read panel inside the Codemode card shows the first 2,000 lines or 50 KiB of such a result and says that the script received all of it.
22
+
23
+ Diff is another exception: in a Codemode script it returns the complete unified diff as a string, without the system-result envelope, and `""` when the sources are equal. A direct Diff call shows the bounded diff and saves the full one as a temporary result that its truncation notice names.
14
24
 
15
25
  When the shared text limit truncates a result, the complete useful text is saved to a private temporary file. The result names that file. Use Read with `offset` and `limit` to continue, or `raw:` byte windows for a line that is too large. The file is removed when its owning runtime is disposed. Media is resized or omitted, not archived.
16
26
 
@@ -20,11 +30,13 @@ An explicit request limit still selects what the tool produces; the saved file d
20
30
 
21
31
  Tool source fields take one complete resource reference. A filesystem path is the common case, but it is not the only kind of reference. Depending on the tool and loaded resolvers, a reference may name a file, URL, protocol source, temporary result, or a typed text selection.
22
32
 
33
+ Read accepts a file or directory path, resource address, or issued result. Pass an array to read each source independently in order. Unsupported sources return an error. Built-in address forms include `raw:<file>` for bytes, `temp:<id>` for saved output, and `docs:<id>` for a guide. HTTP(S) URLs are fetched locally; `web:ssh://<target>/https://…` fetches on that target. Extensions register further resource addresses.
34
+
23
35
  A typed `SEARCH#...` value is both an anchor and a resource reference. It carries its source or sources and its selected ranges. Pass it by itself in either role:
24
36
 
25
37
  ```ts
26
38
  replace({ path: "SEARCH#19AF:all:match", text: "new" });
27
- replace({ start: "SEARCH#19AF:all:match", text: "new" });
39
+ replace({ at: "SEARCH#19AF:all:match", text: "new" });
28
40
  ```
29
41
 
30
42
  Do not append it to a filesystem path:
@@ -41,6 +53,14 @@ Configure a Linux SSH target, then use `ssh://target/path` with the supported ex
41
53
 
42
54
  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
55
 
56
+ ## Outline
57
+
58
+ Use `outline({ path: "src/file.ts" })` for a compressed declaration outline without implementation bodies. The path can also be a configured `ssh://` file. The result maps visible declarations back to the original source, so you can reuse it in Read, Search, AST Search or editing tools.
59
+
60
+ `offset` is the first projected outline row (1-based), not a source line number. `limit` is the maximum number of projected rows (default and maximum: 100). A page can end earlier to stay within its output budget. Follow the continuation in the result to get the next page. In Codemode, `outline` returns `{ text, id }` for the current page; its reference covers only the source rows on that page. If a single projected row is too wide to show, use Read to inspect that source line.
61
+
62
+ Outline parses the whole file on each call and accepts up to 4 MiB of normalized UTF-8 text and 100,000 lines. Beyond those limits, use Search to find declarations or Read with source-line `offset` and `limit`. Read with `views: ["ast"]` still shows the original text with scope markers.
63
+
44
64
  ## Read
45
65
 
46
66
  `read` resolves a source and returns agent-ready content. Built-in resolvers currently cover:
@@ -50,27 +70,35 @@ Authentication stays in OpenSSH. Target programs require their dependencies on t
50
70
  - HTTP and HTTPS resources;
51
71
  - HTML converted to readable Markdown;
52
72
  - AST-aware code views;
53
- - LSP diagnostics, symbols, references, and call graphs.
73
+ - diagnostic overlays beside file text.
54
74
 
55
75
  A read result may include anchors, diagnostics, Git changes, or structural markers. Large text results are bounded. The shared limiter retains complete truncated text in a temporary file.
56
76
 
57
77
  Read sources are not assumed to be writable. The read and text-editor cores keep separate resolver registries so a derived view cannot be edited by accident.
58
78
 
79
+ When a read of a local or SSH text file reaches the last line and the file does not end with a line break, the output ends with the line ``, the marker that mutation results use. It follows every view of file lines. The marker is not a line of the file: it has no anchor or line number, it does not count toward `offset`, `limit` or the line totals, and Codemode script data does not hold it. A read that stops before the last line, a file that ends with a line break and an empty file show no marker. `replace` and `insert` refuse text whose last line is exactly the marker with `END_OF_FILE_MARKER` and change nothing, because the tools keep the end of the file as it is.
80
+
59
81
  HTTP(S) pages use a fast direct request first. Failed requests (including HTTP 403 and timeouts), failed HTML conversion, and empty HTML automatically trigger one retry through local Chrome or Chromium within the same `read` call. The browser gets a fresh timeout; caller cancellation stops both attempts. If the browser also fails or is not installed, the read reports both failures. Successful non-HTML reads and non-HTML conversion errors keep their normal behavior. Browser rendering removes hidden elements before the same HTML-to-Markdown conversion runs.
60
82
 
61
83
  Browser reads discover `google-chrome`, `google-chrome-stable`, `chromium`, or `chromium-browser` on `PATH` and in common Linux locations. Set `PI_AGENT_IDE_BROWSER_PATH` to use another executable. Missing browser support returns a normal read failure and `/agent-ide-doctor` reports it as an optional warning. Browser reads execute page JavaScript. When Pi runs as root, Chromium is launched without its process sandbox; only open sources you trust in that mode.
62
84
 
63
85
  When `path` is a typed text resource, `read` returns one independent chunk for each selected range, in resolver order. Each chunk starts at the range's containing line. `offset` and `limit` are applied to every chunk, not across the combined result. The chunks are then joined and the normal aggregate limit of 2,000 lines or 50 KiB is applied.
64
86
 
87
+ When `path` is an array, `read` reads each source on its own with the same `offset`, `limit` and `views`, and shows each result under its source. The call fails as a whole when any source fails; the other sources' results are still shown. In Codemode it returns an array of values in the same order, with `null` for each source that failed, and the Codemode result lists only the failed sources.
88
+
65
89
  ### Original bytes
66
90
 
67
91
  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.
68
92
 
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.
93
+ In Codemode, a `raw:` Read returns `{ bytes }`, the base64 of every requested byte; the Read panel shows the bounded hex view. This is read-only; byte editing and byte diff are not included.
70
94
 
71
- ### Diagnostic completion
95
+ ## Diagnostics
72
96
 
73
- Edits save before background diagnostics finish. Automatic notifications show only sources with findings, in the chat as soon as they arrive, with a matching hidden message sent to the agent. A new finding wakes an idle agent; during a run it is queued as steering input for the next model call. Each source names the actual reporting command, such as `eslint_d` or `typescript-language-server`, rather than a wrapper extension. Chat summaries show that name in parentheses beside its counts. Pending, unavailable, and empty reports stay silent, including updates that clear earlier findings. Silence does not mean checks passed. Explicit `diagnostics:<path>` reads and the diagnostics view still return details and readiness.
97
+ `diagnostics({ path: "src/app.ts" })` checks one local or `ssh://` file. It accepts only `path`, not Read's `offset`, `limit` or `views`. The tool is available initially. It returns lint and language-server findings with nearby source context and reports pending, unavailable or snapshot states without treating them as completed clean checks. A repeated call checks the current file; an issued report remains a snapshot.
98
+
99
+ Pass the unchanged report or its UUID to Read or Search. In Codemode, the value is `{ text, id }`; reuse it unchanged. Report selections are read-only, including derived reads and searches: read the source file before editing it. Use Read with `views: ["diagnostics"]` when you need findings beside the file text rather than a focused report.
100
+
101
+ Edits save before background diagnostics finish. Automatic notifications show only sources with findings, in the chat as soon as they arrive, with a matching hidden message sent to the agent. A new finding wakes an idle agent; during a run it is queued as steering input for the next model call. Each source names the actual reporting command, such as `eslint_d` or `typescript-language-server`, rather than a wrapper extension. Chat summaries show that name in parentheses beside its counts. Pending, unavailable, and empty reports stay silent, including updates that clear earlier findings. Silence does not mean checks passed. The `diagnostics` tool and the diagnostics view return details and readiness.
74
102
 
75
103
  LSP reads prefer standard pull reports. Servers that advertise a supported completed-request command can use an adapter; TypeScript language server uses one adapter for both TypeScript and JavaScript. Adapter selection uses server capabilities, not language names. All requests remain tied to the synchronized document revision and are canceled when it becomes stale.
76
104
 
@@ -78,20 +106,25 @@ Other push-only servers return a `snapshot`: the latest publication, with no pro
78
106
 
79
107
  ## Terminal sessions
80
108
 
81
- Codemode receives the same readable shell status and output as direct calls. The result includes its session source and a reference to the complete log when output is shortened. A wait timeout leaves a running session, not a failed command. Inspect the reported exit status and effects; failed tools can reject.
109
+ In Codemode, `bash`, `powershell`, `remote_bash` and `remote_powershell` resolve to the fields of Pi's own `bash`, plus the session: `{ output, exit_code, truncated, full_output_path, wall_time_seconds, session }`. `output` holds up to 1 MiB; longer output keeps its first and last 512 KiB around an omission marker such as `[... 351432 bytes omitted ...]`, with `truncated` set. `full_output_path` is the complete log. `session` is the `shell:<session>` source, which stays readable after the command ends. A background command, or one still running when its wait times out, has no `exit_code` yet. A non-zero exit code is a value, not a failure: the script gets it, and the Codemode result does not list the call as failed. Only a command that cannot start, such as one with an unknown SSH target, resolves to `null`; the Codemode result lists it with its reason. A direct call still shows readable status and output and reports a non-zero exit code as an error.
82
110
 
83
111
  ```ts
84
112
  const result = await tools.bash({ command: "your-command" });
85
- text(result);
86
- text(await tools.read({ path: result }));
113
+ if (result !== null && result.exit_code !== 0) text(result.output);
114
+ const server = await tools.bash({ command: "npm run dev", background: true });
115
+ if (server !== null) {
116
+ const status = await tools.read({ path: server.session });
117
+ if (status !== null && "text" in status) text(status.text);
118
+ }
87
119
  ```
88
120
 
89
121
  `bash` (Linux/WSL) or `powershell` (Windows) starts a command in the user's configured system shell. Its schema and prompt guidance name that shell at runtime, so the agent writes Bash, zsh, PowerShell, or Command Prompt syntax as appropriate. Commands are not translated between shell languages.
122
+ A native Windows session offers only `powershell` for local commands; Pi's built-in `bash` (Git Bash) is withdrawn, also after a Teleport from Linux, a reload or a resume.
90
123
 
91
124
  Every run returns a stable `shell:<session>` source. Synchronous runs wait for the real exit status. Background runs return immediately, remain visible below the editor, and send one completion message that wakes the agent; nearby completions are combined without losing individual results. `/terminals` opens the active and recent session overlay.
92
125
  The UI tab in `/agent-ide-settings` controls persistent active-terminal presentation: Detailed cards (default), Compact count, or Off. Detailed cards replace the separate active count instead of showing both. This setting does not hide ordinary run results or completion messages.
93
126
 
94
- Use `read` on the returned source for status and bounded output. Compact cards show the latest 12 output rows and count omitted earlier rows; expanded cards show all retained rows. Add `views: ["image"]` to receive a PNG of the ANSI-aware virtual terminal screen. Use `write` to send exact text without Enter. Use `insert` for named keys and chords such as `Enter`, `Ctrl+C`, `Ctrl+Shift+Left`, or Unix caret controls such as `^U`; separate multiple keys with spaces or commas. A native Codemode script can send several terminal inputs without file formatting or diagnostics. Use `search` with the `shell:<session>` path to search retained output, including rows outside the current screen. `delete` terminates the owned process tree when needed, disposes the virtual screen, and removes the session. `replace` does not apply to terminal sessions.
127
+ Use `read` on the returned source for status and bounded output. Compact cards show the latest 12 output rows and count omitted earlier rows; expanded cards show all retained rows. Add `views: ["image"]` to receive a PNG of the ANSI-aware virtual terminal screen. Use `write` to send exact text without Enter. Use `insert` for named keys and chords such as `Enter`, `Ctrl+C`, `Ctrl+Shift+Left`, or Unix caret controls such as `^U`; separate multiple keys with spaces or commas. A native Codemode script can send several terminal inputs without file formatting or diagnostics. Use `search` with the `shell:<session>` path to search retained output, including rows outside the current screen; the query is literal text, or a regular expression when it starts with `regex:`. `delete` terminates the owned process tree when needed, disposes the virtual screen, and removes the session. `replace` does not apply to terminal sessions.
95
128
 
96
129
  For a bounded terminal sequence, use `views: ["sequence:duration=2,interval=0.5,scale=1"]`. This returns five PNG frames over two seconds. Duration is capped at 10 seconds and each sequence at 20 frames. Terminal images and sequences support scale from greater than 0 through 1; they do not support region or grid-cell selection.
97
130
 
@@ -105,20 +138,26 @@ Deleting an active session first requests graceful termination, then forcefully
105
138
 
106
139
  A resolver decides whether it understands a query. The first successful resolver returns the result. Search plugins can add new query forms without adding another agent tool.
107
140
 
108
- Local text search tries literal terms first. If there are no matches, it retries unquoted terms as regex. If that also finds nothing, an ordinary multi-word query falls back to separate words. Each fallback is reported. Invalid optional regex is skipped, while I/O errors, cancellation, and regex runtime errors stay errors. `regex:<pattern>` forces regex-only matching and reports invalid patterns.
141
+ A local text query is literal text, quotes included, unless it contains a Boolean operator. Local text search tries the literal text first. If there are no matches, it retries the text, or a Boolean query's unquoted terms, as regex. If that also finds nothing, a multi-word query without Boolean operators falls back to separate words. Each fallback is reported. Invalid optional regex is skipped, while I/O errors, cancellation, and regex runtime errors stay errors. The exception is a path that ripgrep cannot read while it searches the rest of the scope, such as a WSL symlink seen from Windows through `\\wsl.localhost`: the search returns the matches it found with one notice that counts the skipped paths and names the first. `regex:<pattern>` forces regex-only matching and reports invalid patterns.
109
142
 
110
- After all ordinary attempts finish with zero matches, a single unquoted ASCII identifier can return separate possible-name groups. They cover naming-style changes, one extra or missing edge component, and small typos, strongest first. Each name is verified exactly in the same scope. These are spelling suggestions, not synonyms, automatic corrections, or proof of equivalent behavior. Quoted, Boolean, explicit regex and other protocol queries do not use this branch.
143
+ After all ordinary attempts finish with zero matches, a single unquoted ASCII identifier can return separate possible-name groups. They cover naming-style changes, one extra or missing edge component, and small typos, strongest first. Each name is verified exactly in the same scope. These are spelling suggestions, not synonyms, automatic corrections, or proof of equivalent behavior. Queries with quotes, Boolean operators or `regex:` do not use this branch.
111
144
 
112
145
  Local groups provide current Read selections; a complete candidate all-reference refreshes only its exact alternative. URL groups reuse the already converted page text and provide URL line ranges without editable Search references. Name collection, capture and output have fixed budgets; a skip or limited capture is explicit. Narrow the scope if a budget is reached.
113
146
 
114
- Boolean queries keep their conditions across literal and regex attempts. They support uppercase `AND`, `OR`, infix `NOT`, `||`, and space-separated `|`. Adjacent terms imply `AND`; `AND` and `NOT` bind more tightly than `OR`. Parentheses containing Boolean operators group conditions. Regex groups, classes, and escapes stay inside terms: `(?:foo|bar)\d+ AND "keep.me" NOT ignored`. An unspaced `foo|bar` is searched as literal text first, then as regex alternatives. Single or double quotes keep a term literal in every attempt. Quoted and Boolean queries never fall back to separate words. Invalid Boolean expressions report the source column and expected syntax.
147
+ A query becomes Boolean only when it contains an operator: uppercase `AND`, `OR`, `NOT`, `||`, or space-separated `|`. Quotes alone never make a query Boolean. Boolean queries keep their conditions across literal and regex attempts. Adjacent terms imply `AND`; `AND` and `NOT` bind more tightly than `OR`. `NOT` excludes lines from its conjunction wherever it appears, so `a NOT b`, `a AND NOT b`, and `NOT b AND a` are the same query; a conjunction needs at least one term without `NOT`. Parentheses containing Boolean operators group conditions. Regex groups, classes, and escapes stay inside terms: `(?:foo|bar)\d+ AND "keep.me" NOT ignored`. An unspaced `foo|bar` is searched as literal text first, then as regex alternatives. In a Boolean query, single or double quotes group a literal phrase in every attempt, and an operator inside quotes is literal text: `"a || b"` finds `a || b`. Boolean queries never fall back to separate words. Invalid Boolean expressions report the source column and expected syntax.
115
148
  Boolean text searches also work with registered result scopes. Each selected range is searched on its own: terms outside it, in sparse gaps, or on another line cannot satisfy a condition.
116
149
 
117
- Empty protocol queries such as `regex:` and unhandled prefixes such as `unknown:needle` search their original text, including the prefix. The tool reports this fallback. Nonempty installed protocols keep their specialized behavior; service errors, timeouts, and successful protocol searches with no results do not launch local text search. Plugins mark a local fallback resolver with `fallback: true`; these resolvers run after specialists regardless of numeric priority and receive empty protocol queries directly.
150
+ A Boolean search can select individual tokens instead of one phrase. Search warns about these selections and prevents editing or transferring the whole result or an `all` anchor. Read or search the result to inspect it, edit a numbered match, or quote the text to search for it as one phrase.
151
+
152
+ Separate-word fallback matches are read-only location hints. Search refuses every edit or transfer through them: the whole result, an `all` anchor, a numbered `:line` or `:match` anchor and each match's handle. Read them or search inside them, then edit through a Read anchor or a search for the exact current text.
153
+
154
+ A colon does not make a query a resource reference. Plain text such as `docs:debugger` or `status:` follows normal text matching without a protocol fallback notice. Supported query forms such as `regex:<pattern>` stay with their resolver; `regex:` without a pattern is an error. Resolver failures and successful searches with no results do not launch another text search. Plugins mark a text fallback resolver with `fallback: true`; these resolvers run after specialists regardless of numeric priority.
155
+
156
+ An omitted or empty `path` searches the session directory. An explicit `null` argument fails the call in `search`, `file_search`, `ast_search` and `lsp_search` instead of counting as omitted. A null source such as `path: null` means the call that produced it failed or selected no text, such as a directory copy or a `delete`, and searching everything instead would hide that; the same holds for `include`, `exclude`, `query`, `pattern` and the other text arguments. In Codemode the failed call resolves to `null` and is listed in the script's failure block. A null in a number, boolean or object argument, such as `limit: null`, is rejected as invalid arguments. Pi drops a null optional property before a tool runs, so each tool keeps the null visible in `prepareArguments` and refuses it in `execute`.
118
157
 
119
158
  A complete search call times out after 30 seconds by default, including resolver work and result formatting. The timeout cancels the active resolver and tells the agent to retry with a smaller `path` scope. Global and project `search.json` files can change or disable the timeout as described in [Configuration](./configuration.md#search-timeout).
120
159
 
121
- Local text and regex results can expose four reusable forms:
160
+ Direct local text and regex results can expose four reusable forms:
122
161
 
123
162
  - `SEARCH#HASH:N:line` selects result `N` as a whole line;
124
163
  - `SEARCH#HASH:N:match` selects the exact match for result `N`;
@@ -129,21 +168,32 @@ Every response that includes these values includes an `Anchors:` syntax legend a
129
168
 
130
169
  These values are both edit anchors and typed text resources. `read` and mutation `path` fields accept each complete `SEARCH#...` value directly; no filesystem path is added before or around it. The text search resolver turns them into ordered Resource sources and character ranges; consumers use that typed result and do not parse the `SEARCH#` string themselves.
131
170
 
132
- A `:line` range includes its LF or CRLF line ending. A whole-line replacement preserves that separator when the replacement text does not provide one. Insertion happens after the line by default and before it when `before: true`. A final line without a line ending selects through EOF and stays without a trailing separator when replaced, unless the replacement text provides a line ending. Whole-line deletion removes only that line and its own terminator, when present. An unterminated final line never consumes the preceding separator. Empty Replace removes the same range as Delete. Adjacent whole-line deletions are coalesced. A `:match` range contains only the matched characters, so deleting it keeps surrounding text and line endings.
171
+ For text reads, a `:line` range includes the line text and its LF if present; in CRLF text, the range includes the CR too. A final unterminated line selects through EOF. A `:match` range contains only the matched characters. Edits use the same boundary rules for both forms; see [Editing](#editing).
133
172
 
134
- 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.
173
+ 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. A search that ran inside a Read or Search result reruns inside that result as its file is now, also for `ast_search` and `lsp_search`. Limited or otherwise incomplete searches omit the `:all` forms. A forged `:all` value for an incomplete search is rejected.
174
+
175
+ When an `:all` form cannot be used, the error says why and what to do: the search was limited, the rerun found more matches than its limit, the result it ran inside is no longer in the file, the file kept changing while the search ran again, or the rerun failed with its own reason. An edit retries a file that changed during the rerun, like any other change by another process. A retry of the same edit does not search again when it can avoid it: it moves the matches the earlier attempt found onto the newer text through unchanged lines. It searches again when a match's own line changed or moved, or when an added or changed line contains a matched text and so may hold a new match.
135
176
 
136
177
  ## File search
137
178
 
138
- `file_search` finds file paths under `path` (default: the session directory), locally or on an SSH target. A `pattern` with glob syntax (`*`, `**`, `?`, character classes, braces) matches paths relative to `path` when it contains `/`, and file names at any depth otherwise. Other patterns match as a case-insensitive subsequence of the relative path. `include` and `exclude` narrow the scan; `.git` is skipped and ignore files are honored. Results are sorted, limited by `limit` (default 100), and mark an incomplete list when the limit is reached.
179
+ `file_search` finds file paths under `path` (default: the session directory), locally or on an SSH target. A `pattern` with glob syntax (`*`, `**`, `?`, character classes, braces) matches paths relative to `path` when it contains `/`, and file names at any depth otherwise. Other patterns match as a case-insensitive subsequence of the relative path. `include` and `exclude` narrow the scan; `.git` is skipped and ignore files are honored. The tool walks paths in a deterministic order and stops as soon as it finds `limit` distinct matches (default 100). Reaching the limit or the 30-second deadline leaves an incomplete list. In Codemode, the value is a `string[]` with no default match limit. If the call times out, the array contains the paths found so far and the Codemode failure summary marks it incomplete. Narrow `path` if you need a complete list.
139
180
 
140
181
  ## Syntax search
141
182
 
142
- `ast_search` runs [ast-grep](https://ast-grep.github.io/) in files or inside a returned Read, Search or edit result, for every language ast-grep supports. It takes either a `pattern` in source-code syntax, with `$NAME` and `$$$ARGS` captures, or an ast-grep `rule` object with a `language`. Rules add relations such as `inside`, `has`, `not`, `follows` and `precedes`. With a result as `path`, `relation: "enclosing"` returns the innermost match that contains each range, for example the function around a text match. Matches and captures are guarded `SEARCH#` and `RESULT#` selections like text search results. The agent guide is `docs:ast-search`.
183
+ `ast_search` runs [ast-grep](https://ast-grep.github.io/) in files or inside a returned Read, Search or edit result, for every language ast-grep supports. It takes either a `pattern` in source-code syntax, with `$NAME` and `$$$ARGS` captures, or an ast-grep `rule` object with a `language`. Rules add relations such as `inside`, `has`, `not`, `follows` and `precedes`. With a result as `path`, `relation: "enclosing"` returns the innermost match that contains each range, for example the function around a text match. Matches and captures are guarded `SEARCH#` and `RESULT#` selections like text search results. Pi Agent IDE ships its own ast-grep for local projects, so no system-wide install is needed; SSH targets still use the `ast-grep` on their own PATH. If the bundled ast-grep cannot start, the tool is not offered and the doctor names the reason. The agent guide is `docs:ast-search`.
143
184
 
144
185
  ## Language-server search
145
186
 
146
- `lsp_search` asks the project's language servers. `query` finds declarations and references by symbol name in the workspace, a path or a returned result; `references: true` follows symbols found inside that scope to references elsewhere in the workspace. `declaration: "file#selector"` returns one declaration as a guarded `SEARCH#` selection. `calls: "file"` or `calls: "file#selector"` lists references and incoming and outgoing calls. Editing tools keep accepting `symbol:<file>#<selector>` paths, and `symbol:<file>#<selector>#name` triggers a native rename.
187
+ `lsp_search` asks the project's language servers. `query` finds declarations and references by symbol name in the workspace, a path or a returned result; `references: true` follows symbols found inside that scope to references elsewhere in the workspace. `declaration: "file#selector"` returns one declaration as a guarded `SEARCH#` selection; a selector segment with parameter types, such as `clamp(int, float)`, names one overload, and each definition in a `query` result shows its selector. `calls: "file"` or `calls: "file#selector"` lists references and incoming and outgoing calls. Pass the returned declaration or its match to an editing tool to edit its complete lines as text. The result also exposes `capture name: RESULT#…`, available in Codemode as `matches[0].captures.name[0]`. Replace that capture with a new identifier to rename through the language server, including references, imports and shorthand forms. A rename takes one capture without start/end; replacing the whole declaration remains a text edit.
188
+
189
+ In Codemode, `query` and `declaration` resolve to `{ id, complete, matches }` like Search, with every match unless `limit` is set; a declaration's one match holds the whole declaration. `calls` resolves to `{ id, complete, matches, incoming, outgoing }`: references in `matches`, and each caller and callee as its whole declaration, in whole lines like `declaration`. A call at module level has the whole file as its caller in TypeScript, so that `incoming` entry selects the whole file. A file's calls merge the lists of its top-level declarations. `id` selects the references, and each match's `id` selects that match. `complete: false` marks C and C++ answers that can miss references, as below, and calls in a direction the server does not support.
190
+
191
+ For C and C++, clangd needs extra handling. After a fatal clang error, clang stops instantiating templates. The 20-error limit is one such error and a missing `#include` is another. Code after it that needs a new instantiation then has no references, and clang reports nothing there.
192
+
193
+ - Pi starts clangd through a small POSIX launcher. The launcher writes a clangd user config that adds `-ferror-limit=0`, followed by the user's own `clangd/config.yaml`, to `~/.cache/pi-agent-ide/clangd-config`, or to a private temporary directory when that is not writable. User config takes precedence over a project's `.clangd`, so only a limit in the user's own config still applies. clangd reads this config on Linux and other non-Apple Unix systems.
194
+ - Before references, the calls of one symbol and a rename, Pi opens up to 32 workspace files whose text contains the name. It finds them with `rg` on the machine that owns the files. Their references then come from a fresh parse instead of clangd's background index, which parses whole files and lags behind edits.
195
+ - A fatal clang error in a file the answer depends on, or more files than the limit, marks `lsp_search` and the calls view incomplete and names the files. An LSP rename in that case changes nothing and says why.
196
+ - The calls of a whole file check only files that are already open.
147
197
 
148
198
  ## Narrowing a result
149
199
 
@@ -166,19 +216,35 @@ They share the same Resource and anchor contracts. A mutation can resolve one or
166
216
 
167
217
  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).
168
218
 
169
- To save an image a Read returned, such as a terminal screenshot or image file, pass that Read result as Write `content`: the image value itself in Codemode, or the result's UUID or `RESULT#` reference in a direct call. Write saves the exact image bytes, and the file extension must match the image type (`.png`, `.jpg`/`.jpeg`, `.webp`, `.gif`). Several frames become numbered files: `<name>-01.png`, `<name>-02.png`… beside the path, or `frame-01.png`… inside a folder path. Any other text, including a UUID of a result without images, is not image content: plain text is written as before, and an image-less result reference is refused.
219
+ Write `content` is a plain string and is saved exactly as given, including JSON text such as `{"a": 1.0}`. Images use a separate parameter. To save an image a Read returned, such as a terminal screenshot or image file, pass that Read result as Write `image` instead of `content`: the image value itself in Codemode, or the result's UUID or `RESULT#` reference in a direct call. Write saves the exact image bytes, and the file extension must match the image type (`.png`, `.jpg`/`.jpeg`, `.webp`, `.gif`). Several frames become numbered files: `<name>-01.png`, `<name>-02.png`… beside the path, or `frame-01.png`… inside a folder path. A call takes exactly one of `content` and `image`. Text in `content` is never treated as an image, even when it is an image result's UUID; `image` refuses anything other than an image result, including the reference of a result without images. Images are written to local files only.
220
+
221
+ Whole-file text Write refuses to replace a file if it changed since the current Pi process last read or wrote it. Read the whole current file and rebuild the replacement, or use a targeted edit. A partial Read can establish the first observation, but does not clear a conflict. For large files, Read inside Codemode to get the full text. Creating a new file does not require a prior Read.
170
222
 
171
- For selected-text work, a path identifies the source and anchors identify the span. Pass an unchanged Read, Search 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 at the selected range's start or end. Whole-line selections add needed line breaks; exact selections insert at their character boundaries. A directory listing or read-only view does not grant text-edit authority.
223
+ For selected-text work, a path identifies the source and anchors identify the span. Pass an unchanged Read, Search 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 at the selected range's start or end. A directory listing or read-only view does not grant text-edit authority.
172
224
 
173
- Narrow a result with Search rather than reconstructing boundaries 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.
225
+ Selectors only locate the span. A span covers whole lines if it starts at a line start (after any BOM) and ends before or after the last line's ending. `delete` and empty `replace` remove whole lines with their separators; nonempty `replace` keeps the last selected line's ending, including none at EOF. At a line edge, use text containing a line break to insert separate lines, or `separation: "blank-line"` to separate a paragraph. The first break at each edge of an inserted text block is a separator; additional breaks add empty lines and count toward `blank-line` separation. Text made only of breaks inserts one empty line per break. Single-line text with default separation and mid-line insertions go at the selected boundary. Copy and Move land whole lines separately at line edges or over whole-line targets; partial targets use the copied content as characters. [Editing principles](https://github.com/alexshpunt/pi-agent-ide/blob/main/src/extensions/pi-agent-text-editor/docs/editing-principles.md) give the byte rules for BOMs, line endings and look-alike characters.
174
226
 
175
- Use `start` alone for an exact fragment or one line selection. Paired `start`/`end` and `targetStart`/`targetEnd` preserve each endpoint's extent: exact text and `SEARCH :match` keep character boundaries, while line anchors and `SEARCH :line` keep whole-line boundaries. A pair runs from the beginning of its first endpoint through the end of its last endpoint, including the ending match. Mixed types retain their independent extents. Snapshot-backed selectors reject changed files; missing or ambiguous exact text is rejected rather than guessed.
227
+ A result passed together with selectors limits them to its ranges: they resolve in the result's file, exact text needs to be unique only inside those ranges, and a selector outside them, or a pair in two different ranges, fails and names the result's selection, such as `task.txt line 2`. With a result of several files, the edit goes to the one file whose selection holds the selector. Selector parameters also take a value with an id, such as a Search match in Codemode, as source parameters do.
228
+
229
+ Narrow a result with Search rather than reconstructing boundaries from previews.
230
+
231
+ For Replace, Delete, Copy and Move, use `at` or `from` alone for one source selection, or omit source selectors when `path` is an issued selection. For a range, pass one opening selector (`from` includes its match; `after` excludes it) and one closing selector (`through` includes its match; `before` excludes it). The closing selector must match once among the matches from the opening match on: several matches are refused, with each candidate's line number and line anchor and one ready call, and nothing changes. With `from` and `through`, the closing match can start inside the opening match. The range includes both matches in full. Use `through` for a block's own closing line. When a block has no closing line and ends at the next block's start, use `before` with that opening line, such as the next heading. Do not combine `at` with boundaries. Snapshot-backed selectors reject changed files; the tools refuse missing or ambiguous exact text.
232
+
233
+ Copy and Move use the same words for their destinations: `targetAt` or `targetFrom` alone replaces one span; `targetFrom` or `targetAfter` with `targetThrough` or `targetBefore` replaces a range. Pass only `targetAfter` or only `targetBefore` to insert next to a match. Omit destination selectors when an issued `target` already selects the span to replace. Source and destination selections can be paired when their counts match. Text selectors do not apply to whole-object transfers.
234
+
235
+ For text Insert, pass either `after` or `before` with the match next to the insertion. Set neither when `path` already selects the text and the insertion should follow it.
176
236
 
177
237
  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.
178
238
 
179
- Several Pi processes on one machine can edit the same file. Their reads and writes of a file run one at a time, and a write replaces the file in one step, so neither Pi nor other programs such as ripgrep or a language server read a half-written file, and a write never replaces text that changed after its edit read the file. Such an edit runs again on the current text: exact text and `symbol:` selectors resolve again, while snapshot-backed selectors such as line anchors are rejected because the lines they named changed. When another process rewrites the file before a Codemode batch's final post-processing, the batch's edits stay saved, post-processing of the newer text is skipped, and the result says so. When a language server answered for an older version of the file, `symbol:` selectors and `lsp_search` results move with their unchanged lines; a declaration whose own lines changed is resolved again, and one the server cannot answer for because the file keeps changing fails with a clear message. `ast_search` parses the same bytes it reports on. An empty list of incoming calls notes that the server's index can miss callers added in the last seconds.
239
+ In native Codemode, Search selections for one local file share the pending snapshot batch with content-anchor edits. Pass the Search value, a match or its ID, or an issued `SEARCH#` selector; an owned selector can supply an omitted source or target path. Remote/provider sources, multi-file Search selections and pending-edit result references still end the batch. A vanished Search match fails only its own edit at commit; inspect the script's final effects to see which peers were saved.
240
+
241
+ In Codemode, `replace`, `insert`, `write`, `copy`, `move` and `undo` resolve to the `RESULT#<uuid>` id of the text they produced when the selection is verified; a whole-file Copy, Move or Undo of a text file selects the whole new file. Pass it to the next tool's source parameter: `tools.search({ path: await tools.replace(…), query })`. An id of an edit still pending in the script's batch works too; that call commits the batch first. An edit whose targets already have the text writes nothing and still resolves to the id of that text. An edit that selects no text, such as a directory or binary copy, terminal input or an image Write, resolves to `null`; filesystem and text `delete` resolves to `null`; a provider action keeps its value or receipt. A successful edit also resolves to `null` when its output selection cannot be verified, for example if another process changes the file before publication. Check the Codemode result's failure block to distinguish failed calls, and read the file before further edits when there is no verified selection. A resource provider's semantic action, such as a computer-use action, resolves to the value the provider returns. The Codemode result reports the text changes of the script's edits and lists every failed edit in its failure block.
242
+
243
+ Several Pi processes on one machine can edit the same file. Their reads and writes of a file run one at a time, and a write replaces the file in one step, so neither Pi nor other programs such as ripgrep or a language server read a half-written file, and a write never replaces text that changed after its edit read the file. Such an edit runs again on the current text: exact text, line anchors, AST scope markers and complete `SEARCH#…:all` forms resolve again, and `RESULT#…` and numbered `SEARCH#…` references, also those of `move` and `copy`, move to their new positions or fail with their current lines when their own text changed, in every source, destination and selector field and in the check before a direct call alike, always in the text the edit reads; a line anchor fails when its own line changed, the anchor of a repeated line also when the lines between it and the nearest unique line of its own block changed or a copy of its text appeared or went away before the nearest unique line on the other side, and the anchor of a blank line also when a neighbouring block moved. An ordinary edit tries at most 8 times and starts no new attempt more than 10 seconds after its first attempt found newer text, so the first attempt can take longer and still be retried; then it fails without writing and says that another process kept writing the file. The edits a native Codemode script has accepted also run again on the current text. A call whose anchor no longer resolves fails alone, the others are saved, and the script result names the failed call. When another process rewrites the file before a Codemode batch's final post-processing, the batch's edits stay saved, post-processing of the newer text is skipped, and the result says so. When a language server answered for an older version of the file, `lsp_search` results move with their unchanged lines; a declaration whose own lines changed is resolved again, and one the server cannot answer for because the file keeps changing fails with a clear message. An `lsp_search` whose file another process writes while the server answers runs again on the current text. References are asked for at the position the declaration has in the text the server holds, so a reference list stays complete while another process keeps writing the file. `ast_search` parses the same bytes it reports on. A `search` registers its anchors from the text it read itself, so a file another process writes in between keeps the anchors of the matches that text holds and the whole result stays usable as an edit source; a matched file that can no longer be read is left out with a notice naming the reason, and a search left with nothing to register fails with that reason instead of showing matches it cannot anchor. An empty list of incoming calls notes that the server's index can miss callers added in the last seconds.
244
+
245
+ When a rename through a declaration's name capture detects newer text, `replace` retries within the same call. Recovery allows up to nine retries in one 12-second window and cancels any refresh still planning after four seconds. Initial server startup for a fresh selection is outside that window. A C-family rename can carry identifier edits across changes to blank lines and simple comments. It can also follow indentation changes when the source has no signs of preprocessing. Changes that can affect symbol lookup or introduce references require a fresh server plan. If recovery runs out of attempts or time, no files change and `replace` reports how long the call ran. Repeat `replace` with the same capture and new name to start a new recovery window. If the capture no longer identifies the declaration, run `lsp_search` again.
180
246
 
181
- 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.
247
+ 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) for reference lifetime and recovery.
182
248
 
183
249
  An omitted path can reuse the last resolved source when it is unambiguous. Supply the path when several resources could be meant.
184
250
 
@@ -189,8 +255,8 @@ Anchors are opaque references owned by registered resolvers. The editor does not
189
255
  Common built-in forms include:
190
256
 
191
257
  ```text
192
- 12#A4F0 a line from a specific snapshot
193
- scope-begin-7C21 a structural boundary
258
+ K7M2QX4 a line, named by its content
259
+ scope-begin-K7M2QX4 a structural boundary
194
260
  SEARCH#19AF:3:line one result's full line
195
261
  SEARCH#19AF:3:match one exact match
196
262
  SEARCH#19AF:all:line each unique containing line
@@ -67,7 +67,7 @@ export default function (pi: ExtensionAPI) {
67
67
 
68
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
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 host permission. External directories and symlinks and targets without a Git worktree also require permission unless they are eligible [temporary directories](./configuration.md#temporary-directory-deletion), including the temporary root itself. SSH temporary roots and settings come from that target's account and project. Failed Git checks inside the current project still require permission. Untracked directories and symlinks inside that worktree need no dialog. Ordinary files keep their existing policy.
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. Directories and symlinks that are tracked or contain tracked or newly staged entries require host permission. External directories and symlinks and targets without a Git worktree also require permission unless they are eligible [temporary directories](./configuration.md#temporary-directory-deletion), including the temporary root itself. SSH temporary roots and settings come from that target's account and project. Failed Git checks inside the current project still require permission. Untracked directories and symlinks inside that worktree need no dialog. Deleting a regular file needs no dialog, even when Git tracks it; hooks and protected paths still apply to it.
71
71
 
72
72
  The shared dialog names the exact target, reason, and operation. User-configured YOLO or a matching session grant can supply permission without a dialog; see [Operation confirmations and YOLO](configuration.md#operation-confirmations-and-yolo). Otherwise 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 or YOLO allows. Git control protection also covers regular-file `.git` markers. Without Git, cwd and its ancestors are protected.
73
73
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-doctor",
3
- "version": "0.9.7",
3
+ "version": "1.0.0",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
@@ -56,6 +56,8 @@ export interface ToolRecipe {
56
56
  readonly output: "in-place" | "stdout";
57
57
  };
58
58
  readonly linter?: {
59
+ /** False requires an explicit enabled override before automatic lint selection. */
60
+ readonly enabled?: boolean;
59
61
  readonly extensions: readonly string[];
60
62
 
61
63
  /** Exact basenames accepted in addition to the file extensions. */
@@ -65,7 +65,7 @@ export async function isExecutableAvailable(
65
65
  ]
66
66
  : [];
67
67
  const candidates = locations.flatMap((location) => [
68
- location,
68
+ ...(process.platform !== "win32" || path.extname(location) ? [location] : []),
69
69
  ...suffixes.map((suffix) => `${location}${suffix}`),
70
70
  ]);
71
71
  for (const candidate of candidates) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-documentation",
3
- "version": "0.9.7",
3
+ "version": "1.0.0",
4
4
  "type": "module",
5
5
  "types": "./src/index.ts",
6
6
  "exports": {
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "pi-agent-filesystem",
3
- "version": "0.9.7",
3
+ "version": "1.0.0",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
7
7
  },
8
8
  "dependencies": {
9
- "pi-agent-image": "0.9.7",
10
- "pi-agent-invariant": "0.9.7",
11
- "pi-agent-read": "0.9.7",
12
- "pi-agent-resource": "0.9.7",
13
- "pi-agent-text": "0.9.7",
14
- "pi-agent-text-editor": "0.9.7"
9
+ "pi-agent-image": "1.0.0",
10
+ "pi-agent-invariant": "1.0.0",
11
+ "pi-agent-read": "1.0.0",
12
+ "pi-agent-resource": "1.0.0",
13
+ "pi-agent-text": "1.0.0",
14
+ "pi-agent-text-editor": "1.0.0"
15
15
  },
16
16
  "pi": {
17
17
  "extensions": [
@@ -2,10 +2,10 @@ import { createHash } from "node:crypto";
2
2
  import { mkdir, rm, stat } from "node:fs/promises";
3
3
  import os from "node:os";
4
4
  import path from "node:path";
5
+ import { EDIT_WAIT_TIMEOUT_MS } from "pi-agent-resource";
5
6
 
6
7
  /** A lock older than this belongs to a process that died while holding it. */
7
8
  const STALE_LOCK_MS = 10_000;
8
- const WAIT_TIMEOUT_MS = 30_000;
9
9
 
10
10
  /**
11
11
  * Runs `action` while no other Pi process on this machine reads or writes the same file through
@@ -46,9 +46,13 @@ async function acquire(
46
46
  } catch {
47
47
  return false;
48
48
  }
49
- const started = Date.now();
49
+ const deadline = performance.now() + EDIT_WAIT_TIMEOUT_MS;
50
50
  for (;;) {
51
51
  signal?.throwIfAborted();
52
+ if (performance.now() >= deadline)
53
+ throw Object.assign(new Error(`Timed out waiting for the write lock on ${filePath}`), {
54
+ code: "LOCK_TIMEOUT",
55
+ });
52
56
  try {
53
57
  await mkdir(lock);
54
58
  return true;
@@ -63,8 +67,6 @@ async function acquire(
63
67
  await rm(lock, { recursive: true, force: true });
64
68
  continue;
65
69
  }
66
- if (Date.now() - started > WAIT_TIMEOUT_MS)
67
- throw new Error(`Timed out waiting for another Pi process to finish with ${filePath}`);
68
70
  await new Promise((resolve) => setTimeout(resolve, 5 + Math.random() * 20));
69
71
  }
70
72
  }
@@ -1,5 +1,5 @@
1
1
  import { randomBytes } from "node:crypto";
2
- import { realpath, rename, rm, stat, writeFile } from "node:fs/promises";
2
+ import { chmod, realpath, rename, rm, stat, writeFile } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
 
5
5
  /**
@@ -29,11 +29,14 @@ export async function replaceFileContent(
29
29
  `.${path.basename(target)}.${randomBytes(6).toString("hex")}.pi-tmp`,
30
30
  );
31
31
  try {
32
+ const mode = existing.mode & 0o7777;
32
33
  await writeFile(temporary, bytes, {
33
- mode: existing.mode & 0o7777,
34
+ mode,
34
35
  flag: "wx",
35
36
  ...(signal !== undefined && { signal }),
36
37
  });
38
+ // The process umask narrows the mode a file is created with; the replacement keeps the original.
39
+ await chmod(temporary, mode);
37
40
  await rename(temporary, target);
38
41
  } catch (error) {
39
42
  await rm(temporary, { force: true });
@@ -70,21 +70,32 @@ function resolveFilesystemSource(
70
70
  return false;
71
71
  }
72
72
  })();
73
- let sourceBytes: Uint8Array | undefined;
73
+ // undefined is unread; null is an observed absence.
74
+ let sourceBytes: Uint8Array | null | undefined;
75
+ let entries: readonly string[] | undefined;
74
76
  const read = async ({ signal }: { readonly signal?: AbortSignal }) => {
75
77
  sourceBytes = undefined;
76
- return isDirectory
77
- ? readDirectoryContent(filePath, signal)
78
- : readFilesystemContent(filePath, contentHost, signal, (bytes) => {
79
- sourceBytes = bytes;
80
- });
78
+ entries = undefined;
79
+ if (isDirectory)
80
+ return readDirectoryContent(filePath, signal, (names) => {
81
+ entries = names;
82
+ });
83
+ return readFilesystemContent(filePath, contentHost, signal, (bytes) => {
84
+ sourceBytes = bytes;
85
+ }).catch((error: unknown) => {
86
+ if ((error as NodeJS.ErrnoException).code === "ENOENT") sourceBytes = null;
87
+ throw error;
88
+ });
81
89
  };
82
90
  const resource = {
83
91
  source: filePath,
84
92
  link,
85
93
  read,
86
94
  get sourceBytes() {
87
- return sourceBytes;
95
+ return sourceBytes ?? undefined;
96
+ },
97
+ get entries() {
98
+ return entries;
88
99
  },
89
100
  };
90
101
 
@@ -97,7 +108,7 @@ function resolveFilesystemSource(
97
108
  resource: {
98
109
  ...resource,
99
110
  get sourceBytes() {
100
- return sourceBytes;
111
+ return sourceBytes ?? undefined;
101
112
  },
102
113
  async write(content, operationContext) {
103
114
  throwIfAborted(operationContext.signal);
@@ -113,7 +124,7 @@ function resolveFilesystemSource(
113
124
  if ((error as NodeJS.ErrnoException).code === "ENOENT") return undefined;
114
125
  throw error;
115
126
  });
116
- if (current === undefined || !current.equals(expected))
127
+ if (expected === null ? current !== undefined : !current?.equals(expected))
117
128
  throw new ResourceError("RESOURCE_CHANGED", filePath, "not-applied");
118
129
  }
119
130
  const bytes = Buffer.from(text, "utf8");
@@ -125,7 +136,11 @@ function resolveFilesystemSource(
125
136
  };
126
137
  }
127
138
 
128
- function readDirectoryContent(filePath: string, signal: AbortSignal | undefined) {
139
+ function readDirectoryContent(
140
+ filePath: string,
141
+ signal: AbortSignal | undefined,
142
+ capture: (entries: readonly string[]) => void,
143
+ ) {
129
144
  throwIfAborted(signal);
130
145
 
131
146
  const entries = readdirSync(filePath, { withFileTypes: true });
@@ -140,6 +155,7 @@ function readDirectoryContent(filePath: string, signal: AbortSignal | undefined)
140
155
  lines.push(` ${icon} ${entry.name}`);
141
156
  }
142
157
 
158
+ capture(entries.map((entry) => (entry.isDirectory() ? `${entry.name}/` : entry.name)));
143
159
  return [{ type: "text" as const, text: lines.join("\n") }] as const;
144
160
  }
145
161
 
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "pi-agent-filesystem-image",
3
- "version": "0.9.7",
3
+ "version": "1.0.0",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#extension": "./index.ts"
7
7
  },
8
8
  "dependencies": {
9
- "pi-agent-image": "0.9.7",
10
- "pi-agent-resource": "0.9.7"
9
+ "pi-agent-image": "1.0.0",
10
+ "pi-agent-resource": "1.0.0"
11
11
  },
12
12
  "pi": {
13
13
  "extensions": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-filesystem-jq",
3
- "version": "0.9.7",
3
+ "version": "1.0.0",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
@@ -12,10 +12,10 @@
12
12
  }
13
13
  },
14
14
  "dependencies": {
15
- "pi-agent-doctor": "0.9.7",
16
- "pi-agent-documentation": "0.9.7",
17
- "pi-agent-read": "0.9.7",
18
- "pi-agent-text": "0.9.7"
15
+ "pi-agent-doctor": "1.0.0",
16
+ "pi-agent-documentation": "1.0.0",
17
+ "pi-agent-read": "1.0.0",
18
+ "pi-agent-text": "1.0.0"
19
19
  },
20
20
  "pi": {
21
21
  "extensions": [
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "pi-agent-filesystem-pdf",
3
- "version": "0.9.7",
3
+ "version": "1.0.0",
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "pi-agent-pdf": "0.9.7",
7
- "pi-agent-resource": "0.9.7"
6
+ "pi-agent-pdf": "1.0.0",
7
+ "pi-agent-resource": "1.0.0"
8
8
  },
9
9
  "pi": {
10
10
  "extensions": [