pi-agent-ide 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/README.md +11 -5
- package/dist/chunk-266RH77Z.js +1 -0
- package/dist/chunk-2SKAED2I.js +2 -0
- package/dist/chunk-2XYXV5HS.js +4 -0
- package/dist/chunk-2ZMYT6ZC.js +1 -0
- package/dist/chunk-34ZQTTU2.js +2 -0
- package/dist/chunk-3H2EU7VQ.js +0 -0
- package/dist/chunk-3YK4XMWB.js +0 -0
- package/dist/chunk-4SQQKEVD.js +16 -0
- package/dist/chunk-5BWUVAR4.js +1 -0
- package/dist/chunk-6DN7NO7L.js +1 -0
- package/dist/chunk-6SMFVLTY.js +1 -0
- package/dist/chunk-6XQQBKPE.js +58 -0
- package/dist/chunk-BYWAG6X3.js +6 -0
- package/dist/chunk-DEP55R35.js +1 -0
- package/dist/chunk-E2RESHYR.js +1 -0
- package/dist/chunk-EEH4WYI7.js +1 -0
- package/dist/chunk-EI7MMDWY.js +1 -0
- package/dist/chunk-ERVMDQGX.js +1 -0
- package/dist/chunk-EW2KVKCN.js +2 -0
- package/dist/chunk-F6SESI3P.js +4 -0
- package/dist/chunk-GTK5AREE.js +2 -0
- package/dist/chunk-HOBTFFQR.js +1 -0
- package/dist/chunk-IMVCVPMP.js +3 -0
- package/dist/chunk-IOCABSRL.js +1 -0
- package/dist/chunk-JASLOB2X.js +1 -0
- package/dist/chunk-JMVDFOTQ.js +1 -0
- package/dist/chunk-K4ZMRDEI.js +0 -0
- package/dist/chunk-KH5KPBCR.js +10 -0
- package/dist/chunk-KINKBPPX.js +1 -0
- package/dist/chunk-KNMWCDDK.js +7 -0
- package/dist/chunk-KYVOMBO5.js +1 -0
- package/dist/chunk-KZBAJFCV.js +1 -0
- package/dist/chunk-L4FA6OD4.js +1 -0
- package/dist/chunk-LFV6G5Z3.js +1 -0
- package/dist/chunk-LGN7EJYR.js +13 -0
- package/dist/chunk-MB6VVVAF.js +2 -0
- package/dist/chunk-MBUXFKIW.js +3 -0
- package/dist/chunk-MTQSGWZJ.js +1 -0
- package/dist/chunk-MTTKFJV6.js +1 -0
- package/dist/chunk-N34ATN52.js +1 -0
- package/dist/chunk-NI2NK4JU.js +1 -0
- package/dist/chunk-NNCZYO4Q.js +0 -0
- package/dist/chunk-NXHPO7ER.js +6 -0
- package/dist/chunk-OBWZ5RYN.js +1 -0
- package/dist/chunk-OFHVDY4Q.js +2 -0
- package/dist/chunk-OIL6BB2S.js +33 -0
- package/dist/chunk-ONWUJXUR.js +1 -0
- package/dist/chunk-ORAPGW7W.js +1 -0
- package/dist/chunk-OVUYPHDE.js +1 -0
- package/dist/chunk-PETQCA7G.js +1 -0
- package/dist/chunk-PODWLGNO.js +6 -0
- package/dist/chunk-QZANC2IG.js +1 -0
- package/dist/chunk-SJYDLHEF.js +108 -0
- package/dist/chunk-SMSIT3CE.js +3 -0
- package/dist/chunk-SSZB66C3.js +3 -0
- package/dist/chunk-STUZZM5B.js +1 -0
- package/dist/chunk-T2RPMEM2.js +1 -0
- package/dist/chunk-TG6H6EOI.js +1 -0
- package/dist/chunk-UTTW55S2.js +1 -0
- package/dist/chunk-VCCMVQXU.js +1 -0
- package/dist/chunk-VEJGSURY.js +8 -0
- package/dist/chunk-VFBLX4TG.js +1 -0
- package/dist/chunk-VSP2QQPQ.js +2 -0
- package/dist/chunk-W3XYKJ5H.js +1 -0
- package/dist/chunk-WZI4YC2O.js +1 -0
- package/dist/chunk-XGUAL3CA.js +1 -0
- package/dist/chunk-XNXQYPVT.js +10 -0
- package/dist/chunk-YHUTTZC6.js +2 -0
- package/dist/chunk-YPHXLAQF.js +1 -0
- package/dist/chunk-ZC65Z3CK.js +1 -0
- package/dist/chunk-ZIHEF6K3.js +3 -0
- package/dist/entry-0.js +1 -0
- package/dist/entry-1.js +1 -0
- package/dist/entry-10.js +1 -0
- package/dist/entry-11.js +1 -0
- package/dist/entry-12.js +1 -0
- package/dist/entry-13.js +1 -0
- package/dist/entry-14.js +1 -0
- package/dist/entry-16.js +1 -0
- package/dist/entry-17.js +1 -0
- package/dist/entry-18.js +1 -0
- package/dist/entry-19.js +1 -0
- package/dist/entry-2.js +1 -0
- package/dist/entry-20.js +1 -0
- package/dist/entry-21.js +1 -0
- package/dist/entry-22.js +1 -0
- package/dist/entry-23.js +1 -0
- package/dist/entry-24.js +1 -0
- package/dist/entry-25.js +1 -0
- package/dist/entry-26.js +1 -0
- package/dist/entry-27.js +1 -0
- package/dist/entry-28.js +1 -0
- package/dist/entry-29.js +1 -0
- package/dist/entry-3.js +1 -0
- package/dist/entry-30.js +1 -0
- package/dist/entry-31.js +1 -0
- package/dist/entry-32.js +1 -0
- package/dist/entry-33.js +1 -0
- package/dist/entry-34.js +1 -0
- package/dist/entry-35.js +1 -0
- package/dist/entry-36.js +1 -0
- package/dist/entry-37.js +1 -0
- package/dist/entry-38.js +1 -0
- package/dist/entry-39.js +1 -0
- package/dist/entry-4.js +1 -0
- package/dist/entry-40.js +1 -0
- package/dist/entry-41.js +1 -0
- package/dist/entry-42.js +1 -0
- package/dist/entry-43.js +1 -0
- package/dist/entry-44.js +1 -0
- package/dist/entry-45.js +1 -0
- package/dist/entry-46.js +1 -0
- package/dist/entry-47.js +1 -0
- package/dist/entry-48.js +1 -0
- package/dist/entry-49.js +1 -0
- package/dist/entry-5.js +1 -0
- package/dist/entry-50.js +1 -0
- package/dist/entry-51.js +1 -0
- package/dist/entry-52.js +1 -0
- package/dist/entry-53.js +1 -0
- package/dist/entry-54.js +0 -0
- package/dist/entry-55.js +1 -0
- package/dist/entry-56.js +0 -0
- package/dist/entry-57.js +1 -0
- package/dist/entry-58.js +1 -0
- package/dist/entry-59.js +1 -0
- package/dist/entry-6.js +1 -0
- package/dist/entry-60.js +1 -0
- package/dist/entry-61.js +1 -0
- package/dist/entry-62.js +1 -0
- package/dist/entry-63.js +0 -0
- package/dist/entry-64.js +1 -0
- package/dist/entry-65.js +0 -0
- package/dist/entry-66.js +1 -0
- package/dist/entry-67.js +1 -0
- package/dist/entry-68.js +1 -0
- package/dist/entry-69.js +1 -0
- package/dist/entry-7.js +1 -0
- package/dist/entry-70.js +1 -0
- package/dist/entry-71.js +1 -0
- package/dist/entry-72.js +1 -0
- package/dist/entry-73.js +1 -0
- package/dist/entry-74.js +1 -0
- package/dist/entry-75.js +1 -0
- package/dist/entry-76.js +1 -0
- package/dist/entry-77.js +1 -0
- package/dist/entry-78.js +1 -0
- package/dist/entry-79.js +1 -0
- package/dist/entry-8.js +1 -0
- package/dist/entry-80.js +1 -0
- package/dist/entry-9.js +1 -0
- package/dist/pi-agent-ide.js +13 -0
- package/docs/architecture.md +21 -17
- package/docs/configuration.md +180 -52
- package/docs/development.md +105 -5
- package/docs/extensions.md +64 -4
- 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 -6
- 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 -5
- package/docs/generated/tool-catalog/index.md +9 -0
- package/docs/generated/tool-catalog/javascript.md +8 -6
- package/docs/generated/tool-catalog/json.md +7 -6
- 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 -5
- 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/toml.md +6 -5
- package/docs/generated/tool-catalog/typescript.md +9 -6
- package/docs/generated/tool-catalog/vue.md +9 -0
- package/docs/generated/tool-catalog/yaml.md +6 -5
- package/docs/generated/tool-catalog/zig.md +9 -0
- package/docs/tools.md +88 -6
- package/node_modules/pi-agent-doctor/package.json +15 -5
- package/node_modules/pi-agent-doctor/runtime/entry-16.js +1 -0
- package/node_modules/pi-agent-doctor/runtime/entry-17.js +1 -0
- package/node_modules/pi-agent-doctor/runtime/entry-18.js +1 -0
- package/node_modules/pi-agent-doctor/runtime/entry-19.js +1 -0
- 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 +85 -6
- package/node_modules/pi-agent-doctor/src/plugin-protocol.ts +30 -4
- package/node_modules/pi-agent-filesystem/index.ts +4 -3
- package/node_modules/pi-agent-filesystem/package.json +7 -7
- package/node_modules/pi-agent-filesystem/runtime/entry-21.js +2 -0
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- package/node_modules/pi-agent-filesystem-image/runtime/entry-22.js +2 -0
- package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
- package/node_modules/pi-agent-filesystem-pdf/runtime/entry-23.js +2 -0
- 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 -10
- package/node_modules/pi-agent-ide-ast/runtime/entry-25.js +1 -0
- package/node_modules/pi-agent-ide-ast/runtime/entry-26.js +2 -0
- package/node_modules/pi-agent-ide-ast/src/api/scope.ts +1 -1
- package/node_modules/pi-agent-ide-ast/src/ast/manager.ts +3 -0
- package/node_modules/pi-agent-ide-ast/src/ast/outline.ts +4 -1
- package/node_modules/pi-agent-ide-ast/src/doctor-plugin.ts +25 -0
- package/node_modules/pi-agent-ide-ast/src/extension.ts +13 -5
- package/node_modules/pi-agent-ide-ast/src/scope-resolver.ts +6 -0
- package/node_modules/pi-agent-ide-changes/index.ts +6 -2
- package/node_modules/pi-agent-ide-changes/package.json +8 -7
- package/node_modules/pi-agent-ide-changes/runtime/entry-27.js +1 -0
- package/node_modules/pi-agent-ide-changes/runtime/entry-28.js +2 -0
- package/node_modules/pi-agent-ide-changes/src/change-anchor.ts +6 -0
- package/node_modules/pi-agent-ide-changes/src/changes/change-groups.ts +1 -1
- package/node_modules/pi-agent-ide-changes/src/changes/change-service.ts +1 -1
- package/node_modules/pi-agent-ide-changes/src/changes/git-changes-backend.ts +1 -0
- package/node_modules/pi-agent-ide-changes/src/current-change-presenter.ts +1 -1
- package/node_modules/pi-agent-ide-changes/src/doctor-plugin.ts +31 -1
- package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +5 -0
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +7 -0
- package/node_modules/pi-agent-ide-formatter/package.json +4 -4
- package/node_modules/pi-agent-ide-formatter/runtime/entry-29.js +2 -0
- package/node_modules/pi-agent-ide-formatter/src/catalog.ts +165 -13
- package/node_modules/pi-agent-ide-formatter/src/doctor-plugin.ts +115 -63
- package/node_modules/pi-agent-ide-formatter/src/registry.ts +86 -31
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-languages/runtime/entry-30.js +2 -0
- package/node_modules/pi-agent-ide-languages/src/languages.ts +15 -0
- package/node_modules/pi-agent-ide-lint/index.ts +30 -155
- package/node_modules/pi-agent-ide-lint/package.json +8 -7
- package/node_modules/pi-agent-ide-lint/runtime/entry-31.js +2 -0
- package/node_modules/pi-agent-ide-lint/src/catalog.ts +210 -41
- package/node_modules/pi-agent-ide-lint/src/command-linter.ts +80 -4
- package/node_modules/pi-agent-ide-lint/src/diagnostics.ts +76 -34
- package/node_modules/pi-agent-ide-lint/src/doctor-plugin.ts +115 -64
- package/node_modules/pi-agent-ide-lint/src/registry.ts +87 -30
- package/node_modules/pi-agent-ide-lsp/index.ts +35 -134
- package/node_modules/pi-agent-ide-lsp/package.json +9 -8
- 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/code-view-resolvers.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/src/diagnostic-source.ts +110 -0
- package/node_modules/pi-agent-ide-lsp/src/doctor-plugin.ts +108 -55
- package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +248 -38
- package/node_modules/pi-agent-ide-lsp/src/lsp/code-views.ts +2 -1
- package/node_modules/pi-agent-ide-lsp/src/lsp/diagnostic-adapters.ts +76 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/diagnostics.ts +137 -144
- 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/lsp-compiler.ts +2 -2
- package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +17 -36
- package/node_modules/pi-agent-ide-lsp/src/lsp/registry.ts +139 -68
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +1 -0
- 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 +13 -6
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +5 -5
- package/node_modules/pi-agent-image/package.json +3 -3
- package/node_modules/pi-agent-image/runtime/entry-33.js +1 -0
- package/node_modules/pi-agent-invariant/package.json +12 -0
- package/node_modules/pi-agent-invariant/runtime/entry-34.js +1 -0
- package/node_modules/pi-agent-pdf/package.json +3 -3
- package/node_modules/pi-agent-pdf/runtime/entry-35.js +1 -0
- package/node_modules/pi-agent-pdf/src/pdf-converter.ts +3 -2
- package/node_modules/pi-agent-read/package.json +11 -9
- package/node_modules/pi-agent-read/runtime/entry-36.js +1 -0
- package/node_modules/pi-agent-read/runtime/entry-37.js +1 -0
- package/node_modules/pi-agent-read/runtime/entry-38.js +1 -0
- package/node_modules/pi-agent-read/runtime/entry-39.js +1 -0
- package/node_modules/pi-agent-read/runtime/entry-40.js +2 -0
- package/node_modules/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/node_modules/pi-agent-read/src/api/tools/read.ts +113 -2
- package/node_modules/pi-agent-read/src/core/extension.ts +19 -0
- package/node_modules/pi-agent-read/src/core/read-core.ts +85 -13
- package/node_modules/pi-agent-read/src/core/tools/read/output-truncation.ts +26 -10
- package/node_modules/pi-agent-read/src/core/tools/read/persisted-result.ts +72 -0
- package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +102 -12
- package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +27 -3
- package/node_modules/pi-agent-read/src/core/tools/read/views.ts +29 -0
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +532 -46
- package/node_modules/pi-agent-resource/package.json +5 -2
- package/node_modules/pi-agent-resource/runtime/entry-41.js +1 -0
- package/node_modules/pi-agent-resource/src/content-conversion/content-converter.ts +1 -1
- package/node_modules/pi-agent-resource/src/content-conversion/content-host.ts +1 -1
- package/node_modules/pi-agent-resource/src/content-conversion/content-runner.ts +1 -1
- package/node_modules/pi-agent-resource/src/content-conversion/validation.ts +1 -1
- package/node_modules/pi-agent-search/package.json +7 -6
- package/node_modules/pi-agent-search/runtime/entry-42.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-43.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-44.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-45.js +2 -0
- package/node_modules/pi-agent-search/src/api/search.ts +4 -0
- package/node_modules/pi-agent-search/src/core/extension.ts +99 -27
- package/node_modules/pi-agent-search/src/core/search-config.ts +98 -0
- package/node_modules/pi-agent-search/src/core/search-core.ts +32 -28
- package/node_modules/pi-agent-search/src/core/search-timeout.ts +54 -0
- package/node_modules/pi-agent-search-text/index.ts +53 -3
- package/node_modules/pi-agent-search-text/package.json +9 -9
- package/node_modules/pi-agent-search-text/runtime/entry-46.js +2 -0
- package/node_modules/pi-agent-search-text/runtime/entry-47.js +1 -0
- package/node_modules/pi-agent-search-text/src/doctor-plugin.ts +20 -1
- package/node_modules/pi-agent-search-text/src/persisted-result.ts +56 -0
- package/node_modules/pi-agent-search-text/src/resolvers.ts +36 -34
- package/node_modules/pi-agent-search-text/src/search-query.ts +254 -71
- package/node_modules/pi-agent-search-text/src/search-recipe.ts +68 -0
- package/node_modules/pi-agent-search-text/src/search-renderer.ts +71 -117
- package/node_modules/pi-agent-search-text/src/search-result.ts +1 -0
- package/node_modules/pi-agent-search-text/src/search-session.ts +276 -110
- package/node_modules/pi-agent-text/package.json +6 -3
- package/node_modules/pi-agent-text/runtime/entry-48.js +1 -0
- package/node_modules/pi-agent-text/src/index.ts +23 -0
- package/node_modules/pi-agent-text/src/stored-text.ts +14 -0
- package/node_modules/pi-agent-text/src/text-anchor.ts +160 -16
- package/node_modules/pi-agent-text/src/text-document.ts +26 -5
- package/node_modules/pi-agent-text/src/text-target.ts +105 -0
- package/node_modules/pi-agent-text-anchor-constant/package.json +7 -4
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-49.js +2 -0
- package/node_modules/pi-agent-text-anchor-constant/src/resolver.ts +6 -0
- package/node_modules/pi-agent-text-anchor-exact/index.ts +34 -0
- package/node_modules/pi-agent-text-anchor-exact/package.json +27 -0
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-50.js +1 -0
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-51.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/src/anchor.ts +230 -0
- package/node_modules/pi-agent-text-anchor-exact/src/config.ts +159 -0
- package/node_modules/pi-agent-text-anchor-exact/src/fuzzy-worker.ts +100 -0
- package/node_modules/pi-agent-text-anchor-exact/src/recovery.ts +151 -0
- package/node_modules/pi-agent-text-anchor-line-hash/index.ts +8 -2
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +10 -6
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-52.js +1 -0
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-53.js +2 -0
- package/node_modules/pi-agent-text-anchor-line-hash/src/anchor.ts +32 -1
- package/node_modules/pi-agent-text-anchor-line-hash/src/read-handler.ts +20 -12
- package/node_modules/pi-agent-text-editor/package.json +22 -21
- package/node_modules/pi-agent-text-editor/runtime/entry-54.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-55.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-56.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-57.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-58.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-59.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-60.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-61.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-62.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-63.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-64.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-65.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-66.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-67.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-68.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-69.js +2 -0
- package/node_modules/pi-agent-text-editor/src/api/anchor-inspection.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +1 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +38 -0
- package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +30 -15
- package/node_modules/pi-agent-text-editor/src/api/text-selection-anchor.ts +10 -13
- package/node_modules/pi-agent-text-editor/src/api/tool-call-interceptor.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/builtin-edit-filter.ts +12 -5
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +15 -1
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/agent-diff.ts +14 -10
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/diff.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +3 -2
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +19 -2
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +64 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/inline-hints.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/read-fragment-resolver.ts +83 -0
- package/node_modules/pi-agent-text-editor/src/core/text-anchor-registry.ts +96 -8
- package/node_modules/pi-agent-text-editor/src/core/text-change-engine.ts +4 -1
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +194 -35
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +43 -13
- package/node_modules/pi-agent-text-editor/src/core/text-editor-config.ts +95 -0
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +75 -5
- package/node_modules/pi-agent-text-editor/src/core/text-mutation-anchor-error.ts +7 -0
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +541 -130
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +5 -9
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/rendering.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/tools/text-selection.ts +228 -6
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +50 -70
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +25 -26
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +30 -21
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +57 -71
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +30 -27
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +2 -0
- package/node_modules/pi-agent-text-editor-argument-order/package.json +3 -3
- package/node_modules/pi-agent-text-editor-argument-order/runtime/entry-70.js +2 -0
- package/node_modules/pi-agent-text-editor-overwrite/index.ts +1 -1
- package/node_modules/pi-agent-text-editor-overwrite/package.json +4 -3
- package/node_modules/pi-agent-text-editor-overwrite/runtime/entry-71.js +2 -0
- package/node_modules/pi-agent-text-editor-renderer/index.ts +21 -1
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -3
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-72.js +2 -0
- package/node_modules/pi-agent-text-editor-renderer/src/animation-pressure.ts +50 -0
- package/node_modules/pi-agent-text-editor-renderer/src/config.ts +73 -0
- package/node_modules/pi-agent-text-editor-renderer/src/diff-model.ts +1 -1
- package/node_modules/pi-agent-text-editor-renderer/src/diff-renderer.ts +77 -22
- package/node_modules/pi-agent-text-editor-renderer/src/diff-theme.ts +1 -1
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +140 -24
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-projection.ts +274 -43
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-result.ts +33 -6
- package/node_modules/pi-agent-text-editor-renderer/src/persisted-result.ts +47 -0
- package/node_modules/pi-agent-text-editor-renderer/src/render-resource.ts +7 -0
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +265 -105
- package/node_modules/pi-agent-text-editor-renderer/src/typing-interpolation.ts +96 -15
- package/node_modules/pi-agent-text-editor-stale-anchor/index.ts +22 -6
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -4
- 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 +5 -2
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-74.js +1 -0
- package/node_modules/pi-agent-tool-call-interception/src/index.ts +175 -32
- package/node_modules/pi-agent-tool-ui/package.json +15 -0
- package/node_modules/pi-agent-tool-ui/runtime/entry-75.js +1 -0
- package/node_modules/pi-agent-tool-ui/src/index.ts +318 -0
- package/node_modules/pi-agent-web/index.ts +16 -6
- package/node_modules/pi-agent-web/package.json +8 -6
- package/node_modules/pi-agent-web/runtime/entry-76.js +2 -0
- package/node_modules/pi-agent-web/src/browser-loader.ts +180 -0
- package/node_modules/pi-agent-web/src/doctor-plugin.ts +41 -0
- package/node_modules/pi-agent-web/src/resolver.ts +128 -24
- package/node_modules/pi-agent-web-html/package.json +6 -3
- package/node_modules/pi-agent-web-html/runtime/entry-77.js +2 -0
- package/node_modules/pi-agent-web-html/src/extract-readable-html.ts +19 -6
- package/node_modules/pi-agent-web-image/package.json +4 -4
- package/node_modules/pi-agent-web-image/runtime/entry-78.js +2 -0
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/runtime/entry-79.js +2 -0
- 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 +68 -54
- package/src/api/code-view.ts +4 -0
- package/src/api/connect-tip-provider.ts +49 -0
- package/src/api/plugin-protocol.ts +41 -2
- package/src/api/tips.ts +77 -0
- package/src/api/tool-config/formatters.json +273 -0
- package/src/api/tool-config/linters.json +339 -0
- package/src/api/tool-config/lsp-servers.json +410 -0
- package/src/api/tool-config.ts +248 -12
- package/src/api/toolchain.ts +0 -5
- package/src/code-view/diagnostic-view.ts +121 -26
- package/src/code-view/source-view.ts +1 -1
- package/src/composite/builtin-extensions.ts +12 -6
- package/src/composite/extensions-config.ts +137 -0
- package/src/composite/selection.ts +58 -3
- package/src/core/diagnostic-store.ts +244 -0
- package/src/core/extension.ts +40 -0
- package/src/core/ide-core.ts +48 -3
- package/src/doctor/config-writer.ts +15 -2
- package/src/doctor/core.ts +47 -0
- package/src/doctor/discovery.ts +23 -70
- package/src/doctor/extension.ts +12 -1
- package/src/doctor/inventory.ts +24 -6
- package/src/doctor/run.ts +100 -87
- package/src/doctor/tip-provider.ts +92 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +4 -3
- 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-image/runtime/entry-22.js +2 -0
- 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-pdf/runtime/entry-23.js +2 -0
- 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 +16 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +6 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-77.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/src/extract-readable-html.ts +19 -6
- 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-image/runtime/entry-78.js +2 -0
- 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-pdf/runtime/entry-79.js +2 -0
- 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/extensions/pi-agent-web/src/browser-loader.ts +180 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/doctor-plugin.ts +41 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/resolver.ts +128 -24
- package/src/extensions/pi-agent-read/package.json +11 -9
- package/src/extensions/pi-agent-read/runtime/entry-36.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-37.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-38.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-39.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-40.js +2 -0
- package/src/extensions/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +113 -2
- package/src/extensions/pi-agent-read/src/core/extension.ts +19 -0
- package/src/extensions/pi-agent-read/src/core/read-core.ts +85 -13
- package/src/extensions/pi-agent-read/src/core/tools/read/output-truncation.ts +26 -10
- package/src/extensions/pi-agent-read/src/core/tools/read/persisted-result.ts +72 -0
- package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +102 -12
- package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +27 -3
- package/src/extensions/pi-agent-read/src/core/tools/read/views.ts +29 -0
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +532 -46
- package/src/extensions/pi-agent-search/package.json +7 -6
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +53 -3
- 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 +2 -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/doctor-plugin.ts +20 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/persisted-result.ts +56 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +36 -34
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-query.ts +254 -71
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +68 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +71 -117
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +276 -110
- package/src/extensions/pi-agent-search/runtime/entry-42.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-43.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-44.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-45.js +2 -0
- package/src/extensions/pi-agent-search/src/api/search.ts +4 -0
- package/src/extensions/pi-agent-search/src/core/extension.ts +99 -27
- package/src/extensions/pi-agent-search/src/core/search-config.ts +98 -0
- package/src/extensions/pi-agent-search/src/core/search-core.ts +32 -28
- package/src/extensions/pi-agent-search/src/core/search-timeout.ts +54 -0
- package/src/extensions/pi-agent-text-editor/package.json +22 -21
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +7 -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-constant/src/resolver.ts +6 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.ts +34 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +27 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-50.js +1 -0
- 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-exact/src/anchor.ts +230 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/config.ts +159 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/fuzzy-worker.ts +100 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/recovery.ts +151 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +8 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +10 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-52.js +1 -0
- 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-anchor-line-hash/src/anchor.ts +32 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/read-handler.ts +20 -12
- 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-argument-order/runtime/entry-70.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/index.ts +1 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/package.json +4 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/runtime/entry-71.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +21 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-72.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/animation-pressure.ts +50 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/config.ts +73 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-model.ts +1 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-renderer.ts +77 -22
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-theme.ts +1 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +140 -24
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-projection.ts +274 -43
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-result.ts +33 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/persisted-result.ts +47 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/render-resource.ts +7 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +265 -105
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/typing-interpolation.ts +96 -15
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/index.ts +22 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -4
- 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-54.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-55.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-56.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-57.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-58.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-59.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-60.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-61.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-62.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-63.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-64.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-65.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-66.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-67.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-68.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-69.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/anchor-inspection.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +1 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +38 -0
- package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +30 -15
- package/src/extensions/pi-agent-text-editor/src/api/text-selection-anchor.ts +10 -13
- package/src/extensions/pi-agent-text-editor/src/api/tool-call-interceptor.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/builtin-edit-filter.ts +12 -5
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +15 -1
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/agent-diff.ts +14 -10
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/diff.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +3 -2
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +19 -2
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +64 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/inline-hints.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/read-fragment-resolver.ts +83 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-anchor-registry.ts +96 -8
- package/src/extensions/pi-agent-text-editor/src/core/text-change-engine.ts +4 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +194 -35
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +43 -13
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-config.ts +95 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +75 -5
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation-anchor-error.ts +7 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +541 -130
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +5 -9
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/rendering.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/tools/text-selection.ts +228 -6
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +50 -70
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +25 -26
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +30 -21
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +57 -71
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +30 -27
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +2 -0
- package/src/pi-agent-ide.ts +15 -3
- package/src/plugins/pi-agent-ide-ast/package.json +11 -10
- package/src/plugins/pi-agent-ide-ast/runtime/entry-25.js +1 -0
- package/src/plugins/pi-agent-ide-ast/runtime/entry-26.js +2 -0
- package/src/plugins/pi-agent-ide-ast/src/api/scope.ts +1 -1
- package/src/plugins/pi-agent-ide-ast/src/ast/manager.ts +3 -0
- package/src/plugins/pi-agent-ide-ast/src/ast/outline.ts +4 -1
- package/src/plugins/pi-agent-ide-ast/src/doctor-plugin.ts +25 -0
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +13 -5
- package/src/plugins/pi-agent-ide-ast/src/scope-resolver.ts +6 -0
- package/src/plugins/pi-agent-ide-changes/index.ts +6 -2
- package/src/plugins/pi-agent-ide-changes/package.json +8 -7
- package/src/plugins/pi-agent-ide-changes/runtime/entry-27.js +1 -0
- package/src/plugins/pi-agent-ide-changes/runtime/entry-28.js +2 -0
- package/src/plugins/pi-agent-ide-changes/src/change-anchor.ts +6 -0
- package/src/plugins/pi-agent-ide-changes/src/changes/change-groups.ts +1 -1
- package/src/plugins/pi-agent-ide-changes/src/changes/change-service.ts +1 -1
- package/src/plugins/pi-agent-ide-changes/src/changes/git-changes-backend.ts +1 -0
- package/src/plugins/pi-agent-ide-changes/src/current-change-presenter.ts +1 -1
- package/src/plugins/pi-agent-ide-changes/src/doctor-plugin.ts +31 -1
- package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +5 -0
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +7 -0
- package/src/plugins/pi-agent-ide-diagnostics/index.ts +1 -0
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +199 -0
- package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
- package/src/plugins/pi-agent-ide-formatter/runtime/entry-29.js +2 -0
- package/src/plugins/pi-agent-ide-formatter/src/catalog.ts +165 -13
- package/src/plugins/pi-agent-ide-formatter/src/doctor-plugin.ts +115 -63
- package/src/plugins/pi-agent-ide-formatter/src/registry.ts +86 -31
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-languages/runtime/entry-30.js +2 -0
- package/src/plugins/pi-agent-ide-languages/src/languages.ts +15 -0
- package/src/plugins/pi-agent-ide-lint/index.ts +30 -155
- package/src/plugins/pi-agent-ide-lint/package.json +8 -7
- package/src/plugins/pi-agent-ide-lint/runtime/entry-31.js +2 -0
- package/src/plugins/pi-agent-ide-lint/src/catalog.ts +210 -41
- package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +80 -4
- package/src/plugins/pi-agent-ide-lint/src/diagnostics.ts +76 -34
- package/src/plugins/pi-agent-ide-lint/src/doctor-plugin.ts +115 -64
- package/src/plugins/pi-agent-ide-lint/src/registry.ts +87 -30
- package/src/plugins/pi-agent-ide-lsp/index.ts +35 -134
- package/src/plugins/pi-agent-ide-lsp/package.json +9 -8
- 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/code-view-resolvers.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/src/diagnostic-source.ts +110 -0
- package/src/plugins/pi-agent-ide-lsp/src/doctor-plugin.ts +108 -55
- package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +248 -38
- package/src/plugins/pi-agent-ide-lsp/src/lsp/code-views.ts +2 -1
- package/src/plugins/pi-agent-ide-lsp/src/lsp/diagnostic-adapters.ts +76 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/diagnostics.ts +137 -144
- 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/lsp-compiler.ts +2 -2
- package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +17 -36
- package/src/plugins/pi-agent-ide-lsp/src/lsp/registry.ts +139 -68
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +1 -0
- 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 +13 -6
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +5 -5
- package/src/post-edit/gate.ts +17 -141
- package/src/tips/core.ts +86 -0
- package/src/tips/extension.ts +115 -0
- package/src/tips/persistence.ts +225 -0
- package/src/tips/tip-callout.ts +77 -0
- package/src/toolchain/registry.ts +8 -23
- package/src/toolchain/types.ts +8 -74
- package/node_modules/pi-agent-search-semantic/index.ts +0 -97
- package/node_modules/pi-agent-search-semantic/package.json +0 -17
- package/node_modules/pi-agent-search-text/src/lucene-query-parser.d.ts +0 -20
- package/node_modules/pi-agent-search-web/index.ts +0 -82
- package/node_modules/pi-agent-search-web/package.json +0 -20
- package/node_modules/pi-agent-search-web/src/config.ts +0 -560
- package/node_modules/pi-agent-search-web/src/doctor-plugin.ts +0 -40
- package/node_modules/pi-agent-search-web/src/providers/duckduckgo-html.ts +0 -74
- package/node_modules/pi-agent-search-web/src/providers/endpoints.ts +0 -81
- package/node_modules/pi-agent-search-web/src/providers/request.ts +0 -427
- package/node_modules/pi-agent-search-web/src/providers/response.ts +0 -353
- package/node_modules/pi-agent-search-web/src/search-format.ts +0 -24
- package/node_modules/pi-agent-search-web/src/search.ts +0 -376
- package/node_modules/pi-agent-search-web/src/types.ts +0 -141
- package/src/composite/config.ts +0 -100
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-semantic/index.ts +0 -97
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-semantic/package.json +0 -17
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/lucene-query-parser.d.ts +0 -20
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/index.ts +0 -82
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/package.json +0 -20
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/config.ts +0 -560
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/doctor-plugin.ts +0 -40
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/duckduckgo-html.ts +0 -74
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/endpoints.ts +0 -81
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/request.ts +0 -427
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/response.ts +0 -353
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/search-format.ts +0 -24
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/search.ts +0 -376
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/types.ts +0 -141
- package/src/toolchain/gate.ts +0 -305
- /package/{src/utils/required-value.ts → node_modules/pi-agent-invariant/src/index.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { requiredValue } from "
|
|
1
|
+
import { requiredValue } from "pi-agent-invariant";
|
|
2
2
|
import type { DiagnosticParserConfig } from "pi-agent-ide/api/tool-config";
|
|
3
3
|
import type { Diagnostic } from "pi-agent-ide/api/toolchain";
|
|
4
4
|
|
|
@@ -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,
|
|
@@ -149,9 +178,16 @@ function stringValue(value: unknown, fallback: string): string {
|
|
|
149
178
|
}
|
|
150
179
|
|
|
151
180
|
function severityValue(value: unknown): Diagnostic["severity"] {
|
|
181
|
+
if (value === 2) return "error";
|
|
182
|
+
if (value === 1) return "warning";
|
|
152
183
|
const normalized = stringValue(value, "warning").toLowerCase();
|
|
153
184
|
|
|
154
|
-
if (
|
|
185
|
+
if (
|
|
186
|
+
normalized.includes("error") ||
|
|
187
|
+
normalized === "e" ||
|
|
188
|
+
normalized === "f" ||
|
|
189
|
+
normalized === "fatal"
|
|
190
|
+
) {
|
|
155
191
|
return "error";
|
|
156
192
|
}
|
|
157
193
|
|
|
@@ -172,6 +208,12 @@ function sarifSeverity(value: unknown): string {
|
|
|
172
208
|
|
|
173
209
|
function decodeXml(value: string): string {
|
|
174
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
|
+
})
|
|
175
217
|
.replaceAll(""", '"')
|
|
176
218
|
.replaceAll("'", "'")
|
|
177
219
|
.replaceAll("<", "<")
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { copyFile, mkdtemp,
|
|
1
|
+
import { copyFile, mkdtemp, rm } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
|
|
4
4
|
import { DOCTOR_API_VERSION, DOCTOR_PROTOCOL } from "pi-agent-doctor/api/plugin-protocol";
|
|
5
|
-
import {
|
|
6
|
-
parseLintersConfig,
|
|
7
|
-
projectIdeConfigPath,
|
|
8
|
-
runConfiguredProcess,
|
|
9
|
-
} from "pi-agent-ide/api/tool-config";
|
|
10
|
-
|
|
5
|
+
import { hasConfiguredExecutable } from "pi-agent-ide/api/tool-config";
|
|
11
6
|
import { LINTER_RECIPES } from "./catalog.js";
|
|
7
|
+
import { runConfiguredLinter } from "./command-linter.js";
|
|
8
|
+
import { LintCommandRegistry } from "./registry.js";
|
|
12
9
|
|
|
13
|
-
import type {
|
|
10
|
+
import type {
|
|
11
|
+
DoctorContext,
|
|
12
|
+
DoctorFinding,
|
|
13
|
+
DoctorPlugin,
|
|
14
|
+
DoctorSetupInspection,
|
|
15
|
+
} from "pi-agent-doctor/api/plugin-protocol";
|
|
16
|
+
import type { EffectiveToolConfigEntry, LinterCommandConfig } from "pi-agent-ide/api/tool-config";
|
|
14
17
|
|
|
15
18
|
/**
|
|
16
19
|
Doctor contribution owned by the lint plugin.
|
|
@@ -24,73 +27,63 @@ export const lintDoctorPlugin: DoctorPlugin = {
|
|
|
24
27
|
api.addToolRecipe(recipe);
|
|
25
28
|
}
|
|
26
29
|
|
|
30
|
+
api.addSetupCheck({
|
|
31
|
+
id: "effective-config",
|
|
32
|
+
inspect: inspectLinterSetup,
|
|
33
|
+
});
|
|
34
|
+
|
|
27
35
|
api.addCheck({
|
|
28
36
|
id: "config",
|
|
29
37
|
title: "Linter",
|
|
30
38
|
async run(context) {
|
|
31
|
-
const file = projectIdeConfigPath(context.cwd, "linters");
|
|
32
|
-
|
|
33
39
|
try {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
message: `${Object.keys(config.linters).length} linter mappings loaded`,
|
|
39
|
-
detail: file,
|
|
40
|
-
},
|
|
41
|
-
];
|
|
40
|
+
const registry = await LintCommandRegistry.fromDirectory(context.cwd, {
|
|
41
|
+
environment: context.env,
|
|
42
|
+
});
|
|
43
|
+
const applicable = applicableLinters(registry, context.files, context.cwd);
|
|
42
44
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
linter.extensions.includes(path.extname(candidate).toLowerCase()),
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
if (source === undefined) {
|
|
49
|
-
continue;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const directory = await mkdtemp(
|
|
53
|
-
path.join(path.dirname(source), ".pi-agent-ide-doctor-"),
|
|
54
|
-
);
|
|
55
|
-
const probe = path.join(directory, path.basename(source));
|
|
56
|
-
|
|
57
|
-
try {
|
|
58
|
-
await copyFile(source, probe);
|
|
59
|
-
const result = await runConfiguredProcess(linter.check, {
|
|
60
|
-
projectRoot: context.cwd,
|
|
61
|
-
filePath: probe,
|
|
62
|
-
env: context.env,
|
|
63
|
-
});
|
|
64
|
-
findings.push(
|
|
65
|
-
result.ok
|
|
66
|
-
? { status: "pass", message: `${id} probe passed`, detail: path.basename(source) }
|
|
67
|
-
: {
|
|
68
|
-
status: "fail",
|
|
69
|
-
message: `${id} probe failed`,
|
|
70
|
-
detail: result.stderr.trim().slice(0, 200),
|
|
71
|
-
},
|
|
72
|
-
);
|
|
73
|
-
} catch (error) {
|
|
74
|
-
findings.push({
|
|
75
|
-
status: "fail",
|
|
76
|
-
message: `${id}: ${error instanceof Error ? error.message : String(error)}`,
|
|
77
|
-
});
|
|
78
|
-
} finally {
|
|
79
|
-
await rm(directory, { recursive: true, force: true });
|
|
80
|
-
}
|
|
45
|
+
if (applicable.length === 0) {
|
|
46
|
+
return [{ status: "skip", message: "No linter matches the inspected project files" }];
|
|
81
47
|
}
|
|
82
48
|
|
|
83
|
-
return
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
49
|
+
return await Promise.all(
|
|
50
|
+
applicable.map(async ({ entry, source }): Promise<DoctorFinding> => {
|
|
51
|
+
const label = `${entry.id} [${entry.layer}] command ${JSON.stringify(entry.config.check.command)}`;
|
|
52
|
+
const directory = await mkdtemp(
|
|
53
|
+
path.join(path.dirname(source), ".pi-agent-ide-doctor-"),
|
|
54
|
+
);
|
|
55
|
+
const probe = path.join(directory, path.basename(source));
|
|
88
56
|
|
|
57
|
+
try {
|
|
58
|
+
await copyFile(source, probe);
|
|
59
|
+
const result = await runConfiguredLinter(entry.config, {
|
|
60
|
+
projectRoot: context.cwd,
|
|
61
|
+
filePath: probe,
|
|
62
|
+
env: context.env,
|
|
63
|
+
});
|
|
64
|
+
return result.ok
|
|
65
|
+
? { status: "pass", message: `${label}: probe passed`, detail: entry.sourcePath }
|
|
66
|
+
: {
|
|
67
|
+
status: "fail",
|
|
68
|
+
message: `${label}: probe failed`,
|
|
69
|
+
detail: result.failure ?? entry.sourcePath,
|
|
70
|
+
};
|
|
71
|
+
} catch (error) {
|
|
72
|
+
return {
|
|
73
|
+
status: "fail",
|
|
74
|
+
message: `${label}: ${error instanceof Error ? error.message : String(error)}`,
|
|
75
|
+
detail: entry.sourcePath,
|
|
76
|
+
};
|
|
77
|
+
} finally {
|
|
78
|
+
await rm(directory, { recursive: true, force: true });
|
|
79
|
+
}
|
|
80
|
+
}),
|
|
81
|
+
);
|
|
82
|
+
} catch (error) {
|
|
89
83
|
return [
|
|
90
84
|
{
|
|
91
85
|
status: "fail",
|
|
92
86
|
message: error instanceof Error ? error.message : String(error),
|
|
93
|
-
detail: file,
|
|
94
87
|
},
|
|
95
88
|
];
|
|
96
89
|
}
|
|
@@ -99,6 +92,64 @@ export const lintDoctorPlugin: DoctorPlugin = {
|
|
|
99
92
|
},
|
|
100
93
|
};
|
|
101
94
|
|
|
102
|
-
function
|
|
103
|
-
|
|
95
|
+
async function inspectLinterSetup(context: DoctorContext): Promise<DoctorSetupInspection> {
|
|
96
|
+
try {
|
|
97
|
+
const registry = await LintCommandRegistry.fromDirectory(context.cwd, {
|
|
98
|
+
environment: context.env,
|
|
99
|
+
});
|
|
100
|
+
const selections = [];
|
|
101
|
+
const actions = new Map<string, { readonly id: string; readonly message: string }>();
|
|
102
|
+
|
|
103
|
+
for (const [languageId, files] of context.detectedLanguages) {
|
|
104
|
+
const selected = files
|
|
105
|
+
.map((file) => registry.resolveEntry(file, context.cwd))
|
|
106
|
+
.find((entry) => entry !== undefined);
|
|
107
|
+
if (selected === undefined) {
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
selections.push({ kind: "linter" as const, languageId, toolId: selected.id });
|
|
112
|
+
if (!(await hasConfiguredExecutable(selected.config.check, context.cwd, context.env))) {
|
|
113
|
+
actions.set(selected.id, {
|
|
114
|
+
id: `linter-${selected.id}-unavailable`,
|
|
115
|
+
message: `Configured linter ${selected.id} cannot run ${JSON.stringify(selected.config.check.command)}`,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return { selections, actions: [...actions.values()] };
|
|
121
|
+
} catch (error) {
|
|
122
|
+
return {
|
|
123
|
+
actions: [
|
|
124
|
+
{
|
|
125
|
+
id: "linter-config-invalid",
|
|
126
|
+
message: `Linter configuration cannot load: ${error instanceof Error ? error.message : String(error)}`,
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function applicableLinters(
|
|
134
|
+
registry: LintCommandRegistry,
|
|
135
|
+
files: readonly string[],
|
|
136
|
+
projectRoot: string,
|
|
137
|
+
): readonly {
|
|
138
|
+
readonly entry: EffectiveToolConfigEntry<LinterCommandConfig>;
|
|
139
|
+
readonly source: string;
|
|
140
|
+
}[] {
|
|
141
|
+
const applicable = new Map<
|
|
142
|
+
string,
|
|
143
|
+
{ entry: EffectiveToolConfigEntry<LinterCommandConfig>; source: string }
|
|
144
|
+
>();
|
|
145
|
+
|
|
146
|
+
for (const source of files) {
|
|
147
|
+
const entry = registry.resolveEntry(source, projectRoot);
|
|
148
|
+
|
|
149
|
+
if (entry !== undefined && !applicable.has(entry.id)) {
|
|
150
|
+
applicable.set(entry.id, { entry, source });
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return [...applicable.values()];
|
|
104
155
|
}
|
|
@@ -1,52 +1,109 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { inspectRecipeEvidence } from "pi-agent-doctor/api/evidence";
|
|
2
|
+
import { LINTER_RECIPES } from "./catalog.js";
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
hasConfiguredExecutable,
|
|
6
|
+
loadLayeredToolConfig,
|
|
7
|
+
selectConfiguredEntry,
|
|
6
8
|
parseLintersConfig,
|
|
7
|
-
projectIdeConfigPath,
|
|
8
9
|
} from "pi-agent-ide/api/tool-config";
|
|
9
10
|
|
|
10
|
-
import type {
|
|
11
|
+
import type {
|
|
12
|
+
EffectiveToolConfigEntry,
|
|
13
|
+
LinterCommandConfig,
|
|
14
|
+
LintersConfig,
|
|
15
|
+
LayeredToolConfigOptions,
|
|
16
|
+
} from "pi-agent-ide/api/tool-config";
|
|
11
17
|
|
|
12
18
|
/**
|
|
13
|
-
Validated linter commands
|
|
19
|
+
Validated linter commands in project, global, and built-in priority order.
|
|
14
20
|
*/
|
|
15
21
|
export class LintCommandRegistry {
|
|
16
|
-
private constructor(
|
|
22
|
+
private constructor(
|
|
23
|
+
private readonly linters: readonly EffectiveToolConfigEntry<LinterCommandConfig>[],
|
|
24
|
+
private readonly availableBuiltIns: ReadonlySet<string>,
|
|
25
|
+
|
|
26
|
+
private readonly evidence: ReadonlyMap<string, { readonly score: number }> = new Map(),
|
|
27
|
+
) {}
|
|
17
28
|
|
|
18
29
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
public static async fromDirectory(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
Loads and merges project, global, and built-in `linters.json` files.
|
|
31
|
+
*/
|
|
32
|
+
public static async fromDirectory(
|
|
33
|
+
directory: string,
|
|
34
|
+
options: LayeredToolConfigOptions = {},
|
|
35
|
+
): Promise<LintCommandRegistry> {
|
|
36
|
+
const effective = await loadLayeredToolConfig(
|
|
37
|
+
directory,
|
|
38
|
+
"linters",
|
|
39
|
+
(value) => parseLintersConfig(value).linters,
|
|
40
|
+
options,
|
|
41
|
+
);
|
|
42
|
+
const environment = options.environment ?? process.env;
|
|
43
|
+
const available = await Promise.all(
|
|
44
|
+
effective.entries
|
|
45
|
+
.filter((entry) => entry.layer === "built-in")
|
|
46
|
+
.map(async (entry) => ({
|
|
47
|
+
id: entry.id,
|
|
48
|
+
available: await hasConfiguredExecutable(entry.config.check, directory, environment),
|
|
49
|
+
})),
|
|
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
|
+
);
|
|
57
|
+
return new LintCommandRegistry(
|
|
58
|
+
entries,
|
|
59
|
+
new Set(available.filter((entry) => entry.available).map((entry) => entry.id)),
|
|
60
|
+
|
|
61
|
+
evidence,
|
|
62
|
+
);
|
|
32
63
|
}
|
|
33
64
|
|
|
34
65
|
/**
|
|
35
|
-
|
|
36
|
-
|
|
66
|
+
Creates a project-layer registry from a validated config.
|
|
67
|
+
*/
|
|
37
68
|
public static fromConfig(config: LintersConfig): LintCommandRegistry {
|
|
38
|
-
return new LintCommandRegistry(
|
|
69
|
+
return new LintCommandRegistry(
|
|
70
|
+
Object.entries(config.linters).map(([id, linter]) => ({
|
|
71
|
+
id,
|
|
72
|
+
config: linter,
|
|
73
|
+
layer: "project",
|
|
74
|
+
sourcePath: "<memory>",
|
|
75
|
+
})),
|
|
76
|
+
new Set(),
|
|
77
|
+
);
|
|
39
78
|
}
|
|
40
79
|
|
|
41
80
|
/**
|
|
42
|
-
|
|
43
|
-
|
|
81
|
+
Returns the first command matching this file.
|
|
82
|
+
*/
|
|
44
83
|
public resolve(filePath: string, projectRoot: string): LinterCommandConfig | undefined {
|
|
45
|
-
|
|
46
|
-
return this.linters.find((linter) => matchesConfiguredFile(linter, absolute, projectRoot));
|
|
84
|
+
return this.resolveEntry(filePath, projectRoot)?.config;
|
|
47
85
|
}
|
|
48
|
-
}
|
|
49
86
|
|
|
50
|
-
|
|
51
|
-
|
|
87
|
+
/**
|
|
88
|
+
Returns the first matching command together with its stable ID and source layer.
|
|
89
|
+
*/
|
|
90
|
+
public resolveEntry(
|
|
91
|
+
filePath: string,
|
|
92
|
+
projectRoot: string,
|
|
93
|
+
): EffectiveToolConfigEntry<LinterCommandConfig> | undefined {
|
|
94
|
+
return selectConfiguredEntry(
|
|
95
|
+
this.linters,
|
|
96
|
+
this.availableBuiltIns,
|
|
97
|
+
this.evidence,
|
|
98
|
+
filePath,
|
|
99
|
+
projectRoot,
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
Lists all merged entries in runtime resolution order.
|
|
105
|
+
*/
|
|
106
|
+
public get entries(): readonly EffectiveToolConfigEntry<LinterCommandConfig>[] {
|
|
107
|
+
return this.linters;
|
|
108
|
+
}
|
|
52
109
|
}
|