pi-agent-ide 0.1.1 → 0.2.1

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 (702) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +11 -5
  3. package/dist/chunk-266RH77Z.js +1 -0
  4. package/dist/chunk-2SKAED2I.js +2 -0
  5. package/dist/chunk-2XYXV5HS.js +4 -0
  6. package/dist/chunk-2ZMYT6ZC.js +1 -0
  7. package/dist/chunk-34ZQTTU2.js +2 -0
  8. package/dist/chunk-3H2EU7VQ.js +0 -0
  9. package/dist/chunk-3YK4XMWB.js +0 -0
  10. package/dist/chunk-4SQQKEVD.js +16 -0
  11. package/dist/chunk-5BWUVAR4.js +1 -0
  12. package/dist/chunk-6DN7NO7L.js +1 -0
  13. package/dist/chunk-6SMFVLTY.js +1 -0
  14. package/dist/chunk-6XQQBKPE.js +58 -0
  15. package/dist/chunk-BYWAG6X3.js +6 -0
  16. package/dist/chunk-DEP55R35.js +1 -0
  17. package/dist/chunk-E2RESHYR.js +1 -0
  18. package/dist/chunk-EEH4WYI7.js +1 -0
  19. package/dist/chunk-EI7MMDWY.js +1 -0
  20. package/dist/chunk-ERVMDQGX.js +1 -0
  21. package/dist/chunk-EW2KVKCN.js +2 -0
  22. package/dist/chunk-F6SESI3P.js +4 -0
  23. package/dist/chunk-GTK5AREE.js +2 -0
  24. package/dist/chunk-HOBTFFQR.js +1 -0
  25. package/dist/chunk-IMVCVPMP.js +3 -0
  26. package/dist/chunk-IOCABSRL.js +1 -0
  27. package/dist/chunk-JASLOB2X.js +1 -0
  28. package/dist/chunk-JMVDFOTQ.js +1 -0
  29. package/dist/chunk-K4ZMRDEI.js +0 -0
  30. package/dist/chunk-KH5KPBCR.js +10 -0
  31. package/dist/chunk-KINKBPPX.js +1 -0
  32. package/dist/chunk-KNMWCDDK.js +7 -0
  33. package/dist/chunk-KYVOMBO5.js +1 -0
  34. package/dist/chunk-KZBAJFCV.js +1 -0
  35. package/dist/chunk-L4FA6OD4.js +1 -0
  36. package/dist/chunk-LFV6G5Z3.js +1 -0
  37. package/dist/chunk-LGN7EJYR.js +13 -0
  38. package/dist/chunk-MB6VVVAF.js +2 -0
  39. package/dist/chunk-MBUXFKIW.js +3 -0
  40. package/dist/chunk-MTQSGWZJ.js +1 -0
  41. package/dist/chunk-MTTKFJV6.js +1 -0
  42. package/dist/chunk-N34ATN52.js +1 -0
  43. package/dist/chunk-NI2NK4JU.js +1 -0
  44. package/dist/chunk-NNCZYO4Q.js +0 -0
  45. package/dist/chunk-NXHPO7ER.js +6 -0
  46. package/dist/chunk-OBWZ5RYN.js +1 -0
  47. package/dist/chunk-OFHVDY4Q.js +2 -0
  48. package/dist/chunk-OIL6BB2S.js +33 -0
  49. package/dist/chunk-ONWUJXUR.js +1 -0
  50. package/dist/chunk-ORAPGW7W.js +1 -0
  51. package/dist/chunk-OVUYPHDE.js +1 -0
  52. package/dist/chunk-PETQCA7G.js +1 -0
  53. package/dist/chunk-PODWLGNO.js +6 -0
  54. package/dist/chunk-QZANC2IG.js +1 -0
  55. package/dist/chunk-SJYDLHEF.js +108 -0
  56. package/dist/chunk-SMSIT3CE.js +3 -0
  57. package/dist/chunk-SSZB66C3.js +3 -0
  58. package/dist/chunk-STUZZM5B.js +1 -0
  59. package/dist/chunk-T2RPMEM2.js +1 -0
  60. package/dist/chunk-TG6H6EOI.js +1 -0
  61. package/dist/chunk-UTTW55S2.js +1 -0
  62. package/dist/chunk-VCCMVQXU.js +1 -0
  63. package/dist/chunk-VEJGSURY.js +8 -0
  64. package/dist/chunk-VFBLX4TG.js +1 -0
  65. package/dist/chunk-VSP2QQPQ.js +2 -0
  66. package/dist/chunk-W3XYKJ5H.js +1 -0
  67. package/dist/chunk-WZI4YC2O.js +1 -0
  68. package/dist/chunk-XGUAL3CA.js +1 -0
  69. package/dist/chunk-XNXQYPVT.js +10 -0
  70. package/dist/chunk-YHUTTZC6.js +2 -0
  71. package/dist/chunk-YPHXLAQF.js +1 -0
  72. package/dist/chunk-ZC65Z3CK.js +1 -0
  73. package/dist/chunk-ZIHEF6K3.js +3 -0
  74. package/dist/entry-0.js +1 -0
  75. package/dist/entry-1.js +1 -0
  76. package/dist/entry-10.js +1 -0
  77. package/dist/entry-11.js +1 -0
  78. package/dist/entry-12.js +1 -0
  79. package/dist/entry-13.js +1 -0
  80. package/dist/entry-14.js +1 -0
  81. package/dist/entry-16.js +1 -0
  82. package/dist/entry-17.js +1 -0
  83. package/dist/entry-18.js +1 -0
  84. package/dist/entry-19.js +1 -0
  85. package/dist/entry-2.js +1 -0
  86. package/dist/entry-20.js +1 -0
  87. package/dist/entry-21.js +1 -0
  88. package/dist/entry-22.js +1 -0
  89. package/dist/entry-23.js +1 -0
  90. package/dist/entry-24.js +1 -0
  91. package/dist/entry-25.js +1 -0
  92. package/dist/entry-26.js +1 -0
  93. package/dist/entry-27.js +1 -0
  94. package/dist/entry-28.js +1 -0
  95. package/dist/entry-29.js +1 -0
  96. package/dist/entry-3.js +1 -0
  97. package/dist/entry-30.js +1 -0
  98. package/dist/entry-31.js +1 -0
  99. package/dist/entry-32.js +1 -0
  100. package/dist/entry-33.js +1 -0
  101. package/dist/entry-34.js +1 -0
  102. package/dist/entry-35.js +1 -0
  103. package/dist/entry-36.js +1 -0
  104. package/dist/entry-37.js +1 -0
  105. package/dist/entry-38.js +1 -0
  106. package/dist/entry-39.js +1 -0
  107. package/dist/entry-4.js +1 -0
  108. package/dist/entry-40.js +1 -0
  109. package/dist/entry-41.js +1 -0
  110. package/dist/entry-42.js +1 -0
  111. package/dist/entry-43.js +1 -0
  112. package/dist/entry-44.js +1 -0
  113. package/dist/entry-45.js +1 -0
  114. package/dist/entry-46.js +1 -0
  115. package/dist/entry-47.js +1 -0
  116. package/dist/entry-48.js +1 -0
  117. package/dist/entry-49.js +1 -0
  118. package/dist/entry-5.js +1 -0
  119. package/dist/entry-50.js +1 -0
  120. package/dist/entry-51.js +1 -0
  121. package/dist/entry-52.js +1 -0
  122. package/dist/entry-53.js +1 -0
  123. package/dist/entry-54.js +0 -0
  124. package/dist/entry-55.js +1 -0
  125. package/dist/entry-56.js +0 -0
  126. package/dist/entry-57.js +1 -0
  127. package/dist/entry-58.js +1 -0
  128. package/dist/entry-59.js +1 -0
  129. package/dist/entry-6.js +1 -0
  130. package/dist/entry-60.js +1 -0
  131. package/dist/entry-61.js +1 -0
  132. package/dist/entry-62.js +1 -0
  133. package/dist/entry-63.js +0 -0
  134. package/dist/entry-64.js +1 -0
  135. package/dist/entry-65.js +0 -0
  136. package/dist/entry-66.js +1 -0
  137. package/dist/entry-67.js +1 -0
  138. package/dist/entry-68.js +1 -0
  139. package/dist/entry-69.js +1 -0
  140. package/dist/entry-7.js +1 -0
  141. package/dist/entry-70.js +1 -0
  142. package/dist/entry-71.js +1 -0
  143. package/dist/entry-72.js +1 -0
  144. package/dist/entry-73.js +1 -0
  145. package/dist/entry-74.js +1 -0
  146. package/dist/entry-75.js +1 -0
  147. package/dist/entry-76.js +1 -0
  148. package/dist/entry-77.js +1 -0
  149. package/dist/entry-78.js +1 -0
  150. package/dist/entry-79.js +1 -0
  151. package/dist/entry-8.js +1 -0
  152. package/dist/entry-80.js +1 -0
  153. package/dist/entry-9.js +1 -0
  154. package/dist/pi-agent-ide.js +13 -0
  155. package/docs/architecture.md +21 -17
  156. package/docs/configuration.md +180 -52
  157. package/docs/development.md +105 -5
  158. package/docs/extensions.md +64 -4
  159. package/docs/generated/tool-catalog/cmake.md +5 -5
  160. package/docs/generated/tool-catalog/csharp.md +5 -5
  161. package/docs/generated/tool-catalog/css.md +7 -6
  162. package/docs/generated/tool-catalog/dart.md +9 -0
  163. package/docs/generated/tool-catalog/dockerfile.md +5 -5
  164. package/docs/generated/tool-catalog/elixir.md +9 -0
  165. package/docs/generated/tool-catalog/html.md +7 -5
  166. package/docs/generated/tool-catalog/index.md +9 -0
  167. package/docs/generated/tool-catalog/javascript.md +8 -6
  168. package/docs/generated/tool-catalog/json.md +7 -6
  169. package/docs/generated/tool-catalog/julia.md +8 -0
  170. package/docs/generated/tool-catalog/kotlin.md +6 -5
  171. package/docs/generated/tool-catalog/markdown.md +6 -5
  172. package/docs/generated/tool-catalog/powershell.md +9 -0
  173. package/docs/generated/tool-catalog/python.md +6 -6
  174. package/docs/generated/tool-catalog/r.md +9 -0
  175. package/docs/generated/tool-catalog/scala.md +9 -0
  176. package/docs/generated/tool-catalog/svelte.md +9 -0
  177. package/docs/generated/tool-catalog/toml.md +6 -5
  178. package/docs/generated/tool-catalog/typescript.md +9 -6
  179. package/docs/generated/tool-catalog/vue.md +9 -0
  180. package/docs/generated/tool-catalog/yaml.md +6 -5
  181. package/docs/generated/tool-catalog/zig.md +9 -0
  182. package/docs/tools.md +88 -6
  183. package/node_modules/pi-agent-doctor/package.json +15 -5
  184. package/node_modules/pi-agent-doctor/runtime/entry-16.js +1 -0
  185. package/node_modules/pi-agent-doctor/runtime/entry-17.js +1 -0
  186. package/node_modules/pi-agent-doctor/runtime/entry-18.js +1 -0
  187. package/node_modules/pi-agent-doctor/runtime/entry-19.js +1 -0
  188. package/node_modules/pi-agent-doctor/runtime/entry-20.js +1 -0
  189. package/node_modules/pi-agent-doctor/src/catalog.ts +27 -1
  190. package/node_modules/pi-agent-doctor/src/evidence.ts +118 -0
  191. package/node_modules/pi-agent-doctor/src/executable.ts +85 -6
  192. package/node_modules/pi-agent-doctor/src/plugin-protocol.ts +30 -4
  193. package/node_modules/pi-agent-filesystem/index.ts +4 -3
  194. package/node_modules/pi-agent-filesystem/package.json +7 -7
  195. package/node_modules/pi-agent-filesystem/runtime/entry-21.js +2 -0
  196. package/node_modules/pi-agent-filesystem-image/package.json +4 -4
  197. package/node_modules/pi-agent-filesystem-image/runtime/entry-22.js +2 -0
  198. package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
  199. package/node_modules/pi-agent-filesystem-pdf/runtime/entry-23.js +2 -0
  200. package/node_modules/pi-agent-filesystem-text/package.json +4 -4
  201. package/node_modules/pi-agent-filesystem-text/runtime/entry-24.js +2 -0
  202. package/node_modules/pi-agent-ide-ast/package.json +11 -10
  203. package/node_modules/pi-agent-ide-ast/runtime/entry-25.js +1 -0
  204. package/node_modules/pi-agent-ide-ast/runtime/entry-26.js +2 -0
  205. package/node_modules/pi-agent-ide-ast/src/api/scope.ts +1 -1
  206. package/node_modules/pi-agent-ide-ast/src/ast/manager.ts +3 -0
  207. package/node_modules/pi-agent-ide-ast/src/ast/outline.ts +4 -1
  208. package/node_modules/pi-agent-ide-ast/src/doctor-plugin.ts +25 -0
  209. package/node_modules/pi-agent-ide-ast/src/extension.ts +13 -5
  210. package/node_modules/pi-agent-ide-ast/src/scope-resolver.ts +6 -0
  211. package/node_modules/pi-agent-ide-changes/index.ts +6 -2
  212. package/node_modules/pi-agent-ide-changes/package.json +8 -7
  213. package/node_modules/pi-agent-ide-changes/runtime/entry-27.js +1 -0
  214. package/node_modules/pi-agent-ide-changes/runtime/entry-28.js +2 -0
  215. package/node_modules/pi-agent-ide-changes/src/change-anchor.ts +6 -0
  216. package/node_modules/pi-agent-ide-changes/src/changes/change-groups.ts +1 -1
  217. package/node_modules/pi-agent-ide-changes/src/changes/change-service.ts +1 -1
  218. package/node_modules/pi-agent-ide-changes/src/changes/git-changes-backend.ts +1 -0
  219. package/node_modules/pi-agent-ide-changes/src/current-change-presenter.ts +1 -1
  220. package/node_modules/pi-agent-ide-changes/src/doctor-plugin.ts +31 -1
  221. package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +5 -0
  222. package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +7 -0
  223. package/node_modules/pi-agent-ide-formatter/package.json +4 -4
  224. package/node_modules/pi-agent-ide-formatter/runtime/entry-29.js +2 -0
  225. package/node_modules/pi-agent-ide-formatter/src/catalog.ts +165 -13
  226. package/node_modules/pi-agent-ide-formatter/src/doctor-plugin.ts +115 -63
  227. package/node_modules/pi-agent-ide-formatter/src/registry.ts +86 -31
  228. package/node_modules/pi-agent-ide-languages/package.json +3 -3
  229. package/node_modules/pi-agent-ide-languages/runtime/entry-30.js +2 -0
  230. package/node_modules/pi-agent-ide-languages/src/languages.ts +15 -0
  231. package/node_modules/pi-agent-ide-lint/index.ts +30 -155
  232. package/node_modules/pi-agent-ide-lint/package.json +8 -7
  233. package/node_modules/pi-agent-ide-lint/runtime/entry-31.js +2 -0
  234. package/node_modules/pi-agent-ide-lint/src/catalog.ts +210 -41
  235. package/node_modules/pi-agent-ide-lint/src/command-linter.ts +80 -4
  236. package/node_modules/pi-agent-ide-lint/src/diagnostics.ts +76 -34
  237. package/node_modules/pi-agent-ide-lint/src/doctor-plugin.ts +115 -64
  238. package/node_modules/pi-agent-ide-lint/src/registry.ts +87 -30
  239. package/node_modules/pi-agent-ide-lsp/index.ts +35 -134
  240. package/node_modules/pi-agent-ide-lsp/package.json +9 -8
  241. package/node_modules/pi-agent-ide-lsp/runtime/entry-32.js +2 -0
  242. package/node_modules/pi-agent-ide-lsp/src/catalog.ts +161 -7
  243. package/node_modules/pi-agent-ide-lsp/src/code-view-resolvers.ts +1 -1
  244. package/node_modules/pi-agent-ide-lsp/src/diagnostic-source.ts +110 -0
  245. package/node_modules/pi-agent-ide-lsp/src/doctor-plugin.ts +108 -55
  246. package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +248 -38
  247. package/node_modules/pi-agent-ide-lsp/src/lsp/code-views.ts +2 -1
  248. package/node_modules/pi-agent-ide-lsp/src/lsp/diagnostic-adapters.ts +76 -0
  249. package/node_modules/pi-agent-ide-lsp/src/lsp/diagnostics.ts +137 -144
  250. package/node_modules/pi-agent-ide-lsp/src/lsp/file-watchers.ts +88 -0
  251. package/node_modules/pi-agent-ide-lsp/src/lsp/initialization-options.ts +14 -0
  252. package/node_modules/pi-agent-ide-lsp/src/lsp/lsp-compiler.ts +2 -2
  253. package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +17 -36
  254. package/node_modules/pi-agent-ide-lsp/src/lsp/registry.ts +139 -68
  255. package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +1 -0
  256. package/node_modules/pi-agent-ide-lsp/src/lsp/transport-writer.ts +24 -0
  257. package/node_modules/pi-agent-ide-lsp/src/lsp/types.ts +13 -6
  258. package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +5 -5
  259. package/node_modules/pi-agent-image/package.json +3 -3
  260. package/node_modules/pi-agent-image/runtime/entry-33.js +1 -0
  261. package/node_modules/pi-agent-invariant/package.json +12 -0
  262. package/node_modules/pi-agent-invariant/runtime/entry-34.js +1 -0
  263. package/node_modules/pi-agent-pdf/package.json +3 -3
  264. package/node_modules/pi-agent-pdf/runtime/entry-35.js +1 -0
  265. package/node_modules/pi-agent-pdf/src/pdf-converter.ts +3 -2
  266. package/node_modules/pi-agent-read/package.json +11 -9
  267. package/node_modules/pi-agent-read/runtime/entry-36.js +1 -0
  268. package/node_modules/pi-agent-read/runtime/entry-37.js +1 -0
  269. package/node_modules/pi-agent-read/runtime/entry-38.js +1 -0
  270. package/node_modules/pi-agent-read/runtime/entry-39.js +1 -0
  271. package/node_modules/pi-agent-read/runtime/entry-40.js +2 -0
  272. package/node_modules/pi-agent-read/src/api/plugin-protocol.ts +1 -1
  273. package/node_modules/pi-agent-read/src/api/tools/read.ts +113 -2
  274. package/node_modules/pi-agent-read/src/core/extension.ts +19 -0
  275. package/node_modules/pi-agent-read/src/core/read-core.ts +85 -13
  276. package/node_modules/pi-agent-read/src/core/tools/read/output-truncation.ts +26 -10
  277. package/node_modules/pi-agent-read/src/core/tools/read/persisted-result.ts +72 -0
  278. package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +102 -12
  279. package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +27 -3
  280. package/node_modules/pi-agent-read/src/core/tools/read/views.ts +29 -0
  281. package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +532 -46
  282. package/node_modules/pi-agent-resource/package.json +5 -2
  283. package/node_modules/pi-agent-resource/runtime/entry-41.js +1 -0
  284. package/node_modules/pi-agent-resource/src/content-conversion/content-converter.ts +1 -1
  285. package/node_modules/pi-agent-resource/src/content-conversion/content-host.ts +1 -1
  286. package/node_modules/pi-agent-resource/src/content-conversion/content-runner.ts +1 -1
  287. package/node_modules/pi-agent-resource/src/content-conversion/validation.ts +1 -1
  288. package/node_modules/pi-agent-search/package.json +7 -6
  289. package/node_modules/pi-agent-search/runtime/entry-42.js +1 -0
  290. package/node_modules/pi-agent-search/runtime/entry-43.js +1 -0
  291. package/node_modules/pi-agent-search/runtime/entry-44.js +1 -0
  292. package/node_modules/pi-agent-search/runtime/entry-45.js +2 -0
  293. package/node_modules/pi-agent-search/src/api/search.ts +4 -0
  294. package/node_modules/pi-agent-search/src/core/extension.ts +99 -27
  295. package/node_modules/pi-agent-search/src/core/search-config.ts +98 -0
  296. package/node_modules/pi-agent-search/src/core/search-core.ts +32 -28
  297. package/node_modules/pi-agent-search/src/core/search-timeout.ts +54 -0
  298. package/node_modules/pi-agent-search-text/index.ts +53 -3
  299. package/node_modules/pi-agent-search-text/package.json +9 -9
  300. package/node_modules/pi-agent-search-text/runtime/entry-46.js +2 -0
  301. package/node_modules/pi-agent-search-text/runtime/entry-47.js +1 -0
  302. package/node_modules/pi-agent-search-text/src/doctor-plugin.ts +20 -1
  303. package/node_modules/pi-agent-search-text/src/persisted-result.ts +56 -0
  304. package/node_modules/pi-agent-search-text/src/resolvers.ts +36 -34
  305. package/node_modules/pi-agent-search-text/src/search-query.ts +254 -71
  306. package/node_modules/pi-agent-search-text/src/search-recipe.ts +68 -0
  307. package/node_modules/pi-agent-search-text/src/search-renderer.ts +71 -117
  308. package/node_modules/pi-agent-search-text/src/search-result.ts +1 -0
  309. package/node_modules/pi-agent-search-text/src/search-session.ts +276 -110
  310. package/node_modules/pi-agent-text/package.json +6 -3
  311. package/node_modules/pi-agent-text/runtime/entry-48.js +1 -0
  312. package/node_modules/pi-agent-text/src/index.ts +23 -0
  313. package/node_modules/pi-agent-text/src/stored-text.ts +14 -0
  314. package/node_modules/pi-agent-text/src/text-anchor.ts +160 -16
  315. package/node_modules/pi-agent-text/src/text-document.ts +26 -5
  316. package/node_modules/pi-agent-text/src/text-target.ts +105 -0
  317. package/node_modules/pi-agent-text-anchor-constant/package.json +7 -4
  318. package/node_modules/pi-agent-text-anchor-constant/runtime/entry-49.js +2 -0
  319. package/node_modules/pi-agent-text-anchor-constant/src/resolver.ts +6 -0
  320. package/node_modules/pi-agent-text-anchor-exact/index.ts +34 -0
  321. package/node_modules/pi-agent-text-anchor-exact/package.json +27 -0
  322. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-50.js +1 -0
  323. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-51.js +2 -0
  324. package/node_modules/pi-agent-text-anchor-exact/src/anchor.ts +230 -0
  325. package/node_modules/pi-agent-text-anchor-exact/src/config.ts +159 -0
  326. package/node_modules/pi-agent-text-anchor-exact/src/fuzzy-worker.ts +100 -0
  327. package/node_modules/pi-agent-text-anchor-exact/src/recovery.ts +151 -0
  328. package/node_modules/pi-agent-text-anchor-line-hash/index.ts +8 -2
  329. package/node_modules/pi-agent-text-anchor-line-hash/package.json +10 -6
  330. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-52.js +1 -0
  331. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-53.js +2 -0
  332. package/node_modules/pi-agent-text-anchor-line-hash/src/anchor.ts +32 -1
  333. package/node_modules/pi-agent-text-anchor-line-hash/src/read-handler.ts +20 -12
  334. package/node_modules/pi-agent-text-editor/package.json +22 -21
  335. package/node_modules/pi-agent-text-editor/runtime/entry-54.js +1 -0
  336. package/node_modules/pi-agent-text-editor/runtime/entry-55.js +1 -0
  337. package/node_modules/pi-agent-text-editor/runtime/entry-56.js +1 -0
  338. package/node_modules/pi-agent-text-editor/runtime/entry-57.js +1 -0
  339. package/node_modules/pi-agent-text-editor/runtime/entry-58.js +1 -0
  340. package/node_modules/pi-agent-text-editor/runtime/entry-59.js +1 -0
  341. package/node_modules/pi-agent-text-editor/runtime/entry-60.js +1 -0
  342. package/node_modules/pi-agent-text-editor/runtime/entry-61.js +1 -0
  343. package/node_modules/pi-agent-text-editor/runtime/entry-62.js +1 -0
  344. package/node_modules/pi-agent-text-editor/runtime/entry-63.js +1 -0
  345. package/node_modules/pi-agent-text-editor/runtime/entry-64.js +1 -0
  346. package/node_modules/pi-agent-text-editor/runtime/entry-65.js +1 -0
  347. package/node_modules/pi-agent-text-editor/runtime/entry-66.js +1 -0
  348. package/node_modules/pi-agent-text-editor/runtime/entry-67.js +1 -0
  349. package/node_modules/pi-agent-text-editor/runtime/entry-68.js +1 -0
  350. package/node_modules/pi-agent-text-editor/runtime/entry-69.js +2 -0
  351. package/node_modules/pi-agent-text-editor/src/api/anchor-inspection.ts +2 -0
  352. package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +1 -0
  353. package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +38 -0
  354. package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +30 -15
  355. package/node_modules/pi-agent-text-editor/src/api/text-selection-anchor.ts +10 -13
  356. package/node_modules/pi-agent-text-editor/src/api/tool-call-interceptor.ts +1 -1
  357. package/node_modules/pi-agent-text-editor/src/core/builtin-edit-filter.ts +12 -5
  358. package/node_modules/pi-agent-text-editor/src/core/extension.ts +15 -1
  359. package/node_modules/pi-agent-text-editor/src/core/mutation-result/agent-diff.ts +14 -10
  360. package/node_modules/pi-agent-text-editor/src/core/mutation-result/diff.ts +1 -1
  361. package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +3 -2
  362. package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +19 -2
  363. package/node_modules/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +64 -0
  364. package/node_modules/pi-agent-text-editor/src/core/mutation-result/inline-hints.ts +1 -1
  365. package/node_modules/pi-agent-text-editor/src/core/read-fragment-resolver.ts +83 -0
  366. package/node_modules/pi-agent-text-editor/src/core/text-anchor-registry.ts +96 -8
  367. package/node_modules/pi-agent-text-editor/src/core/text-change-engine.ts +4 -1
  368. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +1 -1
  369. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +194 -35
  370. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +43 -13
  371. package/node_modules/pi-agent-text-editor/src/core/text-editor-config.ts +95 -0
  372. package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +75 -5
  373. package/node_modules/pi-agent-text-editor/src/core/text-mutation-anchor-error.ts +7 -0
  374. package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +541 -130
  375. package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +5 -9
  376. package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/rendering.ts +2 -0
  377. package/node_modules/pi-agent-text-editor/src/tools/text-selection.ts +228 -6
  378. package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +50 -70
  379. package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +25 -26
  380. package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +30 -21
  381. package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +57 -71
  382. package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +30 -27
  383. package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +2 -0
  384. package/node_modules/pi-agent-text-editor-argument-order/package.json +3 -3
  385. package/node_modules/pi-agent-text-editor-argument-order/runtime/entry-70.js +2 -0
  386. package/node_modules/pi-agent-text-editor-overwrite/index.ts +1 -1
  387. package/node_modules/pi-agent-text-editor-overwrite/package.json +4 -3
  388. package/node_modules/pi-agent-text-editor-overwrite/runtime/entry-71.js +2 -0
  389. package/node_modules/pi-agent-text-editor-renderer/index.ts +21 -1
  390. package/node_modules/pi-agent-text-editor-renderer/package.json +6 -3
  391. package/node_modules/pi-agent-text-editor-renderer/runtime/entry-72.js +2 -0
  392. package/node_modules/pi-agent-text-editor-renderer/src/animation-pressure.ts +50 -0
  393. package/node_modules/pi-agent-text-editor-renderer/src/config.ts +73 -0
  394. package/node_modules/pi-agent-text-editor-renderer/src/diff-model.ts +1 -1
  395. package/node_modules/pi-agent-text-editor-renderer/src/diff-renderer.ts +77 -22
  396. package/node_modules/pi-agent-text-editor-renderer/src/diff-theme.ts +1 -1
  397. package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +140 -24
  398. package/node_modules/pi-agent-text-editor-renderer/src/mutation-projection.ts +274 -43
  399. package/node_modules/pi-agent-text-editor-renderer/src/mutation-result.ts +33 -6
  400. package/node_modules/pi-agent-text-editor-renderer/src/persisted-result.ts +47 -0
  401. package/node_modules/pi-agent-text-editor-renderer/src/render-resource.ts +7 -0
  402. package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +265 -105
  403. package/node_modules/pi-agent-text-editor-renderer/src/typing-interpolation.ts +96 -15
  404. package/node_modules/pi-agent-text-editor-stale-anchor/index.ts +22 -6
  405. package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -4
  406. package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +2 -0
  407. package/node_modules/pi-agent-tool-call-interception/package.json +5 -2
  408. package/node_modules/pi-agent-tool-call-interception/runtime/entry-74.js +1 -0
  409. package/node_modules/pi-agent-tool-call-interception/src/index.ts +175 -32
  410. package/node_modules/pi-agent-tool-ui/package.json +15 -0
  411. package/node_modules/pi-agent-tool-ui/runtime/entry-75.js +1 -0
  412. package/node_modules/pi-agent-tool-ui/src/index.ts +318 -0
  413. package/node_modules/pi-agent-web/index.ts +16 -6
  414. package/node_modules/pi-agent-web/package.json +8 -6
  415. package/node_modules/pi-agent-web/runtime/entry-76.js +2 -0
  416. package/node_modules/pi-agent-web/src/browser-loader.ts +180 -0
  417. package/node_modules/pi-agent-web/src/doctor-plugin.ts +41 -0
  418. package/node_modules/pi-agent-web/src/resolver.ts +128 -24
  419. package/node_modules/pi-agent-web-html/package.json +6 -3
  420. package/node_modules/pi-agent-web-html/runtime/entry-77.js +2 -0
  421. package/node_modules/pi-agent-web-html/src/extract-readable-html.ts +19 -6
  422. package/node_modules/pi-agent-web-image/package.json +4 -4
  423. package/node_modules/pi-agent-web-image/runtime/entry-78.js +2 -0
  424. package/node_modules/pi-agent-web-pdf/package.json +4 -4
  425. package/node_modules/pi-agent-web-pdf/runtime/entry-79.js +2 -0
  426. package/node_modules/pi-agent-web-text/package.json +4 -4
  427. package/node_modules/pi-agent-web-text/runtime/entry-80.js +2 -0
  428. package/package.json +68 -54
  429. package/src/api/code-view.ts +4 -0
  430. package/src/api/connect-tip-provider.ts +49 -0
  431. package/src/api/plugin-protocol.ts +41 -2
  432. package/src/api/tips.ts +77 -0
  433. package/src/api/tool-config/formatters.json +273 -0
  434. package/src/api/tool-config/linters.json +339 -0
  435. package/src/api/tool-config/lsp-servers.json +410 -0
  436. package/src/api/tool-config.ts +248 -12
  437. package/src/api/toolchain.ts +0 -5
  438. package/src/code-view/diagnostic-view.ts +121 -26
  439. package/src/code-view/source-view.ts +1 -1
  440. package/src/composite/builtin-extensions.ts +12 -6
  441. package/src/composite/extensions-config.ts +137 -0
  442. package/src/composite/selection.ts +58 -3
  443. package/src/core/diagnostic-store.ts +244 -0
  444. package/src/core/extension.ts +40 -0
  445. package/src/core/ide-core.ts +48 -3
  446. package/src/doctor/config-writer.ts +15 -2
  447. package/src/doctor/core.ts +47 -0
  448. package/src/doctor/discovery.ts +23 -70
  449. package/src/doctor/extension.ts +12 -1
  450. package/src/doctor/inventory.ts +24 -6
  451. package/src/doctor/run.ts +100 -87
  452. package/src/doctor/tip-provider.ts +92 -0
  453. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +4 -3
  454. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
  455. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
  456. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-22.js +2 -0
  457. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
  458. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-23.js +2 -0
  459. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
  460. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-24.js +2 -0
  461. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-21.js +2 -0
  462. package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +16 -6
  463. package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -6
  464. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +6 -3
  465. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-77.js +2 -0
  466. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/src/extract-readable-html.ts +19 -6
  467. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
  468. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-78.js +2 -0
  469. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
  470. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-79.js +2 -0
  471. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
  472. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-80.js +2 -0
  473. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-76.js +2 -0
  474. package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/browser-loader.ts +180 -0
  475. package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/doctor-plugin.ts +41 -0
  476. package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/resolver.ts +128 -24
  477. package/src/extensions/pi-agent-read/package.json +11 -9
  478. package/src/extensions/pi-agent-read/runtime/entry-36.js +1 -0
  479. package/src/extensions/pi-agent-read/runtime/entry-37.js +1 -0
  480. package/src/extensions/pi-agent-read/runtime/entry-38.js +1 -0
  481. package/src/extensions/pi-agent-read/runtime/entry-39.js +1 -0
  482. package/src/extensions/pi-agent-read/runtime/entry-40.js +2 -0
  483. package/src/extensions/pi-agent-read/src/api/plugin-protocol.ts +1 -1
  484. package/src/extensions/pi-agent-read/src/api/tools/read.ts +113 -2
  485. package/src/extensions/pi-agent-read/src/core/extension.ts +19 -0
  486. package/src/extensions/pi-agent-read/src/core/read-core.ts +85 -13
  487. package/src/extensions/pi-agent-read/src/core/tools/read/output-truncation.ts +26 -10
  488. package/src/extensions/pi-agent-read/src/core/tools/read/persisted-result.ts +72 -0
  489. package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +102 -12
  490. package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +27 -3
  491. package/src/extensions/pi-agent-read/src/core/tools/read/views.ts +29 -0
  492. package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +532 -46
  493. package/src/extensions/pi-agent-search/package.json +7 -6
  494. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +53 -3
  495. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +9 -9
  496. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-46.js +2 -0
  497. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-47.js +1 -0
  498. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/doctor-plugin.ts +20 -1
  499. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/persisted-result.ts +56 -0
  500. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +36 -34
  501. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-query.ts +254 -71
  502. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +68 -0
  503. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +71 -117
  504. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +1 -0
  505. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +276 -110
  506. package/src/extensions/pi-agent-search/runtime/entry-42.js +1 -0
  507. package/src/extensions/pi-agent-search/runtime/entry-43.js +1 -0
  508. package/src/extensions/pi-agent-search/runtime/entry-44.js +1 -0
  509. package/src/extensions/pi-agent-search/runtime/entry-45.js +2 -0
  510. package/src/extensions/pi-agent-search/src/api/search.ts +4 -0
  511. package/src/extensions/pi-agent-search/src/core/extension.ts +99 -27
  512. package/src/extensions/pi-agent-search/src/core/search-config.ts +98 -0
  513. package/src/extensions/pi-agent-search/src/core/search-core.ts +32 -28
  514. package/src/extensions/pi-agent-search/src/core/search-timeout.ts +54 -0
  515. package/src/extensions/pi-agent-text-editor/package.json +22 -21
  516. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +7 -4
  517. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-49.js +2 -0
  518. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/src/resolver.ts +6 -0
  519. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.ts +34 -0
  520. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +27 -0
  521. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-50.js +1 -0
  522. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-51.js +2 -0
  523. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/anchor.ts +230 -0
  524. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/config.ts +159 -0
  525. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/fuzzy-worker.ts +100 -0
  526. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/recovery.ts +151 -0
  527. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +8 -2
  528. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +10 -6
  529. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-52.js +1 -0
  530. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-53.js +2 -0
  531. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/anchor.ts +32 -1
  532. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/read-handler.ts +20 -12
  533. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/package.json +3 -3
  534. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/runtime/entry-70.js +2 -0
  535. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/index.ts +1 -1
  536. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/package.json +4 -3
  537. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/runtime/entry-71.js +2 -0
  538. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +21 -1
  539. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -3
  540. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-72.js +2 -0
  541. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/animation-pressure.ts +50 -0
  542. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/config.ts +73 -0
  543. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-model.ts +1 -1
  544. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-renderer.ts +77 -22
  545. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-theme.ts +1 -1
  546. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +140 -24
  547. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-projection.ts +274 -43
  548. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-result.ts +33 -6
  549. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/persisted-result.ts +47 -0
  550. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/render-resource.ts +7 -0
  551. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +265 -105
  552. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/typing-interpolation.ts +96 -15
  553. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/index.ts +22 -6
  554. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -4
  555. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +2 -0
  556. package/src/extensions/pi-agent-text-editor/runtime/entry-54.js +1 -0
  557. package/src/extensions/pi-agent-text-editor/runtime/entry-55.js +1 -0
  558. package/src/extensions/pi-agent-text-editor/runtime/entry-56.js +1 -0
  559. package/src/extensions/pi-agent-text-editor/runtime/entry-57.js +1 -0
  560. package/src/extensions/pi-agent-text-editor/runtime/entry-58.js +1 -0
  561. package/src/extensions/pi-agent-text-editor/runtime/entry-59.js +1 -0
  562. package/src/extensions/pi-agent-text-editor/runtime/entry-60.js +1 -0
  563. package/src/extensions/pi-agent-text-editor/runtime/entry-61.js +1 -0
  564. package/src/extensions/pi-agent-text-editor/runtime/entry-62.js +1 -0
  565. package/src/extensions/pi-agent-text-editor/runtime/entry-63.js +1 -0
  566. package/src/extensions/pi-agent-text-editor/runtime/entry-64.js +1 -0
  567. package/src/extensions/pi-agent-text-editor/runtime/entry-65.js +1 -0
  568. package/src/extensions/pi-agent-text-editor/runtime/entry-66.js +1 -0
  569. package/src/extensions/pi-agent-text-editor/runtime/entry-67.js +1 -0
  570. package/src/extensions/pi-agent-text-editor/runtime/entry-68.js +1 -0
  571. package/src/extensions/pi-agent-text-editor/runtime/entry-69.js +2 -0
  572. package/src/extensions/pi-agent-text-editor/src/api/anchor-inspection.ts +2 -0
  573. package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +1 -0
  574. package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +38 -0
  575. package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +30 -15
  576. package/src/extensions/pi-agent-text-editor/src/api/text-selection-anchor.ts +10 -13
  577. package/src/extensions/pi-agent-text-editor/src/api/tool-call-interceptor.ts +1 -1
  578. package/src/extensions/pi-agent-text-editor/src/core/builtin-edit-filter.ts +12 -5
  579. package/src/extensions/pi-agent-text-editor/src/core/extension.ts +15 -1
  580. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/agent-diff.ts +14 -10
  581. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/diff.ts +1 -1
  582. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +3 -2
  583. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +19 -2
  584. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +64 -0
  585. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/inline-hints.ts +1 -1
  586. package/src/extensions/pi-agent-text-editor/src/core/read-fragment-resolver.ts +83 -0
  587. package/src/extensions/pi-agent-text-editor/src/core/text-anchor-registry.ts +96 -8
  588. package/src/extensions/pi-agent-text-editor/src/core/text-change-engine.ts +4 -1
  589. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +1 -1
  590. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +194 -35
  591. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +43 -13
  592. package/src/extensions/pi-agent-text-editor/src/core/text-editor-config.ts +95 -0
  593. package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +75 -5
  594. package/src/extensions/pi-agent-text-editor/src/core/text-mutation-anchor-error.ts +7 -0
  595. package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +541 -130
  596. package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +5 -9
  597. package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/rendering.ts +2 -0
  598. package/src/extensions/pi-agent-text-editor/src/tools/text-selection.ts +228 -6
  599. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +50 -70
  600. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +25 -26
  601. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +30 -21
  602. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +57 -71
  603. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +30 -27
  604. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +2 -0
  605. package/src/pi-agent-ide.ts +15 -3
  606. package/src/plugins/pi-agent-ide-ast/package.json +11 -10
  607. package/src/plugins/pi-agent-ide-ast/runtime/entry-25.js +1 -0
  608. package/src/plugins/pi-agent-ide-ast/runtime/entry-26.js +2 -0
  609. package/src/plugins/pi-agent-ide-ast/src/api/scope.ts +1 -1
  610. package/src/plugins/pi-agent-ide-ast/src/ast/manager.ts +3 -0
  611. package/src/plugins/pi-agent-ide-ast/src/ast/outline.ts +4 -1
  612. package/src/plugins/pi-agent-ide-ast/src/doctor-plugin.ts +25 -0
  613. package/src/plugins/pi-agent-ide-ast/src/extension.ts +13 -5
  614. package/src/plugins/pi-agent-ide-ast/src/scope-resolver.ts +6 -0
  615. package/src/plugins/pi-agent-ide-changes/index.ts +6 -2
  616. package/src/plugins/pi-agent-ide-changes/package.json +8 -7
  617. package/src/plugins/pi-agent-ide-changes/runtime/entry-27.js +1 -0
  618. package/src/plugins/pi-agent-ide-changes/runtime/entry-28.js +2 -0
  619. package/src/plugins/pi-agent-ide-changes/src/change-anchor.ts +6 -0
  620. package/src/plugins/pi-agent-ide-changes/src/changes/change-groups.ts +1 -1
  621. package/src/plugins/pi-agent-ide-changes/src/changes/change-service.ts +1 -1
  622. package/src/plugins/pi-agent-ide-changes/src/changes/git-changes-backend.ts +1 -0
  623. package/src/plugins/pi-agent-ide-changes/src/current-change-presenter.ts +1 -1
  624. package/src/plugins/pi-agent-ide-changes/src/doctor-plugin.ts +31 -1
  625. package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +5 -0
  626. package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +7 -0
  627. package/src/plugins/pi-agent-ide-diagnostics/index.ts +1 -0
  628. package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +199 -0
  629. package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
  630. package/src/plugins/pi-agent-ide-formatter/runtime/entry-29.js +2 -0
  631. package/src/plugins/pi-agent-ide-formatter/src/catalog.ts +165 -13
  632. package/src/plugins/pi-agent-ide-formatter/src/doctor-plugin.ts +115 -63
  633. package/src/plugins/pi-agent-ide-formatter/src/registry.ts +86 -31
  634. package/src/plugins/pi-agent-ide-languages/package.json +3 -3
  635. package/src/plugins/pi-agent-ide-languages/runtime/entry-30.js +2 -0
  636. package/src/plugins/pi-agent-ide-languages/src/languages.ts +15 -0
  637. package/src/plugins/pi-agent-ide-lint/index.ts +30 -155
  638. package/src/plugins/pi-agent-ide-lint/package.json +8 -7
  639. package/src/plugins/pi-agent-ide-lint/runtime/entry-31.js +2 -0
  640. package/src/plugins/pi-agent-ide-lint/src/catalog.ts +210 -41
  641. package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +80 -4
  642. package/src/plugins/pi-agent-ide-lint/src/diagnostics.ts +76 -34
  643. package/src/plugins/pi-agent-ide-lint/src/doctor-plugin.ts +115 -64
  644. package/src/plugins/pi-agent-ide-lint/src/registry.ts +87 -30
  645. package/src/plugins/pi-agent-ide-lsp/index.ts +35 -134
  646. package/src/plugins/pi-agent-ide-lsp/package.json +9 -8
  647. package/src/plugins/pi-agent-ide-lsp/runtime/entry-32.js +2 -0
  648. package/src/plugins/pi-agent-ide-lsp/src/catalog.ts +161 -7
  649. package/src/plugins/pi-agent-ide-lsp/src/code-view-resolvers.ts +1 -1
  650. package/src/plugins/pi-agent-ide-lsp/src/diagnostic-source.ts +110 -0
  651. package/src/plugins/pi-agent-ide-lsp/src/doctor-plugin.ts +108 -55
  652. package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +248 -38
  653. package/src/plugins/pi-agent-ide-lsp/src/lsp/code-views.ts +2 -1
  654. package/src/plugins/pi-agent-ide-lsp/src/lsp/diagnostic-adapters.ts +76 -0
  655. package/src/plugins/pi-agent-ide-lsp/src/lsp/diagnostics.ts +137 -144
  656. package/src/plugins/pi-agent-ide-lsp/src/lsp/file-watchers.ts +88 -0
  657. package/src/plugins/pi-agent-ide-lsp/src/lsp/initialization-options.ts +14 -0
  658. package/src/plugins/pi-agent-ide-lsp/src/lsp/lsp-compiler.ts +2 -2
  659. package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +17 -36
  660. package/src/plugins/pi-agent-ide-lsp/src/lsp/registry.ts +139 -68
  661. package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +1 -0
  662. package/src/plugins/pi-agent-ide-lsp/src/lsp/transport-writer.ts +24 -0
  663. package/src/plugins/pi-agent-ide-lsp/src/lsp/types.ts +13 -6
  664. package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +5 -5
  665. package/src/post-edit/gate.ts +17 -141
  666. package/src/tips/core.ts +86 -0
  667. package/src/tips/extension.ts +115 -0
  668. package/src/tips/persistence.ts +225 -0
  669. package/src/tips/tip-callout.ts +77 -0
  670. package/src/toolchain/registry.ts +8 -23
  671. package/src/toolchain/types.ts +8 -74
  672. package/node_modules/pi-agent-search-semantic/index.ts +0 -97
  673. package/node_modules/pi-agent-search-semantic/package.json +0 -17
  674. package/node_modules/pi-agent-search-text/src/lucene-query-parser.d.ts +0 -20
  675. package/node_modules/pi-agent-search-web/index.ts +0 -82
  676. package/node_modules/pi-agent-search-web/package.json +0 -20
  677. package/node_modules/pi-agent-search-web/src/config.ts +0 -560
  678. package/node_modules/pi-agent-search-web/src/doctor-plugin.ts +0 -40
  679. package/node_modules/pi-agent-search-web/src/providers/duckduckgo-html.ts +0 -74
  680. package/node_modules/pi-agent-search-web/src/providers/endpoints.ts +0 -81
  681. package/node_modules/pi-agent-search-web/src/providers/request.ts +0 -427
  682. package/node_modules/pi-agent-search-web/src/providers/response.ts +0 -353
  683. package/node_modules/pi-agent-search-web/src/search-format.ts +0 -24
  684. package/node_modules/pi-agent-search-web/src/search.ts +0 -376
  685. package/node_modules/pi-agent-search-web/src/types.ts +0 -141
  686. package/src/composite/config.ts +0 -100
  687. package/src/extensions/pi-agent-search/plugins/pi-agent-search-semantic/index.ts +0 -97
  688. package/src/extensions/pi-agent-search/plugins/pi-agent-search-semantic/package.json +0 -17
  689. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/lucene-query-parser.d.ts +0 -20
  690. package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/index.ts +0 -82
  691. package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/package.json +0 -20
  692. package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/config.ts +0 -560
  693. package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/doctor-plugin.ts +0 -40
  694. package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/duckduckgo-html.ts +0 -74
  695. package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/endpoints.ts +0 -81
  696. package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/request.ts +0 -427
  697. package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/response.ts +0 -353
  698. package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/search-format.ts +0 -24
  699. package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/search.ts +0 -376
  700. package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/types.ts +0 -141
  701. package/src/toolchain/gate.ts +0 -305
  702. /package/{src/utils/required-value.ts → node_modules/pi-agent-invariant/src/index.ts} +0 -0
