pi-agent-ide 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -40
- package/README.md +12 -7
- package/dist/{chunk-MOJ5RR35.js → chunk-246NTPOS.js} +1 -1
- package/dist/{chunk-NULNW6GK.js → chunk-2ITKAXHO.js} +1 -1
- package/dist/{chunk-SBNR4WZF.js → chunk-3WO2NOEQ.js} +1 -1
- package/dist/{chunk-N7LMRL64.js → chunk-47SPPIXK.js} +1 -1
- package/dist/{chunk-EY65TFHJ.js → chunk-4HWKBCBH.js} +1 -1
- package/dist/{chunk-JMVDFOTQ.js → chunk-57F5GTHO.js} +1 -1
- package/dist/{chunk-KL776TGR.js → chunk-7LOVUWNI.js} +1 -1
- package/dist/{chunk-7JV4VN73.js → chunk-A64JRDZK.js} +1 -1
- package/dist/{chunk-Z3PGADVA.js → chunk-AIT3YWR5.js} +1 -1
- package/dist/{chunk-E4HPRLRB.js → chunk-AKNHSDGV.js} +1 -1
- package/dist/{chunk-4XPUN4QN.js → chunk-AUL5FGGK.js} +1 -1
- package/dist/chunk-BB4A5UI3.js +5 -0
- package/dist/{chunk-CTJV77FR.js → chunk-BQAKA3FU.js} +1 -1
- package/dist/{chunk-PNP2KNGP.js → chunk-BR7GRH4A.js} +1 -1
- package/dist/{chunk-4OYVLXWD.js → chunk-D4IA2MTA.js} +1 -1
- package/dist/{chunk-R5XJSEOE.js → chunk-DXONCYWF.js} +3 -3
- package/dist/{chunk-TWWND6NI.js → chunk-E2PHA4SQ.js} +1 -1
- package/dist/{chunk-MZXX353D.js → chunk-EMRJP6EM.js} +1 -1
- package/dist/{chunk-7HDK3NRQ.js → chunk-GEMDU6XW.js} +1 -1
- package/dist/chunk-GNACBJM3.js +1 -0
- package/dist/{chunk-3G54ZL2L.js → chunk-HCK7OIQ3.js} +1 -1
- package/dist/chunk-HFJGCYFO.js +11 -0
- package/dist/{chunk-CSXHCSTH.js → chunk-ID4RJIVZ.js} +1 -1
- package/dist/{chunk-SBLKPTL3.js → chunk-JKMXND6V.js} +1 -1
- package/dist/{chunk-WE42GBGU.js → chunk-LAJQSHEI.js} +1 -1
- package/dist/{chunk-HCN5W76B.js → chunk-LLRUJD62.js} +1 -1
- package/dist/{chunk-2K65BSXS.js → chunk-M4TVRCMZ.js} +1 -1
- package/dist/{chunk-IUSLSROY.js → chunk-N56WAVYA.js} +1 -1
- package/dist/chunk-OI3HBIPK.js +2 -0
- package/dist/{chunk-GW6NZQTQ.js → chunk-PRLIHLCS.js} +1 -1
- package/dist/{chunk-7TJ6DWW3.js → chunk-Q5X6OXNS.js} +1 -1
- package/dist/{chunk-75SWXD2Z.js → chunk-SWA5B5B2.js} +1 -1
- package/dist/chunk-T7MWQQIF.js +3 -0
- package/dist/{chunk-ICDI27GZ.js → chunk-TGC2ZACO.js} +1 -1
- package/dist/{chunk-7NS3QUIE.js → chunk-TXG2H7YQ.js} +1 -1
- package/dist/{chunk-RAZP42IQ.js → chunk-VAXLSPPU.js} +1 -1
- package/dist/chunk-VMGZMXEM.js +10 -0
- package/dist/{chunk-CPZJPGLG.js → chunk-VNTY7BKC.js} +1 -1
- package/dist/chunk-W3YFF6OO.js +1 -0
- package/dist/{chunk-OLI3JPHJ.js → chunk-W7M3V7FR.js} +1 -1
- package/dist/{chunk-UUJJRXHG.js → chunk-WMHSVEIT.js} +1 -1
- package/dist/{chunk-OJX3RJ5A.js → chunk-WPBQ45ZL.js} +1 -1
- package/dist/{chunk-XZDOVPRC.js → chunk-WXGTU2M6.js} +1 -1
- package/dist/{chunk-3ZGDMTMD.js → chunk-XSIKDVAR.js} +1 -1
- package/dist/{chunk-QP2QSQ4U.js → chunk-YHREORHH.js} +1 -1
- package/dist/chunk-YTYLS2UM.js +1 -0
- package/dist/chunk-Z2QGNTGQ.js +1 -0
- package/dist/{chunk-UBH6X3D3.js → chunk-ZV5ETNLQ.js} +1 -1
- package/dist/entry-11.js +1 -1
- package/dist/entry-13.js +1 -1
- package/dist/entry-14.js +1 -1
- package/dist/entry-15.js +1 -1
- package/dist/entry-16.js +1 -1
- package/dist/entry-17.js +1 -1
- package/dist/entry-18.js +1 -0
- package/dist/entry-20.js +1 -1
- package/dist/entry-21.js +1 -1
- package/dist/entry-22.js +1 -1
- package/dist/entry-23.js +1 -1
- package/dist/entry-24.js +1 -1
- package/dist/entry-25.js +1 -1
- package/dist/entry-26.js +1 -2
- package/dist/entry-27.js +2 -1
- package/dist/entry-28.js +1 -4
- package/dist/entry-29.js +4 -1
- package/dist/entry-30.js +1 -1
- package/dist/entry-31.js +1 -1
- package/dist/entry-32.js +1 -18
- package/dist/entry-33.js +18 -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 +1 -1
- package/dist/entry-39.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-45.js +1 -1
- package/dist/entry-46.js +1 -25
- package/dist/entry-47.js +25 -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 -3
- package/dist/entry-52.js +3 -13
- package/dist/entry-53.js +13 -1
- package/dist/entry-54.js +1 -1
- package/dist/entry-55.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-6.js +1 -1
- package/dist/entry-60.js +1 -1
- package/dist/entry-61.js +1 -1
- package/dist/entry-62.js +1 -0
- package/dist/entry-63.js +0 -1
- package/dist/entry-64.js +1 -0
- package/dist/entry-65.js +0 -1
- package/dist/entry-66.js +1 -1
- package/dist/entry-67.js +1 -1
- package/dist/entry-68.js +1 -1
- package/dist/entry-69.js +1 -1
- package/dist/entry-7.js +1 -1
- package/dist/entry-70.js +1 -1
- package/dist/entry-71.js +1 -1
- package/dist/entry-72.js +1 -0
- package/dist/entry-73.js +0 -1
- package/dist/entry-74.js +1 -0
- package/dist/entry-75.js +0 -1
- package/dist/entry-76.js +1 -1
- package/dist/entry-77.js +1 -1
- package/dist/entry-78.js +1 -80
- package/dist/entry-79.js +76 -17
- package/dist/entry-80.js +22 -2
- package/dist/entry-81.js +2 -1
- package/dist/entry-82.js +1 -1
- package/dist/entry-83.js +1 -1
- package/dist/entry-84.js +1 -3
- package/dist/entry-85.js +3 -1
- package/dist/entry-86.js +1 -1
- package/dist/entry-87.js +1 -1
- package/dist/entry-88.js +1 -0
- package/dist/pi-agent-ide.js +53 -24
- package/docs/agent-guides/search-code.md +3 -1
- package/docs/agent-guides/ssh.md +1 -1
- package/docs/configuration.md +18 -6
- package/docs/development.md +1 -13
- package/docs/extensions.md +1 -1
- package/docs/releases.md +1 -1
- package/docs/settings-help.md +39 -0
- package/docs/tools.md +1 -0
- package/docs/user-hooks.md +3 -1
- package/node_modules/pi-agent-doctor/package.json +7 -10
- package/node_modules/pi-agent-documentation/package.json +2 -2
- package/node_modules/pi-agent-documentation/runtime/entry-26.js +1 -0
- package/node_modules/pi-agent-filesystem/package.json +8 -8
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- package/node_modules/pi-agent-filesystem-jq/package.json +6 -7
- package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/runtime/entry-31.js +2 -0
- package/node_modules/pi-agent-ide-ast/package.json +15 -41
- package/node_modules/pi-agent-ide-ast/runtime/entry-32.js +0 -1
- package/node_modules/pi-agent-ide-ast/runtime/entry-33.js +2 -0
- package/node_modules/pi-agent-ide-changes/package.json +10 -11
- package/node_modules/pi-agent-ide-changes/runtime/entry-34.js +0 -1
- package/node_modules/pi-agent-ide-formatter/package.json +4 -4
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-lint/package.json +8 -8
- package/node_modules/pi-agent-ide-lsp/package.json +10 -13
- package/node_modules/pi-agent-ide-lsp/runtime/entry-39.js +2 -0
- package/node_modules/pi-agent-image/package.json +3 -3
- package/node_modules/pi-agent-invariant/package.json +2 -2
- package/node_modules/pi-agent-pdf/package.json +3 -4
- package/node_modules/pi-agent-read/package.json +12 -12
- package/node_modules/pi-agent-read/runtime/entry-46.js +0 -1
- package/node_modules/pi-agent-read/runtime/entry-47.js +2 -0
- package/node_modules/pi-agent-resource/package.json +2 -2
- package/node_modules/pi-agent-resource/src/result-targets.ts +9 -0
- package/node_modules/pi-agent-search/package.json +9 -9
- package/node_modules/pi-agent-search/runtime/entry-51.js +0 -1
- package/node_modules/pi-agent-search/src/api/plugin-protocol.ts +1 -1
- package/node_modules/pi-agent-search/src/api/presentation.ts +10 -2
- package/node_modules/pi-agent-search/src/api/search-parameters.ts +1 -1
- package/node_modules/pi-agent-search/src/api/search.ts +7 -0
- package/node_modules/pi-agent-search/src/core/search-core.ts +23 -3
- package/node_modules/pi-agent-search-text/index.ts +2 -0
- package/node_modules/pi-agent-search-text/package.json +14 -14
- package/node_modules/pi-agent-search-text/runtime/entry-53.js +1 -0
- package/node_modules/pi-agent-search-text/src/search-backend.ts +18 -10
- package/node_modules/pi-agent-search-text/src/search-session.ts +68 -9
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text/runtime/entry-57.js +1 -0
- package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-58.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/package.json +5 -6
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-59.js +0 -1
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-60.js +2 -0
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-61.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-62.js +2 -0
- package/node_modules/pi-agent-text-editor/package.json +26 -34
- package/node_modules/pi-agent-text-editor/runtime/entry-78.js +0 -1
- package/node_modules/pi-agent-text-editor/src/api/delete-guard.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/api/native-edit-batch-event.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/core/delete-policy.ts +6 -12
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +1 -0
- package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +49 -21
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +18 -9
- package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/core/temporary-directories.ts +13 -9
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +16 -8
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +118 -36
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +7 -4
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +6 -8
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +22 -1
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -8
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +22 -0
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-81.js +2 -0
- package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
- package/node_modules/pi-agent-tool-ui/package.json +2 -2
- package/node_modules/pi-agent-tool-ui/runtime/entry-83.js +1 -0
- package/node_modules/pi-agent-web/package.json +8 -11
- package/node_modules/pi-agent-web-html/package.json +3 -5
- package/node_modules/pi-agent-web-image/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-88.js +2 -0
- package/package.json +43 -39
- package/skills/configure-agent-ide/SKILL.md +38 -0
- package/src/api/content.ts +6 -0
- package/src/api/tips.ts +3 -0
- package/src/composite/nested-tool-rendering.ts +16 -5
- package/src/composite/preferences.ts +13 -0
- package/src/composite/settings-documentation.ts +59 -0
- package/src/composite/settings-help.ts +106 -0
- package/src/composite/text-results.ts +50 -22
- package/src/documentation/extension.ts +12 -0
- package/src/documentation/search.ts +166 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +8 -8
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +6 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-31.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-27.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -11
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -5
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-88.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-84.js +2 -0
- package/src/extensions/pi-agent-read/package.json +12 -12
- package/src/extensions/pi-agent-read/runtime/entry-46.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-47.js +2 -0
- package/src/extensions/pi-agent-search/package.json +9 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +2 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +14 -14
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-53.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-56.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +18 -10
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +68 -9
- package/src/extensions/pi-agent-search/runtime/entry-51.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-52.js +2 -0
- package/src/extensions/pi-agent-search/src/api/plugin-protocol.ts +1 -1
- package/src/extensions/pi-agent-search/src/api/presentation.ts +10 -2
- package/src/extensions/pi-agent-search/src/api/search-parameters.ts +1 -1
- package/src/extensions/pi-agent-search/src/api/search.ts +7 -0
- package/src/extensions/pi-agent-search/src/core/search-core.ts +23 -3
- package/src/extensions/pi-agent-text-editor/package.json +26 -34
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-58.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-59.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-60.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-61.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-62.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -8
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +22 -0
- 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/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-81.js +2 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-78.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-79.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/delete-guard.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/api/native-edit-batch-event.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/core/delete-policy.ts +6 -12
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +1 -0
- package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +49 -21
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +18 -9
- package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/core/temporary-directories.ts +13 -9
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +16 -8
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +118 -36
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +7 -4
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +6 -8
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +22 -1
- package/src/pi-agent-ide.ts +14 -2
- package/src/plugins/pi-agent-ide-ast/package.json +15 -41
- package/src/plugins/pi-agent-ide-ast/runtime/entry-32.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-33.js +2 -0
- package/src/plugins/pi-agent-ide-changes/package.json +10 -11
- package/src/plugins/pi-agent-ide-changes/runtime/entry-34.js +0 -1
- package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-lint/package.json +8 -8
- package/src/plugins/pi-agent-ide-lsp/package.json +10 -13
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-39.js +2 -0
- package/src/tips/core.ts +5 -2
- package/src/tips/extension.ts +30 -2
- package/src/tips/persistence.ts +29 -27
- package/src/tips/setup-hint.ts +19 -0
- package/dist/chunk-5KFVDYCI.js +0 -1
- package/dist/chunk-ABFCAOU5.js +0 -1
- package/dist/chunk-BIG45IPN.js +0 -2
- package/dist/chunk-BMOJTJJJ.js +0 -3
- package/dist/chunk-BQ67M4NC.js +0 -3
- package/dist/chunk-IH5NW5JX.js +0 -11
- package/dist/chunk-NRZO5KJT.js +0 -9
- package/dist/chunk-O36UC74T.js +0 -1
- package/dist/chunk-SSWUUBIR.js +0 -1
- package/dist/entry-19.js +0 -1
- package/docs/research/apply-native-capability-matrix.md +0 -174
- package/docs/research/apply-read-latency.md +0 -221
- package/docs/research/codemode-write-context.md +0 -56
- package/docs/research/lpt-393-fuzzy-results/file.json +0 -152
- package/docs/research/lpt-393-fuzzy-results/repo.json +0 -122
- package/docs/research/lpt-393-search-fuzzy-fallback.md +0 -97
- package/docs/research/native-codemode-batch-decision.md +0 -31
- package/docs/research/native-codemode-batching.md +0 -65
- package/node_modules/pi-agent-doctor/runtime/entry-19.js +0 -1
- package/node_modules/pi-agent-filesystem/runtime/entry-26.js +0 -2
- package/node_modules/pi-agent-ide-ast/runtime/entry-31.js +0 -1
- package/node_modules/pi-agent-ide-changes/runtime/entry-33.js +0 -1
- package/node_modules/pi-agent-image/runtime/entry-39.js +0 -1
- package/node_modules/pi-agent-resource/runtime/entry-47.js +0 -1
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-57.js +0 -2
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-58.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-60.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-62.js +0 -1
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-81.js +0 -1
- package/node_modules/pi-agent-web/runtime/entry-83.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-27.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-26.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-84.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-83.js +0 -2
- package/src/extensions/pi-agent-read/runtime/entry-42.js +0 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-52.js +0 -2
- package/src/extensions/pi-agent-search/runtime/entry-48.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-57.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-58.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-60.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-79.js +0 -2
- package/src/extensions/pi-agent-text-editor/runtime/entry-62.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-31.js +0 -1
- package/src/plugins/pi-agent-ide-changes/runtime/entry-33.js +0 -1
- /package/node_modules/{pi-agent-documentation → pi-agent-doctor}/runtime/entry-25.js +0 -0
- /package/node_modules/{pi-agent-filesystem-image → pi-agent-filesystem}/runtime/entry-27.js +0 -0
- /package/node_modules/{pi-agent-filesystem-jq → pi-agent-filesystem-image}/runtime/entry-28.js +0 -0
- /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem-jq}/runtime/entry-29.js +0 -0
- /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-30.js +0 -0
- /package/node_modules/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-35.js +0 -0
- /package/node_modules/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-36.js +0 -0
- /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-37.js +0 -0
- /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-38.js +0 -0
- /package/node_modules/{pi-agent-invariant → pi-agent-image}/runtime/entry-40.js +0 -0
- /package/node_modules/{pi-agent-pdf → pi-agent-invariant}/runtime/entry-41.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-42.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-48.js +0 -0
- /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-52.js +0 -0
- /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-56.js +0 -0
- /package/node_modules/{pi-agent-text-editor-renderer → pi-agent-text-editor}/runtime/entry-79.js +0 -0
- /package/node_modules/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-80.js +0 -0
- /package/node_modules/{pi-agent-tool-ui → pi-agent-tool-call-interception}/runtime/entry-82.js +0 -0
- /package/node_modules/{pi-agent-web-html → pi-agent-web}/runtime/entry-84.js +0 -0
- /package/node_modules/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-85.js +0 -0
- /package/node_modules/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-86.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-87.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-jq → pi-agent-filesystem-image}/runtime/entry-28.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-pdf → pi-agent-filesystem-jq}/runtime/entry-29.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-30.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-85.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-86.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-87.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-80.js +0 -0
- /package/src/plugins/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-35.js +0 -0
- /package/src/plugins/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-36.js +0 -0
- /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-37.js +0 -0
- /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-38.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-anchor-exact",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,17 +8,16 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./api/anchor": {
|
|
10
10
|
"types": "./src/anchor.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-59.js"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"
|
|
16
|
-
"pi-agent-text": "0.8.
|
|
17
|
-
"pi-agent-text-editor": "0.8.0"
|
|
15
|
+
"pi-agent-text": "0.8.1",
|
|
16
|
+
"pi-agent-text-editor": "0.8.1"
|
|
18
17
|
},
|
|
19
18
|
"pi": {
|
|
20
19
|
"extensions": [
|
|
21
|
-
"./runtime/entry-
|
|
20
|
+
"./runtime/entry-60.js"
|
|
22
21
|
]
|
|
23
22
|
},
|
|
24
23
|
"peerDependencies": {
|
package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-anchor-line-hash",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,18 +8,18 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./api/anchor": {
|
|
10
10
|
"types": "./src/anchor.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-61.js"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"pi-agent-invariant": "0.8.
|
|
16
|
-
"pi-agent-read": "0.8.
|
|
17
|
-
"pi-agent-text": "0.8.
|
|
18
|
-
"pi-agent-text-editor": "0.8.
|
|
15
|
+
"pi-agent-invariant": "0.8.1",
|
|
16
|
+
"pi-agent-read": "0.8.1",
|
|
17
|
+
"pi-agent-text": "0.8.1",
|
|
18
|
+
"pi-agent-text-editor": "0.8.1"
|
|
19
19
|
},
|
|
20
20
|
"pi": {
|
|
21
21
|
"extensions": [
|
|
22
|
-
"./runtime/entry-
|
|
22
|
+
"./runtime/entry-62.js"
|
|
23
23
|
]
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-editor-renderer",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"
|
|
10
|
-
"pi-agent-
|
|
11
|
-
"pi-agent-
|
|
12
|
-
"pi-agent-tool-
|
|
13
|
-
"pi-agent-tool-ui": "0.8.0",
|
|
14
|
-
"vscode-diff": "3.0.1"
|
|
9
|
+
"pi-agent-invariant": "0.8.1",
|
|
10
|
+
"pi-agent-text-editor": "0.8.1",
|
|
11
|
+
"pi-agent-tool-call-interception": "0.8.1",
|
|
12
|
+
"pi-agent-tool-ui": "0.8.1"
|
|
15
13
|
},
|
|
16
14
|
"pi": {
|
|
17
15
|
"extensions": [
|
|
18
|
-
"./runtime/entry-
|
|
16
|
+
"./runtime/entry-80.js"
|
|
19
17
|
]
|
|
20
18
|
},
|
|
21
19
|
"peerDependencies": {
|
package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts
CHANGED
|
@@ -953,6 +953,12 @@ function wholeFileOperationSummary(details: unknown):
|
|
|
953
953
|
|
|
954
954
|
function wholeFileFailureCause(code: string): string {
|
|
955
955
|
switch (code) {
|
|
956
|
+
case "WRITE_FAILED": {
|
|
957
|
+
return "resource write failed";
|
|
958
|
+
}
|
|
959
|
+
case "POST_WRITE_FAILED": {
|
|
960
|
+
return "post-write processing failed";
|
|
961
|
+
}
|
|
956
962
|
case "APPLY_UNDO_OWNER_CHANGED": {
|
|
957
963
|
return "resource owner changed";
|
|
958
964
|
}
|
|
@@ -1002,6 +1008,22 @@ function wholeFileFailureCause(code: string): string {
|
|
|
1002
1008
|
function userFacingFailure(
|
|
1003
1009
|
agentOutput: string,
|
|
1004
1010
|
details: FileMutationBatchResult | undefined,
|
|
1011
|
+
): string {
|
|
1012
|
+
const causes = new Set(
|
|
1013
|
+
details?.results?.flatMap((result) =>
|
|
1014
|
+
// Provider reasons can contain private data; decode only public editor failure codes.
|
|
1015
|
+
(result.data.errors ?? []).map((error) => wholeFileFailureCause(error.code ?? "")),
|
|
1016
|
+
),
|
|
1017
|
+
);
|
|
1018
|
+
return [
|
|
1019
|
+
mutationFailureSummary(agentOutput, details),
|
|
1020
|
+
...[...causes].map((cause) => `Reason: ${cause}`),
|
|
1021
|
+
...(details?.effect === "unknown" ? ["Read the affected resource before retrying."] : []),
|
|
1022
|
+
].join("\n");
|
|
1023
|
+
}
|
|
1024
|
+
function mutationFailureSummary(
|
|
1025
|
+
agentOutput: string,
|
|
1026
|
+
details: FileMutationBatchResult | undefined,
|
|
1005
1027
|
): string {
|
|
1006
1028
|
const rollbacks =
|
|
1007
1029
|
details?.results?.flatMap((result) => (result.data.rollback ? [result.data.rollback] : [])) ??
|
package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-editor-stale-anchor",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-invariant": "0.8.
|
|
7
|
-
"pi-agent-read": "0.8.
|
|
8
|
-
"pi-agent-text-editor": "0.8.
|
|
6
|
+
"pi-agent-invariant": "0.8.1",
|
|
7
|
+
"pi-agent-read": "0.8.1",
|
|
8
|
+
"pi-agent-text-editor": "0.8.1"
|
|
9
9
|
},
|
|
10
10
|
"pi": {
|
|
11
11
|
"extensions": [
|
|
12
|
-
"./runtime/entry-
|
|
12
|
+
"./runtime/entry-81.js"
|
|
13
13
|
]
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
@@ -17,7 +17,7 @@ export interface BeforeDeleteEvent {
|
|
|
17
17
|
export interface DeleteFileAccess {
|
|
18
18
|
/** Omitted means POSIX target paths; native uses the controller platform's path syntax. */
|
|
19
19
|
readonly pathStyle?: "posix" | "native";
|
|
20
|
-
/** Native account defaults and config directory for temporary
|
|
20
|
+
/** Native account defaults and config directory for temporary removal exceptions.
|
|
21
21
|
* Omitted disables those exceptions; a remote owner must never use controller values.
|
|
22
22
|
* All returned paths are absolute on this owner. Called again during policy recheck.
|
|
23
23
|
*/
|
|
@@ -7,8 +7,8 @@ export interface NativeEditBatchEvent {
|
|
|
7
7
|
readonly calls: readonly string[];
|
|
8
8
|
/** Successful Copy calls that retained identical destination text without a write. */
|
|
9
9
|
readonly unchangedCopyCalls?: readonly string[];
|
|
10
|
-
/** Per-call
|
|
11
|
-
readonly
|
|
10
|
+
/** Per-call receipts keep only their own output selection and failure evidence. */
|
|
11
|
+
readonly mutationResults?: ReadonlyMap<string, AgentToolResult<FileMutationBatchResult>>;
|
|
12
12
|
readonly result: AgentToolResult<FileMutationBatchResult>;
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -29,20 +29,19 @@ export async function prepareDeletion(
|
|
|
29
29
|
context: DeletePolicyContext,
|
|
30
30
|
signal?: AbortSignal,
|
|
31
31
|
): Promise<BeforeDeleteEvent & { readonly revision: string }> {
|
|
32
|
-
const guard = await prepareDeletionGuard(source, cwd, context, signal
|
|
32
|
+
const guard = await prepareDeletionGuard(source, cwd, context, signal);
|
|
33
33
|
await guard.verify();
|
|
34
34
|
return guard.event;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
/**
|
|
37
|
+
/** Apply the same approval policy to Delete and each removed Move endpoint. */
|
|
38
38
|
export async function prepareDeletionGuard(
|
|
39
39
|
source: string,
|
|
40
40
|
cwd: string,
|
|
41
41
|
context: DeletePolicyContext,
|
|
42
42
|
signal?: AbortSignal,
|
|
43
|
-
allowTemporary = false,
|
|
44
43
|
): Promise<DeletionGuard> {
|
|
45
|
-
const before = await inspectDeletion(source, cwd, signal, context.files
|
|
44
|
+
const before = await inspectDeletion(source, cwd, signal, context.files);
|
|
46
45
|
const event =
|
|
47
46
|
context.files === undefined
|
|
48
47
|
? before.event
|
|
@@ -70,7 +69,7 @@ export async function prepareDeletionGuard(
|
|
|
70
69
|
signal?.throwIfAborted();
|
|
71
70
|
let after;
|
|
72
71
|
try {
|
|
73
|
-
after = await inspectDeletion(source, cwd, signal, context.files
|
|
72
|
+
after = await inspectDeletion(source, cwd, signal, context.files);
|
|
74
73
|
} catch (error) {
|
|
75
74
|
signal?.throwIfAborted();
|
|
76
75
|
fail(
|
|
@@ -93,7 +92,6 @@ async function inspectDeletion(
|
|
|
93
92
|
cwd: string,
|
|
94
93
|
signal: AbortSignal | undefined,
|
|
95
94
|
files: DeleteFileAccess | undefined,
|
|
96
|
-
allowTemporary: boolean,
|
|
97
95
|
) {
|
|
98
96
|
const access = files ?? localFiles;
|
|
99
97
|
const paths = files === undefined || files.pathStyle === "native" ? path : path.posix;
|
|
@@ -112,12 +110,8 @@ async function inspectDeletion(
|
|
|
112
110
|
assertUnprotected(resolvedPath, boundary, project.controls, paths);
|
|
113
111
|
|
|
114
112
|
const temporaryRoots =
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
: [];
|
|
118
|
-
const temporary =
|
|
119
|
-
!temporaryRoots.some((root) => paths.relative(root, resolvedPath) === "") &&
|
|
120
|
-
temporaryRoots.some((root) => contains(root, resolvedPath, paths));
|
|
113
|
+
kind !== "file" ? await loadTemporaryDirectories(boundary, resolvedPath, access, signal) : [];
|
|
114
|
+
const temporary = temporaryRoots.some((root) => contains(root, resolvedPath, paths));
|
|
121
115
|
let reason: string | undefined;
|
|
122
116
|
let tracked: string[] = [];
|
|
123
117
|
if (kind !== "file") {
|
|
@@ -2,11 +2,29 @@ import path from "node:path";
|
|
|
2
2
|
import type { TextEditorCore } from "#src/core/text-editor-core.js";
|
|
3
3
|
import type { FileOperation, FileOperationResult } from "#src/core/file-operations.js";
|
|
4
4
|
import { forgetDeferredPostEdit } from "./post-edit-scope.js";
|
|
5
|
-
import type {
|
|
5
|
+
import type {
|
|
6
|
+
AgentToolResult,
|
|
7
|
+
ExtensionAPI,
|
|
8
|
+
ExtensionContext,
|
|
9
|
+
} from "@earendil-works/pi-coding-agent";
|
|
6
10
|
import type { FileMutationBatchResult } from "#src/core/mutation-result/file-mutation-result.js";
|
|
7
11
|
import { isDiffStatusContribution } from "#src/api/post-edit.js";
|
|
8
12
|
import type { MutationDiffStatus } from "#src/api/mutation-result.js";
|
|
9
13
|
|
|
14
|
+
function emitBlocked(
|
|
15
|
+
events: Pick<ExtensionAPI["events"], "emit"> | undefined,
|
|
16
|
+
active: boolean,
|
|
17
|
+
): void {
|
|
18
|
+
try {
|
|
19
|
+
events?.emit(
|
|
20
|
+
"herdr:blocked",
|
|
21
|
+
active ? { active: true, label: "Waiting for user response" } : { active: false },
|
|
22
|
+
);
|
|
23
|
+
} catch {
|
|
24
|
+
// Header status must not change the user's decision or fail filesystem work.
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
10
28
|
/** Return whether a hybrid text tool invocation addresses a complete file. */
|
|
11
29
|
export function isWholeFileInvocation(
|
|
12
30
|
operation: FileOperation | undefined,
|
|
@@ -26,7 +44,7 @@ export function isWholeFileInvocation(
|
|
|
26
44
|
return operation === "delete" || (typeof input.target === "string" && input.target.length > 0);
|
|
27
45
|
}
|
|
28
46
|
|
|
29
|
-
/** Execute
|
|
47
|
+
/** Execute whole-object operations; terminal approval dialogs report waiting through host events. */
|
|
30
48
|
export async function executeWholeFileTool(
|
|
31
49
|
core: TextEditorCore,
|
|
32
50
|
operation: FileOperation,
|
|
@@ -34,9 +52,11 @@ export async function executeWholeFileTool(
|
|
|
34
52
|
signal: AbortSignal | undefined,
|
|
35
53
|
context: Pick<ExtensionContext, "cwd"> & {
|
|
36
54
|
readonly hasUI?: boolean;
|
|
55
|
+
readonly mode?: ExtensionContext["mode"];
|
|
37
56
|
readonly ui?: Pick<ExtensionContext["ui"], "confirm">;
|
|
38
57
|
},
|
|
39
58
|
verifySource?: () => Promise<void>,
|
|
59
|
+
events?: Pick<ExtensionAPI["events"], "emit">,
|
|
40
60
|
): Promise<AgentToolResult<FileMutationBatchResult>> {
|
|
41
61
|
let finalize: Awaited<ReturnType<TextEditorCore["prepareFilePostProcessing"]>> | undefined;
|
|
42
62
|
const ui = context.hasUI ? context.ui : undefined;
|
|
@@ -69,25 +89,33 @@ export async function executeWholeFileTool(
|
|
|
69
89
|
});
|
|
70
90
|
},
|
|
71
91
|
...(ui !== undefined && {
|
|
72
|
-
confirm: async (event, reason) =>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
confirm: async (event, reason) => {
|
|
93
|
+
const waitingEvents = context.mode === "tui" ? events : undefined;
|
|
94
|
+
emitBlocked(waitingEvents, true);
|
|
95
|
+
try {
|
|
96
|
+
return await ui.confirm(
|
|
97
|
+
operation === "move" ? "Move filesystem object?" : "Delete permanently?",
|
|
98
|
+
[
|
|
99
|
+
event.path,
|
|
100
|
+
event.resolvedPath === event.path
|
|
101
|
+
? undefined
|
|
102
|
+
: `Resolved path: ${event.resolvedPath}`,
|
|
103
|
+
operation === "move" &&
|
|
104
|
+
event.path === path.resolve(context.cwd, String(input.path))
|
|
105
|
+
? `Move source to ${String(input.target)}; preserve link objects without following their targets.`
|
|
106
|
+
: event.recursive
|
|
107
|
+
? "Remove directory and all contents recursively."
|
|
108
|
+
: "Unlink symlink only; leave its target untouched.",
|
|
109
|
+
reason,
|
|
110
|
+
]
|
|
111
|
+
.filter((line) => line !== undefined)
|
|
112
|
+
.join("\n"),
|
|
113
|
+
{ signal },
|
|
114
|
+
);
|
|
115
|
+
} finally {
|
|
116
|
+
emitBlocked(waitingEvents, false);
|
|
117
|
+
}
|
|
118
|
+
},
|
|
91
119
|
}),
|
|
92
120
|
});
|
|
93
121
|
},
|
package/src/extensions/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts
CHANGED
|
@@ -14,7 +14,7 @@ export function groupReplacements(
|
|
|
14
14
|
if (results.length === 0) return;
|
|
15
15
|
const groups: { removedText: string; insertedText: string; count: number }[] = [];
|
|
16
16
|
const indexes = new Map<string, number>();
|
|
17
|
-
const files
|
|
17
|
+
const files = new Map<string, { path: string; groups: number[]; formatting: Set<string> }>();
|
|
18
18
|
let changes = 0;
|
|
19
19
|
for (const result of results) {
|
|
20
20
|
const operations = result.data.operations;
|
|
@@ -33,7 +33,12 @@ export function groupReplacements(
|
|
|
33
33
|
operations.reduce((sum, operation) => sum + operation.changes, 0) !== raw.length
|
|
34
34
|
)
|
|
35
35
|
return;
|
|
36
|
-
const
|
|
36
|
+
const file = files.get(result.path) ?? {
|
|
37
|
+
path: result.path,
|
|
38
|
+
groups: [],
|
|
39
|
+
formatting: new Set<string>(),
|
|
40
|
+
};
|
|
41
|
+
const counts = file.groups;
|
|
37
42
|
for (const change of raw) {
|
|
38
43
|
const key = JSON.stringify([change.removedText, change.insertedText]);
|
|
39
44
|
let index = indexes.get(key);
|
|
@@ -52,21 +57,25 @@ export function groupReplacements(
|
|
|
52
57
|
counts[index] = (counts[index] ?? 0) + 1;
|
|
53
58
|
changes++;
|
|
54
59
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
groups: counts,
|
|
58
|
-
formatting: result.data.formatting?.status ?? "not-reported",
|
|
59
|
-
});
|
|
60
|
+
file.formatting.add(result.data.formatting?.status ?? "not-reported");
|
|
61
|
+
files.set(result.path, file);
|
|
60
62
|
}
|
|
61
63
|
// Keep ordinary final-state output when there is nothing repeated to compress.
|
|
62
64
|
if (groups.length === changes) return;
|
|
63
|
-
return {
|
|
65
|
+
return {
|
|
66
|
+
groups,
|
|
67
|
+
files: Array.from(files.values(), (file) => ({
|
|
68
|
+
...file,
|
|
69
|
+
formatting: Array.from(file.formatting).join(", "),
|
|
70
|
+
})),
|
|
71
|
+
changes,
|
|
72
|
+
};
|
|
64
73
|
}
|
|
65
74
|
|
|
66
75
|
/** Renders all unique pairs and every affected file without repeating surrounding source text. */
|
|
67
76
|
export function renderGroupedReplacements(receipt: GroupedReplacements): string {
|
|
68
77
|
return [
|
|
69
|
-
`Applied ${receipt.changes} replacements in ${receipt.files.length} files.`,
|
|
78
|
+
`Applied ${receipt.changes} replacements in ${receipt.files.length} file${receipt.files.length === 1 ? "" : "s"}.`,
|
|
70
79
|
"Exact applied replacements (before any additional formatting; not a full final-file view):",
|
|
71
80
|
...receipt.groups.map(
|
|
72
81
|
(group, index) =>
|
|
@@ -957,9 +957,9 @@ class NativeTextEditBatchCoordinator {
|
|
|
957
957
|
.snapshot()
|
|
958
958
|
.filter((call) => call.state === "completed" && unchangedCopies.get(call.callId)?.all)
|
|
959
959
|
.map((call) => call.callId),
|
|
960
|
-
...(value.details.
|
|
960
|
+
...(value.details.mutationResults === undefined
|
|
961
961
|
? {}
|
|
962
|
-
: {
|
|
962
|
+
: { mutationResults: value.details.mutationResults }),
|
|
963
963
|
result: value,
|
|
964
964
|
} satisfies NativeEditBatchEvent;
|
|
965
965
|
script.presentations.push(presentation);
|
|
@@ -2,16 +2,19 @@ import path from "node:path";
|
|
|
2
2
|
import type { DeleteFileAccess } from "#src/api/delete-guard.js";
|
|
3
3
|
import { localFileTransferAccess as localFiles } from "#src/api/native-files.js";
|
|
4
4
|
|
|
5
|
+
const temporaryNames = new Set(["tmp", ".tmp", "temp", ".temp"]);
|
|
6
|
+
|
|
5
7
|
interface TemporaryDirectorySettings {
|
|
6
8
|
readonly mode: "replace" | "extend";
|
|
7
9
|
readonly paths: readonly string[];
|
|
8
10
|
}
|
|
9
11
|
|
|
10
|
-
/** Load
|
|
11
|
-
* A provider without native account defaults keeps the strict
|
|
12
|
+
/** Load temporary removal roots for a resolved path, then apply its owner's settings.
|
|
13
|
+
* A provider without native account defaults keeps the strict removal policy.
|
|
12
14
|
*/
|
|
13
15
|
export async function loadTemporaryDirectories(
|
|
14
16
|
projectRoot: string,
|
|
17
|
+
resolvedPath: string,
|
|
15
18
|
files: DeleteFileAccess = localFiles,
|
|
16
19
|
signal?: AbortSignal,
|
|
17
20
|
): Promise<readonly string[]> {
|
|
@@ -20,14 +23,15 @@ export async function loadTemporaryDirectories(
|
|
|
20
23
|
const environment = await files.temporaryEnvironment(signal);
|
|
21
24
|
const paths = files.pathStyle === "native" ? path : path.posix;
|
|
22
25
|
const home = await files.realpath(environment.home);
|
|
23
|
-
const names = ["tmp", ".tmp", "temp", ".temp"];
|
|
24
26
|
const system = await existingRoot(environment.temporary, files, signal);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
let roots = system === undefined ? [] : [system];
|
|
28
|
+
// The caller has resolved parent links; only real path components grant the default exception.
|
|
29
|
+
for (let directory = resolvedPath; ;) {
|
|
30
|
+
if (temporaryNames.has(paths.basename(directory))) roots.push(directory);
|
|
31
|
+
const parent = paths.dirname(directory);
|
|
32
|
+
if (parent === directory) break;
|
|
33
|
+
directory = parent;
|
|
34
|
+
}
|
|
31
35
|
const layers = [
|
|
32
36
|
{
|
|
33
37
|
file: paths.join(
|
|
@@ -28,9 +28,11 @@ export interface BatchCallCandidate<TState = unknown> {
|
|
|
28
28
|
export interface ToolBatchDefinition<TState = unknown> {
|
|
29
29
|
readonly sourceTools: readonly string[];
|
|
30
30
|
readonly syntheticTool: string;
|
|
31
|
+
/** Use the current worktree/session to keep registered selections out of plain-path plans. */
|
|
31
32
|
readonly resolveCall: (
|
|
32
33
|
call: OriginalToolCall,
|
|
33
34
|
inheritedState: TState | undefined,
|
|
35
|
+
context: ExtensionContext,
|
|
34
36
|
) => BatchCallCandidate<TState> | undefined;
|
|
35
37
|
readonly buildArguments: (
|
|
36
38
|
calls: readonly BatchCallCandidate<TState>[],
|
|
@@ -133,7 +135,12 @@ function publishRenderArguments(
|
|
|
133
135
|
}
|
|
134
136
|
}
|
|
135
137
|
|
|
136
|
-
function rewriteMessage(
|
|
138
|
+
function rewriteMessage(
|
|
139
|
+
state: CoordinatorState,
|
|
140
|
+
message: unknown,
|
|
141
|
+
createPlans: boolean,
|
|
142
|
+
context: ExtensionContext,
|
|
143
|
+
): unknown {
|
|
137
144
|
if (
|
|
138
145
|
!isObjectNotArray(message) ||
|
|
139
146
|
message.role !== "assistant" ||
|
|
@@ -154,6 +161,7 @@ function rewriteMessage(state: CoordinatorState, message: unknown, createPlans:
|
|
|
154
161
|
? definition.resolveCall(
|
|
155
162
|
first,
|
|
156
163
|
inheritedDefinition === definition ? inheritedState : undefined,
|
|
164
|
+
context,
|
|
157
165
|
)
|
|
158
166
|
: undefined;
|
|
159
167
|
|
|
@@ -176,7 +184,7 @@ function rewriteMessage(state: CoordinatorState, message: unknown, createPlans:
|
|
|
176
184
|
break;
|
|
177
185
|
}
|
|
178
186
|
|
|
179
|
-
const candidate = definition.resolveCall(next, requiredValue(run.at(-1)).state);
|
|
187
|
+
const candidate = definition.resolveCall(next, requiredValue(run.at(-1)).state, context);
|
|
180
188
|
|
|
181
189
|
if (!candidate) {
|
|
182
190
|
break;
|
|
@@ -522,12 +530,12 @@ function coordinatorFor(pi: ExtensionAPI): CoordinatorState {
|
|
|
522
530
|
|
|
523
531
|
if (!state.registered) {
|
|
524
532
|
state.registered = true;
|
|
525
|
-
pi.on("message_update", (event) => {
|
|
526
|
-
rewriteMessage(state, event.message, false);
|
|
533
|
+
pi.on("message_update", (event, context) => {
|
|
534
|
+
rewriteMessage(state, event.message, false, context);
|
|
527
535
|
return;
|
|
528
536
|
});
|
|
529
|
-
pi.on("message_end", (event) => {
|
|
530
|
-
rewriteMessage(state, event.message, true);
|
|
537
|
+
pi.on("message_end", (event, context) => {
|
|
538
|
+
rewriteMessage(state, event.message, true, context);
|
|
531
539
|
return;
|
|
532
540
|
});
|
|
533
541
|
pi.on("before_provider_request", (event) => filterProviderTools(state, event));
|
|
@@ -550,8 +558,8 @@ export function registerToolBatch<TState>(
|
|
|
550
558
|
const definitionForCoordinator: ToolBatchDefinition = {
|
|
551
559
|
sourceTools: definition.sourceTools,
|
|
552
560
|
syntheticTool: definition.syntheticTool,
|
|
553
|
-
resolveCall: (call, inheritedState) =>
|
|
554
|
-
definition.resolveCall(call, inheritedState as TState | undefined),
|
|
561
|
+
resolveCall: (call, inheritedState, context) =>
|
|
562
|
+
definition.resolveCall(call, inheritedState as TState | undefined, context),
|
|
555
563
|
buildArguments: (calls) =>
|
|
556
564
|
definition.buildArguments(calls as readonly BatchCallCandidate<TState>[]),
|
|
557
565
|
execute: definition.execute,
|