pi-agent-ide 0.6.0 → 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 +29 -0
- package/README.md +79 -53
- package/assets/social-preview.png +0 -0
- package/dist/chunk-4KUFOHWP.js +2 -0
- package/dist/chunk-4LDOV7QS.js +28 -0
- package/dist/chunk-FA6BKC5Y.js +1 -0
- package/dist/{chunk-HSM6R7IB.js → chunk-I6Y3W4X6.js} +13 -13
- package/dist/chunk-MPT3R4BL.js +0 -0
- package/dist/chunk-PZFOOHY2.js +15 -0
- package/dist/{chunk-OYWIZII6.js → chunk-S6QRG3TQ.js} +1 -1
- 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 -1
- package/dist/entry-17.js +1 -0
- 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 -1
- package/dist/entry-23.js +1 -2
- 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 -1
- package/dist/entry-28.js +1 -12
- 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 -1
- package/dist/entry-33.js +1 -4
- package/dist/entry-34.js +1 -9
- 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 -1
- package/dist/entry-42.js +1 -18
- 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 -1
- package/dist/entry-47.js +1 -7
- package/dist/entry-48.js +1 -11
- 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 -1
- package/dist/entry-57.js +1 -0
- package/dist/entry-58.js +1 -1
- package/dist/entry-59.js +1 -0
- 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 -1
- package/dist/entry-66.js +1 -0
- package/dist/entry-67.js +1 -1
- package/dist/entry-68.js +1 -0
- package/dist/entry-69.js +0 -1
- package/dist/entry-70.js +1 -1
- package/dist/entry-71.js +0 -1
- package/dist/entry-72.js +1 -259
- package/dist/entry-73.js +1 -30
- package/dist/entry-74.js +1 -2
- package/dist/entry-75.js +315 -1
- package/dist/entry-76.js +30 -1
- package/dist/entry-77.js +2 -3
- package/dist/entry-78.js +1 -3
- package/dist/entry-79.js +1 -1
- package/dist/entry-80.js +3 -1
- package/dist/entry-81.js +3 -1
- 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 +6 -14
- package/docs/research/apply-read-latency.md +219 -0
- package/node_modules/pi-agent-doctor/package.json +6 -6
- 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-jq/index.ts +134 -0
- package/node_modules/pi-agent-filesystem-jq/package.json +23 -0
- package/node_modules/pi-agent-filesystem-jq/runtime/entry-27.js +2 -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-text/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/runtime/entry-29.js +2 -0
- package/node_modules/pi-agent-ide-ast/package.json +11 -11
- package/node_modules/pi-agent-ide-ast/runtime/entry-30.js +1 -0
- 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/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 +17 -1
- 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-42.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 +2 -2
- 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 +19 -12
- package/node_modules/pi-agent-resource/package.json +2 -2
- package/node_modules/pi-agent-search/package.json +8 -7
- package/node_modules/pi-agent-search/runtime/entry-47.js +0 -1
- package/node_modules/pi-agent-search/runtime/entry-48.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-50.js +2 -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-text/package.json +3 -3
- package/node_modules/pi-agent-text/runtime/entry-53.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-54.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/package.json +5 -5
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-55.js +1 -0
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-56.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-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-72.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-73.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-74.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 +24 -18
- package/node_modules/pi-agent-text-editor/src/core/apply/output.ts +4 -2
- package/node_modules/pi-agent-text-editor/src/core/apply/prompt.ts +5 -44
- package/node_modules/pi-agent-text-editor/src/core/apply/renderer.ts +13 -5
- package/node_modules/pi-agent-text-editor/src/core/apply/runtime.ts +124 -26
- package/node_modules/pi-agent-text-editor/src/core/apply/tool.ts +2 -6
- package/node_modules/pi-agent-text-editor/src/core/apply/transaction.ts +186 -1
- 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/text-editor-config.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +0 -2
- 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/runtime/entry-76.js +2 -0
- 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-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 +108 -44
- package/src/api/documentation.ts +2 -0
- package/src/composite/builtin-extensions.ts +7 -0
- package/src/composite/extensions-config.ts +6 -0
- package/src/composite/module-labels.ts +5 -0
- package/src/composite/module-settings-store.ts +3 -0
- package/src/composite/module-settings.ts +39 -5
- package/src/composite/preferences.ts +37 -0
- package/src/composite/presentation.ts +14 -0
- package/src/composite/presets.ts +57 -0
- 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-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-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-42.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-43.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 +2 -2
- 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 +19 -12
- 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/runtime/entry-47.js +0 -1
- 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-constant/runtime/entry-54.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-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-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/runtime/entry-76.js +2 -0
- 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/runtime/entry-72.js +0 -1
- 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 +24 -18
- package/src/extensions/pi-agent-text-editor/src/core/apply/output.ts +4 -2
- package/src/extensions/pi-agent-text-editor/src/core/apply/prompt.ts +5 -44
- package/src/extensions/pi-agent-text-editor/src/core/apply/renderer.ts +13 -5
- package/src/extensions/pi-agent-text-editor/src/core/apply/runtime.ts +124 -26
- package/src/extensions/pi-agent-text-editor/src/core/apply/tool.ts +2 -6
- package/src/extensions/pi-agent-text-editor/src/core/apply/transaction.ts +186 -1
- 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/text-editor-config.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +0 -2
- package/src/pi-agent-ide.ts +7 -10
- package/src/plugins/pi-agent-ide-ast/package.json +11 -11
- package/src/plugins/pi-agent-ide-ast/runtime/entry-30.js +1 -0
- 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 +12 -4
- 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/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 +17 -1
- 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-terminal/index.ts +27 -2
- 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/tools.ts +7 -4
- package/src/plugins/pi-agent-ide-vision/index.ts +8 -6
- package/dist/chunk-22CLOM2D.js +0 -1
- package/dist/chunk-3XJ3KDPZ.js +0 -16
- package/dist/chunk-526E364R.js +0 -3
- package/dist/chunk-DDKHZZDO.js +0 -5
- package/dist/chunk-EJ5OACQM.js +0 -1
- package/dist/chunk-PCZH7GOX.js +0 -26
- package/dist/chunk-SQ7ZTGOP.js +0 -2
- package/dist/entry-18.js +0 -1
- package/node_modules/pi-agent-doctor/runtime/entry-18.js +0 -1
- package/node_modules/pi-agent-filesystem/runtime/entry-23.js +0 -2
- package/node_modules/pi-agent-filesystem-image/runtime/entry-24.js +0 -2
- package/node_modules/pi-agent-ide-ast/runtime/entry-27.js +0 -1
- package/node_modules/pi-agent-ide-changes/runtime/entry-29.js +0 -1
- package/node_modules/pi-agent-ide-changes/runtime/entry-30.js +0 -2
- package/node_modules/pi-agent-ide-languages/runtime/entry-32.js +0 -2
- package/node_modules/pi-agent-image/runtime/entry-35.js +0 -1
- package/node_modules/pi-agent-invariant/runtime/entry-36.js +0 -1
- package/node_modules/pi-agent-pdf/runtime/entry-37.js +0 -1
- package/node_modules/pi-agent-search/runtime/entry-45.js +0 -1
- package/node_modules/pi-agent-search-text/runtime/entry-48.js +0 -2
- package/node_modules/pi-agent-text/runtime/entry-50.js +0 -1
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-53.js +0 -2
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-54.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-55.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-73.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-74.js +0 -2
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-75.js +0 -1
- package/node_modules/pi-agent-tool-ui/runtime/entry-76.js +0 -1
- package/node_modules/pi-agent-web-html/runtime/entry-78.js +0 -2
- package/node_modules/pi-agent-web-image/runtime/entry-79.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-24.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-25.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-23.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-78.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-79.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-80.js +0 -2
- 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-48.js +0 -2
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-49.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 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-53.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-54.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-55.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-73.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-74.js +0 -2
- 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-27.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-28.js +0 -2
- package/src/plugins/pi-agent-ide-changes/runtime/entry-29.js +0 -1
- package/src/plugins/pi-agent-ide-changes/runtime/entry-30.js +0 -2
- package/src/plugins/pi-agent-ide-languages/runtime/entry-32.js +0 -2
- /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem}/runtime/entry-25.js +0 -0
- /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-image}/runtime/entry-26.js +0 -0
- /package/node_modules/{pi-agent-ide-ast → pi-agent-filesystem-pdf}/runtime/entry-28.js +0 -0
- /package/node_modules/{pi-agent-ide-formatter → pi-agent-ide-ast}/runtime/entry-31.js +0 -0
- /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-changes}/runtime/entry-33.js +0 -0
- /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-formatter}/runtime/entry-34.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-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 → pi-agent-resource}/runtime/entry-46.js +0 -0
- /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-49.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-constant → pi-agent-search-text}/runtime/entry-51.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-exact → pi-agent-search-text}/runtime/entry-52.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-web → pi-agent-text-editor-stale-anchor}/runtime/entry-77.js +0 -0
- /package/node_modules/{pi-agent-web-pdf → pi-agent-web}/runtime/entry-80.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web-html}/runtime/entry-81.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-image}/runtime/entry-26.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-html}/runtime/entry-81.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-constant → pi-agent-search/plugins/pi-agent-search-text}/runtime/entry-51.js +0 -0
- /package/src/extensions/{pi-agent-text-editor/plugins/pi-agent-text-anchor-exact → pi-agent-search/plugins/pi-agent-search-text}/runtime/entry-52.js +0 -0
- /package/src/extensions/{pi-agent-read/extensions/pi-agent-web → pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor}/runtime/entry-77.js +0 -0
- /package/src/plugins/{pi-agent-ide-formatter → pi-agent-ide-ast}/runtime/entry-31.js +0 -0
- /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-changes}/runtime/entry-33.js +0 -0
- /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-formatter}/runtime/entry-34.js +0 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import spawn from "cross-spawn";
|
|
2
|
+
import { projectProcessEnvironment } from "pi-agent-doctor/api/executable";
|
|
3
|
+
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
const JQ_TIMEOUT_MS = 5_000;
|
|
7
|
+
const JQ_MAX_OUTPUT_BYTES = 10 * 1024 * 1024;
|
|
8
|
+
const JQ_MODULE_DIRECTORY = fileURLToPath(new URL(".", import.meta.url));
|
|
9
|
+
|
|
10
|
+
export interface JqView {
|
|
11
|
+
readonly filter: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Parse one exclusive parameterized jq view from a Read request. */
|
|
15
|
+
export function parseJqView(views: readonly string[] | undefined): JqView | undefined {
|
|
16
|
+
const jqViews = views?.filter((view) => view === "jq" || view.startsWith("jq:")) ?? [];
|
|
17
|
+
if (jqViews.length === 0) return undefined;
|
|
18
|
+
if (jqViews.length > 1) throw new Error("Read accepts only one jq view");
|
|
19
|
+
if (views?.length !== 1) throw new Error("The jq view cannot be combined with other views");
|
|
20
|
+
const selected = jqViews[0];
|
|
21
|
+
if (selected === undefined || selected === "jq" || selected.slice(3).trim().length === 0)
|
|
22
|
+
throw new Error('The jq view requires a filter, for example views: ["jq:.scripts"]');
|
|
23
|
+
return { filter: selected.slice(3) };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Run the real jq executable over one JSON text with bounded output and no shell. */
|
|
27
|
+
export function executeJq(
|
|
28
|
+
filter: string,
|
|
29
|
+
input: string,
|
|
30
|
+
options: { readonly cwd: string; readonly signal?: AbortSignal; readonly command?: string },
|
|
31
|
+
): Promise<string> {
|
|
32
|
+
if (options.signal?.aborted === true)
|
|
33
|
+
return Promise.reject(new Error("jq execution was cancelled"));
|
|
34
|
+
return new Promise((resolve, reject) => {
|
|
35
|
+
const child = spawn(options.command ?? "jq", ["-L", JQ_MODULE_DIRECTORY, "--", filter], {
|
|
36
|
+
cwd: options.cwd,
|
|
37
|
+
env: safeEnvironment(options.cwd),
|
|
38
|
+
shell: false,
|
|
39
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
40
|
+
windowsHide: true,
|
|
41
|
+
});
|
|
42
|
+
let stdout = "";
|
|
43
|
+
let stderr = "";
|
|
44
|
+
let settled = false;
|
|
45
|
+
let outputBytes = 0;
|
|
46
|
+
const finish = (error?: Error): void => {
|
|
47
|
+
if (settled) return;
|
|
48
|
+
settled = true;
|
|
49
|
+
clearTimeout(timeout);
|
|
50
|
+
options.signal?.removeEventListener("abort", abort);
|
|
51
|
+
if (error === undefined) resolve(stdout);
|
|
52
|
+
else reject(error);
|
|
53
|
+
};
|
|
54
|
+
const stop = (error: Error): void => {
|
|
55
|
+
child.kill();
|
|
56
|
+
finish(error);
|
|
57
|
+
};
|
|
58
|
+
const abort = (): void => stop(new Error("jq execution was cancelled"));
|
|
59
|
+
const timeout = setTimeout(
|
|
60
|
+
() => stop(new Error(`jq did not finish within ${JQ_TIMEOUT_MS / 1_000} seconds`)),
|
|
61
|
+
JQ_TIMEOUT_MS,
|
|
62
|
+
);
|
|
63
|
+
timeout.unref();
|
|
64
|
+
options.signal?.addEventListener("abort", abort, { once: true });
|
|
65
|
+
|
|
66
|
+
child.stdout?.setEncoding("utf8");
|
|
67
|
+
child.stderr?.setEncoding("utf8");
|
|
68
|
+
child.stdout?.on("data", (chunk: string) => {
|
|
69
|
+
outputBytes += Buffer.byteLength(chunk);
|
|
70
|
+
if (outputBytes > JQ_MAX_OUTPUT_BYTES) {
|
|
71
|
+
stop(new Error(`jq output exceeded ${JQ_MAX_OUTPUT_BYTES / 1024 / 1024}MB`));
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
stdout += chunk;
|
|
75
|
+
});
|
|
76
|
+
child.stderr?.on("data", (chunk: string) => {
|
|
77
|
+
if (Buffer.byteLength(stderr) < 16_384) stderr += chunk;
|
|
78
|
+
});
|
|
79
|
+
child.once("error", (error) => finish(new Error(`Cannot start jq: ${error.message}`)));
|
|
80
|
+
child.once("close", (code, signal) => {
|
|
81
|
+
if (settled) return;
|
|
82
|
+
if (code === 0) finish();
|
|
83
|
+
else {
|
|
84
|
+
const detail = stderr.trim().split(/\r?\n/u).slice(0, 8).join("\n");
|
|
85
|
+
finish(
|
|
86
|
+
new Error(
|
|
87
|
+
detail ||
|
|
88
|
+
`jq exited ${signal === null ? `with code ${String(code)}` : `after signal ${signal}`}`,
|
|
89
|
+
),
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
child.stdin?.once("error", (error) =>
|
|
94
|
+
finish(new Error(`Cannot send JSON to jq: ${error.message}`)),
|
|
95
|
+
);
|
|
96
|
+
child.stdin?.end(input);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function safeEnvironment(cwd: string): NodeJS.ProcessEnv {
|
|
101
|
+
const source = projectProcessEnvironment(cwd, process.env);
|
|
102
|
+
const environment: NodeJS.ProcessEnv = {};
|
|
103
|
+
for (const key of ["PATH", "PATHEXT", "SystemRoot", "SYSTEMROOT", "WINDIR"]) {
|
|
104
|
+
if (source[key] !== undefined) environment[key] = source[key];
|
|
105
|
+
}
|
|
106
|
+
return environment;
|
|
107
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-filesystem-pdf",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-pdf": "0.6.
|
|
7
|
-
"pi-agent-resource": "0.6.
|
|
6
|
+
"pi-agent-pdf": "0.6.1",
|
|
7
|
+
"pi-agent-resource": "0.6.1"
|
|
8
8
|
},
|
|
9
9
|
"pi": {
|
|
10
10
|
"extensions": [
|
|
11
|
-
"./runtime/entry-
|
|
11
|
+
"./runtime/entry-28.js"
|
|
12
12
|
]
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-filesystem-text",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#extension": "./index.ts"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"pi-agent-resource": "0.6.
|
|
10
|
-
"pi-agent-text": "0.6.
|
|
9
|
+
"pi-agent-resource": "0.6.1",
|
|
10
|
+
"pi-agent-text": "0.6.1"
|
|
11
11
|
},
|
|
12
12
|
"pi": {
|
|
13
13
|
"extensions": [
|
|
14
|
-
"./runtime/entry-
|
|
14
|
+
"./runtime/entry-29.js"
|
|
15
15
|
]
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-web",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"defuddle": "^0.19.1",
|
|
10
10
|
"linkedom": "^0.18.12",
|
|
11
|
-
"pi-agent-doctor": "0.6.
|
|
12
|
-
"pi-agent-image": "0.6.
|
|
13
|
-
"pi-agent-read": "0.6.
|
|
14
|
-
"pi-agent-resource": "0.6.
|
|
15
|
-
"pi-agent-text": "0.6.
|
|
11
|
+
"pi-agent-doctor": "0.6.1",
|
|
12
|
+
"pi-agent-image": "0.6.1",
|
|
13
|
+
"pi-agent-read": "0.6.1",
|
|
14
|
+
"pi-agent-resource": "0.6.1",
|
|
15
|
+
"pi-agent-text": "0.6.1",
|
|
16
16
|
"playwright-core": "^1.62.1"
|
|
17
17
|
},
|
|
18
18
|
"pi": {
|
|
19
19
|
"extensions": [
|
|
20
|
-
"./runtime/entry-
|
|
20
|
+
"./runtime/entry-80.js"
|
|
21
21
|
]
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-web-html",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"defuddle": "^0.19.1",
|
|
10
10
|
"linkedom": "^0.18.12",
|
|
11
|
-
"pi-agent-resource": "0.6.
|
|
11
|
+
"pi-agent-resource": "0.6.1"
|
|
12
12
|
},
|
|
13
13
|
"pi": {
|
|
14
14
|
"extensions": [
|
|
15
|
-
"./runtime/entry-
|
|
15
|
+
"./runtime/entry-81.js"
|
|
16
16
|
]
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-web-image",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-image": "0.6.
|
|
7
|
-
"pi-agent-resource": "0.6.
|
|
6
|
+
"pi-agent-image": "0.6.1",
|
|
7
|
+
"pi-agent-resource": "0.6.1"
|
|
8
8
|
},
|
|
9
9
|
"pi": {
|
|
10
10
|
"extensions": [
|
|
11
|
-
"./runtime/entry-
|
|
11
|
+
"./runtime/entry-82.js"
|
|
12
12
|
]
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-web-pdf",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-pdf": "0.6.
|
|
7
|
-
"pi-agent-resource": "0.6.
|
|
6
|
+
"pi-agent-pdf": "0.6.1",
|
|
7
|
+
"pi-agent-resource": "0.6.1"
|
|
8
8
|
},
|
|
9
9
|
"pi": {
|
|
10
10
|
"extensions": [
|
|
11
|
-
"./runtime/entry-
|
|
11
|
+
"./runtime/entry-83.js"
|
|
12
12
|
]
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-web-text",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-resource": "0.6.
|
|
7
|
-
"pi-agent-text": "0.6.
|
|
6
|
+
"pi-agent-resource": "0.6.1",
|
|
7
|
+
"pi-agent-text": "0.6.1"
|
|
8
8
|
},
|
|
9
9
|
"pi": {
|
|
10
10
|
"extensions": [
|
|
11
|
-
"./runtime/entry-
|
|
11
|
+
"./runtime/entry-84.js"
|
|
12
12
|
]
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-read",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,31 +8,32 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./api/connect-plugin": {
|
|
10
10
|
"types": "./src/api/connect-plugin.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-41.js"
|
|
12
12
|
},
|
|
13
13
|
"./api/rendering": {
|
|
14
14
|
"types": "./src/api/rendering.ts",
|
|
15
|
-
"default": "./runtime/entry-
|
|
15
|
+
"default": "./runtime/entry-42.js"
|
|
16
16
|
},
|
|
17
17
|
"./api/plugin-protocol": {
|
|
18
18
|
"types": "./src/api/plugin-protocol.ts",
|
|
19
|
-
"default": "./runtime/entry-
|
|
19
|
+
"default": "./runtime/entry-43.js"
|
|
20
20
|
},
|
|
21
21
|
"./api/tools/read": {
|
|
22
22
|
"types": "./src/api/tools/read.ts",
|
|
23
|
-
"default": "./runtime/entry-
|
|
23
|
+
"default": "./runtime/entry-44.js"
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"pi-agent-
|
|
28
|
-
"pi-agent-
|
|
29
|
-
"pi-agent-
|
|
30
|
-
"pi-agent-
|
|
31
|
-
"pi-agent-tool-
|
|
27
|
+
"pi-agent-documentation": "0.6.1",
|
|
28
|
+
"pi-agent-invariant": "0.6.1",
|
|
29
|
+
"pi-agent-resource": "0.6.1",
|
|
30
|
+
"pi-agent-text": "0.6.1",
|
|
31
|
+
"pi-agent-tool-call-interception": "0.6.1",
|
|
32
|
+
"pi-agent-tool-ui": "0.6.1"
|
|
32
33
|
},
|
|
33
34
|
"pi": {
|
|
34
35
|
"extensions": [
|
|
35
|
-
"./runtime/entry-
|
|
36
|
+
"./runtime/entry-45.js"
|
|
36
37
|
]
|
|
37
38
|
},
|
|
38
39
|
"peerDependencies": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../../dist/entry-43.js";
|
|
@@ -5,7 +5,7 @@ export const readParameters = Type.Object({
|
|
|
5
5
|
path: Type.Optional(
|
|
6
6
|
Type.String({
|
|
7
7
|
description:
|
|
8
|
-
"What to read: a file or directory path, URL, returned temp:
|
|
8
|
+
"What to read: a supported resource such as a file or directory path, URL, returned temp: reference, SEARCH# reference, or registered protocol source. Supply a path; an empty call cannot select a source.",
|
|
9
9
|
}),
|
|
10
10
|
),
|
|
11
11
|
offset: Type.Optional(
|
|
@@ -23,7 +23,7 @@ export const readParameters = Type.Object({
|
|
|
23
23
|
views: Type.Optional(
|
|
24
24
|
Type.Array(Type.String(), {
|
|
25
25
|
description:
|
|
26
|
-
'Optional
|
|
26
|
+
'Optional source-specific presentations. Combine views when both presentations are needed, for example ["anchors", "ast"]. Omit for the source\'s default presentation.',
|
|
27
27
|
}),
|
|
28
28
|
),
|
|
29
29
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { connectAgentDocumentation, loadPackagedAgentGuide } from "pi-agent-documentation";
|
|
2
3
|
import {
|
|
3
4
|
ToolCallInterceptionRenderStore,
|
|
4
5
|
withToolCallInterceptionRendering,
|
|
@@ -19,8 +20,21 @@ function isRecord(value: unknown): value is Record<string, unknown> {
|
|
|
19
20
|
return typeof value === "object" && value !== null;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
function parsePresentation(value: string | undefined): "full" | "compact" | "disabled" {
|
|
24
|
+
return value === "full" || value === "disabled" ? value : "compact";
|
|
25
|
+
}
|
|
26
|
+
export default async function registerReadCore(
|
|
27
|
+
pi: ExtensionAPI,
|
|
28
|
+
context?: { readonly preferences: Readonly<Record<string, string>> },
|
|
29
|
+
): Promise<void> {
|
|
30
|
+
connectAgentDocumentation(pi, [
|
|
31
|
+
await loadPackagedAgentGuide({
|
|
32
|
+
id: "read-resources",
|
|
33
|
+
description: "Resource selection, windows, views, raw bytes, and continuation",
|
|
34
|
+
triggers: [{ tool: "read" }],
|
|
35
|
+
}),
|
|
36
|
+
]);
|
|
37
|
+
const core = createReadCore(parsePresentation(context?.preferences["ui.read"]));
|
|
24
38
|
|
|
25
39
|
const unsubscribeRegistration = pi.events.on(READ_PLUGIN_REGISTER_EVENT, (request) => {
|
|
26
40
|
if (!isReadPluginRegistrationRequest(request)) {
|
|
@@ -49,14 +49,13 @@ export interface ReadCore {
|
|
|
49
49
|
renderPluginPromptGuideline(): string | undefined;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
export function createReadCore(
|
|
52
|
+
export function createReadCore(
|
|
53
|
+
presentation: "full" | "compact" | "disabled" = "compact",
|
|
54
|
+
): ReadCore {
|
|
53
55
|
const outputReducers: ReadOutputReducer[] = [];
|
|
54
56
|
const pendingPlugins = new Set<Promise<void>>();
|
|
55
57
|
const plugins = new Map<string, RegisteredPlugin>();
|
|
56
|
-
const read = createReadTool(
|
|
57
|
-
() => renderPromptGuidelines(plugins),
|
|
58
|
-
() => renderPluginPromptGuideline(plugins),
|
|
59
|
-
);
|
|
58
|
+
const read = createReadTool(() => renderPromptGuidelines(plugins), presentation);
|
|
60
59
|
let registrationQueue = Promise.resolve();
|
|
61
60
|
|
|
62
61
|
return {
|
|
@@ -228,10 +228,16 @@ export class ReadResultPanel implements Component {
|
|
|
228
228
|
|
|
229
229
|
const innerWidth = width - 2;
|
|
230
230
|
const contentWidth = Math.max(1, innerWidth - 2);
|
|
231
|
-
const
|
|
231
|
+
const compactInput = compactRenderInput(this.state, contentWidth);
|
|
232
|
+
const renderedRows = renderContentRows(compactInput.state, contentWidth).flatMap((row) =>
|
|
232
233
|
wrapTextWithAnsi(row, contentWidth),
|
|
233
234
|
);
|
|
234
|
-
const rows = compactRows(
|
|
235
|
+
const rows = compactRows(
|
|
236
|
+
renderedRows,
|
|
237
|
+
this.state.expanded,
|
|
238
|
+
this.state.theme,
|
|
239
|
+
compactInput.hasHiddenRows,
|
|
240
|
+
);
|
|
235
241
|
const lines = [renderTopBorder(this.state, innerWidth, this.state.theme)];
|
|
236
242
|
|
|
237
243
|
for (const row of rows) {
|
|
@@ -257,6 +263,49 @@ export class ReadResultPanel implements Component {
|
|
|
257
263
|
}
|
|
258
264
|
}
|
|
259
265
|
|
|
266
|
+
const COMPACT_SOURCE_RENDER_THRESHOLD = 100;
|
|
267
|
+
const MAX_COMPACT_SOURCE_LINES = COMPACT_READ_ROWS;
|
|
268
|
+
const MAX_COMPACT_CHARACTERS_PER_ROW = 4;
|
|
269
|
+
|
|
270
|
+
interface CompactRenderInput {
|
|
271
|
+
readonly state: ReadPanelState;
|
|
272
|
+
readonly hasHiddenRows: boolean;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
function compactRenderInput(state: ReadPanelState, width: number): CompactRenderInput {
|
|
276
|
+
if (state.expanded) return { state, hasHiddenRows: false };
|
|
277
|
+
|
|
278
|
+
const lines = readLines(state.details);
|
|
279
|
+
if (lines !== undefined && lines.length > COMPACT_SOURCE_RENDER_THRESHOLD) {
|
|
280
|
+
return {
|
|
281
|
+
state: {
|
|
282
|
+
...state,
|
|
283
|
+
details: { ...state.details, lines: lines.slice(0, MAX_COMPACT_SOURCE_LINES) },
|
|
284
|
+
},
|
|
285
|
+
hasHiddenRows: true,
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
if (lines !== undefined) return { state, hasHiddenRows: false };
|
|
290
|
+
|
|
291
|
+
const characterLimit = Math.max(
|
|
292
|
+
COMPACT_READ_ROWS,
|
|
293
|
+
width * COMPACT_READ_ROWS * MAX_COMPACT_CHARACTERS_PER_ROW,
|
|
294
|
+
);
|
|
295
|
+
const content = state.result.content.map((block) => {
|
|
296
|
+
if (block.type !== "text" || block.text.length <= characterLimit) return block;
|
|
297
|
+
return { ...block, text: block.text.slice(0, characterLimit) };
|
|
298
|
+
});
|
|
299
|
+
const hasHiddenRows = content.some((block, index) => {
|
|
300
|
+
const original = state.result.content[index];
|
|
301
|
+
return (
|
|
302
|
+
block.type === "text" && original?.type === "text" && block.text.length < original.text.length
|
|
303
|
+
);
|
|
304
|
+
});
|
|
305
|
+
return hasHiddenRows
|
|
306
|
+
? { state: { ...state, result: { ...state.result, content } }, hasHiddenRows }
|
|
307
|
+
: { state, hasHiddenRows: false };
|
|
308
|
+
}
|
|
260
309
|
function renderContentRows(state: ReadPanelState, width: number): string[] {
|
|
261
310
|
const lines = readLines(state.details);
|
|
262
311
|
const text = cleanText(state.result, lines, state.details, !state.expanded);
|
|
@@ -390,19 +439,24 @@ function renderCodeViewLabel(value: string, theme: Theme, stripMarkers = true):
|
|
|
390
439
|
return theme.fg("toolOutput", line);
|
|
391
440
|
}
|
|
392
441
|
|
|
393
|
-
function compactRows(
|
|
394
|
-
|
|
442
|
+
function compactRows(
|
|
443
|
+
rows: readonly string[],
|
|
444
|
+
expanded: boolean,
|
|
445
|
+
theme: Theme,
|
|
446
|
+
hasHiddenRows = false,
|
|
447
|
+
): readonly string[] {
|
|
448
|
+
if (expanded || (rows.length <= COMPACT_READ_ROWS && !hasHiddenRows)) {
|
|
395
449
|
return rows;
|
|
396
450
|
}
|
|
397
451
|
|
|
398
452
|
const shown = rows.slice(0, COMPACT_READ_ROWS - 1);
|
|
399
453
|
const omitted = rows.length - shown.length;
|
|
454
|
+
const count = hasHiddenRows
|
|
455
|
+
? "more rows"
|
|
456
|
+
: `${String(omitted)} more ${omitted === 1 ? "row" : "rows"}`;
|
|
400
457
|
return [
|
|
401
458
|
...shown,
|
|
402
|
-
`${theme.fg("dim", `… ${
|
|
403
|
-
"app.tools.expand",
|
|
404
|
-
"to expand",
|
|
405
|
-
)}`,
|
|
459
|
+
`${theme.fg("dim", `… ${count} · `)}${keyHint("app.tools.expand", "to expand")}`,
|
|
406
460
|
];
|
|
407
461
|
}
|
|
408
462
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { requiredValue } from "pi-agent-invariant";
|
|
2
|
+
import { Text } from "@earendil-works/pi-tui";
|
|
2
3
|
import { type ToolDefinition } from "@earendil-works/pi-coding-agent";
|
|
3
4
|
import {
|
|
4
5
|
isAgentContent,
|
|
@@ -120,7 +121,7 @@ export interface ReadTool {
|
|
|
120
121
|
/** Creates a read pipeline whose prompt contributions reflect the currently installed plugins. */
|
|
121
122
|
export function createReadTool(
|
|
122
123
|
pluginPromptGuidelines?: () => readonly string[],
|
|
123
|
-
|
|
124
|
+
presentation: "full" | "compact" | "disabled" = "compact",
|
|
124
125
|
): ReadTool {
|
|
125
126
|
const temporaryResources = new TempResourceStore();
|
|
126
127
|
const resolvers: RegisteredResolver[] = [
|
|
@@ -150,18 +151,11 @@ export function createReadTool(
|
|
|
150
151
|
|
|
151
152
|
promptSnippet: "Read supported sources as text or bytes, with optional views",
|
|
152
153
|
get description(): string {
|
|
153
|
-
return
|
|
154
|
-
`Use read to inspect files, directories, URLs and supported sources without changing them. path selects the source; offset/limit select a text window; views add annotations. Text limit: ${READ_OUTPUT_MAX_LINES} lines or ${READ_OUTPUT_MAX_BYTES / 1024}KB. Continuation: returned offset, or returned temp: reference as path. Temporary references remain available until their owning runtime is disposed.`,
|
|
155
|
-
"Use raw:<local-file> to inspect original bytes without decoding or conversion, including PDFs and images. In raw: mode offset is a zero-based byte position (negative from EOF), limit is a non-negative byte count, and 0 reads no bytes. Output uses hexadecimal offsets, hex bytes and printable ASCII; dots stand for nonprintable bytes. Follow the returned byte offset to continue. Raw sources do not accept views or text anchors.",
|
|
156
|
-
pluginDescription?.() ?? "",
|
|
157
|
-
]
|
|
158
|
-
.filter(Boolean)
|
|
159
|
-
.join("\n");
|
|
154
|
+
return `Use read to inspect supported resources. path selects the source; offset and limit select a bounded window; views request source-specific presentations. Text output is limited to ${READ_OUTPUT_MAX_LINES} lines or ${READ_OUTPUT_MAX_BYTES / 1024}KB; follow a returned continuation offset or temp: reference when present.`;
|
|
160
155
|
},
|
|
161
156
|
get promptGuidelines(): string[] {
|
|
162
157
|
return [
|
|
163
|
-
"Use read to
|
|
164
|
-
"Use read with raw:<local-file> instead of xxd, od or hexdump when byte-level inspection is needed.",
|
|
158
|
+
"Use read to inspect supported sources and search to locate workspace content.",
|
|
165
159
|
...(pluginPromptGuidelines?.() ?? []),
|
|
166
160
|
];
|
|
167
161
|
},
|
|
@@ -172,7 +166,12 @@ export function createReadTool(
|
|
|
172
166
|
source === undefined
|
|
173
167
|
? undefined
|
|
174
168
|
: resolvers.find(({ matchesCall }) => matchesCall?.(source) === true)?.renderCall;
|
|
175
|
-
|
|
169
|
+
const mode = context.expanded ? "full" : presentation;
|
|
170
|
+
if (mode === "disabled") return new Text(theme.fg("toolTitle", "read"), 0, 0);
|
|
171
|
+
return (renderer ?? renderReadCall)(arguments_, theme, {
|
|
172
|
+
...context,
|
|
173
|
+
expanded: mode === "full",
|
|
174
|
+
});
|
|
176
175
|
},
|
|
177
176
|
renderResult(result, options, theme, context) {
|
|
178
177
|
const resolvedBy = result.details.resolvedBy;
|
|
@@ -180,7 +179,15 @@ export function createReadTool(
|
|
|
180
179
|
resolvedBy === undefined
|
|
181
180
|
? undefined
|
|
182
181
|
: resolvers.find(({ resolver }) => resolver.id === resolvedBy)?.renderResult;
|
|
183
|
-
|
|
182
|
+
const mode = options.expanded ? "full" : presentation;
|
|
183
|
+
if (mode === "disabled" && !context.isError && !options.isPartial)
|
|
184
|
+
return new Text(theme.fg("success", "✓ read"), 0, 0);
|
|
185
|
+
return (renderer ?? fallbackReadRenderer)(
|
|
186
|
+
result,
|
|
187
|
+
{ ...options, expanded: mode === "full" },
|
|
188
|
+
theme,
|
|
189
|
+
context,
|
|
190
|
+
);
|
|
184
191
|
},
|
|
185
192
|
async execute(_toolCallId, parameters, signal, _onUpdate, context) {
|
|
186
193
|
const resolverContext: ResourceResolverContext = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-search",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,24 +8,25 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./api/connect-plugin": {
|
|
10
10
|
"types": "./src/api/connect-plugin.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-47.js"
|
|
12
12
|
},
|
|
13
13
|
"./api/plugin-protocol": {
|
|
14
14
|
"types": "./src/api/plugin-protocol.ts",
|
|
15
|
-
"default": "./runtime/entry-
|
|
15
|
+
"default": "./runtime/entry-48.js"
|
|
16
16
|
},
|
|
17
17
|
"./api/search": {
|
|
18
18
|
"types": "./src/api/search.ts",
|
|
19
|
-
"default": "./runtime/entry-
|
|
19
|
+
"default": "./runtime/entry-49.js"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"pi-agent-
|
|
24
|
-
"pi-agent-tool-
|
|
23
|
+
"pi-agent-documentation": "0.6.1",
|
|
24
|
+
"pi-agent-tool-call-interception": "0.6.1",
|
|
25
|
+
"pi-agent-tool-ui": "0.6.1"
|
|
25
26
|
},
|
|
26
27
|
"pi": {
|
|
27
28
|
"extensions": [
|
|
28
|
-
"./runtime/entry-
|
|
29
|
+
"./runtime/entry-50.js"
|
|
29
30
|
]
|
|
30
31
|
},
|
|
31
32
|
"peerDependencies": {
|