pi-agent-ide 0.1.1 → 0.2.0
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 +27 -0
- package/README.md +11 -5
- package/dist/chunk-266RH77Z.js +1 -0
- package/dist/chunk-2SKAED2I.js +2 -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-476MR2QB.js +1 -0
- package/dist/chunk-4KQOODGE.js +13 -0
- package/dist/chunk-4SQQKEVD.js +16 -0
- package/dist/chunk-52BM6J6I.js +6 -0
- package/dist/chunk-5A25RATC.js +3 -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-7NDBZ4WX.js +1 -0
- package/dist/chunk-AP7Z3VWC.js +1 -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-E4SECPF4.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-KINKBPPX.js +1 -0
- package/dist/chunk-KNMWCDDK.js +7 -0
- package/dist/chunk-KP37XTDI.js +1 -0
- package/dist/chunk-KYVOMBO5.js +1 -0
- package/dist/chunk-KZBAJFCV.js +1 -0
- package/dist/chunk-LFV6G5Z3.js +1 -0
- package/dist/chunk-MB6VVVAF.js +2 -0
- package/dist/chunk-MBUXFKIW.js +3 -0
- package/dist/chunk-MTTKFJV6.js +1 -0
- package/dist/chunk-NI2NK4JU.js +1 -0
- package/dist/chunk-NNCZYO4Q.js +0 -0
- package/dist/chunk-OBWZ5RYN.js +1 -0
- package/dist/chunk-OIL6BB2S.js +33 -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-QNZVPFSP.js +3 -0
- package/dist/chunk-QW5O42QJ.js +2 -0
- package/dist/chunk-SJYDLHEF.js +108 -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-TNWYEXFG.js +1 -0
- package/dist/chunk-U4D6FT66.js +1 -0
- package/dist/chunk-VCCMVQXU.js +1 -0
- package/dist/chunk-VFBLX4TG.js +1 -0
- package/dist/chunk-VSP2QQPQ.js +2 -0
- package/dist/chunk-VUNCBASK.js +10 -0
- package/dist/chunk-VWVLBOMU.js +8 -0
- package/dist/chunk-W3XYKJ5H.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-YQTLJ5ZV.js +58 -0
- package/dist/chunk-ZC65Z3CK.js +1 -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 +0 -0
- package/dist/entry-54.js +1 -0
- package/dist/entry-55.js +0 -0
- package/dist/entry-56.js +1 -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 +0 -0
- package/dist/entry-63.js +1 -0
- package/dist/entry-64.js +0 -0
- package/dist/entry-65.js +1 -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-9.js +1 -0
- package/dist/pi-agent-ide.js +13 -0
- package/docs/architecture.md +21 -17
- package/docs/configuration.md +149 -52
- package/docs/development.md +105 -5
- package/docs/extensions.md +64 -4
- package/docs/generated/tool-catalog/css.md +7 -6
- package/docs/generated/tool-catalog/html.md +6 -5
- package/docs/generated/tool-catalog/javascript.md +8 -6
- package/docs/generated/tool-catalog/json.md +7 -6
- package/docs/generated/tool-catalog/markdown.md +6 -5
- package/docs/generated/tool-catalog/toml.md +6 -5
- package/docs/generated/tool-catalog/typescript.md +8 -6
- package/docs/generated/tool-catalog/yaml.md +6 -5
- package/docs/tools.md +88 -6
- package/node_modules/pi-agent-doctor/package.json +8 -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/src/executable.ts +33 -0
- 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-20.js +2 -0
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- package/node_modules/pi-agent-filesystem-image/runtime/entry-21.js +2 -0
- package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
- package/node_modules/pi-agent-filesystem-pdf/runtime/entry-22.js +2 -0
- package/node_modules/pi-agent-filesystem-text/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/runtime/entry-23.js +2 -0
- package/node_modules/pi-agent-ide-ast/package.json +11 -10
- package/node_modules/pi-agent-ide-ast/runtime/entry-24.js +1 -0
- package/node_modules/pi-agent-ide-ast/runtime/entry-25.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/outline.ts +1 -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-26.js +1 -0
- package/node_modules/pi-agent-ide-changes/runtime/entry-27.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-28.js +2 -0
- package/node_modules/pi-agent-ide-formatter/src/catalog.ts +34 -0
- package/node_modules/pi-agent-ide-formatter/src/doctor-plugin.ts +115 -63
- package/node_modules/pi-agent-ide-formatter/src/registry.ts +71 -28
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-languages/runtime/entry-29.js +2 -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-30.js +2 -0
- package/node_modules/pi-agent-ide-lint/src/catalog.ts +14 -2
- package/node_modules/pi-agent-ide-lint/src/command-linter.ts +60 -4
- package/node_modules/pi-agent-ide-lint/src/diagnostics.ts +3 -1
- package/node_modules/pi-agent-ide-lint/src/doctor-plugin.ts +115 -64
- package/node_modules/pi-agent-ide-lint/src/registry.ts +72 -27
- 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-31.js +2 -0
- 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 +113 -0
- package/node_modules/pi-agent-ide-lsp/src/doctor-plugin.ts +108 -53
- package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +94 -27
- 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/lsp-compiler.ts +2 -2
- package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +9 -32
- package/node_modules/pi-agent-ide-lsp/src/lsp/registry.ts +86 -50
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +1 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/types.ts +8 -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-32.js +1 -0
- package/node_modules/pi-agent-invariant/package.json +12 -0
- package/node_modules/pi-agent-invariant/runtime/entry-33.js +1 -0
- package/node_modules/pi-agent-pdf/package.json +3 -3
- package/node_modules/pi-agent-pdf/runtime/entry-34.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-35.js +1 -0
- 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 +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-40.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-41.js +1 -0
- 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 +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-45.js +2 -0
- package/node_modules/pi-agent-search-text/runtime/entry-46.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-47.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-48.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-49.js +1 -0
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-50.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-51.js +1 -0
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-52.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-53.js +1 -0
- 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 +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-69.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-70.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-71.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-72.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-73.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-74.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-75.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-76.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-77.js +2 -0
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/runtime/entry-78.js +2 -0
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-79.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 +215 -0
- package/src/api/tool-config/linters.json +257 -0
- package/src/api/tool-config/lsp-servers.json +275 -0
- package/src/api/tool-config.ts +217 -13
- package/src/api/toolchain.ts +0 -5
- package/src/code-view/diagnostic-view.ts +117 -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 +1 -1
- package/src/doctor/core.ts +47 -0
- package/src/doctor/discovery.ts +10 -2
- package/src/doctor/extension.ts +12 -1
- package/src/doctor/inventory.ts +24 -6
- package/src/doctor/run.ts +68 -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-21.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-22.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-23.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-20.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-76.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-77.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-78.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-79.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-75.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-35.js +1 -0
- 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 +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-45.js +2 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-46.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/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-41.js +1 -0
- 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 +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-48.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-49.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-50.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-51.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-52.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-69.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-70.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-71.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-72.js +2 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-53.js +1 -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 +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-24.js +1 -0
- package/src/plugins/pi-agent-ide-ast/runtime/entry-25.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/outline.ts +1 -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-26.js +1 -0
- package/src/plugins/pi-agent-ide-changes/runtime/entry-27.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 +191 -0
- package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
- package/src/plugins/pi-agent-ide-formatter/runtime/entry-28.js +2 -0
- package/src/plugins/pi-agent-ide-formatter/src/catalog.ts +34 -0
- package/src/plugins/pi-agent-ide-formatter/src/doctor-plugin.ts +115 -63
- package/src/plugins/pi-agent-ide-formatter/src/registry.ts +71 -28
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-languages/runtime/entry-29.js +2 -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-30.js +2 -0
- package/src/plugins/pi-agent-ide-lint/src/catalog.ts +14 -2
- package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +60 -4
- package/src/plugins/pi-agent-ide-lint/src/diagnostics.ts +3 -1
- package/src/plugins/pi-agent-ide-lint/src/doctor-plugin.ts +115 -64
- package/src/plugins/pi-agent-ide-lint/src/registry.ts +72 -27
- 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-31.js +2 -0
- 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 +113 -0
- package/src/plugins/pi-agent-ide-lsp/src/doctor-plugin.ts +108 -53
- package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +94 -27
- 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/lsp-compiler.ts +2 -2
- package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +9 -32
- package/src/plugins/pi-agent-ide-lsp/src/lsp/registry.ts +86 -50
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +1 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/types.ts +8 -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 +6 -74
- package/node_modules/pi-agent-search-semantic/index.ts +0 -97
- package/node_modules/pi-agent-search-semantic/package.json +0 -17
- package/node_modules/pi-agent-search-text/src/lucene-query-parser.d.ts +0 -20
- package/node_modules/pi-agent-search-web/index.ts +0 -82
- package/node_modules/pi-agent-search-web/package.json +0 -20
- package/node_modules/pi-agent-search-web/src/config.ts +0 -560
- package/node_modules/pi-agent-search-web/src/doctor-plugin.ts +0 -40
- package/node_modules/pi-agent-search-web/src/providers/duckduckgo-html.ts +0 -74
- package/node_modules/pi-agent-search-web/src/providers/endpoints.ts +0 -81
- package/node_modules/pi-agent-search-web/src/providers/request.ts +0 -427
- package/node_modules/pi-agent-search-web/src/providers/response.ts +0 -353
- package/node_modules/pi-agent-search-web/src/search-format.ts +0 -24
- package/node_modules/pi-agent-search-web/src/search.ts +0 -376
- package/node_modules/pi-agent-search-web/src/types.ts +0 -141
- package/src/composite/config.ts +0 -100
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-semantic/index.ts +0 -97
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-semantic/package.json +0 -17
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/lucene-query-parser.d.ts +0 -20
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/index.ts +0 -82
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/package.json +0 -20
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/config.ts +0 -560
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/doctor-plugin.ts +0 -40
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/duckduckgo-html.ts +0 -74
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/endpoints.ts +0 -81
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/request.ts +0 -427
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/response.ts +0 -353
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/search-format.ts +0 -24
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/search.ts +0 -376
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/types.ts +0 -141
- package/src/toolchain/gate.ts +0 -305
- /package/{src/utils/required-value.ts → node_modules/pi-agent-invariant/src/index.ts} +0 -0
|
@@ -1,170 +1,163 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
|
-
|
|
3
2
|
import { URI } from "vscode-uri";
|
|
4
|
-
|
|
5
3
|
import { DiagnosticSeverity, type LspDiagnostic } from "./types.js";
|
|
6
|
-
|
|
7
4
|
import type { LspClient } from "./client.js";
|
|
8
|
-
import type { Diagnostic, Severity } from "pi-agent-ide/api/toolchain";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Request diagnostics from an LSP server for a document.
|
|
12
|
-
*
|
|
13
|
-
* Returns IDE Diagnostic[] with proper severity classification
|
|
14
|
-
* suitable for both compiler (syntax errors cause rollback) and linter
|
|
15
|
-
* (warnings are informational only).
|
|
16
|
-
*/
|
|
17
|
-
export async function requestDiagnostics(
|
|
18
|
-
client: LspClient,
|
|
19
|
-
uri: string,
|
|
20
|
-
languageId?: string,
|
|
21
|
-
): Promise<{
|
|
22
|
-
diagnostics: Diagnostic[];
|
|
23
|
-
syntaxErrors: Diagnostic[];
|
|
24
|
-
otherDiagnostics: Diagnostic[];
|
|
25
|
-
}> {
|
|
26
|
-
// Try pull-model first (LSP 3.17+). Fall back to push notifications.
|
|
27
|
-
try {
|
|
28
|
-
const raw = await client.sendRequest<LspDiagnosticResult>("textDocument/diagnostic", {
|
|
29
|
-
textDocument: { uri },
|
|
30
|
-
});
|
|
31
|
-
client.setDiagnosticMode("pull");
|
|
32
|
-
return classify(toDiagnostics(raw.items));
|
|
33
|
-
} catch (error) {
|
|
34
|
-
if (isMethodNotFound(error)) {
|
|
35
|
-
// Server doesn't support pull model — check if it supports diagnostics at all
|
|
36
|
-
if (!client.hasServerDiagnosticsCapability) {
|
|
37
|
-
return classify([]);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
client.setDiagnosticMode("push");
|
|
41
|
-
return await waitForPushDiagnostics(client, uri, languageId);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
throw error;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// ── LSP types ───────────────────────────────────────────────────────
|
|
49
|
-
|
|
50
|
-
interface LspDiagnosticResult {
|
|
51
|
-
kind: "full";
|
|
52
|
-
items: LspDiagnostic[];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// ── conversion ───────────────────────────────────────────────────────
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
Convert an LSP diagnostic to a Gate Diagnostic (1-based coordinates).
|
|
59
|
-
*/
|
|
60
|
-
function toGateDiagnostic(d: LspDiagnostic): Diagnostic {
|
|
61
|
-
return {
|
|
62
|
-
code: typeof d.code === "number" ? String(d.code) : (d.code ?? "LSP"),
|
|
63
|
-
message: d.message,
|
|
64
|
-
line: d.range.start.line + 1,
|
|
65
|
-
column: d.range.start.character + 1,
|
|
66
|
-
severity: lspSeverityToGate(d.severity),
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
Map LSP DiagnosticSeverity (1-4) to Gate Severity.
|
|
72
|
-
*/
|
|
73
|
-
function lspSeverityToGate(severity: DiagnosticSeverity): Severity {
|
|
74
|
-
switch (severity) {
|
|
75
|
-
case DiagnosticSeverity.Error: {
|
|
76
|
-
return "error";
|
|
77
|
-
}
|
|
78
|
-
case DiagnosticSeverity.Warning: {
|
|
79
|
-
return "warning";
|
|
80
|
-
}
|
|
81
|
-
case DiagnosticSeverity.Information: {
|
|
82
|
-
return "info";
|
|
83
|
-
}
|
|
84
|
-
case DiagnosticSeverity.Hint: {
|
|
85
|
-
return "hint";
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// ── helpers ───────────────────────────────────────────────────────────
|
|
91
5
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
6
|
+
import { completedDiagnosticAdapter } from "./diagnostic-adapters.js";
|
|
7
|
+
import type { Diagnostic } from "pi-agent-ide/api/toolchain";
|
|
95
8
|
|
|
96
|
-
|
|
9
|
+
/** LSP diagnostics do not reliably distinguish parser errors from type errors. */
|
|
10
|
+
export interface LspDiagnosticResult {
|
|
97
11
|
diagnostics: Diagnostic[];
|
|
98
12
|
syntaxErrors: Diagnostic[];
|
|
99
13
|
otherDiagnostics: Diagnostic[];
|
|
100
|
-
|
|
101
|
-
const syntaxErrors = diags.filter((d) => d.severity === "error");
|
|
102
|
-
const otherDiagnostics = diags.filter((d) => d.severity !== "error");
|
|
103
|
-
return { diagnostics: diags, syntaxErrors, otherDiagnostics };
|
|
104
|
-
}
|
|
14
|
+
unversioned: boolean;
|
|
105
15
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
error !== null &&
|
|
109
|
-
typeof error === "object" &&
|
|
110
|
-
"code" in error &&
|
|
111
|
-
(error as { code: number }).code === -32601
|
|
112
|
-
);
|
|
16
|
+
/** False for push snapshots, even when a publication carries a document version. */
|
|
17
|
+
complete: boolean;
|
|
113
18
|
}
|
|
114
19
|
|
|
115
|
-
/**
|
|
116
|
-
|
|
117
|
-
*/
|
|
118
|
-
async function waitForPushDiagnostics(
|
|
20
|
+
/** Request current diagnostics using pull when supported, otherwise a version-aware push wait. */
|
|
21
|
+
export async function requestDiagnostics(
|
|
119
22
|
client: LspClient,
|
|
120
23
|
uri: string,
|
|
121
24
|
languageId?: string,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
25
|
+
options: { signal?: AbortSignal; content?: string } = {},
|
|
26
|
+
): Promise<LspDiagnosticResult> {
|
|
27
|
+
const controller = new AbortController();
|
|
28
|
+
const signal = AbortSignal.any([controller.signal, ...(options.signal ? [options.signal] : [])]);
|
|
29
|
+
const timeout = setTimeout(
|
|
30
|
+
() => controller.abort(new Error(`[lsp] ${client.serverId}: diagnostics timed out for ${uri}`)),
|
|
31
|
+
client.timeoutMs,
|
|
32
|
+
);
|
|
33
|
+
try {
|
|
34
|
+
return await requestCurrentDiagnostics(client, uri, languageId, options.content, signal);
|
|
35
|
+
} finally {
|
|
36
|
+
clearTimeout(timeout);
|
|
131
37
|
}
|
|
38
|
+
}
|
|
132
39
|
|
|
133
|
-
|
|
40
|
+
async function requestCurrentDiagnostics(
|
|
41
|
+
client: LspClient,
|
|
42
|
+
uri: string,
|
|
43
|
+
languageId: string | undefined,
|
|
44
|
+
content: string | undefined,
|
|
45
|
+
signal: AbortSignal,
|
|
46
|
+
): Promise<LspDiagnosticResult> {
|
|
47
|
+
signal.throwIfAborted();
|
|
48
|
+
if (client.diagnosticMode !== "push") {
|
|
49
|
+
const version = client.documentVersion(uri);
|
|
50
|
+
try {
|
|
51
|
+
const raw = await client.sendRequest<{ kind: string; items?: LspDiagnostic[] }>(
|
|
52
|
+
"textDocument/diagnostic",
|
|
53
|
+
{ textDocument: { uri } },
|
|
54
|
+
signal,
|
|
55
|
+
);
|
|
56
|
+
if (raw.kind !== "full" || !Array.isArray(raw.items))
|
|
57
|
+
throw new Error("Invalid full diagnostic report");
|
|
58
|
+
if (client.documentVersion(uri) !== version)
|
|
59
|
+
throw new Error("Document changed during diagnostic request");
|
|
60
|
+
client.setDiagnosticMode("pull");
|
|
61
|
+
return classify(raw.items, false, true);
|
|
62
|
+
} catch (error) {
|
|
63
|
+
if (!isMethodNotFound(error)) throw error;
|
|
64
|
+
client.setDiagnosticMode("push");
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const adapter = completedDiagnosticAdapter(client);
|
|
68
|
+
if (adapter) {
|
|
69
|
+
if (client.documentVersion(uri) === undefined)
|
|
70
|
+
client.syncDocument(
|
|
71
|
+
uri,
|
|
72
|
+
content ?? (await readFile(URI.parse(uri).fsPath, "utf8")),
|
|
73
|
+
languageId ?? "plaintext",
|
|
74
|
+
);
|
|
75
|
+
const version = client.documentVersion(uri);
|
|
76
|
+
const diagnostics = await adapter.request(client, uri, signal);
|
|
77
|
+
signal.throwIfAborted();
|
|
78
|
+
if (client.documentVersion(uri) !== version)
|
|
79
|
+
throw new Error("Document changed during diagnostic request");
|
|
80
|
+
return {
|
|
81
|
+
diagnostics,
|
|
82
|
+
syntaxErrors: [],
|
|
83
|
+
otherDiagnostics: diagnostics,
|
|
84
|
+
unversioned: false,
|
|
85
|
+
complete: true,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
signal.throwIfAborted();
|
|
89
|
+
const opened = client.documentVersion(uri) !== undefined;
|
|
90
|
+
const text = opened ? undefined : (content ?? (await readFile(URI.parse(uri).fsPath, "utf8")));
|
|
91
|
+
signal.throwIfAborted();
|
|
134
92
|
client.beginDiagnosticRequest(uri);
|
|
135
|
-
|
|
136
93
|
try {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
const notification = parameters as {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
94
|
+
return await new Promise<LspDiagnosticResult>((resolve, reject) => {
|
|
95
|
+
const expectedVersion = client.documentVersion(uri) ?? 1;
|
|
96
|
+
const receive = (parameters: unknown) => {
|
|
97
|
+
const notification = parameters as {
|
|
98
|
+
uri?: unknown;
|
|
99
|
+
version?: unknown;
|
|
100
|
+
diagnostics?: unknown;
|
|
101
|
+
};
|
|
102
|
+
if (notification.uri !== uri || !Array.isArray(notification.diagnostics)) return;
|
|
103
|
+
if (notification.version !== undefined && notification.version !== expectedVersion) return;
|
|
104
|
+
if (client.documentVersion(uri) !== expectedVersion) return;
|
|
105
|
+
cleanup();
|
|
106
|
+
resolve(
|
|
107
|
+
classify(notification.diagnostics as LspDiagnostic[], notification.version === undefined),
|
|
108
|
+
);
|
|
109
|
+
};
|
|
110
|
+
const unsubscribe = client.onNotification("textDocument/publishDiagnostics", receive);
|
|
111
|
+
const onAbort = () => {
|
|
112
|
+
cleanup();
|
|
113
|
+
reject(signal.reason);
|
|
114
|
+
};
|
|
115
|
+
function cleanup(): void {
|
|
159
116
|
unsubscribe();
|
|
160
|
-
|
|
117
|
+
signal.removeEventListener("abort", onAbort);
|
|
118
|
+
}
|
|
119
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
120
|
+
try {
|
|
121
|
+
if (!opened) client.syncDocument(uri, text ?? "", languageId ?? "plaintext");
|
|
122
|
+
const cached = client.diagnosticPublication(uri);
|
|
123
|
+
if (cached) receive({ uri, ...cached });
|
|
124
|
+
} catch (error) {
|
|
125
|
+
cleanup();
|
|
126
|
+
reject(error);
|
|
161
127
|
}
|
|
162
|
-
|
|
163
|
-
client.syncDocument(uri, text, langId);
|
|
164
128
|
});
|
|
165
|
-
|
|
166
|
-
return classify(toDiagnostics(items));
|
|
167
129
|
} finally {
|
|
168
130
|
client.endDiagnosticRequest(uri);
|
|
169
131
|
}
|
|
170
132
|
}
|
|
133
|
+
|
|
134
|
+
/** Convert protocol coordinates and severity to the shared 1-based diagnostic format. */
|
|
135
|
+
export function toDiagnostic(diagnostic: LspDiagnostic): Diagnostic {
|
|
136
|
+
return {
|
|
137
|
+
code: String(diagnostic.code ?? "LSP"),
|
|
138
|
+
message: diagnostic.message,
|
|
139
|
+
line: diagnostic.range.start.line + 1,
|
|
140
|
+
column: diagnostic.range.start.character + 1,
|
|
141
|
+
severity:
|
|
142
|
+
diagnostic.severity === DiagnosticSeverity.Warning
|
|
143
|
+
? "warning"
|
|
144
|
+
: diagnostic.severity === DiagnosticSeverity.Information
|
|
145
|
+
? "info"
|
|
146
|
+
: diagnostic.severity === DiagnosticSeverity.Hint
|
|
147
|
+
? "hint"
|
|
148
|
+
: "error",
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function classify(
|
|
153
|
+
items: LspDiagnostic[],
|
|
154
|
+
unversioned: boolean,
|
|
155
|
+
complete = false,
|
|
156
|
+
): LspDiagnosticResult {
|
|
157
|
+
const diagnostics = items.map(toDiagnostic);
|
|
158
|
+
return { diagnostics, syntaxErrors: [], otherDiagnostics: diagnostics, unversioned, complete };
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function isMethodNotFound(error: unknown): boolean {
|
|
162
|
+
return error !== null && typeof error === "object" && "code" in error && error.code === -32601;
|
|
163
|
+
}
|
|
@@ -11,7 +11,7 @@ import type { Compiler, CompileResult, Diagnostic, ToolContext } from "pi-agent-
|
|
|
11
11
|
* higher than skip (0). Handles any language with a configured LSP server
|
|
12
12
|
* that provides diagnostics capability.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
14
|
+
* LSP errors include type errors and never act as a syntax-only formatting gate.
|
|
15
15
|
*/
|
|
16
16
|
export function createLspCompiler(manager: LspManager): Compiler {
|
|
17
17
|
let _client: LspClient | null = null;
|
|
@@ -33,7 +33,7 @@ export function createLspCompiler(manager: LspManager): Compiler {
|
|
|
33
33
|
_client = client;
|
|
34
34
|
|
|
35
35
|
return {
|
|
36
|
-
ok:
|
|
36
|
+
ok: !diagnostics.some((diagnostic) => diagnostic.severity === "error"),
|
|
37
37
|
diagnostics,
|
|
38
38
|
syntaxErrors,
|
|
39
39
|
otherDiagnostics,
|
|
@@ -4,12 +4,15 @@ import path from "node:path";
|
|
|
4
4
|
import { URI } from "vscode-uri";
|
|
5
5
|
|
|
6
6
|
import { LspClient } from "./client.js";
|
|
7
|
-
import {
|
|
7
|
+
import { toDiagnostic } from "./diagnostics.js";
|
|
8
|
+
import { type LspDiagnostic, type ResolvedServer } from "./types.js";
|
|
8
9
|
|
|
9
10
|
import type { LspServerRegistry } from "./registry.js";
|
|
10
11
|
import type { Diagnostic } from "pi-agent-ide/api/toolchain";
|
|
11
12
|
|
|
13
|
+
/** A workspace-scoped published report; an omitted version leaves freshness unverified. */
|
|
12
14
|
export interface LspPushDiagnosticsEvent {
|
|
15
|
+
cwd: string;
|
|
13
16
|
serverId: string;
|
|
14
17
|
uri: string;
|
|
15
18
|
version?: number;
|
|
@@ -83,6 +86,7 @@ export class LspManager {
|
|
|
83
86
|
return this._clients.size;
|
|
84
87
|
}
|
|
85
88
|
|
|
89
|
+
/** Subscribe to full published reports, including clearing updates from pull-capable servers. */
|
|
86
90
|
onPushDiagnostics(handler: PushHandler): () => void {
|
|
87
91
|
this._pushHandlers.add(handler);
|
|
88
92
|
return () => this._pushHandlers.delete(handler);
|
|
@@ -329,11 +333,7 @@ export class LspManager {
|
|
|
329
333
|
const unsubscribe = client.onNotification("textDocument/publishDiagnostics", (parameters) => {
|
|
330
334
|
const notification = parsePushNotification(parameters);
|
|
331
335
|
|
|
332
|
-
if (
|
|
333
|
-
!notification ||
|
|
334
|
-
client.diagnosticMode !== "push" ||
|
|
335
|
-
client.hasActiveDiagnosticRequest(notification.uri)
|
|
336
|
-
) {
|
|
336
|
+
if (!notification || client.hasActiveDiagnosticRequest(notification.uri)) {
|
|
337
337
|
return;
|
|
338
338
|
}
|
|
339
339
|
|
|
@@ -347,15 +347,9 @@ export class LspManager {
|
|
|
347
347
|
return;
|
|
348
348
|
}
|
|
349
349
|
|
|
350
|
-
const key = `${
|
|
351
|
-
|
|
352
|
-
if (notification.diagnostics.length === 0) {
|
|
353
|
-
this._pushFingerprints.delete(key);
|
|
354
|
-
return;
|
|
355
|
-
}
|
|
356
|
-
|
|
350
|
+
const key = `${clientKey}:${notification.uri}`;
|
|
357
351
|
const diagnostics = notification.diagnostics.map(toDiagnostic);
|
|
358
|
-
const fingerprint = JSON.stringify(diagnostics);
|
|
352
|
+
const fingerprint = JSON.stringify([notification.version, currentVersion, diagnostics]);
|
|
359
353
|
|
|
360
354
|
if (this._pushFingerprints.get(key) === fingerprint) {
|
|
361
355
|
return;
|
|
@@ -363,6 +357,7 @@ export class LspManager {
|
|
|
363
357
|
|
|
364
358
|
this._pushFingerprints.set(key, fingerprint);
|
|
365
359
|
const event: LspPushDiagnosticsEvent = {
|
|
360
|
+
cwd: URI.parse(client.rootUri).fsPath,
|
|
366
361
|
serverId: client.serverId,
|
|
367
362
|
uri: notification.uri,
|
|
368
363
|
diagnostics,
|
|
@@ -423,21 +418,3 @@ function parsePushNotification(parameters: unknown):
|
|
|
423
418
|
...(typeof value.version === "number" && { version: value.version }),
|
|
424
419
|
};
|
|
425
420
|
}
|
|
426
|
-
|
|
427
|
-
function toDiagnostic(diagnostic: LspDiagnostic): Diagnostic {
|
|
428
|
-
return {
|
|
429
|
-
code:
|
|
430
|
-
typeof diagnostic.code === "number" ? String(diagnostic.code) : (diagnostic.code ?? "LSP"),
|
|
431
|
-
message: diagnostic.message,
|
|
432
|
-
line: diagnostic.range.start.line + 1,
|
|
433
|
-
column: diagnostic.range.start.character + 1,
|
|
434
|
-
severity:
|
|
435
|
-
diagnostic.severity === DiagnosticSeverity.Error
|
|
436
|
-
? "error"
|
|
437
|
-
: diagnostic.severity === DiagnosticSeverity.Warning
|
|
438
|
-
? "warning"
|
|
439
|
-
: diagnostic.severity === DiagnosticSeverity.Information
|
|
440
|
-
? "info"
|
|
441
|
-
: "hint",
|
|
442
|
-
};
|
|
443
|
-
}
|
|
@@ -1,57 +1,83 @@
|
|
|
1
|
-
import { requiredValue } from "
|
|
2
|
-
|
|
3
|
-
import
|
|
1
|
+
import { requiredValue } from "pi-agent-invariant";
|
|
2
|
+
|
|
3
|
+
import { hasConfiguredExecutable, loadLayeredToolConfig } from "pi-agent-ide/api/tool-config";
|
|
4
4
|
|
|
5
5
|
import { buildLanguageLookup, type LanguageLookup } from "./language-map.js";
|
|
6
6
|
|
|
7
|
+
import type {
|
|
8
|
+
EffectiveToolConfigEntry,
|
|
9
|
+
LayeredToolConfigOptions,
|
|
10
|
+
} from "pi-agent-ide/api/tool-config";
|
|
7
11
|
import type { LspServersConfig, ResolvedServer, ServerConfig } from "./types.js";
|
|
8
12
|
|
|
9
13
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
13
|
-
* Thread-safe: all mutations happen at construction time.
|
|
14
|
-
*/
|
|
14
|
+
LSP server configuration in project, global, and built-in priority order.
|
|
15
|
+
*/
|
|
15
16
|
export class LspServerRegistry {
|
|
16
17
|
private readonly _servers: Record<string, ServerConfig>;
|
|
18
|
+
private readonly _entries: readonly EffectiveToolConfigEntry<ServerConfig>[];
|
|
19
|
+
private readonly _entriesById: ReadonlyMap<string, EffectiveToolConfigEntry<ServerConfig>>;
|
|
17
20
|
private readonly _lookup: LanguageLookup;
|
|
18
21
|
|
|
19
|
-
private constructor(
|
|
20
|
-
|
|
22
|
+
private constructor(
|
|
23
|
+
entries: readonly EffectiveToolConfigEntry<ServerConfig>[],
|
|
24
|
+
availableBuiltIns: ReadonlySet<string>,
|
|
25
|
+
) {
|
|
26
|
+
this._entries = entries;
|
|
27
|
+
this._entriesById = new Map(entries.map((entry) => [entry.id, entry]));
|
|
28
|
+
const activeEntries = entries.filter(
|
|
29
|
+
(entry) => entry.layer !== "built-in" || availableBuiltIns.has(entry.id),
|
|
30
|
+
);
|
|
31
|
+
this._servers = Object.fromEntries(activeEntries.map((entry) => [entry.id, entry.config]));
|
|
21
32
|
this._lookup = buildLanguageLookup(this._servers);
|
|
22
33
|
}
|
|
23
34
|
|
|
24
35
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
static async fromPackageDir(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
Loads and merges project, global, and built-in `lsp-servers.json` files.
|
|
37
|
+
*/
|
|
38
|
+
static async fromPackageDir(
|
|
39
|
+
packageDir: string,
|
|
40
|
+
options: LayeredToolConfigOptions = {},
|
|
41
|
+
): Promise<LspServerRegistry> {
|
|
42
|
+
const effective = await loadLayeredToolConfig(
|
|
43
|
+
packageDir,
|
|
44
|
+
"lsp-servers",
|
|
45
|
+
(value) => parseLspConfig(value).servers,
|
|
46
|
+
options,
|
|
47
|
+
);
|
|
48
|
+
const environment = options.environment ?? process.env;
|
|
49
|
+
const available = await Promise.all(
|
|
50
|
+
effective.entries
|
|
51
|
+
.filter((entry) => entry.layer === "built-in")
|
|
52
|
+
.map(async (entry) => ({
|
|
53
|
+
id: entry.id,
|
|
54
|
+
available: await hasConfiguredExecutable(entry.config, packageDir, environment),
|
|
55
|
+
})),
|
|
56
|
+
);
|
|
57
|
+
return new LspServerRegistry(
|
|
58
|
+
effective.entries,
|
|
59
|
+
new Set(available.filter((entry) => entry.available).map((entry) => entry.id)),
|
|
60
|
+
);
|
|
42
61
|
}
|
|
43
62
|
|
|
44
63
|
/**
|
|
45
|
-
|
|
46
|
-
|
|
64
|
+
Creates a project-layer registry from an already-parsed config.
|
|
65
|
+
*/
|
|
47
66
|
static fromConfig(config: LspServersConfig): LspServerRegistry {
|
|
48
|
-
return new LspServerRegistry(
|
|
67
|
+
return new LspServerRegistry(
|
|
68
|
+
Object.entries(config.servers).map(([id, server]) => ({
|
|
69
|
+
id,
|
|
70
|
+
config: server,
|
|
71
|
+
layer: "project",
|
|
72
|
+
sourcePath: "<memory>",
|
|
73
|
+
})),
|
|
74
|
+
new Set(),
|
|
75
|
+
);
|
|
49
76
|
}
|
|
50
77
|
|
|
51
78
|
/**
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
*/
|
|
79
|
+
Resolves a file extension to matching LSP servers in layer priority order.
|
|
80
|
+
*/
|
|
55
81
|
resolve(extension: string): ResolvedServer[] {
|
|
56
82
|
const normalized = extension.startsWith(".")
|
|
57
83
|
? extension.toLowerCase()
|
|
@@ -68,31 +94,42 @@ export class LspServerRegistry {
|
|
|
68
94
|
return [];
|
|
69
95
|
}
|
|
70
96
|
|
|
71
|
-
return serverIds.map((serverId) =>
|
|
72
|
-
serverId
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
97
|
+
return serverIds.map((serverId) => {
|
|
98
|
+
const entry = requiredValue(this._entriesById.get(serverId));
|
|
99
|
+
return {
|
|
100
|
+
serverId,
|
|
101
|
+
config: entry.config,
|
|
102
|
+
languageId,
|
|
103
|
+
layer: entry.layer,
|
|
104
|
+
sourcePath: entry.sourcePath,
|
|
105
|
+
};
|
|
106
|
+
});
|
|
76
107
|
}
|
|
77
108
|
|
|
78
109
|
/**
|
|
79
|
-
|
|
80
|
-
|
|
110
|
+
All effective server configurations by stable ID.
|
|
111
|
+
*/
|
|
81
112
|
get servers(): Readonly<Record<string, ServerConfig>> {
|
|
82
113
|
return this._servers;
|
|
83
114
|
}
|
|
84
115
|
|
|
85
116
|
/**
|
|
86
|
-
|
|
87
|
-
|
|
117
|
+
All merged server entries in runtime resolution order.
|
|
118
|
+
*/
|
|
119
|
+
get entries(): readonly EffectiveToolConfigEntry<ServerConfig>[] {
|
|
120
|
+
return this._entries;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
All known extensions (with leading dot, lowercased).
|
|
125
|
+
*/
|
|
88
126
|
get knownExtensions(): ReadonlySet<string> {
|
|
89
127
|
return new Set(this._lookup.extToLanguageId.keys());
|
|
90
128
|
}
|
|
91
129
|
|
|
92
130
|
/**
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
*/
|
|
131
|
+
Resolves a file extension to the canonical LSP languageId.
|
|
132
|
+
*/
|
|
96
133
|
languageId(extension: string): string {
|
|
97
134
|
const normalized = extension.startsWith(".")
|
|
98
135
|
? extension.toLowerCase()
|
|
@@ -101,7 +138,10 @@ export class LspServerRegistry {
|
|
|
101
138
|
}
|
|
102
139
|
}
|
|
103
140
|
|
|
104
|
-
|
|
141
|
+
/**
|
|
142
|
+
Validates and returns an LSP server configuration object.
|
|
143
|
+
*/
|
|
144
|
+
export function parseLspConfig(value: unknown): LspServersConfig {
|
|
105
145
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
106
146
|
throw new Error("LSP config must be an object");
|
|
107
147
|
}
|
|
@@ -174,7 +214,3 @@ function parseLspConfig(value: unknown): LspServersConfig {
|
|
|
174
214
|
|
|
175
215
|
return value as LspServersConfig;
|
|
176
216
|
}
|
|
177
|
-
|
|
178
|
-
function isMissingFile(error: unknown): boolean {
|
|
179
|
-
return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
|
|
180
|
-
}
|
|
@@ -33,6 +33,7 @@ function toHit(
|
|
|
33
33
|
const relativePath = path.relative(cwd, filePath);
|
|
34
34
|
|
|
35
35
|
return {
|
|
36
|
+
// oxlint-disable-next-line repo/no-parent-paths -- defensive check against traversal, not a traversal
|
|
36
37
|
filePath: relativePath.startsWith("..") ? filePath : relativePath,
|
|
37
38
|
lineNumber: line + 1,
|
|
38
39
|
column: character + 1,
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* Owned by the LSP extension. Not tied to any specific LSP server implementation.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import type { ToolConfigLayer } from "pi-agent-ide/api/tool-config";
|
|
8
|
+
|
|
7
9
|
// ── LSP protocol primitives ───────────────────────────────────────────
|
|
8
10
|
|
|
9
11
|
/**
|
|
@@ -81,15 +83,15 @@ export interface LspServersConfig {
|
|
|
81
83
|
// ── Resolved server info (registry output) ─────────────────────────────
|
|
82
84
|
|
|
83
85
|
export interface ResolvedServer {
|
|
84
|
-
/**
|
|
85
|
-
Server key from lsp-servers.json (e.g. "gopls").
|
|
86
|
-
*/
|
|
86
|
+
/** Server key from lsp-servers.json (e.g. "gopls"). */
|
|
87
87
|
serverId: string;
|
|
88
88
|
config: ServerConfig;
|
|
89
|
-
/**
|
|
90
|
-
LanguageId this extension maps to (e.g. "go").
|
|
91
|
-
*/
|
|
89
|
+
/** LanguageId this extension maps to (e.g. "go"). */
|
|
92
90
|
languageId: string;
|
|
91
|
+
/** Configuration layer that supplied this server. */
|
|
92
|
+
layer: ToolConfigLayer;
|
|
93
|
+
/** JSON file that supplied this server. */
|
|
94
|
+
sourcePath: string;
|
|
93
95
|
}
|
|
94
96
|
|
|
95
97
|
// ── Client state ───────────────────────────────────────────────────────
|
|
@@ -8,16 +8,16 @@ export function createLspSearchResolver(
|
|
|
8
8
|
managerFor: (cwd: string) => Promise<LspManager>,
|
|
9
9
|
): SearchResolver {
|
|
10
10
|
return {
|
|
11
|
-
id: "
|
|
11
|
+
id: "symbols",
|
|
12
12
|
async tryResolve(request, context) {
|
|
13
|
-
if (!request.query.startsWith("
|
|
13
|
+
if (!request.query.startsWith("symbols:")) {
|
|
14
14
|
return { kind: "not-handled" };
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
const query = request.query.slice("
|
|
17
|
+
const query = request.query.slice("symbols:".length).trim();
|
|
18
18
|
|
|
19
19
|
if (query.length === 0) {
|
|
20
|
-
return { kind: "failed", error: new Error("
|
|
20
|
+
return { kind: "failed", error: new Error("symbols: query must not be empty") };
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
await managerFor(context.cwd);
|
|
@@ -31,7 +31,7 @@ export function createLspSearchResolver(
|
|
|
31
31
|
};
|
|
32
32
|
const text =
|
|
33
33
|
hits.length === 0
|
|
34
|
-
? "No
|
|
34
|
+
? "No symbols found."
|
|
35
35
|
: hits
|
|
36
36
|
.map(
|
|
37
37
|
(hit, index) =>
|