pi-agent-ide 0.2.1 → 0.3.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 (490) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/README.md +12 -8
  3. package/dist/{chunk-XNXQYPVT.js → chunk-4LUW26BX.js} +1 -1
  4. package/dist/chunk-5MSNYFDE.js +1 -0
  5. package/dist/chunk-5VSE5X5R.js +2 -0
  6. package/dist/chunk-6EYWFBNG.js +0 -0
  7. package/dist/{chunk-ORAPGW7W.js → chunk-72EEL2DW.js} +1 -1
  8. package/dist/{chunk-T2RPMEM2.js → chunk-7UGNGK7Y.js} +1 -1
  9. package/dist/{chunk-STUZZM5B.js → chunk-AADJ2KIB.js} +1 -1
  10. package/dist/{chunk-SMSIT3CE.js → chunk-B5KB2I7J.js} +1 -1
  11. package/dist/chunk-BHSO2MDK.js +6 -0
  12. package/dist/chunk-BMOJTJJJ.js +3 -0
  13. package/dist/{chunk-EEH4WYI7.js → chunk-CEKXBS55.js} +1 -1
  14. package/dist/chunk-CW53ZTU3.js +2 -0
  15. package/dist/chunk-EWNWKDMP.js +4 -0
  16. package/dist/{chunk-VSP2QQPQ.js → chunk-GIRAEVUJ.js} +1 -1
  17. package/dist/{chunk-MTTKFJV6.js → chunk-GUTQ3PWL.js} +1 -1
  18. package/dist/chunk-HGPUI7F3.js +1 -0
  19. package/dist/{chunk-OBWZ5RYN.js → chunk-HKMBQLEK.js} +1 -1
  20. package/dist/chunk-ITSNK5YG.js +7 -0
  21. package/dist/chunk-KAB3AYA2.js +1 -0
  22. package/dist/{chunk-266RH77Z.js → chunk-LRYE2WCN.js} +1 -1
  23. package/dist/chunk-M5L42DWE.js +7 -0
  24. package/dist/chunk-M5MJP7Z2.js +1 -0
  25. package/dist/chunk-NMFQGKPE.js +2 -0
  26. package/dist/chunk-NTYXZ3EL.js +3 -0
  27. package/dist/{chunk-PETQCA7G.js → chunk-QDST6VIU.js} +1 -1
  28. package/dist/chunk-QIJMV2P2.js +2 -0
  29. package/dist/chunk-RHV5STR3.js +3 -0
  30. package/dist/chunk-ROXXK6TW.js +0 -0
  31. package/dist/chunk-S3ZPXWX7.js +2 -0
  32. package/dist/chunk-SSHZEWWV.js +1 -0
  33. package/dist/chunk-TPIHQYK2.js +14 -0
  34. package/dist/chunk-VZJIZXSH.js +14 -0
  35. package/dist/chunk-YHADTHQM.js +1 -0
  36. package/dist/{chunk-KZBAJFCV.js → chunk-Z3VC3S2T.js} +1 -1
  37. package/dist/{chunk-SJYDLHEF.js → chunk-ZM4L5AGN.js} +1 -1
  38. package/dist/{chunk-E2RESHYR.js → chunk-ZTYWHL2F.js} +1 -1
  39. package/dist/entry-0.js +1 -1
  40. package/dist/entry-1.js +1 -1
  41. package/dist/entry-10.js +1 -1
  42. package/dist/entry-11.js +1 -1
  43. package/dist/entry-12.js +1 -1
  44. package/dist/entry-13.js +1 -1
  45. package/dist/entry-14.js +1 -1
  46. package/dist/entry-2.js +1 -1
  47. package/dist/entry-21.js +2 -1
  48. package/dist/entry-22.js +1 -1
  49. package/dist/entry-23.js +1 -1
  50. package/dist/entry-24.js +1 -1
  51. package/dist/entry-25.js +1 -1
  52. package/dist/entry-26.js +12 -1
  53. package/dist/entry-28.js +1 -1
  54. package/dist/entry-29.js +1 -1
  55. package/dist/entry-30.js +1 -1
  56. package/dist/entry-31.js +4 -1
  57. package/dist/entry-32.js +9 -1
  58. package/dist/entry-33.js +1 -1
  59. package/dist/entry-35.js +1 -1
  60. package/dist/entry-36.js +1 -1
  61. package/dist/entry-37.js +1 -1
  62. package/dist/entry-38.js +1 -1
  63. package/dist/entry-39.js +1 -1
  64. package/dist/entry-4.js +1 -1
  65. package/dist/entry-40.js +18 -1
  66. package/dist/entry-41.js +1 -1
  67. package/dist/entry-42.js +1 -1
  68. package/dist/entry-43.js +1 -1
  69. package/dist/entry-44.js +1 -1
  70. package/dist/entry-45.js +7 -1
  71. package/dist/entry-46.js +11 -1
  72. package/dist/entry-47.js +1 -1
  73. package/dist/entry-48.js +1 -1
  74. package/dist/entry-49.js +1 -1
  75. package/dist/entry-50.js +1 -1
  76. package/dist/entry-51.js +1 -1
  77. package/dist/entry-52.js +1 -1
  78. package/dist/entry-53.js +1 -1
  79. package/dist/entry-54.js +1 -0
  80. package/dist/entry-55.js +0 -1
  81. package/dist/entry-56.js +1 -0
  82. package/dist/entry-57.js +0 -1
  83. package/dist/entry-58.js +1 -1
  84. package/dist/entry-59.js +1 -1
  85. package/dist/entry-60.js +1 -1
  86. package/dist/entry-61.js +1 -1
  87. package/dist/entry-62.js +1 -1
  88. package/dist/entry-63.js +1 -0
  89. package/dist/entry-64.js +0 -1
  90. package/dist/entry-65.js +1 -0
  91. package/dist/entry-66.js +0 -1
  92. package/dist/entry-67.js +1 -1
  93. package/dist/entry-68.js +1 -1
  94. package/dist/entry-69.js +1 -1
  95. package/dist/entry-70.js +123 -1
  96. package/dist/entry-71.js +30 -1
  97. package/dist/entry-72.js +2 -1
  98. package/dist/entry-73.js +1 -1
  99. package/dist/entry-74.js +1 -1
  100. package/dist/entry-75.js +1 -1
  101. package/dist/entry-76.js +3 -1
  102. package/dist/entry-77.js +1 -1
  103. package/dist/entry-78.js +1 -1
  104. package/dist/entry-79.js +1 -1
  105. package/dist/pi-agent-ide.js +3 -13
  106. package/docs/configuration.md +57 -11
  107. package/docs/extensions.md +4 -2
  108. package/docs/tools.md +7 -1
  109. package/node_modules/pi-agent-doctor/package.json +1 -1
  110. package/node_modules/pi-agent-filesystem/index.ts +2 -2
  111. package/node_modules/pi-agent-filesystem/package.json +6 -6
  112. package/node_modules/pi-agent-filesystem-image/package.json +3 -3
  113. package/node_modules/pi-agent-filesystem-pdf/package.json +3 -3
  114. package/node_modules/pi-agent-filesystem-text/package.json +3 -3
  115. package/node_modules/pi-agent-ide-ast/package.json +9 -9
  116. package/node_modules/pi-agent-ide-ast/src/ast/outline.ts +89 -19
  117. package/node_modules/pi-agent-ide-ast/src/extension.ts +11 -15
  118. package/node_modules/pi-agent-ide-ast/src/overflow-handler.ts +83 -0
  119. package/node_modules/pi-agent-ide-ast/src/scope-handler.ts +8 -1
  120. package/node_modules/pi-agent-ide-ast/src/scope-resolver.ts +1 -1
  121. package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +83 -5
  122. package/node_modules/pi-agent-ide-changes/index.ts +22 -10
  123. package/node_modules/pi-agent-ide-changes/package.json +6 -6
  124. package/node_modules/pi-agent-ide-changes/src/last-text-transaction-store.ts +10 -0
  125. package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +5 -9
  126. package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +1 -5
  127. package/node_modules/pi-agent-ide-formatter/package.json +3 -3
  128. package/node_modules/pi-agent-ide-formatter/src/formatter.ts +36 -13
  129. package/node_modules/pi-agent-ide-formatter/src/registry.ts +9 -1
  130. package/node_modules/pi-agent-ide-languages/package.json +2 -2
  131. package/node_modules/pi-agent-ide-lint/index.ts +49 -17
  132. package/node_modules/pi-agent-ide-lint/package.json +7 -7
  133. package/node_modules/pi-agent-ide-lint/src/registry.ts +9 -1
  134. package/node_modules/pi-agent-ide-lsp/index.ts +127 -20
  135. package/node_modules/pi-agent-ide-lsp/package.json +9 -8
  136. package/node_modules/pi-agent-ide-lsp/src/declaration-targets.ts +61 -0
  137. package/node_modules/pi-agent-ide-lsp/src/diagnostic-source.ts +25 -7
  138. package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +12 -1
  139. package/node_modules/pi-agent-ide-lsp/src/lsp/code-views.ts +40 -0
  140. package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +21 -32
  141. package/node_modules/pi-agent-ide-lsp/src/lsp/registry.ts +15 -2
  142. package/node_modules/pi-agent-ide-lsp/src/lsp/rename.ts +1 -1
  143. package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +32 -5
  144. package/node_modules/pi-agent-ide-lsp/src/rename-plan.ts +138 -0
  145. package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +9 -2
  146. package/node_modules/pi-agent-image/package.json +2 -2
  147. package/node_modules/pi-agent-image/src/image-converter.ts +1 -1
  148. package/node_modules/pi-agent-invariant/package.json +1 -1
  149. package/node_modules/pi-agent-pdf/package.json +2 -2
  150. package/node_modules/pi-agent-pdf/src/pdf-converter.ts +1 -1
  151. package/node_modules/pi-agent-read/package.json +6 -6
  152. package/node_modules/pi-agent-read/src/api/plugin-protocol.ts +1 -1
  153. package/node_modules/pi-agent-read/src/api/read-parameters.ts +29 -0
  154. package/node_modules/pi-agent-read/src/api/rendering.ts +3 -0
  155. package/node_modules/pi-agent-read/src/api/tools/read.ts +73 -1
  156. package/node_modules/pi-agent-read/src/core/read-core.ts +32 -28
  157. package/node_modules/pi-agent-read/src/core/tools/read/native-resource-renderer.ts +74 -0
  158. package/node_modules/pi-agent-read/src/core/tools/read/output-truncation.ts +1 -1
  159. package/node_modules/pi-agent-read/src/core/tools/read/raw-read.ts +113 -0
  160. package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +87 -19
  161. package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +15 -0
  162. package/node_modules/pi-agent-read/src/core/tools/read/temp-resource-store.ts +35 -126
  163. package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +87 -53
  164. package/node_modules/pi-agent-resource/package.json +1 -1
  165. package/node_modules/pi-agent-resource/src/content-conversion/content-description.ts +1 -8
  166. package/node_modules/pi-agent-resource/src/resolver.ts +2 -0
  167. package/node_modules/pi-agent-search/package.json +3 -3
  168. package/node_modules/pi-agent-search/src/api/plugin-protocol.ts +1 -1
  169. package/node_modules/pi-agent-search/src/api/search-parameters.ts +25 -0
  170. package/node_modules/pi-agent-search/src/api/search.ts +55 -1
  171. package/node_modules/pi-agent-search/src/core/extension.ts +8 -27
  172. package/node_modules/pi-agent-search/src/core/search-core.ts +38 -3
  173. package/node_modules/pi-agent-search-text/index.ts +82 -33
  174. package/node_modules/pi-agent-search-text/package.json +6 -6
  175. package/node_modules/pi-agent-search-text/src/file-search.ts +9 -1
  176. package/node_modules/pi-agent-search-text/src/resolvers.ts +1 -1
  177. package/node_modules/pi-agent-search-text/src/search-recipe.ts +2 -0
  178. package/node_modules/pi-agent-search-text/src/search-session.ts +112 -24
  179. package/node_modules/pi-agent-text/package.json +2 -2
  180. package/node_modules/pi-agent-text/src/text-converter.ts +1 -1
  181. package/node_modules/pi-agent-text/src/text-document.ts +5 -0
  182. package/node_modules/pi-agent-text/src/text-target.ts +4 -0
  183. package/node_modules/pi-agent-text-anchor-constant/package.json +3 -3
  184. package/node_modules/pi-agent-text-anchor-exact/package.json +3 -3
  185. package/node_modules/pi-agent-text-anchor-line-hash/index.ts +2 -6
  186. package/node_modules/pi-agent-text-anchor-line-hash/package.json +5 -5
  187. package/node_modules/pi-agent-text-anchor-line-hash/src/read-handler.ts +1 -0
  188. package/node_modules/pi-agent-text-editor/index.ts +1 -3
  189. package/node_modules/pi-agent-text-editor/package.json +34 -24
  190. package/node_modules/pi-agent-text-editor/runtime/entry-69.js +0 -1
  191. package/node_modules/pi-agent-text-editor/src/api/apply-renderer.ts +3 -0
  192. package/node_modules/pi-agent-text-editor/src/api/edit-completion.ts +2 -0
  193. package/node_modules/pi-agent-text-editor/src/api/edit-pipeline.ts +15 -0
  194. package/node_modules/pi-agent-text-editor/src/api/last-resolved-resource.ts +5 -0
  195. package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +3 -0
  196. package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +15 -1
  197. package/node_modules/pi-agent-text-editor/src/api/post-edit.ts +74 -1
  198. package/node_modules/pi-agent-text-editor/src/core/apply/execution.ts +237 -0
  199. package/node_modules/pi-agent-text-editor/src/core/apply/final-mutations.ts +50 -0
  200. package/node_modules/pi-agent-text-editor/src/core/apply/format-source.ts +11 -0
  201. package/node_modules/pi-agent-text-editor/src/core/apply/mixed-source.ts +208 -0
  202. package/node_modules/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +39 -0
  203. package/node_modules/pi-agent-text-editor/src/core/apply/output.ts +216 -0
  204. package/node_modules/pi-agent-text-editor/src/core/apply/prompt.ts +45 -0
  205. package/node_modules/pi-agent-text-editor/src/core/apply/queue.ts +25 -0
  206. package/node_modules/pi-agent-text-editor/src/core/apply/renderer.ts +324 -0
  207. package/node_modules/pi-agent-text-editor/src/core/apply/results.ts +133 -0
  208. package/node_modules/pi-agent-text-editor/src/core/apply/runtime.ts +112 -0
  209. package/node_modules/pi-agent-text-editor/src/core/apply/tool.ts +132 -0
  210. package/node_modules/pi-agent-text-editor/src/core/builtin-edit-filter.ts +4 -12
  211. package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +205 -0
  212. package/node_modules/pi-agent-text-editor/src/core/extension.ts +13 -9
  213. package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +76 -0
  214. package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +153 -0
  215. package/node_modules/pi-agent-text-editor/src/core/mutation-result/diff.ts +5 -2
  216. package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +28 -2
  217. package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +43 -0
  218. package/node_modules/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +2 -0
  219. package/node_modules/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +81 -0
  220. package/node_modules/pi-agent-text-editor/src/core/post-edit-scope.ts +73 -0
  221. package/node_modules/pi-agent-text-editor/src/core/text-anchor-registry.ts +5 -2
  222. package/node_modules/pi-agent-text-editor/src/core/text-change-engine.ts +10 -2
  223. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +40 -0
  224. package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +178 -58
  225. package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +313 -21
  226. package/node_modules/pi-agent-text-editor/src/tools/text-selection.ts +45 -43
  227. package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +18 -8
  228. package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +7 -4
  229. package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +13 -5
  230. package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +18 -8
  231. package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +9 -5
  232. package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +2 -1
  233. package/node_modules/pi-agent-text-editor-renderer/index.ts +93 -2
  234. package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
  235. package/node_modules/pi-agent-text-editor-renderer/src/diff-model.ts +7 -0
  236. package/node_modules/pi-agent-text-editor-renderer/src/diff-renderer.ts +1 -1
  237. package/node_modules/pi-agent-text-editor-renderer/src/diff-viewport.ts +11 -2
  238. package/node_modules/pi-agent-text-editor-renderer/src/frozen-viewport.ts +140 -52
  239. package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +69 -4
  240. package/node_modules/pi-agent-text-editor-renderer/src/mutation-result.ts +53 -1
  241. package/node_modules/pi-agent-text-editor-renderer/src/persisted-result.ts +8 -2
  242. package/node_modules/pi-agent-text-editor-renderer/src/render-resource.ts +10 -0
  243. package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +24 -13
  244. package/node_modules/pi-agent-text-editor-renderer/src/status-summary.ts +33 -0
  245. package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
  246. package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
  247. package/node_modules/pi-agent-tool-call-interception/runtime/entry-73.js +1 -0
  248. package/node_modules/pi-agent-tool-call-interception/src/index.ts +3 -0
  249. package/node_modules/pi-agent-tool-ui/package.json +2 -2
  250. package/node_modules/pi-agent-web/index.ts +1 -6
  251. package/node_modules/pi-agent-web/package.json +7 -7
  252. package/node_modules/pi-agent-web/runtime/entry-75.js +2 -0
  253. package/node_modules/pi-agent-web/src/browser-loader.ts +1 -0
  254. package/node_modules/pi-agent-web-html/package.json +3 -3
  255. package/node_modules/pi-agent-web-html/src/html-converter.ts +1 -1
  256. package/node_modules/pi-agent-web-image/package.json +4 -4
  257. package/node_modules/pi-agent-web-pdf/package.json +4 -4
  258. package/node_modules/pi-agent-web-text/package.json +4 -4
  259. package/package.json +38 -38
  260. package/src/api/plugin-protocol.ts +12 -2
  261. package/src/api/text-editor.ts +7 -0
  262. package/src/api/tool-config.ts +77 -2
  263. package/src/code-view/diagnostic-view.ts +22 -3
  264. package/src/composite/builtin-extensions.ts +138 -67
  265. package/src/composite/extensions-config.ts +59 -0
  266. package/src/composite/feature-flags.ts +32 -0
  267. package/src/composite/module-labels.ts +55 -0
  268. package/src/composite/module-settings-store.ts +44 -0
  269. package/src/composite/module-settings.ts +132 -0
  270. package/src/composite/selection.ts +4 -4
  271. package/src/composite/settings-panel.ts +71 -0
  272. package/src/core/diagnostic-delivery.ts +29 -0
  273. package/src/core/diagnostic-entry.ts +142 -0
  274. package/src/core/diagnostic-store.ts +96 -23
  275. package/src/core/extension.ts +45 -22
  276. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +2 -2
  277. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +6 -6
  278. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +3 -3
  279. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +3 -3
  280. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +3 -3
  281. package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +1 -6
  282. package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +7 -7
  283. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -3
  284. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-76.js +2 -0
  285. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/src/html-converter.ts +1 -1
  286. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
  287. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
  288. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
  289. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-75.js +2 -0
  290. package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/browser-loader.ts +1 -0
  291. package/src/extensions/pi-agent-read/package.json +6 -6
  292. package/src/extensions/pi-agent-read/src/api/plugin-protocol.ts +1 -1
  293. package/src/extensions/pi-agent-read/src/api/read-parameters.ts +29 -0
  294. package/src/extensions/pi-agent-read/src/api/rendering.ts +3 -0
  295. package/src/extensions/pi-agent-read/src/api/tools/read.ts +73 -1
  296. package/src/extensions/pi-agent-read/src/core/read-core.ts +32 -28
  297. package/src/extensions/pi-agent-read/src/core/tools/read/native-resource-renderer.ts +74 -0
  298. package/src/extensions/pi-agent-read/src/core/tools/read/output-truncation.ts +1 -1
  299. package/src/extensions/pi-agent-read/src/core/tools/read/raw-read.ts +113 -0
  300. package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +87 -19
  301. package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +15 -0
  302. package/src/extensions/pi-agent-read/src/core/tools/read/temp-resource-store.ts +35 -126
  303. package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +87 -53
  304. package/src/extensions/pi-agent-search/package.json +3 -3
  305. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +82 -33
  306. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +6 -6
  307. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/file-search.ts +9 -1
  308. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +1 -1
  309. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +2 -0
  310. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +112 -24
  311. package/src/extensions/pi-agent-search/src/api/plugin-protocol.ts +1 -1
  312. package/src/extensions/pi-agent-search/src/api/search-parameters.ts +25 -0
  313. package/src/extensions/pi-agent-search/src/api/search.ts +55 -1
  314. package/src/extensions/pi-agent-search/src/core/extension.ts +8 -27
  315. package/src/extensions/pi-agent-search/src/core/search-core.ts +38 -3
  316. package/src/extensions/pi-agent-text-editor/index.ts +1 -3
  317. package/src/extensions/pi-agent-text-editor/package.json +34 -24
  318. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +3 -3
  319. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +3 -3
  320. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +2 -6
  321. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +5 -5
  322. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/read-handler.ts +1 -0
  323. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +93 -2
  324. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
  325. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-model.ts +7 -0
  326. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-renderer.ts +1 -1
  327. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-viewport.ts +11 -2
  328. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/frozen-viewport.ts +140 -52
  329. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +69 -4
  330. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-result.ts +53 -1
  331. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/persisted-result.ts +8 -2
  332. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/render-resource.ts +10 -0
  333. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +24 -13
  334. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/status-summary.ts +33 -0
  335. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -5
  336. package/src/extensions/pi-agent-text-editor/runtime/entry-69.js +0 -1
  337. package/src/extensions/pi-agent-text-editor/runtime/entry-70.js +2 -0
  338. package/src/extensions/pi-agent-text-editor/src/api/apply-renderer.ts +3 -0
  339. package/src/extensions/pi-agent-text-editor/src/api/edit-completion.ts +2 -0
  340. package/src/extensions/pi-agent-text-editor/src/api/edit-pipeline.ts +15 -0
  341. package/src/extensions/pi-agent-text-editor/src/api/last-resolved-resource.ts +5 -0
  342. package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +3 -0
  343. package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +15 -1
  344. package/src/extensions/pi-agent-text-editor/src/api/post-edit.ts +74 -1
  345. package/src/extensions/pi-agent-text-editor/src/core/apply/execution.ts +237 -0
  346. package/src/extensions/pi-agent-text-editor/src/core/apply/final-mutations.ts +50 -0
  347. package/src/extensions/pi-agent-text-editor/src/core/apply/format-source.ts +11 -0
  348. package/src/extensions/pi-agent-text-editor/src/core/apply/mixed-source.ts +208 -0
  349. package/src/extensions/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +39 -0
  350. package/src/extensions/pi-agent-text-editor/src/core/apply/output.ts +216 -0
  351. package/src/extensions/pi-agent-text-editor/src/core/apply/prompt.ts +45 -0
  352. package/src/extensions/pi-agent-text-editor/src/core/apply/queue.ts +25 -0
  353. package/src/extensions/pi-agent-text-editor/src/core/apply/renderer.ts +324 -0
  354. package/src/extensions/pi-agent-text-editor/src/core/apply/results.ts +133 -0
  355. package/src/extensions/pi-agent-text-editor/src/core/apply/runtime.ts +112 -0
  356. package/src/extensions/pi-agent-text-editor/src/core/apply/tool.ts +132 -0
  357. package/src/extensions/pi-agent-text-editor/src/core/builtin-edit-filter.ts +4 -12
  358. package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +205 -0
  359. package/src/extensions/pi-agent-text-editor/src/core/extension.ts +13 -9
  360. package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +76 -0
  361. package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +153 -0
  362. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/diff.ts +5 -2
  363. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +28 -2
  364. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +43 -0
  365. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +2 -0
  366. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +81 -0
  367. package/src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts +73 -0
  368. package/src/extensions/pi-agent-text-editor/src/core/text-anchor-registry.ts +5 -2
  369. package/src/extensions/pi-agent-text-editor/src/core/text-change-engine.ts +10 -2
  370. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +40 -0
  371. package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +178 -58
  372. package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +313 -21
  373. package/src/extensions/pi-agent-text-editor/src/tools/text-selection.ts +45 -43
  374. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +18 -8
  375. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +7 -4
  376. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +13 -5
  377. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +18 -8
  378. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +9 -5
  379. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +2 -1
  380. package/src/pi-agent-ide.ts +45 -0
  381. package/src/plugins/pi-agent-ide-ast/package.json +9 -9
  382. package/src/plugins/pi-agent-ide-ast/src/ast/outline.ts +89 -19
  383. package/src/plugins/pi-agent-ide-ast/src/extension.ts +11 -15
  384. package/src/plugins/pi-agent-ide-ast/src/overflow-handler.ts +83 -0
  385. package/src/plugins/pi-agent-ide-ast/src/scope-handler.ts +8 -1
  386. package/src/plugins/pi-agent-ide-ast/src/scope-resolver.ts +1 -1
  387. package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +83 -5
  388. package/src/plugins/pi-agent-ide-changes/index.ts +22 -10
  389. package/src/plugins/pi-agent-ide-changes/package.json +6 -6
  390. package/src/plugins/pi-agent-ide-changes/src/last-text-transaction-store.ts +10 -0
  391. package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +5 -9
  392. package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +1 -5
  393. package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +62 -26
  394. package/src/plugins/pi-agent-ide-formatter/package.json +3 -3
  395. package/src/plugins/pi-agent-ide-formatter/src/formatter.ts +36 -13
  396. package/src/plugins/pi-agent-ide-formatter/src/registry.ts +9 -1
  397. package/src/plugins/pi-agent-ide-languages/package.json +2 -2
  398. package/src/plugins/pi-agent-ide-lint/index.ts +49 -17
  399. package/src/plugins/pi-agent-ide-lint/package.json +7 -7
  400. package/src/plugins/pi-agent-ide-lint/src/registry.ts +9 -1
  401. package/src/plugins/pi-agent-ide-lsp/index.ts +127 -20
  402. package/src/plugins/pi-agent-ide-lsp/package.json +9 -8
  403. package/src/plugins/pi-agent-ide-lsp/src/declaration-targets.ts +61 -0
  404. package/src/plugins/pi-agent-ide-lsp/src/diagnostic-source.ts +25 -7
  405. package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +12 -1
  406. package/src/plugins/pi-agent-ide-lsp/src/lsp/code-views.ts +40 -0
  407. package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +21 -32
  408. package/src/plugins/pi-agent-ide-lsp/src/lsp/registry.ts +15 -2
  409. package/src/plugins/pi-agent-ide-lsp/src/lsp/rename.ts +1 -1
  410. package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +32 -5
  411. package/src/plugins/pi-agent-ide-lsp/src/rename-plan.ts +138 -0
  412. package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +9 -2
  413. package/src/post-edit/gate.ts +57 -15
  414. package/src/toolchain/types.ts +2 -0
  415. package/dist/chunk-2SKAED2I.js +0 -2
  416. package/dist/chunk-2XYXV5HS.js +0 -4
  417. package/dist/chunk-2ZMYT6ZC.js +0 -1
  418. package/dist/chunk-34ZQTTU2.js +0 -2
  419. package/dist/chunk-4SQQKEVD.js +0 -16
  420. package/dist/chunk-5BWUVAR4.js +0 -1
  421. package/dist/chunk-6DN7NO7L.js +0 -1
  422. package/dist/chunk-6SMFVLTY.js +0 -1
  423. package/dist/chunk-6XQQBKPE.js +0 -58
  424. package/dist/chunk-BYWAG6X3.js +0 -6
  425. package/dist/chunk-EW2KVKCN.js +0 -2
  426. package/dist/chunk-F6SESI3P.js +0 -4
  427. package/dist/chunk-GTK5AREE.js +0 -2
  428. package/dist/chunk-HOBTFFQR.js +0 -1
  429. package/dist/chunk-IMVCVPMP.js +0 -3
  430. package/dist/chunk-IOCABSRL.js +0 -1
  431. package/dist/chunk-JASLOB2X.js +0 -1
  432. package/dist/chunk-KH5KPBCR.js +0 -10
  433. package/dist/chunk-KNMWCDDK.js +0 -7
  434. package/dist/chunk-KYVOMBO5.js +0 -1
  435. package/dist/chunk-L4FA6OD4.js +0 -1
  436. package/dist/chunk-LFV6G5Z3.js +0 -1
  437. package/dist/chunk-LGN7EJYR.js +0 -13
  438. package/dist/chunk-MB6VVVAF.js +0 -2
  439. package/dist/chunk-MTQSGWZJ.js +0 -1
  440. package/dist/chunk-NI2NK4JU.js +0 -1
  441. package/dist/chunk-NXHPO7ER.js +0 -6
  442. package/dist/chunk-OFHVDY4Q.js +0 -2
  443. package/dist/chunk-OIL6BB2S.js +0 -33
  444. package/dist/chunk-ONWUJXUR.js +0 -1
  445. package/dist/chunk-PODWLGNO.js +0 -6
  446. package/dist/chunk-QZANC2IG.js +0 -1
  447. package/dist/chunk-SSZB66C3.js +0 -3
  448. package/dist/chunk-TG6H6EOI.js +0 -1
  449. package/dist/chunk-UTTW55S2.js +0 -1
  450. package/dist/chunk-VEJGSURY.js +0 -8
  451. package/dist/chunk-W3XYKJ5H.js +0 -1
  452. package/dist/chunk-XGUAL3CA.js +0 -1
  453. package/dist/chunk-YPHXLAQF.js +0 -1
  454. package/dist/chunk-ZIHEF6K3.js +0 -3
  455. package/dist/entry-80.js +0 -1
  456. package/node_modules/pi-agent-read/src/core/tools/read/views.ts +0 -29
  457. package/node_modules/pi-agent-text-editor/src/core/tool-description.ts +0 -14
  458. package/node_modules/pi-agent-text-editor-argument-order/index.ts +0 -26
  459. package/node_modules/pi-agent-text-editor-argument-order/package.json +0 -16
  460. package/node_modules/pi-agent-text-editor-argument-order/src/argument-order-guard.ts +0 -100
  461. package/node_modules/pi-agent-text-editor-overwrite/index.ts +0 -365
  462. package/node_modules/pi-agent-text-editor-overwrite/package.json +0 -17
  463. package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +0 -2
  464. package/node_modules/pi-agent-tool-ui/runtime/entry-75.js +0 -1
  465. package/node_modules/pi-agent-web-text/runtime/entry-80.js +0 -2
  466. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-80.js +0 -2
  467. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-76.js +0 -2
  468. package/src/extensions/pi-agent-read/src/core/tools/read/views.ts +0 -29
  469. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/index.ts +0 -26
  470. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/package.json +0 -16
  471. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/runtime/entry-70.js +0 -2
  472. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/src/argument-order-guard.ts +0 -100
  473. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/index.ts +0 -365
  474. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/package.json +0 -17
  475. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +0 -2
  476. package/src/extensions/pi-agent-text-editor/src/core/tool-description.ts +0 -14
  477. /package/dist/{chunk-3H2EU7VQ.js → chunk-4U2GUKNJ.js} +0 -0
  478. /package/node_modules/{pi-agent-text-editor-argument-order → pi-agent-text-editor}/runtime/entry-70.js +0 -0
  479. /package/node_modules/{pi-agent-text-editor-overwrite → pi-agent-text-editor-renderer}/runtime/entry-71.js +0 -0
  480. /package/node_modules/{pi-agent-text-editor-renderer → pi-agent-text-editor-stale-anchor}/runtime/entry-72.js +0 -0
  481. /package/node_modules/{pi-agent-tool-call-interception → pi-agent-tool-ui}/runtime/entry-74.js +0 -0
  482. /package/node_modules/{pi-agent-web → pi-agent-web-html}/runtime/entry-76.js +0 -0
  483. /package/node_modules/{pi-agent-web-html → pi-agent-web-image}/runtime/entry-77.js +0 -0
  484. /package/node_modules/{pi-agent-web-image → pi-agent-web-pdf}/runtime/entry-78.js +0 -0
  485. /package/node_modules/{pi-agent-web-pdf → pi-agent-web-text}/runtime/entry-79.js +0 -0
  486. /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-html → pi-agent-web-image}/runtime/entry-77.js +0 -0
  487. /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-image → pi-agent-web-pdf}/runtime/entry-78.js +0 -0
  488. /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-pdf → pi-agent-web-text}/runtime/entry-79.js +0 -0
  489. /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-overwrite → pi-agent-text-editor-renderer}/runtime/entry-71.js +0 -0
  490. /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-renderer → pi-agent-text-editor-stale-anchor}/runtime/entry-72.js +0 -0
