pi-agent-ide 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -40
- package/README.md +12 -7
- package/dist/{chunk-MOJ5RR35.js → chunk-246NTPOS.js} +1 -1
- package/dist/{chunk-NULNW6GK.js → chunk-2ITKAXHO.js} +1 -1
- package/dist/{chunk-SBNR4WZF.js → chunk-3WO2NOEQ.js} +1 -1
- package/dist/{chunk-N7LMRL64.js → chunk-47SPPIXK.js} +1 -1
- package/dist/{chunk-EY65TFHJ.js → chunk-4HWKBCBH.js} +1 -1
- package/dist/{chunk-JMVDFOTQ.js → chunk-57F5GTHO.js} +1 -1
- package/dist/{chunk-KL776TGR.js → chunk-7LOVUWNI.js} +1 -1
- package/dist/{chunk-7JV4VN73.js → chunk-A64JRDZK.js} +1 -1
- package/dist/{chunk-Z3PGADVA.js → chunk-AIT3YWR5.js} +1 -1
- package/dist/{chunk-E4HPRLRB.js → chunk-AKNHSDGV.js} +1 -1
- package/dist/{chunk-4XPUN4QN.js → chunk-AUL5FGGK.js} +1 -1
- package/dist/chunk-BB4A5UI3.js +5 -0
- package/dist/{chunk-CTJV77FR.js → chunk-BQAKA3FU.js} +1 -1
- package/dist/{chunk-PNP2KNGP.js → chunk-BR7GRH4A.js} +1 -1
- package/dist/{chunk-4OYVLXWD.js → chunk-D4IA2MTA.js} +1 -1
- package/dist/{chunk-R5XJSEOE.js → chunk-DXONCYWF.js} +3 -3
- package/dist/{chunk-TWWND6NI.js → chunk-E2PHA4SQ.js} +1 -1
- package/dist/{chunk-MZXX353D.js → chunk-EMRJP6EM.js} +1 -1
- package/dist/{chunk-7HDK3NRQ.js → chunk-GEMDU6XW.js} +1 -1
- package/dist/chunk-GNACBJM3.js +1 -0
- package/dist/{chunk-3G54ZL2L.js → chunk-HCK7OIQ3.js} +1 -1
- package/dist/chunk-HFJGCYFO.js +11 -0
- package/dist/{chunk-CSXHCSTH.js → chunk-ID4RJIVZ.js} +1 -1
- package/dist/{chunk-SBLKPTL3.js → chunk-JKMXND6V.js} +1 -1
- package/dist/{chunk-WE42GBGU.js → chunk-LAJQSHEI.js} +1 -1
- package/dist/{chunk-HCN5W76B.js → chunk-LLRUJD62.js} +1 -1
- package/dist/{chunk-2K65BSXS.js → chunk-M4TVRCMZ.js} +1 -1
- package/dist/{chunk-IUSLSROY.js → chunk-N56WAVYA.js} +1 -1
- package/dist/chunk-OI3HBIPK.js +2 -0
- package/dist/{chunk-GW6NZQTQ.js → chunk-PRLIHLCS.js} +1 -1
- package/dist/{chunk-7TJ6DWW3.js → chunk-Q5X6OXNS.js} +1 -1
- package/dist/{chunk-75SWXD2Z.js → chunk-SWA5B5B2.js} +1 -1
- package/dist/chunk-T7MWQQIF.js +3 -0
- package/dist/{chunk-ICDI27GZ.js → chunk-TGC2ZACO.js} +1 -1
- package/dist/{chunk-7NS3QUIE.js → chunk-TXG2H7YQ.js} +1 -1
- package/dist/{chunk-RAZP42IQ.js → chunk-VAXLSPPU.js} +1 -1
- package/dist/chunk-VMGZMXEM.js +10 -0
- package/dist/{chunk-CPZJPGLG.js → chunk-VNTY7BKC.js} +1 -1
- package/dist/chunk-W3YFF6OO.js +1 -0
- package/dist/{chunk-OLI3JPHJ.js → chunk-W7M3V7FR.js} +1 -1
- package/dist/{chunk-UUJJRXHG.js → chunk-WMHSVEIT.js} +1 -1
- package/dist/{chunk-OJX3RJ5A.js → chunk-WPBQ45ZL.js} +1 -1
- package/dist/{chunk-XZDOVPRC.js → chunk-WXGTU2M6.js} +1 -1
- package/dist/{chunk-3ZGDMTMD.js → chunk-XSIKDVAR.js} +1 -1
- package/dist/{chunk-QP2QSQ4U.js → chunk-YHREORHH.js} +1 -1
- package/dist/chunk-YTYLS2UM.js +1 -0
- package/dist/chunk-Z2QGNTGQ.js +1 -0
- package/dist/{chunk-UBH6X3D3.js → chunk-ZV5ETNLQ.js} +1 -1
- package/dist/entry-11.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 -0
- package/dist/entry-20.js +1 -1
- package/dist/entry-21.js +1 -1
- package/dist/entry-22.js +1 -1
- 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 -2
- package/dist/entry-27.js +2 -1
- package/dist/entry-28.js +1 -4
- package/dist/entry-29.js +4 -1
- package/dist/entry-30.js +1 -1
- package/dist/entry-31.js +1 -1
- package/dist/entry-32.js +1 -18
- package/dist/entry-33.js +18 -1
- package/dist/entry-34.js +1 -1
- package/dist/entry-35.js +1 -1
- package/dist/entry-36.js +1 -1
- package/dist/entry-37.js +1 -1
- package/dist/entry-38.js +1 -1
- package/dist/entry-39.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 -25
- package/dist/entry-47.js +25 -1
- package/dist/entry-48.js +1 -1
- package/dist/entry-49.js +1 -1
- package/dist/entry-50.js +1 -1
- package/dist/entry-51.js +1 -3
- package/dist/entry-52.js +3 -13
- package/dist/entry-53.js +13 -1
- package/dist/entry-54.js +1 -1
- package/dist/entry-55.js +1 -1
- package/dist/entry-56.js +1 -1
- package/dist/entry-57.js +1 -1
- package/dist/entry-58.js +1 -1
- package/dist/entry-59.js +1 -1
- package/dist/entry-6.js +1 -1
- package/dist/entry-60.js +1 -1
- package/dist/entry-61.js +1 -1
- package/dist/entry-62.js +1 -0
- package/dist/entry-63.js +0 -1
- package/dist/entry-64.js +1 -0
- package/dist/entry-65.js +0 -1
- package/dist/entry-66.js +1 -1
- package/dist/entry-67.js +1 -1
- package/dist/entry-68.js +1 -1
- package/dist/entry-69.js +1 -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 -0
- package/dist/entry-73.js +0 -1
- package/dist/entry-74.js +1 -0
- package/dist/entry-75.js +0 -1
- package/dist/entry-76.js +1 -1
- package/dist/entry-77.js +1 -1
- package/dist/entry-78.js +1 -80
- package/dist/entry-79.js +76 -17
- package/dist/entry-80.js +22 -2
- package/dist/entry-81.js +2 -1
- package/dist/entry-82.js +1 -1
- package/dist/entry-83.js +1 -1
- package/dist/entry-84.js +1 -3
- package/dist/entry-85.js +3 -1
- package/dist/entry-86.js +1 -1
- package/dist/entry-87.js +1 -1
- package/dist/entry-88.js +1 -0
- package/dist/pi-agent-ide.js +53 -24
- package/docs/agent-guides/search-code.md +3 -1
- package/docs/agent-guides/ssh.md +1 -1
- package/docs/configuration.md +18 -6
- package/docs/development.md +1 -13
- package/docs/extensions.md +1 -1
- package/docs/releases.md +1 -1
- package/docs/settings-help.md +39 -0
- package/docs/tools.md +1 -0
- package/docs/user-hooks.md +3 -1
- package/node_modules/pi-agent-doctor/package.json +7 -10
- package/node_modules/pi-agent-documentation/package.json +2 -2
- package/node_modules/pi-agent-documentation/runtime/entry-26.js +1 -0
- package/node_modules/pi-agent-filesystem/package.json +8 -8
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- package/node_modules/pi-agent-filesystem-jq/package.json +6 -7
- package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/runtime/entry-31.js +2 -0
- package/node_modules/pi-agent-ide-ast/package.json +15 -41
- package/node_modules/pi-agent-ide-ast/runtime/entry-32.js +0 -1
- package/node_modules/pi-agent-ide-ast/runtime/entry-33.js +2 -0
- package/node_modules/pi-agent-ide-changes/package.json +10 -11
- package/node_modules/pi-agent-ide-changes/runtime/entry-34.js +0 -1
- package/node_modules/pi-agent-ide-formatter/package.json +4 -4
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-lint/package.json +8 -8
- package/node_modules/pi-agent-ide-lsp/package.json +10 -13
- package/node_modules/pi-agent-ide-lsp/runtime/entry-39.js +2 -0
- package/node_modules/pi-agent-image/package.json +3 -3
- package/node_modules/pi-agent-invariant/package.json +2 -2
- package/node_modules/pi-agent-pdf/package.json +3 -4
- package/node_modules/pi-agent-read/package.json +12 -12
- package/node_modules/pi-agent-read/runtime/entry-46.js +0 -1
- package/node_modules/pi-agent-read/runtime/entry-47.js +2 -0
- package/node_modules/pi-agent-resource/package.json +2 -2
- package/node_modules/pi-agent-resource/src/result-targets.ts +9 -0
- package/node_modules/pi-agent-search/package.json +9 -9
- package/node_modules/pi-agent-search/runtime/entry-51.js +0 -1
- package/node_modules/pi-agent-search/src/api/plugin-protocol.ts +1 -1
- package/node_modules/pi-agent-search/src/api/presentation.ts +10 -2
- package/node_modules/pi-agent-search/src/api/search-parameters.ts +1 -1
- package/node_modules/pi-agent-search/src/api/search.ts +7 -0
- package/node_modules/pi-agent-search/src/core/search-core.ts +23 -3
- package/node_modules/pi-agent-search-text/index.ts +2 -0
- package/node_modules/pi-agent-search-text/package.json +14 -14
- package/node_modules/pi-agent-search-text/runtime/entry-53.js +1 -0
- package/node_modules/pi-agent-search-text/src/search-backend.ts +18 -10
- package/node_modules/pi-agent-search-text/src/search-session.ts +68 -9
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text/runtime/entry-57.js +1 -0
- package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-58.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/package.json +5 -6
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-59.js +0 -1
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-60.js +2 -0
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-61.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-62.js +2 -0
- package/node_modules/pi-agent-text-editor/package.json +26 -34
- package/node_modules/pi-agent-text-editor/runtime/entry-78.js +0 -1
- package/node_modules/pi-agent-text-editor/src/api/delete-guard.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/api/native-edit-batch-event.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/core/delete-policy.ts +6 -12
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +1 -0
- package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +49 -21
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +18 -9
- package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/core/temporary-directories.ts +13 -9
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +16 -8
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +118 -36
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +7 -4
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +6 -8
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +22 -1
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -8
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +22 -0
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-81.js +2 -0
- package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
- package/node_modules/pi-agent-tool-ui/package.json +2 -2
- package/node_modules/pi-agent-tool-ui/runtime/entry-83.js +1 -0
- package/node_modules/pi-agent-web/package.json +8 -11
- package/node_modules/pi-agent-web-html/package.json +3 -5
- package/node_modules/pi-agent-web-image/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-88.js +2 -0
- package/package.json +43 -39
- package/skills/configure-agent-ide/SKILL.md +38 -0
- package/src/api/content.ts +6 -0
- package/src/api/tips.ts +3 -0
- package/src/composite/nested-tool-rendering.ts +16 -5
- package/src/composite/preferences.ts +13 -0
- package/src/composite/settings-documentation.ts +59 -0
- package/src/composite/settings-help.ts +106 -0
- package/src/composite/text-results.ts +50 -22
- package/src/documentation/extension.ts +12 -0
- package/src/documentation/search.ts +166 -0
- 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/package.json +6 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-31.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-27.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -11
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -5
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-88.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-84.js +2 -0
- package/src/extensions/pi-agent-read/package.json +12 -12
- package/src/extensions/pi-agent-read/runtime/entry-46.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-47.js +2 -0
- package/src/extensions/pi-agent-search/package.json +9 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +2 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +14 -14
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-53.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-56.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +18 -10
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +68 -9
- package/src/extensions/pi-agent-search/runtime/entry-51.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-52.js +2 -0
- package/src/extensions/pi-agent-search/src/api/plugin-protocol.ts +1 -1
- package/src/extensions/pi-agent-search/src/api/presentation.ts +10 -2
- package/src/extensions/pi-agent-search/src/api/search-parameters.ts +1 -1
- package/src/extensions/pi-agent-search/src/api/search.ts +7 -0
- package/src/extensions/pi-agent-search/src/core/search-core.ts +23 -3
- package/src/extensions/pi-agent-text-editor/package.json +26 -34
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-58.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-59.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-60.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-61.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-62.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -8
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +22 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-81.js +2 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-78.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-79.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/delete-guard.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/api/native-edit-batch-event.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/core/delete-policy.ts +6 -12
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +1 -0
- package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +49 -21
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +18 -9
- package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/core/temporary-directories.ts +13 -9
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +16 -8
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +118 -36
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +7 -4
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +6 -8
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +22 -1
- package/src/pi-agent-ide.ts +14 -2
- package/src/plugins/pi-agent-ide-ast/package.json +15 -41
- package/src/plugins/pi-agent-ide-ast/runtime/entry-32.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-33.js +2 -0
- package/src/plugins/pi-agent-ide-changes/package.json +10 -11
- package/src/plugins/pi-agent-ide-changes/runtime/entry-34.js +0 -1
- package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-lint/package.json +8 -8
- package/src/plugins/pi-agent-ide-lsp/package.json +10 -13
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-39.js +2 -0
- package/src/tips/core.ts +5 -2
- package/src/tips/extension.ts +30 -2
- package/src/tips/persistence.ts +29 -27
- package/src/tips/setup-hint.ts +19 -0
- package/dist/chunk-5KFVDYCI.js +0 -1
- package/dist/chunk-ABFCAOU5.js +0 -1
- package/dist/chunk-BIG45IPN.js +0 -2
- package/dist/chunk-BMOJTJJJ.js +0 -3
- package/dist/chunk-BQ67M4NC.js +0 -3
- package/dist/chunk-IH5NW5JX.js +0 -11
- package/dist/chunk-NRZO5KJT.js +0 -9
- package/dist/chunk-O36UC74T.js +0 -1
- package/dist/chunk-SSWUUBIR.js +0 -1
- package/dist/entry-19.js +0 -1
- package/docs/research/apply-native-capability-matrix.md +0 -174
- package/docs/research/apply-read-latency.md +0 -221
- package/docs/research/codemode-write-context.md +0 -56
- package/docs/research/lpt-393-fuzzy-results/file.json +0 -152
- package/docs/research/lpt-393-fuzzy-results/repo.json +0 -122
- package/docs/research/lpt-393-search-fuzzy-fallback.md +0 -97
- package/docs/research/native-codemode-batch-decision.md +0 -31
- package/docs/research/native-codemode-batching.md +0 -65
- package/node_modules/pi-agent-doctor/runtime/entry-19.js +0 -1
- package/node_modules/pi-agent-filesystem/runtime/entry-26.js +0 -2
- package/node_modules/pi-agent-ide-ast/runtime/entry-31.js +0 -1
- package/node_modules/pi-agent-ide-changes/runtime/entry-33.js +0 -1
- package/node_modules/pi-agent-image/runtime/entry-39.js +0 -1
- package/node_modules/pi-agent-resource/runtime/entry-47.js +0 -1
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-57.js +0 -2
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-58.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-60.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-62.js +0 -1
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-81.js +0 -1
- package/node_modules/pi-agent-web/runtime/entry-83.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-27.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-26.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-84.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-83.js +0 -2
- package/src/extensions/pi-agent-read/runtime/entry-42.js +0 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-52.js +0 -2
- package/src/extensions/pi-agent-search/runtime/entry-48.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-57.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-58.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-60.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-79.js +0 -2
- package/src/extensions/pi-agent-text-editor/runtime/entry-62.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-31.js +0 -1
- package/src/plugins/pi-agent-ide-changes/runtime/entry-33.js +0 -1
- /package/node_modules/{pi-agent-documentation → pi-agent-doctor}/runtime/entry-25.js +0 -0
- /package/node_modules/{pi-agent-filesystem-image → pi-agent-filesystem}/runtime/entry-27.js +0 -0
- /package/node_modules/{pi-agent-filesystem-jq → pi-agent-filesystem-image}/runtime/entry-28.js +0 -0
- /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem-jq}/runtime/entry-29.js +0 -0
- /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-30.js +0 -0
- /package/node_modules/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-35.js +0 -0
- /package/node_modules/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-36.js +0 -0
- /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-37.js +0 -0
- /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-38.js +0 -0
- /package/node_modules/{pi-agent-invariant → pi-agent-image}/runtime/entry-40.js +0 -0
- /package/node_modules/{pi-agent-pdf → pi-agent-invariant}/runtime/entry-41.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-42.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-48.js +0 -0
- /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-52.js +0 -0
- /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-56.js +0 -0
- /package/node_modules/{pi-agent-text-editor-renderer → pi-agent-text-editor}/runtime/entry-79.js +0 -0
- /package/node_modules/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-80.js +0 -0
- /package/node_modules/{pi-agent-tool-ui → pi-agent-tool-call-interception}/runtime/entry-82.js +0 -0
- /package/node_modules/{pi-agent-web-html → pi-agent-web}/runtime/entry-84.js +0 -0
- /package/node_modules/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-85.js +0 -0
- /package/node_modules/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-86.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-87.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-jq → pi-agent-filesystem-image}/runtime/entry-28.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-pdf → pi-agent-filesystem-jq}/runtime/entry-29.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-30.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-85.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-86.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-87.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-80.js +0 -0
- /package/src/plugins/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-35.js +0 -0
- /package/src/plugins/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-36.js +0 -0
- /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-37.js +0 -0
- /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-38.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.1 — 2026-10-11
|
|
4
|
+
|
|
5
|
+
### Settings and help
|
|
6
|
+
|
|
7
|
+
- Ask the agent to explain Pi Agent IDE or configure it for your workflow. The new setup skill uses the registered settings catalog, asks for Project or Global scope and preserves unrelated settings.
|
|
8
|
+
- Open `/agent-ide-help` for a short, scrollable settings guide. A one-time setup hint appears across the installation without entering the model's context.
|
|
9
|
+
- Choose **Show tool results from Codemode**, an Off/On setting that defaults to Off. It controls extra successful IDE panels, not Codemode's script or output. On follows each tool's presentation setting; errors and expanded history remain available.
|
|
10
|
+
- Add **Developer mode**, off by default. It enables `/agent-ide-tip` for manually previewing the setup hint; automatic startup hints remain independent.
|
|
11
|
+
|
|
12
|
+
### Search and editing
|
|
13
|
+
|
|
14
|
+
- Search packaged guides through `docs:all` or one `docs:<id>`, with literal or regex queries, case and whole-word options, and bounded results. Guide matches are read-only.
|
|
15
|
+
- Keep result-scoped Search inside selected source ranges, including Boolean queries and text containing colons. Reject changed numbered Search references while preserving query refresh for complete all-match references.
|
|
16
|
+
- Preserve issued selections when Codemode batches same-file edits. Return verified follow-up targets for Replace and Insert after formatting, keep unrelated edits concurrent and count grouped replacements per file correctly.
|
|
17
|
+
- Preserve blocked-edit recovery feedback and bound errors even when a later guard replaces them. Explain failed writes and require rereading resources before retrying uncertain effects.
|
|
18
|
+
|
|
19
|
+
### Filesystem guards
|
|
20
|
+
|
|
21
|
+
- Apply temporary-directory cleanup rules consistently to Delete and removed Move endpoints. Recognize exact `tmp`, `.tmp`, `temp` and `.temp` path components while preserving protected-path, tracked-content and hook checks. Show Herdr's waiting state during filesystem approval dialogs.
|
|
22
|
+
|
|
3
23
|
## 0.8.0 — 2026-10-09
|
|
4
24
|
|
|
5
25
|
### SSH workspaces
|
|
@@ -20,12 +40,9 @@
|
|
|
20
40
|
- Resolve temporary-deletion settings from the remote account and project. Local settings do not grant remote deletion permission; protected paths, tracked contents and hooks remain guarded.
|
|
21
41
|
- Clean up only processes owned by each SSH command channel, including descendants that start new sessions. Report interrupted operations and uncertain cleanup honestly rather than claiming rollback or successful termination.
|
|
22
42
|
|
|
23
|
-
###
|
|
43
|
+
### Known limits
|
|
24
44
|
|
|
25
|
-
-
|
|
26
|
-
- Split core Linux integration checks into four CI jobs with separate logs and reports, and combine their results for the required validation gate.
|
|
27
|
-
- Split independent SSH hook checks into separate real-Pi sessions so Read guards, Move guards and saved-edit feedback keep their full coverage within the existing run limits.
|
|
28
|
-
- Document a known Java/Kotlin adapter issue: `fwcd/kotlin-debug-adapter` 0.4.4 can run past verified breakpoints. The issue was reproduced locally and over SSH; those recipes remain available, but a verified breakpoint does not guarantee a stop.
|
|
45
|
+
- `fwcd/kotlin-debug-adapter` 0.4.4 can run past verified breakpoints; a verified breakpoint does not guarantee a stop.
|
|
29
46
|
|
|
30
47
|
## 0.7.3 — 2026-10-09
|
|
31
48
|
|
|
@@ -45,16 +62,10 @@
|
|
|
45
62
|
- Delete declarations through direct `symbol:` paths. Route `symbol:<file>#<selector>#name` replacement through semantic rename in native Codemode rather than declaration-text replacement.
|
|
46
63
|
- Keep original source selections behind compact AST Read overviews. Follow-up tools use the requested source range, not the displayed outline.
|
|
47
64
|
|
|
48
|
-
### Display
|
|
65
|
+
### Display
|
|
49
66
|
|
|
50
67
|
- Explain shortened arguments, omitted result displays, omitted call panels and unavailable results separately in saved nested IDE displays.
|
|
51
68
|
- Hide internal result references from Stage's user-facing output and retain breakpoint-removal labels after deletion.
|
|
52
|
-
- Add an opt-in real-model capability matrix for direct and native Codemode routes. Free coverage checks do not call models or prove model execution; paid runs retain their evidence.
|
|
53
|
-
- Reuse recent full CI evidence only for identical trees and verification conditions. Promotion and versioned candidates still run their required full checks.
|
|
54
|
-
- Permit Bubblewrap user namespaces through a per-binary AppArmor profile on restricted Ubuntu CI runners. Keep the runner-wide restriction enabled and require a real sandbox launch before unit checks.
|
|
55
|
-
- Keep links to excluded tests and benchmarks usable in the public npm package by linking to the public repository.
|
|
56
|
-
- Update integration checks for compact Write receipts while retaining saved-byte, formatting, hook, output-recovery and native-panel contracts. Run sandbox semantic rename with the pinned Pi host and CI language-server toolchain.
|
|
57
|
-
- Reduce shared-runner integration concurrency to three processes to keep Pi startup within existing run limits and the complete suite within the unchanged job budget. Retain native Codemode failure traces.
|
|
58
69
|
|
|
59
70
|
## 0.7.2 — 2026-10-08
|
|
60
71
|
|
|
@@ -87,12 +98,6 @@
|
|
|
87
98
|
- Refresh debugger state when delayed stop or exit events arrive. Track adapter-relocated breakpoints and later binding changes, and refresh displayed local variables after evaluation.
|
|
88
99
|
- Preserve omitted optional IDE tool arguments on Copilot's Responses route instead of letting implicit strictness turn them into required fields. Explicit strictness and other tools remain unchanged.
|
|
89
100
|
|
|
90
|
-
### Verification and maintenance
|
|
91
|
-
|
|
92
|
-
- Add real-Pi stress coverage for every callable IDE tool, direct and nested output, provider text and images, limit/view/offset/scope combinations and complete saved-output recovery. Include the reported Search case of 10,114 matches across 1,725 files with `limit=80`.
|
|
93
|
-
- Keep real debugger checks running in separate, non-blocking jobs with their own reports, outside shared CI totals. Pure debugger unit tests and editor checks, including Delete, still block the release.
|
|
94
|
-
- Automatically import newly opened GitHub issues into Linear, with stable issue IDs to avoid duplicate imports.
|
|
95
|
-
|
|
96
101
|
## 0.7.1 — 2026-10-05
|
|
97
102
|
|
|
98
103
|
- Reduced prompt size by keeping internal result structures out of agent-facing tool schemas.
|
|
@@ -126,18 +131,6 @@
|
|
|
126
131
|
|
|
127
132
|
- Keep whole replacements visible when old and new blocks share no trimmed line. Avoid unnecessary character refinement while preserving the existing time, pairing and size limits, precise small-edit highlights and truthful unavailable state for unfinished comparisons.
|
|
128
133
|
|
|
129
|
-
### Packaging
|
|
130
|
-
|
|
131
|
-
- Fix a documentation link to excluded tests so public package validation succeeds.
|
|
132
|
-
|
|
133
|
-
### Verification
|
|
134
|
-
|
|
135
|
-
- Run the full integration suite in four standalone CI shards with separate reports and retained logs, without raising timeouts or skipping tests. Close each scenario's Pi process instead of accumulating shared fixture hosts.
|
|
136
|
-
- Check that each final file is formatted once without requiring independent files to finish in a fixed order.
|
|
137
|
-
- Make the shell-result scenario independent of background completion timing while keeping separate completion-delivery coverage.
|
|
138
|
-
- Run Windows source and installed-package checks without a retained shared harness workspace, avoiding locks on the shared cleanup directory.
|
|
139
|
-
- Retry transient Windows test-workspace removal locks a bounded number of times after the Pi process tree exits; persistent locks still fail. Retain Windows host traces on failure without changing test timeouts or assertions.
|
|
140
|
-
|
|
141
134
|
## 0.6.4 — 2026-10-03
|
|
142
135
|
|
|
143
136
|
### Native Pi integration
|
|
@@ -149,11 +142,10 @@
|
|
|
149
142
|
- Run disjoint Read, Search, and editing operations concurrently while preserving ordering and rollback protection for shared resources.
|
|
150
143
|
- Attach first-use guides without blocking or replaying tool calls, and preserve guidance across nested calls and session navigation.
|
|
151
144
|
- Keep IDE panels visible for nested calls, show final batch diffs without duplicate bookkeeping panels, and preserve bounded history and native usage accounting.
|
|
152
|
-
- Verify IDE tool coexistence with native MCP tools and resources.
|
|
153
145
|
|
|
154
|
-
###
|
|
146
|
+
### Installation
|
|
155
147
|
|
|
156
|
-
- Fix Windows
|
|
148
|
+
- Fix Windows package entrypoint resolution and installation from npm archives.
|
|
157
149
|
|
|
158
150
|
### Editing and reading
|
|
159
151
|
|
|
@@ -162,7 +154,7 @@
|
|
|
162
154
|
- Bound large committed Apply results before serialization and keep full results addressable.
|
|
163
155
|
- Preserve structured source data when AST output exceeds the preview budget.
|
|
164
156
|
- Run independent post-read handlers concurrently while applying their transforms in order.
|
|
165
|
-
- Document
|
|
157
|
+
- Document jq views for JSONL inspection.
|
|
166
158
|
|
|
167
159
|
### Search and presentation
|
|
168
160
|
|
|
@@ -192,11 +184,6 @@
|
|
|
192
184
|
- Bound replayable DAP events so noisy debug targets do not grow the queue without limit.
|
|
193
185
|
- Check each debugger's own executable or configured adapter path instead of applying Python or JavaScript probes to unrelated adapters.
|
|
194
186
|
|
|
195
|
-
### Verification
|
|
196
|
-
|
|
197
|
-
- Temporarily skip the flaky Windows Java public-Pi startup test. Keep Linux public-Pi and native Windows Java lifecycle checks enabled.
|
|
198
|
-
- Retain unit test reports immediately and stop before integration tests when the unit suite fails. Keep content checks independent of wall-clock load and allow independent formatters to finish in either order.
|
|
199
|
-
|
|
200
187
|
## 0.6.3 — 2026-09-27
|
|
201
188
|
|
|
202
189
|
### Editing
|
|
@@ -429,7 +416,6 @@
|
|
|
429
416
|
- Fix CSharpier detection and diagnostic commands or parsers for .NET, Go, PHP, HTML, CSS, and Java. Keep project-wide lint findings attached to the correct file.
|
|
430
417
|
- Treat a failed linter with no parsed findings as a failure, not a clean check.
|
|
431
418
|
- Use the language server's advertised diagnostic mode, fixing Java and Go servers that publish diagnostics without supporting pull requests.
|
|
432
|
-
- Verify native mini-projects with real formatting, lint, language diagnostics, and separate compiler or behavior checks before and after formatting.
|
|
433
419
|
|
|
434
420
|
## 0.2.0 — 2026-09-05
|
|
435
421
|
|
package/README.md
CHANGED
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
|
+
Ask your agent to explain Pi Agent IDE or configure it for your workflow. For example: “Help me configure Pi Agent IDE for my tasks.” The agent checks the available settings and asks whether to save changes for this project or globally.
|
|
32
|
+
|
|
33
|
+
To configure it yourself, read the [short settings guide](./docs/settings-help.md), run `/agent-ide-help`, or open `/agent-ide-settings` inside Pi.
|
|
34
|
+
|
|
31
35
|
## Summary
|
|
32
36
|
|
|
33
37
|
Pi Agent IDE gives the [Pi coding agent](https://pi.dev/) a small set of development tools for understanding, changing, running, debugging, and observing software. The same tools work with local resources and configured Linux SSH targets.
|
|
@@ -45,7 +49,7 @@ Pi Agent IDE gives the [Pi coding agent](https://pi.dev/) a small set of develop
|
|
|
45
49
|
|
|
46
50
|
### Combine tools through direct calls or native Codemode
|
|
47
51
|
|
|
48
|
-
All IDE tools support direct calls and Pi's built-in Codemode. The agent can combine reading, search, selection and editing into one workflow, with the same source checks
|
|
52
|
+
All IDE tools support direct calls and Pi's built-in Codemode. The agent can combine reading, search, selection and editing into one workflow, with the same source checks in both modes.
|
|
49
53
|
|
|
50
54
|
For example, this script finds a checklist item, selects its complete line, and marks it done:
|
|
51
55
|
|
|
@@ -77,7 +81,7 @@ Views change how the same resource is presented. The agent can request source st
|
|
|
77
81
|
|
|
78
82
|
### Find anything through `search`
|
|
79
83
|
|
|
80
|
-
`search` provides one interface for paths, exact text, regular expressions, AST patterns, symbols, references, code relationships, process discovery, and retained terminal output.
|
|
84
|
+
`search` provides one interface for paths, exact text, regular expressions, AST patterns, symbols, references, code relationships, process discovery, and retained terminal output. File matches are reusable guarded references, so the agent can pass a selection directly to `read` or an editing tool. Search packaged guides through `docs:all` or one `docs:<id>`; guide matches are read-only and do not authorize edits.
|
|
81
85
|
|
|
82
86
|
<div align="center">
|
|
83
87
|
|
|
@@ -172,7 +176,7 @@ Filesystem and HTTP reads, resource views, content converters, search backends,
|
|
|
172
176
|
|
|
173
177
|
A person can see the agent's edits, diffs, diagnostics, running processes, debugger state, and failures. Bounded presentation keeps live output readable without discarding the underlying result. Guarded snapshots and first-class undo make mistakes visible and recovery inexpensive.
|
|
174
178
|
|
|
175
|
-
Direct calls
|
|
179
|
+
Direct calls show tool panels and diffs using each tool's presentation setting. Extra successful IDE panels from Codemode are off by default; turn on **Show tool results from Codemode** in `/agent-ide-settings` to show them. Codemode's own script and output are unchanged. Errors and expanded history remain available, and a batch of edits shows the final diff for each file rather than intermediate cards.
|
|
176
180
|
|
|
177
181
|
<div align="center">
|
|
178
182
|
|
|
@@ -184,13 +188,13 @@ Direct calls and native Codemode both show tool panels and diffs. A batch of edi
|
|
|
184
188
|
|
|
185
189
|
Built-in debugger recipes cover C, C++, C#, Dart, Elixir, Go, Java, JavaScript, Julia, Kotlin, Lua, PHP, PowerShell, Python, R, Ruby, Rust, shell scripts, Swift, TypeScript, and Zig. Formatting, linting, AST, language-server, and debugger support follows the tools and configuration available in each project.
|
|
186
190
|
|
|
187
|
-
Known issue: the
|
|
191
|
+
Known issue: the Kotlin adapter (`fwcd/kotlin-debug-adapter` 0.4.4) can run past verified breakpoints. This was reproduced with JDK 17 and 21 both locally and over SSH. Its recipe remains available, but a verified breakpoint is not proof that execution will stop there. Java uses `java-debug / JDT LS`, not this adapter.
|
|
188
192
|
|
|
189
193
|
Windows and WSL are first-class supported environments alongside Linux. Run `/pi-agent-ide-doctor` to see the exact capabilities available on the current machine.
|
|
190
194
|
|
|
191
195
|
### Built through data-driven development
|
|
192
196
|
|
|
193
|
-
Pi Agent IDE is developed through daily use on real software and measured with the [Explicit Edit Benchmark](https://github.com/alexshpunt/explicit-edit-benchmark).
|
|
197
|
+
Pi Agent IDE is developed through daily use on real software and measured with the [Explicit Edit Benchmark](https://github.com/alexshpunt/explicit-edit-benchmark). Published benchmark observations record performance on real editing tasks; not every release has a benchmark run. The badge above links to the [latest accepted observation](https://huggingface.co/spaces/alexshpunt/benchmark-explorer?card=harness%3Api-agent-ide%40latest), with its score and run details; the underlying observations are available in the [published dataset](https://huggingface.co/datasets/alexshpunt/explicit-edit-benchmark).
|
|
194
198
|
|
|
195
199
|
The project is also used to develop itself. Weak interactions, missing affordances, and agent failure modes appear in real work instead of remaining theoretical. Problems are fixed as they are found, and the tools evolve through regular releases.
|
|
196
200
|
|
|
@@ -198,7 +202,7 @@ Pi Agent IDE is experimental and under active development. Interfaces and behavi
|
|
|
198
202
|
|
|
199
203
|
## Installation
|
|
200
204
|
|
|
201
|
-
Install [Pi](https://pi.dev/) **0.99.1 or newer** first, then install Pi Agent IDE from npm. Development and integration tests use Pi 1.
|
|
205
|
+
Install [Pi](https://pi.dev/) **0.99.1 or newer** first, then install Pi Agent IDE from npm. Development and integration tests use Pi 1.1.0. Older hosts are rejected with an upgrade message.
|
|
202
206
|
|
|
203
207
|
```bash
|
|
204
208
|
pi install npm:pi-agent-ide
|
|
@@ -264,12 +268,13 @@ If something breaks, behaves badly, or does not fit your workflow, please [open
|
|
|
264
268
|
| [Result composition](./docs/structured-results.md) | Passing results between tools, reference lifetime, and commit boundaries |
|
|
265
269
|
| [Selection](./docs/agent-guides/select-code.md) | Text ranges, AST parts, and combining selections |
|
|
266
270
|
| [Directory operations](./docs/directory-operations.md) | Copy, Move, Delete, symlinks, guards, and partial failures |
|
|
271
|
+
| [Settings guide](./docs/settings-help.md) | Choosing settings, scope, saving and output presentation |
|
|
267
272
|
| [Configuration](./docs/configuration.md) | Project tools, SSH targets, Doctor, and presentation settings |
|
|
268
273
|
| [SSH guide](./docs/agent-guides/ssh.md) | Agent setup and supported remote operations |
|
|
269
274
|
| [File hooks](./docs/user-hooks.md) | Inspect, change, or deny reads and edits |
|
|
270
275
|
| [Writing extensions](./docs/extensions.md) | Resolvers, views, anchors, search backends, and IDE plugins |
|
|
271
276
|
| [Architecture](./docs/architecture.md) | Module boundaries, protocols, and the umbrella extension |
|
|
272
|
-
| [Development](./docs/development.md) | Checkout setup, tests, and
|
|
277
|
+
| [Development](./docs/development.md) | Checkout setup, tests, and package builds |
|
|
273
278
|
| [Releases](./docs/releases.md) | Nightly builds, release candidates, verification, and publication |
|
|
274
279
|
|
|
275
280
|
## License
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as O}from"./chunk-
|
|
1
|
+
import{a as O}from"./chunk-AKNHSDGV.js";import{a as R}from"./chunk-N56WAVYA.js";import{a as v,b as S}from"./chunk-GEMDU6XW.js";import{b as y}from"./chunk-WPBQ45ZL.js";import"./chunk-WXGTU2M6.js";import{a as w,b as E,c as b}from"./chunk-LLRUJD62.js";import"./chunk-Q5X6OXNS.js";import{g as s}from"./chunk-4HWKBCBH.js";import{a as p,b as k,d as C}from"./chunk-6EDOLYOV.js";import{c as g}from"./chunk-W7CASEO3.js";import"./chunk-TOYN4W4F.js";import"./chunk-YJ6T3PEP.js";import"./chunk-S72FVLUX.js";import"./chunk-DXONCYWF.js";import"./chunk-ZAWRSA7N.js";import"./chunk-OFILFO6D.js";import{c as u,l as h,m as P}from"./chunk-IMGIDBCC.js";import"./chunk-BXGMMZT3.js";import"./chunk-756K3LJY.js";import"./chunk-ZC65Z3CK.js";import{a as c}from"./chunk-EI7MMDWY.js";import T from"node:path";function A(i){let l=v(i),U=R(i),d=new Map;return{async resolveProject(r,o){if(r.startsWith("ssh://")||o.startsWith("ssh://")){let e=i.resolve(r,o);if(!e)throw new s("UNSUPPORTED_SOURCE",r,"not-applied");let t=i.resolve(o);if(t&&t.location.target!==e.location.target)throw new s("UNSUPPORTED_SOURCE",r,"not-applied");return O(e.backend,e.location.path,t?.location.path,"formatters",p)}if(r.includes("://")||o.includes("://"))throw new s("UNSUPPORTED_SOURCE",r,"not-applied");let n=await u(o,r,"formatters",p);return n===void 0?void 0:{cwd:n,external:n!==T.resolve(o)}},async loadRegistry(r,o){let n=JSON.stringify([r,o]),e=d.get(n);if(!e){let t=i.resolve(r);e=k.fromDirectory(r,{includeGlobal:!o,requireBuiltInEvidence:!0,...t?{layerAccess:l,executableAvailability:c(a=>y(t.backend,t.location.path,a),"executableAvailability"),recipeEvidence:c(a=>S(t.backend,t.location.path,a),"recipeEvidence")}:{}}),d.set(n,e)}return e},async run(r,o,n){let e=i.resolve(n);if(!e){if(n.includes("://")||o.includes("://"))throw new s("UNSUPPORTED_SOURCE",n,"not-applied");return P(r,{projectRoot:o,filePath:n})}let t=await e.backend.read(e.location.path),a=await h(r.run,{projectRoot:o,filePath:n,processAccess:U}),m=await e.backend.read(e.location.path);if(!a.ok)return{ok:!1,changed:!m.bytes.equals(t.bytes)};if(r.output==="stdout"){if(m.version!==t.version)throw new s("CONFLICT",n,"not-applied");let f=Buffer.from(a.stdout);return f.equals(t.bytes)||await e.backend.write(e.location.path,f,t.version),{ok:!0,changed:!f.equals(t.bytes)}}return{ok:!0,changed:!m.bytes.equals(t.bytes)}}}}c(A,"createOwnedFormatterRuntime");async function F(i){let l=new b(await E(w(g())));await C(i,A(l))}c(F,"registerOwnedFormatter");export{A as createOwnedFormatterRuntime,F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as I}from"./chunk-
|
|
1
|
+
import{a as I}from"./chunk-JKMXND6V.js";import{g as r}from"./chunk-4HWKBCBH.js";import{a as l}from"./chunk-EI7MMDWY.js";import{readFile as S}from"node:fs/promises";async function m(h,t,o){o?.throwIfAborted(),w??=S(new URL("./vision-capture-worker.py",new URL("../src/backend/vision-capture.ts",import.meta.url).href),"utf8");let s=await I(h,"python3",["-c",await w,JSON.stringify({kind:"probe"})],t,{signal:o,timeoutMs:5e3,maxBytes:128*1024});if(o?.throwIfAborted(),s.exitCode!==0)throw new r("CAPABILITY_UNAVAILABLE",t,"not-applied");let e;try{e=JSON.parse(s.stdout.toString("utf8"))}catch{throw new r("INVALID_RESPONSE",t,"not-applied")}if(typeof e!="object"||e===null)throw new r("INVALID_RESPONSE",t,"not-applied");if("display"in e&&e.display===!0&&"window"in e&&typeof e.window=="boolean"&&(e.window||"error"in e&&e.error==="CAPABILITY_UNAVAILABLE"))return{display:{ok:!0,detail:"Target X11 connection opened without pixels; capture opt-in unchanged"},window:{ok:e.window,detail:e.window?"Target X-Resource 1.2 is available; individual window authorization is not checked":`CAPABILITY_UNAVAILABLE: ${t} (trusted X11 client identity unavailable)`}};let n="error"in e&&typeof e.error=="string"&&y.has(e.error)?e.error:"INVALID_RESPONSE";throw new r(n,t,"not-applied")}l(m,"probeSshCapture");var w,E=Buffer.from([137,80,78,71,13,10,26,10]),y=new Set(["DESKTOP_UNAVAILABLE","CAPABILITY_UNAVAILABLE","ENOENT","EACCES","STALE_PROCESS","AMBIGUOUS_WINDOW","WINDOW_OBSCURED","CONTENT_LIMIT","PIXEL_LIMIT","BYTE_LIMIT"]);async function g(h,t,o,s){s?.throwIfAborted();let e=o.kind==="window"?"window:":"display:";if(!t.startsWith(`${e}ssh://`))throw new r("INVALID_SOURCE",t,"not-applied");let n=new URL(t.slice(e.length)),p=o.kind==="window"?o.pid:o.index;if(n.username||n.password||n.port||n.search||!Number.isSafeInteger(p)||(o.kind==="window"?p<1||n.pathname!==`/${p}`||n.hash!=="":p<0||n.pathname!=="/"||n.hash!==`#${p}`&&!(p===0&&n.hash==="")))throw new r("INVALID_SOURCE",t,"not-applied");try{let a=h.resolve(`ssh://${n.hostname}/`);if(!a)throw new r("UNSUPPORTED_SOURCE",t,"not-applied");w??=S(new URL("./vision-capture-worker.py",new URL("../src/backend/vision-capture.ts",import.meta.url).href),"utf8");let i=await I(a.backend.target,"python3",["-c",await w,JSON.stringify(o)],t,{signal:s,timeoutMs:1e4,maxBytes:20*1024*1024});if(s?.throwIfAborted(),i.exitCode!==0)throw new r("CAPABILITY_UNAVAILABLE",t,"not-applied");if(i.stdout.subarray(0,8).equals(E)){if(i.stdout.length<33||i.stdout.length>20*1024*1024||i.stdout.toString("ascii",12,16)!=="IHDR")throw new r("INVALID_RESPONSE",t,"not-applied");let A=i.stdout.readUInt32BE(16),f=i.stdout.readUInt32BE(20);if(A<1||f<1||A*f>16*1024*1024)throw new r("PIXEL_LIMIT",t,"not-applied");return i.stdout}let d;try{d=JSON.parse(i.stdout.toString("utf8"))}catch{throw new r("INVALID_RESPONSE",t,"not-applied")}let c=typeof d=="object"&&d!==null&&"error"in d&&typeof d.error=="string"&&y.has(d.error)?d.error:"INVALID_RESPONSE";throw new r(c,t,"not-applied")}catch(a){throw a instanceof r?new r(a.code,t,a.effect):a}}l(g,"captureSshFrame");export{m as a,g as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b}from"./chunk-
|
|
1
|
+
import{a as b}from"./chunk-AKNHSDGV.js";import{a as y}from"./chunk-HCK7OIQ3.js";import"./chunk-7LOVUWNI.js";import{a as k,b as E}from"./chunk-GEMDU6XW.js";import{b as S}from"./chunk-WPBQ45ZL.js";import"./chunk-BQAKA3FU.js";import{a as u,b as w,c as v}from"./chunk-LLRUJD62.js";import{g as c}from"./chunk-4HWKBCBH.js";import{a as p,b as h,d as P}from"./chunk-TXG2H7YQ.js";import"./chunk-47SPPIXK.js";import"./chunk-VAXLSPPU.js";import"./chunk-OI3HBIPK.js";import"./chunk-YTYLS2UM.js";import{c as f}from"./chunk-W7CASEO3.js";import"./chunk-TOYN4W4F.js";import"./chunk-YJ6T3PEP.js";import"./chunk-S72FVLUX.js";import"./chunk-M4TVRCMZ.js";import"./chunk-TGC2ZACO.js";import"./chunk-NNCZYO4Q.js";import"./chunk-IICJXZBU.js";import"./chunk-PS2B6THP.js";import"./chunk-BU7IZLKB.js";import"./chunk-S5PL5DFQ.js";import"./chunk-DXONCYWF.js";import"./chunk-DUUOCBS3.js";import"./chunk-T4FTT3U4.js";import"./chunk-ZPT5D4VP.js";import"./chunk-ZAWRSA7N.js";import"./chunk-OFILFO6D.js";import"./chunk-KINKBPPX.js";import{c as m}from"./chunk-IMGIDBCC.js";import"./chunk-BXGMMZT3.js";import"./chunk-756K3LJY.js";import"./chunk-ZC65Z3CK.js";import{a as i}from"./chunk-EI7MMDWY.js";import R from"node:path";function g(d){let n=i(o=>{let e=d.resolve(o);if(!e)throw new c("UNSUPPORTED_SOURCE",o,"not-applied");return e},"resolve");return{transport:i(o=>y(d,o),"transport"),async readText(o,e){let r=n(o);return(await r.backend.read(r.location.path,{signal:e})).bytes.toString("utf8")},async readSnapshot(o,e){let r=n(o),t=await r.backend.read(r.location.path,{signal:e});return{content:t.bytes.toString("utf8"),version:t.version}},async readBytes(o,e){let r=n(o);return(await r.backend.read(r.location.path,{signal:e})).bytes},async exists(o,e){let r=n(o);try{return await r.backend.stat(r.location.path,{signal:e}),!0}catch(t){if(t instanceof c&&t.code==="ENOENT")return!1;throw t}},async isFile(o,e){let r=n(o);return(await r.backend.stat(r.location.path,{signal:e})).kind==="file"},async entries(o,e){let r=n(o);return(await r.backend.list(r.location.path,{signal:e})).map(t=>({name:t.name,kind:t.kind==="symlink"?"other":t.kind}))}}}i(g,"createSshLspWorkspaceOwner");async function O(d){let n=new v(await w(u(f()))),o=g(n);await P(d,{workspace:i(e=>e.startsWith("ssh://")?o:void 0,"workspace"),async loadRegistry(e,r,t){t?.throwIfAborted();let s=n.resolve(e);if(s)return h.fromPackageDir(e,{signal:t,layerAccess:k(n,t),includeGlobal:!r,requireBuiltInEvidence:r,recipes:p,recipeEvidence:i(a=>E(s.backend,s.location.path,a,t),"recipeEvidence"),executableAvailability:i(a=>S(s.backend,s.location.path,a,t),"executableAvailability")});if(e.includes("://"))throw new c("UNSUPPORTED_SOURCE",e,"not-applied");return h.fromPackageDir(r?e:process.env.PI_AGENT_IDE_CONFIG_DIR??e,{signal:t,includeGlobal:!r,requireBuiltInEvidence:r,recipes:p})},async resolveProject(e,r,t){if(t?.throwIfAborted(),e.startsWith("ssh://")||r.startsWith("ssh://")){let a=n.resolve(e,r);if(!a)throw new c("UNSUPPORTED_SOURCE",e,"not-applied");let l=n.resolve(r);if(l&&l.location.target!==a.location.target)throw new c("UNSUPPORTED_SOURCE",e,"not-applied");return b(a.backend,a.location.path,l?.location.path,"lsp-servers",p,t)}let s=await m(r,e,"lsp-servers",p,t);return s===void 0?void 0:{cwd:s,external:s!==R.resolve(r)}}})}i(O,"registerOwnedLsp");export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c,d,e as u}from"./chunk-
|
|
1
|
+
import{c,d,e as u}from"./chunk-VAXLSPPU.js";import{a as r}from"./chunk-EI7MMDWY.js";function E(t,o){let s=r(()=>{let e,i={plugin:o,accept(g){if(e!==void 0)throw new Error(`Plugin ${o.id} registration was accepted more than once`);e=g}};return t.events.emit(d,i),e},"announce"),n=r(()=>{},"unsubscribe");n=t.events.on(c,e=>{if(!u(e))throw new Error("Invalid pi-agent-search core readiness event");let i=s();if(i===void 0)throw new Error("pi-agent-search core announced readiness without accepting the plugin");n(),i.catch(()=>{})}),t.on("session_shutdown",n);let a=s();if(a!==void 0)return n(),a}r(E,"connectSearchPlugin");export{E as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as f}from"./chunk-
|
|
1
|
+
import{k as f}from"./chunk-DXONCYWF.js";import{a}from"./chunk-EI7MMDWY.js";import k from"node:path";function p(i,t){if(!/^[a-z0-9][a-z0-9_-]*$/u.test(i))throw new TypeError("SSH target IDs must contain lowercase letters, digits, underscores or hyphens");if(!t.startsWith("/")||t.includes("\0"))throw new TypeError("Remote paths must be absolute and contain no NUL characters");let r=k.posix.normalize(t),e=r.split("/").map(encodeURIComponent).join("/");return{target:i,path:r,source:`ssh://${i}${e}`}}a(p,"remoteLocation");function O(i,t){if(i.startsWith("ssh:")){let e=new URL(i);if(!i.startsWith("ssh://")||!e.hostname||e.username||e.password||e.port||e.search||e.hash||i.includes("?")||i.includes("#"))throw new TypeError("SSH references require a configured target and an absolute path, without credentials or selectors");return p(e.hostname,decodeURIComponent(e.pathname))}if(!t?.startsWith("ssh:")||/^[A-Za-z][A-Za-z\d+.-]*:/u.test(i))return;let r=O(t);if(!r)throw new TypeError("Invalid remote workspace");return p(r.target,k.posix.resolve(r.path,i))}a(O,"resolveRemoteLocation");import{readFile as C}from"node:fs/promises";function S(i){if(p(i.id,i.workspace),!/^(?:[A-Za-z0-9_][A-Za-z0-9_.-]*@)?[A-Za-z0-9_][A-Za-z0-9_.-]*$/u.test(i.host))throw new TypeError("SSH host must be an OpenSSH host alias, not a command or URI")}a(S,"validateSshTarget");async function y(i){return`exec(__import__("base64").b64decode("${(await C(i)).toString("base64")}"))`}a(y,"sshWorkerProgram");async function F(i){return`python3 -c '${await y(i)}'`}a(F,"sshWorkerCommand");function D(i,t){let r=["-T","-o","BatchMode=yes","-o","StrictHostKeyChecking=yes","-o","ForwardAgent=no","-o","PermitLocalCommand=no","-o","ClearAllForwardings=yes"];return i.configFile!==void 0&&r.push("-F",i.configFile),r.push("--",i.host,t),r}a(D,"systemSshArguments");function H(i,t){return/Host key verification failed|REMOTE HOST IDENTIFICATION HAS CHANGED|No .* host key is known/u.test(t)?"HOST_KEY_FAILED":/Permission denied \([^)]*\)/u.test(t)?"AUTH_FAILED":i===127&&/\bpython3:\s*(?:command\s+)?not found\b/u.test(t)?"DEPENDENCY_UNAVAILABLE":"TRANSPORT_FAILED"}a(H,"sshFailureCode");import{createHash as I}from"node:crypto";import{Type as n}from"typebox";import{Value as x}from"typebox/value";var d=class extends f{static{a(this,"SshBackendError")}constructor(t,r,e,o){super(t,r,e,o),this.name=t==="CANCELLED"?"AbortError":"SshBackendError"}},L=n.Object({bytes:n.String(),version:n.String({pattern:"^[a-f0-9]{64}$"})}),v=n.Object({directory:n.String(),path:n.String(),revision:n.String({pattern:"^[a-f0-9]{64}$"}),sourceRevision:n.String({pattern:"^[a-f0-9]{64}$"}),sha256:n.String({pattern:"^[a-f0-9]{64}$"})}),E=n.Object({revision:n.String({pattern:"^[a-f0-9]{64}$"}),bytes:n.String(),offset:n.Integer({minimum:0}),totalBytes:n.Integer({minimum:0})}),T=n.Array(n.Object({name:n.String(),kind:n.Union([n.Literal("file"),n.Literal("directory"),n.Literal("symlink"),n.Literal("other")])})),B=n.Object({kind:n.Union([n.Literal("file"),n.Literal("directory"),n.Literal("other")]),size:n.Integer({minimum:0}),mode:n.Integer({minimum:0})}),m=n.Object({kind:n.Union([n.Literal("file"),n.Literal("directory"),n.Literal("symlink"),n.Literal("other")]),size:n.Integer({minimum:0}),mode:n.Integer({minimum:0}),links:n.Integer({minimum:0}),identity:n.Object({device:n.String({pattern:"^[0-9]+$"}),inode:n.String({pattern:"^[0-9]+$"})}),revision:n.String({pattern:"^[a-f0-9]{64}$"})}),N=n.Object({path:n.String({minLength:1}),entries:n.Array(n.Object({relativePath:n.String(),kind:m.properties.kind,revision:m.properties.revision,identity:m.properties.identity,mode:n.Integer({minimum:0}),link:n.Optional(n.String())}))}),A=n.Union([n.Object({ok:n.Literal(!0),data:n.Unknown()}),n.Object({ok:n.Literal(!1),code:n.String({pattern:"^[A-Z][A-Z0-9_]*$"}),effect:n.Union([n.Literal("not-applied"),n.Literal("applied"),n.Literal("unknown")])})]),w=class{static{a(this,"SshBackend")}target;constructor(t){S(t),this.target={...t}}async stat(t,r={}){let e=await this.request({operation:"stat",path:t},!1,r);return this.checked(B,e,t,!1),e}async lstat(t,r={}){let e=await this.request({operation:"lstat",path:t},!1,r);return this.checked(m,e,t,!1),e}async temporaryEnvironment(t={}){let r=await this.request({operation:"temporary-environment",path:this.target.workspace},!1,t);return this.checked(n.Object({home:n.String({minLength:1,pattern:"^/"}),temporary:n.String({minLength:1,pattern:"^/"}),agentDirectory:n.Optional(n.String({minLength:1,pattern:"^/"}))}),r,this.target.workspace,!1),r}async objectSnapshot(t,r={}){let e=await this.request({operation:"object-snapshot",path:t},!1,r);return this.checked(N,e,t,!1),e}async ensureObjectDirectory(t,r,e,o={}){let s=await this.request({operation:"mkdir-object",path:t,mode:r,revision:e},!0,o);this.checked(n.Null(),s,t,!0)}async createObjectLink(t,r,e={}){let o=await this.request({operation:"symlink-object",path:t,link:r,revision:null},!0,e);this.checked(n.Null(),o,t,!0)}async setObjectMode(t,r,e,o={}){let s=await this.request({operation:"chmod-object",path:t,mode:r,revision:e},!0,o);this.checked(n.Null(),s,t,!0)}async moveObject(t,r,e={}){let o=await this.request({operation:"move-object",path:t.path,destination:r.path,sourceSnapshot:t,targetSnapshot:r},!0,e);return this.checked(n.Boolean(),o,t.path,!0),o}async captureJournal(t,r={}){let e=await this.request({operation:"journal",path:t},!1,r);return this.checked(v,e,t,!1),e}async releaseJournal(t,r={}){let e=await this.request({operation:"journal-release",path:t},!1,r);this.checked(n.Null(),e,t,!1)}async read(t,r={}){let e=await this.request({operation:"read",path:t},!1,r);return this.checked(L,e,t,!1),{bytes:Buffer.from(e.bytes,"base64"),version:e.version}}async readRange(t,r,e,o={}){if(!Number.isSafeInteger(r)||!Number.isSafeInteger(e)||e<0)throw new TypeError("Byte offset and limit must be safe integers; limit must be nonnegative");let s=await this.request({operation:"range",path:t,offset:r,limit:e},!1,o);return this.checked(E,s,t,!1),{bytes:Buffer.from(s.bytes,"base64"),offset:s.offset,totalBytes:s.totalBytes,revision:s.revision}}async list(t,r={}){let e=await this.request({operation:"list",path:t},!1,r);return this.checked(T,e,t,!1),e}async write(t,r,e,o={}){let s=await this.request({operation:"write",path:t,bytes:Buffer.from(r).toString("base64"),expected:e},!0,o);return this.checked(n.String({pattern:"^[a-f0-9]{64}$"}),s,t,!0),s}async copy(t,r,e,o,s={}){return this.copyEntry("copy",t,r,e,o,s)}async restoreJournal(t,r,e,o,s={}){return this.copyEntry("restore",t,r,e,o,s)}async copyEntry(t,r,e,o,s,c){let u=await this.request({operation:t,path:r,destination:e,sourceRevision:o,targetRevision:s},!0,c);this.checked(n.Null(),u,r,!0)}async move(t,r,e,o,s={}){let c=await this.request({operation:"move",path:t,destination:r,sourceRevision:e,targetRevision:o},!0,s);this.checked(n.Null(),c,t,!0)}async realpath(t,r={}){let e=await this.request({operation:"realpath",path:t},!1,r);if(this.checked(n.String({minLength:1}),e,t,!1),!e.startsWith("/"))throw new d("INVALID_RESPONSE",t,"not-applied");return e}async queryGit(t,r,e={}){let o=await this.request({operation:"git-query",path:t,args:r},!1,{...e,timeoutMs:5e3});return this.checked(n.String(),o,t,!1),o}async removeObject(t,r,e={}){let o=await this.request({operation:"delete-object",path:t,revision:r},!0,e);this.checked(n.Null(),o,t,!0)}async removeEntry(t,r,e={}){let o=await this.request({operation:"unlink",path:t,revision:r},!0,e);this.checked(n.Null(),o,t,!0)}async remove(t,r,e={}){let o=await this.request({operation:"remove",path:t,expected:r},!0,e);this.checked(n.Null(),o,t,!0)}async writeGitIndex(t,r,e={}){let o=Buffer.from(r.text,"utf8");if(o.length>32*1024*1024)throw new d("CONTENT_LIMIT",p(this.target.id,t).source,"not-applied");let{text:s,expectedIndexText:c,expectedWorktreeText:u,...g}=r,l=a(b=>I("sha256").update(b,"utf8").digest("hex"),"digest"),h=await this.request({operation:"gitIndex",path:t,...g,bytes:o.toString("base64"),expectedIndexHash:l(c),...u!==void 0&&{expectedWorktreeHash:l(u)}},!0,e);this.checked(n.Null(),h,t,!0)}async execute(t,r,e,o={}){let{runOwnedSshCommand:s}=await import("./chunk-Z2QGNTGQ.js");return s({...this.target,workspace:e},t,r,p(this.target.id,e).source,{signal:o.signal,timeoutMs:o.timeoutMs??3e4,maxBytes:32*1024*1024,limitCode:"CONTENT_LIMIT",closeInput:!0,effect:"unknown"})}async startProcess(t,r,e,o={}){let{startSshProcess:s}=await import("./chunk-W3YFF6OO.js");return s(this.target,t,r,e,o)}checked(t,r,e,o){if(!x.Check(t,r))throw new d("INVALID_RESPONSE",p(this.target.id,e).source,o?"unknown":"not-applied")}async request(t,r,e){let o=typeof t.path=="string"?t.path:typeof t.cwd=="string"?t.cwd:this.target.workspace,s=p(this.target.id,o).source,c=e.timeoutMs??3e4;if(!Number.isFinite(c)||c<=0)throw new TypeError("SSH operation deadline must be positive");e.signal?.throwIfAborted();let{runOwnedSshCommand:u}=await import("./chunk-Z2QGNTGQ.js"),g=await y(new URL("./ssh-worker.py",new URL("../src/backend/ssh.ts",import.meta.url).href)),l=await u({...this.target,workspace:t.operation==="gitIndex"?o:"/"},"python3",["-c",g],s,{signal:e.signal,timeoutMs:c,maxBytes:48*1024*1024,limitCode:"CONTENT_LIMIT",effect:r?"unknown":"not-applied",input:Buffer.from(JSON.stringify(t))});if(l.exitCode!==0)throw new d("REMOTE_OPERATION_FAILED",s,r?"unknown":"not-applied");let h;try{h=JSON.parse(l.stdout.toString("utf8"))}catch{throw new d("INVALID_RESPONSE",s,r?"unknown":"not-applied")}if(!j(h))throw new d("INVALID_RESPONSE",s,r?"unknown":"not-applied");if(!h.ok)throw new d(h.code,s,h.effect);return h.data}};function j(i){return x.Check(A,i)}a(j,"isReply");export{p as a,O as b,S as c,F as d,D as e,H as f,d as g,w as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./chunk-EI7MMDWY.js";var a="pi-agent-ide-tips",c=1,T="pi-agent-ide-tips/core/ready",f="pi-agent-ide-tips/provider/register";function P(e){return t(e)&&e.protocol===a&&e.apiVersion===c}r(P,"isTipCoreReady");function u(e){return!t(e)||typeof e.accept!="function"||!t(e.provider)?!1:e.provider.protocol===a&&e.provider.apiVersion===c&&typeof e.provider.id=="string"&&e.provider.id.length>0&&typeof e.provider.getTip=="function"}r(u,"isTipProviderRegistrationRequest");function t(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}r(t,"isRecord");function
|
|
1
|
+
import{a as r}from"./chunk-EI7MMDWY.js";var a="pi-agent-ide-tips",c=1,T="pi-agent-ide-tips/core/ready",f="pi-agent-ide-tips/provider/register";function P(e){return t(e)&&e.protocol===a&&e.apiVersion===c}r(P,"isTipCoreReady");function u(e){return!t(e)||typeof e.accept!="function"||!t(e.provider)?!1:e.provider.protocol===a&&e.provider.apiVersion===c&&typeof e.provider.id=="string"&&e.provider.id.length>0&&typeof e.provider.getTip=="function"}r(u,"isTipProviderRegistrationRequest");function t(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}r(t,"isRecord");function R(e,d){let s=r(()=>{let o,n={provider:d,accept(y){if(o!==void 0)throw new Error(`Tip provider ${d.id} was accepted more than once`);o=y}};return e.events.emit(f,n),o},"announce"),i=r(()=>{},"unsubscribe");i=e.events.on(T,o=>{if(!P(o))throw new Error("Invalid tip core readiness event");let n=s();if(n===void 0)throw new Error("Tip core did not accept the provider");i(),n.catch(()=>{})}),e.on("session_shutdown",i);let p=s();if(p!==void 0)return i(),p}r(R,"connectTipProvider");export{R as a,a as b,c,T as d,f as e,P as f,u as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as n}from"./chunk-
|
|
1
|
+
import{b as n}from"./chunk-BQAKA3FU.js";import{g as s}from"./chunk-4HWKBCBH.js";import{a as o}from"./chunk-EI7MMDWY.js";async function h(r,c,d){try{await r.stop()}catch(t){if(!(t instanceof s)||t.code!=="TRANSPORT_FAILED"||!r.identity)throw t;let e;try{e=await n(c,d,r.pid)}catch(i){throw new AggregateError([t,i],"Owned SSH cleanup could not be reconciled",{cause:i})}if(e===void 0||e.identity!==r.identity)return;throw t}}o(h,"stopOwnedSshProcess");export{h as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as h,g as w,m as P}from"./chunk-
|
|
1
|
+
import{c as h,g as w,m as P}from"./chunk-TGC2ZACO.js";import{a as E,c as T}from"./chunk-DXONCYWF.js";import{a as x}from"./chunk-ZC65Z3CK.js";import{a as o}from"./chunk-EI7MMDWY.js";import{AsyncLocalStorage as S}from"node:async_hooks";var p=new S,m=new S;function C(t){let e=m.getStore();e?e.push(t):t()}o(C,"afterPostEditScope");async function O(t){if(m.getStore())return t();let e=[];try{return await m.run(e,t)}finally{for(let r of e)r()}}o(O,"collectPostEditNotifications");function q(t,e){let r=p.getStore();return r?r.immediate?(r.pending.delete(t),!1):(r.pending.set(t,e),!0):!1}o(q,"deferPostEdit");function D(t){return p.getStore()?.pending.has(t)??!1}o(D,"hasDeferredPostEdit");function F(t){p.getStore()?.pending.delete(t)}o(F,"forgetDeferredPostEdit");function L(t=process.cwd()){let e=new Map;return{run(r,a=!1){return p.run({pending:e,immediate:a},r)},forget(r){e.delete(r)},sources(){return[...e.keys()]},async finish(r,a){let s=[...e];e.clear();let c=[],i=[];if(await O(async()=>{let u=new E,b=await Promise.allSettled(s.map(([g,d])=>u.run(T(g,t,"write"),d)));for(let[g,d]of b.entries()){let y=x(s[g])[0];if(d.status==="rejected"){i.push(d.reason);try{a?.(y,d.reason)}catch(l){i.push(l)}continue}c.push(d.value);try{r?.(d.value)}catch(l){i.push(l);try{a?.(y,l)}catch(k){i.push(k)}}}}),i.length>0)throw new AggregateError(i,`Some final post-processing failed; completed edits remain applied. ${i.map(u=>u instanceof Error?u.message:String(u)).join("; ")}`);return c}}}o(L,"createPostEditScope");import{Type as n}from"typebox";import{Value as f}from"typebox/value";var A=`${h}/post-edit/register`;function $(t){return f.Check(n.Object({formatting:n.Object({status:n.Union(["disabled","unavailable","skipped-syntax","unchanged","changed","failed","not-reported","deferred"].map(e=>n.Literal(e))),formatter:n.Optional(n.String())})}),t)}o($,"isFormattingContribution");function W(t){return f.Check(n.Object({diffStatuses:n.Array(n.Object({text:n.String({minLength:1}),origin:n.Optional(n.Literal("after-edit")),formatter:n.Optional(n.String()),tone:n.Optional(n.Union(["muted","success","warning","error"].map(e=>n.Literal(e))))}))}),t)}o(W,"isDiffStatusContribution");var R=n.Function([],n.Unknown()),v=n.Object({id:n.String({minLength:1}),handler:R}),H=n.Object({registration:v,accept:R});function j(t){return f.Check(v,t)}o(j,"isTextPostEditHandlerRegistration");function B(t){return f.Check(H,t)}o(B,"isTextPostEditHandlerRegistrationRequest");function G(t){if(typeof t!="object"||t===null)return!1;let e=t;return Array.isArray(e.hints)&&typeof e.scopeMarkers=="object"&&e.scopeMarkers!==null&&Array.isArray(e.warnings)}o(G,"isTextMutationResultContributionData");function K(t,e){if(!j(e))throw new TypeError("Invalid text editor post-edit handler registration");let r,a=o(()=>{let c={registration:e,accept(i){if(r!==void 0)throw new Error(`Post-edit handler ${e.id} was accepted more than once`);r=i}};return t.events.emit(A,c),r!==void 0},"announce"),s=o(()=>{},"unsubscribeReady");s=t.events.on(w,c=>{if(!P(c))throw new Error("Invalid pi-agent-text-editor core readiness event");if(!a())throw new Error("pi-agent-text-editor core announced readiness without accepting the post-edit handler");s()}),t.on("session_shutdown",()=>{s(),r?.()}),a()&&s()}o(K,"connectTextEditorPostEditHandler");export{C as a,O as b,q as c,D as d,F as e,L as f,A as g,$ as h,W as i,j,B as k,G as l,K as m};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as N,b as B}from"./chunk-VDP5CQHM.js";import{a as
|
|
1
|
+
import{a as N,b as B}from"./chunk-VDP5CQHM.js";import{a as O}from"./chunk-47SPPIXK.js";import{a as A,b as k}from"./chunk-VAXLSPPU.js";import{a as $,c as b,e as D,f as _,g as L,h as y,i as H}from"./chunk-OI3HBIPK.js";import{e as I}from"./chunk-YTYLS2UM.js";import{a as z}from"./chunk-YJ6T3PEP.js";import{b as S,c as v}from"./chunk-S72FVLUX.js";import{d as T}from"./chunk-IICJXZBU.js";import{a as C}from"./chunk-BU7IZLKB.js";import{a as P,b as x}from"./chunk-S5PL5DFQ.js";import{F as E,l as W}from"./chunk-DXONCYWF.js";import{e as R}from"./chunk-756K3LJY.js";import{a as i}from"./chunk-EI7MMDWY.js";var M={protocol:S,apiVersion:v,id:"web-browser",setup(r){r.addCheck({id:"system-browser",title:"Browser web reads",async run(e){try{e.signal?.throwIfAborted();let t=e.workspace?await V(e.workspace,e.signal):await R(await N(e.env.PI_AGENT_IDE_BROWSER_PATH,e.env),["--version"],e.cwd,e.env,e.signal);return e.signal?.throwIfAborted(),[t.ok?{status:"pass",message:"Chrome/Chromium is available",detail:t.detail}:{status:"warn",message:"Chrome/Chromium cannot start",detail:t.detail}]}catch(t){return e.signal?.throwIfAborted(),[{status:"warn",message:"Browser reads are unavailable",detail:t instanceof Error?t.message:String(t)}]}}})}};async function V(r,e){if(!r.probeBrowser)throw new Error("Project owner does not provide a browser probe");return r.probeBrowser(e)}i(V,"probeOwnerBrowser");function F(r){return{id:"web",readResources:i(e=>e.path!==void 0&&/^https?:/iu.test(e.path)?[e.path]:[],"readResources"),async tryResolve(e,t){let o=e.path;if(o===void 0||!/^(?:https?:|web:)/iu.test(o))return{kind:"not-handled"};if(e.include!==void 0||e.exclude!==void 0)return{kind:"failed",error:new Error("File include/exclude globs do not apply to a web page.")};let s=q(e),a=await r.tryResolve(o,t);if(a.kind!=="resolved")return a;if(a.resource.read===void 0)return{kind:"failed",error:new Error(`Cannot read ${o}`)};let n=await a.resource.read({signal:t.signal});if(n.some(l=>l.type!=="text"))return{kind:"failed",error:new Error(`Web search requires text content: ${o}`)};let u=n.map(l=>l.type==="text"?l.text:"").join(`
|
|
2
2
|
`),d=[],h=e.limit??50;for(let[l,m]of u.split(/\r\n|\n|\r/u).entries()){t.signal?.throwIfAborted();for(let c of m.matchAll(s)){if(c[0].length===0)continue;let p=c.index,f=p+c[0].length;if(!(e.wholeWord===!0&&(new RegExp("\\p{L}|\\p{N}|_","u").test(m[p-1]??"")||new RegExp("\\p{L}|\\p{N}|_","u").test(m[f]??"")))){if(d.length===h)return{kind:"resolved",payload:{source:o,matches:d,complete:!1}};d.push({source:o,lineNumber:l+1,startColumn:p,endColumn:f,matchedText:c[0],lineText:m})}}}let g=d.length===0&&D(e.query)?U(u,o,e.query,t.signal):void 0;return{kind:"resolved",payload:{source:o,matches:d,complete:!0,...g===void 0?{}:{fuzzy:g}}}},toScriptData(e){let t=e;return{...I(t.matches,t.complete),...t.fuzzy===void 0?{}:{fuzzy:{...t.fuzzy,candidates:t.fuzzy.candidates.map(o=>y(o))}}}},renderResult(e,t,o){let s=e.details;return $(s.matches,s.complete,o,t.expanded,void 0,["Web page \xB7 read-only",...s.complete?[]:["Limit reached \xB7 incomplete results"]])},format(e){let t=e,o=t.matches.length===0?`No matches in ${t.source}`:`${t.matches.length}${t.complete?"":"+"} matches in ${t.source}${t.complete?"":" (limit reached)"}`,s=[o];t.fuzzy?.status==="skipped"&&s.push(`Possible-name fallback skipped: ${t.fuzzy.message}`),t.fuzzy?.candidates.length&&s.push("Possible names \u2014 spelling suggestions, not equivalent behavior.",...t.fuzzy.candidates.map(n=>H(y(n))));let a=Buffer.byteLength(o);for(let n of t.matches){let u=`${t.source}:${n.lineNumber}:${n.startColumn+1} ${j(n)}`;if(a+=Buffer.byteLength(u)+1,a>48*1024){s.push("Output shortened. Narrow the query or lower the limit.");break}s.push(u)}return{content:[{type:"text",text:s.join(`
|
|
3
3
|
`)}],details:t}}}}i(F,"createWebSearchResolver");function U(r,e,t,o){o?.throwIfAborted();let s=performance.now(),a=new _;if(a.addText(r),a.limited)return{status:"skipped",message:"name collection reached its byte or unique-name budget",candidates:[]};let n=[];for(let u of L(t,a.names)){if(o?.throwIfAborted(),performance.now()-s>b.timeoutMs)return{status:"skipped",message:"extra search reached its time budget",candidates:[]};let d=new RegExp(u.identifier.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),"gu"),h=[],g=!0,l=0;e:for(let[m,c]of r.split(/\r\n|\n|\r/u).entries()){if(performance.now()-s>b.timeoutMs)return{status:"skipped",message:"extra search reached its time budget",candidates:[]};o?.throwIfAborted();for(let p of c.matchAll(d)){let f=p.index,w=f+p[0].length;if(!(/[\p{L}\p{N}_$]/u.test(c[f-1]??"")||/[\p{L}\p{N}_$]/u.test(c[w]??""))){if(l+=Buffer.byteLength(c),h.length===b.matchesPerCandidate||l>b.verificationBytes){g=!1;break e}h.push({source:e,lineNumber:m+1,startColumn:f,endColumn:w,matchedText:p[0],lineText:c})}}}h.length>0&&n.push({...u,matches:h,complete:g})}return n.length===0?void 0:{status:"ready",candidates:n}}i(U,"searchFuzzyText");function j(r){let e=Math.max(0,r.startColumn-64),t=Math.min(r.lineText.length,r.startColumn+192);return`${e>0?"\u2026":""}${r.lineText.slice(e,t)}${t<r.lineText.length?"\u2026":""}`}i(j,"previewMatch");function q(r){let e=r.query,t=e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e,o=e.startsWith("regex:")?e.slice(6):t.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");return new RegExp(o,r.caseSensitive===!0?"gu":"giu")}i(q,"searchPattern");var G={provider:"web",capability:"read"},J=T({kind:"markdown",label:"WEB"});async function Q(r){await K(r)}i(Q,"registerWeb");async function K(r,e){let t=E(r,G),o=B(t,{owner:e?.(t)}),s={protocol:P,apiVersion:x,id:"web",setup(n){n.addResolver({resolver:o,renderResult:J,preserveTruncatedOutput:!0}),n.describe({path:i(()=>W(e?"HTTP(S) URLs use local HTTP/browser execution; web:ssh://target/https://\u2026 explicitly uses the configured target. Web content is read-only. Target browser fallback requires target-installed Node, playwright-core and Chrome/Chromium. Browser reads enable page JavaScript and disable the Chromium sandbox, using a fresh temporary profile.":"HTTP(S) URL \u2014 remote content.",t.listDescriptions()),"path")})}},a={protocol:A,apiVersion:k,id:"web",setup(n){n.addResolver({resolver:F(o),priority:-100}),n.describe("HTTP(S) Search reuses converted page text for zero-result identifier spelling suggestions. Candidate groups carry the URL and line ranges, never editable SEARCH references."),n.addPromptGuideline(e?"Use search with an HTTP(S) path for local web execution or web:ssh://target/https://\u2026 for explicit target execution; no prior read is required.":"Use search with an HTTP(S) path to find text on a web page; no prior read is required.")}};await Promise.all([C(r,s),O(r,a),Promise.resolve(z(r,M))])}i(K,"registerWebWithOwner");export{Q as a,K as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as y}from"./chunk-
|
|
1
|
+
import{b as y}from"./chunk-GEMDU6XW.js";import{a as c,g as m}from"./chunk-4HWKBCBH.js";import{q as w}from"./chunk-IMGIDBCC.js";import{a as p}from"./chunk-EI7MMDWY.js";import a from"node:path";async function C(e,f,t,v,h,n){n?.throwIfAborted();let i=c(e.target.id,f).path;if(t&&x(t,i))return{cwd:c(e.target.id,t).source,external:!1};let d=!1;try{d=(await e.stat(i,{signal:n})).kind==="directory"}catch(r){if(!(r instanceof m)||r.code!=="ENOENT")throw r}let g=d?h:h.filter(r=>w(r,i)),T=t===void 0&&x(e.target.workspace,i)?e.target.workspace:void 0,o=d?i:a.posix.dirname(i);for(;;){n?.throwIfAborted();let r=a.posix.join(o,".pi","pi-agent-ide",`${v}.json`),l=!1;try{await e.stat(r,{signal:n}),l=!0}catch(s){if(!(s instanceof m)||s.code!=="ENOENT")throw s}let E=!l&&g.length>0?[...(await y(e,o,g,n)).values()].some(s=>s.score>0):!1;if(l||E||o===T)return{cwd:c(e.target.id,o).source,external:t!==void 0};let u=a.posix.dirname(o);if(u===o)return;o=u}}p(C,"resolveSshToolProject");function x(e,f){let t=a.posix.relative(e,f);return t===""||t!==".."&&!t.startsWith("../")&&!a.posix.isAbsolute(t)}p(x,"inside");export{C as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as E,f as b}from"./chunk-T7I2VX3J.js";import{d as q}from"./chunk-
|
|
1
|
+
import{e as E,f as b}from"./chunk-T7I2VX3J.js";import{d as q}from"./chunk-A64JRDZK.js";import"./chunk-TGC2ZACO.js";import"./chunk-NNCZYO4Q.js";import{d as S}from"./chunk-IICJXZBU.js";import"./chunk-PS2B6THP.js";import{a as T}from"./chunk-BU7IZLKB.js";import{a as N,b as O}from"./chunk-S5PL5DFQ.js";import"./chunk-DXONCYWF.js";import{a as h,b as w,c as P,d as k,e as y,h as I}from"./chunk-DUUOCBS3.js";import"./chunk-T4FTT3U4.js";import"./chunk-ZPT5D4VP.js";import{a as A}from"./chunk-ZAWRSA7N.js";import{a as v,b as C}from"./chunk-OFILFO6D.js";import"./chunk-KINKBPPX.js";import"./chunk-ZC65Z3CK.js";import{a as l}from"./chunk-EI7MMDWY.js";import H from"node:path";var M="diagnostics",L=S({kind:"code-view",label:"Diagnostics"});async function V(r){b(r,[await E({id:"diagnostics",description:"Diagnostic resources, readiness, and verification",triggers:[{tool:"read",resourcePrefixes:["diagnostics:"]}]})]);let n,t=l((c,f,e)=>{if(n===void 0)throw new Error("IDE diagnostics are not connected");return n(c,{cwd:f,...e})},"collect"),i={protocol:v,apiVersion:5,id:"diagnostics",setup(c){n=c.readDiagnostics}},o=new WeakMap,s=new WeakMap,a=new WeakMap,u=new WeakMap,W={protocol:N,apiVersion:O,id:"diagnostics",setup(c){c.addResolver({resolver:j(t,s),renderResult:L});let f=I();c.addView({view:"diagnostics",priority:100,presenter:B(t,u)}),c.addHandler({stage:"read",when:{resolvedBy:"any",contentKind:"text"},handler(e){if(e.state?.resolvedBy==="diagnostics"){let p=e.state.content[0],g=s.get(p);return g&&o.set(e.request,g),f(e)}return e.state?.contentKind==="text"&&e.request.views?.includes("diagnostics")&&a.set(e.request,e.state.text),{kind:"continue",context:e}}}),c.addHandler({stage:"post-read",handler(e){let p=o.get(e.request);if(p&&e.result)return{kind:"continue",context:e,transform:l(d=>({...d,details:{...d.details,diagnosticCheck:p}}),"transform")};let g=a.get(e.request),R=g&&u.get(g),m=e.result,_=m?.content[0];return!R||!m||_?.type!=="text"?{kind:"continue",context:e}:{kind:"continue",context:e,transform(d){let D=d.content[0];return D?.type!=="text"?d:{...d,content:[{...D,text:`${R}
|
|
2
2
|
${D.text}`},...d.content.slice(1)],details:{...d.details,diagnosticStatus:R}}}}}}),c.describe({path:"diagnostics:<path> \u2014 lint and language-server diagnostics with reporting tool and readiness.",views:"diagnostics \u2014 diagnostics alongside source text, with reporting tool and readiness."})}};await Promise.all([A(r,i),T(r,W)])}l(V,"registerDiagnostics");function j(r,n){return{id:"diagnostics",tryResolve(t,i){return Promise.resolve(x(t,i.cwd,r,n,{signal:i.signal,...i.audience==="script"&&{mode:"complete"}}))}}}l(j,"createDiagnosticResolver");function x(r,n,t,i,o){let s;try{s=h(r,M,n)}catch(a){return{kind:"failed",error:a}}return s===void 0?{kind:"not-handled"}:{kind:"resolved",resource:{source:w(M,s),async read(){let a=await t(s,n,o),u=P(s,a.content,a.results);return i.set(u,u.diagnosticCheck),[u]}}}}l(x,"resolveDiagnosticSource");function B(r,n){return{id:"diagnostics",async present(t,i){if(i.purpose!=="read"||!H.isAbsolute(t.source)&&!t.source.startsWith("ssh://"))return t;let o=i.audience==="script"&&!i.requestedViews?.includes("diagnostics");if(o&&q(t.source))return t;let s=await r(t.source,i.cwd,{signal:i.signal,...i.audience==="script"&&{mode:o?"snapshot":"complete"}}).catch(a=>{if(i.signal?.throwIfAborted(),!o)throw a});if(s===void 0||o&&s.content!==t.content)return t;if(s.content!==t.content)throw new Error("File changed during diagnostic read; read it again for current source lines.");return n.set(t,y(s.results)),k(t,s.results)}}}l(B,"createDiagnosticPresenter");export{V as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{b as g,c as y,d as _,e as C,g as k}from"./chunk-57F5GTHO.js";import{a as i}from"./chunk-EI7MMDWY.js";import{truncateToWidth as N,wrapTextWithAnsi as L}from"@earendil-works/pi-tui";var x="PI AGENT IDE",U=/\/[a-z][\w-]*/giu,m=class{constructor(t,n){this.tip=t;this.theme=n}static{i(this,"TipCallout")}cached;render(t){if(this.cached?.width===t)return this.cached.lines;let n=$(this.tip,this.theme,t);return this.cached={width:t,lines:n},n}invalidate(){this.cached=void 0}};function $(e,t,n){if(n<=0)return[];if(n<=2)return[t.fg("accent",n===1?"\u2502":"\u2502 ")];let s=n-2,r=t.fg("accent",t.bold(x))+t.fg("dim"," \xB7 ")+t.bold(e.title),o=e.body.split(`
|
|
2
|
+
`).map(c=>c.length===0?"":z(c,t)),d=[r,...o].flatMap(c=>M(c,s)),a=t.fg("accent","\u2502");return d.map(c=>N(`${a} ${c}`,n))}i($,"renderTip");function M(e,t){return e.length===0?[""]:L(e,t)}i(M,"wrapLine");function z(e,t){let n="",s=0;for(let r of e.matchAll(U)){let o=r.index;n+=t.fg("muted",e.slice(s,o)),n+=t.fg("accent",t.bold(r[0])),s=o+r[0].length}return n+t.fg("muted",e.slice(s))}i(z,"styleBodyLine");var h=class{static{i(this,"TipCore")}providers=new Map;registerProvider(t){if(!/^[a-z0-9][a-z0-9.-]*$/u.test(t.id))return Promise.reject(new Error(`Invalid tip provider ID: ${t.id}`));let n=this.providers.get(t.id);return n!==void 0?n===t?Promise.resolve():Promise.reject(new Error(`Tip provider ${t.id} is already registered`)):(this.providers.set(t.id,t),Promise.resolve())}get isEmpty(){return this.providers.size===0}async collectTips(t){let n=[];for(let s of this.providers.values()){if(t.signal?.aborted)break;try{let r=await V(s,t);r!==void 0&&Y(r)&&n.push({providerId:s.id,tip:r})}catch{}}return n}};async function V(e,t){let n=t.signal;if(n===void 0)return e.getTip(t);if(n.aborted)return;let s=i(()=>{},"abort"),r=new Promise(o=>{s=i(()=>o(void 0),"abort"),n.addEventListener("abort",s,{once:!0})});try{return await Promise.race([e.getTip(t),r])}finally{n.removeEventListener("abort",s)}}i(V,"collectTip");function Y(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.id=="string"&&/^[a-z0-9][a-z0-9.-]*$/u.test(t.id)&&typeof t.title=="string"&&t.title.trim().length>0&&typeof t.body=="string"&&t.body.trim().length>0&&(t.scope===void 0||t.scope==="project"||t.scope==="global")}i(Y,"isTip");import{randomUUID as F}from"node:crypto";import{mkdir as I,readFile as G,rename as H,rm as S,stat as J,writeFile as K}from"node:fs/promises";import{setTimeout as W}from"node:timers/promises";import{homedir as B}from"node:os";import f from"node:path";var O=1,Q=10,X=5e3,q=6e4,p=Promise.resolve();function Z(e=process.env){let t=e.PI_CODING_AGENT_DIR??f.join(B(),".pi","agent");return f.join(t,"pi-agent-ide","tips.json")}i(Z,"resolveTipStatePath");var P=class{constructor(t=Z()){this.statePath=t}static{i(this,"TipStateStore")}async shownFor(t){let n=await T(this.statePath);return new Set(w(n,t))}async claimIfUnseen(t,n,s){let r=p.then(async()=>{try{return await v(this.statePath,async()=>{let o=await T(this.statePath),d=new Set(w(o,t));return d.has(n)||s!==void 0&&d.has(s)?!1:(d.add(n),await E(this.statePath,b(o,t,[...d])),!0)})}catch{return!0}});return p=r.then(()=>{},()=>{}),r}async markShown(t,n){if(n.length===0)return;p=p.then(async()=>{await v(this.statePath,async()=>{let r=await T(this.statePath),o=new Set(w(r,t));for(let d of n)o.add(d);await E(this.statePath,b(r,t,[...o]))})}).catch(()=>{}),await p}async unmarkShown(t,n){p=p.then(async()=>{try{await v(this.statePath,async()=>{let r=await T(this.statePath),o=new Set(w(r,t));o.delete(n)&&await E(this.statePath,b(r,t,[...o]))})}catch{}}).catch(()=>{}),await p}};function w(e,t){return t===void 0?e.global??[]:e.projects[t]??[]}i(w,"shownIds");function b(e,t,n){return t===void 0?{...e,global:n}:{...e,projects:{...e.projects,[t]:n}}}i(b,"withShown");function j(e){return f.resolve(e)}i(j,"normalizeProjectPath");async function T(e){try{let t=JSON.parse(await G(e,"utf8"));return et(t)?t:R()}catch{return R()}}i(T,"readState");async function v(e,t){let n=`${e}.lock`;await I(f.dirname(e),{recursive:!0});let s=Date.now();for(;;)try{await I(n);break}catch(r){if(tt(r)!=="EEXIST")throw r;try{if(Date.now()-(await J(n)).mtimeMs>q){await S(n,{recursive:!0,force:!0});continue}}catch{}if(Date.now()-s>=X)throw new Error(`Timed out waiting for startup-tip state lock: ${n}`,{cause:r});await W(Q)}try{return await t()}finally{await S(n,{recursive:!0,force:!0})}}i(v,"withStateLock");function tt(e){return typeof e=="object"&&e!==null&&"code"in e?String(e.code):void 0}i(tt,"errorCode");async function E(e,t){try{await I(f.dirname(e),{recursive:!0});let n=`${e}.${process.pid}.${F()}.tmp`;try{await K(n,`${JSON.stringify(t,null,2)}
|
|
3
|
+
`,"utf8"),await H(n,e)}finally{await S(n,{force:!0})}}catch{}}i(E,"writeState");function R(){return{version:O,projects:{}}}i(R,"emptyState");function et(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e;return t.version!==O||typeof t.projects!="object"||t.projects===null||Array.isArray(t.projects)||t.global!==void 0&&(!Array.isArray(t.global)||!t.global.every(n=>typeof n=="string"))?!1:Object.values(t.projects).every(n=>Array.isArray(n)&&n.every(s=>typeof s=="string"))}i(et,"isState");function D(e){return{protocol:g,apiVersion:y,id:"agent-setup",getTip(t){if(!(t.mode!=="tui"||!t.hasUI||!e()))return{id:"agent-setup-v1",scope:"global",title:"Agent-assisted setup",body:`You can ask your agent to configure Pi Agent IDE.
|
|
4
|
+
Try: \u201CHelp me configure Pi Agent IDE for this project.\u201D
|
|
5
|
+
Or open /agent-ide-settings.`}}}}i(D,"createSetupHintProvider");var A="pi-agent-ide-startup-tip";async function nt(e){let t=new h,n=D(()=>e.getCommands().some(a=>a.source==="skill"&&a.name==="skill:configure-agent-ide"));await t.registerProvider(n),e.getFlag("pi-agent-ide-developer-mode")===!0&&e.registerCommand("agent-ide-tip",{description:"Show the Agent IDE setup hint again without resetting its one-time state",async handler(a,u){if(u.mode!=="tui"||!u.hasUI)return;let c=await n.getTip({cwd:u.cwd,mode:u.mode,hasUI:u.hasUI,signal:u.signal,reason:"startup"});c?e.appendEntry(A,c):u.ui.notify("The Agent IDE setup skill is not available in this session.","info")}});let s=new P;e.registerEntryRenderer(A,(a,u,c)=>{let l=a.data;if(!(typeof l.title!="string"||typeof l.body!="string"))return new m({title:l.title,body:l.body},c)});let r=e.events.on(C,a=>{if(!k(a))throw new Error("Invalid tip provider registration request");a.accept(t.registerProvider(a.provider))});e.on("session_shutdown",r);let o,d=Promise.resolve();e.on("session_start",(a,u)=>{o?.abort(),o=new AbortController;let c=o.signal;d=d.then(()=>rt(e,t,s,a.reason,u,c)).catch(()=>{})}),e.on("session_shutdown",async()=>{o?.abort(),await d}),e.events.emit(_,{protocol:g,apiVersion:y})}i(nt,"registerTips");async function rt(e,t,n,s,r,o){if(r.mode!=="tui"||(o.throwIfAborted(),t.isEmpty))return;let d=await t.collectTips({cwd:r.cwd,mode:r.mode,hasUI:r.hasUI,signal:o,reason:s});if(o.throwIfAborted(),d.length!==0)for(let a of d){let u=a.tip.scope==="global"?void 0:j(r.cwd),c=it(a.providerId,a.tip.id);if(await n.claimIfUnseen(u,c,a.tip.id)){if(o.aborted){await n.unmarkShown(u,c);return}try{e.appendEntry(A,a.tip);return}catch(l){throw await n.unmarkShown(u,c),l}}}}i(rt,"displayTip");function it(e,t){return JSON.stringify([e,t])}i(it,"tipIdentity");export{nt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as a}from"./chunk-
|
|
1
|
+
import{g as a}from"./chunk-4HWKBCBH.js";import{a as c}from"./chunk-EI7MMDWY.js";import{readFile as l}from"node:fs/promises";import{Type as t}from"typebox";import{Value as p}from"typebox/value";var m=t.Object({pid:t.Integer({minimum:1}),parentPid:t.Integer({minimum:0}),command:t.String(),started:t.String(),identity:t.String({pattern:"^[a-f0-9-]+:[0-9]+$"}),executable:t.Union([t.String(),t.Null()])}),w=t.Object({processes:t.Array(m)}),f;async function P(i,n,r,o){return h(i,n,r,o,!1)}c(P,"readSshProcessMetadata");async function E(i,n,r,o){return(await h(i,n,r,o,!0))[0]}c(E,"findSshProcessMetadata");async function h(i,n,r,o,u){if(o?.throwIfAborted(),r!==void 0&&(!Number.isSafeInteger(r)||r<1))throw new Error("Invalid process PID");let d=i.resolve(n);if(!d)throw new a("UNSUPPORTED_SOURCE",n,"not-applied");f??=l(new URL("./process-metadata-worker.py",new URL("../src/backend/process-metadata.ts",import.meta.url).href),"utf8");let S=await d.backend.execute("python3",["-c",await f,...r===void 0?[]:[String(r)]],d.location.path,{signal:o});if(o?.throwIfAborted(),S.exitCode!==0)throw new a("CAPABILITY_UNAVAILABLE",n,"not-applied");let e;try{e=JSON.parse(S.stdout.toString("utf8"))}catch{throw new a("INVALID_RESPONSE",n,"not-applied")}if(typeof e=="object"&&e!==null&&"error"in e){if(u&&r!==void 0&&e.error==="ENOENT")return[];let s=new Set(["CAPABILITY_UNAVAILABLE","ENOENT","EACCES","BYTE_LIMIT"]);throw new a(typeof e.error=="string"&&s.has(e.error)?e.error:"INVALID_RESPONSE",n,"not-applied")}if(!p.Check(w,e)||r!==void 0&&(e.processes.length!==1||e.processes[0]?.pid!==r)||new Set(e.processes.map(s=>s.pid)).size!==e.processes.length)throw new a("INVALID_RESPONSE",n,"not-applied");return e.processes.map(s=>({...s,target:d.location.target,host:"ssh",owned:!1,resource:`process:ssh://${d.location.target}/${s.pid}`}))}c(h,"readSshProcessRows");export{P as a,E as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as se}from"./chunk-E2PHA4SQ.js";import{a as oe}from"./chunk-L2B4DTVS.js";import{b as O}from"./chunk-2ITKAXHO.js";import{c as re}from"./chunk-JKMXND6V.js";import{a as $}from"./chunk-BQAKA3FU.js";import"./chunk-WXGTU2M6.js";import{a as ee,b as te,c as ne}from"./chunk-LLRUJD62.js";import"./chunk-Q5X6OXNS.js";import{g as y}from"./chunk-4HWKBCBH.js";import"./chunk-VDP5CQHM.js";import{a as Q}from"./chunk-47SPPIXK.js";import{a as J,b as K}from"./chunk-VAXLSPPU.js";import{c as Z}from"./chunk-W7CASEO3.js";import{e as z,f as F}from"./chunk-T7I2VX3J.js";import{a as H}from"./chunk-YJ6T3PEP.js";import{b as B,c as _}from"./chunk-S72FVLUX.js";import{a as X}from"./chunk-PS2B6THP.js";import{a as G}from"./chunk-BU7IZLKB.js";import{a as j,b as Y}from"./chunk-S5PL5DFQ.js";import"./chunk-DXONCYWF.js";import{a as d}from"./chunk-EI7MMDWY.js";var ie={protocol:B,apiVersion:_,id:"vision",setup(e){e.addCheck({id:"target-graphics",title:"Target screen capture readiness",async run(t){if(!t.workspace)return[];try{if(t.signal?.throwIfAborted(),!t.workspace.probeCapture)throw new Error("Project owner does not provide a capture readiness probe");let n=await t.workspace.probeCapture(t.signal);return t.signal?.throwIfAborted(),[{status:n.display.ok?"pass":"warn",message:"Native display connection",detail:n.display.detail},{status:n.window.ok?"pass":"warn",message:"Trusted native window identity",detail:n.window.detail}]}catch(n){return t.signal?.throwIfAborted(),[{status:"warn",message:"Native capture readiness is unavailable",detail:n instanceof Error?n.message:String(n)}]}}})}};import{execFile as be}from"node:child_process";import Pe from"node:os";import{promisify as ve}from"node:util";import{createCanvas as ae,loadImage as Se}from"@napi-rs/canvas";var v=ve(be),k=20*1024*1024,de={durationSeconds:2,intervalSeconds:.5,scale:.5},q=new Set;function D(e,t){let n=t.list().find(r=>r.owned===!0&&r.remote?.target===e.target&&r.remote.pid===e.pid&&r.remote.identity===e.identity&&(r.status==="running"||r.status==="stopping"||r.status==="paused"));return n?{...e,owned:!0,source:n.source}:{...e,owned:!1,source:void 0}}d(D,"withRemoteProcessOwnership");function le(e){let t=V({mode:"sequence",durationSeconds:Number(e.durationSeconds??2),intervalSeconds:Number(e.intervalSeconds??.5),scale:Number(e.scale??.5)});de={durationSeconds:t.durationSeconds,intervalSeconds:t.intervalSeconds,scale:t.scale},q=new Set((e.allowedExecutables??"").split(",").map(n=>n.trim().toLowerCase()).filter(Boolean))}d(le,"configureVision");function C(){return de}d(C,"getVisionDefaults");function ue(e){let t=e.includes("\\")?e.slice(e.lastIndexOf("\\")+1):e,n=t.trim().split(/\s+/u)[0]??"",r=n.slice(n.lastIndexOf("/")+1);return q.has((e.includes("\\")?t:r).toLowerCase())}d(ue,"isExecutableAllowed");function pe(e){return q.has(e.slice(e.lastIndexOf("/")+1).toLowerCase())}d(pe,"isNativeExecutableAllowed");function we(e,t){let n=e?.filter(u=>/^(?:image|sequence)(?::|$)/u.test(u))??[];if(n.length===0)return;if(n.length>1)throw new Error("Use only one image or sequence view");let r=n[0],s=r.indexOf(":"),c=r.slice(0,s<0?void 0:s),a={};if(s>=0&&xe(r.slice(s+1),a),c==="image"&&(a.duration!==void 0||a.interval!==void 0))throw new Error("duration and interval are supported only by the sequence view");return V({mode:c,durationSeconds:a.duration??t.durationSeconds,intervalSeconds:a.interval??t.intervalSeconds,scale:a.scale??t.scale,...a.region===void 0?{}:{region:a.region}})}d(we,"parseVisionView");function xe(e,t){if(e.length===0)throw new Error("View parameters cannot be empty");let n=e.split(",");for(let r=0;r<n.length;r+=1){let s=n[r],c=s.indexOf("=");if(c<=0)throw new Error(`Invalid view parameter ${s}`);let a=s.slice(0,c),u=s.slice(c+1);if(a==="region"){let o=[u,n[r+1],n[r+2],n[r+3]].map(Number);if(o.some(w=>!Number.isFinite(w)))throw new Error("region requires x,y,width,height values");t.region={x:o[0],y:o[1],width:o[2],height:o[3]},r+=3;continue}if(a!=="duration"&&a!=="interval"&&a!=="scale")throw new Error(`Unknown view parameter ${a}`);let i=Number(u);if(!Number.isFinite(i))throw new Error(`View parameter ${a} must be a number`);if(t[a]!==void 0)throw new Error(`Duplicate view parameter ${a}`);t[a]=i}}d(xe,"parseViewParameters");function me(e){if(!e.startsWith("display:"))return;if(e==="display:")return 0;let t=/^display:#(\d+)$/u.exec(e);if(t===null)throw new Error("Display sources use display: or display:#N with a zero-based index");let n=Number(t[1]);if(!Number.isSafeInteger(n))throw new Error("Display sources use display: or display:#N with a zero-based index");return n}d(me,"parseDisplaySource");async function T(e){let t=new Map(e.list().flatMap(s=>s.remote!==void 0||s.pid===void 0?[]:[[s.pid,s]]));if(process.platform!=="linux"&&process.platform!=="darwin")return[...t].map(([s,c])=>({pid:s,command:c.description,owned:!0,source:c.source,host:"local"}));let{stdout:n}=await v("ps",["-eo","pid=,ppid=,lstart=,args="],{maxBuffer:4*1024*1024}),r=n.split(`
|
|
2
2
|
`).flatMap(s=>{let c=/^\s*(\d+)\s+(\d+)\s+(\S+\s+\S+\s+\d+\s+\d+:\d+:\d+\s+\d+)\s+(.*)$/u.exec(s);if(c===null)return[];let a=Number(c[1]),u=t.get(a);return[{pid:a,parentPid:Number(c[2]),started:c[3],command:c[4]??"",owned:u!==void 0,host:"local",...u===void 0?{}:{source:u.source}}]});return M()?[...r,...await Ie()]:r}d(T,"listProcesses");async function Ie(){try{let{stdout:e}=await v("powershell.exe",["-NoLogo","-NoProfile","-NonInteractive","-Command","Get-Process | Select-Object Id,ProcessName,Path,StartTime | ConvertTo-Json -Compress"],{maxBuffer:4194304}),t=JSON.parse(e);return(Array.isArray(t)?t:[t]).flatMap(r=>{if(typeof r!="object"||r===null||!("Id"in r)||typeof r.Id!="number")return[];let s="ProcessName"in r&&typeof r.ProcessName=="string"?r.ProcessName:"Windows process",c="Path"in r&&typeof r.Path=="string"?r.Path:void 0,a="StartTime"in r&&typeof r.StartTime=="string"?r.StartTime:void 0;return[{pid:r.Id,command:c??s,owned:!1,host:"windows",...a===void 0?{}:{started:a}}]})}catch{return[]}}d(Ie,"listWindowsProcesses");async function W(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error("Process PID must be a positive integer");let n=(await T(t)).find(r=>r.pid===e);if(n===void 0)throw new Error(`Process ${e} is not running`);return n}d(W,"readProcess");function V(e){let t=e.scale??1;if(!(t>0&&t<=1))throw new Error("Image scale must be greater than 0 and at most 1");let n=e.durationSeconds??0,r=e.intervalSeconds??1;if(e.mode==="sequence"){if(!(n>0&&n<=10))throw new Error("Sequence duration must be greater than 0 and at most 10 seconds");if(!(r>0))throw new Error("Sequence interval must be greater than 0 seconds");if(Math.floor(n/r)+1>20)throw new Error("Sequence capture is limited to 20 frames")}if(e.region!==void 0){let{x:s,y:c,width:a,height:u}=e.region;if(s<0||c<0||a<=0||u<=0||s+a>1||c+u>1)throw new Error("Image region x,y,width,height must fit within normalized bounds 0..1")}if(e.cellIndex!==void 0&&e.cellSize===void 0)throw new Error("Image offset requires limit to set the square grid cell size");if(e.cellSize!==void 0&&(!Number.isSafeInteger(e.cellSize)||e.cellSize<=0))throw new Error("Image limit must be a positive integer pixel size");if(e.cellIndex!==void 0&&(!Number.isSafeInteger(e.cellIndex)||e.cellIndex<0))throw new Error("Image offset must be a zero-based cell index");return e}d(V,"validateVisionOptions");async function I(e,t,n){let r=V(t),s=r.mode==="image"?1:Math.floor(r.durationSeconds/r.intervalSeconds)+1,c=[],a=0;for(let u=0;u<s;u+=1){n?.throwIfAborted(),u>0&&await Ne(r.intervalSeconds*1e3,n);let i=await e();if(a+=i.byteLength,a>k)throw new Error("Captured images exceed the 20MB aggregate limit");for(let o of await Ee(i,r))c.push({type:"image",data:Buffer.from(o).toString("base64"),mimeType:"image/png"})}return c}d(I,"captureImages");async function Ee(e,t){let n=await Se(e),r=t.region??{x:0,y:0,width:1,height:1},s=Math.round(r.x*n.width),c=Math.round(r.y*n.height),a=Math.max(1,Math.round(r.width*n.width)),u=Math.max(1,Math.round(r.height*n.height)),i=t.scale??1,o=Math.max(1,Math.round(a*i)),w=Math.max(1,Math.round(u*i)),f=ae(o,w);if(f.getContext("2d").drawImage(n,s,c,a,u,0,0,o,w),t.cellSize===void 0)return[await f.encode("png")];let m=Math.ceil(o/t.cellSize),l=Math.ceil(w/t.cellSize),p=t.cellIndex??0;if(p>=m*l)throw new Error(`Image cell offset ${p} exceeds the ${m}x${l} grid`);let g=p%m,N=Math.floor(p/m),A=g*t.cellSize,b=N*t.cellSize,P=Math.min(t.cellSize,o-A),x=Math.min(t.cellSize,w-b),L=ae(P,x);return L.getContext("2d").drawImage(f,A,b,P,x,0,0,P,x),[await L.encode("png")]}d(Ee,"selectImage");function Ae(e,t){return e&&t==="windows"}d(Ae,"usesWindowsHostWindowCapture");function fe(){return{async captureWindow(e,t,n){if(n?.throwIfAborted(),Ae(M(),t))return Re(e,n);if(process.platform!=="linux"&&process.platform!=="darwin")throw new Error(`Window capture is unsupported on ${process.platform}`);let{Window:r}=await import("node-screenshots"),s;try{s=r.all()}catch(u){throw new Error(`Desktop window enumeration is unavailable: ${ce(u)}`,{cause:u})}let c=s.find(u=>{try{return u.pid()===e}catch{return!1}});if(c===void 0)throw new Error(`No capturable desktop window belongs to PID ${e}`);let a=await c.captureImage();return n?.throwIfAborted(),new Uint8Array(await a.toPng())},async captureDisplay(e,t){if(t?.throwIfAborted(),M())return De(e,t);if(process.platform!=="linux"&&process.platform!=="darwin"&&process.platform!=="win32")throw new Error(`Display capture is unsupported on ${process.platform}`);let{Monitor:n}=await import("node-screenshots"),r;try{r=n.all()}catch(a){throw new Error(`Desktop display enumeration is unavailable: ${ce(a)}`,{cause:a})}let s=r[e];if(s===void 0)throw new Error(`Display index ${e} is unavailable; found ${r.length} display(s)`);let c=await s.captureImage();return t?.throwIfAborted(),new Uint8Array(await c.toPng())},async captureUrl(e,t){if(e.protocol!=="http:"&&e.protocol!=="https:")throw new Error("Web screenshots require an HTTP(S) URL");let{chromium:n}=await import("playwright-core"),r=await Ce(),s=await n.launch({executablePath:r,headless:!0,chromiumSandbox:!1,timeout:3e4}),c=d(()=>{s.close()},"abort");t?.addEventListener("abort",c,{once:!0});try{let a=await s.newPage({viewport:{width:1280,height:720}});return await a.goto(e.href,{waitUntil:"domcontentloaded",timeout:3e4}),await a.waitForLoadState("networkidle",{timeout:1500}).catch(()=>{}),t?.throwIfAborted(),new Uint8Array(await a.screenshot({type:"png",fullPage:!0}))}finally{t?.removeEventListener("abort",c),await s.close().catch(()=>{})}}}}d(fe,"createCaptureBackend");async function Re(e,t){let n=new URL("windows-window-capture.ps1",new URL("../src/plugins/pi-agent-ide-vision/src/vision.ts",import.meta.url).href);t?.throwIfAborted();let{stdout:r}=await v("wslpath",["-w",n.pathname],{signal:t}),{stdout:s}=await v("powershell.exe",["-NoLogo","-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-File",r.trim(),"-ProcessId",String(e)],{encoding:"buffer",maxBuffer:k,signal:t});return new Uint8Array(s)}d(Re,"captureWslWindow");async function De(e,t){let n=new URL("windows-display-capture.ps1",new URL("../src/plugins/pi-agent-ide-vision/src/vision.ts",import.meta.url).href);t?.throwIfAborted();let{stdout:r}=await v("wslpath",["-w",n.pathname],{signal:t}),{stdout:s}=await v("powershell.exe",["-NoLogo","-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-File",r.trim(),"-DisplayIndex",String(e)],{encoding:"buffer",maxBuffer:k,signal:t});return new Uint8Array(s)}d(De,"captureWslDisplay");function M(){return process.platform==="linux"&&(process.env.WSL_DISTRO_NAME!==void 0||Pe.release().toLowerCase().includes("microsoft"))}d(M,"isWsl");async function Ce(){let e=process.env.PI_AGENT_IDE_BROWSER_PATH;if(e!==void 0)return e;let{stdout:t}=await v("bash",["-lc","command -v google-chrome-stable || command -v google-chrome || command -v chromium || command -v chromium-browser"]),n=t.trim();if(n.length===0)throw new Error("No Chrome or Chromium executable was found; set PI_AGENT_IDE_BROWSER_PATH");return n}d(Ce,"resolveBrowser");function Ne(e,t){return new Promise((n,r)=>{let s=setTimeout(n,e),c=d(()=>{clearTimeout(s),r(t?.reason??new Error("Capture aborted"))},"abort");t?.addEventListener("abort",c,{once:!0}),s.unref()})}d(Ne,"delay");function ce(e){return e instanceof Error?e.message:String(e)}d(ce,"errorMessage");async function ye(e,t,n,r){F(e,[await z({id:"vision",description:"Window, display, image, and sequence capture",triggers:[{tool:"read",resourcePrefixes:["process:","window:","display:"]},{tool:"read",resourcePrefixes:["web:ssh://"],viewPrefixes:["image","sequence"]}]})]);let s=t?.preferences??{};le({durationSeconds:s["vision.sequenceDurationSeconds"],intervalSeconds:s["vision.sequenceIntervalSeconds"],scale:s["vision.imageScale"],allowedExecutables:s["vision.allowedExecutables"]});let c=oe(e),a=fe();await Promise.all([H(e,ie),G(e,{protocol:j,apiVersion:Y,id:"vision",setup(u){for(let i of["image","sequence"])u.addView({contentKind:"any",view:i,presenter:{id:`vision-${i}`,present:d(o=>o,"present")}});u.addHandler({stage:"pre-read",async handler(i){let o=i.request.path;if(o===void 0)return{kind:"continue",context:i};if(o.startsWith("window:ssh://")||o.startsWith("display:ssh://"))try{let l=o.startsWith("window:"),p=new URL(o.slice(l?7:8));if(p.username||p.password||p.port||p.search||(l?p.hash!==""||!/^\/[1-9][0-9]*$/u.test(p.pathname):p.pathname!=="/"||p.hash!==""&&!/^#\d+$/u.test(p.hash)))throw new Error(`Invalid target capture resource: ${o}`);if(!l&&e.getFlag("pi-agent-ide-vision-displays")!==!0)return h(o,"Display capture is disabled. Enable --pi-agent-ide-vision-displays to allow it.");if(!r)return h(o,`Target capture is unavailable: ${o}`);let g=Number(l?p.pathname.slice(1):p.hash.slice(1)||"0");if(!Number.isSafeInteger(g))throw new Error(`Invalid target capture resource: ${o}`);let N=await I(async()=>{if(!l)return r.captureDisplay(o,g,i.resolverContext.signal);let A=`process:ssh://${p.hostname}/${g}`,b=await n?.read(A,i.resolverContext.signal);if(!b||b.resource!==A||b.pid!==g||b.target!==p.hostname)throw new Error(`Target process identity is unavailable: ${o}`);let P=D(b,c),x=P.executable;if(!P.owned&&(!x||!pe(x))&&e.getFlag("pi-agent-ide-vision-arbitrary-windows")!==!0)throw new Error(`Window capture is denied for the target executable: ${o}`);return r.captureWindow(o,P,i.resolverContext.signal)},R(i.request),i.resolverContext.signal);return S(o,N)}catch(l){return h(o,E(l))}if(o.startsWith("web:")&&he(i.request))try{let l=r?.captureWeb?.bind(r);if(!l)return h(o,`Target web capture is unavailable: ${o}`);let p=await I(()=>l(o,i.resolverContext.signal),R(i.request),i.resolverContext.signal);return S(o,p)}catch(l){return h(o,E(l))}let w=me(o);if(w!==void 0){if(e.getFlag("pi-agent-ide-vision-displays")!==!0)return h(o,"Display capture is disabled. Enable --pi-agent-ide-vision-displays to allow it.");try{let l=await I(()=>a.captureDisplay(w,i.resolverContext.signal),R(i.request),i.resolverContext.signal);return S(o,l)}catch(l){return h(o,E(l))}}try{let l=await n?.read(o,i.resolverContext.signal);if(l)return S(o,[{type:"text",text:U(D(l,c))}])}catch(l){return h(o,E(l))}let f=ge(o,"process:");if(f!==void 0){let l=await W(f,c);return S(o,[{type:"text",text:U(l)}])}let m=ge(o,"window:");if(m!==void 0){let l=await W(m,c);if(!l.owned&&!ue(l.command)&&e.getFlag("pi-agent-ide-vision-arbitrary-windows")!==!0)return h(o,`Window capture for PID ${m} is denied because the process is neither Agent IDE-owned nor allowlisted by executable name. Enable --pi-agent-ide-vision-arbitrary-windows to allow it.`);try{let p=await I(()=>a.captureWindow(m,l.host,i.resolverContext.signal),R(i.request),i.resolverContext.signal);return S(o,p)}catch(p){return h(o,E(p))}}if(/^https?:\/\//iu.test(o)&&he(i.request)){let l=new URL(o);try{let p=await I(()=>a.captureUrl(l,i.resolverContext.signal),R(i.request),i.resolverContext.signal);return S(l.href,p)}catch(p){return h(l.href,E(p))}}return{kind:"continue",context:i}}}),u.describe({path:d(()=>`process:ssh://target/PID, window:ssh://target/PID and display:ssh://target/ select configured Linux SSH targets; missing target facilities fail without local fallback. web:ssh://target/https://\u2026 captures with target-installed Playwright/Chromium. process:PID \u2014 process metadata. window:PID \u2014 capture a window of an IDE-owned or allowlisted process${e.getFlag("pi-agent-ide-vision-arbitrary-windows")===!0?"; arbitrary windows are enabled":"; other processes require --pi-agent-ide-vision-arbitrary-windows"}. display: or display:#N \u2014 display capture with a zero-based index; ${e.getFlag("pi-agent-ide-vision-displays")===!0?"enabled":"requires --pi-agent-ide-vision-displays"}. HTTP(S) URLs accept image or sequence screenshots.`,"path"),views:d(()=>{let i=C();return`image or image:scale=S,region=X,Y,W,H \u2014 one screenshot. sequence or sequence:duration=D,interval=I,scale=S,region=X,Y,W,H \u2014 timed frames. Only one image/sequence view per request. duration and interval are seconds and only valid for sequence: 0 < D <= 10, I > 0, at most 20 frames (floor(D/I)+1). Scale satisfies 0 < S <= 1. Region uses normalized x,y,width,height: x,y >= 0, width,height > 0, and the rectangle must fit in 0..1; crop runs before scaling. Settings are optional; defaults: duration=${i.durationSeconds}, interval=${i.intervalSeconds}, scale=${i.scale}.`},"views"),offset:"For window:, display: and HTTP(S) image/sequence captures, a non-negative integer zero-based row-major grid cell index in the transformed image. Requires limit; omit to select cell 0 when limit is set.",limit:"For window:, display: and HTTP(S) image/sequence captures, a positive integer square grid cell size in output pixels. Omit both offset and limit for the bounded transformed image."})}}),Q(e,{protocol:J,apiVersion:K,id:"vision-processes",setup(u){u.addResolver({priority:-100,resolver:{id:"processes",readResources:d(i=>/^process:/iu.test(i.query)?void 0:[],"readResources"),toScriptData(i){return{kind:"custom",resolverId:"processes",value:{processes:i.map(w=>({pid:w.pid,command:w.command,...w.host==="ssh"?{host:w.host,target:w.target,resource:w.resource,identity:w.identity,owned:w.owned,parentPid:w.parentPid,started:w.started,executable:w.executable,...w.source===void 0?{}:{source:w.source}}:{}}))}}},async tryResolve(i,o){let w=/^process:(.*)$/isu.exec(i.query);if(w===null)return{kind:"not-handled"};let f=(w[1]??"").trim().toLowerCase(),m=i.path??o.cwd,l=await n?.list(m,o.signal);if(m.includes("://")&&l===void 0)throw new Error("Process scope has no resource owner");return{kind:"resolved",payload:(l?.map(g=>D(g,c))??await T(c)).filter(g=>f.length===0||String(g.pid)===f||g.command.toLowerCase().includes(f)).slice(0,Math.min(i.limit??50,100))}},renderResult(i,o,w){let f=i.details;return new X({summary:`${f.processes.length} processes shown`,rows:f.processes.length?f.processes.map(m=>({kind:"note",text:`${m.pid} ${m.command}`})):[{kind:"note",text:"No matching processes"}]},w,o.expanded)},format(i){let o=i;return{content:[{type:"text",text:o.length===0?"No matching processes.":o.map(U).join(`
|
|
3
3
|
|
|
4
4
|
`)}],details:{count:o.length,processes:o}}}}}),u.describe("process:<query> finds running processes by PID or command. Select a configured Linux target with an SSH path; its results retain process:ssh://target/PID, target and kernel start identity. Use process:PID for local metadata. Use window:ssh://target/PID for authorized target capture, never window:PID with a remote PID. Discovery alone does not grant capture or process control.")}})])}d(ye,"registerVisionWithOwner");function ge(e,t){if(!e.startsWith(t))return;let n=e.slice(t.length);if(!/^\d+$/u.test(n))throw new Error(`${t} sources require a numeric PID`);return Number(n)}d(ge,"prefixedPid");function R(e){return{...we(e.views,C())??{mode:"image",...C()},...e.limit===void 0?{}:{cellSize:e.limit},...e.offset===void 0?{}:{cellIndex:e.offset}}}d(R,"options");function he(e){return e.views?.some(t=>/^(?:image|sequence)(?::|$)/u.test(t))===!0}d(he,"requestsScreenshot");function S(e,t){return{kind:"return",result:{content:t,script:{kind:"native",source:e,blocks:t},details:{source:e,resolvedBy:"vision"}}}}d(S,"returned");function h(e,t){return{kind:"return",result:{content:[{type:"text",text:t}],details:{source:e,resolvedBy:"vision",failure:{code:"READ_FAILED",source:e,resolverId:"vision",message:t}},isError:!0}}}d(h,"failed");function E(e){return e instanceof Error?e.message:String(e)}d(E,"errorMessage");function U(e){return[`PID: ${e.pid}`,...e.host==="ssh"?[`Target: ${e.target}`,`Resource: ${e.resource}`,`Identity: ${e.identity}`]:[],`Command: ${e.command}`,`Owned by Agent IDE: ${e.owned?"yes":"no"}`,...e.host==="ssh"&&e.executable!==null?[`Executable: ${e.executable}`]:[],...e.parentPid===void 0?[]:[`Parent PID: ${e.parentPid}`],...e.started===void 0?[]:[`Started: ${e.started}`],...e.source===void 0?[]:[`Agent IDE source: ${e.source}`]].join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as S,d as C}from"./chunk-
|
|
1
|
+
import{c as S,d as C}from"./chunk-OI3HBIPK.js";import{a as h}from"./chunk-EI7MMDWY.js";import z from"node:path";import{pathToFileURL as x}from"node:url";function b(e,n){let r=new Map;for(let t of e){let i=r.get(t.source)??[];i.push(t),r.set(t.source,i)}let a=new Set,u=e.length,s=[...r].sort(([t,i],[d,m])=>m.length-i.length||t.localeCompare(d));for(let[t,i]of s){if(u<=n)break;a.add(t),u-=i.length-1}let c=[],o=n,l=[...r].sort(([t],[i])=>Number(a.has(t))-Number(a.has(i))||t.localeCompare(i));for(let[t,i]of l){if(!a.has(t)){if(i.length>o)continue;c.push({kind:"detailed",source:t,matches:i}),o-=i.length;continue}if(o<1)continue;o--;let d=new Map;for(let g of i)d.set(g.lineText,(d.get(g.lineText)??0)+1);let m=r.size===1?[...d].sort(([g,p],[F,w])=>w-p||g.localeCompare(F)).slice(0,o).map(([g,p])=>({text:g,matchCount:p})):[];o-=m.length,c.push({kind:"compacted",source:t,matchCount:i.length,uniqueLineCount:d.size,groups:m})}return c.sort((t,i)=>t.source.localeCompare(i.source)),{files:c}}h(b,"planSearchPresentation");function N(e,n,r,a,u,s=50){let c=b(n,s),o=new Set(n.map(t=>t.source)).size,l=c.files.map(t=>t.kind==="detailed"?L(t.source,t.matches,a):{path:M(t.source,a),link:x(t.source).href,matchCount:t.matchCount,uniqueLineCount:t.uniqueLineCount,groups:t.groups,lines:[]});return{...u!==void 0&&{sessionId:u},query:e,matchCount:n.length,fileCount:o,...c.files.length<o?{omittedFileCount:o-l.length,omittedMatchCount:n.length-l.reduce((t,i)=>t+i.matchCount,0)}:{},complete:r,files:l}}h(N,"createSearchToolDetails");function $(e,n){return{fileCount:new Set(e.flatMap(r=>r.matches.map(a=>a.source))).size,groups:e.map(r=>{let u=N(r.identifier,r.matches.slice(0,S.previewMatches),r.complete,n).files.map(s=>{let c=s.lines.map(o=>{let l=Math.max(0,(o.ranges[0]?.from??0)-64),t=Math.min(o.text.length,(o.ranges[0]?.to??0)+64),i=l>0?"\u2026":"",d=o.ranges.filter(m=>m.from>=l&&m.to<=t).map(m=>({from:m.from-l+i.length,to:m.to-l+i.length}));return{...o,text:i+o.text.slice(l,t)+(t<o.text.length?"\u2026":""),ranges:d,matchCount:d.length}});return{...s,lines:c,matchCount:c.reduce((o,l)=>o+l.matchCount,0)}});return{identifier:r.identifier,files:u}})}}h($,"createFuzzyPresentation");function k(e){return f(e)&&y(e.fileCount)&&Array.isArray(e.groups)&&e.groups.every(n=>f(n)&&typeof n.identifier=="string"&&Array.isArray(n.files)&&n.files.every(R))}h(k,"isFuzzyPresentation");function E(e){if(!f(e)||typeof e.query!="string"||!y(e.matchCount)||!y(e.fileCount)||e.omittedFileCount!==void 0&&!y(e.omittedFileCount)||e.omittedMatchCount!==void 0&&!y(e.omittedMatchCount)||typeof e.complete!="boolean"||e.sessionId!==void 0&&typeof e.sessionId!="string"||e.fuzzy!==void 0&&!C(e.fuzzy)||e.fuzzyPresentation!==void 0&&!k(e.fuzzyPresentation)||!Array.isArray(e.files)||!e.files.every(R))return!1;let n=e.files;return e.fileCount===n.length+(e.omittedFileCount??0)&&e.matchCount===n.reduce((r,a)=>r+a.matchCount,0)+(e.omittedMatchCount??0)}h(E,"isSearchToolDetails");function L(e,n,r){let a=new Map;for(let s of n){let c=a.get(s.lineNumber);if(c!==void 0&&c.text!==s.lineText)throw new Error(`Search results disagree about line ${String(s.lineNumber)} in ${e}.`);let o=c??{lineNumber:s.lineNumber,text:s.lineText,ranges:[]};o.ranges.push({from:s.startColumn,to:s.endColumn}),a.set(s.lineNumber,o)}let u=[...a.values()].sort((s,c)=>s.lineNumber-c.lineNumber).map(s=>{let c=[...s.ranges].sort((o,l)=>o.from-l.from||o.to-l.to);return{lineNumber:s.lineNumber,text:s.text,matchCount:c.length,ranges:c}});return{path:M(e,r),link:x(e).href,matchCount:n.length,lines:u}}h(L,"createSearchResultFile");function R(e){if(!f(e)||typeof e.path!="string"||typeof e.link!="string"||!y(e.matchCount)||!Array.isArray(e.lines)||!e.lines.every(P))return!1;let n=e.lines,r=e.groups,a=new Set(n.flatMap(u=>u.logicalMatchIds??[]));return(r===void 0||Array.isArray(r)&&r.every(u=>f(u)&&typeof u.text=="string"&&y(u.matchCount)))&&(e.uniqueLineCount===void 0||y(e.uniqueLineCount))&&(n.length===0||(a.size>0?a.size===e.matchCount:e.matchCount===n.reduce((u,s)=>u+s.matchCount,0)))}h(R,"isSearchResultFile");function P(e){return f(e)&&Number.isSafeInteger(e.lineNumber)&&e.lineNumber>=1&&typeof e.text=="string"&&y(e.matchCount)&&Array.isArray(e.ranges)&&e.ranges.length===e.matchCount&&(e.logicalMatchIds===void 0||Array.isArray(e.logicalMatchIds)&&e.logicalMatchIds.every(n=>typeof n=="string"))&&e.ranges.every(n=>A(n,e.text))}h(P,"isSearchResultLine");function A(e,n){return f(e)&&Number.isSafeInteger(e.from)&&Number.isSafeInteger(e.to)&&e.from>=0&&e.to>e.from&&e.to<=n.length}h(A,"isSearchResultRange");function f(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}h(f,"isRecord");function y(e){return Number.isSafeInteger(e)&&e>=0}h(y,"isCount");function M(e,n){if(e.includes("://"))return e;let r=z.relative(n,e);return r.length>0&&!r.startsWith("..")&&!z.isAbsolute(r)?r:e}h(M,"displaySource");export{b as a,N as b,$ as c,E as d};
|