pi-agent-ide 0.7.0 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (323) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/chunk-6U5OU77O.js +3 -0
  3. package/dist/{chunk-6CZO43OH.js → chunk-BU7IZLKB.js} +1 -1
  4. package/dist/chunk-EURHXLN3.js +2 -0
  5. package/dist/{chunk-PYPPV2F5.js → chunk-F6IWZKOG.js} +6 -6
  6. package/dist/{chunk-GBLKIB6O.js → chunk-H445SHSJ.js} +2 -2
  7. package/dist/chunk-IG56UGSO.js +2 -0
  8. package/dist/chunk-IICJXZBU.js +6 -0
  9. package/dist/{chunk-XYS4FSCC.js → chunk-IM24DB3K.js} +1 -1
  10. package/dist/{chunk-YRF7OATP.js → chunk-KOVPDKSJ.js} +1 -1
  11. package/dist/chunk-MXLSGMRZ.js +3 -0
  12. package/dist/chunk-NRZO5KJT.js +9 -0
  13. package/dist/chunk-OB46OPMZ.js +1 -0
  14. package/dist/chunk-PKSQT6TC.js +1 -0
  15. package/dist/{chunk-PNU3E7IO.js → chunk-Q6CZ6GBR.js} +2 -2
  16. package/dist/{chunk-EDURPQAV.js → chunk-QRJLIV6P.js} +6 -6
  17. package/dist/chunk-QUYXINGZ.js +7 -0
  18. package/dist/{chunk-OBNING2A.js → chunk-S5PL5DFQ.js} +1 -1
  19. package/dist/chunk-SBP3ABH4.js +5 -0
  20. package/dist/{chunk-FXNKMNSJ.js → chunk-SJ4UZ4GU.js} +1 -1
  21. package/dist/chunk-SNF7PDDX.js +11 -0
  22. package/dist/{chunk-AJRIASPQ.js → chunk-STBJO3Z3.js} +1 -1
  23. package/dist/{chunk-3HYXQ4YA.js → chunk-TQGE7RH6.js} +13 -13
  24. package/dist/{chunk-S5LXX32D.js → chunk-XDG7EQRN.js} +3 -3
  25. package/dist/{chunk-F5YZG77W.js → chunk-XH5WN5XA.js} +1 -1
  26. package/dist/chunk-YWQS33DF.js +1 -0
  27. package/dist/chunk-ZIWPKIBZ.js +1 -0
  28. package/dist/entry-11.js +1 -1
  29. package/dist/entry-13.js +1 -1
  30. package/dist/entry-14.js +1 -1
  31. package/dist/entry-15.js +1 -1
  32. package/dist/entry-17.js +1 -1
  33. package/dist/entry-25.js +2 -2
  34. package/dist/entry-26.js +1 -1
  35. package/dist/entry-27.js +2 -2
  36. package/dist/entry-28.js +1 -1
  37. package/dist/entry-29.js +1 -1
  38. package/dist/entry-31.js +15 -13
  39. package/dist/entry-33.js +2 -1
  40. package/dist/entry-37.js +6 -6
  41. package/dist/entry-41.js +1 -1
  42. package/dist/entry-42.js +1 -1
  43. package/dist/entry-43.js +1 -1
  44. package/dist/entry-44.js +1 -1
  45. package/dist/entry-45.js +20 -13
  46. package/dist/entry-46.js +1 -1
  47. package/dist/entry-49.js +1 -1
  48. package/dist/entry-50.js +1 -1
  49. package/dist/entry-51.js +8 -7
  50. package/dist/entry-52.js +1 -1
  51. package/dist/entry-53.js +1 -1
  52. package/dist/entry-54.js +1 -1
  53. package/dist/entry-56.js +1 -1
  54. package/dist/entry-57.js +1 -1
  55. package/dist/entry-58.js +1 -1
  56. package/dist/entry-60.js +1 -1
  57. package/dist/entry-62.js +1 -1
  58. package/dist/entry-65.js +1 -1
  59. package/dist/entry-66.js +1 -1
  60. package/dist/entry-68.js +1 -1
  61. package/dist/entry-70.js +1 -1
  62. package/dist/entry-75.js +1 -1
  63. package/dist/entry-77.js +51 -43
  64. package/dist/entry-78.js +14 -14
  65. package/dist/entry-79.js +1 -1
  66. package/dist/entry-80.js +1 -1
  67. package/dist/entry-82.js +5 -5
  68. package/dist/entry-83.js +1 -1
  69. package/dist/entry-84.js +1 -1
  70. package/dist/entry-85.js +1 -1
  71. package/dist/entry-86.js +1 -1
  72. package/dist/pi-agent-ide.js +37 -9
  73. package/docs/agent-guides/editing.md +35 -46
  74. package/docs/agent-guides/git-changes.md +10 -0
  75. package/docs/agent-guides/read-resources.md +9 -50
  76. package/docs/agent-guides/search-code.md +18 -17
  77. package/docs/agent-guides/select-code.md +62 -140
  78. package/docs/agent-guides/terminal.md +9 -1
  79. package/docs/configuration.md +1 -1
  80. package/docs/releases.md +4 -0
  81. package/docs/research/native-codemode-batch-decision.md +2 -0
  82. package/docs/structured-results.md +27 -62
  83. package/docs/tools.md +15 -11
  84. package/node_modules/pi-agent-doctor/package.json +1 -1
  85. package/node_modules/pi-agent-documentation/package.json +1 -1
  86. package/node_modules/pi-agent-filesystem/index.ts +7 -6
  87. package/node_modules/pi-agent-filesystem/package.json +7 -7
  88. package/node_modules/pi-agent-filesystem-image/package.json +3 -3
  89. package/node_modules/pi-agent-filesystem-jq/index.ts +4 -3
  90. package/node_modules/pi-agent-filesystem-jq/package.json +5 -5
  91. package/node_modules/pi-agent-filesystem-jq/src/jq.ts +4 -1
  92. package/node_modules/pi-agent-filesystem-pdf/package.json +3 -3
  93. package/node_modules/pi-agent-filesystem-text/package.json +3 -3
  94. package/node_modules/pi-agent-ide-ast/package.json +13 -13
  95. package/node_modules/pi-agent-ide-ast/src/extension.ts +5 -4
  96. package/node_modules/pi-agent-ide-ast/src/overflow-handler.ts +2 -2
  97. package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +35 -9
  98. package/node_modules/pi-agent-ide-ast/src/select-presentation.ts +1 -1
  99. package/node_modules/pi-agent-ide-ast/src/select-schema.ts +10 -8
  100. package/node_modules/pi-agent-ide-ast/src/tool-select.ts +28 -3
  101. package/node_modules/pi-agent-ide-changes/index.ts +4 -3
  102. package/node_modules/pi-agent-ide-changes/package.json +8 -8
  103. package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +66 -4
  104. package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +8 -11
  105. package/node_modules/pi-agent-ide-formatter/package.json +3 -3
  106. package/node_modules/pi-agent-ide-languages/package.json +2 -2
  107. package/node_modules/pi-agent-ide-lint/package.json +7 -7
  108. package/node_modules/pi-agent-ide-lsp/index.ts +3 -3
  109. package/node_modules/pi-agent-ide-lsp/package.json +9 -9
  110. package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +5 -2
  111. package/node_modules/pi-agent-image/package.json +2 -2
  112. package/node_modules/pi-agent-invariant/package.json +1 -1
  113. package/node_modules/pi-agent-pdf/package.json +2 -2
  114. package/node_modules/pi-agent-read/package.json +7 -7
  115. package/node_modules/pi-agent-read/src/api/plugin-protocol.ts +1 -1
  116. package/node_modules/pi-agent-read/src/api/read-parameters.ts +38 -1
  117. package/node_modules/pi-agent-read/src/api/tools/read.ts +18 -1
  118. package/node_modules/pi-agent-read/src/core/extension.ts +8 -2
  119. package/node_modules/pi-agent-read/src/core/read-core.ts +54 -35
  120. package/node_modules/pi-agent-read/src/core/tools/read/output-truncation.ts +91 -18
  121. package/node_modules/pi-agent-read/src/core/tools/read/raw-read.ts +8 -2
  122. package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +38 -1
  123. package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +57 -2
  124. package/node_modules/pi-agent-read/src/core/tools/read/structured-result.ts +3 -3
  125. package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +108 -46
  126. package/node_modules/pi-agent-resource/package.json +1 -1
  127. package/node_modules/pi-agent-resource/src/index.ts +1 -0
  128. package/node_modules/pi-agent-resource/src/result-targets.ts +186 -9
  129. package/node_modules/{pi-agent-read/src/core/tools/read → pi-agent-resource/src}/temp-resource-store.ts +17 -7
  130. package/node_modules/pi-agent-resource/src/tool-result.ts +13 -1
  131. package/node_modules/pi-agent-search/package.json +5 -5
  132. package/node_modules/pi-agent-search/src/api/fuzzy.ts +5 -1
  133. package/node_modules/pi-agent-search/src/api/search-parameters.ts +3 -3
  134. package/node_modules/pi-agent-search/src/core/extension.ts +2 -1
  135. package/node_modules/pi-agent-search/src/core/search-core.ts +13 -4
  136. package/node_modules/pi-agent-search-text/index.ts +1 -1
  137. package/node_modules/pi-agent-search-text/package.json +7 -7
  138. package/node_modules/pi-agent-search-text/src/resolvers.ts +11 -1
  139. package/node_modules/pi-agent-search-text/src/scoped-search.ts +1 -1
  140. package/node_modules/pi-agent-search-text/src/search-presentation.ts +42 -32
  141. package/node_modules/pi-agent-search-text/src/search-recipe.ts +1 -1
  142. package/node_modules/pi-agent-search-text/src/search-renderer.ts +6 -0
  143. package/node_modules/pi-agent-search-text/src/search-result.ts +17 -3
  144. package/node_modules/pi-agent-text/package.json +2 -2
  145. package/node_modules/pi-agent-text-anchor-constant/package.json +3 -3
  146. package/node_modules/pi-agent-text-anchor-exact/index.ts +65 -4
  147. package/node_modules/pi-agent-text-anchor-exact/package.json +3 -3
  148. package/node_modules/pi-agent-text-anchor-exact/src/anchor.ts +12 -2
  149. package/node_modules/pi-agent-text-anchor-line-hash/index.ts +4 -3
  150. package/node_modules/pi-agent-text-anchor-line-hash/package.json +5 -5
  151. package/node_modules/pi-agent-text-editor/package.json +9 -9
  152. package/node_modules/pi-agent-text-editor/src/api/edit-completion.ts +2 -2
  153. package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +2 -1
  154. package/node_modules/pi-agent-text-editor/src/api/native-edit-batch-event.ts +4 -0
  155. package/node_modules/pi-agent-text-editor/src/api/stale-anchor-message.ts +1 -1
  156. package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +54 -12
  157. package/node_modules/pi-agent-text-editor/src/core/editing-guidelines.ts +1 -1
  158. package/node_modules/pi-agent-text-editor/src/core/extension.ts +10 -3
  159. package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +3 -13
  160. package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +35 -6
  161. package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +19 -1
  162. package/node_modules/pi-agent-text-editor/src/core/mutation-result-targets.ts +132 -11
  163. package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +232 -144
  164. package/node_modules/pi-agent-text-editor/src/core/post-edit-scope.ts +34 -10
  165. package/node_modules/pi-agent-text-editor/src/core/result-input.ts +24 -4
  166. package/node_modules/pi-agent-text-editor/src/core/result-transfer.ts +7 -2
  167. package/node_modules/pi-agent-text-editor/src/core/structured-result.ts +49 -214
  168. package/node_modules/pi-agent-text-editor/src/core/text-change-engine.ts +5 -1
  169. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +152 -22
  170. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +4 -0
  171. package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +76 -32
  172. package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +409 -209
  173. package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +1 -1
  174. package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +6 -9
  175. package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +10 -3
  176. package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +9 -4
  177. package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +7 -8
  178. package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +1 -1
  179. package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +3 -4
  180. package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +10 -4
  181. package/node_modules/pi-agent-text-editor-renderer/package.json +5 -5
  182. package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +11 -0
  183. package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +54 -5
  184. package/node_modules/pi-agent-text-editor-renderer/src/status-summary.ts +18 -3
  185. package/node_modules/pi-agent-text-editor-stale-anchor/package.json +4 -4
  186. package/node_modules/pi-agent-tool-call-interception/package.json +2 -2
  187. package/node_modules/pi-agent-tool-call-interception/src/index.ts +3 -0
  188. package/node_modules/pi-agent-tool-ui/package.json +1 -1
  189. package/node_modules/pi-agent-web/index.ts +4 -3
  190. package/node_modules/pi-agent-web/package.json +7 -7
  191. package/node_modules/pi-agent-web/src/resolver.ts +11 -13
  192. package/node_modules/pi-agent-web-html/package.json +2 -2
  193. package/node_modules/pi-agent-web-image/package.json +3 -3
  194. package/node_modules/pi-agent-web-pdf/package.json +3 -3
  195. package/node_modules/pi-agent-web-text/package.json +3 -3
  196. package/package.json +35 -35
  197. package/src/composite/nested-tool-rendering.ts +64 -6
  198. package/src/composite/output-limits.ts +125 -0
  199. package/src/composite/responses-tools.ts +25 -0
  200. package/src/composite/text-results.ts +372 -0
  201. package/src/documentation/extension.ts +11 -9
  202. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +7 -6
  203. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
  204. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +3 -3
  205. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/index.ts +4 -3
  206. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +5 -5
  207. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/src/jq.ts +4 -1
  208. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +3 -3
  209. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +3 -3
  210. package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +4 -3
  211. package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +7 -7
  212. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +2 -2
  213. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +3 -3
  214. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +3 -3
  215. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +3 -3
  216. package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/resolver.ts +11 -13
  217. package/src/extensions/pi-agent-read/package.json +7 -7
  218. package/src/extensions/pi-agent-read/src/api/plugin-protocol.ts +1 -1
  219. package/src/extensions/pi-agent-read/src/api/read-parameters.ts +38 -1
  220. package/src/extensions/pi-agent-read/src/api/tools/read.ts +18 -1
  221. package/src/extensions/pi-agent-read/src/core/extension.ts +8 -2
  222. package/src/extensions/pi-agent-read/src/core/read-core.ts +54 -35
  223. package/src/extensions/pi-agent-read/src/core/tools/read/output-truncation.ts +91 -18
  224. package/src/extensions/pi-agent-read/src/core/tools/read/raw-read.ts +8 -2
  225. package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +38 -1
  226. package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +57 -2
  227. package/src/extensions/pi-agent-read/src/core/tools/read/structured-result.ts +3 -3
  228. package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +108 -46
  229. package/src/extensions/pi-agent-search/package.json +5 -5
  230. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +1 -1
  231. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +7 -7
  232. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +11 -1
  233. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/scoped-search.ts +1 -1
  234. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-presentation.ts +42 -32
  235. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +1 -1
  236. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +6 -0
  237. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +17 -3
  238. package/src/extensions/pi-agent-search/src/api/fuzzy.ts +5 -1
  239. package/src/extensions/pi-agent-search/src/api/search-parameters.ts +3 -3
  240. package/src/extensions/pi-agent-search/src/core/extension.ts +2 -1
  241. package/src/extensions/pi-agent-search/src/core/search-core.ts +13 -4
  242. package/src/extensions/pi-agent-text-editor/package.json +9 -9
  243. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +3 -3
  244. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.ts +65 -4
  245. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +3 -3
  246. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/anchor.ts +12 -2
  247. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +4 -3
  248. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +5 -5
  249. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +5 -5
  250. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +11 -0
  251. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +54 -5
  252. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/status-summary.ts +18 -3
  253. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +4 -4
  254. package/src/extensions/pi-agent-text-editor/src/api/edit-completion.ts +2 -2
  255. package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +2 -1
  256. package/src/extensions/pi-agent-text-editor/src/api/native-edit-batch-event.ts +4 -0
  257. package/src/extensions/pi-agent-text-editor/src/api/stale-anchor-message.ts +1 -1
  258. package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +54 -12
  259. package/src/extensions/pi-agent-text-editor/src/core/editing-guidelines.ts +1 -1
  260. package/src/extensions/pi-agent-text-editor/src/core/extension.ts +10 -3
  261. package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +3 -13
  262. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +35 -6
  263. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +19 -1
  264. package/src/extensions/pi-agent-text-editor/src/core/mutation-result-targets.ts +132 -11
  265. package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +232 -144
  266. package/src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts +34 -10
  267. package/src/extensions/pi-agent-text-editor/src/core/result-input.ts +24 -4
  268. package/src/extensions/pi-agent-text-editor/src/core/result-transfer.ts +7 -2
  269. package/src/extensions/pi-agent-text-editor/src/core/structured-result.ts +49 -214
  270. package/src/extensions/pi-agent-text-editor/src/core/text-change-engine.ts +5 -1
  271. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +152 -22
  272. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +4 -0
  273. package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +76 -32
  274. package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +409 -209
  275. package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +1 -1
  276. package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +6 -9
  277. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +10 -3
  278. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +9 -4
  279. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +7 -8
  280. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +1 -1
  281. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +3 -4
  282. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +10 -4
  283. package/src/pi-agent-ide.ts +15 -1
  284. package/src/plugins/pi-agent-ide-ast/package.json +13 -13
  285. package/src/plugins/pi-agent-ide-ast/src/extension.ts +5 -4
  286. package/src/plugins/pi-agent-ide-ast/src/overflow-handler.ts +2 -2
  287. package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +35 -9
  288. package/src/plugins/pi-agent-ide-ast/src/select-presentation.ts +1 -1
  289. package/src/plugins/pi-agent-ide-ast/src/select-schema.ts +10 -8
  290. package/src/plugins/pi-agent-ide-ast/src/tool-select.ts +28 -3
  291. package/src/plugins/pi-agent-ide-changes/index.ts +4 -3
  292. package/src/plugins/pi-agent-ide-changes/package.json +8 -8
  293. package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +66 -4
  294. package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +8 -11
  295. package/src/plugins/pi-agent-ide-debugger/index.ts +22 -10
  296. package/src/plugins/pi-agent-ide-debugger/src/dap-client.ts +5 -0
  297. package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +93 -38
  298. package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +6 -3
  299. package/src/plugins/pi-agent-ide-formatter/package.json +3 -3
  300. package/src/plugins/pi-agent-ide-languages/package.json +2 -2
  301. package/src/plugins/pi-agent-ide-lint/package.json +7 -7
  302. package/src/plugins/pi-agent-ide-lsp/index.ts +3 -3
  303. package/src/plugins/pi-agent-ide-lsp/package.json +9 -9
  304. package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +5 -2
  305. package/src/plugins/pi-agent-ide-terminal/src/output-limits.ts +3 -3
  306. package/src/plugins/pi-agent-ide-terminal/src/resources.ts +8 -6
  307. package/src/plugins/pi-agent-ide-terminal/src/tools.ts +3 -3
  308. package/src/plugins/pi-agent-ide-vision/index.ts +13 -4
  309. package/src/post-edit/gate.ts +13 -2
  310. package/dist/chunk-3JO7QFIL.js +0 -1
  311. package/dist/chunk-4NIFBFFR.js +0 -11
  312. package/dist/chunk-64M3SQPG.js +0 -3
  313. package/dist/chunk-7LZKOHH2.js +0 -1
  314. package/dist/chunk-EAZGN5ND.js +0 -7
  315. package/dist/chunk-FK42RSF4.js +0 -1
  316. package/dist/chunk-KBP3QUDT.js +0 -2
  317. package/dist/chunk-KR36BT5E.js +0 -1
  318. package/dist/chunk-MBUXFKIW.js +0 -3
  319. package/dist/chunk-OE7QVAI2.js +0 -5
  320. package/dist/chunk-SILJ3OL4.js +0 -9
  321. package/dist/chunk-SQKAXYIR.js +0 -2
  322. package/dist/chunk-VCGNVTXQ.js +0 -1
  323. package/src/extensions/pi-agent-read/src/core/tools/read/temp-resource-store.ts +0 -105
