pi-agent-ide 0.8.4 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +59 -0
- package/README.md +24 -29
- package/dist/{chunk-CM3XGY72.js → chunk-2AY526TN.js} +1 -1
- package/dist/{chunk-LEJKDYCK.js → chunk-2TZDG2JH.js} +1 -1
- package/dist/{chunk-XBQR74IK.js → chunk-4GBFIGH3.js} +1 -1
- package/dist/{chunk-PJL3UVMJ.js → chunk-4IWEKRSP.js} +1 -1
- package/dist/chunk-52PFWQMU.js +5 -0
- package/dist/chunk-5BGWNYQS.js +1 -0
- package/dist/{chunk-QUYXINGZ.js → chunk-5S74Z6Y4.js} +3 -3
- package/dist/chunk-64JTD2DJ.js +1 -0
- package/dist/{chunk-XAHU42FP.js → chunk-6A3ORNW3.js} +2 -2
- package/dist/{chunk-ANM3Y5FO.js → chunk-6WCHBHFW.js} +5 -5
- package/dist/{chunk-IMGIDBCC.js → chunk-7D7PXIVV.js} +1 -1
- package/dist/chunk-7PVDTMEM.js +1 -0
- package/dist/chunk-7SG756UO.js +4 -0
- package/dist/{chunk-GBUJOR6V.js → chunk-7URANI6I.js} +14 -14
- package/dist/{chunk-Z2MNHSJ4.js → chunk-AJZVKDYC.js} +1 -1
- package/dist/chunk-AMIIOWFL.js +1 -0
- package/dist/{chunk-TOYN4W4F.js → chunk-B25LXXNV.js} +1 -1
- package/dist/chunk-C2JT2G5K.js +1 -0
- package/dist/chunk-CVOYSEBE.js +1 -0
- package/dist/chunk-DDH3FP4G.js +3 -0
- package/dist/chunk-FEZLTM4L.js +1 -0
- package/dist/{chunk-CPELC6JE.js → chunk-FHRHYY4M.js} +1 -1
- package/dist/chunk-FKKAHI62.js +11 -0
- package/dist/chunk-FS3KCKFX.js +9 -0
- package/dist/chunk-FYOU4RBH.js +2 -0
- package/dist/chunk-G4PRFO6G.js +1 -0
- package/dist/chunk-GS5ZRTUG.js +1 -0
- package/dist/{chunk-XXLLY66B.js → chunk-GXL4NMHR.js} +1 -1
- package/dist/{chunk-QT3EAHOG.js → chunk-H3GEEOOL.js} +1 -1
- package/dist/chunk-H5Z54BEU.js +25 -0
- package/dist/chunk-H7WAM5RH.js +23 -0
- package/dist/chunk-HT7LZN5A.js +9 -0
- package/dist/chunk-IG5DXVDJ.js +1 -0
- package/dist/chunk-K4UTEMDU.js +1 -0
- package/dist/chunk-KFBRL2V4.js +3 -0
- package/dist/chunk-KN6VPARZ.js +1 -0
- package/dist/{chunk-RW2GTYQI.js → chunk-LF325WYO.js} +1 -1
- package/dist/chunk-LTADNZKW.js +2 -0
- package/dist/{chunk-YJ6T3PEP.js → chunk-MDD5ORB6.js} +1 -1
- package/dist/{chunk-S72FVLUX.js → chunk-MLFJU2US.js} +1 -1
- package/dist/chunk-NA2NEU4V.js +1 -0
- package/dist/chunk-OBTT5INC.js +6 -0
- package/dist/{chunk-IICJXZBU.js → chunk-OMNKD7WW.js} +3 -3
- package/dist/chunk-PLMHBXWI.js +10 -0
- package/dist/{chunk-235QMMVA.js → chunk-PQWANILR.js} +1 -1
- package/dist/{chunk-QRJLIV6P.js → chunk-QJ6V5IAY.js} +6 -6
- package/dist/chunk-QM5WDEFI.js +1 -0
- package/dist/{chunk-SMIFCAAX.js → chunk-RIJRPAL2.js} +1 -1
- package/dist/chunk-RIOPUTUJ.js +6 -0
- package/dist/chunk-RVFMH77U.js +82 -0
- package/dist/{chunk-NJ7C4KMA.js → chunk-SRFWT562.js} +1 -1
- package/dist/{chunk-U22JNO6N.js → chunk-STUZZM5B.js} +1 -1
- package/dist/{chunk-PT35ZFLH.js → chunk-TNAUCNUT.js} +12 -12
- package/dist/{chunk-DUUOCBS3.js → chunk-TVH2ND35.js} +1 -1
- package/dist/chunk-TVSZYABY.js +5 -0
- package/dist/chunk-TVXZE4KW.js +4 -0
- package/dist/chunk-U7YDLVFL.js +1 -0
- package/dist/{chunk-KZC7TI5M.js → chunk-UD3DMY3Q.js} +1 -1
- package/dist/{chunk-VXP5BMW7.js → chunk-USG6WHAT.js} +1 -1
- package/dist/{chunk-RMI3NMQY.js → chunk-V4J3TLCV.js} +2 -2
- package/dist/{chunk-ZPT5D4VP.js → chunk-VDJSH3DQ.js} +2 -2
- package/dist/{chunk-VMTOFEXF.js → chunk-VMLPXSMK.js} +1 -1
- package/dist/{chunk-6T7PSDQW.js → chunk-VN3XBH2Q.js} +1 -1
- package/dist/chunk-WAJW4G4F.js +22 -0
- package/dist/chunk-WEE3NM6L.js +1 -0
- package/dist/{chunk-IM24DB3K.js → chunk-WES2E4VR.js} +1 -1
- package/dist/{chunk-RIJMXO43.js → chunk-WQIMM4SU.js} +1 -1
- package/dist/chunk-WUO3UW4J.js +17 -0
- package/dist/chunk-XE4W5YTE.js +2 -0
- package/dist/chunk-XUYIK4TX.js +1 -0
- package/dist/{chunk-ZJQRLVVV.js → chunk-Y74EKJOY.js} +1 -1
- package/dist/{chunk-AAC77UD4.js → chunk-YPYROPQF.js} +1 -1
- package/dist/chunk-ZXO4D5UB.js +1 -0
- package/dist/entry-0.js +1 -1
- package/dist/entry-1.js +1 -1
- package/dist/entry-10.js +1 -1
- package/dist/entry-11.js +1 -1
- package/dist/entry-12.js +1 -1
- package/dist/entry-13.js +1 -1
- package/dist/entry-14.js +1 -1
- package/dist/entry-15.js +1 -1
- package/dist/entry-16.js +1 -1
- package/dist/entry-17.js +1 -1
- package/dist/entry-18.js +1 -1
- package/dist/entry-19.js +1 -1
- package/dist/entry-2.js +1 -1
- package/dist/entry-20.js +1 -1
- package/dist/entry-21.js +1 -0
- package/dist/entry-23.js +1 -1
- package/dist/entry-24.js +1 -1
- package/dist/entry-25.js +1 -1
- package/dist/entry-26.js +1 -1
- package/dist/entry-27.js +1 -1
- package/dist/entry-28.js +1 -1
- package/dist/entry-29.js +1 -2
- package/dist/entry-3.js +1 -1
- package/dist/entry-30.js +2 -1
- package/dist/entry-31.js +1 -4
- package/dist/entry-32.js +1 -1
- package/dist/entry-33.js +1 -1
- package/dist/entry-34.js +1 -1
- package/dist/entry-35.js +1 -18
- package/dist/entry-36.js +1 -1
- package/dist/entry-37.js +15 -1
- package/dist/entry-38.js +1 -1
- package/dist/entry-39.js +1 -1
- package/dist/entry-4.js +1 -1
- package/dist/entry-40.js +1 -1
- package/dist/entry-41.js +1 -1
- package/dist/entry-42.js +1 -1
- package/dist/entry-43.js +1 -1
- package/dist/entry-44.js +1 -1
- package/dist/entry-45.js +1 -1
- package/dist/entry-46.js +1 -1
- package/dist/entry-47.js +1 -1
- package/dist/entry-48.js +1 -1
- package/dist/entry-49.js +1 -25
- package/dist/entry-5.js +1 -1
- package/dist/entry-50.js +1 -1
- package/dist/entry-51.js +1 -1
- package/dist/entry-52.js +1 -1
- package/dist/entry-53.js +1 -1
- package/dist/entry-54.js +1 -3
- package/dist/entry-55.js +1 -13
- package/dist/entry-56.js +1 -1
- package/dist/entry-57.js +1 -1
- package/dist/entry-58.js +1 -1
- package/dist/entry-59.js +1 -1
- package/dist/entry-6.js +1 -1
- package/dist/entry-60.js +1 -1
- package/dist/entry-61.js +1 -1
- package/dist/entry-62.js +1 -1
- package/dist/entry-63.js +1 -1
- package/dist/entry-64.js +1 -1
- package/dist/entry-65.js +1 -0
- package/dist/entry-66.js +1 -1
- package/dist/entry-68.js +1 -1
- package/dist/entry-69.js +0 -1
- package/dist/entry-7.js +1 -1
- package/dist/entry-70.js +1 -1
- package/dist/entry-71.js +1 -1
- package/dist/entry-72.js +1 -1
- package/dist/entry-73.js +1 -1
- package/dist/entry-74.js +1 -1
- package/dist/entry-75.js +1 -0
- package/dist/entry-76.js +1 -1
- package/dist/entry-78.js +1 -1
- package/dist/entry-79.js +0 -1
- package/dist/entry-8.js +1 -1
- package/dist/entry-80.js +1 -1
- package/dist/entry-81.js +1 -80
- package/dist/entry-82.js +1 -22
- package/dist/entry-83.js +1 -2
- package/dist/entry-84.js +1 -1
- package/dist/entry-85.js +2 -1
- package/dist/entry-86.js +1 -1
- package/dist/entry-87.js +1 -1
- package/dist/entry-88.js +1 -3
- package/dist/entry-89.js +1 -1
- package/dist/entry-9.js +1 -1
- package/dist/entry-90.js +3 -1
- package/dist/entry-91.js +1 -1
- package/dist/entry-92.js +1 -0
- package/dist/entry-93.js +1 -0
- package/dist/pi-agent-ide.js +10 -34
- package/docs/agent-guides/ast-search.md +58 -0
- package/docs/agent-guides/debugger.md +1 -1
- package/docs/agent-guides/editing.md +26 -58
- package/docs/agent-guides/git-changes.md +4 -14
- package/docs/agent-guides/search.md +38 -0
- package/docs/agent-guides/ssh.md +17 -49
- package/docs/agent-guides/terminal.md +9 -15
- package/docs/configuration.md +9 -13
- package/docs/extensions.md +82 -0
- package/docs/settings-help.md +2 -2
- package/docs/structured-results.md +33 -11
- package/docs/tools.md +23 -22
- package/node_modules/pi-agent-doctor/package.json +7 -7
- package/node_modules/pi-agent-doctor/src/workspace.ts +0 -5
- package/node_modules/pi-agent-documentation/package.json +2 -2
- package/node_modules/pi-agent-documentation/runtime/entry-29.js +1 -0
- package/node_modules/pi-agent-documentation/src/index.ts +26 -10
- package/node_modules/pi-agent-filesystem/index.ts +1 -1
- package/node_modules/pi-agent-filesystem/package.json +8 -8
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- package/node_modules/pi-agent-filesystem-jq/index.ts +9 -63
- package/node_modules/pi-agent-filesystem-jq/package.json +12 -6
- package/node_modules/pi-agent-filesystem-jq/runtime/entry-32.js +1 -0
- package/node_modules/pi-agent-filesystem-jq/src/api/jq.ts +112 -0
- package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
- package/node_modules/pi-agent-filesystem-pdf/runtime/entry-34.js +2 -0
- package/node_modules/pi-agent-filesystem-text/package.json +4 -4
- package/node_modules/pi-agent-ide-ast/package.json +15 -15
- package/node_modules/pi-agent-ide-ast/src/extension.ts +8 -8
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +104 -26
- package/node_modules/pi-agent-ide-ast/src/tool-ast-search.ts +210 -0
- package/node_modules/pi-agent-ide-changes/index.ts +1 -2
- package/node_modules/pi-agent-ide-changes/package.json +10 -10
- package/node_modules/pi-agent-ide-changes/runtime/entry-38.js +1 -0
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +3 -3
- package/node_modules/pi-agent-ide-formatter/package.json +4 -4
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-lint/package.json +8 -8
- package/node_modules/pi-agent-ide-lint/runtime/entry-42.js +2 -0
- package/node_modules/pi-agent-ide-lsp/index.ts +22 -28
- package/node_modules/pi-agent-ide-lsp/package.json +14 -10
- package/node_modules/pi-agent-ide-lsp/runtime/entry-43.js +2 -0
- package/node_modules/pi-agent-ide-lsp/src/declaration-targets.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/src/lsp/code-views.ts +8 -84
- package/node_modules/pi-agent-ide-lsp/src/lsp/index.ts +1 -6
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +11 -11
- package/node_modules/pi-agent-ide-lsp/src/manager-provider.ts +8 -0
- package/node_modules/pi-agent-ide-lsp/src/rename-plan.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +234 -36
- package/node_modules/pi-agent-ide-lsp/src/tool-lsp-search.ts +212 -0
- package/node_modules/pi-agent-image/package.json +3 -3
- package/node_modules/pi-agent-image/src/image-converter.ts +24 -1
- package/node_modules/pi-agent-invariant/package.json +2 -2
- package/node_modules/pi-agent-pdf/package.json +3 -3
- package/node_modules/pi-agent-pdf/src/pdf-converter.ts +23 -1
- package/node_modules/pi-agent-read/package.json +12 -12
- package/node_modules/pi-agent-read/runtime/entry-49.js +0 -1
- package/node_modules/pi-agent-read/runtime/entry-51.js +2 -0
- package/node_modules/pi-agent-read/src/api/read-parameters.ts +4 -7
- package/node_modules/pi-agent-read/src/api/tools/read.ts +2 -0
- package/node_modules/pi-agent-read/src/core/extension.ts +0 -8
- package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +47 -14
- package/node_modules/pi-agent-read/src/core/tools/read/result-target.ts +3 -1
- package/node_modules/pi-agent-read/src/core/tools/read/structured-result.ts +14 -2
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +21 -8
- package/node_modules/pi-agent-resource/package.json +2 -2
- package/node_modules/pi-agent-resource/src/index.ts +8 -0
- package/node_modules/pi-agent-resource/src/resource-error-metadata.ts +89 -0
- package/node_modules/pi-agent-resource/src/resource-error.ts +6 -1
- package/node_modules/pi-agent-resource/src/result-images.ts +87 -0
- package/node_modules/pi-agent-resource/src/result-targets.ts +9 -3
- package/node_modules/pi-agent-resource/src/tool-result.ts +17 -0
- package/node_modules/pi-agent-search/package.json +9 -9
- package/node_modules/pi-agent-search/runtime/entry-54.js +0 -1
- package/node_modules/pi-agent-search/runtime/entry-55.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-56.js +2 -0
- package/node_modules/pi-agent-search/src/api/glob-list.ts +35 -0
- package/node_modules/pi-agent-search/src/api/search-parameters.ts +8 -8
- package/node_modules/pi-agent-search/src/api/search.ts +14 -2
- package/node_modules/pi-agent-search/src/core/extension.ts +11 -20
- package/node_modules/pi-agent-search/src/core/search-core.ts +30 -10
- package/node_modules/pi-agent-search-text/index.ts +34 -12
- package/node_modules/pi-agent-search-text/package.json +17 -15
- package/node_modules/pi-agent-search-text/runtime/entry-57.js +1 -0
- package/node_modules/pi-agent-search-text/runtime/entry-60.js +1 -0
- package/node_modules/pi-agent-search-text/src/file-search.ts +59 -25
- package/node_modules/pi-agent-search-text/src/resolvers.ts +61 -16
- package/node_modules/pi-agent-search-text/src/scoped-search.ts +9 -3
- package/node_modules/pi-agent-search-text/src/search-backend.ts +44 -48
- package/node_modules/pi-agent-search-text/src/search-presentation.ts +19 -15
- package/node_modules/pi-agent-search-text/src/search-recipe.ts +2 -1
- package/node_modules/pi-agent-search-text/src/search-result.ts +6 -2
- package/node_modules/pi-agent-search-text/src/search-session.ts +1 -0
- package/node_modules/pi-agent-search-text/src/tool-file-search.ts +146 -0
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text/src/text-converter.ts +1 -1
- package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
- package/node_modules/pi-agent-text-anchor-exact/package.json +5 -5
- package/node_modules/pi-agent-text-anchor-exact/src/anchor.ts +6 -1
- package/node_modules/pi-agent-text-anchor-line-hash/index.ts +1 -2
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-66.js +2 -0
- package/node_modules/pi-agent-text-editor/package.json +26 -26
- package/node_modules/pi-agent-text-editor/runtime/entry-81.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-82.js +1 -0
- package/node_modules/pi-agent-text-editor/src/api/edit-pipeline.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +23 -0
- package/node_modules/pi-agent-text-editor/src/api/text-selection-anchor.ts +31 -1
- package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +11 -21
- package/node_modules/pi-agent-text-editor/src/core/editing-guidelines.ts +5 -5
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +13 -7
- package/node_modules/pi-agent-text-editor/src/core/file-operation-guards.ts +22 -4
- package/node_modules/pi-agent-text-editor/src/core/image-write.ts +111 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +3 -0
- package/node_modules/pi-agent-text-editor/src/core/structured-result.ts +5 -1
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +8 -2
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +103 -20
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +146 -62
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +14 -19
- package/node_modules/pi-agent-text-editor/src/tools/text-selection.ts +43 -12
- package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +5 -5
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +6 -5
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +3 -7
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +6 -8
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +9 -6
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +3 -4
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +37 -22
- package/node_modules/pi-agent-text-editor-renderer/index.ts +6 -1
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-84.js +2 -0
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +18 -5
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +6 -6
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-85.js +2 -0
- package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
- package/node_modules/pi-agent-tool-ui/package.json +3 -3
- package/node_modules/pi-agent-tool-ui/runtime/entry-87.js +1 -0
- package/node_modules/pi-agent-tool-ui/runtime/entry-88.js +1 -0
- package/node_modules/pi-agent-web/index.ts +28 -6
- package/node_modules/pi-agent-web/package.json +8 -8
- package/node_modules/pi-agent-web-html/package.json +3 -3
- package/node_modules/pi-agent-web-html/src/html-converter.ts +1 -1
- package/node_modules/pi-agent-web-image/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/runtime/entry-92.js +2 -0
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-93.js +2 -0
- package/package.json +61 -58
- package/src/api/approval.ts +2 -0
- package/src/api/read.ts +2 -0
- package/src/api/standalone.ts +7 -0
- package/src/backend/doctor-workspace.ts +0 -3
- package/src/backend/process-metadata-worker.py +9 -18
- package/src/backend/process-metadata.ts +11 -44
- package/src/backend/registration.ts +0 -10
- package/src/backend/web-browser-worker.mjs +2 -17
- package/src/backend/web-browser.ts +1 -26
- package/src/composite/builtin-extensions.ts +8 -6
- package/src/composite/ide-alias-rendering.ts +18 -2
- package/src/composite/module-labels.ts +0 -4
- package/src/composite/preferences.ts +0 -36
- package/src/composite/settings-documentation.ts +1 -2
- package/src/composite/text-results.ts +61 -23
- package/src/documentation/extension.ts +39 -15
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +1 -1
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +8 -8
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/index.ts +9 -63
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +12 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-32.js +1 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/src/api/jq.ts +112 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-34.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-35.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-30.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +28 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -8
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/src/html-converter.ts +1 -1
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-92.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-93.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-89.js +2 -0
- package/src/extensions/pi-agent-read/package.json +12 -12
- package/src/extensions/pi-agent-read/runtime/entry-49.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-50.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-51.js +2 -0
- package/src/extensions/pi-agent-read/src/api/read-parameters.ts +4 -7
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +2 -0
- package/src/extensions/pi-agent-read/src/core/extension.ts +0 -8
- package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +47 -14
- package/src/extensions/pi-agent-read/src/core/tools/read/result-target.ts +3 -1
- package/src/extensions/pi-agent-read/src/core/tools/read/structured-result.ts +14 -2
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +21 -8
- package/src/extensions/pi-agent-search/package.json +9 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +34 -12
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +17 -15
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-57.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-59.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-60.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/file-search.ts +59 -25
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +61 -16
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/scoped-search.ts +9 -3
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +44 -48
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-presentation.ts +19 -15
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +2 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +6 -2
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/tool-file-search.ts +146 -0
- package/src/extensions/pi-agent-search/runtime/entry-54.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-55.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-56.js +2 -0
- package/src/extensions/pi-agent-search/src/api/glob-list.ts +35 -0
- package/src/extensions/pi-agent-search/src/api/search-parameters.ts +8 -8
- package/src/extensions/pi-agent-search/src/api/search.ts +14 -2
- package/src/extensions/pi-agent-search/src/core/extension.ts +11 -20
- package/src/extensions/pi-agent-search/src/core/search-core.ts +30 -10
- package/src/extensions/pi-agent-text-editor/package.json +26 -26
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/anchor.ts +6 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +1 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-65.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-66.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +6 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-84.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +18 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +6 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-85.js +2 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-81.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-82.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-83.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/edit-pipeline.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +23 -0
- package/src/extensions/pi-agent-text-editor/src/api/text-selection-anchor.ts +31 -1
- package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +11 -21
- package/src/extensions/pi-agent-text-editor/src/core/editing-guidelines.ts +5 -5
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +13 -7
- package/src/extensions/pi-agent-text-editor/src/core/file-operation-guards.ts +22 -4
- package/src/extensions/pi-agent-text-editor/src/core/image-write.ts +111 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +3 -0
- package/src/extensions/pi-agent-text-editor/src/core/structured-result.ts +5 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +8 -2
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +103 -20
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +146 -62
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +14 -19
- package/src/extensions/pi-agent-text-editor/src/tools/text-selection.ts +43 -12
- package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +5 -5
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +6 -5
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +3 -7
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +6 -8
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +9 -6
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +3 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +37 -22
- package/src/pi-agent-ide.ts +8 -15
- package/src/plugins/pi-agent-ide-ast/package.json +15 -15
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +8 -8
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +104 -26
- package/src/plugins/pi-agent-ide-ast/src/tool-ast-search.ts +210 -0
- package/src/plugins/pi-agent-ide-changes/index.ts +1 -2
- package/src/plugins/pi-agent-ide-changes/package.json +10 -10
- package/src/plugins/pi-agent-ide-changes/runtime/entry-38.js +1 -0
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +3 -3
- package/src/plugins/pi-agent-ide-debugger/index.ts +17 -4
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +2 -11
- package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-lint/package.json +8 -8
- package/src/plugins/pi-agent-ide-lint/runtime/entry-42.js +2 -0
- package/src/plugins/pi-agent-ide-lsp/index.ts +22 -28
- package/src/plugins/pi-agent-ide-lsp/package.json +14 -10
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-43.js +2 -0
- package/src/plugins/pi-agent-ide-lsp/src/declaration-targets.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/src/lsp/code-views.ts +8 -84
- package/src/plugins/pi-agent-ide-lsp/src/lsp/index.ts +1 -6
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +11 -11
- package/src/plugins/pi-agent-ide-lsp/src/manager-provider.ts +8 -0
- package/src/plugins/pi-agent-ide-lsp/src/rename-plan.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +234 -36
- package/src/plugins/pi-agent-ide-lsp/src/tool-lsp-search.ts +212 -0
- package/src/plugins/pi-agent-ide-processes/src/ui.ts +61 -16
- package/src/plugins/pi-agent-ide-terminal/index.ts +1 -1
- package/src/plugins/pi-agent-ide-terminal/src/resources.ts +10 -7
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +1 -3
- package/src/standalone/resource-host.ts +147 -0
- package/src/standalone/scoped-api.ts +457 -0
- package/dist/chunk-2RTCSZB3.js +0 -1
- package/dist/chunk-4DIUPEDF.js +0 -2
- package/dist/chunk-6EDOLYOV.js +0 -1
- package/dist/chunk-6FGLAVPJ.js +0 -1
- package/dist/chunk-6H32W35W.js +0 -1
- package/dist/chunk-6OJ565FL.js +0 -2
- package/dist/chunk-6R3Y4AD3.js +0 -1
- package/dist/chunk-6TJPMBUQ.js +0 -1
- package/dist/chunk-6XFUICD7.js +0 -1
- package/dist/chunk-BHSO2MDK.js +0 -6
- package/dist/chunk-GSOYVIQS.js +0 -1
- package/dist/chunk-HSRH76JN.js +0 -3
- package/dist/chunk-HSZ4AQ6L.js +0 -9
- package/dist/chunk-I6NPILT5.js +0 -1
- package/dist/chunk-K7SRNBIV.js +0 -1
- package/dist/chunk-LCWBVOII.js +0 -3
- package/dist/chunk-MKEC3U2M.js +0 -4
- package/dist/chunk-NUM3YQGK.js +0 -1
- package/dist/chunk-OM4LYD3S.js +0 -1
- package/dist/chunk-PLKYHUNT.js +0 -1
- package/dist/chunk-QIJMV2P2.js +0 -2
- package/dist/chunk-RVU73VKN.js +0 -2
- package/dist/chunk-SDAH3ECM.js +0 -5
- package/dist/chunk-SGQWRIRJ.js +0 -10
- package/dist/chunk-SWBJS3U4.js +0 -1
- package/dist/chunk-T7I2VX3J.js +0 -1
- package/dist/chunk-T7MWQQIF.js +0 -3
- package/dist/chunk-VDP5CQHM.js +0 -3
- package/dist/chunk-XG7QNAKW.js +0 -9
- package/dist/chunk-XLWCSJMR.js +0 -1
- package/dist/chunk-YFP4P2FV.js +0 -1
- package/dist/chunk-YIXP2ALP.js +0 -9
- package/dist/entry-22.js +0 -1
- package/docs/agent-guides/diagnostics.md +0 -5
- package/docs/agent-guides/json-reading.md +0 -57
- package/docs/agent-guides/read-resources.md +0 -17
- package/docs/agent-guides/search-code.md +0 -76
- package/docs/agent-guides/select-code.md +0 -119
- package/docs/agent-guides/vision.md +0 -11
- package/node_modules/pi-agent-doctor/runtime/entry-22.js +0 -1
- package/node_modules/pi-agent-filesystem/runtime/entry-29.js +0 -2
- package/node_modules/pi-agent-filesystem-pdf/runtime/entry-32.js +0 -2
- package/node_modules/pi-agent-ide-ast/runtime/entry-34.js +0 -1
- package/node_modules/pi-agent-ide-ast/src/ast/constructs.ts +0 -193
- package/node_modules/pi-agent-ide-ast/src/ast/element-extent.ts +0 -59
- package/node_modules/pi-agent-ide-ast/src/ast/selection.ts +0 -204
- package/node_modules/pi-agent-ide-ast/src/geometry-selection.ts +0 -184
- package/node_modules/pi-agent-ide-ast/src/select-presentation.ts +0 -105
- package/node_modules/pi-agent-ide-ast/src/select-schema.ts +0 -387
- package/node_modules/pi-agent-ide-ast/src/selection-region.ts +0 -41
- package/node_modules/pi-agent-ide-ast/src/source-text.ts +0 -92
- package/node_modules/pi-agent-ide-ast/src/text-selection.ts +0 -214
- package/node_modules/pi-agent-ide-ast/src/tool-select.ts +0 -277
- package/node_modules/pi-agent-ide-formatter/runtime/entry-38.js +0 -2
- package/node_modules/pi-agent-ide-lsp/src/code-view-resolvers.ts +0 -136
- package/node_modules/pi-agent-image/runtime/entry-42.js +0 -1
- package/node_modules/pi-agent-invariant/runtime/entry-43.js +0 -1
- package/node_modules/pi-agent-search/runtime/entry-51.js +0 -1
- package/node_modules/pi-agent-search-text/runtime/entry-55.js +0 -2
- package/node_modules/pi-agent-search-text/runtime/entry-56.js +0 -1
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-60.js +0 -2
- package/node_modules/pi-agent-text-editor/runtime/entry-66.js +0 -1
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-82.js +0 -2
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-84.js +0 -1
- package/node_modules/pi-agent-tool-ui/runtime/entry-85.js +0 -1
- package/node_modules/pi-agent-web/runtime/entry-87.js +0 -2
- package/node_modules/pi-agent-web-html/runtime/entry-88.js +0 -2
- package/src/backend/vision-capture-worker.py +0 -319
- package/src/backend/vision-capture.ts +0 -165
- package/src/backend/vision-registration.ts +0 -104
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-30.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-32.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-29.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-88.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-89.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-87.js +0 -2
- package/src/extensions/pi-agent-read/runtime/entry-45.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-46.js +0 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-55.js +0 -2
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-56.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-51.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-52.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-60.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-61.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-82.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-83.js +0 -2
- package/src/extensions/pi-agent-text-editor/runtime/entry-65.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-66.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-34.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-35.js +0 -2
- package/src/plugins/pi-agent-ide-ast/src/ast/constructs.ts +0 -193
- package/src/plugins/pi-agent-ide-ast/src/ast/element-extent.ts +0 -59
- package/src/plugins/pi-agent-ide-ast/src/ast/selection.ts +0 -204
- package/src/plugins/pi-agent-ide-ast/src/geometry-selection.ts +0 -184
- package/src/plugins/pi-agent-ide-ast/src/select-presentation.ts +0 -105
- package/src/plugins/pi-agent-ide-ast/src/select-schema.ts +0 -387
- package/src/plugins/pi-agent-ide-ast/src/selection-region.ts +0 -41
- package/src/plugins/pi-agent-ide-ast/src/source-text.ts +0 -92
- package/src/plugins/pi-agent-ide-ast/src/text-selection.ts +0 -214
- package/src/plugins/pi-agent-ide-ast/src/tool-select.ts +0 -277
- package/src/plugins/pi-agent-ide-formatter/runtime/entry-38.js +0 -2
- package/src/plugins/pi-agent-ide-lsp/src/code-view-resolvers.ts +0 -136
- package/src/plugins/pi-agent-ide-vision/index.ts +0 -439
- package/src/plugins/pi-agent-ide-vision/src/doctor-plugin.ts +0 -47
- package/src/plugins/pi-agent-ide-vision/src/vision.ts +0 -585
- package/src/plugins/pi-agent-ide-vision/src/windows-display-capture.ps1 +0 -30
- package/src/plugins/pi-agent-ide-vision/src/windows-window-capture.ps1 +0 -33
- /package/dist/{chunk-U2JKHKLK.js → chunk-3PMHFEJY.js} +0 -0
- /package/node_modules/{pi-agent-documentation → pi-agent-doctor}/runtime/entry-28.js +0 -0
- /package/node_modules/{pi-agent-filesystem-image → pi-agent-filesystem}/runtime/entry-30.js +0 -0
- /package/node_modules/{pi-agent-filesystem-jq → pi-agent-filesystem-image}/runtime/entry-31.js +0 -0
- /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-jq}/runtime/entry-33.js +0 -0
- /package/node_modules/{pi-agent-ide-ast → pi-agent-filesystem-text}/runtime/entry-35.js +0 -0
- /package/node_modules/{pi-agent-ide-changes → pi-agent-ide-ast}/runtime/entry-36.js +0 -0
- /package/node_modules/{pi-agent-ide-changes → pi-agent-ide-ast}/runtime/entry-37.js +0 -0
- /package/node_modules/{pi-agent-ide-languages → pi-agent-ide-changes}/runtime/entry-39.js +0 -0
- /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-formatter}/runtime/entry-40.js +0 -0
- /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-languages}/runtime/entry-41.js +0 -0
- /package/node_modules/{pi-agent-pdf → pi-agent-image}/runtime/entry-44.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-invariant}/runtime/entry-45.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-46.js +0 -0
- /package/node_modules/{pi-agent-resource → pi-agent-read}/runtime/entry-50.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-52.js +0 -0
- /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-59.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-exact → pi-agent-text}/runtime/entry-61.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-exact → pi-agent-text-anchor-constant}/runtime/entry-62.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-exact}/runtime/entry-63.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-exact}/runtime/entry-64.js +0 -0
- /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-line-hash}/runtime/entry-65.js +0 -0
- /package/node_modules/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor}/runtime/entry-83.js +0 -0
- /package/node_modules/{pi-agent-tool-ui → pi-agent-tool-call-interception}/runtime/entry-86.js +0 -0
- /package/node_modules/{pi-agent-web-image → pi-agent-web}/runtime/entry-89.js +0 -0
- /package/node_modules/{pi-agent-web-pdf → pi-agent-web-html}/runtime/entry-90.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web-image}/runtime/entry-91.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-jq → pi-agent-filesystem-image}/runtime/entry-31.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-jq}/runtime/entry-33.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-pdf → pi-agent-web-html}/runtime/entry-90.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-image}/runtime/entry-91.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-anchor-exact → pi-agent-text-anchor-constant}/runtime/entry-62.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-exact}/runtime/entry-63.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-exact}/runtime/entry-64.js +0 -0
- /package/src/plugins/{pi-agent-ide-changes → pi-agent-ide-ast}/runtime/entry-36.js +0 -0
- /package/src/plugins/{pi-agent-ide-changes → pi-agent-ide-ast}/runtime/entry-37.js +0 -0
- /package/src/plugins/{pi-agent-ide-languages → pi-agent-ide-changes}/runtime/entry-39.js +0 -0
- /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-formatter}/runtime/entry-40.js +0 -0
- /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-languages}/runtime/entry-41.js +0 -0
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
import { TEXT_POSITION_ANCHOR_KIND, TEXT_SEARCH_ANCHOR_KIND } from "#src/api/plugin-protocol.js";
|
|
10
10
|
import {
|
|
11
11
|
anchorSpanRange,
|
|
12
|
+
transferText,
|
|
12
13
|
deleteAnchorSpan,
|
|
13
14
|
insertionAfterAnchor,
|
|
14
15
|
replaceAnchorSpan,
|
|
@@ -20,12 +21,10 @@ import type { TextChange } from "#src/core/text-change-engine.js";
|
|
|
20
21
|
export const moveSchema = Type.Object(
|
|
21
22
|
{
|
|
22
23
|
path: resultSourceProperty(
|
|
23
|
-
"
|
|
24
|
+
"Source: a path, an unchanged Read/Search result or its UUID, or an array of them. A path without start moves the whole file, directory or symlink. Omit to use the file of the start anchor.",
|
|
24
25
|
),
|
|
25
26
|
...sourceRangeProperties(),
|
|
26
|
-
...targetProperties(
|
|
27
|
-
"Directory Move replaces the exact target directory, removing destination-only entries.",
|
|
28
|
-
),
|
|
27
|
+
...targetProperties("Moving a directory replaces the target directory."),
|
|
29
28
|
},
|
|
30
29
|
{ additionalProperties: false },
|
|
31
30
|
);
|
|
@@ -42,7 +41,7 @@ export const moveMutationTool: TextMutationToolRegistration<typeof moveSchema> =
|
|
|
42
41
|
name: "move",
|
|
43
42
|
wholeFileOperation: "move",
|
|
44
43
|
description:
|
|
45
|
-
"Use move to move or rename a file
|
|
44
|
+
"Use move to move or rename a file or directory, or to cut text from one place and put it in another.",
|
|
46
45
|
|
|
47
46
|
promptSnippet: "Move filesystem objects or selected text",
|
|
48
47
|
parameters: moveSchema,
|
|
@@ -94,7 +93,11 @@ export const moveMutationTool: TextMutationToolRegistration<typeof moveSchema> =
|
|
|
94
93
|
"targetEnd",
|
|
95
94
|
);
|
|
96
95
|
target = targetSpan.source;
|
|
97
|
-
targetChange = replaceAnchorSpan(
|
|
96
|
+
targetChange = replaceAnchorSpan(
|
|
97
|
+
context,
|
|
98
|
+
targetSpan,
|
|
99
|
+
transferText(context, starts, ends, sourceSpan, targetSpan),
|
|
100
|
+
);
|
|
98
101
|
}
|
|
99
102
|
|
|
100
103
|
if (sourceSpan.source === target && rangesTouch(deletion, targetChange)) {
|
|
@@ -18,13 +18,12 @@ export const replaceSchema = Type.Object(
|
|
|
18
18
|
path: Type.Optional(
|
|
19
19
|
Type.Union(resultInputSchema.anyOf, {
|
|
20
20
|
description:
|
|
21
|
-
"
|
|
21
|
+
"File path, SEARCH# reference, unchanged Read/Search/edit result or its UUID, or an array of them; a result selects only its ranges. Omit to reuse the file of the anchor, the last read or the preceding edit.",
|
|
22
22
|
}),
|
|
23
23
|
),
|
|
24
24
|
...sourceRangeProperties(),
|
|
25
25
|
text: Type.String({
|
|
26
|
-
description:
|
|
27
|
-
"Replacement text for each selected range. Empty text removes the selection; a whole-line selection removes its lines without inserting a blank line. Adjacent unselected lines are kept.",
|
|
26
|
+
description: "Replacement for each selected range; empty text deletes it.",
|
|
28
27
|
}),
|
|
29
28
|
},
|
|
30
29
|
{ additionalProperties: false },
|
|
@@ -38,7 +37,7 @@ interface ReplaceParameters {
|
|
|
38
37
|
|
|
39
38
|
export const replaceMutationTool: TextMutationToolRegistration<typeof replaceSchema> = {
|
|
40
39
|
name: "replace",
|
|
41
|
-
description: "Use replace to
|
|
40
|
+
description: "Use replace to change selected text.",
|
|
42
41
|
|
|
43
42
|
promptSnippet: "Make precise file edits by replacing text using exact matches or anchors",
|
|
44
43
|
parameters: replaceSchema,
|
|
@@ -7,43 +7,58 @@ export const writeSchema = Type.Object(
|
|
|
7
7
|
{
|
|
8
8
|
path: {
|
|
9
9
|
...resultInputSchema,
|
|
10
|
-
description:
|
|
11
|
-
"File path or one whole-file source result. Partial file scopes and multiple files are rejected. Use shell:<session> to send input to a running terminal.",
|
|
10
|
+
description: "File path, or an unchanged whole-file result.",
|
|
12
11
|
},
|
|
13
|
-
content: Type.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
content: Type.Union(
|
|
13
|
+
[
|
|
14
|
+
Type.String(),
|
|
15
|
+
Type.Object({ type: Type.Literal("image"), data: Type.String(), mimeType: Type.String() }),
|
|
16
|
+
Type.Object({
|
|
17
|
+
type: Type.Literal("images"),
|
|
18
|
+
images: Type.Array(Type.Object({ data: Type.String(), mimeType: Type.String() })),
|
|
19
|
+
}),
|
|
20
|
+
],
|
|
21
|
+
{
|
|
22
|
+
description:
|
|
23
|
+
"Complete file content. To save an image that read returned, pass that read result or its UUID and give path an image extension; several images become numbered files.",
|
|
24
|
+
},
|
|
25
|
+
),
|
|
17
26
|
},
|
|
18
27
|
{ additionalProperties: false },
|
|
19
28
|
);
|
|
20
29
|
|
|
21
30
|
interface WriteParameters {
|
|
22
31
|
readonly path: unknown;
|
|
23
|
-
readonly content:
|
|
32
|
+
readonly content: unknown;
|
|
24
33
|
}
|
|
25
34
|
|
|
26
35
|
export const writeMutationTool: TextMutationToolRegistration<typeof writeSchema> = {
|
|
27
36
|
name: "write",
|
|
28
37
|
description:
|
|
29
|
-
"Use write to create or
|
|
38
|
+
"Use write to create a file or replace all of its content, or to type into a terminal session.",
|
|
30
39
|
|
|
31
40
|
promptSnippet: "Create or overwrite files",
|
|
32
41
|
parameters: writeSchema,
|
|
33
42
|
source: { field: "path" },
|
|
34
43
|
anchors: [],
|
|
35
|
-
mutate: (context, parameters: WriteParameters) =>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
mutate: (context, parameters: WriteParameters) => {
|
|
45
|
+
// Image content is written as files before text mutation starts.
|
|
46
|
+
if (typeof parameters.content !== "string")
|
|
47
|
+
throw new Error("Image content must name images a Read returned.");
|
|
48
|
+
const content = parameters.content;
|
|
49
|
+
return {
|
|
50
|
+
edits: new Map([
|
|
51
|
+
[
|
|
52
|
+
context.sourceFor("path"),
|
|
53
|
+
{
|
|
54
|
+
changes:
|
|
55
|
+
context.sourceDocument.content === content
|
|
56
|
+
? []
|
|
57
|
+
: [context.sourceDocument.replaceAll(content)],
|
|
58
|
+
action: "overwritten",
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
]),
|
|
62
|
+
};
|
|
63
|
+
},
|
|
49
64
|
};
|
package/src/pi-agent-ide.ts
CHANGED
|
@@ -34,8 +34,14 @@ export default async function registerUnifiedPiAgentIde(pi: ExtensionAPI): Promi
|
|
|
34
34
|
const nestedRendering = createNestedIdeRendering(pi, hideCodemodeToolResults);
|
|
35
35
|
const textResults = createIdeTextResults(nestedRendering.api);
|
|
36
36
|
const availability = createIdeToolAvailability(textResults.api);
|
|
37
|
+
// Pi can still run an in-flight request's payload hook after it disposed the session that
|
|
38
|
+
// issued it. Its context is stale then, and the request is being cancelled anyway.
|
|
39
|
+
let shutDown = false;
|
|
40
|
+
pi.on("session_shutdown", () => {
|
|
41
|
+
shutDown = true;
|
|
42
|
+
});
|
|
37
43
|
pi.on("before_provider_request", (event, context) => {
|
|
38
|
-
if (context.model?.api !== "openai-responses") return;
|
|
44
|
+
if (shutDown || context.model?.api !== "openai-responses") return;
|
|
39
45
|
const names = new Set(
|
|
40
46
|
pi
|
|
41
47
|
.getAllTools()
|
|
@@ -45,6 +51,7 @@ export default async function registerUnifiedPiAgentIde(pi: ExtensionAPI): Promi
|
|
|
45
51
|
return preserveResponsesToolOmission(event.payload, names);
|
|
46
52
|
});
|
|
47
53
|
pi.on("session_start", (event, context) => {
|
|
54
|
+
shutDown = false;
|
|
48
55
|
// Pi 1.3 restores transcript tools and applies defaultTools and CLI +/- selections itself.
|
|
49
56
|
if (hostOwnsToolLoadout(VERSION)) {
|
|
50
57
|
availability.reconcile(true, [], true);
|
|
@@ -121,20 +128,6 @@ export default async function registerUnifiedPiAgentIde(pi: ExtensionAPI): Promi
|
|
|
121
128
|
"Skip automatic formatting and diagnostics after edits. Explicit diagnostic reads still work.",
|
|
122
129
|
default: false,
|
|
123
130
|
});
|
|
124
|
-
flags.register({
|
|
125
|
-
id: "pi-agent-ide-vision-arbitrary-windows",
|
|
126
|
-
name: "Capture arbitrary windows",
|
|
127
|
-
description:
|
|
128
|
-
"Allow window:PID capture for processes not owned by Agent IDE. Keep disabled unless the agent may inspect other desktop apps.",
|
|
129
|
-
default: false,
|
|
130
|
-
});
|
|
131
|
-
flags.register({
|
|
132
|
-
id: "pi-agent-ide-vision-displays",
|
|
133
|
-
name: "Capture full displays",
|
|
134
|
-
description:
|
|
135
|
-
"Allow display screenshots through display: and display:#N resources. Keep disabled unless the agent may inspect the full desktop.",
|
|
136
|
-
default: false,
|
|
137
|
-
});
|
|
138
131
|
flags.register({
|
|
139
132
|
id: "pi-agent-ide-no-diagnostic-buffer",
|
|
140
133
|
name: "Immediate diagnostic notices",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-ast",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,31 +8,31 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./api/scope": {
|
|
10
10
|
"types": "./src/api/scope.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-36.js"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"pi-agent-doctor": "0.
|
|
16
|
-
"pi-agent-documentation": "0.
|
|
17
|
-
"pi-agent-invariant": "0.
|
|
18
|
-
"pi-agent-read": "0.
|
|
19
|
-
"pi-agent-resource": "0.
|
|
20
|
-
"pi-agent-search": "0.
|
|
21
|
-
"pi-agent-search-text": "0.
|
|
22
|
-
"pi-agent-text": "0.
|
|
23
|
-
"pi-agent-text-editor": "0.
|
|
24
|
-
"pi-agent-tool-call-interception": "0.
|
|
25
|
-
"pi-agent-tool-ui": "0.
|
|
15
|
+
"pi-agent-doctor": "0.9.0",
|
|
16
|
+
"pi-agent-documentation": "0.9.0",
|
|
17
|
+
"pi-agent-invariant": "0.9.0",
|
|
18
|
+
"pi-agent-read": "0.9.0",
|
|
19
|
+
"pi-agent-resource": "0.9.0",
|
|
20
|
+
"pi-agent-search": "0.9.0",
|
|
21
|
+
"pi-agent-search-text": "0.9.0",
|
|
22
|
+
"pi-agent-text": "0.9.0",
|
|
23
|
+
"pi-agent-text-editor": "0.9.0",
|
|
24
|
+
"pi-agent-tool-call-interception": "0.9.0",
|
|
25
|
+
"pi-agent-tool-ui": "0.9.0"
|
|
26
26
|
},
|
|
27
27
|
"pi": {
|
|
28
28
|
"extensions": [
|
|
29
|
-
"./runtime/entry-
|
|
29
|
+
"./runtime/entry-37.js"
|
|
30
30
|
]
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@earendil-works/pi-coding-agent": "*",
|
|
34
34
|
"@earendil-works/pi-tui": "*",
|
|
35
|
-
"pi-agent-ide": "0.
|
|
35
|
+
"pi-agent-ide": "0.9.0",
|
|
36
36
|
"typebox": "*"
|
|
37
37
|
},
|
|
38
38
|
"peerDependenciesMeta": {
|
|
@@ -25,11 +25,13 @@ import { createAstOverflowHandler, reduceAstReadOutput } from "./overflow-handle
|
|
|
25
25
|
import { createAstScopePostReadHandler, createAstScopePresenter } from "./scope-handler.js";
|
|
26
26
|
import { createAstScopeAnchorResolver } from "./scope-resolver.js";
|
|
27
27
|
import { createAstSearchResolver } from "./search-resolver.js";
|
|
28
|
-
import {
|
|
28
|
+
import { registerAstSearchTool, type AstSearchRuntime } from "./tool-ast-search.js";
|
|
29
29
|
|
|
30
30
|
const renderReadResult = createReadResultRenderer({ kind: "code-view", label: "AST" });
|
|
31
31
|
|
|
32
32
|
export default async function registerAst(pi: ExtensionAPI): Promise<void> {
|
|
33
|
+
let resolveSearchApi!: (value: AstSearchRuntime) => void;
|
|
34
|
+
const searchApi = new Promise<AstSearchRuntime>((resolve) => (resolveSearchApi = resolve));
|
|
33
35
|
const manager = new AstScopeManager();
|
|
34
36
|
const presenter = createAstScopePresenter(manager);
|
|
35
37
|
|
|
@@ -74,10 +76,9 @@ export default async function registerAst(pi: ExtensionAPI): Promise<void> {
|
|
|
74
76
|
},
|
|
75
77
|
});
|
|
76
78
|
api.describe({
|
|
77
|
-
path: "ast:<path> —
|
|
78
|
-
views: "ast — scope boundaries
|
|
79
|
+
path: "ast:<path> — declaration outline.",
|
|
80
|
+
views: "ast — scope boundaries.",
|
|
79
81
|
});
|
|
80
|
-
await registerSelect(pi, api);
|
|
81
82
|
},
|
|
82
83
|
} satisfies ReadPlugin;
|
|
83
84
|
const editorPlugin = {
|
|
@@ -103,11 +104,10 @@ export default async function registerAst(pi: ExtensionAPI): Promise<void> {
|
|
|
103
104
|
apiVersion: SEARCH_API_VERSION,
|
|
104
105
|
id: "ast-search",
|
|
105
106
|
setup(api): void {
|
|
106
|
-
|
|
107
|
-
api.
|
|
108
|
-
"Search code structure with ast:<pattern>, using source-code syntax and placeholders such as $NAME for one node and $$$BODY for several nodes. path, include and exclude narrow the search. Use returned SEARCH# references to read, replace, copy, move or delete exact AST matches, including multiline nodes. A single :match reference becomes stale after its file changes; :all:match reruns the original structural query. Incomplete results do not provide all selections. Use the displayed capture NAME reference as a Search/Select/edit source. Single captures contain one node; multi captures retain provider nodes, including punctuation. Strict result scopes return only wholly contained matches. These edits do not update imports or references.",
|
|
109
|
-
);
|
|
107
|
+
// Not registered with search: ast_search runs it through the shared execution core.
|
|
108
|
+
resolveSearchApi({ api, resolver: createAstSearchResolver(api.registerSelection) });
|
|
110
109
|
},
|
|
111
110
|
}),
|
|
111
|
+
registerAstSearchTool(pi, () => searchApi),
|
|
112
112
|
]);
|
|
113
113
|
}
|
|
@@ -6,8 +6,8 @@ import { requiredValue } from "pi-agent-invariant";
|
|
|
6
6
|
import type { SearchPluginApi, SearchSelectionMatch } from "pi-agent-search/api/search";
|
|
7
7
|
|
|
8
8
|
import type { SearchEnvironment, SearchRequest, SearchResolver } from "pi-agent-search/api/search";
|
|
9
|
-
import { selectionData, containsSearchMatch } from "pi-agent-search/api/search";
|
|
10
|
-
import { verifyResultTargets } from "pi-agent-resource";
|
|
9
|
+
import { selectionData, containsSearchMatch, splitGlobList } from "pi-agent-search/api/search";
|
|
10
|
+
import { verifyResultTargets, type ResolvedResultTargets } from "pi-agent-resource";
|
|
11
11
|
import { renderSearchResult } from "pi-agent-search-text/rendering";
|
|
12
12
|
|
|
13
13
|
import { createAstSearchPresentation } from "./search-presentation.js";
|
|
@@ -33,6 +33,57 @@ interface AstCapture {
|
|
|
33
33
|
readonly range: AstGrepMatch["range"];
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
/** Options the `ast_search` tool passes in `SearchRequest.options.ast`; their presence selects this resolver. */
|
|
37
|
+
export interface AstSearchOptions {
|
|
38
|
+
readonly pattern?: string;
|
|
39
|
+
/** An ast-grep rule object (the value of `rule:` in a rule file); requires `language`. */
|
|
40
|
+
readonly rule?: Readonly<Record<string, unknown>>;
|
|
41
|
+
readonly language?: string;
|
|
42
|
+
/** `inside` keeps matches within the scope ranges; `enclosing` keeps the innermost match containing each range. */
|
|
43
|
+
readonly relation?: "inside" | "enclosing";
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function astOptions(request: SearchRequest): AstSearchOptions | undefined {
|
|
47
|
+
const value = request.options?.ast;
|
|
48
|
+
return typeof value === "object" && value !== null ? value : undefined;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface Position {
|
|
52
|
+
readonly line: number;
|
|
53
|
+
readonly column: number;
|
|
54
|
+
}
|
|
55
|
+
const before = (a: Position, b: Position) =>
|
|
56
|
+
a.line < b.line || (a.line === b.line && a.column <= b.column);
|
|
57
|
+
|
|
58
|
+
/** For each scope range, keep the smallest match that wholly contains it, once per match. */
|
|
59
|
+
function innermostEnclosing<T extends { readonly selection: SearchSelectionMatch }>(
|
|
60
|
+
eligible: readonly T[],
|
|
61
|
+
targets: ResolvedResultTargets["targets"],
|
|
62
|
+
): T[] {
|
|
63
|
+
const chosen = new Set<T>();
|
|
64
|
+
for (const target of targets) {
|
|
65
|
+
for (const range of target.ranges) {
|
|
66
|
+
const start = { line: range.start.lineNumber, column: range.start.column };
|
|
67
|
+
const end = { line: range.end.lineNumber, column: range.end.column };
|
|
68
|
+
let best: T | undefined;
|
|
69
|
+
let bestLength = Number.POSITIVE_INFINITY;
|
|
70
|
+
for (const item of eligible) {
|
|
71
|
+
const match = item.selection;
|
|
72
|
+
if (match.source !== target.source) continue;
|
|
73
|
+
const matchStart = { line: match.lineNumber, column: match.startColumn };
|
|
74
|
+
const matchEnd = { line: match.endLineNumber ?? match.lineNumber, column: match.endColumn };
|
|
75
|
+
if (!before(matchStart, start) || !before(end, matchEnd)) continue;
|
|
76
|
+
if (match.matchedText.length < bestLength) {
|
|
77
|
+
best = item;
|
|
78
|
+
bestLength = match.matchedText.length;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (best !== undefined) chosen.add(best);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return eligible.filter((item) => chosen.has(item));
|
|
85
|
+
}
|
|
86
|
+
|
|
36
87
|
/** Search existing AST patterns inside exact source scopes and retain associated capture targets. */
|
|
37
88
|
export function createAstSearchResolver(
|
|
38
89
|
registerSelection: SearchPluginApi["registerSelection"],
|
|
@@ -41,19 +92,30 @@ export function createAstSearchResolver(
|
|
|
41
92
|
id: "ast",
|
|
42
93
|
supportsResultScope: true,
|
|
43
94
|
readResources: (request, context) =>
|
|
44
|
-
request
|
|
45
|
-
?
|
|
46
|
-
: [],
|
|
95
|
+
astOptions(request) === undefined
|
|
96
|
+
? []
|
|
97
|
+
: (context.scope?.targets.map((target) => target.source) ?? [request.path ?? context.cwd]),
|
|
47
98
|
renderResult: renderSearchResult as SearchResolver["renderResult"],
|
|
48
99
|
async tryResolve(request, context) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
100
|
+
const options = astOptions(request);
|
|
101
|
+
if (options === undefined) return { kind: "not-handled" };
|
|
52
102
|
|
|
53
|
-
const pattern =
|
|
103
|
+
const pattern = options.pattern?.trim() ?? "";
|
|
104
|
+
const enclosing = options.relation === "enclosing";
|
|
54
105
|
|
|
55
|
-
if (pattern.length === 0) {
|
|
56
|
-
return { kind: "failed", error: new Error("
|
|
106
|
+
if (pattern.length === 0 && options.rule === undefined) {
|
|
107
|
+
return { kind: "failed", error: new Error("Pass a pattern or a rule.") };
|
|
108
|
+
}
|
|
109
|
+
if (options.rule !== undefined && (options.language ?? "").trim().length === 0) {
|
|
110
|
+
return { kind: "failed", error: new Error("A rule requires language.") };
|
|
111
|
+
}
|
|
112
|
+
if (enclosing && context.scope === undefined) {
|
|
113
|
+
return {
|
|
114
|
+
kind: "failed",
|
|
115
|
+
error: new Error(
|
|
116
|
+
'relation "enclosing" needs a Read, Search or edit result as path; it returns the innermost match containing each of its ranges.',
|
|
117
|
+
),
|
|
118
|
+
};
|
|
57
119
|
}
|
|
58
120
|
|
|
59
121
|
const owner = (source: string): SearchEnvironment | undefined =>
|
|
@@ -95,7 +157,11 @@ export function createAstSearchResolver(
|
|
|
95
157
|
await selectionMatches([match], context.cwd, signal, owner(match.file))
|
|
96
158
|
)[0];
|
|
97
159
|
if (selection === undefined) throw new Error("Missing AST selection snapshot");
|
|
98
|
-
if (
|
|
160
|
+
if (
|
|
161
|
+
!enclosing &&
|
|
162
|
+
context.scope !== undefined &&
|
|
163
|
+
!containsSearchMatch(context.scope, selection)
|
|
164
|
+
)
|
|
99
165
|
continue;
|
|
100
166
|
eligible.push({
|
|
101
167
|
selection,
|
|
@@ -112,12 +178,17 @@ export function createAstSearchResolver(
|
|
|
112
178
|
},
|
|
113
179
|
});
|
|
114
180
|
}
|
|
115
|
-
const
|
|
181
|
+
const candidates =
|
|
182
|
+
enclosing && context.scope !== undefined
|
|
183
|
+
? innermostEnclosing(eligible, context.scope.targets)
|
|
184
|
+
: eligible;
|
|
185
|
+
const kept = candidates.slice(0, request.limit ?? 100);
|
|
116
186
|
if (context.scope !== undefined) await verifyResultTargets(context.scope, signal);
|
|
117
187
|
return {
|
|
118
188
|
raw: kept.map((item) => item.raw),
|
|
119
189
|
matches: kept.map((item) => item.selection),
|
|
120
|
-
complete:
|
|
190
|
+
complete:
|
|
191
|
+
(context.scope?.complete ?? true) && candidates.length <= (request.limit ?? 100),
|
|
121
192
|
};
|
|
122
193
|
};
|
|
123
194
|
const selected = await collect(context.signal);
|
|
@@ -133,7 +204,10 @@ export function createAstSearchResolver(
|
|
|
133
204
|
...Object.fromEntries(
|
|
134
205
|
Object.entries(raw.metaVariables?.single ?? {}).map(([name, node]) => [name, [node]]),
|
|
135
206
|
),
|
|
136
|
-
|
|
207
|
+
// `scan` reports relational rule labels as a `secondary` group; they are not captures.
|
|
208
|
+
...Object.fromEntries(
|
|
209
|
+
Object.entries(raw.metaVariables?.multi ?? {}).filter(([name]) => name !== "secondary"),
|
|
210
|
+
),
|
|
137
211
|
});
|
|
138
212
|
const projected = [];
|
|
139
213
|
const groupsForMatch: Record<string, { target: string; nodes: number }> = {};
|
|
@@ -318,13 +392,25 @@ function runAstGrep(
|
|
|
318
392
|
environment?: SearchEnvironment,
|
|
319
393
|
): Promise<AstGrepMatch[]> {
|
|
320
394
|
signal?.throwIfAborted();
|
|
321
|
-
const
|
|
395
|
+
const { rule, language } = astOptions(request) ?? {};
|
|
396
|
+
// A rule runs through `scan` with one inline rule; JSON is valid YAML for ast-grep.
|
|
397
|
+
const arguments_ =
|
|
398
|
+
rule === undefined
|
|
399
|
+
? ["run", "--pattern", pattern, "--json=compact", "--no-ignore", "parent"]
|
|
400
|
+
: [
|
|
401
|
+
"scan",
|
|
402
|
+
"--inline-rules",
|
|
403
|
+
JSON.stringify({ id: "ast_search", language, severity: "hint", rule }),
|
|
404
|
+
"--json=compact",
|
|
405
|
+
"--no-ignore",
|
|
406
|
+
"parent",
|
|
407
|
+
];
|
|
322
408
|
|
|
323
|
-
for (const include of
|
|
409
|
+
for (const include of splitGlobList(request.include)) {
|
|
324
410
|
arguments_.push("--globs", include);
|
|
325
411
|
}
|
|
326
412
|
|
|
327
|
-
for (const exclude of
|
|
413
|
+
for (const exclude of splitGlobList(request.exclude)) {
|
|
328
414
|
arguments_.push("--globs", `!${exclude}`);
|
|
329
415
|
}
|
|
330
416
|
|
|
@@ -408,11 +494,3 @@ async function runOwnedAstGrep(
|
|
|
408
494
|
file: environment.resolve(executionCwd, match.file),
|
|
409
495
|
}));
|
|
410
496
|
}
|
|
411
|
-
function splitGlobs(value: string | undefined): string[] {
|
|
412
|
-
return (
|
|
413
|
-
value
|
|
414
|
-
?.split(",")
|
|
415
|
-
.map((item) => item.trim())
|
|
416
|
-
.filter(Boolean) ?? []
|
|
417
|
-
);
|
|
418
|
-
}
|