@@ -0,0 +1 @@
1
+ import{a,b}from"./chunk-KYVOMBO5.js";import"./chunk-XNXQYPVT.js";import"./chunk-VSP2QQPQ.js";import"./chunk-YHUTTZC6.js";import"./chunk-EEH4WYI7.js";import"./chunk-266RH77Z.js";import"./chunk-EW2KVKCN.js";import"./chunk-2SKAED2I.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{b as createOverwriteGuard,a as default};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-OIL6BB2S.js";import"./chunk-KNMWCDDK.js";import"./chunk-VSP2QQPQ.js";import"./chunk-YHUTTZC6.js";import"./chunk-EEH4WYI7.js";import"./chunk-266RH77Z.js";import"./chunk-EW2KVKCN.js";import"./chunk-2SKAED2I.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as default};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-OFHVDY4Q.js";import"./chunk-OVUYPHDE.js";import"./chunk-YPHXLAQF.js";import"./chunk-XNXQYPVT.js";import"./chunk-MBUXFKIW.js";import"./chunk-VSP2QQPQ.js";import"./chunk-YHUTTZC6.js";import"./chunk-ORAPGW7W.js";import"./chunk-JASLOB2X.js";import"./chunk-EEH4WYI7.js";import"./chunk-266RH77Z.js";import"./chunk-EW2KVKCN.js";import"./chunk-2SKAED2I.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as default};
@@ -0,0 +1 @@
1
+ import{a,b,c,d,e,f,g,h}from"./chunk-VSP2QQPQ.js";import"./chunk-YHUTTZC6.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};
@@ -0,0 +1 @@
1
+ import{a,b,c,d,e,f,g}from"./chunk-YHUTTZC6.js";import"./chunk-EI7MMDWY.js";export{b as ToolCallHeader,f as preserveEnclosingBackground,e as renderToolCallDetails,d as renderToolCallHeader,g as singleLine,a as toolBackgroundAnsi,c as toolCallHeader};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-UTTW55S2.js";import"./chunk-ERVMDQGX.js";import"./chunk-VFBLX4TG.js";import"./chunk-NNCZYO4Q.js";import"./chunk-SSZB66C3.js";import"./chunk-YHUTTZC6.js";import"./chunk-ORAPGW7W.js";import"./chunk-JASLOB2X.js";import"./chunk-EW2KVKCN.js";import"./chunk-2SKAED2I.js";import"./chunk-N34ATN52.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as default};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-IMVCVPMP.js";import"./chunk-EW2KVKCN.js";import"./chunk-EI7MMDWY.js";export{a as default};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-LFV6G5Z3.js";import"./chunk-GTK5AREE.js";import"./chunk-EW2KVKCN.js";import"./chunk-EI7MMDWY.js";export{a as default};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-IOCABSRL.js";import"./chunk-PODWLGNO.js";import"./chunk-EW2KVKCN.js";import"./chunk-EI7MMDWY.js";export{a as default};
@@ -0,0 +1 @@
1
+ import"./chunk-3YK4XMWB.js";import{a,b,c,d,e,f}from"./chunk-VFBLX4TG.js";import"./chunk-EI7MMDWY.js";export{b as DOCTOR_API_VERSION,c as DOCTOR_CORE_READY_EVENT,d as DOCTOR_PLUGIN_REGISTER_EVENT,a as DOCTOR_PROTOCOL,e as isDoctorCoreReady,f as isDoctorPluginRegistrationRequest};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-6DN7NO7L.js";import"./chunk-EW2KVKCN.js";import"./chunk-2SKAED2I.js";import"./chunk-EI7MMDWY.js";export{a as default};
@@ -0,0 +1 @@
1
+ import{a as o}from"./chunk-ERVMDQGX.js";import"./chunk-VFBLX4TG.js";import"./chunk-EI7MMDWY.js";export{o as connectDoctorPlugin};
@@ -0,0 +1,13 @@
1
+ import{a as We}from"./chunk-6DN7NO7L.js";import{a as it}from"./chunk-OIL6BB2S.js";import{a as ot}from"./chunk-OFHVDY4Q.js";import{a as qe}from"./chunk-UTTW55S2.js";import{a as Je}from"./chunk-IMVCVPMP.js";import{a as Ge}from"./chunk-LFV6G5Z3.js";import{a as ze}from"./chunk-IOCABSRL.js";import{a as Ke}from"./chunk-6XQQBKPE.js";import"./chunk-OVUYPHDE.js";import"./chunk-YPHXLAQF.js";import"./chunk-VCCMVQXU.js";import{a as tt}from"./chunk-F6SESI3P.js";import{a as nt}from"./chunk-KYVOMBO5.js";import"./chunk-XNXQYPVT.js";import"./chunk-STUZZM5B.js";import"./chunk-MBUXFKIW.js";import{e as Le}from"./chunk-TG6H6EOI.js";import"./chunk-KNMWCDDK.js";import{a as Qe}from"./chunk-5BWUVAR4.js";import{a as et}from"./chunk-HOBTFFQR.js";import"./chunk-SJYDLHEF.js";import{a as Ze}from"./chunk-6SMFVLTY.js";import"./chunk-PETQCA7G.js";import{a as He}from"./chunk-4SQQKEVD.js";import{a as Xe}from"./chunk-BYWAG6X3.js";import"./chunk-VSP2QQPQ.js";import{a as Ye}from"./chunk-KH5KPBCR.js";import"./chunk-34ZQTTU2.js";import"./chunk-MTTKFJV6.js";import{a as lt}from"./chunk-VEJGSURY.js";import{a as Be}from"./chunk-XGUAL3CA.js";import{a as rt}from"./chunk-NXHPO7ER.js";import"./chunk-SMSIT3CE.js";import{a as st}from"./chunk-ONWUJXUR.js";import"./chunk-DEP55R35.js";import{a as at}from"./chunk-MTQSGWZJ.js";import{a as ct}from"./chunk-QZANC2IG.js";import{a as dt}from"./chunk-2XYXV5HS.js";import{a as Fe}from"./chunk-WZI4YC2O.js";import{a as Me}from"./chunk-MB6VVVAF.js";import{a as Ve}from"./chunk-NI2NK4JU.js";import"./chunk-GTK5AREE.js";import{a as Ue}from"./chunk-W3XYKJ5H.js";import"./chunk-PODWLGNO.js";import"./chunk-3YK4XMWB.js";import"./chunk-ERVMDQGX.js";import{a as xe,b as De,c as Se,d as Re,f as Ce}from"./chunk-VFBLX4TG.js";import"./chunk-2ZMYT6ZC.js";import"./chunk-NNCZYO4Q.js";import{c as je}from"./chunk-SSZB66C3.js";import"./chunk-YHUTTZC6.js";import{a as $e}from"./chunk-ORAPGW7W.js";import{a as ke,b as Ae}from"./chunk-JASLOB2X.js";import"./chunk-E2RESHYR.js";import"./chunk-T2RPMEM2.js";import{a as Ne}from"./chunk-EEH4WYI7.js";import{a as Oe,b as _e}from"./chunk-266RH77Z.js";import"./chunk-EW2KVKCN.js";import{e as ce,f as de,g as le,h as ue,i as pe,l as fe}from"./chunk-ZIHEF6K3.js";import"./chunk-2SKAED2I.js";import{a as we}from"./chunk-OBWZ5RYN.js";import{a as D,b as S,c as me,d as he,g as ye}from"./chunk-KZBAJFCV.js";import"./chunk-KINKBPPX.js";import{b as Pe,c as P}from"./chunk-L4FA6OD4.js";import{d as be}from"./chunk-N34ATN52.js";import{a as ge}from"./chunk-ZC65Z3CK.js";import{a as ve,b as R,c as C,d as Ie,e as Te,g as Ee}from"./chunk-JMVDFOTQ.js";import{a}from"./chunk-EI7MMDWY.js";var k=[],A=[],J=[];function q(n,e,t){if(e.some(i=>i.name===t))throw new Error(`[pi-agent-ide] ${n} "${t}" is already registered. Use a unique name.`)}a(q,"assertUniqueName");function pt(n){let e=new Set;for(let t of n){let i=`${t.kind}:${t.name}`;if(e.has(i))throw new Error(`[pi-agent-ide] ${t.kind} "${t.name}" is registered twice by one plugin.`);switch(e.add(i),t.kind){case"compiler":{q(t.kind,A,t.name);break}case"formatter":{q(t.kind,k,t.name);break}case"linter":{q(t.kind,J,t.name);break}}}for(let t of n)switch(t.kind){case"compiler":{A.push(t);break}case"formatter":{k.push(t);break}case"linter":{J.push(t);break}}}a(pt,"registerTools");async function ut(n,e){let t=[];for(let i of n)try{await i.detect(e)&&t.push(i)}catch(o){console.error(`[pi-agent-ide] detect failed for "${i.name}":`,o)}return t.sort((i,o)=>o.priority-i.priority),Bt(t),t}a(ut,"filterActive");function Bt(n){let e=new Map;for(let t of n)for(let i of t.extensions){let o=`${i}@${t.priority}`,s=e.get(o);if(s!==void 0)throw new Error(`[pi-agent-ide] priority conflict: tools "${s}" and "${t.name}" both claim "${i}" at priority ${t.priority}.`);e.set(o,t.name)}}a(Bt,"assertNoPriorityConflicts");async function gt(n){let[e,t]=await Promise.all([ut(k,n),ut(A.filter(i=>i.syntaxOnly===!0),n)]);return{ctx:n,formatters:e,compilers:t,linters:[]}}a(gt,"warmupFormatting");function G(){k.length=0,A.length=0,J.length=0}a(G,"resetRegistry");import{readFile as z}from"node:fs/promises";import b from"node:path";var $=class{constructor(e,t={}){this.sources=e;this.options=t}static{a(this,"DiagnosticStore")}files=new Map;dirty=new Set;sent=new Map;queue=[];running=0;disposed=!1;schedule(e,t,{cwd:i}){this.disposed||this.ensure(e,t,i)}async read(e,{cwd:t}){this.assertActive();let i=b.resolve(t,e),o=await z(i,"utf8");this.assertActive();let s=this.ensure(i,o,t);await qt(Promise.all(s.jobs),this.options.readWaitMs??5e3),this.assertActive();let r=await z(i,"utf8");this.assertActive();let c=this.ensure(i,r,t);return{filePath:i,content:c.content,results:[...c.results.values()]}}async takeNotifications(e){let t=[];for(let i of[...this.dirty]){if(i.cwd!==b.resolve(e)||(this.dirty.delete(i),!await this.isCurrent(i)))continue;let o=[...i.results.values()],s=o.map(d=>{if(d.status==="pending"||d.status==="unavailable")return`${d.source} ${d.status}`;let l=["error","warning","info","hint"].map(u=>`${d.diagnostics.filter(p=>p.severity===u).length} ${u}`);return`${d.source} ${l.join(", ")}${d.status==="snapshot"?" (snapshot; completion unknown)":d.status==="unversioned"?" (unversioned)":""}`}).join("; "),r=this.key(i.filePath,i.cwd),c=JSON.stringify(o);this.sent.get(r)!==c&&(this.sent.set(r,c),t.push(`${JSON.stringify(b.relative(e,i.filePath))}: ${s||"no diagnostic sources"}.`))}return t}dispose(){this.disposed=!0;for(let e of this.files.values())e.controller.abort();this.files.clear(),this.dirty.clear(),this.sent.clear(),this.pump()}key(e,t){return JSON.stringify([b.resolve(t),b.resolve(t,e)])}ensure(e,t,i){let o=this.key(e,i),s=this.files.get(o);if(s?.content===t)return s;s?.controller.abort(),s&&this.dirty.delete(s);let r={cwd:b.resolve(i),filePath:b.resolve(i,e),content:t,controller:new AbortController,results:new Map,jobs:[],publications:new Map};this.files.set(o,r),this.sources.length===0&&r.results.set("diagnostics",{source:"diagnostics",status:"unavailable",diagnostics:[],reason:"No diagnostic sources registered"}),this.dirty.add(r);for(let c of this.sources){r.results.set(c.id,{source:c.id,status:"pending",diagnostics:[]});let d=new Promise(l=>{this.queue.push(async()=>{try{await this.check(r,c)}finally{l()}})});r.jobs.push(d)}return queueMicrotask(()=>this.pump()),r}pump(){for(;this.running<(this.options.concurrency??4)&&this.queue.length>0;){let e=this.queue.shift();if(!e)break;this.running++,e().finally(()=>{this.running--,this.pump()})}}active(e){return!this.disposed&&!e.controller.signal.aborted}assertActive(){if(this.disposed)throw new Error("Diagnostics session has ended")}async isCurrent(e){if(!this.active(e))return!1;let t=await z(e.filePath,"utf8").catch(()=>{});return this.active(e)&&t===e.content}async publish(e,t,i){let o=(e.publications.get(t)??0)+1;if(e.publications.set(t,o),!await this.isCurrent(e)||e.publications.get(t)!==o)return;let s={source:t,...i};JSON.stringify(e.results.get(t))!==JSON.stringify(s)&&(e.results.set(t,s),this.dirty.add(e))}async check(e,t){if(!await this.isCurrent(e))return;let i=new AbortController,o=AbortSignal.any([i.signal,e.controller.signal]);if(o.aborted)return;let s,r;try{let c=new Promise((l,u)=>{r=a(()=>u(o.reason),"onAbort"),o.addEventListener("abort",r,{once:!0}),s=setTimeout(()=>i.abort(new Error("Diagnostic check timed out")),this.options.checkTimeoutMs??3e4)}),d=await Promise.race([t.diagnose(e.filePath,{cwd:e.cwd,content:e.content,signal:o,publish:a(l=>{o.aborted||this.publish(e,t.id,l)},"publish")}),c]);await this.publish(e,t.id,d)}catch(c){await this.publish(e,t.id,{status:"unavailable",diagnostics:[],reason:c instanceof Error?c.message:String(c)})}finally{clearTimeout(s),r&&o.removeEventListener("abort",r)}}};async function qt(n,e){let t;try{await Promise.race([n,new Promise(i=>{t=setTimeout(i,e)})])}finally{clearTimeout(t)}}a(qt,"waitAtMost");function ft(){let n=new Map,e=[],t=new $(e),i=Promise.resolve();return{diagnostics:t,registerPlugin(o){if(o.id.trim().length===0)return Promise.reject(new Error("Plugin ID must not be empty"));let s=n.get(o.id);if(s!==void 0)return s;let r=i.then(async()=>{let c=[],d=[],l=!0,u={addTool(p){if(!l)throw new Error(`Plugin ${o.id} setup is already complete`);Gt(p),c.push(p)},addDiagnosticSource(p){if(!l)throw new Error(`Plugin ${o.id} setup is already complete`);zt(p),d.push(p)},readDiagnostics(p,f){return t.read(p,f)}};try{await o.setup(u)}catch(p){throw l=!1,p}l=!1,Jt(e,d),pt(c),e.push(...d)});return n.set(o.id,r),i=r.catch(()=>{}),r.catch(()=>{n.delete(o.id)}),r},async waitForPendingPlugins(){await Promise.all(n.values())}}}a(ft,"createIdeCore");function Jt(n,e){let t=new Set(n.map(i=>i.id));for(let i of e){if(t.has(i.id))throw new Error(`Diagnostic source ${i.id} is already registered`);t.add(i.id)}}a(Jt,"assertUniqueDiagnosticSources");function Gt(n){if(!mt(n))throw new TypeError("IDE tool must be an object");let e=n.kind,t=e==="compiler"?n.compile:e==="formatter"?n.format:e==="linter"?n.lint:void 0;if(t===void 0||typeof t!="function"||typeof n.detect!="function"||typeof n.name!="string"||n.name.trim().length===0||typeof n.priority!="number"||!Number.isFinite(n.priority)||!Array.isArray(n.extensions)||n.extensions.length===0||n.extensions.some(i=>typeof i!="string"||i.length===0))throw new TypeError("Invalid pi-agent-ide tool contribution")}a(Gt,"assertIdeTool");function zt(n){if(!mt(n)||typeof n.id!="string"||n.id.trim().length===0||typeof n.diagnose!="function")throw new TypeError("Invalid pi-agent-ide diagnostic source contribution")}a(zt,"assertDiagnosticSource");function mt(n){return typeof n=="object"&&n!==null}a(mt,"isRecord");import ht from"node:path";async function yt(n){if(!ht.isAbsolute(n.resourceSource))return;let e=await gt({cwd:n.cwd}),t=ht.extname(n.resourceSource).toLowerCase(),i=a(r=>r.extensions.includes(t)||r.extensions.includes("*"),"matches"),o=e.compilers.find(i);if(o&&(await o.compile({filePath:n.resourceSource},e.ctx)).syntaxErrors.length>0)return;await e.formatters.find(i)?.format({filePath:n.resourceSource},e.ctx)}a(yt,"runIdePostEditGate");import Wt from"node:path";async function W(n){n.registerFlag("old-tools",{description:"Use the old IDE and text editor tools",type:"boolean",default:!1}),G();let e=ft(),t=n.events.on(he,i=>{if(!ye(i))throw new Error("Invalid pi-agent-ide plugin registration request");i.accept(e.registerPlugin(i.plugin))});n.on("session_shutdown",()=>{t(),e.diagnostics.dispose(),G()}),Le(n,{id:"pi-agent-ide",handler:yt}),n.events.emit(me,{protocol:D,apiVersion:3}),await Ne(n,{protocol:Oe,apiVersion:_e,id:"ide-diagnostics",setup(i){i.onDidEdit(o=>{Wt.isAbsolute(o.resourceSource)&&e.diagnostics.schedule(o.resourceSource,o.after.content,{cwd:o.cwd})})}}),n.on("context",async(i,o)=>{let s=await e.diagnostics.takeNotifications(o.cwd);if(s.length!==0)return{messages:[...i.messages,{role:"custom",customType:"ide-diagnostics",display:!1,content:`File diagnostics:
2
+ ${s.join(`
3
+ `)}`,timestamp:Date.now()}]}}),await e.waitForPendingPlugins()}a(W,"registerPiAgentIde");import{truncateToWidth as Ht,wrapTextWithAnsi as Xt}from"@earendil-works/pi-tui";var Yt="PI AGENT IDE",Kt=/\/[a-z][\w-]*/giu,j=class{constructor(e,t){this.tip=e;this.theme=t}static{a(this,"TipCallout")}cached;render(e){if(this.cached?.width===e)return this.cached.lines;let t=Qt(this.tip,this.theme,e);return this.cached={width:e,lines:t},t}invalidate(){this.cached=void 0}};function Qt(n,e,t){if(t<=0)return[];if(t<=2)return[e.fg("accent",t===1?"\u2502":"\u2502 ")];let i=t-2,o=e.fg("accent",e.bold(Yt))+e.fg("dim"," \xB7 ")+e.bold(n.title),s=n.body.split(`
4
+ `).map(l=>l.length===0?"":en(l,e)),r=[o,...s].flatMap(l=>Zt(l,i)),c=e.fg("accent","\u2502");return r.map(l=>Ht(`${c} ${l}`,t))}a(Qt,"renderTip");function Zt(n,e){return n.length===0?[""]:Xt(n,e)}a(Zt,"wrapLine");function en(n,e){let t="",i=0;for(let o of n.matchAll(Kt)){let s=o.index;t+=e.fg("muted",n.slice(i,s)),t+=e.fg("accent",e.bold(o[0])),i=s+o[0].length}return t+e.fg("muted",n.slice(i))}a(en,"styleBodyLine");var O=class{static{a(this,"TipCore")}providers=new Map;registerProvider(e){if(!/^[a-z0-9][a-z0-9.-]*$/u.test(e.id))return Promise.reject(new Error(`Invalid tip provider ID: ${e.id}`));let t=this.providers.get(e.id);return t!==void 0?t===e?Promise.resolve():Promise.reject(new Error(`Tip provider ${e.id} is already registered`)):(this.providers.set(e.id,e),Promise.resolve())}get isEmpty(){return this.providers.size===0}async collectTips(e){let t=[];for(let i of this.providers.values()){if(e.signal?.aborted)break;try{let o=await tn(i,e);o!==void 0&&nn(o)&&t.push({providerId:i.id,tip:o})}catch{}}return t}};async function tn(n,e){let t=e.signal;if(t===void 0)return n.getTip(e);if(t.aborted)return;let i=a(()=>{},"abort"),o=new Promise(s=>{i=a(()=>s(void 0),"abort"),t.addEventListener("abort",i,{once:!0})});try{return await Promise.race([n.getTip(e),o])}finally{t.removeEventListener("abort",i)}}a(tn,"collectTip");function nn(n){return typeof n.id=="string"&&/^[a-z0-9][a-z0-9.-]*$/u.test(n.id)&&typeof n.title=="string"&&n.title.trim().length>0&&typeof n.body=="string"&&n.body.trim().length>0}a(nn,"isTip");import{randomUUID as on}from"node:crypto";import{mkdir as Y,readFile as rn,rename as sn,rm as K,stat as an,writeFile as cn}from"node:fs/promises";import{setTimeout as dn}from"node:timers/promises";import{homedir as ln}from"node:os";import T from"node:path";var I=1,un=10,pn=5e3,gn=6e4,y=Promise.resolve();function fn(n=process.env){let e=n.PI_CODING_AGENT_DIR??T.join(ln(),".pi","agent");return T.join(e,"pi-agent-ide","tips.json")}a(fn,"resolveTipStatePath");var N=class{constructor(e=fn()){this.statePath=e}static{a(this,"TipStateStore")}async shownFor(e){let t=await _(this.statePath);return new Set(t.projects[e]??[])}async claimIfUnseen(e,t,i){let o=y.then(async()=>{try{return await H(this.statePath,async()=>{let s=await _(this.statePath),r=new Set(s.projects[e]??[]);if(r.has(t)||i!==void 0&&r.has(i))return!1;r.add(t);let c={version:I,projects:{...s.projects,[e]:[...r]}};return await X(this.statePath,c),!0})}catch{return!0}});return y=o.then(()=>{},()=>{}),o}async markShown(e,t){if(t.length===0)return;y=y.then(async()=>{await H(this.statePath,async()=>{let o=await _(this.statePath),s=new Set(o.projects[e]??[]);for(let c of t)s.add(c);let r={version:I,projects:{...o.projects,[e]:[...s]}};await X(this.statePath,r)})}).catch(()=>{}),await y}async unmarkShown(e,t){y=y.then(async()=>{try{await H(this.statePath,async()=>{let o=await _(this.statePath),s=new Set(o.projects[e]??[]);if(!s.delete(t))return;let r={version:I,projects:{...o.projects,[e]:[...s]}};await X(this.statePath,r)})}catch{}}).catch(()=>{}),await y}};function bt(n){return T.resolve(n)}a(bt,"normalizeProjectPath");async function _(n){try{let e=JSON.parse(await rn(n,"utf8"));return hn(e)?e:wt()}catch{return wt()}}a(_,"readState");async function H(n,e){let t=`${n}.lock`;await Y(T.dirname(n),{recursive:!0});let i=Date.now();for(;;)try{await Y(t);break}catch(o){if(mn(o)!=="EEXIST")throw o;try{if(Date.now()-(await an(t)).mtimeMs>gn){await K(t,{recursive:!0,force:!0});continue}}catch{}if(Date.now()-i>=pn)throw new Error(`Timed out waiting for startup-tip state lock: ${t}`,{cause:o});await dn(un)}try{return await e()}finally{await K(t,{recursive:!0,force:!0})}}a(H,"withStateLock");function mn(n){return typeof n=="object"&&n!==null&&"code"in n?String(n.code):void 0}a(mn,"errorCode");async function X(n,e){try{await Y(T.dirname(n),{recursive:!0});let t=`${n}.${process.pid}.${on()}.tmp`;try{await cn(t,`${JSON.stringify(e,null,2)}
5
+ `,"utf8"),await sn(t,n)}finally{await K(t,{force:!0})}}catch{}}a(X,"writeState");function wt(){return{version:I,projects:{}}}a(wt,"emptyState");function hn(n){if(typeof n!="object"||n===null||Array.isArray(n))return!1;let e=n;return e.version!==I||typeof e.projects!="object"||e.projects===null?!1:Object.values(e.projects).every(t=>Array.isArray(t)&&t.every(i=>typeof i=="string"))}a(hn,"isState");var Pt="pi-agent-ide-startup-tip";function Q(n){let e=new O,t=new N;n.registerEntryRenderer(Pt,(r,c,d)=>{let l=r.data;if(!(typeof l.title!="string"||typeof l.body!="string"))return new j({title:l.title,body:l.body},d)});let i=n.events.on(Te,r=>{if(!Ee(r))throw new Error("Invalid tip provider registration request");r.accept(e.registerProvider(r.provider))});n.on("session_shutdown",i);let o,s=Promise.resolve();n.on("session_start",(r,c)=>{o?.abort(),o=new AbortController;let d=o.signal;s=s.then(()=>yn(n,e,t,r.reason,c,d)).catch(()=>{})}),n.on("session_shutdown",async()=>{o?.abort(),await s}),n.events.emit(Ie,{protocol:R,apiVersion:C})}a(Q,"registerTips");async function yn(n,e,t,i,o,s){if(o.mode!=="tui"||(s.throwIfAborted(),e.isEmpty))return;let r=await e.collectTips({cwd:o.cwd,mode:o.mode,hasUI:o.hasUI,signal:s,reason:i});if(s.throwIfAborted(),r.length===0)return;let c=bt(o.cwd);for(let d of r){let l=wn(d.providerId,d.tip.id);if(await t.claimIfUnseen(c,l,d.tip.id)){if(s.aborted){await t.unmarkShown(c,l);return}try{n.appendEntry(Pt,d.tip);return}catch(u){throw await t.unmarkShown(c,l),u}}}}a(yn,"displayTip");function wn(n,e){return JSON.stringify([n,e])}a(wn,"tipIdentity");import{mkdir as bn,readFile as vt,writeFile as Pn}from"node:fs/promises";async function It(n,e){await bn(Pe(n),{recursive:!0});let t=[],i=e.filter(r=>r.recipe.formatter!==void 0),o=e.filter(r=>r.recipe.linter!==void 0),s=e.filter(r=>r.recipe.lsp!==void 0);if(i.length>0){let r=P(n,"formatters"),c=await Z(r,{version:1,formatters:{}}),d=ee(c,"formatters");for(let l of i)d[l.recipe.id]??=l.recipe.formatter;await te(r,c)&&t.push(r)}if(o.length>0){let r=P(n,"linters"),c=await Z(r,{version:1,linters:{}}),d=ee(c,"linters");for(let l of o)d[l.recipe.id]??=l.recipe.linter;await te(r,c)&&t.push(r)}if(s.length>0){let r=P(n,"lsp-servers"),c=await Z(r,{version:1,servers:{}}),d=ee(c,"servers");for(let l of s){let u=ge(l.recipe.lsp);d[l.recipe.id]??={command:u.command,transport:"stdio",rootMarkers:u.rootMarkers,...u.initializationOptions!==void 0&&{initializationOptions:u.initializationOptions},...u.settings!==void 0&&{settings:u.settings},...u.requireRootMarker!==void 0&&{requireRootMarker:u.requireRootMarker},languages:Object.fromEntries(Object.entries(u.languageIds).map(([p,f])=>[p,{extensions:f,...u.fileNames?.[p]&&{fileNames:u.fileNames[p]}}])),capabilities:["diagnostics"]}}await te(r,c)&&t.push(r)}return t}a(It,"writeSuggestedConfigs");async function Z(n,e){try{let t=JSON.parse(await vt(n,"utf8"));if(typeof t!="object"||t===null||Array.isArray(t))throw new Error(`${n} must contain an object`);return t}catch(t){if(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ENOENT")return e;throw t}}a(Z,"readObject");function ee(n,e){let t=n[e];if(typeof t!="object"||t===null||Array.isArray(t))throw new Error(`${e} must be an object`);return t}a(ee,"objectMember");async function te(n,e){let t=`${JSON.stringify(e,null,2)}
6
+ `;return await vt(n,"utf8").catch(()=>{})===t?!1:(await Pn(n,t,"utf8"),!0)}a(te,"writeJson");var F=class{static{a(this,"DoctorCore")}plugins=new Map;languages=[];recipes=[];setupChecks=[];checks=[];queue=Promise.resolve();registerPlugin(e){let t=this.plugins.get(e.id);if(t!==void 0)return t;let i=this.queue.then(async()=>{let o=!0,s=[],r=[],c=[],d=[],l={addLanguage:a(u=>{L(u,s,e.id,"language",()=>o)},"addLanguage"),addToolRecipe:a(u=>{L(u,r,e.id,"tool recipe",()=>o)},"addToolRecipe"),addSetupCheck:a(u=>{L(u,c,e.id,"setup check",()=>o)},"addSetupCheck"),addCheck:a(u=>{L(u,d,e.id,"check",()=>o)},"addCheck")};try{await e.setup(l)}finally{o=!1}Tt(this.languages,s,"language"),Tt(this.recipes,r,"tool recipe"),this.languages.push(...s),this.recipes.push(...r),this.setupChecks.push(...c),this.checks.push(...d)});return this.plugins.set(e.id,i),this.queue=i.catch(()=>{}),i.catch(()=>{this.plugins.delete(e.id)}),i}async waitForPlugins(){await Promise.all(this.plugins.values())}snapshot(){return{languages:[...this.languages],recipes:[...this.recipes],setupChecks:[...this.setupChecks],checks:[...this.checks]}}};async function Et(n,e){let t=[],i=[];for(let o of n.setupChecks)try{let s=await o.value.inspect(e);t.push(...(s.selections??[]).map(r=>({...r,pluginId:o.pluginId}))),i.push(...(s.actions??[]).map(r=>({...r,pluginId:o.pluginId})))}catch{}return{selections:t,actions:i}}a(Et,"runContributedSetupChecks");async function xt(n,e){let t=[];for(let i of n.checks)try{t.push({pluginId:i.pluginId,title:i.value.title,findings:await i.value.run(e)})}catch(o){t.push({pluginId:i.pluginId,title:i.value.title,findings:[{status:"fail",message:o instanceof Error?o.message:String(o)}]})}return t}a(xt,"runContributedChecks");function Tt(n,e,t){for(let i of e){let o=n.find(s=>s.value.id===i.value.id)?.pluginId;if(o!==void 0)throw new Error(`${t} ${i.value.id} is already owned by doctor plugin ${o}`)}}a(Tt,"assertAvailable");function L(n,e,t,i,o){if(!o())throw new Error(`Doctor plugin ${t} setup is complete`);if(!/^[a-z0-9][a-z0-9.-]*$/u.test(n.id))throw new Error(`Invalid ${i} ID: ${n.id}`);if(e.some(s=>s.value.id===n.id))throw new Error(`Doctor plugin ${t} registered ${i} ${n.id} twice`);e.push({pluginId:t,value:n})}a(L,"add");import Cn from"node:path";import{readFile as vn}from"node:fs/promises";async function Dt(n,e,t,i=process.env){let o=await Fe(n,t.map(c=>c.value)),s=await Tn(n),r=[];for(let c of t){let d=c.value;if(d.languages.every(x=>!e.has(x)))continue;let l=[],u=1,p=o.get(d.id),f=p?.config;f!==void 0&&(u+=6,l.push(`project config: ${f}`)),s.has(`${d.kind}:${d.id}`)&&(u+=6,l.push("Pi Agent IDE config"));let h=p?.dependency;h!==void 0&&(u+=4,l.push(`project dependency: ${h}`));let w=await In(n,d.executables,i);w!==void 0&&(u+=3,l.push(`executable: ${w}`)),r.push({pluginId:c.pluginId,recipe:d,score:u,evidence:l,...w&&{executable:w}})}return r.sort((c,d)=>d.score-c.score||c.recipe.id.localeCompare(d.recipe.id))}a(Dt,"discoverRecipeCandidates");function St(n,e,t=[]){let i=new Map,o=new Map(t.map(s=>[`${s.kind}:${s.languageId}`,s.toolId]));for(let s of e)for(let r of["formatter","linter","lsp"]){let c=o.get(`${r}:${s}`),d=c===void 0?4:7,l=n.filter(p=>p.recipe.kind===r&&p.recipe.languages.includes(s)&&p.executable!==void 0&&p.recipe.id!==c&&p.score>=d),u=l[0];u!==void 0&&(l.filter(p=>p.score===u.score).length>1||i.set(`${u.recipe.kind}:${u.recipe.id}`,u))}return[...i.values()]}a(St,"selectSuggestedRecipes");async function In(n,e,t){for(let i of e)if(await be(i,n,t))return i}a(In,"firstExecutable");async function Tn(n){let e=new Set;for(let[t,i,o]of[["formatters","formatters","formatter"],["linters","linters","linter"],["lsp-servers","servers","lsp"]])try{let s=JSON.parse(await vn(P(n,t),"utf8"));if(typeof s!="object"||s===null||Array.isArray(s))continue;let c=s[i];if(typeof c=="object"&&c!==null&&!Array.isArray(c))for(let d of Object.keys(c))e.add(`${o}:${d}`)}catch{}return e}a(Tn,"managedRecipeIds");import{execFile as En}from"node:child_process";import{readdir as xn}from"node:fs/promises";import v from"node:path";import{promisify as Dn}from"node:util";var Sn=Dn(En),Rn=new Set([".git",".hg",".svn","node_modules","vendor","build","dist","coverage",".cache",".next","target"]);async function Rt(n,e){e?.throwIfAborted();try{let i=(await Sn("git",["ls-files","--cached","--others","--exclude-standard","-z"],{cwd:n,encoding:"utf8",maxBuffer:16777216,signal:e})).stdout.split("\0").filter(Boolean).map(o=>v.resolve(n,o)).filter(o=>!kt(o));return e?.throwIfAborted(),i.length>0?i:await ne(n,e)}catch{return e?.throwIfAborted(),ne(n,e)}}a(Rt,"collectProjectFiles");function Ct(n,e){let t=new Map;for(let i of e){let o=new Set(i.extensions.map(c=>c.toLowerCase())),s=new Set(i.fileNames),r=n.filter(c=>!c.split(v.sep).join("/").includes("/.pi/pi-agent-ide/")&&(o.has(v.extname(c).toLowerCase())||s.has(v.basename(c))));r.length>0&&t.set(i.id,r)}return t}a(Ct,"detectProjectLanguages");async function ne(n,e){e?.throwIfAborted();let t=[];for(let i of await xn(n,{withFileTypes:!0})){if(i.isDirectory()&&Rn.has(i.name))continue;let o=v.join(n,i.name);kt(o)||(i.isDirectory()?t.push(...await ne(o,e)):i.isFile()&&t.push(o))}return t}a(ne,"walk");function kt(n){return n.split(v.sep).join("/").includes("/.pi/pi-agent-ide/")}a(kt,"isManagedIdeConfig");async function ie(n,e,t=process.env,i){i?.throwIfAborted();let o=await Rt(e,i);i?.throwIfAborted();let s=Ct(o,n.languages.map(p=>p.value)),r=new Set(s.keys()),c={cwd:e,files:o,detectedLanguageIds:r,detectedLanguages:s,env:t},[d,l]=await Promise.all([Dt(e,r,n.recipes,t),Et(n,c)]),u=new Map;for(let p of r)for(let f of["formatter","linter","lsp"]){if(l.selections.some(m=>m.languageId===p&&m.kind===f))continue;let h=d.filter(m=>m.recipe.kind===f&&m.recipe.languages.includes(p)),w=a(m=>m.score-(m.executable===void 0?0:3),"nativeScore"),x=Math.max(1,...h.map(w));for(let m of h){if(m.executable!==void 0||w(m)!==x||x<=1)continue;let ae=`${f}-${m.recipe.id}-unavailable`;u.set(ae,{id:ae,pluginId:m.pluginId,message:`Native project setup selects ${m.recipe.id}, but its executable is unavailable. Install ${m.recipe.executables.join(" or ")} and run Doctor again.`})}}return{cwd:e,files:o,detectedLanguages:s,candidates:d,selections:l.selections,actions:[...l.actions,...u.values()],suggestions:St(d,r,l.selections)}}a(ie,"inspectDoctorSetup");async function M(n,e,t=process.env){let i=await ie(n,e,t),o=new Set(i.detectedLanguages.keys()),s={cwd:e,files:i.files,detectedLanguageIds:o,detectedLanguages:i.detectedLanguages,env:t},r=await xt(n,s),c=[{status:"pass",message:`Project: ${e}`},i.files.length>0?{status:"pass",message:`${i.files.length} project files inspected`}:{status:"warn",message:"No project files found"},o.size>0?{status:"pass",message:`Detected: ${[...o].join(", ")}`}:{status:"warn",message:"No registered project languages detected"}];return{...i,sections:[{title:"Project",pluginId:"doctor",findings:c},...r]}}a(M,"runDoctor");function E(n){let e=["Pi Agent IDE doctor",""];for(let t of n.sections){e.push(`${t.title} (${t.pluginId})`);for(let i of t.findings)e.push(` ${i.status.toUpperCase().padEnd(4)} ${i.message}`),i.detail!==void 0&&e.push(` \`${i.detail}\``);e.push("")}if(n.actions.length>0){e.push("Setup needs attention");for(let t of n.actions)e.push(` ${t.message} [${t.pluginId}]`);e.push("")}if(n.suggestions.length>0){e.push("Suggested configuration");for(let t of n.suggestions){let i=t.evidence.length>0?` \u2014 ${t.evidence.join(", ")}`:"";e.push(` ${t.recipe.kind.padEnd(9)} ${t.recipe.id} [${t.pluginId}]${i}`)}e.push("")}return e.join(`
7
+ `).trimEnd()}a(E,"formatDoctorReport");function oe(n){return n.actions.length>0||n.suggestions.length>0||n.sections.some(e=>e.findings.some(t=>t.status==="fail"))}a(oe,"doctorNeedsWork");function At(n){let e=n.candidates.map(t=>({owner:t.pluginId,id:t.recipe.id,kind:t.recipe.kind,languages:t.recipe.languages,evidence:t.evidence,documentation:t.recipe.documentation}));return["Finish configuring Pi Agent IDE for this project.","Preserve existing formatter, linter, compiler, and style rules. Do not invent or replace native project settings.","Do not install packages, write credentials, or change source files without the user's normal confirmation.","Pi Agent IDE project configs live in .pi/pi-agent-ide/.","Use only the relevant plugin contributions listed below; each owner remains responsible for its own scope.","",E(n),"","Relevant registered recipes:",JSON.stringify(e,null,2),"",`Project root: ${Cn.resolve(n.cwd)}`].join(`
8
+ `)}a(At,"buildDoctorAgentPrompt");import{createHash as kn}from"node:crypto";var An="doctor",re=3;function $t(n,e){let t=ve(n,$n(e));t!==void 0&&t.catch(()=>{})}a($t,"registerDoctorTipProvider");function $n(n){return{protocol:R,apiVersion:C,id:An,async getTip(e){let t=await n(e),i=jn(t);if(i.length===0)return;let o=i.slice(0,re).map(s=>`\u2022 ${s.message}`);return i.length>re&&o.push(`\u2022 ${i.length-re} more`),{id:`doctor-setup-${On(i)}`,title:i.length===1?"Project setup needs attention":`${i.length} project setup items`,body:[...o,"Run /pi-agent-ide-doctor"].join(`
9
+ `)}}}}a($n,"createDoctorTipProvider");function jn(n){let e=n.actions.map(i=>({id:`action:${i.pluginId}:${i.id}`,message:i.message})),t=n.suggestions.map(i=>{let o=i.recipe.languages.filter(r=>n.detectedLanguages.has(r)).join(", "),s={formatter:"formatting",linter:"linting",lsp:"language support"}[i.recipe.kind];return{id:`suggestion:${i.pluginId}:${i.recipe.kind}:${i.recipe.id}`,message:`Use ${i.recipe.name} for ${o} ${s}`}});return[...e,...t].sort((i,o)=>i.id.localeCompare(o.id))}a(jn,"setupItems");function On(n){return kn("sha256").update(n.map(e=>`${e.id}\0${e.message}`).join("\0")).digest("hex").slice(0,12)}a(On,"fingerprint");async function V(n){let e=new F;$t(n,async o=>(await e.waitForPlugins(),ie(e.snapshot(),o.cwd,process.env,o.signal)));let t,i=n.events.on(Re,o=>{if(!Ce(o))throw new Error("Invalid doctor plugin registration request");o.accept(e.registerPlugin(o.plugin))});n.on("session_shutdown",i),n.registerCommand("pi-agent-ide-doctor",{description:"Check and configure Pi Agent IDE for this project",handler:a(async(o,s)=>{await e.waitForPlugins();let r=await M(e.snapshot(),s.cwd);se(n,E(r));let c=new Set(o.trim().split(/\s+/u).filter(Boolean));if(r.suggestions.length>0&&!c.has("--no-apply")&&(c.has("--apply")||s.hasUI&&await s.ui.confirm("Apply suggested configuration?","Add detected tools to .pi/pi-agent-ide/. Existing entries and native tool settings are kept."))){let u=await It(s.cwd,r.suggestions),p=u.length===0?"Pi Agent IDE configs are already up to date":`Updated ${u.length} Pi Agent IDE config ${u.length===1?"file":"files"}`;s.ui.notify(p,"info"),r=await M(e.snapshot(),s.cwd),se(n,E(r))}if(!oe(r)&&!c.has("--agent"))return;(c.has("--agent")||s.hasUI&&await s.ui.confirm("Ask the agent to finish setup?","The agent will receive this redacted report and relevant plugin recipes."))&&(t=s.cwd,n.sendUserMessage(At(r)))},"handler")}),n.on("agent_end",async(o,s)=>{let r=t;if(r===void 0)return;t=void 0;let c=await M(e.snapshot(),r,process.env);se(n,`Doctor recheck after agent setup
10
+
11
+ ${E(c)}`),oe(c)?s.ui.notify("Pi Agent IDE setup still needs attention","warning"):s.ui.notify("Pi Agent IDE setup is ready","info")}),n.events.emit(Se,{protocol:xe,apiVersion:1}),await e.waitForPlugins()}a(V,"registerDoctor");function se(n,e){n.sendMessage({customType:"pi-agent-ide-doctor",content:e,display:!0},{triggerTurn:!1})}a(se,"sendReport");import _n from"node:path";var jt="diagnostics",Nn=je({kind:"code-view",label:"Diagnostics"});async function U(n){let e,t=a((c,d)=>{if(e===void 0)throw new Error("IDE diagnostics are not connected");return e(c,{cwd:d})},"collect"),i={protocol:D,apiVersion:3,id:"diagnostics",setup(c){e=c.readDiagnostics}},o=new WeakMap,s=new WeakMap,r={protocol:ke,apiVersion:Ae,id:"diagnostics",setup(c){c.addResolver({resolver:Ln(t),renderResult:Nn});let d=fe();c.addView({view:"diagnostics",priority:100,presenter:Mn(t,s)}),c.addHandler({stage:"read",when:{resolvedBy:"any",contentKind:"text"},handler(l){return l.state?.resolvedBy==="diagnostics"?d(l):(l.state?.contentKind==="text"&&l.request.views?.includes("diagnostics")&&o.set(l.request,l.state.text),{kind:"continue",context:l})}}),c.addHandler({stage:"post-read",handler(l){let u=o.get(l.request),p=u&&s.get(u),f=l.result,h=f?.content[0];return!p||!f||h?.type!=="text"?{kind:"continue",context:l}:{kind:"continue",context:{...l,result:{...f,content:[{...h,text:`${p}
12
+ ${h.text}`},...f.content.slice(1)]}}}}}),c.describe("`diagnostics:<path>` returns lint and LSP diagnostics with five lines of source context on each side. The `diagnostics` view adds the same diagnostics alongside a normal file read. Both reuse background results, wait briefly for current checks, and report pending, unavailable, snapshot, or unversioned sources explicitly. A snapshot is the latest push update, not a completed check; an empty snapshot does not mean the file is clean."),c.addPromptGuideline("Use read with `diagnostics:<path>` or the `diagnostics` view for per-file diagnostics instead of running equivalent checks through Bash. Project builds and tests remain separate verification."),c.addPromptGuideline('You can use read with `views: ["diagnostics"]` to add lint and LSP diagnostics alongside file content.'),c.addPromptGuideline("Treat diagnostic snapshots as incomplete observations, not completed checks; an empty snapshot is not evidence that the file is clean."),c.addPromptGuideline("Explicit formatter, linter, and LSP overrides can match exact basenames with fileNames, such as Dockerfile or CMakeLists.txt. LSP requireRootMarker limits a server to files below one of its rootMarkers inside the project, keeping framework servers from claiming unrelated files. LSP initializationOptions can use {project} in string values for project-local plugin paths. Regex diagnostic parsers support multiline output and columnBase: 0 for zero-based tool columns."),c.addPromptGuideline("For missing formatting or diagnostics, check native project configuration and installed executables before adding IDE overrides. Built-ins find tools in node_modules/.bin, Python virtualenv bin directories (Scripts on Windows), and vendor/bin; Windows executable suffixes follow PATHEXT. /pi-agent-ide-doctor reports detected tools and missing dependencies. A detected runtime does not prove its formatter modules or language server can run.")}};await Promise.all([we(n,i),$e(n,r)])}a(U,"registerDiagnostics");function Ln(n){return{id:"diagnostics",tryResolve(e,t){return Promise.resolve(Fn(e,t.cwd,n))}}}a(Ln,"createDiagnosticResolver");function Fn(n,e,t){let i;try{i=ce(n,jt,e)}catch(o){return{kind:"failed",error:o}}return i===void 0?{kind:"not-handled"}:{kind:"resolved",resource:{source:de(jt,i),async read(){let o=await t(i,e);return[le(i,o.content,o.results)]}}}}a(Fn,"resolveDiagnosticSource");function Mn(n,e){return{id:"diagnostics",async present(t,i){if(i.purpose!=="read"||!_n.isAbsolute(t.source))return t;let o=await n(t.source,i.cwd);if(o.content!==t.content)throw new Error("File changed during diagnostic read; read it again for current source lines.");return e.set(t,pe(o.results)),ue(t,o.results)}}}a(Mn,"createDiagnosticPresenter");var Ot=[g("ide.core",W),g("ide.tips",Q),g("ide.doctor",V),g("ide.languages",ct,["ide.doctor"]),g("read.core",He),g("read.filesystem",Me,["read.core","editor.core"]),g("read.filesystem.image",Ve,["read.filesystem"]),g("read.filesystem.pdf",Ue,["read.filesystem"]),g("read.filesystem.text",Be,["read.filesystem"]),g("read.web",qe,["read.core"]),g("read.web.html",Je,["read.web"]),g("read.web.image",Ge,["read.web"]),g("read.web.pdf",ze,["read.web"]),g("read.web.text",We,["read.web"]),g("search.core",Xe),g("search.text",Ye,["search.core"]),g("editor.renderer",it,["editor.core"]),g("editor.core",Ke),g("editor.anchor.constant",Qe,["read.core","editor.core"]),g("editor.anchor.line-hash",Ze,["read.core","editor.core"]),g("editor.anchor.exact",et,["editor.core"]),g("editor.argument-order",tt,["editor.core"],!1),g("editor.overwrite",nt,["editor.core"],!1),g("editor.stale-anchor",ot,["editor.core"]),g("ide.ast",rt,["ide.core","read.core","search.core","editor.core"]),g("ide.formatter",at,["ide.core"]),g("ide.lint",dt,["ide.core"]),g("ide.changes",st,["ide.core","read.core","editor.core"]),g("ide.lsp",lt,["ide.core","read.core","search.core"]),g("ide.diagnostics",U,["ide.core","read.core"])];function g(n,e,t=[],i=!0){return{id:n,dependencies:t,register:e,...i?{}:{defaultEnabled:!1}}}a(g,"builtin");import{readFile as Vn}from"node:fs/promises";import Un from"node:os";import B from"node:path";function Ft(n=process.env,e=Un.homedir(),t=process.cwd()){let i=n.PI_CODING_AGENT_DIR?.trim(),o=i===void 0||i.length===0?B.join(e,".pi","agent"):B.resolve(i);return{globalPath:B.join(o,"pi-agent-ide","extensions.json"),projectPath:B.resolve(t,".pi","pi-agent-ide","extensions.json")}}a(Ft,"resolvePiAgentIdeExtensionsConfigPaths");async function Mt(n){let e=await _t(n.globalPath),t=await _t(n.projectPath);return{disabled:[...new Set([...e.disabled,...t.disabled])],enabled:[...new Set([...e.enabled,...t.enabled])]}}a(Mt,"readPiAgentIdeExtensionsConfig");async function _t(n){let e;try{e=await Vn(n,"utf8")}catch(i){if(Bn(i))return{disabled:[],enabled:[]};throw new Error(`Cannot read Pi Agent IDE extension config at ${n}: ${Lt(i)}`,{cause:i})}let t;try{t=JSON.parse(e)}catch(i){throw new Error(`Invalid JSON in Pi Agent IDE extension config at ${n}: ${Lt(i)}`,{cause:i})}if(!Vt(t))throw new Error(`Pi Agent IDE extension config at ${n} must be a JSON object`);return{disabled:Nt(t,"disabled",n),enabled:Nt(t,"enabled",n)}}a(_t,"readConfigExtensionIds");function Nt(n,e,t){let i=n[e];if(i===void 0)return[];if(!Array.isArray(i))throw new Error(`${e} in ${t} must be an array of non-empty strings`);let o=i.filter(r=>typeof r=="string");if(o.length!==i.length||o.some(r=>r.length===0))throw new Error(`${e} in ${t} must be an array of non-empty strings`);if(new Set(o).size!==o.length)throw new Error(`${e} in ${t} must not contain duplicate IDs`);return o}a(Nt,"readIdField");function Bn(n){return Vt(n)&&n.code==="ENOENT"}a(Bn,"isMissingFile");function Vt(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}a(Vt,"isRecord");function Lt(n){return n instanceof Error?n.message:String(n)}a(Lt,"errorMessage");function Ut(n,e,t=[]){let i=new Map;for(let d of n){if(i.has(d.id))throw new Error(`Duplicate Pi Agent IDE extension ID: ${d.id}`);i.set(d.id,d)}for(let d of n)for(let l of d.dependencies)if(!i.has(l))throw new Error(`Pi Agent IDE extension ${d.id} has unknown dependency ${l}`);let o=new Set;for(let d of e){if(!i.has(d))throw new Error(`Unknown Pi Agent IDE extension ID in disabled: ${d}`);o.add(d)}for(let d of t)if(!i.has(d))throw new Error(`Unknown Pi Agent IDE extension ID in enabled: ${d}`);let s=qn(i,t,o),r=new Set;for(let d of n)(d.defaultEnabled===!1&&!s.has(d.id)||o.has(d.id))&&r.add(d.id);let c=!0;for(;c;){c=!1;for(let d of n)r.has(d.id)||d.dependencies.every(l=>!r.has(l))||(r.add(d.id),c=!0)}return{enabled:n.filter(d=>!r.has(d.id)),disabled:r}}a(Ut,"selectBuiltinExtensions");function qn(n,e,t){let i=new Set,o=[...e];for(;o.length>0;){let s=o.pop();if(!(i.has(s)||t.has(s))){i.add(s);for(let r of n.get(s)?.dependencies??[])i.has(r)||o.push(r)}}return i}a(qn,"collectForcedOn");async function Jn(n){n.on("before_agent_start",i=>{let o=i.systemPrompt.replace("- bash: Execute bash commands (ls, grep, find, etc.)","- bash: Execute Bash commands").replace(`- Use bash for file operations like ls, rg, find
13
+ `,"");return o===i.systemPrompt?void 0:{systemPrompt:o}});let e=await Mt(Ft()),{enabled:t}=Ut(Ot,e.disabled,e.enabled);for(let i of t)await i.register(n)}a(Jn,"registerUnifiedPiAgentIde");export{Jn as default};
@@ -24,11 +24,13 @@ Pi Agent IDE
24
24
  ├── read core