@@ -1,151 +1,102 @@
1
1
  # Select source boundaries
2
2
 
3
- Use Search to find text or code by a predicate. Use Select when an existing target needs new text or structural boundaries. Ordinary JavaScript chooses returned items; it cannot grant source authority to reconstructed coordinates or strings.
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
4
 
5
- ## AST operations
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
6
 
7
- AST operations support JavaScript (.js/.mjs/.cjs) and TypeScript (.ts/.mts/.cts), without JSX/TSX. Syntax errors and unavailable providers are errors, not evidence of absence. Text operations do not require a parser.
7
+ ## Syntax operations
8
8
 
9
- ### Enclosing constructs
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
10
 
11
- Use `{kind:"object", object:"function"}` to find the nearest function containing the entire seed. An exact function selects itself. Set level:2 for the next outer function; levels count only the requested category. The optional relation/extent spellings remain enclosing/around. Enclosing can expand outside a Read/Search window and reports each input association and expansion. Seeds crossing separate constructs are rejected instead of choosing from their first character.
11
+ ### Enclosing constructs
12
12
 
13
- Supported object categories:
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
14
 
15
- - function: declarations, expressions, arrows, class/object methods, async/generator forms and bodyless TS signatures. Default parameter expressions belong to their function.
16
- - call: calls and new expressions.
17
- - class, if, switch, loop (for/for-in/for-of/while/do), try and catch.
18
- - binding: a variable declarator, not the surrounding const/let/var statement. assignment: ordinary and compound assignment expressions.
19
- - object/array: literals and destructuring patterns; property: key/value pairs and shorthand object properties.
20
- - return and throw.
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.
21
16
 
