pi-agent-ide 0.8.4 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +77 -0
- package/README.md +24 -29
- package/dist/{chunk-CM3XGY72.js → chunk-2AY526TN.js} +1 -1
- package/dist/{chunk-LEJKDYCK.js → chunk-2TZDG2JH.js} +1 -1
- package/dist/{chunk-DUUOCBS3.js → chunk-35LZOKEW.js} +1 -1
- package/dist/chunk-3LVBARLW.js +33 -0
- package/dist/{chunk-XBQR74IK.js → chunk-4GBFIGH3.js} +1 -1
- package/dist/{chunk-PJL3UVMJ.js → chunk-4IWEKRSP.js} +1 -1
- package/dist/chunk-52PFWQMU.js +5 -0
- package/dist/chunk-5BGWNYQS.js +1 -0
- package/dist/chunk-5PC5INOL.js +1 -0
- package/dist/{chunk-QUYXINGZ.js → chunk-5S74Z6Y4.js} +3 -3
- package/dist/{chunk-XAHU42FP.js → chunk-6A3ORNW3.js} +2 -2
- package/dist/{chunk-ANM3Y5FO.js → chunk-6WCHBHFW.js} +5 -5
- package/dist/{chunk-IMGIDBCC.js → chunk-7D7PXIVV.js} +1 -1
- package/dist/chunk-7PVDTMEM.js +1 -0
- package/dist/chunk-AMIIOWFL.js +1 -0
- package/dist/{chunk-TOYN4W4F.js → chunk-B25LXXNV.js} +1 -1
- package/dist/chunk-BT2CFM7D.js +11 -0
- package/dist/chunk-C2JT2G5K.js +1 -0
- package/dist/chunk-DDH3FP4G.js +3 -0
- package/dist/{chunk-6T7PSDQW.js → chunk-DVNL5NZE.js} +1 -1
- package/dist/chunk-FEZLTM4L.js +1 -0
- package/dist/{chunk-CPELC6JE.js → chunk-FHRHYY4M.js} +1 -1
- package/dist/chunk-FXPY3V4L.js +10 -0
- package/dist/chunk-FYOU4RBH.js +2 -0
- package/dist/chunk-G4PRFO6G.js +1 -0
- package/dist/chunk-GS5ZRTUG.js +1 -0
- package/dist/{chunk-XXLLY66B.js → chunk-GXL4NMHR.js} +1 -1
- package/dist/{chunk-QT3EAHOG.js → chunk-H3GEEOOL.js} +1 -1
- package/dist/chunk-H5Z54BEU.js +25 -0
- package/dist/chunk-H7WAM5RH.js +23 -0
- package/dist/{chunk-Z2MNHSJ4.js → chunk-HGCJDIRR.js} +1 -1
- package/dist/chunk-HISGZD3C.js +81 -0
- package/dist/chunk-HKYVP2Q6.js +3 -0
- package/dist/chunk-HRBUY2FF.js +4 -0
- package/dist/chunk-IG5DXVDJ.js +1 -0
- package/dist/chunk-IOGWZNWT.js +1 -0
- package/dist/chunk-IUJUECXH.js +9 -0
- package/dist/chunk-KN6VPARZ.js +1 -0
- package/dist/{chunk-RW2GTYQI.js → chunk-LF325WYO.js} +1 -1
- package/dist/chunk-LXDF2NWX.js +1 -0
- package/dist/{chunk-YJ6T3PEP.js → chunk-MDD5ORB6.js} +1 -1
- package/dist/{chunk-S72FVLUX.js → chunk-MLFJU2US.js} +1 -1
- package/dist/chunk-MPNE25CY.js +5 -0
- package/dist/chunk-NA2NEU4V.js +1 -0
- package/dist/{chunk-ZJQRLVVV.js → chunk-O7V6G3OO.js} +1 -1
- package/dist/chunk-OBTT5INC.js +6 -0
- package/dist/{chunk-IICJXZBU.js → chunk-OMNKD7WW.js} +3 -3
- package/dist/chunk-OUCVZBOR.js +28 -0
- package/dist/chunk-PCGBM2D6.js +17 -0
- package/dist/{chunk-235QMMVA.js → chunk-PQWANILR.js} +1 -1
- package/dist/{chunk-QRJLIV6P.js → chunk-QJ6V5IAY.js} +6 -6
- package/dist/{chunk-SMIFCAAX.js → chunk-RIJRPAL2.js} +1 -1
- package/dist/chunk-RIOPUTUJ.js +6 -0
- package/dist/{chunk-RMI3NMQY.js → chunk-RIZARTUM.js} +2 -2
- package/dist/{chunk-NJ7C4KMA.js → chunk-SRFWT562.js} +1 -1
- package/dist/{chunk-U22JNO6N.js → chunk-STUZZM5B.js} +1 -1
- package/dist/chunk-T3Z4KXOX.js +2 -0
- package/dist/chunk-TSQ6FBTB.js +1 -0
- package/dist/chunk-U7YDLVFL.js +1 -0
- package/dist/{chunk-KZC7TI5M.js → chunk-UD3DMY3Q.js} +1 -1
- package/dist/{chunk-VXP5BMW7.js → chunk-USG6WHAT.js} +1 -1
- package/dist/{chunk-ZPT5D4VP.js → chunk-VDJSH3DQ.js} +2 -2
- package/dist/{chunk-VMTOFEXF.js → chunk-VMLPXSMK.js} +1 -1
- package/dist/chunk-VNWGT367.js +1 -0
- package/dist/chunk-WAJW4G4F.js +22 -0
- package/dist/chunk-WEE3NM6L.js +1 -0
- package/dist/{chunk-IM24DB3K.js → chunk-WES2E4VR.js} +1 -1
- package/dist/{chunk-RIJMXO43.js → chunk-WQIMM4SU.js} +1 -1
- package/dist/chunk-X2WFNMQR.js +9 -0
- package/dist/chunk-XCPIIDFS.js +4 -0
- package/dist/chunk-XE4W5YTE.js +2 -0
- package/dist/chunk-XUYIK4TX.js +1 -0
- package/dist/{chunk-AAC77UD4.js → chunk-YPYROPQF.js} +1 -1
- package/dist/chunk-ZXO4D5UB.js +1 -0
- package/dist/entry-0.js +1 -1
- package/dist/entry-1.js +1 -1
- package/dist/entry-10.js +1 -1
- package/dist/entry-11.js +1 -1
- package/dist/entry-12.js +1 -1
- package/dist/entry-13.js +1 -1
- package/dist/entry-14.js +1 -1
- package/dist/entry-15.js +1 -1
- package/dist/entry-16.js +1 -1
- package/dist/entry-17.js +1 -1
- package/dist/entry-18.js +1 -1
- package/dist/entry-19.js +1 -1
- package/dist/entry-2.js +1 -1
- package/dist/entry-20.js +1 -1
- package/dist/entry-21.js +1 -0
- package/dist/entry-22.js +1 -1
- package/dist/entry-24.js +1 -1
- package/dist/entry-25.js +1 -1
- package/dist/entry-26.js +1 -1
- package/dist/entry-27.js +1 -1
- package/dist/entry-28.js +1 -1
- package/dist/entry-29.js +1 -2
- package/dist/entry-3.js +1 -1
- package/dist/entry-30.js +1 -1
- package/dist/entry-31.js +2 -4
- package/dist/entry-32.js +1 -1
- package/dist/entry-33.js +1 -1
- package/dist/entry-34.js +1 -1
- package/dist/entry-35.js +1 -18
- package/dist/entry-36.js +1 -1
- package/dist/entry-37.js +1 -1
- package/dist/entry-38.js +15 -1
- package/dist/entry-39.js +1 -1
- package/dist/entry-4.js +1 -1
- package/dist/entry-40.js +1 -1
- package/dist/entry-41.js +1 -1
- package/dist/entry-42.js +1 -1
- package/dist/entry-43.js +1 -1
- package/dist/entry-44.js +1 -1
- package/dist/entry-45.js +1 -1
- package/dist/entry-46.js +1 -1
- package/dist/entry-47.js +1 -1
- package/dist/entry-48.js +1 -1
- package/dist/entry-49.js +1 -25
- package/dist/entry-5.js +1 -1
- package/dist/entry-50.js +1 -1
- package/dist/entry-51.js +1 -1
- package/dist/entry-52.js +1 -1
- package/dist/entry-53.js +1 -1
- package/dist/entry-54.js +1 -3
- package/dist/entry-55.js +1 -13
- package/dist/entry-56.js +1 -1
- package/dist/entry-57.js +1 -1
- package/dist/entry-58.js +1 -1
- package/dist/entry-59.js +1 -1
- package/dist/entry-6.js +1 -1
- package/dist/entry-60.js +1 -1
- package/dist/entry-61.js +1 -1
- package/dist/entry-62.js +1 -1
- package/dist/entry-63.js +1 -1
- package/dist/entry-64.js +1 -1
- package/dist/entry-65.js +1 -0
- package/dist/entry-66.js +1 -1
- package/dist/entry-67.js +1 -0
- package/dist/entry-68.js +0 -1
- package/dist/entry-69.js +1 -1
- package/dist/entry-7.js +1 -1
- package/dist/entry-70.js +0 -1
- package/dist/entry-71.js +1 -1
- package/dist/entry-72.js +1 -1
- package/dist/entry-73.js +1 -1
- package/dist/entry-74.js +1 -1
- package/dist/entry-75.js +1 -0
- package/dist/entry-76.js +1 -1
- package/dist/entry-77.js +1 -0
- package/dist/entry-78.js +0 -1
- package/dist/entry-79.js +1 -1
- package/dist/entry-8.js +1 -1
- package/dist/entry-80.js +0 -1
- package/dist/entry-81.js +1 -80
- package/dist/entry-82.js +1 -22
- package/dist/entry-83.js +1 -2
- package/dist/entry-84.js +1 -1
- package/dist/entry-85.js +1 -1
- package/dist/entry-86.js +2 -1
- package/dist/entry-87.js +1 -1
- package/dist/entry-88.js +1 -3
- package/dist/entry-89.js +1 -1
- package/dist/entry-9.js +1 -1
- package/dist/entry-90.js +1 -1
- package/dist/entry-91.js +3 -1
- package/dist/entry-92.js +1 -0
- package/dist/entry-93.js +1 -0
- package/dist/entry-94.js +1 -0
- package/dist/pi-agent-ide.js +13 -34
- package/docs/agent-guides/ast-search.md +58 -0
- package/docs/agent-guides/debugger.md +1 -1
- package/docs/agent-guides/editing.md +29 -58
- package/docs/agent-guides/git-changes.md +4 -14
- package/docs/agent-guides/search.md +38 -0
- package/docs/agent-guides/ssh.md +17 -49
- package/docs/agent-guides/terminal.md +9 -15
- package/docs/configuration.md +9 -13
- package/docs/extensions.md +82 -0
- package/docs/settings-help.md +2 -2
- package/docs/structured-results.md +33 -11
- package/docs/tools.md +24 -23
- package/node_modules/pi-agent-doctor/package.json +7 -7
- package/node_modules/pi-agent-doctor/runtime/entry-29.js +1 -0
- package/node_modules/pi-agent-doctor/src/workspace.ts +0 -5
- package/node_modules/pi-agent-documentation/package.json +2 -2
- package/node_modules/pi-agent-documentation/runtime/entry-30.js +1 -0
- package/node_modules/pi-agent-documentation/src/index.ts +26 -10
- package/node_modules/pi-agent-filesystem/index.ts +1 -1
- package/node_modules/pi-agent-filesystem/package.json +8 -8
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- package/node_modules/pi-agent-filesystem-jq/index.ts +9 -63
- package/node_modules/pi-agent-filesystem-jq/package.json +12 -6
- package/node_modules/pi-agent-filesystem-jq/runtime/entry-33.js +1 -0
- package/node_modules/pi-agent-filesystem-jq/runtime/entry-34.js +2 -0
- package/node_modules/pi-agent-filesystem-jq/src/api/jq.ts +112 -0
- package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/runtime/entry-36.js +2 -0
- package/node_modules/pi-agent-ide-ast/package.json +15 -15
- package/node_modules/pi-agent-ide-ast/runtime/entry-37.js +1 -0
- package/node_modules/pi-agent-ide-ast/src/extension.ts +8 -8
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +104 -26
- package/node_modules/pi-agent-ide-ast/src/tool-ast-search.ts +210 -0
- package/node_modules/pi-agent-ide-changes/index.ts +1 -2
- package/node_modules/pi-agent-ide-changes/package.json +10 -10
- package/node_modules/pi-agent-ide-changes/runtime/entry-39.js +1 -0
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +3 -3
- package/node_modules/pi-agent-ide-formatter/package.json +4 -4
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-languages/runtime/entry-42.js +2 -0
- package/node_modules/pi-agent-ide-lint/package.json +8 -8
- package/node_modules/pi-agent-ide-lint/runtime/entry-43.js +2 -0
- package/node_modules/pi-agent-ide-lsp/index.ts +22 -28
- package/node_modules/pi-agent-ide-lsp/package.json +14 -10
- package/node_modules/pi-agent-ide-lsp/runtime/entry-44.js +2 -0
- package/node_modules/pi-agent-ide-lsp/src/declaration-targets.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/src/lsp/code-views.ts +8 -84
- package/node_modules/pi-agent-ide-lsp/src/lsp/index.ts +1 -6
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +11 -11
- package/node_modules/pi-agent-ide-lsp/src/manager-provider.ts +8 -0
- package/node_modules/pi-agent-ide-lsp/src/rename-plan.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +234 -36
- package/node_modules/pi-agent-ide-lsp/src/tool-lsp-search.ts +212 -0
- package/node_modules/pi-agent-image/package.json +3 -3
- package/node_modules/pi-agent-image/src/image-converter.ts +24 -1
- package/node_modules/pi-agent-invariant/package.json +2 -2
- package/node_modules/pi-agent-pdf/package.json +3 -3
- package/node_modules/pi-agent-pdf/src/pdf-converter.ts +23 -1
- package/node_modules/pi-agent-read/package.json +12 -12
- package/node_modules/pi-agent-read/runtime/entry-49.js +0 -1
- package/node_modules/pi-agent-read/runtime/entry-52.js +2 -0
- package/node_modules/pi-agent-read/src/api/read-parameters.ts +4 -7
- package/node_modules/pi-agent-read/src/api/tools/read.ts +2 -0
- package/node_modules/pi-agent-read/src/core/extension.ts +0 -8
- package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +47 -14
- package/node_modules/pi-agent-read/src/core/tools/read/result-target.ts +3 -1
- package/node_modules/pi-agent-read/src/core/tools/read/structured-result.ts +14 -2
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +21 -8
- package/node_modules/pi-agent-resource/package.json +2 -2
- package/node_modules/pi-agent-resource/src/index.ts +8 -0
- package/node_modules/pi-agent-resource/src/resource-error-metadata.ts +89 -0
- package/node_modules/pi-agent-resource/src/resource-error.ts +6 -1
- package/node_modules/pi-agent-resource/src/result-images.ts +87 -0
- package/node_modules/pi-agent-resource/src/result-targets.ts +9 -3
- package/node_modules/pi-agent-resource/src/tool-result.ts +17 -0
- package/node_modules/pi-agent-search/package.json +9 -9
- package/node_modules/pi-agent-search/runtime/entry-54.js +0 -1
- package/node_modules/pi-agent-search/runtime/entry-55.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-57.js +2 -0
- package/node_modules/pi-agent-search/src/api/glob-list.ts +35 -0
- package/node_modules/pi-agent-search/src/api/search-parameters.ts +8 -8
- package/node_modules/pi-agent-search/src/api/search.ts +14 -2
- package/node_modules/pi-agent-search/src/core/extension.ts +11 -20
- package/node_modules/pi-agent-search/src/core/search-core.ts +30 -10
- package/node_modules/pi-agent-search-text/index.ts +34 -12
- package/node_modules/pi-agent-search-text/package.json +17 -15
- package/node_modules/pi-agent-search-text/runtime/entry-58.js +1 -0
- package/node_modules/pi-agent-search-text/runtime/entry-60.js +1 -0
- package/node_modules/pi-agent-search-text/src/file-search.ts +59 -25
- package/node_modules/pi-agent-search-text/src/resolvers.ts +61 -16
- package/node_modules/pi-agent-search-text/src/scoped-search.ts +9 -3
- package/node_modules/pi-agent-search-text/src/search-backend.ts +44 -48
- package/node_modules/pi-agent-search-text/src/search-presentation.ts +19 -15
- package/node_modules/pi-agent-search-text/src/search-recipe.ts +2 -1
- package/node_modules/pi-agent-search-text/src/search-result.ts +6 -2
- package/node_modules/pi-agent-search-text/src/search-session.ts +1 -0
- package/node_modules/pi-agent-search-text/src/tool-file-search.ts +146 -0
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text/runtime/entry-62.js +1 -0
- package/node_modules/pi-agent-text/src/text-converter.ts +1 -1
- package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-63.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/package.json +5 -5
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-64.js +1 -0
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-65.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/src/anchor.ts +6 -1
- package/node_modules/pi-agent-text-anchor-line-hash/index.ts +1 -2
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-67.js +2 -0
- package/node_modules/pi-agent-text-editor/package.json +26 -26
- package/node_modules/pi-agent-text-editor/runtime/entry-81.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-82.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-83.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-84.js +2 -0
- package/node_modules/pi-agent-text-editor/src/api/edit-pipeline.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +23 -0
- package/node_modules/pi-agent-text-editor/src/api/text-selection-anchor.ts +31 -1
- package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +11 -21
- package/node_modules/pi-agent-text-editor/src/core/editing-guidelines.ts +5 -5
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +13 -7
- package/node_modules/pi-agent-text-editor/src/core/file-operation-guards.ts +22 -4
- package/node_modules/pi-agent-text-editor/src/core/image-write.ts +111 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +3 -0
- package/node_modules/pi-agent-text-editor/src/core/result-transfer.ts +2 -6
- package/node_modules/pi-agent-text-editor/src/core/structured-result.ts +5 -1
- package/node_modules/pi-agent-text-editor/src/core/text-change-engine.ts +17 -36
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +8 -2
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +103 -20
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +146 -62
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +14 -19
- package/node_modules/pi-agent-text-editor/src/tools/text-selection.ts +63 -74
- package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +5 -5
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +7 -10
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +4 -10
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +8 -8
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +5 -8
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +3 -4
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +37 -22
- package/node_modules/pi-agent-text-editor-renderer/index.ts +6 -1
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-85.js +2 -0
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +18 -5
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +6 -6
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-86.js +2 -0
- package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-87.js +1 -0
- package/node_modules/pi-agent-tool-ui/package.json +3 -3
- package/node_modules/pi-agent-tool-ui/runtime/entry-88.js +1 -0
- package/node_modules/pi-agent-tool-ui/runtime/entry-89.js +1 -0
- package/node_modules/pi-agent-web/index.ts +28 -6
- package/node_modules/pi-agent-web/package.json +8 -8
- package/node_modules/pi-agent-web-html/package.json +3 -3
- package/node_modules/pi-agent-web-html/src/html-converter.ts +1 -1
- package/node_modules/pi-agent-web-image/package.json +4 -4
- package/node_modules/pi-agent-web-image/runtime/entry-92.js +2 -0
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/runtime/entry-93.js +2 -0
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-94.js +2 -0
- package/package.json +65 -58
- package/src/api/approval.ts +2 -0
- package/src/api/capabilities.ts +60 -0
- package/src/api/read.ts +2 -0
- package/src/api/standalone.ts +7 -0
- package/src/backend/doctor-workspace.ts +0 -3
- package/src/backend/process-metadata-worker.py +9 -18
- package/src/backend/process-metadata.ts +11 -44
- package/src/backend/registration.ts +0 -10
- package/src/backend/web-browser-worker.mjs +2 -17
- package/src/backend/web-browser.ts +1 -26
- package/src/composite/builtin-extensions.ts +8 -6
- package/src/composite/capabilities.ts +252 -0
- package/src/composite/capability-schemas.ts +53 -0
- package/src/composite/ide-alias-rendering.ts +18 -2
- package/src/composite/module-labels.ts +0 -4
- package/src/composite/preferences.ts +0 -36
- package/src/composite/responses-tools.ts +27 -9
- package/src/composite/settings-documentation.ts +1 -2
- package/src/composite/text-results.ts +61 -23
- package/src/composite/tool-availability.ts +28 -13
- package/src/documentation/extension.ts +39 -15
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +1 -1
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +8 -8
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/index.ts +9 -63
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +12 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-33.js +1 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-34.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/src/api/jq.ts +112 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-35.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-36.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-31.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +28 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -8
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/src/html-converter.ts +1 -1
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-92.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-93.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-94.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-90.js +2 -0
- package/src/extensions/pi-agent-read/package.json +12 -12
- package/src/extensions/pi-agent-read/runtime/entry-49.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-50.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-52.js +2 -0
- package/src/extensions/pi-agent-read/src/api/read-parameters.ts +4 -7
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +2 -0
- package/src/extensions/pi-agent-read/src/core/extension.ts +0 -8
- package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +47 -14
- package/src/extensions/pi-agent-read/src/core/tools/read/result-target.ts +3 -1
- package/src/extensions/pi-agent-read/src/core/tools/read/structured-result.ts +14 -2
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +21 -8
- package/src/extensions/pi-agent-search/package.json +9 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +34 -12
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +17 -15
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-58.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-59.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-60.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/file-search.ts +59 -25
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +61 -16
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/scoped-search.ts +9 -3
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +44 -48
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-presentation.ts +19 -15
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +2 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +6 -2
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/tool-file-search.ts +146 -0
- package/src/extensions/pi-agent-search/runtime/entry-54.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-55.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-56.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-57.js +2 -0
- package/src/extensions/pi-agent-search/src/api/glob-list.ts +35 -0
- package/src/extensions/pi-agent-search/src/api/search-parameters.ts +8 -8
- package/src/extensions/pi-agent-search/src/api/search.ts +14 -2
- package/src/extensions/pi-agent-search/src/core/extension.ts +11 -20
- package/src/extensions/pi-agent-search/src/core/search-core.ts +30 -10
- package/src/extensions/pi-agent-text-editor/package.json +26 -26
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-63.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-64.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-65.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/anchor.ts +6 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +1 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-66.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-67.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +6 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-85.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +18 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +6 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-86.js +2 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-81.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-82.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-83.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-84.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/edit-pipeline.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +23 -0
- package/src/extensions/pi-agent-text-editor/src/api/text-selection-anchor.ts +31 -1
- package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +11 -21
- package/src/extensions/pi-agent-text-editor/src/core/editing-guidelines.ts +5 -5
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +13 -7
- package/src/extensions/pi-agent-text-editor/src/core/file-operation-guards.ts +22 -4
- package/src/extensions/pi-agent-text-editor/src/core/image-write.ts +111 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +3 -0
- package/src/extensions/pi-agent-text-editor/src/core/result-transfer.ts +2 -6
- package/src/extensions/pi-agent-text-editor/src/core/structured-result.ts +5 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-change-engine.ts +17 -36
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +8 -2
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +103 -20
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +146 -62
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +14 -19
- package/src/extensions/pi-agent-text-editor/src/tools/text-selection.ts +63 -74
- package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +5 -5
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +7 -10
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +4 -10
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +8 -8
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +5 -8
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +3 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +37 -22
- package/src/pi-agent-ide.ts +12 -16
- package/src/plugins/pi-agent-ide-ast/package.json +15 -15
- package/src/plugins/pi-agent-ide-ast/runtime/entry-37.js +1 -0
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +8 -8
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +104 -26
- package/src/plugins/pi-agent-ide-ast/src/tool-ast-search.ts +210 -0
- package/src/plugins/pi-agent-ide-changes/index.ts +1 -2
- package/src/plugins/pi-agent-ide-changes/package.json +10 -10
- package/src/plugins/pi-agent-ide-changes/runtime/entry-39.js +1 -0
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +3 -3
- package/src/plugins/pi-agent-ide-debugger/index.ts +31 -13
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +2 -11
- package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-languages/runtime/entry-42.js +2 -0
- package/src/plugins/pi-agent-ide-lint/package.json +8 -8
- package/src/plugins/pi-agent-ide-lint/runtime/entry-43.js +2 -0
- package/src/plugins/pi-agent-ide-lsp/index.ts +22 -28
- package/src/plugins/pi-agent-ide-lsp/package.json +14 -10
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-44.js +2 -0
- package/src/plugins/pi-agent-ide-lsp/src/declaration-targets.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/src/lsp/code-views.ts +8 -84
- package/src/plugins/pi-agent-ide-lsp/src/lsp/index.ts +1 -6
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +11 -11
- package/src/plugins/pi-agent-ide-lsp/src/manager-provider.ts +8 -0
- package/src/plugins/pi-agent-ide-lsp/src/rename-plan.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +234 -36
- package/src/plugins/pi-agent-ide-lsp/src/tool-lsp-search.ts +212 -0
- package/src/plugins/pi-agent-ide-processes/src/ui.ts +61 -16
- package/src/plugins/pi-agent-ide-terminal/index.ts +43 -1
- package/src/plugins/pi-agent-ide-terminal/src/resources.ts +0 -18
- package/src/plugins/pi-agent-ide-terminal/src/search.ts +0 -3
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +1 -3
- package/src/standalone/resource-host.ts +147 -0
- package/src/standalone/scoped-api.ts +457 -0
- package/dist/chunk-2RTCSZB3.js +0 -1
- package/dist/chunk-4DIUPEDF.js +0 -2
- package/dist/chunk-6EDOLYOV.js +0 -1
- package/dist/chunk-6FGLAVPJ.js +0 -1
- package/dist/chunk-6H32W35W.js +0 -1
- package/dist/chunk-6OJ565FL.js +0 -2
- package/dist/chunk-6R3Y4AD3.js +0 -1
- package/dist/chunk-6TJPMBUQ.js +0 -1
- package/dist/chunk-6XFUICD7.js +0 -1
- package/dist/chunk-BHSO2MDK.js +0 -6
- package/dist/chunk-GBUJOR6V.js +0 -28
- package/dist/chunk-GSOYVIQS.js +0 -1
- package/dist/chunk-HSRH76JN.js +0 -3
- package/dist/chunk-HSZ4AQ6L.js +0 -9
- package/dist/chunk-I6NPILT5.js +0 -1
- package/dist/chunk-K7SRNBIV.js +0 -1
- package/dist/chunk-LCWBVOII.js +0 -3
- package/dist/chunk-MKEC3U2M.js +0 -4
- package/dist/chunk-NUM3YQGK.js +0 -1
- package/dist/chunk-OM4LYD3S.js +0 -1
- package/dist/chunk-PLKYHUNT.js +0 -1
- package/dist/chunk-PT35ZFLH.js +0 -33
- package/dist/chunk-QIJMV2P2.js +0 -2
- package/dist/chunk-RVU73VKN.js +0 -2
- package/dist/chunk-SDAH3ECM.js +0 -5
- package/dist/chunk-SGQWRIRJ.js +0 -10
- package/dist/chunk-SWBJS3U4.js +0 -1
- package/dist/chunk-T7I2VX3J.js +0 -1
- package/dist/chunk-T7MWQQIF.js +0 -3
- package/dist/chunk-VDP5CQHM.js +0 -3
- package/dist/chunk-XG7QNAKW.js +0 -9
- package/dist/chunk-XLWCSJMR.js +0 -1
- package/dist/chunk-YFP4P2FV.js +0 -1
- package/dist/chunk-YIXP2ALP.js +0 -9
- package/dist/entry-23.js +0 -1
- package/docs/agent-guides/diagnostics.md +0 -5
- package/docs/agent-guides/json-reading.md +0 -57
- package/docs/agent-guides/read-resources.md +0 -17
- package/docs/agent-guides/search-code.md +0 -76
- package/docs/agent-guides/select-code.md +0 -119
- package/docs/agent-guides/vision.md +0 -11
- package/node_modules/pi-agent-doctor/runtime/entry-22.js +0 -1
- package/node_modules/pi-agent-doctor/runtime/entry-23.js +0 -1
- package/node_modules/pi-agent-filesystem/runtime/entry-29.js +0 -2
- package/node_modules/pi-agent-filesystem-image/runtime/entry-30.js +0 -2
- package/node_modules/pi-agent-filesystem-text/runtime/entry-33.js +0 -2
- package/node_modules/pi-agent-ide-ast/runtime/entry-34.js +0 -1
- package/node_modules/pi-agent-ide-ast/src/ast/constructs.ts +0 -193
- package/node_modules/pi-agent-ide-ast/src/ast/element-extent.ts +0 -59
- package/node_modules/pi-agent-ide-ast/src/ast/selection.ts +0 -204
- package/node_modules/pi-agent-ide-ast/src/geometry-selection.ts +0 -184
- package/node_modules/pi-agent-ide-ast/src/select-presentation.ts +0 -105
- package/node_modules/pi-agent-ide-ast/src/select-schema.ts +0 -387
- package/node_modules/pi-agent-ide-ast/src/selection-region.ts +0 -41
- package/node_modules/pi-agent-ide-ast/src/source-text.ts +0 -92
- package/node_modules/pi-agent-ide-ast/src/text-selection.ts +0 -214
- package/node_modules/pi-agent-ide-ast/src/tool-select.ts +0 -277
- package/node_modules/pi-agent-ide-changes/runtime/entry-36.js +0 -1
- package/node_modules/pi-agent-ide-changes/runtime/entry-37.js +0 -2
- package/node_modules/pi-agent-ide-languages/runtime/entry-39.js +0 -2
- package/node_modules/pi-agent-ide-lsp/src/code-view-resolvers.ts +0 -136
- package/node_modules/pi-agent-image/runtime/entry-42.js +0 -1
- package/node_modules/pi-agent-invariant/runtime/entry-43.js +0 -1
- package/node_modules/pi-agent-pdf/runtime/entry-44.js +0 -1
- package/node_modules/pi-agent-search/runtime/entry-52.js +0 -1
- package/node_modules/pi-agent-search-text/runtime/entry-55.js +0 -2
- package/node_modules/pi-agent-search-text/runtime/entry-57.js +0 -1
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-60.js +0 -2
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-62.js +0 -2
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-63.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-64.js +0 -2
- package/node_modules/pi-agent-text-editor/runtime/entry-65.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-67.js +0 -1
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-82.js +0 -2
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-83.js +0 -2
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-84.js +0 -1
- package/node_modules/pi-agent-tool-ui/runtime/entry-85.js +0 -1
- package/node_modules/pi-agent-tool-ui/runtime/entry-86.js +0 -1
- package/node_modules/pi-agent-web/runtime/entry-87.js +0 -2
- package/node_modules/pi-agent-web-html/runtime/entry-88.js +0 -2
- package/node_modules/pi-agent-web-image/runtime/entry-89.js +0 -2
- package/src/backend/vision-capture-worker.py +0 -319
- package/src/backend/vision-capture.ts +0 -165
- package/src/backend/vision-registration.ts +0 -104
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-30.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-31.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-33.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-29.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-88.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-89.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-90.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-87.js +0 -2
- package/src/extensions/pi-agent-read/runtime/entry-45.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-46.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-47.js +0 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-55.js +0 -2
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-56.js +0 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-57.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-52.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-53.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-60.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-62.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-63.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-64.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-82.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-83.js +0 -2
- package/src/extensions/pi-agent-text-editor/runtime/entry-65.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-66.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-67.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-34.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-35.js +0 -2
- package/src/plugins/pi-agent-ide-ast/src/ast/constructs.ts +0 -193
- package/src/plugins/pi-agent-ide-ast/src/ast/element-extent.ts +0 -59
- package/src/plugins/pi-agent-ide-ast/src/ast/selection.ts +0 -204
- package/src/plugins/pi-agent-ide-ast/src/geometry-selection.ts +0 -184
- package/src/plugins/pi-agent-ide-ast/src/select-presentation.ts +0 -105
- package/src/plugins/pi-agent-ide-ast/src/select-schema.ts +0 -387
- package/src/plugins/pi-agent-ide-ast/src/selection-region.ts +0 -41
- package/src/plugins/pi-agent-ide-ast/src/source-text.ts +0 -92
- package/src/plugins/pi-agent-ide-ast/src/text-selection.ts +0 -214
- package/src/plugins/pi-agent-ide-ast/src/tool-select.ts +0 -277
- package/src/plugins/pi-agent-ide-changes/runtime/entry-36.js +0 -1
- package/src/plugins/pi-agent-ide-changes/runtime/entry-37.js +0 -2
- package/src/plugins/pi-agent-ide-languages/runtime/entry-39.js +0 -2
- package/src/plugins/pi-agent-ide-lsp/src/code-view-resolvers.ts +0 -136
- package/src/plugins/pi-agent-ide-vision/index.ts +0 -439
- package/src/plugins/pi-agent-ide-vision/src/doctor-plugin.ts +0 -47
- package/src/plugins/pi-agent-ide-vision/src/vision.ts +0 -585
- package/src/plugins/pi-agent-ide-vision/src/windows-display-capture.ps1 +0 -30
- package/src/plugins/pi-agent-ide-vision/src/windows-window-capture.ps1 +0 -33
- /package/dist/{chunk-U2JKHKLK.js → chunk-3PMHFEJY.js} +0 -0
- /package/node_modules/{pi-agent-documentation → pi-agent-doctor}/runtime/entry-28.js +0 -0
- /package/node_modules/{pi-agent-filesystem-jq → pi-agent-filesystem}/runtime/entry-31.js +0 -0
- /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-32.js +0 -0
- /package/node_modules/{pi-agent-ide-ast → pi-agent-filesystem-pdf}/runtime/entry-35.js +0 -0
- /package/node_modules/{pi-agent-ide-formatter → pi-agent-ide-ast}/runtime/entry-38.js +0 -0
- /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-changes}/runtime/entry-40.js +0 -0
- /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-formatter}/runtime/entry-41.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-image}/runtime/entry-45.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-invariant}/runtime/entry-46.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-47.js +0 -0
- /package/node_modules/{pi-agent-resource → pi-agent-read}/runtime/entry-50.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-read}/runtime/entry-51.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-53.js +0 -0
- /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-56.js +0 -0
- /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-59.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-exact → pi-agent-search-text}/runtime/entry-61.js +0 -0
- /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-line-hash}/runtime/entry-66.js +0 -0
- /package/node_modules/{pi-agent-web-pdf → pi-agent-web}/runtime/entry-90.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web-html}/runtime/entry-91.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-32.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-html}/runtime/entry-91.js +0 -0
- /package/src/extensions/{pi-agent-search → pi-agent-read}/runtime/entry-51.js +0 -0
- /package/src/extensions/{pi-agent-text-editor/plugins/pi-agent-text-anchor-exact → pi-agent-search/plugins/pi-agent-search-text}/runtime/entry-61.js +0 -0
- /package/src/plugins/{pi-agent-ide-formatter → pi-agent-ide-ast}/runtime/entry-38.js +0 -0
- /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-changes}/runtime/entry-40.js +0 -0
- /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-formatter}/runtime/entry-41.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as C}from"./chunk-
|
|
1
|
+
import{b as C}from"./chunk-5S74Z6Y4.js";import{a as b}from"./chunk-ZC65Z3CK.js";import{a as m}from"./chunk-EI7MMDWY.js";import{diffChars as j}from"diff";import{DefaultLinesDiffComputer as J}from"vscode-diff";var N=2,P=.5,S=100,Q=16e3,H=1e6,Z=new J,ee=new Set(["async","boolean","const","export","false","function","interface","let","new","null","number","private","protected","public","readonly","return","static","string","true","type","undefined","var"]);function E(e,n,t=[],r={}){let o=ne(e,n,(r.beforeLineOffset??0)+1,(r.afterLineOffset??0)+1);if(o===void 0)return{rows:[],added:0,modified:0,removed:0,focusRow:0,omittedChanges:{outside:0,ambiguous:0,unavailable:!0}};let i=r.project===!1?o:oe(o),f=r.focusAfterLine??(t.length===0?void 0:fe(n,b(t.at(-1)).to)+(r.afterLineOffset??0));return{rows:i,added:o.filter(({kind:d})=>d==="added").length,modified:o.filter(({kind:d})=>d==="modified").length,removed:o.filter(({kind:d})=>d==="removed").length,focusRow:se(i,f)}}m(E,"createDiffModel");function ne(e,n,t=1,r=1){if(e.length+n.length>H)return;let o=performance.now()+S,i=W(e),f=W(n),d=[];if(i.length===0||f.length===0)return[...i.map((u,y)=>({kind:"removed",text:u,beforeLine:t+y,changed:!0})),...f.map((u,y)=>({kind:"added",text:u,afterLine:r+y,changed:!0}))];let a=new Set(i.map(u=>u.trim())),c=f.some(u=>a.has(u.trim()))?Z.computeDiff([...i],[...f],{ignoreTrimWhitespace:!0,computeMoves:!1,maxComputationTimeMs:S}):{hitTimeout:!1,changes:[{original:{startLineNumber:1,endLineNumberExclusive:i.length+1},modified:{startLineNumber:1,endLineNumberExclusive:f.length+1}}]};if(c.hitTimeout||performance.now()>=o)return;let g=0,s=0,h=m(u=>{for(;s<u;)d.push({kind:"context",text:b(f[s]),beforeLine:t+g++,afterLine:r+s++,changed:!1})},"appendContext");for(let u of c.changes){h(u.modified.startLineNumber-1);let y=i.slice(u.original.startLineNumber-1,u.original.endLineNumberExclusive-1).map((x,R)=>({text:x,line:t+g+R})),w=f.slice(u.modified.startLineNumber-1,u.modified.endLineNumberExclusive-1).map((x,R)=>({text:x,line:r+s+R})),D=te(y,w,o);d.push(...D??[...y.map(({text:x,line:R})=>({kind:"removed",text:x,beforeLine:R,changed:!0})),...w.map(({text:x,line:R})=>({kind:"added",text:x,afterLine:R,changed:!0}))]),g+=y.length,s+=w.length}if(h(f.length),e.endsWith(`
|
|
2
2
|
`)!==n.endsWith(`
|
|
3
3
|
`)){let u=d.at(-1);u?.kind==="context"&&(d[d.length-1]={...u,kind:"modified",changed:!0,addedRanges:[],deletedOffsets:e.endsWith(`
|
|
4
4
|
`)?[u.text.length]:[]})}return d}m(ne,"createSemanticRows");function T(e,n,t){let r=e[n]?.[t];if(r===void 0)throw new RangeError(`Score [${n}, ${t}] is outside the alignment matrix.`);return r}m(T,"scoreAt");function te(e,n,t){let r=new Map,o=m((c,g)=>{if(performance.now()>=t)return;let s=r.get(c)?.get(g);if(s!==void 0)return s;let h=ie(c,g,t);if(h!==void 0){let u=r.get(c);u===void 0&&(u=new Map,r.set(c,u)),u.set(g,h)}return h},"compareCharacters");if(e.length>1&&e.length===n.length){let c=[];for(let[g,s]of e.entries()){let h=b(n[g]),u=z(s.text,h.text,o);if(u===void 0)return;if(u<P)break;let y=_(s,h,t);if(y===void 0)return;c.push(y)}if(c.length===e.length)return c}if(e.length===1&&n.length===1){let c=_(b(e[0]),b(n[0]),t);return c===void 0?void 0:[c]}if(e.length*n.length>Q)return;let i=Array.from({length:e.length},()=>Array(n.length).fill(0)),f=Array.from({length:e.length+1},()=>Array.from({length:n.length+1}).fill(0));for(let c=1;c<=e.length;c++)for(let g=1;g<=n.length;g++){let s=z(b(e[c-1]).text,b(n[g-1]).text,o);if(s===void 0)return;b(i[c-1])[g-1]=s;let h=s>=P?T(f,c-1,g-1)+s:Number.NEGATIVE_INFINITY;b(f[c])[g]=Math.max(T(f,c-1,g),T(f,c,g-1),h)}let d=[],a=e.length,l=n.length;for(;a>0||l>0;){let c=a>0&&l>0?T(i,a-1,l-1):0;if((a>0&&l>0&&c>=P?T(f,a-1,l-1)+c:Number.NEGATIVE_INFINITY)===T(f,a,l)){let s=_(b(e[a-1]),b(n[l-1]),t);if(s===void 0)return;d.push(s),a--,l--}else if(l>0&&T(f,a,l-1)>=(a>0?T(f,a-1,l):Number.NEGATIVE_INFINITY)){let s=b(n[l-1]);d.push({kind:"added",text:s.text,afterLine:s.line,changed:!0}),l--}else{let s=b(e[a-1]);d.push({kind:"removed",text:s.text,beforeLine:s.line,changed:!0}),a--}}return d.reverse()}m(te,"alignChangedLines");function _(e,n,t){let r=re(e.text,n.text,t);if(r!==void 0)return{kind:"modified",text:n.text,beforeLine:e.line,afterLine:n.line,changed:!0,...r}}m(_,"modifiedRow");function re(e,n,t=performance.now()+S){let r=t-performance.now();if(r<=0||e.length+n.length>H)return;let o=j(e.trim(),n.trim(),{timeout:r,maxEditLength:5e3});if(o===void 0)return;let i=[],f=[],d=n.length-n.trimStart().length;for(let a=0;a<o.length;a++){let l=b(o[a]);l.removed?o[a+1]?.added||f.push(d):(l.added&&i.push({from:d,to:d+l.value.length}),d+=l.value.length)}return{addedRanges:i,deletedOffsets:f}}m(re,"compareInlineText");function z(e,n,t){let r=t(e,n);if(r===void 0)return;let o=V(e),i=V(n);if(o.length===0&&i.length===0)return r;let f=B(o,i,t),d=B(i,o,t);if(f===void 0||d===void 0)return;let a=(f+d)/2;return r*.35+a*.65}m(z,"lineSimilarity");function V(e){return(e.toLowerCase().match(/[\p{L}\p{N}_$]+/gu)??[]).filter(n=>!ee.has(n))}m(V,"semanticTokens");function B(e,n,t){if(e.length===0||n.length===0)return 0;let r=0;for(let o of e){let i=0;for(let f of n){let d=t(o,f);if(d===void 0)return;i=Math.max(i,d)}r+=i}return r/e.length}m(B,"directionalTokenSimilarity");function ie(e,n,t){if(t-performance.now()<=0)return;let o=Math.max(e.length,n.length);if(o===0||e===n)return 1;let i=Array.from(e),f=Array.from(n),d=0,a=0;for(;d<i.length&&d<f.length&&i[d]===f[d];)a+=b(i[d]).length,d++;let l=i.length,c=f.length;for(;l>d&&c>d&&i[l-1]===f[c-1];)a+=b(i[--l]).length,c--;let g=i.slice(d,l),s=f.slice(d,c);if(s.length>g.length&&([g,s]=[s,g]),s.length<=31&&g.every(y=>y.length===1)){let y=new Map;for(let[x,R]of s.entries())y.set(R,(y.get(R)??0)|1<<x);let w=0;for(let x of g){let R=(y.get(x)??0)|w;w=R&~(R-(w<<1|1))}let D=a;for(;w!==0;)w&=w-1,D++;return D/o}let h=j(e,n,{timeout:t-performance.now(),maxEditLength:2e3});return h===void 0?void 0:h.filter(y=>!y.added&&!y.removed).reduce((y,w)=>y+w.value.length,0)/o}m(ie,"characterSimilarity");function oe(e){let n=[];for(let t=0;t<e.length;t++){if(!b(e[t]).changed)continue;let r=t;for(;t+1<e.length&&b(e[t+1]).changed;)t++;let o={start:Math.max(0,r-N),end:Math.min(e.length-1,t+N)},i=n.at(-1);i!==void 0&&o.start<=i.end+1?n[n.length-1]={start:i.start,end:Math.max(i.end,o.end)}:n.push(o)}return n.flatMap((t,r)=>{let o=n[r-1];return[...o===void 0?[]:[de(t.start-o.end-1)],...e.slice(t.start,t.end+1)]})}m(oe,"projectHunks");function de(e){return{kind:"omitted",text:"",changed:!1,omitted:e}}m(de,"omittedRow");function W(e){if(e.length===0)return[];let n=e.replaceAll(`\r
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as d,g,h as c}from"./chunk-
|
|
1
|
+
import{b as d,g,h as c}from"./chunk-4IWEKRSP.js";import{a as s}from"./chunk-EI7MMDWY.js";import{readFile as p}from"node:fs/promises";import a from"node:path";import{Type as i}from"typebox";import{Value as f}from"typebox/value";var S=i.Object({targets:i.Array(i.Object({id:i.String(),host:i.String(),workspace:i.String(),configFile:i.Optional(i.String({minLength:1}))},{additionalProperties:!1}))},{additionalProperties:!1});function T(o){return{globalPath:a.join(a.dirname(o.globalPath),"ssh.json"),projectPath:a.join(a.dirname(o.projectPath),"ssh.json")}}s(T,"resolveSshConfigPaths");async function j(o){let r=await h(o.globalPath),t=await h(o.projectPath),e=new Map(r.map(n=>[n.id,n]));for(let n of t)e.set(n.id,n);return[...e.values()]}s(j,"readSshTargets");async function h(o){let r;try{r=await p(o,"utf8")}catch(t){if(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ENOENT")return[];throw new Error(`Cannot read SSH settings at ${o}`,{cause:t})}try{let t=JSON.parse(r);if(!f.Check(S,t))throw new Error("Invalid settings");return u(t,o)}catch{throw new Error(`Invalid SSH settings at ${o}`)}}s(h,"readScope");function u(o,r){let t=new Set;return o.targets.map(e=>{if(t.has(e.id))throw new Error("Duplicate target");t.add(e.id);let n={id:e.id,host:e.host,workspace:e.workspace,...e.configFile===void 0?{}:{configFile:a.resolve(a.dirname(r),e.configFile)}};return new c(n).target})}s(u,"validateScope");var l=class{static{s(this,"SshBackendRegistry")}#t=new Map;constructor(r){for(let t of r){if(this.#t.has(t.id))throw new TypeError(`Duplicate SSH target: ${t.id}`);this.#t.set(t.id,new c(t))}}resolve(r,t){let e=d(r,t);if(!e)return;let n=this.#t.get(e.target);if(!n)throw new g("UNKNOWN_TARGET",e.source,"not-applied");return{location:e,backend:n}}};export{T as a,j as b,l as c};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{a as le,b as fe,c as ue}from"./chunk-WQIMM4SU.js";import{a as de}from"./chunk-FHRHYY4M.js";import{a as N,g as l}from"./chunk-4IWEKRSP.js";import{c as ce}from"./chunk-W7CASEO3.js";import"./chunk-NNCZYO4Q.js";import{a as ne}from"./chunk-47SPPIXK.js";import{a as te,b as re}from"./chunk-VAXLSPPU.js";import{f as Z,g as ee}from"./chunk-KN6VPARZ.js";import{d as q}from"./chunk-OMNKD7WW.js";import"./chunk-PS2B6THP.js";import{a as ie}from"./chunk-GXL4NMHR.js";import{b as x,c as Q,d as X}from"./chunk-PQWANILR.js";import{a as W}from"./chunk-BU7IZLKB.js";import{a as $,b as K}from"./chunk-S5PL5DFQ.js";import{I as H}from"./chunk-DDH3FP4G.js";import{r as J}from"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import{a as se}from"./chunk-ZAWRSA7N.js";import{a as oe,b as ae}from"./chunk-OFILFO6D.js";import{a as s}from"./chunk-EI7MMDWY.js";import pe from"node:path";import{StringDecoder as Oe}from"node:string_decoder";function he(r){return(o,a)=>{let i=r.resolve(o.path??".",a.cwd);if(i===void 0)return;let{backend:c,location:w}=i,e=s((t,n=w.source)=>{let m=r.resolve(t,n);if(m===void 0||m.backend!==c)throw new l("UNSUPPORTED_SOURCE",t,"not-applied");return m.location},"own");return{resolve:s((t,n)=>e(n,t.includes("://")?t:w.source).source,"resolve"),dirname:s(t=>N(w.target,pe.posix.dirname(e(t).path)).source,"dirname"),basename:s(t=>pe.posix.basename(e(t).path),"basename"),isDirectory:s(async(t,n)=>(await c.stat(e(t).path,{signal:n})).kind==="directory","isDirectory"),byteSize:s(async(t,n)=>(await c.stat(e(t).path,{signal:n})).size,"byteSize"),readText:s(async(t,n)=>(await c.read(e(t).path,{signal:n})).bytes.toString("utf8"),"readText"),async execute(t,n,m,R){let d=await c.execute(t,n,e(m).path,{signal:R});return{code:d.exitCode,stdout:d.stdout.toString("utf8"),stderr:d.stderr.toString("utf8")}},async runLines(t,n,m,R){let d=await c.startProcess("rg",t,e(n).path,{signal:R}),g=new Oe("utf8"),u=[],p=0,f="",h,y=s(E=>{let k=E.split(`
|
|
2
|
+
`);for(let[O,b]of k.entries()){if(u.push(b),p+=Buffer.byteLength(b),p>32*1024*1024)throw new l("CONTENT_LIMIT",w.source,"not-applied");O<k.length-1&&(m(u.join("")),u.length=0,p=0)}},"consume"),v=(async()=>{try{for await(let E of d.stdout)y(g.write(E));y(g.end()),p>0&&m(u.join(""))}catch(E){h=E,await d.stop()}})(),T=(async()=>{for await(let E of d.stderr)f+=E.toString("utf8"),f.length>65536&&(f=f.slice(-65536))})();try{try{await d.end()}catch(k){if(!(k instanceof l)||k.code!=="INPUT_CLOSED")throw k}let E=await d.completion;if(await Promise.all([v,T]),h!==void 0)throw h instanceof Error?h:new Error("Search output failed.",{cause:h});return R?.throwIfAborted(),{code:E.exitCode,stderr:f}}finally{await d.stop(),await Promise.allSettled([v,T])}}}}}s(he,"createSshSearchEnvironmentProvider");import{lstat as Ue,mkdir as Ee,rm as Me,symlink as He,unlink as Ve,open as ze}from"node:fs/promises";import A from"node:path";import{constants as z}from"node:fs";import{createHash as Pe,randomBytes as Te}from"node:crypto";import{constants as we}from"node:fs";import{lstat as Ie,mkdir as Ne,open as me,readFile as Ce,rename as _e,rm as Ae,unlink as Fe}from"node:fs/promises";import D from"node:path";import{fileURLToPath as Le}from"node:url";function C(r,o,a){if(a?.has(r)&&a.get(r)!==o)throw new l("CONFLICT",r,"not-applied")}s(C,"checkCapturedRevision");var Be=1024*1024,De=Ce(new URL("./ssh-transfer-worker.py",new URL("../src/backend/file-transfer.ts",import.meta.url).href),"utf8");function j(r,o){if(r.startsWith("file:"))try{return Le(r)}catch{throw new l("UNSUPPORTED_SOURCE",r,"not-applied")}if(/^[a-z][a-z\d+.-]*:/iu.test(r)&&!/^[a-z]:[\\/]/iu.test(r))throw new l("UNSUPPORTED_SOURCE",r,"not-applied");if(o.startsWith("ssh://"))throw new l("UNSUPPORTED_SOURCE",r,"not-applied");return D.resolve(o,r)}s(j,"localTransferSource");function F(r){return[r.dev,r.ino,r.mode,r.uid,r.gid,r.size,r.mtimeNs,r.ctimeNs].join(":")}s(F,"localRevision");async function U(r){let o=await Ie(r,{bigint:!0});if(!o.isFile()||o.isSymbolicLink())throw new l("INVALID_FILE_TYPE",r,"not-applied");if(o.size>BigInt(Number.MAX_SAFE_INTEGER))throw new l("CONTENT_LIMIT",r,"not-applied");return o}s(U,"localEntry");function ye(r){return r!==null&&typeof r=="object"&&"code"in r&&r.code==="ENOENT"}s(ye,"missing");function ge(r){return r!==null&&typeof r=="object"&&"code"in r&&typeof r.code=="string"&&/^[A-Z][A-Z0-9_]*$/u.test(r.code)?r.code:"TRANSFER_FAILED"}s(ge,"errorCode");async function je(r,o,a,i){a.signal?.throwIfAborted();let c=r.resolve(o.path,a.cwd),w=r.resolve(o.target??"",a.cwd),e=c?.location.source??j(o.path,a.cwd),t=w?.location.source??j(o.target??"",a.cwd);if(e===t)throw new l("SAME_FILE",e,"not-applied");let n=c?await c.backend.lstat(c.location.path,a):await U(e);if("kind"in n&&n.kind!=="file")throw new l("INVALID_FILE_TYPE",e,"not-applied");let m=Number(n.size),R=Number(n.mode),d="revision"in n?n.revision:F(n);C(e,d,i);let g;try{g=w?await w.backend.lstat(w.location.path,a):await U(t)}catch(p){if(!ye(p))throw p}if(g!==void 0){if("kind"in g&&g.kind!=="file")throw new l("INVALID_FILE_TYPE",t,"not-applied");if(C(t,"revision"in g?g.revision:F(g),i),c&&w&&c.backend.target.host===w.backend.target.host&&c.backend.target.configFile===w.backend.target.configFile&&"identity"in n&&"identity"in g&&n.identity.device===g.identity.device&&n.identity.inode===g.identity.inode)throw new l("SAME_FILE",e,"not-applied")}let u=g===void 0?null:"revision"in g?g.revision:F(g);return g===void 0&&C(t,null,i),{source:e,target:t,remoteSource:c,remoteTarget:w,size:m,mode:R,sourceRevision:d,targetRevision:u}}s(je,"prepareTransfer");async function V(r,o,a,i,c,w){let{source:e,target:t,remoteSource:n,remoteTarget:m,size:R,mode:d,sourceRevision:g,targetRevision:u}=await je(r,a,i,c);await w?.();let p=n?void 0:await me(e,we.O_RDONLY|we.O_NOFOLLOW),f,h,y,v=!1,T="",E=s(async()=>{let k=n?await n.backend.lstat(n.location.path,i):await U(e);if(("revision"in k?k.revision:F(k))!==g)throw new l("CONFLICT",e,"not-applied")},"verifySource");try{if(p&&F(await p.stat({bigint:!0}))!==g)throw new l("CONFLICT",e,"not-applied");m?(y=await de(m.backend.target,"python3",["-c",await De,JSON.stringify({destination:m.location.path,size:R,mode:d,expected:u})],"/",i),y.completion.catch(()=>{}),y.stdout.on("data",b=>{T.length<=8192&&(T+=b.toString("utf8")),T.length>8192&&y?.stop().catch(()=>{})}),y.stderr.resume()):(await Ne(D.dirname(t),{recursive:!0}),f=D.join(D.dirname(t),`.pi-ide-transfer-${Te(12).toString("hex")}`),h=await me(f,"wx",d&4095));let k=Pe("sha256");for(let b=0;b<R;){i.signal?.throwIfAborted();let S=Math.min(Be,R-b),I;if(n){let P=await n.backend.readRange(n.location.path,b,S,i);if(P.revision!==g||P.offset!==b||P.totalBytes!==R)throw new l("CONFLICT",e,"not-applied");I=P.bytes}else{if(p===void 0)throw new Error("Missing source descriptor");let P=Buffer.allocUnsafe(S),{bytesRead:B}=await p.read(P,0,S,b);I=P.subarray(0,B)}if(I.length===0)throw new l("CONFLICT",e,"not-applied");if(k.update(I),y)await y.write(I);else{if(h===void 0)throw new Error("Missing destination descriptor");for(let P=0;P<I.length;){let B=await h.write(I,P,I.length-P);if(B.bytesWritten===0)throw new l("TRANSFER_FAILED",t,"not-applied");P+=B.bytesWritten}}b+=I.length}await E(),await w?.();let O=k.digest("hex");if(i.signal?.throwIfAborted(),y){if(await y.write(Buffer.from(`${JSON.stringify({sha256:O})}
|
|
3
|
+
`)),await y.end(),(await y.completion).exitCode!==0||T.length>8192)throw new l("TRANSFER_FAILED",t,"unknown");let S;try{S=JSON.parse(T)}catch{throw new l("INVALID_REPLY",t,"unknown")}if(S===null||typeof S!="object"||!("ok"in S))throw new l("INVALID_REPLY",t,"unknown");if(S.ok!==!0){let I="effect"in S&&(S.effect==="not-applied"||S.effect==="applied")?S.effect:"unknown";throw new l(ge(S),t,I)}if(!("sha256"in S)||S.sha256!==O)throw new l("CHECKSUM_MISMATCH",t,"unknown");v=!0}else{if(h===void 0||f===void 0)throw new Error("Missing staged destination");await h.chmod(d&4095),await h.sync(),await h.close(),h=void 0;let b=null;try{b=F(await U(t))}catch(S){if(!ye(S))throw S}if(b!==u)throw new l("CONFLICT",t,"not-applied");i.signal?.throwIfAborted(),await _e(f,t),f=void 0,v=!0}return o==="move"&&(await E(),n?await n.backend.removeEntry(n.location.path,g,i):await Fe(e)),{source:e,target:t}}catch(k){throw v?new l(ge(k),e,"unknown"):k}finally{await p?.close(),await h?.close(),f!==void 0&&await Ae(f,{force:!0}),y&&await y.stop().catch(()=>{})}}s(V,"transferFile");function Re(r,o,a){let i=r.resolve(o,a.cwd);if(i===void 0){let e=j(o,a.cwd);return{path:e,source:e,cwd:a.cwd,files:x}}let c=r.resolve(a.cwd,a.cwd),w=c?.location.target===i.location.target?c.location.path:i.backend.target.workspace;return{remote:i,source:i.location.source,path:i.location.path,cwd:w,files:{owner:JSON.stringify([i.backend.target.host,i.backend.target.configFile??null]),realpath:s(e=>i.backend.realpath(e,a),"realpath"),inspect:s(e=>i.backend.lstat(e,a),"inspect"),read:s(async e=>(await i.backend.read(e,a)).bytes.toString("utf8"),"read"),git:s((e,t,n)=>i.backend.queryGit(e,t,{...a,signal:n}),"git"),source:s(e=>N(i.location.target,e).source,"source"),snapshot:s((e,t)=>i.backend.objectSnapshot(e,{...a,signal:t}),"snapshot")}}}s(Re,"endpoint");function L(r,o,a){let i=r.remote?A.posix:A;if(i.sep==="\\"&&a.split("/").some(c=>c.includes("\\")||c.includes(":")))throw new l("INVALID_TARGET",r.source,"not-applied");return i.join(o,...a.split("/"))}s(L,"leaf");function G(r,o){return r.remote?N(r.remote.location.target,o).source:o}s(G,"receiptPath");async function _(r,o,a){let i;try{i=await r.files.inspect(o)}catch(c){if(c!==null&&typeof c=="object"&&"code"in c&&c.code==="ENOENT"){if(a===void 0)return}else throw c}if(a===void 0||i?.revision!==a.revision)throw new l("TRANSFER_TARGET_CHANGED",G(r,o),"not-applied")}s(_,"checkEntry");async function M(r){let o;try{o=await Ue(r)}catch(a){if(a===null||typeof a!="object"||!("code"in a)||a.code!=="ENOENT")throw a;await M(A.dirname(r)),await Ee(r);return}if(!o.isDirectory()||o.isSymbolicLink())throw new l("INVALID_FILE_TYPE",r,"not-applied");A.dirname(r)!==r&&await M(A.dirname(r))}s(M,"directoryParents");async function ve(r,o,a,i){r.remote?await r.remote.backend.removeObject(o,a.revision,i):(await _(r,o,a),a.kind==="directory"?await Me(o,{recursive:!0,force:!1}):await Ve(o))}s(ve,"remove");async function ke(r,o,a,i,c,w){let e=Re(r,a.path,i),t=Re(r,a.target??"",i),n=await c.prepareTransfer(o,e,t),m=n.source.entries[0];if(m===void 0)throw new l("ENOENT",e.source,"not-applied");e.remote&&C(e.source,m.revision,w),t.remote&&C(t.source,n.target.entries[0]?.revision??null,w);let R=!1;try{i.signal?.throwIfAborted();for(let d of n.source.entries)L(e,n.source.path,d.relativePath),L(t,n.target.path,d.relativePath);if(n.sourceKind==="file")e.remote&&t.remote&&e.remote.location.target===t.remote.location.target?await e.remote.backend[o](n.source.path,n.target.path,m.revision,n.target.entries[0]?.revision??null,i):await V(r,o,a,i,w,async()=>{await _(e,n.source.path,m),await _(t,n.target.path,n.target.entries[0])});else{if(o==="move"&&e.remote&&t.remote&&e.files.owner===t.files.owner&&await e.remote.backend.moveObject(n.source,n.target,i))return{kind:"file-operation",operation:o,ok:!0,effect:"applied",path:e.source,target:t.source,sourceKind:n.sourceKind};let d=new Map(n.target.entries.map(u=>[u.relativePath,u])),g=new Map;o==="move"&&n.target.entries[0]&&(R=!0,await ve(t,n.target.path,n.target.entries[0],i),d.clear());for(let u of n.source.entries){i.signal?.throwIfAborted();let p=L(e,n.source.path,u.relativePath),f=L(t,n.target.path,u.relativePath);await _(e,p,u);let h=d.get(u.relativePath);if(await _(t,f,h),u.kind==="directory")h===void 0&&(R=!0),t.remote?await t.remote.backend.ensureObjectDirectory(f,u.mode|448,h?.revision??null,i):h===void 0&&(await M(A.dirname(f)),await Ee(f,{mode:u.mode|448})),h===void 0&&g.set(u.relativePath,(await t.files.inspect(f)).identity);else if(u.kind==="symlink"){if(R=!0,u.link===void 0)throw new l("INVALID_RESPONSE",e.source,"unknown");t.remote?await t.remote.backend.createObjectLink(f,u.link,i):(await M(A.dirname(f)),await He(Buffer.from(u.link,"base64"),f))}else{R=!0;let y=G(e,p),v=G(t,f);e.remote&&t.remote&&e.files.owner===t.files.owner?await e.remote.backend.copy(p,f,u.revision,h?.revision??null,i):await V(r,"copy",{path:y,target:v},i,void 0,async()=>{await _(e,p,u),await _(t,f,h)})}}for(let u of[...n.source.entries].reverse()){if(u.kind!=="directory"||d.has(u.relativePath))continue;let p=L(t,n.target.path,u.relativePath),f=await t.files.inspect(p),h=g.get(u.relativePath);if(f.kind!=="directory"||h?.device!==f.identity.device||h.inode!==f.identity.inode)throw new l("TRANSFER_TARGET_CHANGED",t.source,"unknown");if(t.remote)await t.remote.backend.setObjectMode(p,u.mode,f.revision,i);else{let y=await ze(p,z.O_RDONLY|z.O_DIRECTORY|z.O_NOFOLLOW);try{let v=await y.stat();if(String(v.dev)!==h.device||String(v.ino)!==h.inode)throw new l("TRANSFER_TARGET_CHANGED",t.source,"unknown");await y.chmod(u.mode&4095)}finally{await y.close()}}}await n.verifySource(),o==="move"&&await ve(e,n.source.path,m,i)}return{kind:"file-operation",operation:o,ok:!0,effect:"applied",path:e.source,target:t.source,sourceKind:n.sourceKind}}catch(d){throw R?Object.assign(d instanceof Error?d:new Error(String(d)),{effect:"unknown"}):d}}s(ke,"transferObject");function Se(r,o){return async(a,i,c,w)=>{let e=r.resolve(i.path,c.cwd);if(e===void 0&&(i.target===void 0||r.resolve(i.target,c.cwd)===void 0))return;if(a!=="delete"){if(w===void 0)throw new l("TRANSFER_POLICY_REQUIRED",i.path,"not-applied");return ke(r,a,i,c,w,o)}if(e===void 0)return;let t=await e.backend.lstat(e.location.path,c);C(e.location.source,t.revision,o);{if(w===void 0)throw new l("DELETE_POLICY_REQUIRED",e.location.source,"not-applied");let n=r.resolve(c.cwd,c.cwd);if(n!==void 0&&n.location.target!==e.location.target)throw new l("UNSUPPORTED_SOURCE",e.location.source,"not-applied");let m=n?.location.path??e.backend.target.workspace,R=await w.prepare(e.location.path,m,{temporaryEnvironment:s(d=>e.backend.temporaryEnvironment({...c,signal:d}),"temporaryEnvironment"),realpath:s(d=>e.backend.realpath(d,c),"realpath"),inspect:s(d=>e.backend.lstat(d,c),"inspect"),read:s(async d=>(await e.backend.read(d,c)).bytes.toString("utf8"),"read"),git:s((d,g,u)=>e.backend.queryGit(d,g,{...c,signal:u}),"git"),source:s(d=>N(e.location.target,d).source,"source")});if(R.revision!==t.revision)throw new l("DELETE_TARGET_CHANGED",e.location.source,"not-applied");return await e.backend.removeObject(R.resolvedPath,R.revision,c),{kind:"file-operation",operation:a,ok:!0,effect:"applied",path:e.location.source}}}}s(Se,"createSshFileOperationResolver");function Y(r,o,a){return{id:"ssh",async tryResolve(i,c){try{let w=r.resolve(i,c.cwd);if(!w)return{kind:"not-handled"};let{backend:e,location:t}=w,n=!1;try{n=(await e.stat(t.path,c)).kind==="directory"}catch(p){if(!(p instanceof l)||p.code!=="ENOENT")throw p}let m,R,d=s(async p=>{try{let f=await e.read(t.path,p);return m=f.version,f.bytes}catch(f){throw f instanceof l&&f.code==="ENOENT"&&(m=null),f}},"snapshot"),g=s(async p=>{if(R=void 0,n){let h=(await e.list(t.path,p)).map(y=>` ${y.kind==="directory"?"\u{1F4C1}":y.kind==="file"?"\u{1F4C4}":"\u{1F517}"} ${y.name}`);return[{type:"text",text:[`\u{1F4C1} ${t.source}/`,...h.length?["",...h]:[]].join(`
|
|
4
|
+
`)}]}return R=await d(p),o.convert({source:t.source,bytes:R},p)},"read"),u=s(async(p,f,h)=>{let v=await e.readRange(t.path,p,Math.min(f??4194304,4194304),h),T=[v.bytes],E=v.bytes.length,k=Math.min(f??v.totalBytes,v.totalBytes-v.offset);for(;E<k;){let O=await e.readRange(t.path,v.offset+E,Math.min(k-E,4194304),h);if(O.revision!==v.revision||O.totalBytes!==v.totalBytes||O.offset!==v.offset+E)throw new l("SOURCE_CHANGED",t.source,"not-applied");if(O.bytes.length===0)break;T.push(O.bytes),E+=O.bytes.length}return{bytes:Buffer.concat(T,E),byteOffset:v.offset,totalBytes:v.totalBytes}},"readBytes");return a==="read"||n?{kind:"resolved",resource:{source:t.source,link:t.source,read:g,get sourceBytes(){return R},...n?{}:{readBytes:u}}}:{kind:"resolved",resource:{source:t.source,link:t.source,read:g,readBytes:u,get sourceBytes(){return R},async write(p,f){let h=J(p);if(m===void 0)try{await d(f)}catch(y){if(!(y instanceof l)||y.code!=="ENOENT")throw y}if(m===void 0)throw new l("SNAPSHOT_REQUIRED",t.source,"not-applied");m=await e.write(t.path,Buffer.from(h,"utf8"),m,f)}}}}catch(w){return{kind:"failed",error:w}}}}}s(Y,"createSshResourceResolver");async function be(r,o){let a=await Z({id:"ssh",description:"Set up SSH targets and use remote resources",triggers:[{tool:"read",resourcePrefixes:["ssh://","raw:ssh://","ast:ssh://","web:ssh://"]},{tool:"search",resourcePrefixes:["ssh://","web:ssh://"]},{tool:"debug",resourcePrefixes:["ssh://"]},...["write","replace","insert","delete","copy","move","stage","unstage","undo"].map(n=>({tool:n,resourcePrefixes:["ssh://"]}))]});if(ee(r,[{...a,markdown:`${a.markdown}
|
|
5
|
+
## Configured workspaces
|
|
6
|
+
|
|
7
|
+
${o.length===0?"No SSH targets are configured. Follow the setup steps above.":o.map(n=>`- \`${N(n.id,n.workspace).source}\``).join(`
|
|
8
|
+
`)}
|
|
9
|
+
`}]),o.length===0)return;let i=new ue(o),c=H(r,{provider:"filesystem",capability:"read"}),w=H(r,{provider:"filesystem",capability:"write"}),e={protocol:$,apiVersion:K,id:"ssh",setup(n){n.addResolver({resolver:Y(i,c,"read"),priority:-50,preserveTruncatedOutput:!0,renderResult:q({kind:"source"})})}},t={protocol:Q,apiVersion:X,id:"ssh",setup(n){n.addFileOperationResolver(Se(i)),n.addResolver({resolver:Y(i,w,"write"),priority:-50})}};await Promise.all([se(r,{protocol:oe,apiVersion:5,id:"ssh-diagnostic-files",setup(n){n.addDiagnosticFileReader({id:"ssh",async readText(m,R){let d=i.resolve(m,R.cwd);if(d)return(await d.backend.read(d.location.path,{signal:R.signal})).bytes.toString("utf8")}})}}),W(r,e),ie(r,t),ne(r,{protocol:te,apiVersion:re,id:"ssh",setup(n){n.addEnvironmentProvider(he(i))}})])}s(be,"registerSshResources");async function Ge(r){let o=await fe(le(ce()));await be(r,o)}s(Ge,"registerSshModule");export{Ge as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{c as q}from"./chunk-756K3LJY.js";import{m as E}from"./chunk-VDJSH3DQ.js";import{a}from"./chunk-EI7MMDWY.js";import O from"cross-spawn";import{fileURLToPath as S}from"node:url";var T=5e3,R=10*1024*1024,P=S(new URL(".",new URL("../src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/src/jq.ts",import.meta.url).href));function j(n){let t=n?.filter(r=>r==="jq"||r.startsWith("jq:"))??[];if(t.length===0)return;if(t.length>1)throw new Error("Read accepts only one jq view");if(n?.length!==1)throw new Error("The jq view cannot be combined with other views. Keep only one jq:<filter> in views.");let e=t[0];if(e===void 0||e==="jq"||e.slice(3).trim().length===0)throw new Error('The jq view requires a filter, for example views: ["jq:.scripts"]');return{filter:e.slice(3)}}a(j,"parseJqView");function y(n,t,e){return e.signal?.aborted===!0?Promise.reject(new Error("jq execution was cancelled")):J(n)?Promise.reject(new Error("jq module loading is disabled")):new Promise((r,s)=>{let i=O(e.command??"jq",["-L",P,"--",n],{cwd:e.cwd,env:b(e.cwd),shell:!1,stdio:["pipe","pipe","pipe"],windowsHide:!0}),d="",u="",c=!1,p=0,l=a(o=>{c||(c=!0,clearTimeout(h),e.signal?.removeEventListener("abort",m),o===void 0?r(d):s(o))},"finish"),g=a(o=>{i.kill(),l(o)},"stop"),m=a(()=>g(new Error("jq execution was cancelled")),"abort"),h=setTimeout(()=>g(new Error(`jq did not finish within ${T/1e3} seconds`)),T);h.unref(),e.signal?.addEventListener("abort",m,{once:!0}),i.stdout?.setEncoding("utf8"),i.stderr?.setEncoding("utf8"),i.stdout?.on("data",o=>{if(p+=Buffer.byteLength(o),p>R){g(new Error(`jq output exceeded ${R/1024/1024}MB`));return}d+=o}),i.stderr?.on("data",o=>{Buffer.byteLength(u)<16384&&(u+=o)}),i.once("error",o=>l(new Error(`Cannot start jq: ${o.message}`))),i.once("close",(o,w)=>{if(!c)if(o===0)l();else{let x=u.trim().split(/\r?\n/u).slice(0,8).join(`
|
|
2
|
+
`);l(new Error(x||`jq exited ${w===null?`with code ${String(o)}`:`after signal ${w}`}`))}}),i.stdin?.once("error",o=>l(new Error(`Cannot send JSON to jq: ${o.message}`))),i.stdin?.end(t)})}a(y,"executeJq");function J(n){let t=[0],e=0,r="";for(;e<n.length;){let s=n[e],i=t.at(-1);if(i==="string"){s==="\\"?(n[e+1]==="("&&(t.push(0),r=""),e+=2):(s==='"'&&(t.pop(),r='"'),e+=1);continue}if(s==="#"){let d=n.indexOf(`
|
|
3
|
+
`,e);e=d<0?n.length:d+1;continue}if(s==='"')t.push("string");else if(s==="(")t[t.length-1]=(i??0)+1;else if(s===")")t.length>1&&i===0?t.pop():t[t.length-1]=Math.max(0,(i??0)-1);else if(/[A-Za-z_]/u.test(s??"")){let d=e;for(;/[A-Za-z0-9_]/u.test(n[e]??"");)e+=1;let u=n.slice(d,e),c=_(n,e),p=r==="."||r==="$",l=c.startsWith(":")&&!c.startsWith("::");if(!p&&!l&&(u==="include"||u==="import"||u==="modulemeta"))return!0;r=u;continue}s!==void 0&&!/\s/u.test(s)&&(r=s),e+=1}return!1}a(J,"hasModuleOperation");function _(n,t){let e=t;for(;e<n.length;)if(/\s/u.test(n[e]??""))e+=1;else if(n[e]==="#"){let r=n.indexOf(`
|
|
4
|
+
`,e);e=r<0?n.length:r+1}else break;return n.slice(e,e+2)}a(_,"nextCode");function b(n){let t=q(n,process.env),e={};for(let r of["PATH","PATHEXT","SystemRoot","SYSTEMROOT","WINDIR"])t[r]!==void 0&&(e[r]=t[r]);return e}a(b,"safeEnvironment");function $(n){return async t=>{let e;try{e=j(t.request.views)}catch(u){return f(t,n.pluginId,"READ_FAILED",v(u))}if(e===void 0)return{kind:"continue",context:t};if(t.inputScope==="selection"||t.sourceTarget!==void 0)return f(t,n.pluginId,"UNSUPPORTED_RANGE","jq requires a complete JSON source. Read its explicit path instead of a result, search selection or text anchor.");if(t.inputScope!=="source")return f(t,n.pluginId,"READ_FAILED","This jq view requires a matching Read host that classifies complete source inputs.");let r=t.state;if(r?.contentKind!=="text")return f(t,n.pluginId,"UNSUPPORTED_CONTENT","This source does not supply structured JSON for jq.");let s=n.input(t);if(typeof s!="string")return f(t,n.pluginId,"UNSUPPORTED_CONTENT","This source does not supply structured JSON for jq.");let i;try{i=await y(e.filter,s,{cwd:t.resolverContext.cwd,...t.resolverContext.signal===void 0?{}:{signal:t.resolverContext.signal}})}catch(u){return f(t,n.pluginId,"READ_FAILED",v(u))}let d={...r,content:[{type:"text",text:i}],text:E(r.source,i),preserveTruncatedOutput:!0};return{kind:"continue",context:{...t,sourceText:void 0,sourceTarget:void 0,state:d}}}}a($,"createJqReadHandler");function v(n){return n instanceof Error?n.message:String(n)}a(v,"message");function f(n,t,e,r){let s=n.state?.source??n.request.path,i=n.state?.resolvedBy;return{kind:"return",result:{content:[{type:"text",text:`jq failed: ${r}`}],details:{source:s,resolvedBy:i,failure:{code:e,source:s,resolverId:i,pluginId:t,stage:"read",message:r}},isError:!0}}}a(f,"failure");export{$ as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as i}from"./chunk-EI7MMDWY.js";import{convertToPng as k,formatDimensionNote as x,resizeImage as y}from"@earendil-works/pi-coding-agent";var g=[137,80,78,71,13,10,26,10];function A(){return{id:"image",description:"Image \u2014 the image.",async tryConvert(e,n){let t=f(n.signal);if(t!==void 0)return{kind:"failed",error:t};let r=T(e.bytes);if(r.kind==="not-handled")return r;let a=i(()=>!v(e.source,e.mediaType)&&w(e.bytes),"leaveToText");if(r.kind==="invalid")return a()?{kind:"not-handled"}:{kind:"failed",error:new TypeError(`${e.source}: ${r.message}`)};try{let o=await h(e.bytes,r.mimeType),d=f(n.signal);return d!==void 0?{kind:"failed",error:d}:{kind:"converted",content:o}}catch(o){let d=f(n.signal);return d===void 0&&a()?{kind:"not-handled"}:{kind:"failed",error:d??new TypeError(`Unable to process image ${e.source}`,{cause:o})}}}}}i(A,"createImageContentConverter");var U=/\.(?:bmp|gif|jpe?g|png|webp)$/iu;function v(e,n){return(n?.split(";",1)[0]?.trim().toLowerCase()??"").startsWith("image/")||U.test(e.split(/[?#]/u,1)[0]??"")}i(v,"declaresImage");function w(e){try{return new TextDecoder("utf8",{fatal:!0}).decode(e),!0}catch{return!1}}i(w,"isUtf8Text");function C(e){let n=T(e);return n.kind==="supported"?n.mimeType:null}i(C,"detectSupportedImageMimeType");async function h(e,n){let t=e,r=n,a;if(n==="image/bmp"){let l=await k(Buffer.from(e).toString("base64"),n);if(l===null)throw new TypeError("Unable to convert image/bmp to an inline image format");t=Buffer.from(l.data,"base64"),r=l.mimeType,a=n}let o=await y(t,r);if(o===null)throw new TypeError(`Unable to normalize ${n} within Pi inline image limits`);let d=[];a!==void 0&&a!==o.mimeType&&d.push(`[Image converted from ${a} to ${o.mimeType}.]`);let c=x(o);return c!==void 0&&d.push(c),[{type:"text",text:[`Read image [${o.mimeType}]`,...d].join(`
|
|
2
|
+
`)},{type:"image",data:o.data,mimeType:o.mimeType}]}i(h,"createImageContent");function T(e){return s(e,[255,216,255])?e[3]===247?{kind:"not-handled"}:{kind:"supported",mimeType:"image/jpeg"}:s(e,g)?E(e)?M(e)?{kind:"invalid",message:"Animated PNG is not supported"}:{kind:"supported",mimeType:"image/png"}:{kind:"invalid",message:"Malformed PNG image"}:m(e,0,"GIF87a")||m(e,0,"GIF89a")?{kind:"supported",mimeType:"image/gif"}:m(e,0,"RIFF")&&m(e,8,"WEBP")?{kind:"supported",mimeType:"image/webp"}:m(e,0,"BM")?P(e)?{kind:"supported",mimeType:"image/bmp"}:{kind:"invalid",message:"Malformed BMP image"}:{kind:"not-handled"}}i(T,"inspectImage");function E(e){return e.length>=33&&I(e,g.length)===13&&m(e,12,"IHDR")}i(E,"isPng");function M(e){let n=g.length;for(;n+8<=e.length;){let t=I(e,n),r=n+4;if(m(e,r,"acTL"))return!0;if(m(e,r,"IDAT"))return!1;let a=n+8+t+4;if(a<=n||a>e.length)return!1;n=a}return!1}i(M,"isAnimatedPng");function P(e){if(e.length<26)return!1;let n=p(e,2),t=p(e,10),r=p(e,14);if(n!==0&&(n<26||n>e.length)||t<14+r||t>=e.length||n!==0&&t>=n)return!1;let a,o;if(r===12)a=u(e,22),o=u(e,24);else if(r>=40&&r<=124){if(e.length<30)return!1;a=u(e,26),o=u(e,28)}else return!1;return a===1&&[1,4,8,16,24,32].includes(o)}i(P,"isBmp");function u(e,n){return(e[n]??0)+((e[n+1]??0)<<8)}i(u,"readUint16LE");function I(e,n){return(e[n]??0)*16777216+((e[n+1]??0)<<16)+((e[n+2]??0)<<8)+(e[n+3]??0)}i(I,"readUint32BE");function p(e,n){return(e[n]??0)+((e[n+1]??0)<<8)+((e[n+2]??0)<<16)+(e[n+3]??0)*16777216}i(p,"readUint32LE");function s(e,n){return e.length>=n.length&&n.every((t,r)=>e[r]===t)}i(s,"startsWith");function m(e,n,t){if(e.length<n+t.length)return!1;for(let r=0;r<t.length;r+=1)if(e[n+r]!==t.codePointAt(r))return!1;return!0}i(m,"startsWithAscii");function f(e){if(e?.aborted===!0)return e.reason instanceof Error?e.reason:S()}i(f,"cancellationError");function S(){let e=new Error("The operation was aborted");return e.name="AbortError",e}i(S,"abortError");export{A as a,C as b,h as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as T}from"./chunk-L2B4DTVS.js";import{c as S,d as M}from"./chunk-W7CASEO3.js";import{a as t}from"./chunk-EI7MMDWY.js";import{Container as R,Key as P,matchesKey as C,MouseRegion as q,SelectList as L,Text as I,truncateToWidth as W,visibleWidth as A}from"@earendil-works/pi-tui";var x=class{constructor(e,d,o){this.registry=e;this.activityMode=d;e.onDidChange(()=>this.#r()),o.registerCommand("agent-ide-processes",{description:"Show active terminal and debugger processes created by Agent IDE",handler:t(async(c,n)=>{if(this.bind(n),n.mode!=="tui"){n.ui.notify("The Agent IDE process overlay requires the TUI.","info");return}await this.#d(n)},"handler")})}static{t(this,"AgentIdeProcessesUi")}#t;#i=!1;#s;#e;bind(e){this.#i||(this.#t=e,this.#r())}dispose(){this.#i=!0,this.#e!==void 0&&clearInterval(this.#e),this.#e=void 0,this.#t?.ui.setWidget("agent-ide-processes",void 0),this.#t?.ui.setStatus("agent-ide-processes",void 0),this.#t=void 0}#n(){return this.registry.list()}#r(){let e=this.#t;if(this.#i||e===void 0||!e.hasUI)return;let d=this.#n();if(this.activityMode==="off"||d.length===0){e.ui.setWidget("agent-ide-processes",void 0),e.ui.setStatus("agent-ide-processes",void 0),this.#e!==void 0&&clearInterval(this.#e),this.#e=void 0;return}if(this.activityMode==="compact"){e.ui.setWidget("agent-ide-processes",void 0),e.ui.setStatus("agent-ide-processes",`Agent IDE processes: ${d.length}`);return}e.ui.setStatus("agent-ide-processes",void 0),e.ui.setWidget("agent-ide-processes",(o,c)=>O(d,c,n=>{this.#d(e,n).catch(p=>{e.ui.notify(`Could not open process details: ${String(p)}`,"error")})}),{placement:"belowEditor"}),this.#e??=setInterval(()=>this.#r(),1e3)}#d(e,d){return this.#s??=this.#o(e,d).finally(()=>{this.#s=void 0}),this.#s}async#o(e,d){for(;;){if(this.#n().length===0){e.ui.notify("No active Agent IDE processes.","info");return}let o=t(()=>{},"disposeRefresh"),c,n;try{n=await e.ui.custom((f,g,j,E)=>{let h=this.#n(),a=h.find(s=>s.source===d),l=a?"detail":"list";d=void 0;let $=t(s=>{let u=h.map(i=>({value:i.source,label:`${i.status} ${i.kind} ${i.title}`,description:i.description})),y=new L(u,Math.min(u.length,12),{selectedPrefix:t(i=>g.fg("accent",i),"selectedPrefix"),selectedText:t(i=>g.fg("accent",i),"selectedText"),description:t(i=>g.fg("muted",i),"description"),scrollInfo:t(i=>g.fg("dim",i),"scrollInfo"),noMatch:t(i=>g.fg("warning",i),"noMatch")}),v=u.findIndex(i=>i.value===s);return v>=0&&y.setSelectedIndex(v),y.onSelect=i=>{a=h.find(_=>_.source===i.value),l="detail",f.requestRender()},y.onCancel=()=>E(null),y},"createList"),m=$(a?.source),w=t(()=>{let s=a?.source??m.getSelectedItem()?.value;h=this.#n(),a=l==="list"?void 0:h.find(u=>u.source===s),m=$(s),f.requestRender()},"refresh");return o=this.registry.onDidChange(w),c=setInterval(w,1e3),{invalidate:t(()=>m.invalidate(),"invalidate"),render(s){let u=new R;l==="list"?(u.addChild(m),u.addChild(new I(g.fg("dim",h.length===0?"esc close":"enter view \xB7 d stop \xB7 esc close"),1,0))):a===void 0?(u.addChild(new I(g.fg("warning","Process is no longer active."),1,0)),u.addChild(new I(g.fg("dim","esc back"),1,0))):(u.addChild(a.renderDetail(g)),u.addChild(new I(g.fg(l==="confirm"?"warning":"dim",l==="confirm"?"Stop this process? y confirm \xB7 n/esc cancel":l==="input"?"input mode \xB7 type to send \xB7 esc stop input":a.sendInput===void 0?"esc back \xB7 d stop":"i input \xB7 esc back \xB7 d stop"),1,0)));let y=t(i=>g.fg("accent",i),"accent"),v=Math.max(1,s-2);return[D("Agent IDE Processes",`${h.length} active`,s,y),...u.render(v).map(i=>b(i,s,y)),k(s,y)]},handleInput(s){l==="list"?s==="d"?(a=h.find(u=>u.source===m.getSelectedItem()?.value),a!==void 0&&(l="confirm")):m.handleInput(s):l==="detail"?C(s,P.escape)?l="list":s==="d"&&a!==void 0?l="confirm":s==="i"&&a?.sendInput!==void 0&&(l="input"):l==="input"?C(s,P.escape)?l="detail":a?.sendInput?.(s):s==="y"&&a!==void 0?E({source:a.source}):(s==="n"||C(s,P.escape))&&(l="detail"),f.requestRender()}}},{overlay:!0,overlayOptions:{width:"75%",maxHeight:"80%",minWidth:52}})}finally{o(),c!==void 0&&clearInterval(c)}if(n===null)return;let p=this.#n().find(f=>f.source===n.source);p!==void 0&&await p.stop()}}};function O(r,e,d){let o=new R;if(r.length===0)return o;let c=t(n=>e.fg("accent",n),"accent");o.addChild({invalidate(){},render:t(n=>[D("Agent IDE Processes",`${r.length} active`,n,c)],"render")});for(let[n,p]of r.entries())o.addChild(new q({invalidate(){},render:t(f=>p.renderSummary(e).map(g=>b(` ${g} `,f,c)),"render")},f=>{if(!(d===void 0||f.type!=="click"||f.button!=="left"))return d(p.source),{handled:!0}})),n<r.length-1&&o.addChild({invalidate(){},render:t(f=>[b("",f,c)],"render")});return o.addChild({invalidate(){},render:t(n=>[k(n,c)],"render")}),o}t(O,"createProcessWidget");function D(r,e,d,o){if(d<=1)return o("\u256D");let c=d-2,n=`\u2500 ${r} `,p=` ${e} \u2500`,f="\u2500".repeat(Math.max(0,c-A(n)-A(p)));return o(`\u256D${W(`${n}${f}${p}`,c).padEnd(c,"\u2500")}\u256E`)}t(D,"borderTop");function b(r,e,d){if(e<=1)return d("\u2502");let o=e-2,c=W(r,o);return`${d("\u2502")}${c}${" ".repeat(Math.max(0,o-A(c)))}${d("\u2502")}`}t(b,"borderLine");function k(r,e){return e(r<=1?"\u2570":`\u2570${"\u2500".repeat(r-2)}\u256F`)}t(k,"borderBottom");async function K(r){let e=T(r),d=await M(S()),o=new x(e,U(d.preferences?.["processes.activity"]),r);r.on("session_start",(c,n)=>o.bind(n)),r.on("session_shutdown",()=>o.dispose())}t(K,"registerAgentIdeProcesses");function U(r){return r==="compact"||r==="off"?r:"detailed"}t(U,"activityMode");export{K as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as
|
|
1
|
+
import{c as T,g as h,m as w}from"./chunk-PQWANILR.js";import{a as x,c as E}from"./chunk-DDH3FP4G.js";import{a as P}from"./chunk-ZC65Z3CK.js";import{a as o}from"./chunk-EI7MMDWY.js";import{AsyncLocalStorage as S}from"node:async_hooks";var p=new S,m=new S;function C(t){let e=m.getStore();e?e.push(t):t()}o(C,"afterPostEditScope");async function O(t){if(m.getStore())return t();let e=[];try{return await m.run(e,t)}finally{for(let r of e)r()}}o(O,"collectPostEditNotifications");function q(t,e){let r=p.getStore();return r?r.immediate?(r.pending.delete(t),!1):(r.pending.set(t,e),!0):!1}o(q,"deferPostEdit");function D(t){return p.getStore()?.pending.has(t)??!1}o(D,"hasDeferredPostEdit");function F(t){p.getStore()?.pending.delete(t)}o(F,"forgetDeferredPostEdit");function L(t=process.cwd()){let e=new Map;return{run(r,a=!1){return p.run({pending:e,immediate:a},r)},forget(r){e.delete(r)},sources(){return[...e.keys()]},async finish(r,a){let s=[...e];e.clear();let c=[],i=[];if(await O(async()=>{let u=new x,b=await Promise.allSettled(s.map(([g,d])=>u.run(E(g,t,"write"),d)));for(let[g,d]of b.entries()){let y=P(s[g])[0];if(d.status==="rejected"){i.push(d.reason);try{a?.(y,d.reason)}catch(l){i.push(l)}continue}c.push(d.value);try{r?.(d.value)}catch(l){i.push(l);try{a?.(y,l)}catch(k){i.push(k)}}}}),i.length>0)throw new AggregateError(i,`Some final post-processing failed; completed edits remain applied. ${i.map(u=>u instanceof Error?u.message:String(u)).join("; ")}`);return c}}}o(L,"createPostEditScope");import{Type as n}from"typebox";import{Value as f}from"typebox/value";var A=`${T}/post-edit/register`;function $(t){return f.Check(n.Object({formatting:n.Object({status:n.Union(["disabled","unavailable","skipped-syntax","unchanged","changed","failed","not-reported","deferred"].map(e=>n.Literal(e))),formatter:n.Optional(n.String())})}),t)}o($,"isFormattingContribution");function W(t){return f.Check(n.Object({diffStatuses:n.Array(n.Object({text:n.String({minLength:1}),origin:n.Optional(n.Literal("after-edit")),formatter:n.Optional(n.String()),tone:n.Optional(n.Union(["muted","success","warning","error"].map(e=>n.Literal(e))))}))}),t)}o(W,"isDiffStatusContribution");var R=n.Function([],n.Unknown()),v=n.Object({id:n.String({minLength:1}),handler:R}),H=n.Object({registration:v,accept:R});function j(t){return f.Check(v,t)}o(j,"isTextPostEditHandlerRegistration");function B(t){return f.Check(H,t)}o(B,"isTextPostEditHandlerRegistrationRequest");function G(t){if(typeof t!="object"||t===null)return!1;let e=t;return Array.isArray(e.hints)&&typeof e.scopeMarkers=="object"&&e.scopeMarkers!==null&&Array.isArray(e.warnings)}o(G,"isTextMutationResultContributionData");function K(t,e){if(!j(e))throw new TypeError("Invalid text editor post-edit handler registration");let r,a=o(()=>{let c={registration:e,accept(i){if(r!==void 0)throw new Error(`Post-edit handler ${e.id} was accepted more than once`);r=i}};return t.events.emit(A,c),r!==void 0},"announce"),s=o(()=>{},"unsubscribeReady");s=t.events.on(h,c=>{if(!w(c))throw new Error("Invalid pi-agent-text-editor core readiness event");if(!a())throw new Error("pi-agent-text-editor core announced readiness without accepting the post-edit handler");s()}),t.on("session_shutdown",()=>{s(),r?.()}),a()&&s()}o(K,"connectTextEditorPostEditHandler");export{C as a,O as b,q as c,D as d,F as e,L as f,A as g,$ as h,W as i,j,B as k,G as l,K as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as d}from"./chunk-VMLPXSMK.js";import{g as o}from"./chunk-4IWEKRSP.js";import{a as m}from"./chunk-EI7MMDWY.js";async function w(i,n,e,t,s){return d(i,n,e,t,{...s,effect:"not-applied"})}m(w,"readOwnedSshCommand");import{readFile as u}from"node:fs/promises";import{Type as p}from"typebox";import{Value as f}from"typebox/value";var S=p.Object({html:p.String(),source:p.String()}),c=new Set(["CAPABILITY_UNAVAILABLE","INVALID_SOURCE","BYTE_LIMIT","TIMEOUT","HTTP_FAILED","BROWSER_FAILED","CANCELLED"]),l;async function B(i,n,e,t){let s=await h(i,n,e,t,"html");if(!f.Check(S,s)||Buffer.byteLength(s.html,"utf8")>16*1024*1024)throw new o("INVALID_RESPONSE",e,"not-applied");let r=new URL(s.source);if(!["http:","https:"].includes(r.protocol)||r.username||r.password)throw new o("INVALID_RESPONSE",e,"not-applied");return s}m(B,"readSshBrowserPage");async function N(i,n,e){let t=await h(i,new URL("about:blank"),n,{signal:e,timeoutMs:3e4},"probe");if(!f.Check(p.Object({ready:p.Literal(!0)}),t))throw new o("INVALID_RESPONSE",n,"not-applied")}m(N,"probeSshBrowser");async function h(i,n,e,t,s){t.signal?.throwIfAborted(),l??=u(new URL("./web-browser-worker.mjs",new URL("../src/backend/web-browser.ts",import.meta.url).href),"utf8");try{let r=await w(i,"node",["--input-type=module","-e",await l,JSON.stringify({kind:s,url:n.href,timeoutMs:t.timeoutMs})],e,{signal:t.signal,timeoutMs:t.timeoutMs,maxBytes:33554432});if(r.exitCode!==0)throw new o("BROWSER_FAILED",e,"not-applied");let a;try{a=JSON.parse(r.stdout.toString("utf8"))}catch{throw new o("INVALID_RESPONSE",e,"not-applied")}if(typeof a=="object"&&a!==null&&"error"in a)throw new o(typeof a.error=="string"&&c.has(a.error)?a.error:"INVALID_RESPONSE",e,"not-applied");return a}catch(r){throw r instanceof o?new o(r.code==="ENOENT"?"CAPABILITY_UNAVAILABLE":r.code,e,r.effect):r}}m(h,"runBrowser");export{w as a,B as b,N as c};
|
package/dist/entry-0.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f}from"./chunk-OJEIX7OZ.js";import"./chunk-EI7MMDWY.js";export{c as SETTINGS_READY_EVENT,b as SETTINGS_READ_EVENT,a as SETTINGS_REGISTER_EVENT,e as readAgentIdeSetting,d as registerAgentIdeSettings,f as validateAgentIdeSettings};
|
|
1
|
+
import{a as le}from"./chunk-FXPY3V4L.js";import{c as te,d as re}from"./chunk-HISGZD3C.js";import"./chunk-J34VKQGJ.js";import{a as ie}from"./chunk-WAJW4G4F.js";import{b as oe}from"./chunk-YHADTHQM.js";import"./chunk-6WCHBHFW.js";import"./chunk-MXLSGMRZ.js";import"./chunk-FEZLTM4L.js";import{a as ae}from"./chunk-WEE3NM6L.js";import"./chunk-QJ6V5IAY.js";import{a as ne}from"./chunk-C2JT2G5K.js";import"./chunk-UD3DMY3Q.js";import"./chunk-STUZZM5B.js";import{a as q}from"./chunk-HKYVP2Q6.js";import{b as ee}from"./chunk-PCGBM2D6.js";import"./chunk-OBTT5INC.js";import"./chunk-5BGWNYQS.js";import{a as se}from"./chunk-NA2NEU4V.js";import{a as K,b as Z}from"./chunk-H7WAM5RH.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{a as F}from"./chunk-H5Z54BEU.js";import"./chunk-WES2E4VR.js";import"./chunk-YGGKGZO2.js";import"./chunk-5S74Z6Y4.js";import"./chunk-GS5ZRTUG.js";import"./chunk-MPT3R4BL.js";import"./chunk-KN6VPARZ.js";import"./chunk-MDD5ORB6.js";import"./chunk-MLFJU2US.js";import"./chunk-52PFWQMU.js";import"./chunk-OMNKD7WW.js";import{e as Q}from"./chunk-PS2B6THP.js";import"./chunk-YPYROPQF.js";import"./chunk-GXL4NMHR.js";import{c as B,d as Y}from"./chunk-PQWANILR.js";import{a as X}from"./chunk-BU7IZLKB.js";import{a as V,b as J}from"./chunk-S5PL5DFQ.js";import{N as k}from"./chunk-DDH3FP4G.js";import"./chunk-756K3LJY.js";import{c as G}from"./chunk-RQ7JJ7GV.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import{a as n}from"./chunk-EI7MMDWY.js";import{Type as Re}from"typebox";var ce=["read","search","write","replace","insert","delete","copy","move","diff"],de={read:["path"],search:["path"],write:["path"],replace:["path"],insert:["path"],delete:["path"],copy:["path","target"],move:["path","target"],diff:["before","after"]},ue=new Set(["read","search","diff"]),pe="pi-agent-ide/standalone-reservation/v1",m=n(a=>a!==null&&typeof a=="object"&&!Array.isArray(a),"record"),fe=n(a=>a.startsWith("pi-agent-ide/operation-approval/")||a.startsWith("pi-agent-ide/settings/"),"shared");function me(a,h){let d=h.namespace.name;if(!/^[a-z][a-z0-9_]*$/u.test(d))throw new Error("Resource host namespace must be a lowercase identifier.");let w=new Set(h.tools??ce);if([...w].some(e=>!ce.includes(e)))throw new Error("Unsupported resource host tool.");let p={namespace:d,claimed:!1};if(a.events.emit(pe,p),p.claimed)throw new Error(`Resource host namespace already registered: ${d}`);let A=a.events.on(pe,e=>{m(e)&&e.namespace===d&&(e.claimed=!0)}),R=new Map,u=new Set,g=[A],S=new Map,I=new Map,C=new Set,E=!1,D,_,y=n(e=>`${d}_${e}`,"publicName"),b=n(e=>typeof e=="string"&&e.startsWith(d+"_")&&w.has(e.slice(d.length+1))?e.slice(d.length+1):void 0,"localName"),H=n(e=>e.replace(/\b(?:read|search|select|write|replace|insert|delete|copy|move|diff)\b/gu,(o,t)=>{let s=e.slice(0,t),r=e.slice(t+o.length);return s.endsWith("tools.")||s.endsWith("`")&&/^[`.]/u.test(r)||/(?:\bUse|\band) $/u.test(s)&&r.startsWith(" to ")?y(o):o}),"words");function U(e,o){let t=e.startsWith("raw:")&&!o?e.slice(4):e;return!o&&(t.startsWith("docs:")||t.startsWith("temp:"))?!0:/^[a-z][a-z\d+.-]*:\/\//iu.test(t)&&!/^(?:file:|[a-z]:[/\\])/iu.test(t)&&h.ownsSource(t)}n(U,"owns");let j=n(()=>k(_),"targets");async function x(e,o,t){let s=j().source(e,o.cwd,!t);if(Array.isArray(s)){for(let r of s)await x(r,o,t);return}if(m(s)&&"path"in s){await x(s.path,o,t);return}if(typeof s!="string")throw new Error("Use an owned resource URI or an issued source result.");if(s.startsWith("RESULT#")){let r=j().resolve(s,o.cwd);if(r.targets.some(f=>!U(f.source,t)))throw new Error("Source selection belongs outside this resource host.");await j().verify(r,o.signal);return}if(s.startsWith("SEARCH#")){let r=await D?.read({path:s},{cwd:o.cwd,signal:o.signal},"script");if(r?.isError||r?.script?.kind!=="text"||!r.script.target)throw new Error("Unknown or expired resource search selection.");await x(r.script.target,o,t);return}if(!U(s,t))throw new Error("Use this host only for its provider-owned resource URIs; local paths are not supported.")}n(x,"checkSource");async function M(e,o,t){if(E)throw new Error("Standalone resource host is closed.");if(!m(o))throw new Error("Resource tool arguments must be an object.");let s=!ue.has(e),r=de[e]??[];if(["read","search"].includes(e)&&o.path===void 0)throw new Error("Supply an explicit owned resource or source result.");if(s&&o.path===void 0){let f=oe(_)?.source;if(!f)throw new Error("Supply an owned source before editing.");await x(f,t,!0)}for(let f of r)o[f]!==void 0&&await x(o[f],t,s);for(let f of["start","end","anchor","targetStart","targetEnd"]){let c=o[f];typeof c=="string"&&/^(?:RESULT#|SEARCH#|<system-result)/u.test(c)&&await x(c,t,s)}if(e==="write"&&typeof o.content!="string")throw new Error("Standalone resource Write accepts text/JSON content, not filesystem image writes.")}n(M,"validate");let P=n((e,o)=>a.on(e,async(t,s)=>await o({...t},s)),"subscribe");g.push(P("tool_call",async(e,o)=>{let t=b(e.toolName);if(t)try{await M(t,e.input,o)}catch(s){return{block:!0,reason:s instanceof Error?s.message:String(s)}}}));let ge=n((e,o)=>{let t=o;if(e==="session_shutdown")return u.add(t),()=>{u.delete(t)};let s=P(e,async(r,f)=>{if(E)return;let c=r;if(e.startsWith("tool_")){let i=b(r.toolName);if(i)typeof r.parentToolCallId=="string"&&C.add(r.parentToolCallId),c={...r,toolName:i};else if(typeof r.toolCallId=="string"&&C.has(r.toolCallId))c={...r,toolName:r.toolName==="codemode"?"codemode":"__standalone_parent"};else return}if(e==="message_end"){if(!m(r.message)||r.message.role!=="toolResult")return;let i=b(r.message.toolName);if(!i)return;c={...r,message:{...r.message,toolName:i}}}e==="context"&&Array.isArray(r.messages)&&(c={...r,messages:r.messages.map(i=>m(i)&&typeof i.toolName=="string"?{...i,toolName:b(i.toolName)??"__outside_resource_host"}:i)});let l=await t(c,f);if(!m(l))return l;if(e==="message_end"&&m(l.message)&&m(r.message))return{...l,message:{...l.message,toolName:r.message.toolName}};if(e==="context"&&Array.isArray(l.messages)&&Array.isArray(r.messages)){let i=r.messages;if(l.messages.length!==i.length)throw new Error("Resource host context handlers must preserve message positions.");return{...l,messages:l.messages.map((N,O)=>{let T=i[O];return m(N)&&m(T)&&typeof T.toolName=="string"?{...N,toolName:T.toolName}:N})}}return l});return g.push(s),s},"on"),he={emit(e,o){if(E)throw new Error("Standalone resource host is closed.");if(fe(e))a.events.emit(e,o);else for(let t of R.get(e)??[])t(o)},on(e,o){if(fe(e)){let s=a.events.on(e,o);return g.push(s),s}let t=R.get(e);return t||R.set(e,t=new Set),t.add(o),()=>{t.delete(o)}}};function W(e){return Array.isArray(e)?e.map(W):m(e)?Object.fromEntries(Object.entries(e).map(([o,t])=>[o,o==="description"&&typeof t=="string"?H(t):W(t)])):e}n(W,"descriptions");function we(e){return{...e,tools:e.tools.flatMap(o=>{let t=b(o.name);return t?[{...o,name:t}]:[]}),executeTool(o,t,s){if(!w.has(o))throw new Error("Tool is not owned by this resource host.");return e.executeTool(y(o),t,s)}}}n(we,"toolContext"),_={...a,events:he,on:ge,registerTool:n(e=>{let o=e.name;if(!w.has(o))return;let t=Object.getOwnPropertyDescriptors(e);t.name={value:y(o),enumerable:!0,configurable:!0},t.label={value:y(o),enumerable:!0,configurable:!0},t.namespace={value:h.namespace,enumerable:!0,configurable:!0},t.exposure={value:"deferred",enumerable:!0,configurable:!0},t.description={get:n(()=>`Use ${y(o)} to ${o==="read"?"inspect provider-owned resources and packaged guides":o==="search"?"find objects or text within an explicit provider-owned resource":`${o} provider-owned text resources`}.`,"get"),enumerable:!0,configurable:!0},t.promptSnippet={get:n(()=>H(e.promptSnippet??""),"get"),enumerable:!0,configurable:!0},t.promptGuidelines={get:n(()=>[...(e.promptGuidelines??[]).map(H),"Use only this namespace's owned resource URIs and issued results. Local filesystem paths are not supported."],"get"),enumerable:!0,configurable:!0},t.parameters={get:n(()=>{let c=W(e.parameters),l=m(c.properties)?{...c.properties}:{};for(let i of de[o]??[])m(l[i])&&(l[i]={...l[i],description:"Provider-owned resource URI, unchanged source result, or an issued reference."});return o==="write"&&(l.content=Re.String({description:"Complete text/Markdown or JSON payload for the selected provider resource."})),Object.assign({},e.parameters,c,{properties:l})},"get"),enumerable:!0,configurable:!0};let s=n(async(c,l,i,N,O)=>{if(E)throw new Error("Standalone resource host is closed.");let T=new AbortController,L=n(()=>{},"finish"),ye=new Promise(v=>{L=v});S.set(T,ye);let be=[i,O.signal,T.signal].filter(v=>v!==void 0),$=AbortSignal.any(be);try{let v={...we(O),signal:$};return await M(o,l,v),$.throwIfAborted(),await e.execute(c,l,$,N,v)}finally{S.delete(T),L()}},"execute");t.execute={value:s,enumerable:!0,configurable:!0};let r=n((c,l,i)=>!ue.has(o)&&e.renderCall?e.renderCall(c,l,i):Q(i.lastComponent,{tool:y(o),primary:{text:m(c)?String(c.path??c.query??"owned resource"):"owned resource",truncate:"end"},expanded:i.expanded},l),"renderCall");t.renderCall={value:r,enumerable:!0,configurable:!0};let f=Object.defineProperties({},t);I.set(o,()=>a.registerTool({...f,exposure:"hidden"})),a.registerTool(f)},"registerTool"),getActiveTools:n(()=>a.getActiveTools().flatMap(e=>{let o=b(e);return o?[o]:[]}),"getActiveTools"),getAllTools:n(()=>a.getAllTools().flatMap(e=>{let o=b(e.name);return o?[{...e,name:o}]:[]}),"getAllTools"),setActiveTools(e){let o=a.getActiveTools().filter(t=>!b(t));a.setActiveTools([...o,...e.filter(t=>w.has(t)).map(y)])}},g.push(P("session_start",()=>{C.clear(),!(a.getSettings().defaultTools??[]).includes("-tool_search")&&a.getAllTools().some(e=>e.name==="tool_search"&&e.exposure!=="hidden")&&!a.getActiveTools().includes("tool_search")&&a.setActiveTools([...a.getActiveTools(),"tool_search"])})),g.push(P("agent_end",()=>{C.clear()}));async function z(e,o=!0){if(E)return;E=!0;for(let r of S.keys())r.abort();await Promise.all(S.values());let t=await Promise.allSettled([...u].map(r=>r({type:"session_shutdown"},e)));for(let r of g)r();if(R.clear(),u.clear(),C.clear(),o)for(let r of I.values())r();I.clear();let s=t.find(r=>r.status==="rejected");if(s?.status==="rejected")throw s.reason}return n(z,"dispose"),g.push(P("session_shutdown",(e,o)=>z(o,!1))),{api:_,owns:U,tools:[...w].map(y),dispose:z,setApi(e){_=e},setRead(e){D=e}}}n(me,"createResourceHostApi");async function Se(a,h){G(a);let d=me(a,h),w=F(d.api,{resourceOutput:!0,promptSection:`resource_${h.namespace.name}_results`}),p=w.api;d.setApi(p);try{await Z(p);let A;await X(p,{protocol:V,apiVersion:J,id:"standalone-resource-boundary",setup(u){A=u,d.setRead(u),u.addResourceGuard({id:"standalone-resource-boundary",guard:n(g=>d.owns(g.resourceSource,!1)?{kind:"accepted"}:{kind:"rejected",reason:"Resource belongs outside this standalone host."},"guard")}),u.addHandler({stage:"post-read",handler:K(k(p),u.read,g=>d.owns(g,!0))})}}),await q(p);let R=await te(p);if(await R.registerPlugin({protocol:B,apiVersion:Y,id:"standalone-resource-boundary",setup(u){u.addMutationGuard({id:"standalone-resource-boundary",guard:n(g=>g.resources.every(S=>d.owns(S.source,!0)&&S.binary===void 0)?{kind:"accepted"}:{kind:"rejected",rejection:{code:"RESOURCE_HOST_BOUNDARY",reason:"Resource belongs outside this standalone host.",message:"Use this host only for its provider-owned text resources.",effect:"not-applied"}},"guard")})}}),await se(p),await ne(p),await ae(p),await ee(p),!A)throw new Error("Standalone Read host did not initialize.");return await le(p,{recordType:`agent-documentation-read/${h.namespace.name}`,ownsTool:n(u=>typeof u=="string"&&d.tools.includes(u),"ownsTool")}),await ie(p,{preferences:{},toolName:n(u=>`${h.namespace.name}_${u}`,"toolName")}),re(p,R),w.finalize(),{api:p,tools:d.tools,dispose:n(u=>d.dispose(u),"dispose")}}catch(A){throw await d.dispose(),A}}n(Se,"createStandaloneResourceHost");export{Se as createStandaloneResourceHost};
|
package/dist/entry-1.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d
|
|
1
|
+
import{a,b,c,d}from"./chunk-TSQ6FBTB.js";import"./chunk-EI7MMDWY.js";export{c as IDE_CAPABILITIES_READY,b as IDE_CAPABILITIES_REGISTER,a as IDE_CAPABILITIES_VERSION,d as registerIdeCapability};
|
package/dist/entry-10.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a,b,c,d,e,f,g}from"./chunk-57F5GTHO.js";import"./chunk-EI7MMDWY.js";export{c as TIP_API_VERSION,d as TIP_CORE_READY_EVENT,b as TIP_PROTOCOL,e as TIP_PROVIDER_REGISTER_EVENT,a as connectTipProvider,f as isTipCoreReady,g as isTipProviderRegistrationRequest};
|
package/dist/entry-11.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{a}from"./chunk-57F5GTHO.js";import"./chunk-EI7MMDWY.js";export{a as connectTipProvider};
|
package/dist/entry-12.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as h,b as i,c as j,d as k}from"./chunk-B25LXXNV.js";import"./chunk-7D7PXIVV.js";import"./chunk-BXGMMZT3.js";import{a,b,c,d,e,f,g}from"./chunk-MLFJU2US.js";import"./chunk-756K3LJY.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{c as DOCTOR_API_VERSION,d as DOCTOR_CORE_READY_EVENT,e as DOCTOR_PLUGIN_REGISTER_EVENT,b as DOCTOR_PROTOCOL,a as DOCTOR_TOOL_PATH_KEYS,j as doctorExecutableAvailable,i as doctorProcessAccess,h as doctorRuntimeOptions,f as isDoctorCoreReady,g as isDoctorPluginRegistrationRequest,k as withDoctorProbeCopy};
|
package/dist/entry-13.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-MPT3R4BL.js";import{a,b,c,d,e,f,g}from"./chunk-KN6VPARZ.js";import"./chunk-EI7MMDWY.js";export{b as DOCUMENTATION_API_VERSION,a as DOCUMENTATION_PROTOCOL,c as DOCUMENTATION_READY_EVENT,d as DOCUMENTATION_REGISTER_EVENT,g as connectAgentDocumentation,e as createPackagedAgentGuideLoader,f as loadPackagedAgentGuide};
|
package/dist/entry-14.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a as o}from"./chunk-MDD5ORB6.js";import"./chunk-MLFJU2US.js";import"./chunk-EI7MMDWY.js";export{o as connectDoctorPlugin};
|
package/dist/entry-15.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-3PMHFEJY.js";import"./chunk-XCPIIDFS.js";import"./chunk-NNCZYO4Q.js";import"./chunk-IQD6PON5.js";import"./chunk-52PFWQMU.js";import"./chunk-OMNKD7WW.js";import"./chunk-PS2B6THP.js";import"./chunk-YPYROPQF.js";import{a as l}from"./chunk-GXL4NMHR.js";import{c as a,d as s}from"./chunk-PQWANILR.js";import{a as p}from"./chunk-BU7IZLKB.js";import{a as u,b as y}from"./chunk-S5PL5DFQ.js";import"./chunk-DDH3FP4G.js";import"./chunk-756K3LJY.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import{a as d}from"./chunk-EI7MMDWY.js";function x(o,e){return c(e),l(o,{protocol:a,apiVersion:s,id:`hook/before-delete/${e.id}`,setup(t){t.addDeleteGuard({id:e.id,guard:d(n=>e.run(n),"guard")})}})}d(x,"connectBeforeDeleteHook");function m(o,e){return c(e),p(o,{protocol:u,apiVersion:y,id:`hook/before-read/${e.id}`,setup(t){t.addResourceGuard({id:e.id,async guard(n){let r=await e.run(n);return r.decision==="allow"?{kind:"accepted"}:{kind:"rejected",reason:r.reason}}})}})}d(m,"connectBeforeReadHook");function A(o,e){return c(e),l(o,{protocol:a,apiVersion:s,id:`hook/before-edit/${e.id}`,setup(t){t.addMutationGuard({id:e.id,async guard(n,r){let f=await e.run({cwd:r.cwd,intent:r.intent??"edit",resources:n.resources.map(i=>({resourceSource:i.source,existed:i.existed,before:i.before,after:i.after,changes:i.changes,...i.binary===void 0?{}:{binary:i.binary}})),...r.signal!==void 0&&{signal:r.signal}});return f.decision==="allow"?{kind:"accepted"}:{kind:"rejected",rejection:{code:"MUTATION_REJECTED",reason:f.reason,message:`Edit blocked by hook ${e.id}: ${f.reason}`,effect:"not-applied"}}}})}})}d(A,"connectBeforeEditHook");function v(o,e){return c(e),l(o,{protocol:a,apiVersion:s,id:`hook/after-edit/${e.id}`,setup(t){t.onDidEdit(async n=>{if(n.postProcessing!=="deferred")try{return await e.run(n)}catch(r){return{feedback:`After-edit hook ${e.id} failed after the edit was saved: ${r instanceof Error?r.message:String(r)}`,tone:"error"}}})}})}d(v,"connectAfterEditHook");function c(o){if(o.id.trim().length===0||typeof o.run!="function")throw new TypeError("A file hook needs a non-empty id and run function")}d(c,"assertHook");export{v as connectAfterEditHook,x as connectBeforeDeleteHook,A as connectBeforeEditHook,m as connectBeforeReadHook};
|
package/dist/entry-16.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a}from"./chunk-K5G4FDXD.js";import"./chunk-EI7MMDWY.js";export{a as sameFilePath};
|
package/dist/entry-17.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import"./chunk-3PMHFEJY.js";import{a as u}from"./chunk-XCPIIDFS.js";import"./chunk-NNCZYO4Q.js";import{a as i,h as j,i as k,j as l,k as m,l as n,m as o,n as p,o as q,p as r}from"./chunk-52PFWQMU.js";import{b as s,d as t}from"./chunk-OMNKD7WW.js";import"./chunk-PS2B6THP.js";import{a as h}from"./chunk-BU7IZLKB.js";import{a,b,c,d,e,f,g}from"./chunk-S5PL5DFQ.js";import"./chunk-DDH3FP4G.js";import"./chunk-756K3LJY.js";import"./chunk-VDJSH3DQ.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{s as COMPACT_READ_ROWS,b as READ_API_VERSION,c as READ_CORE_READY_EVENT,d as READ_PLUGIN_REGISTER_EVENT,a as READ_PROTOCOL,h as connectReadPlugin,u as createJqReadHandler,t as createReadResultRenderer,q as isFragmentResolverRegistration,e as isReadCoreReady,r as isReadFragmentResolution,o as isReadHandlerRegistration,f as isReadPlugin,g as isReadPluginRegistrationRequest,p as isReadViewRegistration,n as isResourceResolverRegistration,m as isTextTargetResolverRegistration,j as readDataSchema,k as readOutputSchema,i as readParameters,l as structuredRead};
|
package/dist/entry-18.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as r}from"./chunk-XE4W5YTE.js";import{a as e}from"./chunk-RIOPUTUJ.js";import"./chunk-EI7MMDWY.js";export{r as createImageContentConverter,e as createPdfContentConverter};
|
package/dist/entry-19.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b,k as c,l as d,m as g,n as h,o as i,p as j,q as k,r as l,s as n,t as q,u as s}from"./chunk-
|
|
1
|
+
import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b,k as c,l as d,m as g,n as h,o as i,p as j,q as k,r as l,s as n,t as q,u as s,v as u,w as v,x as w,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,c as MAX_STRUCTURED_BYTES,x as ResourceError,o as ResourceScheduler,O as ResultImageStore,L as ResultTargetStore,f as TempResourceStore,z as UnsupportedContentError,d as assertJsonData,J as connectContentConverter,P as connectResultImages,N as connectResultTargets,I as createContentHost,A as createContentRunner,j as isAgentContent,w as isContentConversionAttempt,u as isContentConversionContext,v as isContentConverter,y as isContentConverterRegistration,H as isContentConverterRegistrationRequest,G as isContentHostReady,s as isContentInput,q as isContentTarget,k as isResource,n as isResourceResolutionAttempt,l as isResourceResolver,i as renderContentDescription,e as resourceAccesses,p as resourceErrorMetadata,t as resourceErrorMetadataOf,m as resourceErrorMetadataSchema,r as resourceScheduler,g as resultError,a as resultErrorSchema,K as resultInputSchema,b as structuredResultSchema,B as targetsEqual,M as verifyResultTargets,h as withStructuredResult};
|
package/dist/entry-2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a,b,c,d,e,f}from"./chunk-OJEIX7OZ.js";import"./chunk-EI7MMDWY.js";export{c as SETTINGS_READY_EVENT,b as SETTINGS_READ_EVENT,a as SETTINGS_REGISTER_EVENT,e as readAgentIdeSetting,d as registerAgentIdeSettings,f as validateAgentIdeSettings};
|
package/dist/entry-20.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import{a as g,b as h,c as i,d as j,e as k,f as l,g as n,h as q,i as s,j as u}from"./chunk-FYOU4RBH.js";import{b as x,c as a,d as b,e as c}from"./chunk-7PVDTMEM.js";import{a as d}from"./chunk-47SPPIXK.js";import{a as o,b as r,c as e,d as f,e as m,f as p,g as t}from"./chunk-VAXLSPPU.js";import"./chunk-PS2B6THP.js";import"./chunk-DDH3FP4G.js";import"./chunk-EI7MMDWY.js";export{n as FuzzyVocabulary,r as SEARCH_API_VERSION,e as SEARCH_CORE_READY_EVENT,f as SEARCH_PLUGIN_REGISTER_EVENT,o as SEARCH_PROTOCOL,d as connectSearchPlugin,h as containsSearchMatch,u as formatFuzzyCandidate,s as fuzzyCandidateData,j as fuzzyLimits,l as isFuzzyQuery,k as isFuzzyResultData,m as isSearchCoreReady,p as isSearchPlugin,t as isSearchPluginRegistrationRequest,q as rankFuzzyIdentifiers,g as renderSearchMatches,x as searchDataSchema,a as searchOutputSchema,c as searchSchema,b as selectionData,i as splitGlobList};
|
package/dist/entry-21.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b,k as c,l as d,m as g,n as h,o as i,p as j,q as k,r as l,s as n,t as q,u as s}from"./chunk-VDJSH3DQ.js";import"./chunk-EI7MMDWY.js";export{o as TextAnchor,r as attachTextAnchorRenderer,j as createTextContentConverter,g as createTextDocument,e as getTextAnchorRenderer,a as getTextSourceLine,t as isTextAnchorRecoveryOutcome,p as isTextAnchorResolutionAttempt,m as isTextAnchorResolver,c as isTextLinePresenter,d as isTextPresenterRegistration,n as isTextTargetResolutionAttempt,k as isTextualMediaType,i as renderPresentedTextDocument,x as renderPresentedTextRows,f as renderTextAnchor,h as renderTextDocument,s as restoreText,q as storeText,l as textFromAgentContent,b as withTextSourceLine};
|
package/dist/entry-22.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-IQD6PON5.js";import{m as q}from"./chunk-YPYROPQF.js";import{a as p}from"./chunk-GXL4NMHR.js";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-ZC65Z3CK.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,p as connectTextEditorPlugin,q as connectTextEditorPostEditHandler,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-24.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import"./chunk-K4ZMRDEI.js";
|
package/dist/entry-25.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a}from"./chunk-MDD5ORB6.js";import"./chunk-MLFJU2US.js";import"./chunk-EI7MMDWY.js";export{a as connectDoctorPlugin};
|
package/dist/entry-26.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b
|
|
1
|
+
import{a,b}from"./chunk-BXGMMZT3.js";import"./chunk-EI7MMDWY.js";export{b as hasProjectMarker,a as inspectRecipeEvidence};
|
package/dist/entry-27.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-756K3LJY.js";import"./chunk-EI7MMDWY.js";export{d as isExecutableAvailable,b as normalizeProcessEnvironment,e as probeExecutable,a as projectExecutableDirectories,c as projectProcessEnvironment};
|
package/dist/entry-28.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c
|
|
1
|
+
import{a,b,c}from"./chunk-R2U5WXYR.js";import"./chunk-756K3LJY.js";import"./chunk-EI7MMDWY.js";export{b as probeProjectExecutable,c as projectExecutableAvailable,a as projectFileExists};
|
package/dist/entry-29.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a
|
|
2
|
-
`)}]}s(q,"readDirectoryContent");async function J(e,t,r,o){g(r);let n=await $(e,{encoding:null,...r!==void 0&&{signal:r}});return g(r),o(n),t.convert({source:e,bytes:n},r===void 0?{}:{signal:r})}s(J,"readFilesystemContent");function K(e){return/^[A-Za-z]:[\\/]/u.test(e)||e.startsWith("file://")?!0:!/^[A-Za-z][A-Za-z\d+.-]*:/u.test(e)}s(K,"isFilesystemSource");function g(e){if(e?.aborted===!0)throw H()}s(g,"throwIfAborted");function H(){let e=new Error("The operation was aborted");return e.name="AbortError",e}s(H,"abortError");import{execFile as Q}from"node:child_process";import{existsSync as Y}from"node:fs";import{realpath as L}from"node:fs/promises";import ee from"node:os";import u from"node:path";import{fileURLToPath as te}from"node:url";async function N(e,t){let r=e.cause,o=Date.now()+500;if(t.signal?.aborted||e.source===void 0||typeof r!="object"||r===null||!("code"in r)||r.code!=="ENOENT")return;let n=e.source.startsWith("file://")?te(e.source):e.source,i=u.relative(t.cwd,u.resolve(t.cwd,n));if(!w(i)||i.includes("#"))return;let m=u.basename(i).toLowerCase();if(m.length<3||m.length>160)return;let c=u.join(process.env.PI_CODING_AGENT_DIR??u.join(ee.homedir(),".pi","agent"),"bin",process.platform==="win32"?"rg.exe":"rg"),b=await new Promise(a=>{Q(Y(c)?c:"rg",["--files","--hidden","--no-config","--no-ignore-parent","--null","--glob","!.git/**"],{cwd:t.cwd,timeout:250,maxBuffer:2*1024*1024,...t.signal===void 0?{}:{signal:t.signal}},(d,R)=>a(d?[]:R.split("\0").filter(Boolean).slice(0,2e4)))}),p=Math.min(3,Math.max(1,Math.floor(m.length*.2))),f=b.flatMap(a=>{if(t.signal?.aborted||Date.now()>o||!w(a))return[];let d=u.basename(a).toLowerCase();if(d.length>160||Math.abs(d.length-m.length)>p)return[];let R=re(m,d);if(R>p)return[];let M=u.dirname(i).toLowerCase(),U=u.dirname(a).toLowerCase();return[{path:a,distance:R,directoryDistance:M===U?0:1}]}).sort((a,d)=>a.distance-d.distance||a.directoryDistance-d.directoryDistance||a.path.localeCompare(d.path)),l=[],h=await L(t.cwd);for(let a of f.slice(0,20)){if(t.signal?.aborted||Date.now()>o)return;try{let d=await L(u.resolve(t.cwd,a.path));w(u.relative(h,d))&&l.push({path:a.path})}catch{}if(l.length===3)break}return l.length?l:void 0}s(N,"recoverFilesystemPath");function w(e){return e!==""&&!/^\.\.(?:[\\/]|$)/u.test(e)&&!u.isAbsolute(e)}s(w,"insideWorkspace");function re(e,t){let r=Array.from({length:t.length+1},(o,n)=>n);for(let o=1;o<=e.length;o++){let n=[o];for(let i=1;i<=t.length;i++)n[i]=Math.min(y(n[i-1])+1,y(r[i])+1,y(r[i-1])+(e[o-1]===t[i-1]?0:1));r=n}return y(r[t.length])}s(re,"editDistance");var ne={provider:"filesystem",capability:"read"},oe={provider:"filesystem",capability:"write"},ie=A({kind:"source",nativeResources:!0});async function se(e){let t=v(e,ne),r=v(e,oe),o=S(t),n=_(r),i={protocol:C,apiVersion:P,id:"filesystem",setup(c){c.addResolver({resolver:o,renderResult:ie,recoverFailure:N}),c.describe({path:s(()=>E("File path \u2014 file content; directory path \u2014 entry listing. Relative, absolute and file:// paths accepted.",t.listDescriptions()),"path")})}},m={protocol:D,apiVersion:k,id:"filesystem",setup(c){c.addResolver({resolver:n})}};await Promise.all([T(e,i),I(e,m)])}s(se,"registerFilesystemPlugin");export{se as default};
|
|
1
|
+
import{a,b,c,d,e,f,g}from"./chunk-MLFJU2US.js";import"./chunk-EI7MMDWY.js";export{c as DOCTOR_API_VERSION,d as DOCTOR_CORE_READY_EVENT,e as DOCTOR_PLUGIN_REGISTER_EVENT,b as DOCTOR_PROTOCOL,a as DOCTOR_TOOL_PATH_KEYS,f as isDoctorCoreReady,g as isDoctorPluginRegistrationRequest};
|
package/dist/entry-3.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{c as p,d as e}from"./chunk-RQ7JJ7GV.js";import"./chunk-EI7MMDWY.js";export{e as confirmOperation,p as registerOperationApproval};
|
package/dist/entry-30.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a,b,c,d,e,f,g}from"./chunk-KN6VPARZ.js";import"./chunk-EI7MMDWY.js";export{b as DOCUMENTATION_API_VERSION,a as DOCUMENTATION_PROTOCOL,c as DOCUMENTATION_READY_EVENT,d as DOCUMENTATION_REGISTER_EVENT,g as connectAgentDocumentation,e as createPackagedAgentGuideLoader,f as loadPackagedAgentGuide};
|
package/dist/entry-31.js
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`);
|
|
3
|
-
`,e);e=a<0?n.length:a+1;continue}if(s==='"')t.push("string");else if(s==="(")t[t.length-1]=(i??0)+1;else if(s===")")t.length>1&&i===0?t.pop():t[t.length-1]=Math.max(0,(i??0)-1);else if(/[A-Za-z_]/u.test(s??"")){let a=e;for(;/[A-Za-z0-9_]/u.test(n[e]??"");)e+=1;let l=n.slice(a,e),u=B(n,e),f=r==="."||r==="$",c=u.startsWith(":")&&!u.startsWith("::");if(!f&&!c&&(l==="include"||l==="import"||l==="modulemeta"))return!0;r=l;continue}s!==void 0&&!/\s/u.test(s)&&(r=s),e+=1}return!1}d(V,"hasModuleOperation");function B(n,t){let e=t;for(;e<n.length;)if(/\s/u.test(n[e]??""))e+=1;else if(n[e]==="#"){let r=n.indexOf(`
|
|
4
|
-
`,e);e=r<0?n.length:r+1}else break;return n.slice(e,e+2)}d(B,"nextCode");function N(n){let t=h(n,process.env),e={};for(let r of["PATH","PATHEXT","SystemRoot","SYSTEMROOT","WINDIR"])t[r]!==void 0&&(e[r]=t[r]);return e}d(N,"safeEnvironment");async function $(n){x(n,[await b({id:"json-reading",description:"Query and transform JSON resources with jq read views",triggers:[{tool:"read",viewPrefixes:["jq:"]}]})]),await Promise.all([R(n,M),P(n,U)])}d($,"registerFilesystemJq");var M={protocol:O,apiVersion:T,id:"filesystem-jq",setup(n){n.addView({view:"jq",presenter:{id:"filesystem-jq",present:d(t=>t,"present")}}),n.addHandler({stage:"read",when:{resolvedBy:"any",contentKind:"text"},async handler(t){let e=t.state;if(e?.contentKind!=="text"||e.resolvedBy!=="filesystem"&&e.resolvedBy!=="ssh")return{kind:"continue",context:t};let r;try{r=_(t.request.views)}catch(a){return J(e,a instanceof Error?a.message:String(a))}if(r===void 0)return{kind:"continue",context:t};let s;try{s=await k(r.filter,e.content[0].text,{cwd:t.resolverContext.cwd,...t.resolverContext.signal===void 0?{}:{signal:t.resolverContext.signal}})}catch(a){return J(e,a instanceof Error?a.message:String(a))}let i={...e,content:[{type:"text",text:s}],text:q(e.source,s),preserveTruncatedOutput:!0};return{kind:"continue",context:{...t,sourceText:void 0,state:i}}}}),n.describe({views:'jq:<filter> \u2014 query local JSON text with the installed jq executable, e.g. ["jq:.scripts | keys"]. Exactly one non-empty jq filter is required; it cannot be combined with other views. offset/limit apply to the transformed output, not original source lines.'})}};function J(n,t){return{kind:"return",result:{content:[{type:"text",text:`jq failed: ${t}`}],details:{source:n.source,resolvedBy:n.resolvedBy,failure:{code:"READ_FAILED",source:n.source,resolverId:n.resolvedBy,pluginId:"filesystem-jq",stage:"read",message:t}},isError:!0}}}d(J,"jqFailure");var U={protocol:y,apiVersion:E,id:"filesystem-jq",setup(n){n.addSetupCheck({id:"jq",async inspect(t){return await j("jq",t.workspace?process.cwd():t.cwd,t.workspace?process.env:t.env,t.signal)?{}:{actions:[{id:"jq-unavailable",message:"JSON jq views are unavailable because jq was not found"}]}}}),n.addCheck({id:"jq",title:"JSON jq views",async run(t){t.signal?.throwIfAborted();let e=await v("jq",["--version"],t.workspace?process.cwd():t.cwd,t.workspace?process.env:t.env,t.signal);return t.signal?.throwIfAborted(),[e.ok?{status:"pass",message:"jq is available",detail:t.workspace?`Controller content adapter: ${e.detail}`:e.detail}:{status:"fail",message:"jq is not available",detail:e.detail}]}})}};export{$ as default};
|
|
1
|
+
import"./chunk-NNCZYO4Q.js";import{d as k}from"./chunk-OMNKD7WW.js";import"./chunk-PS2B6THP.js";import{a as I}from"./chunk-GXL4NMHR.js";import{c as E,d as D}from"./chunk-PQWANILR.js";import{a as T}from"./chunk-BU7IZLKB.js";import{a as C,b as P}from"./chunk-S5PL5DFQ.js";import{I as v,o as F}from"./chunk-DDH3FP4G.js";import{r as A}from"./chunk-VDJSH3DQ.js";import{a as y}from"./chunk-ZC65Z3CK.js";import{a as s}from"./chunk-EI7MMDWY.js";import{readdirSync as W,realpathSync as B,statSync as V}from"node:fs";import{mkdir as j,readFile as $,writeFile as z}from"node:fs/promises";import O from"node:path";import{fileURLToPath as Z,pathToFileURL as G}from"node:url";function S(e){return x("read",e)}s(S,"createFilesystemReadResolver");function _(e){return x("write",e)}s(_,"createFilesystemWriteResolver");function x(e,t){return{id:"filesystem",tryResolve(r,o){return Promise.resolve(X(r,o,e,t))}}}s(x,"createFilesystemResolver");function X(e,t,r,o){if(e.length===0)return{kind:"failed",error:new TypeError("Filesystem source must not be empty")};if(!K(e))return{kind:"not-handled"};if(t.signal?.aborted===!0)return{kind:"failed",error:H()};let n=e.startsWith("file://")?B(Z(new URL(e))):O.resolve(t.cwd,e),i=G(n).href,m=(()=>{try{return V(n).isDirectory()}catch{return!1}})(),c,p={source:n,link:i,read:s(async({signal:f})=>(c=void 0,m?q(n,f):J(n,o,f,l=>{c=l})),"read"),get sourceBytes(){return c}};return r==="read"||m?{kind:"resolved",resource:p}:{kind:"resolved",resource:{...p,get sourceBytes(){return c},async write(f,l){g(l.signal);let h=A(f);await j(O.dirname(n),{recursive:!0}),g(l.signal),await z(n,h,{encoding:"utf8",...l.signal!==void 0&&{signal:l.signal}})}}}}s(X,"resolveFilesystemSource");function q(e,t){g(t);let r=W(e,{withFileTypes:!0}),o=[`\u{1F4C1} ${e}/`];r.length>0&&o.push("");for(let n of r){let i=n.isDirectory()?"\u{1F4C1}":n.isFile()?"\u{1F4C4}":"\u{1F517}";o.push(` ${i} ${n.name}`)}return[{type:"text",text:o.join(`
|
|
2
|
+
`)}]}s(q,"readDirectoryContent");async function J(e,t,r,o){g(r);let n=await $(e,{encoding:null,...r!==void 0&&{signal:r}});return g(r),o(n),t.convert({source:e,bytes:n},r===void 0?{}:{signal:r})}s(J,"readFilesystemContent");function K(e){return/^[A-Za-z]:[\\/]/u.test(e)||e.startsWith("file://")?!0:!/^[A-Za-z][A-Za-z\d+.-]*:/u.test(e)}s(K,"isFilesystemSource");function g(e){if(e?.aborted===!0)throw H()}s(g,"throwIfAborted");function H(){let e=new Error("The operation was aborted");return e.name="AbortError",e}s(H,"abortError");import{execFile as Q}from"node:child_process";import{existsSync as Y}from"node:fs";import{realpath as L}from"node:fs/promises";import ee from"node:os";import u from"node:path";import{fileURLToPath as te}from"node:url";async function N(e,t){let r=e.cause,o=Date.now()+500;if(t.signal?.aborted||e.source===void 0||typeof r!="object"||r===null||!("code"in r)||r.code!=="ENOENT")return;let n=e.source.startsWith("file://")?te(e.source):e.source,i=u.relative(t.cwd,u.resolve(t.cwd,n));if(!w(i)||i.includes("#"))return;let m=u.basename(i).toLowerCase();if(m.length<3||m.length>160)return;let c=u.join(process.env.PI_CODING_AGENT_DIR??u.join(ee.homedir(),".pi","agent"),"bin",process.platform==="win32"?"rg.exe":"rg"),b=await new Promise(a=>{Q(Y(c)?c:"rg",["--files","--hidden","--no-config","--no-ignore-parent","--null","--glob","!.git/**"],{cwd:t.cwd,timeout:250,maxBuffer:2*1024*1024,...t.signal===void 0?{}:{signal:t.signal}},(d,R)=>a(d?[]:R.split("\0").filter(Boolean).slice(0,2e4)))}),p=Math.min(3,Math.max(1,Math.floor(m.length*.2))),f=b.flatMap(a=>{if(t.signal?.aborted||Date.now()>o||!w(a))return[];let d=u.basename(a).toLowerCase();if(d.length>160||Math.abs(d.length-m.length)>p)return[];let R=re(m,d);if(R>p)return[];let M=u.dirname(i).toLowerCase(),U=u.dirname(a).toLowerCase();return[{path:a,distance:R,directoryDistance:M===U?0:1}]}).sort((a,d)=>a.distance-d.distance||a.directoryDistance-d.directoryDistance||a.path.localeCompare(d.path)),l=[],h=await L(t.cwd);for(let a of f.slice(0,20)){if(t.signal?.aborted||Date.now()>o)return;try{let d=await L(u.resolve(t.cwd,a.path));w(u.relative(h,d))&&l.push({path:a.path})}catch{}if(l.length===3)break}return l.length?l:void 0}s(N,"recoverFilesystemPath");function w(e){return e!==""&&!/^\.\.(?:[\\/]|$)/u.test(e)&&!u.isAbsolute(e)}s(w,"insideWorkspace");function re(e,t){let r=Array.from({length:t.length+1},(o,n)=>n);for(let o=1;o<=e.length;o++){let n=[o];for(let i=1;i<=t.length;i++)n[i]=Math.min(y(n[i-1])+1,y(r[i])+1,y(r[i-1])+(e[o-1]===t[i-1]?0:1));r=n}return y(r[t.length])}s(re,"editDistance");var ne={provider:"filesystem",capability:"read"},oe={provider:"filesystem",capability:"write"},ie=k({kind:"source",nativeResources:!0});async function se(e){let t=v(e,ne),r=v(e,oe),o=S(t),n=_(r),i={protocol:C,apiVersion:P,id:"filesystem",setup(c){c.addResolver({resolver:o,renderResult:ie,recoverFailure:N}),c.describe({path:s(()=>F("File \u2014 content; directory \u2014 listing.",t.listDescriptions()),"path")})}},m={protocol:E,apiVersion:D,id:"filesystem",setup(c){c.addResolver({resolver:n})}};await Promise.all([T(e,i),I(e,m)])}s(se,"registerFilesystemPlugin");export{se as default};
|
package/dist/entry-32.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-XE4W5YTE.js";import{J as e}from"./chunk-DDH3FP4G.js";import{a as t}from"./chunk-EI7MMDWY.js";var n={target:{provider:"filesystem",capability:"read"},converter:r(),priority:100};async function i(o){await e(o,n)}t(i,"registerFilesystemImage");export{i as default};
|
package/dist/entry-33.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"./chunk-XCPIIDFS.js";import"./chunk-756K3LJY.js";import"./chunk-VDJSH3DQ.js";import"./chunk-EI7MMDWY.js";export{a as createJqReadHandler};
|
package/dist/entry-34.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as
|
|
1
|
+
import{a as f}from"./chunk-XCPIIDFS.js";import{a as p}from"./chunk-MDD5ORB6.js";import{b as l,c as d}from"./chunk-MLFJU2US.js";import{a as n}from"./chunk-BU7IZLKB.js";import{a as r,b as o}from"./chunk-S5PL5DFQ.js";import{d as c,e as u}from"./chunk-756K3LJY.js";import"./chunk-VDJSH3DQ.js";import{a as t}from"./chunk-EI7MMDWY.js";async function m(i){await Promise.all([n(i,w),p(i,g)])}t(m,"registerFilesystemJq");var w={protocol:r,apiVersion:o,id:"filesystem-jq",setup(i){i.addView({view:"jq",presenter:{id:"filesystem-jq",present:t(s=>s,"present")}});let e=f({pluginId:"filesystem-jq",input:t(s=>s.state?.contentKind==="text"?s.state.content[0].text:void 0,"input")});i.addHandler({stage:"read",when:{resolvedBy:"any",contentKind:"text"},handler(s){let a=s.state;return a?.contentKind!=="text"||a.resolvedBy!=="filesystem"&&a.resolvedBy!=="ssh"?{kind:"continue",context:s}:e(s)}}),i.describe({views:"jq:<filter> \u2014 run jq on a JSON file or a resource whose provider supplies JSON (JSONL record by record); use alone; offset and limit apply to its output."})}},g={protocol:l,apiVersion:d,id:"filesystem-jq",setup(i){i.addSetupCheck({id:"jq",async inspect(e){return await c("jq",e.workspace?process.cwd():e.cwd,e.workspace?process.env:e.env,e.signal)?{}:{actions:[{id:"jq-unavailable",message:"JSON jq views are unavailable because jq was not found"}]}}}),i.addCheck({id:"jq",title:"JSON jq views",async run(e){e.signal?.throwIfAborted();let s=await u("jq",["--version"],e.workspace?process.cwd():e.cwd,e.workspace?process.env:e.env,e.signal);return e.signal?.throwIfAborted(),[s.ok?{status:"pass",message:"jq is available",detail:e.workspace?`Controller content adapter: ${s.detail}`:s.detail}:{status:"fail",message:"jq is not available",detail:s.detail}]}})}};export{m as default};
|