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
|
@@ -12,10 +12,29 @@ import { textSearchDoctorPlugin } from "#src/doctor-plugin.js";
|
|
|
12
12
|
import { createFileResolver, createRegexResolver, createTextResolver } from "#src/resolvers.js";
|
|
13
13
|
import { SearchSessionStore } from "#src/search-session.js";
|
|
14
14
|
|
|
15
|
+
import { compactSearchDetails } from "#src/persisted-result.js";
|
|
16
|
+
import { isSearchToolDetails } from "#src/search-result.js";
|
|
17
|
+
|
|
15
18
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
16
19
|
|
|
17
20
|
export default async function registerTextSearch(pi: ExtensionAPI): Promise<void> {
|
|
18
21
|
const sessions = new SearchSessionStore();
|
|
22
|
+
|
|
23
|
+
pi.on("tool_result", (event) => {
|
|
24
|
+
if (event.toolName !== "search" || typeof event.details !== "object" || event.details === null)
|
|
25
|
+
return;
|
|
26
|
+
const details = event.details as { payload?: unknown };
|
|
27
|
+
if (!isSearchToolDetails(details.payload)) return;
|
|
28
|
+
return {
|
|
29
|
+
details: {
|
|
30
|
+
...details,
|
|
31
|
+
payload: compactSearchDetails(
|
|
32
|
+
details.payload,
|
|
33
|
+
event.content.flatMap((block) => (block.type === "text" ? [block.text] : [])).join("\n"),
|
|
34
|
+
),
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
});
|
|
19
38
|
await Promise.all([
|
|
20
39
|
connectDoctorPlugin(pi, textSearchDoctorPlugin),
|
|
21
40
|
connectSearchPlugin(pi, {
|
|
@@ -25,14 +44,44 @@ export default async function registerTextSearch(pi: ExtensionAPI): Promise<void
|
|
|
25
44
|
setup(api): void {
|
|
26
45
|
api.addResolver({ resolver: createRegexResolver(sessions), priority: -10 });
|
|
27
46
|
api.addResolver({ resolver: createFileResolver(), priority: -10 });
|
|
28
|
-
api.addResolver({ resolver: createTextResolver(sessions),
|
|
47
|
+
api.addResolver({ resolver: createTextResolver(sessions), fallback: true });
|
|
29
48
|
api.describe(
|
|
30
49
|
[
|
|
31
50
|
"Searches workspace text and paths.",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
51
|
+
"Local queries try literal terms first, then unquoted terms as regex when no literal results exist, then separate words for ordinary multi-word queries. Quoted terms stay literal. Boolean conditions stay intact across fallback. Uppercase AND/OR, infix NOT, ||, and space-separated | are Boolean operators; unspaced | and regex groups/classes belong to regex terms. Parentheses containing Boolean operators group Boolean conditions. regex:<pattern> forces regex-only matching; files:<pattern> searches file paths.",
|
|
52
|
+
"Complete text and regex result sessions register four stale-safe typed resources for read and text-editor operations: SEARCH#HASH:N:line, SEARCH#HASH:N:match, SEARCH#HASH:all:line, and SEARCH#HASH:all:match. Search IDs use four uppercase hexadecimal characters by default and grow only on collision. Limited or incomplete sessions omit the all-result resources.",
|
|
34
53
|
].join("\n"),
|
|
35
54
|
);
|
|
55
|
+
|
|
56
|
+
api.addPromptGuideline(
|
|
57
|
+
"Local search tries literal terms first, then unquoted terms as regex if no matches exist, then separate words for ordinary multi-word queries. Search reports each fallback; invalid optional regex is skipped. Quoted and Boolean queries never fall back to separate words.",
|
|
58
|
+
);
|
|
59
|
+
api.addPromptGuideline(
|
|
60
|
+
'You can combine search terms with uppercase `AND`/`OR`, infix `NOT`, `||`, or space-separated `|`. Parentheses containing Boolean operators group conditions. Regex groups, classes, and escapes stay inside terms: `(?:foo|bar)\\d+ AND "keep.me" NOT ignored`. Quoted terms stay literal, including during regex fallback; `foo|bar` first searches that exact text, then regex alternatives.',
|
|
61
|
+
);
|
|
62
|
+
api.addPromptGuideline(
|
|
63
|
+
"You can use `regex:<pattern>` to force regex-only search and `files:<pattern>` for file paths. Empty or unhandled protocol queries fall back to searching the original text, including the prefix. Resolver errors, timeouts, and successful empty protocol results do not trigger text fallback.",
|
|
64
|
+
);
|
|
65
|
+
api.addPromptGuideline(
|
|
66
|
+
"You can narrow local search with `path`, `include`, `exclude`, `caseSensitive`, `wholeWord`, and `limit`.",
|
|
67
|
+
);
|
|
68
|
+
api.addPromptGuideline(
|
|
69
|
+
[
|
|
70
|
+
"You can reuse complete text and regex search results through these `SEARCH#...` values:",
|
|
71
|
+
" - `SEARCH#HASH:N:line` selects one result's full line.",
|
|
72
|
+
" - `SEARCH#HASH:N:match` selects one exact match.",
|
|
73
|
+
" - `SEARCH#HASH:all:line` selects every unique containing line.",
|
|
74
|
+
" - `SEARCH#HASH:all:match` selects every exact match.",
|
|
75
|
+
" Read shows the containing lines for both modes; `:line` and `:match` control the edit range, not partial-line read rendering.",
|
|
76
|
+
" Limited or incomplete searches omit the `all` values.",
|
|
77
|
+
].join("\n"),
|
|
78
|
+
);
|
|
79
|
+
api.addPromptGuideline(
|
|
80
|
+
"You can pass a returned `SEARCH#...` value directly to read or a compatible mutation tool as its path or anchor. Omit the file path when an `all` value spans files.",
|
|
81
|
+
);
|
|
82
|
+
api.addPromptGuideline(
|
|
83
|
+
"You can replace every exact search match by passing `SEARCH#HASH:all:match` as the replace path, or replace whole matched lines with `SEARCH#HASH:all:line`.",
|
|
84
|
+
);
|
|
36
85
|
},
|
|
37
86
|
}),
|
|
38
87
|
connectTextEditorPlugin(pi, {
|
|
@@ -45,6 +94,7 @@ export default async function registerTextSearch(pi: ExtensionAPI): Promise<void
|
|
|
45
94
|
resources: sessions.resourceResolver(),
|
|
46
95
|
kind: TEXT_SEARCH_ANCHOR_KIND,
|
|
47
96
|
type: "auxiliary",
|
|
97
|
+
describeInPrompt: false,
|
|
48
98
|
});
|
|
49
99
|
},
|
|
50
100
|
}),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-search-text",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,23 +8,23 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./index.ts",
|
|
11
|
-
"default": "./
|
|
11
|
+
"default": "./runtime/entry-46.js"
|
|
12
12
|
},
|
|
13
13
|
"./search-session": {
|
|
14
14
|
"types": "./src/search-session.ts",
|
|
15
|
-
"default": "./
|
|
15
|
+
"default": "./runtime/entry-47.js"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"
|
|
20
|
-
"pi-agent-
|
|
21
|
-
"pi-agent-search": "0.
|
|
22
|
-
"pi-agent-text": "0.
|
|
23
|
-
"pi-agent-text-editor": "0.
|
|
19
|
+
"pi-agent-doctor": "0.2.1",
|
|
20
|
+
"pi-agent-invariant": "0.2.1",
|
|
21
|
+
"pi-agent-search": "0.2.1",
|
|
22
|
+
"pi-agent-text": "0.2.1",
|
|
23
|
+
"pi-agent-text-editor": "0.2.1"
|
|
24
24
|
},
|
|
25
25
|
"pi": {
|
|
26
26
|
"extensions": [
|
|
27
|
-
"./
|
|
27
|
+
"./runtime/entry-46.js"
|
|
28
28
|
]
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../dist/entry-47.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { probeExecutable } from "pi-agent-doctor/api/executable";
|
|
1
|
+
import { isExecutableAvailable, probeExecutable } from "pi-agent-doctor/api/executable";
|
|
2
|
+
|
|
2
3
|
import { DOCTOR_API_VERSION, DOCTOR_PROTOCOL } from "pi-agent-doctor/api/plugin-protocol";
|
|
3
4
|
|
|
4
5
|
import { resolveRipgrepExecutable } from "#src/ripgrep.js";
|
|
@@ -11,6 +12,24 @@ export const textSearchDoctorPlugin: DoctorPlugin = {
|
|
|
11
12
|
apiVersion: DOCTOR_API_VERSION,
|
|
12
13
|
id: "search-text",
|
|
13
14
|
setup(api): void {
|
|
15
|
+
api.addSetupCheck({
|
|
16
|
+
id: "ripgrep",
|
|
17
|
+
async inspect(context) {
|
|
18
|
+
const executable = resolveRipgrepExecutable(context.env.PI_CODING_AGENT_DIR);
|
|
19
|
+
const available = await isExecutableAvailable(executable, context.cwd, context.env);
|
|
20
|
+
return available
|
|
21
|
+
? {}
|
|
22
|
+
: {
|
|
23
|
+
actions: [
|
|
24
|
+
{
|
|
25
|
+
id: "ripgrep-unavailable",
|
|
26
|
+
message: "Local search is unavailable because ripgrep was not found",
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
14
33
|
api.addCheck({
|
|
15
34
|
id: "ripgrep",
|
|
16
35
|
title: "Local search",
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { storeText, restoreText, type StoredText } from "pi-agent-text";
|
|
2
|
+
import type { SearchToolDetails, SearchResultFile, SearchResultRange } from "./search-result.js";
|
|
3
|
+
|
|
4
|
+
type StoredLine = readonly [number, StoredText, readonly SearchResultRange[]];
|
|
5
|
+
interface StoredSearchDetails extends Omit<SearchToolDetails, "files"> {
|
|
6
|
+
readonly storedFiles: readonly (Omit<SearchResultFile, "lines"> & {
|
|
7
|
+
readonly lines: readonly StoredLine[];
|
|
8
|
+
})[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Uses the output without match delimiters as a stable text-reference source. */
|
|
12
|
+
function sourceText(text: string): string {
|
|
13
|
+
return text.replaceAll("⟦", "").replaceAll("⟧", "");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Stores match geometry while sharing line text with the saved tool output. */
|
|
17
|
+
export function compactSearchDetails(
|
|
18
|
+
details: SearchToolDetails,
|
|
19
|
+
text: string,
|
|
20
|
+
): StoredSearchDetails {
|
|
21
|
+
const { files, ...rest } = details;
|
|
22
|
+
const source = sourceText(text);
|
|
23
|
+
return {
|
|
24
|
+
...rest,
|
|
25
|
+
storedFiles: files.map(({ lines, ...file }) => ({
|
|
26
|
+
...file,
|
|
27
|
+
lines: lines.map((line): StoredLine => [
|
|
28
|
+
line.lineNumber,
|
|
29
|
+
storeText(line.text, source),
|
|
30
|
+
line.ranges,
|
|
31
|
+
]),
|
|
32
|
+
})),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Restores renderer data from the result alone, including literal fallback lines. */
|
|
37
|
+
export function restoreSearchDetails(
|
|
38
|
+
value: SearchToolDetails | StoredSearchDetails,
|
|
39
|
+
text: string,
|
|
40
|
+
): SearchToolDetails {
|
|
41
|
+
if ("files" in value) return value;
|
|
42
|
+
const { storedFiles, ...rest } = value;
|
|
43
|
+
const source = sourceText(text);
|
|
44
|
+
return {
|
|
45
|
+
...rest,
|
|
46
|
+
files: storedFiles.map(({ lines, ...file }) => ({
|
|
47
|
+
...file,
|
|
48
|
+
lines: lines.map(([lineNumber, text, ranges]) => ({
|
|
49
|
+
lineNumber,
|
|
50
|
+
text: restoreText(text, source),
|
|
51
|
+
ranges,
|
|
52
|
+
matchCount: ranges.length,
|
|
53
|
+
})),
|
|
54
|
+
})),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
|
|
3
3
|
import { searchFiles } from "#src/file-search.js";
|
|
4
|
-
import {
|
|
5
|
-
import { compileSearchQuery } from "#src/search-query.js";
|
|
4
|
+
import { createSearchRecipe, runSearchRecipe, type SearchRecipe } from "#src/search-recipe.js";
|
|
6
5
|
import { renderSearchResult } from "#src/search-renderer.js";
|
|
7
6
|
import { createSearchToolDetails } from "#src/search-result.js";
|
|
8
7
|
|
|
@@ -17,6 +16,8 @@ interface TextPayload {
|
|
|
17
16
|
readonly request: SearchRequest;
|
|
18
17
|
readonly matches: readonly TextSearchMatch[];
|
|
19
18
|
readonly complete: boolean;
|
|
19
|
+
readonly recipe: SearchRecipe;
|
|
20
|
+
readonly notices: readonly string[];
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
interface FilePayload {
|
|
@@ -25,22 +26,21 @@ interface FilePayload {
|
|
|
25
26
|
readonly complete: boolean;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
/** Search unhandled requests with literal-first hybrid matching. */
|
|
30
30
|
export function createTextResolver(sessions: SearchSessionStore): SearchResolver {
|
|
31
|
-
return createMatchResolver("text", sessions,
|
|
32
|
-
explicitPrefixes.some((prefix) => query.startsWith(prefix))
|
|
33
|
-
? undefined
|
|
34
|
-
: compileSearchQuery(query),
|
|
35
|
-
);
|
|
31
|
+
return createMatchResolver("text", sessions, createSearchRecipe);
|
|
36
32
|
}
|
|
37
33
|
|
|
34
|
+
/** Search an explicit regex without broadening or swallowing syntax errors. */
|
|
38
35
|
export function createRegexResolver(sessions: SearchSessionStore): SearchResolver {
|
|
39
|
-
return createMatchResolver("regex", sessions, (
|
|
40
|
-
query.startsWith("regex:")
|
|
36
|
+
return createMatchResolver("regex", sessions, (request) =>
|
|
37
|
+
request.query.startsWith("regex:")
|
|
38
|
+
? { ...request, query: request.query.slice("regex:".length), regex: true }
|
|
39
|
+
: undefined,
|
|
41
40
|
);
|
|
42
41
|
}
|
|
43
42
|
|
|
43
|
+
/** Resolve file-pattern queries through the local file search backend. */
|
|
44
44
|
export function createFileResolver(): SearchResolver {
|
|
45
45
|
return {
|
|
46
46
|
id: "files",
|
|
@@ -69,29 +69,21 @@ export function createFileResolver(): SearchResolver {
|
|
|
69
69
|
function createMatchResolver(
|
|
70
70
|
id: "text" | "regex",
|
|
71
71
|
sessions: SearchSessionStore,
|
|
72
|
-
queryBody: (
|
|
72
|
+
queryBody: (request: SearchRequest) => SearchRecipe | undefined,
|
|
73
73
|
): SearchResolver {
|
|
74
74
|
return {
|
|
75
75
|
id,
|
|
76
76
|
async tryResolve(request, context) {
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
return { kind: "not-handled" };
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (query.length === 0) {
|
|
84
|
-
return { kind: "failed", error: new Error(`${id} search query must not be empty`) };
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const result = await searchText(
|
|
88
|
-
{ ...request, query, regex: true },
|
|
89
|
-
context.cwd,
|
|
90
|
-
context.signal,
|
|
91
|
-
);
|
|
77
|
+
const recipe = queryBody(request);
|
|
78
|
+
if (recipe === undefined) return { kind: "not-handled" };
|
|
79
|
+
const result = await runSearchRecipe(recipe, context.cwd, context.signal);
|
|
92
80
|
return {
|
|
93
81
|
kind: "resolved",
|
|
94
|
-
payload: {
|
|
82
|
+
payload: {
|
|
83
|
+
request: { ...request, query: result.query },
|
|
84
|
+
...result,
|
|
85
|
+
recipe,
|
|
86
|
+
} satisfies TextPayload,
|
|
95
87
|
};
|
|
96
88
|
},
|
|
97
89
|
async format(payload, context) {
|
|
@@ -99,7 +91,7 @@ function createMatchResolver(
|
|
|
99
91
|
|
|
100
92
|
if (result.matches.length === 0) {
|
|
101
93
|
return {
|
|
102
|
-
content: [{ type: "text", text: "No matches found." }],
|
|
94
|
+
content: [{ type: "text", text: [...result.notices, "No matches found."].join("\n") }],
|
|
103
95
|
details: createSearchToolDetails(result.request.query, [], result.complete, context.cwd),
|
|
104
96
|
};
|
|
105
97
|
}
|
|
@@ -110,9 +102,15 @@ function createMatchResolver(
|
|
|
110
102
|
result.complete,
|
|
111
103
|
context.cwd,
|
|
112
104
|
context.signal,
|
|
105
|
+
result.recipe,
|
|
113
106
|
);
|
|
114
107
|
return {
|
|
115
|
-
content: [
|
|
108
|
+
content: [
|
|
109
|
+
{
|
|
110
|
+
type: "text",
|
|
111
|
+
text: [...result.notices, formatSearchSession(session, context.cwd)].join("\n"),
|
|
112
|
+
},
|
|
113
|
+
],
|
|
116
114
|
details: createSearchToolDetails(
|
|
117
115
|
session.query,
|
|
118
116
|
session.matches,
|
|
@@ -130,7 +128,7 @@ function formatSearchSession(session: TextSearchSession, cwd: string): string {
|
|
|
130
128
|
const fileCount = new Set(session.matches.map((match) => match.source)).size;
|
|
131
129
|
const count = session.matches.length;
|
|
132
130
|
const heading = session.complete
|
|
133
|
-
? `SEARCH#${session.id}:all — ${String(count)} ${plural(count, "match", "matches")} in ${String(fileCount)} ${plural(
|
|
131
|
+
? `SEARCH#${session.id}:all:line / SEARCH#${session.id}:all:match — ${String(count)} ${plural(count, "match", "matches")} in ${String(fileCount)} ${plural(
|
|
134
132
|
fileCount,
|
|
135
133
|
"file",
|
|
136
134
|
"files",
|
|
@@ -139,9 +137,12 @@ function formatSearchSession(session: TextSearchSession, cwd: string): string {
|
|
|
139
137
|
fileCount,
|
|
140
138
|
"file",
|
|
141
139
|
"files",
|
|
142
|
-
)} (limit reached; no all
|
|
143
|
-
const lines = [heading];
|
|
140
|
+
)} (limit reached; no all anchors were registered)`;
|
|
144
141
|
let previousSource: string | undefined;
|
|
142
|
+
const lines = [
|
|
143
|
+
"Anchors: SEARCH#HASH:N:line (line), SEARCH#HASH:N:match (exact match), SEARCH#HASH:all:line (each unique containing line), SEARCH#HASH:all:match (every exact match)",
|
|
144
|
+
heading,
|
|
145
|
+
];
|
|
145
146
|
|
|
146
147
|
for (const [index, match] of session.matches.entries()) {
|
|
147
148
|
if (previousSource !== undefined && previousSource !== match.source) {
|
|
@@ -152,7 +153,7 @@ function formatSearchSession(session: TextSearchSession, cwd: string): string {
|
|
|
152
153
|
lines.push(
|
|
153
154
|
`${source}:${String(match.lineNumber)}:${String(match.startColumn + 1)}-${String(
|
|
154
155
|
match.endColumn + 1,
|
|
155
|
-
)} SEARCH#${session.id}:${String(index + 1)}`,
|
|
156
|
+
)} SEARCH#${session.id}:${String(index + 1)}:line SEARCH#${session.id}:${String(index + 1)}:match`,
|
|
156
157
|
` ${previewMatch(match)}`,
|
|
157
158
|
);
|
|
158
159
|
previousSource = match.source;
|
|
@@ -177,6 +178,7 @@ function previewMatch(match: TextSearchMatch): string {
|
|
|
177
178
|
|
|
178
179
|
function displaySource(source: string, cwd: string): string {
|
|
179
180
|
const relative = path.relative(cwd, source);
|
|
181
|
+
// oxlint-disable-next-line repo/no-parent-paths -- defensive check against traversal, not a traversal
|
|
180
182
|
return relative.length > 0 && !relative.startsWith("..") && !path.isAbsolute(relative)
|
|
181
183
|
? relative
|
|
182
184
|
: source;
|