pi-agent-ide 0.7.3 → 0.8.1
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 +48 -35
- package/README.md +70 -19
- package/dist/chunk-246NTPOS.js +1 -0
- package/dist/chunk-2ITKAXHO.js +1 -0
- package/dist/chunk-3WO2NOEQ.js +1 -0
- package/dist/{chunk-ZTYWHL2F.js → chunk-47SPPIXK.js} +1 -1
- package/dist/chunk-4HWKBCBH.js +1 -0
- package/dist/chunk-4W7GH3T7.js +10 -0
- package/dist/{chunk-JMVDFOTQ.js → chunk-57F5GTHO.js} +1 -1
- package/dist/chunk-6EDOLYOV.js +1 -0
- package/dist/chunk-756K3LJY.js +1 -0
- package/dist/chunk-7LOVUWNI.js +1 -0
- package/dist/chunk-A64JRDZK.js +1 -0
- package/dist/chunk-AIT3YWR5.js +3 -0
- package/dist/chunk-AKNHSDGV.js +1 -0
- package/dist/chunk-AUL5FGGK.js +2 -0
- package/dist/chunk-BB4A5UI3.js +5 -0
- package/dist/chunk-BQAKA3FU.js +1 -0
- package/dist/chunk-BR7GRH4A.js +5 -0
- package/dist/chunk-BXGMMZT3.js +1 -0
- package/dist/{chunk-ZIWPKIBZ.js → chunk-D4IA2MTA.js} +1 -1
- package/dist/chunk-DUUOCBS3.js +3 -0
- package/dist/chunk-DXONCYWF.js +3 -0
- package/dist/chunk-E2PHA4SQ.js +1 -0
- package/dist/{chunk-H445SHSJ.js → chunk-EMRJP6EM.js} +1 -1
- package/dist/chunk-GEMDU6XW.js +1 -0
- package/dist/chunk-GNACBJM3.js +1 -0
- package/dist/chunk-HCK7OIQ3.js +1 -0
- package/dist/chunk-HFJGCYFO.js +11 -0
- package/dist/chunk-ID4RJIVZ.js +9 -0
- package/dist/chunk-IMGIDBCC.js +1 -0
- package/dist/chunk-JKMXND6V.js +1 -0
- package/dist/chunk-L2B4DTVS.js +1 -0
- package/dist/chunk-LAJQSHEI.js +4 -0
- package/dist/chunk-LEKC4GQK.js +5 -0
- package/dist/chunk-LLRUJD62.js +1 -0
- package/dist/{chunk-2ZMMRINH.js → chunk-M4TVRCMZ.js} +1 -1
- package/dist/chunk-MKEC3U2M.js +4 -0
- package/dist/chunk-N56WAVYA.js +1 -0
- package/dist/chunk-OFILFO6D.js +1 -0
- package/dist/chunk-OI3HBIPK.js +2 -0
- package/dist/{chunk-S6QRG3TQ.js → chunk-OM4LYD3S.js} +1 -1
- package/dist/{chunk-WLZIUMJL.js → chunk-PRLIHLCS.js} +1 -1
- package/dist/chunk-Q5X6OXNS.js +2 -0
- package/dist/chunk-R2U5WXYR.js +1 -0
- package/dist/chunk-S72FVLUX.js +1 -0
- package/dist/chunk-SWA5B5B2.js +9 -0
- package/dist/chunk-T4FTT3U4.js +1 -0
- package/dist/chunk-T7MWQQIF.js +3 -0
- package/dist/chunk-TGC2ZACO.js +1 -0
- package/dist/chunk-TOYN4W4F.js +1 -0
- package/dist/chunk-TXG2H7YQ.js +9 -0
- package/dist/{chunk-QFTBY67N.js → chunk-UEVGZUII.js} +3 -3
- package/dist/{chunk-7UGNGK7Y.js → chunk-VAXLSPPU.js} +1 -1
- package/dist/chunk-VDP5CQHM.js +3 -0
- package/dist/chunk-VMGZMXEM.js +10 -0
- package/dist/chunk-VNTY7BKC.js +1 -0
- package/dist/chunk-W3YFF6OO.js +1 -0
- package/dist/chunk-W7M3V7FR.js +28 -0
- package/dist/chunk-WMHSVEIT.js +29 -0
- package/dist/chunk-WPBQ45ZL.js +1 -0
- package/dist/chunk-WXGTU2M6.js +1 -0
- package/dist/chunk-XSIKDVAR.js +25 -0
- package/dist/chunk-YHREORHH.js +2 -0
- package/dist/chunk-YJ6T3PEP.js +1 -0
- package/dist/chunk-YTYLS2UM.js +1 -0
- package/dist/chunk-Z2QGNTGQ.js +1 -0
- package/dist/{chunk-QDLTO5PH.js → chunk-ZAWRSA7N.js} +1 -1
- package/dist/chunk-ZV5ETNLQ.js +1 -0
- 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-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-2.js +1 -1
- package/dist/entry-20.js +1 -1
- package/dist/entry-21.js +1 -1
- package/dist/entry-22.js +1 -1
- package/dist/entry-23.js +1 -1
- package/dist/entry-24.js +1 -1
- package/dist/entry-25.js +1 -2
- package/dist/entry-26.js +1 -1
- package/dist/entry-27.js +2 -2
- package/dist/entry-28.js +1 -1
- package/dist/entry-29.js +4 -1
- package/dist/entry-30.js +1 -1
- package/dist/entry-31.js +1 -17
- package/dist/entry-32.js +1 -1
- package/dist/entry-33.js +18 -3
- package/dist/entry-34.js +1 -1
- package/dist/entry-35.js +1 -1
- package/dist/entry-36.js +1 -4
- package/dist/entry-37.js +1 -9
- 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 -25
- package/dist/entry-46.js +1 -1
- package/dist/entry-47.js +25 -1
- package/dist/entry-48.js +1 -1
- package/dist/entry-49.js +1 -1
- package/dist/entry-50.js +1 -3
- package/dist/entry-51.js +1 -13
- package/dist/entry-52.js +3 -1
- package/dist/entry-53.js +13 -1
- package/dist/entry-54.js +1 -1
- package/dist/entry-55.js +1 -1
- package/dist/entry-56.js +1 -1
- package/dist/entry-57.js +1 -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 -0
- package/dist/entry-62.js +1 -1
- package/dist/entry-64.js +1 -1
- package/dist/entry-65.js +0 -1
- package/dist/entry-66.js +1 -1
- package/dist/entry-67.js +1 -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 -0
- package/dist/entry-72.js +1 -1
- package/dist/entry-74.js +1 -1
- package/dist/entry-75.js +0 -1
- package/dist/entry-76.js +1 -1
- package/dist/entry-77.js +1 -80
- package/dist/entry-78.js +1 -19
- package/dist/entry-79.js +80 -2
- package/dist/entry-8.js +1 -1
- package/dist/entry-80.js +22 -1
- package/dist/entry-81.js +2 -1
- package/dist/entry-82.js +1 -5
- package/dist/entry-83.js +1 -3
- package/dist/entry-84.js +1 -1
- package/dist/entry-85.js +3 -1
- package/dist/entry-86.js +1 -1
- package/dist/entry-87.js +1 -0
- package/dist/entry-88.js +1 -0
- package/dist/pi-agent-ide.js +53 -24
- package/docs/agent-guides/debugger.md +2 -0
- package/docs/agent-guides/editing.md +1 -1
- package/docs/agent-guides/search-code.md +7 -2
- package/docs/agent-guides/ssh.md +58 -0
- package/docs/agent-guides/vision.md +6 -0
- package/docs/configuration.md +51 -5
- package/docs/development.md +1 -13
- package/docs/extensions.md +1 -1
- package/docs/releases.md +1 -1
- package/docs/settings-help.md +39 -0
- package/docs/tools.md +22 -14
- package/docs/user-hooks.md +7 -3
- package/node_modules/pi-agent-doctor/package.json +10 -9
- package/node_modules/pi-agent-doctor/runtime/entry-25.js +1 -0
- package/node_modules/pi-agent-doctor/src/evidence.ts +49 -4
- package/node_modules/pi-agent-doctor/src/executable.ts +46 -16
- package/node_modules/pi-agent-doctor/src/fixtures/executable-probe.ts +78 -0
- package/node_modules/pi-agent-doctor/src/fixtures/probe-executable-wait.mjs +10 -0
- package/node_modules/pi-agent-doctor/src/plugin-protocol.ts +6 -0
- package/node_modules/pi-agent-doctor/src/project-probes.ts +73 -0
- package/node_modules/pi-agent-doctor/src/workspace.ts +106 -0
- package/node_modules/pi-agent-documentation/package.json +2 -2
- package/node_modules/pi-agent-documentation/runtime/entry-26.js +1 -0
- package/node_modules/pi-agent-filesystem/package.json +8 -8
- package/node_modules/pi-agent-filesystem/src/resolver.ts +23 -7
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- package/node_modules/pi-agent-filesystem-jq/index.ts +33 -6
- package/node_modules/pi-agent-filesystem-jq/package.json +6 -7
- package/node_modules/pi-agent-filesystem-jq/src/jq.ts +67 -0
- package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
- package/node_modules/pi-agent-filesystem-pdf/runtime/entry-30.js +2 -0
- package/node_modules/pi-agent-filesystem-text/package.json +4 -4
- package/node_modules/pi-agent-ide-ast/package.json +15 -41
- package/node_modules/pi-agent-ide-ast/src/ast/manager.ts +2 -1
- package/node_modules/pi-agent-ide-ast/src/ast/outline.ts +10 -3
- package/node_modules/pi-agent-ide-ast/src/ast/read-text.ts +4 -1
- package/node_modules/pi-agent-ide-ast/src/ast/selection.ts +3 -3
- package/node_modules/pi-agent-ide-ast/src/doctor-plugin.ts +13 -10
- package/node_modules/pi-agent-ide-ast/src/extension.ts +17 -1
- package/node_modules/pi-agent-ide-ast/src/outline-resolver.ts +32 -4
- package/node_modules/pi-agent-ide-ast/src/overflow-handler.ts +2 -2
- package/node_modules/pi-agent-ide-ast/src/scope-handler.ts +1 -1
- package/node_modules/pi-agent-ide-ast/src/search-presentation.ts +4 -3
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +100 -42
- package/node_modules/pi-agent-ide-ast/src/select-presentation.ts +3 -2
- package/node_modules/pi-agent-ide-ast/src/tool-select.ts +2 -1
- package/node_modules/pi-agent-ide-changes/index.ts +10 -2
- package/node_modules/pi-agent-ide-changes/package.json +10 -11
- package/node_modules/pi-agent-ide-changes/runtime/entry-34.js +1 -0
- package/node_modules/pi-agent-ide-changes/src/change-anchor.ts +7 -2
- package/node_modules/pi-agent-ide-changes/src/changes/change-service.ts +18 -1
- package/node_modules/pi-agent-ide-changes/src/changes/change-types.ts +3 -0
- package/node_modules/pi-agent-ide-changes/src/changes/git-changes-backend.ts +59 -7
- package/node_modules/pi-agent-ide-changes/src/changes/git-paths.ts +49 -0
- package/node_modules/pi-agent-ide-changes/src/current-change-presenter.ts +10 -2
- package/node_modules/pi-agent-ide-changes/src/doctor-plugin.ts +13 -14
- package/node_modules/pi-agent-ide-changes/src/last-text-transaction-store.ts +2 -1
- package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +47 -11
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +6 -1
- package/node_modules/pi-agent-ide-formatter/index.ts +14 -2
- package/node_modules/pi-agent-ide-formatter/package.json +4 -4
- package/node_modules/pi-agent-ide-formatter/src/doctor-plugin.ts +47 -35
- package/node_modules/pi-agent-ide-formatter/src/formatter.ts +41 -11
- package/node_modules/pi-agent-ide-formatter/src/registry.ts +9 -28
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-lint/index.ts +35 -4
- package/node_modules/pi-agent-ide-lint/package.json +8 -8
- package/node_modules/pi-agent-ide-lint/runtime/entry-38.js +2 -0
- package/node_modules/pi-agent-ide-lint/src/command-linter.ts +14 -10
- package/node_modules/pi-agent-ide-lint/src/doctor-plugin.ts +47 -39
- package/node_modules/pi-agent-ide-lint/src/registry.ts +9 -25
- package/node_modules/pi-agent-ide-lsp/index.ts +107 -25
- package/node_modules/pi-agent-ide-lsp/package.json +10 -13
- package/node_modules/pi-agent-ide-lsp/runtime/entry-39.js +2 -0
- package/node_modules/pi-agent-ide-lsp/src/code-view-resolvers.ts +6 -2
- package/node_modules/pi-agent-ide-lsp/src/declaration-targets.ts +5 -1
- package/node_modules/pi-agent-ide-lsp/src/diagnostic-source.ts +5 -3
- package/node_modules/pi-agent-ide-lsp/src/doctor-plugin.ts +27 -11
- package/node_modules/pi-agent-ide-lsp/src/lsp/abort.ts +62 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +245 -103
- package/node_modules/pi-agent-ide-lsp/src/lsp/code-views.ts +26 -45
- package/node_modules/pi-agent-ide-lsp/src/lsp/diagnostic-adapters.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/src/lsp/document-uri.ts +40 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/file-watchers.ts +8 -1
- package/node_modules/pi-agent-ide-lsp/src/lsp/lsp-compiler.ts +24 -17
- package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +255 -56
- package/node_modules/pi-agent-ide-lsp/src/lsp/navigation.ts +51 -11
- package/node_modules/pi-agent-ide-lsp/src/lsp/owner-transport.ts +67 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/registry.ts +149 -18
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +79 -31
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbols.ts +15 -12
- package/node_modules/pi-agent-ide-lsp/src/lsp/workspace-owner.ts +16 -0
- package/node_modules/pi-agent-ide-lsp/src/rename-plan.ts +67 -46
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +50 -19
- 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-45.js +0 -1
- package/node_modules/pi-agent-read/runtime/entry-47.js +2 -0
- package/node_modules/pi-agent-read/src/api/tools/read.ts +4 -2
- package/node_modules/pi-agent-read/src/core/extension.ts +4 -1
- package/node_modules/pi-agent-read/src/core/tools/read/raw-read.ts +143 -69
- package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +25 -1
- package/node_modules/pi-agent-read/src/core/tools/read/result-target.ts +67 -44
- package/node_modules/pi-agent-read/src/core/tools/read/structured-result.ts +8 -3
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +20 -5
- package/node_modules/pi-agent-resource/package.json +2 -2
- package/node_modules/pi-agent-resource/src/content-conversion/content-host.ts +75 -16
- package/node_modules/pi-agent-resource/src/index.ts +3 -0
- package/node_modules/pi-agent-resource/src/resource-error.ts +17 -0
- package/node_modules/pi-agent-resource/src/resource.ts +23 -0
- package/node_modules/pi-agent-resource/src/result-targets.ts +25 -2
- package/node_modules/pi-agent-resource/src/validation.ts +2 -1
- package/node_modules/pi-agent-search/package.json +9 -9
- package/node_modules/pi-agent-search/runtime/entry-50.js +0 -1
- package/node_modules/pi-agent-search/runtime/entry-51.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-52.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 +7 -3
- package/node_modules/pi-agent-search/src/api/search.ts +51 -2
- package/node_modules/pi-agent-search/src/core/extension.ts +2 -3
- package/node_modules/pi-agent-search/src/core/search-core.ts +98 -8
- package/node_modules/pi-agent-search-text/index.ts +37 -1
- package/node_modules/pi-agent-search-text/package.json +14 -12
- package/node_modules/pi-agent-search-text/runtime/entry-53.js +1 -0
- package/node_modules/pi-agent-search-text/runtime/entry-56.js +1 -0
- package/node_modules/pi-agent-search-text/src/doctor-plugin.ts +10 -5
- package/node_modules/pi-agent-search-text/src/file-search.ts +26 -3
- package/node_modules/pi-agent-search-text/src/fuzzy-search.ts +54 -3
- package/node_modules/pi-agent-search-text/src/resolvers.ts +22 -5
- package/node_modules/pi-agent-search-text/src/scoped-search.ts +4 -5
- package/node_modules/pi-agent-search-text/src/search-backend.ts +123 -17
- package/node_modules/pi-agent-search-text/src/search-recipe.ts +5 -1
- package/node_modules/pi-agent-search-text/src/search-result.ts +1 -0
- package/node_modules/pi-agent-search-text/src/search-session.ts +166 -31
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text/src/text-document.ts +2 -0
- package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
- package/node_modules/pi-agent-text-anchor-exact/package.json +5 -6
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-62.js +2 -0
- package/node_modules/pi-agent-text-anchor-line-hash/src/read-handler.ts +3 -1
- package/node_modules/pi-agent-text-editor/package.json +26 -34
- package/node_modules/pi-agent-text-editor/runtime/entry-77.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-78.js +1 -0
- package/node_modules/pi-agent-text-editor/src/api/delete-guard.ts +29 -2
- package/node_modules/pi-agent-text-editor/src/api/edit-completion.ts +3 -0
- package/node_modules/pi-agent-text-editor/src/api/file-operations.ts +55 -0
- package/node_modules/pi-agent-text-editor/src/api/file-transfers.ts +41 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-guard.ts +2 -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/api/native-files.ts +127 -0
- package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +20 -1
- package/node_modules/pi-agent-text-editor/src/api/post-edit.ts +1 -0
- package/node_modules/pi-agent-text-editor/src/core/delete-policy.ts +93 -85
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +15 -2
- package/node_modules/pi-agent-text-editor/src/core/file-operation-guards.ts +81 -0
- package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +70 -25
- package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +123 -27
- package/node_modules/pi-agent-text-editor/src/core/file-result-targets.ts +30 -1
- package/node_modules/pi-agent-text-editor/src/core/file-transfers.ts +147 -105
- 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/mutation-result-targets.ts +91 -14
- package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +74 -9
- package/node_modules/pi-agent-text-editor/src/core/temporary-directories.ts +49 -25
- 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 +122 -39
- 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-editor-core.ts +307 -32
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +85 -31
- 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/write-agent-result.ts +4 -1
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -8
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-80.js +2 -0
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +139 -27
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-81.js +2 -0
- package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-82.js +1 -0
- package/node_modules/pi-agent-tool-ui/package.json +2 -2
- package/node_modules/pi-agent-tool-ui/runtime/entry-83.js +1 -0
- package/node_modules/pi-agent-web/index.ts +28 -4
- package/node_modules/pi-agent-web/package.json +8 -11
- package/node_modules/pi-agent-web/src/doctor-plugin.ts +21 -6
- package/node_modules/pi-agent-web/src/resolver.ts +12 -2
- package/node_modules/pi-agent-web/src/search.ts +2 -1
- package/node_modules/pi-agent-web-html/package.json +3 -5
- 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-pdf/runtime/entry-87.js +2 -0
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-88.js +2 -0
- package/package.json +43 -39
- package/skills/configure-agent-ide/SKILL.md +38 -0
- package/src/api/content.ts +6 -0
- package/src/api/doctor-runtime.ts +80 -0
- package/src/api/doctor.ts +6 -0
- package/src/api/hooks.ts +3 -0
- package/src/api/plugin-protocol.ts +11 -1
- package/src/api/tips.ts +3 -0
- package/src/api/tool-config.ts +143 -24
- package/src/backend/config.ts +85 -0
- package/src/backend/configured-process.ts +59 -0
- package/src/backend/dap-java-transport.ts +112 -0
- package/src/backend/dap-java-worker.py +218 -0
- package/src/backend/dap-node-transport.ts +112 -0
- package/src/backend/dap-powershell-worker.py +44 -0
- package/src/backend/dap-r-worker.py +210 -0
- package/src/backend/dap-tcp-transport.ts +42 -0
- package/src/backend/dap-tcp-worker.py +125 -0
- package/src/backend/dap-transport.ts +69 -0
- package/src/backend/dap-unix-worker.py +63 -0
- package/src/backend/debugger-registration.ts +62 -0
- package/src/backend/debugger-workspace-owner.ts +413 -0
- package/src/backend/doctor-inventory-worker.py +54 -0
- package/src/backend/doctor-probe-worker.py +140 -0
- package/src/backend/doctor-registration.ts +18 -0
- package/src/backend/doctor-workspace.ts +381 -0
- package/src/backend/file-operation-resolver.ts +58 -0
- package/src/backend/file-revision.ts +13 -0
- package/src/backend/file-transfer.ts +302 -0
- package/src/backend/file-watch-worker.py +119 -0
- package/src/backend/formatter-registration.ts +114 -0
- package/src/backend/git-registration.ts +60 -0
- package/src/backend/identity.ts +47 -0
- package/src/backend/index.ts +12 -0
- package/src/backend/lint-registration.ts +102 -0
- package/src/backend/lsp-file-watchers.ts +220 -0
- package/src/backend/lsp-registration.ts +83 -0
- package/src/backend/lsp-transport.ts +87 -0
- package/src/backend/lsp-workspace-owner.ts +50 -0
- package/src/backend/object-transfer.ts +299 -0
- package/src/backend/owned-command.ts +105 -0
- package/src/backend/owned-process-stop.ts +36 -0
- package/src/backend/owned-read-command.ts +20 -0
- package/src/backend/process-environment.ts +77 -0
- package/src/backend/process-metadata-worker.py +98 -0
- package/src/backend/process-metadata.ts +99 -0
- package/src/backend/recipe-evidence-worker.py +26 -0
- package/src/backend/recipe-evidence.ts +77 -0
- package/src/backend/registration.ts +124 -0
- package/src/backend/registry.ts +29 -0
- package/src/backend/resource-resolver.ts +147 -0
- package/src/backend/search-environment.ts +100 -0
- package/src/backend/ssh-channel-worker.py +306 -0
- package/src/backend/ssh-channel.ts +376 -0
- package/src/backend/ssh-transfer-worker.py +99 -0
- package/src/backend/ssh-transport.ts +54 -0
- package/src/backend/ssh-worker.py +730 -0
- package/src/backend/ssh.ts +610 -0
- package/src/backend/tool-config-access.ts +63 -0
- package/src/backend/tool-project.ts +71 -0
- package/src/backend/vision-capture-worker.py +319 -0
- package/src/backend/vision-capture.ts +165 -0
- package/src/backend/vision-registration.ts +104 -0
- package/src/backend/web-browser-worker.mjs +182 -0
- package/src/backend/web-browser.ts +128 -0
- package/src/backend/web-http-worker.py +62 -0
- package/src/backend/web-http.ts +79 -0
- package/src/backend/web-owner.ts +68 -0
- package/src/backend/web-registration.ts +14 -0
- package/src/code-view/diagnostic-view.ts +2 -2
- package/src/code-view/reference.ts +9 -0
- package/src/composite/builtin-extensions.ts +9 -14
- package/src/composite/module-labels.ts +1 -0
- package/src/composite/nested-tool-rendering.ts +26 -6
- package/src/composite/preferences.ts +13 -0
- package/src/composite/settings-documentation.ts +59 -0
- package/src/composite/settings-help.ts +106 -0
- package/src/composite/text-results.ts +50 -22
- package/src/core/diagnostic-store.ts +32 -10
- package/src/core/ide-core.ts +22 -2
- package/src/doctor/arguments.ts +19 -0
- package/src/doctor/config-writer.ts +72 -29
- package/src/doctor/discovery.ts +53 -15
- package/src/doctor/extension.ts +27 -10
- package/src/doctor/run.ts +42 -7
- package/src/documentation/extension.ts +12 -0
- 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/index.ts +33 -6
- 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/src/jq.ts +67 -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-30.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-31.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-27.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/src/resolver.ts +23 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +28 -4
- 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-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-pdf/runtime/entry-87.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-88.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-84.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/doctor-plugin.ts +21 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/resolver.ts +12 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/search.ts +2 -1
- package/src/extensions/pi-agent-read/package.json +12 -12
- package/src/extensions/pi-agent-read/runtime/entry-45.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-46.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-47.js +2 -0
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +4 -2
- package/src/extensions/pi-agent-read/src/core/extension.ts +4 -1
- package/src/extensions/pi-agent-read/src/core/tools/read/raw-read.ts +143 -69
- package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +25 -1
- package/src/extensions/pi-agent-read/src/core/tools/read/result-target.ts +67 -44
- package/src/extensions/pi-agent-read/src/core/tools/read/structured-result.ts +8 -3
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +20 -5
- package/src/extensions/pi-agent-search/package.json +9 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +37 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +14 -12
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-53.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/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/src/doctor-plugin.ts +10 -5
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/file-search.ts +26 -3
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/fuzzy-search.ts +54 -3
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +22 -5
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/scoped-search.ts +4 -5
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +123 -17
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +5 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +166 -31
- package/src/extensions/pi-agent-search/runtime/entry-50.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-51.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-52.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 +7 -3
- package/src/extensions/pi-agent-search/src/api/search.ts +51 -2
- package/src/extensions/pi-agent-search/src/core/extension.ts +2 -3
- package/src/extensions/pi-agent-search/src/core/search-core.ts +98 -8
- 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-exact/package.json +5 -6
- 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-61.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-62.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/read-handler.ts +3 -1
- 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-80.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +139 -27
- 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-81.js +2 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-77.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-78.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-79.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/delete-guard.ts +29 -2
- package/src/extensions/pi-agent-text-editor/src/api/edit-completion.ts +3 -0
- package/src/extensions/pi-agent-text-editor/src/api/file-operations.ts +55 -0
- package/src/extensions/pi-agent-text-editor/src/api/file-transfers.ts +41 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-guard.ts +2 -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/api/native-files.ts +127 -0
- package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +20 -1
- package/src/extensions/pi-agent-text-editor/src/api/post-edit.ts +1 -0
- package/src/extensions/pi-agent-text-editor/src/core/delete-policy.ts +93 -85
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +15 -2
- package/src/extensions/pi-agent-text-editor/src/core/file-operation-guards.ts +81 -0
- package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +70 -25
- package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +123 -27
- package/src/extensions/pi-agent-text-editor/src/core/file-result-targets.ts +30 -1
- package/src/extensions/pi-agent-text-editor/src/core/file-transfers.ts +147 -105
- 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/mutation-result-targets.ts +91 -14
- package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +74 -9
- package/src/extensions/pi-agent-text-editor/src/core/temporary-directories.ts +49 -25
- 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 +122 -39
- 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-editor-core.ts +307 -32
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +85 -31
- 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/write-agent-result.ts +4 -1
- package/src/pi-agent-ide.ts +14 -2
- package/src/plugins/pi-agent-ide-ast/package.json +15 -41
- package/src/plugins/pi-agent-ide-ast/src/ast/manager.ts +2 -1
- package/src/plugins/pi-agent-ide-ast/src/ast/outline.ts +10 -3
- package/src/plugins/pi-agent-ide-ast/src/ast/read-text.ts +4 -1
- package/src/plugins/pi-agent-ide-ast/src/ast/selection.ts +3 -3
- package/src/plugins/pi-agent-ide-ast/src/doctor-plugin.ts +13 -10
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +17 -1
- package/src/plugins/pi-agent-ide-ast/src/outline-resolver.ts +32 -4
- package/src/plugins/pi-agent-ide-ast/src/overflow-handler.ts +2 -2
- package/src/plugins/pi-agent-ide-ast/src/scope-handler.ts +1 -1
- package/src/plugins/pi-agent-ide-ast/src/search-presentation.ts +4 -3
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +100 -42
- package/src/plugins/pi-agent-ide-ast/src/select-presentation.ts +3 -2
- package/src/plugins/pi-agent-ide-ast/src/tool-select.ts +2 -1
- package/src/plugins/pi-agent-ide-changes/index.ts +10 -2
- package/src/plugins/pi-agent-ide-changes/package.json +10 -11
- package/src/plugins/pi-agent-ide-changes/runtime/entry-34.js +1 -0
- package/src/plugins/pi-agent-ide-changes/src/change-anchor.ts +7 -2
- package/src/plugins/pi-agent-ide-changes/src/changes/change-service.ts +18 -1
- package/src/plugins/pi-agent-ide-changes/src/changes/change-types.ts +3 -0
- package/src/plugins/pi-agent-ide-changes/src/changes/git-changes-backend.ts +59 -7
- package/src/plugins/pi-agent-ide-changes/src/changes/git-paths.ts +49 -0
- package/src/plugins/pi-agent-ide-changes/src/current-change-presenter.ts +10 -2
- package/src/plugins/pi-agent-ide-changes/src/doctor-plugin.ts +13 -14
- package/src/plugins/pi-agent-ide-changes/src/last-text-transaction-store.ts +2 -1
- package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +47 -11
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +6 -1
- package/src/plugins/pi-agent-ide-debugger/index.ts +62 -25
- package/src/plugins/pi-agent-ide-debugger/src/adapter-executables.ts +3 -1
- package/src/plugins/pi-agent-ide-debugger/src/dap-client.ts +33 -0
- package/src/plugins/pi-agent-ide-debugger/src/doctor-plugin.ts +150 -171
- package/src/plugins/pi-agent-ide-debugger/src/process-provider.ts +2 -0
- package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +152 -58
- package/src/plugins/pi-agent-ide-debugger/src/workspace-owner.ts +28 -0
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +4 -1
- package/src/plugins/pi-agent-ide-formatter/index.ts +14 -2
- package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
- package/src/plugins/pi-agent-ide-formatter/src/doctor-plugin.ts +47 -35
- package/src/plugins/pi-agent-ide-formatter/src/formatter.ts +41 -11
- package/src/plugins/pi-agent-ide-formatter/src/registry.ts +9 -28
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-lint/index.ts +35 -4
- package/src/plugins/pi-agent-ide-lint/package.json +8 -8
- package/src/plugins/pi-agent-ide-lint/runtime/entry-38.js +2 -0
- package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +14 -10
- package/src/plugins/pi-agent-ide-lint/src/doctor-plugin.ts +47 -39
- package/src/plugins/pi-agent-ide-lint/src/registry.ts +9 -25
- package/src/plugins/pi-agent-ide-lsp/index.ts +107 -25
- package/src/plugins/pi-agent-ide-lsp/package.json +10 -13
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-39.js +2 -0
- package/src/plugins/pi-agent-ide-lsp/src/code-view-resolvers.ts +6 -2
- package/src/plugins/pi-agent-ide-lsp/src/declaration-targets.ts +5 -1
- package/src/plugins/pi-agent-ide-lsp/src/diagnostic-source.ts +5 -3
- package/src/plugins/pi-agent-ide-lsp/src/doctor-plugin.ts +27 -11
- package/src/plugins/pi-agent-ide-lsp/src/lsp/abort.ts +62 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +245 -103
- package/src/plugins/pi-agent-ide-lsp/src/lsp/code-views.ts +26 -45
- package/src/plugins/pi-agent-ide-lsp/src/lsp/diagnostic-adapters.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/src/lsp/document-uri.ts +40 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/file-watchers.ts +8 -1
- package/src/plugins/pi-agent-ide-lsp/src/lsp/lsp-compiler.ts +24 -17
- package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +255 -56
- package/src/plugins/pi-agent-ide-lsp/src/lsp/navigation.ts +51 -11
- package/src/plugins/pi-agent-ide-lsp/src/lsp/owner-transport.ts +67 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/registry.ts +149 -18
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +79 -31
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbols.ts +15 -12
- package/src/plugins/pi-agent-ide-lsp/src/lsp/workspace-owner.ts +16 -0
- package/src/plugins/pi-agent-ide-lsp/src/rename-plan.ts +67 -46
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +50 -19
- package/src/plugins/pi-agent-ide-processes/src/registry.ts +8 -1
- package/src/plugins/pi-agent-ide-terminal/index.ts +7 -0
- package/src/plugins/pi-agent-ide-terminal/src/process-provider.ts +5 -1
- package/src/plugins/pi-agent-ide-terminal/src/resources.ts +5 -2
- package/src/plugins/pi-agent-ide-terminal/src/session-manager.ts +161 -42
- package/src/plugins/pi-agent-ide-terminal/src/shell-profile.ts +7 -0
- package/src/plugins/pi-agent-ide-terminal/src/shell-result.ts +11 -0
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +33 -8
- package/src/plugins/pi-agent-ide-terminal/src/types.ts +5 -0
- package/src/plugins/pi-agent-ide-vision/index.ts +170 -9
- package/src/plugins/pi-agent-ide-vision/src/doctor-plugin.ts +47 -0
- package/src/plugins/pi-agent-ide-vision/src/vision.ts +42 -1
- package/src/post-edit/gate.ts +4 -1
- 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/src/toolchain/types.ts +2 -0
- package/dist/chunk-3YK4XMWB.js +0 -0
- package/dist/chunk-5JELU6RV.js +0 -7
- package/dist/chunk-6U5OU77O.js +0 -3
- package/dist/chunk-7LD2OQH3.js +0 -14
- package/dist/chunk-BMOJTJJJ.js +0 -3
- package/dist/chunk-BYZSBXUK.js +0 -2
- package/dist/chunk-CEX73RI5.js +0 -28
- package/dist/chunk-DZWTKF2K.js +0 -1
- package/dist/chunk-EOKEQ3YH.js +0 -25
- package/dist/chunk-HZ5BNF3A.js +0 -1
- package/dist/chunk-IG56UGSO.js +0 -2
- package/dist/chunk-KVHDMIZS.js +0 -3
- package/dist/chunk-M5IVSCR2.js +0 -1
- package/dist/chunk-M5MJP7Z2.js +0 -1
- package/dist/chunk-MGCHOGQD.js +0 -1
- package/dist/chunk-N34ATN52.js +0 -1
- package/dist/chunk-NHKPP2AI.js +0 -28
- package/dist/chunk-NRZO5KJT.js +0 -9
- package/dist/chunk-OB46OPMZ.js +0 -1
- package/dist/chunk-Q6CZ6GBR.js +0 -3
- package/dist/chunk-QIK2E64R.js +0 -1
- package/dist/chunk-SBP3ABH4.js +0 -5
- package/dist/chunk-STBJO3Z3.js +0 -2
- package/dist/chunk-T6LX2RX5.js +0 -1
- package/dist/chunk-TXOTNK6B.js +0 -11
- package/dist/chunk-WZI4YC2O.js +0 -1
- package/dist/entry-19.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-filesystem/runtime/entry-25.js +0 -2
- package/node_modules/pi-agent-filesystem-image/runtime/entry-26.js +0 -2
- package/node_modules/pi-agent-ide-ast/runtime/entry-30.js +0 -1
- package/node_modules/pi-agent-ide-formatter/runtime/entry-34.js +0 -2
- package/node_modules/pi-agent-image/runtime/entry-38.js +0 -1
- package/node_modules/pi-agent-invariant/runtime/entry-39.js +0 -1
- package/node_modules/pi-agent-search/runtime/entry-47.js +0 -1
- package/node_modules/pi-agent-search-text/runtime/entry-51.js +0 -2
- package/node_modules/pi-agent-search-text/runtime/entry-52.js +0 -1
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-56.js +0 -2
- package/node_modules/pi-agent-text-editor/runtime/entry-62.js +0 -1
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-78.js +0 -2
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-80.js +0 -1
- package/node_modules/pi-agent-tool-ui/runtime/entry-81.js +0 -1
- package/node_modules/pi-agent-web/runtime/entry-82.js +0 -2
- package/node_modules/pi-agent-web-html/runtime/entry-83.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-26.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-27.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-25.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-83.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-84.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-82.js +0 -2
- package/src/extensions/pi-agent-read/runtime/entry-41.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-42.js +0 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-51.js +0 -2
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-52.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-47.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-48.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-56.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-57.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-78.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-79.js +0 -2
- package/src/extensions/pi-agent-text-editor/runtime/entry-61.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-62.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-30.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-31.js +0 -2
- package/src/plugins/pi-agent-ide-formatter/runtime/entry-34.js +0 -2
- /package/node_modules/{pi-agent-documentation → pi-agent-doctor}/runtime/entry-24.js +0 -0
- /package/node_modules/{pi-agent-filesystem-jq → pi-agent-filesystem}/runtime/entry-27.js +0 -0
- /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-28.js +0 -0
- /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-jq}/runtime/entry-29.js +0 -0
- /package/node_modules/{pi-agent-ide-ast → pi-agent-filesystem-text}/runtime/entry-31.js +0 -0
- /package/node_modules/{pi-agent-ide-changes → pi-agent-ide-ast}/runtime/entry-32.js +0 -0
- /package/node_modules/{pi-agent-ide-changes → pi-agent-ide-ast}/runtime/entry-33.js +0 -0
- /package/node_modules/{pi-agent-ide-languages → pi-agent-ide-changes}/runtime/entry-35.js +0 -0
- /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-formatter}/runtime/entry-36.js +0 -0
- /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-languages}/runtime/entry-37.js +0 -0
- /package/node_modules/{pi-agent-pdf → pi-agent-image}/runtime/entry-40.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-invariant}/runtime/entry-41.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-42.js +0 -0
- /package/node_modules/{pi-agent-resource → pi-agent-read}/runtime/entry-46.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-48.js +0 -0
- /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-55.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-exact → pi-agent-text}/runtime/entry-57.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-exact → pi-agent-text-anchor-constant}/runtime/entry-58.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-exact}/runtime/entry-59.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-exact}/runtime/entry-60.js +0 -0
- /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-line-hash}/runtime/entry-61.js +0 -0
- /package/node_modules/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor}/runtime/entry-79.js +0 -0
- /package/node_modules/{pi-agent-web-image → pi-agent-web}/runtime/entry-84.js +0 -0
- /package/node_modules/{pi-agent-web-pdf → pi-agent-web-html}/runtime/entry-85.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web-image}/runtime/entry-86.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-28.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-jq}/runtime/entry-29.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-pdf → pi-agent-web-html}/runtime/entry-85.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-image}/runtime/entry-86.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-anchor-exact → pi-agent-text-anchor-constant}/runtime/entry-58.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-exact}/runtime/entry-59.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-exact}/runtime/entry-60.js +0 -0
- /package/src/plugins/{pi-agent-ide-changes → pi-agent-ide-ast}/runtime/entry-32.js +0 -0
- /package/src/plugins/{pi-agent-ide-changes → pi-agent-ide-ast}/runtime/entry-33.js +0 -0
- /package/src/plugins/{pi-agent-ide-languages → pi-agent-ide-changes}/runtime/entry-35.js +0 -0
- /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-formatter}/runtime/entry-36.js +0 -0
- /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-languages}/runtime/entry-37.js +0 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import type { ToolRecipe } from "pi-agent-doctor/api/catalog";
|
|
3
|
+
import { recipeMatchesFile, type ToolConfigName } from "#src/api/tool-config.js";
|
|
4
|
+
import type { SshBackend } from "./ssh.js";
|
|
5
|
+
import { SshBackendError } from "./ssh.js";
|
|
6
|
+
import { remoteLocation } from "./identity.js";
|
|
7
|
+
import { inspectSshRecipeEvidence } from "./recipe-evidence.js";
|
|
8
|
+
|
|
9
|
+
/** Resolve an SSH file or directory's native project; an explicit current project keeps its context. */
|
|
10
|
+
export async function resolveSshToolProject(
|
|
11
|
+
backend: SshBackend,
|
|
12
|
+
filePath: string,
|
|
13
|
+
currentRoot: string | undefined,
|
|
14
|
+
name: ToolConfigName,
|
|
15
|
+
recipes: readonly ToolRecipe[],
|
|
16
|
+
signal?: AbortSignal,
|
|
17
|
+
): Promise<{ cwd: string; external: boolean } | undefined> {
|
|
18
|
+
signal?.throwIfAborted();
|
|
19
|
+
const file = remoteLocation(backend.target.id, filePath).path;
|
|
20
|
+
if (currentRoot && inside(currentRoot, file))
|
|
21
|
+
return { cwd: remoteLocation(backend.target.id, currentRoot).source, external: false };
|
|
22
|
+
let selectedDirectory = false;
|
|
23
|
+
try {
|
|
24
|
+
selectedDirectory = (await backend.stat(file, { signal })).kind === "directory";
|
|
25
|
+
} catch (error) {
|
|
26
|
+
if (!(error instanceof SshBackendError) || error.code !== "ENOENT") throw error;
|
|
27
|
+
}
|
|
28
|
+
const relevant = selectedDirectory
|
|
29
|
+
? recipes
|
|
30
|
+
: recipes.filter((recipe) => recipeMatchesFile(recipe, file));
|
|
31
|
+
const fallback =
|
|
32
|
+
currentRoot === undefined && inside(backend.target.workspace, file)
|
|
33
|
+
? backend.target.workspace
|
|
34
|
+
: undefined;
|
|
35
|
+
let directory = selectedDirectory ? file : path.posix.dirname(file);
|
|
36
|
+
for (;;) {
|
|
37
|
+
signal?.throwIfAborted();
|
|
38
|
+
const config = path.posix.join(directory, ".pi", "pi-agent-ide", `${name}.json`);
|
|
39
|
+
let configured = false;
|
|
40
|
+
try {
|
|
41
|
+
await backend.stat(config, { signal });
|
|
42
|
+
configured = true;
|
|
43
|
+
} catch (error) {
|
|
44
|
+
if (!(error instanceof SshBackendError) || error.code !== "ENOENT") throw error;
|
|
45
|
+
}
|
|
46
|
+
const evidenced =
|
|
47
|
+
!configured && relevant.length > 0
|
|
48
|
+
? [...(await inspectSshRecipeEvidence(backend, directory, relevant, signal)).values()].some(
|
|
49
|
+
(item) => item.score > 0,
|
|
50
|
+
)
|
|
51
|
+
: false;
|
|
52
|
+
if (configured || evidenced || directory === fallback)
|
|
53
|
+
return {
|
|
54
|
+
cwd: remoteLocation(backend.target.id, directory).source,
|
|
55
|
+
external: currentRoot !== undefined,
|
|
56
|
+
};
|
|
57
|
+
const parent = path.posix.dirname(directory);
|
|
58
|
+
if (parent === directory) return undefined;
|
|
59
|
+
directory = parent;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function inside(root: string, file: string): boolean {
|
|
64
|
+
const relative = path.posix.relative(root, file);
|
|
65
|
+
return (
|
|
66
|
+
relative === "" ||
|
|
67
|
+
// Containment only; no parent-relative path is constructed.
|
|
68
|
+
// eslint-disable-next-line repo/no-parent-paths
|
|
69
|
+
(relative !== ".." && !relative.startsWith("../") && !path.posix.isAbsolute(relative))
|
|
70
|
+
);
|
|
71
|
+
}
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
"""Read one authorized X11 drawable. No controller desktop or root-image window fallback."""
|
|
2
|
+
import ctypes as c
|
|
3
|
+
import json
|
|
4
|
+
import os
|
|
5
|
+
import struct
|
|
6
|
+
import sys
|
|
7
|
+
import zlib
|
|
8
|
+
|
|
9
|
+
MAX_PIXELS = 16 * 1024 * 1024
|
|
10
|
+
MAX_BYTES = 20 * 1024 * 1024
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Refused(Exception):
|
|
14
|
+
pass
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def process_identity(pid):
|
|
18
|
+
try:
|
|
19
|
+
with open(f"/proc/{pid}/stat", encoding="utf8") as file:
|
|
20
|
+
ticks = file.read().rsplit(")", 1)[1].split()[19]
|
|
21
|
+
with open("/proc/sys/kernel/random/boot_id", encoding="ascii") as file:
|
|
22
|
+
boot = file.read().strip()
|
|
23
|
+
return boot + ":" + ticks, os.readlink(f"/proc/{pid}/exe")
|
|
24
|
+
except FileNotFoundError:
|
|
25
|
+
raise Refused("ENOENT")
|
|
26
|
+
except PermissionError:
|
|
27
|
+
raise Refused("EACCES")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class Image(c.Structure):
|
|
31
|
+
_fields_ = [("width", c.c_int), ("height", c.c_int), ("xoffset", c.c_int),
|
|
32
|
+
("format", c.c_int), ("data", c.c_void_p), ("byte_order", c.c_int),
|
|
33
|
+
("bitmap_unit", c.c_int), ("bitmap_bit_order", c.c_int), ("bitmap_pad", c.c_int),
|
|
34
|
+
("depth", c.c_int), ("bytes_per_line", c.c_int), ("bits_per_pixel", c.c_int),
|
|
35
|
+
("red_mask", c.c_ulong), ("green_mask", c.c_ulong), ("blue_mask", c.c_ulong)]
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class Extension(c.Structure):
|
|
39
|
+
_fields_ = [("name", c.c_char_p), ("global_id", c.c_int)]
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class ProtocolRequest(c.Structure):
|
|
43
|
+
_fields_ = [("count", c.c_size_t), ("ext", c.POINTER(Extension)),
|
|
44
|
+
("opcode", c.c_uint8), ("isvoid", c.c_uint8)]
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class Iovec(c.Structure):
|
|
48
|
+
_fields_ = [("base", c.c_void_p), ("length", c.c_size_t)]
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def trusted_client_query(display):
|
|
52
|
+
"""Check X-Resource 1.2 on this Xlib connection without reading any pixels."""
|
|
53
|
+
try:
|
|
54
|
+
bridge = c.CDLL("libX11-xcb.so.1")
|
|
55
|
+
xcb = c.CDLL("libxcb.so.1")
|
|
56
|
+
except OSError:
|
|
57
|
+
raise Refused("CAPABILITY_UNAVAILABLE")
|
|
58
|
+
pointer = c.c_void_p
|
|
59
|
+
bridge.XGetXCBConnection.restype = pointer
|
|
60
|
+
bridge.XGetXCBConnection.argtypes = [pointer]
|
|
61
|
+
# Share the grabbed Xlib connection. A second client would wait behind XGrabServer.
|
|
62
|
+
connection = bridge.XGetXCBConnection(display)
|
|
63
|
+
if not connection:
|
|
64
|
+
raise Refused("CAPABILITY_UNAVAILABLE")
|
|
65
|
+
extension = Extension(b"X-Resource", 0)
|
|
66
|
+
xcb.xcb_get_extension_data.restype = pointer
|
|
67
|
+
xcb.xcb_get_extension_data.argtypes = [pointer, c.POINTER(Extension)]
|
|
68
|
+
information = xcb.xcb_get_extension_data(connection, c.byref(extension))
|
|
69
|
+
if not information or c.string_at(information, 12)[8] != 1:
|
|
70
|
+
raise Refused("CAPABILITY_UNAVAILABLE")
|
|
71
|
+
xcb.xcb_send_request.restype = c.c_uint
|
|
72
|
+
xcb.xcb_send_request.argtypes = [pointer, c.c_int, c.POINTER(Iovec), c.POINTER(ProtocolRequest)]
|
|
73
|
+
xcb.xcb_wait_for_reply.restype = pointer
|
|
74
|
+
xcb.xcb_wait_for_reply.argtypes = [pointer, c.c_uint, c.POINTER(pointer)]
|
|
75
|
+
libc = c.CDLL(None)
|
|
76
|
+
libc.free.argtypes = [pointer]
|
|
77
|
+
libc.free.restype = None
|
|
78
|
+
|
|
79
|
+
def query(opcode, data):
|
|
80
|
+
buffer = c.create_string_buffer(data)
|
|
81
|
+
# libxcb reserves two iovecs before the request for its wire header.
|
|
82
|
+
vectors = (Iovec * 4)()
|
|
83
|
+
vectors[2] = Iovec(c.cast(buffer, pointer), len(data))
|
|
84
|
+
vectors[3] = Iovec(None, (-len(data)) & 3)
|
|
85
|
+
protocol = ProtocolRequest(2, c.pointer(extension), opcode, 0)
|
|
86
|
+
sequence = xcb.xcb_send_request(connection, 1,
|
|
87
|
+
c.cast(c.byref(vectors, 2 * c.sizeof(Iovec)), c.POINTER(Iovec)), c.byref(protocol))
|
|
88
|
+
error = pointer()
|
|
89
|
+
reply = xcb.xcb_wait_for_reply(connection, sequence, c.byref(error)) if sequence else None
|
|
90
|
+
try:
|
|
91
|
+
if error or not reply:
|
|
92
|
+
raise Refused("CAPABILITY_UNAVAILABLE")
|
|
93
|
+
header = c.string_at(reply, 32)
|
|
94
|
+
size = struct.unpack_from("=I", header, 4)[0] * 4
|
|
95
|
+
if header[0] != 1 or size > 4096:
|
|
96
|
+
raise Refused("CAPABILITY_UNAVAILABLE")
|
|
97
|
+
return header + c.string_at(reply + 32, size)
|
|
98
|
+
finally:
|
|
99
|
+
if error:
|
|
100
|
+
libc.free(error)
|
|
101
|
+
if reply:
|
|
102
|
+
libc.free(reply)
|
|
103
|
+
|
|
104
|
+
version = query(0, struct.pack("=BBHBB2x", 0, 0, 0, 1, 2))
|
|
105
|
+
if struct.unpack_from("=HH", version, 8) < (1, 2):
|
|
106
|
+
raise Refused("CAPABILITY_UNAVAILABLE")
|
|
107
|
+
return query
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def trusted_window_pid(display, window):
|
|
111
|
+
"""Ask for the server-observed local client PID, not a window property."""
|
|
112
|
+
query = trusted_client_query(display)
|
|
113
|
+
identifiers = query(4, struct.pack("=BBHIII", 0, 0, 0, 1, window, 2))
|
|
114
|
+
# One requested client and one LOCAL_CLIENT_PID value (length is bytes).
|
|
115
|
+
if len(identifiers) != 48 or struct.unpack_from("=I", identifiers, 8)[0] != 1:
|
|
116
|
+
raise Refused("CAPABILITY_UNAVAILABLE")
|
|
117
|
+
_, mask, length, pid = struct.unpack_from("=IIII", identifiers, 32)
|
|
118
|
+
if mask != 2 or length != 4 or pid == 0:
|
|
119
|
+
raise Refused("CAPABILITY_UNAVAILABLE")
|
|
120
|
+
return pid
|
|
121
|
+
|
|
122
|
+
def display_library():
|
|
123
|
+
if not os.environ.get("DISPLAY"):
|
|
124
|
+
raise Refused("DESKTOP_UNAVAILABLE")
|
|
125
|
+
try:
|
|
126
|
+
x = c.CDLL("libX11.so.6")
|
|
127
|
+
except OSError:
|
|
128
|
+
raise Refused("CAPABILITY_UNAVAILABLE")
|
|
129
|
+
return x
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def probe():
|
|
133
|
+
"""Connect to the native desktop and check trusted identity support. Never acquire pixels."""
|
|
134
|
+
x = display_library()
|
|
135
|
+
x.XOpenDisplay.restype = c.c_void_p
|
|
136
|
+
x.XOpenDisplay.argtypes = [c.c_char_p]
|
|
137
|
+
x.XCloseDisplay.restype = c.c_int
|
|
138
|
+
x.XCloseDisplay.argtypes = [c.c_void_p]
|
|
139
|
+
display = x.XOpenDisplay(None)
|
|
140
|
+
if not display:
|
|
141
|
+
raise Refused("DESKTOP_UNAVAILABLE")
|
|
142
|
+
try:
|
|
143
|
+
try:
|
|
144
|
+
trusted_client_query(display)
|
|
145
|
+
except Refused as error:
|
|
146
|
+
return {"display": True, "window": False, "error": str(error)}
|
|
147
|
+
return {"display": True, "window": True}
|
|
148
|
+
finally:
|
|
149
|
+
x.XCloseDisplay(display)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
def capture(request):
|
|
153
|
+
x = display_library()
|
|
154
|
+
pointer, number = c.c_void_p, c.c_ulong
|
|
155
|
+
def bind(name, result, arguments):
|
|
156
|
+
function = getattr(x, name)
|
|
157
|
+
function.restype, function.argtypes = result, arguments
|
|
158
|
+
return function
|
|
159
|
+
open_display = bind("XOpenDisplay", pointer, [c.c_char_p])
|
|
160
|
+
close_display = bind("XCloseDisplay", c.c_int, [pointer])
|
|
161
|
+
root_window = bind("XRootWindow", number, [pointer, c.c_int])
|
|
162
|
+
screen_count = bind("XScreenCount", c.c_int, [pointer])
|
|
163
|
+
query_tree = bind("XQueryTree", c.c_int, [pointer, number, c.POINTER(number),
|
|
164
|
+
c.POINTER(number), c.POINTER(c.POINTER(number)), c.POINTER(c.c_uint)])
|
|
165
|
+
get_geometry = bind("XGetGeometry", c.c_int, [pointer, number, c.POINTER(number),
|
|
166
|
+
c.POINTER(c.c_int), c.POINTER(c.c_int), c.POINTER(c.c_uint), c.POINTER(c.c_uint),
|
|
167
|
+
c.POINTER(c.c_uint), c.POINTER(c.c_uint)])
|
|
168
|
+
translate = bind("XTranslateCoordinates", c.c_int, [pointer, number, number,
|
|
169
|
+
c.c_int, c.c_int, c.POINTER(c.c_int), c.POINTER(c.c_int), c.POINTER(number)])
|
|
170
|
+
atom = bind("XInternAtom", number, [pointer, c.c_char_p, c.c_int])
|
|
171
|
+
get_property = bind("XGetWindowProperty", c.c_int, [pointer, number, number, c.c_long,
|
|
172
|
+
c.c_long, c.c_int, number, c.POINTER(number), c.POINTER(c.c_int),
|
|
173
|
+
c.POINTER(number), c.POINTER(number), c.POINTER(pointer)])
|
|
174
|
+
free = bind("XFree", c.c_int, [pointer])
|
|
175
|
+
get_image = bind("XGetImage", c.POINTER(Image), [pointer, number, c.c_int, c.c_int,
|
|
176
|
+
c.c_uint, c.c_uint, number, c.c_int])
|
|
177
|
+
destroy_image = bind("XDestroyImage", c.c_int, [c.POINTER(Image)])
|
|
178
|
+
grab = bind("XGrabServer", c.c_int, [pointer])
|
|
179
|
+
ungrab = bind("XUngrabServer", c.c_int, [pointer])
|
|
180
|
+
sync = bind("XSync", c.c_int, [pointer, c.c_int])
|
|
181
|
+
error_handler = c.CFUNCTYPE(c.c_int, pointer, pointer)
|
|
182
|
+
error_seen = []
|
|
183
|
+
@error_handler
|
|
184
|
+
def on_error(_display, _event):
|
|
185
|
+
error_seen.append(True)
|
|
186
|
+
return 0
|
|
187
|
+
bind("XSetErrorHandler", pointer, [error_handler])(on_error)
|
|
188
|
+
display = open_display(None)
|
|
189
|
+
if not display:
|
|
190
|
+
raise Refused("DESKTOP_UNAVAILABLE")
|
|
191
|
+
image = None
|
|
192
|
+
grabbed = False
|
|
193
|
+
try:
|
|
194
|
+
def children(window):
|
|
195
|
+
root, parent, count = number(), number(), c.c_uint()
|
|
196
|
+
values = c.POINTER(number)()
|
|
197
|
+
if not query_tree(display, window, c.byref(root), c.byref(parent), c.byref(values), c.byref(count)):
|
|
198
|
+
raise Refused("EACCES")
|
|
199
|
+
try:
|
|
200
|
+
if count.value > 4096:
|
|
201
|
+
raise Refused("CONTENT_LIMIT")
|
|
202
|
+
return list(values[:count.value])
|
|
203
|
+
finally:
|
|
204
|
+
if values:
|
|
205
|
+
free(values)
|
|
206
|
+
def geometry(window, root, include_border=False):
|
|
207
|
+
owner, child = number(), number()
|
|
208
|
+
left, top, rx, ry = c.c_int(), c.c_int(), c.c_int(), c.c_int()
|
|
209
|
+
width, height, border, depth = c.c_uint(), c.c_uint(), c.c_uint(), c.c_uint()
|
|
210
|
+
if not get_geometry(display, window, c.byref(owner), c.byref(left), c.byref(top),
|
|
211
|
+
c.byref(width), c.byref(height), c.byref(border), c.byref(depth)):
|
|
212
|
+
raise Refused("EACCES")
|
|
213
|
+
if not translate(display, window, root, 0, 0, c.byref(rx), c.byref(ry), c.byref(child)):
|
|
214
|
+
raise Refused("EACCES")
|
|
215
|
+
edge = border.value if include_border else 0
|
|
216
|
+
return rx.value - edge, ry.value - edge, width.value + 2 * edge, height.value + 2 * edge
|
|
217
|
+
pid_atom = atom(display, b"_NET_WM_PID", 1)
|
|
218
|
+
def window_pid(window):
|
|
219
|
+
actual, count, remaining = number(), number(), number()
|
|
220
|
+
format = c.c_int()
|
|
221
|
+
value = pointer()
|
|
222
|
+
result = get_property(display, window, pid_atom, 0, 1, 0, 6,
|
|
223
|
+
c.byref(actual), c.byref(format), c.byref(count), c.byref(remaining), c.byref(value))
|
|
224
|
+
try:
|
|
225
|
+
if result == 0 and actual.value == 6 and format.value == 32 and count.value == 1 and remaining.value == 0:
|
|
226
|
+
return c.cast(value, c.POINTER(number))[0]
|
|
227
|
+
return None
|
|
228
|
+
finally:
|
|
229
|
+
if value:
|
|
230
|
+
free(value)
|
|
231
|
+
grab(display)
|
|
232
|
+
grabbed = True
|
|
233
|
+
if request["kind"] == "display":
|
|
234
|
+
index = request["index"]
|
|
235
|
+
if index < 0 or index >= screen_count(display):
|
|
236
|
+
raise Refused("ENOENT")
|
|
237
|
+
root = drawable = root_window(display, index)
|
|
238
|
+
else:
|
|
239
|
+
pid = request["pid"]
|
|
240
|
+
expected = (request["identity"], request["executable"])
|
|
241
|
+
if process_identity(pid) != expected:
|
|
242
|
+
raise Refused("STALE_PROCESS")
|
|
243
|
+
matches = []
|
|
244
|
+
visited = 0
|
|
245
|
+
for screen in range(screen_count(display)):
|
|
246
|
+
root = root_window(display, screen)
|
|
247
|
+
top_windows = children(root)
|
|
248
|
+
pending = [(window, position) for position, window in enumerate(top_windows)]
|
|
249
|
+
while pending:
|
|
250
|
+
window, position = pending.pop()
|
|
251
|
+
visited += 1
|
|
252
|
+
if visited > 4096:
|
|
253
|
+
raise Refused("CONTENT_LIMIT")
|
|
254
|
+
if pid_atom and window_pid(window) == pid:
|
|
255
|
+
matches.append((root, window, top_windows[position + 1:]))
|
|
256
|
+
pending.extend((child, position) for child in children(window))
|
|
257
|
+
if not matches:
|
|
258
|
+
raise Refused("ENOENT")
|
|
259
|
+
if len(matches) != 1:
|
|
260
|
+
raise Refused("AMBIGUOUS_WINDOW")
|
|
261
|
+
root, drawable, above = matches[0]
|
|
262
|
+
sync(display, 0)
|
|
263
|
+
if trusted_window_pid(display, drawable) != pid:
|
|
264
|
+
raise Refused("EACCES")
|
|
265
|
+
left, top, width, height = geometry(drawable, root)
|
|
266
|
+
for other in above:
|
|
267
|
+
ox, oy, ow, oh = geometry(other, root, include_border=True)
|
|
268
|
+
if left < ox + ow and ox < left + width and top < oy + oh and oy < top + height:
|
|
269
|
+
# XGetImage has undefined obscured pixels. Never replace them with root pixels.
|
|
270
|
+
raise Refused("WINDOW_OBSCURED")
|
|
271
|
+
_, _, width, height = geometry(drawable, root)
|
|
272
|
+
if width < 1 or height < 1 or width * height > MAX_PIXELS:
|
|
273
|
+
raise Refused("PIXEL_LIMIT")
|
|
274
|
+
image = get_image(display, drawable, 0, 0, width, height, number(-1), 2)
|
|
275
|
+
sync(display, 0)
|
|
276
|
+
if not image or error_seen:
|
|
277
|
+
raise Refused("EACCES")
|
|
278
|
+
if request["kind"] == "window" and process_identity(request["pid"]) != expected:
|
|
279
|
+
raise Refused("STALE_PROCESS")
|
|
280
|
+
ungrab(display)
|
|
281
|
+
grabbed = False
|
|
282
|
+
pixels = image.contents
|
|
283
|
+
if (pixels.width, pixels.height) != (width, height) or pixels.xoffset != 0 or pixels.byte_order != 0 or pixels.bits_per_pixel not in (24, 32) or (pixels.red_mask, pixels.green_mask, pixels.blue_mask) != (0xff0000, 0xff00, 0xff):
|
|
284
|
+
raise Refused("CAPABILITY_UNAVAILABLE")
|
|
285
|
+
step = pixels.bits_per_pixel // 8
|
|
286
|
+
if pixels.bytes_per_line < width * step or pixels.bytes_per_line * height > MAX_PIXELS * 4:
|
|
287
|
+
raise Refused("PIXEL_LIMIT")
|
|
288
|
+
raw = c.string_at(pixels.data, pixels.bytes_per_line * height)
|
|
289
|
+
scanlines = bytearray()
|
|
290
|
+
for row in range(height):
|
|
291
|
+
data = raw[row * pixels.bytes_per_line:row * pixels.bytes_per_line + width * step]
|
|
292
|
+
rgb = bytearray(width * 3)
|
|
293
|
+
rgb[0::3], rgb[1::3], rgb[2::3] = data[2::step], data[1::step], data[0::step]
|
|
294
|
+
scanlines.extend(b"\0" + rgb)
|
|
295
|
+
def chunk(kind, data):
|
|
296
|
+
return struct.pack("!I", len(data)) + kind + data + struct.pack("!I", zlib.crc32(kind + data))
|
|
297
|
+
png = b"\x89PNG\r\n\x1a\n" + chunk(b"IHDR", struct.pack("!IIBBBBB", width, height, 8, 2, 0, 0, 0)) + chunk(b"IDAT", zlib.compress(scanlines)) + chunk(b"IEND", b"")
|
|
298
|
+
if len(png) > MAX_BYTES:
|
|
299
|
+
raise Refused("BYTE_LIMIT")
|
|
300
|
+
return png
|
|
301
|
+
finally:
|
|
302
|
+
if image:
|
|
303
|
+
destroy_image(image)
|
|
304
|
+
if grabbed:
|
|
305
|
+
ungrab(display)
|
|
306
|
+
close_display(display)
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
try:
|
|
310
|
+
request = json.loads(sys.argv[1])
|
|
311
|
+
if request["kind"] == "probe":
|
|
312
|
+
print(json.dumps(probe()))
|
|
313
|
+
else:
|
|
314
|
+
sys.stdout.buffer.write(capture(request))
|
|
315
|
+
except Refused as error:
|
|
316
|
+
print(json.dumps({"error": str(error)}))
|
|
317
|
+
except Exception:
|
|
318
|
+
# Do not return display names, authorization paths, native logs or environment values.
|
|
319
|
+
print(json.dumps({"error": "CAPABILITY_UNAVAILABLE"}))
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import type { SshBackendRegistry } from "./registry.js";
|
|
3
|
+
import type { SshTarget } from "./ssh.js";
|
|
4
|
+
import { SshBackendError } from "./ssh.js";
|
|
5
|
+
import { readOwnedSshCommand } from "./owned-read-command.js";
|
|
6
|
+
|
|
7
|
+
/** A native target frame request. Window identity must come from an authorized target snapshot. */
|
|
8
|
+
export type SshCaptureRequest =
|
|
9
|
+
| {
|
|
10
|
+
readonly kind: "window";
|
|
11
|
+
readonly pid: number;
|
|
12
|
+
readonly identity: string;
|
|
13
|
+
readonly executable: string;
|
|
14
|
+
}
|
|
15
|
+
| { readonly kind: "display"; readonly index: number };
|
|
16
|
+
|
|
17
|
+
/** Connect to target X11 and check trusted client support without pixels or opt-in changes.
|
|
18
|
+
* This is readiness only, not authorization for any particular window or display.
|
|
19
|
+
*/
|
|
20
|
+
export async function probeSshCapture(
|
|
21
|
+
target: SshTarget,
|
|
22
|
+
source: string,
|
|
23
|
+
signal?: AbortSignal,
|
|
24
|
+
): Promise<{
|
|
25
|
+
display: { ok: boolean; detail: string };
|
|
26
|
+
window: { ok: boolean; detail: string };
|
|
27
|
+
}> {
|
|
28
|
+
signal?.throwIfAborted();
|
|
29
|
+
worker ??= readFile(new URL("./vision-capture-worker.py", import.meta.url), "utf8");
|
|
30
|
+
const result = await readOwnedSshCommand(
|
|
31
|
+
target,
|
|
32
|
+
"python3",
|
|
33
|
+
["-c", await worker, JSON.stringify({ kind: "probe" })],
|
|
34
|
+
source,
|
|
35
|
+
{ signal, timeoutMs: 5_000, maxBytes: 128 * 1024 },
|
|
36
|
+
);
|
|
37
|
+
signal?.throwIfAborted();
|
|
38
|
+
if (result.exitCode !== 0)
|
|
39
|
+
throw new SshBackendError("CAPABILITY_UNAVAILABLE", source, "not-applied");
|
|
40
|
+
let reply: unknown;
|
|
41
|
+
try {
|
|
42
|
+
reply = JSON.parse(result.stdout.toString("utf8"));
|
|
43
|
+
} catch {
|
|
44
|
+
throw new SshBackendError("INVALID_RESPONSE", source, "not-applied");
|
|
45
|
+
}
|
|
46
|
+
if (typeof reply !== "object" || reply === null)
|
|
47
|
+
throw new SshBackendError("INVALID_RESPONSE", source, "not-applied");
|
|
48
|
+
if (
|
|
49
|
+
"display" in reply &&
|
|
50
|
+
reply.display === true &&
|
|
51
|
+
"window" in reply &&
|
|
52
|
+
typeof reply.window === "boolean" &&
|
|
53
|
+
(reply.window || ("error" in reply && reply.error === "CAPABILITY_UNAVAILABLE"))
|
|
54
|
+
) {
|
|
55
|
+
return {
|
|
56
|
+
display: {
|
|
57
|
+
ok: true,
|
|
58
|
+
detail: "Target X11 connection opened without pixels; capture opt-in unchanged",
|
|
59
|
+
},
|
|
60
|
+
window: {
|
|
61
|
+
ok: reply.window,
|
|
62
|
+
detail: reply.window
|
|
63
|
+
? "Target X-Resource 1.2 is available; individual window authorization is not checked"
|
|
64
|
+
: `CAPABILITY_UNAVAILABLE: ${source} (trusted X11 client identity unavailable)`,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
const code =
|
|
69
|
+
"error" in reply && typeof reply.error === "string" && refusalCodes.has(reply.error)
|
|
70
|
+
? reply.error
|
|
71
|
+
: "INVALID_RESPONSE";
|
|
72
|
+
throw new SshBackendError(code, source, "not-applied");
|
|
73
|
+
}
|
|
74
|
+
let worker: Promise<string> | undefined;
|
|
75
|
+
const PNG_SIGNATURE = Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]);
|
|
76
|
+
const refusalCodes = new Set([
|
|
77
|
+
"DESKTOP_UNAVAILABLE",
|
|
78
|
+
"CAPABILITY_UNAVAILABLE",
|
|
79
|
+
"ENOENT",
|
|
80
|
+
"EACCES",
|
|
81
|
+
"STALE_PROCESS",
|
|
82
|
+
"AMBIGUOUS_WINDOW",
|
|
83
|
+
"WINDOW_OBSCURED",
|
|
84
|
+
"CONTENT_LIMIT",
|
|
85
|
+
"PIXEL_LIMIT",
|
|
86
|
+
"BYTE_LIMIT",
|
|
87
|
+
]);
|
|
88
|
+
|
|
89
|
+
/** Acquire bounded X11 pixels on the configured target, never from the controller desktop.
|
|
90
|
+
* The caller checks capture opt-in and authorizes the exact target executable before each frame.
|
|
91
|
+
* The worker rechecks boot/start identity and executable around the requested drawable read.
|
|
92
|
+
*/
|
|
93
|
+
export async function captureSshFrame(
|
|
94
|
+
registry: SshBackendRegistry,
|
|
95
|
+
source: string,
|
|
96
|
+
request: SshCaptureRequest,
|
|
97
|
+
signal?: AbortSignal,
|
|
98
|
+
): Promise<Uint8Array> {
|
|
99
|
+
signal?.throwIfAborted();
|
|
100
|
+
const prefix = request.kind === "window" ? "window:" : "display:";
|
|
101
|
+
if (!source.startsWith(`${prefix}ssh://`))
|
|
102
|
+
throw new SshBackendError("INVALID_SOURCE", source, "not-applied");
|
|
103
|
+
const uri = new URL(source.slice(prefix.length));
|
|
104
|
+
const selected = request.kind === "window" ? request.pid : request.index;
|
|
105
|
+
if (
|
|
106
|
+
uri.username ||
|
|
107
|
+
uri.password ||
|
|
108
|
+
uri.port ||
|
|
109
|
+
uri.search ||
|
|
110
|
+
!Number.isSafeInteger(selected) ||
|
|
111
|
+
(request.kind === "window"
|
|
112
|
+
? selected < 1 || uri.pathname !== `/${selected}` || uri.hash !== ""
|
|
113
|
+
: selected < 0 ||
|
|
114
|
+
uri.pathname !== "/" ||
|
|
115
|
+
(uri.hash !== `#${selected}` && !(selected === 0 && uri.hash === "")))
|
|
116
|
+
)
|
|
117
|
+
throw new SshBackendError("INVALID_SOURCE", source, "not-applied");
|
|
118
|
+
try {
|
|
119
|
+
const owner = registry.resolve(`ssh://${uri.hostname}/`);
|
|
120
|
+
if (!owner) throw new SshBackendError("UNSUPPORTED_SOURCE", source, "not-applied");
|
|
121
|
+
worker ??= readFile(new URL("./vision-capture-worker.py", import.meta.url), "utf8");
|
|
122
|
+
const result = await readOwnedSshCommand(
|
|
123
|
+
owner.backend.target,
|
|
124
|
+
"python3",
|
|
125
|
+
["-c", await worker, JSON.stringify(request)],
|
|
126
|
+
source,
|
|
127
|
+
{ signal, timeoutMs: 10_000, maxBytes: 20 * 1024 * 1024 },
|
|
128
|
+
);
|
|
129
|
+
signal?.throwIfAborted();
|
|
130
|
+
if (result.exitCode !== 0)
|
|
131
|
+
throw new SshBackendError("CAPABILITY_UNAVAILABLE", source, "not-applied");
|
|
132
|
+
if (result.stdout.subarray(0, 8).equals(PNG_SIGNATURE)) {
|
|
133
|
+
if (
|
|
134
|
+
result.stdout.length < 33 ||
|
|
135
|
+
result.stdout.length > 20 * 1024 * 1024 ||
|
|
136
|
+
result.stdout.toString("ascii", 12, 16) !== "IHDR"
|
|
137
|
+
)
|
|
138
|
+
throw new SshBackendError("INVALID_RESPONSE", source, "not-applied");
|
|
139
|
+
const width = result.stdout.readUInt32BE(16),
|
|
140
|
+
height = result.stdout.readUInt32BE(20);
|
|
141
|
+
if (width < 1 || height < 1 || width * height > 16 * 1024 * 1024)
|
|
142
|
+
throw new SshBackendError("PIXEL_LIMIT", source, "not-applied");
|
|
143
|
+
return result.stdout;
|
|
144
|
+
}
|
|
145
|
+
let reply: unknown;
|
|
146
|
+
try {
|
|
147
|
+
reply = JSON.parse(result.stdout.toString("utf8"));
|
|
148
|
+
} catch {
|
|
149
|
+
throw new SshBackendError("INVALID_RESPONSE", source, "not-applied");
|
|
150
|
+
}
|
|
151
|
+
const code =
|
|
152
|
+
typeof reply === "object" &&
|
|
153
|
+
reply !== null &&
|
|
154
|
+
"error" in reply &&
|
|
155
|
+
typeof reply.error === "string" &&
|
|
156
|
+
refusalCodes.has(reply.error)
|
|
157
|
+
? reply.error
|
|
158
|
+
: "INVALID_RESPONSE";
|
|
159
|
+
throw new SshBackendError(code, source, "not-applied");
|
|
160
|
+
} catch (error) {
|
|
161
|
+
if (error instanceof SshBackendError)
|
|
162
|
+
throw new SshBackendError(error.code, source, error.effect);
|
|
163
|
+
throw error;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import type { BuiltinExtensionContext } from "#src/composite/selection.js";
|
|
3
|
+
import {
|
|
4
|
+
registerVisionWithOwner,
|
|
5
|
+
type ProcessOwnerAccess,
|
|
6
|
+
type CaptureOwnerAccess,
|
|
7
|
+
} from "#src/plugins/pi-agent-ide-vision/index.js";
|
|
8
|
+
import { resolvePiAgentIdeExtensionsConfigPaths } from "#src/composite/extensions-config.js";
|
|
9
|
+
import { readSshTargets, resolveSshConfigPaths } from "./config.js";
|
|
10
|
+
import { SshBackendRegistry } from "./registry.js";
|
|
11
|
+
import { SshBackendError } from "./ssh.js";
|
|
12
|
+
import { readSshProcessMetadata } from "./process-metadata.js";
|
|
13
|
+
import { captureSshFrame } from "./vision-capture.js";
|
|
14
|
+
import { parseSshWebSource } from "./web-owner.js";
|
|
15
|
+
import { captureSshBrowserImage } from "./web-browser.js";
|
|
16
|
+
|
|
17
|
+
/** Add explicit target process namespaces without changing ordinary local discovery or capture. */
|
|
18
|
+
export function createSshProcessOwner(registry: SshBackendRegistry): ProcessOwnerAccess {
|
|
19
|
+
return {
|
|
20
|
+
async read(source, signal) {
|
|
21
|
+
if (!source.startsWith("process:ssh://")) return undefined;
|
|
22
|
+
const uri = new URL(source.slice("process:".length));
|
|
23
|
+
if (
|
|
24
|
+
uri.username ||
|
|
25
|
+
uri.password ||
|
|
26
|
+
uri.port ||
|
|
27
|
+
uri.search ||
|
|
28
|
+
uri.hash ||
|
|
29
|
+
!/^\/[1-9][0-9]*$/u.test(uri.pathname)
|
|
30
|
+
)
|
|
31
|
+
throw new SshBackendError("INVALID_SOURCE", source, "not-applied");
|
|
32
|
+
try {
|
|
33
|
+
const [metadata] = await readSshProcessMetadata(
|
|
34
|
+
registry,
|
|
35
|
+
`ssh://${uri.hostname}/`,
|
|
36
|
+
Number(uri.pathname.slice(1)),
|
|
37
|
+
signal,
|
|
38
|
+
);
|
|
39
|
+
if (!metadata) throw new SshBackendError("ENOENT", source, "not-applied");
|
|
40
|
+
return metadata;
|
|
41
|
+
} catch (error) {
|
|
42
|
+
if (error instanceof SshBackendError)
|
|
43
|
+
throw new SshBackendError(error.code, source, error.effect);
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
async list(scope, signal) {
|
|
48
|
+
if (!scope.startsWith("ssh://")) return undefined;
|
|
49
|
+
return readSshProcessMetadata(registry, scope, undefined, signal);
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Bridge authorized target snapshots to native pixel acquisition; local capture is never used. */
|
|
55
|
+
export function createSshCaptureOwner(registry: SshBackendRegistry): CaptureOwnerAccess {
|
|
56
|
+
return {
|
|
57
|
+
captureWindow(source, process, signal) {
|
|
58
|
+
if (!process.executable)
|
|
59
|
+
throw new SshBackendError("CAPABILITY_UNAVAILABLE", source, "not-applied");
|
|
60
|
+
return captureSshFrame(
|
|
61
|
+
registry,
|
|
62
|
+
source,
|
|
63
|
+
{
|
|
64
|
+
kind: "window",
|
|
65
|
+
pid: process.pid,
|
|
66
|
+
identity: process.identity,
|
|
67
|
+
executable: process.executable,
|
|
68
|
+
},
|
|
69
|
+
signal,
|
|
70
|
+
);
|
|
71
|
+
},
|
|
72
|
+
async captureWeb(source, signal) {
|
|
73
|
+
const parsed = parseSshWebSource(source);
|
|
74
|
+
if (!parsed) throw new SshBackendError("INVALID_SOURCE", source, "not-applied");
|
|
75
|
+
try {
|
|
76
|
+
const owner = registry.resolve(`ssh://${parsed.target}/`);
|
|
77
|
+
if (!owner) throw new SshBackendError("UNSUPPORTED_SOURCE", source, "not-applied");
|
|
78
|
+
return await captureSshBrowserImage(owner.backend.target, parsed.url, source, signal);
|
|
79
|
+
} catch (error) {
|
|
80
|
+
if (error instanceof SshBackendError)
|
|
81
|
+
throw new SshBackendError(error.code, source, error.effect);
|
|
82
|
+
throw error;
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
captureDisplay(source, index, signal) {
|
|
86
|
+
return captureSshFrame(registry, source, { kind: "display", index }, signal);
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/** Register enabled vision/process providers lazily; unused targets launch no probes. */
|
|
91
|
+
export default async function registerOwnedVision(
|
|
92
|
+
pi: ExtensionAPI,
|
|
93
|
+
context?: BuiltinExtensionContext,
|
|
94
|
+
): Promise<void> {
|
|
95
|
+
const registry = new SshBackendRegistry(
|
|
96
|
+
await readSshTargets(resolveSshConfigPaths(resolvePiAgentIdeExtensionsConfigPaths())),
|
|
97
|
+
);
|
|
98
|
+
await registerVisionWithOwner(
|
|
99
|
+
pi,
|
|
100
|
+
context,
|
|
101
|
+
createSshProcessOwner(registry),
|
|
102
|
+
createSshCaptureOwner(registry),
|
|
103
|
+
);
|
|
104
|
+
}
|