pi-agent-ide 0.8.0 → 0.8.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 +70 -40
- package/README.md +15 -8
- package/dist/{chunk-ICDI27GZ.js → chunk-235QMMVA.js} +1 -1
- package/dist/{chunk-N7LMRL64.js → chunk-47SPPIXK.js} +1 -1
- package/dist/chunk-4DIUPEDF.js +2 -0
- package/dist/{chunk-JMVDFOTQ.js → chunk-57F5GTHO.js} +1 -1
- package/dist/{chunk-NULNW6GK.js → chunk-6FGLAVPJ.js} +1 -1
- package/dist/{chunk-KL776TGR.js → chunk-6H32W35W.js} +1 -1
- package/dist/{chunk-QP2QSQ4U.js → chunk-6OJ565FL.js} +1 -1
- package/dist/{chunk-TWWND6NI.js → chunk-6R3Y4AD3.js} +1 -1
- package/dist/{chunk-CPZJPGLG.js → chunk-6T7PSDQW.js} +1 -1
- package/dist/{chunk-4OYVLXWD.js → chunk-6TJPMBUQ.js} +1 -1
- package/dist/{chunk-SBLKPTL3.js → chunk-6XFUICD7.js} +1 -1
- package/dist/chunk-7VSVJRRF.js +28 -0
- package/dist/{chunk-7JV4VN73.js → chunk-AAC77UD4.js} +1 -1
- package/dist/chunk-ANM3Y5FO.js +11 -0
- package/dist/chunk-BB4A5UI3.js +5 -0
- package/dist/{chunk-7TJ6DWW3.js → chunk-CPELC6JE.js} +1 -1
- package/dist/chunk-FTPC44FP.js +33 -0
- package/dist/{chunk-SBNR4WZF.js → chunk-GSOYVIQS.js} +1 -1
- package/dist/{chunk-Z3PGADVA.js → chunk-HSRH76JN.js} +1 -1
- package/dist/{chunk-CSXHCSTH.js → chunk-HSZ4AQ6L.js} +1 -1
- package/dist/chunk-I6NPILT5.js +1 -0
- package/dist/chunk-K7SRNBIV.js +1 -0
- package/dist/{chunk-R5XJSEOE.js → chunk-LCWBVOII.js} +3 -3
- package/dist/{chunk-MZXX353D.js → chunk-LEJKDYCK.js} +1 -1
- package/dist/{chunk-3G54ZL2L.js → chunk-NJ7C4KMA.js} +1 -1
- package/dist/{chunk-CTJV77FR.js → chunk-NUM3YQGK.js} +1 -1
- package/dist/chunk-OJEIX7OZ.js +1 -0
- package/dist/{chunk-EY65TFHJ.js → chunk-PJL3UVMJ.js} +1 -1
- package/dist/{chunk-E4HPRLRB.js → chunk-QT3EAHOG.js} +1 -1
- package/dist/{chunk-HCN5W76B.js → chunk-RIJMXO43.js} +1 -1
- package/dist/chunk-RMI3NMQY.js +23 -0
- package/dist/chunk-RQ7JJ7GV.js +4 -0
- package/dist/{chunk-4XPUN4QN.js → chunk-RVU73VKN.js} +1 -1
- package/dist/{chunk-OJX3RJ5A.js → chunk-RW2GTYQI.js} +1 -1
- package/dist/{chunk-PNP2KNGP.js → chunk-SDAH3ECM.js} +1 -1
- package/dist/chunk-SGQWRIRJ.js +10 -0
- package/dist/{chunk-IUSLSROY.js → chunk-SMIFCAAX.js} +1 -1
- package/dist/chunk-SWBJS3U4.js +1 -0
- package/dist/chunk-T7MWQQIF.js +3 -0
- package/dist/{chunk-RAZP42IQ.js → chunk-VAXLSPPU.js} +1 -1
- package/dist/{chunk-XZDOVPRC.js → chunk-VMTOFEXF.js} +1 -1
- package/dist/{chunk-7HDK3NRQ.js → chunk-VXP5BMW7.js} +1 -1
- package/dist/{chunk-WE42GBGU.js → chunk-XAHU42FP.js} +3 -3
- package/dist/{chunk-UBH6X3D3.js → chunk-XBQR74IK.js} +1 -1
- package/dist/{chunk-7NS3QUIE.js → chunk-XG7QNAKW.js} +1 -1
- package/dist/{chunk-GW6NZQTQ.js → chunk-XLWCSJMR.js} +1 -1
- package/dist/{chunk-2K65BSXS.js → chunk-XXLLY66B.js} +1 -1
- package/dist/chunk-YFP4P2FV.js +1 -0
- package/dist/{chunk-75SWXD2Z.js → chunk-YIXP2ALP.js} +1 -1
- package/dist/{chunk-MOJ5RR35.js → chunk-ZJQRLVVV.js} +1 -1
- package/dist/entry-0.js +1 -1
- package/dist/entry-1.js +1 -1
- package/dist/entry-10.js +1 -1
- package/dist/entry-11.js +1 -1
- package/dist/entry-12.js +1 -1
- package/dist/entry-13.js +1 -1
- package/dist/entry-14.js +1 -1
- package/dist/entry-15.js +1 -1
- package/dist/entry-16.js +1 -1
- package/dist/entry-17.js +1 -1
- package/dist/entry-18.js +1 -0
- package/dist/entry-19.js +1 -1
- package/dist/entry-2.js +1 -1
- package/dist/entry-20.js +1 -1
- package/dist/entry-22.js +1 -1
- package/dist/entry-23.js +1 -1
- package/dist/entry-24.js +1 -1
- package/dist/entry-25.js +1 -1
- package/dist/entry-26.js +1 -2
- package/dist/entry-27.js +1 -1
- package/dist/entry-28.js +1 -4
- package/dist/entry-29.js +2 -1
- package/dist/entry-3.js +1 -1
- package/dist/entry-30.js +1 -1
- package/dist/entry-31.js +4 -1
- package/dist/entry-32.js +1 -18
- package/dist/entry-33.js +1 -1
- package/dist/entry-34.js +1 -1
- package/dist/entry-35.js +18 -1
- package/dist/entry-36.js +1 -1
- package/dist/entry-37.js +1 -1
- package/dist/entry-38.js +1 -1
- package/dist/entry-39.js +1 -1
- package/dist/entry-4.js +1 -1
- package/dist/entry-40.js +1 -1
- 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 +1 -1
- package/dist/entry-46.js +1 -25
- package/dist/entry-47.js +1 -1
- package/dist/entry-48.js +1 -1
- package/dist/entry-49.js +25 -1
- package/dist/entry-5.js +1 -1
- package/dist/entry-50.js +1 -1
- package/dist/entry-51.js +1 -3
- package/dist/entry-52.js +1 -13
- package/dist/entry-53.js +1 -1
- package/dist/entry-54.js +3 -1
- package/dist/entry-55.js +13 -1
- package/dist/entry-56.js +1 -1
- package/dist/entry-57.js +1 -1
- package/dist/entry-58.js +1 -1
- package/dist/entry-59.js +1 -1
- package/dist/entry-6.js +1 -1
- package/dist/entry-60.js +1 -1
- package/dist/entry-61.js +1 -1
- package/dist/entry-62.js +1 -0
- package/dist/entry-63.js +1 -1
- package/dist/entry-64.js +1 -0
- package/dist/entry-65.js +0 -1
- package/dist/entry-66.js +1 -1
- package/dist/entry-67.js +0 -1
- package/dist/entry-68.js +1 -1
- package/dist/entry-69.js +1 -1
- package/dist/entry-7.js +1 -1
- package/dist/entry-70.js +1 -1
- package/dist/entry-71.js +1 -1
- package/dist/entry-72.js +1 -0
- package/dist/entry-73.js +1 -1
- package/dist/entry-74.js +1 -0
- package/dist/entry-75.js +0 -1
- package/dist/entry-76.js +1 -1
- package/dist/entry-77.js +0 -1
- package/dist/entry-78.js +1 -80
- package/dist/entry-79.js +1 -21
- package/dist/entry-8.js +1 -1
- package/dist/entry-80.js +1 -2
- package/dist/entry-81.js +80 -1
- package/dist/entry-82.js +22 -1
- package/dist/entry-83.js +2 -1
- package/dist/entry-84.js +1 -3
- package/dist/entry-85.js +1 -1
- package/dist/entry-86.js +1 -1
- package/dist/entry-87.js +1 -1
- package/dist/entry-88.js +3 -0
- package/dist/entry-89.js +1 -0
- package/dist/entry-9.js +1 -1
- package/dist/entry-90.js +1 -0
- package/dist/entry-91.js +1 -0
- package/dist/pi-agent-ide.js +53 -31
- package/docs/agent-guides/debugger.md +2 -0
- package/docs/agent-guides/editing.md +3 -3
- package/docs/agent-guides/search-code.md +5 -3
- package/docs/agent-guides/select-code.md +9 -6
- package/docs/agent-guides/ssh.md +1 -1
- package/docs/code-review.md +5 -0
- package/docs/configuration.md +52 -8
- package/docs/development.md +9 -13
- package/docs/directory-operations.md +1 -1
- package/docs/extensions.md +99 -2
- package/docs/releases.md +1 -1
- package/docs/settings-help.md +39 -0
- package/docs/structured-results.md +11 -6
- package/docs/tools.md +1 -0
- package/docs/user-hooks.md +4 -2
- package/node_modules/pi-agent-doctor/package.json +7 -10
- package/node_modules/pi-agent-doctor/runtime/entry-26.js +1 -0
- package/node_modules/pi-agent-doctor/runtime/entry-27.js +1 -0
- package/node_modules/pi-agent-documentation/package.json +2 -2
- package/node_modules/pi-agent-documentation/runtime/entry-28.js +1 -0
- package/node_modules/pi-agent-filesystem/package.json +8 -8
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- package/node_modules/pi-agent-filesystem-jq/package.json +6 -7
- package/node_modules/pi-agent-filesystem-jq/runtime/entry-31.js +2 -0
- package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/runtime/entry-33.js +2 -0
- package/node_modules/pi-agent-ide-ast/package.json +15 -41
- package/node_modules/pi-agent-ide-ast/runtime/entry-34.js +1 -0
- package/node_modules/pi-agent-ide-ast/src/select-schema.ts +6 -5
- package/node_modules/pi-agent-ide-changes/package.json +10 -11
- package/node_modules/pi-agent-ide-changes/runtime/entry-36.js +1 -0
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +6 -5
- package/node_modules/pi-agent-ide-formatter/package.json +4 -4
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-languages/runtime/entry-39.js +2 -0
- package/node_modules/pi-agent-ide-lint/package.json +8 -8
- package/node_modules/pi-agent-ide-lint/runtime/entry-40.js +2 -0
- package/node_modules/pi-agent-ide-lsp/package.json +10 -13
- package/node_modules/pi-agent-ide-lsp/runtime/entry-41.js +2 -0
- package/node_modules/pi-agent-image/package.json +3 -3
- package/node_modules/pi-agent-invariant/package.json +2 -2
- package/node_modules/pi-agent-pdf/package.json +3 -4
- package/node_modules/pi-agent-read/package.json +12 -12
- package/node_modules/pi-agent-read/runtime/entry-46.js +0 -1
- package/node_modules/pi-agent-read/runtime/entry-49.js +2 -0
- package/node_modules/pi-agent-resource/package.json +2 -2
- package/node_modules/pi-agent-resource/src/resource-error.ts +11 -0
- package/node_modules/pi-agent-resource/src/result-targets.ts +9 -0
- package/node_modules/pi-agent-search/package.json +9 -9
- package/node_modules/pi-agent-search/runtime/entry-51.js +0 -1
- package/node_modules/pi-agent-search/runtime/entry-52.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-54.js +2 -0
- package/node_modules/pi-agent-search/src/api/plugin-protocol.ts +1 -1
- package/node_modules/pi-agent-search/src/api/presentation.ts +10 -2
- package/node_modules/pi-agent-search/src/api/search-parameters.ts +6 -5
- package/node_modules/pi-agent-search/src/api/search.ts +7 -0
- package/node_modules/pi-agent-search/src/core/search-core.ts +23 -3
- package/node_modules/pi-agent-search-text/index.ts +2 -0
- package/node_modules/pi-agent-search-text/package.json +14 -14
- package/node_modules/pi-agent-search-text/runtime/entry-55.js +1 -0
- package/node_modules/pi-agent-search-text/runtime/entry-57.js +1 -0
- package/node_modules/pi-agent-search-text/src/search-backend.ts +18 -10
- package/node_modules/pi-agent-search-text/src/search-session.ts +68 -9
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text/runtime/entry-59.js +1 -0
- package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-60.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/package.json +5 -6
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-61.js +1 -0
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-62.js +2 -0
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-64.js +2 -0
- package/node_modules/pi-agent-text-editor/index.ts +2 -0
- package/node_modules/pi-agent-text-editor/package.json +26 -34
- package/node_modules/pi-agent-text-editor/runtime/entry-78.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-79.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-80.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-81.js +2 -0
- package/node_modules/pi-agent-text-editor/src/api/delete-guard.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/api/edit-completion.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +5 -0
- package/node_modules/pi-agent-text-editor/src/api/native-edit-batch-event.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/core/delete-policy.ts +6 -12
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +4 -1
- package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +40 -11
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +18 -9
- package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +29 -20
- package/node_modules/pi-agent-text-editor/src/core/temporary-directories.ts +13 -9
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +16 -8
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +118 -36
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +7 -4
- package/node_modules/pi-agent-text-editor/src/core/text-edit-origin.ts +38 -0
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +106 -48
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +35 -14
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +22 -1
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +39 -44
- package/node_modules/pi-agent-text-editor/src/core/write-agent-result.ts +3 -1
- package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +6 -5
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -8
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-82.js +2 -0
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +35 -2
- package/node_modules/pi-agent-text-editor-stale-anchor/index.ts +17 -0
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +6 -5
- package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-84.js +1 -0
- package/node_modules/pi-agent-tool-ui/package.json +6 -2
- package/node_modules/pi-agent-tool-ui/runtime/entry-85.js +1 -0
- package/node_modules/pi-agent-tool-ui/runtime/entry-86.js +1 -0
- package/node_modules/pi-agent-tool-ui/src/operation-approval.ts +271 -0
- package/node_modules/pi-agent-web/package.json +8 -11
- package/node_modules/pi-agent-web-html/package.json +3 -5
- package/node_modules/pi-agent-web-html/runtime/entry-88.js +2 -0
- package/node_modules/pi-agent-web-image/package.json +4 -4
- package/node_modules/pi-agent-web-image/runtime/entry-89.js +2 -0
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/runtime/entry-90.js +2 -0
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-91.js +2 -0
- package/package.json +65 -53
- package/skills/configure-agent-ide/SKILL.md +38 -0
- package/src/api/approval.ts +5 -0
- package/src/api/content.ts +6 -0
- package/src/api/settings.ts +198 -0
- package/src/api/tips.ts +3 -0
- package/src/backend/debugger-registration.ts +5 -1
- package/src/code-review/extension.ts +10 -4
- package/src/code-review/reviewer.ts +8 -0
- package/src/composite/host-version.ts +29 -5
- package/src/composite/ide-alias-rendering.ts +97 -0
- package/src/composite/nested-tool-rendering.ts +90 -9
- package/src/composite/preferences.ts +13 -0
- package/src/composite/search-facts.ts +45 -0
- package/src/composite/settings-documentation.ts +68 -0
- package/src/composite/settings-help.ts +106 -0
- package/src/composite/settings-registry.ts +94 -0
- package/src/composite/text-results.ts +170 -30
- package/src/composite/tool-availability.ts +11 -2
- package/src/core/diagnostic-entry.ts +31 -8
- package/src/core/diagnostic-store.ts +19 -3
- package/src/core/extension.ts +7 -2
- package/src/documentation/extension.ts +12 -0
- package/src/documentation/registry.ts +10 -2
- package/src/documentation/search.ts +166 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +8 -8
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +6 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-31.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-32.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-33.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-29.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -11
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -5
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-88.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-89.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-90.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-91.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-87.js +2 -0
- package/src/extensions/pi-agent-read/package.json +12 -12
- package/src/extensions/pi-agent-read/runtime/entry-46.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-47.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-49.js +2 -0
- package/src/extensions/pi-agent-search/package.json +9 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +2 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +14 -14
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-55.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-56.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-57.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +18 -10
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +68 -9
- package/src/extensions/pi-agent-search/runtime/entry-51.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-52.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-53.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-54.js +2 -0
- package/src/extensions/pi-agent-search/src/api/plugin-protocol.ts +1 -1
- package/src/extensions/pi-agent-search/src/api/presentation.ts +10 -2
- package/src/extensions/pi-agent-search/src/api/search-parameters.ts +6 -5
- package/src/extensions/pi-agent-search/src/api/search.ts +7 -0
- package/src/extensions/pi-agent-search/src/core/search-core.ts +23 -3
- package/src/extensions/pi-agent-text-editor/index.ts +2 -0
- package/src/extensions/pi-agent-text-editor/package.json +26 -34
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-60.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-61.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-62.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-63.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-64.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -8
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-82.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +35 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/index.ts +17 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +6 -5
- package/src/extensions/pi-agent-text-editor/runtime/entry-78.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-79.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-80.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-81.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/delete-guard.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/api/edit-completion.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +5 -0
- package/src/extensions/pi-agent-text-editor/src/api/native-edit-batch-event.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/core/delete-policy.ts +6 -12
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +4 -1
- package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +40 -11
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +18 -9
- package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +29 -20
- package/src/extensions/pi-agent-text-editor/src/core/temporary-directories.ts +13 -9
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +16 -8
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +118 -36
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +7 -4
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-origin.ts +38 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +106 -48
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +35 -14
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +22 -1
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +39 -44
- package/src/extensions/pi-agent-text-editor/src/core/write-agent-result.ts +3 -1
- package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +6 -5
- package/src/pi-agent-ide.ts +74 -15
- package/src/plugins/pi-agent-ide-ast/package.json +15 -41
- package/src/plugins/pi-agent-ide-ast/runtime/entry-34.js +1 -0
- package/src/plugins/pi-agent-ide-ast/src/select-schema.ts +6 -5
- package/src/plugins/pi-agent-ide-changes/package.json +10 -11
- package/src/plugins/pi-agent-ide-changes/runtime/entry-36.js +1 -0
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +6 -5
- package/src/plugins/pi-agent-ide-debugger/index.ts +158 -55
- package/src/plugins/pi-agent-ide-debugger/src/debugmcp-client.ts +118 -0
- package/src/plugins/pi-agent-ide-debugger/src/doctor-plugin.ts +47 -0
- package/src/plugins/pi-agent-ide-debugger/src/renderer.ts +2 -0
- package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +146 -1
- package/src/plugins/pi-agent-ide-debugger/src/ui.ts +12 -0
- package/src/plugins/pi-agent-ide-debugger/src/vscode-backend.ts +497 -0
- package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-languages/runtime/entry-39.js +2 -0
- package/src/plugins/pi-agent-ide-lint/package.json +8 -8
- package/src/plugins/pi-agent-ide-lint/runtime/entry-40.js +2 -0
- package/src/plugins/pi-agent-ide-lsp/package.json +10 -13
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-41.js +2 -0
- package/src/plugins/pi-agent-ide-terminal/index.ts +2 -0
- package/src/plugins/pi-agent-ide-terminal/src/origin.ts +30 -0
- package/src/plugins/pi-agent-ide-terminal/src/session-manager.ts +34 -0
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +11 -2
- package/src/plugins/pi-agent-ide-terminal/src/types.ts +9 -0
- package/src/plugins/pi-agent-ide-terminal/src/ui.ts +72 -26
- package/src/tips/core.ts +5 -2
- package/src/tips/extension.ts +30 -2
- package/src/tips/persistence.ts +29 -27
- package/src/tips/setup-hint.ts +19 -0
- package/dist/chunk-3ZGDMTMD.js +0 -25
- package/dist/chunk-5KFVDYCI.js +0 -1
- package/dist/chunk-ABFCAOU5.js +0 -1
- package/dist/chunk-BIG45IPN.js +0 -2
- package/dist/chunk-BMOJTJJJ.js +0 -3
- package/dist/chunk-BQ67M4NC.js +0 -3
- package/dist/chunk-IH5NW5JX.js +0 -11
- package/dist/chunk-NRZO5KJT.js +0 -9
- package/dist/chunk-O36UC74T.js +0 -1
- package/dist/chunk-OLI3JPHJ.js +0 -28
- package/dist/chunk-SSWUUBIR.js +0 -1
- package/dist/chunk-UUJJRXHG.js +0 -29
- package/dist/entry-21.js +0 -1
- package/docs/research/apply-native-capability-matrix.md +0 -174
- package/docs/research/apply-read-latency.md +0 -221
- package/docs/research/codemode-write-context.md +0 -56
- package/docs/research/lpt-393-fuzzy-results/file.json +0 -152
- package/docs/research/lpt-393-fuzzy-results/repo.json +0 -122
- package/docs/research/lpt-393-search-fuzzy-fallback.md +0 -97
- package/docs/research/native-codemode-batch-decision.md +0 -31
- package/docs/research/native-codemode-batching.md +0 -65
- package/node_modules/pi-agent-doctor/runtime/entry-19.js +0 -1
- package/node_modules/pi-agent-doctor/runtime/entry-20.js +0 -1
- package/node_modules/pi-agent-doctor/runtime/entry-21.js +0 -1
- package/node_modules/pi-agent-filesystem/runtime/entry-26.js +0 -2
- package/node_modules/pi-agent-filesystem-image/runtime/entry-27.js +0 -2
- package/node_modules/pi-agent-filesystem-jq/runtime/entry-28.js +0 -2
- package/node_modules/pi-agent-ide-ast/runtime/entry-31.js +0 -1
- package/node_modules/pi-agent-ide-changes/runtime/entry-33.js +0 -1
- package/node_modules/pi-agent-ide-changes/runtime/entry-34.js +0 -2
- package/node_modules/pi-agent-ide-languages/runtime/entry-36.js +0 -2
- package/node_modules/pi-agent-image/runtime/entry-39.js +0 -1
- package/node_modules/pi-agent-invariant/runtime/entry-40.js +0 -1
- package/node_modules/pi-agent-pdf/runtime/entry-41.js +0 -1
- package/node_modules/pi-agent-search/runtime/entry-49.js +0 -1
- package/node_modules/pi-agent-search-text/runtime/entry-52.js +0 -2
- package/node_modules/pi-agent-search-text/runtime/entry-54.js +0 -1
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-57.js +0 -2
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-59.js +0 -2
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-60.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-61.js +0 -2
- package/node_modules/pi-agent-text-editor/runtime/entry-62.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-64.js +0 -1
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-79.js +0 -2
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-80.js +0 -2
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-81.js +0 -1
- package/node_modules/pi-agent-tool-ui/runtime/entry-82.js +0 -1
- package/node_modules/pi-agent-web-html/runtime/entry-84.js +0 -2
- package/node_modules/pi-agent-web-image/runtime/entry-85.js +0 -2
- package/node_modules/pi-agent-web-pdf/runtime/entry-86.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-27.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-28.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-29.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-26.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-84.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-85.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-86.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-87.js +0 -2
- package/src/extensions/pi-agent-read/runtime/entry-42.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-43.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-44.js +0 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-52.js +0 -2
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-53.js +0 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-54.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-49.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-50.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-57.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-59.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-60.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-61.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-79.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-80.js +0 -2
- package/src/extensions/pi-agent-text-editor/runtime/entry-62.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-63.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-64.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-31.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-32.js +0 -2
- package/src/plugins/pi-agent-ide-changes/runtime/entry-33.js +0 -1
- package/src/plugins/pi-agent-ide-changes/runtime/entry-34.js +0 -2
- package/src/plugins/pi-agent-ide-languages/runtime/entry-36.js +0 -2
- /package/node_modules/{pi-agent-documentation → pi-agent-doctor}/runtime/entry-25.js +0 -0
- /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem}/runtime/entry-29.js +0 -0
- /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-image}/runtime/entry-30.js +0 -0
- /package/node_modules/{pi-agent-ide-ast → pi-agent-filesystem-pdf}/runtime/entry-32.js +0 -0
- /package/node_modules/{pi-agent-ide-formatter → pi-agent-ide-ast}/runtime/entry-35.js +0 -0
- /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-changes}/runtime/entry-37.js +0 -0
- /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-formatter}/runtime/entry-38.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-image}/runtime/entry-42.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-invariant}/runtime/entry-43.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-44.js +0 -0
- /package/node_modules/{pi-agent-resource → pi-agent-read}/runtime/entry-47.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-read}/runtime/entry-48.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-50.js +0 -0
- /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-53.js +0 -0
- /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-56.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-exact → pi-agent-search-text}/runtime/entry-58.js +0 -0
- /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-line-hash}/runtime/entry-63.js +0 -0
- /package/node_modules/{pi-agent-web → pi-agent-text-editor-stale-anchor}/runtime/entry-83.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web}/runtime/entry-87.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-image}/runtime/entry-30.js +0 -0
- /package/src/extensions/{pi-agent-search → pi-agent-read}/runtime/entry-48.js +0 -0
- /package/src/extensions/{pi-agent-text-editor/plugins/pi-agent-text-anchor-exact → pi-agent-search/plugins/pi-agent-search-text}/runtime/entry-58.js +0 -0
- /package/src/extensions/{pi-agent-read/extensions/pi-agent-web → pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor}/runtime/entry-83.js +0 -0
- /package/src/plugins/{pi-agent-ide-formatter → pi-agent-ide-ast}/runtime/entry-35.js +0 -0
- /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-changes}/runtime/entry-37.js +0 -0
- /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-formatter}/runtime/entry-38.js +0 -0
package/src/pi-agent-ide.ts
CHANGED
|
@@ -7,15 +7,21 @@ import { AGENT_IDE_PREFERENCES } from "#src/composite/preferences.js";
|
|
|
7
7
|
import { disabledByPreset } from "#src/composite/presets.js";
|
|
8
8
|
import { selectBuiltinExtensions } from "#src/composite/selection.js";
|
|
9
9
|
import { registerModuleSettings } from "#src/composite/module-settings.js";
|
|
10
|
+
import { registerSettingsHelp } from "#src/composite/settings-help.js";
|
|
10
11
|
import { createFeatureFlags } from "#src/composite/feature-flags.js";
|
|
12
|
+
import { connectAgentDocumentation } from "#src/api/documentation.js";
|
|
13
|
+
import { createIdeSettingsDocumentation } from "#src/composite/settings-documentation.js";
|
|
11
14
|
import { createIdeToolAvailability } from "#src/composite/tool-availability.js";
|
|
12
15
|
import { createNestedIdeRendering } from "#src/composite/nested-tool-rendering.js";
|
|
13
16
|
import { createIdeTextResults } from "#src/composite/text-results.js";
|
|
14
17
|
import { preserveResponsesToolOmission } from "#src/composite/responses-tools.js";
|
|
18
|
+
import { registerOperationApproval } from "pi-agent-tool-ui/operation-approval";
|
|
19
|
+
import { createAgentIdeSettingsRegistry } from "#src/composite/settings-registry.js";
|
|
20
|
+
import { readAgentIdeSetting } from "#src/api/settings.js";
|
|
15
21
|
|
|
16
22
|
import { VERSION } from "@earendil-works/pi-coding-agent";
|
|
17
23
|
import { getCurrentTools } from "@earendil-works/pi-ai";
|
|
18
|
-
import { assertSupportedHost } from "#src/composite/host-version.js";
|
|
24
|
+
import { assertSupportedHost, hostOwnsToolLoadout } from "#src/composite/host-version.js";
|
|
19
25
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
20
26
|
|
|
21
27
|
/**
|
|
@@ -23,7 +29,9 @@ Registers the configured built-ins as one Pi Agent IDE extension.
|
|
|
23
29
|
*/
|
|
24
30
|
export default async function registerUnifiedPiAgentIde(pi: ExtensionAPI): Promise<void> {
|
|
25
31
|
assertSupportedHost(VERSION);
|
|
26
|
-
const
|
|
32
|
+
const config = await readPiAgentIdeExtensionsConfig(resolvePiAgentIdeExtensionsConfigPaths());
|
|
33
|
+
const hideCodemodeToolResults = config.preferences?.["ui.codemode"] !== "on";
|
|
34
|
+
const nestedRendering = createNestedIdeRendering(pi, hideCodemodeToolResults);
|
|
27
35
|
const textResults = createIdeTextResults(nestedRendering.api);
|
|
28
36
|
const availability = createIdeToolAvailability(textResults.api);
|
|
29
37
|
pi.on("before_provider_request", (event, context) => {
|
|
@@ -37,6 +45,11 @@ export default async function registerUnifiedPiAgentIde(pi: ExtensionAPI): Promi
|
|
|
37
45
|
return preserveResponsesToolOmission(event.payload, names);
|
|
38
46
|
});
|
|
39
47
|
pi.on("session_start", (event, context) => {
|
|
48
|
+
// Pi 1.3 restores transcript tools and applies defaultTools and CLI +/- selections itself.
|
|
49
|
+
if (hostOwnsToolLoadout(VERSION)) {
|
|
50
|
+
availability.reconcile(true, [], true);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
40
53
|
const restored =
|
|
41
54
|
event.reason === "reload"
|
|
42
55
|
? []
|
|
@@ -49,12 +62,18 @@ export default async function registerUnifiedPiAgentIde(pi: ExtensionAPI): Promi
|
|
|
49
62
|
});
|
|
50
63
|
pi.on("before_agent_start", (event) => {
|
|
51
64
|
availability.reconcile();
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
65
|
+
const options = event.systemPromptOptions;
|
|
66
|
+
if (options.toolSnippets.bash)
|
|
67
|
+
options.toolSnippets.bash = options.toolSnippets.bash.replace(
|
|
68
|
+
"Execute bash commands (ls, grep, find, etc.)",
|
|
69
|
+
"Execute Bash commands",
|
|
70
|
+
);
|
|
71
|
+
// Keep the legacy host-rule correction structured so portable providers can project it.
|
|
72
|
+
const rules = /^<rules>\n([\s\S]*?)\n<\/rules>$/mu.exec(event.systemPrompt)?.[1];
|
|
73
|
+
if (rules?.includes("- Use bash for file operations like ls, rg, find"))
|
|
74
|
+
options.sections.rules = rules
|
|
75
|
+
.replace(/(?:^|\n)- Use bash for file operations like ls, rg, find(?=\n|$)/u, "")
|
|
76
|
+
.trim();
|
|
58
77
|
const tools = pi.getAllTools().filter((tool) => tool.exposure !== "hidden");
|
|
59
78
|
const active = pi.getActiveTools();
|
|
60
79
|
const discovery = active.includes("tool_search")
|
|
@@ -75,18 +94,19 @@ export default async function registerUnifiedPiAgentIde(pi: ExtensionAPI): Promi
|
|
|
75
94
|
? [`${discovery} debug in ide_debug when creating a debugger session.`]
|
|
76
95
|
: []),
|
|
77
96
|
];
|
|
78
|
-
|
|
79
|
-
guidance.length === 0
|
|
80
|
-
? systemPrompt
|
|
81
|
-
: `${systemPrompt}\n\n<ide_discovery>\n${guidance.join("\n")}\n</ide_discovery>`;
|
|
82
|
-
return prompt === event.systemPrompt ? undefined : { systemPrompt: prompt };
|
|
97
|
+
options.sections.ide_discovery = guidance.join("\n");
|
|
83
98
|
});
|
|
84
|
-
const config = await readPiAgentIdeExtensionsConfig(resolvePiAgentIdeExtensionsConfigPaths());
|
|
85
99
|
const flags = createFeatureFlags(pi, {
|
|
86
100
|
"pi-agent-ide-no-animations": config.noAnimations ?? false,
|
|
87
101
|
"pi-agent-ide-no-post-processing": config.noPostProcessing ?? false,
|
|
88
102
|
...config.flags,
|
|
89
103
|
});
|
|
104
|
+
flags.register({
|
|
105
|
+
id: "pi-agent-ide-developer-mode",
|
|
106
|
+
name: "Developer mode",
|
|
107
|
+
description: "Enable development commands, including manual setup-hint previews.",
|
|
108
|
+
default: false,
|
|
109
|
+
});
|
|
90
110
|
flags.register({
|
|
91
111
|
id: "pi-agent-ide-no-animations",
|
|
92
112
|
name: "Static edit previews",
|
|
@@ -137,7 +157,46 @@ export default async function registerUnifiedPiAgentIde(pi: ExtensionAPI): Promi
|
|
|
137
157
|
"Use the packaged skill to propose reusable rules from user review feedback. Save only after confirmation.",
|
|
138
158
|
default: false,
|
|
139
159
|
});
|
|
140
|
-
|
|
160
|
+
const settings = createAgentIdeSettingsRegistry(
|
|
161
|
+
pi,
|
|
162
|
+
[
|
|
163
|
+
...flags.definitions,
|
|
164
|
+
{
|
|
165
|
+
id: "pi-agent-ide-yolo",
|
|
166
|
+
name: "YOLO: allow all operations",
|
|
167
|
+
description:
|
|
168
|
+
"Skip existing operation confirmation dialogs unless an extension explicitly disables its YOLO setting. Safety checks and remote permissions still apply.",
|
|
169
|
+
default: false,
|
|
170
|
+
labels: { on: "on", off: "off" },
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
id: "pi-agent-ide-filesystem-yolo",
|
|
174
|
+
name: "YOLO: filesystem operations",
|
|
175
|
+
description:
|
|
176
|
+
"Skip filesystem operation confirmations. Default inherits common YOLO; Off disables persistent permission, not remembered session grants. Protected paths stay protected.",
|
|
177
|
+
default: false,
|
|
178
|
+
labels: { on: "on", off: "off" },
|
|
179
|
+
},
|
|
180
|
+
],
|
|
181
|
+
AGENT_IDE_PREFERENCES,
|
|
182
|
+
);
|
|
183
|
+
registerOperationApproval(pi, {
|
|
184
|
+
async isAllowed(request, context) {
|
|
185
|
+
if (request.yoloSetting === undefined) return false;
|
|
186
|
+
const extension = await readAgentIdeSetting(pi.events, request.yoloSetting, context.cwd);
|
|
187
|
+
if (typeof extension.value !== "boolean")
|
|
188
|
+
throw new Error(`Operation approval needs a boolean YOLO setting: ${request.yoloSetting}`);
|
|
189
|
+
if (extension.overridden) return extension.value;
|
|
190
|
+
return (
|
|
191
|
+
(await readAgentIdeSetting(pi.events, "pi-agent-ide-yolo", context.cwd)).value === true
|
|
192
|
+
);
|
|
193
|
+
},
|
|
194
|
+
});
|
|
195
|
+
registerModuleSettings(pi, settings.flags, settings.preferences);
|
|
196
|
+
registerSettingsHelp(pi);
|
|
197
|
+
connectAgentDocumentation(pi, [
|
|
198
|
+
createIdeSettingsDocumentation(settings.flags, settings.preferences),
|
|
199
|
+
]);
|
|
141
200
|
const presetDisabled = disabledByPreset(BUILTIN_EXTENSIONS, config.preset ?? "full");
|
|
142
201
|
const { enabled } = selectBuiltinExtensions(
|
|
143
202
|
BUILTIN_EXTENSIONS,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-ast",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,57 +8,31 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./api/scope": {
|
|
10
10
|
"types": "./src/api/scope.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-34.js"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"@ast-grep/lang-ruby": "^0.0.7",
|
|
27
|
-
"@ast-grep/lang-scala": "^0.0.7",
|
|
28
|
-
"@ast-grep/lang-sql": "^0.0.8",
|
|
29
|
-
"@ast-grep/lang-swift": "^0.0.8",
|
|
30
|
-
"@ast-grep/napi": "^0.42.3",
|
|
31
|
-
"@tree-sitter-grammars/tree-sitter-toml": "^0.7.0",
|
|
32
|
-
"@tree-sitter-grammars/tree-sitter-yaml": "^0.7.1",
|
|
33
|
-
"cross-spawn": "^7.0.6",
|
|
34
|
-
"pi-agent-doctor": "0.8.0",
|
|
35
|
-
"pi-agent-documentation": "0.8.0",
|
|
36
|
-
"pi-agent-invariant": "0.8.0",
|
|
37
|
-
"pi-agent-read": "0.8.0",
|
|
38
|
-
"pi-agent-resource": "0.8.0",
|
|
39
|
-
"pi-agent-search": "0.8.0",
|
|
40
|
-
"pi-agent-search-text": "0.8.0",
|
|
41
|
-
"pi-agent-text": "0.8.0",
|
|
42
|
-
"pi-agent-text-editor": "0.8.0",
|
|
43
|
-
"pi-agent-tool-call-interception": "0.8.0",
|
|
44
|
-
"pi-agent-tool-ui": "0.8.0",
|
|
45
|
-
"tree-sitter-cpp": "^0.23.4",
|
|
46
|
-
"tree-sitter-javascript": "^0.25.0",
|
|
47
|
-
"tree-sitter-json": "^0.24.8",
|
|
48
|
-
"tree-sitter-python": "^0.25.0",
|
|
49
|
-
"tree-sitter-rust": "^0.24.0",
|
|
50
|
-
"tree-sitter-typescript": "^0.23.2",
|
|
51
|
-
"web-tree-sitter": "^0.26.11"
|
|
15
|
+
"pi-agent-doctor": "0.8.2",
|
|
16
|
+
"pi-agent-documentation": "0.8.2",
|
|
17
|
+
"pi-agent-invariant": "0.8.2",
|
|
18
|
+
"pi-agent-read": "0.8.2",
|
|
19
|
+
"pi-agent-resource": "0.8.2",
|
|
20
|
+
"pi-agent-search": "0.8.2",
|
|
21
|
+
"pi-agent-search-text": "0.8.2",
|
|
22
|
+
"pi-agent-text": "0.8.2",
|
|
23
|
+
"pi-agent-text-editor": "0.8.2",
|
|
24
|
+
"pi-agent-tool-call-interception": "0.8.2",
|
|
25
|
+
"pi-agent-tool-ui": "0.8.2"
|
|
52
26
|
},
|
|
53
27
|
"pi": {
|
|
54
28
|
"extensions": [
|
|
55
|
-
"./runtime/entry-
|
|
29
|
+
"./runtime/entry-35.js"
|
|
56
30
|
]
|
|
57
31
|
},
|
|
58
32
|
"peerDependencies": {
|
|
59
33
|
"@earendil-works/pi-coding-agent": "*",
|
|
60
34
|
"@earendil-works/pi-tui": "*",
|
|
61
|
-
"pi-agent-ide": "0.8.
|
|
35
|
+
"pi-agent-ide": "0.8.2",
|
|
62
36
|
"typebox": "*"
|
|
63
37
|
},
|
|
64
38
|
"peerDependenciesMeta": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../../dist/entry-34.js";
|
|
@@ -197,11 +197,12 @@ const astPartSchema = Type.Union([
|
|
|
197
197
|
Type.Literal("finalizer"),
|
|
198
198
|
Type.Literal("parameter"),
|
|
199
199
|
]);
|
|
200
|
-
const objectFilter = Type.Optional(
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
})
|
|
200
|
+
const objectFilter = Type.Optional(
|
|
201
|
+
Type.Union(astObjectSchema.anyOf, {
|
|
202
|
+
description:
|
|
203
|
+
"Filter results by construct category after navigation. The filter does not change parent/child/sibling relationships.",
|
|
204
|
+
}),
|
|
205
|
+
);
|
|
205
206
|
const structuralOperationSchema = Type.Union([
|
|
206
207
|
Type.Object(
|
|
207
208
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-changes",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,22 +8,21 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./changes/change-groups": {
|
|
10
10
|
"types": "./src/changes/change-groups.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-36.js"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"
|
|
16
|
-
"pi-agent-
|
|
17
|
-
"pi-agent-
|
|
18
|
-
"pi-agent-
|
|
19
|
-
"pi-agent-
|
|
20
|
-
"pi-agent-
|
|
21
|
-
"pi-agent-text": "0.8.
|
|
22
|
-
"pi-agent-text-editor": "0.8.0"
|
|
15
|
+
"pi-agent-doctor": "0.8.2",
|
|
16
|
+
"pi-agent-documentation": "0.8.2",
|
|
17
|
+
"pi-agent-invariant": "0.8.2",
|
|
18
|
+
"pi-agent-read": "0.8.2",
|
|
19
|
+
"pi-agent-resource": "0.8.2",
|
|
20
|
+
"pi-agent-text": "0.8.2",
|
|
21
|
+
"pi-agent-text-editor": "0.8.2"
|
|
23
22
|
},
|
|
24
23
|
"pi": {
|
|
25
24
|
"extensions": [
|
|
26
|
-
"./runtime/entry-
|
|
25
|
+
"./runtime/entry-37.js"
|
|
27
26
|
]
|
|
28
27
|
},
|
|
29
28
|
"peerDependencies": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../../dist/entry-36.js";
|
|
@@ -13,11 +13,12 @@ import type { TextMutationToolRegistration } from "pi-agent-text-editor/api/muta
|
|
|
13
13
|
|
|
14
14
|
export const undoSchema = Type.Object(
|
|
15
15
|
{
|
|
16
|
-
file: Type.Optional(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
file: Type.Optional(
|
|
17
|
+
Type.Union(resultInputSchema.anyOf, {
|
|
18
|
+
description:
|
|
19
|
+
"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.",
|
|
20
|
+
}),
|
|
21
|
+
),
|
|
21
22
|
change: Type.String({
|
|
22
23
|
description:
|
|
23
24
|
'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.',
|
|
@@ -60,33 +60,20 @@ import {
|
|
|
60
60
|
} from "#src/plugins/pi-agent-ide-debugger/src/renderer.js";
|
|
61
61
|
import {
|
|
62
62
|
debuggerEvaluationFromResult,
|
|
63
|
+
debuggerFailureFromResult,
|
|
63
64
|
debuggerSnapshotFromResult,
|
|
64
65
|
} from "#src/plugins/pi-agent-ide-debugger/src/ui.js";
|
|
65
66
|
import { debuggerProcessProvider } from "#src/plugins/pi-agent-ide-debugger/src/process-provider.js";
|
|
66
67
|
import { agentIdeProcessRegistry } from "#src/plugins/pi-agent-ide-processes/src/registry.js";
|
|
67
68
|
import type { DebugWorkspaceOwnerResolver } from "./src/workspace-owner.js";
|
|
69
|
+
import { VscodeDebugSession } from "./src/vscode-backend.js";
|
|
68
70
|
|
|
69
71
|
interface DebugToolDetails {
|
|
70
72
|
readonly source?: string;
|
|
71
73
|
readonly sourceResource?: string;
|
|
72
74
|
readonly breakpointsResource?: string;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
| "debugpy"
|
|
76
|
-
| "delve"
|
|
77
|
-
| "java"
|
|
78
|
-
| "elixir"
|
|
79
|
-
| "julia"
|
|
80
|
-
| "kotlin"
|
|
81
|
-
| "lldb-dap"
|
|
82
|
-
| "lua"
|
|
83
|
-
| "netcoredbg"
|
|
84
|
-
| "node"
|
|
85
|
-
| "php"
|
|
86
|
-
| "powershell"
|
|
87
|
-
| "r"
|
|
88
|
-
| "ruby"
|
|
89
|
-
| "shell";
|
|
75
|
+
/** Native adapter, `vscode`, or the requested backend when creation failed. */
|
|
76
|
+
readonly adapter: string;
|
|
90
77
|
readonly program: string;
|
|
91
78
|
readonly sourceFile?: string;
|
|
92
79
|
readonly cwd: string;
|
|
@@ -106,29 +93,37 @@ import {
|
|
|
106
93
|
|
|
107
94
|
const debugParameters = Type.Object(
|
|
108
95
|
{
|
|
109
|
-
|
|
110
|
-
[
|
|
111
|
-
"dart",
|
|
112
|
-
"debugpy",
|
|
113
|
-
"delve",
|
|
114
|
-
"java",
|
|
115
|
-
"elixir",
|
|
116
|
-
"julia",
|
|
117
|
-
"kotlin",
|
|
118
|
-
"lldb-dap",
|
|
119
|
-
"lua",
|
|
120
|
-
"netcoredbg",
|
|
121
|
-
"node",
|
|
122
|
-
"php",
|
|
123
|
-
"powershell",
|
|
124
|
-
"r",
|
|
125
|
-
"ruby",
|
|
126
|
-
"shell",
|
|
127
|
-
] as const,
|
|
128
|
-
{
|
|
96
|
+
backend: Type.Optional(
|
|
97
|
+
StringEnum(["auto", "vscode", "native"] as const, {
|
|
129
98
|
description:
|
|
130
|
-
"Select
|
|
131
|
-
},
|
|
99
|
+
"Select the debugger backend. auto (default) debugs through VS Code when the local program is inside a workspace open in VS Code with the DebugMCP extension, that window has no active debug session, and args and mainClass are omitted; otherwise it uses the native adapter. vscode fails with the unmet condition instead of falling back. native always launches the selected adapter.",
|
|
100
|
+
}),
|
|
101
|
+
),
|
|
102
|
+
adapter: Type.Optional(
|
|
103
|
+
StringEnum(
|
|
104
|
+
[
|
|
105
|
+
"dart",
|
|
106
|
+
"debugpy",
|
|
107
|
+
"delve",
|
|
108
|
+
"java",
|
|
109
|
+
"elixir",
|
|
110
|
+
"julia",
|
|
111
|
+
"kotlin",
|
|
112
|
+
"lldb-dap",
|
|
113
|
+
"lua",
|
|
114
|
+
"netcoredbg",
|
|
115
|
+
"node",
|
|
116
|
+
"php",
|
|
117
|
+
"powershell",
|
|
118
|
+
"r",
|
|
119
|
+
"ruby",
|
|
120
|
+
"shell",
|
|
121
|
+
] as const,
|
|
122
|
+
{
|
|
123
|
+
description:
|
|
124
|
+
"Select an installed native DAP adapter for Dart, Python, Go, Java, Elixir, Julia, Kotlin, C, C++, Rust, Swift, Zig, Lua, C#, JavaScript, TypeScript, PHP, PowerShell, R, Ruby, or shell scripts. Required for the native backend; VS Code chooses its debugger from launch.json or the file type.",
|
|
125
|
+
},
|
|
126
|
+
),
|
|
132
127
|
),
|
|
133
128
|
program: Type.String({
|
|
134
129
|
minLength: 1,
|
|
@@ -141,7 +136,10 @@ const debugParameters = Type.Object(
|
|
|
141
136
|
}),
|
|
142
137
|
),
|
|
143
138
|
args: Type.Optional(
|
|
144
|
-
Type.Array(Type.String(), {
|
|
139
|
+
Type.Array(Type.String(), {
|
|
140
|
+
description:
|
|
141
|
+
"Arguments passed to the debugged program by the native backend. For VS Code, put them in a launch.json configuration.",
|
|
142
|
+
}),
|
|
145
143
|
),
|
|
146
144
|
mainClass: Type.Optional(
|
|
147
145
|
Type.String({
|
|
@@ -149,6 +147,20 @@ const debugParameters = Type.Object(
|
|
|
149
147
|
description: "Fully qualified JVM main class. Required by Java and Kotlin adapters.",
|
|
150
148
|
}),
|
|
151
149
|
),
|
|
150
|
+
configuration: Type.Optional(
|
|
151
|
+
Type.String({
|
|
152
|
+
minLength: 1,
|
|
153
|
+
description:
|
|
154
|
+
"Name of a .vscode/launch.json configuration to launch in VS Code. Use it for program arguments or environment. VS Code backend only.",
|
|
155
|
+
}),
|
|
156
|
+
),
|
|
157
|
+
test: Type.Optional(
|
|
158
|
+
Type.String({
|
|
159
|
+
minLength: 1,
|
|
160
|
+
description:
|
|
161
|
+
"Name of one test to debug through the VS Code Testing API; set program to its test file. VS Code backend only.",
|
|
162
|
+
}),
|
|
163
|
+
),
|
|
152
164
|
cwd: Type.Optional(
|
|
153
165
|
Type.String({
|
|
154
166
|
description:
|
|
@@ -295,12 +307,29 @@ export async function registerDebuggerWithOwner(
|
|
|
295
307
|
if (parameters.path !== session.source || parameters.anchor !== undefined) {
|
|
296
308
|
throw new Error("Debug commands target the session resource without an anchor");
|
|
297
309
|
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
310
|
+
let evaluation: DebugEvaluation | undefined;
|
|
311
|
+
try {
|
|
312
|
+
evaluation = await executeSessionCommand(
|
|
313
|
+
manager,
|
|
314
|
+
session,
|
|
315
|
+
parameters.text,
|
|
316
|
+
context.signal,
|
|
317
|
+
);
|
|
318
|
+
} catch (error) {
|
|
319
|
+
// Return the debugger's own reason with the session state instead of a generic edit failure.
|
|
320
|
+
if (context.signal?.aborted === true) throw error;
|
|
321
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
322
|
+
return {
|
|
323
|
+
source: session.source,
|
|
324
|
+
summary: `${parameters.text.trim()} failed: ${message}\n\n${renderDebugSession(session)}`,
|
|
325
|
+
data: {
|
|
326
|
+
...debugActionData(manager, session, parameters.text),
|
|
327
|
+
ok: false,
|
|
328
|
+
effect: "not-applied",
|
|
329
|
+
error: { code: "DEBUG_ACTION_FAILED", message },
|
|
330
|
+
},
|
|
331
|
+
};
|
|
332
|
+
}
|
|
304
333
|
return {
|
|
305
334
|
source: session.source,
|
|
306
335
|
summary:
|
|
@@ -389,7 +418,13 @@ export async function registerDebuggerWithOwner(
|
|
|
389
418
|
const snapshot = debuggerSnapshotFromResult(result.details);
|
|
390
419
|
if (snapshot === undefined) throw new Error("Debugger result is missing its session");
|
|
391
420
|
const evaluation = debuggerEvaluationFromResult(result.details);
|
|
392
|
-
return renderDebugResult(
|
|
421
|
+
return renderDebugResult(
|
|
422
|
+
snapshot,
|
|
423
|
+
options.expanded,
|
|
424
|
+
theme,
|
|
425
|
+
evaluation,
|
|
426
|
+
debuggerFailureFromResult(result.details),
|
|
427
|
+
);
|
|
393
428
|
},
|
|
394
429
|
});
|
|
395
430
|
}
|
|
@@ -419,14 +454,21 @@ export async function registerDebuggerWithOwner(
|
|
|
419
454
|
label: "Debug session",
|
|
420
455
|
promptSnippet: "Configure a local debugger session",
|
|
421
456
|
description:
|
|
422
|
-
"Use debug to create a configured debugger session on a local or supported SSH workspace. This does not launch the program yet. The returned debug: resource survives extension reloads.",
|
|
457
|
+
"Use debug to create a configured debugger session on a local or supported SSH workspace, through VS Code or a native adapter. This does not launch the program yet. The returned debug: resource survives extension reloads.",
|
|
423
458
|
parameters: debugParameters,
|
|
424
459
|
outputSchema: debugOutputSchema,
|
|
425
460
|
async execute(_toolCallId, input, signal, _onUpdate, context) {
|
|
461
|
+
const backend = input.backend ?? "auto";
|
|
426
462
|
let cwd = input.cwd ?? context.cwd;
|
|
427
463
|
let program = input.program;
|
|
428
464
|
try {
|
|
429
465
|
signal?.throwIfAborted();
|
|
466
|
+
if (
|
|
467
|
+
backend === "vscode" &&
|
|
468
|
+
[input.cwd, input.program, input.source].some((source) => source?.includes("://"))
|
|
469
|
+
) {
|
|
470
|
+
throw new Error("The VS Code backend debugs only local workspaces");
|
|
471
|
+
}
|
|
430
472
|
const owned = await ownerAccess?.resolveOptions(input, context.cwd, signal);
|
|
431
473
|
if (
|
|
432
474
|
owned === undefined &&
|
|
@@ -438,16 +480,45 @@ export async function registerDebuggerWithOwner(
|
|
|
438
480
|
program = owned?.program ?? path.resolve(cwd, input.program);
|
|
439
481
|
if (owned === undefined) await access(program);
|
|
440
482
|
signal?.throwIfAborted();
|
|
441
|
-
const
|
|
442
|
-
|
|
483
|
+
const sourceFile = path.resolve(cwd, input.source ?? input.program);
|
|
484
|
+
const selection =
|
|
485
|
+
owned === undefined && backend !== "native"
|
|
486
|
+
? await openVscodeBackend(backend, input, { cwd, program, sourceFile }, signal)
|
|
487
|
+
: { unavailable: "native backend requested" };
|
|
488
|
+
let session: DebugSession;
|
|
489
|
+
if ("vscode" in selection) {
|
|
490
|
+
session = manager.create(
|
|
491
|
+
{
|
|
492
|
+
adapter: "vscode",
|
|
493
|
+
program,
|
|
494
|
+
sourceFile,
|
|
495
|
+
args: [],
|
|
496
|
+
cwd,
|
|
497
|
+
...(input.configuration === undefined
|
|
498
|
+
? {}
|
|
499
|
+
: { configuration: input.configuration }),
|
|
500
|
+
...(input.test === undefined ? {} : { test: input.test }),
|
|
501
|
+
},
|
|
502
|
+
selection.vscode,
|
|
503
|
+
);
|
|
504
|
+
} else if (input.configuration !== undefined || input.test !== undefined) {
|
|
505
|
+
throw new Error("configuration and test need the VS Code backend");
|
|
506
|
+
} else if (owned !== undefined) {
|
|
507
|
+
session = manager.create(owned);
|
|
508
|
+
} else if (input.adapter === undefined) {
|
|
509
|
+
throw new Error(
|
|
510
|
+
`Select an adapter for the native debugger backend. VS Code is not used: ${selection.unavailable}`,
|
|
511
|
+
);
|
|
512
|
+
} else {
|
|
513
|
+
session = manager.create({
|
|
443
514
|
adapter: input.adapter,
|
|
444
515
|
program,
|
|
445
|
-
sourceFile
|
|
516
|
+
sourceFile,
|
|
446
517
|
args: input.args ?? [],
|
|
447
518
|
cwd,
|
|
448
519
|
...(input.mainClass === undefined ? {} : { mainClass: input.mainClass }),
|
|
449
|
-
}
|
|
450
|
-
|
|
520
|
+
});
|
|
521
|
+
}
|
|
451
522
|
const details = debugDetails(manager, session);
|
|
452
523
|
const { snapshot: _snapshot, stop: _stop, ...data } = details;
|
|
453
524
|
return withStructuredResult(
|
|
@@ -469,7 +540,7 @@ export async function registerDebuggerWithOwner(
|
|
|
469
540
|
content: [
|
|
470
541
|
{ type: "text", text: error instanceof Error ? error.message : String(error) },
|
|
471
542
|
],
|
|
472
|
-
details: { adapter: input.adapter, program, cwd, status: "failed" },
|
|
543
|
+
details: { adapter: input.adapter ?? backend, program, cwd, status: "failed" },
|
|
473
544
|
isError: true,
|
|
474
545
|
},
|
|
475
546
|
debugDataSchema,
|
|
@@ -486,7 +557,11 @@ export async function registerDebuggerWithOwner(
|
|
|
486
557
|
? rawProgram
|
|
487
558
|
: path.resolve(cwd, rawProgram);
|
|
488
559
|
return renderDebugCall(
|
|
489
|
-
typeof input.adapter === "string"
|
|
560
|
+
typeof input.adapter === "string"
|
|
561
|
+
? input.adapter
|
|
562
|
+
: input.backend === "vscode"
|
|
563
|
+
? "vscode"
|
|
564
|
+
: "debugger",
|
|
490
565
|
program,
|
|
491
566
|
cwd,
|
|
492
567
|
theme,
|
|
@@ -518,6 +593,34 @@ export async function registerDebuggerWithOwner(
|
|
|
518
593
|
});
|
|
519
594
|
}
|
|
520
595
|
|
|
596
|
+
/** Open the VS Code backend, or report why auto mode falls back to the native adapter. */
|
|
597
|
+
async function openVscodeBackend(
|
|
598
|
+
backend: "auto" | "vscode",
|
|
599
|
+
input: Static<typeof debugParameters>,
|
|
600
|
+
paths: { readonly cwd: string; readonly program: string; readonly sourceFile: string },
|
|
601
|
+
signal?: AbortSignal,
|
|
602
|
+
): Promise<{ readonly vscode: VscodeDebugSession } | { readonly unavailable: string }> {
|
|
603
|
+
try {
|
|
604
|
+
const unsupported =
|
|
605
|
+
(input.args?.length ?? 0) > 0
|
|
606
|
+
? "args"
|
|
607
|
+
: input.mainClass === undefined
|
|
608
|
+
? undefined
|
|
609
|
+
: "mainClass";
|
|
610
|
+
if (unsupported !== undefined) {
|
|
611
|
+
throw new Error(`it does not accept ${unsupported}; use a launch.json configuration`);
|
|
612
|
+
}
|
|
613
|
+
return { vscode: await VscodeDebugSession.open(paths, signal) };
|
|
614
|
+
} catch (error) {
|
|
615
|
+
signal?.throwIfAborted();
|
|
616
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
617
|
+
if (backend === "vscode" || input.configuration !== undefined || input.test !== undefined) {
|
|
618
|
+
throw new Error(`VS Code backend unavailable: ${reason}`, { cause: error });
|
|
619
|
+
}
|
|
620
|
+
return { unavailable: reason };
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
|
|
521
624
|
function createDebugResourceResolver(manager: DebugSessionManager, id: string): ResourceResolver {
|
|
522
625
|
return {
|
|
523
626
|
id,
|