pi-agent-ide 0.6.3 → 0.6.4
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 +59 -0
- package/README.md +8 -1
- package/dist/chunk-2P2OGO3G.js +2 -0
- package/dist/{chunk-5QQABP47.js → chunk-3BBJZSMS.js} +1 -1
- package/dist/chunk-5J43L2RL.js +11 -0
- package/dist/{chunk-ITSNK5YG.js → chunk-7AVXUV4A.js} +2 -2
- package/dist/chunk-BAYETTZZ.js +16 -0
- package/dist/{chunk-VCTK4JSN.js → chunk-BSICWXMH.js} +1 -1
- package/dist/chunk-BVK5A7ED.js +28 -0
- package/dist/{chunk-ZM4L5AGN.js → chunk-EDURPQAV.js} +3 -2
- package/dist/{chunk-L7JMDDSD.js → chunk-FBOW7XOV.js} +1 -1
- package/dist/{chunk-25CZ5ZIU.js → chunk-FUG2TEKI.js} +1 -1
- package/dist/chunk-FZBCKIJJ.js +1 -0
- package/dist/chunk-HPUAIWIH.js +25 -0
- package/dist/chunk-I5JLCFUX.js +1 -0
- package/dist/chunk-KUPHNMUK.js +2 -0
- package/dist/{chunk-NTYXZ3EL.js → chunk-KVHDMIZS.js} +1 -1
- package/dist/{chunk-QDST6VIU.js → chunk-KZC7TI5M.js} +1 -1
- package/dist/chunk-MIZAFRDR.js +1 -0
- package/dist/chunk-PJPA5EEE.js +2 -0
- package/dist/{chunk-GUTQ3PWL.js → chunk-PLKYHUNT.js} +1 -1
- package/dist/chunk-QEJGED4V.js +28 -0
- package/dist/chunk-SILJ3OL4.js +9 -0
- package/dist/{chunk-VXD6FZP5.js → chunk-TQZBVOTT.js} +3 -3
- package/dist/chunk-VBICI5YA.js +1 -0
- package/dist/chunk-VWW3RLUX.js +12 -0
- package/dist/{chunk-O6LE42GK.js → chunk-WJTHY6AG.js} +1 -1
- package/dist/chunk-YGGKGZO2.js +1 -0
- package/dist/chunk-ZODCBFBL.js +2 -0
- package/dist/chunk-ZPT5D4VP.js +2 -0
- package/dist/entry-0.js +1 -1
- package/dist/entry-11.js +1 -1
- package/dist/entry-13.js +1 -1
- package/dist/entry-14.js +1 -1
- package/dist/entry-15.js +1 -1
- package/dist/entry-16.js +1 -1
- package/dist/entry-17.js +1 -1
- package/dist/entry-25.js +2 -2
- package/dist/entry-26.js +1 -1
- package/dist/entry-27.js +1 -1
- package/dist/entry-28.js +1 -1
- package/dist/entry-29.js +1 -1
- package/dist/entry-30.js +1 -1
- package/dist/entry-31.js +11 -11
- package/dist/entry-33.js +1 -1
- package/dist/entry-37.js +2 -2
- package/dist/entry-42.js +1 -1
- package/dist/entry-44.js +1 -1
- package/dist/entry-45.js +13 -12
- package/dist/entry-46.js +1 -1
- package/dist/entry-49.js +1 -1
- package/dist/entry-50.js +4 -4
- package/dist/entry-51.js +9 -9
- package/dist/entry-52.js +1 -1
- package/dist/entry-53.js +1 -1
- package/dist/entry-55.js +1 -1
- package/dist/entry-56.js +1 -1
- package/dist/entry-57.js +1 -1
- package/dist/entry-58.js +1 -1
- package/dist/entry-59.js +1 -1
- package/dist/entry-60.js +1 -1
- package/dist/entry-61.js +1 -1
- package/dist/entry-63.js +1 -1
- package/dist/entry-66.js +1 -1
- package/dist/entry-68.js +1 -1
- package/dist/entry-69.js +1 -1
- package/dist/entry-70.js +1 -1
- package/dist/entry-71.js +1 -0
- package/dist/entry-72.js +0 -1
- package/dist/entry-73.js +1 -0
- package/dist/entry-74.js +0 -1
- package/dist/entry-75.js +1 -1
- package/dist/entry-76.js +1 -1
- package/dist/entry-77.js +1 -324
- package/dist/entry-78.js +324 -25
- package/dist/entry-79.js +18 -2
- package/dist/entry-80.js +2 -1
- package/dist/entry-81.js +1 -1
- package/dist/entry-82.js +1 -3
- package/dist/entry-83.js +5 -3
- package/dist/entry-84.js +3 -1
- package/dist/entry-85.js +1 -1
- package/dist/entry-86.js +1 -1
- package/dist/entry-87.js +1 -0
- package/dist/pi-agent-ide.js +15 -3
- package/docs/agent-guides/editing.md +12 -0
- package/docs/agent-guides/json-reading.md +19 -3
- package/docs/agent-guides/read-resources.md +6 -0
- package/docs/agent-guides/search-code.md +5 -1
- package/docs/agent-guides/terminal.md +1 -1
- package/docs/code-review.md +99 -0
- package/docs/configuration.md +34 -0
- package/docs/development.md +15 -19
- package/docs/nightly.md +7 -0
- package/docs/releases.md +42 -0
- package/docs/research/native-codemode-batch-decision.md +27 -0
- package/docs/research/native-codemode-batching.md +65 -0
- package/docs/structured-results.md +59 -0
- package/docs/tools.md +18 -2
- package/node_modules/pi-agent-doctor/package.json +1 -1
- package/node_modules/pi-agent-documentation/package.json +1 -1
- package/node_modules/pi-agent-documentation/src/index.ts +1 -1
- package/node_modules/pi-agent-filesystem/index.ts +6 -1
- package/node_modules/pi-agent-filesystem/package.json +7 -6
- package/node_modules/pi-agent-filesystem/src/path-recovery.ts +109 -0
- package/node_modules/pi-agent-filesystem-image/package.json +3 -3
- package/node_modules/pi-agent-filesystem-jq/package.json +5 -5
- 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 +10 -10
- package/node_modules/pi-agent-ide-ast/src/overflow-handler.ts +6 -1
- package/node_modules/pi-agent-ide-ast/src/scope-handler.ts +6 -2
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +17 -0
- package/node_modules/pi-agent-ide-changes/index.ts +3 -9
- package/node_modules/pi-agent-ide-changes/package.json +8 -7
- package/node_modules/pi-agent-ide-changes/src/current-change-presenter.ts +5 -0
- package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +125 -47
- package/node_modules/pi-agent-ide-formatter/package.json +3 -3
- package/node_modules/pi-agent-ide-languages/package.json +2 -2
- package/node_modules/pi-agent-ide-lint/package.json +7 -7
- package/node_modules/pi-agent-ide-lsp/package.json +9 -9
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +19 -0
- 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 +7 -7
- package/node_modules/pi-agent-read/src/api/tools/read.ts +31 -2
- package/node_modules/pi-agent-read/src/core/tools/read/raw-read.ts +9 -10
- package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +28 -15
- package/node_modules/pi-agent-read/src/core/tools/read/structured-result.ts +216 -0
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +119 -72
- package/node_modules/pi-agent-resource/package.json +1 -1
- package/node_modules/pi-agent-resource/src/index.ts +12 -0
- package/node_modules/pi-agent-resource/src/resource-access.ts +55 -0
- package/node_modules/pi-agent-resource/src/resource-scheduler.ts +204 -0
- package/node_modules/pi-agent-resource/src/tool-result.ts +125 -0
- package/node_modules/pi-agent-search/package.json +5 -4
- package/node_modules/pi-agent-search/src/api/search-parameters.ts +6 -5
- package/node_modules/pi-agent-search/src/api/search.ts +11 -0
- package/node_modules/pi-agent-search/src/api/structured-result.ts +93 -0
- package/node_modules/pi-agent-search/src/core/extension.ts +40 -14
- package/node_modules/pi-agent-search/src/core/search-core.ts +136 -77
- package/node_modules/pi-agent-search-text/index.ts +3 -0
- package/node_modules/pi-agent-search-text/package.json +6 -6
- package/node_modules/pi-agent-search-text/src/resolvers.ts +17 -0
- package/node_modules/pi-agent-search-text/src/search-backend.ts +104 -8
- package/node_modules/pi-agent-search-text/src/search-query.ts +42 -34
- package/node_modules/pi-agent-search-text/src/search-recipe.ts +18 -4
- package/node_modules/pi-agent-search-text/src/search-renderer.ts +37 -3
- package/node_modules/pi-agent-search-text/src/search-session.ts +21 -13
- package/node_modules/pi-agent-text/package.json +2 -2
- package/node_modules/pi-agent-text/src/text-document.ts +15 -10
- 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-exact/src/anchor.ts +4 -3
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +5 -5
- package/node_modules/pi-agent-text-editor/index.ts +4 -2
- package/node_modules/pi-agent-text-editor/package.json +21 -17
- package/node_modules/pi-agent-text-editor/runtime/entry-77.js +0 -1
- package/node_modules/pi-agent-text-editor/src/api/mutation-preview.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +6 -0
- package/node_modules/pi-agent-text-editor/src/api/native-edit-batch-event.ts +12 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/apply-undo-store.ts +4 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/execution.ts +95 -34
- package/node_modules/pi-agent-text-editor/src/core/apply/results.ts +4 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/structured-result.ts +251 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/tool.ts +32 -12
- package/node_modules/pi-agent-text-editor/src/core/apply/transaction.ts +154 -132
- package/node_modules/pi-agent-text-editor/src/core/builtin-edit.ts +16 -0
- package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +74 -18
- package/node_modules/pi-agent-text-editor/src/core/editing-guidelines.ts +8 -0
- package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +6 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +640 -0
- package/node_modules/pi-agent-text-editor/src/core/post-edit-scope.ts +20 -6
- package/node_modules/pi-agent-text-editor/src/core/structured-result.ts +314 -0
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +143 -138
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +242 -116
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +109 -47
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +25 -5
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +8 -4
- package/node_modules/pi-agent-text-editor-renderer/index.ts +8 -1
- package/node_modules/pi-agent-text-editor-renderer/package.json +7 -6
- package/node_modules/pi-agent-text-editor-renderer/src/diff-model.ts +262 -129
- package/node_modules/pi-agent-text-editor-renderer/src/diff-renderer.ts +36 -2
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +28 -2
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-projection.ts +40 -10
- package/node_modules/pi-agent-text-editor-stale-anchor/index.ts +16 -1
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-80.js +2 -0
- package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
- package/node_modules/pi-agent-tool-ui/package.json +2 -2
- package/node_modules/pi-agent-tool-ui/runtime/entry-82.js +1 -0
- package/node_modules/pi-agent-web/index.ts +20 -0
- package/node_modules/pi-agent-web/package.json +8 -7
- package/node_modules/pi-agent-web/src/search.ts +112 -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/node_modules/pi-agent-web-text/runtime/entry-87.js +2 -0
- package/package.json +42 -36
- package/skills/capture-code-review-rule/SKILL.md +60 -0
- package/src/code-review/config.ts +68 -0
- package/src/code-review/extension.ts +105 -0
- package/src/code-review/fragments.ts +26 -0
- package/src/code-review/reviewer.ts +198 -0
- package/src/composite/host-version.ts +13 -0
- package/src/composite/nested-tool-rendering.ts +298 -0
- package/src/composite/tool-availability.ts +90 -0
- package/src/core/extension.ts +2 -0
- package/src/documentation/extension.ts +81 -145
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +6 -1
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -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-jq/package.json +5 -5
- 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-filesystem/src/path-recovery.ts +109 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +20 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -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-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-87.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-83.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/search.ts +112 -0
- package/src/extensions/pi-agent-read/package.json +7 -7
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +31 -2
- package/src/extensions/pi-agent-read/src/core/tools/read/raw-read.ts +9 -10
- package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +28 -15
- package/src/extensions/pi-agent-read/src/core/tools/read/structured-result.ts +216 -0
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +119 -72
- package/src/extensions/pi-agent-search/package.json +5 -4
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +3 -0
- 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/resolvers.ts +17 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +104 -8
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-query.ts +42 -34
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +18 -4
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +37 -3
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +21 -13
- package/src/extensions/pi-agent-search/src/api/search-parameters.ts +6 -5
- package/src/extensions/pi-agent-search/src/api/search.ts +11 -0
- package/src/extensions/pi-agent-search/src/api/structured-result.ts +93 -0
- package/src/extensions/pi-agent-search/src/core/extension.ts +40 -14
- package/src/extensions/pi-agent-search/src/core/search-core.ts +136 -77
- package/src/extensions/pi-agent-text-editor/index.ts +4 -2
- package/src/extensions/pi-agent-text-editor/package.json +21 -17
- 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-exact/src/anchor.ts +4 -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-editor-renderer/index.ts +8 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +7 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-model.ts +262 -129
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-renderer.ts +36 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +28 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-projection.ts +40 -10
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/index.ts +16 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-80.js +2 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-77.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-78.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-preview.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +6 -0
- package/src/extensions/pi-agent-text-editor/src/api/native-edit-batch-event.ts +12 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/apply-undo-store.ts +4 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/execution.ts +95 -34
- package/src/extensions/pi-agent-text-editor/src/core/apply/results.ts +4 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/structured-result.ts +251 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/tool.ts +32 -12
- package/src/extensions/pi-agent-text-editor/src/core/apply/transaction.ts +154 -132
- package/src/extensions/pi-agent-text-editor/src/core/builtin-edit.ts +16 -0
- package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +74 -18
- package/src/extensions/pi-agent-text-editor/src/core/editing-guidelines.ts +8 -0
- package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +6 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +640 -0
- package/src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts +20 -6
- package/src/extensions/pi-agent-text-editor/src/core/structured-result.ts +314 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +143 -138
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +242 -116
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +109 -47
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +25 -5
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +8 -4
- package/src/pi-agent-ide.ts +61 -2
- package/src/plugins/pi-agent-ide-ast/package.json +10 -10
- package/src/plugins/pi-agent-ide-ast/src/overflow-handler.ts +6 -1
- package/src/plugins/pi-agent-ide-ast/src/scope-handler.ts +6 -2
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +17 -0
- package/src/plugins/pi-agent-ide-changes/index.ts +3 -9
- package/src/plugins/pi-agent-ide-changes/package.json +8 -7
- package/src/plugins/pi-agent-ide-changes/src/current-change-presenter.ts +5 -0
- package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +125 -47
- package/src/plugins/pi-agent-ide-debugger/index.ts +63 -17
- package/src/plugins/pi-agent-ide-debugger/src/catalog.ts +18 -2
- package/src/plugins/pi-agent-ide-debugger/src/dap-client.ts +24 -4
- package/src/plugins/pi-agent-ide-debugger/src/doctor-plugin.ts +68 -2
- package/src/plugins/pi-agent-ide-debugger/src/java-runtime.ts +357 -0
- package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +55 -3
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +13 -13
- package/src/plugins/pi-agent-ide-formatter/package.json +3 -3
- package/src/plugins/pi-agent-ide-languages/package.json +2 -2
- package/src/plugins/pi-agent-ide-lint/package.json +7 -7
- package/src/plugins/pi-agent-ide-lsp/package.json +9 -9
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +19 -0
- package/src/plugins/pi-agent-ide-terminal/index.ts +12 -2
- package/src/plugins/pi-agent-ide-terminal/src/output-limits.ts +1 -1
- package/src/plugins/pi-agent-ide-terminal/src/resources.ts +65 -30
- package/src/plugins/pi-agent-ide-terminal/src/search.ts +13 -8
- package/src/plugins/pi-agent-ide-terminal/src/session-manager.ts +1 -0
- package/src/plugins/pi-agent-ide-terminal/src/shell-result.ts +100 -0
- package/src/plugins/pi-agent-ide-terminal/src/steering.ts +62 -0
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +97 -45
- package/src/plugins/pi-agent-ide-terminal/src/types.ts +3 -1
- package/src/plugins/pi-agent-ide-terminal/src/ui.ts +15 -6
- package/src/plugins/pi-agent-ide-vision/index.ts +16 -1
- package/dist/chunk-3E2NTWCN.js +0 -2
- package/dist/chunk-4LUW26BX.js +0 -10
- package/dist/chunk-5VSE5X5R.js +0 -2
- package/dist/chunk-CEX3VOJ7.js +0 -2
- package/dist/chunk-FA6BKC5Y.js +0 -1
- package/dist/chunk-FEDVTZJG.js +0 -1
- package/dist/chunk-HMLH43ZS.js +0 -4
- package/dist/chunk-KII2JQC5.js +0 -1
- package/dist/chunk-LVWMWWWF.js +0 -28
- package/dist/chunk-P7XO5CIP.js +0 -2
- package/dist/chunk-PZFOOHY2.js +0 -15
- package/dist/chunk-S3ZPXWX7.js +0 -2
- package/dist/chunk-T7CZIACQ.js +0 -27
- package/dist/chunk-YT42LKFV.js +0 -16
- package/node_modules/pi-agent-text-editor/src/core/builtin-edit-filter.ts +0 -52
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-80.js +0 -1
- package/node_modules/pi-agent-web/runtime/entry-82.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-83.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-82.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-78.js +0 -2
- package/src/extensions/pi-agent-text-editor/src/core/builtin-edit-filter.ts +0 -52
- /package/dist/{chunk-4U2GUKNJ.js → chunk-F7NVAC4Q.js} +0 -0
- /package/dist/{chunk-ROXXK6TW.js → chunk-PXWDDBBC.js} +0 -0
- /package/node_modules/{pi-agent-text-editor-renderer → pi-agent-text-editor}/runtime/entry-78.js +0 -0
- /package/node_modules/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-79.js +0 -0
- /package/node_modules/{pi-agent-tool-ui → pi-agent-tool-call-interception}/runtime/entry-81.js +0 -0
- /package/node_modules/{pi-agent-web-html → pi-agent-web}/runtime/entry-83.js +0 -0
- /package/node_modules/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-84.js +0 -0
- /package/node_modules/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-85.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-86.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-84.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-85.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-86.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-79.js +0 -0
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ToolExecutionComponent,
|
|
3
|
+
type ExtensionAPI,
|
|
4
|
+
type ToolDefinition,
|
|
5
|
+
type AgentToolResult,
|
|
6
|
+
} from "@earendil-works/pi-coding-agent";
|
|
7
|
+
import { Container, Spacer, Text, type TUI } from "@earendil-works/pi-tui";
|
|
8
|
+
import {
|
|
9
|
+
NATIVE_EDIT_BATCH_EVENT,
|
|
10
|
+
type NativeEditBatchEvent,
|
|
11
|
+
} from "#src/extensions/pi-agent-text-editor/src/api/native-edit-batch-event.js";
|
|
12
|
+
import { compactMutationDetails } from "#src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/persisted-result.js";
|
|
13
|
+
|
|
14
|
+
const ENTRY_TYPE = "ide-nested-results";
|
|
15
|
+
const MAX_CALLS = 256;
|
|
16
|
+
const MAX_BYTES = 512 * 1024;
|
|
17
|
+
const MAX_ARGUMENT_BYTES = 8 * 1024;
|
|
18
|
+
const MAX_ARGUMENT_TOTAL_BYTES = 32 * 1024;
|
|
19
|
+
|
|
20
|
+
interface ChildPanel {
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
args: unknown;
|
|
24
|
+
renderArgs?: unknown;
|
|
25
|
+
omitted?: boolean;
|
|
26
|
+
batched?: boolean;
|
|
27
|
+
result?: { content: AgentToolResult<unknown>["content"]; details: unknown; isError: boolean };
|
|
28
|
+
}
|
|
29
|
+
interface BatchReport {
|
|
30
|
+
data?: { operations?: { id: string; effect: string; errors: { message: string }[] }[] };
|
|
31
|
+
}
|
|
32
|
+
interface PanelGroup {
|
|
33
|
+
parentToolCallId: string;
|
|
34
|
+
cwd: string;
|
|
35
|
+
calls: ChildPanel[];
|
|
36
|
+
complete: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Keep bounded display data for nested IDE tools, separate from model context and usage. */
|
|
40
|
+
export function createNestedIdeRendering(pi: ExtensionAPI) {
|
|
41
|
+
const definitions = new Map<string, ToolDefinition>();
|
|
42
|
+
const parents = new Map<string, string>();
|
|
43
|
+
const groups = new Map<string, PanelGroup>();
|
|
44
|
+
let tui: TUI | undefined;
|
|
45
|
+
const components = new WeakMap<object, Container>();
|
|
46
|
+
const retainResult = (
|
|
47
|
+
group: PanelGroup,
|
|
48
|
+
call: ChildPanel,
|
|
49
|
+
result: NonNullable<ChildPanel["result"]>,
|
|
50
|
+
) => {
|
|
51
|
+
// Bound in-memory display data as each call finishes, not only at persistence.
|
|
52
|
+
call.result = result;
|
|
53
|
+
try {
|
|
54
|
+
const serialized = JSON.stringify(group);
|
|
55
|
+
if (Buffer.byteLength(serialized) <= MAX_BYTES) {
|
|
56
|
+
call.result = JSON.parse(JSON.stringify(result)) as NonNullable<ChildPanel["result"]>;
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
} catch {
|
|
60
|
+
// A renderer payload that cannot be serialized must not break tool execution.
|
|
61
|
+
}
|
|
62
|
+
const references =
|
|
63
|
+
result.details && typeof result.details === "object"
|
|
64
|
+
? Object.entries(result.details)
|
|
65
|
+
.filter(
|
|
66
|
+
([key, value]) =>
|
|
67
|
+
(key === "source" || key === "fullOutputPath") && typeof value === "string",
|
|
68
|
+
)
|
|
69
|
+
.map(([key, value]) => `${key}: ${String(value)}`)
|
|
70
|
+
: [];
|
|
71
|
+
call.result = {
|
|
72
|
+
content: [
|
|
73
|
+
{
|
|
74
|
+
type: "text",
|
|
75
|
+
text: [
|
|
76
|
+
"Result presentation omitted (history size limit or unsupported payload).",
|
|
77
|
+
...references,
|
|
78
|
+
].join("\n"),
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
details: undefined,
|
|
82
|
+
isError: result.isError,
|
|
83
|
+
};
|
|
84
|
+
call.omitted = true;
|
|
85
|
+
group.complete = false;
|
|
86
|
+
};
|
|
87
|
+
const clear = () => {
|
|
88
|
+
parents.clear();
|
|
89
|
+
groups.clear();
|
|
90
|
+
};
|
|
91
|
+
pi.on("session_start", (_event, context) => {
|
|
92
|
+
clear();
|
|
93
|
+
if (context.mode !== "tui") return;
|
|
94
|
+
// A zero-row widget supplies the public TUI handle needed by native tool components.
|
|
95
|
+
context.ui.setWidget(ENTRY_TYPE, (ui) => {
|
|
96
|
+
tui = ui;
|
|
97
|
+
return {
|
|
98
|
+
render: () => [],
|
|
99
|
+
invalidate: () => {},
|
|
100
|
+
};
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
pi.on("session_tree", clear);
|
|
104
|
+
pi.on("session_shutdown", clear);
|
|
105
|
+
pi.on("tool_execution_start", (event, context) => {
|
|
106
|
+
if (event.parentToolCallId === undefined) return;
|
|
107
|
+
const root = parents.get(event.parentToolCallId) ?? event.parentToolCallId;
|
|
108
|
+
parents.set(event.toolCallId, root);
|
|
109
|
+
// Flush is bookkeeping; its committed edits already own the final diff panels.
|
|
110
|
+
if (event.toolName === "flush" || !definitions.has(event.toolName)) return;
|
|
111
|
+
let group = groups.get(root);
|
|
112
|
+
if (!group) {
|
|
113
|
+
group = { parentToolCallId: root, cwd: context.cwd, calls: [], complete: true };
|
|
114
|
+
groups.set(root, group);
|
|
115
|
+
}
|
|
116
|
+
if (group.calls.length >= MAX_CALLS) {
|
|
117
|
+
group.complete = false;
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const json = JSON.stringify(event.args);
|
|
121
|
+
const remaining =
|
|
122
|
+
MAX_ARGUMENT_TOTAL_BYTES -
|
|
123
|
+
group.calls.reduce((bytes, call) => bytes + Buffer.byteLength(JSON.stringify(call.args)), 0);
|
|
124
|
+
const omitted = Buffer.byteLength(json) > Math.min(MAX_ARGUMENT_BYTES, remaining);
|
|
125
|
+
const args = omitted
|
|
126
|
+
? Object.fromEntries(
|
|
127
|
+
Object.entries(event.args as Record<string, unknown>).map(([key, value]) => [
|
|
128
|
+
key,
|
|
129
|
+
typeof value === "string"
|
|
130
|
+
? value.slice(0, 200) + (value.length > 200 ? "… [omitted]" : "")
|
|
131
|
+
: "[omitted]",
|
|
132
|
+
]),
|
|
133
|
+
)
|
|
134
|
+
: (JSON.parse(json) as unknown);
|
|
135
|
+
const boundedArgs = Buffer.byteLength(JSON.stringify(args)) <= remaining ? args : {};
|
|
136
|
+
group.calls.push({ id: event.toolCallId, name: event.toolName, args: boundedArgs });
|
|
137
|
+
if (omitted) group.complete = false;
|
|
138
|
+
});
|
|
139
|
+
pi.on("tool_execution_end", (event) => {
|
|
140
|
+
const root = parents.get(event.toolCallId);
|
|
141
|
+
if (root === undefined) return;
|
|
142
|
+
parents.delete(event.toolCallId);
|
|
143
|
+
const group = groups.get(root);
|
|
144
|
+
const call = group?.calls.find((call) => call.id === event.toolCallId);
|
|
145
|
+
if (group && call) {
|
|
146
|
+
// Hooks have already prepared compact renderer details. Never copy structuredContent or usage.
|
|
147
|
+
const result = event.result as AgentToolResult<unknown>;
|
|
148
|
+
retainResult(group, call, {
|
|
149
|
+
content: result.content.filter(
|
|
150
|
+
(block) => block.type !== "text" || !block.text.startsWith("\n\n---\n\n# Guide:"),
|
|
151
|
+
),
|
|
152
|
+
details: result.details,
|
|
153
|
+
isError: event.isError,
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
pi.on("message_end", (event) => {
|
|
158
|
+
if (event.message.role !== "toolResult") return;
|
|
159
|
+
const group = groups.get(event.message.toolCallId);
|
|
160
|
+
if (!group) return;
|
|
161
|
+
groups.delete(event.message.toolCallId);
|
|
162
|
+
for (const [child, root] of parents) if (root === group.parentToolCallId) parents.delete(child);
|
|
163
|
+
// Serializing once strips runtime classes and prevents later hooks from mutating history.
|
|
164
|
+
const saved: PanelGroup = { ...group, calls: [], complete: group.complete };
|
|
165
|
+
let bytes = 0;
|
|
166
|
+
for (const call of group.calls) {
|
|
167
|
+
if (call.batched) continue;
|
|
168
|
+
const json = JSON.stringify(call);
|
|
169
|
+
bytes += Buffer.byteLength(json);
|
|
170
|
+
if (bytes > MAX_BYTES) {
|
|
171
|
+
saved.complete = false;
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
saved.calls.push(JSON.parse(json) as ChildPanel);
|
|
175
|
+
if (!call.result) saved.complete = false;
|
|
176
|
+
}
|
|
177
|
+
pi.appendEntry(ENTRY_TYPE, saved);
|
|
178
|
+
});
|
|
179
|
+
pi.registerEntryRenderer<PanelGroup>(ENTRY_TYPE, function renderEntry(entry, options, theme) {
|
|
180
|
+
if (!Array.isArray(entry.data?.calls)) return undefined;
|
|
181
|
+
// Pi rebuilds resumed history before session_start binds the public UI.
|
|
182
|
+
// Keep the entry mounted and resolve its tool components on the next render.
|
|
183
|
+
if (!tui)
|
|
184
|
+
return {
|
|
185
|
+
render: (width: number): string[] =>
|
|
186
|
+
tui ? (renderEntry(entry, options, theme)?.render(width) ?? []) : [],
|
|
187
|
+
invalidate: () => {
|
|
188
|
+
if (entry.data) components.get(entry.data)?.invalidate();
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
let panel = components.get(entry.data);
|
|
192
|
+
if (!panel) {
|
|
193
|
+
panel = new Container();
|
|
194
|
+
for (const call of entry.data.calls) {
|
|
195
|
+
const component = new ToolExecutionComponent(
|
|
196
|
+
call.name,
|
|
197
|
+
call.id,
|
|
198
|
+
call.renderArgs ?? call.args,
|
|
199
|
+
{ showImages: true },
|
|
200
|
+
call.omitted || !call.result ? undefined : definitions.get(call.name),
|
|
201
|
+
tui,
|
|
202
|
+
entry.data.cwd,
|
|
203
|
+
);
|
|
204
|
+
if (call.result) component.updateResult(call.result);
|
|
205
|
+
else
|
|
206
|
+
component.updateResult({
|
|
207
|
+
content: [{ type: "text", text: "Result unavailable; history is incomplete." }],
|
|
208
|
+
isError: true,
|
|
209
|
+
});
|
|
210
|
+
panel.addChild(new Spacer(1));
|
|
211
|
+
panel.addChild(component);
|
|
212
|
+
}
|
|
213
|
+
if (!entry.data.complete)
|
|
214
|
+
panel.addChild(
|
|
215
|
+
new Text(
|
|
216
|
+
theme.fg(
|
|
217
|
+
"warning",
|
|
218
|
+
"Incomplete nested IDE presentation; some results were not retained.",
|
|
219
|
+
),
|
|
220
|
+
0,
|
|
221
|
+
0,
|
|
222
|
+
),
|
|
223
|
+
);
|
|
224
|
+
components.set(entry.data, panel);
|
|
225
|
+
}
|
|
226
|
+
const warning = panel.children.at(-1);
|
|
227
|
+
if (!entry.data.complete && warning instanceof Text)
|
|
228
|
+
warning.setText(
|
|
229
|
+
theme.fg("warning", "Incomplete nested IDE presentation; some results were not retained."),
|
|
230
|
+
);
|
|
231
|
+
for (const child of panel.children)
|
|
232
|
+
if (child instanceof ToolExecutionComponent) child.setExpanded(options.expanded);
|
|
233
|
+
return panel;
|
|
234
|
+
});
|
|
235
|
+
const finalize = () => {
|
|
236
|
+
pi.events.on(NATIVE_EDIT_BATCH_EVENT, (value) => {
|
|
237
|
+
const batch = value as NativeEditBatchEvent;
|
|
238
|
+
const group = groups.get(batch.parentToolCallId);
|
|
239
|
+
if (!group) return;
|
|
240
|
+
const details = compactMutationDetails(batch.result.details);
|
|
241
|
+
for (const id of batch.calls) {
|
|
242
|
+
const call = group.calls.find((call) => call.id === id);
|
|
243
|
+
if (!call) continue;
|
|
244
|
+
// Native history keeps every call; user presentation keeps the final batch diff only.
|
|
245
|
+
call.batched = id !== batch.calls.at(-1);
|
|
246
|
+
if (call.batched) call.result = undefined;
|
|
247
|
+
else {
|
|
248
|
+
// A multi-file batch has no single source: let the existing renderer label each file.
|
|
249
|
+
if (new Set(details.mutationRender?.map((resource) => resource.path)).size > 1)
|
|
250
|
+
call.renderArgs = {};
|
|
251
|
+
retainResult(group, call, {
|
|
252
|
+
content: batch.result.content,
|
|
253
|
+
details,
|
|
254
|
+
isError: batch.result.isError === true,
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
pi.on("tool_result", (event) => {
|
|
260
|
+
const details = event.details;
|
|
261
|
+
const group = groups.get(event.toolCallId);
|
|
262
|
+
if (
|
|
263
|
+
group &&
|
|
264
|
+
details &&
|
|
265
|
+
typeof details === "object" &&
|
|
266
|
+
"editorBatchResults" in details &&
|
|
267
|
+
Array.isArray(details.editorBatchResults)
|
|
268
|
+
) {
|
|
269
|
+
for (const report of details.editorBatchResults as BatchReport[]) {
|
|
270
|
+
for (const operation of report.data?.operations ?? []) {
|
|
271
|
+
const call = group.calls.find((call) => call.id === operation.id);
|
|
272
|
+
if (!call) continue;
|
|
273
|
+
const errors = operation.errors.map((error) => error.message);
|
|
274
|
+
if (errors.length > 0 || operation.effect !== "applied") {
|
|
275
|
+
call.batched = false;
|
|
276
|
+
delete call.renderArgs;
|
|
277
|
+
retainResult(group, call, {
|
|
278
|
+
content: [
|
|
279
|
+
{
|
|
280
|
+
type: "text",
|
|
281
|
+
text: `${call.name}: ${operation.effect}.\n${errors.join("\n")}`,
|
|
282
|
+
},
|
|
283
|
+
],
|
|
284
|
+
details: undefined,
|
|
285
|
+
isError: errors.length > 0 || operation.effect === "unknown",
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
};
|
|
293
|
+
const registerTool: ExtensionAPI["registerTool"] = (definition) => {
|
|
294
|
+
definitions.set(definition.name, definition as ToolDefinition);
|
|
295
|
+
pi.registerTool(definition);
|
|
296
|
+
};
|
|
297
|
+
return { api: { ...pi, registerTool }, finalize };
|
|
298
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
|
|
3
|
+
interface ToolAvailability {
|
|
4
|
+
hide(): void;
|
|
5
|
+
restore(): void;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
type AvailabilityApi = Pick<
|
|
9
|
+
ExtensionAPI,
|
|
10
|
+
"registerTool" | "getSettings" | "getAllTools" | "getActiveTools" | "setActiveTools"
|
|
11
|
+
>;
|
|
12
|
+
|
|
13
|
+
/** Keep explicit settings exclusions out of every native IDE execution path. */
|
|
14
|
+
export function createIdeToolAvailability<TApi extends AvailabilityApi>(pi: TApi) {
|
|
15
|
+
const definitions = new Map<string, ToolAvailability>();
|
|
16
|
+
const hidden = new Set<string>();
|
|
17
|
+
const registerTool: ExtensionAPI["registerTool"] = (definition) => {
|
|
18
|
+
if (definition.namespace?.name.startsWith("ide_") === true) {
|
|
19
|
+
definitions.set(definition.name, {
|
|
20
|
+
hide: () =>
|
|
21
|
+
pi.registerTool({
|
|
22
|
+
...definition,
|
|
23
|
+
get description() {
|
|
24
|
+
return definition.description;
|
|
25
|
+
},
|
|
26
|
+
get promptGuidelines() {
|
|
27
|
+
return definition.promptGuidelines;
|
|
28
|
+
},
|
|
29
|
+
exposure: "hidden",
|
|
30
|
+
}),
|
|
31
|
+
restore: () => pi.registerTool(definition),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
if (hidden.has(definition.name)) definitions.get(definition.name)?.hide();
|
|
35
|
+
else pi.registerTool(definition);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
api: { ...pi, registerTool },
|
|
40
|
+
/** Enforce exclusions; activate configured or restored tools only at session startup. */
|
|
41
|
+
reconcile(activateDefaults = false, restoredTools: readonly string[] = []): void {
|
|
42
|
+
const excluded = new Set<string>();
|
|
43
|
+
const requested = new Set<string>();
|
|
44
|
+
for (const entry of pi.getSettings().defaultTools ?? []) {
|
|
45
|
+
if (entry.startsWith("-")) {
|
|
46
|
+
excluded.add(entry.slice(1));
|
|
47
|
+
requested.delete(entry.slice(1));
|
|
48
|
+
} else {
|
|
49
|
+
const name = entry.startsWith("+") ? entry.slice(1) : entry;
|
|
50
|
+
excluded.delete(name);
|
|
51
|
+
requested.add(name);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
for (const [name, definition] of definitions) {
|
|
55
|
+
if (excluded.has(name) === hidden.has(name)) continue;
|
|
56
|
+
if (excluded.has(name)) {
|
|
57
|
+
definition.hide();
|
|
58
|
+
hidden.add(name);
|
|
59
|
+
} else {
|
|
60
|
+
definition.restore();
|
|
61
|
+
hidden.delete(name);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// The host registry already applies CLI allowlists and exclusions. Never
|
|
65
|
+
// activate a tool absent from it, or infer deferred availability from active tools.
|
|
66
|
+
const available = pi.getAllTools().filter((tool) => tool.exposure !== "hidden");
|
|
67
|
+
const active = new Set(pi.getActiveTools());
|
|
68
|
+
for (const tool of available) {
|
|
69
|
+
if (
|
|
70
|
+
activateDefaults &&
|
|
71
|
+
definitions.has(tool.name) &&
|
|
72
|
+
(requested.has(tool.name) ||
|
|
73
|
+
(tool.exposure === "deferred" && restoredTools.includes(tool.name)))
|
|
74
|
+
)
|
|
75
|
+
active.add(tool.name);
|
|
76
|
+
}
|
|
77
|
+
if (
|
|
78
|
+
activateDefaults &&
|
|
79
|
+
!excluded.has("tool_search") &&
|
|
80
|
+
available.some((tool) => tool.name === "tool_search") &&
|
|
81
|
+
available.some((tool) => definitions.has(tool.name) && tool.exposure === "deferred")
|
|
82
|
+
)
|
|
83
|
+
active.add("tool_search");
|
|
84
|
+
const previous = pi.getActiveTools();
|
|
85
|
+
const next = [...active].filter((name) => !hidden.has(name));
|
|
86
|
+
if (next.length !== previous.length || next.some((name) => !previous.includes(name)))
|
|
87
|
+
pi.setActiveTools(next);
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
}
|
package/src/core/extension.ts
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
} from "#src/core/diagnostic-entry.js";
|
|
15
15
|
import { runIdePostEditGate } from "#src/post-edit/gate.js";
|
|
16
16
|
import { resetRegistry } from "#src/toolchain/registry.js";
|
|
17
|
+
import registerCodeReview from "#src/code-review/extension.js";
|
|
17
18
|
import {
|
|
18
19
|
connectTextEditorPostEditHandler,
|
|
19
20
|
afterPostEditScope,
|
|
@@ -103,5 +104,6 @@ export default async function registerPiAgentIde(pi: ExtensionAPI): Promise<void
|
|
|
103
104
|
unsubscribeDiagnostics();
|
|
104
105
|
});
|
|
105
106
|
|
|
107
|
+
await registerCodeReview(pi);
|
|
106
108
|
await core.waitForPendingPlugins();
|
|
107
109
|
}
|