pi-agent-ide 0.6.4 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (395) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +2 -2
  3. package/dist/{chunk-AWXVJ5AC.js → chunk-2RTCSZB3.js} +1 -1
  4. package/dist/{chunk-QEJGED4V.js → chunk-3HYXQ4YA.js} +1 -1
  5. package/dist/chunk-3JO7QFIL.js +1 -0
  6. package/dist/{chunk-5J43L2RL.js → chunk-4NIFBFFR.js} +1 -1
  7. package/dist/{chunk-BSICWXMH.js → chunk-64M3SQPG.js} +1 -1
  8. package/dist/{chunk-3BBJZSMS.js → chunk-7LD2OQH3.js} +1 -1
  9. package/dist/chunk-7LZKOHH2.js +1 -0
  10. package/dist/chunk-AJRIASPQ.js +2 -0
  11. package/dist/chunk-EAZGN5ND.js +7 -0
  12. package/dist/{chunk-GIRAEVUJ.js → chunk-F5YZG77W.js} +1 -1
  13. package/dist/chunk-FK42RSF4.js +1 -0
  14. package/dist/{chunk-WJTHY6AG.js → chunk-FXNKMNSJ.js} +1 -1
  15. package/dist/chunk-GBLKIB6O.js +2 -0
  16. package/dist/{chunk-KUPHNMUK.js → chunk-KBP3QUDT.js} +1 -1
  17. package/dist/{chunk-VBICI5YA.js → chunk-KR36BT5E.js} +1 -1
  18. package/dist/chunk-OE7QVAI2.js +5 -0
  19. package/dist/chunk-PNU3E7IO.js +3 -0
  20. package/dist/chunk-PS2B6THP.js +3 -0
  21. package/dist/{chunk-HPUAIWIH.js → chunk-PYPPV2F5.js} +1 -1
  22. package/dist/{chunk-FUG2TEKI.js → chunk-QFTBY67N.js} +2 -2
  23. package/dist/chunk-S5LXX32D.js +28 -0
  24. package/dist/chunk-SQKAXYIR.js +2 -0
  25. package/dist/chunk-VCGNVTXQ.js +1 -0
  26. package/dist/chunk-XYS4FSCC.js +12 -0
  27. package/dist/{chunk-FBOW7XOV.js → chunk-YRF7OATP.js} +1 -1
  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 +1 -1
  34. package/dist/entry-26.js +1 -1
  35. package/dist/entry-28.js +1 -1
  36. package/dist/entry-29.js +1 -1
  37. package/dist/entry-30.js +1 -1
  38. package/dist/entry-31.js +13 -11
  39. package/dist/entry-33.js +1 -1
  40. package/dist/entry-37.js +6 -6
  41. package/dist/entry-42.js +1 -1
  42. package/dist/entry-44.js +1 -1
  43. package/dist/entry-45.js +13 -13
  44. package/dist/entry-46.js +1 -1
  45. package/dist/entry-49.js +1 -1
  46. package/dist/entry-50.js +3 -6
  47. package/dist/entry-51.js +11 -9
  48. package/dist/entry-52.js +1 -1
  49. package/dist/entry-53.js +1 -1
  50. package/dist/entry-54.js +1 -1
  51. package/dist/entry-56.js +1 -1
  52. package/dist/entry-58.js +1 -1
  53. package/dist/entry-60.js +1 -1
  54. package/dist/entry-61.js +0 -1
  55. package/dist/entry-62.js +1 -0
  56. package/dist/entry-63.js +0 -1
  57. package/dist/entry-64.js +1 -0
  58. package/dist/entry-65.js +1 -1
  59. package/dist/entry-66.js +1 -1
  60. package/dist/entry-67.js +1 -1
  61. package/dist/entry-68.js +1 -1
  62. package/dist/entry-69.js +1 -1
  63. package/dist/entry-70.js +1 -1
  64. package/dist/entry-71.js +0 -1
  65. package/dist/entry-72.js +1 -0
  66. package/dist/entry-73.js +0 -1
  67. package/dist/entry-74.js +1 -0
  68. package/dist/entry-75.js +1 -1
  69. package/dist/entry-76.js +1 -1
  70. package/dist/entry-77.js +67 -1
  71. package/dist/entry-78.js +14 -325
  72. package/dist/entry-79.js +2 -18
  73. package/dist/entry-80.js +1 -2
  74. package/dist/entry-81.js +1 -1
  75. package/dist/entry-82.js +5 -1
  76. package/dist/entry-83.js +3 -5
  77. package/dist/entry-84.js +1 -3
  78. package/dist/entry-85.js +1 -1
  79. package/dist/entry-86.js +1 -1
  80. package/dist/pi-agent-ide.js +5 -5
  81. package/docs/agent-guides/editing.md +20 -4
  82. package/docs/agent-guides/git-changes.md +1 -1
  83. package/docs/agent-guides/read-resources.md +9 -1
  84. package/docs/agent-guides/search-code.md +38 -1
  85. package/docs/agent-guides/select-code.md +194 -0
  86. package/docs/configuration.md +12 -17
  87. package/docs/development.md +2 -1
  88. package/docs/releases.md +1 -1
  89. package/docs/research/apply-native-capability-matrix.md +174 -0
  90. package/docs/research/apply-read-latency.md +2 -0
  91. package/docs/research/lpt-393-fuzzy-results/file.json +152 -0
  92. package/docs/research/lpt-393-fuzzy-results/repo.json +122 -0
  93. package/docs/research/lpt-393-search-fuzzy-fallback.md +97 -0
  94. package/docs/research/native-codemode-batch-decision.md +2 -0
  95. package/docs/research/native-codemode-batching.md +1 -1
  96. package/docs/structured-results.md +32 -5
  97. package/docs/tools.md +6 -2
  98. package/docs/user-hooks.md +1 -1
  99. package/node_modules/pi-agent-doctor/package.json +1 -1
  100. package/node_modules/pi-agent-documentation/package.json +1 -1
  101. package/node_modules/pi-agent-filesystem/package.json +7 -7
  102. package/node_modules/pi-agent-filesystem-image/package.json +3 -3
  103. package/node_modules/pi-agent-filesystem-jq/package.json +5 -5
  104. package/node_modules/pi-agent-filesystem-pdf/package.json +3 -3
  105. package/node_modules/pi-agent-filesystem-text/package.json +3 -3
  106. package/node_modules/pi-agent-ide-ast/package.json +15 -10
  107. package/node_modules/pi-agent-ide-ast/src/ast/constructs.ts +193 -0
  108. package/node_modules/pi-agent-ide-ast/src/ast/element-extent.ts +59 -0
  109. package/node_modules/pi-agent-ide-ast/src/ast/manager.ts +5 -1
  110. package/node_modules/pi-agent-ide-ast/src/ast/selection.ts +204 -0
  111. package/node_modules/pi-agent-ide-ast/src/ast/syntax-tree.ts +2 -0
  112. package/node_modules/pi-agent-ide-ast/src/extension.ts +4 -2
  113. package/node_modules/pi-agent-ide-ast/src/geometry-selection.ts +184 -0
  114. package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +107 -21
  115. package/node_modules/pi-agent-ide-ast/src/select-presentation.ts +104 -0
  116. package/node_modules/pi-agent-ide-ast/src/select-schema.ts +384 -0
  117. package/node_modules/pi-agent-ide-ast/src/selection-region.ts +41 -0
  118. package/node_modules/pi-agent-ide-ast/src/source-text.ts +92 -0
  119. package/node_modules/pi-agent-ide-ast/src/text-selection.ts +214 -0
  120. package/node_modules/pi-agent-ide-ast/src/tool-select.ts +251 -0
  121. package/node_modules/pi-agent-ide-changes/index.ts +2 -18
  122. package/node_modules/pi-agent-ide-changes/package.json +8 -8
  123. package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +2 -2
  124. package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +11 -40
  125. package/node_modules/pi-agent-ide-formatter/package.json +3 -3
  126. package/node_modules/pi-agent-ide-languages/package.json +2 -2
  127. package/node_modules/pi-agent-ide-lint/package.json +7 -7
  128. package/node_modules/pi-agent-ide-lsp/index.ts +2 -2
  129. package/node_modules/pi-agent-ide-lsp/package.json +9 -9
  130. package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +5 -0
  131. package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +8 -2
  132. package/node_modules/pi-agent-ide-lsp/src/lsp/project.ts +19 -0
  133. package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +204 -118
  134. package/node_modules/pi-agent-ide-lsp/src/rename-plan.ts +2 -17
  135. package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +88 -45
  136. package/node_modules/pi-agent-image/package.json +2 -2
  137. package/node_modules/pi-agent-invariant/package.json +1 -1
  138. package/node_modules/pi-agent-pdf/package.json +2 -2
  139. package/node_modules/pi-agent-read/package.json +7 -7
  140. package/node_modules/pi-agent-read/src/api/read-parameters.ts +2 -2
  141. package/node_modules/pi-agent-read/src/api/tools/read.ts +4 -0
  142. package/node_modules/pi-agent-read/src/core/extension.ts +11 -0
  143. package/node_modules/pi-agent-read/src/core/tools/read/result-target.ts +93 -0
  144. package/node_modules/pi-agent-read/src/core/tools/read/structured-result.ts +2 -0
  145. package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +8 -1
  146. package/node_modules/pi-agent-resource/package.json +1 -1
  147. package/node_modules/pi-agent-resource/src/index.ts +10 -0
  148. package/node_modules/pi-agent-resource/src/result-targets.ts +233 -0
  149. package/node_modules/pi-agent-search/package.json +5 -5
  150. package/node_modules/pi-agent-search/src/api/fuzzy.ts +208 -0
  151. package/node_modules/pi-agent-search/src/api/presentation.ts +68 -0
  152. package/node_modules/pi-agent-search/src/api/search-parameters.ts +9 -3
  153. package/node_modules/pi-agent-search/src/api/search-scope.ts +22 -0
  154. package/node_modules/pi-agent-search/src/api/search.ts +28 -0
  155. package/node_modules/pi-agent-search/src/api/structured-result.ts +69 -14
  156. package/node_modules/pi-agent-search/src/core/extension.ts +56 -16
  157. package/node_modules/pi-agent-search/src/core/search-core.ts +9 -1
  158. package/node_modules/pi-agent-search-text/index.ts +3 -1
  159. package/node_modules/pi-agent-search-text/package.json +7 -6
  160. package/node_modules/pi-agent-search-text/src/fuzzy-search.ts +164 -0
  161. package/node_modules/pi-agent-search-text/src/resolvers.ts +161 -30
  162. package/node_modules/pi-agent-search-text/src/scoped-search.ts +103 -0
  163. package/node_modules/pi-agent-search-text/src/search-backend.ts +104 -17
  164. package/node_modules/pi-agent-search-text/src/search-renderer.ts +89 -292
  165. package/node_modules/pi-agent-search-text/src/search-result.ts +77 -0
  166. package/node_modules/pi-agent-search-text/src/search-session.ts +96 -11
  167. package/node_modules/pi-agent-text/package.json +2 -2
  168. package/node_modules/pi-agent-text-anchor-constant/package.json +3 -3
  169. package/node_modules/pi-agent-text-anchor-exact/package.json +3 -3
  170. package/node_modules/pi-agent-text-anchor-line-hash/package.json +5 -5
  171. package/node_modules/pi-agent-text-editor/index.ts +0 -5
  172. package/node_modules/pi-agent-text-editor/package.json +26 -31
  173. package/node_modules/pi-agent-text-editor/runtime/entry-77.js +1 -0
  174. package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +3 -1
  175. package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +1 -20
  176. package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +4 -23
  177. package/node_modules/pi-agent-text-editor/src/core/editing-guidelines.ts +2 -2
  178. package/node_modules/pi-agent-text-editor/src/core/extension.ts +12 -2
  179. package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +29 -4
  180. package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +1 -1
  181. package/node_modules/pi-agent-text-editor/src/core/file-result-targets.ts +76 -0
  182. package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +1 -1
  183. package/node_modules/pi-agent-text-editor/src/core/mutation-result-targets.ts +168 -0
  184. package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +199 -19
  185. package/node_modules/pi-agent-text-editor/src/core/result-input.ts +22 -0
  186. package/node_modules/pi-agent-text-editor/src/core/result-target-anchors.ts +78 -0
  187. package/node_modules/pi-agent-text-editor/src/core/result-transfer.ts +175 -0
  188. package/node_modules/pi-agent-text-editor/src/core/structured-result.ts +109 -11
  189. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +6 -1
  190. package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +0 -75
  191. package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +211 -223
  192. package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +9 -6
  193. package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +5 -5
  194. package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +5 -5
  195. package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +9 -7
  196. package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +8 -8
  197. package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +8 -3
  198. package/node_modules/pi-agent-text-editor-renderer/index.ts +1 -72
  199. package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
  200. package/node_modules/pi-agent-text-editor-renderer/src/diff-model.ts +19 -5
  201. package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +19 -45
  202. package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
  203. package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
  204. package/node_modules/pi-agent-tool-call-interception/runtime/entry-80.js +1 -0
  205. package/node_modules/pi-agent-tool-ui/package.json +2 -2
  206. package/node_modules/pi-agent-tool-ui/src/index.ts +7 -0
  207. package/node_modules/pi-agent-tool-ui/src/result-panel.ts +298 -0
  208. package/node_modules/pi-agent-web/index.ts +3 -0
  209. package/node_modules/pi-agent-web/package.json +8 -8
  210. package/node_modules/pi-agent-web/runtime/entry-82.js +2 -0
  211. package/node_modules/pi-agent-web/src/search.ts +111 -2
  212. package/node_modules/pi-agent-web-html/package.json +3 -3
  213. package/node_modules/pi-agent-web-image/package.json +4 -4
  214. package/node_modules/pi-agent-web-pdf/package.json +4 -4
  215. package/node_modules/pi-agent-web-text/package.json +4 -4
  216. package/package.json +35 -36
  217. package/src/composite/module-labels.ts +1 -1
  218. package/src/composite/preferences.ts +0 -5
  219. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
  220. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +3 -3
  221. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +5 -5
  222. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +3 -3
  223. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +3 -3
  224. package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +3 -0
  225. package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -8
  226. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -3
  227. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-83.js +2 -0
  228. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
  229. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
  230. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
  231. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-82.js +2 -0
  232. package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/search.ts +111 -2
  233. package/src/extensions/pi-agent-read/package.json +7 -7
  234. package/src/extensions/pi-agent-read/src/api/read-parameters.ts +2 -2
  235. package/src/extensions/pi-agent-read/src/api/tools/read.ts +4 -0
  236. package/src/extensions/pi-agent-read/src/core/extension.ts +11 -0
  237. package/src/extensions/pi-agent-read/src/core/tools/read/result-target.ts +93 -0
  238. package/src/extensions/pi-agent-read/src/core/tools/read/structured-result.ts +2 -0
  239. package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +8 -1
  240. package/src/extensions/pi-agent-search/package.json +5 -5
  241. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +3 -1
  242. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +7 -6
  243. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/fuzzy-search.ts +164 -0
  244. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +161 -30
  245. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/scoped-search.ts +103 -0
  246. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +104 -17
  247. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +89 -292
  248. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +77 -0
  249. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +96 -11
  250. package/src/extensions/pi-agent-search/src/api/fuzzy.ts +208 -0
  251. package/src/extensions/pi-agent-search/src/api/presentation.ts +68 -0
  252. package/src/extensions/pi-agent-search/src/api/search-parameters.ts +9 -3
  253. package/src/extensions/pi-agent-search/src/api/search-scope.ts +22 -0
  254. package/src/extensions/pi-agent-search/src/api/search.ts +28 -0
  255. package/src/extensions/pi-agent-search/src/api/structured-result.ts +69 -14
  256. package/src/extensions/pi-agent-search/src/core/extension.ts +56 -16
  257. package/src/extensions/pi-agent-search/src/core/search-core.ts +9 -1
  258. package/src/extensions/pi-agent-text-editor/index.ts +0 -5
  259. package/src/extensions/pi-agent-text-editor/package.json +26 -31
  260. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +3 -3
  261. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +3 -3
  262. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +5 -5
  263. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +1 -72
  264. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
  265. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-78.js +2 -0
  266. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-model.ts +19 -5
  267. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +19 -45
  268. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -5
  269. package/src/extensions/pi-agent-text-editor/runtime/entry-77.js +1 -0
  270. package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +3 -1
  271. package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +1 -20
  272. package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +4 -23
  273. package/src/extensions/pi-agent-text-editor/src/core/editing-guidelines.ts +2 -2
  274. package/src/extensions/pi-agent-text-editor/src/core/extension.ts +12 -2
  275. package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +29 -4
  276. package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +1 -1
  277. package/src/extensions/pi-agent-text-editor/src/core/file-result-targets.ts +76 -0
  278. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +1 -1
  279. package/src/extensions/pi-agent-text-editor/src/core/mutation-result-targets.ts +168 -0
  280. package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +199 -19
  281. package/src/extensions/pi-agent-text-editor/src/core/result-input.ts +22 -0
  282. package/src/extensions/pi-agent-text-editor/src/core/result-target-anchors.ts +78 -0
  283. package/src/extensions/pi-agent-text-editor/src/core/result-transfer.ts +175 -0
  284. package/src/extensions/pi-agent-text-editor/src/core/structured-result.ts +109 -11
  285. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +6 -1
  286. package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +0 -75
  287. package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +211 -223
  288. package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +9 -6
  289. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +5 -5
  290. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +5 -5
  291. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +9 -7
  292. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +8 -8
  293. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +8 -3
  294. package/src/pi-agent-ide.ts +0 -6
  295. package/src/plugins/pi-agent-ide-ast/package.json +15 -10
  296. package/src/plugins/pi-agent-ide-ast/src/ast/constructs.ts +193 -0
  297. package/src/plugins/pi-agent-ide-ast/src/ast/element-extent.ts +59 -0
  298. package/src/plugins/pi-agent-ide-ast/src/ast/manager.ts +5 -1
  299. package/src/plugins/pi-agent-ide-ast/src/ast/selection.ts +204 -0
  300. package/src/plugins/pi-agent-ide-ast/src/ast/syntax-tree.ts +2 -0
  301. package/src/plugins/pi-agent-ide-ast/src/extension.ts +4 -2
  302. package/src/plugins/pi-agent-ide-ast/src/geometry-selection.ts +184 -0
  303. package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +107 -21
  304. package/src/plugins/pi-agent-ide-ast/src/select-presentation.ts +104 -0
  305. package/src/plugins/pi-agent-ide-ast/src/select-schema.ts +384 -0
  306. package/src/plugins/pi-agent-ide-ast/src/selection-region.ts +41 -0
  307. package/src/plugins/pi-agent-ide-ast/src/source-text.ts +92 -0
  308. package/src/plugins/pi-agent-ide-ast/src/text-selection.ts +214 -0
  309. package/src/plugins/pi-agent-ide-ast/src/tool-select.ts +251 -0
  310. package/src/plugins/pi-agent-ide-changes/index.ts +2 -18
  311. package/src/plugins/pi-agent-ide-changes/package.json +8 -8
  312. package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +2 -2
  313. package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +11 -40
  314. package/src/plugins/pi-agent-ide-formatter/package.json +3 -3
  315. package/src/plugins/pi-agent-ide-languages/package.json +2 -2
  316. package/src/plugins/pi-agent-ide-lint/package.json +7 -7
  317. package/src/plugins/pi-agent-ide-lsp/index.ts +2 -2
  318. package/src/plugins/pi-agent-ide-lsp/package.json +9 -9
  319. package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +5 -0
  320. package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +8 -2
  321. package/src/plugins/pi-agent-ide-lsp/src/lsp/project.ts +19 -0
  322. package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +204 -118
  323. package/src/plugins/pi-agent-ide-lsp/src/rename-plan.ts +2 -17
  324. package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +88 -45
  325. package/src/plugins/pi-agent-ide-terminal/src/search.ts +10 -36
  326. package/src/plugins/pi-agent-ide-terminal/src/tools.ts +1 -1
  327. package/src/plugins/pi-agent-ide-vision/index.ts +19 -0
  328. package/dist/chunk-2P2OGO3G.js +0 -2
  329. package/dist/chunk-6EYWFBNG.js +0 -0
  330. package/dist/chunk-7AVXUV4A.js +0 -7
  331. package/dist/chunk-7WCZOO5I.js +0 -1
  332. package/dist/chunk-BAYETTZZ.js +0 -16
  333. package/dist/chunk-BVK5A7ED.js +0 -28
  334. package/dist/chunk-F7NVAC4Q.js +0 -0
  335. package/dist/chunk-FZBCKIJJ.js +0 -1
  336. package/dist/chunk-I5JLCFUX.js +0 -1
  337. package/dist/chunk-MIZAFRDR.js +0 -1
  338. package/dist/chunk-PJPA5EEE.js +0 -2
  339. package/dist/chunk-PXWDDBBC.js +0 -0
  340. package/dist/chunk-TQZBVOTT.js +0 -5
  341. package/dist/chunk-VWW3RLUX.js +0 -12
  342. package/dist/chunk-YHUTTZC6.js +0 -2
  343. package/dist/chunk-ZODCBFBL.js +0 -2
  344. package/dist/entry-87.js +0 -1
  345. package/docs/agent-guides/apply.md +0 -333
  346. package/node_modules/pi-agent-text-editor/src/api/apply-renderer.ts +0 -3
  347. package/node_modules/pi-agent-text-editor/src/core/apply/apply-undo-store.ts +0 -159
  348. package/node_modules/pi-agent-text-editor/src/core/apply/execution.ts +0 -405
  349. package/node_modules/pi-agent-text-editor/src/core/apply/final-mutations.ts +0 -50
  350. package/node_modules/pi-agent-text-editor/src/core/apply/format-source.ts +0 -11
  351. package/node_modules/pi-agent-text-editor/src/core/apply/mixed-source.ts +0 -203
  352. package/node_modules/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +0 -55
  353. package/node_modules/pi-agent-text-editor/src/core/apply/output.ts +0 -276
  354. package/node_modules/pi-agent-text-editor/src/core/apply/prompt.ts +0 -13
  355. package/node_modules/pi-agent-text-editor/src/core/apply/queue.ts +0 -25
  356. package/node_modules/pi-agent-text-editor/src/core/apply/renderer.ts +0 -405
  357. package/node_modules/pi-agent-text-editor/src/core/apply/results.ts +0 -137
  358. package/node_modules/pi-agent-text-editor/src/core/apply/runtime.ts +0 -369
  359. package/node_modules/pi-agent-text-editor/src/core/apply/structured-result.ts +0 -251
  360. package/node_modules/pi-agent-text-editor/src/core/apply/tool.ts +0 -168
  361. package/node_modules/pi-agent-text-editor/src/core/apply/transaction.ts +0 -942
  362. package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-80.js +0 -2
  363. package/node_modules/pi-agent-tool-ui/runtime/entry-82.js +0 -1
  364. package/node_modules/pi-agent-web-text/runtime/entry-87.js +0 -2
  365. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-87.js +0 -2
  366. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-83.js +0 -2
  367. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-80.js +0 -2
  368. package/src/extensions/pi-agent-text-editor/runtime/entry-78.js +0 -2
  369. package/src/extensions/pi-agent-text-editor/src/api/apply-renderer.ts +0 -3
  370. package/src/extensions/pi-agent-text-editor/src/core/apply/apply-undo-store.ts +0 -159
  371. package/src/extensions/pi-agent-text-editor/src/core/apply/execution.ts +0 -405
  372. package/src/extensions/pi-agent-text-editor/src/core/apply/final-mutations.ts +0 -50
  373. package/src/extensions/pi-agent-text-editor/src/core/apply/format-source.ts +0 -11
  374. package/src/extensions/pi-agent-text-editor/src/core/apply/mixed-source.ts +0 -203
  375. package/src/extensions/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +0 -55
  376. package/src/extensions/pi-agent-text-editor/src/core/apply/output.ts +0 -276
  377. package/src/extensions/pi-agent-text-editor/src/core/apply/prompt.ts +0 -13
  378. package/src/extensions/pi-agent-text-editor/src/core/apply/queue.ts +0 -25
  379. package/src/extensions/pi-agent-text-editor/src/core/apply/renderer.ts +0 -405
  380. package/src/extensions/pi-agent-text-editor/src/core/apply/results.ts +0 -137
  381. package/src/extensions/pi-agent-text-editor/src/core/apply/runtime.ts +0 -369
  382. package/src/extensions/pi-agent-text-editor/src/core/apply/structured-result.ts +0 -251
  383. package/src/extensions/pi-agent-text-editor/src/core/apply/tool.ts +0 -168
  384. package/src/extensions/pi-agent-text-editor/src/core/apply/transaction.ts +0 -942
  385. /package/node_modules/{pi-agent-text-editor → pi-agent-text-editor-renderer}/runtime/entry-78.js +0 -0
  386. /package/node_modules/{pi-agent-text-editor-renderer → pi-agent-text-editor-stale-anchor}/runtime/entry-79.js +0 -0
  387. /package/node_modules/{pi-agent-tool-call-interception → pi-agent-tool-ui}/runtime/entry-81.js +0 -0
  388. /package/node_modules/{pi-agent-web → pi-agent-web-html}/runtime/entry-83.js +0 -0
  389. /package/node_modules/{pi-agent-web-html → pi-agent-web-image}/runtime/entry-84.js +0 -0
  390. /package/node_modules/{pi-agent-web-image → pi-agent-web-pdf}/runtime/entry-85.js +0 -0
  391. /package/node_modules/{pi-agent-web-pdf → pi-agent-web-text}/runtime/entry-86.js +0 -0
  392. /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
  393. /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
  394. /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
  395. /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
