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
package/src/doctor/core.ts
CHANGED
|
@@ -4,6 +4,9 @@ import type {
|
|
|
4
4
|
DoctorFinding,
|
|
5
5
|
DoctorPlugin,
|
|
6
6
|
DoctorPluginApi,
|
|
7
|
+
DoctorSetupAction,
|
|
8
|
+
DoctorSetupCheck,
|
|
9
|
+
DoctorToolSelection,
|
|
7
10
|
} from "#src/api/doctor.js";
|
|
8
11
|
import type { LanguageDefinition, ToolRecipe } from "#src/api/tool-catalog.js";
|
|
9
12
|
|
|
@@ -15,6 +18,7 @@ export interface OwnedContribution<T> {
|
|
|
15
18
|
export interface DoctorSnapshot {
|
|
16
19
|
readonly languages: readonly OwnedContribution<LanguageDefinition>[];
|
|
17
20
|
readonly recipes: readonly OwnedContribution<ToolRecipe>[];
|
|
21
|
+
readonly setupChecks: readonly OwnedContribution<DoctorSetupCheck>[];
|
|
18
22
|
readonly checks: readonly OwnedContribution<DoctorCheck>[];
|
|
19
23
|
}
|
|
20
24
|
|
|
@@ -25,6 +29,7 @@ export class DoctorCore {
|
|
|
25
29
|
private readonly plugins = new Map<string, Promise<void>>();
|
|
26
30
|
private readonly languages: OwnedContribution<LanguageDefinition>[] = [];
|
|
27
31
|
private readonly recipes: OwnedContribution<ToolRecipe>[] = [];
|
|
32
|
+
private readonly setupChecks: OwnedContribution<DoctorSetupCheck>[] = [];
|
|
28
33
|
private readonly checks: OwnedContribution<DoctorCheck>[] = [];
|
|
29
34
|
private queue = Promise.resolve();
|
|
30
35
|
|
|
@@ -42,6 +47,7 @@ export class DoctorCore {
|
|
|
42
47
|
let isOpen = true;
|
|
43
48
|
const ownLanguages: OwnedContribution<LanguageDefinition>[] = [];
|
|
44
49
|
const ownRecipes: OwnedContribution<ToolRecipe>[] = [];
|
|
50
|
+
const ownSetupChecks: OwnedContribution<DoctorSetupCheck>[] = [];
|
|
45
51
|
const ownChecks: OwnedContribution<DoctorCheck>[] = [];
|
|
46
52
|
const api: DoctorPluginApi = {
|
|
47
53
|
addLanguage: (value) => {
|
|
@@ -50,6 +56,9 @@ export class DoctorCore {
|
|
|
50
56
|
addToolRecipe: (value) => {
|
|
51
57
|
add(value, ownRecipes, plugin.id, "tool recipe", () => isOpen);
|
|
52
58
|
},
|
|
59
|
+
addSetupCheck: (value) => {
|
|
60
|
+
add(value, ownSetupChecks, plugin.id, "setup check", () => isOpen);
|
|
61
|
+
},
|
|
53
62
|
addCheck: (value) => {
|
|
54
63
|
add(value, ownChecks, plugin.id, "check", () => isOpen);
|
|
55
64
|
},
|
|
@@ -65,6 +74,7 @@ export class DoctorCore {
|
|
|
65
74
|
assertAvailable(this.recipes, ownRecipes, "tool recipe");
|
|
66
75
|
this.languages.push(...ownLanguages);
|
|
67
76
|
this.recipes.push(...ownRecipes);
|
|
77
|
+
this.setupChecks.push(...ownSetupChecks);
|
|
68
78
|
this.checks.push(...ownChecks);
|
|
69
79
|
return undefined;
|
|
70
80
|
});
|
|
@@ -91,11 +101,48 @@ export class DoctorCore {
|
|
|
91
101
|
return {
|
|
92
102
|
languages: [...this.languages],
|
|
93
103
|
recipes: [...this.recipes],
|
|
104
|
+
setupChecks: [...this.setupChecks],
|
|
94
105
|
checks: [...this.checks],
|
|
95
106
|
};
|
|
96
107
|
}
|
|
97
108
|
}
|
|
98
109
|
|
|
110
|
+
export interface DoctorSetupState {
|
|
111
|
+
readonly selections: readonly (DoctorToolSelection & { readonly pluginId: string })[];
|
|
112
|
+
readonly actions: readonly (DoctorSetupAction & { readonly pluginId: string })[];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** Runs lightweight setup checks while isolating a broken plugin. */
|
|
116
|
+
export async function runContributedSetupChecks(
|
|
117
|
+
snapshot: DoctorSnapshot,
|
|
118
|
+
context: DoctorContext,
|
|
119
|
+
): Promise<DoctorSetupState> {
|
|
120
|
+
const selections: (DoctorToolSelection & { readonly pluginId: string })[] = [];
|
|
121
|
+
const actions: (DoctorSetupAction & { readonly pluginId: string })[] = [];
|
|
122
|
+
|
|
123
|
+
for (const contribution of snapshot.setupChecks) {
|
|
124
|
+
try {
|
|
125
|
+
const result = await contribution.value.inspect(context);
|
|
126
|
+
selections.push(
|
|
127
|
+
...(result.selections ?? []).map((selection) => ({
|
|
128
|
+
...selection,
|
|
129
|
+
pluginId: contribution.pluginId,
|
|
130
|
+
})),
|
|
131
|
+
);
|
|
132
|
+
actions.push(
|
|
133
|
+
...(result.actions ?? []).map((action) => ({
|
|
134
|
+
...action,
|
|
135
|
+
pluginId: contribution.pluginId,
|
|
136
|
+
})),
|
|
137
|
+
);
|
|
138
|
+
} catch {
|
|
139
|
+
// Setup guidance is optional. An internal inspection failure is not a user action.
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return { selections, actions };
|
|
144
|
+
}
|
|
145
|
+
|
|
99
146
|
/**
|
|
100
147
|
Executes checks independently so one broken plugin cannot hide the rest.
|
|
101
148
|
*/
|
package/src/doctor/discovery.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
|
|
3
|
+
import { inspectRecipeEvidence } from "pi-agent-doctor/api/evidence";
|
|
4
|
+
|
|
5
|
+
import { isExecutableAvailable } from "pi-agent-doctor/api/executable";
|
|
3
6
|
|
|
4
7
|
import { projectIdeConfigPath } from "#src/api/tool-config.js";
|
|
8
|
+
import type { DoctorToolSelection } from "#src/api/doctor.js";
|
|
5
9
|
import type { ToolRecipe } from "#src/api/tool-catalog.js";
|
|
6
10
|
import type { OwnedContribution } from "./core.js";
|
|
7
11
|
|
|
@@ -22,7 +26,10 @@ export async function discoverRecipeCandidates(
|
|
|
22
26
|
recipes: readonly OwnedContribution<ToolRecipe>[],
|
|
23
27
|
environment: NodeJS.ProcessEnv = process.env,
|
|
24
28
|
): Promise<readonly RecipeCandidate[]> {
|
|
25
|
-
const
|
|
29
|
+
const nativeEvidence = await inspectRecipeEvidence(
|
|
30
|
+
cwd,
|
|
31
|
+
recipes.map((entry) => entry.value),
|
|
32
|
+
);
|
|
26
33
|
const managedRecipes = await managedRecipeIds(cwd);
|
|
27
34
|
const candidates: RecipeCandidate[] = [];
|
|
28
35
|
|
|
@@ -35,7 +42,8 @@ export async function discoverRecipeCandidates(
|
|
|
35
42
|
|
|
36
43
|
const evidence: string[] = [];
|
|
37
44
|
let score = 1;
|
|
38
|
-
const
|
|
45
|
+
const native = nativeEvidence.get(recipe.id);
|
|
46
|
+
const nativeConfig = native?.config;
|
|
39
47
|
|
|
40
48
|
if (nativeConfig !== undefined) {
|
|
41
49
|
score += 6;
|
|
@@ -47,7 +55,7 @@ export async function discoverRecipeCandidates(
|
|
|
47
55
|
evidence.push("Pi Agent IDE config");
|
|
48
56
|
}
|
|
49
57
|
|
|
50
|
-
const dependency =
|
|
58
|
+
const dependency = native?.dependency;
|
|
51
59
|
|
|
52
60
|
if (dependency !== undefined) {
|
|
53
61
|
score += 4;
|
|
@@ -81,17 +89,24 @@ Selects at most one recipe per language and tool kind.
|
|
|
81
89
|
export function selectSuggestedRecipes(
|
|
82
90
|
candidates: readonly RecipeCandidate[],
|
|
83
91
|
detectedLanguageIds: ReadonlySet<string>,
|
|
92
|
+
selections: readonly DoctorToolSelection[] = [],
|
|
84
93
|
): readonly RecipeCandidate[] {
|
|
85
94
|
const selected = new Map<string, RecipeCandidate>();
|
|
95
|
+
const activeBySlot = new Map(
|
|
96
|
+
selections.map((selection) => [`${selection.kind}:${selection.languageId}`, selection.toolId]),
|
|
97
|
+
);
|
|
86
98
|
|
|
87
99
|
for (const language of detectedLanguageIds) {
|
|
88
100
|
for (const kind of ["formatter", "linter", "lsp"] as const) {
|
|
101
|
+
const activeToolId = activeBySlot.get(`${kind}:${language}`);
|
|
102
|
+
const minimumScore = activeToolId === undefined ? 4 : 7;
|
|
89
103
|
const matches = candidates.filter(
|
|
90
104
|
(candidate) =>
|
|
91
105
|
candidate.recipe.kind === kind &&
|
|
92
106
|
candidate.recipe.languages.includes(language) &&
|
|
93
107
|
candidate.executable !== undefined &&
|
|
94
|
-
candidate.
|
|
108
|
+
candidate.recipe.id !== activeToolId &&
|
|
109
|
+
candidate.score >= minimumScore,
|
|
95
110
|
);
|
|
96
111
|
const best = matches[0];
|
|
97
112
|
|
|
@@ -103,54 +118,21 @@ export function selectSuggestedRecipes(
|
|
|
103
118
|
continue;
|
|
104
119
|
}
|
|
105
120
|
|
|
106
|
-
selected.set(best.recipe.id
|
|
121
|
+
selected.set(`${best.recipe.kind}:${best.recipe.id}`, best);
|
|
107
122
|
}
|
|
108
123
|
}
|
|
109
124
|
|
|
110
125
|
return [...selected.values()];
|
|
111
126
|
}
|
|
112
127
|
|
|
113
|
-
async function firstExisting(cwd: string, names: readonly string[]): Promise<string | undefined> {
|
|
114
|
-
for (const name of names) {
|
|
115
|
-
try {
|
|
116
|
-
await access(path.join(cwd, name));
|
|
117
|
-
return name;
|
|
118
|
-
} catch {
|
|
119
|
-
// Try the next project marker.
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return undefined;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
128
|
async function firstExecutable(
|
|
127
129
|
cwd: string,
|
|
128
130
|
names: readonly string[],
|
|
129
131
|
environment: NodeJS.ProcessEnv,
|
|
130
132
|
): Promise<string | undefined> {
|
|
131
|
-
const pathDirectories = (environment.PATH ?? "").split(path.delimiter).filter(Boolean);
|
|
132
|
-
const directories = [path.join(cwd, "node_modules", ".bin"), ...pathDirectories];
|
|
133
|
-
|
|
134
133
|
for (const name of names) {
|
|
135
|
-
if (name
|
|
136
|
-
try {
|
|
137
|
-
await access(path.resolve(cwd, name));
|
|
138
|
-
return name;
|
|
139
|
-
} catch {
|
|
140
|
-
continue;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
for (const directory of directories) {
|
|
145
|
-
try {
|
|
146
|
-
await access(path.join(directory, name));
|
|
147
|
-
return name;
|
|
148
|
-
} catch {
|
|
149
|
-
// Try the next executable location.
|
|
150
|
-
}
|
|
151
|
-
}
|
|
134
|
+
if (await isExecutableAvailable(name, cwd, environment)) return name;
|
|
152
135
|
}
|
|
153
|
-
|
|
154
136
|
return undefined;
|
|
155
137
|
}
|
|
156
138
|
|
|
@@ -184,32 +166,3 @@ async function managedRecipeIds(cwd: string): Promise<ReadonlySet<string>> {
|
|
|
184
166
|
|
|
185
167
|
return ids;
|
|
186
168
|
}
|
|
187
|
-
|
|
188
|
-
async function packageDependencies(cwd: string): Promise<ReadonlySet<string>> {
|
|
189
|
-
try {
|
|
190
|
-
const value = JSON.parse(await readFile(path.join(cwd, "package.json"), "utf8")) as Record<
|
|
191
|
-
string,
|
|
192
|
-
unknown
|
|
193
|
-
>;
|
|
194
|
-
const names = new Set<string>();
|
|
195
|
-
|
|
196
|
-
for (const key of [
|
|
197
|
-
"dependencies",
|
|
198
|
-
"devDependencies",
|
|
199
|
-
"peerDependencies",
|
|
200
|
-
"optionalDependencies",
|
|
201
|
-
]) {
|
|
202
|
-
const section = value[key];
|
|
203
|
-
|
|
204
|
-
if (typeof section === "object" && section !== null && !Array.isArray(section)) {
|
|
205
|
-
for (const name of Object.keys(section)) {
|
|
206
|
-
names.add(name);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
return names;
|
|
212
|
-
} catch {
|
|
213
|
-
return new Set();
|
|
214
|
-
}
|
|
215
|
-
}
|
package/src/doctor/extension.ts
CHANGED
|
@@ -8,7 +8,14 @@ import {
|
|
|
8
8
|
|
|
9
9
|
import { writeSuggestedConfigs } from "./config-writer.js";
|
|
10
10
|
import { DoctorCore } from "./core.js";
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
buildDoctorAgentPrompt,
|
|
13
|
+
doctorNeedsWork,
|
|
14
|
+
formatDoctorReport,
|
|
15
|
+
inspectDoctorSetup,
|
|
16
|
+
runDoctor,
|
|
17
|
+
} from "./run.js";
|
|
18
|
+
import { registerDoctorTipProvider } from "./tip-provider.js";
|
|
12
19
|
|
|
13
20
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
14
21
|
|
|
@@ -17,6 +24,10 @@ Registers the modular doctor core and `/pi-agent-ide-doctor`.
|
|
|
17
24
|
*/
|
|
18
25
|
export default async function registerDoctor(pi: ExtensionAPI): Promise<void> {
|
|
19
26
|
const core = new DoctorCore();
|
|
27
|
+
registerDoctorTipProvider(pi, async (context) => {
|
|
28
|
+
await core.waitForPlugins();
|
|
29
|
+
return inspectDoctorSetup(core.snapshot(), context.cwd, process.env, context.signal);
|
|
30
|
+
});
|
|
20
31
|
let delegatedProject: string | undefined;
|
|
21
32
|
const unsubscribe = pi.events.on(DOCTOR_PLUGIN_REGISTER_EVENT, (request) => {
|
|
22
33
|
if (!isDoctorPluginRegistrationRequest(request)) {
|
package/src/doctor/inventory.ts
CHANGED
|
@@ -23,7 +23,11 @@ const skippedDirectories = new Set([
|
|
|
23
23
|
/**
|
|
24
24
|
Collects project files while respecting Git ignores when Git is available.
|
|
25
25
|
*/
|
|
26
|
-
export async function collectProjectFiles(
|
|
26
|
+
export async function collectProjectFiles(
|
|
27
|
+
cwd: string,
|
|
28
|
+
signal?: AbortSignal,
|
|
29
|
+
): Promise<readonly string[]> {
|
|
30
|
+
signal?.throwIfAborted();
|
|
27
31
|
try {
|
|
28
32
|
const result = await execFileAsync(
|
|
29
33
|
"git",
|
|
@@ -32,15 +36,20 @@ export async function collectProjectFiles(cwd: string): Promise<readonly string[
|
|
|
32
36
|
cwd,
|
|
33
37
|
encoding: "utf8",
|
|
34
38
|
maxBuffer: 16 * 1024 * 1024,
|
|
39
|
+
|
|
40
|
+
signal,
|
|
35
41
|
},
|
|
36
42
|
);
|
|
37
43
|
const files = result.stdout
|
|
38
44
|
.split("\0")
|
|
39
45
|
.filter(Boolean)
|
|
40
|
-
.map((file) => path.resolve(cwd, file))
|
|
41
|
-
|
|
46
|
+
.map((file) => path.resolve(cwd, file))
|
|
47
|
+
.filter((file) => !isManagedIdeConfig(file));
|
|
48
|
+
signal?.throwIfAborted();
|
|
49
|
+
return files.length > 0 ? files : await walk(cwd, signal);
|
|
42
50
|
} catch {
|
|
43
|
-
|
|
51
|
+
signal?.throwIfAborted();
|
|
52
|
+
return walk(cwd, signal);
|
|
44
53
|
}
|
|
45
54
|
}
|
|
46
55
|
|
|
@@ -70,7 +79,8 @@ export function detectProjectLanguages(
|
|
|
70
79
|
return detected;
|
|
71
80
|
}
|
|
72
81
|
|
|
73
|
-
async function walk(directory: string): Promise<string[]> {
|
|
82
|
+
async function walk(directory: string, signal?: AbortSignal): Promise<string[]> {
|
|
83
|
+
signal?.throwIfAborted();
|
|
74
84
|
const files: string[] = [];
|
|
75
85
|
|
|
76
86
|
for (const entry of await readdir(directory, { withFileTypes: true })) {
|
|
@@ -80,8 +90,12 @@ async function walk(directory: string): Promise<string[]> {
|
|
|
80
90
|
|
|
81
91
|
const absolute = path.join(directory, entry.name);
|
|
82
92
|
|
|
93
|
+
if (isManagedIdeConfig(absolute)) {
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
|
|
83
97
|
if (entry.isDirectory()) {
|
|
84
|
-
files.push(...(await walk(absolute)));
|
|
98
|
+
files.push(...(await walk(absolute, signal)));
|
|
85
99
|
} else if (entry.isFile()) {
|
|
86
100
|
files.push(absolute);
|
|
87
101
|
}
|
|
@@ -89,3 +103,7 @@ async function walk(directory: string): Promise<string[]> {
|
|
|
89
103
|
|
|
90
104
|
return files;
|
|
91
105
|
}
|
|
106
|
+
|
|
107
|
+
function isManagedIdeConfig(file: string): boolean {
|
|
108
|
+
return file.split(path.sep).join("/").includes("/.pi/pi-agent-ide/");
|
|
109
|
+
}
|
package/src/doctor/run.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
|
|
3
|
-
import { runContributedChecks } from "./core.js";
|
|
3
|
+
import { runContributedChecks, runContributedSetupChecks } from "./core.js";
|
|
4
4
|
import { discoverRecipeCandidates, selectSuggestedRecipes } from "./discovery.js";
|
|
5
5
|
import { collectProjectFiles, detectProjectLanguages } from "./inventory.js";
|
|
6
6
|
|
|
7
|
-
import type { DoctorFinding } from "#src/api/doctor.js";
|
|
7
|
+
import type { DoctorFinding, DoctorSetupAction, DoctorToolSelection } from "#src/api/doctor.js";
|
|
8
8
|
import type { DoctorSnapshot } from "./core.js";
|
|
9
9
|
import type { RecipeCandidate } from "./discovery.js";
|
|
10
10
|
|
|
@@ -14,55 +14,112 @@ export interface DoctorSection {
|
|
|
14
14
|
readonly findings: readonly DoctorFinding[];
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export interface
|
|
17
|
+
export interface DoctorSetupRun {
|
|
18
18
|
readonly cwd: string;
|
|
19
19
|
readonly files: readonly string[];
|
|
20
20
|
readonly detectedLanguages: ReadonlyMap<string, readonly string[]>;
|
|
21
21
|
readonly candidates: readonly RecipeCandidate[];
|
|
22
22
|
readonly suggestions: readonly RecipeCandidate[];
|
|
23
|
+
readonly selections: readonly (DoctorToolSelection & { readonly pluginId: string })[];
|
|
24
|
+
readonly actions: readonly (DoctorSetupAction & { readonly pluginId: string })[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface DoctorRun extends DoctorSetupRun {
|
|
23
28
|
readonly sections: readonly DoctorSection[];
|
|
24
29
|
}
|
|
25
30
|
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
*/
|
|
29
|
-
export async function runDoctor(
|
|
31
|
+
/** Runs the lightweight setup inspection used by startup guidance. */
|
|
32
|
+
export async function inspectDoctorSetup(
|
|
30
33
|
snapshot: DoctorSnapshot,
|
|
31
34
|
cwd: string,
|
|
32
35
|
environment: NodeJS.ProcessEnv = process.env,
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
signal?: AbortSignal,
|
|
37
|
+
): Promise<DoctorSetupRun> {
|
|
38
|
+
signal?.throwIfAborted();
|
|
39
|
+
const files = await collectProjectFiles(cwd, signal);
|
|
40
|
+
signal?.throwIfAborted();
|
|
35
41
|
const detectedLanguages = detectProjectLanguages(
|
|
36
42
|
files,
|
|
37
43
|
snapshot.languages.map((entry) => entry.value),
|
|
38
44
|
);
|
|
39
|
-
const
|
|
40
|
-
const context = { cwd, files, detectedLanguageIds
|
|
41
|
-
const [candidates,
|
|
42
|
-
discoverRecipeCandidates(cwd,
|
|
43
|
-
|
|
45
|
+
const detectedLanguageIds = new Set(detectedLanguages.keys());
|
|
46
|
+
const context = { cwd, files, detectedLanguageIds, detectedLanguages, env: environment };
|
|
47
|
+
const [candidates, setup] = await Promise.all([
|
|
48
|
+
discoverRecipeCandidates(cwd, detectedLanguageIds, snapshot.recipes, environment),
|
|
49
|
+
runContributedSetupChecks(snapshot, context),
|
|
44
50
|
]);
|
|
51
|
+
|
|
52
|
+
const missingActions = new Map<string, DoctorSetupAction & { readonly pluginId: string }>();
|
|
53
|
+
for (const language of detectedLanguageIds) {
|
|
54
|
+
for (const kind of ["formatter", "linter", "lsp"] as const) {
|
|
55
|
+
if (
|
|
56
|
+
setup.selections.some(
|
|
57
|
+
(selection) => selection.languageId === language && selection.kind === kind,
|
|
58
|
+
)
|
|
59
|
+
)
|
|
60
|
+
continue;
|
|
61
|
+
const relevant = candidates.filter(
|
|
62
|
+
(candidate) =>
|
|
63
|
+
candidate.recipe.kind === kind && candidate.recipe.languages.includes(language),
|
|
64
|
+
);
|
|
65
|
+
const nativeScore = (candidate: RecipeCandidate) =>
|
|
66
|
+
candidate.score - (candidate.executable === undefined ? 0 : 3);
|
|
67
|
+
const bestScore = Math.max(1, ...relevant.map(nativeScore));
|
|
68
|
+
for (const candidate of relevant) {
|
|
69
|
+
if (
|
|
70
|
+
candidate.executable !== undefined ||
|
|
71
|
+
nativeScore(candidate) !== bestScore ||
|
|
72
|
+
bestScore <= 1
|
|
73
|
+
)
|
|
74
|
+
continue;
|
|
75
|
+
const id = `${kind}-${candidate.recipe.id}-unavailable`;
|
|
76
|
+
missingActions.set(id, {
|
|
77
|
+
id,
|
|
78
|
+
pluginId: candidate.pluginId,
|
|
79
|
+
message: `Native project setup selects ${candidate.recipe.id}, but its executable is unavailable. Install ${candidate.recipe.executables.join(" or ")} and run Doctor again.`,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
cwd,
|
|
86
|
+
files,
|
|
87
|
+
detectedLanguages,
|
|
88
|
+
candidates,
|
|
89
|
+
selections: setup.selections,
|
|
90
|
+
actions: [...setup.actions, ...missingActions.values()],
|
|
91
|
+
suggestions: selectSuggestedRecipes(candidates, detectedLanguageIds, setup.selections),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Runs one deterministic full doctor inspection from the current contribution snapshot. */
|
|
96
|
+
export async function runDoctor(
|
|
97
|
+
snapshot: DoctorSnapshot,
|
|
98
|
+
cwd: string,
|
|
99
|
+
environment: NodeJS.ProcessEnv = process.env,
|
|
100
|
+
): Promise<DoctorRun> {
|
|
101
|
+
const setup = await inspectDoctorSetup(snapshot, cwd, environment);
|
|
102
|
+
const detectedLanguageIds = new Set(setup.detectedLanguages.keys());
|
|
103
|
+
const context = {
|
|
104
|
+
cwd,
|
|
105
|
+
files: setup.files,
|
|
106
|
+
detectedLanguageIds,
|
|
107
|
+
detectedLanguages: setup.detectedLanguages,
|
|
108
|
+
env: environment,
|
|
109
|
+
};
|
|
110
|
+
const checks = await runContributedChecks(snapshot, context);
|
|
45
111
|
const projectFindings: DoctorFinding[] = [
|
|
46
112
|
{ status: "pass", message: `Project: ${cwd}` },
|
|
47
|
-
files.length > 0
|
|
48
|
-
? { status: "pass", message: `${files.length} project files inspected` }
|
|
113
|
+
setup.files.length > 0
|
|
114
|
+
? { status: "pass", message: `${setup.files.length} project files inspected` }
|
|
49
115
|
: { status: "warn", message: "No project files found" },
|
|
50
|
-
|
|
51
|
-
? { status: "pass", message: `Detected: ${[...
|
|
116
|
+
detectedLanguageIds.size > 0
|
|
117
|
+
? { status: "pass", message: `Detected: ${[...detectedLanguageIds].join(", ")}` }
|
|
52
118
|
: { status: "warn", message: "No registered project languages detected" },
|
|
53
119
|
];
|
|
54
|
-
const toolFindings = toolCoverageFindings(detectedLanguages, candidates);
|
|
55
120
|
return {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
detectedLanguages,
|
|
59
|
-
candidates,
|
|
60
|
-
suggestions: selectSuggestedRecipes(candidates, languageIds),
|
|
61
|
-
sections: [
|
|
62
|
-
{ title: "Project", pluginId: "doctor", findings: projectFindings },
|
|
63
|
-
{ title: "Tool discovery", pluginId: "doctor", findings: toolFindings },
|
|
64
|
-
...checks,
|
|
65
|
-
],
|
|
121
|
+
...setup,
|
|
122
|
+
sections: [{ title: "Project", pluginId: "doctor", findings: projectFindings }, ...checks],
|
|
66
123
|
};
|
|
67
124
|
}
|
|
68
125
|
|
|
@@ -86,6 +143,16 @@ export function formatDoctorReport(run: DoctorRun): string {
|
|
|
86
143
|
lines.push("");
|
|
87
144
|
}
|
|
88
145
|
|
|
146
|
+
if (run.actions.length > 0) {
|
|
147
|
+
lines.push("Setup needs attention");
|
|
148
|
+
|
|
149
|
+
for (const action of run.actions) {
|
|
150
|
+
lines.push(` ${action.message} [${action.pluginId}]`);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
lines.push("");
|
|
154
|
+
}
|
|
155
|
+
|
|
89
156
|
if (run.suggestions.length > 0) {
|
|
90
157
|
lines.push("Suggested configuration");
|
|
91
158
|
|
|
@@ -106,8 +173,10 @@ export function formatDoctorReport(run: DoctorRun): string {
|
|
|
106
173
|
Returns true when a report needs setup work.
|
|
107
174
|
*/
|
|
108
175
|
export function doctorNeedsWork(run: DoctorRun): boolean {
|
|
109
|
-
return
|
|
110
|
-
|
|
176
|
+
return (
|
|
177
|
+
run.actions.length > 0 ||
|
|
178
|
+
run.suggestions.length > 0 ||
|
|
179
|
+
run.sections.some((section) => section.findings.some((finding) => finding.status === "fail"))
|
|
111
180
|
);
|
|
112
181
|
}
|
|
113
182
|
|
|
@@ -138,59 +207,3 @@ export function buildDoctorAgentPrompt(run: DoctorRun): string {
|
|
|
138
207
|
`Project root: ${path.resolve(run.cwd)}`,
|
|
139
208
|
].join("\n");
|
|
140
209
|
}
|
|
141
|
-
|
|
142
|
-
function toolCoverageFindings(
|
|
143
|
-
detected: ReadonlyMap<string, readonly string[]>,
|
|
144
|
-
candidates: readonly RecipeCandidate[],
|
|
145
|
-
): DoctorFinding[] {
|
|
146
|
-
const findings: DoctorFinding[] = [];
|
|
147
|
-
|
|
148
|
-
for (const [language, files] of detected) {
|
|
149
|
-
for (const kind of ["formatter", "linter", "lsp"] as const) {
|
|
150
|
-
const matches = candidates.filter(
|
|
151
|
-
(candidate) =>
|
|
152
|
-
candidate.recipe.kind === kind && candidate.recipe.languages.includes(language),
|
|
153
|
-
);
|
|
154
|
-
const topScore = matches[0]?.score;
|
|
155
|
-
const tied =
|
|
156
|
-
topScore === undefined ? [] : matches.filter((candidate) => candidate.score === topScore);
|
|
157
|
-
|
|
158
|
-
if (tied.length > 1 && tied.some((candidate) => candidate.evidence.length > 0)) {
|
|
159
|
-
findings.push({
|
|
160
|
-
status: "warn",
|
|
161
|
-
message: `${language} ${kind}: choose between ${tied.map((item) => item.recipe.name).join(", ")}`,
|
|
162
|
-
});
|
|
163
|
-
continue;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
const readyConfigured = matches.find(
|
|
167
|
-
(candidate) =>
|
|
168
|
-
candidate.evidence.includes("Pi Agent IDE config") ||
|
|
169
|
-
(candidate.executable !== undefined &&
|
|
170
|
-
candidate.evidence.some((item) => item.startsWith("project config:"))),
|
|
171
|
-
);
|
|
172
|
-
|
|
173
|
-
if (readyConfigured !== undefined) {
|
|
174
|
-
findings.push({
|
|
175
|
-
status: "pass",
|
|
176
|
-
message: `${language} ${kind}: ${readyConfigured.recipe.name}`,
|
|
177
|
-
});
|
|
178
|
-
} else if (matches.length > 0) {
|
|
179
|
-
findings.push({
|
|
180
|
-
status: "warn",
|
|
181
|
-
message: `${language} ${kind}: ${matches
|
|
182
|
-
.map((item) => item.recipe.name)
|
|
183
|
-
.join(", ")} available in catalog`,
|
|
184
|
-
detail: `${files.length} matching files`,
|
|
185
|
-
});
|
|
186
|
-
} else {
|
|
187
|
-
findings.push({
|
|
188
|
-
status: "skip",
|
|
189
|
-
message: `${language} ${kind}: no loaded plugin contribution`,
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
return findings;
|
|
196
|
-
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
connectTipProvider,
|
|
5
|
+
TIP_API_VERSION,
|
|
6
|
+
TIP_PROTOCOL,
|
|
7
|
+
type TipContext,
|
|
8
|
+
type TipProvider,
|
|
9
|
+
} from "#src/api/tips.js";
|
|
10
|
+
|
|
11
|
+
import type { DoctorSetupRun } from "./run.js";
|
|
12
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
13
|
+
|
|
14
|
+
const DOCTOR_TIP_PROVIDER_ID = "doctor";
|
|
15
|
+
const MAX_VISIBLE_ITEMS = 3;
|
|
16
|
+
|
|
17
|
+
/** Registers actionable doctor startup guidance with the built-in tip core. */
|
|
18
|
+
export function registerDoctorTipProvider(
|
|
19
|
+
pi: ExtensionAPI,
|
|
20
|
+
inspect: (context: TipContext) => Promise<DoctorSetupRun>,
|
|
21
|
+
): void {
|
|
22
|
+
const registration = connectTipProvider(pi, createDoctorTipProvider(inspect));
|
|
23
|
+
if (registration !== undefined) {
|
|
24
|
+
void registration.catch(() => {});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Creates a provider whose identity follows the current actionable setup state. */
|
|
29
|
+
export function createDoctorTipProvider(
|
|
30
|
+
inspect: (context: TipContext) => Promise<DoctorSetupRun>,
|
|
31
|
+
): TipProvider {
|
|
32
|
+
return {
|
|
33
|
+
protocol: TIP_PROTOCOL,
|
|
34
|
+
apiVersion: TIP_API_VERSION,
|
|
35
|
+
id: DOCTOR_TIP_PROVIDER_ID,
|
|
36
|
+
async getTip(context) {
|
|
37
|
+
const result = await inspect(context);
|
|
38
|
+
const items = setupItems(result);
|
|
39
|
+
if (items.length === 0) {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const visible = items.slice(0, MAX_VISIBLE_ITEMS).map((item) => `• ${item.message}`);
|
|
44
|
+
if (items.length > MAX_VISIBLE_ITEMS) {
|
|
45
|
+
visible.push(`• ${items.length - MAX_VISIBLE_ITEMS} more`);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
id: `doctor-setup-${fingerprint(items)}`,
|
|
50
|
+
title:
|
|
51
|
+
items.length === 1
|
|
52
|
+
? "Project setup needs attention"
|
|
53
|
+
: `${items.length} project setup items`,
|
|
54
|
+
body: [...visible, "Run /pi-agent-ide-doctor"].join("\n"),
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
interface SetupItem {
|
|
61
|
+
readonly id: string;
|
|
62
|
+
readonly message: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function setupItems(result: DoctorSetupRun): readonly SetupItem[] {
|
|
66
|
+
const actions = result.actions.map((action) => ({
|
|
67
|
+
id: `action:${action.pluginId}:${action.id}`,
|
|
68
|
+
message: action.message,
|
|
69
|
+
}));
|
|
70
|
+
const suggestions = result.suggestions.map((suggestion) => {
|
|
71
|
+
const languages = suggestion.recipe.languages
|
|
72
|
+
.filter((language) => result.detectedLanguages.has(language))
|
|
73
|
+
.join(", ");
|
|
74
|
+
const capability = {
|
|
75
|
+
formatter: "formatting",
|
|
76
|
+
linter: "linting",
|
|
77
|
+
lsp: "language support",
|
|
78
|
+
}[suggestion.recipe.kind];
|
|
79
|
+
return {
|
|
80
|
+
id: `suggestion:${suggestion.pluginId}:${suggestion.recipe.kind}:${suggestion.recipe.id}`,
|
|
81
|
+
message: `Use ${suggestion.recipe.name} for ${languages} ${capability}`,
|
|
82
|
+
};
|
|
83
|
+
});
|
|
84
|
+
return [...actions, ...suggestions].sort((left, right) => left.id.localeCompare(right.id));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function fingerprint(items: readonly SetupItem[]): string {
|
|
88
|
+
return createHash("sha256")
|
|
89
|
+
.update(items.map((item) => `${item.id}\0${item.message}`).join("\0"))
|
|
90
|
+
.digest("hex")
|
|
91
|
+
.slice(0, 12);
|
|
92
|
+
}
|