22
- These are syntax categories, not resolved symbol identities. Parser-only wrappers, punctuation, type nodes and comments do not become extra public construct categories. Class fields, JSX/TSX and other unlisted forms are not promised as constructs. ownBody is not implemented.
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.
23
18
 
24
19
  ### Navigate
25
20
 
26
- Use `{kind:"navigate", relation:"parent"}` on an exact named syntax node. Returned constructs skip parser-only wrappers. Exact part/capture targets can be used directly; if a text range cuts through a node, first use object/enclosing. When several nested nodes have identical bounds, the supported construct takes precedence; otherwise the innermost exact named node is the starting node. A whole-file seed is not implicitly split into constructs.
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.
27
22
 
28
- - parent returns the nearest normalized construct ancestor, excluding the starting node.
29
- - ancestors returns all normalized ancestors in source order, excluding the starting node.
30
- - children returns the nearest nested constructs. descendants returns all nested constructs. Neither includes the starting node.
31
- - siblings requires an exact normalized construct. direction previous/next returns its immediate neighbor under the same normalized parent; omit direction or use all for every other sibling. Top-level constructs share the document root. Missing parents/neighbors are valid absence.
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.
32
27
 
33
- Set object to filter results by category after navigation. A filter never changes topology: parent with object:function does not jump past an intervening call; children with object:call does not jump through an if. previous/next do not skip a different-category neighbor. Use ancestors/descendants when deeper matching constructs are wanted.
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.
34
29
 