25
25
  │ └── Resource resolvers, presenters, and pipeline handlers
26
26
  ├── search core
27
- │ └── text, structural, semantic, and web resolvers
27
+ │ └── text and structural resolvers
28
28
  ├── text-editor core
29
29
  │ └── writable Resources, anchors, mutations, guards, and renderers
30
- └── IDE core
31
- └── AST, LSP, formatter, lint, and Git-aware plugins
30
+ ├── IDE core
31
+ │ └── AST, LSP, formatter, lint, and Git-aware plugins
32
+ └── startup-tip core
33
+ └── passive, provider-owned TUI tips
32
34
  ```
33
35
 
34
36
  The cores do not import concrete plugins to discover behavior. Plugins connect through public protocols.
@@ -43,16 +45,17 @@ Shared Resource contracts live under `packages/pi-agent-resource`.
43
45
 
44
46
  ## Plugin protocols
45
47
 
46
- The umbrella currently exposes four main extension protocols:
48
+ The umbrella currently exposes five main extension protocols:
47
49
 
48
- | Protocol package | Contributions |
49
- | ---------------------- | ------------------------------------------------------------------------- |
50
- | `pi-agent-read` | Resource resolvers, read handlers, presenters, result renderers |
51
- | `pi-agent-search` | Search resolvers and search actions |
52
- | `pi-agent-text-editor` | Writable resolvers, anchors, mutations, guards, renderers, edit listeners |
53
- | `pi-agent-ide` | Formatter, compiler, linter, and other toolchain implementations |
50
+ | Protocol package | Contributions |
51
+ | ----------------------- | ------------------------------------------------------------------------- |
52
+ | `pi-agent-read` | Resource resolvers, read handlers, presenters, result renderers |
53
+ | `pi-agent-search` | Search resolvers and search actions |
54
+ | `pi-agent-text-editor` | Writable resolvers, anchors, mutations, guards, renderers, edit listeners |
55
+ | `pi-agent-ide` | Formatter, compiler, linter, and other toolchain implementations |
56
+ | `pi-agent-ide/api/tips` | Provider-owned passive startup tips |
54
57
 
55
- Each plugin declares a protocol name, API version, stable ID, and `setup` function. Setup contributions are validated before they become active.
58
+ Each protocol contribution declares a protocol name, API version, and stable ID. Contributions are validated before they become active; protocols that need setup expose it through their own contract.
56
59
 
57
60
  The core and plugin may load in either order. They exchange readiness and registration messages through Pi's shared event bus, then use direct in-memory APIs after registration. This lets an external Pi extension connect even though the built-in package is loaded through one composite entrypoint.
58
61
 
@@ -61,12 +64,13 @@ The core and plugin may load in either order. They exchange readiness and regist
61
64
  Doctor is an independent protocol, not a central list of tool knowledge. Each extension owns and registers its own checks and recipes:
62
65
 
63
66
  - the language plugin contributes language detection;
64
- - AST contributes parser probes;
65
- - formatter, lint, and LSP contribute their own catalogs and config checks;
66
- - web search contributes provider and credential checks;
67
+ - AST contributes structural-search setup and parser probes;
68
+ - formatter, lint, and LSP contribute their own catalogs, lightweight effective-selection inspections, and full config checks;
69
+ - local search and Git contribute lightweight dependency setup inspections and full runtime checks;
70
+ - browser reads contribute an optional full runtime check, not a startup setup action;
67
71
  - external extensions can contribute through `pi-agent-doctor`.
68
72
 
69
- The doctor core only aggregates contributions, runs them, and presents the result. It never imports concrete plugins or assumes their IDs. Disabling a plugin removes its checks and recipes from `/pi-agent-ide-doctor`. Human-facing catalog pages are generated from the same plugin-owned data.
73
+ The doctor core only aggregates contributions, runs them, and presents the result. It never imports concrete plugins or assumes their IDs. Lightweight setup inspections decide whether actionable startup guidance exists without launching project tools. Full checks remain behind `/pi-agent-ide-doctor`. Disabling a plugin removes its checks, setup inspections, and recipes. Human-facing catalog pages are generated from the same plugin-owned data.
70
74
 
71
75
  ## Anchors
72
76
 
@@ -78,9 +82,9 @@ An anchor resolver can:
78
82
  - validate it against the current Resource snapshot;
79
83
  - return a line or text selection;
80
84
  - reject stale or ambiguous input with recovery context;
81
- - resolve one anchor to several Resource sources.
85
+ - resolve one value to typed ranges in several Resource sources.
82
86
 
83
- Read presenters can display matching markers without changing canonical source text.
87
+ Typed target resolvers own their opaque syntax. Read and editor cores validate and use the returned sources and ranges; they do not parse formats such as `SEARCH#...` themselves. Read presenters can display matching markers without changing canonical source text.
84
88
 
