pi-agent-ide 0.8.3 → 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 +65 -0
- package/README.md +24 -29
- package/dist/chunk-2AY526TN.js +3 -0
- 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-4W7GH3T7.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/ast/manager.ts +13 -1
- 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/ast/manager.ts +13 -1
- 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-UEVGZUII.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
package/dist/entry-37.js
CHANGED
|
@@ -1 +1,15 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{a as me}from"./chunk-LEKC4GQK.js";import{b as he,c as ge}from"./chunk-2AY526TN.js";import"./chunk-NNCZYO4Q.js";import{b as E}from"./chunk-2TZDG2JH.js";import"./chunk-IG5DXVDJ.js";import{f as J,g as X}from"./chunk-XH5WN5XA.js";import{b as ce,c as le}from"./chunk-R2U5WXYR.js";import{a as ne}from"./chunk-47SPPIXK.js";import{a as Q,b as Z}from"./chunk-VAXLSPPU.js";import{b as ae,c as P}from"./chunk-FYOU4RBH.js";import{b as ee,c as te,d as O}from"./chunk-7PVDTMEM.js";import{f as K,g as Y}from"./chunk-KN6VPARZ.js";import{a as oe}from"./chunk-MDD5ORB6.js";import{b as re,c as se}from"./chunk-MLFJU2US.js";import{d as z}from"./chunk-OMNKD7WW.js";import{e as W}from"./chunk-PS2B6THP.js";import{a as ie}from"./chunk-GXL4NMHR.js";import{c as G,d as F,e as U}from"./chunk-PQWANILR.js";import{a as V}from"./chunk-BU7IZLKB.js";import{a as H,b as B}from"./chunk-S5PL5DFQ.js";import{K as _,M as v,m as j,n as D}from"./chunk-DDH3FP4G.js";import{h as fe}from"./chunk-TVH2ND35.js";import{a as de,b as ue,c as pe}from"./chunk-T4FTT3U4.js";import"./chunk-VDJSH3DQ.js";import"./chunk-KINKBPPX.js";import"./chunk-756K3LJY.js";import{a as q}from"./chunk-ZC65Z3CK.js";import{a as u}from"./chunk-EI7MMDWY.js";import{readFile as je}from"node:fs/promises";var De={cmake:"no compatible Tree-sitter parser is packaged",dockerfile:"no compatible Tree-sitter parser is packaged",julia:"no compatible Tree-sitter parser is packaged",powershell:"no compatible Tree-sitter parser is packaged",r:"no compatible Tree-sitter parser is packaged",svelte:"the container grammar is not available as an ast-grep language package",terraform:"the HCL grammar is not available as an ast-grep language package",vue:"the container grammar is not available as an ast-grep language package",xml:"no compatible Tree-sitter parser is packaged",zig:"no compatible Tree-sitter parser is packaged"},L=new Set(["c","cpp","csharp","css","dart","elixir","go","html","java","kotlin","lua","markdown","php","ruby","scala","shell","sql","swift","javascript","typescript","python","rust","json","yaml","toml"]),ye={protocol:re,apiVersion:se,id:"ast",setup(s){s.addSetupCheck({id:"structural-search",async inspect(e){return[...e.detectedLanguageIds].some(r=>L.has(r))?await le(e,"ast-grep")?{}:{actions:[{id:"ast-grep-unavailable",message:"Structural search is unavailable because ast-grep was not found"}]}:{}}}),s.addCheck({id:"parsers",title:"AST",async run(e){let n=[];for(let r of e.detectedLanguageIds){let t=De[r];if(t!==void 0){n.push({status:"skip",message:`${r} AST is unavailable: ${t}`});continue}if(!L.has(r))continue;let a=e.files.find(i=>_e(i,r));if(a!==void 0)try{e.signal?.throwIfAborted();let i=e.workspace?await e.workspace.readText(a,e.signal):await je(a,{encoding:"utf8",signal:e.signal});if(i===void 0)throw new Error(`Source disappeared: ${a}`);e.signal?.throwIfAborted();let o=await he(a,e.cwd,i.replaceAll(`\r
|
|
2
|
+
`,`
|
|
3
|
+
`).split(`
|
|
4
|
+
`));n.push(o===void 0?{status:"fail",message:`${r} parser did not return a tree`}:{status:"pass",message:`${r} parser loaded`,detail:a})}catch(i){e.signal?.throwIfAborted(),n.push({status:"fail",message:`${r}: ${i instanceof Error?i.message:String(i)}`})}}return n.length>0?n:[{status:"skip",message:"No supported AST files found"}]}}),s.addCheck({id:"ast-grep",title:"Structural search",async run(e){if(![...e.detectedLanguageIds].some(r=>L.has(r)))return[{status:"skip",message:"No supported structural-search files found"}];let n=await ce(e,"ast-grep",["--version"]);return[n.ok?{status:"pass",message:"ast-grep is available",detail:n.detail}:{status:"fail",message:"ast-grep is not available",detail:n.detail}]}})}};function _e(s,e){let n=s.slice(s.lastIndexOf(".")).toLowerCase();return{c:[".c",".h"],cpp:[".cc",".cpp",".cxx",".hh",".hpp",".hxx"],csharp:[".cs"],css:[".css",".scss",".less"],dart:[".dart"],elixir:[".ex",".exs"],go:[".go"],html:[".html",".htm"],java:[".java"],kotlin:[".kt",".kts"],lua:[".lua"],markdown:[".md",".mdx"],php:[".php"],ruby:[".rb",".rake"],scala:[".scala",".sc"],shell:[".sh",".bash"],sql:[".sql"],swift:[".swift"],javascript:[".js",".jsx",".mjs",".cjs"],typescript:[".ts",".tsx",".mts",".cts"],python:[".py",".pyi"],rust:[".rs"],json:[".json",".jsonc"],yaml:[".yaml",".yml"],toml:[".toml"]}[e]?.includes(n)??!1}u(_e,"matchesLanguage");var He,Be;function Se(s,e){return{id:"ast",tryResolve(n,r){return Promise.resolve(Ve(n,r,s,e))}}}u(Se,"createAstOutlineResolver");function Ve(s,e,n,r){let t;try{t=de(s,"ast")}catch(o){return{kind:"failed",error:o}}if(t===void 0)return{kind:"not-handled"};let a;try{a=ue(t.path,e.cwd)}catch(o){return{kind:"failed",error:o}}let i=pe("ast",a);return{kind:"resolved",resource:{source:a,link:i,async read({signal:o}){o?.throwIfAborted();let c=await(Be??=import("./chunk-AJZVKDYC.js")),d=n??(He??=new c.AstOutlineManager),l;if(a.startsWith("ssh://")){if(r===void 0)throw new Error("No AST snapshot owner for this resource.");let f=await r(a,{...e,signal:o});if(Buffer.byteLength(f.lines.join(`
|
|
5
|
+
`))>me)throw new Error("File exceeds the 262144-byte AST outline limit.");if(f.lines.some(h=>h.includes("\0")))throw new Error("Binary resources cannot be read as AST outlines.");l=await d.readDocumentOutline(f.source,e.cwd,f.lines)}else l=await d.readFileOutline(a,e.cwd);return o?.throwIfAborted(),[c.formatAstOutline(l)]}}}}u(Ve,"resolveAstOutlineSource");import{DEFAULT_MAX_BYTES as Ge,DEFAULT_MAX_LINES as Fe,truncateHead as k}from"@earendil-works/pi-coding-agent";var M=u(async(s,e,n)=>{let{source:r,resolvedBy:t,lines:a,totalLines:i,startLine:o}=s.details;if(!(r===void 0||t!=="filesystem"&&!r.startsWith("ssh://")||a===void 0||a.length!==i||o!==void 0&&o!==1))try{let{AstOutlineManager:c,isSupportedOutlinePath:d}=await import("./chunk-AJZVKDYC.js");if(!d(r))return;let l=u(p=>[`Code overview of ${p.path}, source lines 1-${p.totalLines}: the requested text exceeded the output limit.`,`Some source text is omitted. Read ${JSON.stringify(r)} with offset and limit for exact source text.`,...p.renderedLines.map(g=>`${g.sourceLine?.lineNumber??"\u2026"} | ${g.text}`)].join(`
|
|
6
|
+
`),"format");e.signal?.throwIfAborted();let f=await new c(12).readDocumentOutline(r,e.cwd,a.map(p=>p.content),p=>(e.signal?.throwIfAborted(),!k(l(p),n).truncated)),h=l(f);return k(h,n).truncated?void 0:{script:s.script,content:[{type:"text",text:h}],details:{source:r,resolvedBy:"ast-overflow"}}}catch{e.signal?.throwIfAborted();return}},"reduceAstReadOutput");function Ae(){return async s=>{let{state:e,result:n}=s,r=n?.content.length===1?n.content[0]:void 0;if(s.audience==="script"||n===void 0||e?.contentKind!=="text"||e.resolvedBy!=="filesystem"&&!e.source.startsWith("ssh://")||r?.type!=="text"||!k(r.text).truncated)return{kind:"continue",context:s};let t=await M({...n,details:{...n.details,source:e.source,resolvedBy:e.resolvedBy,lines:e.text.lines,startLine:1,totalLines:e.text.lines.length}},s.resolverContext,{maxBytes:Ge,maxLines:Fe});return t===void 0?{kind:"continue",context:s}:{kind:"continue",context:s,transform:u(a=>({...t,script:a.script}),"transform")}}}u(Ae,"createAstOverflowHandler");var we="pi-agent-ast";function Re(s){return{id:"ast-scopes",async present(e,n){if(n.resolvedBy!=="filesystem"&&!e.source.startsWith("ssh://"))return e;try{let r=await s.getDocumentScopes(e.source,n.cwd,e.lines.map(a=>a.content)),t=Ue(e.lines,r);return t===e.lines?e:{...e,lines:t}}catch{return e}}}}u(Re,"createAstScopePresenter");function be(){return s=>{let e=s.state,n=s.result;if(e?.contentKind!=="text"||n===void 0)return{kind:"continue",context:s};let r=n.details.lines;if(r===void 0)return{kind:"continue",context:s};let t=new Map(e.text.lines.map(l=>[l.lineNumber,l])),a=new Set(r.map(l=>l.lineNumber)),i=new Map;for(let l of r){let f=t.get(l.lineNumber),h=Te(f);for(let p of h?.boundaries??[]){if(a.has(p.endLine))continue;let g=t.get(p.endLine);g!==void 0&&i.set(p.endLine,g)}}if(i.size===0)return{kind:"continue",context:s};let o=[...i.values()].sort((l,f)=>l.lineNumber-f.lineNumber),c=[...r,...o],d=r.at(-1);return{kind:"continue",context:s,transform:u(l=>We(l,c,d),"transform")}}}u(be,"createAstScopePostReadHandler");function Ue(s,e){if(e.length===0)return s;let n=new Map,r=new Map;for(let t of e){let a=n.get(t.startLine)??[];a.push(t.beginAnchor.value),n.set(t.startLine,a);let i=r.get(t.startLine)??[];i.push({endLine:t.endLine,beginAnchor:t.beginAnchor.value,endAnchor:t.endScopeAnchor.value}),r.set(t.startLine,i);let o=n.get(t.endLine)??[];o.push(t.endScopeAnchor.value),n.set(t.endLine,o)}return s.map(t=>{let a=n.get(t.lineNumber),i=r.get(t.lineNumber);return a===void 0&&i===void 0?t:{...t,...a!==void 0&&{anchors:[...new Set([...t.anchors??[],...a])],presentation:{...t.presentation,suffix:`${t.presentation?.suffix??""}${a.map(o=>` <!-- ${o} -->`).join("")}`}},metadata:{...t.metadata,[we]:{...Te(t),...i!==void 0&&{boundaries:i}}}}})}u(Ue,"addScopeMarkers");function Te(s){let e=s?.metadata?.[we];if(!(typeof e!="object"||e===null))return e}u(Te,"getAstScopeMetadata");function We(s,e,n){let r=s.content.length===1?s.content[0]:void 0;if(r?.type!=="text"||s.details.lines===void 0)return s;let t=e.slice(s.details.lines.length);if(t.length===0)return s;let a=n?.lineEnding!==void 0&&n.lineEnding.length>0?n.lineEnding:t[0]?.lineEnding!==void 0&&t[0].lineEnding.length>0?t[0].lineEnding:`
|
|
7
|
+
`,i=t.map((d,l)=>{let h=l===t.length-1?d.lineEnding:d.lineEnding||a,p=d.presentation?.prefix??"",g=d.presentation?.suffix??"";return`${p}${d.content}${g}${h}`}).join(""),o=/(?:\r\n|\r|\n)$/.test(r.text)?"":a,c=`${r.text}${o}${i}`;return{...s,content:[{...r,text:c}],details:{...s.details,lines:e}}}u(We,"appendTextLines");var ve=/^scope-(begin|end)-[A-Z0-9]{3,4}(?:-[1-9]\d*)?$/;function Oe(s){return{id:"ast-scope",description:'`scope-begin-HASH` / `scope-end-HASH` from read views: ["ast"] \u2014 first/last lines of a scope. Any numeric suffix is part of the anchor.',renderFull(e){return e},renderCompact(e){return ve.exec(e)?.[1]==="begin"?"scope start":"scope end"},async tryResolve(e,n){if(!ve.test(e))return{kind:"not-handled"};try{let t=(await s.getDocumentScopes(n.source,n.cwd,n.lines)).find(a=>a.beginAnchor.value===e||a.endScopeAnchor.value===e);return t===void 0?{kind:"rejected",rejection:{code:"stale",reason:`AST scope anchor ${e} is stale`}}:{kind:"resolved",anchor:t.beginAnchor.value===e?t.beginAnchor:t.endScopeAnchor}}catch(r){return{kind:"failed",error:r}}}}}u(Oe,"createAstScopeAnchorResolver");import Ke from"cross-spawn";import{readFile as Ye,stat as Pe}from"node:fs/promises";import Qe from"node:path";import Ee from"node:path";import{pathToFileURL as Je}from"node:url";function xe(s,e,n,r,t){let a=new Map;for(let o of e){let c=a.get(o.file)??[];c.push(o),a.set(o.file,c)}let i=[...a.entries()].map(([o,c])=>Xe(o,c,r));return{sessionId:t,query:s,matchCount:e.length,fileCount:i.length,complete:n,files:i}}u(xe,"createAstSearchPresentation");function Xe(s,e,n){let r=new Map;e.forEach((o,c)=>{let d=o.lines.replace(/\r/gu,"").split(`
|
|
8
|
+
`);d.at(-1)===""&&d.pop();let l=`${s}:${String(c)}`;d.forEach((f,h)=>{let p=o.range.start.line+h+1,g=qe(o,f,h,d.length);if(g===void 0)return;let S=r.get(p)??{text:f,ranges:[],logicalMatchIds:[]};S.ranges.push(g),S.logicalMatchIds.push(l),r.set(p,S)})});let t=[...r.entries()].sort(([o],[c])=>o-c).map(([o,c])=>{let d=ze(c.ranges);return{lineNumber:o,text:c.text,matchCount:d.length,ranges:d,logicalMatchIds:[...new Set(c.logicalMatchIds)]}}),a=s.includes("://"),i=a?s:Ee.resolve(n,s);return{path:a?i:Ee.relative(n,i),link:a?i:Je(i).href,matchCount:e.length,lines:t}}u(Xe,"createFilePresentation");function qe(s,e,n,r){let t=n===0,a=n===r-1,i=t?s.range.start.column:0,o=a?s.range.end.column:e.length;if(!(o<=i))return{from:Math.min(i,e.length),to:Math.min(o,e.length)}}u(qe,"highlightedRange");function ze(s){let e=[...s].sort((r,t)=>r.from-t.from||r.to-t.to),n=[];for(let r of e){let t=n.at(-1);t===void 0||r.from>t.to?n.push(r):n[n.length-1]={from:t.from,to:Math.max(t.to,r.to)}}return n}u(ze,"mergeRanges");function I(s){let e=s.options?.ast;return typeof e=="object"&&e!==null?e:void 0}u(I,"astOptions");var Le=u((s,e)=>s.line<e.line||s.line===e.line&&s.column<=e.column,"before");function Ze(s,e){let n=new Set;for(let r of e)for(let t of r.ranges){let a={line:t.start.lineNumber,column:t.start.column},i={line:t.end.lineNumber,column:t.end.column},o,c=Number.POSITIVE_INFINITY;for(let d of s){let l=d.selection;if(l.source!==r.source)continue;let f={line:l.lineNumber,column:l.startColumn},h={line:l.endLineNumber??l.lineNumber,column:l.endColumn};!Le(f,a)||!Le(i,h)||l.matchedText.length<c&&(o=d,c=l.matchedText.length)}o!==void 0&&n.add(o)}return s.filter(r=>n.has(r))}u(Ze,"innermostEnclosing");function Ie(s){return{id:"ast",supportsResultScope:!0,readResources:u((e,n)=>I(e)===void 0?[]:n.scope?.targets.map(r=>r.source)??[e.path??n.cwd],"readResources"),renderResult:E,async tryResolve(e,n){let r=I(e);if(r===void 0)return{kind:"not-handled"};let t=r.pattern?.trim()??"",a=r.relation==="enclosing";if(t.length===0&&r.rule===void 0)return{kind:"failed",error:new Error("Pass a pattern or a rule.")};if(r.rule!==void 0&&(r.language??"").trim().length===0)return{kind:"failed",error:new Error("A rule requires language.")};if(a&&n.scope===void 0)return{kind:"failed",error:new Error('relation "enclosing" needs a Read, Search or edit result as path; it returns the innermost match containing each of its ranges.')};let i=u(p=>n.environmentForSource?.(p)??n.environment,"owner"),o=u(async p=>{n.scope!==void 0&&await v(n.scope,p);let g=[];if(n.scope===void 0)g.push(...await Me(t,e,n.cwd,p,n.environment));else for(let m of new Set(n.scope.targets.map(A=>A.source)))p?.throwIfAborted(),g.push(...await Me(t,{...e,path:m},n.cwd,p,i(m)));let S=g.map(m=>({...m,file:x(n.cwd,m.file,i(m.file))}));S.sort((m,A)=>m.file.localeCompare(A.file)||m.range.byteOffset.start-A.range.byteOffset.start||m.range.byteOffset.end-A.range.byteOffset.end);let T=[];for(let m of S){let A=(await ke([m],n.cwd,p,i(m.file)))[0];if(A===void 0)throw new Error("Missing AST selection snapshot");!a&&n.scope!==void 0&&!ae(n.scope,A)||T.push({selection:A,raw:{...m,range:{...m.range,start:{line:A.lineNumber-1,column:A.startColumn},end:{line:(A.endLineNumber??A.lineNumber)-1,column:A.endColumn}}}})}let w=a&&n.scope!==void 0?Ze(T,n.scope.targets):T,b=w.slice(0,e.limit??100);return n.scope!==void 0&&await v(n.scope,p),{raw:b.map(m=>m.raw),matches:b.map(m=>m.selection),complete:(n.scope?.complete??!0)&&w.length<=(e.limit??100)}},"collect"),c=await o(n.signal),d=await s({request:e,matches:c.matches,complete:c.complete,refresh:o},n),l=O(c.matches,c.complete,d.id,d),f=[],h=[];for(let p of c.raw.slice(0,l.matches.length)){let g=Object.entries({...Object.fromEntries(Object.entries(p.metaVariables?.single??{}).map(([w,b])=>[w,[b]])),...Object.fromEntries(Object.entries(p.metaVariables?.multi??{}).filter(([w])=>w!=="secondary"))}),S=[],T={};for(let[w,b]of g){for(let R of b)if(R.range.byteOffset.start<p.range.byteOffset.start||R.range.byteOffset.end>p.range.byteOffset.end)throw new Error("AST capture lies outside its parent match.");let m=await ke(b.map(R=>({...p,...R})),n.cwd,n.signal,i(p.file)),A=await s({request:e,matches:m,complete:c.complete,refresh:u(async()=>{throw new Error("Capture snapshots cannot refresh; repeat the AST search.")},"refresh")},n);T[w]={target:q(O(m,c.complete,void 0,A).target),nodes:m.length};let N=[];for(let R=0;R<m.length;R+=100){let $=m.slice(R,R+100),$e=await s({request:e,matches:$,complete:c.complete,refresh:u(async()=>{throw new Error("Capture snapshots cannot refresh; repeat the AST search.")},"refresh")},n);N.push(...O($,c.complete,void 0,$e).matches)}S.push([w,N])}f.push(Object.fromEntries(S)),h.push(T)}return n.scope!==void 0&&await v(n.scope,n.signal),{kind:"resolved",payload:{data:{...l,matches:l.matches.map((p,g)=>({...p,captures:f[g]}))},captureGroups:h,pattern:t,matches:c.raw.map((p,g)=>({...p,selection:c.matches[g]})),complete:c.complete,sessionId:d.id,presentation:xe(e.query,c.raw,c.complete,n.cwd,d.id)}}},toScriptData(e){return e.data},format(e){let n=e;if(n.matches.length===0)return{content:[{type:"text",text:"No AST matches found."}],details:n.presentation};let r=n.matches.flatMap((t,a)=>{let i=[`SEARCH#${n.sessionId}:${a+1}:match ${t.file}:${t.range.start.line+1}:${t.range.start.column+1} ${t.language}`,` ${t.lines.trim()}`];for(let[o,c]of Object.entries(n.captureGroups[a]??{}))i.push(` capture ${o}: ${c.target} ${c.nodes} node(s)`);return i});return n.complete&&r.unshift(`SEARCH#${n.sessionId}:all:match selects all exact AST matches.`),{content:[{type:"text",text:r.join(`
|
|
9
|
+
`)}],details:n.presentation}}}}u(Ie,"createAstSearchResolver");async function ke(s,e,n,r){let t=new Map;for(let a of s){let i=x(e,a.file,r);if(!t.has(i))if(r!==void 0)t.set(i,Buffer.from(await r.readText(i,n)));else{let o=await Pe(i),c=await Ye(i,{signal:n}),d=await Pe(i);if(o.mtimeMs!==d.mtimeMs||o.size!==d.size)throw new Error("AST source changed during search. Run the structural query again.");t.set(i,c)}}return s.map(a=>{let i=x(e,a.file,r),o=t.get(i);if(o===void 0)throw new Error("Missing AST source snapshot");let{start:c,end:d}=a.range.byteOffset;if(!Number.isInteger(c)||!Number.isInteger(d)||c<0||d<c||d>o.length||o.subarray(c,d).toString("utf8")!==a.text)throw new Error("AST range does not match its source snapshot. Search again.");let l=o.subarray(0,c).toString("utf8"),f=o.subarray(0,d).toString("utf8"),h=l.split(`
|
|
10
|
+
`).length;return{source:i,lineNumber:h,endLineNumber:f.split(`
|
|
11
|
+
`).length,startColumn:l.length-l.lastIndexOf(`
|
|
12
|
+
`)-1,endColumn:f.length-f.lastIndexOf(`
|
|
13
|
+
`)-1,matchedText:a.text,lineText:o.toString("utf8").split(`
|
|
14
|
+
`)[h-1]?.replace(/\r$/u,"")??""}})}u(ke,"selectionMatches");function Me(s,e,n,r,t){r?.throwIfAborted();let{rule:a,language:i}=I(e)??{},o=a===void 0?["run","--pattern",s,"--json=compact","--no-ignore","parent"]:["scan","--inline-rules",JSON.stringify({id:"ast_search",language:i,severity:"hint",rule:a}),"--json=compact","--no-ignore","parent"];for(let c of P(e.include))o.push("--globs",c);for(let c of P(e.exclude))o.push("--globs",`!${c}`);return t!==void 0?et(t,o,e,n,r):(x(n,e.path??"."),o.push(e.path??"."),new Promise((c,d)=>{let l=Ke("ast-grep",o,{cwd:n,stdio:["ignore","pipe","pipe"]}),f="",h="";l.stdout.setEncoding("utf8"),l.stderr.setEncoding("utf8"),l.stdout.on("data",g=>f+=g),l.stderr.on("data",g=>h+=g);let p=u(()=>{l.kill("SIGTERM")},"abort");r?.addEventListener("abort",p,{once:!0}),l.once("error",d),l.once("close",g=>{if(r?.removeEventListener("abort",p),r?.aborted===!0){d(r.reason instanceof Error?r.reason:new Error("AST search aborted"));return}if(g!==0&&g!==1){d(new Error(h.trim()||`ast-grep exited with code ${String(g)}`));return}try{let S=JSON.parse(f.length===0?"[]":f);if(!Array.isArray(S))throw new TypeError("ast-grep returned non-array JSON");c(S)}catch(S){d(S instanceof Error?S:new Error(String(S)))}})}))}u(Me,"runAstGrep");function x(s,e,n){if(n!==void 0)return n.resolve(s,e);if(e.includes("://")||s.includes("://"))throw new Error("No structural search owner for this resource.");return Qe.resolve(s,e)}u(x,"resolveSource");async function et(s,e,n,r,t){if(s.execute===void 0)throw new Error("This resource owner does not support structural search execution.");let a=s.resolve(r,n.path??"."),i=await s.isDirectory(a,t),o=i?a:s.dirname(a);e.push(i?".":`./${s.basename(a)}`);let c=await s.execute("ast-grep",e,o,t);if(t?.throwIfAborted(),c.code!==0&&c.code!==1)throw new Error(`Structural search failed with exit ${String(c.code)}.`);let d=JSON.parse(c.stdout.length===0?"[]":c.stdout);if(!Array.isArray(d))throw new TypeError("ast-grep returned non-array JSON");return d.map(l=>({...l,file:s.resolve(o,l.file)}))}u(et,"runOwnedAstGrep");import{Text as tt}from"@earendil-works/pi-tui";import{Type as y}from"typebox";var nt=y.Object({pattern:y.Optional(y.String({minLength:1,description:"ast-grep pattern in source-code syntax; $NAME captures one node, $$$ARGS several. Use pattern or rule."})),rule:y.Optional(y.Record(y.String(),y.Unknown(),{description:"ast-grep rule object, the value of `rule:` in an ast-grep rule file: pattern, kind, regex, inside, has, not, all, any, follows, precedes, stopBy. Requires language."})),language:y.Optional(y.String({minLength:1,description:"ast-grep language for a rule, such as typescript, python or go."})),path:y.Optional(y.Union(_.anyOf,{description:"File, directory, unchanged Read/Search/edit result, its UUID, or an array of such results."})),relation:y.Optional(y.Union([y.Literal("inside"),y.Literal("enclosing")],{description:"With a result as path: inside (default) keeps matches within its ranges; enclosing returns the innermost match that contains each range."})),include:y.Optional(y.String({description:"Include glob for files"})),exclude:y.Optional(y.String({description:"Exclude glob for files"})),limit:y.Optional(y.Integer({minimum:1,maximum:1e3,description:"Maximum matches (default 100)."}))},{additionalProperties:!1});async function Ce(s,e){let n;e().then(r=>n=r),s.registerTool(X({name:"ast_search",label:"ast_search",exposure:"direct",namespace:{name:"ide_ast_search",description:"Find code by syntax structure."},annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},description:"Use ast_search to find code by syntax with ast-grep patterns or rules, in files or inside a Read, Search or edit result, and to get the function, class or call that encloses a match. Matches and captures are editable selections.",promptSnippet:"Find code by syntax with ast-grep patterns and relational rules",parameters:nt,outputSchema:te,renderCall(r,t,a){return W(a.lastComponent,{tool:"ast_search",primary:{text:r.pattern??(r.rule===void 0?"":JSON.stringify(r.rule)),color:"accent",truncate:"end"},qualifiers:[...r.path===void 0?[]:[{text:typeof r.path=="string"?`in ${r.path}`:"in result scope",color:"accent",truncate:"start"}],...r.language===void 0?[]:[{text:r.language}],...r.relation==="enclosing"?[{text:"enclosing"}]:[]],expanded:a.expanded},t)},renderResult(r,t,a,i){let o=r.details;return o?.payload!==void 0&&!i.isError&&!t.isPartial?E({...r,details:o.payload},t,a,i):new tt(r.content.flatMap(c=>c.type==="text"?[c.text]:[]).join(`
|
|
15
|
+
`),0,0)},async execute(r,t,a,i,o){if(t.pattern===void 0==(t.rule===void 0))return C("Pass exactly one of pattern or rule.");if(t.rule!==void 0&&t.language===void 0)return C("A rule requires language, such as typescript or python.");let c={...t.pattern===void 0?{}:{pattern:t.pattern},...t.rule===void 0?{}:{rule:t.rule},...t.language===void 0?{}:{language:t.language},...t.relation===void 0?{}:{relation:t.relation}};if(n===void 0)return C("ast_search needs the Search module (search.core), which is not loaded.");let{api:d,resolver:l}=n;return await d.searchWith(l,{query:t.pattern??JSON.stringify(t.rule),...t.path===void 0?{}:{path:t.path},...t.include===void 0?{}:{include:t.include},...t.exclude===void 0?{}:{exclude:t.exclude},...t.limit===void 0?{}:{limit:t.limit},options:{ast:c}},{cwd:o.cwd,...a!==void 0&&{signal:a},...i!==void 0&&{onUpdate:i}})}},new J)),Y(s,[await K({id:"ast-search",description:"Syntax patterns, ast-grep rules and enclosing constructs",triggers:[{tool:"ast_search"}]})])}u(Ce,"registerAstSearchTool");function C(s){return D({content:[{type:"text",text:s}],details:{failure:{code:"INVALID_REQUEST",message:s}}},ee,{status:"error",errors:[j(new Error(s),"SEARCH_FAILED")]})}u(C,"failure");var rt=z({kind:"code-view",label:"AST"});async function Ne(s){let e,n=new Promise(o=>e=o),r=new ge,t=Re(r),a={protocol:H,apiVersion:B,id:"ast",async setup(o){o.addResolver({resolver:Se(void 0,async(l,f)=>{let h=await o.read({path:l},f,"script");if(h.isError===!0)throw new Error(h.details.failure?.message??"Could not acquire an owned text snapshot for the AST outline.");if(h.script?.kind!=="text")throw new Error("AST outlines require an owned text snapshot.");return{source:h.script.source,lines:h.script.lines.map(p=>p.content)}}),renderResult:rt}),o.addHandler({stage:"read",when:{resolvedBy:"ast",contentKind:"text"},handler:fe()}),o.addView({view:"ast",presenter:t});let c=Ae();o.addOutputReducer(M);let d=be();o.addHandler({stage:"post-read",async handler(l){let f=await c(l);return f.kind==="return"||f.transform!==void 0?f:d(f.context)}}),o.describe({path:"ast:<path> \u2014 declaration outline.",views:"ast \u2014 scope boundaries."})}},i={protocol:G,apiVersion:F,id:"ast",setup(o){o.addAnchorResolver({resolver:Oe(r),kind:U,type:"auxiliary"}),o.addTextPresenter({presenter:t})}};await Promise.all([V(s,a),oe(s,ye),ie(s,i),ne(s,{protocol:Q,apiVersion:Z,id:"ast-search",setup(o){e({api:o,resolver:Ie(o.registerSelection)})}}),Ce(s,()=>n)])}u(Ne,"registerAst");export{Ne as default};
|
package/dist/entry-38.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c
|
|
1
|
+
import{a,b,c}from"./chunk-DEP55R35.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as createChangeGroups,c as replaceHeadRangeInIndex,b as reverseChangeGroup};
|
package/dist/entry-39.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a,b}from"./chunk-6A3ORNW3.js";import"./chunk-DEP55R35.js";import"./chunk-R2U5WXYR.js";import"./chunk-KN6VPARZ.js";import"./chunk-MDD5ORB6.js";import"./chunk-MLFJU2US.js";import"./chunk-GXL4NMHR.js";import"./chunk-PQWANILR.js";import"./chunk-BU7IZLKB.js";import"./chunk-S5PL5DFQ.js";import"./chunk-DDH3FP4G.js";import"./chunk-VDJSH3DQ.js";import"./chunk-756K3LJY.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as default,b as registerGitChangesWithExecutor};
|
package/dist/entry-4.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a}from"./chunk-ZAWRSA7N.js";import"./chunk-OFILFO6D.js";import"./chunk-EI7MMDWY.js";export{a as connectIdePlugin};
|
package/dist/entry-40.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d
|
|
1
|
+
import{a,b,c,d}from"./chunk-64JTD2DJ.js";import"./chunk-B25LXXNV.js";import"./chunk-MDD5ORB6.js";import"./chunk-MLFJU2US.js";import"./chunk-ZAWRSA7N.js";import"./chunk-OFILFO6D.js";import"./chunk-7D7PXIVV.js";import"./chunk-BXGMMZT3.js";import"./chunk-756K3LJY.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as FORMATTER_RECIPES,b as FormatterCommandRegistry,c as default,d as registerFormatterWithOwner};
|
package/dist/entry-41.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a as p}from"./chunk-MDD5ORB6.js";import{b as n,c}from"./chunk-MLFJU2US.js";import{a as e}from"./chunk-EI7MMDWY.js";var m=[t("c","C",[".c",".h"],["CMakeLists.txt","meson.build","compile_commands.json"],"tree-sitter"),t("cpp","C++",[".cc",".cpp",".cxx",".hh",".hpp",".hxx"],["CMakeLists.txt","meson.build","compile_commands.json","conanfile.py","vcpkg.json"],"tree-sitter"),t("csharp","C#",[".cs"],[".sln",".csproj","global.json"]),t("go","Go",[".go"],["go.mod","go.work"]),t("java","Java",[".java"],["pom.xml","build.gradle","build.gradle.kts"]),t("kotlin","Kotlin",[".kt",".kts"],["build.gradle.kts","settings.gradle.kts"]),t("javascript","JavaScript",[".js",".jsx",".mjs",".cjs"],["package.json"],"tree-sitter"),t("typescript","TypeScript",[".ts",".tsx",".mts",".cts"],["tsconfig.json","package.json"],"tree-sitter"),t("python","Python",[".py",".pyi"],["pyproject.toml","requirements.txt","setup.py"],"tree-sitter"),t("rust","Rust",[".rs"],["Cargo.toml"],"tree-sitter"),t("ruby","Ruby",[".rb",".rake"],["Gemfile",".ruby-version"]),t("php","PHP",[".php"],["composer.json"]),t("swift","Swift",[".swift"],["Package.swift"]),t("lua","Lua",[".lua"],[".luarc.json","stylua.toml"]),t("dart","Dart",[".dart"],["pubspec.yaml","analysis_options.yaml"]),t("powershell","PowerShell",[".ps1",".psm1",".psd1"],["PSScriptAnalyzerSettings.psd1"]),t("r","R",[".r"],["DESCRIPTION",".lintr",".Rprofile"]),t("scala","Scala",[".scala",".sc"],["build.sbt","project.scala",".scalafmt.conf"]),t("elixir","Elixir",[".ex",".exs"],["mix.exs",".formatter.exs"]),t("zig","Zig",[".zig",".zon"],["build.zig","build.zig.zon","zls.json"]),t("julia","Julia",[".jl"],["Project.toml",".JuliaFormatter.toml"]),t("vue","Vue",[".vue"],["package.json"]),t("svelte","Svelte",[".svelte"],["svelte.config.js","svelte.config.ts"]),t("shell","Shell",[".sh",".bash",".zsh"],[".shellcheckrc"]),t("html","HTML",[".html",".htm"],[]),t("css","CSS",[".css",".scss",".sass",".less"],["stylelint.config.js"]),t("json","JSON",[".json",".jsonc"],[],"tree-sitter"),t("yaml","YAML",[".yaml",".yml"],[".yamllint"],"tree-sitter"),t("toml","TOML",[".toml"],["taplo.toml"],"tree-sitter"),t("xml","XML",[".xml",".xsd",".xsl"],[]),t("markdown","Markdown",[".md",".mdx"],[".markdownlint.json"]),t("sql","SQL",[".sql"],[".sqlfluff"]),t("dockerfile","Dockerfile",[],["Dockerfile","compose.yaml"],void 0,["Dockerfile","Containerfile"]),t("terraform","Terraform",[".tf",".tfvars"],[".terraform.lock.hcl"]),t("cmake","CMake",[".cmake"],["CMakeLists.txt"],void 0,["CMakeLists.txt"])];function t(s,i,o,r,l,a){return{id:s,name:i,extensions:o,projectMarkers:r,...l&&{ast:l},...a&&{fileNames:a}}}e(t,"language");function g(s){return p(s,{protocol:n,apiVersion:c,id:"languages",setup(o){for(let r of m)o.addLanguage(r)}})}e(g,"registerLanguages");export{g as default};
|
package/dist/entry-42.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-TVXZE4KW.js";import"./chunk-B25LXXNV.js";import"./chunk-K5G4FDXD.js";import"./chunk-MDD5ORB6.js";import"./chunk-MLFJU2US.js";import"./chunk-ZAWRSA7N.js";import"./chunk-OFILFO6D.js";import"./chunk-7D7PXIVV.js";import"./chunk-BXGMMZT3.js";import"./chunk-756K3LJY.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as LINTER_RECIPES,b as LintCommandRegistry,d as default,e as registerLintWithOwner,c as runConfiguredLinter};
|
package/dist/entry-43.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as
|
|
1
|
+
import{a,b,c,d}from"./chunk-FKKAHI62.js";import"./chunk-B25LXXNV.js";import"./chunk-XH5WN5XA.js";import"./chunk-47SPPIXK.js";import"./chunk-VAXLSPPU.js";import"./chunk-FYOU4RBH.js";import"./chunk-7PVDTMEM.js";import"./chunk-MDD5ORB6.js";import"./chunk-MLFJU2US.js";import"./chunk-PS2B6THP.js";import"./chunk-GXL4NMHR.js";import"./chunk-PQWANILR.js";import"./chunk-BU7IZLKB.js";import"./chunk-S5PL5DFQ.js";import"./chunk-DDH3FP4G.js";import"./chunk-TVH2ND35.js";import"./chunk-T4FTT3U4.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZAWRSA7N.js";import"./chunk-OFILFO6D.js";import"./chunk-KINKBPPX.js";import"./chunk-7D7PXIVV.js";import"./chunk-BXGMMZT3.js";import"./chunk-756K3LJY.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as LSP_RECIPES,b as LspServerRegistry,c as default,d as registerLspWithOwner};
|
package/dist/entry-44.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"./chunk-
|
|
1
|
+
import{a,b,c}from"./chunk-XE4W5YTE.js";import"./chunk-EI7MMDWY.js";export{c as createImageContent,a as createImageContentConverter,b as detectSupportedImageMimeType};
|
package/dist/entry-45.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as requiredValue};
|
package/dist/entry-46.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{a,b,c}from"./chunk-RIOPUTUJ.js";import"./chunk-EI7MMDWY.js";export{c as createPdfContent,a as createPdfContentConverter,b as isPdf};
|
package/dist/entry-47.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a}from"./chunk-BU7IZLKB.js";import"./chunk-S5PL5DFQ.js";import"./chunk-EI7MMDWY.js";export{a as connectReadPlugin};
|
package/dist/entry-48.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import"./chunk-NNCZYO4Q.js";import{b as a,d as b}from"./chunk-OMNKD7WW.js";import"./chunk-PS2B6THP.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as COMPACT_READ_ROWS,b as createReadResultRenderer};
|
package/dist/entry-49.js
CHANGED
|
@@ -1,25 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
Read ${JSON.stringify(e.source)} with views=["anchors"] and choose a current anchor.`),`Read failed${e.source===void 0?"":` for ${JSON.stringify(e.source)}`}: ${i}`}d(at,"readFailureMessage");function ne(e,t,n){if(!n?.aborted||!e.isError)return e;let r=e.details.source??e.details.failure?.source??t;return{...e,content:[{type:"text",text:`Read cancelled${r===void 0?"":` for ${JSON.stringify(r)}`}. No completed result was returned.`}]}}d(ne,"withReadCancellation");function T(e){let t=e.cause instanceof te?e.cause:void 0;return t!==void 0?e={...e,source:e.source??t.source,message:`${t.code}: ${e.source??t.source}`,cause:new te(t.code,t.source,t.effect)}:e.cause instanceof Error&&"code"in e.cause&&!["ENOENT","EACCES","EPERM"].includes(String(e.cause.code))&&(e={...e,message:`${e.code}: ${e.source??"source"}`,cause:void 0}),{content:[{type:"text",text:[at(e),...e.candidates?.length?["","Possible matches:",...e.candidates.map(n=>`- ${JSON.stringify(n.path)}`),"","Retry read with an exact candidate path."]:[]].join(`
|
|
3
|
-
`)}],details:{failure:e},isError:!0}}d(T,"failureResult");function Ie(e){return{source:e.source,resolvedBy:e.resolvedBy}}d(Ie,"readDetails");function dt(e){let t=[],n=[];for(let[o,i]of e.entries()){if(i.type!=="custom"){t.push(i);continue}n.push({index:o,kind:i.kind}),t.push({type:"text",text:`[unsupported_content_block kind=${i.kind} index=${o}]`})}let r=n[0];return{content:t,...r!==void 0&&{unsupportedContentBlocks:[r,...n.slice(1)]}}}d(dt,"projectAgentContent");function ut(e,t,n){let r=e.offset===void 0?1:Math.trunc(e.offset),o=oe(r,t,n),i=e.limit===void 0?t:Math.max(0,Math.trunc(e.limit));return{startIndex:Math.min(t,o-1),endIndex:Math.min(t,o-1+i)}}d(ut,"resolveTextRange");function oe(e,t,n){if(n===void 0)return e<0?Math.max(1,t+e+1):Math.max(1,e);let r=e<0?n+e:n+Math.max(1,e)-1;return Math.max(1,r)}d(oe,"anchoredStartLine");function ct(e){return e.length===1&&e[0].type==="text"}d(ct,"isSingleTextContent");var ee=ft,ie=pt;async function se(e,t,n,r){let o=r?.originLine,i=e.content.length===1?e.content[0]:void 0;if(i?.type!=="text")return e;let s=Rt(i.text,{maxBytes:ee,maxLines:ie});if(s.truncated){let a=n===void 0?void 0:await n(i.text),c=s.firstLineExceedsLimit?await yt(i.text,e.details,t):ht(s,e.details,t,o),y=a===void 0?c:mt(c,a);return{...e,content:[{...i,text:Ve(s.content,y)}],details:{...Tt(e.details,s),outputNotice:(s.content.length?`
|
|
4
|
-
|
|
5
|
-
`:"")+y,...a!==void 0&&{temporarySource:a}}}}return ae(e,t,r)}d(se,"limitReadOutput");function ae(e,t,n){let r=e.content.length===1?e.content[0]:void 0;if(e.isError||r?.type!=="text")return e;let o=r.text.length===0?gt(e,t,n?.originLine):vt(e.details,t,n?.originLine);return o===void 0?e:{...e,content:[{...r,text:Ve(r.text,o)}],details:{...e.details,outputNotice:(r.text.length?`
|
|
6
|
-
|
|
7
|
-
`:"")+o}}}d(ae,"explainReadWindow");function gt(e,t,n){let r=e.script;if(e.isError||r?.kind!=="text"||r.lines.length!==0)return;if(r.totalLines===0)return"[Empty source.]";if(t.limit!==void 0&&Math.trunc(t.limit)<=0)return"[No lines selected: limit=0.]";let o=Math.trunc(t.offset??1);if(oe(o,r.totalLines,n)>r.totalLines)return`[Offset ${o} is beyond the end of the source (${r.totalLines} ${r.totalLines===1?"line":"lines"}).]`}d(gt,"emptyTextNotice");function mt(e,t){let n=t.startsWith("temp:")?t:JSON.stringify(t);return`${e.slice(0,-1)} Full output: ${n}. Available until this runtime is disposed.]`}d(mt,"appendTemporarySource");async function yt(e,t,n){let r=e.split(/\r\n|\r|\n/u,1)[0]??"",o=Z(Buffer.byteLength(r,"utf8")),i=de(t,n),s=i===void 0?"First output line":`Line ${i}`,a=Z(ee);return t.resolvedBy==="filesystem"&&n.views?.some(c=>c.startsWith("jq:"))===!0?`[Output line ${i??1} is ${o}, exceeds the ${a} output limit. This line was not returned. Narrow the jq filter to return a smaller value.]`:t.resolvedBy==="filesystem"&&t.source!==void 0&&(await lt(t.source).catch(()=>{}))?.isFile()===!0?`[${s} is ${o}, exceeds the ${a} output limit. This line was not returned. Read ${JSON.stringify(`raw:${t.source}`)} with offset=0 and limit=4096 to inspect the original bytes.]`:`[${s} is ${o}, exceeds ${a} limit. Use a source-specific tool to read this line in smaller byte ranges.]`}d(yt,"oversizedFirstLineNotice");function ht(e,t,n,r){let o=wt(e,t,n);if(o!==void 0&&o.endLine<o.totalLines){let s=e.truncatedBy==="lines"?`${e.maxLines}-line limit`:`${Z(e.maxBytes)} limit`,a=Fe(t,n,o.endLine+1,r);return`[Showing lines ${o.startLine}-${o.endLine} of ${o.totalLines} (${s}). ${a} to continue.]`}let i=e.truncatedBy==="lines"?`${e.maxLines}-line limit`:`${Z(e.maxBytes)} limit`;return`[Output truncated: showing ${e.outputLines} of ${e.totalLines} output lines (${i}). No single source-line continuation is available. Retry Read with a smaller limit, keeping the same source and views.]`}d(ht,"truncatedOutputNotice");function wt(e,t,n){let r=t.totalLines,o=de(t,n);if(r===void 0||r===0||o===void 0||e.outputLines===0)return;let s=(t.endLine===void 0||t.endLine<o?r:t.endLine)-o+1,a=Math.min(e.outputLines,s);return{startLine:o,endLine:o+a-1,totalLines:r}}d(wt,"shownSourceRange");function vt(e,t,n){if(t.limit===void 0||e.totalLines===void 0||e.totalLines===0)return;let r=de(e,t);if(r===void 0)return;let o=e.endLine===void 0||e.endLine<r?r:e.endLine+1;if(o>e.totalLines)return;let i=e.totalLines-o+1,s=i===1?"line":"lines",a=Fe(e,t,o,n);return`[${i} more ${s} in source. ${a} to continue.]`}d(vt,"explicitLimitNotice");function Fe(e,t,n,r){let o=e.source===void 0?`Use offset=${xt(n,r)}`:`Read ${JSON.stringify(e.source)} with offset=${n}`,i=t.views===void 0||t.views.length===0?"":` and views=${JSON.stringify(t.views)}`;return o+i}d(Fe,"sourceContinuationAction");function xt(e,t){return t===void 0?e:e-t+1}d(xt,"continuationOffset");function de(e,t){if(e.startLine!==void 0&&e.startLine>0)return e.startLine;if(e.totalLines===void 0||e.totalLines===0)return;let n=t.offset===void 0?1:Math.trunc(t.offset);return n<0?Math.max(1,e.totalLines+n+1):Math.max(1,n)}d(de,"sourceStartLine");function Tt(e,t){return{...e,...e.lines!==void 0&&{lines:e.lines.slice(0,t.outputLines)},truncation:t}}d(Tt,"truncatedDetails");function Ve(e,t){return e.length===0?t:`${e}
|
|
8
|
-
|
|
9
|
-
${t}`}d(Ve,"appendNotice");import{open as Et,realpath as Pt,stat as Lt}from"node:fs/promises";import bt from"node:path";import{fileURLToPath as St}from"node:url";var ue=16*Math.max(1,Math.min(ie-4,Math.floor((ee-1024)/90)));async function je(e,t,n,r=[],o=[]){let i=e.path??"";try{if((e.views?.length??0)>0)throw new Error("Raw byte reads do not accept views. Omit views for bytes, or read the file without raw: to use text views.");let s=e.offset??0,a=e.limit;if(!Number.isSafeInteger(s)||a!==void 0&&(!Number.isSafeInteger(a)||a<0))throw new Error("Use an integer byte offset and a non-negative integer byte limit");let c=i.slice(4);if(c.length===0)throw new Error("Supply a file or byte resource after raw:");if(!c.startsWith("file://")&&(Me(c)||Me(t.cwd))){for(let u of o){t.signal?.throwIfAborted();let g=await u.tryResolve(c,{...t,audience:n});if(!z(g))throw new Error(`Resolver ${u.id} returned an invalid result`);if(g.kind==="not-handled")continue;if(g.kind==="failed")throw g.error;let E=g.resource,p=`raw:${E.source}`;if(!E.readBytes)throw new Error(`Resource ${E.source} does not support original byte reads`);let x=await Be(e,p,t,n,r);if(x)return x;t.signal?.throwIfAborted();let P=n==="script"?a:Math.min(a??ue,ue),S=await E.readBytes(s,P,t);return t.signal?.throwIfAborted(),$t(S,s,P),Ue(p,S,a)}throw new Error(`No byte resource resolver handled ${c}`)}let y=c.startsWith("file://")?St(c):bt.resolve(t.cwd,c),v=await Pt(y),h=`raw:${v}`,f=await Be(e,h,t,n,r);if(f)return f;if(t.signal?.throwIfAborted(),!(await Lt(v)).isFile())throw new Error("Raw reads require a regular file");let l=await Et(v,"r");try{let u=await l.stat();if(!u.isFile())throw new Error("Raw reads require a regular file");let g=Math.min(u.size,Math.max(0,s<0?u.size+s:s)),E=Math.min(a??u.size,u.size-g),p=n==="script"?E:Math.min(E,ue),x=Buffer.alloc(p),P=0;for(;P<p;){t.signal?.throwIfAborted();let S=await l.read(x,P,p-P,g+P);if(S.bytesRead===0)break;P+=S.bytesRead}return t.signal?.throwIfAborted(),Ue(h,{bytes:x.subarray(0,P),byteOffset:g,totalBytes:u.size},a)}finally{await l.close()}}catch(s){if(t.signal?.aborted)throw s;return T({code:"READ_FAILED",source:i,message:s instanceof Error?s.message:String(s),cause:s})}}d(je,"readRaw");function Me(e){return/^[a-z][a-z0-9+.-]*:\/\//iu.test(e)&&!/^[a-z]:[\\/]/iu.test(e)}d(Me,"isProtocolSource");async function Be(e,t,n,r,o){for(let{registration:i}of o)try{let s=await i.guard({requestedSource:e.path??"",resourceSource:t,resolvedBy:"raw",cwd:n.cwd,request:e,audience:r,...n.signal!==void 0&&{signal:n.signal}});if(s.kind==="rejected")return T({code:"READ_FAILED",source:t,resolverId:"raw",message:`Read blocked by hook ${i.id}: ${s.reason}`})}catch(s){return T({code:"READ_FAILED",source:t,resolverId:"raw",message:`Read blocked because hook ${i.id} failed: ${s instanceof Error?s.message:String(s)}`,cause:s})}}d(Be,"checkGuards");function $t(e,t,n){if(!(e.bytes instanceof Uint8Array)||!Number.isSafeInteger(e.totalBytes)||e.totalBytes<0||!Number.isSafeInteger(e.byteOffset)||e.byteOffset!==Math.min(e.totalBytes,Math.max(0,t<0?e.totalBytes+t:t))||e.bytes.length>Math.min(n??e.totalBytes,e.totalBytes-e.byteOffset))throw new Error("Byte resource returned an invalid range")}d($t,"validateByteRange");function Ue(e,t,n){let{bytes:r,byteOffset:o,totalBytes:i}=t,s=r.length,a=o+s,c=Math.min(n??i,i-o),y=`${e}
|
|
10
|
-
Bytes ${o}..${a} (end exclusive), ${i} bytes total`,v=Ot(r,o),h=a>=i?"":s<c?`
|
|
11
|
-
[Output limited. Read ${JSON.stringify(e)} with offset=${a} to continue.]`:`
|
|
12
|
-
Use offset=${a} to continue in bytes.`;return{content:[{type:"text",text:`${y}
|
|
13
|
-
${v}${h}`}],details:{source:e,resolvedBy:"raw",byteOffset:o,byteLength:s,totalBytes:i},script:{kind:"bytes",source:e,byteOffset:o,byteLength:s,totalBytes:i,bytes:Array.from(r),truncated:s<c}}}d(Ue,"rawResult");function Ot(e,t){let n=[];for(let r=0;r<e.length;r+=16){let o=e.subarray(r,r+16),i=Array.from(o,a=>a.toString(16).padStart(2,"0")).join(" "),s=Array.from(o,a=>a>=32&&a<=126?String.fromCharCode(a):".").join("");n.push(`${(t+r).toString(16).padStart(8,"0")} ${i.padEnd(47)} |${s}|`)}return n.join(`
|
|
14
|
-
`)}d(Ot,"formatRawBytes");var At=Te({kind:"source"});function Je(e,t="compact",n){let r=new Le,o,i=[{resolver:r.resolver,preserveTruncatedOutput:!1,priority:Number.MIN_SAFE_INTEGER,order:0}],s=[],a=[],c=[],y=[],v=[],h="read";return{saveTemporary:d(f=>r.save(f),"saveTemporary"),setOutputSaver(f){o=f},tool:{name:h,exposure:"direct",namespace:{name:"ide_read",description:"Read resources and compare sources."},annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!0},label:h,promptSnippet:"Read supported sources as text or bytes, with optional views",description:"Use read to inspect files and other supported resources.",get promptGuidelines(){return["Use read to inspect supported sources and search to locate workspace content.",...e?.()??[]]},get parameters(){return Oe(n?.()??{})},outputSchema:Ae,renderCall(f,l,u){let g=typeof f.path=="string"?f.path:void 0,E=g===void 0?void 0:i.find(({matchesCall:x})=>x?.(g)===!0)?.renderCall,p=u.expanded?"full":t;return p==="disabled"?new Ge(l.fg("toolTitle","read"),0,0):(E??xe)(f,l,{...u,expanded:p==="full"})},renderResult(f,l,u,g){let E=f.details.resolvedBy,p=E===void 0?void 0:i.find(({resolver:P})=>P.id===E)?.renderResult,x=l.expanded?"full":t;return x==="disabled"&&!g.isError&&!l.isPartial?new Ge(u.fg("success","\u2713 read"),0,0):(p??At)(f,{...l,expanded:x==="full"},u,g)},async execute(f,l,u,g,E){let p={cwd:E.cwd,...u!==void 0&&{signal:u}};try{let x=await He(l,p,i,a,c,r,y,v,s,"agent",o);return re(ne(x,l.path,u))}catch(x){if(u?.aborted)throw x;return re(T({code:"READ_FAILED",source:l.path,message:x instanceof Error?x.message:String(x)}))}}},async execute(f,l,u="agent"){let g=await He(f,l,i,a,c,r,y,v,s,u,o);return ne(g,f.path,l.signal)},registerContributions(f,l){let u=[...l.resourceGuards??[]],g=[...l.resolvers??[]],E=[...l.targetResolvers??[]],p=[...l.handlers??[]],x=[...l.views??[]],P=[...l.fragments??[]],S=new Set(s.map(({registration:R})=>R.id));for(let R of u){if(R.id.trim().length===0||typeof R.guard!="function")throw new TypeError(`Plugin ${f} provided an invalid Resource guard`);if(S.has(R.id))throw new Error(`Resource guard ${R.id} is already registered`);S.add(R.id)}Ht(f,g,p,i,a),zt(f,P,y);let L=new Set(v.map(({resolver:R})=>R.id));for(let R of E){if(!W(R))throw new TypeError(`Plugin ${f} provided an invalid text target resolver`);if(L.has(R.resolver.id))throw new Error(`Text target resolver ${R.resolver.id} is already registered`);L.add(R.resolver.id)}let $=new Set(c.map(({registration:R})=>R.view)),w=new Set(c.map(({registration:R})=>`${R.view}/${R.presenter.id}`));for(let R of x){if(!Y(R))throw new TypeError(`Plugin ${f} provided an invalid view registration`);let O=`${R.view}/${R.presenter.id}`;if(w.has(O))throw new Error(`View ${R.view} already has a presenter ${R.presenter.id}`);$.add(R.view),w.add(O)}for(let R of u)s.push({pluginId:f,registration:R});for(let R of g)i.push({resolver:R.resolver,...R.matchesCall!==void 0&&{matchesCall:R.matchesCall,renderCall:R.renderCall},...R.renderResult!==void 0&&{renderResult:R.renderResult},priority:R.priority??0,preserveTruncatedOutput:R.preserveTruncatedOutput??!1,...R.recoverFailure===void 0?{}:{recoverFailure:R.recoverFailure},order:i.length});for(let R of E)v.push({resolver:R.resolver,priority:R.priority??0,order:v.length});for(let R of p)a.push({pluginId:f,registration:R});for(let R of x)c.push({pluginId:f,registration:R,order:c.length});for(let R of P)y.push({registration:R,priority:R.priority??0,order:y.length})},dispose(){return r.dispose()}}}d(Je,"createReadTool");async function He(e,t,n,r,o,i,s,a,c,y="agent",v){if(e.path?.startsWith("raw:"))return je(e,t,y,c,[...n].sort((m,b)=>m.priority-b.priority||m.order-b.order).map(({resolver:m})=>m));t={...t,audience:y};let h=y==="script"?async m=>m:(m,b,G,H)=>se(m,b,v??G,H),f=[...n].sort((m,b)=>m.priority-b.priority||m.order-b.order),l=[...r],u=[...o].sort((m,b)=>(m.registration.priority??0)-(b.registration.priority??0)||m.order-b.order),g=[...s].sort((m,b)=>m.priority-b.priority||m.order-b.order),E=[...a].sort((m,b)=>m.priority-b.priority||m.order-b.order),p=e.views??[],x=new Set(p.map(j)),P=new Set([...u.map(({registration:m})=>m.view)]),S=[...new Set(e.views??[])],L=new Set(u.filter(({registration:m})=>m.contentKind==="any").map(({registration:m})=>m.view)),$={ignored:S.filter(m=>!P.has(j(m))),textOnly:S.filter(m=>P.has(j(m))&&!L.has(j(m)))};if(e.path!==void 0&&E.length>0){let m=await Dt(e,t,E,f,l,u,x,$,y,c,v);if(m!==void 0)return m}let w={request:{...e},resolverContext:t,audience:y};if(!w.request.path?.startsWith("temp:")){let m=await Ye(w,l);if(m.kind==="return")return k(await h(m.result,w.request),$);w=m.context}let R=w.request.path;if(R===void 0||R.length===0)return T({code:"INVALID_REQUEST",message:"No source was provided"});let O=await ce(w,f,c,e.path??R),N;if(O.kind==="return"&&O.result.isError===!0&&Ct(O.result)&&!R.startsWith("temp:")){let m=Nt(R);if(m!==void 0){let b={result:O,pipeline:w},G={...w,request:{...w.request,path:m.source}},H=await ce(G,f,c,e.path??R);H.kind==="continue"?(O=H,w=G,N=m.fragment):O=b.result}}if(O.kind==="return")return h(O.result,w.request);w=O.context;let C;if(N!==void 0){let m=await It(w,g,N);if(typeof m!="number")return m;C=m}if(w.state?.textMode==="final")return k(await h(Q(w.state,w.request,{originLine:C,audience:y}),w.request,void 0,{originLine:C}),$);let D=await Xe(w,l);if(D.kind==="return")return k(await h(D.result,w.request,void 0,{originLine:C}),$);w=D.context,w=await qe(w,u,x);let _=Q(A(w.state),w.request,{audience:y,originLine:C});w={...w,result:_};let I=await Qe(w,l),M=I.kind==="return"?I.result:A(I.context.result),F=w.request.limit===void 0&&w.state?.preserveTruncatedOutput===!0?m=>i.save(m):void 0;return k(await h(M,w.request,F,{originLine:C}),$)}d(He,"executeRead");var kt=new Set(["INVALID_RESOLVER_RESULT","NO_RESOLVER","READ_FAILED","RESOLVE_FAILED"]);function Ct(e){let t=e.details.failure?.code;return t!==void 0&&kt.has(t)}d(Ct,"isRetryableFailure");async function Dt(e,t,n,r,o,i,s,a,c,y,v){let h=c==="script"?async f=>f:(f,l,u,g)=>se(f,l,v??u,g);for(let{resolver:f}of n){let l;try{l=await f.tryResolve(e.path??"",t)}catch(L){return T({code:"RESOLVE_FAILED",source:e.path,message:V(`Text target resolver ${f.id} failed`,L),cause:L})}if(!Re(l))return T({code:"INVALID_RESOLVER_RESULT",source:e.path,message:`Text target resolver ${f.id} returned an invalid result`,cause:l});let u=l;if(u.kind==="not-handled")continue;if(u.kind==="rejected")return T({code:"RESOLVE_FAILED",source:e.path,message:u.rejection.reason});if(u.kind==="failed")return T({code:"RESOLVE_FAILED",source:e.path,message:u.error instanceof Error?u.error.message:String(u.error)});if(u.targets.length===0)return T({code:"RESOLVE_FAILED",source:e.path,message:"Text target resolver returned no targets"});let g=[],E=[],p,x=u.targets.flatMap(L=>(L.ranges??[{start:{lineNumber:1,column:0},end:{lineNumber:1,column:1}}]).map(async w=>{let R=e.path?.startsWith("RESULT#")?e.path:void 0,O=Math.max(1,w.end.lineNumber-w.start.lineNumber+(R!==void 0&&w.end.column>0?1:0)),N={sourceTarget:R,request:{...e,path:L.source,limit:e.limit??O},resolverContext:t,audience:c};if(!L.source.startsWith("temp:")){let m=await Ye(N,o);if(m.kind==="return")return m.result.isError===!0?k(m.result,a):m.result;N=m.context}let C=await ce(N,r,y,e.path??L.source);if(C.kind==="return")return k(C.result,a);let D=await Xe(C.context,o);if(D.kind==="return")return D.result.isError===!0?k(D.result,a):D.result;let _=await qe(D.context,i,s),I=Q(A(_.state),_.request,{audience:c,originLine:w.start.lineNumber}),M=await Qe({..._,result:I},o);if(I.isError===!0)return k(I,a);let F=M.kind==="return"?M.result:A(M.context.result);return F.isError===!0?k(F,a):c==="script"?F:ae(F,{..._.request,limit:e.limit},{originLine:w.start.lineNumber})})),P=await Promise.allSettled(x);for(let L of P){if(L.status==="rejected")throw L.reason;let $=L.value;if($.isError===!0)return k($,a);for(let w of $.content)w.type==="text"&&g.push(w.text);E.push($),p??=$.details}let S={script:E.length===1&&E[0]?.script!==void 0?E[0].script:{kind:"resources",source:e.path,resources:E.map(L=>A(L.script))},content:[{type:"text",text:g.join(`
|
|
15
|
-
`)}],details:c==="script"?{source:e.path,resources:E}:p??{source:e.path}};return k(await h(S,{path:e.path,views:e.views}),a)}}d(Dt,"resolveTextTargets");var ze="#";function Nt(e){let t=e.indexOf(ze);if(!(t<=0||t===e.length-1))return{source:e.slice(0,t),fragment:e.slice(t+ze.length)}}d(Nt,"splitAnchoredSource");async function It(e,t,n){let r=A(e.state);if(r.contentKind!=="text")return T({code:"UNSUPPORTED_RANGE",source:r.source,resolverId:r.resolvedBy,message:"Anchored reads require textual content. Read this source without an anchor."});if(t.length===0)return T({code:"NO_FRAGMENT_RESOLVER",source:r.source,message:`No fragment resolver is registered for anchor "${n}"`});for(let{registration:o}of t){let i;try{i=await o.resolve({source:r.source,fragment:n,text:r.text,cwd:e.resolverContext.cwd,...e.resolverContext.signal!==void 0&&{signal:e.resolverContext.signal}})}catch(s){return T({code:"FRAGMENT_FAILED",source:r.source,resolverId:o.id,message:V(`Fragment resolver ${o.id} failed`,s),cause:s})}if(!ke(i))return T({code:"INVALID_RESOLVER_RESULT",source:r.source,resolverId:o.id,message:`Fragment resolver ${o.id} returned an invalid result`,cause:i});if(i.kind!=="not-handled")return i.kind==="failed"?T({code:"FRAGMENT_FAILED",source:r.source,resolverId:o.id,message:i.message}):!Number.isInteger(i.originLine)||i.originLine<1||i.originLine>r.text.lines.length?T({code:"INVALID_RESOLVER_RESULT",source:r.source,resolverId:o.id,message:`Fragment resolver ${o.id} returned out-of-range origin line ${i.originLine}`}):i.originLine}return T({code:"NO_FRAGMENT_RESOLVER",source:r.source,message:`No fragment resolver handled anchor "${n}"`})}d(It,"resolveAnchoredOrigin");async function ce(e,t,n,r){let o=A(e.request.path),i=e.resolverContext;for(let a of t){let{resolver:c}=a,y=d(async u=>{try{let g=await a.recoverFailure?.(u,i);return T({...u,...g?.length?{candidates:g}:{}})}catch{return T(u)}},"recoveredFailure"),v;try{v=await c.tryResolve(o,i)}catch(u){return{kind:"return",result:await y({code:"RESOLVE_FAILED",source:o,resolverId:c.id,message:V(`Resolver ${c.id} failed`,u),cause:u})}}if(!z(v))return{kind:"return",result:T({code:"INVALID_RESOLVER_RESULT",source:o,resolverId:c.id,message:`Resolver ${c.id} returned an invalid result`,cause:v})};if(v.kind==="not-handled")continue;if(v.kind==="failed")return{kind:"return",result:await y({code:"RESOLVE_FAILED",source:o,resolverId:c.id,message:V(`Resolver ${c.id} failed`,v.error),cause:v.error})};let h=v.resource;if(h.read===void 0)return{kind:"return",result:T({code:"UNSUPPORTED_CAPABILITY",source:h.source,resolverId:c.id,message:`Resource ${h.source} does not support reading`})};for(let{registration:u}of n)try{let g=await u.guard({requestedSource:r,resourceSource:h.source,resolvedBy:c.id,cwd:i.cwd,request:e.request,audience:e.audience??"agent",...i.signal!==void 0&&{signal:i.signal}});if(g.kind==="rejected")return{kind:"return",result:q(T({code:"READ_FAILED",source:h.source,resolverId:c.id,message:`Read blocked by hook ${u.id}: ${g.reason}`}),g.reason)}}catch(g){return{kind:"return",result:q(T({code:"READ_FAILED",source:h.source,resolverId:c.id,message:V(`Read blocked because hook ${u.id} failed`,g),cause:g}),`Hook ${u.id} failed`)}}let f;try{f=await Ee.run(Pe(h.source,i.cwd,"read"),()=>A(h.read)({...i.signal!==void 0&&{signal:i.signal}}),i.signal)}catch(u){return{kind:"return",result:await y({code:"READ_FAILED",source:h.source,resolverId:c.id,message:V(`Unable to read ${h.source}`,u),cause:u})}}if(!be(f))return{kind:"return",result:T({code:"INVALID_RESOURCE_CONTENT",source:h.source,resolverId:c.id,message:`Resource ${h.source} returned invalid content`,cause:f})};let l;if(h.sourceBytes!==void 0)try{l=new TextDecoder("utf8",{fatal:!0}).decode(h.sourceBytes)}catch{}return{kind:"continue",context:{...e,...l===void 0?{}:{sourceText:l},state:_e(f,h.source,c.id,{preserveTruncatedOutput:a.preserveTruncatedOutput,textMode:c.id==="temp"?"final":"normal"})}}}let s=`No resolver handled ${o}`;return{kind:"return",result:q(T({code:"NO_RESOLVER",source:o,message:s}),s)}}d(ce,"resolveSource");async function Ye(e,t){let n=e;for(let r of t){if(r.registration.stage!=="pre-read")continue;let o=await le(r.registration.handler,n,r.pluginId,"pre-read");if(o.kind==="return")return o;n=o.context}return{kind:"continue",context:n}}d(Ye,"runPreReadHandlers");async function Xe(e,t){let n=e.state,r=n===void 0?[]:t.filter(i=>i.registration.stage==="read"&&Gt(i.registration,n)),o=e;for(let i of r){let s=i.registration;if(s.stage!=="read")continue;let a=await le(s.handler,o,i.pluginId,"read");if(a.kind==="return")return a;o=a.context}return{kind:"continue",context:o}}d(Xe,"runReadHandlers");async function qe(e,t,n){let r=e.state;if(r?.contentKind!=="text"||n.size===0)return e;let o=r.text,i={purpose:"read",...e.sourceText===void 0?{}:{sourceText:e.sourceText},audience:e.resolverContext.audience,requestedViews:e.request.views,source:r.source,cwd:e.resolverContext.cwd,resolvedBy:r.resolvedBy,...e.resolverContext.signal!==void 0&&{signal:e.resolverContext.signal}},s=t.filter(({registration:h})=>n.has(h.view)),a=new Set(s.flatMap(({registration:h})=>h.includes??[])),c=s.filter(({registration:h})=>!a.has(h.view)),y=await Promise.all(c.map(async({registration:h})=>({presenterId:h.presenter.id,document:await h.presenter.present(o,i)}))),v=_t(o,y);return{...e,state:{...r,text:v}}}d(qe,"runTextPresenters");function j(e){let t=e.indexOf(":");return t<0?e:e.slice(0,t)}d(j,"viewName");function k(e,t){let n=[];if(t.ignored.length>0&&n.push(t.ignored.length===1?`Unknown view ignored: ${t.ignored[0]}. Remove it or choose a supported view from the views parameter.`:`Unknown views ignored: ${t.ignored.join(", ")}. Remove these entries or choose supported views from the views parameter.`),e.isError!==!0&&e.content.some(s=>s.type!=="text"))for(let s of t.textOnly)n.push(`View not applied: ${s} requires text. Read a text source to use ${j(s)}.`);if(n.length===0||e.details.viewWarnings!==void 0)return e;let r=n.join(`
|
|
16
|
-
`),o=e.content[0],i=e.content.length===1&&o?.type==="text"?[{...o,text:`${r}
|
|
17
|
-
${o.text}`}]:[{type:"text",text:r},...e.content];return{...e,content:i,details:{...e.details,...t.ignored.length===0?{}:{ignoredViews:t.ignored},viewWarnings:n}}}d(k,"withViewWarnings");function _t(e,t){let n=e.lines;for(let o of t)Ft(e,o),n=n.map((i,s)=>Vt(A(e.lines[s]),i,A(o.document.lines[s])));let r=[...new Map([e,...t.map(o=>o.document)].flatMap(o=>o.references??[]).map(o=>[o.value,o])).values()];return{...e,lines:n,...r.length===0?{}:{references:r}}}d(_t,"mergeViewContributions");function Ft(e,t){let n=t.document;if(n.source!==e.source||n.content!==e.content||n.lines.length!==e.lines.length)throw new Error(`Text presenter ${t.presenterId} changed canonical text`);for(let[r,o]of n.lines.entries()){let i=A(e.lines[r]);if(o.lineNumber!==i.lineNumber||o.content!==i.content||o.lineEnding!==i.lineEnding)throw new Error(`Text presenter ${t.presenterId} changed canonical text`)}}d(Ft,"assertPresentationOnly");function Vt(e,t,n){let r=Mt(e.presentation,t.presentation,n.presentation),o=jt(e.metadata,t.metadata,n.metadata),i=n.anchors===void 0?t.anchors:[...new Set([...t.anchors??[],...n.anchors])];return r===t.presentation&&o===t.metadata&&i===t.anchors?t:{...t,...r!==void 0&&{presentation:r},...o!==void 0&&{metadata:o},...i!==void 0&&{anchors:i}}}d(Vt,"mergePresentedLine");function Mt(e,t,n){if(n===e)return t;let r=We(e?.prefix,t?.prefix,n?.prefix),o=We(e?.suffix,t?.suffix,n?.suffix),i=Ke(e?.before,t?.before,n?.before),s=Ke(e?.after,t?.after,n?.after),a=n?.marker===e?.marker?t?.marker:n?.marker;return r===t?.prefix&&o===t?.suffix&&i===t?.before&&s===t?.after&&a===t?.marker?t:{...t,...r!==void 0&&{prefix:r},...o!==void 0&&{suffix:o},...i!==void 0&&{before:i},...s!==void 0&&{after:s},...a!==void 0&&{marker:a}}}d(Mt,"mergeLinePresentation");function We(e,t,n){if(n===e)return t;let r=e??"",o=t??"",i=n??"";return r.length>0&&i.startsWith(r)?`${o}${i.slice(r.length)}`:r.length>0&&i.endsWith(r)?`${i.slice(0,-r.length)}${o}`:`${o}${i}`}d(We,"mergePresentedText");function Ke(e,t,n){if(n===e)return t;let r=e??[],o=t??[],i=n??[];return Bt(i,r)?[...o,...i.slice(r.length)]:Ut(i,r)?[...i.slice(0,i.length-r.length),...o]:[...o,...i]}d(Ke,"mergePresentedRows");function Bt(e,t){return t.length>0&&t.length<=e.length&&t.every((n,r)=>e[r]===n)}d(Bt,"startsWithRows");function Ut(e,t){let n=e.length-t.length;return t.length>0&&n>=0&&t.every((r,o)=>e[n+o]===r)}d(Ut,"endsWithRows");function jt(e,t,n){if(n===e||n===void 0)return t;let r=Object.fromEntries(Object.entries(n).filter(([o,i])=>e?.[o]!==i));return Object.keys(r).length===0?t:{...t,...r}}d(jt,"mergeLineMetadata");async function Qe(e,t){let n=t.filter(({registration:i})=>i.stage==="post-read"),r=await Promise.all(n.map(i=>le(i.registration.handler,e,i.pluginId,"post-read")));for(let i of r)if(i.kind==="return")return i;let o=e.result;for(let i of r)if(!(i.kind==="return"||i.transform===void 0)){if(o===void 0)throw new Error("Post-read transform requires a read result");o=i.transform(o)}return{kind:"continue",context:o===void 0?e:{...e,result:o}}}d(Qe,"runPostReadHandlers");async function le(e,t,n,r){try{return await e(t)}catch(o){return{kind:"return",result:T({code:"PIPELINE_FAILED",...t.state?.source===void 0?t.result?.details.source===void 0?{}:{source:t.result.details.source}:{source:t.state.source},pluginId:n,stage:r,message:`Plugin ${n} failed during ${r}`,cause:o})}}}d(le,"invokeHandler");function Gt(e,t){return(e.when.resolvedBy==="any"||e.when.resolvedBy===t.resolvedBy)&&(e.when.contentKind==="any"||e.when.contentKind===t.contentKind)}d(Gt,"matchesReadState");function Ht(e,t,n,r,o){let i=new Set(r.map(({resolver:a})=>a.id));for(let a of t){if(!K(a))throw new TypeError(`Plugin ${e} provided an invalid resource resolver`);if(i.has(a.resolver.id))throw new Error(`Resource resolver ${a.resolver.id} is already registered`);i.add(a.resolver.id)}let s=new Set(o.filter(a=>a.pluginId===e).map(a=>a.registration.stage));for(let a of n){if(!J(a))throw new TypeError(`Plugin ${e} provided an invalid read handler`);if(s.has(a.stage))throw new Error(`Plugin ${e} already handles ${a.stage}`);s.add(a.stage)}}d(Ht,"validateContributions");function zt(e,t,n){let r=new Set(n.map(({registration:o})=>o.id));for(let o of t){if(!X(o))throw new TypeError(`Plugin ${e} provided an invalid fragment resolver`);if(r.has(o.id))throw new Error(`Fragment resolver ${o.id} is already registered`);r.add(o.id)}}d(zt,"validateFragmentRegistrations");function V(e,t){return!(t instanceof Error)||t.message.length===0?e:`${e}: ${t.message}`}d(V,"appendErrorMessage");function Ze(e="compact"){let t=[],n=new Set,r=new Map,o=Je(()=>Jt(r),e,()=>Yt(r)),i=Promise.resolve();return{read:o,registerPlugin(s){let a=Wt(s);if(a!==void 0)return Promise.reject(a);let c=r.get(s.id);if(c?.plugin===s)return c.ready;if(c!==void 0)return Promise.reject(new Error(`Plugin ${s.id} is already registered`));let y={status:"pending"},v=[],h=[],f=Kt(s.id,o,h,v,t),l=i.then(async()=>{try{await s.setup(f.api),f.commit(),y.status="active";return}catch(g){throw f.close(),g}}),u={lifecycle:y,plugin:s,promptGuidelines:h,parameterDescriptions:v,ready:l};return r.set(s.id,u),n.add(l),i=l.catch(()=>{}),l.then(()=>{n.delete(l)},()=>{n.delete(l),r.get(s.id)===u&&r.delete(s.id)}),l},async waitForPendingPlugins(){await Promise.all(n)}}}d(Ze,"createReadCore");function Wt(e){if(e.protocol!==B)return new Error(`Plugin ${e.id} uses an unsupported protocol`);if(e.apiVersion!==U)return new Error(`Plugin ${e.id} uses an unsupported API version`);if(e.id.trim().length===0)return new Error("Plugin ID must not be empty")}d(Wt,"getPluginValidationError");function Kt(e,t,n,r,o){let i=[],s=[],a=[],c=[],y=[],v=[],h=[],f=[],l=[],u="setup",g=d(()=>{if(u==="closed")throw new Error(`Plugin ${e} API is closed`)},"assertAvailable");return{api:{addOutputReducer(p){if(g(),typeof p!="function")throw new TypeError("Expected an output reducer");(u==="setup"?i:o).push(p)},async reduceOutput(p,x,P){g();for(let S of o){x.signal?.throwIfAborted();let L=await S(p,x,P);if(L!==void 0)return L}},saveTemporary(p){return g(),t.saveTemporary(p)},setOutputSaver(p){g(),t.setOutputSaver(p)},read(p,x,P){return g(),t.execute(p,x,P)},addResourceGuard(p){g(),u==="setup"?c.push(p):t.registerContributions(e,{resourceGuards:[p]})},addResolver(p){if(g(),!K(p))throw new TypeError(`Plugin ${e} provided an invalid resource resolver`);if(u==="setup"){y.push(p);return}t.registerContributions(e,{resolvers:[p]})},addTargetResolver(p){if(g(),!W(p))throw new TypeError(`Plugin ${e} provided an invalid text target resolver`);if(u==="setup"){v.push(p);return}t.registerContributions(e,{targetResolvers:[p]})},addHandler(p){if(g(),!J(p))throw new TypeError(`Plugin ${e} provided an invalid read handler`);if(u==="setup"){h.push(p);return}t.registerContributions(e,{handlers:[p]})},addView(p){if(g(),!Y(p))throw new TypeError(`Plugin ${e} provided an invalid view registration`);if(u==="setup"){f.push(p);return}t.registerContributions(e,{views:[p]})},addFragmentResolver(p){if(g(),!X(p))throw new TypeError(`Plugin ${e} provided an invalid fragment resolver`);if(u==="setup"){l.push(p);return}t.registerContributions(e,{fragments:[p]})},describe(p){if(g(),s.length>0||r.length>0)throw new Error(`Plugin ${e} provides more than one description`);let x=Xt(p);if(u==="setup"){s.push(x);return}r.push(x)},addPromptGuideline(p){g();let x=et(p);if(u==="setup"){a.push(x);return}n.push(x)}},close(){u="closed"},commit(){if(u!=="setup")throw new Error(`Plugin ${e} setup contributions cannot be committed`);t.registerContributions(e,{resourceGuards:c,resolvers:y,targetResolvers:v,handlers:h,views:f,fragments:l}),r.push(...s),o.push(...i),n.push(...a),u="active"}}}d(Kt,"createPluginContributionController");function Jt(e){let t=[];for(let n of e.values())if(n.lifecycle.status==="active")for(let r of n.promptGuidelines){let o=tt(r);o!==void 0&&t.push(o)}return t}d(Jt,"renderPromptGuidelines");function Yt(e){let t={};for(let n of e.values())if(n.lifecycle.status==="active")for(let r of n.parameterDescriptions)for(let o of Object.keys(r)){let i=r[o];if(i===void 0)continue;let s=tt(i);s!==void 0&&(t[o]??=[]).push(s)}return Object.fromEntries(Object.entries(t).map(([n,r])=>[n,[...new Set(r.flatMap(o=>o.split(`
|
|
18
|
-
`)))].join(`
|
|
19
|
-
`)]))}d(Yt,"renderParameterDescriptions");function Xt(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("Read plugin parameter descriptions must be an object");let t=Object.entries(e);if(t.length===0)throw new Error("Read plugin parameter descriptions are empty");let n={};for(let[r,o]of t){if(!Object.hasOwn($e.properties,r))throw new Error(`Read plugin description names an unknown parameter: ${r}`);n[r]=et(o)}return n}d(Xt,"normalizeParameterDescriptions");function et(e){if(typeof e=="string")return rt(e);if(typeof e=="function")return e;throw new TypeError("Read plugin prompt description must be a string or callback")}d(et,"normalizeDescriptionSource");function tt(e){if(typeof e=="string")return e;let t=e();return t===void 0?void 0:rt(t)}d(tt,"renderDescriptionSource");function rt(e){if(typeof e!="string")throw new TypeError("Read plugin prompt description must be a string");let t=e.replaceAll(`\r
|
|
20
|
-
`,`
|
|
21
|
-
`).replaceAll("\r",`
|
|
22
|
-
`).split(`
|
|
23
|
-
`).map(r=>r.trimEnd());for(;t[0]?.trim().length===0;)t.shift();for(;t.at(-1)?.trim().length===0;)t.pop();let n=t.join(`
|
|
24
|
-
`);if(n.trim().length===0)throw new Error("Read plugin prompt description is empty");return n}d(rt,"normalizeDescription");function qt(e){return typeof e=="object"&&e!==null}d(qt,"isRecord");function Qt(e){return e==="full"||e==="disabled"?e:"compact"}d(Qt,"parsePresentation");async function nt(e,t){me(e,[await ge({id:"read-resources",description:"Read results, selection boundaries, and composition",triggers:[{tool:"read"}]})]);let n=Ze(Qt(t?.preferences["ui.read"])),r=Se(e);await n.registerPlugin({protocol:B,apiVersion:U,id:"result-targets",setup(a){a.addHandler({stage:"post-read",handler:Ne(r,n.read.execute)})}});let o=e.events.on(he,a=>{if(!we(a))throw new Error("Invalid pi-agent-read plugin registration request");a.accept(n.registerPlugin(a.plugin))});e.on("session_shutdown",async()=>{o(),await n.read.dispose()});let i=new Ce,s=De(n.read.tool,i);e.registerTool(s),e.on("before_agent_start",async()=>{await n.waitForPendingPlugins(),e.getActiveTools().includes("read")&&e.registerTool(s)}),e.on("tool_result",a=>{if(!(a.toolName!=="read"||!qt(a.details)))return{details:ve(a.details,a.content.flatMap(c=>c.type==="text"?[c.text]:[]).join(`
|
|
25
|
-
`)),...a.details.failure!==void 0&&{isError:!0}}}),e.events.emit(ye,{protocol:B,apiVersion:U}),await n.waitForPendingPlugins()}d(nt,"registerReadCore");export{nt as default};
|
|
1
|
+
import{a,b,c,d,e,f,g}from"./chunk-S5PL5DFQ.js";import"./chunk-EI7MMDWY.js";export{b as READ_API_VERSION,c as READ_CORE_READY_EVENT,d as READ_PLUGIN_REGISTER_EVENT,a as READ_PROTOCOL,e as isReadCoreReady,f as isReadPlugin,g as isReadPluginRegistrationRequest};
|
package/dist/entry-5.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a,b,c,d,e,f,g}from"./chunk-OFILFO6D.js";import"./chunk-EI7MMDWY.js";export{b as IDE_API_VERSION,c as IDE_CORE_READY_EVENT,d as IDE_PLUGIN_REGISTER_EVENT,a as IDE_PROTOCOL,e as isIdeCoreReady,f as isIdePlugin,g as isIdePluginRegistrationRequest};
|
package/dist/entry-50.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a,h as b,i as c,j as d,k as e,l as f,m as g,n as h,o as i,p as j}from"./chunk-52PFWQMU.js";import"./chunk-DDH3FP4G.js";import"./chunk-VDJSH3DQ.js";import"./chunk-EI7MMDWY.js";export{i as isFragmentResolverRegistration,j as isReadFragmentResolution,g as isReadHandlerRegistration,h as isReadViewRegistration,f as isResourceResolverRegistration,e as isTextTargetResolverRegistration,b as readDataSchema,c as readOutputSchema,a as readParameters,d as structuredRead};
|
package/dist/entry-51.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as e}from"./chunk-H7WAM5RH.js";import"./chunk-XH5WN5XA.js";import"./chunk-52PFWQMU.js";import"./chunk-OMNKD7WW.js";import"./chunk-PS2B6THP.js";import"./chunk-S5PL5DFQ.js";import"./chunk-DDH3FP4G.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{e as default};
|
package/dist/entry-52.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g}from"./chunk-
|
|
1
|
+
import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-DDH3FP4G.js";import"./chunk-EI7MMDWY.js";export{D as CONTENT_API_VERSION,F as CONTENT_CONVERTER_REGISTER_EVENT,E as CONTENT_HOST_READY_EVENT,C as CONTENT_PROTOCOL,k as MAX_STRUCTURED_BYTES,h as ResourceError,a as ResourceScheduler,O as ResultImageStore,L as ResultTargetStore,d as TempResourceStore,z as UnsupportedContentError,l as assertJsonData,J as connectContentConverter,P as connectResultImages,N as connectResultTargets,I as createContentHost,A as createContentRunner,p as isAgentContent,x as isContentConversionAttempt,v as isContentConversionContext,w as isContentConverter,y as isContentConverterRegistration,H as isContentConverterRegistrationRequest,G as isContentHostReady,u as isContentInput,t as isContentTarget,q as isResource,s as isResourceResolutionAttempt,r as isResourceResolver,o as renderContentDescription,c as resourceAccesses,f as resourceErrorMetadata,g as resourceErrorMetadataOf,e as resourceErrorMetadataSchema,b as resourceScheduler,m as resultError,i as resultErrorSchema,K as resultInputSchema,j as structuredResultSchema,B as targetsEqual,M as verifyResultTargets,n as withStructuredResult};
|
package/dist/entry-53.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a}from"./chunk-47SPPIXK.js";import"./chunk-VAXLSPPU.js";import"./chunk-EI7MMDWY.js";export{a as connectSearchPlugin};
|
package/dist/entry-54.js
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
import{e as Z,f as ee,g as re}from"./chunk-XH5WN5XA.js";import{a as J,b as z,c as Q,d as K,g as B}from"./chunk-VAXLSPPU.js";import{a as Y,c as x,d as X}from"./chunk-I6NPILT5.js";import{e as F,f as q}from"./chunk-T7I2VX3J.js";import{a as H,e as V}from"./chunk-PS2B6THP.js";import{K as _,b as G,c as U,i as W,j as C}from"./chunk-LCWBVOII.js";import{a as s}from"./chunk-EI7MMDWY.js";import{Text as ue}from"@earendil-works/pi-tui";import Ee from"node:os";function oe(e){let t=[],c=[],d=[],a,S=new Map,I=new Map,h=new Map,u=new Map,v=Promise.resolve(),w={registerPlugin(o){if(o.id.trim().length===0)return Promise.reject(new Error("Plugin ID must not be empty"));let r=u.get(o.id);if(r!==void 0)return r;let m=v.then(async()=>{let l=[],R=[],b=[],k=[],A,g,y=[],i={addScopeProvider(n){b.push(n)},addEnvironmentProvider(n){R.push(n)},addSelectionProvider(n){if(A!==void 0||a!==void 0)throw new Error("Search selection provider is already registered");A=n},registerSelection(n,p){if(a===void 0)throw new Error("Search selections are unavailable. Enable the shared search selection plugin.");return a(n,p)},addResolver(n){pe(n),l.push(n)},addAction(n){he(n),k.push(n)},describe(n){if(g!==void 0)throw new Error(`Plugin ${o.id} provides more than one description`);g=te(n)},addPromptGuideline(n){y.push(te(n))},search:s((n,p,f)=>w.execute(n,p,f),"search"),runAction(n,p){return w.runAction(n.reference,n.capability,n.resolverId,n.input,p)}};await o.setup(i);let P=new Set(t.map(({registration:n})=>n.resolver.id));for(let n of l){if(P.has(n.resolver.id))throw new Error(`Search resolver ${n.resolver.id} is already registered`);P.add(n.resolver.id)}for(let n of k){let p=O(n.resolverId,n.capability);if(S.has(p)||k.some(f=>f!==n&&O(f.resolverId,f.capability)===p))throw new Error(`Search action ${p} is already registered`)}for(let n of l)t.push({pluginId:o.id,registration:n,order:t.length});A!==void 0&&(a=A),c.push(...R),d.push(...b);for(let n of k)S.set(O(n.resolverId,n.capability),n);g!==void 0&&h.set(o.id,g),y.length>0&&I.set(o.id,y)});return u.set(o.id,m),v=m.catch(()=>{}),m.catch(()=>{u.delete(o.id)}),m},async waitForPendingPlugins(){await Promise.all(u.values())},async execute(o,r,m="agent"){let l={...o,path:typeof o.path=="string"?o.path:void 0};if(l.query.trim().length===0)return E("INVALID_REQUEST","Search query must not be empty");if(o.navigation!==void 0&&!o.query.startsWith("symbols:"))return E("INVALID_REQUEST","Reference navigation is supported only for symbols: queries.");try{if(typeof o.path=="string")for(let y of d){let i=await y(o.path,r);if(i!==void 0){if(r.scope!==void 0)throw new Error("Pass one result scope, not two.");e!==void 0&&await e.verify(i,r.signal),r={...r,scope:i},l=Object.assign({},l,{path:void 0});break}}if(o.path!==void 0&&(typeof o.path!="string"||l.path===o.path&&o.path.startsWith("RESULT#"))){if(e===void 0)throw new Error("Result scopes are unavailable.");if(r.scope!==void 0)throw new Error("Pass one result scope, not two.");let y=e.resolve(o.path,r.cwd);await e.verify(y,r.signal),r={...r,scope:y},l=Object.assign({},l,{path:void 0})}if(r.scope!==void 0){let y=r;r={...r,environmentForSource:s(i=>{for(let P of c){let n=P({...l,path:i},y);if(n!==void 0)return n}},"environmentForSource")}}for(let y of r.scope===void 0?c:[]){let i=y(l,r);if(i!==void 0){r={...r,environment:i};break}}}catch(g){return E("RESOLVE_FAILED",$(g,"Search scope is unavailable"),void 0,g)}let R=[...t].sort((g,y)=>+(g.registration.fallback===!0)-+(y.registration.fallback===!0)||(g.registration.priority??0)-(y.registration.priority??0)||g.order-y.order),b=/^[a-z][\w-]*:\s*$/iu.test(l.query),k=/^[a-z][\w-]*:/iu.test(l.query);for(let g of R){if(r.scope!==void 0&&g.registration.resolver.supportsResultScope!==!0)continue;let y=/^(?:ast|symbols):/u.test(l.query);if(g.registration.fallback&&y&&r.scope!==void 0||b&&!g.registration.fallback&&r.scope===void 0)continue;let i=g.registration.resolver;if(!(r.scope!==void 0&&i.supportsResultScope!==!0))try{let P=Promise.resolve().then(async()=>{let p=await i.readResources?.(l,r);return p===void 0?[{resource:"*",mode:"read"}]:(await Promise.all(p.map(async f=>{let T=await U(f,r.cwd,"read");return r.environment!==void 0&&await r.environment.isDirectory(f,r.signal)?T.map(j=>({...j,recursive:!0})):T}))).flat()}),n=await G.run(P,async()=>{let p;try{r.signal?.throwIfAborted(),p=await i.tryResolve(l,r)}catch(f){return E("RESOLVE_FAILED",$(f,`Resolver ${i.id} failed`),i.id,f)}if(!me(p))return E("INVALID_RESOLVER_RESULT",`Resolver ${i.id} returned an invalid result`,i.id);if(p.kind!=="not-handled"){if(p.kind==="failed")return E("RESOLVE_FAILED",$(p.error,`Resolver ${i.id} failed`),i.id,p.error);try{let f=await i.format(p.payload,r);if(!ge(f))return E("FORMAT_FAILED",`Resolver ${i.id} formatter returned an invalid result`,i.id);let T=i.toScriptData?.(p.payload,f.details),j=T===void 0;return C({content:[...g.registration.fallback&&k?[{type:"text",text:b?"Search fallback: empty protocol query; searched the original text.":"Search fallback: unhandled protocol query; searched the original text."},...f.content]:f.content,...L(T)&&T.complete===!1?[{type:"text",text:"Search coverage is incomplete. Do not conclude absence or use this result as an edit scope."}]:[]],details:{resolverId:i.id,payload:f.details},...m==="script"&&{script:{resolverId:i.id,data:p.payload,details:f.details}},...f.usage!==void 0&&{usage:f.usage}},x,j?{status:"error",errors:[{code:"STRUCTURED_ADAPTER_REQUIRED",message:`Search resolver ${i.id} must provide toScriptData`}]}:f.isError?{status:"error",data:T,errors:[{code:"RESOLVE_FAILED",message:`Search resolver ${i.id} returned an error`}]}:{status:"success",data:T,errors:[]})}catch(f){return E("FORMAT_FAILED",$(f,`Resolver ${i.id} formatter failed`),i.id,f)}}},r.signal);if(n!==void 0)return n}catch(P){return E("RESOLVE_FAILED",$(P,`Resolver ${i.id} failed`),i.id,P)}}let A=`No search resolver handled ${l.query}`;return Z(E("NO_RESOLVER",A),A)},runAction(o,r,m,l,R){let b=S.get(O(m,r));if(b===void 0)throw new Error(`Search reference does not support ${r}`);return b.execute(o,l,R)},renderDescriptions(){return[...h.values()].flatMap(o=>{let r=ne(o);return r===void 0?[]:[r]})},renderPromptGuidelines(){return[...I.values()].flat().flatMap(o=>{let r=ne(o);return r===void 0?[]:[r]})},renderer(o){return t.find(({registration:r})=>r.resolver.id===o)?.registration.resolver.renderResult}};return w}s(oe,"createSearchCore");function pe(e){if(!L(e)||!L(e.resolver))throw new TypeError("Invalid search resolver registration");let t=e.resolver;if(typeof t.id!="string"||t.id.trim().length===0||typeof t.tryResolve!="function"||typeof t.format!="function")throw new TypeError("Invalid search resolver registration");if(e.priority!==void 0&&(typeof e.priority!="number"||!Number.isFinite(e.priority)))throw new TypeError("Invalid search resolver priority")}s(pe,"assertResolver");function he(e){if(!L(e)||typeof e.resolverId!="string"||e.resolverId.trim().length===0||typeof e.capability!="string"||e.capability.trim().length===0||typeof e.execute!="function")throw new TypeError("Invalid search action registration")}s(he,"assertAction");function L(e){return typeof e=="object"&&e!==null}s(L,"isRecord");function me(e){if(typeof e!="object"||e===null||!("kind"in e))return!1;let t=e.kind;return t==="not-handled"||t==="resolved"&&"payload"in e||t==="failed"&&"error"in e}s(me,"isAttempt");function ge(e){return typeof e=="object"&&e!==null&&Array.isArray(e.content)}s(ge,"isAgentToolResult");function E(e,t,c,d){return C({isError:!0,content:[{type:"text",text:t}],details:{failure:{code:e,message:t,...c!==void 0&&{resolverId:c},...d!==void 0&&{cause:d}}}},x,{status:"error",errors:[{code:e,message:t}]})}s(E,"failure");function te(e){if(typeof e=="function")return e;if(typeof e!="string"||e.trim().length===0)throw new TypeError("Search description must not be empty");return e.trim()}s(te,"normalizeDescriptionSource");function ne(e){let t=typeof e=="function"?e():e;if(t!==void 0){if(typeof t!="string"||t.trim().length===0)throw new TypeError("Search description must not be empty");return t.trim()}}s(ne,"renderDescription");function O(e,t){return`${e}:${t}`}s(O,"actionKey");function $(e,t){return!(e instanceof Error)||e.message.trim().length===0?t:e instanceof SyntaxError?e.message:`${t}: ${e.message}`}s($,"messageFor");import{readFile as ye}from"node:fs/promises";import Se from"node:os";import N from"node:path";var we=3e4;function se(e=process.env,t=Se.homedir(),c=process.cwd()){let d=e.PI_CODING_AGENT_DIR?.trim(),a=d===void 0||d.length===0?N.join(t,".pi","agent"):N.resolve(d);return{globalPath:N.join(a,"pi-agent-ide","search.json"),projectPath:N.resolve(c,".pi","pi-agent-ide","search.json")}}s(se,"resolveSearchConfigPaths");async function ae(e){let[t,c]=await Promise.all([ie(e.globalPath),ie(e.projectPath)]),d=c!==void 0?c:t;return{timeoutMs:d===void 0?we:d}}s(ae,"loadSearchConfig");async function ie(e){let t;try{t=await ye(e,"utf8")}catch(S){if(ve(S))return;throw new Error(`Cannot read Pi Agent IDE search config at ${e}`,{cause:S})}let c;try{c=JSON.parse(t)}catch(S){throw new Error(`Invalid JSON in Pi Agent IDE search config at ${e}`,{cause:S})}if(!ce(c))throw new TypeError(`Pi Agent IDE search config at ${e} must be a JSON object`);let d=Object.keys(c).find(S=>S!=="timeoutMs");if(d!==void 0)throw new TypeError(`Pi Agent IDE search config at ${e} contains unknown key ${d}`);let a=c.timeoutMs;if(a==null)return a;if(typeof a!="number"||!Number.isSafeInteger(a)||a<=0)throw new TypeError(`timeoutMs must be a positive integer or null in Pi Agent IDE search config at ${e}`);return a}s(ie,"readTimeout");function ve(e){return ce(e)&&e.code==="ENOENT"}s(ve,"isMissingFile");function ce(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(ce,"isRecord");var de=Symbol("search-timeout"),M=class extends Error{static{s(this,"SearchTimeoutError")}constructor(t){super(t),this.name="SearchTimeoutError"}};async function le(e,t,c){if(e===null)return c(t);let d=new AbortController,a=t===void 0?d.signal:AbortSignal.any([t,d.signal]),S,I=new Promise(h=>{S=setTimeout(()=>{h(de),d.abort()},e)});try{let h=await Promise.race([c(a),I]);if(h===de)throw new M(`Search timed out after ${Re(e)}. Try a smaller path scope.`);return h}finally{clearTimeout(S)}}s(le,"runWithSearchTimeout");function Re(e){if(e%1e3!==0)return`${String(e)}ms`;let t=e/1e3;return`${String(t)} ${t===1?"second":"seconds"}`}s(Re,"formatDuration");function Pe(e,t){let c=[...e.path===void 0?[]:[{text:typeof e.path=="string"?`in ${e.path}`:"in result scope",color:"accent",underline:!0,truncate:"start"}],...e.navigation===void 0?[]:[{text:"reference navigation",color:"warning"}],...e.include===void 0?[]:[{text:`include ${e.include}`}],...e.exclude===void 0?[]:[{text:`exclude ${e.exclude}`}],...e.caseSensitive===!0?[{text:"case sensitive"}]:[],...e.wholeWord===!0?[{text:"whole word"}]:[],...e.limit===void 0?[]:[{text:`limit ${String(e.limit)}`}]];return{tool:"search",primary:{text:JSON.stringify(e.query),color:"accent",truncate:"end"},qualifiers:c,details:Te(e),expanded:t}}s(Pe,"searchCallModel");function be(e){return e==="full"||e==="disabled"?e:"compact"}s(be,"parsePresentation");async function fe(e,t){let c=be(t?.preferences["ui.search"]);q(e,[await F({id:"search-code",description:"Text search, AST patterns, symbols, graphs, and semantic rename",triggers:[{tool:"search"},{tool:"read",resourcePrefixes:["ast:","symbol:","symbols:","graph:"]}]})]);let d=_(e),a=oe(d),S=new ee,I=e.events.on(K,h=>{if(!B(h))throw new Error("Invalid pi-agent-search plugin registration request");h.accept(a.registerPlugin(h.plugin))});e.on("session_shutdown",I),e.registerTool(re({name:"search",exposure:"direct",namespace:{name:"ide_search",description:"Find workspace text, paths and code structures."},annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},label:"search",description:"Use search to find text, file paths, syntax patterns, language symbols, web-page text, and running processes.",promptSnippet:"Search files and text with literals or regular expressions, plus syntax trees and language symbols",get promptGuidelines(){return["Use the narrowest useful search query and scope; broaden when needed.",...a.renderPromptGuidelines()]},parameters:Y,outputSchema:X,renderCall(h,u,v){let w=v.expanded?"full":c;return w==="disabled"?new ue(u.fg("toolTitle","search"),0,0):V(v.lastComponent,Pe(h,w==="full"),u)},renderResult(h,u,v,w){let o=u.expanded?"full":c;if(o==="disabled"&&!w.isError&&!u.isPartial)return new ue(v.fg("success","\u2713 search"),0,0);u={...u,expanded:o==="full"};let r=h.details,m=r?.resolverId===void 0?void 0:a.renderer(r.resolverId);if(m!==void 0&&r?.payload!==void 0&&!w.isError&&!u.isPartial){let l={...h,details:r.payload};return m(l,u,v,w)}return Ae(h,u,v)},async execute(h,u,v,w,o){try{let r=await ae(se(process.env,Ee.homedir(),o.cwd));return await le(r.timeoutMs,v,async m=>{await a.waitForPendingPlugins();let l=u.path!==void 0&&(typeof u.path!="string"||u.path.startsWith("RESULT#")),R=l?d.resolve(u.path,o.cwd):void 0;if(R!==void 0&&(await d.verify(R,m),/^(?:files|symbol|graph|process):/u.test(u.query)))throw new Error("This query provider does not support result scopes yet.");return a.execute({...u,path:typeof u.path=="string"&&!l?u.path:void 0},{cwd:o.cwd,...R===void 0?{}:{scope:R},...m!==void 0&&{signal:m},...w!==void 0&&{onUpdate:w}})})}catch(r){if(v?.aborted)throw r;let m=r instanceof Error?r.message:String(r);return C({content:[{type:"text",text:m}],details:{failure:{code:"RESOLVE_FAILED",message:m}}},x,{status:"error",errors:[W(r,"SEARCH_FAILED")]})}}},S)),e.events.emit(Q,{protocol:J,apiVersion:z}),await a.waitForPendingPlugins()}s(fe,"registerSearchCore");function Te(e){return[{label:"query",value:JSON.stringify(e.query)},...D("path",e.path===void 0?void 0:typeof e.path=="string"?e.path:"result scope"),...D("navigation",e.navigation),...D("include",e.include),...D("exclude",e.exclude),...D("caseSensitive",e.caseSensitive===void 0?void 0:String(e.caseSensitive)),...D("wholeWord",e.wholeWord===void 0?void 0:String(e.wholeWord)),...D("limit",e.limit===void 0?void 0:String(e.limit))]}s(Te,"searchCallDetails");function D(e,t){return t===void 0?[]:[{label:e,value:t}]}s(D,"optionalDetail");function Ae(e,t,c){let d=e.content.flatMap(a=>a.type==="text"?[a.text]:[]).join(`
|
|
2
|
-
`);return new H({summary:e.details&&typeof e.details=="object"&&"failure"in e.details?"Search failed":"Search results",rows:d.split(`
|
|
3
|
-
`).map(a=>({kind:"note",text:a}))},c,t.expanded)}s(Ae,"fallbackResult");export{fe as default};
|
|
1
|
+
import{a,b,c,d,e,f,g}from"./chunk-VAXLSPPU.js";import"./chunk-EI7MMDWY.js";export{b as SEARCH_API_VERSION,c as SEARCH_CORE_READY_EVENT,d as SEARCH_PLUGIN_REGISTER_EVENT,a as SEARCH_PROTOCOL,e as isSearchCoreReady,f as isSearchPlugin,g as isSearchPluginRegistrationRequest};
|
package/dist/entry-55.js
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
`).filter(Boolean).map(h=>T.relative(s,T.resolve(s,h))).filter(h=>ye(h,r)).sort((h,y)=>h.localeCompare(y));i({files:g.slice(0,n),complete:g.length<=n})})})}f(Se,"searchFiles");function ge(r){return r?.split(",").map(o=>o.trim()).filter(Boolean)??[]}f(ge,"splitGlobs");function ye(r,o){if(/[*?[\]{}]/u.test(o)){let s=o.replace(/^\.\//u,"");return T.matchesGlob(s.includes("/")?r:T.basename(r),s)}return Te(r,o)}f(ye,"matchFile");function Te(r,o){if(o.length===0)return!0;let s=0,t=r.toLowerCase();for(let e of o.toLowerCase()){if(s=t.indexOf(e,s),s===-1)return!1;s+=1}return!0}f(Te,"fuzzyMatch");import{spawn as $e}from"node:child_process";import{stat as Pe}from"node:fs/promises";async function be(r,o,s,t){let e=AbortSignal.timeout(b.timeoutMs),n=s===void 0?e:AbortSignal.any([s,e]);try{if(n.throwIfAborted(),t!==void 0&&t.byteSize===void 0)return A("source owner cannot bound candidate snapshots");let a=await qe(r,o,n,t);if(a.limited)return A("name collection reached its byte or unique-name budget");let i=[],c=0,u=new Set;for(let m of Y(r.query,a.names)){n.throwIfAborted();let p=await q({...r,query:m.identifier},o,n,t);if(p.matches.length===0){if(!p.complete)return A("candidate verification reached its byte budget before capturing a match");continue}for(let d of p.matches)if(!u.has(d.source)&&(u.add(d.source),c+=t===void 0?(await Pe(d.source)).size:await ke(t,d.source,n),c>b.vocabularyBytes))return A("candidate source snapshots exceeded the byte budget");i.push({...m,...p})}return i.length===0?void 0:{status:"ready",candidates:i}}catch(a){return s?.throwIfAborted(),A(e.aborted?"extra search reached its time budget":`extra search failed: ${a instanceof Error?a.message:String(a)}`)}}f(be,"searchFuzzy");async function q(r,o,s,t){let e=AbortSignal.timeout(b.timeoutMs),n=s===void 0?e:AbortSignal.any([s,e]),a=await se({...r,regex:!1,caseSensitive:!0,wholeWord:!0},o,n,{matches:b.matchesPerCandidate,bytes:b.verificationBytes},t);return{...a,matches:a.matches.filter(i=>i.lineText[i.startColumn-1]!=="$"&&i.lineText[i.endColumn]!=="$")}}f(q,"searchFuzzyAlternative");async function ke(r,o,s){if(r.byteSize===void 0)throw new Error("Source owner cannot bound candidate snapshots");return r.byteSize(o,s)}f(ke,"ownedByteSize");function A(r){return{status:"skipped",message:r,candidates:[]}}f(A,"skipped");async function qe(r,o,s,t){let e=await oe(r,o,t,s);if(t!==void 0){let n=new P,a=new AbortController,i=AbortSignal.any([s,a.signal]);try{let c=await t.runLines(["--only-matching","--no-filename","--case-sensitive",...e.arguments,"--","[A-Za-z_$][A-Za-z0-9_$]*",e.target],e.cwd,u=>{a.signal.aborted||(n.account(Buffer.byteLength(u)+1)&&n.add(u),n.limited&&a.abort())},i);if(!n.limited&&c.code!==0&&c.code!==1)throw new Error(c.stderr.trim()||"Ripgrep failed.")}catch(c){if(s.throwIfAborted(),!n.limited)throw c}return n}return s.throwIfAborted(),new Promise((n,a)=>{let i=$e(v(),["--only-matching","--no-filename","--case-sensitive",...e.arguments,"--","[A-Za-z_$][A-Za-z0-9_$]*",e.target],{cwd:e.cwd,stdio:["ignore","pipe","pipe"]}),c=new P,u="",m=!1,p="",d=f(()=>{i.kill()},"abort"),l=f(()=>{s.removeEventListener("abort",d)},"cleanup");i.stdout.on("data",g=>{if(!c.account(g.length)){i.kill();return}for(let h of g)if(h===10){if(m||c.add(u),u="",m=!1,c.limited){i.kill();break}}else m||(u.length===b.identifierLength?(u="",m=!0):u+=String.fromCharCode(h))}),i.stderr.setEncoding("utf8"),i.stderr.on("data",g=>{p=(p+g).slice(0,4096)}),i.once("error",g=>{l(),a(g)}),i.once("close",g=>{if(l(),s.aborted){a(s.reason);return}if(!c.limited&&g!==0&&g!==1){a(new Error(p.trim()||`ripgrep exited with code ${String(g)}`));return}n(c)}),s.addEventListener("abort",d,{once:!0}),s.aborted&&d()})}f(qe,"collectNames");var Re="Anchors: SEARCH#HASH:N:line (line), SEARCH#HASH:N:match (exact match), SEARCH#HASH:all:line (each unique containing line), SEARCH#HASH:all:match (every exact match)";function xe(r){return ze("text",r,ie)}f(xe,"createTextResolver");function ve(r){return ze("regex",r,o=>o.query.startsWith("regex:")?{...o,query:o.query.slice(6),regex:!0}:void 0)}f(ve,"createRegexResolver");function Ae(){return{id:"files",readResources:f((r,o)=>r.query.startsWith("files:")?[r.path??o.cwd]:[],"readResources"),toScriptData(r){let o=r;return{kind:"files",files:[...o.files],complete:o.complete}},async tryResolve(r,o){if(!r.query.startsWith("files:"))return{kind:"not-handled"};let s=r.query.slice(6).trim(),t=await Se(s,r,o.cwd,o.signal,o.environment);return{kind:"resolved",payload:{query:s,...t}}},renderResult(r,o,s){let t=r.details;return new j({summary:`${t.files.length}${t.complete?"":"+"} ${t.files.length===1?"file":"files"}`,rows:t.files.length?t.files.map(e=>({kind:"source",label:e,link:e.startsWith("ssh://")?e:Ie(I.resolve(t.cwd,e)).href})):[{kind:"note",text:"No files found"}]},s,o.expanded)},format(r,o){let s=r;return{content:[{type:"text",text:[s.complete?`${String(s.files.length)} files`:`${String(s.files.length)}+ files (limit reached)`,...s.files].join(`
|
|
3
|
-
`)}],details:{query:s.query,files:s.files,complete:s.complete,cwd:o.cwd}}}}}f(Ae,"createFileResolver");function ze(r,o,s){return{readResources:f((t,e)=>s(t)===void 0?[]:e.scope?.targets.map(n=>n.source)??[t.path??e.cwd],"readResources"),id:r,supportsResultScope:!0,toScriptData(t,e){let n=t,a=e,i=a.sessionId;return{...X(n.matches,n.complete,i,a),notices:[...n.notices],...a.fuzzy===void 0?{}:{fuzzy:a.fuzzy}}},async tryResolve(t,e){let n=s(t);if(n===void 0)return{kind:"not-handled"};let a=e.scope===void 0?await ce(n,e.cwd,e.signal,e.environment):await k(n,e.scope,e.cwd,e.signal),i=e.scope===void 0&&r==="text"&&a.complete&&a.matches.length===0&&K(t.query)?await be({...t,query:t.query},e.cwd,e.signal,e.environment):void 0;return{kind:"resolved",payload:{request:{...t,query:a.query},...a,recipe:{...n,originalQuery:t.query},...i===void 0?{}:{fuzzy:i}}}},async format(t,e){let n=t,a=e.scope,i=await o.registerIfCurrent(n.request.query,n.matches,n.complete,e.cwd,e.signal,n.recipe,a===void 0?void 0:m=>k(n.recipe,a,e.cwd,m),void 0,e.environment);if(n.fuzzy!==void 0){let m=E(n.request.query,[],n.complete,e.cwd),p=[],d=!1,l=AbortSignal.timeout(b.timeoutMs),g=e.signal===void 0?l:AbortSignal.any([e.signal,l]);for(let w of n.fuzzy.candidates){let R={...n.request,query:w.identifier,regex:!1,caseSensitive:!0,wholeWord:!0},x;try{x=await o.registerIfCurrent(w.identifier,w.matches,w.complete,e.cwd,g,R,z=>q(R,e.cwd,z,e.environment),b.vocabularyBytes,e.environment)}catch{e.signal?.throwIfAborted()}x===void 0&&(d=!0),p.push(ee(w,x?.id,x))}let h=d?"Some candidate files changed or could not be registered; locations are shown without stable references.":n.fuzzy.message,y={status:n.fuzzy.status,...h===void 0?{}:{message:h},candidates:p},S=[...n.notices,"No matches found."];return p.some(w=>w.selection.matches[0]?.references!==void 0)&&S.push(Re),y.status==="ready"&&y.message!==void 0&&S.push(y.message),y.status==="skipped"&&S.push(`Possible-name fallback skipped: ${y.message}`),p.length>0&&S.push("Possible names \u2014 spelling suggestions, not equivalent behavior.",...p.map(te)),{content:[{type:"text",text:S.join(`
|
|
4
|
-
|
|
5
|
-
`)}],details:{...m,...i?.target===void 0?{}:{target:i.target,matchTargets:[]},fuzzyPresentation:de(n.fuzzy.candidates,e.cwd),fuzzy:y}}}let c=n.request.limit??50;if(n.matches.length===0)return{content:[{type:"text",text:[...n.notices,"No matches found."].join(`
|
|
6
|
-
`)}],details:{...E(n.request.query,[],n.complete,e.cwd),...i?.target===void 0?{}:{target:i.target,matchTargets:[]}}};let u=i??{query:n.request.query,matches:n.matches,complete:n.complete};return{content:[{type:"text",text:[...n.notices,Ne(u,e.cwd,c,i!==void 0)].join(`
|
|
7
|
-
`)}],details:{...E(u.query,u.matches,u.complete,e.cwd,i?.id,c),...i?.target===void 0?{}:{target:i.target,matchTargets:i.matchTargets}}}},renderResult:he}}f(ze,"createMatchResolver");function Ne(r,o,s,t=!0){let e=new Set(r.matches.map(d=>d.source)).size,n=r.matches.length,a=`${String(n)}${r.complete?"":"+"} ${we(n,"match","matches")} in ${String(e)} ${we(e,"file","files")}`,i=t?r.complete?`SEARCH#${r.id}:all:line / SEARCH#${r.id}:all:match \u2014 ${a}`:`${a} (incomplete results; no all anchors were registered)`:`${a} (files changed during search; results shown without anchors)`,c=t?[Re,i]:[i],u=new Map(r.matches.map((d,l)=>[d,l+1])),m=le(r.matches,s);for(let[d,l]of m.files.entries()){d>0&&c.push("");let g=_e(l.source,o);if(l.kind==="compacted"){c.push(`${g}: ${String(l.matchCount)} matches across ${String(l.uniqueLineCount)} unique line texts (compacted)`);for(let h of l.groups)c.push(` \xD7${String(h.matchCount)} ${Fe(h.text)}`);l.groups.length<l.uniqueLineCount&&c.push(` \u2026 ${String(l.uniqueLineCount-l.groups.length)} more unique line texts`),c.push(` Search again with path: ${JSON.stringify(g)} and a narrower query to see individual matches.`);continue}for(let h of l.matches){let y=u.get(h);if(y===void 0)continue;let S=`${g}:${String(h.lineNumber)}:${String(h.startColumn+1)}-${String(h.endColumn+1)}`;c.push(t?`${S} SEARCH#${r.id}:${String(y)}:line SEARCH#${r.id}:${String(y)}:match`:S,` ${Oe(h)}`)}}let p=e-m.files.length;if(p>0){let d=m.files.reduce((l,g)=>l+(g.kind==="detailed"?g.matches.length:g.matchCount),0);c.push(`
|
|
8
|
-
\u2026 ${p} more files (${n-d} matches) not displayed. Narrow path, include, or query to see them.`)}return c.join(`
|
|
9
|
-
`)}f(Ne,"formatSearchSession");function Oe(r){let s=Math.max(0,r.startColumn-64),t=Math.min(r.lineText.length,r.endColumn+64);return`${s>0?"\u2026":""}${r.lineText.slice(s,r.startColumn)}\u27E6${r.lineText.slice(r.startColumn,r.endColumn)}\u27E7${r.lineText.slice(r.endColumn,t)}${t<r.lineText.length?"\u2026":""}`}f(Oe,"previewMatch");function Fe(r){return`${r.slice(0,129)}${r.length>129?"\u2026":""}`}f(Fe,"previewLine");function _e(r,o){if(r.includes("://"))return r;let s=I.relative(o,r);return s.length>0&&!s.startsWith("..")&&!I.isAbsolute(s)?s:r}f(_e,"displaySource");function we(r,o,s){return r===1?o:s}f(we,"plural");async function He(r){let o,s=new pe(void 0,B(r),async(t,e,n)=>{if(o===void 0){if(t.includes("://"))throw new Error("No search snapshot owner for this source.");return De(t,{encoding:"utf8",signal:n})}let a=await o.read({path:t},{cwd:e,signal:n},"script");if(a.isError||a.script?.kind!=="text"||a.script.source!==t)throw new Error(a.details.failure?.message??"The source cannot provide an exact text snapshot.");return a.script.content});r.on("tool_result",async(t,e)=>{if(t.toolName!=="replace"||t.isError||typeof t.details!="object"||t.details===null)return;let n="metadata"in t.details?t.details.metadata:void 0,a=n&&typeof n=="object"&&"searchObservations"in n?n.searchObservations:void 0,i=Array.isArray(a)?a:await s.observeAfterEdit([t.input.path,t.input.start,t.input.end],e.signal);if(i.length!==0)return{content:[...t.content,{type:"text",text:["Original search observed after editing (not task validation):",...i.map(c=>{let{query:u,fallbacks:m,...p}=c.scope;return[`SEARCH#${c.sessionId}: ${JSON.stringify(c.query)}`,`Scope and options: ${JSON.stringify(p)}`,c.error===void 0?`Matches: ${c.matches}${c.complete===!0?"; complete search.":"+; incomplete search, lower bound only."}`:`Search failed: ${c.error}. Applied edits remain applied.`,...c.notices??[]].join(`
|
|
10
|
-
`)})].join(`
|
|
11
|
-
`)}],details:{...t.details,searchObservations:i},...t.structuredContent===void 0?{}:{structuredContent:t.structuredContent}}}),r.on("tool_result",t=>{if(t.toolName!=="search"||typeof t.details!="object"||t.details===null)return;let e=t.details;if(ue(e.payload))return{details:{...e,payload:fe(e.payload,t.content.flatMap(n=>n.type==="text"?[n.text]:[]).join(`
|
|
12
|
-
`))}}}),await Promise.all([M(r,{protocol:H,apiVersion:L,id:"search-snapshots",setup(t){o=t}}),D(r,me),Z(r,{protocol:Q,apiVersion:U,id:"local",setup(t){t.addScopeProvider((e,n)=>s.resolveSearchScope(e,n)),t.addSelectionProvider((e,n)=>s.register(e.request.query,e.matches,e.complete,n.cwd,n.signal,{...e.request,regex:!1},e.refresh,void 0,n.environment)),t.addResolver({resolver:ve(s),priority:-10}),t.addResolver({resolver:Ae(),priority:-10}),t.addResolver({resolver:xe(s),fallback:!0}),t.describe(["Local queries try literal terms first, then unquoted terms as regex when no literal results exist, then separate words for ordinary multi-word queries. Quoted terms stay literal. Boolean conditions stay intact across fallback. Uppercase AND/OR, infix NOT, ||, and space-separated | are Boolean operators; unspaced | and regex groups/classes belong to regex terms. Parentheses containing Boolean operators group Boolean conditions. regex:<pattern> forces regex-only matching; files:<pattern> searches file paths: glob patterns use *, **, ?, character classes and braces; other queries use case-insensitive subsequence matching. Slash-containing globs match cwd-relative paths; basename globs match at any depth.","After a complete zero result, a single unquoted ASCII identifier may produce separate possible-name groups: naming-style changes, one leading/trailing component, then small typos. Each group reports a verified case-sensitive whole-identifier alternative in the same scope, its count/completeness, and Read references. Budget skips are explicit. A candidate all-reference refreshes that exact alternative, not the fuzzy ranking. Registered local candidate selections also expose strict snapshot targets. Result scopes stay exact and do not run this extra branch.","The result says when a query was broadened. Empty or unknown prefixes are searched as plain text. A recognized prefixed query returns its own results or error; it does not silently become a text search.","SEARCH#HASH:N:line selects one containing line; :match selects its exact match. :all:line selects all unique containing lines and :all:match selects all matches. Read returns containing lines for both forms. A SEARCH resource can be used as a read path or mutation path/anchor; omit the file path for an all-selection spanning files.","Use SEARCH references exactly as returned to select the matching content. A single-result reference becomes stale when its file changes; obtain a fresh result before using it again. An :all reference refreshes the original query when a selected file changes. Search compacts noisy files when the detail limit is exceeded; narrow the query to that file to see individual matches. Compaction does not remove complete :all selections."].join(`
|
|
13
|
-
`))}}),J(r,{protocol:V,apiVersion:G,id:"search-anchors",setup(t){t.tool("replace").addHandler({stage:"text-post-edit",async handler(e){if(!e.result||typeof e.result!="object"||!("kind"in e.result)||e.result.kind!=="completed"||!e.input||typeof e.input!="object")return e;let n=e.input,a=await s.observeAfterEdit([n.path,n.start,n.end],e.signal);return a.length===0?e:{...e,metadata:{...e.metadata,searchObservations:a}}}}),t.addAnchorResolver({resolver:s.anchorResolver(),resources:s.resourceResolver(),kind:W,type:"auxiliary",describeInPrompt:!1})}})])}f(He,"registerTextSearch");export{Ce as createSearchSessionId,He as default};
|
|
1
|
+
import{a as e,b as f,c as g,d as h,e as i,f as j,g as k,h as l,i as m,j as n}from"./chunk-FYOU4RBH.js";import{b as a,c as b,d as c,e as d}from"./chunk-7PVDTMEM.js";import"./chunk-PS2B6THP.js";import"./chunk-DDH3FP4G.js";import"./chunk-EI7MMDWY.js";export{k as FuzzyVocabulary,f as containsSearchMatch,n as formatFuzzyCandidate,m as fuzzyCandidateData,h as fuzzyLimits,j as isFuzzyQuery,i as isFuzzyResultData,l as rankFuzzyIdentifiers,e as renderSearchMatches,a as searchDataSchema,b as searchOutputSchema,d as searchSchema,c as selectionData,g as splitGlobList};
|
package/dist/entry-56.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as e}from"./chunk-KFBRL2V4.js";import"./chunk-XH5WN5XA.js";import"./chunk-VAXLSPPU.js";import"./chunk-7PVDTMEM.js";import"./chunk-KN6VPARZ.js";import"./chunk-PS2B6THP.js";import"./chunk-DDH3FP4G.js";import"./chunk-EI7MMDWY.js";export{e as default};
|
package/dist/entry-57.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as
|
|
1
|
+
import{a as b,b as c}from"./chunk-WUO3UW4J.js";import{g as a}from"./chunk-OBTT5INC.js";import"./chunk-5BGWNYQS.js";import"./chunk-2TZDG2JH.js";import"./chunk-IG5DXVDJ.js";import"./chunk-XH5WN5XA.js";import"./chunk-R2U5WXYR.js";import"./chunk-47SPPIXK.js";import"./chunk-VAXLSPPU.js";import"./chunk-FYOU4RBH.js";import"./chunk-7PVDTMEM.js";import"./chunk-MDD5ORB6.js";import"./chunk-MLFJU2US.js";import"./chunk-PS2B6THP.js";import"./chunk-GXL4NMHR.js";import"./chunk-PQWANILR.js";import"./chunk-BU7IZLKB.js";import"./chunk-S5PL5DFQ.js";import"./chunk-DDH3FP4G.js";import"./chunk-VDJSH3DQ.js";import"./chunk-756K3LJY.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as createSearchSessionId,b as default,c as registerResourceSearchSelections};
|
package/dist/entry-58.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{g as a,h as b,i as c,j as d,k as e}from"./chunk-OBTT5INC.js";import"./chunk-5BGWNYQS.js";import"./chunk-FYOU4RBH.js";import"./chunk-7PVDTMEM.js";import"./chunk-PS2B6THP.js";import"./chunk-DDH3FP4G.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{e as SearchSessionStore,d as SearchSnapshotChangedError,c as allocateSearchSessionId,a as createSearchSessionId,b as createSearchSessionIdentity};
|
package/dist/entry-59.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b
|
|
1
|
+
import{b as a,c as b}from"./chunk-2TZDG2JH.js";import"./chunk-IG5DXVDJ.js";import"./chunk-FYOU4RBH.js";import"./chunk-7PVDTMEM.js";import"./chunk-PS2B6THP.js";import"./chunk-DDH3FP4G.js";import"./chunk-VDJSH3DQ.js";import"./chunk-EI7MMDWY.js";export{b as SearchResultPanel,a as renderSearchResult};
|
package/dist/entry-6.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a as t}from"./chunk-KINKBPPX.js";import"./chunk-EI7MMDWY.js";export{t as formatDiagnostic};
|
package/dist/entry-60.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as a,c as b,d as c}from"./chunk-IG5DXVDJ.js";import"./chunk-FYOU4RBH.js";import"./chunk-7PVDTMEM.js";import"./chunk-PS2B6THP.js";import"./chunk-DDH3FP4G.js";import"./chunk-EI7MMDWY.js";export{b as createFuzzyPresentation,a as createSearchToolDetails,c as isSearchToolDetails};
|
package/dist/entry-61.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u}from"./chunk-VDJSH3DQ.js";import"./chunk-EI7MMDWY.js";export{a as TextAnchor,b as attachTextAnchorRenderer,p as createTextContentConverter,m as createTextDocument,c as getTextAnchorRenderer,i as getTextSourceLine,g as isTextAnchorRecoveryOutcome,f as isTextAnchorResolutionAttempt,e as isTextAnchorResolver,k as isTextLinePresenter,l as isTextPresenterRegistration,s as isTextTargetResolutionAttempt,q as isTextualMediaType,o as renderPresentedTextDocument,h as renderPresentedTextRows,d as renderTextAnchor,n as renderTextDocument,u as restoreText,t as storeText,r as textFromAgentContent,j as withTextSourceLine};
|
package/dist/entry-62.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a}from"./chunk-NA2NEU4V.js";import"./chunk-GXL4NMHR.js";import"./chunk-PQWANILR.js";import"./chunk-DDH3FP4G.js";import"./chunk-VDJSH3DQ.js";import"./chunk-EI7MMDWY.js";export{a as default};
|
package/dist/entry-63.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c
|
|
1
|
+
import{a,b,c}from"./chunk-QJ6V5IAY.js";import"./chunk-5BGWNYQS.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as createExactTextAnchorResolver,c as findExactTextMatches,b as resolveExactTextAnchor};
|
package/dist/entry-64.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"./chunk-WEE3NM6L.js";import"./chunk-QJ6V5IAY.js";import"./chunk-5BGWNYQS.js";import"./chunk-GXL4NMHR.js";import"./chunk-PQWANILR.js";import"./chunk-DDH3FP4G.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as default};
|
package/dist/entry-65.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-UD3DMY3Q.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{b as createLineHashAnchor,e as createLineHashAnchorResolver,c as formatLineHashAnchor,a as hashLine,d as renderLineHashLines};
|
package/dist/entry-66.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-C2JT2G5K.js";import"./chunk-UD3DMY3Q.js";import"./chunk-GXL4NMHR.js";import"./chunk-PQWANILR.js";import"./chunk-BU7IZLKB.js";import"./chunk-S5PL5DFQ.js";import"./chunk-DDH3FP4G.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as default};
|
package/dist/entry-68.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-GXL4NMHR.js";import"./chunk-PQWANILR.js";import"./chunk-DDH3FP4G.js";import"./chunk-VDJSH3DQ.js";import"./chunk-EI7MMDWY.js";export{a as connectTextEditorPlugin};
|
package/dist/entry-69.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk-235QMMVA.js";import"./chunk-LCWBVOII.js";import"./chunk-ZPT5D4VP.js";import"./chunk-EI7MMDWY.js";export{d as TEXT_EDITOR_API_VERSION,g as TEXT_EDITOR_CORE_READY_EVENT,h as TEXT_EDITOR_PLUGIN_REGISTER_EVENT,c as TEXT_EDITOR_PROTOCOL,e as TEXT_POSITION_ANCHOR_KIND,f as TEXT_SEARCH_ANCHOR_KIND,j as isResourceResolverRegistration,k as isTextAnchorResolverRegistration,l as isTextAnchorResourceResolutionAttempt,m as isTextEditorCoreReady,n as isTextEditorPlugin,o as isTextEditorPluginRegistrationRequest,i as isTextEditorToolId,b as localFileTransferAccess,a as snapshotLocalObjects};
|
package/dist/entry-7.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q}from"./chunk-7D7PXIVV.js";import"./chunk-BXGMMZT3.js";import"./chunk-756K3LJY.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as TOOL_CONFIG_VERSION,b as configuredExecutableName,p as createConfiguredProcessEnvironment,j as hasConfiguredExecutable,g as loadLayeredToolConfig,h as matchesConfiguredFile,n as parseFormattersConfig,o as parseLintersConfig,d as projectIdeConfigDirectory,e as projectIdeConfigPath,q as recipeMatchesFile,c as resolveExternalToolProjectRoot,f as resolveToolConfigPaths,m as runConfiguredFormatter,l as runConfiguredProcess,i as selectConfiguredEntry,k as toolRuntimeEvidence};
|
package/dist/entry-70.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-STUZZM5B.js";import"./chunk-EI7MMDWY.js";export{a as isTextEditHandlerRegistration};
|
package/dist/entry-71.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk-PQWANILR.js";import"./chunk-DDH3FP4G.js";import"./chunk-VDJSH3DQ.js";import"./chunk-EI7MMDWY.js";export{d as TEXT_EDITOR_API_VERSION,g as TEXT_EDITOR_CORE_READY_EVENT,h as TEXT_EDITOR_PLUGIN_REGISTER_EVENT,c as TEXT_EDITOR_PROTOCOL,e as TEXT_POSITION_ANCHOR_KIND,f as TEXT_SEARCH_ANCHOR_KIND,j as isResourceResolverRegistration,k as isTextAnchorResolverRegistration,l as isTextAnchorResourceResolutionAttempt,m as isTextEditorCoreReady,n as isTextEditorPlugin,o as isTextEditorPluginRegistrationRequest,i as isTextEditorToolId,b as localFileTransferAccess,a as snapshotLocalObjects};
|
package/dist/entry-72.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a}from"./chunk-MXLSGMRZ.js";import"./chunk-EI7MMDWY.js";export{a as formatStaleAnchorMessage};
|