35
- Ancestors and descendants can overlap. Choose the intended disjoint targets before editing; edit tools still reject overlapping writes. JavaScript chooses items by syntax.object or source/range; the item's stored target supplies source authority.
30
+ Ancestors and descendants can overlap. Narrow to disjoint targets before editing; edit tools reject overlapping writes.
36
31
 
37
32
  ### Named parts
38
33
 
39
- Use `{kind:"part", part:"arguments"}` on an exact construct. Parts retain provider boundaries and delimiters: a function block body includes braces, parameter/argument lists include parentheses, return/type annotations include their colon, and an else/finalizer clause includes its keyword. A single unparenthesized arrow parameter has no invented parentheses; an expression arrow body is its exact expression.
40
-
41
- | Construct | Supported parts |
42
- | ----------------------------------------- | ---------------------------------------------------------- |
43
- | function | name, parameters, returnType, body |
44
- | call/new | callee, arguments |
45
- | class | name, body |
46
- | if | condition, then, else |
47
- | switch | condition, body |
48
- | classic for | initializer, condition, update, body |
49
- | for-in / for-of | left, iterable, body |
50
- | while / do | condition, body |
51
- | try | body, handler, finalizer |
52
- | catch | parameter, body |
53
- | finally clause returned by part/finalizer | body |
54
- | binding | name, type, value |
55
- | assignment | left, right |
56
- | property | key, value; shorthand selects the same identifier for both |
57
- | return / throw | value |
58
-
59
- A supported optional part that is absent produces no selection and increments missingInputs: anonymous function name, optional else, bodyless TS declaration, missing annotation, bare return, optional catch parameter, or new without arguments. Unsupported parts return an error listing available names. Objects and arrays do not invent a body or arguments part; use navigation for nested constructs and AST Search for scalar elements. For argument/parameter separator ownership, use elementExtent below; array/object list extents are not implemented.
60
-
61
- Structural items include parser-derived syntax.object and, for part selections, syntax.part where a normalized owner exists. These labels are descriptive, not editable authority. Read takes the item's target string; its displayed line context never widens the exact part's source scope.
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.
62
55
 
63
56
  ```js
64
57
  const found = await tools.search({ path: "client.ts", query: "ast:send($$$ARGS)" });
65
58
  const call = await tools.select({ path: found, operation: { kind: "object", object: "call" } });
66
59
  const args = await tools.select({ path: call, operation: { kind: "part", part: "arguments" } });
67
- await tools.read({ path: args.data.target });
60
+ text(await tools.read({ path: args }));
68
61
  const number = await tools.search({ path: args, query: "10" });
69
62
  await tools.replace({ path: number, text: "20" });
70
63
  ```
71
64
 
72
- ## List element extents
73
-
74
- Use `{kind:"elementExtent", extent:"inside"}` on an exact direct JS/TS call/new argument or parenthesized function/method/arrow parameter. AST captures can provide those element targets. Variadic captures may also contain punctuation; choose the element items in JavaScript before passing them here. Commas themselves are not elements. A typed/default parameter must include its type/default, not just its name. Partial expressions, whole lists, array/object elements and unparenthesized arrow parameters are unsupported; this operation never silently selects an enclosing element.
75
-
76
- `inside` keeps only the element. `around` adds owned comma/whitespace, reports expansion and preserves list parentheses:
65
+ ### List element extents
77
66
 
78
- | Element | around includes |
79
- | ----------------------------------- | -------------------------------------------------------------------------------------- |
80
- | First or middle with a next element | Element through the next element's start, including the following comma and whitespace |
81
- | Last with a trailing comma | Element through the closing parenthesis, excluding the parenthesis |
82
- | Last without a trailing comma | Previous element's end through this element's end; keeps closing whitespace |
83
- | Only element | Entire list interior, including leading/trailing whitespace and any trailing comma |
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.
84
68
 
85
- Both adjacent gaps must contain only the expected comma and whitespace for around. Comments in those gaps return AMBIGUOUS_LIST_TRIVIA instead of guessing their owner. Comments inside the element are retained. inside does not assign neighboring trivia and remains available when an around request is refused.
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.
86
70
 
87
- Example: `send(a, b, c)` selects `b, ` around b and `, c` around c. Removing either single extent preserves the comma structure. Several selected extents can overlap: edit tools still reject overlap; do not assume arbitrary bulk deletion is repaired. Source bytes and CRLF stay exact.
88
-
89
- Copy/move transports precisely the selected bytes, not a refactoring. A following-comma extent can be inserted before an existing destination element; a preceding-comma extent can be inserted after one. Destination syntax, parameter ordering and semantic validity are the caller's responsibility. Read the extent's target to preview it before editing. No new edit input contract or implicit syntax repair is provided.
90
-
91
- ```js
92
- const found = await tools.search({ path: "client.ts", query: "ast:send($FIRST, $MIDDLE, $LAST)" });
93
- const element = await tools.select({
94
- path: found.data.matches[0].captures.MIDDLE,
95
- operation: { kind: "elementExtent", extent: "around" },
96
- });
97
- await tools.read({ path: element.data.target });
98
- await tools.delete({ path: element });
99
- ```
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.
100
72
 
101
73
  ## Text operations
102
74
 
