pi-agent-ide 0.2.2 → 0.4.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 +46 -0
- package/README.md +13 -8
- package/dist/chunk-3SE372WC.js +3 -0
- package/dist/chunk-5MSNYFDE.js +1 -0
- package/dist/chunk-5VSE5X5R.js +2 -0
- package/dist/chunk-6DZA4CLO.js +4 -0
- package/dist/chunk-6EYWFBNG.js +0 -0
- package/dist/{chunk-ORAPGW7W.js → chunk-72EEL2DW.js} +1 -1
- package/dist/chunk-7JYQMAEL.js +14 -0
- 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-DQF5QMJ2.js +1 -0
- package/dist/chunk-EJ5OACQM.js +1 -0
- package/dist/chunk-GFW5QPQV.js +2 -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-J34VKQGJ.js +1 -0
- package/dist/chunk-KAB3AYA2.js +1 -0
- 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-ROXXK6TW.js +0 -0
- package/dist/{chunk-WNMGUALD.js → chunk-TI5GMJ7Q.js} +1 -1
- package/dist/{chunk-4ZTEPMJO.js → chunk-TPIHQYK2.js} +1 -1
- package/dist/chunk-XSTHESNR.js +25 -0
- package/dist/{chunk-THSCUT2L.js → chunk-Y7ZMR4LT.js} +1 -1
- 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 +17 -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 +64 -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-resource/src/resource.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/api/tool-renderer.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 +212 -51
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +273 -11
- 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 +20 -12
- 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 +41 -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 +10 -15
- package/src/composite/extensions-config.ts +59 -0
- package/src/composite/feature-flags.ts +32 -0
- package/src/composite/module-labels.ts +59 -0
- package/src/composite/module-settings-store.ts +60 -0
- package/src/composite/module-settings.ts +162 -0
- package/src/composite/preferences.ts +26 -0
- package/src/composite/selection.ts +4 -4
- package/src/composite/settings-panel.ts +103 -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 +64 -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 +20 -12
- 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/api/tool-renderer.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 +212 -51
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +273 -11
- 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 +43 -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/plugins/pi-agent-ide-terminal/index.ts +34 -0
- package/src/plugins/pi-agent-ide-terminal/src/renderer.ts +238 -0
- package/src/plugins/pi-agent-ide-terminal/src/resources.ts +461 -0
- package/src/plugins/pi-agent-ide-terminal/src/screen-image.ts +127 -0
- package/src/plugins/pi-agent-ide-terminal/src/search.ts +159 -0
- package/src/plugins/pi-agent-ide-terminal/src/session-manager.ts +529 -0
- package/src/plugins/pi-agent-ide-terminal/src/shell-profile.ts +56 -0
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +157 -0
- package/src/plugins/pi-agent-ide-terminal/src/types.ts +66 -0
- package/src/plugins/pi-agent-ide-terminal/src/ui.ts +336 -0
- 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-VCCMVQXU.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,365 +0,0 @@
|
|
|
1
|
-
import { requiredValue } from "pi-agent-invariant";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
|
|
4
|
-
import { connectTextEditorPlugin } from "pi-agent-text-editor/api/connect-plugin";
|
|
5
|
-
import {
|
|
6
|
-
TEXT_EDITOR_API_VERSION,
|
|
7
|
-
TEXT_EDITOR_PROTOCOL,
|
|
8
|
-
type TextEditorPlugin,
|
|
9
|
-
type TextEditorPluginApi,
|
|
10
|
-
} from "pi-agent-text-editor/api/plugin-protocol";
|
|
11
|
-
import {
|
|
12
|
-
type InterceptResult,
|
|
13
|
-
registerToolCallInterceptor,
|
|
14
|
-
type ToolCallInterceptorHandler,
|
|
15
|
-
} from "pi-agent-text-editor/api/tool-call-interceptor";
|
|
16
|
-
|
|
17
|
-
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
18
|
-
import type {
|
|
19
|
-
TextMutationGuardRegistration,
|
|
20
|
-
TextMutationGuardRejection,
|
|
21
|
-
TextMutationPlan,
|
|
22
|
-
} from "pi-agent-text-editor/api/mutation-guard";
|
|
23
|
-
import type { TextMutationPreviewResource } from "pi-agent-text-editor/api/mutation-preview";
|
|
24
|
-
import type { TextMutationToolRegistration } from "pi-agent-text-editor/api/mutation-tool";
|
|
25
|
-
|
|
26
|
-
interface OverwriteCandidate {
|
|
27
|
-
readonly source: string;
|
|
28
|
-
readonly afterContent: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
type FinalOverwriteDecision =
|
|
32
|
-
| { readonly kind: "accepted" }
|
|
33
|
-
| { readonly kind: "rejected"; readonly rejection: TextMutationGuardRejection };
|
|
34
|
-
type OverwriteDecision = FinalOverwriteDecision | { readonly kind: "deferred" };
|
|
35
|
-
|
|
36
|
-
class OverwriteAttempts {
|
|
37
|
-
private readonly pending = new Set<string>();
|
|
38
|
-
private readonly pendingBySource = new Map<string, Set<string>>();
|
|
39
|
-
private readonly approvedForExecution = new Set<string>();
|
|
40
|
-
private readonly pendingEarly = new Set<string>();
|
|
41
|
-
private readonly approvedEarlyForExecution = new Set<string>();
|
|
42
|
-
|
|
43
|
-
inspectEarly(candidates: readonly OverwriteCandidate[]): OverwriteDecision {
|
|
44
|
-
const key = sourceAttemptKey(candidates);
|
|
45
|
-
|
|
46
|
-
if (this.pendingEarly.delete(key)) {
|
|
47
|
-
this.approvedEarlyForExecution.add(key);
|
|
48
|
-
return { kind: "accepted" };
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if ((this.pendingBySource.get(key)?.size ?? 0) > 0) {
|
|
52
|
-
return { kind: "deferred" };
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
this.pendingEarly.add(key);
|
|
56
|
-
return rejected();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
inspectStream(candidates: readonly OverwriteCandidate[]): FinalOverwriteDecision {
|
|
60
|
-
const earlyKey = sourceAttemptKey(candidates);
|
|
61
|
-
|
|
62
|
-
if (this.pendingEarly.delete(earlyKey)) {
|
|
63
|
-
this.approvedEarlyForExecution.add(earlyKey);
|
|
64
|
-
return { kind: "accepted" };
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const key = attemptKey(candidates);
|
|
68
|
-
|
|
69
|
-
if (this.pending.delete(key)) {
|
|
70
|
-
this.forgetPending(earlyKey, key);
|
|
71
|
-
this.approvedForExecution.add(key);
|
|
72
|
-
return { kind: "accepted" };
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
this.rememberPending(earlyKey, key);
|
|
76
|
-
return rejected();
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
inspectExecution(candidates: readonly OverwriteCandidate[]): FinalOverwriteDecision {
|
|
80
|
-
const earlyKey = sourceAttemptKey(candidates);
|
|
81
|
-
|
|
82
|
-
if (this.approvedEarlyForExecution.delete(earlyKey)) {
|
|
83
|
-
return { kind: "accepted" };
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const key = attemptKey(candidates);
|
|
87
|
-
|
|
88
|
-
if (this.approvedForExecution.delete(key)) {
|
|
89
|
-
return { kind: "accepted" };
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if (this.pending.delete(key)) {
|
|
93
|
-
this.forgetPending(earlyKey, key);
|
|
94
|
-
return { kind: "accepted" };
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
this.rememberPending(earlyKey, key);
|
|
98
|
-
return rejected();
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
private rememberPending(sourceKey: string, key: string): void {
|
|
102
|
-
this.pending.add(key);
|
|
103
|
-
const keys = this.pendingBySource.get(sourceKey) ?? new Set<string>();
|
|
104
|
-
keys.add(key);
|
|
105
|
-
this.pendingBySource.set(sourceKey, keys);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
private forgetPending(sourceKey: string, key: string): void {
|
|
109
|
-
const keys = this.pendingBySource.get(sourceKey);
|
|
110
|
-
|
|
111
|
-
if (keys === undefined) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
keys.delete(key);
|
|
116
|
-
|
|
117
|
-
if (keys.size === 0) {
|
|
118
|
-
this.pendingBySource.delete(sourceKey);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export default function registerTextEditorOverwriteGuard(pi: ExtensionAPI): void | Promise<void> {
|
|
124
|
-
const attempts = new OverwriteAttempts();
|
|
125
|
-
const plugin = {
|
|
126
|
-
protocol: TEXT_EDITOR_PROTOCOL,
|
|
127
|
-
apiVersion: TEXT_EDITOR_API_VERSION,
|
|
128
|
-
id: "text-editor-overwrite",
|
|
129
|
-
setup(api) {
|
|
130
|
-
api.addMutationGuard(createGuard(attempts));
|
|
131
|
-
const dynamic = createStreamingGuard(pi, api, attempts);
|
|
132
|
-
registerToolCallInterceptor(pi, dynamic.handler);
|
|
133
|
-
api.onMutationTool(dynamic.add);
|
|
134
|
-
},
|
|
135
|
-
} satisfies TextEditorPlugin;
|
|
136
|
-
|
|
137
|
-
return connectTextEditorPlugin(pi, plugin);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export function createOverwriteGuard(): TextMutationGuardRegistration {
|
|
141
|
-
return createGuard(new OverwriteAttempts());
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
function createGuard(attempts: OverwriteAttempts): TextMutationGuardRegistration {
|
|
145
|
-
return {
|
|
146
|
-
id: "overwrite",
|
|
147
|
-
guard(plan, context) {
|
|
148
|
-
if (context.intent === "restore") {
|
|
149
|
-
return { kind: "accepted" };
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
const candidates = planCandidates(plan, context.cwd);
|
|
153
|
-
return candidates.length === 0 ? { kind: "accepted" } : attempts.inspectExecution(candidates);
|
|
154
|
-
},
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function createStreamingGuard(
|
|
159
|
-
pi: ExtensionAPI,
|
|
160
|
-
api: TextEditorPluginApi,
|
|
161
|
-
attempts: OverwriteAttempts,
|
|
162
|
-
): {
|
|
163
|
-
readonly handler: ToolCallInterceptorHandler;
|
|
164
|
-
readonly add: (registration: TextMutationToolRegistration) => void;
|
|
165
|
-
} {
|
|
166
|
-
const registrations = new Map<string, TextMutationToolRegistration>();
|
|
167
|
-
const acceptedContentIndices = new Set<number>();
|
|
168
|
-
const toolNames: string[] = [];
|
|
169
|
-
const handler: ToolCallInterceptorHandler = {
|
|
170
|
-
name: "text-editor-overwrite-inspection",
|
|
171
|
-
blockExecution: true,
|
|
172
|
-
toolNames,
|
|
173
|
-
async intercept(context) {
|
|
174
|
-
if (context.contentIndex !== undefined && acceptedContentIndices.has(context.contentIndex)) {
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
const registration = registrations.get(context.toolCall.name);
|
|
179
|
-
|
|
180
|
-
if (registration === undefined) {
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
const isEarly = context.partialArgs !== undefined;
|
|
185
|
-
const input = isEarly
|
|
186
|
-
? preparePreviewArguments(registration, requiredValue(context.partialArgs))
|
|
187
|
-
: context.args;
|
|
188
|
-
const preview = await api.previewMutation({
|
|
189
|
-
tool: context.toolCall.name,
|
|
190
|
-
input,
|
|
191
|
-
cwd: context.cwd,
|
|
192
|
-
...(context.signal !== undefined && { signal: context.signal }),
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
if (preview.kind === "failed") {
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
const candidates = previewCandidates(
|
|
200
|
-
preview.resources,
|
|
201
|
-
context.toolCall.name,
|
|
202
|
-
isEarly,
|
|
203
|
-
context.cwd,
|
|
204
|
-
);
|
|
205
|
-
|
|
206
|
-
if (candidates.length === 0) {
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
const decision = isEarly
|
|
211
|
-
? attempts.inspectEarly(candidates)
|
|
212
|
-
: attempts.inspectStream(candidates);
|
|
213
|
-
|
|
214
|
-
if (decision.kind === "rejected") {
|
|
215
|
-
return interceptResult(decision.rejection);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
if (decision.kind === "accepted" && isEarly && context.contentIndex !== undefined) {
|
|
219
|
-
acceptedContentIndices.add(context.contentIndex);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
return;
|
|
223
|
-
},
|
|
224
|
-
onContentEnd(contentIndex) {
|
|
225
|
-
acceptedContentIndices.delete(contentIndex);
|
|
226
|
-
},
|
|
227
|
-
onAbort(contentIndex) {
|
|
228
|
-
acceptedContentIndices.delete(contentIndex);
|
|
229
|
-
},
|
|
230
|
-
onAgentEnd() {
|
|
231
|
-
acceptedContentIndices.clear();
|
|
232
|
-
},
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
return {
|
|
236
|
-
handler,
|
|
237
|
-
add(registration): void {
|
|
238
|
-
if (registration.intent === "restore") {
|
|
239
|
-
return;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
registrations.set(registration.name, registration);
|
|
243
|
-
toolNames.push(registration.name);
|
|
244
|
-
registerToolCallInterceptor(pi, handler);
|
|
245
|
-
},
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
function planCandidates(plan: TextMutationPlan, cwd: string): OverwriteCandidate[] {
|
|
250
|
-
return plan.resources
|
|
251
|
-
.filter(
|
|
252
|
-
(resource) =>
|
|
253
|
-
resource.existed &&
|
|
254
|
-
resource.after.content !== resource.before.content &&
|
|
255
|
-
resource.changes.some(
|
|
256
|
-
({ fromBefore, toBefore }) =>
|
|
257
|
-
fromBefore === 0 && toBefore === resource.before.content.length,
|
|
258
|
-
),
|
|
259
|
-
)
|
|
260
|
-
.map((resource) => ({
|
|
261
|
-
source: canonicalSource(resource.source, cwd),
|
|
262
|
-
afterContent: resource.after.content,
|
|
263
|
-
}));
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
function preparePreviewArguments(
|
|
267
|
-
registration: TextMutationToolRegistration,
|
|
268
|
-
arguments_: Readonly<Record<string, unknown>>,
|
|
269
|
-
): Record<string, unknown> {
|
|
270
|
-
const prepared = { ...arguments_ };
|
|
271
|
-
const schema = registration.parameters as {
|
|
272
|
-
readonly required?: unknown;
|
|
273
|
-
readonly properties?: Readonly<Record<string, { readonly type?: unknown }>>;
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
if (!Array.isArray(schema.required)) {
|
|
277
|
-
return prepared;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
for (const field of schema.required) {
|
|
281
|
-
if (
|
|
282
|
-
typeof field === "string" &&
|
|
283
|
-
!(field in prepared) &&
|
|
284
|
-
schema.properties?.[field]?.type === "string"
|
|
285
|
-
) {
|
|
286
|
-
prepared[field] = "";
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
return prepared;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
function previewCandidates(
|
|
294
|
-
resources: readonly TextMutationPreviewResource[],
|
|
295
|
-
toolName: string,
|
|
296
|
-
early: boolean,
|
|
297
|
-
cwd: string,
|
|
298
|
-
): OverwriteCandidate[] {
|
|
299
|
-
const isWritePathIsEnough = early && toolName === "write";
|
|
300
|
-
return resources
|
|
301
|
-
.filter(
|
|
302
|
-
(resource) =>
|
|
303
|
-
resource.existed === true &&
|
|
304
|
-
(isWritePathIsEnough ||
|
|
305
|
-
(resource.afterContent !== resource.beforeContent &&
|
|
306
|
-
resource.beforeRanges?.some(
|
|
307
|
-
({ from, to }) => from === 0 && to === resource.beforeContent.length,
|
|
308
|
-
) === true)),
|
|
309
|
-
)
|
|
310
|
-
.map((resource) => ({
|
|
311
|
-
source: canonicalSource(resource.path, cwd),
|
|
312
|
-
afterContent: resource.afterContent,
|
|
313
|
-
}));
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
function canonicalSource(source: string, cwd: string): string {
|
|
317
|
-
return /^[A-Za-z][A-Za-z\d+.-]*:/u.test(source) || path.isAbsolute(source)
|
|
318
|
-
? source
|
|
319
|
-
: path.resolve(cwd, source);
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
function attemptKey(resources: readonly OverwriteCandidate[]): string {
|
|
323
|
-
return [...resources]
|
|
324
|
-
.sort((left, right) => left.source.localeCompare(right.source))
|
|
325
|
-
.map(({ source, afterContent }) => `${source}\u{0}${afterContent}`)
|
|
326
|
-
.join("\u{1}");
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
function sourceAttemptKey(resources: readonly OverwriteCandidate[]): string {
|
|
330
|
-
return [...resources]
|
|
331
|
-
.map(({ source }) => source)
|
|
332
|
-
.sort((left, right) => left.localeCompare(right))
|
|
333
|
-
.join("\u{1}");
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
function rejected(): FinalOverwriteDecision {
|
|
337
|
-
const message =
|
|
338
|
-
"The file already exists — a full rewrite may be unnecessary. " +
|
|
339
|
-
"Overwriting is error-prone, token-cost ineffective and simply stupid. " +
|
|
340
|
-
"Think again and prefer precise text editing operations. " +
|
|
341
|
-
"If the task genuinely requires overwriting this file, state why and repeat the same operation.";
|
|
342
|
-
|
|
343
|
-
return {
|
|
344
|
-
kind: "rejected",
|
|
345
|
-
rejection: {
|
|
346
|
-
code: "MUTATION_REJECTED",
|
|
347
|
-
reason: message,
|
|
348
|
-
message,
|
|
349
|
-
annotation: { kind: "overwrite-blocked" },
|
|
350
|
-
effect: "not-applied",
|
|
351
|
-
},
|
|
352
|
-
};
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
function interceptResult(rejection: TextMutationGuardRejection): InterceptResult {
|
|
356
|
-
return {
|
|
357
|
-
annotation: { kind: "custom", label: "Overwrite Blocked", color: "warning" },
|
|
358
|
-
message: {
|
|
359
|
-
customType: "text-editor-overwrite-block",
|
|
360
|
-
content: `Reason: ${rejection.reason}`,
|
|
361
|
-
display: false,
|
|
362
|
-
details: rejection,
|
|
363
|
-
},
|
|
364
|
-
};
|
|
365
|
-
}
|
package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/package.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "pi-agent-text-editor-overwrite",
|
|
3
|
-
"version": "0.2.2",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"dependencies": {
|
|
6
|
-
"pi-agent-invariant": "0.2.2",
|
|
7
|
-
"pi-agent-text-editor": "0.2.2"
|
|
8
|
-
},
|
|
9
|
-
"pi": {
|
|
10
|
-
"extensions": [
|
|
11
|
-
"./runtime/entry-71.js"
|
|
12
|
-
]
|
|
13
|
-
},
|
|
14
|
-
"peerDependencies": {
|
|
15
|
-
"@earendil-works/pi-coding-agent": "*"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { TSchema } from "typebox";
|
|
2
|
-
|
|
3
|
-
export function appendSchemaFieldOrder(description: string, schema: TSchema): string {
|
|
4
|
-
const properties = (schema as { readonly properties?: unknown }).properties;
|
|
5
|
-
|
|
6
|
-
if (properties === null || typeof properties !== "object" || Array.isArray(properties)) {
|
|
7
|
-
return description;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const fields = Object.keys(properties);
|
|
11
|
-
return fields.length === 0
|
|
12
|
-
? description
|
|
13
|
-
: `${description}\nArgument order: ${fields.map((field) => `\`${field}\``).join(", ")}.`;
|
|
14
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/node_modules/{pi-agent-tool-call-interception → pi-agent-tool-ui}/runtime/entry-74.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|