pi-agent-ide 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/README.md +11 -5
- package/dist/chunk-266RH77Z.js +1 -0
- package/dist/chunk-2SKAED2I.js +2 -0
- package/dist/chunk-2XYXV5HS.js +4 -0
- package/dist/chunk-2ZMYT6ZC.js +1 -0
- package/dist/chunk-34ZQTTU2.js +2 -0
- package/dist/chunk-3H2EU7VQ.js +0 -0
- package/dist/chunk-3YK4XMWB.js +0 -0
- package/dist/chunk-4SQQKEVD.js +16 -0
- package/dist/chunk-5BWUVAR4.js +1 -0
- package/dist/chunk-6DN7NO7L.js +1 -0
- package/dist/chunk-6SMFVLTY.js +1 -0
- package/dist/chunk-6XQQBKPE.js +58 -0
- package/dist/chunk-BYWAG6X3.js +6 -0
- package/dist/chunk-DEP55R35.js +1 -0
- package/dist/chunk-E2RESHYR.js +1 -0
- package/dist/chunk-EEH4WYI7.js +1 -0
- package/dist/chunk-EI7MMDWY.js +1 -0
- package/dist/chunk-ERVMDQGX.js +1 -0
- package/dist/chunk-EW2KVKCN.js +2 -0
- package/dist/chunk-F6SESI3P.js +4 -0
- package/dist/chunk-GTK5AREE.js +2 -0
- package/dist/chunk-HOBTFFQR.js +1 -0
- package/dist/chunk-IMVCVPMP.js +3 -0
- package/dist/chunk-IOCABSRL.js +1 -0
- package/dist/chunk-JASLOB2X.js +1 -0
- package/dist/chunk-JMVDFOTQ.js +1 -0
- package/dist/chunk-K4ZMRDEI.js +0 -0
- package/dist/chunk-KH5KPBCR.js +10 -0
- package/dist/chunk-KINKBPPX.js +1 -0
- package/dist/chunk-KNMWCDDK.js +7 -0
- package/dist/chunk-KYVOMBO5.js +1 -0
- package/dist/chunk-KZBAJFCV.js +1 -0
- package/dist/chunk-L4FA6OD4.js +1 -0
- package/dist/chunk-LFV6G5Z3.js +1 -0
- package/dist/chunk-LGN7EJYR.js +13 -0
- package/dist/chunk-MB6VVVAF.js +2 -0
- package/dist/chunk-MBUXFKIW.js +3 -0
- package/dist/chunk-MTQSGWZJ.js +1 -0
- package/dist/chunk-MTTKFJV6.js +1 -0
- package/dist/chunk-N34ATN52.js +1 -0
- package/dist/chunk-NI2NK4JU.js +1 -0
- package/dist/chunk-NNCZYO4Q.js +0 -0
- package/dist/chunk-NXHPO7ER.js +6 -0
- package/dist/chunk-OBWZ5RYN.js +1 -0
- package/dist/chunk-OFHVDY4Q.js +2 -0
- package/dist/chunk-OIL6BB2S.js +33 -0
- package/dist/chunk-ONWUJXUR.js +1 -0
- package/dist/chunk-ORAPGW7W.js +1 -0
- package/dist/chunk-OVUYPHDE.js +1 -0
- package/dist/chunk-PETQCA7G.js +1 -0
- package/dist/chunk-PODWLGNO.js +6 -0
- package/dist/chunk-QZANC2IG.js +1 -0
- package/dist/chunk-SJYDLHEF.js +108 -0
- package/dist/chunk-SMSIT3CE.js +3 -0
- package/dist/chunk-SSZB66C3.js +3 -0
- package/dist/chunk-STUZZM5B.js +1 -0
- package/dist/chunk-T2RPMEM2.js +1 -0
- package/dist/chunk-TG6H6EOI.js +1 -0
- package/dist/chunk-UTTW55S2.js +1 -0
- package/dist/chunk-VCCMVQXU.js +1 -0
- package/dist/chunk-VEJGSURY.js +8 -0
- package/dist/chunk-VFBLX4TG.js +1 -0
- package/dist/chunk-VSP2QQPQ.js +2 -0
- package/dist/chunk-W3XYKJ5H.js +1 -0
- package/dist/chunk-WZI4YC2O.js +1 -0
- package/dist/chunk-XGUAL3CA.js +1 -0
- package/dist/chunk-XNXQYPVT.js +10 -0
- package/dist/chunk-YHUTTZC6.js +2 -0
- package/dist/chunk-YPHXLAQF.js +1 -0
- package/dist/chunk-ZC65Z3CK.js +1 -0
- package/dist/chunk-ZIHEF6K3.js +3 -0
- package/dist/entry-0.js +1 -0
- package/dist/entry-1.js +1 -0
- package/dist/entry-10.js +1 -0
- package/dist/entry-11.js +1 -0
- package/dist/entry-12.js +1 -0
- package/dist/entry-13.js +1 -0
- package/dist/entry-14.js +1 -0
- package/dist/entry-16.js +1 -0
- package/dist/entry-17.js +1 -0
- package/dist/entry-18.js +1 -0
- package/dist/entry-19.js +1 -0
- package/dist/entry-2.js +1 -0
- package/dist/entry-20.js +1 -0
- package/dist/entry-21.js +1 -0
- package/dist/entry-22.js +1 -0
- package/dist/entry-23.js +1 -0
- package/dist/entry-24.js +1 -0
- package/dist/entry-25.js +1 -0
- package/dist/entry-26.js +1 -0
- package/dist/entry-27.js +1 -0
- package/dist/entry-28.js +1 -0
- package/dist/entry-29.js +1 -0
- package/dist/entry-3.js +1 -0
- package/dist/entry-30.js +1 -0
- package/dist/entry-31.js +1 -0
- package/dist/entry-32.js +1 -0
- package/dist/entry-33.js +1 -0
- package/dist/entry-34.js +1 -0
- package/dist/entry-35.js +1 -0
- package/dist/entry-36.js +1 -0
- package/dist/entry-37.js +1 -0
- package/dist/entry-38.js +1 -0
- package/dist/entry-39.js +1 -0
- package/dist/entry-4.js +1 -0
- package/dist/entry-40.js +1 -0
- package/dist/entry-41.js +1 -0
- package/dist/entry-42.js +1 -0
- package/dist/entry-43.js +1 -0
- package/dist/entry-44.js +1 -0
- package/dist/entry-45.js +1 -0
- package/dist/entry-46.js +1 -0
- package/dist/entry-47.js +1 -0
- package/dist/entry-48.js +1 -0
- package/dist/entry-49.js +1 -0
- package/dist/entry-5.js +1 -0
- package/dist/entry-50.js +1 -0
- package/dist/entry-51.js +1 -0
- package/dist/entry-52.js +1 -0
- package/dist/entry-53.js +1 -0
- package/dist/entry-54.js +0 -0
- package/dist/entry-55.js +1 -0
- package/dist/entry-56.js +0 -0
- package/dist/entry-57.js +1 -0
- package/dist/entry-58.js +1 -0
- package/dist/entry-59.js +1 -0
- package/dist/entry-6.js +1 -0
- package/dist/entry-60.js +1 -0
- package/dist/entry-61.js +1 -0
- package/dist/entry-62.js +1 -0
- package/dist/entry-63.js +0 -0
- package/dist/entry-64.js +1 -0
- package/dist/entry-65.js +0 -0
- package/dist/entry-66.js +1 -0
- package/dist/entry-67.js +1 -0
- package/dist/entry-68.js +1 -0
- package/dist/entry-69.js +1 -0
- package/dist/entry-7.js +1 -0
- package/dist/entry-70.js +1 -0
- package/dist/entry-71.js +1 -0
- package/dist/entry-72.js +1 -0
- package/dist/entry-73.js +1 -0
- package/dist/entry-74.js +1 -0
- package/dist/entry-75.js +1 -0
- package/dist/entry-76.js +1 -0
- package/dist/entry-77.js +1 -0
- package/dist/entry-78.js +1 -0
- package/dist/entry-79.js +1 -0
- package/dist/entry-8.js +1 -0
- package/dist/entry-80.js +1 -0
- package/dist/entry-9.js +1 -0
- package/dist/pi-agent-ide.js +13 -0
- package/docs/architecture.md +21 -17
- package/docs/configuration.md +180 -52
- package/docs/development.md +105 -5
- package/docs/extensions.md +64 -4
- package/docs/generated/tool-catalog/cmake.md +5 -5
- package/docs/generated/tool-catalog/csharp.md +5 -5
- package/docs/generated/tool-catalog/css.md +7 -6
- package/docs/generated/tool-catalog/dart.md +9 -0
- package/docs/generated/tool-catalog/dockerfile.md +5 -5
- package/docs/generated/tool-catalog/elixir.md +9 -0
- package/docs/generated/tool-catalog/html.md +7 -5
- package/docs/generated/tool-catalog/index.md +9 -0
- package/docs/generated/tool-catalog/javascript.md +8 -6
- package/docs/generated/tool-catalog/json.md +7 -6
- package/docs/generated/tool-catalog/julia.md +8 -0
- package/docs/generated/tool-catalog/kotlin.md +6 -5
- package/docs/generated/tool-catalog/markdown.md +6 -5
- package/docs/generated/tool-catalog/powershell.md +9 -0
- package/docs/generated/tool-catalog/python.md +6 -6
- package/docs/generated/tool-catalog/r.md +9 -0
- package/docs/generated/tool-catalog/scala.md +9 -0
- package/docs/generated/tool-catalog/svelte.md +9 -0
- package/docs/generated/tool-catalog/toml.md +6 -5
- package/docs/generated/tool-catalog/typescript.md +9 -6
- package/docs/generated/tool-catalog/vue.md +9 -0
- package/docs/generated/tool-catalog/yaml.md +6 -5
- package/docs/generated/tool-catalog/zig.md +9 -0
- package/docs/tools.md +88 -6
- package/node_modules/pi-agent-doctor/package.json +15 -5
- package/node_modules/pi-agent-doctor/runtime/entry-16.js +1 -0
- package/node_modules/pi-agent-doctor/runtime/entry-17.js +1 -0
- package/node_modules/pi-agent-doctor/runtime/entry-18.js +1 -0
- package/node_modules/pi-agent-doctor/runtime/entry-19.js +1 -0
- package/node_modules/pi-agent-doctor/runtime/entry-20.js +1 -0
- package/node_modules/pi-agent-doctor/src/catalog.ts +27 -1
- package/node_modules/pi-agent-doctor/src/evidence.ts +118 -0
- package/node_modules/pi-agent-doctor/src/executable.ts +85 -6
- package/node_modules/pi-agent-doctor/src/plugin-protocol.ts +30 -4
- package/node_modules/pi-agent-filesystem/index.ts +4 -3
- package/node_modules/pi-agent-filesystem/package.json +7 -7
- package/node_modules/pi-agent-filesystem/runtime/entry-21.js +2 -0
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- package/node_modules/pi-agent-filesystem-image/runtime/entry-22.js +2 -0
- package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
- package/node_modules/pi-agent-filesystem-pdf/runtime/entry-23.js +2 -0
- package/node_modules/pi-agent-filesystem-text/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/runtime/entry-24.js +2 -0
- package/node_modules/pi-agent-ide-ast/package.json +11 -10
- package/node_modules/pi-agent-ide-ast/runtime/entry-25.js +1 -0
- package/node_modules/pi-agent-ide-ast/runtime/entry-26.js +2 -0
- package/node_modules/pi-agent-ide-ast/src/api/scope.ts +1 -1
- package/node_modules/pi-agent-ide-ast/src/ast/manager.ts +3 -0
- package/node_modules/pi-agent-ide-ast/src/ast/outline.ts +4 -1
- package/node_modules/pi-agent-ide-ast/src/doctor-plugin.ts +25 -0
- package/node_modules/pi-agent-ide-ast/src/extension.ts +13 -5
- package/node_modules/pi-agent-ide-ast/src/scope-resolver.ts +6 -0
- package/node_modules/pi-agent-ide-changes/index.ts +6 -2
- package/node_modules/pi-agent-ide-changes/package.json +8 -7
- package/node_modules/pi-agent-ide-changes/runtime/entry-27.js +1 -0
- package/node_modules/pi-agent-ide-changes/runtime/entry-28.js +2 -0
- package/node_modules/pi-agent-ide-changes/src/change-anchor.ts +6 -0
- package/node_modules/pi-agent-ide-changes/src/changes/change-groups.ts +1 -1
- package/node_modules/pi-agent-ide-changes/src/changes/change-service.ts +1 -1
- package/node_modules/pi-agent-ide-changes/src/changes/git-changes-backend.ts +1 -0
- package/node_modules/pi-agent-ide-changes/src/current-change-presenter.ts +1 -1
- package/node_modules/pi-agent-ide-changes/src/doctor-plugin.ts +31 -1
- package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +5 -0
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +7 -0
- package/node_modules/pi-agent-ide-formatter/package.json +4 -4
- package/node_modules/pi-agent-ide-formatter/runtime/entry-29.js +2 -0
- package/node_modules/pi-agent-ide-formatter/src/catalog.ts +165 -13
- package/node_modules/pi-agent-ide-formatter/src/doctor-plugin.ts +115 -63
- package/node_modules/pi-agent-ide-formatter/src/registry.ts +86 -31
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-languages/runtime/entry-30.js +2 -0
- package/node_modules/pi-agent-ide-languages/src/languages.ts +15 -0
- package/node_modules/pi-agent-ide-lint/index.ts +30 -155
- package/node_modules/pi-agent-ide-lint/package.json +8 -7
- package/node_modules/pi-agent-ide-lint/runtime/entry-31.js +2 -0
- package/node_modules/pi-agent-ide-lint/src/catalog.ts +210 -41
- package/node_modules/pi-agent-ide-lint/src/command-linter.ts +80 -4
- package/node_modules/pi-agent-ide-lint/src/diagnostics.ts +76 -34
- package/node_modules/pi-agent-ide-lint/src/doctor-plugin.ts +115 -64
- package/node_modules/pi-agent-ide-lint/src/registry.ts +87 -30
- package/node_modules/pi-agent-ide-lsp/index.ts +35 -134
- package/node_modules/pi-agent-ide-lsp/package.json +9 -8
- package/node_modules/pi-agent-ide-lsp/runtime/entry-32.js +2 -0
- package/node_modules/pi-agent-ide-lsp/src/catalog.ts +161 -7
- package/node_modules/pi-agent-ide-lsp/src/code-view-resolvers.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/src/diagnostic-source.ts +110 -0
- package/node_modules/pi-agent-ide-lsp/src/doctor-plugin.ts +108 -55
- package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +248 -38
- package/node_modules/pi-agent-ide-lsp/src/lsp/code-views.ts +2 -1
- package/node_modules/pi-agent-ide-lsp/src/lsp/diagnostic-adapters.ts +76 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/diagnostics.ts +137 -144
- package/node_modules/pi-agent-ide-lsp/src/lsp/file-watchers.ts +88 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/initialization-options.ts +14 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/lsp-compiler.ts +2 -2
- package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +17 -36
- package/node_modules/pi-agent-ide-lsp/src/lsp/registry.ts +139 -68
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +1 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/transport-writer.ts +24 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/types.ts +13 -6
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +5 -5
- package/node_modules/pi-agent-image/package.json +3 -3
- package/node_modules/pi-agent-image/runtime/entry-33.js +1 -0
- package/node_modules/pi-agent-invariant/package.json +12 -0
- package/node_modules/pi-agent-invariant/runtime/entry-34.js +1 -0
- package/node_modules/pi-agent-pdf/package.json +3 -3
- package/node_modules/pi-agent-pdf/runtime/entry-35.js +1 -0
- package/node_modules/pi-agent-pdf/src/pdf-converter.ts +3 -2
- package/node_modules/pi-agent-read/package.json +11 -9
- package/node_modules/pi-agent-read/runtime/entry-36.js +1 -0
- package/node_modules/pi-agent-read/runtime/entry-37.js +1 -0
- package/node_modules/pi-agent-read/runtime/entry-38.js +1 -0
- package/node_modules/pi-agent-read/runtime/entry-39.js +1 -0
- package/node_modules/pi-agent-read/runtime/entry-40.js +2 -0
- package/node_modules/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/node_modules/pi-agent-read/src/api/tools/read.ts +113 -2
- package/node_modules/pi-agent-read/src/core/extension.ts +19 -0
- package/node_modules/pi-agent-read/src/core/read-core.ts +85 -13
- package/node_modules/pi-agent-read/src/core/tools/read/output-truncation.ts +26 -10
- package/node_modules/pi-agent-read/src/core/tools/read/persisted-result.ts +72 -0
- package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +102 -12
- package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +27 -3
- package/node_modules/pi-agent-read/src/core/tools/read/views.ts +29 -0
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +532 -46
- package/node_modules/pi-agent-resource/package.json +5 -2
- package/node_modules/pi-agent-resource/runtime/entry-41.js +1 -0
- package/node_modules/pi-agent-resource/src/content-conversion/content-converter.ts +1 -1
- package/node_modules/pi-agent-resource/src/content-conversion/content-host.ts +1 -1
- package/node_modules/pi-agent-resource/src/content-conversion/content-runner.ts +1 -1
- package/node_modules/pi-agent-resource/src/content-conversion/validation.ts +1 -1
- package/node_modules/pi-agent-search/package.json +7 -6
- package/node_modules/pi-agent-search/runtime/entry-42.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-43.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-44.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-45.js +2 -0
- package/node_modules/pi-agent-search/src/api/search.ts +4 -0
- package/node_modules/pi-agent-search/src/core/extension.ts +99 -27
- package/node_modules/pi-agent-search/src/core/search-config.ts +98 -0
- package/node_modules/pi-agent-search/src/core/search-core.ts +32 -28
- package/node_modules/pi-agent-search/src/core/search-timeout.ts +54 -0
- package/node_modules/pi-agent-search-text/index.ts +53 -3
- package/node_modules/pi-agent-search-text/package.json +9 -9
- package/node_modules/pi-agent-search-text/runtime/entry-46.js +2 -0
- package/node_modules/pi-agent-search-text/runtime/entry-47.js +1 -0
- package/node_modules/pi-agent-search-text/src/doctor-plugin.ts +20 -1
- package/node_modules/pi-agent-search-text/src/persisted-result.ts +56 -0
- package/node_modules/pi-agent-search-text/src/resolvers.ts +36 -34
- package/node_modules/pi-agent-search-text/src/search-query.ts +254 -71
- package/node_modules/pi-agent-search-text/src/search-recipe.ts +68 -0
- package/node_modules/pi-agent-search-text/src/search-renderer.ts +71 -117
- package/node_modules/pi-agent-search-text/src/search-result.ts +1 -0
- package/node_modules/pi-agent-search-text/src/search-session.ts +276 -110
- package/node_modules/pi-agent-text/package.json +6 -3
- package/node_modules/pi-agent-text/runtime/entry-48.js +1 -0
- package/node_modules/pi-agent-text/src/index.ts +23 -0
- package/node_modules/pi-agent-text/src/stored-text.ts +14 -0
- package/node_modules/pi-agent-text/src/text-anchor.ts +160 -16
- package/node_modules/pi-agent-text/src/text-document.ts +26 -5
- package/node_modules/pi-agent-text/src/text-target.ts +105 -0
- package/node_modules/pi-agent-text-anchor-constant/package.json +7 -4
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-49.js +2 -0
- package/node_modules/pi-agent-text-anchor-constant/src/resolver.ts +6 -0
- package/node_modules/pi-agent-text-anchor-exact/index.ts +34 -0
- package/node_modules/pi-agent-text-anchor-exact/package.json +27 -0
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-50.js +1 -0
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-51.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/src/anchor.ts +230 -0
- package/node_modules/pi-agent-text-anchor-exact/src/config.ts +159 -0
- package/node_modules/pi-agent-text-anchor-exact/src/fuzzy-worker.ts +100 -0
- package/node_modules/pi-agent-text-anchor-exact/src/recovery.ts +151 -0
- package/node_modules/pi-agent-text-anchor-line-hash/index.ts +8 -2
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +10 -6
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-52.js +1 -0
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-53.js +2 -0
- package/node_modules/pi-agent-text-anchor-line-hash/src/anchor.ts +32 -1
- package/node_modules/pi-agent-text-anchor-line-hash/src/read-handler.ts +20 -12
- package/node_modules/pi-agent-text-editor/package.json +22 -21
- package/node_modules/pi-agent-text-editor/runtime/entry-54.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-55.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-56.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-57.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-58.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-59.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-60.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-61.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-62.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-63.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-64.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-65.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-66.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-67.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-68.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-69.js +2 -0
- package/node_modules/pi-agent-text-editor/src/api/anchor-inspection.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +1 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +38 -0
- package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +30 -15
- package/node_modules/pi-agent-text-editor/src/api/text-selection-anchor.ts +10 -13
- package/node_modules/pi-agent-text-editor/src/api/tool-call-interceptor.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/builtin-edit-filter.ts +12 -5
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +15 -1
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/agent-diff.ts +14 -10
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/diff.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +3 -2
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +19 -2
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +64 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/inline-hints.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/read-fragment-resolver.ts +83 -0
- package/node_modules/pi-agent-text-editor/src/core/text-anchor-registry.ts +96 -8
- package/node_modules/pi-agent-text-editor/src/core/text-change-engine.ts +4 -1
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +194 -35
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +43 -13
- package/node_modules/pi-agent-text-editor/src/core/text-editor-config.ts +95 -0
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +75 -5
- package/node_modules/pi-agent-text-editor/src/core/text-mutation-anchor-error.ts +7 -0
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +541 -130
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +5 -9
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/rendering.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/tools/text-selection.ts +228 -6
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +50 -70
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +25 -26
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +30 -21
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +57 -71
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +30 -27
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +2 -0
- package/node_modules/pi-agent-text-editor-argument-order/package.json +3 -3
- package/node_modules/pi-agent-text-editor-argument-order/runtime/entry-70.js +2 -0
- package/node_modules/pi-agent-text-editor-overwrite/index.ts +1 -1
- package/node_modules/pi-agent-text-editor-overwrite/package.json +4 -3
- package/node_modules/pi-agent-text-editor-overwrite/runtime/entry-71.js +2 -0
- package/node_modules/pi-agent-text-editor-renderer/index.ts +21 -1
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -3
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-72.js +2 -0
- package/node_modules/pi-agent-text-editor-renderer/src/animation-pressure.ts +50 -0
- package/node_modules/pi-agent-text-editor-renderer/src/config.ts +73 -0
- package/node_modules/pi-agent-text-editor-renderer/src/diff-model.ts +1 -1
- package/node_modules/pi-agent-text-editor-renderer/src/diff-renderer.ts +77 -22
- package/node_modules/pi-agent-text-editor-renderer/src/diff-theme.ts +1 -1
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +140 -24
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-projection.ts +274 -43
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-result.ts +33 -6
- package/node_modules/pi-agent-text-editor-renderer/src/persisted-result.ts +47 -0
- package/node_modules/pi-agent-text-editor-renderer/src/render-resource.ts +7 -0
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +265 -105
- package/node_modules/pi-agent-text-editor-renderer/src/typing-interpolation.ts +96 -15
- package/node_modules/pi-agent-text-editor-stale-anchor/index.ts +22 -6
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -4
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +2 -0
- package/node_modules/pi-agent-tool-call-interception/package.json +5 -2
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-74.js +1 -0
- package/node_modules/pi-agent-tool-call-interception/src/index.ts +175 -32
- package/node_modules/pi-agent-tool-ui/package.json +15 -0
- package/node_modules/pi-agent-tool-ui/runtime/entry-75.js +1 -0
- package/node_modules/pi-agent-tool-ui/src/index.ts +318 -0
- package/node_modules/pi-agent-web/index.ts +16 -6
- package/node_modules/pi-agent-web/package.json +8 -6
- package/node_modules/pi-agent-web/runtime/entry-76.js +2 -0
- package/node_modules/pi-agent-web/src/browser-loader.ts +180 -0
- package/node_modules/pi-agent-web/src/doctor-plugin.ts +41 -0
- package/node_modules/pi-agent-web/src/resolver.ts +128 -24
- package/node_modules/pi-agent-web-html/package.json +6 -3
- package/node_modules/pi-agent-web-html/runtime/entry-77.js +2 -0
- package/node_modules/pi-agent-web-html/src/extract-readable-html.ts +19 -6
- package/node_modules/pi-agent-web-image/package.json +4 -4
- package/node_modules/pi-agent-web-image/runtime/entry-78.js +2 -0
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/runtime/entry-79.js +2 -0
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-80.js +2 -0
- package/package.json +68 -54
- package/src/api/code-view.ts +4 -0
- package/src/api/connect-tip-provider.ts +49 -0
- package/src/api/plugin-protocol.ts +41 -2
- package/src/api/tips.ts +77 -0
- package/src/api/tool-config/formatters.json +273 -0
- package/src/api/tool-config/linters.json +339 -0
- package/src/api/tool-config/lsp-servers.json +410 -0
- package/src/api/tool-config.ts +248 -12
- package/src/api/toolchain.ts +0 -5
- package/src/code-view/diagnostic-view.ts +121 -26
- package/src/code-view/source-view.ts +1 -1
- package/src/composite/builtin-extensions.ts +12 -6
- package/src/composite/extensions-config.ts +137 -0
- package/src/composite/selection.ts +58 -3
- package/src/core/diagnostic-store.ts +244 -0
- package/src/core/extension.ts +40 -0
- package/src/core/ide-core.ts +48 -3
- package/src/doctor/config-writer.ts +15 -2
- package/src/doctor/core.ts +47 -0
- package/src/doctor/discovery.ts +23 -70
- package/src/doctor/extension.ts +12 -1
- package/src/doctor/inventory.ts +24 -6
- package/src/doctor/run.ts +100 -87
- package/src/doctor/tip-provider.ts +92 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +4 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-22.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-23.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-24.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-21.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +16 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +6 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-77.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/src/extract-readable-html.ts +19 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-78.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-79.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-80.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-76.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/browser-loader.ts +180 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/doctor-plugin.ts +41 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/resolver.ts +128 -24
- package/src/extensions/pi-agent-read/package.json +11 -9
- package/src/extensions/pi-agent-read/runtime/entry-36.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-37.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-38.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-39.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-40.js +2 -0
- package/src/extensions/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +113 -2
- package/src/extensions/pi-agent-read/src/core/extension.ts +19 -0
- package/src/extensions/pi-agent-read/src/core/read-core.ts +85 -13
- package/src/extensions/pi-agent-read/src/core/tools/read/output-truncation.ts +26 -10
- package/src/extensions/pi-agent-read/src/core/tools/read/persisted-result.ts +72 -0
- package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +102 -12
- package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +27 -3
- package/src/extensions/pi-agent-read/src/core/tools/read/views.ts +29 -0
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +532 -46
- package/src/extensions/pi-agent-search/package.json +7 -6
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +53 -3
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +9 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-46.js +2 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-47.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/doctor-plugin.ts +20 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/persisted-result.ts +56 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +36 -34
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-query.ts +254 -71
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +68 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +71 -117
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +276 -110
- package/src/extensions/pi-agent-search/runtime/entry-42.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-43.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-44.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-45.js +2 -0
- package/src/extensions/pi-agent-search/src/api/search.ts +4 -0
- package/src/extensions/pi-agent-search/src/core/extension.ts +99 -27
- package/src/extensions/pi-agent-search/src/core/search-config.ts +98 -0
- package/src/extensions/pi-agent-search/src/core/search-core.ts +32 -28
- package/src/extensions/pi-agent-search/src/core/search-timeout.ts +54 -0
- package/src/extensions/pi-agent-text-editor/package.json +22 -21
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +7 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-49.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/src/resolver.ts +6 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.ts +34 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +27 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-50.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-51.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/anchor.ts +230 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/config.ts +159 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/fuzzy-worker.ts +100 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/recovery.ts +151 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +8 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +10 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-52.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-53.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/anchor.ts +32 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/read-handler.ts +20 -12
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/package.json +3 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/runtime/entry-70.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/index.ts +1 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/package.json +4 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/runtime/entry-71.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +21 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-72.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/animation-pressure.ts +50 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/config.ts +73 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-model.ts +1 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-renderer.ts +77 -22
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-theme.ts +1 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +140 -24
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-projection.ts +274 -43
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-result.ts +33 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/persisted-result.ts +47 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/render-resource.ts +7 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +265 -105
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/typing-interpolation.ts +96 -15
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/index.ts +22 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +2 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-54.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-55.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-56.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-57.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-58.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-59.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-60.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-61.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-62.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-63.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-64.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-65.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-66.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-67.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-68.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-69.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/anchor-inspection.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +1 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +38 -0
- package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +30 -15
- package/src/extensions/pi-agent-text-editor/src/api/text-selection-anchor.ts +10 -13
- package/src/extensions/pi-agent-text-editor/src/api/tool-call-interceptor.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/builtin-edit-filter.ts +12 -5
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +15 -1
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/agent-diff.ts +14 -10
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/diff.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +3 -2
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +19 -2
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +64 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/inline-hints.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/read-fragment-resolver.ts +83 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-anchor-registry.ts +96 -8
- package/src/extensions/pi-agent-text-editor/src/core/text-change-engine.ts +4 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +194 -35
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +43 -13
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-config.ts +95 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +75 -5
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation-anchor-error.ts +7 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +541 -130
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +5 -9
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/rendering.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/tools/text-selection.ts +228 -6
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +50 -70
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +25 -26
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +30 -21
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +57 -71
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +30 -27
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +2 -0
- package/src/pi-agent-ide.ts +15 -3
- package/src/plugins/pi-agent-ide-ast/package.json +11 -10
- package/src/plugins/pi-agent-ide-ast/runtime/entry-25.js +1 -0
- package/src/plugins/pi-agent-ide-ast/runtime/entry-26.js +2 -0
- package/src/plugins/pi-agent-ide-ast/src/api/scope.ts +1 -1
- package/src/plugins/pi-agent-ide-ast/src/ast/manager.ts +3 -0
- package/src/plugins/pi-agent-ide-ast/src/ast/outline.ts +4 -1
- package/src/plugins/pi-agent-ide-ast/src/doctor-plugin.ts +25 -0
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +13 -5
- package/src/plugins/pi-agent-ide-ast/src/scope-resolver.ts +6 -0
- package/src/plugins/pi-agent-ide-changes/index.ts +6 -2
- package/src/plugins/pi-agent-ide-changes/package.json +8 -7
- package/src/plugins/pi-agent-ide-changes/runtime/entry-27.js +1 -0
- package/src/plugins/pi-agent-ide-changes/runtime/entry-28.js +2 -0
- package/src/plugins/pi-agent-ide-changes/src/change-anchor.ts +6 -0
- package/src/plugins/pi-agent-ide-changes/src/changes/change-groups.ts +1 -1
- package/src/plugins/pi-agent-ide-changes/src/changes/change-service.ts +1 -1
- package/src/plugins/pi-agent-ide-changes/src/changes/git-changes-backend.ts +1 -0
- package/src/plugins/pi-agent-ide-changes/src/current-change-presenter.ts +1 -1
- package/src/plugins/pi-agent-ide-changes/src/doctor-plugin.ts +31 -1
- package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +5 -0
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +7 -0
- package/src/plugins/pi-agent-ide-diagnostics/index.ts +1 -0
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +199 -0
- package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
- package/src/plugins/pi-agent-ide-formatter/runtime/entry-29.js +2 -0
- package/src/plugins/pi-agent-ide-formatter/src/catalog.ts +165 -13
- package/src/plugins/pi-agent-ide-formatter/src/doctor-plugin.ts +115 -63
- package/src/plugins/pi-agent-ide-formatter/src/registry.ts +86 -31
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-languages/runtime/entry-30.js +2 -0
- package/src/plugins/pi-agent-ide-languages/src/languages.ts +15 -0
- package/src/plugins/pi-agent-ide-lint/index.ts +30 -155
- package/src/plugins/pi-agent-ide-lint/package.json +8 -7
- package/src/plugins/pi-agent-ide-lint/runtime/entry-31.js +2 -0
- package/src/plugins/pi-agent-ide-lint/src/catalog.ts +210 -41
- package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +80 -4
- package/src/plugins/pi-agent-ide-lint/src/diagnostics.ts +76 -34
- package/src/plugins/pi-agent-ide-lint/src/doctor-plugin.ts +115 -64
- package/src/plugins/pi-agent-ide-lint/src/registry.ts +87 -30
- package/src/plugins/pi-agent-ide-lsp/index.ts +35 -134
- package/src/plugins/pi-agent-ide-lsp/package.json +9 -8
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-32.js +2 -0
- package/src/plugins/pi-agent-ide-lsp/src/catalog.ts +161 -7
- package/src/plugins/pi-agent-ide-lsp/src/code-view-resolvers.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/src/diagnostic-source.ts +110 -0
- package/src/plugins/pi-agent-ide-lsp/src/doctor-plugin.ts +108 -55
- package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +248 -38
- package/src/plugins/pi-agent-ide-lsp/src/lsp/code-views.ts +2 -1
- package/src/plugins/pi-agent-ide-lsp/src/lsp/diagnostic-adapters.ts +76 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/diagnostics.ts +137 -144
- package/src/plugins/pi-agent-ide-lsp/src/lsp/file-watchers.ts +88 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/initialization-options.ts +14 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/lsp-compiler.ts +2 -2
- package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +17 -36
- package/src/plugins/pi-agent-ide-lsp/src/lsp/registry.ts +139 -68
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +1 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/transport-writer.ts +24 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/types.ts +13 -6
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +5 -5
- package/src/post-edit/gate.ts +17 -141
- package/src/tips/core.ts +86 -0
- package/src/tips/extension.ts +115 -0
- package/src/tips/persistence.ts +225 -0
- package/src/tips/tip-callout.ts +77 -0
- package/src/toolchain/registry.ts +8 -23
- package/src/toolchain/types.ts +8 -74
- package/node_modules/pi-agent-search-semantic/index.ts +0 -97
- package/node_modules/pi-agent-search-semantic/package.json +0 -17
- package/node_modules/pi-agent-search-text/src/lucene-query-parser.d.ts +0 -20
- package/node_modules/pi-agent-search-web/index.ts +0 -82
- package/node_modules/pi-agent-search-web/package.json +0 -20
- package/node_modules/pi-agent-search-web/src/config.ts +0 -560
- package/node_modules/pi-agent-search-web/src/doctor-plugin.ts +0 -40
- package/node_modules/pi-agent-search-web/src/providers/duckduckgo-html.ts +0 -74
- package/node_modules/pi-agent-search-web/src/providers/endpoints.ts +0 -81
- package/node_modules/pi-agent-search-web/src/providers/request.ts +0 -427
- package/node_modules/pi-agent-search-web/src/providers/response.ts +0 -353
- package/node_modules/pi-agent-search-web/src/search-format.ts +0 -24
- package/node_modules/pi-agent-search-web/src/search.ts +0 -376
- package/node_modules/pi-agent-search-web/src/types.ts +0 -141
- package/src/composite/config.ts +0 -100
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-semantic/index.ts +0 -97
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-semantic/package.json +0 -17
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/lucene-query-parser.d.ts +0 -20
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/index.ts +0 -82
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/package.json +0 -20
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/config.ts +0 -560
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/doctor-plugin.ts +0 -40
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/duckduckgo-html.ts +0 -74
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/endpoints.ts +0 -81
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/request.ts +0 -427
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/response.ts +0 -353
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/search-format.ts +0 -24
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/search.ts +0 -376
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/types.ts +0 -141
- package/src/toolchain/gate.ts +0 -305
- /package/{src/utils/required-value.ts → node_modules/pi-agent-invariant/src/index.ts} +0 -0
package/src/api/tool-config.ts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import spawn from "cross-spawn";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
isExecutableAvailable,
|
|
5
|
+
normalizeProcessEnvironment,
|
|
6
|
+
projectProcessEnvironment,
|
|
7
|
+
} from "pi-agent-doctor/api/executable";
|
|
8
|
+
import { requiredValue } from "pi-agent-invariant";
|
|
3
9
|
import { readFile, writeFile } from "node:fs/promises";
|
|
10
|
+
import os from "node:os";
|
|
4
11
|
import path from "node:path";
|
|
12
|
+
import { fileURLToPath } from "node:url";
|
|
5
13
|
|
|
6
14
|
/**
|
|
7
15
|
Current on-disk tool configuration version.
|
|
@@ -24,6 +32,9 @@ File selection shared by formatter and linter commands.
|
|
|
24
32
|
*/
|
|
25
33
|
export interface FileMatcherConfig {
|
|
26
34
|
readonly extensions: readonly string[];
|
|
35
|
+
|
|
36
|
+
/** Exact basenames accepted in addition to extensions, such as CMakeLists.txt. */
|
|
37
|
+
readonly fileNames?: readonly string[];
|
|
27
38
|
readonly include?: readonly string[];
|
|
28
39
|
readonly exclude?: readonly string[];
|
|
29
40
|
}
|
|
@@ -59,6 +70,9 @@ Describes how a linter's output becomes Pi Agent IDE diagnostics.
|
|
|
59
70
|
export interface DiagnosticParserConfig {
|
|
60
71
|
readonly format: DiagnosticFormat;
|
|
61
72
|
readonly pattern?: string;
|
|
73
|
+
|
|
74
|
+
/** Column numbering used by a regex reporter; IDE diagnostics are always one-based. */
|
|
75
|
+
readonly columnBase?: 0 | 1;
|
|
62
76
|
}
|
|
63
77
|
|
|
64
78
|
/**
|
|
@@ -88,6 +102,51 @@ export interface ProcessResult {
|
|
|
88
102
|
readonly stderr: string;
|
|
89
103
|
}
|
|
90
104
|
|
|
105
|
+
/**
|
|
106
|
+
Configuration files supported by the layered tool loader.
|
|
107
|
+
*/
|
|
108
|
+
export type ToolConfigName = "formatters" | "linters" | "lsp-servers";
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
The origin of one effective formatter, linter, or LSP entry.
|
|
112
|
+
*/
|
|
113
|
+
export type ToolConfigLayer = "project" | "global" | "built-in";
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
Physical files consulted for one tool configuration category.
|
|
117
|
+
*/
|
|
118
|
+
export interface ToolConfigPaths {
|
|
119
|
+
readonly project: string;
|
|
120
|
+
readonly global: string;
|
|
121
|
+
readonly builtIn: string;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
One validated entry in the effective layered configuration.
|
|
126
|
+
*/
|
|
127
|
+
export interface EffectiveToolConfigEntry<T> {
|
|
128
|
+
readonly id: string;
|
|
129
|
+
readonly config: T;
|
|
130
|
+
readonly layer: ToolConfigLayer;
|
|
131
|
+
readonly sourcePath: string;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
Validated entries in runtime resolution order, with their source files.
|
|
136
|
+
*/
|
|
137
|
+
export interface EffectiveToolConfig<T> {
|
|
138
|
+
readonly entries: readonly EffectiveToolConfigEntry<T>[];
|
|
139
|
+
readonly paths: ToolConfigPaths;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
Optional environment inputs used to resolve global tool configuration.
|
|
144
|
+
*/
|
|
145
|
+
export interface LayeredToolConfigOptions {
|
|
146
|
+
readonly environment?: NodeJS.ProcessEnv;
|
|
147
|
+
readonly homeDirectory?: string;
|
|
148
|
+
}
|
|
149
|
+
|
|
91
150
|
/**
|
|
92
151
|
Resolves the project-local Pi Agent IDE configuration directory.
|
|
93
152
|
*/
|
|
@@ -98,13 +157,65 @@ export function projectIdeConfigDirectory(projectRoot: string): string {
|
|
|
98
157
|
/**
|
|
99
158
|
Resolves a named project-local Pi Agent IDE JSON file.
|
|
100
159
|
*/
|
|
101
|
-
export function projectIdeConfigPath(
|
|
102
|
-
projectRoot: string,
|
|
103
|
-
name: "formatters" | "linters" | "lsp-servers",
|
|
104
|
-
): string {
|
|
160
|
+
export function projectIdeConfigPath(projectRoot: string, name: ToolConfigName): string {
|
|
105
161
|
return path.join(projectIdeConfigDirectory(projectRoot), `${name}.json`);
|
|
106
162
|
}
|
|
107
163
|
|
|
164
|
+
/**
|
|
165
|
+
Resolves project, global, and package-built-in files for one tool category.
|
|
166
|
+
*/
|
|
167
|
+
export function resolveToolConfigPaths(
|
|
168
|
+
projectRoot: string,
|
|
169
|
+
name: ToolConfigName,
|
|
170
|
+
options: LayeredToolConfigOptions = {},
|
|
171
|
+
): ToolConfigPaths {
|
|
172
|
+
const environment = options.environment ?? process.env;
|
|
173
|
+
const configuredAgentDirectory = environment.PI_CODING_AGENT_DIR?.trim();
|
|
174
|
+
const agentDirectory =
|
|
175
|
+
configuredAgentDirectory === undefined || configuredAgentDirectory.length === 0
|
|
176
|
+
? path.join(options.homeDirectory ?? os.homedir(), ".pi", "agent")
|
|
177
|
+
: path.resolve(configuredAgentDirectory);
|
|
178
|
+
return {
|
|
179
|
+
project: projectIdeConfigPath(projectRoot, name),
|
|
180
|
+
global: path.join(agentDirectory, "extensions", "pi-agent-ide", `${name}.json`),
|
|
181
|
+
builtIn: fileURLToPath(new URL(`tool-config/${name}.json`, import.meta.url)),
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
Loads and validates all present layers, replaces lower entries by ID, and preserves layer priority.
|
|
187
|
+
*/
|
|
188
|
+
export async function loadLayeredToolConfig<T>(
|
|
189
|
+
projectRoot: string,
|
|
190
|
+
name: ToolConfigName,
|
|
191
|
+
parseEntries: (value: unknown) => Readonly<Record<string, T>>,
|
|
192
|
+
options: LayeredToolConfigOptions = {},
|
|
193
|
+
): Promise<EffectiveToolConfig<T>> {
|
|
194
|
+
const paths = resolveToolConfigPaths(projectRoot, name, options);
|
|
195
|
+
const layers = [
|
|
196
|
+
{ layer: "project", sourcePath: paths.project, optional: true },
|
|
197
|
+
{ layer: "global", sourcePath: paths.global, optional: true },
|
|
198
|
+
{ layer: "built-in", sourcePath: paths.builtIn, optional: false },
|
|
199
|
+
] as const;
|
|
200
|
+
const entries: EffectiveToolConfigEntry<T>[] = [];
|
|
201
|
+
const claimedIds = new Set<string>();
|
|
202
|
+
|
|
203
|
+
for (const source of layers) {
|
|
204
|
+
const parsed = await readToolConfigLayer(source, name, parseEntries);
|
|
205
|
+
|
|
206
|
+
for (const [id, config] of Object.entries(parsed)) {
|
|
207
|
+
if (claimedIds.has(id)) {
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
claimedIds.add(id);
|
|
212
|
+
entries.push({ id, config, layer: source.layer, sourcePath: source.sourcePath });
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return { entries, paths };
|
|
217
|
+
}
|
|
218
|
+
|
|
108
219
|
/**
|
|
109
220
|
Returns whether a configured matcher accepts a project file.
|
|
110
221
|
*/
|
|
@@ -118,6 +229,11 @@ export function matchesConfiguredFile(
|
|
|
118
229
|
if (
|
|
119
230
|
config.extensions.every(
|
|
120
231
|
(candidate) => !(normalizeExtension(candidate) === extension || candidate === "*"),
|
|
232
|
+
) &&
|
|
233
|
+
!config.fileNames?.some((name) =>
|
|
234
|
+
process.platform === "win32"
|
|
235
|
+
? name.toLowerCase() === path.basename(filePath).toLowerCase()
|
|
236
|
+
: name === path.basename(filePath),
|
|
121
237
|
)
|
|
122
238
|
) {
|
|
123
239
|
return false;
|
|
@@ -131,14 +247,55 @@ export function matchesConfiguredFile(
|
|
|
131
247
|
}
|
|
132
248
|
|
|
133
249
|
/**
|
|
134
|
-
|
|
250
|
+
Selects an explicit override first, then an available built-in with the strongest native evidence.
|
|
251
|
+
A missing native choice never falls back to an unrelated installed tool.
|
|
252
|
+
*/
|
|
253
|
+
export function selectConfiguredEntry<T extends FileMatcherConfig>(
|
|
254
|
+
entries: readonly EffectiveToolConfigEntry<T>[],
|
|
255
|
+
availableBuiltIns: ReadonlySet<string>,
|
|
256
|
+
evidence: ReadonlyMap<string, { readonly score: number }>,
|
|
257
|
+
filePath: string,
|
|
258
|
+
projectRoot: string,
|
|
259
|
+
): EffectiveToolConfigEntry<T> | undefined {
|
|
260
|
+
const absolute = path.resolve(projectRoot, filePath);
|
|
261
|
+
const matching = entries.filter((entry) =>
|
|
262
|
+
matchesConfiguredFile(entry.config, absolute, projectRoot),
|
|
263
|
+
);
|
|
264
|
+
const override = matching.find((entry) => entry.layer !== "built-in");
|
|
265
|
+
if (override !== undefined) return override;
|
|
266
|
+
const score = Math.max(0, ...matching.map((entry) => evidence.get(entry.id)?.score ?? 0));
|
|
267
|
+
return matching.find(
|
|
268
|
+
(entry) => availableBuiltIns.has(entry.id) && (evidence.get(entry.id)?.score ?? 0) === score,
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
Returns whether a configured process executable can be launched from the project.
|
|
135
274
|
*/
|
|
275
|
+
export async function hasConfiguredExecutable(
|
|
276
|
+
config: ProcessConfig,
|
|
277
|
+
projectRoot: string,
|
|
278
|
+
environment: NodeJS.ProcessEnv = process.env,
|
|
279
|
+
): Promise<boolean> {
|
|
280
|
+
assertProcessConfig(config, "process");
|
|
281
|
+
const executable = requiredValue(config.command[0]).replaceAll("{project}", projectRoot);
|
|
282
|
+
const effectiveEnvironment = createConfiguredProcessEnvironment(config, projectRoot, environment);
|
|
283
|
+
return isExecutableAvailable(executable, projectRoot, effectiveEnvironment);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
Runs a configured process after expanding placeholders.
|
|
288
|
+
Project-local package binaries take priority over the configured process path.
|
|
289
|
+
An optional abort signal terminates the child process.
|
|
290
|
+
*/
|
|
291
|
+
|
|
136
292
|
export async function runConfiguredProcess(
|
|
137
293
|
config: ProcessConfig,
|
|
138
294
|
context: {
|
|
139
295
|
readonly projectRoot: string;
|
|
140
296
|
readonly filePath: string;
|
|
141
297
|
readonly env?: NodeJS.ProcessEnv;
|
|
298
|
+
readonly signal?: AbortSignal;
|
|
142
299
|
},
|
|
143
300
|
): Promise<ProcessResult> {
|
|
144
301
|
assertProcessConfig(config, "process");
|
|
@@ -147,26 +304,35 @@ export async function runConfiguredProcess(
|
|
|
147
304
|
const arguments_ = command.slice(1);
|
|
148
305
|
const cwd = config.cwd === "file" ? path.dirname(context.filePath) : context.projectRoot;
|
|
149
306
|
const accepted = config.successExitCodes ?? [0];
|
|
307
|
+
const environment = createConfiguredProcessEnvironment(
|
|
308
|
+
config,
|
|
309
|
+
context.projectRoot,
|
|
310
|
+
context.env ?? process.env,
|
|
311
|
+
);
|
|
150
312
|
|
|
151
313
|
return new Promise((resolve, reject) => {
|
|
152
314
|
const child = spawn(executable, arguments_, {
|
|
153
315
|
cwd,
|
|
154
|
-
env:
|
|
316
|
+
env: environment,
|
|
317
|
+
signal: context.signal,
|
|
318
|
+
killSignal: "SIGKILL",
|
|
155
319
|
stdio: ["ignore", "pipe", "pipe"],
|
|
156
320
|
});
|
|
157
321
|
let stdout = "";
|
|
158
322
|
let stderr = "";
|
|
323
|
+
const childStdout = requiredValue(child.stdout);
|
|
324
|
+
const childStderr = requiredValue(child.stderr);
|
|
159
325
|
let isTimedOut = false;
|
|
160
326
|
const timeout = setTimeout(() => {
|
|
161
327
|
isTimedOut = true;
|
|
162
328
|
child.kill("SIGKILL");
|
|
163
329
|
}, config.timeoutMs ?? 30_000);
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
330
|
+
childStdout.setEncoding("utf8");
|
|
331
|
+
childStderr.setEncoding("utf8");
|
|
332
|
+
childStdout.on("data", (chunk: string) => {
|
|
167
333
|
stdout += chunk;
|
|
168
334
|
});
|
|
169
|
-
|
|
335
|
+
childStderr.on("data", (chunk: string) => {
|
|
170
336
|
stderr += chunk;
|
|
171
337
|
});
|
|
172
338
|
child.on("error", (error) => {
|
|
@@ -200,6 +366,10 @@ export async function runConfiguredFormatter(
|
|
|
200
366
|
const result = await runConfiguredProcess(config.run, context);
|
|
201
367
|
|
|
202
368
|
if (!result.ok) {
|
|
369
|
+
// A failed in-place formatter must not leave a partially formatted edit behind.
|
|
370
|
+
if (config.output === "in-place" && (await readFile(context.filePath, "utf8")) !== before) {
|
|
371
|
+
await writeFile(context.filePath, before, "utf8");
|
|
372
|
+
}
|
|
203
373
|
return { ok: false, changed: false };
|
|
204
374
|
}
|
|
205
375
|
|
|
@@ -260,6 +430,13 @@ export function parseLintersConfig(value: unknown): LintersConfig {
|
|
|
260
430
|
throw new Error(`linter ${name} has an unsupported diagnostics format`);
|
|
261
431
|
}
|
|
262
432
|
|
|
433
|
+
if (
|
|
434
|
+
diagnostics.columnBase !== undefined &&
|
|
435
|
+
(diagnostics.format !== "regex" ||
|
|
436
|
+
(diagnostics.columnBase !== 0 && diagnostics.columnBase !== 1))
|
|
437
|
+
) {
|
|
438
|
+
throw new Error(`linter ${name} columnBase must be 0 or 1 for regex diagnostics`);
|
|
439
|
+
}
|
|
263
440
|
if (diagnostics.format === "regex" && typeof diagnostics.pattern !== "string") {
|
|
264
441
|
throw new Error(`linter ${name} regex diagnostics require pattern`);
|
|
265
442
|
}
|
|
@@ -285,6 +462,9 @@ function configRoot(
|
|
|
285
462
|
function assertMatcher(record: Record<string, unknown>, label: string): void {
|
|
286
463
|
assertStringArray(record.extensions, `${label}.extensions`, false);
|
|
287
464
|
|
|
465
|
+
if (record.fileNames !== undefined)
|
|
466
|
+
assertStringArray(record.fileNames, `${label}.fileNames`, false);
|
|
467
|
+
|
|
288
468
|
if (record.include !== undefined) {
|
|
289
469
|
assertStringArray(record.include, `${label}.include`, false);
|
|
290
470
|
}
|
|
@@ -352,6 +532,62 @@ function normalizeExtension(extension: string): string {
|
|
|
352
532
|
return extension.startsWith(".") ? extension.toLowerCase() : `.${extension.toLowerCase()}`;
|
|
353
533
|
}
|
|
354
534
|
|
|
535
|
+
async function readToolConfigLayer<T>(
|
|
536
|
+
source: {
|
|
537
|
+
readonly layer: ToolConfigLayer;
|
|
538
|
+
readonly sourcePath: string;
|
|
539
|
+
readonly optional: boolean;
|
|
540
|
+
},
|
|
541
|
+
name: ToolConfigName,
|
|
542
|
+
parseEntries: (value: unknown) => Readonly<Record<string, T>>,
|
|
543
|
+
): Promise<Readonly<Record<string, T>>> {
|
|
544
|
+
let raw: string;
|
|
545
|
+
|
|
546
|
+
try {
|
|
547
|
+
raw = await readFile(source.sourcePath, "utf8");
|
|
548
|
+
} catch (error) {
|
|
549
|
+
if (source.optional && isMissingFile(error)) {
|
|
550
|
+
return {};
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
throw new Error(
|
|
554
|
+
`Cannot read ${source.layer} ${name} config at ${source.sourcePath}: ${errorMessage(error)}`,
|
|
555
|
+
{ cause: error },
|
|
556
|
+
);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
try {
|
|
560
|
+
return parseEntries(JSON.parse(raw));
|
|
561
|
+
} catch (error) {
|
|
562
|
+
throw new Error(
|
|
563
|
+
`Invalid ${source.layer} ${name} config at ${source.sourcePath}: ${errorMessage(error)}`,
|
|
564
|
+
{ cause: error },
|
|
565
|
+
);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
function isMissingFile(error: unknown): boolean {
|
|
570
|
+
return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
function errorMessage(error: unknown): string {
|
|
574
|
+
return error instanceof Error ? error.message : String(error);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
Builds the environment used to launch a configured project tool.
|
|
579
|
+
*/
|
|
580
|
+
export function createConfiguredProcessEnvironment(
|
|
581
|
+
config: Pick<ProcessConfig, "command" | "env">,
|
|
582
|
+
projectRoot: string,
|
|
583
|
+
environment: NodeJS.ProcessEnv,
|
|
584
|
+
): NodeJS.ProcessEnv {
|
|
585
|
+
return projectProcessEnvironment(projectRoot, {
|
|
586
|
+
...normalizeProcessEnvironment(environment),
|
|
587
|
+
...normalizeProcessEnvironment(config.env ?? {}),
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
|
|
355
591
|
function expandPlaceholders(
|
|
356
592
|
value: string,
|
|
357
593
|
context: { readonly projectRoot: string; readonly filePath: string },
|
package/src/api/toolchain.ts
CHANGED
|
@@ -8,14 +8,9 @@ export {
|
|
|
8
8
|
type Compiler,
|
|
9
9
|
type CompileResult,
|
|
10
10
|
type Diagnostic,
|
|
11
|
-
type FileGateResult,
|
|
12
11
|
type FormatInput,
|
|
13
12
|
type FormatResult,
|
|
14
13
|
type Formatter,
|
|
15
|
-
type GatePhaseCallback,
|
|
16
|
-
type GatePhaseEntry,
|
|
17
|
-
type GateResult,
|
|
18
|
-
type GateStage,
|
|
19
14
|
type Linter,
|
|
20
15
|
type LintInput,
|
|
21
16
|
type LintResult,
|
|
@@ -4,7 +4,21 @@ import { formatDiagnostic } from "#src/toolchain/diagnostic.js";
|
|
|
4
4
|
|
|
5
5
|
import type { Diagnostic } from "#src/toolchain/types.js";
|
|
6
6
|
import type { SourceMappedTextContent } from "./source-view.js";
|
|
7
|
-
import type { TextSourceLine } from "pi-agent-text";
|
|
7
|
+
import type { TextDocument, TextSourceLine } from "pi-agent-text";
|
|
8
|
+
|
|
9
|
+
/** Diagnostics produced by one named source such as `lsp` or `lint`. */
|
|
10
|
+
export interface DiagnosticSource {
|
|
11
|
+
readonly source: string;
|
|
12
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
13
|
+
|
|
14
|
+
readonly status?: "ready" | "pending" | "unavailable" | "snapshot" | "unversioned";
|
|
15
|
+
readonly reason?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Controls the source context projected around diagnostic lines. */
|
|
19
|
+
export interface DiagnosticViewOptions {
|
|
20
|
+
readonly contextLines?: number;
|
|
21
|
+
}
|
|
8
22
|
|
|
9
23
|
export function resolveDiagnosticViewPath(
|
|
10
24
|
source: string,
|
|
@@ -30,48 +44,52 @@ export function formatDiagnosticViewSource(scheme: string, filePath: string): st
|
|
|
30
44
|
return `${scheme}:${filePath}`;
|
|
31
45
|
}
|
|
32
46
|
|
|
47
|
+
/** Builds a source-mapped diagnostic read with merged context around every diagnostic line. */
|
|
33
48
|
export function createDiagnosticViewContent(
|
|
34
49
|
filePath: string,
|
|
35
50
|
text: string,
|
|
36
|
-
|
|
37
|
-
|
|
51
|
+
sources: readonly DiagnosticSource[],
|
|
52
|
+
options: DiagnosticViewOptions = {},
|
|
38
53
|
): SourceMappedTextContent {
|
|
39
54
|
const fileLines = text.split(/\r\n|\r|\n/u);
|
|
40
|
-
const diagnosticsByLine =
|
|
41
|
-
|
|
42
|
-
for (const diagnostic of diagnostics) {
|
|
43
|
-
if (
|
|
44
|
-
!Number.isInteger(diagnostic.line) ||
|
|
45
|
-
diagnostic.line < 1 ||
|
|
46
|
-
diagnostic.line > fileLines.length
|
|
47
|
-
) {
|
|
48
|
-
continue;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const lineDiagnostics = diagnosticsByLine.get(diagnostic.line) ?? [];
|
|
52
|
-
lineDiagnostics.push(diagnostic);
|
|
53
|
-
diagnosticsByLine.set(diagnostic.line, lineDiagnostics);
|
|
54
|
-
}
|
|
55
|
+
const diagnosticsByLine = diagnosticsByValidLine(sources, fileLines.length);
|
|
55
56
|
|
|
56
57
|
if (diagnosticsByLine.size === 0) {
|
|
57
58
|
return {
|
|
58
59
|
type: "text",
|
|
59
|
-
text:
|
|
60
|
+
text: diagnosticStatus(sources) || "No diagnostics.",
|
|
60
61
|
sourceLines: {},
|
|
61
62
|
};
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
const
|
|
65
|
+
const contextLines = options.contextLines ?? 5;
|
|
66
|
+
|
|
67
|
+
if (!Number.isInteger(contextLines) || contextLines < 0) {
|
|
68
|
+
throw new TypeError("Diagnostic contextLines must be a non-negative integer.");
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const includedLines = new Set<number>();
|
|
72
|
+
for (const diagnosticLine of diagnosticsByLine.keys()) {
|
|
73
|
+
const first = Math.max(1, diagnosticLine - contextLines);
|
|
74
|
+
const last = Math.min(fileLines.length, diagnosticLine + contextLines);
|
|
75
|
+
|
|
76
|
+
for (let lineNumber = first; lineNumber <= last; lineNumber += 1) {
|
|
77
|
+
includedLines.add(lineNumber);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const status = diagnosticStatus(sources);
|
|
82
|
+
const renderedLines: string[] = status ? [status] : [];
|
|
65
83
|
const sourceLines: Record<string, TextSourceLine> = {};
|
|
66
84
|
|
|
67
|
-
for (const
|
|
68
|
-
([left], [right]) => left - right,
|
|
69
|
-
)) {
|
|
85
|
+
for (const lineNumber of [...includedLines].sort((left, right) => left - right)) {
|
|
70
86
|
const content = fileLines[lineNumber - 1] ?? "";
|
|
71
|
-
const annotations =
|
|
72
|
-
.map(
|
|
87
|
+
const annotations = (diagnosticsByLine.get(lineNumber) ?? [])
|
|
88
|
+
.map(
|
|
89
|
+
({ diagnostic, source }) => `<!-- ${source}: ${formatDiagnostic(diagnostic, source)} -->`,
|
|
90
|
+
)
|
|
73
91
|
.join(" ");
|
|
74
|
-
renderedLines.push(`${content} ${annotations}`);
|
|
92
|
+
renderedLines.push(annotations.length === 0 ? content : `${content} ${annotations}`);
|
|
75
93
|
sourceLines[String(renderedLines.length)] = { source: filePath, lineNumber, content };
|
|
76
94
|
}
|
|
77
95
|
|
|
@@ -81,3 +99,80 @@ export function createDiagnosticViewContent(
|
|
|
81
99
|
sourceLines,
|
|
82
100
|
};
|
|
83
101
|
}
|
|
102
|
+
|
|
103
|
+
/** Add annotations without changing source lines. EOF reports attach to the last line with their original coordinates. */
|
|
104
|
+
export function addDiagnosticAnnotations(
|
|
105
|
+
document: TextDocument,
|
|
106
|
+
sources: readonly DiagnosticSource[],
|
|
107
|
+
): TextDocument {
|
|
108
|
+
const diagnostics = diagnosticsByValidLine(
|
|
109
|
+
sources,
|
|
110
|
+
document.lines.length,
|
|
111
|
+
/[\r\n]$/u.test(document.content),
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
const lines = document.lines.map((line) => {
|
|
115
|
+
const annotations = diagnostics.get(line.lineNumber);
|
|
116
|
+
|
|
117
|
+
if (annotations === undefined) {
|
|
118
|
+
return line;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const suffix = annotations
|
|
122
|
+
.map(
|
|
123
|
+
({ diagnostic, source }) =>
|
|
124
|
+
`<!-- ${source}: ${formatDiagnostic(diagnostic, source)}${diagnostic.line === line.lineNumber ? "" : ` @${diagnostic.line}:${diagnostic.column}`} -->`,
|
|
125
|
+
)
|
|
126
|
+
.join(" ");
|
|
127
|
+
|
|
128
|
+
return {
|
|
129
|
+
...line,
|
|
130
|
+
presentation: {
|
|
131
|
+
...line.presentation,
|
|
132
|
+
suffix: `${line.presentation?.suffix ?? ""} ${suffix}`,
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
return { ...document, lines };
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** Describe incomplete or unverified sources without treating missing results as clean. */
|
|
141
|
+
export function diagnosticStatus(sources: readonly DiagnosticSource[]): string {
|
|
142
|
+
return sources
|
|
143
|
+
.filter((source) => source.status && source.status !== "ready")
|
|
144
|
+
.map(
|
|
145
|
+
(source) =>
|
|
146
|
+
`${source.source}: ${source.status}${source.reason ? ` (${source.reason})` : ""}.`,
|
|
147
|
+
)
|
|
148
|
+
.join(" ");
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
interface NamedDiagnostic {
|
|
152
|
+
readonly source: string;
|
|
153
|
+
readonly diagnostic: Diagnostic;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function diagnosticsByValidLine(
|
|
157
|
+
sources: readonly DiagnosticSource[],
|
|
158
|
+
lineCount: number,
|
|
159
|
+
trailingNewline = false,
|
|
160
|
+
): Map<number, NamedDiagnostic[]> {
|
|
161
|
+
const diagnosticsByLine = new Map<number, NamedDiagnostic[]>();
|
|
162
|
+
|
|
163
|
+
for (const { diagnostics, source } of sources) {
|
|
164
|
+
for (const diagnostic of diagnostics) {
|
|
165
|
+
const renderedLine =
|
|
166
|
+
trailingNewline && diagnostic.line === lineCount + 1 ? lineCount : diagnostic.line;
|
|
167
|
+
if (!Number.isInteger(diagnostic.line) || renderedLine < 1 || renderedLine > lineCount) {
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const lineDiagnostics = diagnosticsByLine.get(renderedLine) ?? [];
|
|
172
|
+
lineDiagnostics.push({ diagnostic, source });
|
|
173
|
+
diagnosticsByLine.set(renderedLine, lineDiagnostics);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return diagnosticsByLine;
|
|
178
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import registerIdeCore from "#src/core/extension.js";
|
|
2
|
+
import registerTips from "#src/tips/extension.js";
|
|
2
3
|
import registerDoctor from "#src/doctor/index.js";
|
|
3
4
|
import registerFilesystem from "#src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.js";
|
|
4
5
|
import registerFilesystemImage from "#src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/index.js";
|
|
@@ -11,17 +12,19 @@ import registerWebPdf from "#src/extensions/pi-agent-read/extensions/pi-agent-we
|
|
|
11
12
|
import registerWebText from "#src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/index.js";
|
|
12
13
|
import registerReadCore from "#src/extensions/pi-agent-read/index.js";
|
|
13
14
|
import registerSearchCore from "#src/extensions/pi-agent-search/index.js";
|
|
14
|
-
import registerSemanticSearch from "#src/extensions/pi-agent-search/plugins/pi-agent-search-semantic/index.js";
|
|
15
15
|
import registerTextSearch from "#src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.js";
|
|
16
|
-
import registerWebSearch from "#src/extensions/pi-agent-search/plugins/pi-agent-search-web/index.js";
|
|
17
16
|
import registerTextEditor from "#src/extensions/pi-agent-text-editor/index.js";
|
|
18
17
|
import registerConstantAnchors from "#src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/index.js";
|
|
19
18
|
import registerLineHashAnchors from "#src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.js";
|
|
19
|
+
import registerExactTextAnchors from "#src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.js";
|
|
20
20
|
import registerArgumentOrder from "#src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/index.js";
|
|
21
|
+
import registerOverwrite from "#src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/index.js";
|
|
21
22
|
import registerTextEditorRenderer from "#src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.js";
|
|
22
23
|
import registerStaleAnchorGuard from "#src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/index.js";
|
|
23
24
|
import registerAst from "#src/plugins/pi-agent-ide-ast/index.js";
|
|
24
25
|
import registerChanges from "#src/plugins/pi-agent-ide-changes/index.js";
|
|
26
|
+
|
|
27
|
+
import registerDiagnostics from "#src/plugins/pi-agent-ide-diagnostics/index.js";
|
|
25
28
|
import registerFormatter from "#src/plugins/pi-agent-ide-formatter/index.js";
|
|
26
29
|
import registerLanguages from "#src/plugins/pi-agent-ide-languages/index.js";
|
|
27
30
|
import registerLint from "#src/plugins/pi-agent-ide-lint/index.js";
|
|
@@ -34,6 +37,7 @@ Built-ins in their established registration order. IDs are stable configuration
|
|
|
34
37
|
*/
|
|
35
38
|
export const BUILTIN_EXTENSIONS: readonly BuiltinExtension[] = [
|
|
36
39
|
builtin("ide.core", registerIdeCore),
|
|
40
|
+
builtin("ide.tips", registerTips),
|
|
37
41
|
builtin("ide.doctor", registerDoctor),
|
|
38
42
|
builtin("ide.languages", registerLanguages, ["ide.doctor"]),
|
|
39
43
|
builtin("read.core", registerReadCore),
|
|
@@ -48,25 +52,27 @@ export const BUILTIN_EXTENSIONS: readonly BuiltinExtension[] = [
|
|
|
48
52
|
builtin("read.web.text", registerWebText, ["read.web"]),
|
|
49
53
|
builtin("search.core", registerSearchCore),
|
|
50
54
|
builtin("search.text", registerTextSearch, ["search.core"]),
|
|
51
|
-
builtin("search.semantic", registerSemanticSearch, ["search.core"]),
|
|
52
|
-
builtin("search.web", registerWebSearch, ["search.core"]),
|
|
53
55
|
builtin("editor.renderer", registerTextEditorRenderer, ["editor.core"]),
|
|
54
56
|
builtin("editor.core", registerTextEditor),
|
|
55
57
|
builtin("editor.anchor.constant", registerConstantAnchors, ["read.core", "editor.core"]),
|
|
56
58
|
builtin("editor.anchor.line-hash", registerLineHashAnchors, ["read.core", "editor.core"]),
|
|
57
|
-
builtin("editor.
|
|
59
|
+
builtin("editor.anchor.exact", registerExactTextAnchors, ["editor.core"]),
|
|
60
|
+
builtin("editor.argument-order", registerArgumentOrder, ["editor.core"], false),
|
|
61
|
+
builtin("editor.overwrite", registerOverwrite, ["editor.core"], false),
|
|
58
62
|
builtin("editor.stale-anchor", registerStaleAnchorGuard, ["editor.core"]),
|
|
59
63
|
builtin("ide.ast", registerAst, ["ide.core", "read.core", "search.core", "editor.core"]),
|
|
60
64
|
builtin("ide.formatter", registerFormatter, ["ide.core"]),
|
|
61
65
|
builtin("ide.lint", registerLint, ["ide.core"]),
|
|
62
66
|
builtin("ide.changes", registerChanges, ["ide.core", "read.core", "editor.core"]),
|
|
63
67
|
builtin("ide.lsp", registerLsp, ["ide.core", "read.core", "search.core"]),
|
|
68
|
+
builtin("ide.diagnostics", registerDiagnostics, ["ide.core", "read.core"]),
|
|
64
69
|
];
|
|
65
70
|
|
|
66
71
|
function builtin(
|
|
67
72
|
id: string,
|
|
68
73
|
register: BuiltinExtension["register"],
|
|
69
74
|
dependencies: readonly string[] = [],
|
|
75
|
+
defaultEnabled = true,
|
|
70
76
|
): BuiltinExtension {
|
|
71
|
-
return { id, dependencies, register };
|
|
77
|
+
return { id, dependencies, register, ...(defaultEnabled ? {} : { defaultEnabled: false }) };
|
|
72
78
|
}
|