103
- Use `operation.kind` to choose a text transformation:
104
-
105
- - `range` with startLine/startColumn/endLine/endColumn selects absolute source coordinates in one source. Lines are one-based, columns UTF-16 and the end exclusive. The entire requested range must fit one input region.
106
- - `lines` with first/last selects inclusive absolute complete lines in one source, including their existing line endings. Require containment in one input region.
107
- - `between` with non-empty literal start/end markers and extent inside/around/lines pairs the next opening marker with the nearest following closing marker, then resumes after that pair. inside excludes markers; around includes them; lines explicitly expands to complete containing lines. There is no nesting or bracket balancing. Identical markers pair successive occurrences. An unmatched opening is an error; no opening is valid absence.
108
- - `sliceText` with non-negative from and optional to slices each region by relative UTF-16 offsets. to is exclusive and defaults to the region end. This slices source text, not the items array.
109
- - `trim` with side start/end/both removes Unicode whitespace from those edges of each region. Whitespace-only input returns a zero-width point at its end.
110
- - `split` with a non-empty literal delimiter returns segments without the delimiter. Empty segments remain zero-width points.
111
- - `linesOf` explicitly expands each region to its complete containing lines. An exclusive end at next-line column zero leaves that untouched next line out.
112
- - `position` with edge before/after returns each region's zero-width start/end. Use a whole-file Read for file edges.
113
- - `columns` with from/to returns the exclusive UTF-16 column interval on each touched line, without line endings. Every interval must fit both its line and input scope.
114
-
115
- Except for range/lines, apply each operation independently to every input region. Keep files and sparse gaps separate; markers or delimiters cannot span those gaps. Invalid bounds, short-line columns and boundaries inside surrogate pairs or CRLF are errors, not clipped ranges. Preserve original CRLF/LF/bare-CR endings and unterminated EOF. Only linesOf and between/lines explicitly expand text input and report expansion.
116
-
117
- Resolve registered anchors through existing Read inputs, then pass their verified target to Select. Use Search for regex captures rather than a second regex language inside Select. Use JavaScript array slice/filter to choose items; use sliceText to derive source boundaries.
118
-
119
- ```js
120
- const source = await tools.read({ path: "notes.txt", offset: 2, limit: 1 });
121
- const inside = await tools.select({
122
- path: source,
123
- operation: { kind: "between", start: "<", end: ">", extent: "inside" },
124
- });
125
- const value = await tools.select({
126
- path: inside,
127
- operation: { kind: "trim", side: "both" },
128
- });
129
- await tools.read({ path: value.data.target });
130
- await tools.replace({ path: value, text: "new value" });
131
- ```
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.
132
84
 
133
- Select works as an ordinary tool as well as inside native Codemode. A position can be consumed by replace or a paired copy/move destination for exact insertion. insert keeps its string-path/anchor contract.
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.
134
86
 
135
87
  ## Range sets
136
88
 
137
- Use path for candidates and operation.scopes for comparison scopes. Both accept verified results/data/targets/item arrays and readable source strings. Match sets by file and snapshot, never by array order; different files do not match. Every input is verified even when it has no counterpart. Stale or incompatible snapshots reject the operation.
138
-
139
- - within retains a complete candidate only when one scope contains it. It does not clip or join adjacent scopes for containment.
140
- - intersection clips each candidate to the union of comparison scopes.
141
- - difference subtracts the union of scopes from each candidate and returns separate surviving fragments.
142
- - merge explicitly joins overlapping candidates. Set adjacent:true to also join touching nonempty ranges; default false. Never fill a real gap.
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.
143
90
 
144
- Clipping/subtraction keeps different candidate seeds separate. Equal output geometry is deduplicated; origins retain the candidate associations, not comparison scopes. Merge retains every contributor and reports its expansion relative to each candidate.
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.
145
95
 
146
- A point belongs to a nonempty [start,end) range at its included start but not its excluded end. Equal points match. Intersection with an explicit point keeps that point when contained; touching nonempty text does not create a point. Difference removes covered candidate points, but subtracting a point does not cut text. Merge absorbs covered points and keeps other points separate without extending text or bridging gaps. EOF points are outside a range ending at EOF.
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.
147
97
 
148
- Empty comparison scopes make within/intersection empty and difference unchanged. Empty candidates stay empty. Binary output complete is the conjunction of both inputs, including unmatched comparison files. Incomplete scopes do not establish absence or authorize an edit. missingInputs counts candidates that produce no output.
98
+ Empty scopes make within/intersection empty and difference unchanged. Incomplete inputs cannot establish absence or authorize edits. Select never writes or formats.
99
+ Repeat the operation after interruption. Do not treat cancellation as an empty result.
149
100
 
150
101
  ```js
151
102
  const candidates = await tools.search({ path: "notes.txt", query: "regex:<[^>]+>" });
@@ -158,37 +109,8 @@ const found = await tools.search({ path: editable, query: "old" });
158
109
  await tools.replace({ path: found, text: "new" });
159
110
  ```
160
111
 
161
- ## Source inputs and results
162
-
163
- path accepts compatible Read/Search/mutation/Select results, their data, RESULT# references and arrays of returned items. A file path obtains a fresh whole-file Read snapshot; the chosen operation still must make sense for that entire seed. A multi-function file is not implicitly split into functions.
164
-
165
- The result has kind selection, a complete stored target, items with individual targets, exact ranges and original-input associations, complete, totalItems, missingInputs and truncated. Lines are one-based and columns are UTF-16; character ends are exclusive. Identical output geometry is deduplicated while origins retain the separate input ranges. Empty results remain valid source sets. Unsupported part inputs, ambiguity and stale/expired inputs are errors.
166
-
167
- Items are limited to 100 and each text preview to 1000 UTF-16 code units. truncated describes presentation, not execution completeness. The top-level target retains all selected ranges. complete inherits input completeness; an incomplete result cannot establish absence or safely authorize edits. Source snapshots stay strict: refresh Read/Search after edits, session changes or reload. Select never writes or runs formatting.
168
-
169
- ## Compose with existing tools
170
-
171
- ```js
172
- const calls = await tools.search({ path: "client.ts", query: "ast:legacyRequest($OPTIONS)" });
173
- const owners = await tools.select({
174
- path: calls,
175
- operation: {
176
- kind: "object",
177
- object: "function",
178
- relation: "enclosing",
179
- level: 1,
180
- extent: "around",
181
- },
182
- });
183
- const body = await tools.select({
184
- path: owners.data.items[0],
185
- operation: { kind: "part", part: "body" },
186
- });
187
- const retry = await tools.search({ path: body, query: "ast:retry($$$ARGS)" });
188
- ```
189
-
190
- A body includes nested functions. To test for retry in that function's own body, select each retry call's nearest enclosing function and compare its source/range to the original owner. This keeps outer retry calls containing callbacks while excluding calls in nested functions or their default parameters. Do not establish absence from incomplete Search or clipped items.
112
+ ## Composition limits
191
113
 
192
- For the initial timeout scenario, retain the original legacyRequest calls associated with eligible owners, use AST captures for inline object-literal options and their direct timeout values, preview, then replace only those values. Do not edit unrelated or nested-object properties, resolve variables, or imply semantic identity from a syntactic call name.
114
+ 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.
193
115
 
