pi-agent-ide 0.6.0 → 0.6.2
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 +41 -0
- package/README.md +146 -68
- package/assets/social-preview.png +0 -0
- package/assets/summary/debugging.png +0 -0
- package/assets/summary/editing.png +0 -0
- package/assets/summary/read.png +0 -0
- package/assets/summary/search-and-replace.png +0 -0
- package/assets/summary/search.png +0 -0
- package/assets/summary/settings.png +0 -0
- package/assets/summary/terminal.png +0 -0
- package/assets/summary/thumbs/debugging.png +0 -0
- package/assets/summary/thumbs/editing.png +0 -0
- package/assets/summary/thumbs/read.png +0 -0
- package/assets/summary/thumbs/search-and-replace.png +0 -0
- package/assets/summary/thumbs/search.png +0 -0
- package/assets/summary/thumbs/settings.png +0 -0
- package/assets/summary/thumbs/terminal.png +0 -0
- package/assets/summary/thumbs/user_terminal.png +0 -0
- package/assets/summary/user_terminal.png +0 -0
- package/dist/chunk-3E2NTWCN.js +2 -0
- package/dist/chunk-7WCZOO5I.js +1 -0
- package/dist/chunk-CEX3VOJ7.js +2 -0
- package/dist/chunk-FA6BKC5Y.js +1 -0
- package/dist/{chunk-2527OQ4Y.js → chunk-HMLH43ZS.js} +1 -1
- package/dist/chunk-LVWMWWWF.js +28 -0
- package/dist/chunk-MPT3R4BL.js +0 -0
- package/dist/chunk-PZFOOHY2.js +15 -0
- package/dist/{chunk-HKMBQLEK.js → chunk-QDLTO5PH.js} +1 -1
- package/dist/{chunk-Z3VC3S2T.js → chunk-QIK2E64R.js} +1 -1
- package/dist/{chunk-OYWIZII6.js → chunk-S6QRG3TQ.js} +1 -1
- package/dist/chunk-T7CZIACQ.js +27 -0
- package/dist/chunk-T7I2VX3J.js +1 -0
- package/dist/chunk-VCTK4JSN.js +3 -0
- package/dist/chunk-VXD6FZP5.js +5 -0
- package/dist/chunk-W7CASEO3.js +1 -0
- package/dist/chunk-YT42LKFV.js +16 -0
- package/dist/entry-1.js +1 -1
- package/dist/entry-10.js +1 -1
- package/dist/entry-11.js +1 -1
- package/dist/entry-12.js +1 -1
- package/dist/entry-13.js +1 -1
- package/dist/entry-14.js +1 -1
- package/dist/entry-15.js +1 -1
- package/dist/entry-16.js +1 -1
- package/dist/entry-17.js +1 -0
- package/dist/entry-19.js +1 -1
- package/dist/entry-2.js +1 -1
- package/dist/entry-20.js +1 -1
- package/dist/entry-21.js +1 -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 +13 -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 +10 -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 +1 -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 +0 -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 +1 -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 +0 -30
- package/dist/entry-74.js +1 -2
- package/dist/entry-75.js +1 -1
- package/dist/entry-76.js +1 -1
- package/dist/entry-77.js +315 -3
- package/dist/entry-78.js +30 -3
- package/dist/entry-79.js +2 -1
- package/dist/entry-80.js +1 -1
- package/dist/entry-81.js +1 -1
- package/dist/entry-82.js +3 -0
- package/dist/entry-83.js +3 -0
- package/dist/entry-84.js +1 -0
- package/dist/entry-85.js +1 -0
- package/dist/entry-86.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 +12 -11
- package/node_modules/pi-agent-ide-ast/runtime/entry-30.js +1 -0
- package/node_modules/pi-agent-ide-ast/src/search-presentation.ts +117 -0
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +20 -2
- 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 +17 -9
- package/node_modules/pi-agent-search-text/runtime/entry-53.js +1 -0
- package/node_modules/pi-agent-search-text/src/persisted-result.ts +9 -7
- package/node_modules/pi-agent-search-text/src/search-renderer.ts +10 -4
- package/node_modules/pi-agent-search-text/src/search-result.ts +8 -1
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text/runtime/entry-55.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-56.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-58.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-60.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/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/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-80.js +1 -0
- package/node_modules/pi-agent-tool-ui/package.json +2 -2
- package/node_modules/pi-agent-tool-ui/runtime/entry-81.js +1 -0
- package/node_modules/pi-agent-web/package.json +7 -7
- package/node_modules/pi-agent-web/runtime/entry-82.js +2 -0
- package/node_modules/pi-agent-web-html/package.json +3 -3
- package/node_modules/pi-agent-web-html/runtime/entry-83.js +2 -0
- package/node_modules/pi-agent-web-image/package.json +4 -4
- package/node_modules/pi-agent-web-image/runtime/entry-84.js +2 -0
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/runtime/entry-85.js +2 -0
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-86.js +2 -0
- package/package.json +108 -44
- package/src/api/documentation.ts +2 -0
- package/src/api/plugin-protocol.ts +10 -4
- 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-html/runtime/entry-83.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-84.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-85.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-86.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-82.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 +17 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-53.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/persisted-result.ts +9 -7
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +10 -4
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +8 -1
- 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-56.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-57.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-58.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-59.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-60.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-78.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/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-79.js +2 -0
- 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 +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-76.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-77.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 +12 -11
- package/src/plugins/pi-agent-ide-ast/runtime/entry-30.js +1 -0
- package/src/plugins/pi-agent-ide-ast/src/search-presentation.ts +117 -0
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +20 -2
- 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 +44 -14
- package/src/plugins/pi-agent-ide-debugger/src/renderer.ts +10 -1
- package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +39 -0
- package/src/plugins/pi-agent-ide-debugger/src/ui.ts +42 -5
- 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 +88 -12
- package/src/plugins/pi-agent-ide-terminal/src/screen-image.ts +6 -2
- 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 +10 -7
- package/src/plugins/pi-agent-ide-vision/src/vision.ts +17 -3
- package/assets/gallery/apply-editing.png +0 -0
- package/assets/gallery/debugging.png +0 -0
- package/assets/gallery/read-web.png +0 -0
- package/assets/gallery/search-replace.png +0 -0
- package/assets/gallery/terminal.png +0 -0
- package/assets/gallery/tool-editing.png +0 -0
- 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-HSM6R7IB.js +0 -27
- 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-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/runtime/entry-60.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-web-pdf/runtime/entry-80.js +0 -2
- package/node_modules/pi-agent-web-text/runtime/entry-81.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/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-81.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-77.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-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/extensions/pi-agent-text-editor/runtime/entry-59.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-60.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-anchor-line-hash → pi-agent-search-text}/runtime/entry-54.js +0 -0
- /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-exact}/runtime/entry-57.js +0 -0
- /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-line-hash}/runtime/entry-59.js +0 -0
- /package/node_modules/{pi-agent-tool-call-interception → pi-agent-text-editor}/runtime/entry-75.js +0 -0
- /package/node_modules/{pi-agent-tool-ui → pi-agent-text-editor}/runtime/entry-76.js +0 -0
- /package/node_modules/{pi-agent-web → pi-agent-text-editor}/runtime/entry-77.js +0 -0
- /package/node_modules/{pi-agent-web-html → pi-agent-text-editor-renderer}/runtime/entry-78.js +0 -0
- /package/node_modules/{pi-agent-web-image → pi-agent-text-editor-stale-anchor}/runtime/entry-79.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-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-text-editor/plugins/pi-agent-text-anchor-line-hash → pi-agent-search/plugins/pi-agent-search-text}/runtime/entry-54.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,219 @@
|
|
|
1
|
+
# Apply and Read latency research
|
|
2
|
+
|
|
3
|
+
This report records the LPT-238 investigation. It describes the current code on `develop` at `bf7f36db` and the retained benchmark evidence available on 17 September 2026. No product behavior was changed.
|
|
4
|
+
|
|
5
|
+
## Summary
|
|
6
|
+
|
|
7
|
+
Apply has a confirmed transaction scaling problem. A flush with many same-file selections does not write the final file once. It validates, snapshots, rebuilds, reads, and writes the whole file once per selection. It also retains one full before/after receipt per selection. On an 11,000-line, 407 KB fixture, 300 replacements took 50.7 seconds. A 1,000-replacement run did not finish within 249 seconds after the 300-replacement sample. This is enough to explain Apply calls that cross a 120-second benchmark timeout.
|
|
8
|
+
|
|
9
|
+
Apply also does avoidable work after the bytes are correct. Final post-processing is serial by file. Final diffs are built twice, once for model output and once for the TUI. Output limits are applied only after full diffs and full text have been built. These costs explain why a workspace can become exact before the tool call returns.
|
|
10
|
+
|
|
11
|
+
The basic Read text pipeline is not responsible for a 26–33 second delay by itself. Parsing, projecting, and bounding an 11,000-line, 407 KB text fixture averaged about 14 ms in a controlled run. The expensive Read candidates are optional views, post-read handlers, and TUI rendering, because they process the full document before compacting it. Retained benchmark trajectories do not contain phase timestamps, so they cannot assign a reported 26–33 second model cycle to the Read tool alone.
|
|
12
|
+
|
|
13
|
+
## Evidence from retained runs
|
|
14
|
+
|
|
15
|
+
The benchmark repository was used read-only.
|
|
16
|
+
|
|
17
|
+
The reported timeout group contains two different failure modes:
|
|
18
|
+
|
|
19
|
+
- Exact before process timeout: `delete-subset-1000-plain`, `insert-subset-1000-plain`, `multi-file-100-unicode`, and `delete-subset-1000-unicode`.
|
|
20
|
+
- Partial workspace at timeout: `multi-file-1-plain`, `multi-file-10-plain`, `multi-file-10-unicode`, `replace-all-1000-unicode`, and `insert-subset-1000-unicode`.
|
|
21
|
+
|
|
22
|
+
The exact cases prove that correctness and lifecycle completion are separate. The partial cases do not all prove one Apply call was slow. Some trajectories use many calls or touch only part of the requested file set. They must be classified from the trajectory before attributing the timeout to Apply internals.
|
|
23
|
+
|
|
24
|
+
A current retained trajectory is useful as a control:
|
|
25
|
+
|
|
26
|
+
- `results/local-pi-agent-ide-hard-oracle5-20260917/trials/delete-subset-1000-unicode__r01__pi-agent-ide/rounds/0/`
|
|
27
|
+
- It completed in 65.86 seconds with 18 tool calls and 11 model rounds.
|
|
28
|
+
- Its first line-range Apply was followed by a corrective Apply, then verification reads.
|
|
29
|
+
- The final mismatch was a selection/correctness issue, not proof of one 65-second Apply call.
|
|
30
|
+
|
|
31
|
+
The retained `stdout.jsonl` and `tool-calls.json` record order but not tool start/end wall-clock timestamps. They are insufficient for phase-level latency attribution. Future benchmark capture should preserve tool-call duration or tool lifecycle timestamps without changing pass/fail semantics.
|
|
32
|
+
|
|
33
|
+
## Apply lifecycle and costs
|
|
34
|
+
|
|
35
|
+
### 1. Guest execution
|
|
36
|
+
|
|
37
|
+
`src/extensions/pi-agent-text-editor/src/core/apply/runtime.ts`
|
|
38
|
+
|
|
39
|
+
`executeApplySource()` creates a sandbox and sends every host operation through `ApplyQueue`. The queue is deliberately serial. A flush sends all open snapshot content and every staged selection across the sandbox bridge.
|
|
40
|
+
|
|
41
|
+
This serialization is useful for deterministic snapshot semantics. It is not the main same-file 1,000-edit bottleneck, but the growing request and response payloads add cost.
|
|
42
|
+
|
|
43
|
+
### 2. Transaction execution is the primary bottleneck
|
|
44
|
+
|
|
45
|
+
`src/extensions/pi-agent-text-editor/src/core/apply/transaction.ts`
|
|
46
|
+
|
|
47
|
+
For every replacement, `executeEditorTransaction()` currently does all of the following:
|
|
48
|
+
|
|
49
|
+
1. Scans prior accepted changes for overlap.
|
|
50
|
+
2. Rebuilds expected content from the original snapshot and all prior changes.
|
|
51
|
+
3. Reads the whole current file for stale validation.
|
|
52
|
+
4. Reads and retains the whole current file again for rollback.
|
|
53
|
+
5. Rebuilds the before state.
|
|
54
|
+
6. Rebuilds the after state.
|
|
55
|
+
7. Calls `editor.editTexts()` with a full-file replacement.
|
|
56
|
+
8. Stores a receipt containing full before/after strings and detailed changes.
|
|
57
|
+
|
|
58
|
+
The accepted-change list grows after every selection. The overlap scan is quadratic. Repeated sorting and application of the growing list adds at least quadratic-logarithmic CPU work. Whole-file read/write/snapshot work is repeated `E` times for `E` selections. Receipts retain progressively changed full-file strings.
|
|
59
|
+
|
|
60
|
+
### Controlled transaction timing
|
|
61
|
+
|
|
62
|
+
Fixture:
|
|
63
|
+
|
|
64
|
+
- 11,000 lines
|
|
65
|
+
- 407,000 bytes
|
|
66
|
+
- non-overlapping replacements of `legacyCheckout` with `stableCheckout`
|
|
67
|
+
- real temporary file reads and writes
|
|
68
|
+
- the production `executeEditorTransaction()` function
|
|
69
|
+
- a minimal editor adapter with no formatter, diagnostics, presenters, or model
|
|
70
|
+
|
|
71
|
+
Results:
|
|
72
|
+
|
|
73
|
+
| Replacements | Transaction time | Full writes | Full file receipts |
|
|
74
|
+
| -----------: | -------------------------------------------: | ---------------------------: | ---------------------------: |
|
|
75
|
+
| 10 | 125 ms | 10 | 10 |
|
|
76
|
+
| 100 | 5,647 ms | 100 | 100 |
|
|
77
|
+
| 300 | 50,726 ms | 300 | 300 |
|
|
78
|
+
| 1,000 | did not finish before the 300 s test timeout | more than 300 before timeout | more than 300 before timeout |
|
|
79
|
+
|
|
80
|
+
The 1,000 sample started after the first three samples, so it had less than 249 seconds available. It still establishes that the isolated transaction alone can exceed the benchmark's 120-second limit.
|
|
81
|
+
|
|
82
|
+
To reproduce, create a focused Vitest next to `apply-transaction.test.ts` that calls `executeEditorTransaction()` with the fixture above and logs elapsed time, write count, and `outcome.files.length`. Run:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pnpm vitest run src/extensions/pi-agent-text-editor/tests/core/<profile-test>.test.ts --reporter=verbose
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Keep this as an explicit local profile, not a timing assertion in the test suite.
|
|
89
|
+
|
|
90
|
+
### 3. Snapshot refresh
|
|
91
|
+
|
|
92
|
+
`src/extensions/pi-agent-text-editor/src/core/apply/execution.ts`
|
|
93
|
+
|
|
94
|
+
After every `editorApply`, Apply refreshes every requested open snapshot with a full script-mode Read. It does this even for snapshots not changed by that flush. Script-mode Read also enables all registered views. This can add repeated full-document work between flushes.
|
|
95
|
+
|
|
96
|
+
### 4. Post-processing after bytes are correct
|
|
97
|
+
|
|
98
|
+
`src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts`
|
|
99
|
+
|
|
100
|
+
Intermediate post-processing is correctly deferred, but `finish()` runs one finalizer at a time. For many files, formatting, diagnostics, listeners, and presenters form a serial tail after the workspace has reached its final bytes. Apply also waits behind the editor's global mutation queue.
|
|
101
|
+
|
|
102
|
+
This is the clearest lifecycle explanation for `multi-file-100-unicode`: the files can become exact while finalizers continue serially.
|
|
103
|
+
|
|
104
|
+
### 5. Result and preview construction
|
|
105
|
+
|
|
106
|
+
`src/extensions/pi-agent-text-editor/src/core/apply/final-mutations.ts`
|
|
107
|
+
|
|
108
|
+
`finalApplyMutations()` scans mutation receipts for every final file and creates a unified diff. It is called independently by:
|
|
109
|
+
|
|
110
|
+
- `renderApplyOutput()` for model-facing output;
|
|
111
|
+
- `createApplyDisplay()` for TUI details.
|
|
112
|
+
|
|
113
|
+
`createUnifiedDiff()` itself runs two line-diff passes: one for the patch and one for statistics.
|
|
114
|
+
|
|
115
|
+
`src/extensions/pi-agent-text-editor/src/core/apply/output.ts`
|
|
116
|
+
|
|
117
|
+
The 2,000-line/50 KB limit bounds the returned result, not the work. Apply first builds complete sections and final diffs, joins the full text, and only then checks truncation. Oversized output is saved, then reducible sections are reduced serially. A summary is built only after this work.
|
|
118
|
+
|
|
119
|
+
The TUI renderer also receives full mutation data and can highlight, wrap, and render more rows than compact mode ultimately shows.
|
|
120
|
+
|
|
121
|
+
## Read lifecycle and costs
|
|
122
|
+
|
|
123
|
+
`src/extensions/pi-agent-read/src/core/tools/tool-read.ts`
|
|
124
|
+
|
|
125
|
+
Read currently performs these full-source stages before output truncation:
|
|
126
|
+
|
|
127
|
+
1. Read the complete resource.
|
|
128
|
+
2. Build a line document for the complete text.
|
|
129
|
+
3. Run matching read handlers.
|
|
130
|
+
4. Run requested presenters.
|
|
131
|
+
5. Validate and merge every presenter's contribution across every line.
|
|
132
|
+
6. Project and render the requested range.
|
|
133
|
+
7. Run post-read handlers.
|
|
134
|
+
8. Apply the model-facing output limit.
|
|
135
|
+
|
|
136
|
+
For script reads, all registered views are requested and model-facing output truncation is bypassed. Apply open and refresh operations use this mode.
|
|
137
|
+
|
|
138
|
+
`src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts`
|
|
139
|
+
|
|
140
|
+
Compact TUI mode compacts after content rendering. Syntax highlighting, Markdown rendering, normalization, and ANSI wrapping may therefore process the full result even when only 12 rows remain visible.
|
|
141
|
+
|
|
142
|
+
### Controlled core Read timing
|
|
143
|
+
|
|
144
|
+
Fixture:
|
|
145
|
+
|
|
146
|
+
- the same 11,000-line, 407 KB text;
|
|
147
|
+
- 20 iterations;
|
|
148
|
+
- production `createReadState()`, `projectReadState()`, and `limitReadOutput()`;
|
|
149
|
+
- no optional view, post-read handler, filesystem wait, or TUI.
|
|
150
|
+
|
|
151
|
+
Average:
|
|
152
|
+
|
|
153
|
+
| Phase | Time |
|
|
154
|
+
| ---------------------------- | -------: |
|
|
155
|
+
| Build text document | 3.45 ms |
|
|
156
|
+
| Project and render all lines | 9.55 ms |
|
|
157
|
+
| Apply 2,000-line/50 KB bound | 1.01 ms |
|
|
158
|
+
| Total measured core | 14.01 ms |
|
|
159
|
+
|
|
160
|
+
To reproduce, create a focused Vitest beside `read-tool.test.ts`, construct the fixture in memory, time the three functions with `performance.now()`, and run:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
pnpm vitest run src/extensions/pi-agent-read/tests/core/<profile-test>.test.ts --reporter=verbose
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
This result rules out the basic text projection as the source of a 26–33 second delay on this machine. It does not rule out resolver I/O, views, hooks, syntax highlighting, terminal rendering, or the next model response. Those phases need explicit live tracing.
|
|
167
|
+
|
|
168
|
+
## Recommended optimization order
|
|
169
|
+
|
|
170
|
+
| Priority | Change | Expected effect | Capability and risk |
|
|
171
|
+
| -------: | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
172
|
+
| 1 | Validate all same-file selections against one snapshot, apply the non-overlapping change set once, snapshot rollback state once, and write once per file. | Removes the confirmed 1,000-edit timeout mechanism and most receipt growth. | Keep per-operation outcomes and atomic rollback semantics. The main risk is preserving partial-failure reporting when one selection is invalid. |
|
|
173
|
+
| 2 | Store one net file result plus compact per-operation metadata instead of full before/after content for every selection. | Reduces bridge payload and retained heap from roughly edit-count × file-size. | Preserve operation status, affected resources, undo, and final diff. Do not discard failure attribution. |
|
|
174
|
+
| 3 | Reuse one computed final mutation/diff model for model output and TUI output. Compute statistics in the same diff pass. | Removes duplicate final line diffs after bytes are correct. | No capability loss. Ensure model redaction and TUI presentation remain separate projections of the shared data. |
|
|
175
|
+
| 4 | Refresh only snapshots changed by a flush, and allow Apply's editable-text refresh to skip presentation views. | Removes repeated full Read/view work between flushes. | Keep canonical text, line metadata needed by selections, and stale-snapshot checks. |
|
|
176
|
+
| 5 | Make independent final file post-processing concurrent with an explicit concurrency limit, while preserving notification order where required. | Shortens the exact-workspace lifecycle tail for multi-file edits. | Formatting or tooling that mutates shared project state may require serialization. Classify handlers before parallelizing. |
|
|
177
|
+
| 6 | Build bounded model output directly from final mutation metadata; create a full temporary preview lazily only when requested. | Avoids building huge previews merely to summarize them. | Preserve access to full output through a temporary resource. Be careful that lazy generation sees the committed snapshot. |
|
|
178
|
+
| 7 | Make compact Read/Apply renderers clip before syntax highlighting and ANSI wrapping. | Reduces synchronous TUI work and event-loop stalls on large results. | Expanded mode must still show the full presentation. Compact output must keep the useful head/tail contract. |
|
|
179
|
+
| 8 | Add phase timings to tool lifecycle records. | Separates model, resolver, mutation, post-processing, output, and TUI delays in future benchmark runs. | Metrics must not alter timeout or correctness behavior and should be off or low-cost by default. |
|
|
180
|
+
|
|
181
|
+
## Suggested next measurement
|
|
182
|
+
|
|
183
|
+
Before implementing, add temporary spans around these boundaries in a dedicated development branch:
|
|
184
|
+
|
|
185
|
+
- Apply sandbox run;
|
|
186
|
+
- transaction parse, validation, rollback snapshot, edit/write, and receipt assembly;
|
|
187
|
+
- snapshot refresh;
|
|
188
|
+
- deferred post-processing per file;
|
|
189
|
+
- final mutation/diff creation;
|
|
190
|
+
- model output reduction;
|
|
191
|
+
- TUI display creation and first render;
|
|
192
|
+
- Read resolver, document creation, each handler/view, projection, truncation, and TUI render.
|
|
193
|
+
|
|
194
|
+
Run one exact-before-timeout case and one partial case with tool start/end timestamps. This will show which partial cases are Apply latency and which are model/tool-selection trajectories.
|
|
195
|
+
|
|
196
|
+
## Implemented Apply changes
|
|
197
|
+
|
|
198
|
+
The implementation following this research now:
|
|
199
|
+
|
|
200
|
+
- batches consecutive non-overlapping replacements from one document into one guarded file write;
|
|
201
|
+
- keeps one outcome per requested operation and still rejects invalid or overlapping selections independently;
|
|
202
|
+
- captures rollback state once for the batch and records one undo transaction;
|
|
203
|
+
- retains one net file receipt instead of one progressive full-file receipt per selection;
|
|
204
|
+
- refreshes only snapshots whose resources were changed by a flush;
|
|
205
|
+
- computes final mutation diffs once and shares them between model-facing output and TUI display.
|
|
206
|
+
|
|
207
|
+
The reusable performance check is:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
pnpm profile:apply
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
It runs the 11,000-line, 1,000-replacement transaction three times, checks byte-level effects and one write, and enforces the accepted five-second ceiling. The first completed implementation run measured 367.4 ms, 348.9 ms, and 342.3 ms. The pre-change transaction did not finish 1,000 replacements in the available 249 seconds.
|
|
214
|
+
|
|
215
|
+
## Conclusion
|
|
216
|
+
|
|
217
|
+
The largest confirmed problem was not preview construction. It was per-selection transaction execution: one logical 1,000-selection file edit became 1,000 whole-file validation, snapshot, rebuild, write, and receipt cycles. The implemented batching removes that primary cost. Snapshot refresh and duplicated diff work were also reduced without removing transaction, undo, output, or post-processing behavior.
|
|
218
|
+
|
|
219
|
+
Read needs tracing around views and TUI work, but the basic 11,000-line text pipeline is fast in isolation. The benchmark's reported 26–33 second cycles should not be labeled Read latency until tool lifecycle timestamps separate the Read call from model response time.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-doctor",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,23 +8,23 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./api/catalog": {
|
|
10
10
|
"types": "./src/catalog.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-19.js"
|
|
12
12
|
},
|
|
13
13
|
"./api/connect-plugin": {
|
|
14
14
|
"types": "./src/connect-plugin.ts",
|
|
15
|
-
"default": "./runtime/entry-
|
|
15
|
+
"default": "./runtime/entry-20.js"
|
|
16
16
|
},
|
|
17
17
|
"./api/evidence": {
|
|
18
18
|
"types": "./src/evidence.ts",
|
|
19
|
-
"default": "./runtime/entry-
|
|
19
|
+
"default": "./runtime/entry-21.js"
|
|
20
20
|
},
|
|
21
21
|
"./api/executable": {
|
|
22
22
|
"types": "./src/executable.ts",
|
|
23
|
-
"default": "./runtime/entry-
|
|
23
|
+
"default": "./runtime/entry-22.js"
|
|
24
24
|
},
|
|
25
25
|
"./api/plugin-protocol": {
|
|
26
26
|
"types": "./src/plugin-protocol.ts",
|
|
27
|
-
"default": "./runtime/entry-
|
|
27
|
+
"default": "./runtime/entry-23.js"
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../dist/entry-23.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pi-agent-documentation",
|
|
3
|
+
"version": "0.6.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"types": "./src/index.ts",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./src/index.ts",
|
|
9
|
+
"default": "./runtime/entry-24.js"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"peerDependencies": {
|
|
13
|
+
"@earendil-works/pi-coding-agent": "*"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../dist/entry-24.js";
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
|
|
4
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
5
|
+
|
|
6
|
+
export const DOCUMENTATION_PROTOCOL = "pi-agent-ide-documentation" as const;
|
|
7
|
+
export const DOCUMENTATION_API_VERSION = 1 as const;
|
|
8
|
+
export const DOCUMENTATION_READY_EVENT = `${DOCUMENTATION_PROTOCOL}/core/ready` as const;
|
|
9
|
+
export const DOCUMENTATION_REGISTER_EVENT = `${DOCUMENTATION_PROTOCOL}/document/register` as const;
|
|
10
|
+
|
|
11
|
+
/** One tool-call shape that makes a packaged guide relevant. */
|
|
12
|
+
export interface AgentDocumentationTrigger {
|
|
13
|
+
readonly tool: string;
|
|
14
|
+
/** Restrict path-bearing calls to these resource prefixes. Omit for every path. */
|
|
15
|
+
readonly resourcePrefixes?: readonly string[];
|
|
16
|
+
/** Restrict calls to views with one of these prefixes. Omit for every view. */
|
|
17
|
+
readonly viewPrefixes?: readonly string[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** A packaged guide that can be discovered, read explicitly, and attached on first relevant use. */
|
|
21
|
+
export interface AgentDocumentation {
|
|
22
|
+
readonly id: string;
|
|
23
|
+
readonly description: string;
|
|
24
|
+
readonly markdown: string;
|
|
25
|
+
readonly triggers: readonly AgentDocumentationTrigger[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Loads one Markdown guide shipped with the documentation protocol package. */
|
|
29
|
+
export async function loadPackagedAgentGuide(
|
|
30
|
+
definition: Omit<AgentDocumentation, "markdown">,
|
|
31
|
+
): Promise<AgentDocumentation> {
|
|
32
|
+
return {
|
|
33
|
+
...definition,
|
|
34
|
+
markdown: await readFile(
|
|
35
|
+
path.join(await findHostPackageRoot(), "docs", "agent-guides", `${definition.id}.md`),
|
|
36
|
+
"utf8",
|
|
37
|
+
),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async function findHostPackageRoot(): Promise<string> {
|
|
42
|
+
let current = import.meta.dirname;
|
|
43
|
+
for (;;) {
|
|
44
|
+
const manifest = path.join(current, "package.json");
|
|
45
|
+
try {
|
|
46
|
+
const parsed = JSON.parse(await readFile(manifest, "utf8")) as { readonly name?: unknown };
|
|
47
|
+
if (parsed.name === "pi-agent-ide") return current;
|
|
48
|
+
} catch {
|
|
49
|
+
// Continue to the parent when this directory has no readable package manifest.
|
|
50
|
+
}
|
|
51
|
+
const parent = path.dirname(current);
|
|
52
|
+
if (parent === current) throw new Error("Cannot locate the pi-agent-ide package root");
|
|
53
|
+
current = parent;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Registers packaged agent documentation without depending on documentation-core load order. */
|
|
58
|
+
export function connectAgentDocumentation(
|
|
59
|
+
pi: ExtensionAPI,
|
|
60
|
+
documents: readonly AgentDocumentation[],
|
|
61
|
+
): void {
|
|
62
|
+
const announce = (): void => pi.events.emit(DOCUMENTATION_REGISTER_EVENT, { documents });
|
|
63
|
+
let unsubscribe = pi.events.on(DOCUMENTATION_READY_EVENT, () => {
|
|
64
|
+
announce();
|
|
65
|
+
unsubscribe();
|
|
66
|
+
});
|
|
67
|
+
pi.on("session_shutdown", unsubscribe);
|
|
68
|
+
announce();
|
|
69
|
+
}
|
|
@@ -37,10 +37,6 @@ export default async function registerFilesystemPlugin(pi: ExtensionAPI): Promis
|
|
|
37
37
|
readHost.listDescriptions(),
|
|
38
38
|
),
|
|
39
39
|
);
|
|
40
|
-
|
|
41
|
-
api.addPromptGuideline(
|
|
42
|
-
"Use read with paths relative to the current working directory for project files. Use read with absolute paths for files elsewhere on the system.",
|
|
43
|
-
);
|
|
44
40
|
},
|
|
45
41
|
} satisfies ReadPlugin;
|
|
46
42
|
const textEditorPlugin = {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-filesystem",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"pi-agent-image": "0.6.
|
|
10
|
-
"pi-agent-read": "0.6.
|
|
11
|
-
"pi-agent-resource": "0.6.
|
|
12
|
-
"pi-agent-text": "0.6.
|
|
13
|
-
"pi-agent-text-editor": "0.6.
|
|
9
|
+
"pi-agent-image": "0.6.2",
|
|
10
|
+
"pi-agent-read": "0.6.2",
|
|
11
|
+
"pi-agent-resource": "0.6.2",
|
|
12
|
+
"pi-agent-text": "0.6.2",
|
|
13
|
+
"pi-agent-text-editor": "0.6.2"
|
|
14
14
|
},
|
|
15
15
|
"pi": {
|
|
16
16
|
"extensions": [
|
|
17
|
-
"./runtime/entry-
|
|
17
|
+
"./runtime/entry-25.js"
|
|
18
18
|
]
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-filesystem-image",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#extension": "./index.ts"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"pi-agent-image": "0.6.
|
|
10
|
-
"pi-agent-resource": "0.6.
|
|
9
|
+
"pi-agent-image": "0.6.2",
|
|
10
|
+
"pi-agent-resource": "0.6.2"
|
|
11
11
|
},
|
|
12
12
|
"pi": {
|
|
13
13
|
"extensions": [
|
|
14
|
-
"./runtime/entry-
|
|
14
|
+
"./runtime/entry-26.js"
|
|
15
15
|
]
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { connectDoctorPlugin } from "pi-agent-doctor/api/connect-plugin";
|
|
3
|
+
import { isExecutableAvailable, probeExecutable } from "pi-agent-doctor/api/executable";
|
|
4
|
+
import {
|
|
5
|
+
DOCTOR_API_VERSION,
|
|
6
|
+
DOCTOR_PROTOCOL,
|
|
7
|
+
type DoctorPlugin,
|
|
8
|
+
} from "pi-agent-doctor/api/plugin-protocol";
|
|
9
|
+
import { connectAgentDocumentation, loadPackagedAgentGuide } from "pi-agent-documentation";
|
|
10
|
+
import { connectReadPlugin } from "pi-agent-read/api/connect-plugin";
|
|
11
|
+
import {
|
|
12
|
+
READ_API_VERSION,
|
|
13
|
+
READ_PROTOCOL,
|
|
14
|
+
type ReadPlugin,
|
|
15
|
+
} from "pi-agent-read/api/plugin-protocol";
|
|
16
|
+
import type { ReadTextState } from "pi-agent-read/api/tools/read";
|
|
17
|
+
import { createTextDocument } from "pi-agent-text";
|
|
18
|
+
|
|
19
|
+
import { executeJq, parseJqView } from "#src/jq.js";
|
|
20
|
+
|
|
21
|
+
export default async function registerFilesystemJq(pi: ExtensionAPI): Promise<void> {
|
|
22
|
+
connectAgentDocumentation(pi, [
|
|
23
|
+
await loadPackagedAgentGuide({
|
|
24
|
+
id: "json-reading",
|
|
25
|
+
description: "Query and transform JSON resources with jq read views",
|
|
26
|
+
triggers: [{ tool: "read", viewPrefixes: ["jq:"] }],
|
|
27
|
+
}),
|
|
28
|
+
]);
|
|
29
|
+
await Promise.all([connectReadPlugin(pi, readPlugin), connectDoctorPlugin(pi, doctorPlugin)]);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const readPlugin = {
|
|
33
|
+
protocol: READ_PROTOCOL,
|
|
34
|
+
apiVersion: READ_API_VERSION,
|
|
35
|
+
id: "filesystem-jq",
|
|
36
|
+
setup(api) {
|
|
37
|
+
api.addView({
|
|
38
|
+
view: "jq",
|
|
39
|
+
presenter: { id: "filesystem-jq", present: (document) => document },
|
|
40
|
+
});
|
|
41
|
+
api.addHandler({
|
|
42
|
+
stage: "read",
|
|
43
|
+
when: { resolvedBy: "filesystem", contentKind: "text" },
|
|
44
|
+
async handler(context) {
|
|
45
|
+
const state = context.state;
|
|
46
|
+
if (state?.contentKind !== "text") return { kind: "continue", context };
|
|
47
|
+
let selected: ReturnType<typeof parseJqView>;
|
|
48
|
+
try {
|
|
49
|
+
selected = parseJqView(context.request.views);
|
|
50
|
+
} catch (error) {
|
|
51
|
+
return jqFailure(state, error instanceof Error ? error.message : String(error));
|
|
52
|
+
}
|
|
53
|
+
if (selected === undefined) return { kind: "continue", context };
|
|
54
|
+
let output: string;
|
|
55
|
+
try {
|
|
56
|
+
output = await executeJq(selected.filter, state.content[0].text, {
|
|
57
|
+
cwd: context.resolverContext.cwd,
|
|
58
|
+
...(context.resolverContext.signal === undefined
|
|
59
|
+
? {}
|
|
60
|
+
: { signal: context.resolverContext.signal }),
|
|
61
|
+
});
|
|
62
|
+
} catch (error) {
|
|
63
|
+
return jqFailure(state, error instanceof Error ? error.message : String(error));
|
|
64
|
+
}
|
|
65
|
+
const transformed: ReadTextState = {
|
|
66
|
+
...state,
|
|
67
|
+
content: [{ type: "text", text: output }],
|
|
68
|
+
text: createTextDocument(state.source, output),
|
|
69
|
+
preserveTruncatedOutput: true,
|
|
70
|
+
};
|
|
71
|
+
return { kind: "continue", context: { ...context, state: transformed } };
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
api.describe(
|
|
75
|
+
'JSON files accept views such as ["jq:.scripts | keys"] to query them with the installed jq executable.',
|
|
76
|
+
);
|
|
77
|
+
},
|
|
78
|
+
} satisfies ReadPlugin;
|
|
79
|
+
|
|
80
|
+
function jqFailure(state: ReadTextState, message: string) {
|
|
81
|
+
return {
|
|
82
|
+
kind: "return" as const,
|
|
83
|
+
result: {
|
|
84
|
+
content: [{ type: "text" as const, text: `jq failed: ${message}` }],
|
|
85
|
+
details: {
|
|
86
|
+
source: state.source,
|
|
87
|
+
resolvedBy: state.resolvedBy,
|
|
88
|
+
failure: {
|
|
89
|
+
code: "READ_FAILED" as const,
|
|
90
|
+
source: state.source,
|
|
91
|
+
resolverId: state.resolvedBy,
|
|
92
|
+
pluginId: "filesystem-jq",
|
|
93
|
+
stage: "read" as const,
|
|
94
|
+
message,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
isError: true,
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
const doctorPlugin = {
|
|
102
|
+
protocol: DOCTOR_PROTOCOL,
|
|
103
|
+
apiVersion: DOCTOR_API_VERSION,
|
|
104
|
+
id: "filesystem-jq",
|
|
105
|
+
setup(api) {
|
|
106
|
+
api.addSetupCheck({
|
|
107
|
+
id: "jq",
|
|
108
|
+
async inspect(context) {
|
|
109
|
+
return (await isExecutableAvailable("jq", context.cwd, context.env))
|
|
110
|
+
? {}
|
|
111
|
+
: {
|
|
112
|
+
actions: [
|
|
113
|
+
{
|
|
114
|
+
id: "jq-unavailable",
|
|
115
|
+
message: "JSON jq views are unavailable because jq was not found",
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
};
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
api.addCheck({
|
|
122
|
+
id: "jq",
|
|
123
|
+
title: "JSON jq views",
|
|
124
|
+
async run(context) {
|
|
125
|
+
const result = await probeExecutable("jq", ["--version"], context.cwd, context.env);
|
|
126
|
+
return [
|
|
127
|
+
result.ok
|
|
128
|
+
? { status: "pass", message: "jq is available", detail: result.detail }
|
|
129
|
+
: { status: "fail", message: "jq is not available", detail: result.detail },
|
|
130
|
+
];
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
},
|
|
134
|
+
} satisfies DoctorPlugin;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pi-agent-filesystem-jq",
|
|
3
|
+
"version": "0.6.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"imports": {
|
|
6
|
+
"#src/*": "./src/*"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"cross-spawn": "^7.0.6",
|
|
10
|
+
"pi-agent-doctor": "0.6.2",
|
|
11
|
+
"pi-agent-documentation": "0.6.2",
|
|
12
|
+
"pi-agent-read": "0.6.2",
|
|
13
|
+
"pi-agent-text": "0.6.2"
|
|
14
|
+
},
|
|
15
|
+
"pi": {
|
|
16
|
+
"extensions": [
|
|
17
|
+
"./runtime/entry-27.js"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"@earendil-works/pi-coding-agent": "*"
|
|
22
|
+
}
|
|
23
|
+
}
|