pi-agent-ide 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/README.md +11 -5
- package/dist/chunk-266RH77Z.js +1 -0
- package/dist/chunk-2SKAED2I.js +2 -0
- package/dist/chunk-2ZMYT6ZC.js +1 -0
- package/dist/chunk-34ZQTTU2.js +2 -0
- package/dist/chunk-3H2EU7VQ.js +0 -0
- package/dist/chunk-3YK4XMWB.js +0 -0
- package/dist/chunk-476MR2QB.js +1 -0
- package/dist/chunk-4KQOODGE.js +13 -0
- package/dist/chunk-4SQQKEVD.js +16 -0
- package/dist/chunk-52BM6J6I.js +6 -0
- package/dist/chunk-5A25RATC.js +3 -0
- package/dist/chunk-5BWUVAR4.js +1 -0
- package/dist/chunk-6DN7NO7L.js +1 -0
- package/dist/chunk-6SMFVLTY.js +1 -0
- package/dist/chunk-7NDBZ4WX.js +1 -0
- package/dist/chunk-AP7Z3VWC.js +1 -0
- package/dist/chunk-BYWAG6X3.js +6 -0
- package/dist/chunk-DEP55R35.js +1 -0
- package/dist/chunk-E2RESHYR.js +1 -0
- package/dist/chunk-E4SECPF4.js +1 -0
- package/dist/chunk-EEH4WYI7.js +1 -0
- package/dist/chunk-EI7MMDWY.js +1 -0
- package/dist/chunk-ERVMDQGX.js +1 -0
- package/dist/chunk-EW2KVKCN.js +2 -0
- package/dist/chunk-F6SESI3P.js +4 -0
- package/dist/chunk-GTK5AREE.js +2 -0
- package/dist/chunk-HOBTFFQR.js +1 -0
- package/dist/chunk-IMVCVPMP.js +3 -0
- package/dist/chunk-IOCABSRL.js +1 -0
- package/dist/chunk-JASLOB2X.js +1 -0
- package/dist/chunk-JMVDFOTQ.js +1 -0
- package/dist/chunk-K4ZMRDEI.js +0 -0
- package/dist/chunk-KINKBPPX.js +1 -0
- package/dist/chunk-KNMWCDDK.js +7 -0
- package/dist/chunk-KP37XTDI.js +1 -0
- package/dist/chunk-KYVOMBO5.js +1 -0
- package/dist/chunk-KZBAJFCV.js +1 -0
- package/dist/chunk-LFV6G5Z3.js +1 -0
- package/dist/chunk-MB6VVVAF.js +2 -0
- package/dist/chunk-MBUXFKIW.js +3 -0
- package/dist/chunk-MTTKFJV6.js +1 -0
- package/dist/chunk-NI2NK4JU.js +1 -0
- package/dist/chunk-NNCZYO4Q.js +0 -0
- package/dist/chunk-OBWZ5RYN.js +1 -0
- package/dist/chunk-OIL6BB2S.js +33 -0
- package/dist/chunk-ORAPGW7W.js +1 -0
- package/dist/chunk-OVUYPHDE.js +1 -0
- package/dist/chunk-PETQCA7G.js +1 -0
- package/dist/chunk-PODWLGNO.js +6 -0
- package/dist/chunk-QNZVPFSP.js +3 -0
- package/dist/chunk-QW5O42QJ.js +2 -0
- package/dist/chunk-SJYDLHEF.js +108 -0
- package/dist/chunk-SSZB66C3.js +3 -0
- package/dist/chunk-STUZZM5B.js +1 -0
- package/dist/chunk-T2RPMEM2.js +1 -0
- package/dist/chunk-TG6H6EOI.js +1 -0
- package/dist/chunk-TNWYEXFG.js +1 -0
- package/dist/chunk-U4D6FT66.js +1 -0
- package/dist/chunk-VCCMVQXU.js +1 -0
- package/dist/chunk-VFBLX4TG.js +1 -0
- package/dist/chunk-VSP2QQPQ.js +2 -0
- package/dist/chunk-VUNCBASK.js +10 -0
- package/dist/chunk-VWVLBOMU.js +8 -0
- package/dist/chunk-W3XYKJ5H.js +1 -0
- package/dist/chunk-XGUAL3CA.js +1 -0
- package/dist/chunk-XNXQYPVT.js +10 -0
- package/dist/chunk-YHUTTZC6.js +2 -0
- package/dist/chunk-YPHXLAQF.js +1 -0
- package/dist/chunk-YQTLJ5ZV.js +58 -0
- package/dist/chunk-ZC65Z3CK.js +1 -0
- package/dist/entry-0.js +1 -0
- package/dist/entry-1.js +1 -0
- package/dist/entry-10.js +1 -0
- package/dist/entry-11.js +1 -0
- package/dist/entry-12.js +1 -0
- package/dist/entry-13.js +1 -0
- package/dist/entry-14.js +1 -0
- package/dist/entry-16.js +1 -0
- package/dist/entry-17.js +1 -0
- package/dist/entry-18.js +1 -0
- package/dist/entry-19.js +1 -0
- package/dist/entry-2.js +1 -0
- package/dist/entry-20.js +1 -0
- package/dist/entry-21.js +1 -0
- package/dist/entry-22.js +1 -0
- package/dist/entry-23.js +1 -0
- package/dist/entry-24.js +1 -0
- package/dist/entry-25.js +1 -0
- package/dist/entry-26.js +1 -0
- package/dist/entry-27.js +1 -0
- package/dist/entry-28.js +1 -0
- package/dist/entry-29.js +1 -0
- package/dist/entry-3.js +1 -0
- package/dist/entry-30.js +1 -0
- package/dist/entry-31.js +1 -0
- package/dist/entry-32.js +1 -0
- package/dist/entry-33.js +1 -0
- package/dist/entry-34.js +1 -0
- package/dist/entry-35.js +1 -0
- package/dist/entry-36.js +1 -0
- package/dist/entry-37.js +1 -0
- package/dist/entry-38.js +1 -0
- package/dist/entry-39.js +1 -0
- package/dist/entry-4.js +1 -0
- package/dist/entry-40.js +1 -0
- package/dist/entry-41.js +1 -0
- package/dist/entry-42.js +1 -0
- package/dist/entry-43.js +1 -0
- package/dist/entry-44.js +1 -0
- package/dist/entry-45.js +1 -0
- package/dist/entry-46.js +1 -0
- package/dist/entry-47.js +1 -0
- package/dist/entry-48.js +1 -0
- package/dist/entry-49.js +1 -0
- package/dist/entry-5.js +1 -0
- package/dist/entry-50.js +1 -0
- package/dist/entry-51.js +1 -0
- package/dist/entry-52.js +1 -0
- package/dist/entry-53.js +0 -0
- package/dist/entry-54.js +1 -0
- package/dist/entry-55.js +0 -0
- package/dist/entry-56.js +1 -0
- package/dist/entry-57.js +1 -0
- package/dist/entry-58.js +1 -0
- package/dist/entry-59.js +1 -0
- package/dist/entry-6.js +1 -0
- package/dist/entry-60.js +1 -0
- package/dist/entry-61.js +1 -0
- package/dist/entry-62.js +0 -0
- package/dist/entry-63.js +1 -0
- package/dist/entry-64.js +0 -0
- package/dist/entry-65.js +1 -0
- package/dist/entry-66.js +1 -0
- package/dist/entry-67.js +1 -0
- package/dist/entry-68.js +1 -0
- package/dist/entry-69.js +1 -0
- package/dist/entry-7.js +1 -0
- package/dist/entry-70.js +1 -0
- package/dist/entry-71.js +1 -0
- package/dist/entry-72.js +1 -0
- package/dist/entry-73.js +1 -0
- package/dist/entry-74.js +1 -0
- package/dist/entry-75.js +1 -0
- package/dist/entry-76.js +1 -0
- package/dist/entry-77.js +1 -0
- package/dist/entry-78.js +1 -0
- package/dist/entry-79.js +1 -0
- package/dist/entry-8.js +1 -0
- package/dist/entry-9.js +1 -0
- package/dist/pi-agent-ide.js +13 -0
- package/docs/architecture.md +21 -17
- package/docs/configuration.md +149 -52
- package/docs/development.md +105 -5
- package/docs/extensions.md +64 -4
- package/docs/generated/tool-catalog/css.md +7 -6
- package/docs/generated/tool-catalog/html.md +6 -5
- package/docs/generated/tool-catalog/javascript.md +8 -6
- package/docs/generated/tool-catalog/json.md +7 -6
- package/docs/generated/tool-catalog/markdown.md +6 -5
- package/docs/generated/tool-catalog/toml.md +6 -5
- package/docs/generated/tool-catalog/typescript.md +8 -6
- package/docs/generated/tool-catalog/yaml.md +6 -5
- package/docs/tools.md +88 -6
- package/node_modules/pi-agent-doctor/package.json +8 -5
- package/node_modules/pi-agent-doctor/runtime/entry-16.js +1 -0
- package/node_modules/pi-agent-doctor/runtime/entry-17.js +1 -0
- package/node_modules/pi-agent-doctor/runtime/entry-18.js +1 -0
- package/node_modules/pi-agent-doctor/runtime/entry-19.js +1 -0
- package/node_modules/pi-agent-doctor/src/executable.ts +33 -0
- package/node_modules/pi-agent-doctor/src/plugin-protocol.ts +30 -4
- package/node_modules/pi-agent-filesystem/index.ts +4 -3
- package/node_modules/pi-agent-filesystem/package.json +7 -7
- package/node_modules/pi-agent-filesystem/runtime/entry-20.js +2 -0
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- package/node_modules/pi-agent-filesystem-image/runtime/entry-21.js +2 -0
- package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
- package/node_modules/pi-agent-filesystem-pdf/runtime/entry-22.js +2 -0
- package/node_modules/pi-agent-filesystem-text/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/runtime/entry-23.js +2 -0
- package/node_modules/pi-agent-ide-ast/package.json +11 -10
- package/node_modules/pi-agent-ide-ast/runtime/entry-24.js +1 -0
- package/node_modules/pi-agent-ide-ast/runtime/entry-25.js +2 -0
- package/node_modules/pi-agent-ide-ast/src/api/scope.ts +1 -1
- package/node_modules/pi-agent-ide-ast/src/ast/outline.ts +1 -1
- package/node_modules/pi-agent-ide-ast/src/doctor-plugin.ts +25 -0
- package/node_modules/pi-agent-ide-ast/src/extension.ts +13 -5
- package/node_modules/pi-agent-ide-ast/src/scope-resolver.ts +6 -0
- package/node_modules/pi-agent-ide-changes/index.ts +6 -2
- package/node_modules/pi-agent-ide-changes/package.json +8 -7
- package/node_modules/pi-agent-ide-changes/runtime/entry-26.js +1 -0
- package/node_modules/pi-agent-ide-changes/runtime/entry-27.js +2 -0
- package/node_modules/pi-agent-ide-changes/src/change-anchor.ts +6 -0
- package/node_modules/pi-agent-ide-changes/src/changes/change-groups.ts +1 -1
- package/node_modules/pi-agent-ide-changes/src/changes/change-service.ts +1 -1
- package/node_modules/pi-agent-ide-changes/src/changes/git-changes-backend.ts +1 -0
- package/node_modules/pi-agent-ide-changes/src/current-change-presenter.ts +1 -1
- package/node_modules/pi-agent-ide-changes/src/doctor-plugin.ts +31 -1
- package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +5 -0
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +7 -0
- package/node_modules/pi-agent-ide-formatter/package.json +4 -4
- package/node_modules/pi-agent-ide-formatter/runtime/entry-28.js +2 -0
- package/node_modules/pi-agent-ide-formatter/src/catalog.ts +34 -0
- package/node_modules/pi-agent-ide-formatter/src/doctor-plugin.ts +115 -63
- package/node_modules/pi-agent-ide-formatter/src/registry.ts +71 -28
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-languages/runtime/entry-29.js +2 -0
- package/node_modules/pi-agent-ide-lint/index.ts +30 -155
- package/node_modules/pi-agent-ide-lint/package.json +8 -7
- package/node_modules/pi-agent-ide-lint/runtime/entry-30.js +2 -0
- package/node_modules/pi-agent-ide-lint/src/catalog.ts +14 -2
- package/node_modules/pi-agent-ide-lint/src/command-linter.ts +60 -4
- package/node_modules/pi-agent-ide-lint/src/diagnostics.ts +3 -1
- package/node_modules/pi-agent-ide-lint/src/doctor-plugin.ts +115 -64
- package/node_modules/pi-agent-ide-lint/src/registry.ts +72 -27
- package/node_modules/pi-agent-ide-lsp/index.ts +35 -134
- package/node_modules/pi-agent-ide-lsp/package.json +9 -8
- package/node_modules/pi-agent-ide-lsp/runtime/entry-31.js +2 -0
- package/node_modules/pi-agent-ide-lsp/src/code-view-resolvers.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/src/diagnostic-source.ts +113 -0
- package/node_modules/pi-agent-ide-lsp/src/doctor-plugin.ts +108 -53
- package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +94 -27
- package/node_modules/pi-agent-ide-lsp/src/lsp/code-views.ts +2 -1
- package/node_modules/pi-agent-ide-lsp/src/lsp/diagnostic-adapters.ts +76 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/diagnostics.ts +137 -144
- package/node_modules/pi-agent-ide-lsp/src/lsp/lsp-compiler.ts +2 -2
- package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +9 -32
- package/node_modules/pi-agent-ide-lsp/src/lsp/registry.ts +86 -50
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +1 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/types.ts +8 -6
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +5 -5
- package/node_modules/pi-agent-image/package.json +3 -3
- package/node_modules/pi-agent-image/runtime/entry-32.js +1 -0
- package/node_modules/pi-agent-invariant/package.json +12 -0
- package/node_modules/pi-agent-invariant/runtime/entry-33.js +1 -0
- package/node_modules/pi-agent-pdf/package.json +3 -3
- package/node_modules/pi-agent-pdf/runtime/entry-34.js +1 -0
- package/node_modules/pi-agent-pdf/src/pdf-converter.ts +3 -2
- package/node_modules/pi-agent-read/package.json +11 -9
- package/node_modules/pi-agent-read/runtime/entry-35.js +1 -0
- package/node_modules/pi-agent-read/runtime/entry-36.js +1 -0
- package/node_modules/pi-agent-read/runtime/entry-37.js +1 -0
- package/node_modules/pi-agent-read/runtime/entry-38.js +1 -0
- package/node_modules/pi-agent-read/runtime/entry-39.js +2 -0
- package/node_modules/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/node_modules/pi-agent-read/src/api/tools/read.ts +113 -2
- package/node_modules/pi-agent-read/src/core/extension.ts +19 -0
- package/node_modules/pi-agent-read/src/core/read-core.ts +85 -13
- package/node_modules/pi-agent-read/src/core/tools/read/output-truncation.ts +26 -10
- package/node_modules/pi-agent-read/src/core/tools/read/persisted-result.ts +72 -0
- package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +102 -12
- package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +27 -3
- package/node_modules/pi-agent-read/src/core/tools/read/views.ts +29 -0
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +532 -46
- package/node_modules/pi-agent-resource/package.json +5 -2
- package/node_modules/pi-agent-resource/runtime/entry-40.js +1 -0
- package/node_modules/pi-agent-resource/src/content-conversion/content-converter.ts +1 -1
- package/node_modules/pi-agent-resource/src/content-conversion/content-host.ts +1 -1
- package/node_modules/pi-agent-resource/src/content-conversion/content-runner.ts +1 -1
- package/node_modules/pi-agent-resource/src/content-conversion/validation.ts +1 -1
- package/node_modules/pi-agent-search/package.json +7 -6
- package/node_modules/pi-agent-search/runtime/entry-41.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-42.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-43.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-44.js +2 -0
- package/node_modules/pi-agent-search/src/api/search.ts +4 -0
- package/node_modules/pi-agent-search/src/core/extension.ts +99 -27
- package/node_modules/pi-agent-search/src/core/search-config.ts +98 -0
- package/node_modules/pi-agent-search/src/core/search-core.ts +32 -28
- package/node_modules/pi-agent-search/src/core/search-timeout.ts +54 -0
- package/node_modules/pi-agent-search-text/index.ts +53 -3
- package/node_modules/pi-agent-search-text/package.json +9 -9
- package/node_modules/pi-agent-search-text/runtime/entry-45.js +2 -0
- package/node_modules/pi-agent-search-text/runtime/entry-46.js +1 -0
- package/node_modules/pi-agent-search-text/src/doctor-plugin.ts +20 -1
- package/node_modules/pi-agent-search-text/src/persisted-result.ts +56 -0
- package/node_modules/pi-agent-search-text/src/resolvers.ts +36 -34
- package/node_modules/pi-agent-search-text/src/search-query.ts +254 -71
- package/node_modules/pi-agent-search-text/src/search-recipe.ts +68 -0
- package/node_modules/pi-agent-search-text/src/search-renderer.ts +71 -117
- package/node_modules/pi-agent-search-text/src/search-result.ts +1 -0
- package/node_modules/pi-agent-search-text/src/search-session.ts +276 -110
- package/node_modules/pi-agent-text/package.json +6 -3
- package/node_modules/pi-agent-text/runtime/entry-47.js +1 -0
- package/node_modules/pi-agent-text/src/index.ts +23 -0
- package/node_modules/pi-agent-text/src/stored-text.ts +14 -0
- package/node_modules/pi-agent-text/src/text-anchor.ts +160 -16
- package/node_modules/pi-agent-text/src/text-document.ts +26 -5
- package/node_modules/pi-agent-text/src/text-target.ts +105 -0
- package/node_modules/pi-agent-text-anchor-constant/package.json +7 -4
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-48.js +2 -0
- package/node_modules/pi-agent-text-anchor-constant/src/resolver.ts +6 -0
- package/node_modules/pi-agent-text-anchor-exact/index.ts +34 -0
- package/node_modules/pi-agent-text-anchor-exact/package.json +27 -0
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-49.js +1 -0
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-50.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/src/anchor.ts +230 -0
- package/node_modules/pi-agent-text-anchor-exact/src/config.ts +159 -0
- package/node_modules/pi-agent-text-anchor-exact/src/fuzzy-worker.ts +100 -0
- package/node_modules/pi-agent-text-anchor-exact/src/recovery.ts +151 -0
- package/node_modules/pi-agent-text-anchor-line-hash/index.ts +8 -2
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +10 -6
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-51.js +1 -0
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-52.js +2 -0
- package/node_modules/pi-agent-text-anchor-line-hash/src/anchor.ts +32 -1
- package/node_modules/pi-agent-text-anchor-line-hash/src/read-handler.ts +20 -12
- package/node_modules/pi-agent-text-editor/package.json +22 -21
- package/node_modules/pi-agent-text-editor/runtime/entry-53.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-54.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-55.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-56.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-57.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-58.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-59.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-60.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-61.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-62.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-63.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-64.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-65.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-66.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-67.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-68.js +2 -0
- package/node_modules/pi-agent-text-editor/src/api/anchor-inspection.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +1 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +38 -0
- package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +30 -15
- package/node_modules/pi-agent-text-editor/src/api/text-selection-anchor.ts +10 -13
- package/node_modules/pi-agent-text-editor/src/api/tool-call-interceptor.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/builtin-edit-filter.ts +12 -5
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +15 -1
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/agent-diff.ts +14 -10
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/diff.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +3 -2
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +19 -2
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +64 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/inline-hints.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/read-fragment-resolver.ts +83 -0
- package/node_modules/pi-agent-text-editor/src/core/text-anchor-registry.ts +96 -8
- package/node_modules/pi-agent-text-editor/src/core/text-change-engine.ts +4 -1
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +194 -35
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +43 -13
- package/node_modules/pi-agent-text-editor/src/core/text-editor-config.ts +95 -0
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +75 -5
- package/node_modules/pi-agent-text-editor/src/core/text-mutation-anchor-error.ts +7 -0
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +541 -130
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +5 -9
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/rendering.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/tools/text-selection.ts +228 -6
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +50 -70
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +25 -26
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +30 -21
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +57 -71
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +30 -27
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +2 -0
- package/node_modules/pi-agent-text-editor-argument-order/package.json +3 -3
- package/node_modules/pi-agent-text-editor-argument-order/runtime/entry-69.js +2 -0
- package/node_modules/pi-agent-text-editor-overwrite/index.ts +1 -1
- package/node_modules/pi-agent-text-editor-overwrite/package.json +4 -3
- package/node_modules/pi-agent-text-editor-overwrite/runtime/entry-70.js +2 -0
- package/node_modules/pi-agent-text-editor-renderer/index.ts +21 -1
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -3
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-71.js +2 -0
- package/node_modules/pi-agent-text-editor-renderer/src/animation-pressure.ts +50 -0
- package/node_modules/pi-agent-text-editor-renderer/src/config.ts +73 -0
- package/node_modules/pi-agent-text-editor-renderer/src/diff-model.ts +1 -1
- package/node_modules/pi-agent-text-editor-renderer/src/diff-renderer.ts +77 -22
- package/node_modules/pi-agent-text-editor-renderer/src/diff-theme.ts +1 -1
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +140 -24
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-projection.ts +274 -43
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-result.ts +33 -6
- package/node_modules/pi-agent-text-editor-renderer/src/persisted-result.ts +47 -0
- package/node_modules/pi-agent-text-editor-renderer/src/render-resource.ts +7 -0
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +265 -105
- package/node_modules/pi-agent-text-editor-renderer/src/typing-interpolation.ts +96 -15
- package/node_modules/pi-agent-text-editor-stale-anchor/index.ts +22 -6
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -4
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-72.js +2 -0
- package/node_modules/pi-agent-tool-call-interception/package.json +5 -2
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-73.js +1 -0
- package/node_modules/pi-agent-tool-call-interception/src/index.ts +175 -32
- package/node_modules/pi-agent-tool-ui/package.json +15 -0
- package/node_modules/pi-agent-tool-ui/runtime/entry-74.js +1 -0
- package/node_modules/pi-agent-tool-ui/src/index.ts +318 -0
- package/node_modules/pi-agent-web/index.ts +16 -6
- package/node_modules/pi-agent-web/package.json +8 -6
- package/node_modules/pi-agent-web/runtime/entry-75.js +2 -0
- package/node_modules/pi-agent-web/src/browser-loader.ts +180 -0
- package/node_modules/pi-agent-web/src/doctor-plugin.ts +41 -0
- package/node_modules/pi-agent-web/src/resolver.ts +128 -24
- package/node_modules/pi-agent-web-html/package.json +6 -3
- package/node_modules/pi-agent-web-html/runtime/entry-76.js +2 -0
- package/node_modules/pi-agent-web-html/src/extract-readable-html.ts +19 -6
- package/node_modules/pi-agent-web-image/package.json +4 -4
- package/node_modules/pi-agent-web-image/runtime/entry-77.js +2 -0
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/runtime/entry-78.js +2 -0
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-79.js +2 -0
- package/package.json +68 -54
- package/src/api/code-view.ts +4 -0
- package/src/api/connect-tip-provider.ts +49 -0
- package/src/api/plugin-protocol.ts +41 -2
- package/src/api/tips.ts +77 -0
- package/src/api/tool-config/formatters.json +215 -0
- package/src/api/tool-config/linters.json +257 -0
- package/src/api/tool-config/lsp-servers.json +275 -0
- package/src/api/tool-config.ts +217 -13
- package/src/api/toolchain.ts +0 -5
- package/src/code-view/diagnostic-view.ts +117 -26
- package/src/code-view/source-view.ts +1 -1
- package/src/composite/builtin-extensions.ts +12 -6
- package/src/composite/extensions-config.ts +137 -0
- package/src/composite/selection.ts +58 -3
- package/src/core/diagnostic-store.ts +244 -0
- package/src/core/extension.ts +40 -0
- package/src/core/ide-core.ts +48 -3
- package/src/doctor/config-writer.ts +1 -1
- package/src/doctor/core.ts +47 -0
- package/src/doctor/discovery.ts +10 -2
- package/src/doctor/extension.ts +12 -1
- package/src/doctor/inventory.ts +24 -6
- package/src/doctor/run.ts +68 -87
- package/src/doctor/tip-provider.ts +92 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +4 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-21.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-22.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-23.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-20.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +16 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +6 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-76.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/src/extract-readable-html.ts +19 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-77.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-78.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-79.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-75.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/browser-loader.ts +180 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/doctor-plugin.ts +41 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/resolver.ts +128 -24
- package/src/extensions/pi-agent-read/package.json +11 -9
- package/src/extensions/pi-agent-read/runtime/entry-35.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-36.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-37.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-38.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-39.js +2 -0
- package/src/extensions/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +113 -2
- package/src/extensions/pi-agent-read/src/core/extension.ts +19 -0
- package/src/extensions/pi-agent-read/src/core/read-core.ts +85 -13
- package/src/extensions/pi-agent-read/src/core/tools/read/output-truncation.ts +26 -10
- package/src/extensions/pi-agent-read/src/core/tools/read/persisted-result.ts +72 -0
- package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +102 -12
- package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +27 -3
- package/src/extensions/pi-agent-read/src/core/tools/read/views.ts +29 -0
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +532 -46
- package/src/extensions/pi-agent-search/package.json +7 -6
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +53 -3
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +9 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-45.js +2 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-46.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/doctor-plugin.ts +20 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/persisted-result.ts +56 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +36 -34
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-query.ts +254 -71
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +68 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +71 -117
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +276 -110
- package/src/extensions/pi-agent-search/runtime/entry-41.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-42.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-43.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-44.js +2 -0
- package/src/extensions/pi-agent-search/src/api/search.ts +4 -0
- package/src/extensions/pi-agent-search/src/core/extension.ts +99 -27
- package/src/extensions/pi-agent-search/src/core/search-config.ts +98 -0
- package/src/extensions/pi-agent-search/src/core/search-core.ts +32 -28
- package/src/extensions/pi-agent-search/src/core/search-timeout.ts +54 -0
- package/src/extensions/pi-agent-text-editor/package.json +22 -21
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +7 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-48.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/src/resolver.ts +6 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.ts +34 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +27 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-49.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-50.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/anchor.ts +230 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/config.ts +159 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/fuzzy-worker.ts +100 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/recovery.ts +151 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +8 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +10 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-51.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-52.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/anchor.ts +32 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/read-handler.ts +20 -12
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/package.json +3 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/runtime/entry-69.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/index.ts +1 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/package.json +4 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/runtime/entry-70.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +21 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-71.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/animation-pressure.ts +50 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/config.ts +73 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-model.ts +1 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-renderer.ts +77 -22
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-theme.ts +1 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +140 -24
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-projection.ts +274 -43
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-result.ts +33 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/persisted-result.ts +47 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/render-resource.ts +7 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +265 -105
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/typing-interpolation.ts +96 -15
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/index.ts +22 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-72.js +2 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-53.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-54.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-55.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-56.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-57.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-58.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-59.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-60.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-61.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-62.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-63.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-64.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-65.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-66.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-67.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-68.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/anchor-inspection.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +1 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +38 -0
- package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +30 -15
- package/src/extensions/pi-agent-text-editor/src/api/text-selection-anchor.ts +10 -13
- package/src/extensions/pi-agent-text-editor/src/api/tool-call-interceptor.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/builtin-edit-filter.ts +12 -5
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +15 -1
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/agent-diff.ts +14 -10
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/diff.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +3 -2
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +19 -2
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +64 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/inline-hints.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/read-fragment-resolver.ts +83 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-anchor-registry.ts +96 -8
- package/src/extensions/pi-agent-text-editor/src/core/text-change-engine.ts +4 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +194 -35
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +43 -13
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-config.ts +95 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +75 -5
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation-anchor-error.ts +7 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +541 -130
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +5 -9
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/rendering.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/tools/text-selection.ts +228 -6
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +50 -70
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +25 -26
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +30 -21
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +57 -71
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +30 -27
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +2 -0
- package/src/pi-agent-ide.ts +15 -3
- package/src/plugins/pi-agent-ide-ast/package.json +11 -10
- package/src/plugins/pi-agent-ide-ast/runtime/entry-24.js +1 -0
- package/src/plugins/pi-agent-ide-ast/runtime/entry-25.js +2 -0
- package/src/plugins/pi-agent-ide-ast/src/api/scope.ts +1 -1
- package/src/plugins/pi-agent-ide-ast/src/ast/outline.ts +1 -1
- package/src/plugins/pi-agent-ide-ast/src/doctor-plugin.ts +25 -0
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +13 -5
- package/src/plugins/pi-agent-ide-ast/src/scope-resolver.ts +6 -0
- package/src/plugins/pi-agent-ide-changes/index.ts +6 -2
- package/src/plugins/pi-agent-ide-changes/package.json +8 -7
- package/src/plugins/pi-agent-ide-changes/runtime/entry-26.js +1 -0
- package/src/plugins/pi-agent-ide-changes/runtime/entry-27.js +2 -0
- package/src/plugins/pi-agent-ide-changes/src/change-anchor.ts +6 -0
- package/src/plugins/pi-agent-ide-changes/src/changes/change-groups.ts +1 -1
- package/src/plugins/pi-agent-ide-changes/src/changes/change-service.ts +1 -1
- package/src/plugins/pi-agent-ide-changes/src/changes/git-changes-backend.ts +1 -0
- package/src/plugins/pi-agent-ide-changes/src/current-change-presenter.ts +1 -1
- package/src/plugins/pi-agent-ide-changes/src/doctor-plugin.ts +31 -1
- package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +5 -0
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +7 -0
- package/src/plugins/pi-agent-ide-diagnostics/index.ts +1 -0
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +191 -0
- package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
- package/src/plugins/pi-agent-ide-formatter/runtime/entry-28.js +2 -0
- package/src/plugins/pi-agent-ide-formatter/src/catalog.ts +34 -0
- package/src/plugins/pi-agent-ide-formatter/src/doctor-plugin.ts +115 -63
- package/src/plugins/pi-agent-ide-formatter/src/registry.ts +71 -28
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-languages/runtime/entry-29.js +2 -0
- package/src/plugins/pi-agent-ide-lint/index.ts +30 -155
- package/src/plugins/pi-agent-ide-lint/package.json +8 -7
- package/src/plugins/pi-agent-ide-lint/runtime/entry-30.js +2 -0
- package/src/plugins/pi-agent-ide-lint/src/catalog.ts +14 -2
- package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +60 -4
- package/src/plugins/pi-agent-ide-lint/src/diagnostics.ts +3 -1
- package/src/plugins/pi-agent-ide-lint/src/doctor-plugin.ts +115 -64
- package/src/plugins/pi-agent-ide-lint/src/registry.ts +72 -27
- package/src/plugins/pi-agent-ide-lsp/index.ts +35 -134
- package/src/plugins/pi-agent-ide-lsp/package.json +9 -8
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-31.js +2 -0
- package/src/plugins/pi-agent-ide-lsp/src/code-view-resolvers.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/src/diagnostic-source.ts +113 -0
- package/src/plugins/pi-agent-ide-lsp/src/doctor-plugin.ts +108 -53
- package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +94 -27
- package/src/plugins/pi-agent-ide-lsp/src/lsp/code-views.ts +2 -1
- package/src/plugins/pi-agent-ide-lsp/src/lsp/diagnostic-adapters.ts +76 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/diagnostics.ts +137 -144
- package/src/plugins/pi-agent-ide-lsp/src/lsp/lsp-compiler.ts +2 -2
- package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +9 -32
- package/src/plugins/pi-agent-ide-lsp/src/lsp/registry.ts +86 -50
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +1 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/types.ts +8 -6
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +5 -5
- package/src/post-edit/gate.ts +17 -141
- package/src/tips/core.ts +86 -0
- package/src/tips/extension.ts +115 -0
- package/src/tips/persistence.ts +225 -0
- package/src/tips/tip-callout.ts +77 -0
- package/src/toolchain/registry.ts +8 -23
- package/src/toolchain/types.ts +6 -74
- package/node_modules/pi-agent-search-semantic/index.ts +0 -97
- package/node_modules/pi-agent-search-semantic/package.json +0 -17
- package/node_modules/pi-agent-search-text/src/lucene-query-parser.d.ts +0 -20
- package/node_modules/pi-agent-search-web/index.ts +0 -82
- package/node_modules/pi-agent-search-web/package.json +0 -20
- package/node_modules/pi-agent-search-web/src/config.ts +0 -560
- package/node_modules/pi-agent-search-web/src/doctor-plugin.ts +0 -40
- package/node_modules/pi-agent-search-web/src/providers/duckduckgo-html.ts +0 -74
- package/node_modules/pi-agent-search-web/src/providers/endpoints.ts +0 -81
- package/node_modules/pi-agent-search-web/src/providers/request.ts +0 -427
- package/node_modules/pi-agent-search-web/src/providers/response.ts +0 -353
- package/node_modules/pi-agent-search-web/src/search-format.ts +0 -24
- package/node_modules/pi-agent-search-web/src/search.ts +0 -376
- package/node_modules/pi-agent-search-web/src/types.ts +0 -141
- package/src/composite/config.ts +0 -100
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-semantic/index.ts +0 -97
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-semantic/package.json +0 -17
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/lucene-query-parser.d.ts +0 -20
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/index.ts +0 -82
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/package.json +0 -20
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/config.ts +0 -560
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/doctor-plugin.ts +0 -40
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/duckduckgo-html.ts +0 -74
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/endpoints.ts +0 -81
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/request.ts +0 -427
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/response.ts +0 -353
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/search-format.ts +0 -24
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/search.ts +0 -376
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/types.ts +0 -141
- package/src/toolchain/gate.ts +0 -305
- /package/{src/utils/required-value.ts → node_modules/pi-agent-invariant/src/index.ts} +0 -0
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import { requiredValue } from "
|
|
1
|
+
import { requiredValue } from "pi-agent-invariant";
|
|
2
2
|
import { Text } from "@earendil-works/pi-tui";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
TOOL_CALL_INTERCEPTION_ANCHOR_RENDER_PATCH,
|
|
6
|
+
type ToolCallAnchorRenderPatch,
|
|
7
|
+
} from "pi-agent-tool-call-interception";
|
|
8
|
+
import { singleLine, type ToolCallHeaderDetail } from "pi-agent-tool-ui";
|
|
9
|
+
import { NEXT_TOOL_CALL_DRAIN_MS, type MutationAnimationPressure } from "./animation-pressure.js";
|
|
10
|
+
import { loadRendererConfig } from "./config.js";
|
|
5
11
|
import { freezeMutationViewports, type FrozenMutationViewports } from "./frozen-viewport.js";
|
|
6
12
|
import { MutationPanel } from "./mutation-panel.js";
|
|
7
13
|
import {
|
|
8
14
|
advanceTypingProjectionResources,
|
|
9
15
|
extendTypingPreviewResources,
|
|
16
|
+
preserveCompletedTypingRows,
|
|
10
17
|
projectTypingResources,
|
|
11
18
|
} from "./mutation-projection.js";
|
|
12
19
|
import { resolveMutationResultResources } from "./mutation-result.js";
|
|
@@ -24,6 +31,9 @@ type MutationRenderOutcome =
|
|
|
24
31
|
| { readonly kind: "completed"; readonly resources: readonly MutationRenderResource[] }
|
|
25
32
|
| { readonly kind: "failed"; readonly reason: string };
|
|
26
33
|
|
|
34
|
+
const NO_TOOL_CALL_DETAILS: readonly ToolCallHeaderDetail[] = [];
|
|
35
|
+
const MAX_EXPANDED_ARGUMENT_CHARS = 120;
|
|
36
|
+
|
|
27
37
|
interface PreviewRequest {
|
|
28
38
|
readonly identity: string;
|
|
29
39
|
readonly input: Readonly<Record<string, unknown>>;
|
|
@@ -52,8 +62,12 @@ interface RenderState {
|
|
|
52
62
|
preview?: MutationRenderOutcome;
|
|
53
63
|
viewports?: FrozenMutationViewports;
|
|
54
64
|
panel?: MutationPanel;
|
|
65
|
+
|
|
66
|
+
stableHeader?: { readonly value: string; readonly expanded: boolean };
|
|
55
67
|
input?: Readonly<Record<string, unknown>>;
|
|
56
68
|
theme?: Theme;
|
|
69
|
+
cwd?: string;
|
|
70
|
+
expanded?: boolean;
|
|
57
71
|
invalidate?: () => void;
|
|
58
72
|
latestGenerated?: string;
|
|
59
73
|
typing?: TypingInterpolation;
|
|
@@ -61,28 +75,38 @@ interface RenderState {
|
|
|
61
75
|
queuedPreview?: PreviewRequest;
|
|
62
76
|
previewRunning?: boolean;
|
|
63
77
|
timer?: ReturnType<typeof setInterval>;
|
|
78
|
+
|
|
64
79
|
displayedResources?: readonly MutationRenderResource[];
|
|
65
80
|
displayedText?: string;
|
|
81
|
+
[TOOL_CALL_INTERCEPTION_ANCHOR_RENDER_PATCH]?: ToolCallAnchorRenderPatch;
|
|
82
|
+
|
|
66
83
|
pendingResult?: PendingResult;
|
|
84
|
+
releaseAnimationPressure?: () => void;
|
|
67
85
|
}
|
|
68
86
|
|
|
69
|
-
|
|
87
|
+
/** Register mutation renderers with optional model-stream animation pressure. */
|
|
88
|
+
export function registerMutationRenderers(
|
|
89
|
+
api: TextEditorPluginApi,
|
|
90
|
+
animationPressure?: MutationAnimationPressure,
|
|
91
|
+
): void {
|
|
70
92
|
api.onMutationTool((registration) => {
|
|
71
|
-
api.addToolRenderer(createRenderer(api, registration));
|
|
93
|
+
api.addToolRenderer(createRenderer(api, registration, animationPressure));
|
|
72
94
|
});
|
|
73
95
|
}
|
|
74
96
|
|
|
75
97
|
function createRenderer(
|
|
76
98
|
api: TextEditorPluginApi,
|
|
77
99
|
registration: AnyTextMutationToolRegistration,
|
|
100
|
+
animationPressure?: MutationAnimationPressure,
|
|
78
101
|
): TextEditorToolRendererRegistration {
|
|
79
102
|
const tool = registration.name;
|
|
80
103
|
|
|
81
104
|
return {
|
|
82
105
|
tool,
|
|
83
106
|
fallback: true,
|
|
107
|
+
...(tool === "write" && { renderShell: "self" as const }),
|
|
84
108
|
renderCall(arguments_, theme, context) {
|
|
85
|
-
const component = panel(context.lastComponent, theme);
|
|
109
|
+
const component = panel(context.lastComponent, theme, tool === "write");
|
|
86
110
|
const input = asInput(arguments_);
|
|
87
111
|
const state = context.state as RenderState;
|
|
88
112
|
state.registration = registration;
|
|
@@ -91,11 +115,43 @@ function createRenderer(
|
|
|
91
115
|
state.input = input;
|
|
92
116
|
state.theme = theme;
|
|
93
117
|
state.invalidate = context.invalidate;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
118
|
+
// renderCall runs on every frame, so reapply the project's viewport policy each time.
|
|
119
|
+
state.cwd = context.cwd;
|
|
120
|
+
component.setExpanded(context.expanded || preferFullDiff(context.cwd));
|
|
121
|
+
state.expanded = context.expanded;
|
|
122
|
+
|
|
123
|
+
component.setResourceLabelsVisible(
|
|
124
|
+
stringValue(input[registration.source.field]) === undefined,
|
|
125
|
+
);
|
|
126
|
+
component.setBackground(context.isError ? "toolErrorBg" : "toolPendingBg");
|
|
127
|
+
|
|
128
|
+
const generated = generatedText(tool, input);
|
|
129
|
+
const renderedHeader = renderHeader(
|
|
130
|
+
registration,
|
|
131
|
+
input,
|
|
132
|
+
state.preview,
|
|
133
|
+
theme,
|
|
134
|
+
state[TOOL_CALL_INTERCEPTION_ANCHOR_RENDER_PATCH],
|
|
135
|
+
context.expanded,
|
|
136
|
+
);
|
|
137
|
+
const sourceReady =
|
|
138
|
+
stringValue(input[registration.source.field]) !== undefined ||
|
|
139
|
+
state.preview?.kind === "completed";
|
|
140
|
+
const argumentsReady =
|
|
141
|
+
generatedField(tool) === undefined ? context.argsComplete : generated !== undefined;
|
|
142
|
+
const canFreezeHeader = sourceReady && argumentsReady;
|
|
143
|
+
const stableHeader =
|
|
144
|
+
state.stableHeader?.expanded === context.expanded
|
|
145
|
+
? state.stableHeader
|
|
146
|
+
: { value: renderedHeader, expanded: context.expanded };
|
|
147
|
+
if (canFreezeHeader) {
|
|
148
|
+
state.stableHeader = stableHeader;
|
|
149
|
+
}
|
|
150
|
+
component.setHeader(
|
|
151
|
+
canFreezeHeader ? stableHeader.value : renderedHeader,
|
|
152
|
+
mutationCallDetails(registration.name, input, context.expanded),
|
|
153
|
+
context.expanded,
|
|
97
154
|
);
|
|
98
|
-
component.setHeader(renderHeader(registration, input, state.preview, theme));
|
|
99
155
|
|
|
100
156
|
if (!context.isPartial && !context.argsComplete) {
|
|
101
157
|
disposeRenderState(state);
|
|
@@ -104,15 +160,19 @@ function createRenderer(
|
|
|
104
160
|
|
|
105
161
|
const isArgumentsComplete = context.argsComplete;
|
|
106
162
|
const key = `${isArgumentsComplete ? "complete" : "typing"}:${JSON.stringify(input)}`;
|
|
107
|
-
const generated = generatedText(tool, input);
|
|
108
163
|
|
|
109
164
|
if (generated !== undefined) {
|
|
110
165
|
const typing = (state.typing ??= new TypingInterpolation());
|
|
166
|
+
|
|
167
|
+
state.releaseAnimationPressure ??= animationPressure?.track(context.toolCallId, () => {
|
|
168
|
+
state.typing?.finish(performance.now(), NEXT_TOOL_CALL_DRAIN_MS);
|
|
169
|
+
ensureTypingTimer(state);
|
|
170
|
+
});
|
|
111
171
|
typing.observe(generated, now);
|
|
112
172
|
state.latestGenerated = generated;
|
|
113
173
|
|
|
114
174
|
if (isArgumentsComplete) {
|
|
115
|
-
typing.finish();
|
|
175
|
+
typing.finish(now);
|
|
116
176
|
}
|
|
117
177
|
|
|
118
178
|
if (state.key !== key && generated.length > 0) {
|
|
@@ -143,9 +203,14 @@ function createRenderer(
|
|
|
143
203
|
state.registration = registration;
|
|
144
204
|
const viewports = state.viewports;
|
|
145
205
|
state.theme = theme;
|
|
206
|
+
state.cwd = context.cwd;
|
|
146
207
|
state.invalidate = context.invalidate;
|
|
208
|
+
|
|
209
|
+
state.expanded = options.expanded;
|
|
210
|
+
|
|
211
|
+
state.panel?.setBackground(context.isError ? "toolErrorBg" : "toolSuccessBg");
|
|
147
212
|
cancelPreviewWorker(state);
|
|
148
|
-
const resources = resolveMutationResultResources(result.details, viewports);
|
|
213
|
+
const resources = resolveMutationResultResources(result.details, viewports, false);
|
|
149
214
|
|
|
150
215
|
if (!context.isError && resources.length > 0) {
|
|
151
216
|
const typing = state.typing;
|
|
@@ -155,20 +220,39 @@ function createRenderer(
|
|
|
155
220
|
state.latestGenerated === state.target.generated;
|
|
156
221
|
|
|
157
222
|
if (canFinishTyping && !typing.caughtUp) {
|
|
158
|
-
typing.finish();
|
|
223
|
+
typing.finish(performance.now());
|
|
159
224
|
state.pendingResult = { details: result.details, expanded: options.expanded, theme };
|
|
160
225
|
ensureTypingTimer(state);
|
|
161
226
|
return new Text("", 0, 0);
|
|
162
227
|
}
|
|
163
228
|
|
|
164
|
-
applyResultResources(
|
|
229
|
+
applyResultResources(
|
|
230
|
+
state,
|
|
231
|
+
resolveMutationResultResources(
|
|
232
|
+
result.details,
|
|
233
|
+
registration.name === "write" ? undefined : viewports,
|
|
234
|
+
),
|
|
235
|
+
options.expanded,
|
|
236
|
+
theme,
|
|
237
|
+
);
|
|
165
238
|
return new Text("", 0, 0);
|
|
166
239
|
}
|
|
167
240
|
|
|
168
241
|
clearTypingRuntime(state);
|
|
169
242
|
delete state.preview;
|
|
170
243
|
delete state.viewports;
|
|
171
|
-
state.panel?.setHeader(
|
|
244
|
+
state.panel?.setHeader(
|
|
245
|
+
renderHeader(
|
|
246
|
+
registration,
|
|
247
|
+
state.input ?? {},
|
|
248
|
+
undefined,
|
|
249
|
+
theme,
|
|
250
|
+
state[TOOL_CALL_INTERCEPTION_ANCHOR_RENDER_PATCH],
|
|
251
|
+
options.expanded,
|
|
252
|
+
),
|
|
253
|
+
mutationCallDetails(registration.name, state.input ?? {}, options.expanded),
|
|
254
|
+
options.expanded,
|
|
255
|
+
);
|
|
172
256
|
state.panel?.setPreviewResources([]);
|
|
173
257
|
|
|
174
258
|
const output = result.content
|
|
@@ -177,8 +261,11 @@ function createRenderer(
|
|
|
177
261
|
)
|
|
178
262
|
.map((item) => item.text)
|
|
179
263
|
.join("\n");
|
|
264
|
+
const displayedOutput = context.isError ? userFacingFailure(output) : output;
|
|
180
265
|
return new Text(
|
|
181
|
-
|
|
266
|
+
displayedOutput.length === 0
|
|
267
|
+
? ""
|
|
268
|
+
: theme.fg(context.isError ? "error" : "toolOutput", displayedOutput),
|
|
182
269
|
0,
|
|
183
270
|
0,
|
|
184
271
|
);
|
|
@@ -186,8 +273,21 @@ function createRenderer(
|
|
|
186
273
|
};
|
|
187
274
|
}
|
|
188
275
|
|
|
189
|
-
|
|
190
|
-
|
|
276
|
+
const diffViewCache = new Map<string, boolean>();
|
|
277
|
+
|
|
278
|
+
/** Returns whether diffs should render fully by default for the given project. */
|
|
279
|
+
function preferFullDiff(cwd: string): boolean {
|
|
280
|
+
let preferFull = diffViewCache.get(cwd);
|
|
281
|
+
if (preferFull === undefined) {
|
|
282
|
+
preferFull = loadRendererConfig(cwd).diffView === "full";
|
|
283
|
+
diffViewCache.set(cwd, preferFull);
|
|
284
|
+
}
|
|
285
|
+
return preferFull;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
function panel(previous: unknown, theme: Theme, ownsShell: boolean): MutationPanel {
|
|
289
|
+
const component =
|
|
290
|
+
previous instanceof MutationPanel ? previous : new MutationPanel(theme, ownsShell);
|
|
191
291
|
component.setTheme(theme);
|
|
192
292
|
return component;
|
|
193
293
|
}
|
|
@@ -238,17 +338,21 @@ function queuePreview(
|
|
|
238
338
|
const epoch = state.epoch ?? 0;
|
|
239
339
|
state.epoch = epoch;
|
|
240
340
|
state.previewRunning = true;
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
341
|
+
// Restored rows receive their saved result synchronously. Let that result cancel
|
|
342
|
+
// the preview before it can inspect today's file contents.
|
|
343
|
+
void Promise.resolve()
|
|
344
|
+
.then(() => runPreviewWorker(state, api, tool, epoch))
|
|
345
|
+
.finally(() => {
|
|
346
|
+
if (state.epoch !== epoch) {
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
245
349
|
|
|
246
|
-
|
|
350
|
+
state.previewRunning = false;
|
|
247
351
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
352
|
+
if (state.queuedPreview !== undefined) {
|
|
353
|
+
queuePreview(state, state.queuedPreview, api, tool);
|
|
354
|
+
}
|
|
355
|
+
});
|
|
252
356
|
}
|
|
253
357
|
|
|
254
358
|
async function runPreviewWorker(
|
|
@@ -346,15 +450,24 @@ function showPreviewFailure(state: RenderState, reason: string): void {
|
|
|
346
450
|
|
|
347
451
|
if (state.panel !== undefined && state.theme !== undefined) {
|
|
348
452
|
state.panel.setHeader(
|
|
349
|
-
|
|
453
|
+
state.stableHeader?.value ??
|
|
454
|
+
renderHeader(
|
|
455
|
+
state.registration,
|
|
456
|
+
state.input ?? {},
|
|
457
|
+
preview,
|
|
458
|
+
state.theme,
|
|
459
|
+
state[TOOL_CALL_INTERCEPTION_ANCHOR_RENDER_PATCH],
|
|
460
|
+
state.expanded ?? false,
|
|
461
|
+
),
|
|
462
|
+
mutationCallDetails(state.registration.name, state.input ?? {}, state.expanded ?? false),
|
|
463
|
+
state.expanded ?? false,
|
|
350
464
|
);
|
|
351
465
|
}
|
|
352
|
-
|
|
353
466
|
invalidateState(state);
|
|
354
467
|
}
|
|
355
468
|
|
|
356
469
|
function ensureTypingTimer(state: RenderState): void {
|
|
357
|
-
if (state.timer !== undefined || state.
|
|
470
|
+
if (state.timer !== undefined || state.panel === undefined) {
|
|
358
471
|
return;
|
|
359
472
|
}
|
|
360
473
|
|
|
@@ -412,7 +525,11 @@ function updateTypingPanel(state: RenderState): boolean {
|
|
|
412
525
|
visibleText,
|
|
413
526
|
);
|
|
414
527
|
const resources =
|
|
415
|
-
advanced ??
|
|
528
|
+
advanced ??
|
|
529
|
+
preserveCompletedTypingRows(
|
|
530
|
+
state.displayedResources ?? [],
|
|
531
|
+
projectTypingResources(target.resources, target.generated, visibleText),
|
|
532
|
+
);
|
|
416
533
|
state.displayedResources = resources;
|
|
417
534
|
state.displayedText = visibleText;
|
|
418
535
|
const preview = { kind: "completed", resources } as const;
|
|
@@ -420,7 +537,21 @@ function updateTypingPanel(state: RenderState): boolean {
|
|
|
420
537
|
state.viewports = freezeMutationViewports(resources);
|
|
421
538
|
component.setPreviewResources(resources);
|
|
422
539
|
component.setHeader(
|
|
423
|
-
|
|
540
|
+
state.stableHeader?.value ??
|
|
541
|
+
renderHeader(
|
|
542
|
+
state.registration,
|
|
543
|
+
state.input ?? target.input,
|
|
544
|
+
preview,
|
|
545
|
+
theme,
|
|
546
|
+
state[TOOL_CALL_INTERCEPTION_ANCHOR_RENDER_PATCH],
|
|
547
|
+
state.expanded ?? false,
|
|
548
|
+
),
|
|
549
|
+
mutationCallDetails(
|
|
550
|
+
state.registration.name,
|
|
551
|
+
state.input ?? target.input,
|
|
552
|
+
state.expanded ?? false,
|
|
553
|
+
),
|
|
554
|
+
state.expanded ?? false,
|
|
424
555
|
);
|
|
425
556
|
return true;
|
|
426
557
|
}
|
|
@@ -432,7 +563,7 @@ function finishPendingResult(state: RenderState): boolean {
|
|
|
432
563
|
return false;
|
|
433
564
|
}
|
|
434
565
|
|
|
435
|
-
const resources = resolveMutationResultResources(pending.details,
|
|
566
|
+
const resources = resolveMutationResultResources(pending.details, undefined);
|
|
436
567
|
delete state.pendingResult;
|
|
437
568
|
|
|
438
569
|
if (resources.length === 0) {
|
|
@@ -450,11 +581,24 @@ function applyResultResources(
|
|
|
450
581
|
expanded: boolean,
|
|
451
582
|
theme: Theme,
|
|
452
583
|
): void {
|
|
453
|
-
const
|
|
584
|
+
const stableResources = preserveCompletedTypingRows(state.displayedResources ?? [], resources);
|
|
585
|
+
const preview = { kind: "completed", resources: stableResources } as const;
|
|
454
586
|
state.preview = preview;
|
|
455
|
-
state.panel?.setHeader(
|
|
456
|
-
|
|
457
|
-
|
|
587
|
+
state.panel?.setHeader(
|
|
588
|
+
state.stableHeader?.value ??
|
|
589
|
+
renderHeader(
|
|
590
|
+
state.registration,
|
|
591
|
+
state.input ?? {},
|
|
592
|
+
preview,
|
|
593
|
+
theme,
|
|
594
|
+
state[TOOL_CALL_INTERCEPTION_ANCHOR_RENDER_PATCH],
|
|
595
|
+
expanded,
|
|
596
|
+
),
|
|
597
|
+
mutationCallDetails(state.registration.name, state.input ?? {}, expanded),
|
|
598
|
+
expanded,
|
|
599
|
+
);
|
|
600
|
+
state.panel?.setResultResources(stableResources);
|
|
601
|
+
state.panel?.setExpanded(expanded || preferFullDiff(state.cwd ?? process.cwd()));
|
|
458
602
|
clearTypingRuntime(state);
|
|
459
603
|
}
|
|
460
604
|
|
|
@@ -472,7 +616,11 @@ function clearTypingRuntime(state: RenderState): void {
|
|
|
472
616
|
delete state.timer;
|
|
473
617
|
}
|
|
474
618
|
|
|
619
|
+
delete state.stableHeader;
|
|
475
620
|
delete state.typing;
|
|
621
|
+
|
|
622
|
+
state.releaseAnimationPressure?.();
|
|
623
|
+
delete state.releaseAnimationPressure;
|
|
476
624
|
delete state.target;
|
|
477
625
|
delete state.latestGenerated;
|
|
478
626
|
delete state.displayedResources;
|
|
@@ -529,11 +677,36 @@ function asInput(value: unknown): Readonly<Record<string, unknown>> {
|
|
|
529
677
|
: {};
|
|
530
678
|
}
|
|
531
679
|
|
|
680
|
+
function mutationCallDetails(
|
|
681
|
+
tool: string,
|
|
682
|
+
input: Readonly<Record<string, unknown>>,
|
|
683
|
+
expanded: boolean,
|
|
684
|
+
): readonly ToolCallHeaderDetail[] {
|
|
685
|
+
if (!expanded) {
|
|
686
|
+
return NO_TOOL_CALL_DETAILS;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
const generated = generatedField(tool);
|
|
690
|
+
return Object.entries(input).map(([label, value]) => {
|
|
691
|
+
const encoded = typeof value === "string" ? value : JSON.stringify(value);
|
|
692
|
+
const exact = typeof encoded === "string" ? encoded : String(value);
|
|
693
|
+
return {
|
|
694
|
+
label,
|
|
695
|
+
value:
|
|
696
|
+
exact.length > MAX_EXPANDED_ARGUMENT_CHARS
|
|
697
|
+
? `${exact.slice(0, MAX_EXPANDED_ARGUMENT_CHARS)}… (${String(exact.length)} chars${label === generated ? "; full value shown in diff" : ""})`
|
|
698
|
+
: exact,
|
|
699
|
+
};
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
|
|
532
703
|
function renderHeader(
|
|
533
704
|
registration: AnyTextMutationToolRegistration,
|
|
534
705
|
input: Readonly<Record<string, unknown>>,
|
|
535
706
|
preview: MutationRenderOutcome | undefined,
|
|
536
707
|
theme: Theme,
|
|
708
|
+
anchorRenderPatch: ToolCallAnchorRenderPatch | undefined,
|
|
709
|
+
expanded: boolean,
|
|
537
710
|
): string {
|
|
538
711
|
const source = registration.source;
|
|
539
712
|
const path = stringValue(input[source.field]);
|
|
@@ -555,22 +728,22 @@ function renderHeader(
|
|
|
555
728
|
(target): target is { readonly field: string; readonly path: string } =>
|
|
556
729
|
target.path !== undefined && target.path !== path,
|
|
557
730
|
);
|
|
558
|
-
const sourceFallback = targets.length === 0 ? 0 : undefined;
|
|
559
731
|
let header = `${theme.fg("toolTitle", theme.bold(registration.name))} ${renderPath(
|
|
560
732
|
displayedPath,
|
|
561
733
|
sourceLink,
|
|
562
734
|
theme,
|
|
563
|
-
)}${renderAnchorRange(registration, source.field, input, theme)}
|
|
564
|
-
preview,
|
|
565
|
-
path,
|
|
566
|
-
theme,
|
|
567
|
-
sourceFallback,
|
|
568
|
-
)}`;
|
|
735
|
+
)}${renderAnchorRange(registration, source.field, input, anchorRenderPatch, theme, expanded)}`;
|
|
569
736
|
|
|
570
737
|
for (const target of targets) {
|
|
571
738
|
header += ` ${theme.fg("muted", "->")} ${renderPath(target.path, resourceLink(preview, target.path), theme)}`;
|
|
572
|
-
header += renderAnchorRange(
|
|
573
|
-
|
|
739
|
+
header += renderAnchorRange(
|
|
740
|
+
registration,
|
|
741
|
+
target.field,
|
|
742
|
+
input,
|
|
743
|
+
anchorRenderPatch,
|
|
744
|
+
theme,
|
|
745
|
+
expanded,
|
|
746
|
+
);
|
|
574
747
|
}
|
|
575
748
|
|
|
576
749
|
return header;
|
|
@@ -580,7 +753,9 @@ function renderAnchorRange(
|
|
|
580
753
|
registration: AnyTextMutationToolRegistration,
|
|
581
754
|
sourceField: string,
|
|
582
755
|
input: Readonly<Record<string, unknown>>,
|
|
756
|
+
anchorRenderPatch: ToolCallAnchorRenderPatch | undefined,
|
|
583
757
|
theme: Theme,
|
|
758
|
+
expanded: boolean,
|
|
584
759
|
): string {
|
|
585
760
|
const anchors = (registration.anchors ?? []).filter(
|
|
586
761
|
(anchor) => anchor.sourceField === sourceField,
|
|
@@ -589,15 +764,25 @@ function renderAnchorRange(
|
|
|
589
764
|
sourceField === registration.source.field && registration.pair !== undefined
|
|
590
765
|
? registration.pair
|
|
591
766
|
: anchors.slice(0, 2).map(({ field }) => field);
|
|
592
|
-
const
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
767
|
+
const renderField = (field: string | undefined): string | undefined => {
|
|
768
|
+
if (field === undefined) {
|
|
769
|
+
return undefined;
|
|
770
|
+
}
|
|
771
|
+
const state = anchorRenderPatch?.[field];
|
|
772
|
+
if (state?.kind === "resolved") {
|
|
773
|
+
return singleLine(expanded ? state.full : state.compact);
|
|
774
|
+
}
|
|
775
|
+
if (state?.kind === "failed") {
|
|
776
|
+
return "selected range";
|
|
777
|
+
}
|
|
778
|
+
const raw = stringValue(input[field]);
|
|
779
|
+
if (raw === undefined) {
|
|
780
|
+
return undefined;
|
|
781
|
+
}
|
|
782
|
+
return expanded ? singleLine(raw) : "selected range";
|
|
783
|
+
};
|
|
784
|
+
return range(renderField(fields.at(0)), renderField(fields.at(1)), theme);
|
|
599
785
|
}
|
|
600
|
-
|
|
601
786
|
function resourceLink(
|
|
602
787
|
preview: MutationRenderOutcome | undefined,
|
|
603
788
|
path: string | undefined,
|
|
@@ -607,56 +792,6 @@ function resourceLink(
|
|
|
607
792
|
: undefined;
|
|
608
793
|
}
|
|
609
794
|
|
|
610
|
-
function renderStats(
|
|
611
|
-
preview: MutationRenderOutcome | undefined,
|
|
612
|
-
path: string | undefined,
|
|
613
|
-
theme: Theme,
|
|
614
|
-
fallbackIndex?: number,
|
|
615
|
-
): string {
|
|
616
|
-
if (preview?.kind !== "completed") {
|
|
617
|
-
return "";
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
if (path === undefined) {
|
|
621
|
-
const totals = { added: 0, modified: 0, removed: 0 };
|
|
622
|
-
|
|
623
|
-
for (const resource of preview.resources) {
|
|
624
|
-
const model =
|
|
625
|
-
resource.model ??
|
|
626
|
-
createDiffModel(resource.beforeContent, resource.afterContent, resource.ranges);
|
|
627
|
-
totals.added += model.added;
|
|
628
|
-
totals.modified += model.modified;
|
|
629
|
-
totals.removed += model.removed;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
return renderStatCounts(totals, theme);
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
const resource =
|
|
636
|
-
preview.resources.find(
|
|
637
|
-
(candidate) => candidate.path === path || candidate.path.endsWith(`/${path}`),
|
|
638
|
-
) ?? (fallbackIndex === undefined ? undefined : preview.resources[fallbackIndex]);
|
|
639
|
-
|
|
640
|
-
if (resource === undefined) {
|
|
641
|
-
return renderStatCounts({ added: 0, modified: 0, removed: 0 }, theme);
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
const model =
|
|
645
|
-
resource.model ??
|
|
646
|
-
createDiffModel(resource.beforeContent, resource.afterContent, resource.ranges);
|
|
647
|
-
return renderStatCounts(model, theme);
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
function renderStatCounts(
|
|
651
|
-
counts: { readonly added: number; readonly modified: number; readonly removed: number },
|
|
652
|
-
theme: Theme,
|
|
653
|
-
): string {
|
|
654
|
-
return ` ${theme.fg("success", `+${counts.added}`)} ${theme.fg("warning", `~${counts.modified}`)} ${theme.fg(
|
|
655
|
-
"error",
|
|
656
|
-
`-${counts.removed}`,
|
|
657
|
-
)}`;
|
|
658
|
-
}
|
|
659
|
-
|
|
660
795
|
function renderPath(path: string, link: string | undefined, theme: Theme): string {
|
|
661
796
|
if (path.length === 0) {
|
|
662
797
|
return theme.fg("muted", "...");
|
|
@@ -673,7 +808,32 @@ function range(start: string | undefined, end: string | undefined, theme: Theme)
|
|
|
673
808
|
return "";
|
|
674
809
|
}
|
|
675
810
|
|
|
676
|
-
|
|
811
|
+
const value = end === undefined ? start : semanticRange(start, end);
|
|
812
|
+
return `${theme.fg("dim", " · ")}${theme.fg("warning", value)}`;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
function semanticRange(start: string, end: string): string {
|
|
816
|
+
const startLine = /^line (\d+)$/u.exec(start)?.[1];
|
|
817
|
+
const endLine = /^line (\d+)$/u.exec(end)?.[1];
|
|
818
|
+
return startLine !== undefined && endLine !== undefined
|
|
819
|
+
? `lines ${startLine}–${endLine}`
|
|
820
|
+
: `${start}–${end}`;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
function userFacingFailure(agentOutput: string): string {
|
|
824
|
+
if (/\banchor\b[\s\S]*\bis ambiguous\./iu.test(agentOutput)) {
|
|
825
|
+
return "Not changed · selection is ambiguous";
|
|
826
|
+
}
|
|
827
|
+
if (/\banchor\b[\s\S]*\bis stale\./iu.test(agentOutput)) {
|
|
828
|
+
return "Not changed · selection is out of date";
|
|
829
|
+
}
|
|
830
|
+
if (/\banchor\b[\s\S]*\bwas not found\./iu.test(agentOutput)) {
|
|
831
|
+
return "Not changed · selected text was not found";
|
|
832
|
+
}
|
|
833
|
+
if (/\banchor\b[\s\S]*\bis invalid\./iu.test(agentOutput)) {
|
|
834
|
+
return "Not changed · selection is invalid";
|
|
835
|
+
}
|
|
836
|
+
return "Not changed · edit failed";
|
|
677
837
|
}
|
|
678
838
|
|
|
679
839
|
function stringValue(value: unknown): string | undefined {
|