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
|
@@ -3,6 +3,7 @@ import { Value } from "typebox/value";
|
|
|
3
3
|
|
|
4
4
|
const textAnchorBrand = Symbol.for("pi-agent-text/TextAnchor");
|
|
5
5
|
|
|
6
|
+
/** A text value resolved by a registered anchor resolver. */
|
|
6
7
|
export abstract class TextAnchor {
|
|
7
8
|
readonly [textAnchorBrand] = true;
|
|
8
9
|
|
|
@@ -23,11 +24,12 @@ export abstract class TextAnchor {
|
|
|
23
24
|
return false;
|
|
24
25
|
}
|
|
25
26
|
}
|
|
27
|
+
|
|
26
28
|
protected constructor(
|
|
27
29
|
readonly value: string,
|
|
28
30
|
readonly lineNumber: number,
|
|
29
31
|
) {
|
|
30
|
-
if (value.
|
|
32
|
+
if (value.length === 0) {
|
|
31
33
|
throw new TypeError("Text anchor value must be non-empty");
|
|
32
34
|
}
|
|
33
35
|
|
|
@@ -41,6 +43,7 @@ export abstract class TextAnchor {
|
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
|
|
46
|
+
/** Immutable source snapshot available to an anchor resolver. */
|
|
44
47
|
export interface TextAnchorResolverContext {
|
|
45
48
|
readonly source: string;
|
|
46
49
|
readonly content: string;
|
|
@@ -49,17 +52,54 @@ export interface TextAnchorResolverContext {
|
|
|
49
52
|
readonly signal?: AbortSignal;
|
|
50
53
|
}
|
|
51
54
|
|
|
55
|
+
/** Legacy line window used by anchor inspection. */
|
|
52
56
|
export interface TextAnchorRecoveryRange {
|
|
53
57
|
readonly offset: number;
|
|
54
58
|
readonly limit: number;
|
|
55
59
|
}
|
|
56
60
|
|
|
61
|
+
/** Why an anchor could not resolve safely. */
|
|
57
62
|
export interface TextAnchorRejection {
|
|
58
63
|
readonly code: "invalid" | "stale" | "missing" | "ambiguous";
|
|
59
64
|
readonly reason: string;
|
|
60
65
|
readonly contextRange?: TextAnchorRecoveryRange;
|
|
61
66
|
}
|
|
62
67
|
|
|
68
|
+
/** A position in the current text snapshot. Columns are zero-based. */
|
|
69
|
+
export interface TextAnchorRecoveryPosition {
|
|
70
|
+
readonly lineNumber: number;
|
|
71
|
+
readonly column: number;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** A candidate character span in the current text snapshot. */
|
|
75
|
+
export interface TextAnchorRecoveryCandidateRange {
|
|
76
|
+
readonly start: TextAnchorRecoveryPosition;
|
|
77
|
+
readonly end: TextAnchorRecoveryPosition;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** A safe candidate returned after an anchor rejection. */
|
|
81
|
+
export interface TextAnchorRecoveryCandidate {
|
|
82
|
+
readonly rank: number;
|
|
83
|
+
readonly range: TextAnchorRecoveryCandidateRange;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Context passed back to the resolver that rejected an anchor. */
|
|
87
|
+
export interface TextAnchorResolverRecoveryContext extends TextAnchorResolverContext {
|
|
88
|
+
readonly rejection: TextAnchorRejection;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** Result of an optional, non-mutating anchor recovery attempt. */
|
|
92
|
+
export type TextAnchorRecoveryOutcome =
|
|
93
|
+
| { readonly kind: "unavailable" }
|
|
94
|
+
| {
|
|
95
|
+
readonly kind: "candidates";
|
|
96
|
+
readonly candidates: readonly TextAnchorRecoveryCandidate[];
|
|
97
|
+
readonly total: number;
|
|
98
|
+
}
|
|
99
|
+
| { readonly kind: "timed-out" }
|
|
100
|
+
| { readonly kind: "failed"; readonly error: unknown };
|
|
101
|
+
|
|
102
|
+
/** Result of resolving an anchor value. */
|
|
63
103
|
export type TextAnchorResolutionAttempt =
|
|
64
104
|
| { readonly kind: "not-handled" }
|
|
65
105
|
| { readonly kind: "resolved"; readonly anchor: TextAnchor }
|
|
@@ -67,28 +107,126 @@ export type TextAnchorResolutionAttempt =
|
|
|
67
107
|
| { readonly kind: "failed"; readonly error: unknown };
|
|
68
108
|
|
|
69
109
|
export type TextAnchorDescriptionSource = string | (() => string | undefined);
|
|
110
|
+
/** Context passed to an anchor renderer. */
|
|
111
|
+
export interface TextAnchorRenderContext {
|
|
112
|
+
readonly source: string;
|
|
113
|
+
readonly anchor: TextAnchor;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** Renderer functions owned by one anchor resolver. */
|
|
117
|
+
export interface TextAnchorRenderer {
|
|
118
|
+
/** Returns the raw value for agent-facing output. */
|
|
119
|
+
renderFull(value: string, context: TextAnchorRenderContext): string;
|
|
120
|
+
/** Returns a short, single-line value for user-facing output. */
|
|
121
|
+
renderCompact(value: string, context: TextAnchorRenderContext): string;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
interface AttachedTextAnchorRenderer {
|
|
125
|
+
readonly renderer: TextAnchorRenderer;
|
|
126
|
+
readonly resolverId: string;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const rendererByAnchor = new WeakMap<TextAnchor, AttachedTextAnchorRenderer>();
|
|
130
|
+
|
|
131
|
+
/** Associates a resolver-owned renderer with a resolved anchor. */
|
|
132
|
+
export function attachTextAnchorRenderer(
|
|
133
|
+
anchor: TextAnchor,
|
|
134
|
+
renderer: TextAnchorRenderer,
|
|
135
|
+
resolverId: string,
|
|
136
|
+
): void {
|
|
137
|
+
rendererByAnchor.set(anchor, { renderer, resolverId });
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** Returns the renderer attached to a resolved anchor. */
|
|
141
|
+
export function getTextAnchorRenderer(anchor: TextAnchor): TextAnchorRenderer | undefined {
|
|
142
|
+
return rendererByAnchor.get(anchor)?.renderer;
|
|
143
|
+
}
|
|
70
144
|
|
|
145
|
+
/** Renders a resolved anchor through its resolver-owned renderer. */
|
|
146
|
+
export function renderTextAnchor(
|
|
147
|
+
anchor: TextAnchor,
|
|
148
|
+
value: string,
|
|
149
|
+
context: TextAnchorRenderContext,
|
|
150
|
+
): TextAnchorRenderer & {
|
|
151
|
+
readonly full: string;
|
|
152
|
+
readonly compact: string;
|
|
153
|
+
readonly resolverId: string;
|
|
154
|
+
} {
|
|
155
|
+
const attached = rendererByAnchor.get(anchor);
|
|
156
|
+
if (attached === undefined) {
|
|
157
|
+
throw new Error(`No renderer is attached to text anchor "${value}"`);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return {
|
|
161
|
+
...attached.renderer,
|
|
162
|
+
resolverId: attached.resolverId,
|
|
163
|
+
full: attached.renderer.renderFull(value, context),
|
|
164
|
+
compact: attached.renderer.renderCompact(value, context),
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/** Resolves one anchor syntax and may recover its own rejected values. */
|
|
71
169
|
export interface TextAnchorResolver {
|
|
72
170
|
readonly id: string;
|
|
73
171
|
readonly description: TextAnchorDescriptionSource;
|
|
74
172
|
readonly normalize?: (value: string) => string;
|
|
173
|
+
/** Returns the raw value for agent-facing output. */
|
|
174
|
+
readonly renderFull: TextAnchorRenderer["renderFull"];
|
|
175
|
+
/** Returns a short, single-line value for user-facing output. */
|
|
176
|
+
readonly renderCompact: TextAnchorRenderer["renderCompact"];
|
|
75
177
|
tryResolve(
|
|
76
178
|
value: string,
|
|
77
179
|
context: TextAnchorResolverContext,
|
|
78
180
|
): Promise<TextAnchorResolutionAttempt>;
|
|
181
|
+
readonly recover?: (
|
|
182
|
+
value: string,
|
|
183
|
+
context: TextAnchorResolverRecoveryContext,
|
|
184
|
+
) => Promise<TextAnchorRecoveryOutcome>;
|
|
79
185
|
}
|
|
80
186
|
|
|
81
187
|
const objectOptions = { additionalProperties: true } as const;
|
|
82
188
|
const functionSchema = Type.Function([], Type.Unknown());
|
|
189
|
+
const positionSchema = Type.Object(
|
|
190
|
+
{
|
|
191
|
+
lineNumber: Type.Integer({ minimum: 1 }),
|
|
192
|
+
column: Type.Integer({ minimum: 0 }),
|
|
193
|
+
},
|
|
194
|
+
objectOptions,
|
|
195
|
+
);
|
|
196
|
+
const candidateSchema = Type.Object(
|
|
197
|
+
{
|
|
198
|
+
rank: Type.Integer({ minimum: 1 }),
|
|
199
|
+
range: Type.Object({ start: positionSchema, end: positionSchema }, objectOptions),
|
|
200
|
+
},
|
|
201
|
+
objectOptions,
|
|
202
|
+
);
|
|
83
203
|
const resolverSchema = Type.Object(
|
|
84
204
|
{
|
|
85
205
|
id: Type.String({ minLength: 1 }),
|
|
86
206
|
description: Type.Union([Type.String(), functionSchema]),
|
|
87
207
|
normalize: Type.Optional(functionSchema),
|
|
208
|
+
renderFull: functionSchema,
|
|
209
|
+
renderCompact: functionSchema,
|
|
88
210
|
tryResolve: functionSchema,
|
|
211
|
+
recover: Type.Optional(functionSchema),
|
|
89
212
|
},
|
|
90
213
|
objectOptions,
|
|
91
214
|
);
|
|
215
|
+
const rejectionSchema = Type.Object({
|
|
216
|
+
code: Type.Union([
|
|
217
|
+
Type.Literal("invalid"),
|
|
218
|
+
Type.Literal("stale"),
|
|
219
|
+
Type.Literal("missing"),
|
|
220
|
+
Type.Literal("ambiguous"),
|
|
221
|
+
]),
|
|
222
|
+
reason: Type.String(),
|
|
223
|
+
contextRange: Type.Optional(
|
|
224
|
+
Type.Object({
|
|
225
|
+
offset: Type.Number(),
|
|
226
|
+
limit: Type.Number(),
|
|
227
|
+
}),
|
|
228
|
+
),
|
|
229
|
+
});
|
|
92
230
|
const attemptSchema = Type.Union([
|
|
93
231
|
Type.Object({ kind: Type.Literal("not-handled") }, objectOptions),
|
|
94
232
|
Type.Object(
|
|
@@ -101,21 +239,7 @@ const attemptSchema = Type.Union([
|
|
|
101
239
|
Type.Object(
|
|
102
240
|
{
|
|
103
241
|
kind: Type.Literal("rejected"),
|
|
104
|
-
rejection:
|
|
105
|
-
code: Type.Union([
|
|
106
|
-
Type.Literal("invalid"),
|
|
107
|
-
Type.Literal("stale"),
|
|
108
|
-
Type.Literal("missing"),
|
|
109
|
-
Type.Literal("ambiguous"),
|
|
110
|
-
]),
|
|
111
|
-
reason: Type.String(),
|
|
112
|
-
contextRange: Type.Optional(
|
|
113
|
-
Type.Object({
|
|
114
|
-
offset: Type.Number(),
|
|
115
|
-
limit: Type.Number(),
|
|
116
|
-
}),
|
|
117
|
-
),
|
|
118
|
-
}),
|
|
242
|
+
rejection: rejectionSchema,
|
|
119
243
|
},
|
|
120
244
|
objectOptions,
|
|
121
245
|
),
|
|
@@ -127,7 +251,21 @@ const attemptSchema = Type.Union([
|
|
|
127
251
|
objectOptions,
|
|
128
252
|
),
|
|
129
253
|
]);
|
|
254
|
+
const recoveryOutcomeSchema = Type.Union([
|
|
255
|
+
Type.Object({ kind: Type.Literal("unavailable") }, objectOptions),
|
|
256
|
+
Type.Object(
|
|
257
|
+
{
|
|
258
|
+
kind: Type.Literal("candidates"),
|
|
259
|
+
candidates: Type.Array(candidateSchema),
|
|
260
|
+
total: Type.Integer({ minimum: 0 }),
|
|
261
|
+
},
|
|
262
|
+
objectOptions,
|
|
263
|
+
),
|
|
264
|
+
Type.Object({ kind: Type.Literal("timed-out") }, objectOptions),
|
|
265
|
+
Type.Object({ kind: Type.Literal("failed"), error: Type.Unknown() }, objectOptions),
|
|
266
|
+
]);
|
|
130
267
|
|
|
268
|
+
/** Returns whether a plugin value satisfies the resolver contract. */
|
|
131
269
|
export function isTextAnchorResolver(value: unknown): value is TextAnchorResolver {
|
|
132
270
|
return (
|
|
133
271
|
safeCheck(resolverSchema, value) &&
|
|
@@ -135,6 +273,7 @@ export function isTextAnchorResolver(value: unknown): value is TextAnchorResolve
|
|
|
135
273
|
);
|
|
136
274
|
}
|
|
137
275
|
|
|
276
|
+
/** Returns whether a resolver result satisfies the resolution contract. */
|
|
138
277
|
export function isTextAnchorResolutionAttempt(
|
|
139
278
|
value: unknown,
|
|
140
279
|
): value is TextAnchorResolutionAttempt {
|
|
@@ -147,6 +286,11 @@ export function isTextAnchorResolutionAttempt(
|
|
|
147
286
|
);
|
|
148
287
|
}
|
|
149
288
|
|
|
289
|
+
/** Returns whether a resolver recovery result is safe for core to consume. */
|
|
290
|
+
export function isTextAnchorRecoveryOutcome(value: unknown): value is TextAnchorRecoveryOutcome {
|
|
291
|
+
return safeCheck(recoveryOutcomeSchema, value);
|
|
292
|
+
}
|
|
293
|
+
|
|
150
294
|
function safeCheck(schema: TSchema, value: unknown): boolean {
|
|
151
295
|
return safeEvaluate(() => Value.Check(schema, value));
|
|
152
296
|
}
|
|
@@ -10,6 +10,10 @@ import {
|
|
|
10
10
|
export interface TextLinePresentation {
|
|
11
11
|
readonly prefix?: string;
|
|
12
12
|
readonly suffix?: string;
|
|
13
|
+
/** Optional user-facing prefix used by compact TUI renderers. */
|
|
14
|
+
readonly compactPrefix?: string;
|
|
15
|
+
/** Optional user-facing suffix used by compact TUI renderers. */
|
|
16
|
+
readonly compactSuffix?: string;
|
|
13
17
|
readonly marker?: TextChangeMarker;
|
|
14
18
|
readonly before?: readonly PresentedTextRow[];
|
|
15
19
|
readonly after?: readonly PresentedTextRow[];
|
|
@@ -76,10 +80,19 @@ export function renderTextDocument(document: TextDocument): string {
|
|
|
76
80
|
return document.lines.map((line) => `${line.content}${line.lineEnding}`).join("");
|
|
77
81
|
}
|
|
78
82
|
|
|
79
|
-
|
|
83
|
+
/** Controls whether user-facing compact presentation fields replace their full forms. */
|
|
84
|
+
export interface PresentedTextDocumentRenderOptions {
|
|
85
|
+
readonly compact?: boolean;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Renders a text document with its presenter-owned annotations. */
|
|
89
|
+
export function renderPresentedTextDocument(
|
|
90
|
+
document: TextDocument,
|
|
91
|
+
options: PresentedTextDocumentRenderOptions = {},
|
|
92
|
+
): string {
|
|
80
93
|
const rows = document.lines.flatMap((line) => [
|
|
81
94
|
...(line.presentation?.before ?? []),
|
|
82
|
-
presentedRowFor(line),
|
|
95
|
+
presentedRowFor(line, options.compact === true),
|
|
83
96
|
...(line.presentation?.after ?? []),
|
|
84
97
|
]);
|
|
85
98
|
const rendered = renderPresentedTextRows(rows);
|
|
@@ -96,11 +109,19 @@ export function renderPresentedTextDocument(document: TextDocument): string {
|
|
|
96
109
|
.join("");
|
|
97
110
|
}
|
|
98
111
|
|
|
99
|
-
function presentedRowFor(line: TextLine): PresentedTextRow {
|
|
112
|
+
function presentedRowFor(line: TextLine, compact: boolean): PresentedTextRow {
|
|
113
|
+
const prefix =
|
|
114
|
+
compact && line.presentation?.compactPrefix !== undefined
|
|
115
|
+
? line.presentation.compactPrefix
|
|
116
|
+
: line.presentation?.prefix;
|
|
117
|
+
const suffix =
|
|
118
|
+
compact && line.presentation?.compactSuffix !== undefined
|
|
119
|
+
? line.presentation.compactSuffix
|
|
120
|
+
: line.presentation?.suffix;
|
|
100
121
|
return {
|
|
101
122
|
content: line.content,
|
|
102
|
-
...(
|
|
103
|
-
...(
|
|
123
|
+
...(prefix !== undefined && { prefix }),
|
|
124
|
+
...(suffix !== undefined && { suffix }),
|
|
104
125
|
...(line.presentation?.marker !== undefined && { marker: line.presentation.marker }),
|
|
105
126
|
};
|
|
106
127
|
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/** A position with a one-based line and zero-based column. */
|
|
2
|
+
export interface TextSelectionPosition {
|
|
3
|
+
readonly lineNumber: number;
|
|
4
|
+
readonly column: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/** A character range in a text document. */
|
|
8
|
+
export interface TextSelectionRange {
|
|
9
|
+
readonly start: TextSelectionPosition;
|
|
10
|
+
readonly end: TextSelectionPosition;
|
|
11
|
+
/** Treat a whole-line match as complete lines during mutation. */
|
|
12
|
+
readonly linewise?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** A source and optional ranges selected by a typed text anchor. */
|
|
16
|
+
export interface TextTarget {
|
|
17
|
+
readonly source: string;
|
|
18
|
+
readonly ranges?: readonly TextSelectionRange[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface TextTargetResolverContext {
|
|
22
|
+
readonly cwd: string;
|
|
23
|
+
readonly signal?: AbortSignal;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type TextTargetResolutionAttempt =
|
|
27
|
+
| { readonly kind: "not-handled" }
|
|
28
|
+
| { readonly kind: "resolved"; readonly targets: readonly TextTarget[] }
|
|
29
|
+
| {
|
|
30
|
+
readonly kind: "rejected";
|
|
31
|
+
readonly rejection: {
|
|
32
|
+
readonly code: "invalid" | "stale" | "missing" | "ambiguous";
|
|
33
|
+
readonly reason: string;
|
|
34
|
+
readonly contextRange?: { readonly offset: number; readonly limit: number };
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
| { readonly kind: "failed"; readonly error: unknown };
|
|
38
|
+
|
|
39
|
+
/** Resolves an anchor/resource value into typed text targets. */
|
|
40
|
+
export interface TextTargetResolver {
|
|
41
|
+
readonly id: string;
|
|
42
|
+
tryResolve(
|
|
43
|
+
value: string,
|
|
44
|
+
context: TextTargetResolverContext,
|
|
45
|
+
): TextTargetResolutionAttempt | Promise<TextTargetResolutionAttempt>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Validates an untrusted runtime result from a text target resolver. */
|
|
49
|
+
export function isTextTargetResolutionAttempt(
|
|
50
|
+
value: unknown,
|
|
51
|
+
): value is TextTargetResolutionAttempt {
|
|
52
|
+
if (value === null || typeof value !== "object") return false;
|
|
53
|
+
const attempt = value as Record<string, unknown>;
|
|
54
|
+
if (attempt.kind === "not-handled") return true;
|
|
55
|
+
if (attempt.kind === "failed") return "error" in attempt;
|
|
56
|
+
if (attempt.kind === "rejected") {
|
|
57
|
+
const rejection = attempt.rejection;
|
|
58
|
+
return (
|
|
59
|
+
rejection !== null &&
|
|
60
|
+
typeof rejection === "object" &&
|
|
61
|
+
["invalid", "stale", "missing", "ambiguous"].includes(
|
|
62
|
+
(rejection as Record<string, unknown>).code as string,
|
|
63
|
+
) &&
|
|
64
|
+
typeof (rejection as Record<string, unknown>).reason === "string"
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
if (
|
|
68
|
+
attempt.kind !== "resolved" ||
|
|
69
|
+
!Array.isArray(attempt.targets) ||
|
|
70
|
+
attempt.targets.length === 0
|
|
71
|
+
) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
return attempt.targets.every((target) => {
|
|
75
|
+
if (target === null || typeof target !== "object") return false;
|
|
76
|
+
const source = (target as Record<string, unknown>).source;
|
|
77
|
+
const ranges = (target as Record<string, unknown>).ranges;
|
|
78
|
+
return (
|
|
79
|
+
typeof source === "string" &&
|
|
80
|
+
source.length > 0 &&
|
|
81
|
+
(ranges === undefined || (Array.isArray(ranges) && ranges.every(isTextSelectionRange)))
|
|
82
|
+
);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function isTextSelectionRange(value: unknown): value is TextSelectionRange {
|
|
87
|
+
if (value === null || typeof value !== "object") return false;
|
|
88
|
+
const range = value as Record<string, unknown>;
|
|
89
|
+
return (
|
|
90
|
+
isTextSelectionPosition(range.start) &&
|
|
91
|
+
isTextSelectionPosition(range.end) &&
|
|
92
|
+
(range.linewise === undefined || typeof range.linewise === "boolean")
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function isTextSelectionPosition(value: unknown): value is TextSelectionPosition {
|
|
97
|
+
if (value === null || typeof value !== "object") return false;
|
|
98
|
+
const position = value as Record<string, unknown>;
|
|
99
|
+
return (
|
|
100
|
+
Number.isInteger(position.lineNumber) &&
|
|
101
|
+
(position.lineNumber as number) >= 1 &&
|
|
102
|
+
Number.isInteger(position.column) &&
|
|
103
|
+
(position.column as number) >= 0
|
|
104
|
+
);
|
|
105
|
+
}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-anchor-constant",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"imports": {
|
|
6
|
+
"#src/*": "./src/*"
|
|
7
|
+
},
|
|
5
8
|
"dependencies": {
|
|
6
|
-
"pi-agent-text": "0.
|
|
7
|
-
"pi-agent-text-editor": "0.
|
|
9
|
+
"pi-agent-text": "0.2.1",
|
|
10
|
+
"pi-agent-text-editor": "0.2.1"
|
|
8
11
|
},
|
|
9
12
|
"pi": {
|
|
10
13
|
"extensions": [
|
|
11
|
-
"./
|
|
14
|
+
"./runtime/entry-49.js"
|
|
12
15
|
]
|
|
13
16
|
},
|
|
14
17
|
"peerDependencies": {
|
|
@@ -15,6 +15,12 @@ export function createConstantTextAnchorResolver(): TextAnchorResolver {
|
|
|
15
15
|
return {
|
|
16
16
|
id: "file-position",
|
|
17
17
|
description: "`begin` and `end` select the first and last existing lines.",
|
|
18
|
+
renderFull(value) {
|
|
19
|
+
return value;
|
|
20
|
+
},
|
|
21
|
+
renderCompact(value) {
|
|
22
|
+
return value === "begin" ? "file start" : "file end";
|
|
23
|
+
},
|
|
18
24
|
tryResolve(value, context) {
|
|
19
25
|
return Promise.resolve(resolveConstantAnchor(value, context));
|
|
20
26
|
},
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { connectTextEditorPlugin } from "pi-agent-text-editor/api/connect-plugin";
|
|
2
|
+
import {
|
|
3
|
+
TEXT_EDITOR_API_VERSION,
|
|
4
|
+
TEXT_EDITOR_PROTOCOL,
|
|
5
|
+
TEXT_POSITION_ANCHOR_KIND,
|
|
6
|
+
type TextEditorPlugin,
|
|
7
|
+
} from "pi-agent-text-editor/api/plugin-protocol";
|
|
8
|
+
|
|
9
|
+
import { createExactTextAnchorResolver } from "./src/anchor.js";
|
|
10
|
+
import { parseExactTextRecoveryConfig } from "./src/config.js";
|
|
11
|
+
|
|
12
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
13
|
+
|
|
14
|
+
/** Registers unique exact text as the final position-anchor fallback. */
|
|
15
|
+
export default async function registerExactTextAnchor(pi: ExtensionAPI): Promise<void> {
|
|
16
|
+
const plugin = {
|
|
17
|
+
protocol: TEXT_EDITOR_PROTOCOL,
|
|
18
|
+
apiVersion: TEXT_EDITOR_API_VERSION,
|
|
19
|
+
id: "text-anchor-exact",
|
|
20
|
+
setup(api) {
|
|
21
|
+
api.addAnchorResolver({
|
|
22
|
+
resolver: createExactTextAnchorResolver(
|
|
23
|
+
parseExactTextRecoveryConfig(api.recoveryConfig("exactText")),
|
|
24
|
+
),
|
|
25
|
+
kind: TEXT_POSITION_ANCHOR_KIND,
|
|
26
|
+
type: "auxiliary",
|
|
27
|
+
describeInPrompt: false,
|
|
28
|
+
priority: 10_000,
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
} satisfies TextEditorPlugin;
|
|
32
|
+
|
|
33
|
+
await connectTextEditorPlugin(pi, plugin);
|
|
34
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pi-agent-text-anchor-exact",
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"imports": {
|
|
6
|
+
"#src/*": "./src/*"
|
|
7
|
+
},
|
|
8
|
+
"exports": {
|
|
9
|
+
"./api/anchor": {
|
|
10
|
+
"types": "./src/anchor.ts",
|
|
11
|
+
"default": "./runtime/entry-50.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"fast-fuzzy": "1.12.0",
|
|
16
|
+
"pi-agent-text": "0.2.1",
|
|
17
|
+
"pi-agent-text-editor": "0.2.1"
|
|
18
|
+
},
|
|
19
|
+
"pi": {
|
|
20
|
+
"extensions": [
|
|
21
|
+
"./runtime/entry-51.js"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"@earendil-works/pi-coding-agent": "*"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../dist/entry-50.js";
|