@@ -0,0 +1,152 @@
1
+ {
2
+ "scope": "file",
3
+ "request": {
4
+ "query": "generateHintStrings",
5
+ "path": "tests/integration/extensions/pi-agent-search/fixtures/fuzzy-vimium/link_hints.js"
6
+ },
7
+ "node": "v24.20.0",
8
+ "baselineRssBytes": 147570688,
9
+ "baselineHeapBytes": 52466544,
10
+ "peakNodeRssKiB": 156064,
11
+ "runs": [
12
+ {
13
+ "repetition": 0,
14
+ "invocation": "first in this process",
15
+ "resolveMs": 48.63072999999986,
16
+ "registrationMs": 4.892467000000124,
17
+ "totalMs": 53.52319699999998,
18
+ "ordinaryMs": 6.71617399999991,
19
+ "status": "ready",
20
+ "candidates": [
21
+ {
22
+ "identifier": "hintStrings",
23
+ "matchCount": 5,
24
+ "complete": true
25
+ },
26
+ {
27
+ "identifier": "generateHintString",
28
+ "matchCount": 2,
29
+ "complete": true
30
+ }
31
+ ],
32
+ "rssBytes": 152731648,
33
+ "heapBytes": 43699128
34
+ },
35
+ {
36
+ "repetition": 1,
37
+ "invocation": "repeat; fresh name scan",
38
+ "resolveMs": 30.852624000000105,
39
+ "registrationMs": 2.1712270000000444,
40
+ "totalMs": 33.02385100000015,
41
+ "ordinaryMs": 7.320789000000104,
42
+ "status": "ready",
43
+ "candidates": [
44
+ {
45
+ "identifier": "hintStrings",
46
+ "matchCount": 5,
47
+ "complete": true
48
+ },
49
+ {
50
+ "identifier": "generateHintString",
51
+ "matchCount": 2,
52
+ "complete": true
53
+ }
54
+ ],
55
+ "rssBytes": 152862720,
56
+ "heapBytes": 49453640
57
+ },
58
+ {
59
+ "repetition": 2,
60
+ "invocation": "repeat; fresh name scan",
61
+ "resolveMs": 30.69540700000016,
62
+ "registrationMs": 1.7809270000000197,
63
+ "totalMs": 32.47633400000018,
64
+ "ordinaryMs": 7.036112000000003,
65
+ "status": "ready",
66
+ "candidates": [
67
+ {
68
+ "identifier": "hintStrings",
69
+ "matchCount": 5,
70
+ "complete": true
71
+ },
72
+ {
73
+ "identifier": "generateHintString",
74
+ "matchCount": 2,
75
+ "complete": true
76
+ }
77
+ ],
78
+ "rssBytes": 152862720,
79
+ "heapBytes": 53448504
80
+ },
81
+ {
82
+ "repetition": 3,
83
+ "invocation": "repeat; fresh name scan",
84
+ "resolveMs": 25.92471099999989,
85
+ "registrationMs": 1.7080989999999474,
86
+ "totalMs": 27.632809999999836,
87
+ "ordinaryMs": 6.778381999999965,
88
+ "status": "ready",
89
+ "candidates": [
90
+ {
91
+ "identifier": "hintStrings",
92
+ "matchCount": 5,
93
+ "complete": true
94
+ },
95
+ {
96
+ "identifier": "generateHintString",
97
+ "matchCount": 2,
98
+ "complete": true
99
+ }
100
+ ],
101
+ "rssBytes": 152862720,
102
+ "heapBytes": 57350904
103
+ },
104
+ {
105
+ "repetition": 4,
106
+ "invocation": "repeat; fresh name scan",
107
+ "resolveMs": 30.013942999999927,
108
+ "registrationMs": 2.700010999999904,
109
+ "totalMs": 32.71395399999983,
110
+ "ordinaryMs": 7.596590999999989,
111
+ "status": "ready",
112
+ "candidates": [
113
+ {
114
+ "identifier": "hintStrings",
115
+ "matchCount": 5,
116
+ "complete": true
117
+ },
118
+ {
119
+ "identifier": "generateHintString",
120
+ "matchCount": 2,
121
+ "complete": true
122
+ }
123
+ ],
124
+ "rssBytes": 155746304,
125
+ "heapBytes": 61306432
126
+ },
127
+ {
128
+ "repetition": 5,
129
+ "invocation": "repeat; fresh name scan",
130
+ "resolveMs": 30.76448000000005,
131
+ "registrationMs": 2.2739610000000994,
132
+ "totalMs": 33.03844100000015,
133
+ "ordinaryMs": 7.54132699999991,
134
+ "status": "ready",
135
+ "candidates": [
136
+ {
137
+ "identifier": "hintStrings",
138
+ "matchCount": 5,
139
+ "complete": true
140
+ },
141
+ {
142
+ "identifier": "generateHintString",
143
+ "matchCount": 2,
144
+ "complete": true
145
+ }
146
+ ],
147
+ "rssBytes": 159809536,
148
+ "heapBytes": 65303264
149
+ }
150
+ ],
151
+ "note": "First invocation is not a flushed OS cache. Resolve includes ordinary search, name collection and exact verification. Registration includes bounded snapshots. RSS includes imported runtime modules; it is not the vocabulary size and does not include child-process RSS."
152
+ }
@@ -0,0 +1,122 @@
1
+ {
2
+ "scope": "repo",
3
+ "request": {
4
+ "query": "planSearchPresentations",
5
+ "path": "src"
6
+ },
7
+ "node": "v24.20.0",
8
+ "baselineRssBytes": 149012480,
9
+ "baselineHeapBytes": 52543264,
10
+ "peakNodeRssKiB": 253136,
11
+ "runs": [
12
+ {
13
+ "repetition": 0,
14
+ "invocation": "first in this process",
15
+ "resolveMs": 197.02866299999994,
16
+ "registrationMs": 5.886676999999963,
17
+ "totalMs": 202.9153399999999,
18
+ "ordinaryMs": 11.027428999999984,
19
+ "status": "ready",
20
+ "candidates": [
21
+ {
22
+ "identifier": "planSearchPresentation",
23
+ "matchCount": 10,
24
+ "complete": true
25
+ }
26
+ ],
27
+ "rssBytes": 192319488,
28
+ "heapBytes": 42126184
29
+ },
30
+ {
31
+ "repetition": 1,
32
+ "invocation": "repeat; fresh name scan",
33
+ "resolveMs": 153.16502000000014,
34
+ "registrationMs": 2.6196299999999155,
35
+ "totalMs": 155.78465000000006,
36
+ "ordinaryMs": 13.262361000000055,
37
+ "status": "ready",
38
+ "candidates": [
39
+ {
40
+ "identifier": "planSearchPresentation",
41
+ "matchCount": 10,
42
+ "complete": true
43
+ }
44
+ ],
45
+ "rssBytes": 193245184,
46
+ "heapBytes": 43182040
47
+ },
48
+ {
49
+ "repetition": 2,
50
+ "invocation": "repeat; fresh name scan",
51
+ "resolveMs": 140.010812,
52
+ "registrationMs": 2.463557999999921,
53
+ "totalMs": 142.4743699999999,
54
+ "ordinaryMs": 13.206528999999819,
55
+ "status": "ready",
56
+ "candidates": [
57
+ {
58
+ "identifier": "planSearchPresentation",
59
+ "matchCount": 10,
60
+ "complete": true
61
+ }
62
+ ],
63
+ "rssBytes": 194007040,
64
+ "heapBytes": 44272152
65
+ },
66
+ {
67
+ "repetition": 3,
68
+ "invocation": "repeat; fresh name scan",
69
+ "resolveMs": 155.73641399999997,
70
+ "registrationMs": 2.2927649999999176,
71
+ "totalMs": 158.02917899999989,
72
+ "ordinaryMs": 13.180634999999938,
73
+ "status": "ready",
74
+ "candidates": [
75
+ {
76
+ "identifier": "planSearchPresentation",
77
+ "matchCount": 10,
78
+ "complete": true
79
+ }
80
+ ],
81
+ "rssBytes": 194613248,
82
+ "heapBytes": 45255216
83
+ },
84
+ {
85
+ "repetition": 4,
86
+ "invocation": "repeat; fresh name scan",
87
+ "resolveMs": 155.2331959999999,
88
+ "registrationMs": 2.0157530000001316,
89
+ "totalMs": 157.24894900000004,
90
+ "ordinaryMs": 12.454251000000113,
91
+ "status": "ready",
92
+ "candidates": [
93
+ {
94
+ "identifier": "planSearchPresentation",
95
+ "matchCount": 10,
96
+ "complete": true
97
+ }
98
+ ],
99
+ "rssBytes": 195268608,
100
+ "heapBytes": 46803240
101
+ },
102
+ {
103
+ "repetition": 5,
104
+ "invocation": "repeat; fresh name scan",
105
+ "resolveMs": 147.09523799999988,
106
+ "registrationMs": 2.65529800000013,
107
+ "totalMs": 149.750536,
108
+ "ordinaryMs": 11.426179999999931,
109
+ "status": "ready",
110
+ "candidates": [
111
+ {
112
+ "identifier": "planSearchPresentation",
113
+ "matchCount": 10,
114
+ "complete": true
115
+ }
116
+ ],
117
+ "rssBytes": 195883008,
118
+ "heapBytes": 47151672
119
+ }
120
+ ],
121
+ "note": "First invocation is not a flushed OS cache. Resolve includes ordinary search, name collection and exact verification. Registration includes bounded snapshots. RSS includes imported runtime modules; it is not the vocabulary size and does not include child-process RSS."
122
+ }
@@ -0,0 +1,97 @@
1
+ # LPT-393: zero-result fuzzy Search verification
2
+
3
+ Search can now suggest nearby identifier spellings after a complete zero-result search. This is a spelling fallback, not semantic search. No model, new dependency, service, or persistent index is needed.
4
+
5
+ ## How to use it
6
+
7
+ Call Search as usual with an unquoted identifier and a useful scope:
8
+
9
+ ```js
10
+ search({ query: "generateHintStrings", path: "content_scripts/link_hints.js" });
11
+ ```
12
+
13
+ The original result stays empty. On the pinned Vimium fixture, two separate groups follow:
14
+
15
+ - `hintStrings`: remove the leading `generate` component; 5 exact spans.
16
+ - `generateHintString`: one character edit; 2 exact spans.
17
+
18
+ These counts are occurrences, not implementations. Read the suggested source before deciding which name is relevant. Local groups provide their own Search references. Each all-reference repeats only that exact spelling if the files change, not the fuzzy ranking. Individual references become stale normally.
19
+
20
+ Inside native Codemode, the original `data.matches` remains empty. Use `data.fuzzy.candidates`, inspect each `selection.complete`, and read its `selection.all.line` when available. `selection.truncated` only describes the three-location public preview, not capture completeness. URL groups instead provide the requested URL and line ranges, with no editable Search references.
21
+
22
+ The fallback applies only to suitable unquoted ASCII identifiers, 5–80 characters long, after the ordinary search completes with zero results. Quoted queries, Boolean queries, explicit protocols, nonzero results, and incomplete searches keep their existing behavior. Ranking puts case/separator normalization first, one missing or extra edge component next, and one character edit last. Digits are not corrected. Suggestions do not claim synonyms or equivalent behavior.
23
+
24
+ ## User TUI and agent results are separate
25
+
26
+ The local Search card now reports `0 exact · 10 fuzzy matches · 4 files` for the repository typo case. Below it, each candidate has a mechanical reason and a bounded source preview: file, line number and highlighted code. The preview uses at most three captured spans per name, with short context around the first highlighted span of each line. Shared source files count once in the header. Incomplete totals carry `+`; compact panels keep their expansion hint.
27
+
28
+ These previews are private renderer metadata, not agent-facing text or structured data. The agent still receives the original zero and separate exact candidate groups with Read references. URL results keep their existing URL/line output; this user-requested card revision changes the native local/repository panel.
29
+
30
+ The screenshot that showed only `No matches` came from restoring the older global renderer before merging this branch. That older renderer does not understand the new groups. Live verification uses the branch loader; global deployment still requires acceptance and merge.
31
+
32
+ ## Bounds and freshness
33
+
34
+ Local collection streams unique names using the ordinary ripgrep scope and ignore/glob rules. It does not retain all occurrences just to build a vocabulary. Every invocation scans fresh names; there is no cache to invalidate after edits or checkout changes.
35
+
36
+ - At most 20,000 unique names and 8 MiB of name-stream input.
37
+ - At most 5 candidate groups.
38
+ - Exact verification captures at most 200 spans and 4 MiB of output per candidate.
39
+ - Collection and verification share a two-second deadline. Registration has a separate two-second phase budget and bounded snapshot reads.
40
+ - Source-size checks bound candidate snapshots to 8 MiB across the captured sources; registration and refresh also retain byte limits.
41
+ - Budget skips and extra-branch failures preserve the original zero and explain why suggestions are unavailable. Parent cancellation still aborts the call.
42
+ - Incomplete groups have no complete all-reference. A source race can leave readable locations without stable references; the result explains this.
43
+
44
+ URL search reuses the already fetched and converted body, with an 8 MiB content budget. It does not fetch the URL again for each candidate.
45
+
46
+ ## Measured file and repository cases
47
+
48
+ Measured with Node 24.20.0 on this checkout. Each scope ran once, then five more times with a fresh name scan. Total time includes the ordinary search, vocabulary scan, exact verification, and reference registration. The ordinary backend was measured separately as a baseline.
49
+
50
+ | Scope / query | First total | Median of five repeats | Ordinary median | Node RSS before calls | Peak Node RSS |
51
+ | -------------------------------------------- | ----------: | ---------------------: | --------------: | --------------------: | ------------: |
52
+ | Pinned Vimium file / `generateHintStrings` | 53.52 ms | 32.71 ms | 7.18 ms | 140.73 MiB | 152.41 MiB |
53
+ | Repository `src` / `planSearchPresentations` | 202.92 ms | 155.78 ms | 12.82 ms | 142.11 MiB | 247.20 MiB |
54
+
55
+ All six file runs returned the same 5/2 groups. All six repository runs returned `planSearchPresentation` with 10 exact spans. This repository case scans `src`, not every file in the repository.
56
+
57
+ The first call is not a flushed OS-cache measurement. RSS includes imported Node/runtime modules and process allocations, not just the vocabulary, and excludes child-process RSS. These are two measured cases, not a latency or memory guarantee for arbitrary repositories. Raw measurements: [file](lpt-393-fuzzy-results/file.json) and [repository](lpt-393-fuzzy-results/repo.json).
58
+
59
+ ## Verification evidence
60
+
61
+ - 18 relevant unit files, 133 tests passed; focused type-aware lint passed.
62
+ - Four real-Pi integration files, 11 tests passed, covering fuzzy fallback, ordinary hybrid Search, web Search, and structured results. The two fuzzy integrations were rerun after the last renderer change and passed.
63
+ - Contracts cover query guards, scope/ignore rules, edits/removals/checkouts, byte and capture limits, cancellation, source races, bounded refresh, dollar identifier boundaries, typed results, and persisted rendering.
64
+ - Native local and URL Search plus native Codemode-to-Read were exercised after reloading the working extension. `hintStrings` Read returned four unique lines containing the five spans, including the method declaration at line 886.
65
+ - Actual `inspect_tui` captures of Herdr pane `w3GX:p1`, 123×108 cells, revision 147, live bottom: local groups showed both names, counts, reasons and locations without raw anchors or clipping. The URL compact result showed both names/counts and its expansion hint; remaining detail is available with Ctrl+O.
66
+ - After the user requested explicit fuzzy status and highlighted source previews, actual viewport captures of the same pane at revisions 606 and 635 showed the new `0 exact` header, distinct fuzzy/file totals, candidate names, file/line rows and highlighted code. Renderer persistence, bounded previews, partial totals, shared-file counting and isolation from agent output are covered by tests.
67
+ - Normal configured startup loaded exactly one IDE extension without errors or warnings, both with the temporary worktree loader and after restoring global loading. No model prompt was sent.
68
+ - Full source typecheck, package boundaries, machine-path check, catalog generation/check, public package build, and diff whitespace check passed.
69
+ - The effective Read/Search interface was exported and read completely. New workflow guidance lives in `docs:search-code`; callable parameter schemas are unchanged.
70
+
71
+ The temporary local settings/loader and local HTTP server were removed after verification. The global runtime was restored. The user explicitly accepted the feature after the live demo and a separate real-Pi recording of the card. Acceptance authorizes the PR into develop; it does not itself deploy the feature.
72
+
73
+ ## Repeat the checks
74
+
75
+ ```sh
76
+ pnpm exec vitest run src/extensions/pi-agent-search \
77
+ src/extensions/pi-agent-read/extensions/pi-agent-web/test/search.test.ts
78
+ pnpm exec pi-test run -- pnpm exec vitest run --config vitest.integration.config.mjs \
79
+ tests/integration/extensions/pi-agent-search/fuzzy-fallback.integration.test.ts
80
+ pnpm exec oxnode scripts/dev/check-normal-startup.ts
81
+ pnpm typecheck
82
+ pnpm check:boundaries
83
+ pnpm check:paths
84
+ pnpm docs:catalog
85
+ pnpm check:catalog
86
+ pnpm check:package
87
+ ```
88
+
89
+ To repeat the measured cases, bundle the tracked profiler into the ignored temporary directory, then run each scope:
90
+
91
+ ```sh
92
+ pnpm exec esbuild dev/performance/fuzzy-search.ts --bundle --platform=node \
93
+ --format=esm --target=node24 --external:@earendil-works/* \
94
+ --external:typebox --external:typebox/* --outfile=.tmp/fuzzy-verification/profile.mjs
95
+ node .tmp/fuzzy-verification/profile.mjs file
96
+ node .tmp/fuzzy-verification/profile.mjs repo
97
+ ```
@@ -1,5 +1,7 @@
1
1
  # Solution decision: accumulate sequential Codemode text edits
