pi-agent-ide 0.9.4 → 0.9.6

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 (776) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +1 -1
  3. package/dist/{chunk-ZXO4D5UB.js → chunk-2AANEKFS.js} +1 -1
  4. package/dist/{chunk-BU7IZLKB.js → chunk-2DSY4U73.js} +1 -1
  5. package/dist/chunk-2YO6RVX4.js +1 -0
  6. package/dist/{chunk-WES2E4VR.js → chunk-33U3RUM3.js} +1 -1
  7. package/dist/{chunk-CJPS4GXD.js → chunk-34IYWKY5.js} +1 -1
  8. package/dist/{chunk-2TTSJOLO.js → chunk-4CSNQX54.js} +1 -1
  9. package/dist/{chunk-DAZQSXUW.js → chunk-53IV6EKV.js} +1 -1
  10. package/dist/{chunk-7PVDTMEM.js → chunk-5AROEOJB.js} +1 -1
  11. package/dist/{chunk-IG5DXVDJ.js → chunk-5D4C225L.js} +1 -1
  12. package/dist/{chunk-GHO6TCPJ.js → chunk-5DN2XBVI.js} +1 -1
  13. package/dist/{chunk-FHRHYY4M.js → chunk-5W6QQZFI.js} +1 -1
  14. package/dist/{chunk-5PC5INOL.js → chunk-6W4OJLCJ.js} +1 -1
  15. package/dist/chunk-6ZYCTWQE.js +1 -0
  16. package/dist/{chunk-B25LXXNV.js → chunk-72FL5FHZ.js} +1 -1
  17. package/dist/{chunk-BB4A5UI3.js → chunk-7JWZPJI5.js} +1 -1
  18. package/dist/{chunk-T3Z4KXOX.js → chunk-AMSNDWBT.js} +1 -1
  19. package/dist/{chunk-DFXXT6MJ.js → chunk-APWMLLSE.js} +6 -6
  20. package/dist/{chunk-NA2NEU4V.js → chunk-B5UJCNQU.js} +1 -1
  21. package/dist/chunk-BMSAVDRD.js +13 -0
  22. package/dist/{chunk-MPNE25CY.js → chunk-BRJIXNFU.js} +1 -1
  23. package/dist/chunk-C2GZLLSP.js +5 -0
  24. package/dist/{chunk-XCPIIDFS.js → chunk-DHOIQZUF.js} +1 -1
  25. package/dist/chunk-ECSMTGVM.js +6 -0
  26. package/dist/{chunk-DEP55R35.js → chunk-EHFWODRT.js} +1 -1
  27. package/dist/{chunk-6WCHBHFW.js → chunk-EWTVVPUA.js} +1 -1
  28. package/dist/{chunk-H3GEEOOL.js → chunk-FBR7ZLLN.js} +1 -1
  29. package/dist/{chunk-UD3DMY3Q.js → chunk-FGN2ZMEN.js} +1 -1
  30. package/dist/{chunk-MKDOT76B.js → chunk-FJSYWOE6.js} +1 -1
  31. package/dist/{chunk-LF325WYO.js → chunk-FTECKRK6.js} +1 -1
  32. package/dist/chunk-GRZTKMXQ.js +1 -0
  33. package/dist/chunk-H6FEBUAP.js +1 -0
  34. package/dist/{chunk-FYOU4RBH.js → chunk-HFCHOFLV.js} +1 -1
  35. package/dist/chunk-HFF4GY7R.js +3 -0
  36. package/dist/{chunk-QJ6V5IAY.js → chunk-HJXSEPO7.js} +14 -12
  37. package/dist/{chunk-SRFWT562.js → chunk-HSEDKYH4.js} +1 -1
  38. package/dist/{chunk-6P7LTQZT.js → chunk-II7AOJNH.js} +1 -1
  39. package/dist/chunk-J6CDIH3S.js +84 -0
  40. package/dist/{chunk-USG6WHAT.js → chunk-JHWLRL4U.js} +1 -1
  41. package/dist/{chunk-35LZOKEW.js → chunk-JMQ67UNK.js} +1 -1
  42. package/dist/{chunk-7OUML24Z.js → chunk-JRIP33PC.js} +1 -1
  43. package/dist/chunk-JXULBI4S.js +2 -0
  44. package/dist/chunk-JYITLCXC.js +1 -0
  45. package/dist/{chunk-4IWEKRSP.js → chunk-KJAR2WDO.js} +1 -1
  46. package/dist/{chunk-GS5ZRTUG.js → chunk-KQV2ZXLP.js} +1 -1
  47. package/dist/{chunk-AMIIOWFL.js → chunk-KX7MG72M.js} +1 -1
  48. package/dist/{chunk-HGCJDIRR.js → chunk-LIGOOMJS.js} +5 -5
  49. package/dist/{chunk-OMNKD7WW.js → chunk-LY2UANKU.js} +3 -3
  50. package/dist/chunk-M7P7V4WI.js +25 -0
  51. package/dist/chunk-N2NEFXHB.js +13 -0
  52. package/dist/{chunk-2TZDG2JH.js → chunk-NF74ITWT.js} +2 -2
  53. package/dist/{chunk-AP2BOC24.js → chunk-NQYUIQRH.js} +1 -1
  54. package/dist/{chunk-7C73WVPB.js → chunk-OCU6NW5Y.js} +1 -1
  55. package/dist/chunk-OIEA4QWF.js +4 -0
  56. package/dist/{chunk-FXPY3V4L.js → chunk-ON5HDFNL.js} +1 -1
  57. package/dist/{chunk-U2N73BUY.js → chunk-P43GGKUC.js} +5 -5
  58. package/dist/{chunk-5BGWNYQS.js → chunk-P7FUD4WY.js} +1 -1
  59. package/dist/{chunk-VMLPXSMK.js → chunk-PPCWY4BB.js} +1 -1
  60. package/dist/{chunk-YPYROPQF.js → chunk-QGXZ4RWX.js} +1 -1
  61. package/dist/chunk-S3T5NOSL.js +1 -0
  62. package/dist/chunk-S7E2D5K7.js +5 -0
  63. package/dist/{chunk-DDH3FP4G.js → chunk-SIYPD5MM.js} +3 -3
  64. package/dist/{chunk-6A3ORNW3.js → chunk-T5ACAOKJ.js} +3 -3
  65. package/dist/chunk-TILMPAF2.js +1 -0
  66. package/dist/{chunk-RIJRPAL2.js → chunk-TSNY2FSU.js} +1 -1
  67. package/dist/{chunk-UI4KSKS3.js → chunk-TWJINFQB.js} +4 -4
  68. package/dist/chunk-TWQ6ACOI.js +1 -0
  69. package/dist/chunk-UDVVKVG4.js +1 -0
  70. package/dist/{chunk-WQIMM4SU.js → chunk-V2D5MLGE.js} +1 -1
  71. package/dist/{chunk-PQWANILR.js → chunk-VDSSAP6Y.js} +1 -1
  72. package/dist/{chunk-AVJVTF5H.js → chunk-VHYJTAXX.js} +1 -1
  73. package/dist/{chunk-MJFY4RGT.js → chunk-WCSWQDJ2.js} +1 -1
  74. package/dist/{chunk-JWSJCEIB.js → chunk-WQTF6Q2X.js} +1 -1
  75. package/dist/chunk-YFPU2LRR.js +23 -0
  76. package/dist/{chunk-KWJD7FBS.js → chunk-YLEERRX3.js} +14 -14
  77. package/dist/chunk-YNOR4LIE.js +1 -0
  78. package/dist/{chunk-WEE3NM6L.js → chunk-YOJHCARZ.js} +1 -1
  79. package/dist/chunk-YPTDPMK5.js +1 -0
  80. package/dist/{chunk-GXL4NMHR.js → chunk-YZTVC7ME.js} +1 -1
  81. package/dist/entry-0.js +1 -1
  82. package/dist/entry-10.js +1 -1
  83. package/dist/entry-11.js +1 -1
  84. package/dist/entry-12.js +1 -1
  85. package/dist/entry-14.js +1 -1
  86. package/dist/entry-15.js +1 -1
  87. package/dist/entry-17.js +1 -1
  88. package/dist/entry-19.js +1 -1
  89. package/dist/entry-2.js +1 -1
  90. package/dist/entry-20.js +1 -1
  91. package/dist/entry-21.js +1 -1
  92. package/dist/entry-22.js +1 -1
  93. package/dist/entry-25.js +1 -1
  94. package/dist/entry-31.js +2 -2
  95. package/dist/entry-32.js +1 -1
  96. package/dist/entry-33.js +1 -1
  97. package/dist/entry-34.js +1 -1
  98. package/dist/entry-35.js +1 -1
  99. package/dist/entry-36.js +1 -1
  100. package/dist/entry-37.js +1 -1
  101. package/dist/entry-38.js +13 -13
  102. package/dist/entry-39.js +1 -1
  103. package/dist/entry-4.js +1 -1
  104. package/dist/entry-40.js +1 -1
  105. package/dist/entry-41.js +1 -1
  106. package/dist/entry-42.js +1 -1
  107. package/dist/entry-43.js +1 -1
  108. package/dist/entry-44.js +1 -1
  109. package/dist/entry-48.js +1 -1
  110. package/dist/entry-49.js +1 -1
  111. package/dist/entry-50.js +1 -1
  112. package/dist/entry-51.js +1 -1
  113. package/dist/entry-52.js +1 -1
  114. package/dist/entry-53.js +1 -1
  115. package/dist/entry-56.js +1 -1
  116. package/dist/entry-57.js +1 -1
  117. package/dist/entry-58.js +1 -1
  118. package/dist/entry-59.js +1 -1
  119. package/dist/entry-60.js +1 -1
  120. package/dist/entry-61.js +1 -1
  121. package/dist/entry-62.js +1 -1
  122. package/dist/entry-63.js +1 -1
  123. package/dist/entry-64.js +1 -1
  124. package/dist/entry-65.js +1 -1
  125. package/dist/entry-66.js +1 -1
  126. package/dist/entry-67.js +1 -1
  127. package/dist/entry-69.js +1 -1
  128. package/dist/entry-72.js +1 -1
  129. package/dist/entry-74.js +1 -1
  130. package/dist/entry-75.js +1 -1
  131. package/dist/entry-77.js +1 -1
  132. package/dist/entry-79.js +1 -1
  133. package/dist/entry-8.js +1 -1
  134. package/dist/entry-82.js +1 -1
  135. package/dist/entry-84.js +1 -1
  136. package/dist/entry-85.js +1 -1
  137. package/dist/entry-86.js +1 -1
  138. package/dist/entry-87.js +1 -1
  139. package/dist/entry-90.js +1 -1
  140. package/dist/entry-91.js +1 -1
  141. package/dist/entry-92.js +1 -1
  142. package/dist/entry-93.js +1 -1
  143. package/dist/entry-94.js +1 -1
  144. package/dist/pi-agent-ide.js +11 -11
  145. package/docs/development.md +2 -0
  146. package/docs/generated/tool-catalog/python.md +1 -0
  147. package/docs/tools.md +2 -0
  148. package/node_modules/pi-agent-doctor/package.json +1 -1
  149. package/node_modules/pi-agent-doctor/src/connect-plugin.ts +2 -2
  150. package/node_modules/pi-agent-doctor/src/evidence.ts +1 -1
  151. package/node_modules/pi-agent-doctor/src/fixtures/executable-probe.ts +2 -2
  152. package/node_modules/pi-agent-doctor/src/plugin-protocol.ts +4 -4
  153. package/node_modules/pi-agent-doctor/src/project-probes.ts +2 -2
  154. package/node_modules/pi-agent-doctor/src/workspace.ts +2 -2
  155. package/node_modules/pi-agent-documentation/package.json +1 -1
  156. package/node_modules/pi-agent-filesystem/index.ts +2 -2
  157. package/node_modules/pi-agent-filesystem/package.json +7 -7
  158. package/node_modules/pi-agent-filesystem/src/file-write-lock.ts +70 -0
  159. package/node_modules/pi-agent-filesystem/src/replace-file.ts +50 -0
  160. package/node_modules/pi-agent-filesystem/src/resolver.ts +28 -8
  161. package/node_modules/pi-agent-filesystem-image/package.json +3 -3
  162. package/node_modules/pi-agent-filesystem-jq/index.ts +1 -1
  163. package/node_modules/pi-agent-filesystem-jq/package.json +5 -5
  164. package/node_modules/pi-agent-filesystem-jq/src/api/jq.ts +1 -1
  165. package/node_modules/pi-agent-filesystem-pdf/package.json +3 -3
  166. package/node_modules/pi-agent-filesystem-text/package.json +3 -3
  167. package/node_modules/pi-agent-ide-ast/index.ts +1 -1
  168. package/node_modules/pi-agent-ide-ast/package.json +13 -13
  169. package/node_modules/pi-agent-ide-ast/src/api/scope.ts +1 -1
  170. package/node_modules/pi-agent-ide-ast/src/ast/manager.ts +33 -11
  171. package/node_modules/pi-agent-ide-ast/src/ast/native-parser.ts +1 -1
  172. package/node_modules/pi-agent-ide-ast/src/ast/outline.ts +60 -55
  173. package/node_modules/pi-agent-ide-ast/src/doctor-plugin.ts +4 -3
  174. package/node_modules/pi-agent-ide-ast/src/extension.ts +10 -10
  175. package/node_modules/pi-agent-ide-ast/src/outline-resolver.ts +3 -3
  176. package/node_modules/pi-agent-ide-ast/src/overflow-handler.ts +1 -1
  177. package/node_modules/pi-agent-ide-ast/src/scope-handler.ts +35 -8
  178. package/node_modules/pi-agent-ide-ast/src/scope-resolver.ts +1 -1
  179. package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +161 -23
  180. package/node_modules/pi-agent-ide-ast/src/tool-ast-search.ts +1 -1
  181. package/node_modules/pi-agent-ide-changes/index.ts +9 -9
  182. package/node_modules/pi-agent-ide-changes/package.json +8 -8
  183. package/node_modules/pi-agent-ide-changes/src/change-anchor.ts +4 -4
  184. package/node_modules/pi-agent-ide-changes/src/changes/change-groups.ts +1 -1
  185. package/node_modules/pi-agent-ide-changes/src/changes/change-service.ts +4 -4
  186. package/node_modules/pi-agent-ide-changes/src/changes/git-changes-backend.ts +1 -1
  187. package/node_modules/pi-agent-ide-changes/src/current-change-presenter.ts +4 -4
  188. package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +5 -5
  189. package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +6 -6
  190. package/node_modules/pi-agent-ide-formatter/index.ts +5 -5
  191. package/node_modules/pi-agent-ide-formatter/package.json +3 -3
  192. package/node_modules/pi-agent-ide-formatter/src/doctor-plugin.ts +2 -2
  193. package/node_modules/pi-agent-ide-formatter/src/formatter.ts +2 -2
  194. package/node_modules/pi-agent-ide-formatter/src/registry.ts +1 -1
  195. package/node_modules/pi-agent-ide-languages/index.ts +1 -1
  196. package/node_modules/pi-agent-ide-languages/package.json +2 -2
  197. package/node_modules/pi-agent-ide-lint/index.ts +9 -9
  198. package/node_modules/pi-agent-ide-lint/package.json +7 -7
  199. package/node_modules/pi-agent-ide-lint/src/catalog.ts +4 -0
  200. package/node_modules/pi-agent-ide-lint/src/command-linter.ts +15 -6
  201. package/node_modules/pi-agent-ide-lint/src/diagnostics.ts +8 -14
  202. package/node_modules/pi-agent-ide-lint/src/doctor-plugin.ts +3 -3
  203. package/node_modules/pi-agent-ide-lint/src/registry.ts +1 -1
  204. package/node_modules/pi-agent-ide-lsp/index.ts +37 -16
  205. package/node_modules/pi-agent-ide-lsp/package.json +12 -12
  206. package/node_modules/pi-agent-ide-lsp/src/catalog.ts +12 -1
  207. package/node_modules/pi-agent-ide-lsp/src/declaration-targets.ts +21 -14
  208. package/node_modules/pi-agent-ide-lsp/src/diagnostic-source.ts +63 -20
  209. package/node_modules/pi-agent-ide-lsp/src/doctor-plugin.ts +4 -4
  210. package/node_modules/pi-agent-ide-lsp/src/idle-timeout.ts +15 -0
  211. package/node_modules/pi-agent-ide-lsp/src/lsp/abort.ts +11 -0
  212. package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +434 -80
  213. package/node_modules/pi-agent-ide-lsp/src/lsp/code-views.ts +121 -35
  214. package/node_modules/pi-agent-ide-lsp/src/lsp/diagnostic-adapters.ts +1 -1
  215. package/node_modules/pi-agent-ide-lsp/src/lsp/diagnostics.ts +26 -12
  216. package/node_modules/pi-agent-ide-lsp/src/lsp/document-leases.ts +31 -0
  217. package/node_modules/pi-agent-ide-lsp/src/lsp/errors.ts +4 -0
  218. package/node_modules/pi-agent-ide-lsp/src/lsp/file-watchers.ts +1 -77
  219. package/node_modules/pi-agent-ide-lsp/src/lsp/index.ts +19 -19
  220. package/node_modules/pi-agent-ide-lsp/src/lsp/language-map.ts +1 -1
  221. package/node_modules/pi-agent-ide-lsp/src/lsp/lsp-compiler.ts +5 -4
  222. package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +59 -28
  223. package/node_modules/pi-agent-ide-lsp/src/lsp/navigation.ts +42 -22
  224. package/node_modules/pi-agent-ide-lsp/src/lsp/owner-transport.ts +1 -1
  225. package/node_modules/pi-agent-ide-lsp/src/lsp/position-map.ts +52 -0
  226. package/node_modules/pi-agent-ide-lsp/src/lsp/project.ts +1 -1
  227. package/node_modules/pi-agent-ide-lsp/src/lsp/registry.ts +2 -2
  228. package/node_modules/pi-agent-ide-lsp/src/lsp/rename.ts +2 -2
  229. package/node_modules/pi-agent-ide-lsp/src/lsp/server-request-handlers.mjs +325 -0
  230. package/node_modules/pi-agent-ide-lsp/src/lsp/shared-server-host.mjs +797 -0
  231. package/node_modules/pi-agent-ide-lsp/src/lsp/shared-servers.ts +322 -0
  232. package/node_modules/pi-agent-ide-lsp/src/lsp/source-changes.ts +29 -0
  233. package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +76 -17
  234. package/node_modules/pi-agent-ide-lsp/src/lsp/symbols.ts +3 -3
  235. package/node_modules/pi-agent-ide-lsp/src/lsp/workspace-owner.ts +1 -1
  236. package/node_modules/pi-agent-ide-lsp/src/manager-provider.ts +1 -1
  237. package/node_modules/pi-agent-ide-lsp/src/rename-plan.ts +16 -8
  238. package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +149 -134
  239. package/node_modules/pi-agent-ide-lsp/src/tool-lsp-search.ts +1 -1
  240. package/node_modules/pi-agent-image/package.json +2 -2
  241. package/node_modules/pi-agent-image/src/index.ts +1 -1
  242. package/node_modules/pi-agent-invariant/package.json +1 -1
  243. package/node_modules/pi-agent-pdf/package.json +2 -2
  244. package/node_modules/pi-agent-pdf/src/index.ts +1 -1
  245. package/node_modules/pi-agent-read/index.ts +1 -1
  246. package/node_modules/pi-agent-read/package.json +7 -7
  247. package/node_modules/pi-agent-read/src/api/connect-plugin.ts +1 -1
  248. package/node_modules/pi-agent-read/src/api/plugin-protocol.ts +1 -1
  249. package/node_modules/pi-agent-read/src/api/read-parameters.ts +1 -1
  250. package/node_modules/pi-agent-read/src/api/rendering.ts +2 -2
  251. package/node_modules/pi-agent-read/src/api/tools/read.ts +8 -2
  252. package/node_modules/pi-agent-read/src/core/extension.ts +4 -4
  253. package/node_modules/pi-agent-read/src/core/read-core.ts +4 -4
  254. package/node_modules/pi-agent-read/src/core/tools/read/output-truncation.ts +2 -2
  255. package/node_modules/pi-agent-read/src/core/tools/read/persisted-result.ts +1 -1
  256. package/node_modules/pi-agent-read/src/core/tools/read/raw-read.ts +3 -3
  257. package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +4 -4
  258. package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +21 -14
  259. package/node_modules/pi-agent-read/src/core/tools/read/result-target.ts +24 -18
  260. package/node_modules/pi-agent-read/src/core/tools/read/structured-result.ts +2 -2
  261. package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +44 -18
  262. package/node_modules/pi-agent-resource/package.json +1 -1
  263. package/node_modules/pi-agent-resource/src/content-conversion/connect-plugin.ts +4 -4
  264. package/node_modules/pi-agent-resource/src/content-conversion/content-converter.ts +1 -1
  265. package/node_modules/pi-agent-resource/src/content-conversion/content-description.ts +1 -1
  266. package/node_modules/pi-agent-resource/src/content-conversion/content-host.ts +4 -4
  267. package/node_modules/pi-agent-resource/src/content-conversion/content-runner.ts +3 -3
  268. package/node_modules/pi-agent-resource/src/content-conversion/plugin-protocol.ts +2 -2
  269. package/node_modules/pi-agent-resource/src/content-conversion/validation.ts +2 -2
  270. package/node_modules/pi-agent-resource/src/index.ts +19 -19
  271. package/node_modules/pi-agent-resource/src/resolver.ts +1 -1
  272. package/node_modules/pi-agent-resource/src/resource-access.ts +1 -1
  273. package/node_modules/pi-agent-resource/src/resource-error.ts +1 -1
  274. package/node_modules/pi-agent-resource/src/resource.ts +1 -1
  275. package/node_modules/pi-agent-resource/src/result-images.ts +1 -1
  276. package/node_modules/pi-agent-resource/src/result-targets.ts +23 -2
  277. package/node_modules/pi-agent-resource/src/temp-resource-store.ts +2 -2
  278. package/node_modules/pi-agent-resource/src/tool-result.ts +2 -2
  279. package/node_modules/pi-agent-resource/src/validation.ts +3 -3
  280. package/node_modules/pi-agent-search/index.ts +1 -1
  281. package/node_modules/pi-agent-search/package.json +5 -5
  282. package/node_modules/pi-agent-search/src/api/connect-plugin.ts +1 -1
  283. package/node_modules/pi-agent-search/src/api/fuzzy.ts +2 -2
  284. package/node_modules/pi-agent-search/src/api/plugin-protocol.ts +1 -1
  285. package/node_modules/pi-agent-search/src/api/presentation.ts +1 -1
  286. package/node_modules/pi-agent-search/src/api/search-scope.ts +1 -1
  287. package/node_modules/pi-agent-search/src/api/search.ts +7 -7
  288. package/node_modules/pi-agent-search/src/core/extension.ts +7 -7
  289. package/node_modules/pi-agent-search/src/core/search-core.ts +3 -3
  290. package/node_modules/pi-agent-search-text/index.ts +8 -8
  291. package/node_modules/pi-agent-search-text/package.json +10 -10
  292. package/node_modules/pi-agent-search-text/src/doctor-plugin.ts +1 -1
  293. package/node_modules/pi-agent-search-text/src/file-search.ts +1 -1
  294. package/node_modules/pi-agent-search-text/src/fuzzy-search.ts +2 -2
  295. package/node_modules/pi-agent-search-text/src/persisted-result.ts +1 -1
  296. package/node_modules/pi-agent-search-text/src/resolvers.ts +9 -9
  297. package/node_modules/pi-agent-search-text/src/scoped-search.ts +4 -4
  298. package/node_modules/pi-agent-search-text/src/search-backend.ts +3 -3
  299. package/node_modules/pi-agent-search-text/src/search-presentation.ts +1 -1
  300. package/node_modules/pi-agent-search-text/src/search-recipe.ts +2 -2
  301. package/node_modules/pi-agent-search-text/src/search-renderer.ts +3 -3
  302. package/node_modules/pi-agent-search-text/src/search-result.ts +2 -2
  303. package/node_modules/pi-agent-search-text/src/search-session.ts +132 -67
  304. package/node_modules/pi-agent-search-text/src/tool-file-search.ts +1 -1
  305. package/node_modules/pi-agent-text/package.json +2 -2
  306. package/node_modules/pi-agent-text/src/index.ts +7 -7
  307. package/node_modules/pi-agent-text/src/source-line.ts +1 -1
  308. package/node_modules/pi-agent-text/src/text-document.ts +50 -2
  309. package/node_modules/pi-agent-text-anchor-constant/index.ts +1 -1
  310. package/node_modules/pi-agent-text-anchor-constant/package.json +3 -3
  311. package/node_modules/pi-agent-text-anchor-exact/index.ts +2 -2
  312. package/node_modules/pi-agent-text-anchor-exact/package.json +3 -3
  313. package/node_modules/pi-agent-text-anchor-exact/src/anchor.ts +63 -48
  314. package/node_modules/pi-agent-text-anchor-exact/src/recovery.ts +3 -3
  315. package/node_modules/pi-agent-text-anchor-line-hash/index.ts +2 -2
  316. package/node_modules/pi-agent-text-anchor-line-hash/package.json +5 -5
  317. package/node_modules/pi-agent-text-anchor-line-hash/src/read-handler.ts +23 -12
  318. package/node_modules/pi-agent-text-editor/index.ts +5 -5
  319. package/node_modules/pi-agent-text-editor/package.json +9 -9
  320. package/node_modules/pi-agent-text-editor/src/api/connect-plugin.ts +1 -1
  321. package/node_modules/pi-agent-text-editor/src/api/edit-pipeline.ts +2 -2
  322. package/node_modules/pi-agent-text-editor/src/api/file-operations.ts +2 -2
  323. package/node_modules/pi-agent-text-editor/src/api/file-transfers.ts +1 -1
  324. package/node_modules/pi-agent-text-editor/src/api/mutation-guard.ts +4 -4
  325. package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +3 -3
  326. package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +2 -2
  327. package/node_modules/pi-agent-text-editor/src/api/native-edit-batch-event.ts +1 -1
  328. package/node_modules/pi-agent-text-editor/src/api/native-files.ts +1 -1
  329. package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +14 -14
  330. package/node_modules/pi-agent-text-editor/src/api/post-edit.ts +3 -3
  331. package/node_modules/pi-agent-text-editor/src/api/tool-call-interceptor.ts +1 -1
  332. package/node_modules/pi-agent-text-editor/src/api/tool-renderer.ts +2 -2
  333. package/node_modules/pi-agent-text-editor/src/core/delete-policy.ts +3 -3
  334. package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +3 -3
  335. package/node_modules/pi-agent-text-editor/src/core/extension.ts +13 -13
  336. package/node_modules/pi-agent-text-editor/src/core/file-operation-guards.ts +2 -2
  337. package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +6 -6
  338. package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +5 -5
  339. package/node_modules/pi-agent-text-editor/src/core/file-result-targets.ts +1 -1
  340. package/node_modules/pi-agent-text-editor/src/core/file-transfers.ts +3 -3
  341. package/node_modules/pi-agent-text-editor/src/core/image-write.ts +1 -1
  342. package/node_modules/pi-agent-text-editor/src/core/mutation-result/agent-diff.ts +11 -6
  343. package/node_modules/pi-agent-text-editor/src/core/mutation-result/diff.ts +213 -20
  344. package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +4 -4
  345. package/node_modules/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +39 -3
  346. package/node_modules/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +1 -1
  347. package/node_modules/pi-agent-text-editor/src/core/mutation-result/inline-hints.ts +1 -1
  348. package/node_modules/pi-agent-text-editor/src/core/mutation-result-targets.ts +6 -6
  349. package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +22 -22
  350. package/node_modules/pi-agent-text-editor/src/core/post-edit-scope.ts +1 -1
  351. package/node_modules/pi-agent-text-editor/src/core/read-fragment-resolver.ts +3 -3
  352. package/node_modules/pi-agent-text-editor/src/core/result-input.ts +1 -1
  353. package/node_modules/pi-agent-text-editor/src/core/result-target-anchors.ts +2 -2
  354. package/node_modules/pi-agent-text-editor/src/core/result-transfer.ts +4 -4
  355. package/node_modules/pi-agent-text-editor/src/core/source-change-retry.ts +41 -0
  356. package/node_modules/pi-agent-text-editor/src/core/structured-result.ts +2 -2
  357. package/node_modules/pi-agent-text-editor/src/core/temporary-directories.ts +2 -2
  358. package/node_modules/pi-agent-text-editor/src/core/text-anchor-recovery.ts +1 -1
  359. package/node_modules/pi-agent-text-editor/src/core/text-anchor-registry.ts +3 -3
  360. package/node_modules/pi-agent-text-editor/src/core/text-change-engine.ts +4 -7
  361. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +2 -2
  362. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-recovery.ts +2 -2
  363. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +34 -21
  364. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +4 -4
  365. package/node_modules/pi-agent-text-editor/src/core/text-edit-origin.ts +1 -1
  366. package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +72 -30
  367. package/node_modules/pi-agent-text-editor/src/core/text-mutation-anchor-error.ts +1 -1
  368. package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +211 -159
  369. package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +4 -4
  370. package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +1 -1
  371. package/node_modules/pi-agent-text-editor/src/core/write-agent-result.ts +3 -3
  372. package/node_modules/pi-agent-text-editor/src/tools/extension.ts +7 -7
  373. package/node_modules/pi-agent-text-editor/src/tools/text-selection.ts +2 -2
  374. package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +4 -4
  375. package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +4 -4
  376. package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +3 -3
  377. package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +5 -5
  378. package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +4 -4
  379. package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +1 -1
  380. package/node_modules/pi-agent-text-editor-renderer/index.ts +5 -5
  381. package/node_modules/pi-agent-text-editor-renderer/package.json +5 -5
  382. package/node_modules/pi-agent-text-editor-renderer/src/diff-renderer.ts +3 -3
  383. package/node_modules/pi-agent-text-editor-renderer/src/diff-viewport.ts +1 -1
  384. package/node_modules/pi-agent-text-editor-renderer/src/frozen-viewport.ts +2 -2
  385. package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +4 -4
  386. package/node_modules/pi-agent-text-editor-renderer/src/mutation-projection.ts +2 -2
  387. package/node_modules/pi-agent-text-editor-renderer/src/mutation-result.ts +3 -3
  388. package/node_modules/pi-agent-text-editor-renderer/src/persisted-result.ts +2 -2
  389. package/node_modules/pi-agent-text-editor-renderer/src/render-resource.ts +1 -1
  390. package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +7 -7
  391. package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
  392. package/node_modules/pi-agent-tool-call-interception/package.json +2 -2
  393. package/node_modules/pi-agent-tool-call-interception/src/index.ts +32 -9
  394. package/node_modules/pi-agent-tool-ui/package.json +1 -1
  395. package/node_modules/pi-agent-tool-ui/src/index.ts +1 -1
  396. package/node_modules/pi-agent-tool-ui/src/result-panel.ts +1 -1
  397. package/node_modules/pi-agent-web/index.ts +3 -3
  398. package/node_modules/pi-agent-web/package.json +7 -7
  399. package/node_modules/pi-agent-web/src/doctor-plugin.ts +1 -1
  400. package/node_modules/pi-agent-web/src/resolver.ts +1 -1
  401. package/node_modules/pi-agent-web-html/index.ts +1 -1
  402. package/node_modules/pi-agent-web-html/package.json +2 -2
  403. package/node_modules/pi-agent-web-html/src/html-converter.ts +1 -1
  404. package/node_modules/pi-agent-web-image/package.json +3 -3
  405. package/node_modules/pi-agent-web-pdf/package.json +3 -3
  406. package/node_modules/pi-agent-web-text/package.json +3 -3
  407. package/package.json +36 -36
  408. package/src/api/code-view.ts +3 -3
  409. package/src/api/connect-plugin.ts +1 -1
  410. package/src/api/connect-tip-provider.ts +2 -2
  411. package/src/api/doctor-runtime.ts +1 -1
  412. package/src/api/doctor.ts +1 -1
  413. package/src/api/hooks.ts +2 -2
  414. package/src/api/plugin-protocol.ts +1 -1
  415. package/src/api/settings.ts +6 -1
  416. package/src/api/standalone.ts +1 -1
  417. package/src/api/tips.ts +1 -1
  418. package/src/api/tool-config/linters.json +1 -1
  419. package/src/api/tool-config/lsp-servers.json +11 -0
  420. package/src/api/tool-config.ts +45 -5
  421. package/src/api/toolchain.ts +3 -3
  422. package/src/backend/config.ts +2 -2
  423. package/src/backend/configured-process.ts +5 -5
  424. package/src/backend/dap-java-transport.ts +6 -6
  425. package/src/backend/dap-node-transport.ts +5 -5
  426. package/src/backend/dap-tcp-transport.ts +3 -3
  427. package/src/backend/dap-transport.ts +5 -5
  428. package/src/backend/debugger-registration.ts +7 -7
  429. package/src/backend/debugger-workspace-owner.ts +10 -10
  430. package/src/backend/doctor-registration.ts +5 -5
  431. package/src/backend/doctor-workspace.ts +13 -13
  432. package/src/backend/file-operation-resolver.ts +5 -5
  433. package/src/backend/file-revision.ts +1 -1
  434. package/src/backend/file-transfer.ts +4 -4
  435. package/src/backend/formatter-registration.ts +11 -11
  436. package/src/backend/git-registration.ts +4 -4
  437. package/src/backend/index.ts +3 -3
  438. package/src/backend/lint-registration.ts +11 -11
  439. package/src/backend/lsp-file-watchers.ts +5 -5
  440. package/src/backend/lsp-registration.ts +11 -11
  441. package/src/backend/lsp-transport.ts +7 -7
  442. package/src/backend/lsp-workspace-owner.ts +4 -4
  443. package/src/backend/object-transfer.ts +5 -5
  444. package/src/backend/owned-command.ts +2 -2
  445. package/src/backend/owned-process-stop.ts +4 -4
  446. package/src/backend/owned-read-command.ts +2 -2
  447. package/src/backend/process-environment.ts +2 -2
  448. package/src/backend/process-metadata.ts +2 -2
  449. package/src/backend/recipe-evidence.ts +2 -2
  450. package/src/backend/registration.ts +8 -8
  451. package/src/backend/registry.ts +2 -2
  452. package/src/backend/resource-resolver.ts +2 -2
  453. package/src/backend/search-environment.ts +3 -3
  454. package/src/backend/ssh-channel.ts +3 -3
  455. package/src/backend/ssh-transport.ts +2 -2
  456. package/src/backend/ssh.ts +6 -6
  457. package/src/backend/tool-config-access.ts +4 -4
  458. package/src/backend/tool-project.ts +5 -5
  459. package/src/backend/web-browser.ts +3 -3
  460. package/src/backend/web-http.ts +2 -2
  461. package/src/backend/web-owner.ts +5 -5
  462. package/src/backend/web-registration.ts +5 -5
  463. package/src/code-review/extension.ts +3 -3
  464. package/src/code-review/reviewer.ts +2 -2
  465. package/src/code-view/diagnostic-view.ts +4 -4
  466. package/src/composite/builtin-extensions.ts +37 -37
  467. package/src/composite/capabilities.ts +2 -2
  468. package/src/composite/capability-schemas.ts +1 -1
  469. package/src/composite/detached-results.ts +32 -0
  470. package/src/composite/extensions-config.ts +2 -2
  471. package/src/composite/module-settings-store.ts +2 -2
  472. package/src/composite/module-settings.ts +12 -12
  473. package/src/composite/nested-tool-rendering.ts +3 -3
  474. package/src/composite/output-limits.ts +6 -1
  475. package/src/composite/preferences.ts +10 -0
  476. package/src/composite/presets.ts +1 -1
  477. package/src/composite/reload-required.ts +6 -6
  478. package/src/composite/settings-documentation.ts +5 -5
  479. package/src/composite/settings-registry.ts +4 -4
  480. package/src/composite/text-results.ts +2 -2
  481. package/src/core/diagnostic-entry.ts +2 -2
  482. package/src/core/diagnostic-store.ts +3 -3
  483. package/src/core/extension.ts +8 -8
  484. package/src/core/ide-core.ts +4 -4
  485. package/src/doctor/config-writer.ts +3 -3
  486. package/src/doctor/core.ts +2 -2
  487. package/src/doctor/discovery.ts +4 -4
  488. package/src/doctor/extension.ts +7 -7
  489. package/src/doctor/index.ts +1 -1
  490. package/src/doctor/inventory.ts +1 -1
  491. package/src/doctor/run.ts +6 -6
  492. package/src/doctor/tip-provider.ts +2 -2
  493. package/src/documentation/extension.ts +3 -3
  494. package/src/documentation/registry.ts +1 -1
  495. package/src/documentation/search.ts +1 -1
  496. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +2 -2
  497. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
  498. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +3 -3
  499. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/index.ts +1 -1
  500. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +5 -5
  501. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/src/api/jq.ts +1 -1
  502. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +3 -3
  503. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +3 -3
  504. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/src/file-write-lock.ts +70 -0
  505. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/src/replace-file.ts +50 -0
  506. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/src/resolver.ts +28 -8
  507. package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +3 -3
  508. package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +7 -7
  509. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/index.ts +1 -1
  510. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +2 -2
  511. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/src/html-converter.ts +1 -1
  512. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +3 -3
  513. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +3 -3
  514. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +3 -3
  515. package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/doctor-plugin.ts +1 -1
  516. package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/resolver.ts +1 -1
  517. package/src/extensions/pi-agent-read/index.ts +1 -1
  518. package/src/extensions/pi-agent-read/package.json +7 -7
  519. package/src/extensions/pi-agent-read/src/api/connect-plugin.ts +1 -1
  520. package/src/extensions/pi-agent-read/src/api/plugin-protocol.ts +1 -1
  521. package/src/extensions/pi-agent-read/src/api/read-parameters.ts +1 -1
  522. package/src/extensions/pi-agent-read/src/api/rendering.ts +2 -2
  523. package/src/extensions/pi-agent-read/src/api/tools/read.ts +8 -2
  524. package/src/extensions/pi-agent-read/src/core/extension.ts +4 -4
  525. package/src/extensions/pi-agent-read/src/core/read-core.ts +4 -4
  526. package/src/extensions/pi-agent-read/src/core/tools/read/output-truncation.ts +2 -2
  527. package/src/extensions/pi-agent-read/src/core/tools/read/persisted-result.ts +1 -1
  528. package/src/extensions/pi-agent-read/src/core/tools/read/raw-read.ts +3 -3
  529. package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +4 -4
  530. package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +21 -14
  531. package/src/extensions/pi-agent-read/src/core/tools/read/result-target.ts +24 -18
  532. package/src/extensions/pi-agent-read/src/core/tools/read/structured-result.ts +2 -2
  533. package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +44 -18
  534. package/src/extensions/pi-agent-search/index.ts +1 -1
  535. package/src/extensions/pi-agent-search/package.json +5 -5
  536. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +8 -8
  537. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +10 -10
  538. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/doctor-plugin.ts +1 -1
  539. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/file-search.ts +1 -1
  540. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/fuzzy-search.ts +2 -2
  541. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/persisted-result.ts +1 -1
  542. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +9 -9
  543. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/scoped-search.ts +4 -4
  544. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +3 -3
  545. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-presentation.ts +1 -1
  546. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +2 -2
  547. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +3 -3
  548. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +2 -2
  549. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +132 -67
  550. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/tool-file-search.ts +1 -1
  551. package/src/extensions/pi-agent-search/src/api/connect-plugin.ts +1 -1
  552. package/src/extensions/pi-agent-search/src/api/fuzzy.ts +2 -2
  553. package/src/extensions/pi-agent-search/src/api/plugin-protocol.ts +1 -1
  554. package/src/extensions/pi-agent-search/src/api/presentation.ts +1 -1
  555. package/src/extensions/pi-agent-search/src/api/search-scope.ts +1 -1
  556. package/src/extensions/pi-agent-search/src/api/search.ts +7 -7
  557. package/src/extensions/pi-agent-search/src/core/extension.ts +7 -7
  558. package/src/extensions/pi-agent-search/src/core/search-core.ts +3 -3
  559. package/src/extensions/pi-agent-text-editor/index.ts +5 -5
  560. package/src/extensions/pi-agent-text-editor/package.json +9 -9
  561. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/index.ts +1 -1
  562. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +3 -3
  563. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.ts +2 -2
  564. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +3 -3
  565. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/anchor.ts +63 -48
  566. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/recovery.ts +3 -3
  567. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +2 -2
  568. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +5 -5
  569. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/read-handler.ts +23 -12
  570. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +5 -5
  571. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +5 -5
  572. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-renderer.ts +3 -3
  573. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-viewport.ts +1 -1
  574. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/frozen-viewport.ts +2 -2
  575. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +4 -4
  576. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-projection.ts +2 -2
  577. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-result.ts +3 -3
  578. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/persisted-result.ts +2 -2
  579. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/render-resource.ts +1 -1
  580. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +7 -7
  581. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -5
  582. package/src/extensions/pi-agent-text-editor/src/api/connect-plugin.ts +1 -1
  583. package/src/extensions/pi-agent-text-editor/src/api/edit-pipeline.ts +2 -2
  584. package/src/extensions/pi-agent-text-editor/src/api/file-operations.ts +2 -2
  585. package/src/extensions/pi-agent-text-editor/src/api/file-transfers.ts +1 -1
  586. package/src/extensions/pi-agent-text-editor/src/api/mutation-guard.ts +4 -4
  587. package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +3 -3
  588. package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +2 -2
  589. package/src/extensions/pi-agent-text-editor/src/api/native-edit-batch-event.ts +1 -1
  590. package/src/extensions/pi-agent-text-editor/src/api/native-files.ts +1 -1
  591. package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +14 -14
  592. package/src/extensions/pi-agent-text-editor/src/api/post-edit.ts +3 -3
  593. package/src/extensions/pi-agent-text-editor/src/api/tool-call-interceptor.ts +1 -1
  594. package/src/extensions/pi-agent-text-editor/src/api/tool-renderer.ts +2 -2
  595. package/src/extensions/pi-agent-text-editor/src/core/delete-policy.ts +3 -3
  596. package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +3 -3
  597. package/src/extensions/pi-agent-text-editor/src/core/extension.ts +13 -13
  598. package/src/extensions/pi-agent-text-editor/src/core/file-operation-guards.ts +2 -2
  599. package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +6 -6
  600. package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +5 -5
  601. package/src/extensions/pi-agent-text-editor/src/core/file-result-targets.ts +1 -1
  602. package/src/extensions/pi-agent-text-editor/src/core/file-transfers.ts +3 -3
  603. package/src/extensions/pi-agent-text-editor/src/core/image-write.ts +1 -1
  604. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/agent-diff.ts +11 -6
  605. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/diff.ts +213 -20
  606. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +4 -4
  607. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +39 -3
  608. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +1 -1
  609. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/inline-hints.ts +1 -1
  610. package/src/extensions/pi-agent-text-editor/src/core/mutation-result-targets.ts +6 -6
  611. package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +22 -22
  612. package/src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts +1 -1
  613. package/src/extensions/pi-agent-text-editor/src/core/read-fragment-resolver.ts +3 -3
  614. package/src/extensions/pi-agent-text-editor/src/core/result-input.ts +1 -1
  615. package/src/extensions/pi-agent-text-editor/src/core/result-target-anchors.ts +2 -2
  616. package/src/extensions/pi-agent-text-editor/src/core/result-transfer.ts +4 -4
  617. package/src/extensions/pi-agent-text-editor/src/core/source-change-retry.ts +41 -0
  618. package/src/extensions/pi-agent-text-editor/src/core/structured-result.ts +2 -2
  619. package/src/extensions/pi-agent-text-editor/src/core/temporary-directories.ts +2 -2
  620. package/src/extensions/pi-agent-text-editor/src/core/text-anchor-recovery.ts +1 -1
  621. package/src/extensions/pi-agent-text-editor/src/core/text-anchor-registry.ts +3 -3
  622. package/src/extensions/pi-agent-text-editor/src/core/text-change-engine.ts +4 -7
  623. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +2 -2
  624. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-recovery.ts +2 -2
  625. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +34 -21
  626. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +4 -4
  627. package/src/extensions/pi-agent-text-editor/src/core/text-edit-origin.ts +1 -1
  628. package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +72 -30
  629. package/src/extensions/pi-agent-text-editor/src/core/text-mutation-anchor-error.ts +1 -1
  630. package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +211 -159
  631. package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +4 -4
  632. package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +1 -1
  633. package/src/extensions/pi-agent-text-editor/src/core/write-agent-result.ts +3 -3
  634. package/src/extensions/pi-agent-text-editor/src/tools/extension.ts +7 -7
  635. package/src/extensions/pi-agent-text-editor/src/tools/text-selection.ts +2 -2
  636. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +4 -4
  637. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +4 -4
  638. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +3 -3
  639. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +5 -5
  640. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +4 -4
  641. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +1 -1
  642. package/src/index.ts +1 -1
  643. package/src/pi-agent-ide.ts +22 -20
  644. package/src/plugins/pi-agent-ide-ast/index.ts +1 -1
  645. package/src/plugins/pi-agent-ide-ast/package.json +13 -13
  646. package/src/plugins/pi-agent-ide-ast/src/api/scope.ts +1 -1
  647. package/src/plugins/pi-agent-ide-ast/src/ast/manager.ts +33 -11
  648. package/src/plugins/pi-agent-ide-ast/src/ast/native-parser.ts +1 -1
  649. package/src/plugins/pi-agent-ide-ast/src/ast/outline.ts +60 -55
  650. package/src/plugins/pi-agent-ide-ast/src/doctor-plugin.ts +4 -3
  651. package/src/plugins/pi-agent-ide-ast/src/extension.ts +10 -10
  652. package/src/plugins/pi-agent-ide-ast/src/outline-resolver.ts +3 -3
  653. package/src/plugins/pi-agent-ide-ast/src/overflow-handler.ts +1 -1
  654. package/src/plugins/pi-agent-ide-ast/src/scope-handler.ts +35 -8
  655. package/src/plugins/pi-agent-ide-ast/src/scope-resolver.ts +1 -1
  656. package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +161 -23
  657. package/src/plugins/pi-agent-ide-ast/src/tool-ast-search.ts +1 -1
  658. package/src/plugins/pi-agent-ide-changes/index.ts +9 -9
  659. package/src/plugins/pi-agent-ide-changes/package.json +8 -8
  660. package/src/plugins/pi-agent-ide-changes/src/change-anchor.ts +4 -4
  661. package/src/plugins/pi-agent-ide-changes/src/changes/change-groups.ts +1 -1
  662. package/src/plugins/pi-agent-ide-changes/src/changes/change-service.ts +4 -4
  663. package/src/plugins/pi-agent-ide-changes/src/changes/git-changes-backend.ts +1 -1
  664. package/src/plugins/pi-agent-ide-changes/src/current-change-presenter.ts +4 -4
  665. package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +5 -5
  666. package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +6 -6
  667. package/src/plugins/pi-agent-ide-debugger/index.ts +21 -13
  668. package/src/plugins/pi-agent-ide-debugger/src/breakpoint-view.ts +1 -1
  669. package/src/plugins/pi-agent-ide-debugger/src/doctor-plugin.ts +4 -4
  670. package/src/plugins/pi-agent-ide-debugger/src/java-runtime.ts +2 -2
  671. package/src/plugins/pi-agent-ide-debugger/src/process-provider.ts +3 -3
  672. package/src/plugins/pi-agent-ide-debugger/src/renderer.ts +1 -1
  673. package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +5 -5
  674. package/src/plugins/pi-agent-ide-debugger/src/ui.ts +1 -1
  675. package/src/plugins/pi-agent-ide-debugger/src/vscode-backend.ts +1 -1
  676. package/src/plugins/pi-agent-ide-debugger/src/workspace-owner.ts +2 -2
  677. package/src/plugins/pi-agent-ide-diagnostics/index.ts +1 -1
  678. package/src/plugins/pi-agent-ide-formatter/index.ts +5 -5
  679. package/src/plugins/pi-agent-ide-formatter/package.json +3 -3
  680. package/src/plugins/pi-agent-ide-formatter/src/doctor-plugin.ts +2 -2
  681. package/src/plugins/pi-agent-ide-formatter/src/formatter.ts +2 -2
  682. package/src/plugins/pi-agent-ide-formatter/src/registry.ts +1 -1
  683. package/src/plugins/pi-agent-ide-languages/index.ts +1 -1
  684. package/src/plugins/pi-agent-ide-languages/package.json +2 -2
  685. package/src/plugins/pi-agent-ide-lint/index.ts +9 -9
  686. package/src/plugins/pi-agent-ide-lint/package.json +7 -7
  687. package/src/plugins/pi-agent-ide-lint/src/catalog.ts +4 -0
  688. package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +15 -6
  689. package/src/plugins/pi-agent-ide-lint/src/diagnostics.ts +8 -14
  690. package/src/plugins/pi-agent-ide-lint/src/doctor-plugin.ts +3 -3
  691. package/src/plugins/pi-agent-ide-lint/src/registry.ts +1 -1
  692. package/src/plugins/pi-agent-ide-lsp/index.ts +37 -16
  693. package/src/plugins/pi-agent-ide-lsp/package.json +12 -12
  694. package/src/plugins/pi-agent-ide-lsp/src/catalog.ts +12 -1
  695. package/src/plugins/pi-agent-ide-lsp/src/declaration-targets.ts +21 -14
  696. package/src/plugins/pi-agent-ide-lsp/src/diagnostic-source.ts +63 -20
  697. package/src/plugins/pi-agent-ide-lsp/src/doctor-plugin.ts +4 -4
  698. package/src/plugins/pi-agent-ide-lsp/src/idle-timeout.ts +15 -0
  699. package/src/plugins/pi-agent-ide-lsp/src/lsp/abort.ts +11 -0
  700. package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +434 -80
  701. package/src/plugins/pi-agent-ide-lsp/src/lsp/code-views.ts +121 -35
  702. package/src/plugins/pi-agent-ide-lsp/src/lsp/diagnostic-adapters.ts +1 -1
  703. package/src/plugins/pi-agent-ide-lsp/src/lsp/diagnostics.ts +26 -12
  704. package/src/plugins/pi-agent-ide-lsp/src/lsp/document-leases.ts +31 -0
  705. package/src/plugins/pi-agent-ide-lsp/src/lsp/errors.ts +4 -0
  706. package/src/plugins/pi-agent-ide-lsp/src/lsp/file-watchers.ts +1 -77
  707. package/src/plugins/pi-agent-ide-lsp/src/lsp/index.ts +19 -19
  708. package/src/plugins/pi-agent-ide-lsp/src/lsp/language-map.ts +1 -1
  709. package/src/plugins/pi-agent-ide-lsp/src/lsp/lsp-compiler.ts +5 -4
  710. package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +59 -28
  711. package/src/plugins/pi-agent-ide-lsp/src/lsp/navigation.ts +42 -22
  712. package/src/plugins/pi-agent-ide-lsp/src/lsp/owner-transport.ts +1 -1
  713. package/src/plugins/pi-agent-ide-lsp/src/lsp/position-map.ts +52 -0
  714. package/src/plugins/pi-agent-ide-lsp/src/lsp/project.ts +1 -1
  715. package/src/plugins/pi-agent-ide-lsp/src/lsp/registry.ts +2 -2
  716. package/src/plugins/pi-agent-ide-lsp/src/lsp/rename.ts +2 -2
  717. package/src/plugins/pi-agent-ide-lsp/src/lsp/server-request-handlers.mjs +325 -0
  718. package/src/plugins/pi-agent-ide-lsp/src/lsp/shared-server-host.mjs +797 -0
  719. package/src/plugins/pi-agent-ide-lsp/src/lsp/shared-servers.ts +322 -0
  720. package/src/plugins/pi-agent-ide-lsp/src/lsp/source-changes.ts +29 -0
  721. package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +76 -17
  722. package/src/plugins/pi-agent-ide-lsp/src/lsp/symbols.ts +3 -3
  723. package/src/plugins/pi-agent-ide-lsp/src/lsp/workspace-owner.ts +1 -1
  724. package/src/plugins/pi-agent-ide-lsp/src/manager-provider.ts +1 -1
  725. package/src/plugins/pi-agent-ide-lsp/src/rename-plan.ts +16 -8
  726. package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +149 -134
  727. package/src/plugins/pi-agent-ide-lsp/src/tool-lsp-search.ts +1 -1
  728. package/src/plugins/pi-agent-ide-processes/index.ts +4 -4
  729. package/src/plugins/pi-agent-ide-processes/src/ui.ts +1 -1
  730. package/src/plugins/pi-agent-ide-semantic/src/vera-backend.ts +2 -2
  731. package/src/plugins/pi-agent-ide-terminal/index.ts +17 -17
  732. package/src/plugins/pi-agent-ide-terminal/src/origin.ts +1 -1
  733. package/src/plugins/pi-agent-ide-terminal/src/output-limits.ts +1 -1
  734. package/src/plugins/pi-agent-ide-terminal/src/process-provider.ts +3 -3
  735. package/src/plugins/pi-agent-ide-terminal/src/renderer.ts +3 -3
  736. package/src/plugins/pi-agent-ide-terminal/src/resources.ts +5 -5
  737. package/src/plugins/pi-agent-ide-terminal/src/screen-image.ts +1 -1
  738. package/src/plugins/pi-agent-ide-terminal/src/search.ts +2 -2
  739. package/src/plugins/pi-agent-ide-terminal/src/session-manager.ts +3 -3
  740. package/src/plugins/pi-agent-ide-terminal/src/shell-profile.ts +1 -1
  741. package/src/plugins/pi-agent-ide-terminal/src/shell-result.ts +1 -1
  742. package/src/plugins/pi-agent-ide-terminal/src/tools.ts +9 -9
  743. package/src/plugins/pi-agent-ide-terminal/src/types.ts +1 -1
  744. package/src/plugins/pi-agent-ide-terminal/src/ui.ts +3 -3
  745. package/src/post-edit/gate.ts +1 -1
  746. package/src/semantic/extension.ts +2 -2
  747. package/src/semantic/index.ts +4 -4
  748. package/src/standalone/resource-host.ts +13 -13
  749. package/src/standalone/scoped-api.ts +2 -2
  750. package/src/tips/core.ts +1 -1
  751. package/src/tips/extension.ts +6 -6
  752. package/src/tips/setup-hint.ts +1 -1
  753. package/src/toolchain/diagnostic.ts +1 -1
  754. package/src/toolchain/registry.ts +1 -1
  755. package/dist/chunk-2AY526TN.js +0 -3
  756. package/dist/chunk-52PFWQMU.js +0 -5
  757. package/dist/chunk-57F5GTHO.js +0 -1
  758. package/dist/chunk-5S74Z6Y4.js +0 -7
  759. package/dist/chunk-7D7PXIVV.js +0 -1
  760. package/dist/chunk-BT2CFM7D.js +0 -11
  761. package/dist/chunk-C2JT2G5K.js +0 -1
  762. package/dist/chunk-DEWWWKUF.js +0 -6
  763. package/dist/chunk-FEZLTM4L.js +0 -1
  764. package/dist/chunk-G4PRFO6G.js +0 -1
  765. package/dist/chunk-H5Z54BEU.js +0 -25
  766. package/dist/chunk-HISGZD3C.js +0 -81
  767. package/dist/chunk-HRBUY2FF.js +0 -4
  768. package/dist/chunk-ICIRQLZ4.js +0 -23
  769. package/dist/chunk-LIQ4BVOB.js +0 -1
  770. package/dist/chunk-LXDF2NWX.js +0 -1
  771. package/dist/chunk-MDD5ORB6.js +0 -1
  772. package/dist/chunk-OJEIX7OZ.js +0 -1
  773. package/dist/chunk-S5PL5DFQ.js +0 -1
  774. package/dist/chunk-U7YDLVFL.js +0 -1
  775. package/dist/chunk-VDJSH3DQ.js +0 -2
  776. package/dist/chunk-XH5WN5XA.js +0 -2
