pi-agent-ide 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/README.md +81 -23
- 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 +1 -0
- package/dist/{chunk-LY6U5EAD.js → chunk-2527OQ4Y.js} +1 -1
- package/dist/chunk-3XJ3KDPZ.js +16 -0
- package/dist/chunk-5JELU6RV.js +7 -0
- package/dist/chunk-DDKHZZDO.js +5 -0
- package/dist/chunk-FEDVTZJG.js +1 -0
- package/dist/chunk-HSM6R7IB.js +27 -0
- package/dist/chunk-K5G4FDXD.js +1 -0
- package/dist/chunk-M5IVSCR2.js +1 -0
- package/dist/chunk-OYWIZII6.js +1 -0
- package/dist/chunk-P7XO5CIP.js +2 -0
- package/dist/chunk-PCZH7GOX.js +26 -0
- package/dist/{chunk-DQXPQOF7.js → chunk-SQ7ZTGOP.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 -0
- package/dist/entry-18.js +1 -1
- package/dist/entry-19.js +1 -1
- package/dist/entry-20.js +1 -1
- package/dist/entry-21.js +1 -1
- package/dist/entry-22.js +1 -2
- package/dist/entry-23.js +2 -1
- package/dist/entry-24.js +1 -1
- package/dist/entry-25.js +1 -1
- package/dist/entry-26.js +1 -1
- package/dist/entry-27.js +1 -12
- package/dist/entry-28.js +12 -1
- package/dist/entry-29.js +1 -1
- package/dist/entry-30.js +1 -1
- package/dist/entry-31.js +1 -1
- package/dist/entry-32.js +1 -4
- package/dist/entry-33.js +3 -8
- package/dist/entry-34.js +9 -1
- package/dist/entry-35.js +1 -1
- package/dist/entry-36.js +1 -1
- package/dist/entry-37.js +1 -1
- package/dist/entry-38.js +1 -1
- package/dist/entry-39.js +1 -1
- package/dist/entry-40.js +1 -1
- package/dist/entry-41.js +1 -18
- package/dist/entry-42.js +18 -1
- package/dist/entry-43.js +1 -1
- package/dist/entry-44.js +1 -1
- package/dist/entry-45.js +1 -1
- package/dist/entry-46.js +1 -7
- package/dist/entry-47.js +7 -11
- package/dist/entry-48.js +11 -1
- package/dist/entry-49.js +1 -1
- package/dist/entry-50.js +1 -1
- package/dist/entry-51.js +1 -1
- package/dist/entry-52.js +1 -1
- package/dist/entry-53.js +1 -1
- package/dist/entry-54.js +1 -1
- package/dist/entry-55.js +1 -1
- package/dist/entry-56.js +1 -0
- package/dist/entry-57.js +0 -1
- package/dist/entry-58.js +1 -0
- package/dist/entry-59.js +0 -1
- package/dist/entry-60.js +1 -1
- package/dist/entry-61.js +1 -1
- package/dist/entry-62.js +1 -1
- package/dist/entry-63.js +1 -1
- package/dist/entry-64.js +1 -1
- package/dist/entry-65.js +1 -0
- package/dist/entry-66.js +0 -1
- package/dist/entry-67.js +1 -0
- package/dist/entry-68.js +0 -1
- package/dist/entry-69.js +1 -1
- package/dist/entry-70.js +1 -1
- package/dist/entry-71.js +1 -203
- package/dist/entry-72.js +254 -25
- package/dist/entry-73.js +30 -2
- package/dist/entry-74.js +2 -1
- package/dist/entry-75.js +1 -1
- package/dist/entry-76.js +1 -1
- package/dist/entry-77.js +3 -3
- package/dist/entry-78.js +3 -1
- package/dist/entry-79.js +1 -1
- package/dist/entry-80.js +1 -1
- package/dist/entry-81.js +1 -0
- package/dist/pi-agent-ide.js +3 -3
- package/docs/configuration.md +3 -1
- package/docs/development.md +0 -6
- package/docs/tools.md +12 -0
- package/node_modules/pi-agent-doctor/package.json +6 -6
- package/node_modules/pi-agent-doctor/runtime/entry-22.js +1 -0
- package/node_modules/pi-agent-filesystem/package.json +7 -7
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- 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-26.js +2 -0
- package/node_modules/pi-agent-ide-ast/package.json +12 -11
- package/node_modules/pi-agent-ide-ast/runtime/entry-27.js +0 -1
- package/node_modules/pi-agent-ide-ast/runtime/entry-28.js +2 -0
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +8 -6
- package/node_modules/pi-agent-ide-changes/package.json +8 -8
- package/node_modules/pi-agent-ide-changes/runtime/entry-29.js +0 -1
- package/node_modules/pi-agent-ide-formatter/package.json +4 -4
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-lint/package.json +8 -8
- package/node_modules/pi-agent-ide-lint/src/command-linter.ts +3 -1
- package/node_modules/pi-agent-ide-lsp/package.json +10 -10
- package/node_modules/pi-agent-ide-lsp/runtime/entry-34.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 +11 -11
- package/node_modules/pi-agent-read/runtime/entry-41.js +0 -1
- package/node_modules/pi-agent-read/runtime/entry-42.js +2 -0
- package/node_modules/pi-agent-read/src/api/read-parameters.ts +2 -2
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +11 -6
- package/node_modules/pi-agent-resource/package.json +2 -2
- package/node_modules/pi-agent-search/package.json +7 -7
- package/node_modules/pi-agent-search/runtime/entry-46.js +0 -1
- package/node_modules/pi-agent-search-text/package.json +9 -9
- package/node_modules/pi-agent-search-text/runtime/entry-48.js +1 -0
- package/node_modules/pi-agent-search-text/src/resolvers.ts +32 -27
- package/node_modules/pi-agent-search-text/src/search-session.ts +27 -1
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text/runtime/entry-50.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-51.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/index.ts +3 -3
- package/node_modules/pi-agent-text-anchor-exact/package.json +5 -5
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-52.js +0 -1
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-53.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/src/config.ts +2 -2
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-54.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-55.js +2 -0
- package/node_modules/pi-agent-text-editor/package.json +25 -25
- package/node_modules/pi-agent-text-editor/runtime/entry-71.js +0 -1
- package/node_modules/pi-agent-text-editor/src/core/apply/execution.ts +125 -3
- package/node_modules/pi-agent-text-editor/src/core/apply/mixed-source.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +14 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/output.ts +32 -3
- package/node_modules/pi-agent-text-editor/src/core/apply/prompt.ts +21 -19
- package/node_modules/pi-agent-text-editor/src/core/apply/renderer.ts +37 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/runtime.ts +85 -34
- package/node_modules/pi-agent-text-editor/src/core/apply/tool.ts +2 -3
- package/node_modules/pi-agent-text-editor/src/core/apply/transaction.ts +589 -241
- package/node_modules/pi-agent-text-editor/src/core/post-edit-scope.ts +5 -0
- package/node_modules/pi-agent-text-editor/src/core/text-editor-config.ts +3 -3
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +9 -1
- package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +53 -0
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +11 -41
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +8 -18
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +11 -41
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +9 -19
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-74.js +2 -0
- package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
- package/node_modules/pi-agent-tool-ui/package.json +2 -2
- package/node_modules/pi-agent-tool-ui/runtime/entry-76.js +1 -0
- package/node_modules/pi-agent-web/package.json +7 -7
- package/node_modules/pi-agent-web/src/resolver.ts +128 -1
- 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-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-81.js +2 -0
- package/package.json +44 -39
- package/src/api/path-identity.ts +15 -0
- package/src/composite/builtin-extensions.ts +7 -2
- package/src/composite/module-labels.ts +4 -0
- package/src/composite/module-settings.ts +34 -14
- package/src/composite/preferences.ts +46 -3
- package/src/composite/selection.ts +5 -1
- package/src/doctor/inventory.ts +7 -2
- 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-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-26.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-23.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-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-81.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-77.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/resolver.ts +128 -1
- package/src/extensions/pi-agent-read/package.json +11 -11
- package/src/extensions/pi-agent-read/runtime/entry-41.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-42.js +2 -0
- package/src/extensions/pi-agent-read/src/api/read-parameters.ts +2 -2
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +11 -6
- package/src/extensions/pi-agent-search/package.json +7 -7
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +9 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-48.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-49.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +32 -27
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +27 -1
- package/src/extensions/pi-agent-search/runtime/entry-46.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-47.js +2 -0
- package/src/extensions/pi-agent-text-editor/package.json +25 -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-51.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.ts +3 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-52.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-53.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/config.ts +2 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-54.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-55.js +2 -0
- 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-stale-anchor/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-74.js +2 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-71.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-72.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/execution.ts +125 -3
- package/src/extensions/pi-agent-text-editor/src/core/apply/mixed-source.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +14 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/output.ts +32 -3
- package/src/extensions/pi-agent-text-editor/src/core/apply/prompt.ts +21 -19
- package/src/extensions/pi-agent-text-editor/src/core/apply/renderer.ts +37 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/runtime.ts +85 -34
- package/src/extensions/pi-agent-text-editor/src/core/apply/tool.ts +2 -3
- package/src/extensions/pi-agent-text-editor/src/core/apply/transaction.ts +589 -241
- package/src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts +5 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-config.ts +3 -3
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +9 -1
- package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +53 -0
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +11 -41
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +8 -18
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +11 -41
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +9 -19
- package/src/pi-agent-ide.ts +15 -2
- package/src/plugins/pi-agent-ide-ast/package.json +12 -11
- package/src/plugins/pi-agent-ide-ast/runtime/entry-27.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-28.js +2 -0
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +8 -6
- package/src/plugins/pi-agent-ide-changes/package.json +8 -8
- package/src/plugins/pi-agent-ide-changes/runtime/entry-29.js +0 -1
- package/src/plugins/pi-agent-ide-debugger/index.ts +3 -9
- package/src/plugins/pi-agent-ide-debugger/src/adapter-executables.ts +31 -0
- package/src/plugins/pi-agent-ide-debugger/src/breakpoint-view.ts +3 -1
- package/src/plugins/pi-agent-ide-debugger/src/catalog.ts +24 -23
- package/src/plugins/pi-agent-ide-debugger/src/dap-client.ts +5 -2
- package/src/plugins/pi-agent-ide-debugger/src/doctor-plugin.ts +55 -17
- package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +55 -22
- package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-lint/package.json +8 -8
- package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +3 -1
- package/src/plugins/pi-agent-ide-lsp/package.json +10 -10
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-34.js +2 -0
- package/src/plugins/pi-agent-ide-processes/src/registry.ts +6 -0
- package/src/plugins/pi-agent-ide-processes/src/ui.ts +28 -11
- package/src/plugins/pi-agent-ide-terminal/index.ts +1 -1
- package/src/plugins/pi-agent-ide-terminal/src/process-provider.ts +2 -0
- package/src/plugins/pi-agent-ide-terminal/src/search.ts +32 -2
- package/src/plugins/pi-agent-ide-terminal/src/session-manager.ts +5 -4
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +2 -2
- package/src/plugins/pi-agent-ide-terminal/src/types.ts +3 -1
- package/src/plugins/pi-agent-ide-terminal/src/ui.ts +1 -1
- package/src/plugins/pi-agent-ide-vision/index.ts +232 -0
- package/src/plugins/pi-agent-ide-vision/src/vision.ts +530 -0
- package/src/plugins/pi-agent-ide-vision/src/windows-display-capture.ps1 +30 -0
- package/src/plugins/pi-agent-ide-vision/src/windows-window-capture.ps1 +33 -0
- package/dist/chunk-5PLV4HLG.js +0 -1
- package/dist/chunk-BGUSBUUD.js +0 -26
- package/dist/chunk-G725MARR.js +0 -16
- package/dist/chunk-HKXDP2FD.js +0 -7
- package/dist/chunk-J4RTW44E.js +0 -1
- package/dist/chunk-QH4ZUDOD.js +0 -1
- package/dist/chunk-WGGIQ7IJ.js +0 -1
- package/dist/chunk-ZG2MWXCR.js +0 -2
- package/dist/chunk-ZUMN6U77.js +0 -27
- package/dist/entry-17.js +0 -1
- package/docs/evaluation.md +0 -14
- package/node_modules/pi-agent-doctor/runtime/entry-17.js +0 -1
- package/node_modules/pi-agent-filesystem/runtime/entry-22.js +0 -2
- package/node_modules/pi-agent-ide-ast/runtime/entry-26.js +0 -1
- package/node_modules/pi-agent-ide-changes/runtime/entry-28.js +0 -1
- package/node_modules/pi-agent-image/runtime/entry-34.js +0 -1
- package/node_modules/pi-agent-resource/runtime/entry-42.js +0 -1
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-50.js +0 -2
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-51.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-53.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-55.js +0 -1
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-74.js +0 -1
- package/node_modules/pi-agent-web/runtime/entry-76.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-23.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-22.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-77.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-76.js +0 -2
- package/src/extensions/pi-agent-read/runtime/entry-37.js +0 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-47.js +0 -2
- package/src/extensions/pi-agent-search/runtime/entry-43.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-50.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-51.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-53.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-72.js +0 -2
- package/src/extensions/pi-agent-text-editor/runtime/entry-55.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-26.js +0 -1
- package/src/plugins/pi-agent-ide-changes/runtime/entry-28.js +0 -1
- /package/node_modules/{pi-agent-filesystem-image → pi-agent-filesystem}/runtime/entry-23.js +0 -0
- /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-24.js +0 -0
- /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-25.js +0 -0
- /package/node_modules/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-30.js +0 -0
- /package/node_modules/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-31.js +0 -0
- /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-32.js +0 -0
- /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-33.js +0 -0
- /package/node_modules/{pi-agent-invariant → pi-agent-image}/runtime/entry-35.js +0 -0
- /package/node_modules/{pi-agent-pdf → pi-agent-invariant}/runtime/entry-36.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-37.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-43.js +0 -0
- /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-47.js +0 -0
- /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-49.js +0 -0
- /package/node_modules/{pi-agent-text-editor-renderer → pi-agent-text-editor}/runtime/entry-72.js +0 -0
- /package/node_modules/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-73.js +0 -0
- /package/node_modules/{pi-agent-tool-ui → pi-agent-tool-call-interception}/runtime/entry-75.js +0 -0
- /package/node_modules/{pi-agent-web-html → pi-agent-web}/runtime/entry-77.js +0 -0
- /package/node_modules/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-78.js +0 -0
- /package/node_modules/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-79.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-80.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-24.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-25.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-78.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-79.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-80.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-73.js +0 -0
- /package/src/plugins/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-30.js +0 -0
- /package/src/plugins/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-31.js +0 -0
- /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-32.js +0 -0
- /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-33.js +0 -0
|
@@ -36,6 +36,11 @@ export function deferPostEdit(source: string, finalize: Finalize): boolean {
|
|
|
36
36
|
export function hasDeferredPostEdit(source: string): boolean {
|
|
37
37
|
return active.getStore()?.has(source) ?? false;
|
|
38
38
|
}
|
|
39
|
+
|
|
40
|
+
/** Stop deferred processing when a later operation removes or moves the resource. */
|
|
41
|
+
export function forgetDeferredPostEdit(source: string): void {
|
|
42
|
+
active.getStore()?.delete(source);
|
|
43
|
+
}
|
|
39
44
|
/** Writes stay immediate; finishing drains each surviving final resource once. */
|
|
40
45
|
export function createPostEditScope() {
|
|
41
46
|
const pending = new Map<string, Finalize>();
|
|
@@ -21,21 +21,21 @@ export function loadTextEditorConfig(cwd: string): LoadedTextEditorConfig {
|
|
|
21
21
|
value = JSON.parse(readFileSync(file, "utf8"));
|
|
22
22
|
} catch (error) {
|
|
23
23
|
if (isMissingFile(error)) {
|
|
24
|
-
return { contextLines:
|
|
24
|
+
return { contextLines: 15, timeoutMs: 2000, sections: {} };
|
|
25
25
|
}
|
|
26
26
|
throw new Error(`Invalid text editor config at ${file}`, { cause: error });
|
|
27
27
|
}
|
|
28
28
|
const root = record(value, "text editor config");
|
|
29
29
|
assertKeys(root, ["recovery", "renderer"], "text editor config");
|
|
30
30
|
if (root.recovery === undefined) {
|
|
31
|
-
return { contextLines:
|
|
31
|
+
return { contextLines: 15, timeoutMs: 2000, sections: {} };
|
|
32
32
|
}
|
|
33
33
|
const recovery = record(root.recovery, "recovery");
|
|
34
34
|
const sections = Object.fromEntries(
|
|
35
35
|
Object.entries(recovery).filter(([key]) => key !== "contextLines" && key !== "timeoutMs"),
|
|
36
36
|
);
|
|
37
37
|
return {
|
|
38
|
-
contextLines: integer(recovery.contextLines, "contextLines", 0, 20,
|
|
38
|
+
contextLines: integer(recovery.contextLines, "contextLines", 0, 20, 15),
|
|
39
39
|
timeoutMs: integer(recovery.timeoutMs, "timeoutMs", 1, 10_000, 2000),
|
|
40
40
|
sections,
|
|
41
41
|
};
|
|
@@ -274,6 +274,8 @@ export interface TextAnchorInTextRequest {
|
|
|
274
274
|
readonly content: string;
|
|
275
275
|
readonly value: string;
|
|
276
276
|
readonly cwd: string;
|
|
277
|
+
/** Limit resolution to these registered anchor kinds. Omit to use all configured resolvers. */
|
|
278
|
+
readonly kinds?: readonly string[];
|
|
277
279
|
readonly signal?: AbortSignal;
|
|
278
280
|
}
|
|
279
281
|
|
|
@@ -618,7 +620,13 @@ export function createTextEditorCore(
|
|
|
618
620
|
...(request.signal !== undefined && { signal: request.signal }),
|
|
619
621
|
};
|
|
620
622
|
|
|
621
|
-
return anchorRegistry
|
|
623
|
+
return anchorRegistry
|
|
624
|
+
.snapshot()
|
|
625
|
+
.resolve(
|
|
626
|
+
request.value,
|
|
627
|
+
context,
|
|
628
|
+
request.kinds === undefined ? undefined : new Set(request.kinds),
|
|
629
|
+
);
|
|
622
630
|
},
|
|
623
631
|
editText<Result>(
|
|
624
632
|
source: string,
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Type } from "typebox";
|
|
2
|
+
|
|
3
|
+
/** Build the source selector shared by text mutation schemas. */
|
|
4
|
+
export function sourcePathProperty(description: string) {
|
|
5
|
+
return Type.Optional(Type.String({ description }));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/** Build the inclusive source-range selectors shared by text mutation schemas. */
|
|
9
|
+
export function sourceRangeProperties() {
|
|
10
|
+
return {
|
|
11
|
+
start: Type.Optional(
|
|
12
|
+
Type.String({
|
|
13
|
+
description:
|
|
14
|
+
"Anchor or unique exact text. Alone, selects that fragment; a line anchor selects only its line. Omit when path already selects text through a supported resource reference. With end, selects a whole-line range.",
|
|
15
|
+
}),
|
|
16
|
+
),
|
|
17
|
+
end: Type.Optional(
|
|
18
|
+
Type.String({
|
|
19
|
+
description:
|
|
20
|
+
"Optional anchor or unique exact text. Range includes start's first line through end's last line, even for SEARCH :match. Mixed types allowed; boundaries must be unique, in one file, and forward-ordered. Omit when start already selects the intended content; do not repeat start. The end line is included, not a stopping point before it.",
|
|
21
|
+
}),
|
|
22
|
+
),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Build the destination selectors shared by copy and move schemas. */
|
|
27
|
+
export function targetProperties() {
|
|
28
|
+
return {
|
|
29
|
+
target: Type.Optional(
|
|
30
|
+
Type.String({
|
|
31
|
+
description:
|
|
32
|
+
"Target resource reference or file path. Required for a whole-file operation; defaults to the source for selected text.",
|
|
33
|
+
}),
|
|
34
|
+
),
|
|
35
|
+
targetStart: Type.Optional(
|
|
36
|
+
Type.String({
|
|
37
|
+
description:
|
|
38
|
+
"Registered anchor or unique exact text in the destination. Required unless target already selects one destination range. Without targetEnd, inserts after the last containing line, keeping the selected text. With targetEnd, replacement starts at the first containing line. SEARCH :match also uses these line boundaries.",
|
|
39
|
+
}),
|
|
40
|
+
),
|
|
41
|
+
targetEnd: Type.Optional(
|
|
42
|
+
Type.String({
|
|
43
|
+
description:
|
|
44
|
+
"Optional inclusive destination end. Replaces whole lines through the last line containing this anchor, including SEARCH :match. May differ in type from targetStart; both must resolve uniquely in the target file and in forward order. Omit to insert after targetStart instead.",
|
|
45
|
+
}),
|
|
46
|
+
),
|
|
47
|
+
overwrite: Type.Optional(
|
|
48
|
+
Type.Boolean({
|
|
49
|
+
description: "Allow replacing an existing regular target file. Defaults to false.",
|
|
50
|
+
}),
|
|
51
|
+
),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { Type } from "typebox";
|
|
2
2
|
|
|
3
|
+
import {
|
|
4
|
+
sourcePathProperty,
|
|
5
|
+
sourceRangeProperties,
|
|
6
|
+
targetProperties,
|
|
7
|
+
} from "#src/tools/text-tool-schema-properties.js";
|
|
8
|
+
|
|
3
9
|
import { TEXT_POSITION_ANCHOR_KIND, TEXT_SEARCH_ANCHOR_KIND } from "#src/api/plugin-protocol.js";
|
|
4
10
|
import {
|
|
5
11
|
anchorSpanRange,
|
|
@@ -11,50 +17,14 @@ import type { TextMutationToolRegistration } from "#src/api/mutation-tool.js";
|
|
|
11
17
|
|
|
12
18
|
export const copySchema = Type.Object(
|
|
13
19
|
{
|
|
14
|
-
path:
|
|
15
|
-
|
|
16
|
-
description: "Source file path, or a returned SEARCH# reference selecting the text to copy",
|
|
17
|
-
}),
|
|
18
|
-
),
|
|
19
|
-
start: Type.Optional(
|
|
20
|
-
Type.String({
|
|
21
|
-
description:
|
|
22
|
-
"Anchor or unique exact text. Alone, selects that fragment; a line anchor selects only its line. Omit when path already selects text through a supported resource reference. With end, selects a whole-line range.",
|
|
23
|
-
}),
|
|
24
|
-
),
|
|
25
|
-
end: Type.Optional(
|
|
26
|
-
Type.String({
|
|
27
|
-
description:
|
|
28
|
-
"Optional anchor or unique exact text. Range includes start's first line through end's last line, even for SEARCH :match. Mixed types allowed; boundaries must be unique, in one file, and forward-ordered. Omit when start already selects the intended content; do not repeat start. The end line is included, not a stopping point before it.",
|
|
29
|
-
}),
|
|
30
|
-
),
|
|
31
|
-
target: Type.Optional(
|
|
32
|
-
Type.String({
|
|
33
|
-
description:
|
|
34
|
-
"Target resource reference or file path. Required for a whole-file operation; defaults to the source for selected text.",
|
|
35
|
-
}),
|
|
36
|
-
),
|
|
37
|
-
targetStart: Type.Optional(
|
|
38
|
-
Type.String({
|
|
39
|
-
description:
|
|
40
|
-
"Registered anchor or unique exact text in the destination. Required unless target already selects one destination range. Without targetEnd, inserts after the last containing line, keeping the selected text. With targetEnd, replacement starts at the first containing line. SEARCH :match also uses these line boundaries.",
|
|
41
|
-
}),
|
|
42
|
-
),
|
|
43
|
-
targetEnd: Type.Optional(
|
|
44
|
-
Type.String({
|
|
45
|
-
description:
|
|
46
|
-
"Optional inclusive destination end. Replaces whole lines through the last line containing this anchor, including SEARCH :match. May differ in type from targetStart; both must resolve uniquely in the target file and in forward order. Omit to insert after targetStart instead.",
|
|
47
|
-
}),
|
|
48
|
-
),
|
|
49
|
-
overwrite: Type.Optional(
|
|
50
|
-
Type.Boolean({
|
|
51
|
-
description: "Allow replacing an existing regular target file. Defaults to false.",
|
|
52
|
-
}),
|
|
20
|
+
path: sourcePathProperty(
|
|
21
|
+
"Source file path, or a returned SEARCH# reference selecting the text to copy",
|
|
53
22
|
),
|
|
23
|
+
...sourceRangeProperties(),
|
|
24
|
+
...targetProperties(),
|
|
54
25
|
},
|
|
55
26
|
{ additionalProperties: false },
|
|
56
27
|
);
|
|
57
|
-
|
|
58
28
|
interface CopyParameters {
|
|
59
29
|
readonly path?: string;
|
|
60
30
|
readonly start?: string;
|
|
@@ -68,7 +38,7 @@ export const copyMutationTool: TextMutationToolRegistration<typeof copySchema> =
|
|
|
68
38
|
name: "copy",
|
|
69
39
|
wholeFileOperation: "copy",
|
|
70
40
|
description:
|
|
71
|
-
"Use copy to copy one regular file
|
|
41
|
+
"Use copy to copy one regular file, or to duplicate selected text within or between files.",
|
|
72
42
|
|
|
73
43
|
promptSnippet: "Copy regular files, or copy selected text within or between files",
|
|
74
44
|
parameters: copySchema,
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { Type } from "typebox";
|
|
2
2
|
|
|
3
|
+
import {
|
|
4
|
+
sourcePathProperty,
|
|
5
|
+
sourceRangeProperties,
|
|
6
|
+
} from "#src/tools/text-tool-schema-properties.js";
|
|
7
|
+
|
|
3
8
|
import { TEXT_POSITION_ANCHOR_KIND, TEXT_SEARCH_ANCHOR_KIND } from "#src/api/plugin-protocol.js";
|
|
4
9
|
import {
|
|
5
10
|
anchorSpanRange,
|
|
@@ -12,28 +17,13 @@ import type { TextMutationToolRegistration } from "#src/api/mutation-tool.js";
|
|
|
12
17
|
|
|
13
18
|
export const deleteSchema = Type.Object(
|
|
14
19
|
{
|
|
15
|
-
path:
|
|
16
|
-
|
|
17
|
-
description:
|
|
18
|
-
"Source resource reference or file path. A returned SEARCH# reference can select deletion ranges.",
|
|
19
|
-
}),
|
|
20
|
-
),
|
|
21
|
-
start: Type.Optional(
|
|
22
|
-
Type.String({
|
|
23
|
-
description:
|
|
24
|
-
"Anchor or unique exact text. Alone, selects that fragment; a line anchor selects only its line. Omit when path already selects text through a supported resource reference. With end, selects a whole-line range.",
|
|
25
|
-
}),
|
|
26
|
-
),
|
|
27
|
-
end: Type.Optional(
|
|
28
|
-
Type.String({
|
|
29
|
-
description:
|
|
30
|
-
"Optional anchor or unique exact text. Range includes start's first line through end's last line, even for SEARCH :match. Mixed types allowed; boundaries must be unique, in one file, and forward-ordered. Omit when start already selects the intended content; do not repeat start. The end line is included, not a stopping point before it.",
|
|
31
|
-
}),
|
|
20
|
+
path: sourcePathProperty(
|
|
21
|
+
"Source resource reference or file path. A returned SEARCH# reference can select deletion ranges.",
|
|
32
22
|
),
|
|
23
|
+
...sourceRangeProperties(),
|
|
33
24
|
},
|
|
34
25
|
{ additionalProperties: false },
|
|
35
26
|
);
|
|
36
|
-
|
|
37
27
|
interface DeleteParameters {
|
|
38
28
|
readonly path?: string;
|
|
39
29
|
readonly start?: string;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { Type } from "typebox";
|
|
2
2
|
|
|
3
|
+
import {
|
|
4
|
+
sourcePathProperty,
|
|
5
|
+
sourceRangeProperties,
|
|
6
|
+
targetProperties,
|
|
7
|
+
} from "#src/tools/text-tool-schema-properties.js";
|
|
8
|
+
|
|
3
9
|
import { TEXT_POSITION_ANCHOR_KIND, TEXT_SEARCH_ANCHOR_KIND } from "#src/api/plugin-protocol.js";
|
|
4
10
|
import {
|
|
5
11
|
anchorSpanRange,
|
|
@@ -13,50 +19,14 @@ import type { TextChange } from "#src/core/text-change-engine.js";
|
|
|
13
19
|
|
|
14
20
|
export const moveSchema = Type.Object(
|
|
15
21
|
{
|
|
16
|
-
path:
|
|
17
|
-
|
|
18
|
-
description: "Source file path, or a returned SEARCH# reference selecting the text to move",
|
|
19
|
-
}),
|
|
20
|
-
),
|
|
21
|
-
start: Type.Optional(
|
|
22
|
-
Type.String({
|
|
23
|
-
description:
|
|
24
|
-
"Anchor or unique exact text. Alone, selects that fragment; a line anchor selects only its line. Omit when path already selects text through a supported resource reference. With end, selects a whole-line range.",
|
|
25
|
-
}),
|
|
26
|
-
),
|
|
27
|
-
end: Type.Optional(
|
|
28
|
-
Type.String({
|
|
29
|
-
description:
|
|
30
|
-
"Optional anchor or unique exact text. Range includes start's first line through end's last line, even for SEARCH :match. Mixed types allowed; boundaries must be unique, in one file, and forward-ordered. Omit when start already selects the intended content; do not repeat start. The end line is included, not a stopping point before it.",
|
|
31
|
-
}),
|
|
32
|
-
),
|
|
33
|
-
target: Type.Optional(
|
|
34
|
-
Type.String({
|
|
35
|
-
description:
|
|
36
|
-
"Target resource reference or file path. Required for a whole-file operation; defaults to the source for selected text.",
|
|
37
|
-
}),
|
|
38
|
-
),
|
|
39
|
-
targetStart: Type.Optional(
|
|
40
|
-
Type.String({
|
|
41
|
-
description:
|
|
42
|
-
"Registered anchor or unique exact text in the destination. Required unless target already selects one destination range. Without targetEnd, inserts after the last containing line, keeping the selected text. With targetEnd, replacement starts at the first containing line. SEARCH :match also uses these line boundaries.",
|
|
43
|
-
}),
|
|
44
|
-
),
|
|
45
|
-
targetEnd: Type.Optional(
|
|
46
|
-
Type.String({
|
|
47
|
-
description:
|
|
48
|
-
"Optional inclusive destination end. Replaces whole lines through the last line containing this anchor, including SEARCH :match. May differ in type from targetStart; both must resolve uniquely in the target file and in forward order. Omit to insert after targetStart instead.",
|
|
49
|
-
}),
|
|
50
|
-
),
|
|
51
|
-
overwrite: Type.Optional(
|
|
52
|
-
Type.Boolean({
|
|
53
|
-
description: "Allow replacing an existing regular target file. Defaults to false.",
|
|
54
|
-
}),
|
|
22
|
+
path: sourcePathProperty(
|
|
23
|
+
"Source file path, or a returned SEARCH# reference selecting the text to move",
|
|
55
24
|
),
|
|
25
|
+
...sourceRangeProperties(),
|
|
26
|
+
...targetProperties(),
|
|
56
27
|
},
|
|
57
28
|
{ additionalProperties: false },
|
|
58
29
|
);
|
|
59
|
-
|
|
60
30
|
interface MoveParameters {
|
|
61
31
|
readonly path?: string;
|
|
62
32
|
readonly start?: string;
|
|
@@ -70,7 +40,7 @@ export const moveMutationTool: TextMutationToolRegistration<typeof moveSchema> =
|
|
|
70
40
|
name: "move",
|
|
71
41
|
wholeFileOperation: "move",
|
|
72
42
|
description:
|
|
73
|
-
"Use move to move or rename one regular file
|
|
43
|
+
"Use move to move or rename one regular file, or to relocate selected text within or between files.",
|
|
74
44
|
|
|
75
45
|
promptSnippet: "Move or rename regular files, or move selected text within or between files",
|
|
76
46
|
parameters: moveSchema,
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { Type } from "typebox";
|
|
2
2
|
|
|
3
|
+
import {
|
|
4
|
+
sourcePathProperty,
|
|
5
|
+
sourceRangeProperties,
|
|
6
|
+
} from "#src/tools/text-tool-schema-properties.js";
|
|
7
|
+
|
|
3
8
|
import { TEXT_POSITION_ANCHOR_KIND, TEXT_SEARCH_ANCHOR_KIND } from "#src/api/plugin-protocol.js";
|
|
4
9
|
import {
|
|
5
10
|
anchorSpanRange,
|
|
@@ -12,24 +17,10 @@ import type { TextMutationToolRegistration } from "#src/api/mutation-tool.js";
|
|
|
12
17
|
|
|
13
18
|
export const replaceSchema = Type.Object(
|
|
14
19
|
{
|
|
15
|
-
path:
|
|
16
|
-
|
|
17
|
-
description:
|
|
18
|
-
"Source resource reference or file path. A returned SEARCH# reference can select replacement ranges.",
|
|
19
|
-
}),
|
|
20
|
-
),
|
|
21
|
-
start: Type.Optional(
|
|
22
|
-
Type.String({
|
|
23
|
-
description:
|
|
24
|
-
"Anchor or unique exact text. Alone, selects that fragment; a line anchor selects only its line. Omit when path already selects text through a supported resource reference. With end, selects a whole-line range.",
|
|
25
|
-
}),
|
|
26
|
-
),
|
|
27
|
-
end: Type.Optional(
|
|
28
|
-
Type.String({
|
|
29
|
-
description:
|
|
30
|
-
"Optional anchor or unique exact text. Range includes start's first line through end's last line, even for SEARCH :match. Mixed types allowed; boundaries must be unique, in one file, and forward-ordered. Omit when start already selects the intended content; do not repeat start. The end line is included, not a stopping point before it.",
|
|
31
|
-
}),
|
|
20
|
+
path: sourcePathProperty(
|
|
21
|
+
"Source resource reference or file path. A returned SEARCH# reference can select replacement ranges.",
|
|
32
22
|
),
|
|
23
|
+
...sourceRangeProperties(),
|
|
33
24
|
text: Type.String({
|
|
34
25
|
description:
|
|
35
26
|
"Replacement text. Empty text removes the selection; a whole-line selection removes its lines without inserting a blank line. Adjacent unselected lines are kept.",
|
|
@@ -37,7 +28,6 @@ export const replaceSchema = Type.Object(
|
|
|
37
28
|
},
|
|
38
29
|
{ additionalProperties: false },
|
|
39
30
|
);
|
|
40
|
-
|
|
41
31
|
interface ReplaceParameters {
|
|
42
32
|
readonly path?: string;
|
|
43
33
|
readonly start?: string;
|
|
@@ -48,7 +38,7 @@ interface ReplaceParameters {
|
|
|
48
38
|
export const replaceMutationTool: TextMutationToolRegistration<typeof replaceSchema> = {
|
|
49
39
|
name: "replace",
|
|
50
40
|
description:
|
|
51
|
-
"Use replace to change an existing text fragment, an inclusive line range, or every selected search match.
|
|
41
|
+
"Use replace to change an existing text fragment, an inclusive line range, or every selected search match.",
|
|
52
42
|
|
|
53
43
|
promptSnippet: "Make precise file edits by replacing text using exact matches or anchors",
|
|
54
44
|
parameters: replaceSchema,
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-editor-renderer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"diff": "^9.0.0",
|
|
10
|
-
"pi-agent-invariant": "0.
|
|
11
|
-
"pi-agent-text-editor": "0.
|
|
12
|
-
"pi-agent-tool-call-interception": "0.
|
|
13
|
-
"pi-agent-tool-ui": "0.
|
|
10
|
+
"pi-agent-invariant": "0.6.0",
|
|
11
|
+
"pi-agent-text-editor": "0.6.0",
|
|
12
|
+
"pi-agent-tool-call-interception": "0.6.0",
|
|
13
|
+
"pi-agent-tool-ui": "0.6.0"
|
|
14
14
|
},
|
|
15
15
|
"pi": {
|
|
16
16
|
"extensions": [
|
|
17
|
-
"./runtime/entry-
|
|
17
|
+
"./runtime/entry-73.js"
|
|
18
18
|
]
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-editor-stale-anchor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-invariant": "0.
|
|
7
|
-
"pi-agent-read": "0.
|
|
8
|
-
"pi-agent-text-editor": "0.
|
|
6
|
+
"pi-agent-invariant": "0.6.0",
|
|
7
|
+
"pi-agent-read": "0.6.0",
|
|
8
|
+
"pi-agent-text-editor": "0.6.0"
|
|
9
9
|
},
|
|
10
10
|
"pi": {
|
|
11
11
|
"extensions": [
|
|
12
|
-
"./runtime/entry-
|
|
12
|
+
"./runtime/entry-74.js"
|
|
13
13
|
]
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-tool-call-interception",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./src/index.ts",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
8
|
"types": "./src/index.ts",
|
|
9
|
-
"default": "./runtime/entry-
|
|
9
|
+
"default": "./runtime/entry-75.js"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"pi-agent-tool-ui": "0.
|
|
13
|
+
"pi-agent-tool-ui": "0.6.0"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"@earendil-works/pi-coding-agent": "*",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-tool-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./src/index.ts",
|
|
8
|
-
"default": "./runtime/entry-
|
|
8
|
+
"default": "./runtime/entry-76.js"
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
11
|
"peerDependencies": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../../dist/entry-76.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
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.
|
|
12
|
-
"pi-agent-image": "0.
|
|
13
|
-
"pi-agent-read": "0.
|
|
14
|
-
"pi-agent-resource": "0.
|
|
15
|
-
"pi-agent-text": "0.
|
|
11
|
+
"pi-agent-doctor": "0.6.0",
|
|
12
|
+
"pi-agent-image": "0.6.0",
|
|
13
|
+
"pi-agent-read": "0.6.0",
|
|
14
|
+
"pi-agent-resource": "0.6.0",
|
|
15
|
+
"pi-agent-text": "0.6.0",
|
|
16
16
|
"playwright-core": "^1.62.1"
|
|
17
17
|
},
|
|
18
18
|
"pi": {
|
|
19
19
|
"extensions": [
|
|
20
|
-
"./runtime/entry-
|
|
20
|
+
"./runtime/entry-77.js"
|
|
21
21
|
]
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
@@ -9,6 +9,8 @@ import { type BrowserHtmlLoader, createSystemBrowserHtmlLoader } from "./browser
|
|
|
9
9
|
|
|
10
10
|
type WebContentHost = Pick<ContentHost, "convert">;
|
|
11
11
|
|
|
12
|
+
const BINARY_PREVIEW_BYTES = 4096;
|
|
13
|
+
|
|
12
14
|
/** HTTP timeout, transport, and internal browser fallback settings. */
|
|
13
15
|
export interface WebResolverOptions {
|
|
14
16
|
readonly timeoutMs?: number;
|
|
@@ -115,10 +117,20 @@ async function readWebContent(
|
|
|
115
117
|
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
116
118
|
}
|
|
117
119
|
|
|
120
|
+
const mediaType = response.headers.get("content-type") ?? undefined;
|
|
121
|
+
if (isUnsupportedBinaryMediaType(mediaType) && !hasSupportedDocumentExtension(url)) {
|
|
122
|
+
const preview = await readBoundedBody(response, BINARY_PREVIEW_BYTES, operation.signal);
|
|
123
|
+
return [
|
|
124
|
+
{
|
|
125
|
+
type: "text",
|
|
126
|
+
text: formatUnsupportedBinaryResponse(url, response, mediaType, preview),
|
|
127
|
+
},
|
|
128
|
+
];
|
|
129
|
+
}
|
|
130
|
+
|
|
118
131
|
const bytes = new Uint8Array(await response.arrayBuffer());
|
|
119
132
|
operation.signal.throwIfAborted();
|
|
120
133
|
const source = response.url.length === 0 ? url.href : response.url;
|
|
121
|
-
const mediaType = response.headers.get("content-type") ?? undefined;
|
|
122
134
|
const input = {
|
|
123
135
|
source,
|
|
124
136
|
bytes,
|
|
@@ -191,6 +203,121 @@ async function loadAndConvertBrowser(
|
|
|
191
203
|
);
|
|
192
204
|
}
|
|
193
205
|
|
|
206
|
+
function isUnsupportedBinaryMediaType(mediaType: string | undefined): boolean {
|
|
207
|
+
if (mediaType === undefined) return false;
|
|
208
|
+
const type = mediaType.split(";", 1)[0]?.trim().toLowerCase() ?? "";
|
|
209
|
+
return !(
|
|
210
|
+
type.startsWith("text/") ||
|
|
211
|
+
type.startsWith("image/") ||
|
|
212
|
+
type === "application/json" ||
|
|
213
|
+
type.endsWith("+json") ||
|
|
214
|
+
type === "application/xml" ||
|
|
215
|
+
type.endsWith("+xml") ||
|
|
216
|
+
type === "application/xhtml+xml" ||
|
|
217
|
+
type === "application/pdf"
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function hasSupportedDocumentExtension(url: URL): boolean {
|
|
222
|
+
return /\.(?:avif|bmp|gif|jpe?g|pdf|png|webp)$/iu.test(url.pathname);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
async function readBoundedBody(
|
|
226
|
+
response: Response,
|
|
227
|
+
limit: number,
|
|
228
|
+
signal: AbortSignal,
|
|
229
|
+
): Promise<Uint8Array> {
|
|
230
|
+
if (response.body === null) return new Uint8Array();
|
|
231
|
+
const reader = response.body.getReader();
|
|
232
|
+
const chunks: Uint8Array[] = [];
|
|
233
|
+
let length = 0;
|
|
234
|
+
try {
|
|
235
|
+
while (length < limit) {
|
|
236
|
+
signal.throwIfAborted();
|
|
237
|
+
const part = await reader.read();
|
|
238
|
+
if (part.done) break;
|
|
239
|
+
const remaining = limit - length;
|
|
240
|
+
const chunk = part.value.subarray(0, remaining);
|
|
241
|
+
chunks.push(chunk);
|
|
242
|
+
length += chunk.length;
|
|
243
|
+
if (part.value.length > remaining) break;
|
|
244
|
+
}
|
|
245
|
+
} finally {
|
|
246
|
+
await reader.cancel().catch(() => undefined);
|
|
247
|
+
}
|
|
248
|
+
const preview = new Uint8Array(length);
|
|
249
|
+
let offset = 0;
|
|
250
|
+
for (const chunk of chunks) {
|
|
251
|
+
preview.set(chunk, offset);
|
|
252
|
+
offset += chunk.length;
|
|
253
|
+
}
|
|
254
|
+
return preview;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function formatUnsupportedBinaryResponse(
|
|
258
|
+
requestedUrl: URL,
|
|
259
|
+
response: Response,
|
|
260
|
+
mediaType: string | undefined,
|
|
261
|
+
preview: Uint8Array,
|
|
262
|
+
): string {
|
|
263
|
+
const lines = [
|
|
264
|
+
"Binary response",
|
|
265
|
+
`URL: ${requestedUrl.href}`,
|
|
266
|
+
`HTTP: ${response.status} ${response.statusText}`.trimEnd(),
|
|
267
|
+
`Content-Type: ${mediaType ?? "unknown"}`,
|
|
268
|
+
];
|
|
269
|
+
const disposition = response.headers.get("content-disposition");
|
|
270
|
+
const filename = disposition === null ? undefined : attachmentFilename(disposition);
|
|
271
|
+
if (filename !== undefined) lines.push(`Filename: ${filename}`);
|
|
272
|
+
const length = response.headers.get("content-length");
|
|
273
|
+
if (length !== null) lines.push(`Content-Length: ${length}`);
|
|
274
|
+
lines.push("", "Headers:");
|
|
275
|
+
for (const [name, value] of [...response.headers].sort(([left], [right]) =>
|
|
276
|
+
left.localeCompare(right),
|
|
277
|
+
)) {
|
|
278
|
+
if (isSensitiveRedirectHeader(name)) continue;
|
|
279
|
+
lines.push(`${name}: ${value}`);
|
|
280
|
+
}
|
|
281
|
+
lines.push(
|
|
282
|
+
"",
|
|
283
|
+
`Preview: first ${preview.length} bytes (hex); the remaining body was not downloaded`,
|
|
284
|
+
formatHexPreview(preview),
|
|
285
|
+
);
|
|
286
|
+
return lines.join("\n");
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function attachmentFilename(disposition: string): string | undefined {
|
|
290
|
+
const encoded = /filename\*=UTF-8''([^;]+)/iu.exec(disposition)?.[1];
|
|
291
|
+
if (encoded !== undefined) {
|
|
292
|
+
try {
|
|
293
|
+
return decodeURIComponent(encoded).replaceAll(/[\r\n]/gu, "");
|
|
294
|
+
} catch {
|
|
295
|
+
return encoded.replaceAll(/[\r\n]/gu, "");
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
return /filename=(?:"([^"]+)"|([^;]+))/iu.exec(disposition)?.slice(1).find(Boolean)?.trim();
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
function isSensitiveRedirectHeader(name: string): boolean {
|
|
302
|
+
return ["content-location", "link", "location", "refresh", "set-cookie"].includes(
|
|
303
|
+
name.toLowerCase(),
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
function formatHexPreview(bytes: Uint8Array): string {
|
|
308
|
+
if (bytes.length === 0) return "(empty body)";
|
|
309
|
+
const rows: string[] = [];
|
|
310
|
+
for (let offset = 0; offset < bytes.length; offset += 16) {
|
|
311
|
+
const chunk = bytes.subarray(offset, offset + 16);
|
|
312
|
+
const hex = [...chunk].map((byte) => byte.toString(16).padStart(2, "0")).join(" ");
|
|
313
|
+
const text = [...chunk]
|
|
314
|
+
.map((byte) => (byte >= 32 && byte <= 126 ? String.fromCodePoint(byte) : "."))
|
|
315
|
+
.join("");
|
|
316
|
+
rows.push(`${offset.toString(16).padStart(8, "0")} ${hex.padEnd(47)} |${text}|`);
|
|
317
|
+
}
|
|
318
|
+
return rows.join("\n");
|
|
319
|
+
}
|
|
320
|
+
|
|
194
321
|
function isHtml(bytes: Uint8Array, mediaType: string | undefined): boolean {
|
|
195
322
|
const normalizedMediaType = mediaType?.split(";", 1)[0]?.trim().toLowerCase();
|
|
196
323
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-web-html",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
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.
|
|
11
|
+
"pi-agent-resource": "0.6.0"
|
|
12
12
|
},
|
|
13
13
|
"pi": {
|
|
14
14
|
"extensions": [
|
|
15
|
-
"./runtime/entry-
|
|
15
|
+
"./runtime/entry-78.js"
|
|
16
16
|
]
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|