pi-agent-ide 0.8.4 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +59 -0
- package/README.md +24 -29
- package/dist/{chunk-CM3XGY72.js → chunk-2AY526TN.js} +1 -1
- package/dist/{chunk-LEJKDYCK.js → chunk-2TZDG2JH.js} +1 -1
- package/dist/{chunk-XBQR74IK.js → chunk-4GBFIGH3.js} +1 -1
- package/dist/{chunk-PJL3UVMJ.js → chunk-4IWEKRSP.js} +1 -1
- package/dist/chunk-52PFWQMU.js +5 -0
- package/dist/chunk-5BGWNYQS.js +1 -0
- package/dist/{chunk-QUYXINGZ.js → chunk-5S74Z6Y4.js} +3 -3
- package/dist/chunk-64JTD2DJ.js +1 -0
- package/dist/{chunk-XAHU42FP.js → chunk-6A3ORNW3.js} +2 -2
- package/dist/{chunk-ANM3Y5FO.js → chunk-6WCHBHFW.js} +5 -5
- package/dist/{chunk-IMGIDBCC.js → chunk-7D7PXIVV.js} +1 -1
- package/dist/chunk-7PVDTMEM.js +1 -0
- package/dist/chunk-7SG756UO.js +4 -0
- package/dist/{chunk-GBUJOR6V.js → chunk-7URANI6I.js} +14 -14
- package/dist/{chunk-Z2MNHSJ4.js → chunk-AJZVKDYC.js} +1 -1
- package/dist/chunk-AMIIOWFL.js +1 -0
- package/dist/{chunk-TOYN4W4F.js → chunk-B25LXXNV.js} +1 -1
- package/dist/chunk-C2JT2G5K.js +1 -0
- package/dist/chunk-CVOYSEBE.js +1 -0
- package/dist/chunk-DDH3FP4G.js +3 -0
- package/dist/chunk-FEZLTM4L.js +1 -0
- package/dist/{chunk-CPELC6JE.js → chunk-FHRHYY4M.js} +1 -1
- package/dist/chunk-FKKAHI62.js +11 -0
- package/dist/chunk-FS3KCKFX.js +9 -0
- package/dist/chunk-FYOU4RBH.js +2 -0
- package/dist/chunk-G4PRFO6G.js +1 -0
- package/dist/chunk-GS5ZRTUG.js +1 -0
- package/dist/{chunk-XXLLY66B.js → chunk-GXL4NMHR.js} +1 -1
- package/dist/{chunk-QT3EAHOG.js → chunk-H3GEEOOL.js} +1 -1
- package/dist/chunk-H5Z54BEU.js +25 -0
- package/dist/chunk-H7WAM5RH.js +23 -0
- package/dist/chunk-HT7LZN5A.js +9 -0
- package/dist/chunk-IG5DXVDJ.js +1 -0
- package/dist/chunk-K4UTEMDU.js +1 -0
- package/dist/chunk-KFBRL2V4.js +3 -0
- package/dist/chunk-KN6VPARZ.js +1 -0
- package/dist/{chunk-RW2GTYQI.js → chunk-LF325WYO.js} +1 -1
- package/dist/chunk-LTADNZKW.js +2 -0
- package/dist/{chunk-YJ6T3PEP.js → chunk-MDD5ORB6.js} +1 -1
- package/dist/{chunk-S72FVLUX.js → chunk-MLFJU2US.js} +1 -1
- package/dist/chunk-NA2NEU4V.js +1 -0
- package/dist/chunk-OBTT5INC.js +6 -0
- package/dist/{chunk-IICJXZBU.js → chunk-OMNKD7WW.js} +3 -3
- package/dist/chunk-PLMHBXWI.js +10 -0
- package/dist/{chunk-235QMMVA.js → chunk-PQWANILR.js} +1 -1
- package/dist/{chunk-QRJLIV6P.js → chunk-QJ6V5IAY.js} +6 -6
- package/dist/chunk-QM5WDEFI.js +1 -0
- package/dist/{chunk-SMIFCAAX.js → chunk-RIJRPAL2.js} +1 -1
- package/dist/chunk-RIOPUTUJ.js +6 -0
- package/dist/chunk-RVFMH77U.js +82 -0
- package/dist/{chunk-NJ7C4KMA.js → chunk-SRFWT562.js} +1 -1
- package/dist/{chunk-U22JNO6N.js → chunk-STUZZM5B.js} +1 -1
- package/dist/{chunk-PT35ZFLH.js → chunk-TNAUCNUT.js} +12 -12
- package/dist/{chunk-DUUOCBS3.js → chunk-TVH2ND35.js} +1 -1
- package/dist/chunk-TVSZYABY.js +5 -0
- package/dist/chunk-TVXZE4KW.js +4 -0
- package/dist/chunk-U7YDLVFL.js +1 -0
- package/dist/{chunk-KZC7TI5M.js → chunk-UD3DMY3Q.js} +1 -1
- package/dist/{chunk-VXP5BMW7.js → chunk-USG6WHAT.js} +1 -1
- package/dist/{chunk-RMI3NMQY.js → chunk-V4J3TLCV.js} +2 -2
- package/dist/{chunk-ZPT5D4VP.js → chunk-VDJSH3DQ.js} +2 -2
- package/dist/{chunk-VMTOFEXF.js → chunk-VMLPXSMK.js} +1 -1
- package/dist/{chunk-6T7PSDQW.js → chunk-VN3XBH2Q.js} +1 -1
- package/dist/chunk-WAJW4G4F.js +22 -0
- package/dist/chunk-WEE3NM6L.js +1 -0
- package/dist/{chunk-IM24DB3K.js → chunk-WES2E4VR.js} +1 -1
- package/dist/{chunk-RIJMXO43.js → chunk-WQIMM4SU.js} +1 -1
- package/dist/chunk-WUO3UW4J.js +17 -0
- package/dist/chunk-XE4W5YTE.js +2 -0
- package/dist/chunk-XUYIK4TX.js +1 -0
- package/dist/{chunk-ZJQRLVVV.js → chunk-Y74EKJOY.js} +1 -1
- package/dist/{chunk-AAC77UD4.js → chunk-YPYROPQF.js} +1 -1
- package/dist/chunk-ZXO4D5UB.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-12.js +1 -1
- package/dist/entry-13.js +1 -1
- package/dist/entry-14.js +1 -1
- package/dist/entry-15.js +1 -1
- package/dist/entry-16.js +1 -1
- package/dist/entry-17.js +1 -1
- package/dist/entry-18.js +1 -1
- package/dist/entry-19.js +1 -1
- package/dist/entry-2.js +1 -1
- package/dist/entry-20.js +1 -1
- package/dist/entry-21.js +1 -0
- package/dist/entry-23.js +1 -1
- package/dist/entry-24.js +1 -1
- package/dist/entry-25.js +1 -1
- package/dist/entry-26.js +1 -1
- package/dist/entry-27.js +1 -1
- package/dist/entry-28.js +1 -1
- package/dist/entry-29.js +1 -2
- package/dist/entry-3.js +1 -1
- package/dist/entry-30.js +2 -1
- package/dist/entry-31.js +1 -4
- package/dist/entry-32.js +1 -1
- package/dist/entry-33.js +1 -1
- package/dist/entry-34.js +1 -1
- package/dist/entry-35.js +1 -18
- package/dist/entry-36.js +1 -1
- package/dist/entry-37.js +15 -1
- package/dist/entry-38.js +1 -1
- package/dist/entry-39.js +1 -1
- package/dist/entry-4.js +1 -1
- package/dist/entry-40.js +1 -1
- package/dist/entry-41.js +1 -1
- package/dist/entry-42.js +1 -1
- package/dist/entry-43.js +1 -1
- package/dist/entry-44.js +1 -1
- package/dist/entry-45.js +1 -1
- package/dist/entry-46.js +1 -1
- package/dist/entry-47.js +1 -1
- package/dist/entry-48.js +1 -1
- package/dist/entry-49.js +1 -25
- package/dist/entry-5.js +1 -1
- package/dist/entry-50.js +1 -1
- package/dist/entry-51.js +1 -1
- package/dist/entry-52.js +1 -1
- package/dist/entry-53.js +1 -1
- package/dist/entry-54.js +1 -3
- package/dist/entry-55.js +1 -13
- package/dist/entry-56.js +1 -1
- package/dist/entry-57.js +1 -1
- package/dist/entry-58.js +1 -1
- package/dist/entry-59.js +1 -1
- package/dist/entry-6.js +1 -1
- package/dist/entry-60.js +1 -1
- package/dist/entry-61.js +1 -1
- package/dist/entry-62.js +1 -1
- package/dist/entry-63.js +1 -1
- package/dist/entry-64.js +1 -1
- package/dist/entry-65.js +1 -0
- package/dist/entry-66.js +1 -1
- package/dist/entry-68.js +1 -1
- package/dist/entry-69.js +0 -1
- package/dist/entry-7.js +1 -1
- package/dist/entry-70.js +1 -1
- package/dist/entry-71.js +1 -1
- package/dist/entry-72.js +1 -1
- package/dist/entry-73.js +1 -1
- package/dist/entry-74.js +1 -1
- package/dist/entry-75.js +1 -0
- package/dist/entry-76.js +1 -1
- package/dist/entry-78.js +1 -1
- package/dist/entry-79.js +0 -1
- package/dist/entry-8.js +1 -1
- package/dist/entry-80.js +1 -1
- package/dist/entry-81.js +1 -80
- package/dist/entry-82.js +1 -22
- package/dist/entry-83.js +1 -2
- package/dist/entry-84.js +1 -1
- package/dist/entry-85.js +2 -1
- package/dist/entry-86.js +1 -1
- package/dist/entry-87.js +1 -1
- package/dist/entry-88.js +1 -3
- package/dist/entry-89.js +1 -1
- package/dist/entry-9.js +1 -1
- package/dist/entry-90.js +3 -1
- package/dist/entry-91.js +1 -1
- package/dist/entry-92.js +1 -0
- package/dist/entry-93.js +1 -0
- package/dist/pi-agent-ide.js +10 -34
- package/docs/agent-guides/ast-search.md +58 -0
- package/docs/agent-guides/debugger.md +1 -1
- package/docs/agent-guides/editing.md +26 -58
- package/docs/agent-guides/git-changes.md +4 -14
- package/docs/agent-guides/search.md +38 -0
- package/docs/agent-guides/ssh.md +17 -49
- package/docs/agent-guides/terminal.md +9 -15
- package/docs/configuration.md +9 -13
- package/docs/extensions.md +82 -0
- package/docs/settings-help.md +2 -2
- package/docs/structured-results.md +33 -11
- package/docs/tools.md +23 -22
- package/node_modules/pi-agent-doctor/package.json +7 -7
- package/node_modules/pi-agent-doctor/src/workspace.ts +0 -5
- package/node_modules/pi-agent-documentation/package.json +2 -2
- package/node_modules/pi-agent-documentation/runtime/entry-29.js +1 -0
- package/node_modules/pi-agent-documentation/src/index.ts +26 -10
- package/node_modules/pi-agent-filesystem/index.ts +1 -1
- package/node_modules/pi-agent-filesystem/package.json +8 -8
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- package/node_modules/pi-agent-filesystem-jq/index.ts +9 -63
- package/node_modules/pi-agent-filesystem-jq/package.json +12 -6
- package/node_modules/pi-agent-filesystem-jq/runtime/entry-32.js +1 -0
- package/node_modules/pi-agent-filesystem-jq/src/api/jq.ts +112 -0
- package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
- package/node_modules/pi-agent-filesystem-pdf/runtime/entry-34.js +2 -0
- package/node_modules/pi-agent-filesystem-text/package.json +4 -4
- package/node_modules/pi-agent-ide-ast/package.json +15 -15
- package/node_modules/pi-agent-ide-ast/src/extension.ts +8 -8
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +104 -26
- package/node_modules/pi-agent-ide-ast/src/tool-ast-search.ts +210 -0
- package/node_modules/pi-agent-ide-changes/index.ts +1 -2
- package/node_modules/pi-agent-ide-changes/package.json +10 -10
- package/node_modules/pi-agent-ide-changes/runtime/entry-38.js +1 -0
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +3 -3
- package/node_modules/pi-agent-ide-formatter/package.json +4 -4
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-lint/package.json +8 -8
- package/node_modules/pi-agent-ide-lint/runtime/entry-42.js +2 -0
- package/node_modules/pi-agent-ide-lsp/index.ts +22 -28
- package/node_modules/pi-agent-ide-lsp/package.json +14 -10
- package/node_modules/pi-agent-ide-lsp/runtime/entry-43.js +2 -0
- package/node_modules/pi-agent-ide-lsp/src/declaration-targets.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/src/lsp/code-views.ts +8 -84
- package/node_modules/pi-agent-ide-lsp/src/lsp/index.ts +1 -6
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +11 -11
- package/node_modules/pi-agent-ide-lsp/src/manager-provider.ts +8 -0
- package/node_modules/pi-agent-ide-lsp/src/rename-plan.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +234 -36
- package/node_modules/pi-agent-ide-lsp/src/tool-lsp-search.ts +212 -0
- package/node_modules/pi-agent-image/package.json +3 -3
- package/node_modules/pi-agent-image/src/image-converter.ts +24 -1
- package/node_modules/pi-agent-invariant/package.json +2 -2
- package/node_modules/pi-agent-pdf/package.json +3 -3
- package/node_modules/pi-agent-pdf/src/pdf-converter.ts +23 -1
- package/node_modules/pi-agent-read/package.json +12 -12
- package/node_modules/pi-agent-read/runtime/entry-49.js +0 -1
- package/node_modules/pi-agent-read/runtime/entry-51.js +2 -0
- package/node_modules/pi-agent-read/src/api/read-parameters.ts +4 -7
- package/node_modules/pi-agent-read/src/api/tools/read.ts +2 -0
- package/node_modules/pi-agent-read/src/core/extension.ts +0 -8
- package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +47 -14
- package/node_modules/pi-agent-read/src/core/tools/read/result-target.ts +3 -1
- package/node_modules/pi-agent-read/src/core/tools/read/structured-result.ts +14 -2
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +21 -8
- package/node_modules/pi-agent-resource/package.json +2 -2
- package/node_modules/pi-agent-resource/src/index.ts +8 -0
- package/node_modules/pi-agent-resource/src/resource-error-metadata.ts +89 -0
- package/node_modules/pi-agent-resource/src/resource-error.ts +6 -1
- package/node_modules/pi-agent-resource/src/result-images.ts +87 -0
- package/node_modules/pi-agent-resource/src/result-targets.ts +9 -3
- package/node_modules/pi-agent-resource/src/tool-result.ts +17 -0
- package/node_modules/pi-agent-search/package.json +9 -9
- package/node_modules/pi-agent-search/runtime/entry-54.js +0 -1
- package/node_modules/pi-agent-search/runtime/entry-55.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-56.js +2 -0
- package/node_modules/pi-agent-search/src/api/glob-list.ts +35 -0
- package/node_modules/pi-agent-search/src/api/search-parameters.ts +8 -8
- package/node_modules/pi-agent-search/src/api/search.ts +14 -2
- package/node_modules/pi-agent-search/src/core/extension.ts +11 -20
- package/node_modules/pi-agent-search/src/core/search-core.ts +30 -10
- package/node_modules/pi-agent-search-text/index.ts +34 -12
- package/node_modules/pi-agent-search-text/package.json +17 -15
- package/node_modules/pi-agent-search-text/runtime/entry-57.js +1 -0
- package/node_modules/pi-agent-search-text/runtime/entry-60.js +1 -0
- package/node_modules/pi-agent-search-text/src/file-search.ts +59 -25
- package/node_modules/pi-agent-search-text/src/resolvers.ts +61 -16
- package/node_modules/pi-agent-search-text/src/scoped-search.ts +9 -3
- package/node_modules/pi-agent-search-text/src/search-backend.ts +44 -48
- package/node_modules/pi-agent-search-text/src/search-presentation.ts +19 -15
- package/node_modules/pi-agent-search-text/src/search-recipe.ts +2 -1
- package/node_modules/pi-agent-search-text/src/search-result.ts +6 -2
- package/node_modules/pi-agent-search-text/src/search-session.ts +1 -0
- package/node_modules/pi-agent-search-text/src/tool-file-search.ts +146 -0
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text/src/text-converter.ts +1 -1
- package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
- package/node_modules/pi-agent-text-anchor-exact/package.json +5 -5
- package/node_modules/pi-agent-text-anchor-exact/src/anchor.ts +6 -1
- package/node_modules/pi-agent-text-anchor-line-hash/index.ts +1 -2
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-66.js +2 -0
- package/node_modules/pi-agent-text-editor/package.json +26 -26
- package/node_modules/pi-agent-text-editor/runtime/entry-81.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-82.js +1 -0
- package/node_modules/pi-agent-text-editor/src/api/edit-pipeline.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +23 -0
- package/node_modules/pi-agent-text-editor/src/api/text-selection-anchor.ts +31 -1
- package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +11 -21
- package/node_modules/pi-agent-text-editor/src/core/editing-guidelines.ts +5 -5
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +13 -7
- package/node_modules/pi-agent-text-editor/src/core/file-operation-guards.ts +22 -4
- package/node_modules/pi-agent-text-editor/src/core/image-write.ts +111 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +3 -0
- package/node_modules/pi-agent-text-editor/src/core/structured-result.ts +5 -1
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +8 -2
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +103 -20
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +146 -62
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +14 -19
- package/node_modules/pi-agent-text-editor/src/tools/text-selection.ts +43 -12
- package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +5 -5
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +6 -5
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +3 -7
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +6 -8
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +9 -6
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +3 -4
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +37 -22
- package/node_modules/pi-agent-text-editor-renderer/index.ts +6 -1
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-84.js +2 -0
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +18 -5
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +6 -6
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-85.js +2 -0
- package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
- package/node_modules/pi-agent-tool-ui/package.json +3 -3
- package/node_modules/pi-agent-tool-ui/runtime/entry-87.js +1 -0
- package/node_modules/pi-agent-tool-ui/runtime/entry-88.js +1 -0
- package/node_modules/pi-agent-web/index.ts +28 -6
- package/node_modules/pi-agent-web/package.json +8 -8
- package/node_modules/pi-agent-web-html/package.json +3 -3
- package/node_modules/pi-agent-web-html/src/html-converter.ts +1 -1
- 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-92.js +2 -0
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-93.js +2 -0
- package/package.json +61 -58
- package/src/api/approval.ts +2 -0
- package/src/api/read.ts +2 -0
- package/src/api/standalone.ts +7 -0
- package/src/backend/doctor-workspace.ts +0 -3
- package/src/backend/process-metadata-worker.py +9 -18
- package/src/backend/process-metadata.ts +11 -44
- package/src/backend/registration.ts +0 -10
- package/src/backend/web-browser-worker.mjs +2 -17
- package/src/backend/web-browser.ts +1 -26
- package/src/composite/builtin-extensions.ts +8 -6
- package/src/composite/ide-alias-rendering.ts +18 -2
- package/src/composite/module-labels.ts +0 -4
- package/src/composite/preferences.ts +0 -36
- package/src/composite/settings-documentation.ts +1 -2
- package/src/composite/text-results.ts +61 -23
- package/src/documentation/extension.ts +39 -15
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +1 -1
- 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 +9 -63
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +12 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-32.js +1 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/src/api/jq.ts +112 -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-34.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-35.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-30.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +28 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -8
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/src/html-converter.ts +1 -1
- 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-92.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-93.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-89.js +2 -0
- package/src/extensions/pi-agent-read/package.json +12 -12
- package/src/extensions/pi-agent-read/runtime/entry-49.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-50.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-51.js +2 -0
- package/src/extensions/pi-agent-read/src/api/read-parameters.ts +4 -7
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +2 -0
- package/src/extensions/pi-agent-read/src/core/extension.ts +0 -8
- package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +47 -14
- package/src/extensions/pi-agent-read/src/core/tools/read/result-target.ts +3 -1
- package/src/extensions/pi-agent-read/src/core/tools/read/structured-result.ts +14 -2
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +21 -8
- package/src/extensions/pi-agent-search/package.json +9 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +34 -12
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +17 -15
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-57.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-59.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-60.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/file-search.ts +59 -25
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +61 -16
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/scoped-search.ts +9 -3
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +44 -48
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-presentation.ts +19 -15
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +2 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +6 -2
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/tool-file-search.ts +146 -0
- package/src/extensions/pi-agent-search/runtime/entry-54.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-55.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-56.js +2 -0
- package/src/extensions/pi-agent-search/src/api/glob-list.ts +35 -0
- package/src/extensions/pi-agent-search/src/api/search-parameters.ts +8 -8
- package/src/extensions/pi-agent-search/src/api/search.ts +14 -2
- package/src/extensions/pi-agent-search/src/core/extension.ts +11 -20
- package/src/extensions/pi-agent-search/src/core/search-core.ts +30 -10
- package/src/extensions/pi-agent-text-editor/package.json +26 -26
- 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 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/anchor.ts +6 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +1 -2
- 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-65.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-66.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +6 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-84.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +18 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +6 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-85.js +2 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-81.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-82.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-83.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/edit-pipeline.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +23 -0
- package/src/extensions/pi-agent-text-editor/src/api/text-selection-anchor.ts +31 -1
- package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +11 -21
- package/src/extensions/pi-agent-text-editor/src/core/editing-guidelines.ts +5 -5
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +13 -7
- package/src/extensions/pi-agent-text-editor/src/core/file-operation-guards.ts +22 -4
- package/src/extensions/pi-agent-text-editor/src/core/image-write.ts +111 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +3 -0
- package/src/extensions/pi-agent-text-editor/src/core/structured-result.ts +5 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +8 -2
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +103 -20
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +146 -62
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +14 -19
- package/src/extensions/pi-agent-text-editor/src/tools/text-selection.ts +43 -12
- package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +5 -5
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +6 -5
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +3 -7
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +6 -8
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +9 -6
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +3 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +37 -22
- package/src/pi-agent-ide.ts +8 -15
- package/src/plugins/pi-agent-ide-ast/package.json +15 -15
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +8 -8
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +104 -26
- package/src/plugins/pi-agent-ide-ast/src/tool-ast-search.ts +210 -0
- package/src/plugins/pi-agent-ide-changes/index.ts +1 -2
- package/src/plugins/pi-agent-ide-changes/package.json +10 -10
- package/src/plugins/pi-agent-ide-changes/runtime/entry-38.js +1 -0
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +3 -3
- package/src/plugins/pi-agent-ide-debugger/index.ts +17 -4
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +2 -11
- package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-lint/package.json +8 -8
- package/src/plugins/pi-agent-ide-lint/runtime/entry-42.js +2 -0
- package/src/plugins/pi-agent-ide-lsp/index.ts +22 -28
- package/src/plugins/pi-agent-ide-lsp/package.json +14 -10
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-43.js +2 -0
- package/src/plugins/pi-agent-ide-lsp/src/declaration-targets.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/src/lsp/code-views.ts +8 -84
- package/src/plugins/pi-agent-ide-lsp/src/lsp/index.ts +1 -6
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +11 -11
- package/src/plugins/pi-agent-ide-lsp/src/manager-provider.ts +8 -0
- package/src/plugins/pi-agent-ide-lsp/src/rename-plan.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +234 -36
- package/src/plugins/pi-agent-ide-lsp/src/tool-lsp-search.ts +212 -0
- package/src/plugins/pi-agent-ide-processes/src/ui.ts +61 -16
- package/src/plugins/pi-agent-ide-terminal/index.ts +1 -1
- package/src/plugins/pi-agent-ide-terminal/src/resources.ts +10 -7
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +1 -3
- package/src/standalone/resource-host.ts +147 -0
- package/src/standalone/scoped-api.ts +457 -0
- package/dist/chunk-2RTCSZB3.js +0 -1
- package/dist/chunk-4DIUPEDF.js +0 -2
- package/dist/chunk-6EDOLYOV.js +0 -1
- package/dist/chunk-6FGLAVPJ.js +0 -1
- package/dist/chunk-6H32W35W.js +0 -1
- package/dist/chunk-6OJ565FL.js +0 -2
- package/dist/chunk-6R3Y4AD3.js +0 -1
- package/dist/chunk-6TJPMBUQ.js +0 -1
- package/dist/chunk-6XFUICD7.js +0 -1
- package/dist/chunk-BHSO2MDK.js +0 -6
- package/dist/chunk-GSOYVIQS.js +0 -1
- package/dist/chunk-HSRH76JN.js +0 -3
- package/dist/chunk-HSZ4AQ6L.js +0 -9
- package/dist/chunk-I6NPILT5.js +0 -1
- package/dist/chunk-K7SRNBIV.js +0 -1
- package/dist/chunk-LCWBVOII.js +0 -3
- package/dist/chunk-MKEC3U2M.js +0 -4
- package/dist/chunk-NUM3YQGK.js +0 -1
- package/dist/chunk-OM4LYD3S.js +0 -1
- package/dist/chunk-PLKYHUNT.js +0 -1
- package/dist/chunk-QIJMV2P2.js +0 -2
- package/dist/chunk-RVU73VKN.js +0 -2
- package/dist/chunk-SDAH3ECM.js +0 -5
- package/dist/chunk-SGQWRIRJ.js +0 -10
- package/dist/chunk-SWBJS3U4.js +0 -1
- package/dist/chunk-T7I2VX3J.js +0 -1
- package/dist/chunk-T7MWQQIF.js +0 -3
- package/dist/chunk-VDP5CQHM.js +0 -3
- package/dist/chunk-XG7QNAKW.js +0 -9
- package/dist/chunk-XLWCSJMR.js +0 -1
- package/dist/chunk-YFP4P2FV.js +0 -1
- package/dist/chunk-YIXP2ALP.js +0 -9
- package/dist/entry-22.js +0 -1
- package/docs/agent-guides/diagnostics.md +0 -5
- package/docs/agent-guides/json-reading.md +0 -57
- package/docs/agent-guides/read-resources.md +0 -17
- package/docs/agent-guides/search-code.md +0 -76
- package/docs/agent-guides/select-code.md +0 -119
- package/docs/agent-guides/vision.md +0 -11
- package/node_modules/pi-agent-doctor/runtime/entry-22.js +0 -1
- package/node_modules/pi-agent-filesystem/runtime/entry-29.js +0 -2
- package/node_modules/pi-agent-filesystem-pdf/runtime/entry-32.js +0 -2
- package/node_modules/pi-agent-ide-ast/runtime/entry-34.js +0 -1
- package/node_modules/pi-agent-ide-ast/src/ast/constructs.ts +0 -193
- package/node_modules/pi-agent-ide-ast/src/ast/element-extent.ts +0 -59
- package/node_modules/pi-agent-ide-ast/src/ast/selection.ts +0 -204
- package/node_modules/pi-agent-ide-ast/src/geometry-selection.ts +0 -184
- package/node_modules/pi-agent-ide-ast/src/select-presentation.ts +0 -105
- package/node_modules/pi-agent-ide-ast/src/select-schema.ts +0 -387
- package/node_modules/pi-agent-ide-ast/src/selection-region.ts +0 -41
- package/node_modules/pi-agent-ide-ast/src/source-text.ts +0 -92
- package/node_modules/pi-agent-ide-ast/src/text-selection.ts +0 -214
- package/node_modules/pi-agent-ide-ast/src/tool-select.ts +0 -277
- package/node_modules/pi-agent-ide-formatter/runtime/entry-38.js +0 -2
- package/node_modules/pi-agent-ide-lsp/src/code-view-resolvers.ts +0 -136
- package/node_modules/pi-agent-image/runtime/entry-42.js +0 -1
- package/node_modules/pi-agent-invariant/runtime/entry-43.js +0 -1
- package/node_modules/pi-agent-search/runtime/entry-51.js +0 -1
- package/node_modules/pi-agent-search-text/runtime/entry-55.js +0 -2
- package/node_modules/pi-agent-search-text/runtime/entry-56.js +0 -1
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-60.js +0 -2
- package/node_modules/pi-agent-text-editor/runtime/entry-66.js +0 -1
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-82.js +0 -2
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-84.js +0 -1
- package/node_modules/pi-agent-tool-ui/runtime/entry-85.js +0 -1
- package/node_modules/pi-agent-web/runtime/entry-87.js +0 -2
- package/node_modules/pi-agent-web-html/runtime/entry-88.js +0 -2
- package/src/backend/vision-capture-worker.py +0 -319
- package/src/backend/vision-capture.ts +0 -165
- package/src/backend/vision-registration.ts +0 -104
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-30.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-32.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-29.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-88.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-89.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-87.js +0 -2
- package/src/extensions/pi-agent-read/runtime/entry-45.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-46.js +0 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-55.js +0 -2
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-56.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-51.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-52.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-60.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-61.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-82.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-83.js +0 -2
- package/src/extensions/pi-agent-text-editor/runtime/entry-65.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-66.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-34.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-35.js +0 -2
- package/src/plugins/pi-agent-ide-ast/src/ast/constructs.ts +0 -193
- package/src/plugins/pi-agent-ide-ast/src/ast/element-extent.ts +0 -59
- package/src/plugins/pi-agent-ide-ast/src/ast/selection.ts +0 -204
- package/src/plugins/pi-agent-ide-ast/src/geometry-selection.ts +0 -184
- package/src/plugins/pi-agent-ide-ast/src/select-presentation.ts +0 -105
- package/src/plugins/pi-agent-ide-ast/src/select-schema.ts +0 -387
- package/src/plugins/pi-agent-ide-ast/src/selection-region.ts +0 -41
- package/src/plugins/pi-agent-ide-ast/src/source-text.ts +0 -92
- package/src/plugins/pi-agent-ide-ast/src/text-selection.ts +0 -214
- package/src/plugins/pi-agent-ide-ast/src/tool-select.ts +0 -277
- package/src/plugins/pi-agent-ide-formatter/runtime/entry-38.js +0 -2
- package/src/plugins/pi-agent-ide-lsp/src/code-view-resolvers.ts +0 -136
- package/src/plugins/pi-agent-ide-vision/index.ts +0 -439
- package/src/plugins/pi-agent-ide-vision/src/doctor-plugin.ts +0 -47
- package/src/plugins/pi-agent-ide-vision/src/vision.ts +0 -585
- package/src/plugins/pi-agent-ide-vision/src/windows-display-capture.ps1 +0 -30
- package/src/plugins/pi-agent-ide-vision/src/windows-window-capture.ps1 +0 -33
- /package/dist/{chunk-U2JKHKLK.js → chunk-3PMHFEJY.js} +0 -0
- /package/node_modules/{pi-agent-documentation → pi-agent-doctor}/runtime/entry-28.js +0 -0
- /package/node_modules/{pi-agent-filesystem-image → pi-agent-filesystem}/runtime/entry-30.js +0 -0
- /package/node_modules/{pi-agent-filesystem-jq → pi-agent-filesystem-image}/runtime/entry-31.js +0 -0
- /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-jq}/runtime/entry-33.js +0 -0
- /package/node_modules/{pi-agent-ide-ast → pi-agent-filesystem-text}/runtime/entry-35.js +0 -0
- /package/node_modules/{pi-agent-ide-changes → pi-agent-ide-ast}/runtime/entry-36.js +0 -0
- /package/node_modules/{pi-agent-ide-changes → pi-agent-ide-ast}/runtime/entry-37.js +0 -0
- /package/node_modules/{pi-agent-ide-languages → pi-agent-ide-changes}/runtime/entry-39.js +0 -0
- /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-formatter}/runtime/entry-40.js +0 -0
- /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-languages}/runtime/entry-41.js +0 -0
- /package/node_modules/{pi-agent-pdf → pi-agent-image}/runtime/entry-44.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-invariant}/runtime/entry-45.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-46.js +0 -0
- /package/node_modules/{pi-agent-resource → pi-agent-read}/runtime/entry-50.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-52.js +0 -0
- /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-59.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-exact → pi-agent-text}/runtime/entry-61.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-exact → pi-agent-text-anchor-constant}/runtime/entry-62.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-exact}/runtime/entry-63.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-exact}/runtime/entry-64.js +0 -0
- /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-line-hash}/runtime/entry-65.js +0 -0
- /package/node_modules/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor}/runtime/entry-83.js +0 -0
- /package/node_modules/{pi-agent-tool-ui → pi-agent-tool-call-interception}/runtime/entry-86.js +0 -0
- /package/node_modules/{pi-agent-web-image → pi-agent-web}/runtime/entry-89.js +0 -0
- /package/node_modules/{pi-agent-web-pdf → pi-agent-web-html}/runtime/entry-90.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web-image}/runtime/entry-91.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-jq → pi-agent-filesystem-image}/runtime/entry-31.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-jq}/runtime/entry-33.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-pdf → pi-agent-web-html}/runtime/entry-90.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-image}/runtime/entry-91.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-anchor-exact → pi-agent-text-anchor-constant}/runtime/entry-62.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-exact}/runtime/entry-63.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-exact}/runtime/entry-64.js +0 -0
- /package/src/plugins/{pi-agent-ide-changes → pi-agent-ide-ast}/runtime/entry-36.js +0 -0
- /package/src/plugins/{pi-agent-ide-changes → pi-agent-ide-ast}/runtime/entry-37.js +0 -0
- /package/src/plugins/{pi-agent-ide-languages → pi-agent-ide-changes}/runtime/entry-39.js +0 -0
- /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-formatter}/runtime/entry-40.js +0 -0
- /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-languages}/runtime/entry-41.js +0 -0
|
@@ -1,439 +0,0 @@
|
|
|
1
|
-
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import { ResultPanel } from "pi-agent-tool-ui";
|
|
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";
|
|
6
|
-
|
|
7
|
-
import type { BuiltinExtensionContext } from "#src/composite/selection.js";
|
|
8
|
-
import { connectReadPlugin } from "pi-agent-read/api/connect-plugin";
|
|
9
|
-
import { READ_API_VERSION, READ_PROTOCOL } from "pi-agent-read/api/plugin-protocol";
|
|
10
|
-
import type { ReadRequest, ReadToolResult } from "pi-agent-read/api/tools/read";
|
|
11
|
-
import { connectSearchPlugin } from "pi-agent-search/api/connect-plugin";
|
|
12
|
-
import { SEARCH_API_VERSION, SEARCH_PROTOCOL } from "pi-agent-search/api/plugin-protocol";
|
|
13
|
-
|
|
14
|
-
import { agentIdeProcessRegistry } from "#src/plugins/pi-agent-ide-processes/src/registry.js";
|
|
15
|
-
import {
|
|
16
|
-
captureImages,
|
|
17
|
-
configureVision,
|
|
18
|
-
createCaptureBackend,
|
|
19
|
-
getVisionDefaults,
|
|
20
|
-
isExecutableAllowed,
|
|
21
|
-
isNativeExecutableAllowed,
|
|
22
|
-
listProcesses,
|
|
23
|
-
parseDisplaySource,
|
|
24
|
-
parseVisionView,
|
|
25
|
-
readProcess,
|
|
26
|
-
type VisionOptions,
|
|
27
|
-
type ProcessMetadata,
|
|
28
|
-
type RemoteProcessMetadata,
|
|
29
|
-
withRemoteProcessOwnership,
|
|
30
|
-
} from "#src/plugins/pi-agent-ide-vision/src/vision.js";
|
|
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
|
-
}
|
|
48
|
-
/** Register process discovery and guarded visual capture resources. */
|
|
49
|
-
export default async function registerVision(
|
|
50
|
-
pi: ExtensionAPI,
|
|
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,
|
|
62
|
-
): Promise<void> {
|
|
63
|
-
connectAgentDocumentation(pi, [
|
|
64
|
-
await loadPackagedAgentGuide({
|
|
65
|
-
id: "vision",
|
|
66
|
-
description: "Window, display, image, and sequence capture",
|
|
67
|
-
triggers: [
|
|
68
|
-
{ tool: "read", resourcePrefixes: ["process:", "window:", "display:"] },
|
|
69
|
-
{ tool: "read", resourcePrefixes: ["web:ssh://"], viewPrefixes: ["image", "sequence"] },
|
|
70
|
-
],
|
|
71
|
-
}),
|
|
72
|
-
]);
|
|
73
|
-
const preferences = context?.preferences ?? {};
|
|
74
|
-
configureVision({
|
|
75
|
-
durationSeconds: preferences["vision.sequenceDurationSeconds"],
|
|
76
|
-
intervalSeconds: preferences["vision.sequenceIntervalSeconds"],
|
|
77
|
-
scale: preferences["vision.imageScale"],
|
|
78
|
-
allowedExecutables: preferences["vision.allowedExecutables"],
|
|
79
|
-
});
|
|
80
|
-
const registry = agentIdeProcessRegistry(pi);
|
|
81
|
-
const backend = createCaptureBackend();
|
|
82
|
-
await Promise.all([
|
|
83
|
-
connectDoctorPlugin(pi, visionDoctorPlugin),
|
|
84
|
-
connectReadPlugin(pi, {
|
|
85
|
-
protocol: READ_PROTOCOL,
|
|
86
|
-
apiVersion: READ_API_VERSION,
|
|
87
|
-
id: "vision",
|
|
88
|
-
setup(api) {
|
|
89
|
-
for (const view of ["image", "sequence"]) {
|
|
90
|
-
api.addView({
|
|
91
|
-
contentKind: "any",
|
|
92
|
-
view,
|
|
93
|
-
presenter: { id: `vision-${view}`, present: (document) => document },
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
api.addHandler({
|
|
97
|
-
stage: "pre-read",
|
|
98
|
-
async handler(context) {
|
|
99
|
-
const source = context.request.path;
|
|
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
|
-
}
|
|
187
|
-
const displayIndex = parseDisplaySource(source);
|
|
188
|
-
if (displayIndex !== undefined) {
|
|
189
|
-
if (pi.getFlag("pi-agent-ide-vision-displays") !== true) {
|
|
190
|
-
return failed(
|
|
191
|
-
source,
|
|
192
|
-
"Display capture is disabled. Enable --pi-agent-ide-vision-displays to allow it.",
|
|
193
|
-
);
|
|
194
|
-
}
|
|
195
|
-
try {
|
|
196
|
-
const content = await captureImages(
|
|
197
|
-
() => backend.captureDisplay(displayIndex, context.resolverContext.signal),
|
|
198
|
-
options(context.request),
|
|
199
|
-
context.resolverContext.signal,
|
|
200
|
-
);
|
|
201
|
-
return returned(source, content);
|
|
202
|
-
} catch (error) {
|
|
203
|
-
return failed(source, errorMessage(error));
|
|
204
|
-
}
|
|
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
|
-
}
|
|
218
|
-
const processPid = prefixedPid(source, "process:");
|
|
219
|
-
if (processPid !== undefined) {
|
|
220
|
-
const metadata = await readProcess(processPid, registry);
|
|
221
|
-
return returned(source, [{ type: "text", text: formatProcess(metadata) }]);
|
|
222
|
-
}
|
|
223
|
-
const windowPid = prefixedPid(source, "window:");
|
|
224
|
-
if (windowPid !== undefined) {
|
|
225
|
-
const metadata = await readProcess(windowPid, registry);
|
|
226
|
-
if (
|
|
227
|
-
!metadata.owned &&
|
|
228
|
-
!isExecutableAllowed(metadata.command) &&
|
|
229
|
-
pi.getFlag("pi-agent-ide-vision-arbitrary-windows") !== true
|
|
230
|
-
) {
|
|
231
|
-
return failed(
|
|
232
|
-
source,
|
|
233
|
-
`Window capture for PID ${windowPid} is denied because the process is neither Agent IDE-owned nor allowlisted by executable name. Enable --pi-agent-ide-vision-arbitrary-windows to allow it.`,
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
try {
|
|
238
|
-
const content = await captureImages(
|
|
239
|
-
() =>
|
|
240
|
-
backend.captureWindow(windowPid, metadata.host, context.resolverContext.signal),
|
|
241
|
-
options(context.request),
|
|
242
|
-
context.resolverContext.signal,
|
|
243
|
-
);
|
|
244
|
-
return returned(source, content);
|
|
245
|
-
} catch (error) {
|
|
246
|
-
return failed(source, errorMessage(error));
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
if (/^https?:\/\//iu.test(source) && requestsScreenshot(context.request)) {
|
|
250
|
-
const url = new URL(source);
|
|
251
|
-
try {
|
|
252
|
-
const content = await captureImages(
|
|
253
|
-
() => backend.captureUrl(url, context.resolverContext.signal),
|
|
254
|
-
options(context.request),
|
|
255
|
-
context.resolverContext.signal,
|
|
256
|
-
);
|
|
257
|
-
return returned(url.href, content);
|
|
258
|
-
} catch (error) {
|
|
259
|
-
return failed(url.href, errorMessage(error));
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
return { kind: "continue", context };
|
|
263
|
-
},
|
|
264
|
-
});
|
|
265
|
-
api.describe({
|
|
266
|
-
path: () =>
|
|
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.`,
|
|
268
|
-
views: () => {
|
|
269
|
-
const defaults = getVisionDefaults();
|
|
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}.`;
|
|
271
|
-
},
|
|
272
|
-
offset:
|
|
273
|
-
"For window:, display: and HTTP(S) image/sequence captures, a non-negative integer zero-based row-major grid cell index in the transformed image. Requires limit; omit to select cell 0 when limit is set.",
|
|
274
|
-
limit:
|
|
275
|
-
"For window:, display: and HTTP(S) image/sequence captures, a positive integer square grid cell size in output pixels. Omit both offset and limit for the bounded transformed image.",
|
|
276
|
-
});
|
|
277
|
-
},
|
|
278
|
-
}),
|
|
279
|
-
connectSearchPlugin(pi, {
|
|
280
|
-
protocol: SEARCH_PROTOCOL,
|
|
281
|
-
apiVersion: SEARCH_API_VERSION,
|
|
282
|
-
id: "vision-processes",
|
|
283
|
-
setup(api) {
|
|
284
|
-
api.addResolver({
|
|
285
|
-
priority: -100,
|
|
286
|
-
resolver: {
|
|
287
|
-
id: "processes",
|
|
288
|
-
readResources: (request) => (/^process:/iu.test(request.query) ? undefined : []),
|
|
289
|
-
toScriptData(payload) {
|
|
290
|
-
const processes = payload as readonly (ProcessMetadata | RemoteProcessMetadata)[];
|
|
291
|
-
return {
|
|
292
|
-
kind: "custom",
|
|
293
|
-
resolverId: "processes",
|
|
294
|
-
value: {
|
|
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
|
-
})),
|
|
312
|
-
},
|
|
313
|
-
};
|
|
314
|
-
},
|
|
315
|
-
async tryResolve(request, context) {
|
|
316
|
-
const match = /^process:(.*)$/isu.exec(request.query);
|
|
317
|
-
if (match === null) return { kind: "not-handled" as const };
|
|
318
|
-
const query = (match[1] ?? "").trim().toLowerCase();
|
|
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
|
-
)
|
|
327
|
-
.filter(
|
|
328
|
-
(item) =>
|
|
329
|
-
query.length === 0 ||
|
|
330
|
-
String(item.pid) === query ||
|
|
331
|
-
item.command.toLowerCase().includes(query),
|
|
332
|
-
)
|
|
333
|
-
.slice(0, Math.min(request.limit ?? 50, 100));
|
|
334
|
-
return { kind: "resolved" as const, payload: matches };
|
|
335
|
-
},
|
|
336
|
-
renderResult(result, options, theme) {
|
|
337
|
-
const data = result.details as {
|
|
338
|
-
processes: Awaited<ReturnType<typeof listProcesses>>;
|
|
339
|
-
};
|
|
340
|
-
return new ResultPanel(
|
|
341
|
-
{
|
|
342
|
-
summary: `${data.processes.length} processes shown`,
|
|
343
|
-
rows: data.processes.length
|
|
344
|
-
? data.processes.map((item) => ({
|
|
345
|
-
kind: "note",
|
|
346
|
-
text: `${item.pid} ${item.command}`,
|
|
347
|
-
}))
|
|
348
|
-
: [{ kind: "note", text: "No matching processes" }],
|
|
349
|
-
},
|
|
350
|
-
theme,
|
|
351
|
-
options.expanded,
|
|
352
|
-
);
|
|
353
|
-
},
|
|
354
|
-
format(payload) {
|
|
355
|
-
const processes = payload as readonly (ProcessMetadata | RemoteProcessMetadata)[];
|
|
356
|
-
return {
|
|
357
|
-
content: [
|
|
358
|
-
{
|
|
359
|
-
type: "text" as const,
|
|
360
|
-
text:
|
|
361
|
-
processes.length === 0
|
|
362
|
-
? "No matching processes."
|
|
363
|
-
: processes.map(formatProcess).join("\n\n"),
|
|
364
|
-
},
|
|
365
|
-
],
|
|
366
|
-
details: { count: processes.length, processes },
|
|
367
|
-
};
|
|
368
|
-
},
|
|
369
|
-
},
|
|
370
|
-
});
|
|
371
|
-
api.describe(
|
|
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.",
|
|
373
|
-
);
|
|
374
|
-
},
|
|
375
|
-
}),
|
|
376
|
-
]);
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
function prefixedPid(source: string, prefix: string): number | undefined {
|
|
380
|
-
if (!source.startsWith(prefix)) return undefined;
|
|
381
|
-
const value = source.slice(prefix.length);
|
|
382
|
-
if (!/^\d+$/u.test(value)) throw new Error(`${prefix} sources require a numeric PID`);
|
|
383
|
-
return Number(value);
|
|
384
|
-
}
|
|
385
|
-
function options(request: ReadRequest): VisionOptions {
|
|
386
|
-
const selected = parseVisionView(request.views, getVisionDefaults()) ?? {
|
|
387
|
-
mode: "image" as const,
|
|
388
|
-
...getVisionDefaults(),
|
|
389
|
-
};
|
|
390
|
-
return {
|
|
391
|
-
...selected,
|
|
392
|
-
...(request.limit === undefined ? {} : { cellSize: request.limit }),
|
|
393
|
-
...(request.offset === undefined ? {} : { cellIndex: request.offset }),
|
|
394
|
-
};
|
|
395
|
-
}
|
|
396
|
-
function requestsScreenshot(request: ReadRequest): boolean {
|
|
397
|
-
return request.views?.some((view) => /^(?:image|sequence)(?::|$)/u.test(view)) === true;
|
|
398
|
-
}
|
|
399
|
-
function returned(source: string, content: ReadToolResult["content"]) {
|
|
400
|
-
return {
|
|
401
|
-
kind: "return" as const,
|
|
402
|
-
result: {
|
|
403
|
-
content,
|
|
404
|
-
script: { kind: "native" as const, source, blocks: content },
|
|
405
|
-
details: { source, resolvedBy: "vision" },
|
|
406
|
-
},
|
|
407
|
-
};
|
|
408
|
-
}
|
|
409
|
-
function failed(source: string, message: string) {
|
|
410
|
-
return {
|
|
411
|
-
kind: "return" as const,
|
|
412
|
-
result: {
|
|
413
|
-
content: [{ type: "text" as const, text: message }],
|
|
414
|
-
details: {
|
|
415
|
-
source,
|
|
416
|
-
resolvedBy: "vision",
|
|
417
|
-
failure: { code: "READ_FAILED" as const, source, resolverId: "vision", message },
|
|
418
|
-
},
|
|
419
|
-
isError: true,
|
|
420
|
-
},
|
|
421
|
-
};
|
|
422
|
-
}
|
|
423
|
-
function errorMessage(error: unknown): string {
|
|
424
|
-
return error instanceof Error ? error.message : String(error);
|
|
425
|
-
}
|
|
426
|
-
function formatProcess(item: ProcessMetadata | RemoteProcessMetadata): string {
|
|
427
|
-
return [
|
|
428
|
-
`PID: ${item.pid}`,
|
|
429
|
-
...(item.host === "ssh"
|
|
430
|
-
? [`Target: ${item.target}`, `Resource: ${item.resource}`, `Identity: ${item.identity}`]
|
|
431
|
-
: []),
|
|
432
|
-
`Command: ${item.command}`,
|
|
433
|
-
`Owned by Agent IDE: ${item.owned ? "yes" : "no"}`,
|
|
434
|
-
...(item.host === "ssh" && item.executable !== null ? [`Executable: ${item.executable}`] : []),
|
|
435
|
-
...(item.parentPid === undefined ? [] : [`Parent PID: ${item.parentPid}`]),
|
|
436
|
-
...(item.started === undefined ? [] : [`Started: ${item.started}`]),
|
|
437
|
-
...(item.source === undefined ? [] : [`Agent IDE source: ${item.source}`]),
|
|
438
|
-
].join("\n");
|
|
439
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
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
|
-
};
|