pi-agent-ide 0.6.4 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (431) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +2 -2
  3. package/dist/{chunk-AWXVJ5AC.js → chunk-2RTCSZB3.js} +1 -1
  4. package/dist/chunk-2TRHFMCZ.js +11 -0
  5. package/dist/{chunk-WJTHY6AG.js → chunk-4GCWGE2C.js} +1 -1
  6. package/dist/chunk-4XMY4H4V.js +1 -0
  7. package/dist/{chunk-BSICWXMH.js → chunk-64M3SQPG.js} +1 -1
  8. package/dist/{chunk-QEJGED4V.js → chunk-76ZK5ODR.js} +2 -2
  9. package/dist/{chunk-3BBJZSMS.js → chunk-7LD2OQH3.js} +1 -1
  10. package/dist/{chunk-6CZO43OH.js → chunk-BU7IZLKB.js} +1 -1
  11. package/dist/chunk-CWD4O5PM.js +3 -0
  12. package/dist/chunk-D3WTDA6V.js +2 -0
  13. package/dist/chunk-EAZGN5ND.js +7 -0
  14. package/dist/chunk-GXEGY7GV.js +1 -0
  15. package/dist/chunk-HZEY4GT4.js +2 -0
  16. package/dist/chunk-LEEQIQ7D.js +28 -0
  17. package/dist/chunk-NRZO5KJT.js +9 -0
  18. package/dist/chunk-OMVRLWMX.js +5 -0
  19. package/dist/{chunk-VBICI5YA.js → chunk-PGIVHICI.js} +1 -1
  20. package/dist/{chunk-FBOW7XOV.js → chunk-PKKDDIWW.js} +1 -1
  21. package/dist/chunk-PNU3E7IO.js +3 -0
  22. package/dist/chunk-PS2B6THP.js +3 -0
  23. package/dist/{chunk-FUG2TEKI.js → chunk-QFTBY67N.js} +2 -2
  24. package/dist/{chunk-EDURPQAV.js → chunk-QRJLIV6P.js} +6 -6
  25. package/dist/{chunk-OBNING2A.js → chunk-S5PL5DFQ.js} +1 -1
  26. package/dist/chunk-VMTR74FF.js +2 -0
  27. package/dist/{chunk-HPUAIWIH.js → chunk-WMO6RNE2.js} +1 -1
  28. package/dist/chunk-WU6ZK6YD.js +1 -0
  29. package/dist/{chunk-GIRAEVUJ.js → chunk-XH5WN5XA.js} +1 -1
  30. package/dist/chunk-XYS4FSCC.js +12 -0
  31. package/dist/chunk-YP46DVVP.js +2 -0
  32. package/dist/entry-11.js +1 -1
  33. package/dist/entry-13.js +1 -1
  34. package/dist/entry-14.js +1 -1
  35. package/dist/entry-15.js +1 -1
  36. package/dist/entry-17.js +1 -1
  37. package/dist/entry-25.js +2 -2
  38. package/dist/entry-26.js +1 -1
  39. package/dist/entry-27.js +2 -2
  40. package/dist/entry-28.js +1 -1
  41. package/dist/entry-29.js +1 -1
  42. package/dist/entry-30.js +1 -1
  43. package/dist/entry-31.js +12 -9
  44. package/dist/entry-33.js +1 -1
  45. package/dist/entry-37.js +6 -6
  46. package/dist/entry-41.js +1 -1
  47. package/dist/entry-42.js +1 -1
  48. package/dist/entry-43.js +1 -1
  49. package/dist/entry-44.js +1 -1
  50. package/dist/entry-45.js +13 -14
  51. package/dist/entry-46.js +1 -1
  52. package/dist/entry-49.js +1 -1
  53. package/dist/entry-50.js +3 -6
  54. package/dist/entry-51.js +11 -9
  55. package/dist/entry-52.js +1 -1
  56. package/dist/entry-53.js +1 -1
  57. package/dist/entry-54.js +1 -1
  58. package/dist/entry-56.js +1 -1
  59. package/dist/entry-57.js +1 -1
  60. package/dist/entry-58.js +1 -1
  61. package/dist/entry-60.js +1 -1
  62. package/dist/entry-61.js +0 -1
  63. package/dist/entry-62.js +1 -0
  64. package/dist/entry-63.js +0 -1
  65. package/dist/entry-64.js +1 -0
  66. package/dist/entry-65.js +1 -1
  67. package/dist/entry-66.js +1 -1
  68. package/dist/entry-67.js +1 -1
  69. package/dist/entry-68.js +1 -1
  70. package/dist/entry-69.js +1 -1
  71. package/dist/entry-70.js +1 -1
  72. package/dist/entry-71.js +0 -1
  73. package/dist/entry-72.js +1 -0
  74. package/dist/entry-73.js +0 -1
  75. package/dist/entry-74.js +1 -0
  76. package/dist/entry-75.js +1 -1
  77. package/dist/entry-76.js +1 -1
  78. package/dist/entry-77.js +66 -1
  79. package/dist/entry-78.js +14 -325
  80. package/dist/entry-79.js +2 -18
  81. package/dist/entry-80.js +1 -2
  82. package/dist/entry-81.js +1 -1
  83. package/dist/entry-82.js +5 -1
  84. package/dist/entry-83.js +3 -5
  85. package/dist/entry-84.js +1 -3
  86. package/dist/entry-85.js +1 -1
  87. package/dist/entry-86.js +1 -1
  88. package/dist/pi-agent-ide.js +14 -9
  89. package/docs/agent-guides/editing.md +38 -33
  90. package/docs/agent-guides/git-changes.md +1 -1
  91. package/docs/agent-guides/read-resources.md +8 -4
  92. package/docs/agent-guides/search-code.md +34 -2
  93. package/docs/agent-guides/select-code.md +115 -0
  94. package/docs/configuration.md +12 -17
  95. package/docs/development.md +2 -1
  96. package/docs/releases.md +1 -1
  97. package/docs/research/apply-native-capability-matrix.md +174 -0
  98. package/docs/research/apply-read-latency.md +2 -0
  99. package/docs/research/lpt-393-fuzzy-results/file.json +152 -0
  100. package/docs/research/lpt-393-fuzzy-results/repo.json +122 -0
  101. package/docs/research/lpt-393-search-fuzzy-fallback.md +97 -0
  102. package/docs/research/native-codemode-batch-decision.md +2 -0
  103. package/docs/research/native-codemode-batching.md +1 -1
  104. package/docs/structured-results.md +30 -38
  105. package/docs/tools.md +11 -11
  106. package/docs/user-hooks.md +1 -1
  107. package/node_modules/pi-agent-doctor/package.json +1 -1
  108. package/node_modules/pi-agent-documentation/package.json +1 -1
  109. package/node_modules/pi-agent-filesystem/index.ts +7 -6
  110. package/node_modules/pi-agent-filesystem/package.json +7 -7
  111. package/node_modules/pi-agent-filesystem-image/package.json +3 -3
  112. package/node_modules/pi-agent-filesystem-jq/index.ts +4 -3
  113. package/node_modules/pi-agent-filesystem-jq/package.json +5 -5
  114. package/node_modules/pi-agent-filesystem-pdf/package.json +3 -3
  115. package/node_modules/pi-agent-filesystem-text/package.json +3 -3
  116. package/node_modules/pi-agent-ide-ast/package.json +15 -10
  117. package/node_modules/pi-agent-ide-ast/src/ast/constructs.ts +193 -0
  118. package/node_modules/pi-agent-ide-ast/src/ast/element-extent.ts +59 -0
  119. package/node_modules/pi-agent-ide-ast/src/ast/manager.ts +5 -1
  120. package/node_modules/pi-agent-ide-ast/src/ast/selection.ts +204 -0
  121. package/node_modules/pi-agent-ide-ast/src/ast/syntax-tree.ts +2 -0
  122. package/node_modules/pi-agent-ide-ast/src/extension.ts +10 -5
  123. package/node_modules/pi-agent-ide-ast/src/geometry-selection.ts +184 -0
  124. package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +142 -27
  125. package/node_modules/pi-agent-ide-ast/src/select-presentation.ts +104 -0
  126. package/node_modules/pi-agent-ide-ast/src/select-schema.ts +384 -0
  127. package/node_modules/pi-agent-ide-ast/src/selection-region.ts +41 -0
  128. package/node_modules/pi-agent-ide-ast/src/source-text.ts +92 -0
  129. package/node_modules/pi-agent-ide-ast/src/text-selection.ts +214 -0
  130. package/node_modules/pi-agent-ide-ast/src/tool-select.ts +268 -0
  131. package/node_modules/pi-agent-ide-changes/index.ts +6 -21
  132. package/node_modules/pi-agent-ide-changes/package.json +8 -8
  133. package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +2 -2
  134. package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +11 -40
  135. package/node_modules/pi-agent-ide-formatter/package.json +3 -3
  136. package/node_modules/pi-agent-ide-languages/package.json +2 -2
  137. package/node_modules/pi-agent-ide-lint/package.json +7 -7
  138. package/node_modules/pi-agent-ide-lsp/index.ts +5 -5
  139. package/node_modules/pi-agent-ide-lsp/package.json +9 -9
  140. package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +5 -0
  141. package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +8 -2
  142. package/node_modules/pi-agent-ide-lsp/src/lsp/project.ts +19 -0
  143. package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +204 -118
  144. package/node_modules/pi-agent-ide-lsp/src/rename-plan.ts +2 -17
  145. package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +92 -45
  146. package/node_modules/pi-agent-image/package.json +2 -2
  147. package/node_modules/pi-agent-invariant/package.json +1 -1
  148. package/node_modules/pi-agent-pdf/package.json +2 -2
  149. package/node_modules/pi-agent-read/package.json +7 -7
  150. package/node_modules/pi-agent-read/src/api/plugin-protocol.ts +1 -1
  151. package/node_modules/pi-agent-read/src/api/read-parameters.ts +40 -3
  152. package/node_modules/pi-agent-read/src/api/tools/read.ts +11 -1
  153. package/node_modules/pi-agent-read/src/core/extension.ts +18 -1
  154. package/node_modules/pi-agent-read/src/core/read-core.ts +50 -35
  155. package/node_modules/pi-agent-read/src/core/tools/read/result-target.ts +93 -0
  156. package/node_modules/pi-agent-read/src/core/tools/read/structured-result.ts +5 -3
  157. package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +17 -3
  158. package/node_modules/pi-agent-resource/package.json +1 -1
  159. package/node_modules/pi-agent-resource/src/index.ts +10 -0
  160. package/node_modules/pi-agent-resource/src/result-targets.ts +407 -0
  161. package/node_modules/pi-agent-resource/src/tool-result.ts +13 -1
  162. package/node_modules/pi-agent-search/package.json +5 -5
  163. package/node_modules/pi-agent-search/src/api/fuzzy.ts +208 -0
  164. package/node_modules/pi-agent-search/src/api/presentation.ts +68 -0
  165. package/node_modules/pi-agent-search/src/api/search-parameters.ts +9 -3
  166. package/node_modules/pi-agent-search/src/api/search-scope.ts +22 -0
  167. package/node_modules/pi-agent-search/src/api/search.ts +28 -0
  168. package/node_modules/pi-agent-search/src/api/structured-result.ts +69 -14
  169. package/node_modules/pi-agent-search/src/core/extension.ts +56 -16
  170. package/node_modules/pi-agent-search/src/core/search-core.ts +9 -1
  171. package/node_modules/pi-agent-search-text/index.ts +3 -1
  172. package/node_modules/pi-agent-search-text/package.json +7 -6
  173. package/node_modules/pi-agent-search-text/src/fuzzy-search.ts +164 -0
  174. package/node_modules/pi-agent-search-text/src/resolvers.ts +161 -30
  175. package/node_modules/pi-agent-search-text/src/scoped-search.ts +103 -0
  176. package/node_modules/pi-agent-search-text/src/search-backend.ts +104 -17
  177. package/node_modules/pi-agent-search-text/src/search-renderer.ts +89 -292
  178. package/node_modules/pi-agent-search-text/src/search-result.ts +77 -0
  179. package/node_modules/pi-agent-search-text/src/search-session.ts +96 -11
  180. package/node_modules/pi-agent-text/package.json +2 -2
  181. package/node_modules/pi-agent-text-anchor-constant/package.json +3 -3
  182. package/node_modules/pi-agent-text-anchor-exact/index.ts +65 -4
  183. package/node_modules/pi-agent-text-anchor-exact/package.json +3 -3
  184. package/node_modules/pi-agent-text-anchor-exact/src/anchor.ts +12 -2
  185. package/node_modules/pi-agent-text-anchor-line-hash/index.ts +4 -3
  186. package/node_modules/pi-agent-text-anchor-line-hash/package.json +5 -5
  187. package/node_modules/pi-agent-text-editor/index.ts +0 -5
  188. package/node_modules/pi-agent-text-editor/package.json +26 -31
  189. package/node_modules/pi-agent-text-editor/runtime/entry-77.js +1 -0
  190. package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +3 -1
  191. package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +3 -1
  192. package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +1 -20
  193. package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +4 -23
  194. package/node_modules/pi-agent-text-editor/src/core/editing-guidelines.ts +2 -2
  195. package/node_modules/pi-agent-text-editor/src/core/extension.ts +22 -5
  196. package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +29 -4
  197. package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +4 -14
  198. package/node_modules/pi-agent-text-editor/src/core/file-result-targets.ts +76 -0
  199. package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +1 -1
  200. package/node_modules/pi-agent-text-editor/src/core/mutation-result-targets.ts +168 -0
  201. package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +217 -30
  202. package/node_modules/pi-agent-text-editor/src/core/result-input.ts +22 -0
  203. package/node_modules/pi-agent-text-editor/src/core/result-target-anchors.ts +78 -0
  204. package/node_modules/pi-agent-text-editor/src/core/result-transfer.ts +175 -0
  205. package/node_modules/pi-agent-text-editor/src/core/structured-result.ts +86 -154
  206. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +6 -1
  207. package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +0 -75
  208. package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +238 -244
  209. package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +1 -1
  210. package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +9 -11
  211. package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +5 -5
  212. package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +5 -5
  213. package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +9 -7
  214. package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +8 -8
  215. package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +8 -3
  216. package/node_modules/pi-agent-text-editor-renderer/index.ts +1 -72
  217. package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
  218. package/node_modules/pi-agent-text-editor-renderer/src/diff-model.ts +19 -5
  219. package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +19 -45
  220. package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
  221. package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
  222. package/node_modules/pi-agent-tool-call-interception/runtime/entry-80.js +1 -0
  223. package/node_modules/pi-agent-tool-call-interception/src/index.ts +3 -0
  224. package/node_modules/pi-agent-tool-ui/package.json +2 -2
  225. package/node_modules/pi-agent-tool-ui/src/index.ts +7 -0
  226. package/node_modules/pi-agent-tool-ui/src/result-panel.ts +298 -0
  227. package/node_modules/pi-agent-web/index.ts +7 -3
  228. package/node_modules/pi-agent-web/package.json +8 -8
  229. package/node_modules/pi-agent-web/runtime/entry-82.js +2 -0
  230. package/node_modules/pi-agent-web/src/search.ts +111 -2
  231. package/node_modules/pi-agent-web-html/package.json +3 -3
  232. package/node_modules/pi-agent-web-image/package.json +4 -4
  233. package/node_modules/pi-agent-web-pdf/package.json +4 -4
  234. package/node_modules/pi-agent-web-text/package.json +4 -4
  235. package/package.json +35 -36
  236. package/src/composite/module-labels.ts +1 -1
  237. package/src/composite/preferences.ts +0 -5
  238. package/src/composite/text-results.ts +221 -0
  239. package/src/documentation/extension.ts +11 -9
  240. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +7 -6
  241. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
  242. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +3 -3
  243. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/index.ts +4 -3
  244. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +5 -5
  245. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +3 -3
  246. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +3 -3
  247. package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +7 -3
  248. package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -8
  249. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -3
  250. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-83.js +2 -0
  251. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
  252. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
  253. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
  254. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-82.js +2 -0
  255. package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/search.ts +111 -2
  256. package/src/extensions/pi-agent-read/package.json +7 -7
  257. package/src/extensions/pi-agent-read/src/api/plugin-protocol.ts +1 -1
  258. package/src/extensions/pi-agent-read/src/api/read-parameters.ts +40 -3
  259. package/src/extensions/pi-agent-read/src/api/tools/read.ts +11 -1
  260. package/src/extensions/pi-agent-read/src/core/extension.ts +18 -1
  261. package/src/extensions/pi-agent-read/src/core/read-core.ts +50 -35
  262. package/src/extensions/pi-agent-read/src/core/tools/read/result-target.ts +93 -0
  263. package/src/extensions/pi-agent-read/src/core/tools/read/structured-result.ts +5 -3
  264. package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +17 -3
  265. package/src/extensions/pi-agent-search/package.json +5 -5
  266. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +3 -1
  267. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +7 -6
  268. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/fuzzy-search.ts +164 -0
  269. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +161 -30
  270. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/scoped-search.ts +103 -0
  271. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +104 -17
  272. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +89 -292
  273. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +77 -0
  274. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +96 -11
  275. package/src/extensions/pi-agent-search/src/api/fuzzy.ts +208 -0
  276. package/src/extensions/pi-agent-search/src/api/presentation.ts +68 -0
  277. package/src/extensions/pi-agent-search/src/api/search-parameters.ts +9 -3
  278. package/src/extensions/pi-agent-search/src/api/search-scope.ts +22 -0
  279. package/src/extensions/pi-agent-search/src/api/search.ts +28 -0
  280. package/src/extensions/pi-agent-search/src/api/structured-result.ts +69 -14
  281. package/src/extensions/pi-agent-search/src/core/extension.ts +56 -16
  282. package/src/extensions/pi-agent-search/src/core/search-core.ts +9 -1
  283. package/src/extensions/pi-agent-text-editor/index.ts +0 -5
  284. package/src/extensions/pi-agent-text-editor/package.json +26 -31
  285. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +3 -3
  286. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.ts +65 -4
  287. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +3 -3
  288. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/anchor.ts +12 -2
  289. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +4 -3
  290. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +5 -5
  291. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +1 -72
  292. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
  293. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-78.js +2 -0
  294. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-model.ts +19 -5
  295. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +19 -45
  296. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -5
  297. package/src/extensions/pi-agent-text-editor/runtime/entry-77.js +1 -0
  298. package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +3 -1
  299. package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +3 -1
  300. package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +1 -20
  301. package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +4 -23
  302. package/src/extensions/pi-agent-text-editor/src/core/editing-guidelines.ts +2 -2
  303. package/src/extensions/pi-agent-text-editor/src/core/extension.ts +22 -5
  304. package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +29 -4
  305. package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +4 -14
  306. package/src/extensions/pi-agent-text-editor/src/core/file-result-targets.ts +76 -0
  307. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +1 -1
  308. package/src/extensions/pi-agent-text-editor/src/core/mutation-result-targets.ts +168 -0
  309. package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +217 -30
  310. package/src/extensions/pi-agent-text-editor/src/core/result-input.ts +22 -0
  311. package/src/extensions/pi-agent-text-editor/src/core/result-target-anchors.ts +78 -0
  312. package/src/extensions/pi-agent-text-editor/src/core/result-transfer.ts +175 -0
  313. package/src/extensions/pi-agent-text-editor/src/core/structured-result.ts +86 -154
  314. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +6 -1
  315. package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +0 -75
  316. package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +238 -244
  317. package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +1 -1
  318. package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +9 -11
  319. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +5 -5
  320. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +5 -5
  321. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +9 -7
  322. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +8 -8
  323. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +8 -3
  324. package/src/pi-agent-ide.ts +4 -7
  325. package/src/plugins/pi-agent-ide-ast/package.json +15 -10
  326. package/src/plugins/pi-agent-ide-ast/src/ast/constructs.ts +193 -0
  327. package/src/plugins/pi-agent-ide-ast/src/ast/element-extent.ts +59 -0
  328. package/src/plugins/pi-agent-ide-ast/src/ast/manager.ts +5 -1
  329. package/src/plugins/pi-agent-ide-ast/src/ast/selection.ts +204 -0
  330. package/src/plugins/pi-agent-ide-ast/src/ast/syntax-tree.ts +2 -0
  331. package/src/plugins/pi-agent-ide-ast/src/extension.ts +10 -5
  332. package/src/plugins/pi-agent-ide-ast/src/geometry-selection.ts +184 -0
  333. package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +142 -27
  334. package/src/plugins/pi-agent-ide-ast/src/select-presentation.ts +104 -0
  335. package/src/plugins/pi-agent-ide-ast/src/select-schema.ts +384 -0
  336. package/src/plugins/pi-agent-ide-ast/src/selection-region.ts +41 -0
  337. package/src/plugins/pi-agent-ide-ast/src/source-text.ts +92 -0
  338. package/src/plugins/pi-agent-ide-ast/src/text-selection.ts +214 -0
  339. package/src/plugins/pi-agent-ide-ast/src/tool-select.ts +268 -0
  340. package/src/plugins/pi-agent-ide-changes/index.ts +6 -21
  341. package/src/plugins/pi-agent-ide-changes/package.json +8 -8
  342. package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +2 -2
  343. package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +11 -40
  344. package/src/plugins/pi-agent-ide-debugger/index.ts +5 -3
  345. package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +5 -3
  346. package/src/plugins/pi-agent-ide-formatter/package.json +3 -3
  347. package/src/plugins/pi-agent-ide-languages/package.json +2 -2
  348. package/src/plugins/pi-agent-ide-lint/package.json +7 -7
  349. package/src/plugins/pi-agent-ide-lsp/index.ts +5 -5
  350. package/src/plugins/pi-agent-ide-lsp/package.json +9 -9
  351. package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +5 -0
  352. package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +8 -2
  353. package/src/plugins/pi-agent-ide-lsp/src/lsp/project.ts +19 -0
  354. package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +204 -118
  355. package/src/plugins/pi-agent-ide-lsp/src/rename-plan.ts +2 -17
  356. package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +92 -45
  357. package/src/plugins/pi-agent-ide-terminal/src/resources.ts +8 -6
  358. package/src/plugins/pi-agent-ide-terminal/src/search.ts +10 -36
  359. package/src/plugins/pi-agent-ide-terminal/src/tools.ts +1 -1
  360. package/src/plugins/pi-agent-ide-vision/index.ts +31 -4
  361. package/dist/chunk-2P2OGO3G.js +0 -2
  362. package/dist/chunk-5J43L2RL.js +0 -11
  363. package/dist/chunk-6EYWFBNG.js +0 -0
  364. package/dist/chunk-7AVXUV4A.js +0 -7
  365. package/dist/chunk-7WCZOO5I.js +0 -1
  366. package/dist/chunk-BAYETTZZ.js +0 -16
  367. package/dist/chunk-BVK5A7ED.js +0 -28
  368. package/dist/chunk-F7NVAC4Q.js +0 -0
  369. package/dist/chunk-FZBCKIJJ.js +0 -1
  370. package/dist/chunk-I5JLCFUX.js +0 -1
  371. package/dist/chunk-KUPHNMUK.js +0 -2
  372. package/dist/chunk-MIZAFRDR.js +0 -1
  373. package/dist/chunk-PJPA5EEE.js +0 -2
  374. package/dist/chunk-PXWDDBBC.js +0 -0
  375. package/dist/chunk-SILJ3OL4.js +0 -9
  376. package/dist/chunk-TQZBVOTT.js +0 -5
  377. package/dist/chunk-VWW3RLUX.js +0 -12
  378. package/dist/chunk-YHUTTZC6.js +0 -2
  379. package/dist/chunk-ZODCBFBL.js +0 -2
  380. package/dist/entry-87.js +0 -1
  381. package/docs/agent-guides/apply.md +0 -333
  382. package/node_modules/pi-agent-text-editor/src/api/apply-renderer.ts +0 -3
  383. package/node_modules/pi-agent-text-editor/src/core/apply/apply-undo-store.ts +0 -159
  384. package/node_modules/pi-agent-text-editor/src/core/apply/execution.ts +0 -405
  385. package/node_modules/pi-agent-text-editor/src/core/apply/final-mutations.ts +0 -50
  386. package/node_modules/pi-agent-text-editor/src/core/apply/format-source.ts +0 -11
  387. package/node_modules/pi-agent-text-editor/src/core/apply/mixed-source.ts +0 -203
  388. package/node_modules/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +0 -55
  389. package/node_modules/pi-agent-text-editor/src/core/apply/output.ts +0 -276
  390. package/node_modules/pi-agent-text-editor/src/core/apply/prompt.ts +0 -13
  391. package/node_modules/pi-agent-text-editor/src/core/apply/queue.ts +0 -25
  392. package/node_modules/pi-agent-text-editor/src/core/apply/renderer.ts +0 -405
  393. package/node_modules/pi-agent-text-editor/src/core/apply/results.ts +0 -137
  394. package/node_modules/pi-agent-text-editor/src/core/apply/runtime.ts +0 -369
  395. package/node_modules/pi-agent-text-editor/src/core/apply/structured-result.ts +0 -251
  396. package/node_modules/pi-agent-text-editor/src/core/apply/tool.ts +0 -168
  397. package/node_modules/pi-agent-text-editor/src/core/apply/transaction.ts +0 -942
  398. package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-80.js +0 -2
  399. package/node_modules/pi-agent-tool-ui/runtime/entry-82.js +0 -1
  400. package/node_modules/pi-agent-web-text/runtime/entry-87.js +0 -2
  401. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-87.js +0 -2
  402. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-83.js +0 -2
  403. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-80.js +0 -2
  404. package/src/extensions/pi-agent-text-editor/runtime/entry-78.js +0 -2
  405. package/src/extensions/pi-agent-text-editor/src/api/apply-renderer.ts +0 -3
  406. package/src/extensions/pi-agent-text-editor/src/core/apply/apply-undo-store.ts +0 -159
  407. package/src/extensions/pi-agent-text-editor/src/core/apply/execution.ts +0 -405
  408. package/src/extensions/pi-agent-text-editor/src/core/apply/final-mutations.ts +0 -50
  409. package/src/extensions/pi-agent-text-editor/src/core/apply/format-source.ts +0 -11
  410. package/src/extensions/pi-agent-text-editor/src/core/apply/mixed-source.ts +0 -203
  411. package/src/extensions/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +0 -55
  412. package/src/extensions/pi-agent-text-editor/src/core/apply/output.ts +0 -276
  413. package/src/extensions/pi-agent-text-editor/src/core/apply/prompt.ts +0 -13
  414. package/src/extensions/pi-agent-text-editor/src/core/apply/queue.ts +0 -25
  415. package/src/extensions/pi-agent-text-editor/src/core/apply/renderer.ts +0 -405
  416. package/src/extensions/pi-agent-text-editor/src/core/apply/results.ts +0 -137
  417. package/src/extensions/pi-agent-text-editor/src/core/apply/runtime.ts +0 -369
  418. package/src/extensions/pi-agent-text-editor/src/core/apply/structured-result.ts +0 -251
  419. package/src/extensions/pi-agent-text-editor/src/core/apply/tool.ts +0 -168
  420. package/src/extensions/pi-agent-text-editor/src/core/apply/transaction.ts +0 -942
  421. /package/node_modules/{pi-agent-text-editor → pi-agent-text-editor-renderer}/runtime/entry-78.js +0 -0
  422. /package/node_modules/{pi-agent-text-editor-renderer → pi-agent-text-editor-stale-anchor}/runtime/entry-79.js +0 -0
  423. /package/node_modules/{pi-agent-tool-call-interception → pi-agent-tool-ui}/runtime/entry-81.js +0 -0
  424. /package/node_modules/{pi-agent-web → pi-agent-web-html}/runtime/entry-83.js +0 -0
  425. /package/node_modules/{pi-agent-web-html → pi-agent-web-image}/runtime/entry-84.js +0 -0
  426. /package/node_modules/{pi-agent-web-image → pi-agent-web-pdf}/runtime/entry-85.js +0 -0
  427. /package/node_modules/{pi-agent-web-pdf → pi-agent-web-text}/runtime/entry-86.js +0 -0
  428. /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-html → pi-agent-web-image}/runtime/entry-84.js +0 -0
  429. /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-image → pi-agent-web-pdf}/runtime/entry-85.js +0 -0
  430. /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-pdf → pi-agent-web-text}/runtime/entry-86.js +0 -0
  431. /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-renderer → pi-agent-text-editor-stale-anchor}/runtime/entry-79.js +0 -0