85
89
  ## Toolchain feedback
86
90
 
@@ -1,72 +1,199 @@
1
1
  # Configuration
2
2
 
3
- Pi Agent IDE enables every built-in extension by default. A user config can disable built-ins that are not useful in a particular setup.
3
+ Pi Agent IDE enables every built-in extension by default. Project and global config files can disable built-ins by their stable IDs and turn on built-ins that are off by default.
4
4
 
5
- ## Config file
5
+ ## Config files
6
6
 
7
- Create:
7
+ Pi Agent IDE reads these optional files:
8
8
 
9
9
  ```text
10
- ~/.pi/agent/pi-agent-ide.json
10
+ <project>/.pi/pi-agent-ide/extensions.json
11
+ ~/.pi/agent/pi-agent-ide/extensions.json
12
+ <project>/.pi/pi-agent-ide/search.json
13
+ ~/.pi/agent/pi-agent-ide/search.json
11
14
  ```
12
15
 
16
+ For `extensions.json`, the project file is read first and the global file is also applied. The lists are merged: if either file disables an ID, that extension stays disabled; `enabled` works the same way for extensions that are off by default.
17
+
13
18
  Example:
14
19
 
15
20
  ```json
16
21
  {
17
- "disabledExtensions": ["search.semantic", "ide.lsp"]
22
+ "enabled": ["editor.argument-order"]
18
23
  }
19
24
  ```
