pi-agent-ide 0.2.0 → 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 (326) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/chunk-2XYXV5HS.js +4 -0
  3. package/dist/{chunk-YQTLJ5ZV.js → chunk-6XQQBKPE.js} +1 -1
  4. package/dist/{chunk-VUNCBASK.js → chunk-KH5KPBCR.js} +3 -3
  5. package/dist/chunk-L4FA6OD4.js +1 -0
  6. package/dist/chunk-LGN7EJYR.js +13 -0
  7. package/dist/chunk-MTQSGWZJ.js +1 -0
  8. package/dist/chunk-N34ATN52.js +1 -0
  9. package/dist/{chunk-52BM6J6I.js → chunk-NXHPO7ER.js} +3 -3
  10. package/dist/{chunk-QW5O42QJ.js → chunk-OFHVDY4Q.js} +1 -1
  11. package/dist/{chunk-E4SECPF4.js → chunk-ONWUJXUR.js} +1 -1
  12. package/dist/chunk-QZANC2IG.js +1 -0
  13. package/dist/{chunk-QNZVPFSP.js → chunk-SMSIT3CE.js} +1 -1
  14. package/dist/{chunk-KP37XTDI.js → chunk-UTTW55S2.js} +1 -1
  15. package/dist/chunk-VEJGSURY.js +8 -0
  16. package/dist/chunk-WZI4YC2O.js +1 -0
  17. package/dist/{chunk-5A25RATC.js → chunk-ZIHEF6K3.js} +3 -3
  18. package/dist/entry-0.js +1 -1
  19. package/dist/entry-18.js +1 -1
  20. package/dist/entry-19.js +1 -1
  21. package/dist/entry-20.js +1 -1
  22. package/dist/entry-21.js +1 -1
  23. package/dist/entry-22.js +1 -1
  24. package/dist/entry-23.js +1 -1
  25. package/dist/entry-24.js +1 -1
  26. package/dist/entry-25.js +1 -1
  27. package/dist/entry-26.js +1 -1
  28. package/dist/entry-27.js +1 -1
  29. package/dist/entry-28.js +1 -1
  30. package/dist/entry-29.js +1 -1
  31. package/dist/entry-30.js +1 -1
  32. package/dist/entry-31.js +1 -1
  33. package/dist/entry-32.js +1 -1
  34. package/dist/entry-33.js +1 -1
  35. package/dist/entry-34.js +1 -1
  36. package/dist/entry-35.js +1 -1
  37. package/dist/entry-36.js +1 -1
  38. package/dist/entry-37.js +1 -1
  39. package/dist/entry-38.js +1 -1
  40. package/dist/entry-39.js +1 -1
  41. package/dist/entry-4.js +1 -1
  42. package/dist/entry-40.js +1 -1
  43. package/dist/entry-41.js +1 -1
  44. package/dist/entry-42.js +1 -1
  45. package/dist/entry-43.js +1 -1
  46. package/dist/entry-44.js +1 -1
  47. package/dist/entry-45.js +1 -1
  48. package/dist/entry-46.js +1 -1
  49. package/dist/entry-47.js +1 -1
  50. package/dist/entry-48.js +1 -1
  51. package/dist/entry-49.js +1 -1
  52. package/dist/entry-50.js +1 -1
  53. package/dist/entry-51.js +1 -1
  54. package/dist/entry-52.js +1 -1
  55. package/dist/entry-53.js +1 -0
  56. package/dist/entry-54.js +0 -1
  57. package/dist/entry-55.js +1 -0
  58. package/dist/entry-56.js +0 -1
  59. package/dist/entry-57.js +1 -1
  60. package/dist/entry-58.js +1 -1
  61. package/dist/entry-59.js +1 -1
  62. package/dist/entry-60.js +1 -1
  63. package/dist/entry-61.js +1 -1
  64. package/dist/entry-62.js +1 -0
  65. package/dist/entry-63.js +0 -1
  66. package/dist/entry-64.js +1 -0
  67. package/dist/entry-65.js +0 -1
  68. package/dist/entry-66.js +1 -1
  69. package/dist/entry-67.js +1 -1
  70. package/dist/entry-68.js +1 -1
  71. package/dist/entry-69.js +1 -1
  72. package/dist/entry-70.js +1 -1
  73. package/dist/entry-71.js +1 -1
  74. package/dist/entry-72.js +1 -1
  75. package/dist/entry-73.js +1 -1
  76. package/dist/entry-74.js +1 -1
  77. package/dist/entry-75.js +1 -1
  78. package/dist/entry-76.js +1 -1
  79. package/dist/entry-77.js +1 -1
  80. package/dist/entry-78.js +1 -1
  81. package/dist/entry-79.js +1 -1
  82. package/dist/entry-80.js +1 -0
  83. package/dist/pi-agent-ide.js +12 -12
  84. package/docs/configuration.md +32 -1
  85. package/docs/generated/tool-catalog/cmake.md +5 -5
  86. package/docs/generated/tool-catalog/csharp.md +5 -5
  87. package/docs/generated/tool-catalog/css.md +7 -7
  88. package/docs/generated/tool-catalog/dart.md +9 -0
  89. package/docs/generated/tool-catalog/dockerfile.md +5 -5
  90. package/docs/generated/tool-catalog/elixir.md +9 -0
  91. package/docs/generated/tool-catalog/html.md +7 -6
  92. package/docs/generated/tool-catalog/index.md +9 -0
  93. package/docs/generated/tool-catalog/javascript.md +8 -8
  94. package/docs/generated/tool-catalog/json.md +7 -7
  95. package/docs/generated/tool-catalog/julia.md +8 -0
  96. package/docs/generated/tool-catalog/kotlin.md +6 -5
  97. package/docs/generated/tool-catalog/markdown.md +6 -6
  98. package/docs/generated/tool-catalog/powershell.md +9 -0
  99. package/docs/generated/tool-catalog/python.md +6 -6
  100. package/docs/generated/tool-catalog/r.md +9 -0
  101. package/docs/generated/tool-catalog/scala.md +9 -0
  102. package/docs/generated/tool-catalog/svelte.md +9 -0
  103. package/docs/generated/tool-catalog/typescript.md +9 -8
  104. package/docs/generated/tool-catalog/vue.md +9 -0
  105. package/docs/generated/tool-catalog/yaml.md +6 -6
  106. package/docs/generated/tool-catalog/zig.md +9 -0
  107. package/node_modules/pi-agent-doctor/package.json +10 -3
  108. package/node_modules/pi-agent-doctor/runtime/entry-20.js +1 -0
  109. package/node_modules/pi-agent-doctor/src/catalog.ts +27 -1
  110. package/node_modules/pi-agent-doctor/src/evidence.ts +118 -0
  111. package/node_modules/pi-agent-doctor/src/executable.ts +63 -17
  112. package/node_modules/pi-agent-filesystem/package.json +7 -7
  113. package/node_modules/pi-agent-filesystem-image/package.json +4 -4
  114. package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
  115. package/node_modules/pi-agent-filesystem-text/package.json +4 -4
  116. package/node_modules/pi-agent-filesystem-text/runtime/entry-24.js +2 -0
  117. package/node_modules/pi-agent-ide-ast/package.json +11 -11
  118. package/node_modules/pi-agent-ide-ast/runtime/entry-25.js +0 -1
  119. package/node_modules/pi-agent-ide-ast/runtime/entry-26.js +2 -0
  120. package/node_modules/pi-agent-ide-ast/src/ast/manager.ts +3 -0
  121. package/node_modules/pi-agent-ide-ast/src/ast/outline.ts +3 -0
  122. package/node_modules/pi-agent-ide-changes/package.json +8 -8
  123. package/node_modules/pi-agent-ide-changes/runtime/entry-27.js +0 -1
  124. package/node_modules/pi-agent-ide-formatter/package.json +4 -4
  125. package/node_modules/pi-agent-ide-formatter/src/catalog.ts +131 -13
  126. package/node_modules/pi-agent-ide-formatter/src/registry.ts +20 -8
  127. package/node_modules/pi-agent-ide-languages/package.json +3 -3
  128. package/node_modules/pi-agent-ide-languages/src/languages.ts +15 -0
  129. package/node_modules/pi-agent-ide-lint/package.json +8 -8
  130. package/node_modules/pi-agent-ide-lint/src/catalog.ts +196 -39
  131. package/node_modules/pi-agent-ide-lint/src/command-linter.ts +23 -3
  132. package/node_modules/pi-agent-ide-lint/src/diagnostics.ts +73 -33
  133. package/node_modules/pi-agent-ide-lint/src/registry.ts +20 -8
  134. package/node_modules/pi-agent-ide-lsp/package.json +9 -9
  135. package/node_modules/pi-agent-ide-lsp/runtime/entry-32.js +2 -0
  136. package/node_modules/pi-agent-ide-lsp/src/catalog.ts +161 -7
  137. package/node_modules/pi-agent-ide-lsp/src/diagnostic-source.ts +3 -6
  138. package/node_modules/pi-agent-ide-lsp/src/doctor-plugin.ts +2 -4
  139. package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +154 -11
  140. package/node_modules/pi-agent-ide-lsp/src/lsp/file-watchers.ts +88 -0
  141. package/node_modules/pi-agent-ide-lsp/src/lsp/initialization-options.ts +14 -0
  142. package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +8 -4
  143. package/node_modules/pi-agent-ide-lsp/src/lsp/registry.ts +69 -34
  144. package/node_modules/pi-agent-ide-lsp/src/lsp/transport-writer.ts +24 -0
  145. package/node_modules/pi-agent-ide-lsp/src/lsp/types.ts +5 -0
  146. package/node_modules/pi-agent-image/package.json +3 -3
  147. package/node_modules/pi-agent-invariant/package.json +2 -2
  148. package/node_modules/pi-agent-pdf/package.json +3 -3
  149. package/node_modules/pi-agent-read/package.json +11 -11
  150. package/node_modules/pi-agent-read/runtime/entry-39.js +0 -1
  151. package/node_modules/pi-agent-read/runtime/entry-40.js +2 -0
  152. package/node_modules/pi-agent-resource/package.json +2 -2
  153. package/node_modules/pi-agent-search/package.json +7 -7
  154. package/node_modules/pi-agent-search/runtime/entry-44.js +0 -1
  155. package/node_modules/pi-agent-search-text/package.json +9 -9
  156. package/node_modules/pi-agent-search-text/runtime/entry-46.js +1 -0
  157. package/node_modules/pi-agent-text/package.json +3 -3
  158. package/node_modules/pi-agent-text/runtime/entry-48.js +1 -0
  159. package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
  160. package/node_modules/pi-agent-text-anchor-constant/runtime/entry-49.js +2 -0
  161. package/node_modules/pi-agent-text-anchor-exact/package.json +5 -5
  162. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-50.js +0 -1
  163. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-51.js +2 -0
  164. package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
  165. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-52.js +0 -1
  166. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-53.js +2 -0
  167. package/node_modules/pi-agent-text-editor/package.json +22 -22
  168. package/node_modules/pi-agent-text-editor/runtime/entry-68.js +0 -1
  169. package/node_modules/pi-agent-text-editor-argument-order/package.json +3 -3
  170. package/node_modules/pi-agent-text-editor-overwrite/package.json +4 -4
  171. package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
  172. package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
  173. package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +2 -0
  174. package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
  175. package/node_modules/pi-agent-tool-ui/package.json +2 -2
  176. package/node_modules/pi-agent-tool-ui/runtime/entry-75.js +1 -0
  177. package/node_modules/pi-agent-web/package.json +7 -7
  178. package/node_modules/pi-agent-web-html/package.json +3 -3
  179. package/node_modules/pi-agent-web-image/package.json +4 -4
  180. package/node_modules/pi-agent-web-pdf/package.json +4 -4
  181. package/node_modules/pi-agent-web-text/package.json +4 -4
  182. package/node_modules/pi-agent-web-text/runtime/entry-80.js +2 -0
  183. package/package.json +35 -35
  184. package/src/api/tool-config/formatters.json +70 -12
  185. package/src/api/tool-config/linters.json +148 -66
  186. package/src/api/tool-config/lsp-servers.json +142 -7
  187. package/src/api/tool-config.ts +56 -24
  188. package/src/code-view/diagnostic-view.ts +14 -10
  189. package/src/doctor/config-writer.ts +14 -1
  190. package/src/doctor/discovery.ts +13 -68
  191. package/src/doctor/run.ts +33 -1
  192. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
  193. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
  194. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
  195. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
  196. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-24.js +2 -0
  197. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-21.js +2 -0
  198. package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +7 -7
  199. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -3
  200. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
  201. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
  202. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
  203. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-80.js +2 -0
  204. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-76.js +2 -0
  205. package/src/extensions/pi-agent-read/package.json +11 -11
  206. package/src/extensions/pi-agent-read/runtime/entry-39.js +0 -1
  207. package/src/extensions/pi-agent-read/runtime/entry-40.js +2 -0
  208. package/src/extensions/pi-agent-search/package.json +7 -7
  209. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +9 -9
  210. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-46.js +1 -0
  211. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-47.js +1 -0
  212. package/src/extensions/pi-agent-search/runtime/entry-44.js +0 -1
  213. package/src/extensions/pi-agent-search/runtime/entry-45.js +2 -0
  214. package/src/extensions/pi-agent-text-editor/package.json +22 -22
  215. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
  216. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-49.js +2 -0
  217. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -5
  218. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-50.js +0 -1
  219. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-51.js +2 -0
  220. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
  221. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-52.js +0 -1
  222. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-53.js +2 -0
  223. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/package.json +3 -3
  224. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/package.json +4 -4
  225. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
  226. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -5
  227. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +2 -0
  228. package/src/extensions/pi-agent-text-editor/runtime/entry-68.js +0 -1
  229. package/src/extensions/pi-agent-text-editor/runtime/entry-69.js +2 -0
  230. package/src/plugins/pi-agent-ide-ast/package.json +11 -11
  231. package/src/plugins/pi-agent-ide-ast/runtime/entry-25.js +0 -1
  232. package/src/plugins/pi-agent-ide-ast/runtime/entry-26.js +2 -0
  233. package/src/plugins/pi-agent-ide-ast/src/ast/manager.ts +3 -0
  234. package/src/plugins/pi-agent-ide-ast/src/ast/outline.ts +3 -0
  235. package/src/plugins/pi-agent-ide-changes/package.json +8 -8
  236. package/src/plugins/pi-agent-ide-changes/runtime/entry-27.js +0 -1
  237. package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +8 -0
  238. package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
  239. package/src/plugins/pi-agent-ide-formatter/src/catalog.ts +131 -13
  240. package/src/plugins/pi-agent-ide-formatter/src/registry.ts +20 -8
  241. package/src/plugins/pi-agent-ide-languages/package.json +3 -3
  242. package/src/plugins/pi-agent-ide-languages/src/languages.ts +15 -0
  243. package/src/plugins/pi-agent-ide-lint/package.json +8 -8
  244. package/src/plugins/pi-agent-ide-lint/src/catalog.ts +196 -39
  245. package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +23 -3
  246. package/src/plugins/pi-agent-ide-lint/src/diagnostics.ts +73 -33
  247. package/src/plugins/pi-agent-ide-lint/src/registry.ts +20 -8
  248. package/src/plugins/pi-agent-ide-lsp/package.json +9 -9
  249. package/src/plugins/pi-agent-ide-lsp/runtime/entry-32.js +2 -0
  250. package/src/plugins/pi-agent-ide-lsp/src/catalog.ts +161 -7
  251. package/src/plugins/pi-agent-ide-lsp/src/diagnostic-source.ts +3 -6
  252. package/src/plugins/pi-agent-ide-lsp/src/doctor-plugin.ts +2 -4
  253. package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +154 -11
  254. package/src/plugins/pi-agent-ide-lsp/src/lsp/file-watchers.ts +88 -0
  255. package/src/plugins/pi-agent-ide-lsp/src/lsp/initialization-options.ts +14 -0
  256. package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +8 -4
  257. package/src/plugins/pi-agent-ide-lsp/src/lsp/registry.ts +69 -34
  258. package/src/plugins/pi-agent-ide-lsp/src/lsp/transport-writer.ts +24 -0
  259. package/src/plugins/pi-agent-ide-lsp/src/lsp/types.ts +5 -0
  260. package/src/toolchain/types.ts +2 -0
  261. package/dist/chunk-476MR2QB.js +0 -1
  262. package/dist/chunk-4KQOODGE.js +0 -13
  263. package/dist/chunk-7NDBZ4WX.js +0 -1
  264. package/dist/chunk-AP7Z3VWC.js +0 -1
  265. package/dist/chunk-TNWYEXFG.js +0 -1
  266. package/dist/chunk-U4D6FT66.js +0 -1
  267. package/dist/chunk-VWVLBOMU.js +0 -8
  268. package/node_modules/pi-agent-filesystem/runtime/entry-20.js +0 -2
  269. package/node_modules/pi-agent-ide-ast/runtime/entry-24.js +0 -1
  270. package/node_modules/pi-agent-ide-changes/runtime/entry-26.js +0 -1
  271. package/node_modules/pi-agent-image/runtime/entry-32.js +0 -1
  272. package/node_modules/pi-agent-resource/runtime/entry-40.js +0 -1
  273. package/node_modules/pi-agent-text-anchor-constant/runtime/entry-48.js +0 -2
  274. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-49.js +0 -1
  275. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-51.js +0 -1
  276. package/node_modules/pi-agent-text-editor/runtime/entry-53.js +0 -1
  277. package/node_modules/pi-agent-tool-call-interception/runtime/entry-73.js +0 -1
  278. package/node_modules/pi-agent-web/runtime/entry-75.js +0 -2
  279. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-21.js +0 -2
  280. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-20.js +0 -2
  281. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-76.js +0 -2
  282. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-75.js +0 -2
  283. package/src/extensions/pi-agent-read/runtime/entry-35.js +0 -1
  284. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-45.js +0 -2
  285. package/src/extensions/pi-agent-search/runtime/entry-41.js +0 -1
  286. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-48.js +0 -2
  287. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-49.js +0 -1
  288. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-51.js +0 -1
  289. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/runtime/entry-69.js +0 -2
  290. package/src/extensions/pi-agent-text-editor/runtime/entry-53.js +0 -1
  291. package/src/plugins/pi-agent-ide-ast/runtime/entry-24.js +0 -1
  292. package/src/plugins/pi-agent-ide-changes/runtime/entry-26.js +0 -1
  293. /package/node_modules/{pi-agent-filesystem-image → pi-agent-filesystem}/runtime/entry-21.js +0 -0
  294. /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-22.js +0 -0
  295. /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-23.js +0 -0
  296. /package/node_modules/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-28.js +0 -0
  297. /package/node_modules/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-29.js +0 -0
  298. /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-30.js +0 -0
  299. /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-31.js +0 -0
  300. /package/node_modules/{pi-agent-invariant → pi-agent-image}/runtime/entry-33.js +0 -0
  301. /package/node_modules/{pi-agent-pdf → pi-agent-invariant}/runtime/entry-34.js +0 -0
  302. /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-35.js +0 -0
  303. /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-41.js +0 -0
  304. /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-45.js +0 -0
  305. /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-47.js +0 -0
  306. /package/node_modules/{pi-agent-text-editor-argument-order → pi-agent-text-editor}/runtime/entry-69.js +0 -0
  307. /package/node_modules/{pi-agent-text-editor-overwrite → pi-agent-text-editor-argument-order}/runtime/entry-70.js +0 -0
  308. /package/node_modules/{pi-agent-text-editor-renderer → pi-agent-text-editor-overwrite}/runtime/entry-71.js +0 -0
  309. /package/node_modules/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-72.js +0 -0
  310. /package/node_modules/{pi-agent-tool-ui → pi-agent-tool-call-interception}/runtime/entry-74.js +0 -0
  311. /package/node_modules/{pi-agent-web-html → pi-agent-web}/runtime/entry-76.js +0 -0
  312. /package/node_modules/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-77.js +0 -0
  313. /package/node_modules/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-78.js +0 -0
  314. /package/node_modules/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-79.js +0 -0
  315. /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
  316. /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
  317. /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
  318. /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
  319. /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
  320. /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
  321. /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-renderer → pi-agent-text-editor-overwrite}/runtime/entry-71.js +0 -0
  322. /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
  323. /package/src/plugins/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-28.js +0 -0
  324. /package/src/plugins/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-29.js +0 -0
  325. /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-30.js +0 -0
  326. /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-31.js +0 -0
