pi-agent-ide 0.3.0 → 0.5.0
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 +62 -0
- package/README.md +7 -6
- package/dist/chunk-25CZ5ZIU.js +3 -0
- package/dist/chunk-526E364R.js +3 -0
- package/dist/chunk-5PLV4HLG.js +1 -0
- package/dist/chunk-5QQABP47.js +14 -0
- package/dist/{chunk-72EEL2DW.js → chunk-6CZO43OH.js} +1 -1
- package/dist/chunk-AWXVJ5AC.js +1 -0
- package/dist/chunk-BGUSBUUD.js +26 -0
- package/dist/{chunk-CW53ZTU3.js → chunk-DQXPQOF7.js} +1 -1
- package/dist/chunk-EJ5OACQM.js +1 -0
- package/dist/chunk-ESPNEJHK.js +1 -0
- package/dist/chunk-G725MARR.js +16 -0
- package/dist/{chunk-M5L42DWE.js → chunk-HKXDP2FD.js} +2 -2
- package/dist/chunk-IQD6PON5.js +0 -0
- package/dist/chunk-J34VKQGJ.js +1 -0
- package/dist/chunk-J4RTW44E.js +1 -0
- package/dist/{chunk-HGPUI7F3.js → chunk-KII2JQC5.js} +1 -1
- package/dist/{chunk-CEKXBS55.js → chunk-L7JMDDSD.js} +1 -1
- package/dist/{chunk-EWNWKDMP.js → chunk-LY6U5EAD.js} +1 -1
- package/dist/{chunk-ERVMDQGX.js → chunk-MGCHOGQD.js} +1 -1
- package/dist/{chunk-LRYE2WCN.js → chunk-O6LE42GK.js} +1 -1
- package/dist/{chunk-KAB3AYA2.js → chunk-OBNING2A.js} +1 -1
- package/dist/chunk-QH4ZUDOD.js +1 -0
- package/dist/{chunk-VFBLX4TG.js → chunk-T6LX2RX5.js} +1 -1
- package/dist/{chunk-AADJ2KIB.js → chunk-U22JNO6N.js} +1 -1
- package/dist/chunk-U2JKHKLK.js +0 -0
- package/dist/{chunk-SSHZEWWV.js → chunk-WGGIQ7IJ.js} +1 -1
- package/dist/chunk-ZG2MWXCR.js +2 -0
- package/dist/chunk-ZUMN6U77.js +27 -0
- 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 -0
- package/dist/entry-17.js +1 -1
- package/dist/entry-18.js +1 -1
- package/dist/entry-19.js +1 -1
- package/dist/entry-20.js +1 -1
- package/dist/entry-21.js +1 -2
- package/dist/entry-22.js +2 -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 -12
- package/dist/entry-27.js +12 -1
- package/dist/entry-28.js +1 -1
- package/dist/entry-29.js +1 -1
- package/dist/entry-30.js +1 -1
- package/dist/entry-31.js +1 -4
- package/dist/entry-32.js +3 -8
- package/dist/entry-33.js +9 -1
- package/dist/entry-34.js +1 -1
- package/dist/entry-35.js +1 -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-40.js +1 -18
- package/dist/entry-41.js +18 -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 -7
- package/dist/entry-46.js +7 -11
- package/dist/entry-47.js +11 -1
- package/dist/entry-48.js +1 -1
- package/dist/entry-49.js +1 -1
- package/dist/entry-50.js +1 -1
- package/dist/entry-51.js +1 -1
- package/dist/entry-52.js +1 -1
- package/dist/entry-53.js +1 -1
- package/dist/entry-54.js +1 -1
- package/dist/entry-55.js +1 -0
- package/dist/entry-56.js +0 -1
- package/dist/entry-57.js +1 -0
- package/dist/entry-58.js +0 -1
- package/dist/entry-59.js +1 -1
- package/dist/entry-60.js +1 -1
- package/dist/entry-61.js +1 -1
- package/dist/entry-62.js +1 -1
- 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 -0
- package/dist/entry-67.js +0 -1
- package/dist/entry-68.js +1 -1
- package/dist/entry-69.js +1 -1
- package/dist/entry-70.js +1 -123
- package/dist/entry-71.js +198 -25
- package/dist/entry-72.js +30 -2
- package/dist/entry-73.js +2 -1
- package/dist/entry-74.js +1 -1
- package/dist/entry-75.js +1 -1
- package/dist/entry-76.js +1 -3
- package/dist/entry-77.js +3 -1
- package/dist/entry-78.js +1 -1
- package/dist/entry-79.js +1 -1
- package/dist/entry-8.js +1 -1
- package/dist/entry-80.js +1 -0
- package/dist/entry-9.js +1 -1
- package/dist/pi-agent-ide.js +3 -3
- package/docs/configuration.md +1 -1
- package/docs/tools.md +11 -0
- package/docs/user-hooks.md +68 -0
- package/node_modules/pi-agent-doctor/package.json +6 -6
- package/node_modules/pi-agent-doctor/runtime/entry-21.js +1 -0
- package/node_modules/pi-agent-doctor/src/catalog.ts +9 -1
- package/node_modules/pi-agent-doctor/src/plugin-protocol.ts +5 -0
- package/node_modules/pi-agent-filesystem/package.json +7 -7
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- package/node_modules/pi-agent-filesystem-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-25.js +2 -0
- package/node_modules/pi-agent-ide-ast/package.json +32 -11
- package/node_modules/pi-agent-ide-ast/runtime/entry-26.js +0 -1
- package/node_modules/pi-agent-ide-ast/runtime/entry-27.js +2 -0
- package/node_modules/pi-agent-ide-ast/src/ast/manager.ts +16 -8
- package/node_modules/pi-agent-ide-ast/src/ast/native-parser.ts +151 -0
- package/node_modules/pi-agent-ide-ast/src/ast/outline.ts +22 -17
- package/node_modules/pi-agent-ide-ast/src/ast/syntax-tree.ts +25 -0
- package/node_modules/pi-agent-ide-ast/src/doctor-plugin.ts +52 -1
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +4 -1
- package/node_modules/pi-agent-ide-changes/index.ts +3 -1
- package/node_modules/pi-agent-ide-changes/package.json +8 -8
- package/node_modules/pi-agent-ide-changes/runtime/entry-28.js +0 -1
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +42 -9
- package/node_modules/pi-agent-ide-formatter/package.json +9 -4
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-lint/package.json +13 -8
- package/node_modules/pi-agent-ide-lsp/index.ts +4 -1
- package/node_modules/pi-agent-ide-lsp/package.json +15 -10
- package/node_modules/pi-agent-ide-lsp/runtime/entry-33.js +2 -0
- package/node_modules/pi-agent-image/package.json +3 -3
- package/node_modules/pi-agent-invariant/package.json +2 -2
- package/node_modules/pi-agent-pdf/package.json +3 -3
- package/node_modules/pi-agent-read/package.json +11 -11
- package/node_modules/pi-agent-read/runtime/entry-40.js +0 -1
- package/node_modules/pi-agent-read/runtime/entry-41.js +2 -0
- package/node_modules/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/node_modules/pi-agent-read/src/api/rendering.ts +1 -1
- package/node_modules/pi-agent-read/src/api/tools/read.ts +32 -0
- package/node_modules/pi-agent-read/src/core/read-core.ts +8 -0
- package/node_modules/pi-agent-read/src/core/tools/read/raw-read.ts +38 -4
- package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +66 -4
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +105 -5
- package/node_modules/pi-agent-resource/package.json +2 -2
- package/node_modules/pi-agent-resource/src/resource.ts +2 -0
- package/node_modules/pi-agent-search/package.json +7 -7
- package/node_modules/pi-agent-search/runtime/entry-45.js +0 -1
- package/node_modules/pi-agent-search/src/api/search-parameters.ts +5 -1
- package/node_modules/pi-agent-search-text/index.ts +1 -1
- package/node_modules/pi-agent-search-text/package.json +9 -9
- package/node_modules/pi-agent-search-text/runtime/entry-47.js +1 -0
- package/node_modules/pi-agent-search-text/src/resolvers.ts +47 -19
- package/node_modules/pi-agent-search-text/src/search-backend.ts +6 -15
- package/node_modules/pi-agent-search-text/src/search-presentation.ts +80 -0
- package/node_modules/pi-agent-search-text/src/search-renderer.ts +17 -1
- package/node_modules/pi-agent-search-text/src/search-result.ts +32 -12
- package/node_modules/pi-agent-search-text/src/search-session.ts +6 -3
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text/runtime/entry-49.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-50.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/package.json +5 -5
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-51.js +0 -1
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-52.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-53.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-54.js +2 -0
- package/node_modules/pi-agent-text-editor/package.json +25 -25
- package/node_modules/pi-agent-text-editor/runtime/entry-70.js +0 -1
- package/node_modules/pi-agent-text-editor/src/api/edit-completion.ts +7 -1
- package/node_modules/pi-agent-text-editor/src/api/edit-pipeline.ts +3 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-guard.ts +1 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +47 -0
- package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +6 -1
- package/node_modules/pi-agent-text-editor/src/api/tool-renderer.ts +3 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/apply-undo-store.ts +155 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/execution.ts +56 -77
- package/node_modules/pi-agent-text-editor/src/core/apply/mixed-source.ts +7 -12
- package/node_modules/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/output.ts +37 -8
- package/node_modules/pi-agent-text-editor/src/core/apply/prompt.ts +42 -37
- package/node_modules/pi-agent-text-editor/src/core/apply/renderer.ts +51 -15
- package/node_modules/pi-agent-text-editor/src/core/apply/runtime.ts +119 -20
- package/node_modules/pi-agent-text-editor/src/core/apply/tool.ts +28 -7
- package/node_modules/pi-agent-text-editor/src/core/apply/transaction.ts +387 -0
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +3 -2
- package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +68 -71
- package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +4 -4
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +11 -0
- 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 +182 -10
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +135 -6
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +9 -4
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +3 -2
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +9 -4
- package/node_modules/pi-agent-text-editor-renderer/index.ts +5 -0
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +60 -2
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +2 -0
- package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
- package/node_modules/pi-agent-tool-ui/package.json +2 -2
- package/node_modules/pi-agent-tool-ui/runtime/entry-75.js +1 -0
- package/node_modules/pi-agent-web/package.json +7 -7
- package/node_modules/pi-agent-web-html/package.json +3 -3
- package/node_modules/pi-agent-web-image/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-80.js +2 -0
- package/package.json +61 -38
- package/src/api/hooks.ts +168 -0
- package/src/api/text-editor.ts +2 -0
- package/src/composite/builtin-extensions.ts +13 -0
- package/src/composite/extensions-config.ts +18 -0
- package/src/composite/module-labels.ts +12 -0
- package/src/composite/module-settings-store.ts +17 -1
- package/src/composite/module-settings.ts +34 -4
- package/src/composite/preferences.ts +26 -0
- package/src/composite/settings-panel.ts +62 -30
- package/src/core/reload-resource-store.ts +34 -0
- package/src/doctor/tip-provider.ts +1 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
- 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-25.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-22.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +7 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
- 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-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-80.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-76.js +2 -0
- package/src/extensions/pi-agent-read/package.json +11 -11
- package/src/extensions/pi-agent-read/runtime/entry-40.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-41.js +2 -0
- package/src/extensions/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/src/extensions/pi-agent-read/src/api/rendering.ts +1 -1
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +32 -0
- package/src/extensions/pi-agent-read/src/core/read-core.ts +8 -0
- package/src/extensions/pi-agent-read/src/core/tools/read/raw-read.ts +38 -4
- package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +66 -4
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +105 -5
- package/src/extensions/pi-agent-search/package.json +7 -7
- 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 +9 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-47.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-48.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +47 -19
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +6 -15
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-presentation.ts +80 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +17 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +32 -12
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +6 -3
- package/src/extensions/pi-agent-search/runtime/entry-45.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-46.js +2 -0
- package/src/extensions/pi-agent-search/src/api/search-parameters.ts +5 -1
- package/src/extensions/pi-agent-text-editor/package.json +25 -25
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-50.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-51.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-52.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-53.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-54.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +5 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +60 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +2 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-70.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-71.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/edit-completion.ts +7 -1
- package/src/extensions/pi-agent-text-editor/src/api/edit-pipeline.ts +3 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-guard.ts +1 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +47 -0
- package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +6 -1
- package/src/extensions/pi-agent-text-editor/src/api/tool-renderer.ts +3 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/apply-undo-store.ts +155 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/execution.ts +56 -77
- package/src/extensions/pi-agent-text-editor/src/core/apply/mixed-source.ts +7 -12
- package/src/extensions/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/output.ts +37 -8
- package/src/extensions/pi-agent-text-editor/src/core/apply/prompt.ts +42 -37
- package/src/extensions/pi-agent-text-editor/src/core/apply/renderer.ts +51 -15
- package/src/extensions/pi-agent-text-editor/src/core/apply/runtime.ts +119 -20
- package/src/extensions/pi-agent-text-editor/src/core/apply/tool.ts +28 -7
- package/src/extensions/pi-agent-text-editor/src/core/apply/transaction.ts +387 -0
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +3 -2
- package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +68 -71
- package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +4 -4
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +11 -0
- 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 +182 -10
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +135 -6
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +9 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +3 -2
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +9 -4
- package/src/pi-agent-ide.ts +2 -1
- package/src/plugins/pi-agent-ide-ast/package.json +32 -11
- package/src/plugins/pi-agent-ide-ast/runtime/entry-26.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-27.js +2 -0
- package/src/plugins/pi-agent-ide-ast/src/ast/manager.ts +16 -8
- package/src/plugins/pi-agent-ide-ast/src/ast/native-parser.ts +151 -0
- package/src/plugins/pi-agent-ide-ast/src/ast/outline.ts +22 -17
- package/src/plugins/pi-agent-ide-ast/src/ast/syntax-tree.ts +25 -0
- package/src/plugins/pi-agent-ide-ast/src/doctor-plugin.ts +52 -1
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +4 -1
- package/src/plugins/pi-agent-ide-changes/index.ts +3 -1
- package/src/plugins/pi-agent-ide-changes/package.json +8 -8
- package/src/plugins/pi-agent-ide-changes/runtime/entry-28.js +0 -1
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +42 -9
- package/src/plugins/pi-agent-ide-debugger/index.ts +573 -0
- package/src/plugins/pi-agent-ide-debugger/src/breakpoint-view.ts +73 -0
- package/src/plugins/pi-agent-ide-debugger/src/catalog.ts +306 -0
- package/src/plugins/pi-agent-ide-debugger/src/dap-client.ts +338 -0
- package/src/plugins/pi-agent-ide-debugger/src/doctor-plugin.ts +349 -0
- package/src/plugins/pi-agent-ide-debugger/src/process-provider.ts +39 -0
- package/src/plugins/pi-agent-ide-debugger/src/renderer.ts +152 -0
- package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +1344 -0
- package/src/plugins/pi-agent-ide-debugger/src/ui.ts +14 -0
- package/src/plugins/pi-agent-ide-formatter/package.json +9 -4
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-lint/package.json +13 -8
- package/src/plugins/pi-agent-ide-lsp/index.ts +4 -1
- package/src/plugins/pi-agent-ide-lsp/package.json +15 -10
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-33.js +2 -0
- package/src/plugins/pi-agent-ide-processes/index.ts +28 -0
- package/src/plugins/pi-agent-ide-processes/src/registry.ts +81 -0
- package/src/plugins/pi-agent-ide-processes/src/ui.ts +252 -0
- package/src/plugins/pi-agent-ide-terminal/index.ts +40 -0
- package/src/plugins/pi-agent-ide-terminal/src/output-limits.ts +52 -0
- package/src/plugins/pi-agent-ide-terminal/src/process-provider.ts +30 -0
- package/src/plugins/pi-agent-ide-terminal/src/renderer.ts +204 -0
- package/src/plugins/pi-agent-ide-terminal/src/resources.ts +452 -0
- package/src/plugins/pi-agent-ide-terminal/src/screen-image.ts +127 -0
- package/src/plugins/pi-agent-ide-terminal/src/search.ts +159 -0
- package/src/plugins/pi-agent-ide-terminal/src/session-manager.ts +642 -0
- package/src/plugins/pi-agent-ide-terminal/src/shell-profile.ts +56 -0
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +151 -0
- package/src/plugins/pi-agent-ide-terminal/src/types.ts +78 -0
- package/src/plugins/pi-agent-ide-terminal/src/ui.ts +212 -0
- package/dist/chunk-5MSNYFDE.js +0 -1
- package/dist/chunk-B5KB2I7J.js +0 -3
- package/dist/chunk-NMFQGKPE.js +0 -2
- package/dist/chunk-OVUYPHDE.js +0 -1
- package/dist/chunk-RHV5STR3.js +0 -3
- package/dist/chunk-TPIHQYK2.js +0 -14
- package/dist/chunk-VCCMVQXU.js +0 -1
- package/dist/chunk-VZJIZXSH.js +0 -14
- package/dist/entry-16.js +0 -1
- package/node_modules/pi-agent-doctor/runtime/entry-16.js +0 -1
- package/node_modules/pi-agent-filesystem/runtime/entry-21.js +0 -2
- package/node_modules/pi-agent-ide-ast/runtime/entry-25.js +0 -1
- package/node_modules/pi-agent-ide-changes/runtime/entry-27.js +0 -1
- package/node_modules/pi-agent-image/runtime/entry-33.js +0 -1
- package/node_modules/pi-agent-resource/runtime/entry-41.js +0 -1
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-49.js +0 -2
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-50.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-52.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-54.js +0 -1
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-73.js +0 -1
- package/node_modules/pi-agent-web/runtime/entry-75.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-22.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-21.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-76.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-75.js +0 -2
- package/src/extensions/pi-agent-read/runtime/entry-36.js +0 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-46.js +0 -2
- package/src/extensions/pi-agent-search/runtime/entry-42.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-49.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-50.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-52.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-71.js +0 -2
- package/src/extensions/pi-agent-text-editor/runtime/entry-54.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-25.js +0 -1
- package/src/plugins/pi-agent-ide-changes/runtime/entry-27.js +0 -1
- /package/node_modules/{pi-agent-filesystem-image → pi-agent-filesystem}/runtime/entry-22.js +0 -0
- /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-23.js +0 -0
- /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-24.js +0 -0
- /package/node_modules/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-29.js +0 -0
- /package/node_modules/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-30.js +0 -0
- /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-31.js +0 -0
- /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-32.js +0 -0
- /package/node_modules/{pi-agent-invariant → pi-agent-image}/runtime/entry-34.js +0 -0
- /package/node_modules/{pi-agent-pdf → pi-agent-invariant}/runtime/entry-35.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-36.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-42.js +0 -0
- /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-46.js +0 -0
- /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-48.js +0 -0
- /package/node_modules/{pi-agent-text-editor-renderer → pi-agent-text-editor}/runtime/entry-71.js +0 -0
- /package/node_modules/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-72.js +0 -0
- /package/node_modules/{pi-agent-tool-ui → pi-agent-tool-call-interception}/runtime/entry-74.js +0 -0
- /package/node_modules/{pi-agent-web-html → pi-agent-web}/runtime/entry-76.js +0 -0
- /package/node_modules/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-77.js +0 -0
- /package/node_modules/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-78.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-79.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-23.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-24.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-77.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-78.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-79.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-72.js +0 -0
- /package/src/plugins/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-29.js +0 -0
- /package/src/plugins/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-30.js +0 -0
- /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-31.js +0 -0
- /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-32.js +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DebugSessionSnapshot } from "#src/plugins/pi-agent-ide-debugger/src/session-manager.js";
|
|
2
|
+
|
|
3
|
+
/** Extract one immutable snapshot from a debugger semantic-action receipt. */
|
|
4
|
+
export function debuggerSnapshotFromResult(details: unknown): DebugSessionSnapshot | undefined {
|
|
5
|
+
if (typeof details !== "object" || details === null) return undefined;
|
|
6
|
+
const metadata = (details as { readonly metadata?: unknown }).metadata;
|
|
7
|
+
if (typeof metadata !== "object" || metadata === null) return undefined;
|
|
8
|
+
const semantic = (metadata as { readonly semanticAction?: unknown }).semanticAction;
|
|
9
|
+
if (typeof semantic !== "object" || semantic === null) return undefined;
|
|
10
|
+
const snapshot = (semantic as { readonly snapshot?: unknown }).snapshot;
|
|
11
|
+
return typeof snapshot === "object" && snapshot !== null
|
|
12
|
+
? (snapshot as DebugSessionSnapshot)
|
|
13
|
+
: undefined;
|
|
14
|
+
}
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-formatter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-doctor": "0.
|
|
6
|
+
"pi-agent-doctor": "0.5.0"
|
|
7
7
|
},
|
|
8
8
|
"pi": {
|
|
9
9
|
"extensions": [
|
|
10
|
-
"./runtime/entry-
|
|
10
|
+
"./runtime/entry-30.js"
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"@earendil-works/pi-coding-agent": "*",
|
|
15
|
-
"pi-agent-ide": "0.
|
|
15
|
+
"pi-agent-ide": "0.5.0"
|
|
16
|
+
},
|
|
17
|
+
"peerDependenciesMeta": {
|
|
18
|
+
"pi-agent-ide": {
|
|
19
|
+
"optional": true
|
|
20
|
+
}
|
|
16
21
|
}
|
|
17
22
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-languages",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-doctor": "0.
|
|
6
|
+
"pi-agent-doctor": "0.5.0"
|
|
7
7
|
},
|
|
8
8
|
"pi": {
|
|
9
9
|
"extensions": [
|
|
10
|
-
"./runtime/entry-
|
|
10
|
+
"./runtime/entry-31.js"
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-lint",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-doctor": "0.
|
|
7
|
-
"pi-agent-invariant": "0.
|
|
8
|
-
"pi-agent-read": "0.
|
|
9
|
-
"pi-agent-resource": "0.
|
|
10
|
-
"pi-agent-text": "0.
|
|
6
|
+
"pi-agent-doctor": "0.5.0",
|
|
7
|
+
"pi-agent-invariant": "0.5.0",
|
|
8
|
+
"pi-agent-read": "0.5.0",
|
|
9
|
+
"pi-agent-resource": "0.5.0",
|
|
10
|
+
"pi-agent-text": "0.5.0"
|
|
11
11
|
},
|
|
12
12
|
"pi": {
|
|
13
13
|
"extensions": [
|
|
14
|
-
"./runtime/entry-
|
|
14
|
+
"./runtime/entry-32.js"
|
|
15
15
|
]
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"@earendil-works/pi-coding-agent": "*",
|
|
19
|
-
"pi-agent-ide": "0.
|
|
19
|
+
"pi-agent-ide": "0.5.0"
|
|
20
|
+
},
|
|
21
|
+
"peerDependenciesMeta": {
|
|
22
|
+
"pi-agent-ide": {
|
|
23
|
+
"optional": true
|
|
24
|
+
}
|
|
20
25
|
}
|
|
21
26
|
}
|
|
@@ -115,6 +115,9 @@ export default async function registerLsp(pi: ExtensionAPI): Promise<void> {
|
|
|
115
115
|
api.describe(
|
|
116
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
117
|
);
|
|
118
|
+
api.addPromptGuideline(
|
|
119
|
+
"Use semantic code views first when exploring code supported by a configured language server. Use `symbols:<query>` to locate named declaration and reference candidates when the file is unknown. Use `graph:<file>` to map the declarations and relationships in a known file before reading implementation bodies. Use `graph:<file>#<selector>` to inspect references and incoming/outgoing calls for one declaration. Use `symbol:<file>#<selector>` to read that declaration’s source. Use text search for exact text, non-code files, or when semantic views are unavailable.",
|
|
120
|
+
);
|
|
118
121
|
},
|
|
119
122
|
} satisfies ReadPlugin;
|
|
120
123
|
|
|
@@ -220,7 +223,7 @@ export default async function registerLsp(pi: ExtensionAPI): Promise<void> {
|
|
|
220
223
|
setup(api): void {
|
|
221
224
|
api.addResolver({ resolver: createLspSearchResolver(managerFor) });
|
|
222
225
|
api.describe(
|
|
223
|
-
"Use `symbols:<query>` to
|
|
226
|
+
"Use `symbols:<query>` to locate named workspace declarations and references through configured language servers when the file is unknown.",
|
|
224
227
|
);
|
|
225
228
|
},
|
|
226
229
|
}),
|
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-lsp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"cross-spawn": "^7.0.6",
|
|
7
|
-
"pi-agent-doctor": "0.
|
|
8
|
-
"pi-agent-invariant": "0.
|
|
9
|
-
"pi-agent-read": "0.
|
|
10
|
-
"pi-agent-resource": "0.
|
|
11
|
-
"pi-agent-search": "0.
|
|
12
|
-
"pi-agent-text": "0.
|
|
13
|
-
"pi-agent-text-editor": "0.
|
|
7
|
+
"pi-agent-doctor": "0.5.0",
|
|
8
|
+
"pi-agent-invariant": "0.5.0",
|
|
9
|
+
"pi-agent-read": "0.5.0",
|
|
10
|
+
"pi-agent-resource": "0.5.0",
|
|
11
|
+
"pi-agent-search": "0.5.0",
|
|
12
|
+
"pi-agent-text": "0.5.0",
|
|
13
|
+
"pi-agent-text-editor": "0.5.0",
|
|
14
14
|
"vscode-jsonrpc": "^9.0.0",
|
|
15
15
|
"vscode-uri": "^3.1.0"
|
|
16
16
|
},
|
|
17
17
|
"pi": {
|
|
18
18
|
"extensions": [
|
|
19
|
-
"./runtime/entry-
|
|
19
|
+
"./runtime/entry-33.js"
|
|
20
20
|
]
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@earendil-works/pi-coding-agent": "*",
|
|
24
|
-
"pi-agent-ide": "0.
|
|
24
|
+
"pi-agent-ide": "0.5.0"
|
|
25
|
+
},
|
|
26
|
+
"peerDependenciesMeta": {
|
|
27
|
+
"pi-agent-ide": {
|
|
28
|
+
"optional": true
|
|
29
|
+
}
|
|
25
30
|
}
|
|
26
31
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
readPiAgentIdeExtensionsConfig,
|
|
5
|
+
resolvePiAgentIdeExtensionsConfigPaths,
|
|
6
|
+
} from "#src/composite/extensions-config.js";
|
|
7
|
+
import { agentIdeProcessRegistry } from "#src/plugins/pi-agent-ide-processes/src/registry.js";
|
|
8
|
+
import {
|
|
9
|
+
AgentIdeProcessesUi,
|
|
10
|
+
type ProcessActivityMode,
|
|
11
|
+
} from "#src/plugins/pi-agent-ide-processes/src/ui.js";
|
|
12
|
+
|
|
13
|
+
/** Register the shared Agent IDE process widget and overlay. */
|
|
14
|
+
export default async function registerAgentIdeProcesses(pi: ExtensionAPI): Promise<void> {
|
|
15
|
+
const registry = agentIdeProcessRegistry(pi);
|
|
16
|
+
const config = await readPiAgentIdeExtensionsConfig(resolvePiAgentIdeExtensionsConfigPaths());
|
|
17
|
+
const ui = new AgentIdeProcessesUi(
|
|
18
|
+
registry,
|
|
19
|
+
activityMode(config.preferences?.["processes.activity"]),
|
|
20
|
+
pi,
|
|
21
|
+
);
|
|
22
|
+
pi.on("session_start", (_event, context) => ui.bind(context));
|
|
23
|
+
pi.on("session_shutdown", () => ui.dispose());
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function activityMode(value: string | undefined): ProcessActivityMode {
|
|
27
|
+
return value === "compact" || value === "off" ? value : "detailed";
|
|
28
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { ExtensionAPI, Theme } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import type { Component } from "@earendil-works/pi-tui";
|
|
3
|
+
|
|
4
|
+
export type AgentIdeProcessStatus = "configured" | "running" | "stopping" | "paused";
|
|
5
|
+
|
|
6
|
+
/** One active process contributed by an Agent IDE capability. */
|
|
7
|
+
export interface AgentIdeProcess {
|
|
8
|
+
readonly source: string;
|
|
9
|
+
readonly kind: string;
|
|
10
|
+
readonly title: string;
|
|
11
|
+
readonly description: string;
|
|
12
|
+
readonly status: AgentIdeProcessStatus;
|
|
13
|
+
renderSummary(theme: Theme): readonly string[];
|
|
14
|
+
renderDetail(theme: Theme): Component;
|
|
15
|
+
stop(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Supplies one process kind to the shared Agent IDE process surface. */
|
|
19
|
+
export interface AgentIdeProcessProvider {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
list(): readonly AgentIdeProcess[];
|
|
22
|
+
onDidChange(listener: () => void): () => void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
type Listener = () => void;
|
|
26
|
+
|
|
27
|
+
/** Session-local registry shared by independently loaded Agent IDE extensions. */
|
|
28
|
+
export class AgentIdeProcessRegistry {
|
|
29
|
+
readonly #providers = new Map<string, AgentIdeProcessProvider>();
|
|
30
|
+
readonly #listeners = new Set<Listener>();
|
|
31
|
+
readonly #disposeProviders = new Map<string, () => void>();
|
|
32
|
+
|
|
33
|
+
add(provider: AgentIdeProcessProvider): () => void {
|
|
34
|
+
this.#disposeProviders.get(provider.id)?.();
|
|
35
|
+
this.#providers.set(provider.id, provider);
|
|
36
|
+
this.#disposeProviders.set(
|
|
37
|
+
provider.id,
|
|
38
|
+
provider.onDidChange(() => this.#emit()),
|
|
39
|
+
);
|
|
40
|
+
this.#emit();
|
|
41
|
+
return () => {
|
|
42
|
+
if (this.#providers.get(provider.id) !== provider) return;
|
|
43
|
+
this.#disposeProviders.get(provider.id)?.();
|
|
44
|
+
this.#disposeProviders.delete(provider.id);
|
|
45
|
+
this.#providers.delete(provider.id);
|
|
46
|
+
this.#emit();
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
list(): readonly AgentIdeProcess[] {
|
|
51
|
+
return [...this.#providers.values()].flatMap((provider) => provider.list());
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
onDidChange(listener: Listener): () => void {
|
|
55
|
+
this.#listeners.add(listener);
|
|
56
|
+
return () => this.#listeners.delete(listener);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
dispose(): void {
|
|
60
|
+
for (const dispose of this.#disposeProviders.values()) dispose();
|
|
61
|
+
this.#disposeProviders.clear();
|
|
62
|
+
this.#providers.clear();
|
|
63
|
+
this.#listeners.clear();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
#emit(): void {
|
|
67
|
+
for (const listener of this.#listeners) listener();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const registries = new WeakMap<ExtensionAPI, AgentIdeProcessRegistry>();
|
|
72
|
+
|
|
73
|
+
/** Return the shared process registry for this Pi extension runtime. */
|
|
74
|
+
export function agentIdeProcessRegistry(pi: ExtensionAPI): AgentIdeProcessRegistry {
|
|
75
|
+
let registry = registries.get(pi);
|
|
76
|
+
if (registry === undefined) {
|
|
77
|
+
registry = new AgentIdeProcessRegistry();
|
|
78
|
+
registries.set(pi, registry);
|
|
79
|
+
}
|
|
80
|
+
return registry;
|
|
81
|
+
}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DynamicBorder,
|
|
3
|
+
type ExtensionAPI,
|
|
4
|
+
type ExtensionContext,
|
|
5
|
+
type Theme,
|
|
6
|
+
} from "@earendil-works/pi-coding-agent";
|
|
7
|
+
import {
|
|
8
|
+
Container,
|
|
9
|
+
Key,
|
|
10
|
+
matchesKey,
|
|
11
|
+
SelectList,
|
|
12
|
+
Text,
|
|
13
|
+
truncateToWidth,
|
|
14
|
+
visibleWidth,
|
|
15
|
+
type SelectItem,
|
|
16
|
+
} from "@earendil-works/pi-tui";
|
|
17
|
+
|
|
18
|
+
import type { AgentIdeProcess, AgentIdeProcessRegistry } from "./registry.js";
|
|
19
|
+
|
|
20
|
+
export type ProcessActivityMode = "detailed" | "compact" | "off";
|
|
21
|
+
|
|
22
|
+
/** Owns the unified active-process widget and `/agent-ide-processes` overlay. */
|
|
23
|
+
export class AgentIdeProcessesUi {
|
|
24
|
+
#context: ExtensionContext | undefined;
|
|
25
|
+
#closed = false;
|
|
26
|
+
#elapsedTimer: ReturnType<typeof setInterval> | undefined;
|
|
27
|
+
|
|
28
|
+
constructor(
|
|
29
|
+
private readonly registry: AgentIdeProcessRegistry,
|
|
30
|
+
private readonly activityMode: ProcessActivityMode,
|
|
31
|
+
pi: ExtensionAPI,
|
|
32
|
+
) {
|
|
33
|
+
registry.onDidChange(() => this.#render());
|
|
34
|
+
pi.registerCommand("agent-ide-processes", {
|
|
35
|
+
description: "Show active terminal and debugger processes created by Agent IDE",
|
|
36
|
+
handler: async (_args, context) => {
|
|
37
|
+
this.bind(context);
|
|
38
|
+
if (context.mode !== "tui") {
|
|
39
|
+
context.ui.notify("The Agent IDE process overlay requires the TUI.", "info");
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
await this.#showOverlay(context);
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
bind(context: ExtensionContext): void {
|
|
48
|
+
if (this.#closed) return;
|
|
49
|
+
this.#context = context;
|
|
50
|
+
this.#render();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
dispose(): void {
|
|
54
|
+
this.#closed = true;
|
|
55
|
+
if (this.#elapsedTimer !== undefined) clearInterval(this.#elapsedTimer);
|
|
56
|
+
this.#elapsedTimer = undefined;
|
|
57
|
+
this.#context?.ui.setWidget("agent-ide-processes", undefined);
|
|
58
|
+
this.#context?.ui.setStatus("agent-ide-processes", undefined);
|
|
59
|
+
this.#context = undefined;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
#active(): readonly AgentIdeProcess[] {
|
|
63
|
+
return this.registry.list();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
#render(): void {
|
|
67
|
+
const context = this.#context;
|
|
68
|
+
if (this.#closed || context === undefined || !context.hasUI) return;
|
|
69
|
+
const active = this.#active();
|
|
70
|
+
if (this.activityMode === "off" || active.length === 0) {
|
|
71
|
+
context.ui.setWidget("agent-ide-processes", undefined);
|
|
72
|
+
context.ui.setStatus("agent-ide-processes", undefined);
|
|
73
|
+
if (this.#elapsedTimer !== undefined) clearInterval(this.#elapsedTimer);
|
|
74
|
+
this.#elapsedTimer = undefined;
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (this.activityMode === "compact") {
|
|
78
|
+
context.ui.setWidget("agent-ide-processes", undefined);
|
|
79
|
+
context.ui.setStatus("agent-ide-processes", `Agent IDE processes: ${active.length}`);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
context.ui.setStatus("agent-ide-processes", undefined);
|
|
83
|
+
context.ui.setWidget(
|
|
84
|
+
"agent-ide-processes",
|
|
85
|
+
(_tui, theme) => ({
|
|
86
|
+
invalidate() {},
|
|
87
|
+
render: (width: number) => renderProcessWidget(active, width, theme),
|
|
88
|
+
}),
|
|
89
|
+
{ placement: "belowEditor" },
|
|
90
|
+
);
|
|
91
|
+
this.#elapsedTimer ??= setInterval(() => this.#render(), 1_000);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
async #showOverlay(context: ExtensionContext): Promise<void> {
|
|
95
|
+
for (;;) {
|
|
96
|
+
if (this.#active().length === 0) {
|
|
97
|
+
context.ui.notify("No active Agent IDE processes.", "info");
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
let disposeRefresh: () => void = () => undefined;
|
|
102
|
+
let refreshTimer: ReturnType<typeof setInterval> | undefined;
|
|
103
|
+
let action: { readonly source: string } | null;
|
|
104
|
+
try {
|
|
105
|
+
action = await context.ui.custom<{ readonly source: string } | null>(
|
|
106
|
+
(tui, theme, _keys, done) => {
|
|
107
|
+
let active = this.#active();
|
|
108
|
+
let page: "list" | "detail" | "confirm" = "list";
|
|
109
|
+
let selected: AgentIdeProcess | undefined;
|
|
110
|
+
const createList = (selectedSource?: string): SelectList => {
|
|
111
|
+
const items: SelectItem[] = active.map((process) => ({
|
|
112
|
+
value: process.source,
|
|
113
|
+
label: `${process.status} ${process.kind} ${process.title}`,
|
|
114
|
+
description: process.description,
|
|
115
|
+
}));
|
|
116
|
+
const next = new SelectList(items, Math.min(items.length, 12), {
|
|
117
|
+
selectedPrefix: (text) => theme.fg("accent", text),
|
|
118
|
+
selectedText: (text) => theme.fg("accent", text),
|
|
119
|
+
description: (text) => theme.fg("muted", text),
|
|
120
|
+
scrollInfo: (text) => theme.fg("dim", text),
|
|
121
|
+
noMatch: (text) => theme.fg("warning", text),
|
|
122
|
+
});
|
|
123
|
+
const selectedIndex = items.findIndex((item) => item.value === selectedSource);
|
|
124
|
+
if (selectedIndex >= 0) next.setSelectedIndex(selectedIndex);
|
|
125
|
+
next.onSelect = (item) => {
|
|
126
|
+
selected = active.find((process) => process.source === item.value);
|
|
127
|
+
page = "detail";
|
|
128
|
+
tui.requestRender();
|
|
129
|
+
};
|
|
130
|
+
next.onCancel = () => done(null);
|
|
131
|
+
return next;
|
|
132
|
+
};
|
|
133
|
+
let list = createList();
|
|
134
|
+
const refresh = (): void => {
|
|
135
|
+
const selectedSource = selected?.source ?? list.getSelectedItem()?.value;
|
|
136
|
+
active = this.#active();
|
|
137
|
+
selected =
|
|
138
|
+
page === "list"
|
|
139
|
+
? undefined
|
|
140
|
+
: active.find((process) => process.source === selectedSource);
|
|
141
|
+
list = createList(selectedSource);
|
|
142
|
+
tui.requestRender();
|
|
143
|
+
};
|
|
144
|
+
disposeRefresh = this.registry.onDidChange(refresh);
|
|
145
|
+
refreshTimer = setInterval(refresh, 1_000);
|
|
146
|
+
|
|
147
|
+
return {
|
|
148
|
+
invalidate: () => list.invalidate(),
|
|
149
|
+
render(width: number) {
|
|
150
|
+
const container = new Container();
|
|
151
|
+
container.addChild(new DynamicBorder((text) => theme.fg("accent", text)));
|
|
152
|
+
if (page === "list") {
|
|
153
|
+
container.addChild(
|
|
154
|
+
new Text(theme.fg("accent", theme.bold("Agent IDE processes")), 1, 0),
|
|
155
|
+
);
|
|
156
|
+
container.addChild(list);
|
|
157
|
+
container.addChild(
|
|
158
|
+
new Text(theme.fg("dim", "enter view · d stop · esc close"), 1, 0),
|
|
159
|
+
);
|
|
160
|
+
} else if (selected === undefined) {
|
|
161
|
+
container.addChild(
|
|
162
|
+
new Text(theme.fg("warning", "Process is no longer active."), 1, 0),
|
|
163
|
+
);
|
|
164
|
+
} else {
|
|
165
|
+
container.addChild(selected.renderDetail(theme));
|
|
166
|
+
container.addChild(
|
|
167
|
+
new Text(
|
|
168
|
+
theme.fg(
|
|
169
|
+
page === "confirm" ? "warning" : "dim",
|
|
170
|
+
page === "confirm"
|
|
171
|
+
? "Stop this process? y confirm · n/esc cancel"
|
|
172
|
+
: "esc back · d stop",
|
|
173
|
+
),
|
|
174
|
+
1,
|
|
175
|
+
0,
|
|
176
|
+
),
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
container.addChild(new DynamicBorder((text) => theme.fg("accent", text)));
|
|
180
|
+
return container.render(width);
|
|
181
|
+
},
|
|
182
|
+
handleInput(data: string) {
|
|
183
|
+
if (page === "list") {
|
|
184
|
+
if (data === "d") {
|
|
185
|
+
selected = active.find(
|
|
186
|
+
(process) => process.source === list.getSelectedItem()?.value,
|
|
187
|
+
);
|
|
188
|
+
if (selected !== undefined) page = "confirm";
|
|
189
|
+
} else list.handleInput(data);
|
|
190
|
+
} else if (page === "detail") {
|
|
191
|
+
if (matchesKey(data, Key.escape)) page = "list";
|
|
192
|
+
else if (data === "d") page = "confirm";
|
|
193
|
+
} else if (data === "y" && selected !== undefined)
|
|
194
|
+
done({ source: selected.source });
|
|
195
|
+
else if (data === "n" || matchesKey(data, Key.escape)) page = "detail";
|
|
196
|
+
tui.requestRender();
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
},
|
|
200
|
+
{ overlay: true, overlayOptions: { width: "75%", maxHeight: "80%", minWidth: 52 } },
|
|
201
|
+
);
|
|
202
|
+
} finally {
|
|
203
|
+
disposeRefresh();
|
|
204
|
+
if (refreshTimer !== undefined) clearInterval(refreshTimer);
|
|
205
|
+
}
|
|
206
|
+
if (action === null) return;
|
|
207
|
+
const process = this.#active().find((candidate) => candidate.source === action.source);
|
|
208
|
+
if (process !== undefined) await process.stop();
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** Render all active process kinds in one stable shared widget. */
|
|
214
|
+
export function renderProcessWidget(
|
|
215
|
+
processes: readonly AgentIdeProcess[],
|
|
216
|
+
width: number,
|
|
217
|
+
theme: Theme,
|
|
218
|
+
): string[] {
|
|
219
|
+
if (processes.length === 0) return [];
|
|
220
|
+
const accent = (text: string) => theme.fg("accent", text);
|
|
221
|
+
const lines = [borderTop("Agent IDE Processes", `${processes.length} active`, width, accent)];
|
|
222
|
+
for (const [index, process] of processes.entries()) {
|
|
223
|
+
for (const line of process.renderSummary(theme))
|
|
224
|
+
lines.push(borderLine(` ${line} `, width, accent));
|
|
225
|
+
if (index < processes.length - 1) lines.push(borderLine("", width, accent));
|
|
226
|
+
}
|
|
227
|
+
lines.push(borderBottom(width, accent));
|
|
228
|
+
return lines;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function borderTop(
|
|
232
|
+
title: string,
|
|
233
|
+
info: string,
|
|
234
|
+
width: number,
|
|
235
|
+
accent: (text: string) => string,
|
|
236
|
+
): string {
|
|
237
|
+
if (width <= 1) return accent("╭");
|
|
238
|
+
const inner = width - 2;
|
|
239
|
+
const left = `─ ${title} `;
|
|
240
|
+
const right = ` ${info} ─`;
|
|
241
|
+
const fill = "─".repeat(Math.max(0, inner - visibleWidth(left) - visibleWidth(right)));
|
|
242
|
+
return accent(`╭${truncateToWidth(`${left}${fill}${right}`, inner).padEnd(inner, "─")}╮`);
|
|
243
|
+
}
|
|
244
|
+
function borderLine(line: string, width: number, accent: (text: string) => string): string {
|
|
245
|
+
if (width <= 1) return accent("│");
|
|
246
|
+
const inner = width - 2;
|
|
247
|
+
const clipped = truncateToWidth(line, inner);
|
|
248
|
+
return `${accent("│")}${clipped}${" ".repeat(Math.max(0, inner - visibleWidth(clipped)))}${accent("│")}`;
|
|
249
|
+
}
|
|
250
|
+
function borderBottom(width: number, accent: (text: string) => string): string {
|
|
251
|
+
return accent(width <= 1 ? "╰" : `╰${"─".repeat(width - 2)}╯`);
|
|
252
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import {
|
|
3
|
+
forgetReloadResource,
|
|
4
|
+
retainReloadResource,
|
|
5
|
+
takeReloadResource,
|
|
6
|
+
} from "#src/core/reload-resource-store.js";
|
|
7
|
+
import { agentIdeProcessRegistry } from "#src/plugins/pi-agent-ide-processes/src/registry.js";
|
|
8
|
+
import { terminalProcessProvider } from "#src/plugins/pi-agent-ide-terminal/src/process-provider.js";
|
|
9
|
+
import { registerTerminalResources } from "#src/plugins/pi-agent-ide-terminal/src/resources.js";
|
|
10
|
+
import { registerTerminalSearch } from "#src/plugins/pi-agent-ide-terminal/src/search.js";
|
|
11
|
+
import { TerminalSessionManager } from "#src/plugins/pi-agent-ide-terminal/src/session-manager.js";
|
|
12
|
+
import { resolveShellProfile } from "#src/plugins/pi-agent-ide-terminal/src/shell-profile.js";
|
|
13
|
+
import { registerTerminalTools } from "#src/plugins/pi-agent-ide-terminal/src/tools.js";
|
|
14
|
+
import { TerminalUi } from "#src/plugins/pi-agent-ide-terminal/src/ui.js";
|
|
15
|
+
|
|
16
|
+
/** Register the platform-aware terminal runner and shell session resources. */
|
|
17
|
+
export default async function registerTerminal(pi: ExtensionAPI): Promise<void> {
|
|
18
|
+
const manager =
|
|
19
|
+
(takeReloadResource("terminal") as TerminalSessionManager | undefined) ??
|
|
20
|
+
new TerminalSessionManager();
|
|
21
|
+
const profile = resolveShellProfile();
|
|
22
|
+
const ui = new TerminalUi(pi, manager);
|
|
23
|
+
const removeProcessProvider = agentIdeProcessRegistry(pi).add(terminalProcessProvider(manager));
|
|
24
|
+
|
|
25
|
+
await Promise.all([registerTerminalResources(pi, manager), registerTerminalSearch(pi, manager)]);
|
|
26
|
+
registerTerminalTools(pi, manager, profile, ui);
|
|
27
|
+
|
|
28
|
+
pi.on("session_start", (_event, context) => ui.bind(context));
|
|
29
|
+
pi.on("agent_settled", (_event, context) => ui.onAgentSettled(context));
|
|
30
|
+
pi.on("session_shutdown", async (event) => {
|
|
31
|
+
ui.dispose();
|
|
32
|
+
removeProcessProvider();
|
|
33
|
+
if (event.reason === "reload") {
|
|
34
|
+
retainReloadResource("terminal", manager);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
forgetReloadResource("terminal", manager);
|
|
38
|
+
await manager.dispose();
|
|
39
|
+
});
|
|
40
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_MAX_BYTES,
|
|
3
|
+
DEFAULT_MAX_LINES,
|
|
4
|
+
formatSize,
|
|
5
|
+
truncateTail,
|
|
6
|
+
type TruncationResult,
|
|
7
|
+
} from "@earendil-works/pi-coding-agent";
|
|
8
|
+
|
|
9
|
+
import type { TerminalSessionSnapshot } from "#src/plugins/pi-agent-ide-terminal/src/types.js";
|
|
10
|
+
|
|
11
|
+
/** Keep the useful end of terminal output within the shared Read output budget. */
|
|
12
|
+
export function terminalOutputTail(output: string): TruncationResult {
|
|
13
|
+
return truncateTail(output, {
|
|
14
|
+
maxBytes: DEFAULT_MAX_BYTES - 4_096,
|
|
15
|
+
maxLines: DEFAULT_MAX_LINES - 32,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Format one terminal snapshot for the agent without exposing unbounded output. */
|
|
20
|
+
export function formatAgentTerminalSnapshot(snapshot: TerminalSessionSnapshot): string {
|
|
21
|
+
const truncation = terminalOutputTail(snapshot.output);
|
|
22
|
+
const metadata = [
|
|
23
|
+
`session: ${snapshot.source}`,
|
|
24
|
+
`status: ${snapshot.status}`,
|
|
25
|
+
`shell: ${snapshot.shell}`,
|
|
26
|
+
`cwd: ${snapshot.cwd}`,
|
|
27
|
+
`elapsedMs: ${snapshot.elapsedMs}`,
|
|
28
|
+
snapshot.exitCode === undefined ? undefined : `exitCode: ${snapshot.exitCode}`,
|
|
29
|
+
snapshot.signal === undefined ? undefined : `signal: ${snapshot.signal}`,
|
|
30
|
+
snapshot.error === undefined ? undefined : `error: ${snapshot.error}`,
|
|
31
|
+
snapshot.waitReason === undefined ? undefined : `reason: ${snapshot.waitReason}`,
|
|
32
|
+
snapshot.completionReason === undefined
|
|
33
|
+
? undefined
|
|
34
|
+
: `completionReason: ${snapshot.completionReason}`,
|
|
35
|
+
snapshot.waitReason === undefined
|
|
36
|
+
? undefined
|
|
37
|
+
: `next: Read ${snapshot.source} to inspect it, then use write or insert to send input.`,
|
|
38
|
+
`outputRange: ${snapshot.outputStart}-${snapshot.outputEnd}`,
|
|
39
|
+
snapshot.truncated ? "retainedOutput: earlier data omitted from memory" : undefined,
|
|
40
|
+
truncation.truncated ? `fullOutput: ${snapshot.fullOutputPath}` : undefined,
|
|
41
|
+
].filter((line): line is string => line !== undefined);
|
|
42
|
+
const output = truncation.content.trimEnd();
|
|
43
|
+
if (!truncation.truncated) {
|
|
44
|
+
return `${metadata.join("\n")}\noutput:${output.length === 0 ? " (empty)" : `\n${output}`}`;
|
|
45
|
+
}
|
|
46
|
+
const limit =
|
|
47
|
+
truncation.truncatedBy === "lines"
|
|
48
|
+
? `${DEFAULT_MAX_LINES} line output budget`
|
|
49
|
+
: `${formatSize(DEFAULT_MAX_BYTES)} output budget`;
|
|
50
|
+
const notice = `[Earlier output omitted: showing the last ${truncation.outputLines} of ${truncation.totalLines} lines (${limit}). Full output: ${snapshot.fullOutputPath}]`;
|
|
51
|
+
return `${metadata.join("\n")}\noutput:\n${notice}${output.length === 0 ? "" : `\n${output}`}`;
|
|
52
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AgentIdeProcessProvider } from "#src/plugins/pi-agent-ide-processes/src/registry.js";
|
|
2
|
+
import {
|
|
3
|
+
renderActiveTerminal,
|
|
4
|
+
renderTerminalResult,
|
|
5
|
+
} from "#src/plugins/pi-agent-ide-terminal/src/renderer.js";
|
|
6
|
+
import type { TerminalSessionManager } from "#src/plugins/pi-agent-ide-terminal/src/session-manager.js";
|
|
7
|
+
|
|
8
|
+
/** Expose active PTY sessions through the shared Agent IDE process registry. */
|
|
9
|
+
export function terminalProcessProvider(manager: TerminalSessionManager): AgentIdeProcessProvider {
|
|
10
|
+
return {
|
|
11
|
+
id: "terminal",
|
|
12
|
+
onDidChange: (listener) => manager.onDidChange(listener),
|
|
13
|
+
list: () =>
|
|
14
|
+
manager
|
|
15
|
+
.list()
|
|
16
|
+
.filter((session) => session.status === "running" || session.status === "stopping")
|
|
17
|
+
.map((snapshot) => {
|
|
18
|
+
return {
|
|
19
|
+
source: snapshot.source,
|
|
20
|
+
kind: "terminal",
|
|
21
|
+
title: snapshot.shell.toLocaleLowerCase(),
|
|
22
|
+
description: snapshot.command,
|
|
23
|
+
status: snapshot.status === "stopping" ? ("stopping" as const) : ("running" as const),
|
|
24
|
+
renderSummary: (theme) => renderActiveTerminal(snapshot, theme).split("\n"),
|
|
25
|
+
renderDetail: (theme) => renderTerminalResult(snapshot, true, theme),
|
|
26
|
+
stop: () => manager.delete(snapshot.source),
|
|
27
|
+
};
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
30
|
+
}
|