pi-agent-ide 0.6.0 → 0.6.2
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 +41 -0
- package/README.md +146 -68
- package/assets/social-preview.png +0 -0
- package/assets/summary/debugging.png +0 -0
- package/assets/summary/editing.png +0 -0
- package/assets/summary/read.png +0 -0
- package/assets/summary/search-and-replace.png +0 -0
- package/assets/summary/search.png +0 -0
- package/assets/summary/settings.png +0 -0
- package/assets/summary/terminal.png +0 -0
- package/assets/summary/thumbs/debugging.png +0 -0
- package/assets/summary/thumbs/editing.png +0 -0
- package/assets/summary/thumbs/read.png +0 -0
- package/assets/summary/thumbs/search-and-replace.png +0 -0
- package/assets/summary/thumbs/search.png +0 -0
- package/assets/summary/thumbs/settings.png +0 -0
- package/assets/summary/thumbs/terminal.png +0 -0
- package/assets/summary/thumbs/user_terminal.png +0 -0
- package/assets/summary/user_terminal.png +0 -0
- package/dist/chunk-3E2NTWCN.js +2 -0
- package/dist/chunk-7WCZOO5I.js +1 -0
- package/dist/chunk-CEX3VOJ7.js +2 -0
- package/dist/chunk-FA6BKC5Y.js +1 -0
- package/dist/{chunk-2527OQ4Y.js → chunk-HMLH43ZS.js} +1 -1
- package/dist/chunk-LVWMWWWF.js +28 -0
- package/dist/chunk-MPT3R4BL.js +0 -0
- package/dist/chunk-PZFOOHY2.js +15 -0
- package/dist/{chunk-HKMBQLEK.js → chunk-QDLTO5PH.js} +1 -1
- package/dist/{chunk-Z3VC3S2T.js → chunk-QIK2E64R.js} +1 -1
- package/dist/{chunk-OYWIZII6.js → chunk-S6QRG3TQ.js} +1 -1
- package/dist/chunk-T7CZIACQ.js +27 -0
- package/dist/chunk-T7I2VX3J.js +1 -0
- package/dist/chunk-VCTK4JSN.js +3 -0
- package/dist/chunk-VXD6FZP5.js +5 -0
- package/dist/chunk-W7CASEO3.js +1 -0
- package/dist/chunk-YT42LKFV.js +16 -0
- package/dist/entry-1.js +1 -1
- package/dist/entry-10.js +1 -1
- package/dist/entry-11.js +1 -1
- package/dist/entry-12.js +1 -1
- package/dist/entry-13.js +1 -1
- package/dist/entry-14.js +1 -1
- package/dist/entry-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-2.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 +13 -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 +10 -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 +1 -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 +0 -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 +1 -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 +0 -30
- package/dist/entry-74.js +1 -2
- package/dist/entry-75.js +1 -1
- package/dist/entry-76.js +1 -1
- package/dist/entry-77.js +315 -3
- package/dist/entry-78.js +30 -3
- package/dist/entry-79.js +2 -1
- package/dist/entry-80.js +1 -1
- package/dist/entry-81.js +1 -1
- package/dist/entry-82.js +3 -0
- package/dist/entry-83.js +3 -0
- package/dist/entry-84.js +1 -0
- package/dist/entry-85.js +1 -0
- package/dist/entry-86.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 +12 -11
- package/node_modules/pi-agent-ide-ast/runtime/entry-30.js +1 -0
- package/node_modules/pi-agent-ide-ast/src/search-presentation.ts +117 -0
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +20 -2
- 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 +17 -9
- package/node_modules/pi-agent-search-text/runtime/entry-53.js +1 -0
- package/node_modules/pi-agent-search-text/src/persisted-result.ts +9 -7
- package/node_modules/pi-agent-search-text/src/search-renderer.ts +10 -4
- package/node_modules/pi-agent-search-text/src/search-result.ts +8 -1
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text/runtime/entry-55.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-56.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-58.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-60.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/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/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-80.js +1 -0
- package/node_modules/pi-agent-tool-ui/package.json +2 -2
- package/node_modules/pi-agent-tool-ui/runtime/entry-81.js +1 -0
- package/node_modules/pi-agent-web/package.json +7 -7
- package/node_modules/pi-agent-web/runtime/entry-82.js +2 -0
- package/node_modules/pi-agent-web-html/package.json +3 -3
- package/node_modules/pi-agent-web-html/runtime/entry-83.js +2 -0
- package/node_modules/pi-agent-web-image/package.json +4 -4
- package/node_modules/pi-agent-web-image/runtime/entry-84.js +2 -0
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/runtime/entry-85.js +2 -0
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-86.js +2 -0
- package/package.json +108 -44
- package/src/api/documentation.ts +2 -0
- package/src/api/plugin-protocol.ts +10 -4
- 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-html/runtime/entry-83.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-84.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-85.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-86.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-82.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 +17 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-53.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/persisted-result.ts +9 -7
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +10 -4
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +8 -1
- 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-56.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-57.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-58.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-59.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-60.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-78.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/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-79.js +2 -0
- 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 +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-76.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-77.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 +12 -11
- package/src/plugins/pi-agent-ide-ast/runtime/entry-30.js +1 -0
- package/src/plugins/pi-agent-ide-ast/src/search-presentation.ts +117 -0
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +20 -2
- 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 +44 -14
- package/src/plugins/pi-agent-ide-debugger/src/renderer.ts +10 -1
- package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +39 -0
- package/src/plugins/pi-agent-ide-debugger/src/ui.ts +42 -5
- 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 +88 -12
- package/src/plugins/pi-agent-ide-terminal/src/screen-image.ts +6 -2
- 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 +10 -7
- package/src/plugins/pi-agent-ide-vision/src/vision.ts +17 -3
- package/assets/gallery/apply-editing.png +0 -0
- package/assets/gallery/debugging.png +0 -0
- package/assets/gallery/read-web.png +0 -0
- package/assets/gallery/search-replace.png +0 -0
- package/assets/gallery/terminal.png +0 -0
- package/assets/gallery/tool-editing.png +0 -0
- 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-HSM6R7IB.js +0 -27
- 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-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/runtime/entry-60.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-web-pdf/runtime/entry-80.js +0 -2
- package/node_modules/pi-agent-web-text/runtime/entry-81.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/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-81.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-77.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-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/extensions/pi-agent-text-editor/runtime/entry-59.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-60.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-anchor-line-hash → pi-agent-search-text}/runtime/entry-54.js +0 -0
- /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-exact}/runtime/entry-57.js +0 -0
- /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-line-hash}/runtime/entry-59.js +0 -0
- /package/node_modules/{pi-agent-tool-call-interception → pi-agent-text-editor}/runtime/entry-75.js +0 -0
- /package/node_modules/{pi-agent-tool-ui → pi-agent-text-editor}/runtime/entry-76.js +0 -0
- /package/node_modules/{pi-agent-web → pi-agent-text-editor}/runtime/entry-77.js +0 -0
- /package/node_modules/{pi-agent-web-html → pi-agent-text-editor-renderer}/runtime/entry-78.js +0 -0
- /package/node_modules/{pi-agent-web-image → pi-agent-text-editor-stale-anchor}/runtime/entry-79.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-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-text-editor/plugins/pi-agent-text-anchor-line-hash → pi-agent-search/plugins/pi-agent-search-text}/runtime/entry-54.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
|
@@ -228,10 +228,16 @@ export class ReadResultPanel implements Component {
|
|
|
228
228
|
|
|
229
229
|
const innerWidth = width - 2;
|
|
230
230
|
const contentWidth = Math.max(1, innerWidth - 2);
|
|
231
|
-
const
|
|
231
|
+
const compactInput = compactRenderInput(this.state, contentWidth);
|
|
232
|
+
const renderedRows = renderContentRows(compactInput.state, contentWidth).flatMap((row) =>
|
|
232
233
|
wrapTextWithAnsi(row, contentWidth),
|
|
233
234
|
);
|
|
234
|
-
const rows = compactRows(
|
|
235
|
+
const rows = compactRows(
|
|
236
|
+
renderedRows,
|
|
237
|
+
this.state.expanded,
|
|
238
|
+
this.state.theme,
|
|
239
|
+
compactInput.hasHiddenRows,
|
|
240
|
+
);
|
|
235
241
|
const lines = [renderTopBorder(this.state, innerWidth, this.state.theme)];
|
|
236
242
|
|
|
237
243
|
for (const row of rows) {
|
|
@@ -257,6 +263,49 @@ export class ReadResultPanel implements Component {
|
|
|
257
263
|
}
|
|
258
264
|
}
|
|
259
265
|
|
|
266
|
+
const COMPACT_SOURCE_RENDER_THRESHOLD = 100;
|
|
267
|
+
const MAX_COMPACT_SOURCE_LINES = COMPACT_READ_ROWS;
|
|
268
|
+
const MAX_COMPACT_CHARACTERS_PER_ROW = 4;
|
|
269
|
+
|
|
270
|
+
interface CompactRenderInput {
|
|
271
|
+
readonly state: ReadPanelState;
|
|
272
|
+
readonly hasHiddenRows: boolean;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
function compactRenderInput(state: ReadPanelState, width: number): CompactRenderInput {
|
|
276
|
+
if (state.expanded) return { state, hasHiddenRows: false };
|
|
277
|
+
|
|
278
|
+
const lines = readLines(state.details);
|
|
279
|
+
if (lines !== undefined && lines.length > COMPACT_SOURCE_RENDER_THRESHOLD) {
|
|
280
|
+
return {
|
|
281
|
+
state: {
|
|
282
|
+
...state,
|
|
283
|
+
details: { ...state.details, lines: lines.slice(0, MAX_COMPACT_SOURCE_LINES) },
|
|
284
|
+
},
|
|
285
|
+
hasHiddenRows: true,
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
if (lines !== undefined) return { state, hasHiddenRows: false };
|
|
290
|
+
|
|
291
|
+
const characterLimit = Math.max(
|
|
292
|
+
COMPACT_READ_ROWS,
|
|
293
|
+
width * COMPACT_READ_ROWS * MAX_COMPACT_CHARACTERS_PER_ROW,
|
|
294
|
+
);
|
|
295
|
+
const content = state.result.content.map((block) => {
|
|
296
|
+
if (block.type !== "text" || block.text.length <= characterLimit) return block;
|
|
297
|
+
return { ...block, text: block.text.slice(0, characterLimit) };
|
|
298
|
+
});
|
|
299
|
+
const hasHiddenRows = content.some((block, index) => {
|
|
300
|
+
const original = state.result.content[index];
|
|
301
|
+
return (
|
|
302
|
+
block.type === "text" && original?.type === "text" && block.text.length < original.text.length
|
|
303
|
+
);
|
|
304
|
+
});
|
|
305
|
+
return hasHiddenRows
|
|
306
|
+
? { state: { ...state, result: { ...state.result, content } }, hasHiddenRows }
|
|
307
|
+
: { state, hasHiddenRows: false };
|
|
308
|
+
}
|
|
260
309
|
function renderContentRows(state: ReadPanelState, width: number): string[] {
|
|
261
310
|
const lines = readLines(state.details);
|
|
262
311
|
const text = cleanText(state.result, lines, state.details, !state.expanded);
|
|
@@ -390,19 +439,24 @@ function renderCodeViewLabel(value: string, theme: Theme, stripMarkers = true):
|
|
|
390
439
|
return theme.fg("toolOutput", line);
|
|
391
440
|
}
|
|
392
441
|
|
|
393
|
-
function compactRows(
|
|
394
|
-
|
|
442
|
+
function compactRows(
|
|
443
|
+
rows: readonly string[],
|
|
444
|
+
expanded: boolean,
|
|
445
|
+
theme: Theme,
|
|
446
|
+
hasHiddenRows = false,
|
|
447
|
+
): readonly string[] {
|
|
448
|
+
if (expanded || (rows.length <= COMPACT_READ_ROWS && !hasHiddenRows)) {
|
|
395
449
|
return rows;
|
|
396
450
|
}
|
|
397
451
|
|
|
398
452
|
const shown = rows.slice(0, COMPACT_READ_ROWS - 1);
|
|
399
453
|
const omitted = rows.length - shown.length;
|
|
454
|
+
const count = hasHiddenRows
|
|
455
|
+
? "more rows"
|
|
456
|
+
: `${String(omitted)} more ${omitted === 1 ? "row" : "rows"}`;
|
|
400
457
|
return [
|
|
401
458
|
...shown,
|
|
402
|
-
`${theme.fg("dim", `… ${
|
|
403
|
-
"app.tools.expand",
|
|
404
|
-
"to expand",
|
|
405
|
-
)}`,
|
|
459
|
+
`${theme.fg("dim", `… ${count} · `)}${keyHint("app.tools.expand", "to expand")}`,
|
|
406
460
|
];
|
|
407
461
|
}
|
|
408
462
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { requiredValue } from "pi-agent-invariant";
|
|
2
|
+
import { Text } from "@earendil-works/pi-tui";
|
|
2
3
|
import { type ToolDefinition } from "@earendil-works/pi-coding-agent";
|
|
3
4
|
import {
|
|
4
5
|
isAgentContent,
|
|
@@ -120,7 +121,7 @@ export interface ReadTool {
|
|
|
120
121
|
/** Creates a read pipeline whose prompt contributions reflect the currently installed plugins. */
|
|
121
122
|
export function createReadTool(
|
|
122
123
|
pluginPromptGuidelines?: () => readonly string[],
|
|
123
|
-
|
|
124
|
+
presentation: "full" | "compact" | "disabled" = "compact",
|
|
124
125
|
): ReadTool {
|
|
125
126
|
const temporaryResources = new TempResourceStore();
|
|
126
127
|
const resolvers: RegisteredResolver[] = [
|
|
@@ -150,18 +151,11 @@ export function createReadTool(
|
|
|
150
151
|
|
|
151
152
|
promptSnippet: "Read supported sources as text or bytes, with optional views",
|
|
152
153
|
get description(): string {
|
|
153
|
-
return
|
|
154
|
-
`Use read to inspect files, directories, URLs and supported sources without changing them. path selects the source; offset/limit select a text window; views add annotations. Text limit: ${READ_OUTPUT_MAX_LINES} lines or ${READ_OUTPUT_MAX_BYTES / 1024}KB. Continuation: returned offset, or returned temp: reference as path. Temporary references remain available until their owning runtime is disposed.`,
|
|
155
|
-
"Use raw:<local-file> to inspect original bytes without decoding or conversion, including PDFs and images. In raw: mode offset is a zero-based byte position (negative from EOF), limit is a non-negative byte count, and 0 reads no bytes. Output uses hexadecimal offsets, hex bytes and printable ASCII; dots stand for nonprintable bytes. Follow the returned byte offset to continue. Raw sources do not accept views or text anchors.",
|
|
156
|
-
pluginDescription?.() ?? "",
|
|
157
|
-
]
|
|
158
|
-
.filter(Boolean)
|
|
159
|
-
.join("\n");
|
|
154
|
+
return `Use read to inspect supported resources. path selects the source; offset and limit select a bounded window; views request source-specific presentations. Text output is limited to ${READ_OUTPUT_MAX_LINES} lines or ${READ_OUTPUT_MAX_BYTES / 1024}KB; follow a returned continuation offset or temp: reference when present.`;
|
|
160
155
|
},
|
|
161
156
|
get promptGuidelines(): string[] {
|
|
162
157
|
return [
|
|
163
|
-
"Use read to
|
|
164
|
-
"Use read with raw:<local-file> instead of xxd, od or hexdump when byte-level inspection is needed.",
|
|
158
|
+
"Use read to inspect supported sources and search to locate workspace content.",
|
|
165
159
|
...(pluginPromptGuidelines?.() ?? []),
|
|
166
160
|
];
|
|
167
161
|
},
|
|
@@ -172,7 +166,12 @@ export function createReadTool(
|
|
|
172
166
|
source === undefined
|
|
173
167
|
? undefined
|
|
174
168
|
: resolvers.find(({ matchesCall }) => matchesCall?.(source) === true)?.renderCall;
|
|
175
|
-
|
|
169
|
+
const mode = context.expanded ? "full" : presentation;
|
|
170
|
+
if (mode === "disabled") return new Text(theme.fg("toolTitle", "read"), 0, 0);
|
|
171
|
+
return (renderer ?? renderReadCall)(arguments_, theme, {
|
|
172
|
+
...context,
|
|
173
|
+
expanded: mode === "full",
|
|
174
|
+
});
|
|
176
175
|
},
|
|
177
176
|
renderResult(result, options, theme, context) {
|
|
178
177
|
const resolvedBy = result.details.resolvedBy;
|
|
@@ -180,7 +179,15 @@ export function createReadTool(
|
|
|
180
179
|
resolvedBy === undefined
|
|
181
180
|
? undefined
|
|
182
181
|
: resolvers.find(({ resolver }) => resolver.id === resolvedBy)?.renderResult;
|
|
183
|
-
|
|
182
|
+
const mode = options.expanded ? "full" : presentation;
|
|
183
|
+
if (mode === "disabled" && !context.isError && !options.isPartial)
|
|
184
|
+
return new Text(theme.fg("success", "✓ read"), 0, 0);
|
|
185
|
+
return (renderer ?? fallbackReadRenderer)(
|
|
186
|
+
result,
|
|
187
|
+
{ ...options, expanded: mode === "full" },
|
|
188
|
+
theme,
|
|
189
|
+
context,
|
|
190
|
+
);
|
|
184
191
|
},
|
|
185
192
|
async execute(_toolCallId, parameters, signal, _onUpdate, context) {
|
|
186
193
|
const resolverContext: ResourceResolverContext = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-search",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,24 +8,25 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./api/connect-plugin": {
|
|
10
10
|
"types": "./src/api/connect-plugin.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-47.js"
|
|
12
12
|
},
|
|
13
13
|
"./api/plugin-protocol": {
|
|
14
14
|
"types": "./src/api/plugin-protocol.ts",
|
|
15
|
-
"default": "./runtime/entry-
|
|
15
|
+
"default": "./runtime/entry-48.js"
|
|
16
16
|
},
|
|
17
17
|
"./api/search": {
|
|
18
18
|
"types": "./src/api/search.ts",
|
|
19
|
-
"default": "./runtime/entry-
|
|
19
|
+
"default": "./runtime/entry-49.js"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"pi-agent-
|
|
24
|
-
"pi-agent-tool-
|
|
23
|
+
"pi-agent-documentation": "0.6.2",
|
|
24
|
+
"pi-agent-tool-call-interception": "0.6.2",
|
|
25
|
+
"pi-agent-tool-ui": "0.6.2"
|
|
25
26
|
},
|
|
26
27
|
"pi": {
|
|
27
28
|
"extensions": [
|
|
28
|
-
"./runtime/entry-
|
|
29
|
+
"./runtime/entry-50.js"
|
|
29
30
|
]
|
|
30
31
|
},
|
|
31
32
|
"peerDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-search-text",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,23 +8,31 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./index.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-51.js"
|
|
12
12
|
},
|
|
13
13
|
"./search-session": {
|
|
14
14
|
"types": "./src/search-session.ts",
|
|
15
|
-
"default": "./runtime/entry-
|
|
15
|
+
"default": "./runtime/entry-52.js"
|
|
16
|
+
},
|
|
17
|
+
"./rendering": {
|
|
18
|
+
"types": "./src/search-renderer.ts",
|
|
19
|
+
"default": "./runtime/entry-53.js"
|
|
20
|
+
},
|
|
21
|
+
"./result": {
|
|
22
|
+
"types": "./src/search-result.ts",
|
|
23
|
+
"default": "./runtime/entry-54.js"
|
|
16
24
|
}
|
|
17
25
|
},
|
|
18
26
|
"dependencies": {
|
|
19
|
-
"pi-agent-doctor": "0.6.
|
|
20
|
-
"pi-agent-invariant": "0.6.
|
|
21
|
-
"pi-agent-search": "0.6.
|
|
22
|
-
"pi-agent-text": "0.6.
|
|
23
|
-
"pi-agent-text-editor": "0.6.
|
|
27
|
+
"pi-agent-doctor": "0.6.2",
|
|
28
|
+
"pi-agent-invariant": "0.6.2",
|
|
29
|
+
"pi-agent-search": "0.6.2",
|
|
30
|
+
"pi-agent-text": "0.6.2",
|
|
31
|
+
"pi-agent-text-editor": "0.6.2"
|
|
24
32
|
},
|
|
25
33
|
"pi": {
|
|
26
34
|
"extensions": [
|
|
27
|
-
"./runtime/entry-
|
|
35
|
+
"./runtime/entry-51.js"
|
|
28
36
|
]
|
|
29
37
|
},
|
|
30
38
|
"peerDependencies": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../../../../dist/entry-53.js";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { storeText, restoreText, type StoredText } from "pi-agent-text";
|
|
2
2
|
import type { SearchToolDetails, SearchResultFile, SearchResultRange } from "./search-result.js";
|
|
3
3
|
|
|
4
|
-
type StoredLine =
|
|
4
|
+
type StoredLine =
|
|
5
|
+
| readonly [number, StoredText, readonly SearchResultRange[]]
|
|
6
|
+
| readonly [number, StoredText, readonly SearchResultRange[], readonly string[]];
|
|
5
7
|
interface StoredSearchDetails extends Omit<SearchToolDetails, "files"> {
|
|
6
8
|
readonly storedFiles: readonly (Omit<SearchResultFile, "lines"> & {
|
|
7
9
|
readonly lines: readonly StoredLine[];
|
|
@@ -24,11 +26,10 @@ export function compactSearchDetails(
|
|
|
24
26
|
...rest,
|
|
25
27
|
storedFiles: files.map(({ lines, ...file }) => ({
|
|
26
28
|
...file,
|
|
27
|
-
lines: lines.map((line): StoredLine =>
|
|
28
|
-
line.lineNumber,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
]),
|
|
29
|
+
lines: lines.map((line): StoredLine => {
|
|
30
|
+
const stored = [line.lineNumber, storeText(line.text, source), line.ranges] as const;
|
|
31
|
+
return line.logicalMatchIds === undefined ? stored : [...stored, line.logicalMatchIds];
|
|
32
|
+
}),
|
|
32
33
|
})),
|
|
33
34
|
};
|
|
34
35
|
}
|
|
@@ -45,11 +46,12 @@ export function restoreSearchDetails(
|
|
|
45
46
|
...rest,
|
|
46
47
|
files: storedFiles.map(({ lines, ...file }) => ({
|
|
47
48
|
...file,
|
|
48
|
-
lines: lines.map(([lineNumber, text, ranges]) => ({
|
|
49
|
+
lines: lines.map(([lineNumber, text, ranges, logicalMatchIds]) => ({
|
|
49
50
|
lineNumber,
|
|
50
51
|
text: restoreText(text, source),
|
|
51
52
|
ranges,
|
|
52
53
|
matchCount: ranges.length,
|
|
54
|
+
...(logicalMatchIds === undefined ? {} : { logicalMatchIds }),
|
|
53
55
|
})),
|
|
54
56
|
})),
|
|
55
57
|
};
|
|
@@ -166,11 +166,17 @@ function searchViewport(details: SearchToolDetails, expanded: boolean): readonly
|
|
|
166
166
|
selected.pop();
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
const
|
|
170
|
-
(
|
|
171
|
-
0,
|
|
169
|
+
const shownIds = new Set(
|
|
170
|
+
selected.flatMap((row) => (row.kind === "line" ? (row.line.logicalMatchIds ?? []) : [])),
|
|
172
171
|
);
|
|
173
|
-
|
|
172
|
+
const shownMatches =
|
|
173
|
+
shownIds.size > 0
|
|
174
|
+
? shownIds.size
|
|
175
|
+
: selected.reduce((count, row) => count + (row.kind === "line" ? row.line.matchCount : 0), 0);
|
|
176
|
+
return [
|
|
177
|
+
...selected,
|
|
178
|
+
{ kind: "omitted", matches: Math.max(0, details.matchCount - shownMatches) },
|
|
179
|
+
];
|
|
174
180
|
}
|
|
175
181
|
|
|
176
182
|
function compactRenderedRows(
|
|
@@ -14,6 +14,7 @@ export interface SearchResultLine {
|
|
|
14
14
|
readonly text: string;
|
|
15
15
|
readonly matchCount: number;
|
|
16
16
|
readonly ranges: readonly SearchResultRange[];
|
|
17
|
+
readonly logicalMatchIds?: readonly string[];
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
export interface SearchResultGroup {
|
|
@@ -155,6 +156,7 @@ function isSearchResultFile(value: unknown): value is SearchResultFile {
|
|
|
155
156
|
|
|
156
157
|
const lines = value.lines as readonly SearchResultLine[];
|
|
157
158
|
const groups = value.groups;
|
|
159
|
+
const logicalMatchIds = new Set(lines.flatMap((line) => line.logicalMatchIds ?? []));
|
|
158
160
|
return (
|
|
159
161
|
(groups === undefined ||
|
|
160
162
|
(Array.isArray(groups) &&
|
|
@@ -163,7 +165,9 @@ function isSearchResultFile(value: unknown): value is SearchResultFile {
|
|
|
163
165
|
))) &&
|
|
164
166
|
(value.uniqueLineCount === undefined || isCount(value.uniqueLineCount)) &&
|
|
165
167
|
(lines.length === 0 ||
|
|
166
|
-
|
|
168
|
+
(logicalMatchIds.size > 0
|
|
169
|
+
? logicalMatchIds.size === value.matchCount
|
|
170
|
+
: value.matchCount === lines.reduce((count, line) => count + line.matchCount, 0)))
|
|
167
171
|
);
|
|
168
172
|
}
|
|
169
173
|
|
|
@@ -176,6 +180,9 @@ function isSearchResultLine(value: unknown): value is SearchResultLine {
|
|
|
176
180
|
isCount(value.matchCount) &&
|
|
177
181
|
Array.isArray(value.ranges) &&
|
|
178
182
|
value.ranges.length === value.matchCount &&
|
|
183
|
+
(value.logicalMatchIds === undefined ||
|
|
184
|
+
(Array.isArray(value.logicalMatchIds) &&
|
|
185
|
+
value.logicalMatchIds.every((id) => typeof id === "string"))) &&
|
|
179
186
|
value.ranges.every((range) => isSearchResultRange(range, value.text as string))
|
|
180
187
|
);
|
|
181
188
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../../dist/entry-48.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../../dist/entry-49.js";
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
type ToolRenderResultOptions,
|
|
7
7
|
} from "@earendil-works/pi-coding-agent";
|
|
8
8
|
import { type Component, Text } from "@earendil-works/pi-tui";
|
|
9
|
+
import { connectAgentDocumentation, loadPackagedAgentGuide } from "pi-agent-documentation";
|
|
9
10
|
import {
|
|
10
11
|
toolCallHeader,
|
|
11
12
|
type ToolCallHeaderDetail,
|
|
@@ -73,7 +74,24 @@ export function searchCallModel(
|
|
|
73
74
|
};
|
|
74
75
|
}
|
|
75
76
|
|
|
76
|
-
|
|
77
|
+
function parsePresentation(value: string | undefined): "full" | "compact" | "disabled" {
|
|
78
|
+
return value === "full" || value === "disabled" ? value : "compact";
|
|
79
|
+
}
|
|
80
|
+
export default async function registerSearchCore(
|
|
81
|
+
pi: ExtensionAPI,
|
|
82
|
+
context?: { readonly preferences: Readonly<Record<string, string>> },
|
|
83
|
+
): Promise<void> {
|
|
84
|
+
const presentation = parsePresentation(context?.preferences["ui.search"]);
|
|
85
|
+
connectAgentDocumentation(pi, [
|
|
86
|
+
await loadPackagedAgentGuide({
|
|
87
|
+
id: "search-code",
|
|
88
|
+
description: "Text search, AST patterns, symbols, graphs, and semantic rename",
|
|
89
|
+
triggers: [
|
|
90
|
+
{ tool: "search" },
|
|
91
|
+
{ tool: "read", resourcePrefixes: ["ast:", "symbol:", "symbols:", "graph:"] },
|
|
92
|
+
],
|
|
93
|
+
}),
|
|
94
|
+
]);
|
|
77
95
|
const core = createSearchCore();
|
|
78
96
|
const interceptionRendering = new ToolCallInterceptionRenderStore();
|
|
79
97
|
const unsubscribe = pi.events.on(SEARCH_PLUGIN_REGISTER_EVENT, (request) => {
|
|
@@ -89,12 +107,7 @@ export default async function registerSearchCore(pi: ExtensionAPI): Promise<void
|
|
|
89
107
|
{
|
|
90
108
|
name: "search",
|
|
91
109
|
label: "search",
|
|
92
|
-
|
|
93
|
-
return [
|
|
94
|
-
"Use search to locate text, file paths and code structures in the workspace.",
|
|
95
|
-
...core.renderDescriptions(),
|
|
96
|
-
].join("\n");
|
|
97
|
-
},
|
|
110
|
+
description: "Use search to locate workspace text, file paths, and code structures.",
|
|
98
111
|
promptSnippet:
|
|
99
112
|
"Search files and text with literals or regular expressions, plus syntax trees and language symbols",
|
|
100
113
|
get promptGuidelines(): string[] {
|
|
@@ -104,14 +117,20 @@ export default async function registerSearchCore(pi: ExtensionAPI): Promise<void
|
|
|
104
117
|
];
|
|
105
118
|
},
|
|
106
119
|
parameters: searchSchema,
|
|
107
|
-
renderCall(arguments_, theme,
|
|
120
|
+
renderCall(arguments_, theme, renderContext): Component {
|
|
121
|
+
const mode = renderContext.expanded ? "full" : presentation;
|
|
122
|
+
if (mode === "disabled") return new Text(theme.fg("toolTitle", "search"), 0, 0);
|
|
108
123
|
return toolCallHeader(
|
|
109
|
-
|
|
110
|
-
searchCallModel(arguments_,
|
|
124
|
+
renderContext.lastComponent,
|
|
125
|
+
searchCallModel(arguments_, mode === "full"),
|
|
111
126
|
theme,
|
|
112
127
|
);
|
|
113
128
|
},
|
|
114
129
|
renderResult(result, options, theme, context): Component {
|
|
130
|
+
const mode = options.expanded ? "full" : presentation;
|
|
131
|
+
if (mode === "disabled" && !context.isError && !options.isPartial)
|
|
132
|
+
return new Text(theme.fg("success", "✓ search"), 0, 0);
|
|
133
|
+
options = { ...options, expanded: mode === "full" };
|
|
115
134
|
const details = result.details as SearchToolDetails | undefined;
|
|
116
135
|
const renderer =
|
|
117
136
|
details?.resolverId === undefined ? undefined : core.renderer(details.resolverId);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { connectAgentDocumentation, loadPackagedAgentGuide } from "pi-agent-documentation";
|
|
2
3
|
|
|
3
4
|
import { registerBuiltinEditFilter } from "./src/core/builtin-edit-filter.js";
|
|
4
5
|
import registerTextEditorCore from "./src/core/extension.js";
|
|
@@ -6,6 +7,20 @@ import { registerTextEditBatching } from "./src/core/text-edit-batch-registrar.j
|
|
|
6
7
|
import { registerTextEditorTools } from "./src/tools/extension.js";
|
|
7
8
|
|
|
8
9
|
export default async function registerTextEditor(pi: ExtensionAPI): Promise<void> {
|
|
10
|
+
connectAgentDocumentation(pi, [
|
|
11
|
+
await loadPackagedAgentGuide({
|
|
12
|
+
id: "apply",
|
|
13
|
+
description: "Guarded Apply scripting, selections, transactions, and file operations",
|
|
14
|
+
triggers: [{ tool: "apply" }],
|
|
15
|
+
}),
|
|
16
|
+
await loadPackagedAgentGuide({
|
|
17
|
+
id: "editing",
|
|
18
|
+
description: "Precise standalone text and file edits",
|
|
19
|
+
triggers: ["write", "replace", "insert", "delete", "copy", "move", "diff"].map((tool) => ({
|
|
20
|
+
tool,
|
|
21
|
+
})),
|
|
22
|
+
}),
|
|
23
|
+
]);
|
|
9
24
|
const core = await registerTextEditorCore(pi);
|
|
10
25
|
registerBuiltinEditFilter(pi);
|
|
11
26
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-editor",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,67 +8,67 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./api/apply-renderer": {
|
|
10
10
|
"types": "./src/api/apply-renderer.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-61.js"
|
|
12
12
|
},
|
|
13
13
|
"./api/anchor-inspection": {
|
|
14
14
|
"types": "./src/api/anchor-inspection.ts",
|
|
15
|
-
"default": "./runtime/entry-
|
|
15
|
+
"default": "./runtime/entry-62.js"
|
|
16
16
|
},
|
|
17
17
|
"./api/connect-plugin": {
|
|
18
18
|
"types": "./src/api/connect-plugin.ts",
|
|
19
|
-
"default": "./runtime/entry-
|
|
19
|
+
"default": "./runtime/entry-63.js"
|
|
20
20
|
},
|
|
21
21
|
"./api/edit-completion": {
|
|
22
22
|
"types": "./src/api/edit-completion.ts",
|
|
23
|
-
"default": "./runtime/entry-
|
|
23
|
+
"default": "./runtime/entry-64.js"
|
|
24
24
|
},
|
|
25
25
|
"./api/edit-pipeline": {
|
|
26
26
|
"types": "./src/api/edit-pipeline.ts",
|
|
27
|
-
"default": "./runtime/entry-
|
|
27
|
+
"default": "./runtime/entry-65.js"
|
|
28
28
|
},
|
|
29
29
|
"./api/plugin-protocol": {
|
|
30
30
|
"types": "./src/api/plugin-protocol.ts",
|
|
31
|
-
"default": "./runtime/entry-
|
|
31
|
+
"default": "./runtime/entry-66.js"
|
|
32
32
|
},
|
|
33
33
|
"./api/stale-anchor-message": {
|
|
34
34
|
"types": "./src/api/stale-anchor-message.ts",
|
|
35
|
-
"default": "./runtime/entry-
|
|
35
|
+
"default": "./runtime/entry-67.js"
|
|
36
36
|
},
|
|
37
37
|
"./api/text-selection-anchor": {
|
|
38
38
|
"types": "./src/api/text-selection-anchor.ts",
|
|
39
|
-
"default": "./runtime/entry-
|
|
39
|
+
"default": "./runtime/entry-68.js"
|
|
40
40
|
},
|
|
41
41
|
"./api/post-edit": {
|
|
42
42
|
"types": "./src/api/post-edit.ts",
|
|
43
|
-
"default": "./runtime/entry-
|
|
43
|
+
"default": "./runtime/entry-69.js"
|
|
44
44
|
},
|
|
45
45
|
"./api/mutation-result": {
|
|
46
46
|
"types": "./src/api/mutation-result.ts",
|
|
47
|
-
"default": "./runtime/entry-
|
|
47
|
+
"default": "./runtime/entry-70.js"
|
|
48
48
|
},
|
|
49
49
|
"./api/mutation-guard": {
|
|
50
50
|
"types": "./src/api/mutation-guard.ts",
|
|
51
|
-
"default": "./runtime/entry-
|
|
51
|
+
"default": "./runtime/entry-71.js"
|
|
52
52
|
},
|
|
53
53
|
"./api/mutation-tool": {
|
|
54
54
|
"types": "./src/api/mutation-tool.ts",
|
|
55
|
-
"default": "./runtime/entry-
|
|
55
|
+
"default": "./runtime/entry-72.js"
|
|
56
56
|
},
|
|
57
57
|
"./api/mutation-preview": {
|
|
58
58
|
"types": "./src/api/mutation-preview.ts",
|
|
59
|
-
"default": "./runtime/entry-
|
|
59
|
+
"default": "./runtime/entry-73.js"
|
|
60
60
|
},
|
|
61
61
|
"./api/last-resolved-resource": {
|
|
62
62
|
"types": "./src/api/last-resolved-resource.ts",
|
|
63
|
-
"default": "./runtime/entry-
|
|
63
|
+
"default": "./runtime/entry-74.js"
|
|
64
64
|
},
|
|
65
65
|
"./api/tool-call-interceptor": {
|
|
66
66
|
"types": "./src/api/tool-call-interceptor.ts",
|
|
67
|
-
"default": "./runtime/entry-
|
|
67
|
+
"default": "./runtime/entry-75.js"
|
|
68
68
|
},
|
|
69
69
|
"./api/tool-renderer": {
|
|
70
70
|
"types": "./src/api/tool-renderer.ts",
|
|
71
|
-
"default": "./runtime/entry-
|
|
71
|
+
"default": "./runtime/entry-76.js"
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
@@ -79,19 +79,20 @@
|
|
|
79
79
|
"fs-extra": "^11.4.0",
|
|
80
80
|
"oxfmt": "0.64.0",
|
|
81
81
|
"partial-json": "^0.1.7",
|
|
82
|
-
"pi-agent-
|
|
83
|
-
"pi-agent-
|
|
84
|
-
"pi-agent-
|
|
85
|
-
"pi-agent-
|
|
86
|
-
"pi-agent-
|
|
87
|
-
"pi-agent-
|
|
88
|
-
"pi-agent-tool-
|
|
82
|
+
"pi-agent-documentation": "0.6.2",
|
|
83
|
+
"pi-agent-invariant": "0.6.2",
|
|
84
|
+
"pi-agent-read": "0.6.2",
|
|
85
|
+
"pi-agent-resource": "0.6.2",
|
|
86
|
+
"pi-agent-search": "0.6.2",
|
|
87
|
+
"pi-agent-text": "0.6.2",
|
|
88
|
+
"pi-agent-tool-call-interception": "0.6.2",
|
|
89
|
+
"pi-agent-tool-ui": "0.6.2",
|
|
89
90
|
"run": "2.1.4",
|
|
90
91
|
"typebox-guard": "npm:typebox@^1.1.38"
|
|
91
92
|
},
|
|
92
93
|
"pi": {
|
|
93
94
|
"extensions": [
|
|
94
|
-
"./runtime/entry-
|
|
95
|
+
"./runtime/entry-77.js"
|
|
95
96
|
]
|
|
96
97
|
},
|
|
97
98
|
"peerDependencies": {
|
package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-anchor-constant",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"pi-agent-text": "0.6.
|
|
10
|
-
"pi-agent-text-editor": "0.6.
|
|
9
|
+
"pi-agent-text": "0.6.2",
|
|
10
|
+
"pi-agent-text-editor": "0.6.2"
|
|
11
11
|
},
|
|
12
12
|
"pi": {
|
|
13
13
|
"extensions": [
|
|
14
|
-
"./runtime/entry-
|
|
14
|
+
"./runtime/entry-56.js"
|
|
15
15
|
]
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-anchor-exact",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,17 +8,17 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./api/anchor": {
|
|
10
10
|
"types": "./src/anchor.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-57.js"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"fast-fuzzy": "1.12.0",
|
|
16
|
-
"pi-agent-text": "0.6.
|
|
17
|
-
"pi-agent-text-editor": "0.6.
|
|
16
|
+
"pi-agent-text": "0.6.2",
|
|
17
|
+
"pi-agent-text-editor": "0.6.2"
|
|
18
18
|
},
|
|
19
19
|
"pi": {
|
|
20
20
|
"extensions": [
|
|
21
|
-
"./runtime/entry-
|
|
21
|
+
"./runtime/entry-58.js"
|
|
22
22
|
]
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-57.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../../../../dist/entry-57.js";
|