pi-agent-ide 0.9.0 → 0.9.2
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 +24 -0
- package/dist/{chunk-TVH2ND35.js → chunk-35LZOKEW.js} +1 -1
- package/dist/chunk-3LVBARLW.js +33 -0
- package/dist/chunk-4GBFIGH3.js +1 -1
- package/dist/{chunk-64JTD2DJ.js → chunk-5PC5INOL.js} +1 -1
- package/dist/{chunk-FKKAHI62.js → chunk-BT2CFM7D.js} +1 -1
- package/dist/{chunk-VN3XBH2Q.js → chunk-DVNL5NZE.js} +1 -1
- package/dist/{chunk-PLMHBXWI.js → chunk-FXPY3V4L.js} +1 -1
- package/dist/{chunk-AJZVKDYC.js → chunk-HGCJDIRR.js} +1 -1
- package/dist/{chunk-RVFMH77U.js → chunk-HISGZD3C.js} +43 -44
- package/dist/{chunk-KFBRL2V4.js → chunk-HKYVP2Q6.js} +1 -1
- package/dist/{chunk-TVXZE4KW.js → chunk-HRBUY2FF.js} +1 -1
- package/dist/{chunk-QM5WDEFI.js → chunk-IOGWZNWT.js} +1 -1
- package/dist/{chunk-HT7LZN5A.js → chunk-IUJUECXH.js} +1 -1
- package/dist/chunk-LXDF2NWX.js +1 -0
- package/dist/{chunk-TVSZYABY.js → chunk-MPNE25CY.js} +1 -1
- package/dist/{chunk-Y74EKJOY.js → chunk-O7V6G3OO.js} +1 -1
- package/dist/chunk-OUCVZBOR.js +28 -0
- package/dist/{chunk-WUO3UW4J.js → chunk-PCGBM2D6.js} +1 -1
- package/dist/{chunk-V4J3TLCV.js → chunk-RIZARTUM.js} +1 -1
- package/dist/{chunk-LTADNZKW.js → chunk-T3Z4KXOX.js} +1 -1
- package/dist/chunk-TSQ6FBTB.js +1 -0
- package/dist/{chunk-CVOYSEBE.js → chunk-VNWGT367.js} +1 -1
- package/dist/{chunk-FS3KCKFX.js → chunk-X2WFNMQR.js} +1 -1
- package/dist/{chunk-7SG756UO.js → chunk-XCPIIDFS.js} +1 -1
- 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 -1
- package/dist/entry-22.js +1 -0
- 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 -1
- package/dist/entry-3.js +1 -1
- package/dist/entry-30.js +1 -2
- package/dist/entry-31.js +2 -1
- 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 -1
- package/dist/entry-36.js +1 -1
- package/dist/entry-37.js +1 -15
- package/dist/entry-38.js +15 -1
- package/dist/entry-39.js +1 -1
- package/dist/entry-4.js +1 -1
- package/dist/entry-40.js +1 -1
- package/dist/entry-41.js +1 -1
- package/dist/entry-42.js +1 -1
- package/dist/entry-43.js +1 -1
- package/dist/entry-44.js +1 -1
- package/dist/entry-45.js +1 -1
- package/dist/entry-46.js +1 -1
- package/dist/entry-47.js +1 -1
- package/dist/entry-48.js +1 -1
- package/dist/entry-49.js +1 -1
- 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 -1
- package/dist/entry-55.js +1 -1
- 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 -1
- package/dist/entry-66.js +1 -1
- package/dist/entry-67.js +1 -0
- package/dist/entry-68.js +0 -1
- package/dist/entry-69.js +1 -0
- package/dist/entry-7.js +1 -1
- package/dist/entry-70.js +0 -1
- package/dist/entry-71.js +1 -1
- package/dist/entry-72.js +1 -1
- package/dist/entry-73.js +1 -1
- package/dist/entry-74.js +1 -1
- package/dist/entry-75.js +1 -1
- package/dist/entry-76.js +1 -1
- package/dist/entry-77.js +1 -0
- package/dist/entry-78.js +0 -1
- package/dist/entry-79.js +1 -0
- package/dist/entry-8.js +1 -1
- package/dist/entry-80.js +0 -1
- package/dist/entry-81.js +1 -1
- package/dist/entry-82.js +1 -1
- package/dist/entry-83.js +1 -1
- package/dist/entry-84.js +1 -1
- package/dist/entry-85.js +1 -2
- package/dist/entry-86.js +2 -1
- package/dist/entry-87.js +1 -1
- package/dist/entry-88.js +1 -1
- package/dist/entry-89.js +1 -1
- package/dist/entry-9.js +1 -1
- package/dist/entry-90.js +1 -3
- package/dist/entry-91.js +3 -1
- package/dist/entry-92.js +1 -1
- package/dist/entry-93.js +1 -1
- package/dist/entry-94.js +1 -0
- package/dist/pi-agent-ide.js +13 -10
- package/docs/agent-guides/editing.md +3 -0
- package/docs/tools.md +2 -2
- package/node_modules/pi-agent-doctor/package.json +7 -7
- package/node_modules/pi-agent-documentation/package.json +2 -2
- package/node_modules/pi-agent-documentation/runtime/entry-30.js +1 -0
- package/node_modules/pi-agent-filesystem/package.json +8 -8
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- package/node_modules/pi-agent-filesystem-image/runtime/entry-32.js +2 -0
- package/node_modules/pi-agent-filesystem-jq/package.json +7 -7
- package/node_modules/pi-agent-filesystem-jq/runtime/entry-33.js +0 -1
- package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/runtime/entry-36.js +2 -0
- package/node_modules/pi-agent-ide-ast/package.json +15 -15
- package/node_modules/pi-agent-ide-ast/runtime/entry-37.js +0 -1
- package/node_modules/pi-agent-ide-ast/runtime/entry-38.js +2 -0
- package/node_modules/pi-agent-ide-changes/package.json +10 -10
- package/node_modules/pi-agent-ide-changes/runtime/entry-39.js +0 -1
- 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-lsp/package.json +13 -13
- package/node_modules/pi-agent-ide-lsp/runtime/entry-44.js +2 -0
- package/node_modules/pi-agent-image/package.json +3 -3
- 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-read/package.json +12 -12
- package/node_modules/pi-agent-read/runtime/entry-51.js +0 -1
- package/node_modules/pi-agent-read/runtime/entry-52.js +2 -0
- package/node_modules/pi-agent-resource/package.json +2 -2
- package/node_modules/pi-agent-search/package.json +9 -9
- package/node_modules/pi-agent-search/runtime/entry-56.js +0 -1
- package/node_modules/pi-agent-search-text/package.json +15 -15
- package/node_modules/pi-agent-search-text/runtime/entry-58.js +1 -0
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text/runtime/entry-62.js +1 -0
- package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-63.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/package.json +5 -5
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-64.js +0 -1
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-65.js +2 -0
- 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 +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-67.js +2 -0
- package/node_modules/pi-agent-text-editor/package.json +26 -26
- package/node_modules/pi-agent-text-editor/runtime/entry-83.js +0 -1
- package/node_modules/pi-agent-text-editor/src/core/result-transfer.ts +2 -6
- package/node_modules/pi-agent-text-editor/src/core/text-change-engine.ts +17 -36
- package/node_modules/pi-agent-text-editor/src/tools/text-selection.ts +40 -82
- package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +5 -9
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +1 -3
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +7 -5
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +2 -8
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +6 -6
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-86.js +2 -0
- package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
- package/node_modules/pi-agent-tool-ui/package.json +3 -3
- package/node_modules/pi-agent-tool-ui/runtime/entry-89.js +1 -0
- 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-image/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-94.js +2 -0
- package/package.json +61 -57
- package/src/api/capabilities.ts +60 -0
- package/src/composite/capabilities.ts +252 -0
- package/src/composite/capability-schemas.ts +53 -0
- package/src/composite/responses-tools.ts +27 -9
- package/src/composite/tool-availability.ts +28 -13
- 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-image/runtime/entry-32.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +7 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-33.js +0 -1
- 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-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-36.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-31.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/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-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-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-94.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-90.js +2 -0
- package/src/extensions/pi-agent-read/package.json +12 -12
- package/src/extensions/pi-agent-read/runtime/entry-51.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-52.js +2 -0
- package/src/extensions/pi-agent-search/package.json +9 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +15 -15
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-58.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-61.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-56.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-57.js +2 -0
- package/src/extensions/pi-agent-text-editor/package.json +26 -26
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-63.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-64.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-65.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-66.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-67.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +6 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-86.js +2 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-83.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-84.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/core/result-transfer.ts +2 -6
- package/src/extensions/pi-agent-text-editor/src/core/text-change-engine.ts +17 -36
- package/src/extensions/pi-agent-text-editor/src/tools/text-selection.ts +40 -82
- package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +5 -9
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +1 -3
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +7 -5
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +2 -8
- package/src/pi-agent-ide.ts +4 -1
- package/src/plugins/pi-agent-ide-ast/package.json +15 -15
- package/src/plugins/pi-agent-ide-ast/runtime/entry-37.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-38.js +2 -0
- package/src/plugins/pi-agent-ide-changes/package.json +10 -10
- package/src/plugins/pi-agent-ide-changes/runtime/entry-39.js +0 -1
- package/src/plugins/pi-agent-ide-debugger/index.ts +31 -26
- 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-lsp/package.json +13 -13
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-44.js +2 -0
- package/src/plugins/pi-agent-ide-terminal/index.ts +42 -0
- package/src/plugins/pi-agent-ide-terminal/src/resources.ts +0 -21
- package/src/plugins/pi-agent-ide-terminal/src/search.ts +0 -3
- package/dist/chunk-7URANI6I.js +0 -28
- package/dist/chunk-K4UTEMDU.js +0 -1
- package/dist/chunk-TNAUCNUT.js +0 -33
- package/dist/entry-23.js +0 -1
- package/node_modules/pi-agent-doctor/runtime/entry-23.js +0 -1
- package/node_modules/pi-agent-filesystem/runtime/entry-30.js +0 -2
- package/node_modules/pi-agent-filesystem-jq/runtime/entry-32.js +0 -1
- package/node_modules/pi-agent-ide-ast/runtime/entry-36.js +0 -1
- package/node_modules/pi-agent-ide-changes/runtime/entry-38.js +0 -1
- package/node_modules/pi-agent-image/runtime/entry-44.js +0 -1
- package/node_modules/pi-agent-resource/runtime/entry-52.js +0 -1
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-62.js +0 -2
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-63.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-65.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-67.js +0 -1
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-86.js +0 -1
- package/node_modules/pi-agent-web/runtime/entry-89.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-31.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-32.js +0 -1
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-30.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-90.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-89.js +0 -2
- package/src/extensions/pi-agent-read/runtime/entry-47.js +0 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-57.js +0 -2
- package/src/extensions/pi-agent-search/runtime/entry-53.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-62.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-63.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-65.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-84.js +0 -2
- package/src/extensions/pi-agent-text-editor/runtime/entry-67.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-36.js +0 -1
- package/src/plugins/pi-agent-ide-changes/runtime/entry-38.js +0 -1
- /package/node_modules/{pi-agent-documentation → pi-agent-doctor}/runtime/entry-29.js +0 -0
- /package/node_modules/{pi-agent-filesystem-image → pi-agent-filesystem}/runtime/entry-31.js +0 -0
- /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem-jq}/runtime/entry-34.js +0 -0
- /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-35.js +0 -0
- /package/node_modules/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-40.js +0 -0
- /package/node_modules/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-41.js +0 -0
- /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-42.js +0 -0
- /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-43.js +0 -0
- /package/node_modules/{pi-agent-invariant → pi-agent-image}/runtime/entry-45.js +0 -0
- /package/node_modules/{pi-agent-pdf → pi-agent-invariant}/runtime/entry-46.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-47.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-53.js +0 -0
- /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-57.js +0 -0
- /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-61.js +0 -0
- /package/node_modules/{pi-agent-text-editor-renderer → pi-agent-text-editor}/runtime/entry-84.js +0 -0
- /package/node_modules/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-85.js +0 -0
- /package/node_modules/{pi-agent-tool-ui → pi-agent-tool-call-interception}/runtime/entry-87.js +0 -0
- /package/node_modules/{pi-agent-web-html → pi-agent-web}/runtime/entry-90.js +0 -0
- /package/node_modules/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-91.js +0 -0
- /package/node_modules/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-92.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-93.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-pdf → pi-agent-filesystem-jq}/runtime/entry-34.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-35.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-91.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-92.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-93.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-85.js +0 -0
- /package/src/plugins/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-40.js +0 -0
- /package/src/plugins/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-41.js +0 -0
- /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-42.js +0 -0
- /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-43.js +0 -0
package/dist/entry-37.js
CHANGED
|
@@ -1,15 +1 @@
|
|
|
1
|
-
import{
|
|
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};
|
|
1
|
+
import{b as e,c as o}from"./chunk-2AY526TN.js";import"./chunk-VDJSH3DQ.js";import"./chunk-EI7MMDWY.js";export{o as AstScopeManager,e as parseDocument};
|
package/dist/entry-38.js
CHANGED
|
@@ -1 +1,15 @@
|
|
|
1
|
-
import{a,b,c}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{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{a as ne}from"./chunk-47SPPIXK.js";import{a as Q,b as Z}from"./chunk-VAXLSPPU.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"./chunk-756K3LJY.js";import{h as fe}from"./chunk-35LZOKEW.js";import{a as de,b as ue,c as pe}from"./chunk-T4FTT3U4.js";import"./chunk-VDJSH3DQ.js";import{a as q}from"./chunk-ZC65Z3CK.js";import"./chunk-KINKBPPX.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-HGCJDIRR.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-HGCJDIRR.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-39.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
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-4.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
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}from"./chunk-35LZOKEW.js";import{a,b,c,d}from"./chunk-T4FTT3U4.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import"./chunk-KINKBPPX.js";import"./chunk-EI7MMDWY.js";export{h as addDiagnosticAnnotations,g as createDiagnosticViewContent,l as createSourceMappedTextReadHandler,i as diagnosticStatus,c as formatCodeViewReference,f as formatDiagnosticViewSource,k as formatSourceViewResults,d as formatSymbolSelector,a as parseCodeViewReference,j as renderSourceViewLine,b as resolveCodeViewPath,e as resolveDiagnosticViewPath};
|
package/dist/entry-40.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b
|
|
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-756K3LJY.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as default,b as registerGitChangesWithExecutor};
|
package/dist/entry-41.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a,b,c,d}from"./chunk-5PC5INOL.js";import"./chunk-B25LXXNV.js";import"./chunk-7D7PXIVV.js";import"./chunk-BXGMMZT3.js";import"./chunk-MDD5ORB6.js";import"./chunk-MLFJU2US.js";import"./chunk-756K3LJY.js";import"./chunk-ZC65Z3CK.js";import"./chunk-ZAWRSA7N.js";import"./chunk-OFILFO6D.js";import"./chunk-EI7MMDWY.js";export{a as FORMATTER_RECIPES,b as FormatterCommandRegistry,c as default,d as registerFormatterWithOwner};
|
package/dist/entry-42.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-43.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-HRBUY2FF.js";import"./chunk-K5G4FDXD.js";import"./chunk-B25LXXNV.js";import"./chunk-7D7PXIVV.js";import"./chunk-BXGMMZT3.js";import"./chunk-MDD5ORB6.js";import"./chunk-MLFJU2US.js";import"./chunk-756K3LJY.js";import"./chunk-ZC65Z3CK.js";import"./chunk-ZAWRSA7N.js";import"./chunk-OFILFO6D.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-44.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"./chunk-
|
|
1
|
+
import{a,b,c,d}from"./chunk-BT2CFM7D.js";import"./chunk-B25LXXNV.js";import"./chunk-7D7PXIVV.js";import"./chunk-BXGMMZT3.js";import"./chunk-XH5WN5XA.js";import"./chunk-FYOU4RBH.js";import"./chunk-7PVDTMEM.js";import"./chunk-47SPPIXK.js";import"./chunk-VAXLSPPU.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-756K3LJY.js";import"./chunk-35LZOKEW.js";import"./chunk-T4FTT3U4.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import"./chunk-ZAWRSA7N.js";import"./chunk-OFILFO6D.js";import"./chunk-KINKBPPX.js";import"./chunk-EI7MMDWY.js";export{a as LSP_RECIPES,b as LspServerRegistry,c as default,d as registerLspWithOwner};
|
package/dist/entry-45.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}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-46.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a}from"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as requiredValue};
|
package/dist/entry-47.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
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-48.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{a}from"./chunk-BU7IZLKB.js";import"./chunk-S5PL5DFQ.js";import"./chunk-EI7MMDWY.js";export{a as connectReadPlugin};
|
package/dist/entry-49.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b
|
|
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-5.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-50.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,
|
|
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-51.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e}from"./chunk-
|
|
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-52.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-53.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,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-54.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-55.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
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-56.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
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-57.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as e}from"./chunk-HKYVP2Q6.js";import"./chunk-XH5WN5XA.js";import"./chunk-7PVDTMEM.js";import"./chunk-VAXLSPPU.js";import"./chunk-KN6VPARZ.js";import"./chunk-PS2B6THP.js";import"./chunk-DDH3FP4G.js";import"./chunk-EI7MMDWY.js";export{e as default};
|
package/dist/entry-58.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as b,b as c}from"./chunk-PCGBM2D6.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-FYOU4RBH.js";import"./chunk-7PVDTMEM.js";import"./chunk-47SPPIXK.js";import"./chunk-VAXLSPPU.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-756K3LJY.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as createSearchSessionId,b as default,c as registerResourceSearchSelections};
|
package/dist/entry-59.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-6.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-60.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a,c as 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-61.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c
|
|
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-62.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,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-63.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-64.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
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-65.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
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-66.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
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-67.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
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 +0,0 @@
|
|
|
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
|
@@ -0,0 +1 @@
|
|
|
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-7.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-70.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
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
|
|
1
|
+
import{a}from"./chunk-STUZZM5B.js";import"./chunk-EI7MMDWY.js";export{a as isTextEditHandlerRegistration};
|
package/dist/entry-72.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-73.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-MXLSGMRZ.js";import"./chunk-EI7MMDWY.js";export{a as formatStaleAnchorMessage};
|
package/dist/entry-74.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a}from"./chunk-5BGWNYQS.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as TextSelectionAnchor};
|
package/dist/entry-75.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a,d as b,g as c,h as d,i as e,j as f,k as g,l as h,m as i}from"./chunk-YPYROPQF.js";import"./chunk-PQWANILR.js";import"./chunk-DDH3FP4G.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{c as TEXT_EDITOR_POST_EDIT_REGISTER_EVENT,a as afterPostEditScope,i as connectTextEditorPostEditHandler,b as hasDeferredPostEdit,e as isDiffStatusContribution,d as isFormattingContribution,h as isTextMutationResultContributionData,f as isTextPostEditHandlerRegistration,g as isTextPostEditHandlerRegistrationRequest};
|
package/dist/entry-76.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a}from"./chunk-YGGKGZO2.js";import"./chunk-EI7MMDWY.js";export{a as NATIVE_EDIT_BATCH_EVENT};
|
package/dist/entry-77.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,d as c}from"./chunk-5S74Z6Y4.js";import{a as d,b as e,d as f}from"./chunk-GS5ZRTUG.js";import"./chunk-DDH3FP4G.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{b as FileMutationResult,a as FileRange,c as computeChangedRanges,d as mutationDataSchema,e as mutationResultSchema,f as structuredMutation};
|
package/dist/entry-78.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d}from"./chunk-FEZLTM4L.js";import"./chunk-EI7MMDWY.js";export{c as assertTextMutationToolRegistration,a as isMutationAnchorValue,d as mutationSource,b as withoutEmptyOptionalAnchors};
|
package/dist/entry-79.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d}from"./chunk-FEZLTM4L.js";import"./chunk-EI7MMDWY.js";export{c as assertTextMutationToolRegistration,a as isMutationAnchorValue,d as mutationSource,b as withoutEmptyOptionalAnchors};
|
package/dist/entry-8.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-80.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c}from"./chunk-YHADTHQM.js";import"./chunk-EI7MMDWY.js";export{c as clearLastResolvedResource,b as getLastResolvedResource,a as rememberLastResolvedResource};
|
package/dist/entry-81.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a,b,c}from"./chunk-YHADTHQM.js";import"./chunk-EI7MMDWY.js";export{c as clearLastResolvedResource,b as getLastResolvedResource,a as rememberLastResolvedResource};
|
package/dist/entry-82.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a as b,b as c}from"./chunk-6WCHBHFW.js";import{c as a}from"./chunk-XH5WN5XA.js";import"./chunk-GS5ZRTUG.js";import"./chunk-PS2B6THP.js";import"./chunk-DDH3FP4G.js";import"./chunk-EI7MMDWY.js";export{a as getToolCallInterception,c as registerToolCallAnnotationSink,b as registerToolCallInterceptor};
|
package/dist/entry-83.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a}from"./chunk-J34VKQGJ.js";import"./chunk-EI7MMDWY.js";export{a as isTextEditorToolRendererRegistration};
|
package/dist/entry-84.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a as d,b as a,c as s,d as m}from"./chunk-HISGZD3C.js";import"./chunk-J34VKQGJ.js";import"./chunk-YHADTHQM.js";import"./chunk-6WCHBHFW.js";import"./chunk-MXLSGMRZ.js";import"./chunk-FEZLTM4L.js";import"./chunk-STUZZM5B.js";import"./chunk-5BGWNYQS.js";import"./chunk-XH5WN5XA.js";import"./chunk-YGGKGZO2.js";import"./chunk-5S74Z6Y4.js";import"./chunk-GS5ZRTUG.js";import{f as o,g as n}from"./chunk-KN6VPARZ.js";import"./chunk-52PFWQMU.js";import"./chunk-PS2B6THP.js";import"./chunk-YPYROPQF.js";import"./chunk-PQWANILR.js";import"./chunk-BU7IZLKB.js";import"./chunk-S5PL5DFQ.js";import"./chunk-DDH3FP4G.js";import{c as r}from"./chunk-RQ7JJ7GV.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import{a as t}from"./chunk-EI7MMDWY.js";import{Type as f}from"typebox";function p(e){e.registerTool({name:"edit",label:"edit",description:"",exposure:"hidden",parameters:f.Object({},{additionalProperties:!1}),execute(){throw new Error("Hidden edit must never execute.")}})}t(p,"hideBuiltinEdit");async function g(e){r(e),n(e,[await o({id:"editing",description:"Precise standalone text and file edits",triggers:["write","replace","insert","delete","copy","move","diff"].map(c=>({tool:c}))})]);let i=await s(e);p(e),m(e,i),a(e,i),d(e,i)}t(g,"registerTextEditor");export{g as default};
|
package/dist/entry-85.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`),u={guardId:"stale-anchor",effect:"not-applied",toolName:n.toolCall.name,field:c,path:i,anchor:S(a[h]),...!(I===void 0||I.length===0)&&{context:I}},p=Y(u,r.reason),m=g.get(l)??new Map;return m.set(e,p),g.set(l,m),p}R($,"inspectAnchors");function N(t,o,n){return{annotation:{kind:"blocked",reason:n},message:{customType:"text-editor-resolver-block",content:`[SYSTEM] ${t} blocked: ${n}`,display:!1,details:{guardId:"resolver",effect:"not-applied",toolName:t,source:o,reason:n}}}}R(N,"makeResolverBlockResult");function Y(t,o){return{annotation:{kind:"stale-anchor"},message:{customType:"text-editor-stale-anchor-block",content:D(t,o),display:!1,details:t}}}R(Y,"makeBlockResult");export{V as default};
|
|
1
|
+
import{a}from"./chunk-WAJW4G4F.js";import"./chunk-XH5WN5XA.js";import"./chunk-WES2E4VR.js";import"./chunk-5S74Z6Y4.js";import"./chunk-GS5ZRTUG.js";import"./chunk-PS2B6THP.js";import"./chunk-YPYROPQF.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-86.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{b as v}from"./chunk-YHADTHQM.js";import{a as x}from"./chunk-6WCHBHFW.js";import{a as D}from"./chunk-MXLSGMRZ.js";import{a as P}from"./chunk-FEZLTM4L.js";import"./chunk-XH5WN5XA.js";import"./chunk-GS5ZRTUG.js";import"./chunk-PS2B6THP.js";import{a as _}from"./chunk-GXL4NMHR.js";import{c as O,d as b}from"./chunk-PQWANILR.js";import{a as C}from"./chunk-BU7IZLKB.js";import{a as w,b as k}from"./chunk-S5PL5DFQ.js";import{N as M}from"./chunk-DDH3FP4G.js";import"./chunk-VDJSH3DQ.js";import{a as S}from"./chunk-ZC65Z3CK.js";import{a as R}from"./chunk-EI7MMDWY.js";var E="\0",H="";async function V(t){let o,n={protocol:w,apiVersion:k,id:"text-editor-stale-anchor",setup(i){o=i}},c={protocol:O,apiVersion:b,id:"text-editor-stale-anchor",setup(i){let a=j(t,i,()=>{if(o===void 0)throw new Error("pi-agent-read is unavailable");return o});x(t,a.handler),i.onMutationTool(a.add)}};await Promise.all([C(t,n),_(t,c)])}R(V,"registerTextEditorStaleAnchor");function j(t,o,n){let c=M(t),i=new Map,a=[],f=new Map,d=new Map,g=new Map,l={name:"text-editor-stale-anchor-inspection",blockExecution:!0,toolNames:a,async intercept(e){let s=i.get(e.toolCall.name);if(s===void 0)return;let r=e.partialArgs??e.args;try{for(let u of[s.source.field,...(s.source.targets??[]).map(p=>p.field)]){let p=r[u],m=c.source(p,e.cwd);if(m!==p||typeof m=="string"&&m.startsWith("RESULT#"))return}}catch{return}let h=B(r,e,f,s.source.field,s.source.inherited?v(t)?.source:void 0);if(h===void 0)return;let A=await L(o,n(),e,s,r,h,d,g);if(A!==void 0)return A;let I=s.pair?.every(u=>{let p=s.anchors?.find(m=>m.field===u);return p!==void 0&&P(p,r[u])})===!0?new Set(s.pair):new Set;for(let u of s.anchors??[]){if(I.has(u.field))continue;let p=r[u.field];if(!P(u,p))continue;let m=r[u.sourceField],T=typeof m=="string"?m:h,y=await $(o,n(),e,u.field,T,[p],[u.kinds],d,g);if(y!==void 0)return y}},onContentEnd(e){d.delete(e),g.delete(e)},onAbort(e){d.delete(e),g.delete(e),f.delete(e)},onAgentEnd(){d.clear(),g.clear(),f.clear()}};return{handler:l,add(e){(e.anchors?.length??0)>0&&(i.set(e.name,e),a.push(e.name),x(t,l))}}}R(j,"createHandler");function B(t,o,n,c,i){let a=t[c];if(typeof a=="string")return o.contentIndex!==void 0&&n.set(o.contentIndex,a),a;if(o.contentIndex!==void 0)for(let f=o.contentIndex-1;f>=0;f-=1){let d=n.get(f);if(d!==void 0)return t[c]=d,d}return i!==void 0&&(t[c]=i),i}R(B,"resolveSource");async function L(t,o,n,c,i,a,f,d){if(c.pair===void 0)return;let[g,l]=c.pair,e=i[g],s=i[l];if(typeof e!="string"||typeof s!="string")return;let r=c.anchors?.find(({field:A})=>A===g),h=c.anchors?.find(({field:A})=>A===l);if(!(r===void 0||h===void 0)&&!(!P(r,e)||!P(h,s)))return $(t,o,n,l,a,[e,s],[r.kinds,h.kinds],f,d)}R(L,"inspectAnchorPair");async function $(t,o,n,c,i,a,f,d,g){let l=n.contentIndex??-1,e=`${i}${E}${a.join(E)}${E}${f.map(T=>T.join(H)).join(E)}`,s=g.get(l)?.get(e);if(s!==void 0)return s;let r=d.get(l)?.get(e);if(r===void 0){let T=await t.inspectTextAnchors({source:i,anchors:a,kinds:f,cwd:n.cwd,...n.signal!==void 0&&{signal:n.signal}}),y=d.get(l)??new Map;y.set(e,T),d.set(l,y),r=T}if(r.kind==="valid")return;if(r.kind==="failed")return N(n.toolCall.name,i,r.reason);if(r.rejectionCode!=="stale")return;let h=r.anchorIndex,I=(r.contextRange===void 0?void 0:await o.read({path:i,views:["anchors"],...r.contextRange},{cwd:n.cwd,...n.signal!==void 0&&{signal:n.signal}}))?.content.filter(T=>T.type==="text").map(T=>T.text).join(`
|
|
2
|
+
`),u={guardId:"stale-anchor",effect:"not-applied",toolName:n.toolCall.name,field:c,path:i,anchor:S(a[h]),...!(I===void 0||I.length===0)&&{context:I}},p=Y(u,r.reason),m=g.get(l)??new Map;return m.set(e,p),g.set(l,m),p}R($,"inspectAnchors");function N(t,o,n){return{annotation:{kind:"blocked",reason:n},message:{customType:"text-editor-resolver-block",content:`[SYSTEM] ${t} blocked: ${n}`,display:!1,details:{guardId:"resolver",effect:"not-applied",toolName:t,source:o,reason:n}}}}R(N,"makeResolverBlockResult");function Y(t,o){return{annotation:{kind:"stale-anchor"},message:{customType:"text-editor-stale-anchor-block",content:D(t,o),display:!1,details:t}}}R(Y,"makeBlockResult");export{V as default};
|
package/dist/entry-87.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h}from"./chunk-XH5WN5XA.js";import"./chunk-PS2B6THP.js";import"./chunk-EI7MMDWY.js";export{b as TOOL_CALL_INTERCEPTION_ANCHOR_RENDER_PATCH,a as TOOL_CALL_INTERCEPTION_DETAILS_KEY,f as ToolCallInterceptionRenderStore,c as getToolCallInterception,h as isToolCallAnnotation,e as withBlockedToolResult,d as withToolCallInterceptionDetails,g as withToolCallInterceptionRendering};
|
package/dist/entry-88.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-RQ7JJ7GV.js";import"./chunk-EI7MMDWY.js";export{a as OPERATION_APPROVAL_EVENT,b as OPERATION_PERMISSION_ENTRY,d as confirmOperation,e as createOperationApproval,c as registerOperationApproval};
|
package/dist/entry-89.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i}from"./chunk-PS2B6THP.js";import"./chunk-EI7MMDWY.js";export{a as ResultPanel,d as ToolCallHeader,h as preserveEnclosingBackground,g as renderToolCallDetails,f as renderToolCallHeader,i as singleLine,b as sourceRows,c as toolBackgroundAnsi,e as toolCallHeader};
|
package/dist/entry-9.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import"./chunk-K4ZMRDEI.js";
|
package/dist/entry-90.js
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
|
|
3
|
-
${i.content}`}]}}}}r(f,"createHtmlContentConverter");function E(t,n){if(n!==void 0){let o=n.split(";",1)[0]?.trim().toLowerCase()??"";if(x.has(o))return!0}let e=new TextDecoder("utf8").decode(t.subarray(0,1024));return w.test(e)}r(E,"isHtmlInput");function m(t){if(t?.aborted===!0)return t.reason instanceof Error?t.reason:C()}r(m,"cancellationError");function C(){let t=new Error("The operation was aborted");return t.name="AbortError",t}r(C,"abortError");var h={target:{provider:"web",capability:"read"},converter:f(),priority:200};async function H(t){await c(t,h)}r(H,"registerWebHtml");export{H as default};
|
|
1
|
+
import{b as a,c as b}from"./chunk-MPNE25CY.js";import"./chunk-NNCZYO4Q.js";import"./chunk-FYOU4RBH.js";import"./chunk-7PVDTMEM.js";import"./chunk-47SPPIXK.js";import"./chunk-VAXLSPPU.js";import"./chunk-MDD5ORB6.js";import"./chunk-MLFJU2US.js";import"./chunk-OMNKD7WW.js";import"./chunk-PS2B6THP.js";import"./chunk-BU7IZLKB.js";import"./chunk-S5PL5DFQ.js";import"./chunk-DDH3FP4G.js";import"./chunk-756K3LJY.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as default,b as registerWebWithOwner};
|
package/dist/entry-91.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{J as c}from"./chunk-DDH3FP4G.js";import{a as r}from"./chunk-EI7MMDWY.js";import{parseHTML as g}from"linkedom";async function d(t,n,e=p){try{let o=await e(t,n);return{content:o.content.trim(),title:o.title.trim(),usedFallback:!1}}catch{return{...b(t,n),usedFallback:!0}}}r(d,"extractReadableHtml");async function p(t,n){let e=u(t,n),{Defuddle:o}=await import("defuddle/node"),i=await o(e,n,{markdown:!0,useAsync:!1});return{content:i.content,title:i.title}}r(p,"extractWithDefuddle");function b(t,n){let e=u(t,n);for(let a of e.querySelectorAll("script, style, nav, footer, header, aside, noscript, template"))a.remove();let o=e.querySelector("article, main")??e.body??e.documentElement,i=s(o?.textContent??""),l=s(e.querySelector("title")?.textContent??"");return{content:i,title:l}}r(b,"extractPlainText");function u(t,n){let e=g(t);try{Object.defineProperty(e.document,"location",{value:new URL(n),configurable:!0})}catch{}return e.document}r(u,"parseDocument");function s(t){return t.replace(/\s+/gu," ").trim()}r(s,"normalizeWhitespace");var x=new Set(["application/xhtml+xml","text/html"]),w=/^\u{FEFF}?\s*(?:<!doctype\s+html\b|<(?:article|body|head|html)\b)/iu;function f(){return{id:"html",description:"Web page \u2014 readable page text.",async tryConvert(t,n){if(!E(t.bytes,t.mediaType))return{kind:"not-handled"};let e=m(n.signal);if(e!==void 0)return{kind:"failed",error:e};let o;try{o=new TextDecoder("utf8",{fatal:!0}).decode(t.bytes)}catch(y){return{kind:"failed",error:new TypeError(`${t.source} is not valid UTF-8 HTML`,{cause:y})}}let i=await d(o,t.source),l=m(n.signal);return l!==void 0?{kind:"failed",error:l}:{kind:"converted",content:[{type:"text",text:i.title.length===0?i.content:i.content.length===0?`# ${i.title}`:`# ${i.title}
|
|
2
|
+
|
|
3
|
+
${i.content}`}]}}}}r(f,"createHtmlContentConverter");function E(t,n){if(n!==void 0){let o=n.split(";",1)[0]?.trim().toLowerCase()??"";if(x.has(o))return!0}let e=new TextDecoder("utf8").decode(t.subarray(0,1024));return w.test(e)}r(E,"isHtmlInput");function m(t){if(t?.aborted===!0)return t.reason instanceof Error?t.reason:C()}r(m,"cancellationError");function C(){let t=new Error("The operation was aborted");return t.name="AbortError",t}r(C,"abortError");var h={target:{provider:"web",capability:"read"},converter:f(),priority:200};async function H(t){await c(t,h)}r(H,"registerWebHtml");export{H as default};
|