pi-agent-ide 0.2.2 → 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 +25 -0
- package/README.md +12 -8
- 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-XF5PVZOS.js → chunk-B5KB2I7J.js} +1 -1
- package/dist/{chunk-WNMGUALD.js → chunk-CEKXBS55.js} +1 -1
- package/dist/chunk-CW53ZTU3.js +2 -0
- package/dist/chunk-EWNWKDMP.js +4 -0
- package/dist/{chunk-LQYZG62K.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-THSCUT2L.js → chunk-LRYE2WCN.js} +1 -1
- package/dist/{chunk-76WHES5H.js → chunk-M5L42DWE.js} +5 -5
- package/dist/chunk-M5MJP7Z2.js +1 -0
- package/dist/chunk-NMFQGKPE.js +2 -0
- package/dist/chunk-NTYXZ3EL.js +3 -0
- package/dist/{chunk-P6T3Q7LB.js → chunk-QDST6VIU.js} +1 -1
- package/dist/chunk-RHV5STR3.js +3 -0
- package/dist/chunk-ROXXK6TW.js +0 -0
- package/dist/chunk-SSHZEWWV.js +1 -0
- package/dist/{chunk-4ZTEPMJO.js → chunk-TPIHQYK2.js} +1 -1
- 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-ZXN3TWWW.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-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 +1 -1
- package/dist/entry-24.js +1 -1
- package/dist/entry-25.js +1 -1
- package/dist/entry-26.js +10 -5
- package/dist/entry-28.js +1 -1
- package/dist/entry-29.js +1 -1
- package/dist/entry-31.js +3 -3
- package/dist/entry-32.js +6 -5
- 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 +12 -8
- 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 +4 -4
- package/dist/entry-46.js +10 -10
- 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 -59
- package/dist/entry-70.js +123 -4
- package/dist/entry-71.js +30 -1
- package/dist/entry-72.js +2 -29
- package/dist/entry-73.js +1 -2
- 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 -3
- package/dist/entry-78.js +1 -1
- package/dist/entry-79.js +1 -1
- package/dist/pi-agent-ide.js +3 -2
- package/docs/configuration.md +32 -11
- package/docs/tools.md +6 -0
- package/node_modules/pi-agent-doctor/package.json +1 -1
- 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/extension.ts +4 -3
- package/node_modules/pi-agent-ide-ast/src/overflow-handler.ts +68 -45
- package/node_modules/pi-agent-ide-ast/src/scope-handler.ts +8 -1
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +83 -5
- package/node_modules/pi-agent-ide-changes/index.ts +21 -5
- 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 +4 -2
- package/node_modules/pi-agent-ide-formatter/package.json +3 -3
- package/node_modules/pi-agent-ide-formatter/src/formatter.ts +26 -8
- 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 +46 -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 +126 -8
- 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 +18 -3
- package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +4 -0
- 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-invariant/package.json +1 -1
- package/node_modules/pi-agent-pdf/package.json +2 -2
- 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/tools/read.ts +73 -1
- package/node_modules/pi-agent-read/src/core/read-core.ts +26 -2
- 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 +61 -14
- 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 +73 -44
- package/node_modules/pi-agent-resource/package.json +1 -1
- 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 +2 -23
- package/node_modules/pi-agent-search/src/core/search-core.ts +28 -3
- package/node_modules/pi-agent-search-text/index.ts +44 -4
- package/node_modules/pi-agent-search-text/package.json +6 -6
- package/node_modules/pi-agent-search-text/src/search-session.ts +65 -25
- package/node_modules/pi-agent-text/package.json +2 -2
- 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/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/plugin-protocol.ts +15 -1
- package/node_modules/pi-agent-text-editor/src/api/post-edit.ts +3 -0
- 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/diff-tool.ts +205 -0
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +6 -0
- 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 +1 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +6 -1
- 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-change-engine.ts +10 -2
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +17 -0
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +173 -49
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +261 -9
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +1 -1
- package/node_modules/pi-agent-text-editor-renderer/index.ts +88 -1
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +42 -25
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +19 -10
- 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-ui/package.json +2 -2
- 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-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 +10 -2
- package/src/api/tool-config.ts +73 -2
- package/src/code-view/diagnostic-view.ts +22 -3
- package/src/composite/builtin-extensions.ts +4 -15
- package/src/composite/extensions-config.ts +41 -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 +51 -3
- package/src/core/diagnostic-store.ts +56 -5
- package/src/core/extension.ts +34 -33
- 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/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-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/tools/read.ts +73 -1
- package/src/extensions/pi-agent-read/src/core/read-core.ts +26 -2
- 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 +61 -14
- 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 +73 -44
- package/src/extensions/pi-agent-search/package.json +3 -3
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +44 -4
- 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/search-session.ts +65 -25
- 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 +2 -23
- package/src/extensions/pi-agent-search/src/core/search-core.ts +28 -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/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 +88 -1
- 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/mutation-panel.ts +42 -25
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +19 -10
- 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/plugin-protocol.ts +15 -1
- package/src/extensions/pi-agent-text-editor/src/api/post-edit.ts +3 -0
- 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/diff-tool.ts +205 -0
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +6 -0
- 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 +1 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +6 -1
- 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-change-engine.ts +10 -2
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +17 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +173 -49
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +261 -9
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +1 -1
- package/src/pi-agent-ide.ts +42 -8
- package/src/plugins/pi-agent-ide-ast/package.json +9 -9
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +4 -3
- package/src/plugins/pi-agent-ide-ast/src/overflow-handler.ts +68 -45
- package/src/plugins/pi-agent-ide-ast/src/scope-handler.ts +8 -1
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +83 -5
- package/src/plugins/pi-agent-ide-changes/index.ts +21 -5
- 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 +4 -2
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +62 -11
- package/src/plugins/pi-agent-ide-formatter/package.json +3 -3
- package/src/plugins/pi-agent-ide-formatter/src/formatter.ts +26 -8
- 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 +46 -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 +126 -8
- 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 +18 -3
- package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +4 -0
- 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 +15 -2
- package/dist/chunk-4U6KGABH.js +0 -1
- package/dist/chunk-6ACQQBUY.js +0 -7
- package/dist/chunk-GFWDXTOB.js +0 -4
- package/dist/chunk-JASLOB2X.js +0 -1
- package/dist/chunk-JJVXUL5U.js +0 -2
- package/dist/chunk-KCEOTU5Z.js +0 -3
- package/dist/chunk-KVGQG43U.js +0 -1
- package/dist/chunk-QJFRAMK7.js +0 -2
- package/dist/chunk-RAZOACDD.js +0 -2
- package/dist/chunk-RIGRP3FD.js +0 -1
- package/dist/chunk-X6MPU7UO.js +0 -3
- package/dist/chunk-YPHXLAQF.js +0 -1
- package/dist/entry-80.js +0 -1
- 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-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
|
@@ -1,87 +1,97 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
|
-
"#src/*": "./src/*"
|
|
7
|
-
"#overwrite/*": "./plugins/pi-agent-text-editor-overwrite/*"
|
|
6
|
+
"#src/*": "./src/*"
|
|
8
7
|
},
|
|
9
8
|
"exports": {
|
|
9
|
+
"./api/apply-renderer": {
|
|
10
|
+
"types": "./src/api/apply-renderer.ts",
|
|
11
|
+
"default": "./runtime/entry-54.js"
|
|
12
|
+
},
|
|
10
13
|
"./api/anchor-inspection": {
|
|
11
14
|
"types": "./src/api/anchor-inspection.ts",
|
|
12
|
-
"default": "./runtime/entry-
|
|
15
|
+
"default": "./runtime/entry-55.js"
|
|
13
16
|
},
|
|
14
17
|
"./api/connect-plugin": {
|
|
15
18
|
"types": "./src/api/connect-plugin.ts",
|
|
16
|
-
"default": "./runtime/entry-
|
|
19
|
+
"default": "./runtime/entry-56.js"
|
|
17
20
|
},
|
|
18
21
|
"./api/edit-completion": {
|
|
19
22
|
"types": "./src/api/edit-completion.ts",
|
|
20
|
-
"default": "./runtime/entry-
|
|
23
|
+
"default": "./runtime/entry-57.js"
|
|
21
24
|
},
|
|
22
25
|
"./api/edit-pipeline": {
|
|
23
26
|
"types": "./src/api/edit-pipeline.ts",
|
|
24
|
-
"default": "./runtime/entry-
|
|
27
|
+
"default": "./runtime/entry-58.js"
|
|
25
28
|
},
|
|
26
29
|
"./api/plugin-protocol": {
|
|
27
30
|
"types": "./src/api/plugin-protocol.ts",
|
|
28
|
-
"default": "./runtime/entry-
|
|
31
|
+
"default": "./runtime/entry-59.js"
|
|
29
32
|
},
|
|
30
33
|
"./api/stale-anchor-message": {
|
|
31
34
|
"types": "./src/api/stale-anchor-message.ts",
|
|
32
|
-
"default": "./runtime/entry-
|
|
35
|
+
"default": "./runtime/entry-60.js"
|
|
33
36
|
},
|
|
34
37
|
"./api/text-selection-anchor": {
|
|
35
38
|
"types": "./src/api/text-selection-anchor.ts",
|
|
36
|
-
"default": "./runtime/entry-
|
|
39
|
+
"default": "./runtime/entry-61.js"
|
|
37
40
|
},
|
|
38
41
|
"./api/post-edit": {
|
|
39
42
|
"types": "./src/api/post-edit.ts",
|
|
40
|
-
"default": "./runtime/entry-
|
|
43
|
+
"default": "./runtime/entry-62.js"
|
|
41
44
|
},
|
|
42
45
|
"./api/mutation-result": {
|
|
43
46
|
"types": "./src/api/mutation-result.ts",
|
|
44
|
-
"default": "./runtime/entry-
|
|
47
|
+
"default": "./runtime/entry-63.js"
|
|
45
48
|
},
|
|
46
49
|
"./api/mutation-guard": {
|
|
47
50
|
"types": "./src/api/mutation-guard.ts",
|
|
48
|
-
"default": "./runtime/entry-
|
|
51
|
+
"default": "./runtime/entry-64.js"
|
|
49
52
|
},
|
|
50
53
|
"./api/mutation-tool": {
|
|
51
54
|
"types": "./src/api/mutation-tool.ts",
|
|
52
|
-
"default": "./runtime/entry-
|
|
55
|
+
"default": "./runtime/entry-65.js"
|
|
53
56
|
},
|
|
54
57
|
"./api/mutation-preview": {
|
|
55
58
|
"types": "./src/api/mutation-preview.ts",
|
|
56
|
-
"default": "./runtime/entry-
|
|
59
|
+
"default": "./runtime/entry-66.js"
|
|
57
60
|
},
|
|
58
61
|
"./api/last-resolved-resource": {
|
|
59
62
|
"types": "./src/api/last-resolved-resource.ts",
|
|
60
|
-
"default": "./runtime/entry-
|
|
63
|
+
"default": "./runtime/entry-67.js"
|
|
61
64
|
},
|
|
62
65
|
"./api/tool-call-interceptor": {
|
|
63
66
|
"types": "./src/api/tool-call-interceptor.ts",
|
|
64
|
-
"default": "./runtime/entry-
|
|
67
|
+
"default": "./runtime/entry-68.js"
|
|
65
68
|
},
|
|
66
69
|
"./api/tool-renderer": {
|
|
67
70
|
"types": "./src/api/tool-renderer.ts",
|
|
68
|
-
"default": "./runtime/entry-
|
|
71
|
+
"default": "./runtime/entry-69.js"
|
|
69
72
|
}
|
|
70
73
|
},
|
|
71
74
|
"dependencies": {
|
|
72
75
|
"@codemirror/state": "^6.5.0",
|
|
76
|
+
"@lezer/common": "^1.5.2",
|
|
77
|
+
"@lezer/javascript": "^1.5.4",
|
|
73
78
|
"diff": "^9.0.0",
|
|
79
|
+
"fs-extra": "^11.4.0",
|
|
80
|
+
"oxfmt": "0.64.0",
|
|
74
81
|
"partial-json": "^0.1.7",
|
|
75
|
-
"pi-agent-invariant": "0.
|
|
76
|
-
"pi-agent-read": "0.
|
|
77
|
-
"pi-agent-resource": "0.
|
|
78
|
-
"pi-agent-
|
|
79
|
-
"pi-agent-
|
|
82
|
+
"pi-agent-invariant": "0.3.0",
|
|
83
|
+
"pi-agent-read": "0.3.0",
|
|
84
|
+
"pi-agent-resource": "0.3.0",
|
|
85
|
+
"pi-agent-search": "0.3.0",
|
|
86
|
+
"pi-agent-text": "0.3.0",
|
|
87
|
+
"pi-agent-tool-call-interception": "0.3.0",
|
|
88
|
+
"pi-agent-tool-ui": "0.3.0",
|
|
89
|
+
"run": "2.1.4",
|
|
80
90
|
"typebox-guard": "npm:typebox@^1.1.38"
|
|
81
91
|
},
|
|
82
92
|
"pi": {
|
|
83
93
|
"extensions": [
|
|
84
|
-
"./runtime/entry-
|
|
94
|
+
"./runtime/entry-70.js"
|
|
85
95
|
]
|
|
86
96
|
},
|
|
87
97
|
"peerDependencies": {
|
package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-anchor-constant",
|
|
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
|
-
"pi-agent-text": "0.
|
|
10
|
-
"pi-agent-text-editor": "0.
|
|
9
|
+
"pi-agent-text": "0.3.0",
|
|
10
|
+
"pi-agent-text-editor": "0.3.0"
|
|
11
11
|
},
|
|
12
12
|
"pi": {
|
|
13
13
|
"extensions": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-anchor-exact",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"fast-fuzzy": "1.12.0",
|
|
16
|
-
"pi-agent-text": "0.
|
|
17
|
-
"pi-agent-text-editor": "0.
|
|
16
|
+
"pi-agent-text": "0.3.0",
|
|
17
|
+
"pi-agent-text-editor": "0.3.0"
|
|
18
18
|
},
|
|
19
19
|
"pi": {
|
|
20
20
|
"extensions": [
|
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.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"pi-agent-invariant": "0.
|
|
16
|
-
"pi-agent-read": "0.
|
|
17
|
-
"pi-agent-text": "0.
|
|
18
|
-
"pi-agent-text-editor": "0.
|
|
15
|
+
"pi-agent-invariant": "0.3.0",
|
|
16
|
+
"pi-agent-read": "0.3.0",
|
|
17
|
+
"pi-agent-text": "0.3.0",
|
|
18
|
+
"pi-agent-text-editor": "0.3.0"
|
|
19
19
|
},
|
|
20
20
|
"pi": {
|
|
21
21
|
"extensions": [
|
|
@@ -32,6 +32,7 @@ export function createLineHashPresenter(): TextLinePresenter {
|
|
|
32
32
|
|
|
33
33
|
return {
|
|
34
34
|
...line,
|
|
35
|
+
anchors: [...new Set([...(line.anchors ?? []), item.anchor.value])],
|
|
35
36
|
presentation: {
|
|
36
37
|
...line.presentation,
|
|
37
38
|
prefix: `${item.anchor.value.padStart(anchorWidth)}|${line.presentation?.prefix ?? ""}`,
|
|
@@ -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,6 +29,84 @@ 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
112
|
registerMutationRenderers(
|
package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json
CHANGED
|
@@ -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": {
|
|
@@ -16,6 +16,7 @@ import { createDiffModel, type DiffModel, type DiffRow } from "./diff-model.js";
|
|
|
16
16
|
import { type DiffPanelResource, renderDiffPanel } from "./diff-renderer.js";
|
|
17
17
|
|
|
18
18
|
import type { MutationRenderResource } from "./render-resource.js";
|
|
19
|
+
import { summarizeStatuses } from "./status-summary.js";
|
|
19
20
|
|
|
20
21
|
type ToolBackground = "toolPendingBg" | "toolSuccessBg" | "toolErrorBg";
|
|
21
22
|
|
|
@@ -236,32 +237,48 @@ function renderTail(
|
|
|
236
237
|
width: number,
|
|
237
238
|
): string[] {
|
|
238
239
|
const counts = renderCounts(resources, theme);
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
:
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
240
|
+
const grouped = summarizeStatuses(
|
|
241
|
+
resources.map((resource) => ({
|
|
242
|
+
path: resource.path,
|
|
243
|
+
diffStatuses: [
|
|
244
|
+
...(resource.diffStatuses ?? []),
|
|
245
|
+
...(resource.model?.omittedChanges === undefined
|
|
246
|
+
? []
|
|
247
|
+
: [
|
|
248
|
+
{
|
|
249
|
+
text: resource.model.omittedChanges.unavailable
|
|
250
|
+
? "Local diff unavailable: alignment limit reached"
|
|
251
|
+
: [
|
|
252
|
+
...(resource.model.omittedChanges.outside > 0
|
|
253
|
+
? [
|
|
254
|
+
`${resource.model.omittedChanges.outside} changed rows outside this area`,
|
|
255
|
+
]
|
|
256
|
+
: []),
|
|
257
|
+
...(resource.model.omittedChanges.ambiguous > 0
|
|
258
|
+
? [`${resource.model.omittedChanges.ambiguous} changed rows unassigned`]
|
|
259
|
+
: []),
|
|
260
|
+
].join("; "),
|
|
261
|
+
tone: "warning" as const,
|
|
262
|
+
},
|
|
263
|
+
]),
|
|
264
|
+
],
|
|
265
|
+
})),
|
|
264
266
|
);
|
|
267
|
+
const statuses = grouped.statuses.map(({ status, paths }) => {
|
|
268
|
+
const label = resources.length > 1 ? `${paths.join(", ")}: ${status.text}` : status.text;
|
|
269
|
+
return theme.fg(status.tone ?? "muted", label.replace(/[\u0000-\u001f\u007f-\u009f]/g, " "));
|
|
270
|
+
});
|
|
271
|
+
if (grouped.formatted.length > 0) {
|
|
272
|
+
const by =
|
|
273
|
+
grouped.formatters.length === 1
|
|
274
|
+
? grouped.formatters[0]
|
|
275
|
+
: `${grouped.formatters.length} formatters`;
|
|
276
|
+
const label =
|
|
277
|
+
resources.length === 1
|
|
278
|
+
? `Formatted (${by})`
|
|
279
|
+
: `Formatted ${grouped.formatted.length} files by ${by}`;
|
|
280
|
+
statuses.unshift(theme.fg("success", label.replace(/[\u0000-\u001f\u007f-\u009f]/g, " ")));
|
|
281
|
+
}
|
|
265
282
|
const text = [counts, ...statuses]
|
|
266
283
|
.filter((item) => item !== undefined)
|
|
267
284
|
.join(theme.fg("dim", " · "));
|
package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts
CHANGED
|
@@ -702,6 +702,14 @@ function mutationCallDetails(
|
|
|
702
702
|
});
|
|
703
703
|
}
|
|
704
704
|
|
|
705
|
+
/** Render a written call header without preparing previews or reading files. */
|
|
706
|
+
export function renderWrittenMutationHeader(
|
|
707
|
+
registration: AnyTextMutationToolRegistration,
|
|
708
|
+
input: Readonly<Record<string, unknown>>,
|
|
709
|
+
theme: Theme,
|
|
710
|
+
): string {
|
|
711
|
+
return renderHeader(registration, input, undefined, theme, undefined, false);
|
|
712
|
+
}
|
|
705
713
|
function renderHeader(
|
|
706
714
|
registration: AnyTextMutationToolRegistration,
|
|
707
715
|
input: Readonly<Record<string, unknown>>,
|
|
@@ -770,18 +778,19 @@ function renderAnchorRange(
|
|
|
770
778
|
if (field === undefined) {
|
|
771
779
|
return undefined;
|
|
772
780
|
}
|
|
773
|
-
const state = anchorRenderPatch?.[field];
|
|
774
|
-
if (state?.kind === "resolved") {
|
|
775
|
-
return singleLine(expanded ? state.full : state.compact);
|
|
776
|
-
}
|
|
777
|
-
if (state?.kind === "failed") {
|
|
778
|
-
return "selected range";
|
|
779
|
-
}
|
|
780
781
|
const raw = stringValue(input[field]);
|
|
781
|
-
if (raw
|
|
782
|
-
|
|
782
|
+
if (raw !== undefined) {
|
|
783
|
+
const displayed = singleLine(raw);
|
|
784
|
+
const structured =
|
|
785
|
+
/^(?:\d+#[0-9A-F]+|CHANGE#[0-9A-F]+|SEARCH#|scope-(?:begin|end)-|begin$|end$)/.test(raw);
|
|
786
|
+
return expanded || structured || displayed.length <= 100
|
|
787
|
+
? displayed
|
|
788
|
+
: `${displayed.slice(0, 60)}…${displayed.slice(-30)} (${raw.length} chars)`;
|
|
783
789
|
}
|
|
784
|
-
|
|
790
|
+
const state = anchorRenderPatch?.[field];
|
|
791
|
+
return state?.kind === "resolved"
|
|
792
|
+
? singleLine(expanded ? state.full : state.compact)
|
|
793
|
+
: undefined;
|
|
785
794
|
};
|
|
786
795
|
return range(renderField(fields.at(0)), renderField(fields.at(1)), theme);
|
|
787
796
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { MutationDiffStatus } from "pi-agent-text-editor/api/mutation-result";
|
|
2
|
+
|
|
3
|
+
/** Aggregate successful formatting by unique file and tool; leave failures identifiable. */
|
|
4
|
+
export function summarizeStatuses(
|
|
5
|
+
resources: readonly {
|
|
6
|
+
readonly path: string;
|
|
7
|
+
readonly diffStatuses?: readonly MutationDiffStatus[];
|
|
8
|
+
}[],
|
|
9
|
+
) {
|
|
10
|
+
const formatted = new Set<string>();
|
|
11
|
+
const formatters = new Set<string>();
|
|
12
|
+
const remaining = new Map<string, { status: MutationDiffStatus; paths: Set<string> }>();
|
|
13
|
+
for (const resource of resources)
|
|
14
|
+
for (const status of resource.diffStatuses ?? []) {
|
|
15
|
+
if (status.formatter !== undefined && status.tone === "success") {
|
|
16
|
+
formatted.add(resource.path);
|
|
17
|
+
formatters.add(status.formatter);
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
const key = JSON.stringify([status.text, status.tone]);
|
|
21
|
+
let group = remaining.get(key);
|
|
22
|
+
if (!group) {
|
|
23
|
+
group = { status, paths: new Set() };
|
|
24
|
+
remaining.set(key, group);
|
|
25
|
+
}
|
|
26
|
+
group.paths.add(resource.path);
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
formatted: [...formatted],
|
|
30
|
+
formatters: [...formatters],
|
|
31
|
+
statuses: [...remaining.values()].map(({ status, paths }) => ({ status, paths: [...paths] })),
|
|
32
|
+
};
|
|
33
|
+
}
|
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.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-invariant": "0.
|
|
7
|
-
"pi-agent-read": "0.
|
|
8
|
-
"pi-agent-text-editor": "0.
|
|
6
|
+
"pi-agent-invariant": "0.3.0",
|
|
7
|
+
"pi-agent-read": "0.3.0",
|
|
8
|
+
"pi-agent-text-editor": "0.3.0"
|
|
9
9
|
},
|
|
10
10
|
"pi": {
|
|
11
11
|
"extensions": [
|
|
12
|
-
"./runtime/entry-
|
|
12
|
+
"./runtime/entry-72.js"
|
|
13
13
|
]
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
@@ -3,6 +3,8 @@ import type { TextDocument } from "pi-agent-text";
|
|
|
3
3
|
export type TextEditIntent = "edit" | "restore" | "mixed";
|
|
4
4
|
|
|
5
5
|
export interface TextEditCompletion {
|
|
6
|
+
/** Deferred writes remain observable; final updates reconcile formatting without another edit. */
|
|
7
|
+
readonly postProcessing?: "deferred" | "final" | "complete";
|
|
6
8
|
readonly source: string;
|
|
7
9
|
readonly resourceSource: string;
|
|
8
10
|
readonly resolvedBy: string;
|
|
@@ -5,10 +5,25 @@ import type { TextEditorToolId } from "#src/api/plugin-protocol.js";
|
|
|
5
5
|
|
|
6
6
|
export type TextEditPipelineStage = "text-pre-edit" | "text-edit" | "text-post-edit";
|
|
7
7
|
|
|
8
|
+
/** Host-plugin edit plan, checked against exact snapshots before any writes. */
|
|
9
|
+
export interface TextEditPlan {
|
|
10
|
+
readonly files: readonly {
|
|
11
|
+
readonly source: string;
|
|
12
|
+
readonly expectedContent: string;
|
|
13
|
+
readonly changes: readonly {
|
|
14
|
+
readonly from: number;
|
|
15
|
+
readonly to: number;
|
|
16
|
+
readonly insert: string;
|
|
17
|
+
}[];
|
|
18
|
+
}[];
|
|
19
|
+
}
|
|
8
20
|
export interface TextPreEditState<Input = unknown> {
|
|
9
21
|
readonly cwd: string;
|
|
10
22
|
readonly input: Input;
|
|
23
|
+
/** Optional native semantic edits supplied by the owning plugin, not by tool arguments. */
|
|
24
|
+
readonly editPlan?: TextEditPlan;
|
|
11
25
|
readonly signal?: AbortSignal;
|
|
26
|
+
/** A validated diffStatuses contribution is added to each completed file's presentation. */
|
|
12
27
|
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
13
28
|
}
|
|
14
29
|
|
|
@@ -16,6 +16,11 @@ export function rememberLastResolvedResource(pi: ExtensionAPI, details: unknown)
|
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
if (Array.isArray(details.resources)) {
|
|
20
|
+
for (const resource of details.resources) {
|
|
21
|
+
if (isRecord(resource)) rememberLastResolvedResource(pi, resource.details);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
19
24
|
const source = details.source;
|
|
20
25
|
const resolverId = details.resolvedBy;
|
|
21
26
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { AgentToolResult, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import type { TSchema } from "typebox";
|
|
1
3
|
import { isResourceResolver, type ResourceResolver } from "pi-agent-resource";
|
|
2
4
|
import {
|
|
3
5
|
isTextAnchorResolver,
|
|
@@ -26,9 +28,19 @@ import type {
|
|
|
26
28
|
} from "#src/api/mutation-tool.js";
|
|
27
29
|
import type { TextEditorToolRendererRegistration } from "#src/api/tool-renderer.js";
|
|
28
30
|
|
|
31
|
+
/** Shared index operations; Apply uses the same implementation and guards as standalone tools. */
|
|
32
|
+
export interface ScriptIndexOperation {
|
|
33
|
+
readonly name: "stage" | "unstage";
|
|
34
|
+
readonly parameters: TSchema;
|
|
35
|
+
execute(
|
|
36
|
+
input: unknown,
|
|
37
|
+
signal: AbortSignal,
|
|
38
|
+
context: ExtensionContext,
|
|
39
|
+
): Promise<AgentToolResult<unknown>>;
|
|
40
|
+
}
|
|
29
41
|
export const TEXT_EDITOR_PROTOCOL = "pi-agent-text-editor";
|
|
30
42
|
|
|
31
|
-
export const TEXT_EDITOR_API_VERSION =
|
|
43
|
+
export const TEXT_EDITOR_API_VERSION = 20;
|
|
32
44
|
|
|
33
45
|
export const TEXT_POSITION_ANCHOR_KIND = "pi-agent-text-editor/position";
|
|
34
46
|
|
|
@@ -89,6 +101,8 @@ export interface TextEditorPluginApi {
|
|
|
89
101
|
addMutationTool(registration: TextMutationToolRegistration): void;
|
|
90
102
|
addMutationGuard(registration: TextMutationGuardRegistration): void;
|
|
91
103
|
addToolRenderer(registration: TextEditorToolRendererRegistration): void;
|
|
104
|
+
/** Register an index operation for Apply without exposing unrelated Pi tools. */
|
|
105
|
+
addScriptIndexOperation(operation: ScriptIndexOperation): void;
|
|
92
106
|
onMutationTool(listener: TextMutationToolListener): () => void;
|
|
93
107
|
onDidEdit(listener: TextEditCompletionListener): () => void;
|
|
94
108
|
previewMutation(request: TextMutationPreviewRequest): Promise<TextMutationPreviewOutcome>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { hasDeferredPostEdit, afterPostEditScope } from "#src/core/post-edit-scope.js";
|
|
1
2
|
import { Type } from "typebox";
|
|
2
3
|
import { Value } from "typebox/value";
|
|
3
4
|
|
|
@@ -58,6 +59,7 @@ export function isFormattingContribution(
|
|
|
58
59
|
"changed",
|
|
59
60
|
"failed",
|
|
60
61
|
"not-reported",
|
|
62
|
+
"deferred",
|
|
61
63
|
].map((status) => Type.Literal(status)),
|
|
62
64
|
),
|
|
63
65
|
formatter: Type.Optional(Type.String()),
|
|
@@ -89,6 +91,7 @@ export function isDiffStatusContribution(value: unknown): value is TextPostEditS
|
|
|
89
91
|
diffStatuses: Type.Array(
|
|
90
92
|
Type.Object({
|
|
91
93
|
text: Type.String({ minLength: 1 }),
|
|
94
|
+
formatter: Type.Optional(Type.String()),
|
|
92
95
|
tone: Type.Optional(
|
|
93
96
|
Type.Union(["muted", "success", "warning", "error"].map((tone) => Type.Literal(tone))),
|
|
94
97
|
),
|