pi-agent-ide 0.7.0 → 0.7.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 +44 -0
- package/dist/chunk-6U5OU77O.js +3 -0
- package/dist/{chunk-6CZO43OH.js → chunk-BU7IZLKB.js} +1 -1
- package/dist/chunk-EURHXLN3.js +2 -0
- package/dist/{chunk-PYPPV2F5.js → chunk-F6IWZKOG.js} +6 -6
- package/dist/{chunk-GBLKIB6O.js → chunk-H445SHSJ.js} +2 -2
- 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-YRF7OATP.js → chunk-KOVPDKSJ.js} +1 -1
- package/dist/chunk-MXLSGMRZ.js +3 -0
- package/dist/chunk-NRZO5KJT.js +9 -0
- package/dist/chunk-OB46OPMZ.js +1 -0
- package/dist/chunk-PKSQT6TC.js +1 -0
- package/dist/{chunk-PNU3E7IO.js → chunk-Q6CZ6GBR.js} +2 -2
- package/dist/{chunk-EDURPQAV.js → chunk-QRJLIV6P.js} +6 -6
- package/dist/chunk-QUYXINGZ.js +7 -0
- package/dist/{chunk-OBNING2A.js → chunk-S5PL5DFQ.js} +1 -1
- package/dist/chunk-SBP3ABH4.js +5 -0
- package/dist/{chunk-FXNKMNSJ.js → chunk-SJ4UZ4GU.js} +1 -1
- package/dist/chunk-SNF7PDDX.js +11 -0
- package/dist/{chunk-AJRIASPQ.js → chunk-STBJO3Z3.js} +1 -1
- package/dist/{chunk-3HYXQ4YA.js → chunk-TQGE7RH6.js} +13 -13
- package/dist/{chunk-S5LXX32D.js → chunk-XDG7EQRN.js} +3 -3
- package/dist/{chunk-F5YZG77W.js → chunk-XH5WN5XA.js} +1 -1
- package/dist/chunk-YWQS33DF.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 +2 -2
- package/dist/entry-26.js +1 -1
- package/dist/entry-27.js +2 -2
- package/dist/entry-28.js +1 -1
- package/dist/entry-29.js +1 -1
- package/dist/entry-31.js +15 -13
- package/dist/entry-33.js +2 -1
- package/dist/entry-37.js +6 -6
- package/dist/entry-41.js +1 -1
- package/dist/entry-42.js +1 -1
- package/dist/entry-43.js +1 -1
- package/dist/entry-44.js +1 -1
- package/dist/entry-45.js +20 -13
- 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 +8 -7
- 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-57.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 +51 -43
- package/dist/entry-78.js +14 -14
- package/dist/entry-79.js +1 -1
- package/dist/entry-80.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 +37 -9
- package/docs/agent-guides/editing.md +35 -46
- package/docs/agent-guides/git-changes.md +10 -0
- package/docs/agent-guides/read-resources.md +9 -50
- package/docs/agent-guides/search-code.md +18 -17
- package/docs/agent-guides/select-code.md +62 -140
- package/docs/agent-guides/terminal.md +9 -1
- package/docs/configuration.md +1 -1
- package/docs/releases.md +4 -0
- package/docs/research/native-codemode-batch-decision.md +2 -0
- package/docs/structured-results.md +27 -62
- package/docs/tools.md +15 -11
- 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/index.ts +7 -6
- 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/index.ts +4 -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 +5 -4
- package/node_modules/pi-agent-ide-ast/src/overflow-handler.ts +2 -2
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +35 -9
- package/node_modules/pi-agent-ide-ast/src/select-presentation.ts +1 -1
- package/node_modules/pi-agent-ide-ast/src/select-schema.ts +10 -8
- package/node_modules/pi-agent-ide-ast/src/tool-select.ts +28 -3
- package/node_modules/pi-agent-ide-changes/index.ts +4 -3
- package/node_modules/pi-agent-ide-changes/package.json +8 -8
- package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +66 -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 +3 -3
- package/node_modules/pi-agent-ide-lsp/package.json +9 -9
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +5 -2
- 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/plugin-protocol.ts +1 -1
- package/node_modules/pi-agent-read/src/api/read-parameters.ts +38 -1
- package/node_modules/pi-agent-read/src/api/tools/read.ts +18 -1
- package/node_modules/pi-agent-read/src/core/extension.ts +8 -2
- package/node_modules/pi-agent-read/src/core/read-core.ts +54 -35
- 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/read/structured-result.ts +3 -3
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +108 -46
- 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 +186 -9
- 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-resource/src/tool-result.ts +13 -1
- 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 +3 -3
- 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/index.ts +1 -1
- 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/index.ts +65 -4
- package/node_modules/pi-agent-text-anchor-exact/package.json +3 -3
- package/node_modules/pi-agent-text-anchor-exact/src/anchor.ts +12 -2
- package/node_modules/pi-agent-text-anchor-line-hash/index.ts +4 -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/edit-completion.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +2 -1
- 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/stale-anchor-message.ts +1 -1
- 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/extension.ts +10 -3
- package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +3 -13
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +35 -6
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +19 -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 +232 -144
- 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 +7 -2
- package/node_modules/pi-agent-text-editor/src/core/structured-result.ts +49 -214
- 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 +152 -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 +76 -32
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +409 -209
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +6 -9
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +10 -3
- 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 +1 -1
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +3 -4
- 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 +54 -5
- 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-call-interception/src/index.ts +3 -0
- package/node_modules/pi-agent-tool-ui/package.json +1 -1
- package/node_modules/pi-agent-web/index.ts +4 -3
- 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 +35 -35
- package/src/composite/nested-tool-rendering.ts +64 -6
- package/src/composite/output-limits.ts +125 -0
- package/src/composite/responses-tools.ts +25 -0
- package/src/composite/text-results.ts +372 -0
- package/src/documentation/extension.ts +11 -9
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +7 -6
- 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/index.ts +4 -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/index.ts +4 -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/plugin-protocol.ts +1 -1
- package/src/extensions/pi-agent-read/src/api/read-parameters.ts +38 -1
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +18 -1
- package/src/extensions/pi-agent-read/src/core/extension.ts +8 -2
- package/src/extensions/pi-agent-read/src/core/read-core.ts +54 -35
- 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/read/structured-result.ts +3 -3
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +108 -46
- package/src/extensions/pi-agent-search/package.json +5 -5
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +1 -1
- 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 +3 -3
- 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/index.ts +65 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +3 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/anchor.ts +12 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +4 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/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 +54 -5
- 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/edit-completion.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +2 -1
- 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/stale-anchor-message.ts +1 -1
- 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/extension.ts +10 -3
- package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +3 -13
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +35 -6
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +19 -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 +232 -144
- 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 +7 -2
- package/src/extensions/pi-agent-text-editor/src/core/structured-result.ts +49 -214
- 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 +152 -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 +76 -32
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +409 -209
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +6 -9
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +10 -3
- 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 +1 -1
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +3 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +10 -4
- package/src/pi-agent-ide.ts +15 -1
- package/src/plugins/pi-agent-ide-ast/package.json +13 -13
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +5 -4
- package/src/plugins/pi-agent-ide-ast/src/overflow-handler.ts +2 -2
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +35 -9
- package/src/plugins/pi-agent-ide-ast/src/select-presentation.ts +1 -1
- package/src/plugins/pi-agent-ide-ast/src/select-schema.ts +10 -8
- package/src/plugins/pi-agent-ide-ast/src/tool-select.ts +28 -3
- package/src/plugins/pi-agent-ide-changes/index.ts +4 -3
- package/src/plugins/pi-agent-ide-changes/package.json +8 -8
- package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +66 -4
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +8 -11
- package/src/plugins/pi-agent-ide-debugger/index.ts +22 -10
- 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 +6 -3
- 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 +3 -3
- package/src/plugins/pi-agent-ide-lsp/package.json +9 -9
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +5 -2
- package/src/plugins/pi-agent-ide-terminal/src/output-limits.ts +3 -3
- package/src/plugins/pi-agent-ide-terminal/src/resources.ts +8 -6
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +3 -3
- package/src/plugins/pi-agent-ide-vision/index.ts +13 -4
- package/src/post-edit/gate.ts +13 -2
- package/dist/chunk-3JO7QFIL.js +0 -1
- package/dist/chunk-4NIFBFFR.js +0 -11
- package/dist/chunk-64M3SQPG.js +0 -3
- package/dist/chunk-7LZKOHH2.js +0 -1
- package/dist/chunk-EAZGN5ND.js +0 -7
- package/dist/chunk-FK42RSF4.js +0 -1
- package/dist/chunk-KBP3QUDT.js +0 -2
- package/dist/chunk-KR36BT5E.js +0 -1
- package/dist/chunk-MBUXFKIW.js +0 -3
- package/dist/chunk-OE7QVAI2.js +0 -5
- package/dist/chunk-SILJ3OL4.js +0 -9
- package/dist/chunk-SQKAXYIR.js +0 -2
- package/dist/chunk-VCGNVTXQ.js +0 -1
- package/src/extensions/pi-agent-read/src/core/tools/read/temp-resource-store.ts +0 -105
|
@@ -45,6 +45,22 @@ export const indexChangeSchema = Type.Object(
|
|
|
45
45
|
{ additionalProperties: false },
|
|
46
46
|
);
|
|
47
47
|
|
|
48
|
+
const unstageChangeSchema = Type.Object(
|
|
49
|
+
{
|
|
50
|
+
file: {
|
|
51
|
+
...indexChangeSchema.properties.file,
|
|
52
|
+
description:
|
|
53
|
+
"Path to a tracked text file in the current Git worktree. Relative paths resolve from the workspace.",
|
|
54
|
+
},
|
|
55
|
+
change: {
|
|
56
|
+
...indexChangeSchema.properties.change,
|
|
57
|
+
description:
|
|
58
|
+
'Select one complete current CHANGE#HASH anchor returned by read with views: ["changes"].',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{ additionalProperties: false },
|
|
62
|
+
);
|
|
63
|
+
|
|
48
64
|
interface IndexChangeToolDetails {
|
|
49
65
|
readonly action: ChangeIndexAction;
|
|
50
66
|
readonly change: string;
|
|
@@ -70,6 +86,24 @@ export function createIndexChangeTool(
|
|
|
70
86
|
) {
|
|
71
87
|
const execute = createIndexChangeExecutor(action, executor, queue);
|
|
72
88
|
const pastTense = action === "stage" ? "Staged" : "Unstaged";
|
|
89
|
+
const parameters =
|
|
90
|
+
action === "stage"
|
|
91
|
+
? {
|
|
92
|
+
...indexChangeSchema,
|
|
93
|
+
properties: {
|
|
94
|
+
file: {
|
|
95
|
+
...indexChangeSchema.properties.file,
|
|
96
|
+
description:
|
|
97
|
+
"Path to the tracked text file, absolute or relative to the current working directory.",
|
|
98
|
+
},
|
|
99
|
+
change: {
|
|
100
|
+
...indexChangeSchema.properties.change,
|
|
101
|
+
description:
|
|
102
|
+
'Use the complete current CHANGE#HASH anchor shown by read with views: ["changes"].',
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
}
|
|
106
|
+
: unstageChangeSchema;
|
|
73
107
|
|
|
74
108
|
return defineTool<typeof indexChangeSchema, IndexChangeToolDetails>({
|
|
75
109
|
name: action,
|
|
@@ -87,8 +121,11 @@ export function createIndexChangeTool(
|
|
|
87
121
|
label: action,
|
|
88
122
|
|
|
89
123
|
promptSnippet: `${pastTense.slice(0, -1)} a selected Git change`,
|
|
90
|
-
description:
|
|
91
|
-
|
|
124
|
+
description:
|
|
125
|
+
action === "stage"
|
|
126
|
+
? "Use stage to add one selected Git change to the index without changing the worktree file."
|
|
127
|
+
: "Use unstage to remove one selected Git change from the index. Worktree content is kept.",
|
|
128
|
+
parameters,
|
|
92
129
|
outputSchema: indexOutputSchema,
|
|
93
130
|
async execute(_toolCallId, parameters, signal, _onUpdate, context) {
|
|
94
131
|
try {
|
|
@@ -148,7 +185,11 @@ export function createIndexChangeExecutor(
|
|
|
148
185
|
const creation = await ChangeService.create(executor, context.cwd, signal);
|
|
149
186
|
|
|
150
187
|
if (creation.status !== "ready") {
|
|
151
|
-
throw new Error(
|
|
188
|
+
throw new Error(
|
|
189
|
+
action === "stage"
|
|
190
|
+
? `Cannot stage ${parameters.file}: ${creation.message}`
|
|
191
|
+
: creation.message,
|
|
192
|
+
);
|
|
152
193
|
}
|
|
153
194
|
|
|
154
195
|
const result = await creation.service.changeIndex(
|
|
@@ -163,10 +204,31 @@ export function createIndexChangeExecutor(
|
|
|
163
204
|
);
|
|
164
205
|
|
|
165
206
|
if (result.status === "unavailable") {
|
|
166
|
-
|
|
207
|
+
if (action === "stage" && result.reason === "stale-selector") {
|
|
208
|
+
throw new Error(
|
|
209
|
+
`${result.message}. Read ${parameters.file} with views: ["changes"] and use a current CHANGE# anchor.`,
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
if (action === "stage" && result.reason === "index-write-failed" && !signal?.aborted) {
|
|
213
|
+
throw new Error(
|
|
214
|
+
`${result.message}\nThe index may have changed. Read ${parameters.file} with views: ["changes"] before retrying.`,
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
throw new Error(
|
|
218
|
+
action === "stage" && result.reason !== "index-write-failed"
|
|
219
|
+
? `Cannot stage ${parameters.file}: ${result.message}`
|
|
220
|
+
: result.message,
|
|
221
|
+
);
|
|
167
222
|
}
|
|
168
223
|
|
|
169
224
|
if (result.status === "not-applicable") {
|
|
225
|
+
if (action === "stage") {
|
|
226
|
+
const reason =
|
|
227
|
+
result.reason === "clean"
|
|
228
|
+
? "the worktree text matches HEAD"
|
|
229
|
+
: "the file is not present in HEAD";
|
|
230
|
+
throw new Error(`Cannot stage ${parameters.file}: ${reason}.`);
|
|
231
|
+
}
|
|
170
232
|
throw new Error(`${action} is not applicable to ${file}: ${result.reason}`);
|
|
171
233
|
}
|
|
172
234
|
|
|
@@ -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 },
|
|
@@ -216,9 +220,11 @@ export default async function registerDebugger(pi: ExtensionAPI): Promise<void>
|
|
|
216
220
|
},
|
|
217
221
|
});
|
|
218
222
|
api.addView({ view: "breakpoints", presenter: breakpointPresenter });
|
|
219
|
-
api.describe(
|
|
220
|
-
|
|
221
|
-
|
|
223
|
+
api.describe({
|
|
224
|
+
path: "debug:<session> — debugger state.",
|
|
225
|
+
views:
|
|
226
|
+
"breakpoints — current debugger breakpoints beside source lines. Normal files include every current session; debug sources are session-scoped.",
|
|
227
|
+
});
|
|
222
228
|
},
|
|
223
229
|
} satisfies ReadPlugin;
|
|
224
230
|
const editorPlugin = {
|
|
@@ -227,6 +233,11 @@ export default async function registerDebugger(pi: ExtensionAPI): Promise<void>
|
|
|
227
233
|
id: "debugger",
|
|
228
234
|
setup(api) {
|
|
229
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
|
+
);
|
|
230
241
|
api.tool("insert").addSemanticHandler({
|
|
231
242
|
matches: (input) => matchesDebugInsert(input, manager),
|
|
232
243
|
execute: async (context, input) => {
|
|
@@ -248,7 +259,7 @@ export default async function registerDebugger(pi: ExtensionAPI): Promise<void>
|
|
|
248
259
|
);
|
|
249
260
|
return {
|
|
250
261
|
source: breakpoint.source,
|
|
251
|
-
summary: `Breakpoint ${breakpoint.source}
|
|
262
|
+
summary: `Breakpoint ${breakpoint.source} registered at ${path.relative(session.options.cwd, breakpoint.file)}:${breakpoint.line} (${breakpoint.verified ? "verified" : "pending"}).`,
|
|
252
263
|
data: {
|
|
253
264
|
kind: "debug-breakpoint",
|
|
254
265
|
session: session.source,
|
|
@@ -382,9 +393,9 @@ export default async function registerDebugger(pi: ExtensionAPI): Promise<void>
|
|
|
382
393
|
openWorldHint: false,
|
|
383
394
|
},
|
|
384
395
|
label: "Debug session",
|
|
385
|
-
promptSnippet: "
|
|
396
|
+
promptSnippet: "Configure a local debugger session",
|
|
386
397
|
description:
|
|
387
|
-
"Use debug to
|
|
398
|
+
"Use debug to configure a local debugger session without launching the adapter or program.",
|
|
388
399
|
parameters: debugParameters,
|
|
389
400
|
outputSchema: debugOutputSchema,
|
|
390
401
|
async execute(_toolCallId, input, _signal, _onUpdate, context) {
|
|
@@ -407,7 +418,7 @@ export default async function registerDebugger(pi: ExtensionAPI): Promise<void>
|
|
|
407
418
|
content: [
|
|
408
419
|
{
|
|
409
420
|
type: "text",
|
|
410
|
-
text: `${renderDebugSession(session)}\nSource: ${details.sourceResource}\nBreakpoints: ${details.breakpointsResource}\n\nNext: read ${details.sourceResource} with views ["anchors"], then insert
|
|
421
|
+
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.`,
|
|
411
422
|
},
|
|
412
423
|
],
|
|
413
424
|
details,
|
|
@@ -479,6 +490,7 @@ function createDebugResourceResolver(manager: DebugSessionManager, id: string):
|
|
|
479
490
|
resource: {
|
|
480
491
|
source,
|
|
481
492
|
async read() {
|
|
493
|
+
await manager.refresh(session);
|
|
482
494
|
const sourceFile = manager.sourceFile(source);
|
|
483
495
|
if (sourceFile !== undefined) {
|
|
484
496
|
return [debugSourceContent(sourceFile, await manager.readSource(source))];
|
|
@@ -606,7 +618,7 @@ function renderBreakpointList(session: DebugSession): string {
|
|
|
606
618
|
return [...session.breakpoints.values()]
|
|
607
619
|
.map(
|
|
608
620
|
(breakpoint) =>
|
|
609
|
-
`${breakpoint.verified ? "●" : "○"} ${breakpoint.file}:${breakpoint.line} · ${breakpoint.source}`,
|
|
621
|
+
`${breakpoint.verified ? "●" : "○"} ${breakpoint.file}:${breakpoint.line} · ${breakpoint.source} (${breakpoint.verified ? "verified" : "pending"})`,
|
|
610
622
|
)
|
|
611
623
|
.join("\n");
|
|
612
624
|
}
|
|
@@ -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,14 +130,17 @@ 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
|
-
api.describe(
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
api.describe({
|
|
140
|
+
path: "diagnostics:<path> — lint and language-server diagnostics with reporting tool and readiness.",
|
|
141
|
+
views:
|
|
142
|
+
"diagnostics — diagnostics alongside source text, with reporting tool and readiness.",
|
|
143
|
+
});
|
|
141
144
|
},
|
|
142
145
|
} satisfies ReadPlugin;
|
|
143
146
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-formatter",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-doctor": "0.7.
|
|
6
|
+
"pi-agent-doctor": "0.7.2"
|
|
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.2"
|
|
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.2",
|
|
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.2",
|
|
7
|
+
"pi-agent-invariant": "0.7.2",
|
|
8
|
+
"pi-agent-read": "0.7.2",
|
|
9
|
+
"pi-agent-resource": "0.7.2",
|
|
10
|
+
"pi-agent-text": "0.7.2"
|
|
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.2"
|
|
20
20
|
},
|
|
21
21
|
"peerDependenciesMeta": {
|
|
22
22
|
"pi-agent-ide": {
|
|
@@ -112,9 +112,9 @@ export default async function registerLsp(pi: ExtensionAPI): Promise<void> {
|
|
|
112
112
|
when: { resolvedBy: "any", contentKind: "text" },
|
|
113
113
|
handler: createSourceMappedTextReadHandler(),
|
|
114
114
|
});
|
|
115
|
-
api.describe(
|
|
116
|
-
"symbol:<file>#<selector> — declaration source, e.g. symbol:src/catalog.ts#Catalog/find. graph:<file> — top-level declarations, references and calls; members include selectors. graph:<file>#<selector> — references and incoming/outgoing calls for that declaration or member.",
|
|
117
|
-
);
|
|
115
|
+
api.describe({
|
|
116
|
+
path: "symbol:<file>#<selector> — declaration source, e.g. symbol:src/catalog.ts#Catalog/find. graph:<file> — top-level declarations, references and calls; members include selectors. graph:<file>#<selector> — references and incoming/outgoing calls for that declaration or member.",
|
|
117
|
+
});
|
|
118
118
|
},
|
|
119
119
|
} satisfies ReadPlugin;
|
|
120
120
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-lsp",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
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.2",
|
|
8
|
+
"pi-agent-invariant": "0.7.2",
|
|
9
|
+
"pi-agent-read": "0.7.2",
|
|
10
|
+
"pi-agent-resource": "0.7.2",
|
|
11
|
+
"pi-agent-search": "0.7.2",
|
|
12
|
+
"pi-agent-text": "0.7.2",
|
|
13
|
+
"pi-agent-text-editor": "0.7.2",
|
|
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.2"
|
|
25
25
|
},
|
|
26
26
|
"peerDependenciesMeta": {
|
|
27
27
|
"pi-agent-ide": {
|
|
@@ -52,6 +52,7 @@ export function createLspSearchResolver(
|
|
|
52
52
|
payload: {
|
|
53
53
|
query,
|
|
54
54
|
hits: found.hits,
|
|
55
|
+
sessionId: session.id,
|
|
55
56
|
complete: found.complete,
|
|
56
57
|
navigation: request.navigation,
|
|
57
58
|
data: {
|
|
@@ -87,6 +88,7 @@ export function createLspSearchResolver(
|
|
|
87
88
|
format(payload, context) {
|
|
88
89
|
const result = payload as {
|
|
89
90
|
readonly query: string;
|
|
91
|
+
readonly sessionId: string;
|
|
90
92
|
readonly hits: readonly SymbolHit[];
|
|
91
93
|
readonly complete: boolean;
|
|
92
94
|
readonly navigation?: "references";
|
|
@@ -102,9 +104,10 @@ export function createLspSearchResolver(
|
|
|
102
104
|
.slice(0, 100)
|
|
103
105
|
.map(
|
|
104
106
|
(hit, index) =>
|
|
105
|
-
|
|
107
|
+
`SEARCH#${result.sessionId}:${index + 1}:match ${path.relative(context.cwd, hit.source)}:${hit.lineNumber}:${hit.startColumn + 1} ${hit.role} ${hit.symbol.name} · declared at ${path.relative(context.cwd, hit.symbol.source)}:${hit.symbol.range.startLine}:${hit.symbol.range.startColumn + 1}`,
|
|
106
108
|
);
|
|
107
|
-
if (
|
|
109
|
+
if (result.complete && result.hits.length)
|
|
110
|
+
lines.unshift(`SEARCH#${result.sessionId}:all:match selects all exact symbol matches.`);
|
|
108
111
|
if (result.hits.length > 100) lines.push("Preview shortened; full source targets retained.");
|
|
109
112
|
return {
|
|
110
113
|
content: [{ type: "text", text: [heading, ...lines].join("\n") }],
|
|
@@ -32,9 +32,9 @@ export function formatAgentTerminalSnapshot(snapshot: TerminalSessionSnapshot):
|
|
|
32
32
|
snapshot.completionReason === undefined
|
|
33
33
|
? undefined
|
|
34
34
|
: `completionReason: ${snapshot.completionReason}`,
|
|
35
|
-
snapshot.
|
|
36
|
-
?
|
|
37
|
-
:
|
|
35
|
+
snapshot.status === "running" && snapshot.background
|
|
36
|
+
? `next: Continue independent work or finish your turn; completion or a one-time idle inspection notice will wake the agent. Read ${snapshot.source} to inspect output; use write or insert when input is needed.`
|
|
37
|
+
: undefined,
|
|
38
38
|
`outputRange: ${snapshot.outputStart}-${snapshot.outputEnd}`,
|
|
39
39
|
snapshot.truncated ? "retainedOutput: earlier data omitted from memory" : undefined,
|
|
40
40
|
truncation.truncated ? `fullOutput: ${snapshot.fullOutputPath}` : undefined,
|