pi-agent-ide 0.2.2 → 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 (385) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +12 -8
  3. package/dist/chunk-5MSNYFDE.js +1 -0
  4. package/dist/chunk-5VSE5X5R.js +2 -0
  5. package/dist/chunk-6EYWFBNG.js +0 -0
  6. package/dist/{chunk-ORAPGW7W.js → chunk-72EEL2DW.js} +1 -1
  7. package/dist/{chunk-T2RPMEM2.js → chunk-7UGNGK7Y.js} +1 -1
  8. package/dist/{chunk-STUZZM5B.js → chunk-AADJ2KIB.js} +1 -1
  9. package/dist/{chunk-XF5PVZOS.js → chunk-B5KB2I7J.js} +1 -1
  10. package/dist/{chunk-WNMGUALD.js → chunk-CEKXBS55.js} +1 -1
  11. package/dist/chunk-CW53ZTU3.js +2 -0
  12. package/dist/chunk-EWNWKDMP.js +4 -0
  13. package/dist/{chunk-LQYZG62K.js → chunk-GUTQ3PWL.js} +1 -1
  14. package/dist/chunk-HGPUI7F3.js +1 -0
  15. package/dist/{chunk-OBWZ5RYN.js → chunk-HKMBQLEK.js} +1 -1
  16. package/dist/chunk-ITSNK5YG.js +7 -0
  17. package/dist/chunk-KAB3AYA2.js +1 -0
  18. package/dist/{chunk-THSCUT2L.js → chunk-LRYE2WCN.js} +1 -1
  19. package/dist/{chunk-76WHES5H.js → chunk-M5L42DWE.js} +5 -5
  20. package/dist/chunk-M5MJP7Z2.js +1 -0
  21. package/dist/chunk-NMFQGKPE.js +2 -0
  22. package/dist/chunk-NTYXZ3EL.js +3 -0
  23. package/dist/{chunk-P6T3Q7LB.js → chunk-QDST6VIU.js} +1 -1
  24. package/dist/chunk-RHV5STR3.js +3 -0
  25. package/dist/chunk-ROXXK6TW.js +0 -0
  26. package/dist/chunk-SSHZEWWV.js +1 -0
  27. package/dist/{chunk-4ZTEPMJO.js → chunk-TPIHQYK2.js} +1 -1
  28. package/dist/chunk-VZJIZXSH.js +14 -0
  29. package/dist/chunk-YHADTHQM.js +1 -0
  30. package/dist/{chunk-KZBAJFCV.js → chunk-Z3VC3S2T.js} +1 -1
  31. package/dist/{chunk-ZXN3TWWW.js → chunk-ZM4L5AGN.js} +1 -1
  32. package/dist/{chunk-E2RESHYR.js → chunk-ZTYWHL2F.js} +1 -1
  33. package/dist/entry-0.js +1 -1
  34. package/dist/entry-1.js +1 -1
  35. package/dist/entry-10.js +1 -1
  36. package/dist/entry-12.js +1 -1
  37. package/dist/entry-13.js +1 -1
  38. package/dist/entry-14.js +1 -1
  39. package/dist/entry-2.js +1 -1
  40. package/dist/entry-21.js +1 -1
  41. package/dist/entry-24.js +1 -1
  42. package/dist/entry-25.js +1 -1
  43. package/dist/entry-26.js +10 -5
  44. package/dist/entry-28.js +1 -1
  45. package/dist/entry-29.js +1 -1
  46. package/dist/entry-31.js +3 -3
  47. package/dist/entry-32.js +6 -5
  48. package/dist/entry-36.js +1 -1
  49. package/dist/entry-37.js +1 -1
  50. package/dist/entry-38.js +1 -1
  51. package/dist/entry-39.js +1 -1
  52. package/dist/entry-4.js +1 -1
  53. package/dist/entry-40.js +12 -8
  54. package/dist/entry-42.js +1 -1
  55. package/dist/entry-43.js +1 -1
  56. package/dist/entry-44.js +1 -1
  57. package/dist/entry-45.js +4 -4
  58. package/dist/entry-46.js +10 -10
  59. package/dist/entry-47.js +1 -1
  60. package/dist/entry-48.js +1 -1
  61. package/dist/entry-49.js +1 -1
  62. package/dist/entry-50.js +1 -1
  63. package/dist/entry-51.js +1 -1
  64. package/dist/entry-52.js +1 -1
  65. package/dist/entry-53.js +1 -1
  66. package/dist/entry-54.js +1 -0
  67. package/dist/entry-55.js +0 -1
  68. package/dist/entry-56.js +1 -0
  69. package/dist/entry-57.js +0 -1
  70. package/dist/entry-58.js +1 -1
  71. package/dist/entry-59.js +1 -1
  72. package/dist/entry-60.js +1 -1
  73. package/dist/entry-61.js +1 -1
  74. package/dist/entry-62.js +1 -1
  75. package/dist/entry-63.js +1 -0
  76. package/dist/entry-64.js +0 -1
  77. package/dist/entry-65.js +1 -0
  78. package/dist/entry-66.js +0 -1
  79. package/dist/entry-67.js +1 -1
  80. package/dist/entry-68.js +1 -1
  81. package/dist/entry-69.js +1 -59
  82. package/dist/entry-70.js +123 -4
  83. package/dist/entry-71.js +30 -1
  84. package/dist/entry-72.js +2 -29
  85. package/dist/entry-73.js +1 -2
  86. package/dist/entry-74.js +1 -1
  87. package/dist/entry-75.js +1 -1
  88. package/dist/entry-76.js +3 -1
  89. package/dist/entry-77.js +1 -3
  90. package/dist/entry-78.js +1 -1
  91. package/dist/entry-79.js +1 -1
  92. package/dist/pi-agent-ide.js +3 -2
  93. package/docs/configuration.md +32 -11
  94. package/docs/tools.md +6 -0
  95. package/node_modules/pi-agent-doctor/package.json +1 -1
  96. package/node_modules/pi-agent-filesystem/package.json +6 -6
  97. package/node_modules/pi-agent-filesystem-image/package.json +3 -3
  98. package/node_modules/pi-agent-filesystem-pdf/package.json +3 -3
  99. package/node_modules/pi-agent-filesystem-text/package.json +3 -3
  100. package/node_modules/pi-agent-ide-ast/package.json +9 -9
  101. package/node_modules/pi-agent-ide-ast/src/extension.ts +4 -3
  102. package/node_modules/pi-agent-ide-ast/src/overflow-handler.ts +68 -45
  103. package/node_modules/pi-agent-ide-ast/src/scope-handler.ts +8 -1
  104. package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +83 -5
  105. package/node_modules/pi-agent-ide-changes/index.ts +21 -5
  106. package/node_modules/pi-agent-ide-changes/package.json +6 -6
  107. package/node_modules/pi-agent-ide-changes/src/last-text-transaction-store.ts +10 -0
  108. package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +4 -2
  109. package/node_modules/pi-agent-ide-formatter/package.json +3 -3
  110. package/node_modules/pi-agent-ide-formatter/src/formatter.ts +26 -8
  111. package/node_modules/pi-agent-ide-formatter/src/registry.ts +9 -1
  112. package/node_modules/pi-agent-ide-languages/package.json +2 -2
  113. package/node_modules/pi-agent-ide-lint/index.ts +46 -17
  114. package/node_modules/pi-agent-ide-lint/package.json +7 -7
  115. package/node_modules/pi-agent-ide-lint/src/registry.ts +9 -1
  116. package/node_modules/pi-agent-ide-lsp/index.ts +126 -8
  117. package/node_modules/pi-agent-ide-lsp/package.json +9 -8
  118. package/node_modules/pi-agent-ide-lsp/src/declaration-targets.ts +61 -0
  119. package/node_modules/pi-agent-ide-lsp/src/diagnostic-source.ts +18 -3
  120. package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +4 -0
  121. package/node_modules/pi-agent-ide-lsp/src/lsp/code-views.ts +40 -0
  122. package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +21 -32
  123. package/node_modules/pi-agent-ide-lsp/src/lsp/registry.ts +15 -2
  124. package/node_modules/pi-agent-ide-lsp/src/lsp/rename.ts +1 -1
  125. package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +32 -5
  126. package/node_modules/pi-agent-ide-lsp/src/rename-plan.ts +138 -0
  127. package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +9 -2
  128. package/node_modules/pi-agent-image/package.json +2 -2
  129. package/node_modules/pi-agent-invariant/package.json +1 -1
  130. package/node_modules/pi-agent-pdf/package.json +2 -2
  131. package/node_modules/pi-agent-read/package.json +6 -6
  132. package/node_modules/pi-agent-read/src/api/plugin-protocol.ts +1 -1
  133. package/node_modules/pi-agent-read/src/api/read-parameters.ts +29 -0
  134. package/node_modules/pi-agent-read/src/api/tools/read.ts +73 -1
  135. package/node_modules/pi-agent-read/src/core/read-core.ts +26 -2
  136. package/node_modules/pi-agent-read/src/core/tools/read/output-truncation.ts +1 -1
  137. package/node_modules/pi-agent-read/src/core/tools/read/raw-read.ts +113 -0
  138. package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +61 -14
  139. package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +15 -0
  140. package/node_modules/pi-agent-read/src/core/tools/read/temp-resource-store.ts +35 -126
  141. package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +73 -44
  142. package/node_modules/pi-agent-resource/package.json +1 -1
  143. package/node_modules/pi-agent-resource/src/resolver.ts +2 -0
  144. package/node_modules/pi-agent-search/package.json +3 -3
  145. package/node_modules/pi-agent-search/src/api/plugin-protocol.ts +1 -1
  146. package/node_modules/pi-agent-search/src/api/search-parameters.ts +25 -0
  147. package/node_modules/pi-agent-search/src/api/search.ts +55 -1
  148. package/node_modules/pi-agent-search/src/core/extension.ts +2 -23
  149. package/node_modules/pi-agent-search/src/core/search-core.ts +28 -3
  150. package/node_modules/pi-agent-search-text/index.ts +44 -4
  151. package/node_modules/pi-agent-search-text/package.json +6 -6
  152. package/node_modules/pi-agent-search-text/src/search-session.ts +65 -25
  153. package/node_modules/pi-agent-text/package.json +2 -2
  154. package/node_modules/pi-agent-text/src/text-document.ts +5 -0
  155. package/node_modules/pi-agent-text/src/text-target.ts +4 -0
  156. package/node_modules/pi-agent-text-anchor-constant/package.json +3 -3
  157. package/node_modules/pi-agent-text-anchor-exact/package.json +3 -3
  158. package/node_modules/pi-agent-text-anchor-line-hash/package.json +5 -5
  159. package/node_modules/pi-agent-text-anchor-line-hash/src/read-handler.ts +1 -0
  160. package/node_modules/pi-agent-text-editor/index.ts +1 -3
  161. package/node_modules/pi-agent-text-editor/package.json +34 -24
  162. package/node_modules/pi-agent-text-editor/runtime/entry-69.js +0 -1
  163. package/node_modules/pi-agent-text-editor/src/api/apply-renderer.ts +3 -0
  164. package/node_modules/pi-agent-text-editor/src/api/edit-completion.ts +2 -0
  165. package/node_modules/pi-agent-text-editor/src/api/edit-pipeline.ts +15 -0
  166. package/node_modules/pi-agent-text-editor/src/api/last-resolved-resource.ts +5 -0
  167. package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +15 -1
  168. package/node_modules/pi-agent-text-editor/src/api/post-edit.ts +3 -0
  169. package/node_modules/pi-agent-text-editor/src/core/apply/execution.ts +237 -0
  170. package/node_modules/pi-agent-text-editor/src/core/apply/final-mutations.ts +50 -0
  171. package/node_modules/pi-agent-text-editor/src/core/apply/format-source.ts +11 -0
  172. package/node_modules/pi-agent-text-editor/src/core/apply/mixed-source.ts +208 -0
  173. package/node_modules/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +39 -0
  174. package/node_modules/pi-agent-text-editor/src/core/apply/output.ts +216 -0
  175. package/node_modules/pi-agent-text-editor/src/core/apply/prompt.ts +45 -0
  176. package/node_modules/pi-agent-text-editor/src/core/apply/queue.ts +25 -0
  177. package/node_modules/pi-agent-text-editor/src/core/apply/renderer.ts +324 -0
  178. package/node_modules/pi-agent-text-editor/src/core/apply/results.ts +133 -0
  179. package/node_modules/pi-agent-text-editor/src/core/apply/runtime.ts +112 -0
  180. package/node_modules/pi-agent-text-editor/src/core/apply/tool.ts +132 -0
  181. package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +205 -0
  182. package/node_modules/pi-agent-text-editor/src/core/extension.ts +6 -0
  183. package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +76 -0
  184. package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +153 -0
  185. package/node_modules/pi-agent-text-editor/src/core/mutation-result/diff.ts +5 -2
  186. package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +1 -0
  187. package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +6 -1
  188. package/node_modules/pi-agent-text-editor/src/core/post-edit-scope.ts +73 -0
  189. package/node_modules/pi-agent-text-editor/src/core/text-change-engine.ts +10 -2
  190. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +17 -0
  191. package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +173 -49
  192. package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +261 -9
  193. package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +1 -1
  194. package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +1 -1
  195. package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +1 -1
  196. package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +1 -1
  197. package/node_modules/pi-agent-text-editor-renderer/index.ts +88 -1
  198. package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
  199. package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +42 -25
  200. package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +19 -10
  201. package/node_modules/pi-agent-text-editor-renderer/src/status-summary.ts +33 -0
  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-73.js +1 -0
  205. package/node_modules/pi-agent-tool-ui/package.json +2 -2
  206. package/node_modules/pi-agent-web/package.json +7 -7
  207. package/node_modules/pi-agent-web/runtime/entry-75.js +2 -0
  208. package/node_modules/pi-agent-web/src/browser-loader.ts +1 -0
  209. package/node_modules/pi-agent-web-html/package.json +3 -3
  210. package/node_modules/pi-agent-web-image/package.json +4 -4
  211. package/node_modules/pi-agent-web-pdf/package.json +4 -4
  212. package/node_modules/pi-agent-web-text/package.json +4 -4
  213. package/package.json +38 -38
  214. package/src/api/plugin-protocol.ts +10 -2
  215. package/src/api/tool-config.ts +73 -2
  216. package/src/code-view/diagnostic-view.ts +22 -3
  217. package/src/composite/builtin-extensions.ts +4 -15
  218. package/src/composite/extensions-config.ts +41 -0
  219. package/src/composite/feature-flags.ts +32 -0
  220. package/src/composite/module-labels.ts +55 -0
  221. package/src/composite/module-settings-store.ts +44 -0
  222. package/src/composite/module-settings.ts +132 -0
  223. package/src/composite/selection.ts +4 -4
  224. package/src/composite/settings-panel.ts +71 -0
  225. package/src/core/diagnostic-delivery.ts +29 -0
  226. package/src/core/diagnostic-entry.ts +51 -3
  227. package/src/core/diagnostic-store.ts +56 -5
  228. package/src/core/extension.ts +34 -33
  229. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +6 -6
  230. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +3 -3
  231. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +3 -3
  232. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +3 -3
  233. package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +7 -7
  234. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -3
  235. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-76.js +2 -0
  236. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
  237. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
  238. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
  239. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-75.js +2 -0
  240. package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/browser-loader.ts +1 -0
  241. package/src/extensions/pi-agent-read/package.json +6 -6
  242. package/src/extensions/pi-agent-read/src/api/plugin-protocol.ts +1 -1
  243. package/src/extensions/pi-agent-read/src/api/read-parameters.ts +29 -0
  244. package/src/extensions/pi-agent-read/src/api/tools/read.ts +73 -1
  245. package/src/extensions/pi-agent-read/src/core/read-core.ts +26 -2
  246. package/src/extensions/pi-agent-read/src/core/tools/read/output-truncation.ts +1 -1
  247. package/src/extensions/pi-agent-read/src/core/tools/read/raw-read.ts +113 -0
  248. package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +61 -14
  249. package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +15 -0
  250. package/src/extensions/pi-agent-read/src/core/tools/read/temp-resource-store.ts +35 -126
  251. package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +73 -44
  252. package/src/extensions/pi-agent-search/package.json +3 -3
  253. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +44 -4
  254. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +6 -6
  255. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +65 -25
  256. package/src/extensions/pi-agent-search/src/api/plugin-protocol.ts +1 -1
  257. package/src/extensions/pi-agent-search/src/api/search-parameters.ts +25 -0
  258. package/src/extensions/pi-agent-search/src/api/search.ts +55 -1
  259. package/src/extensions/pi-agent-search/src/core/extension.ts +2 -23
  260. package/src/extensions/pi-agent-search/src/core/search-core.ts +28 -3
  261. package/src/extensions/pi-agent-text-editor/index.ts +1 -3
  262. package/src/extensions/pi-agent-text-editor/package.json +34 -24
  263. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +3 -3
  264. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +3 -3
  265. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +5 -5
  266. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/read-handler.ts +1 -0
  267. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +88 -1
  268. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
  269. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +42 -25
  270. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +19 -10
  271. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/status-summary.ts +33 -0
  272. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -5
  273. package/src/extensions/pi-agent-text-editor/runtime/entry-69.js +0 -1
  274. package/src/extensions/pi-agent-text-editor/runtime/entry-70.js +2 -0
  275. package/src/extensions/pi-agent-text-editor/src/api/apply-renderer.ts +3 -0
  276. package/src/extensions/pi-agent-text-editor/src/api/edit-completion.ts +2 -0
  277. package/src/extensions/pi-agent-text-editor/src/api/edit-pipeline.ts +15 -0
  278. package/src/extensions/pi-agent-text-editor/src/api/last-resolved-resource.ts +5 -0
  279. package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +15 -1
  280. package/src/extensions/pi-agent-text-editor/src/api/post-edit.ts +3 -0
  281. package/src/extensions/pi-agent-text-editor/src/core/apply/execution.ts +237 -0
  282. package/src/extensions/pi-agent-text-editor/src/core/apply/final-mutations.ts +50 -0
  283. package/src/extensions/pi-agent-text-editor/src/core/apply/format-source.ts +11 -0
  284. package/src/extensions/pi-agent-text-editor/src/core/apply/mixed-source.ts +208 -0
  285. package/src/extensions/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +39 -0
  286. package/src/extensions/pi-agent-text-editor/src/core/apply/output.ts +216 -0
  287. package/src/extensions/pi-agent-text-editor/src/core/apply/prompt.ts +45 -0
  288. package/src/extensions/pi-agent-text-editor/src/core/apply/queue.ts +25 -0
  289. package/src/extensions/pi-agent-text-editor/src/core/apply/renderer.ts +324 -0
  290. package/src/extensions/pi-agent-text-editor/src/core/apply/results.ts +133 -0
  291. package/src/extensions/pi-agent-text-editor/src/core/apply/runtime.ts +112 -0
  292. package/src/extensions/pi-agent-text-editor/src/core/apply/tool.ts +132 -0
  293. package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +205 -0
  294. package/src/extensions/pi-agent-text-editor/src/core/extension.ts +6 -0
  295. package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +76 -0
  296. package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +153 -0
  297. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/diff.ts +5 -2
  298. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +1 -0
  299. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +6 -1
  300. package/src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts +73 -0
  301. package/src/extensions/pi-agent-text-editor/src/core/text-change-engine.ts +10 -2
  302. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +17 -0
  303. package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +173 -49
  304. package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +261 -9
  305. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +1 -1
  306. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +1 -1
  307. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +1 -1
  308. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +1 -1
  309. package/src/pi-agent-ide.ts +42 -8
  310. package/src/plugins/pi-agent-ide-ast/package.json +9 -9
  311. package/src/plugins/pi-agent-ide-ast/src/extension.ts +4 -3
  312. package/src/plugins/pi-agent-ide-ast/src/overflow-handler.ts +68 -45
  313. package/src/plugins/pi-agent-ide-ast/src/scope-handler.ts +8 -1
  314. package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +83 -5
  315. package/src/plugins/pi-agent-ide-changes/index.ts +21 -5
  316. package/src/plugins/pi-agent-ide-changes/package.json +6 -6
  317. package/src/plugins/pi-agent-ide-changes/src/last-text-transaction-store.ts +10 -0
  318. package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +4 -2
  319. package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +62 -11
  320. package/src/plugins/pi-agent-ide-formatter/package.json +3 -3
  321. package/src/plugins/pi-agent-ide-formatter/src/formatter.ts +26 -8
  322. package/src/plugins/pi-agent-ide-formatter/src/registry.ts +9 -1
  323. package/src/plugins/pi-agent-ide-languages/package.json +2 -2
  324. package/src/plugins/pi-agent-ide-lint/index.ts +46 -17
  325. package/src/plugins/pi-agent-ide-lint/package.json +7 -7
  326. package/src/plugins/pi-agent-ide-lint/src/registry.ts +9 -1
  327. package/src/plugins/pi-agent-ide-lsp/index.ts +126 -8
  328. package/src/plugins/pi-agent-ide-lsp/package.json +9 -8
  329. package/src/plugins/pi-agent-ide-lsp/src/declaration-targets.ts +61 -0
  330. package/src/plugins/pi-agent-ide-lsp/src/diagnostic-source.ts +18 -3
  331. package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +4 -0
  332. package/src/plugins/pi-agent-ide-lsp/src/lsp/code-views.ts +40 -0
  333. package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +21 -32
  334. package/src/plugins/pi-agent-ide-lsp/src/lsp/registry.ts +15 -2
  335. package/src/plugins/pi-agent-ide-lsp/src/lsp/rename.ts +1 -1
  336. package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +32 -5
  337. package/src/plugins/pi-agent-ide-lsp/src/rename-plan.ts +138 -0
  338. package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +9 -2
  339. package/src/post-edit/gate.ts +15 -2
  340. package/dist/chunk-4U6KGABH.js +0 -1
  341. package/dist/chunk-6ACQQBUY.js +0 -7
  342. package/dist/chunk-GFWDXTOB.js +0 -4
  343. package/dist/chunk-JASLOB2X.js +0 -1
  344. package/dist/chunk-JJVXUL5U.js +0 -2
  345. package/dist/chunk-KCEOTU5Z.js +0 -3
  346. package/dist/chunk-KVGQG43U.js +0 -1
  347. package/dist/chunk-QJFRAMK7.js +0 -2
  348. package/dist/chunk-RAZOACDD.js +0 -2
  349. package/dist/chunk-RIGRP3FD.js +0 -1
  350. package/dist/chunk-X6MPU7UO.js +0 -3
  351. package/dist/chunk-YPHXLAQF.js +0 -1
  352. package/dist/entry-80.js +0 -1
  353. package/node_modules/pi-agent-text-editor/src/core/tool-description.ts +0 -14
  354. package/node_modules/pi-agent-text-editor-argument-order/index.ts +0 -26
  355. package/node_modules/pi-agent-text-editor-argument-order/package.json +0 -16
  356. package/node_modules/pi-agent-text-editor-argument-order/src/argument-order-guard.ts +0 -100
  357. package/node_modules/pi-agent-text-editor-overwrite/index.ts +0 -365
  358. package/node_modules/pi-agent-text-editor-overwrite/package.json +0 -17
  359. package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +0 -2
  360. package/node_modules/pi-agent-tool-ui/runtime/entry-75.js +0 -1
  361. package/node_modules/pi-agent-web-text/runtime/entry-80.js +0 -2
  362. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-80.js +0 -2
  363. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-76.js +0 -2
  364. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/index.ts +0 -26
  365. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/package.json +0 -16
  366. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/runtime/entry-70.js +0 -2
  367. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/src/argument-order-guard.ts +0 -100
  368. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/index.ts +0 -365
  369. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/package.json +0 -17
  370. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +0 -2
  371. package/src/extensions/pi-agent-text-editor/src/core/tool-description.ts +0 -14
  372. /package/dist/{chunk-3H2EU7VQ.js → chunk-4U2GUKNJ.js} +0 -0
  373. /package/node_modules/{pi-agent-text-editor-argument-order → pi-agent-text-editor}/runtime/entry-70.js +0 -0
  374. /package/node_modules/{pi-agent-text-editor-overwrite → pi-agent-text-editor-renderer}/runtime/entry-71.js +0 -0
  375. /package/node_modules/{pi-agent-text-editor-renderer → pi-agent-text-editor-stale-anchor}/runtime/entry-72.js +0 -0
  376. /package/node_modules/{pi-agent-tool-call-interception → pi-agent-tool-ui}/runtime/entry-74.js +0 -0
  377. /package/node_modules/{pi-agent-web → pi-agent-web-html}/runtime/entry-76.js +0 -0
  378. /package/node_modules/{pi-agent-web-html → pi-agent-web-image}/runtime/entry-77.js +0 -0
  379. /package/node_modules/{pi-agent-web-image → pi-agent-web-pdf}/runtime/entry-78.js +0 -0
  380. /package/node_modules/{pi-agent-web-pdf → pi-agent-web-text}/runtime/entry-79.js +0 -0
  381. /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
  382. /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
  383. /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
  384. /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-overwrite → pi-agent-text-editor-renderer}/runtime/entry-71.js +0 -0
  385. /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
