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
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { ResultPanel } from "pi-agent-tool-ui";
|
|
3
3
|
import { connectAgentDocumentation, loadPackagedAgentGuide } from "pi-agent-documentation";
|
|
4
|
+
import { connectDoctorPlugin } from "pi-agent-doctor/api/connect-plugin";
|
|
5
|
+
import { visionDoctorPlugin } from "./src/doctor-plugin.js";
|
|
4
6
|
|
|
5
7
|
import type { BuiltinExtensionContext } from "#src/composite/selection.js";
|
|
6
8
|
import { connectReadPlugin } from "pi-agent-read/api/connect-plugin";
|
|
@@ -16,23 +18,56 @@ import {
|
|
|
16
18
|
createCaptureBackend,
|
|
17
19
|
getVisionDefaults,
|
|
18
20
|
isExecutableAllowed,
|
|
21
|
+
isNativeExecutableAllowed,
|
|
19
22
|
listProcesses,
|
|
20
23
|
parseDisplaySource,
|
|
21
24
|
parseVisionView,
|
|
22
25
|
readProcess,
|
|
23
26
|
type VisionOptions,
|
|
27
|
+
type ProcessMetadata,
|
|
28
|
+
type RemoteProcessMetadata,
|
|
29
|
+
withRemoteProcessOwnership,
|
|
24
30
|
} from "#src/plugins/pi-agent-ide-vision/src/vision.js";
|
|
25
31
|
|
|
32
|
+
/** Target-native capture. Registration checks opt-in and current target ownership before each frame. */
|
|
33
|
+
export interface CaptureOwnerAccess {
|
|
34
|
+
/** Capture an explicitly owned web resource; never select a local browser for it. */
|
|
35
|
+
captureWeb?(source: string, signal?: AbortSignal): Promise<Uint8Array>;
|
|
36
|
+
captureWindow(
|
|
37
|
+
source: string,
|
|
38
|
+
process: RemoteProcessMetadata,
|
|
39
|
+
signal?: AbortSignal,
|
|
40
|
+
): Promise<Uint8Array>;
|
|
41
|
+
captureDisplay(source: string, index: number, signal?: AbortSignal): Promise<Uint8Array>;
|
|
42
|
+
}
|
|
43
|
+
/** Optional resource-owner metadata. Undefined means unclaimed, never a remote-to-local fallback. */
|
|
44
|
+
export interface ProcessOwnerAccess {
|
|
45
|
+
read(source: string, signal?: AbortSignal): Promise<RemoteProcessMetadata | undefined>;
|
|
46
|
+
list(scope: string, signal?: AbortSignal): Promise<readonly RemoteProcessMetadata[] | undefined>;
|
|
47
|
+
}
|
|
26
48
|
/** Register process discovery and guarded visual capture resources. */
|
|
27
49
|
export default async function registerVision(
|
|
28
50
|
pi: ExtensionAPI,
|
|
29
51
|
context?: BuiltinExtensionContext,
|
|
52
|
+
): Promise<void> {
|
|
53
|
+
await registerVisionWithOwner(pi, context);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Register existing process and capture interfaces with optional target-owned metadata. */
|
|
57
|
+
export async function registerVisionWithOwner(
|
|
58
|
+
pi: ExtensionAPI,
|
|
59
|
+
context?: BuiltinExtensionContext,
|
|
60
|
+
processOwner?: ProcessOwnerAccess,
|
|
61
|
+
captureOwner?: CaptureOwnerAccess,
|
|
30
62
|
): Promise<void> {
|
|
31
63
|
connectAgentDocumentation(pi, [
|
|
32
64
|
await loadPackagedAgentGuide({
|
|
33
65
|
id: "vision",
|
|
34
66
|
description: "Window, display, image, and sequence capture",
|
|
35
|
-
triggers: [
|
|
67
|
+
triggers: [
|
|
68
|
+
{ tool: "read", resourcePrefixes: ["process:", "window:", "display:"] },
|
|
69
|
+
{ tool: "read", resourcePrefixes: ["web:ssh://"], viewPrefixes: ["image", "sequence"] },
|
|
70
|
+
],
|
|
36
71
|
}),
|
|
37
72
|
]);
|
|
38
73
|
const preferences = context?.preferences ?? {};
|
|
@@ -45,6 +80,7 @@ export default async function registerVision(
|
|
|
45
80
|
const registry = agentIdeProcessRegistry(pi);
|
|
46
81
|
const backend = createCaptureBackend();
|
|
47
82
|
await Promise.all([
|
|
83
|
+
connectDoctorPlugin(pi, visionDoctorPlugin),
|
|
48
84
|
connectReadPlugin(pi, {
|
|
49
85
|
protocol: READ_PROTOCOL,
|
|
50
86
|
apiVersion: READ_API_VERSION,
|
|
@@ -62,6 +98,92 @@ export default async function registerVision(
|
|
|
62
98
|
async handler(context) {
|
|
63
99
|
const source = context.request.path;
|
|
64
100
|
if (source === undefined) return { kind: "continue", context };
|
|
101
|
+
if (source.startsWith("window:ssh://") || source.startsWith("display:ssh://")) {
|
|
102
|
+
try {
|
|
103
|
+
const window = source.startsWith("window:");
|
|
104
|
+
const uri = new URL(source.slice(window ? "window:".length : "display:".length));
|
|
105
|
+
if (
|
|
106
|
+
uri.username ||
|
|
107
|
+
uri.password ||
|
|
108
|
+
uri.port ||
|
|
109
|
+
uri.search ||
|
|
110
|
+
(window
|
|
111
|
+
? uri.hash !== "" || !/^\/[1-9][0-9]*$/u.test(uri.pathname)
|
|
112
|
+
: uri.pathname !== "/" || (uri.hash !== "" && !/^#\d+$/u.test(uri.hash)))
|
|
113
|
+
)
|
|
114
|
+
throw new Error(`Invalid target capture resource: ${source}`);
|
|
115
|
+
if (!window && pi.getFlag("pi-agent-ide-vision-displays") !== true)
|
|
116
|
+
return failed(
|
|
117
|
+
source,
|
|
118
|
+
"Display capture is disabled. Enable --pi-agent-ide-vision-displays to allow it.",
|
|
119
|
+
);
|
|
120
|
+
if (!captureOwner)
|
|
121
|
+
return failed(source, `Target capture is unavailable: ${source}`);
|
|
122
|
+
const index = window
|
|
123
|
+
? Number(uri.pathname.slice(1))
|
|
124
|
+
: Number(uri.hash.slice(1) || "0");
|
|
125
|
+
if (!Number.isSafeInteger(index))
|
|
126
|
+
throw new Error(`Invalid target capture resource: ${source}`);
|
|
127
|
+
const content = await captureImages(
|
|
128
|
+
async () => {
|
|
129
|
+
if (!window)
|
|
130
|
+
return captureOwner.captureDisplay(
|
|
131
|
+
source,
|
|
132
|
+
index,
|
|
133
|
+
context.resolverContext.signal,
|
|
134
|
+
);
|
|
135
|
+
const processSource = `process:ssh://${uri.hostname}/${index}`;
|
|
136
|
+
const snapshot = await processOwner?.read(
|
|
137
|
+
processSource,
|
|
138
|
+
context.resolverContext.signal,
|
|
139
|
+
);
|
|
140
|
+
if (
|
|
141
|
+
!snapshot ||
|
|
142
|
+
snapshot.resource !== processSource ||
|
|
143
|
+
snapshot.pid !== index ||
|
|
144
|
+
snapshot.target !== uri.hostname
|
|
145
|
+
)
|
|
146
|
+
throw new Error(`Target process identity is unavailable: ${source}`);
|
|
147
|
+
const metadata = withRemoteProcessOwnership(snapshot, registry);
|
|
148
|
+
const executable = metadata.executable;
|
|
149
|
+
// Use the native executable, not a command-line prefix or controller PID.
|
|
150
|
+
if (
|
|
151
|
+
!metadata.owned &&
|
|
152
|
+
(!executable || !isNativeExecutableAllowed(executable)) &&
|
|
153
|
+
pi.getFlag("pi-agent-ide-vision-arbitrary-windows") !== true
|
|
154
|
+
)
|
|
155
|
+
throw new Error(
|
|
156
|
+
`Window capture is denied for the target executable: ${source}`,
|
|
157
|
+
);
|
|
158
|
+
return captureOwner.captureWindow(
|
|
159
|
+
source,
|
|
160
|
+
metadata,
|
|
161
|
+
context.resolverContext.signal,
|
|
162
|
+
);
|
|
163
|
+
},
|
|
164
|
+
options(context.request),
|
|
165
|
+
context.resolverContext.signal,
|
|
166
|
+
);
|
|
167
|
+
return returned(source, content);
|
|
168
|
+
} catch (error) {
|
|
169
|
+
return failed(source, errorMessage(error));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
if (source.startsWith("web:") && requestsScreenshot(context.request)) {
|
|
173
|
+
try {
|
|
174
|
+
const captureWeb = captureOwner?.captureWeb?.bind(captureOwner);
|
|
175
|
+
if (!captureWeb)
|
|
176
|
+
return failed(source, `Target web capture is unavailable: ${source}`);
|
|
177
|
+
const content = await captureImages(
|
|
178
|
+
() => captureWeb(source, context.resolverContext.signal),
|
|
179
|
+
options(context.request),
|
|
180
|
+
context.resolverContext.signal,
|
|
181
|
+
);
|
|
182
|
+
return returned(source, content);
|
|
183
|
+
} catch (error) {
|
|
184
|
+
return failed(source, errorMessage(error));
|
|
185
|
+
}
|
|
186
|
+
}
|
|
65
187
|
const displayIndex = parseDisplaySource(source);
|
|
66
188
|
if (displayIndex !== undefined) {
|
|
67
189
|
if (pi.getFlag("pi-agent-ide-vision-displays") !== true) {
|
|
@@ -81,6 +203,18 @@ export default async function registerVision(
|
|
|
81
203
|
return failed(source, errorMessage(error));
|
|
82
204
|
}
|
|
83
205
|
}
|
|
206
|
+
try {
|
|
207
|
+
const owned = await processOwner?.read(source, context.resolverContext.signal);
|
|
208
|
+
if (owned)
|
|
209
|
+
return returned(source, [
|
|
210
|
+
{
|
|
211
|
+
type: "text",
|
|
212
|
+
text: formatProcess(withRemoteProcessOwnership(owned, registry)),
|
|
213
|
+
},
|
|
214
|
+
]);
|
|
215
|
+
} catch (error) {
|
|
216
|
+
return failed(source, errorMessage(error));
|
|
217
|
+
}
|
|
84
218
|
const processPid = prefixedPid(source, "process:");
|
|
85
219
|
if (processPid !== undefined) {
|
|
86
220
|
const metadata = await readProcess(processPid, registry);
|
|
@@ -130,7 +264,7 @@ export default async function registerVision(
|
|
|
130
264
|
});
|
|
131
265
|
api.describe({
|
|
132
266
|
path: () =>
|
|
133
|
-
`process:PID — process metadata. window:PID — capture a window of an IDE-owned or allowlisted process${pi.getFlag("pi-agent-ide-vision-arbitrary-windows") === true ? "; arbitrary windows are enabled" : "; other processes require --pi-agent-ide-vision-arbitrary-windows"}. display: or display:#N — display capture with a zero-based index; ${pi.getFlag("pi-agent-ide-vision-displays") === true ? "enabled" : "requires --pi-agent-ide-vision-displays"}. HTTP(S) URLs accept image or sequence screenshots.`,
|
|
267
|
+
`process:ssh://target/PID, window:ssh://target/PID and display:ssh://target/ select configured Linux SSH targets; missing target facilities fail without local fallback. web:ssh://target/https://… captures with target-installed Playwright/Chromium. process:PID — process metadata. window:PID — capture a window of an IDE-owned or allowlisted process${pi.getFlag("pi-agent-ide-vision-arbitrary-windows") === true ? "; arbitrary windows are enabled" : "; other processes require --pi-agent-ide-vision-arbitrary-windows"}. display: or display:#N — display capture with a zero-based index; ${pi.getFlag("pi-agent-ide-vision-displays") === true ? "enabled" : "requires --pi-agent-ide-vision-displays"}. HTTP(S) URLs accept image or sequence screenshots.`,
|
|
134
268
|
views: () => {
|
|
135
269
|
const defaults = getVisionDefaults();
|
|
136
270
|
return `image or image:scale=S,region=X,Y,W,H — one screenshot. sequence or sequence:duration=D,interval=I,scale=S,region=X,Y,W,H — timed frames. Only one image/sequence view per request. duration and interval are seconds and only valid for sequence: 0 < D <= 10, I > 0, at most 20 frames (floor(D/I)+1). Scale satisfies 0 < S <= 1. Region uses normalized x,y,width,height: x,y >= 0, width,height > 0, and the rectangle must fit in 0..1; crop runs before scaling. Settings are optional; defaults: duration=${defaults.durationSeconds}, interval=${defaults.intervalSeconds}, scale=${defaults.scale}.`;
|
|
@@ -153,20 +287,43 @@ export default async function registerVision(
|
|
|
153
287
|
id: "processes",
|
|
154
288
|
readResources: (request) => (/^process:/iu.test(request.query) ? undefined : []),
|
|
155
289
|
toScriptData(payload) {
|
|
156
|
-
const processes = payload as
|
|
290
|
+
const processes = payload as readonly (ProcessMetadata | RemoteProcessMetadata)[];
|
|
157
291
|
return {
|
|
158
292
|
kind: "custom",
|
|
159
293
|
resolverId: "processes",
|
|
160
294
|
value: {
|
|
161
|
-
processes: processes.map((item) => ({
|
|
295
|
+
processes: processes.map((item) => ({
|
|
296
|
+
pid: item.pid,
|
|
297
|
+
command: item.command,
|
|
298
|
+
...(item.host === "ssh"
|
|
299
|
+
? {
|
|
300
|
+
host: item.host,
|
|
301
|
+
target: item.target,
|
|
302
|
+
resource: item.resource,
|
|
303
|
+
identity: item.identity,
|
|
304
|
+
owned: item.owned,
|
|
305
|
+
parentPid: item.parentPid,
|
|
306
|
+
started: item.started,
|
|
307
|
+
executable: item.executable,
|
|
308
|
+
...(item.source === undefined ? {} : { source: item.source }),
|
|
309
|
+
}
|
|
310
|
+
: {}),
|
|
311
|
+
})),
|
|
162
312
|
},
|
|
163
313
|
};
|
|
164
314
|
},
|
|
165
|
-
async tryResolve(request) {
|
|
315
|
+
async tryResolve(request, context) {
|
|
166
316
|
const match = /^process:(.*)$/isu.exec(request.query);
|
|
167
317
|
if (match === null) return { kind: "not-handled" as const };
|
|
168
318
|
const query = (match[1] ?? "").trim().toLowerCase();
|
|
169
|
-
const
|
|
319
|
+
const scope = request.path ?? context.cwd;
|
|
320
|
+
const remote = await processOwner?.list(scope, context.signal);
|
|
321
|
+
if (scope.includes("://") && remote === undefined)
|
|
322
|
+
throw new Error("Process scope has no resource owner");
|
|
323
|
+
const matches = (
|
|
324
|
+
remote?.map((item) => withRemoteProcessOwnership(item, registry)) ??
|
|
325
|
+
(await listProcesses(registry))
|
|
326
|
+
)
|
|
170
327
|
.filter(
|
|
171
328
|
(item) =>
|
|
172
329
|
query.length === 0 ||
|
|
@@ -195,7 +352,7 @@ export default async function registerVision(
|
|
|
195
352
|
);
|
|
196
353
|
},
|
|
197
354
|
format(payload) {
|
|
198
|
-
const processes = payload as
|
|
355
|
+
const processes = payload as readonly (ProcessMetadata | RemoteProcessMetadata)[];
|
|
199
356
|
return {
|
|
200
357
|
content: [
|
|
201
358
|
{
|
|
@@ -212,7 +369,7 @@ export default async function registerVision(
|
|
|
212
369
|
},
|
|
213
370
|
});
|
|
214
371
|
api.describe(
|
|
215
|
-
"process:<query> finds running processes by PID or command
|
|
372
|
+
"process:<query> finds running processes by PID or command. Select a configured Linux target with an SSH path; its results retain process:ssh://target/PID, target and kernel start identity. Use process:PID for local metadata. Use window:ssh://target/PID for authorized target capture, never window:PID with a remote PID. Discovery alone does not grant capture or process control.",
|
|
216
373
|
);
|
|
217
374
|
},
|
|
218
375
|
}),
|
|
@@ -266,11 +423,15 @@ function failed(source: string, message: string) {
|
|
|
266
423
|
function errorMessage(error: unknown): string {
|
|
267
424
|
return error instanceof Error ? error.message : String(error);
|
|
268
425
|
}
|
|
269
|
-
function formatProcess(item:
|
|
426
|
+
function formatProcess(item: ProcessMetadata | RemoteProcessMetadata): string {
|
|
270
427
|
return [
|
|
271
428
|
`PID: ${item.pid}`,
|
|
429
|
+
...(item.host === "ssh"
|
|
430
|
+
? [`Target: ${item.target}`, `Resource: ${item.resource}`, `Identity: ${item.identity}`]
|
|
431
|
+
: []),
|
|
272
432
|
`Command: ${item.command}`,
|
|
273
433
|
`Owned by Agent IDE: ${item.owned ? "yes" : "no"}`,
|
|
434
|
+
...(item.host === "ssh" && item.executable !== null ? [`Executable: ${item.executable}`] : []),
|
|
274
435
|
...(item.parentPid === undefined ? [] : [`Parent PID: ${item.parentPid}`]),
|
|
275
436
|
...(item.started === undefined ? [] : [`Started: ${item.started}`]),
|
|
276
437
|
...(item.source === undefined ? [] : [`Agent IDE source: ${item.source}`]),
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { DOCTOR_API_VERSION, DOCTOR_PROTOCOL } from "pi-agent-doctor/api/plugin-protocol";
|
|
2
|
+
import type { DoctorPlugin } from "pi-agent-doctor/api/plugin-protocol";
|
|
3
|
+
|
|
4
|
+
/** Native graphics readiness only. This does not grant capture or read any pixels. */
|
|
5
|
+
export const visionDoctorPlugin: DoctorPlugin = {
|
|
6
|
+
protocol: DOCTOR_PROTOCOL,
|
|
7
|
+
apiVersion: DOCTOR_API_VERSION,
|
|
8
|
+
id: "vision",
|
|
9
|
+
setup(api) {
|
|
10
|
+
api.addCheck({
|
|
11
|
+
id: "target-graphics",
|
|
12
|
+
title: "Target screen capture readiness",
|
|
13
|
+
async run(context) {
|
|
14
|
+
// Local capture has its own platform backend; never substitute it for a target probe.
|
|
15
|
+
if (!context.workspace) return [];
|
|
16
|
+
try {
|
|
17
|
+
context.signal?.throwIfAborted();
|
|
18
|
+
if (!context.workspace.probeCapture)
|
|
19
|
+
throw new Error("Project owner does not provide a capture readiness probe");
|
|
20
|
+
const result = await context.workspace.probeCapture(context.signal);
|
|
21
|
+
context.signal?.throwIfAborted();
|
|
22
|
+
return [
|
|
23
|
+
{
|
|
24
|
+
status: result.display.ok ? "pass" : "warn",
|
|
25
|
+
message: "Native display connection",
|
|
26
|
+
detail: result.display.detail,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
status: result.window.ok ? "pass" : "warn",
|
|
30
|
+
message: "Trusted native window identity",
|
|
31
|
+
detail: result.window.detail,
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
} catch (error) {
|
|
35
|
+
context.signal?.throwIfAborted();
|
|
36
|
+
return [
|
|
37
|
+
{
|
|
38
|
+
status: "warn",
|
|
39
|
+
message: "Native capture readiness is unavailable",
|
|
40
|
+
detail: error instanceof Error ? error.message : String(error),
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
};
|
|
@@ -49,6 +49,39 @@ export interface ProcessMetadata {
|
|
|
49
49
|
readonly host: "local" | "windows";
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
/** Target-scoped read-only process metadata; discovery alone does not grant control or capture. */
|
|
53
|
+
export interface RemoteProcessMetadata {
|
|
54
|
+
readonly pid: number;
|
|
55
|
+
readonly parentPid: number;
|
|
56
|
+
readonly command: string;
|
|
57
|
+
readonly started: string;
|
|
58
|
+
readonly identity: string;
|
|
59
|
+
readonly executable: string | null;
|
|
60
|
+
readonly owned: boolean;
|
|
61
|
+
readonly source?: string;
|
|
62
|
+
readonly host: "ssh";
|
|
63
|
+
readonly target: string;
|
|
64
|
+
readonly resource: string;
|
|
65
|
+
}
|
|
66
|
+
/** Match a read-only target snapshot to an active channel without granting ownership after PID reuse. */
|
|
67
|
+
export function withRemoteProcessOwnership(
|
|
68
|
+
metadata: RemoteProcessMetadata,
|
|
69
|
+
registry: AgentIdeProcessRegistry,
|
|
70
|
+
): RemoteProcessMetadata {
|
|
71
|
+
const owner = registry
|
|
72
|
+
.list()
|
|
73
|
+
.find(
|
|
74
|
+
(entry) =>
|
|
75
|
+
entry.owned === true &&
|
|
76
|
+
entry.remote?.target === metadata.target &&
|
|
77
|
+
entry.remote.pid === metadata.pid &&
|
|
78
|
+
entry.remote.identity === metadata.identity &&
|
|
79
|
+
(entry.status === "running" || entry.status === "stopping" || entry.status === "paused"),
|
|
80
|
+
);
|
|
81
|
+
return owner
|
|
82
|
+
? { ...metadata, owned: true, source: owner.source }
|
|
83
|
+
: { ...metadata, owned: false, source: undefined };
|
|
84
|
+
}
|
|
52
85
|
export interface CaptureBackend {
|
|
53
86
|
captureWindow(
|
|
54
87
|
pid: number,
|
|
@@ -100,6 +133,10 @@ export function isExecutableAllowed(command: string): boolean {
|
|
|
100
133
|
return allowedExecutables.has((command.includes("\\") ? windowsName : unixName).toLowerCase());
|
|
101
134
|
}
|
|
102
135
|
|
|
136
|
+
/** Check a native target executable path without treating its filename as command-line text. */
|
|
137
|
+
export function isNativeExecutableAllowed(executable: string): boolean {
|
|
138
|
+
return allowedExecutables.has(executable.slice(executable.lastIndexOf("/") + 1).toLowerCase());
|
|
139
|
+
}
|
|
103
140
|
/** Parses image and sequence view strings with named capture parameters. */
|
|
104
141
|
export function parseVisionView(
|
|
105
142
|
views: readonly string[] | undefined,
|
|
@@ -177,7 +214,11 @@ export async function listProcesses(registry: AgentIdeProcessRegistry): Promise<
|
|
|
177
214
|
const owned = new Map(
|
|
178
215
|
registry
|
|
179
216
|
.list()
|
|
180
|
-
.flatMap((process) =>
|
|
217
|
+
.flatMap((process) =>
|
|
218
|
+
process.remote !== undefined || process.pid === undefined
|
|
219
|
+
? []
|
|
220
|
+
: [[process.pid, process] as const],
|
|
221
|
+
),
|
|
181
222
|
);
|
|
182
223
|
if (process.platform !== "linux" && process.platform !== "darwin") {
|
|
183
224
|
return [...owned].map(([pid, item]) => ({
|
package/src/post-edit/gate.ts
CHANGED
|
@@ -11,7 +11,10 @@ import type {
|
|
|
11
11
|
export async function runIdePostEditGate(
|
|
12
12
|
transaction: TextPostEditTransaction,
|
|
13
13
|
): Promise<{ formatting: MutationFormatting } & Partial<TextPostEditStatusContribution>> {
|
|
14
|
-
if (
|
|
14
|
+
if (
|
|
15
|
+
!path.isAbsolute(transaction.resourceSource) &&
|
|
16
|
+
!transaction.resourceSource.startsWith("ssh://")
|
|
17
|
+
)
|
|
15
18
|
return { formatting: { status: "unavailable" } };
|
|
16
19
|
let formatterName: string | undefined;
|
|
17
20
|
try {
|
package/src/tips/core.ts
CHANGED
|
@@ -74,13 +74,16 @@ async function collectTip(provider: TipProvider, context: TipContext): Promise<T
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
function isTip(
|
|
77
|
+
function isTip(input: unknown): input is Tip {
|
|
78
|
+
if (typeof input !== "object" || input === null) return false;
|
|
79
|
+
const value = input as Record<string, unknown>;
|
|
78
80
|
return (
|
|
79
81
|
typeof value.id === "string" &&
|
|
80
82
|
/^[a-z0-9][a-z0-9.-]*$/u.test(value.id) &&
|
|
81
83
|
typeof value.title === "string" &&
|
|
82
84
|
value.title.trim().length > 0 &&
|
|
83
85
|
typeof value.body === "string" &&
|
|
84
|
-
value.body.trim().length > 0
|
|
86
|
+
value.body.trim().length > 0 &&
|
|
87
|
+
(value.scope === undefined || value.scope === "project" || value.scope === "global")
|
|
85
88
|
);
|
|
86
89
|
}
|
package/src/tips/extension.ts
CHANGED
|
@@ -12,12 +12,39 @@ import type { TipContext } from "#src/api/tips.js";
|
|
|
12
12
|
import { TipCallout } from "./tip-callout.js";
|
|
13
13
|
import { TipCore } from "./core.js";
|
|
14
14
|
import { normalizeProjectPath, TipStateStore } from "./persistence.js";
|
|
15
|
+
import { createSetupHintProvider } from "./setup-hint.js";
|
|
15
16
|
|
|
16
17
|
const TIP_ENTRY_TYPE = "pi-agent-ide-startup-tip";
|
|
17
18
|
|
|
18
19
|
/** Registers the built-in startup-tip core and passive TUI renderer. */
|
|
19
|
-
export default function registerTips(pi: ExtensionAPI): void {
|
|
20
|
+
export default async function registerTips(pi: ExtensionAPI): Promise<void> {
|
|
20
21
|
const core = new TipCore();
|
|
22
|
+
const setupHint = createSetupHintProvider(() =>
|
|
23
|
+
pi
|
|
24
|
+
.getCommands()
|
|
25
|
+
.some(
|
|
26
|
+
(command) => command.source === "skill" && command.name === "skill:configure-agent-ide",
|
|
27
|
+
),
|
|
28
|
+
);
|
|
29
|
+
await core.registerProvider(setupHint);
|
|
30
|
+
if (pi.getFlag("pi-agent-ide-developer-mode") === true) {
|
|
31
|
+
pi.registerCommand("agent-ide-tip", {
|
|
32
|
+
description: "Show the Agent IDE setup hint again without resetting its one-time state",
|
|
33
|
+
async handler(_args, context) {
|
|
34
|
+
if (context.mode !== "tui" || !context.hasUI) return;
|
|
35
|
+
const tip = await setupHint.getTip({
|
|
36
|
+
cwd: context.cwd,
|
|
37
|
+
mode: context.mode,
|
|
38
|
+
hasUI: context.hasUI,
|
|
39
|
+
signal: context.signal,
|
|
40
|
+
reason: "startup",
|
|
41
|
+
});
|
|
42
|
+
if (tip) pi.appendEntry(TIP_ENTRY_TYPE, tip);
|
|
43
|
+
else
|
|
44
|
+
context.ui.notify("The Agent IDE setup skill is not available in this session.", "info");
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
}
|
|
21
48
|
const state = new TipStateStore();
|
|
22
49
|
pi.registerEntryRenderer(TIP_ENTRY_TYPE, (entry, _options, theme) => {
|
|
23
50
|
const tip = entry.data as { readonly title?: string; readonly body?: string };
|
|
@@ -86,8 +113,9 @@ async function displayTip(
|
|
|
86
113
|
return;
|
|
87
114
|
}
|
|
88
115
|
|
|
89
|
-
const project = normalizeProjectPath(context.cwd);
|
|
90
116
|
for (const contribution of contributions) {
|
|
117
|
+
const project =
|
|
118
|
+
contribution.tip.scope === "global" ? undefined : normalizeProjectPath(context.cwd);
|
|
91
119
|
const identity = tipIdentity(contribution.providerId, contribution.tip.id);
|
|
92
120
|
if (!(await state.claimIfUnseen(project, identity, contribution.tip.id))) {
|
|
93
121
|
continue;
|
package/src/tips/persistence.ts
CHANGED
|
@@ -13,6 +13,7 @@ let writeQueue = Promise.resolve();
|
|
|
13
13
|
interface TipState {
|
|
14
14
|
readonly version: 1;
|
|
15
15
|
readonly projects: Record<string, readonly string[]>;
|
|
16
|
+
readonly global?: readonly string[];
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
/** Returns the global, configurable startup-tip state path. */
|
|
@@ -27,15 +28,15 @@ Stores shown tips globally while treating malformed or unwritable state as empty
|
|
|
27
28
|
export class TipStateStore {
|
|
28
29
|
public constructor(private readonly statePath = resolveTipStatePath()) {}
|
|
29
30
|
|
|
30
|
-
/** Returns IDs
|
|
31
|
-
public async shownFor(project
|
|
31
|
+
/** Returns IDs shown for a project, or across the installation when omitted. */
|
|
32
|
+
public async shownFor(project?: string): Promise<ReadonlySet<string>> {
|
|
32
33
|
const state = await readState(this.statePath);
|
|
33
|
-
return new Set(state
|
|
34
|
+
return new Set(shownIds(state, project));
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
/** Claims a
|
|
37
|
+
/** Claims a tip for a project, or across the installation when project is undefined. */
|
|
37
38
|
public async claimIfUnseen(
|
|
38
|
-
project: string,
|
|
39
|
+
project: string | undefined,
|
|
39
40
|
tipIdentity: string,
|
|
40
41
|
legacyTipId?: string,
|
|
41
42
|
): Promise<boolean> {
|
|
@@ -43,7 +44,7 @@ export class TipStateStore {
|
|
|
43
44
|
try {
|
|
44
45
|
return await withStateLock(this.statePath, async () => {
|
|
45
46
|
const state = await readState(this.statePath);
|
|
46
|
-
const existing = new Set(state
|
|
47
|
+
const existing = new Set(shownIds(state, project));
|
|
47
48
|
if (
|
|
48
49
|
existing.has(tipIdentity) ||
|
|
49
50
|
(legacyTipId !== undefined && existing.has(legacyTipId))
|
|
@@ -52,11 +53,7 @@ export class TipStateStore {
|
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
existing.add(tipIdentity);
|
|
55
|
-
|
|
56
|
-
version: STATE_VERSION,
|
|
57
|
-
projects: { ...state.projects, [project]: [...existing] },
|
|
58
|
-
};
|
|
59
|
-
await writeState(this.statePath, next);
|
|
56
|
+
await writeState(this.statePath, withShown(state, project, [...existing]));
|
|
60
57
|
return true;
|
|
61
58
|
});
|
|
62
59
|
} catch {
|
|
@@ -71,8 +68,8 @@ export class TipStateStore {
|
|
|
71
68
|
return claim;
|
|
72
69
|
}
|
|
73
70
|
|
|
74
|
-
/**
|
|
75
|
-
public async markShown(project: string, tipIds: readonly string[]): Promise<void> {
|
|
71
|
+
/** Records shown IDs in the chosen scope; persistence failures are ignored. */
|
|
72
|
+
public async markShown(project: string | undefined, tipIds: readonly string[]): Promise<void> {
|
|
76
73
|
if (tipIds.length === 0) {
|
|
77
74
|
return;
|
|
78
75
|
}
|
|
@@ -80,16 +77,12 @@ export class TipStateStore {
|
|
|
80
77
|
const update = writeQueue.then(async () => {
|
|
81
78
|
await withStateLock(this.statePath, async () => {
|
|
82
79
|
const state = await readState(this.statePath);
|
|
83
|
-
const existing = new Set(state
|
|
80
|
+
const existing = new Set(shownIds(state, project));
|
|
84
81
|
for (const tipId of tipIds) {
|
|
85
82
|
existing.add(tipId);
|
|
86
83
|
}
|
|
87
84
|
|
|
88
|
-
|
|
89
|
-
version: STATE_VERSION,
|
|
90
|
-
projects: { ...state.projects, [project]: [...existing] },
|
|
91
|
-
};
|
|
92
|
-
await writeState(this.statePath, next);
|
|
85
|
+
await writeState(this.statePath, withShown(state, project, [...existing]));
|
|
93
86
|
});
|
|
94
87
|
});
|
|
95
88
|
writeQueue = update.catch(() => {});
|
|
@@ -97,21 +90,17 @@ export class TipStateStore {
|
|
|
97
90
|
}
|
|
98
91
|
|
|
99
92
|
/** Removes a failed claim without blocking startup when persistence is unavailable. */
|
|
100
|
-
public async unmarkShown(project: string, tipIdentity: string): Promise<void> {
|
|
93
|
+
public async unmarkShown(project: string | undefined, tipIdentity: string): Promise<void> {
|
|
101
94
|
const update = writeQueue.then(async () => {
|
|
102
95
|
try {
|
|
103
96
|
await withStateLock(this.statePath, async () => {
|
|
104
97
|
const state = await readState(this.statePath);
|
|
105
|
-
const existing = new Set(state
|
|
98
|
+
const existing = new Set(shownIds(state, project));
|
|
106
99
|
if (!existing.delete(tipIdentity)) {
|
|
107
100
|
return;
|
|
108
101
|
}
|
|
109
102
|
|
|
110
|
-
|
|
111
|
-
version: STATE_VERSION,
|
|
112
|
-
projects: { ...state.projects, [project]: [...existing] },
|
|
113
|
-
};
|
|
114
|
-
await writeState(this.statePath, next);
|
|
103
|
+
await writeState(this.statePath, withShown(state, project, [...existing]));
|
|
115
104
|
});
|
|
116
105
|
} catch {
|
|
117
106
|
// State is an optimization. Never block startup on a failed cleanup.
|
|
@@ -122,6 +111,16 @@ export class TipStateStore {
|
|
|
122
111
|
}
|
|
123
112
|
}
|
|
124
113
|
|
|
114
|
+
function shownIds(state: TipState, project: string | undefined): readonly string[] {
|
|
115
|
+
return project === undefined ? (state.global ?? []) : (state.projects[project] ?? []);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function withShown(state: TipState, project: string | undefined, ids: readonly string[]): TipState {
|
|
119
|
+
return project === undefined
|
|
120
|
+
? { ...state, global: ids }
|
|
121
|
+
: { ...state, projects: { ...state.projects, [project]: ids } };
|
|
122
|
+
}
|
|
123
|
+
|
|
125
124
|
/** Normalizes a project path for use as a state key. */
|
|
126
125
|
export function normalizeProjectPath(project: string): string {
|
|
127
126
|
return path.resolve(project);
|
|
@@ -214,7 +213,10 @@ function isState(value: unknown): value is TipState {
|
|
|
214
213
|
if (
|
|
215
214
|
record.version !== STATE_VERSION ||
|
|
216
215
|
typeof record.projects !== "object" ||
|
|
217
|
-
record.projects === null
|
|
216
|
+
record.projects === null ||
|
|
217
|
+
Array.isArray(record.projects) ||
|
|
218
|
+
(record.global !== undefined &&
|
|
219
|
+
(!Array.isArray(record.global) || !record.global.every((tip) => typeof tip === "string")))
|
|
218
220
|
) {
|
|
219
221
|
return false;
|
|
220
222
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TIP_API_VERSION, TIP_PROTOCOL, type TipProvider } from "#src/api/tips.js";
|
|
2
|
+
|
|
3
|
+
/** Creates a global setup hint when the setup skill is available in an interactive session. */
|
|
4
|
+
export function createSetupHintProvider(hasSkill: () => boolean): TipProvider {
|
|
5
|
+
return {
|
|
6
|
+
protocol: TIP_PROTOCOL,
|
|
7
|
+
apiVersion: TIP_API_VERSION,
|
|
8
|
+
id: "agent-setup",
|
|
9
|
+
getTip(context) {
|
|
10
|
+
if (context.mode !== "tui" || !context.hasUI || !hasSkill()) return undefined;
|
|
11
|
+
return {
|
|
12
|
+
id: "agent-setup-v1",
|
|
13
|
+
scope: "global",
|
|
14
|
+
title: "Agent-assisted setup",
|
|
15
|
+
body: "You can ask your agent to configure Pi Agent IDE.\nTry: “Help me configure Pi Agent IDE for this project.”\nOr open /agent-ide-settings.",
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
}
|
package/src/toolchain/types.ts
CHANGED
package/dist/chunk-3YK4XMWB.js
DELETED
|
File without changes
|