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,214 +0,0 @@
|
|
|
1
|
-
import type { ResolvedResultTargets } from "pi-agent-resource";
|
|
2
|
-
import {
|
|
3
|
-
publicRange,
|
|
4
|
-
retainRegion,
|
|
5
|
-
SelectionError,
|
|
6
|
-
type SelectedRegion,
|
|
7
|
-
} from "./selection-region.js";
|
|
8
|
-
import { SourceText } from "./source-text.js";
|
|
9
|
-
import type { TextSelectOperation } from "./select-schema.js";
|
|
10
|
-
|
|
11
|
-
interface Interval {
|
|
12
|
-
readonly from: number;
|
|
13
|
-
readonly to: number;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/** Derive source-backed text boundaries from independently retained input regions. */
|
|
17
|
-
export function selectTextRegions(
|
|
18
|
-
input: ResolvedResultTargets,
|
|
19
|
-
operation: TextSelectOperation,
|
|
20
|
-
signal?: AbortSignal,
|
|
21
|
-
): { readonly regions: readonly SelectedRegion[]; readonly missingInputs: number } {
|
|
22
|
-
signal?.throwIfAborted();
|
|
23
|
-
const absolute = operation.kind === "range" || operation.kind === "lines";
|
|
24
|
-
if (absolute && new Set(input.targets.map((target) => target.source)).size > 1)
|
|
25
|
-
throw new SelectionError("MULTIPLE_SOURCES", "Absolute text bounds require one source.");
|
|
26
|
-
const selected = new Map<string, SelectedRegion>();
|
|
27
|
-
let missingInputs = 0;
|
|
28
|
-
for (const target of input.targets) {
|
|
29
|
-
signal?.throwIfAborted();
|
|
30
|
-
const source = new SourceText(target.expectedContent);
|
|
31
|
-
const requested = absolute ? absoluteInterval(source, operation) : undefined;
|
|
32
|
-
let contained = false;
|
|
33
|
-
for (const seed of target.ranges) {
|
|
34
|
-
signal?.throwIfAborted();
|
|
35
|
-
const from = source.offset(seed.start);
|
|
36
|
-
const to = source.offset(seed.end);
|
|
37
|
-
source.range(from, to);
|
|
38
|
-
const intervals = requested
|
|
39
|
-
? requested.from >= from && requested.to <= to
|
|
40
|
-
? [requested]
|
|
41
|
-
: []
|
|
42
|
-
: transform(source, { from, to }, operation, signal);
|
|
43
|
-
if (!intervals.length) missingInputs++;
|
|
44
|
-
else contained = true;
|
|
45
|
-
for (const interval of intervals) {
|
|
46
|
-
signal?.throwIfAborted();
|
|
47
|
-
const range = source.range(interval.from, interval.to);
|
|
48
|
-
const expanded = interval.from < from || interval.to > to;
|
|
49
|
-
if (
|
|
50
|
-
expanded &&
|
|
51
|
-
operation.kind !== "linesOf" &&
|
|
52
|
-
!(operation.kind === "between" && operation.extent === "lines")
|
|
53
|
-
)
|
|
54
|
-
throw new SelectionError("OUTSIDE_SCOPE", "Text selection exceeds its input scope.");
|
|
55
|
-
retainRegion(selected, {
|
|
56
|
-
target,
|
|
57
|
-
range,
|
|
58
|
-
text: source.content.slice(interval.from, interval.to),
|
|
59
|
-
origins: [{ source: target.source, range: publicRange(seed), expanded }],
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if (requested && !contained)
|
|
64
|
-
throw new SelectionError(
|
|
65
|
-
"OUTSIDE_SCOPE",
|
|
66
|
-
"Requested text bounds are outside every input scope.",
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
return { regions: [...selected.values()], missingInputs };
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function absoluteInterval(
|
|
73
|
-
source: SourceText,
|
|
74
|
-
operation: Extract<TextSelectOperation, { kind: "range" | "lines" }>,
|
|
75
|
-
): Interval {
|
|
76
|
-
if (operation.kind === "range") {
|
|
77
|
-
const from = source.offset({ lineNumber: operation.startLine, column: operation.startColumn });
|
|
78
|
-
const to = source.offset({ lineNumber: operation.endLine, column: operation.endColumn });
|
|
79
|
-
source.range(from, to);
|
|
80
|
-
return { from, to };
|
|
81
|
-
}
|
|
82
|
-
const first = source.lines[operation.first - 1];
|
|
83
|
-
const last = source.lines[operation.last - 1];
|
|
84
|
-
if (
|
|
85
|
-
!Number.isSafeInteger(operation.first) ||
|
|
86
|
-
!Number.isSafeInteger(operation.last) ||
|
|
87
|
-
!first ||
|
|
88
|
-
!last ||
|
|
89
|
-
operation.last < operation.first
|
|
90
|
-
)
|
|
91
|
-
throw new SelectionError(
|
|
92
|
-
"INVALID_RANGE",
|
|
93
|
-
"Line bounds are outside the retained snapshot or reversed.",
|
|
94
|
-
);
|
|
95
|
-
return { from: first.start, to: last.end };
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function transform(
|
|
99
|
-
source: SourceText,
|
|
100
|
-
seed: Interval,
|
|
101
|
-
operation: TextSelectOperation,
|
|
102
|
-
signal?: AbortSignal,
|
|
103
|
-
): readonly Interval[] {
|
|
104
|
-
const text = source.content.slice(seed.from, seed.to);
|
|
105
|
-
switch (operation.kind) {
|
|
106
|
-
case "between": {
|
|
107
|
-
nonEmpty(operation.start);
|
|
108
|
-
nonEmpty(operation.end);
|
|
109
|
-
const ranges: Interval[] = [];
|
|
110
|
-
let cursor = 0;
|
|
111
|
-
while (cursor <= text.length) {
|
|
112
|
-
signal?.throwIfAborted();
|
|
113
|
-
const left = text.indexOf(operation.start, cursor);
|
|
114
|
-
if (left < 0) break;
|
|
115
|
-
const right = text.indexOf(operation.end, left + operation.start.length);
|
|
116
|
-
if (right < 0)
|
|
117
|
-
throw new SelectionError(
|
|
118
|
-
"UNMATCHED_MARKER",
|
|
119
|
-
"Opening marker has no following closing marker in its input scope.",
|
|
120
|
-
);
|
|
121
|
-
const markerStart = seed.from + left;
|
|
122
|
-
const markerEnd = seed.from + right + operation.end.length;
|
|
123
|
-
// Even an omitted marker must not cut a source character or line-ending pair.
|
|
124
|
-
source.boundary(markerStart);
|
|
125
|
-
source.boundary(markerStart + operation.start.length);
|
|
126
|
-
source.boundary(seed.from + right);
|
|
127
|
-
source.boundary(markerEnd);
|
|
128
|
-
ranges.push(
|
|
129
|
-
operation.extent === "lines"
|
|
130
|
-
? source.fullLines(markerStart, markerEnd)
|
|
131
|
-
: {
|
|
132
|
-
from:
|
|
133
|
-
operation.extent === "inside"
|
|
134
|
-
? markerStart + operation.start.length
|
|
135
|
-
: markerStart,
|
|
136
|
-
to: operation.extent === "inside" ? seed.from + right : markerEnd,
|
|
137
|
-
},
|
|
138
|
-
);
|
|
139
|
-
cursor = right + operation.end.length;
|
|
140
|
-
}
|
|
141
|
-
return ranges;
|
|
142
|
-
}
|
|
143
|
-
case "sliceText": {
|
|
144
|
-
const to = operation.to ?? text.length;
|
|
145
|
-
orderedBounds(operation.from, to, text.length);
|
|
146
|
-
return [{ from: seed.from + operation.from, to: seed.from + to }];
|
|
147
|
-
}
|
|
148
|
-
case "trim": {
|
|
149
|
-
if (!text.trim().length) return [{ from: seed.to, to: seed.to }];
|
|
150
|
-
const from = operation.side === "end" ? 0 : text.length - text.trimStart().length;
|
|
151
|
-
const to = operation.side === "start" ? text.length : text.trimEnd().length;
|
|
152
|
-
return [{ from: seed.from + from, to: seed.from + to }];
|
|
153
|
-
}
|
|
154
|
-
case "split": {
|
|
155
|
-
nonEmpty(operation.delimiter);
|
|
156
|
-
const ranges: Interval[] = [];
|
|
157
|
-
let cursor = 0;
|
|
158
|
-
while (cursor <= text.length) {
|
|
159
|
-
signal?.throwIfAborted();
|
|
160
|
-
const separator = text.indexOf(operation.delimiter, cursor);
|
|
161
|
-
ranges.push({
|
|
162
|
-
from: seed.from + cursor,
|
|
163
|
-
to: separator < 0 ? seed.to : seed.from + separator,
|
|
164
|
-
});
|
|
165
|
-
if (separator < 0) break;
|
|
166
|
-
cursor = separator + operation.delimiter.length;
|
|
167
|
-
}
|
|
168
|
-
return ranges;
|
|
169
|
-
}
|
|
170
|
-
case "linesOf": {
|
|
171
|
-
return [source.fullLines(seed.from, seed.to)];
|
|
172
|
-
}
|
|
173
|
-
case "position": {
|
|
174
|
-
const point = operation.edge === "before" ? seed.from : seed.to;
|
|
175
|
-
return [{ from: point, to: point }];
|
|
176
|
-
}
|
|
177
|
-
case "columns": {
|
|
178
|
-
const ranges: Interval[] = [];
|
|
179
|
-
const first = source.lineIndex(seed.from);
|
|
180
|
-
const last = source.lineIndex(seed.to > seed.from ? seed.to - 1 : seed.from);
|
|
181
|
-
for (let index = first; index <= last; index++) {
|
|
182
|
-
signal?.throwIfAborted();
|
|
183
|
-
const line = source.lines[index];
|
|
184
|
-
if (!line) throw new SelectionError("INVALID_RANGE", "Source line bounds are unavailable.");
|
|
185
|
-
orderedBounds(operation.from, operation.to, line.length);
|
|
186
|
-
const range = { from: line.start + operation.from, to: line.start + operation.to };
|
|
187
|
-
if (range.from < seed.from || range.to > seed.to)
|
|
188
|
-
throw new SelectionError("OUTSIDE_SCOPE", "Requested columns exceed their input scope.");
|
|
189
|
-
ranges.push(range);
|
|
190
|
-
}
|
|
191
|
-
return ranges;
|
|
192
|
-
}
|
|
193
|
-
case "range":
|
|
194
|
-
case "lines": {
|
|
195
|
-
throw new SelectionError("INVALID_RANGE", "Absolute bounds must resolve against one source.");
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
function nonEmpty(marker: string): void {
|
|
201
|
-
if (!marker.length)
|
|
202
|
-
throw new SelectionError("INVALID_MARKER", "Use a non-empty literal marker or delimiter.");
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
function orderedBounds(from: number, to: number, length: number): void {
|
|
206
|
-
if (
|
|
207
|
-
!Number.isSafeInteger(from) ||
|
|
208
|
-
!Number.isSafeInteger(to) ||
|
|
209
|
-
from < 0 ||
|
|
210
|
-
to < from ||
|
|
211
|
-
to > length
|
|
212
|
-
)
|
|
213
|
-
throw new SelectionError("INVALID_RANGE", "Text bounds are outside their region or reversed.");
|
|
214
|
-
}
|
|
@@ -1,277 +0,0 @@
|
|
|
1
|
-
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import { Text } from "@earendil-works/pi-tui";
|
|
3
|
-
import { connectAgentDocumentation, loadPackagedAgentGuide } from "pi-agent-documentation";
|
|
4
|
-
import type { ReadPluginApi } from "pi-agent-read/api/plugin-protocol";
|
|
5
|
-
import { connectResultTargets, resultError, withStructuredResult } from "pi-agent-resource";
|
|
6
|
-
import { ResultPanel, toolCallHeader, type ResultPanelModel } from "pi-agent-tool-ui";
|
|
7
|
-
import {
|
|
8
|
-
ToolCallInterceptionRenderStore,
|
|
9
|
-
withToolCallInterceptionRendering,
|
|
10
|
-
} from "pi-agent-tool-call-interception";
|
|
11
|
-
import { selectPresentation } from "./select-presentation.js";
|
|
12
|
-
|
|
13
|
-
import { selectStructuralRegions } from "./ast/selection.js";
|
|
14
|
-
import { publicRange } from "./selection-region.js";
|
|
15
|
-
import { selectTextRegions } from "./text-selection.js";
|
|
16
|
-
import { selectGeometryRegions } from "./geometry-selection.js";
|
|
17
|
-
import {
|
|
18
|
-
selectSchema,
|
|
19
|
-
selectOutputSchema,
|
|
20
|
-
selectionDataSchema,
|
|
21
|
-
type SelectionData,
|
|
22
|
-
type SelectParameters,
|
|
23
|
-
type GeometrySelectOperation,
|
|
24
|
-
} from "./select-schema.js";
|
|
25
|
-
/** Show selected text and opaque item references, never the internal selection record. */
|
|
26
|
-
function selectionText(data: SelectionData): string {
|
|
27
|
-
const rows = [`${data.totalItems} selection(s)${data.complete ? "" : " · incomplete input"}`];
|
|
28
|
-
if (!data.complete)
|
|
29
|
-
rows.push("Obtain complete source selections before checking absence or editing.");
|
|
30
|
-
if (data.missingInputs) rows.push(`${data.missingInputs} input range(s) produced no selection`);
|
|
31
|
-
for (const item of data.items) {
|
|
32
|
-
const range = item.range;
|
|
33
|
-
rows.push(
|
|
34
|
-
`${item.target} ${item.source}:${range.startLine}:${range.startColumn}–${range.endLine}:${range.endColumn}${item.syntax ? ` ${item.syntax.object}${item.syntax.part ? `/${item.syntax.part}` : ""}` : ""}`,
|
|
35
|
-
item.preview,
|
|
36
|
-
);
|
|
37
|
-
if (range.startLine === range.endLine && range.startColumn === range.endColumn)
|
|
38
|
-
rows.push("Zero-width position; no text selected.");
|
|
39
|
-
if (item.textTruncated)
|
|
40
|
-
rows.push("… preview shortened; pass this item reference to consume the full selection");
|
|
41
|
-
}
|
|
42
|
-
if (data.truncated)
|
|
43
|
-
rows.push("… more selections retained; pass the whole result to consume all selections");
|
|
44
|
-
return rows.join("\n");
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function operationLabel(operation: SelectParameters["operation"]): string {
|
|
48
|
-
switch (operation.kind) {
|
|
49
|
-
case "object": {
|
|
50
|
-
return `enclosing ${operation.object} · level ${operation.level ?? 1}`;
|
|
51
|
-
}
|
|
52
|
-
case "part": {
|
|
53
|
-
return `part ${operation.part}`;
|
|
54
|
-
}
|
|
55
|
-
case "elementExtent": {
|
|
56
|
-
return `list element · ${operation.extent}`;
|
|
57
|
-
}
|
|
58
|
-
case "navigate": {
|
|
59
|
-
return `${operation.relation}${operation.relation === "siblings" ? ` ${operation.direction ?? "all"}` : ""}${operation.object ? ` · ${operation.object}` : ""}`;
|
|
60
|
-
}
|
|
61
|
-
case "between": {
|
|
62
|
-
return `between ${JSON.stringify(operation.start)} … ${JSON.stringify(operation.end)} · ${operation.extent}`;
|
|
63
|
-
}
|
|
64
|
-
case "range": {
|
|
65
|
-
return `range ${operation.startLine}:${operation.startColumn}–${operation.endLine}:${operation.endColumn}`;
|
|
66
|
-
}
|
|
67
|
-
case "lines": {
|
|
68
|
-
return `lines ${operation.first}–${operation.last}`;
|
|
69
|
-
}
|
|
70
|
-
case "sliceText": {
|
|
71
|
-
return `text slice ${operation.from}–${operation.to ?? "end"}`;
|
|
72
|
-
}
|
|
73
|
-
case "trim": {
|
|
74
|
-
return `trim ${operation.side}`;
|
|
75
|
-
}
|
|
76
|
-
case "split": {
|
|
77
|
-
return `split ${JSON.stringify(operation.delimiter)}`;
|
|
78
|
-
}
|
|
79
|
-
case "linesOf": {
|
|
80
|
-
return "containing lines";
|
|
81
|
-
}
|
|
82
|
-
case "position": {
|
|
83
|
-
return `position ${operation.edge}`;
|
|
84
|
-
}
|
|
85
|
-
case "columns": {
|
|
86
|
-
return `columns ${operation.from}–${operation.to}`;
|
|
87
|
-
}
|
|
88
|
-
case "within":
|
|
89
|
-
case "intersection":
|
|
90
|
-
case "difference": {
|
|
91
|
-
return operation.kind;
|
|
92
|
-
}
|
|
93
|
-
case "merge": {
|
|
94
|
-
return operation.adjacent ? "merge overlaps and adjacent ranges" : "merge overlaps";
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
function isGeometryOperation(
|
|
99
|
-
operation: SelectParameters["operation"],
|
|
100
|
-
): operation is GeometrySelectOperation {
|
|
101
|
-
return (
|
|
102
|
-
operation.kind === "within" ||
|
|
103
|
-
operation.kind === "intersection" ||
|
|
104
|
-
operation.kind === "difference" ||
|
|
105
|
-
operation.kind === "merge"
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
/** Register read-only text and AST selection using the existing Read and source-target backends. */
|
|
109
|
-
export async function registerSelect(pi: ExtensionAPI, read: ReadPluginApi): Promise<void> {
|
|
110
|
-
const targets = connectResultTargets(pi);
|
|
111
|
-
connectAgentDocumentation(pi, [
|
|
112
|
-
await loadPackagedAgentGuide({
|
|
113
|
-
id: "select-code",
|
|
114
|
-
description:
|
|
115
|
-
"Derive text and AST boundaries, navigate constructs and combine source-range sets",
|
|
116
|
-
triggers: [{ tool: "select" }],
|
|
117
|
-
}),
|
|
118
|
-
]);
|
|
119
|
-
pi.registerTool(
|
|
120
|
-
withToolCallInterceptionRendering(
|
|
121
|
-
{
|
|
122
|
-
name: "select",
|
|
123
|
-
label: "select",
|
|
124
|
-
exposure: "direct",
|
|
125
|
-
namespace: {
|
|
126
|
-
name: "ide_select",
|
|
127
|
-
description: "Derive exact source boundaries from existing targets.",
|
|
128
|
-
},
|
|
129
|
-
annotations: {
|
|
130
|
-
readOnlyHint: true,
|
|
131
|
-
destructiveHint: false,
|
|
132
|
-
idempotentHint: false,
|
|
133
|
-
openWorldHint: false,
|
|
134
|
-
},
|
|
135
|
-
description:
|
|
136
|
-
"Use select to derive text ranges or positions, navigate JavaScript/TypeScript constructs and their parts (without JSX/TSX), and combine source-local selections. Pass the returned result or an item reference to Read, Search or an edit tool. Select does not change files.",
|
|
137
|
-
promptSnippet:
|
|
138
|
-
"Derive text and AST boundaries, navigate constructs and combine source-range sets",
|
|
139
|
-
promptGuidelines: [
|
|
140
|
-
"Use Search for predicate matches and existing captures; use Select when a target needs new text or structural boundaries.",
|
|
141
|
-
"Compare the enclosing owner of each inner match with the original function when checking a condition in that function's own body.",
|
|
142
|
-
],
|
|
143
|
-
parameters: selectSchema,
|
|
144
|
-
outputSchema: selectOutputSchema,
|
|
145
|
-
renderCall(parameters, theme, context) {
|
|
146
|
-
return toolCallHeader(
|
|
147
|
-
context.lastComponent,
|
|
148
|
-
{
|
|
149
|
-
tool: "select",
|
|
150
|
-
primary: {
|
|
151
|
-
text: operationLabel(parameters.operation),
|
|
152
|
-
color: "accent",
|
|
153
|
-
},
|
|
154
|
-
qualifiers: [
|
|
155
|
-
{
|
|
156
|
-
text:
|
|
157
|
-
typeof parameters.path === "string" && !parameters.path.startsWith("RESULT#")
|
|
158
|
-
? parameters.path
|
|
159
|
-
: "in result scope",
|
|
160
|
-
},
|
|
161
|
-
],
|
|
162
|
-
expanded: context.expanded,
|
|
163
|
-
},
|
|
164
|
-
theme,
|
|
165
|
-
);
|
|
166
|
-
},
|
|
167
|
-
renderResult(result, options, theme) {
|
|
168
|
-
const presentation = result.details as ResultPanelModel | undefined;
|
|
169
|
-
if (typeof presentation?.summary === "string" && Array.isArray(presentation.rows))
|
|
170
|
-
return new ResultPanel(presentation, theme, options.expanded);
|
|
171
|
-
return new Text(
|
|
172
|
-
result.content
|
|
173
|
-
.flatMap((block) => (block.type === "text" ? [block.text] : []))
|
|
174
|
-
.join("\n"),
|
|
175
|
-
0,
|
|
176
|
-
0,
|
|
177
|
-
);
|
|
178
|
-
},
|
|
179
|
-
async execute(_id, parameters: SelectParameters, signal, _onUpdate, context) {
|
|
180
|
-
try {
|
|
181
|
-
signal?.throwIfAborted();
|
|
182
|
-
const resolve = async (source: unknown) => {
|
|
183
|
-
if (typeof source === "string" && !source.startsWith("RESULT#")) {
|
|
184
|
-
const resolved = await read.read(
|
|
185
|
-
{ path: source },
|
|
186
|
-
{ cwd: context.cwd, ...(signal !== undefined && { signal }) },
|
|
187
|
-
"script",
|
|
188
|
-
);
|
|
189
|
-
if (resolved.isError) throw new Error("Select could not read this source.");
|
|
190
|
-
source = resolved.script;
|
|
191
|
-
}
|
|
192
|
-
return targets.resolve(source, context.cwd);
|
|
193
|
-
};
|
|
194
|
-
const input = await resolve(parameters.path);
|
|
195
|
-
const operation = parameters.operation;
|
|
196
|
-
const scopes =
|
|
197
|
-
isGeometryOperation(operation) && "scopes" in operation
|
|
198
|
-
? await resolve(operation.scopes)
|
|
199
|
-
: { targets: [], complete: true };
|
|
200
|
-
const verified = {
|
|
201
|
-
targets: [...input.targets, ...scopes.targets],
|
|
202
|
-
complete: input.complete && scopes.complete,
|
|
203
|
-
};
|
|
204
|
-
await targets.verify(verified, signal);
|
|
205
|
-
const selected = isGeometryOperation(operation)
|
|
206
|
-
? selectGeometryRegions(input, operation, scopes, signal)
|
|
207
|
-
: operation.kind === "object" ||
|
|
208
|
-
operation.kind === "part" ||
|
|
209
|
-
operation.kind === "navigate" ||
|
|
210
|
-
operation.kind === "elementExtent"
|
|
211
|
-
? await selectStructuralRegions(input, operation, context.cwd, signal)
|
|
212
|
-
: selectTextRegions(input, operation, signal);
|
|
213
|
-
await targets.verify(verified, signal);
|
|
214
|
-
signal?.throwIfAborted();
|
|
215
|
-
const sourceTargets = selected.regions.map((region) => ({
|
|
216
|
-
...region.target,
|
|
217
|
-
ranges: [region.range],
|
|
218
|
-
}));
|
|
219
|
-
const data: SelectionData = {
|
|
220
|
-
kind: "selection",
|
|
221
|
-
target: targets.register(sourceTargets, context.cwd, verified.complete),
|
|
222
|
-
complete: verified.complete,
|
|
223
|
-
totalItems: selected.regions.length,
|
|
224
|
-
missingInputs: selected.missingInputs,
|
|
225
|
-
truncated: selected.regions.length > 100,
|
|
226
|
-
items: selected.regions.slice(0, 100).map((region) => {
|
|
227
|
-
const preview = region.text.slice(0, 1000).replace(/[\uD800-\uDBFF]$/u, "");
|
|
228
|
-
return {
|
|
229
|
-
target: targets.register(
|
|
230
|
-
[{ ...region.target, ranges: [region.range] }],
|
|
231
|
-
context.cwd,
|
|
232
|
-
verified.complete,
|
|
233
|
-
),
|
|
234
|
-
source: region.target.source,
|
|
235
|
-
range: publicRange(region.range),
|
|
236
|
-
origins: region.origins,
|
|
237
|
-
...(region.syntax ? { syntax: region.syntax } : {}),
|
|
238
|
-
preview,
|
|
239
|
-
textTruncated: preview.length < region.text.length,
|
|
240
|
-
};
|
|
241
|
-
}),
|
|
242
|
-
};
|
|
243
|
-
return withStructuredResult(
|
|
244
|
-
{
|
|
245
|
-
content: [{ type: "text", text: selectionText(data) }],
|
|
246
|
-
details: selectPresentation(
|
|
247
|
-
selected.regions,
|
|
248
|
-
verified.complete,
|
|
249
|
-
selected.missingInputs,
|
|
250
|
-
context.cwd,
|
|
251
|
-
),
|
|
252
|
-
},
|
|
253
|
-
selectionDataSchema,
|
|
254
|
-
{ status: "success", data, errors: [] },
|
|
255
|
-
);
|
|
256
|
-
} catch (error) {
|
|
257
|
-
if (signal?.aborted) throw error;
|
|
258
|
-
return withStructuredResult<ResultPanelModel | undefined, never>(
|
|
259
|
-
{
|
|
260
|
-
content: [
|
|
261
|
-
{
|
|
262
|
-
type: "text",
|
|
263
|
-
text: `${error instanceof Error ? error.message : String(error)}\nResolve the reported error before retrying. Do not treat a failed selection as an empty result.`,
|
|
264
|
-
},
|
|
265
|
-
],
|
|
266
|
-
details: undefined,
|
|
267
|
-
},
|
|
268
|
-
selectionDataSchema,
|
|
269
|
-
{ status: "error", errors: [resultError(error, "SELECT_FAILED")] },
|
|
270
|
-
);
|
|
271
|
-
}
|
|
272
|
-
},
|
|
273
|
-
},
|
|
274
|
-
new ToolCallInterceptionRenderStore(),
|
|
275
|
-
),
|
|
276
|
-
);
|
|
277
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../../dist/entry-36.js";
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { requiredValue } from "pi-agent-invariant";
|
|
2
|
-
import {
|
|
3
|
-
type CodeViewScheme,
|
|
4
|
-
formatCodeViewReference,
|
|
5
|
-
parseCodeViewReference,
|
|
6
|
-
resolveCodeViewPath,
|
|
7
|
-
type SourceMappedTextContent,
|
|
8
|
-
} from "pi-agent-ide/api/code-view";
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
type LspManager,
|
|
12
|
-
readLspFileGraph,
|
|
13
|
-
readLspSymbolBody,
|
|
14
|
-
readLspSymbolGraph,
|
|
15
|
-
} from "./lsp/index.js";
|
|
16
|
-
|
|
17
|
-
import type {
|
|
18
|
-
ResourceResolutionAttempt,
|
|
19
|
-
ResourceResolver,
|
|
20
|
-
ResourceResolverContext,
|
|
21
|
-
} from "pi-agent-resource";
|
|
22
|
-
|
|
23
|
-
export type LspManagerProvider = (
|
|
24
|
-
cwd: string,
|
|
25
|
-
filePath?: string,
|
|
26
|
-
signal?: AbortSignal,
|
|
27
|
-
) => Promise<LspManager>;
|
|
28
|
-
|
|
29
|
-
export function createLspSymbolResolver(getManager: LspManagerProvider): ResourceResolver {
|
|
30
|
-
return createCodeViewResolver("symbol", "lsp-symbol", getManager, async (request) => {
|
|
31
|
-
return await readLspSymbolBody(
|
|
32
|
-
request.manager,
|
|
33
|
-
request.filePath,
|
|
34
|
-
requiredValue(request.selector),
|
|
35
|
-
request.cwd,
|
|
36
|
-
request.signal,
|
|
37
|
-
);
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function createLspGraphResolver(getManager: LspManagerProvider): ResourceResolver {
|
|
42
|
-
return createCodeViewResolver("graph", "lsp-graph", getManager, async (request) => {
|
|
43
|
-
if (request.selector === undefined) {
|
|
44
|
-
return await readLspFileGraph(request.manager, request.filePath, request.cwd, request.signal);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return await readLspSymbolGraph(
|
|
48
|
-
request.manager,
|
|
49
|
-
request.filePath,
|
|
50
|
-
request.selector,
|
|
51
|
-
request.cwd,
|
|
52
|
-
request.signal,
|
|
53
|
-
);
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
interface CodeViewReadRequest {
|
|
58
|
-
readonly manager: LspManager;
|
|
59
|
-
readonly filePath: string;
|
|
60
|
-
readonly selector?: readonly string[];
|
|
61
|
-
readonly cwd: string;
|
|
62
|
-
readonly signal?: AbortSignal;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
type CodeViewRead = (request: CodeViewReadRequest) => Promise<string | SourceMappedTextContent>;
|
|
66
|
-
|
|
67
|
-
function createCodeViewResolver(
|
|
68
|
-
scheme: Extract<CodeViewScheme, "symbol" | "graph">,
|
|
69
|
-
id: string,
|
|
70
|
-
getManager: LspManagerProvider,
|
|
71
|
-
read: CodeViewRead,
|
|
72
|
-
): ResourceResolver {
|
|
73
|
-
return {
|
|
74
|
-
id,
|
|
75
|
-
tryResolve(source, context) {
|
|
76
|
-
return Promise.resolve(resolveCodeViewSource(source, context, scheme, getManager, read));
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function resolveCodeViewSource(
|
|
82
|
-
source: string,
|
|
83
|
-
context: ResourceResolverContext,
|
|
84
|
-
scheme: Extract<CodeViewScheme, "symbol" | "graph">,
|
|
85
|
-
getManager: LspManagerProvider,
|
|
86
|
-
read: CodeViewRead,
|
|
87
|
-
): ResourceResolutionAttempt {
|
|
88
|
-
let reference;
|
|
89
|
-
|
|
90
|
-
try {
|
|
91
|
-
reference = parseCodeViewReference(source, scheme);
|
|
92
|
-
} catch (error) {
|
|
93
|
-
return { kind: "failed", error };
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
if (reference === undefined) {
|
|
97
|
-
return { kind: "not-handled" };
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
let filePath: string;
|
|
101
|
-
|
|
102
|
-
try {
|
|
103
|
-
filePath = resolveCodeViewPath(reference.path, context.cwd);
|
|
104
|
-
} catch (error) {
|
|
105
|
-
return { kind: "failed", error };
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
const canonicalSource = formatCodeViewReference(scheme, filePath, reference.selector);
|
|
109
|
-
return {
|
|
110
|
-
kind: "resolved",
|
|
111
|
-
resource: {
|
|
112
|
-
source: canonicalSource,
|
|
113
|
-
async read(operationContext) {
|
|
114
|
-
const manager = await getManager(context.cwd, filePath, operationContext.signal);
|
|
115
|
-
const content = await read({
|
|
116
|
-
manager,
|
|
117
|
-
filePath,
|
|
118
|
-
cwd: context.cwd,
|
|
119
|
-
...optionalSelector(reference.selector),
|
|
120
|
-
...optionalSignal(operationContext.signal),
|
|
121
|
-
});
|
|
122
|
-
return [typeof content === "string" ? { type: "text", text: content } : content];
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function optionalSelector(
|
|
129
|
-
selector: readonly string[] | undefined,
|
|
130
|
-
): Pick<CodeViewReadRequest, "selector"> {
|
|
131
|
-
return selector === undefined ? {} : { selector };
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function optionalSignal(signal: AbortSignal | undefined): { readonly signal?: AbortSignal } {
|
|
135
|
-
return signal === undefined ? {} : { signal };
|
|
136
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../../dist/entry-42.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../../dist/entry-43.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../../dist/entry-44.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../../dist/entry-52.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../../dist/entry-57.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../../dist/entry-63.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../../dist/entry-65.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../../dist/entry-67.js";
|