pi-agent-ide 0.5.1 → 0.6.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 +71 -0
- package/README.md +82 -50
- package/assets/social-preview.png +0 -0
- package/dist/{chunk-LY6U5EAD.js → chunk-2527OQ4Y.js} +1 -1
- package/dist/chunk-4KUFOHWP.js +2 -0
- package/dist/chunk-4LDOV7QS.js +28 -0
- package/dist/chunk-5JELU6RV.js +7 -0
- package/dist/chunk-FA6BKC5Y.js +1 -0
- package/dist/chunk-FEDVTZJG.js +1 -0
- package/dist/chunk-I6Y3W4X6.js +27 -0
- package/dist/chunk-K5G4FDXD.js +1 -0
- package/dist/chunk-M5IVSCR2.js +1 -0
- package/dist/chunk-MPT3R4BL.js +0 -0
- package/dist/chunk-PZFOOHY2.js +15 -0
- package/dist/chunk-S6QRG3TQ.js +1 -0
- package/dist/chunk-T7I2VX3J.js +1 -0
- package/dist/chunk-VCTK4JSN.js +3 -0
- package/dist/chunk-W7CASEO3.js +1 -0
- package/dist/chunk-YEQOQMU7.js +5 -0
- package/dist/chunk-YT42LKFV.js +16 -0
- package/dist/entry-10.js +1 -1
- package/dist/entry-11.js +1 -1
- package/dist/entry-12.js +1 -1
- package/dist/entry-13.js +1 -1
- package/dist/entry-14.js +1 -1
- package/dist/entry-15.js +1 -1
- package/dist/entry-16.js +1 -0
- package/dist/entry-17.js +1 -1
- package/dist/entry-19.js +1 -1
- package/dist/entry-20.js +1 -1
- package/dist/entry-21.js +1 -1
- package/dist/entry-22.js +1 -2
- package/dist/entry-23.js +1 -1
- package/dist/entry-24.js +1 -1
- package/dist/entry-25.js +2 -1
- package/dist/entry-26.js +1 -1
- package/dist/entry-27.js +2 -12
- package/dist/entry-28.js +1 -1
- package/dist/entry-29.js +1 -1
- package/dist/entry-30.js +1 -1
- package/dist/entry-31.js +12 -1
- package/dist/entry-32.js +1 -4
- package/dist/entry-33.js +1 -9
- package/dist/entry-34.js +1 -1
- package/dist/entry-35.js +1 -1
- package/dist/entry-36.js +4 -1
- package/dist/entry-37.js +9 -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 -18
- 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 +17 -1
- package/dist/entry-46.js +1 -7
- package/dist/entry-47.js +1 -11
- package/dist/entry-48.js +1 -1
- package/dist/entry-49.js +1 -1
- package/dist/entry-50.js +6 -1
- package/dist/entry-51.js +11 -1
- package/dist/entry-52.js +1 -1
- package/dist/entry-53.js +1 -1
- package/dist/entry-54.js +1 -1
- package/dist/entry-55.js +1 -1
- package/dist/entry-56.js +1 -0
- package/dist/entry-57.js +1 -1
- package/dist/entry-58.js +1 -0
- package/dist/entry-59.js +1 -1
- package/dist/entry-60.js +0 -1
- package/dist/entry-61.js +1 -1
- package/dist/entry-62.js +0 -1
- package/dist/entry-63.js +1 -1
- package/dist/entry-64.js +1 -1
- package/dist/entry-65.js +1 -0
- package/dist/entry-66.js +1 -1
- package/dist/entry-67.js +1 -0
- package/dist/entry-68.js +1 -1
- package/dist/entry-69.js +0 -1
- package/dist/entry-70.js +1 -1
- package/dist/entry-71.js +0 -203
- package/dist/entry-72.js +1 -30
- package/dist/entry-73.js +1 -2
- package/dist/entry-74.js +1 -1
- package/dist/entry-75.js +315 -1
- package/dist/entry-76.js +30 -3
- package/dist/entry-77.js +2 -3
- package/dist/entry-78.js +1 -1
- package/dist/entry-79.js +1 -1
- package/dist/entry-80.js +3 -1
- package/dist/entry-81.js +3 -0
- package/dist/entry-82.js +1 -0
- package/dist/entry-83.js +1 -0
- package/dist/entry-84.js +1 -0
- package/dist/entry-9.js +1 -1
- package/dist/pi-agent-ide.js +3 -3
- package/docs/agent-guides/apply.md +333 -0
- package/docs/agent-guides/debugger.md +5 -0
- package/docs/agent-guides/diagnostics.md +5 -0
- package/docs/agent-guides/editing.md +44 -0
- package/docs/agent-guides/git-changes.md +5 -0
- package/docs/agent-guides/json-reading.md +41 -0
- package/docs/agent-guides/read-resources.md +44 -0
- package/docs/agent-guides/search-code.md +29 -0
- package/docs/agent-guides/terminal.md +7 -0
- package/docs/agent-guides/vision.md +5 -0
- package/docs/configuration.md +9 -15
- package/docs/research/apply-read-latency.md +219 -0
- package/docs/tools.md +12 -0
- package/node_modules/pi-agent-doctor/package.json +6 -6
- package/node_modules/pi-agent-doctor/runtime/entry-22.js +1 -0
- package/node_modules/pi-agent-doctor/runtime/entry-23.js +1 -0
- package/node_modules/pi-agent-documentation/package.json +15 -0
- package/node_modules/pi-agent-documentation/runtime/entry-24.js +1 -0
- package/node_modules/pi-agent-documentation/src/index.ts +69 -0
- package/node_modules/pi-agent-filesystem/index.ts +0 -4
- package/node_modules/pi-agent-filesystem/package.json +7 -7
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- package/node_modules/pi-agent-filesystem-image/runtime/entry-26.js +2 -0
- package/node_modules/pi-agent-filesystem-jq/index.ts +134 -0
- package/node_modules/pi-agent-filesystem-jq/package.json +23 -0
- package/node_modules/pi-agent-filesystem-jq/src/jq.ts +107 -0
- package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
- package/node_modules/pi-agent-filesystem-pdf/runtime/entry-28.js +2 -0
- package/node_modules/pi-agent-filesystem-text/package.json +4 -4
- package/node_modules/pi-agent-ide-ast/package.json +12 -11
- package/node_modules/pi-agent-ide-ast/runtime/entry-30.js +1 -0
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +8 -6
- package/node_modules/pi-agent-ide-changes/index.ts +8 -0
- package/node_modules/pi-agent-ide-changes/package.json +9 -8
- package/node_modules/pi-agent-ide-changes/runtime/entry-32.js +1 -0
- package/node_modules/pi-agent-ide-formatter/package.json +4 -4
- package/node_modules/pi-agent-ide-formatter/runtime/entry-34.js +2 -0
- package/node_modules/pi-agent-ide-formatter/src/formatter.ts +1 -1
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-languages/runtime/entry-35.js +2 -0
- package/node_modules/pi-agent-ide-lint/index.ts +1 -1
- package/node_modules/pi-agent-ide-lint/package.json +8 -8
- package/node_modules/pi-agent-ide-lint/runtime/entry-36.js +2 -0
- package/node_modules/pi-agent-ide-lint/src/command-linter.ts +20 -2
- package/node_modules/pi-agent-ide-lsp/index.ts +0 -3
- package/node_modules/pi-agent-ide-lsp/package.json +10 -10
- package/node_modules/pi-agent-ide-lsp/runtime/entry-37.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 -3
- package/node_modules/pi-agent-read/package.json +12 -11
- package/node_modules/pi-agent-read/runtime/entry-41.js +0 -1
- package/node_modules/pi-agent-read/runtime/entry-45.js +2 -0
- package/node_modules/pi-agent-read/src/api/read-parameters.ts +4 -4
- package/node_modules/pi-agent-read/src/core/extension.ts +16 -2
- package/node_modules/pi-agent-read/src/core/read-core.ts +4 -5
- package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +62 -8
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +29 -17
- package/node_modules/pi-agent-resource/package.json +2 -2
- package/node_modules/pi-agent-resource/runtime/entry-46.js +1 -0
- package/node_modules/pi-agent-search/package.json +8 -7
- package/node_modules/pi-agent-search/runtime/entry-47.js +1 -0
- package/node_modules/pi-agent-search/src/core/extension.ts +29 -10
- package/node_modules/pi-agent-search-text/package.json +9 -9
- package/node_modules/pi-agent-search-text/runtime/entry-51.js +2 -0
- package/node_modules/pi-agent-search-text/runtime/entry-52.js +1 -0
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
- package/node_modules/pi-agent-text-anchor-exact/index.ts +3 -3
- package/node_modules/pi-agent-text-anchor-exact/package.json +5 -5
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-56.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/src/config.ts +2 -2
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-58.js +2 -0
- package/node_modules/pi-agent-text-editor/index.ts +15 -0
- package/node_modules/pi-agent-text-editor/package.json +26 -25
- package/node_modules/pi-agent-text-editor/runtime/entry-71.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-72.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-73.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-75.js +2 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/execution.ts +131 -3
- package/node_modules/pi-agent-text-editor/src/core/apply/mixed-source.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +14 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/output.ts +36 -5
- package/node_modules/pi-agent-text-editor/src/core/apply/prompt.ts +5 -42
- package/node_modules/pi-agent-text-editor/src/core/apply/renderer.ts +50 -5
- package/node_modules/pi-agent-text-editor/src/core/apply/runtime.ts +187 -38
- package/node_modules/pi-agent-text-editor/src/core/apply/tool.ts +3 -8
- package/node_modules/pi-agent-text-editor/src/core/apply/transaction.ts +770 -237
- package/node_modules/pi-agent-text-editor/src/core/builtin-edit-filter.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +0 -11
- package/node_modules/pi-agent-text-editor/src/core/post-edit-scope.ts +5 -0
- package/node_modules/pi-agent-text-editor/src/core/text-editor-config.ts +4 -4
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +9 -1
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +0 -2
- package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +53 -0
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +11 -41
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +8 -18
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +11 -41
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +9 -19
- package/node_modules/pi-agent-text-editor-renderer/index.ts +17 -4
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +23 -11
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +21 -16
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-78.js +1 -0
- package/node_modules/pi-agent-tool-ui/package.json +2 -2
- package/node_modules/pi-agent-tool-ui/runtime/entry-79.js +1 -0
- package/node_modules/pi-agent-web/package.json +7 -7
- package/node_modules/pi-agent-web-html/package.json +3 -3
- package/node_modules/pi-agent-web-html/runtime/entry-81.js +2 -0
- package/node_modules/pi-agent-web-image/package.json +4 -4
- package/node_modules/pi-agent-web-image/runtime/entry-82.js +2 -0
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/runtime/entry-83.js +2 -0
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-84.js +2 -0
- package/package.json +112 -43
- package/src/api/documentation.ts +2 -0
- package/src/api/path-identity.ts +15 -0
- package/src/composite/builtin-extensions.ts +14 -2
- package/src/composite/extensions-config.ts +6 -0
- package/src/composite/module-labels.ts +9 -0
- package/src/composite/module-settings-store.ts +3 -0
- package/src/composite/module-settings.ts +71 -17
- package/src/composite/preferences.ts +83 -3
- package/src/composite/presentation.ts +14 -0
- package/src/composite/presets.ts +57 -0
- package/src/composite/selection.ts +5 -1
- package/src/doctor/inventory.ts +7 -2
- package/src/documentation/extension.ts +295 -0
- package/src/documentation/registry.ts +98 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +0 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
- 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-image/runtime/entry-26.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/index.ts +134 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +23 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-27.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/src/jq.ts +107 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-28.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-29.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-25.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +7 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-81.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-82.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-83.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-84.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-80.js +2 -0
- package/src/extensions/pi-agent-read/package.json +12 -11
- package/src/extensions/pi-agent-read/runtime/entry-41.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-42.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-45.js +2 -0
- package/src/extensions/pi-agent-read/src/api/read-parameters.ts +4 -4
- package/src/extensions/pi-agent-read/src/core/extension.ts +16 -2
- package/src/extensions/pi-agent-read/src/core/read-core.ts +4 -5
- package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +62 -8
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +29 -17
- package/src/extensions/pi-agent-search/package.json +8 -7
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +9 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-51.js +2 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-52.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-47.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-48.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-49.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-50.js +2 -0
- package/src/extensions/pi-agent-search/src/core/extension.ts +29 -10
- package/src/extensions/pi-agent-text-editor/index.ts +15 -0
- package/src/extensions/pi-agent-text-editor/package.json +26 -25
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.ts +3 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-55.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-56.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/config.ts +2 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-57.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-58.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +17 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +23 -11
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +21 -16
- 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-77.js +2 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-71.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-72.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-73.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-74.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-75.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/execution.ts +131 -3
- package/src/extensions/pi-agent-text-editor/src/core/apply/mixed-source.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +14 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/output.ts +36 -5
- package/src/extensions/pi-agent-text-editor/src/core/apply/prompt.ts +5 -42
- package/src/extensions/pi-agent-text-editor/src/core/apply/renderer.ts +50 -5
- package/src/extensions/pi-agent-text-editor/src/core/apply/runtime.ts +187 -38
- package/src/extensions/pi-agent-text-editor/src/core/apply/tool.ts +3 -8
- package/src/extensions/pi-agent-text-editor/src/core/apply/transaction.ts +770 -237
- package/src/extensions/pi-agent-text-editor/src/core/builtin-edit-filter.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +0 -11
- package/src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts +5 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-config.ts +4 -4
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +9 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +0 -2
- package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +53 -0
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +11 -41
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +8 -18
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +11 -41
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +9 -19
- package/src/pi-agent-ide.ts +21 -11
- package/src/plugins/pi-agent-ide-ast/package.json +12 -11
- package/src/plugins/pi-agent-ide-ast/runtime/entry-30.js +1 -0
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +8 -6
- package/src/plugins/pi-agent-ide-changes/index.ts +8 -0
- package/src/plugins/pi-agent-ide-changes/package.json +9 -8
- package/src/plugins/pi-agent-ide-changes/runtime/entry-32.js +1 -0
- package/src/plugins/pi-agent-ide-debugger/index.ts +13 -11
- package/src/plugins/pi-agent-ide-debugger/src/adapter-executables.ts +31 -0
- package/src/plugins/pi-agent-ide-debugger/src/breakpoint-view.ts +3 -1
- package/src/plugins/pi-agent-ide-debugger/src/catalog.ts +24 -23
- package/src/plugins/pi-agent-ide-debugger/src/dap-client.ts +5 -2
- package/src/plugins/pi-agent-ide-debugger/src/doctor-plugin.ts +55 -17
- package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +55 -22
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +9 -4
- package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
- package/src/plugins/pi-agent-ide-formatter/runtime/entry-34.js +2 -0
- package/src/plugins/pi-agent-ide-formatter/src/formatter.ts +1 -1
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-languages/runtime/entry-35.js +2 -0
- package/src/plugins/pi-agent-ide-lint/index.ts +1 -1
- package/src/plugins/pi-agent-ide-lint/package.json +8 -8
- package/src/plugins/pi-agent-ide-lint/runtime/entry-36.js +2 -0
- package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +20 -2
- package/src/plugins/pi-agent-ide-lsp/index.ts +0 -3
- package/src/plugins/pi-agent-ide-lsp/package.json +10 -10
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-37.js +2 -0
- package/src/plugins/pi-agent-ide-processes/src/registry.ts +4 -0
- package/src/plugins/pi-agent-ide-processes/src/ui.ts +18 -9
- package/src/plugins/pi-agent-ide-terminal/index.ts +27 -2
- package/src/plugins/pi-agent-ide-terminal/src/process-provider.ts +1 -0
- package/src/plugins/pi-agent-ide-terminal/src/renderer.ts +27 -2
- package/src/plugins/pi-agent-ide-terminal/src/resources.ts +1 -4
- package/src/plugins/pi-agent-ide-terminal/src/search.ts +0 -3
- package/src/plugins/pi-agent-ide-terminal/src/session-manager.ts +1 -0
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +8 -5
- package/src/plugins/pi-agent-ide-terminal/src/types.ts +1 -0
- package/src/plugins/pi-agent-ide-vision/index.ts +234 -0
- package/src/plugins/pi-agent-ide-vision/src/vision.ts +530 -0
- package/src/plugins/pi-agent-ide-vision/src/windows-display-capture.ps1 +30 -0
- package/src/plugins/pi-agent-ide-vision/src/windows-window-capture.ps1 +33 -0
- package/dist/chunk-526E364R.js +0 -3
- package/dist/chunk-5PLV4HLG.js +0 -1
- package/dist/chunk-7ALCBKCW.js +0 -26
- package/dist/chunk-DQXPQOF7.js +0 -2
- package/dist/chunk-EJ5OACQM.js +0 -1
- package/dist/chunk-G725MARR.js +0 -16
- package/dist/chunk-HKXDP2FD.js +0 -7
- package/dist/chunk-IRECDTJG.js +0 -27
- package/dist/chunk-J4RTW44E.js +0 -1
- package/dist/chunk-NZYDMBM6.js +0 -1
- package/dist/chunk-WGGIQ7IJ.js +0 -1
- package/dist/entry-18.js +0 -1
- package/node_modules/pi-agent-doctor/runtime/entry-17.js +0 -1
- package/node_modules/pi-agent-doctor/runtime/entry-18.js +0 -1
- package/node_modules/pi-agent-filesystem/runtime/entry-22.js +0 -2
- package/node_modules/pi-agent-filesystem-image/runtime/entry-23.js +0 -2
- package/node_modules/pi-agent-filesystem-pdf/runtime/entry-24.js +0 -2
- package/node_modules/pi-agent-ide-ast/runtime/entry-26.js +0 -1
- package/node_modules/pi-agent-ide-changes/runtime/entry-28.js +0 -1
- package/node_modules/pi-agent-ide-formatter/runtime/entry-30.js +0 -2
- package/node_modules/pi-agent-ide-lint/runtime/entry-32.js +0 -2
- package/node_modules/pi-agent-image/runtime/entry-34.js +0 -1
- package/node_modules/pi-agent-invariant/runtime/entry-35.js +0 -1
- package/node_modules/pi-agent-pdf/runtime/entry-36.js +0 -1
- package/node_modules/pi-agent-read/runtime/entry-37.js +0 -1
- package/node_modules/pi-agent-search/runtime/entry-45.js +0 -1
- package/node_modules/pi-agent-search/runtime/entry-46.js +0 -2
- package/node_modules/pi-agent-search-text/runtime/entry-47.js +0 -2
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-51.js +0 -1
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-52.js +0 -2
- package/node_modules/pi-agent-text-editor/runtime/entry-56.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-58.js +0 -1
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-72.js +0 -2
- package/node_modules/pi-agent-text-editor-renderer/src/config.ts +0 -73
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +0 -2
- package/node_modules/pi-agent-tool-ui/runtime/entry-75.js +0 -1
- package/node_modules/pi-agent-web-image/runtime/entry-78.js +0 -2
- package/node_modules/pi-agent-web-pdf/runtime/entry-79.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-23.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-24.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-25.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-22.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-77.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-78.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-79.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-80.js +0 -2
- package/src/extensions/pi-agent-read/runtime/entry-37.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-38.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-39.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-40.js +0 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-47.js +0 -2
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-48.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-45.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-46.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-50.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-51.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-52.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-53.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-72.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/config.ts +0 -73
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +0 -2
- package/src/extensions/pi-agent-text-editor/runtime/entry-55.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-56.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-57.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-58.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-26.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-27.js +0 -2
- package/src/plugins/pi-agent-ide-changes/runtime/entry-28.js +0 -1
- package/src/plugins/pi-agent-ide-changes/runtime/entry-29.js +0 -2
- package/src/plugins/pi-agent-ide-formatter/runtime/entry-30.js +0 -2
- package/src/plugins/pi-agent-ide-lint/runtime/entry-32.js +0 -2
- /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem}/runtime/entry-25.js +0 -0
- /package/node_modules/{pi-agent-ide-ast → pi-agent-filesystem-jq}/runtime/entry-27.js +0 -0
- /package/node_modules/{pi-agent-ide-changes → pi-agent-filesystem-text}/runtime/entry-29.js +0 -0
- /package/node_modules/{pi-agent-ide-languages → pi-agent-ide-ast}/runtime/entry-31.js +0 -0
- /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-changes}/runtime/entry-33.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-image}/runtime/entry-38.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-invariant}/runtime/entry-39.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-40.js +0 -0
- /package/node_modules/{pi-agent-resource → pi-agent-read}/runtime/entry-42.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-read}/runtime/entry-43.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-read}/runtime/entry-44.js +0 -0
- /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-48.js +0 -0
- /package/node_modules/{pi-agent-text → pi-agent-search}/runtime/entry-49.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-constant → pi-agent-search}/runtime/entry-50.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-line-hash → pi-agent-text}/runtime/entry-53.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-constant}/runtime/entry-54.js +0 -0
- /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-exact}/runtime/entry-55.js +0 -0
- /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-line-hash}/runtime/entry-57.js +0 -0
- /package/node_modules/{pi-agent-tool-call-interception → pi-agent-text-editor}/runtime/entry-74.js +0 -0
- /package/node_modules/{pi-agent-web → pi-agent-text-editor-renderer}/runtime/entry-76.js +0 -0
- /package/node_modules/{pi-agent-web-html → pi-agent-text-editor-stale-anchor}/runtime/entry-77.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web}/runtime/entry-80.js +0 -0
- /package/src/extensions/{pi-agent-search → pi-agent-read}/runtime/entry-43.js +0 -0
- /package/src/extensions/{pi-agent-search → pi-agent-read}/runtime/entry-44.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-constant}/runtime/entry-54.js +0 -0
- /package/src/extensions/{pi-agent-read/extensions/pi-agent-web → pi-agent-text-editor/plugins/pi-agent-text-editor-renderer}/runtime/entry-76.js +0 -0
- /package/src/plugins/{pi-agent-ide-languages → pi-agent-ide-ast}/runtime/entry-31.js +0 -0
- /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-changes}/runtime/entry-33.js +0 -0
package/dist/entry-50.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
import{a as d}from"./chunk-L7JMDDSD.js";import{a as s,b as l,c}from"./chunk-O6LE42GK.js";import"./chunk-S3ZPXWX7.js";import{a as i}from"./chunk-5VSE5X5R.js";import{a as t}from"./chunk-EI7MMDWY.js";var o=class extends i{static{t(this,"ConstantTextAnchor")}constructor(n,r){super(n,r)}};function p(){return{id:"file-position",description:"`begin` and `end` select the first and last existing lines.",renderFull(e){return e},renderCompact(e){return e==="begin"?"file start":"file end"},tryResolve(e,n){return Promise.resolve(a(e,n))}}}t(p,"createConstantTextAnchorResolver");function a(e,n){return e!=="begin"&&e!=="end"?{kind:"not-handled"}:n.lines.length===0?{kind:"failed",error:new Error(`${e} cannot resolve in an empty file`)}:{kind:"resolved",anchor:new o(e,e==="begin"?1:n.lines.length)}}t(a,"resolveConstantAnchor");async function T(e){await d(e,{protocol:s,apiVersion:l,id:"text-anchor-constant",setup(r){r.addAnchorResolver({resolver:p(),kind:c,type:"constant"})}})}t(T,"registerConstantTextAnchors");export{T as default};
|
|
1
|
+
import{e as G,f as H,g as V}from"./chunk-GIRAEVUJ.js";import{e as C,f as D}from"./chunk-T7I2VX3J.js";import{c as $}from"./chunk-YHUTTZC6.js";import{a as L}from"./chunk-KII2JQC5.js";import{a as N,b as M,c as O,d as j,g as F}from"./chunk-7UGNGK7Y.js";import{a as o}from"./chunk-EI7MMDWY.js";import{keyText as ae}from"@earendil-works/pi-coding-agent";import{Text as I}from"@earendil-works/pi-tui";import ce from"node:os";function W(){let e=[],r,s=new Map,i=new Map,l=new Map,u=new Map,f=Promise.resolve(),c={registerPlugin(n){if(n.id.trim().length===0)return Promise.reject(new Error("Plugin ID must not be empty"));let a=u.get(n.id);if(a!==void 0)return a;let h=f.then(async()=>{let g=[],p=[],m,R,y=[],d={addSelectionProvider(t){if(m!==void 0||r!==void 0)throw new Error("Search selection provider is already registered");m=t},registerSelection(t,w){if(r===void 0)throw new Error("Search selections are unavailable. Enable the shared search selection plugin.");return r(t,w)},addResolver(t){X(t),g.push(t)},addAction(t){Z(t),p.push(t)},describe(t){if(R!==void 0)throw new Error(`Plugin ${n.id} provides more than one description`);R=q(t)},addPromptGuideline(t){y.push(q(t))},search:o((t,w,T)=>c.execute(t,w,T),"search"),runAction(t,w){return c.runAction(t.reference,t.capability,t.resolverId,t.input,w)}};await n.setup(d);let S=new Set(e.map(({registration:t})=>t.resolver.id));for(let t of g){if(S.has(t.resolver.id))throw new Error(`Search resolver ${t.resolver.id} is already registered`);S.add(t.resolver.id)}for(let t of p){let w=b(t.resolverId,t.capability);if(s.has(w)||p.some(T=>T!==t&&b(T.resolverId,T.capability)===w))throw new Error(`Search action ${w} is already registered`)}for(let t of g)e.push({pluginId:n.id,registration:t,order:e.length});m!==void 0&&(r=m);for(let t of p)s.set(b(t.resolverId,t.capability),t);R!==void 0&&l.set(n.id,R),y.length>0&&i.set(n.id,y)});return u.set(n.id,h),f=h.catch(()=>{}),h.catch(()=>{u.delete(n.id)}),h},async waitForPendingPlugins(){await Promise.all(u.values())},async execute(n,a,h="agent"){if(n.query.trim().length===0)return P("INVALID_REQUEST","Search query must not be empty");let g=[...e].sort((y,d)=>+(y.registration.fallback===!0)-+(d.registration.fallback===!0)||(y.registration.priority??0)-(d.registration.priority??0)||y.order-d.order),p=/^[a-z][\w-]*:\s*$/iu.test(n.query),m=/^[a-z][\w-]*:/iu.test(n.query);for(let y of g){if(p&&!y.registration.fallback)continue;let d=y.registration.resolver,S;try{a.signal?.throwIfAborted(),S=await d.tryResolve(n,a)}catch(t){return P("RESOLVE_FAILED",x(t,`Resolver ${d.id} failed`),d.id,t)}if(!ee(S))return P("INVALID_RESOLVER_RESULT",`Resolver ${d.id} returned an invalid result`,d.id);if(S.kind!=="not-handled"){if(S.kind==="failed")return P("RESOLVE_FAILED",x(S.error,`Resolver ${d.id} failed`),d.id,S.error);try{let t=await d.format(S.payload,a);return re(t)?{content:y.registration.fallback&&m?[{type:"text",text:p?"Search fallback: empty protocol query; searched the original text.":"Search fallback: unhandled protocol query; searched the original text."},...t.content]:t.content,details:{resolverId:d.id,payload:t.details},...h==="script"&&{script:{resolverId:d.id,data:S.payload,details:t.details}},...t.usage!==void 0&&{usage:t.usage}}:P("FORMAT_FAILED",`Resolver ${d.id} formatter returned an invalid result`,d.id)}catch(t){return P("FORMAT_FAILED",x(t,`Resolver ${d.id} formatter failed`),d.id,t)}}}let R=`No search resolver handled ${n.query}`;return G(P("NO_RESOLVER",R),R)},runAction(n,a,h,g,p){let m=s.get(b(h,a));if(m===void 0)throw new Error(`Search reference does not support ${a}`);return m.execute(n,g,p)},renderDescriptions(){return[...l.values()].flatMap(n=>{let a=J(n);return a===void 0?[]:[a]})},renderPromptGuidelines(){return[...i.values()].flat().flatMap(n=>{let a=J(n);return a===void 0?[]:[a]})},renderer(n){return e.find(({registration:a})=>a.resolver.id===n)?.registration.resolver.renderResult}};return c}o(W,"createSearchCore");function X(e){if(!A(e)||!A(e.resolver))throw new TypeError("Invalid search resolver registration");let r=e.resolver;if(typeof r.id!="string"||r.id.trim().length===0||typeof r.tryResolve!="function"||typeof r.format!="function")throw new TypeError("Invalid search resolver registration");if(e.priority!==void 0&&(typeof e.priority!="number"||!Number.isFinite(e.priority)))throw new TypeError("Invalid search resolver priority")}o(X,"assertResolver");function Z(e){if(!A(e)||typeof e.resolverId!="string"||e.resolverId.trim().length===0||typeof e.capability!="string"||e.capability.trim().length===0||typeof e.execute!="function")throw new TypeError("Invalid search action registration")}o(Z,"assertAction");function A(e){return typeof e=="object"&&e!==null}o(A,"isRecord");function ee(e){if(typeof e!="object"||e===null||!("kind"in e))return!1;let r=e.kind;return r==="not-handled"||r==="resolved"&&"payload"in e||r==="failed"&&"error"in e}o(ee,"isAttempt");function re(e){return typeof e=="object"&&e!==null&&Array.isArray(e.content)}o(re,"isAgentToolResult");function P(e,r,s,i){return{content:[{type:"text",text:r}],details:{failure:{code:e,message:r,...s!==void 0&&{resolverId:s},...i!==void 0&&{cause:i}}}}}o(P,"failure");function q(e){if(typeof e=="function")return e;if(typeof e!="string"||e.trim().length===0)throw new TypeError("Search description must not be empty");return e.trim()}o(q,"normalizeDescriptionSource");function J(e){let r=typeof e=="function"?e():e;if(r!==void 0){if(typeof r!="string"||r.trim().length===0)throw new TypeError("Search description must not be empty");return r.trim()}}o(J,"renderDescription");function b(e,r){return`${e}:${r}`}o(b,"actionKey");function x(e,r){return!(e instanceof Error)||e.message.trim().length===0?r:e instanceof SyntaxError?e.message:`${r}: ${e.message}`}o(x,"messageFor");import{readFile as te}from"node:fs/promises";import ne from"node:os";import E from"node:path";var oe=3e4;function z(e=process.env,r=ne.homedir(),s=process.cwd()){let i=e.PI_CODING_AGENT_DIR?.trim(),l=i===void 0||i.length===0?E.join(r,".pi","agent"):E.resolve(i);return{globalPath:E.join(l,"pi-agent-ide","search.json"),projectPath:E.resolve(s,".pi","pi-agent-ide","search.json")}}o(z,"resolveSearchConfigPaths");async function _(e){let[r,s]=await Promise.all([U(e.globalPath),U(e.projectPath)]),i=s!==void 0?s:r;return{timeoutMs:i===void 0?oe:i}}o(_,"loadSearchConfig");async function U(e){let r;try{r=await te(e,"utf8")}catch(u){if(ie(u))return;throw new Error(`Cannot read Pi Agent IDE search config at ${e}`,{cause:u})}let s;try{s=JSON.parse(r)}catch(u){throw new Error(`Invalid JSON in Pi Agent IDE search config at ${e}`,{cause:u})}if(!K(s))throw new TypeError(`Pi Agent IDE search config at ${e} must be a JSON object`);let i=Object.keys(s).find(u=>u!=="timeoutMs");if(i!==void 0)throw new TypeError(`Pi Agent IDE search config at ${e} contains unknown key ${i}`);let l=s.timeoutMs;if(l==null)return l;if(typeof l!="number"||!Number.isSafeInteger(l)||l<=0)throw new TypeError(`timeoutMs must be a positive integer or null in Pi Agent IDE search config at ${e}`);return l}o(U,"readTimeout");function ie(e){return K(e)&&e.code==="ENOENT"}o(ie,"isMissingFile");function K(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(K,"isRecord");var B=Symbol("search-timeout"),k=class extends Error{static{o(this,"SearchTimeoutError")}constructor(r){super(r),this.name="SearchTimeoutError"}};async function Q(e,r,s){if(e===null)return s(r);let i=new AbortController,l=r===void 0?i.signal:AbortSignal.any([r,i.signal]),u,f=new Promise(c=>{u=setTimeout(()=>{c(B),i.abort()},e)});try{let c=await Promise.race([s(l),f]);if(c===B)throw new k(`Search timed out after ${se(e)}. Try a smaller path scope.`);return c}finally{clearTimeout(u)}}o(Q,"runWithSearchTimeout");function se(e){if(e%1e3!==0)return`${String(e)}ms`;let r=e/1e3;return`${String(r)} ${r===1?"second":"seconds"}`}o(se,"formatDuration");function de(e,r){let s=[...e.path===void 0?[]:[{text:`in ${e.path}`,color:"accent",underline:!0,truncate:"start"}],...e.include===void 0?[]:[{text:`include ${e.include}`}],...e.exclude===void 0?[]:[{text:`exclude ${e.exclude}`}],...e.caseSensitive===!0?[{text:"case sensitive"}]:[],...e.wholeWord===!0?[{text:"whole word"}]:[],...e.limit===void 0?[]:[{text:`limit ${String(e.limit)}`}]];return{tool:"search",primary:{text:JSON.stringify(e.query),color:"accent",truncate:"end"},qualifiers:s,details:ue(e),expanded:r}}o(de,"searchCallModel");function le(e){return e==="full"||e==="disabled"?e:"compact"}o(le,"parsePresentation");async function Y(e,r){let s=le(r?.preferences["ui.search"]);D(e,[await C({id:"search-code",description:"Text search, AST patterns, symbols, graphs, and semantic rename",triggers:[{tool:"search"},{tool:"read",resourcePrefixes:["ast:","symbol:","symbols:","graph:"]}]})]);let i=W(),l=new H,u=e.events.on(j,f=>{if(!F(f))throw new Error("Invalid pi-agent-search plugin registration request");f.accept(i.registerPlugin(f.plugin))});e.on("session_shutdown",u),e.registerTool(V({name:"search",label:"search",description:"Use search to locate workspace text, file paths, and code structures.",promptSnippet:"Search files and text with literals or regular expressions, plus syntax trees and language symbols",get promptGuidelines(){return["Use the narrowest useful search query and scope; broaden when needed.",...i.renderPromptGuidelines()]},parameters:L,renderCall(f,c,n){let a=n.expanded?"full":s;return a==="disabled"?new I(c.fg("toolTitle","search"),0,0):$(n.lastComponent,de(f,a==="full"),c)},renderResult(f,c,n,a){let h=c.expanded?"full":s;if(h==="disabled"&&!a.isError&&!c.isPartial)return new I(n.fg("success","\u2713 search"),0,0);c={...c,expanded:h==="full"};let g=f.details,p=g?.resolverId===void 0?void 0:i.renderer(g.resolverId);if(p!==void 0){let m={...f,details:g?.payload};return p(m,c,n,a)}return fe(f,c,n)},async execute(f,c,n,a,h){let g=await _(z(process.env,ce.homedir(),h.cwd));return Q(g.timeoutMs,n,async p=>(await i.waitForPendingPlugins(),i.execute(c,{cwd:h.cwd,...p!==void 0&&{signal:p},...a!==void 0&&{onUpdate:o(m=>{a(m)},"onUpdate")}})))}},l)),e.events.emit(O,{protocol:N,apiVersion:M}),await i.waitForPendingPlugins()}o(Y,"registerSearchCore");function ue(e){return[{label:"query",value:JSON.stringify(e.query)},...v("path",e.path),...v("include",e.include),...v("exclude",e.exclude),...v("caseSensitive",e.caseSensitive===void 0?void 0:String(e.caseSensitive)),...v("wholeWord",e.wholeWord===void 0?void 0:String(e.wholeWord)),...v("limit",e.limit===void 0?void 0:String(e.limit))]}o(ue,"searchCallDetails");function v(e,r){return r===void 0?[]:[{label:e,value:r}]}o(v,"optionalDetail");function fe(e,r,s){let i=e.content.flatMap(f=>f.type==="text"?[f.text]:[]).join(`
|
|
2
|
+
`),l=r.expanded?i:i.split(`
|
|
3
|
+
`).slice(0,8).join(`
|
|
4
|
+
`),u=!r.expanded&&i.split(`
|
|
5
|
+
`).length>8?`
|
|
6
|
+
${s.fg("dim",`${ae("app.tools.expand")} to expand`)}`:"";return new I(`${s.fg("muted",l)}${u}`,0,0)}o(fe,"fallbackResult");export{Y as default};
|
package/dist/entry-51.js
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
import{a,b,c}from"./chunk-
|
|
1
|
+
import{a as x,b as J,c as X,d as fe,h as Q}from"./chunk-P7XO5CIP.js";import"./chunk-GUTQ3PWL.js";import{a as H}from"./chunk-MGCHOGQD.js";import{a as F,b as I}from"./chunk-T6LX2RX5.js";import{a as W}from"./chunk-L7JMDDSD.js";import{a as _,b as j,d as B}from"./chunk-O6LE42GK.js";import"./chunk-S3ZPXWX7.js";import{a as z}from"./chunk-ZTYWHL2F.js";import{a as G,b as V}from"./chunk-7UGNGK7Y.js";import{t as L,u as O}from"./chunk-5VSE5X5R.js";import{d as N,e as v}from"./chunk-N34ATN52.js";import{a as M}from"./chunk-ZC65Z3CK.js";import{a as c}from"./chunk-EI7MMDWY.js";var U={protocol:F,apiVersion:1,id:"search-text",setup(e){e.addSetupCheck({id:"ripgrep",async inspect(t){let r=x(t.env.PI_CODING_AGENT_DIR);return await N(r,t.cwd,t.env)?{}:{actions:[{id:"ripgrep-unavailable",message:"Local search is unavailable because ripgrep was not found"}]}}}),e.addCheck({id:"ripgrep",title:"Local search",async run(t){let r=t.env.PI_CODING_AGENT_DIR,n=x(r),a=await v(n,["--version"],t.cwd,t.env);return[a.ok?{status:"pass",message:"ripgrep is available",detail:a.detail}:{status:"fail",message:"ripgrep is not available",detail:a.detail}]}})}};import ce from"node:path";import{spawn as ge}from"node:child_process";import T from"node:path";function Y(e,t,r,n){let a=t.limit??100,o=["--files","--hidden","--no-config","--no-ignore-parent","--glob","!.git/**"];for(let i of K(t.include))o.push("--glob",i);for(let i of K(t.exclude))o.push("--glob",`!${i}`);return t.path!==void 0&&o.push(t.path),new Promise((i,s)=>{let l=ge(x(),o,{cwd:r,stdio:["ignore","pipe","pipe"]}),u="",h="";l.stdout.setEncoding("utf8"),l.stderr.setEncoding("utf8"),l.stdout.on("data",d=>u+=d),l.stderr.on("data",d=>h+=d);let p=c(()=>{l.kill("SIGTERM")},"abort");n?.addEventListener("abort",p,{once:!0}),l.once("error",s),l.once("close",d=>{if(n?.removeEventListener("abort",p),n?.aborted===!0){s(n.reason instanceof Error?n.reason:new Error("File search aborted"));return}if(d!==0&&d!==1){s(new Error(h.trim()||`rg exited with code ${String(d)}`));return}let g=u.split(`
|
|
2
|
+
`).filter(Boolean).map(m=>T.relative(r,T.resolve(r,m))).filter(m=>ye(m,e)).sort((m,b)=>m.localeCompare(b));i({files:g.slice(0,a),complete:g.length<=a})})})}c(Y,"searchFiles");function K(e){return e?.split(",").map(t=>t.trim()).filter(Boolean)??[]}c(K,"splitGlobs");function ye(e,t){if(/[*?[\]{}]/u.test(t)){let r=t.replace(/^\.\//u,"");return T.matchesGlob(r.includes("/")?e:T.basename(e),r)}return Se(e,t)}c(ye,"matchFile");function Se(e,t){if(t.length===0)return!0;let r=0,n=e.toLowerCase();for(let a of t.toLowerCase()){if(r=n.indexOf(a,r),r===-1)return!1;r+=1}return!0}c(Se,"fuzzyMatch");import Te from"node:path";import{keyText as ie}from"@earendil-works/pi-coding-agent";import{Text as $e,truncateToWidth as C,visibleWidth as f,wrapTextWithAnsi as Ae}from"@earendil-works/pi-tui";import Z from"node:path";import{pathToFileURL as ee}from"node:url";function $(e,t){let r=new Map;for(let s of e){let l=r.get(s.source)??[];l.push(s),r.set(s.source,l)}let n=new Set,a=e.length,o=[...r].sort(([s,l],[u,h])=>h.length-l.length||s.localeCompare(u));for(let[s,l]of o){if(a<=t)break;n.add(s),a-=l.length}return{files:[...r].sort(([s],[l])=>s.localeCompare(l)).map(([s,l])=>{if(!n.has(s))return{kind:"detailed",source:s,matches:l};let u=new Map;for(let h of l)u.set(h.lineText,(u.get(h.lineText)??0)+1);return{kind:"compacted",source:s,matchCount:l.length,uniqueLineCount:u.size,groups:r.size===1?[...u].sort(([h,p],[d,g])=>g-p||h.localeCompare(d)).slice(0,t).map(([h,p])=>({text:h,matchCount:p})):[]}})}}c($,"planSearchPresentation");function E(e,t,r,n,a,o=50){let s=$(t,o).files.map(l=>l.kind==="detailed"?be(l.source,l.matches,n):{path:te(l.source,n),link:ee(l.source).href,matchCount:l.matchCount,uniqueLineCount:l.uniqueLineCount,groups:l.groups,lines:[]});return{...a!==void 0&&{sessionId:a},query:e,matchCount:t.length,fileCount:s.length,complete:r,files:s}}c(E,"createSearchToolDetails");function A(e){if(!R(e)||typeof e.query!="string"||!y(e.matchCount)||!y(e.fileCount)||typeof e.complete!="boolean"||e.sessionId!==void 0&&typeof e.sessionId!="string"||!Array.isArray(e.files)||!e.files.every(xe))return!1;let t=e.files;return e.fileCount===t.length&&e.matchCount===t.reduce((r,n)=>r+n.matchCount,0)}c(A,"isSearchToolDetails");function be(e,t,r){let n=new Map;for(let o of t){let i=n.get(o.lineNumber);if(i!==void 0&&i.text!==o.lineText)throw new Error(`Search results disagree about line ${String(o.lineNumber)} in ${e}.`);let s=i??{lineNumber:o.lineNumber,text:o.lineText,ranges:[]};s.ranges.push({from:o.startColumn,to:o.endColumn}),n.set(o.lineNumber,s)}let a=[...n.values()].sort((o,i)=>o.lineNumber-i.lineNumber).map(o=>{let i=[...o.ranges].sort((s,l)=>s.from-l.from||s.to-l.to);return{lineNumber:o.lineNumber,text:o.text,matchCount:i.length,ranges:i}});return{path:te(e,r),link:ee(e).href,matchCount:t.length,lines:a}}c(be,"createSearchResultFile");function xe(e){if(!R(e)||typeof e.path!="string"||typeof e.link!="string"||!y(e.matchCount)||!Array.isArray(e.lines)||!e.lines.every(Re))return!1;let t=e.lines,r=e.groups;return(r===void 0||Array.isArray(r)&&r.every(n=>R(n)&&typeof n.text=="string"&&y(n.matchCount)))&&(e.uniqueLineCount===void 0||y(e.uniqueLineCount))&&(t.length===0||e.matchCount===t.reduce((n,a)=>n+a.matchCount,0))}c(xe,"isSearchResultFile");function Re(e){return R(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.ranges.every(t=>Ce(t,e.text))}c(Re,"isSearchResultLine");function Ce(e,t){return R(e)&&Number.isSafeInteger(e.from)&&Number.isSafeInteger(e.to)&&e.from>=0&&e.to>e.from&&e.to<=t.length}c(Ce,"isSearchResultRange");function R(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}c(R,"isRecord");function y(e){return Number.isSafeInteger(e)&&e>=0}c(y,"isCount");function te(e,t){let r=Z.relative(t,e);return r.length>0&&!r.startsWith("..")&&!Z.isAbsolute(r)?r:e}c(te,"displaySource");function re(e){return e.replaceAll("\u27E6","").replaceAll("\u27E7","")}c(re,"sourceText");function ne(e,t){let{files:r,...n}=e,a=re(t);return{...n,storedFiles:r.map(({lines:o,...i})=>({...i,lines:o.map(s=>[s.lineNumber,L(s.text,a),s.ranges])}))}}c(ne,"compactSearchDetails");function oe(e,t){if("files"in e)return e;let{storedFiles:r,...n}=e,a=re(t);return{...n,files:r.map(({lines:o,...i})=>({...i,lines:o.map(([s,l,u])=>({lineNumber:s,text:O(l,a),ranges:u,matchCount:u.length}))}))}}c(oe,"restoreSearchDetails");var ae=new WeakMap,k=12,we={".ts":{label:"TS",color:"accent"},".tsx":{label:"TX",color:"accent"},".js":{label:"JS",color:"warning"},".jsx":{label:"JX",color:"warning"},".json":{label:"{}",color:"warning"},".md":{label:"MD",color:"mdHeading"},".py":{label:"PY",color:"accent"},".rs":{label:"RS",color:"accent"},".go":{label:"GO",color:"accent"},".css":{label:"CS",color:"accent"},".html":{label:"<>",color:"accent"}};function se(e,t,r,n){if(typeof e.details=="object"){let i=ae.get(e.details);i===void 0&&(i=oe(e.details,e.content.flatMap(s=>s.type==="text"?[s.text]:[]).join(`
|
|
3
|
+
`)),ae.set(e.details,i)),e={...e,details:i}}if(t.isPartial||n.isError||!A(e.details)){let i=e.content[0],s=i?.type==="text"?i.text:"",l=n.isError?"error":t.isPartial?"dim":"toolOutput";return new $e(r.fg(l,s),0,0)}let o=(n.lastComponent instanceof q?n.lastComponent:void 0)??new q(e.details,r,t.expanded);return o.update(e.details,r,t.expanded),o}c(se,"renderSearchResult");var q=class{constructor(t,r,n){this.details=t;this.theme=r;this.expanded=n}static{c(this,"SearchResultPanel")}cached;update(t,r,n){this.details===t&&this.theme===r&&this.expanded===n||(this.details=t,this.theme=r,this.expanded=n,this.invalidate())}render(t){if(this.cached?.width===t)return this.cached.lines;if(t<4){let u=[C(le(this.details),Math.max(1,t))];return this.cached={width:t,lines:u},u}let r=t-2,n=ke(this.details,this.expanded),a=Fe(this.details.files),o=n.flatMap(u=>Ee(u,r,a,this.theme)),i=qe(o,this.expanded,r,this.theme),s=[Le(this.details,r,this.theme),...i];s.push(this.theme.fg("borderMuted",`\u2570${"\u2500".repeat(r)}\u256F`));let l=s.map(u=>C(u,t));return this.cached={width:t,lines:l},l}invalidate(){this.cached=void 0}};function ke(e,t){let r=e.files.length===0?[{kind:"empty"}]:e.files.flatMap(o=>[{kind:"file",file:o},...o.uniqueLineCount===void 0?o.lines.map(i=>({kind:"line",file:o,line:i})):[{kind:"summary",text:`${String(o.uniqueLineCount)} unique line texts \xB7 search this path with a narrower query`},...(o.groups??[]).map(i=>({kind:"summary",text:`\xD7${String(i.matchCount)} ${i.text}`}))]]);if(t||r.length<=k)return r;let n=r.slice(0,k-1);for(;n.at(-1)?.kind==="file";)n.pop();let a=n.reduce((o,i)=>o+(i.kind==="line"?i.line.matchCount:0),0);return[...n,{kind:"omitted",matches:e.matchCount-a}]}c(ke,"searchViewport");function qe(e,t,r,n){if(t||e.length<=k)return e;let a=`${ie("app.tools.expand")} to expand`,o=S(n.fg("dim",` \u2026 output truncated \xB7 ${a}`),r,n);return[...e.slice(0,k-1),o]}c(qe,"compactRenderedRows");function Ee(e,t,r,n){if(e.kind==="file")return[S(Pe(e.file,t,n),t,n,!0)];if(e.kind==="line")return De(e.line,t,r,n);if(e.kind==="summary")return[S(n.fg("dim",` ${w(e.text)}`),t,n)];if(e.kind==="omitted"){let a=`${ie("app.tools.expand")} to expand`;return[S(n.fg("dim",` \u2026 ${String(e.matches)} more ${P(e.matches,"match","matches")} \xB7 ${a}`),t,n)]}return[S(n.fg("dim"," No matches found"),t,n)]}c(Ee,"renderPanelRow");function Pe(e,t,r){let n=Oe(e.path,r),a=r.fg("accent",r.bold(String(e.matchCount))),o=f(n)+f(a)+4,i=Math.max(1,t-o),s=ve(e.path,i),l=Ne(s,e.link,r),u=` ${n} ${l}`,h=" ".repeat(Math.max(1,t-f(u)-f(a)-1));return C(`${u}${h}${a} `,t)}c(Pe,"renderFileHeader");function De(e,t,r,n){let a=String(e.lineNumber).padStart(r),o=` ${n.fg("dim",a)} ${n.fg("borderMuted","\u2502")} `,i=Math.max(1,t-f(o)-1),s=Ae(Me(e,n),i),l=" ".repeat(f(o));return s.map((u,h)=>S(`${h===0?o:l}${u}`,t,n))}c(De,"renderMatchLine");function Me(e,t){let r="",n=0;for(let a of e.ranges){a.from>n&&(r+=t.fg("toolOutput",w(e.text.slice(n,a.from))));let o=w(e.text.slice(a.from,a.to));r+=t.bg("selectedBg",t.fg("accent",t.bold(o))),n=a.to}return n<e.text.length&&(r+=t.fg("toolOutput",w(e.text.slice(n)))),r}c(Me,"renderHighlightedLine");function Le(e,t,r){let n=c(i=>r.fg("borderMuted",i),"frame"),a=C(` ${le(e)} `,Math.max(0,t-1),""),o="\u2500".repeat(Math.max(0,t-f(a)-1));return`${n("\u256D\u2500")}${r.fg("accent",a)}${n(`${o}\u256E`)}`}c(Le,"renderTopBorder");function le(e){return e.matchCount===0?"No matches":`${`${String(e.matchCount)}${e.complete?"":"+"}`} ${P(e.matchCount,"match","matches")} in ${String(e.fileCount)} ${P(e.fileCount,"file","files")}`}c(le,"searchSummary");function S(e,t,r,n=!1){let a=C(e,t),o=`${a}${" ".repeat(Math.max(0,t-f(a)))}`,i=n?r.bg("selectedBg",o):o,s=r.fg("borderMuted","\u2502");return`${s}${i}${s}`}c(S,"framed");function Oe(e,t){let r=Te.extname(e).toLowerCase(),n=we[r]??{label:"\u25C7 ",color:r.length===0?"muted":"accent"};return t.fg(n.color,t.bold(n.label))}c(Oe,"fileBadge");function Ne(e,t,r){let n=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\")),a=n===-1?"":e.slice(0,n+1),o=n===-1?e:e.slice(n+1),i=r.fg("muted",a)+r.underline(r.fg("accent",o));return t.includes("\x07")||t.includes("\x1B")?i:`\x1B]8;;${t}\x07${i}\x1B]8;;\x07`}c(Ne,"fileLink");function ve(e,t){return f(e)<=t?e:t<=1?"\u2026":`\u2026${e.slice(-(t-1))}`}c(ve,"truncatePath");function w(e){let t="";for(let r of e){if(r===" "){t+=" ".repeat(4);continue}let n=M(r.codePointAt(0));t+=n<32||n===127?"\uFFFD":r}return t}c(w,"safeText");function Fe(e){let t=1;for(let r of e)for(let n of r.lines)t=Math.max(t,n.lineNumber);return Math.max(3,String(t).length)}c(Fe,"maximumLineNumberWidth");function P(e,t,r){return e===1?t:r}c(P,"plural");function de(e){return pe("text",e,J)}c(de,"createTextResolver");function he(e){return pe("regex",e,t=>t.query.startsWith("regex:")?{...t,query:t.query.slice(6),regex:!0}:void 0)}c(he,"createRegexResolver");function me(){return{id:"files",async tryResolve(e,t){if(!e.query.startsWith("files:"))return{kind:"not-handled"};let r=e.query.slice(6).trim(),n=await Y(r,e,t.cwd,t.signal);return{kind:"resolved",payload:{query:r,...n}}},format(e){let t=e;return{content:[{type:"text",text:[t.complete?`${String(t.files.length)} files`:`${String(t.files.length)}+ files (limit reached)`,...t.files].join(`
|
|
4
|
+
`)}],details:{query:t.query,files:t.files,complete:t.complete}}}}}c(me,"createFileResolver");function pe(e,t,r){return{id:e,async tryResolve(n,a){let o=r(n);if(o===void 0)return{kind:"not-handled"};let i=await X(o,a.cwd,a.signal);return{kind:"resolved",payload:{request:{...n,query:i.query},...i,recipe:{...o,originalQuery:n.query}}}},async format(n,a){let o=n;if(o.matches.length===0)return{content:[{type:"text",text:[...o.notices,"No matches found."].join(`
|
|
5
|
+
`)}],details:E(o.request.query,[],o.complete,a.cwd)};let i=o.request.limit??50,s=await t.registerIfCurrent(o.request.query,o.matches,o.complete,a.cwd,a.signal,o.recipe),l=s??{query:o.request.query,matches:o.matches,complete:o.complete};return{content:[{type:"text",text:[...o.notices,Ie(l,a.cwd,i,s!==void 0)].join(`
|
|
6
|
+
`)}],details:E(l.query,l.matches,l.complete,a.cwd,s?.id,i)}},renderResult:se}}c(pe,"createMatchResolver");function Ie(e,t,r,n=!0){let a=new Set(e.matches.map(p=>p.source)).size,o=e.matches.length,i=`${String(o)}${e.complete?"":"+"} ${ue(o,"match","matches")} in ${String(a)} ${ue(a,"file","files")}`,s=n?e.complete?`SEARCH#${e.id}:all:line / SEARCH#${e.id}:all:match \u2014 ${i}`:`${i} (limit reached; no all anchors were registered)`:`${i} (files changed during search; results shown without anchors)`,l=n?["Anchors: SEARCH#HASH:N:line (line), SEARCH#HASH:N:match (exact match), SEARCH#HASH:all:line (each unique containing line), SEARCH#HASH:all:match (every exact match)",s]:[s],u=new Map(e.matches.map((p,d)=>[p,d+1])),h=$(e.matches,r);for(let[p,d]of h.files.entries()){p>0&&l.push("");let g=je(d.source,t);if(d.kind==="compacted"){l.push(`${g}: ${String(d.matchCount)} matches across ${String(d.uniqueLineCount)} unique line texts (compacted)`);for(let m of d.groups)l.push(` \xD7${String(m.matchCount)} ${_e(m.text)}`);d.groups.length<d.uniqueLineCount&&l.push(` \u2026 ${String(d.uniqueLineCount-d.groups.length)} more unique line texts`),l.push(` Search again with path: ${JSON.stringify(g)} and a narrower query to see individual matches.`);continue}for(let m of d.matches){let b=u.get(m);if(b===void 0)continue;let D=`${g}:${String(m.lineNumber)}:${String(m.startColumn+1)}-${String(m.endColumn+1)}`;l.push(n?`${D} SEARCH#${e.id}:${String(b)}:line SEARCH#${e.id}:${String(b)}:match`:D,` ${He(m)}`)}}return l.join(`
|
|
7
|
+
`)}c(Ie,"formatSearchSession");function He(e){let r=Math.max(0,e.startColumn-64),n=Math.min(e.lineText.length,e.endColumn+64);return`${r>0?"\u2026":""}${e.lineText.slice(r,e.startColumn)}\u27E6${e.lineText.slice(e.startColumn,e.endColumn)}\u27E7${e.lineText.slice(e.endColumn,n)}${n<e.lineText.length?"\u2026":""}`}c(He,"previewMatch");function _e(e){return`${e.slice(0,129)}${e.length>129?"\u2026":""}`}c(_e,"previewLine");function je(e,t){let r=ce.relative(t,e);return r.length>0&&!r.startsWith("..")&&!ce.isAbsolute(r)?r:e}c(je,"displaySource");function ue(e,t,r){return e===1?t:r}c(ue,"plural");async function Be(e){let t=new Q;e.on("tool_result",async(r,n)=>{if(r.toolName!=="replace"||r.isError||typeof r.details!="object"||r.details===null)return;let a="metadata"in r.details?r.details.metadata:void 0,o=a&&typeof a=="object"&&"searchObservations"in a?a.searchObservations:void 0,i=Array.isArray(o)?o:await t.observeAfterEdit([r.input.path,r.input.start,r.input.end],n.signal);if(i.length!==0)return{content:[...r.content,{type:"text",text:["Original search observed after editing (not task validation):",...i.map(s=>{let{query:l,fallbacks:u,...h}=s.scope;return[`SEARCH#${s.sessionId}: ${JSON.stringify(s.query)}`,`Scope and options: ${JSON.stringify(h)}`,s.error===void 0?`Matches: ${s.matches}${s.complete===!0?"; complete search.":"+; incomplete search, lower bound only."}`:`Search failed: ${s.error}. Applied edits remain applied.`,...s.notices??[]].join(`
|
|
8
|
+
`)})].join(`
|
|
9
|
+
`)}],details:{...r.details,searchObservations:i}}}),e.on("tool_result",r=>{if(r.toolName!=="search"||typeof r.details!="object"||r.details===null)return;let n=r.details;if(A(n.payload))return{details:{...n,payload:ne(n.payload,r.content.flatMap(a=>a.type==="text"?[a.text]:[]).join(`
|
|
10
|
+
`))}}}),await Promise.all([H(e,U),z(e,{protocol:G,apiVersion:V,id:"local",setup(r){r.addSelectionProvider((n,a)=>t.register(n.request.query,n.matches,n.complete,a.cwd,a.signal,{...n.request,regex:!1},n.refresh)),r.addResolver({resolver:he(t),priority:-10}),r.addResolver({resolver:me(),priority:-10}),r.addResolver({resolver:de(t),fallback:!0}),r.describe(["Local queries try literal terms first, then unquoted terms as regex when no literal results exist, then separate words for ordinary multi-word queries. Quoted terms stay literal. Boolean conditions stay intact across fallback. Uppercase AND/OR, infix NOT, ||, and space-separated | are Boolean operators; unspaced | and regex groups/classes belong to regex terms. Parentheses containing Boolean operators group Boolean conditions. regex:<pattern> forces regex-only matching; files:<pattern> searches file paths: glob patterns use *, **, ?, character classes and braces; other queries use case-insensitive subsequence matching. Slash-containing globs match cwd-relative paths; basename globs match at any depth.","The result says when a query was broadened. Empty or unknown prefixes are searched as plain text. A recognized prefixed query returns its own results or error; it does not silently become a text search.","SEARCH#HASH:N:line selects one containing line; :match selects its exact match. :all:line selects all unique containing lines and :all:match selects all matches. Read returns containing lines for both forms. A SEARCH resource can be used as a read path or mutation path/anchor; omit the file path for an all-selection spanning files.","Use SEARCH references exactly as returned to select the matching content. A single-result reference becomes stale when its file changes; obtain a fresh result before using it again. An :all reference refreshes the original query when a selected file changes. Search compacts noisy files when the detail limit is exceeded; narrow the query to that file to see individual matches. Compaction does not remove complete :all selections."].join(`
|
|
11
|
+
`))}}),W(e,{protocol:_,apiVersion:j,id:"search-anchors",setup(r){r.tool("replace").addHandler({stage:"text-post-edit",async handler(n){if(!n.result||typeof n.result!="object"||!("kind"in n.result)||n.result.kind!=="completed"||!n.input||typeof n.input!="object")return n;let a=n.input,o=await t.observeAfterEdit([a.path,a.start,a.end],n.signal);return o.length===0?n:{...n,metadata:{...n.metadata,searchObservations:o}}}}),r.addAnchorResolver({resolver:t.anchorResolver(),resources:t.resourceResolver(),kind:B,type:"auxiliary",describeInPrompt:!1})}})])}c(Be,"registerTextSearch");export{fe as createSearchSessionId,Be as default};
|
package/dist/entry-52.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d as a,e as b,f as c,g as d,h as e}from"./chunk-P7XO5CIP.js";import"./chunk-GUTQ3PWL.js";import"./chunk-5VSE5X5R.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{e as SearchSessionStore,d as SearchSnapshotChangedError,c as allocateSearchSessionId,a as createSearchSessionId,b as createSearchSessionIdentity};
|
package/dist/entry-53.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u}from"./chunk-5VSE5X5R.js";import"./chunk-EI7MMDWY.js";export{a as TextAnchor,b as attachTextAnchorRenderer,p as createTextContentConverter,m as createTextDocument,c as getTextAnchorRenderer,i as getTextSourceLine,g as isTextAnchorRecoveryOutcome,f as isTextAnchorResolutionAttempt,e as isTextAnchorResolver,k as isTextLinePresenter,l as isTextPresenterRegistration,s as isTextTargetResolutionAttempt,q as isTextualMediaType,o as renderPresentedTextDocument,h as renderPresentedTextRows,d as renderTextAnchor,n as renderTextDocument,u as restoreText,t as storeText,r as textFromAgentContent,j as withTextSourceLine};
|
package/dist/entry-54.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as d}from"./chunk-L7JMDDSD.js";import{a as s,b as l,c}from"./chunk-O6LE42GK.js";import"./chunk-S3ZPXWX7.js";import{a as i}from"./chunk-5VSE5X5R.js";import{a as t}from"./chunk-EI7MMDWY.js";var o=class extends i{static{t(this,"ConstantTextAnchor")}constructor(n,r){super(n,r)}};function p(){return{id:"file-position",description:"`begin` and `end` select the first and last existing lines.",renderFull(e){return e},renderCompact(e){return e==="begin"?"file start":"file end"},tryResolve(e,n){return Promise.resolve(a(e,n))}}}t(p,"createConstantTextAnchorResolver");function a(e,n){return e!=="begin"&&e!=="end"?{kind:"not-handled"}:n.lines.length===0?{kind:"failed",error:new Error(`${e} cannot resolve in an empty file`)}:{kind:"resolved",anchor:new o(e,e==="begin"?1:n.lines.length)}}t(a,"resolveConstantAnchor");async function T(e){await d(e,{protocol:s,apiVersion:l,id:"text-anchor-constant",setup(r){r.addAnchorResolver({resolver:p(),kind:c,type:"constant"})}})}t(T,"registerConstantTextAnchors");export{T as default};
|
package/dist/entry-55.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{a,b,c}from"./chunk-ZM4L5AGN.js";import"./chunk-GUTQ3PWL.js";import"./chunk-5VSE5X5R.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as createExactTextAnchorResolver,c as findExactTextMatches,b as resolveExactTextAnchor};
|
package/dist/entry-56.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as m}from"./chunk-ZM4L5AGN.js";import"./chunk-GUTQ3PWL.js";import{a as f}from"./chunk-L7JMDDSD.js";import{a as c,b as u,d as s}from"./chunk-O6LE42GK.js";import"./chunk-S3ZPXWX7.js";import"./chunk-5VSE5X5R.js";import"./chunk-ZC65Z3CK.js";import{a as i}from"./chunk-EI7MMDWY.js";import{readFileSync as z}from"node:fs";import w from"node:path";function x(e){let n=b(e.settings,"recovery.exactText");n!==void 0&&p(n,["fuzzyEnabled","threshold","exactCandidateLimit","fuzzyCandidateLimit","maxFileSizeMiB","maxQuerySizeKiB","seedLimit","blockLineVariance"],"recovery.exactText");let t=i(o=>n===void 0?void 0:n[o],"value");return{fuzzyEnabled:g(t("fuzzyEnabled"),"fuzzyEnabled")??!0,threshold:d(t("threshold"),"threshold",0,1)??.8,exactCandidateLimit:a(t("exactCandidateLimit"),"exactCandidateLimit",1,100)??20,fuzzyCandidateLimit:a(t("fuzzyCandidateLimit"),"fuzzyCandidateLimit",1,20)??5,maxFileSizeMiB:d(t("maxFileSizeMiB"),"maxFileSizeMiB",.01,100)??20,maxQuerySizeKiB:d(t("maxQuerySizeKiB"),"maxQuerySizeKiB",.01,4096)??1024,seedLimit:a(t("seedLimit"),"seedLimit",1,10)??3,blockLineVariance:a(t("blockLineVariance"),"blockLineVariance",0,10)??2,contextLines:e.contextLines,timeoutMs:e.timeoutMs}}i(x,"parseExactTextRecoveryConfig");function l(e,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError(`${n} must be an object`);return Object.fromEntries(Object.entries(e))}i(l,"objectRecord");function b(e,n){return e===void 0?void 0:l(e,n)}i(b,"optionalObject");function p(e,n,t){let o=new Set(n),r=Object.keys(e).find(y=>!o.has(y));if(r!==void 0)throw new TypeError(`${t} contains unknown key ${r}`)}i(p,"assertKeys");function g(e,n){if(e===void 0||typeof e=="boolean")return e;throw new TypeError(`${n} must be a boolean`)}i(g,"optionalBoolean");function d(e,n,t,o){if(e!==void 0){if(typeof e!="number"||!Number.isFinite(e)||e<t||e>o)throw new RangeError(`${n} must be between ${t} and ${o}`);return e}}i(d,"optionalNumber");function a(e,n,t,o){let r=d(e,n,t,o);if(r!==void 0&&!Number.isInteger(r))throw new TypeError(`${n} must be an integer`);return r}i(a,"optionalInteger");async function E(e){await f(e,{protocol:c,apiVersion:u,id:"text-anchor-exact",setup(t){t.addAnchorResolver({resolver:m(x(t.recoveryConfig("exactText"))),kind:s,type:"auxiliary",describeInPrompt:!1,priority:1e4})}})}i(E,"registerExactTextAnchor");export{E as default};
|
package/dist/entry-57.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-QDST6VIU.js";import"./chunk-5VSE5X5R.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{b as createLineHashAnchor,e as createLineHashAnchorResolver,c as formatLineHashAnchor,a as hashLine,d as renderLineHashLines};
|
package/dist/entry-58.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as x,e as T}from"./chunk-QDST6VIU.js";import{a as P}from"./chunk-L7JMDDSD.js";import{a as u,b as h,c as f}from"./chunk-O6LE42GK.js";import{a as l}from"./chunk-6CZO43OH.js";import{a as d,b as m}from"./chunk-OBNING2A.js";import"./chunk-S3ZPXWX7.js";import{i as p}from"./chunk-5VSE5X5R.js";import"./chunk-ZC65Z3CK.js";import{a}from"./chunk-EI7MMDWY.js";function g(){return{id:"line-hash",present(n,o){let i=n.lines.map(e=>{let t=o.resolvedBy==="filesystem"?{lineNumber:e.lineNumber,content:e.content}:p(e);return t===void 0?void 0:{anchor:x(t.lineNumber,t.content),lineNumber:t.lineNumber}}),c=Math.max(0,...i.map(e=>e?.anchor.value.length??0)),r=Math.max(0,...i.map(e=>String(e?.lineNumber??"").length)),E=n.lines.map((e,t)=>{let s=i[t];return s===void 0?e:{...e,anchors:[...new Set([...e.anchors??[],s.anchor.value])],presentation:{...e.presentation,prefix:`${s.anchor.value.padStart(c)}|${e.presentation?.prefix??""}`,compactPrefix:e.presentation?.compactPrefix??`${String(s.lineNumber).padStart(r)} \u2502 `}}});return{...n,lines:E}}}}a(g,"createLineHashPresenter");async function R(n){let o=g(),i={protocol:d,apiVersion:m,id:"text-anchor-line-hash",setup(r){r.addView({view:"anchors",presenter:o}),r.describe('views: ["anchors"] \u2014 LINE#HASH references for editing individual source lines.')}},c={protocol:u,apiVersion:h,id:"text-anchor-line-hash",setup(r){r.addAnchorResolver({resolver:T(),kind:f,type:"major"}),r.addTextPresenter({presenter:o})}};await Promise.all([l(n,i),P(n,c)])}a(R,"registerLineHashTextAnchor");export{R as default};
|
package/dist/entry-59.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import"./chunk-6EYWFBNG.js";import{g as a,i as b}from"./chunk-YT42LKFV.js";import"./chunk-ITSNK5YG.js";import"./chunk-FA6BKC5Y.js";import"./chunk-NNCZYO4Q.js";import"./chunk-VCTK4JSN.js";import"./chunk-YHUTTZC6.js";import"./chunk-S3ZPXWX7.js";import"./chunk-5VSE5X5R.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as createApplyCallRenderer,b as createApplyResultRenderer};
|
package/dist/entry-60.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m}from"./chunk-O6LE42GK.js";import"./chunk-S3ZPXWX7.js";import"./chunk-5VSE5X5R.js";import"./chunk-EI7MMDWY.js";export{b as TEXT_EDITOR_API_VERSION,e as TEXT_EDITOR_CORE_READY_EVENT,f as TEXT_EDITOR_PLUGIN_REGISTER_EVENT,a as TEXT_EDITOR_PROTOCOL,c as TEXT_POSITION_ANCHOR_KIND,d as TEXT_SEARCH_ANCHOR_KIND,h as isResourceResolverRegistration,i as isTextAnchorResolverRegistration,j as isTextAnchorResourceResolutionAttempt,k as isTextEditorCoreReady,l as isTextEditorPlugin,m as isTextEditorPluginRegistrationRequest,g as isTextEditorToolId};
|
package/dist/entry-61.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-L7JMDDSD.js";import"./chunk-O6LE42GK.js";import"./chunk-S3ZPXWX7.js";import"./chunk-5VSE5X5R.js";import"./chunk-EI7MMDWY.js";export{a as connectTextEditorPlugin};
|
package/dist/entry-62.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-GUTQ3PWL.js";import"./chunk-5VSE5X5R.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as TextSelectionAnchor};
|
package/dist/entry-63.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a}from"./chunk-U22JNO6N.js";import"./chunk-EI7MMDWY.js";export{a as isTextEditHandlerRegistration};
|
package/dist/entry-64.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m}from"./chunk-O6LE42GK.js";import"./chunk-S3ZPXWX7.js";import"./chunk-5VSE5X5R.js";import"./chunk-EI7MMDWY.js";export{b as TEXT_EDITOR_API_VERSION,e as TEXT_EDITOR_CORE_READY_EVENT,f as TEXT_EDITOR_PLUGIN_REGISTER_EVENT,a as TEXT_EDITOR_PROTOCOL,c as TEXT_POSITION_ANCHOR_KIND,d as TEXT_SEARCH_ANCHOR_KIND,h as isResourceResolverRegistration,i as isTextAnchorResolverRegistration,j as isTextAnchorResourceResolutionAttempt,k as isTextEditorCoreReady,l as isTextEditorPlugin,m as isTextEditorPluginRegistrationRequest,g as isTextEditorToolId};
|
package/dist/entry-65.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-MBUXFKIW.js";import"./chunk-EI7MMDWY.js";export{a as formatStaleAnchorMessage};
|
package/dist/entry-66.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a}from"./chunk-GUTQ3PWL.js";import"./chunk-5VSE5X5R.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{a as TextSelectionAnchor};
|
package/dist/entry-67.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,d as b,g as c,h as d,i as e,j as f,k as g,l as h,m as i}from"./chunk-FEDVTZJG.js";import"./chunk-O6LE42GK.js";import"./chunk-S3ZPXWX7.js";import"./chunk-5VSE5X5R.js";import"./chunk-EI7MMDWY.js";export{c as TEXT_EDITOR_POST_EDIT_REGISTER_EVENT,a as afterPostEditScope,i as connectTextEditorPostEditHandler,b as hasDeferredPostEdit,e as isDiffStatusContribution,d as isFormattingContribution,h as isTextMutationResultContributionData,f as isTextPostEditHandlerRegistration,g as isTextPostEditHandlerRegistrationRequest};
|
package/dist/entry-68.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"./chunk-
|
|
1
|
+
import"./chunk-4U2GUKNJ.js";import{b as a,c as b,d as c}from"./chunk-ITSNK5YG.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{c as FileMutationResult,b as FileRange,a as computeChangedRanges};
|
package/dist/entry-69.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as b,b as c}from"./chunk-4LUW26BX.js";import{c as a}from"./chunk-GIRAEVUJ.js";import"./chunk-YHUTTZC6.js";import"./chunk-EI7MMDWY.js";export{a as getToolCallInterception,c as registerToolCallAnnotationSink,b as registerToolCallInterceptor};
|
package/dist/entry-70.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a,b,c}from"./chunk-AWXVJ5AC.js";import"./chunk-EI7MMDWY.js";export{b as assertTextMutationToolRegistration,a as isMutationAnchorValue,c as mutationSource};
|