20
25
 
21
- Restart Pi or use `/reload` after changing the file.
26
+ `editor.argument-order` is off by default, so this config turns it on.
22
27
 
23
- ## Custom path
28
+ An explicit `disabled` entry always beats an explicit `enabled` entry for the same ID.
29
+ `enabled` matters only for built-ins marked as off by default; listing an always-on
30
+ extension there changes nothing. Enabling a default-off extension also enables its
31
+ default-off dependencies unless they are explicitly disabled.
24
32
 
25
- Set `PI_AGENT_IDE_CONFIG` to read another file:
33
+ A project config is useful for repository-specific choices. The global config applies to every project. When Pi uses a custom `PI_CODING_AGENT_DIR`, the global config follows that directory.
26
34
 
27
- ```bash
28
- PI_AGENT_IDE_CONFIG=./pi-agent-ide.json pi
35
+ Restart Pi or use `/reload` after changing extension selection. Search timeout settings are read for every search call.
36
+
37
+ ## Search timeout
38
+
39
+ The complete `search` call has a 30-second timeout by default. This covers resolver work and result formatting. When it expires, the active resolver is cancelled and the agent receives this error:
40
+
41
+ ```text
42
+ Search timed out after 30 seconds. Try a smaller path scope.
29
43
  ```
30
44
 
31
- Relative paths are resolved from the current working directory. When Pi uses a custom `PI_CODING_AGENT_DIR`, the default config path follows that directory.
45
+ Set a global timeout in `~/.pi/agent/pi-agent-ide/search.json`:
32
46
 
33
- ## Project setup
47
+ ```json
48
+ {
49
+ "timeoutMs": 30000
50
+ }
51
+ ```
52
+
53
+ A project can override it in `<project>/.pi/pi-agent-ide/search.json`. Set `timeoutMs` to `null` at either level to disable the timeout. A project value wins over the global value. Any numeric value must be a positive integer. Invalid search settings reject the search call and name the bad config file.
34
54
 
35
- Run `/pi-agent-ide-doctor` from a project directory. Doctor collects checks and setup recipes from the extensions that are loaded in the current Pi session. It detects project languages, existing native tool configs, installed executables, AST parsers, search providers, formatters, linters, and language servers.
55
+ ## Tool configuration
36
56
 
37
- Doctor shows a report before it changes anything. After confirmation, generated tool mappings are stored in:
57
+ Pi Agent IDE ships formatter, linter, and LSP mappings. You do not need to copy them into each project. Install the tools and their required modules separately. Pi looks in project `node_modules/.bin`, Python `.venv` and `venv` executable directories, `vendor/bin`, and `PATH`. Python environments use `Scripts` on Windows and `bin` elsewhere. Windows command lookup respects `PATHEXT`, including `.cmd` launchers.
58
+
59
+ You can replace built-in entries or add custom entries in either of these directories:
60
+
61
+ ```text
62
+ ~/.pi/agent/extensions/pi-agent-ide/
63
+ <project>/.pi/pi-agent-ide/
64
+ ```
65
+
66
+ Each directory can contain `formatters.json`, `linters.json`, and `lsp-servers.json`. All three layers use the same JSON schema. Pi resolves entries in this order:
67
+
68
+ 1. Project.
69
+ 2. Global.
70
+ 3. Built-in.
71
+
72
+ Entries merge by stable ID. A project entry replaces the whole global or built-in entry with the same ID. A global entry replaces the whole built-in entry. New IDs are allowed. When different IDs match the same file, the entry from the higher layer runs first. Invalid JSON or an invalid entry stops that tool category instead of silently using a lower layer; the other categories still load.
73
+
74
+ Use a global override for a nonstandard command shared by your projects. Use a project override when one repository needs different behavior. Existing files such as `.clang-format`, `eslint.config.js`, `pyproject.toml`, and `tsconfig.json` remain the source of formatting and lint rules.
75
+
76
+ Use direct argument arrays in tool commands. Available placeholders are `{file}`, `{relativeFile}`, `{fileDir}`, and `{project}`. Formatter output can be `in-place` or `stdout`. Linters have separate `check` and optional `fix` commands. See the [generated tool catalog](./generated/tool-catalog/index.md) for built-in IDs and commands.
77
+
78
+ When `PI_CODING_AGENT_DIR` is set, the global directory follows it as `<PI_CODING_AGENT_DIR>/extensions/pi-agent-ide/`. Restart Pi or use `/reload` after changing a configuration file.
79
+
80
+ ### Files without a language extension
81
+
82
+ Formatter and linter `fileNames` entries match exact basenames, such as `Dockerfile` or `CMakeLists.txt`. A file can match either `extensions` or `fileNames`; existing `include` and `exclude` rules still apply. LSP entries put `fileNames` beside `extensions` inside each language. Basenames are case-insensitive on Windows.
83
+
84
+ ### Framework language servers
85
+
86
+ An LSP entry can set `requireRootMarker: true`. It then applies only when one of its `rootMarkers` exists in the file's directory or an ancestor inside the project. Markers are relative paths, not globs. The Angular built-in uses `angular.json`, so installing Angular's server does not make it claim ordinary TypeScript or HTML projects. A single-file server can leave this option unset.
87
+
88
+ JSX and TSX use the LSP language IDs `javascriptreact` and `typescriptreact`, not plain JavaScript and TypeScript.
89
+
90
+ LSP `initializationOptions` can use `{project}` inside string values, including nested plugin locations. Pi expands it to the absolute project path before starting the server. `settings` values are sent through the LSP configuration protocol.
91
+
92
+ Vue diagnostics use `typescript-language-server` with the project-local `@vue/typescript-plugin`. Install both, along with TypeScript, and enable the Vue plugin in the native `tsconfig.json`:
93
+
94
+ ```json
95
+ {
96
+ "compilerOptions": {
97
+ "plugins": [{ "name": "@vue/typescript-plugin" }]
98
+ },
99
+ "include": ["src/**/*.vue"]
100
+ }
101
+ ```
102
+
103
+ The Vue mapping is separate from ordinary TypeScript, so other projects do not load the Vue plugin. This setup does not claim the extra custom commands of `@vue/language-server`.
104
+
105
+ ### Custom diagnostic reporters
106
+
107
+ Regex diagnostic parsers run with multiline matching. Set `columnBase: 0` when a reporter counts columns from zero; the default is one. Returned diagnostic positions remain one-based. This setting applies only to `format: "regex"` parsers.
108
+
109
+ A runtime being installed does not prove its modules or language-server features are installed. For example, Taplo's npm build can format TOML but does not include its LSP. Use an LSP-enabled Taplo build for language-server diagnostics. Doctor reports the actual startup failure rather than treating that file as clean.
110
+
111
+ ## Doctor
112
+
113
+ Run `/pi-agent-ide-doctor` to check the effective tools for the current project. Doctor uses the same layered entries as runtime. For each applicable entry it shows the stable ID, source layer, command, and real probe result. A missing or failing command is reported instead of falling back to a lower layer.
114
+
115
+ Doctor can still suggest a project override when project evidence points to a better installed tool. It shows the report before changing anything. `--apply` writes only to `<project>/.pi/pi-agent-ide/`; it never changes the global directory or built-in files. `--agent` delegates remaining setup work, and `--no-apply` skips suggested writes.
116
+
117
+ The project directory may also contain extension and editor settings:
38
118
 
39
119
  ```text