package/dist/entry-45.js CHANGED
@@ -1,7 +1,7 @@
1
- import{e as M,f as N,g as j}from"./chunk-GIRAEVUJ.js";import{c as k}from"./chunk-YHUTTZC6.js";import{a as I,b as C,c as D,d as $,g as O}from"./chunk-T2RPMEM2.js";import{a as o}from"./chunk-EI7MMDWY.js";import{keyText as te}from"@earendil-works/pi-coding-agent";import{Text as ne}from"@earendil-works/pi-tui";import oe from"node:os";import{Type as p}from"typebox";function q(){let e=[],r=new Map,s=new Map,a=new Map,i=new Map,l=Promise.resolve(),u={registerPlugin(n){if(n.id.trim().length===0)return Promise.reject(new Error("Plugin ID must not be empty"));let c=i.get(n.id);if(c!==void 0)return c;let f=l.then(async()=>{let h=[],m=[],y,g=[],d={addResolver(t){z(t),h.push(t)},addAction(t){_(t),m.push(t)},describe(t){if(y!==void 0)throw new Error(`Plugin ${n.id} provides more than one description`);y=L(t)},addPromptGuideline(t){g.push(L(t))},search:o((t,w)=>u.execute(t,w),"search"),runAction(t,w){return u.runAction(t.reference,t.capability,t.resolverId,t.input,w)}};await n.setup(d);let S=new Set(e.map(({registration:t})=>t.resolver.id));for(let t of h){if(S.has(t.resolver.id))throw new Error(`Search resolver ${t.resolver.id} is already registered`);S.add(t.resolver.id)}for(let t of m){let w=P(t.resolverId,t.capability);if(r.has(w)||m.some(x=>x!==t&&P(x.resolverId,x.capability)===w))throw new Error(`Search action ${w} is already registered`)}for(let t of h)e.push({pluginId:n.id,registration:t,order:e.length});for(let t of m)r.set(P(t.resolverId,t.capability),t);y!==void 0&&a.set(n.id,y),g.length>0&&s.set(n.id,g)});return i.set(n.id,f),l=f.catch(()=>{}),f.catch(()=>{i.delete(n.id)}),f},async waitForPendingPlugins(){await Promise.all(i.values())},async execute(n,c){if(n.query.trim().length===0)return R("INVALID_REQUEST","Search query must not be empty");let f=[...e].sort((g,d)=>+(g.registration.fallback===!0)-+(d.registration.fallback===!0)||(g.registration.priority??0)-(d.registration.priority??0)||g.order-d.order),h=/^[a-z][\w-]*:\s*$/iu.test(n.query),m=/^[a-z][\w-]*:/iu.test(n.query);for(let g of f){if(h&&!g.registration.fallback)continue;let d=g.registration.resolver,S;try{c.signal?.throwIfAborted(),S=await d.tryResolve(n,c)}catch(t){return R("RESOLVE_FAILED",b(t,`Resolver ${d.id} failed`),d.id,t)}if(!K(S))return R("INVALID_RESOLVER_RESULT",`Resolver ${d.id} returned an invalid result`,d.id);if(S.kind!=="not-handled"){if(S.kind==="failed")return R("RESOLVE_FAILED",b(S.error,`Resolver ${d.id} failed`),d.id,S.error);try{let t=await d.format(S.payload,c);return Q(t)?{content:g.registration.fallback&&m?[{type:"text",text:h?"Search fallback: empty protocol query; searched the original text.":"Search fallback: unhandled protocol query; searched the original text."},...t.content]:t.content,details:{resolverId:d.id,payload:t.details},...t.usage!==void 0&&{usage:t.usage}}:R("FORMAT_FAILED",`Resolver ${d.id} formatter returned an invalid result`,d.id)}catch(t){return R("FORMAT_FAILED",b(t,`Resolver ${d.id} formatter failed`),d.id,t)}}}let y=`No search resolver handled ${n.query}`;return M(R("NO_RESOLVER",y),y)},runAction(n,c,f,h,m){let y=r.get(P(f,c));if(y===void 0)throw new Error(`Search reference does not support ${c}`);return y.execute(n,h,m)},renderDescriptions(){return[...a.values()].flatMap(n=>{let c=F(n);return c===void 0?[]:[c]})},renderPromptGuidelines(){return[...s.values()].flat().flatMap(n=>{let c=F(n);return c===void 0?[]:[c]})},renderer(n){return e.find(({registration:c})=>c.resolver.id===n)?.registration.resolver.renderResult}};return u}o(q,"createSearchCore");function z(e){if(!E(e)||!E(e.resolver))throw new TypeError("Invalid search resolver registration");let r=e.resolver;if(typeof r.id!="string"||r.id.trim().length===0||typeof r.tryResolve!="function"||typeof r.format!="function")throw new TypeError("Invalid search resolver registration");if(e.priority!==void 0&&(typeof e.priority!="number"||!Number.isFinite(e.priority)))throw new TypeError("Invalid search resolver priority")}o(z,"assertResolver");function _(e){if(!E(e)||typeof e.resolverId!="string"||e.resolverId.trim().length===0||typeof e.capability!="string"||e.capability.trim().length===0||typeof e.execute!="function")throw new TypeError("Invalid search action registration")}o(_,"assertAction");function E(e){return typeof e=="object"&&e!==null}o(E,"isRecord");function K(e){if(typeof e!="object"||e===null||!("kind"in e))return!1;let r=e.kind;return r==="not-handled"||r==="resolved"&&"payload"in e||r==="failed"&&"error"in e}o(K,"isAttempt");function Q(e){return typeof e=="object"&&e!==null&&Array.isArray(e.content)}o(Q,"isAgentToolResult");function R(e,r,s,a){return{content:[{type:"text",text:r}],details:{failure:{code:e,message:r,...s!==void 0&&{resolverId:s},...a!==void 0&&{cause:a}}}}}o(R,"failure");function L(e){if(typeof e=="function")return e;if(typeof e!="string"||e.trim().length===0)throw new TypeError("Search description must not be empty");return e.trim()}o(L,"normalizeDescriptionSource");function F(e){let r=typeof e=="function"?e():e;if(r!==void 0){if(typeof r!="string"||r.trim().length===0)throw new TypeError("Search description must not be empty");return r.trim()}}o(F,"renderDescription");function P(e,r){return`${e}:${r}`}o(P,"actionKey");function b(e,r){return!(e instanceof Error)||e.message.trim().length===0?r:e instanceof SyntaxError?e.message:`${r}: ${e.message}`}o(b,"messageFor");import{readFile as Y}from"node:fs/promises";import X from"node:os";import T from"node:path";var Z=3e4;function H(e=process.env,r=X.homedir(),s=process.cwd()){let a=e.PI_CODING_AGENT_DIR?.trim(),i=a===void 0||a.length===0?T.join(r,".pi","agent"):T.resolve(a);return{globalPath:T.join(i,"pi-agent-ide","search.json"),projectPath:T.resolve(s,".pi","pi-agent-ide","search.json")}}o(H,"resolveSearchConfigPaths");async function V(e){let[r,s]=await Promise.all([G(e.globalPath),G(e.projectPath)]),a=s!==void 0?s:r;return{timeoutMs:a===void 0?Z:a}}o(V,"loadSearchConfig");async function G(e){let r;try{r=await Y(e,"utf8")}catch(l){if(ee(l))return;throw new Error(`Cannot read Pi Agent IDE search config at ${e}`,{cause:l})}let s;try{s=JSON.parse(r)}catch(l){throw new Error(`Invalid JSON in Pi Agent IDE search config at ${e}`,{cause:l})}if(!W(s))throw new TypeError(`Pi Agent IDE search config at ${e} must be a JSON object`);let a=Object.keys(s).find(l=>l!=="timeoutMs");if(a!==void 0)throw new TypeError(`Pi Agent IDE search config at ${e} contains unknown key ${a}`);let i=s.timeoutMs;if(i==null)return i;if(typeof i!="number"||!Number.isSafeInteger(i)||i<=0)throw new TypeError(`timeoutMs must be a positive integer or null in Pi Agent IDE search config at ${e}`);return i}o(G,"readTimeout");function ee(e){return W(e)&&e.code==="ENOENT"}o(ee,"isMissingFile");function W(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(W,"isRecord");var J=Symbol("search-timeout"),A=class extends Error{static{o(this,"SearchTimeoutError")}constructor(r){super(r),this.name="SearchTimeoutError"}};async function U(e,r,s){if(e===null)return s(r);let a=new AbortController,i=r===void 0?a.signal:AbortSignal.any([r,a.signal]),l,u=new Promise(n=>{l=setTimeout(()=>{n(J),a.abort()},e)});try{let n=await Promise.race([s(i),u]);if(n===J)throw new A(`Search timed out after ${re(e)}. Try a smaller path scope.`);return n}finally{clearTimeout(l)}}o(U,"runWithSearchTimeout");function re(e){if(e%1e3!==0)return`${String(e)}ms`;let r=e/1e3;return`${String(r)} ${r===1?"second":"seconds"}`}o(re,"formatDuration");var ie=p.Object({query:p.String({minLength:1,description:"Text to find, a Boolean expression, or a prefixed query described below, such as files:*.ts. Quote text to keep it literal, or use regex:<pattern> for regular-expression matching."}),path:p.Optional(p.String({description:"Optional file or directory scope for local search"})),include:p.Optional(p.String({description:"Optional include glob for local search"})),exclude:p.Optional(p.String({description:"Optional exclude glob for local search"})),caseSensitive:p.Optional(p.Boolean({description:"Match letter case in local search"})),wholeWord:p.Optional(p.Boolean({description:"Match complete words in local search"})),limit:p.Optional(p.Integer({minimum:1,maximum:1e3,description:"Maximum results (default 100)"}))},{additionalProperties:!1});function se(e,r){let s=[...e.path===void 0?[]:[{text:`in ${e.path}`,color:"accent",underline:!0,truncate:"start"}],...e.include===void 0?[]:[{text:`include ${e.include}`}],...e.exclude===void 0?[]:[{text:`exclude ${e.exclude}`}],...e.caseSensitive===!0?[{text:"case sensitive"}]:[],...e.wholeWord===!0?[{text:"whole word"}]:[],...e.limit===void 0?[]:[{text:`limit ${String(e.limit)}`}]];return{tool:"search",primary:{text:JSON.stringify(e.query),color:"accent",truncate:"end"},qualifiers:s,details:ae(e),expanded:r}}o(se,"searchCallModel");async function B(e){let r=q(),s=new N,a=e.events.on($,i=>{if(!O(i))throw new Error("Invalid pi-agent-search plugin registration request");i.accept(r.registerPlugin(i.plugin))});e.on("session_shutdown",a),e.registerTool(j({name:"search",label:"search",get description(){return["Use search to locate text, file paths and code structures in the workspace.",...r.renderDescriptions()].join(`
2
- `)},promptSnippet:"Search files and text with literals or regular expressions, plus syntax trees and language symbols",get promptGuidelines(){return["Use the narrowest useful search query and scope; broaden when needed.",...r.renderPromptGuidelines()]},parameters:ie,renderCall(i,l,u){return k(u.lastComponent,se(i,u.expanded),l)},renderResult(i,l,u,n){let c=i.details,f=c?.resolverId===void 0?void 0:r.renderer(c.resolverId);if(f!==void 0){let h={...i,details:c?.payload};return f(h,l,u,n)}return ce(i,l,u)},async execute(i,l,u,n,c){let f=await V(H(process.env,oe.homedir(),c.cwd));return U(f.timeoutMs,u,async h=>(await r.waitForPendingPlugins(),r.execute(l,{cwd:c.cwd,...h!==void 0&&{signal:h},...n!==void 0&&{onUpdate:o(m=>{n(m)},"onUpdate")}})))}},s)),e.events.emit(D,{protocol:I,apiVersion:C}),await r.waitForPendingPlugins()}o(B,"registerSearchCore");function ae(e){return[{label:"query",value:JSON.stringify(e.query)},...v("path",e.path),...v("include",e.include),...v("exclude",e.exclude),...v("caseSensitive",e.caseSensitive===void 0?void 0:String(e.caseSensitive)),...v("wholeWord",e.wholeWord===void 0?void 0:String(e.wholeWord)),...v("limit",e.limit===void 0?void 0:String(e.limit))]}o(ae,"searchCallDetails");function v(e,r){return r===void 0?[]:[{label:e,value:r}]}o(v,"optionalDetail");function ce(e,r,s){let a=e.content.flatMap(u=>u.type==="text"?[u.text]:[]).join(`
1
+ import{e as j,f as F,g as L}from"./chunk-GIRAEVUJ.js";import{c as I}from"./chunk-YHUTTZC6.js";import{a as O}from"./chunk-HGPUI7F3.js";import{a as C,b as D,c as $,d as N,g as M}from"./chunk-7UGNGK7Y.js";import{a as o}from"./chunk-EI7MMDWY.js";import{keyText as oe}from"@earendil-works/pi-coding-agent";import{Text as ie}from"@earendil-works/pi-tui";import se from"node:os";function V(){let e=[],r,s=new Map,a=new Map,i=new Map,c=new Map,u=Promise.resolve(),f={registerPlugin(n){if(n.id.trim().length===0)return Promise.reject(new Error("Plugin ID must not be empty"));let d=c.get(n.id);if(d!==void 0)return d;let p=u.then(async()=>{let m=[],y=[],S,R,h=[],l={addSelectionProvider(t){if(S!==void 0||r!==void 0)throw new Error("Search selection provider is already registered");S=t},registerSelection(t,w){if(r===void 0)throw new Error("Search selections are unavailable. Enable the shared search selection plugin.");return r(t,w)},addResolver(t){B(t),m.push(t)},addAction(t){Q(t),y.push(t)},describe(t){if(R!==void 0)throw new Error(`Plugin ${n.id} provides more than one description`);R=G(t)},addPromptGuideline(t){h.push(G(t))},search:o((t,w,T)=>f.execute(t,w,T),"search"),runAction(t,w){return f.runAction(t.reference,t.capability,t.resolverId,t.input,w)}};await n.setup(l);let g=new Set(e.map(({registration:t})=>t.resolver.id));for(let t of m){if(g.has(t.resolver.id))throw new Error(`Search resolver ${t.resolver.id} is already registered`);g.add(t.resolver.id)}for(let t of y){let w=E(t.resolverId,t.capability);if(s.has(w)||y.some(T=>T!==t&&E(T.resolverId,T.capability)===w))throw new Error(`Search action ${w} is already registered`)}for(let t of m)e.push({pluginId:n.id,registration:t,order:e.length});S!==void 0&&(r=S);for(let t of y)s.set(E(t.resolverId,t.capability),t);R!==void 0&&i.set(n.id,R),h.length>0&&a.set(n.id,h)});return c.set(n.id,p),u=p.catch(()=>{}),p.catch(()=>{c.delete(n.id)}),p},async waitForPendingPlugins(){await Promise.all(c.values())},async execute(n,d,p="agent"){if(n.query.trim().length===0)return v("INVALID_REQUEST","Search query must not be empty");let m=[...e].sort((h,l)=>+(h.registration.fallback===!0)-+(l.registration.fallback===!0)||(h.registration.priority??0)-(l.registration.priority??0)||h.order-l.order),y=/^[a-z][\w-]*:\s*$/iu.test(n.query),S=/^[a-z][\w-]*:/iu.test(n.query);for(let h of m){if(y&&!h.registration.fallback)continue;let l=h.registration.resolver,g;try{d.signal?.throwIfAborted(),g=await l.tryResolve(n,d)}catch(t){return v("RESOLVE_FAILED",x(t,`Resolver ${l.id} failed`),l.id,t)}if(!Y(g))return v("INVALID_RESOLVER_RESULT",`Resolver ${l.id} returned an invalid result`,l.id);if(g.kind!=="not-handled"){if(g.kind==="failed")return v("RESOLVE_FAILED",x(g.error,`Resolver ${l.id} failed`),l.id,g.error);try{let t=await l.format(g.payload,d);return X(t)?{content:h.registration.fallback&&S?[{type:"text",text:y?"Search fallback: empty protocol query; searched the original text.":"Search fallback: unhandled protocol query; searched the original text."},...t.content]:t.content,details:{resolverId:l.id,payload:t.details},...p==="script"&&{script:{resolverId:l.id,data:g.payload,details:t.details}},...t.usage!==void 0&&{usage:t.usage}}:v("FORMAT_FAILED",`Resolver ${l.id} formatter returned an invalid result`,l.id)}catch(t){return v("FORMAT_FAILED",x(t,`Resolver ${l.id} formatter failed`),l.id,t)}}}let R=`No search resolver handled ${n.query}`;return j(v("NO_RESOLVER",R),R)},runAction(n,d,p,m,y){let S=s.get(E(p,d));if(S===void 0)throw new Error(`Search reference does not support ${d}`);return S.execute(n,m,y)},renderDescriptions(){return[...i.values()].flatMap(n=>{let d=H(n);return d===void 0?[]:[d]})},renderPromptGuidelines(){return[...a.values()].flat().flatMap(n=>{let d=H(n);return d===void 0?[]:[d]})},renderer(n){return e.find(({registration:d})=>d.resolver.id===n)?.registration.resolver.renderResult}};return f}o(V,"createSearchCore");function B(e){if(!A(e)||!A(e.resolver))throw new TypeError("Invalid search resolver registration");let r=e.resolver;if(typeof r.id!="string"||r.id.trim().length===0||typeof r.tryResolve!="function"||typeof r.format!="function")throw new TypeError("Invalid search resolver registration");if(e.priority!==void 0&&(typeof e.priority!="number"||!Number.isFinite(e.priority)))throw new TypeError("Invalid search resolver priority")}o(B,"assertResolver");function Q(e){if(!A(e)||typeof e.resolverId!="string"||e.resolverId.trim().length===0||typeof e.capability!="string"||e.capability.trim().length===0||typeof e.execute!="function")throw new TypeError("Invalid search action registration")}o(Q,"assertAction");function A(e){return typeof e=="object"&&e!==null}o(A,"isRecord");function Y(e){if(typeof e!="object"||e===null||!("kind"in e))return!1;let r=e.kind;return r==="not-handled"||r==="resolved"&&"payload"in e||r==="failed"&&"error"in e}o(Y,"isAttempt");function X(e){return typeof e=="object"&&e!==null&&Array.isArray(e.content)}o(X,"isAgentToolResult");function v(e,r,s,a){return{content:[{type:"text",text:r}],details:{failure:{code:e,message:r,...s!==void 0&&{resolverId:s},...a!==void 0&&{cause:a}}}}}o(v,"failure");function G(e){if(typeof e=="function")return e;if(typeof e!="string"||e.trim().length===0)throw new TypeError("Search description must not be empty");return e.trim()}o(G,"normalizeDescriptionSource");function H(e){let r=typeof e=="function"?e():e;if(r!==void 0){if(typeof r!="string"||r.trim().length===0)throw new TypeError("Search description must not be empty");return r.trim()}}o(H,"renderDescription");function E(e,r){return`${e}:${r}`}o(E,"actionKey");function x(e,r){return!(e instanceof Error)||e.message.trim().length===0?r:e instanceof SyntaxError?e.message:`${r}: ${e.message}`}o(x,"messageFor");import{readFile as Z}from"node:fs/promises";import ee from"node:os";import b from"node:path";var re=3e4;function J(e=process.env,r=ee.homedir(),s=process.cwd()){let a=e.PI_CODING_AGENT_DIR?.trim(),i=a===void 0||a.length===0?b.join(r,".pi","agent"):b.resolve(a);return{globalPath:b.join(i,"pi-agent-ide","search.json"),projectPath:b.resolve(s,".pi","pi-agent-ide","search.json")}}o(J,"resolveSearchConfigPaths");async function W(e){let[r,s]=await Promise.all([q(e.globalPath),q(e.projectPath)]),a=s!==void 0?s:r;return{timeoutMs:a===void 0?re:a}}o(W,"loadSearchConfig");async function q(e){let r;try{r=await Z(e,"utf8")}catch(c){if(te(c))return;throw new Error(`Cannot read Pi Agent IDE search config at ${e}`,{cause:c})}let s;try{s=JSON.parse(r)}catch(c){throw new Error(`Invalid JSON in Pi Agent IDE search config at ${e}`,{cause:c})}if(!U(s))throw new TypeError(`Pi Agent IDE search config at ${e} must be a JSON object`);let a=Object.keys(s).find(c=>c!=="timeoutMs");if(a!==void 0)throw new TypeError(`Pi Agent IDE search config at ${e} contains unknown key ${a}`);let i=s.timeoutMs;if(i==null)return i;if(typeof i!="number"||!Number.isSafeInteger(i)||i<=0)throw new TypeError(`timeoutMs must be a positive integer or null in Pi Agent IDE search config at ${e}`);return i}o(q,"readTimeout");function te(e){return U(e)&&e.code==="ENOENT"}o(te,"isMissingFile");function U(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(U,"isRecord");var z=Symbol("search-timeout"),k=class extends Error{static{o(this,"SearchTimeoutError")}constructor(r){super(r),this.name="SearchTimeoutError"}};async function _(e,r,s){if(e===null)return s(r);let a=new AbortController,i=r===void 0?a.signal:AbortSignal.any([r,a.signal]),c,u=new Promise(f=>{c=setTimeout(()=>{f(z),a.abort()},e)});try{let f=await Promise.race([s(i),u]);if(f===z)throw new k(`Search timed out after ${ne(e)}. Try a smaller path scope.`);return f}finally{clearTimeout(c)}}o(_,"runWithSearchTimeout");function ne(e){if(e%1e3!==0)return`${String(e)}ms`;let r=e/1e3;return`${String(r)} ${r===1?"second":"seconds"}`}o(ne,"formatDuration");function ae(e,r){let s=[...e.path===void 0?[]:[{text:`in ${e.path}`,color:"accent",underline:!0,truncate:"start"}],...e.include===void 0?[]:[{text:`include ${e.include}`}],...e.exclude===void 0?[]:[{text:`exclude ${e.exclude}`}],...e.caseSensitive===!0?[{text:"case sensitive"}]:[],...e.wholeWord===!0?[{text:"whole word"}]:[],...e.limit===void 0?[]:[{text:`limit ${String(e.limit)}`}]];return{tool:"search",primary:{text:JSON.stringify(e.query),color:"accent",truncate:"end"},qualifiers:s,details:ce(e),expanded:r}}o(ae,"searchCallModel");async function K(e){let r=V(),s=new F,a=e.events.on(N,i=>{if(!M(i))throw new Error("Invalid pi-agent-search plugin registration request");i.accept(r.registerPlugin(i.plugin))});e.on("session_shutdown",a),e.registerTool(L({name:"search",label:"search",get description(){return["Use search to locate text, file paths and code structures in the workspace.",...r.renderDescriptions()].join(`
2
+ `)},promptSnippet:"Search files and text with literals or regular expressions, plus syntax trees and language symbols",get promptGuidelines(){return["Use the narrowest useful search query and scope; broaden when needed.",...r.renderPromptGuidelines()]},parameters:O,renderCall(i,c,u){return I(u.lastComponent,ae(i,u.expanded),c)},renderResult(i,c,u,f){let n=i.details,d=n?.resolverId===void 0?void 0:r.renderer(n.resolverId);if(d!==void 0){let p={...i,details:n?.payload};return d(p,c,u,f)}return de(i,c,u)},async execute(i,c,u,f,n){let d=await W(J(process.env,se.homedir(),n.cwd));return _(d.timeoutMs,u,async p=>(await r.waitForPendingPlugins(),r.execute(c,{cwd:n.cwd,...p!==void 0&&{signal:p},...f!==void 0&&{onUpdate:o(m=>{f(m)},"onUpdate")}})))}},s)),e.events.emit($,{protocol:C,apiVersion:D}),await r.waitForPendingPlugins()}o(K,"registerSearchCore");function ce(e){return[{label:"query",value:JSON.stringify(e.query)},...P("path",e.path),...P("include",e.include),...P("exclude",e.exclude),...P("caseSensitive",e.caseSensitive===void 0?void 0:String(e.caseSensitive)),...P("wholeWord",e.wholeWord===void 0?void 0:String(e.wholeWord)),...P("limit",e.limit===void 0?void 0:String(e.limit))]}o(ce,"searchCallDetails");function P(e,r){return r===void 0?[]:[{label:e,value:r}]}o(P,"optionalDetail");function de(e,r,s){let a=e.content.flatMap(u=>u.type==="text"?[u.text]:[]).join(`
3
3
  `),i=r.expanded?a:a.split(`
4
4
  `).slice(0,8).join(`
5
- `),l=!r.expanded&&a.split(`
5
+ `),c=!r.expanded&&a.split(`
6
6
  `).length>8?`
7
- ${s.fg("dim",`${te("app.tools.expand")} to expand`)}`:"";return new ne(`${s.fg("muted",i)}${l}`,0,0)}o(ce,"fallbackResult");export{B as default};
7
+ ${s.fg("dim",`${oe("app.tools.expand")} to expand`)}`:"";return new ie(`${s.fg("muted",i)}${c}`,0,0)}o(de,"fallbackResult");export{K as default};
package/dist/entry-46.js CHANGED
@@ -1,11 +1,11 @@
1
- import{a as f,b as X,c as z,d as de,g as J}from"./chunk-JJVXUL5U.js";import"./chunk-LQYZG62K.js";import{a as H}from"./chunk-ERVMDQGX.js";import{a as F,b as I}from"./chunk-VFBLX4TG.js";import{a as j}from"./chunk-E2RESHYR.js";import{a as _,b as q}from"./chunk-T2RPMEM2.js";import{a as V}from"./chunk-WNMGUALD.js";import{a as B,b as W,d as G}from"./chunk-THSCUT2L.js";import"./chunk-S3ZPXWX7.js";import{t as O,u as P}from"./chunk-RAZOACDD.js";import{d as L,e as v}from"./chunk-N34ATN52.js";import{a as k}from"./chunk-ZC65Z3CK.js";import{a as s}from"./chunk-EI7MMDWY.js";var Q={protocol:F,apiVersion:1,id:"search-text",setup(e){e.addSetupCheck({id:"ripgrep",async inspect(t){let r=f(t.env.PI_CODING_AGENT_DIR);return await L(r,t.cwd,t.env)?{}:{actions:[{id:"ripgrep-unavailable",message:"Local search is unavailable because ripgrep was not found"}]}}}),e.addCheck({id:"ripgrep",title:"Local search",async run(t){let r=t.env.PI_CODING_AGENT_DIR,n=f(r),i=await v(n,["--version"],t.cwd,t.env);return[i.ok?{status:"pass",message:"ripgrep is available",detail:i.detail}:{status:"fail",message:"ripgrep is not available",detail:i.detail}]}})}};import ie from"node:path";import{spawn as he}from"node:child_process";import y from"node:path";function K(e,t,r,n){let i=t.limit??100,o=["--files","--hidden","--no-config","--no-ignore-parent","--glob","!.git/**"];for(let a of U(t.include))o.push("--glob",a);for(let a of U(t.exclude))o.push("--glob",`!${a}`);return t.path!==void 0&&o.push(t.path),new Promise((a,l)=>{let c=he(f(),o,{cwd:r,stdio:["ignore","pipe","pipe"]}),u="",m="";c.stdout.setEncoding("utf8"),c.stderr.setEncoding("utf8"),c.stdout.on("data",h=>u+=h),c.stderr.on("data",h=>m+=h);let N=s(()=>{c.kill("SIGTERM")},"abort");n?.addEventListener("abort",N,{once:!0}),c.once("error",l),c.once("close",h=>{if(n?.removeEventListener("abort",N),n?.aborted===!0){l(n.reason instanceof Error?n.reason:new Error("File search aborted"));return}if(h!==0&&h!==1){l(new Error(m.trim()||`rg exited with code ${String(h)}`));return}let M=u.split(`
2
- `).filter(Boolean).map(p=>y.relative(r,y.resolve(r,p))).filter(p=>me(p,e)).sort((p,ue)=>p.localeCompare(ue));a({files:M.slice(0,i),complete:M.length<=i})})})}s(K,"searchFiles");function U(e){return e?.split(",").map(t=>t.trim()).filter(Boolean)??[]}s(U,"splitGlobs");function me(e,t){if(/[*?[\]{}]/u.test(t)){let r=t.replace(/^\.\//u,"");return y.matchesGlob(r.includes("/")?e:y.basename(e),r)}return pe(e,t)}s(me,"matchFile");function pe(e,t){if(t.length===0)return!0;let r=0,n=e.toLowerCase();for(let i of t.toLowerCase()){if(r=n.indexOf(i,r),r===-1)return!1;r+=1}return!0}s(pe,"fuzzyMatch");import Re from"node:path";import{keyText as re}from"@earendil-works/pi-coding-agent";import{Text as Te,truncateToWidth as S,visibleWidth as d,wrapTextWithAnsi as Ce}from"@earendil-works/pi-tui";import $ from"node:path";import{pathToFileURL as fe}from"node:url";function A(e,t,r,n,i){let o=new Map;for(let l of t){let c=$.resolve(l.source);o.set(c,[...o.get(c)??[],l])}let a=[...o].sort(([l],[c])=>l.localeCompare(c)).map(([l,c])=>ge(l,c,n));return{...i!==void 0&&{sessionId:i},query:e,matchCount:t.length,fileCount:a.length,complete:r,files:a}}s(A,"createSearchToolDetails");function x(e){if(!R(e)||typeof e.query!="string"||!b(e.matchCount)||!b(e.fileCount)||typeof e.complete!="boolean"||e.sessionId!==void 0&&typeof e.sessionId!="string"||!Array.isArray(e.files)||!e.files.every(Se))return!1;let t=e.files;return e.fileCount===t.length&&e.matchCount===t.reduce((r,n)=>r+n.matchCount,0)}s(x,"isSearchToolDetails");function ge(e,t,r){let n=new Map;for(let o of t){let a=n.get(o.lineNumber);if(a!==void 0&&a.text!==o.lineText)throw new Error(`Search results disagree about line ${String(o.lineNumber)} in ${e}.`);let l=a??{lineNumber:o.lineNumber,text:o.lineText,ranges:[]};l.ranges.push({from:o.startColumn,to:o.endColumn}),n.set(o.lineNumber,l)}let i=[...n.values()].sort((o,a)=>o.lineNumber-a.lineNumber).map(o=>{let a=[...o.ranges].sort((l,c)=>l.from-c.from||l.to-c.to);return{lineNumber:o.lineNumber,text:o.text,matchCount:a.length,ranges:a}});return{path:xe(e,r),link:fe(e).href,matchCount:t.length,lines:i}}s(ge,"createSearchResultFile");function Se(e){return!R(e)||typeof e.path!="string"||typeof e.link!="string"||!b(e.matchCount)||!Array.isArray(e.lines)||!e.lines.every(ye)?!1:e.matchCount===e.lines.reduce((t,r)=>t+r.matchCount,0)}s(Se,"isSearchResultFile");function ye(e){return R(e)&&Number.isSafeInteger(e.lineNumber)&&e.lineNumber>=1&&typeof e.text=="string"&&b(e.matchCount)&&Array.isArray(e.ranges)&&e.ranges.length===e.matchCount&&e.ranges.every(t=>be(t,e.text))}s(ye,"isSearchResultLine");function be(e,t){return R(e)&&Number.isSafeInteger(e.from)&&Number.isSafeInteger(e.to)&&e.from>=0&&e.to>e.from&&e.to<=t.length}s(be,"isSearchResultRange");function R(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(R,"isRecord");function b(e){return Number.isSafeInteger(e)&&e>=0}s(b,"isCount");function xe(e,t){let r=$.relative(t,e);return r.length>0&&!r.startsWith("..")&&!$.isAbsolute(r)?r:e}s(xe,"displaySource");function Y(e){return e.replaceAll("\u27E6","").replaceAll("\u27E7","")}s(Y,"sourceText");function Z(e,t){let{files:r,...n}=e,i=Y(t);return{...n,storedFiles:r.map(({lines:o,...a})=>({...a,lines:o.map(l=>[l.lineNumber,O(l.text,i),l.ranges])}))}}s(Z,"compactSearchDetails");function ee(e,t){if("files"in e)return e;let{storedFiles:r,...n}=e,i=Y(t);return{...n,files:r.map(({lines:o,...a})=>({...a,lines:o.map(([l,c,u])=>({lineNumber:l,text:P(c,i),ranges:u,matchCount:u.length}))}))}}s(ee,"restoreSearchDetails");var te=new WeakMap,T=12,$e={".ts":{label:"TS",color:"accent"},".tsx":{label:"TX",color:"accent"},".js":{label:"JS",color:"warning"},".jsx":{label:"JX",color:"warning"},".json":{label:"{}",color:"warning"},".md":{label:"MD",color:"mdHeading"},".py":{label:"PY",color:"accent"},".rs":{label:"RS",color:"accent"},".go":{label:"GO",color:"accent"},".css":{label:"CS",color:"accent"},".html":{label:"<>",color:"accent"}};function ne(e,t,r,n){if(typeof e.details=="object"){let a=te.get(e.details);a===void 0&&(a=ee(e.details,e.content.flatMap(l=>l.type==="text"?[l.text]:[]).join(`
3
- `)),te.set(e.details,a)),e={...e,details:a}}if(t.isPartial||n.isError||!x(e.details)){let a=e.content[0],l=a?.type==="text"?a.text:"",c=n.isError?"error":t.isPartial?"dim":"toolOutput";return new Te(r.fg(c,l),0,0)}let o=(n.lastComponent instanceof C?n.lastComponent:void 0)??new C(e.details,r,t.expanded);return o.update(e.details,r,t.expanded),o}s(ne,"renderSearchResult");var C=class{constructor(t,r,n){this.details=t;this.theme=r;this.expanded=n}static{s(this,"SearchResultPanel")}cached;update(t,r,n){this.details===t&&this.theme===r&&this.expanded===n||(this.details=t,this.theme=r,this.expanded=n,this.invalidate())}render(t){if(this.cached?.width===t)return this.cached.lines;if(t<4){let u=[S(oe(this.details),Math.max(1,t))];return this.cached={width:t,lines:u},u}let r=t-2,n=Ae(this.details,this.expanded),i=ve(this.details.files),o=n.flatMap(u=>we(u,r,i,this.theme)),a=Ee(o,this.expanded,r,this.theme),l=[ke(this.details,r,this.theme),...a];l.push(this.theme.fg("borderMuted",`\u2570${"\u2500".repeat(r)}\u256F`));let c=l.map(u=>S(u,t));return this.cached={width:t,lines:c},c}invalidate(){this.cached=void 0}};function Ae(e,t){let r=e.files.length===0?[{kind:"empty"}]:e.files.flatMap(o=>[{kind:"file",file:o},...o.lines.map(a=>({kind:"line",file:o,line:a}))]);if(t||r.length<=T)return r;let n=r.slice(0,T-1);for(;n.at(-1)?.kind==="file";)n.pop();let i=n.reduce((o,a)=>o+(a.kind==="line"?a.line.matchCount:0),0);return[...n,{kind:"omitted",matches:e.matchCount-i}]}s(Ae,"searchViewport");function Ee(e,t,r,n){if(t||e.length<=T)return e;let i=`${re("app.tools.expand")} to expand`,o=g(n.fg("dim",` \u2026 output truncated \xB7 ${i}`),r,n);return[...e.slice(0,T-1),o]}s(Ee,"compactRenderedRows");function we(e,t,r,n){if(e.kind==="file")return[g(De(e.file,t,n),t,n,!0)];if(e.kind==="line")return Ne(e.line,t,r,n);if(e.kind==="omitted"){let i=`${re("app.tools.expand")} to expand`;return[g(n.fg("dim",` \u2026 ${String(e.matches)} more ${w(e.matches,"match","matches")} \xB7 ${i}`),t,n)]}return[g(n.fg("dim"," No matches found"),t,n)]}s(we,"renderPanelRow");function De(e,t,r){let n=Oe(e.path,r),i=r.fg("accent",r.bold(String(e.matchCount))),o=d(n)+d(i)+4,a=Math.max(1,t-o),l=Le(e.path,a),c=Pe(l,e.link,r),u=` ${n} ${c}`,m=" ".repeat(Math.max(1,t-d(u)-d(i)-1));return S(`${u}${m}${i} `,t)}s(De,"renderFileHeader");function Ne(e,t,r,n){let i=String(e.lineNumber).padStart(r),o=` ${n.fg("dim",i)} ${n.fg("borderMuted","\u2502")} `,a=Math.max(1,t-d(o)-1),l=Ce(Me(e,n),a),c=" ".repeat(d(o));return l.map((u,m)=>g(`${m===0?o:c}${u}`,t,n))}s(Ne,"renderMatchLine");function Me(e,t){let r="",n=0;for(let i of e.ranges){i.from>n&&(r+=t.fg("toolOutput",E(e.text.slice(n,i.from))));let o=E(e.text.slice(i.from,i.to));r+=t.bg("selectedBg",t.fg("accent",t.bold(o))),n=i.to}return n<e.text.length&&(r+=t.fg("toolOutput",E(e.text.slice(n)))),r}s(Me,"renderHighlightedLine");function ke(e,t,r){let n=s(a=>r.fg("borderMuted",a),"frame"),i=S(` ${oe(e)} `,Math.max(0,t-1),""),o="\u2500".repeat(Math.max(0,t-d(i)-1));return`${n("\u256D\u2500")}${r.fg("accent",i)}${n(`${o}\u256E`)}`}s(ke,"renderTopBorder");function oe(e){return e.matchCount===0?"No matches":`${`${String(e.matchCount)}${e.complete?"":"+"}`} ${w(e.matchCount,"match","matches")} in ${String(e.fileCount)} ${w(e.fileCount,"file","files")}`}s(oe,"searchSummary");function g(e,t,r,n=!1){let i=S(e,t),o=`${i}${" ".repeat(Math.max(0,t-d(i)))}`,a=n?r.bg("selectedBg",o):o,l=r.fg("borderMuted","\u2502");return`${l}${a}${l}`}s(g,"framed");function Oe(e,t){let r=Re.extname(e).toLowerCase(),n=$e[r]??{label:"\u25C7 ",color:r.length===0?"muted":"accent"};return t.fg(n.color,t.bold(n.label))}s(Oe,"fileBadge");function Pe(e,t,r){let n=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\")),i=n===-1?"":e.slice(0,n+1),o=n===-1?e:e.slice(n+1),a=r.fg("muted",i)+r.underline(r.fg("accent",o));return t.includes("\x07")||t.includes("\x1B")?a:`\x1B]8;;${t}\x07${a}\x1B]8;;\x07`}s(Pe,"fileLink");function Le(e,t){return d(e)<=t?e:t<=1?"\u2026":`\u2026${e.slice(-(t-1))}`}s(Le,"truncatePath");function E(e){let t="";for(let r of e){if(r===" "){t+=" ".repeat(4);continue}let n=k(r.codePointAt(0));t+=n<32||n===127?"\uFFFD":r}return t}s(E,"safeText");function ve(e){let t=1;for(let r of e)for(let n of r.lines)t=Math.max(t,n.lineNumber);return Math.max(3,String(t).length)}s(ve,"maximumLineNumberWidth");function w(e,t,r){return e===1?t:r}s(w,"plural");function ae(e){return ce("text",e,X)}s(ae,"createTextResolver");function se(e){return ce("regex",e,t=>t.query.startsWith("regex:")?{...t,query:t.query.slice(6),regex:!0}:void 0)}s(se,"createRegexResolver");function le(){return{id:"files",async tryResolve(e,t){if(!e.query.startsWith("files:"))return{kind:"not-handled"};let r=e.query.slice(6).trim(),n=await K(r,e,t.cwd,t.signal);return{kind:"resolved",payload:{query:r,...n}}},format(e){let t=e;return{content:[{type:"text",text:[t.complete?`${String(t.files.length)} files`:`${String(t.files.length)}+ files (limit reached)`,...t.files].join(`
4
- `)}],details:{query:t.query,files:t.files,complete:t.complete}}}}}s(le,"createFileResolver");function ce(e,t,r){return{id:e,async tryResolve(n,i){let o=r(n);if(o===void 0)return{kind:"not-handled"};let a=await z(o,i.cwd,i.signal);return{kind:"resolved",payload:{request:{...n,query:a.query},...a,recipe:{...o,originalQuery:n.query}}}},async format(n,i){let o=n;if(o.matches.length===0)return{content:[{type:"text",text:[...o.notices,"No matches found."].join(`
5
- `)}],details:A(o.request.query,[],o.complete,i.cwd)};let a=await t.register(o.request.query,o.matches,o.complete,i.cwd,i.signal,o.recipe);return{content:[{type:"text",text:[...o.notices,Fe(a,i.cwd)].join(`
6
- `)}],details:A(a.query,a.matches,a.complete,i.cwd,a.id)}},renderResult:ne}}s(ce,"createMatchResolver");function Fe(e,t){let r=new Set(e.matches.map(l=>l.source)).size,n=e.matches.length,i=e.complete?`SEARCH#${e.id}:all:line / SEARCH#${e.id}:all:match \u2014 ${String(n)} ${D(n,"match","matches")} in ${String(r)} ${D(r,"file","files")}`:`${String(n)}+ matches in ${String(r)} ${D(r,"file","files")} (limit reached; no all anchors were registered)`,o,a=["Anchors: SEARCH#HASH:N:line (line), SEARCH#HASH:N:match (exact match), SEARCH#HASH:all:line (each unique containing line), SEARCH#HASH:all:match (every exact match)",i];for(let[l,c]of e.matches.entries()){o!==void 0&&o!==c.source&&a.push("");let u=He(c.source,t);a.push(`${u}:${String(c.lineNumber)}:${String(c.startColumn+1)}-${String(c.endColumn+1)} SEARCH#${e.id}:${String(l+1)}:line SEARCH#${e.id}:${String(l+1)}:match`,` ${Ie(c)}`),o=c.source}return e.complete||a.push("","Increase limit and search again before applying a complete replacement."),a.join(`
7
- `)}s(Fe,"formatSearchSession");function Ie(e){let r=Math.max(0,e.startColumn-64),n=Math.min(e.lineText.length,e.endColumn+64);return`${r>0?"\u2026":""}${e.lineText.slice(r,e.startColumn)}\u27E6${e.lineText.slice(e.startColumn,e.endColumn)}\u27E7${e.lineText.slice(e.endColumn,n)}${n<e.lineText.length?"\u2026":""}`}s(Ie,"previewMatch");function He(e,t){let r=ie.relative(t,e);return r.length>0&&!r.startsWith("..")&&!ie.isAbsolute(r)?r:e}s(He,"displaySource");function D(e,t,r){return e===1?t:r}s(D,"plural");async function _e(e){let t=new J;e.on("tool_result",async(r,n)=>{if(r.toolName!=="replace"||r.isError||typeof r.details!="object"||r.details===null)return;let i=await t.observeAfterEdit([r.input.path,r.input.start,r.input.end],n.signal);if(i.length!==0)return{content:[...r.content,{type:"text",text:["Original search observed after editing (not task validation):",...i.map(o=>{let{query:a,fallbacks:l,...c}=o.scope;return[`SEARCH#${o.sessionId}: ${JSON.stringify(o.query)}`,`Scope and options: ${JSON.stringify(c)}`,o.error===void 0?`Matches: ${o.matches}${o.complete===!0?"; complete search.":"+; incomplete search, lower bound only."}`:`Search failed: ${o.error}. Applied edits remain applied.`,...o.notices??[]].join(`
1
+ import{a as f,b as X,c as z,d as de,g as J}from"./chunk-NMFQGKPE.js";import"./chunk-GUTQ3PWL.js";import{a as I}from"./chunk-ERVMDQGX.js";import{a as F,b as H}from"./chunk-VFBLX4TG.js";import{a as j}from"./chunk-ZTYWHL2F.js";import{a as q,b as _}from"./chunk-7UGNGK7Y.js";import{a as V}from"./chunk-CEKXBS55.js";import{a as B,b as W,d as G}from"./chunk-LRYE2WCN.js";import"./chunk-S3ZPXWX7.js";import{t as M,u as P}from"./chunk-5VSE5X5R.js";import{d as v,e as L}from"./chunk-N34ATN52.js";import{a as O}from"./chunk-ZC65Z3CK.js";import{a as l}from"./chunk-EI7MMDWY.js";var Q={protocol:F,apiVersion:1,id:"search-text",setup(e){e.addSetupCheck({id:"ripgrep",async inspect(t){let r=f(t.env.PI_CODING_AGENT_DIR);return await v(r,t.cwd,t.env)?{}:{actions:[{id:"ripgrep-unavailable",message:"Local search is unavailable because ripgrep was not found"}]}}}),e.addCheck({id:"ripgrep",title:"Local search",async run(t){let r=t.env.PI_CODING_AGENT_DIR,n=f(r),a=await L(n,["--version"],t.cwd,t.env);return[a.ok?{status:"pass",message:"ripgrep is available",detail:a.detail}:{status:"fail",message:"ripgrep is not available",detail:a.detail}]}})}};import ae from"node:path";import{spawn as he}from"node:child_process";import y from"node:path";function K(e,t,r,n){let a=t.limit??100,o=["--files","--hidden","--no-config","--no-ignore-parent","--glob","!.git/**"];for(let i of U(t.include))o.push("--glob",i);for(let i of U(t.exclude))o.push("--glob",`!${i}`);return t.path!==void 0&&o.push(t.path),new Promise((i,s)=>{let c=he(f(),o,{cwd:r,stdio:["ignore","pipe","pipe"]}),u="",h="";c.stdout.setEncoding("utf8"),c.stderr.setEncoding("utf8"),c.stdout.on("data",m=>u+=m),c.stderr.on("data",m=>h+=m);let k=l(()=>{c.kill("SIGTERM")},"abort");n?.addEventListener("abort",k,{once:!0}),c.once("error",s),c.once("close",m=>{if(n?.removeEventListener("abort",k),n?.aborted===!0){s(n.reason instanceof Error?n.reason:new Error("File search aborted"));return}if(m!==0&&m!==1){s(new Error(h.trim()||`rg exited with code ${String(m)}`));return}let N=u.split(`
2
+ `).filter(Boolean).map(p=>y.relative(r,y.resolve(r,p))).filter(p=>me(p,e)).sort((p,ue)=>p.localeCompare(ue));i({files:N.slice(0,a),complete:N.length<=a})})})}l(K,"searchFiles");function U(e){return e?.split(",").map(t=>t.trim()).filter(Boolean)??[]}l(U,"splitGlobs");function me(e,t){if(/[*?[\]{}]/u.test(t)){let r=t.replace(/^\.\//u,"");return y.matchesGlob(r.includes("/")?e:y.basename(e),r)}return pe(e,t)}l(me,"matchFile");function pe(e,t){if(t.length===0)return!0;let r=0,n=e.toLowerCase();for(let a of t.toLowerCase()){if(r=n.indexOf(a,r),r===-1)return!1;r+=1}return!0}l(pe,"fuzzyMatch");import Re from"node:path";import{keyText as re}from"@earendil-works/pi-coding-agent";import{Text as Te,truncateToWidth as S,visibleWidth as d,wrapTextWithAnsi as Ce}from"@earendil-works/pi-tui";import $ from"node:path";import{pathToFileURL as fe}from"node:url";function A(e,t,r,n,a){let o=new Map;for(let s of t){let c=$.resolve(s.source);o.set(c,[...o.get(c)??[],s])}let i=[...o].sort(([s],[c])=>s.localeCompare(c)).map(([s,c])=>ge(s,c,n));return{...a!==void 0&&{sessionId:a},query:e,matchCount:t.length,fileCount:i.length,complete:r,files:i}}l(A,"createSearchToolDetails");function x(e){if(!R(e)||typeof e.query!="string"||!b(e.matchCount)||!b(e.fileCount)||typeof e.complete!="boolean"||e.sessionId!==void 0&&typeof e.sessionId!="string"||!Array.isArray(e.files)||!e.files.every(Se))return!1;let t=e.files;return e.fileCount===t.length&&e.matchCount===t.reduce((r,n)=>r+n.matchCount,0)}l(x,"isSearchToolDetails");function ge(e,t,r){let n=new Map;for(let o of t){let i=n.get(o.lineNumber);if(i!==void 0&&i.text!==o.lineText)throw new Error(`Search results disagree about line ${String(o.lineNumber)} in ${e}.`);let s=i??{lineNumber:o.lineNumber,text:o.lineText,ranges:[]};s.ranges.push({from:o.startColumn,to:o.endColumn}),n.set(o.lineNumber,s)}let a=[...n.values()].sort((o,i)=>o.lineNumber-i.lineNumber).map(o=>{let i=[...o.ranges].sort((s,c)=>s.from-c.from||s.to-c.to);return{lineNumber:o.lineNumber,text:o.text,matchCount:i.length,ranges:i}});return{path:xe(e,r),link:fe(e).href,matchCount:t.length,lines:a}}l(ge,"createSearchResultFile");function Se(e){return!R(e)||typeof e.path!="string"||typeof e.link!="string"||!b(e.matchCount)||!Array.isArray(e.lines)||!e.lines.every(ye)?!1:e.matchCount===e.lines.reduce((t,r)=>t+r.matchCount,0)}l(Se,"isSearchResultFile");function ye(e){return R(e)&&Number.isSafeInteger(e.lineNumber)&&e.lineNumber>=1&&typeof e.text=="string"&&b(e.matchCount)&&Array.isArray(e.ranges)&&e.ranges.length===e.matchCount&&e.ranges.every(t=>be(t,e.text))}l(ye,"isSearchResultLine");function be(e,t){return R(e)&&Number.isSafeInteger(e.from)&&Number.isSafeInteger(e.to)&&e.from>=0&&e.to>e.from&&e.to<=t.length}l(be,"isSearchResultRange");function R(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}l(R,"isRecord");function b(e){return Number.isSafeInteger(e)&&e>=0}l(b,"isCount");function xe(e,t){let r=$.relative(t,e);return r.length>0&&!r.startsWith("..")&&!$.isAbsolute(r)?r:e}l(xe,"displaySource");function Y(e){return e.replaceAll("\u27E6","").replaceAll("\u27E7","")}l(Y,"sourceText");function Z(e,t){let{files:r,...n}=e,a=Y(t);return{...n,storedFiles:r.map(({lines:o,...i})=>({...i,lines:o.map(s=>[s.lineNumber,M(s.text,a),s.ranges])}))}}l(Z,"compactSearchDetails");function ee(e,t){if("files"in e)return e;let{storedFiles:r,...n}=e,a=Y(t);return{...n,files:r.map(({lines:o,...i})=>({...i,lines:o.map(([s,c,u])=>({lineNumber:s,text:P(c,a),ranges:u,matchCount:u.length}))}))}}l(ee,"restoreSearchDetails");var te=new WeakMap,T=12,$e={".ts":{label:"TS",color:"accent"},".tsx":{label:"TX",color:"accent"},".js":{label:"JS",color:"warning"},".jsx":{label:"JX",color:"warning"},".json":{label:"{}",color:"warning"},".md":{label:"MD",color:"mdHeading"},".py":{label:"PY",color:"accent"},".rs":{label:"RS",color:"accent"},".go":{label:"GO",color:"accent"},".css":{label:"CS",color:"accent"},".html":{label:"<>",color:"accent"}};function ne(e,t,r,n){if(typeof e.details=="object"){let i=te.get(e.details);i===void 0&&(i=ee(e.details,e.content.flatMap(s=>s.type==="text"?[s.text]:[]).join(`
3
+ `)),te.set(e.details,i)),e={...e,details:i}}if(t.isPartial||n.isError||!x(e.details)){let i=e.content[0],s=i?.type==="text"?i.text:"",c=n.isError?"error":t.isPartial?"dim":"toolOutput";return new Te(r.fg(c,s),0,0)}let o=(n.lastComponent instanceof C?n.lastComponent:void 0)??new C(e.details,r,t.expanded);return o.update(e.details,r,t.expanded),o}l(ne,"renderSearchResult");var C=class{constructor(t,r,n){this.details=t;this.theme=r;this.expanded=n}static{l(this,"SearchResultPanel")}cached;update(t,r,n){this.details===t&&this.theme===r&&this.expanded===n||(this.details=t,this.theme=r,this.expanded=n,this.invalidate())}render(t){if(this.cached?.width===t)return this.cached.lines;if(t<4){let u=[S(oe(this.details),Math.max(1,t))];return this.cached={width:t,lines:u},u}let r=t-2,n=Ae(this.details,this.expanded),a=Le(this.details.files),o=n.flatMap(u=>Ee(u,r,a,this.theme)),i=we(o,this.expanded,r,this.theme),s=[Oe(this.details,r,this.theme),...i];s.push(this.theme.fg("borderMuted",`\u2570${"\u2500".repeat(r)}\u256F`));let c=s.map(u=>S(u,t));return this.cached={width:t,lines:c},c}invalidate(){this.cached=void 0}};function Ae(e,t){let r=e.files.length===0?[{kind:"empty"}]:e.files.flatMap(o=>[{kind:"file",file:o},...o.lines.map(i=>({kind:"line",file:o,line:i}))]);if(t||r.length<=T)return r;let n=r.slice(0,T-1);for(;n.at(-1)?.kind==="file";)n.pop();let a=n.reduce((o,i)=>o+(i.kind==="line"?i.line.matchCount:0),0);return[...n,{kind:"omitted",matches:e.matchCount-a}]}l(Ae,"searchViewport");function we(e,t,r,n){if(t||e.length<=T)return e;let a=`${re("app.tools.expand")} to expand`,o=g(n.fg("dim",` \u2026 output truncated \xB7 ${a}`),r,n);return[...e.slice(0,T-1),o]}l(we,"compactRenderedRows");function Ee(e,t,r,n){if(e.kind==="file")return[g(De(e.file,t,n),t,n,!0)];if(e.kind==="line")return ke(e.line,t,r,n);if(e.kind==="omitted"){let a=`${re("app.tools.expand")} to expand`;return[g(n.fg("dim",` \u2026 ${String(e.matches)} more ${E(e.matches,"match","matches")} \xB7 ${a}`),t,n)]}return[g(n.fg("dim"," No matches found"),t,n)]}l(Ee,"renderPanelRow");function De(e,t,r){let n=Me(e.path,r),a=r.fg("accent",r.bold(String(e.matchCount))),o=d(n)+d(a)+4,i=Math.max(1,t-o),s=ve(e.path,i),c=Pe(s,e.link,r),u=` ${n} ${c}`,h=" ".repeat(Math.max(1,t-d(u)-d(a)-1));return S(`${u}${h}${a} `,t)}l(De,"renderFileHeader");function ke(e,t,r,n){let a=String(e.lineNumber).padStart(r),o=` ${n.fg("dim",a)} ${n.fg("borderMuted","\u2502")} `,i=Math.max(1,t-d(o)-1),s=Ce(Ne(e,n),i),c=" ".repeat(d(o));return s.map((u,h)=>g(`${h===0?o:c}${u}`,t,n))}l(ke,"renderMatchLine");function Ne(e,t){let r="",n=0;for(let a of e.ranges){a.from>n&&(r+=t.fg("toolOutput",w(e.text.slice(n,a.from))));let o=w(e.text.slice(a.from,a.to));r+=t.bg("selectedBg",t.fg("accent",t.bold(o))),n=a.to}return n<e.text.length&&(r+=t.fg("toolOutput",w(e.text.slice(n)))),r}l(Ne,"renderHighlightedLine");function Oe(e,t,r){let n=l(i=>r.fg("borderMuted",i),"frame"),a=S(` ${oe(e)} `,Math.max(0,t-1),""),o="\u2500".repeat(Math.max(0,t-d(a)-1));return`${n("\u256D\u2500")}${r.fg("accent",a)}${n(`${o}\u256E`)}`}l(Oe,"renderTopBorder");function oe(e){return e.matchCount===0?"No matches":`${`${String(e.matchCount)}${e.complete?"":"+"}`} ${E(e.matchCount,"match","matches")} in ${String(e.fileCount)} ${E(e.fileCount,"file","files")}`}l(oe,"searchSummary");function g(e,t,r,n=!1){let a=S(e,t),o=`${a}${" ".repeat(Math.max(0,t-d(a)))}`,i=n?r.bg("selectedBg",o):o,s=r.fg("borderMuted","\u2502");return`${s}${i}${s}`}l(g,"framed");function Me(e,t){let r=Re.extname(e).toLowerCase(),n=$e[r]??{label:"\u25C7 ",color:r.length===0?"muted":"accent"};return t.fg(n.color,t.bold(n.label))}l(Me,"fileBadge");function Pe(e,t,r){let n=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\")),a=n===-1?"":e.slice(0,n+1),o=n===-1?e:e.slice(n+1),i=r.fg("muted",a)+r.underline(r.fg("accent",o));return t.includes("\x07")||t.includes("\x1B")?i:`\x1B]8;;${t}\x07${i}\x1B]8;;\x07`}l(Pe,"fileLink");function ve(e,t){return d(e)<=t?e:t<=1?"\u2026":`\u2026${e.slice(-(t-1))}`}l(ve,"truncatePath");function w(e){let t="";for(let r of e){if(r===" "){t+=" ".repeat(4);continue}let n=O(r.codePointAt(0));t+=n<32||n===127?"\uFFFD":r}return t}l(w,"safeText");function Le(e){let t=1;for(let r of e)for(let n of r.lines)t=Math.max(t,n.lineNumber);return Math.max(3,String(t).length)}l(Le,"maximumLineNumberWidth");function E(e,t,r){return e===1?t:r}l(E,"plural");function ie(e){return ce("text",e,X)}l(ie,"createTextResolver");function se(e){return ce("regex",e,t=>t.query.startsWith("regex:")?{...t,query:t.query.slice(6),regex:!0}:void 0)}l(se,"createRegexResolver");function le(){return{id:"files",async tryResolve(e,t){if(!e.query.startsWith("files:"))return{kind:"not-handled"};let r=e.query.slice(6).trim(),n=await K(r,e,t.cwd,t.signal);return{kind:"resolved",payload:{query:r,...n}}},format(e){let t=e;return{content:[{type:"text",text:[t.complete?`${String(t.files.length)} files`:`${String(t.files.length)}+ files (limit reached)`,...t.files].join(`
4
+ `)}],details:{query:t.query,files:t.files,complete:t.complete}}}}}l(le,"createFileResolver");function ce(e,t,r){return{id:e,async tryResolve(n,a){let o=r(n);if(o===void 0)return{kind:"not-handled"};let i=await z(o,a.cwd,a.signal);return{kind:"resolved",payload:{request:{...n,query:i.query},...i,recipe:{...o,originalQuery:n.query}}}},async format(n,a){let o=n;if(o.matches.length===0)return{content:[{type:"text",text:[...o.notices,"No matches found."].join(`
5
+ `)}],details:A(o.request.query,[],o.complete,a.cwd)};let i=await t.register(o.request.query,o.matches,o.complete,a.cwd,a.signal,o.recipe);return{content:[{type:"text",text:[...o.notices,Fe(i,a.cwd)].join(`
6
+ `)}],details:A(i.query,i.matches,i.complete,a.cwd,i.id)}},renderResult:ne}}l(ce,"createMatchResolver");function Fe(e,t){let r=new Set(e.matches.map(s=>s.source)).size,n=e.matches.length,a=e.complete?`SEARCH#${e.id}:all:line / SEARCH#${e.id}:all:match \u2014 ${String(n)} ${D(n,"match","matches")} in ${String(r)} ${D(r,"file","files")}`:`${String(n)}+ matches in ${String(r)} ${D(r,"file","files")} (limit reached; no all anchors were registered)`,o,i=["Anchors: SEARCH#HASH:N:line (line), SEARCH#HASH:N:match (exact match), SEARCH#HASH:all:line (each unique containing line), SEARCH#HASH:all:match (every exact match)",a];for(let[s,c]of e.matches.entries()){o!==void 0&&o!==c.source&&i.push("");let u=Ie(c.source,t);i.push(`${u}:${String(c.lineNumber)}:${String(c.startColumn+1)}-${String(c.endColumn+1)} SEARCH#${e.id}:${String(s+1)}:line SEARCH#${e.id}:${String(s+1)}:match`,` ${He(c)}`),o=c.source}return e.complete||i.push("","Increase limit and search again before applying a complete replacement."),i.join(`
7
+ `)}l(Fe,"formatSearchSession");function He(e){let r=Math.max(0,e.startColumn-64),n=Math.min(e.lineText.length,e.endColumn+64);return`${r>0?"\u2026":""}${e.lineText.slice(r,e.startColumn)}\u27E6${e.lineText.slice(e.startColumn,e.endColumn)}\u27E7${e.lineText.slice(e.endColumn,n)}${n<e.lineText.length?"\u2026":""}`}l(He,"previewMatch");function Ie(e,t){let r=ae.relative(t,e);return r.length>0&&!r.startsWith("..")&&!ae.isAbsolute(r)?r:e}l(Ie,"displaySource");function D(e,t,r){return e===1?t:r}l(D,"plural");async function qe(e){let t=new J;e.on("tool_result",async(r,n)=>{if(r.toolName!=="replace"||r.isError||typeof r.details!="object"||r.details===null)return;let a="metadata"in r.details?r.details.metadata:void 0,o=a&&typeof a=="object"&&"searchObservations"in a?a.searchObservations:void 0,i=Array.isArray(o)?o:await t.observeAfterEdit([r.input.path,r.input.start,r.input.end],n.signal);if(i.length!==0)return{content:[...r.content,{type:"text",text:["Original search observed after editing (not task validation):",...i.map(s=>{let{query:c,fallbacks:u,...h}=s.scope;return[`SEARCH#${s.sessionId}: ${JSON.stringify(s.query)}`,`Scope and options: ${JSON.stringify(h)}`,s.error===void 0?`Matches: ${s.matches}${s.complete===!0?"; complete search.":"+; incomplete search, lower bound only."}`:`Search failed: ${s.error}. Applied edits remain applied.`,...s.notices??[]].join(`
8
8
  `)})].join(`
9
- `)}],details:{...r.details,searchObservations:i}}}),e.on("tool_result",r=>{if(r.toolName!=="search"||typeof r.details!="object"||r.details===null)return;let n=r.details;if(x(n.payload))return{details:{...n,payload:Z(n.payload,r.content.flatMap(i=>i.type==="text"?[i.text]:[]).join(`
10
- `))}}}),await Promise.all([H(e,Q),j(e,{protocol:_,apiVersion:q,id:"local",setup(r){r.addResolver({resolver:se(t),priority:-10}),r.addResolver({resolver:le(),priority:-10}),r.addResolver({resolver:ae(t),fallback:!0}),r.describe(["Local queries try literal terms first, then unquoted terms as regex when no literal results exist, then separate words for ordinary multi-word queries. Quoted terms stay literal. Boolean conditions stay intact across fallback. Uppercase AND/OR, infix NOT, ||, and space-separated | are Boolean operators; unspaced | and regex groups/classes belong to regex terms. Parentheses containing Boolean operators group Boolean conditions. regex:<pattern> forces regex-only matching; files:<pattern> searches file paths: glob patterns use *, **, ?, character classes and braces; other queries use case-insensitive subsequence matching. Slash-containing globs match cwd-relative paths; basename globs match at any depth.","The result says when a query was broadened. Empty or unknown prefixes are searched as plain text. A recognized prefixed query returns its own results or error; it does not silently become a text search.","SEARCH#HASH:N:line selects one containing line; :match selects its exact match. :all:line selects all unique containing lines and :all:match selects all matches. Read returns containing lines for both forms. A SEARCH resource can be used as a read path or mutation path/anchor; omit the file path for an all-selection spanning files.","Use SEARCH references exactly as returned to select the matching content. A single-result reference becomes stale when its file changes; obtain a fresh result before using it again. An :all reference refreshes the original query when a selected file changes. Limited or incomplete searches do not provide :all selections."].join(`
11
- `))}}),V(e,{protocol:B,apiVersion:W,id:"search-anchors",setup(r){r.addAnchorResolver({resolver:t.anchorResolver(),resources:t.resourceResolver(),kind:G,type:"auxiliary",describeInPrompt:!1})}})])}s(_e,"registerTextSearch");export{de as createSearchSessionId,_e as default};
9
+ `)}],details:{...r.details,searchObservations:i}}}),e.on("tool_result",r=>{if(r.toolName!=="search"||typeof r.details!="object"||r.details===null)return;let n=r.details;if(x(n.payload))return{details:{...n,payload:Z(n.payload,r.content.flatMap(a=>a.type==="text"?[a.text]:[]).join(`
10
+ `))}}}),await Promise.all([I(e,Q),j(e,{protocol:q,apiVersion:_,id:"local",setup(r){r.addSelectionProvider((n,a)=>t.register(n.request.query,n.matches,n.complete,a.cwd,a.signal,{...n.request,regex:!1},n.refresh)),r.addResolver({resolver:se(t),priority:-10}),r.addResolver({resolver:le(),priority:-10}),r.addResolver({resolver:ie(t),fallback:!0}),r.describe(["Local queries try literal terms first, then unquoted terms as regex when no literal results exist, then separate words for ordinary multi-word queries. Quoted terms stay literal. Boolean conditions stay intact across fallback. Uppercase AND/OR, infix NOT, ||, and space-separated | are Boolean operators; unspaced | and regex groups/classes belong to regex terms. Parentheses containing Boolean operators group Boolean conditions. regex:<pattern> forces regex-only matching; files:<pattern> searches file paths: glob patterns use *, **, ?, character classes and braces; other queries use case-insensitive subsequence matching. Slash-containing globs match cwd-relative paths; basename globs match at any depth.","The result says when a query was broadened. Empty or unknown prefixes are searched as plain text. A recognized prefixed query returns its own results or error; it does not silently become a text search.","SEARCH#HASH:N:line selects one containing line; :match selects its exact match. :all:line selects all unique containing lines and :all:match selects all matches. Read returns containing lines for both forms. A SEARCH resource can be used as a read path or mutation path/anchor; omit the file path for an all-selection spanning files.","Use SEARCH references exactly as returned to select the matching content. A single-result reference becomes stale when its file changes; obtain a fresh result before using it again. An :all reference refreshes the original query when a selected file changes. Limited or incomplete searches do not provide :all selections."].join(`
11
+ `))}}),V(e,{protocol:B,apiVersion:W,id:"search-anchors",setup(r){r.tool("replace").addHandler({stage:"text-post-edit",async handler(n){if(!n.result||typeof n.result!="object"||!("kind"in n.result)||n.result.kind!=="completed"||!n.input||typeof n.input!="object")return n;let a=n.input,o=await t.observeAfterEdit([a.path,a.start,a.end],n.signal);return o.length===0?n:{...n,metadata:{...n.metadata,searchObservations:o}}}}),r.addAnchorResolver({resolver:t.anchorResolver(),resources:t.resourceResolver(),kind:G,type:"auxiliary",describeInPrompt:!1})}})])}l(qe,"registerTextSearch");export{de as createSearchSessionId,qe as default};
package/dist/entry-47.js CHANGED
@@ -1 +1 @@
1
- import{d as a,e as b,f as c,g as d}from"./chunk-JJVXUL5U.js";import"./chunk-LQYZG62K.js";import"./chunk-RAZOACDD.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{d as SearchSessionStore,c as allocateSearchSessionId,a as createSearchSessionId,b as createSearchSessionIdentity};
1
+ import{d as a,e as b,f as c,g as d}from"./chunk-NMFQGKPE.js";import"./chunk-GUTQ3PWL.js";import"./chunk-5VSE5X5R.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{d as SearchSessionStore,c as allocateSearchSessionId,a as createSearchSessionId,b as createSearchSessionIdentity};
package/dist/entry-48.js CHANGED
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u}from"./chunk-RAZOACDD.js";import"./chunk-EI7MMDWY.js";export{a as TextAnchor,b as attachTextAnchorRenderer,p as createTextContentConverter,m as createTextDocument,c as getTextAnchorRenderer,i as getTextSourceLine,g as isTextAnchorRecoveryOutcome,f as isTextAnchorResolutionAttempt,e as isTextAnchorResolver,k as isTextLinePresenter,l as isTextPresenterRegistration,s as isTextTargetResolutionAttempt,q as isTextualMediaType,o as renderPresentedTextDocument,h as renderPresentedTextRows,d as renderTextAnchor,n as renderTextDocument,u as restoreText,t as storeText,r as textFromAgentContent,j as withTextSourceLine};
1
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u}from"./chunk-5VSE5X5R.js";import"./chunk-EI7MMDWY.js";export{a as TextAnchor,b as attachTextAnchorRenderer,p as createTextContentConverter,m as createTextDocument,c as getTextAnchorRenderer,i as getTextSourceLine,g as isTextAnchorRecoveryOutcome,f as isTextAnchorResolutionAttempt,e as isTextAnchorResolver,k as isTextLinePresenter,l as isTextPresenterRegistration,s as isTextTargetResolutionAttempt,q as isTextualMediaType,o as renderPresentedTextDocument,h as renderPresentedTextRows,d as renderTextAnchor,n as renderTextDocument,u as restoreText,t as storeText,r as textFromAgentContent,j as withTextSourceLine};
package/dist/entry-49.js CHANGED
@@ -1 +1 @@
1
- import{a as d}from"./chunk-WNMGUALD.js";import{a as s,b as l,c}from"./chunk-THSCUT2L.js";import"./chunk-S3ZPXWX7.js";import{a as i}from"./chunk-RAZOACDD.js";import{a as t}from"./chunk-EI7MMDWY.js";var o=class extends i{static{t(this,"ConstantTextAnchor")}constructor(n,r){super(n,r)}};function p(){return{id:"file-position",description:"`begin` and `end` select the first and last existing lines.",renderFull(e){return e},renderCompact(e){return e==="begin"?"file start":"file end"},tryResolve(e,n){return Promise.resolve(a(e,n))}}}t(p,"createConstantTextAnchorResolver");function a(e,n){return e!=="begin"&&e!=="end"?{kind:"not-handled"}:n.lines.length===0?{kind:"failed",error:new Error(`${e} cannot resolve in an empty file`)}:{kind:"resolved",anchor:new o(e,e==="begin"?1:n.lines.length)}}t(a,"resolveConstantAnchor");async function T(e){await d(e,{protocol:s,apiVersion:l,id:"text-anchor-constant",setup(r){r.addAnchorResolver({resolver:p(),kind:c,type:"constant"})}})}t(T,"registerConstantTextAnchors");export{T as default};
1
+ import{a as d}from"./chunk-CEKXBS55.js";import{a as s,b as l,c}from"./chunk-LRYE2WCN.js";import"./chunk-S3ZPXWX7.js";import{a as i}from"./chunk-5VSE5X5R.js";import{a as t}from"./chunk-EI7MMDWY.js";var o=class extends i{static{t(this,"ConstantTextAnchor")}constructor(n,r){super(n,r)}};function p(){return{id:"file-position",description:"`begin` and `end` select the first and last existing lines.",renderFull(e){return e},renderCompact(e){return e==="begin"?"file start":"file end"},tryResolve(e,n){return Promise.resolve(a(e,n))}}}t(p,"createConstantTextAnchorResolver");function a(e,n){return e!=="begin"&&e!=="end"?{kind:"not-handled"}:n.lines.length===0?{kind:"failed",error:new Error(`${e} cannot resolve in an empty file`)}:{kind:"resolved",anchor:new o(e,e==="begin"?1:n.lines.length)}}t(a,"resolveConstantAnchor");async function T(e){await d(e,{protocol:s,apiVersion:l,id:"text-anchor-constant",setup(r){r.addAnchorResolver({resolver:p(),kind:c,type:"constant"})}})}t(T,"registerConstantTextAnchors");export{T as default};
package/dist/entry-50.js CHANGED
@@ -1 +1 @@
1
- import{a,b,c}from"./chunk-ZXN3TWWW.js";import"./chunk-LQYZG62K.js";import"./chunk-RAZOACDD.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as createExactTextAnchorResolver,c as findExactTextMatches,b as resolveExactTextAnchor};
1
+ import{a,b,c}from"./chunk-ZM4L5AGN.js";import"./chunk-GUTQ3PWL.js";import"./chunk-5VSE5X5R.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as createExactTextAnchorResolver,c as findExactTextMatches,b as resolveExactTextAnchor};
package/dist/entry-51.js CHANGED
@@ -1 +1 @@
1
- import{a as m}from"./chunk-ZXN3TWWW.js";import"./chunk-LQYZG62K.js";import{a as f}from"./chunk-WNMGUALD.js";import{a as c,b as u,c as s}from"./chunk-THSCUT2L.js";import"./chunk-S3ZPXWX7.js";import"./chunk-RAZOACDD.js";import"./chunk-ZC65Z3CK.js";import{a as i}from"./chunk-EI7MMDWY.js";import{readFileSync as z}from"node:fs";import w from"node:path";function x(e){let n=b(e.settings,"recovery.exactText");n!==void 0&&p(n,["fuzzyEnabled","threshold","exactCandidateLimit","fuzzyCandidateLimit","maxFileSizeMiB","maxQuerySizeKiB","seedLimit","blockLineVariance"],"recovery.exactText");let t=i(o=>n===void 0?void 0:n[o],"value");return{fuzzyEnabled:g(t("fuzzyEnabled"),"fuzzyEnabled")??!0,threshold:d(t("threshold"),"threshold",0,1)??.8,exactCandidateLimit:a(t("exactCandidateLimit"),"exactCandidateLimit",1,100)??20,fuzzyCandidateLimit:a(t("fuzzyCandidateLimit"),"fuzzyCandidateLimit",1,20)??5,maxFileSizeMiB:d(t("maxFileSizeMiB"),"maxFileSizeMiB",.01,100)??20,maxQuerySizeKiB:d(t("maxQuerySizeKiB"),"maxQuerySizeKiB",.01,4096)??1024,seedLimit:a(t("seedLimit"),"seedLimit",1,10)??3,blockLineVariance:a(t("blockLineVariance"),"blockLineVariance",0,10)??2,contextLines:e.contextLines,timeoutMs:e.timeoutMs}}i(x,"parseExactTextRecoveryConfig");function l(e,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError(`${n} must be an object`);return Object.fromEntries(Object.entries(e))}i(l,"objectRecord");function b(e,n){return e===void 0?void 0:l(e,n)}i(b,"optionalObject");function p(e,n,t){let o=new Set(n),r=Object.keys(e).find(y=>!o.has(y));if(r!==void 0)throw new TypeError(`${t} contains unknown key ${r}`)}i(p,"assertKeys");function g(e,n){if(e===void 0||typeof e=="boolean")return e;throw new TypeError(`${n} must be a boolean`)}i(g,"optionalBoolean");function d(e,n,t,o){if(e!==void 0){if(typeof e!="number"||!Number.isFinite(e)||e<t||e>o)throw new RangeError(`${n} must be between ${t} and ${o}`);return e}}i(d,"optionalNumber");function a(e,n,t,o){let r=d(e,n,t,o);if(r!==void 0&&!Number.isInteger(r))throw new TypeError(`${n} must be an integer`);return r}i(a,"optionalInteger");async function E(e){await f(e,{protocol:c,apiVersion:u,id:"text-anchor-exact",setup(t){t.addAnchorResolver({resolver:m(x(t.recoveryConfig("exactText"))),kind:s,type:"auxiliary",describeInPrompt:!1,priority:1e4})}})}i(E,"registerExactTextAnchor");export{E as default};
1
+ import{a as m}from"./chunk-ZM4L5AGN.js";import"./chunk-GUTQ3PWL.js";import{a as f}from"./chunk-CEKXBS55.js";import{a as c,b as u,c as s}from"./chunk-LRYE2WCN.js";import"./chunk-S3ZPXWX7.js";import"./chunk-5VSE5X5R.js";import"./chunk-ZC65Z3CK.js";import{a as i}from"./chunk-EI7MMDWY.js";import{readFileSync as z}from"node:fs";import w from"node:path";function x(e){let n=b(e.settings,"recovery.exactText");n!==void 0&&p(n,["fuzzyEnabled","threshold","exactCandidateLimit","fuzzyCandidateLimit","maxFileSizeMiB","maxQuerySizeKiB","seedLimit","blockLineVariance"],"recovery.exactText");let t=i(o=>n===void 0?void 0:n[o],"value");return{fuzzyEnabled:g(t("fuzzyEnabled"),"fuzzyEnabled")??!0,threshold:d(t("threshold"),"threshold",0,1)??.8,exactCandidateLimit:a(t("exactCandidateLimit"),"exactCandidateLimit",1,100)??20,fuzzyCandidateLimit:a(t("fuzzyCandidateLimit"),"fuzzyCandidateLimit",1,20)??5,maxFileSizeMiB:d(t("maxFileSizeMiB"),"maxFileSizeMiB",.01,100)??20,maxQuerySizeKiB:d(t("maxQuerySizeKiB"),"maxQuerySizeKiB",.01,4096)??1024,seedLimit:a(t("seedLimit"),"seedLimit",1,10)??3,blockLineVariance:a(t("blockLineVariance"),"blockLineVariance",0,10)??2,contextLines:e.contextLines,timeoutMs:e.timeoutMs}}i(x,"parseExactTextRecoveryConfig");function l(e,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError(`${n} must be an object`);return Object.fromEntries(Object.entries(e))}i(l,"objectRecord");function b(e,n){return e===void 0?void 0:l(e,n)}i(b,"optionalObject");function p(e,n,t){let o=new Set(n),r=Object.keys(e).find(y=>!o.has(y));if(r!==void 0)throw new TypeError(`${t} contains unknown key ${r}`)}i(p,"assertKeys");function g(e,n){if(e===void 0||typeof e=="boolean")return e;throw new TypeError(`${n} must be a boolean`)}i(g,"optionalBoolean");function d(e,n,t,o){if(e!==void 0){if(typeof e!="number"||!Number.isFinite(e)||e<t||e>o)throw new RangeError(`${n} must be between ${t} and ${o}`);return e}}i(d,"optionalNumber");function a(e,n,t,o){let r=d(e,n,t,o);if(r!==void 0&&!Number.isInteger(r))throw new TypeError(`${n} must be an integer`);return r}i(a,"optionalInteger");async function E(e){await f(e,{protocol:c,apiVersion:u,id:"text-anchor-exact",setup(t){t.addAnchorResolver({resolver:m(x(t.recoveryConfig("exactText"))),kind:s,type:"auxiliary",describeInPrompt:!1,priority:1e4})}})}i(E,"registerExactTextAnchor");export{E as default};
package/dist/entry-52.js CHANGED
@@ -1 +1 @@
1
- import{a,b,c,d,e}from"./chunk-P6T3Q7LB.js";import"./chunk-RAZOACDD.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{b as createLineHashAnchor,e as createLineHashAnchorResolver,c as formatLineHashAnchor,a as hashLine,d as renderLineHashLines};
1
+ import{a,b,c,d,e}from"./chunk-QDST6VIU.js";import"./chunk-5VSE5X5R.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{b as createLineHashAnchor,e as createLineHashAnchorResolver,c as formatLineHashAnchor,a as hashLine,d as renderLineHashLines};
package/dist/entry-53.js CHANGED
@@ -1 +1 @@
1
- import{b as x,e as T}from"./chunk-P6T3Q7LB.js";import{a as l}from"./chunk-ORAPGW7W.js";import{a as d,b as m}from"./chunk-JASLOB2X.js";import{a as P}from"./chunk-WNMGUALD.js";import{a as u,b as h,c as f}from"./chunk-THSCUT2L.js";import"./chunk-S3ZPXWX7.js";import{i as p}from"./chunk-RAZOACDD.js";import"./chunk-ZC65Z3CK.js";import{a as s}from"./chunk-EI7MMDWY.js";function g(){return{id:"line-hash",present(n,o){let i=n.lines.map(e=>{let t=o.resolvedBy==="filesystem"?{lineNumber:e.lineNumber,content:e.content}:p(e);return t===void 0?void 0:{anchor:x(t.lineNumber,t.content),lineNumber:t.lineNumber}}),a=Math.max(0,...i.map(e=>e?.anchor.value.length??0)),r=Math.max(0,...i.map(e=>String(e?.lineNumber??"").length)),E=n.lines.map((e,t)=>{let c=i[t];return c===void 0?e:{...e,presentation:{...e.presentation,prefix:`${c.anchor.value.padStart(a)}|${e.presentation?.prefix??""}`,compactPrefix:e.presentation?.compactPrefix??`${String(c.lineNumber).padStart(r)} \u2502 `}}});return{...n,lines:E}}}}s(g,"createLineHashPresenter");async function R(n){let o=g(),i={protocol:d,apiVersion:m,id:"text-anchor-line-hash",setup(r){r.addView({view:"anchors",presenter:o}),r.describe('views: ["anchors"] \u2014 LINE#HASH references for editing individual source lines.')}},a={protocol:u,apiVersion:h,id:"text-anchor-line-hash",setup(r){r.addAnchorResolver({resolver:T(),kind:f,type:"major"}),r.addTextPresenter({presenter:o})}};await Promise.all([l(n,i),P(n,a)])}s(R,"registerLineHashTextAnchor");export{R as default};
1
+ import{b as x,e as T}from"./chunk-QDST6VIU.js";import{a as l}from"./chunk-72EEL2DW.js";import{a as d,b as m}from"./chunk-KAB3AYA2.js";import{a as P}from"./chunk-CEKXBS55.js";import{a as u,b as h,c as f}from"./chunk-LRYE2WCN.js";import"./chunk-S3ZPXWX7.js";import{i as p}from"./chunk-5VSE5X5R.js";import"./chunk-ZC65Z3CK.js";import{a}from"./chunk-EI7MMDWY.js";function g(){return{id:"line-hash",present(n,o){let i=n.lines.map(e=>{let t=o.resolvedBy==="filesystem"?{lineNumber:e.lineNumber,content:e.content}:p(e);return t===void 0?void 0:{anchor:x(t.lineNumber,t.content),lineNumber:t.lineNumber}}),c=Math.max(0,...i.map(e=>e?.anchor.value.length??0)),r=Math.max(0,...i.map(e=>String(e?.lineNumber??"").length)),E=n.lines.map((e,t)=>{let s=i[t];return s===void 0?e:{...e,anchors:[...new Set([...e.anchors??[],s.anchor.value])],presentation:{...e.presentation,prefix:`${s.anchor.value.padStart(c)}|${e.presentation?.prefix??""}`,compactPrefix:e.presentation?.compactPrefix??`${String(s.lineNumber).padStart(r)} \u2502 `}}});return{...n,lines:E}}}}a(g,"createLineHashPresenter");async function R(n){let o=g(),i={protocol:d,apiVersion:m,id:"text-anchor-line-hash",setup(r){r.addView({view:"anchors",presenter:o}),r.describe('views: ["anchors"] \u2014 LINE#HASH references for editing individual source lines.')}},c={protocol:u,apiVersion:h,id:"text-anchor-line-hash",setup(r){r.addAnchorResolver({resolver:T(),kind:f,type:"major"}),r.addTextPresenter({presenter:o})}};await Promise.all([l(n,i),P(n,c)])}a(R,"registerLineHashTextAnchor");export{R as default};
package/dist/entry-54.js CHANGED
@@ -0,0 +1 @@
1
+ import"./chunk-6EYWFBNG.js";import{j as a,l as b}from"./chunk-VZJIZXSH.js";import"./chunk-ITSNK5YG.js";import"./chunk-5MSNYFDE.js";import"./chunk-NNCZYO4Q.js";import"./chunk-RHV5STR3.js";import"./chunk-YHUTTZC6.js";import"./chunk-S3ZPXWX7.js";import"./chunk-5VSE5X5R.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as createApplyCallRenderer,b as createApplyResultRenderer};
package/dist/entry-55.js CHANGED
@@ -1 +0,0 @@
1
- import{a}from"./chunk-WNMGUALD.js";import"./chunk-THSCUT2L.js";import"./chunk-S3ZPXWX7.js";import"./chunk-RAZOACDD.js";import"./chunk-EI7MMDWY.js";export{a as connectTextEditorPlugin};
package/dist/entry-56.js CHANGED
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-CEKXBS55.js";import"./chunk-LRYE2WCN.js";import"./chunk-S3ZPXWX7.js";import"./chunk-5VSE5X5R.js";import"./chunk-EI7MMDWY.js";export{a as connectTextEditorPlugin};
package/dist/entry-57.js CHANGED
@@ -1 +0,0 @@
1
- import{a}from"./chunk-STUZZM5B.js";import"./chunk-EI7MMDWY.js";export{a as isTextEditHandlerRegistration};
package/dist/entry-58.js CHANGED
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k,l,m}from"./chunk-THSCUT2L.js";import"./chunk-S3ZPXWX7.js";import"./chunk-RAZOACDD.js";import"./chunk-EI7MMDWY.js";export{b as TEXT_EDITOR_API_VERSION,e as TEXT_EDITOR_CORE_READY_EVENT,f as TEXT_EDITOR_PLUGIN_REGISTER_EVENT,a as TEXT_EDITOR_PROTOCOL,c as TEXT_POSITION_ANCHOR_KIND,d as TEXT_SEARCH_ANCHOR_KIND,h as isResourceResolverRegistration,i as isTextAnchorResolverRegistration,j as isTextAnchorResourceResolutionAttempt,k as isTextEditorCoreReady,l as isTextEditorPlugin,m as isTextEditorPluginRegistrationRequest,g as isTextEditorToolId};
1
+ import{a}from"./chunk-AADJ2KIB.js";import"./chunk-EI7MMDWY.js";export{a as isTextEditHandlerRegistration};
package/dist/entry-59.js CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-MBUXFKIW.js";import"./chunk-EI7MMDWY.js";export{a as formatStaleAnchorMessage};
1
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m}from"./chunk-LRYE2WCN.js";import"./chunk-S3ZPXWX7.js";import"./chunk-5VSE5X5R.js";import"./chunk-EI7MMDWY.js";export{b as TEXT_EDITOR_API_VERSION,e as TEXT_EDITOR_CORE_READY_EVENT,f as TEXT_EDITOR_PLUGIN_REGISTER_EVENT,a as TEXT_EDITOR_PROTOCOL,c as TEXT_POSITION_ANCHOR_KIND,d as TEXT_SEARCH_ANCHOR_KIND,h as isResourceResolverRegistration,i as isTextAnchorResolverRegistration,j as isTextAnchorResourceResolutionAttempt,k as isTextEditorCoreReady,l as isTextEditorPlugin,m as isTextEditorPluginRegistrationRequest,g as isTextEditorToolId};
package/dist/entry-60.js CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-LQYZG62K.js";import"./chunk-RAZOACDD.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as TextSelectionAnchor};
1
+ import{a}from"./chunk-MBUXFKIW.js";import"./chunk-EI7MMDWY.js";export{a as formatStaleAnchorMessage};
package/dist/entry-61.js CHANGED
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g}from"./chunk-RIGRP3FD.js";import"./chunk-THSCUT2L.js";import"./chunk-S3ZPXWX7.js";import"./chunk-RAZOACDD.js";import"./chunk-EI7MMDWY.js";export{a as TEXT_EDITOR_POST_EDIT_REGISTER_EVENT,g as connectTextEditorPostEditHandler,c as isDiffStatusContribution,b as isFormattingContribution,f as isTextMutationResultContributionData,d as isTextPostEditHandlerRegistration,e as isTextPostEditHandlerRegistrationRequest};
1
+ import{a}from"./chunk-GUTQ3PWL.js";import"./chunk-5VSE5X5R.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as TextSelectionAnchor};
package/dist/entry-62.js CHANGED
@@ -1 +1 @@
1
- import{a,b,d as c}from"./chunk-6ACQQBUY.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{b as FileMutationResult,a as FileRange,c as computeChangedRanges};
1
+ import{a,d as b,f as c,g as d,h as e,i as f,j as g,k as h,l as i}from"./chunk-SSHZEWWV.js";import"./chunk-LRYE2WCN.js";import"./chunk-S3ZPXWX7.js";import"./chunk-5VSE5X5R.js";import"./chunk-EI7MMDWY.js";export{c as TEXT_EDITOR_POST_EDIT_REGISTER_EVENT,a as afterPostEditScope,i as connectTextEditorPostEditHandler,b as hasDeferredPostEdit,e as isDiffStatusContribution,d as isFormattingContribution,h as isTextMutationResultContributionData,f as isTextPostEditHandlerRegistration,g as isTextPostEditHandlerRegistrationRequest};
package/dist/entry-63.js CHANGED
@@ -0,0 +1 @@
1
+ import"./chunk-4U2GUKNJ.js";import{b as a,c as b,d as c}from"./chunk-ITSNK5YG.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{c as FileMutationResult,b as FileRange,a as computeChangedRanges};
package/dist/entry-64.js CHANGED
@@ -1 +0,0 @@
1
- import{a,b,c}from"./chunk-OVUYPHDE.js";import"./chunk-EI7MMDWY.js";export{b as assertTextMutationToolRegistration,a as isMutationAnchorValue,c as mutationSource};
package/dist/entry-65.js CHANGED
@@ -0,0 +1 @@
1
+ import{a,b,c}from"./chunk-OVUYPHDE.js";import"./chunk-EI7MMDWY.js";export{b as assertTextMutationToolRegistration,a as isMutationAnchorValue,c as mutationSource};
package/dist/entry-66.js CHANGED
@@ -1 +0,0 @@
1
- import{a,b,c}from"./chunk-YPHXLAQF.js";import"./chunk-EI7MMDWY.js";export{c as clearLastResolvedResource,b as getLastResolvedResource,a as rememberLastResolvedResource};
package/dist/entry-67.js CHANGED
@@ -1 +1 @@
1
- import{a as b,b as c}from"./chunk-4LUW26BX.js";import{c as a}from"./chunk-GIRAEVUJ.js";import"./chunk-YHUTTZC6.js";import"./chunk-EI7MMDWY.js";export{a as getToolCallInterception,c as registerToolCallAnnotationSink,b as registerToolCallInterceptor};
1
+ import{a,b,c}from"./chunk-YHADTHQM.js";import"./chunk-EI7MMDWY.js";export{c as clearLastResolvedResource,b as getLastResolvedResource,a as rememberLastResolvedResource};
package/dist/entry-68.js CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-VCCMVQXU.js";import"./chunk-EI7MMDWY.js";export{a as isTextEditorToolRendererRegistration};
1
+ import{a as b,b as c}from"./chunk-4LUW26BX.js";import{c as a}from"./chunk-GIRAEVUJ.js";import"./chunk-YHUTTZC6.js";import"./chunk-EI7MMDWY.js";export{a as getToolCallInterception,c as registerToolCallAnnotationSink,b as registerToolCallInterceptor};