@@ -1,60 +1,65 @@
1
1
  # Precise text editing
2
2
 
3
- Use standalone `replace`, `insert`, `delete`, `copy`, and `move` whenever each intended change is known in advance and does not depend on another change. Submit several independent edits together as separate tool calls in one assistant response, whether they affect one file or several files.
3
+ Use standalone `replace`, `insert`, `delete`, `copy`, and `move` when each change is known in advance and does not depend on another change. Submit independent calls together in one response. Use native Codemode for computed or dependent composition; it does not add grouped rollback.
4
4
 
5
- Use `apply` only when the work requires computation, conditions, selection composition, checkpoints, or one coherent cross-file transaction. Do not replace a straightforward standalone batch with a JavaScript Apply program. Read `docs:apply` before writing an Apply script.
5
+ Use `write` only to create a file or deliberately replace all its contents. Use `diff` for read-only comparison.
6
6
 
7
- Use `write` only to create a file or deliberately replace its complete contents. Use `diff` for read-only comparison.
8
-
9
- ## Selecting text
7
+ ## Select the intended text
10
8
 
11
9
  Use a returned anchor when it identifies the intended text. Otherwise use the smallest unique exact string.
12
10
 
13
- Supported selectors include:
11
+ - `LINE#HASH` selects a current source line from the `anchors` view.
12
+ - `scope-begin-HASH` and `scope-end-HASH` mark syntax boundaries from the `ast` view.
13
+ - `SEARCH#...:line` selects a complete containing line; `SEARCH#...:match` selects the exact match.
14
+ - `begin` and `end` select the first and last existing lines.
15
+ - A unique exact string selects that fragment.
14
16
 