40
120
  .pi/pi-agent-ide/
121
+ ├── extensions.json
41
122
  ├── formatters.json
42
123
  ├── linters.json
43
- └── lsp-servers.json
124
+ ├── lsp-servers.json
125
+ ├── search.json
126
+ └── text-editor.json
44
127
  ```
45
128
 
46
- These files describe how Pi Agent IDE runs tools. Existing files such as `.clang-format`, `eslint.config.js`, `pyproject.toml`, and `tsconfig.json` remain the source of formatting and lint rules.
47
-
48
- Use direct argument arrays in tool commands. Available placeholders are `{file}`, `{relativeFile}`, `{fileDir}`, and `{project}`. Formatter output can be `in-place` or `stdout`. Linters have separate `check` and optional `fix` commands. See the [generated tool catalog](./generated/tool-catalog/index.md) for built-in recipes.
49
-
50
129
  Doctor can send a redacted report and the relevant contributed recipes to the agent when setup still needs work. It runs the checks again after that agent turn.
51
130
 
52
131
  For automation and tests, `/pi-agent-ide-doctor --apply` accepts suggested mappings without the dialog, `--agent` delegates the remaining work, and `--no-apply` skips deterministic config writes.
53
132
 
54
- ## Web search credentials
133
+ ### Browser web reads
134
+
135
+ Automatic browser fallback for HTTP(S) reads needs a system Chrome or Chromium executable. Pi Agent IDE checks common command names on `PATH` and common Linux install paths. Set an exact executable when discovery is not enough:
136
+
137
+ ```bash
138
+ export PI_AGENT_IDE_BROWSER_PATH=/path/to/chrome
139
+ ```
140
+
141
+ Doctor reports browser support as an optional warning. Direct HTTP(S) reads keep working when no browser is installed.
142
+
143
+ ### Doctor setup tip
55
144
 
56
- Project routing is read from `.pi/websearch.json`. Shared credentials can live in `~/.pi/agent/websearch.json`. Credential priority is:
145
+ At TUI startup, doctor performs a lightweight setup inspection. It uses project languages, native project configuration, installed executables, and the effective project → global → built-in tool selection. It does not start formatters, linters, language servers, or browsers merely to decide whether to show a tip.
57
146
 
58
- 1. provider environment variable;
59
- 2. global `~/.pi/agent/websearch.json`;
60
- 3. project `.pi/websearch.json`.
147
+ No tip appears when built-in mappings already cover the project. Empty projects, unknown languages, and missing optional tools also stay quiet. A tip appears only for a concrete problem, such as an explicitly configured command that is unavailable, or for a supported installed tool that project evidence identifies as a useful change to the active selection. The tip names the detected items and points to `/pi-agent-ide-doctor` for the full report.
148
+
149
+ Each actionable state has its own stable fingerprint. The same state is shown once per project, while a materially different later problem can produce a new tip. Like other startup tips, it never enters model context. See [Startup tip provider](./extensions.md#startup-tip-provider) for the provider contract and persistence behavior.
150
+
151
+ ### Exact text recovery
152
+
153
+ Exact text anchors work without configuration. Optional recovery settings live in `.pi/pi-agent-ide/text-editor.json`:
154
+
155
+ ```json
156
+ {
157
+ "recovery": {
158
+ "contextLines": 5,
159
+ "timeoutMs": 2000,
160
+ "exactText": {
161
+ "fuzzyEnabled": true,
162
+ "threshold": 0.8,
163
+ "exactCandidateLimit": 20,
164
+ "fuzzyCandidateLimit": 5,
165
+ "maxFileSizeMiB": 20,
166
+ "maxQuerySizeKiB": 1024,
167
+ "seedLimit": 3,
168
+ "blockLineVariance": 2
169
+ }
170
+ }
171
+ }
172
+ ```
173
+
174
+ Missing fields use these defaults. Invalid values stop the editor from loading. Fuzzy recovery only returns candidates; it never applies an edit. The safe maxima are 100 exact candidates, 20 fuzzy candidates, 20 context lines, a 10-second timeout, a 100 MiB file, a 4 MiB query, 10 seed lines, and a block variance of 10 lines.
175
+
176
+ ### Diff view
177
+
178
+ Edit tool diffs show every diff row by default. The panel keeps completed rows visible and grows as the edit streams in. Set `renderer.diffView` to `"compact"` in `.pi/pi-agent-ide/text-editor.json` to choose a sliding window instead:
179
+
180
+ ```json
181
+ {
182
+ "renderer": {
183
+ "diffView": "compact"
184
+ }
185
+ }
186
+ ```
61
187
 
62
- Environment variables include `EXA_API_KEY`, `TAVILY_API_KEY`, `BRAVE_SEARCH_API_KEY`, `SERPER_API_KEY`, `PARALLEL_API_KEY`, `GOOGLE_API_KEY`, `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `PERPLEXITY_API_KEY`, `XAI_API_KEY`, and provider-specific `PI_AGENT_IDE_SEARCH_<ID>_API_KEY` values. Doctor reports only whether a credential is available. It never prints the value.
188
+ `"full"` is the default and needs no configuration.
63
189
 
