pi-agent-ide 0.8.4 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +59 -0
- package/README.md +24 -29
- package/dist/{chunk-CM3XGY72.js → chunk-2AY526TN.js} +1 -1
- package/dist/{chunk-LEJKDYCK.js → chunk-2TZDG2JH.js} +1 -1
- package/dist/{chunk-XBQR74IK.js → chunk-4GBFIGH3.js} +1 -1
- package/dist/{chunk-PJL3UVMJ.js → chunk-4IWEKRSP.js} +1 -1
- package/dist/chunk-52PFWQMU.js +5 -0
- package/dist/chunk-5BGWNYQS.js +1 -0
- package/dist/{chunk-QUYXINGZ.js → chunk-5S74Z6Y4.js} +3 -3
- package/dist/chunk-64JTD2DJ.js +1 -0
- package/dist/{chunk-XAHU42FP.js → chunk-6A3ORNW3.js} +2 -2
- package/dist/{chunk-ANM3Y5FO.js → chunk-6WCHBHFW.js} +5 -5
- package/dist/{chunk-IMGIDBCC.js → chunk-7D7PXIVV.js} +1 -1
- package/dist/chunk-7PVDTMEM.js +1 -0
- package/dist/chunk-7SG756UO.js +4 -0
- package/dist/{chunk-GBUJOR6V.js → chunk-7URANI6I.js} +14 -14
- package/dist/{chunk-Z2MNHSJ4.js → chunk-AJZVKDYC.js} +1 -1
- package/dist/chunk-AMIIOWFL.js +1 -0
- package/dist/{chunk-TOYN4W4F.js → chunk-B25LXXNV.js} +1 -1
- package/dist/chunk-C2JT2G5K.js +1 -0
- package/dist/chunk-CVOYSEBE.js +1 -0
- package/dist/chunk-DDH3FP4G.js +3 -0
- package/dist/chunk-FEZLTM4L.js +1 -0
- package/dist/{chunk-CPELC6JE.js → chunk-FHRHYY4M.js} +1 -1
- package/dist/chunk-FKKAHI62.js +11 -0
- package/dist/chunk-FS3KCKFX.js +9 -0
- package/dist/chunk-FYOU4RBH.js +2 -0
- package/dist/chunk-G4PRFO6G.js +1 -0
- package/dist/chunk-GS5ZRTUG.js +1 -0
- package/dist/{chunk-XXLLY66B.js → chunk-GXL4NMHR.js} +1 -1
- package/dist/{chunk-QT3EAHOG.js → chunk-H3GEEOOL.js} +1 -1
- package/dist/chunk-H5Z54BEU.js +25 -0
- package/dist/chunk-H7WAM5RH.js +23 -0
- package/dist/chunk-HT7LZN5A.js +9 -0
- package/dist/chunk-IG5DXVDJ.js +1 -0
- package/dist/chunk-K4UTEMDU.js +1 -0
- package/dist/chunk-KFBRL2V4.js +3 -0
- package/dist/chunk-KN6VPARZ.js +1 -0
- package/dist/{chunk-RW2GTYQI.js → chunk-LF325WYO.js} +1 -1
- package/dist/chunk-LTADNZKW.js +2 -0
- package/dist/{chunk-YJ6T3PEP.js → chunk-MDD5ORB6.js} +1 -1
- package/dist/{chunk-S72FVLUX.js → chunk-MLFJU2US.js} +1 -1
- package/dist/chunk-NA2NEU4V.js +1 -0
- package/dist/chunk-OBTT5INC.js +6 -0
- package/dist/{chunk-IICJXZBU.js → chunk-OMNKD7WW.js} +3 -3
- package/dist/chunk-PLMHBXWI.js +10 -0
- package/dist/{chunk-235QMMVA.js → chunk-PQWANILR.js} +1 -1
- package/dist/{chunk-QRJLIV6P.js → chunk-QJ6V5IAY.js} +6 -6
- package/dist/chunk-QM5WDEFI.js +1 -0
- package/dist/{chunk-SMIFCAAX.js → chunk-RIJRPAL2.js} +1 -1
- package/dist/chunk-RIOPUTUJ.js +6 -0
- package/dist/chunk-RVFMH77U.js +82 -0
- package/dist/{chunk-NJ7C4KMA.js → chunk-SRFWT562.js} +1 -1
- package/dist/{chunk-U22JNO6N.js → chunk-STUZZM5B.js} +1 -1
- package/dist/{chunk-PT35ZFLH.js → chunk-TNAUCNUT.js} +12 -12
- package/dist/{chunk-DUUOCBS3.js → chunk-TVH2ND35.js} +1 -1
- package/dist/chunk-TVSZYABY.js +5 -0
- package/dist/chunk-TVXZE4KW.js +4 -0
- package/dist/chunk-U7YDLVFL.js +1 -0
- package/dist/{chunk-KZC7TI5M.js → chunk-UD3DMY3Q.js} +1 -1
- package/dist/{chunk-VXP5BMW7.js → chunk-USG6WHAT.js} +1 -1
- package/dist/{chunk-RMI3NMQY.js → chunk-V4J3TLCV.js} +2 -2
- package/dist/{chunk-ZPT5D4VP.js → chunk-VDJSH3DQ.js} +2 -2
- package/dist/{chunk-VMTOFEXF.js → chunk-VMLPXSMK.js} +1 -1
- package/dist/{chunk-6T7PSDQW.js → chunk-VN3XBH2Q.js} +1 -1
- package/dist/chunk-WAJW4G4F.js +22 -0
- package/dist/chunk-WEE3NM6L.js +1 -0
- package/dist/{chunk-IM24DB3K.js → chunk-WES2E4VR.js} +1 -1
- package/dist/{chunk-RIJMXO43.js → chunk-WQIMM4SU.js} +1 -1
- package/dist/chunk-WUO3UW4J.js +17 -0
- package/dist/chunk-XE4W5YTE.js +2 -0
- package/dist/chunk-XUYIK4TX.js +1 -0
- package/dist/{chunk-ZJQRLVVV.js → chunk-Y74EKJOY.js} +1 -1
- package/dist/{chunk-AAC77UD4.js → chunk-YPYROPQF.js} +1 -1
- package/dist/chunk-ZXO4D5UB.js +1 -0
- package/dist/entry-0.js +1 -1
- package/dist/entry-1.js +1 -1
- package/dist/entry-10.js +1 -1
- package/dist/entry-11.js +1 -1
- package/dist/entry-12.js +1 -1
- package/dist/entry-13.js +1 -1
- package/dist/entry-14.js +1 -1
- package/dist/entry-15.js +1 -1
- package/dist/entry-16.js +1 -1
- package/dist/entry-17.js +1 -1
- package/dist/entry-18.js +1 -1
- package/dist/entry-19.js +1 -1
- package/dist/entry-2.js +1 -1
- package/dist/entry-20.js +1 -1
- package/dist/entry-21.js +1 -0
- package/dist/entry-23.js +1 -1
- package/dist/entry-24.js +1 -1
- package/dist/entry-25.js +1 -1
- package/dist/entry-26.js +1 -1
- package/dist/entry-27.js +1 -1
- package/dist/entry-28.js +1 -1
- package/dist/entry-29.js +1 -2
- package/dist/entry-3.js +1 -1
- package/dist/entry-30.js +2 -1
- package/dist/entry-31.js +1 -4
- package/dist/entry-32.js +1 -1
- package/dist/entry-33.js +1 -1
- package/dist/entry-34.js +1 -1
- package/dist/entry-35.js +1 -18
- package/dist/entry-36.js +1 -1
- package/dist/entry-37.js +15 -1
- package/dist/entry-38.js +1 -1
- package/dist/entry-39.js +1 -1
- package/dist/entry-4.js +1 -1
- package/dist/entry-40.js +1 -1
- package/dist/entry-41.js +1 -1
- package/dist/entry-42.js +1 -1
- package/dist/entry-43.js +1 -1
- package/dist/entry-44.js +1 -1
- package/dist/entry-45.js +1 -1
- package/dist/entry-46.js +1 -1
- package/dist/entry-47.js +1 -1
- package/dist/entry-48.js +1 -1
- package/dist/entry-49.js +1 -25
- package/dist/entry-5.js +1 -1
- package/dist/entry-50.js +1 -1
- package/dist/entry-51.js +1 -1
- package/dist/entry-52.js +1 -1
- package/dist/entry-53.js +1 -1
- package/dist/entry-54.js +1 -3
- package/dist/entry-55.js +1 -13
- package/dist/entry-56.js +1 -1
- package/dist/entry-57.js +1 -1
- package/dist/entry-58.js +1 -1
- package/dist/entry-59.js +1 -1
- package/dist/entry-6.js +1 -1
- package/dist/entry-60.js +1 -1
- package/dist/entry-61.js +1 -1
- package/dist/entry-62.js +1 -1
- package/dist/entry-63.js +1 -1
- package/dist/entry-64.js +1 -1
- package/dist/entry-65.js +1 -0
- package/dist/entry-66.js +1 -1
- package/dist/entry-68.js +1 -1
- package/dist/entry-69.js +0 -1
- package/dist/entry-7.js +1 -1
- package/dist/entry-70.js +1 -1
- package/dist/entry-71.js +1 -1
- package/dist/entry-72.js +1 -1
- package/dist/entry-73.js +1 -1
- package/dist/entry-74.js +1 -1
- package/dist/entry-75.js +1 -0
- package/dist/entry-76.js +1 -1
- package/dist/entry-78.js +1 -1
- package/dist/entry-79.js +0 -1
- package/dist/entry-8.js +1 -1
- package/dist/entry-80.js +1 -1
- package/dist/entry-81.js +1 -80
- package/dist/entry-82.js +1 -22
- package/dist/entry-83.js +1 -2
- package/dist/entry-84.js +1 -1
- package/dist/entry-85.js +2 -1
- package/dist/entry-86.js +1 -1
- package/dist/entry-87.js +1 -1
- package/dist/entry-88.js +1 -3
- package/dist/entry-89.js +1 -1
- package/dist/entry-9.js +1 -1
- package/dist/entry-90.js +3 -1
- package/dist/entry-91.js +1 -1
- package/dist/entry-92.js +1 -0
- package/dist/entry-93.js +1 -0
- package/dist/pi-agent-ide.js +10 -34
- package/docs/agent-guides/ast-search.md +58 -0
- package/docs/agent-guides/debugger.md +1 -1
- package/docs/agent-guides/editing.md +26 -58
- package/docs/agent-guides/git-changes.md +4 -14
- package/docs/agent-guides/search.md +38 -0
- package/docs/agent-guides/ssh.md +17 -49
- package/docs/agent-guides/terminal.md +9 -15
- package/docs/configuration.md +9 -13
- package/docs/extensions.md +82 -0
- package/docs/settings-help.md +2 -2
- package/docs/structured-results.md +33 -11
- package/docs/tools.md +23 -22
- package/node_modules/pi-agent-doctor/package.json +7 -7
- package/node_modules/pi-agent-doctor/src/workspace.ts +0 -5
- package/node_modules/pi-agent-documentation/package.json +2 -2
- package/node_modules/pi-agent-documentation/runtime/entry-29.js +1 -0
- package/node_modules/pi-agent-documentation/src/index.ts +26 -10
- package/node_modules/pi-agent-filesystem/index.ts +1 -1
- package/node_modules/pi-agent-filesystem/package.json +8 -8
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- package/node_modules/pi-agent-filesystem-jq/index.ts +9 -63
- package/node_modules/pi-agent-filesystem-jq/package.json +12 -6
- package/node_modules/pi-agent-filesystem-jq/runtime/entry-32.js +1 -0
- package/node_modules/pi-agent-filesystem-jq/src/api/jq.ts +112 -0
- package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
- package/node_modules/pi-agent-filesystem-pdf/runtime/entry-34.js +2 -0
- package/node_modules/pi-agent-filesystem-text/package.json +4 -4
- package/node_modules/pi-agent-ide-ast/package.json +15 -15
- package/node_modules/pi-agent-ide-ast/src/extension.ts +8 -8
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +104 -26
- package/node_modules/pi-agent-ide-ast/src/tool-ast-search.ts +210 -0
- package/node_modules/pi-agent-ide-changes/index.ts +1 -2
- package/node_modules/pi-agent-ide-changes/package.json +10 -10
- package/node_modules/pi-agent-ide-changes/runtime/entry-38.js +1 -0
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +3 -3
- package/node_modules/pi-agent-ide-formatter/package.json +4 -4
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-lint/package.json +8 -8
- package/node_modules/pi-agent-ide-lint/runtime/entry-42.js +2 -0
- package/node_modules/pi-agent-ide-lsp/index.ts +22 -28
- package/node_modules/pi-agent-ide-lsp/package.json +14 -10
- package/node_modules/pi-agent-ide-lsp/runtime/entry-43.js +2 -0
- package/node_modules/pi-agent-ide-lsp/src/declaration-targets.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/src/lsp/code-views.ts +8 -84
- package/node_modules/pi-agent-ide-lsp/src/lsp/index.ts +1 -6
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +11 -11
- package/node_modules/pi-agent-ide-lsp/src/manager-provider.ts +8 -0
- package/node_modules/pi-agent-ide-lsp/src/rename-plan.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +234 -36
- package/node_modules/pi-agent-ide-lsp/src/tool-lsp-search.ts +212 -0
- package/node_modules/pi-agent-image/package.json +3 -3
- package/node_modules/pi-agent-image/src/image-converter.ts +24 -1
- package/node_modules/pi-agent-invariant/package.json +2 -2
- package/node_modules/pi-agent-pdf/package.json +3 -3
- package/node_modules/pi-agent-pdf/src/pdf-converter.ts +23 -1
- package/node_modules/pi-agent-read/package.json +12 -12
- package/node_modules/pi-agent-read/runtime/entry-49.js +0 -1
- package/node_modules/pi-agent-read/runtime/entry-51.js +2 -0
- package/node_modules/pi-agent-read/src/api/read-parameters.ts +4 -7
- package/node_modules/pi-agent-read/src/api/tools/read.ts +2 -0
- package/node_modules/pi-agent-read/src/core/extension.ts +0 -8
- package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +47 -14
- package/node_modules/pi-agent-read/src/core/tools/read/result-target.ts +3 -1
- package/node_modules/pi-agent-read/src/core/tools/read/structured-result.ts +14 -2
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +21 -8
- package/node_modules/pi-agent-resource/package.json +2 -2
- package/node_modules/pi-agent-resource/src/index.ts +8 -0
- package/node_modules/pi-agent-resource/src/resource-error-metadata.ts +89 -0
- package/node_modules/pi-agent-resource/src/resource-error.ts +6 -1
- package/node_modules/pi-agent-resource/src/result-images.ts +87 -0
- package/node_modules/pi-agent-resource/src/result-targets.ts +9 -3
- package/node_modules/pi-agent-resource/src/tool-result.ts +17 -0
- package/node_modules/pi-agent-search/package.json +9 -9
- package/node_modules/pi-agent-search/runtime/entry-54.js +0 -1
- package/node_modules/pi-agent-search/runtime/entry-55.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-56.js +2 -0
- package/node_modules/pi-agent-search/src/api/glob-list.ts +35 -0
- package/node_modules/pi-agent-search/src/api/search-parameters.ts +8 -8
- package/node_modules/pi-agent-search/src/api/search.ts +14 -2
- package/node_modules/pi-agent-search/src/core/extension.ts +11 -20
- package/node_modules/pi-agent-search/src/core/search-core.ts +30 -10
- package/node_modules/pi-agent-search-text/index.ts +34 -12
- package/node_modules/pi-agent-search-text/package.json +17 -15
- package/node_modules/pi-agent-search-text/runtime/entry-57.js +1 -0
- package/node_modules/pi-agent-search-text/runtime/entry-60.js +1 -0
- package/node_modules/pi-agent-search-text/src/file-search.ts +59 -25
- package/node_modules/pi-agent-search-text/src/resolvers.ts +61 -16
- package/node_modules/pi-agent-search-text/src/scoped-search.ts +9 -3
- package/node_modules/pi-agent-search-text/src/search-backend.ts +44 -48
- package/node_modules/pi-agent-search-text/src/search-presentation.ts +19 -15
- package/node_modules/pi-agent-search-text/src/search-recipe.ts +2 -1
- package/node_modules/pi-agent-search-text/src/search-result.ts +6 -2
- package/node_modules/pi-agent-search-text/src/search-session.ts +1 -0
- package/node_modules/pi-agent-search-text/src/tool-file-search.ts +146 -0
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text/src/text-converter.ts +1 -1
- package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
- package/node_modules/pi-agent-text-anchor-exact/package.json +5 -5
- package/node_modules/pi-agent-text-anchor-exact/src/anchor.ts +6 -1
- package/node_modules/pi-agent-text-anchor-line-hash/index.ts +1 -2
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-66.js +2 -0
- package/node_modules/pi-agent-text-editor/package.json +26 -26
- package/node_modules/pi-agent-text-editor/runtime/entry-81.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-82.js +1 -0
- package/node_modules/pi-agent-text-editor/src/api/edit-pipeline.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +23 -0
- package/node_modules/pi-agent-text-editor/src/api/text-selection-anchor.ts +31 -1
- package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +11 -21
- package/node_modules/pi-agent-text-editor/src/core/editing-guidelines.ts +5 -5
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +13 -7
- package/node_modules/pi-agent-text-editor/src/core/file-operation-guards.ts +22 -4
- package/node_modules/pi-agent-text-editor/src/core/image-write.ts +111 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +3 -0
- package/node_modules/pi-agent-text-editor/src/core/structured-result.ts +5 -1
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +8 -2
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +103 -20
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +146 -62
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +14 -19
- package/node_modules/pi-agent-text-editor/src/tools/text-selection.ts +43 -12
- package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +5 -5
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +6 -5
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +3 -7
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +6 -8
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +9 -6
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +3 -4
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +37 -22
- package/node_modules/pi-agent-text-editor-renderer/index.ts +6 -1
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-84.js +2 -0
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +18 -5
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +6 -6
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-85.js +2 -0
- package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
- package/node_modules/pi-agent-tool-ui/package.json +3 -3
- package/node_modules/pi-agent-tool-ui/runtime/entry-87.js +1 -0
- package/node_modules/pi-agent-tool-ui/runtime/entry-88.js +1 -0
- package/node_modules/pi-agent-web/index.ts +28 -6
- package/node_modules/pi-agent-web/package.json +8 -8
- package/node_modules/pi-agent-web-html/package.json +3 -3
- package/node_modules/pi-agent-web-html/src/html-converter.ts +1 -1
- package/node_modules/pi-agent-web-image/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/runtime/entry-92.js +2 -0
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-93.js +2 -0
- package/package.json +61 -58
- package/src/api/approval.ts +2 -0
- package/src/api/read.ts +2 -0
- package/src/api/standalone.ts +7 -0
- package/src/backend/doctor-workspace.ts +0 -3
- package/src/backend/process-metadata-worker.py +9 -18
- package/src/backend/process-metadata.ts +11 -44
- package/src/backend/registration.ts +0 -10
- package/src/backend/web-browser-worker.mjs +2 -17
- package/src/backend/web-browser.ts +1 -26
- package/src/composite/builtin-extensions.ts +8 -6
- package/src/composite/ide-alias-rendering.ts +18 -2
- package/src/composite/module-labels.ts +0 -4
- package/src/composite/preferences.ts +0 -36
- package/src/composite/settings-documentation.ts +1 -2
- package/src/composite/text-results.ts +61 -23
- package/src/documentation/extension.ts +39 -15
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +1 -1
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +8 -8
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/index.ts +9 -63
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +12 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-32.js +1 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/src/api/jq.ts +112 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-34.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-35.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-30.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +28 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -8
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/src/html-converter.ts +1 -1
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-92.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-93.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-89.js +2 -0
- package/src/extensions/pi-agent-read/package.json +12 -12
- package/src/extensions/pi-agent-read/runtime/entry-49.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-50.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-51.js +2 -0
- package/src/extensions/pi-agent-read/src/api/read-parameters.ts +4 -7
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +2 -0
- package/src/extensions/pi-agent-read/src/core/extension.ts +0 -8
- package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +47 -14
- package/src/extensions/pi-agent-read/src/core/tools/read/result-target.ts +3 -1
- package/src/extensions/pi-agent-read/src/core/tools/read/structured-result.ts +14 -2
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +21 -8
- package/src/extensions/pi-agent-search/package.json +9 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +34 -12
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +17 -15
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-57.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-59.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-60.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/file-search.ts +59 -25
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +61 -16
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/scoped-search.ts +9 -3
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +44 -48
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-presentation.ts +19 -15
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +2 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +6 -2
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/tool-file-search.ts +146 -0
- package/src/extensions/pi-agent-search/runtime/entry-54.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-55.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-56.js +2 -0
- package/src/extensions/pi-agent-search/src/api/glob-list.ts +35 -0
- package/src/extensions/pi-agent-search/src/api/search-parameters.ts +8 -8
- package/src/extensions/pi-agent-search/src/api/search.ts +14 -2
- package/src/extensions/pi-agent-search/src/core/extension.ts +11 -20
- package/src/extensions/pi-agent-search/src/core/search-core.ts +30 -10
- package/src/extensions/pi-agent-text-editor/package.json +26 -26
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/anchor.ts +6 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +1 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-65.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-66.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +6 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-84.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +18 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +6 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-85.js +2 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-81.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-82.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-83.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/edit-pipeline.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +23 -0
- package/src/extensions/pi-agent-text-editor/src/api/text-selection-anchor.ts +31 -1
- package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +11 -21
- package/src/extensions/pi-agent-text-editor/src/core/editing-guidelines.ts +5 -5
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +13 -7
- package/src/extensions/pi-agent-text-editor/src/core/file-operation-guards.ts +22 -4
- package/src/extensions/pi-agent-text-editor/src/core/image-write.ts +111 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +3 -0
- package/src/extensions/pi-agent-text-editor/src/core/structured-result.ts +5 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +8 -2
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +103 -20
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +146 -62
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +14 -19
- package/src/extensions/pi-agent-text-editor/src/tools/text-selection.ts +43 -12
- package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +5 -5
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +6 -5
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +3 -7
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +6 -8
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +9 -6
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +3 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +37 -22
- package/src/pi-agent-ide.ts +8 -15
- package/src/plugins/pi-agent-ide-ast/package.json +15 -15
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +8 -8
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +104 -26
- package/src/plugins/pi-agent-ide-ast/src/tool-ast-search.ts +210 -0
- package/src/plugins/pi-agent-ide-changes/index.ts +1 -2
- package/src/plugins/pi-agent-ide-changes/package.json +10 -10
- package/src/plugins/pi-agent-ide-changes/runtime/entry-38.js +1 -0
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +3 -3
- package/src/plugins/pi-agent-ide-debugger/index.ts +17 -4
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +2 -11
- package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-lint/package.json +8 -8
- package/src/plugins/pi-agent-ide-lint/runtime/entry-42.js +2 -0
- package/src/plugins/pi-agent-ide-lsp/index.ts +22 -28
- package/src/plugins/pi-agent-ide-lsp/package.json +14 -10
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-43.js +2 -0
- package/src/plugins/pi-agent-ide-lsp/src/declaration-targets.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/src/lsp/code-views.ts +8 -84
- package/src/plugins/pi-agent-ide-lsp/src/lsp/index.ts +1 -6
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +11 -11
- package/src/plugins/pi-agent-ide-lsp/src/manager-provider.ts +8 -0
- package/src/plugins/pi-agent-ide-lsp/src/rename-plan.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +234 -36
- package/src/plugins/pi-agent-ide-lsp/src/tool-lsp-search.ts +212 -0
- package/src/plugins/pi-agent-ide-processes/src/ui.ts +61 -16
- package/src/plugins/pi-agent-ide-terminal/index.ts +1 -1
- package/src/plugins/pi-agent-ide-terminal/src/resources.ts +10 -7
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +1 -3
- package/src/standalone/resource-host.ts +147 -0
- package/src/standalone/scoped-api.ts +457 -0
- package/dist/chunk-2RTCSZB3.js +0 -1
- package/dist/chunk-4DIUPEDF.js +0 -2
- package/dist/chunk-6EDOLYOV.js +0 -1
- package/dist/chunk-6FGLAVPJ.js +0 -1
- package/dist/chunk-6H32W35W.js +0 -1
- package/dist/chunk-6OJ565FL.js +0 -2
- package/dist/chunk-6R3Y4AD3.js +0 -1
- package/dist/chunk-6TJPMBUQ.js +0 -1
- package/dist/chunk-6XFUICD7.js +0 -1
- package/dist/chunk-BHSO2MDK.js +0 -6
- package/dist/chunk-GSOYVIQS.js +0 -1
- package/dist/chunk-HSRH76JN.js +0 -3
- package/dist/chunk-HSZ4AQ6L.js +0 -9
- package/dist/chunk-I6NPILT5.js +0 -1
- package/dist/chunk-K7SRNBIV.js +0 -1
- package/dist/chunk-LCWBVOII.js +0 -3
- package/dist/chunk-MKEC3U2M.js +0 -4
- package/dist/chunk-NUM3YQGK.js +0 -1
- package/dist/chunk-OM4LYD3S.js +0 -1
- package/dist/chunk-PLKYHUNT.js +0 -1
- package/dist/chunk-QIJMV2P2.js +0 -2
- package/dist/chunk-RVU73VKN.js +0 -2
- package/dist/chunk-SDAH3ECM.js +0 -5
- package/dist/chunk-SGQWRIRJ.js +0 -10
- package/dist/chunk-SWBJS3U4.js +0 -1
- package/dist/chunk-T7I2VX3J.js +0 -1
- package/dist/chunk-T7MWQQIF.js +0 -3
- package/dist/chunk-VDP5CQHM.js +0 -3
- package/dist/chunk-XG7QNAKW.js +0 -9
- package/dist/chunk-XLWCSJMR.js +0 -1
- package/dist/chunk-YFP4P2FV.js +0 -1
- package/dist/chunk-YIXP2ALP.js +0 -9
- package/dist/entry-22.js +0 -1
- package/docs/agent-guides/diagnostics.md +0 -5
- package/docs/agent-guides/json-reading.md +0 -57
- package/docs/agent-guides/read-resources.md +0 -17
- package/docs/agent-guides/search-code.md +0 -76
- package/docs/agent-guides/select-code.md +0 -119
- package/docs/agent-guides/vision.md +0 -11
- package/node_modules/pi-agent-doctor/runtime/entry-22.js +0 -1
- package/node_modules/pi-agent-filesystem/runtime/entry-29.js +0 -2
- package/node_modules/pi-agent-filesystem-pdf/runtime/entry-32.js +0 -2
- package/node_modules/pi-agent-ide-ast/runtime/entry-34.js +0 -1
- package/node_modules/pi-agent-ide-ast/src/ast/constructs.ts +0 -193
- package/node_modules/pi-agent-ide-ast/src/ast/element-extent.ts +0 -59
- package/node_modules/pi-agent-ide-ast/src/ast/selection.ts +0 -204
- package/node_modules/pi-agent-ide-ast/src/geometry-selection.ts +0 -184
- package/node_modules/pi-agent-ide-ast/src/select-presentation.ts +0 -105
- package/node_modules/pi-agent-ide-ast/src/select-schema.ts +0 -387
- package/node_modules/pi-agent-ide-ast/src/selection-region.ts +0 -41
- package/node_modules/pi-agent-ide-ast/src/source-text.ts +0 -92
- package/node_modules/pi-agent-ide-ast/src/text-selection.ts +0 -214
- package/node_modules/pi-agent-ide-ast/src/tool-select.ts +0 -277
- package/node_modules/pi-agent-ide-formatter/runtime/entry-38.js +0 -2
- package/node_modules/pi-agent-ide-lsp/src/code-view-resolvers.ts +0 -136
- package/node_modules/pi-agent-image/runtime/entry-42.js +0 -1
- package/node_modules/pi-agent-invariant/runtime/entry-43.js +0 -1
- package/node_modules/pi-agent-search/runtime/entry-51.js +0 -1
- package/node_modules/pi-agent-search-text/runtime/entry-55.js +0 -2
- package/node_modules/pi-agent-search-text/runtime/entry-56.js +0 -1
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-60.js +0 -2
- package/node_modules/pi-agent-text-editor/runtime/entry-66.js +0 -1
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-82.js +0 -2
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-84.js +0 -1
- package/node_modules/pi-agent-tool-ui/runtime/entry-85.js +0 -1
- package/node_modules/pi-agent-web/runtime/entry-87.js +0 -2
- package/node_modules/pi-agent-web-html/runtime/entry-88.js +0 -2
- package/src/backend/vision-capture-worker.py +0 -319
- package/src/backend/vision-capture.ts +0 -165
- package/src/backend/vision-registration.ts +0 -104
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-30.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-32.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-29.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-88.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-89.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-87.js +0 -2
- package/src/extensions/pi-agent-read/runtime/entry-45.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-46.js +0 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-55.js +0 -2
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-56.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-51.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-52.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-60.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-61.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-82.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-83.js +0 -2
- package/src/extensions/pi-agent-text-editor/runtime/entry-65.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-66.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-34.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-35.js +0 -2
- package/src/plugins/pi-agent-ide-ast/src/ast/constructs.ts +0 -193
- package/src/plugins/pi-agent-ide-ast/src/ast/element-extent.ts +0 -59
- package/src/plugins/pi-agent-ide-ast/src/ast/selection.ts +0 -204
- package/src/plugins/pi-agent-ide-ast/src/geometry-selection.ts +0 -184
- package/src/plugins/pi-agent-ide-ast/src/select-presentation.ts +0 -105
- package/src/plugins/pi-agent-ide-ast/src/select-schema.ts +0 -387
- package/src/plugins/pi-agent-ide-ast/src/selection-region.ts +0 -41
- package/src/plugins/pi-agent-ide-ast/src/source-text.ts +0 -92
- package/src/plugins/pi-agent-ide-ast/src/text-selection.ts +0 -214
- package/src/plugins/pi-agent-ide-ast/src/tool-select.ts +0 -277
- package/src/plugins/pi-agent-ide-formatter/runtime/entry-38.js +0 -2
- package/src/plugins/pi-agent-ide-lsp/src/code-view-resolvers.ts +0 -136
- package/src/plugins/pi-agent-ide-vision/index.ts +0 -439
- package/src/plugins/pi-agent-ide-vision/src/doctor-plugin.ts +0 -47
- package/src/plugins/pi-agent-ide-vision/src/vision.ts +0 -585
- package/src/plugins/pi-agent-ide-vision/src/windows-display-capture.ps1 +0 -30
- package/src/plugins/pi-agent-ide-vision/src/windows-window-capture.ps1 +0 -33
- /package/dist/{chunk-U2JKHKLK.js → chunk-3PMHFEJY.js} +0 -0
- /package/node_modules/{pi-agent-documentation → pi-agent-doctor}/runtime/entry-28.js +0 -0
- /package/node_modules/{pi-agent-filesystem-image → pi-agent-filesystem}/runtime/entry-30.js +0 -0
- /package/node_modules/{pi-agent-filesystem-jq → pi-agent-filesystem-image}/runtime/entry-31.js +0 -0
- /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-jq}/runtime/entry-33.js +0 -0
- /package/node_modules/{pi-agent-ide-ast → pi-agent-filesystem-text}/runtime/entry-35.js +0 -0
- /package/node_modules/{pi-agent-ide-changes → pi-agent-ide-ast}/runtime/entry-36.js +0 -0
- /package/node_modules/{pi-agent-ide-changes → pi-agent-ide-ast}/runtime/entry-37.js +0 -0
- /package/node_modules/{pi-agent-ide-languages → pi-agent-ide-changes}/runtime/entry-39.js +0 -0
- /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-formatter}/runtime/entry-40.js +0 -0
- /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-languages}/runtime/entry-41.js +0 -0
- /package/node_modules/{pi-agent-pdf → pi-agent-image}/runtime/entry-44.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-invariant}/runtime/entry-45.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-46.js +0 -0
- /package/node_modules/{pi-agent-resource → pi-agent-read}/runtime/entry-50.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-52.js +0 -0
- /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-59.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-exact → pi-agent-text}/runtime/entry-61.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-exact → pi-agent-text-anchor-constant}/runtime/entry-62.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-exact}/runtime/entry-63.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-exact}/runtime/entry-64.js +0 -0
- /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-line-hash}/runtime/entry-65.js +0 -0
- /package/node_modules/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor}/runtime/entry-83.js +0 -0
- /package/node_modules/{pi-agent-tool-ui → pi-agent-tool-call-interception}/runtime/entry-86.js +0 -0
- /package/node_modules/{pi-agent-web-image → pi-agent-web}/runtime/entry-89.js +0 -0
- /package/node_modules/{pi-agent-web-pdf → pi-agent-web-html}/runtime/entry-90.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web-image}/runtime/entry-91.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-jq → pi-agent-filesystem-image}/runtime/entry-31.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-jq}/runtime/entry-33.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-pdf → pi-agent-web-html}/runtime/entry-90.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-image}/runtime/entry-91.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-anchor-exact → pi-agent-text-anchor-constant}/runtime/entry-62.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-exact}/runtime/entry-63.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-exact}/runtime/entry-64.js +0 -0
- /package/src/plugins/{pi-agent-ide-changes → pi-agent-ide-ast}/runtime/entry-36.js +0 -0
- /package/src/plugins/{pi-agent-ide-changes → pi-agent-ide-ast}/runtime/entry-37.js +0 -0
- /package/src/plugins/{pi-agent-ide-languages → pi-agent-ide-changes}/runtime/entry-39.js +0 -0
- /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-formatter}/runtime/entry-40.js +0 -0
- /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-languages}/runtime/entry-41.js +0 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import type { AgentToolResult, ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { Text } from "@earendil-works/pi-tui";
|
|
3
|
+
import {
|
|
4
|
+
searchOutputSchema,
|
|
5
|
+
type SearchPluginApi,
|
|
6
|
+
type SearchResolver,
|
|
7
|
+
type SearchToolDetails,
|
|
8
|
+
} from "pi-agent-search/api/search";
|
|
9
|
+
import {
|
|
10
|
+
ToolCallInterceptionRenderStore,
|
|
11
|
+
withToolCallInterceptionRendering,
|
|
12
|
+
} from "pi-agent-tool-call-interception";
|
|
13
|
+
import { toolCallHeader } from "pi-agent-tool-ui";
|
|
14
|
+
import { Type, type Static } from "typebox";
|
|
15
|
+
|
|
16
|
+
import type { FileSearchOptions } from "#src/resolvers.js";
|
|
17
|
+
|
|
18
|
+
export const fileSearchSchema = Type.Object(
|
|
19
|
+
{
|
|
20
|
+
pattern: Type.String({
|
|
21
|
+
minLength: 1,
|
|
22
|
+
description:
|
|
23
|
+
"Glob (*, **, ?, [abc], {a,b}) or plain text matched as a case-insensitive subsequence. A glob with / matches paths relative to path; one without / matches file names at any depth.",
|
|
24
|
+
}),
|
|
25
|
+
path: Type.Optional(
|
|
26
|
+
Type.String({ description: "Directory to search, local or ssh://; defaults to cwd." }),
|
|
27
|
+
),
|
|
28
|
+
include: Type.Optional(Type.String({ description: "Include glob" })),
|
|
29
|
+
exclude: Type.Optional(Type.String({ description: "Exclude glob" })),
|
|
30
|
+
limit: Type.Optional(
|
|
31
|
+
Type.Integer({ minimum: 1, maximum: 1000, description: "Maximum files (default 100)." }),
|
|
32
|
+
),
|
|
33
|
+
},
|
|
34
|
+
{ additionalProperties: false },
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
export type FileSearchParameters = Static<typeof fileSearchSchema>;
|
|
38
|
+
|
|
39
|
+
/** Register the file-path search tool; it runs `resolver` through the shared Search core only. */
|
|
40
|
+
export function registerFileSearchTool(
|
|
41
|
+
pi: ExtensionAPI,
|
|
42
|
+
resolver: SearchResolver,
|
|
43
|
+
search: Promise<SearchPluginApi>,
|
|
44
|
+
): void {
|
|
45
|
+
pi.registerTool(
|
|
46
|
+
withToolCallInterceptionRendering(
|
|
47
|
+
{
|
|
48
|
+
name: "file_search",
|
|
49
|
+
label: "file_search",
|
|
50
|
+
exposure: "direct",
|
|
51
|
+
namespace: { name: "ide_file_search", description: "Find files by path." },
|
|
52
|
+
annotations: {
|
|
53
|
+
readOnlyHint: true,
|
|
54
|
+
destructiveHint: false,
|
|
55
|
+
idempotentHint: false,
|
|
56
|
+
openWorldHint: false,
|
|
57
|
+
},
|
|
58
|
+
description:
|
|
59
|
+
"Use file_search to find file paths by glob or partial name, locally or over SSH. Pass a returned path to read or an edit tool.",
|
|
60
|
+
promptSnippet: "Find file paths by glob or partial name",
|
|
61
|
+
parameters: fileSearchSchema,
|
|
62
|
+
outputSchema: searchOutputSchema,
|
|
63
|
+
renderCall(parameters, theme, context) {
|
|
64
|
+
return toolCallHeader(
|
|
65
|
+
context.lastComponent,
|
|
66
|
+
{
|
|
67
|
+
tool: "file_search",
|
|
68
|
+
primary: { text: parameters.pattern, color: "accent", truncate: "end" },
|
|
69
|
+
qualifiers: [
|
|
70
|
+
...(parameters.path === undefined
|
|
71
|
+
? []
|
|
72
|
+
: [
|
|
73
|
+
{
|
|
74
|
+
text: `in ${parameters.path}`,
|
|
75
|
+
color: "accent" as const,
|
|
76
|
+
truncate: "start" as const,
|
|
77
|
+
},
|
|
78
|
+
]),
|
|
79
|
+
...(parameters.include === undefined
|
|
80
|
+
? []
|
|
81
|
+
: [{ text: `include ${parameters.include}` }]),
|
|
82
|
+
...(parameters.exclude === undefined
|
|
83
|
+
? []
|
|
84
|
+
: [{ text: `exclude ${parameters.exclude}` }]),
|
|
85
|
+
...(parameters.limit === undefined
|
|
86
|
+
? []
|
|
87
|
+
: [{ text: `limit ${String(parameters.limit)}` }]),
|
|
88
|
+
],
|
|
89
|
+
expanded: context.expanded,
|
|
90
|
+
},
|
|
91
|
+
theme,
|
|
92
|
+
);
|
|
93
|
+
},
|
|
94
|
+
renderResult(result, options, theme, context) {
|
|
95
|
+
const details = result.details as SearchToolDetails | undefined;
|
|
96
|
+
if (
|
|
97
|
+
resolver.renderResult !== undefined &&
|
|
98
|
+
details?.payload !== undefined &&
|
|
99
|
+
!context.isError &&
|
|
100
|
+
!options.isPartial
|
|
101
|
+
)
|
|
102
|
+
return resolver.renderResult(
|
|
103
|
+
{ ...result, details: details.payload },
|
|
104
|
+
options,
|
|
105
|
+
theme,
|
|
106
|
+
context,
|
|
107
|
+
);
|
|
108
|
+
return new Text(
|
|
109
|
+
result.content.flatMap((part) => (part.type === "text" ? [part.text] : [])).join("\n"),
|
|
110
|
+
0,
|
|
111
|
+
0,
|
|
112
|
+
);
|
|
113
|
+
},
|
|
114
|
+
async execute(
|
|
115
|
+
_id,
|
|
116
|
+
parameters: FileSearchParameters,
|
|
117
|
+
signal,
|
|
118
|
+
onUpdate,
|
|
119
|
+
context,
|
|
120
|
+
): Promise<AgentToolResult<SearchToolDetails>> {
|
|
121
|
+
const options: FileSearchOptions = { pattern: parameters.pattern };
|
|
122
|
+
return (await (
|
|
123
|
+
await search
|
|
124
|
+
).searchWith(
|
|
125
|
+
resolver,
|
|
126
|
+
{
|
|
127
|
+
// The resolver reads options; the query is the label kept with the result.
|
|
128
|
+
query: parameters.pattern,
|
|
129
|
+
...(parameters.path === undefined ? {} : { path: parameters.path }),
|
|
130
|
+
...(parameters.include === undefined ? {} : { include: parameters.include }),
|
|
131
|
+
...(parameters.exclude === undefined ? {} : { exclude: parameters.exclude }),
|
|
132
|
+
...(parameters.limit === undefined ? {} : { limit: parameters.limit }),
|
|
133
|
+
options: { files: options },
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
cwd: context.cwd,
|
|
137
|
+
...(signal !== undefined && { signal }),
|
|
138
|
+
...(onUpdate !== undefined && { onUpdate }),
|
|
139
|
+
},
|
|
140
|
+
)) as AgentToolResult<SearchToolDetails>;
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
new ToolCallInterceptionRenderStore(),
|
|
144
|
+
),
|
|
145
|
+
);
|
|
146
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./src/index.ts",
|
|
6
6
|
"imports": {
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
11
|
"types": "./src/index.ts",
|
|
12
|
-
"default": "./runtime/entry-
|
|
12
|
+
"default": "./runtime/entry-61.js"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"pi-agent-resource": "0.
|
|
16
|
+
"pi-agent-resource": "0.9.0"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"typebox": "*"
|
|
@@ -25,7 +25,7 @@ const textualAppMediaTypes = new Set([
|
|
|
25
25
|
export function createTextContentConverter(): ContentConverter {
|
|
26
26
|
return {
|
|
27
27
|
id: "text",
|
|
28
|
-
description: "Text file
|
|
28
|
+
description: "Text file — its text.",
|
|
29
29
|
tryConvert(input, context) {
|
|
30
30
|
return Promise.resolve(convertText(input, context));
|
|
31
31
|
},
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-anchor-constant",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"pi-agent-text": "0.
|
|
10
|
-
"pi-agent-text-editor": "0.
|
|
9
|
+
"pi-agent-text": "0.9.0",
|
|
10
|
+
"pi-agent-text-editor": "0.9.0"
|
|
11
11
|
},
|
|
12
12
|
"pi": {
|
|
13
13
|
"extensions": [
|
|
14
|
-
"./runtime/entry-
|
|
14
|
+
"./runtime/entry-62.js"
|
|
15
15
|
]
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-anchor-exact",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./api/anchor": {
|
|
10
10
|
"types": "./src/anchor.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-63.js"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"pi-agent-text": "0.
|
|
16
|
-
"pi-agent-text-editor": "0.
|
|
15
|
+
"pi-agent-text": "0.9.0",
|
|
16
|
+
"pi-agent-text-editor": "0.9.0"
|
|
17
17
|
},
|
|
18
18
|
"pi": {
|
|
19
19
|
"extensions": [
|
|
20
|
-
"./runtime/entry-
|
|
20
|
+
"./runtime/entry-64.js"
|
|
21
21
|
]
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
@@ -90,7 +90,12 @@ export function resolveExactTextAnchor(
|
|
|
90
90
|
};
|
|
91
91
|
return {
|
|
92
92
|
kind: "resolved",
|
|
93
|
-
anchor: new TextSelectionAnchor(
|
|
93
|
+
anchor: new TextSelectionAnchor(
|
|
94
|
+
value,
|
|
95
|
+
context.source,
|
|
96
|
+
[range],
|
|
97
|
+
[{ start: range.start, end: positionAt(context.content, endOffset) }],
|
|
98
|
+
),
|
|
94
99
|
};
|
|
95
100
|
}
|
|
96
101
|
|
|
@@ -26,8 +26,7 @@ export default async function registerLineHashTextAnchor(pi: ExtensionAPI): Prom
|
|
|
26
26
|
setup(api) {
|
|
27
27
|
api.addView({ view: "anchors", presenter });
|
|
28
28
|
api.describe({
|
|
29
|
-
views:
|
|
30
|
-
"anchors — annotate text with returned line references in the form LINE#HASH, e.g. 12#A4F0 (line number 12 and its content hash). These references select source lines in edits or path#anchor reads; display annotations are not file content.",
|
|
29
|
+
views: "anchors — LINE#HASH references for edits.",
|
|
31
30
|
});
|
|
32
31
|
},
|
|
33
32
|
} satisfies ReadPlugin;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-anchor-line-hash",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,18 +8,18 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./api/anchor": {
|
|
10
10
|
"types": "./src/anchor.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-65.js"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"pi-agent-invariant": "0.
|
|
16
|
-
"pi-agent-read": "0.
|
|
17
|
-
"pi-agent-text": "0.
|
|
18
|
-
"pi-agent-text-editor": "0.
|
|
15
|
+
"pi-agent-invariant": "0.9.0",
|
|
16
|
+
"pi-agent-read": "0.9.0",
|
|
17
|
+
"pi-agent-text": "0.9.0",
|
|
18
|
+
"pi-agent-text-editor": "0.9.0"
|
|
19
19
|
},
|
|
20
20
|
"pi": {
|
|
21
21
|
"extensions": [
|
|
22
|
-
"./runtime/entry-
|
|
22
|
+
"./runtime/entry-66.js"
|
|
23
23
|
]
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,82 +8,82 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./api/anchor-inspection": {
|
|
10
10
|
"types": "./src/api/anchor-inspection.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-67.js"
|
|
12
12
|
},
|
|
13
13
|
"./api/connect-plugin": {
|
|
14
14
|
"types": "./src/api/connect-plugin.ts",
|
|
15
|
-
"default": "./runtime/entry-
|
|
15
|
+
"default": "./runtime/entry-68.js"
|
|
16
16
|
},
|
|
17
17
|
"./api/edit-completion": {
|
|
18
18
|
"types": "./src/api/edit-completion.ts",
|
|
19
|
-
"default": "./runtime/entry-
|
|
19
|
+
"default": "./runtime/entry-69.js"
|
|
20
20
|
},
|
|
21
21
|
"./api/edit-pipeline": {
|
|
22
22
|
"types": "./src/api/edit-pipeline.ts",
|
|
23
|
-
"default": "./runtime/entry-
|
|
23
|
+
"default": "./runtime/entry-70.js"
|
|
24
24
|
},
|
|
25
25
|
"./api/plugin-protocol": {
|
|
26
26
|
"types": "./src/api/plugin-protocol.ts",
|
|
27
|
-
"default": "./runtime/entry-
|
|
27
|
+
"default": "./runtime/entry-71.js"
|
|
28
28
|
},
|
|
29
29
|
"./api/stale-anchor-message": {
|
|
30
30
|
"types": "./src/api/stale-anchor-message.ts",
|
|
31
|
-
"default": "./runtime/entry-
|
|
31
|
+
"default": "./runtime/entry-72.js"
|
|
32
32
|
},
|
|
33
33
|
"./api/text-selection-anchor": {
|
|
34
34
|
"types": "./src/api/text-selection-anchor.ts",
|
|
35
|
-
"default": "./runtime/entry-
|
|
35
|
+
"default": "./runtime/entry-73.js"
|
|
36
36
|
},
|
|
37
37
|
"./api/post-edit": {
|
|
38
38
|
"types": "./src/api/post-edit.ts",
|
|
39
|
-
"default": "./runtime/entry-
|
|
39
|
+
"default": "./runtime/entry-74.js"
|
|
40
40
|
},
|
|
41
41
|
"./api/native-edit-batch-event": {
|
|
42
42
|
"types": "./src/api/native-edit-batch-event.ts",
|
|
43
|
-
"default": "./runtime/entry-
|
|
43
|
+
"default": "./runtime/entry-75.js"
|
|
44
44
|
},
|
|
45
45
|
"./api/mutation-result": {
|
|
46
46
|
"types": "./src/api/mutation-result.ts",
|
|
47
|
-
"default": "./runtime/entry-
|
|
47
|
+
"default": "./runtime/entry-76.js"
|
|
48
48
|
},
|
|
49
49
|
"./api/mutation-guard": {
|
|
50
50
|
"types": "./src/api/mutation-guard.ts",
|
|
51
|
-
"default": "./runtime/entry-
|
|
51
|
+
"default": "./runtime/entry-77.js"
|
|
52
52
|
},
|
|
53
53
|
"./api/mutation-tool": {
|
|
54
54
|
"types": "./src/api/mutation-tool.ts",
|
|
55
|
-
"default": "./runtime/entry-
|
|
55
|
+
"default": "./runtime/entry-78.js"
|
|
56
56
|
},
|
|
57
57
|
"./api/mutation-preview": {
|
|
58
58
|
"types": "./src/api/mutation-preview.ts",
|
|
59
|
-
"default": "./runtime/entry-
|
|
59
|
+
"default": "./runtime/entry-79.js"
|
|
60
60
|
},
|
|
61
61
|
"./api/last-resolved-resource": {
|
|
62
62
|
"types": "./src/api/last-resolved-resource.ts",
|
|
63
|
-
"default": "./runtime/entry-
|
|
63
|
+
"default": "./runtime/entry-80.js"
|
|
64
64
|
},
|
|
65
65
|
"./api/tool-call-interceptor": {
|
|
66
66
|
"types": "./src/api/tool-call-interceptor.ts",
|
|
67
|
-
"default": "./runtime/entry-
|
|
67
|
+
"default": "./runtime/entry-81.js"
|
|
68
68
|
},
|
|
69
69
|
"./api/tool-renderer": {
|
|
70
70
|
"types": "./src/api/tool-renderer.ts",
|
|
71
|
-
"default": "./runtime/entry-
|
|
71
|
+
"default": "./runtime/entry-82.js"
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"pi-agent-documentation": "0.
|
|
76
|
-
"pi-agent-invariant": "0.
|
|
77
|
-
"pi-agent-read": "0.
|
|
78
|
-
"pi-agent-resource": "0.
|
|
79
|
-
"pi-agent-search": "0.
|
|
80
|
-
"pi-agent-text": "0.
|
|
81
|
-
"pi-agent-tool-call-interception": "0.
|
|
82
|
-
"pi-agent-tool-ui": "0.
|
|
75
|
+
"pi-agent-documentation": "0.9.0",
|
|
76
|
+
"pi-agent-invariant": "0.9.0",
|
|
77
|
+
"pi-agent-read": "0.9.0",
|
|
78
|
+
"pi-agent-resource": "0.9.0",
|
|
79
|
+
"pi-agent-search": "0.9.0",
|
|
80
|
+
"pi-agent-text": "0.9.0",
|
|
81
|
+
"pi-agent-tool-call-interception": "0.9.0",
|
|
82
|
+
"pi-agent-tool-ui": "0.9.0"
|
|
83
83
|
},
|
|
84
84
|
"pi": {
|
|
85
85
|
"extensions": [
|
|
86
|
-
"./runtime/entry-
|
|
86
|
+
"./runtime/entry-83.js"
|
|
87
87
|
]
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../dist/entry-82.js";
|
|
@@ -48,6 +48,8 @@ export interface TextEditorToolPluginApi {
|
|
|
48
48
|
addSemanticHandler(handler: TextSemanticMutationHandler): void;
|
|
49
49
|
addHandler(registration: TextEditHandlerRegistration): void;
|
|
50
50
|
describe(description: string): void;
|
|
51
|
+
/** Add this plugin's text to one schema field of the tool, such as `path` or `text`. */
|
|
52
|
+
describeField(field: string, description: string): void;
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
export interface TextEditPipelineFailure {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TextEditIntent } from "#src/api/edit-completion.js";
|
|
2
2
|
import type { TextChange, TextChangeDocument } from "#src/core/text-change-engine.js";
|
|
3
|
+
import type { ImageContent } from "pi-agent-resource";
|
|
3
4
|
import type { TextAnchor } from "pi-agent-text";
|
|
4
5
|
import type { Static, TSchema } from "typebox";
|
|
5
6
|
|
|
@@ -60,6 +61,23 @@ export function isMutationAnchorValue(
|
|
|
60
61
|
);
|
|
61
62
|
}
|
|
62
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Returns call arguments without empty optional anchors. An empty selector is no anchor, so
|
|
66
|
+
* models that send `""` for a selector they mean to omit get the omitted behavior.
|
|
67
|
+
*/
|
|
68
|
+
export function withoutEmptyOptionalAnchors<T extends Record<string, unknown>>(
|
|
69
|
+
anchors: readonly TextMutationAnchorField[] | undefined,
|
|
70
|
+
arguments_: T,
|
|
71
|
+
): T {
|
|
72
|
+
const empty = (anchors ?? []).filter(
|
|
73
|
+
({ field, optional }) => optional === true && arguments_[field] === "",
|
|
74
|
+
);
|
|
75
|
+
if (empty.length === 0) return arguments_;
|
|
76
|
+
const prepared: Record<string, unknown> = { ...arguments_ };
|
|
77
|
+
for (const { field } of empty) delete prepared[field];
|
|
78
|
+
return prepared as T;
|
|
79
|
+
}
|
|
80
|
+
|
|
63
81
|
/** A non-file effect performed through an existing text mutation tool. */
|
|
64
82
|
export interface TextSemanticMutationResult {
|
|
65
83
|
/** Addressable resource created or changed by the action. */
|
|
@@ -73,6 +91,11 @@ export interface TextSemanticMutationResult {
|
|
|
73
91
|
* The call then resolves with this value even when `data.ok` is false, so scripts branch on it without try/catch.
|
|
74
92
|
*/
|
|
75
93
|
readonly script?: Readonly<Record<string, unknown>>;
|
|
94
|
+
/**
|
|
95
|
+
* Images shown to the model after the summary, such as before/after crops of an action's effect.
|
|
96
|
+
* They stay out of result details; Codemode scripts still receive `script`.
|
|
97
|
+
*/
|
|
98
|
+
readonly images?: readonly ImageContent[];
|
|
76
99
|
}
|
|
77
100
|
|
|
78
101
|
/** Handles one tool invocation after its current source and anchors are available. */
|
|
@@ -8,6 +8,8 @@ const textSelectionAnchorBrand = Symbol.for("pi-agent-text-editor/TextSelectionA
|
|
|
8
8
|
export class TextSelectionAnchor extends TextAnchor {
|
|
9
9
|
readonly [textSelectionAnchorBrand] = true;
|
|
10
10
|
public readonly ranges: readonly TextSelectionRange[];
|
|
11
|
+
/** Unexpanded selector extents for paired range endpoints; defaults to ranges. */
|
|
12
|
+
public readonly endpointRanges?: readonly TextSelectionRange[];
|
|
11
13
|
|
|
12
14
|
public static is(value: unknown): value is TextSelectionAnchor {
|
|
13
15
|
if (!TextAnchor.is(value)) {
|
|
@@ -23,7 +25,11 @@ export class TextSelectionAnchor extends TextAnchor {
|
|
|
23
25
|
candidate.source.length > 0 &&
|
|
24
26
|
Array.isArray(ranges) &&
|
|
25
27
|
ranges.length > 0 &&
|
|
26
|
-
ranges.every(isTextSelectionRange)
|
|
28
|
+
ranges.every(isTextSelectionRange) &&
|
|
29
|
+
(candidate.endpointRanges === undefined ||
|
|
30
|
+
(Array.isArray(candidate.endpointRanges) &&
|
|
31
|
+
candidate.endpointRanges.length === ranges.length &&
|
|
32
|
+
candidate.endpointRanges.every(isTextSelectionRange)))
|
|
27
33
|
);
|
|
28
34
|
} catch {
|
|
29
35
|
return false;
|
|
@@ -34,6 +40,7 @@ export class TextSelectionAnchor extends TextAnchor {
|
|
|
34
40
|
value: string,
|
|
35
41
|
readonly source: string,
|
|
36
42
|
ranges: readonly TextSelectionRange[],
|
|
43
|
+
endpointRanges?: readonly TextSelectionRange[],
|
|
37
44
|
) {
|
|
38
45
|
const copied = ranges.map((range) => ({
|
|
39
46
|
start: { ...range.start },
|
|
@@ -48,6 +55,29 @@ export class TextSelectionAnchor extends TextAnchor {
|
|
|
48
55
|
}
|
|
49
56
|
|
|
50
57
|
this.ranges = copied;
|
|
58
|
+
if (endpointRanges !== undefined) {
|
|
59
|
+
const endpoints = endpointRanges.map((range) => ({
|
|
60
|
+
start: { ...range.start },
|
|
61
|
+
end: { ...range.end },
|
|
62
|
+
...(range.linewise === true && { linewise: true }),
|
|
63
|
+
}));
|
|
64
|
+
assertSelectionRanges(endpoints);
|
|
65
|
+
if (
|
|
66
|
+
endpoints.length !== copied.length ||
|
|
67
|
+
endpoints.some((range, index) => {
|
|
68
|
+
const outer = requiredValue(copied[index]);
|
|
69
|
+
return (
|
|
70
|
+
comparePositions(range.start, outer.start) < 0 ||
|
|
71
|
+
comparePositions(range.end, outer.end) > 0
|
|
72
|
+
);
|
|
73
|
+
})
|
|
74
|
+
) {
|
|
75
|
+
throw new RangeError(
|
|
76
|
+
"Endpoint ranges must stay within their corresponding selection ranges",
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
this.endpointRanges = endpoints;
|
|
80
|
+
}
|
|
51
81
|
}
|
|
52
82
|
}
|
|
53
83
|
|
|
@@ -33,26 +33,17 @@ export const diffDataSchema = Type.Object(
|
|
|
33
33
|
);
|
|
34
34
|
export const diffOutputSchema = structuredResultSchema(diffDataSchema);
|
|
35
35
|
|
|
36
|
+
// The before field points to read's fields, so the nested copies carry no descriptions.
|
|
36
37
|
const comparisonReadParameters = {
|
|
37
38
|
...readParameters,
|
|
38
|
-
properties:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
...readParameters.properties.offset,
|
|
47
|
-
description:
|
|
48
|
-
"First text line to compare, numbered from 1. Omit or use 0 to start at line 1; negative offsets count from the end. For path#anchor, SEARCH# or RESULT# selections, count from the containing line: omitted, 0 or 1 starts there, 2 starts one line later, -1 one line earlier.",
|
|
49
|
-
},
|
|
50
|
-
limit: {
|
|
51
|
-
...readParameters.properties.limit,
|
|
52
|
-
description:
|
|
53
|
-
"Maximum text lines to compare from the selected starting position. Omit to compare all resolved text in the selected range. Read's display limits do not shorten the comparison inputs.",
|
|
54
|
-
},
|
|
55
|
-
},
|
|
39
|
+
properties: Object.fromEntries(
|
|
40
|
+
Object.entries(readParameters.properties).map(([name, property]) => {
|
|
41
|
+
const { description: _description, ...undescribed } = property as typeof property & {
|
|
42
|
+
description?: string;
|
|
43
|
+
};
|
|
44
|
+
return [name, undescribed];
|
|
45
|
+
}),
|
|
46
|
+
) as typeof readParameters.properties,
|
|
56
47
|
};
|
|
57
48
|
const source = Type.Union([Type.String({ minLength: 1 }), comparisonReadParameters]);
|
|
58
49
|
/** Each side accepts a source string or the same request object as read. */
|
|
@@ -61,12 +52,11 @@ export const diffParameters = Type.Object(
|
|
|
61
52
|
before: {
|
|
62
53
|
...source,
|
|
63
54
|
description:
|
|
64
|
-
"
|
|
55
|
+
"Removed (−) side: a source string as for read, or {path, offset, limit, views} with the same meaning as read's fields. A string names a source, not literal text.",
|
|
65
56
|
},
|
|
66
57
|
after: {
|
|
67
58
|
...source,
|
|
68
|
-
description:
|
|
69
|
-
"Source for the added (+) side. Supply a non-empty source reference string or a Read request object. Strings identify sources, not literal text.",
|
|
59
|
+
description: "Added (+) side, in the same form as before.",
|
|
70
60
|
},
|
|
71
61
|
},
|
|
72
62
|
{ additionalProperties: false },
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** Shared editing workflows owned by enabled mutation tools. */
|
|
2
2
|
export const EDITING_GUIDELINES = [
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
3
|
+
"Read only what you need: search for known text, find code by structure with ast_search or by symbol with lsp_search, and reuse anchors you already have.",
|
|
4
|
+
"Select with an anchor when you have one, otherwise with the shortest unique exact text.",
|
|
5
|
+
"Send independent edits as parallel calls in one response; each sees the files as they were before the batch, so merge overlapping edits into one. Use Codemode when an edit depends on another's result. Retry only the edits that failed.",
|
|
6
|
+
"Read, search and edit tools compose: pass an unchanged result to the next tool to narrow it or act on it. For example, read a function, search that result for a call, then replace that match.",
|
|
7
|
+
"In Codemode, edit different files concurrently and the same file in order.",
|
|
8
8
|
] as const;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import { connectResultTargets } from "pi-agent-resource";
|
|
2
|
+
import { connectResultImages, connectResultTargets } from "pi-agent-resource";
|
|
3
3
|
import { setMutationSnapshotReader } from "./mutation-result-targets.js";
|
|
4
4
|
import { registerTextEditOrigins } from "./text-edit-origin.js";
|
|
5
5
|
import { connectReadPlugin } from "pi-agent-read/api/connect-plugin";
|
|
@@ -51,6 +51,7 @@ export default async function registerTextEditorCore(
|
|
|
51
51
|
interceptionRendering.clear();
|
|
52
52
|
});
|
|
53
53
|
const resultTargets = connectResultTargets(pi);
|
|
54
|
+
const resultImages = connectResultImages(pi);
|
|
54
55
|
const mutationTools = new Set<string>();
|
|
55
56
|
const core = createTextEditorCore((registration, editor) => {
|
|
56
57
|
mutationTools.add(registration.name);
|
|
@@ -62,13 +63,20 @@ export default async function registerTextEditorCore(
|
|
|
62
63
|
() => getLastResolvedResource(pi)?.source,
|
|
63
64
|
resultTargets,
|
|
64
65
|
pi.events,
|
|
66
|
+
resultImages,
|
|
65
67
|
),
|
|
66
68
|
);
|
|
67
69
|
}, resultTargets);
|
|
68
70
|
registerTextEditOrigins(pi, core);
|
|
69
71
|
setTextEditBatchRenderArgumentSink(core, interceptionRendering.resolveArguments);
|
|
70
72
|
core.onDidEdit((completion) => {
|
|
71
|
-
|
|
73
|
+
// A final formatting pass must not retire fresh mutation spans when it left the text unchanged.
|
|
74
|
+
const before = completion.beforePostProcessing ?? completion.before;
|
|
75
|
+
resultTargets.refresh(
|
|
76
|
+
completion.resourceSource,
|
|
77
|
+
completion.cwd,
|
|
78
|
+
before.content !== completion.after.content,
|
|
79
|
+
);
|
|
72
80
|
});
|
|
73
81
|
await core.registerPlugin({
|
|
74
82
|
protocol: TEXT_EDITOR_PROTOCOL,
|
|
@@ -98,11 +106,9 @@ export default async function registerTextEditorCore(
|
|
|
98
106
|
api.addFragmentResolver(createReadFragmentResolver(core));
|
|
99
107
|
|
|
100
108
|
api.describe({
|
|
101
|
-
path: "path#anchor —
|
|
102
|
-
offset:
|
|
103
|
-
|
|
104
|
-
limit:
|
|
105
|
-
"For source selections, limit caps each selected context window separately. Without limit, each selection supplies its natural line count, with at least one line.",
|
|
109
|
+
path: "path#anchor — text around a returned anchor, e.g. notes.txt#12#A4F0; SEARCH#… and RESULT#… go in as they are.",
|
|
110
|
+
offset: "For an anchor or result selection, counts from its line.",
|
|
111
|
+
limit: "For a selection, per selected window.",
|
|
106
112
|
});
|
|
107
113
|
},
|
|
108
114
|
});
|