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.
- package/CHANGELOG.md +57 -0
- package/dist/{chunk-XNXQYPVT.js → chunk-4LUW26BX.js} +1 -1
- package/dist/{chunk-2ZMYT6ZC.js → chunk-4U6KGABH.js} +1 -1
- package/dist/chunk-4ZTEPMJO.js +14 -0
- package/dist/{chunk-KNMWCDDK.js → chunk-6ACQQBUY.js} +1 -1
- package/dist/chunk-76WHES5H.js +7 -0
- package/dist/chunk-BHSO2MDK.js +6 -0
- package/dist/chunk-BMOJTJJJ.js +3 -0
- package/dist/chunk-GFWDXTOB.js +4 -0
- package/dist/{chunk-VSP2QQPQ.js → chunk-GIRAEVUJ.js} +1 -1
- package/dist/chunk-JJVXUL5U.js +2 -0
- package/dist/chunk-KCEOTU5Z.js +3 -0
- package/dist/chunk-KVGQG43U.js +1 -0
- package/dist/{chunk-MTTKFJV6.js → chunk-LQYZG62K.js} +1 -1
- package/dist/chunk-N34ATN52.js +1 -0
- package/dist/{chunk-PETQCA7G.js → chunk-P6T3Q7LB.js} +1 -1
- package/dist/chunk-QIJMV2P2.js +2 -0
- package/dist/chunk-QJFRAMK7.js +2 -0
- package/dist/{chunk-2SKAED2I.js → chunk-RAZOACDD.js} +2 -2
- package/dist/chunk-RIGRP3FD.js +1 -0
- package/dist/chunk-S3ZPXWX7.js +2 -0
- package/dist/{chunk-266RH77Z.js → chunk-THSCUT2L.js} +1 -1
- package/dist/{chunk-EEH4WYI7.js → chunk-WNMGUALD.js} +1 -1
- package/dist/chunk-WZI4YC2O.js +1 -0
- package/dist/{chunk-5A25RATC.js → chunk-X6MPU7UO.js} +3 -3
- package/dist/{chunk-QNZVPFSP.js → chunk-XF5PVZOS.js} +1 -1
- package/dist/{chunk-SJYDLHEF.js → chunk-ZXN3TWWW.js} +1 -1
- package/dist/entry-0.js +1 -1
- package/dist/entry-10.js +1 -1
- package/dist/entry-11.js +1 -1
- package/dist/entry-13.js +1 -1
- package/dist/entry-14.js +1 -1
- package/dist/entry-18.js +1 -1
- package/dist/entry-19.js +1 -1
- package/dist/entry-20.js +1 -1
- package/dist/entry-21.js +2 -1
- package/dist/entry-22.js +1 -1
- package/dist/entry-23.js +1 -1
- package/dist/entry-24.js +1 -1
- package/dist/entry-25.js +1 -1
- package/dist/entry-26.js +7 -1
- package/dist/entry-27.js +1 -1
- package/dist/entry-28.js +1 -1
- package/dist/entry-29.js +1 -1
- package/dist/entry-30.js +1 -1
- package/dist/entry-31.js +4 -1
- package/dist/entry-32.js +8 -1
- package/dist/entry-33.js +1 -1
- package/dist/entry-34.js +1 -1
- package/dist/entry-35.js +1 -1
- package/dist/entry-36.js +1 -1
- package/dist/entry-37.js +1 -1
- package/dist/entry-38.js +1 -1
- package/dist/entry-39.js +1 -1
- package/dist/entry-4.js +1 -1
- package/dist/entry-40.js +14 -1
- package/dist/entry-41.js +1 -1
- package/dist/entry-42.js +1 -1
- package/dist/entry-43.js +1 -1
- package/dist/entry-44.js +1 -1
- package/dist/entry-45.js +7 -1
- package/dist/entry-46.js +11 -1
- package/dist/entry-47.js +1 -1
- package/dist/entry-48.js +1 -1
- package/dist/entry-49.js +1 -1
- package/dist/entry-50.js +1 -1
- package/dist/entry-51.js +1 -1
- package/dist/entry-52.js +1 -1
- package/dist/entry-53.js +1 -0
- package/dist/entry-54.js +0 -1
- package/dist/entry-55.js +1 -0
- package/dist/entry-56.js +0 -1
- package/dist/entry-57.js +1 -1
- package/dist/entry-58.js +1 -1
- package/dist/entry-59.js +1 -1
- package/dist/entry-60.js +1 -1
- package/dist/entry-61.js +1 -1
- package/dist/entry-62.js +1 -0
- package/dist/entry-63.js +0 -1
- package/dist/entry-64.js +1 -0
- package/dist/entry-65.js +0 -1
- package/dist/entry-66.js +1 -1
- package/dist/entry-67.js +1 -1
- package/dist/entry-68.js +1 -1
- package/dist/entry-69.js +59 -1
- package/dist/entry-70.js +4 -1
- package/dist/entry-71.js +1 -1
- package/dist/entry-72.js +29 -1
- package/dist/entry-73.js +2 -1
- package/dist/entry-74.js +1 -1
- package/dist/entry-75.js +1 -1
- package/dist/entry-76.js +1 -1
- package/dist/entry-77.js +3 -1
- package/dist/entry-78.js +1 -1
- package/dist/entry-79.js +1 -1
- package/dist/entry-80.js +1 -0
- package/dist/pi-agent-ide.js +2 -13
- package/docs/configuration.md +57 -1
- package/docs/extensions.md +4 -2
- package/docs/generated/tool-catalog/cmake.md +5 -5
- package/docs/generated/tool-catalog/csharp.md +5 -5
- package/docs/generated/tool-catalog/css.md +7 -7
- package/docs/generated/tool-catalog/dart.md +9 -0
- package/docs/generated/tool-catalog/dockerfile.md +5 -5
- package/docs/generated/tool-catalog/elixir.md +9 -0
- package/docs/generated/tool-catalog/html.md +7 -6
- package/docs/generated/tool-catalog/index.md +9 -0
- package/docs/generated/tool-catalog/javascript.md +8 -8
- package/docs/generated/tool-catalog/json.md +7 -7
- package/docs/generated/tool-catalog/julia.md +8 -0
- package/docs/generated/tool-catalog/kotlin.md +6 -5
- package/docs/generated/tool-catalog/markdown.md +6 -6
- package/docs/generated/tool-catalog/powershell.md +9 -0
- package/docs/generated/tool-catalog/python.md +6 -6
- package/docs/generated/tool-catalog/r.md +9 -0
- package/docs/generated/tool-catalog/scala.md +9 -0
- package/docs/generated/tool-catalog/svelte.md +9 -0
- package/docs/generated/tool-catalog/typescript.md +9 -8
- package/docs/generated/tool-catalog/vue.md +9 -0
- package/docs/generated/tool-catalog/yaml.md +6 -6
- package/docs/generated/tool-catalog/zig.md +9 -0
- package/docs/tools.md +1 -1
- package/node_modules/pi-agent-doctor/package.json +10 -3
- package/node_modules/pi-agent-doctor/runtime/entry-20.js +1 -0
- package/node_modules/pi-agent-doctor/src/catalog.ts +27 -1
- package/node_modules/pi-agent-doctor/src/evidence.ts +118 -0
- package/node_modules/pi-agent-doctor/src/executable.ts +63 -17
- package/node_modules/pi-agent-filesystem/index.ts +2 -2
- package/node_modules/pi-agent-filesystem/package.json +7 -7
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/runtime/entry-24.js +2 -0
- package/node_modules/pi-agent-ide-ast/package.json +11 -11
- package/node_modules/pi-agent-ide-ast/runtime/entry-25.js +0 -1
- package/node_modules/pi-agent-ide-ast/runtime/entry-26.js +2 -0
- package/node_modules/pi-agent-ide-ast/src/ast/manager.ts +3 -0
- package/node_modules/pi-agent-ide-ast/src/ast/outline.ts +92 -19
- package/node_modules/pi-agent-ide-ast/src/extension.ts +9 -14
- package/node_modules/pi-agent-ide-ast/src/overflow-handler.ts +60 -0
- package/node_modules/pi-agent-ide-ast/src/scope-resolver.ts +1 -1
- package/node_modules/pi-agent-ide-changes/index.ts +1 -5
- package/node_modules/pi-agent-ide-changes/package.json +8 -8
- package/node_modules/pi-agent-ide-changes/runtime/entry-27.js +0 -1
- package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +1 -7
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +1 -5
- package/node_modules/pi-agent-ide-formatter/package.json +4 -4
- package/node_modules/pi-agent-ide-formatter/src/catalog.ts +131 -13
- package/node_modules/pi-agent-ide-formatter/src/formatter.ts +12 -7
- package/node_modules/pi-agent-ide-formatter/src/registry.ts +20 -8
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-languages/src/languages.ts +15 -0
- package/node_modules/pi-agent-ide-lint/index.ts +4 -1
- package/node_modules/pi-agent-ide-lint/package.json +8 -8
- package/node_modules/pi-agent-ide-lint/src/catalog.ts +196 -39
- package/node_modules/pi-agent-ide-lint/src/command-linter.ts +23 -3
- package/node_modules/pi-agent-ide-lint/src/diagnostics.ts +73 -33
- package/node_modules/pi-agent-ide-lint/src/registry.ts +20 -8
- package/node_modules/pi-agent-ide-lsp/index.ts +1 -12
- package/node_modules/pi-agent-ide-lsp/package.json +9 -9
- package/node_modules/pi-agent-ide-lsp/runtime/entry-32.js +2 -0
- package/node_modules/pi-agent-ide-lsp/src/catalog.ts +161 -7
- package/node_modules/pi-agent-ide-lsp/src/diagnostic-source.ts +10 -10
- package/node_modules/pi-agent-ide-lsp/src/doctor-plugin.ts +2 -4
- package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +162 -12
- package/node_modules/pi-agent-ide-lsp/src/lsp/file-watchers.ts +88 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/initialization-options.ts +14 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +8 -4
- package/node_modules/pi-agent-ide-lsp/src/lsp/registry.ts +69 -34
- package/node_modules/pi-agent-ide-lsp/src/lsp/transport-writer.ts +24 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/types.ts +5 -0
- package/node_modules/pi-agent-image/package.json +3 -3
- package/node_modules/pi-agent-image/src/image-converter.ts +1 -1
- package/node_modules/pi-agent-invariant/package.json +2 -2
- package/node_modules/pi-agent-pdf/package.json +3 -3
- package/node_modules/pi-agent-pdf/src/pdf-converter.ts +1 -1
- package/node_modules/pi-agent-read/package.json +11 -11
- package/node_modules/pi-agent-read/runtime/entry-39.js +0 -1
- package/node_modules/pi-agent-read/runtime/entry-40.js +2 -0
- package/node_modules/pi-agent-read/src/api/rendering.ts +3 -0
- package/node_modules/pi-agent-read/src/core/read-core.ts +6 -26
- package/node_modules/pi-agent-read/src/core/tools/read/native-resource-renderer.ts +74 -0
- package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +28 -7
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +35 -30
- package/node_modules/pi-agent-resource/package.json +2 -2
- package/node_modules/pi-agent-resource/src/content-conversion/content-description.ts +1 -8
- package/node_modules/pi-agent-search/package.json +7 -7
- package/node_modules/pi-agent-search/runtime/entry-44.js +0 -1
- package/node_modules/pi-agent-search/src/core/extension.ts +7 -5
- package/node_modules/pi-agent-search/src/core/search-core.ts +10 -0
- package/node_modules/pi-agent-search-text/index.ts +42 -33
- package/node_modules/pi-agent-search-text/package.json +9 -9
- package/node_modules/pi-agent-search-text/runtime/entry-46.js +1 -0
- package/node_modules/pi-agent-search-text/src/file-search.ts +9 -1
- package/node_modules/pi-agent-search-text/src/resolvers.ts +1 -1
- package/node_modules/pi-agent-search-text/src/search-recipe.ts +2 -0
- package/node_modules/pi-agent-search-text/src/search-session.ts +48 -0
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text/runtime/entry-48.js +1 -0
- package/node_modules/pi-agent-text/src/text-converter.ts +1 -1
- package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-49.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/package.json +5 -5
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-50.js +0 -1
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-51.js +2 -0
- package/node_modules/pi-agent-text-anchor-line-hash/index.ts +2 -6
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-52.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-53.js +2 -0
- package/node_modules/pi-agent-text-editor/package.json +22 -22
- package/node_modules/pi-agent-text-editor/runtime/entry-68.js +0 -1
- package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +3 -0
- package/node_modules/pi-agent-text-editor/src/api/post-edit.ts +71 -1
- package/node_modules/pi-agent-text-editor/src/core/builtin-edit-filter.ts +4 -12
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +7 -9
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +27 -2
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +38 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +81 -0
- package/node_modules/pi-agent-text-editor/src/core/text-anchor-registry.ts +5 -2
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +23 -0
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +5 -9
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +54 -14
- package/node_modules/pi-agent-text-editor/src/tools/text-selection.ts +45 -43
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +18 -8
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +7 -4
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +13 -5
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +18 -8
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +9 -5
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +2 -1
- package/node_modules/pi-agent-text-editor-argument-order/package.json +3 -3
- package/node_modules/pi-agent-text-editor-overwrite/package.json +4 -4
- package/node_modules/pi-agent-text-editor-renderer/index.ts +5 -1
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
- package/node_modules/pi-agent-text-editor-renderer/src/diff-model.ts +7 -0
- package/node_modules/pi-agent-text-editor-renderer/src/diff-renderer.ts +1 -1
- package/node_modules/pi-agent-text-editor-renderer/src/diff-viewport.ts +11 -2
- package/node_modules/pi-agent-text-editor-renderer/src/frozen-viewport.ts +140 -52
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +52 -4
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-result.ts +53 -1
- package/node_modules/pi-agent-text-editor-renderer/src/persisted-result.ts +8 -2
- package/node_modules/pi-agent-text-editor-renderer/src/render-resource.ts +10 -0
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +5 -3
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +2 -0
- package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
- package/node_modules/pi-agent-tool-call-interception/src/index.ts +3 -0
- package/node_modules/pi-agent-tool-ui/package.json +2 -2
- package/node_modules/pi-agent-tool-ui/runtime/entry-75.js +1 -0
- package/node_modules/pi-agent-web/index.ts +1 -6
- package/node_modules/pi-agent-web/package.json +7 -7
- package/node_modules/pi-agent-web-html/package.json +3 -3
- package/node_modules/pi-agent-web-html/src/html-converter.ts +1 -1
- package/node_modules/pi-agent-web-image/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-80.js +2 -0
- package/package.json +35 -35
- package/src/api/plugin-protocol.ts +2 -0
- package/src/api/text-editor.ts +7 -0
- package/src/api/tool-config/formatters.json +70 -12
- package/src/api/tool-config/linters.json +148 -66
- package/src/api/tool-config/lsp-servers.json +142 -7
- package/src/api/tool-config.ts +60 -24
- package/src/code-view/diagnostic-view.ts +14 -10
- package/src/composite/builtin-extensions.ts +148 -66
- package/src/composite/extensions-config.ts +18 -0
- package/src/core/diagnostic-entry.ts +94 -0
- package/src/core/diagnostic-store.ts +43 -21
- package/src/core/extension.ts +39 -17
- package/src/doctor/config-writer.ts +14 -1
- package/src/doctor/discovery.ts +13 -68
- package/src/doctor/run.ts +33 -1
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +2 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-24.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-21.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +1 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +7 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/src/html-converter.ts +1 -1
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-80.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-76.js +2 -0
- package/src/extensions/pi-agent-read/package.json +11 -11
- package/src/extensions/pi-agent-read/runtime/entry-39.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-40.js +2 -0
- package/src/extensions/pi-agent-read/src/api/rendering.ts +3 -0
- package/src/extensions/pi-agent-read/src/core/read-core.ts +6 -26
- package/src/extensions/pi-agent-read/src/core/tools/read/native-resource-renderer.ts +74 -0
- package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +28 -7
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +35 -30
- package/src/extensions/pi-agent-search/package.json +7 -7
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +42 -33
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +9 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-46.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-47.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/file-search.ts +9 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +1 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +2 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +48 -0
- package/src/extensions/pi-agent-search/runtime/entry-44.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-45.js +2 -0
- package/src/extensions/pi-agent-search/src/core/extension.ts +7 -5
- package/src/extensions/pi-agent-search/src/core/search-core.ts +10 -0
- package/src/extensions/pi-agent-text-editor/package.json +22 -22
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-49.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-50.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-51.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +2 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-52.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-53.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/package.json +3 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/package.json +4 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +5 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-model.ts +7 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-renderer.ts +1 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-viewport.ts +11 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/frozen-viewport.ts +140 -52
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +52 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-result.ts +53 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/persisted-result.ts +8 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/render-resource.ts +10 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +5 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +2 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-68.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-69.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +3 -0
- package/src/extensions/pi-agent-text-editor/src/api/post-edit.ts +71 -1
- package/src/extensions/pi-agent-text-editor/src/core/builtin-edit-filter.ts +4 -12
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +7 -9
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +27 -2
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +38 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +81 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-anchor-registry.ts +5 -2
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +23 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +5 -9
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +54 -14
- package/src/extensions/pi-agent-text-editor/src/tools/text-selection.ts +45 -43
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +18 -8
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +7 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +13 -5
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +18 -8
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +9 -5
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +2 -1
- package/src/pi-agent-ide.ts +11 -0
- package/src/plugins/pi-agent-ide-ast/package.json +11 -11
- package/src/plugins/pi-agent-ide-ast/runtime/entry-25.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-26.js +2 -0
- package/src/plugins/pi-agent-ide-ast/src/ast/manager.ts +3 -0
- package/src/plugins/pi-agent-ide-ast/src/ast/outline.ts +92 -19
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +9 -14
- package/src/plugins/pi-agent-ide-ast/src/overflow-handler.ts +60 -0
- package/src/plugins/pi-agent-ide-ast/src/scope-resolver.ts +1 -1
- package/src/plugins/pi-agent-ide-changes/index.ts +1 -5
- package/src/plugins/pi-agent-ide-changes/package.json +8 -8
- package/src/plugins/pi-agent-ide-changes/runtime/entry-27.js +0 -1
- package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +1 -7
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +1 -5
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +1 -8
- package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
- package/src/plugins/pi-agent-ide-formatter/src/catalog.ts +131 -13
- package/src/plugins/pi-agent-ide-formatter/src/formatter.ts +12 -7
- package/src/plugins/pi-agent-ide-formatter/src/registry.ts +20 -8
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-languages/src/languages.ts +15 -0
- package/src/plugins/pi-agent-ide-lint/index.ts +4 -1
- package/src/plugins/pi-agent-ide-lint/package.json +8 -8
- package/src/plugins/pi-agent-ide-lint/src/catalog.ts +196 -39
- package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +23 -3
- package/src/plugins/pi-agent-ide-lint/src/diagnostics.ts +73 -33
- package/src/plugins/pi-agent-ide-lint/src/registry.ts +20 -8
- package/src/plugins/pi-agent-ide-lsp/index.ts +1 -12
- package/src/plugins/pi-agent-ide-lsp/package.json +9 -9
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-32.js +2 -0
- package/src/plugins/pi-agent-ide-lsp/src/catalog.ts +161 -7
- package/src/plugins/pi-agent-ide-lsp/src/diagnostic-source.ts +10 -10
- package/src/plugins/pi-agent-ide-lsp/src/doctor-plugin.ts +2 -4
- package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +162 -12
- package/src/plugins/pi-agent-ide-lsp/src/lsp/file-watchers.ts +88 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/initialization-options.ts +14 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +8 -4
- package/src/plugins/pi-agent-ide-lsp/src/lsp/registry.ts +69 -34
- package/src/plugins/pi-agent-ide-lsp/src/lsp/transport-writer.ts +24 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/types.ts +5 -0
- package/src/post-edit/gate.ts +44 -15
- package/src/toolchain/types.ts +4 -0
- package/dist/chunk-34ZQTTU2.js +0 -2
- package/dist/chunk-476MR2QB.js +0 -1
- package/dist/chunk-4KQOODGE.js +0 -13
- package/dist/chunk-4SQQKEVD.js +0 -16
- package/dist/chunk-52BM6J6I.js +0 -6
- package/dist/chunk-5BWUVAR4.js +0 -1
- package/dist/chunk-6DN7NO7L.js +0 -1
- package/dist/chunk-6SMFVLTY.js +0 -1
- package/dist/chunk-7NDBZ4WX.js +0 -1
- package/dist/chunk-AP7Z3VWC.js +0 -1
- package/dist/chunk-BYWAG6X3.js +0 -6
- package/dist/chunk-E4SECPF4.js +0 -1
- package/dist/chunk-EW2KVKCN.js +0 -2
- package/dist/chunk-F6SESI3P.js +0 -4
- package/dist/chunk-GTK5AREE.js +0 -2
- package/dist/chunk-HOBTFFQR.js +0 -1
- package/dist/chunk-IMVCVPMP.js +0 -3
- package/dist/chunk-IOCABSRL.js +0 -1
- package/dist/chunk-KP37XTDI.js +0 -1
- package/dist/chunk-KYVOMBO5.js +0 -1
- package/dist/chunk-LFV6G5Z3.js +0 -1
- package/dist/chunk-MB6VVVAF.js +0 -2
- package/dist/chunk-NI2NK4JU.js +0 -1
- package/dist/chunk-OIL6BB2S.js +0 -33
- package/dist/chunk-PODWLGNO.js +0 -6
- package/dist/chunk-QW5O42QJ.js +0 -2
- package/dist/chunk-SSZB66C3.js +0 -3
- package/dist/chunk-TG6H6EOI.js +0 -1
- package/dist/chunk-TNWYEXFG.js +0 -1
- package/dist/chunk-U4D6FT66.js +0 -1
- package/dist/chunk-VUNCBASK.js +0 -10
- package/dist/chunk-VWVLBOMU.js +0 -8
- package/dist/chunk-W3XYKJ5H.js +0 -1
- package/dist/chunk-XGUAL3CA.js +0 -1
- package/dist/chunk-YQTLJ5ZV.js +0 -58
- package/node_modules/pi-agent-filesystem/runtime/entry-20.js +0 -2
- package/node_modules/pi-agent-ide-ast/runtime/entry-24.js +0 -1
- package/node_modules/pi-agent-ide-changes/runtime/entry-26.js +0 -1
- package/node_modules/pi-agent-image/runtime/entry-32.js +0 -1
- package/node_modules/pi-agent-read/src/core/tools/read/views.ts +0 -29
- package/node_modules/pi-agent-resource/runtime/entry-40.js +0 -1
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-48.js +0 -2
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-49.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-51.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-53.js +0 -1
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-73.js +0 -1
- package/node_modules/pi-agent-web/runtime/entry-75.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-21.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-20.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-76.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-75.js +0 -2
- package/src/extensions/pi-agent-read/runtime/entry-35.js +0 -1
- package/src/extensions/pi-agent-read/src/core/tools/read/views.ts +0 -29
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-45.js +0 -2
- package/src/extensions/pi-agent-search/runtime/entry-41.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-48.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-49.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-51.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/runtime/entry-69.js +0 -2
- package/src/extensions/pi-agent-text-editor/runtime/entry-53.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-24.js +0 -1
- package/src/plugins/pi-agent-ide-changes/runtime/entry-26.js +0 -1
- /package/node_modules/{pi-agent-filesystem-image → pi-agent-filesystem}/runtime/entry-21.js +0 -0
- /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-22.js +0 -0
- /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-23.js +0 -0
- /package/node_modules/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-28.js +0 -0
- /package/node_modules/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-29.js +0 -0
- /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-30.js +0 -0
- /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-31.js +0 -0
- /package/node_modules/{pi-agent-invariant → pi-agent-image}/runtime/entry-33.js +0 -0
- /package/node_modules/{pi-agent-pdf → pi-agent-invariant}/runtime/entry-34.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-35.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-41.js +0 -0
- /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-45.js +0 -0
- /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-47.js +0 -0
- /package/node_modules/{pi-agent-text-editor-argument-order → pi-agent-text-editor}/runtime/entry-69.js +0 -0
- /package/node_modules/{pi-agent-text-editor-overwrite → pi-agent-text-editor-argument-order}/runtime/entry-70.js +0 -0
- /package/node_modules/{pi-agent-text-editor-renderer → pi-agent-text-editor-overwrite}/runtime/entry-71.js +0 -0
- /package/node_modules/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-72.js +0 -0
- /package/node_modules/{pi-agent-tool-ui → pi-agent-tool-call-interception}/runtime/entry-74.js +0 -0
- /package/node_modules/{pi-agent-web-html → pi-agent-web}/runtime/entry-76.js +0 -0
- /package/node_modules/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-77.js +0 -0
- /package/node_modules/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-78.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-79.js +0 -0
- /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
- /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
- /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
- /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
- /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
- /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
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-renderer → pi-agent-text-editor-overwrite}/runtime/entry-71.js +0 -0
- /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
- /package/src/plugins/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-28.js +0 -0
- /package/src/plugins/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-29.js +0 -0
- /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-30.js +0 -0
- /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
|
-
[
|
|
23
|
-
|
|
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
|
-
[
|
|
61
|
-
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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=
|
|
121
|
-
"
|
|
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", "--
|
|
131
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
277
|
+
"regex",
|
|
162
278
|
"https://stylelint.io/",
|
|
163
|
-
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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", "
|
|
203
|
-
"
|
|
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", "
|
|
213
|
-
"
|
|
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
|
-
"
|
|
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", "
|
|
233
|
-
"
|
|
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
|
-
[
|
|
241
|
-
|
|
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
|
-
"
|
|
244
|
-
"https://github.com/
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
|
|
292
|
-
|
|
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 =
|
|
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
|
|
73
|
+
ok,
|
|
54
74
|
diagnostics,
|
|
55
|
-
...(!
|
|
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)
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
-
|
|
61
|
-
|
|
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
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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
|
|
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 (
|
|
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(""", '"')
|
|
178
218
|
.replaceAll("'", "'")
|
|
179
219
|
.replaceAll("<", "<")
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
94
|
+
return selectConfiguredEntry(
|
|
95
|
+
this.linters,
|
|
96
|
+
this.availableBuiltIns,
|
|
97
|
+
this.evidence,
|
|
98
|
+
filePath,
|
|
99
|
+
projectRoot,
|
|
88
100
|
);
|
|
89
101
|
}
|
|
90
102
|
|