194
- Search and compatible edits consume selection results through their stored targets. Read keeps its existing string-path schema: pass the result's target (for example, `read({path:body.data.target})`), not the whole object. Its whole-line context does not change the exact selection target. Whole-file write/undo still reject partial selections; selection never widens their guards. insert keeps its existing string/anchor contract. Formatting at the end of a native Codemode script may invalidate earlier selection targets just like other source results.
116
+ 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.
@@ -2,6 +2,14 @@
2
2
 
3
3
  Use the registered shell tool (`bash` or `powershell`) for project commands. Check its command parameter for the actual shell and write that shell's syntax; do not infer syntax from the tool name or operating system. Keep short commands in the foreground. Start servers, watchers, and long builds with `background: true`; continue other work rather than polling. Read the returned `shell:<session>` resource for status and bounded output. Search that resource to locate retained output outside the current tail.
4
4
 
5
+ Check `status` and `exitCode` before treating a process as successfully completed. A returned background session or a released foreground wait is not a completion report. A timeout, detected input prompt, or turn interruption releases the wait without stopping a live process. Read the same `shell:` source to continue; it also survives extension reloads.
6
+
7
+ Send input only when `status` is `running`. Do not treat `stopping`, `stopped`, or `cancelled` as a preserved interactive wait. Before retrying a failed or interrupted command, inspect any returned session. If no source was returned, use `process:<query>` search to check for a process that may have started. Failure does not undo command side effects.
8
+
9
+ Use the log path in a truncation notice to inspect omitted output.
10
+
5
11
  Use `write` on a shell resource to send exact text without Enter. Use `insert` for named keys and chords such as `Enter`, `Ctrl+C`, or `Up`. Delete a shell resource to terminate and remove the session. Add the `image` view only when cursor position, ANSI layout, or a full-screen interface matters. Use a bounded `sequence:duration=<seconds>,interval=<seconds>,scale=<ratio>` view when changes over time matter.
6
12
 
7
- Use `process:<query>` search before reading `process:<PID>` or capturing `window:<PID>`. Do not assume silent background work has completed.
13
+ Use `process:<query>` search before reading `process:<PID>` or capturing `window:<PID>`.
14
+
15
+ If a session returns as running in background and no independent work remains, finish your turn instead of polling. Pi wakes the agent when the session completes. A still-running session also gets one inspection notice after two minutes without terminal activity, once the agent is idle. Read the session when that notice arrives and decide whether to keep waiting, send input, or delete it. An inspection notice is not proof of failure or completion.
@@ -75,7 +75,7 @@ Built-in entry modules are imported only after selection. Disabled built-ins, in
75
75
 
76
76
  ## Animations and post-edit processing
77
77
 
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.
78
+ Standalone editing tools validate source snapshots before writing. Native Codemode commits eligible pending local edits before a dependent tool or when the script ends. Accepted child calls are not proof of persistence. Ordinary script errors keep accepted edits; aborts discard only pending work. Batched edits finish formatting and diagnostics at script end. Write commits earlier pending edits and finishes its own post-edit processing before returning. Text copy/move destinations receive post-processing; binary contents stay unchanged.
79
79
 
80
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.
81
81
 
package/docs/releases.md CHANGED
@@ -14,6 +14,10 @@ Squash-merging `develop` into `main` makes their histories diverge. The **Synchr
14
14
 
15
15
  See [Develop nightly](nightly.md). Nightlies test a pinned `develop` commit and keep an installable package and test reports in GitHub Actions for 30 days. They do not publish to npm.
16
16
 
17
+ ## Flaky debugger checks
18
+
19
+ Real debugger integration tests and adapter/platform jobs still run, but their results are non-blocking and kept outside the shared CI test totals and badges. They have separate jobs and reports marked flaky. A failed debugger job does not reject a release candidate. Pure debugger unit tests, other source/runtime checks, and editor tests remain blocking. In particular, Delete is not part of this exception.
20
+
17
21
  ## Start a release
18
22
 
19
23
  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.
@@ -2,6 +2,8 @@
2
2
 
3
3
  This records the original batching decision. LPT-403 later removed Apply without changing the native batching policy.
4
4
 
5
+ LPT-439 later made Write immediate: pending edits commit before Write, and Write saves and finishes its post-edit processing before returning. If an existing file already matches the supplied content, Write returns its whole-file selection without writing or running post-edit handlers. A missing empty file is still created. Write does not join the pending batch. The policy below still applies to other eligible text edits.
6
+
5
7
  ## Question
6
8
 
7
9
  Should sequential editor calls in native Codemode share only original coordinates, or also one combined write, and where should that batch end?
@@ -1,86 +1,51 @@
1
- # Native IDE results
1
+ # Readable IDE results and private records
2
2
 
3
- Read, Search, text mutations, diff, Git index tools, and debugger creation declare an `outputSchema` and return `structuredContent`. Native Codemode receives that object. Normal calls keep their readable content and existing renderers. Renderer `details` are not a script API.
3
+ IDE tools expose readable text in direct calls and native Codemode. The existing Read views, Search anchors, edit effects and diffs remain the agent-facing output. Select shows its selected text and item references. Agents do not receive the private result records or need to inspect their fields.
4
4
 
5
- The shared envelope is:
5
+ ## Composition
6
6
 
7
- ```ts
8
- { status: "success", data: /* tool data */, errors: [] }
9
- { status: "error" | "partial", data?: /* observed data */, errors: [{ code, message, source? }] }
10
- ```
11
-
12
- `success` means the requested operation completed, including a search with no matches. `partial` means some work completed while other work failed. Output clipping is reported separately; it does not make a successful read an execution failure. `error` and `partial` set native `isError`.
13
-
14
- Check `status` before using data. Domain errors with structured results resolve in native Codemode; they do not automatically throw. Invalid arguments, blocked calls, and cancellation can still reject. A mutation error does not imply rollback. Check its observed effects before retrying.
15
-
16
- ## Data by tool
17
-
18
- - **Read:** `kind` is `text`, `bytes`, `native`, or `resources`. Text has original numbered `lines`, line endings, optional editable `anchors`, and source-level `references`. Bytes have exact `bytes: number[]`, byte offset, selected length, and total size. Native content has ordered text/image `blocks`; pass an image block to `image(...)`. Multi-source selections keep separate child resources.
19
- - **Search:** `matches` have a source, exact line/column range, optional matched text, and optional `references.line` / `references.match` selectors. Columns are zero-based UTF-16 offsets. `complete` describes the backend search; `truncated` describes the public window. `all` selectors exist only for complete registered selections. File searches return paths. Other resolvers return their documented JSON domain data under `kind: "custom"`.
20
- - **Mutations:** `operationId` identifies the call. `effect` and per-source `files` distinguish `pending`, `applied`, `not-applied`, and `unknown`. Recovery candidates and semantic action fields are included when available. `files[].state` reports present/absent/unknown when known. `changes` records exact removed/inserted text and before-snapshot UTF-16 offsets; it is inspection data, not a selector. If that record exceeds 512 KiB serialized, it is omitted with `changesUnavailable`, without clipping text or losing applied effects. Full before/after documents are not copied into receipts.
21
- - **Flush:** `operations` link final effects and errors to accepted child call IDs. It also returns per-source effects. An empty flush succeeds with no operations. A failed flush retains writes that happened and never replays accepted edits.
22
- - **Diff:** returns source identities, equality, added/removed counts, and bounded unified diff text. It does not repeat both source documents.
23
- - **Git index tools:** return action, change selector, file, index state, observed effect, and whether it was already in the requested state.
24
- - **Debugger:** creation returns session, source, and breakpoint resource references plus configuration and status. Debugger mutation actions return selected breakpoint or evaluation fields, not full session snapshots.
25
-
26
- ## Source result composition
27
-
28
- Exact filesystem text Read results and local text/regex, AST, and LSP Search results expose an optional `target: "RESULT#..."`. Each public Search match also has its own target. These handles resolve backend-owned source ranges and snapshots; serializable preview fields do not grant or change write authority.
29
-
30
- Native `search.path`, `replace.path`, `delete.path`, and copy/move `path` / `target` accept a successful result envelope, its data, a target handle, or arrays of compatible results/matches. `write.path` and `undo.file` accept only a single whole-file target; partial scopes never widen to a whole file. A whole result retains its complete stored scope even when its public window is shortened. Pass a matches array to narrow the scope explicitly. Read lines projected to strings or arbitrary coordinates are not editable targets.
7
+ Each result starts with a labelled system-result envelope containing a random UUID. It is not part of a file and must not be edited or inserted into file contents.
31
8
 
