pi-agent-ide 0.2.0 → 0.2.2

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 (494) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/{chunk-XNXQYPVT.js → chunk-4LUW26BX.js} +1 -1
  3. package/dist/{chunk-2ZMYT6ZC.js → chunk-4U6KGABH.js} +1 -1
  4. package/dist/chunk-4ZTEPMJO.js +14 -0
  5. package/dist/{chunk-KNMWCDDK.js → chunk-6ACQQBUY.js} +1 -1
  6. package/dist/chunk-76WHES5H.js +7 -0
  7. package/dist/chunk-BHSO2MDK.js +6 -0
  8. package/dist/chunk-BMOJTJJJ.js +3 -0
  9. package/dist/chunk-GFWDXTOB.js +4 -0
  10. package/dist/{chunk-VSP2QQPQ.js → chunk-GIRAEVUJ.js} +1 -1
  11. package/dist/chunk-JJVXUL5U.js +2 -0
  12. package/dist/chunk-KCEOTU5Z.js +3 -0
  13. package/dist/chunk-KVGQG43U.js +1 -0
  14. package/dist/{chunk-MTTKFJV6.js → chunk-LQYZG62K.js} +1 -1
  15. package/dist/chunk-N34ATN52.js +1 -0
  16. package/dist/{chunk-PETQCA7G.js → chunk-P6T3Q7LB.js} +1 -1
  17. package/dist/chunk-QIJMV2P2.js +2 -0
  18. package/dist/chunk-QJFRAMK7.js +2 -0
  19. package/dist/{chunk-2SKAED2I.js → chunk-RAZOACDD.js} +2 -2
  20. package/dist/chunk-RIGRP3FD.js +1 -0
  21. package/dist/chunk-S3ZPXWX7.js +2 -0
  22. package/dist/{chunk-266RH77Z.js → chunk-THSCUT2L.js} +1 -1
  23. package/dist/{chunk-EEH4WYI7.js → chunk-WNMGUALD.js} +1 -1
  24. package/dist/chunk-WZI4YC2O.js +1 -0
  25. package/dist/{chunk-5A25RATC.js → chunk-X6MPU7UO.js} +3 -3
  26. package/dist/{chunk-QNZVPFSP.js → chunk-XF5PVZOS.js} +1 -1
  27. package/dist/{chunk-SJYDLHEF.js → chunk-ZXN3TWWW.js} +1 -1
  28. package/dist/entry-0.js +1 -1
  29. package/dist/entry-10.js +1 -1
  30. package/dist/entry-11.js +1 -1
  31. package/dist/entry-13.js +1 -1
  32. package/dist/entry-14.js +1 -1
  33. package/dist/entry-18.js +1 -1
  34. package/dist/entry-19.js +1 -1
  35. package/dist/entry-20.js +1 -1
  36. package/dist/entry-21.js +2 -1
  37. package/dist/entry-22.js +1 -1
  38. package/dist/entry-23.js +1 -1
  39. package/dist/entry-24.js +1 -1
  40. package/dist/entry-25.js +1 -1
  41. package/dist/entry-26.js +7 -1
  42. package/dist/entry-27.js +1 -1
  43. package/dist/entry-28.js +1 -1
  44. package/dist/entry-29.js +1 -1
  45. package/dist/entry-30.js +1 -1
  46. package/dist/entry-31.js +4 -1
  47. package/dist/entry-32.js +8 -1
  48. package/dist/entry-33.js +1 -1
  49. package/dist/entry-34.js +1 -1
  50. package/dist/entry-35.js +1 -1
  51. package/dist/entry-36.js +1 -1
  52. package/dist/entry-37.js +1 -1
  53. package/dist/entry-38.js +1 -1
  54. package/dist/entry-39.js +1 -1
  55. package/dist/entry-4.js +1 -1
  56. package/dist/entry-40.js +14 -1
  57. package/dist/entry-41.js +1 -1
  58. package/dist/entry-42.js +1 -1
  59. package/dist/entry-43.js +1 -1
  60. package/dist/entry-44.js +1 -1
  61. package/dist/entry-45.js +7 -1
  62. package/dist/entry-46.js +11 -1
  63. package/dist/entry-47.js +1 -1
  64. package/dist/entry-48.js +1 -1
  65. package/dist/entry-49.js +1 -1
  66. package/dist/entry-50.js +1 -1
  67. package/dist/entry-51.js +1 -1
  68. package/dist/entry-52.js +1 -1
  69. package/dist/entry-53.js +1 -0
  70. package/dist/entry-54.js +0 -1
  71. package/dist/entry-55.js +1 -0
  72. package/dist/entry-56.js +0 -1
  73. package/dist/entry-57.js +1 -1
  74. package/dist/entry-58.js +1 -1
  75. package/dist/entry-59.js +1 -1
  76. package/dist/entry-60.js +1 -1
  77. package/dist/entry-61.js +1 -1
  78. package/dist/entry-62.js +1 -0
  79. package/dist/entry-63.js +0 -1
  80. package/dist/entry-64.js +1 -0
  81. package/dist/entry-65.js +0 -1
  82. package/dist/entry-66.js +1 -1
  83. package/dist/entry-67.js +1 -1
  84. package/dist/entry-68.js +1 -1
  85. package/dist/entry-69.js +59 -1
  86. package/dist/entry-70.js +4 -1
  87. package/dist/entry-71.js +1 -1
  88. package/dist/entry-72.js +29 -1
  89. package/dist/entry-73.js +2 -1
  90. package/dist/entry-74.js +1 -1
  91. package/dist/entry-75.js +1 -1
  92. package/dist/entry-76.js +1 -1
  93. package/dist/entry-77.js +3 -1
  94. package/dist/entry-78.js +1 -1
  95. package/dist/entry-79.js +1 -1
  96. package/dist/entry-80.js +1 -0
  97. package/dist/pi-agent-ide.js +2 -13
  98. package/docs/configuration.md +57 -1
  99. package/docs/extensions.md +4 -2
  100. package/docs/generated/tool-catalog/cmake.md +5 -5
  101. package/docs/generated/tool-catalog/csharp.md +5 -5
  102. package/docs/generated/tool-catalog/css.md +7 -7
  103. package/docs/generated/tool-catalog/dart.md +9 -0
  104. package/docs/generated/tool-catalog/dockerfile.md +5 -5
  105. package/docs/generated/tool-catalog/elixir.md +9 -0
  106. package/docs/generated/tool-catalog/html.md +7 -6
  107. package/docs/generated/tool-catalog/index.md +9 -0
  108. package/docs/generated/tool-catalog/javascript.md +8 -8
  109. package/docs/generated/tool-catalog/json.md +7 -7
  110. package/docs/generated/tool-catalog/julia.md +8 -0
  111. package/docs/generated/tool-catalog/kotlin.md +6 -5
  112. package/docs/generated/tool-catalog/markdown.md +6 -6
  113. package/docs/generated/tool-catalog/powershell.md +9 -0
  114. package/docs/generated/tool-catalog/python.md +6 -6
  115. package/docs/generated/tool-catalog/r.md +9 -0
  116. package/docs/generated/tool-catalog/scala.md +9 -0
  117. package/docs/generated/tool-catalog/svelte.md +9 -0
  118. package/docs/generated/tool-catalog/typescript.md +9 -8
  119. package/docs/generated/tool-catalog/vue.md +9 -0
  120. package/docs/generated/tool-catalog/yaml.md +6 -6
  121. package/docs/generated/tool-catalog/zig.md +9 -0
  122. package/docs/tools.md +1 -1
  123. package/node_modules/pi-agent-doctor/package.json +10 -3
  124. package/node_modules/pi-agent-doctor/runtime/entry-20.js +1 -0
  125. package/node_modules/pi-agent-doctor/src/catalog.ts +27 -1
  126. package/node_modules/pi-agent-doctor/src/evidence.ts +118 -0
  127. package/node_modules/pi-agent-doctor/src/executable.ts +63 -17
  128. package/node_modules/pi-agent-filesystem/index.ts +2 -2
  129. package/node_modules/pi-agent-filesystem/package.json +7 -7
  130. package/node_modules/pi-agent-filesystem-image/package.json +4 -4
  131. package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
  132. package/node_modules/pi-agent-filesystem-text/package.json +4 -4
  133. package/node_modules/pi-agent-filesystem-text/runtime/entry-24.js +2 -0
  134. package/node_modules/pi-agent-ide-ast/package.json +11 -11
  135. package/node_modules/pi-agent-ide-ast/runtime/entry-25.js +0 -1
  136. package/node_modules/pi-agent-ide-ast/runtime/entry-26.js +2 -0
  137. package/node_modules/pi-agent-ide-ast/src/ast/manager.ts +3 -0
  138. package/node_modules/pi-agent-ide-ast/src/ast/outline.ts +92 -19
  139. package/node_modules/pi-agent-ide-ast/src/extension.ts +9 -14
  140. package/node_modules/pi-agent-ide-ast/src/overflow-handler.ts +60 -0
  141. package/node_modules/pi-agent-ide-ast/src/scope-resolver.ts +1 -1
  142. package/node_modules/pi-agent-ide-changes/index.ts +1 -5
  143. package/node_modules/pi-agent-ide-changes/package.json +8 -8
  144. package/node_modules/pi-agent-ide-changes/runtime/entry-27.js +0 -1
  145. package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +1 -7
  146. package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +1 -5
  147. package/node_modules/pi-agent-ide-formatter/package.json +4 -4
  148. package/node_modules/pi-agent-ide-formatter/src/catalog.ts +131 -13
  149. package/node_modules/pi-agent-ide-formatter/src/formatter.ts +12 -7
  150. package/node_modules/pi-agent-ide-formatter/src/registry.ts +20 -8
  151. package/node_modules/pi-agent-ide-languages/package.json +3 -3
  152. package/node_modules/pi-agent-ide-languages/src/languages.ts +15 -0
  153. package/node_modules/pi-agent-ide-lint/index.ts +4 -1
  154. package/node_modules/pi-agent-ide-lint/package.json +8 -8
  155. package/node_modules/pi-agent-ide-lint/src/catalog.ts +196 -39
  156. package/node_modules/pi-agent-ide-lint/src/command-linter.ts +23 -3
  157. package/node_modules/pi-agent-ide-lint/src/diagnostics.ts +73 -33
  158. package/node_modules/pi-agent-ide-lint/src/registry.ts +20 -8
  159. package/node_modules/pi-agent-ide-lsp/index.ts +1 -12
  160. package/node_modules/pi-agent-ide-lsp/package.json +9 -9
  161. package/node_modules/pi-agent-ide-lsp/runtime/entry-32.js +2 -0
  162. package/node_modules/pi-agent-ide-lsp/src/catalog.ts +161 -7
  163. package/node_modules/pi-agent-ide-lsp/src/diagnostic-source.ts +10 -10
  164. package/node_modules/pi-agent-ide-lsp/src/doctor-plugin.ts +2 -4
  165. package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +162 -12
  166. package/node_modules/pi-agent-ide-lsp/src/lsp/file-watchers.ts +88 -0
  167. package/node_modules/pi-agent-ide-lsp/src/lsp/initialization-options.ts +14 -0
  168. package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +8 -4
  169. package/node_modules/pi-agent-ide-lsp/src/lsp/registry.ts +69 -34
  170. package/node_modules/pi-agent-ide-lsp/src/lsp/transport-writer.ts +24 -0
  171. package/node_modules/pi-agent-ide-lsp/src/lsp/types.ts +5 -0
  172. package/node_modules/pi-agent-image/package.json +3 -3
  173. package/node_modules/pi-agent-image/src/image-converter.ts +1 -1
  174. package/node_modules/pi-agent-invariant/package.json +2 -2
  175. package/node_modules/pi-agent-pdf/package.json +3 -3
  176. package/node_modules/pi-agent-pdf/src/pdf-converter.ts +1 -1
  177. package/node_modules/pi-agent-read/package.json +11 -11
  178. package/node_modules/pi-agent-read/runtime/entry-39.js +0 -1
  179. package/node_modules/pi-agent-read/runtime/entry-40.js +2 -0
  180. package/node_modules/pi-agent-read/src/api/rendering.ts +3 -0
  181. package/node_modules/pi-agent-read/src/core/read-core.ts +6 -26
  182. package/node_modules/pi-agent-read/src/core/tools/read/native-resource-renderer.ts +74 -0
  183. package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +28 -7
  184. package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +35 -30
  185. package/node_modules/pi-agent-resource/package.json +2 -2
  186. package/node_modules/pi-agent-resource/src/content-conversion/content-description.ts +1 -8
  187. package/node_modules/pi-agent-search/package.json +7 -7
  188. package/node_modules/pi-agent-search/runtime/entry-44.js +0 -1
  189. package/node_modules/pi-agent-search/src/core/extension.ts +7 -5
  190. package/node_modules/pi-agent-search/src/core/search-core.ts +10 -0
  191. package/node_modules/pi-agent-search-text/index.ts +42 -33
  192. package/node_modules/pi-agent-search-text/package.json +9 -9
  193. package/node_modules/pi-agent-search-text/runtime/entry-46.js +1 -0
  194. package/node_modules/pi-agent-search-text/src/file-search.ts +9 -1
  195. package/node_modules/pi-agent-search-text/src/resolvers.ts +1 -1
  196. package/node_modules/pi-agent-search-text/src/search-recipe.ts +2 -0
  197. package/node_modules/pi-agent-search-text/src/search-session.ts +48 -0
  198. package/node_modules/pi-agent-text/package.json +3 -3
  199. package/node_modules/pi-agent-text/runtime/entry-48.js +1 -0
  200. package/node_modules/pi-agent-text/src/text-converter.ts +1 -1
  201. package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
  202. package/node_modules/pi-agent-text-anchor-constant/runtime/entry-49.js +2 -0
  203. package/node_modules/pi-agent-text-anchor-exact/package.json +5 -5
  204. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-50.js +0 -1
  205. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-51.js +2 -0
  206. package/node_modules/pi-agent-text-anchor-line-hash/index.ts +2 -6
  207. package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
  208. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-52.js +0 -1
  209. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-53.js +2 -0
  210. package/node_modules/pi-agent-text-editor/package.json +22 -22
  211. package/node_modules/pi-agent-text-editor/runtime/entry-68.js +0 -1
  212. package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +3 -0
  213. package/node_modules/pi-agent-text-editor/src/api/post-edit.ts +71 -1
  214. package/node_modules/pi-agent-text-editor/src/core/builtin-edit-filter.ts +4 -12
  215. package/node_modules/pi-agent-text-editor/src/core/extension.ts +7 -9
  216. package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +27 -2
  217. package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +38 -0
  218. package/node_modules/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +2 -0
  219. package/node_modules/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +81 -0
  220. package/node_modules/pi-agent-text-editor/src/core/text-anchor-registry.ts +5 -2
  221. package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +23 -0
  222. package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +5 -9
  223. package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +54 -14
  224. package/node_modules/pi-agent-text-editor/src/tools/text-selection.ts +45 -43
  225. package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +18 -8
  226. package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +7 -4
  227. package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +13 -5
  228. package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +18 -8
  229. package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +9 -5
  230. package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +2 -1
  231. package/node_modules/pi-agent-text-editor-argument-order/package.json +3 -3
  232. package/node_modules/pi-agent-text-editor-overwrite/package.json +4 -4
  233. package/node_modules/pi-agent-text-editor-renderer/index.ts +5 -1
  234. package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
  235. package/node_modules/pi-agent-text-editor-renderer/src/diff-model.ts +7 -0
  236. package/node_modules/pi-agent-text-editor-renderer/src/diff-renderer.ts +1 -1
  237. package/node_modules/pi-agent-text-editor-renderer/src/diff-viewport.ts +11 -2
  238. package/node_modules/pi-agent-text-editor-renderer/src/frozen-viewport.ts +140 -52
  239. package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +52 -4
  240. package/node_modules/pi-agent-text-editor-renderer/src/mutation-result.ts +53 -1
  241. package/node_modules/pi-agent-text-editor-renderer/src/persisted-result.ts +8 -2
  242. package/node_modules/pi-agent-text-editor-renderer/src/render-resource.ts +10 -0
  243. package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +5 -3
  244. package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
  245. package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +2 -0
  246. package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
  247. package/node_modules/pi-agent-tool-call-interception/src/index.ts +3 -0
  248. package/node_modules/pi-agent-tool-ui/package.json +2 -2
  249. package/node_modules/pi-agent-tool-ui/runtime/entry-75.js +1 -0
  250. package/node_modules/pi-agent-web/index.ts +1 -6
  251. package/node_modules/pi-agent-web/package.json +7 -7
  252. package/node_modules/pi-agent-web-html/package.json +3 -3
  253. package/node_modules/pi-agent-web-html/src/html-converter.ts +1 -1
  254. package/node_modules/pi-agent-web-image/package.json +4 -4
  255. package/node_modules/pi-agent-web-pdf/package.json +4 -4
  256. package/node_modules/pi-agent-web-text/package.json +4 -4
  257. package/node_modules/pi-agent-web-text/runtime/entry-80.js +2 -0
  258. package/package.json +35 -35
  259. package/src/api/plugin-protocol.ts +2 -0
  260. package/src/api/text-editor.ts +7 -0
  261. package/src/api/tool-config/formatters.json +70 -12
  262. package/src/api/tool-config/linters.json +148 -66
  263. package/src/api/tool-config/lsp-servers.json +142 -7
  264. package/src/api/tool-config.ts +60 -24
  265. package/src/code-view/diagnostic-view.ts +14 -10
  266. package/src/composite/builtin-extensions.ts +148 -66
  267. package/src/composite/extensions-config.ts +18 -0
  268. package/src/core/diagnostic-entry.ts +94 -0
  269. package/src/core/diagnostic-store.ts +43 -21
  270. package/src/core/extension.ts +39 -17
  271. package/src/doctor/config-writer.ts +14 -1
  272. package/src/doctor/discovery.ts +13 -68
  273. package/src/doctor/run.ts +33 -1
  274. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +2 -2
  275. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
  276. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
  277. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
  278. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
  279. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-24.js +2 -0
  280. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-21.js +2 -0
  281. package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +1 -6
  282. package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +7 -7
  283. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -3
  284. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/src/html-converter.ts +1 -1
  285. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
  286. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
  287. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
  288. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-80.js +2 -0
  289. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-76.js +2 -0
  290. package/src/extensions/pi-agent-read/package.json +11 -11
  291. package/src/extensions/pi-agent-read/runtime/entry-39.js +0 -1
  292. package/src/extensions/pi-agent-read/runtime/entry-40.js +2 -0
  293. package/src/extensions/pi-agent-read/src/api/rendering.ts +3 -0
  294. package/src/extensions/pi-agent-read/src/core/read-core.ts +6 -26
  295. package/src/extensions/pi-agent-read/src/core/tools/read/native-resource-renderer.ts +74 -0
  296. package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +28 -7
  297. package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +35 -30
  298. package/src/extensions/pi-agent-search/package.json +7 -7
  299. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +42 -33
  300. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +9 -9
  301. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-46.js +1 -0
  302. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-47.js +1 -0
  303. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/file-search.ts +9 -1
  304. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +1 -1
  305. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +2 -0
  306. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +48 -0
  307. package/src/extensions/pi-agent-search/runtime/entry-44.js +0 -1
  308. package/src/extensions/pi-agent-search/runtime/entry-45.js +2 -0
  309. package/src/extensions/pi-agent-search/src/core/extension.ts +7 -5
  310. package/src/extensions/pi-agent-search/src/core/search-core.ts +10 -0
  311. package/src/extensions/pi-agent-text-editor/package.json +22 -22
  312. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
  313. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-49.js +2 -0
  314. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -5
  315. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-50.js +0 -1
  316. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-51.js +2 -0
  317. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +2 -6
  318. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
  319. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-52.js +0 -1
  320. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-53.js +2 -0
  321. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/package.json +3 -3
  322. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/package.json +4 -4
  323. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +5 -1
  324. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
  325. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-model.ts +7 -0
  326. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-renderer.ts +1 -1
  327. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-viewport.ts +11 -2
  328. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/frozen-viewport.ts +140 -52
  329. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +52 -4
  330. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-result.ts +53 -1
  331. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/persisted-result.ts +8 -2
  332. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/render-resource.ts +10 -0
  333. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +5 -3
  334. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -5
  335. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +2 -0
  336. package/src/extensions/pi-agent-text-editor/runtime/entry-68.js +0 -1
  337. package/src/extensions/pi-agent-text-editor/runtime/entry-69.js +2 -0
  338. package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +3 -0
  339. package/src/extensions/pi-agent-text-editor/src/api/post-edit.ts +71 -1
  340. package/src/extensions/pi-agent-text-editor/src/core/builtin-edit-filter.ts +4 -12
  341. package/src/extensions/pi-agent-text-editor/src/core/extension.ts +7 -9
  342. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +27 -2
  343. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +38 -0
  344. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +2 -0
  345. package/src/extensions/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +81 -0
  346. package/src/extensions/pi-agent-text-editor/src/core/text-anchor-registry.ts +5 -2
  347. package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +23 -0
  348. package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +5 -9
  349. package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +54 -14
  350. package/src/extensions/pi-agent-text-editor/src/tools/text-selection.ts +45 -43
  351. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +18 -8
  352. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +7 -4
  353. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +13 -5
  354. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +18 -8
  355. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +9 -5
  356. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +2 -1
  357. package/src/pi-agent-ide.ts +11 -0
  358. package/src/plugins/pi-agent-ide-ast/package.json +11 -11
  359. package/src/plugins/pi-agent-ide-ast/runtime/entry-25.js +0 -1
  360. package/src/plugins/pi-agent-ide-ast/runtime/entry-26.js +2 -0
  361. package/src/plugins/pi-agent-ide-ast/src/ast/manager.ts +3 -0
  362. package/src/plugins/pi-agent-ide-ast/src/ast/outline.ts +92 -19
  363. package/src/plugins/pi-agent-ide-ast/src/extension.ts +9 -14
  364. package/src/plugins/pi-agent-ide-ast/src/overflow-handler.ts +60 -0
  365. package/src/plugins/pi-agent-ide-ast/src/scope-resolver.ts +1 -1
  366. package/src/plugins/pi-agent-ide-changes/index.ts +1 -5
  367. package/src/plugins/pi-agent-ide-changes/package.json +8 -8
  368. package/src/plugins/pi-agent-ide-changes/runtime/entry-27.js +0 -1
  369. package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +1 -7
  370. package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +1 -5
  371. package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +1 -8
  372. package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
  373. package/src/plugins/pi-agent-ide-formatter/src/catalog.ts +131 -13
  374. package/src/plugins/pi-agent-ide-formatter/src/formatter.ts +12 -7
  375. package/src/plugins/pi-agent-ide-formatter/src/registry.ts +20 -8
  376. package/src/plugins/pi-agent-ide-languages/package.json +3 -3
  377. package/src/plugins/pi-agent-ide-languages/src/languages.ts +15 -0
  378. package/src/plugins/pi-agent-ide-lint/index.ts +4 -1
  379. package/src/plugins/pi-agent-ide-lint/package.json +8 -8
  380. package/src/plugins/pi-agent-ide-lint/src/catalog.ts +196 -39
  381. package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +23 -3
  382. package/src/plugins/pi-agent-ide-lint/src/diagnostics.ts +73 -33
  383. package/src/plugins/pi-agent-ide-lint/src/registry.ts +20 -8
  384. package/src/plugins/pi-agent-ide-lsp/index.ts +1 -12
  385. package/src/plugins/pi-agent-ide-lsp/package.json +9 -9
  386. package/src/plugins/pi-agent-ide-lsp/runtime/entry-32.js +2 -0
  387. package/src/plugins/pi-agent-ide-lsp/src/catalog.ts +161 -7
  388. package/src/plugins/pi-agent-ide-lsp/src/diagnostic-source.ts +10 -10
  389. package/src/plugins/pi-agent-ide-lsp/src/doctor-plugin.ts +2 -4
  390. package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +162 -12
  391. package/src/plugins/pi-agent-ide-lsp/src/lsp/file-watchers.ts +88 -0
  392. package/src/plugins/pi-agent-ide-lsp/src/lsp/initialization-options.ts +14 -0
  393. package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +8 -4
  394. package/src/plugins/pi-agent-ide-lsp/src/lsp/registry.ts +69 -34
  395. package/src/plugins/pi-agent-ide-lsp/src/lsp/transport-writer.ts +24 -0
  396. package/src/plugins/pi-agent-ide-lsp/src/lsp/types.ts +5 -0
  397. package/src/post-edit/gate.ts +44 -15
  398. package/src/toolchain/types.ts +4 -0
  399. package/dist/chunk-34ZQTTU2.js +0 -2
  400. package/dist/chunk-476MR2QB.js +0 -1
  401. package/dist/chunk-4KQOODGE.js +0 -13
  402. package/dist/chunk-4SQQKEVD.js +0 -16
  403. package/dist/chunk-52BM6J6I.js +0 -6
  404. package/dist/chunk-5BWUVAR4.js +0 -1
  405. package/dist/chunk-6DN7NO7L.js +0 -1
  406. package/dist/chunk-6SMFVLTY.js +0 -1
  407. package/dist/chunk-7NDBZ4WX.js +0 -1
  408. package/dist/chunk-AP7Z3VWC.js +0 -1
  409. package/dist/chunk-BYWAG6X3.js +0 -6
  410. package/dist/chunk-E4SECPF4.js +0 -1
  411. package/dist/chunk-EW2KVKCN.js +0 -2
  412. package/dist/chunk-F6SESI3P.js +0 -4
  413. package/dist/chunk-GTK5AREE.js +0 -2
  414. package/dist/chunk-HOBTFFQR.js +0 -1
  415. package/dist/chunk-IMVCVPMP.js +0 -3
  416. package/dist/chunk-IOCABSRL.js +0 -1
  417. package/dist/chunk-KP37XTDI.js +0 -1
  418. package/dist/chunk-KYVOMBO5.js +0 -1
  419. package/dist/chunk-LFV6G5Z3.js +0 -1
  420. package/dist/chunk-MB6VVVAF.js +0 -2
  421. package/dist/chunk-NI2NK4JU.js +0 -1
  422. package/dist/chunk-OIL6BB2S.js +0 -33
  423. package/dist/chunk-PODWLGNO.js +0 -6
  424. package/dist/chunk-QW5O42QJ.js +0 -2
  425. package/dist/chunk-SSZB66C3.js +0 -3
  426. package/dist/chunk-TG6H6EOI.js +0 -1
  427. package/dist/chunk-TNWYEXFG.js +0 -1
  428. package/dist/chunk-U4D6FT66.js +0 -1
  429. package/dist/chunk-VUNCBASK.js +0 -10
  430. package/dist/chunk-VWVLBOMU.js +0 -8
  431. package/dist/chunk-W3XYKJ5H.js +0 -1
  432. package/dist/chunk-XGUAL3CA.js +0 -1
  433. package/dist/chunk-YQTLJ5ZV.js +0 -58
  434. package/node_modules/pi-agent-filesystem/runtime/entry-20.js +0 -2
  435. package/node_modules/pi-agent-ide-ast/runtime/entry-24.js +0 -1
  436. package/node_modules/pi-agent-ide-changes/runtime/entry-26.js +0 -1
  437. package/node_modules/pi-agent-image/runtime/entry-32.js +0 -1
  438. package/node_modules/pi-agent-read/src/core/tools/read/views.ts +0 -29
  439. package/node_modules/pi-agent-resource/runtime/entry-40.js +0 -1
  440. package/node_modules/pi-agent-text-anchor-constant/runtime/entry-48.js +0 -2
  441. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-49.js +0 -1
  442. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-51.js +0 -1
  443. package/node_modules/pi-agent-text-editor/runtime/entry-53.js +0 -1
  444. package/node_modules/pi-agent-tool-call-interception/runtime/entry-73.js +0 -1
  445. package/node_modules/pi-agent-web/runtime/entry-75.js +0 -2
  446. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-21.js +0 -2
  447. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-20.js +0 -2
  448. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-76.js +0 -2
  449. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-75.js +0 -2
  450. package/src/extensions/pi-agent-read/runtime/entry-35.js +0 -1
  451. package/src/extensions/pi-agent-read/src/core/tools/read/views.ts +0 -29
  452. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-45.js +0 -2
  453. package/src/extensions/pi-agent-search/runtime/entry-41.js +0 -1
  454. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-48.js +0 -2
  455. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-49.js +0 -1
  456. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-51.js +0 -1
  457. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/runtime/entry-69.js +0 -2
  458. package/src/extensions/pi-agent-text-editor/runtime/entry-53.js +0 -1
  459. package/src/plugins/pi-agent-ide-ast/runtime/entry-24.js +0 -1
  460. package/src/plugins/pi-agent-ide-changes/runtime/entry-26.js +0 -1
  461. /package/node_modules/{pi-agent-filesystem-image → pi-agent-filesystem}/runtime/entry-21.js +0 -0
  462. /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-22.js +0 -0
  463. /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-23.js +0 -0
  464. /package/node_modules/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-28.js +0 -0
  465. /package/node_modules/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-29.js +0 -0
  466. /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-30.js +0 -0
  467. /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-31.js +0 -0
  468. /package/node_modules/{pi-agent-invariant → pi-agent-image}/runtime/entry-33.js +0 -0
  469. /package/node_modules/{pi-agent-pdf → pi-agent-invariant}/runtime/entry-34.js +0 -0
  470. /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-35.js +0 -0
  471. /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-41.js +0 -0
  472. /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-45.js +0 -0
  473. /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-47.js +0 -0
  474. /package/node_modules/{pi-agent-text-editor-argument-order → pi-agent-text-editor}/runtime/entry-69.js +0 -0
  475. /package/node_modules/{pi-agent-text-editor-overwrite → pi-agent-text-editor-argument-order}/runtime/entry-70.js +0 -0
  476. /package/node_modules/{pi-agent-text-editor-renderer → pi-agent-text-editor-overwrite}/runtime/entry-71.js +0 -0
  477. /package/node_modules/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-72.js +0 -0
  478. /package/node_modules/{pi-agent-tool-ui → pi-agent-tool-call-interception}/runtime/entry-74.js +0 -0
  479. /package/node_modules/{pi-agent-web-html → pi-agent-web}/runtime/entry-76.js +0 -0
  480. /package/node_modules/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-77.js +0 -0
  481. /package/node_modules/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-78.js +0 -0
  482. /package/node_modules/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-79.js +0 -0
  483. /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-22.js +0 -0
  484. /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-23.js +0 -0
  485. /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-77.js +0 -0
  486. /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-78.js +0 -0
  487. /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-79.js +0 -0
  488. /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-overwrite → pi-agent-text-editor-argument-order}/runtime/entry-70.js +0 -0
  489. /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-renderer → pi-agent-text-editor-overwrite}/runtime/entry-71.js +0 -0
  490. /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-72.js +0 -0
  491. /package/src/plugins/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-28.js +0 -0
  492. /package/src/plugins/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-29.js +0 -0
  493. /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-30.js +0 -0
  494. /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-31.js +0 -0
