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
@@ -4,6 +4,9 @@ import type {
4
4
  DoctorFinding,
5
5
  DoctorPlugin,
6
6
  DoctorPluginApi,
7
+ DoctorSetupAction,
8
+ DoctorSetupCheck,
9
+ DoctorToolSelection,
7
10
  } from "#src/api/doctor.js";
8
11
  import type { LanguageDefinition, ToolRecipe } from "#src/api/tool-catalog.js";
9
12
 
@@ -15,6 +18,7 @@ export interface OwnedContribution<T> {
15
18
  export interface DoctorSnapshot {
16
19
  readonly languages: readonly OwnedContribution<LanguageDefinition>[];
17
20
  readonly recipes: readonly OwnedContribution<ToolRecipe>[];
21
+ readonly setupChecks: readonly OwnedContribution<DoctorSetupCheck>[];
18
22
  readonly checks: readonly OwnedContribution<DoctorCheck>[];
19
23
  }
20
24
 
@@ -25,6 +29,7 @@ export class DoctorCore {
25
29
  private readonly plugins = new Map<string, Promise<void>>();
26
30
  private readonly languages: OwnedContribution<LanguageDefinition>[] = [];
27
31
  private readonly recipes: OwnedContribution<ToolRecipe>[] = [];
32
+ private readonly setupChecks: OwnedContribution<DoctorSetupCheck>[] = [];
28
33
  private readonly checks: OwnedContribution<DoctorCheck>[] = [];
29
34
  private queue = Promise.resolve();
30
35
 
@@ -42,6 +47,7 @@ export class DoctorCore {
42
47
  let isOpen = true;
43
48
  const ownLanguages: OwnedContribution<LanguageDefinition>[] = [];
44
49
  const ownRecipes: OwnedContribution<ToolRecipe>[] = [];
50
+ const ownSetupChecks: OwnedContribution<DoctorSetupCheck>[] = [];
45
51
  const ownChecks: OwnedContribution<DoctorCheck>[] = [];
46
52
  const api: DoctorPluginApi = {
47
53
  addLanguage: (value) => {
@@ -50,6 +56,9 @@ export class DoctorCore {
50
56
  addToolRecipe: (value) => {
51
57
  add(value, ownRecipes, plugin.id, "tool recipe", () => isOpen);
52
58
  },
59
+ addSetupCheck: (value) => {
60
+ add(value, ownSetupChecks, plugin.id, "setup check", () => isOpen);
61
+ },
53
62
  addCheck: (value) => {
54
63
  add(value, ownChecks, plugin.id, "check", () => isOpen);
55
64
  },
@@ -65,6 +74,7 @@ export class DoctorCore {
65
74
  assertAvailable(this.recipes, ownRecipes, "tool recipe");
66
75
  this.languages.push(...ownLanguages);
67
76
  this.recipes.push(...ownRecipes);
77
+ this.setupChecks.push(...ownSetupChecks);
68
78
  this.checks.push(...ownChecks);
69
79
  return undefined;
70
80
  });
@@ -91,11 +101,48 @@ export class DoctorCore {
91
101
  return {
92
102
  languages: [...this.languages],
93
103
  recipes: [...this.recipes],
104
+ setupChecks: [...this.setupChecks],
94
105
  checks: [...this.checks],
95
106
  };
96
107
  }
97
108
  }
98
109
 
110
+ export interface DoctorSetupState {
111
+ readonly selections: readonly (DoctorToolSelection & { readonly pluginId: string })[];
112
+ readonly actions: readonly (DoctorSetupAction & { readonly pluginId: string })[];
113
+ }
114
+
115
+ /** Runs lightweight setup checks while isolating a broken plugin. */
116
+ export async function runContributedSetupChecks(
117
+ snapshot: DoctorSnapshot,
118
+ context: DoctorContext,
119
+ ): Promise<DoctorSetupState> {
120
+ const selections: (DoctorToolSelection & { readonly pluginId: string })[] = [];
121
+ const actions: (DoctorSetupAction & { readonly pluginId: string })[] = [];
122
+
123
+ for (const contribution of snapshot.setupChecks) {
124
+ try {
125
+ const result = await contribution.value.inspect(context);
126
+ selections.push(
127
+ ...(result.selections ?? []).map((selection) => ({
128
+ ...selection,
129
+ pluginId: contribution.pluginId,
130
+ })),
131
+ );
132
+ actions.push(
133
+ ...(result.actions ?? []).map((action) => ({
134
+ ...action,
135
+ pluginId: contribution.pluginId,
136
+ })),
137
+ );
138
+ } catch {
139
+ // Setup guidance is optional. An internal inspection failure is not a user action.
140
+ }
141
+ }
142
+
143
+ return { selections, actions };
144
+ }
145
+
99
146
  /**
100
147
  Executes checks independently so one broken plugin cannot hide the rest.
101
148
  */
@@ -1,7 +1,11 @@
1
- import { access, readFile } from "node:fs/promises";
2
- import path from "node:path";
1
+ import { readFile } from "node:fs/promises";
2
+
3
+ import { inspectRecipeEvidence } from "pi-agent-doctor/api/evidence";
4
+
5
+ import { isExecutableAvailable } from "pi-agent-doctor/api/executable";
3
6
 
4
7
  import { projectIdeConfigPath } from "#src/api/tool-config.js";
8
+ import type { DoctorToolSelection } from "#src/api/doctor.js";
5
9
  import type { ToolRecipe } from "#src/api/tool-catalog.js";
6
10
  import type { OwnedContribution } from "./core.js";
7
11
 
@@ -22,7 +26,10 @@ export async function discoverRecipeCandidates(
22
26
  recipes: readonly OwnedContribution<ToolRecipe>[],
23
27
  environment: NodeJS.ProcessEnv = process.env,
24
28
  ): Promise<readonly RecipeCandidate[]> {
25
- const dependencies = await packageDependencies(cwd);
29
+ const nativeEvidence = await inspectRecipeEvidence(
30
+ cwd,
31
+ recipes.map((entry) => entry.value),
32
+ );
26
33
  const managedRecipes = await managedRecipeIds(cwd);
27
34
  const candidates: RecipeCandidate[] = [];
28
35
 
@@ -35,7 +42,8 @@ export async function discoverRecipeCandidates(
35
42
 
36
43
  const evidence: string[] = [];
37
44
  let score = 1;
38
- const nativeConfig = await firstExisting(cwd, recipe.configFiles ?? []);
45
+ const native = nativeEvidence.get(recipe.id);
46
+ const nativeConfig = native?.config;
39
47
 
40
48
  if (nativeConfig !== undefined) {
41
49
  score += 6;
@@ -47,7 +55,7 @@ export async function discoverRecipeCandidates(
47
55
  evidence.push("Pi Agent IDE config");
48
56
  }
49
57
 
50
- const dependency = recipe.dependencies?.find((name) => dependencies.has(name));
58
+ const dependency = native?.dependency;
51
59
 
52
60
  if (dependency !== undefined) {
53
61
  score += 4;
@@ -81,17 +89,24 @@ Selects at most one recipe per language and tool kind.
81
89
  export function selectSuggestedRecipes(
82
90
  candidates: readonly RecipeCandidate[],
83
91
  detectedLanguageIds: ReadonlySet<string>,
92
+ selections: readonly DoctorToolSelection[] = [],
84
93
  ): readonly RecipeCandidate[] {
85
94
  const selected = new Map<string, RecipeCandidate>();
95
+ const activeBySlot = new Map(
96
+ selections.map((selection) => [`${selection.kind}:${selection.languageId}`, selection.toolId]),
97
+ );
86
98
 
87
99
  for (const language of detectedLanguageIds) {
88
100
  for (const kind of ["formatter", "linter", "lsp"] as const) {
101
+ const activeToolId = activeBySlot.get(`${kind}:${language}`);
102
+ const minimumScore = activeToolId === undefined ? 4 : 7;
89
103
  const matches = candidates.filter(
90
104
  (candidate) =>
91
105
  candidate.recipe.kind === kind &&
92
106
  candidate.recipe.languages.includes(language) &&
93
107
  candidate.executable !== undefined &&
94
- candidate.score >= 4,
108
+ candidate.recipe.id !== activeToolId &&
109
+ candidate.score >= minimumScore,
95
110
  );
96
111
  const best = matches[0];
97
112
 
@@ -103,54 +118,21 @@ export function selectSuggestedRecipes(
103
118
  continue;
104
119
  }
105
120
 
106
- selected.set(best.recipe.id, best);
121
+ selected.set(`${best.recipe.kind}:${best.recipe.id}`, best);
107
122
  }
108
123
  }
109
124
 
110
125
  return [...selected.values()];
111
126
  }
112
127
 
113
- async function firstExisting(cwd: string, names: readonly string[]): Promise<string | undefined> {
114
- for (const name of names) {
115
- try {
116
- await access(path.join(cwd, name));
117
- return name;
118
- } catch {
119
- // Try the next project marker.
120
- }
121
- }
122
-
123
- return undefined;
124
- }
125
-
126
128
  async function firstExecutable(
127
129
  cwd: string,
128
130
  names: readonly string[],
129
131
  environment: NodeJS.ProcessEnv,
130
132
  ): Promise<string | undefined> {
131
- const pathDirectories = (environment.PATH ?? "").split(path.delimiter).filter(Boolean);
132
- const directories = [path.join(cwd, "node_modules", ".bin"), ...pathDirectories];
133
-
134
133
  for (const name of names) {
135
- if (name.includes(path.sep)) {
136
- try {
137
- await access(path.resolve(cwd, name));
138
- return name;
139
- } catch {
140
- continue;
141
- }
142
- }
143
-
144
- for (const directory of directories) {
145
- try {
146
- await access(path.join(directory, name));
147
- return name;
148
- } catch {
149
- // Try the next executable location.
150
- }
151
- }
134
+ if (await isExecutableAvailable(name, cwd, environment)) return name;
152
135
  }
153
-
154
136
  return undefined;
155
137
  }
156
138
 
@@ -184,32 +166,3 @@ async function managedRecipeIds(cwd: string): Promise<ReadonlySet<string>> {
184
166
 
185
167
  return ids;
186
168
  }
187
-
188
- async function packageDependencies(cwd: string): Promise<ReadonlySet<string>> {
189
- try {
190
- const value = JSON.parse(await readFile(path.join(cwd, "package.json"), "utf8")) as Record<
191
- string,
192
- unknown
193
- >;
194
- const names = new Set<string>();
195
-
196
- for (const key of [
197
- "dependencies",
198
- "devDependencies",
199
- "peerDependencies",
200
- "optionalDependencies",
201
- ]) {
202
- const section = value[key];
203
-
204
- if (typeof section === "object" && section !== null && !Array.isArray(section)) {
205
- for (const name of Object.keys(section)) {
206
- names.add(name);
207
- }
208
- }
209
- }
210
-
211
- return names;
212
- } catch {
213
- return new Set();
214
- }
215
- }
@@ -8,7 +8,14 @@ import {
8
8
 
9
9
  import { writeSuggestedConfigs } from "./config-writer.js";
10
10
  import { DoctorCore } from "./core.js";
11
- import { buildDoctorAgentPrompt, doctorNeedsWork, formatDoctorReport, runDoctor } from "./run.js";
11
+ import {
12
+ buildDoctorAgentPrompt,
13
+ doctorNeedsWork,
14
+ formatDoctorReport,
15
+ inspectDoctorSetup,
16
+ runDoctor,
17
+ } from "./run.js";
18
+ import { registerDoctorTipProvider } from "./tip-provider.js";
12
19
 
13
20
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
14
21
 
@@ -17,6 +24,10 @@ Registers the modular doctor core and `/pi-agent-ide-doctor`.
17
24
  */
18
25
  export default async function registerDoctor(pi: ExtensionAPI): Promise<void> {
19
26
  const core = new DoctorCore();
27
+ registerDoctorTipProvider(pi, async (context) => {
28
+ await core.waitForPlugins();
29
+ return inspectDoctorSetup(core.snapshot(), context.cwd, process.env, context.signal);
30
+ });
20
31
  let delegatedProject: string | undefined;
21
32
  const unsubscribe = pi.events.on(DOCTOR_PLUGIN_REGISTER_EVENT, (request) => {
22
33
  if (!isDoctorPluginRegistrationRequest(request)) {
@@ -23,7 +23,11 @@ const skippedDirectories = new Set([
23
23
  /**
24
24
  Collects project files while respecting Git ignores when Git is available.
25
25
  */
26
- export async function collectProjectFiles(cwd: string): Promise<readonly string[]> {
26
+ export async function collectProjectFiles(
27
+ cwd: string,
28
+ signal?: AbortSignal,
29
+ ): Promise<readonly string[]> {
30
+ signal?.throwIfAborted();
27
31
  try {
28
32
  const result = await execFileAsync(
29
33
  "git",
@@ -32,15 +36,20 @@ export async function collectProjectFiles(cwd: string): Promise<readonly string[
32
36
  cwd,
33
37
  encoding: "utf8",
34
38
  maxBuffer: 16 * 1024 * 1024,
39
+
40
+ signal,
35
41
  },
36
42
  );
37
43
  const files = result.stdout
38
44
  .split("\0")
39
45
  .filter(Boolean)
40
- .map((file) => path.resolve(cwd, file));
41
- return files.length > 0 ? files : await walk(cwd);
46
+ .map((file) => path.resolve(cwd, file))
47
+ .filter((file) => !isManagedIdeConfig(file));
48
+ signal?.throwIfAborted();
49
+ return files.length > 0 ? files : await walk(cwd, signal);
42
50
  } catch {
43
- return walk(cwd);
51
+ signal?.throwIfAborted();
52
+ return walk(cwd, signal);
44
53
  }
45
54
  }
46
55
 
@@ -70,7 +79,8 @@ export function detectProjectLanguages(
70
79
  return detected;
71
80
  }
72
81
 
73
- async function walk(directory: string): Promise<string[]> {
82
+ async function walk(directory: string, signal?: AbortSignal): Promise<string[]> {
83
+ signal?.throwIfAborted();
74
84
  const files: string[] = [];
75
85
 
76
86
  for (const entry of await readdir(directory, { withFileTypes: true })) {
@@ -80,8 +90,12 @@ async function walk(directory: string): Promise<string[]> {
80
90
 
81
91
  const absolute = path.join(directory, entry.name);
82
92
 
93
+ if (isManagedIdeConfig(absolute)) {
94
+ continue;
95
+ }
96
+
83
97
  if (entry.isDirectory()) {
84
- files.push(...(await walk(absolute)));
98
+ files.push(...(await walk(absolute, signal)));
85
99
  } else if (entry.isFile()) {
86
100
  files.push(absolute);
87
101
  }
@@ -89,3 +103,7 @@ async function walk(directory: string): Promise<string[]> {
89
103
 
90
104
  return files;
91
105
  }
106
+
107
+ function isManagedIdeConfig(file: string): boolean {
108
+ return file.split(path.sep).join("/").includes("/.pi/pi-agent-ide/");
109
+ }
package/src/doctor/run.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import path from "node:path";
2
2
 
3
- import { runContributedChecks } from "./core.js";
3
+ import { runContributedChecks, runContributedSetupChecks } from "./core.js";
4
4
  import { discoverRecipeCandidates, selectSuggestedRecipes } from "./discovery.js";
5
5
  import { collectProjectFiles, detectProjectLanguages } from "./inventory.js";
6
6
 
7
- import type { DoctorFinding } from "#src/api/doctor.js";
7
+ import type { DoctorFinding, DoctorSetupAction, DoctorToolSelection } from "#src/api/doctor.js";
8
8
  import type { DoctorSnapshot } from "./core.js";
9
9
  import type { RecipeCandidate } from "./discovery.js";
10
10
 
@@ -14,55 +14,112 @@ export interface DoctorSection {
14
14
  readonly findings: readonly DoctorFinding[];
15
15
  }
16
16
 
17
- export interface DoctorRun {
17
+ export interface DoctorSetupRun {
18
18
  readonly cwd: string;
19
19
  readonly files: readonly string[];
20
20
  readonly detectedLanguages: ReadonlyMap<string, readonly string[]>;
21
21
  readonly candidates: readonly RecipeCandidate[];
22
22
  readonly suggestions: readonly RecipeCandidate[];
23
+ readonly selections: readonly (DoctorToolSelection & { readonly pluginId: string })[];
24
+ readonly actions: readonly (DoctorSetupAction & { readonly pluginId: string })[];
25
+ }
26
+
27
+ export interface DoctorRun extends DoctorSetupRun {
23
28
  readonly sections: readonly DoctorSection[];
24
29
  }
25
30
 
26
- /**
27
- Runs one deterministic doctor inspection from the current contribution snapshot.
28
- */
29
- export async function runDoctor(
31
+ /** Runs the lightweight setup inspection used by startup guidance. */
32
+ export async function inspectDoctorSetup(
30
33
  snapshot: DoctorSnapshot,
31
34
  cwd: string,
32
35
  environment: NodeJS.ProcessEnv = process.env,
33
- ): Promise<DoctorRun> {
34
- const files = await collectProjectFiles(cwd);
36
+ signal?: AbortSignal,
37
+ ): Promise<DoctorSetupRun> {
38
+ signal?.throwIfAborted();
39
+ const files = await collectProjectFiles(cwd, signal);
40
+ signal?.throwIfAborted();
35
41
  const detectedLanguages = detectProjectLanguages(
36
42
  files,
37
43
  snapshot.languages.map((entry) => entry.value),
38
44
  );
39
- const languageIds = new Set(detectedLanguages.keys());
40
- const context = { cwd, files, detectedLanguageIds: languageIds, env: environment };
41
- const [candidates, checks] = await Promise.all([
42
- discoverRecipeCandidates(cwd, languageIds, snapshot.recipes, environment),
43
- runContributedChecks(snapshot, context),
45
+ const detectedLanguageIds = new Set(detectedLanguages.keys());
46
+ const context = { cwd, files, detectedLanguageIds, detectedLanguages, env: environment };
47
+ const [candidates, setup] = await Promise.all([
48
+ discoverRecipeCandidates(cwd, detectedLanguageIds, snapshot.recipes, environment),
49
+ runContributedSetupChecks(snapshot, context),
44
50
  ]);
51
+
52
+ const missingActions = new Map<string, DoctorSetupAction & { readonly pluginId: string }>();
53
+ for (const language of detectedLanguageIds) {
54
+ for (const kind of ["formatter", "linter", "lsp"] as const) {
55
+ if (
56
+ setup.selections.some(
57
+ (selection) => selection.languageId === language && selection.kind === kind,
58
+ )
59
+ )
60
+ continue;
61
+ const relevant = candidates.filter(
62
+ (candidate) =>
63
+ candidate.recipe.kind === kind && candidate.recipe.languages.includes(language),
64
+ );
65
+ const nativeScore = (candidate: RecipeCandidate) =>
66
+ candidate.score - (candidate.executable === undefined ? 0 : 3);
67
+ const bestScore = Math.max(1, ...relevant.map(nativeScore));
68
+ for (const candidate of relevant) {
69
+ if (
70
+ candidate.executable !== undefined ||
71
+ nativeScore(candidate) !== bestScore ||
72
+ bestScore <= 1
73
+ )
74
+ continue;
75
+ const id = `${kind}-${candidate.recipe.id}-unavailable`;
76
+ missingActions.set(id, {
77
+ id,
78
+ pluginId: candidate.pluginId,
79
+ message: `Native project setup selects ${candidate.recipe.id}, but its executable is unavailable. Install ${candidate.recipe.executables.join(" or ")} and run Doctor again.`,
80
+ });
81
+ }
82
+ }
83
+ }
84
+ return {
85
+ cwd,
86
+ files,
87
+ detectedLanguages,
88
+ candidates,
89
+ selections: setup.selections,
90
+ actions: [...setup.actions, ...missingActions.values()],
91
+ suggestions: selectSuggestedRecipes(candidates, detectedLanguageIds, setup.selections),
92
+ };
93
+ }
94
+
95
+ /** Runs one deterministic full doctor inspection from the current contribution snapshot. */
96
+ export async function runDoctor(
97
+ snapshot: DoctorSnapshot,
98
+ cwd: string,
99
+ environment: NodeJS.ProcessEnv = process.env,
100
+ ): Promise<DoctorRun> {
101
+ const setup = await inspectDoctorSetup(snapshot, cwd, environment);
102
+ const detectedLanguageIds = new Set(setup.detectedLanguages.keys());
103
+ const context = {
104
+ cwd,
105
+ files: setup.files,
106
+ detectedLanguageIds,
107
+ detectedLanguages: setup.detectedLanguages,
108
+ env: environment,
109
+ };
110
+ const checks = await runContributedChecks(snapshot, context);
45
111
  const projectFindings: DoctorFinding[] = [
46
112
  { status: "pass", message: `Project: ${cwd}` },
47
- files.length > 0
48
- ? { status: "pass", message: `${files.length} project files inspected` }
113
+ setup.files.length > 0
114
+ ? { status: "pass", message: `${setup.files.length} project files inspected` }
49
115
  : { status: "warn", message: "No project files found" },
50
- languageIds.size > 0
51
- ? { status: "pass", message: `Detected: ${[...languageIds].join(", ")}` }
116
+ detectedLanguageIds.size > 0
117
+ ? { status: "pass", message: `Detected: ${[...detectedLanguageIds].join(", ")}` }
52
118
  : { status: "warn", message: "No registered project languages detected" },
53
119
  ];
54
- const toolFindings = toolCoverageFindings(detectedLanguages, candidates);
55
120
  return {
56
- cwd,
57
- files,
58
- detectedLanguages,
59
- candidates,
60
- suggestions: selectSuggestedRecipes(candidates, languageIds),
61
- sections: [
62
- { title: "Project", pluginId: "doctor", findings: projectFindings },
63
- { title: "Tool discovery", pluginId: "doctor", findings: toolFindings },
64
- ...checks,
65
- ],
121
+ ...setup,
122
+ sections: [{ title: "Project", pluginId: "doctor", findings: projectFindings }, ...checks],
66
123
  };
67
124
  }
68
125
 
@@ -86,6 +143,16 @@ export function formatDoctorReport(run: DoctorRun): string {
86
143
  lines.push("");
87
144
  }
88
145
 
146
+ if (run.actions.length > 0) {
147
+ lines.push("Setup needs attention");
148
+
149
+ for (const action of run.actions) {
150
+ lines.push(` ${action.message} [${action.pluginId}]`);
151
+ }
152
+
153
+ lines.push("");
154
+ }
155
+
89
156
  if (run.suggestions.length > 0) {
90
157
  lines.push("Suggested configuration");
91
158
 
@@ -106,8 +173,10 @@ export function formatDoctorReport(run: DoctorRun): string {
106
173
  Returns true when a report needs setup work.
107
174
  */
108
175
  export function doctorNeedsWork(run: DoctorRun): boolean {
109
- return run.sections.some((section) =>
110
- section.findings.some((finding) => finding.status === "fail" || finding.status === "warn"),
176
+ return (
177
+ run.actions.length > 0 ||
178
+ run.suggestions.length > 0 ||
179
+ run.sections.some((section) => section.findings.some((finding) => finding.status === "fail"))
111
180
  );
112
181
  }
113
182
 
@@ -138,59 +207,3 @@ export function buildDoctorAgentPrompt(run: DoctorRun): string {
138
207
  `Project root: ${path.resolve(run.cwd)}`,
139
208
  ].join("\n");
140
209
  }
141
-
142
- function toolCoverageFindings(
143
- detected: ReadonlyMap<string, readonly string[]>,
144
- candidates: readonly RecipeCandidate[],
145
- ): DoctorFinding[] {
146
- const findings: DoctorFinding[] = [];
147
-
148
- for (const [language, files] of detected) {
149
- for (const kind of ["formatter", "linter", "lsp"] as const) {
150
- const matches = candidates.filter(
151
- (candidate) =>
152
- candidate.recipe.kind === kind && candidate.recipe.languages.includes(language),
153
- );
154
- const topScore = matches[0]?.score;
155
- const tied =
156
- topScore === undefined ? [] : matches.filter((candidate) => candidate.score === topScore);
157
-
158
- if (tied.length > 1 && tied.some((candidate) => candidate.evidence.length > 0)) {
159
- findings.push({
160
- status: "warn",
161
- message: `${language} ${kind}: choose between ${tied.map((item) => item.recipe.name).join(", ")}`,
162
- });
163
- continue;
164
- }
165
-
166
- const readyConfigured = matches.find(
167
- (candidate) =>
168
- candidate.evidence.includes("Pi Agent IDE config") ||
169
- (candidate.executable !== undefined &&
170
- candidate.evidence.some((item) => item.startsWith("project config:"))),
171
- );
172
-
173
- if (readyConfigured !== undefined) {
174
- findings.push({
175
- status: "pass",
176
- message: `${language} ${kind}: ${readyConfigured.recipe.name}`,
177
- });
178
- } else if (matches.length > 0) {
179
- findings.push({
180
- status: "warn",
181
- message: `${language} ${kind}: ${matches
182
- .map((item) => item.recipe.name)
183
- .join(", ")} available in catalog`,
184
- detail: `${files.length} matching files`,
185
- });
186
- } else {
187
- findings.push({
188
- status: "skip",
189
- message: `${language} ${kind}: no loaded plugin contribution`,
190
- });
191
- }
192
- }
193
- }
194
-
195
- return findings;
196
- }
@@ -0,0 +1,92 @@
1
+ import { createHash } from "node:crypto";
2
+
3
+ import {
4
+ connectTipProvider,
5
+ TIP_API_VERSION,
6
+ TIP_PROTOCOL,
7
+ type TipContext,
8
+ type TipProvider,
9
+ } from "#src/api/tips.js";
10
+
11
+ import type { DoctorSetupRun } from "./run.js";
12
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
13
+
14
+ const DOCTOR_TIP_PROVIDER_ID = "doctor";
15
+ const MAX_VISIBLE_ITEMS = 3;
16
+
17
+ /** Registers actionable doctor startup guidance with the built-in tip core. */
18
+ export function registerDoctorTipProvider(
19
+ pi: ExtensionAPI,
20
+ inspect: (context: TipContext) => Promise<DoctorSetupRun>,
21
+ ): void {
22
+ const registration = connectTipProvider(pi, createDoctorTipProvider(inspect));
23
+ if (registration !== undefined) {
24
+ void registration.catch(() => {});
25
+ }
26
+ }
27
+
28
+ /** Creates a provider whose identity follows the current actionable setup state. */
29
+ export function createDoctorTipProvider(
30
+ inspect: (context: TipContext) => Promise<DoctorSetupRun>,
31
+ ): TipProvider {
32
+ return {
33
+ protocol: TIP_PROTOCOL,
34
+ apiVersion: TIP_API_VERSION,
35
+ id: DOCTOR_TIP_PROVIDER_ID,
36
+ async getTip(context) {
37
+ const result = await inspect(context);
38
+ const items = setupItems(result);
39
+ if (items.length === 0) {
40
+ return undefined;
41
+ }
42
+
43
+ const visible = items.slice(0, MAX_VISIBLE_ITEMS).map((item) => `• ${item.message}`);
44
+ if (items.length > MAX_VISIBLE_ITEMS) {
45
+ visible.push(`• ${items.length - MAX_VISIBLE_ITEMS} more`);
46
+ }
47
+
48
+ return {
49
+ id: `doctor-setup-${fingerprint(items)}`,
50
+ title:
51
+ items.length === 1
52
+ ? "Project setup needs attention"
53
+ : `${items.length} project setup items`,
54
+ body: [...visible, "Run /pi-agent-ide-doctor"].join("\n"),
55
+ };
56
+ },
57
+ };
58
+ }
59
+
60
+ interface SetupItem {
61
+ readonly id: string;
62
+ readonly message: string;
63
+ }
64
+
65
+ function setupItems(result: DoctorSetupRun): readonly SetupItem[] {
66
+ const actions = result.actions.map((action) => ({
67
+ id: `action:${action.pluginId}:${action.id}`,
68
+ message: action.message,
69
+ }));
70
+ const suggestions = result.suggestions.map((suggestion) => {
71
+ const languages = suggestion.recipe.languages
72
+ .filter((language) => result.detectedLanguages.has(language))
73
+ .join(", ");
74
+ const capability = {
75
+ formatter: "formatting",
76
+ linter: "linting",
77
+ lsp: "language support",
78
+ }[suggestion.recipe.kind];
79
+ return {
80
+ id: `suggestion:${suggestion.pluginId}:${suggestion.recipe.kind}:${suggestion.recipe.id}`,
81
+ message: `Use ${suggestion.recipe.name} for ${languages} ${capability}`,
82
+ };
83
+ });
84
+ return [...actions, ...suggestions].sort((left, right) => left.id.localeCompare(right.id));
85
+ }
86
+
87
+ function fingerprint(items: readonly SetupItem[]): string {
88
+ return createHash("sha256")
89
+ .update(items.map((item) => `${item.id}\0${item.message}`).join("\0"))
90
+ .digest("hex")
91
+ .slice(0, 12);
92
+ }