package/dist/entry-57.js CHANGED
@@ -1 +1 @@
1
- import{a as e}from"./chunk-JWSJCEIB.js";import"./chunk-XH5WN5XA.js";import"./chunk-7PVDTMEM.js";import"./chunk-VAXLSPPU.js";import"./chunk-KN6VPARZ.js";import"./chunk-PS2B6THP.js";import"./chunk-DDH3FP4G.js";import"./chunk-EI7MMDWY.js";export{e as default};
1
+ import{a as e}from"./chunk-WQTF6Q2X.js";import"./chunk-JXULBI4S.js";import"./chunk-5AROEOJB.js";import"./chunk-VAXLSPPU.js";import"./chunk-KN6VPARZ.js";import"./chunk-PS2B6THP.js";import"./chunk-SIYPD5MM.js";import"./chunk-EI7MMDWY.js";export{e as default};
package/dist/entry-58.js CHANGED
@@ -1 +1 @@
1
- import{a as b,b as c}from"./chunk-DFXXT6MJ.js";import"./chunk-7C73WVPB.js";import{f as a}from"./chunk-DEWWWKUF.js";import"./chunk-K5M65CAF.js";import"./chunk-5BGWNYQS.js";import"./chunk-2TZDG2JH.js";import"./chunk-IG5DXVDJ.js";import"./chunk-XH5WN5XA.js";import"./chunk-R2U5WXYR.js";import"./chunk-FYOU4RBH.js";import"./chunk-7PVDTMEM.js";import"./chunk-47SPPIXK.js";import"./chunk-VAXLSPPU.js";import"./chunk-MDD5ORB6.js";import"./chunk-MLFJU2US.js";import"./chunk-PS2B6THP.js";import"./chunk-GXL4NMHR.js";import"./chunk-PQWANILR.js";import"./chunk-BU7IZLKB.js";import"./chunk-S5PL5DFQ.js";import"./chunk-DDH3FP4G.js";import"./chunk-756K3LJY.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as createSearchSessionId,b as default,c as registerResourceSearchSelections};
1
+ import{a as b,b as c}from"./chunk-APWMLLSE.js";import"./chunk-OCU6NW5Y.js";import{f as a}from"./chunk-ECSMTGVM.js";import"./chunk-K5M65CAF.js";import"./chunk-P7FUD4WY.js";import"./chunk-NF74ITWT.js";import"./chunk-5D4C225L.js";import"./chunk-JXULBI4S.js";import"./chunk-R2U5WXYR.js";import"./chunk-HFCHOFLV.js";import"./chunk-5AROEOJB.js";import"./chunk-47SPPIXK.js";import"./chunk-VAXLSPPU.js";import"./chunk-2YO6RVX4.js";import"./chunk-MLFJU2US.js";import"./chunk-PS2B6THP.js";import"./chunk-YZTVC7ME.js";import"./chunk-VDSSAP6Y.js";import"./chunk-2DSY4U73.js";import"./chunk-H6FEBUAP.js";import"./chunk-SIYPD5MM.js";import"./chunk-756K3LJY.js";import"./chunk-S7E2D5K7.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as createSearchSessionId,b as default,c as registerResourceSearchSelections};
package/dist/entry-59.js CHANGED
@@ -1 +1 @@
1
- import{f as a,g as b,h as c,i as d,j as e}from"./chunk-DEWWWKUF.js";import"./chunk-K5M65CAF.js";import"./chunk-5BGWNYQS.js";import"./chunk-FYOU4RBH.js";import"./chunk-7PVDTMEM.js";import"./chunk-PS2B6THP.js";import"./chunk-DDH3FP4G.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{e as SearchSessionStore,d as SearchSnapshotChangedError,c as allocateSearchSessionId,a as createSearchSessionId,b as createSearchSessionIdentity};
1
+ import{f as a,g as b,h as c,i as d,j as e}from"./chunk-ECSMTGVM.js";import"./chunk-K5M65CAF.js";import"./chunk-P7FUD4WY.js";import"./chunk-HFCHOFLV.js";import"./chunk-5AROEOJB.js";import"./chunk-PS2B6THP.js";import"./chunk-SIYPD5MM.js";import"./chunk-S7E2D5K7.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{e as SearchSessionStore,d as SearchSnapshotChangedError,c as allocateSearchSessionId,a as createSearchSessionId,b as createSearchSessionIdentity};
package/dist/entry-60.js CHANGED
@@ -1 +1 @@
1
- import{b as a,c as b}from"./chunk-2TZDG2JH.js";import"./chunk-IG5DXVDJ.js";import"./chunk-FYOU4RBH.js";import"./chunk-7PVDTMEM.js";import"./chunk-PS2B6THP.js";import"./chunk-DDH3FP4G.js";import"./chunk-VDJSH3DQ.js";import"./chunk-EI7MMDWY.js";export{b as SearchResultPanel,a as renderSearchResult};
1
+ import{b as a,c as b}from"./chunk-NF74ITWT.js";import"./chunk-5D4C225L.js";import"./chunk-HFCHOFLV.js";import"./chunk-5AROEOJB.js";import"./chunk-PS2B6THP.js";import"./chunk-SIYPD5MM.js";import"./chunk-S7E2D5K7.js";import"./chunk-EI7MMDWY.js";export{b as SearchResultPanel,a as renderSearchResult};
package/dist/entry-61.js CHANGED
@@ -1 +1 @@
1
- import{b as a,c as b,d as c}from"./chunk-IG5DXVDJ.js";import"./chunk-FYOU4RBH.js";import"./chunk-7PVDTMEM.js";import"./chunk-PS2B6THP.js";import"./chunk-DDH3FP4G.js";import"./chunk-EI7MMDWY.js";export{b as createFuzzyPresentation,a as createSearchToolDetails,c as isSearchToolDetails};
1
+ import{b as a,c as b,d as c}from"./chunk-5D4C225L.js";import"./chunk-HFCHOFLV.js";import"./chunk-5AROEOJB.js";import"./chunk-PS2B6THP.js";import"./chunk-SIYPD5MM.js";import"./chunk-EI7MMDWY.js";export{b as createFuzzyPresentation,a as createSearchToolDetails,c as isSearchToolDetails};
package/dist/entry-62.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-VDJSH3DQ.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-S7E2D5K7.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-63.js CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-NA2NEU4V.js";import"./chunk-GXL4NMHR.js";import"./chunk-PQWANILR.js";import"./chunk-DDH3FP4G.js";import"./chunk-VDJSH3DQ.js";import"./chunk-EI7MMDWY.js";export{a as default};
1
+ import{a}from"./chunk-B5UJCNQU.js";import"./chunk-YZTVC7ME.js";import"./chunk-VDSSAP6Y.js";import"./chunk-SIYPD5MM.js";import"./chunk-S7E2D5K7.js";import"./chunk-EI7MMDWY.js";export{a as default};
package/dist/entry-64.js CHANGED
@@ -1 +1 @@
1
- import{a,b,c}from"./chunk-QJ6V5IAY.js";import"./chunk-5BGWNYQS.js";import"./chunk-VDJSH3DQ.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-HJXSEPO7.js";import"./chunk-P7FUD4WY.js";import"./chunk-S7E2D5K7.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as createExactTextAnchorResolver,c as findExactTextMatches,b as resolveExactTextAnchor};
package/dist/entry-65.js CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-WEE3NM6L.js";import"./chunk-QJ6V5IAY.js";import"./chunk-5BGWNYQS.js";import"./chunk-GXL4NMHR.js";import"./chunk-PQWANILR.js";import"./chunk-DDH3FP4G.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as default};
1
+ import{a}from"./chunk-YOJHCARZ.js";import"./chunk-HJXSEPO7.js";import"./chunk-P7FUD4WY.js";import"./chunk-YZTVC7ME.js";import"./chunk-VDSSAP6Y.js";import"./chunk-SIYPD5MM.js";import"./chunk-S7E2D5K7.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as default};
package/dist/entry-66.js CHANGED
@@ -1 +1 @@
1
- import{a,b,c,d,e}from"./chunk-UD3DMY3Q.js";import"./chunk-VDJSH3DQ.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-FGN2ZMEN.js";import"./chunk-S7E2D5K7.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-67.js CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-C2JT2G5K.js";import"./chunk-UD3DMY3Q.js";import"./chunk-GXL4NMHR.js";import"./chunk-PQWANILR.js";import"./chunk-BU7IZLKB.js";import"./chunk-S5PL5DFQ.js";import"./chunk-DDH3FP4G.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as default};
1
+ import{a}from"./chunk-TWQ6ACOI.js";import"./chunk-FGN2ZMEN.js";import"./chunk-YZTVC7ME.js";import"./chunk-VDSSAP6Y.js";import"./chunk-2DSY4U73.js";import"./chunk-H6FEBUAP.js";import"./chunk-SIYPD5MM.js";import"./chunk-S7E2D5K7.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as default};
package/dist/entry-69.js CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-GXL4NMHR.js";import"./chunk-PQWANILR.js";import"./chunk-DDH3FP4G.js";import"./chunk-VDJSH3DQ.js";import"./chunk-EI7MMDWY.js";export{a as connectTextEditorPlugin};
1
+ import{a}from"./chunk-YZTVC7ME.js";import"./chunk-VDSSAP6Y.js";import"./chunk-SIYPD5MM.js";import"./chunk-S7E2D5K7.js";import"./chunk-EI7MMDWY.js";export{a as connectTextEditorPlugin};
package/dist/entry-72.js CHANGED
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk-PQWANILR.js";import"./chunk-DDH3FP4G.js";import"./chunk-VDJSH3DQ.js";import"./chunk-EI7MMDWY.js";export{d as TEXT_EDITOR_API_VERSION,g as TEXT_EDITOR_CORE_READY_EVENT,h as TEXT_EDITOR_PLUGIN_REGISTER_EVENT,c as TEXT_EDITOR_PROTOCOL,e as TEXT_POSITION_ANCHOR_KIND,f as TEXT_SEARCH_ANCHOR_KIND,j as isResourceResolverRegistration,k as isTextAnchorResolverRegistration,l as isTextAnchorResourceResolutionAttempt,m as isTextEditorCoreReady,n as isTextEditorPlugin,o as isTextEditorPluginRegistrationRequest,i as isTextEditorToolId,b as localFileTransferAccess,a as snapshotLocalObjects};
1
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk-VDSSAP6Y.js";import"./chunk-SIYPD5MM.js";import"./chunk-S7E2D5K7.js";import"./chunk-EI7MMDWY.js";export{d as TEXT_EDITOR_API_VERSION,g as TEXT_EDITOR_CORE_READY_EVENT,h as TEXT_EDITOR_PLUGIN_REGISTER_EVENT,c as TEXT_EDITOR_PROTOCOL,e as TEXT_POSITION_ANCHOR_KIND,f as TEXT_SEARCH_ANCHOR_KIND,j as isResourceResolverRegistration,k as isTextAnchorResolverRegistration,l as isTextAnchorResourceResolutionAttempt,m as isTextEditorCoreReady,n as isTextEditorPlugin,o as isTextEditorPluginRegistrationRequest,i as isTextEditorToolId,b as localFileTransferAccess,a as snapshotLocalObjects};
package/dist/entry-74.js CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-5BGWNYQS.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as TextSelectionAnchor};
1
+ import{a}from"./chunk-P7FUD4WY.js";import"./chunk-S7E2D5K7.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as TextSelectionAnchor};
package/dist/entry-75.js CHANGED
@@ -1 +1 @@
1
- import{a,d as b,g as c,h as d,i as e,j as f,k as g,l as h,m as i}from"./chunk-YPYROPQF.js";import"./chunk-PQWANILR.js";import"./chunk-DDH3FP4G.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.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};
1
+ import{a,d as b,g as c,h as d,i as e,j as f,k as g,l as h,m as i}from"./chunk-QGXZ4RWX.js";import"./chunk-VDSSAP6Y.js";import"./chunk-SIYPD5MM.js";import"./chunk-S7E2D5K7.js";import"./chunk-ZC65Z3CK.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-77.js CHANGED
@@ -1 +1 @@
1
- import{a,b,d as c}from"./chunk-5S74Z6Y4.js";import{a as d,b as e,d as f}from"./chunk-GS5ZRTUG.js";import"./chunk-DDH3FP4G.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{b as FileMutationResult,a as FileRange,c as computeChangedRanges,d as mutationDataSchema,e as mutationResultSchema,f as structuredMutation};
1
+ import{a,b,e as c}from"./chunk-N2NEFXHB.js";import{a as d,b as e,d as f}from"./chunk-KQV2ZXLP.js";import"./chunk-SIYPD5MM.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{b as FileMutationResult,a as FileRange,c as computeChangedRanges,d as mutationDataSchema,e as mutationResultSchema,f as structuredMutation};
package/dist/entry-79.js CHANGED
@@ -1 +1 @@
1
- import{a,b,c,d}from"./chunk-FEZLTM4L.js";import"./chunk-EI7MMDWY.js";export{c as assertTextMutationToolRegistration,a as isMutationAnchorValue,d as mutationSource,b as withoutEmptyOptionalAnchors};
1
+ import{a,b,c,d}from"./chunk-UDVVKVG4.js";import"./chunk-EI7MMDWY.js";export{c as assertTextMutationToolRegistration,a as isMutationAnchorValue,d as mutationSource,b as withoutEmptyOptionalAnchors};
package/dist/entry-8.js CHANGED
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q}from"./chunk-7D7PXIVV.js";import"./chunk-BXGMMZT3.js";import"./chunk-756K3LJY.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as TOOL_CONFIG_VERSION,b as configuredExecutableName,p as createConfiguredProcessEnvironment,j as hasConfiguredExecutable,g as loadLayeredToolConfig,h as matchesConfiguredFile,n as parseFormattersConfig,o as parseLintersConfig,d as projectIdeConfigDirectory,e as projectIdeConfigPath,q as recipeMatchesFile,c as resolveExternalToolProjectRoot,f as resolveToolConfigPaths,m as runConfiguredFormatter,l as runConfiguredProcess,i as selectConfiguredEntry,k as toolRuntimeEvidence};
1
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q}from"./chunk-S3T5NOSL.js";import"./chunk-BXGMMZT3.js";import"./chunk-756K3LJY.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as TOOL_CONFIG_VERSION,b as configuredExecutableName,p as createConfiguredProcessEnvironment,j as hasConfiguredExecutable,g as loadLayeredToolConfig,h as matchesConfiguredFile,n as parseFormattersConfig,o as parseLintersConfig,d as projectIdeConfigDirectory,e as projectIdeConfigPath,q as recipeMatchesFile,c as resolveExternalToolProjectRoot,f as resolveToolConfigPaths,m as runConfiguredFormatter,l as runConfiguredProcess,i as selectConfiguredEntry,k as toolRuntimeEvidence};
package/dist/entry-82.js CHANGED
@@ -1 +1 @@
1
- import{a as b,b as c}from"./chunk-6WCHBHFW.js";import{c as a}from"./chunk-XH5WN5XA.js";import"./chunk-GS5ZRTUG.js";import"./chunk-PS2B6THP.js";import"./chunk-DDH3FP4G.js";import"./chunk-EI7MMDWY.js";export{a as getToolCallInterception,c as registerToolCallAnnotationSink,b as registerToolCallInterceptor};
1
+ import{a as b,b as c}from"./chunk-EWTVVPUA.js";import{c as a}from"./chunk-JXULBI4S.js";import"./chunk-KQV2ZXLP.js";import"./chunk-PS2B6THP.js";import"./chunk-SIYPD5MM.js";import"./chunk-EI7MMDWY.js";export{a as getToolCallInterception,c as registerToolCallAnnotationSink,b as registerToolCallInterceptor};
package/dist/entry-84.js CHANGED
@@ -1 +1 @@
1
- import{a as d,b as a,c as s,d as m}from"./chunk-HISGZD3C.js";import"./chunk-J34VKQGJ.js";import"./chunk-YHADTHQM.js";import"./chunk-6WCHBHFW.js";import"./chunk-MXLSGMRZ.js";import"./chunk-FEZLTM4L.js";import"./chunk-STUZZM5B.js";import"./chunk-5BGWNYQS.js";import"./chunk-XH5WN5XA.js";import"./chunk-YGGKGZO2.js";import"./chunk-5S74Z6Y4.js";import"./chunk-GS5ZRTUG.js";import{f as o,g as n}from"./chunk-KN6VPARZ.js";import"./chunk-52PFWQMU.js";import"./chunk-PS2B6THP.js";import"./chunk-YPYROPQF.js";import"./chunk-PQWANILR.js";import"./chunk-BU7IZLKB.js";import"./chunk-S5PL5DFQ.js";import"./chunk-DDH3FP4G.js";import{c as r}from"./chunk-RQ7JJ7GV.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import{a as t}from"./chunk-EI7MMDWY.js";import{Type as f}from"typebox";function p(e){e.registerTool({name:"edit",label:"edit",description:"",exposure:"hidden",parameters:f.Object({},{additionalProperties:!1}),execute(){throw new Error("Hidden edit must never execute.")}})}t(p,"hideBuiltinEdit");async function g(e){r(e),n(e,[await o({id:"editing",description:"Precise standalone text and file edits",triggers:["write","replace","insert","delete","copy","move","diff"].map(c=>({tool:c}))})]);let i=await s(e);p(e),m(e,i),a(e,i),d(e,i)}t(g,"registerTextEditor");export{g as default};
1
+ import{a as d,b as a,c as s,d as m}from"./chunk-J6CDIH3S.js";import"./chunk-J34VKQGJ.js";import"./chunk-YHADTHQM.js";import"./chunk-EWTVVPUA.js";import"./chunk-MXLSGMRZ.js";import"./chunk-UDVVKVG4.js";import"./chunk-STUZZM5B.js";import"./chunk-P7FUD4WY.js";import"./chunk-JXULBI4S.js";import"./chunk-YGGKGZO2.js";import"./chunk-N2NEFXHB.js";import"./chunk-KQV2ZXLP.js";import{f as o,g as n}from"./chunk-KN6VPARZ.js";import"./chunk-C2GZLLSP.js";import"./chunk-PS2B6THP.js";import"./chunk-QGXZ4RWX.js";import"./chunk-VDSSAP6Y.js";import"./chunk-2DSY4U73.js";import"./chunk-H6FEBUAP.js";import"./chunk-SIYPD5MM.js";import{c as r}from"./chunk-RQ7JJ7GV.js";import"./chunk-S7E2D5K7.js";import"./chunk-ZC65Z3CK.js";import{a as t}from"./chunk-EI7MMDWY.js";import{Type as f}from"typebox";function p(e){e.registerTool({name:"edit",label:"edit",description:"",exposure:"hidden",parameters:f.Object({},{additionalProperties:!1}),execute(){throw new Error("Hidden edit must never execute.")}})}t(p,"hideBuiltinEdit");async function g(e){r(e),n(e,[await o({id:"editing",description:"Precise standalone text and file edits",triggers:["write","replace","insert","delete","copy","move","diff"].map(c=>({tool:c}))})]);let i=await s(e);p(e),m(e,i),a(e,i),d(e,i)}t(g,"registerTextEditor");export{g as default};
package/dist/entry-85.js CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-MJFY4RGT.js";import"./chunk-XH5WN5XA.js";import"./chunk-WES2E4VR.js";import"./chunk-5S74Z6Y4.js";import"./chunk-GS5ZRTUG.js";import"./chunk-PS2B6THP.js";import"./chunk-YPYROPQF.js";import"./chunk-GXL4NMHR.js";import"./chunk-PQWANILR.js";import"./chunk-DDH3FP4G.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as default};
1
+ import{a}from"./chunk-WCSWQDJ2.js";import"./chunk-JXULBI4S.js";import"./chunk-33U3RUM3.js";import"./chunk-N2NEFXHB.js";import"./chunk-KQV2ZXLP.js";import"./chunk-PS2B6THP.js";import"./chunk-QGXZ4RWX.js";import"./chunk-YZTVC7ME.js";import"./chunk-VDSSAP6Y.js";import"./chunk-SIYPD5MM.js";import"./chunk-S7E2D5K7.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as default};
package/dist/entry-86.js CHANGED
@@ -1,2 +1,2 @@
1
- import{b as v}from"./chunk-YHADTHQM.js";import{a as x}from"./chunk-6WCHBHFW.js";import{a as D}from"./chunk-MXLSGMRZ.js";import{a as P}from"./chunk-FEZLTM4L.js";import"./chunk-XH5WN5XA.js";import"./chunk-GS5ZRTUG.js";import"./chunk-PS2B6THP.js";import{a as _}from"./chunk-GXL4NMHR.js";import{c as O,d as b}from"./chunk-PQWANILR.js";import{a as C}from"./chunk-BU7IZLKB.js";import{a as w,b as k}from"./chunk-S5PL5DFQ.js";import{N as M}from"./chunk-DDH3FP4G.js";import"./chunk-VDJSH3DQ.js";import{a as S}from"./chunk-ZC65Z3CK.js";import{a as R}from"./chunk-EI7MMDWY.js";var E="\0",H="";async function V(t){let o,n={protocol:w,apiVersion:k,id:"text-editor-stale-anchor",setup(i){o=i}},c={protocol:O,apiVersion:b,id:"text-editor-stale-anchor",setup(i){let a=j(t,i,()=>{if(o===void 0)throw new Error("pi-agent-read is unavailable");return o});x(t,a.handler),i.onMutationTool(a.add)}};await Promise.all([C(t,n),_(t,c)])}R(V,"registerTextEditorStaleAnchor");function j(t,o,n){let c=M(t),i=new Map,a=[],f=new Map,d=new Map,g=new Map,l={name:"text-editor-stale-anchor-inspection",blockExecution:!0,toolNames:a,async intercept(e){let s=i.get(e.toolCall.name);if(s===void 0)return;let r=e.partialArgs??e.args;try{for(let u of[s.source.field,...(s.source.targets??[]).map(p=>p.field)]){let p=r[u],m=c.source(p,e.cwd);if(m!==p||typeof m=="string"&&m.startsWith("RESULT#"))return}}catch{return}let h=B(r,e,f,s.source.field,s.source.inherited?v(t)?.source:void 0);if(h===void 0)return;let A=await L(o,n(),e,s,r,h,d,g);if(A!==void 0)return A;let I=s.pair?.every(u=>{let p=s.anchors?.find(m=>m.field===u);return p!==void 0&&P(p,r[u])})===!0?new Set(s.pair):new Set;for(let u of s.anchors??[]){if(I.has(u.field))continue;let p=r[u.field];if(!P(u,p))continue;let m=r[u.sourceField],T=typeof m=="string"?m:h,y=await $(o,n(),e,u.field,T,[p],[u.kinds],d,g);if(y!==void 0)return y}},onContentEnd(e){d.delete(e),g.delete(e)},onAbort(e){d.delete(e),g.delete(e),f.delete(e)},onAgentEnd(){d.clear(),g.clear(),f.clear()}};return{handler:l,add(e){(e.anchors?.length??0)>0&&(i.set(e.name,e),a.push(e.name),x(t,l))}}}R(j,"createHandler");function B(t,o,n,c,i){let a=t[c];if(typeof a=="string")return o.contentIndex!==void 0&&n.set(o.contentIndex,a),a;if(o.contentIndex!==void 0)for(let f=o.contentIndex-1;f>=0;f-=1){let d=n.get(f);if(d!==void 0)return t[c]=d,d}return i!==void 0&&(t[c]=i),i}R(B,"resolveSource");async function L(t,o,n,c,i,a,f,d){if(c.pair===void 0)return;let[g,l]=c.pair,e=i[g],s=i[l];if(typeof e!="string"||typeof s!="string")return;let r=c.anchors?.find(({field:A})=>A===g),h=c.anchors?.find(({field:A})=>A===l);if(!(r===void 0||h===void 0)&&!(!P(r,e)||!P(h,s)))return $(t,o,n,l,a,[e,s],[r.kinds,h.kinds],f,d)}R(L,"inspectAnchorPair");async function $(t,o,n,c,i,a,f,d,g){let l=n.contentIndex??-1,e=`${i}${E}${a.join(E)}${E}${f.map(T=>T.join(H)).join(E)}`,s=g.get(l)?.get(e);if(s!==void 0)return s;let r=d.get(l)?.get(e);if(r===void 0){let T=await t.inspectTextAnchors({source:i,anchors:a,kinds:f,cwd:n.cwd,...n.signal!==void 0&&{signal:n.signal}}),y=d.get(l)??new Map;y.set(e,T),d.set(l,y),r=T}if(r.kind==="valid")return;if(r.kind==="failed")return N(n.toolCall.name,i,r.reason);if(r.rejectionCode!=="stale")return;let h=r.anchorIndex,I=(r.contextRange===void 0?void 0:await o.read({path:i,views:["anchors"],...r.contextRange},{cwd:n.cwd,...n.signal!==void 0&&{signal:n.signal}}))?.content.filter(T=>T.type==="text").map(T=>T.text).join(`
1
+ import{b as v}from"./chunk-YHADTHQM.js";import{a as x}from"./chunk-EWTVVPUA.js";import{a as D}from"./chunk-MXLSGMRZ.js";import{a as P}from"./chunk-UDVVKVG4.js";import"./chunk-JXULBI4S.js";import"./chunk-KQV2ZXLP.js";import"./chunk-PS2B6THP.js";import{a as _}from"./chunk-YZTVC7ME.js";import{c as O,d as b}from"./chunk-VDSSAP6Y.js";import{a as C}from"./chunk-2DSY4U73.js";import{a as w,b as k}from"./chunk-H6FEBUAP.js";import{N as M}from"./chunk-SIYPD5MM.js";import"./chunk-S7E2D5K7.js";import{a as S}from"./chunk-ZC65Z3CK.js";import{a as R}from"./chunk-EI7MMDWY.js";var E="\0",H="";async function V(t){let o,n={protocol:w,apiVersion:k,id:"text-editor-stale-anchor",setup(i){o=i}},c={protocol:O,apiVersion:b,id:"text-editor-stale-anchor",setup(i){let a=j(t,i,()=>{if(o===void 0)throw new Error("pi-agent-read is unavailable");return o});x(t,a.handler),i.onMutationTool(a.add)}};await Promise.all([C(t,n),_(t,c)])}R(V,"registerTextEditorStaleAnchor");function j(t,o,n){let c=M(t),i=new Map,a=[],f=new Map,d=new Map,g=new Map,l={name:"text-editor-stale-anchor-inspection",blockExecution:!0,toolNames:a,async intercept(e){let s=i.get(e.toolCall.name);if(s===void 0)return;let r=e.partialArgs??e.args;try{for(let u of[s.source.field,...(s.source.targets??[]).map(p=>p.field)]){let p=r[u],m=c.source(p,e.cwd);if(m!==p||typeof m=="string"&&m.startsWith("RESULT#"))return}}catch{return}let h=B(r,e,f,s.source.field,s.source.inherited?v(t)?.source:void 0);if(h===void 0)return;let A=await L(o,n(),e,s,r,h,d,g);if(A!==void 0)return A;let I=s.pair?.every(u=>{let p=s.anchors?.find(m=>m.field===u);return p!==void 0&&P(p,r[u])})===!0?new Set(s.pair):new Set;for(let u of s.anchors??[]){if(I.has(u.field))continue;let p=r[u.field];if(!P(u,p))continue;let m=r[u.sourceField],T=typeof m=="string"?m:h,y=await $(o,n(),e,u.field,T,[p],[u.kinds],d,g);if(y!==void 0)return y}},onContentEnd(e){d.delete(e),g.delete(e)},onAbort(e){d.delete(e),g.delete(e),f.delete(e)},onAgentEnd(){d.clear(),g.clear(),f.clear()}};return{handler:l,add(e){(e.anchors?.length??0)>0&&(i.set(e.name,e),a.push(e.name),x(t,l))}}}R(j,"createHandler");function B(t,o,n,c,i){let a=t[c];if(typeof a=="string")return o.contentIndex!==void 0&&n.set(o.contentIndex,a),a;if(o.contentIndex!==void 0)for(let f=o.contentIndex-1;f>=0;f-=1){let d=n.get(f);if(d!==void 0)return t[c]=d,d}return i!==void 0&&(t[c]=i),i}R(B,"resolveSource");async function L(t,o,n,c,i,a,f,d){if(c.pair===void 0)return;let[g,l]=c.pair,e=i[g],s=i[l];if(typeof e!="string"||typeof s!="string")return;let r=c.anchors?.find(({field:A})=>A===g),h=c.anchors?.find(({field:A})=>A===l);if(!(r===void 0||h===void 0)&&!(!P(r,e)||!P(h,s)))return $(t,o,n,l,a,[e,s],[r.kinds,h.kinds],f,d)}R(L,"inspectAnchorPair");async function $(t,o,n,c,i,a,f,d,g){let l=n.contentIndex??-1,e=`${i}${E}${a.join(E)}${E}${f.map(T=>T.join(H)).join(E)}`,s=g.get(l)?.get(e);if(s!==void 0)return s;let r=d.get(l)?.get(e);if(r===void 0){let T=await t.inspectTextAnchors({source:i,anchors:a,kinds:f,cwd:n.cwd,...n.signal!==void 0&&{signal:n.signal}}),y=d.get(l)??new Map;y.set(e,T),d.set(l,y),r=T}if(r.kind==="valid")return;if(r.kind==="failed")return N(n.toolCall.name,i,r.reason);if(r.rejectionCode!=="stale")return;let h=r.anchorIndex,I=(r.contextRange===void 0?void 0:await o.read({path:i,views:["anchors"],...r.contextRange},{cwd:n.cwd,...n.signal!==void 0&&{signal:n.signal}}))?.content.filter(T=>T.type==="text").map(T=>T.text).join(`
2
2
  `),u={guardId:"stale-anchor",effect:"not-applied",toolName:n.toolCall.name,field:c,path:i,anchor:S(a[h]),...!(I===void 0||I.length===0)&&{context:I}},p=Y(u,r.reason),m=g.get(l)??new Map;return m.set(e,p),g.set(l,m),p}R($,"inspectAnchors");function N(t,o,n){return{annotation:{kind:"blocked",reason:n},message:{customType:"text-editor-resolver-block",content:`[SYSTEM] ${t} blocked: ${n}`,display:!1,details:{guardId:"resolver",effect:"not-applied",toolName:t,source:o,reason:n}}}}R(N,"makeResolverBlockResult");function Y(t,o){return{annotation:{kind:"stale-anchor"},message:{customType:"text-editor-stale-anchor-block",content:D(t,o),display:!1,details:t}}}R(Y,"makeBlockResult");export{V as default};
package/dist/entry-87.js CHANGED
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g,h}from"./chunk-XH5WN5XA.js";import"./chunk-PS2B6THP.js";import"./chunk-EI7MMDWY.js";export{b as TOOL_CALL_INTERCEPTION_ANCHOR_RENDER_PATCH,a as TOOL_CALL_INTERCEPTION_DETAILS_KEY,f as ToolCallInterceptionRenderStore,c as getToolCallInterception,h as isToolCallAnnotation,e as withBlockedToolResult,d as withToolCallInterceptionDetails,g as withToolCallInterceptionRendering};
1
+ import{a,b,c,d,e,f,g,h}from"./chunk-JXULBI4S.js";import"./chunk-PS2B6THP.js";import"./chunk-EI7MMDWY.js";export{b as TOOL_CALL_INTERCEPTION_ANCHOR_RENDER_PATCH,a as TOOL_CALL_INTERCEPTION_DETAILS_KEY,f as ToolCallInterceptionRenderStore,c as getToolCallInterception,h as isToolCallAnnotation,e as withBlockedToolResult,d as withToolCallInterceptionDetails,g as withToolCallInterceptionRendering};
package/dist/entry-90.js CHANGED
@@ -1 +1 @@
1
- import{b as a,c as b}from"./chunk-MPNE25CY.js";import"./chunk-NNCZYO4Q.js";import"./chunk-FYOU4RBH.js";import"./chunk-7PVDTMEM.js";import"./chunk-47SPPIXK.js";import"./chunk-VAXLSPPU.js";import"./chunk-MDD5ORB6.js";import"./chunk-MLFJU2US.js";import"./chunk-OMNKD7WW.js";import"./chunk-PS2B6THP.js";import"./chunk-BU7IZLKB.js";import"./chunk-S5PL5DFQ.js";import"./chunk-DDH3FP4G.js";import"./chunk-756K3LJY.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as default,b as registerWebWithOwner};
1
+ import{b as a,c as b}from"./chunk-BRJIXNFU.js";import"./chunk-NNCZYO4Q.js";import"./chunk-HFCHOFLV.js";import"./chunk-5AROEOJB.js";import"./chunk-47SPPIXK.js";import"./chunk-VAXLSPPU.js";import"./chunk-2YO6RVX4.js";import"./chunk-MLFJU2US.js";import"./chunk-LY2UANKU.js";import"./chunk-PS2B6THP.js";import"./chunk-2DSY4U73.js";import"./chunk-H6FEBUAP.js";import"./chunk-SIYPD5MM.js";import"./chunk-756K3LJY.js";import"./chunk-S7E2D5K7.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as default,b as registerWebWithOwner};
package/dist/entry-91.js CHANGED
@@ -1,3 +1,3 @@
1
- import{J as c}from"./chunk-DDH3FP4G.js";import{a as r}from"./chunk-EI7MMDWY.js";import{parseHTML as g}from"linkedom";async function d(t,n,e=p){try{let o=await e(t,n);return{content:o.content.trim(),title:o.title.trim(),usedFallback:!1}}catch{return{...b(t,n),usedFallback:!0}}}r(d,"extractReadableHtml");async function p(t,n){let e=u(t,n),{Defuddle:o}=await import("defuddle/node"),i=await o(e,n,{markdown:!0,useAsync:!1});return{content:i.content,title:i.title}}r(p,"extractWithDefuddle");function b(t,n){let e=u(t,n);for(let a of e.querySelectorAll("script, style, nav, footer, header, aside, noscript, template"))a.remove();let o=e.querySelector("article, main")??e.body??e.documentElement,i=s(o?.textContent??""),l=s(e.querySelector("title")?.textContent??"");return{content:i,title:l}}r(b,"extractPlainText");function u(t,n){let e=g(t);try{Object.defineProperty(e.document,"location",{value:new URL(n),configurable:!0})}catch{}return e.document}r(u,"parseDocument");function s(t){return t.replace(/\s+/gu," ").trim()}r(s,"normalizeWhitespace");var x=new Set(["application/xhtml+xml","text/html"]),w=/^\u{FEFF}?\s*(?:<!doctype\s+html\b|<(?:article|body|head|html)\b)/iu;function f(){return{id:"html",description:"Web page \u2014 readable page text.",async tryConvert(t,n){if(!E(t.bytes,t.mediaType))return{kind:"not-handled"};let e=m(n.signal);if(e!==void 0)return{kind:"failed",error:e};let o;try{o=new TextDecoder("utf8",{fatal:!0}).decode(t.bytes)}catch(y){return{kind:"failed",error:new TypeError(`${t.source} is not valid UTF-8 HTML`,{cause:y})}}let i=await d(o,t.source),l=m(n.signal);return l!==void 0?{kind:"failed",error:l}:{kind:"converted",content:[{type:"text",text:i.title.length===0?i.content:i.content.length===0?`# ${i.title}`:`# ${i.title}
1
+ import{J as c}from"./chunk-SIYPD5MM.js";import{a as r}from"./chunk-EI7MMDWY.js";import{parseHTML as g}from"linkedom";async function d(t,n,e=p){try{let o=await e(t,n);return{content:o.content.trim(),title:o.title.trim(),usedFallback:!1}}catch{return{...b(t,n),usedFallback:!0}}}r(d,"extractReadableHtml");async function p(t,n){let e=u(t,n),{Defuddle:o}=await import("defuddle/node"),i=await o(e,n,{markdown:!0,useAsync:!1});return{content:i.content,title:i.title}}r(p,"extractWithDefuddle");function b(t,n){let e=u(t,n);for(let a of e.querySelectorAll("script, style, nav, footer, header, aside, noscript, template"))a.remove();let o=e.querySelector("article, main")??e.body??e.documentElement,i=s(o?.textContent??""),l=s(e.querySelector("title")?.textContent??"");return{content:i,title:l}}r(b,"extractPlainText");function u(t,n){let e=g(t);try{Object.defineProperty(e.document,"location",{value:new URL(n),configurable:!0})}catch{}return e.document}r(u,"parseDocument");function s(t){return t.replace(/\s+/gu," ").trim()}r(s,"normalizeWhitespace");var x=new Set(["application/xhtml+xml","text/html"]),w=/^\u{FEFF}?\s*(?:<!doctype\s+html\b|<(?:article|body|head|html)\b)/iu;function f(){return{id:"html",description:"Web page \u2014 readable page text.",async tryConvert(t,n){if(!E(t.bytes,t.mediaType))return{kind:"not-handled"};let e=m(n.signal);if(e!==void 0)return{kind:"failed",error:e};let o;try{o=new TextDecoder("utf8",{fatal:!0}).decode(t.bytes)}catch(y){return{kind:"failed",error:new TypeError(`${t.source} is not valid UTF-8 HTML`,{cause:y})}}let i=await d(o,t.source),l=m(n.signal);return l!==void 0?{kind:"failed",error:l}:{kind:"converted",content:[{type:"text",text:i.title.length===0?i.content:i.content.length===0?`# ${i.title}`:`# ${i.title}
2
2
 
3
3
  ${i.content}`}]}}}}r(f,"createHtmlContentConverter");function E(t,n){if(n!==void 0){let o=n.split(";",1)[0]?.trim().toLowerCase()??"";if(x.has(o))return!0}let e=new TextDecoder("utf8").decode(t.subarray(0,1024));return w.test(e)}r(E,"isHtmlInput");function m(t){if(t?.aborted===!0)return t.reason instanceof Error?t.reason:C()}r(m,"cancellationError");function C(){let t=new Error("The operation was aborted");return t.name="AbortError",t}r(C,"abortError");var h={target:{provider:"web",capability:"read"},converter:f(),priority:200};async function H(t){await c(t,h)}r(H,"registerWebHtml");export{H as default};
package/dist/entry-92.js CHANGED
@@ -1 +1 @@
1
- import{a as r}from"./chunk-XE4W5YTE.js";import{J as e}from"./chunk-DDH3FP4G.js";import{a as t}from"./chunk-EI7MMDWY.js";var n={target:{provider:"web",capability:"read"},converter:r(),priority:100};async function i(o){await e(o,n)}t(i,"registerWebImage");export{i as default};
1
+ import{a as r}from"./chunk-XE4W5YTE.js";import{J as e}from"./chunk-SIYPD5MM.js";import{a as t}from"./chunk-EI7MMDWY.js";var n={target:{provider:"web",capability:"read"},converter:r(),priority:100};async function i(o){await e(o,n)}t(i,"registerWebImage");export{i as default};
package/dist/entry-93.js CHANGED
@@ -1 +1 @@
1
- import{a as r}from"./chunk-UGWRUW77.js";import{J as e}from"./chunk-DDH3FP4G.js";import{a as t}from"./chunk-EI7MMDWY.js";var n={target:{provider:"web",capability:"read"},converter:r(),priority:200};async function i(o){await e(o,n)}t(i,"registerWebPdf");export{i as default};
1
+ import{a as r}from"./chunk-UGWRUW77.js";import{J as e}from"./chunk-SIYPD5MM.js";import{a as t}from"./chunk-EI7MMDWY.js";var n={target:{provider:"web",capability:"read"},converter:r(),priority:200};async function i(o){await e(o,n)}t(i,"registerWebPdf");export{i as default};
package/dist/entry-94.js CHANGED
@@ -1 +1 @@
1
- import{J as e}from"./chunk-DDH3FP4G.js";import{p as r}from"./chunk-VDJSH3DQ.js";import{a as t}from"./chunk-EI7MMDWY.js";var n={target:{provider:"web",capability:"read"},converter:r(),priority:300};async function i(o){await e(o,n)}t(i,"registerWebText");export{i as default};
1
+ import{J as e}from"./chunk-SIYPD5MM.js";import{p as r}from"./chunk-S7E2D5K7.js";import{a as t}from"./chunk-EI7MMDWY.js";var n={target:{provider:"web",capability:"read"},converter:r(),priority:300};async function i(o){await e(o,n)}t(i,"registerWebText");export{i as default};
@@ -1,5 +1,5 @@
1
- import{a as Ce,b as _e}from"./chunk-OTVNO5SX.js";import{a as Te,b as Re}from"./chunk-LLP3EIJL.js";import{a as z,b as J,c as V,d as X,e as $,f as B}from"./chunk-XHFAV2NI.js";import{a as Pe}from"./chunk-AVJVTF5H.js";import"./chunk-57F5GTHO.js";import{a as ye}from"./chunk-H5Z54BEU.js";import{f as te}from"./chunk-WES2E4VR.js";import{a as we}from"./chunk-YGGKGZO2.js";import"./chunk-5S74Z6Y4.js";import"./chunk-GS5ZRTUG.js";import"./chunk-MPT3R4BL.js";import{g as be}from"./chunk-KN6VPARZ.js";import"./chunk-BU7IZLKB.js";import"./chunk-S5PL5DFQ.js";import"./chunk-DDH3FP4G.js";import{a as ne,b as ve,c as Ee}from"./chunk-TSQ6FBTB.js";import{a as Ie,b as xe,c as Se,e as oe,f as Ae}from"./chunk-OJEIX7OZ.js";import{c as he}from"./chunk-RQ7JJ7GV.js";import"./chunk-ZC65Z3CK.js";import{a as r}from"./chunk-EI7MMDWY.js";var ie={"ide.core":["IDE services","Shared services used by language, formatting and diagnostic modules."],"ide.tips":["Getting started tips","Show contextual guidance while setting up a project."],"ide.documentation":["Progressive agent documentation","Expose packaged guides and attach them on first relevant tool use."],"ide.doctor":["Setup doctor","Check external tools and help configure project support."],"ide.languages":["Language setup","Discover languages and their recommended toolchains."],"ide.processes":["Agent IDE processes","Show active terminal and debugger sessions in one shared process surface."],"ide.debugger":["Debugger sessions","Debug local programs through addressable DAP sessions and anchored breakpoints."],"ide.terminal":["Terminal sessions","Run and manage local interactive and background terminal processes."],"read.core":["Read tools","Read sources through the configured readers and views."],"read.filesystem":["Local files","Resolve files and folders from the local filesystem."],"read.ssh":["SSH files","Read and edit configured SSH file sources through existing tools."],"read.filesystem.jq":["JSON queries","Query local JSON files through jq read views."],"read.filesystem.image":["Local images","Read local images as visual content."],"read.filesystem.pdf":["Local PDFs","Extract readable content from local PDF documents."],"read.filesystem.text":["Local text","Read local text files with their source coordinates."],"read.web":["Web sources","Read remote sources over HTTP and HTTPS."],"read.web.html":["Web pages","Extract readable content from HTML pages."],"read.web.image":["Web images","Read remote images as visual content."],"read.web.pdf":["Web PDFs","Extract text from remote PDF documents."],"read.web.text":["Web text","Read remote plain-text sources."],"search.core":["Search tools","Run searches through the configured search providers."],"search.text":["Text search","Find text and files and register reusable search selections."],"search.semantic":["Optional semantic search","Search indexed project code by meaning using the selected engine."],"editor.core":["Editing tools","Make guarded text and whole-file changes, directly or through native Codemode."],"editor.renderer":["Edit previews","Display changes in the shared colored diff panels."],"editor.anchor.constant":["File boundary selectors","Use begin and end to select file boundaries."],"editor.anchor.line-hash":["Checked line selectors","Select lines with hashes that detect stale content."],"editor.anchor.exact":["Exact text selectors","Locate edit ranges using unique source text."],"editor.stale-anchor":["Stale selection recovery","Provide recovery guidance when an edit selection is outdated."],"ide.ast":["Structural code support","Read code outlines and search or edit exact syntax-tree nodes."],"ide.formatter":["Code formatting","Run configured formatters after edits."],"ide.lint":["Lint checks","Run configured linters and collect their findings."],"ide.changes":["Git changes","Inspect and manage uncommitted changes and undo history."],"ide.lsp":["Language servers","Resolve symbols, rename references and collect language-server diagnostics."],"ide.diagnostics":["Diagnostic views","Show diagnostic findings through read views and sources."]};var M=[T("ide.core",()=>import("./chunk-2TTSJOLO.js")),T("ide.tips",()=>import("./chunk-BB4A5UI3.js")),T("ide.doctor",()=>import("./chunk-UI4KSKS3.js")),T("ide.languages",()=>import("./entry-42.js"),["ide.doctor"]),T("read.core",()=>import("./entry-52.js")),T("ide.documentation",async()=>{let{default:e}=await import("./chunk-LXDF2NWX.js");return{default:r(t=>e(t),"default")}},["read.core"]),T("read.filesystem",()=>import("./entry-31.js"),["read.core","editor.core"]),T("read.ssh",()=>import("./chunk-6P7LTQZT.js"),["read.filesystem"]),T("read.filesystem.jq",()=>import("./entry-34.js"),["read.filesystem","ide.documentation","ide.doctor"]),T("read.filesystem.image",()=>import("./entry-32.js"),["read.filesystem"]),T("read.filesystem.pdf",()=>import("./entry-35.js"),["read.filesystem"]),T("read.filesystem.text",()=>import("./entry-36.js"),["read.filesystem"]),T("read.web",()=>import("./chunk-AP2BOC24.js"),["read.core"]),T("read.web.html",()=>import("./entry-91.js"),["read.web"]),T("read.web.image",()=>import("./entry-92.js"),["read.web"]),T("read.web.pdf",()=>import("./entry-93.js"),["read.web"]),T("read.web.text",()=>import("./entry-94.js"),["read.web"]),T("search.core",()=>import("./entry-57.js")),T("search.semantic",()=>import("./chunk-7OUML24Z.js"),["search.core"]),T("search.text",()=>import("./entry-58.js"),["search.core"]),T("editor.renderer",()=>import("./entry-85.js"),["editor.core"]),T("editor.core",()=>import("./entry-84.js")),T("editor.anchor.constant",()=>import("./entry-63.js"),["read.core","editor.core"]),T("editor.anchor.line-hash",()=>import("./entry-67.js"),["read.core","editor.core"]),T("editor.anchor.exact",()=>import("./entry-65.js"),["editor.core"]),T("editor.stale-anchor",()=>import("./entry-86.js"),["editor.core"]),T("ide.ast",()=>import("./entry-38.js"),["ide.core","read.core","search.core","editor.core"]),T("ide.formatter",()=>import("./chunk-DAZQSXUW.js"),["ide.core"]),T("ide.lint",()=>import("./chunk-MKDOT76B.js"),["ide.core"]),T("ide.changes",()=>import("./chunk-GHO6TCPJ.js"),["ide.core","read.core","editor.core"]),T("ide.lsp",()=>import("./chunk-LIQ4BVOB.js"),["ide.core","read.core","search.core"]),T("ide.processes",()=>import("./chunk-CJPS4GXD.js")),T("ide.debugger",()=>import("./chunk-KWJD7FBS.js"),["ide.processes","read.core","editor.core"]),T("ide.terminal",()=>import("./chunk-U2N73BUY.js"),["ide.processes","read.core","search.core","editor.core","editor.anchor.constant"]),T("ide.diagnostics",()=>import("./chunk-T3Z4KXOX.js"),["ide.core","read.core"])];function T(e,t,a=[],d=!0){return{id:e,name:ie[e][0],description:ie[e][1],dependencies:a,async register(i,u){await(await t()).default(i,u)},...d?{}:{defaultEnabled:!1}}}r(T,"builtin");function K(e,t,a){return{kind:"choice",id:e,name:t,description:a,default:"compact",group:"ui",values:[{value:"full",label:"Full"},{value:"compact",label:"Compact"},{value:"disabled",label:"Disabled"}]}}r(K,"presentationPreference");var Z=[{kind:"choice",id:"search.semantic.engine",name:"Semantic search engine",description:"Choose the engine used by /semantic-index and semantic_search.",default:"colgrep",group:"features",values:[{value:"colgrep",label:"ColGREP"},{value:"vera",label:"Vera"}]},{kind:"choice",id:"ui.codemode",name:"Show tool results from Codemode",description:"Show extra Agent IDE result panels using each tool's presentation setting. Off hides successful panels; errors stay visible. Codemode's own output and other tools are unchanged.",default:"off",group:"ui",values:[{value:"off",label:"Off"},{value:"on",label:"On"}]},K("ui.diffs","Diffs","Choose how mutation and comparison diffs are displayed."),K("ui.read","Read","Choose how Read calls and results are displayed."),K("ui.search","Search","Choose how Search calls and results are displayed."),K("ui.terminal","Terminal","Choose how shell commands and terminal output are displayed."),{kind:"choice",id:"processes.activity",name:"Active Agent IDE processes",description:"Choose detailed process cards, a compact active count, or no persistent Agent IDE process UI.",default:"detailed",group:"ui",values:[{value:"detailed",label:"Detailed cards"},{value:"compact",label:"Compact count"},{value:"off",label:"Off"}]}];function Y(e,t,a=[]){let d=new Map;for(let p of e){if(d.has(p.id))throw new Error(`Duplicate Pi Agent IDE extension ID: ${p.id}`);d.set(p.id,p)}for(let p of e)for(let S of p.dependencies)if(!d.has(S))throw new Error(`Pi Agent IDE extension ${p.id} has unknown dependency ${S}`);let i=new Set;for(let p of t)d.has(p)&&i.add(p);for(let p of a)if(!d.has(p))throw new Error(`Unknown Pi Agent IDE extension ID in enabled: ${p}`);let u=at(d,a,i),c=new Set;for(let p of e)(p.defaultEnabled===!1&&!u.has(p.id)||i.has(p.id))&&c.add(p.id);let b=!0;for(;b;){b=!1;for(let p of e)c.has(p.id)||p.dependencies.every(S=>!c.has(S))||(c.add(p.id),b=!0)}return{enabled:e.filter(p=>!c.has(p.id)),disabled:c}}r(Y,"selectBuiltinExtensions");function at(e,t,a){let d=new Set,i=[...t];for(;i.length>0;){let u=i.pop();if(!(d.has(u)||a.has(u))){d.add(u);for(let c of e.get(u)?.dependencies??[])d.has(c)||i.push(c)}}return d}r(at,"collectForcedOn");import{Input as yt}from"@earendil-works/pi-tui";import{mkdir as dt,readFile as lt,writeFile as ct}from"node:fs/promises";import ut from"node:path";import{withFileMutationQueue as ft}from"@earendil-works/pi-coding-agent";async function ke(e,t,a=new Map,d=new Map,i){await ft(e,async()=>{let u=await B(e),c={};try{c=JSON.parse(await lt(e,"utf8"))}catch(m){if(!(m instanceof Error&&"code"in m&&m.code==="ENOENT"))throw m}let b=new Set(u.disabled),p=new Set(u.enabled);for(let[m,f]of t)b.delete(m),p.delete(m),f==="disabled"&&b.add(m),f==="enabled"&&p.add(m);let S={...u.preferences};for(let[m,f]of d)f===void 0?delete S[m]:S[m]=f;let A={...u.flags};for(let[m,f]of a)m==="pi-agent-ide-no-animations"&&delete c.noAnimations,m==="pi-agent-ide-no-post-processing"&&delete c.noPostProcessing,f===void 0?delete A[m]:A[m]=f;i===null&&delete c.preset,await dt(ut.dirname(e),{recursive:!0}),await ct(e,`${JSON.stringify({...c,disabled:[...b],enabled:[...p],...i==null?{}:{preset:i},...a.size>0?{flags:A}:{},...d.size>0?{preferences:S}:{}},null,2)}
2
- `)})}r(ke,"saveModuleChoices");import{getSettingsListTheme as pt}from"@earendil-works/pi-coding-agent";import{matchesKey as Q,SettingsList as gt,truncateToWidth as De,visibleWidth as Oe}from"@earendil-works/pi-tui";function Ne(e,t,a,d,i=""){let u=["extensions","behavior","ui"],c="extensions",b=r(w=>w==="extensions"?"modules":w==="behavior"?"features":"ui","itemKey"),p=r(w=>w==="extensions"?"modules":w==="behavior"?"features":"ui","changeKey"),S=r(()=>{let w=b(c),o=t()[w]??[];return new gt(o,12,pt(),(n,s)=>{a(p(c),n,s);for(let l of t()[w]??[]){let h=o.find(y=>y.id===l.id);h&&Object.assign(h,l)}},()=>d(!1),{enableSearch:!0})},"createList"),A=S(),m=r(w=>e.fg("borderMuted",w),"border"),f=r((w,o)=>{if(o<=1)return m("\u2502");let n=o-2,s=De(w,n);return`${m("\u2502")}${s}${" ".repeat(Math.max(0,n-Oe(s)))}${m("\u2502")}`},"row"),g=r(w=>m(w<=1?"\u251C":`\u251C${"\u2500".repeat(Math.max(0,w-2))}\u2524`),"rule");return{render(w){let o=Math.max(1,w),n=Math.max(1,o-4),s=` Agent IDE settings${i?` \xB7 ${i}`:""} `,l=o<=1?m("\u256D"):`${m("\u256D\u2500")}${e.fg("accent",e.bold(De(s,Math.max(0,o-3),"")))}${m(`${"\u2500".repeat(Math.max(0,o-Oe(s)-3))}\u256E`)}`,h={extensions:"Features",behavior:"Behavior",ui:"UI"},y=u.map(R=>R===c?e.fg("accent",e.bold(`[ ${h[R]} ]`)):e.fg("dim",` ${h[R]} `)).join(" "),I=A.render(n).map(R=>f(` ${R} `,o)),v=e.fg("dim"," Tab switch \xB7 Enter change \xB7 Ctrl+S save \xB7 Esc exit ");return[l,f(` ${y} `,o),g(o),...I,g(o),f(v,o),m(o<=1?"\u2570":`\u2570${"\u2500".repeat(Math.max(0,o-2))}\u256F`)]},invalidate(){A.invalidate()},handleInput(w){Q(w,"tab")||Q(w,"shift+tab")?(c=u[(u.indexOf(c)+(Q(w,"shift+tab")?2:1))%u.length]??"extensions",A=S()):Q(w,"ctrl+s")?d(!0):A.handleInput(w)}}}r(Ne,"createSettingsPanel");var mt=new Set(["pi-agent-ide-yolo","pi-agent-ide-filesystem-yolo","pi-agent-ide-no-post-processing","pi-agent-ide-no-animations","pi-agent-ide-code-review","pi-agent-ide-code-review-capture"]),ht=new Set(["search.semantic.engine","ui.codemode","ui.diffs","ui.read","ui.search","ui.terminal","processes.activity"]);function re(e){return!mt.has(e)}r(re,"flagRequiresReload");function se(e){return!ht.has(e)}r(se,"preferenceRequiresReload");function ae(e,t,a,d,i,u=new Set){let c=r(f=>Y(a,[...J(a,f.preset??"full"),...f.disabled],f.enabled).disabled,"selected"),b=c(e),p=c(t),S=a.filter(f=>b.has(f.id)!==p.has(f.id)).map(f=>f.name??f.id),A=$(e),m=$(t);for(let f of d)re(f.id)&&!u.has(f.id)&&(A[f.id]??f.default)!==(m[f.id]??f.default)&&S.push(f.name);for(let f of i)se(f.id)&&(e.preferences?.[f.id]??f.default)!==(t.preferences?.[f.id]??f.default)&&S.push(f.name);return S}r(ae,"pendingReloadChanges");function Me(e,t=[],a=[],d){let i=d;e.registerCommand("agent-ide-settings",{description:"Configure Agent IDE modules and features",async handler(u,c){if(c.hasUI)try{let b=await c.ui.select("Agent IDE settings \u2014 save scope",["Project","Global"]);if(b===void 0)return;let p=V(process.env,void 0,c.cwd),S=await X(p);i??=S;let A=new Set(t.filter(R=>process.argv.some(E=>E===`--${R.id}`||E.startsWith(`--${R.id}=`))).map(R=>R.id)),m=new Set(ae(i,S,M,t,a,A)),f=b==="Project"?p.projectPath:p.globalPath,g=await B(f),w=await B(b==="Project"?p.globalPath:p.projectPath),o=new Map,n=new Map,s=new Map,l,h=await c.ui.custom((R,E,C,k)=>{let j=Ne(E,()=>{let O=new Set(g.disabled),_=new Set(g.enabled);for(let[P,x]of o)O.delete(P),_.delete(P),x==="disabled"&&O.add(P),x==="enabled"&&_.add(P);let N=Y(M,[...J(M,b==="Project"?(l===void 0?g.preset:l)??w.preset??"full":w.preset??(l===void 0?g.preset:l)??"full"),...O,...w.disabled],[..._,...w.enabled]);return{modules:M.map(P=>({id:P.id,label:`${P.name??P.id}${m.has(P.name??P.id)?" *":""}`,description:`${P.description??""} Reload required for changes. Effective: ${N.disabled.has(P.id)?"off":"on"}.${w.disabled.includes(P.id)?" Disabled in the other scope.":P.dependencies.some(x=>N.disabled.has(x))?" A dependency is disabled.":""}`,currentValue:o.get(P.id)??(g.disabled.includes(P.id)?"disabled":g.enabled.includes(P.id)?"enabled":"default"),values:["default","enabled","disabled"]})),features:[D(),...q("features"),...F("features")],ui:[...q("ui"),...F("ui")]};function D(){let P=l===void 0?g.preset:l;return{id:"preset",label:"Preset",description:"Choose the built-in Agent IDE capability set. Reload required.",currentValue:z.find(x=>x.value===P)?.label??"default",values:["default",...z.map(x=>x.label)]}}function F(P){return a.filter(x=>x.group===P).map(x=>{let W=s.has(x.id)?s.get(x.id):g.preferences?.[x.id];return{id:x.id,label:`${x.name}${m.has(x.name)?" *":""}`,description:`${x.description}${se(x.id)?" Reload required for changes.":""} Default: ${x.kind==="choice"?x.values.find(L=>L.value===x.default)?.label??x.default:x.default||"empty"}.`,currentValue:W===void 0?"default":x.kind==="choice"?x.values.find(L=>L.value===W)?.label??W:W,...x.kind==="choice"?{values:["default",...x.values.map(L=>L.label)]}:{submenu:r((L,ge)=>{let H=new yt,me=L==="default"?x.default:L;return me.length>0&&H.handleInput(me),H.focused=!0,H.onSubmit=st=>ge(st),H.onEscape=()=>ge(),H},"submenu")}}})}function q(P){return t.filter(x=>(x.group??"features")===P).map(x=>{let W=n.has(x.id)?n.get(x.id):$(g)[x.id];return{id:x.id,label:`${x.name}${m.has(x.name)?" *":""}`,description:`${x.description}${re(x.id)?" Reload required for changes.":""}`,currentValue:W===void 0?"default":W?x.labels?.on??"enabled":x.labels?.off??"disabled",values:["default",x.labels?.off??"disabled",x.labels?.on??"enabled"]}})}},(O,_,N)=>{if(O==="modules"){let D=g.disabled.includes(_)?"disabled":g.enabled.includes(_)?"enabled":"default";N===D?o.delete(_):o.set(_,N)}else if(_==="preset"){let D=z.find(F=>F.label===N)?.value??null;l=D===(g.preset??null)?void 0:D}else if(a.some(D=>D.id===_)){let D=a.find(q=>q.id===_),F=N==="default"||N.length===0?void 0:D?.kind==="choice"?D.values.find(q=>q.label===N)?.value:N;F===g.preferences?.[_]?s.delete(_):s.set(_,F)}else{let D=N==="default"?void 0:N===(t.find(F=>F.id===_)?.labels?.on??"enabled");D===$(g)[_]?n.delete(_):n.set(_,D)}},k,`${b}${m.size?" \xB7 * reload pending":""}`);return{render:r(O=>j.render(O),"render"),invalidate:r(()=>j.invalidate(),"invalidate"),handleInput(O){j.handleInput(O),R.requestRender()}}});if(o.size+n.size+s.size+(l===void 0?0:1)===0||!h&&!await c.ui.confirm("Unsaved changes","Save changes?"))return;await ke(f,o,n,s,l);let y=await X(p);for(let R of a){let E=y.preferences?.[R.id];if(E!==void 0&&R.kind==="choice"&&!R.values.some(C=>C.value===E))throw new Error(`Saved settings contain an invalid choice: ${R.id}`)}e.events?.emit(Ce,{preferences:y.preferences??{}}),e.events?.emit(Te,{flags:$(y)});let I=[];e.events?.emit(Pe,{cwd:c.cwd,waitUntil:r(R=>I.push(R),"waitUntil")}),await Promise.all(I);let v=ae(i,y,M,t,a,A);if(c.ui.setStatus("pi-agent-ide-reload",v.length?`Reload required (${v.length}; see settings)`:void 0),v.length===0){c.ui.notify(`Saved ${b.toLowerCase()} Agent IDE settings.`,"info");return}c.ui.notify(`Saved ${b.toLowerCase()} Agent IDE settings. Reload required: ${v.join(", ")}.`,"info"),await c.ui.confirm("Reload Pi?","Reload extensions to apply pending settings. In-memory extension state may reset.")&&await c.reload()}catch(b){c.ui.notify(b instanceof Error?b.message:String(b),"error")}}})}r(Me,"registerModuleSettings");import{readFile as bt}from"node:fs/promises";import de from"node:path";import{getMarkdownTheme as wt}from"@earendil-works/pi-coding-agent";import{Markdown as vt,matchesKey as G,ScrollView as Et,truncateToWidth as It}from"@earendil-works/pi-tui";function xt(){return bt(de.join(de.dirname(de.dirname(import.meta.dirname)),"docs/settings-help.md"),"utf8")}r(xt,"readSettingsHelp");function $e(e){e.registerCommand("agent-ide-help",{description:"Read the short Agent IDE settings guide",async handler(t,a){if(!(a.mode!=="tui"||!a.hasUI))try{let d=await xt();await a.ui.custom((i,u,c,b)=>new le(d,u,()=>Math.max(5,Math.min(36,i.terminal.rows-4)),()=>i.requestRender(),b),{overlay:!0,overlayOptions:{width:92,margin:1}})}catch(d){a.ui.notify(d instanceof Error?d.message:String(d),"error")}}})}r($e,"registerSettingsHelp");var le=class{constructor(t,a,d,i,u){this.content=t;this.theme=a;this.height=d;this.requestRender=i;this.done=u;this.markdown=this.createMarkdown(),this.scroll=new Et(this.markdown)}static{r(this,"SettingsHelpPanel")}markdown;scroll;createMarkdown(){return new vt(this.content,0,0,wt(),{color:r(t=>this.theme.fg("text",t),"color")})}invalidate(){this.markdown.invalidate()}handleInput(t){if(G(t,"escape")){this.done();return}G(t,"up")?this.scroll.scrollBy(-1):G(t,"down")?this.scroll.scrollBy(1):G(t,"pageUp")?this.scroll.scrollBy(-this.scroll.viewportHeight):G(t,"pageDown")||G(t,"space")?this.scroll.scrollBy(this.scroll.viewportHeight):G(t,"home")?this.scroll.scrollToStart():G(t,"end")&&this.scroll.scrollToEnd()}render(t){let a=Math.max(1,t-4),d=this.markdown.render(a),i=Math.max(1,this.height()-4);this.scroll.updateLayout(d.length,i,this.requestRender);let u=d.slice(this.scroll.scrollTop,this.scroll.scrollTop+i);for(;u.length<i;)u.push("");let c=this.theme.fg("border","\u2500".repeat(Math.max(0,t-2))),b=r(p=>this.theme.fg("border","\u2502 ")+It(p,a,"\u2026",!0)+this.theme.fg("border"," \u2502"),"row");return[this.theme.fg("border","\u256D")+c+this.theme.fg("border","\u256E"),b(this.theme.fg("accent","Agent IDE settings help")),...u.map(b),b(this.theme.fg("muted","\u2191\u2193 scroll \xB7 PgUp/PgDn page \xB7 Home/End \xB7 Esc close")),this.theme.fg("border","\u2570")+c+this.theme.fg("border","\u256F")]}};function je(e,t){let a=[];return{definitions:a,register(d){if(a.some(i=>i.id===d.id))throw new Error(`Duplicate feature flag: ${d.id}`);a.push(d),e.registerFlag(d.id,{type:"boolean",description:d.description,default:t[d.id]??d.default})}}}r(je,"createFeatureFlags");function Fe(e,t=Z){return{id:"ide-settings",description:"IDE settings and their scopes",triggers:[{tool:"read",resourcePrefixes:["docs:ide-settings"]}],get markdown(){let a={preferences:t,flags:e,modules:M.map(({id:i,name:u,description:c,defaultEnabled:b,dependencies:p})=>({id:i,name:u,description:c,default:b!==!1,dependencies:p})),presets:z};return`# IDE settings
1
+ import{a as Ce,b as ke}from"./chunk-OTVNO5SX.js";import{a as Te,b as Re}from"./chunk-LLP3EIJL.js";import{a as z,b as J,c as V,d as X,e as $,f as j}from"./chunk-XHFAV2NI.js";import{a as Pe}from"./chunk-VHYJTAXX.js";import"./chunk-JYITLCXC.js";import{a as ye}from"./chunk-M7P7V4WI.js";import{f as te}from"./chunk-33U3RUM3.js";import{a as we}from"./chunk-YGGKGZO2.js";import"./chunk-N2NEFXHB.js";import"./chunk-KQV2ZXLP.js";import"./chunk-MPT3R4BL.js";import{g as be}from"./chunk-KN6VPARZ.js";import"./chunk-2DSY4U73.js";import"./chunk-H6FEBUAP.js";import"./chunk-SIYPD5MM.js";import{a as ne,b as ve,c as Ee}from"./chunk-TSQ6FBTB.js";import{a as Ie,b as xe,c as Se,f as oe,g as Ae}from"./chunk-YNOR4LIE.js";import{c as he}from"./chunk-RQ7JJ7GV.js";import"./chunk-ZC65Z3CK.js";import{a as r}from"./chunk-EI7MMDWY.js";var ie={"ide.core":["IDE services","Shared services used by language, formatting and diagnostic modules."],"ide.tips":["Getting started tips","Show contextual guidance while setting up a project."],"ide.documentation":["Progressive agent documentation","Expose packaged guides and attach them on first relevant tool use."],"ide.doctor":["Setup doctor","Check external tools and help configure project support."],"ide.languages":["Language setup","Discover languages and their recommended toolchains."],"ide.processes":["Agent IDE processes","Show active terminal and debugger sessions in one shared process surface."],"ide.debugger":["Debugger sessions","Debug local programs through addressable DAP sessions and anchored breakpoints."],"ide.terminal":["Terminal sessions","Run and manage local interactive and background terminal processes."],"read.core":["Read tools","Read sources through the configured readers and views."],"read.filesystem":["Local files","Resolve files and folders from the local filesystem."],"read.ssh":["SSH files","Read and edit configured SSH file sources through existing tools."],"read.filesystem.jq":["JSON queries","Query local JSON files through jq read views."],"read.filesystem.image":["Local images","Read local images as visual content."],"read.filesystem.pdf":["Local PDFs","Extract readable content from local PDF documents."],"read.filesystem.text":["Local text","Read local text files with their source coordinates."],"read.web":["Web sources","Read remote sources over HTTP and HTTPS."],"read.web.html":["Web pages","Extract readable content from HTML pages."],"read.web.image":["Web images","Read remote images as visual content."],"read.web.pdf":["Web PDFs","Extract text from remote PDF documents."],"read.web.text":["Web text","Read remote plain-text sources."],"search.core":["Search tools","Run searches through the configured search providers."],"search.text":["Text search","Find text and files and register reusable search selections."],"search.semantic":["Optional semantic search","Search indexed project code by meaning using the selected engine."],"editor.core":["Editing tools","Make guarded text and whole-file changes, directly or through native Codemode."],"editor.renderer":["Edit previews","Display changes in the shared colored diff panels."],"editor.anchor.constant":["File boundary selectors","Use begin and end to select file boundaries."],"editor.anchor.line-hash":["Checked line selectors","Select lines with hashes that detect stale content."],"editor.anchor.exact":["Exact text selectors","Locate edit ranges using unique source text."],"editor.stale-anchor":["Stale selection recovery","Provide recovery guidance when an edit selection is outdated."],"ide.ast":["Structural code support","Read code outlines and search or edit exact syntax-tree nodes."],"ide.formatter":["Code formatting","Run configured formatters after edits."],"ide.lint":["Lint checks","Run configured linters and collect their findings."],"ide.changes":["Git changes","Inspect and manage uncommitted changes and undo history."],"ide.lsp":["Language servers","Resolve symbols, rename references and collect language-server diagnostics."],"ide.diagnostics":["Diagnostic views","Show diagnostic findings through read views and sources."]};var M=[T("ide.core",()=>import("./chunk-4CSNQX54.js")),T("ide.tips",()=>import("./chunk-7JWZPJI5.js")),T("ide.doctor",()=>import("./chunk-TWJINFQB.js")),T("ide.languages",()=>import("./entry-42.js"),["ide.doctor"]),T("read.core",()=>import("./entry-52.js")),T("ide.documentation",async()=>{let{default:e}=await import("./chunk-YPTDPMK5.js");return{default:r(t=>e(t),"default")}},["read.core"]),T("read.filesystem",()=>import("./entry-31.js"),["read.core","editor.core"]),T("read.ssh",()=>import("./chunk-II7AOJNH.js"),["read.filesystem"]),T("read.filesystem.jq",()=>import("./entry-34.js"),["read.filesystem","ide.documentation","ide.doctor"]),T("read.filesystem.image",()=>import("./entry-32.js"),["read.filesystem"]),T("read.filesystem.pdf",()=>import("./entry-35.js"),["read.filesystem"]),T("read.filesystem.text",()=>import("./entry-36.js"),["read.filesystem"]),T("read.web",()=>import("./chunk-NQYUIQRH.js"),["read.core"]),T("read.web.html",()=>import("./entry-91.js"),["read.web"]),T("read.web.image",()=>import("./entry-92.js"),["read.web"]),T("read.web.pdf",()=>import("./entry-93.js"),["read.web"]),T("read.web.text",()=>import("./entry-94.js"),["read.web"]),T("search.core",()=>import("./entry-57.js")),T("search.semantic",()=>import("./chunk-JRIP33PC.js"),["search.core"]),T("search.text",()=>import("./entry-58.js"),["search.core"]),T("editor.renderer",()=>import("./entry-85.js"),["editor.core"]),T("editor.core",()=>import("./entry-84.js")),T("editor.anchor.constant",()=>import("./entry-63.js"),["read.core","editor.core"]),T("editor.anchor.line-hash",()=>import("./entry-67.js"),["read.core","editor.core"]),T("editor.anchor.exact",()=>import("./entry-65.js"),["editor.core"]),T("editor.stale-anchor",()=>import("./entry-86.js"),["editor.core"]),T("ide.ast",()=>import("./entry-38.js"),["ide.core","read.core","search.core","editor.core"]),T("ide.formatter",()=>import("./chunk-53IV6EKV.js"),["ide.core"]),T("ide.lint",()=>import("./chunk-FJSYWOE6.js"),["ide.core"]),T("ide.changes",()=>import("./chunk-5DN2XBVI.js"),["ide.core","read.core","editor.core"]),T("ide.lsp",()=>import("./chunk-6ZYCTWQE.js"),["ide.core","read.core","search.core"]),T("ide.processes",()=>import("./chunk-34IYWKY5.js")),T("ide.debugger",()=>import("./chunk-YLEERRX3.js"),["ide.processes","read.core","editor.core"]),T("ide.terminal",()=>import("./chunk-P43GGKUC.js"),["ide.processes","read.core","search.core","editor.core","editor.anchor.constant"]),T("ide.diagnostics",()=>import("./chunk-AMSNDWBT.js"),["ide.core","read.core"])];function T(e,t,s=[],d=!0){return{id:e,name:ie[e][0],description:ie[e][1],dependencies:s,async register(i,u){await(await t()).default(i,u)},...d?{}:{defaultEnabled:!1}}}r(T,"builtin");function K(e,t,s){return{kind:"choice",id:e,name:t,description:s,default:"compact",group:"ui",values:[{value:"full",label:"Full"},{value:"compact",label:"Compact"},{value:"disabled",label:"Disabled"}]}}r(K,"presentationPreference");var Z=[{kind:"choice",id:"search.semantic.engine",name:"Semantic search engine",description:"Choose the engine used by /semantic-index and semantic_search.",default:"colgrep",group:"features",values:[{value:"colgrep",label:"ColGREP"},{value:"vera",label:"Vera"}]},{kind:"choice",id:"ui.codemode",name:"Show tool results from Codemode",description:"Show extra Agent IDE result panels using each tool's presentation setting. Off hides successful panels; errors stay visible. Codemode's own output and other tools are unchanged.",default:"off",group:"ui",values:[{value:"off",label:"Off"},{value:"on",label:"On"}]},K("ui.diffs","Diffs","Choose how mutation and comparison diffs are displayed."),K("ui.read","Read","Choose how Read calls and results are displayed."),K("ui.search","Search","Choose how Search calls and results are displayed."),K("ui.terminal","Terminal","Choose how shell commands and terminal output are displayed."),{kind:"choice",id:"processes.activity",name:"Active Agent IDE processes",description:"Choose detailed process cards, a compact active count, or no persistent Agent IDE process UI.",default:"detailed",group:"ui",values:[{value:"detailed",label:"Detailed cards"},{value:"compact",label:"Compact count"},{value:"off",label:"Off"}]},{kind:"text",id:"lsp.idle-timeout",name:"Language server idle timeout",description:"Minutes without requests before a language server stops; the next request starts it again. Use a positive number.",default:"10",group:"features",placeholder:"10"}];function Y(e,t,s=[]){let d=new Map;for(let p of e){if(d.has(p.id))throw new Error(`Duplicate Pi Agent IDE extension ID: ${p.id}`);d.set(p.id,p)}for(let p of e)for(let S of p.dependencies)if(!d.has(S))throw new Error(`Pi Agent IDE extension ${p.id} has unknown dependency ${S}`);let i=new Set;for(let p of t)d.has(p)&&i.add(p);for(let p of s)if(!d.has(p))throw new Error(`Unknown Pi Agent IDE extension ID in enabled: ${p}`);let u=lt(d,s,i),c=new Set;for(let p of e)(p.defaultEnabled===!1&&!u.has(p.id)||i.has(p.id))&&c.add(p.id);let b=!0;for(;b;){b=!1;for(let p of e)c.has(p.id)||p.dependencies.every(S=>!c.has(S))||(c.add(p.id),b=!0)}return{enabled:e.filter(p=>!c.has(p.id)),disabled:c}}r(Y,"selectBuiltinExtensions");function lt(e,t,s){let d=new Set,i=[...t];for(;i.length>0;){let u=i.pop();if(!(d.has(u)||s.has(u))){d.add(u);for(let c of e.get(u)?.dependencies??[])d.has(c)||i.push(c)}}return d}r(lt,"collectForcedOn");import{Input as wt}from"@earendil-works/pi-tui";import{mkdir as ct,readFile as ut,writeFile as ft}from"node:fs/promises";import pt from"node:path";import{withFileMutationQueue as gt}from"@earendil-works/pi-coding-agent";async function _e(e,t,s=new Map,d=new Map,i){await gt(e,async()=>{let u=await j(e),c={};try{c=JSON.parse(await ut(e,"utf8"))}catch(m){if(!(m instanceof Error&&"code"in m&&m.code==="ENOENT"))throw m}let b=new Set(u.disabled),p=new Set(u.enabled);for(let[m,f]of t)b.delete(m),p.delete(m),f==="disabled"&&b.add(m),f==="enabled"&&p.add(m);let S={...u.preferences};for(let[m,f]of d)f===void 0?delete S[m]:S[m]=f;let A={...u.flags};for(let[m,f]of s)m==="pi-agent-ide-no-animations"&&delete c.noAnimations,m==="pi-agent-ide-no-post-processing"&&delete c.noPostProcessing,f===void 0?delete A[m]:A[m]=f;i===null&&delete c.preset,await ct(pt.dirname(e),{recursive:!0}),await ft(e,`${JSON.stringify({...c,disabled:[...b],enabled:[...p],...i==null?{}:{preset:i},...s.size>0?{flags:A}:{},...d.size>0?{preferences:S}:{}},null,2)}
2
+ `)})}r(_e,"saveModuleChoices");import{getSettingsListTheme as mt}from"@earendil-works/pi-coding-agent";import{matchesKey as Q,SettingsList as ht,truncateToWidth as De,visibleWidth as Oe}from"@earendil-works/pi-tui";function Ne(e,t,s,d,i=""){let u=["extensions","behavior","ui"],c="extensions",b=r(w=>w==="extensions"?"modules":w==="behavior"?"features":"ui","itemKey"),p=r(w=>w==="extensions"?"modules":w==="behavior"?"features":"ui","changeKey"),S=r(()=>{let w=b(c),o=t()[w]??[];return new ht(o,12,mt(),(n,a)=>{s(p(c),n,a);for(let l of t()[w]??[]){let h=o.find(y=>y.id===l.id);h&&Object.assign(h,l)}},()=>d(!1),{enableSearch:!0})},"createList"),A=S(),m=r(w=>e.fg("borderMuted",w),"border"),f=r((w,o)=>{if(o<=1)return m("\u2502");let n=o-2,a=De(w,n);return`${m("\u2502")}${a}${" ".repeat(Math.max(0,n-Oe(a)))}${m("\u2502")}`},"row"),g=r(w=>m(w<=1?"\u251C":`\u251C${"\u2500".repeat(Math.max(0,w-2))}\u2524`),"rule");return{render(w){let o=Math.max(1,w),n=Math.max(1,o-4),a=` Agent IDE settings${i?` \xB7 ${i}`:""} `,l=o<=1?m("\u256D"):`${m("\u256D\u2500")}${e.fg("accent",e.bold(De(a,Math.max(0,o-3),"")))}${m(`${"\u2500".repeat(Math.max(0,o-Oe(a)-3))}\u256E`)}`,h={extensions:"Features",behavior:"Behavior",ui:"UI"},y=u.map(R=>R===c?e.fg("accent",e.bold(`[ ${h[R]} ]`)):e.fg("dim",` ${h[R]} `)).join(" "),I=A.render(n).map(R=>f(` ${R} `,o)),v=e.fg("dim"," Tab switch \xB7 Enter change \xB7 Ctrl+S save \xB7 Esc exit ");return[l,f(` ${y} `,o),g(o),...I,g(o),f(v,o),m(o<=1?"\u2570":`\u2570${"\u2500".repeat(Math.max(0,o-2))}\u256F`)]},invalidate(){A.invalidate()},handleInput(w){Q(w,"tab")||Q(w,"shift+tab")?(c=u[(u.indexOf(c)+(Q(w,"shift+tab")?2:1))%u.length]??"extensions",A=S()):Q(w,"ctrl+s")?d(!0):A.handleInput(w)}}}r(Ne,"createSettingsPanel");var yt=new Set(["pi-agent-ide-yolo","pi-agent-ide-filesystem-yolo","pi-agent-ide-no-post-processing","pi-agent-ide-no-animations","pi-agent-ide-code-review","pi-agent-ide-code-review-capture"]),bt=new Set(["search.semantic.engine","ui.codemode","ui.diffs","ui.read","ui.search","ui.terminal","processes.activity"]);function re(e){return!yt.has(e)}r(re,"flagRequiresReload");function se(e){return!bt.has(e)}r(se,"preferenceRequiresReload");function ae(e,t,s,d,i,u=new Set){let c=r(f=>Y(s,[...J(s,f.preset??"full"),...f.disabled],f.enabled).disabled,"selected"),b=c(e),p=c(t),S=s.filter(f=>b.has(f.id)!==p.has(f.id)).map(f=>f.name??f.id),A=$(e),m=$(t);for(let f of d)re(f.id)&&!u.has(f.id)&&(A[f.id]??f.default)!==(m[f.id]??f.default)&&S.push(f.name);for(let f of i)se(f.id)&&(e.preferences?.[f.id]??f.default)!==(t.preferences?.[f.id]??f.default)&&S.push(f.name);return S}r(ae,"pendingReloadChanges");function Me(e,t=[],s=[],d){let i=d;e.registerCommand("agent-ide-settings",{description:"Configure Agent IDE modules and features",async handler(u,c){if(c.hasUI)try{let b=await c.ui.select("Agent IDE settings \u2014 save scope",["Project","Global"]);if(b===void 0)return;let p=V(process.env,void 0,c.cwd),S=await X(p);i??=S;let A=new Set(t.filter(R=>process.argv.some(E=>E===`--${R.id}`||E.startsWith(`--${R.id}=`))).map(R=>R.id)),m=new Set(ae(i,S,M,t,s,A)),f=b==="Project"?p.projectPath:p.globalPath,g=await j(f),w=await j(b==="Project"?p.globalPath:p.projectPath),o=new Map,n=new Map,a=new Map,l,h=await c.ui.custom((R,E,C,_)=>{let F=Ne(E,()=>{let O=new Set(g.disabled),k=new Set(g.enabled);for(let[P,x]of o)O.delete(P),k.delete(P),x==="disabled"&&O.add(P),x==="enabled"&&k.add(P);let N=Y(M,[...J(M,b==="Project"?(l===void 0?g.preset:l)??w.preset??"full":w.preset??(l===void 0?g.preset:l)??"full"),...O,...w.disabled],[...k,...w.enabled]);return{modules:M.map(P=>({id:P.id,label:`${P.name??P.id}${m.has(P.name??P.id)?" *":""}`,description:`${P.description??""} Reload required for changes. Effective: ${N.disabled.has(P.id)?"off":"on"}.${w.disabled.includes(P.id)?" Disabled in the other scope.":P.dependencies.some(x=>N.disabled.has(x))?" A dependency is disabled.":""}`,currentValue:o.get(P.id)??(g.disabled.includes(P.id)?"disabled":g.enabled.includes(P.id)?"enabled":"default"),values:["default","enabled","disabled"]})),features:[D(),...W("features"),...L("features")],ui:[...W("ui"),...L("ui")]};function D(){let P=l===void 0?g.preset:l;return{id:"preset",label:"Preset",description:"Choose the built-in Agent IDE capability set. Reload required.",currentValue:z.find(x=>x.value===P)?.label??"default",values:["default",...z.map(x=>x.label)]}}function L(P){return s.filter(x=>x.group===P).map(x=>{let q=a.has(x.id)?a.get(x.id):g.preferences?.[x.id];return{id:x.id,label:`${x.name}${m.has(x.name)?" *":""}`,description:`${x.description}${se(x.id)?" Reload required for changes.":""} Default: ${x.kind==="choice"?x.values.find(B=>B.value===x.default)?.label??x.default:x.default||"empty"}.`,currentValue:q===void 0?"default":x.kind==="choice"?x.values.find(B=>B.value===q)?.label??q:q,...x.kind==="choice"?{values:["default",...x.values.map(B=>B.label)]}:{submenu:r((B,ge)=>{let H=new wt,me=B==="default"?x.default:B;return me.length>0&&H.handleInput(me),H.focused=!0,H.onSubmit=dt=>ge(dt),H.onEscape=()=>ge(),H},"submenu")}}})}function W(P){return t.filter(x=>(x.group??"features")===P).map(x=>{let q=n.has(x.id)?n.get(x.id):$(g)[x.id];return{id:x.id,label:`${x.name}${m.has(x.name)?" *":""}`,description:`${x.description}${re(x.id)?" Reload required for changes.":""}`,currentValue:q===void 0?"default":q?x.labels?.on??"enabled":x.labels?.off??"disabled",values:["default",x.labels?.off??"disabled",x.labels?.on??"enabled"]}})}},(O,k,N)=>{if(O==="modules"){let D=g.disabled.includes(k)?"disabled":g.enabled.includes(k)?"enabled":"default";N===D?o.delete(k):o.set(k,N)}else if(k==="preset"){let D=z.find(L=>L.label===N)?.value??null;l=D===(g.preset??null)?void 0:D}else if(s.some(D=>D.id===k)){let D=s.find(W=>W.id===k),L=N==="default"||N.length===0?void 0:D?.kind==="choice"?D.values.find(W=>W.label===N)?.value:N;L===g.preferences?.[k]?a.delete(k):a.set(k,L)}else{let D=N==="default"?void 0:N===(t.find(L=>L.id===k)?.labels?.on??"enabled");D===$(g)[k]?n.delete(k):n.set(k,D)}},_,`${b}${m.size?" \xB7 * reload pending":""}`);return{render:r(O=>F.render(O),"render"),invalidate:r(()=>F.invalidate(),"invalidate"),handleInput(O){F.handleInput(O),R.requestRender()}}});if(o.size+n.size+a.size+(l===void 0?0:1)===0||!h&&!await c.ui.confirm("Unsaved changes","Save changes?"))return;await _e(f,o,n,a,l);let y=await X(p);for(let R of s){let E=y.preferences?.[R.id];if(E!==void 0&&R.kind==="choice"&&!R.values.some(C=>C.value===E))throw new Error(`Saved settings contain an invalid choice: ${R.id}`)}e.events?.emit(Ce,{preferences:y.preferences??{}}),e.events?.emit(Te,{flags:$(y)});let I=[];e.events?.emit(Pe,{cwd:c.cwd,waitUntil:r(R=>I.push(R),"waitUntil")}),await Promise.all(I);let v=ae(i,y,M,t,s,A);if(c.ui.setStatus("pi-agent-ide-reload",v.length?`Reload required (${v.length}; see settings)`:void 0),v.length===0){c.ui.notify(`Saved ${b.toLowerCase()} Agent IDE settings.`,"info");return}c.ui.notify(`Saved ${b.toLowerCase()} Agent IDE settings. Reload required: ${v.join(", ")}.`,"info"),await c.ui.confirm("Reload Pi?","Reload extensions to apply pending settings. In-memory extension state may reset.")&&await c.reload()}catch(b){c.ui.notify(b instanceof Error?b.message:String(b),"error")}}})}r(Me,"registerModuleSettings");import{readFile as vt}from"node:fs/promises";import de from"node:path";import{getMarkdownTheme as Et}from"@earendil-works/pi-coding-agent";import{Markdown as It,matchesKey as G,ScrollView as xt,truncateToWidth as St}from"@earendil-works/pi-tui";function At(){return vt(de.join(de.dirname(de.dirname(import.meta.dirname)),"docs/settings-help.md"),"utf8")}r(At,"readSettingsHelp");function $e(e){e.registerCommand("agent-ide-help",{description:"Read the short Agent IDE settings guide",async handler(t,s){if(!(s.mode!=="tui"||!s.hasUI))try{let d=await At();await s.ui.custom((i,u,c,b)=>new le(d,u,()=>Math.max(5,Math.min(36,i.terminal.rows-4)),()=>i.requestRender(),b),{overlay:!0,overlayOptions:{width:92,margin:1}})}catch(d){s.ui.notify(d instanceof Error?d.message:String(d),"error")}}})}r($e,"registerSettingsHelp");var le=class{constructor(t,s,d,i,u){this.content=t;this.theme=s;this.height=d;this.requestRender=i;this.done=u;this.markdown=this.createMarkdown(),this.scroll=new xt(this.markdown)}static{r(this,"SettingsHelpPanel")}markdown;scroll;createMarkdown(){return new It(this.content,0,0,Et(),{color:r(t=>this.theme.fg("text",t),"color")})}invalidate(){this.markdown.invalidate()}handleInput(t){if(G(t,"escape")){this.done();return}G(t,"up")?this.scroll.scrollBy(-1):G(t,"down")?this.scroll.scrollBy(1):G(t,"pageUp")?this.scroll.scrollBy(-this.scroll.viewportHeight):G(t,"pageDown")||G(t,"space")?this.scroll.scrollBy(this.scroll.viewportHeight):G(t,"home")?this.scroll.scrollToStart():G(t,"end")&&this.scroll.scrollToEnd()}render(t){let s=Math.max(1,t-4),d=this.markdown.render(s),i=Math.max(1,this.height()-4);this.scroll.updateLayout(d.length,i,this.requestRender);let u=d.slice(this.scroll.scrollTop,this.scroll.scrollTop+i);for(;u.length<i;)u.push("");let c=this.theme.fg("border","\u2500".repeat(Math.max(0,t-2))),b=r(p=>this.theme.fg("border","\u2502 ")+St(p,s,"\u2026",!0)+this.theme.fg("border"," \u2502"),"row");return[this.theme.fg("border","\u256D")+c+this.theme.fg("border","\u256E"),b(this.theme.fg("accent","Agent IDE settings help")),...u.map(b),b(this.theme.fg("muted","\u2191\u2193 scroll \xB7 PgUp/PgDn page \xB7 Home/End \xB7 Esc close")),this.theme.fg("border","\u2570")+c+this.theme.fg("border","\u256F")]}};function Fe(e,t){let s=[];return{definitions:s,register(d){if(s.some(i=>i.id===d.id))throw new Error(`Duplicate feature flag: ${d.id}`);s.push(d),e.registerFlag(d.id,{type:"boolean",description:d.description,default:t[d.id]??d.default})}}}r(Fe,"createFeatureFlags");function Le(e,t=Z){return{id:"ide-settings",description:"IDE settings and their scopes",triggers:[{tool:"read",resourcePrefixes:["docs:ide-settings"]}],get markdown(){let s={preferences:t,flags:e,modules:M.map(({id:i,name:u,description:c,defaultEnabled:b,dependencies:p})=>({id:i,name:u,description:c,default:b!==!1,dependencies:p})),presets:z};return`# IDE settings
3
3
 
4
4
  This catalog describes supported settings, not current saved values or live runtime state. It is generated from the registrations used by /agent-ide-settings. Read both configuration scopes to inspect overrides. The settings menu applies live settings on save and marks pending reload-only settings with an asterisk. Module selection, diagnostic buffering, developer mode and unknown external settings require reload; effective changes masked by other scopes, dependencies or CLI flags do not. Reverting pending changes clears the indicator. Built-in CLI flags can override saved defaults for an invocation.
5
5
 
@@ -23,22 +23,22 @@ Choices carry their saved value and human label. Text settings carry a descripti
23
23
 
24
24
  \`\`\`json
25
25
  {
26
- ${Object.entries(a).map(([i,u])=>` "${i}": [
26
+ ${Object.entries(s).map(([i,u])=>` "${i}": [
27
27
  ${u.map(c=>` ${JSON.stringify(c)}`).join(`,
28
28
  `)}
29
29
  ]`).join(`,
30
30
  `)}
31
31
  }
32
32
  \`\`\`
33
- `}}}r(Fe,"createIdeSettingsDocumentation");function Le(e){let t=new Set,a=new Set;for(let d of e)if(d.startsWith("-"))t.add(d.slice(1)),a.delete(d.slice(1));else{let i=d.startsWith("+")?d.slice(1):d;t.delete(i),a.add(i)}return{excluded:t,requested:a}}r(Le,"resolveToolSelection");function Be(e){let t=new Map,a=new Set;return{api:{...e,registerTool:r(i=>{let u=i.name.startsWith("ide_capability_");(i.namespace?.name.startsWith("ide_")===!0||u)&&t.set(i.name,{hide:r(()=>e.registerTool({...i,get description(){return i.description},get promptGuidelines(){return i.promptGuidelines},get parameters(){return i.parameters},exposure:"hidden"}),"hide"),restore:r(()=>e.registerTool(i),"restore")}),u&&(Le(e.getSettings().defaultTools??[]).excluded.has(i.name)?a.add(i.name):a.delete(i.name)),a.has(i.name)?t.get(i.name)?.hide():e.registerTool(i)},"registerTool")},reconcile(i=!1,u=[],c=!1){let{excluded:b,requested:p}=Le(e.getSettings().defaultTools??[]);for(let[g,w]of t)b.has(g)!==a.has(g)&&(b.has(g)?(w.hide(),a.add(g)):(w.restore(),a.delete(g)));let S=e.getAllTools().filter(g=>g.exposure!=="hidden"),A=new Set(e.getActiveTools());for(let g of S)i&&!c&&t.has(g.name)&&(p.has(g.name)||g.exposure==="deferred"&&u.includes(g.name))&&A.add(g.name);i&&!b.has("tool_search")&&S.some(g=>g.name==="tool_search")&&S.some(g=>t.has(g.name)&&g.exposure==="deferred")&&A.add("tool_search");let m=e.getActiveTools(),f=[...A].filter(g=>!a.has(g));(f.length!==m.length||f.some(g=>!m.includes(g)))&&e.setActiveTools(f)}}}r(Be,"createIdeToolAvailability");import{Type as St}from"typebox";import{Text as At}from"@earendil-works/pi-tui";function Ge(e){return[...new Set(e.filter(t=>t!==void 0&&t!==""))].join(`
34
- `)}r(Ge,"joinUnique");function Ue(e,t){if(t.length===0)return e;let a=e.parameters;if(a.properties===void 0)throw new Error(`Capability target is not an object schema: ${e.name}`);let d={...a.properties};for(let i of t)for(let u of Object.keys(i.parameters??{}))if(!Object.hasOwn(d,u))throw new Error(`Unknown capability parameter: ${e.name}.${u}`);for(let[i,u]of Object.entries(d)){let c=t.map(b=>b.parameters?.[i]);c.some(b=>b!==void 0)&&(d[i]={...u,description:Ge([typeof u.description=="string"?u.description:void 0,...c])})}return{...e,description:Ge([e.description,...t.flatMap(i=>[i.description,...i.promptGuidelines??[]])]),parameters:{...e.parameters,properties:d},promptGuidelines:[...new Set([...e.promptGuidelines??[],...t.flatMap(i=>i.promptGuidelines??[])])]}}r(Ue,"composeCapabilitySchema");var We="ide-capabilities/v1";function U(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}r(U,"record");function Tt(e){if(!U(e)||typeof e.id!="string")throw new Error("Invalid IDE capability");if(e.version!==1||!/^[a-z][a-z0-9._-]*$/u.test(e.id))throw new Error("Invalid IDE capability identity");if(!Array.isArray(e.tools)||e.tools.some(t=>typeof t!="string"||!t))throw new Error("Invalid IDE capability tools");if(e.tools.length===0&&e.discovery===void 0)throw new Error("A capability needs an existing tool or a discovery loader");if(e.discovery!==void 0){let t=e.discovery;if(!U(t)||typeof t.name!="string"||!/^ide_capability_[a-z0-9_]+$/u.test(t.name)||typeof t.description!="string"||!t.description.trim())throw new Error("Invalid capability discovery metadata");if(t.namespace!==void 0&&(!U(t.namespace)||typeof t.namespace.name!="string"||typeof t.namespace.description!="string"))throw new Error("Invalid capability namespace")}if(!U(e.schemas))throw new Error("Invalid capability schemas");for(let t of Object.values(e.schemas))if(!U(t)||t.description!==void 0&&typeof t.description!="string"||t.parameters!==void 0&&(!U(t.parameters)||Object.values(t.parameters).some(a=>typeof a!="string"))||t.promptGuidelines!==void 0&&(!Array.isArray(t.promptGuidelines)||t.promptGuidelines.some(a=>typeof a!="string")))throw new Error("Invalid capability schema metadata")}r(Tt,"validate");function qe(e){let t=new Map,a=new Map,d=new Set,i=new Set,u=!1,c=r(()=>new Set(e.getAllTools().filter(o=>o.exposure!=="hidden").map(o=>o.name)),"visibleTools"),b=r(o=>[...o.tools,...o.discovery?[o.discovery.name]:[]],"triggers"),p=r((o,n)=>b(o).some(s=>n.has(s)),"available"),S=r(()=>{if(!u)return;let o=c(),n=[...a].map(([s,l])=>{let h=[...t.values()].filter(y=>i.has(y.id)&&p(y,o)).flatMap(y=>y.schemas[s]===void 0?[]:[y.schemas[s]]);return l(h)});for(let s of n)s()},"refresh"),A=r(o=>{let n,s=r(l=>{let h=Ue(o,l),y=JSON.stringify([h.description,h.parameters,h.promptGuidelines]);return()=>{y!==n&&(e.registerTool(h),n=y)}},"prepare");for(let l of t.values()){let h=l.schemas[o.name];h!==void 0&&s([h])}a.set(o.name,s),e.registerTool(o),S()},"registerTool"),m=r(o=>{let n=c(),s=!1;for(let l of t.values())!i.has(l.id)&&p(l,n)&&b(l).some(h=>o.includes(h)&&n.has(h))&&(i.add(l.id),s=!0);s&&(e.appendEntry(We,{version:1,active:[...i]}),S())},"activate"),f=r(o=>{let n=o.discovery;if(!(n===void 0||d.has(n.name))){if(e.getAllTools().some(s=>s.name===n.name))throw new Error(`Capability loader name is already registered: ${n.name}`);e.registerTool({name:n.name,label:n.name,description:n.description,exposure:"deferred",namespace:n.namespace,parameters:St.Object({}),renderResult(s){return new At(s.content.flatMap(l=>l.type==="text"?[l.text]:[]).join(`
35
- `),0,0)},async execute(){return m([n.name]),{content:[{type:"text",text:`Enabled capability ${o.id}.`}],details:{capability:o.id}}}}),d.add(n.name)}},"installLoader"),g=r(o=>{i=new Set;for(let n of o.sessionManager.getBranch())n.type!=="custom"||n.customType!==We||!U(n.data)||n.data.version!==1||!Array.isArray(n.data.active)||(i=new Set(n.data.active.filter(s=>typeof s=="string")));S()},"restore"),w=e.events.on(ve,o=>{let n=o;try{let s=n.capability;if(Tt(s),t.has(s.id))throw new Error(`Duplicate capability: ${s.id}`);let l=s.discovery?.name;if(l!==void 0&&(a.has(l)||[...t.values()].some(y=>y.discovery?.name===l)||u&&e.getAllTools().some(y=>y.name===l)))throw new Error(`Capability loader name is already registered: ${l}`);for(let[y,I]of Object.entries(s.schemas))a.get(y)?.([I]);let h=structuredClone(s);u&&f(h),t.set(h.id,h),S(),n.accept()}catch(s){n.accept(s instanceof Error?s:new Error(String(s)))}});return e.on("session_shutdown",w),e.on("tool_call",o=>m([o.toolName])),e.on("tool_result",o=>{m([o.toolName]),!(o.toolName!=="tool_search"||o.isError||!U(o.details)||!Array.isArray(o.details.loaded))&&m(o.details.loaded.filter(n=>typeof n=="string"))}),e.events.emit(Ee,{version:1}),{api:{...e,registerTool:A},finalize(o){e.on("session_start",(n,s)=>{u=!0;let l=[];for(let h of t.values())try{f(h)}catch(y){t.delete(h.id),l.push(y instanceof Error?y.message:String(y))}if(o(),g(s),l.length>0)throw new Error(l.join(`
36
- `))}),e.on("session_tree",(n,s)=>g(s)),e.on("session_compact",(n,s)=>g(s)),e.on("before_agent_start",S),e.on("turn_start",S)}}}r(qe,"createIdeCapabilities");import{ToolExecutionComponent as Je}from"@earendil-works/pi-coding-agent";import{Container as ce,Spacer as Ve,Text as ee}from"@earendil-works/pi-tui";import{isDeepStrictEqual as Rt}from"node:util";import{createCodemodeExtension as Pt}from"@earendil-works/pi-coding-agent";function ze(e,t){let a=r(i=>{if(!i.startsWith("mcp__"))return;let u=e.getAllTools(),c=u.find(p=>p.name===i);if(!c||c.namespace||c.exposure==="hidden")return;let b=u.filter(p=>(t.has(p.name)&&p.namespace?.name.startsWith("ide_")===!0||p.name==="codemode"&&p.sourceInfo.source==="builtin"&&p.sourceInfo.path==="builtin:codemode")&&p.exposure!=="hidden"&&p.description===c.description&&Rt(p.parameters,c.parameters));return b.length===1?b[0]?.name:void 0},"source"),d;return e.registerToolRenderer((i,u)=>{let c=a(i);return c!=="codemode"?c===void 0?u():t.get(c):(d||Pt()({...e,registerTool:r(b=>{let{renderShell:p,renderCall:S,renderResult:A}=b;d={renderShell:p,renderCall:S,renderResult:A}},"registerTool")}),d??u())}),e.on("before_agent_start",()=>{for(let i of e.getAllTools()){let u=a(i.name),c=u===void 0?void 0:t.get(u);if(!c)continue;let b=Object.getOwnPropertyDescriptors(c);delete b.namespace,b.name={value:i.name,enumerable:!0,configurable:!0,writable:!0},b.exposure={value:i.exposure==="model-only"?i.exposure:"deferred",enumerable:!0,configurable:!0,writable:!0};let p=r(m=>{let f=c.prepareLoadout?.(m);return m.declared.some(g=>g.name===c.name)?{...f,hiddenDeclarations:[...f?.hiddenDeclarations??[],i.name]}:f},"prepareLoadout");b.prepareLoadout={value:p,enumerable:!0,configurable:!0,writable:!0};let S=r(async(m,f,g,w,o)=>{let{result:n,isError:s}=await o.executeTool(c.name,f,{signal:g,onUpdate:w}),{usage:l,...h}=n;return{...h,isError:s}},"execute");b.execute={value:S,enumerable:!0,configurable:!0,writable:!0};let A=Object.defineProperties({},b);e.registerTool(A)}}),a}r(ze,"registerIdeAliasCompatibility");var ue="ide-nested-results",Ye=256,He=512*1024,Xe=8*1024,Ct=32*1024,_t=r(()=>({argumentsTruncated:!1,resultsOmitted:!1,callsOmitted:!1,resultsUnavailable:!1}),"retained");function Ke(e){let t=e.retention,a=[t?.argumentsTruncated&&"arguments shortened",t?.resultsOmitted&&"result displays omitted",t?.callsOmitted&&"call panels omitted",t?.resultsUnavailable&&"results unavailable"].filter(Boolean);if(a.length>0)return`Nested IDE display: ${a.join("; ")}. Tool execution and parent output are unchanged.`;if(!t&&e.complete===!1)return"Nested IDE display is incomplete; omission details are unavailable."}r(Ke,"retentionWarning");function kt(e){let t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;let a=Math.floor(t),d=Math.floor(a/60);return d<60?`${d}m ${a%60}s`:`${Math.floor(d/60)}h ${d%60}m ${a%60}s`}r(kt,"formatToolDuration");function Ze(e,t=!1){let a=new Map,d=ze(e,a),i=new Map,u=new Map,c=new Map,b,p=new WeakMap,S=new WeakMap,A=r(o=>{let n=a.get(o),s=n?.renderResult;if(!n||!s)return n;let l=S.get(n);if(!l){let h=new WeakMap;l={...n,renderResult(y,I,v,R){let E=R.lastComponent&&h.get(R.lastComponent),C=s.call(n,y,I,v,{...R,lastComponent:E??R.lastComponent});if(I.isPartial||R.durationMs===void 0)return C;let k=new ce;return k.addChild(C),k.addChild(new Ve(1)),k.addChild(new ee(v.fg("muted",`Took ${kt(R.durationMs)}`),0,0)),h.set(k,C),k}},S.set(n,l)}return l},"timedDefinition"),m=r((o,n,s)=>{n.result=s,n.resultOmitted=!1;try{let h=JSON.stringify(o);if(Buffer.byteLength(h)<=He){n.result=JSON.parse(JSON.stringify(s));return}}catch{}let l=s.details&&typeof s.details=="object"?Object.entries(s.details).filter(([h,y])=>(h==="source"||h==="fullOutputPath")&&typeof y=="string").map(([h,y])=>`${h}: ${String(y)}`):[];n.result={content:[{type:"text",text:["Result presentation omitted (history size limit or unsupported payload).",...l].join(`
37
- `)}],details:void 0,isError:s.isError},n.resultOmitted=!0},"retainResult"),f=r(()=>{i.clear(),u.clear(),c.clear()},"clear");e.on("session_start",(o,n)=>{f(),n.mode==="tui"&&n.ui.setWidget(ue,s=>(b=s,{render:r(()=>[],"render"),invalidate:r(()=>{},"invalidate")}))}),e.on("session_tree",f),e.on("session_shutdown",f),e.on("tool_execution_start",(o,n)=>{if(o.parentToolCallId===void 0){let E=d(o.toolName);E!==void 0&&i.set(o.toolCallId,E);return}let s=u.get(o.parentToolCallId)??o.parentToolCallId;if(u.set(o.toolCallId,s),i.get(s)===o.toolName||!a.has(o.toolName))return;let l=c.get(s);if(l||(l={parentToolCallId:s,cwd:n.cwd,calls:[],retention:_t()},c.set(s,l)),l.calls.length>=Ye){l.retention.callsOmitted=!0;return}let h=JSON.stringify(o.args),y=Ct-l.calls.reduce((E,C)=>E+Buffer.byteLength(JSON.stringify(C.args)),0)-(Ye-l.calls.length-1)*2,I=Buffer.byteLength(h)>Math.min(Xe,y),v=I?Object.fromEntries(Object.entries(o.args).map(([E,C])=>[E,typeof C=="string"?C.slice(0,200)+(C.length>200?"\u2026 [omitted]":""):"[omitted]"])):JSON.parse(h),R=Buffer.byteLength(JSON.stringify(v))<=Math.min(Xe,y)?v:{};l.calls.push({id:o.toolCallId,name:o.toolName,args:R,argumentsTruncated:I})}),e.on("tool_execution_end",o=>{i.delete(o.toolCallId);let n=u.get(o.toolCallId);if(n===void 0)return;u.delete(o.toolCallId);let s=c.get(n),l=s?.calls.find(h=>h.id===o.toolCallId);if(s&&l){typeof o.durationMs=="number"&&Number.isFinite(o.durationMs)&&(l.durationMs=o.durationMs);let h=o.result;m(s,l,{content:h.content.filter(y=>y.type!=="text"||!y.text.startsWith(`
33
+ `}}}r(Le,"createIdeSettingsDocumentation");function Be(e){let t=new Set,s=new Set;for(let d of e)if(d.startsWith("-"))t.add(d.slice(1)),s.delete(d.slice(1));else{let i=d.startsWith("+")?d.slice(1):d;t.delete(i),s.add(i)}return{excluded:t,requested:s}}r(Be,"resolveToolSelection");function je(e){let t=new Map,s=new Set;return{api:{...e,registerTool:r(i=>{let u=i.name.startsWith("ide_capability_");(i.namespace?.name.startsWith("ide_")===!0||u)&&t.set(i.name,{hide:r(()=>e.registerTool({...i,get description(){return i.description},get promptGuidelines(){return i.promptGuidelines},get parameters(){return i.parameters},exposure:"hidden"}),"hide"),restore:r(()=>e.registerTool(i),"restore")}),u&&(Be(e.getSettings().defaultTools??[]).excluded.has(i.name)?s.add(i.name):s.delete(i.name)),s.has(i.name)?t.get(i.name)?.hide():e.registerTool(i)},"registerTool")},reconcile(i=!1,u=[],c=!1){let{excluded:b,requested:p}=Be(e.getSettings().defaultTools??[]);for(let[g,w]of t)b.has(g)!==s.has(g)&&(b.has(g)?(w.hide(),s.add(g)):(w.restore(),s.delete(g)));let S=e.getAllTools().filter(g=>g.exposure!=="hidden"),A=new Set(e.getActiveTools());for(let g of S)i&&!c&&t.has(g.name)&&(p.has(g.name)||g.exposure==="deferred"&&u.includes(g.name))&&A.add(g.name);i&&!b.has("tool_search")&&S.some(g=>g.name==="tool_search")&&S.some(g=>t.has(g.name)&&g.exposure==="deferred")&&A.add("tool_search");let m=e.getActiveTools(),f=[...A].filter(g=>!s.has(g));(f.length!==m.length||f.some(g=>!m.includes(g)))&&e.setActiveTools(f)}}}r(je,"createIdeToolAvailability");import{Type as Tt}from"typebox";import{Text as Rt}from"@earendil-works/pi-tui";function Ge(e){return[...new Set(e.filter(t=>t!==void 0&&t!==""))].join(`
34
+ `)}r(Ge,"joinUnique");function Ue(e,t){if(t.length===0)return e;let s=e.parameters;if(s.properties===void 0)throw new Error(`Capability target is not an object schema: ${e.name}`);let d={...s.properties};for(let i of t)for(let u of Object.keys(i.parameters??{}))if(!Object.hasOwn(d,u))throw new Error(`Unknown capability parameter: ${e.name}.${u}`);for(let[i,u]of Object.entries(d)){let c=t.map(b=>b.parameters?.[i]);c.some(b=>b!==void 0)&&(d[i]={...u,description:Ge([typeof u.description=="string"?u.description:void 0,...c])})}return{...e,description:Ge([e.description,...t.flatMap(i=>[i.description,...i.promptGuidelines??[]])]),parameters:{...e.parameters,properties:d},promptGuidelines:[...new Set([...e.promptGuidelines??[],...t.flatMap(i=>i.promptGuidelines??[])])]}}r(Ue,"composeCapabilitySchema");var qe="ide-capabilities/v1";function U(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}r(U,"record");function Pt(e){if(!U(e)||typeof e.id!="string")throw new Error("Invalid IDE capability");if(e.version!==1||!/^[a-z][a-z0-9._-]*$/u.test(e.id))throw new Error("Invalid IDE capability identity");if(!Array.isArray(e.tools)||e.tools.some(t=>typeof t!="string"||!t))throw new Error("Invalid IDE capability tools");if(e.tools.length===0&&e.discovery===void 0)throw new Error("A capability needs an existing tool or a discovery loader");if(e.discovery!==void 0){let t=e.discovery;if(!U(t)||typeof t.name!="string"||!/^ide_capability_[a-z0-9_]+$/u.test(t.name)||typeof t.description!="string"||!t.description.trim())throw new Error("Invalid capability discovery metadata");if(t.namespace!==void 0&&(!U(t.namespace)||typeof t.namespace.name!="string"||typeof t.namespace.description!="string"))throw new Error("Invalid capability namespace")}if(!U(e.schemas))throw new Error("Invalid capability schemas");for(let t of Object.values(e.schemas))if(!U(t)||t.description!==void 0&&typeof t.description!="string"||t.parameters!==void 0&&(!U(t.parameters)||Object.values(t.parameters).some(s=>typeof s!="string"))||t.promptGuidelines!==void 0&&(!Array.isArray(t.promptGuidelines)||t.promptGuidelines.some(s=>typeof s!="string")))throw new Error("Invalid capability schema metadata")}r(Pt,"validate");function We(e){let t=new Map,s=new Map,d=new Set,i=new Set,u=!1,c=r(()=>new Set(e.getAllTools().filter(o=>o.exposure!=="hidden").map(o=>o.name)),"visibleTools"),b=r(o=>[...o.tools,...o.discovery?[o.discovery.name]:[]],"triggers"),p=r((o,n)=>b(o).some(a=>n.has(a)),"available"),S=r(()=>{if(!u)return;let o=c(),n=[...s].map(([a,l])=>{let h=[...t.values()].filter(y=>i.has(y.id)&&p(y,o)).flatMap(y=>y.schemas[a]===void 0?[]:[y.schemas[a]]);return l(h)});for(let a of n)a()},"refresh"),A=r(o=>{let n,a=r(l=>{let h=Ue(o,l),y=JSON.stringify([h.description,h.parameters,h.promptGuidelines]);return()=>{y!==n&&(e.registerTool(h),n=y)}},"prepare");for(let l of t.values()){let h=l.schemas[o.name];h!==void 0&&a([h])}s.set(o.name,a),e.registerTool(o),S()},"registerTool"),m=r(o=>{let n=c(),a=!1;for(let l of t.values())!i.has(l.id)&&p(l,n)&&b(l).some(h=>o.includes(h)&&n.has(h))&&(i.add(l.id),a=!0);a&&(e.appendEntry(qe,{version:1,active:[...i]}),S())},"activate"),f=r(o=>{let n=o.discovery;if(!(n===void 0||d.has(n.name))){if(e.getAllTools().some(a=>a.name===n.name))throw new Error(`Capability loader name is already registered: ${n.name}`);e.registerTool({name:n.name,label:n.name,description:n.description,exposure:"deferred",namespace:n.namespace,parameters:Tt.Object({}),renderResult(a){return new Rt(a.content.flatMap(l=>l.type==="text"?[l.text]:[]).join(`
35
+ `),0,0)},async execute(){return m([n.name]),{content:[{type:"text",text:`Enabled capability ${o.id}.`}],details:{capability:o.id}}}}),d.add(n.name)}},"installLoader"),g=r(o=>{i=new Set;for(let n of o.sessionManager.getBranch())n.type!=="custom"||n.customType!==qe||!U(n.data)||n.data.version!==1||!Array.isArray(n.data.active)||(i=new Set(n.data.active.filter(a=>typeof a=="string")));S()},"restore"),w=e.events.on(ve,o=>{let n=o;try{let a=n.capability;if(Pt(a),t.has(a.id))throw new Error(`Duplicate capability: ${a.id}`);let l=a.discovery?.name;if(l!==void 0&&(s.has(l)||[...t.values()].some(y=>y.discovery?.name===l)||u&&e.getAllTools().some(y=>y.name===l)))throw new Error(`Capability loader name is already registered: ${l}`);for(let[y,I]of Object.entries(a.schemas))s.get(y)?.([I]);let h=structuredClone(a);u&&f(h),t.set(h.id,h),S(),n.accept()}catch(a){n.accept(a instanceof Error?a:new Error(String(a)))}});return e.on("session_shutdown",w),e.on("tool_call",o=>m([o.toolName])),e.on("tool_result",o=>{m([o.toolName]),!(o.toolName!=="tool_search"||o.isError||!U(o.details)||!Array.isArray(o.details.loaded))&&m(o.details.loaded.filter(n=>typeof n=="string"))}),e.events.emit(Ee,{version:1}),{api:{...e,registerTool:A},finalize(o){e.on("session_start",(n,a)=>{u=!0;let l=[];for(let h of t.values())try{f(h)}catch(y){t.delete(h.id),l.push(y instanceof Error?y.message:String(y))}if(o(),g(a),l.length>0)throw new Error(l.join(`
36
+ `))}),e.on("session_tree",(n,a)=>g(a)),e.on("session_compact",(n,a)=>g(a)),e.on("before_agent_start",S),e.on("turn_start",S)}}}r(We,"createIdeCapabilities");import{ToolExecutionComponent as Je}from"@earendil-works/pi-coding-agent";import{Container as ce,Spacer as Ve,Text as ee}from"@earendil-works/pi-tui";import{isDeepStrictEqual as Ct}from"node:util";import{createCodemodeExtension as kt}from"@earendil-works/pi-coding-agent";function ze(e,t){let s=r(i=>{if(!i.startsWith("mcp__"))return;let u=e.getAllTools(),c=u.find(p=>p.name===i);if(!c||c.namespace||c.exposure==="hidden")return;let b=u.filter(p=>(t.has(p.name)&&p.namespace?.name.startsWith("ide_")===!0||p.name==="codemode"&&p.sourceInfo.source==="builtin"&&p.sourceInfo.path==="builtin:codemode")&&p.exposure!=="hidden"&&p.description===c.description&&Ct(p.parameters,c.parameters));return b.length===1?b[0]?.name:void 0},"source"),d;return e.registerToolRenderer((i,u)=>{let c=s(i);return c!=="codemode"?c===void 0?u():t.get(c):(d||kt()({...e,registerTool:r(b=>{let{renderShell:p,renderCall:S,renderResult:A}=b;d={renderShell:p,renderCall:S,renderResult:A}},"registerTool")}),d??u())}),e.on("before_agent_start",()=>{for(let i of e.getAllTools()){let u=s(i.name),c=u===void 0?void 0:t.get(u);if(!c)continue;let b=Object.getOwnPropertyDescriptors(c);delete b.namespace,b.name={value:i.name,enumerable:!0,configurable:!0,writable:!0},b.exposure={value:i.exposure==="model-only"?i.exposure:"deferred",enumerable:!0,configurable:!0,writable:!0};let p=r(m=>{let f=c.prepareLoadout?.(m);return m.declared.some(g=>g.name===c.name)?{...f,hiddenDeclarations:[...f?.hiddenDeclarations??[],i.name]}:f},"prepareLoadout");b.prepareLoadout={value:p,enumerable:!0,configurable:!0,writable:!0};let S=r(async(m,f,g,w,o)=>{let{result:n,isError:a}=await o.executeTool(c.name,f,{signal:g,onUpdate:w}),{usage:l,...h}=n;return{...h,isError:a}},"execute");b.execute={value:S,enumerable:!0,configurable:!0,writable:!0};let A=Object.defineProperties({},b);e.registerTool(A)}}),s}r(ze,"registerIdeAliasCompatibility");var ue="ide-nested-results",Ye=256,He=512*1024,Xe=8*1024,_t=32*1024,Dt=r(()=>({argumentsTruncated:!1,resultsOmitted:!1,callsOmitted:!1,resultsUnavailable:!1}),"retained");function Ke(e){let t=e.retention,s=[t?.argumentsTruncated&&"arguments shortened",t?.resultsOmitted&&"result displays omitted",t?.callsOmitted&&"call panels omitted",t?.resultsUnavailable&&"results unavailable"].filter(Boolean);if(s.length>0)return`Nested IDE display: ${s.join("; ")}. Tool execution and parent output are unchanged.`;if(!t&&e.complete===!1)return"Nested IDE display is incomplete; omission details are unavailable."}r(Ke,"retentionWarning");function Ot(e){let t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;let s=Math.floor(t),d=Math.floor(s/60);return d<60?`${d}m ${s%60}s`:`${Math.floor(d/60)}h ${d%60}m ${s%60}s`}r(Ot,"formatToolDuration");function Ze(e,t=!1){let s=new Map,d=ze(e,s),i=new Map,u=new Map,c=new Map,b,p=new WeakMap,S=new WeakMap,A=r(o=>{let n=s.get(o),a=n?.renderResult;if(!n||!a)return n;let l=S.get(n);if(!l){let h=new WeakMap;l={...n,renderResult(y,I,v,R){let E=R.lastComponent&&h.get(R.lastComponent),C=a.call(n,y,I,v,{...R,lastComponent:E??R.lastComponent});if(I.isPartial||R.durationMs===void 0)return C;let _=new ce;return _.addChild(C),_.addChild(new Ve(1)),_.addChild(new ee(v.fg("muted",`Took ${Ot(R.durationMs)}`),0,0)),h.set(_,C),_}},S.set(n,l)}return l},"timedDefinition"),m=r((o,n,a)=>{n.result=a,n.resultOmitted=!1;try{let h=JSON.stringify(o);if(Buffer.byteLength(h)<=He){n.result=JSON.parse(JSON.stringify(a));return}}catch{}let l=a.details&&typeof a.details=="object"?Object.entries(a.details).filter(([h,y])=>(h==="source"||h==="fullOutputPath")&&typeof y=="string").map(([h,y])=>`${h}: ${String(y)}`):[];n.result={content:[{type:"text",text:["Result presentation omitted (history size limit or unsupported payload).",...l].join(`
37
+ `)}],details:void 0,isError:a.isError},n.resultOmitted=!0},"retainResult"),f=r(()=>{i.clear(),u.clear(),c.clear()},"clear");e.on("session_start",(o,n)=>{f(),n.mode==="tui"&&n.ui.setWidget(ue,a=>(b=a,{render:r(()=>[],"render"),invalidate:r(()=>{},"invalidate")}))}),e.on("session_tree",f),e.on("session_shutdown",f),e.on("tool_execution_start",(o,n)=>{if(o.parentToolCallId===void 0){let E=d(o.toolName);E!==void 0&&i.set(o.toolCallId,E);return}let a=u.get(o.parentToolCallId)??o.parentToolCallId;if(u.set(o.toolCallId,a),i.get(a)===o.toolName||!s.has(o.toolName))return;let l=c.get(a);if(l||(l={parentToolCallId:a,cwd:n.cwd,calls:[],retention:Dt()},c.set(a,l)),l.calls.length>=Ye){l.retention.callsOmitted=!0;return}let h=JSON.stringify(o.args),y=_t-l.calls.reduce((E,C)=>E+Buffer.byteLength(JSON.stringify(C.args)),0)-(Ye-l.calls.length-1)*2,I=Buffer.byteLength(h)>Math.min(Xe,y),v=I?Object.fromEntries(Object.entries(o.args).map(([E,C])=>[E,typeof C=="string"?C.slice(0,200)+(C.length>200?"\u2026 [omitted]":""):"[omitted]"])):JSON.parse(h),R=Buffer.byteLength(JSON.stringify(v))<=Math.min(Xe,y)?v:{};l.calls.push({id:o.toolCallId,name:o.toolName,args:R,argumentsTruncated:I})}),e.on("tool_execution_end",o=>{i.delete(o.toolCallId);let n=u.get(o.toolCallId);if(n===void 0)return;u.delete(o.toolCallId);let a=c.get(n),l=a?.calls.find(h=>h.id===o.toolCallId);if(a&&l){typeof o.durationMs=="number"&&Number.isFinite(o.durationMs)&&(l.durationMs=o.durationMs);let h=o.result;m(a,l,{content:h.content.filter(y=>y.type!=="text"||!y.text.startsWith(`
38
38
 
39
39
  ---
40
40
 
41
- # Guide:`)),details:h.details,isError:o.isError})}}),e.on("message_end",o=>{if(o.message.role!=="toolResult")return;let n=c.get(o.message.toolCallId);if(!n)return;c.delete(o.message.toolCallId);for(let[y,I]of u)I===n.parentToolCallId&&u.delete(y);let s=n.calls.filter(y=>!y.batched),l={...n,parentToolName:o.message.toolName,calls:[],retention:{...n.retention,argumentsTruncated:s.some(y=>y.argumentsTruncated===!0),resultsOmitted:s.some(y=>y.resultOmitted===!0),resultsUnavailable:s.some(y=>!y.result)}},h=Buffer.byteLength(JSON.stringify(l));for(let y of s){let I=JSON.stringify(y);if(h+=Buffer.byteLength(I)+(l.calls.length>0?1:0),h>He){l.retention.callsOmitted=!0;break}l.calls.push(JSON.parse(I))}e.appendEntry(ue,l)}),e.registerEntryRenderer(ue,r(function o(n,s,l){if(!Array.isArray(n.data?.calls))return;let h=(typeof t=="function"?t():t)&&n.data.parentToolName==="codemode"&&!s.expanded,y=h?n.data.calls.filter(E=>E.result?.isError):n.data.calls;if(h&&y.length===0){let E=Ke(n.data);return E?new ee(l.fg("warning",E),0,0):new ce}if(!b)return{render:r(E=>b?o(n,s,l)?.render(E)??[]:[],"render"),invalidate:r(()=>{n.data&&p.get(n.data)?.invalidate()},"invalidate")};let I=Ke(n.data),v=h?void 0:p.get(n.data);if(!v){v=new ce;for(let E of y){let C=new Je(E.name,E.id,E.renderArgs??E.args,{showImages:!0},E.resultOmitted||E.omitted||!E.result?void 0:A(E.name),b,n.data.cwd);E.result?C.updateResult({...E.result,...E.durationMs===void 0||E.groupedResult===!0?{}:{durationMs:E.durationMs}}):C.updateResult({content:[{type:"text",text:"Result unavailable in this saved display."}],isError:!0}),v.addChild(new Ve(1)),v.addChild(C)}I&&v.addChild(new ee(l.fg("warning",I),0,0)),h||p.set(n.data,v)}let R=v.children.at(-1);I&&R instanceof ee&&R.setText(l.fg("warning",I));for(let E of v.children)E instanceof Je&&E.setExpanded(s.expanded);return v},"renderEntry"));let g=r(()=>{e.events.on(we,o=>{let n=o,s=c.get(n.parentToolCallId);if(!s)return;let l=te(n.result.details),h=n.calls.findLast(I=>!n.unchangedCopyCalls?.includes(I)),y="callIdsByResult"in l&&Array.isArray(l.callIdsByResult)?l.callIdsByResult:[];for(let I of n.calls){let v=s.calls.find(k=>k.id===I);if(!v)continue;let R=l.results?.filter((k,j)=>(y[j]===I||y.length===0&&n.calls.length===1)&&k.data.errors?.some(O=>O.code==="POST_WRITE_FAILED"||O.code==="POST_EDIT_FAILED"))??[];if(v.postWriteFailure=R.length>0,v.postWriteFailure){v.batched=!1,delete v.renderArgs,m(s,v,{content:n.result.content,details:{results:R,effect:"applied"},isError:!0});continue}let E=n.mutationResults?.get(I),C=E?.details.metadata?.copyRollback;if(v.name==="copy"&&E&&(C==="restored"||C==="failed")){v.copyRollback=C,v.batched=!1,m(s,v,{content:E.content,details:te(E.details),isError:!0});continue}if(v.unchangedCopy=v.name==="copy"&&n.unchangedCopyCalls?.includes(I)===!0,v.batched=!v.unchangedCopy&&I!==h,v.groupedResult=!v.batched&&!v.unchangedCopy&&n.calls.filter(k=>!n.unchangedCopyCalls?.includes(k)).length>1,v.unchangedCopy)m(s,v,{content:[{type:"text",text:"No changes: destination already has this text."}],details:{},isError:!1});else if(v.batched)v.result=void 0;else{new Set(l.mutationRender?.map(j=>j.path)).size>1&&(v.renderArgs={}),v.rollback=l.results?.some(j=>j.data.rollback!==void 0)===!0;let k=v.result?.details?.metadata?.targetUnavailable;m(s,v,{content:n.result.content,details:typeof k=="string"?{...l,metadata:{...l.metadata,targetUnavailable:k}}:l,isError:n.result.isError===!0||v.rollback})}}}),e.on("tool_result",o=>{let n=o.details,s=c.get(o.toolCallId);if(s&&n&&typeof n=="object"&&"editorBatchResults"in n&&Array.isArray(n.editorBatchResults))for(let l of n.editorBatchResults)for(let h of l.data?.operations??[]){let y=s.calls.find(v=>v.id===h.id);if(!y)continue;let I=h.errors.map(v=>v.message);y.rollback||y.postWriteFailure||y.copyRollback!==void 0||y.unchangedCopy&&I.length===0&&h.effect==="not-applied"||(I.length>0||h.effect!=="applied")&&(y.batched=!1,delete y.renderArgs,m(s,y,{content:[{type:"text",text:`${y.name}: ${h.effect}.
41
+ # Guide:`)),details:h.details,isError:o.isError})}}),e.on("message_end",o=>{if(o.message.role!=="toolResult")return;let n=c.get(o.message.toolCallId);if(!n)return;c.delete(o.message.toolCallId);for(let[y,I]of u)I===n.parentToolCallId&&u.delete(y);let a=n.calls.filter(y=>!y.batched),l={...n,parentToolName:o.message.toolName,calls:[],retention:{...n.retention,argumentsTruncated:a.some(y=>y.argumentsTruncated===!0),resultsOmitted:a.some(y=>y.resultOmitted===!0),resultsUnavailable:a.some(y=>!y.result)}},h=Buffer.byteLength(JSON.stringify(l));for(let y of a){let I=JSON.stringify(y);if(h+=Buffer.byteLength(I)+(l.calls.length>0?1:0),h>He){l.retention.callsOmitted=!0;break}l.calls.push(JSON.parse(I))}e.appendEntry(ue,l)}),e.registerEntryRenderer(ue,r(function o(n,a,l){if(!Array.isArray(n.data?.calls))return;let h=(typeof t=="function"?t():t)&&n.data.parentToolName==="codemode"&&!a.expanded,y=h?n.data.calls.filter(E=>E.result?.isError):n.data.calls;if(h&&y.length===0){let E=Ke(n.data);return E?new ee(l.fg("warning",E),0,0):new ce}if(!b)return{render:r(E=>b?o(n,a,l)?.render(E)??[]:[],"render"),invalidate:r(()=>{n.data&&p.get(n.data)?.invalidate()},"invalidate")};let I=Ke(n.data),v=h?void 0:p.get(n.data);if(!v){v=new ce;for(let E of y){let C=new Je(E.name,E.id,E.renderArgs??E.args,{showImages:!0},E.resultOmitted||E.omitted||!E.result?void 0:A(E.name),b,n.data.cwd);E.result?C.updateResult({...E.result,...E.durationMs===void 0||E.groupedResult===!0?{}:{durationMs:E.durationMs}}):C.updateResult({content:[{type:"text",text:"Result unavailable in this saved display."}],isError:!0}),v.addChild(new Ve(1)),v.addChild(C)}I&&v.addChild(new ee(l.fg("warning",I),0,0)),h||p.set(n.data,v)}let R=v.children.at(-1);I&&R instanceof ee&&R.setText(l.fg("warning",I));for(let E of v.children)E instanceof Je&&E.setExpanded(a.expanded);return v},"renderEntry"));let g=r(()=>{e.events.on(we,o=>{let n=o,a=c.get(n.parentToolCallId);if(!a)return;let l=te(n.result.details),h=n.calls.findLast(I=>!n.unchangedCopyCalls?.includes(I)),y="callIdsByResult"in l&&Array.isArray(l.callIdsByResult)?l.callIdsByResult:[];for(let I of n.calls){let v=a.calls.find(_=>_.id===I);if(!v)continue;let R=l.results?.filter((_,F)=>(y[F]===I||y.length===0&&n.calls.length===1)&&_.data.errors?.some(O=>O.code==="POST_WRITE_FAILED"||O.code==="POST_EDIT_FAILED"))??[];if(v.postWriteFailure=R.length>0,v.postWriteFailure){v.batched=!1,delete v.renderArgs,m(a,v,{content:n.result.content,details:{results:R,effect:"applied"},isError:!0});continue}let E=n.mutationResults?.get(I),C=E?.details.metadata?.copyRollback;if(v.name==="copy"&&E&&(C==="restored"||C==="failed")){v.copyRollback=C,v.batched=!1,m(a,v,{content:E.content,details:te(E.details),isError:!0});continue}if(v.unchangedCopy=v.name==="copy"&&n.unchangedCopyCalls?.includes(I)===!0,v.batched=!v.unchangedCopy&&I!==h,v.groupedResult=!v.batched&&!v.unchangedCopy&&n.calls.filter(_=>!n.unchangedCopyCalls?.includes(_)).length>1,v.unchangedCopy)m(a,v,{content:[{type:"text",text:"No changes: destination already has this text."}],details:{},isError:!1});else if(v.batched)v.result=void 0;else{new Set(l.mutationRender?.map(F=>F.path)).size>1&&(v.renderArgs={}),v.rollback=l.results?.some(F=>F.data.rollback!==void 0)===!0;let _=v.result?.details?.metadata?.targetUnavailable;m(a,v,{content:n.result.content,details:typeof _=="string"?{...l,metadata:{...l.metadata,targetUnavailable:_}}:l,isError:n.result.isError===!0||v.rollback})}}}),e.on("tool_result",o=>{let n=o.details,a=c.get(o.toolCallId);if(a&&n&&typeof n=="object"&&"editorBatchResults"in n&&Array.isArray(n.editorBatchResults))for(let l of n.editorBatchResults)for(let h of l.data?.operations??[]){let y=a.calls.find(v=>v.id===h.id);if(!y)continue;let I=h.errors.map(v=>v.message);y.rollback||y.postWriteFailure||y.copyRollback!==void 0||y.unchangedCopy&&I.length===0&&h.effect==="not-applied"||(I.length>0||h.effect!=="applied")&&(y.batched=!1,delete y.renderArgs,m(a,y,{content:[{type:"text",text:`${y.name}: ${h.effect}.
42
42
  ${I.join(`
43
- `)}`}],details:void 0,isError:I.length>0||h.effect==="unknown"}))}})},"finalize");return{api:{...e,registerTool:r(o=>{a.set(o.name,o),e.registerTool(o)},"registerTool")},finalize:g}}r(Ze,"createNestedIdeRendering");function fe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}r(fe,"isRecord");function Qe(e,t){let a=e.map(d=>!fe(d)||d.type!=="function"||typeof d.name!="string"||!t.has(d.name)||d.strict!==void 0?d:{...d,strict:!1});return a.some((d,i)=>d!==e[i])?a:e}r(Qe,"relaxed");function et(e,t){if(!fe(e))return e;let a=e;if(Array.isArray(e.tools)){let i=Qe(e.tools,t);i!==e.tools&&(a={...a,tools:i})}let d=e.input;if(Array.isArray(d)){let i=d.map(u=>{if(!fe(u)||u.type!=="additional_tools"||!Array.isArray(u.tools))return u;let c=Qe(u.tools,t);return c===u.tools?u:{...u,tools:c}});i.some((u,c)=>u!==d[c])&&(a={...a,input:i})}return a}r(et,"preserveResponsesToolOmission");function tt(e,t,a){let d=new Map,i=[],u=[];function c(A,m){Ae(A,m);for(let f of m){let g=d.get(f.id);if(g)throw new Error(`Setting ${f.id} is already registered by ${g.owner}`)}for(let f of m)if(d.set(f.id,{owner:A,definition:f}),f.kind==="boolean"){let{kind:g,group:w,...o}=f;i.push({...o,...w==="ui"?{group:w}:{}})}else u.push({...f,group:f.group??"features"})}r(c,"register"),c("pi-agent-ide",[...t.map(A=>({...A,kind:"boolean"})),...a]);async function b(A,m){let f=d.get(A)?.definition;if(!f)throw new Error(`Unknown Agent IDE setting: ${A}`);let g=V(process.env,void 0,m),[w,o]=await Promise.all([B(g.globalPath),B(g.projectPath)]),n=f.kind==="boolean"?{...$(w),...$(o)}:{...w.preferences,...o.preferences},s=Object.hasOwn(n,A),l=s?n[A]:f.default;if(l===void 0||(f.kind==="boolean"?typeof l!="boolean":typeof l!="string"))throw new Error(`Invalid saved setting type: ${A}`);if(f.kind==="choice"&&!f.values.some(h=>h.value===l))throw new Error(`Invalid saved setting choice: ${A}`);return{value:l,overridden:s}}r(b,"read");let p=e.events.on(Ie,A=>{let m=A;try{c(m.owner,m.definitions),m.accept()}catch(f){m.accept(f instanceof Error?f:new Error(String(f)))}}),S=e.events.on(xe,A=>{let m=A;m.accept(b(m.id,m.cwd))});return e.on("session_shutdown",()=>{p(),S()}),e.events.emit(Se,void 0),{flags:i,preferences:u,read:b}}r(tt,"createAgentIdeSettingsRegistry");import{VERSION as rt}from"@earendil-works/pi-coding-agent";import{getCurrentTools as Dt}from"@earendil-works/pi-ai";function nt(e){let t=/^(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/u.exec(e);if(t===null||pe(t,[0,99,1])<0||it(t,[0,99,1]))throw new Error(`Pi Agent IDE requires Pi 0.99.1 or newer; this host is ${e}. Update Pi before loading the extension.`)}r(nt,"assertSupportedHost");function ot(e){let t=/^(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z.-]+)?/u.exec(e);return t!==null&&pe(t,[1,3,0])>=0&&!it(t,[1,3,0])}r(ot,"hostOwnsToolLoadout");function pe(e,t){return e.slice(1,4).map((a,d)=>Number(a)-(t[d]??0)).find(a=>a!==0)??0}r(pe,"compareVersion");function it(e,t){return pe(e,t)===0&&e[4]!==void 0}r(it,"isPrereleaseOf");async function Ot(e){nt(rt);let t=await X(V()),a={...t.preferences};for(let g of["ui.codemode","ui.read","ui.search","ui.diffs","ui.terminal"])_e(e,g,w=>{w===void 0?delete a[g]:a[g]=w});let d=Ze(e,()=>a["ui.codemode"]!=="on"),i=ye(d.api),u=Be(i.api),c=qe(u.api),b=!1;e.on("session_shutdown",()=>{b=!0}),e.on("before_provider_request",(g,w)=>{if(b||w.model?.api!=="openai-responses")return;let o=new Set(e.getAllTools().filter(n=>n.namespace?.name.startsWith("ide_")).map(n=>n.name));return et(g.payload,o)}),e.on("session_start",(g,w)=>{if(b=!1,ot(rt)){u.reconcile(!0,[],!0);return}let o=g.reason==="reload"?[]:Dt(w.sessionManager.getBranch().flatMap(n=>n.type==="message"?[n.message]:[])).map(n=>n.name);u.reconcile(!0,o)}),e.on("before_agent_start",g=>{u.reconcile();let w=g.systemPromptOptions;w.toolSnippets.bash&&(w.toolSnippets.bash=w.toolSnippets.bash.replace("Execute bash commands (ls, grep, find, etc.)","Execute Bash commands"));let o=/^<rules>\n([\s\S]*?)\n<\/rules>$/mu.exec(g.systemPrompt)?.[1];o?.includes("- Use bash for file operations like ls, rg, find")&&(w.sections.rules=o.replace(/(?:^|\n)- Use bash for file operations like ls, rg, find(?=\n|$)/u,"").trim());let n=e.getAllTools().filter(I=>I.exposure!=="hidden"),s=e.getActiveTools(),l=s.includes("tool_search")?"Use tool_search to find":s.includes("codemode")?"Use searchTools inside codemode to find":"Enable native tool_search to find",h=n.filter(I=>I.namespace?.name==="ide_git").map(I=>I.name),y=[...h.length===0?[]:[`${l} ${h.join(" and ")} in ide_git when staging or unstaging selected Git changes.`],...n.some(I=>I.name==="debug"&&I.namespace?.name==="ide_debug")?[`${l} debug in ide_debug when creating a debugger session.`]:[]];w.sections.ide_discovery=y.join(`
44
- `)});let p=je(e,{"pi-agent-ide-no-animations":t.noAnimations??!1,"pi-agent-ide-no-post-processing":t.noPostProcessing??!1,...t.flags});p.register({id:"pi-agent-ide-developer-mode",name:"Developer mode",description:"Enable development commands, including manual setup-hint previews.",default:!1}),p.register({id:"pi-agent-ide-no-animations",name:"Static edit previews",group:"ui",description:"Show edit results immediately, without animated playback.",default:!1}),p.register({id:"pi-agent-ide-no-post-processing",name:"Skip automatic post-processing",description:"Skip automatic formatting and diagnostics after edits. Explicit diagnostic reads still work.",default:!1}),p.register({id:"pi-agent-ide-no-diagnostic-buffer",name:"Immediate diagnostic notices",description:"Send findings immediately instead of combining reports received over five seconds.",group:"ui",default:!1}),p.register({id:"pi-agent-ide-code-review",name:"Jev code review",description:"Review saved edit fragments against project YAML rules in the background. Sends code to a connected Jev provider.",default:!1}),p.register({id:"pi-agent-ide-code-review-capture",name:"Capture code-review rules",description:"Use the packaged skill to propose reusable rules from user review feedback. Save only after confirmation.",default:!1});let S=tt(e,[...p.definitions,{id:"pi-agent-ide-yolo",name:"YOLO: allow all operations",description:"Skip existing operation confirmation dialogs unless an extension explicitly disables its YOLO setting. Safety checks and remote permissions still apply.",default:!1,labels:{on:"on",off:"off"}},{id:"pi-agent-ide-filesystem-yolo",name:"YOLO: filesystem operations",description:"Skip filesystem operation confirmations. Default inherits common YOLO; Off disables persistent permission, not remembered session grants. Protected paths stay protected.",default:!1,labels:{on:"on",off:"off"}}],Z);he(e,{async isAllowed(g,w){if(g.yoloSetting===void 0)return!1;let o=await oe(e.events,g.yoloSetting,w.cwd);if(typeof o.value!="boolean")throw new Error(`Operation approval needs a boolean YOLO setting: ${g.yoloSetting}`);return o.overridden?o.value:(await oe(e.events,"pi-agent-ide-yolo",w.cwd)).value===!0}}),Me(e,S.flags,S.preferences,t),$e(e),be(e,[Fe(S.flags,S.preferences)]);let A=J(M,t.preset??"full"),{enabled:m}=Y(M,[...A,...t.disabled],t.enabled),f=Re(e,"pi-agent-ide-no-animations");for(let g of m)await g.register(c.api,{preferences:a,animationsEnabled:r(()=>!f(),"animationsEnabled")});c.finalize(()=>u.reconcile(!0,[],!0)),d.finalize(),i.finalize()}r(Ot,"registerUnifiedPiAgentIde");export{Ot as default};
43
+ `)}`}],details:void 0,isError:I.length>0||h.effect==="unknown"}))}})},"finalize");return{api:{...e,registerTool:r(o=>{s.set(o.name,o),e.registerTool(o)},"registerTool")},finalize:g}}r(Ze,"createNestedIdeRendering");function et(e){e.on("tool_result",t=>{let s=Qe(t.details),d=Qe(t.structuredContent);if(!(s===void 0&&d===void 0))return{...s!==void 0&&{details:s.value},...d!==void 0&&{structuredContent:d.value}}})}r(et,"registerDetachedResults");function Qe(e){if(e!=null)try{return{value:structuredClone(e)}}catch{return}}r(Qe,"detached");function fe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}r(fe,"isRecord");function tt(e,t){let s=e.map(d=>!fe(d)||d.type!=="function"||typeof d.name!="string"||!t.has(d.name)||d.strict!==void 0?d:{...d,strict:!1});return s.some((d,i)=>d!==e[i])?s:e}r(tt,"relaxed");function nt(e,t){if(!fe(e))return e;let s=e;if(Array.isArray(e.tools)){let i=tt(e.tools,t);i!==e.tools&&(s={...s,tools:i})}let d=e.input;if(Array.isArray(d)){let i=d.map(u=>{if(!fe(u)||u.type!=="additional_tools"||!Array.isArray(u.tools))return u;let c=tt(u.tools,t);return c===u.tools?u:{...u,tools:c}});i.some((u,c)=>u!==d[c])&&(s={...s,input:i})}return s}r(nt,"preserveResponsesToolOmission");function ot(e,t,s){let d=new Map,i=[],u=[];function c(A,m){Ae(A,m);for(let f of m){let g=d.get(f.id);if(g)throw new Error(`Setting ${f.id} is already registered by ${g.owner}`)}for(let f of m)if(d.set(f.id,{owner:A,definition:f}),f.kind==="boolean"){let{kind:g,group:w,...o}=f;i.push({...o,...w==="ui"?{group:w}:{}})}else u.push({...f,group:f.group??"features"})}r(c,"register"),c("pi-agent-ide",[...t.map(A=>({...A,kind:"boolean"})),...s]);async function b(A,m){let f=d.get(A)?.definition;if(!f)throw new Error(`Unknown Agent IDE setting: ${A}`);let g=V(process.env,void 0,m),[w,o]=await Promise.all([j(g.globalPath),j(g.projectPath)]),n=f.kind==="boolean"?{...$(w),...$(o)}:{...w.preferences,...o.preferences},a=Object.hasOwn(n,A),l=a?n[A]:f.default;if(l===void 0||(f.kind==="boolean"?typeof l!="boolean":typeof l!="string"))throw new Error(`Invalid saved setting type: ${A}`);if(f.kind==="choice"&&!f.values.some(h=>h.value===l))throw new Error(`Invalid saved setting choice: ${A}`);return{value:l,overridden:a}}r(b,"read");let p=e.events.on(Ie,A=>{let m=A;try{c(m.owner,m.definitions),m.accept()}catch(f){m.accept(f instanceof Error?f:new Error(String(f)))}}),S=e.events.on(xe,A=>{let m=A;m.accept(b(m.id,m.cwd))});return e.on("session_shutdown",()=>{p(),S()}),e.events.emit(Se,void 0),{flags:i,preferences:u,read:b}}r(ot,"createAgentIdeSettingsRegistry");import{VERSION as at}from"@earendil-works/pi-coding-agent";import{getCurrentTools as Nt}from"@earendil-works/pi-ai";function it(e){let t=/^(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/u.exec(e);if(t===null||pe(t,[0,99,1])<0||st(t,[0,99,1]))throw new Error(`Pi Agent IDE requires Pi 0.99.1 or newer; this host is ${e}. Update Pi before loading the extension.`)}r(it,"assertSupportedHost");function rt(e){let t=/^(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z.-]+)?/u.exec(e);return t!==null&&pe(t,[1,3,0])>=0&&!st(t,[1,3,0])}r(rt,"hostOwnsToolLoadout");function pe(e,t){return e.slice(1,4).map((s,d)=>Number(s)-(t[d]??0)).find(s=>s!==0)??0}r(pe,"compareVersion");function st(e,t){return pe(e,t)===0&&e[4]!==void 0}r(st,"isPrereleaseOf");async function Mt(e){it(at);let t=await X(V()),s={...t.preferences};for(let g of["ui.codemode","ui.read","ui.search","ui.diffs","ui.terminal"])ke(e,g,w=>{w===void 0?delete s[g]:s[g]=w});let d=Ze(e,()=>s["ui.codemode"]!=="on"),i=ye(d.api),u=je(i.api),c=We(u.api),b=!1;e.on("session_shutdown",()=>{b=!0}),e.on("before_provider_request",(g,w)=>{if(b||w.model?.api!=="openai-responses")return;let o=new Set(e.getAllTools().filter(n=>n.namespace?.name.startsWith("ide_")).map(n=>n.name));return nt(g.payload,o)}),e.on("session_start",(g,w)=>{if(b=!1,rt(at)){u.reconcile(!0,[],!0);return}let o=g.reason==="reload"?[]:Nt(w.sessionManager.getBranch().flatMap(n=>n.type==="message"?[n.message]:[])).map(n=>n.name);u.reconcile(!0,o)}),e.on("before_agent_start",g=>{u.reconcile();let w=g.systemPromptOptions;w.toolSnippets.bash&&(w.toolSnippets.bash=w.toolSnippets.bash.replace("Execute bash commands (ls, grep, find, etc.)","Execute Bash commands"));let o=/^<rules>\n([\s\S]*?)\n<\/rules>$/mu.exec(g.systemPrompt)?.[1];o?.includes("- Use bash for file operations like ls, rg, find")&&(w.sections.rules=o.replace(/(?:^|\n)- Use bash for file operations like ls, rg, find(?=\n|$)/u,"").trim());let n=e.getAllTools().filter(I=>I.exposure!=="hidden"),a=e.getActiveTools(),l=a.includes("tool_search")?"Use tool_search to find":a.includes("codemode")?"Use searchTools inside codemode to find":"Enable native tool_search to find",h=n.filter(I=>I.namespace?.name==="ide_git").map(I=>I.name),y=[...h.length===0?[]:[`${l} ${h.join(" and ")} in ide_git when staging or unstaging selected Git changes.`],...n.some(I=>I.name==="debug"&&I.namespace?.name==="ide_debug")?[`${l} debug in ide_debug when creating a debugger session.`]:[]];w.sections.ide_discovery=y.join(`
44
+ `)});let p=Fe(e,{"pi-agent-ide-no-animations":t.noAnimations??!1,"pi-agent-ide-no-post-processing":t.noPostProcessing??!1,...t.flags});p.register({id:"pi-agent-ide-developer-mode",name:"Developer mode",description:"Enable development commands, including manual setup-hint previews.",default:!1}),p.register({id:"pi-agent-ide-no-animations",name:"Static edit previews",group:"ui",description:"Show edit results immediately, without animated playback.",default:!1}),p.register({id:"pi-agent-ide-no-post-processing",name:"Skip automatic post-processing",description:"Skip automatic formatting and diagnostics after edits. Explicit diagnostic reads still work.",default:!1}),p.register({id:"pi-agent-ide-no-diagnostic-buffer",name:"Immediate diagnostic notices",description:"Send findings immediately instead of combining reports received over five seconds.",group:"ui",default:!1}),p.register({id:"pi-agent-ide-code-review",name:"Jev code review",description:"Review saved edit fragments against project YAML rules in the background. Sends code to a connected Jev provider.",default:!1}),p.register({id:"pi-agent-ide-code-review-capture",name:"Capture code-review rules",description:"Use the packaged skill to propose reusable rules from user review feedback. Save only after confirmation.",default:!1});let S=ot(e,[...p.definitions,{id:"pi-agent-ide-yolo",name:"YOLO: allow all operations",description:"Skip existing operation confirmation dialogs unless an extension explicitly disables its YOLO setting. Safety checks and remote permissions still apply.",default:!1,labels:{on:"on",off:"off"}},{id:"pi-agent-ide-filesystem-yolo",name:"YOLO: filesystem operations",description:"Skip filesystem operation confirmations. Default inherits common YOLO; Off disables persistent permission, not remembered session grants. Protected paths stay protected.",default:!1,labels:{on:"on",off:"off"}}],Z);he(e,{async isAllowed(g,w){if(g.yoloSetting===void 0)return!1;let o=await oe(e.events,g.yoloSetting,w.cwd);if(typeof o.value!="boolean")throw new Error(`Operation approval needs a boolean YOLO setting: ${g.yoloSetting}`);return o.overridden?o.value:(await oe(e.events,"pi-agent-ide-yolo",w.cwd)).value===!0}}),Me(e,S.flags,S.preferences,t),$e(e),be(e,[Le(S.flags,S.preferences)]);let A=J(M,t.preset??"full"),{enabled:m}=Y(M,[...A,...t.disabled],t.enabled),f=Re(e,"pi-agent-ide-no-animations");for(let g of m)await g.register(c.api,{preferences:s,animationsEnabled:r(()=>!f(),"animationsEnabled")});c.finalize(()=>u.reconcile(!0,[],!0)),d.finalize(),i.finalize(),et(e)}r(Mt,"registerUnifiedPiAgentIde");export{Mt as default};
@@ -126,6 +126,8 @@ Check package paths before committing:
126
126
  pnpm check:paths
