pi-agent-ide 0.9.4 → 0.9.6
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 +38 -0
- package/README.md +1 -1
- package/dist/{chunk-ZXO4D5UB.js → chunk-2AANEKFS.js} +1 -1
- package/dist/{chunk-BU7IZLKB.js → chunk-2DSY4U73.js} +1 -1
- package/dist/chunk-2YO6RVX4.js +1 -0
- package/dist/{chunk-WES2E4VR.js → chunk-33U3RUM3.js} +1 -1
- package/dist/{chunk-CJPS4GXD.js → chunk-34IYWKY5.js} +1 -1
- package/dist/{chunk-2TTSJOLO.js → chunk-4CSNQX54.js} +1 -1
- package/dist/{chunk-DAZQSXUW.js → chunk-53IV6EKV.js} +1 -1
- package/dist/{chunk-7PVDTMEM.js → chunk-5AROEOJB.js} +1 -1
- package/dist/{chunk-IG5DXVDJ.js → chunk-5D4C225L.js} +1 -1
- package/dist/{chunk-GHO6TCPJ.js → chunk-5DN2XBVI.js} +1 -1
- package/dist/{chunk-FHRHYY4M.js → chunk-5W6QQZFI.js} +1 -1
- package/dist/{chunk-5PC5INOL.js → chunk-6W4OJLCJ.js} +1 -1
- package/dist/chunk-6ZYCTWQE.js +1 -0
- package/dist/{chunk-B25LXXNV.js → chunk-72FL5FHZ.js} +1 -1
- package/dist/{chunk-BB4A5UI3.js → chunk-7JWZPJI5.js} +1 -1
- package/dist/{chunk-T3Z4KXOX.js → chunk-AMSNDWBT.js} +1 -1
- package/dist/{chunk-DFXXT6MJ.js → chunk-APWMLLSE.js} +6 -6
- package/dist/{chunk-NA2NEU4V.js → chunk-B5UJCNQU.js} +1 -1
- package/dist/chunk-BMSAVDRD.js +13 -0
- package/dist/{chunk-MPNE25CY.js → chunk-BRJIXNFU.js} +1 -1
- package/dist/chunk-C2GZLLSP.js +5 -0
- package/dist/{chunk-XCPIIDFS.js → chunk-DHOIQZUF.js} +1 -1
- package/dist/chunk-ECSMTGVM.js +6 -0
- package/dist/{chunk-DEP55R35.js → chunk-EHFWODRT.js} +1 -1
- package/dist/{chunk-6WCHBHFW.js → chunk-EWTVVPUA.js} +1 -1
- package/dist/{chunk-H3GEEOOL.js → chunk-FBR7ZLLN.js} +1 -1
- package/dist/{chunk-UD3DMY3Q.js → chunk-FGN2ZMEN.js} +1 -1
- package/dist/{chunk-MKDOT76B.js → chunk-FJSYWOE6.js} +1 -1
- package/dist/{chunk-LF325WYO.js → chunk-FTECKRK6.js} +1 -1
- package/dist/chunk-GRZTKMXQ.js +1 -0
- package/dist/chunk-H6FEBUAP.js +1 -0
- package/dist/{chunk-FYOU4RBH.js → chunk-HFCHOFLV.js} +1 -1
- package/dist/chunk-HFF4GY7R.js +3 -0
- package/dist/{chunk-QJ6V5IAY.js → chunk-HJXSEPO7.js} +14 -12
- package/dist/{chunk-SRFWT562.js → chunk-HSEDKYH4.js} +1 -1
- package/dist/{chunk-6P7LTQZT.js → chunk-II7AOJNH.js} +1 -1
- package/dist/chunk-J6CDIH3S.js +84 -0
- package/dist/{chunk-USG6WHAT.js → chunk-JHWLRL4U.js} +1 -1
- package/dist/{chunk-35LZOKEW.js → chunk-JMQ67UNK.js} +1 -1
- package/dist/{chunk-7OUML24Z.js → chunk-JRIP33PC.js} +1 -1
- package/dist/chunk-JXULBI4S.js +2 -0
- package/dist/chunk-JYITLCXC.js +1 -0
- package/dist/{chunk-4IWEKRSP.js → chunk-KJAR2WDO.js} +1 -1
- package/dist/{chunk-GS5ZRTUG.js → chunk-KQV2ZXLP.js} +1 -1
- package/dist/{chunk-AMIIOWFL.js → chunk-KX7MG72M.js} +1 -1
- package/dist/{chunk-HGCJDIRR.js → chunk-LIGOOMJS.js} +5 -5
- package/dist/{chunk-OMNKD7WW.js → chunk-LY2UANKU.js} +3 -3
- package/dist/chunk-M7P7V4WI.js +25 -0
- package/dist/chunk-N2NEFXHB.js +13 -0
- package/dist/{chunk-2TZDG2JH.js → chunk-NF74ITWT.js} +2 -2
- package/dist/{chunk-AP2BOC24.js → chunk-NQYUIQRH.js} +1 -1
- package/dist/{chunk-7C73WVPB.js → chunk-OCU6NW5Y.js} +1 -1
- package/dist/chunk-OIEA4QWF.js +4 -0
- package/dist/{chunk-FXPY3V4L.js → chunk-ON5HDFNL.js} +1 -1
- package/dist/{chunk-U2N73BUY.js → chunk-P43GGKUC.js} +5 -5
- package/dist/{chunk-5BGWNYQS.js → chunk-P7FUD4WY.js} +1 -1
- package/dist/{chunk-VMLPXSMK.js → chunk-PPCWY4BB.js} +1 -1
- package/dist/{chunk-YPYROPQF.js → chunk-QGXZ4RWX.js} +1 -1
- package/dist/chunk-S3T5NOSL.js +1 -0
- package/dist/chunk-S7E2D5K7.js +5 -0
- package/dist/{chunk-DDH3FP4G.js → chunk-SIYPD5MM.js} +3 -3
- package/dist/{chunk-6A3ORNW3.js → chunk-T5ACAOKJ.js} +3 -3
- package/dist/chunk-TILMPAF2.js +1 -0
- package/dist/{chunk-RIJRPAL2.js → chunk-TSNY2FSU.js} +1 -1
- package/dist/{chunk-UI4KSKS3.js → chunk-TWJINFQB.js} +4 -4
- package/dist/chunk-TWQ6ACOI.js +1 -0
- package/dist/chunk-UDVVKVG4.js +1 -0
- package/dist/{chunk-WQIMM4SU.js → chunk-V2D5MLGE.js} +1 -1
- package/dist/{chunk-PQWANILR.js → chunk-VDSSAP6Y.js} +1 -1
- package/dist/{chunk-AVJVTF5H.js → chunk-VHYJTAXX.js} +1 -1
- package/dist/{chunk-MJFY4RGT.js → chunk-WCSWQDJ2.js} +1 -1
- package/dist/{chunk-JWSJCEIB.js → chunk-WQTF6Q2X.js} +1 -1
- package/dist/chunk-YFPU2LRR.js +23 -0
- package/dist/{chunk-KWJD7FBS.js → chunk-YLEERRX3.js} +14 -14
- package/dist/chunk-YNOR4LIE.js +1 -0
- package/dist/{chunk-WEE3NM6L.js → chunk-YOJHCARZ.js} +1 -1
- package/dist/chunk-YPTDPMK5.js +1 -0
- package/dist/{chunk-GXL4NMHR.js → chunk-YZTVC7ME.js} +1 -1
- package/dist/entry-0.js +1 -1
- package/dist/entry-10.js +1 -1
- package/dist/entry-11.js +1 -1
- package/dist/entry-12.js +1 -1
- package/dist/entry-14.js +1 -1
- package/dist/entry-15.js +1 -1
- package/dist/entry-17.js +1 -1
- package/dist/entry-19.js +1 -1
- package/dist/entry-2.js +1 -1
- package/dist/entry-20.js +1 -1
- package/dist/entry-21.js +1 -1
- package/dist/entry-22.js +1 -1
- package/dist/entry-25.js +1 -1
- package/dist/entry-31.js +2 -2
- package/dist/entry-32.js +1 -1
- package/dist/entry-33.js +1 -1
- package/dist/entry-34.js +1 -1
- package/dist/entry-35.js +1 -1
- package/dist/entry-36.js +1 -1
- package/dist/entry-37.js +1 -1
- package/dist/entry-38.js +13 -13
- package/dist/entry-39.js +1 -1
- package/dist/entry-4.js +1 -1
- package/dist/entry-40.js +1 -1
- package/dist/entry-41.js +1 -1
- package/dist/entry-42.js +1 -1
- package/dist/entry-43.js +1 -1
- package/dist/entry-44.js +1 -1
- package/dist/entry-48.js +1 -1
- package/dist/entry-49.js +1 -1
- package/dist/entry-50.js +1 -1
- package/dist/entry-51.js +1 -1
- package/dist/entry-52.js +1 -1
- package/dist/entry-53.js +1 -1
- package/dist/entry-56.js +1 -1
- package/dist/entry-57.js +1 -1
- package/dist/entry-58.js +1 -1
- package/dist/entry-59.js +1 -1
- package/dist/entry-60.js +1 -1
- package/dist/entry-61.js +1 -1
- package/dist/entry-62.js +1 -1
- package/dist/entry-63.js +1 -1
- package/dist/entry-64.js +1 -1
- package/dist/entry-65.js +1 -1
- package/dist/entry-66.js +1 -1
- package/dist/entry-67.js +1 -1
- package/dist/entry-69.js +1 -1
- package/dist/entry-72.js +1 -1
- package/dist/entry-74.js +1 -1
- package/dist/entry-75.js +1 -1
- package/dist/entry-77.js +1 -1
- package/dist/entry-79.js +1 -1
- package/dist/entry-8.js +1 -1
- package/dist/entry-82.js +1 -1
- package/dist/entry-84.js +1 -1
- package/dist/entry-85.js +1 -1
- package/dist/entry-86.js +1 -1
- package/dist/entry-87.js +1 -1
- package/dist/entry-90.js +1 -1
- package/dist/entry-91.js +1 -1
- package/dist/entry-92.js +1 -1
- package/dist/entry-93.js +1 -1
- package/dist/entry-94.js +1 -1
- package/dist/pi-agent-ide.js +11 -11
- package/docs/development.md +2 -0
- package/docs/generated/tool-catalog/python.md +1 -0
- package/docs/tools.md +2 -0
- package/node_modules/pi-agent-doctor/package.json +1 -1
- package/node_modules/pi-agent-doctor/src/connect-plugin.ts +2 -2
- package/node_modules/pi-agent-doctor/src/evidence.ts +1 -1
- package/node_modules/pi-agent-doctor/src/fixtures/executable-probe.ts +2 -2
- package/node_modules/pi-agent-doctor/src/plugin-protocol.ts +4 -4
- package/node_modules/pi-agent-doctor/src/project-probes.ts +2 -2
- package/node_modules/pi-agent-doctor/src/workspace.ts +2 -2
- package/node_modules/pi-agent-documentation/package.json +1 -1
- package/node_modules/pi-agent-filesystem/index.ts +2 -2
- package/node_modules/pi-agent-filesystem/package.json +7 -7
- package/node_modules/pi-agent-filesystem/src/file-write-lock.ts +70 -0
- package/node_modules/pi-agent-filesystem/src/replace-file.ts +50 -0
- package/node_modules/pi-agent-filesystem/src/resolver.ts +28 -8
- package/node_modules/pi-agent-filesystem-image/package.json +3 -3
- package/node_modules/pi-agent-filesystem-jq/index.ts +1 -1
- package/node_modules/pi-agent-filesystem-jq/package.json +5 -5
- package/node_modules/pi-agent-filesystem-jq/src/api/jq.ts +1 -1
- package/node_modules/pi-agent-filesystem-pdf/package.json +3 -3
- package/node_modules/pi-agent-filesystem-text/package.json +3 -3
- package/node_modules/pi-agent-ide-ast/index.ts +1 -1
- package/node_modules/pi-agent-ide-ast/package.json +13 -13
- package/node_modules/pi-agent-ide-ast/src/api/scope.ts +1 -1
- package/node_modules/pi-agent-ide-ast/src/ast/manager.ts +33 -11
- package/node_modules/pi-agent-ide-ast/src/ast/native-parser.ts +1 -1
- package/node_modules/pi-agent-ide-ast/src/ast/outline.ts +60 -55
- package/node_modules/pi-agent-ide-ast/src/doctor-plugin.ts +4 -3
- package/node_modules/pi-agent-ide-ast/src/extension.ts +10 -10
- package/node_modules/pi-agent-ide-ast/src/outline-resolver.ts +3 -3
- package/node_modules/pi-agent-ide-ast/src/overflow-handler.ts +1 -1
- package/node_modules/pi-agent-ide-ast/src/scope-handler.ts +35 -8
- package/node_modules/pi-agent-ide-ast/src/scope-resolver.ts +1 -1
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +161 -23
- package/node_modules/pi-agent-ide-ast/src/tool-ast-search.ts +1 -1
- package/node_modules/pi-agent-ide-changes/index.ts +9 -9
- package/node_modules/pi-agent-ide-changes/package.json +8 -8
- package/node_modules/pi-agent-ide-changes/src/change-anchor.ts +4 -4
- 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 +4 -4
- package/node_modules/pi-agent-ide-changes/src/changes/git-changes-backend.ts +1 -1
- package/node_modules/pi-agent-ide-changes/src/current-change-presenter.ts +4 -4
- package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +5 -5
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +6 -6
- package/node_modules/pi-agent-ide-formatter/index.ts +5 -5
- package/node_modules/pi-agent-ide-formatter/package.json +3 -3
- package/node_modules/pi-agent-ide-formatter/src/doctor-plugin.ts +2 -2
- package/node_modules/pi-agent-ide-formatter/src/formatter.ts +2 -2
- package/node_modules/pi-agent-ide-formatter/src/registry.ts +1 -1
- package/node_modules/pi-agent-ide-languages/index.ts +1 -1
- package/node_modules/pi-agent-ide-languages/package.json +2 -2
- package/node_modules/pi-agent-ide-lint/index.ts +9 -9
- package/node_modules/pi-agent-ide-lint/package.json +7 -7
- package/node_modules/pi-agent-ide-lint/src/catalog.ts +4 -0
- package/node_modules/pi-agent-ide-lint/src/command-linter.ts +15 -6
- package/node_modules/pi-agent-ide-lint/src/diagnostics.ts +8 -14
- package/node_modules/pi-agent-ide-lint/src/doctor-plugin.ts +3 -3
- package/node_modules/pi-agent-ide-lint/src/registry.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/index.ts +37 -16
- package/node_modules/pi-agent-ide-lsp/package.json +12 -12
- package/node_modules/pi-agent-ide-lsp/src/catalog.ts +12 -1
- package/node_modules/pi-agent-ide-lsp/src/declaration-targets.ts +21 -14
- package/node_modules/pi-agent-ide-lsp/src/diagnostic-source.ts +63 -20
- package/node_modules/pi-agent-ide-lsp/src/doctor-plugin.ts +4 -4
- package/node_modules/pi-agent-ide-lsp/src/idle-timeout.ts +15 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/abort.ts +11 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +434 -80
- package/node_modules/pi-agent-ide-lsp/src/lsp/code-views.ts +121 -35
- package/node_modules/pi-agent-ide-lsp/src/lsp/diagnostic-adapters.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/src/lsp/diagnostics.ts +26 -12
- package/node_modules/pi-agent-ide-lsp/src/lsp/document-leases.ts +31 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/errors.ts +4 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/file-watchers.ts +1 -77
- package/node_modules/pi-agent-ide-lsp/src/lsp/index.ts +19 -19
- package/node_modules/pi-agent-ide-lsp/src/lsp/language-map.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/src/lsp/lsp-compiler.ts +5 -4
- package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +59 -28
- package/node_modules/pi-agent-ide-lsp/src/lsp/navigation.ts +42 -22
- package/node_modules/pi-agent-ide-lsp/src/lsp/owner-transport.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/src/lsp/position-map.ts +52 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/project.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/src/lsp/registry.ts +2 -2
- package/node_modules/pi-agent-ide-lsp/src/lsp/rename.ts +2 -2
- package/node_modules/pi-agent-ide-lsp/src/lsp/server-request-handlers.mjs +325 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/shared-server-host.mjs +797 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/shared-servers.ts +322 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/source-changes.ts +29 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +76 -17
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbols.ts +3 -3
- package/node_modules/pi-agent-ide-lsp/src/lsp/workspace-owner.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/src/manager-provider.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/src/rename-plan.ts +16 -8
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +149 -134
- package/node_modules/pi-agent-ide-lsp/src/tool-lsp-search.ts +1 -1
- package/node_modules/pi-agent-image/package.json +2 -2
- package/node_modules/pi-agent-image/src/index.ts +1 -1
- package/node_modules/pi-agent-invariant/package.json +1 -1
- package/node_modules/pi-agent-pdf/package.json +2 -2
- package/node_modules/pi-agent-pdf/src/index.ts +1 -1
- package/node_modules/pi-agent-read/index.ts +1 -1
- package/node_modules/pi-agent-read/package.json +7 -7
- package/node_modules/pi-agent-read/src/api/connect-plugin.ts +1 -1
- package/node_modules/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/node_modules/pi-agent-read/src/api/read-parameters.ts +1 -1
- package/node_modules/pi-agent-read/src/api/rendering.ts +2 -2
- package/node_modules/pi-agent-read/src/api/tools/read.ts +8 -2
- package/node_modules/pi-agent-read/src/core/extension.ts +4 -4
- package/node_modules/pi-agent-read/src/core/read-core.ts +4 -4
- package/node_modules/pi-agent-read/src/core/tools/read/output-truncation.ts +2 -2
- package/node_modules/pi-agent-read/src/core/tools/read/persisted-result.ts +1 -1
- package/node_modules/pi-agent-read/src/core/tools/read/raw-read.ts +3 -3
- package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +4 -4
- package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +21 -14
- package/node_modules/pi-agent-read/src/core/tools/read/result-target.ts +24 -18
- package/node_modules/pi-agent-read/src/core/tools/read/structured-result.ts +2 -2
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +44 -18
- package/node_modules/pi-agent-resource/package.json +1 -1
- package/node_modules/pi-agent-resource/src/content-conversion/connect-plugin.ts +4 -4
- package/node_modules/pi-agent-resource/src/content-conversion/content-converter.ts +1 -1
- package/node_modules/pi-agent-resource/src/content-conversion/content-description.ts +1 -1
- package/node_modules/pi-agent-resource/src/content-conversion/content-host.ts +4 -4
- package/node_modules/pi-agent-resource/src/content-conversion/content-runner.ts +3 -3
- package/node_modules/pi-agent-resource/src/content-conversion/plugin-protocol.ts +2 -2
- package/node_modules/pi-agent-resource/src/content-conversion/validation.ts +2 -2
- package/node_modules/pi-agent-resource/src/index.ts +19 -19
- package/node_modules/pi-agent-resource/src/resolver.ts +1 -1
- package/node_modules/pi-agent-resource/src/resource-access.ts +1 -1
- package/node_modules/pi-agent-resource/src/resource-error.ts +1 -1
- package/node_modules/pi-agent-resource/src/resource.ts +1 -1
- package/node_modules/pi-agent-resource/src/result-images.ts +1 -1
- package/node_modules/pi-agent-resource/src/result-targets.ts +23 -2
- package/node_modules/pi-agent-resource/src/temp-resource-store.ts +2 -2
- package/node_modules/pi-agent-resource/src/tool-result.ts +2 -2
- package/node_modules/pi-agent-resource/src/validation.ts +3 -3
- package/node_modules/pi-agent-search/index.ts +1 -1
- package/node_modules/pi-agent-search/package.json +5 -5
- package/node_modules/pi-agent-search/src/api/connect-plugin.ts +1 -1
- package/node_modules/pi-agent-search/src/api/fuzzy.ts +2 -2
- package/node_modules/pi-agent-search/src/api/plugin-protocol.ts +1 -1
- package/node_modules/pi-agent-search/src/api/presentation.ts +1 -1
- package/node_modules/pi-agent-search/src/api/search-scope.ts +1 -1
- package/node_modules/pi-agent-search/src/api/search.ts +7 -7
- package/node_modules/pi-agent-search/src/core/extension.ts +7 -7
- package/node_modules/pi-agent-search/src/core/search-core.ts +3 -3
- package/node_modules/pi-agent-search-text/index.ts +8 -8
- package/node_modules/pi-agent-search-text/package.json +10 -10
- package/node_modules/pi-agent-search-text/src/doctor-plugin.ts +1 -1
- package/node_modules/pi-agent-search-text/src/file-search.ts +1 -1
- package/node_modules/pi-agent-search-text/src/fuzzy-search.ts +2 -2
- package/node_modules/pi-agent-search-text/src/persisted-result.ts +1 -1
- package/node_modules/pi-agent-search-text/src/resolvers.ts +9 -9
- package/node_modules/pi-agent-search-text/src/scoped-search.ts +4 -4
- package/node_modules/pi-agent-search-text/src/search-backend.ts +3 -3
- package/node_modules/pi-agent-search-text/src/search-presentation.ts +1 -1
- package/node_modules/pi-agent-search-text/src/search-recipe.ts +2 -2
- package/node_modules/pi-agent-search-text/src/search-renderer.ts +3 -3
- package/node_modules/pi-agent-search-text/src/search-result.ts +2 -2
- package/node_modules/pi-agent-search-text/src/search-session.ts +132 -67
- package/node_modules/pi-agent-search-text/src/tool-file-search.ts +1 -1
- package/node_modules/pi-agent-text/package.json +2 -2
- package/node_modules/pi-agent-text/src/index.ts +7 -7
- package/node_modules/pi-agent-text/src/source-line.ts +1 -1
- package/node_modules/pi-agent-text/src/text-document.ts +50 -2
- package/node_modules/pi-agent-text-anchor-constant/index.ts +1 -1
- package/node_modules/pi-agent-text-anchor-constant/package.json +3 -3
- package/node_modules/pi-agent-text-anchor-exact/index.ts +2 -2
- package/node_modules/pi-agent-text-anchor-exact/package.json +3 -3
- package/node_modules/pi-agent-text-anchor-exact/src/anchor.ts +63 -48
- package/node_modules/pi-agent-text-anchor-exact/src/recovery.ts +3 -3
- package/node_modules/pi-agent-text-anchor-line-hash/index.ts +2 -2
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +5 -5
- package/node_modules/pi-agent-text-anchor-line-hash/src/read-handler.ts +23 -12
- package/node_modules/pi-agent-text-editor/index.ts +5 -5
- package/node_modules/pi-agent-text-editor/package.json +9 -9
- package/node_modules/pi-agent-text-editor/src/api/connect-plugin.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/api/edit-pipeline.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/api/file-operations.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/api/file-transfers.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/api/mutation-guard.ts +4 -4
- package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +3 -3
- package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/api/native-edit-batch-event.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/api/native-files.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +14 -14
- package/node_modules/pi-agent-text-editor/src/api/post-edit.ts +3 -3
- package/node_modules/pi-agent-text-editor/src/api/tool-call-interceptor.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/api/tool-renderer.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/core/delete-policy.ts +3 -3
- package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +3 -3
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +13 -13
- package/node_modules/pi-agent-text-editor/src/core/file-operation-guards.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +6 -6
- package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +5 -5
- package/node_modules/pi-agent-text-editor/src/core/file-result-targets.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/file-transfers.ts +3 -3
- package/node_modules/pi-agent-text-editor/src/core/image-write.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/agent-diff.ts +11 -6
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/diff.ts +213 -20
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +4 -4
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +39 -3
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +1 -1
- 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/mutation-result-targets.ts +6 -6
- package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +22 -22
- package/node_modules/pi-agent-text-editor/src/core/post-edit-scope.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/read-fragment-resolver.ts +3 -3
- package/node_modules/pi-agent-text-editor/src/core/result-input.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/result-target-anchors.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/core/result-transfer.ts +4 -4
- package/node_modules/pi-agent-text-editor/src/core/source-change-retry.ts +41 -0
- package/node_modules/pi-agent-text-editor/src/core/structured-result.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/core/temporary-directories.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/core/text-anchor-recovery.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/text-anchor-registry.ts +3 -3
- package/node_modules/pi-agent-text-editor/src/core/text-change-engine.ts +4 -7
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-recovery.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +34 -21
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +4 -4
- package/node_modules/pi-agent-text-editor/src/core/text-edit-origin.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +72 -30
- package/node_modules/pi-agent-text-editor/src/core/text-mutation-anchor-error.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +211 -159
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +4 -4
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/write-agent-result.ts +3 -3
- package/node_modules/pi-agent-text-editor/src/tools/extension.ts +7 -7
- package/node_modules/pi-agent-text-editor/src/tools/text-selection.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +4 -4
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +4 -4
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +3 -3
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +5 -5
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +4 -4
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +1 -1
- package/node_modules/pi-agent-text-editor-renderer/index.ts +5 -5
- package/node_modules/pi-agent-text-editor-renderer/package.json +5 -5
- package/node_modules/pi-agent-text-editor-renderer/src/diff-renderer.ts +3 -3
- package/node_modules/pi-agent-text-editor-renderer/src/diff-viewport.ts +1 -1
- package/node_modules/pi-agent-text-editor-renderer/src/frozen-viewport.ts +2 -2
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +4 -4
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-projection.ts +2 -2
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-result.ts +3 -3
- package/node_modules/pi-agent-text-editor-renderer/src/persisted-result.ts +2 -2
- package/node_modules/pi-agent-text-editor-renderer/src/render-resource.ts +1 -1
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +7 -7
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/node_modules/pi-agent-tool-call-interception/package.json +2 -2
- package/node_modules/pi-agent-tool-call-interception/src/index.ts +32 -9
- package/node_modules/pi-agent-tool-ui/package.json +1 -1
- package/node_modules/pi-agent-tool-ui/src/index.ts +1 -1
- package/node_modules/pi-agent-tool-ui/src/result-panel.ts +1 -1
- package/node_modules/pi-agent-web/index.ts +3 -3
- package/node_modules/pi-agent-web/package.json +7 -7
- package/node_modules/pi-agent-web/src/doctor-plugin.ts +1 -1
- package/node_modules/pi-agent-web/src/resolver.ts +1 -1
- package/node_modules/pi-agent-web-html/index.ts +1 -1
- package/node_modules/pi-agent-web-html/package.json +2 -2
- package/node_modules/pi-agent-web-html/src/html-converter.ts +1 -1
- package/node_modules/pi-agent-web-image/package.json +3 -3
- package/node_modules/pi-agent-web-pdf/package.json +3 -3
- package/node_modules/pi-agent-web-text/package.json +3 -3
- package/package.json +36 -36
- package/src/api/code-view.ts +3 -3
- package/src/api/connect-plugin.ts +1 -1
- package/src/api/connect-tip-provider.ts +2 -2
- package/src/api/doctor-runtime.ts +1 -1
- package/src/api/doctor.ts +1 -1
- package/src/api/hooks.ts +2 -2
- package/src/api/plugin-protocol.ts +1 -1
- package/src/api/settings.ts +6 -1
- package/src/api/standalone.ts +1 -1
- package/src/api/tips.ts +1 -1
- package/src/api/tool-config/linters.json +1 -1
- package/src/api/tool-config/lsp-servers.json +11 -0
- package/src/api/tool-config.ts +45 -5
- package/src/api/toolchain.ts +3 -3
- package/src/backend/config.ts +2 -2
- package/src/backend/configured-process.ts +5 -5
- package/src/backend/dap-java-transport.ts +6 -6
- package/src/backend/dap-node-transport.ts +5 -5
- package/src/backend/dap-tcp-transport.ts +3 -3
- package/src/backend/dap-transport.ts +5 -5
- package/src/backend/debugger-registration.ts +7 -7
- package/src/backend/debugger-workspace-owner.ts +10 -10
- package/src/backend/doctor-registration.ts +5 -5
- package/src/backend/doctor-workspace.ts +13 -13
- package/src/backend/file-operation-resolver.ts +5 -5
- package/src/backend/file-revision.ts +1 -1
- package/src/backend/file-transfer.ts +4 -4
- package/src/backend/formatter-registration.ts +11 -11
- package/src/backend/git-registration.ts +4 -4
- package/src/backend/index.ts +3 -3
- package/src/backend/lint-registration.ts +11 -11
- package/src/backend/lsp-file-watchers.ts +5 -5
- package/src/backend/lsp-registration.ts +11 -11
- package/src/backend/lsp-transport.ts +7 -7
- package/src/backend/lsp-workspace-owner.ts +4 -4
- package/src/backend/object-transfer.ts +5 -5
- package/src/backend/owned-command.ts +2 -2
- package/src/backend/owned-process-stop.ts +4 -4
- package/src/backend/owned-read-command.ts +2 -2
- package/src/backend/process-environment.ts +2 -2
- package/src/backend/process-metadata.ts +2 -2
- package/src/backend/recipe-evidence.ts +2 -2
- package/src/backend/registration.ts +8 -8
- package/src/backend/registry.ts +2 -2
- package/src/backend/resource-resolver.ts +2 -2
- package/src/backend/search-environment.ts +3 -3
- package/src/backend/ssh-channel.ts +3 -3
- package/src/backend/ssh-transport.ts +2 -2
- package/src/backend/ssh.ts +6 -6
- package/src/backend/tool-config-access.ts +4 -4
- package/src/backend/tool-project.ts +5 -5
- package/src/backend/web-browser.ts +3 -3
- package/src/backend/web-http.ts +2 -2
- package/src/backend/web-owner.ts +5 -5
- package/src/backend/web-registration.ts +5 -5
- package/src/code-review/extension.ts +3 -3
- package/src/code-review/reviewer.ts +2 -2
- package/src/code-view/diagnostic-view.ts +4 -4
- package/src/composite/builtin-extensions.ts +37 -37
- package/src/composite/capabilities.ts +2 -2
- package/src/composite/capability-schemas.ts +1 -1
- package/src/composite/detached-results.ts +32 -0
- package/src/composite/extensions-config.ts +2 -2
- package/src/composite/module-settings-store.ts +2 -2
- package/src/composite/module-settings.ts +12 -12
- package/src/composite/nested-tool-rendering.ts +3 -3
- package/src/composite/output-limits.ts +6 -1
- package/src/composite/preferences.ts +10 -0
- package/src/composite/presets.ts +1 -1
- package/src/composite/reload-required.ts +6 -6
- package/src/composite/settings-documentation.ts +5 -5
- package/src/composite/settings-registry.ts +4 -4
- package/src/composite/text-results.ts +2 -2
- package/src/core/diagnostic-entry.ts +2 -2
- package/src/core/diagnostic-store.ts +3 -3
- package/src/core/extension.ts +8 -8
- package/src/core/ide-core.ts +4 -4
- package/src/doctor/config-writer.ts +3 -3
- package/src/doctor/core.ts +2 -2
- package/src/doctor/discovery.ts +4 -4
- package/src/doctor/extension.ts +7 -7
- package/src/doctor/index.ts +1 -1
- package/src/doctor/inventory.ts +1 -1
- package/src/doctor/run.ts +6 -6
- package/src/doctor/tip-provider.ts +2 -2
- package/src/documentation/extension.ts +3 -3
- package/src/documentation/registry.ts +1 -1
- package/src/documentation/search.ts +1 -1
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +2 -2
- 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 +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/index.ts +1 -1
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +5 -5
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/src/api/jq.ts +1 -1
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/src/file-write-lock.ts +70 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/src/replace-file.ts +50 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/src/resolver.ts +28 -8
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +7 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/index.ts +1 -1
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +2 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/src/html-converter.ts +1 -1
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/doctor-plugin.ts +1 -1
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/resolver.ts +1 -1
- package/src/extensions/pi-agent-read/index.ts +1 -1
- package/src/extensions/pi-agent-read/package.json +7 -7
- package/src/extensions/pi-agent-read/src/api/connect-plugin.ts +1 -1
- package/src/extensions/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/src/extensions/pi-agent-read/src/api/read-parameters.ts +1 -1
- package/src/extensions/pi-agent-read/src/api/rendering.ts +2 -2
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +8 -2
- package/src/extensions/pi-agent-read/src/core/extension.ts +4 -4
- package/src/extensions/pi-agent-read/src/core/read-core.ts +4 -4
- package/src/extensions/pi-agent-read/src/core/tools/read/output-truncation.ts +2 -2
- package/src/extensions/pi-agent-read/src/core/tools/read/persisted-result.ts +1 -1
- package/src/extensions/pi-agent-read/src/core/tools/read/raw-read.ts +3 -3
- package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +4 -4
- package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +21 -14
- package/src/extensions/pi-agent-read/src/core/tools/read/result-target.ts +24 -18
- package/src/extensions/pi-agent-read/src/core/tools/read/structured-result.ts +2 -2
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +44 -18
- package/src/extensions/pi-agent-search/index.ts +1 -1
- package/src/extensions/pi-agent-search/package.json +5 -5
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +8 -8
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +10 -10
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/doctor-plugin.ts +1 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/file-search.ts +1 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/fuzzy-search.ts +2 -2
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/persisted-result.ts +1 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +9 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/scoped-search.ts +4 -4
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +3 -3
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-presentation.ts +1 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +2 -2
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +3 -3
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +2 -2
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +132 -67
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/tool-file-search.ts +1 -1
- package/src/extensions/pi-agent-search/src/api/connect-plugin.ts +1 -1
- package/src/extensions/pi-agent-search/src/api/fuzzy.ts +2 -2
- package/src/extensions/pi-agent-search/src/api/plugin-protocol.ts +1 -1
- package/src/extensions/pi-agent-search/src/api/presentation.ts +1 -1
- package/src/extensions/pi-agent-search/src/api/search-scope.ts +1 -1
- package/src/extensions/pi-agent-search/src/api/search.ts +7 -7
- package/src/extensions/pi-agent-search/src/core/extension.ts +7 -7
- package/src/extensions/pi-agent-search/src/core/search-core.ts +3 -3
- package/src/extensions/pi-agent-text-editor/index.ts +5 -5
- package/src/extensions/pi-agent-text-editor/package.json +9 -9
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/index.ts +1 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +3 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.ts +2 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +3 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/anchor.ts +63 -48
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/recovery.ts +3 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +2 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/read-handler.ts +23 -12
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-renderer.ts +3 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-viewport.ts +1 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/frozen-viewport.ts +2 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +4 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-projection.ts +2 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-result.ts +3 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/persisted-result.ts +2 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/render-resource.ts +1 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +7 -7
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/src/api/connect-plugin.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/api/edit-pipeline.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/api/file-operations.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/api/file-transfers.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/api/mutation-guard.ts +4 -4
- package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +3 -3
- package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/api/native-edit-batch-event.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/api/native-files.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +14 -14
- package/src/extensions/pi-agent-text-editor/src/api/post-edit.ts +3 -3
- package/src/extensions/pi-agent-text-editor/src/api/tool-call-interceptor.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/api/tool-renderer.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/core/delete-policy.ts +3 -3
- package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +3 -3
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +13 -13
- package/src/extensions/pi-agent-text-editor/src/core/file-operation-guards.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +6 -6
- package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +5 -5
- package/src/extensions/pi-agent-text-editor/src/core/file-result-targets.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/file-transfers.ts +3 -3
- package/src/extensions/pi-agent-text-editor/src/core/image-write.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/agent-diff.ts +11 -6
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/diff.ts +213 -20
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +4 -4
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +39 -3
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +1 -1
- 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/mutation-result-targets.ts +6 -6
- package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +22 -22
- package/src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/read-fragment-resolver.ts +3 -3
- package/src/extensions/pi-agent-text-editor/src/core/result-input.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/result-target-anchors.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/core/result-transfer.ts +4 -4
- package/src/extensions/pi-agent-text-editor/src/core/source-change-retry.ts +41 -0
- package/src/extensions/pi-agent-text-editor/src/core/structured-result.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/core/temporary-directories.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/core/text-anchor-recovery.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-anchor-registry.ts +3 -3
- package/src/extensions/pi-agent-text-editor/src/core/text-change-engine.ts +4 -7
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-recovery.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +34 -21
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +4 -4
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-origin.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +72 -30
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation-anchor-error.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +211 -159
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +4 -4
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/write-agent-result.ts +3 -3
- package/src/extensions/pi-agent-text-editor/src/tools/extension.ts +7 -7
- package/src/extensions/pi-agent-text-editor/src/tools/text-selection.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +4 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +4 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +3 -3
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +5 -5
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +4 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +1 -1
- package/src/index.ts +1 -1
- package/src/pi-agent-ide.ts +22 -20
- package/src/plugins/pi-agent-ide-ast/index.ts +1 -1
- package/src/plugins/pi-agent-ide-ast/package.json +13 -13
- package/src/plugins/pi-agent-ide-ast/src/api/scope.ts +1 -1
- package/src/plugins/pi-agent-ide-ast/src/ast/manager.ts +33 -11
- package/src/plugins/pi-agent-ide-ast/src/ast/native-parser.ts +1 -1
- package/src/plugins/pi-agent-ide-ast/src/ast/outline.ts +60 -55
- package/src/plugins/pi-agent-ide-ast/src/doctor-plugin.ts +4 -3
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +10 -10
- package/src/plugins/pi-agent-ide-ast/src/outline-resolver.ts +3 -3
- package/src/plugins/pi-agent-ide-ast/src/overflow-handler.ts +1 -1
- package/src/plugins/pi-agent-ide-ast/src/scope-handler.ts +35 -8
- package/src/plugins/pi-agent-ide-ast/src/scope-resolver.ts +1 -1
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +161 -23
- package/src/plugins/pi-agent-ide-ast/src/tool-ast-search.ts +1 -1
- package/src/plugins/pi-agent-ide-changes/index.ts +9 -9
- package/src/plugins/pi-agent-ide-changes/package.json +8 -8
- package/src/plugins/pi-agent-ide-changes/src/change-anchor.ts +4 -4
- 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 +4 -4
- package/src/plugins/pi-agent-ide-changes/src/changes/git-changes-backend.ts +1 -1
- package/src/plugins/pi-agent-ide-changes/src/current-change-presenter.ts +4 -4
- package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +5 -5
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +6 -6
- package/src/plugins/pi-agent-ide-debugger/index.ts +21 -13
- package/src/plugins/pi-agent-ide-debugger/src/breakpoint-view.ts +1 -1
- package/src/plugins/pi-agent-ide-debugger/src/doctor-plugin.ts +4 -4
- package/src/plugins/pi-agent-ide-debugger/src/java-runtime.ts +2 -2
- package/src/plugins/pi-agent-ide-debugger/src/process-provider.ts +3 -3
- package/src/plugins/pi-agent-ide-debugger/src/renderer.ts +1 -1
- package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +5 -5
- package/src/plugins/pi-agent-ide-debugger/src/ui.ts +1 -1
- package/src/plugins/pi-agent-ide-debugger/src/vscode-backend.ts +1 -1
- package/src/plugins/pi-agent-ide-debugger/src/workspace-owner.ts +2 -2
- package/src/plugins/pi-agent-ide-diagnostics/index.ts +1 -1
- package/src/plugins/pi-agent-ide-formatter/index.ts +5 -5
- package/src/plugins/pi-agent-ide-formatter/package.json +3 -3
- package/src/plugins/pi-agent-ide-formatter/src/doctor-plugin.ts +2 -2
- package/src/plugins/pi-agent-ide-formatter/src/formatter.ts +2 -2
- package/src/plugins/pi-agent-ide-formatter/src/registry.ts +1 -1
- package/src/plugins/pi-agent-ide-languages/index.ts +1 -1
- package/src/plugins/pi-agent-ide-languages/package.json +2 -2
- package/src/plugins/pi-agent-ide-lint/index.ts +9 -9
- package/src/plugins/pi-agent-ide-lint/package.json +7 -7
- package/src/plugins/pi-agent-ide-lint/src/catalog.ts +4 -0
- package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +15 -6
- package/src/plugins/pi-agent-ide-lint/src/diagnostics.ts +8 -14
- package/src/plugins/pi-agent-ide-lint/src/doctor-plugin.ts +3 -3
- package/src/plugins/pi-agent-ide-lint/src/registry.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/index.ts +37 -16
- package/src/plugins/pi-agent-ide-lsp/package.json +12 -12
- package/src/plugins/pi-agent-ide-lsp/src/catalog.ts +12 -1
- package/src/plugins/pi-agent-ide-lsp/src/declaration-targets.ts +21 -14
- package/src/plugins/pi-agent-ide-lsp/src/diagnostic-source.ts +63 -20
- package/src/plugins/pi-agent-ide-lsp/src/doctor-plugin.ts +4 -4
- package/src/plugins/pi-agent-ide-lsp/src/idle-timeout.ts +15 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/abort.ts +11 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +434 -80
- package/src/plugins/pi-agent-ide-lsp/src/lsp/code-views.ts +121 -35
- package/src/plugins/pi-agent-ide-lsp/src/lsp/diagnostic-adapters.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/src/lsp/diagnostics.ts +26 -12
- package/src/plugins/pi-agent-ide-lsp/src/lsp/document-leases.ts +31 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/errors.ts +4 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/file-watchers.ts +1 -77
- package/src/plugins/pi-agent-ide-lsp/src/lsp/index.ts +19 -19
- package/src/plugins/pi-agent-ide-lsp/src/lsp/language-map.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/src/lsp/lsp-compiler.ts +5 -4
- package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +59 -28
- package/src/plugins/pi-agent-ide-lsp/src/lsp/navigation.ts +42 -22
- package/src/plugins/pi-agent-ide-lsp/src/lsp/owner-transport.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/src/lsp/position-map.ts +52 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/project.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/src/lsp/registry.ts +2 -2
- package/src/plugins/pi-agent-ide-lsp/src/lsp/rename.ts +2 -2
- package/src/plugins/pi-agent-ide-lsp/src/lsp/server-request-handlers.mjs +325 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/shared-server-host.mjs +797 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/shared-servers.ts +322 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/source-changes.ts +29 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +76 -17
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbols.ts +3 -3
- package/src/plugins/pi-agent-ide-lsp/src/lsp/workspace-owner.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/src/manager-provider.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/src/rename-plan.ts +16 -8
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +149 -134
- package/src/plugins/pi-agent-ide-lsp/src/tool-lsp-search.ts +1 -1
- package/src/plugins/pi-agent-ide-processes/index.ts +4 -4
- package/src/plugins/pi-agent-ide-processes/src/ui.ts +1 -1
- package/src/plugins/pi-agent-ide-semantic/src/vera-backend.ts +2 -2
- package/src/plugins/pi-agent-ide-terminal/index.ts +17 -17
- package/src/plugins/pi-agent-ide-terminal/src/origin.ts +1 -1
- package/src/plugins/pi-agent-ide-terminal/src/output-limits.ts +1 -1
- package/src/plugins/pi-agent-ide-terminal/src/process-provider.ts +3 -3
- package/src/plugins/pi-agent-ide-terminal/src/renderer.ts +3 -3
- package/src/plugins/pi-agent-ide-terminal/src/resources.ts +5 -5
- package/src/plugins/pi-agent-ide-terminal/src/screen-image.ts +1 -1
- package/src/plugins/pi-agent-ide-terminal/src/search.ts +2 -2
- package/src/plugins/pi-agent-ide-terminal/src/session-manager.ts +3 -3
- package/src/plugins/pi-agent-ide-terminal/src/shell-profile.ts +1 -1
- package/src/plugins/pi-agent-ide-terminal/src/shell-result.ts +1 -1
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +9 -9
- package/src/plugins/pi-agent-ide-terminal/src/types.ts +1 -1
- package/src/plugins/pi-agent-ide-terminal/src/ui.ts +3 -3
- package/src/post-edit/gate.ts +1 -1
- package/src/semantic/extension.ts +2 -2
- package/src/semantic/index.ts +4 -4
- package/src/standalone/resource-host.ts +13 -13
- package/src/standalone/scoped-api.ts +2 -2
- package/src/tips/core.ts +1 -1
- package/src/tips/extension.ts +6 -6
- package/src/tips/setup-hint.ts +1 -1
- package/src/toolchain/diagnostic.ts +1 -1
- package/src/toolchain/registry.ts +1 -1
- package/dist/chunk-2AY526TN.js +0 -3
- package/dist/chunk-52PFWQMU.js +0 -5
- package/dist/chunk-57F5GTHO.js +0 -1
- package/dist/chunk-5S74Z6Y4.js +0 -7
- package/dist/chunk-7D7PXIVV.js +0 -1
- package/dist/chunk-BT2CFM7D.js +0 -11
- package/dist/chunk-C2JT2G5K.js +0 -1
- package/dist/chunk-DEWWWKUF.js +0 -6
- package/dist/chunk-FEZLTM4L.js +0 -1
- package/dist/chunk-G4PRFO6G.js +0 -1
- package/dist/chunk-H5Z54BEU.js +0 -25
- package/dist/chunk-HISGZD3C.js +0 -81
- package/dist/chunk-HRBUY2FF.js +0 -4
- package/dist/chunk-ICIRQLZ4.js +0 -23
- package/dist/chunk-LIQ4BVOB.js +0 -1
- package/dist/chunk-LXDF2NWX.js +0 -1
- package/dist/chunk-MDD5ORB6.js +0 -1
- package/dist/chunk-OJEIX7OZ.js +0 -1
- package/dist/chunk-S5PL5DFQ.js +0 -1
- package/dist/chunk-U7YDLVFL.js +0 -1
- package/dist/chunk-VDJSH3DQ.js +0 -2
- package/dist/chunk-XH5WN5XA.js +0 -2
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { requiredValue } from "pi-agent-invariant";
|
|
2
|
+
import { LinePositionMap } from "./position-map.ts";
|
|
3
|
+
import { retryWhileSourceChanges, sourceChanged } from "./source-changes.ts";
|
|
2
4
|
import path from "node:path";
|
|
3
5
|
import { fileURLToPath } from "node:url";
|
|
4
6
|
|
|
@@ -8,19 +10,20 @@ import {
|
|
|
8
10
|
formatSymbolSelector,
|
|
9
11
|
} from "pi-agent-ide/api/code-view";
|
|
10
12
|
|
|
11
|
-
import { requestCallHierarchy, requestReferences } from "./navigation.
|
|
12
|
-
import { requestDocumentSymbols, symbolKindName } from "./symbols.
|
|
13
|
+
import { requestCallHierarchy, requestReferences } from "./navigation.ts";
|
|
14
|
+
import { requestDocumentSymbols, symbolKindName } from "./symbols.ts";
|
|
13
15
|
|
|
14
|
-
import type { LspClient } from "./client.
|
|
15
|
-
import type { LspManager } from "./manager.
|
|
16
|
+
import type { LspClient } from "./client.ts";
|
|
17
|
+
import type { LspManager } from "./manager.ts";
|
|
16
18
|
import type {
|
|
19
|
+
LspCallDirection,
|
|
17
20
|
LspCallHierarchyResult,
|
|
18
21
|
LspIncomingCall,
|
|
19
22
|
LspLocation,
|
|
20
23
|
LspOutgoingCall,
|
|
21
|
-
} from "./navigation.
|
|
22
|
-
import type { LspDocumentSymbol } from "./symbols.
|
|
23
|
-
import type { LspRange } from "./types.
|
|
24
|
+
} from "./navigation.ts";
|
|
25
|
+
import type { LspDocumentSymbol } from "./symbols.ts";
|
|
26
|
+
import type { LspRange } from "./types.ts";
|
|
24
27
|
|
|
25
28
|
const MAX_GROUPS = 10;
|
|
26
29
|
const MAX_ITEMS_PER_GROUP = 5;
|
|
@@ -41,6 +44,8 @@ interface LspCodeDocument {
|
|
|
41
44
|
readonly filePath: string;
|
|
42
45
|
readonly displayPath: string;
|
|
43
46
|
readonly symbols: readonly LspCodeSymbol[];
|
|
47
|
+
/** Text the server answered for, or undefined when the client holds none. */
|
|
48
|
+
readonly servedText: string | undefined;
|
|
44
49
|
}
|
|
45
50
|
|
|
46
51
|
/** Resolve a declaration's exact server range for guarded text operations. */
|
|
@@ -50,16 +55,42 @@ export async function resolveLspDeclaration(
|
|
|
50
55
|
selector: readonly string[],
|
|
51
56
|
cwd: string,
|
|
52
57
|
signal?: AbortSignal,
|
|
58
|
+
): Promise<{ readonly source: string; readonly range: LspRange; readonly content: string }> {
|
|
59
|
+
// Another Pi process may write the file while the server reports its symbols.
|
|
60
|
+
return retryWhileSourceChanges(
|
|
61
|
+
() => resolveLspDeclarationOnce(manager, filePath, selector, cwd, signal),
|
|
62
|
+
signal,
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async function resolveLspDeclarationOnce(
|
|
67
|
+
manager: LspManager,
|
|
68
|
+
filePath: string,
|
|
69
|
+
selector: readonly string[],
|
|
70
|
+
cwd: string,
|
|
71
|
+
signal?: AbortSignal,
|
|
53
72
|
): Promise<{ readonly source: string; readonly range: LspRange; readonly content: string }> {
|
|
54
73
|
throwIfAborted(signal);
|
|
55
|
-
const before = await manager.readSourceText(filePath, signal);
|
|
56
74
|
const document = await openCodeDocument(manager, filePath, cwd, signal);
|
|
57
75
|
const symbol = resolveLspCodeSymbol(document.symbols, selector, document.displayPath);
|
|
58
|
-
const
|
|
76
|
+
const current = await manager.readSourceText(document.filePath, signal);
|
|
59
77
|
throwIfAborted(signal);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
78
|
+
// Other Pi processes may have edited the file while the server answered, and on a shared
|
|
79
|
+
// server another session's newer text may be what it answered for. The text where the name
|
|
80
|
+
// sits at the reported position is the one the ranges belong to; the declaration then moves
|
|
81
|
+
// with its unchanged lines, and one whose own lines changed is resolved again.
|
|
82
|
+
const served = document.servedText;
|
|
83
|
+
const range =
|
|
84
|
+
served === current || answeredFor(current, symbol)
|
|
85
|
+
? symbol.range
|
|
86
|
+
: served !== undefined && answeredFor(served, symbol)
|
|
87
|
+
? LinePositionMap.between(served, current).mapRange(symbol.range)
|
|
88
|
+
: undefined;
|
|
89
|
+
if (range === undefined)
|
|
90
|
+
throw sourceChanged(
|
|
91
|
+
"The symbol source changed during resolution. Read it again before editing.",
|
|
92
|
+
);
|
|
93
|
+
return { source: document.filePath, range, content: current };
|
|
63
94
|
}
|
|
64
95
|
/** Resolve the native identifier position and client without guessing from declaration text. */
|
|
65
96
|
export async function resolveLspRenameTarget(
|
|
@@ -95,12 +126,31 @@ export async function readLspSymbolGraph(
|
|
|
95
126
|
cwd: string,
|
|
96
127
|
signal?: AbortSignal,
|
|
97
128
|
): Promise<string> {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
129
|
+
return retryWhileSourceChanges(async () => {
|
|
130
|
+
throwIfAborted(signal);
|
|
131
|
+
const document = await openCodeDocument(manager, filePath, cwd, signal);
|
|
132
|
+
const symbol = resolveLspCodeSymbol(document.symbols, selector, document.displayPath);
|
|
133
|
+
const relations = await queryRelations(document, symbol, signal);
|
|
134
|
+
const locations = new LocationPresenter(cwd);
|
|
135
|
+
const graph = await formatSymbolGraph(document, symbol, relations, locations);
|
|
136
|
+
await assertAnsweredForCurrentText(manager, document, signal);
|
|
137
|
+
return graph;
|
|
138
|
+
}, signal);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Graph lines carry anchors of the current file at the server's line numbers. When another
|
|
143
|
+
* process edited the file while the server answered, those numbers can name other lines.
|
|
144
|
+
*/
|
|
145
|
+
async function assertAnsweredForCurrentText(
|
|
146
|
+
manager: LspManager,
|
|
147
|
+
document: LspCodeDocument,
|
|
148
|
+
signal: AbortSignal | undefined,
|
|
149
|
+
): Promise<void> {
|
|
150
|
+
if (document.servedText === undefined) return;
|
|
151
|
+
const current = await manager.readSourceText(document.filePath, signal);
|
|
152
|
+
if (document.servedText !== current)
|
|
153
|
+
throw sourceChanged("The file changed while the language server answered. Read it again.");
|
|
104
154
|
}
|
|
105
155
|
|
|
106
156
|
export async function readLspFileGraph(
|
|
@@ -109,21 +159,24 @@ export async function readLspFileGraph(
|
|
|
109
159
|
cwd: string,
|
|
110
160
|
signal?: AbortSignal,
|
|
111
161
|
): Promise<string> {
|
|
112
|
-
|
|
113
|
-
const document = await openCodeDocument(manager, filePath, cwd, signal);
|
|
114
|
-
const locations = new LocationPresenter(cwd);
|
|
115
|
-
const lines = [
|
|
116
|
-
`## file graph: ${document.displayPath}`,
|
|
117
|
-
`Top-level declarations: ${document.symbols.length}`,
|
|
118
|
-
];
|
|
119
|
-
|
|
120
|
-
for (const symbol of document.symbols) {
|
|
162
|
+
return retryWhileSourceChanges(async () => {
|
|
121
163
|
throwIfAborted(signal);
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
164
|
+
const document = await openCodeDocument(manager, filePath, cwd, signal);
|
|
165
|
+
const locations = new LocationPresenter(cwd);
|
|
166
|
+
const lines = [
|
|
167
|
+
`## file graph: ${document.displayPath}`,
|
|
168
|
+
`Top-level declarations: ${document.symbols.length}`,
|
|
169
|
+
];
|
|
125
170
|
|
|
126
|
-
|
|
171
|
+
for (const symbol of document.symbols) {
|
|
172
|
+
throwIfAborted(signal);
|
|
173
|
+
const relations = await queryRelations(document, symbol, signal);
|
|
174
|
+
lines.push("", ...(await formatFileGraphSymbol(document, symbol, relations, locations)));
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
await assertAnsweredForCurrentText(manager, document, signal);
|
|
178
|
+
return lines.join("\n");
|
|
179
|
+
}, signal);
|
|
127
180
|
}
|
|
128
181
|
|
|
129
182
|
export function resolveLspCodeSymbol(
|
|
@@ -189,6 +242,7 @@ async function openCodeDocument(
|
|
|
189
242
|
);
|
|
190
243
|
}
|
|
191
244
|
|
|
245
|
+
const servedText = opened.client.documentContent(opened.uri);
|
|
192
246
|
const rawSymbols = await requestDocumentSymbols(opened.client, opened.uri, signal);
|
|
193
247
|
const symbols = normalizeDocumentSymbols(rawSymbols).sort(compareSymbols);
|
|
194
248
|
return {
|
|
@@ -197,6 +251,7 @@ async function openCodeDocument(
|
|
|
197
251
|
filePath: absolutePath,
|
|
198
252
|
displayPath: displayFilePath(absolutePath, cwd),
|
|
199
253
|
symbols,
|
|
254
|
+
servedText,
|
|
200
255
|
};
|
|
201
256
|
}
|
|
202
257
|
|
|
@@ -274,9 +329,11 @@ async function formatSymbolGraph(
|
|
|
274
329
|
"",
|
|
275
330
|
...(await formatReferences(relations.references, locations)),
|
|
276
331
|
"",
|
|
277
|
-
...(
|
|
332
|
+
...(unsupportedCalls(document, relations, "incoming") ??
|
|
333
|
+
(await formatIncomingCalls(relations.calls.incoming, locations))),
|
|
278
334
|
"",
|
|
279
|
-
...(
|
|
335
|
+
...(unsupportedCalls(document, relations, "outgoing") ??
|
|
336
|
+
(await formatOutgoingCalls(relations.calls.outgoing, locations))),
|
|
280
337
|
];
|
|
281
338
|
return lines.join("\n");
|
|
282
339
|
}
|
|
@@ -307,11 +364,25 @@ async function formatReferences(
|
|
|
307
364
|
return lines;
|
|
308
365
|
}
|
|
309
366
|
|
|
367
|
+
/** A calls section for a direction the server does not implement, or undefined when it does. */
|
|
368
|
+
function unsupportedCalls(
|
|
369
|
+
document: LspCodeDocument,
|
|
370
|
+
relations: SymbolRelations,
|
|
371
|
+
direction: LspCallDirection,
|
|
372
|
+
): string[] | undefined {
|
|
373
|
+
if (!relations.calls.unsupported.includes(direction)) return undefined;
|
|
374
|
+
const label = direction === "incoming" ? "Incoming calls" : "Outgoing calls";
|
|
375
|
+
return [`${label}: not supported by ${document.client.serverId}`];
|
|
376
|
+
}
|
|
377
|
+
|
|
310
378
|
async function formatIncomingCalls(
|
|
311
379
|
calls: readonly LspIncomingCall[],
|
|
312
380
|
locations: LocationPresenter,
|
|
313
381
|
): Promise<string[]> {
|
|
314
382
|
const lines = [`Incoming calls: ${calls.length}`];
|
|
383
|
+
// Servers such as clangd answer callers from an index that is rebuilt after edits.
|
|
384
|
+
if (calls.length === 0)
|
|
385
|
+
lines.push("- none found; the server's index can miss callers added in the last seconds");
|
|
315
386
|
|
|
316
387
|
for (const call of calls.slice(0, MAX_CALLS)) {
|
|
317
388
|
const line = call.fromRanges[0]?.start.line ?? call.from.selectionRange.start.line;
|
|
@@ -370,8 +441,12 @@ async function formatFileGraphSymbol(
|
|
|
370
441
|
`Selector: ${formatSymbolSelector(symbol.selector)}`,
|
|
371
442
|
`Definition: ${definitionAnchor}`,
|
|
372
443
|
`Used by: ${summarize(referenceFiles)}`,
|
|
373
|
-
|
|
374
|
-
|
|
444
|
+
...(unsupportedCalls(document, relations, "incoming") ?? [
|
|
445
|
+
`Incoming calls: ${summarize(incoming)}`,
|
|
446
|
+
]),
|
|
447
|
+
...(unsupportedCalls(document, relations, "outgoing") ?? [
|
|
448
|
+
`Outgoing calls: ${summarize(outgoing)}`,
|
|
449
|
+
]),
|
|
375
450
|
];
|
|
376
451
|
|
|
377
452
|
if (symbol.children.length > 0) {
|
|
@@ -483,3 +558,14 @@ function abortReason(signal: AbortSignal, fallback?: unknown): Error {
|
|
|
483
558
|
error.name = "AbortError";
|
|
484
559
|
return error;
|
|
485
560
|
}
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* Whether the server's ranges belong to this text: the symbol's name is where it says. A name
|
|
564
|
+
* range over several lines cannot be checked this way and never matches.
|
|
565
|
+
*/
|
|
566
|
+
function answeredFor(text: string, symbol: LspCodeSymbol): boolean {
|
|
567
|
+
const lines = text.split("\n");
|
|
568
|
+
const { start, end } = symbol.selectionRange;
|
|
569
|
+
if (start.line !== end.line) return false;
|
|
570
|
+
return lines[start.line]?.slice(start.character, end.character) === symbol.name;
|
|
571
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Diagnostic } from "pi-agent-ide/api/toolchain";
|
|
2
|
-
import type { LspClient } from "./client.
|
|
2
|
+
import type { LspClient } from "./client.ts";
|
|
3
3
|
|
|
4
4
|
/** A server capability that returns completed diagnostics rather than intermediate pushes. */
|
|
5
5
|
export interface CompletedDiagnosticAdapter {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
2
|
import { URI } from "vscode-uri";
|
|
3
|
-
import { DiagnosticSeverity, type LspDiagnostic } from "./types.
|
|
4
|
-
import type { LspClient } from "./client.
|
|
3
|
+
import { DiagnosticSeverity, type LspDiagnostic } from "./types.ts";
|
|
4
|
+
import type { LspClient } from "./client.ts";
|
|
5
5
|
|
|
6
|
-
import { completedDiagnosticAdapter } from "./diagnostic-adapters.
|
|
6
|
+
import { completedDiagnosticAdapter } from "./diagnostic-adapters.ts";
|
|
7
|
+
import { isMethodNotFound } from "./errors.ts";
|
|
7
8
|
import type { Diagnostic } from "pi-agent-ide/api/toolchain";
|
|
8
9
|
|
|
9
10
|
/** LSP diagnostics do not reliably distinguish parser errors from type errors. */
|
|
@@ -47,18 +48,35 @@ async function requestCurrentDiagnostics(
|
|
|
47
48
|
signal.throwIfAborted();
|
|
48
49
|
if (client.diagnosticMode !== "push") {
|
|
49
50
|
const version = client.documentVersion(uri);
|
|
51
|
+
// A repeated pull of the same version, such as after a refresh request, lets the server
|
|
52
|
+
// answer "unchanged" instead of checking the file again.
|
|
53
|
+
const previous = client.pulledReport(uri);
|
|
50
54
|
try {
|
|
51
|
-
const raw = await client.sendRequest<{
|
|
55
|
+
const raw = await client.sendRequest<{
|
|
56
|
+
kind: string;
|
|
57
|
+
resultId?: unknown;
|
|
58
|
+
items?: LspDiagnostic[];
|
|
59
|
+
}>(
|
|
52
60
|
"textDocument/diagnostic",
|
|
53
|
-
{
|
|
61
|
+
{
|
|
62
|
+
textDocument: { uri },
|
|
63
|
+
...(previous !== undefined && { previousResultId: previous.resultId }),
|
|
64
|
+
},
|
|
54
65
|
signal,
|
|
55
66
|
);
|
|
56
|
-
|
|
57
|
-
|
|
67
|
+
const items =
|
|
68
|
+
raw.kind === "full" && Array.isArray(raw.items)
|
|
69
|
+
? raw.items
|
|
70
|
+
: raw.kind === "unchanged" && previous !== undefined && raw.resultId === previous.resultId
|
|
71
|
+
? [...previous.diagnostics]
|
|
72
|
+
: undefined;
|
|
73
|
+
if (items === undefined) throw new Error("Invalid full diagnostic report");
|
|
58
74
|
if (client.documentVersion(uri) !== version)
|
|
59
75
|
throw new Error("Document changed during diagnostic request");
|
|
60
76
|
client.setDiagnosticMode("pull");
|
|
61
|
-
|
|
77
|
+
if (version !== undefined && typeof raw.resultId === "string")
|
|
78
|
+
client.rememberPulledReport(uri, { version, resultId: raw.resultId, diagnostics: items });
|
|
79
|
+
return classify(items, false, true);
|
|
62
80
|
} catch (error) {
|
|
63
81
|
if (!isMethodNotFound(error)) throw error;
|
|
64
82
|
client.setDiagnosticMode("push");
|
|
@@ -157,7 +175,3 @@ function classify(
|
|
|
157
175
|
const diagnostics = items.map(toDiagnostic);
|
|
158
176
|
return { diagnostics, syntaxErrors: [], otherDiagnostics: diagnostics, unversioned, complete };
|
|
159
177
|
}
|
|
160
|
-
|
|
161
|
-
function isMethodNotFound(error: unknown): boolean {
|
|
162
|
-
return error !== null && typeof error === "object" && "code" in error && error.code === -32601;
|
|
163
|
-
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
|
|
3
|
+
import type { LspClient } from "./client.ts";
|
|
4
|
+
|
|
5
|
+
/** Documents one operation keeps open, released together when it finishes. */
|
|
6
|
+
type DocumentScope = Map<LspClient, Map<string, () => void>>;
|
|
7
|
+
|
|
8
|
+
const operation = new AsyncLocalStorage<DocumentScope>();
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Run one language-server operation. Documents opened during it stay open until it finishes,
|
|
12
|
+
* then close unless another operation still uses them. Nested calls join the outer operation.
|
|
13
|
+
*/
|
|
14
|
+
export async function withLspDocuments<T>(run: () => Promise<T>): Promise<T> {
|
|
15
|
+
if (operation.getStore() !== undefined) return run();
|
|
16
|
+
const scope: DocumentScope = new Map();
|
|
17
|
+
try {
|
|
18
|
+
return await operation.run(scope, run);
|
|
19
|
+
} finally {
|
|
20
|
+
for (const releases of scope.values()) for (const release of releases.values()) release();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Keep a document open for the current operation; outside an operation it stays open. */
|
|
25
|
+
export function retainForCurrentOperation(client: LspClient, uri: string): void {
|
|
26
|
+
const scope = operation.getStore();
|
|
27
|
+
if (scope === undefined) return;
|
|
28
|
+
const releases = scope.get(client) ?? new Map<string, () => void>();
|
|
29
|
+
scope.set(client, releases);
|
|
30
|
+
if (!releases.has(uri)) releases.set(uri, client.retainDocument(uri));
|
|
31
|
+
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import { watch, type FSWatcher } from "node:fs";
|
|
2
|
-
import { readdir, stat } from "node:fs/promises";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import { URI } from "vscode-uri";
|
|
5
|
-
|
|
6
1
|
/** One language-server glob and its requested create/change/delete event mask. */
|
|
7
2
|
export interface WatchPattern {
|
|
8
3
|
globPattern: string | { baseUri: string | { uri: string }; pattern: string };
|
|
@@ -21,75 +16,4 @@ export interface LspFileWatcherSubscriptions {
|
|
|
21
16
|
unregister(id: string): void | Promise<void>;
|
|
22
17
|
dispose(): void | Promise<void>;
|
|
23
18
|
}
|
|
24
|
-
|
|
25
|
-
export class LspFileWatchers {
|
|
26
|
-
private readonly registrations = new Map<string, FSWatcher[]>();
|
|
27
|
-
|
|
28
|
-
private disposed = false;
|
|
29
|
-
|
|
30
|
-
constructor(
|
|
31
|
-
private readonly root: string,
|
|
32
|
-
private readonly changed: (change: WatchedFileChange) => void,
|
|
33
|
-
private readonly failed: (error: Error) => void,
|
|
34
|
-
) {}
|
|
35
|
-
|
|
36
|
-
/** Install all patterns for one workspace/didChangeWatchedFiles registration. */
|
|
37
|
-
async register(id: string, patterns: readonly WatchPattern[]): Promise<void> {
|
|
38
|
-
const watchers: FSWatcher[] = [];
|
|
39
|
-
try {
|
|
40
|
-
for (const pattern of patterns) {
|
|
41
|
-
const glob = pattern.globPattern;
|
|
42
|
-
const root =
|
|
43
|
-
typeof glob === "string"
|
|
44
|
-
? this.root
|
|
45
|
-
: URI.parse(typeof glob.baseUri === "string" ? glob.baseUri : glob.baseUri.uri).fsPath;
|
|
46
|
-
const expression = typeof glob === "string" ? glob : glob.pattern;
|
|
47
|
-
const matches = (file: string) =>
|
|
48
|
-
path.matchesGlob(path.isAbsolute(expression) ? path.join(root, file) : file, expression);
|
|
49
|
-
const existing = new Set((await readdir(root, { recursive: true })).filter(matches));
|
|
50
|
-
|
|
51
|
-
if (this.disposed) throw new Error("Language server file watchers are disposed");
|
|
52
|
-
const watcher = watch(root, { recursive: true }, (_event, name) => {
|
|
53
|
-
if (!name || !matches(name)) return;
|
|
54
|
-
void stat(path.join(root, name)).then(
|
|
55
|
-
() => {
|
|
56
|
-
if (!this.registrations.get(id)?.includes(watcher)) return;
|
|
57
|
-
const type = existing.has(name) ? 2 : 1;
|
|
58
|
-
existing.add(name);
|
|
59
|
-
if ((pattern.kind ?? 7) & (type === 1 ? 1 : 2))
|
|
60
|
-
this.changed({ uri: URI.file(path.join(root, name)).toString(), type });
|
|
61
|
-
},
|
|
62
|
-
(error: NodeJS.ErrnoException) => {
|
|
63
|
-
if (!this.registrations.get(id)?.includes(watcher)) return;
|
|
64
|
-
if (error.code !== "ENOENT") {
|
|
65
|
-
this.failed(error);
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
if (existing.delete(name) && (pattern.kind ?? 7) & 4)
|
|
69
|
-
this.changed({ uri: URI.file(path.join(root, name)).toString(), type: 3 });
|
|
70
|
-
},
|
|
71
|
-
);
|
|
72
|
-
});
|
|
73
|
-
watcher.on("error", this.failed);
|
|
74
|
-
watchers.push(watcher);
|
|
75
|
-
}
|
|
76
|
-
} catch (error) {
|
|
77
|
-
for (const watcher of watchers) watcher.close();
|
|
78
|
-
throw error;
|
|
79
|
-
}
|
|
80
|
-
this.unregister(id);
|
|
81
|
-
this.registrations.set(id, watchers);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/** Stop a server registration without affecting its other subscriptions. */
|
|
85
|
-
unregister(id: string): void {
|
|
86
|
-
for (const watcher of this.registrations.get(id) ?? []) watcher.close();
|
|
87
|
-
this.registrations.delete(id);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/** Close all subscriptions when the server exits or the session ends. */
|
|
91
|
-
dispose(): void {
|
|
92
|
-
this.disposed = true;
|
|
93
|
-
for (const id of this.registrations.keys()) this.unregister(id);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
19
|
+
export { LspFileWatchers } from "./server-request-handlers.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { LspClient } from "./client.
|
|
1
|
+
export { LspClient } from "./client.ts";
|
|
2
2
|
|
|
3
|
-
export { requestDiagnostics } from "./diagnostics.
|
|
3
|
+
export { requestDiagnostics } from "./diagnostics.ts";
|
|
4
4
|
|
|
5
5
|
export {
|
|
6
6
|
findDocumentSymbol,
|
|
@@ -8,23 +8,23 @@ export {
|
|
|
8
8
|
requestDocumentSymbols,
|
|
9
9
|
requestWorkspaceSymbols,
|
|
10
10
|
symbolKindName,
|
|
11
|
-
} from "./symbols.
|
|
11
|
+
} from "./symbols.ts";
|
|
12
12
|
|
|
13
|
-
export { requestRename, workspaceEditEntries } from "./rename.
|
|
13
|
+
export { requestRename, workspaceEditEntries } from "./rename.ts";
|
|
14
14
|
|
|
15
|
-
export { searchSymbols } from "./symbol-search.
|
|
15
|
+
export { searchSymbols } from "./symbol-search.ts";
|
|
16
16
|
|
|
17
|
-
export type { SymbolHit } from "./symbol-search.
|
|
17
|
+
export type { SymbolHit } from "./symbol-search.ts";
|
|
18
18
|
|
|
19
|
-
export type { LspWorkspaceEdit } from "./rename.
|
|
19
|
+
export type { LspWorkspaceEdit } from "./rename.ts";
|
|
20
20
|
|
|
21
|
-
export type { LspWorkspaceSymbol } from "./symbols.
|
|
21
|
+
export type { LspWorkspaceSymbol } from "./symbols.ts";
|
|
22
22
|
|
|
23
|
-
export { requestCallHierarchy, requestReferences } from "./navigation.
|
|
23
|
+
export { requestCallHierarchy, requestReferences } from "./navigation.ts";
|
|
24
24
|
|
|
25
|
-
export { readLspFileGraph, readLspSymbolGraph, resolveLspCodeSymbol } from "./code-views.
|
|
25
|
+
export { readLspFileGraph, readLspSymbolGraph, resolveLspCodeSymbol } from "./code-views.ts";
|
|
26
26
|
|
|
27
|
-
export type { LspCodeSymbol } from "./code-views.
|
|
27
|
+
export type { LspCodeSymbol } from "./code-views.ts";
|
|
28
28
|
|
|
29
29
|
export type {
|
|
30
30
|
LspCallHierarchyItem,
|
|
@@ -32,15 +32,15 @@ export type {
|
|
|
32
32
|
LspIncomingCall,
|
|
33
33
|
LspLocation,
|
|
34
34
|
LspOutgoingCall,
|
|
35
|
-
} from "./navigation.
|
|
35
|
+
} from "./navigation.ts";
|
|
36
36
|
|
|
37
|
-
export { createLspCompiler } from "./lsp-compiler.
|
|
37
|
+
export { createLspCompiler } from "./lsp-compiler.ts";
|
|
38
38
|
|
|
39
|
-
export { LspManager } from "./manager.
|
|
39
|
+
export { LspManager } from "./manager.ts";
|
|
40
40
|
|
|
41
|
-
export type { LspPushDiagnosticsEvent } from "./manager.
|
|
41
|
+
export type { LspPushDiagnosticsEvent } from "./manager.ts";
|
|
42
42
|
|
|
43
|
-
export { LspServerRegistry } from "./registry.
|
|
43
|
+
export { LspServerRegistry } from "./registry.ts";
|
|
44
44
|
|
|
45
45
|
export type {
|
|
46
46
|
DiagnosticSeverity,
|
|
@@ -52,8 +52,8 @@ export type {
|
|
|
52
52
|
ResolvedServer,
|
|
53
53
|
ServerCapability,
|
|
54
54
|
ServerConfig,
|
|
55
|
-
} from "./types.
|
|
55
|
+
} from "./types.ts";
|
|
56
56
|
|
|
57
|
-
export { DiagnosticSeverity as LspSeverity } from "./types.
|
|
57
|
+
export { DiagnosticSeverity as LspSeverity } from "./types.ts";
|
|
58
58
|
|
|
59
|
-
export type { LspDocumentSymbol } from "./symbols.
|
|
59
|
+
export type { LspDocumentSymbol } from "./symbols.ts";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { requestDiagnostics } from "./diagnostics.
|
|
1
|
+
import { requestDiagnostics } from "./diagnostics.ts";
|
|
2
|
+
import { withLspDocuments } from "./document-leases.ts";
|
|
2
3
|
|
|
3
|
-
import type { LspClient } from "./client.
|
|
4
|
-
import type { LspManager } from "./manager.
|
|
4
|
+
import type { LspClient } from "./client.ts";
|
|
5
|
+
import type { LspManager } from "./manager.ts";
|
|
5
6
|
import type { Compiler, Diagnostic, ToolContext } from "pi-agent-ide/api/toolchain";
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -28,7 +29,7 @@ export function createLspCompiler(
|
|
|
28
29
|
context.signal?.throwIfAborted();
|
|
29
30
|
const manager = await managerForFile(context.cwd, filePath, context.signal);
|
|
30
31
|
context.signal?.throwIfAborted();
|
|
31
|
-
const result = await openAndDiagnose(filePath, context, manager);
|
|
32
|
+
const result = await withLspDocuments(() => openAndDiagnose(filePath, context, manager));
|
|
32
33
|
|
|
33
34
|
if (!result) {
|
|
34
35
|
throw new Error("No diagnostic language server for this source");
|