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,6 +1,6 @@
|
|
|
1
1
|
import { rm, unlink } from "node:fs/promises";
|
|
2
|
-
import { prepareFileTransfer, prepareObjectTransfer, type TransferKind } from "./file-transfers.
|
|
3
|
-
import { prepareDeletion, type DeletePolicyContext } from "./delete-policy.
|
|
2
|
+
import { prepareFileTransfer, prepareObjectTransfer, type TransferKind } from "./file-transfers.ts";
|
|
3
|
+
import { prepareDeletion, type DeletePolicyContext } from "./delete-policy.ts";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import fs from "fs-extra";
|
|
6
6
|
import { Type } from "typebox";
|
|
@@ -11,9 +11,9 @@ import type {
|
|
|
11
11
|
FileOperationInput,
|
|
12
12
|
FileOperationResult,
|
|
13
13
|
FileOperationResolver,
|
|
14
|
-
} from "#src/api/file-operations.
|
|
15
|
-
export { fileOperations } from "#src/api/file-operations.
|
|
16
|
-
export type { FileOperation, FileOperationResult } from "#src/api/file-operations.
|
|
14
|
+
} from "#src/api/file-operations.ts";
|
|
15
|
+
export { fileOperations } from "#src/api/file-operations.ts";
|
|
16
|
+
export type { FileOperation, FileOperationResult } from "#src/api/file-operations.ts";
|
|
17
17
|
const filePath = Type.String({
|
|
18
18
|
minLength: 1,
|
|
19
19
|
description:
|
|
@@ -2,7 +2,7 @@ import { lstat, readFile } from "node:fs/promises";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import type { AgentToolResult } from "@earendil-works/pi-coding-agent";
|
|
4
4
|
import type { ResultSourceTarget, ResultTargetStore } from "pi-agent-resource";
|
|
5
|
-
import type { FileMutationBatchResult } from "#src/api/mutation-result.
|
|
5
|
+
import type { FileMutationBatchResult } from "#src/api/mutation-result.ts";
|
|
6
6
|
|
|
7
7
|
/** Publish whole destination/restored files only after checking their actual text bytes. */
|
|
8
8
|
export async function attachFileMutationTargets(
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { localFileTransferAccess } from "#src/api/native-files.
|
|
2
|
+
import { localFileTransferAccess } from "#src/api/native-files.ts";
|
|
3
3
|
import type {
|
|
4
4
|
FileObjectEntry,
|
|
5
5
|
FileObjectSnapshot,
|
|
6
6
|
FileTransferEndpoint,
|
|
7
7
|
FileTransferGuard,
|
|
8
|
-
} from "#src/api/file-transfers.
|
|
8
|
+
} from "#src/api/file-transfers.ts";
|
|
9
9
|
import {
|
|
10
10
|
assertUnprotectedTransferPath,
|
|
11
11
|
prepareDeletionGuard,
|
|
12
12
|
type DeletePolicyContext,
|
|
13
13
|
type DeletionGuard,
|
|
14
|
-
} from "./delete-policy.
|
|
14
|
+
} from "./delete-policy.ts";
|
|
15
15
|
|
|
16
16
|
/** Object kinds supported by byte-preserving whole-object transfers. */
|
|
17
17
|
export type TransferKind = "file" | "directory" | "symlink";
|
|
@@ -3,7 +3,7 @@ import path from "node:path";
|
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import type { AgentToolResult } from "@earendil-works/pi-coding-agent";
|
|
5
5
|
import type { ImageContent, ResultImageStore } from "pi-agent-resource";
|
|
6
|
-
import type { FileMutationBatchResult } from "#src/core/mutation-result/file-mutation-result.
|
|
6
|
+
import type { FileMutationBatchResult } from "#src/core/mutation-result/file-mutation-result.ts";
|
|
7
7
|
|
|
8
8
|
const extensions: Readonly<Record<string, readonly string[]>> = {
|
|
9
9
|
"image/png": [".png"],
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { requiredValue } from "pi-agent-invariant";
|
|
2
|
-
import { diffLines } from "diff";
|
|
3
2
|
import { type PresentedTextRow, renderPresentedTextRows } from "pi-agent-text";
|
|
4
3
|
|
|
5
|
-
import {
|
|
4
|
+
import { diffTextLines } from "./diff.ts";
|
|
5
|
+
import { formatHint } from "./inline-hints.ts";
|
|
6
6
|
|
|
7
|
-
import type { DiagnosticHint, FileMutationResult } from "./file-mutation-result.
|
|
7
|
+
import type { DiagnosticHint, FileMutationResult } from "./file-mutation-result.ts";
|
|
8
8
|
|
|
9
9
|
const CONTEXT_LINES = 5;
|
|
10
10
|
const MAX_SYNTAX_ERRORS = 5;
|
|
@@ -175,7 +175,7 @@ export function buildDiffLines(
|
|
|
175
175
|
let beforeLine = 1;
|
|
176
176
|
let afterLine = 1;
|
|
177
177
|
|
|
178
|
-
for (const part of
|
|
178
|
+
for (const part of diffTextLines(before, after)) {
|
|
179
179
|
for (const text of splitPartLines(part.value)) {
|
|
180
180
|
if (part.added) {
|
|
181
181
|
result.push({ kind: "added", text, afterLine, positionLine: afterLine });
|
|
@@ -196,7 +196,7 @@ export function buildDiffLines(
|
|
|
196
196
|
}
|
|
197
197
|
|
|
198
198
|
export function editRanges(
|
|
199
|
-
fmr: FileMutationResult,
|
|
199
|
+
fmr: { readonly data: Pick<FileMutationResult["data"], "rawChanges"> },
|
|
200
200
|
after: string,
|
|
201
201
|
afterLineCount: number,
|
|
202
202
|
diff: readonly AgentDiffLine[],
|
|
@@ -320,7 +320,12 @@ export function isLineVisible(line: number, ranges: readonly LineRange[]): boole
|
|
|
320
320
|
|
|
321
321
|
function lineAtOffset(content: string, offset: number): number {
|
|
322
322
|
const boundedOffset = Math.max(0, Math.min(content.length, offset));
|
|
323
|
-
|
|
323
|
+
let line = 1;
|
|
324
|
+
for (let index = content.indexOf("\n"); index !== -1 && index < boundedOffset;) {
|
|
325
|
+
line += 1;
|
|
326
|
+
index = content.indexOf("\n", index + 1);
|
|
327
|
+
}
|
|
328
|
+
return line;
|
|
324
329
|
}
|
|
325
330
|
|
|
326
331
|
export function splitLines(content: string): string[] {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { requiredValue } from "pi-agent-invariant";
|
|
2
|
-
import {
|
|
2
|
+
import { type Change, diffLines, formatPatch, type StructuredPatchHunk } from "diff";
|
|
3
3
|
|
|
4
4
|
export interface DiffStats {
|
|
5
5
|
removed: number;
|
|
@@ -11,49 +11,242 @@ export interface UnifiedDiffResult {
|
|
|
11
11
|
stats: DiffStats;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
const PATCH_CONTEXT_LINES = 3;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Creates a unified diff with three context lines, as jsdiff's `createTwoFilesPatch` does, but runs
|
|
18
|
+
* the line diff only over the lines that differ.
|
|
19
|
+
*/
|
|
14
20
|
export function createUnifiedDiff(
|
|
15
21
|
path: string,
|
|
16
22
|
beforeContent: string,
|
|
17
23
|
afterContent: string,
|
|
18
24
|
afterPath = path,
|
|
19
25
|
): UnifiedDiffResult {
|
|
20
|
-
const
|
|
21
|
-
|
|
26
|
+
const window = lineDiffWindow(beforeContent, afterContent, PATCH_CONTEXT_LINES);
|
|
27
|
+
const stats: DiffStats = { removed: 0, added: 0 };
|
|
28
|
+
for (const part of window.parts) {
|
|
29
|
+
if (part.added) {
|
|
30
|
+
stats.added += part.count;
|
|
31
|
+
} else if (part.removed) {
|
|
32
|
+
stats.removed += part.count;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const diff = formatPatch({
|
|
36
|
+
oldFileName: path,
|
|
37
|
+
newFileName: afterPath,
|
|
38
|
+
oldHeader: "",
|
|
39
|
+
newHeader: "",
|
|
40
|
+
hunks: patchHunks(window.parts, window.skippedLines + 1, PATCH_CONTEXT_LINES),
|
|
22
41
|
})
|
|
23
42
|
.replace(/^(?:Index: .*\n)?={3,}\n?/m, "")
|
|
24
43
|
.trimEnd();
|
|
25
44
|
|
|
26
|
-
return { diff, stats
|
|
45
|
+
return { diff, stats };
|
|
27
46
|
}
|
|
28
47
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Diffs two texts line by line like jsdiff's `diffLines`, but only runs the diff over the lines
|
|
50
|
+
* between their common leading and trailing lines, so a small edit of a large file stays cheap.
|
|
51
|
+
*/
|
|
52
|
+
export function diffTextLines(beforeContent: string, afterContent: string): Change[] {
|
|
53
|
+
return lineDiffWindow(beforeContent, afterContent, Infinity).parts;
|
|
54
|
+
}
|
|
32
55
|
|
|
33
|
-
|
|
34
|
-
|
|
56
|
+
interface LineDiffWindow {
|
|
57
|
+
/** Number of unchanged lines before the first part. */
|
|
58
|
+
readonly skippedLines: number;
|
|
59
|
+
/** Line diff parts; unchanged parts keep at most the requested context around changes. */
|
|
60
|
+
readonly parts: Change[];
|
|
61
|
+
}
|
|
35
62
|
|
|
36
|
-
|
|
37
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Trims the common leading and trailing lines, diffs the rest with jsdiff and surrounds the result
|
|
65
|
+
* with up to `contextLines` of the trimmed lines on each side. Lines end after `\n`, as in jsdiff's
|
|
66
|
+
* line tokens, so the parts match what `diffLines` returns for that region.
|
|
67
|
+
*/
|
|
68
|
+
function lineDiffWindow(before: string, after: string, contextLines: number): LineDiffWindow {
|
|
69
|
+
const shorter = Math.min(before.length, after.length);
|
|
70
|
+
let common = 0;
|
|
71
|
+
while (common < shorter && before.charCodeAt(common) === after.charCodeAt(common)) {
|
|
72
|
+
common += 1;
|
|
73
|
+
}
|
|
74
|
+
const prefixEnd =
|
|
75
|
+
common === before.length && common === after.length
|
|
76
|
+
? common
|
|
77
|
+
: common === 0
|
|
78
|
+
? 0
|
|
79
|
+
: before.lastIndexOf("\n", common - 1) + 1;
|
|
80
|
+
|
|
81
|
+
let commonSuffix = 0;
|
|
82
|
+
const maxSuffix = shorter - prefixEnd;
|
|
83
|
+
while (
|
|
84
|
+
commonSuffix < maxSuffix &&
|
|
85
|
+
before.charCodeAt(before.length - 1 - commonSuffix) ===
|
|
86
|
+
after.charCodeAt(after.length - 1 - commonSuffix)
|
|
87
|
+
) {
|
|
88
|
+
commonSuffix += 1;
|
|
89
|
+
}
|
|
90
|
+
// The trailing lines start after a line break that lies inside the common suffix.
|
|
91
|
+
const breakInSuffix = before.indexOf("\n", before.length - commonSuffix);
|
|
92
|
+
const suffixStart =
|
|
93
|
+
commonSuffix === 0 || breakInSuffix === -1 ? before.length : breakInSuffix + 1;
|
|
94
|
+
const afterSuffixStart = after.length - (before.length - suffixStart);
|
|
95
|
+
|
|
96
|
+
let contextStart = prefixEnd;
|
|
97
|
+
let contextEnd = suffixStart;
|
|
98
|
+
if (contextLines === Infinity) {
|
|
99
|
+
contextStart = 0;
|
|
100
|
+
contextEnd = before.length;
|
|
101
|
+
} else {
|
|
102
|
+
for (let line = 0; line < contextLines && contextStart > 0; line += 1) {
|
|
103
|
+
contextStart = contextStart < 2 ? 0 : before.lastIndexOf("\n", contextStart - 2) + 1;
|
|
38
104
|
}
|
|
105
|
+
for (let line = 0; line < contextLines && contextEnd < before.length; line += 1) {
|
|
106
|
+
const lineBreak = before.indexOf("\n", contextEnd);
|
|
107
|
+
contextEnd = lineBreak === -1 ? before.length : lineBreak + 1;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
39
110
|
|
|
40
|
-
|
|
41
|
-
|
|
111
|
+
const parts: Change[] = [];
|
|
112
|
+
const pushUnchanged = (value: string) => {
|
|
113
|
+
if (value.length === 0) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const last = parts.at(-1);
|
|
117
|
+
if (last !== undefined && !last.added && !last.removed) {
|
|
118
|
+
last.value += value;
|
|
119
|
+
last.count += countDiffLines(value);
|
|
120
|
+
} else {
|
|
121
|
+
parts.push({ value, count: countDiffLines(value), added: false, removed: false });
|
|
42
122
|
}
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
pushUnchanged(before.slice(contextStart, prefixEnd));
|
|
126
|
+
if (prefixEnd < suffixStart || prefixEnd < afterSuffixStart) {
|
|
127
|
+
for (const part of diffLines(
|
|
128
|
+
before.slice(prefixEnd, suffixStart),
|
|
129
|
+
after.slice(prefixEnd, afterSuffixStart),
|
|
130
|
+
)) {
|
|
131
|
+
if (part.added || part.removed) {
|
|
132
|
+
parts.push(part);
|
|
133
|
+
} else {
|
|
134
|
+
pushUnchanged(part.value);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
pushUnchanged(before.slice(suffixStart, contextEnd));
|
|
139
|
+
return { skippedLines: countLineBreaks(before, contextStart), parts };
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** Groups line diff parts into unified diff hunks the way jsdiff's `structuredPatch` does. */
|
|
143
|
+
function patchHunks(
|
|
144
|
+
parts: readonly Change[],
|
|
145
|
+
firstLine: number,
|
|
146
|
+
context: number,
|
|
147
|
+
): StructuredPatchHunk[] {
|
|
148
|
+
const hunks: StructuredPatchHunk[] = [];
|
|
149
|
+
const partLines = parts.map((part) => patchLines(part.value));
|
|
150
|
+
let oldRangeStart = 0;
|
|
151
|
+
let newRangeStart = 0;
|
|
152
|
+
let range: string[] = [];
|
|
153
|
+
let oldLine = firstLine;
|
|
154
|
+
let newLine = firstLine;
|
|
155
|
+
|
|
156
|
+
for (let index = 0; index < parts.length; index += 1) {
|
|
157
|
+
const part = requiredValue(parts[index]);
|
|
158
|
+
const lines = requiredValue(partLines[index]);
|
|
159
|
+
if (part.added || part.removed) {
|
|
160
|
+
if (oldRangeStart === 0) {
|
|
161
|
+
const previous = partLines[index - 1];
|
|
162
|
+
oldRangeStart = oldLine;
|
|
163
|
+
newRangeStart = newLine;
|
|
164
|
+
range =
|
|
165
|
+
previous === undefined || context === 0
|
|
166
|
+
? []
|
|
167
|
+
: previous.slice(-context).map((line) => ` ${line}`);
|
|
168
|
+
oldRangeStart -= range.length;
|
|
169
|
+
newRangeStart -= range.length;
|
|
170
|
+
}
|
|
171
|
+
for (const line of lines) {
|
|
172
|
+
range.push(`${part.added ? "+" : "-"}${line}`);
|
|
173
|
+
}
|
|
174
|
+
if (part.added) {
|
|
175
|
+
newLine += lines.length;
|
|
176
|
+
} else {
|
|
177
|
+
oldLine += lines.length;
|
|
178
|
+
}
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (oldRangeStart !== 0) {
|
|
183
|
+
if (lines.length <= context * 2 && index < parts.length - 1) {
|
|
184
|
+
range.push(...lines.map((line) => ` ${line}`));
|
|
185
|
+
} else {
|
|
186
|
+
const contextSize = Math.min(lines.length, context);
|
|
187
|
+
range.push(...lines.slice(0, contextSize).map((line) => ` ${line}`));
|
|
188
|
+
hunks.push({
|
|
189
|
+
oldStart: oldRangeStart,
|
|
190
|
+
oldLines: oldLine - oldRangeStart + contextSize,
|
|
191
|
+
newStart: newRangeStart,
|
|
192
|
+
newLines: newLine - newRangeStart + contextSize,
|
|
193
|
+
lines: range,
|
|
194
|
+
});
|
|
195
|
+
oldRangeStart = 0;
|
|
196
|
+
newRangeStart = 0;
|
|
197
|
+
range = [];
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
oldLine += lines.length;
|
|
201
|
+
newLine += lines.length;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
if (oldRangeStart !== 0) {
|
|
205
|
+
hunks.push({
|
|
206
|
+
oldStart: oldRangeStart,
|
|
207
|
+
oldLines: oldLine - oldRangeStart,
|
|
208
|
+
newStart: newRangeStart,
|
|
209
|
+
newLines: newLine - newRangeStart,
|
|
210
|
+
lines: range,
|
|
211
|
+
});
|
|
43
212
|
}
|
|
44
213
|
|
|
45
|
-
|
|
214
|
+
for (const hunk of hunks) {
|
|
215
|
+
hunk.lines = hunk.lines.flatMap((line) =>
|
|
216
|
+
line.endsWith("\n") ? [line.slice(0, -1)] : [line, "\"],
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
return hunks;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/** Splits a part into lines that keep their trailing `\n`. */
|
|
223
|
+
function patchLines(text: string): string[] {
|
|
224
|
+
if (text.length === 0) {
|
|
225
|
+
return [];
|
|
226
|
+
}
|
|
227
|
+
const lines = text.split("\n").map((line) => `${line}\n`);
|
|
228
|
+
const last = requiredValue(lines.pop());
|
|
229
|
+
if (!text.endsWith("\n")) {
|
|
230
|
+
lines.push(last.slice(0, -1));
|
|
231
|
+
}
|
|
232
|
+
return lines;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function countLineBreaks(value: string, end: number): number {
|
|
236
|
+
let count = 0;
|
|
237
|
+
for (let index = value.indexOf("\n"); index !== -1 && index < end;) {
|
|
238
|
+
count += 1;
|
|
239
|
+
index = value.indexOf("\n", index + 1);
|
|
240
|
+
}
|
|
241
|
+
return count;
|
|
46
242
|
}
|
|
47
243
|
|
|
48
244
|
function countDiffLines(value: string): number {
|
|
49
245
|
if (value.length === 0) {
|
|
50
246
|
return 0;
|
|
51
247
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return normalized.endsWith("\n")
|
|
55
|
-
? normalized.slice(0, -1).split("\n").length
|
|
56
|
-
: normalized.split("\n").length;
|
|
248
|
+
const lineBreaks = countLineBreaks(value, value.length);
|
|
249
|
+
return value.endsWith("\n") ? lineBreaks : lineBreaks + 1;
|
|
57
250
|
}
|
|
58
251
|
|
|
59
252
|
export interface ChangedRange {
|
|
@@ -73,7 +266,7 @@ export interface ChangedRange {
|
|
|
73
266
|
* numbering. Adjacent ranges are merged into single islands.
|
|
74
267
|
*/
|
|
75
268
|
export function computeChangedRanges(beforeContent: string, afterContent: string): ChangedRange[] {
|
|
76
|
-
const parts =
|
|
269
|
+
const parts = diffTextLines(beforeContent, afterContent);
|
|
77
270
|
const ranges: ChangedRange[] = [];
|
|
78
271
|
let afterLine = 0;
|
|
79
272
|
|
package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { renderAgentDiff } from "./agent-diff.
|
|
2
|
-
import { groupReplacements, renderGroupedReplacements } from "./grouped-replacements.
|
|
3
|
-
import { renderFinalStateFragment } from "./final-state-fragment.
|
|
4
|
-
import { type FileMutationResult } from "./file-mutation-result.
|
|
1
|
+
import { renderAgentDiff } from "./agent-diff.ts";
|
|
2
|
+
import { groupReplacements, renderGroupedReplacements } from "./grouped-replacements.ts";
|
|
3
|
+
import { renderFinalStateFragment } from "./final-state-fragment.ts";
|
|
4
|
+
import { type FileMutationResult } from "./file-mutation-result.ts";
|
|
5
5
|
|
|
6
6
|
// ─── Agent-facing result formatter ───────────────────────────────────────
|
|
7
7
|
|
|
@@ -8,9 +8,43 @@ import {
|
|
|
8
8
|
metadataForLine,
|
|
9
9
|
selectSyntaxHints,
|
|
10
10
|
splitLines,
|
|
11
|
-
} from "./agent-diff.
|
|
11
|
+
} from "./agent-diff.ts";
|
|
12
12
|
|
|
13
|
-
import type { DiagnosticHint, FileMutationResult } from "./file-mutation-result.
|
|
13
|
+
import type { DiagnosticHint, FileMutationResult } from "./file-mutation-result.ts";
|
|
14
|
+
|
|
15
|
+
/** Inputs that decide which final lines a successful mutation shows. */
|
|
16
|
+
export interface FinalStateLineInput {
|
|
17
|
+
readonly before: string;
|
|
18
|
+
readonly after: string;
|
|
19
|
+
readonly rawChanges: NonNullable<FileMutationResult["data"]["rawChanges"]>;
|
|
20
|
+
readonly hints: readonly DiagnosticHint[];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Lists every final line the fragment can show for these inputs, including all compiler errors,
|
|
25
|
+
* so line presentation computed from it covers the rendered fragment.
|
|
26
|
+
*/
|
|
27
|
+
export function finalStateLineNumbers(input: FinalStateLineInput): number[] {
|
|
28
|
+
const lineCount = Math.max(1, splitLines(input.after).length);
|
|
29
|
+
const baseRanges = editRanges(
|
|
30
|
+
{ data: { rawChanges: input.rawChanges } },
|
|
31
|
+
input.after,
|
|
32
|
+
lineCount,
|
|
33
|
+
input.rawChanges.length > 0 ? [] : buildDiffLines(input.before, input.after, lineCount),
|
|
34
|
+
);
|
|
35
|
+
const ranges = expandAndMerge(
|
|
36
|
+
[
|
|
37
|
+
...baseRanges,
|
|
38
|
+
...input.hints
|
|
39
|
+
.filter((hint) => hint.source === "compiler" && hint.severity === "error")
|
|
40
|
+
.map((hint) => ({ start: hint.line, end: hint.line })),
|
|
41
|
+
],
|
|
42
|
+
lineCount,
|
|
43
|
+
);
|
|
44
|
+
return ranges.flatMap((range) =>
|
|
45
|
+
Array.from({ length: range.end - range.start + 1 }, (_, index) => range.start + index),
|
|
46
|
+
);
|
|
47
|
+
}
|
|
14
48
|
|
|
15
49
|
/** Renders the final file state around a successful mutation. */
|
|
16
50
|
export function renderFinalStateFragment(fmr: FileMutationResult, path: string): string[] {
|
|
@@ -23,7 +57,9 @@ export function renderFinalStateFragment(fmr: FileMutationResult, path: string):
|
|
|
23
57
|
|
|
24
58
|
const lines = splitLines(after);
|
|
25
59
|
const lineCount = Math.max(1, lines.length);
|
|
26
|
-
|
|
60
|
+
// Edit ranges come from the raw changes when they exist; only a mutation without them needs a diff.
|
|
61
|
+
const diff =
|
|
62
|
+
(fmr.data.rawChanges ?? []).length > 0 ? [] : buildDiffLines(before, after, lineCount);
|
|
27
63
|
const baseRanges = editRanges(fmr, after, lineCount, diff);
|
|
28
64
|
const visibleRanges = expandAndMerge(baseRanges, lineCount);
|
|
29
65
|
const syntaxHints = fmr.hints.filter(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FileMutationResult } from "./file-mutation-result.
|
|
1
|
+
import type { FileMutationResult } from "./file-mutation-result.ts";
|
|
2
2
|
|
|
3
3
|
/** Exact applied replacement pairs and complete per-file counts, before formatting. */
|
|
4
4
|
export interface GroupedReplacements {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { requiredValue } from "pi-agent-invariant";
|
|
2
|
-
import type { DiagnosticHint } from "./file-mutation-result.
|
|
2
|
+
import type { DiagnosticHint } from "./file-mutation-result.ts";
|
|
3
3
|
|
|
4
4
|
export interface InsertHintsOptions {
|
|
5
5
|
readonly suppressContextHunksFor?: (hint: DiagnosticHint) => boolean;
|
|
@@ -3,14 +3,14 @@ import { fileURLToPath } from "node:url";
|
|
|
3
3
|
import type { ResultRange, ResultSourceTarget } from "pi-agent-resource";
|
|
4
4
|
import type { ResultTargetStore } from "pi-agent-resource";
|
|
5
5
|
import type { AgentToolResult } from "@earendil-works/pi-coding-agent";
|
|
6
|
-
import type { FileMutationBatchResult } from "#src/api/mutation-result.
|
|
6
|
+
import type { FileMutationBatchResult } from "#src/api/mutation-result.ts";
|
|
7
7
|
import { createTextDocument } from "pi-agent-text";
|
|
8
|
-
import type { TextEditCompletion } from "#src/api/edit-completion.
|
|
9
|
-
import type { TextMutation, TextMutationEdit } from "#src/api/mutation-tool.
|
|
10
|
-
import { applyTextChanges } from "./text-change-engine.
|
|
11
|
-
import { attachFileMutationTargets } from "./file-result-targets.
|
|
8
|
+
import type { TextEditCompletion } from "#src/api/edit-completion.ts";
|
|
9
|
+
import type { TextMutation, TextMutationEdit } from "#src/api/mutation-tool.ts";
|
|
10
|
+
import { applyTextChanges } from "./text-change-engine.ts";
|
|
11
|
+
import { attachFileMutationTargets } from "./file-result-targets.ts";
|
|
12
12
|
|
|
13
|
-
import type { TextEditorCore } from "./text-editor-core.
|
|
13
|
+
import type { TextEditorCore } from "./text-editor-core.ts";
|
|
14
14
|
|
|
15
15
|
export type MutationSnapshotReader = (
|
|
16
16
|
source: string,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
|
-
import { withTextEditOrigin } from "./text-edit-origin.
|
|
2
|
+
import { withTextEditOrigin } from "./text-edit-origin.ts";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { requiredValue } from "pi-agent-invariant";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
@@ -8,24 +8,24 @@ import type {
|
|
|
8
8
|
ExtensionAPI,
|
|
9
9
|
ExtensionContext,
|
|
10
10
|
} from "@earendil-works/pi-coding-agent";
|
|
11
|
-
import type { AnyTextMutationToolRegistration } from "#src/api/mutation-tool.
|
|
12
|
-
import { getLastResolvedResource } from "#src/api/last-resolved-resource.
|
|
13
|
-
import { isMutationAnchorValue } from "#src/api/mutation-tool.
|
|
14
|
-
import type { FileMutationBatchResult, FileMutationResult } from "#src/api/mutation-result.
|
|
15
|
-
import type { TextBatchEntry } from "./text-edit-batch.
|
|
16
|
-
import type { TextEditCompletion } from "#src/api/edit-completion.
|
|
17
|
-
import type { TextEditorCore, TextResourceEditRequest } from "./text-editor-core.
|
|
18
|
-
import { BatchExecutionJournal } from "./text-edit-batch-execution.
|
|
11
|
+
import type { AnyTextMutationToolRegistration } from "#src/api/mutation-tool.ts";
|
|
12
|
+
import { getLastResolvedResource } from "#src/api/last-resolved-resource.ts";
|
|
13
|
+
import { isMutationAnchorValue } from "#src/api/mutation-tool.ts";
|
|
14
|
+
import type { FileMutationBatchResult, FileMutationResult } from "#src/api/mutation-result.ts";
|
|
15
|
+
import type { TextBatchEntry } from "./text-edit-batch.ts";
|
|
16
|
+
import type { TextEditCompletion } from "#src/api/edit-completion.ts";
|
|
17
|
+
import type { TextEditorCore, TextResourceEditRequest } from "./text-editor-core.ts";
|
|
18
|
+
import { BatchExecutionJournal } from "./text-edit-batch-execution.ts";
|
|
19
19
|
import {
|
|
20
20
|
executeRegisteredTextBatch,
|
|
21
21
|
planRegisteredTextBatch,
|
|
22
22
|
type PlannedTextBatch,
|
|
23
|
-
} from "./text-edit-batch-registrar.
|
|
24
|
-
import { buildFailedTextMutationResult, mutationSources } from "./text-mutation.
|
|
25
|
-
import { isWholeFileInvocation } from "./file-operation-tools.
|
|
26
|
-
import { isResultInput } from "./result-transfer.
|
|
27
|
-
import { FileMutationAgentResult } from "./mutation-result/file-mutation-agent-result.
|
|
28
|
-
import { writeProblemNotices } from "./write-agent-result.
|
|
23
|
+
} from "./text-edit-batch-registrar.ts";
|
|
24
|
+
import { buildFailedTextMutationResult, mutationSources } from "./text-mutation.ts";
|
|
25
|
+
import { isWholeFileInvocation } from "./file-operation-tools.ts";
|
|
26
|
+
import { isResultInput } from "./result-transfer.ts";
|
|
27
|
+
import { FileMutationAgentResult } from "./mutation-result/file-mutation-agent-result.ts";
|
|
28
|
+
import { writeProblemNotices } from "./write-agent-result.ts";
|
|
29
29
|
import {
|
|
30
30
|
ResourceScheduler,
|
|
31
31
|
resourceAccesses,
|
|
@@ -34,16 +34,16 @@ import {
|
|
|
34
34
|
type ResultTargetStore,
|
|
35
35
|
type StructuredResult,
|
|
36
36
|
} from "pi-agent-resource";
|
|
37
|
-
import { createPostEditScope } from "./post-edit-scope.
|
|
38
|
-
import { committedMutationTargets, unchangedCopySources } from "./mutation-result-targets.
|
|
39
|
-
import { FileMutationResult as MutationPresentation } from "./mutation-result/file-mutation-result.
|
|
40
|
-
import { isFormattingContribution, isDiffStatusContribution } from "#src/api/post-edit.
|
|
41
|
-
import { captureScriptMutation } from "./text-mutation.
|
|
37
|
+
import { createPostEditScope } from "./post-edit-scope.ts";
|
|
38
|
+
import { committedMutationTargets, unchangedCopySources } from "./mutation-result-targets.ts";
|
|
39
|
+
import { FileMutationResult as MutationPresentation } from "./mutation-result/file-mutation-result.ts";
|
|
40
|
+
import { isFormattingContribution, isDiffStatusContribution } from "#src/api/post-edit.ts";
|
|
41
|
+
import { captureScriptMutation } from "./text-mutation.ts";
|
|
42
42
|
import {
|
|
43
43
|
NATIVE_EDIT_BATCH_EVENT,
|
|
44
44
|
type NativeEditBatchEvent,
|
|
45
|
-
} from "#src/api/native-edit-batch-event.
|
|
46
|
-
import { mutationOutcome, type MutationData, type BatchMutationData } from "./structured-result.
|
|
45
|
+
} from "#src/api/native-edit-batch-event.ts";
|
|
46
|
+
import { mutationOutcome, type MutationData, type BatchMutationData } from "./structured-result.ts";
|
|
47
47
|
|
|
48
48
|
/** A confirmed whole-file write can finish formatting after its child tool has returned. */
|
|
49
49
|
function appliedFileAction(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
2
|
import { requiredValue } from "pi-agent-invariant";
|
|
3
3
|
import { ResourceScheduler, resourceAccesses } from "pi-agent-resource";
|
|
4
|
-
import type { TextResourceEditOutcome } from "./text-editor-core.
|
|
4
|
+
import type { TextResourceEditOutcome } from "./text-editor-core.ts";
|
|
5
5
|
|
|
6
6
|
type Completed = Exclude<TextResourceEditOutcome<unknown>, { readonly kind: "failed" }>;
|
|
7
7
|
type Finalize = () => Promise<Completed>;
|
|
@@ -2,9 +2,9 @@ import { requiredValue } from "pi-agent-invariant";
|
|
|
2
2
|
import type { FragmentResolverRegistration } from "pi-agent-read/api/tools/read";
|
|
3
3
|
import type { TextAnchor } from "pi-agent-text";
|
|
4
4
|
|
|
5
|
-
import type { TextAnchorInTextRequest } from "#src/core/text-editor-core.
|
|
6
|
-
import { TextSelectionAnchor } from "#src/api/text-selection-anchor.
|
|
7
|
-
import { TextAnchorResolutionError } from "#src/core/text-anchor-registry.
|
|
5
|
+
import type { TextAnchorInTextRequest } from "#src/core/text-editor-core.ts";
|
|
6
|
+
import { TextSelectionAnchor } from "#src/api/text-selection-anchor.ts";
|
|
7
|
+
import { TextAnchorResolutionError } from "#src/core/text-anchor-registry.ts";
|
|
8
8
|
|
|
9
9
|
/** Anything that can resolve an anchor value against provided text content. */
|
|
10
10
|
export interface ReadFragmentAnchorSource {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ResolvedResultTargets } from "pi-agent-resource";
|
|
2
|
-
import { TextChangeDocument } from "./text-change-engine.
|
|
2
|
+
import { TextChangeDocument } from "./text-change-engine.ts";
|
|
3
3
|
|
|
4
4
|
const writePartialReason =
|
|
5
5
|
"Write received a partial file selection. Use replace to edit that selection, or Read the whole file before deliberately replacing all its contents.";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ResultTargetStore } from "pi-agent-resource";
|
|
2
|
-
import { TextSelectionAnchor } from "#src/api/text-selection-anchor.
|
|
2
|
+
import { TextSelectionAnchor } from "#src/api/text-selection-anchor.ts";
|
|
3
3
|
import {
|
|
4
4
|
TEXT_SEARCH_ANCHOR_KIND,
|
|
5
5
|
type TextAnchorResolverRegistration,
|
|
6
|
-
} from "#src/api/plugin-protocol.
|
|
6
|
+
} from "#src/api/plugin-protocol.ts";
|
|
7
7
|
|
|
8
8
|
/** Resolve registered snapshot targets through the editor's normal source and anchor guards. */
|
|
9
9
|
export function createResultTargetAnchors(
|
|
@@ -3,10 +3,10 @@ import type {
|
|
|
3
3
|
TextMutation,
|
|
4
4
|
TextMutationContext,
|
|
5
5
|
TextMutationEdit,
|
|
6
|
-
} from "#src/api/mutation-tool.
|
|
7
|
-
import { TextChangeDocument, type TextChange } from "./text-change-engine.
|
|
8
|
-
import { anchorSpanRange, insertionAfterAnchor } from "#src/tools/text-selection.
|
|
9
|
-
import { wholeFileResultSource } from "./result-input.
|
|
6
|
+
} from "#src/api/mutation-tool.ts";
|
|
7
|
+
import { TextChangeDocument, type TextChange } from "./text-change-engine.ts";
|
|
8
|
+
import { anchorSpanRange, insertionAfterAnchor } from "#src/tools/text-selection.ts";
|
|
9
|
+
import { wholeFileResultSource } from "./result-input.ts";
|
|
10
10
|
|
|
11
11
|
/** Distinguish structured source authority from ordinary paths and legacy anchors. */
|
|
12
12
|
export function isResultInput(value: unknown): boolean {
|