15
- - `LINE#HASH` — one current source line returned by the `anchors` view.
16
- - `scope-begin-HASH` and `scope-end-HASH` — syntax-scope boundaries returned by the `ast` view.
17
- - `SEARCH#...:line` — the complete containing line of a search result.
18
- - `SEARCH#...:match` — only the exact search match.
19
- - `begin` and `end` — the first and last existing source lines.
20
- - A unique exact string — that text fragment itself.
17
+ With `end`, the operation covers complete lines from the first line containing `start` through the last line containing `end`, inclusive. Without `end`, an exact string selects just that fragment.
21
18
 
22
- With an `end` selector, the operation covers complete lines from the first line containing `start` through the last line containing `end`, inclusive. Without `end`, an exact string targets only that fragment, while a line or structured anchor targets its selected line or range.
19
+ After an exact-text selector fails, exact-text edits are blocked for that file. Find the intended location among the returned current anchors, or use Read/Search for another section. Edit with its anchor. After that edit succeeds, exact text is available again. Do not retry a guessed string.
23
20
 
24
- Selections are revision-sensitive. Re-read after a mutation before reusing a single-file line, scope, or search anchor. Complete `SEARCH#...:all` selections can refresh their original query.
21
+ Re-read after a mutation before reusing line, scope, or individual Search anchors. Complete `SEARCH#...:all` selections retain their existing query-refresh behavior.
25
22
 
