pi-agent-ide 0.7.1 → 0.7.3
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 +66 -0
- package/README.md +3 -1
- package/dist/{chunk-PKKDDIWW.js → chunk-2ZMMRINH.js} +1 -1
- package/dist/chunk-6U5OU77O.js +3 -0
- package/dist/chunk-BYZSBXUK.js +2 -0
- package/dist/{chunk-LEEQIQ7D.js → chunk-CEX73RI5.js} +6 -6
- package/dist/chunk-DZWTKF2K.js +1 -0
- package/dist/{chunk-WMO6RNE2.js → chunk-EOKEQ3YH.js} +6 -6
- package/dist/{chunk-HZEY4GT4.js → chunk-H445SHSJ.js} +2 -2
- package/dist/{chunk-4GCWGE2C.js → chunk-HZ5BNF3A.js} +1 -1
- package/dist/chunk-IG56UGSO.js +2 -0
- package/dist/chunk-IICJXZBU.js +6 -0
- package/dist/{chunk-XYS4FSCC.js → chunk-IM24DB3K.js} +1 -1
- package/dist/chunk-MXLSGMRZ.js +3 -0
- package/dist/{chunk-76ZK5ODR.js → chunk-NHKPP2AI.js} +13 -13
- package/dist/chunk-OB46OPMZ.js +1 -0
- package/dist/{chunk-PNU3E7IO.js → chunk-Q6CZ6GBR.js} +2 -2
- package/dist/chunk-QUYXINGZ.js +7 -0
- package/dist/{chunk-OMVRLWMX.js → chunk-SBP3ABH4.js} +1 -1
- package/dist/{chunk-YP46DVVP.js → chunk-STBJO3Z3.js} +1 -1
- package/dist/{chunk-2TRHFMCZ.js → chunk-TXOTNK6B.js} +1 -1
- package/dist/chunk-WLZIUMJL.js +1 -0
- package/dist/chunk-ZIWPKIBZ.js +1 -0
- package/dist/entry-11.js +1 -1
- package/dist/entry-13.js +1 -1
- package/dist/entry-14.js +1 -1
- package/dist/entry-15.js +1 -1
- package/dist/entry-17.js +1 -1
- package/dist/entry-25.js +1 -1
- package/dist/entry-26.js +1 -1
- package/dist/entry-27.js +1 -1
- package/dist/entry-28.js +1 -1
- package/dist/entry-29.js +1 -1
- package/dist/entry-31.js +12 -11
- package/dist/entry-33.js +3 -1
- package/dist/entry-37.js +6 -6
- package/dist/entry-42.js +1 -1
- package/dist/entry-44.js +1 -1
- package/dist/entry-45.js +20 -12
- package/dist/entry-46.js +1 -1
- package/dist/entry-49.js +1 -1
- package/dist/entry-50.js +1 -1
- package/dist/entry-51.js +7 -6
- package/dist/entry-52.js +1 -1
- package/dist/entry-53.js +1 -1
- package/dist/entry-54.js +1 -1
- package/dist/entry-56.js +1 -1
- package/dist/entry-58.js +1 -1
- package/dist/entry-60.js +1 -1
- package/dist/entry-62.js +1 -1
- package/dist/entry-65.js +1 -1
- package/dist/entry-66.js +1 -1
- package/dist/entry-68.js +1 -1
- package/dist/entry-70.js +1 -1
- package/dist/entry-75.js +1 -1
- package/dist/entry-77.js +63 -49
- package/dist/entry-78.js +15 -14
- package/dist/entry-79.js +1 -1
- package/dist/entry-82.js +5 -5
- package/dist/entry-83.js +1 -1
- package/dist/entry-84.js +1 -1
- package/dist/entry-85.js +1 -1
- package/dist/entry-86.js +1 -1
- package/dist/pi-agent-ide.js +34 -11
- package/docs/agent-guides/editing.md +14 -7
- package/docs/agent-guides/git-changes.md +10 -0
- package/docs/agent-guides/read-resources.md +9 -46
- package/docs/agent-guides/search-code.md +7 -1
- package/docs/agent-guides/select-code.md +1 -0
- package/docs/agent-guides/terminal.md +9 -1
- package/docs/configuration.md +22 -1
- package/docs/development.md +4 -0
- package/docs/directory-operations.md +45 -0
- package/docs/releases.md +12 -0
- package/docs/research/codemode-write-context.md +56 -0
- package/docs/research/native-codemode-batch-decision.md +2 -0
- package/docs/structured-results.md +2 -2
- package/docs/tools.md +10 -2
- package/docs/user-hooks.md +26 -0
- package/node_modules/pi-agent-doctor/package.json +1 -1
- package/node_modules/pi-agent-documentation/package.json +1 -1
- package/node_modules/pi-agent-filesystem/package.json +7 -7
- package/node_modules/pi-agent-filesystem-image/package.json +3 -3
- package/node_modules/pi-agent-filesystem-jq/package.json +5 -5
- package/node_modules/pi-agent-filesystem-jq/src/jq.ts +4 -1
- package/node_modules/pi-agent-filesystem-pdf/package.json +3 -3
- package/node_modules/pi-agent-filesystem-text/package.json +3 -3
- package/node_modules/pi-agent-ide-ast/package.json +13 -13
- package/node_modules/pi-agent-ide-ast/src/extension.ts +3 -3
- package/node_modules/pi-agent-ide-ast/src/overflow-handler.ts +9 -4
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +0 -3
- package/node_modules/pi-agent-ide-ast/src/select-schema.ts +8 -6
- package/node_modules/pi-agent-ide-ast/src/tool-select.ts +13 -5
- package/node_modules/pi-agent-ide-changes/package.json +9 -8
- package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +82 -4
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +8 -11
- package/node_modules/pi-agent-ide-formatter/package.json +3 -3
- package/node_modules/pi-agent-ide-languages/package.json +2 -2
- package/node_modules/pi-agent-ide-lint/package.json +7 -7
- package/node_modules/pi-agent-ide-lsp/index.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/package.json +9 -9
- package/node_modules/pi-agent-ide-lsp/src/declaration-targets.ts +2 -1
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +0 -1
- package/node_modules/pi-agent-image/package.json +2 -2
- package/node_modules/pi-agent-invariant/package.json +1 -1
- package/node_modules/pi-agent-pdf/package.json +2 -2
- package/node_modules/pi-agent-read/package.json +7 -7
- package/node_modules/pi-agent-read/src/api/read-parameters.ts +3 -3
- package/node_modules/pi-agent-read/src/api/tools/read.ts +11 -0
- package/node_modules/pi-agent-read/src/core/extension.ts +1 -1
- package/node_modules/pi-agent-read/src/core/read-core.ts +5 -1
- package/node_modules/pi-agent-read/src/core/tools/read/output-truncation.ts +91 -18
- package/node_modules/pi-agent-read/src/core/tools/read/raw-read.ts +8 -2
- package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +38 -1
- package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +57 -2
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +99 -44
- package/node_modules/pi-agent-resource/package.json +1 -1
- package/node_modules/pi-agent-resource/src/index.ts +1 -0
- package/node_modules/pi-agent-resource/src/result-targets.ts +6 -3
- package/node_modules/{pi-agent-read/src/core/tools/read → pi-agent-resource/src}/temp-resource-store.ts +17 -7
- package/node_modules/pi-agent-search/package.json +5 -5
- package/node_modules/pi-agent-search/src/api/fuzzy.ts +5 -1
- package/node_modules/pi-agent-search/src/api/search-parameters.ts +2 -2
- package/node_modules/pi-agent-search/src/core/extension.ts +2 -1
- package/node_modules/pi-agent-search/src/core/search-core.ts +13 -4
- package/node_modules/pi-agent-search-text/package.json +7 -7
- package/node_modules/pi-agent-search-text/src/resolvers.ts +11 -1
- package/node_modules/pi-agent-search-text/src/scoped-search.ts +1 -1
- package/node_modules/pi-agent-search-text/src/search-presentation.ts +42 -32
- package/node_modules/pi-agent-search-text/src/search-recipe.ts +1 -1
- package/node_modules/pi-agent-search-text/src/search-renderer.ts +6 -0
- package/node_modules/pi-agent-search-text/src/search-result.ts +17 -3
- package/node_modules/pi-agent-text/package.json +2 -2
- package/node_modules/pi-agent-text-anchor-constant/package.json +3 -3
- package/node_modules/pi-agent-text-anchor-exact/package.json +3 -3
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +5 -5
- package/node_modules/pi-agent-text-editor/package.json +9 -9
- package/node_modules/pi-agent-text-editor/src/api/delete-guard.ts +24 -0
- package/node_modules/pi-agent-text-editor/src/api/edit-completion.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/api/mutation-guard.ts +1 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +1 -2
- package/node_modules/pi-agent-text-editor/src/api/native-edit-batch-event.ts +4 -0
- package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +4 -1
- package/node_modules/pi-agent-text-editor/src/api/stale-anchor-message.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/delete-policy.ts +284 -0
- package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +54 -12
- package/node_modules/pi-agent-text-editor/src/core/editing-guidelines.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +32 -3
- package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +30 -40
- package/node_modules/pi-agent-text-editor/src/core/file-result-targets.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/file-transfers.ts +164 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +36 -12
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +25 -1
- package/node_modules/pi-agent-text-editor/src/core/mutation-result-targets.ts +132 -11
- package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +286 -162
- package/node_modules/pi-agent-text-editor/src/core/post-edit-scope.ts +34 -10
- package/node_modules/pi-agent-text-editor/src/core/result-input.ts +24 -4
- package/node_modules/pi-agent-text-editor/src/core/result-transfer.ts +46 -11
- package/node_modules/pi-agent-text-editor/src/core/structured-result.ts +21 -14
- package/node_modules/pi-agent-text-editor/src/core/temporary-directories.ts +96 -0
- package/node_modules/pi-agent-text-editor/src/core/text-change-engine.ts +5 -1
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +155 -22
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +4 -0
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +126 -32
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +428 -189
- package/node_modules/pi-agent-text-editor/src/core/write-agent-result.ts +66 -0
- package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +6 -4
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +15 -6
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +9 -4
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +7 -8
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +6 -4
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +2 -3
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +10 -4
- package/node_modules/pi-agent-text-editor-renderer/package.json +5 -5
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +11 -0
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +75 -11
- package/node_modules/pi-agent-text-editor-renderer/src/status-summary.ts +18 -3
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +4 -4
- package/node_modules/pi-agent-tool-call-interception/package.json +2 -2
- package/node_modules/pi-agent-tool-ui/package.json +1 -1
- package/node_modules/pi-agent-web/package.json +7 -7
- package/node_modules/pi-agent-web/src/resolver.ts +11 -13
- package/node_modules/pi-agent-web-html/package.json +2 -2
- package/node_modules/pi-agent-web-image/package.json +3 -3
- package/node_modules/pi-agent-web-pdf/package.json +3 -3
- package/node_modules/pi-agent-web-text/package.json +3 -3
- package/package.json +36 -35
- package/src/api/hooks.ts +24 -0
- package/src/composite/nested-tool-rendering.ts +184 -77
- package/src/composite/output-limits.ts +125 -0
- package/src/composite/responses-tools.ts +25 -0
- package/src/composite/text-results.ts +158 -7
- 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 +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +5 -5
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/src/jq.ts +4 -1
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +7 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +2 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/resolver.ts +11 -13
- package/src/extensions/pi-agent-read/package.json +7 -7
- package/src/extensions/pi-agent-read/src/api/read-parameters.ts +3 -3
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +11 -0
- package/src/extensions/pi-agent-read/src/core/extension.ts +1 -1
- package/src/extensions/pi-agent-read/src/core/read-core.ts +5 -1
- package/src/extensions/pi-agent-read/src/core/tools/read/output-truncation.ts +91 -18
- package/src/extensions/pi-agent-read/src/core/tools/read/raw-read.ts +8 -2
- package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +38 -1
- package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +57 -2
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +99 -44
- package/src/extensions/pi-agent-search/package.json +5 -5
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +7 -7
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +11 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/scoped-search.ts +1 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-presentation.ts +42 -32
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +1 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +6 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +17 -3
- package/src/extensions/pi-agent-search/src/api/fuzzy.ts +5 -1
- package/src/extensions/pi-agent-search/src/api/search-parameters.ts +2 -2
- package/src/extensions/pi-agent-search/src/core/extension.ts +2 -1
- package/src/extensions/pi-agent-search/src/core/search-core.ts +13 -4
- package/src/extensions/pi-agent-text-editor/package.json +9 -9
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +3 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +3 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +11 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +75 -11
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/status-summary.ts +18 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +4 -4
- package/src/extensions/pi-agent-text-editor/src/api/delete-guard.ts +24 -0
- package/src/extensions/pi-agent-text-editor/src/api/edit-completion.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/api/mutation-guard.ts +1 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +1 -2
- package/src/extensions/pi-agent-text-editor/src/api/native-edit-batch-event.ts +4 -0
- package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +4 -1
- package/src/extensions/pi-agent-text-editor/src/api/stale-anchor-message.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/delete-policy.ts +284 -0
- package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +54 -12
- package/src/extensions/pi-agent-text-editor/src/core/editing-guidelines.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +32 -3
- package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +30 -40
- package/src/extensions/pi-agent-text-editor/src/core/file-result-targets.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/file-transfers.ts +164 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +36 -12
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +25 -1
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result-targets.ts +132 -11
- package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +286 -162
- package/src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts +34 -10
- package/src/extensions/pi-agent-text-editor/src/core/result-input.ts +24 -4
- package/src/extensions/pi-agent-text-editor/src/core/result-transfer.ts +46 -11
- package/src/extensions/pi-agent-text-editor/src/core/structured-result.ts +21 -14
- package/src/extensions/pi-agent-text-editor/src/core/temporary-directories.ts +96 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-change-engine.ts +5 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +155 -22
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +4 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +126 -32
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +428 -189
- package/src/extensions/pi-agent-text-editor/src/core/write-agent-result.ts +66 -0
- package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +6 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +15 -6
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +9 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +7 -8
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +6 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +2 -3
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +10 -4
- package/src/pi-agent-ide.ts +11 -0
- package/src/plugins/pi-agent-ide-ast/package.json +13 -13
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +3 -3
- package/src/plugins/pi-agent-ide-ast/src/overflow-handler.ts +9 -4
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +0 -3
- package/src/plugins/pi-agent-ide-ast/src/select-schema.ts +8 -6
- package/src/plugins/pi-agent-ide-ast/src/tool-select.ts +13 -5
- package/src/plugins/pi-agent-ide-changes/package.json +9 -8
- package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +82 -4
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +8 -11
- package/src/plugins/pi-agent-ide-debugger/index.ts +20 -8
- package/src/plugins/pi-agent-ide-debugger/src/dap-client.ts +5 -0
- package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +93 -38
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +3 -2
- package/src/plugins/pi-agent-ide-formatter/package.json +3 -3
- package/src/plugins/pi-agent-ide-languages/package.json +2 -2
- package/src/plugins/pi-agent-ide-lint/package.json +7 -7
- package/src/plugins/pi-agent-ide-lsp/index.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/package.json +9 -9
- package/src/plugins/pi-agent-ide-lsp/src/declaration-targets.ts +2 -1
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +0 -1
- package/src/plugins/pi-agent-ide-terminal/src/output-limits.ts +3 -3
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +3 -3
- package/src/plugins/pi-agent-ide-vision/index.ts +1 -0
- package/src/post-edit/gate.ts +13 -2
- package/dist/chunk-4XMY4H4V.js +0 -1
- package/dist/chunk-64M3SQPG.js +0 -3
- package/dist/chunk-CWD4O5PM.js +0 -3
- package/dist/chunk-D3WTDA6V.js +0 -2
- package/dist/chunk-EAZGN5ND.js +0 -7
- package/dist/chunk-GXEGY7GV.js +0 -1
- package/dist/chunk-MBUXFKIW.js +0 -3
- package/dist/chunk-PGIVHICI.js +0 -1
- package/dist/chunk-VMTR74FF.js +0 -2
- package/dist/chunk-WU6ZK6YD.js +0 -1
- package/src/extensions/pi-agent-read/src/core/tools/read/temp-resource-store.ts +0 -105
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
type ExtensionAPI,
|
|
9
9
|
withFileMutationQueue,
|
|
10
10
|
} from "@earendil-works/pi-coding-agent";
|
|
11
|
+
import { Text } from "@earendil-works/pi-tui";
|
|
11
12
|
import { Type, type Static } from "typebox";
|
|
12
13
|
import { resultError, structuredResultSchema, withStructuredResult } from "pi-agent-resource";
|
|
13
14
|
const indexDataSchema = Type.Object(
|
|
@@ -45,6 +46,22 @@ export const indexChangeSchema = Type.Object(
|
|
|
45
46
|
{ additionalProperties: false },
|
|
46
47
|
);
|
|
47
48
|
|
|
49
|
+
const unstageChangeSchema = Type.Object(
|
|
50
|
+
{
|
|
51
|
+
file: {
|
|
52
|
+
...indexChangeSchema.properties.file,
|
|
53
|
+
description:
|
|
54
|
+
"Path to a tracked text file in the current Git worktree. Relative paths resolve from the workspace.",
|
|
55
|
+
},
|
|
56
|
+
change: {
|
|
57
|
+
...indexChangeSchema.properties.change,
|
|
58
|
+
description:
|
|
59
|
+
'Select one complete current CHANGE#HASH anchor returned by read with views: ["changes"].',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{ additionalProperties: false },
|
|
63
|
+
);
|
|
64
|
+
|
|
48
65
|
interface IndexChangeToolDetails {
|
|
49
66
|
readonly action: ChangeIndexAction;
|
|
50
67
|
readonly change: string;
|
|
@@ -70,6 +87,24 @@ export function createIndexChangeTool(
|
|
|
70
87
|
) {
|
|
71
88
|
const execute = createIndexChangeExecutor(action, executor, queue);
|
|
72
89
|
const pastTense = action === "stage" ? "Staged" : "Unstaged";
|
|
90
|
+
const parameters =
|
|
91
|
+
action === "stage"
|
|
92
|
+
? {
|
|
93
|
+
...indexChangeSchema,
|
|
94
|
+
properties: {
|
|
95
|
+
file: {
|
|
96
|
+
...indexChangeSchema.properties.file,
|
|
97
|
+
description:
|
|
98
|
+
"Path to the tracked text file, absolute or relative to the current working directory.",
|
|
99
|
+
},
|
|
100
|
+
change: {
|
|
101
|
+
...indexChangeSchema.properties.change,
|
|
102
|
+
description:
|
|
103
|
+
'Use the complete current CHANGE#HASH anchor shown by read with views: ["changes"].',
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
}
|
|
107
|
+
: unstageChangeSchema;
|
|
73
108
|
|
|
74
109
|
return defineTool<typeof indexChangeSchema, IndexChangeToolDetails>({
|
|
75
110
|
name: action,
|
|
@@ -87,9 +122,27 @@ export function createIndexChangeTool(
|
|
|
87
122
|
label: action,
|
|
88
123
|
|
|
89
124
|
promptSnippet: `${pastTense.slice(0, -1)} a selected Git change`,
|
|
90
|
-
description:
|
|
91
|
-
|
|
125
|
+
description:
|
|
126
|
+
action === "stage"
|
|
127
|
+
? "Use stage to add one selected Git change to the index without changing the worktree file."
|
|
128
|
+
: "Use unstage to remove one selected Git change from the index. Worktree content is kept.",
|
|
129
|
+
parameters,
|
|
92
130
|
outputSchema: indexOutputSchema,
|
|
131
|
+
// The full IDE removes private result metadata before calling this renderer.
|
|
132
|
+
...(action === "stage" && {
|
|
133
|
+
renderResult(result, _options, theme) {
|
|
134
|
+
return new Text(
|
|
135
|
+
theme.fg(
|
|
136
|
+
"toolOutput",
|
|
137
|
+
result.content
|
|
138
|
+
.flatMap((block) => (block.type === "text" ? [block.text] : []))
|
|
139
|
+
.join("\n"),
|
|
140
|
+
),
|
|
141
|
+
0,
|
|
142
|
+
0,
|
|
143
|
+
);
|
|
144
|
+
},
|
|
145
|
+
}),
|
|
93
146
|
async execute(_toolCallId, parameters, signal, _onUpdate, context) {
|
|
94
147
|
try {
|
|
95
148
|
const result = await execute(parameters, signal, context);
|
|
@@ -148,7 +201,11 @@ export function createIndexChangeExecutor(
|
|
|
148
201
|
const creation = await ChangeService.create(executor, context.cwd, signal);
|
|
149
202
|
|
|
150
203
|
if (creation.status !== "ready") {
|
|
151
|
-
throw new Error(
|
|
204
|
+
throw new Error(
|
|
205
|
+
action === "stage"
|
|
206
|
+
? `Cannot stage ${parameters.file}: ${creation.message}`
|
|
207
|
+
: creation.message,
|
|
208
|
+
);
|
|
152
209
|
}
|
|
153
210
|
|
|
154
211
|
const result = await creation.service.changeIndex(
|
|
@@ -163,10 +220,31 @@ export function createIndexChangeExecutor(
|
|
|
163
220
|
);
|
|
164
221
|
|
|
165
222
|
if (result.status === "unavailable") {
|
|
166
|
-
|
|
223
|
+
if (action === "stage" && result.reason === "stale-selector") {
|
|
224
|
+
throw new Error(
|
|
225
|
+
`${result.message}. Read ${parameters.file} with views: ["changes"] and use a current CHANGE# anchor.`,
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
if (action === "stage" && result.reason === "index-write-failed" && !signal?.aborted) {
|
|
229
|
+
throw new Error(
|
|
230
|
+
`${result.message}\nThe index may have changed. Read ${parameters.file} with views: ["changes"] before retrying.`,
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
throw new Error(
|
|
234
|
+
action === "stage" && result.reason !== "index-write-failed"
|
|
235
|
+
? `Cannot stage ${parameters.file}: ${result.message}`
|
|
236
|
+
: result.message,
|
|
237
|
+
);
|
|
167
238
|
}
|
|
168
239
|
|
|
169
240
|
if (result.status === "not-applicable") {
|
|
241
|
+
if (action === "stage") {
|
|
242
|
+
const reason =
|
|
243
|
+
result.reason === "clean"
|
|
244
|
+
? "the worktree text matches HEAD"
|
|
245
|
+
: "the file is not present in HEAD";
|
|
246
|
+
throw new Error(`Cannot stage ${parameters.file}: ${reason}.`);
|
|
247
|
+
}
|
|
170
248
|
throw new Error(`${action} is not applicable to ${file}: ${result.reason}`);
|
|
171
249
|
}
|
|
172
250
|
|
|
@@ -15,22 +15,20 @@ export const undoSchema = Type.Object(
|
|
|
15
15
|
file: Type.Optional({
|
|
16
16
|
...resultInputSchema,
|
|
17
17
|
description:
|
|
18
|
-
"File
|
|
18
|
+
"File path or one whole-file source result. Partial and multi-file selections are rejected. Omit file to use the supplied CHANGE anchor's file or the last resolved source.",
|
|
19
|
+
}),
|
|
20
|
+
change: Type.String({
|
|
21
|
+
description:
|
|
22
|
+
'Use a complete current CHANGE#HASH anchor from read with views: ["changes"] to restore that change to HEAD in both worktree and index. Use last to restore the file\'s latest saved text-editor transaction.',
|
|
23
|
+
pattern: "^(?:CHANGE#[0-9A-F]{4,64}|last)$",
|
|
19
24
|
}),
|
|
20
|
-
change: Type.Optional(
|
|
21
|
-
Type.String({
|
|
22
|
-
description:
|
|
23
|
-
"Complete CHANGE#HASH anchor shown by read, or last for this file's latest text-editor transaction",
|
|
24
|
-
pattern: "^(?:CHANGE#[0-9A-F]{4,64}|last)$",
|
|
25
|
-
}),
|
|
26
|
-
),
|
|
27
25
|
},
|
|
28
26
|
{ additionalProperties: false },
|
|
29
27
|
);
|
|
30
28
|
|
|
31
29
|
interface UndoParameters {
|
|
32
30
|
readonly file?: unknown;
|
|
33
|
-
readonly change
|
|
31
|
+
readonly change: string;
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
export function createUndoMutationTool(
|
|
@@ -41,7 +39,7 @@ export function createUndoMutationTool(
|
|
|
41
39
|
return {
|
|
42
40
|
name: "undo",
|
|
43
41
|
description:
|
|
44
|
-
"Use undo to
|
|
42
|
+
"Use undo to restore one selected uncommitted Git change or a file's latest text-editor transaction.",
|
|
45
43
|
|
|
46
44
|
promptSnippet: "Restore a Git change or latest text edit",
|
|
47
45
|
parameters: undoSchema,
|
|
@@ -56,7 +54,6 @@ export function createUndoMutationTool(
|
|
|
56
54
|
},
|
|
57
55
|
],
|
|
58
56
|
async mutate(context, parameters: UndoParameters) {
|
|
59
|
-
if (parameters.change === undefined) throw new Error("change is required");
|
|
60
57
|
const source = context.sourceFor("file");
|
|
61
58
|
let restoredText: string;
|
|
62
59
|
let afterWrite: (() => Promise<void>) | undefined;
|
|
@@ -134,7 +134,8 @@ const debugParameters = Type.Object(
|
|
|
134
134
|
}),
|
|
135
135
|
source: Type.Optional(
|
|
136
136
|
Type.String({
|
|
137
|
-
description:
|
|
137
|
+
description:
|
|
138
|
+
"Source file used for anchored breakpoints. Defaults to program. Relative paths resolve from cwd.",
|
|
138
139
|
}),
|
|
139
140
|
),
|
|
140
141
|
args: Type.Optional(
|
|
@@ -147,7 +148,10 @@ const debugParameters = Type.Object(
|
|
|
147
148
|
}),
|
|
148
149
|
),
|
|
149
150
|
cwd: Type.Optional(
|
|
150
|
-
Type.String({
|
|
151
|
+
Type.String({
|
|
152
|
+
description:
|
|
153
|
+
"Working directory. Defaults to the workspace. Relative paths resolve from the workspace.",
|
|
154
|
+
}),
|
|
151
155
|
),
|
|
152
156
|
},
|
|
153
157
|
{ additionalProperties: false },
|
|
@@ -229,6 +233,11 @@ export default async function registerDebugger(pi: ExtensionAPI): Promise<void>
|
|
|
229
233
|
id: "debugger",
|
|
230
234
|
setup(api) {
|
|
231
235
|
api.addResolver({ resolver: editorResolver });
|
|
236
|
+
api
|
|
237
|
+
.tool("insert")
|
|
238
|
+
.describe(
|
|
239
|
+
'For debug:<session>, omit anchor and put start, continue, step over, step into, step out, or evaluate <expression> in text. Evaluate requires a stopped frame. For debug:<session>/source, use a fresh Read/Search line anchor and text "breakpoint"; the result reports pending or verified readiness. These actions do not edit source text.',
|
|
240
|
+
);
|
|
232
241
|
api.tool("insert").addSemanticHandler({
|
|
233
242
|
matches: (input) => matchesDebugInsert(input, manager),
|
|
234
243
|
execute: async (context, input) => {
|
|
@@ -250,7 +259,7 @@ export default async function registerDebugger(pi: ExtensionAPI): Promise<void>
|
|
|
250
259
|
);
|
|
251
260
|
return {
|
|
252
261
|
source: breakpoint.source,
|
|
253
|
-
summary: `Breakpoint ${breakpoint.source}
|
|
262
|
+
summary: `Breakpoint ${breakpoint.source} registered at ${path.relative(session.options.cwd, breakpoint.file)}:${breakpoint.line} (${breakpoint.verified ? "verified" : "pending"}).`,
|
|
254
263
|
data: {
|
|
255
264
|
kind: "debug-breakpoint",
|
|
256
265
|
session: session.source,
|
|
@@ -339,7 +348,9 @@ export default async function registerDebugger(pi: ExtensionAPI): Promise<void>
|
|
|
339
348
|
input.path === undefined
|
|
340
349
|
? undefined
|
|
341
350
|
: (manager.breakpoint(input.path) ??
|
|
342
|
-
snapshot.breakpoints.find(
|
|
351
|
+
(deletedSnapshot ?? snapshot).breakpoints.find(
|
|
352
|
+
(candidate) => candidate.source === input.path,
|
|
353
|
+
));
|
|
343
354
|
const sourceFile =
|
|
344
355
|
input.path === undefined ? undefined : manager.sourceFile(input.path);
|
|
345
356
|
const action =
|
|
@@ -384,9 +395,9 @@ export default async function registerDebugger(pi: ExtensionAPI): Promise<void>
|
|
|
384
395
|
openWorldHint: false,
|
|
385
396
|
},
|
|
386
397
|
label: "Debug session",
|
|
387
|
-
promptSnippet: "
|
|
398
|
+
promptSnippet: "Configure a local debugger session",
|
|
388
399
|
description:
|
|
389
|
-
"Use debug to
|
|
400
|
+
"Use debug to configure a local debugger session without launching the adapter or program.",
|
|
390
401
|
parameters: debugParameters,
|
|
391
402
|
outputSchema: debugOutputSchema,
|
|
392
403
|
async execute(_toolCallId, input, _signal, _onUpdate, context) {
|
|
@@ -409,7 +420,7 @@ export default async function registerDebugger(pi: ExtensionAPI): Promise<void>
|
|
|
409
420
|
content: [
|
|
410
421
|
{
|
|
411
422
|
type: "text",
|
|
412
|
-
text: `${renderDebugSession(session)}\nSource: ${details.sourceResource}\nBreakpoints: ${details.breakpointsResource}\n\nNext: read ${details.sourceResource} with views ["anchors"], then insert
|
|
423
|
+
text: `${renderDebugSession(session)}\nSource: ${details.sourceResource}\nBreakpoints: ${details.breakpointsResource}\n\nNext: read ${session.source} to inspect the configured session. To set a breakpoint, read ${details.sourceResource} with views ["anchors"], then insert "breakpoint" at an anchor.`,
|
|
413
424
|
},
|
|
414
425
|
],
|
|
415
426
|
details,
|
|
@@ -481,6 +492,7 @@ function createDebugResourceResolver(manager: DebugSessionManager, id: string):
|
|
|
481
492
|
resource: {
|
|
482
493
|
source,
|
|
483
494
|
async read() {
|
|
495
|
+
await manager.refresh(session);
|
|
484
496
|
const sourceFile = manager.sourceFile(source);
|
|
485
497
|
if (sourceFile !== undefined) {
|
|
486
498
|
return [debugSourceContent(sourceFile, await manager.readSource(source))];
|
|
@@ -608,7 +620,7 @@ function renderBreakpointList(session: DebugSession): string {
|
|
|
608
620
|
return [...session.breakpoints.values()]
|
|
609
621
|
.map(
|
|
610
622
|
(breakpoint) =>
|
|
611
|
-
`${breakpoint.verified ? "●" : "○"} ${breakpoint.file}:${breakpoint.line} · ${breakpoint.source}`,
|
|
623
|
+
`${breakpoint.verified ? "●" : "○"} ${breakpoint.file}:${breakpoint.line} · ${breakpoint.source} (${breakpoint.verified ? "verified" : "pending"})`,
|
|
612
624
|
)
|
|
613
625
|
.join("\n");
|
|
614
626
|
}
|
|
@@ -202,6 +202,11 @@ export class DapClient {
|
|
|
202
202
|
return response;
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
/** Consume an already buffered control event without waiting for a new one. */
|
|
206
|
+
takeEvent(events: readonly string[]): DapEvent | undefined {
|
|
207
|
+
const index = this.#events.findIndex((event) => events.includes(event.event));
|
|
208
|
+
return index < 0 ? undefined : this.#events.splice(index, 1)[0];
|
|
209
|
+
}
|
|
205
210
|
/** Wait for a matching event. Only the newest 128 control events can be replayed. */
|
|
206
211
|
waitForEvent(event: string, timeoutMs = 30_000): Promise<DapEvent> {
|
|
207
212
|
return this.waitForAnyEvent([event], timeoutMs);
|
|
@@ -51,7 +51,12 @@ export interface DebugBreakpoint {
|
|
|
51
51
|
readonly id: string;
|
|
52
52
|
readonly source: string;
|
|
53
53
|
readonly file: string;
|
|
54
|
-
|
|
54
|
+
/** Requested source line, kept when the adapter relocates the breakpoint. */
|
|
55
|
+
readonly requestedLine: number;
|
|
56
|
+
/** Current line reported by the adapter. */
|
|
57
|
+
line: number;
|
|
58
|
+
/** Adapter identity used by later binding-change events. */
|
|
59
|
+
adapterId?: number;
|
|
55
60
|
verified: boolean;
|
|
56
61
|
}
|
|
57
62
|
|
|
@@ -145,7 +150,11 @@ interface EvaluateBody {
|
|
|
145
150
|
readonly variablesReference?: number;
|
|
146
151
|
}
|
|
147
152
|
interface SetBreakpointsBody {
|
|
148
|
-
readonly breakpoints?: readonly {
|
|
153
|
+
readonly breakpoints?: readonly {
|
|
154
|
+
readonly id?: number;
|
|
155
|
+
readonly verified?: boolean;
|
|
156
|
+
readonly line?: number;
|
|
157
|
+
}[];
|
|
149
158
|
}
|
|
150
159
|
|
|
151
160
|
/** Owns debug sessions and keeps DAP references scoped to their current stop. */
|
|
@@ -245,6 +254,7 @@ export class DebugSessionManager {
|
|
|
245
254
|
id,
|
|
246
255
|
source: `${session.source}/breakpoint/${id}`,
|
|
247
256
|
file,
|
|
257
|
+
requestedLine: line,
|
|
248
258
|
line,
|
|
249
259
|
verified: false,
|
|
250
260
|
};
|
|
@@ -353,6 +363,8 @@ export class DebugSessionManager {
|
|
|
353
363
|
}
|
|
354
364
|
const initialized = client.waitForAnyEvent(["initialized"], 30_000, signal);
|
|
355
365
|
const launch = client.request(recipe.request, recipe.launch, { signal });
|
|
366
|
+
// Configuration can fail before launch is awaited; cleanup must not leave a rejected request unhandled.
|
|
367
|
+
void launch.catch(() => {});
|
|
356
368
|
await initialized;
|
|
357
369
|
await this.#configureBreakpoints(session, client, signal);
|
|
358
370
|
const configurationDone = client.request("configurationDone", undefined, { signal });
|
|
@@ -403,12 +415,41 @@ export class DebugSessionManager {
|
|
|
403
415
|
}
|
|
404
416
|
}
|
|
405
417
|
|
|
418
|
+
/** Refresh execution state from events that arrived after a control wait ended. */
|
|
419
|
+
async refresh(session: DebugSession): Promise<void> {
|
|
420
|
+
if (session.client === undefined) return;
|
|
421
|
+
for (
|
|
422
|
+
let event = session.client.takeEvent(["breakpoint"]);
|
|
423
|
+
event !== undefined;
|
|
424
|
+
event = session.client.takeEvent(["breakpoint"])
|
|
425
|
+
) {
|
|
426
|
+
this.#updateBreakpoint(session, event);
|
|
427
|
+
}
|
|
428
|
+
if (session.status === "terminated") return;
|
|
429
|
+
for (;;) {
|
|
430
|
+
const event = session.client.takeEvent([
|
|
431
|
+
...(session.status === "running" ? ["stopped"] : []),
|
|
432
|
+
"terminated",
|
|
433
|
+
"exited",
|
|
434
|
+
]);
|
|
435
|
+
if (event === undefined) return;
|
|
436
|
+
if (event.event === "stopped") await this.#captureStop(session, event);
|
|
437
|
+
else {
|
|
438
|
+
session.status = "terminated";
|
|
439
|
+
session.stop = undefined;
|
|
440
|
+
this.#notify(session);
|
|
441
|
+
await session.javaRuntime?.close();
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
406
446
|
/** Continue or step and wait for the next observable execution state. */
|
|
407
447
|
async command(
|
|
408
448
|
session: DebugSession,
|
|
409
449
|
command: "continue" | "next" | "stepIn" | "stepOut",
|
|
410
450
|
signal?: AbortSignal,
|
|
411
451
|
): Promise<DebugSession> {
|
|
452
|
+
await this.refresh(session);
|
|
412
453
|
if (session.status !== "stopped" || session.stop === undefined) {
|
|
413
454
|
throw new Error(`Cannot ${command} while session is ${session.status}`);
|
|
414
455
|
}
|
|
@@ -429,10 +470,13 @@ export class DebugSessionManager {
|
|
|
429
470
|
expression: string,
|
|
430
471
|
signal?: AbortSignal,
|
|
431
472
|
): Promise<DebugEvaluation> {
|
|
473
|
+
await this.refresh(session);
|
|
432
474
|
if (session.status !== "stopped" || session.stop?.frame === undefined) {
|
|
433
475
|
throw new Error(`Cannot evaluate while session is ${session.status}`);
|
|
434
476
|
}
|
|
435
477
|
const trimmed = expression.trim();
|
|
478
|
+
const stop = session.stop;
|
|
479
|
+
const frameId = session.stop.frame.id;
|
|
436
480
|
if (trimmed.length === 0) throw new Error("Debug evaluation requires an expression");
|
|
437
481
|
const response = await requiredClient(session).request<EvaluateBody>(
|
|
438
482
|
"evaluate",
|
|
@@ -442,6 +486,8 @@ export class DebugSessionManager {
|
|
|
442
486
|
if (typeof response.result !== "string") {
|
|
443
487
|
throw new Error("Debug adapter returned no evaluation result");
|
|
444
488
|
}
|
|
489
|
+
session.stop = { ...stop, variables: await this.#readVariables(session, frameId) };
|
|
490
|
+
this.#notify(session);
|
|
445
491
|
return {
|
|
446
492
|
expression: trimmed,
|
|
447
493
|
result: response.result,
|
|
@@ -759,13 +805,16 @@ export class DebugSessionManager {
|
|
|
759
805
|
"setBreakpoints",
|
|
760
806
|
{
|
|
761
807
|
source: { path: file, name: path.basename(file) },
|
|
762
|
-
breakpoints: breakpoints.map(({
|
|
808
|
+
breakpoints: breakpoints.map(({ requestedLine }) => ({ line: requestedLine })),
|
|
763
809
|
sourceModified: false,
|
|
764
810
|
},
|
|
765
811
|
{ signal },
|
|
766
812
|
);
|
|
767
813
|
for (const [index, breakpoint] of breakpoints.entries()) {
|
|
768
|
-
|
|
814
|
+
const bound = response.breakpoints?.[index];
|
|
815
|
+
breakpoint.verified = bound?.verified === true;
|
|
816
|
+
breakpoint.line = bound?.line ?? breakpoint.requestedLine;
|
|
817
|
+
breakpoint.adapterId = bound?.id;
|
|
769
818
|
}
|
|
770
819
|
}
|
|
771
820
|
|
|
@@ -800,19 +849,7 @@ export class DebugSessionManager {
|
|
|
800
849
|
return;
|
|
801
850
|
}
|
|
802
851
|
if (event.event === "breakpoint") {
|
|
803
|
-
|
|
804
|
-
const changedSource = asRecord(changed.source);
|
|
805
|
-
for (const breakpoint of session.breakpoints.values()) {
|
|
806
|
-
if (
|
|
807
|
-
changed.verified === true &&
|
|
808
|
-
typeof changed.line === "number" &&
|
|
809
|
-
changed.line === breakpoint.line &&
|
|
810
|
-
typeof changedSource.path === "string" &&
|
|
811
|
-
sameFilePath(changedSource.path, breakpoint.file)
|
|
812
|
-
) {
|
|
813
|
-
breakpoint.verified = true;
|
|
814
|
-
}
|
|
815
|
-
}
|
|
852
|
+
this.#updateBreakpoint(session, event);
|
|
816
853
|
await this.#waitForStop(session, signal);
|
|
817
854
|
return;
|
|
818
855
|
}
|
|
@@ -887,6 +924,22 @@ export class DebugSessionManager {
|
|
|
887
924
|
if (session.options.adapter === "shell") this.#notify(session);
|
|
888
925
|
}
|
|
889
926
|
|
|
927
|
+
#updateBreakpoint(session: DebugSession, event: DapEvent): void {
|
|
928
|
+
const changed = asRecord(asRecord(event.body).breakpoint);
|
|
929
|
+
const source = asRecord(changed.source);
|
|
930
|
+
for (const breakpoint of session.breakpoints.values()) {
|
|
931
|
+
const matches =
|
|
932
|
+
typeof changed.id === "number" && breakpoint.adapterId !== undefined
|
|
933
|
+
? changed.id === breakpoint.adapterId
|
|
934
|
+
: typeof source.path === "string" &&
|
|
935
|
+
sameFilePath(source.path, breakpoint.file) &&
|
|
936
|
+
changed.line === breakpoint.requestedLine;
|
|
937
|
+
if (!matches) continue;
|
|
938
|
+
if (typeof changed.line === "number") breakpoint.line = changed.line;
|
|
939
|
+
breakpoint.verified = changed.verified === true;
|
|
940
|
+
}
|
|
941
|
+
this.#notify(session);
|
|
942
|
+
}
|
|
890
943
|
async #captureStop(session: DebugSession, event: DapEvent, notify = true): Promise<void> {
|
|
891
944
|
const client = requiredClient(session);
|
|
892
945
|
const body = asRecord(event.body);
|
|
@@ -902,27 +955,7 @@ export class DebugSessionManager {
|
|
|
902
955
|
}
|
|
903
956
|
}
|
|
904
957
|
}
|
|
905
|
-
const variables
|
|
906
|
-
if (frame !== undefined) {
|
|
907
|
-
const scopes =
|
|
908
|
-
(await client.request<ScopesBody>("scopes", { frameId: frame.id })).scopes ?? [];
|
|
909
|
-
const localScopes =
|
|
910
|
-
session.options.adapter === "r"
|
|
911
|
-
? scopes
|
|
912
|
-
: scopes.filter((item) =>
|
|
913
|
-
[item.name.toLowerCase(), item.presentationHint?.toLowerCase()].some(
|
|
914
|
-
(value) => value?.includes("local") === true || value === "variables",
|
|
915
|
-
),
|
|
916
|
-
);
|
|
917
|
-
for (const scope of localScopes) {
|
|
918
|
-
const values = await client.request<VariablesBody>("variables", {
|
|
919
|
-
variablesReference: scope.variablesReference,
|
|
920
|
-
start: 0,
|
|
921
|
-
count: 100,
|
|
922
|
-
});
|
|
923
|
-
variables.push(...(values.variables ?? []));
|
|
924
|
-
}
|
|
925
|
-
}
|
|
958
|
+
const variables = frame === undefined ? [] : await this.#readVariables(session, frame.id);
|
|
926
959
|
session.stopGeneration++;
|
|
927
960
|
session.stop = {
|
|
928
961
|
generation: session.stopGeneration,
|
|
@@ -936,6 +969,28 @@ export class DebugSessionManager {
|
|
|
936
969
|
if (notify) this.#notify(session);
|
|
937
970
|
}
|
|
938
971
|
|
|
972
|
+
async #readVariables(session: DebugSession, frameId: number): Promise<DebugVariable[]> {
|
|
973
|
+
const client = requiredClient(session);
|
|
974
|
+
const scopes = (await client.request<ScopesBody>("scopes", { frameId })).scopes ?? [];
|
|
975
|
+
const localScopes =
|
|
976
|
+
session.options.adapter === "r"
|
|
977
|
+
? scopes
|
|
978
|
+
: scopes.filter((item) =>
|
|
979
|
+
[item.name.toLowerCase(), item.presentationHint?.toLowerCase()].some(
|
|
980
|
+
(value) => value?.includes("local") === true || value === "variables",
|
|
981
|
+
),
|
|
982
|
+
);
|
|
983
|
+
const variables: DebugVariable[] = [];
|
|
984
|
+
for (const scope of localScopes) {
|
|
985
|
+
const values = await client.request<VariablesBody>("variables", {
|
|
986
|
+
variablesReference: scope.variablesReference,
|
|
987
|
+
start: 0,
|
|
988
|
+
count: 100,
|
|
989
|
+
});
|
|
990
|
+
variables.push(...(values.variables ?? []));
|
|
991
|
+
}
|
|
992
|
+
return variables;
|
|
993
|
+
}
|
|
939
994
|
#notify(session: DebugSession): void {
|
|
940
995
|
const snapshot = this.snapshot(session);
|
|
941
996
|
for (const listener of this.#changeListeners) listener(snapshot);
|
|
@@ -130,15 +130,16 @@ export default async function registerDiagnostics(pi: ExtensionAPI): Promise<voi
|
|
|
130
130
|
{ ...first, text: `${status}\n${first.text}` },
|
|
131
131
|
...updated.content.slice(1),
|
|
132
132
|
],
|
|
133
|
+
details: { ...updated.details, diagnosticStatus: status },
|
|
133
134
|
};
|
|
134
135
|
},
|
|
135
136
|
};
|
|
136
137
|
},
|
|
137
138
|
});
|
|
138
139
|
api.describe({
|
|
139
|
-
path: "diagnostics:<path> — lint and language-server diagnostics with reporting tool and readiness.
|
|
140
|
+
path: "diagnostics:<path> — lint and language-server diagnostics with reporting tool and readiness.",
|
|
140
141
|
views:
|
|
141
|
-
"diagnostics — diagnostics alongside source text, with reporting tool and readiness.
|
|
142
|
+
"diagnostics — diagnostics alongside source text, with reporting tool and readiness.",
|
|
142
143
|
});
|
|
143
144
|
},
|
|
144
145
|
} satisfies ReadPlugin;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-formatter",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-doctor": "0.7.
|
|
6
|
+
"pi-agent-doctor": "0.7.3"
|
|
7
7
|
},
|
|
8
8
|
"pi": {
|
|
9
9
|
"extensions": [
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"@earendil-works/pi-coding-agent": "*",
|
|
15
|
-
"pi-agent-ide": "0.7.
|
|
15
|
+
"pi-agent-ide": "0.7.3"
|
|
16
16
|
},
|
|
17
17
|
"peerDependenciesMeta": {
|
|
18
18
|
"pi-agent-ide": {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-lint",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-doctor": "0.7.
|
|
7
|
-
"pi-agent-invariant": "0.7.
|
|
8
|
-
"pi-agent-read": "0.7.
|
|
9
|
-
"pi-agent-resource": "0.7.
|
|
10
|
-
"pi-agent-text": "0.7.
|
|
6
|
+
"pi-agent-doctor": "0.7.3",
|
|
7
|
+
"pi-agent-invariant": "0.7.3",
|
|
8
|
+
"pi-agent-read": "0.7.3",
|
|
9
|
+
"pi-agent-resource": "0.7.3",
|
|
10
|
+
"pi-agent-text": "0.7.3"
|
|
11
11
|
},
|
|
12
12
|
"pi": {
|
|
13
13
|
"extensions": [
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"@earendil-works/pi-coding-agent": "*",
|
|
19
|
-
"pi-agent-ide": "0.7.
|
|
19
|
+
"pi-agent-ide": "0.7.3"
|
|
20
20
|
},
|
|
21
21
|
"peerDependenciesMeta": {
|
|
22
22
|
"pi-agent-ide": {
|
|
@@ -143,7 +143,7 @@ export default async function registerLsp(pi: ExtensionAPI): Promise<void> {
|
|
|
143
143
|
api
|
|
144
144
|
.tool(operation)
|
|
145
145
|
.describe(
|
|
146
|
-
"Use symbol:<file>#<selector> as path to select one exact declaration without start/end. Use parent/child for ambiguous names. Copy/
|
|
146
|
+
"Use symbol:<file>#<selector> as path to select one exact declaration without start/end. Use parent/child for ambiguous names. For declaration-text Copy/Move, supply an explicit target and destination anchor. This text fallback leaves imports and references unchanged; it is not semantic rename." +
|
|
147
147
|
(operation === "replace"
|
|
148
148
|
? " Use symbol:<file>#<selector>#name with text containing the new name for native LSP rename across references. Omit start/end. A failed server rename never falls back to identifier text replacement."
|
|
149
149
|
: ""),
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-lsp",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"cross-spawn": "^7.0.6",
|
|
7
|
-
"pi-agent-doctor": "0.7.
|
|
8
|
-
"pi-agent-invariant": "0.7.
|
|
9
|
-
"pi-agent-read": "0.7.
|
|
10
|
-
"pi-agent-resource": "0.7.
|
|
11
|
-
"pi-agent-search": "0.7.
|
|
12
|
-
"pi-agent-text": "0.7.
|
|
13
|
-
"pi-agent-text-editor": "0.7.
|
|
7
|
+
"pi-agent-doctor": "0.7.3",
|
|
8
|
+
"pi-agent-invariant": "0.7.3",
|
|
9
|
+
"pi-agent-read": "0.7.3",
|
|
10
|
+
"pi-agent-resource": "0.7.3",
|
|
11
|
+
"pi-agent-search": "0.7.3",
|
|
12
|
+
"pi-agent-text": "0.7.3",
|
|
13
|
+
"pi-agent-text-editor": "0.7.3",
|
|
14
14
|
"vscode-jsonrpc": "^9.0.0",
|
|
15
15
|
"vscode-uri": "^3.1.0"
|
|
16
16
|
},
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@earendil-works/pi-coding-agent": "*",
|
|
24
|
-
"pi-agent-ide": "0.7.
|
|
24
|
+
"pi-agent-ide": "0.7.3"
|
|
25
25
|
},
|
|
26
26
|
"peerDependenciesMeta": {
|
|
27
27
|
"pi-agent-ide": {
|
|
@@ -9,7 +9,8 @@ export function createDeclarationTargets(managerFor: LspManagerProvider): TextTa
|
|
|
9
9
|
id: "lsp-declaration-target",
|
|
10
10
|
async tryResolve(value, context) {
|
|
11
11
|
const reference = parseCodeViewReference(value, "symbol");
|
|
12
|
-
|
|
12
|
+
// #name belongs to the rename pre-edit handler, not declaration-text fallback.
|
|
13
|
+
if (reference === undefined || value.endsWith("#name")) return { kind: "not-handled" };
|
|
13
14
|
if (reference.selector === undefined)
|
|
14
15
|
return {
|
|
15
16
|
kind: "rejected",
|
|
@@ -108,7 +108,6 @@ export function createLspSearchResolver(
|
|
|
108
108
|
);
|
|
109
109
|
if (result.complete && result.hits.length)
|
|
110
110
|
lines.unshift(`SEARCH#${result.sessionId}:all:match selects all exact symbol matches.`);
|
|
111
|
-
if (!result.complete) lines.push("Incomplete results; not a complete edit scope.");
|
|
112
111
|
if (result.hits.length > 100) lines.push("Preview shortened; full source targets retained.");
|
|
113
112
|
return {
|
|
114
113
|
content: [{ type: "text", text: [heading, ...lines].join("\n") }],
|