pi-agent-ide 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/README.md +79 -53
- package/assets/social-preview.png +0 -0
- package/dist/chunk-4KUFOHWP.js +2 -0
- package/dist/chunk-4LDOV7QS.js +28 -0
- package/dist/chunk-FA6BKC5Y.js +1 -0
- package/dist/{chunk-HSM6R7IB.js → chunk-I6Y3W4X6.js} +13 -13
- package/dist/chunk-MPT3R4BL.js +0 -0
- package/dist/chunk-PZFOOHY2.js +15 -0
- package/dist/{chunk-OYWIZII6.js → chunk-S6QRG3TQ.js} +1 -1
- package/dist/chunk-T7I2VX3J.js +1 -0
- package/dist/chunk-VCTK4JSN.js +3 -0
- package/dist/chunk-W7CASEO3.js +1 -0
- package/dist/chunk-YEQOQMU7.js +5 -0
- package/dist/chunk-YT42LKFV.js +16 -0
- package/dist/entry-10.js +1 -1
- package/dist/entry-11.js +1 -1
- package/dist/entry-12.js +1 -1
- package/dist/entry-13.js +1 -1
- package/dist/entry-14.js +1 -1
- package/dist/entry-15.js +1 -1
- package/dist/entry-16.js +1 -1
- package/dist/entry-17.js +1 -0
- package/dist/entry-19.js +1 -1
- package/dist/entry-20.js +1 -1
- package/dist/entry-21.js +1 -1
- package/dist/entry-22.js +1 -1
- package/dist/entry-23.js +1 -2
- package/dist/entry-24.js +1 -1
- package/dist/entry-25.js +2 -1
- package/dist/entry-26.js +1 -1
- package/dist/entry-27.js +2 -1
- package/dist/entry-28.js +1 -12
- package/dist/entry-29.js +1 -1
- package/dist/entry-30.js +1 -1
- package/dist/entry-31.js +12 -1
- package/dist/entry-32.js +1 -1
- package/dist/entry-33.js +1 -4
- package/dist/entry-34.js +1 -9
- package/dist/entry-35.js +1 -1
- package/dist/entry-36.js +4 -1
- package/dist/entry-37.js +9 -1
- package/dist/entry-38.js +1 -1
- package/dist/entry-39.js +1 -1
- package/dist/entry-40.js +1 -1
- package/dist/entry-41.js +1 -1
- package/dist/entry-42.js +1 -18
- package/dist/entry-43.js +1 -1
- package/dist/entry-44.js +1 -1
- package/dist/entry-45.js +17 -1
- package/dist/entry-46.js +1 -1
- package/dist/entry-47.js +1 -7
- package/dist/entry-48.js +1 -11
- package/dist/entry-49.js +1 -1
- package/dist/entry-50.js +6 -1
- package/dist/entry-51.js +11 -1
- package/dist/entry-52.js +1 -1
- package/dist/entry-53.js +1 -1
- package/dist/entry-54.js +1 -1
- package/dist/entry-55.js +1 -1
- package/dist/entry-56.js +1 -1
- package/dist/entry-57.js +1 -0
- package/dist/entry-58.js +1 -1
- package/dist/entry-59.js +1 -0
- package/dist/entry-60.js +0 -1
- package/dist/entry-61.js +1 -1
- package/dist/entry-62.js +0 -1
- package/dist/entry-63.js +1 -1
- package/dist/entry-64.js +1 -1
- package/dist/entry-65.js +1 -1
- package/dist/entry-66.js +1 -0
- package/dist/entry-67.js +1 -1
- package/dist/entry-68.js +1 -0
- package/dist/entry-69.js +0 -1
- package/dist/entry-70.js +1 -1
- package/dist/entry-71.js +0 -1
- package/dist/entry-72.js +1 -259
- package/dist/entry-73.js +1 -30
- package/dist/entry-74.js +1 -2
- package/dist/entry-75.js +315 -1
- package/dist/entry-76.js +30 -1
- package/dist/entry-77.js +2 -3
- package/dist/entry-78.js +1 -3
- package/dist/entry-79.js +1 -1
- package/dist/entry-80.js +3 -1
- package/dist/entry-81.js +3 -1
- package/dist/entry-82.js +1 -0
- package/dist/entry-83.js +1 -0
- package/dist/entry-84.js +1 -0
- package/dist/entry-9.js +1 -1
- package/dist/pi-agent-ide.js +3 -3
- package/docs/agent-guides/apply.md +333 -0
- package/docs/agent-guides/debugger.md +5 -0
- package/docs/agent-guides/diagnostics.md +5 -0
- package/docs/agent-guides/editing.md +44 -0
- package/docs/agent-guides/git-changes.md +5 -0
- package/docs/agent-guides/json-reading.md +41 -0
- package/docs/agent-guides/read-resources.md +44 -0
- package/docs/agent-guides/search-code.md +29 -0
- package/docs/agent-guides/terminal.md +7 -0
- package/docs/agent-guides/vision.md +5 -0
- package/docs/configuration.md +6 -14
- package/docs/research/apply-read-latency.md +219 -0
- package/node_modules/pi-agent-doctor/package.json +6 -6
- package/node_modules/pi-agent-doctor/runtime/entry-23.js +1 -0
- package/node_modules/pi-agent-documentation/package.json +15 -0
- package/node_modules/pi-agent-documentation/runtime/entry-24.js +1 -0
- package/node_modules/pi-agent-documentation/src/index.ts +69 -0
- package/node_modules/pi-agent-filesystem/index.ts +0 -4
- package/node_modules/pi-agent-filesystem/package.json +7 -7
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- package/node_modules/pi-agent-filesystem-jq/index.ts +134 -0
- package/node_modules/pi-agent-filesystem-jq/package.json +23 -0
- package/node_modules/pi-agent-filesystem-jq/runtime/entry-27.js +2 -0
- package/node_modules/pi-agent-filesystem-jq/src/jq.ts +107 -0
- package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/runtime/entry-29.js +2 -0
- package/node_modules/pi-agent-ide-ast/package.json +11 -11
- package/node_modules/pi-agent-ide-ast/runtime/entry-30.js +1 -0
- package/node_modules/pi-agent-ide-changes/index.ts +8 -0
- package/node_modules/pi-agent-ide-changes/package.json +9 -8
- package/node_modules/pi-agent-ide-changes/runtime/entry-32.js +1 -0
- package/node_modules/pi-agent-ide-formatter/package.json +4 -4
- package/node_modules/pi-agent-ide-formatter/src/formatter.ts +1 -1
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-languages/runtime/entry-35.js +2 -0
- package/node_modules/pi-agent-ide-lint/index.ts +1 -1
- package/node_modules/pi-agent-ide-lint/package.json +8 -8
- package/node_modules/pi-agent-ide-lint/runtime/entry-36.js +2 -0
- package/node_modules/pi-agent-ide-lint/src/command-linter.ts +17 -1
- package/node_modules/pi-agent-ide-lsp/index.ts +0 -3
- package/node_modules/pi-agent-ide-lsp/package.json +10 -10
- package/node_modules/pi-agent-ide-lsp/runtime/entry-37.js +2 -0
- package/node_modules/pi-agent-image/package.json +3 -3
- package/node_modules/pi-agent-invariant/package.json +2 -2
- package/node_modules/pi-agent-pdf/package.json +3 -3
- package/node_modules/pi-agent-read/package.json +12 -11
- package/node_modules/pi-agent-read/runtime/entry-42.js +0 -1
- package/node_modules/pi-agent-read/runtime/entry-45.js +2 -0
- package/node_modules/pi-agent-read/src/api/read-parameters.ts +2 -2
- package/node_modules/pi-agent-read/src/core/extension.ts +16 -2
- package/node_modules/pi-agent-read/src/core/read-core.ts +4 -5
- package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +62 -8
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +19 -12
- package/node_modules/pi-agent-resource/package.json +2 -2
- package/node_modules/pi-agent-search/package.json +8 -7
- package/node_modules/pi-agent-search/runtime/entry-47.js +0 -1
- package/node_modules/pi-agent-search/runtime/entry-48.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-50.js +2 -0
- package/node_modules/pi-agent-search/src/core/extension.ts +29 -10
- package/node_modules/pi-agent-search-text/package.json +9 -9
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text/runtime/entry-53.js +1 -0
- package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-54.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/package.json +5 -5
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-55.js +1 -0
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-56.js +2 -0
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-58.js +2 -0
- package/node_modules/pi-agent-text-editor/index.ts +15 -0
- package/node_modules/pi-agent-text-editor/package.json +26 -25
- package/node_modules/pi-agent-text-editor/runtime/entry-72.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-73.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-74.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-75.js +2 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/execution.ts +24 -18
- package/node_modules/pi-agent-text-editor/src/core/apply/output.ts +4 -2
- package/node_modules/pi-agent-text-editor/src/core/apply/prompt.ts +5 -44
- package/node_modules/pi-agent-text-editor/src/core/apply/renderer.ts +13 -5
- package/node_modules/pi-agent-text-editor/src/core/apply/runtime.ts +124 -26
- package/node_modules/pi-agent-text-editor/src/core/apply/tool.ts +2 -6
- package/node_modules/pi-agent-text-editor/src/core/apply/transaction.ts +186 -1
- package/node_modules/pi-agent-text-editor/src/core/builtin-edit-filter.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +0 -11
- package/node_modules/pi-agent-text-editor/src/core/text-editor-config.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +0 -2
- package/node_modules/pi-agent-text-editor-renderer/index.ts +17 -4
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-76.js +2 -0
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +23 -11
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +21 -16
- 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-78.js +1 -0
- package/node_modules/pi-agent-tool-ui/package.json +2 -2
- package/node_modules/pi-agent-tool-ui/runtime/entry-79.js +1 -0
- package/node_modules/pi-agent-web/package.json +7 -7
- 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-image/runtime/entry-82.js +2 -0
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/runtime/entry-83.js +2 -0
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-84.js +2 -0
- package/package.json +108 -44
- package/src/api/documentation.ts +2 -0
- package/src/composite/builtin-extensions.ts +7 -0
- package/src/composite/extensions-config.ts +6 -0
- package/src/composite/module-labels.ts +5 -0
- package/src/composite/module-settings-store.ts +3 -0
- package/src/composite/module-settings.ts +39 -5
- package/src/composite/preferences.ts +37 -0
- package/src/composite/presentation.ts +14 -0
- package/src/composite/presets.ts +57 -0
- package/src/documentation/extension.ts +295 -0
- package/src/documentation/registry.ts +98 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +0 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/index.ts +134 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +23 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-27.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/src/jq.ts +107 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-28.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-29.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-25.js +2 -0
- 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-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-82.js +2 -0
- 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-pdf/runtime/entry-83.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-84.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-80.js +2 -0
- package/src/extensions/pi-agent-read/package.json +12 -11
- package/src/extensions/pi-agent-read/runtime/entry-42.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-43.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-45.js +2 -0
- package/src/extensions/pi-agent-read/src/api/read-parameters.ts +2 -2
- package/src/extensions/pi-agent-read/src/core/extension.ts +16 -2
- package/src/extensions/pi-agent-read/src/core/read-core.ts +4 -5
- package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +62 -8
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +19 -12
- package/src/extensions/pi-agent-search/package.json +8 -7
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +9 -9
- package/src/extensions/pi-agent-search/runtime/entry-47.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-48.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-49.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-50.js +2 -0
- package/src/extensions/pi-agent-search/src/core/extension.ts +29 -10
- package/src/extensions/pi-agent-text-editor/index.ts +15 -0
- package/src/extensions/pi-agent-text-editor/package.json +26 -25
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-54.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-55.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-56.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-57.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-58.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +17 -4
- 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/runtime/entry-76.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +23 -11
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +21 -16
- 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-72.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-73.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-74.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-75.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/execution.ts +24 -18
- package/src/extensions/pi-agent-text-editor/src/core/apply/output.ts +4 -2
- package/src/extensions/pi-agent-text-editor/src/core/apply/prompt.ts +5 -44
- package/src/extensions/pi-agent-text-editor/src/core/apply/renderer.ts +13 -5
- package/src/extensions/pi-agent-text-editor/src/core/apply/runtime.ts +124 -26
- package/src/extensions/pi-agent-text-editor/src/core/apply/tool.ts +2 -6
- package/src/extensions/pi-agent-text-editor/src/core/apply/transaction.ts +186 -1
- package/src/extensions/pi-agent-text-editor/src/core/builtin-edit-filter.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +0 -11
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-config.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +0 -2
- package/src/pi-agent-ide.ts +7 -10
- package/src/plugins/pi-agent-ide-ast/package.json +11 -11
- package/src/plugins/pi-agent-ide-ast/runtime/entry-30.js +1 -0
- package/src/plugins/pi-agent-ide-changes/index.ts +8 -0
- package/src/plugins/pi-agent-ide-changes/package.json +9 -8
- package/src/plugins/pi-agent-ide-changes/runtime/entry-32.js +1 -0
- package/src/plugins/pi-agent-ide-debugger/index.ts +12 -4
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +9 -4
- package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
- package/src/plugins/pi-agent-ide-formatter/src/formatter.ts +1 -1
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-languages/runtime/entry-35.js +2 -0
- package/src/plugins/pi-agent-ide-lint/index.ts +1 -1
- package/src/plugins/pi-agent-ide-lint/package.json +8 -8
- package/src/plugins/pi-agent-ide-lint/runtime/entry-36.js +2 -0
- package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +17 -1
- package/src/plugins/pi-agent-ide-lsp/index.ts +0 -3
- package/src/plugins/pi-agent-ide-lsp/package.json +10 -10
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-37.js +2 -0
- package/src/plugins/pi-agent-ide-terminal/index.ts +27 -2
- package/src/plugins/pi-agent-ide-terminal/src/renderer.ts +27 -2
- package/src/plugins/pi-agent-ide-terminal/src/resources.ts +1 -4
- package/src/plugins/pi-agent-ide-terminal/src/search.ts +0 -3
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +7 -4
- package/src/plugins/pi-agent-ide-vision/index.ts +8 -6
- package/dist/chunk-22CLOM2D.js +0 -1
- package/dist/chunk-3XJ3KDPZ.js +0 -16
- package/dist/chunk-526E364R.js +0 -3
- package/dist/chunk-DDKHZZDO.js +0 -5
- package/dist/chunk-EJ5OACQM.js +0 -1
- package/dist/chunk-PCZH7GOX.js +0 -26
- package/dist/chunk-SQ7ZTGOP.js +0 -2
- package/dist/entry-18.js +0 -1
- package/node_modules/pi-agent-doctor/runtime/entry-18.js +0 -1
- package/node_modules/pi-agent-filesystem/runtime/entry-23.js +0 -2
- package/node_modules/pi-agent-filesystem-image/runtime/entry-24.js +0 -2
- package/node_modules/pi-agent-ide-ast/runtime/entry-27.js +0 -1
- package/node_modules/pi-agent-ide-changes/runtime/entry-29.js +0 -1
- package/node_modules/pi-agent-ide-changes/runtime/entry-30.js +0 -2
- package/node_modules/pi-agent-ide-languages/runtime/entry-32.js +0 -2
- package/node_modules/pi-agent-image/runtime/entry-35.js +0 -1
- package/node_modules/pi-agent-invariant/runtime/entry-36.js +0 -1
- package/node_modules/pi-agent-pdf/runtime/entry-37.js +0 -1
- package/node_modules/pi-agent-search/runtime/entry-45.js +0 -1
- package/node_modules/pi-agent-search-text/runtime/entry-48.js +0 -2
- package/node_modules/pi-agent-text/runtime/entry-50.js +0 -1
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-53.js +0 -2
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-54.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-55.js +0 -2
- package/node_modules/pi-agent-text-editor/runtime/entry-56.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-58.js +0 -1
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-73.js +0 -2
- package/node_modules/pi-agent-text-editor-renderer/src/config.ts +0 -73
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-74.js +0 -2
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-75.js +0 -1
- package/node_modules/pi-agent-tool-ui/runtime/entry-76.js +0 -1
- package/node_modules/pi-agent-web-html/runtime/entry-78.js +0 -2
- package/node_modules/pi-agent-web-image/runtime/entry-79.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-24.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-25.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-23.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-78.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-79.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-80.js +0 -2
- package/src/extensions/pi-agent-read/runtime/entry-38.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-39.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-40.js +0 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-48.js +0 -2
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-49.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-45.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-46.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-53.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-54.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-55.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-73.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/config.ts +0 -73
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-74.js +0 -2
- package/src/extensions/pi-agent-text-editor/runtime/entry-56.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-57.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-58.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-27.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-28.js +0 -2
- package/src/plugins/pi-agent-ide-changes/runtime/entry-29.js +0 -1
- package/src/plugins/pi-agent-ide-changes/runtime/entry-30.js +0 -2
- package/src/plugins/pi-agent-ide-languages/runtime/entry-32.js +0 -2
- /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem}/runtime/entry-25.js +0 -0
- /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-image}/runtime/entry-26.js +0 -0
- /package/node_modules/{pi-agent-ide-ast → pi-agent-filesystem-pdf}/runtime/entry-28.js +0 -0
- /package/node_modules/{pi-agent-ide-formatter → pi-agent-ide-ast}/runtime/entry-31.js +0 -0
- /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-changes}/runtime/entry-33.js +0 -0
- /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-formatter}/runtime/entry-34.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-image}/runtime/entry-38.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-invariant}/runtime/entry-39.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-40.js +0 -0
- /package/node_modules/{pi-agent-resource → pi-agent-read}/runtime/entry-43.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-read}/runtime/entry-44.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-46.js +0 -0
- /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-49.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-constant → pi-agent-search-text}/runtime/entry-51.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-exact → pi-agent-search-text}/runtime/entry-52.js +0 -0
- /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-line-hash}/runtime/entry-57.js +0 -0
- /package/node_modules/{pi-agent-web → pi-agent-text-editor-stale-anchor}/runtime/entry-77.js +0 -0
- /package/node_modules/{pi-agent-web-pdf → pi-agent-web}/runtime/entry-80.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web-html}/runtime/entry-81.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-image}/runtime/entry-26.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-html}/runtime/entry-81.js +0 -0
- /package/src/extensions/{pi-agent-search → pi-agent-read}/runtime/entry-44.js +0 -0
- /package/src/extensions/{pi-agent-text-editor/plugins/pi-agent-text-anchor-constant → pi-agent-search/plugins/pi-agent-search-text}/runtime/entry-51.js +0 -0
- /package/src/extensions/{pi-agent-text-editor/plugins/pi-agent-text-anchor-exact → pi-agent-search/plugins/pi-agent-search-text}/runtime/entry-52.js +0 -0
- /package/src/extensions/{pi-agent-read/extensions/pi-agent-web → pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor}/runtime/entry-77.js +0 -0
- /package/src/plugins/{pi-agent-ide-formatter → pi-agent-ide-ast}/runtime/entry-31.js +0 -0
- /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-changes}/runtime/entry-33.js +0 -0
- /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-formatter}/runtime/entry-34.js +0 -0
|
@@ -111,9 +111,44 @@ export async function executeEditorTransaction(
|
|
|
111
111
|
const files: ScriptMutationFile[] = [];
|
|
112
112
|
const operations: ApplyOperationOutcome[] = [];
|
|
113
113
|
const cwd = context.cwd;
|
|
114
|
+
const batchedReplacements = new Set<number>();
|
|
114
115
|
|
|
115
116
|
for (const [index, operation] of request.operations.entries()) {
|
|
116
117
|
const resources = operationResources(operation, snapshots, cwd);
|
|
118
|
+
if (batchedReplacements.has(index)) continue;
|
|
119
|
+
if (operation.kind === "replace") {
|
|
120
|
+
const replacements: Array<{ index: number; operation: TextOperation }> = [];
|
|
121
|
+
for (
|
|
122
|
+
let candidateIndex = index;
|
|
123
|
+
candidateIndex < request.operations.length;
|
|
124
|
+
candidateIndex += 1
|
|
125
|
+
) {
|
|
126
|
+
const candidate = request.operations[candidateIndex];
|
|
127
|
+
if (
|
|
128
|
+
candidate?.kind !== "replace" ||
|
|
129
|
+
candidate.selection.document !== operation.selection.document
|
|
130
|
+
)
|
|
131
|
+
break;
|
|
132
|
+
replacements.push({ index: candidateIndex, operation: candidate });
|
|
133
|
+
}
|
|
134
|
+
if (replacements.length > 1) {
|
|
135
|
+
for (const replacement of replacements) batchedReplacements.add(replacement.index);
|
|
136
|
+
const outcome = await executeReplacementBatch(
|
|
137
|
+
replacements,
|
|
138
|
+
snapshots,
|
|
139
|
+
accepted,
|
|
140
|
+
editor,
|
|
141
|
+
cwd,
|
|
142
|
+
signal,
|
|
143
|
+
options,
|
|
144
|
+
);
|
|
145
|
+
for (const state of outcome.saved)
|
|
146
|
+
if (!journal.has(state.path)) journal.set(state.path, state);
|
|
147
|
+
files.push(...outcome.files);
|
|
148
|
+
operations.push(...outcome.operations);
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
117
152
|
if (operation.kind === "warning") {
|
|
118
153
|
operations.push({
|
|
119
154
|
index,
|
|
@@ -209,6 +244,141 @@ export async function executeEditorTransaction(
|
|
|
209
244
|
};
|
|
210
245
|
}
|
|
211
246
|
|
|
247
|
+
async function executeReplacementBatch(
|
|
248
|
+
replacements: readonly { readonly index: number; readonly operation: TextOperation }[],
|
|
249
|
+
snapshots: ReadonlyMap<string, EditorSnapshot>,
|
|
250
|
+
accepted: Map<string, TextChange[]>,
|
|
251
|
+
editor: TransactionEditor,
|
|
252
|
+
cwd: string,
|
|
253
|
+
signal: AbortSignal,
|
|
254
|
+
options: TransactionExecutionOptions,
|
|
255
|
+
): Promise<{
|
|
256
|
+
readonly saved: readonly SavedPath[];
|
|
257
|
+
readonly files: readonly ScriptMutationFile[];
|
|
258
|
+
readonly operations: readonly ApplyOperationOutcome[];
|
|
259
|
+
}> {
|
|
260
|
+
const first = requiredValue(replacements[0]);
|
|
261
|
+
const snapshot = snapshots.get(first.operation.selection.document);
|
|
262
|
+
const resources = operationResources(first.operation, snapshots, cwd);
|
|
263
|
+
if (snapshot === undefined)
|
|
264
|
+
return {
|
|
265
|
+
saved: [],
|
|
266
|
+
files: [],
|
|
267
|
+
operations: replacements.map(({ index, operation }) =>
|
|
268
|
+
failed(
|
|
269
|
+
index,
|
|
270
|
+
operation,
|
|
271
|
+
resources,
|
|
272
|
+
invalid("Selection belongs to an unknown editor snapshot"),
|
|
273
|
+
),
|
|
274
|
+
),
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
const prior = accepted.get(snapshot.source) ?? [];
|
|
278
|
+
const additions: TextChange[] = [];
|
|
279
|
+
const operationResults = new Map<number, ApplyOperationOutcome>();
|
|
280
|
+
for (const { index, operation } of replacements) {
|
|
281
|
+
try {
|
|
282
|
+
validateSelection(operation, snapshot);
|
|
283
|
+
if (
|
|
284
|
+
prior.some((change) => overlaps(change, operation.selection)) ||
|
|
285
|
+
additions.some((change) => overlaps(change, operation.selection))
|
|
286
|
+
)
|
|
287
|
+
throw invalid(`Overlapping selection in ${snapshot.source}`);
|
|
288
|
+
additions.push({
|
|
289
|
+
from: operation.selection.from,
|
|
290
|
+
to: operation.selection.to,
|
|
291
|
+
insert: preserveLineEnding(operation.selection, operation.text),
|
|
292
|
+
});
|
|
293
|
+
} catch (error) {
|
|
294
|
+
operationResults.set(index, failed(index, operation, resources, error));
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
if (additions.length === 0)
|
|
298
|
+
return {
|
|
299
|
+
saved: [],
|
|
300
|
+
files: [],
|
|
301
|
+
operations: replacements.map(({ index }) => requiredValue(operationResults.get(index))),
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
const before = applyTextChanges(snapshot.content, prior).content;
|
|
305
|
+
let current: string;
|
|
306
|
+
try {
|
|
307
|
+
current = await readFile(snapshot.source, "utf8");
|
|
308
|
+
if (current !== before) throw stale(snapshot.source);
|
|
309
|
+
} catch (error) {
|
|
310
|
+
for (const { index, operation } of replacements)
|
|
311
|
+
if (!operationResults.has(index))
|
|
312
|
+
operationResults.set(index, failed(index, operation, resources, error));
|
|
313
|
+
return {
|
|
314
|
+
saved: [],
|
|
315
|
+
files: [],
|
|
316
|
+
operations: replacements.map(({ index }) => requiredValue(operationResults.get(index))),
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
const saved = [await savePath(snapshot.source)];
|
|
321
|
+
const combined = [...prior, ...additions];
|
|
322
|
+
const applied = applyTextChanges(snapshot.content, combined);
|
|
323
|
+
try {
|
|
324
|
+
await editOne(editor, snapshot.source, before, applied.content, cwd, signal, false);
|
|
325
|
+
accepted.set(snapshot.source, combined);
|
|
326
|
+
for (const { index, operation } of replacements)
|
|
327
|
+
if (!operationResults.has(index))
|
|
328
|
+
operationResults.set(index, {
|
|
329
|
+
index,
|
|
330
|
+
kind: operation.kind,
|
|
331
|
+
status: "applied",
|
|
332
|
+
effect: "applied",
|
|
333
|
+
resources,
|
|
334
|
+
});
|
|
335
|
+
return {
|
|
336
|
+
saved,
|
|
337
|
+
files: [
|
|
338
|
+
{
|
|
339
|
+
source: snapshot.source,
|
|
340
|
+
before,
|
|
341
|
+
after: applied.content,
|
|
342
|
+
action: "edited",
|
|
343
|
+
changes: applied.changes.map((change, editIndex) => ({
|
|
344
|
+
editIndex,
|
|
345
|
+
fromA: change.fromBefore,
|
|
346
|
+
toA: change.toBefore,
|
|
347
|
+
fromB: change.fromAfter,
|
|
348
|
+
toB: change.toAfter,
|
|
349
|
+
removedText: change.removedText,
|
|
350
|
+
insertedText: change.insertedText,
|
|
351
|
+
})),
|
|
352
|
+
formatting: { status: "not-reported" },
|
|
353
|
+
},
|
|
354
|
+
],
|
|
355
|
+
operations: replacements.map(({ index }) => requiredValue(operationResults.get(index))),
|
|
356
|
+
};
|
|
357
|
+
} catch (error) {
|
|
358
|
+
const rollbackErrors = await rollback(saved, options.restorePath);
|
|
359
|
+
for (const { index, operation } of replacements)
|
|
360
|
+
if (!operationResults.has(index))
|
|
361
|
+
operationResults.set(
|
|
362
|
+
index,
|
|
363
|
+
rollbackErrors.length === 0
|
|
364
|
+
? failed(index, operation, resources, error)
|
|
365
|
+
: {
|
|
366
|
+
index,
|
|
367
|
+
kind: operation.kind,
|
|
368
|
+
status: "unknown",
|
|
369
|
+
effect: "unknown",
|
|
370
|
+
resources,
|
|
371
|
+
error: codedError(error, rollbackErrors),
|
|
372
|
+
},
|
|
373
|
+
);
|
|
374
|
+
return {
|
|
375
|
+
saved: rollbackErrors.length === 0 ? [] : saved,
|
|
376
|
+
files: [],
|
|
377
|
+
operations: replacements.map(({ index }) => requiredValue(operationResults.get(index))),
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
212
382
|
async function validateOperation(
|
|
213
383
|
operation: Operation,
|
|
214
384
|
snapshots: ReadonlyMap<string, EditorSnapshot>,
|
|
@@ -370,6 +540,16 @@ function preserveLineEnding(selection: Selection, insert: string): string {
|
|
|
370
540
|
function rangesOverlap(left: Selection, right: Selection): boolean {
|
|
371
541
|
return left.from < right.to && right.from < left.to;
|
|
372
542
|
}
|
|
543
|
+
function transferInsert(snapshot: EditorSnapshot, destination: Selection, text: string): string {
|
|
544
|
+
if (destination.from !== destination.to || destination.linewise !== true || text.length === 0)
|
|
545
|
+
return text;
|
|
546
|
+
const separator = snapshot.content.includes("\r\n") ? "\r\n" : "\n";
|
|
547
|
+
const before = snapshot.content.slice(0, destination.from);
|
|
548
|
+
const after = snapshot.content.slice(destination.to);
|
|
549
|
+
const prefix = before.length > 0 && !/(?:\r\n|\r|\n)$/u.test(before) ? separator : "";
|
|
550
|
+
const suffix = after.length > 0 && !/(?:\r\n|\r|\n)$/u.test(text) ? separator : "";
|
|
551
|
+
return prefix + text + suffix;
|
|
552
|
+
}
|
|
373
553
|
async function executeTextTransfer(
|
|
374
554
|
operation: TextTransferOperation,
|
|
375
555
|
snapshots: ReadonlyMap<string, EditorSnapshot>,
|
|
@@ -382,7 +562,11 @@ async function executeTextTransfer(
|
|
|
382
562
|
for (const destination of operation.destinations) {
|
|
383
563
|
const snapshot = requiredValue(snapshots.get(destination.document));
|
|
384
564
|
const changes = additions.get(snapshot.source) ?? [];
|
|
385
|
-
changes.push({
|
|
565
|
+
changes.push({
|
|
566
|
+
from: destination.from,
|
|
567
|
+
to: destination.to,
|
|
568
|
+
insert: transferInsert(snapshot, destination, operation.text),
|
|
569
|
+
});
|
|
386
570
|
additions.set(snapshot.source, changes);
|
|
387
571
|
}
|
|
388
572
|
if (operation.kind === "text-move")
|
|
@@ -649,6 +833,7 @@ function selections(value: unknown, label: string): Selection[] {
|
|
|
649
833
|
from: integer(item.from, "selection from"),
|
|
650
834
|
to: integer(item.to, "selection to"),
|
|
651
835
|
text: text(item.text, "selection text"),
|
|
836
|
+
...(item.linewise === true && { linewise: true }),
|
|
652
837
|
};
|
|
653
838
|
});
|
|
654
839
|
}
|
|
@@ -32,7 +32,7 @@ export function registerBuiltinEditFilter(pi: ExtensionAPI): void {
|
|
|
32
32
|
"Use the smallest useful source view: reuse sufficient content and anchors, search for known text, or inspect structure when locating a declaration. Read nearby context when boundaries are unclear; resolve ambiguity rather than guessing.",
|
|
33
33
|
"Use an available anchor when it selects exactly the intended text; otherwise use minimal unique exact text. Keep the edit limited to the intended content.",
|
|
34
34
|
"When search broadens to separate words, treat its results as location hints. Refine the query before using those matches for replacement.",
|
|
35
|
-
"
|
|
35
|
+
"Use standalone mutation tools in one assistant-response batch when each change is known in advance and does not depend on another change. This is the default for several independent edits in one file or across files. Every call is evaluated against the original file snapshots. Combine overlapping changes into one mutation. Use Apply only when edits require computation, conditions, selection composition, checkpoints, or one coherent cross-file transaction. Check each batch result and retry only unapplied changes.",
|
|
36
36
|
],
|
|
37
37
|
parameters: Type.Object({}, { additionalProperties: false }),
|
|
38
38
|
execute() {
|
|
@@ -155,9 +155,9 @@ export function registerDiff(
|
|
|
155
155
|
name: "diff",
|
|
156
156
|
label: "Diff",
|
|
157
157
|
parameters: diffParameters,
|
|
158
|
-
promptSnippet: "Compare two text-readable sources
|
|
158
|
+
promptSnippet: "Compare two text-readable sources",
|
|
159
159
|
description:
|
|
160
|
-
"Use diff to compare two sources
|
|
160
|
+
"Use diff to compare two sources. before and after accept a source string or a read request {path, offset?, limit?, views?}. Use any source that read can resolve as text. Omit limit to compare complete resolved text; read presentation limits do not clip comparison inputs. Multiple resolved resources are joined with one newline separator in resolver order. Diff line numbers are relative to each selected text, not the original file when a window is selected. Native non-text content is rejected. Output uses the existing text diff and a shared output budget; oversized output has a full temporary reference. The same diff function is available inside Apply.",
|
|
161
161
|
renderCall(_args, theme) {
|
|
162
162
|
return new Text(theme.fg("toolTitle", theme.bold("Diff")), 0, 0);
|
|
163
163
|
},
|
|
@@ -55,17 +55,6 @@ export default async function registerTextEditorCore(
|
|
|
55
55
|
editor,
|
|
56
56
|
registration,
|
|
57
57
|
interceptionRendering,
|
|
58
|
-
() =>
|
|
59
|
-
[
|
|
60
|
-
(registration.anchors?.length ?? 0) > 0
|
|
61
|
-
? editor.renderGeneralPromptGuideline(
|
|
62
|
-
new Set(registration.anchors?.flatMap((anchor) => anchor.kinds)),
|
|
63
|
-
)
|
|
64
|
-
: undefined,
|
|
65
|
-
editor.renderToolPromptGuideline(registration.name),
|
|
66
|
-
]
|
|
67
|
-
.filter((guideline): guideline is string => guideline !== undefined)
|
|
68
|
-
.join("\n\n") || undefined,
|
|
69
58
|
() => getLastResolvedResource(pi)?.source,
|
|
70
59
|
),
|
|
71
60
|
);
|
|
@@ -26,7 +26,7 @@ export function loadTextEditorConfig(cwd: string): LoadedTextEditorConfig {
|
|
|
26
26
|
throw new Error(`Invalid text editor config at ${file}`, { cause: error });
|
|
27
27
|
}
|
|
28
28
|
const root = record(value, "text editor config");
|
|
29
|
-
assertKeys(root, ["recovery"
|
|
29
|
+
assertKeys(root, ["recovery"], "text editor config");
|
|
30
30
|
if (root.recovery === undefined) {
|
|
31
31
|
return { contextLines: 15, timeoutMs: 2000, sections: {} };
|
|
32
32
|
}
|
|
@@ -81,7 +81,6 @@ export function createTextTool<TParameters extends TSchema>(
|
|
|
81
81
|
core: TextEditorCore,
|
|
82
82
|
definition: TextMutationToolRegistration<TParameters>,
|
|
83
83
|
annotations: ToolCallInterceptionRenderStore,
|
|
84
|
-
pluginPromptGuideline: () => string | undefined,
|
|
85
84
|
getLastResolvedSource: () => string | undefined,
|
|
86
85
|
): ToolDefinition<TParameters, FileMutationBatchResult> {
|
|
87
86
|
const renderer = core.getToolRenderer(definition.name);
|
|
@@ -178,7 +177,6 @@ export function createTextTool<TParameters extends TSchema>(
|
|
|
178
177
|
? `When ${definition.source.field} is omitted, the tool can reuse the file identified by the supplied anchor, the last read, or the preceding edit in the same batch.`
|
|
179
178
|
: `When ${definition.source.field} is omitted, the tool can reuse the file identified by a supplied text anchor.`
|
|
180
179
|
: "",
|
|
181
|
-
pluginPromptGuideline() ?? "",
|
|
182
180
|
]
|
|
183
181
|
.filter(Boolean)
|
|
184
182
|
.join("\n");
|
package/src/pi-agent-ide.ts
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
resolvePiAgentIdeExtensionsConfigPaths,
|
|
5
5
|
} from "#src/composite/extensions-config.js";
|
|
6
6
|
import { AGENT_IDE_PREFERENCES } from "#src/composite/preferences.js";
|
|
7
|
+
import { disabledByPreset } from "#src/composite/presets.js";
|
|
7
8
|
import { selectBuiltinExtensions } from "#src/composite/selection.js";
|
|
8
9
|
import { registerModuleSettings } from "#src/composite/module-settings.js";
|
|
9
10
|
import { createFeatureFlags } from "#src/composite/feature-flags.js";
|
|
@@ -63,15 +64,6 @@ export default async function registerUnifiedPiAgentIde(pi: ExtensionAPI): Promi
|
|
|
63
64
|
description: "Hide the Apply tool. Standalone read, search and editing tools remain available.",
|
|
64
65
|
default: false,
|
|
65
66
|
});
|
|
66
|
-
flags.register({
|
|
67
|
-
id: "pi-agent-ide-apply-code",
|
|
68
|
-
name: "Apply presentation",
|
|
69
|
-
description:
|
|
70
|
-
"Mixed compacts written tool calls during streaming. Code shows the full script. Expanded always exposes the source.",
|
|
71
|
-
group: "ui",
|
|
72
|
-
labels: { on: "Code", off: "Mixed" },
|
|
73
|
-
default: false,
|
|
74
|
-
});
|
|
75
67
|
flags.register({
|
|
76
68
|
id: "pi-agent-ide-no-diagnostic-buffer",
|
|
77
69
|
name: "Immediate diagnostic notices",
|
|
@@ -81,7 +73,12 @@ export default async function registerUnifiedPiAgentIde(pi: ExtensionAPI): Promi
|
|
|
81
73
|
default: false,
|
|
82
74
|
});
|
|
83
75
|
registerModuleSettings(pi, flags.definitions, AGENT_IDE_PREFERENCES);
|
|
84
|
-
const
|
|
76
|
+
const presetDisabled = disabledByPreset(BUILTIN_EXTENSIONS, config.preset ?? "full");
|
|
77
|
+
const { enabled } = selectBuiltinExtensions(
|
|
78
|
+
BUILTIN_EXTENSIONS,
|
|
79
|
+
[...presetDisabled, ...config.disabled],
|
|
80
|
+
config.enabled,
|
|
81
|
+
);
|
|
85
82
|
for (const extension of enabled) {
|
|
86
83
|
await extension.register(pi, { preferences: config.preferences ?? {} });
|
|
87
84
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-ast",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./api/scope": {
|
|
10
10
|
"types": "./src/api/scope.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-30.js"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"@tree-sitter-grammars/tree-sitter-toml": "^0.7.0",
|
|
32
32
|
"@tree-sitter-grammars/tree-sitter-yaml": "^0.7.1",
|
|
33
33
|
"cross-spawn": "^7.0.6",
|
|
34
|
-
"pi-agent-doctor": "0.6.
|
|
35
|
-
"pi-agent-invariant": "0.6.
|
|
36
|
-
"pi-agent-read": "0.6.
|
|
37
|
-
"pi-agent-resource": "0.6.
|
|
38
|
-
"pi-agent-search": "0.6.
|
|
39
|
-
"pi-agent-text": "0.6.
|
|
40
|
-
"pi-agent-text-editor": "0.6.
|
|
34
|
+
"pi-agent-doctor": "0.6.1",
|
|
35
|
+
"pi-agent-invariant": "0.6.1",
|
|
36
|
+
"pi-agent-read": "0.6.1",
|
|
37
|
+
"pi-agent-resource": "0.6.1",
|
|
38
|
+
"pi-agent-search": "0.6.1",
|
|
39
|
+
"pi-agent-text": "0.6.1",
|
|
40
|
+
"pi-agent-text-editor": "0.6.1",
|
|
41
41
|
"tree-sitter-cpp": "^0.23.4",
|
|
42
42
|
"tree-sitter-javascript": "^0.25.0",
|
|
43
43
|
"tree-sitter-json": "^0.24.8",
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
},
|
|
49
49
|
"pi": {
|
|
50
50
|
"extensions": [
|
|
51
|
-
"./runtime/entry-
|
|
51
|
+
"./runtime/entry-31.js"
|
|
52
52
|
]
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@earendil-works/pi-coding-agent": "*",
|
|
56
|
-
"pi-agent-ide": "0.6.
|
|
56
|
+
"pi-agent-ide": "0.6.1"
|
|
57
57
|
},
|
|
58
58
|
"peerDependenciesMeta": {
|
|
59
59
|
"pi-agent-ide": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../../dist/entry-30.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Value } from "typebox/value";
|
|
2
2
|
import { type ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
3
|
+
import { connectAgentDocumentation, loadPackagedAgentGuide } from "pi-agent-documentation";
|
|
3
4
|
import { connectDoctorPlugin } from "pi-agent-doctor/api/connect-plugin";
|
|
4
5
|
import { connectReadPlugin } from "pi-agent-read/api/connect-plugin";
|
|
5
6
|
import {
|
|
@@ -28,6 +29,13 @@ import {
|
|
|
28
29
|
import { createUndoMutationTool } from "#src/tool-text-undo.js";
|
|
29
30
|
|
|
30
31
|
export default async function registerGitChanges(pi: ExtensionAPI): Promise<void> {
|
|
32
|
+
connectAgentDocumentation(pi, [
|
|
33
|
+
await loadPackagedAgentGuide({
|
|
34
|
+
id: "git-changes",
|
|
35
|
+
description: "Git change anchors, staging, and safe undo",
|
|
36
|
+
triggers: ["stage", "unstage", "undo"].map((tool) => ({ tool })),
|
|
37
|
+
}),
|
|
38
|
+
]);
|
|
31
39
|
const executor = extensionGitExecutor(pi);
|
|
32
40
|
const transactions = new LastTextTransactionStore();
|
|
33
41
|
const indexQueue = new IndexMutationQueue();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-changes",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,20 +8,21 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./changes/change-groups": {
|
|
10
10
|
"types": "./src/changes/change-groups.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-32.js"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"diff": "^9.0.0",
|
|
16
|
-
"pi-agent-doctor": "0.6.
|
|
17
|
-
"pi-agent-
|
|
18
|
-
"pi-agent-
|
|
19
|
-
"pi-agent-
|
|
20
|
-
"pi-agent-text
|
|
16
|
+
"pi-agent-doctor": "0.6.1",
|
|
17
|
+
"pi-agent-documentation": "0.6.1",
|
|
18
|
+
"pi-agent-invariant": "0.6.1",
|
|
19
|
+
"pi-agent-read": "0.6.1",
|
|
20
|
+
"pi-agent-text": "0.6.1",
|
|
21
|
+
"pi-agent-text-editor": "0.6.1"
|
|
21
22
|
},
|
|
22
23
|
"pi": {
|
|
23
24
|
"extensions": [
|
|
24
|
-
"./runtime/entry-
|
|
25
|
+
"./runtime/entry-33.js"
|
|
25
26
|
]
|
|
26
27
|
},
|
|
27
28
|
"peerDependencies": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../../dist/entry-32.js";
|
|
@@ -3,6 +3,7 @@ import { access } from "node:fs/promises";
|
|
|
3
3
|
|
|
4
4
|
import { StringEnum } from "@earendil-works/pi-ai";
|
|
5
5
|
import { defineTool, type ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
6
|
+
import { connectAgentDocumentation, loadPackagedAgentGuide } from "pi-agent-documentation";
|
|
6
7
|
import { Type } from "typebox";
|
|
7
8
|
import { connectDoctorPlugin } from "pi-agent-doctor/api/connect-plugin";
|
|
8
9
|
import { connectReadPlugin } from "pi-agent-read/api/connect-plugin";
|
|
@@ -125,6 +126,16 @@ const debugParameters = Type.Object(
|
|
|
125
126
|
|
|
126
127
|
/** Register agent-native debug sessions backed by Debug Adapter Protocol adapters. */
|
|
127
128
|
export default async function registerDebugger(pi: ExtensionAPI): Promise<void> {
|
|
129
|
+
connectAgentDocumentation(pi, [
|
|
130
|
+
await loadPackagedAgentGuide({
|
|
131
|
+
id: "debugger",
|
|
132
|
+
description: "Debugger sessions, breakpoints, stepping, and cleanup",
|
|
133
|
+
triggers: [
|
|
134
|
+
{ tool: "debug" },
|
|
135
|
+
...["read", "insert", "delete"].map((tool) => ({ tool, resourcePrefixes: ["debug:"] })),
|
|
136
|
+
],
|
|
137
|
+
}),
|
|
138
|
+
]);
|
|
128
139
|
const manager =
|
|
129
140
|
(takeReloadResource("debugger") as DebugSessionManager | undefined) ??
|
|
130
141
|
new DebugSessionManager();
|
|
@@ -175,10 +186,7 @@ export default async function registerDebugger(pi: ExtensionAPI): Promise<void>
|
|
|
175
186
|
});
|
|
176
187
|
api.addView({ view: "breakpoints", presenter: breakpointPresenter });
|
|
177
188
|
api.describe(
|
|
178
|
-
'views: ["breakpoints"] —
|
|
179
|
-
);
|
|
180
|
-
api.addPromptGuideline(
|
|
181
|
-
'Use views: ["breakpoints"] when current breakpoint locations matter. Create a debug session with debug. Read the returned debug source to get current anchors, insert text "breakpoint" at one source anchor, then insert "start" on the session. Use read for the latest stop and delete for a breakpoint or the session.',
|
|
189
|
+
'views: ["breakpoints"] — current debugger breakpoints beside source lines. Normal files include every current session; debug sources are session-scoped. debug:<session> — debugger state.',
|
|
182
190
|
);
|
|
183
191
|
},
|
|
184
192
|
} satisfies ReadPlugin;
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
import { createReadResultRenderer } from "pi-agent-read/api/rendering";
|
|
27
27
|
|
|
28
28
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
29
|
+
import { connectAgentDocumentation, loadPackagedAgentGuide } from "pi-agent-documentation";
|
|
29
30
|
import type { ResourceResolutionAttempt, ResourceResolver } from "pi-agent-resource";
|
|
30
31
|
import type { TextDocument, TextLinePresenter } from "pi-agent-text";
|
|
31
32
|
import type { ReadRequest, ReadResultDetails } from "pi-agent-read/api/tools/read";
|
|
@@ -36,6 +37,13 @@ const renderReadResult = createReadResultRenderer({ kind: "code-view", label: "D
|
|
|
36
37
|
type ReadDiagnostics = IdePluginApi["readDiagnostics"];
|
|
37
38
|
|
|
38
39
|
export default async function registerDiagnostics(pi: ExtensionAPI): Promise<void> {
|
|
40
|
+
connectAgentDocumentation(pi, [
|
|
41
|
+
await loadPackagedAgentGuide({
|
|
42
|
+
id: "diagnostics",
|
|
43
|
+
description: "Diagnostic resources, readiness, and verification",
|
|
44
|
+
triggers: [{ tool: "read", resourcePrefixes: ["diagnostics:"] }],
|
|
45
|
+
}),
|
|
46
|
+
]);
|
|
39
47
|
let readDiagnostics: ReadDiagnostics | undefined;
|
|
40
48
|
const collect: CollectDiagnostics = (filePath, cwd, options) => {
|
|
41
49
|
if (readDiagnostics === undefined) {
|
|
@@ -128,10 +136,7 @@ export default async function registerDiagnostics(pi: ExtensionAPI): Promise<voi
|
|
|
128
136
|
},
|
|
129
137
|
});
|
|
130
138
|
api.describe(
|
|
131
|
-
'diagnostics:<path> — lint and language-server diagnostics. views: ["diagnostics"] — diagnostics alongside source text.
|
|
132
|
-
);
|
|
133
|
-
api.addPromptGuideline(
|
|
134
|
-
"Use read with `diagnostics:<path>` or the `diagnostics` view for per-file diagnostics instead of running equivalent checks through Bash. Project builds and tests remain separate verification.",
|
|
139
|
+
'diagnostics:<path> — lint and language-server diagnostics. views: ["diagnostics"] — diagnostics alongside source text. Results identify their reporting tool and readiness; pending results and snapshots are not completed checks.',
|
|
135
140
|
);
|
|
136
141
|
},
|
|
137
142
|
} satisfies ReadPlugin;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-formatter",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-doctor": "0.6.
|
|
6
|
+
"pi-agent-doctor": "0.6.1"
|
|
7
7
|
},
|
|
8
8
|
"pi": {
|
|
9
9
|
"extensions": [
|
|
10
|
-
"./runtime/entry-
|
|
10
|
+
"./runtime/entry-34.js"
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"@earendil-works/pi-coding-agent": "*",
|
|
15
|
-
"pi-agent-ide": "0.6.
|
|
15
|
+
"pi-agent-ide": "0.6.1"
|
|
16
16
|
},
|
|
17
17
|
"peerDependenciesMeta": {
|
|
18
18
|
"pi-agent-ide": {
|
|
@@ -62,7 +62,7 @@ async function loadRegistry(cwd: string, external = false): Promise<FormatterCom
|
|
|
62
62
|
if (registry === undefined) {
|
|
63
63
|
registry = FormatterCommandRegistry.fromDirectory(cwd, {
|
|
64
64
|
includeGlobal: !external,
|
|
65
|
-
requireBuiltInEvidence:
|
|
65
|
+
requireBuiltInEvidence: true,
|
|
66
66
|
});
|
|
67
67
|
registries.set(key, registry);
|
|
68
68
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-languages",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-doctor": "0.6.
|
|
6
|
+
"pi-agent-doctor": "0.6.1"
|
|
7
7
|
},
|
|
8
8
|
"pi": {
|
|
9
9
|
"extensions": [
|
|
10
|
-
"./runtime/entry-
|
|
10
|
+
"./runtime/entry-35.js"
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
@@ -105,6 +105,6 @@ async function loadRegistry(cwd: string, external: boolean): Promise<LintCommand
|
|
|
105
105
|
const configDirectory = external ? cwd : (process.env.PI_AGENT_IDE_CONFIG_DIR ?? cwd);
|
|
106
106
|
return LintCommandRegistry.fromDirectory(configDirectory, {
|
|
107
107
|
includeGlobal: !external,
|
|
108
|
-
requireBuiltInEvidence:
|
|
108
|
+
requireBuiltInEvidence: true,
|
|
109
109
|
});
|
|
110
110
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-lint",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-doctor": "0.6.
|
|
7
|
-
"pi-agent-invariant": "0.6.
|
|
8
|
-
"pi-agent-read": "0.6.
|
|
9
|
-
"pi-agent-resource": "0.6.
|
|
10
|
-
"pi-agent-text": "0.6.
|
|
6
|
+
"pi-agent-doctor": "0.6.1",
|
|
7
|
+
"pi-agent-invariant": "0.6.1",
|
|
8
|
+
"pi-agent-read": "0.6.1",
|
|
9
|
+
"pi-agent-resource": "0.6.1",
|
|
10
|
+
"pi-agent-text": "0.6.1"
|
|
11
11
|
},
|
|
12
12
|
"pi": {
|
|
13
13
|
"extensions": [
|
|
14
|
-
"./runtime/entry-
|
|
14
|
+
"./runtime/entry-36.js"
|
|
15
15
|
]
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"@earendil-works/pi-coding-agent": "*",
|
|
19
|
-
"pi-agent-ide": "0.6.
|
|
19
|
+
"pi-agent-ide": "0.6.1"
|
|
20
20
|
},
|
|
21
21
|
"peerDependenciesMeta": {
|
|
22
22
|
"pi-agent-ide": {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import os from "node:os";
|
|
2
3
|
import { fileURLToPath } from "node:url";
|
|
3
4
|
|
|
4
5
|
import { sameFilePath } from "pi-agent-ide/api/path-identity";
|
|
@@ -31,7 +32,22 @@ export async function runConfiguredLinter(
|
|
|
31
32
|
let result: ProcessResult;
|
|
32
33
|
|
|
33
34
|
try {
|
|
34
|
-
|
|
35
|
+
const executable = path.basename(config.check.command[0] ?? "").toLocaleLowerCase();
|
|
36
|
+
const isRuff = executable === "ruff" || executable === "ruff.exe";
|
|
37
|
+
const inheritedEnvironment = context.env ?? process.env;
|
|
38
|
+
result = await runConfiguredProcess(config.check, {
|
|
39
|
+
...context,
|
|
40
|
+
...(isRuff
|
|
41
|
+
? {
|
|
42
|
+
env: {
|
|
43
|
+
...inheritedEnvironment,
|
|
44
|
+
RUFF_CACHE_DIR:
|
|
45
|
+
inheritedEnvironment.RUFF_CACHE_DIR ??
|
|
46
|
+
path.join(os.tmpdir(), "pi-agent-ide", "ruff-cache"),
|
|
47
|
+
},
|
|
48
|
+
}
|
|
49
|
+
: {}),
|
|
50
|
+
});
|
|
35
51
|
} catch (error) {
|
|
36
52
|
return {
|
|
37
53
|
ok: false,
|