26
- ## Choosing line separation
23
+ ## Compose results
27
24
 
28
- Use `separation: "blank-line"` for a separate paragraph or section; use the default line mode for adjacent code lines, list items, or a continuation of the current block. For example, inserting `X` after `A` in `A\nB` with blank-line separation produces `A\n\nX\n\nB`. In Apply, pass `{ separation: "blank-line" }` as the third argument to a linewise `insertAfter` or `insertBefore`.
25
+ Results are readable text with a leading system-result envelope. The envelope is an internal reference, not file content. Do not edit it or write it into a file. Pass the unchanged result to another source parameter; outside Codemode you can also pass its UUID. Store/load keeps the same string in the current session. No internal fields need to be inspected.
29
26
 
30
- ## Standalone mutation behavior
27
+ Read results select their requested source windows. Search results select exact matches. Select derives new boundaries. A displayed item reference selects that item; the whole result retains all selections, including those omitted from its preview.
31
28
 
32
- Batch independent mutations as separate tool calls in one assistant response. Every call in that batch is evaluated against the original file contents. Combine overlapping changes into one mutation. A rejected call does not cancel successful independent calls; retry only what was not applied.
29
+ - `replace.path` replaces selected ranges. `delete.path` removes selected text but keeps the file, even for a whole-file selection.
30
+ - `write.path` and `undo.file` require one whole-file selection. Partial and multi-file scopes are rejected, not widened.
31
+ - `copy.path` / `move.path` select source ranges; `target` selects destination ranges. A zero-width destination inserts. Arrays pair in declared order, with equal counts and duplicates removed. Unequal counts and overlapping moves are rejected.
32
+ - Ordinary destination file paths without text selectors require one whole-file source and keep byte-preserving file transfer behavior.
33
+ - `insert` uses line-based insertion before or after its selected containing lines.
33
34
 