32
9
  ```js
33
- const read = await tools.read({ path: "note.txt", offset: 2, limit: 2 });
34
- if (read.status !== "success") throw new Error(JSON.stringify(read.errors));
35
- const found = await tools.search({ path: read, query: "old" });
36
- if (found.status !== "success") throw new Error(JSON.stringify(found.errors));
37
- const changed = await tools.replace({ path: found.data.matches.slice(0, 1), text: "new" });
38
- if (changed.status !== "success") throw new Error(JSON.stringify(changed.errors));
39
- text(changed);
10
+ const source = await tools.read({ path: "notes.txt" });
11
+ const matches = await tools.search({ path: source, query: "old" });
12
+ const selected = await tools.select({ path: matches, operation: { kind: "trim", side: "both" } });
13
+ text(await tools.replace({ path: selected, text: "new" }));
40
14
  ```
41
15
 
42
- Targets belong to the active session/runtime and worktree. A new session, reload or shutdown clears the store. Changing any source bytes makes a non-empty retained target stale; re-read or re-search rather than refreshing implicitly. Existing string `SEARCH#:all` selectors retain their separate refresh policy.
16
+ Pass the unchanged result to a supported source parameter. Direct calls also accept its UUID. Store/load retains the result string across scripts in the same session. Displayed item and capture references allow narrower selections without inspecting private arrays.
43
17
 
44
- Scoped text Search runs each range separately through ripgrep and maps matches back to source UTF-16 coordinates. AST and LSP providers can inspect full documents internally but return only provider ranges wholly contained in one declared region. AST matches expose associated `captures.NAME` arrays of source targets, including every node of a multi capture. LSP matches expose `role` and the originating `symbol` with its provider declaration identity and exact range. Use `navigation: "references"` explicitly to follow symbols represented in the seed scope to references outside it, within the workspace. It preserves inherited completeness and deduplicates by source/range identity. Text Boolean queries and text include/exclude globs remain unsupported for result scopes; AST/LSP keep their provider filters. Unsupported provider/scope combinations fail without falling back to a wider search. Replace rejects incomplete input and contradictory snapshot versions before writing, preserves ordinary resource and mutation guards, and treats an empty set as an explicit successful no-op. Preview edits, deleted diff text, bytes, images and derived views without an exact filesystem mapping cannot supply arbitrary edit targets.
18
+ A result identifies its backend-owned ranges, not the text in its preview. Shortened output does not clip a complete selection or make an incomplete selection complete. Read around a selection may show context without granting authority to edit it.
45
19
 
46
- ### Possible-name groups
20
+ ## Reference ownership
47
21
 
48
- After a complete zero result, eligible local and URL identifier searches can add `fuzzy: { status, message?, candidates }`. The original `matches` stays empty. Each candidate has `identifier`, a mechanical `kind` and `reason`, captured `matchCount` and `fileCount`, and a separate `selection` using the normal match/range/reference fields.
22
+ The session registry issues UUIDs and maps them to source handles. A guessed or computed hash has no authority unless the registry issued that reference. UUIDs are opaque references, not content hashes or signatures.
49
23
 
50
- Candidate selections show at most three locations. Their `truncated` flag describes that display window; `complete` describes the exact alternative's capture. Limited capture has lower-bound counts and no complete `all` reference. URL candidates use URL ranges, never editable Search references. A `skipped` branch explains its budget or extra-branch failure without changing the completed ordinary zero into an error.
24
+ The registry validates session/worktree ownership, exact full-output identity, successful source status and live snapshots. Copying a valid ID within its session is intentional reuse, not forgery. Altering the body while keeping the envelope is rejected. An ID cannot grant wider ranges than its original selection.
51
25
 
52
- Registered local candidate selections also expose immutable whole-scope and per-match targets. Their stored scope retains all captured matches even when the candidate preview shows only three. The original zero result remains an empty edit scope. Structured result-scoped queries do not run fuzzy discovery.
26
+ Changed files permanently retire old source and derived references. Restoring the old bytes does not revive them. Actual edit completions and script boundaries observe filesystem generations; retained source bytes are verified before use. Reload and session changes clear the registry.
53
27
 
54
- ## Native editor commits
28
+ Pending edits reserve source handles without granting authority to unconfirmed writes. A dependent source operation commits the batch before using such a handle. Failed or cancelled edits cannot confirm it. Independent peer edits retain their original snapshots until the common commit.
55
29
 
56
- Sequential local edits share original snapshots. Child success with `effect: "pending"` means accepted, not written. Await an explicit flush when the script needs the final receipt:
57
-
58
- ```ts
59
- const found = await tools.search({ query: "old", path: "note.txt" });
60
- if (found.status !== "success") throw new Error(found.errors[0].message);
61
- const changed = await tools.replace({ path: found.data.matches[0].references.match, text: "new" });
62
- if (changed.status !== "success") throw new Error(changed.errors[0].message);
63
- const saved = await tools.flush({});
64
- text(saved);
65
- ```
30
+ Read-only views, raw bytes, images and directory listings do not acquire text-edit authority. Their IDs can identify the resource for another read. Live shell/debugger references can be used only with their owning resource operations. File deletion supplies no reusable text selection.
66
31
 
67
- Resource-owned selectors may commit immediately rather than joining the local batch. Another tool or parent completion also commits pending local edits. The parent Codemode result records automatic commits in `details.editorBatchResults`; those reports contain receipts, not source snapshots. Ordinary script errors keep accepted independent edits. Abort and deadline discard pending edits but do not undo earlier commits.
32
+ ## Internal records
68
33
 
69
- ## Bounds and continuation
34
+ Each tool owns its validated record. Read, Search, Select, Diff, terminals, Git and debugger operations keep their own domain adapters. File edit receipts contain only operation, observed effect, file states and an optional verified selection handle. Delete omits selection fields. The parent Codemode result retains committed operation effects and errors.
70
35
 
