pi-agent-ide 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/README.md +11 -5
- package/dist/chunk-266RH77Z.js +1 -0
- package/dist/chunk-2SKAED2I.js +2 -0
- package/dist/chunk-2XYXV5HS.js +4 -0
- package/dist/chunk-2ZMYT6ZC.js +1 -0
- package/dist/chunk-34ZQTTU2.js +2 -0
- package/dist/chunk-3H2EU7VQ.js +0 -0
- package/dist/chunk-3YK4XMWB.js +0 -0
- package/dist/chunk-4SQQKEVD.js +16 -0
- package/dist/chunk-5BWUVAR4.js +1 -0
- package/dist/chunk-6DN7NO7L.js +1 -0
- package/dist/chunk-6SMFVLTY.js +1 -0
- package/dist/chunk-6XQQBKPE.js +58 -0
- package/dist/chunk-BYWAG6X3.js +6 -0
- package/dist/chunk-DEP55R35.js +1 -0
- package/dist/chunk-E2RESHYR.js +1 -0
- package/dist/chunk-EEH4WYI7.js +1 -0
- package/dist/chunk-EI7MMDWY.js +1 -0
- package/dist/chunk-ERVMDQGX.js +1 -0
- package/dist/chunk-EW2KVKCN.js +2 -0
- package/dist/chunk-F6SESI3P.js +4 -0
- package/dist/chunk-GTK5AREE.js +2 -0
- package/dist/chunk-HOBTFFQR.js +1 -0
- package/dist/chunk-IMVCVPMP.js +3 -0
- package/dist/chunk-IOCABSRL.js +1 -0
- package/dist/chunk-JASLOB2X.js +1 -0
- package/dist/chunk-JMVDFOTQ.js +1 -0
- package/dist/chunk-K4ZMRDEI.js +0 -0
- package/dist/chunk-KH5KPBCR.js +10 -0
- package/dist/chunk-KINKBPPX.js +1 -0
- package/dist/chunk-KNMWCDDK.js +7 -0
- package/dist/chunk-KYVOMBO5.js +1 -0
- package/dist/chunk-KZBAJFCV.js +1 -0
- package/dist/chunk-L4FA6OD4.js +1 -0
- package/dist/chunk-LFV6G5Z3.js +1 -0
- package/dist/chunk-LGN7EJYR.js +13 -0
- package/dist/chunk-MB6VVVAF.js +2 -0
- package/dist/chunk-MBUXFKIW.js +3 -0
- package/dist/chunk-MTQSGWZJ.js +1 -0
- package/dist/chunk-MTTKFJV6.js +1 -0
- package/dist/chunk-N34ATN52.js +1 -0
- package/dist/chunk-NI2NK4JU.js +1 -0
- package/dist/chunk-NNCZYO4Q.js +0 -0
- package/dist/chunk-NXHPO7ER.js +6 -0
- package/dist/chunk-OBWZ5RYN.js +1 -0
- package/dist/chunk-OFHVDY4Q.js +2 -0
- package/dist/chunk-OIL6BB2S.js +33 -0
- package/dist/chunk-ONWUJXUR.js +1 -0
- package/dist/chunk-ORAPGW7W.js +1 -0
- package/dist/chunk-OVUYPHDE.js +1 -0
- package/dist/chunk-PETQCA7G.js +1 -0
- package/dist/chunk-PODWLGNO.js +6 -0
- package/dist/chunk-QZANC2IG.js +1 -0
- package/dist/chunk-SJYDLHEF.js +108 -0
- package/dist/chunk-SMSIT3CE.js +3 -0
- package/dist/chunk-SSZB66C3.js +3 -0
- package/dist/chunk-STUZZM5B.js +1 -0
- package/dist/chunk-T2RPMEM2.js +1 -0
- package/dist/chunk-TG6H6EOI.js +1 -0
- package/dist/chunk-UTTW55S2.js +1 -0
- package/dist/chunk-VCCMVQXU.js +1 -0
- package/dist/chunk-VEJGSURY.js +8 -0
- package/dist/chunk-VFBLX4TG.js +1 -0
- package/dist/chunk-VSP2QQPQ.js +2 -0
- package/dist/chunk-W3XYKJ5H.js +1 -0
- package/dist/chunk-WZI4YC2O.js +1 -0
- package/dist/chunk-XGUAL3CA.js +1 -0
- package/dist/chunk-XNXQYPVT.js +10 -0
- package/dist/chunk-YHUTTZC6.js +2 -0
- package/dist/chunk-YPHXLAQF.js +1 -0
- package/dist/chunk-ZC65Z3CK.js +1 -0
- package/dist/chunk-ZIHEF6K3.js +3 -0
- package/dist/entry-0.js +1 -0
- package/dist/entry-1.js +1 -0
- package/dist/entry-10.js +1 -0
- package/dist/entry-11.js +1 -0
- package/dist/entry-12.js +1 -0
- package/dist/entry-13.js +1 -0
- package/dist/entry-14.js +1 -0
- package/dist/entry-16.js +1 -0
- package/dist/entry-17.js +1 -0
- package/dist/entry-18.js +1 -0
- package/dist/entry-19.js +1 -0
- package/dist/entry-2.js +1 -0
- package/dist/entry-20.js +1 -0
- package/dist/entry-21.js +1 -0
- package/dist/entry-22.js +1 -0
- package/dist/entry-23.js +1 -0
- package/dist/entry-24.js +1 -0
- package/dist/entry-25.js +1 -0
- package/dist/entry-26.js +1 -0
- package/dist/entry-27.js +1 -0
- package/dist/entry-28.js +1 -0
- package/dist/entry-29.js +1 -0
- package/dist/entry-3.js +1 -0
- package/dist/entry-30.js +1 -0
- package/dist/entry-31.js +1 -0
- package/dist/entry-32.js +1 -0
- package/dist/entry-33.js +1 -0
- package/dist/entry-34.js +1 -0
- package/dist/entry-35.js +1 -0
- package/dist/entry-36.js +1 -0
- package/dist/entry-37.js +1 -0
- package/dist/entry-38.js +1 -0
- package/dist/entry-39.js +1 -0
- package/dist/entry-4.js +1 -0
- package/dist/entry-40.js +1 -0
- package/dist/entry-41.js +1 -0
- package/dist/entry-42.js +1 -0
- package/dist/entry-43.js +1 -0
- package/dist/entry-44.js +1 -0
- package/dist/entry-45.js +1 -0
- package/dist/entry-46.js +1 -0
- package/dist/entry-47.js +1 -0
- package/dist/entry-48.js +1 -0
- package/dist/entry-49.js +1 -0
- package/dist/entry-5.js +1 -0
- package/dist/entry-50.js +1 -0
- package/dist/entry-51.js +1 -0
- package/dist/entry-52.js +1 -0
- package/dist/entry-53.js +1 -0
- package/dist/entry-54.js +0 -0
- package/dist/entry-55.js +1 -0
- package/dist/entry-56.js +0 -0
- package/dist/entry-57.js +1 -0
- package/dist/entry-58.js +1 -0
- package/dist/entry-59.js +1 -0
- package/dist/entry-6.js +1 -0
- package/dist/entry-60.js +1 -0
- package/dist/entry-61.js +1 -0
- package/dist/entry-62.js +1 -0
- package/dist/entry-63.js +0 -0
- package/dist/entry-64.js +1 -0
- package/dist/entry-65.js +0 -0
- package/dist/entry-66.js +1 -0
- package/dist/entry-67.js +1 -0
- package/dist/entry-68.js +1 -0
- package/dist/entry-69.js +1 -0
- package/dist/entry-7.js +1 -0
- package/dist/entry-70.js +1 -0
- package/dist/entry-71.js +1 -0
- package/dist/entry-72.js +1 -0
- package/dist/entry-73.js +1 -0
- package/dist/entry-74.js +1 -0
- package/dist/entry-75.js +1 -0
- package/dist/entry-76.js +1 -0
- package/dist/entry-77.js +1 -0
- package/dist/entry-78.js +1 -0
- package/dist/entry-79.js +1 -0
- package/dist/entry-8.js +1 -0
- package/dist/entry-80.js +1 -0
- package/dist/entry-9.js +1 -0
- package/dist/pi-agent-ide.js +13 -0
- package/docs/architecture.md +21 -17
- package/docs/configuration.md +180 -52
- package/docs/development.md +105 -5
- package/docs/extensions.md +64 -4
- package/docs/generated/tool-catalog/cmake.md +5 -5
- package/docs/generated/tool-catalog/csharp.md +5 -5
- package/docs/generated/tool-catalog/css.md +7 -6
- package/docs/generated/tool-catalog/dart.md +9 -0
- package/docs/generated/tool-catalog/dockerfile.md +5 -5
- package/docs/generated/tool-catalog/elixir.md +9 -0
- package/docs/generated/tool-catalog/html.md +7 -5
- package/docs/generated/tool-catalog/index.md +9 -0
- package/docs/generated/tool-catalog/javascript.md +8 -6
- package/docs/generated/tool-catalog/json.md +7 -6
- package/docs/generated/tool-catalog/julia.md +8 -0
- package/docs/generated/tool-catalog/kotlin.md +6 -5
- package/docs/generated/tool-catalog/markdown.md +6 -5
- package/docs/generated/tool-catalog/powershell.md +9 -0
- package/docs/generated/tool-catalog/python.md +6 -6
- package/docs/generated/tool-catalog/r.md +9 -0
- package/docs/generated/tool-catalog/scala.md +9 -0
- package/docs/generated/tool-catalog/svelte.md +9 -0
- package/docs/generated/tool-catalog/toml.md +6 -5
- package/docs/generated/tool-catalog/typescript.md +9 -6
- package/docs/generated/tool-catalog/vue.md +9 -0
- package/docs/generated/tool-catalog/yaml.md +6 -5
- package/docs/generated/tool-catalog/zig.md +9 -0
- package/docs/tools.md +88 -6
- package/node_modules/pi-agent-doctor/package.json +15 -5
- package/node_modules/pi-agent-doctor/runtime/entry-16.js +1 -0
- package/node_modules/pi-agent-doctor/runtime/entry-17.js +1 -0
- package/node_modules/pi-agent-doctor/runtime/entry-18.js +1 -0
- package/node_modules/pi-agent-doctor/runtime/entry-19.js +1 -0
- package/node_modules/pi-agent-doctor/runtime/entry-20.js +1 -0
- package/node_modules/pi-agent-doctor/src/catalog.ts +27 -1
- package/node_modules/pi-agent-doctor/src/evidence.ts +118 -0
- package/node_modules/pi-agent-doctor/src/executable.ts +85 -6
- package/node_modules/pi-agent-doctor/src/plugin-protocol.ts +30 -4
- package/node_modules/pi-agent-filesystem/index.ts +4 -3
- package/node_modules/pi-agent-filesystem/package.json +7 -7
- package/node_modules/pi-agent-filesystem/runtime/entry-21.js +2 -0
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- package/node_modules/pi-agent-filesystem-image/runtime/entry-22.js +2 -0
- package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
- package/node_modules/pi-agent-filesystem-pdf/runtime/entry-23.js +2 -0
- package/node_modules/pi-agent-filesystem-text/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/runtime/entry-24.js +2 -0
- package/node_modules/pi-agent-ide-ast/package.json +11 -10
- package/node_modules/pi-agent-ide-ast/runtime/entry-25.js +1 -0
- package/node_modules/pi-agent-ide-ast/runtime/entry-26.js +2 -0
- package/node_modules/pi-agent-ide-ast/src/api/scope.ts +1 -1
- package/node_modules/pi-agent-ide-ast/src/ast/manager.ts +3 -0
- package/node_modules/pi-agent-ide-ast/src/ast/outline.ts +4 -1
- package/node_modules/pi-agent-ide-ast/src/doctor-plugin.ts +25 -0
- package/node_modules/pi-agent-ide-ast/src/extension.ts +13 -5
- package/node_modules/pi-agent-ide-ast/src/scope-resolver.ts +6 -0
- package/node_modules/pi-agent-ide-changes/index.ts +6 -2
- package/node_modules/pi-agent-ide-changes/package.json +8 -7
- package/node_modules/pi-agent-ide-changes/runtime/entry-27.js +1 -0
- package/node_modules/pi-agent-ide-changes/runtime/entry-28.js +2 -0
- package/node_modules/pi-agent-ide-changes/src/change-anchor.ts +6 -0
- package/node_modules/pi-agent-ide-changes/src/changes/change-groups.ts +1 -1
- package/node_modules/pi-agent-ide-changes/src/changes/change-service.ts +1 -1
- package/node_modules/pi-agent-ide-changes/src/changes/git-changes-backend.ts +1 -0
- package/node_modules/pi-agent-ide-changes/src/current-change-presenter.ts +1 -1
- package/node_modules/pi-agent-ide-changes/src/doctor-plugin.ts +31 -1
- package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +5 -0
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +7 -0
- package/node_modules/pi-agent-ide-formatter/package.json +4 -4
- package/node_modules/pi-agent-ide-formatter/runtime/entry-29.js +2 -0
- package/node_modules/pi-agent-ide-formatter/src/catalog.ts +165 -13
- package/node_modules/pi-agent-ide-formatter/src/doctor-plugin.ts +115 -63
- package/node_modules/pi-agent-ide-formatter/src/registry.ts +86 -31
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-languages/runtime/entry-30.js +2 -0
- package/node_modules/pi-agent-ide-languages/src/languages.ts +15 -0
- package/node_modules/pi-agent-ide-lint/index.ts +30 -155
- package/node_modules/pi-agent-ide-lint/package.json +8 -7
- package/node_modules/pi-agent-ide-lint/runtime/entry-31.js +2 -0
- package/node_modules/pi-agent-ide-lint/src/catalog.ts +210 -41
- package/node_modules/pi-agent-ide-lint/src/command-linter.ts +80 -4
- package/node_modules/pi-agent-ide-lint/src/diagnostics.ts +76 -34
- package/node_modules/pi-agent-ide-lint/src/doctor-plugin.ts +115 -64
- package/node_modules/pi-agent-ide-lint/src/registry.ts +87 -30
- package/node_modules/pi-agent-ide-lsp/index.ts +35 -134
- package/node_modules/pi-agent-ide-lsp/package.json +9 -8
- package/node_modules/pi-agent-ide-lsp/runtime/entry-32.js +2 -0
- package/node_modules/pi-agent-ide-lsp/src/catalog.ts +161 -7
- package/node_modules/pi-agent-ide-lsp/src/code-view-resolvers.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/src/diagnostic-source.ts +110 -0
- package/node_modules/pi-agent-ide-lsp/src/doctor-plugin.ts +108 -55
- package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +248 -38
- package/node_modules/pi-agent-ide-lsp/src/lsp/code-views.ts +2 -1
- package/node_modules/pi-agent-ide-lsp/src/lsp/diagnostic-adapters.ts +76 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/diagnostics.ts +137 -144
- package/node_modules/pi-agent-ide-lsp/src/lsp/file-watchers.ts +88 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/initialization-options.ts +14 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/lsp-compiler.ts +2 -2
- package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +17 -36
- package/node_modules/pi-agent-ide-lsp/src/lsp/registry.ts +139 -68
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +1 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/transport-writer.ts +24 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/types.ts +13 -6
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +5 -5
- package/node_modules/pi-agent-image/package.json +3 -3
- package/node_modules/pi-agent-image/runtime/entry-33.js +1 -0
- package/node_modules/pi-agent-invariant/package.json +12 -0
- package/node_modules/pi-agent-invariant/runtime/entry-34.js +1 -0
- package/node_modules/pi-agent-pdf/package.json +3 -3
- package/node_modules/pi-agent-pdf/runtime/entry-35.js +1 -0
- package/node_modules/pi-agent-pdf/src/pdf-converter.ts +3 -2
- package/node_modules/pi-agent-read/package.json +11 -9
- package/node_modules/pi-agent-read/runtime/entry-36.js +1 -0
- package/node_modules/pi-agent-read/runtime/entry-37.js +1 -0
- package/node_modules/pi-agent-read/runtime/entry-38.js +1 -0
- package/node_modules/pi-agent-read/runtime/entry-39.js +1 -0
- package/node_modules/pi-agent-read/runtime/entry-40.js +2 -0
- package/node_modules/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/node_modules/pi-agent-read/src/api/tools/read.ts +113 -2
- package/node_modules/pi-agent-read/src/core/extension.ts +19 -0
- package/node_modules/pi-agent-read/src/core/read-core.ts +85 -13
- package/node_modules/pi-agent-read/src/core/tools/read/output-truncation.ts +26 -10
- package/node_modules/pi-agent-read/src/core/tools/read/persisted-result.ts +72 -0
- package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +102 -12
- package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +27 -3
- package/node_modules/pi-agent-read/src/core/tools/read/views.ts +29 -0
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +532 -46
- package/node_modules/pi-agent-resource/package.json +5 -2
- package/node_modules/pi-agent-resource/runtime/entry-41.js +1 -0
- package/node_modules/pi-agent-resource/src/content-conversion/content-converter.ts +1 -1
- package/node_modules/pi-agent-resource/src/content-conversion/content-host.ts +1 -1
- package/node_modules/pi-agent-resource/src/content-conversion/content-runner.ts +1 -1
- package/node_modules/pi-agent-resource/src/content-conversion/validation.ts +1 -1
- package/node_modules/pi-agent-search/package.json +7 -6
- package/node_modules/pi-agent-search/runtime/entry-42.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-43.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-44.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-45.js +2 -0
- package/node_modules/pi-agent-search/src/api/search.ts +4 -0
- package/node_modules/pi-agent-search/src/core/extension.ts +99 -27
- package/node_modules/pi-agent-search/src/core/search-config.ts +98 -0
- package/node_modules/pi-agent-search/src/core/search-core.ts +32 -28
- package/node_modules/pi-agent-search/src/core/search-timeout.ts +54 -0
- package/node_modules/pi-agent-search-text/index.ts +53 -3
- package/node_modules/pi-agent-search-text/package.json +9 -9
- package/node_modules/pi-agent-search-text/runtime/entry-46.js +2 -0
- package/node_modules/pi-agent-search-text/runtime/entry-47.js +1 -0
- package/node_modules/pi-agent-search-text/src/doctor-plugin.ts +20 -1
- package/node_modules/pi-agent-search-text/src/persisted-result.ts +56 -0
- package/node_modules/pi-agent-search-text/src/resolvers.ts +36 -34
- package/node_modules/pi-agent-search-text/src/search-query.ts +254 -71
- package/node_modules/pi-agent-search-text/src/search-recipe.ts +68 -0
- package/node_modules/pi-agent-search-text/src/search-renderer.ts +71 -117
- package/node_modules/pi-agent-search-text/src/search-result.ts +1 -0
- package/node_modules/pi-agent-search-text/src/search-session.ts +276 -110
- package/node_modules/pi-agent-text/package.json +6 -3
- package/node_modules/pi-agent-text/runtime/entry-48.js +1 -0
- package/node_modules/pi-agent-text/src/index.ts +23 -0
- package/node_modules/pi-agent-text/src/stored-text.ts +14 -0
- package/node_modules/pi-agent-text/src/text-anchor.ts +160 -16
- package/node_modules/pi-agent-text/src/text-document.ts +26 -5
- package/node_modules/pi-agent-text/src/text-target.ts +105 -0
- package/node_modules/pi-agent-text-anchor-constant/package.json +7 -4
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-49.js +2 -0
- package/node_modules/pi-agent-text-anchor-constant/src/resolver.ts +6 -0
- package/node_modules/pi-agent-text-anchor-exact/index.ts +34 -0
- package/node_modules/pi-agent-text-anchor-exact/package.json +27 -0
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-50.js +1 -0
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-51.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/src/anchor.ts +230 -0
- package/node_modules/pi-agent-text-anchor-exact/src/config.ts +159 -0
- package/node_modules/pi-agent-text-anchor-exact/src/fuzzy-worker.ts +100 -0
- package/node_modules/pi-agent-text-anchor-exact/src/recovery.ts +151 -0
- package/node_modules/pi-agent-text-anchor-line-hash/index.ts +8 -2
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +10 -6
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-52.js +1 -0
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-53.js +2 -0
- package/node_modules/pi-agent-text-anchor-line-hash/src/anchor.ts +32 -1
- package/node_modules/pi-agent-text-anchor-line-hash/src/read-handler.ts +20 -12
- package/node_modules/pi-agent-text-editor/package.json +22 -21
- package/node_modules/pi-agent-text-editor/runtime/entry-54.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-55.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-56.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-57.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-58.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-59.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-60.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-61.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-62.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-63.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-64.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-65.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-66.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-67.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-68.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-69.js +2 -0
- package/node_modules/pi-agent-text-editor/src/api/anchor-inspection.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +1 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +38 -0
- package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +30 -15
- package/node_modules/pi-agent-text-editor/src/api/text-selection-anchor.ts +10 -13
- package/node_modules/pi-agent-text-editor/src/api/tool-call-interceptor.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/builtin-edit-filter.ts +12 -5
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +15 -1
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/agent-diff.ts +14 -10
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/diff.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +3 -2
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +19 -2
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +64 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/inline-hints.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/read-fragment-resolver.ts +83 -0
- package/node_modules/pi-agent-text-editor/src/core/text-anchor-registry.ts +96 -8
- package/node_modules/pi-agent-text-editor/src/core/text-change-engine.ts +4 -1
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +194 -35
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +43 -13
- package/node_modules/pi-agent-text-editor/src/core/text-editor-config.ts +95 -0
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +75 -5
- package/node_modules/pi-agent-text-editor/src/core/text-mutation-anchor-error.ts +7 -0
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +541 -130
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +5 -9
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/rendering.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/tools/text-selection.ts +228 -6
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +50 -70
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +25 -26
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +30 -21
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +57 -71
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +30 -27
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +2 -0
- package/node_modules/pi-agent-text-editor-argument-order/package.json +3 -3
- package/node_modules/pi-agent-text-editor-argument-order/runtime/entry-70.js +2 -0
- package/node_modules/pi-agent-text-editor-overwrite/index.ts +1 -1
- package/node_modules/pi-agent-text-editor-overwrite/package.json +4 -3
- package/node_modules/pi-agent-text-editor-overwrite/runtime/entry-71.js +2 -0
- package/node_modules/pi-agent-text-editor-renderer/index.ts +21 -1
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -3
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-72.js +2 -0
- package/node_modules/pi-agent-text-editor-renderer/src/animation-pressure.ts +50 -0
- package/node_modules/pi-agent-text-editor-renderer/src/config.ts +73 -0
- package/node_modules/pi-agent-text-editor-renderer/src/diff-model.ts +1 -1
- package/node_modules/pi-agent-text-editor-renderer/src/diff-renderer.ts +77 -22
- package/node_modules/pi-agent-text-editor-renderer/src/diff-theme.ts +1 -1
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +140 -24
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-projection.ts +274 -43
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-result.ts +33 -6
- package/node_modules/pi-agent-text-editor-renderer/src/persisted-result.ts +47 -0
- package/node_modules/pi-agent-text-editor-renderer/src/render-resource.ts +7 -0
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +265 -105
- package/node_modules/pi-agent-text-editor-renderer/src/typing-interpolation.ts +96 -15
- package/node_modules/pi-agent-text-editor-stale-anchor/index.ts +22 -6
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -4
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +2 -0
- package/node_modules/pi-agent-tool-call-interception/package.json +5 -2
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-74.js +1 -0
- package/node_modules/pi-agent-tool-call-interception/src/index.ts +175 -32
- package/node_modules/pi-agent-tool-ui/package.json +15 -0
- package/node_modules/pi-agent-tool-ui/runtime/entry-75.js +1 -0
- package/node_modules/pi-agent-tool-ui/src/index.ts +318 -0
- package/node_modules/pi-agent-web/index.ts +16 -6
- package/node_modules/pi-agent-web/package.json +8 -6
- package/node_modules/pi-agent-web/runtime/entry-76.js +2 -0
- package/node_modules/pi-agent-web/src/browser-loader.ts +180 -0
- package/node_modules/pi-agent-web/src/doctor-plugin.ts +41 -0
- package/node_modules/pi-agent-web/src/resolver.ts +128 -24
- package/node_modules/pi-agent-web-html/package.json +6 -3
- package/node_modules/pi-agent-web-html/runtime/entry-77.js +2 -0
- package/node_modules/pi-agent-web-html/src/extract-readable-html.ts +19 -6
- package/node_modules/pi-agent-web-image/package.json +4 -4
- package/node_modules/pi-agent-web-image/runtime/entry-78.js +2 -0
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/runtime/entry-79.js +2 -0
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-80.js +2 -0
- package/package.json +68 -54
- package/src/api/code-view.ts +4 -0
- package/src/api/connect-tip-provider.ts +49 -0
- package/src/api/plugin-protocol.ts +41 -2
- package/src/api/tips.ts +77 -0
- package/src/api/tool-config/formatters.json +273 -0
- package/src/api/tool-config/linters.json +339 -0
- package/src/api/tool-config/lsp-servers.json +410 -0
- package/src/api/tool-config.ts +248 -12
- package/src/api/toolchain.ts +0 -5
- package/src/code-view/diagnostic-view.ts +121 -26
- package/src/code-view/source-view.ts +1 -1
- package/src/composite/builtin-extensions.ts +12 -6
- package/src/composite/extensions-config.ts +137 -0
- package/src/composite/selection.ts +58 -3
- package/src/core/diagnostic-store.ts +244 -0
- package/src/core/extension.ts +40 -0
- package/src/core/ide-core.ts +48 -3
- package/src/doctor/config-writer.ts +15 -2
- package/src/doctor/core.ts +47 -0
- package/src/doctor/discovery.ts +23 -70
- package/src/doctor/extension.ts +12 -1
- package/src/doctor/inventory.ts +24 -6
- package/src/doctor/run.ts +100 -87
- package/src/doctor/tip-provider.ts +92 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +4 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-22.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-23.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-24.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-21.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +16 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +6 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-77.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/src/extract-readable-html.ts +19 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-78.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-79.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-80.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-76.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/browser-loader.ts +180 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/doctor-plugin.ts +41 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/resolver.ts +128 -24
- package/src/extensions/pi-agent-read/package.json +11 -9
- package/src/extensions/pi-agent-read/runtime/entry-36.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-37.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-38.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-39.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-40.js +2 -0
- package/src/extensions/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +113 -2
- package/src/extensions/pi-agent-read/src/core/extension.ts +19 -0
- package/src/extensions/pi-agent-read/src/core/read-core.ts +85 -13
- package/src/extensions/pi-agent-read/src/core/tools/read/output-truncation.ts +26 -10
- package/src/extensions/pi-agent-read/src/core/tools/read/persisted-result.ts +72 -0
- package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +102 -12
- package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +27 -3
- package/src/extensions/pi-agent-read/src/core/tools/read/views.ts +29 -0
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +532 -46
- package/src/extensions/pi-agent-search/package.json +7 -6
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +53 -3
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +9 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-46.js +2 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-47.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/doctor-plugin.ts +20 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/persisted-result.ts +56 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +36 -34
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-query.ts +254 -71
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +68 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +71 -117
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +276 -110
- package/src/extensions/pi-agent-search/runtime/entry-42.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-43.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-44.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-45.js +2 -0
- package/src/extensions/pi-agent-search/src/api/search.ts +4 -0
- package/src/extensions/pi-agent-search/src/core/extension.ts +99 -27
- package/src/extensions/pi-agent-search/src/core/search-config.ts +98 -0
- package/src/extensions/pi-agent-search/src/core/search-core.ts +32 -28
- package/src/extensions/pi-agent-search/src/core/search-timeout.ts +54 -0
- package/src/extensions/pi-agent-text-editor/package.json +22 -21
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +7 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-49.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/src/resolver.ts +6 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.ts +34 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +27 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-50.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-51.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/anchor.ts +230 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/config.ts +159 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/fuzzy-worker.ts +100 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/recovery.ts +151 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +8 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +10 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-52.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-53.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/anchor.ts +32 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/read-handler.ts +20 -12
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/package.json +3 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/runtime/entry-70.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/index.ts +1 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/package.json +4 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/runtime/entry-71.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +21 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-72.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/animation-pressure.ts +50 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/config.ts +73 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-model.ts +1 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-renderer.ts +77 -22
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-theme.ts +1 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +140 -24
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-projection.ts +274 -43
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-result.ts +33 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/persisted-result.ts +47 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/render-resource.ts +7 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +265 -105
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/typing-interpolation.ts +96 -15
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/index.ts +22 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +2 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-54.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-55.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-56.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-57.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-58.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-59.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-60.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-61.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-62.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-63.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-64.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-65.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-66.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-67.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-68.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-69.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/anchor-inspection.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +1 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +38 -0
- package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +30 -15
- package/src/extensions/pi-agent-text-editor/src/api/text-selection-anchor.ts +10 -13
- package/src/extensions/pi-agent-text-editor/src/api/tool-call-interceptor.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/builtin-edit-filter.ts +12 -5
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +15 -1
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/agent-diff.ts +14 -10
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/diff.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +3 -2
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +19 -2
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +64 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/inline-hints.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/read-fragment-resolver.ts +83 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-anchor-registry.ts +96 -8
- package/src/extensions/pi-agent-text-editor/src/core/text-change-engine.ts +4 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +194 -35
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +43 -13
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-config.ts +95 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +75 -5
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation-anchor-error.ts +7 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +541 -130
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +5 -9
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/rendering.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/tools/text-selection.ts +228 -6
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +50 -70
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +25 -26
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +30 -21
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +57 -71
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +30 -27
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +2 -0
- package/src/pi-agent-ide.ts +15 -3
- package/src/plugins/pi-agent-ide-ast/package.json +11 -10
- package/src/plugins/pi-agent-ide-ast/runtime/entry-25.js +1 -0
- package/src/plugins/pi-agent-ide-ast/runtime/entry-26.js +2 -0
- package/src/plugins/pi-agent-ide-ast/src/api/scope.ts +1 -1
- package/src/plugins/pi-agent-ide-ast/src/ast/manager.ts +3 -0
- package/src/plugins/pi-agent-ide-ast/src/ast/outline.ts +4 -1
- package/src/plugins/pi-agent-ide-ast/src/doctor-plugin.ts +25 -0
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +13 -5
- package/src/plugins/pi-agent-ide-ast/src/scope-resolver.ts +6 -0
- package/src/plugins/pi-agent-ide-changes/index.ts +6 -2
- package/src/plugins/pi-agent-ide-changes/package.json +8 -7
- package/src/plugins/pi-agent-ide-changes/runtime/entry-27.js +1 -0
- package/src/plugins/pi-agent-ide-changes/runtime/entry-28.js +2 -0
- package/src/plugins/pi-agent-ide-changes/src/change-anchor.ts +6 -0
- package/src/plugins/pi-agent-ide-changes/src/changes/change-groups.ts +1 -1
- package/src/plugins/pi-agent-ide-changes/src/changes/change-service.ts +1 -1
- package/src/plugins/pi-agent-ide-changes/src/changes/git-changes-backend.ts +1 -0
- package/src/plugins/pi-agent-ide-changes/src/current-change-presenter.ts +1 -1
- package/src/plugins/pi-agent-ide-changes/src/doctor-plugin.ts +31 -1
- package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +5 -0
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +7 -0
- package/src/plugins/pi-agent-ide-diagnostics/index.ts +1 -0
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +199 -0
- package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
- package/src/plugins/pi-agent-ide-formatter/runtime/entry-29.js +2 -0
- package/src/plugins/pi-agent-ide-formatter/src/catalog.ts +165 -13
- package/src/plugins/pi-agent-ide-formatter/src/doctor-plugin.ts +115 -63
- package/src/plugins/pi-agent-ide-formatter/src/registry.ts +86 -31
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-languages/runtime/entry-30.js +2 -0
- package/src/plugins/pi-agent-ide-languages/src/languages.ts +15 -0
- package/src/plugins/pi-agent-ide-lint/index.ts +30 -155
- package/src/plugins/pi-agent-ide-lint/package.json +8 -7
- package/src/plugins/pi-agent-ide-lint/runtime/entry-31.js +2 -0
- package/src/plugins/pi-agent-ide-lint/src/catalog.ts +210 -41
- package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +80 -4
- package/src/plugins/pi-agent-ide-lint/src/diagnostics.ts +76 -34
- package/src/plugins/pi-agent-ide-lint/src/doctor-plugin.ts +115 -64
- package/src/plugins/pi-agent-ide-lint/src/registry.ts +87 -30
- package/src/plugins/pi-agent-ide-lsp/index.ts +35 -134
- package/src/plugins/pi-agent-ide-lsp/package.json +9 -8
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-32.js +2 -0
- package/src/plugins/pi-agent-ide-lsp/src/catalog.ts +161 -7
- package/src/plugins/pi-agent-ide-lsp/src/code-view-resolvers.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/src/diagnostic-source.ts +110 -0
- package/src/plugins/pi-agent-ide-lsp/src/doctor-plugin.ts +108 -55
- package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +248 -38
- package/src/plugins/pi-agent-ide-lsp/src/lsp/code-views.ts +2 -1
- package/src/plugins/pi-agent-ide-lsp/src/lsp/diagnostic-adapters.ts +76 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/diagnostics.ts +137 -144
- package/src/plugins/pi-agent-ide-lsp/src/lsp/file-watchers.ts +88 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/initialization-options.ts +14 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/lsp-compiler.ts +2 -2
- package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +17 -36
- package/src/plugins/pi-agent-ide-lsp/src/lsp/registry.ts +139 -68
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +1 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/transport-writer.ts +24 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/types.ts +13 -6
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +5 -5
- package/src/post-edit/gate.ts +17 -141
- package/src/tips/core.ts +86 -0
- package/src/tips/extension.ts +115 -0
- package/src/tips/persistence.ts +225 -0
- package/src/tips/tip-callout.ts +77 -0
- package/src/toolchain/registry.ts +8 -23
- package/src/toolchain/types.ts +8 -74
- package/node_modules/pi-agent-search-semantic/index.ts +0 -97
- package/node_modules/pi-agent-search-semantic/package.json +0 -17
- package/node_modules/pi-agent-search-text/src/lucene-query-parser.d.ts +0 -20
- package/node_modules/pi-agent-search-web/index.ts +0 -82
- package/node_modules/pi-agent-search-web/package.json +0 -20
- package/node_modules/pi-agent-search-web/src/config.ts +0 -560
- package/node_modules/pi-agent-search-web/src/doctor-plugin.ts +0 -40
- package/node_modules/pi-agent-search-web/src/providers/duckduckgo-html.ts +0 -74
- package/node_modules/pi-agent-search-web/src/providers/endpoints.ts +0 -81
- package/node_modules/pi-agent-search-web/src/providers/request.ts +0 -427
- package/node_modules/pi-agent-search-web/src/providers/response.ts +0 -353
- package/node_modules/pi-agent-search-web/src/search-format.ts +0 -24
- package/node_modules/pi-agent-search-web/src/search.ts +0 -376
- package/node_modules/pi-agent-search-web/src/types.ts +0 -141
- package/src/composite/config.ts +0 -100
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-semantic/index.ts +0 -97
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-semantic/package.json +0 -17
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/lucene-query-parser.d.ts +0 -20
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/index.ts +0 -82
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/package.json +0 -20
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/config.ts +0 -560
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/doctor-plugin.ts +0 -40
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/duckduckgo-html.ts +0 -74
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/endpoints.ts +0 -81
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/request.ts +0 -427
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/response.ts +0 -353
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/search-format.ts +0 -24
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/search.ts +0 -376
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/types.ts +0 -141
- package/src/toolchain/gate.ts +0 -305
- /package/{src/utils/required-value.ts → node_modules/pi-agent-invariant/src/index.ts} +0 -0
|
@@ -1,107 +1,164 @@
|
|
|
1
|
-
import { requiredValue } from "../../../../utils/required-value.js";
|
|
2
|
-
import { readFile } from "node:fs/promises";
|
|
3
1
|
import path from "node:path";
|
|
4
2
|
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
|
|
5
|
+
import { hasConfiguredExecutable, loadLayeredToolConfig } from "pi-agent-ide/api/tool-config";
|
|
6
|
+
|
|
5
7
|
import { buildLanguageLookup, type LanguageLookup } from "./language-map.js";
|
|
6
8
|
|
|
9
|
+
import type {
|
|
10
|
+
EffectiveToolConfigEntry,
|
|
11
|
+
LayeredToolConfigOptions,
|
|
12
|
+
} from "pi-agent-ide/api/tool-config";
|
|
7
13
|
import type { LspServersConfig, ResolvedServer, ServerConfig } from "./types.js";
|
|
8
14
|
|
|
9
15
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
13
|
-
* Thread-safe: all mutations happen at construction time.
|
|
14
|
-
*/
|
|
16
|
+
LSP server configuration in project, global, and built-in priority order.
|
|
17
|
+
*/
|
|
15
18
|
export class LspServerRegistry {
|
|
16
19
|
private readonly _servers: Record<string, ServerConfig>;
|
|
20
|
+
private readonly _entries: readonly EffectiveToolConfigEntry<ServerConfig>[];
|
|
17
21
|
private readonly _lookup: LanguageLookup;
|
|
18
22
|
|
|
19
|
-
private constructor(
|
|
20
|
-
|
|
23
|
+
private constructor(
|
|
24
|
+
entries: readonly EffectiveToolConfigEntry<ServerConfig>[],
|
|
25
|
+
availableBuiltIns: ReadonlySet<string>,
|
|
26
|
+
private readonly _projectRoot: string,
|
|
27
|
+
) {
|
|
28
|
+
this._entries = entries;
|
|
29
|
+
const activeEntries = entries.filter(
|
|
30
|
+
(entry) => entry.layer !== "built-in" || availableBuiltIns.has(entry.id),
|
|
31
|
+
);
|
|
32
|
+
this._servers = Object.fromEntries(activeEntries.map((entry) => [entry.id, entry.config]));
|
|
21
33
|
this._lookup = buildLanguageLookup(this._servers);
|
|
22
34
|
}
|
|
23
35
|
|
|
24
36
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
static async fromPackageDir(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
Loads and merges project, global, and built-in `lsp-servers.json` files.
|
|
38
|
+
*/
|
|
39
|
+
static async fromPackageDir(
|
|
40
|
+
packageDir: string,
|
|
41
|
+
options: LayeredToolConfigOptions = {},
|
|
42
|
+
): Promise<LspServerRegistry> {
|
|
43
|
+
const effective = await loadLayeredToolConfig(
|
|
44
|
+
packageDir,
|
|
45
|
+
"lsp-servers",
|
|
46
|
+
(value) => parseLspConfig(value).servers,
|
|
47
|
+
options,
|
|
48
|
+
);
|
|
49
|
+
const environment = options.environment ?? process.env;
|
|
50
|
+
const available = await Promise.all(
|
|
51
|
+
effective.entries
|
|
52
|
+
.filter((entry) => entry.layer === "built-in")
|
|
53
|
+
.map(async (entry) => ({
|
|
54
|
+
id: entry.id,
|
|
55
|
+
available: await hasConfiguredExecutable(entry.config, packageDir, environment),
|
|
56
|
+
})),
|
|
57
|
+
);
|
|
58
|
+
return new LspServerRegistry(
|
|
59
|
+
effective.entries,
|
|
60
|
+
new Set(available.filter((entry) => entry.available).map((entry) => entry.id)),
|
|
61
|
+
path.resolve(packageDir),
|
|
62
|
+
);
|
|
42
63
|
}
|
|
43
64
|
|
|
44
65
|
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
static fromConfig(config: LspServersConfig): LspServerRegistry {
|
|
48
|
-
return new LspServerRegistry(
|
|
66
|
+
Creates a project-layer registry from an already-parsed config.
|
|
67
|
+
*/
|
|
68
|
+
static fromConfig(config: LspServersConfig, projectRoot = process.cwd()): LspServerRegistry {
|
|
69
|
+
return new LspServerRegistry(
|
|
70
|
+
Object.entries(config.servers).map(([id, server]) => ({
|
|
71
|
+
id,
|
|
72
|
+
config: server,
|
|
73
|
+
layer: "project",
|
|
74
|
+
sourcePath: "<memory>",
|
|
75
|
+
})),
|
|
76
|
+
new Set(),
|
|
77
|
+
path.resolve(projectRoot),
|
|
78
|
+
);
|
|
49
79
|
}
|
|
50
80
|
|
|
51
|
-
/**
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
81
|
+
/** Resolve a file path or extension to servers in layer priority order. */
|
|
82
|
+
resolve(file: string): ResolvedServer[] {
|
|
83
|
+
const basename = path.basename(file);
|
|
84
|
+
const extension = path.extname(file) || (file.startsWith(".") ? file : `.${file}`);
|
|
85
|
+
const normalizeName = (name: string) =>
|
|
86
|
+
process.platform === "win32" ? name.toLowerCase() : name;
|
|
87
|
+
const matches: ResolvedServer[] = [];
|
|
88
|
+
for (const entry of this._entries) {
|
|
89
|
+
if (!this._servers[entry.id]) continue;
|
|
90
|
+
|
|
91
|
+
if (entry.config.requireRootMarker && !this.hasRootMarker(file, entry.config.rootMarkers))
|
|
92
|
+
continue;
|
|
93
|
+
for (const [languageId, language] of Object.entries(entry.config.languages)) {
|
|
94
|
+
if (
|
|
95
|
+
language.extensions.some(
|
|
96
|
+
(candidate) => candidate.toLowerCase() === extension.toLowerCase(),
|
|
97
|
+
) ||
|
|
98
|
+
language.fileNames?.some((name) => normalizeName(name) === normalizeName(basename))
|
|
99
|
+
) {
|
|
100
|
+
matches.push({
|
|
101
|
+
serverId: entry.id,
|
|
102
|
+
config: entry.config,
|
|
103
|
+
languageId,
|
|
104
|
+
layer: entry.layer,
|
|
105
|
+
sourcePath: entry.sourcePath,
|
|
106
|
+
});
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
63
110
|
}
|
|
111
|
+
return matches;
|
|
112
|
+
}
|
|
64
113
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if (!
|
|
68
|
-
|
|
114
|
+
private hasRootMarker(file: string, markers: readonly string[]): boolean {
|
|
115
|
+
let directory = path.dirname(path.resolve(this._projectRoot, file));
|
|
116
|
+
if (file.startsWith(".") && !file.includes(path.sep)) directory = this._projectRoot;
|
|
117
|
+
for (;;) {
|
|
118
|
+
const relative = path.relative(this._projectRoot, directory);
|
|
119
|
+
// This checks containment; it does not construct a parent-relative path.
|
|
120
|
+
// eslint-disable-next-line repo/no-parent-paths
|
|
121
|
+
if (relative === ".." || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative))
|
|
122
|
+
return false;
|
|
123
|
+
if (markers.some((marker) => existsSync(path.join(directory, marker)))) return true;
|
|
124
|
+
if (directory === this._projectRoot) return false;
|
|
125
|
+
directory = path.dirname(directory);
|
|
69
126
|
}
|
|
70
|
-
|
|
71
|
-
return serverIds.map((serverId) => ({
|
|
72
|
-
serverId,
|
|
73
|
-
config: requiredValue(this._servers[serverId]),
|
|
74
|
-
languageId,
|
|
75
|
-
}));
|
|
76
127
|
}
|
|
77
128
|
|
|
78
129
|
/**
|
|
79
|
-
|
|
80
|
-
|
|
130
|
+
All effective server configurations by stable ID.
|
|
131
|
+
*/
|
|
81
132
|
get servers(): Readonly<Record<string, ServerConfig>> {
|
|
82
133
|
return this._servers;
|
|
83
134
|
}
|
|
84
135
|
|
|
85
136
|
/**
|
|
86
|
-
|
|
87
|
-
|
|
137
|
+
All merged server entries in runtime resolution order.
|
|
138
|
+
*/
|
|
139
|
+
get entries(): readonly EffectiveToolConfigEntry<ServerConfig>[] {
|
|
140
|
+
return this._entries;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
All known extensions (with leading dot, lowercased).
|
|
145
|
+
*/
|
|
88
146
|
get knownExtensions(): ReadonlySet<string> {
|
|
89
147
|
return new Set(this._lookup.extToLanguageId.keys());
|
|
90
148
|
}
|
|
91
149
|
|
|
92
150
|
/**
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
*/
|
|
151
|
+
Resolves a file extension to the canonical LSP languageId.
|
|
152
|
+
*/
|
|
96
153
|
languageId(extension: string): string {
|
|
97
|
-
|
|
98
|
-
? extension.toLowerCase()
|
|
99
|
-
: `.${extension.toLowerCase()}`;
|
|
100
|
-
return this._lookup.extToLanguageId.get(normalized) ?? extension.slice(1);
|
|
154
|
+
return this.resolve(extension)[0]?.languageId ?? extension.slice(1);
|
|
101
155
|
}
|
|
102
156
|
}
|
|
103
157
|
|
|
104
|
-
|
|
158
|
+
/**
|
|
159
|
+
Validates and returns an LSP server configuration object.
|
|
160
|
+
*/
|
|
161
|
+
export function parseLspConfig(value: unknown): LspServersConfig {
|
|
105
162
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
106
163
|
throw new Error("LSP config must be an object");
|
|
107
164
|
}
|
|
@@ -142,6 +199,13 @@ function parseLspConfig(value: unknown): LspServersConfig {
|
|
|
142
199
|
throw new Error(`LSP server ${id}.rootMarkers must be a string array`);
|
|
143
200
|
}
|
|
144
201
|
|
|
202
|
+
if (server.requireRootMarker !== undefined && typeof server.requireRootMarker !== "boolean") {
|
|
203
|
+
throw new TypeError(`LSP server ${id}.requireRootMarker must be a boolean`);
|
|
204
|
+
}
|
|
205
|
+
if (server.requireRootMarker && (server.rootMarkers as string[]).length === 0) {
|
|
206
|
+
throw new Error(`LSP server ${id}.requireRootMarker requires rootMarkers`);
|
|
207
|
+
}
|
|
208
|
+
|
|
145
209
|
if (
|
|
146
210
|
typeof server.languages !== "object" ||
|
|
147
211
|
server.languages === null ||
|
|
@@ -165,6 +229,17 @@ function parseLspConfig(value: unknown): LspServersConfig {
|
|
|
165
229
|
) {
|
|
166
230
|
throw new Error(`LSP server ${id} language ${language} requires extensions`);
|
|
167
231
|
}
|
|
232
|
+
|
|
233
|
+
const fileNames = (languageValue as Record<string, unknown>).fileNames;
|
|
234
|
+
if (
|
|
235
|
+
fileNames !== undefined &&
|
|
236
|
+
(!Array.isArray(fileNames) ||
|
|
237
|
+
fileNames.some(
|
|
238
|
+
(name) => typeof name !== "string" || name.length === 0 || /[/\\]/u.test(name),
|
|
239
|
+
))
|
|
240
|
+
) {
|
|
241
|
+
throw new Error(`LSP server ${id} language ${language}.fileNames must contain basenames`);
|
|
242
|
+
}
|
|
168
243
|
}
|
|
169
244
|
|
|
170
245
|
if (!Array.isArray(server.capabilities)) {
|
|
@@ -174,7 +249,3 @@ function parseLspConfig(value: unknown): LspServersConfig {
|
|
|
174
249
|
|
|
175
250
|
return value as LspServersConfig;
|
|
176
251
|
}
|
|
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,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Writable } from "node:stream";
|
|
2
|
+
import { StreamMessageWriter, type Message } from "vscode-jsonrpc/node";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Ends the connection on write failure instead of rejecting into JSON-RPC 9's
|
|
6
|
+
* async Promise executor. The owner must dispose the connection so pending
|
|
7
|
+
* requests reject; a failed transport must never look like a successful request.
|
|
8
|
+
*/
|
|
9
|
+
export class TransportWriter extends StreamMessageWriter {
|
|
10
|
+
constructor(
|
|
11
|
+
stream: Writable,
|
|
12
|
+
private readonly fail: (error: unknown) => void,
|
|
13
|
+
) {
|
|
14
|
+
super(stream);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
override async write(message: Message): Promise<void> {
|
|
18
|
+
try {
|
|
19
|
+
await super.write(message);
|
|
20
|
+
} catch (error) {
|
|
21
|
+
this.fail(error);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -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
|
/**
|
|
@@ -51,6 +53,8 @@ export interface LspTextEdit {
|
|
|
51
53
|
|
|
52
54
|
export interface LanguageEntry {
|
|
53
55
|
extensions: string[];
|
|
56
|
+
/** Exact basenames for files such as Dockerfile and CMakeLists.txt. */
|
|
57
|
+
fileNames?: string[];
|
|
54
58
|
}
|
|
55
59
|
|
|
56
60
|
export type ServerCapability = "diagnostics";
|
|
@@ -59,6 +63,9 @@ export interface ServerConfig {
|
|
|
59
63
|
command: string[];
|
|
60
64
|
transport?: "stdio";
|
|
61
65
|
rootMarkers: string[];
|
|
66
|
+
|
|
67
|
+
/** Require a root marker in the file's directory or an ancestor inside the project. */
|
|
68
|
+
requireRootMarker?: boolean;
|
|
62
69
|
languages: Record<string, LanguageEntry>;
|
|
63
70
|
capabilities: ServerCapability[];
|
|
64
71
|
env?: Record<string, string>;
|
|
@@ -81,15 +88,15 @@ export interface LspServersConfig {
|
|
|
81
88
|
// ── Resolved server info (registry output) ─────────────────────────────
|
|
82
89
|
|
|
83
90
|
export interface ResolvedServer {
|
|
84
|
-
/**
|
|
85
|
-
Server key from lsp-servers.json (e.g. "gopls").
|
|
86
|
-
*/
|
|
91
|
+
/** Server key from lsp-servers.json (e.g. "gopls"). */
|
|
87
92
|
serverId: string;
|
|
88
93
|
config: ServerConfig;
|
|
89
|
-
/**
|
|
90
|
-
LanguageId this extension maps to (e.g. "go").
|
|
91
|
-
*/
|
|
94
|
+
/** LanguageId this extension maps to (e.g. "go"). */
|
|
92
95
|
languageId: string;
|
|
96
|
+
/** Configuration layer that supplied this server. */
|
|
97
|
+
layer: ToolConfigLayer;
|
|
98
|
+
/** JSON file that supplied this server. */
|
|
99
|
+
sourcePath: string;
|
|
93
100
|
}
|
|
94
101
|
|
|
95
102
|
// ── 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) =>
|
package/src/post-edit/gate.ts
CHANGED
|
@@ -1,145 +1,21 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const DIAGNOSTIC_SEVERITY_RANK: Record<Diagnostic["severity"], number> = {
|
|
18
|
-
error: 0,
|
|
19
|
-
warning: 1,
|
|
20
|
-
info: 2,
|
|
21
|
-
hint: 3,
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export type IdePostEditGateRunner = (
|
|
25
|
-
filePath: string,
|
|
26
|
-
toolchain: ActiveToolchain,
|
|
27
|
-
) => Promise<GateResult>;
|
|
28
|
-
|
|
29
|
-
export async function runIdePostEditGate(
|
|
30
|
-
transaction: TextPostEditTransaction,
|
|
31
|
-
runGate: IdePostEditGateRunner = runToolchainGate,
|
|
32
|
-
): Promise<TextMutationResultContributionData | undefined> {
|
|
33
|
-
if (!path.isAbsolute(transaction.resourceSource)) {
|
|
34
|
-
return undefined;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
let toolchain = getActiveToolchain();
|
|
38
|
-
|
|
39
|
-
if (!isToolchainReady() || toolchain.ctx.cwd !== transaction.cwd) {
|
|
40
|
-
toolchain = await warmup({ cwd: transaction.cwd });
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const gateResult = await runGate(transaction.resourceSource, toolchain);
|
|
44
|
-
const fileResult = gateResult.files.find(
|
|
45
|
-
(result) => result.filePath === transaction.resourceSource,
|
|
46
|
-
);
|
|
47
|
-
const finalContent = fileResult?.finalContent ?? transaction.requestedAfter.content;
|
|
48
|
-
const finalLines = normalizedLines(finalContent);
|
|
49
|
-
const compile = fileResult?.compile;
|
|
50
|
-
const syntaxDiagnostics = compile?.syntaxErrors ?? [];
|
|
51
|
-
const hints: DiagnosticHint[] = [];
|
|
52
|
-
|
|
53
|
-
const addHint = (diagnostic: Diagnostic, source: string): void => {
|
|
54
|
-
if (
|
|
55
|
-
!Number.isInteger(diagnostic.line) ||
|
|
56
|
-
diagnostic.line < 1 ||
|
|
57
|
-
diagnostic.line > finalLines.length
|
|
58
|
-
) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
hints.push({
|
|
63
|
-
file: transaction.source,
|
|
64
|
-
line: diagnostic.line,
|
|
65
|
-
column: diagnostic.column,
|
|
66
|
-
lineText: finalLines[diagnostic.line - 1] ?? "",
|
|
67
|
-
severity: diagnostic.severity,
|
|
68
|
-
source,
|
|
69
|
-
code: diagnostic.code,
|
|
70
|
-
message: diagnostic.message,
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
for (const diagnostic of syntaxDiagnostics) {
|
|
75
|
-
addHint(diagnostic, "compiler");
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (syntaxDiagnostics.length === 0) {
|
|
79
|
-
const compilerDiagnostics = compile?.otherDiagnostics ?? [];
|
|
80
|
-
|
|
81
|
-
if (compilerDiagnostics.length > 0) {
|
|
82
|
-
for (const diagnostic of compilerDiagnostics) {
|
|
83
|
-
addHint(diagnostic, "compiler");
|
|
84
|
-
}
|
|
85
|
-
} else {
|
|
86
|
-
for (const diagnostic of fileResult?.lint.diagnostics ?? []) {
|
|
87
|
-
addHint(diagnostic, "linter");
|
|
88
|
-
}
|
|
89
|
-
}
|
|
3
|
+
import { warmupFormatting } from "#src/toolchain/registry.js";
|
|
4
|
+
import type { TextPostEditTransaction } from "pi-agent-text-editor/api/post-edit";
|
|
5
|
+
|
|
6
|
+
/** Finish only file-writing work. Diagnostics are scheduled after final edit completion. */
|
|
7
|
+
export async function runIdePostEditGate(transaction: TextPostEditTransaction): Promise<undefined> {
|
|
8
|
+
if (!path.isAbsolute(transaction.resourceSource)) return;
|
|
9
|
+
const toolchain = await warmupFormatting({ cwd: transaction.cwd });
|
|
10
|
+
const extension = path.extname(transaction.resourceSource).toLowerCase();
|
|
11
|
+
const matches = (tool: { extensions: readonly string[] }) =>
|
|
12
|
+
tool.extensions.includes(extension) || tool.extensions.includes("*");
|
|
13
|
+
const syntax = toolchain.compilers.find(matches);
|
|
14
|
+
if (syntax) {
|
|
15
|
+
const result = await syntax.compile({ filePath: transaction.resourceSource }, toolchain.ctx);
|
|
16
|
+
if (result.syntaxErrors.length > 0) return;
|
|
90
17
|
}
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
transaction.before.content,
|
|
95
|
-
finalContent,
|
|
96
|
-
).length;
|
|
97
|
-
|
|
98
|
-
return {
|
|
99
|
-
hints,
|
|
100
|
-
scopeMarkers: {},
|
|
101
|
-
warnings: [],
|
|
102
|
-
...(syntaxDiagnostics.length > MAX_SYNTAX_ERRORS && {
|
|
103
|
-
syntaxErrorSummary: { total: syntaxDiagnostics.length, shown: shownSyntaxErrors },
|
|
104
|
-
}),
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function runToolchainGate(filePath: string, toolchain: ActiveToolchain): Promise<GateResult> {
|
|
109
|
-
return new Gate(toolchain).runAll([filePath]);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function selectSyntaxDiagnostics(
|
|
113
|
-
diagnostics: readonly Diagnostic[],
|
|
114
|
-
beforeContent: string,
|
|
115
|
-
afterContent: string,
|
|
116
|
-
): Diagnostic[] {
|
|
117
|
-
const changedRanges = computeChangedRanges(beforeContent, afterContent);
|
|
118
|
-
const visible = diagnostics.filter((diagnostic) =>
|
|
119
|
-
changedRanges.some((range) => diagnostic.line >= range.start && diagnostic.line <= range.end),
|
|
120
|
-
);
|
|
121
|
-
const hidden = diagnostics
|
|
122
|
-
.filter((diagnostic) => !visible.includes(diagnostic))
|
|
123
|
-
.sort(compareDiagnostics);
|
|
124
|
-
|
|
125
|
-
return [...visible, ...hidden.slice(0, Math.max(0, MAX_SYNTAX_ERRORS - visible.length))];
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function compareDiagnostics(left: Diagnostic, right: Diagnostic): number {
|
|
129
|
-
return (
|
|
130
|
-
DIAGNOSTIC_SEVERITY_RANK[left.severity] - DIAGNOSTIC_SEVERITY_RANK[right.severity] ||
|
|
131
|
-
left.line - right.line ||
|
|
132
|
-
left.column - right.column ||
|
|
133
|
-
left.code.localeCompare(right.code)
|
|
134
|
-
);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
function normalizedLines(content: string): string[] {
|
|
138
|
-
const normalized = content.replaceAll("\r\n", "\n");
|
|
139
|
-
|
|
140
|
-
if (normalized.length === 0) {
|
|
141
|
-
return [];
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
return normalized.endsWith("\n") ? normalized.slice(0, -1).split("\n") : normalized.split("\n");
|
|
18
|
+
// Configured formatters may use their own parser to reject invalid syntax safely.
|
|
19
|
+
const formatter = toolchain.formatters.find(matches);
|
|
20
|
+
await formatter?.format({ filePath: transaction.resourceSource }, toolchain.ctx);
|
|
145
21
|
}
|
package/src/tips/core.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { Tip, TipContext, TipProvider } from "#src/api/tips.js";
|
|
2
|
+
|
|
3
|
+
/** A provider-owned tip paired with its source provider ID. */
|
|
4
|
+
export interface TipContribution {
|
|
5
|
+
readonly providerId: string;
|
|
6
|
+
readonly tip: Tip;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
Aggregates independent startup-tip providers and isolates provider failures.
|
|
11
|
+
*/
|
|
12
|
+
export class TipCore {
|
|
13
|
+
private readonly providers = new Map<string, TipProvider>();
|
|
14
|
+
|
|
15
|
+
/** Registers one provider exactly once. */
|
|
16
|
+
public registerProvider(provider: TipProvider): Promise<void> {
|
|
17
|
+
if (!/^[a-z0-9][a-z0-9.-]*$/u.test(provider.id)) {
|
|
18
|
+
return Promise.reject(new Error(`Invalid tip provider ID: ${provider.id}`));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const existing = this.providers.get(provider.id);
|
|
22
|
+
if (existing !== undefined) {
|
|
23
|
+
if (existing === provider) {
|
|
24
|
+
return Promise.resolve();
|
|
25
|
+
}
|
|
26
|
+
return Promise.reject(new Error(`Tip provider ${provider.id} is already registered`));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
this.providers.set(provider.id, provider);
|
|
30
|
+
return Promise.resolve();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Returns whether no providers are registered. */
|
|
34
|
+
public get isEmpty(): boolean {
|
|
35
|
+
return this.providers.size === 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
Runs each provider independently. A failed provider cannot hide other tips.
|
|
40
|
+
*/
|
|
41
|
+
public async collectTips(context: TipContext): Promise<readonly TipContribution[]> {
|
|
42
|
+
const contributions: TipContribution[] = [];
|
|
43
|
+
|
|
44
|
+
for (const provider of this.providers.values()) {
|
|
45
|
+
if (context.signal?.aborted) break;
|
|
46
|
+
try {
|
|
47
|
+
const tip = await collectTip(provider, context);
|
|
48
|
+
if (tip !== undefined && isTip(tip)) {
|
|
49
|
+
contributions.push({ providerId: provider.id, tip });
|
|
50
|
+
}
|
|
51
|
+
} catch {
|
|
52
|
+
// Providers are optional. One failure must not hide other providers.
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return contributions;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function collectTip(provider: TipProvider, context: TipContext): Promise<Tip | undefined> {
|
|
61
|
+
const signal = context.signal;
|
|
62
|
+
if (signal === undefined) return provider.getTip(context);
|
|
63
|
+
if (signal.aborted) return undefined;
|
|
64
|
+
let abort = (): void => {};
|
|
65
|
+
const cancelled = new Promise<undefined>((resolve) => {
|
|
66
|
+
abort = () => resolve(undefined);
|
|
67
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
68
|
+
});
|
|
69
|
+
try {
|
|
70
|
+
// Release the old session even if an external provider ignores cancellation.
|
|
71
|
+
return await Promise.race([provider.getTip(context), cancelled]);
|
|
72
|
+
} finally {
|
|
73
|
+
signal.removeEventListener("abort", abort);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function isTip(value: Tip): boolean {
|
|
78
|
+
return (
|
|
79
|
+
typeof value.id === "string" &&
|
|
80
|
+
/^[a-z0-9][a-z0-9.-]*$/u.test(value.id) &&
|
|
81
|
+
typeof value.title === "string" &&
|
|
82
|
+
value.title.trim().length > 0 &&
|
|
83
|
+
typeof value.body === "string" &&
|
|
84
|
+
value.body.trim().length > 0
|
|
85
|
+
);
|
|
86
|
+
}
|