34
- When a text tool allows an omitted path, it can inherit the source identified by its anchor, the last read, or the preceding edit in the same batch. Supply the path when that inheritance would be ambiguous.
35
+ Replace/insert results select their resulting text, including supplied line separators. Empty replacement selects the resulting position, not removed text. Copy/move results select only destination text. Whole-file transfers and write select the whole destination; undo selects restored files. Delete and binary operations provide no reusable text selection. If a result cannot supply a verified selection, inspect the file instead.
35
36
 
36
- Use `delete` with a path and no text selector to delete one complete file. Use a selector to remove text. Use `copy` or `move` with no text selectors for whole-file operations; add source and destination selectors for text transfers.
37
+ Results are strict snapshots. Changed files permanently retire their old IDs, even if the old bytes are restored later. Session changes and reloads also retire IDs. Empty selections are valid no-ops; incomplete or expired selections cannot authorize edits. Diff text and invented coordinates do not grant source authority.
37
38
 
38
- ## Native Codemode
39
+ ## Line separation
39
40
 
40
- Check each IDE result's `status` before using its data. Structured domain errors resolve to `status: "error"` or `"partial"`; argument validation, blocking, and cancellation can still reject. Check `data.effect` and per-source effects before retrying.
41
+ Use `separation: "blank-line"` for a separate paragraph or section; use default line mode for adjacent code, list items, or a continuation. Inserting `X` after `A` in `A\nB` with blank-line separation produces `A\n\nX\n\nB`.
41
42
 
42
- Await `tools.flush({})` when later script work needs a committed receipt. Inspect its `data.operations` for final effects keyed by accepted child call ID. A failed flush does not replay edits. An empty flush succeeds with no operations.
43
+ ## Writes and failures
43
44
 
44
- Submit independent local text-edit calls on disjoint resource sets concurrently inside one script. Await calls on overlapping resource sets in order. Keep their selectors tied to the original file snapshots and combine overlapping edits before submitting them. Check the parent Codemode result for committed effects; a child acceptance is not proof that a file was written.
45
+ Independent calls share the original snapshots. Combine overlapping edits into one mutation. A rejected call does not cancel successful peers; retry only unapplied changes.
45
46
 
46
- Read or search again before dependent edits that need fresh content or anchors. Another tool, a whole-file operation, or a resource-owned selector ends the pending batch before running. Do not reuse old line anchors across that boundary.
47
+ An omitted path can inherit the file identified by an anchor, the last read, or the preceding edit in the batch. Supply the path when that would be ambiguous.
47
48
 
48
- Inspect final results after an ordinary script error and retry only unapplied edits. Abort or deadline discards pending writes, not batches that already committed.
49
+ An ordinary `delete.path` without selectors deletes a complete regular file. A result input removes only selected text. Ordinary copy/move paths without selectors transfer whole files and replace an existing regular destination file.
49
50
 
50
- ## Specialized resources
51
+ Inside Codemode, await independent edits on disjoint resources concurrently and overlapping resources in order. Pass a pending edit result directly to another source tool for dependent work; that boundary commits the batch before consuming the result. Await `tools.flush({})` when you need a committed receipt. Its text reports file and operation effects. A failed flush never replays edits.
52
+
53
+ Failed tools reject in Codemode. Use try/catch or Promise.allSettled when independent calls may fail. Inspect the parent result for actual committed effects: an acceptance is not proof of writing, and an error is not proof of rollback.
51
54
 
52
- Some resources attach non-text actions to the same tools:
55
+ Formatting and registered post-edit handlers run once per surviving resource at script end, not at flush or dependency boundaries. Reads inside the script see written but not yet formatted text. If final processing changes bytes, repeat Read/Search. Standalone edits finish post-edit work immediately.
53
56
 
54
- - `shell:<session>` — `write` sends exact input, `insert` sends named keys, and `delete` terminates the session.
55
- - `debug:<session>` — `insert` controls the debugger and `delete` removes a breakpoint or terminates the session.
56
- - `symbol:<file>#<selector>#name` — `replace` performs a native language-server rename when available.
57
+ Ordinary script errors keep accepted edits. Abort or deadline discards pending writes, not batches that already committed. Inspect final results and retry only unapplied edits.
58
+
59
+ ## Specialized resources
57
60
 
58
- Read `docs:terminal`, `docs:debugger`, or `docs:search-code` before using those specialized resources.
61
+ - `shell:<session>`: write sends exact input, insert sends keys, delete terminates the session.
62
+ - `debug:<session>`: insert controls the debugger; delete removes a breakpoint or terminates it.
63
+ - `symbol:<file>#<selector>#name`: replace performs a native language-server rename when available.
59
64
 
60
- Never guess after a stale snapshot, empty selection, ambiguous target, or unknown rollback effect.
65
+ Read `docs:terminal`, `docs:debugger`, or `docs:search-code` before using these resources. Never guess after a stale snapshot, ambiguous target, incomplete selection, or unknown rollback effect.
@@ -2,4 +2,4 @@
2
2
 
3
3
  Read a tracked file with `views: ["changes"]` to see staged and unstaged hunks and current `CHANGE#` anchors. Stage or unstage only the selected current change. Anchors are revision-sensitive, so re-read after index or worktree changes.
4
4
 
5
- Use `undo` with an `APPLY#` receipt to restore every path from one Apply checkpoint atomically. Use a `CHANGE#` anchor to restore that selected Git change to `HEAD` in both worktree and index. Use `last` with a file only for that file's latest text-editor transaction. Inspect current changes before destructive restoration.
5
+ Use a `CHANGE#` anchor to restore that selected Git change to `HEAD` in both worktree and index. Use `last` with a file only for that file's latest text-editor transaction. Inspect current changes before destructive restoration.
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Selecting a source
4
4
 
5
- `path` selects a resource. Supported providers include regular files and directories, `file:` URLs, HTTP(S) URLs, PDFs, images, returned `temp:` references, `SEARCH#` references, and enabled protocol resources.
5
+ `path` selects a resource. Supported providers include regular files and directories, `file:` URLs, HTTP(S) URLs, PDFs, images, returned `temp:` references, `SEARCH#` and `RESULT#` references, and enabled protocol resources.
6
6
 
7
7
  Common protocol resources include:
8
8
 
@@ -27,11 +27,15 @@ For `raw:` resources, offsets and limits count bytes. A negative offset counts f
27
27
 
28
28
  Temporary resources remain available only in their owning runtime.
29
29
 
30
- ## Native Codemode data
30
+ ## Readable results and composition
31
31
 
32
- Check `status` before reading `data`. Use text `data.lines` and their `anchors` without parsing display rows. Use source-level `data.references` for actions such as Git changes. Follow `data.continuation` as a complete next Read request; its offset is absolute on its returned source. Check `data.truncated` and `data.fullResult` when present.
32
+ Read returns the same file text or requested views in direct calls and Codemode. It adds a leading system-result envelope with a UUID. The envelope is an internal reference, not file content; do not edit or insert it into a file. Follow the displayed continuation offset or temp reference for more output. Raw reads show hexadecimal bytes. Nested image reads also deliver their images on the parent Codemode result.
33
33
 
34
- Use `data.bytes` for `raw:` reads. Forward a native image from `data.blocks` with `image(block)`. Keep multi-source `data.resources` separate instead of joining unrelated ranges.
34
+ Pass an unchanged result as `read.path`, `search.path`, `select.path` or a supported edit source parameter. Outside Codemode, its UUID works too. Store/load retains these strings within the session. Read results keep their requested source windows, not just the shortened preview. Read-only derived views, bytes, images and directory listings do not gain text-edit authority.
35
+
36
+ Read of a selected result may show surrounding whole-line context, but later tools remain restricted to its original exact selection. Context does not grant wider edit authority.
37
+
38
+ Changed snapshots permanently retire their old IDs, even if the file is restored later. Obtain a fresh Read/Search after changes, session switches or reloads. Unsupported and expired references are errors, not empty results.
35
39
 