64
- ## Behavior
190
+ ## Extension config behavior
65
191
 
66
- - A missing config file means every built-in is enabled.
67
- - `disabledExtensions` must be an array of unique, non-empty IDs.
192
+ - A missing `extensions.json` means every built-in extension is enabled.
193
+ - `disabled` and `enabled` must each be an array of unique, non-empty extension IDs.
194
+ - The project and global lists are merged; a setting wins at either level.
68
195
  - Invalid JSON stops Pi Agent IDE from loading.
69
- - An unknown ID stops Pi Agent IDE from loading. This prevents a typo from silently leaving a module enabled.
196
+ - An unknown ID stops Pi Agent IDE from loading. This prevents a typo from silently leaving an extension enabled.
70
197
  - Disabling a core also disables built-ins that depend on it.
71
198
  - The config controls bundled extensions only. It does not disable external Pi extensions.
72
199
 
@@ -77,6 +204,7 @@ Environment variables include `EXA_API_KEY`, `TAVILY_API_KEY`, `BRAVE_SEARCH_API
77
204
  | ID | Contribution |
78
205
  | ----------------- | ------------------------------------------------ |
79
206
  | `ide.core` | IDE toolchain protocol |
207
+ | `ide.tips` | Passive startup-tip provider core |
80
208
  | `ide.doctor` | `/pi-agent-ide-doctor` and contribution protocol |
81
209
  | `ide.languages` | Project language definitions for doctor |
82
210
  | `read.core` | `read` tool and read plugin protocol |
@@ -86,34 +214,34 @@ Environment variables include `EXA_API_KEY`, `TAVILY_API_KEY`, `BRAVE_SEARCH_API
86
214
 
