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
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
|
|
4
|
+
import type {
|
|
5
|
+
SearchResultFile,
|
|
6
|
+
SearchResultLine,
|
|
7
|
+
SearchResultRange,
|
|
8
|
+
SearchToolDetails,
|
|
9
|
+
} from "pi-agent-search-text/result";
|
|
10
|
+
|
|
11
|
+
export interface AstSearchPresentationMatch {
|
|
12
|
+
readonly file: string;
|
|
13
|
+
readonly lines: string;
|
|
14
|
+
readonly range: {
|
|
15
|
+
readonly start: { readonly line: number; readonly column: number };
|
|
16
|
+
readonly end: { readonly line: number; readonly column: number };
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Build ordinary grouped search presentation data without changing AST selection details. */
|
|
21
|
+
export function createAstSearchPresentation(
|
|
22
|
+
query: string,
|
|
23
|
+
matches: readonly AstSearchPresentationMatch[],
|
|
24
|
+
complete: boolean,
|
|
25
|
+
cwd: string,
|
|
26
|
+
sessionId: string,
|
|
27
|
+
): SearchToolDetails {
|
|
28
|
+
const grouped = new Map<string, AstSearchPresentationMatch[]>();
|
|
29
|
+
for (const match of matches) {
|
|
30
|
+
const current = grouped.get(match.file) ?? [];
|
|
31
|
+
current.push(match);
|
|
32
|
+
grouped.set(match.file, current);
|
|
33
|
+
}
|
|
34
|
+
const files = [...grouped.entries()].map(([file, fileMatches]) =>
|
|
35
|
+
createFilePresentation(file, fileMatches, cwd),
|
|
36
|
+
);
|
|
37
|
+
return {
|
|
38
|
+
sessionId,
|
|
39
|
+
query,
|
|
40
|
+
matchCount: matches.length,
|
|
41
|
+
fileCount: files.length,
|
|
42
|
+
complete,
|
|
43
|
+
files,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function createFilePresentation(
|
|
48
|
+
file: string,
|
|
49
|
+
matches: readonly AstSearchPresentationMatch[],
|
|
50
|
+
cwd: string,
|
|
51
|
+
): SearchResultFile {
|
|
52
|
+
const lines = new Map<
|
|
53
|
+
number,
|
|
54
|
+
{ text: string; ranges: SearchResultRange[]; logicalMatchIds: string[] }
|
|
55
|
+
>();
|
|
56
|
+
matches.forEach((match, matchIndex) => {
|
|
57
|
+
const texts = match.lines.replace(/\r/gu, "").split("\n");
|
|
58
|
+
if (texts.at(-1) === "") texts.pop();
|
|
59
|
+
const logicalId = `${file}:${String(matchIndex)}`;
|
|
60
|
+
texts.forEach((text, index) => {
|
|
61
|
+
const lineNumber = match.range.start.line + index + 1;
|
|
62
|
+
const range = highlightedRange(match, text, index, texts.length);
|
|
63
|
+
if (range === undefined) return;
|
|
64
|
+
const current = lines.get(lineNumber) ?? { text, ranges: [], logicalMatchIds: [] };
|
|
65
|
+
current.ranges.push(range);
|
|
66
|
+
current.logicalMatchIds.push(logicalId);
|
|
67
|
+
lines.set(lineNumber, current);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
const resultLines: SearchResultLine[] = [...lines.entries()]
|
|
71
|
+
.sort(([left], [right]) => left - right)
|
|
72
|
+
.map(([lineNumber, line]) => {
|
|
73
|
+
const ranges = mergeRanges(line.ranges);
|
|
74
|
+
return {
|
|
75
|
+
lineNumber,
|
|
76
|
+
text: line.text,
|
|
77
|
+
matchCount: ranges.length,
|
|
78
|
+
ranges,
|
|
79
|
+
logicalMatchIds: [...new Set(line.logicalMatchIds)],
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
const source = path.resolve(cwd, file);
|
|
83
|
+
return {
|
|
84
|
+
path: path.relative(cwd, source),
|
|
85
|
+
link: pathToFileURL(source).href,
|
|
86
|
+
matchCount: matches.length,
|
|
87
|
+
lines: resultLines,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function highlightedRange(
|
|
92
|
+
match: AstSearchPresentationMatch,
|
|
93
|
+
text: string,
|
|
94
|
+
index: number,
|
|
95
|
+
lineCount: number,
|
|
96
|
+
): SearchResultRange | undefined {
|
|
97
|
+
const first = index === 0;
|
|
98
|
+
const last = index === lineCount - 1;
|
|
99
|
+
const from = first ? match.range.start.column : 0;
|
|
100
|
+
const to = last ? match.range.end.column : text.length;
|
|
101
|
+
if (to <= from) return undefined;
|
|
102
|
+
return { from: Math.min(from, text.length), to: Math.min(to, text.length) };
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function mergeRanges(ranges: readonly SearchResultRange[]): SearchResultRange[] {
|
|
106
|
+
const sorted = [...ranges].sort((left, right) => left.from - right.from || left.to - right.to);
|
|
107
|
+
const merged: SearchResultRange[] = [];
|
|
108
|
+
for (const range of sorted) {
|
|
109
|
+
const previous = merged.at(-1);
|
|
110
|
+
if (previous === undefined || range.from > previous.to) {
|
|
111
|
+
merged.push(range);
|
|
112
|
+
} else {
|
|
113
|
+
merged[merged.length - 1] = { from: previous.from, to: Math.max(previous.to, range.to) };
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return merged;
|
|
117
|
+
}
|
|
@@ -5,6 +5,9 @@ import path from "node:path";
|
|
|
5
5
|
import type { SearchPluginApi, SearchSelectionMatch } from "pi-agent-search/api/search";
|
|
6
6
|
|
|
7
7
|
import type { SearchRequest, SearchResolver } from "pi-agent-search/api/search";
|
|
8
|
+
import { renderSearchResult } from "pi-agent-search-text/rendering";
|
|
9
|
+
|
|
10
|
+
import { createAstSearchPresentation } from "./search-presentation.js";
|
|
8
11
|
|
|
9
12
|
interface AstGrepMatch {
|
|
10
13
|
readonly text: string;
|
|
@@ -24,6 +27,7 @@ export function createAstSearchResolver(
|
|
|
24
27
|
): SearchResolver {
|
|
25
28
|
return {
|
|
26
29
|
id: "ast",
|
|
30
|
+
renderResult: renderSearchResult as SearchResolver["renderResult"],
|
|
27
31
|
async tryResolve(request, context) {
|
|
28
32
|
if (!request.query.startsWith("ast:")) {
|
|
29
33
|
return { kind: "not-handled" };
|
|
@@ -65,6 +69,13 @@ export function createAstSearchResolver(
|
|
|
65
69
|
})),
|
|
66
70
|
complete: selected.complete,
|
|
67
71
|
sessionId: session.id,
|
|
72
|
+
presentation: createAstSearchPresentation(
|
|
73
|
+
request.query,
|
|
74
|
+
selected.raw,
|
|
75
|
+
selected.complete,
|
|
76
|
+
context.cwd,
|
|
77
|
+
session.id,
|
|
78
|
+
),
|
|
68
79
|
},
|
|
69
80
|
};
|
|
70
81
|
},
|
|
@@ -74,10 +85,14 @@ export function createAstSearchResolver(
|
|
|
74
85
|
readonly sessionId: string;
|
|
75
86
|
readonly matches: readonly AstGrepMatch[];
|
|
76
87
|
readonly complete: boolean;
|
|
88
|
+
readonly presentation: unknown;
|
|
77
89
|
};
|
|
78
90
|
|
|
79
91
|
if (result.matches.length === 0) {
|
|
80
|
-
return {
|
|
92
|
+
return {
|
|
93
|
+
content: [{ type: "text", text: "No AST matches found." }],
|
|
94
|
+
details: result.presentation,
|
|
95
|
+
};
|
|
81
96
|
}
|
|
82
97
|
|
|
83
98
|
const lines = result.matches.flatMap((match, index) => [
|
|
@@ -93,7 +108,10 @@ export function createAstSearchResolver(
|
|
|
93
108
|
lines.push("Result limit reached.");
|
|
94
109
|
}
|
|
95
110
|
|
|
96
|
-
return {
|
|
111
|
+
return {
|
|
112
|
+
content: [{ type: "text", text: lines.join("\n") }],
|
|
113
|
+
details: result.presentation,
|
|
114
|
+
};
|
|
97
115
|
},
|
|
98
116
|
};
|
|
99
117
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Value } from "typebox/value";
|
|
2
2
|
import { type ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
3
|
+
import { connectAgentDocumentation, loadPackagedAgentGuide } from "pi-agent-documentation";
|
|
3
4
|
import { connectDoctorPlugin } from "pi-agent-doctor/api/connect-plugin";
|
|
4
5
|
import { connectReadPlugin } from "pi-agent-read/api/connect-plugin";
|
|
5
6
|
import {
|
|
@@ -28,6 +29,13 @@ import {
|
|
|
28
29
|
import { createUndoMutationTool } from "#src/tool-text-undo.js";
|
|
29
30
|
|
|
30
31
|
export default async function registerGitChanges(pi: ExtensionAPI): Promise<void> {
|
|
32
|
+
connectAgentDocumentation(pi, [
|
|
33
|
+
await loadPackagedAgentGuide({
|
|
34
|
+
id: "git-changes",
|
|
35
|
+
description: "Git change anchors, staging, and safe undo",
|
|
36
|
+
triggers: ["stage", "unstage", "undo"].map((tool) => ({ tool })),
|
|
37
|
+
}),
|
|
38
|
+
]);
|
|
31
39
|
const executor = extensionGitExecutor(pi);
|
|
32
40
|
const transactions = new LastTextTransactionStore();
|
|
33
41
|
const indexQueue = new IndexMutationQueue();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-changes",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,20 +8,21 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./changes/change-groups": {
|
|
10
10
|
"types": "./src/changes/change-groups.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-32.js"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"diff": "^9.0.0",
|
|
16
|
-
"pi-agent-doctor": "0.6.
|
|
17
|
-
"pi-agent-
|
|
18
|
-
"pi-agent-
|
|
19
|
-
"pi-agent-
|
|
20
|
-
"pi-agent-text
|
|
16
|
+
"pi-agent-doctor": "0.6.2",
|
|
17
|
+
"pi-agent-documentation": "0.6.2",
|
|
18
|
+
"pi-agent-invariant": "0.6.2",
|
|
19
|
+
"pi-agent-read": "0.6.2",
|
|
20
|
+
"pi-agent-text": "0.6.2",
|
|
21
|
+
"pi-agent-text-editor": "0.6.2"
|
|
21
22
|
},
|
|
22
23
|
"pi": {
|
|
23
24
|
"extensions": [
|
|
24
|
-
"./runtime/entry-
|
|
25
|
+
"./runtime/entry-33.js"
|
|
25
26
|
]
|
|
26
27
|
},
|
|
27
28
|
"peerDependencies": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../../dist/entry-32.js";
|
|
@@ -3,6 +3,7 @@ import { access } from "node:fs/promises";
|
|
|
3
3
|
|
|
4
4
|
import { StringEnum } from "@earendil-works/pi-ai";
|
|
5
5
|
import { defineTool, type ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
6
|
+
import { connectAgentDocumentation, loadPackagedAgentGuide } from "pi-agent-documentation";
|
|
6
7
|
import { Type } from "typebox";
|
|
7
8
|
import { connectDoctorPlugin } from "pi-agent-doctor/api/connect-plugin";
|
|
8
9
|
import { connectReadPlugin } from "pi-agent-read/api/connect-plugin";
|
|
@@ -32,7 +33,10 @@ import {
|
|
|
32
33
|
renderDebugCall,
|
|
33
34
|
renderDebugResult,
|
|
34
35
|
} from "#src/plugins/pi-agent-ide-debugger/src/renderer.js";
|
|
35
|
-
import {
|
|
36
|
+
import {
|
|
37
|
+
debuggerEvaluationFromResult,
|
|
38
|
+
debuggerSnapshotFromResult,
|
|
39
|
+
} from "#src/plugins/pi-agent-ide-debugger/src/ui.js";
|
|
36
40
|
import { debuggerProcessProvider } from "#src/plugins/pi-agent-ide-debugger/src/process-provider.js";
|
|
37
41
|
import { agentIdeProcessRegistry } from "#src/plugins/pi-agent-ide-processes/src/registry.js";
|
|
38
42
|
|
|
@@ -69,6 +73,7 @@ interface DebugToolDetails {
|
|
|
69
73
|
import {
|
|
70
74
|
DebugSessionManager,
|
|
71
75
|
renderDebugSession,
|
|
76
|
+
type DebugEvaluation,
|
|
72
77
|
type DebugSession,
|
|
73
78
|
} from "#src/plugins/pi-agent-ide-debugger/src/session-manager.js";
|
|
74
79
|
|
|
@@ -125,9 +130,21 @@ const debugParameters = Type.Object(
|
|
|
125
130
|
|
|
126
131
|
/** Register agent-native debug sessions backed by Debug Adapter Protocol adapters. */
|
|
127
132
|
export default async function registerDebugger(pi: ExtensionAPI): Promise<void> {
|
|
133
|
+
connectAgentDocumentation(pi, [
|
|
134
|
+
await loadPackagedAgentGuide({
|
|
135
|
+
id: "debugger",
|
|
136
|
+
description: "Debugger sessions, breakpoints, stepping, and cleanup",
|
|
137
|
+
triggers: [
|
|
138
|
+
{ tool: "debug" },
|
|
139
|
+
...["read", "insert", "delete"].map((tool) => ({ tool, resourcePrefixes: ["debug:"] })),
|
|
140
|
+
],
|
|
141
|
+
}),
|
|
142
|
+
]);
|
|
143
|
+
const retainedManager = takeReloadResource("debugger") as DebugSessionManager | undefined;
|
|
128
144
|
const manager =
|
|
129
|
-
|
|
130
|
-
|
|
145
|
+
retainedManager !== undefined && typeof retainedManager.evaluate === "function"
|
|
146
|
+
? retainedManager
|
|
147
|
+
: new DebugSessionManager();
|
|
131
148
|
const deletedSnapshots = new Map<string, ReturnType<DebugSessionManager["snapshot"]>>();
|
|
132
149
|
const readResolver = createDebugResourceResolver(manager, "debugger-source");
|
|
133
150
|
const editorResolver = createDebugResourceResolver(manager, "debugger-input");
|
|
@@ -175,10 +192,7 @@ export default async function registerDebugger(pi: ExtensionAPI): Promise<void>
|
|
|
175
192
|
});
|
|
176
193
|
api.addView({ view: "breakpoints", presenter: breakpointPresenter });
|
|
177
194
|
api.describe(
|
|
178
|
-
'views: ["breakpoints"] —
|
|
179
|
-
);
|
|
180
|
-
api.addPromptGuideline(
|
|
181
|
-
'Use views: ["breakpoints"] when current breakpoint locations matter. Create a debug session with debug. Read the returned debug source to get current anchors, insert text "breakpoint" at one source anchor, then insert "start" on the session. Use read for the latest stop and delete for a breakpoint or the session.',
|
|
195
|
+
'views: ["breakpoints"] — current debugger breakpoints beside source lines. Normal files include every current session; debug sources are session-scoped. debug:<session> — debugger state.',
|
|
182
196
|
);
|
|
183
197
|
},
|
|
184
198
|
} satisfies ReadPlugin;
|
|
@@ -223,11 +237,19 @@ export default async function registerDebugger(pi: ExtensionAPI): Promise<void>
|
|
|
223
237
|
if (parameters.path !== session.source || parameters.anchor !== undefined) {
|
|
224
238
|
throw new Error("Debug commands target the session resource without an anchor");
|
|
225
239
|
}
|
|
226
|
-
await executeSessionCommand(
|
|
240
|
+
const evaluation = await executeSessionCommand(
|
|
241
|
+
manager,
|
|
242
|
+
session,
|
|
243
|
+
parameters.text,
|
|
244
|
+
context.signal,
|
|
245
|
+
);
|
|
227
246
|
return {
|
|
228
247
|
source: session.source,
|
|
229
|
-
summary:
|
|
230
|
-
|
|
248
|
+
summary:
|
|
249
|
+
evaluation === undefined
|
|
250
|
+
? renderDebugSession(session)
|
|
251
|
+
: `${evaluation.expression} = ${evaluation.result}${evaluation.type === undefined ? "" : ` (${evaluation.type})`}`,
|
|
252
|
+
data: debugActionData(manager, session, parameters.text, evaluation),
|
|
231
253
|
};
|
|
232
254
|
},
|
|
233
255
|
});
|
|
@@ -255,7 +277,7 @@ export default async function registerDebugger(pi: ExtensionAPI): Promise<void>
|
|
|
255
277
|
},
|
|
256
278
|
});
|
|
257
279
|
api.describe(
|
|
258
|
-
'For debug:<session> resources, insert performs debugger actions without changing source text. On a debug source, insert "breakpoint" at an anchor. On the session, insert start, continue, step over, step into,
|
|
280
|
+
'For debug:<session> resources, insert performs debugger actions without changing source text. On a debug source, insert "breakpoint" at an anchor. On the session, insert start, continue, step over, step into, step out, or evaluate <expression>. Delete removes a breakpoint or terminates the session.',
|
|
259
281
|
);
|
|
260
282
|
for (const tool of ["insert", "delete"] as const) {
|
|
261
283
|
api.addToolRenderer({
|
|
@@ -306,7 +328,8 @@ export default async function registerDebugger(pi: ExtensionAPI): Promise<void>
|
|
|
306
328
|
renderResult(result, options, theme) {
|
|
307
329
|
const snapshot = debuggerSnapshotFromResult(result.details);
|
|
308
330
|
if (snapshot === undefined) throw new Error("Debugger result is missing its session");
|
|
309
|
-
|
|
331
|
+
const evaluation = debuggerEvaluationFromResult(result.details);
|
|
332
|
+
return renderDebugResult(snapshot, options.expanded, theme, evaluation);
|
|
310
333
|
},
|
|
311
334
|
});
|
|
312
335
|
}
|
|
@@ -457,8 +480,13 @@ async function executeSessionCommand(
|
|
|
457
480
|
session: DebugSession,
|
|
458
481
|
command: string,
|
|
459
482
|
signal?: AbortSignal,
|
|
460
|
-
): Promise<
|
|
461
|
-
|
|
483
|
+
): Promise<DebugEvaluation | undefined> {
|
|
484
|
+
const trimmed = command.trim();
|
|
485
|
+
const evaluation = /^evaluate\s+(.+)$/isu.exec(trimmed);
|
|
486
|
+
if (evaluation !== null) {
|
|
487
|
+
return await manager.evaluate(session, evaluation[1] as string, signal);
|
|
488
|
+
}
|
|
489
|
+
switch (trimmed.toLowerCase()) {
|
|
462
490
|
case "start": {
|
|
463
491
|
await manager.start(session, signal);
|
|
464
492
|
return;
|
|
@@ -509,6 +537,7 @@ function debugActionData(
|
|
|
509
537
|
manager: DebugSessionManager,
|
|
510
538
|
session: DebugSession,
|
|
511
539
|
command: string,
|
|
540
|
+
evaluation?: DebugEvaluation,
|
|
512
541
|
): Readonly<Record<string, unknown>> {
|
|
513
542
|
return {
|
|
514
543
|
kind: "debug-command",
|
|
@@ -521,6 +550,7 @@ function debugActionData(
|
|
|
521
550
|
verified,
|
|
522
551
|
})),
|
|
523
552
|
...(session.stop === undefined ? {} : { stop: session.stop }),
|
|
553
|
+
...(evaluation === undefined ? {} : { evaluation }),
|
|
524
554
|
snapshot: manager.snapshot(session),
|
|
525
555
|
};
|
|
526
556
|
}
|
|
@@ -4,6 +4,7 @@ import type { Theme, ThemeColor } from "@earendil-works/pi-coding-agent";
|
|
|
4
4
|
import { Text, type Component } from "@earendil-works/pi-tui";
|
|
5
5
|
|
|
6
6
|
import type {
|
|
7
|
+
DebugEvaluation,
|
|
7
8
|
DebugSessionSnapshot,
|
|
8
9
|
DebugSessionStatus,
|
|
9
10
|
DebugStop,
|
|
@@ -43,8 +44,15 @@ export function renderDebugResult(
|
|
|
43
44
|
snapshot: DebugSessionSnapshot,
|
|
44
45
|
expanded: boolean,
|
|
45
46
|
theme: DebugTheme,
|
|
47
|
+
evaluation?: DebugEvaluation,
|
|
46
48
|
): Component {
|
|
47
|
-
|
|
49
|
+
const lines = debugResultLines(snapshot, expanded, theme);
|
|
50
|
+
if (evaluation !== undefined) {
|
|
51
|
+
lines.unshift(
|
|
52
|
+
`${theme.fg("accent", evaluation.expression)} ${theme.fg("muted", "=")} ${theme.fg("toolOutput", evaluation.result)}${evaluation.type === undefined ? "" : theme.fg("dim", ` ${evaluation.type}`)}`,
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
return new Text(lines.join("\n"), 0, 0);
|
|
48
56
|
}
|
|
49
57
|
|
|
50
58
|
/** Render one compact live session for the below-editor activity widget. */
|
|
@@ -122,6 +130,7 @@ function actionLabel(action: string): string {
|
|
|
122
130
|
if (normalized === "step over") return "↷ step over";
|
|
123
131
|
if (normalized === "step into") return "↓ step into";
|
|
124
132
|
if (normalized === "step out") return "↑ step out";
|
|
133
|
+
if (normalized.startsWith("evaluate ")) return `◆ ${action.trim().slice("evaluate ".length)}`;
|
|
125
134
|
if (normalized.startsWith("breakpoint ")) return `● add ${normalized}`;
|
|
126
135
|
if (normalized.startsWith("delete-breakpoint ")) {
|
|
127
136
|
return `○ remove breakpoint · ${normalized.slice("delete-breakpoint ".length)}`;
|
|
@@ -68,6 +68,13 @@ export interface DebugFrame {
|
|
|
68
68
|
readonly source?: { readonly path?: string; readonly name?: string };
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
export interface DebugEvaluation {
|
|
72
|
+
readonly expression: string;
|
|
73
|
+
readonly result: string;
|
|
74
|
+
readonly type?: string;
|
|
75
|
+
readonly variablesReference: number;
|
|
76
|
+
}
|
|
77
|
+
|
|
71
78
|
export interface DebugSourceLine {
|
|
72
79
|
readonly lineNumber: number;
|
|
73
80
|
readonly content: string;
|
|
@@ -130,6 +137,11 @@ interface ScopesBody {
|
|
|
130
137
|
interface VariablesBody {
|
|
131
138
|
readonly variables?: readonly DebugVariable[];
|
|
132
139
|
}
|
|
140
|
+
interface EvaluateBody {
|
|
141
|
+
readonly result?: string;
|
|
142
|
+
readonly type?: string;
|
|
143
|
+
readonly variablesReference?: number;
|
|
144
|
+
}
|
|
133
145
|
interface SetBreakpointsBody {
|
|
134
146
|
readonly breakpoints?: readonly { readonly verified?: boolean; readonly line?: number }[];
|
|
135
147
|
}
|
|
@@ -363,6 +375,33 @@ export class DebugSessionManager {
|
|
|
363
375
|
return session;
|
|
364
376
|
}
|
|
365
377
|
|
|
378
|
+
/** Evaluate one expression in the currently selected stopped frame. */
|
|
379
|
+
async evaluate(
|
|
380
|
+
session: DebugSession,
|
|
381
|
+
expression: string,
|
|
382
|
+
signal?: AbortSignal,
|
|
383
|
+
): Promise<DebugEvaluation> {
|
|
384
|
+
if (session.status !== "stopped" || session.stop?.frame === undefined) {
|
|
385
|
+
throw new Error(`Cannot evaluate while session is ${session.status}`);
|
|
386
|
+
}
|
|
387
|
+
const trimmed = expression.trim();
|
|
388
|
+
if (trimmed.length === 0) throw new Error("Debug evaluation requires an expression");
|
|
389
|
+
const response = await requiredClient(session).request<EvaluateBody>(
|
|
390
|
+
"evaluate",
|
|
391
|
+
{ expression: trimmed, frameId: session.stop.frame.id, context: "repl" },
|
|
392
|
+
{ signal },
|
|
393
|
+
);
|
|
394
|
+
if (typeof response.result !== "string") {
|
|
395
|
+
throw new Error("Debug adapter returned no evaluation result");
|
|
396
|
+
}
|
|
397
|
+
return {
|
|
398
|
+
expression: trimmed,
|
|
399
|
+
result: response.result,
|
|
400
|
+
variablesReference: response.variablesReference ?? 0,
|
|
401
|
+
...(response.type === undefined ? {} : { type: response.type }),
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
|
|
366
405
|
/** Terminate an owned debuggee and remove its session. */
|
|
367
406
|
async delete(source: string, signal?: AbortSignal): Promise<void> {
|
|
368
407
|
const session = this.get(source);
|
|
@@ -1,14 +1,51 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
DebugEvaluation,
|
|
3
|
+
DebugSessionSnapshot,
|
|
4
|
+
} from "#src/plugins/pi-agent-ide-debugger/src/session-manager.js";
|
|
2
5
|
|
|
3
6
|
/** Extract one immutable snapshot from a debugger semantic-action receipt. */
|
|
4
7
|
export function debuggerSnapshotFromResult(details: unknown): DebugSessionSnapshot | undefined {
|
|
8
|
+
const semantic = semanticActionFromResult(details);
|
|
9
|
+
if (semantic === undefined) return undefined;
|
|
10
|
+
const snapshot = semantic.snapshot;
|
|
11
|
+
return typeof snapshot === "object" && snapshot !== null
|
|
12
|
+
? (snapshot as DebugSessionSnapshot)
|
|
13
|
+
: undefined;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Extract an evaluation result from a debugger semantic-action receipt. */
|
|
17
|
+
export function debuggerEvaluationFromResult(details: unknown): DebugEvaluation | undefined {
|
|
18
|
+
const semantic = semanticActionFromResult(details);
|
|
19
|
+
if (semantic === undefined) return undefined;
|
|
20
|
+
const evaluation = semantic.evaluation;
|
|
21
|
+
if (
|
|
22
|
+
typeof evaluation !== "object" ||
|
|
23
|
+
evaluation === null ||
|
|
24
|
+
!("expression" in evaluation) ||
|
|
25
|
+
typeof evaluation.expression !== "string" ||
|
|
26
|
+
!("result" in evaluation) ||
|
|
27
|
+
typeof evaluation.result !== "string" ||
|
|
28
|
+
!("variablesReference" in evaluation) ||
|
|
29
|
+
typeof evaluation.variablesReference !== "number"
|
|
30
|
+
) {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
expression: evaluation.expression,
|
|
35
|
+
result: evaluation.result,
|
|
36
|
+
variablesReference: evaluation.variablesReference,
|
|
37
|
+
...("type" in evaluation && typeof evaluation.type === "string"
|
|
38
|
+
? { type: evaluation.type }
|
|
39
|
+
: {}),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function semanticActionFromResult(details: unknown): Readonly<Record<string, unknown>> | undefined {
|
|
5
44
|
if (typeof details !== "object" || details === null) return undefined;
|
|
6
45
|
const metadata = (details as { readonly metadata?: unknown }).metadata;
|
|
7
46
|
if (typeof metadata !== "object" || metadata === null) return undefined;
|
|
8
47
|
const semantic = (metadata as { readonly semanticAction?: unknown }).semanticAction;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return typeof snapshot === "object" && snapshot !== null
|
|
12
|
-
? (snapshot as DebugSessionSnapshot)
|
|
48
|
+
return typeof semantic === "object" && semantic !== null
|
|
49
|
+
? (semantic as Readonly<Record<string, unknown>>)
|
|
13
50
|
: undefined;
|
|
14
51
|
}
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
import { createReadResultRenderer } from "pi-agent-read/api/rendering";
|
|
27
27
|
|
|
28
28
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
29
|
+
import { connectAgentDocumentation, loadPackagedAgentGuide } from "pi-agent-documentation";
|
|
29
30
|
import type { ResourceResolutionAttempt, ResourceResolver } from "pi-agent-resource";
|
|
30
31
|
import type { TextDocument, TextLinePresenter } from "pi-agent-text";
|
|
31
32
|
import type { ReadRequest, ReadResultDetails } from "pi-agent-read/api/tools/read";
|
|
@@ -36,6 +37,13 @@ const renderReadResult = createReadResultRenderer({ kind: "code-view", label: "D
|
|
|
36
37
|
type ReadDiagnostics = IdePluginApi["readDiagnostics"];
|
|
37
38
|
|
|
38
39
|
export default async function registerDiagnostics(pi: ExtensionAPI): Promise<void> {
|
|
40
|
+
connectAgentDocumentation(pi, [
|
|
41
|
+
await loadPackagedAgentGuide({
|
|
42
|
+
id: "diagnostics",
|
|
43
|
+
description: "Diagnostic resources, readiness, and verification",
|
|
44
|
+
triggers: [{ tool: "read", resourcePrefixes: ["diagnostics:"] }],
|
|
45
|
+
}),
|
|
46
|
+
]);
|
|
39
47
|
let readDiagnostics: ReadDiagnostics | undefined;
|
|
40
48
|
const collect: CollectDiagnostics = (filePath, cwd, options) => {
|
|
41
49
|
if (readDiagnostics === undefined) {
|
|
@@ -128,10 +136,7 @@ export default async function registerDiagnostics(pi: ExtensionAPI): Promise<voi
|
|
|
128
136
|
},
|
|
129
137
|
});
|
|
130
138
|
api.describe(
|
|
131
|
-
'diagnostics:<path> — lint and language-server diagnostics. views: ["diagnostics"] — diagnostics alongside source text.
|
|
132
|
-
);
|
|
133
|
-
api.addPromptGuideline(
|
|
134
|
-
"Use read with `diagnostics:<path>` or the `diagnostics` view for per-file diagnostics instead of running equivalent checks through Bash. Project builds and tests remain separate verification.",
|
|
139
|
+
'diagnostics:<path> — lint and language-server diagnostics. views: ["diagnostics"] — diagnostics alongside source text. Results identify their reporting tool and readiness; pending results and snapshots are not completed checks.',
|
|
135
140
|
);
|
|
136
141
|
},
|
|
137
142
|
} satisfies ReadPlugin;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-formatter",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-doctor": "0.6.
|
|
6
|
+
"pi-agent-doctor": "0.6.2"
|
|
7
7
|
},
|
|
8
8
|
"pi": {
|
|
9
9
|
"extensions": [
|
|
10
|
-
"./runtime/entry-
|
|
10
|
+
"./runtime/entry-34.js"
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"@earendil-works/pi-coding-agent": "*",
|
|
15
|
-
"pi-agent-ide": "0.6.
|
|
15
|
+
"pi-agent-ide": "0.6.2"
|
|
16
16
|
},
|
|
17
17
|
"peerDependenciesMeta": {
|
|
18
18
|
"pi-agent-ide": {
|
|
@@ -62,7 +62,7 @@ async function loadRegistry(cwd: string, external = false): Promise<FormatterCom
|
|
|
62
62
|
if (registry === undefined) {
|
|
63
63
|
registry = FormatterCommandRegistry.fromDirectory(cwd, {
|
|
64
64
|
includeGlobal: !external,
|
|
65
|
-
requireBuiltInEvidence:
|
|
65
|
+
requireBuiltInEvidence: true,
|
|
66
66
|
});
|
|
67
67
|
registries.set(key, registry);
|
|
68
68
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-languages",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-doctor": "0.6.
|
|
6
|
+
"pi-agent-doctor": "0.6.2"
|
|
7
7
|
},
|
|
8
8
|
"pi": {
|
|
9
9
|
"extensions": [
|
|
10
|
-
"./runtime/entry-
|
|
10
|
+
"./runtime/entry-35.js"
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
@@ -105,6 +105,6 @@ async function loadRegistry(cwd: string, external: boolean): Promise<LintCommand
|
|
|
105
105
|
const configDirectory = external ? cwd : (process.env.PI_AGENT_IDE_CONFIG_DIR ?? cwd);
|
|
106
106
|
return LintCommandRegistry.fromDirectory(configDirectory, {
|
|
107
107
|
includeGlobal: !external,
|
|
108
|
-
requireBuiltInEvidence:
|
|
108
|
+
requireBuiltInEvidence: true,
|
|
109
109
|
});
|
|
110
110
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-lint",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-doctor": "0.6.
|
|
7
|
-
"pi-agent-invariant": "0.6.
|
|
8
|
-
"pi-agent-read": "0.6.
|
|
9
|
-
"pi-agent-resource": "0.6.
|
|
10
|
-
"pi-agent-text": "0.6.
|
|
6
|
+
"pi-agent-doctor": "0.6.2",
|
|
7
|
+
"pi-agent-invariant": "0.6.2",
|
|
8
|
+
"pi-agent-read": "0.6.2",
|
|
9
|
+
"pi-agent-resource": "0.6.2",
|
|
10
|
+
"pi-agent-text": "0.6.2"
|
|
11
11
|
},
|
|
12
12
|
"pi": {
|
|
13
13
|
"extensions": [
|
|
14
|
-
"./runtime/entry-
|
|
14
|
+
"./runtime/entry-36.js"
|
|
15
15
|
]
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"@earendil-works/pi-coding-agent": "*",
|
|
19
|
-
"pi-agent-ide": "0.6.
|
|
19
|
+
"pi-agent-ide": "0.6.2"
|
|
20
20
|
},
|
|
21
21
|
"peerDependenciesMeta": {
|
|
22
22
|
"pi-agent-ide": {
|