@@ -0,0 +1,94 @@
1
+ import { requiredValue } from "pi-agent-invariant";
2
+ import type { ExtensionAPI, Theme } from "@earendil-works/pi-coding-agent";
3
+ import { Text, type Component } from "@earendil-works/pi-tui";
4
+ import type { IdeDiagnosticResult } from "#src/api/plugin-protocol.js";
5
+ import type { DiagnosticNotification } from "#src/core/diagnostic-store.js";
6
+
7
+ export const DIAGNOSTIC_ENTRY_TYPE = "ide-diagnostic-summary";
8
+
9
+ /** Display-only counts. Provider messages and source excerpts stay out of this entry. */
10
+ export interface DiagnosticEntryData {
11
+ readonly filePath: string;
12
+ readonly sources: readonly {
13
+ readonly source: string;
14
+ readonly status: IdeDiagnosticResult["status"];
15
+ readonly counts: Readonly<Record<"error" | "warning" | "info" | "hint", number>>;
16
+ }[];
17
+ }
18
+
19
+ /** Derive visible data from the exact report delivered to the model. */
20
+ export function diagnosticEntryData(notification: DiagnosticNotification): DiagnosticEntryData {
21
+ return {
22
+ filePath: notification.filePath,
23
+ sources: notification.results.map((result) => {
24
+ const counts = { error: 0, warning: 0, info: 0, hint: 0 };
25
+ for (const item of result.diagnostics) counts[item.severity]++;
26
+ return { source: result.source, status: result.status, counts };
27
+ }),
28
+ };
29
+ }
30
+
31
+ /** Render nonempty counts with their tool names; expanded entries also show completion state. */
32
+ export function renderDiagnosticEntry(
33
+ data: DiagnosticEntryData,
34
+ theme: Theme,
35
+ expanded = false,
36
+ ): Component {
37
+ return {
38
+ render(width) {
39
+ const sources = data.sources.filter(
40
+ (source) =>
41
+ source.status !== "pending" &&
42
+ source.status !== "unavailable" &&
43
+ Object.values(source.counts).some((count) => count > 0),
44
+ );
45
+ if (sources.length === 0) return [];
46
+ const summary = sources
47
+ .map(
48
+ (source) =>
49
+ `${renderCounts(source.counts, theme)} ${theme.fg("dim", `(${plain(source.source)})`)}` +
50
+ (source.status === "ready" ? "" : ` · ${theme.fg("dim", source.status)}`),
51
+ )
52
+ .join(" · ");
53
+ const lines = [
54
+ `${theme.fg("accent", "Diagnostics")} ${theme.fg("toolTitle", plain(data.filePath))} · ${summary}`,
55
+ ];
56
+ if (expanded) {
57
+ for (const source of sources) {
58
+ lines.push(
59
+ ` ${theme.fg("dim", plain(source.source))} · ${renderCounts(source.counts, theme)} · ${theme.fg("dim", source.status)}`,
60
+ );
61
+ }
62
+ }
63
+ return new Text(lines.join("\n"), 0, 0).render(width);
64
+ },
65
+ invalidate() {},
66
+ };
67
+ }
68
+
69
+ /** Register durable UI-only entries; appending one never adds model context or starts a turn. */
70
+ export function registerDiagnosticEntryRenderer(pi: ExtensionAPI): void {
71
+ pi.registerEntryRenderer<DiagnosticEntryData>(DIAGNOSTIC_ENTRY_TYPE, (entry, options, theme) =>
72
+ renderDiagnosticEntry(requiredValue(entry.data), theme, options.expanded),
73
+ );
74
+ }
75
+
76
+ function renderCounts(
77
+ counts: DiagnosticEntryData["sources"][number]["counts"],
78
+ theme: Theme,
79
+ ): string {
80
+ return (["error", "warning", "info", "hint"] as const)
81
+ .filter((severity) => counts[severity] > 0)
82
+ .map((severity) => {
83
+ const count = counts[severity];
84
+ const label = severity === "info" || count === 1 ? severity : `${severity}s`;
85
+ const color =
86
+ count > 0 && (severity === "error" || severity === "warning") ? severity : "muted";
87
+ return theme.fg(color, `${count} ${label}`);
88
+ })
89
+ .join(", ");
90
+ }
91
+
92
+ function plain(value: string): string {
93
+ return value.replace(/[\u0000-\u001f\u007f-\u009f]/g, " ");
94
+ }
@@ -9,6 +9,13 @@ import type {
9
9
  } from "#src/api/plugin-protocol.js";