36
40
  ## Views
37
41
 
@@ -8,22 +8,54 @@ Use uppercase `AND` and `OR`, infix `NOT`, `||`, or a space-separated `|` for Bo
8
8
 
9
9
  Use `files:<pattern>` for paths. Slash-containing globs match workspace-relative paths; basename globs match at any depth. Narrow with `path`, `include`, and `exclude` before broadening a noisy query.
10
10
 
11
+ ## Possible names after zero matches
12
+
13
+ Use possible-name groups as spelling hints, not synonyms or proof of equivalent behavior. Inspect the candidate source before choosing an edit. The original match list stays empty; each group is a separate exact alternative in the same scope.
14
+
15
+ Inspect the displayed possible-name groups and their completeness separately. The whole Search result still selects the original empty match set, not a suggested alternative. Use the chosen group's returned references to inspect or edit that alternative. A candidate all-reference refreshes only its exact alternative, not the fuzzy ranking. For URL groups, read the returned URL and line range; no editable Search references exist. Result-scoped queries stay exact and do not run this extra branch.
16
+
17
+ If the extra branch reports a budget skip, narrow `path` rather than treating the skip as proof that no nearby name exists. Keep quoted exact queries, Boolean queries, and explicit protocols exact.
18
+
11
19
  ## Search resources
12
20
 
13
- Inside native Codemode, check `status` and use `data.matches`, their exact `range`, and `references.line` or `references.match`. Use `data.all` only when returned. Check backend `complete` separately from public-window `truncated`; an empty successful match list is not an error.
21
+ Search returns readable matches and references in direct calls and Codemode. An empty successful search is not an error. Incomplete results say so; do not treat their zero matches as proof of absence.
14
22
 
15
23
  Local text results expose `SEARCH#HASH:N:line` for its containing line and `SEARCH#HASH:N:match` for the exact match. Complete selections use `:all:line` or `:all:match`. Pass these references directly to read or editing tools; omit the file path when an all-selection spans files.
16
24
 
17
25
  A single-result reference becomes stale after its file changes. Re-run the search before reuse. A complete `:all` reference refreshes its original query when selected files change. Compacted output retains complete all-selections.
18
26
 
27
+ ## Searching returned scopes
28
+
29
+ Pass an unchanged Read/Search/Select/edit result, its UUID or a `RESULT#` reference as `path`. Arrays of registered results also work. Local text, `regex:`, `ast:`, and `symbols:` queries search their exact ranges. Sparse ranges and files stay separate; gaps and neighboring text are not searched.
30
+
31
+ A replace/insert result searches only that call's resulting text, including an empty resulting position. Copy/move search only destination text; whole-file transfers, write and undo search whole resulting files. Delete and restored absence have no live text target. In Codemode, passing a pending result commits the batch first. Final formatting runs at script end; results from before changed formatting become stale, not silently rebound.
32
+
33
+ Use a displayed item or capture reference for a subset. The whole result retains its complete stored scope; editing copied preview text never narrows that scope.
34
+
35
+ Incomplete scopes cannot authorize edits, even through non-empty subsets. Empty arrays select no sources; they do not default to the workspace. Result-scoped text Boolean queries and text include/exclude globs remain unsupported. AST and LSP providers retain their own path/glob filters. File/process and unsupported provider scopes fail without widening the scope.
36
+
19
37
  ## AST search
20
38
 
21
- Use `ast:<pattern>` for syntax-aware matching. `$NAME` captures one syntax node and `$$$BODY` captures several nodes. Returned search references can select multiline matches for read, replace, copy, move, delete, and Apply. An incomplete result does not provide a complete all-selection. Text replacement through an AST selection does not update imports or references automatically.
39
+ Use `ast:<pattern>` for syntax-aware matching. `$NAME` captures one syntax node and `$$$BODY` captures several nodes. Returned search references can select multiline matches for read, replace, copy, move, and delete. An incomplete result does not provide a complete all-selection. Text replacement through an AST selection does not update imports or references automatically.
40
+
41
+ Use the displayed `capture NAME: RESULT#...` reference to Search or edit a capture without Select. It belongs to that parent match and retains every captured node, including punctuation. Its node count does not change the selection. An empty capture selects nothing; an absent capture has no reference. AST matches and captures must be wholly contained in one requested region; they are not clipped at a scope boundary.
42
+
43
+ ```js
44
+ const window = await tools.read({ path: "client.ts", offset: 10, limit: 4 });
45
+ const calls = await tools.search({ path: window, query: "ast:request($OPTIONS)" });
46
+ text(calls);
47
+ ```
48
+
49
+ Use its displayed OPTIONS reference in the next call. Store/load keeps these result strings across Codemode scripts within the same session.
22
50
 
23
51
  ## Symbols and graphs
24
52
 
25
53
  Use `symbols:<query>` to locate declarations and references when the source file is unknown. Use `symbol:<file>#<selector>` to read one declaration. Use `graph:<file>` for the file's top-level declarations and relationships, or `graph:<file>#<selector>` for incoming and outgoing references of one declaration.
26
54
 
55
+ Pass a result scope to `symbols:` for strict discovery inside its exact ranges. Read the displayed definition/reference and symbol information. Name equality alone does not establish reference identity.
56
+
57
+ Use `navigation: "references"` only when following symbols represented inside the input scope to references outside it. Navigation stays within the workspace. Path and globs define the seed scope in this mode, not the destination references. Omit navigation for strict discovery. Incomplete, failed or unavailable provider results do not prove absence. Text replacement through an LSP match changes only that range; it is not semantic rename.
58
+
27
59
  Append `#name` to an exact symbol resource only for a native language-server rename across references. If semantic support is unavailable, use a precise text or AST operation instead of pretending it was a semantic rename. Pending or empty language-server output does not prove that no declaration or reference exists.
28
60
 
29
61
  ## Other search protocols
