pi-agent-ide 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/README.md +12 -8
- package/dist/{chunk-XNXQYPVT.js → chunk-4LUW26BX.js} +1 -1
- package/dist/chunk-5MSNYFDE.js +1 -0
- package/dist/chunk-5VSE5X5R.js +2 -0
- package/dist/chunk-6EYWFBNG.js +0 -0
- package/dist/{chunk-ORAPGW7W.js → chunk-72EEL2DW.js} +1 -1
- package/dist/{chunk-T2RPMEM2.js → chunk-7UGNGK7Y.js} +1 -1
- package/dist/{chunk-STUZZM5B.js → chunk-AADJ2KIB.js} +1 -1
- package/dist/{chunk-SMSIT3CE.js → chunk-B5KB2I7J.js} +1 -1
- package/dist/chunk-BHSO2MDK.js +6 -0
- package/dist/chunk-BMOJTJJJ.js +3 -0
- package/dist/{chunk-EEH4WYI7.js → chunk-CEKXBS55.js} +1 -1
- package/dist/chunk-CW53ZTU3.js +2 -0
- package/dist/chunk-EWNWKDMP.js +4 -0
- package/dist/{chunk-VSP2QQPQ.js → chunk-GIRAEVUJ.js} +1 -1
- package/dist/{chunk-MTTKFJV6.js → chunk-GUTQ3PWL.js} +1 -1
- package/dist/chunk-HGPUI7F3.js +1 -0
- package/dist/{chunk-OBWZ5RYN.js → chunk-HKMBQLEK.js} +1 -1
- package/dist/chunk-ITSNK5YG.js +7 -0
- package/dist/chunk-KAB3AYA2.js +1 -0
- package/dist/{chunk-266RH77Z.js → chunk-LRYE2WCN.js} +1 -1
- package/dist/chunk-M5L42DWE.js +7 -0
- package/dist/chunk-M5MJP7Z2.js +1 -0
- package/dist/chunk-NMFQGKPE.js +2 -0
- package/dist/chunk-NTYXZ3EL.js +3 -0
- package/dist/{chunk-PETQCA7G.js → chunk-QDST6VIU.js} +1 -1
- package/dist/chunk-QIJMV2P2.js +2 -0
- package/dist/chunk-RHV5STR3.js +3 -0
- package/dist/chunk-ROXXK6TW.js +0 -0
- package/dist/chunk-S3ZPXWX7.js +2 -0
- package/dist/chunk-SSHZEWWV.js +1 -0
- package/dist/chunk-TPIHQYK2.js +14 -0
- package/dist/chunk-VZJIZXSH.js +14 -0
- package/dist/chunk-YHADTHQM.js +1 -0
- package/dist/{chunk-KZBAJFCV.js → chunk-Z3VC3S2T.js} +1 -1
- package/dist/{chunk-SJYDLHEF.js → chunk-ZM4L5AGN.js} +1 -1
- package/dist/{chunk-E2RESHYR.js → chunk-ZTYWHL2F.js} +1 -1
- package/dist/entry-0.js +1 -1
- package/dist/entry-1.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-13.js +1 -1
- package/dist/entry-14.js +1 -1
- package/dist/entry-2.js +1 -1
- package/dist/entry-21.js +2 -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 +12 -1
- package/dist/entry-28.js +1 -1
- package/dist/entry-29.js +1 -1
- package/dist/entry-30.js +1 -1
- package/dist/entry-31.js +4 -1
- package/dist/entry-32.js +9 -1
- package/dist/entry-33.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-4.js +1 -1
- package/dist/entry-40.js +18 -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 +7 -1
- package/dist/entry-46.js +11 -1
- package/dist/entry-47.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-54.js +1 -0
- package/dist/entry-55.js +0 -1
- package/dist/entry-56.js +1 -0
- package/dist/entry-57.js +0 -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 -0
- package/dist/entry-64.js +0 -1
- package/dist/entry-65.js +1 -0
- package/dist/entry-66.js +0 -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-70.js +123 -1
- package/dist/entry-71.js +30 -1
- package/dist/entry-72.js +2 -1
- package/dist/entry-73.js +1 -1
- package/dist/entry-74.js +1 -1
- package/dist/entry-75.js +1 -1
- package/dist/entry-76.js +3 -1
- package/dist/entry-77.js +1 -1
- package/dist/entry-78.js +1 -1
- package/dist/entry-79.js +1 -1
- package/dist/pi-agent-ide.js +3 -13
- package/docs/configuration.md +57 -11
- package/docs/extensions.md +4 -2
- package/docs/tools.md +7 -1
- package/node_modules/pi-agent-doctor/package.json +1 -1
- package/node_modules/pi-agent-filesystem/index.ts +2 -2
- package/node_modules/pi-agent-filesystem/package.json +6 -6
- package/node_modules/pi-agent-filesystem-image/package.json +3 -3
- 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/package.json +9 -9
- package/node_modules/pi-agent-ide-ast/src/ast/outline.ts +89 -19
- package/node_modules/pi-agent-ide-ast/src/extension.ts +11 -15
- package/node_modules/pi-agent-ide-ast/src/overflow-handler.ts +83 -0
- package/node_modules/pi-agent-ide-ast/src/scope-handler.ts +8 -1
- package/node_modules/pi-agent-ide-ast/src/scope-resolver.ts +1 -1
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +83 -5
- package/node_modules/pi-agent-ide-changes/index.ts +22 -10
- package/node_modules/pi-agent-ide-changes/package.json +6 -6
- package/node_modules/pi-agent-ide-changes/src/last-text-transaction-store.ts +10 -0
- package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +5 -9
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +1 -5
- package/node_modules/pi-agent-ide-formatter/package.json +3 -3
- package/node_modules/pi-agent-ide-formatter/src/formatter.ts +36 -13
- package/node_modules/pi-agent-ide-formatter/src/registry.ts +9 -1
- package/node_modules/pi-agent-ide-languages/package.json +2 -2
- package/node_modules/pi-agent-ide-lint/index.ts +49 -17
- package/node_modules/pi-agent-ide-lint/package.json +7 -7
- package/node_modules/pi-agent-ide-lint/src/registry.ts +9 -1
- package/node_modules/pi-agent-ide-lsp/index.ts +127 -20
- package/node_modules/pi-agent-ide-lsp/package.json +9 -8
- package/node_modules/pi-agent-ide-lsp/src/declaration-targets.ts +61 -0
- package/node_modules/pi-agent-ide-lsp/src/diagnostic-source.ts +25 -7
- package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +12 -1
- package/node_modules/pi-agent-ide-lsp/src/lsp/code-views.ts +40 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +21 -32
- package/node_modules/pi-agent-ide-lsp/src/lsp/registry.ts +15 -2
- package/node_modules/pi-agent-ide-lsp/src/lsp/rename.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +32 -5
- package/node_modules/pi-agent-ide-lsp/src/rename-plan.ts +138 -0
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +9 -2
- package/node_modules/pi-agent-image/package.json +2 -2
- package/node_modules/pi-agent-image/src/image-converter.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/pdf-converter.ts +1 -1
- package/node_modules/pi-agent-read/package.json +6 -6
- package/node_modules/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/node_modules/pi-agent-read/src/api/read-parameters.ts +29 -0
- package/node_modules/pi-agent-read/src/api/rendering.ts +3 -0
- package/node_modules/pi-agent-read/src/api/tools/read.ts +73 -1
- package/node_modules/pi-agent-read/src/core/read-core.ts +32 -28
- package/node_modules/pi-agent-read/src/core/tools/read/native-resource-renderer.ts +74 -0
- package/node_modules/pi-agent-read/src/core/tools/read/output-truncation.ts +1 -1
- package/node_modules/pi-agent-read/src/core/tools/read/raw-read.ts +113 -0
- package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +87 -19
- package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +15 -0
- package/node_modules/pi-agent-read/src/core/tools/read/temp-resource-store.ts +35 -126
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +87 -53
- package/node_modules/pi-agent-resource/package.json +1 -1
- package/node_modules/pi-agent-resource/src/content-conversion/content-description.ts +1 -8
- package/node_modules/pi-agent-resource/src/resolver.ts +2 -0
- package/node_modules/pi-agent-search/package.json +3 -3
- package/node_modules/pi-agent-search/src/api/plugin-protocol.ts +1 -1
- package/node_modules/pi-agent-search/src/api/search-parameters.ts +25 -0
- package/node_modules/pi-agent-search/src/api/search.ts +55 -1
- package/node_modules/pi-agent-search/src/core/extension.ts +8 -27
- package/node_modules/pi-agent-search/src/core/search-core.ts +38 -3
- package/node_modules/pi-agent-search-text/index.ts +82 -33
- package/node_modules/pi-agent-search-text/package.json +6 -6
- package/node_modules/pi-agent-search-text/src/file-search.ts +9 -1
- package/node_modules/pi-agent-search-text/src/resolvers.ts +1 -1
- package/node_modules/pi-agent-search-text/src/search-recipe.ts +2 -0
- package/node_modules/pi-agent-search-text/src/search-session.ts +112 -24
- package/node_modules/pi-agent-text/package.json +2 -2
- package/node_modules/pi-agent-text/src/text-converter.ts +1 -1
- package/node_modules/pi-agent-text/src/text-document.ts +5 -0
- package/node_modules/pi-agent-text/src/text-target.ts +4 -0
- package/node_modules/pi-agent-text-anchor-constant/package.json +3 -3
- package/node_modules/pi-agent-text-anchor-exact/package.json +3 -3
- package/node_modules/pi-agent-text-anchor-line-hash/index.ts +2 -6
- 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 +1 -0
- package/node_modules/pi-agent-text-editor/index.ts +1 -3
- package/node_modules/pi-agent-text-editor/package.json +34 -24
- package/node_modules/pi-agent-text-editor/runtime/entry-69.js +0 -1
- package/node_modules/pi-agent-text-editor/src/api/apply-renderer.ts +3 -0
- package/node_modules/pi-agent-text-editor/src/api/edit-completion.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/api/edit-pipeline.ts +15 -0
- package/node_modules/pi-agent-text-editor/src/api/last-resolved-resource.ts +5 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +3 -0
- package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +15 -1
- package/node_modules/pi-agent-text-editor/src/api/post-edit.ts +74 -1
- package/node_modules/pi-agent-text-editor/src/core/apply/execution.ts +237 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/final-mutations.ts +50 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/format-source.ts +11 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/mixed-source.ts +208 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +39 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/output.ts +216 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/prompt.ts +45 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/queue.ts +25 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/renderer.ts +324 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/results.ts +133 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/runtime.ts +112 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/tool.ts +132 -0
- package/node_modules/pi-agent-text-editor/src/core/builtin-edit-filter.ts +4 -12
- package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +205 -0
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +13 -9
- package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +76 -0
- package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +153 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/diff.ts +5 -2
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +28 -2
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +43 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +81 -0
- package/node_modules/pi-agent-text-editor/src/core/post-edit-scope.ts +73 -0
- package/node_modules/pi-agent-text-editor/src/core/text-anchor-registry.ts +5 -2
- package/node_modules/pi-agent-text-editor/src/core/text-change-engine.ts +10 -2
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +40 -0
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +178 -58
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +313 -21
- package/node_modules/pi-agent-text-editor/src/tools/text-selection.ts +45 -43
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +18 -8
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +7 -4
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +13 -5
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +18 -8
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +9 -5
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +2 -1
- package/node_modules/pi-agent-text-editor-renderer/index.ts +93 -2
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
- package/node_modules/pi-agent-text-editor-renderer/src/diff-model.ts +7 -0
- package/node_modules/pi-agent-text-editor-renderer/src/diff-renderer.ts +1 -1
- package/node_modules/pi-agent-text-editor-renderer/src/diff-viewport.ts +11 -2
- package/node_modules/pi-agent-text-editor-renderer/src/frozen-viewport.ts +140 -52
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +69 -4
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-result.ts +53 -1
- package/node_modules/pi-agent-text-editor-renderer/src/persisted-result.ts +8 -2
- package/node_modules/pi-agent-text-editor-renderer/src/render-resource.ts +10 -0
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +24 -13
- package/node_modules/pi-agent-text-editor-renderer/src/status-summary.ts +33 -0
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-73.js +1 -0
- package/node_modules/pi-agent-tool-call-interception/src/index.ts +3 -0
- package/node_modules/pi-agent-tool-ui/package.json +2 -2
- package/node_modules/pi-agent-web/index.ts +1 -6
- package/node_modules/pi-agent-web/package.json +7 -7
- package/node_modules/pi-agent-web/runtime/entry-75.js +2 -0
- package/node_modules/pi-agent-web/src/browser-loader.ts +1 -0
- package/node_modules/pi-agent-web-html/package.json +3 -3
- package/node_modules/pi-agent-web-html/src/html-converter.ts +1 -1
- 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/package.json +38 -38
- package/src/api/plugin-protocol.ts +12 -2
- package/src/api/text-editor.ts +7 -0
- package/src/api/tool-config.ts +77 -2
- package/src/code-view/diagnostic-view.ts +22 -3
- package/src/composite/builtin-extensions.ts +138 -67
- package/src/composite/extensions-config.ts +59 -0
- package/src/composite/feature-flags.ts +32 -0
- package/src/composite/module-labels.ts +55 -0
- package/src/composite/module-settings-store.ts +44 -0
- package/src/composite/module-settings.ts +132 -0
- package/src/composite/selection.ts +4 -4
- package/src/composite/settings-panel.ts +71 -0
- package/src/core/diagnostic-delivery.ts +29 -0
- package/src/core/diagnostic-entry.ts +142 -0
- package/src/core/diagnostic-store.ts +96 -23
- package/src/core/extension.ts +45 -22
- 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 +6 -6
- 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-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-web/index.ts +1 -6
- 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/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-76.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/src/html-converter.ts +1 -1
- 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/runtime/entry-75.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/browser-loader.ts +1 -0
- package/src/extensions/pi-agent-read/package.json +6 -6
- package/src/extensions/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/src/extensions/pi-agent-read/src/api/read-parameters.ts +29 -0
- package/src/extensions/pi-agent-read/src/api/rendering.ts +3 -0
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +73 -1
- package/src/extensions/pi-agent-read/src/core/read-core.ts +32 -28
- package/src/extensions/pi-agent-read/src/core/tools/read/native-resource-renderer.ts +74 -0
- package/src/extensions/pi-agent-read/src/core/tools/read/output-truncation.ts +1 -1
- package/src/extensions/pi-agent-read/src/core/tools/read/raw-read.ts +113 -0
- package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +87 -19
- package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +15 -0
- package/src/extensions/pi-agent-read/src/core/tools/read/temp-resource-store.ts +35 -126
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +87 -53
- package/src/extensions/pi-agent-search/package.json +3 -3
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +82 -33
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +6 -6
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/file-search.ts +9 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +1 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +2 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +112 -24
- package/src/extensions/pi-agent-search/src/api/plugin-protocol.ts +1 -1
- package/src/extensions/pi-agent-search/src/api/search-parameters.ts +25 -0
- package/src/extensions/pi-agent-search/src/api/search.ts +55 -1
- package/src/extensions/pi-agent-search/src/core/extension.ts +8 -27
- package/src/extensions/pi-agent-search/src/core/search-core.ts +38 -3
- package/src/extensions/pi-agent-text-editor/index.ts +1 -3
- package/src/extensions/pi-agent-text-editor/package.json +34 -24
- 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/package.json +3 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +2 -6
- 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 +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +93 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-model.ts +7 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-renderer.ts +1 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-viewport.ts +11 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/frozen-viewport.ts +140 -52
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +69 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-result.ts +53 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/persisted-result.ts +8 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/render-resource.ts +10 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +24 -13
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/status-summary.ts +33 -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/runtime/entry-69.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-70.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/apply-renderer.ts +3 -0
- package/src/extensions/pi-agent-text-editor/src/api/edit-completion.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/edit-pipeline.ts +15 -0
- package/src/extensions/pi-agent-text-editor/src/api/last-resolved-resource.ts +5 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +3 -0
- package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +15 -1
- package/src/extensions/pi-agent-text-editor/src/api/post-edit.ts +74 -1
- package/src/extensions/pi-agent-text-editor/src/core/apply/execution.ts +237 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/final-mutations.ts +50 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/format-source.ts +11 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/mixed-source.ts +208 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +39 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/output.ts +216 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/prompt.ts +45 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/queue.ts +25 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/renderer.ts +324 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/results.ts +133 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/runtime.ts +112 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/tool.ts +132 -0
- package/src/extensions/pi-agent-text-editor/src/core/builtin-edit-filter.ts +4 -12
- package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +205 -0
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +13 -9
- package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +76 -0
- package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +153 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/diff.ts +5 -2
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +28 -2
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +43 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +81 -0
- package/src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts +73 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-anchor-registry.ts +5 -2
- package/src/extensions/pi-agent-text-editor/src/core/text-change-engine.ts +10 -2
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +40 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +178 -58
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +313 -21
- package/src/extensions/pi-agent-text-editor/src/tools/text-selection.ts +45 -43
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +18 -8
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +7 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +13 -5
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +18 -8
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +9 -5
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +2 -1
- package/src/pi-agent-ide.ts +45 -0
- package/src/plugins/pi-agent-ide-ast/package.json +9 -9
- package/src/plugins/pi-agent-ide-ast/src/ast/outline.ts +89 -19
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +11 -15
- package/src/plugins/pi-agent-ide-ast/src/overflow-handler.ts +83 -0
- package/src/plugins/pi-agent-ide-ast/src/scope-handler.ts +8 -1
- package/src/plugins/pi-agent-ide-ast/src/scope-resolver.ts +1 -1
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +83 -5
- package/src/plugins/pi-agent-ide-changes/index.ts +22 -10
- package/src/plugins/pi-agent-ide-changes/package.json +6 -6
- package/src/plugins/pi-agent-ide-changes/src/last-text-transaction-store.ts +10 -0
- package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +5 -9
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +1 -5
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +62 -26
- package/src/plugins/pi-agent-ide-formatter/package.json +3 -3
- package/src/plugins/pi-agent-ide-formatter/src/formatter.ts +36 -13
- package/src/plugins/pi-agent-ide-formatter/src/registry.ts +9 -1
- package/src/plugins/pi-agent-ide-languages/package.json +2 -2
- package/src/plugins/pi-agent-ide-lint/index.ts +49 -17
- package/src/plugins/pi-agent-ide-lint/package.json +7 -7
- package/src/plugins/pi-agent-ide-lint/src/registry.ts +9 -1
- package/src/plugins/pi-agent-ide-lsp/index.ts +127 -20
- package/src/plugins/pi-agent-ide-lsp/package.json +9 -8
- package/src/plugins/pi-agent-ide-lsp/src/declaration-targets.ts +61 -0
- package/src/plugins/pi-agent-ide-lsp/src/diagnostic-source.ts +25 -7
- package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +12 -1
- package/src/plugins/pi-agent-ide-lsp/src/lsp/code-views.ts +40 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +21 -32
- package/src/plugins/pi-agent-ide-lsp/src/lsp/registry.ts +15 -2
- package/src/plugins/pi-agent-ide-lsp/src/lsp/rename.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +32 -5
- package/src/plugins/pi-agent-ide-lsp/src/rename-plan.ts +138 -0
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +9 -2
- package/src/post-edit/gate.ts +57 -15
- package/src/toolchain/types.ts +2 -0
- package/dist/chunk-2SKAED2I.js +0 -2
- package/dist/chunk-2XYXV5HS.js +0 -4
- package/dist/chunk-2ZMYT6ZC.js +0 -1
- package/dist/chunk-34ZQTTU2.js +0 -2
- package/dist/chunk-4SQQKEVD.js +0 -16
- package/dist/chunk-5BWUVAR4.js +0 -1
- package/dist/chunk-6DN7NO7L.js +0 -1
- package/dist/chunk-6SMFVLTY.js +0 -1
- package/dist/chunk-6XQQBKPE.js +0 -58
- package/dist/chunk-BYWAG6X3.js +0 -6
- package/dist/chunk-EW2KVKCN.js +0 -2
- package/dist/chunk-F6SESI3P.js +0 -4
- package/dist/chunk-GTK5AREE.js +0 -2
- package/dist/chunk-HOBTFFQR.js +0 -1
- package/dist/chunk-IMVCVPMP.js +0 -3
- package/dist/chunk-IOCABSRL.js +0 -1
- package/dist/chunk-JASLOB2X.js +0 -1
- package/dist/chunk-KH5KPBCR.js +0 -10
- package/dist/chunk-KNMWCDDK.js +0 -7
- package/dist/chunk-KYVOMBO5.js +0 -1
- package/dist/chunk-L4FA6OD4.js +0 -1
- package/dist/chunk-LFV6G5Z3.js +0 -1
- package/dist/chunk-LGN7EJYR.js +0 -13
- package/dist/chunk-MB6VVVAF.js +0 -2
- package/dist/chunk-MTQSGWZJ.js +0 -1
- package/dist/chunk-NI2NK4JU.js +0 -1
- package/dist/chunk-NXHPO7ER.js +0 -6
- package/dist/chunk-OFHVDY4Q.js +0 -2
- package/dist/chunk-OIL6BB2S.js +0 -33
- package/dist/chunk-ONWUJXUR.js +0 -1
- package/dist/chunk-PODWLGNO.js +0 -6
- package/dist/chunk-QZANC2IG.js +0 -1
- package/dist/chunk-SSZB66C3.js +0 -3
- package/dist/chunk-TG6H6EOI.js +0 -1
- package/dist/chunk-UTTW55S2.js +0 -1
- package/dist/chunk-VEJGSURY.js +0 -8
- package/dist/chunk-W3XYKJ5H.js +0 -1
- package/dist/chunk-XGUAL3CA.js +0 -1
- package/dist/chunk-YPHXLAQF.js +0 -1
- package/dist/chunk-ZIHEF6K3.js +0 -3
- package/dist/entry-80.js +0 -1
- package/node_modules/pi-agent-read/src/core/tools/read/views.ts +0 -29
- package/node_modules/pi-agent-text-editor/src/core/tool-description.ts +0 -14
- package/node_modules/pi-agent-text-editor-argument-order/index.ts +0 -26
- package/node_modules/pi-agent-text-editor-argument-order/package.json +0 -16
- package/node_modules/pi-agent-text-editor-argument-order/src/argument-order-guard.ts +0 -100
- package/node_modules/pi-agent-text-editor-overwrite/index.ts +0 -365
- package/node_modules/pi-agent-text-editor-overwrite/package.json +0 -17
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +0 -2
- package/node_modules/pi-agent-tool-ui/runtime/entry-75.js +0 -1
- package/node_modules/pi-agent-web-text/runtime/entry-80.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-80.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-76.js +0 -2
- package/src/extensions/pi-agent-read/src/core/tools/read/views.ts +0 -29
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/index.ts +0 -26
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/package.json +0 -16
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/runtime/entry-70.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/src/argument-order-guard.ts +0 -100
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/index.ts +0 -365
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/package.json +0 -17
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +0 -2
- package/src/extensions/pi-agent-text-editor/src/core/tool-description.ts +0 -14
- /package/dist/{chunk-3H2EU7VQ.js → chunk-4U2GUKNJ.js} +0 -0
- /package/node_modules/{pi-agent-text-editor-argument-order → pi-agent-text-editor}/runtime/entry-70.js +0 -0
- /package/node_modules/{pi-agent-text-editor-overwrite → pi-agent-text-editor-renderer}/runtime/entry-71.js +0 -0
- /package/node_modules/{pi-agent-text-editor-renderer → pi-agent-text-editor-stale-anchor}/runtime/entry-72.js +0 -0
- /package/node_modules/{pi-agent-tool-call-interception → pi-agent-tool-ui}/runtime/entry-74.js +0 -0
- /package/node_modules/{pi-agent-web → pi-agent-web-html}/runtime/entry-76.js +0 -0
- /package/node_modules/{pi-agent-web-html → pi-agent-web-image}/runtime/entry-77.js +0 -0
- /package/node_modules/{pi-agent-web-image → pi-agent-web-pdf}/runtime/entry-78.js +0 -0
- /package/node_modules/{pi-agent-web-pdf → pi-agent-web-text}/runtime/entry-79.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-html → pi-agent-web-image}/runtime/entry-77.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-image → pi-agent-web-pdf}/runtime/entry-78.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-pdf → pi-agent-web-text}/runtime/entry-79.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-overwrite → pi-agent-text-editor-renderer}/runtime/entry-71.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-renderer → pi-agent-text-editor-stale-anchor}/runtime/entry-72.js +0 -0
|
@@ -13,29 +13,38 @@ export const copySchema = Type.Object(
|
|
|
13
13
|
{
|
|
14
14
|
path: Type.Optional(
|
|
15
15
|
Type.String({
|
|
16
|
-
description:
|
|
17
|
-
"Source resource reference or file path; a typed resource may select one source span",
|
|
16
|
+
description: "Source file path, or a returned SEARCH# reference selecting the text to copy",
|
|
18
17
|
}),
|
|
19
18
|
),
|
|
20
19
|
start: Type.Optional(
|
|
21
20
|
Type.String({
|
|
22
|
-
description:
|
|
21
|
+
description:
|
|
22
|
+
"Anchor or unique exact text. Alone, selects that fragment; a line anchor selects only its line. Omit when path already selects text through a supported resource reference. With end, selects a whole-line range.",
|
|
23
|
+
}),
|
|
24
|
+
),
|
|
25
|
+
end: Type.Optional(
|
|
26
|
+
Type.String({
|
|
27
|
+
description:
|
|
28
|
+
"Optional anchor or unique exact text. Range includes start's first line through end's last line, even for SEARCH :match. Mixed types allowed; boundaries must be unique, in one file, and forward-ordered. Omit when start already selects the intended content; do not repeat start. The end line is included, not a stopping point before it.",
|
|
23
29
|
}),
|
|
24
30
|
),
|
|
25
|
-
end: Type.Optional(Type.String({ description: "Source end anchor; defaults to start" })),
|
|
26
31
|
target: Type.Optional(
|
|
27
32
|
Type.String({
|
|
28
33
|
description:
|
|
29
|
-
"Target resource reference or file path; a
|
|
34
|
+
"Target resource reference or file path; a returned SEARCH# reference may select the destination; defaults to the source",
|
|
30
35
|
}),
|
|
31
36
|
),
|
|
32
37
|
targetStart: Type.Optional(
|
|
33
38
|
Type.String({
|
|
34
|
-
description:
|
|
39
|
+
description:
|
|
40
|
+
"Registered anchor or unique exact text in the destination. Required unless target already selects one destination range. Without targetEnd, inserts after the last containing line, keeping the selected text. With targetEnd, replacement starts at the first containing line. SEARCH :match also uses these line boundaries.",
|
|
35
41
|
}),
|
|
36
42
|
),
|
|
37
43
|
targetEnd: Type.Optional(
|
|
38
|
-
Type.String({
|
|
44
|
+
Type.String({
|
|
45
|
+
description:
|
|
46
|
+
"Optional inclusive destination end. Replaces whole lines through the last line containing this anchor, including SEARCH :match. May differ in type from targetStart; both must resolve uniquely in the target file and in forward order. Omit to insert after targetStart instead.",
|
|
47
|
+
}),
|
|
39
48
|
),
|
|
40
49
|
},
|
|
41
50
|
{ additionalProperties: false },
|
|
@@ -52,7 +61,8 @@ interface CopyParameters {
|
|
|
52
61
|
|
|
53
62
|
export const copyMutationTool: TextMutationToolRegistration<typeof copySchema> = {
|
|
54
63
|
name: "copy",
|
|
55
|
-
description:
|
|
64
|
+
description:
|
|
65
|
+
"Use copy to duplicate existing text within or between files while keeping the source. Select the source and destination without reproducing the text in your call. The copy is inserted at the destination or replaces a destination range.",
|
|
56
66
|
|
|
57
67
|
promptSnippet:
|
|
58
68
|
"Make precise file edits by copying text within or between files using exact matches or anchors",
|
|
@@ -15,17 +15,19 @@ export const deleteSchema = Type.Object(
|
|
|
15
15
|
path: Type.Optional(
|
|
16
16
|
Type.String({
|
|
17
17
|
description:
|
|
18
|
-
"Source resource reference or file path. A
|
|
18
|
+
"Source resource reference or file path. A returned SEARCH# reference can select deletion ranges.",
|
|
19
19
|
}),
|
|
20
20
|
),
|
|
21
21
|
start: Type.Optional(
|
|
22
22
|
Type.String({
|
|
23
|
-
description:
|
|
23
|
+
description:
|
|
24
|
+
"Anchor or unique exact text. Alone, selects that fragment; a line anchor selects only its line. Omit when path already selects text through a supported resource reference. With end, selects a whole-line range.",
|
|
24
25
|
}),
|
|
25
26
|
),
|
|
26
27
|
end: Type.Optional(
|
|
27
28
|
Type.String({
|
|
28
|
-
description:
|
|
29
|
+
description:
|
|
30
|
+
"Optional anchor or unique exact text. Range includes start's first line through end's last line, even for SEARCH :match. Mixed types allowed; boundaries must be unique, in one file, and forward-ordered. Omit when start already selects the intended content; do not repeat start. The end line is included, not a stopping point before it.",
|
|
29
31
|
}),
|
|
30
32
|
),
|
|
31
33
|
},
|
|
@@ -40,7 +42,8 @@ interface DeleteParameters {
|
|
|
40
42
|
|
|
41
43
|
export const deleteMutationTool: TextMutationToolRegistration<typeof deleteSchema> = {
|
|
42
44
|
name: "delete",
|
|
43
|
-
description:
|
|
45
|
+
description:
|
|
46
|
+
"Use delete to remove an existing text fragment or an inclusive range of whole lines. Select only the content to remove; surrounding text is kept.",
|
|
44
47
|
|
|
45
48
|
promptSnippet: "Make precise file edits by deleting text using exact matches or anchors",
|
|
46
49
|
parameters: deleteSchema,
|
|
@@ -15,17 +15,24 @@ export const insertSchema = Type.Object(
|
|
|
15
15
|
path: Type.Optional(
|
|
16
16
|
Type.String({
|
|
17
17
|
description:
|
|
18
|
-
"Source resource reference or file path. A
|
|
18
|
+
"Source resource reference or file path. A returned SEARCH# reference can select insertion positions.",
|
|
19
19
|
}),
|
|
20
20
|
),
|
|
21
21
|
anchor: Type.Optional(
|
|
22
22
|
Type.String({
|
|
23
|
-
description:
|
|
23
|
+
description:
|
|
24
|
+
"Registered anchor or unique exact text locating the insertion. Required unless path already supplies a SEARCH selection. Inserts after the last containing line by default, or before the first containing line when before is true. This includes SEARCH :match and multiline exact text; the selected text is kept. Multiple matches on the same insertion line produce one insertion.",
|
|
24
25
|
}),
|
|
25
26
|
),
|
|
26
|
-
text: Type.String({
|
|
27
|
+
text: Type.String({
|
|
28
|
+
description:
|
|
29
|
+
"New text only. The tool supplies the line boundary; do not prefix a newline just to start a new line. For example, 'NEW' inserts one line, while '\\nNEW' intentionally adds a blank line before it. A missing trailing newline is supplied before following text; additional newlines remain intentional blank lines. When appending after an unterminated final line, the tool supplies the separator before the new text and removes one trailing newline from the payload. Payload line endings follow the destination file's LF/CRLF style.",
|
|
30
|
+
}),
|
|
27
31
|
before: Type.Optional(
|
|
28
|
-
Type.Boolean({
|
|
32
|
+
Type.Boolean({
|
|
33
|
+
description:
|
|
34
|
+
"Defaults to false: insert after the last containing line. True: insert before the first containing line. The anchor's text and its lines are kept.",
|
|
35
|
+
}),
|
|
29
36
|
),
|
|
30
37
|
},
|
|
31
38
|
{ additionalProperties: false },
|
|
@@ -40,7 +47,8 @@ interface InsertParameters {
|
|
|
40
47
|
|
|
41
48
|
export const insertMutationTool: TextMutationToolRegistration<typeof insertSchema> = {
|
|
42
49
|
name: "insert",
|
|
43
|
-
description:
|
|
50
|
+
description:
|
|
51
|
+
"Use insert to add new text before or after selected lines while keeping existing text. Insertion is line-based, including for exact-text and SEARCH :match anchors.",
|
|
44
52
|
|
|
45
53
|
promptSnippet:
|
|
46
54
|
"Make precise file edits by inserting text before or after exact matches or anchors",
|
|
@@ -15,29 +15,38 @@ export const moveSchema = Type.Object(
|
|
|
15
15
|
{
|
|
16
16
|
path: Type.Optional(
|
|
17
17
|
Type.String({
|
|
18
|
-
description:
|
|
19
|
-
"Source resource reference or file path; a typed resource may select one source span",
|
|
18
|
+
description: "Source file path, or a returned SEARCH# reference selecting the text to move",
|
|
20
19
|
}),
|
|
21
20
|
),
|
|
22
21
|
start: Type.Optional(
|
|
23
22
|
Type.String({
|
|
24
|
-
description:
|
|
23
|
+
description:
|
|
24
|
+
"Anchor or unique exact text. Alone, selects that fragment; a line anchor selects only its line. Omit when path already selects text through a supported resource reference. With end, selects a whole-line range.",
|
|
25
|
+
}),
|
|
26
|
+
),
|
|
27
|
+
end: Type.Optional(
|
|
28
|
+
Type.String({
|
|
29
|
+
description:
|
|
30
|
+
"Optional anchor or unique exact text. Range includes start's first line through end's last line, even for SEARCH :match. Mixed types allowed; boundaries must be unique, in one file, and forward-ordered. Omit when start already selects the intended content; do not repeat start. The end line is included, not a stopping point before it.",
|
|
25
31
|
}),
|
|
26
32
|
),
|
|
27
|
-
end: Type.Optional(Type.String({ description: "Source end anchor; defaults to start" })),
|
|
28
33
|
target: Type.Optional(
|
|
29
34
|
Type.String({
|
|
30
35
|
description:
|
|
31
|
-
"Target resource reference or file path; a
|
|
36
|
+
"Target resource reference or file path; a returned SEARCH# reference may select the destination; defaults to the source",
|
|
32
37
|
}),
|
|
33
38
|
),
|
|
34
39
|
targetStart: Type.Optional(
|
|
35
40
|
Type.String({
|
|
36
|
-
description:
|
|
41
|
+
description:
|
|
42
|
+
"Registered anchor or unique exact text in the destination. Required unless target already selects one destination range. Without targetEnd, inserts after the last containing line, keeping the selected text. With targetEnd, replacement starts at the first containing line. SEARCH :match also uses these line boundaries.",
|
|
37
43
|
}),
|
|
38
44
|
),
|
|
39
45
|
targetEnd: Type.Optional(
|
|
40
|
-
Type.String({
|
|
46
|
+
Type.String({
|
|
47
|
+
description:
|
|
48
|
+
"Optional inclusive destination end. Replaces whole lines through the last line containing this anchor, including SEARCH :match. May differ in type from targetStart; both must resolve uniquely in the target file and in forward order. Omit to insert after targetStart instead.",
|
|
49
|
+
}),
|
|
41
50
|
),
|
|
42
51
|
},
|
|
43
52
|
{ additionalProperties: false },
|
|
@@ -54,7 +63,8 @@ interface MoveParameters {
|
|
|
54
63
|
|
|
55
64
|
export const moveMutationTool: TextMutationToolRegistration<typeof moveSchema> = {
|
|
56
65
|
name: "move",
|
|
57
|
-
description:
|
|
66
|
+
description:
|
|
67
|
+
"Use move to relocate existing text within or between files. Select the source and destination without reproducing the text in your call. The selected text is removed from the source and inserted at the destination, or replaces a destination range.",
|
|
58
68
|
|
|
59
69
|
promptSnippet:
|
|
60
70
|
"Make precise file edits by moving text within or between files using exact matches or anchors",
|
|
@@ -15,21 +15,25 @@ export const replaceSchema = Type.Object(
|
|
|
15
15
|
path: Type.Optional(
|
|
16
16
|
Type.String({
|
|
17
17
|
description:
|
|
18
|
-
"Source resource reference or file path. A
|
|
18
|
+
"Source resource reference or file path. A returned SEARCH# reference can select replacement ranges.",
|
|
19
19
|
}),
|
|
20
20
|
),
|
|
21
21
|
start: Type.Optional(
|
|
22
22
|
Type.String({
|
|
23
23
|
description:
|
|
24
|
-
"
|
|
24
|
+
"Anchor or unique exact text. Alone, selects that fragment; a line anchor selects only its line. Omit when path already selects text through a supported resource reference. With end, selects a whole-line range.",
|
|
25
25
|
}),
|
|
26
26
|
),
|
|
27
27
|
end: Type.Optional(
|
|
28
28
|
Type.String({
|
|
29
|
-
description:
|
|
29
|
+
description:
|
|
30
|
+
"Optional anchor or unique exact text. Range includes start's first line through end's last line, even for SEARCH :match. Mixed types allowed; boundaries must be unique, in one file, and forward-ordered. Omit when start already selects the intended content; do not repeat start. The end line is included, not a stopping point before it.",
|
|
30
31
|
}),
|
|
31
32
|
),
|
|
32
|
-
text: Type.String({
|
|
33
|
+
text: Type.String({
|
|
34
|
+
description:
|
|
35
|
+
"Replacement text. Empty text removes the selection; a whole-line selection removes its lines without inserting a blank line. Adjacent unselected lines are kept.",
|
|
36
|
+
}),
|
|
33
37
|
},
|
|
34
38
|
{ additionalProperties: false },
|
|
35
39
|
);
|
|
@@ -44,7 +48,7 @@ interface ReplaceParameters {
|
|
|
44
48
|
export const replaceMutationTool: TextMutationToolRegistration<typeof replaceSchema> = {
|
|
45
49
|
name: "replace",
|
|
46
50
|
description:
|
|
47
|
-
"
|
|
51
|
+
"Use replace to change an existing text fragment, an inclusive line range, or every selected search match. Exact text must be unique; SEARCH#...:all:match selects every returned match for replacement.",
|
|
48
52
|
|
|
49
53
|
promptSnippet: "Make precise file edits by replacing text using exact matches or anchors",
|
|
50
54
|
parameters: replaceSchema,
|
|
@@ -17,7 +17,8 @@ interface WriteParameters {
|
|
|
17
17
|
|
|
18
18
|
export const writeMutationTool: TextMutationToolRegistration<typeof writeSchema> = {
|
|
19
19
|
name: "write",
|
|
20
|
-
description:
|
|
20
|
+
description:
|
|
21
|
+
"Use write to create a new file or deliberately replace a file's entire contents. Supply the complete new text; existing contents are overwritten.",
|
|
21
22
|
|
|
22
23
|
promptSnippet: "Create or overwrite files",
|
|
23
24
|
parameters: writeSchema,
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { Text } from "@earendil-works/pi-tui";
|
|
3
|
+
import {
|
|
4
|
+
createApplyResultRenderer,
|
|
5
|
+
createApplyCallRenderer,
|
|
6
|
+
} from "pi-agent-text-editor/api/apply-renderer";
|
|
7
|
+
import type { AnyTextMutationToolRegistration } from "pi-agent-text-editor/api/mutation-tool";
|
|
8
|
+
import { MutationPanel } from "./src/mutation-panel.js";
|
|
9
|
+
import { resolveMutationResultResources } from "./src/mutation-result.js";
|
|
1
10
|
import { connectTextEditorPlugin } from "pi-agent-text-editor/api/connect-plugin";
|
|
2
11
|
import {
|
|
3
12
|
TEXT_EDITOR_API_VERSION,
|
|
@@ -6,7 +15,7 @@ import {
|
|
|
6
15
|
} from "pi-agent-text-editor/api/plugin-protocol";
|
|
7
16
|
|
|
8
17
|
import { createMutationAnimationPressure } from "./src/animation-pressure.js";
|
|
9
|
-
import { registerMutationRenderers } from "./src/renderer.js";
|
|
18
|
+
import { registerMutationRenderers, renderWrittenMutationHeader } from "./src/renderer.js";
|
|
10
19
|
|
|
11
20
|
import { compactMutationDetails } from "./src/persisted-result.js";
|
|
12
21
|
import type { FileMutationBatchResult } from "pi-agent-text-editor/api/mutation-result";
|
|
@@ -20,9 +29,91 @@ export default async function registerTextEditorRenderer(pi: ExtensionAPI): Prom
|
|
|
20
29
|
apiVersion: TEXT_EDITOR_API_VERSION,
|
|
21
30
|
id: "text-editor-renderer",
|
|
22
31
|
setup(api) {
|
|
32
|
+
const registrations = new Map<string, AnyTextMutationToolRegistration>();
|
|
33
|
+
api.onMutationTool((registration) => registrations.set(registration.name, registration));
|
|
34
|
+
api.addToolRenderer({
|
|
35
|
+
tool: "diff",
|
|
36
|
+
renderResult(result, options, theme, context) {
|
|
37
|
+
const details = result.details as FileMutationBatchResult | undefined;
|
|
38
|
+
if (context.isError || details?.results === undefined)
|
|
39
|
+
return new Text(
|
|
40
|
+
result.content
|
|
41
|
+
.filter((block) => block.type === "text")
|
|
42
|
+
.map((block) => block.text)
|
|
43
|
+
.join("\n"),
|
|
44
|
+
0,
|
|
45
|
+
0,
|
|
46
|
+
);
|
|
47
|
+
const panel = new MutationPanel(theme);
|
|
48
|
+
panel.setBackground("toolSuccessBg");
|
|
49
|
+
panel.setExpanded(options.expanded);
|
|
50
|
+
panel.setResourceLabelsVisible(true);
|
|
51
|
+
panel.setResultResources(resolveMutationResultResources(details, undefined));
|
|
52
|
+
return panel;
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
api.addToolRenderer({
|
|
56
|
+
tool: "apply",
|
|
57
|
+
renderCall: createApplyCallRenderer((call, theme) => {
|
|
58
|
+
const registration = registrations.get(call.name === "remove" ? "delete" : call.name);
|
|
59
|
+
const display = (argument: typeof call.path) =>
|
|
60
|
+
argument ? (argument.literal ? argument.text : `‹${argument.text}›`) : "…";
|
|
61
|
+
const source = display(
|
|
62
|
+
call.arguments[registration?.source.field ?? "path"] ?? call.arguments.file,
|
|
63
|
+
);
|
|
64
|
+
const identityKeys =
|
|
65
|
+
call.name === "diff"
|
|
66
|
+
? ["before", "after"]
|
|
67
|
+
: call.name === "search"
|
|
68
|
+
? ["path", "query"]
|
|
69
|
+
: [registration?.source.field ?? (call.arguments.file ? "file" : "path"), "target"];
|
|
70
|
+
const parameters = Object.entries(call.arguments)
|
|
71
|
+
.filter(([key]) => !identityKeys.includes(key))
|
|
72
|
+
.map(([key, value]) => `${key}: ${display(value)}`)
|
|
73
|
+
.join(" · ");
|
|
74
|
+
const suffix = parameters ? ` ${theme.fg("dim", parameters)}` : "";
|
|
75
|
+
if (registration)
|
|
76
|
+
return (
|
|
77
|
+
renderWrittenMutationHeader(
|
|
78
|
+
registration,
|
|
79
|
+
{
|
|
80
|
+
[registration.source.field]: source,
|
|
81
|
+
...(call.target ? { target: display(call.target) } : {}),
|
|
82
|
+
},
|
|
83
|
+
theme,
|
|
84
|
+
) + suffix
|
|
85
|
+
);
|
|
86
|
+
const identity =
|
|
87
|
+
call.name === "search"
|
|
88
|
+
? `${display(call.query)}${call.path ? ` · ${source}` : ""}`
|
|
89
|
+
: call.name === "diff"
|
|
90
|
+
? `${display(call.before)} → ${display(call.after)}`
|
|
91
|
+
: `${source}${call.target ? ` → ${display(call.target)}` : ""}`;
|
|
92
|
+
return `${theme.fg("toolTitle", theme.bold(call.name))} ${theme.fg("accent", identity)}${suffix}`;
|
|
93
|
+
}),
|
|
94
|
+
renderResult: createApplyResultRenderer((details, theme, expanded, cwd) => {
|
|
95
|
+
const panel = new MutationPanel(theme);
|
|
96
|
+
panel.setBackground("toolSuccessBg");
|
|
97
|
+
panel.setExpanded(expanded);
|
|
98
|
+
panel.setResourceLabelsVisible(true);
|
|
99
|
+
panel.setResultResources(
|
|
100
|
+
resolveMutationResultResources(details, undefined).map((resource) => ({
|
|
101
|
+
...resource,
|
|
102
|
+
path: path.isAbsolute(resource.path)
|
|
103
|
+
? path.relative(cwd, resource.path)
|
|
104
|
+
: resource.path,
|
|
105
|
+
})),
|
|
106
|
+
);
|
|
107
|
+
return panel;
|
|
108
|
+
}),
|
|
109
|
+
});
|
|
23
110
|
const tools = new Set<string>();
|
|
24
111
|
api.onMutationTool(({ name }) => tools.add(name));
|
|
25
|
-
registerMutationRenderers(
|
|
112
|
+
registerMutationRenderers(
|
|
113
|
+
api,
|
|
114
|
+
animationPressure,
|
|
115
|
+
() => pi.getFlag("pi-agent-ide-no-animations") !== true,
|
|
116
|
+
);
|
|
26
117
|
pi.on("tool_result", (event) => {
|
|
27
118
|
if (
|
|
28
119
|
!tools.has(event.toolName) ||
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-editor-renderer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"diff": "^9.0.0",
|
|
10
|
-
"pi-agent-invariant": "0.
|
|
11
|
-
"pi-agent-text-editor": "0.
|
|
12
|
-
"pi-agent-tool-call-interception": "0.
|
|
13
|
-
"pi-agent-tool-ui": "0.
|
|
10
|
+
"pi-agent-invariant": "0.3.0",
|
|
11
|
+
"pi-agent-text-editor": "0.3.0",
|
|
12
|
+
"pi-agent-tool-call-interception": "0.3.0",
|
|
13
|
+
"pi-agent-tool-ui": "0.3.0"
|
|
14
14
|
},
|
|
15
15
|
"pi": {
|
|
16
16
|
"extensions": [
|
|
17
|
-
"./runtime/entry-
|
|
17
|
+
"./runtime/entry-71.js"
|
|
18
18
|
]
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
@@ -23,6 +23,13 @@ export interface DiffRow {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export interface DiffModel {
|
|
26
|
+
/** Changed rows excluded from this operation's local presentation. */
|
|
27
|
+
readonly omittedChanges?: {
|
|
28
|
+
readonly outside: number;
|
|
29
|
+
readonly ambiguous: number;
|
|
30
|
+
/** Alignment exhausted its budget; changed-row counts are unknown. */
|
|
31
|
+
readonly unavailable?: boolean;
|
|
32
|
+
};
|
|
26
33
|
readonly rows: readonly DiffRow[];
|
|
27
34
|
readonly added: number;
|
|
28
35
|
readonly modified: number;
|
|
@@ -100,7 +100,7 @@ function renderRow(
|
|
|
100
100
|
if (omitted !== undefined) {
|
|
101
101
|
const summary = withForeground(
|
|
102
102
|
palette.contextForeground,
|
|
103
|
-
` ··· ${String(omitted)} lines omitted`,
|
|
103
|
+
` ··· ${String(omitted)} lines omitted${item.omittedChanged ? ` (${item.omittedChanged} changed)` : ""}`,
|
|
104
104
|
);
|
|
105
105
|
return [
|
|
106
106
|
showExpandHint
|
|
@@ -5,6 +5,9 @@ export const COMPACT_BODY_ROWS = 12;
|
|
|
5
5
|
export interface ViewportRow {
|
|
6
6
|
readonly row?: DiffRow;
|
|
7
7
|
readonly omitted?: number;
|
|
8
|
+
|
|
9
|
+
/** Changed rows hidden by compact presentation, available when expanded. */
|
|
10
|
+
readonly omittedChanged?: number;
|
|
8
11
|
}
|
|
9
12
|
|
|
10
13
|
export function compactViewport(model: DiffModel): readonly ViewportRow[] {
|
|
@@ -17,11 +20,17 @@ export function compactViewport(model: DiffModel): readonly ViewportRow[] {
|
|
|
17
20
|
const selected: ViewportRow[] = model.rows.slice(start, end).map((row) => ({ row }));
|
|
18
21
|
|
|
19
22
|
if (start > 0) {
|
|
20
|
-
selected[0] = {
|
|
23
|
+
selected[0] = {
|
|
24
|
+
omitted: start + 1,
|
|
25
|
+
omittedChanged: model.rows.slice(0, start + 1).filter((row) => row.changed).length,
|
|
26
|
+
};
|
|
21
27
|
}
|
|
22
28
|
|
|
23
29
|
if (end < model.rows.length) {
|
|
24
|
-
selected[selected.length - 1] = {
|
|
30
|
+
selected[selected.length - 1] = {
|
|
31
|
+
omitted: model.rows.length - end + 1,
|
|
32
|
+
omittedChanged: model.rows.slice(end - 1).filter((row) => row.changed).length,
|
|
33
|
+
};
|
|
25
34
|
}
|
|
26
35
|
|
|
27
36
|
return selected;
|