10
10
  import type { ToolContext } from "#src/toolchain/types.js";
11
11
 
12
+ /** Nonempty findings shared by hidden model delivery and a separate UI summary. */
13
+ export interface DiagnosticNotification {
14
+ readonly filePath: string;
15
+ readonly results: readonly IdeDiagnosticResult[];
16
+ readonly text: string;
17
+ }
18
+
12
19
  interface FileState {
13
20
  readonly cwd: string;
14
21
  readonly filePath: string;
@@ -27,6 +34,13 @@ export class DiagnosticStore {
27
34
  private readonly queue: (() => Promise<void>)[] = [];
28
35
  private running = 0;
29
36
  private disposed = false;
37
+ private readonly changeListeners = new Set<(cwd: string) => void>();
38
+
39
+ /** Observe published reports immediately, independently of agent turns. */
40
+ onDidChange(listener: (cwd: string) => void): () => void {
41
+ this.changeListeners.add(listener);
42
+ return () => this.changeListeners.delete(listener);
43
+ }
30
44
 
31
45
  constructor(
32
46
  private readonly sources: readonly IdeDiagnosticSource[],
@@ -57,41 +71,48 @@ export class DiagnosticStore {
57
71
  return { filePath: absolute, content: current.content, results: [...current.results.values()] };
58
72
  }
59
73
 
60
- /** Drain changed current counts at a model boundary, not at each provider event. */
61
- async takeNotifications(cwd: string): Promise<string[]> {
62
- const lines: string[] = [];
74
+ /** Drain current findings for delivery; pending, unavailable and empty reports stay silent. */
75
+ async takeNotifications(cwd: string): Promise<DiagnosticNotification[]> {
76
+ const notifications: DiagnosticNotification[] = [];
63
77
  for (const state of [...this.dirty]) {
64
78
  if (state.cwd !== path.resolve(cwd)) continue;
65
79
  this.dirty.delete(state);
66
80
  if (!(await this.isCurrent(state))) continue;
67
- const results = [...state.results.values()];
81
+ const results = [...state.results.values()].filter(
82
+ (result) =>
83
+ result.status !== "pending" &&
84
+ result.status !== "unavailable" &&
85
+ result.diagnostics.length > 0,
86
+ );
87
+ const key = this.key(state.filePath, state.cwd);
88
+ // Fingerprint only findings: empty provider updates must not resend the same report.
89
+ const fingerprint = JSON.stringify(results);
90
+ if (this.sent.get(key) === fingerprint) continue;
91
+ this.sent.set(key, fingerprint);
92
+ // Remember the empty state so a later recurrence can notify again.
93
+ if (results.length === 0) continue;
68
94
  const summary = results
69
95
  .map((result) => {
70
- if (result.status === "pending" || result.status === "unavailable") {
71
- return `${result.source} ${result.status}`;
72
- }
73
- const counts = ["error", "warning", "info", "hint"].map(
74
- (severity) =>
75
- `${result.diagnostics.filter((item) => item.severity === severity).length} ${severity}`,
76
- );
96
+ const counts = ["error", "warning", "info", "hint"].flatMap((severity) => {
97
+ const count = result.diagnostics.filter((item) => item.severity === severity).length;
98
+ return count > 0 ? [`${count} ${severity}`] : [];
99
+ });
77
100
  return `${result.source} ${counts.join(", ")}${result.status === "snapshot" ? " (snapshot; completion unknown)" : result.status === "unversioned" ? " (unversioned)" : ""}`;
78
101
  })
79
102
  .join("; ");
80
- const key = this.key(state.filePath, state.cwd);
81
- // Fingerprint details too: a different error with the same count is still a change.
82
- const fingerprint = JSON.stringify(results);
83
- if (this.sent.get(key) === fingerprint) continue;
84
- this.sent.set(key, fingerprint);
85
- lines.push(
86
- `${JSON.stringify(path.relative(cwd, state.filePath))}: ${summary || "no diagnostic sources"}.`,
87
- );
103
+ notifications.push({
104
+ filePath: path.relative(cwd, state.filePath),
105
+ results,
106
+ text: `${JSON.stringify(path.relative(cwd, state.filePath))}: ${summary}.`,
107
+ });
88
108
  }
89
- return lines;
109
+ return notifications;
90
110
  }
91
111
 
92
112
  /** Invalidate all revision-bound callbacks and cancel session-owned work. */
93
113
  dispose(): void {
94
114
  this.disposed = true;
115
+ this.changeListeners.clear();
95
116
  for (const state of this.files.values()) state.controller.abort();
96
117
  this.files.clear();
97
118
  this.dirty.clear();
@@ -181,10 +202,11 @@ export class DiagnosticStore {
181
202
  const publication = (state.publications.get(source) ?? 0) + 1;
182
203
  state.publications.set(source, publication);
183
204
  if (!(await this.isCurrent(state)) || state.publications.get(source) !== publication) return;
184
- const result: IdeDiagnosticResult = { source, ...report };
205
+ const result: IdeDiagnosticResult = { ...report, source: report.source ?? source };
185
206
  if (JSON.stringify(state.results.get(source)) === JSON.stringify(result)) return;
186
207
  state.results.set(source, result);
187
208
  this.dirty.add(state);
209
+ for (const listener of this.changeListeners) listener(state.cwd);
188
210
  }
189
211
 
190
212
  private async check(state: FileState, source: IdeDiagnosticSource): Promise<void> {
@@ -6,6 +6,11 @@ import {
6
6
  isIdePluginRegistrationRequest,
7
7
  } from "#src/api/plugin-protocol.js";
8
8
  import { createIdeCore } from "#src/core/ide-core.js";
9
+ import {
10
+ diagnosticEntryData,
11
+ DIAGNOSTIC_ENTRY_TYPE,
12
+ registerDiagnosticEntryRenderer,
13
+ } from "#src/core/diagnostic-entry.js";
9
14
  import { runIdePostEditGate } from "#src/post-edit/gate.js";
10
15
  import { resetRegistry } from "#src/toolchain/registry.js";
11
16
  import { connectTextEditorPostEditHandler } from "pi-agent-text-editor/api/post-edit";
@@ -27,6 +32,7 @@ export default async function registerPiAgentIde(pi: ExtensionAPI): Promise<void
27
32
  });
28
33
  resetRegistry();
29
34
  const core = createIdeCore();
35
+ registerDiagnosticEntryRenderer(pi);
30
36
  const unsubscribePlugins = pi.events.on(IDE_PLUGIN_REGISTER_EVENT, (request) => {
31
37
  if (!isIdePluginRegistrationRequest(request)) {
32
38
  throw new Error("Invalid pi-agent-ide plugin registration request");
@@ -41,7 +47,10 @@ export default async function registerPiAgentIde(pi: ExtensionAPI): Promise<void
41
47
  });
42
48
  connectTextEditorPostEditHandler(pi, {
43
49
  id: "pi-agent-ide",
44
- handler: runIdePostEditGate,
50
+ handler: (transaction) =>
51
+ pi.getFlag("pi-agent-ide-no-post-processing") === true
52
+ ? Promise.resolve({ formatting: { status: "disabled" } })
53
+ : runIdePostEditGate(transaction),
45
54
  });
46
55
  pi.events.emit(IDE_CORE_READY_EVENT, {
47
56
  protocol: IDE_PROTOCOL,
@@ -54,6 +63,7 @@ export default async function registerPiAgentIde(pi: ExtensionAPI): Promise<void
54
63
  id: "ide-diagnostics",
55
64
  setup(api) {
56
65
  api.onDidEdit((completion) => {
66
+ if (pi.getFlag("pi-agent-ide-no-post-processing") === true) return;
57
67
  if (path.isAbsolute(completion.resourceSource)) {
58
68
  core.diagnostics.schedule(completion.resourceSource, completion.after.content, {
59
69
  cwd: completion.cwd,
@@ -62,22 +72,34 @@ export default async function registerPiAgentIde(pi: ExtensionAPI): Promise<void
62
72
  });
63
73
  },
64
74
  });
65
- pi.on("context", async (event, ctx) => {
66
- const lines = await core.diagnostics.takeNotifications(ctx.cwd);
67
- if (lines.length === 0) return;
68
- // Context-only delivery cannot wake an idle agent or create visible transcript rows.
69
- return {
70
- messages: [
71
- ...event.messages,
72
- {
73
- role: "custom" as const,
74
- customType: "ide-diagnostics",
75
- display: false,
76
- content: `File diagnostics:\n${lines.join("\n")}`,
77
- timestamp: Date.now(),
78
- },
79
- ],
80
- };
75
+ let delivery = Promise.resolve();
76
+ let closed = false;
77
+ const isClosed = () => closed;
78
+ const unsubscribeDiagnostics = core.diagnostics.onDidChange((cwd) => {
79
+ delivery = delivery
80
+ .then(async () => {
81
+ if (closed) return;
82
+ const notifications = await core.diagnostics.takeNotifications(cwd);
83
+ if (isClosed() || notifications.length === 0) return;
84
+ pi.sendMessage(
85
+ {
86
+ customType: "ide-diagnostics",
87
+ display: false,
88
+ content: `File diagnostics:\n${notifications.map((item) => item.text).join("\n")}`,
89
+ },
90
+ { triggerTurn: true, deliverAs: "steer" },
91
+ );
92
+ for (const notification of notifications) {
93
+ pi.appendEntry(DIAGNOSTIC_ENTRY_TYPE, diagnosticEntryData(notification));
94
+ }
95
+ })
96
+ .catch((error: unknown) => {
97
+ console.error("Diagnostic delivery failed", error);
98
+ });
99
+ });
100
+ pi.on("session_shutdown", () => {
101
+ closed = true;
102
+ unsubscribeDiagnostics();
81
103
  });
82
104
 
83
105
  await core.waitForPendingPlugins();
@@ -57,8 +57,21 @@ export async function writeSuggestedConfigs(
57
57
  command: recipe.command,
58
58
  transport: "stdio",
59
59
  rootMarkers: recipe.rootMarkers,
60
+
61
+ ...(recipe.initializationOptions !== undefined && {
62
+ initializationOptions: recipe.initializationOptions,
63
+ }),
64
+
65
+ ...(recipe.settings !== undefined && { settings: recipe.settings }),
66
+
67
+ ...(recipe.requireRootMarker !== undefined && {
68
+ requireRootMarker: recipe.requireRootMarker,
69
+ }),
60
70
  languages: Object.fromEntries(
61
- Object.entries(recipe.languageIds).map(([id, extensions]) => [id, { extensions }]),
71
+ Object.entries(recipe.languageIds).map(([id, extensions]) => [
72
+ id,
73
+ { extensions, ...(recipe.fileNames?.[id] && { fileNames: recipe.fileNames[id] }) },
74
+ ]),
62
75
  ),
63
76
  capabilities: ["diagnostics"],
64
77
  };
@@ -1,5 +1,8 @@
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";
5
8
  import type { DoctorToolSelection } from "#src/api/doctor.js";
@@ -23,7 +26,10 @@ export async function discoverRecipeCandidates(
23
26
  recipes: readonly OwnedContribution<ToolRecipe>[],
24
27
  environment: NodeJS.ProcessEnv = process.env,
25
28
  ): Promise<readonly RecipeCandidate[]> {
26
- const dependencies = await packageDependencies(cwd);
29
+ const nativeEvidence = await inspectRecipeEvidence(
30
+ cwd,
31
+ recipes.map((entry) => entry.value),
32
+ );
27
33
  const managedRecipes = await managedRecipeIds(cwd);
28
34
  const candidates: RecipeCandidate[] = [];
29
35
 
@@ -36,7 +42,8 @@ export async function discoverRecipeCandidates(
36
42
 
37
43
  const evidence: string[] = [];
38
44
  let score = 1;
39
- const nativeConfig = await firstExisting(cwd, recipe.configFiles ?? []);
45
+ const native = nativeEvidence.get(recipe.id);
46
+ const nativeConfig = native?.config;
40
47
 
41
48
  if (nativeConfig !== undefined) {
42
49
  score += 6;
@@ -48,7 +55,7 @@ export async function discoverRecipeCandidates(
48
55
  evidence.push("Pi Agent IDE config");
49
56
  }
50
57
 
51
- const dependency = recipe.dependencies?.find((name) => dependencies.has(name));
58
+ const dependency = native?.dependency;
52
59
 
53
60
  if (dependency !== undefined) {
54
61
  score += 4;
@@ -118,47 +125,14 @@ export function selectSuggestedRecipes(
118
125
  return [...selected.values()];
119
126
  }
120
127
 
121
- async function firstExisting(cwd: string, names: readonly string[]): Promise<string | undefined> {
122
- for (const name of names) {
123
- try {
124
- await access(path.join(cwd, name));
125
- return name;
126
- } catch {
127
- // Try the next project marker.
128
- }
129
- }
130
-
131
- return undefined;
132
- }
133
-
134
128
  async function firstExecutable(
135
129
  cwd: string,
136
130
  names: readonly string[],
137
131
  environment: NodeJS.ProcessEnv,
138
132
  ): Promise<string | undefined> {
139
- const pathDirectories = (environment.PATH ?? "").split(path.delimiter).filter(Boolean);
140
- const directories = [path.join(cwd, "node_modules", ".bin"), ...pathDirectories];
141
-
142
133
  for (const name of names) {
143
- if (name.includes(path.sep)) {
144
- try {
145
- await access(path.resolve(cwd, name));
146
- return name;
147
- } catch {
148
- continue;
149
- }
150
- }
151
-
152
- for (const directory of directories) {
153
- try {
154
- await access(path.join(directory, name));
155
- return name;
156
- } catch {
157
- // Try the next executable location.
158
- }
159
- }
134
+ if (await isExecutableAvailable(name, cwd, environment)) return name;
160
135
  }
161
-
162
136
  return undefined;
163
137
  }
164
138
 
@@ -192,32 +166,3 @@ async function managedRecipeIds(cwd: string): Promise<ReadonlySet<string>> {
192
166
 
193
167
  return ids;
194
168
  }
195
-
196
- async function packageDependencies(cwd: string): Promise<ReadonlySet<string>> {
197
- try {
198
- const value = JSON.parse(await readFile(path.join(cwd, "package.json"), "utf8")) as Record<
199
- string,
200
- unknown
201
- >;
202
- const names = new Set<string>();
203
-
204
- for (const key of [
205
- "dependencies",
206
- "devDependencies",
207
- "peerDependencies",
208
- "optionalDependencies",
209
- ]) {
210
- const section = value[key];
211
-
212
- if (typeof section === "object" && section !== null && !Array.isArray(section)) {
213
- for (const name of Object.keys(section)) {
214
- names.add(name);
215
- }
216
- }
217
- }
218
-
219
- return names;
220
- } catch {
221
- return new Set();
222
- }
223
- }
package/src/doctor/run.ts CHANGED
@@ -49,13 +49,45 @@ export async function inspectDoctorSetup(
49
49
  runContributedSetupChecks(snapshot, context),
50
50
  ]);
51
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
+ }
52
84
  return {
53
85
  cwd,
54
86
  files,
55
87
  detectedLanguages,
56
88
  candidates,
57
89
  selections: setup.selections,
58
- actions: setup.actions,
90
+ actions: [...setup.actions, ...missingActions.values()],
59
91
  suggestions: selectSuggestedRecipes(candidates, detectedLanguageIds, setup.selections),
60
92
  };
61
93
  }
@@ -18,7 +18,7 @@ import { createFilesystemReadResolver, createFilesystemWriteResolver } from "#sr
18
18
 
19
19
  const readTarget = { provider: "filesystem", capability: "read" } satisfies ContentTarget;
20
20
  const writeTarget = { provider: "filesystem", capability: "write" } satisfies ContentTarget;
21
- const renderReadResult = createReadResultRenderer({ kind: "source" });
21
+ const renderReadResult = createReadResultRenderer({ kind: "source", nativeResources: true });
22
22
 
23
23
  export default async function registerFilesystemPlugin(pi: ExtensionAPI): Promise<void> {
24
24
  const readHost = createContentHost(pi, readTarget);
@@ -33,7 +33,7 @@ export default async function registerFilesystemPlugin(pi: ExtensionAPI): Promis
33
33
  api.addResolver({ resolver: readResolver, renderResult: renderReadResult });
34
34
  api.describe(() =>
35
35
  renderContentDescription(
36
- "Reads local filesystem paths and file:// URLs. Directories are read-only listings.",
36
+ "File path — file content; directory path — entry listing. Relative, absolute and file:// paths accepted.",
37
37
  readHost.listDescriptions(),
38
38
  ),
39
39
  );
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "pi-agent-filesystem",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
7
7
  },
8
8
  "dependencies": {
9
- "pi-agent-image": "0.2.0",
10
- "pi-agent-read": "0.2.0",
11
- "pi-agent-resource": "0.2.0",
12
- "pi-agent-text": "0.2.0",
13
- "pi-agent-text-editor": "0.2.0"
9
+ "pi-agent-image": "0.2.2",
10
+ "pi-agent-read": "0.2.2",
11
+ "pi-agent-resource": "0.2.2",
12
+ "pi-agent-text": "0.2.2",
13
+ "pi-agent-text-editor": "0.2.2"
14
14
  },
15
15
  "pi": {
16
16
  "extensions": [
17
- "./runtime/entry-20.js"
17
+ "./runtime/entry-21.js"
18
18
  ]
19
19
  },
20
20
  "peerDependencies": {
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "pi-agent-filesystem-image",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#extension": "./index.ts"
7
7
  },
8
8
  "dependencies": {
9
- "pi-agent-image": "0.2.0",
10
- "pi-agent-resource": "0.2.0"
9
+ "pi-agent-image": "0.2.2",
10
+ "pi-agent-resource": "0.2.2"
11
11
  },
12
12
  "pi": {
13
13
  "extensions": [
14
- "./runtime/entry-21.js"
14
+ "./runtime/entry-22.js"
15
15
  ]
16
16
  },
17
17
  "peerDependencies": {
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "pi-agent-filesystem-pdf",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "pi-agent-pdf": "0.2.0",
7
- "pi-agent-resource": "0.2.0"
6
+ "pi-agent-pdf": "0.2.2",
7
+ "pi-agent-resource": "0.2.2"
8
8
  },
9
9
  "pi": {
10
10
  "extensions": [
11
- "./runtime/entry-22.js"
11
+ "./runtime/entry-23.js"
12
12
  ]
13
13
  },
14
14
  "peerDependencies": {
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "pi-agent-filesystem-text",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#extension": "./index.ts"
7
7
  },
8
8
  "dependencies": {
9
- "pi-agent-resource": "0.2.0",
10
- "pi-agent-text": "0.2.0"
9
+ "pi-agent-resource": "0.2.2",
10
+ "pi-agent-text": "0.2.2"
11
11
  },
12
12
  "pi": {
13
13
  "extensions": [
14
- "./runtime/entry-23.js"
14
+ "./runtime/entry-24.js"
15
15
  ]
16
16
  },
17
17
  "peerDependencies": {
@@ -0,0 +1,2 @@
1
+ export * from "../../../../../../../../dist/entry-24.js";
2
+ export { default } from "../../../../../../../../dist/entry-24.js";
@@ -0,0 +1,2 @@
1
+ export * from "../../../../../../dist/entry-21.js";
2
+ export { default } from "../../../../../../dist/entry-21.js";
@@ -29,13 +29,8 @@ export default async function registerWeb(pi: ExtensionAPI): Promise<void> {
29
29
  preserveTruncatedOutput: true,
30
30
  });
31
31
  api.describe(() =>
32
- renderContentDescription(
33
- "Reads HTTP(S) URLs, automatically retrying failed reads or empty HTML in a local browser.",
34
- readHost.listDescriptions(),
35
- ),
32
+ renderContentDescription("HTTP(S) URL — remote content.", readHost.listDescriptions()),
36
33
  );
37
-
38
- api.addPromptGuideline("Use read with the plain HTTP(S) URL; browser fallback is automatic.");
39
34
  },
40
35
  } satisfies ReadPlugin;
41
36
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-web",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
@@ -8,16 +8,16 @@
8
8
  "dependencies": {
9
9
  "defuddle": "^0.19.1",
10
10
  "linkedom": "^0.18.12",
11
- "pi-agent-doctor": "0.2.0",
12
- "pi-agent-image": "0.2.0",
13
- "pi-agent-read": "0.2.0",
14
- "pi-agent-resource": "0.2.0",
15
- "pi-agent-text": "0.2.0",
11
+ "pi-agent-doctor": "0.2.2",
12
+ "pi-agent-image": "0.2.2",
13
+ "pi-agent-read": "0.2.2",
14
+ "pi-agent-resource": "0.2.2",
15
+ "pi-agent-text": "0.2.2",
16
16
  "playwright-core": "^1.62.1"
17
17
  },
18
18
  "pi": {
19
19
  "extensions": [
20
- "./runtime/entry-75.js"
20
+ "./runtime/entry-76.js"
21
21
  ]
22
22
  },
23
23
  "peerDependencies": {