87
215
  ### Read
88
216
 
89
- | ID | Contribution |
90
- | ----------------------- | -------------------------------- |
91
- | `read.filesystem` | Filesystem Resource resolver |
92
- | `read.filesystem.image` | Filesystem image content |
93
- | `read.filesystem.pdf` | Filesystem PDF content |
94
- | `read.filesystem.text` | Filesystem text content |
95
- | `read.web` | HTTP and HTTPS Resource resolver |
96
- | `read.web.html` | Web HTML conversion |
97
- | `read.web.image` | Web image content |
98
- | `read.web.pdf` | Web PDF content |
99
- | `read.web.text` | Web text content |
217
+ | ID | Contribution |
218
+ | ----------------------- | ----------------------------------------- |
219
+ | `read.filesystem` | Filesystem Resource resolver |
220
+ | `read.filesystem.image` | Filesystem image content |
221
+ | `read.filesystem.pdf` | Filesystem PDF content |
222
+ | `read.filesystem.text` | Filesystem text content |
223
+ | `read.web` | Direct and browser-rendered web Resources |
224
+ | `read.web.html` | Web HTML conversion |
225
+ | `read.web.image` | Web image content |
226
+ | `read.web.pdf` | Web PDF content |
227
+ | `read.web.text` | Web text content |
100
228
 
101
229
  ### Search
102
230
 
103
- | ID | Contribution |
104
- | ----------------- | -------------------------- |
105
- | `search.text` | Local file and text search |
106
- | `search.semantic` | QMD semantic search |
107
- | `search.web` | Web search |
231
+ | ID | Contribution |
232
+ | ------------- | -------------------------- |
233
+ | `search.text` | Local file and text search |
108
234
 
109
235
  ### Editing and anchors
110
236
 
111
- | ID | Contribution |
112
- | ------------------------- | --------------------------------- |
113
- | `editor.anchor.constant` | `begin` and `end` anchors |
114
- | `editor.anchor.line-hash` | Snapshot-aware line anchors |
115
- | `editor.argument-order` | Stable mutation argument ordering |
116
- | `editor.stale-anchor` | Stale-anchor recovery behavior |
237
+ | ID | Contribution |
238
+ | ------------------------- | -------------------------------------------------- |
239
+ | `editor.anchor.constant` | `begin` and `end` anchors |
240
+ | `editor.anchor.line-hash` | Snapshot-aware line anchors |
241
+ | `editor.anchor.exact` | Unique exact text spans and recovery |
242
+ | `editor.argument-order` | Stable mutation argument ordering (off by default) |
243
+ | `editor.overwrite` | Full-file overwrite protection (off by default) |
244
+ | `editor.stale-anchor` | Stale-anchor recovery behavior |
117
245
 
118
246
  ### Code intelligence and feedback
119
247
 
@@ -127,7 +255,7 @@ Environment variables include `EXA_API_KEY`, `TAVILY_API_KEY`, `BRAVE_SEARCH_API
127
255
 
128
256
  ## Dependency examples
129
257
 
130
- Disabling `search.core` also disables `search.text`, `search.semantic`, `search.web`, and built-ins that contribute search behavior such as `ide.ast` and `ide.lsp`.
258
+ Disabling `search.core` also disables `search.text` and built-ins that contribute search behavior such as `ide.ast` and `ide.lsp`.
131
259
 
132
260
  Disabling `editor.core` also disables editor anchors, mutation rendering, writable filesystem support, and IDE plugins that require edit events.
133
261