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
package/dist/pi-agent-ide.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as F,b as W,c as B,d as he,e as q,f as j}from"./chunk-W7CASEO3.js";import{f as Z}from"./chunk-IM24DB3K.js";import{a as ye}from"./chunk-YGGKGZO2.js";import"./chunk-QUYXINGZ.js";import"./chunk-XLWCSJMR.js";import"./chunk-MPT3R4BL.js";import{f as ce}from"./chunk-T7I2VX3J.js";import{a as pe}from"./chunk-BU7IZLKB.js";import{a as ue,b as fe}from"./chunk-S5PL5DFQ.js";import{K as me,d as ge}from"./chunk-LCWBVOII.js";import{a as re,b as ie,c as ae,e as K,f as le}from"./chunk-OJEIX7OZ.js";import{c as de}from"./chunk-RQ7JJ7GV.js";import"./chunk-ZC65Z3CK.js";import{a as l}from"./chunk-EI7MMDWY.js";var Q={"ide.core":["IDE services","Shared services used by language, formatting and diagnostic modules."],"ide.tips":["Getting started tips","Show contextual guidance while setting up a project."],"ide.documentation":["Progressive agent documentation","Expose packaged guides and attach them on first relevant tool use."],"ide.doctor":["Setup doctor","Check external tools and help configure project support."],"ide.languages":["Language setup","Discover languages and their recommended toolchains."],"ide.processes":["Agent IDE processes","Show active terminal and debugger sessions in one shared process surface."],"ide.vision":["Agent vision","Inspect process metadata and capture supported windows and web pages as images."],"ide.debugger":["Debugger sessions","Debug local programs through addressable DAP sessions and anchored breakpoints."],"ide.terminal":["Terminal sessions","Run and manage local interactive and background terminal processes."],"read.core":["Read tools","Read sources through the configured readers and views."],"read.filesystem":["Local files","Resolve files and folders from the local filesystem."],"read.ssh":["SSH files","Read and edit configured SSH file sources through existing tools."],"read.filesystem.jq":["JSON queries","Query local JSON files through jq read views."],"read.filesystem.image":["Local images","Read local images as visual content."],"read.filesystem.pdf":["Local PDFs","Extract readable content from local PDF documents."],"read.filesystem.text":["Local text","Read local text files with their source coordinates."],"read.web":["Web sources","Read remote sources over HTTP and HTTPS."],"read.web.html":["Web pages","Extract readable content from HTML pages."],"read.web.image":["Web images","Read remote images as visual content."],"read.web.pdf":["Web PDFs","Extract text from remote PDF documents."],"read.web.text":["Web text","Read remote plain-text sources."],"search.core":["Search tools","Run searches through the configured search providers."],"search.text":["Text search","Find text and files and register reusable search selections."],"editor.core":["Editing tools","Make guarded text and whole-file changes, directly or through native Codemode."],"editor.renderer":["Edit previews","Display changes in the shared colored diff panels."],"editor.anchor.constant":["File boundary selectors","Use begin and end to select file boundaries."],"editor.anchor.line-hash":["Checked line selectors","Select lines with hashes that detect stale content."],"editor.anchor.exact":["Exact text selectors","Locate edit ranges using unique source text."],"editor.stale-anchor":["Stale selection recovery","Provide recovery guidance when an edit selection is outdated."],"ide.ast":["Structural code support","Read code outlines and search or edit exact syntax-tree nodes."],"ide.formatter":["Code formatting","Run configured formatters after edits."],"ide.lint":["Lint checks","Run configured linters and collect their findings."],"ide.changes":["Git changes","Inspect and manage uncommitted changes and undo history."],"ide.lsp":["Language servers","Resolve symbols, rename references and collect language-server diagnostics."],"ide.diagnostics":["Diagnostic views","Show diagnostic findings through read views and sources."]};var D=[C("ide.core",()=>import("./chunk-RMI3NMQY.js")),C("ide.tips",()=>import("./chunk-BB4A5UI3.js")),C("ide.doctor",()=>import("./chunk-HSZ4AQ6L.js")),C("ide.languages",()=>import("./entry-39.js"),["ide.doctor"]),C("read.core",()=>import("./entry-49.js")),C("ide.documentation",()=>import("./chunk-SGQWRIRJ.js"),["read.core"]),C("read.filesystem",()=>import("./entry-29.js"),["read.core","editor.core"]),C("read.ssh",()=>import("./chunk-YIXP2ALP.js"),["read.filesystem"]),C("read.filesystem.jq",()=>import("./entry-31.js"),["read.filesystem","ide.documentation","ide.doctor"]),C("read.filesystem.image",()=>import("./entry-30.js"),["read.filesystem"]),C("read.filesystem.pdf",()=>import("./entry-32.js"),["read.filesystem"]),C("read.filesystem.text",()=>import("./entry-33.js"),["read.filesystem"]),C("read.web",()=>import("./chunk-YFP4P2FV.js"),["read.core"]),C("read.web.html",()=>import("./entry-88.js"),["read.web"]),C("read.web.image",()=>import("./entry-89.js"),["read.web"]),C("read.web.pdf",()=>import("./entry-90.js"),["read.web"]),C("read.web.text",()=>import("./entry-91.js"),["read.web"]),C("search.core",()=>import("./entry-54.js")),C("search.text",()=>import("./entry-55.js"),["search.core"]),C("editor.renderer",()=>import("./entry-82.js"),["editor.core"]),C("editor.core",()=>import("./entry-81.js")),C("editor.anchor.constant",()=>import("./entry-60.js"),["read.core","editor.core"]),C("editor.anchor.line-hash",()=>import("./entry-64.js"),["read.core","editor.core"]),C("editor.anchor.exact",()=>import("./entry-62.js"),["editor.core"]),C("editor.stale-anchor",()=>import("./entry-83.js"),["editor.core"]),C("ide.ast",()=>import("./entry-35.js"),["ide.core","read.core","search.core","editor.core"]),C("ide.formatter",()=>import("./chunk-ZJQRLVVV.js"),["ide.core"]),C("ide.lint",()=>import("./chunk-6T7PSDQW.js"),["ide.core"]),C("ide.changes",()=>import("./chunk-XBQR74IK.js"),["ide.core","read.core","editor.core"]),C("ide.lsp",()=>import("./chunk-GSOYVIQS.js"),["ide.core","read.core","search.core"]),C("ide.processes",()=>import("./chunk-OM4LYD3S.js")),C("ide.vision",()=>import("./chunk-SDAH3ECM.js"),["ide.processes","read.core","search.core"]),C("ide.debugger",()=>import("./chunk-PT35ZFLH.js"),["ide.processes","read.core","editor.core"]),C("ide.terminal",()=>import("./chunk-GBUJOR6V.js"),["ide.processes","read.core","search.core","editor.core","editor.anchor.constant"]),C("ide.diagnostics",()=>import("./chunk-RVU73VKN.js"),["ide.core","read.core"])];function C(e,t,d=[],i=!0){return{id:e,name:Q[e][0],description:Q[e][1],dependencies:d,async register(o,f){await(await t()).default(o,f)},...i?{}:{defaultEnabled:!1}}}l(C,"builtin");function G(e,t,d){return{kind:"choice",id:e,name:t,description:d,default:"compact",group:"ui",values:[{value:"full",label:"Full"},{value:"compact",label:"Compact"},{value:"disabled",label:"Disabled"}]}}l(G,"presentationPreference");var V=[{kind:"choice",id:"ui.codemode",name:"Show tool results from Codemode",description:"Show extra Agent IDE result panels using each tool's presentation setting. Off hides successful panels; errors stay visible. Codemode's own output and other tools are unchanged.",default:"off",group:"ui",values:[{value:"off",label:"Off"},{value:"on",label:"On"}]},G("ui.diffs","Diffs","Choose how mutation and comparison diffs are displayed."),G("ui.read","Read","Choose how Read calls and results are displayed."),G("ui.search","Search","Choose how Search calls and results are displayed."),G("ui.terminal","Terminal","Choose how shell commands and terminal output are displayed."),{kind:"choice",id:"processes.activity",name:"Active Agent IDE processes",description:"Choose detailed process cards, a compact active count, or no persistent Agent IDE process UI.",default:"detailed",group:"ui",values:[{value:"detailed",label:"Detailed cards"},{value:"compact",label:"Compact count"},{value:"off",label:"Off"}]},{kind:"text",id:"vision.sequenceDurationSeconds",name:"Vision sequence duration",description:"Default sequence duration in seconds. Requests may override it, up to 10 seconds.",default:"2",group:"features"},{kind:"text",id:"vision.sequenceIntervalSeconds",name:"Vision sequence interval",description:"Default seconds between sequence frames. A sequence may contain at most 20 frames.",default:"0.5",group:"features"},{kind:"text",id:"vision.imageScale",name:"Vision image scale",description:"Default image downscale from greater than 0 through 1.",default:"0.5",group:"features"},{kind:"text",id:"vision.allowedExecutables",name:"Vision allowed executables",description:"Comma-separated executable file names that may be captured without arbitrary-window access.",default:"",group:"features",placeholder:"Unity.exe,UnrealEditor.exe"}];function J(e,t,d=[]){let i=new Map;for(let p of e){if(i.has(p.id))throw new Error(`Duplicate Pi Agent IDE extension ID: ${p.id}`);i.set(p.id,p)}for(let p of e)for(let A of p.dependencies)if(!i.has(A))throw new Error(`Pi Agent IDE extension ${p.id} has unknown dependency ${A}`);let o=new Set;for(let p of t)i.has(p)&&o.add(p);for(let p of d)if(!i.has(p))throw new Error(`Unknown Pi Agent IDE extension ID in enabled: ${p}`);let f=Xe(i,d,o),y=new Set;for(let p of e)(p.defaultEnabled===!1&&!f.has(p.id)||o.has(p.id))&&y.add(p.id);let E=!0;for(;E;){E=!1;for(let p of e)y.has(p.id)||p.dependencies.every(A=>!y.has(A))||(y.add(p.id),E=!0)}return{enabled:e.filter(p=>!y.has(p.id)),disabled:y}}l(J,"selectBuiltinExtensions");function Xe(e,t,d){let i=new Set,o=[...t];for(;o.length>0;){let f=o.pop();if(!(i.has(f)||d.has(f))){i.add(f);for(let y of e.get(f)?.dependencies??[])i.has(y)||o.push(y)}}return i}l(Xe,"collectForcedOn");import{Input as st}from"@earendil-works/pi-tui";import{mkdir as Ke,readFile as Ze,writeFile as Qe}from"node:fs/promises";import et from"node:path";import{withFileMutationQueue as tt}from"@earendil-works/pi-coding-agent";async function be(e,t,d=new Map,i=new Map,o){await tt(e,async()=>{let f=await j(e),y={};try{y=JSON.parse(await Ze(e,"utf8"))}catch(g){if(!(g instanceof Error&&"code"in g&&g.code==="ENOENT"))throw g}let E=new Set(f.disabled),p=new Set(f.enabled);for(let[g,x]of t)E.delete(g),p.delete(g),x==="disabled"&&E.add(g),x==="enabled"&&p.add(g);let A={...f.preferences};for(let[g,x]of i)x===void 0?delete A[g]:A[g]=x;let v={...f.flags};for(let[g,x]of d)g==="pi-agent-ide-no-animations"&&delete y.noAnimations,g==="pi-agent-ide-no-post-processing"&&delete y.noPostProcessing,x===void 0?delete v[g]:v[g]=x;await Ke(et.dirname(e),{recursive:!0}),await Qe(e,`${JSON.stringify({...y,disabled:[...E],enabled:[...p],...o===void 0?{}:{preset:o},...d.size>0?{flags:v}:{},...i.size>0?{preferences:A}:{}},null,2)}
|
|
2
|
-
`)})}
|
|
1
|
+
import{a as N,b as j,c as $,d as le,e as B,f as _}from"./chunk-W7CASEO3.js";import{a as ne}from"./chunk-H5Z54BEU.js";import{f as J}from"./chunk-WES2E4VR.js";import{a as re}from"./chunk-YGGKGZO2.js";import"./chunk-5S74Z6Y4.js";import"./chunk-GS5ZRTUG.js";import"./chunk-MPT3R4BL.js";import{g as oe}from"./chunk-KN6VPARZ.js";import"./chunk-BU7IZLKB.js";import"./chunk-S5PL5DFQ.js";import"./chunk-DDH3FP4G.js";import{a as se,b as ie,c as ae,e as Y,f as de}from"./chunk-OJEIX7OZ.js";import{c as te}from"./chunk-RQ7JJ7GV.js";import"./chunk-ZC65Z3CK.js";import{a as r}from"./chunk-EI7MMDWY.js";var z={"ide.core":["IDE services","Shared services used by language, formatting and diagnostic modules."],"ide.tips":["Getting started tips","Show contextual guidance while setting up a project."],"ide.documentation":["Progressive agent documentation","Expose packaged guides and attach them on first relevant tool use."],"ide.doctor":["Setup doctor","Check external tools and help configure project support."],"ide.languages":["Language setup","Discover languages and their recommended toolchains."],"ide.processes":["Agent IDE processes","Show active terminal and debugger sessions in one shared process surface."],"ide.debugger":["Debugger sessions","Debug local programs through addressable DAP sessions and anchored breakpoints."],"ide.terminal":["Terminal sessions","Run and manage local interactive and background terminal processes."],"read.core":["Read tools","Read sources through the configured readers and views."],"read.filesystem":["Local files","Resolve files and folders from the local filesystem."],"read.ssh":["SSH files","Read and edit configured SSH file sources through existing tools."],"read.filesystem.jq":["JSON queries","Query local JSON files through jq read views."],"read.filesystem.image":["Local images","Read local images as visual content."],"read.filesystem.pdf":["Local PDFs","Extract readable content from local PDF documents."],"read.filesystem.text":["Local text","Read local text files with their source coordinates."],"read.web":["Web sources","Read remote sources over HTTP and HTTPS."],"read.web.html":["Web pages","Extract readable content from HTML pages."],"read.web.image":["Web images","Read remote images as visual content."],"read.web.pdf":["Web PDFs","Extract text from remote PDF documents."],"read.web.text":["Web text","Read remote plain-text sources."],"search.core":["Search tools","Run searches through the configured search providers."],"search.text":["Text search","Find text and files and register reusable search selections."],"editor.core":["Editing tools","Make guarded text and whole-file changes, directly or through native Codemode."],"editor.renderer":["Edit previews","Display changes in the shared colored diff panels."],"editor.anchor.constant":["File boundary selectors","Use begin and end to select file boundaries."],"editor.anchor.line-hash":["Checked line selectors","Select lines with hashes that detect stale content."],"editor.anchor.exact":["Exact text selectors","Locate edit ranges using unique source text."],"editor.stale-anchor":["Stale selection recovery","Provide recovery guidance when an edit selection is outdated."],"ide.ast":["Structural code support","Read code outlines and search or edit exact syntax-tree nodes."],"ide.formatter":["Code formatting","Run configured formatters after edits."],"ide.lint":["Lint checks","Run configured linters and collect their findings."],"ide.changes":["Git changes","Inspect and manage uncommitted changes and undo history."],"ide.lsp":["Language servers","Resolve symbols, rename references and collect language-server diagnostics."],"ide.diagnostics":["Diagnostic views","Show diagnostic findings through read views and sources."]};var D=[A("ide.core",()=>import("./chunk-V4J3TLCV.js")),A("ide.tips",()=>import("./chunk-BB4A5UI3.js")),A("ide.doctor",()=>import("./chunk-HT7LZN5A.js")),A("ide.languages",()=>import("./entry-41.js"),["ide.doctor"]),A("read.core",()=>import("./entry-51.js")),A("ide.documentation",async()=>{let{default:e}=await import("./chunk-K4UTEMDU.js");return{default:r(t=>e(t),"default")}},["read.core"]),A("read.filesystem",()=>import("./entry-30.js"),["read.core","editor.core"]),A("read.ssh",()=>import("./chunk-FS3KCKFX.js"),["read.filesystem"]),A("read.filesystem.jq",()=>import("./entry-33.js"),["read.filesystem","ide.documentation","ide.doctor"]),A("read.filesystem.image",()=>import("./entry-31.js"),["read.filesystem"]),A("read.filesystem.pdf",()=>import("./entry-34.js"),["read.filesystem"]),A("read.filesystem.text",()=>import("./entry-35.js"),["read.filesystem"]),A("read.web",()=>import("./chunk-QM5WDEFI.js"),["read.core"]),A("read.web.html",()=>import("./entry-90.js"),["read.web"]),A("read.web.image",()=>import("./entry-91.js"),["read.web"]),A("read.web.pdf",()=>import("./entry-92.js"),["read.web"]),A("read.web.text",()=>import("./entry-93.js"),["read.web"]),A("search.core",()=>import("./entry-56.js")),A("search.text",()=>import("./entry-57.js"),["search.core"]),A("editor.renderer",()=>import("./entry-84.js"),["editor.core"]),A("editor.core",()=>import("./entry-83.js")),A("editor.anchor.constant",()=>import("./entry-62.js"),["read.core","editor.core"]),A("editor.anchor.line-hash",()=>import("./entry-66.js"),["read.core","editor.core"]),A("editor.anchor.exact",()=>import("./entry-64.js"),["editor.core"]),A("editor.stale-anchor",()=>import("./entry-85.js"),["editor.core"]),A("ide.ast",()=>import("./entry-37.js"),["ide.core","read.core","search.core","editor.core"]),A("ide.formatter",()=>import("./chunk-Y74EKJOY.js"),["ide.core"]),A("ide.lint",()=>import("./chunk-VN3XBH2Q.js"),["ide.core"]),A("ide.changes",()=>import("./chunk-4GBFIGH3.js"),["ide.core","read.core","editor.core"]),A("ide.lsp",()=>import("./chunk-CVOYSEBE.js"),["ide.core","read.core","search.core"]),A("ide.processes",()=>import("./chunk-XUYIK4TX.js")),A("ide.debugger",()=>import("./chunk-TNAUCNUT.js"),["ide.processes","read.core","editor.core"]),A("ide.terminal",()=>import("./chunk-7URANI6I.js"),["ide.processes","read.core","search.core","editor.core","editor.anchor.constant"]),A("ide.diagnostics",()=>import("./chunk-LTADNZKW.js"),["ide.core","read.core"])];function A(e,t,u=[],f=!0){return{id:e,name:z[e][0],description:z[e][1],dependencies:u,async register(n,d){await(await t()).default(n,d)},...f?{}:{defaultEnabled:!1}}}r(A,"builtin");function L(e,t,u){return{kind:"choice",id:e,name:t,description:u,default:"compact",group:"ui",values:[{value:"full",label:"Full"},{value:"compact",label:"Compact"},{value:"disabled",label:"Disabled"}]}}r(L,"presentationPreference");var G=[{kind:"choice",id:"ui.codemode",name:"Show tool results from Codemode",description:"Show extra Agent IDE result panels using each tool's presentation setting. Off hides successful panels; errors stay visible. Codemode's own output and other tools are unchanged.",default:"off",group:"ui",values:[{value:"off",label:"Off"},{value:"on",label:"On"}]},L("ui.diffs","Diffs","Choose how mutation and comparison diffs are displayed."),L("ui.read","Read","Choose how Read calls and results are displayed."),L("ui.search","Search","Choose how Search calls and results are displayed."),L("ui.terminal","Terminal","Choose how shell commands and terminal output are displayed."),{kind:"choice",id:"processes.activity",name:"Active Agent IDE processes",description:"Choose detailed process cards, a compact active count, or no persistent Agent IDE process UI.",default:"detailed",group:"ui",values:[{value:"detailed",label:"Detailed cards"},{value:"compact",label:"Compact count"},{value:"off",label:"Off"}]}];function U(e,t,u=[]){let f=new Map;for(let i of e){if(f.has(i.id))throw new Error(`Duplicate Pi Agent IDE extension ID: ${i.id}`);f.set(i.id,i)}for(let i of e)for(let R of i.dependencies)if(!f.has(R))throw new Error(`Pi Agent IDE extension ${i.id} has unknown dependency ${R}`);let n=new Set;for(let i of t)f.has(i)&&n.add(i);for(let i of u)if(!f.has(i))throw new Error(`Unknown Pi Agent IDE extension ID in enabled: ${i}`);let d=Ne(f,u,n),l=new Set;for(let i of e)(i.defaultEnabled===!1&&!d.has(i.id)||n.has(i.id))&&l.add(i.id);let y=!0;for(;y;){y=!1;for(let i of e)l.has(i.id)||i.dependencies.every(R=>!l.has(R))||(l.add(i.id),y=!0)}return{enabled:e.filter(i=>!l.has(i.id)),disabled:l}}r(U,"selectBuiltinExtensions");function Ne(e,t,u){let f=new Set,n=[...t];for(;n.length>0;){let d=n.pop();if(!(f.has(d)||u.has(d))){f.add(d);for(let l of e.get(d)?.dependencies??[])f.has(l)||n.push(l)}}return f}r(Ne,"collectForcedOn");import{Input as We}from"@earendil-works/pi-tui";import{mkdir as $e,readFile as Fe,writeFile as je}from"node:fs/promises";import Be from"node:path";import{withFileMutationQueue as Le}from"@earendil-works/pi-coding-agent";async function ce(e,t,u=new Map,f=new Map,n){await Le(e,async()=>{let d=await _(e),l={};try{l=JSON.parse(await Fe(e,"utf8"))}catch(s){if(!(s instanceof Error&&"code"in s&&s.code==="ENOENT"))throw s}let y=new Set(d.disabled),i=new Set(d.enabled);for(let[s,c]of t)y.delete(s),i.delete(s),c==="disabled"&&y.add(s),c==="enabled"&&i.add(s);let R={...d.preferences};for(let[s,c]of f)c===void 0?delete R[s]:R[s]=c;let I={...d.flags};for(let[s,c]of u)s==="pi-agent-ide-no-animations"&&delete l.noAnimations,s==="pi-agent-ide-no-post-processing"&&delete l.noPostProcessing,c===void 0?delete I[s]:I[s]=c;await $e(Be.dirname(e),{recursive:!0}),await je(e,`${JSON.stringify({...l,disabled:[...y],enabled:[...i],...n===void 0?{}:{preset:n},...u.size>0?{flags:I}:{},...f.size>0?{preferences:R}:{}},null,2)}
|
|
2
|
+
`)})}r(ce,"saveModuleChoices");import{getSettingsListTheme as Ge}from"@earendil-works/pi-coding-agent";import{matchesKey as W,SettingsList as Ue,truncateToWidth as ue,visibleWidth as fe}from"@earendil-works/pi-tui";function ge(e,t,u,f,n=""){let d=["extensions","behavior","ui"],l="extensions",y=r(v=>v==="extensions"?"modules":v==="behavior"?"features":"ui","itemKey"),i=r(v=>v==="extensions"?"modules":v==="behavior"?"features":"ui","changeKey"),R=r(()=>{let v=y(l),a=t()[v]??[];return new Ue(a,12,Ge(),(o,m)=>{u(i(l),o,m);for(let h of t()[v]??[]){let b=a.find(w=>w.id===h.id);b&&Object.assign(b,h)}},()=>f(!1),{enableSearch:!0})},"createList"),I=R(),s=r(v=>e.fg("borderMuted",v),"border"),c=r((v,a)=>{if(a<=1)return s("\u2502");let o=a-2,m=ue(v,o);return`${s("\u2502")}${m}${" ".repeat(Math.max(0,o-fe(m)))}${s("\u2502")}`},"row"),g=r(v=>s(v<=1?"\u251C":`\u251C${"\u2500".repeat(Math.max(0,v-2))}\u2524`),"rule");return{render(v){let a=Math.max(1,v),o=Math.max(1,a-4),m=` Agent IDE settings${n?` \xB7 ${n}`:""} `,h=a<=1?s("\u256D"):`${s("\u256D\u2500")}${e.fg("accent",e.bold(ue(m,Math.max(0,a-3),"")))}${s(`${"\u2500".repeat(Math.max(0,a-fe(m)-3))}\u256E`)}`,b={extensions:"Features",behavior:"Behavior",ui:"UI"},w=d.map(P=>P===l?e.fg("accent",e.bold(`[ ${b[P]} ]`)):e.fg("dim",` ${b[P]} `)).join(" "),S=I.render(o).map(P=>c(` ${P} `,a)),p=e.fg("dim"," Tab switch \xB7 Enter change \xB7 Ctrl+S save \xB7 Esc cancel ");return[h,c(` ${w} `,a),g(a),...S,g(a),c(p,a),s(a<=1?"\u2570":`\u2570${"\u2500".repeat(Math.max(0,a-2))}\u256F`)]},invalidate(){I.invalidate()},handleInput(v){W(v,"tab")||W(v,"shift+tab")?(l=d[(d.indexOf(l)+(W(v,"shift+tab")?2:1))%d.length]??"extensions",I=R()):W(v,"ctrl+s")?f(!0):I.handleInput(v)}}}r(ge,"createSettingsPanel");function pe(e,t=[],u=[]){e.registerCommand("agent-ide-settings",{description:"Configure Agent IDE modules and features",async handler(f,n){if(n.hasUI)try{let d=await n.ui.select("Agent IDE settings \u2014 save scope",["Project","Global"]);if(d===void 0)return;let l=$(process.env,void 0,n.cwd),y=d==="Project"?l.projectPath:l.globalPath,i=await _(y),R=await _(d==="Project"?l.globalPath:l.projectPath),I=new Map,s=new Map,c=new Map,g;if(!await n.ui.custom((a,o,m,h)=>{let b=ge(o,()=>{let w=new Set(i.disabled),S=new Set(i.enabled);for(let[T,E]of I)w.delete(T),S.delete(T),E==="disabled"&&w.add(T),E==="enabled"&&S.add(T);let p=U(D,[...j(D,g??i.preset??"full"),...w,...j(D,R.preset??"full"),...R.disabled],[...S,...R.enabled]);return{modules:D.map(T=>({id:T.id,label:T.name??T.id,description:`${T.description??""} Effective: ${p.disabled.has(T.id)?"off":"on"}.${R.disabled.includes(T.id)?" Disabled in the other scope.":T.dependencies.some(E=>p.disabled.has(E))?" A dependency is disabled.":""}`,currentValue:I.get(T.id)??(i.disabled.includes(T.id)?"disabled":i.enabled.includes(T.id)?"enabled":"default"),values:["default","enabled","disabled"]})),features:[P(),...C("features"),...x("features")],ui:[...C("ui"),...x("ui")]};function P(){let T=g??i.preset??"full";return{id:"preset",label:"Preset",description:"Choose the built-in Agent IDE capability set. Reload required.",currentValue:N.find(E=>E.value===T)?.label??T,values:N.map(E=>E.label)}}function x(T){return u.filter(E=>E.group===T).map(E=>{let k=c.has(E.id)?c.get(E.id):i.preferences?.[E.id];return{id:E.id,label:E.name,description:`${E.description} Default: ${E.kind==="choice"?E.values.find(O=>O.value===E.default)?.label??E.default:E.default||"empty"}.`,currentValue:k===void 0?"default":E.kind==="choice"?E.values.find(O=>O.value===k)?.label??k:k,...E.kind==="choice"?{values:["default",...E.values.map(O=>O.label)]}:{submenu:r((O,Q)=>{let F=new We,ee=O==="default"?E.default:O;return ee.length>0&&F.handleInput(ee),F.focused=!0,F.onSubmit=Me=>Q(Me),F.onEscape=()=>Q(),F},"submenu")}}})}function C(T){return t.filter(E=>(E.group??"features")===T).map(E=>{let k=s.has(E.id)?s.get(E.id):B(i)[E.id];return{id:E.id,label:E.name,description:E.description,currentValue:k===void 0?"default":k?E.labels?.on??"enabled":E.labels?.off??"disabled",values:["default",E.labels?.off??"disabled",E.labels?.on??"enabled"]}})}},(w,S,p)=>{if(w==="modules")I.set(S,p);else if(S==="preset")g=N.find(P=>P.label===p)?.value;else if(u.some(P=>P.id===S)){let P=u.find(x=>x.id===S);c.set(S,p==="default"||p.length===0?void 0:P?.kind==="choice"?P.values.find(x=>x.label===p)?.value:p)}else s.set(S,p==="default"?void 0:p===(t.find(P=>P.id===S)?.labels?.on??"enabled"))},h,d);return{render:r(w=>b.render(w),"render"),invalidate:r(()=>b.invalidate(),"invalidate"),handleInput(w){b.handleInput(w),a.requestRender()}}})||I.size+s.size+c.size+(g===void 0?0:1)===0)return;if(await ce(y,I,s,c,g),n.ui.notify(`Saved ${d.toLowerCase()} Agent IDE settings. Reload required.`,"info"),await n.ui.confirm("Reload Pi?","Reload extensions to apply settings. In-memory extension state may reset.")){await n.reload();return}}catch(d){n.ui.notify(d instanceof Error?d.message:String(d),"error")}}})}r(pe,"registerModuleSettings");import{readFile as qe}from"node:fs/promises";import V from"node:path";import{getMarkdownTheme as Je}from"@earendil-works/pi-coding-agent";import{Markdown as Ye,matchesKey as M,ScrollView as ze,truncateToWidth as Ve}from"@earendil-works/pi-tui";function He(){return qe(V.join(V.dirname(V.dirname(import.meta.dirname)),"docs/settings-help.md"),"utf8")}r(He,"readSettingsHelp");function me(e){e.registerCommand("agent-ide-help",{description:"Read the short Agent IDE settings guide",async handler(t,u){if(!(u.mode!=="tui"||!u.hasUI))try{let f=await He();await u.ui.custom((n,d,l,y)=>new H(f,d,()=>Math.max(5,Math.min(36,n.terminal.rows-4)),()=>n.requestRender(),y),{overlay:!0,overlayOptions:{width:92,margin:1}})}catch(f){u.ui.notify(f instanceof Error?f.message:String(f),"error")}}})}r(me,"registerSettingsHelp");var H=class{constructor(t,u,f,n,d){this.content=t;this.theme=u;this.height=f;this.requestRender=n;this.done=d;this.markdown=this.createMarkdown(),this.scroll=new ze(this.markdown)}static{r(this,"SettingsHelpPanel")}markdown;scroll;createMarkdown(){return new Ye(this.content,0,0,Je(),{color:r(t=>this.theme.fg("text",t),"color")})}invalidate(){this.markdown.invalidate()}handleInput(t){if(M(t,"escape")){this.done();return}M(t,"up")?this.scroll.scrollBy(-1):M(t,"down")?this.scroll.scrollBy(1):M(t,"pageUp")?this.scroll.scrollBy(-this.scroll.viewportHeight):M(t,"pageDown")||M(t,"space")?this.scroll.scrollBy(this.scroll.viewportHeight):M(t,"home")?this.scroll.scrollToStart():M(t,"end")&&this.scroll.scrollToEnd()}render(t){let u=Math.max(1,t-4),f=this.markdown.render(u),n=Math.max(1,this.height()-4);this.scroll.updateLayout(f.length,n,this.requestRender);let d=f.slice(this.scroll.scrollTop,this.scroll.scrollTop+n);for(;d.length<n;)d.push("");let l=this.theme.fg("border","\u2500".repeat(Math.max(0,t-2))),y=r(i=>this.theme.fg("border","\u2502 ")+Ve(i,u,"\u2026",!0)+this.theme.fg("border"," \u2502"),"row");return[this.theme.fg("border","\u256D")+l+this.theme.fg("border","\u256E"),y(this.theme.fg("accent","Agent IDE settings help")),...d.map(y),y(this.theme.fg("muted","\u2191\u2193 scroll \xB7 PgUp/PgDn page \xB7 Home/End \xB7 Esc close")),this.theme.fg("border","\u2570")+l+this.theme.fg("border","\u256F")]}};function he(e,t){let u=[];return{definitions:u,register(f){if(u.some(n=>n.id===f.id))throw new Error(`Duplicate feature flag: ${f.id}`);u.push(f),e.registerFlag(f.id,{type:"boolean",description:f.description,default:t[f.id]??f.default})}}}r(he,"createFeatureFlags");function be(e,t=G){return{id:"ide-settings",description:"IDE settings and their scopes",triggers:[{tool:"read",resourcePrefixes:["docs:ide-settings"]}],get markdown(){let u={preferences:t,flags:e,modules:D.map(({id:n,name:d,description:l,defaultEnabled:y,dependencies:i})=>({id:n,name:d,description:l,default:y!==!1,dependencies:i})),presets:N};return`# IDE settings
|
|
3
3
|
|
|
4
4
|
This catalog describes supported settings, not current saved values or live runtime state. It is generated from the registrations used by /agent-ide-settings. Read both configuration scopes to inspect overrides. Reload or restart applies module and startup-only changes; built-in CLI flags may override their saved defaults for an invocation.
|
|
5
5
|
|
|
@@ -23,43 +23,19 @@ Choices carry their saved value and human label. Text settings carry a descripti
|
|
|
23
23
|
|
|
24
24
|
\`\`\`json
|
|
25
25
|
{
|
|
26
|
-
${Object.entries(
|
|
27
|
-
${
|
|
26
|
+
${Object.entries(u).map(([n,d])=>` "${n}": [
|
|
27
|
+
${d.map(l=>` ${JSON.stringify(l)}`).join(`,
|
|
28
28
|
`)}
|
|
29
29
|
]`).join(`,
|
|
30
30
|
`)}
|
|
31
31
|
}
|
|
32
32
|
\`\`\`
|
|
33
|
-
`}}}
|
|
34
|
-
`)}],details:void 0,isError:
|
|
33
|
+
`}}}r(be,"createIdeSettingsDocumentation");function ye(e){let t=new Map,u=new Set;return{api:{...e,registerTool:r(n=>{n.namespace?.name.startsWith("ide_")===!0&&t.set(n.name,{hide:r(()=>e.registerTool({...n,get description(){return n.description},get promptGuidelines(){return n.promptGuidelines},exposure:"hidden"}),"hide"),restore:r(()=>e.registerTool(n),"restore")}),u.has(n.name)?t.get(n.name)?.hide():e.registerTool(n)},"registerTool")},reconcile(n=!1,d=[],l=!1){let y=new Set,i=new Set;for(let g of e.getSettings().defaultTools??[])if(g.startsWith("-"))y.add(g.slice(1)),i.delete(g.slice(1));else{let v=g.startsWith("+")?g.slice(1):g;y.delete(v),i.add(v)}for(let[g,v]of t)y.has(g)!==u.has(g)&&(y.has(g)?(v.hide(),u.add(g)):(v.restore(),u.delete(g)));let R=e.getAllTools().filter(g=>g.exposure!=="hidden"),I=new Set(e.getActiveTools());for(let g of R)n&&!l&&t.has(g.name)&&(i.has(g.name)||g.exposure==="deferred"&&d.includes(g.name))&&I.add(g.name);n&&!y.has("tool_search")&&R.some(g=>g.name==="tool_search")&&R.some(g=>t.has(g.name)&&g.exposure==="deferred")&&I.add("tool_search");let s=e.getActiveTools(),c=[...I].filter(g=>!u.has(g));(c.length!==s.length||c.some(g=>!s.includes(g)))&&e.setActiveTools(c)}}}r(ye,"createIdeToolAvailability");import{ToolExecutionComponent as ve}from"@earendil-works/pi-coding-agent";import{Container as X,Spacer as Ee,Text as q}from"@earendil-works/pi-tui";import{isDeepStrictEqual as Xe}from"node:util";import{createCodemodeExtension as Ke}from"@earendil-works/pi-coding-agent";function we(e,t){let u=r(n=>{if(!n.startsWith("mcp__"))return;let d=e.getAllTools(),l=d.find(i=>i.name===n);if(!l||l.namespace||l.exposure==="hidden")return;let y=d.filter(i=>(t.has(i.name)&&i.namespace?.name.startsWith("ide_")===!0||i.name==="codemode"&&i.sourceInfo.source==="builtin"&&i.sourceInfo.path==="builtin:codemode")&&i.exposure!=="hidden"&&i.description===l.description&&Xe(i.parameters,l.parameters));return y.length===1?y[0]?.name:void 0},"source"),f;return e.registerToolRenderer((n,d)=>{let l=u(n);return l!=="codemode"?l===void 0?d():t.get(l):(f||Ke()({...e,registerTool:r(y=>{let{renderShell:i,renderCall:R,renderResult:I}=y;f={renderShell:i,renderCall:R,renderResult:I}},"registerTool")}),f??d())}),e.on("before_agent_start",()=>{for(let n of e.getAllTools()){let d=u(n.name),l=d===void 0?void 0:t.get(d);if(!l)continue;let y=Object.getOwnPropertyDescriptors(l);delete y.namespace,y.name={value:n.name,enumerable:!0,configurable:!0,writable:!0},y.exposure={value:n.exposure==="model-only"?n.exposure:"deferred",enumerable:!0,configurable:!0,writable:!0};let i=r(s=>{let c=l.prepareLoadout?.(s);return s.declared.some(g=>g.name===l.name)?{...c,hiddenDeclarations:[...c?.hiddenDeclarations??[],n.name]}:c},"prepareLoadout");y.prepareLoadout={value:i,enumerable:!0,configurable:!0,writable:!0};let R=r(async(s,c,g,v,a)=>{let{result:o,isError:m}=await a.executeTool(l.name,c,{signal:g,onUpdate:v}),{usage:h,...b}=o;return{...b,isError:m}},"execute");y.execute={value:R,enumerable:!0,configurable:!0,writable:!0};let I=Object.defineProperties({},y);e.registerTool(I)}}),u}r(we,"registerIdeAliasCompatibility");var K="ide-nested-results",xe=256,Ie=512*1024,Se=8*1024,Ze=32*1024,Qe=r(()=>({argumentsTruncated:!1,resultsOmitted:!1,callsOmitted:!1,resultsUnavailable:!1}),"retained");function Te(e){let t=e.retention,u=[t?.argumentsTruncated&&"arguments shortened",t?.resultsOmitted&&"result displays omitted",t?.callsOmitted&&"call panels omitted",t?.resultsUnavailable&&"results unavailable"].filter(Boolean);if(u.length>0)return`Nested IDE display: ${u.join("; ")}. Tool execution and parent output are unchanged.`;if(!t&&e.complete===!1)return"Nested IDE display is incomplete; omission details are unavailable."}r(Te,"retentionWarning");function et(e){let t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;let u=Math.floor(t),f=Math.floor(u/60);return f<60?`${f}m ${u%60}s`:`${Math.floor(f/60)}h ${f%60}m ${u%60}s`}r(et,"formatToolDuration");function Ae(e,t=!1){let u=new Map,f=we(e,u),n=new Map,d=new Map,l=new Map,y,i=new WeakMap,R=new WeakMap,I=r(a=>{let o=u.get(a),m=o?.renderResult;if(!o||!m)return o;let h=R.get(o);if(!h){let b=new WeakMap;h={...o,renderResult(w,S,p,P){let x=P.lastComponent&&b.get(P.lastComponent),C=m.call(o,w,S,p,{...P,lastComponent:x??P.lastComponent});if(S.isPartial||P.durationMs===void 0)return C;let T=new X;return T.addChild(C),T.addChild(new Ee(1)),T.addChild(new q(p.fg("muted",`Took ${et(P.durationMs)}`),0,0)),b.set(T,C),T}},R.set(o,h)}return h},"timedDefinition"),s=r((a,o,m)=>{o.result=m,o.resultOmitted=!1;try{let b=JSON.stringify(a);if(Buffer.byteLength(b)<=Ie){o.result=JSON.parse(JSON.stringify(m));return}}catch{}let h=m.details&&typeof m.details=="object"?Object.entries(m.details).filter(([b,w])=>(b==="source"||b==="fullOutputPath")&&typeof w=="string").map(([b,w])=>`${b}: ${String(w)}`):[];o.result={content:[{type:"text",text:["Result presentation omitted (history size limit or unsupported payload).",...h].join(`
|
|
34
|
+
`)}],details:void 0,isError:m.isError},o.resultOmitted=!0},"retainResult"),c=r(()=>{n.clear(),d.clear(),l.clear()},"clear");e.on("session_start",(a,o)=>{c(),o.mode==="tui"&&o.ui.setWidget(K,m=>(y=m,{render:r(()=>[],"render"),invalidate:r(()=>{},"invalidate")}))}),e.on("session_tree",c),e.on("session_shutdown",c),e.on("tool_execution_start",(a,o)=>{if(a.parentToolCallId===void 0){let x=f(a.toolName);x!==void 0&&n.set(a.toolCallId,x);return}let m=d.get(a.parentToolCallId)??a.parentToolCallId;if(d.set(a.toolCallId,m),n.get(m)===a.toolName||!u.has(a.toolName))return;let h=l.get(m);if(h||(h={parentToolCallId:m,cwd:o.cwd,calls:[],retention:Qe()},l.set(m,h)),h.calls.length>=xe){h.retention.callsOmitted=!0;return}let b=JSON.stringify(a.args),w=Ze-h.calls.reduce((x,C)=>x+Buffer.byteLength(JSON.stringify(C.args)),0)-(xe-h.calls.length-1)*2,S=Buffer.byteLength(b)>Math.min(Se,w),p=S?Object.fromEntries(Object.entries(a.args).map(([x,C])=>[x,typeof C=="string"?C.slice(0,200)+(C.length>200?"\u2026 [omitted]":""):"[omitted]"])):JSON.parse(b),P=Buffer.byteLength(JSON.stringify(p))<=Math.min(Se,w)?p:{};h.calls.push({id:a.toolCallId,name:a.toolName,args:P,argumentsTruncated:S})}),e.on("tool_execution_end",a=>{n.delete(a.toolCallId);let o=d.get(a.toolCallId);if(o===void 0)return;d.delete(a.toolCallId);let m=l.get(o),h=m?.calls.find(b=>b.id===a.toolCallId);if(m&&h){typeof a.durationMs=="number"&&Number.isFinite(a.durationMs)&&(h.durationMs=a.durationMs);let b=a.result;s(m,h,{content:b.content.filter(w=>w.type!=="text"||!w.text.startsWith(`
|
|
35
35
|
|
|
36
36
|
---
|
|
37
37
|
|
|
38
|
-
# Guide:`)),details:
|
|
39
|
-
${
|
|
40
|
-
`)}`}],details:void 0,isError:
|
|
41
|
-
`)
|
|
42
|
-
|
|
43
|
-
${u.notices.join(`
|
|
44
|
-
`)}`:"")},...u.images]);return f.set(s,{source:n,content:a}),a},"limitError");pe(e,{protocol:ue,apiVersion:fe,id:"ide-output-retention",setup(s){s.setOutputSaver(o)}}),e.on("session_shutdown",()=>i.dispose());let p=l((s,r)=>{if(s==="message_end"){let c=r;return e.on("message_end",async(a,u)=>{let h=await c(a,u),w=h?.message??a.message;return w.role!=="toolResult"||!w.isError||!d.has(w.toolName)||w.content.some(m=>m.type==="text"&&m.text.startsWith("<system-result"))?h:{...h,message:{...w,content:await E(w.toolCallId,w.content)}}})}let n=r;return s!=="tool_call"?e.on(s,n):e.on("tool_call",async(c,a)=>{let u=await n(c,a);if(!u?.block||!d.has(c.toolName)||u.reason===void 0)return u;let h=await L([{type:"text",text:u.reason}],"",o);return{...u,reason:h.text+(h.notices.length?`
|
|
45
|
-
|
|
46
|
-
${h.notices.join(`
|
|
47
|
-
`)}`:"")}})},"on"),A=new Map,v=new Map,g=l(()=>{A.clear(),v.clear(),f.clear()},"clear");e.on("session_start",g),e.on("session_shutdown",g),e.on("before_agent_start",s=>{s.systemPromptOptions.sections.ide_results="Direct IDE calls return readable text. In Codemode, Search returns { result, hasMatches, complete }; pass its result string to other tools for composition. An image Read returns an image block: show it with image(), pass it to models.classify() images, and pass its note string to other tools. Other text results remain strings. The leading system-result envelope is an internal reference, not file content; do not edit it. Compose tools by passing the unchanged result string to a source parameter. Outside Codemode, pass the same text or its UUID. Store/load preserves results within the session. Use returned anchors to choose individual selections. Changed snapshots and previous sessions cannot be reused."}),e.on("tool_execution_start",s=>{s.parentToolCallId!==void 0&&A.set(s.toolCallId,A.get(s.parentToolCallId)??s.parentToolCallId)}),p("tool_call",(s,r)=>{if(!d.has(s.toolName))return;let n={...s.input};try{for(let c of Be[s.toolName]??[]){let a=n[c];if(a!==void 0)if(s.toolName==="diff"&&a!==null&&typeof a=="object"&&"path"in a)n[c]={...a,path:t.source(a.path,r.cwd,!0)};else{let u=t.source(a,r.cwd,s.toolName==="read"?!0:["write","insert","delete"].includes(s.toolName)?"live":!1);if(s.toolName==="read"&&Array.isArray(u)){let h=t.resolve(u,r.cwd);n[c]=t.register(h.targets,r.cwd,h.complete)}else n[c]=u}}s.toolName==="select"&&n.operation&&typeof n.operation=="object"&&"scopes"in n.operation&&(n.operation={...n.operation,scopes:t.source(n.operation.scopes,r.cwd)});for(let c of["text","content"]){let a=n[c];if(typeof a=="string"&&(a.trimStart().startsWith("<system-result")||/<system-result\b[^>]*><uuid>[a-f\d-]{36}<\/uuid><\/system-result>/iu.test(a)))return{block:!0,reason:"A system result reference is not file content. Do not insert it into a file."}}Object.assign(s.input,n)}catch(c){return{block:!0,reason:c instanceof Error?c.message:String(c)}}});let x=l(s=>{d.add(s.name);let r={},n=Object.getOwnPropertyDescriptors(s);delete n.outputSchema,s.name==="search"&&(n.outputSchema={value:je,enumerable:!0,configurable:!0,writable:!0}),s.name==="read"&&(n.outputSchema={value:Tt,enumerable:!0,configurable:!0,writable:!0}),It.has(s.name)&&(n.outputSchema={value:St,enumerable:!0,configurable:!0,writable:!0});let c=l(async(...h)=>{let w=await s.execute(...h).catch(async I=>{let P=await L([{type:"text",text:I instanceof Error?I.message:String(I)}],"",o);throw P.notices.length===0?I:new Error(P.text+`
|
|
48
|
-
|
|
49
|
-
${P.notices.join(`
|
|
50
|
-
`)}`,{cause:I})}),m=await L(w.content,Ue(w.details),o),T=m.text+m.metadataSuffix;return{...w,content:[{type:"text",text:T+(m.notices.length?`
|
|
51
|
-
|
|
52
|
-
${m.notices.join(`
|
|
53
|
-
`)}`:"")},...m.images]}},"execute");n.execute={value:c,enumerable:!0,configurable:!0,writable:!0};let a=s.renderCall;if(a){let h=l((w,m,T)=>a(Pt(s.name,w),m,T),"renderCall");n.renderCall={value:h,enumerable:!0,configurable:!0,writable:!0}}let u=s.renderResult;if(u){let h=l((w,m,T,I)=>u({...w,content:w.content.map(P=>P.type==="text"?{...P,text:P.text.replace(/^<system-result\b[^>]*><uuid>[a-f\d-]{36}<\/uuid><\/system-result>\n/u,"")}:P)},m,T,I),"renderer");n.renderResult={value:h,enumerable:!0,configurable:!0,writable:!0}}Object.defineProperties(r,n),e.registerTool(r)},"registerTool"),b=l(()=>{e.on("context",async s=>({messages:await Promise.all(s.messages.map(async r=>r.role!=="toolResult"||!r.isError||!d.has(r.toolName)||r.content.some(n=>n.type==="text"&&n.text.startsWith("<system-result"))?r:{...r,content:await E(r.toolCallId,r.content)}))})),e.on("tool_result",async(s,r)=>{if(s.toolName==="codemode"){t.refreshAll();let S=new Set(s.content.flatMap(k=>k.type==="image"?[k.data]:[])),O=(v.get(s.toolCallId)??[]).filter(k=>!S.has(k.data));v.delete(s.toolCallId);for(let[k,X]of A)X===s.toolCallId&&A.delete(k);let M=s.content.filter(k=>k.type==="text"&&k.text.startsWith(`
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
# Guide:`)),U=s.content.filter(k=>!M.includes(k)),_=await L([...U,...O],"",o);return{content:[..._.textTruncated?[{type:"text",text:_.text}]:U.filter(k=>k.type==="text"),..._.images,..._.notices.length?[{type:"text",text:`
|
|
58
|
-
|
|
59
|
-
${_.notices.join(`
|
|
60
|
-
`)}`}]:[],...M]}}if(!d.has(s.toolName))return;let n=s.content.filter(S=>S.type==="text").map(S=>S.text).join(`
|
|
61
|
-
`),c=s.structuredContent,a=c!==null&&typeof c=="object"&&"data"in c?c:{status:s.isError?"error":"success",data:c},u=a.data,h=u!==null&&typeof u=="object"&&"effect"in u&&u.effect==="applied"&&"targetUnavailable"in u&&typeof u.targetUnavailable=="string"?u.targetUnavailable:void 0,w=h===void 0?n:`${n}
|
|
62
|
-
|
|
63
|
-
This result has no verified text selection: ${h}
|
|
64
|
-
Read/Search the file before the next edit; do not repeat the applied edit.`,m=We(a),T=t.publish(a,w,r.cwd,m),I=!s.isError&&a.status!=="error",P=s.toolName==="search"&&I?$e(a,T):s.toolName==="read"?I?At(s.content,T):void 0:Rt(s.details),R=A.get(s.toolCallId);if(A.delete(s.toolCallId),R!==void 0){let S=s.content.filter(O=>O.type==="image");S.length&&v.set(R,[...v.get(R)??[],...S])}return{content:[{type:"text",text:T},...s.content.filter(S=>S.type!=="text")],...P!==void 0&&{structuredContent:P}}})},"finalize");return{api:{...e,on:p,registerTool:x},finalize:b}}l(Le,"createIdeTextResults");function Ue(e){if(e===null||typeof e!="object")return[];let t="outputNotice"in e&&typeof e.outputNotice=="string"?[e.outputNotice]:[];if("resources"in e&&Array.isArray(e.resources)){let d=e.resources;for(let i of d)i!==null&&typeof i=="object"&&"details"in i&&t.push(...Ue(i.details))}return t}l(Ue,"outputNotices");function Pt(e,t){let d=l(o=>{if(Array.isArray(o))return o.map(d);if(typeof o!="string")return o;let f=/^<system-result\b[^>]*><uuid>([a-f\d-]{36})<\/uuid>/u.exec(o)?.[1];return f?`RESULT#${f}`:o},"label"),i={...t};for(let o of Be[e]??[])Object.assign(i,{[o]:d(t[o])});return i}l(Pt,"displaySources");function We(e){if(e===null||typeof e!="object"||!("data"in e))return[];let t=e.data;return t===null||typeof t!="object"?[]:"resources"in t&&Array.isArray(t.resources)?t.resources.flatMap(i=>We({data:i})):"files"in t&&Array.isArray(t.files)?t.files.flatMap(i=>i!==null&&typeof i=="object"&&"source"in i&&typeof i.source=="string"&&/^(?:shell|debug):/u.test(i.source)?[i.source]:[]):"source"in t&&typeof t.source=="string"?[t.source]:[]}l(We,"resultResources");function qe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}l(qe,"isRecord");function Ge(e,t){if(!qe(e)||!Array.isArray(e.tools))return e;let d=e.tools,i=d.map(o=>!qe(o)||o.type!=="function"||typeof o.name!="string"||!t.has(o.name)||o.strict!==void 0?o:{...o,strict:!1});return i.some((o,f)=>o!==d[f])?{...e,tools:i}:e}l(Ge,"preserveResponsesToolOmission");function Ve(e,t,d){let i=new Map,o=[],f=[];function y(v,g){le(v,g);for(let x of g){let b=i.get(x.id);if(b)throw new Error(`Setting ${x.id} is already registered by ${b.owner}`)}for(let x of g)if(i.set(x.id,{owner:v,definition:x}),x.kind==="boolean"){let{kind:b,group:s,...r}=x;o.push({...r,...s==="ui"?{group:s}:{}})}else f.push({...x,group:x.group??"features"})}l(y,"register"),y("pi-agent-ide",[...t.map(v=>({...v,kind:"boolean"})),...d]);async function E(v,g){let x=i.get(v)?.definition;if(!x)throw new Error(`Unknown Agent IDE setting: ${v}`);let b=B(process.env,void 0,g),[s,r]=await Promise.all([j(b.globalPath),j(b.projectPath)]),n=x.kind==="boolean"?{...q(s),...q(r)}:{...s.preferences,...r.preferences},c=Object.hasOwn(n,v),a=c?n[v]:x.default;if(a===void 0||(x.kind==="boolean"?typeof a!="boolean":typeof a!="string"))throw new Error(`Invalid saved setting type: ${v}`);if(x.kind==="choice"&&!x.values.some(u=>u.value===a))throw new Error(`Invalid saved setting choice: ${v}`);return{value:a,overridden:c}}l(E,"read");let p=e.events.on(re,v=>{let g=v;try{y(g.owner,g.definitions),g.accept()}catch(x){g.accept(x instanceof Error?x:new Error(String(x)))}}),A=e.events.on(ie,v=>{let g=v;g.accept(E(g.id,g.cwd))});return e.on("session_shutdown",()=>{p(),A()}),e.events.emit(ae,void 0),{flags:o,preferences:f,read:E}}l(Ve,"createAgentIdeSettingsRegistry");import{VERSION as Ye}from"@earendil-works/pi-coding-agent";import{getCurrentTools as Ct}from"@earendil-works/pi-ai";function Je(e){let t=/^(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/u.exec(e);if(t===null||se(t,[0,99,1])<0||ze(t,[0,99,1]))throw new Error(`Pi Agent IDE requires Pi 0.99.1 or newer; this host is ${e}. Update Pi before loading the extension.`)}l(Je,"assertSupportedHost");function He(e){let t=/^(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z.-]+)?/u.exec(e);return t!==null&&se(t,[1,3,0])>=0&&!ze(t,[1,3,0])}l(He,"hostOwnsToolLoadout");function se(e,t){return e.slice(1,4).map((d,i)=>Number(d)-(t[i]??0)).find(d=>d!==0)??0}l(se,"compareVersion");function ze(e,t){return se(e,t)===0&&e[4]!==void 0}l(ze,"isPrereleaseOf");async function kt(e){Je(Ye);let t=await he(B()),d=t.preferences?.["ui.codemode"]!=="on",i=De(e,d),o=Le(i.api),f=Ae(o.api);e.on("before_provider_request",(v,g)=>{if(g.model?.api!=="openai-responses")return;let x=new Set(e.getAllTools().filter(b=>b.namespace?.name.startsWith("ide_")).map(b=>b.name));return Ge(v.payload,x)}),e.on("session_start",(v,g)=>{if(He(Ye)){f.reconcile(!0,[],!0);return}let x=v.reason==="reload"?[]:Ct(g.sessionManager.getBranch().flatMap(b=>b.type==="message"?[b.message]:[])).map(b=>b.name);f.reconcile(!0,x)}),e.on("before_agent_start",v=>{f.reconcile();let g=v.systemPromptOptions;g.toolSnippets.bash&&(g.toolSnippets.bash=g.toolSnippets.bash.replace("Execute bash commands (ls, grep, find, etc.)","Execute Bash commands"));let x=/^<rules>\n([\s\S]*?)\n<\/rules>$/mu.exec(v.systemPrompt)?.[1];x?.includes("- Use bash for file operations like ls, rg, find")&&(g.sections.rules=x.replace(/(?:^|\n)- Use bash for file operations like ls, rg, find(?=\n|$)/u,"").trim());let b=e.getAllTools().filter(a=>a.exposure!=="hidden"),s=e.getActiveTools(),r=s.includes("tool_search")?"Use tool_search to find":s.includes("codemode")?"Use searchTools inside codemode to find":"Enable native tool_search to find",n=b.filter(a=>a.namespace?.name==="ide_git").map(a=>a.name),c=[...n.length===0?[]:[`${r} ${n.join(" and ")} in ide_git when staging or unstaging selected Git changes.`],...b.some(a=>a.name==="debug"&&a.namespace?.name==="ide_debug")?[`${r} debug in ide_debug when creating a debugger session.`]:[]];g.sections.ide_discovery=c.join(`
|
|
65
|
-
`)});let y=Se(e,{"pi-agent-ide-no-animations":t.noAnimations??!1,"pi-agent-ide-no-post-processing":t.noPostProcessing??!1,...t.flags});y.register({id:"pi-agent-ide-developer-mode",name:"Developer mode",description:"Enable development commands, including manual setup-hint previews.",default:!1}),y.register({id:"pi-agent-ide-no-animations",name:"Static edit previews",group:"ui",description:"Show edit results immediately, without animated playback.",default:!1}),y.register({id:"pi-agent-ide-no-post-processing",name:"Skip automatic post-processing",description:"Skip automatic formatting and diagnostics after edits. Explicit diagnostic reads still work.",default:!1}),y.register({id:"pi-agent-ide-vision-arbitrary-windows",name:"Capture arbitrary windows",description:"Allow window:PID capture for processes not owned by Agent IDE. Keep disabled unless the agent may inspect other desktop apps.",default:!1}),y.register({id:"pi-agent-ide-vision-displays",name:"Capture full displays",description:"Allow display screenshots through display: and display:#N resources. Keep disabled unless the agent may inspect the full desktop.",default:!1}),y.register({id:"pi-agent-ide-no-diagnostic-buffer",name:"Immediate diagnostic notices",description:"Send findings immediately instead of combining reports received over five seconds.",group:"ui",default:!1}),y.register({id:"pi-agent-ide-code-review",name:"Jev code review",description:"Review saved edit fragments against project YAML rules in the background. Sends code to a connected Jev provider.",default:!1}),y.register({id:"pi-agent-ide-code-review-capture",name:"Capture code-review rules",description:"Use the packaged skill to propose reusable rules from user review feedback. Save only after confirmation.",default:!1});let E=Ve(e,[...y.definitions,{id:"pi-agent-ide-yolo",name:"YOLO: allow all operations",description:"Skip existing operation confirmation dialogs unless an extension explicitly disables its YOLO setting. Safety checks and remote permissions still apply.",default:!1,labels:{on:"on",off:"off"}},{id:"pi-agent-ide-filesystem-yolo",name:"YOLO: filesystem operations",description:"Skip filesystem operation confirmations. Default inherits common YOLO; Off disables persistent permission, not remembered session grants. Protected paths stay protected.",default:!1,labels:{on:"on",off:"off"}}],V);de(e,{async isAllowed(v,g){if(v.yoloSetting===void 0)return!1;let x=await K(e.events,v.yoloSetting,g.cwd);if(typeof x.value!="boolean")throw new Error(`Operation approval needs a boolean YOLO setting: ${v.yoloSetting}`);return x.overridden?x.value:(await K(e.events,"pi-agent-ide-yolo",g.cwd)).value===!0}}),Ee(e,E.flags,E.preferences),Ie(e),ce(e,[Te(E.flags,E.preferences)]);let p=W(D,t.preset??"full"),{enabled:A}=J(D,[...p,...t.disabled],t.enabled);for(let v of A)await v.register(f.api,{preferences:t.preferences??{}});i.finalize(),o.finalize()}l(kt,"registerUnifiedPiAgentIde");export{kt as default};
|
|
38
|
+
# Guide:`)),details:b.details,isError:a.isError})}}),e.on("message_end",a=>{if(a.message.role!=="toolResult")return;let o=l.get(a.message.toolCallId);if(!o)return;l.delete(a.message.toolCallId);for(let[w,S]of d)S===o.parentToolCallId&&d.delete(w);let m=o.calls.filter(w=>!w.batched),h={...o,parentToolName:a.message.toolName,calls:[],retention:{...o.retention,argumentsTruncated:m.some(w=>w.argumentsTruncated===!0),resultsOmitted:m.some(w=>w.resultOmitted===!0),resultsUnavailable:m.some(w=>!w.result)}},b=Buffer.byteLength(JSON.stringify(h));for(let w of m){let S=JSON.stringify(w);if(b+=Buffer.byteLength(S)+(h.calls.length>0?1:0),b>Ie){h.retention.callsOmitted=!0;break}h.calls.push(JSON.parse(S))}e.appendEntry(K,h)}),e.registerEntryRenderer(K,r(function a(o,m,h){if(!Array.isArray(o.data?.calls))return;let b=t&&o.data.parentToolName==="codemode"&&!m.expanded,w=b?o.data.calls.filter(x=>x.result?.isError):o.data.calls;if(b&&w.length===0){let x=Te(o.data);return x?new q(h.fg("warning",x),0,0):new X}if(!y)return{render:r(x=>y?a(o,m,h)?.render(x)??[]:[],"render"),invalidate:r(()=>{o.data&&i.get(o.data)?.invalidate()},"invalidate")};let S=Te(o.data),p=b?void 0:i.get(o.data);if(!p){p=new X;for(let x of w){let C=new ve(x.name,x.id,x.renderArgs??x.args,{showImages:!0},x.resultOmitted||x.omitted||!x.result?void 0:I(x.name),y,o.data.cwd);x.result?C.updateResult({...x.result,...x.durationMs===void 0||x.groupedResult===!0?{}:{durationMs:x.durationMs}}):C.updateResult({content:[{type:"text",text:"Result unavailable in this saved display."}],isError:!0}),p.addChild(new Ee(1)),p.addChild(C)}S&&p.addChild(new q(h.fg("warning",S),0,0)),b||i.set(o.data,p)}let P=p.children.at(-1);S&&P instanceof q&&P.setText(h.fg("warning",S));for(let x of p.children)x instanceof ve&&x.setExpanded(m.expanded);return p},"renderEntry"));let g=r(()=>{e.events.on(re,a=>{let o=a,m=l.get(o.parentToolCallId);if(!m)return;let h=J(o.result.details),b=o.calls.findLast(S=>!o.unchangedCopyCalls?.includes(S)),w="callIdsByResult"in h&&Array.isArray(h.callIdsByResult)?h.callIdsByResult:[];for(let S of o.calls){let p=m.calls.find(T=>T.id===S);if(!p)continue;let P=h.results?.filter((T,E)=>(w[E]===S||w.length===0&&o.calls.length===1)&&T.data.errors?.some(k=>k.code==="POST_WRITE_FAILED"||k.code==="POST_EDIT_FAILED"))??[];if(p.postWriteFailure=P.length>0,p.postWriteFailure){p.batched=!1,delete p.renderArgs,s(m,p,{content:o.result.content,details:{results:P,effect:"applied"},isError:!0});continue}let x=o.mutationResults?.get(S),C=x?.details.metadata?.copyRollback;if(p.name==="copy"&&x&&(C==="restored"||C==="failed")){p.copyRollback=C,p.batched=!1,s(m,p,{content:x.content,details:J(x.details),isError:!0});continue}if(p.unchangedCopy=p.name==="copy"&&o.unchangedCopyCalls?.includes(S)===!0,p.batched=!p.unchangedCopy&&S!==b,p.groupedResult=!p.batched&&!p.unchangedCopy&&o.calls.filter(T=>!o.unchangedCopyCalls?.includes(T)).length>1,p.unchangedCopy)s(m,p,{content:[{type:"text",text:"No changes: destination already has this text."}],details:{},isError:!1});else if(p.batched)p.result=void 0;else{new Set(h.mutationRender?.map(E=>E.path)).size>1&&(p.renderArgs={}),p.rollback=h.results?.some(E=>E.data.rollback!==void 0)===!0;let T=p.result?.details?.metadata?.targetUnavailable;s(m,p,{content:o.result.content,details:typeof T=="string"?{...h,metadata:{...h.metadata,targetUnavailable:T}}:h,isError:o.result.isError===!0||p.rollback})}}}),e.on("tool_result",a=>{let o=a.details,m=l.get(a.toolCallId);if(m&&o&&typeof o=="object"&&"editorBatchResults"in o&&Array.isArray(o.editorBatchResults))for(let h of o.editorBatchResults)for(let b of h.data?.operations??[]){let w=m.calls.find(p=>p.id===b.id);if(!w)continue;let S=b.errors.map(p=>p.message);w.rollback||w.postWriteFailure||w.copyRollback!==void 0||w.unchangedCopy&&S.length===0&&b.effect==="not-applied"||(S.length>0||b.effect!=="applied")&&(w.batched=!1,delete w.renderArgs,s(m,w,{content:[{type:"text",text:`${w.name}: ${b.effect}.
|
|
39
|
+
${S.join(`
|
|
40
|
+
`)}`}],details:void 0,isError:S.length>0||b.effect==="unknown"}))}})},"finalize");return{api:{...e,registerTool:r(a=>{u.set(a.name,a),e.registerTool(a)},"registerTool")},finalize:g}}r(Ae,"createNestedIdeRendering");function Re(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}r(Re,"isRecord");function Pe(e,t){if(!Re(e)||!Array.isArray(e.tools))return e;let u=e.tools,f=u.map(n=>!Re(n)||n.type!=="function"||typeof n.name!="string"||!t.has(n.name)||n.strict!==void 0?n:{...n,strict:!1});return f.some((n,d)=>n!==u[d])?{...e,tools:f}:e}r(Pe,"preserveResponsesToolOmission");function Ce(e,t,u){let f=new Map,n=[],d=[];function l(I,s){de(I,s);for(let c of s){let g=f.get(c.id);if(g)throw new Error(`Setting ${c.id} is already registered by ${g.owner}`)}for(let c of s)if(f.set(c.id,{owner:I,definition:c}),c.kind==="boolean"){let{kind:g,group:v,...a}=c;n.push({...a,...v==="ui"?{group:v}:{}})}else d.push({...c,group:c.group??"features"})}r(l,"register"),l("pi-agent-ide",[...t.map(I=>({...I,kind:"boolean"})),...u]);async function y(I,s){let c=f.get(I)?.definition;if(!c)throw new Error(`Unknown Agent IDE setting: ${I}`);let g=$(process.env,void 0,s),[v,a]=await Promise.all([_(g.globalPath),_(g.projectPath)]),o=c.kind==="boolean"?{...B(v),...B(a)}:{...v.preferences,...a.preferences},m=Object.hasOwn(o,I),h=m?o[I]:c.default;if(h===void 0||(c.kind==="boolean"?typeof h!="boolean":typeof h!="string"))throw new Error(`Invalid saved setting type: ${I}`);if(c.kind==="choice"&&!c.values.some(b=>b.value===h))throw new Error(`Invalid saved setting choice: ${I}`);return{value:h,overridden:m}}r(y,"read");let i=e.events.on(se,I=>{let s=I;try{l(s.owner,s.definitions),s.accept()}catch(c){s.accept(c instanceof Error?c:new Error(String(c)))}}),R=e.events.on(ie,I=>{let s=I;s.accept(y(s.id,s.cwd))});return e.on("session_shutdown",()=>{i(),R()}),e.events.emit(ae,void 0),{flags:n,preferences:d,read:y}}r(Ce,"createAgentIdeSettingsRegistry");import{VERSION as _e}from"@earendil-works/pi-coding-agent";import{getCurrentTools as tt}from"@earendil-works/pi-ai";function ke(e){let t=/^(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/u.exec(e);if(t===null||Z(t,[0,99,1])<0||Oe(t,[0,99,1]))throw new Error(`Pi Agent IDE requires Pi 0.99.1 or newer; this host is ${e}. Update Pi before loading the extension.`)}r(ke,"assertSupportedHost");function De(e){let t=/^(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z.-]+)?/u.exec(e);return t!==null&&Z(t,[1,3,0])>=0&&!Oe(t,[1,3,0])}r(De,"hostOwnsToolLoadout");function Z(e,t){return e.slice(1,4).map((u,f)=>Number(u)-(t[f]??0)).find(u=>u!==0)??0}r(Z,"compareVersion");function Oe(e,t){return Z(e,t)===0&&e[4]!==void 0}r(Oe,"isPrereleaseOf");async function nt(e){ke(_e);let t=await le($()),u=t.preferences?.["ui.codemode"]!=="on",f=Ae(e,u),n=ne(f.api),d=ye(n.api),l=!1;e.on("session_shutdown",()=>{l=!0}),e.on("before_provider_request",(s,c)=>{if(l||c.model?.api!=="openai-responses")return;let g=new Set(e.getAllTools().filter(v=>v.namespace?.name.startsWith("ide_")).map(v=>v.name));return Pe(s.payload,g)}),e.on("session_start",(s,c)=>{if(l=!1,De(_e)){d.reconcile(!0,[],!0);return}let g=s.reason==="reload"?[]:tt(c.sessionManager.getBranch().flatMap(v=>v.type==="message"?[v.message]:[])).map(v=>v.name);d.reconcile(!0,g)}),e.on("before_agent_start",s=>{d.reconcile();let c=s.systemPromptOptions;c.toolSnippets.bash&&(c.toolSnippets.bash=c.toolSnippets.bash.replace("Execute bash commands (ls, grep, find, etc.)","Execute Bash commands"));let g=/^<rules>\n([\s\S]*?)\n<\/rules>$/mu.exec(s.systemPrompt)?.[1];g?.includes("- Use bash for file operations like ls, rg, find")&&(c.sections.rules=g.replace(/(?:^|\n)- Use bash for file operations like ls, rg, find(?=\n|$)/u,"").trim());let v=e.getAllTools().filter(b=>b.exposure!=="hidden"),a=e.getActiveTools(),o=a.includes("tool_search")?"Use tool_search to find":a.includes("codemode")?"Use searchTools inside codemode to find":"Enable native tool_search to find",m=v.filter(b=>b.namespace?.name==="ide_git").map(b=>b.name),h=[...m.length===0?[]:[`${o} ${m.join(" and ")} in ide_git when staging or unstaging selected Git changes.`],...v.some(b=>b.name==="debug"&&b.namespace?.name==="ide_debug")?[`${o} debug in ide_debug when creating a debugger session.`]:[]];c.sections.ide_discovery=h.join(`
|
|
41
|
+
`)});let y=he(e,{"pi-agent-ide-no-animations":t.noAnimations??!1,"pi-agent-ide-no-post-processing":t.noPostProcessing??!1,...t.flags});y.register({id:"pi-agent-ide-developer-mode",name:"Developer mode",description:"Enable development commands, including manual setup-hint previews.",default:!1}),y.register({id:"pi-agent-ide-no-animations",name:"Static edit previews",group:"ui",description:"Show edit results immediately, without animated playback.",default:!1}),y.register({id:"pi-agent-ide-no-post-processing",name:"Skip automatic post-processing",description:"Skip automatic formatting and diagnostics after edits. Explicit diagnostic reads still work.",default:!1}),y.register({id:"pi-agent-ide-no-diagnostic-buffer",name:"Immediate diagnostic notices",description:"Send findings immediately instead of combining reports received over five seconds.",group:"ui",default:!1}),y.register({id:"pi-agent-ide-code-review",name:"Jev code review",description:"Review saved edit fragments against project YAML rules in the background. Sends code to a connected Jev provider.",default:!1}),y.register({id:"pi-agent-ide-code-review-capture",name:"Capture code-review rules",description:"Use the packaged skill to propose reusable rules from user review feedback. Save only after confirmation.",default:!1});let i=Ce(e,[...y.definitions,{id:"pi-agent-ide-yolo",name:"YOLO: allow all operations",description:"Skip existing operation confirmation dialogs unless an extension explicitly disables its YOLO setting. Safety checks and remote permissions still apply.",default:!1,labels:{on:"on",off:"off"}},{id:"pi-agent-ide-filesystem-yolo",name:"YOLO: filesystem operations",description:"Skip filesystem operation confirmations. Default inherits common YOLO; Off disables persistent permission, not remembered session grants. Protected paths stay protected.",default:!1,labels:{on:"on",off:"off"}}],G);te(e,{async isAllowed(s,c){if(s.yoloSetting===void 0)return!1;let g=await Y(e.events,s.yoloSetting,c.cwd);if(typeof g.value!="boolean")throw new Error(`Operation approval needs a boolean YOLO setting: ${s.yoloSetting}`);return g.overridden?g.value:(await Y(e.events,"pi-agent-ide-yolo",c.cwd)).value===!0}}),pe(e,i.flags,i.preferences),me(e),oe(e,[be(i.flags,i.preferences)]);let R=j(D,t.preset??"full"),{enabled:I}=U(D,[...R,...t.disabled],t.enabled);for(let s of I)await s.register(d.api,{preferences:t.preferences??{}});f.finalize(),n.finalize()}r(nt,"registerUnifiedPiAgentIde");export{nt as default};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Syntax search with ast_search
|
|
2
|
+
|
|
3
|
+
`ast_search` runs ast-grep in files or inside a Read, Search or edit result. It works for every language ast-grep supports.
|
|
4
|
+
|
|
5
|
+
## Patterns
|
|
6
|
+
|
|
7
|
+
Pass `pattern` in source-code syntax. `$NAME` captures one node and `$$$ARGS` captures several, including their punctuation. A pattern must parse as code in the file's language.
|
|
8
|
+
|
|
9
|
+
Each match shows a `SEARCH#...:N:match` reference and a `capture NAME: RESULT#...` reference per capture. Pass either to Read, Search or an edit tool; a capture selects exactly its nodes, such as a function body or an argument list. `SEARCH#...:all:match` selects every match of a complete result. A single-match reference goes stale when its file changes; repeat the search.
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
const calls = await tools.ast_search({ path: "client.ts", pattern: "request($OPTIONS)" });
|
|
13
|
+
text(calls.result);
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Rules
|
|
17
|
+
|
|
18
|
+
Pass `rule` with `language` for relations a pattern cannot express. `rule` is the value of `rule:` in an ast-grep rule file, as a JSON object: `pattern`, `kind`, `regex`, `inside`, `has`, `not`, `all`, `any`, `follows`, `precedes`. A relational rule needs `stopBy: "end"` to look past the nearest parent or child, and `stopBy: { kind: ... }` to stop at a boundary.
|
|
19
|
+
|
|
20
|
+
Calls to `send` in the own body of `outer`, skipping nested functions:
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"language": "python",
|
|
25
|
+
"rule": {
|
|
26
|
+
"pattern": "send($$$)",
|
|
27
|
+
"inside": {
|
|
28
|
+
"kind": "function_definition",
|
|
29
|
+
"stopBy": { "kind": "function_definition" },
|
|
30
|
+
"has": { "field": "name", "regex": "^outer$" }
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Node kinds are tree-sitter names and differ by language, for example `function_declaration`, `method_definition` and `arrow_function` in TypeScript, `function_definition` in Python. An unknown kind fails with an explicit error.
|
|
37
|
+
|
|
38
|
+
## Enclosing constructs
|
|
39
|
+
|
|
40
|
+
Pass a Read, Search or edit result as `path` and `relation: "enclosing"` to get the innermost match that contains each of its ranges. Starting from a text match:
|
|
41
|
+
|
|
42
|
+
```js
|
|
43
|
+
const hit = await tools.search({ path: "src/app.ts", query: '"connection lost"' });
|
|
44
|
+
const fn = await tools.ast_search({
|
|
45
|
+
path: hit.result,
|
|
46
|
+
relation: "enclosing",
|
|
47
|
+
language: "typescript",
|
|
48
|
+
rule: {
|
|
49
|
+
any: [
|
|
50
|
+
{ kind: "function_declaration" },
|
|
51
|
+
{ kind: "method_definition" },
|
|
52
|
+
{ kind: "arrow_function" },
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Without `relation`, a result scope keeps only matches wholly inside its ranges; matches are never clipped.
|
|
@@ -6,4 +6,4 @@ Read stopped state before the next action. Use `views: ["breakpoints"]` when bre
|
|
|
6
6
|
|
|
7
7
|
A session reporting adapter `vscode` runs in the user's VS Code window through DebugMCP; the same resources and actions apply. Its breakpoints and debug session are visible to the user. It shows aggregate values as `<complex value>`; evaluate an expression that formats the value, such as `repr(items)` in Python, to read it. Use `configuration` to launch a `.vscode/launch.json` entry when the program needs arguments or environment or is a compiled executable, and `test` to debug one test. Pass `backend: "native"` with an `adapter` to keep debugging outside VS Code. If `backend: "vscode"` fails, its error names the unmet condition; open the workspace in VS Code or use the native backend.
|
|
8
8
|
|
|
9
|
-
Use an SSH `cwd` to
|
|
9
|
+
Use an SSH `cwd` to debug on a remote target (see `docs:ssh`); the adapter must be installed there.
|
|
@@ -1,72 +1,40 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Editing
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Select text
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- `LINE#HASH` from `read` with `views: ["anchors"]` selects a line. `scope-begin-HASH` / `scope-end-HASH` from the `ast` view select a syntax block. `SEARCH#…:line` selects a search match's line, `SEARCH#…:match` the match itself. `begin` and `end` select the first and last line.
|
|
6
|
+
- Without an anchor, use the shortest unique exact text.
|
|
7
|
+
- With `start` and `end`, the selection runs from the start of `start` to the end of `end`. Exact text keeps character boundaries; line anchors take whole lines. When both `start` and `end` match complete lines, such as BEGIN/END marker lines, the selection takes those lines whole.
|
|
8
|
+
- After an exact-text selector fails, exact text is blocked for that file until an anchor-based edit succeeds. Use one of the anchors the error returns; don't guess another string.
|
|
9
|
+
- Anchors and results go stale when their file changes. Read or search again before reusing them.
|
|
6
10
|
|
|
7
|
-
##
|
|
11
|
+
## Pass results between tools
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
Pass a result unchanged as `path` (outside Codemode its UUID also works). It selects exactly what it returned:
|
|
10
14
|
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
- `begin` and `end` select the first and last existing lines.
|
|
15
|
-
- A unique exact string selects that fragment.
|
|
15
|
+
- read: its window; search: its matches;
|
|
16
|
+
- replace and insert: the new text; copy and move: the destination text;
|
|
17
|
+
- write and undo: the whole file; delete: nothing.
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
In Codemode, `search` returns `{ result, hasMatches, complete }`: pass `result` on. `hasMatches: false` proves absence only when `complete` is `true`. A failed read resolves to `{ status: "error", errors }` instead of rejecting. An image read returns an image block; pass it to `write` as `content` to save it.
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
## Batches and Codemode
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
- Parallel calls in one response all see the files as they were before the batch. Put overlapping changes into one call.
|
|
24
|
+
- A rejected call doesn't cancel the others. Retry only what failed.
|
|
25
|
+
- In Codemode, await edits on different files concurrently and on the same file in order. Failed tools reject: use `Promise.allSettled` when calls may fail.
|
|
26
|
+
- An error is not proof that nothing was written. After a failure or interruption, read the file before retrying.
|
|
22
27
|
|
|
23
|
-
##
|
|
28
|
+
## Files and directories
|
|
24
29
|
|
|
25
|
-
|
|
30
|
+
- `delete`, `copy` and `move` with a plain path and no `start` act on the whole file, directory or symlink. Symlinks are handled as links, never followed.
|
|
31
|
+
- Copying a directory merges into the target; moving one replaces the target. Recursive transfers have no rollback.
|
|
32
|
+
- Deleting a directory or symlink can ask the user for confirmation; read `docs:ide-settings` if they want to change that.
|
|
26
33
|
|
|
27
|
-
|
|
34
|
+
## Blank lines
|
|
28
35
|
|
|
29
|
-
|
|
30
|
-
- `write.path` and `undo.file` require one whole-file selection. Partial and multi-file scopes are rejected, not widened.
|
|
31
|
-
- `copy.path` / `move.path` select source ranges; `target` selects destination ranges. A zero-width destination inserts. Arrays pair in declared order, with equal counts and duplicates removed. Unequal counts and overlapping moves are rejected.
|
|
32
|
-
- Move succeeds without writes for valid empty arrays and paired zero-width selections. Empty arrays return no selection; paired points return only the unchanged destination points. The usual validation and overlap guards still apply.
|
|
33
|
-
- Ordinary filesystem paths without selectors copy or move one whole object: a regular file, directory tree, or symlink. Result inputs remain text selections; a directory listing does not authorize a whole-directory transfer.
|
|
34
|
-
- `insert` uses line-based insertion before or after its selected containing lines.
|
|
36
|
+
`insert` with `separation: "blank-line"` puts the text in its own paragraph: inserting `X` after `A` in `A\nB` gives `A\n\nX\n\nB`.
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
## Live resources
|
|
37
39
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
## Whole filesystem objects
|
|
41
|
-
|
|
42
|
-
Use ordinary paths without text selectors for whole-object Delete, Copy, and Move. Delete removes directory contents recursively and unlinks symlinks without following their targets. Copy merges directory contents into the exact target directory and keeps destination-only entries. Move replaces an existing target directory and removes destination-only entries. Both transfers create missing parents, preserve file bytes and symlink text, and reject symlink destinations, type conflicts, and overlapping trees. Relative links keep their text; moving them can change what they point to.
|
|
43
|
-
|
|
44
|
-
Directory and symlink transfers have no reusable text selection. Read their ordinary paths to inspect them. A failure before filesystem execution reports `not-applied`; a failure after execution starts reports `unknown`. Inspect both paths before retrying an unknown transfer. Recursive transfers and cross-device Move have no atomic rollback. Cancellation before execution prevents a transfer; in-flight filesystem work may finish.
|
|
45
|
-
|
|
46
|
-
## Line separation
|
|
47
|
-
|
|
48
|
-
Use `separation: "blank-line"` for a separate paragraph or section; use default line mode for adjacent code, list items, or a continuation. Inserting `X` after `A` in `A\nB` with blank-line separation produces `A\n\nX\n\nB`.
|
|
49
|
-
|
|
50
|
-
## Writes and failures
|
|
51
|
-
|
|
52
|
-
When Write changes or creates a file, it saves the file and finishes post-edit processing before returning, including in Codemode. If an existing file already matches the supplied content, Write returns its whole-file selection without writing or running post-edit handlers. Earlier pending edits commit before Write. Other eligible text edits keep their pending-batch behavior.
|
|
53
|
-
|
|
54
|
-
Independent calls share the original snapshots. Combine overlapping edits into one mutation. A rejected call does not cancel successful peers; retry only unapplied changes.
|
|
55
|
-
|
|
56
|
-
An omitted path can inherit the file identified by an anchor, the last read, or the preceding edit in the batch. Supply the path when that would be ambiguous.
|
|
57
|
-
|
|
58
|
-
An ordinary `delete.path` without selectors deletes a whole file, directory, or symlink. Directory and link deletion applies Git protection and the shared host permission policy. User-configured YOLO or a remembered session grant can skip its dialog; no tool argument supplies approval. Protected paths, hooks and target revalidation still apply. Without UI, gated operations fail closed unless YOLO or a session grant permits them. Read `docs:ide-settings` when the user asks to change confirmation settings. Links are unlinked without following their targets. A result input removes only selected text. Ordinary copy/move paths without selectors transfer whole regular files and replace an existing regular destination file.
|
|
59
|
-
|
|
60
|
-
Inside Codemode, await independent edits on disjoint resources concurrently and overlapping resources in order. Pass a pending edit result directly to another source tool for dependent work; that boundary commits the batch before consuming the result.
|
|
61
|
-
|
|
62
|
-
Failed tools reject in Codemode. Use try/catch or Promise.allSettled when independent calls may fail. Inspect the parent result for actual committed effects: an acceptance is not proof of writing, and an error is not proof of rollback. Read the affected files when the result cannot confirm their final state.
|
|
63
|
-
|
|
64
|
-
After an interruption, read the affected files before retrying. Retry only unapplied edits.
|
|
65
|
-
|
|
66
|
-
## Specialized resources
|
|
67
|
-
|
|
68
|
-
- `shell:<session>`: write sends exact input, insert sends keys, delete terminates the session.
|
|
69
|
-
- `debug:<session>`: insert controls the debugger; delete removes a breakpoint or terminates it.
|
|
70
|
-
- `symbol:<file>#<selector>#name`: replace performs a native language-server rename when available.
|
|
71
|
-
|
|
72
|
-
Read `docs:terminal`, `docs:debugger`, or `docs:search-code` before using these resources. Never guess after a stale snapshot, ambiguous target, incomplete selection, or unknown rollback effect.
|
|
40
|
+
`shell:`, `debug:` and `symbol:` paths: read `docs:terminal` or `docs:debugger`; `symbol:` is described in the `path` field of the edit tools.
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
# Git changes
|
|
1
|
+
# Git changes
|
|
2
2
|
|
|
3
|
-
Read a tracked file with `views: ["changes"]` to see staged and unstaged hunks
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
After a failed or interrupted unstage call, inspect the index with `git diff --cached -- <file>` before retrying. Do not assume the error means the index stayed unchanged.
|
|
8
|
-
|
|
9
|
-
Use a `CHANGE#` anchor to restore that selected Git change to `HEAD` in both worktree and index. Use `last` with a file only for that file's latest text-editor transaction. Inspect current changes before destructive restoration.
|
|
10
|
-
|
|
11
|
-
Undo applies the restore before returning, including in Codemode. Earlier pending edits commit before Undo runs. Formatting and registered post-edit handlers run at script end in Codemode; read the file again if they change its bytes.
|
|
12
|
-
|
|
13
|
-
`last` restores one saved transaction, not an undo history or redo. A successful restore clears that saved transaction.
|
|
14
|
-
|
|
15
|
-
After a failed or interrupted Git restore, read the file and inspect the index with `git diff --cached -- <file>` before retrying. Text restoration can succeed before an index update fails. Retry only the work that remains unapplied.
|
|
3
|
+
- Read a tracked file with `views: ["changes"]` to see its staged and unstaged hunks as `CHANGE#` anchors. Anchors go stale when the file or index changes; read again.
|
|
4
|
+
- Stage or unstage one change by its anchor. `undo` with a `CHANGE#` anchor reverts that change in worktree and index; `undo` with `last` reverts the last tool edit of a file, once.
|
|
5
|
+
- After a failed or interrupted stage, unstage or undo, read the file and check `git diff --cached -- <file>` before retrying: the worktree can change before the index update fails.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Search
|
|
2
|
+
|
|
3
|
+
## Queries
|
|
4
|
+
|
|
5
|
+
- Plain text is literal. If nothing matches, unquoted input is retried as a regex, then as separate words. The result says when it broadened; treat broadened matches as location hints, not edit targets. Quoted text stays literal.
|
|
6
|
+
- Boolean: uppercase `AND`, `OR`, infix `NOT`, `||` or a spaced `|`; parentheses group. `regex:<pattern>` forces a regex.
|
|
7
|
+
- A match stays on one line. `multiline: true` lets it span lines, and `.` then matches line breaks. Boolean queries are always single-line.
|
|
8
|
+
- Narrow with `path`, `include` and `exclude` before broadening. Find files by name with `file_search`.
|
|
9
|
+
- After zero matches, an identifier can get "possible names": spelling hints in the same scope, each with its own references. They are not equivalents; read a candidate before editing it.
|
|
10
|
+
|
|
11
|
+
## Results
|
|
12
|
+
|
|
13
|
+
- Each match has `SEARCH#HASH:N:line` (its line) and `SEARCH#HASH:N:match` (the exact match). `:all:line` and `:all:match` select every match, across files. Pass them to `read` or an edit tool as they are.
|
|
14
|
+
- A single reference goes stale when its file changes; search again. An `:all` reference re-runs its query instead.
|
|
15
|
+
- In Codemode, search returns `{ result, hasMatches, complete }`: pass `result` on. `hasMatches: false` proves absence only when `complete` is `true`.
|
|
16
|
+
- A failed or interrupted search is not zero matches.
|
|
17
|
+
|
|
18
|
+
## Search inside a result
|
|
19
|
+
|
|
20
|
+
Pass an unchanged Read/Search/edit result as `path` to search only its ranges; gaps between ranges and `include`/`exclude` don't apply. Use it to narrow a selection before editing, for example the text between two markers:
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
const section = await tools.read({ path: "notes.md", offset: 20, limit: 40 });
|
|
24
|
+
const body = await tools.search({
|
|
25
|
+
path: section,
|
|
26
|
+
query: "regex:(?<=<!-- START -->\\n).*?(?=<!-- END -->)",
|
|
27
|
+
multiline: true,
|
|
28
|
+
});
|
|
29
|
+
await tools.replace({ path: body.result, text: "new body\n" });
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
For syntax structure, use `ast_search` on the same result.
|
|
33
|
+
|
|
34
|
+
## Other sources
|
|
35
|
+
|
|
36
|
+
- `docs:all` or `docs:<id>`: guide text, literal or `regex:`. Read the guide for full context.
|
|
37
|
+
- An HTTP(S) URL or `web:ssh://<target>/https://…`: page text, no read needed first. Matches have no edit references.
|
|
38
|
+
- `shell:<session>`: terminal output beyond the tail.
|