127
127
  ```
128
128
 
129
+ Imports of TypeScript files name the `.ts` file, for example `#src/core/read-core.ts` or `./position-map.ts`, not `.js`. Pi loads a local checkout through jiti, which tries a `.js` specifier's missing file before it finds the `.ts` file; with about 1,700 such imports, loading the extension from sources took four times longer. `pnpm check:imports` reports `.js` imports of TypeScript files, and `pnpm check` runs it.
130
+
129
131
  ## Build the public package
130
132
 
131
133
  Build and validate the single publishable tarball:
@@ -8,3 +8,4 @@ Detected extensions: `.py`, `.pyi`.
8
8
  | formatter | `black` | `pyproject.toml: tool.black` | [Official docs](https://black.readthedocs.io/) |
9
9
  | linter | `ruff` | `pyproject.toml`, `ruff.toml`, `.ruff.toml` | [Official docs](https://docs.astral.sh/ruff/) |
10
10
  | lsp | `basedpyright` | `pyproject.toml`, `pyrightconfig.json` | [Official docs](https://docs.basedpyright.com/) |
11
+ | lsp | `pyright` | `pyproject.toml`, `pyrightconfig.json` | [Official docs](https://microsoft.github.io/pyright/) |
package/docs/tools.md CHANGED
@@ -176,6 +176,8 @@ Use `start` alone for an exact fragment or one line selection. Paired `start`/`e
176
176
 
177
177
  Independent standalone edits in one tool-call batch use their original snapshots. Inside native Codemode, run dependent edits in order and independent resources concurrently. Dependent source-tool calls commit eligible pending edits before consuming their results; script completion saves the remaining batch. Write saves its file and finishes post-edit processing before returning. No Apply or Flush tool is needed.
178
178
 
179
+ Several Pi processes on one machine can edit the same file. Their reads and writes of a file run one at a time, and a write replaces the file in one step, so neither Pi nor other programs such as ripgrep or a language server read a half-written file, and a write never replaces text that changed after its edit read the file. Such an edit runs again on the current text: exact text and `symbol:` selectors resolve again, while snapshot-backed selectors such as line anchors are rejected because the lines they named changed. When another process rewrites the file before a Codemode batch's final post-processing, the batch's edits stay saved, post-processing of the newer text is skipped, and the result says so. When a language server answered for an older version of the file, `symbol:` selectors and `lsp_search` results move with their unchanged lines; a declaration whose own lines changed is resolved again, and one the server cannot answer for because the file keeps changing fails with a clear message. `ast_search` parses the same bytes it reports on. An empty list of incoming calls notes that the server's index can miss callers added in the last seconds.
180
+
179
181
  Check the final reported effects after failures or interruptions. An error does not prove rollback: earlier accepted edits can remain, and recursive operations have no atomic undo. Use text undo or Git-change undo deliberately; neither is a script-wide transaction. See [result composition](./structured-results.md) and the [editing guide](./agent-guides/editing.md) for reference lifetime and recovery.
180
182
 
181
183
  An omitted path can reuse the last resolved source when it is unambiguous. Supply the path when several resources could be meant.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-doctor",
3
- "version": "0.9.4",
3
+ "version": "0.9.6",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
@@ -2,9 +2,9 @@ import {
2
2
  DOCTOR_CORE_READY_EVENT,
3
3
  DOCTOR_PLUGIN_REGISTER_EVENT,
4
4
  isDoctorCoreReady,
5
- } from "./plugin-protocol.js";
5
+ } from "./plugin-protocol.ts";
6
6
 
7
- import type { DoctorPlugin, DoctorPluginRegistrationRequest } from "./plugin-protocol.js";
7
+ import type { DoctorPlugin, DoctorPluginRegistrationRequest } from "./plugin-protocol.ts";
8
8
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
9
9
 
10
10
  /**
@@ -1,7 +1,7 @@
1
1
  import { access, readFile, readdir } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
 
4
- import type { ToolRecipe } from "./catalog.js";
4
+ import type { ToolRecipe } from "./catalog.ts";
5
5
 
6
6
  /** Native project evidence shared by Doctor and runtime tool selection. */
7
7
  export interface RecipeEvidence {
@@ -1,7 +1,7 @@
1
1
  import { mkdir, mkdtemp, readFile, rm, stat, writeFile } from "node:fs/promises";
2
2
  import path from "node:path";
3
- import { probeExecutable } from "../executable.js";
4
- import { probeProjectExecutable } from "../project-probes.js";
3
+ import { probeExecutable } from "../executable.ts";
4
+ import { probeProjectExecutable } from "../project-probes.ts";
5
5
 
6
6
  async function ownedPid(marker: string): Promise<number> {
7
7
  const pid = Number(await readFile(marker, "utf8"));