pi-agent-ide 0.8.4 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +77 -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-DUUOCBS3.js → chunk-35LZOKEW.js} +1 -1
- package/dist/chunk-3LVBARLW.js +33 -0
- 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-5PC5INOL.js +1 -0
- package/dist/{chunk-QUYXINGZ.js → chunk-5S74Z6Y4.js} +3 -3
- 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-AMIIOWFL.js +1 -0
- package/dist/{chunk-TOYN4W4F.js → chunk-B25LXXNV.js} +1 -1
- package/dist/chunk-BT2CFM7D.js +11 -0
- package/dist/chunk-C2JT2G5K.js +1 -0
- package/dist/chunk-DDH3FP4G.js +3 -0
- package/dist/{chunk-6T7PSDQW.js → chunk-DVNL5NZE.js} +1 -1
- package/dist/chunk-FEZLTM4L.js +1 -0
- package/dist/{chunk-CPELC6JE.js → chunk-FHRHYY4M.js} +1 -1
- package/dist/chunk-FXPY3V4L.js +10 -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-Z2MNHSJ4.js → chunk-HGCJDIRR.js} +1 -1
- package/dist/chunk-HISGZD3C.js +81 -0
- package/dist/chunk-HKYVP2Q6.js +3 -0
- package/dist/chunk-HRBUY2FF.js +4 -0
- package/dist/chunk-IG5DXVDJ.js +1 -0
- package/dist/chunk-IOGWZNWT.js +1 -0
- package/dist/chunk-IUJUECXH.js +9 -0
- package/dist/chunk-KN6VPARZ.js +1 -0
- package/dist/{chunk-RW2GTYQI.js → chunk-LF325WYO.js} +1 -1
- package/dist/chunk-LXDF2NWX.js +1 -0
- package/dist/{chunk-YJ6T3PEP.js → chunk-MDD5ORB6.js} +1 -1
- package/dist/{chunk-S72FVLUX.js → chunk-MLFJU2US.js} +1 -1
- package/dist/chunk-MPNE25CY.js +5 -0
- package/dist/chunk-NA2NEU4V.js +1 -0
- package/dist/{chunk-ZJQRLVVV.js → chunk-O7V6G3OO.js} +1 -1
- package/dist/chunk-OBTT5INC.js +6 -0
- package/dist/{chunk-IICJXZBU.js → chunk-OMNKD7WW.js} +3 -3
- package/dist/chunk-OUCVZBOR.js +28 -0
- package/dist/chunk-PCGBM2D6.js +17 -0
- package/dist/{chunk-235QMMVA.js → chunk-PQWANILR.js} +1 -1
- package/dist/{chunk-QRJLIV6P.js → chunk-QJ6V5IAY.js} +6 -6
- package/dist/{chunk-SMIFCAAX.js → chunk-RIJRPAL2.js} +1 -1
- package/dist/chunk-RIOPUTUJ.js +6 -0
- package/dist/{chunk-RMI3NMQY.js → chunk-RIZARTUM.js} +2 -2
- package/dist/{chunk-NJ7C4KMA.js → chunk-SRFWT562.js} +1 -1
- package/dist/{chunk-U22JNO6N.js → chunk-STUZZM5B.js} +1 -1
- package/dist/chunk-T3Z4KXOX.js +2 -0
- package/dist/chunk-TSQ6FBTB.js +1 -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-ZPT5D4VP.js → chunk-VDJSH3DQ.js} +2 -2
- package/dist/{chunk-VMTOFEXF.js → chunk-VMLPXSMK.js} +1 -1
- package/dist/chunk-VNWGT367.js +1 -0
- 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-X2WFNMQR.js +9 -0
- package/dist/chunk-XCPIIDFS.js +4 -0
- package/dist/chunk-XE4W5YTE.js +2 -0
- package/dist/chunk-XUYIK4TX.js +1 -0
- 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-22.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 +1 -1
- package/dist/entry-31.js +2 -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 +1 -1
- package/dist/entry-38.js +15 -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-67.js +1 -0
- package/dist/entry-68.js +0 -1
- package/dist/entry-69.js +1 -1
- package/dist/entry-7.js +1 -1
- package/dist/entry-70.js +0 -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-77.js +1 -0
- package/dist/entry-78.js +0 -1
- package/dist/entry-79.js +1 -1
- package/dist/entry-8.js +1 -1
- package/dist/entry-80.js +0 -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 +1 -1
- package/dist/entry-86.js +2 -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 +1 -1
- package/dist/entry-91.js +3 -1
- package/dist/entry-92.js +1 -0
- package/dist/entry-93.js +1 -0
- package/dist/entry-94.js +1 -0
- package/dist/pi-agent-ide.js +13 -34
- package/docs/agent-guides/ast-search.md +58 -0
- package/docs/agent-guides/debugger.md +1 -1
- package/docs/agent-guides/editing.md +29 -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 +24 -23
- package/node_modules/pi-agent-doctor/package.json +7 -7
- package/node_modules/pi-agent-doctor/runtime/entry-29.js +1 -0
- 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-30.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-33.js +1 -0
- package/node_modules/pi-agent-filesystem-jq/runtime/entry-34.js +2 -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-text/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/runtime/entry-36.js +2 -0
- package/node_modules/pi-agent-ide-ast/package.json +15 -15
- package/node_modules/pi-agent-ide-ast/runtime/entry-37.js +1 -0
- 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-39.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-languages/runtime/entry-42.js +2 -0
- package/node_modules/pi-agent-ide-lint/package.json +8 -8
- package/node_modules/pi-agent-ide-lint/runtime/entry-43.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-44.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-52.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-57.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-58.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/runtime/entry-62.js +1 -0
- 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-constant/runtime/entry-63.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/package.json +5 -5
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-64.js +1 -0
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-65.js +2 -0
- 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-67.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/runtime/entry-83.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-84.js +2 -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/result-transfer.ts +2 -6
- package/node_modules/pi-agent-text-editor/src/core/structured-result.ts +5 -1
- package/node_modules/pi-agent-text-editor/src/core/text-change-engine.ts +17 -36
- 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 +63 -74
- 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 +7 -10
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +4 -10
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +8 -8
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +5 -8
- 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-85.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-86.js +2 -0
- package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-87.js +1 -0
- package/node_modules/pi-agent-tool-ui/package.json +3 -3
- package/node_modules/pi-agent-tool-ui/runtime/entry-88.js +1 -0
- package/node_modules/pi-agent-tool-ui/runtime/entry-89.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-image/runtime/entry-92.js +2 -0
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/runtime/entry-93.js +2 -0
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-94.js +2 -0
- package/package.json +65 -58
- package/src/api/approval.ts +2 -0
- package/src/api/capabilities.ts +60 -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/capabilities.ts +252 -0
- package/src/composite/capability-schemas.ts +53 -0
- 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/responses-tools.ts +27 -9
- package/src/composite/settings-documentation.ts +1 -2
- package/src/composite/text-results.ts +61 -23
- package/src/composite/tool-availability.ts +28 -13
- 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-33.js +1 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-34.js +2 -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-35.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-36.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-31.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-image/runtime/entry-92.js +2 -0
- 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-93.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-94.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-90.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-52.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-58.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 +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-57.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-constant/runtime/entry-63.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-64.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-65.js +2 -0
- 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-66.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-67.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-85.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-86.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 +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-84.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/result-transfer.ts +2 -6
- package/src/extensions/pi-agent-text-editor/src/core/structured-result.ts +5 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-change-engine.ts +17 -36
- 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 +63 -74
- 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 +7 -10
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +4 -10
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +8 -8
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +5 -8
- 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 +12 -16
- package/src/plugins/pi-agent-ide-ast/package.json +15 -15
- package/src/plugins/pi-agent-ide-ast/runtime/entry-37.js +1 -0
- 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-39.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 +31 -13
- 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-languages/runtime/entry-42.js +2 -0
- package/src/plugins/pi-agent-ide-lint/package.json +8 -8
- package/src/plugins/pi-agent-ide-lint/runtime/entry-43.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-44.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 +43 -1
- package/src/plugins/pi-agent-ide-terminal/src/resources.ts +0 -18
- package/src/plugins/pi-agent-ide-terminal/src/search.ts +0 -3
- 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-GBUJOR6V.js +0 -28
- 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-PT35ZFLH.js +0 -33
- 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-23.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-doctor/runtime/entry-23.js +0 -1
- package/node_modules/pi-agent-filesystem/runtime/entry-29.js +0 -2
- package/node_modules/pi-agent-filesystem-image/runtime/entry-30.js +0 -2
- package/node_modules/pi-agent-filesystem-text/runtime/entry-33.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-changes/runtime/entry-36.js +0 -1
- package/node_modules/pi-agent-ide-changes/runtime/entry-37.js +0 -2
- package/node_modules/pi-agent-ide-languages/runtime/entry-39.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-pdf/runtime/entry-44.js +0 -1
- package/node_modules/pi-agent-search/runtime/entry-52.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-57.js +0 -1
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-60.js +0 -2
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-62.js +0 -2
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-63.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-64.js +0 -2
- package/node_modules/pi-agent-text-editor/runtime/entry-65.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-67.js +0 -1
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-82.js +0 -2
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-83.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-tool-ui/runtime/entry-86.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/node_modules/pi-agent-web-image/runtime/entry-89.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-jq/runtime/entry-31.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-33.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/plugins/pi-agent-web-pdf/runtime/entry-90.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-read/runtime/entry-47.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/plugins/pi-agent-search-text/runtime/entry-57.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-52.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-53.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-62.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-63.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-64.js +0 -2
- 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/extensions/pi-agent-text-editor/runtime/entry-67.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-changes/runtime/entry-36.js +0 -1
- package/src/plugins/pi-agent-ide-changes/runtime/entry-37.js +0 -2
- package/src/plugins/pi-agent-ide-languages/runtime/entry-39.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-jq → pi-agent-filesystem}/runtime/entry-31.js +0 -0
- /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-32.js +0 -0
- /package/node_modules/{pi-agent-ide-ast → pi-agent-filesystem-pdf}/runtime/entry-35.js +0 -0
- /package/node_modules/{pi-agent-ide-formatter → pi-agent-ide-ast}/runtime/entry-38.js +0 -0
- /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-changes}/runtime/entry-40.js +0 -0
- /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-formatter}/runtime/entry-41.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-image}/runtime/entry-45.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-invariant}/runtime/entry-46.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-47.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-read}/runtime/entry-51.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-53.js +0 -0
- /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-56.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-search-text}/runtime/entry-61.js +0 -0
- /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-line-hash}/runtime/entry-66.js +0 -0
- /package/node_modules/{pi-agent-web-pdf → pi-agent-web}/runtime/entry-90.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web-html}/runtime/entry-91.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-32.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-html}/runtime/entry-91.js +0 -0
- /package/src/extensions/{pi-agent-search → pi-agent-read}/runtime/entry-51.js +0 -0
- /package/src/extensions/{pi-agent-text-editor/plugins/pi-agent-text-anchor-exact → pi-agent-search/plugins/pi-agent-search-text}/runtime/entry-61.js +0 -0
- /package/src/plugins/{pi-agent-ide-formatter → pi-agent-ide-ast}/runtime/entry-38.js +0 -0
- /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-changes}/runtime/entry-40.js +0 -0
- /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-formatter}/runtime/entry-41.js +0 -0
|
@@ -1,32 +1,163 @@
|
|
|
1
|
+
import { ResultPanel } from "pi-agent-tool-ui";
|
|
2
|
+
import { parseCodeViewReference, resolveCodeViewPath } from "pi-agent-ide/api/code-view";
|
|
1
3
|
import { verifyResultTargets, type ResolvedResultTargets } from "pi-agent-resource";
|
|
2
4
|
import {
|
|
5
|
+
renderSearchMatches,
|
|
3
6
|
selectionData,
|
|
4
7
|
type SearchPluginApi,
|
|
8
|
+
type SearchRequest,
|
|
5
9
|
type SearchResolver,
|
|
10
|
+
type SearchSelectionMatch,
|
|
6
11
|
} from "pi-agent-search/api/search";
|
|
7
|
-
import { searchSymbols, type SymbolHit } from "./lsp/symbol-search.js";
|
|
8
12
|
import path from "node:path";
|
|
9
|
-
import {
|
|
13
|
+
import { readLspFileGraph, readLspSymbolGraph, resolveLspDeclaration } from "./lsp/code-views.js";
|
|
10
14
|
import type { LspManager } from "./lsp/manager.js";
|
|
15
|
+
import { searchSymbols, type SymbolHit } from "./lsp/symbol-search.js";
|
|
16
|
+
|
|
17
|
+
/** Options the `lsp_search` tool passes in `SearchRequest.options.lsp`; their presence selects this resolver. */
|
|
18
|
+
export interface LspSearchOptions {
|
|
19
|
+
/** Workspace symbol names to find. */
|
|
20
|
+
readonly query?: string;
|
|
21
|
+
/** Follow symbols found inside the path scope to references outside it. */
|
|
22
|
+
readonly references?: boolean;
|
|
23
|
+
/** `file#selector`: the exact declaration as an editable selection. */
|
|
24
|
+
readonly declaration?: string;
|
|
25
|
+
/** `file` or `file#selector`: incoming and outgoing calls and references. */
|
|
26
|
+
readonly calls?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
type ManagerFor = (cwd: string, source?: string, signal?: AbortSignal) => Promise<LspManager>;
|
|
11
30
|
|
|
12
|
-
|
|
31
|
+
type Payload =
|
|
32
|
+
| {
|
|
33
|
+
readonly mode: "symbols";
|
|
34
|
+
readonly sessionId: string;
|
|
35
|
+
readonly hits: readonly SymbolHit[];
|
|
36
|
+
readonly complete: boolean;
|
|
37
|
+
readonly references: boolean;
|
|
38
|
+
readonly data: unknown;
|
|
39
|
+
}
|
|
40
|
+
| {
|
|
41
|
+
readonly mode: "declaration";
|
|
42
|
+
readonly sessionId: string;
|
|
43
|
+
readonly selector: string;
|
|
44
|
+
readonly match: SearchSelectionMatch;
|
|
45
|
+
readonly data: unknown;
|
|
46
|
+
}
|
|
47
|
+
| { readonly mode: "calls"; readonly text: string };
|
|
48
|
+
|
|
49
|
+
function lspOptions(request: SearchRequest): LspSearchOptions | undefined {
|
|
50
|
+
const value = request.options?.lsp;
|
|
51
|
+
return typeof value === "object" && value !== null ? value : undefined;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Language-server queries the resolver runs; tests can supply faithful implementations. */
|
|
55
|
+
export interface LspSearchBackend {
|
|
56
|
+
readonly resolveLspDeclaration: typeof resolveLspDeclaration;
|
|
57
|
+
readonly readLspFileGraph: typeof readLspFileGraph;
|
|
58
|
+
readonly readLspSymbolGraph: typeof readLspSymbolGraph;
|
|
59
|
+
readonly searchSymbols: typeof searchSymbols;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const defaultBackend: LspSearchBackend = {
|
|
63
|
+
resolveLspDeclaration,
|
|
64
|
+
readLspFileGraph,
|
|
65
|
+
readLspSymbolGraph,
|
|
66
|
+
searchSymbols,
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/** Language-server discovery, declarations and call graphs as shared source targets. */
|
|
13
70
|
export function createLspSearchResolver(
|
|
14
|
-
managerFor:
|
|
71
|
+
managerFor: ManagerFor,
|
|
15
72
|
registerSelection: SearchPluginApi["registerSelection"],
|
|
73
|
+
backend: LspSearchBackend = defaultBackend,
|
|
16
74
|
): SearchResolver {
|
|
17
75
|
return {
|
|
18
|
-
id: "
|
|
76
|
+
id: "lsp",
|
|
19
77
|
supportsResultScope: true,
|
|
20
78
|
// Workspace symbol backends may read beyond the requested path.
|
|
21
|
-
readResources: (request) => (request
|
|
79
|
+
readResources: (request) => (lspOptions(request) === undefined ? [] : undefined),
|
|
22
80
|
toScriptData(payload) {
|
|
23
|
-
|
|
81
|
+
const result = payload as Payload;
|
|
82
|
+
return result.mode === "calls"
|
|
83
|
+
? { kind: "custom", resolverId: "lsp", value: { calls: result.text } }
|
|
84
|
+
: result.data;
|
|
24
85
|
},
|
|
25
86
|
async tryResolve(request, context) {
|
|
26
|
-
|
|
27
|
-
|
|
87
|
+
const options = lspOptions(request);
|
|
88
|
+
if (options === undefined) return { kind: "not-handled" };
|
|
89
|
+
const modes = [options.query, options.declaration, options.calls].filter(
|
|
90
|
+
(value) => value !== undefined,
|
|
91
|
+
);
|
|
92
|
+
if (modes.length !== 1)
|
|
93
|
+
return {
|
|
94
|
+
kind: "failed",
|
|
95
|
+
error: new Error("Pass exactly one of query, declaration or calls."),
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
if (options.calls !== undefined) {
|
|
99
|
+
const reference = parseCodeViewReference(`graph:${options.calls}`, "graph");
|
|
100
|
+
if (reference === undefined) throw new Error("calls requires a file path.");
|
|
101
|
+
const filePath = resolveCodeViewPath(reference.path, context.cwd);
|
|
102
|
+
const manager = await managerFor(context.cwd, filePath, context.signal);
|
|
103
|
+
const text =
|
|
104
|
+
reference.selector === undefined
|
|
105
|
+
? await backend.readLspFileGraph(manager, filePath, context.cwd, context.signal)
|
|
106
|
+
: await backend.readLspSymbolGraph(
|
|
107
|
+
manager,
|
|
108
|
+
filePath,
|
|
109
|
+
reference.selector,
|
|
110
|
+
context.cwd,
|
|
111
|
+
context.signal,
|
|
112
|
+
);
|
|
113
|
+
return { kind: "resolved", payload: { mode: "calls", text } satisfies Payload };
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (options.declaration !== undefined) {
|
|
117
|
+
const reference = options.declaration.includes("#")
|
|
118
|
+
? parseCodeViewReference(`symbol:${options.declaration}`, "symbol")
|
|
119
|
+
: undefined;
|
|
120
|
+
if (reference?.selector === undefined)
|
|
121
|
+
throw new Error("declaration requires file#selector, such as src/app.ts#App/start.");
|
|
122
|
+
const filePath = resolveCodeViewPath(reference.path, context.cwd);
|
|
123
|
+
const selector = reference.selector;
|
|
124
|
+
const resolve = async (signal?: AbortSignal) => {
|
|
125
|
+
const manager = await managerFor(context.cwd, filePath, signal);
|
|
126
|
+
const found = await backend.resolveLspDeclaration(
|
|
127
|
+
manager,
|
|
128
|
+
filePath,
|
|
129
|
+
selector,
|
|
130
|
+
context.cwd,
|
|
131
|
+
signal,
|
|
132
|
+
);
|
|
133
|
+
return declarationMatch(found.source, found.content, found.range);
|
|
134
|
+
};
|
|
135
|
+
const match = await resolve(context.signal);
|
|
136
|
+
const session = await registerSelection(
|
|
137
|
+
{
|
|
138
|
+
request,
|
|
139
|
+
matches: [match],
|
|
140
|
+
complete: true,
|
|
141
|
+
refresh: async (signal) => ({ matches: [await resolve(signal)], complete: true }),
|
|
142
|
+
},
|
|
143
|
+
context,
|
|
144
|
+
);
|
|
145
|
+
return {
|
|
146
|
+
kind: "resolved",
|
|
147
|
+
payload: {
|
|
148
|
+
mode: "declaration",
|
|
149
|
+
sessionId: session.id,
|
|
150
|
+
selector: options.declaration,
|
|
151
|
+
match,
|
|
152
|
+
data: selectionData([match], true, session.id, session),
|
|
153
|
+
} satisfies Payload,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const query = (options.query ?? "").trim();
|
|
28
158
|
if (query.length === 0)
|
|
29
|
-
return { kind: "failed", error: new Error("
|
|
159
|
+
return { kind: "failed", error: new Error("query must not be empty") };
|
|
160
|
+
const references = options.references === true;
|
|
30
161
|
const scope = context.scope;
|
|
31
162
|
const groups = new Map<LspManager, ResolvedResultTargets["targets"][number][]>();
|
|
32
163
|
if (scope !== undefined) {
|
|
@@ -45,13 +176,16 @@ export function createLspSearchResolver(
|
|
|
45
176
|
const hits: SymbolHit[] = [];
|
|
46
177
|
let complete = scope?.complete ?? true;
|
|
47
178
|
for (const [manager, targets] of groups) {
|
|
48
|
-
const found = await searchSymbols(
|
|
179
|
+
const found = await backend.searchSymbols(
|
|
49
180
|
query,
|
|
50
181
|
manager.workspaceRoot,
|
|
51
182
|
limit,
|
|
52
183
|
signal,
|
|
53
184
|
{
|
|
54
|
-
...request,
|
|
185
|
+
...(request.path === undefined ? {} : { path: request.path }),
|
|
186
|
+
...(request.include === undefined ? {} : { include: request.include }),
|
|
187
|
+
...(request.exclude === undefined ? {} : { exclude: request.exclude }),
|
|
188
|
+
...(references ? { navigation: "references" as const } : {}),
|
|
55
189
|
...(scope === undefined
|
|
56
190
|
? {}
|
|
57
191
|
: { resultScope: { targets, complete: scope.complete } }),
|
|
@@ -81,11 +215,11 @@ export function createLspSearchResolver(
|
|
|
81
215
|
return {
|
|
82
216
|
kind: "resolved",
|
|
83
217
|
payload: {
|
|
84
|
-
|
|
218
|
+
mode: "symbols",
|
|
85
219
|
sessionId: session.id,
|
|
86
220
|
hits: found.hits,
|
|
87
221
|
complete: found.complete,
|
|
88
|
-
|
|
222
|
+
references,
|
|
89
223
|
data: {
|
|
90
224
|
...data,
|
|
91
225
|
matches: data.matches.map((match, index) => ({
|
|
@@ -94,40 +228,70 @@ export function createLspSearchResolver(
|
|
|
94
228
|
symbol: found.hits[index]?.symbol,
|
|
95
229
|
})),
|
|
96
230
|
},
|
|
97
|
-
},
|
|
231
|
+
} satisfies Payload,
|
|
98
232
|
};
|
|
99
233
|
},
|
|
100
234
|
renderResult(result, options, theme) {
|
|
101
|
-
const data = result.details as {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
235
|
+
const data = result.details as Payload & { cwd: string };
|
|
236
|
+
if (data.mode === "calls")
|
|
237
|
+
return new ResultPanel(
|
|
238
|
+
{
|
|
239
|
+
summary: data.text.split("\n", 1)[0] ?? "Calls",
|
|
240
|
+
rows: data.text
|
|
241
|
+
.split("\n")
|
|
242
|
+
.slice(1)
|
|
243
|
+
.map((text) => ({ kind: "note" as const, text })),
|
|
244
|
+
},
|
|
245
|
+
theme,
|
|
246
|
+
options.expanded,
|
|
247
|
+
);
|
|
248
|
+
if (data.mode === "declaration")
|
|
249
|
+
return renderSearchMatches(
|
|
250
|
+
[data.match],
|
|
251
|
+
true,
|
|
252
|
+
theme,
|
|
253
|
+
options.expanded,
|
|
254
|
+
data.cwd,
|
|
255
|
+
[],
|
|
256
|
+
[data.selector],
|
|
257
|
+
);
|
|
107
258
|
return renderSearchMatches(
|
|
108
259
|
data.hits,
|
|
109
260
|
data.complete,
|
|
110
261
|
theme,
|
|
111
262
|
options.expanded,
|
|
112
263
|
data.cwd,
|
|
113
|
-
data.navigation
|
|
114
|
-
? ["LSP reference navigation · may leave input scope"]
|
|
115
|
-
: [],
|
|
264
|
+
data.references ? ["LSP reference navigation · may leave input scope"] : [],
|
|
116
265
|
data.hits.map((hit) => `${hit.role} ${hit.symbol.name}`),
|
|
117
266
|
);
|
|
118
267
|
},
|
|
119
268
|
format(payload, context) {
|
|
120
|
-
const result = payload as
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
269
|
+
const result = payload as Payload;
|
|
270
|
+
const display = (source: string) =>
|
|
271
|
+
source.startsWith("ssh://") ? source : path.relative(context.cwd, source);
|
|
272
|
+
if (result.mode === "calls")
|
|
273
|
+
return { content: [{ type: "text", text: result.text }], details: result };
|
|
274
|
+
if (result.mode === "declaration") {
|
|
275
|
+
const { match } = result;
|
|
276
|
+
// A selection ending at column 0 of the next line ends on the line before it.
|
|
277
|
+
const end = match.endLineNumber ?? match.lineNumber;
|
|
278
|
+
const lastLine = end > match.lineNumber && match.endColumn === 0 ? end - 1 : end;
|
|
279
|
+
return {
|
|
280
|
+
content: [
|
|
281
|
+
{
|
|
282
|
+
type: "text",
|
|
283
|
+
text: [
|
|
284
|
+
`SEARCH#${result.sessionId}:1:match ${display(match.source)}:${match.lineNumber}-${lastLine} declaration ${result.selector}`,
|
|
285
|
+
match.matchedText.replace(/\r?\n$/u, ""),
|
|
286
|
+
].join("\n"),
|
|
287
|
+
},
|
|
288
|
+
],
|
|
289
|
+
details: { ...result, cwd: context.cwd },
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
const heading = result.references
|
|
293
|
+
? "LSP reference navigation (may leave input scope)"
|
|
294
|
+
: "LSP symbols inside scope";
|
|
131
295
|
const lines =
|
|
132
296
|
result.hits.length === 0
|
|
133
297
|
? ["No symbols found."]
|
|
@@ -135,7 +299,7 @@ export function createLspSearchResolver(
|
|
|
135
299
|
.slice(0, 100)
|
|
136
300
|
.map(
|
|
137
301
|
(hit, index) =>
|
|
138
|
-
`SEARCH#${result.sessionId}:${index + 1}:match ${
|
|
302
|
+
`SEARCH#${result.sessionId}:${index + 1}:match ${display(hit.source)}:${hit.lineNumber}:${hit.startColumn + 1} ${hit.role} ${hit.symbol.name} · declared at ${display(hit.symbol.source)}:${hit.symbol.range.startLine}:${hit.symbol.range.startColumn + 1}`,
|
|
139
303
|
);
|
|
140
304
|
if (result.complete && result.hits.length)
|
|
141
305
|
lines.unshift(`SEARCH#${result.sessionId}:all:match selects all exact symbol matches.`);
|
|
@@ -147,3 +311,37 @@ export function createLspSearchResolver(
|
|
|
147
311
|
},
|
|
148
312
|
};
|
|
149
313
|
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Select the complete lines of an LSP range (zero-based lines), including the final line ending,
|
|
317
|
+
* so deleting or moving a declaration does not leave an empty line behind.
|
|
318
|
+
*/
|
|
319
|
+
function declarationMatch(
|
|
320
|
+
source: string,
|
|
321
|
+
content: string,
|
|
322
|
+
range: {
|
|
323
|
+
readonly start: { readonly line: number };
|
|
324
|
+
readonly end: { readonly line: number };
|
|
325
|
+
},
|
|
326
|
+
): SearchSelectionMatch {
|
|
327
|
+
const raw = content.split("\n");
|
|
328
|
+
const lines = raw.map((line) => line.replace(/\r$/u, ""));
|
|
329
|
+
const starts = [0];
|
|
330
|
+
for (const line of raw) starts.push((starts.at(-1) ?? 0) + line.length + 1);
|
|
331
|
+
const first = range.start.line;
|
|
332
|
+
const hasNextLine = range.end.line + 1 < raw.length;
|
|
333
|
+
// Without a following line, the selection ends at the end of the last declaration line.
|
|
334
|
+
const endLine = hasNextLine ? range.end.line + 1 : range.end.line;
|
|
335
|
+
const endColumn = hasNextLine ? 0 : (lines[range.end.line] ?? "").length;
|
|
336
|
+
const from = starts[first] ?? content.length;
|
|
337
|
+
const to = Math.min(content.length, (starts[endLine] ?? content.length) + endColumn);
|
|
338
|
+
return {
|
|
339
|
+
source,
|
|
340
|
+
lineNumber: first + 1,
|
|
341
|
+
startColumn: 0,
|
|
342
|
+
...(endLine === first ? {} : { endLineNumber: endLine + 1 }),
|
|
343
|
+
endColumn,
|
|
344
|
+
matchedText: content.slice(from, to),
|
|
345
|
+
lineText: lines[first] ?? "",
|
|
346
|
+
};
|
|
347
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-image",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./src/index.ts",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
8
|
"types": "./src/index.ts",
|
|
9
|
-
"default": "./runtime/entry-
|
|
9
|
+
"default": "./runtime/entry-45.js"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"pi-agent-resource": "0.
|
|
13
|
+
"pi-agent-resource": "0.9.1"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"@earendil-works/pi-coding-agent": "*"
|
|
@@ -19,7 +19,7 @@ const pngSignature = [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a] as const;
|
|
|
19
19
|
export function createImageContentConverter(): ContentConverter {
|
|
20
20
|
return {
|
|
21
21
|
id: "image",
|
|
22
|
-
description: "Image
|
|
22
|
+
description: "Image — the image.",
|
|
23
23
|
async tryConvert(input, context) {
|
|
24
24
|
const initialCancellation = cancellationError(context.signal);
|
|
25
25
|
|
|
@@ -33,7 +33,13 @@ export function createImageContentConverter(): ContentConverter {
|
|
|
33
33
|
return inspection;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
// ASCII signatures such as "BM" and "GIF89a" also start ordinary text. Leave undeclared
|
|
37
|
+
// readable text to the text converter when the bytes are not a usable image.
|
|
38
|
+
const leaveToText = () =>
|
|
39
|
+
!declaresImage(input.source, input.mediaType) && isUtf8Text(input.bytes);
|
|
40
|
+
|
|
36
41
|
if (inspection.kind === "invalid") {
|
|
42
|
+
if (leaveToText()) return { kind: "not-handled" };
|
|
37
43
|
return {
|
|
38
44
|
kind: "failed",
|
|
39
45
|
error: new TypeError(`${input.source}: ${inspection.message}`),
|
|
@@ -51,6 +57,7 @@ export function createImageContentConverter(): ContentConverter {
|
|
|
51
57
|
return { kind: "converted", content };
|
|
52
58
|
} catch (error) {
|
|
53
59
|
const cancellation = cancellationError(context.signal);
|
|
60
|
+
if (cancellation === undefined && leaveToText()) return { kind: "not-handled" };
|
|
54
61
|
return {
|
|
55
62
|
kind: "failed",
|
|
56
63
|
error:
|
|
@@ -62,6 +69,22 @@ export function createImageContentConverter(): ContentConverter {
|
|
|
62
69
|
};
|
|
63
70
|
}
|
|
64
71
|
|
|
72
|
+
const imageExtensions = /\.(?:bmp|gif|jpe?g|png|webp)$/iu;
|
|
73
|
+
|
|
74
|
+
function declaresImage(source: string, mediaType: string | undefined): boolean {
|
|
75
|
+
const type = mediaType?.split(";", 1)[0]?.trim().toLowerCase() ?? "";
|
|
76
|
+
return type.startsWith("image/") || imageExtensions.test(source.split(/[?#]/u, 1)[0] ?? "");
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function isUtf8Text(bytes: Uint8Array): boolean {
|
|
80
|
+
try {
|
|
81
|
+
new TextDecoder("utf8", { fatal: true }).decode(bytes);
|
|
82
|
+
return true;
|
|
83
|
+
} catch {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
65
88
|
export function detectSupportedImageMimeType(bytes: Uint8Array): SupportedImageMimeType | null {
|
|
66
89
|
const inspection = inspectImage(bytes);
|
|
67
90
|
return inspection.kind === "supported" ? inspection.mimeType : null;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-invariant",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./src/index.ts",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
8
|
"types": "./src/index.ts",
|
|
9
|
-
"default": "./runtime/entry-
|
|
9
|
+
"default": "./runtime/entry-46.js"
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-pdf",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./src/index.ts",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
8
|
"types": "./src/index.ts",
|
|
9
|
-
"default": "./runtime/entry-
|
|
9
|
+
"default": "./runtime/entry-47.js"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"pi-agent-resource": "0.
|
|
13
|
+
"pi-agent-resource": "0.9.1"
|
|
14
14
|
}
|
|
15
15
|
}
|