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
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import type { AgentToolResult, ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { resultError, resultInputSchema, withStructuredResult } from "pi-agent-resource";
|
|
3
|
+
import {
|
|
4
|
+
searchDataSchema,
|
|
5
|
+
searchOutputSchema,
|
|
6
|
+
type SearchPluginApi,
|
|
7
|
+
type SearchResolver,
|
|
8
|
+
type SearchToolDetails,
|
|
9
|
+
} from "pi-agent-search/api/search";
|
|
10
|
+
import {
|
|
11
|
+
ToolCallInterceptionRenderStore,
|
|
12
|
+
withToolCallInterceptionRendering,
|
|
13
|
+
} from "pi-agent-tool-call-interception";
|
|
14
|
+
import { ResultPanel, toolCallHeader } from "pi-agent-tool-ui";
|
|
15
|
+
import { Type, type Static } from "typebox";
|
|
16
|
+
|
|
17
|
+
import type { LspSearchOptions } from "./search-resolver.js";
|
|
18
|
+
|
|
19
|
+
export const lspSearchSchema = Type.Object(
|
|
20
|
+
{
|
|
21
|
+
query: Type.Optional(
|
|
22
|
+
Type.String({ minLength: 1, description: "Symbol name to find in the workspace." }),
|
|
23
|
+
),
|
|
24
|
+
declaration: Type.Optional(
|
|
25
|
+
Type.String({
|
|
26
|
+
minLength: 1,
|
|
27
|
+
description:
|
|
28
|
+
"file#selector, such as src/app.ts#App/start: returns that declaration as an editable selection.",
|
|
29
|
+
}),
|
|
30
|
+
),
|
|
31
|
+
calls: Type.Optional(
|
|
32
|
+
Type.String({
|
|
33
|
+
minLength: 1,
|
|
34
|
+
description: "file or file#selector: references and incoming/outgoing calls.",
|
|
35
|
+
}),
|
|
36
|
+
),
|
|
37
|
+
path: Type.Optional(
|
|
38
|
+
Type.Union(resultInputSchema.anyOf, {
|
|
39
|
+
description:
|
|
40
|
+
"For query: file, directory, unchanged Read/Search/edit result, its UUID, or an array of such results.",
|
|
41
|
+
}),
|
|
42
|
+
),
|
|
43
|
+
references: Type.Optional(
|
|
44
|
+
Type.Boolean({
|
|
45
|
+
description:
|
|
46
|
+
"For query: also follow symbols found inside path to their references outside it.",
|
|
47
|
+
}),
|
|
48
|
+
),
|
|
49
|
+
include: Type.Optional(Type.String({ description: "Include glob for query" })),
|
|
50
|
+
exclude: Type.Optional(Type.String({ description: "Exclude glob for query" })),
|
|
51
|
+
limit: Type.Optional(
|
|
52
|
+
Type.Integer({ minimum: 1, maximum: 1000, description: "Maximum matches (default 100)." }),
|
|
53
|
+
),
|
|
54
|
+
},
|
|
55
|
+
{ additionalProperties: false },
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
export type LspSearchParameters = Static<typeof lspSearchSchema>;
|
|
59
|
+
|
|
60
|
+
/** The shared Search core and the LSP resolver it runs for this tool only. */
|
|
61
|
+
export interface LspSearchRuntime {
|
|
62
|
+
readonly api: SearchPluginApi;
|
|
63
|
+
readonly resolver: SearchResolver;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Register the focused language-server tool on top of the shared Search execution core. */
|
|
67
|
+
export async function registerLspSearchTool(
|
|
68
|
+
pi: ExtensionAPI,
|
|
69
|
+
runtime: Promise<LspSearchRuntime>,
|
|
70
|
+
): Promise<void> {
|
|
71
|
+
let resolved: LspSearchRuntime | undefined;
|
|
72
|
+
void runtime.then((value) => (resolved = value));
|
|
73
|
+
pi.registerTool(
|
|
74
|
+
withToolCallInterceptionRendering(
|
|
75
|
+
{
|
|
76
|
+
name: "lsp_search",
|
|
77
|
+
label: "lsp_search",
|
|
78
|
+
exposure: "direct",
|
|
79
|
+
namespace: { name: "ide_lsp_search", description: "Find code through language servers." },
|
|
80
|
+
annotations: {
|
|
81
|
+
readOnlyHint: true,
|
|
82
|
+
destructiveHint: false,
|
|
83
|
+
idempotentHint: false,
|
|
84
|
+
openWorldHint: false,
|
|
85
|
+
},
|
|
86
|
+
description:
|
|
87
|
+
"Use lsp_search to find symbol declarations and references, read one declaration, or list a symbol's calls and references through the project's language servers. Matches and declarations are editable selections.",
|
|
88
|
+
promptSnippet:
|
|
89
|
+
"Find symbols, references, declarations and call graphs through language servers",
|
|
90
|
+
parameters: lspSearchSchema,
|
|
91
|
+
outputSchema: searchOutputSchema,
|
|
92
|
+
renderCall(parameters, theme, context) {
|
|
93
|
+
return toolCallHeader(
|
|
94
|
+
context.lastComponent,
|
|
95
|
+
{
|
|
96
|
+
tool: "lsp_search",
|
|
97
|
+
primary: {
|
|
98
|
+
text: parameters.query ?? parameters.declaration ?? parameters.calls ?? "",
|
|
99
|
+
color: "accent",
|
|
100
|
+
truncate: "end",
|
|
101
|
+
},
|
|
102
|
+
qualifiers: [
|
|
103
|
+
...(parameters.declaration === undefined ? [] : [{ text: "declaration" }]),
|
|
104
|
+
...(parameters.calls === undefined ? [] : [{ text: "calls" }]),
|
|
105
|
+
...(parameters.path === undefined
|
|
106
|
+
? []
|
|
107
|
+
: [
|
|
108
|
+
{
|
|
109
|
+
text:
|
|
110
|
+
typeof parameters.path === "string"
|
|
111
|
+
? `in ${parameters.path}`
|
|
112
|
+
: "in result scope",
|
|
113
|
+
color: "accent" as const,
|
|
114
|
+
truncate: "start" as const,
|
|
115
|
+
},
|
|
116
|
+
]),
|
|
117
|
+
...(parameters.references === true
|
|
118
|
+
? [{ text: "references", color: "warning" as const }]
|
|
119
|
+
: []),
|
|
120
|
+
],
|
|
121
|
+
expanded: context.expanded,
|
|
122
|
+
},
|
|
123
|
+
theme,
|
|
124
|
+
);
|
|
125
|
+
},
|
|
126
|
+
renderResult(result, options, theme, context) {
|
|
127
|
+
const details = result.details as SearchToolDetails | undefined;
|
|
128
|
+
if (
|
|
129
|
+
resolved?.resolver.renderResult !== undefined &&
|
|
130
|
+
details?.payload !== undefined &&
|
|
131
|
+
!context.isError &&
|
|
132
|
+
!options.isPartial
|
|
133
|
+
)
|
|
134
|
+
return resolved.resolver.renderResult(
|
|
135
|
+
{ ...result, details: details.payload },
|
|
136
|
+
options,
|
|
137
|
+
theme,
|
|
138
|
+
context,
|
|
139
|
+
);
|
|
140
|
+
const text = result.content
|
|
141
|
+
.flatMap((part) => (part.type === "text" ? [part.text] : []))
|
|
142
|
+
.join("\n");
|
|
143
|
+
return new ResultPanel(
|
|
144
|
+
{
|
|
145
|
+
summary: context.isError ? "lsp_search failed" : "lsp_search",
|
|
146
|
+
rows: text.split("\n").map((line) => ({ kind: "note" as const, text: line })),
|
|
147
|
+
},
|
|
148
|
+
theme,
|
|
149
|
+
options.expanded,
|
|
150
|
+
);
|
|
151
|
+
},
|
|
152
|
+
async execute(
|
|
153
|
+
_id,
|
|
154
|
+
parameters: LspSearchParameters,
|
|
155
|
+
signal,
|
|
156
|
+
onUpdate,
|
|
157
|
+
context,
|
|
158
|
+
): Promise<AgentToolResult<SearchToolDetails>> {
|
|
159
|
+
const label = parameters.query ?? parameters.declaration ?? parameters.calls;
|
|
160
|
+
const modes = [parameters.query, parameters.declaration, parameters.calls].filter(
|
|
161
|
+
(value) => value !== undefined,
|
|
162
|
+
);
|
|
163
|
+
if (label === undefined || modes.length !== 1)
|
|
164
|
+
return failure("Pass exactly one of query, declaration or calls.");
|
|
165
|
+
const options: LspSearchOptions = {
|
|
166
|
+
...(parameters.query === undefined ? {} : { query: parameters.query }),
|
|
167
|
+
...(parameters.declaration === undefined
|
|
168
|
+
? {}
|
|
169
|
+
: { declaration: parameters.declaration }),
|
|
170
|
+
...(parameters.calls === undefined ? {} : { calls: parameters.calls }),
|
|
171
|
+
...(parameters.references === true ? { references: true } : {}),
|
|
172
|
+
};
|
|
173
|
+
// The Search core registers this runtime during startup; without it the tool cannot run.
|
|
174
|
+
if (resolved === undefined)
|
|
175
|
+
return failure(
|
|
176
|
+
"lsp_search needs the Search module (search.core), which is not loaded.",
|
|
177
|
+
);
|
|
178
|
+
const { api, resolver: lsp } = resolved;
|
|
179
|
+
return (await api.searchWith(
|
|
180
|
+
lsp,
|
|
181
|
+
{
|
|
182
|
+
// The resolver reads options; the query is the label kept with returned references.
|
|
183
|
+
query: label,
|
|
184
|
+
...(parameters.path === undefined ? {} : { path: parameters.path }),
|
|
185
|
+
...(parameters.include === undefined ? {} : { include: parameters.include }),
|
|
186
|
+
...(parameters.exclude === undefined ? {} : { exclude: parameters.exclude }),
|
|
187
|
+
...(parameters.limit === undefined ? {} : { limit: parameters.limit }),
|
|
188
|
+
options: { lsp: options },
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
cwd: context.cwd,
|
|
192
|
+
...(signal !== undefined && { signal }),
|
|
193
|
+
...(onUpdate !== undefined && { onUpdate }),
|
|
194
|
+
},
|
|
195
|
+
)) as AgentToolResult<SearchToolDetails>;
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
new ToolCallInterceptionRenderStore(),
|
|
199
|
+
),
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function failure(message: string): AgentToolResult<SearchToolDetails> {
|
|
204
|
+
return withStructuredResult(
|
|
205
|
+
{
|
|
206
|
+
content: [{ type: "text", text: message }],
|
|
207
|
+
details: { failure: { code: "INVALID_REQUEST", message } },
|
|
208
|
+
},
|
|
209
|
+
searchDataSchema,
|
|
210
|
+
{ status: "error", errors: [resultError(new Error(message), "SEARCH_FAILED")] },
|
|
211
|
+
);
|
|
212
|
+
}
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
Container,
|
|
8
8
|
Key,
|
|
9
9
|
matchesKey,
|
|
10
|
+
MouseRegion,
|
|
10
11
|
SelectList,
|
|
11
12
|
Text,
|
|
12
13
|
truncateToWidth,
|
|
@@ -22,6 +23,7 @@ export type ProcessActivityMode = "detailed" | "compact" | "off";
|
|
|
22
23
|
export class AgentIdeProcessesUi {
|
|
23
24
|
#context: ExtensionContext | undefined;
|
|
24
25
|
#closed = false;
|
|
26
|
+
#overlay: Promise<void> | undefined;
|
|
25
27
|
#elapsedTimer: ReturnType<typeof setInterval> | undefined;
|
|
26
28
|
|
|
27
29
|
constructor(
|
|
@@ -38,7 +40,7 @@ export class AgentIdeProcessesUi {
|
|
|
38
40
|
context.ui.notify("The Agent IDE process overlay requires the TUI.", "info");
|
|
39
41
|
return;
|
|
40
42
|
}
|
|
41
|
-
await this.#
|
|
43
|
+
await this.#openOverlay(context);
|
|
42
44
|
},
|
|
43
45
|
});
|
|
44
46
|
}
|
|
@@ -81,16 +83,25 @@ export class AgentIdeProcessesUi {
|
|
|
81
83
|
context.ui.setStatus("agent-ide-processes", undefined);
|
|
82
84
|
context.ui.setWidget(
|
|
83
85
|
"agent-ide-processes",
|
|
84
|
-
(_tui, theme) =>
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
(_tui, theme) =>
|
|
87
|
+
createProcessWidget(active, theme, (source) => {
|
|
88
|
+
void this.#openOverlay(context, source).catch((error: unknown) => {
|
|
89
|
+
context.ui.notify(`Could not open process details: ${String(error)}`, "error");
|
|
90
|
+
});
|
|
91
|
+
}),
|
|
88
92
|
{ placement: "belowEditor" },
|
|
89
93
|
);
|
|
90
94
|
this.#elapsedTimer ??= setInterval(() => this.#render(), 1_000);
|
|
91
95
|
}
|
|
92
96
|
|
|
93
|
-
|
|
97
|
+
#openOverlay(context: ExtensionContext, source?: string): Promise<void> {
|
|
98
|
+
this.#overlay ??= this.#showOverlay(context, source).finally(() => {
|
|
99
|
+
this.#overlay = undefined;
|
|
100
|
+
});
|
|
101
|
+
return this.#overlay;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
async #showOverlay(context: ExtensionContext, initialSource?: string): Promise<void> {
|
|
94
105
|
for (;;) {
|
|
95
106
|
if (this.#active().length === 0) {
|
|
96
107
|
context.ui.notify("No active Agent IDE processes.", "info");
|
|
@@ -104,8 +115,9 @@ export class AgentIdeProcessesUi {
|
|
|
104
115
|
action = await context.ui.custom<{ readonly source: string } | null>(
|
|
105
116
|
(tui, theme, _keys, done) => {
|
|
106
117
|
let active = this.#active();
|
|
107
|
-
let
|
|
108
|
-
let
|
|
118
|
+
let selected = active.find((process) => process.source === initialSource);
|
|
119
|
+
let page: "list" | "detail" | "input" | "confirm" = selected ? "detail" : "list";
|
|
120
|
+
initialSource = undefined;
|
|
109
121
|
const createList = (selectedSource?: string): SelectList => {
|
|
110
122
|
const items: SelectItem[] = active.map((process) => ({
|
|
111
123
|
value: process.source,
|
|
@@ -129,7 +141,7 @@ export class AgentIdeProcessesUi {
|
|
|
129
141
|
next.onCancel = () => done(null);
|
|
130
142
|
return next;
|
|
131
143
|
};
|
|
132
|
-
let list = createList();
|
|
144
|
+
let list = createList(selected?.source);
|
|
133
145
|
const refresh = (): void => {
|
|
134
146
|
const selectedSource = selected?.source ?? list.getSelectedItem()?.value;
|
|
135
147
|
active = this.#active();
|
|
@@ -233,16 +245,49 @@ export function renderProcessWidget(
|
|
|
233
245
|
width: number,
|
|
234
246
|
theme: Theme,
|
|
235
247
|
): string[] {
|
|
236
|
-
|
|
248
|
+
return createProcessWidget(processes, theme).render(width);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
function createProcessWidget(
|
|
252
|
+
processes: readonly AgentIdeProcess[],
|
|
253
|
+
theme: Theme,
|
|
254
|
+
onSelect?: (source: string) => void,
|
|
255
|
+
): Container {
|
|
256
|
+
const container = new Container();
|
|
257
|
+
if (processes.length === 0) return container;
|
|
237
258
|
const accent = (text: string) => theme.fg("accent", text);
|
|
238
|
-
|
|
259
|
+
container.addChild({
|
|
260
|
+
invalidate() {},
|
|
261
|
+
render: (width) => [
|
|
262
|
+
borderTop("Agent IDE Processes", `${processes.length} active`, width, accent),
|
|
263
|
+
],
|
|
264
|
+
});
|
|
239
265
|
for (const [index, process] of processes.entries()) {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
266
|
+
container.addChild(
|
|
267
|
+
new MouseRegion(
|
|
268
|
+
{
|
|
269
|
+
invalidate() {},
|
|
270
|
+
render: (width) =>
|
|
271
|
+
process.renderSummary(theme).map((line) => borderLine(` ${line} `, width, accent)),
|
|
272
|
+
},
|
|
273
|
+
(event) => {
|
|
274
|
+
if (onSelect === undefined || event.type !== "click" || event.button !== "left") return;
|
|
275
|
+
onSelect(process.source);
|
|
276
|
+
return { handled: true };
|
|
277
|
+
},
|
|
278
|
+
),
|
|
279
|
+
);
|
|
280
|
+
if (index < processes.length - 1)
|
|
281
|
+
container.addChild({
|
|
282
|
+
invalidate() {},
|
|
283
|
+
render: (width) => [borderLine("", width, accent)],
|
|
284
|
+
});
|
|
243
285
|
}
|
|
244
|
-
|
|
245
|
-
|
|
286
|
+
container.addChild({
|
|
287
|
+
invalidate() {},
|
|
288
|
+
render: (width) => [borderBottom(width, accent)],
|
|
289
|
+
});
|
|
290
|
+
return container;
|
|
246
291
|
}
|
|
247
292
|
|
|
248
293
|
function borderTop(
|
|
@@ -186,9 +186,9 @@ export async function registerTerminalResources(
|
|
|
186
186
|
},
|
|
187
187
|
});
|
|
188
188
|
api.describe({
|
|
189
|
-
path: "shell:<session> —
|
|
189
|
+
path: "shell:<session> — status and output tail.",
|
|
190
190
|
views:
|
|
191
|
-
"On shell:<session
|
|
191
|
+
"On shell:<session>: image[:scale=S] — screen image; sequence[:duration=D,interval=I,scale=S] — frames over time, up to 10 s and 20 frames.",
|
|
192
192
|
});
|
|
193
193
|
},
|
|
194
194
|
} satisfies ReadPlugin;
|
|
@@ -241,15 +241,18 @@ export async function registerTerminalResources(
|
|
|
241
241
|
api.describe(
|
|
242
242
|
"For shell:<session> resources, write sends exact terminal input, insert sends named keys at end, and delete terminates and removes the session. replace is unsupported.",
|
|
243
243
|
);
|
|
244
|
+
api.tool("write").describeField("path", "shell:<session> types into that terminal.");
|
|
245
|
+
api.tool("delete").describeField("path", "shell:<session> ends that session.");
|
|
244
246
|
api
|
|
245
247
|
.tool("write")
|
|
246
|
-
.
|
|
247
|
-
|
|
248
|
-
|
|
248
|
+
.describeField("content", "For shell:<session>, exact input; Enter is not added.");
|
|
249
|
+
api.tool("insert").describeField("path", "shell:<session> sends keys to that terminal.");
|
|
250
|
+
api.tool("insert").describeField("anchor", "Omit for shell:<session>.");
|
|
249
251
|
api
|
|
250
252
|
.tool("insert")
|
|
251
|
-
.
|
|
252
|
-
"
|
|
253
|
+
.describeField(
|
|
254
|
+
"text",
|
|
255
|
+
"For shell:<session>: named keys and chords such as Enter, Ctrl+C, Up, or caret forms such as ^C, separated by spaces or commas.",
|
|
253
256
|
);
|
|
254
257
|
},
|
|
255
258
|
} satisfies TextEditorPlugin;
|
|
@@ -99,9 +99,7 @@ export function registerTerminalTools(
|
|
|
99
99
|
},
|
|
100
100
|
label: profile.displayName,
|
|
101
101
|
promptSnippet: `Execute ${profile.displayName} commands in synchronous or background terminal sessions`,
|
|
102
|
-
promptGuidelines: [
|
|
103
|
-
`Do not use ${toolName} commands or scripts to edit files. Use the standalone editing tools instead. Commands that inherently generate files, such as formatters and code generators, are allowed.`,
|
|
104
|
-
],
|
|
102
|
+
promptGuidelines: [`Edit files with the edit tools, not ${toolName}.`],
|
|
105
103
|
description: `Use ${toolName} to execute a command in the user's configured shell. Each call creates a new terminal session and returns its shell: source for inspection and interaction.`,
|
|
106
104
|
parameters: runParameters,
|
|
107
105
|
outputSchema: shellOutputSchema,
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ExtensionAPI,
|
|
3
|
+
ExtensionContext,
|
|
4
|
+
ToolDefinition,
|
|
5
|
+
} from "@earendil-works/pi-coding-agent";
|
|
6
|
+
import { connectResultTargets } from "pi-agent-resource";
|
|
7
|
+
import { registerOperationApproval } from "pi-agent-tool-ui/operation-approval";
|
|
8
|
+
import { connectReadPlugin } from "pi-agent-read/api/connect-plugin";
|
|
9
|
+
import {
|
|
10
|
+
READ_API_VERSION,
|
|
11
|
+
READ_PROTOCOL,
|
|
12
|
+
type ReadPluginApi,
|
|
13
|
+
} from "pi-agent-read/api/plugin-protocol";
|
|
14
|
+
import {
|
|
15
|
+
TEXT_EDITOR_API_VERSION,
|
|
16
|
+
TEXT_EDITOR_PROTOCOL,
|
|
17
|
+
} from "pi-agent-text-editor/api/plugin-protocol";
|
|
18
|
+
import { createIdeTextResults } from "#src/composite/text-results.js";
|
|
19
|
+
import registerReadCore from "#src/extensions/pi-agent-read/src/core/extension.js";
|
|
20
|
+
import { createReadResultTargetHandler } from "#src/extensions/pi-agent-read/src/core/tools/read/result-target.js";
|
|
21
|
+
import registerSearchCore from "#src/extensions/pi-agent-search/src/core/extension.js";
|
|
22
|
+
import { registerResourceSearchSelections } from "#src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.js";
|
|
23
|
+
import registerEditorCore from "#src/extensions/pi-agent-text-editor/src/core/extension.js";
|
|
24
|
+
import { registerTextEditorTools } from "#src/extensions/pi-agent-text-editor/src/tools/extension.js";
|
|
25
|
+
import registerConstantAnchors from "#src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/index.js";
|
|
26
|
+
import registerHashAnchors from "#src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.js";
|
|
27
|
+
import registerExactAnchors from "#src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.js";
|
|
28
|
+
import registerRenderer from "#src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.js";
|
|
29
|
+
import registerDocumentation from "#src/documentation/extension.js";
|
|
30
|
+
import { createResourceHostApi } from "./scoped-api.js";
|
|
31
|
+
|
|
32
|
+
export type StandaloneResourceTool =
|
|
33
|
+
| "read"
|
|
34
|
+
| "search"
|
|
35
|
+
| "write"
|
|
36
|
+
| "replace"
|
|
37
|
+
| "insert"
|
|
38
|
+
| "delete"
|
|
39
|
+
| "copy"
|
|
40
|
+
| "move"
|
|
41
|
+
| "diff";
|
|
42
|
+
export interface StandaloneResourceHostOptions {
|
|
43
|
+
/** A stable identifier; tool names become <namespace>_<verb>. */
|
|
44
|
+
readonly namespace: NonNullable<ToolDefinition["namespace"]>;
|
|
45
|
+
/** Explicit provider resource ownership, not an OS sandbox. Local paths and file: are refused. */
|
|
46
|
+
readonly ownsSource: (source: string) => boolean;
|
|
47
|
+
/** Expose only this subset. The underlying kernels remain available to provider protocols. */
|
|
48
|
+
readonly tools?: readonly StandaloneResourceTool[];
|
|
49
|
+
}
|
|
50
|
+
export interface StandaloneResourceHost {
|
|
51
|
+
/** Connect existing Read, Search, editor and documentation plugins to this isolated bus. */
|
|
52
|
+
readonly api: ExtensionAPI;
|
|
53
|
+
readonly tools: readonly string[];
|
|
54
|
+
/** Retire this host and its references without shutting down the session or sibling hosts. */
|
|
55
|
+
dispose(context: ExtensionContext): Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Register deferred resource tools on shared IDE kernels. Call during extension registration,
|
|
60
|
+
* then connect the provider to host.api. No filesystem, process, web or Git backends are installed.
|
|
61
|
+
* Approval uses the real session's single service; an existing policy is never replaced here.
|
|
62
|
+
*/
|
|
63
|
+
export async function createStandaloneResourceHost(
|
|
64
|
+
pi: ExtensionAPI,
|
|
65
|
+
options: StandaloneResourceHostOptions,
|
|
66
|
+
): Promise<StandaloneResourceHost> {
|
|
67
|
+
registerOperationApproval(pi);
|
|
68
|
+
const scope = createResourceHostApi(pi, options);
|
|
69
|
+
const results = createIdeTextResults(scope.api, {
|
|
70
|
+
resourceOutput: true,
|
|
71
|
+
promptSection: `resource_${options.namespace.name}_results`,
|
|
72
|
+
});
|
|
73
|
+
const api = results.api;
|
|
74
|
+
scope.setApi(api);
|
|
75
|
+
try {
|
|
76
|
+
await registerReadCore(api);
|
|
77
|
+
let read: ReadPluginApi | undefined;
|
|
78
|
+
await connectReadPlugin(api, {
|
|
79
|
+
protocol: READ_PROTOCOL,
|
|
80
|
+
apiVersion: READ_API_VERSION,
|
|
81
|
+
id: "standalone-resource-boundary",
|
|
82
|
+
setup(value) {
|
|
83
|
+
read = value;
|
|
84
|
+
scope.setRead(value);
|
|
85
|
+
value.addResourceGuard({
|
|
86
|
+
id: "standalone-resource-boundary",
|
|
87
|
+
guard: (event) =>
|
|
88
|
+
scope.owns(event.resourceSource, false)
|
|
89
|
+
? { kind: "accepted" }
|
|
90
|
+
: { kind: "rejected", reason: "Resource belongs outside this standalone host." },
|
|
91
|
+
});
|
|
92
|
+
value.addHandler({
|
|
93
|
+
stage: "post-read",
|
|
94
|
+
handler: createReadResultTargetHandler(connectResultTargets(api), value.read, (source) =>
|
|
95
|
+
scope.owns(source, true),
|
|
96
|
+
),
|
|
97
|
+
});
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
await registerSearchCore(api);
|
|
101
|
+
const editor = await registerEditorCore(api);
|
|
102
|
+
await editor.registerPlugin({
|
|
103
|
+
protocol: TEXT_EDITOR_PROTOCOL,
|
|
104
|
+
apiVersion: TEXT_EDITOR_API_VERSION,
|
|
105
|
+
id: "standalone-resource-boundary",
|
|
106
|
+
setup(value) {
|
|
107
|
+
value.addMutationGuard({
|
|
108
|
+
id: "standalone-resource-boundary",
|
|
109
|
+
guard: (plan) =>
|
|
110
|
+
plan.resources.every(
|
|
111
|
+
(resource) => scope.owns(resource.source, true) && resource.binary === undefined,
|
|
112
|
+
)
|
|
113
|
+
? { kind: "accepted" }
|
|
114
|
+
: {
|
|
115
|
+
kind: "rejected",
|
|
116
|
+
rejection: {
|
|
117
|
+
code: "RESOURCE_HOST_BOUNDARY",
|
|
118
|
+
reason: "Resource belongs outside this standalone host.",
|
|
119
|
+
message: "Use this host only for its provider-owned text resources.",
|
|
120
|
+
effect: "not-applied",
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
await registerConstantAnchors(api);
|
|
127
|
+
await registerHashAnchors(api);
|
|
128
|
+
await registerExactAnchors(api);
|
|
129
|
+
await registerResourceSearchSelections(api);
|
|
130
|
+
if (!read) throw new Error("Standalone Read host did not initialize.");
|
|
131
|
+
await registerDocumentation(api, {
|
|
132
|
+
recordType: `agent-documentation-read/${options.namespace.name}`,
|
|
133
|
+
ownsTool: (name) => typeof name === "string" && scope.tools.includes(name),
|
|
134
|
+
});
|
|
135
|
+
await registerRenderer(api, {
|
|
136
|
+
preferences: {},
|
|
137
|
+
toolName: (name) => `${options.namespace.name}_${name}`,
|
|
138
|
+
});
|
|
139
|
+
// Mutation definitions capture their initial renderer during registration.
|
|
140
|
+
registerTextEditorTools(api, editor);
|
|
141
|
+
results.finalize();
|
|
142
|
+
return { api, tools: scope.tools, dispose: (context) => scope.dispose(context) };
|
|
143
|
+
} catch (error) {
|
|
144
|
+
await scope.dispose();
|
|
145
|
+
throw error;
|
|
146
|
+
}
|
|
147
|
+
}
|