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
|
@@ -7,18 +7,75 @@ const web = [
|
|
|
7
7
|
".cjs",
|
|
8
8
|
".ts",
|
|
9
9
|
".tsx",
|
|
10
|
+
".mts",
|
|
11
|
+
".cts",
|
|
10
12
|
".json",
|
|
11
13
|
".jsonc",
|
|
12
14
|
".css",
|
|
13
15
|
".scss",
|
|
14
16
|
".html",
|
|
15
17
|
".md",
|
|
18
|
+
".yaml",
|
|
19
|
+
".yml",
|
|
20
|
+
".vue",
|
|
21
|
+
".svelte",
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
const oxfmtExtensions = [
|
|
25
|
+
".js",
|
|
26
|
+
".jsx",
|
|
27
|
+
".mjs",
|
|
28
|
+
".cjs",
|
|
29
|
+
".ts",
|
|
30
|
+
".tsx",
|
|
31
|
+
".mts",
|
|
32
|
+
".cts",
|
|
33
|
+
".json",
|
|
34
|
+
".jsonc",
|
|
35
|
+
".css",
|
|
36
|
+
".scss",
|
|
37
|
+
".less",
|
|
38
|
+
".html",
|
|
39
|
+
".htm",
|
|
40
|
+
".md",
|
|
41
|
+
".markdown",
|
|
42
|
+
".mdx",
|
|
43
|
+
".yaml",
|
|
44
|
+
".yml",
|
|
45
|
+
".toml",
|
|
16
46
|
];
|
|
17
47
|
|
|
18
48
|
/**
|
|
19
49
|
Formatter recipes owned by the formatter plugin.
|
|
20
50
|
*/
|
|
21
51
|
export const FORMATTER_RECIPES: readonly ToolRecipe[] = [
|
|
52
|
+
recipe(
|
|
53
|
+
"dart-format",
|
|
54
|
+
["dart"],
|
|
55
|
+
["dart"],
|
|
56
|
+
["pubspec.yaml", "analysis_options.yaml"],
|
|
57
|
+
[".dart"],
|
|
58
|
+
["dart", "format", "{file}"],
|
|
59
|
+
"https://dart.dev/tools/dart-format",
|
|
60
|
+
),
|
|
61
|
+
recipe(
|
|
62
|
+
"zig-format",
|
|
63
|
+
["zig"],
|
|
64
|
+
["zig"],
|
|
65
|
+
["build.zig", "build.zig.zon", "zls.json"],
|
|
66
|
+
[".zig", ".zon"],
|
|
67
|
+
["zig", "fmt", "{file}"],
|
|
68
|
+
"https://ziglang.org/documentation/master/",
|
|
69
|
+
),
|
|
70
|
+
recipe(
|
|
71
|
+
"styler",
|
|
72
|
+
["r"],
|
|
73
|
+
["Rscript"],
|
|
74
|
+
[".Rprofile", "DESCRIPTION"],
|
|
75
|
+
[".r"],
|
|
76
|
+
["Rscript", "-e", "styler::style_file(commandArgs(TRUE)[1])", "{file}"],
|
|
77
|
+
"https://styler.r-lib.org/",
|
|
78
|
+
),
|
|
22
79
|
recipe(
|
|
23
80
|
"clang-format",
|
|
24
81
|
["c", "cpp"],
|
|
@@ -30,43 +87,72 @@ export const FORMATTER_RECIPES: readonly ToolRecipe[] = [
|
|
|
30
87
|
),
|
|
31
88
|
recipe(
|
|
32
89
|
"prettier",
|
|
33
|
-
["javascript", "typescript", "html", "css", "json", "yaml", "markdown"],
|
|
90
|
+
["javascript", "typescript", "html", "css", "json", "yaml", "markdown", "vue", "svelte"],
|
|
34
91
|
["prettier"],
|
|
35
|
-
[
|
|
92
|
+
[
|
|
93
|
+
".prettierrc",
|
|
94
|
+
".prettierrc.json",
|
|
95
|
+
".prettierrc.json5",
|
|
96
|
+
".prettierrc.yaml",
|
|
97
|
+
".prettierrc.yml",
|
|
98
|
+
".prettierrc.toml",
|
|
99
|
+
".prettierrc.js",
|
|
100
|
+
".prettierrc.cjs",
|
|
101
|
+
".prettierrc.mjs",
|
|
102
|
+
"prettier.config.js",
|
|
103
|
+
"prettier.config.cjs",
|
|
104
|
+
"prettier.config.mjs",
|
|
105
|
+
"prettier.config.ts",
|
|
106
|
+
"prettier.config.mts",
|
|
107
|
+
"prettier.config.cts",
|
|
108
|
+
],
|
|
36
109
|
web,
|
|
37
110
|
["prettier", "--write", "{file}"],
|
|
38
111
|
"https://prettier.io/docs/",
|
|
39
112
|
["prettier"],
|
|
113
|
+
{ "package.json": ["prettier"] },
|
|
40
114
|
),
|
|
41
115
|
recipe(
|
|
42
116
|
"biome",
|
|
43
117
|
["javascript", "typescript", "json", "css"],
|
|
44
118
|
["biome"],
|
|
45
119
|
["biome.json", "biome.jsonc"],
|
|
46
|
-
|
|
120
|
+
[".js", ".jsx", ".mjs", ".cjs", ".ts", ".tsx", ".mts", ".cts", ".json", ".jsonc", ".css"],
|
|
47
121
|
["biome", "format", "--write", "{file}"],
|
|
48
122
|
"https://biomejs.dev/",
|
|
49
123
|
["@biomejs/biome"],
|
|
50
124
|
),
|
|
125
|
+
recipe(
|
|
126
|
+
"oxfmt",
|
|
127
|
+
["javascript", "typescript", "json", "css", "html", "markdown", "yaml", "toml"],
|
|
128
|
+
["oxfmt"],
|
|
129
|
+
[".oxfmtrc.json", ".oxfmtrc.jsonc", "oxfmt.config.ts", "oxfmt.config.mts"],
|
|
130
|
+
oxfmtExtensions,
|
|
131
|
+
["oxfmt", "--write", "{file}"],
|
|
132
|
+
"https://oxc.rs/docs/guide/usage/formatter.html",
|
|
133
|
+
["oxfmt"],
|
|
134
|
+
),
|
|
51
135
|
recipe(
|
|
52
136
|
"ruff-format",
|
|
53
137
|
["python"],
|
|
54
138
|
["ruff"],
|
|
55
|
-
["
|
|
139
|
+
["ruff.toml", ".ruff.toml"],
|
|
56
140
|
[".py", ".pyi"],
|
|
57
141
|
["ruff", "format", "{file}"],
|
|
58
142
|
"https://docs.astral.sh/ruff/formatter/",
|
|
59
143
|
["ruff"],
|
|
144
|
+
{ "pyproject.toml": ["tool.ruff"] },
|
|
60
145
|
),
|
|
61
146
|
recipe(
|
|
62
147
|
"black",
|
|
63
148
|
["python"],
|
|
64
149
|
["black"],
|
|
65
|
-
[
|
|
150
|
+
[],
|
|
66
151
|
[".py", ".pyi"],
|
|
67
152
|
["black", "--quiet", "{file}"],
|
|
68
153
|
"https://black.readthedocs.io/",
|
|
69
154
|
["black"],
|
|
155
|
+
{ "pyproject.toml": ["tool.black"] },
|
|
70
156
|
),
|
|
71
157
|
recipe(
|
|
72
158
|
"gofmt",
|
|
@@ -98,10 +184,10 @@ export const FORMATTER_RECIPES: readonly ToolRecipe[] = [
|
|
|
98
184
|
recipe(
|
|
99
185
|
"csharpier",
|
|
100
186
|
["csharp"],
|
|
101
|
-
["
|
|
102
|
-
[".csharpierrc", ".csharpierrc.json"],
|
|
187
|
+
["csharpier"],
|
|
188
|
+
[".csharpierrc", ".csharpierrc.json", ".csharpierrc.yaml", ".csharpierrc.yml"],
|
|
103
189
|
[".cs"],
|
|
104
|
-
["
|
|
190
|
+
["csharpier", "format", "{file}"],
|
|
105
191
|
"https://csharpier.com/",
|
|
106
192
|
),
|
|
107
193
|
recipe(
|
|
@@ -128,7 +214,7 @@ export const FORMATTER_RECIPES: readonly ToolRecipe[] = [
|
|
|
128
214
|
["rubocop"],
|
|
129
215
|
[".rubocop.yml", "Gemfile"],
|
|
130
216
|
[".rb", ".rake"],
|
|
131
|
-
["rubocop", "-
|
|
217
|
+
["rubocop", "--fix-layout", "{file}"],
|
|
132
218
|
"https://docs.rubocop.org/",
|
|
133
219
|
),
|
|
134
220
|
recipe(
|
|
@@ -202,6 +288,9 @@ export const FORMATTER_RECIPES: readonly ToolRecipe[] = [
|
|
|
202
288
|
[".cmake"],
|
|
203
289
|
["cmake-format", "-i", "{file}"],
|
|
204
290
|
"https://cmake-format.readthedocs.io/",
|
|
291
|
+
undefined,
|
|
292
|
+
undefined,
|
|
293
|
+
["CMakeLists.txt"],
|
|
205
294
|
),
|
|
206
295
|
recipe(
|
|
207
296
|
"xmlformat",
|
|
@@ -212,14 +301,67 @@ export const FORMATTER_RECIPES: readonly ToolRecipe[] = [
|
|
|
212
301
|
["xmlformat", "--overwrite", "{file}"],
|
|
213
302
|
"https://github.com/pamoller/xmlformatter",
|
|
214
303
|
),
|
|
304
|
+
recipe(
|
|
305
|
+
"mix-format",
|
|
306
|
+
["elixir"],
|
|
307
|
+
["mix"],
|
|
308
|
+
["mix.exs", ".formatter.exs"],
|
|
309
|
+
[".ex", ".exs"],
|
|
310
|
+
["mix", "format", "{file}"],
|
|
311
|
+
"https://hexdocs.pm/mix/Mix.Tasks.Format.html",
|
|
312
|
+
),
|
|
313
|
+
recipe(
|
|
314
|
+
"scalafmt",
|
|
315
|
+
["scala"],
|
|
316
|
+
["scalafmt"],
|
|
317
|
+
[".scalafmt.conf"],
|
|
318
|
+
[".scala", ".sc", ".sbt"],
|
|
319
|
+
["scalafmt", "{file}"],
|
|
320
|
+
"https://scalameta.org/scalafmt/",
|
|
321
|
+
),
|
|
322
|
+
recipe(
|
|
323
|
+
"julia-format",
|
|
324
|
+
["julia"],
|
|
325
|
+
["julia"],
|
|
326
|
+
[".JuliaFormatter.toml", "Project.toml"],
|
|
327
|
+
[".jl"],
|
|
328
|
+
[
|
|
329
|
+
"julia",
|
|
330
|
+
"--startup-file=no",
|
|
331
|
+
"--history-file=no",
|
|
332
|
+
"-e",
|
|
333
|
+
"using JuliaFormatter; format_file(ARGS[1])",
|
|
334
|
+
"{file}",
|
|
335
|
+
],
|
|
336
|
+
"https://github.com/domluna/JuliaFormatter.jl",
|
|
337
|
+
),
|
|
338
|
+
recipe(
|
|
339
|
+
"powershell-format",
|
|
340
|
+
["powershell"],
|
|
341
|
+
["pwsh"],
|
|
342
|
+
["PSScriptAnalyzerSettings.psd1"],
|
|
343
|
+
[".ps1", ".psm1", ".psd1"],
|
|
344
|
+
[
|
|
345
|
+
"pwsh",
|
|
346
|
+
"-NoProfile",
|
|
347
|
+
"-NonInteractive",
|
|
348
|
+
"-CommandWithArgs",
|
|
349
|
+
'$ErrorActionPreference="Stop";$p=$args[0];$options=@{};if(Test-Path -LiteralPath PSScriptAnalyzerSettings.psd1){$options.Settings="PSScriptAnalyzerSettings.psd1"};[IO.File]::WriteAllText($p,(Invoke-Formatter -ScriptDefinition ([IO.File]::ReadAllText($p)) @options))',
|
|
350
|
+
"{file}",
|
|
351
|
+
],
|
|
352
|
+
"https://learn.microsoft.com/powershell/module/psscriptanalyzer/invoke-formatter",
|
|
353
|
+
),
|
|
215
354
|
recipe(
|
|
216
355
|
"dockfmt",
|
|
217
356
|
["dockerfile"],
|
|
218
357
|
["dockfmt"],
|
|
219
|
-
["Dockerfile"],
|
|
220
|
-
["
|
|
221
|
-
["dockfmt", "fmt", "{file}"],
|
|
358
|
+
["Dockerfile", "Containerfile"],
|
|
359
|
+
[".dockerfile"],
|
|
360
|
+
["dockfmt", "fmt", "--write", "{file}"],
|
|
222
361
|
"https://github.com/jessfraz/dockfmt",
|
|
362
|
+
undefined,
|
|
363
|
+
undefined,
|
|
364
|
+
["Dockerfile", "Containerfile"],
|
|
223
365
|
),
|
|
224
366
|
];
|
|
225
367
|
|
|
@@ -232,6 +374,9 @@ function recipe(
|
|
|
232
374
|
command: readonly string[],
|
|
233
375
|
documentation: string,
|
|
234
376
|
dependencies?: readonly string[],
|
|
377
|
+
configSections?: Readonly<Record<string, readonly string[]>>,
|
|
378
|
+
|
|
379
|
+
fileNames?: readonly string[],
|
|
235
380
|
): ToolRecipe {
|
|
236
381
|
return {
|
|
237
382
|
id,
|
|
@@ -242,6 +387,13 @@ function recipe(
|
|
|
242
387
|
configFiles,
|
|
243
388
|
documentation,
|
|
244
389
|
...(dependencies && { dependencies }),
|
|
245
|
-
|
|
390
|
+
|
|
391
|
+
...(configSections && { configSections }),
|
|
392
|
+
formatter: {
|
|
393
|
+
extensions,
|
|
394
|
+
...(fileNames && { fileNames }),
|
|
395
|
+
run: { command },
|
|
396
|
+
output: "in-place",
|
|
397
|
+
},
|
|
246
398
|
};
|
|
247
399
|
}
|
|
@@ -1,16 +1,22 @@
|
|
|
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
|
-
parseFormattersConfig,
|
|
7
|
-
projectIdeConfigPath,
|
|
8
|
-
runConfiguredFormatter,
|
|
9
|
-
} from "pi-agent-ide/api/tool-config";
|
|
5
|
+
import { hasConfiguredExecutable, runConfiguredFormatter } from "pi-agent-ide/api/tool-config";
|
|
10
6
|
|
|
11
7
|
import { FORMATTER_RECIPES } from "./catalog.js";
|
|
8
|
+
import { FormatterCommandRegistry } 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 {
|
|
17
|
+
EffectiveToolConfigEntry,
|
|
18
|
+
FormatterCommandConfig,
|
|
19
|
+
} from "pi-agent-ide/api/tool-config";
|
|
14
20
|
|
|
15
21
|
/**
|
|
16
22
|
Doctor contribution owned by the formatter plugin.
|
|
@@ -24,73 +30,61 @@ export const formatterDoctorPlugin: DoctorPlugin = {
|
|
|
24
30
|
api.addToolRecipe(recipe);
|
|
25
31
|
}
|
|
26
32
|
|
|
33
|
+
api.addSetupCheck({
|
|
34
|
+
id: "effective-config",
|
|
35
|
+
inspect: inspectFormatterSetup,
|
|
36
|
+
});
|
|
37
|
+
|
|
27
38
|
api.addCheck({
|
|
28
39
|
id: "config",
|
|
29
40
|
title: "Formatter",
|
|
30
41
|
async run(context) {
|
|
31
|
-
const file = projectIdeConfigPath(context.cwd, "formatters");
|
|
32
|
-
|
|
33
42
|
try {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
message: `${Object.keys(config.formatters).length} formatter mappings loaded`,
|
|
39
|
-
detail: file,
|
|
40
|
-
},
|
|
41
|
-
];
|
|
43
|
+
const registry = await FormatterCommandRegistry.fromDirectory(context.cwd, {
|
|
44
|
+
environment: context.env,
|
|
45
|
+
});
|
|
46
|
+
const applicable = applicableFormatters(registry, context.files, context.cwd);
|
|
42
47
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
formatter
|
|
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 runConfiguredFormatter(formatter, {
|
|
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: path.basename(source),
|
|
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
|
-
}
|
|
48
|
+
if (applicable.length === 0) {
|
|
49
|
+
return [
|
|
50
|
+
{ status: "skip", message: "No formatter matches the inspected project files" },
|
|
51
|
+
];
|
|
81
52
|
}
|
|
82
53
|
|
|
83
|
-
return
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
54
|
+
return await Promise.all(
|
|
55
|
+
applicable.map(async ({ entry, source }): Promise<DoctorFinding> => {
|
|
56
|
+
const label = `${entry.id} [${entry.layer}] command ${JSON.stringify(entry.config.run.command)}`;
|
|
57
|
+
const directory = await mkdtemp(
|
|
58
|
+
path.join(path.dirname(source), ".pi-agent-ide-doctor-"),
|
|
59
|
+
);
|
|
60
|
+
const probe = path.join(directory, path.basename(source));
|
|
88
61
|
|
|
62
|
+
try {
|
|
63
|
+
await copyFile(source, probe);
|
|
64
|
+
const result = await runConfiguredFormatter(entry.config, {
|
|
65
|
+
projectRoot: context.cwd,
|
|
66
|
+
filePath: probe,
|
|
67
|
+
env: context.env,
|
|
68
|
+
});
|
|
69
|
+
return result.ok
|
|
70
|
+
? { status: "pass", message: `${label}: probe passed`, detail: entry.sourcePath }
|
|
71
|
+
: { status: "fail", message: `${label}: probe failed`, detail: entry.sourcePath };
|
|
72
|
+
} catch (error) {
|
|
73
|
+
return {
|
|
74
|
+
status: "fail",
|
|
75
|
+
message: `${label}: ${error instanceof Error ? error.message : String(error)}`,
|
|
76
|
+
detail: entry.sourcePath,
|
|
77
|
+
};
|
|
78
|
+
} finally {
|
|
79
|
+
await rm(directory, { recursive: true, force: true });
|
|
80
|
+
}
|
|
81
|
+
}),
|
|
82
|
+
);
|
|
83
|
+
} catch (error) {
|
|
89
84
|
return [
|
|
90
85
|
{
|
|
91
86
|
status: "fail",
|
|
92
87
|
message: error instanceof Error ? error.message : String(error),
|
|
93
|
-
detail: file,
|
|
94
88
|
},
|
|
95
89
|
];
|
|
96
90
|
}
|
|
@@ -99,6 +93,64 @@ export const formatterDoctorPlugin: DoctorPlugin = {
|
|
|
99
93
|
},
|
|
100
94
|
};
|
|
101
95
|
|
|
102
|
-
function
|
|
103
|
-
|
|
96
|
+
async function inspectFormatterSetup(context: DoctorContext): Promise<DoctorSetupInspection> {
|
|
97
|
+
try {
|
|
98
|
+
const registry = await FormatterCommandRegistry.fromDirectory(context.cwd, {
|
|
99
|
+
environment: context.env,
|
|
100
|
+
});
|
|
101
|
+
const selections = [];
|
|
102
|
+
const actions = new Map<string, { readonly id: string; readonly message: string }>();
|
|
103
|
+
|
|
104
|
+
for (const [languageId, files] of context.detectedLanguages) {
|
|
105
|
+
const selected = files
|
|
106
|
+
.map((file) => registry.resolveEntry(file, context.cwd))
|
|
107
|
+
.find((entry) => entry !== undefined);
|
|
108
|
+
if (selected === undefined) {
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
selections.push({ kind: "formatter" as const, languageId, toolId: selected.id });
|
|
113
|
+
if (!(await hasConfiguredExecutable(selected.config.run, context.cwd, context.env))) {
|
|
114
|
+
actions.set(selected.id, {
|
|
115
|
+
id: `formatter-${selected.id}-unavailable`,
|
|
116
|
+
message: `Configured formatter ${selected.id} cannot run ${JSON.stringify(selected.config.run.command)}`,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return { selections, actions: [...actions.values()] };
|
|
122
|
+
} catch (error) {
|
|
123
|
+
return {
|
|
124
|
+
actions: [
|
|
125
|
+
{
|
|
126
|
+
id: "formatter-config-invalid",
|
|
127
|
+
message: `Formatter configuration cannot load: ${error instanceof Error ? error.message : String(error)}`,
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function applicableFormatters(
|
|
135
|
+
registry: FormatterCommandRegistry,
|
|
136
|
+
files: readonly string[],
|
|
137
|
+
projectRoot: string,
|
|
138
|
+
): readonly {
|
|
139
|
+
readonly entry: EffectiveToolConfigEntry<FormatterCommandConfig>;
|
|
140
|
+
readonly source: string;
|
|
141
|
+
}[] {
|
|
142
|
+
const applicable = new Map<
|
|
143
|
+
string,
|
|
144
|
+
{ entry: EffectiveToolConfigEntry<FormatterCommandConfig>; source: string }
|
|
145
|
+
>();
|
|
146
|
+
|
|
147
|
+
for (const source of files) {
|
|
148
|
+
const entry = registry.resolveEntry(source, projectRoot);
|
|
149
|
+
|
|
150
|
+
if (entry !== undefined && !applicable.has(entry.id)) {
|
|
151
|
+
applicable.set(entry.id, { entry, source });
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return [...applicable.values()];
|
|
104
156
|
}
|
|
@@ -1,54 +1,109 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { inspectRecipeEvidence } from "pi-agent-doctor/api/evidence";
|
|
2
|
+
import { FORMATTER_RECIPES } from "./catalog.js";
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
hasConfiguredExecutable,
|
|
6
|
+
loadLayeredToolConfig,
|
|
7
|
+
selectConfiguredEntry,
|
|
6
8
|
parseFormattersConfig,
|
|
7
|
-
projectIdeConfigPath,
|
|
8
9
|
} from "pi-agent-ide/api/tool-config";
|
|
9
10
|
|
|
10
|
-
import type {
|
|
11
|
+
import type {
|
|
12
|
+
EffectiveToolConfigEntry,
|
|
13
|
+
FormatterCommandConfig,
|
|
14
|
+
FormattersConfig,
|
|
15
|
+
LayeredToolConfigOptions,
|
|
16
|
+
} from "pi-agent-ide/api/tool-config";
|
|
11
17
|
|
|
12
18
|
/**
|
|
13
|
-
Validated formatter commands
|
|
19
|
+
Validated formatter commands in project, global, and built-in priority order.
|
|
14
20
|
*/
|
|
15
21
|
export class FormatterCommandRegistry {
|
|
16
|
-
private constructor(
|
|
22
|
+
private constructor(
|
|
23
|
+
private readonly formatters: readonly EffectiveToolConfigEntry<FormatterCommandConfig>[],
|
|
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 `formatters.json` files.
|
|
31
|
+
*/
|
|
32
|
+
public static async fromDirectory(
|
|
33
|
+
directory: string,
|
|
34
|
+
options: LayeredToolConfigOptions = {},
|
|
35
|
+
): Promise<FormatterCommandRegistry> {
|
|
36
|
+
const effective = await loadLayeredToolConfig(
|
|
37
|
+
directory,
|
|
38
|
+
"formatters",
|
|
39
|
+
(value) => parseFormattersConfig(value).formatters,
|
|
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.run, directory, environment),
|
|
49
|
+
})),
|
|
50
|
+
);
|
|
51
|
+
const evidence = await inspectRecipeEvidence(directory, FORMATTER_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 FormatterCommandRegistry(
|
|
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 value.
|
|
67
|
+
*/
|
|
37
68
|
public static fromConfig(config: FormattersConfig): FormatterCommandRegistry {
|
|
38
|
-
return new FormatterCommandRegistry(
|
|
69
|
+
return new FormatterCommandRegistry(
|
|
70
|
+
Object.entries(config.formatters).map(([id, formatter]) => ({
|
|
71
|
+
id,
|
|
72
|
+
config: formatter,
|
|
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): FormatterCommandConfig | undefined {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
84
|
+
return this.resolveEntry(filePath, projectRoot)?.config;
|
|
85
|
+
}
|
|
86
|
+
|
|
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<FormatterCommandConfig> | undefined {
|
|
94
|
+
return selectConfiguredEntry(
|
|
95
|
+
this.formatters,
|
|
96
|
+
this.availableBuiltIns,
|
|
97
|
+
this.evidence,
|
|
98
|
+
filePath,
|
|
99
|
+
projectRoot,
|
|
48
100
|
);
|
|
49
101
|
}
|
|
50
|
-
}
|
|
51
102
|
|
|
52
|
-
|
|
53
|
-
|
|
103
|
+
/**
|
|
104
|
+
Lists all merged entries in runtime resolution order.
|
|
105
|
+
*/
|
|
106
|
+
public get entries(): readonly EffectiveToolConfigEntry<FormatterCommandConfig>[] {
|
|
107
|
+
return this.formatters;
|
|
108
|
+
}
|
|
54
109
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-languages",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-doctor": "0.
|
|
6
|
+
"pi-agent-doctor": "0.2.1"
|
|
7
7
|
},
|
|
8
8
|
"pi": {
|
|
9
9
|
"extensions": [
|
|
10
|
-
"./
|
|
10
|
+
"./runtime/entry-30.js"
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
@@ -48,6 +48,21 @@ export const LANGUAGES: readonly LanguageDefinition[] = [
|
|
|
48
48
|
language("php", "PHP", [".php"], ["composer.json"]),
|
|
49
49
|
language("swift", "Swift", [".swift"], ["Package.swift"]),
|
|
50
50
|
language("lua", "Lua", [".lua"], [".luarc.json", "stylua.toml"]),
|
|
51
|
+
|
|
52
|
+
language("dart", "Dart", [".dart"], ["pubspec.yaml", "analysis_options.yaml"]),
|
|
53
|
+
language(
|
|
54
|
+
"powershell",
|
|
55
|
+
"PowerShell",
|
|
56
|
+
[".ps1", ".psm1", ".psd1"],
|
|
57
|
+
["PSScriptAnalyzerSettings.psd1"],
|
|
58
|
+
),
|
|
59
|
+
language("r", "R", [".r"], ["DESCRIPTION", ".lintr", ".Rprofile"]),
|
|
60
|
+
language("scala", "Scala", [".scala", ".sc"], ["build.sbt", "project.scala", ".scalafmt.conf"]),
|
|
61
|
+
language("elixir", "Elixir", [".ex", ".exs"], ["mix.exs", ".formatter.exs"]),
|
|
62
|
+
language("zig", "Zig", [".zig", ".zon"], ["build.zig", "build.zig.zon", "zls.json"]),
|
|
63
|
+
language("julia", "Julia", [".jl"], ["Project.toml", ".JuliaFormatter.toml"]),
|
|
64
|
+
language("vue", "Vue", [".vue"], ["package.json"]),
|
|
65
|
+
language("svelte", "Svelte", [".svelte"], ["svelte.config.js", "svelte.config.ts"]),
|
|
51
66
|
language("shell", "Shell", [".sh", ".bash", ".zsh"], [".shellcheckrc"]),
|
|
52
67
|
language("html", "HTML", [".html", ".htm"], []),
|
|
53
68
|
language("css", "CSS", [".css", ".scss", ".sass", ".less"], ["stylelint.config.js"]),
|