2
2
 
3
+ This records the original batching decision. LPT-403 later removed Apply without changing the native batching policy.
4
+
3
5
  ## Question
4
6
 
5
7
  Should sequential editor calls in native Codemode share only original coordinates, or also one combined write, and where should that batch end?
@@ -54,7 +54,7 @@ Not every invocation of an editor-named tool is a text edit. Direct transactions
54
54
 
55
55
  `createPostEditScope()` already collects final processing per resource. Its writes remain immediate, so using it alone would not fix the failing snapshot test. It is a possible reuse point for formatting and notifications after a combined write, not a replacement for the batch planner.
56
56
 
57
- **Evidence:** [`post-edit-scope.ts`](../../src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts), `createPostEditScope`; [`Apply execution`](../../src/extensions/pi-agent-text-editor/src/core/apply/execution.ts), `finish`. This is an internal reuse observation, not a request to make Apply callable from Codemode.
57
+ **Evidence:** [`post-edit-scope.ts`](../../src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts), `createPostEditScope`; [`Apply execution`](https://github.com/alexshpunt/pi-agent-ide/blob/c4ccbf9e8620976b5130e6f351f2678ce1d1a067/src/extensions/pi-agent-text-editor/src/core/apply/execution.ts), `finish`. This is an internal reuse observation, not a request to make Apply callable from Codemode.
58
58
 
59
59
  ### Some failure boundaries still need proof
60
60
 
@@ -1,6 +1,6 @@
1
1
  # Native IDE results
2
2
 
3
- Read, Search, text mutations, Apply, 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
+ 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.
4
4
 
5
5
  The shared envelope is:
6
6
 
@@ -17,13 +17,40 @@ Check `status` before using data. Domain errors with structured results resolve
17
17
 
18
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
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, semantic action fields, and transaction receipts are included when available. Full before/after documents are not copied into receipts.
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
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
- - **Apply:** `operations` keep read and mutation outcomes in call order, including failed work. `files` and `transactions` retain committed checkpoints after a later failure. `values` contain only output explicitly requested by the script, not hidden snapshots.
23
22
  - **Diff:** returns source identities, equality, added/removed counts, and bounded unified diff text. It does not repeat both source documents.
24
23
  - **Git index tools:** return action, change selector, file, index state, observed effect, and whether it was already in the requested state.
25
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.
26
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.
31
+
32
+ ```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);
40
+ ```
41
+
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.
43
+
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.
45
+
46
+ ### Possible-name groups
47
+
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.
49
+
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.
51
+
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.
53
+
27
54
  ## Native editor commits
28
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:
@@ -41,7 +68,7 @@ Resource-owned selectors may commit immediately rather than joining the local ba
41
68
 
42
69
  ## Bounds and continuation
43
70
 
44
- 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. Registered search results keep the first 100 matches and at most 4 KiB of matched text per match.
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.
45
72
 
46
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.
47
74
 
@@ -56,4 +83,4 @@ Standard Read Resources use the core text/bytes/native projection. Read handlers
56
83
 
57
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`.
58
85
 
59
- Shell command results keep their separate native process contract. This change does not add a shared result store, cross-session handles, binary editing, or a new Apply interpreter.
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.
package/docs/tools.md CHANGED
@@ -52,7 +52,7 @@ When `path` is a typed text resource, `read` returns one independent chunk for e
52
52
 
53
53
  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
54
 
55
- Inside Apply, the same call returns `kind: "bytes"`, `source`, `byteOffset`, `byteLength`, `totalBytes`, `bytes: number[]`, and `ok`. The script receives the complete selected range; the displayed answer stays bounded. Use `result(doc)` to retain the hex view rather than printing the byte array. This is read-only; byte editing and byte diff are not included.
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.
56
56
 
57
57
  ### Diagnostic completion
58
58
 
@@ -93,7 +93,7 @@ text({
93
93
  Every run returns a stable `shell:<session>` source. Synchronous runs wait for the real exit status. Background runs return immediately, remain visible below the editor, and send one completion message that wakes the agent; nearby completions are combined without losing individual results. `/terminals` opens the active and recent session overlay.
94
94
  The UI tab in `/agent-ide-settings` controls persistent active-terminal presentation: Detailed cards (default), Compact count, or Off. Detailed cards replace the separate active count instead of showing both. This setting does not hide ordinary run results or completion messages.
95
95
 
96
- Use `read` on the returned source for status and bounded output. Compact cards show the latest 12 output rows and count omitted earlier rows; expanded cards show all retained rows. Add `views: ["image"]` to receive a PNG of the ANSI-aware virtual terminal screen. Use `write` to send exact text without Enter. Use `insert` for named keys and chords such as `Enter`, `Ctrl+C`, `Ctrl+Shift+Left`, or Unix caret controls such as `^U`; separate multiple keys with spaces or commas. Batched `apply` calls can send several terminal inputs without file formatting or diagnostics. Use `search` with the `shell:<session>` path to search retained output, including rows outside the current screen. `delete` terminates the owned process tree when needed, disposes the virtual screen, and removes the session. `replace` does not apply to terminal sessions.
96
+ Use `read` on the returned source for status and bounded output. Compact cards show the latest 12 output rows and count omitted earlier rows; expanded cards show all retained rows. Add `views: ["image"]` to receive a PNG of the ANSI-aware virtual terminal screen. Use `write` to send exact text without Enter. Use `insert` for named keys and chords such as `Enter`, `Ctrl+C`, `Ctrl+Shift+Left`, or Unix caret controls such as `^U`; separate multiple keys with spaces or commas. A native Codemode script can send several terminal inputs without file formatting or diagnostics. Use `search` with the `shell:<session>` path to search retained output, including rows outside the current screen. `delete` terminates the owned process tree when needed, disposes the virtual screen, and removes the session. `replace` does not apply to terminal sessions.
97
97
 
98
98
  Deleting an active session first requests graceful termination, then forcefully terminates its process tree after the grace period. Deletion does not undo file or network effects. Sessions survive extension reloads in the current Pi process. Shutdown stops live processes; sessions are not reattached after restart.
99
99
 
@@ -108,6 +108,10 @@ A resolver decides whether it understands a query. The first successful resolver
108
108
 
109
109
  Local text search tries literal terms first. If there are no matches, it retries unquoted terms as regex. If that also finds nothing, an ordinary multi-word query falls back to separate words. Each fallback is reported. Invalid optional regex is skipped, while I/O errors, cancellation, and regex runtime errors stay errors. `regex:<pattern>` forces regex-only matching and reports invalid patterns.
110
110
 
111
+ After all ordinary attempts finish with zero matches, a single unquoted ASCII identifier can return separate possible-name groups. They cover naming-style changes, one extra or missing edge component, and small typos, strongest first. Each name is verified exactly in the same scope. These are spelling suggestions, not synonyms, automatic corrections, or proof of equivalent behavior. Quoted, Boolean, explicit regex and other protocol queries do not use this branch.
112
+
113
+ Local groups provide current Read selections; a complete candidate all-reference refreshes only its exact alternative. URL groups reuse the already converted page text and provide URL line ranges without editable Search references. Name collection, capture and output have fixed budgets; a skip or limited capture is explicit. Narrow the scope if a budget is reached.
114
+
111
115
  Boolean queries keep their conditions across literal and regex attempts. They support uppercase `AND`, `OR`, infix `NOT`, `||`, and space-separated `|`. Adjacent terms imply `AND`; `AND` and `NOT` bind more tightly than `OR`. Parentheses containing Boolean operators group conditions. Regex groups, classes, and escapes stay inside terms: `(?:foo|bar)\d+ AND "keep.me" NOT ignored`. An unspaced `foo|bar` is searched as literal text first, then as regex alternatives. Single or double quotes keep a term literal in every attempt. Quoted and Boolean queries never fall back to separate words. Invalid Boolean expressions report the source column and expected syntax.
112
116
 
113
117
  Empty protocol queries such as `symbols:` and unhandled prefixes such as `unknown:needle` search their original text, including the prefix. The tool reports this fallback. Nonempty installed protocols keep their specialized behavior; service errors, timeouts, and successful protocol searches with no results do not launch local text search. Plugins mark a local fallback resolver with `fallback: true`; these resolvers run after specialists regardless of numeric priority and receive empty protocol queries directly.
@@ -43,7 +43,7 @@ export default function (pi: ExtensionAPI) {
43
43
  }
44
44
  ```
45
45
 
46
- The hook receives one complete plan after Resource and anchor resolution but before the first write. It covers standalone mutation tools and Apply. A denial or thrown error leaves every Resource unchanged.
46
+ The hook receives one complete plan after Resource and anchor resolution but before the first write. It covers standalone mutation tools, including calls through native Codemode. A denial or thrown error leaves every Resource unchanged.
47
47
 
48
48
  ## Check saved edits
49
49
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-doctor",
3
- "version": "0.6.4",
3
+ "version": "0.7.0",
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.6.4",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "types": "./src/index.ts",
6
6
  "exports": {
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "pi-agent-filesystem",
3
- "version": "0.6.4",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
7
7
  },
8
8
  "dependencies": {
9
- "pi-agent-image": "0.6.4",
10
- "pi-agent-invariant": "0.6.4",
11
- "pi-agent-read": "0.6.4",
12
- "pi-agent-resource": "0.6.4",
13
- "pi-agent-text": "0.6.4",
14
- "pi-agent-text-editor": "0.6.4"
9
+ "pi-agent-image": "0.7.0",
10
+ "pi-agent-invariant": "0.7.0",
11
+ "pi-agent-read": "0.7.0",
12
+ "pi-agent-resource": "0.7.0",
13
+ "pi-agent-text": "0.7.0",
14
+ "pi-agent-text-editor": "0.7.0"
15
15
  },
16
16
  "pi": {
17
17
  "extensions": [
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "pi-agent-filesystem-image",
3
- "version": "0.6.4",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#extension": "./index.ts"
7
7
  },
8
8
  "dependencies": {
9
- "pi-agent-image": "0.6.4",
10
- "pi-agent-resource": "0.6.4"
9
+ "pi-agent-image": "0.7.0",
10
+ "pi-agent-resource": "0.7.0"
11
11
  },
12
12
  "pi": {
13
13
  "extensions": [
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "pi-agent-filesystem-jq",
3
- "version": "0.6.4",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
7
7
  },
8
8
  "dependencies": {
9
9
  "cross-spawn": "^7.0.6",
10
- "pi-agent-doctor": "0.6.4",
11
- "pi-agent-documentation": "0.6.4",
12
- "pi-agent-read": "0.6.4",
13
- "pi-agent-text": "0.6.4"
10
+ "pi-agent-doctor": "0.7.0",
11
+ "pi-agent-documentation": "0.7.0",
12
+ "pi-agent-read": "0.7.0",
13
+ "pi-agent-text": "0.7.0"
14
14
  },
15
15
  "pi": {
16
16
  "extensions": [
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "pi-agent-filesystem-pdf",
3
- "version": "0.6.4",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "pi-agent-pdf": "0.6.4",
7
- "pi-agent-resource": "0.6.4"
6
+ "pi-agent-pdf": "0.7.0",
7
+ "pi-agent-resource": "0.7.0"
8
8
  },
9
9
  "pi": {
10
10
  "extensions": [
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "pi-agent-filesystem-text",
3
- "version": "0.6.4",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#extension": "./index.ts"
7
7
  },
8
8
  "dependencies": {
9
- "pi-agent-resource": "0.6.4",
10
- "pi-agent-text": "0.6.4"
9
+ "pi-agent-resource": "0.7.0",
10
+ "pi-agent-text": "0.7.0"
11
11
  },
12
12
  "pi": {
13
13
  "extensions": [