71
- Public structured results must be finite plain JSON and fit within 1 MiB. Text windows keep at most 2,000 lines and 512 KiB of serialized line data. Raw byte windows keep at most 32,768 bytes, within the normal raw-read display budget. Ordinary Search match previews keep the first 100 matches and at most 4 KiB of matched text per match; a whole result's target retains its full registered scope. AST capture arrays retain every captured node for each visible parent match, within the shared JSON budget. Huge indivisible capture data fails explicitly rather than silently dropping nodes.
36
+ The text registry stores only ownership, a digest of the issued text, source references, resource identities and whether the result can be consumed. It does not copy line arrays, removed file contents, image bytes or debugger records into a second ledger. Source ranges and snapshots remain in the source-target store.
72
37
 
73
- Read `continuation` is a complete next request with a resolved source and absolute offset. Follow it rather than recomputing offsets from a rendered annotation. `fullResult` identifies retained complete output when available. A huge indivisible block or invalid adapter returns an explicit error rather than a clipped success. Temporary references belong to their runtime.
38
+ The unified registration adapter omits public outputSchema. Pi's supported Codemode execution path therefore returns each tool's existing text instead of structuredContent. Public tool_result hooks register the private source metadata and return the readable text with its envelope. This does not modify Pi, rewrite scripts, add VM methods, or recognize JSON in Codemode output.
74
39
 
75
- Native structured content is not copied into stored session messages. Existing compact renderer details stay separate. Scripts that explicitly print large data still store what they print.
76
- Guides attached to native structured child calls stay on the readable parent result, even when the script prints only selected data. They do not become fields in the public data schema.
40
+ Nested image blocks are delivered on the parent Codemode result; their bytes are not printed as text. Images remain ordinary native image content.
41
+ Read's private native record contains image type and MIME metadata, not another copy of the image bytes. Large images therefore do not overflow the JSON-record budget while their native content stays unchanged.
77
42
 
78
- ## Resolver adapters
43
+ ## Errors and writes
79
44
 
80
- Search resolvers must provide `toScriptData(payload, formattedDetails)`. Select documented JSON domain fields or use `selectionData` from `pi-agent-search/api/search`. Missing adapters fail with `STRUCTURED_ADAPTER_REQUIRED`; invalid schema or non-JSON values fail with `INVALID_STRUCTURED_RESULT`. Neither case falls back to display-text parsing or raw payload dumping.
45
+ Failed tools reject in Codemode. Use try/catch or Promise.allSettled when independent calls may fail. Inspect the readable file/operation effects and final parent result before retrying. An error does not prove rollback.
81
46
 
82
- Standard Read Resources use the core text/bytes/native projection. Read handlers that return their own result must supply `script: ReadScriptData`; custom content needs an explicit supported projection. Source-level references and line anchors come from presenters, not parsed annotations.
47
+ Automatic batch boundaries save pending edits, not their final formatting. Write finishes its own post-edit processing before returning. Final post-edit processing can retire earlier snapshots. Ordinary script errors keep accepted edits; abort/deadline discards pending writes, not already committed batches.
83
48
 
84
- The shared validation helpers live in `pi-agent-resource`. Read and Search export their data/output schemas through their existing public tool APIs. Text mutation schemas and `structuredMutation` are exported through `pi-agent-text-editor/api/mutation-result`.
49
+ After an exact-text selector fails, the tool returns current anchors and blocks further exact-text edits for that file. Use a current anchor for the next successful edit. Exact text is then available again.
85
50
 
86
- Shell command results keep their separate native process contract. This change does not add a shared result store, cross-session handles, binary editing, or grouped rollback.
51
+ See [editing](./agent-guides/editing.md), [Read](./agent-guides/read-resources.md) and [Select](./agent-guides/select-code.md) for their source and boundary contracts.
package/docs/tools.md CHANGED
@@ -4,9 +4,17 @@ 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
- ## Native structured results
7
+ ## Readable results and composition
8
8
 
9
- IDE tools declare native result schemas. Codemode receives typed data and explicit success/error/partial outcomes instead of display strings. Check status and mutation effects before continuing or retrying. See [Native IDE results](./structured-results.md) for fields, resolver adapters, bounds, and `tools.flush({})`.
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.
10
+
11
+ ## Shared output limits
12
+
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.
14
+
15
+ 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
+
17
+ An explicit request limit still selects what the tool produces; the saved file does not undo that filter. Truncation does not shorten private source selections or change file-edit effects. Terminal results also link to their complete session log.
10
18
 
11
19
  ## Resource references
12
20
 
@@ -38,7 +46,7 @@ A source field such as `path` or mutation `target` is therefore a resource field
38
46
  - AST-aware code views;
39
47
  - LSP diagnostics, symbols, references, and call graphs.
40
48
 
41
- A read result may include anchors, diagnostics, Git changes, or structural markers. Large text results are bounded, and supported resolvers can retain the complete output in a temporary resource.
49
+ 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.
42
50
 
43
51
  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.
44
52
 
@@ -52,7 +60,7 @@ When `path` is a typed text resource, `read` returns one independent chunk for e
52
60
 
53
61
  Use `read({path: "raw:sample.bin", offset: 0, limit: 64})` to inspect original local file bytes, including PDF and image headers. In `raw:` mode only, offset is zero-based in bytes (negative from EOF), and limit is a non-negative byte count. The output shows hexadecimal offsets, hex bytes, and printable ASCII. Follow its returned byte offset to continue. No views or text anchors apply.
54
62
 
55
- Inside native Codemode, check the result’s `status` and use `data.kind: "bytes"`, `source`, `byteOffset`, `byteLength`, `totalBytes` and `bytes: number[]`. The script receives the complete selected range; the displayed answer stays bounded. Use `text(result)` to retain the hex view rather than printing the byte array. This is read-only; byte editing and byte diff are not included.
63
+ 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.
56
64
 
57
65
  ### Diagnostic completion
58
66
 
@@ -76,16 +84,12 @@ Window and display capture use `node-screenshots` on Linux and macOS. Desktop or
76
84
 
77
85
  ## Terminal sessions
78
86
 
79
- Native Codemode scripts receive a structured shell result. `output` holds up to 1 MiB of ANSI-free PTY output; empty output is `""`. Longer logs keep their first and last 512 KiB, cut at UTF-8 character boundaries. `truncated` reports missing output, not whether the process has finished. `output_ranges` gives the zero-based, end-exclusive byte ranges joined into `output`, with no added headings or omission marker. `full_output_path` points to the UTF-8 log, which keeps growing while the process runs and stays available until the session is deleted.
80
-
81
- The native fields `exit_code` and `wall_time_seconds` describe the process, not tool transport. `exit_code` is absent until known. IDE fields `session`, `source`, `status`, `background`, `wait_reason`, `completion_reason`, `signal`, and `error` describe the persistent session. A wait timeout leaves a running session, not a failed command. Nonzero exits and shell startup failures still return structured data to scripts. Normal model output and stored renderer details keep the shorter terminal preview limits.
87
+ 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.
82
88
 
83
89
  ```ts
84
90
  const result = await tools.bash({ command: "your-command" });
85
- text({
86
- status: result.status,
87
- errors: result.output.split("\n").filter((line) => line.includes("error")),
88
- });
91
+ text(result);
92
+ text(await tools.read({ path: result }));
89
93
  ```
90
94
 
91
95
  `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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-doctor",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-documentation",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "type": "module",
5
5
  "types": "./src/index.ts",
6
6
  "exports": {