@@ -5,22 +5,69 @@ import type { DiagnosticFormat } from "pi-agent-ide/api/tool-config";
5
5
  Linter recipes owned by the lint plugin.
6
6
  */
7
7
  export const LINTER_RECIPES: readonly ToolRecipe[] = [
8
+ recipe(
9
+ "dart-analyze",
10
+ ["dart"],
11
+ ["dart"],
12
+ ["analysis_options.yaml", "pubspec.yaml"],
13
+ [".dart"],
14
+ ["dart", "analyze", "--format", "machine", "{file}"],
15
+ "regex",
16
+ "https://dart.dev/tools/dart-analyze",
17
+ "^(?<severity>[^|]+)\\|[^|]+\\|(?<code>[^|]+)\\|(?<file>[^|]+)\\|(?<line>\\d+)\\|(?<column>\\d+)\\|\\d+\\|(?<message>.*)$",
18
+ undefined,
19
+ [0, 1, 2, 3],
20
+ ),
21
+ recipe(
22
+ "zig-ast-check",
23
+ ["zig"],
24
+ ["zig"],
25
+ ["build.zig", "build.zig.zon", "zls.json"],
26
+ [".zig", ".zon"],
27
+ ["zig", "ast-check", "{file}"],
28
+ "gcc",
29
+ "https://ziglang.org/documentation/master/",
30
+ ),
31
+ recipe(
32
+ "lintr",
33
+ ["r"],
34
+ ["Rscript"],
35
+ [".lintr", "DESCRIPTION"],
36
+ [".r"],
37
+ ["Rscript", "-e", "print(lintr::lint(commandArgs(TRUE)[1]))", "{file}"],
38
+ "regex",
39
+ "https://lintr.r-lib.org/",
40
+ "^(?<file>.+?):(?<line>\\d+):(?<column>\\d+): (?<severity>[^:]+): \\[(?<code>[^\\]]+)\\] (?<message>.*)$",
41
+ ),
8
42
  recipe(
9
43
  "clang-tidy",
10
44
  ["c", "cpp"],
11
45
  ["clang-tidy"],
12
46
  [".clang-tidy", "compile_commands.json"],
13
- [".c", ".h", ".cc", ".cpp", ".cxx", ".hpp"],
47
+ [".c", ".h", ".cc", ".cpp", ".cxx", ".hh", ".hpp", ".hxx"],
14
48
  ["clang-tidy", "{file}"],
15
49
  "clang",
16
50
  "https://clang.llvm.org/extra/clang-tidy/",
17
51
  ),
18
52
  recipe(
19
53
  "eslint",
20
- ["javascript", "typescript"],
54
+ ["javascript", "typescript", "vue", "svelte"],
21
55
  ["eslint"],
22
- ["eslint.config.js", "eslint.config.mjs", ".eslintrc.json"],
23
- [".js", ".jsx", ".mjs", ".cjs", ".ts", ".tsx"],
56
+ [
57
+ "eslint.config.js",
58
+ "eslint.config.mjs",
59
+ "eslint.config.cjs",
60
+ "eslint.config.ts",
61
+ "eslint.config.mts",
62
+ "eslint.config.cts",
63
+ ".eslintrc",
64
+ ".eslintrc.json",
65
+ ".eslintrc.js",
66
+ ".eslintrc.cjs",
67
+ ".eslintrc.yaml",
68
+ ".eslintrc.yml",
69
+ ],
70
+ [".js", ".jsx", ".mjs", ".cjs", ".ts", ".tsx", ".mts", ".cts", ".vue", ".svelte"],
24
71
  ["eslint", "--format", "json", "{file}"],
25
72
  "eslint-json",
26
73
  "https://eslint.org/docs/latest/",
@@ -57,8 +104,15 @@ export const LINTER_RECIPES: readonly ToolRecipe[] = [
57
104
  ["golangci-lint"],
58
105
  [".golangci.yml", ".golangci.yaml", "go.mod"],
59
106
  [".go"],
60
- ["golangci-lint", "run", "{file}"],
61
- "gcc",
107
+ [
108
+ "golangci-lint",
109
+ "run",
110
+ "--output.text.path=",
111
+ "--output.checkstyle.path=stdout",
112
+ "--show-stats=false",
113
+ "./...",
114
+ ],
115
+ "checkstyle",
62
116
  "https://golangci-lint.run/",
63
117
  ),
64
118
  recipe(
@@ -77,9 +131,12 @@ export const LINTER_RECIPES: readonly ToolRecipe[] = [
77
131
  ["dotnet"],
78
132
  [".editorconfig", "global.json"],
79
133
  [".cs"],
80
- ["dotnet", "format", "--verify-no-changes"],
81
- "gcc",
134
+ ["dotnet", "format", "--verify-no-changes", "--include", "{relativeFile}"],
135
+ "regex",
82
136
  "https://learn.microsoft.com/dotnet/core/tools/dotnet-format",
137
+ "^(?<file>.+)\\((?<line>\\d+),(?<column>\\d+)\\): (?<severity>error|warning) (?<code>[^:]+): (?<message>.*?)(?: \\[.*\\])?$",
138
+ undefined,
139
+ [0, 2],
83
140
  ),
84
141
  recipe(
85
142
  "checkstyle",
@@ -87,7 +144,7 @@ export const LINTER_RECIPES: readonly ToolRecipe[] = [
87
144
  ["checkstyle"],
88
145
  ["checkstyle.xml", "pom.xml"],
89
146
  [".java"],
90
- ["checkstyle", "-f", "xml", "{file}"],
147
+ ["checkstyle", "-c", "checkstyle.xml", "-f", "xml", "{file}"],
91
148
  "checkstyle",
92
149
  "https://checkstyle.org/",
93
150
  ),
@@ -97,9 +154,12 @@ export const LINTER_RECIPES: readonly ToolRecipe[] = [
97
154
  ["detekt"],
98
155
  ["detekt.yml", "build.gradle.kts"],
99
156
  [".kt", ".kts"],
100
- ["detekt", "--input", "{file}"],
101
- "gcc",
157
+ ["detekt", "--input", "{file}", "--config", "detekt.yml"],
158
+ "regex",
102
159
  "https://detekt.dev/",
160
+ "^(?<file>.+?):(?<line>\\d+):(?<column>\\d+): (?<message>.*?) \\[(?<code>[^\\]]+)\\]$",
161
+ undefined,
162
+ [0, 2],
103
163
  ),
104
164
  recipe(
105
165
  "rubocop",
@@ -108,8 +168,9 @@ export const LINTER_RECIPES: readonly ToolRecipe[] = [
108
168
  [".rubocop.yml", "Gemfile"],
109
169
  [".rb", ".rake"],
110
170
  ["rubocop", "--format", "clang", "{file}"],
111
- "clang",
171
+ "regex",
112
172
  "https://docs.rubocop.org/",
173
+ "^(?<file>.+?):(?<line>\\d+):(?<column>\\d+): (?<severity>[A-Z]): (?:\\[Correctable\\] )?(?<code>[^:]+): (?<message>.*)$",
113
174
  ),
114
175
  recipe(
115
176
  "phpcs",
@@ -117,9 +178,12 @@ export const LINTER_RECIPES: readonly ToolRecipe[] = [
117
178
  ["phpcs"],
118
179
  ["phpcs.xml", "phpcs.xml.dist", "composer.json"],
119
180
  [".php"],
120
- ["phpcs", "--report=emacs", "{file}"],
121
- "gcc",
181
+ ["phpcs", "--report=checkstyle", "{file}"],
182
+ "checkstyle",
122
183
  "https://github.com/PHPCSStandards/PHP_CodeSniffer",
184
+ undefined,
185
+ undefined,
186
+ [0, 1, 2, 3],
123
187
  ),
124
188
  recipe(
125
189
  "swiftlint",
@@ -127,9 +191,58 @@ export const LINTER_RECIPES: readonly ToolRecipe[] = [
127
191
  ["swiftlint"],
128
192
  [".swiftlint.yml", "Package.swift"],
129
193
  [".swift"],
130
- ["swiftlint", "lint", "--path", "{file}"],
131
- "gcc",
194
+ ["swiftlint", "lint", "--quiet", "--reporter", "checkstyle", "{file}"],
195
+ "checkstyle",
132
196
  "https://github.com/realm/SwiftLint",
197
+ undefined,
198
+ undefined,
199
+ [0, 2],
200
+ ),
201
+ recipe(
202
+ "scalafix",
203
+ ["scala"],
204
+ ["scalafix"],
205
+ [".scalafix.conf"],
206
+ [".scala", ".sc"],
207
+ ["scalafix", "--check", "--files", "{file}"],
208
+ "gcc",
209
+ "https://scalacenter.github.io/scalafix/",
210
+ undefined,
211
+ undefined,
212
+ [0, 2, 64, 66],
213
+ ),
214
+ recipe(
215
+ "credo",
216
+ ["elixir"],
217
+ ["mix"],
218
+ ["mix.exs", ".credo.exs"],
219
+ [".ex", ".exs"],
220
+ ["mix", "credo", "--strict", "--format", "flycheck", "--files-included", "{file}"],
221
+ "regex",
222
+ "https://hexdocs.pm/credo/",
223
+ "^(?<file>.+):(?<line>\\d+):(?<column>\\d+): (?<severity>[A-Z]): (?<message>.+)$",
224
+ undefined,
225
+ Array.from({ length: 32 }, (_value, index) => index),
226
+ ),
227
+ recipe(
228
+ "psscriptanalyzer",
229
+ ["powershell"],
230
+ ["pwsh"],
231
+ ["PSScriptAnalyzerSettings.psd1"],
232
+ [".ps1", ".psm1", ".psd1"],
233
+ [
234
+ "pwsh",
235
+ "-NoProfile",
236
+ "-NonInteractive",
237
+ "-CommandWithArgs",
238
+ '$ErrorActionPreference="Stop";$options=@{};if(Test-Path -LiteralPath PSScriptAnalyzerSettings.psd1){$options.Settings="PSScriptAnalyzerSettings.psd1"};Invoke-ScriptAnalyzer -Path $args[0] @options | ForEach-Object {"$($_.ScriptPath):$($_.Line):$($_.Column): $($_.Severity): $($_.Message) [$($_.RuleName)]"}',
239
+ "{file}",
240
+ ],
241
+ "regex",
242
+ "https://learn.microsoft.com/powershell/module/psscriptanalyzer/invoke-scriptanalyzer",
243
+ "^(?<file>.+):(?<line>\\d+):(?<column>\\d+): (?<severity>\\w+): (?<message>.+) \\[(?<code>[^\\]]+)\\]$",
244
+ undefined,
245
+ [0],
133
246
  ),
134
247
  recipe(
135
248
  "luacheck",
@@ -137,9 +250,12 @@ export const LINTER_RECIPES: readonly ToolRecipe[] = [
137
250
  ["luacheck"],
138
251
  [".luacheckrc"],
139
252
  [".lua"],
140
- ["luacheck", "--formatter", "plain", "{file}"],
141
- "gcc",
253
+ ["luacheck", "--formatter", "plain", "--codes", "--no-color", "{file}"],
254
+ "regex",
142
255
  "https://github.com/lunarmodules/luacheck",
256
+ "^(?<file>.+):(?<line>\\d+):(?<column>\\d+): \\((?<code>(?<severity>[WE])\\d+)\\) (?<message>.+)$",
257
+ undefined,
258
+ [0, 1, 2],
143
259
  ),
144
260
  recipe(
145
261
  "shellcheck",
@@ -158,10 +274,11 @@ export const LINTER_RECIPES: readonly ToolRecipe[] = [
158
274
  ["stylelint.config.js", ".stylelintrc.json"],
159
275
  [".css", ".scss", ".sass", ".less"],
160
276
  ["stylelint", "--formatter", "compact", "{file}"],
161
- "gcc",
277
+ "regex",
162
278
  "https://stylelint.io/",
163
- undefined,
279
+ "^(?<file>.+): line (?<line>\\d+), col (?<column>\\d+), (?<severity>error|warning) - (?<message>.+) \\((?<code>[^)]+)\\)$",
164
280
  ["stylelint"],
281
+ [0, 2],
165
282
  ),
166
283
  recipe(
167
284
  "yamllint",
@@ -170,8 +287,9 @@ export const LINTER_RECIPES: readonly ToolRecipe[] = [
170
287
  [".yamllint", ".yamllint.yml"],
171
288
  [".yaml", ".yml"],
172
289
  ["yamllint", "-f", "parsable", "{file}"],
173
- "gcc",
290
+ "regex",
174
291
  "https://yamllint.readthedocs.io/",
292
+ "^(?<file>.+?):(?<line>\\d+):(?<column>\\d+): \\[(?<severity>[^\\]]+)\\] (?<message>.*?) \\((?<code>[^)]+)\\)$",
175
293
  ),
176
294
  recipe(
177
295
  "markdownlint",
@@ -180,8 +298,9 @@ export const LINTER_RECIPES: readonly ToolRecipe[] = [
180
298
  [".markdownlint.json", ".markdownlint.yaml"],
181
299
  [".md", ".mdx"],
182
300
  ["markdownlint", "{file}"],
183
- "gcc",
301
+ "regex",
184
302
  "https://github.com/DavidAnson/markdownlint",
303
+ "^(?<file>.+?):(?<line>\\d+)(?::(?<column>\\d+))? (?<severity>error|warning) (?<code>MD\\d+)(?:/\\S+)? (?<message>.*)$",
185
304
  ),
186
305
  recipe(
187
306
  "sqlfluff",
@@ -198,10 +317,15 @@ export const LINTER_RECIPES: readonly ToolRecipe[] = [
198
317
  ["dockerfile"],
199
318
  ["hadolint"],
200
319
  [".hadolint.yaml"],
201
- ["*"],
202
- ["hadolint", "--format", "tty", "{file}"],
203
- "gcc",
320
+ [".dockerfile"],
321
+ ["hadolint", "--format", "checkstyle", "{file}"],
322
+ "checkstyle",
204
323
  "https://github.com/hadolint/hadolint",
324
+ undefined,
325
+ undefined,
326
+ [0, 1],
327
+ undefined,
328
+ ["Dockerfile", "Containerfile"],
205
329
  ),
206
330
  recipe(
207
331
  "tflint",
@@ -209,9 +333,12 @@ export const LINTER_RECIPES: readonly ToolRecipe[] = [
209
333
  ["tflint"],
210
334
  [".tflint.hcl"],
211
335
  [".tf"],
212
- ["tflint", "--format", "compact"],
213
- "gcc",
336
+ ["tflint", "--format", "checkstyle"],
337
+ "checkstyle",
214
338
  "https://github.com/terraform-linters/tflint",
339
+ undefined,
340
+ undefined,
341
+ [0, 2],
215
342
  ),
216
343
  recipe(
217
344
  "cmake-lint",
@@ -220,8 +347,13 @@ export const LINTER_RECIPES: readonly ToolRecipe[] = [
220
347
  [".cmake-format.py", "CMakeLists.txt"],
221
348
  [".cmake"],
222
349
  ["cmake-lint", "{file}"],
223
- "gcc",
350
+ "regex",
224
351
  "https://cmake-format.readthedocs.io/",
352
+ "^(?<file>.+?):(?<line>\\d+),(?<column>\\d+): \\[(?<code>(?<severity>[A-Z])\\d+)\\] (?<message>.*)$",
353
+ undefined,
354
+ [0, 1],
355
+ 0,
356
+ ["CMakeLists.txt"],
225
357
  ),
226
358
  recipe(
227
359
  "htmlhint",
@@ -229,19 +361,31 @@ export const LINTER_RECIPES: readonly ToolRecipe[] = [
229
361
  ["htmlhint"],
230
362
  [".htmlhintrc"],
231
363
  [".html", ".htm"],
232
- ["htmlhint", "--format", "unix", "{file}"],
233
- "gcc",
364
+ ["htmlhint", "--format", "checkstyle", "--nocolor", "{file}"],
365
+ "checkstyle",
234
366
  "https://htmlhint.com/",
235
367
  ),
236
368
  recipe(
237
369
  "jsonlint",
238
370
  ["json"],
239
371
  ["jsonlint"],
240
- ["package.json"],
241
- [".json", ".jsonc"],
372
+ [
373
+ ".jsonlintrc",
374
+ ".jsonlintrc.json",
375
+ ".jsonlintrc.yaml",
376
+ ".jsonlintrc.yml",
377
+ ".jsonlintrc.js",
378
+ ".jsonlintrc.cjs",
379
+ "jsonlint.config.js",
380
+ "jsonlint.config.cjs",
381
+ ],
382
+ [".json"],
242
383
  ["jsonlint", "-q", "{file}"],
243
- "gcc",
244
- "https://github.com/zaach/jsonlint",
384
+ "regex",
385
+ "https://github.com/prantlf/jsonlint",
386
+ "^(?:Error: )?(?<message>Parse (?<severity>error) on line (?<line>\\d+)(?:, column (?<column>\\d+))?:[^\\n]*)$",
387
+
388
+ ["@prantlf/jsonlint", "jsonlint"],
245
389
  ),
246
390
  recipe(
247
391
  "taplo-check",
@@ -249,9 +393,10 @@ export const LINTER_RECIPES: readonly ToolRecipe[] = [
249
393
  ["taplo"],
250
394
  ["taplo.toml"],
251
395
  [".toml"],
252
- ["taplo", "check", "{file}"],
253
- "gcc",
396
+ ["taplo", "check", "--colors", "never", "{file}"],
397
+ "regex",
254
398
  "https://taplo.tamasfe.dev/",
399
+ "^(?<severity>error): (?<message>[^\\n]+)\\n\\s*┌─ (?<file>.+):(?<line>\\d+):(?<column>\\d+)",
255
400
  ),
256
401
  recipe(
257
402
  "xmllint",
@@ -260,8 +405,11 @@ export const LINTER_RECIPES: readonly ToolRecipe[] = [
260
405
  [".xmllintrc"],
261
406
  [".xml", ".xsd", ".xsl"],
262
407
  ["xmllint", "--noout", "{file}"],
263
- "gcc",
408
+ "regex",
264
409
  "https://gnome.pages.gitlab.gnome.org/libxml2/xmllint.html",
410
+ "^(?<file>.+?):(?<line>\\d+): (?<severity>(?:parser |validity )?(?:error|warning)) : (?<message>.*)$",
411
+ undefined,
412
+ [0, 1, 2, 3, 4],
265
413
  ),
266
414
  ];
267
415
 
@@ -276,6 +424,10 @@ function recipe(
276
424
  documentation: string,
277
425
  pattern?: string,
278
426
  dependencies?: readonly string[],
427
+ successExitCodes: readonly number[] = [0, 1],
428
+
429
+ columnBase?: 0 | 1,
430
+ fileNames?: readonly string[],
279
431
  ): ToolRecipe {
280
432
  return {
281
433
  id,
@@ -288,8 +440,13 @@ function recipe(
288
440
  ...(dependencies && { dependencies }),
289
441
  linter: {
290
442
  extensions,
291
- check: { command, successExitCodes: [0, 1] },
292
- diagnostics: { format, ...(pattern && { pattern }) },
443
+ ...(fileNames && { fileNames }),
444
+ check: { command, successExitCodes },
445
+ diagnostics: {
446
+ format,
447
+ ...(pattern && { pattern }),
448
+ ...(columnBase !== undefined && { columnBase }),
449
+ },
293
450
  },
294
451
  };
295
452
  }
@@ -1,3 +1,5 @@
1
+ import path from "node:path";
2
+ import { fileURLToPath } from "node:url";
1
3
  import { runConfiguredProcess } from "pi-agent-ide/api/tool-config";
2
4
 
3
5
  import { parseDiagnostics } from "./diagnostics.js";
@@ -36,7 +38,12 @@ export async function runConfiguredLinter(
36
38
  };
37
39
  }
38
40
 
39
- const output = result.stdout.trim().length > 0 ? result.stdout : result.stderr;
41
+ const output =
42
+ config.diagnostics.format === "regex" || config.diagnostics.format === "clang"
43
+ ? [result.stdout, result.stderr].filter((stream) => stream.trim().length > 0).join("\n")
44
+ : result.stdout.trim().length > 0
45
+ ? result.stdout
46
+ : result.stderr;
40
47
  let diagnostics: Diagnostic[];
41
48
 
42
49
  try {
@@ -49,10 +56,23 @@ export async function runConfiguredLinter(
49
56
  };
50
57
  }
51
58
 
59
+ const ok = result.ok && (result.exitCode === 0 || diagnostics.length > 0);
60
+
61
+ const workingDirectory =
62
+ config.check.cwd === "file" ? path.dirname(context.filePath) : context.projectRoot;
63
+ diagnostics = diagnostics
64
+ .filter((diagnostic) => {
65
+ if (diagnostic.file === undefined) return true;
66
+ const file = diagnostic.file.startsWith("file:")
67
+ ? fileURLToPath(diagnostic.file)
68
+ : diagnostic.file;
69
+ return path.resolve(workingDirectory, file) === path.resolve(context.filePath);
70
+ })
71
+ .map(({ file: _file, ...diagnostic }) => diagnostic);
52
72
  return {
53
- ok: result.ok,
73
+ ok,
54
74
  diagnostics,
55
- ...(!result.ok && {
75
+ ...(!ok && {
56
76
  failure:
57
77
  result.stderr.trim().slice(0, 200) || `command exited with code ${String(result.exitCode)}`,
58
78
  }),
@@ -28,7 +28,7 @@ export function parseDiagnostics(output: string, config: DiagnosticParserConfig)
28
28
  return parseCompilerLines(output);
29
29
  }
30
30
  case "regex": {
31
- return parseRegexLines(output, requiredValue(config.pattern));
31
+ return parseRegexLines(output, requiredValue(config.pattern), config.columnBase ?? 1);
32
32
  }
33
33
  }
34
34
  }
@@ -39,9 +39,16 @@ function parsePiJson(output: string): Diagnostic[] {
39
39
  }
40
40
 
41
41
  function parseEslintJson(output: string): Diagnostic[] {
42
- const files = JSON.parse(output) as { messages?: unknown }[];
42
+ const files = JSON.parse(output) as { filePath?: string; messages?: unknown }[];
43
43
  return files.flatMap((file) =>
44
- Array.isArray(file.messages) ? file.messages.flatMap(normalizeDiagnostic) : [],
44
+ Array.isArray(file.messages)
45
+ ? file.messages.flatMap((message) =>
46
+ normalizeDiagnostic(message).map((diagnostic) => ({
47
+ ...diagnostic,
48
+ ...(file.filePath && { file: file.filePath }),
49
+ })),
50
+ )
51
+ : [],
45
52
  );
46
53
  }
47
54
 
@@ -49,16 +56,22 @@ function parseSarif(output: string): Diagnostic[] {
49
56
  const sarif = JSON.parse(output) as { runs?: { results?: Record<string, unknown>[] }[] };
50
57
  return (sarif.runs ?? []).flatMap((run) =>
51
58
  (run.results ?? []).flatMap((result) => {
52
- const location =
53
- (
54
- result.locations as
55
- | { physicalLocation?: { region?: Record<string, unknown> } }[]
56
- | undefined
57
- )?.[0]?.physicalLocation?.region ?? {};
59
+ const location = (
60
+ result.locations as
61
+ | {
62
+ physicalLocation?: {
63
+ region?: Record<string, unknown>;
64
+ artifactLocation?: { uri?: string };
65
+ };
66
+ }[]
67
+ | undefined
68
+ )?.[0]?.physicalLocation;
69
+ const region = location?.region ?? {};
58
70
  const message = result.message as { text?: unknown } | undefined;
59
71
  return normalizeDiagnostic({
60
- line: location.startLine,
61
- column: location.startColumn,
72
+ file: location?.artifactLocation?.uri,
73
+ line: region.startLine,
74
+ column: region.startColumn,
62
75
  message: message?.text,
63
76
  code: result.ruleId,
64
77
  severity: sarifSeverity(result.level),
@@ -69,37 +82,52 @@ function parseSarif(output: string): Diagnostic[] {
69
82
 
70
83
  function parseCheckstyle(output: string): Diagnostic[] {
71
84
  const diagnostics: Diagnostic[] = [];
72
- const pattern = /<error\s+([^>]+?)\/?>(?:<\/error>)?/gu;
73
-
74
- for (const match of output.matchAll(pattern)) {
75
- const attributes = Object.fromEntries(
76
- [...requiredValue(match[1]).matchAll(/([\w-]+)="([^"]*)"/gu)].map((item) => [
77
- requiredValue(item[1]),
78
- decodeXml(requiredValue(item[2])),
79
- ]),
80
- );
81
- diagnostics.push(
82
- ...normalizeDiagnostic({
83
- line: Number(attributes.line),
84
- column: Number(attributes.column ?? 1),
85
- message: attributes.message,
86
- code: attributes.source,
87
- severity: attributes.severity,
88
- }),
89
- );
85
+ for (const file of output.matchAll(/<file\s+([^>]+)>([\s\S]*?)<\/file>/gu)) {
86
+ const name = xmlAttributes(requiredValue(file[1])).name;
87
+ for (const error of requiredValue(file[2]).matchAll(/<error\s+([^>]+?)\/?>(?:<\/error>)?/gu)) {
88
+ const attributes = xmlAttributes(requiredValue(error[1]));
89
+ diagnostics.push(
90
+ ...normalizeDiagnostic({
91
+ file: name,
92
+ line: Number(attributes.line),
93
+ column: Number(attributes.column ?? 1),
94
+ message: attributes.message,
95
+ code: attributes.source,
96
+ severity: attributes.severity,
97
+ }),
98
+ );
99
+ }
90
100
  }
91
-
92
101
  return diagnostics;
93
102
  }
94
103
 
104
+ function xmlAttributes(value: string): Record<string, string> {
105
+ return Object.fromEntries(
106
+ [...value.matchAll(/([\w-]+)="([^"]*)"/gu)].map((item) => [
107
+ requiredValue(item[1]),
108
+ decodeXml(requiredValue(item[2])),
109
+ ]),
110
+ );
111
+ }
112
+
95
113
  function parseCompilerLines(output: string): Diagnostic[] {
96
114
  const pattern =
97
115
  /^(?<file>.+?):(?<line>\d+):(?<column>\d+):\s*(?<severity>fatal error|error|warning|note|info|hint):\s*(?<message>.*?)(?:\s+\[(?<code>[^\]]+)\])?$/u;
98
116
  return parseMatchingLines(output, pattern);
99
117
  }
100
118
 
101
- function parseRegexLines(output: string, source: string): Diagnostic[] {
102
- return parseMatchingLines(output, new RegExp(source, "u"));
119
+ function parseRegexLines(output: string, source: string, columnBase: 0 | 1): Diagnostic[] {
120
+ return [...output.replaceAll("\r\n", "\n").matchAll(new RegExp(source, "gmu"))].flatMap(
121
+ (match) => {
122
+ if (match.groups === undefined) return [];
123
+ return normalizeDiagnostic({
124
+ ...match.groups,
125
+ ...(match.groups.column !== undefined && {
126
+ column: Number(match.groups.column) + (1 - columnBase),
127
+ }),
128
+ });
129
+ },
130
+ );
103
131
  }
104
132
 
105
133
  function parseMatchingLines(output: string, pattern: RegExp): Diagnostic[] {
@@ -130,6 +158,7 @@ function normalizeDiagnostic(value: unknown): Diagnostic[] {
130
158
 
131
159
  return [
132
160
  {
161
+ ...(typeof item.file === "string" && { file: item.file }),
133
162
  code: stringValue(item.code ?? item.ruleId, "lint"),
134
163
  message,
135
164
  line,
@@ -153,7 +182,12 @@ function severityValue(value: unknown): Diagnostic["severity"] {
153
182
  if (value === 1) return "warning";
154
183
  const normalized = stringValue(value, "warning").toLowerCase();
155
184
 
156
- if (normalized.includes("error")) {
185
+ if (
186
+ normalized.includes("error") ||
187
+ normalized === "e" ||
188
+ normalized === "f" ||
189
+ normalized === "fatal"
190
+ ) {
157
191
  return "error";
158
192
  }
159
193
 
@@ -174,6 +208,12 @@ function sarifSeverity(value: unknown): string {
174
208
 
175
209
  function decodeXml(value: string): string {
176
210
  return value
211
+ .replace(/&#(x[0-9a-f]+|\d+);/giu, (entity, digits: string) => {
212
+ const code = digits.toLowerCase().startsWith("x")
213
+ ? Number.parseInt(digits.slice(1), 16)
214
+ : Number(digits);
215
+ return code <= 0x10ffff ? String.fromCodePoint(code) : entity;
216
+ })
177
217
  .replaceAll("&quot;", '"')
178
218
  .replaceAll("&apos;", "'")
179
219
  .replaceAll("&lt;", "<")
@@ -1,9 +1,10 @@
1
- import path from "node:path";
1
+ import { inspectRecipeEvidence } from "pi-agent-doctor/api/evidence";
2
+ import { LINTER_RECIPES } from "./catalog.js";
2
3
 
3
4
  import {
4
5
  hasConfiguredExecutable,
5
6
  loadLayeredToolConfig,
6
- matchesConfiguredFile,
7
+ selectConfiguredEntry,
7
8
  parseLintersConfig,
8
9
  } from "pi-agent-ide/api/tool-config";
9
10
 
@@ -21,6 +22,8 @@ export class LintCommandRegistry {
21
22
  private constructor(
22
23
  private readonly linters: readonly EffectiveToolConfigEntry<LinterCommandConfig>[],
23
24
  private readonly availableBuiltIns: ReadonlySet<string>,
25
+
26
+ private readonly evidence: ReadonlyMap<string, { readonly score: number }> = new Map(),
24
27
  ) {}
25
28
 
26
29
  /**
@@ -45,9 +48,17 @@ export class LintCommandRegistry {
45
48
  available: await hasConfiguredExecutable(entry.config.check, directory, environment),
46
49
  })),
47
50
  );
51
+ const evidence = await inspectRecipeEvidence(directory, LINTER_RECIPES);
52
+ const entries = [...effective.entries].sort((left, right) =>
53
+ left.layer === "built-in" && right.layer === "built-in"
54
+ ? (evidence.get(right.id)?.score ?? 0) - (evidence.get(left.id)?.score ?? 0)
55
+ : 0,
56
+ );
48
57
  return new LintCommandRegistry(
49
- effective.entries,
58
+ entries,
50
59
  new Set(available.filter((entry) => entry.available).map((entry) => entry.id)),
60
+
61
+ evidence,
51
62
  );
52
63
  }
53
64
 
@@ -80,11 +91,12 @@ export class LintCommandRegistry {
80
91
  filePath: string,
81
92
  projectRoot: string,
82
93
  ): EffectiveToolConfigEntry<LinterCommandConfig> | undefined {
83
- const absolute = path.isAbsolute(filePath) ? filePath : path.join(projectRoot, filePath);
84
- return this.linters.find(
85
- (linter) =>
86
- (linter.layer !== "built-in" || this.availableBuiltIns.has(linter.id)) &&
87
- matchesConfiguredFile(linter.config, absolute, projectRoot),
94
+ return selectConfiguredEntry(
95
+ this.linters,
96
+ this.availableBuiltIns,
97
+ this.evidence,
98
+ filePath,
99
+ projectRoot,
88
100
  );
89
101
  }
90
102