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
package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts
CHANGED
|
@@ -113,31 +113,26 @@ export function registerStreamingInterceptorProvider(
|
|
|
113
113
|
installed.set(model.provider, state);
|
|
114
114
|
};
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
// Pi can still run an in-flight request's hooks after it disposed the session that issued them.
|
|
117
|
+
// Their context is stale then, and the shut-down session must not join the shared stream again.
|
|
118
|
+
let shutDown = false;
|
|
119
|
+
const attach = (context: ExtensionContext, model?: Model<Api>): void => {
|
|
120
|
+
if (shutDown) return;
|
|
117
121
|
subscriber.context = context;
|
|
118
|
-
install(context.model, context);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
pi.on("turn_start", (_event, context) => {
|
|
122
|
-
subscriber.context = context;
|
|
123
|
-
install(context.model, context);
|
|
124
|
-
});
|
|
122
|
+
install(model ?? context.model, context);
|
|
123
|
+
};
|
|
125
124
|
|
|
126
|
-
pi.on("
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
});
|
|
125
|
+
pi.on("before_provider_request", (_event, context) => attach(context));
|
|
126
|
+
pi.on("turn_start", (_event, context) => attach(context));
|
|
127
|
+
pi.on("agent_start", (_event, context) => attach(context));
|
|
130
128
|
pi.on("session_start", (_event, context) => {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
pi.on("model_select", (event, context) => {
|
|
136
|
-
subscriber.context = context;
|
|
137
|
-
install(event.model, context);
|
|
129
|
+
shutDown = false;
|
|
130
|
+
attach(context);
|
|
138
131
|
});
|
|
132
|
+
pi.on("model_select", (event, context) => attach(context, event.model));
|
|
139
133
|
|
|
140
134
|
pi.on("session_shutdown", () => {
|
|
135
|
+
shutDown = true;
|
|
141
136
|
for (const [provider, state] of installed) {
|
|
142
137
|
state.subscribers.delete(subscriber);
|
|
143
138
|
|
|
@@ -39,10 +39,6 @@ export interface TextAnchorSpan {
|
|
|
39
39
|
readonly to: number;
|
|
40
40
|
readonly selection: boolean;
|
|
41
41
|
readonly preservesTrailingLineBreak: boolean;
|
|
42
|
-
/** First selected line when this span represents whole lines. */
|
|
43
|
-
readonly linewiseStartLine?: number;
|
|
44
|
-
/** Last selected line when this span represents whole lines. */
|
|
45
|
-
readonly linewiseEndLine?: number;
|
|
46
42
|
}
|
|
47
43
|
|
|
48
44
|
/** Resolves one anchor to one character span, converting line anchors to whole-line spans. */
|
|
@@ -50,7 +46,7 @@ export function singleAnchorSpan(
|
|
|
50
46
|
context: TextMutationContext,
|
|
51
47
|
anchors: ReadonlyMap<string, TextAnchor>,
|
|
52
48
|
field: string,
|
|
53
|
-
|
|
49
|
+
rangeEndpoint = false,
|
|
54
50
|
): TextAnchorSpan {
|
|
55
51
|
if (anchors.size !== 1) {
|
|
56
52
|
throw new Error(`Anchor ${field} must resolve in one resource.`);
|
|
@@ -61,12 +57,12 @@ export function singleAnchorSpan(
|
|
|
61
57
|
if (anchor.ranges.length !== 1) {
|
|
62
58
|
throw new Error(`Anchor ${field} must select one match for this operation.`);
|
|
63
59
|
}
|
|
64
|
-
const selectedRange = requiredValue(
|
|
60
|
+
const selectedRange = requiredValue(
|
|
61
|
+
(rangeEndpoint ? (anchor.endpointRanges ?? anchor.ranges) : anchor.ranges)[0],
|
|
62
|
+
);
|
|
65
63
|
const document = context.documentFor(source);
|
|
66
64
|
const exactRange = selectionRange(context, source, selectedRange);
|
|
67
|
-
const endLine =
|
|
68
|
-
? containingEndLine(selectedRange)
|
|
69
|
-
: linewiseSelectionEndLine(selectedRange);
|
|
65
|
+
const endLine = linewiseSelectionEndLine(selectedRange);
|
|
70
66
|
if (endLine !== undefined) {
|
|
71
67
|
const range = document.lineRange(selectedRange.start.lineNumber, endLine);
|
|
72
68
|
return {
|
|
@@ -74,8 +70,6 @@ export function singleAnchorSpan(
|
|
|
74
70
|
...range,
|
|
75
71
|
selection: false,
|
|
76
72
|
preservesTrailingLineBreak: true,
|
|
77
|
-
linewiseStartLine: selectedRange.start.lineNumber,
|
|
78
|
-
linewiseEndLine: endLine,
|
|
79
73
|
};
|
|
80
74
|
}
|
|
81
75
|
return { source, ...exactRange, selection: true, preservesTrailingLineBreak: false };
|
|
@@ -87,12 +81,21 @@ export function singleAnchorSpan(
|
|
|
87
81
|
...range,
|
|
88
82
|
selection: false,
|
|
89
83
|
preservesTrailingLineBreak: true,
|
|
90
|
-
linewiseStartLine: anchor.lineNumber,
|
|
91
|
-
linewiseEndLine: anchor.lineNumber,
|
|
92
84
|
};
|
|
93
85
|
}
|
|
94
86
|
|
|
95
|
-
/**
|
|
87
|
+
/** Whether an endpoint selects complete lines: a line anchor or text matching a whole line. */
|
|
88
|
+
function selectsWholeLines(anchors: ReadonlyMap<string, TextAnchor>): boolean {
|
|
89
|
+
const anchor = anchors.values().next().value;
|
|
90
|
+
if (anchor === undefined) return false;
|
|
91
|
+
if (!TextSelectionAnchor.is(anchor)) return true;
|
|
92
|
+
return anchor.ranges.length === 1 && anchor.ranges[0]?.linewise === true;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Join ordered endpoints. Two whole-line endpoints, such as BEGIN/END marker lines, select their
|
|
97
|
+
* complete lines; otherwise exact text and :match keep character boundaries.
|
|
98
|
+
*/
|
|
96
99
|
export function anchorSpanRange(
|
|
97
100
|
context: TextMutationContext,
|
|
98
101
|
starts: ReadonlyMap<string, TextAnchor>,
|
|
@@ -100,23 +103,22 @@ export function anchorSpanRange(
|
|
|
100
103
|
startField: string,
|
|
101
104
|
endField: string,
|
|
102
105
|
): TextAnchorSpan {
|
|
103
|
-
|
|
104
|
-
const
|
|
106
|
+
if (ends === undefined) return singleAnchorSpan(context, starts, startField);
|
|
107
|
+
const exactEndpoints = !(selectsWholeLines(starts) && selectsWholeLines(ends));
|
|
108
|
+
const start = singleAnchorSpan(context, starts, startField, exactEndpoints);
|
|
109
|
+
const end = singleAnchorSpan(context, ends, endField, exactEndpoints);
|
|
105
110
|
if (start.source !== end.source) {
|
|
106
111
|
throw new Error(`Anchors ${startField} and ${endField} must resolve in one resource.`);
|
|
107
112
|
}
|
|
108
113
|
if (start.from > end.from) {
|
|
109
114
|
throw new Error(`Anchor ${startField} must not come after ${endField}.`);
|
|
110
115
|
}
|
|
111
|
-
if (ends === undefined) return start;
|
|
112
|
-
const first = singleAnchorSpan(context, starts, startField, true);
|
|
113
|
-
const last = singleAnchorSpan(context, ends, endField, true);
|
|
114
116
|
return {
|
|
115
|
-
source:
|
|
116
|
-
from:
|
|
117
|
-
to:
|
|
118
|
-
selection:
|
|
119
|
-
preservesTrailingLineBreak:
|
|
117
|
+
source: start.source,
|
|
118
|
+
from: start.from,
|
|
119
|
+
to: end.to,
|
|
120
|
+
selection: start.selection || end.selection,
|
|
121
|
+
preservesTrailingLineBreak: end.preservesTrailingLineBreak,
|
|
120
122
|
};
|
|
121
123
|
}
|
|
122
124
|
|
|
@@ -132,7 +134,7 @@ export function replaceAnchorSpan(
|
|
|
132
134
|
span: TextAnchorSpan,
|
|
133
135
|
text: string,
|
|
134
136
|
): { readonly from: number; readonly to: number; readonly insert: string } {
|
|
135
|
-
if (text === "") return deleteAnchorSpan(
|
|
137
|
+
if (text === "") return deleteAnchorSpan(span);
|
|
136
138
|
const document = context.documentFor(span.source);
|
|
137
139
|
let insert = targetText(context, span.source, text);
|
|
138
140
|
const selected = document.text(span);
|
|
@@ -145,28 +147,32 @@ export function replaceAnchorSpan(
|
|
|
145
147
|
return { from: span.from, to: span.to, insert };
|
|
146
148
|
}
|
|
147
149
|
|
|
148
|
-
/**
|
|
149
|
-
export function deleteAnchorSpan(
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
if (
|
|
155
|
-
!span.selection &&
|
|
156
|
-
span.to === content.length &&
|
|
157
|
-
span.from > 0 &&
|
|
158
|
-
!/(?:\r\n|\r|\n)$/u.test(content)
|
|
159
|
-
) {
|
|
160
|
-
const prefix = content.slice(0, span.from);
|
|
161
|
-
const match = /(?:\r\n|\r|\n)$/u.exec(prefix);
|
|
162
|
-
if (match !== null) {
|
|
163
|
-
return { from: span.from - match[0].length, to: span.to, insert: "" };
|
|
164
|
-
}
|
|
165
|
-
}
|
|
150
|
+
/** Deletes exactly the resolved extent, including only its own line separator. */
|
|
151
|
+
export function deleteAnchorSpan(span: TextAnchorSpan): {
|
|
152
|
+
readonly from: number;
|
|
153
|
+
readonly to: number;
|
|
154
|
+
readonly insert: "";
|
|
155
|
+
} {
|
|
166
156
|
return { from: span.from, to: span.to, insert: "" };
|
|
167
157
|
}
|
|
168
158
|
|
|
169
|
-
|
|
159
|
+
function insertionAtSpan(
|
|
160
|
+
context: TextMutationContext,
|
|
161
|
+
span: Pick<TextAnchorSpan, "source" | "from" | "to" | "selection">,
|
|
162
|
+
insert: string,
|
|
163
|
+
before: boolean,
|
|
164
|
+
separation: "line" | "blank-line",
|
|
165
|
+
) {
|
|
166
|
+
return context
|
|
167
|
+
.documentFor(span.source)
|
|
168
|
+
.insertAt(
|
|
169
|
+
before ? span.from : span.to,
|
|
170
|
+
insert,
|
|
171
|
+
!span.selection || separation === "blank-line" ? separation : undefined,
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/** Inserts transferred text after the resolved selection without normalizing its bytes. */
|
|
170
176
|
export function insertionAfterAnchor(
|
|
171
177
|
context: TextMutationContext,
|
|
172
178
|
anchors: ReadonlyMap<string, TextAnchor>,
|
|
@@ -174,17 +180,11 @@ export function insertionAfterAnchor(
|
|
|
174
180
|
insert: string,
|
|
175
181
|
separation: "line" | "blank-line" = "line",
|
|
176
182
|
): readonly [string, { readonly from: number; readonly to: number; readonly insert: string }] {
|
|
177
|
-
const span = singleAnchorSpan(context, anchors, field
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
const lineNumber = span.linewiseEndLine ?? lineAnchor(anchors, field).lineNumber;
|
|
181
|
-
return [
|
|
182
|
-
span.source,
|
|
183
|
-
context.documentFor(span.source).insertAfterLine(lineNumber, normalizedInsert, separation),
|
|
184
|
-
];
|
|
183
|
+
const span = singleAnchorSpan(context, anchors, field);
|
|
184
|
+
return [span.source, insertionAtSpan(context, span, insert, false, separation)];
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
/** Inserts before the
|
|
187
|
+
/** Inserts transferred text before the resolved selection without normalizing its bytes. */
|
|
188
188
|
export function insertionBeforeAnchor(
|
|
189
189
|
context: TextMutationContext,
|
|
190
190
|
anchors: ReadonlyMap<string, TextAnchor>,
|
|
@@ -192,14 +192,8 @@ export function insertionBeforeAnchor(
|
|
|
192
192
|
insert: string,
|
|
193
193
|
separation: "line" | "blank-line" = "line",
|
|
194
194
|
): readonly [string, { readonly from: number; readonly to: number; readonly insert: string }] {
|
|
195
|
-
const span = singleAnchorSpan(context, anchors, field
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
const lineNumber = span.linewiseStartLine ?? lineAnchor(anchors, field).lineNumber;
|
|
199
|
-
return [
|
|
200
|
-
span.source,
|
|
201
|
-
context.documentFor(span.source).insertBeforeLine(lineNumber, normalizedInsert, separation),
|
|
202
|
-
];
|
|
195
|
+
const span = singleAnchorSpan(context, anchors, field);
|
|
196
|
+
return [span.source, insertionAtSpan(context, span, insert, true, separation)];
|
|
203
197
|
}
|
|
204
198
|
|
|
205
199
|
function coalesceAdjacentLinewiseRanges(
|
|
@@ -266,20 +260,15 @@ export function insertionChanges(
|
|
|
266
260
|
return new Map(
|
|
267
261
|
[...selections].map(([source, anchor]) => [
|
|
268
262
|
source,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
263
|
+
anchor.ranges.map((range) =>
|
|
264
|
+
insertionAtSpan(
|
|
265
|
+
context,
|
|
266
|
+
{ source, ...selectionRange(context, source, range), selection: range.linewise !== true },
|
|
267
|
+
targetText(context, source, insert),
|
|
268
|
+
before,
|
|
269
|
+
separation,
|
|
275
270
|
),
|
|
276
|
-
|
|
277
|
-
const document = context.documentFor(source);
|
|
278
|
-
const normalizedInsert = targetText(context, source, insert);
|
|
279
|
-
return before
|
|
280
|
-
? document.insertBeforeLine(line, normalizedInsert, separation)
|
|
281
|
-
: document.insertAfterLine(line, normalizedInsert, separation);
|
|
282
|
-
}),
|
|
271
|
+
),
|
|
283
272
|
]),
|
|
284
273
|
);
|
|
285
274
|
}
|
|
@@ -18,14 +18,14 @@ export function sourceRangeProperties(descriptions: Partial<Record<"start" | "en
|
|
|
18
18
|
Type.String({
|
|
19
19
|
description:
|
|
20
20
|
descriptions.start ??
|
|
21
|
-
"Anchor or unique exact text.
|
|
21
|
+
"Anchor or unique exact text where the selection begins. Without end, selects only this text, or only this one line for a line anchor; add end to select several lines. Omit when path is a result that already selects text.",
|
|
22
22
|
}),
|
|
23
23
|
),
|
|
24
24
|
end: Type.Optional(
|
|
25
25
|
Type.String({
|
|
26
26
|
description:
|
|
27
27
|
descriptions.end ??
|
|
28
|
-
"
|
|
28
|
+
"Anchor or unique exact text where the selection ends, inclusive. Omit when start selects everything.",
|
|
29
29
|
}),
|
|
30
30
|
),
|
|
31
31
|
};
|
|
@@ -35,18 +35,18 @@ export function sourceRangeProperties(descriptions: Partial<Record<"start" | "en
|
|
|
35
35
|
export function targetProperties(directorySemantics: string) {
|
|
36
36
|
return {
|
|
37
37
|
target: resultSourceProperty(
|
|
38
|
-
`Destination path,
|
|
38
|
+
`Destination: a path, or an unchanged result whose ranges are replaced. A whole-file transfer creates missing folders and replaces an existing file. ${directorySemantics}`,
|
|
39
39
|
),
|
|
40
40
|
targetStart: Type.Optional(
|
|
41
41
|
Type.String({
|
|
42
42
|
description:
|
|
43
|
-
"
|
|
43
|
+
"Anchor or unique exact text in the destination file; the text goes after its selected extent. Required when the text goes into a file path.",
|
|
44
44
|
}),
|
|
45
45
|
),
|
|
46
46
|
targetEnd: Type.Optional(
|
|
47
47
|
Type.String({
|
|
48
48
|
description:
|
|
49
|
-
"
|
|
49
|
+
"Replace from targetStart through targetEnd instead of inserting after targetStart.",
|
|
50
50
|
}),
|
|
51
51
|
),
|
|
52
52
|
};
|
|
@@ -7,22 +7,18 @@ import {
|
|
|
7
7
|
} from "#src/tools/text-tool-schema-properties.js";
|
|
8
8
|
|
|
9
9
|
import { TEXT_POSITION_ANCHOR_KIND, TEXT_SEARCH_ANCHOR_KIND } from "#src/api/plugin-protocol.js";
|
|
10
|
-
import {
|
|
11
|
-
anchorSpanRange,
|
|
12
|
-
insertionAfterAnchor,
|
|
13
|
-
replaceAnchorSpan,
|
|
14
|
-
} from "#src/tools/text-selection.js";
|
|
10
|
+
import { anchorSpanRange, insertionAfterAnchor } from "#src/tools/text-selection.js";
|
|
15
11
|
|
|
16
12
|
import type { TextMutationToolRegistration } from "#src/api/mutation-tool.js";
|
|
17
13
|
|
|
18
14
|
export const copySchema = Type.Object(
|
|
19
15
|
{
|
|
20
16
|
path: resultSourceProperty(
|
|
21
|
-
"
|
|
17
|
+
"Source: a path, an unchanged Read/Search result or its UUID, or an array of them. A path without start copies the whole file, directory or symlink. Omit to use the file of the start anchor.",
|
|
22
18
|
),
|
|
23
19
|
...sourceRangeProperties(),
|
|
24
20
|
...targetProperties(
|
|
25
|
-
"
|
|
21
|
+
"Copying a directory merges into the target and keeps files that exist only there.",
|
|
26
22
|
),
|
|
27
23
|
},
|
|
28
24
|
{ additionalProperties: false },
|
|
@@ -39,8 +35,7 @@ interface CopyParameters {
|
|
|
39
35
|
export const copyMutationTool: TextMutationToolRegistration<typeof copySchema> = {
|
|
40
36
|
name: "copy",
|
|
41
37
|
wholeFileOperation: "copy",
|
|
42
|
-
description:
|
|
43
|
-
"Use copy to copy a file, directory tree, or symlink object, or to duplicate selected text within or between files.",
|
|
38
|
+
description: "Use copy to copy a file or directory, or to duplicate text in another place.",
|
|
44
39
|
|
|
45
40
|
promptSnippet: "Copy filesystem objects or selected text",
|
|
46
41
|
parameters: copySchema,
|
|
@@ -99,7 +94,9 @@ export const copyMutationTool: TextMutationToolRegistration<typeof copySchema> =
|
|
|
99
94
|
[
|
|
100
95
|
targetSpan.source,
|
|
101
96
|
{
|
|
102
|
-
changes: [
|
|
97
|
+
changes: [
|
|
98
|
+
{ from: targetSpan.from, to: targetSpan.to, insert: copied, allowUnchanged: true },
|
|
99
|
+
],
|
|
103
100
|
action: "edited",
|
|
104
101
|
},
|
|
105
102
|
],
|
|
@@ -18,13 +18,9 @@ import type { TextMutationToolRegistration } from "#src/api/mutation-tool.js";
|
|
|
18
18
|
export const deleteSchema = Type.Object(
|
|
19
19
|
{
|
|
20
20
|
path: resultSourceProperty(
|
|
21
|
-
"
|
|
21
|
+
"Path, unchanged Read/Search result or its UUID, or an array of them. A path without start deletes the file or directory (a symlink only as a link); a result removes only its selected text. Omit to use the file of the start anchor.",
|
|
22
22
|
),
|
|
23
|
-
...sourceRangeProperties(
|
|
24
|
-
start:
|
|
25
|
-
"Anchor or unique exact text locating the text to remove. Without end, exact text selects only that fragment; a line anchor selects its whole line. Omit when path already selects text.",
|
|
26
|
-
end: "Anchor or unique exact text locating the last line to remove. With start, removes whole lines including both boundary lines, even for SEARCH :match anchors. Both boundaries must be unique, in one file, and in forward order. Mixed anchor types are allowed. Omit when start alone selects the intended text.",
|
|
27
|
-
}),
|
|
23
|
+
...sourceRangeProperties(),
|
|
28
24
|
},
|
|
29
25
|
{ additionalProperties: false },
|
|
30
26
|
);
|
|
@@ -38,7 +34,7 @@ export const deleteMutationTool: TextMutationToolRegistration<typeof deleteSchem
|
|
|
38
34
|
name: "delete",
|
|
39
35
|
wholeFileOperation: "delete",
|
|
40
36
|
description:
|
|
41
|
-
"Use delete to remove
|
|
37
|
+
"Use delete to remove text, delete a file or directory, or end a terminal or debugger session.",
|
|
42
38
|
|
|
43
39
|
promptSnippet:
|
|
44
40
|
"Delete files or selected text, terminate terminal or debugger sessions, or remove debugger breakpoints",
|
|
@@ -77,9 +73,7 @@ export const deleteMutationTool: TextMutationToolRegistration<typeof deleteSchem
|
|
|
77
73
|
const ends = parameters.end === undefined ? undefined : await context.resolveAnchors("end");
|
|
78
74
|
const span = anchorSpanRange(context, starts, ends, "start", "end");
|
|
79
75
|
return {
|
|
80
|
-
edits: new Map([
|
|
81
|
-
[span.source, { changes: [deleteAnchorSpan(context, span)], action: "edited" }],
|
|
82
|
-
]),
|
|
76
|
+
edits: new Map([[span.source, { changes: [deleteAnchorSpan(span)], action: "edited" }]]),
|
|
83
77
|
};
|
|
84
78
|
},
|
|
85
79
|
};
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
insertionBeforeAnchor,
|
|
7
7
|
insertionChanges,
|
|
8
8
|
textSelections,
|
|
9
|
+
targetText,
|
|
9
10
|
} from "#src/tools/text-selection.js";
|
|
10
11
|
|
|
11
12
|
import type { TextMutationToolRegistration } from "#src/api/mutation-tool.js";
|
|
@@ -15,30 +16,29 @@ export const insertSchema = Type.Object(
|
|
|
15
16
|
path: Type.Optional(
|
|
16
17
|
Type.String({
|
|
17
18
|
description:
|
|
18
|
-
"
|
|
19
|
+
"File path, resource reference, unchanged Read/Search/edit result or its UUID; a result selects only its ranges. Omit to reuse the file of the anchor, the last read or the preceding edit.",
|
|
19
20
|
}),
|
|
20
21
|
),
|
|
21
22
|
anchor: Type.Optional(
|
|
22
23
|
Type.String({
|
|
23
24
|
description:
|
|
24
|
-
"
|
|
25
|
+
"Line anchor or unique exact text. Insert at the selection boundary: whole lines include their own separator; partial or multiline exact matches keep character boundaries. Omit when path already selects text.",
|
|
25
26
|
}),
|
|
26
27
|
),
|
|
27
28
|
text: Type.String({
|
|
28
29
|
minLength: 1,
|
|
29
30
|
description:
|
|
30
|
-
"
|
|
31
|
+
"Non-empty text to insert, using the target line-ending style. Whole-line selections add needed separators; exact fragments do not.",
|
|
31
32
|
}),
|
|
32
33
|
separation: Type.Optional(
|
|
33
34
|
Type.Union([Type.Literal("line"), Type.Literal("blank-line")], {
|
|
34
|
-
description:
|
|
35
|
-
"For text edits, defaults to line: separate inserted text from existing lines without adding extra blank lines. Use blank-line to add only missing blank lines between the insertion and existing text.",
|
|
35
|
+
description: "line (default) or blank-line: add blank lines around the insertion.",
|
|
36
36
|
}),
|
|
37
37
|
),
|
|
38
38
|
before: Type.Optional(
|
|
39
39
|
Type.Boolean({
|
|
40
40
|
description:
|
|
41
|
-
"
|
|
41
|
+
"true inserts at the start of the selection; default false inserts at its end.",
|
|
42
42
|
}),
|
|
43
43
|
),
|
|
44
44
|
},
|
|
@@ -56,7 +56,7 @@ interface InsertParameters {
|
|
|
56
56
|
export const insertMutationTool: TextMutationToolRegistration<typeof insertSchema> = {
|
|
57
57
|
name: "insert",
|
|
58
58
|
description:
|
|
59
|
-
"Use insert to
|
|
59
|
+
"Use insert to add text at a selection boundary without changing selected text, to send keys to a terminal session, or to control a debugger.",
|
|
60
60
|
|
|
61
61
|
promptSnippet: "Insert file text, send terminal keys, or perform debugger actions",
|
|
62
62
|
parameters: insertSchema,
|
|
@@ -96,7 +96,7 @@ export const insertMutationTool: TextMutationToolRegistration<typeof insertSchem
|
|
|
96
96
|
context,
|
|
97
97
|
anchors,
|
|
98
98
|
"anchor",
|
|
99
|
-
parameters.text,
|
|
99
|
+
targetText(context, context.sourceFor("path"), parameters.text),
|
|
100
100
|
parameters.separation,
|
|
101
101
|
);
|
|
102
102
|
return {
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
anchorSpanRange,
|
|
12
12
|
deleteAnchorSpan,
|
|
13
13
|
insertionAfterAnchor,
|
|
14
|
-
replaceAnchorSpan,
|
|
15
14
|
} from "#src/tools/text-selection.js";
|
|
16
15
|
|
|
17
16
|
import type { TextMutationToolRegistration } from "#src/api/mutation-tool.js";
|
|
@@ -20,12 +19,10 @@ import type { TextChange } from "#src/core/text-change-engine.js";
|
|
|
20
19
|
export const moveSchema = Type.Object(
|
|
21
20
|
{
|
|
22
21
|
path: resultSourceProperty(
|
|
23
|
-
"
|
|
22
|
+
"Source: a path, an unchanged Read/Search result or its UUID, or an array of them. A path without start moves the whole file, directory or symlink. Omit to use the file of the start anchor.",
|
|
24
23
|
),
|
|
25
24
|
...sourceRangeProperties(),
|
|
26
|
-
...targetProperties(
|
|
27
|
-
"Directory Move replaces the exact target directory, removing destination-only entries.",
|
|
28
|
-
),
|
|
25
|
+
...targetProperties("Moving a directory replaces the target directory."),
|
|
29
26
|
},
|
|
30
27
|
{ additionalProperties: false },
|
|
31
28
|
);
|
|
@@ -42,7 +39,7 @@ export const moveMutationTool: TextMutationToolRegistration<typeof moveSchema> =
|
|
|
42
39
|
name: "move",
|
|
43
40
|
wholeFileOperation: "move",
|
|
44
41
|
description:
|
|
45
|
-
"Use move to move or rename a file
|
|
42
|
+
"Use move to move or rename a file or directory, or to cut text from one place and put it in another.",
|
|
46
43
|
|
|
47
44
|
promptSnippet: "Move filesystem objects or selected text",
|
|
48
45
|
parameters: moveSchema,
|
|
@@ -77,7 +74,7 @@ export const moveMutationTool: TextMutationToolRegistration<typeof moveSchema> =
|
|
|
77
74
|
const ends = parameters.end === undefined ? undefined : await context.resolveAnchors("end");
|
|
78
75
|
const sourceSpan = anchorSpanRange(context, starts, ends, "start", "end");
|
|
79
76
|
const copied = context.documentFor(sourceSpan.source).text(sourceSpan);
|
|
80
|
-
const deletion = deleteAnchorSpan(
|
|
77
|
+
const deletion = deleteAnchorSpan(sourceSpan);
|
|
81
78
|
|
|
82
79
|
const targetStarts = await context.resolveAnchors("targetStart");
|
|
83
80
|
let target: string;
|
|
@@ -94,7 +91,7 @@ export const moveMutationTool: TextMutationToolRegistration<typeof moveSchema> =
|
|
|
94
91
|
"targetEnd",
|
|
95
92
|
);
|
|
96
93
|
target = targetSpan.source;
|
|
97
|
-
targetChange =
|
|
94
|
+
targetChange = { from: targetSpan.from, to: targetSpan.to, insert: copied };
|
|
98
95
|
}
|
|
99
96
|
|
|
100
97
|
if (sourceSpan.source === target && rangesTouch(deletion, targetChange)) {
|
|
@@ -18,13 +18,12 @@ export const replaceSchema = Type.Object(
|
|
|
18
18
|
path: Type.Optional(
|
|
19
19
|
Type.Union(resultInputSchema.anyOf, {
|
|
20
20
|
description:
|
|
21
|
-
"
|
|
21
|
+
"File path, SEARCH# reference, unchanged Read/Search/edit result or its UUID, or an array of them; a result selects only its ranges. Omit to reuse the file of the anchor, the last read or the preceding edit.",
|
|
22
22
|
}),
|
|
23
23
|
),
|
|
24
24
|
...sourceRangeProperties(),
|
|
25
25
|
text: Type.String({
|
|
26
|
-
description:
|
|
27
|
-
"Replacement text for each selected range. Empty text removes the selection; a whole-line selection removes its lines without inserting a blank line. Adjacent unselected lines are kept.",
|
|
26
|
+
description: "Replacement for each selected range; empty text deletes it.",
|
|
28
27
|
}),
|
|
29
28
|
},
|
|
30
29
|
{ additionalProperties: false },
|
|
@@ -38,7 +37,7 @@ interface ReplaceParameters {
|
|
|
38
37
|
|
|
39
38
|
export const replaceMutationTool: TextMutationToolRegistration<typeof replaceSchema> = {
|
|
40
39
|
name: "replace",
|
|
41
|
-
description: "Use replace to
|
|
40
|
+
description: "Use replace to change selected text.",
|
|
42
41
|
|
|
43
42
|
promptSnippet: "Make precise file edits by replacing text using exact matches or anchors",
|
|
44
43
|
parameters: replaceSchema,
|
|
@@ -7,43 +7,58 @@ export const writeSchema = Type.Object(
|
|
|
7
7
|
{
|
|
8
8
|
path: {
|
|
9
9
|
...resultInputSchema,
|
|
10
|
-
description:
|
|
11
|
-
"File path or one whole-file source result. Partial file scopes and multiple files are rejected. Use shell:<session> to send input to a running terminal.",
|
|
10
|
+
description: "File path, or an unchanged whole-file result.",
|
|
12
11
|
},
|
|
13
|
-
content: Type.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
content: Type.Union(
|
|
13
|
+
[
|
|
14
|
+
Type.String(),
|
|
15
|
+
Type.Object({ type: Type.Literal("image"), data: Type.String(), mimeType: Type.String() }),
|
|
16
|
+
Type.Object({
|
|
17
|
+
type: Type.Literal("images"),
|
|
18
|
+
images: Type.Array(Type.Object({ data: Type.String(), mimeType: Type.String() })),
|
|
19
|
+
}),
|
|
20
|
+
],
|
|
21
|
+
{
|
|
22
|
+
description:
|
|
23
|
+
"Complete file content. To save an image that read returned, pass that read result or its UUID and give path an image extension; several images become numbered files.",
|
|
24
|
+
},
|
|
25
|
+
),
|
|
17
26
|
},
|
|
18
27
|
{ additionalProperties: false },
|
|
19
28
|
);
|
|
20
29
|
|
|
21
30
|
interface WriteParameters {
|
|
22
31
|
readonly path: unknown;
|
|
23
|
-
readonly content:
|
|
32
|
+
readonly content: unknown;
|
|
24
33
|
}
|
|
25
34
|
|
|
26
35
|
export const writeMutationTool: TextMutationToolRegistration<typeof writeSchema> = {
|
|
27
36
|
name: "write",
|
|
28
37
|
description:
|
|
29
|
-
"Use write to create or
|
|
38
|
+
"Use write to create a file or replace all of its content, or to type into a terminal session.",
|
|
30
39
|
|
|
31
40
|
promptSnippet: "Create or overwrite files",
|
|
32
41
|
parameters: writeSchema,
|
|
33
42
|
source: { field: "path" },
|
|
34
43
|
anchors: [],
|
|
35
|
-
mutate: (context, parameters: WriteParameters) =>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
mutate: (context, parameters: WriteParameters) => {
|
|
45
|
+
// Image content is written as files before text mutation starts.
|
|
46
|
+
if (typeof parameters.content !== "string")
|
|
47
|
+
throw new Error("Image content must name images a Read returned.");
|
|
48
|
+
const content = parameters.content;
|
|
49
|
+
return {
|
|
50
|
+
edits: new Map([
|
|
51
|
+
[
|
|
52
|
+
context.sourceFor("path"),
|
|
53
|
+
{
|
|
54
|
+
changes:
|
|
55
|
+
context.sourceDocument.content === content
|
|
56
|
+
? []
|
|
57
|
+
: [context.sourceDocument.replaceAll(content)],
|
|
58
|
+
action: "overwritten",
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
]),
|
|
62
|
+
};
|
|
63
|
+
},
|
|
49
64
|
};
|