@@ -0,0 +1,115 @@
1
+ # Select source boundaries
2
+
3
+ Use Search for predicates and existing captures. Use Select to derive new text or syntax boundaries. Pass the unchanged Read/Search/Select/edit result as `path`; ordinary paths and returned item references also work. Outside Codemode, you can pass the result's UUID.
4
+
5
+ Select returns readable selected text with item references. The whole result retains all selected ranges, even when its preview is shortened. Use a displayed item reference when you need only that item. Do not build a selection from copied preview text or invented coordinates.
6
+
7
+ ## Syntax operations
8
+
9
+ Syntax operations support JavaScript (.js/.mjs/.cjs) and TypeScript (.ts/.mts/.cts), without JSX/TSX. Missing providers and syntax errors are errors, not evidence of absence. Text operations need no parser.
10
+
11
+ ### Enclosing constructs
12
+
13
+ `{kind:"object", object:"function"}` selects the nearest function containing the entire seed. An exact function selects itself. `level:2` selects the next outer function; levels count only the requested category. A seed crossing separate constructs is rejected. Enclosing can expand outside the original window and reports that expansion.
14
+
15
+ Supported categories: function, call, class, if, switch, loop, try, catch, binding, assignment, object, property, array, return and throw. Call includes new expressions. Function includes methods, arrows, async/generator forms and bodyless TS signatures. Default parameter expressions belong to their function. Binding selects one variable declarator, not the whole declaration statement.
16
+
17
+ These are syntax categories, not semantic identities. Parser-only wrappers, punctuation, comments, class fields, JSX/TSX and unlisted forms do not become extra categories. `ownBody` is not implemented.
18
+
19
+ ### Navigate
20
+
21
+ `{kind:"navigate", relation:"parent"}` requires an exact named syntax node and skips parser-only wrappers. Exact parts and captures work; first use enclosing when a range cuts through a node. A whole-file seed is not implicitly split into functions.
22
+
23
+ - parent selects the nearest normalized ancestor, excluding the starting node.
24
+ - ancestors selects all normalized ancestors in source order.
25
+ - children selects nearest nested constructs; descendants selects all nested constructs.
26
+ - siblings selects other constructs with the same normalized parent. previous/next selects the immediate neighbor; all selects every sibling. Missing neighbors are valid absence.
27
+
28
+ An `object` filter is applied after navigation; it never changes topology. Parent with object:function does not jump past an intervening call. Children with object:call does not jump through an if. Use ancestors/descendants for deeper matches.
29
+
30
+ Ancestors and descendants can overlap. Narrow to disjoint targets before editing; edit tools reject overlapping writes.
31
+
32
+ ### Named parts
33
+
34
+ `{kind:"part", part:"arguments"}` requires an exact construct. Parts keep their delimiters: block bodies include braces, argument/parameter lists include parentheses, annotations include colons, and else/finalizer clauses include their keywords. Expression arrow bodies are exact expressions.
35
+
36
+ | Construct | Supported parts |
37
+ | --------------- | ---------------------------------------------------------- |
38
+ | function | name, parameters, returnType, body |
39
+ | call/new | callee, arguments |
40
+ | class | name, body |
41
+ | if | condition, then, else |
42
+ | switch | condition, body |
43
+ | classic for | initializer, condition, update, body |
44
+ | for-in / for-of | left, iterable, body |
45
+ | while / do | condition, body |
46
+ | try | body, handler, finalizer |
47
+ | catch | parameter, body |
48
+ | finally clause | body |
49
+ | binding | name, type, value |
50
+ | assignment | left, right |
51
+ | property | key, value; shorthand selects the same identifier for both |
52
+ | return / throw | value |
53
+
54
+ An absent optional part produces no selection. An unsupported part reports available names. Objects and arrays do not invent body or arguments parts.
55
+
56
+ ```js
57
+ const found = await tools.search({ path: "client.ts", query: "ast:send($$$ARGS)" });
58
+ const call = await tools.select({ path: found, operation: { kind: "object", object: "call" } });
59
+ const args = await tools.select({ path: call, operation: { kind: "part", part: "arguments" } });
60
+ text(await tools.read({ path: args }));
61
+ const number = await tools.search({ path: args, query: "10" });
62
+ await tools.replace({ path: number, text: "20" });
63
+ ```
64
+
65
+ ### List element extents
66
+
67
+ `{kind:"elementExtent", extent:"inside"}` requires an exact direct call/new argument or parenthesized function parameter. Use a displayed Search capture reference for that element. Variadic captures can include punctuation; punctuation is not an element. Typed/default parameters must include their type/default.
68
+
69
+ Inside keeps the element. Around adds owned comma/whitespace and preserves list parentheses. First/middle elements own the following gap. A last element with a trailing comma owns that following gap; without one it owns the preceding gap. An only element owns the whole list interior.
70
+
71
+ Adjacent comments make around ambiguous; inside remains available. Several around extents may overlap, so do not assume bulk deletion repairs syntax. Copy/move transports exact selected bytes, not a refactoring. Destination syntax and parameter ordering remain the caller's responsibility. Arrays, objects, partial expressions, whole lists and unparenthesized arrow parameters are unsupported here.
72
+
73
+ ## Text operations
74
+
75
+ - range: absolute startLine/startColumn/endLine/endColumn in one source; lines are one-based, columns UTF-16, end exclusive. Must fit one input region.
76
+ - lines: inclusive first/last complete source lines, including existing endings; must fit one region.
77
+ - between: pairs each non-empty start marker with the nearest following end, without nesting, then resumes after the pair. Extent inside excludes markers, around includes them, lines expands to containing lines. Unmatched openings are errors; no openings is valid absence.
78
+ - sliceText: relative UTF-16 from/to in each region; to is exclusive and defaults to its end. Equal offsets select a point.
79
+ - trim: removes whitespace from start/end/both edges. Whitespace-only input selects a point at its end.
80
+ - split: divides by a non-empty literal delimiter, excluding delimiters and retaining empty segments as points.
81
+ - linesOf: expands to complete containing lines. An exclusive end at next-line column zero does not include that line.
82
+ - position: before/after points of each region. Use a whole-file Read for file edges.
83
+ - columns: exclusive from/to columns on each touched line, excluding endings. Every interval must fit its line and input scope.
84
+
85
+ Except for range/lines, operations apply independently to each region. Sparse gaps stay separate. Markers cannot cross gaps. Bounds inside surrogate pairs or CRLF are errors; ranges are never silently clipped. Only linesOf and between/lines explicitly expand text input.
86
+
87
+ ## Range sets
88
+
89
+ Pass candidates in `path` and comparison results in `operation.scopes`. Both accept unchanged results, issued references or arrays. Match by source and snapshot, not array order. Every input is verified, even without a counterpart.
90
+
91
+ - within retains a candidate only if one scope contains it; no clipping or joining for containment.
92
+ - intersection clips each candidate to the union of scopes.
93
+ - difference subtracts scopes and retains separate surviving fragments.
94
+ - merge joins overlapping candidates. adjacent:true also joins touching nonempty ranges, never real gaps.
95
+
96
+ Points belong to a nonempty range at its included start, not its excluded end. Equal points match. Intersection with a contained point keeps it; touching ranges do not create points. Difference removes covered candidate points but point scopes do not cut text. Merge absorbs covered points without extending ranges. EOF points are outside a range ending at EOF.
97
+
98
+ Empty scopes make within/intersection empty and difference unchanged. Incomplete inputs cannot establish absence or authorize edits. Select never writes or formats.
99
+
100
+ ```js
101
+ const candidates = await tools.search({ path: "notes.txt", query: "regex:<[^>]+>" });
102
+ const protectedText = await tools.search({ path: candidates, query: "KEEP" });
103
+ const editable = await tools.select({
104
+ path: candidates,
105
+ operation: { kind: "difference", scopes: protectedText },
106
+ });
107
+ const found = await tools.search({ path: editable, query: "old" });
108
+ await tools.replace({ path: found, text: "new" });
109
+ ```
110
+
111
+ ## Composition limits
112
+
113
+ Read may show whole-line context around a selection, but later tools remain within its exact selected ranges. Whole-file write/undo reject partial selections. Insert remains line-based. Changed files, new sessions and reloads retire IDs; final Codemode formatting may also retire earlier results.
114
+
115
+ A function body includes nested functions. To check a call in a function's own body, compare the call's nearest enclosing function with the original owner using their source-local selections. Syntax names alone do not establish semantic identity. Do not establish absence from incomplete results.
@@ -8,13 +8,9 @@ Default removes the selected scope’s override. Module descriptions show effect
8
8
 
9
9
  Feature overrides are stored under `flags` in `extensions.json`, keyed by their CLI name. Existing `noAnimations` and `noPostProcessing` fields still work; changing the corresponding feature in the menu replaces that field with its flag override.
10
10
 
11
- The Features tab includes **Disable Apply** (`pi-agent-ide-no-apply`). Enable it and reload to remove only the `apply` tool; standalone tools remain available. It defaults to off. The obsolete `old-tools` switch has been removed.
12
-
13
11
  Agent Vision adds separate opt-ins for **Capture arbitrary windows** and **Capture full displays**. Both default to off. Its text settings control the default sequence duration, frame interval, image scale, and a comma-separated list of exact executable file names that may be captured without arbitrary-window access. Press Enter to edit a text value, Enter again to commit it, then Ctrl+S to save.
14
12
 
15
- The UI tab contains separate presentation settings for Apply previews, diffs, Read, Search, and terminal output. Each setting supports **Full**, **Compact**, and **Disabled**. Compact is the product default. Full shows all available content, while Disabled keeps only a concise, honest status and still shows failures and warnings. Expanding a tool call always shows the full presentation, regardless of its collapsed preference. These settings affect only the TUI; agent-facing results and tool behavior do not change.
16
-
17
- Apply previews never execute arguments and do not indicate successful edits; operation results are shown separately. In compact mode, completed source is formatted before recognized helper calls are projected into concise operation headers. Incomplete code uses the recoverable source preview. Headers keep supplied anchors and compact long argument expressions with their source size; those sizes are not counts of applied edits. Full mode shows the complete display copy. Execution always receives the original source.
13
+ The UI tab contains separate presentation settings for diffs, Read, Search, and terminal output. Each setting supports **Full**, **Compact**, and **Disabled**. Compact is the product default. Full shows all available content, while Disabled keeps only a concise, honest status and still shows failures and warnings. Expanding a tool call always shows the full presentation, regardless of its collapsed preference. These settings affect only the TUI; agent-facing results and tool behavior do not change.
18
14
 