@@ -13,29 +13,38 @@ export const copySchema = Type.Object(
13
13
  {
14
14
  path: Type.Optional(
15
15
  Type.String({
16
- description:
17
- "Source resource reference or file path; a typed resource may select one source span",
16
+ description: "Source file path, or a returned SEARCH# reference selecting the text to copy",
18
17
  }),
19
18
  ),
20
19
  start: Type.Optional(
21
20
  Type.String({
22
- description: "Registered text anchor or unique exact text at the source start",
21
+ description:
22
+ "Anchor or unique exact text. Alone, selects that fragment; a line anchor selects only its line. Omit when path already selects text through a supported resource reference. With end, selects a whole-line range.",
23
+ }),
24
+ ),
25
+ end: Type.Optional(
26
+ Type.String({
27
+ description:
28
+ "Optional anchor or unique exact text. Range includes start's first line through end's last line, even for SEARCH :match. Mixed types allowed; boundaries must be unique, in one file, and forward-ordered. Omit when start already selects the intended content; do not repeat start. The end line is included, not a stopping point before it.",
23
29
  }),
24
30
  ),
25
- end: Type.Optional(Type.String({ description: "Source end anchor; defaults to start" })),
26
31
  target: Type.Optional(
27
32
  Type.String({
28
33
  description:
29
- "Target resource reference or file path; a typed resource may select the destination; defaults to the source",
34
+ "Target resource reference or file path; a returned SEARCH# reference may select the destination; defaults to the source",
30
35
  }),
31
36
  ),
32
37
  targetStart: Type.Optional(
33
38
  Type.String({
34
- description: "Target anchor; copied text is inserted after it when targetEnd is omitted",
39
+ description:
40
+ "Registered anchor or unique exact text in the destination. Required unless target already selects one destination range. Without targetEnd, inserts after the last containing line, keeping the selected text. With targetEnd, replacement starts at the first containing line. SEARCH :match also uses these line boundaries.",
35
41
  }),
36
42
  ),
37
43
  targetEnd: Type.Optional(
38
- Type.String({ description: "Target end anchor; the natural target range is replaced" }),
44
+ Type.String({
45
+ description:
46
+ "Optional inclusive destination end. Replaces whole lines through the last line containing this anchor, including SEARCH :match. May differ in type from targetStart; both must resolve uniquely in the target file and in forward order. Omit to insert after targetStart instead.",
47
+ }),
39
48
  ),
40
49
  },
41
50
  { additionalProperties: false },
@@ -52,7 +61,8 @@ interface CopyParameters {
52
61
 
53
62
  export const copyMutationTool: TextMutationToolRegistration<typeof copySchema> = {
54
63
  name: "copy",
55
- description: "Copy one span or an anchor range, then insert it or replace a target range.",
64
+ description:
65
+ "Use copy to duplicate existing text within or between files while keeping the source. Select the source and destination without reproducing the text in your call. The copy is inserted at the destination or replaces a destination range.",
56
66
 
57
67
  promptSnippet:
58
68
  "Make precise file edits by copying text within or between files using exact matches or anchors",
@@ -15,17 +15,19 @@ export const deleteSchema = Type.Object(
15
15
  path: Type.Optional(
16
16
  Type.String({
17
17
  description:
18
- "Source resource reference or file path. A typed SEARCH#... resource can select deletion ranges.",
18
+ "Source resource reference or file path. A returned SEARCH# reference can select deletion ranges.",
19
19
  }),
20
20
  ),
21
21
  start: Type.Optional(
22
22
  Type.String({
23
- description: "Registered text anchor or unique exact text selecting the first span",
23
+ description:
24
+ "Anchor or unique exact text. Alone, selects that fragment; a line anchor selects only its line. Omit when path already selects text through a supported resource reference. With end, selects a whole-line range.",
24
25
  }),
25
26
  ),
26
27
  end: Type.Optional(
27
28
  Type.String({
28
- description: "Registered text anchor or unique exact text selecting the last span",
29
+ description:
30
+ "Optional anchor or unique exact text. Range includes start's first line through end's last line, even for SEARCH :match. Mixed types allowed; boundaries must be unique, in one file, and forward-ordered. Omit when start already selects the intended content; do not repeat start. The end line is included, not a stopping point before it.",
29
31
  }),
30
32
  ),
31
33
  },
@@ -40,7 +42,8 @@ interface DeleteParameters {
40
42
 
41
43
  export const deleteMutationTool: TextMutationToolRegistration<typeof deleteSchema> = {
42
44
  name: "delete",
43
- description: "Delete one selected span or the natural range between two anchors.",
45
+ description:
46
+ "Use delete to remove an existing text fragment or an inclusive range of whole lines. Select only the content to remove; surrounding text is kept.",
44
47
 
45
48
  promptSnippet: "Make precise file edits by deleting text using exact matches or anchors",
46
49
  parameters: deleteSchema,
@@ -15,17 +15,24 @@ export const insertSchema = Type.Object(
15
15
  path: Type.Optional(
16
16
  Type.String({
17
17
  description:
18
- "Source resource reference or file path. A typed SEARCH#... resource can select insertion positions.",
18
+ "Source resource reference or file path. A returned SEARCH# reference can select insertion positions.",
19
19
  }),
20
20
  ),
21
21
  anchor: Type.Optional(
22
22
  Type.String({
23
- description: "Registered text anchor or unique exact text span",
23
+ description:
24
+ "Registered anchor or unique exact text locating the insertion. Required unless path already supplies a SEARCH selection. Inserts after the last containing line by default, or before the first containing line when before is true. This includes SEARCH :match and multiline exact text; the selected text is kept. Multiple matches on the same insertion line produce one insertion.",
24
25
  }),
25
26
  ),
26
- text: Type.String({ description: "Content to insert" }),
27
+ text: Type.String({
28
+ description:
29
+ "New text only. The tool supplies the line boundary; do not prefix a newline just to start a new line. For example, 'NEW' inserts one line, while '\\nNEW' intentionally adds a blank line before it. A missing trailing newline is supplied before following text; additional newlines remain intentional blank lines. When appending after an unterminated final line, the tool supplies the separator before the new text and removes one trailing newline from the payload. Payload line endings follow the destination file's LF/CRLF style.",
30
+ }),
27
31
  before: Type.Optional(
28
- Type.Boolean({ description: "Insert before the anchor instead of after it" }),
32
+ Type.Boolean({
33
+ description:
34
+ "Defaults to false: insert after the last containing line. True: insert before the first containing line. The anchor's text and its lines are kept.",
35
+ }),
29
36
  ),
30
37
  },
31
38
  { additionalProperties: false },
@@ -40,7 +47,8 @@ interface InsertParameters {
40
47
 
41
48
  export const insertMutationTool: TextMutationToolRegistration<typeof insertSchema> = {
42
49
  name: "insert",
43
- description: "Insert text before or after a registered anchor or one unique exact text span.",
50
+ description:
51
+ "Use insert to add new text before or after selected lines while keeping existing text. Insertion is line-based, including for exact-text and SEARCH :match anchors.",
44
52
 
45
53
  promptSnippet:
46
54
  "Make precise file edits by inserting text before or after exact matches or anchors",
@@ -15,29 +15,38 @@ export const moveSchema = Type.Object(
15
15
  {
16
16
  path: Type.Optional(
17
17
  Type.String({
18
- description:
19
- "Source resource reference or file path; a typed resource may select one source span",
18
+ description: "Source file path, or a returned SEARCH# reference selecting the text to move",
20
19
  }),
21
20
  ),
22
21
  start: Type.Optional(
23
22
  Type.String({
24
- description: "Registered text anchor or unique exact text at the source start",
23
+ description:
24
+ "Anchor or unique exact text. Alone, selects that fragment; a line anchor selects only its line. Omit when path already selects text through a supported resource reference. With end, selects a whole-line range.",
25
+ }),
26
+ ),
27
+ end: Type.Optional(
28
+ Type.String({
29
+ description:
30
+ "Optional anchor or unique exact text. Range includes start's first line through end's last line, even for SEARCH :match. Mixed types allowed; boundaries must be unique, in one file, and forward-ordered. Omit when start already selects the intended content; do not repeat start. The end line is included, not a stopping point before it.",
25
31
  }),
26
32
  ),
27
- end: Type.Optional(Type.String({ description: "Source end anchor; defaults to start" })),
28
33
  target: Type.Optional(
29
34
  Type.String({
30
35
  description:
31
- "Target resource reference or file path; a typed resource may select the destination; defaults to the source",
36
+ "Target resource reference or file path; a returned SEARCH# reference may select the destination; defaults to the source",
32
37
  }),
33
38
  ),
34
39
  targetStart: Type.Optional(
35
40
  Type.String({
36
- description: "Target anchor; moved text is inserted after it when targetEnd is omitted",
41
+ description:
42
+ "Registered anchor or unique exact text in the destination. Required unless target already selects one destination range. Without targetEnd, inserts after the last containing line, keeping the selected text. With targetEnd, replacement starts at the first containing line. SEARCH :match also uses these line boundaries.",
37
43
  }),
38
44
  ),
39
45
  targetEnd: Type.Optional(
40
- Type.String({ description: "Target end anchor; the natural target range is replaced" }),
46
+ Type.String({
47
+ description:
48
+ "Optional inclusive destination end. Replaces whole lines through the last line containing this anchor, including SEARCH :match. May differ in type from targetStart; both must resolve uniquely in the target file and in forward order. Omit to insert after targetStart instead.",
49
+ }),
41
50
  ),
42
51
  },
43
52
  { additionalProperties: false },
@@ -54,7 +63,8 @@ interface MoveParameters {
54
63
 
55
64
  export const moveMutationTool: TextMutationToolRegistration<typeof moveSchema> = {
56
65
  name: "move",
57
- description: "Move one span or an anchor range, then insert it or replace a target range.",
66
+ description:
67
+ "Use move to relocate existing text within or between files. Select the source and destination without reproducing the text in your call. The selected text is removed from the source and inserted at the destination, or replaces a destination range.",
58
68
 
59
69
  promptSnippet:
60
70
  "Make precise file edits by moving text within or between files using exact matches or anchors",
@@ -15,21 +15,25 @@ export const replaceSchema = Type.Object(
15
15
  path: Type.Optional(
16
16
  Type.String({
17
17
  description:
18
- "Source resource reference or file path. A typed SEARCH#... resource can select replacement ranges.",
18
+ "Source resource reference or file path. A returned SEARCH# reference can select replacement ranges.",
19
19
  }),
20
20
  ),
21
21
  start: Type.Optional(
22
22
  Type.String({
23
23
  description:
24
- "Registered text anchor or unique exact text selecting the first span to replace",
24
+ "Anchor or unique exact text. Alone, selects that fragment; a line anchor selects only its line. Omit when path already selects text through a supported resource reference. With end, selects a whole-line range.",
25
25
  }),
26
26
  ),
27
27
  end: Type.Optional(
28
28
  Type.String({
29
- description: "Registered text anchor or unique exact text selecting the last span",
29
+ description:
30
+ "Optional anchor or unique exact text. Range includes start's first line through end's last line, even for SEARCH :match. Mixed types allowed; boundaries must be unique, in one file, and forward-ordered. Omit when start already selects the intended content; do not repeat start. The end line is included, not a stopping point before it.",
30
31
  }),
31
32
  ),
32
- text: Type.String({ description: "Replacement text" }),
33
+ text: Type.String({
34
+ description:
35
+ "Replacement text. Empty text removes the selection; a whole-line selection removes its lines without inserting a blank line. Adjacent unselected lines are kept.",
36
+ }),
33
37
  },
34
38
  { additionalProperties: false },
35
39
  );
@@ -44,7 +48,7 @@ interface ReplaceParameters {
44
48
  export const replaceMutationTool: TextMutationToolRegistration<typeof replaceSchema> = {
45
49
  name: "replace",
46
50
  description:
47
- "Replace one span, a range between anchors, or every exact search match. A unique unregistered value is exact text.",
51
+ "Use replace to change an existing text fragment, an inclusive line range, or every selected search match. Exact text must be unique; SEARCH#...:all:match selects every returned match for replacement.",
48
52
 
49
53
  promptSnippet: "Make precise file edits by replacing text using exact matches or anchors",
50
54
  parameters: replaceSchema,
@@ -17,7 +17,8 @@ interface WriteParameters {
17
17
 
18
18
  export const writeMutationTool: TextMutationToolRegistration<typeof writeSchema> = {
19
19
  name: "write",
20
- description: "Create a file or overwrite its complete text.",
20
+ description:
21
+ "Use write to create a new file or deliberately replace a file's entire contents. Supply the complete new text; existing contents are overwritten.",
21
22
 
22
23
  promptSnippet: "Create or overwrite files",
23
24
  parameters: writeSchema,
@@ -4,6 +4,8 @@ import {
4
4
  resolvePiAgentIdeExtensionsConfigPaths,
5
5
  } from "#src/composite/extensions-config.js";
6
6
  import { selectBuiltinExtensions } from "#src/composite/selection.js";
7
+ import { registerModuleSettings } from "#src/composite/module-settings.js";
8
+ import { createFeatureFlags } from "#src/composite/feature-flags.js";
7
9
 
8
10
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
9
11
 
@@ -21,6 +23,49 @@ export default async function registerUnifiedPiAgentIde(pi: ExtensionAPI): Promi
21
23
  return systemPrompt === event.systemPrompt ? undefined : { systemPrompt };
22
24
  });
23
25
  const config = await readPiAgentIdeExtensionsConfig(resolvePiAgentIdeExtensionsConfigPaths());
26
+ const flags = createFeatureFlags(pi, {
27
+ "pi-agent-ide-no-animations": config.noAnimations ?? false,
28
+ "pi-agent-ide-no-post-processing": config.noPostProcessing ?? false,
29
+ ...config.flags,
30
+ });
31
+ flags.register({
32
+ id: "pi-agent-ide-no-animations",
33
+ name: "Static edit previews",
34
+ group: "ui",
35
+ description: "Show edit results immediately, without animated playback.",
36
+ default: false,
37
+ });
38
+ flags.register({
39
+ id: "pi-agent-ide-no-post-processing",
40
+ name: "Skip automatic post-processing",
41
+ description:
42
+ "Skip automatic formatting and diagnostics after edits. Explicit diagnostic reads still work.",
43
+ default: false,
44
+ });
45
+ flags.register({
46
+ id: "pi-agent-ide-no-apply",
47
+ name: "Disable Apply",
48
+ description: "Hide the Apply tool. Standalone read, search and editing tools remain available.",
49
+ default: false,
50
+ });
51
+ flags.register({
52
+ id: "pi-agent-ide-apply-code",
53
+ name: "Apply presentation",
54
+ description:
55
+ "Mixed compacts written tool calls during streaming. Code shows the full script. Expanded always exposes the source.",
56
+ group: "ui",
57
+ labels: { on: "Code", off: "Mixed" },
58
+ default: false,
59
+ });
60
+ flags.register({
61
+ id: "pi-agent-ide-no-diagnostic-buffer",
62
+ name: "Immediate diagnostic notices",
63
+ description:
64
+ "Send findings immediately instead of combining reports received over five seconds.",
65
+ group: "ui",
66
+ default: false,
67
+ });
68
+ registerModuleSettings(pi, flags.definitions);
24
69
  const { enabled } = selectBuiltinExtensions(BUILTIN_EXTENSIONS, config.disabled, config.enabled);
25
70
 
26
71
  for (const extension of enabled) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-ide-ast",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
@@ -14,13 +14,13 @@
14
14
  "dependencies": {
15
15
  "@tree-sitter-grammars/tree-sitter-toml": "^0.7.0",
16
16
  "@tree-sitter-grammars/tree-sitter-yaml": "^0.7.1",
17
- "pi-agent-doctor": "0.2.1",
18
- "pi-agent-invariant": "0.2.1",
19
- "pi-agent-read": "0.2.1",
20
- "pi-agent-resource": "0.2.1",
21
- "pi-agent-search": "0.2.1",
22
- "pi-agent-text": "0.2.1",
23
- "pi-agent-text-editor": "0.2.1",
17
+ "pi-agent-doctor": "0.3.0",
18
+ "pi-agent-invariant": "0.3.0",
19
+ "pi-agent-read": "0.3.0",
20
+ "pi-agent-resource": "0.3.0",
21
+ "pi-agent-search": "0.3.0",
22
+ "pi-agent-text": "0.3.0",
23
+ "pi-agent-text-editor": "0.3.0",
24
24
  "tree-sitter-cpp": "^0.23.4",
25
25
  "tree-sitter-javascript": "^0.25.0",
26
26
  "tree-sitter-json": "^0.24.8",
@@ -36,6 +36,6 @@
36
36
  },
37
37
  "peerDependencies": {
38
38
  "@earendil-works/pi-coding-agent": "*",
39
- "pi-agent-ide": "0.2.1"
39
+ "pi-agent-ide": "0.3.0"
40
40
  }
41
41
  }
@@ -134,6 +134,9 @@ export function formatAstOutline(block: SourceViewBlock): SourceMappedTextConten
134
134
  export class AstOutlineManager {
135
135
  private readonly fallbackScopeManager = new AstScopeManager();
136
136
 
137
+ /** Limit syntax-tree nesting for automatic overviews; explicit outlines keep their existing depth. */
138
+ public constructor(private readonly maxDepth = Number.POSITIVE_INFINITY) {}
139
+
137
140
  public async readFileOutline(filePath: string, cwd: string): Promise<SourceViewBlock> {
138
141
  const absolutePath = resolvePath(filePath, cwd);
139
142
  const displayPath = path.relative(cwd, absolutePath) || absolutePath;
@@ -143,21 +146,50 @@ export class AstOutlineManager {
143
146
  }
144
147
 
145
148
  const snapshot = await readTextFile(absolutePath);
146
- const tree = await parseDocument(absolutePath, cwd, snapshot.lines);
149
+ return this.readDocumentOutline(absolutePath, cwd, snapshot.lines);
150
+ }
151
+
152
+ /** Build an outline from the read snapshot. With a finite depth and a budget
153
+ * predicate, reduce nesting until it fits or reaches file-only detail. Parse once.
154
+ */
155
+ public async readDocumentOutline(
156
+ filePath: string,
157
+ cwd: string,
158
+ lines: readonly string[],
159
+ fits?: (outline: SourceViewBlock) => boolean,
160
+ ): Promise<SourceViewBlock> {
161
+ const absolutePath = resolvePath(filePath, cwd);
162
+ const displayPath = path.relative(cwd, absolutePath) || absolutePath;
163
+ if (!isSupportedOutlinePath(absolutePath)) {
164
+ throw new Error(`AST outline is not supported for ${displayPath}.`);
165
+ }
166
+ const tree = await parseDocument(absolutePath, cwd, lines);
147
167
 
148
168
  if (!tree) {
149
169
  throw new Error(`No AST parser is available for ${displayPath}.`);
150
170
  }
171
+ if (Number.isFinite(this.maxDepth) && tree.rootNode.hasError) {
172
+ throw new Error(`Cannot build an automatic outline from invalid syntax in ${displayPath}.`);
173
+ }
151
174
 
152
- return await this.createSourceViewBlock(
153
- tree.rootNode,
154
- absolutePath,
155
- displayPath,
156
- cwd,
157
- snapshot.lines,
158
- snapshot.content,
159
- path.extname(absolutePath).toLowerCase(),
160
- );
175
+ const content = lines.join("\n");
176
+ for (let depth = this.maxDepth; ; depth -= 1) {
177
+ const outline = await this.createSourceViewBlock(
178
+ tree.rootNode,
179
+ absolutePath,
180
+ displayPath,
181
+ cwd,
182
+ lines,
183
+ content,
184
+ path.extname(absolutePath).toLowerCase(),
185
+ undefined,
186
+ undefined,
187
+ depth,
188
+ );
189
+ if (fits === undefined || fits(outline) || depth <= 0 || !Number.isFinite(depth)) {
190
+ return outline;
191
+ }
192
+ }
161
193
  }
162
194
 
163
195
  public async formatFile(filePath: string, cwd: string): Promise<SourceMappedTextContent> {
@@ -248,8 +280,9 @@ export class AstOutlineManager {
248
280
  extension: string,
249
281
  heading?: string,
250
282
  details?: readonly string[],
283
+ maxDepth = this.maxDepth,
251
284
  ): Promise<SourceViewBlock> {
252
- const projectedLines = renderNodeLines(node, source, extension);
285
+ const projectedLines = renderNodeLines(node, source, extension, maxDepth);
253
286
  const scopes = await getOutlineScopes(this.fallbackScopeManager, filePath, cwd, sourceLines);
254
287
  const markersByLine = buildScopeMarkers(scopes);
255
288
  const renderedLines = projectedLines.map((line) => {
@@ -439,13 +472,18 @@ interface MappedCharacter {
439
472
  readonly sourceLine?: number;
440
473
  }
441
474
 
442
- function renderNodeLines(node: WTS.Node, source: string, extension: string): ProjectedLine[] {
475
+ function renderNodeLines(
476
+ node: WTS.Node,
477
+ source: string,
478
+ extension: string,
479
+ maxDepth: number,
480
+ ): ProjectedLine[] {
443
481
  const replacements: Replacement[] = [];
444
482
 
445
483
  if (DATA_EXTENSIONS.has(extension)) {
446
- collectDataReplacements(node, extension, replacements);
484
+ collectDataReplacements(node, extension, replacements, maxDepth);
447
485
  } else {
448
- collectReplacements(node, extension, replacements);
486
+ collectReplacements(node, extension, replacements, false, maxDepth);
449
487
  }
450
488
 
451
489
  const start = lineStartAt(source, node.startIndex);
@@ -501,7 +539,10 @@ function mapSourceRange(source: string, start: number, end: number): MappedChara
501
539
  let sourceLine = source.slice(0, start).split("\n").length;
502
540
  const mapped: MappedCharacter[] = [];
503
541
 
504
- for (const char of source.slice(start, end)) {
542
+ // Tree-sitter offsets use UTF-16 code units, just like String.slice/splice offsets.
543
+ // Iterating code points would shift replacements after supplementary characters.
544
+ for (let index = start; index < end; index += 1) {
545
+ const char = requiredValue(source[index]);
505
546
  mapped.push({ char, sourceLine });
506
547
 
507
548
  if (char === "\n") {
@@ -531,11 +572,29 @@ function mapReplacement(replacement: Replacement): MappedCharacter[] {
531
572
  return mapped;
532
573
  }
533
574
 
575
+ function collapseDeepNode(
576
+ node: WTS.Node,
577
+ replacements: Replacement[],
578
+ depth: number,
579
+ maxDepth: number,
580
+ ): boolean {
581
+ if (depth < maxDepth || node.namedChildCount === 0) return false;
582
+ replacements.push({
583
+ start: node.startIndex,
584
+ end: node.endIndex,
585
+ text: "…",
586
+ lineSourceLines: [node.startPosition.row + 1],
587
+ });
588
+ return true;
589
+ }
534
590
  function collectDataReplacements(
535
591
  node: WTS.Node,
536
592
  extension: string,
537
593
  replacements: Replacement[],
594
+ maxDepth: number,
595
+ depth = 0,
538
596
  ): void {
597
+ if (collapseDeepNode(node, replacements, depth, maxDepth)) return;
539
598
  for (const child of node.namedChildren) {
540
599
  if (isDataScalar(child, extension)) {
541
600
  if (!isDataKey(child)) {
@@ -550,7 +609,7 @@ function collectDataReplacements(
550
609
  continue;
551
610
  }
552
611
 
553
- collectDataReplacements(child, extension, replacements);
612
+ collectDataReplacements(child, extension, replacements, maxDepth, depth + 1);
554
613
  }
555
614
  }
556
615
 
@@ -602,9 +661,13 @@ function collectReplacements(
602
661
  node: WTS.Node,
603
662
  extension: string,
604
663
  replacements: Replacement[],
605
- topLevel = false,
664
+ topLevel: boolean,
665
+ maxDepth: number,
666
+ depth = 0,
606
667
  ): void {
607
- if (topLevel && !isTopLevelInterfaceNode(node)) {
668
+ if (collapseDeepNode(node, replacements, depth, maxDepth)) return;
669
+ const keepCall = Number.isFinite(maxDepth) && node.type === "expression_statement";
670
+ if (topLevel && !isTopLevelInterfaceNode(node) && !keepCall) {
608
671
  replacements.push({
609
672
  start: node.startIndex,
610
673
  end: node.endIndex,
@@ -644,7 +707,14 @@ function collectReplacements(
644
707
  }
645
708
 
646
709
  for (const child of node.namedChildren) {
647
- collectReplacements(child, extension, replacements, ROOT_TYPES.has(node.type));
710
+ collectReplacements(
711
+ child,
712
+ extension,
713
+ replacements,
714
+ ROOT_TYPES.has(node.type),
715
+ maxDepth,
716
+ depth + 1,
717
+ );
648
718
  }
649
719
  }
650
720
 
@@ -21,6 +21,7 @@ import {
21
21
  import { AstScopeManager } from "./ast/manager.js";
22
22
  import { astDoctorPlugin } from "./doctor-plugin.js";
23
23
  import { createAstOutlineResolver } from "./outline-resolver.js";
24
+ import { createAstOverflowHandler, reduceAstReadOutput } from "./overflow-handler.js";
24
25
  import { createAstScopePostReadHandler, createAstScopePresenter } from "./scope-handler.js";
25
26
  import { createAstScopeAnchorResolver } from "./scope-resolver.js";
26
27
  import { createAstSearchResolver } from "./search-resolver.js";
@@ -43,19 +44,18 @@ export default async function registerAst(pi: ExtensionAPI): Promise<void> {
43
44
  handler: createSourceMappedTextReadHandler(),
44
45
  });
45
46
  api.addView({ view: "ast", presenter });
47
+ const overflow = createAstOverflowHandler();
48
+ api.addOutputReducer(reduceAstReadOutput);
49
+ const scopes = createAstScopePostReadHandler();
46
50
  api.addHandler({
47
51
  stage: "post-read",
48
- handler: createAstScopePostReadHandler(),
52
+ async handler(context) {
53
+ const result = await overflow(context);
54
+ return result.kind === "return" ? result : scopes(result.context);
55
+ },
49
56
  });
50
57
  api.describe(
51
- "Provides compact structural outlines of source files through `ast:<path>` and the `ast` view.",
52
- );
53
- api.addPromptGuideline(
54
- "You can use read with `ast:<path>` for a compact structural overview of a source file, including its classes, functions, signatures, and other declarations.",
55
- );
56
-
57
- api.addPromptGuideline(
58
- 'You can use read with `views: ["ast"]` to add scope boundaries alongside the file\'s source text.',
58
+ 'ast:<path> — compact declaration outline. views: ["ast"] — scope boundaries alongside source text. Oversized code reads may return an outline with source line numbers; offset/limit read a smaller source range.',
59
59
  );
60
60
  },
61
61
  } satisfies ReadPlugin;
@@ -82,13 +82,9 @@ export default async function registerAst(pi: ExtensionAPI): Promise<void> {
82
82
  apiVersion: SEARCH_API_VERSION,
83
83
  id: "ast-search",
84
84
  setup(api): void {
85
- api.addResolver({ resolver: createAstSearchResolver() });
85
+ api.addResolver({ resolver: createAstSearchResolver(api.registerSelection) });
86
86
  api.describe(
87
- "Use `ast:<pattern>` for structural code search through ast-grep. Optional path and glob fields limit the workspace scope.",
88
- );
89
-
90
- api.addPromptGuideline(
91
- "You can use search with `ast:<pattern>` for structural code search. You can limit it with `path`, `include`, and `exclude`.",
87
+ "Search code structure with ast:<pattern>, using source-code syntax and placeholders such as $NAME for one node and $$$BODY for several nodes. path, include and exclude narrow the search. Use returned SEARCH# references to read, replace, copy, move or delete exact AST matches, including multiline nodes. A single :match reference becomes stale after its file changes; :all:match reruns the original structural query. Incomplete results do not provide all selections. Use captures in Apply to compute replacement text; these edits do not update imports or references.",
92
88
  );
93
89
  },
94
90
  }),
@@ -0,0 +1,83 @@
1
+ import {
2
+ DEFAULT_MAX_BYTES,
3
+ DEFAULT_MAX_LINES,
4
+ truncateHead,
5
+ } from "@earendil-works/pi-coding-agent";
6
+ import type { ReadOutputReducer, ReadPostReadHandler } from "pi-agent-read/api/tools/read";
7
+ import type { SourceViewBlock } from "pi-agent-ide/api/code-view";
8
+
9
+ /** Builds a compact source view from recorded text, never from a newer filesystem snapshot. */
10
+ export const reduceAstReadOutput: ReadOutputReducer = async (result, context, budget) => {
11
+ const { source, resolvedBy, lines, totalLines, startLine } = result.details;
12
+ if (
13
+ source === undefined ||
14
+ resolvedBy !== "filesystem" ||
15
+ lines === undefined ||
16
+ lines.length !== totalLines ||
17
+ (startLine !== undefined && startLine !== 1)
18
+ )
19
+ return undefined;
20
+ try {
21
+ const { AstOutlineManager, isSupportedOutlinePath } = await import("./ast/outline.js");
22
+ if (!isSupportedOutlinePath(source)) return undefined;
23
+ const format = (outline: SourceViewBlock): string =>
24
+ [
25
+ `AST overview of ${outline.path}, source lines 1-${outline.totalLines}: the requested text exceeded the read buffer.`,
26
+ "Source line numbers are on the left. Detail is reduced to fit the buffer; omitted bodies are not exact source text. Read a small source range when needed.",
27
+ ...outline.renderedLines.map(
28
+ (line) => `${line.sourceLine?.lineNumber ?? "…"} | ${line.text}`,
29
+ ),
30
+ ].join("\n");
31
+ context.signal?.throwIfAborted();
32
+ const outline = await new AstOutlineManager(12).readDocumentOutline(
33
+ source,
34
+ context.cwd,
35
+ lines.map((line) => line.content),
36
+ (candidate) => {
37
+ context.signal?.throwIfAborted();
38
+ return !truncateHead(format(candidate), budget).truncated;
39
+ },
40
+ );
41
+ const text = format(outline);
42
+ if (truncateHead(text, budget).truncated) return undefined;
43
+ return { content: [{ type: "text", text }], details: { source, resolvedBy: "ast-overflow" } };
44
+ } catch {
45
+ context.signal?.throwIfAborted();
46
+ return undefined;
47
+ }
48
+ };
49
+
50
+ /** Replace an overflowing read window with a source-numbered whole-file outline. */
51
+ export function createAstOverflowHandler(): ReadPostReadHandler {
52
+ return async (context) => {
53
+ const { state, result } = context;
54
+ const block = result?.content.length === 1 ? result.content[0] : undefined;
55
+ if (
56
+ context.audience === "script" ||
57
+ result === undefined ||
58
+ state?.contentKind !== "text" ||
59
+ state.resolvedBy !== "filesystem" ||
60
+ block?.type !== "text" ||
61
+ !truncateHead(block.text).truncated
62
+ )
63
+ return { kind: "continue", context };
64
+ const reduced = await reduceAstReadOutput(
65
+ {
66
+ ...result,
67
+ details: {
68
+ ...result.details,
69
+ source: state.source,
70
+ resolvedBy: state.resolvedBy,
71
+ lines: state.text.lines,
72
+ startLine: 1,
73
+ totalLines: state.text.lines.length,
74
+ },
75
+ },
76
+ context.resolverContext,
77
+ { maxBytes: DEFAULT_MAX_BYTES, maxLines: DEFAULT_MAX_LINES },
78
+ );
79
+ return reduced === undefined
80
+ ? { kind: "continue", context }
81
+ : { kind: "return", result: reduced };
82
+ };
83
+ }