19
15
  All user-configurable presentation and behavior preferences belong in Agent IDE settings. New options must carry a human name, explanation and default in their registration. Presentation options belong in the UI tab.
20
16
 
@@ -28,17 +24,16 @@ Pi Agent IDE enables every built-in extension by default. Project and global con
28
24
 
29
25
  Tools use fixed native exposure; there are no IDE exposure overrides or named profiles.
30
26
 
31
- | Namespace | Tools | Exposure |
32
- | -------------- | -------------------------------- | ------------ |
33
- | `ide_read` | `read`, `diff` | `direct` |
34
- | `ide_search` | `search` | `direct` |
35
- | `ide_edit` | `apply` | `model-only` |
36
- | `ide_edit` | Standalone editing tools | `direct` |
37
- | `ide_terminal` | `bash` (`powershell` on Windows) | `direct` |
38
- | `ide_git` | `stage`, `unstage` | `deferred` |
39
- | `ide_debug` | `debug` | `deferred` |
27
+ | Namespace | Tools | Exposure |
28
+ | -------------- | -------------------------------- | ---------- |
29
+ | `ide_read` | `read`, `diff` | `direct` |
30
+ | `ide_search` | `search` | `direct` |
31
+ | `ide_edit` | Standalone editing tools | `direct` |
32
+ | `ide_terminal` | `bash` (`powershell` on Windows) | `direct` |
33
+ | `ide_git` | `stage`, `unstage` | `deferred` |
34
+ | `ide_debug` | `debug` | `deferred` |
40
35
 
41
- Apply stays directly declared, including in Codemode-only mode. Nested calls and Codemode scripts cannot call it. Direct tools keep their normal calls and can also run through Codemode while active.
36
+ Direct tools keep their normal calls and can also run through Codemode while active. Select derives exact boundaries; edits consume its snapshot-bound targets.
42
37
 
43
38
  Git staging and debugger tools are not declared ahead of time. Short agent guidance names the enabled capabilities and tells the agent to find them through native `tool_search`. IDE activates `tool_search` when an enabled deferred capability needs it and the host allows it. Native namespace filtering, BM25 ranking and Codemode declaration budgets apply; workspace `search` still searches workspace content.
44
39
 
@@ -80,7 +75,7 @@ Built-in entry modules are imported only after selection. Disabled built-ins, in
80
75
 
81
76
  ## Animations and post-edit processing
82
77
 
83
- Apply stages guarded text and file operations against immutable snapshots. An explicit `apply()` validates and commits the current multi-file transaction. Invalid, stale, ambiguous, or overlapping changes fail before writing. A later execution failure triggers rollback and reports whether restoration completed. A script may commit several transactions; reads after a commit see its changes. Configured formatting runs once per surviving changed file at the end of the outer Apply call, and diagnostics start after post-processing. Copied and moved UTF-8 text targets also receive configured post-processing; binary contents stay unchanged.
78
+ Standalone editing tools validate source snapshots before writing. Native Codemode composes those same tools and can commit pending local edits with `tools.flush({})`. Accepted child calls are not proof of persistence. Ordinary script errors keep accepted edits; aborts discard only pending work. Formatting runs once per surviving changed file at script end, followed by diagnostics. Text copy/move destinations receive post-processing; binary contents stay unchanged.
84
79
 
85
80
  Automatic diagnostic findings are grouped for five seconds from the first finding. The UI tab’s **Immediate diagnostic notices** option (`pi-agent-ide-no-diagnostic-buffer`) disables this delay. Combined notices keep each file and reporting tool identifiable. Empty completed diagnostic reads tell the agent that checks finished without findings, but do not draw an empty diagnostic panel. Pending, unavailable and incomplete checks are not reported as clean.
86
81
 
@@ -261,7 +256,7 @@ Missing fields use these defaults. Invalid values stop the editor from loading.
261
256
 
262
257
  ### Diff presentation
263
258
 
264
- Use **Diff presentation** in the Agent IDE settings UI to choose Full, Compact, or Disabled diff panels. Compact is the default and shows a focused sliding window. Full shows every available diff row. Disabled hides diff rows but keeps mutation totals, status, failures, and warnings visible. Expanding a tool call temporarily shows the full diff. The setting applies to standalone mutations, the `diff` tool, and Apply results.
259
+ Use **Diff presentation** in the Agent IDE settings UI to choose Full, Compact, or Disabled diff panels. Compact is the default and shows a focused sliding window. Full shows every available diff row. Disabled hides diff rows but keeps mutation totals, status, failures, and warnings visible. Expanding a tool call temporarily shows the full diff. The setting applies to standalone mutations, native Codemode edit panels, and the `diff` tool.
265
260
 
266
261
  ## Extension config behavior
267
262
 
@@ -58,7 +58,8 @@ The root runner uses native rendering by default. The published harness's raw re
58
58
 
59
59
  Tests that need an unchanged conversation use `#integration/support/pi-runtime/native-pi-coding-agent-test.js`. The root `pi-coding-agent-test` alias uses the same native adapter and keeps its existing surrounding read calls. Both adapters forward explicit launch options; the native adapter also reads the system prompt from Pi 0.99's transcript system messages using the SDK.
60
60
 
61
- `pnpm test:integration:shards` runs four independent Pi pools. Each run prints its own log directory under `.tmp/integration-shards.*`, so parallel audits do not overwrite each other's logs. Set `LOG_DIR` to choose another parent directory.
61
+ `pnpm test:integration:shards` runs four standalone shards. Each scenario closes its Pi process instead of retaining a shared process for every fixture configuration. Each run prints its own log directory under `.tmp/integration-shards.*`, so parallel audits do not overwrite each other's logs. Set `LOG_DIR` to choose another parent directory.
62
+ CI uses the same four shards without changing test or job timeouts. Set `REPORT_DIR` to write a separate `integration-N.xml` JUnit report for each shard. CI retains all shard reports and logs, and builds the release candidate only after every shard passes.
62
63
 
63
64
  `--no-extensions` also disables Pi's native built-ins. Native fixtures explicitly load `builtin:codemode`, `builtin:tool-search`, and `builtin:mcp`; ordinary fixtures do not. `native-host.integration.test.ts` checks the version inside the launched process, deferred discovery, nested execution, and isolation from personal MCP servers.
64
65
 
package/docs/releases.md CHANGED
@@ -19,7 +19,7 @@ See [Develop nightly](nightly.md). Nightlies test a pinned `develop` commit and
19
19
  Choose a release cut by its full commit SHA. If that commit is not yet on main, promote it through a separate pinned branch such as `chore/promote-X.Y.Z`, not a PR whose head is the moving `develop` branch. Keep that promotion head unchanged while CI runs. New develop merges do not join the release unless its scope is explicitly changed. After promotion and main-to-develop synchronization succeed, start the versioned release below. See `.pi/skills/publish-pi-agent-ide/SKILL.md` for the agent runbook.
20
20
 
21
21
  Run **Start release** on `main` with an unused `X.Y.Z` and finished release notes. The workflow checks that no other release branch or registry version exists, creates `release/X.Y.Z` with the version and changelog update, and opens a PR to `main`. The App needs Contents and Pull requests write access to this public repository. Configure `RELEASE_APP_ID` and `RELEASE_APP_PRIVATE_KEY` as Actions secrets; never commit the key. A release branch is the freeze marker. The `Validate` check is required on PRs to `main`; it rejects `develop` while a release branch exists. It admits only the matching release PR or a `fix/release-*` PR labeled `release-fix`. Review the fix itself: a label is not proof that a change is a fix.
22
- Only a branch named exactly `release/X.Y.Z` is an active release marker; older `release/v*` and `release/official-*` branches remain untouched and do not block a new release.
22
+ Only a branch named exactly `release/X.Y.Z` is an active release marker; older `release/v*` and `release/official-*` branches do not block a new release. Remove merged or abandoned release branches when no open PR, running workflow, or worktree still needs them. Delete with an expected-head lease and keep all release tags. Active release branches stay until publication and synchronization, or confirmed cancellation, finish.
23
23
 
24
24
  During the freeze, fix defects in `main` through a labeled fix PR. Rebase `release/X.Y.Z` onto the updated `main` using `--force-with-lease` and wait for the release PR's new CI run. A changed base, head or archive requires fresh candidate evidence. Do not merge features into `main` while a release is active.
25
25