pi-agent-ide 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/README.md +74 -22
- 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-25CZ5ZIU.js +3 -0
- package/dist/chunk-526E364R.js +3 -0
- package/dist/chunk-5PLV4HLG.js +1 -0
- package/dist/chunk-5QQABP47.js +14 -0
- package/dist/{chunk-72EEL2DW.js → chunk-6CZO43OH.js} +1 -1
- package/dist/chunk-7ALCBKCW.js +26 -0
- package/dist/chunk-AWXVJ5AC.js +1 -0
- package/dist/{chunk-GFW5QPQV.js → chunk-DQXPQOF7.js} +1 -1
- package/dist/chunk-ESPNEJHK.js +1 -0
- package/dist/chunk-G725MARR.js +16 -0
- package/dist/{chunk-M5L42DWE.js → chunk-HKXDP2FD.js} +2 -2
- package/dist/chunk-IQD6PON5.js +0 -0
- package/dist/chunk-IRECDTJG.js +27 -0
- package/dist/chunk-J4RTW44E.js +1 -0
- package/dist/{chunk-HGPUI7F3.js → chunk-KII2JQC5.js} +1 -1
- package/dist/{chunk-TI5GMJ7Q.js → chunk-L7JMDDSD.js} +1 -1
- package/dist/{chunk-6DZA4CLO.js → chunk-LY6U5EAD.js} +1 -1
- package/dist/{chunk-ERVMDQGX.js → chunk-MGCHOGQD.js} +1 -1
- package/dist/chunk-NZYDMBM6.js +1 -0
- package/dist/{chunk-Y7ZMR4LT.js → chunk-O6LE42GK.js} +1 -1
- package/dist/{chunk-KAB3AYA2.js → chunk-OBNING2A.js} +1 -1
- package/dist/chunk-P7XO5CIP.js +2 -0
- package/dist/{chunk-VFBLX4TG.js → chunk-T6LX2RX5.js} +1 -1
- package/dist/{chunk-AADJ2KIB.js → chunk-U22JNO6N.js} +1 -1
- package/dist/chunk-U2JKHKLK.js +0 -0
- package/dist/{chunk-DQF5QMJ2.js → chunk-WGGIQ7IJ.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 -0
- package/dist/entry-17.js +1 -1
- 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 -2
- package/dist/entry-22.js +2 -1
- package/dist/entry-23.js +1 -1
- package/dist/entry-24.js +1 -1
- package/dist/entry-25.js +1 -1
- package/dist/entry-26.js +1 -12
- package/dist/entry-27.js +12 -1
- package/dist/entry-28.js +1 -1
- package/dist/entry-29.js +1 -1
- package/dist/entry-30.js +1 -1
- package/dist/entry-31.js +1 -4
- package/dist/entry-32.js +3 -8
- package/dist/entry-33.js +9 -1
- package/dist/entry-34.js +1 -1
- package/dist/entry-35.js +1 -1
- package/dist/entry-36.js +1 -1
- package/dist/entry-37.js +1 -1
- package/dist/entry-38.js +1 -1
- package/dist/entry-39.js +1 -1
- package/dist/entry-40.js +1 -18
- package/dist/entry-41.js +18 -1
- package/dist/entry-42.js +1 -1
- package/dist/entry-43.js +1 -1
- package/dist/entry-44.js +1 -1
- package/dist/entry-45.js +1 -7
- package/dist/entry-46.js +7 -11
- package/dist/entry-47.js +11 -1
- package/dist/entry-48.js +1 -1
- package/dist/entry-49.js +1 -1
- package/dist/entry-50.js +1 -1
- package/dist/entry-51.js +1 -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 -0
- package/dist/entry-56.js +0 -1
- package/dist/entry-57.js +1 -0
- package/dist/entry-58.js +0 -1
- package/dist/entry-59.js +1 -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 -0
- package/dist/entry-65.js +0 -1
- package/dist/entry-66.js +1 -0
- package/dist/entry-67.js +0 -1
- package/dist/entry-68.js +1 -1
- package/dist/entry-69.js +1 -1
- package/dist/entry-70.js +1 -123
- package/dist/entry-71.js +198 -25
- package/dist/entry-72.js +30 -2
- package/dist/entry-73.js +2 -1
- package/dist/entry-74.js +1 -1
- package/dist/entry-75.js +1 -1
- package/dist/entry-76.js +3 -3
- package/dist/entry-77.js +3 -1
- package/dist/entry-78.js +1 -1
- package/dist/entry-79.js +1 -1
- package/dist/entry-8.js +1 -1
- package/dist/entry-80.js +1 -0
- package/dist/entry-9.js +1 -1
- package/dist/pi-agent-ide.js +3 -3
- package/docs/configuration.md +1 -1
- package/docs/development.md +0 -6
- package/docs/user-hooks.md +68 -0
- package/node_modules/pi-agent-doctor/package.json +6 -6
- package/node_modules/pi-agent-doctor/runtime/entry-21.js +1 -0
- package/node_modules/pi-agent-doctor/src/catalog.ts +9 -1
- package/node_modules/pi-agent-doctor/src/plugin-protocol.ts +5 -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-25.js +2 -0
- package/node_modules/pi-agent-ide-ast/package.json +32 -11
- package/node_modules/pi-agent-ide-ast/runtime/entry-26.js +0 -1
- package/node_modules/pi-agent-ide-ast/runtime/entry-27.js +2 -0
- package/node_modules/pi-agent-ide-ast/src/ast/manager.ts +16 -8
- package/node_modules/pi-agent-ide-ast/src/ast/native-parser.ts +151 -0
- package/node_modules/pi-agent-ide-ast/src/ast/outline.ts +22 -17
- package/node_modules/pi-agent-ide-ast/src/ast/syntax-tree.ts +25 -0
- package/node_modules/pi-agent-ide-ast/src/doctor-plugin.ts +52 -1
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +4 -1
- package/node_modules/pi-agent-ide-changes/index.ts +3 -1
- package/node_modules/pi-agent-ide-changes/package.json +8 -8
- package/node_modules/pi-agent-ide-changes/runtime/entry-28.js +0 -1
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +42 -9
- package/node_modules/pi-agent-ide-formatter/package.json +9 -4
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-lint/package.json +13 -8
- package/node_modules/pi-agent-ide-lsp/index.ts +4 -1
- package/node_modules/pi-agent-ide-lsp/package.json +15 -10
- package/node_modules/pi-agent-ide-lsp/runtime/entry-33.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-40.js +0 -1
- package/node_modules/pi-agent-read/runtime/entry-41.js +2 -0
- package/node_modules/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/node_modules/pi-agent-read/src/api/rendering.ts +1 -1
- package/node_modules/pi-agent-read/src/api/tools/read.ts +32 -0
- package/node_modules/pi-agent-read/src/core/read-core.ts +8 -0
- package/node_modules/pi-agent-read/src/core/tools/read/raw-read.ts +38 -4
- package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +63 -4
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +105 -5
- 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-45.js +0 -1
- package/node_modules/pi-agent-search/src/api/search-parameters.ts +5 -1
- package/node_modules/pi-agent-search-text/index.ts +1 -1
- package/node_modules/pi-agent-search-text/package.json +9 -9
- package/node_modules/pi-agent-search-text/runtime/entry-47.js +1 -0
- package/node_modules/pi-agent-search-text/src/resolvers.ts +72 -39
- package/node_modules/pi-agent-search-text/src/search-backend.ts +6 -15
- package/node_modules/pi-agent-search-text/src/search-presentation.ts +80 -0
- package/node_modules/pi-agent-search-text/src/search-renderer.ts +17 -1
- package/node_modules/pi-agent-search-text/src/search-result.ts +32 -12
- package/node_modules/pi-agent-search-text/src/search-session.ts +33 -4
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text/runtime/entry-49.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-50.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-51.js +0 -1
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-52.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-53.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-54.js +2 -0
- package/node_modules/pi-agent-text-editor/package.json +25 -25
- package/node_modules/pi-agent-text-editor/runtime/entry-70.js +0 -1
- package/node_modules/pi-agent-text-editor/src/api/edit-completion.ts +7 -1
- package/node_modules/pi-agent-text-editor/src/api/edit-pipeline.ts +3 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-guard.ts +1 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +47 -0
- package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +6 -1
- package/node_modules/pi-agent-text-editor/src/core/apply/apply-undo-store.ts +155 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/execution.ts +56 -77
- package/node_modules/pi-agent-text-editor/src/core/apply/mixed-source.ts +7 -12
- package/node_modules/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/output.ts +37 -8
- package/node_modules/pi-agent-text-editor/src/core/apply/prompt.ts +42 -37
- package/node_modules/pi-agent-text-editor/src/core/apply/renderer.ts +51 -15
- package/node_modules/pi-agent-text-editor/src/core/apply/runtime.ts +119 -20
- package/node_modules/pi-agent-text-editor/src/core/apply/tool.ts +28 -7
- package/node_modules/pi-agent-text-editor/src/core/apply/transaction.ts +387 -0
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +3 -2
- package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +68 -71
- package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +4 -4
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +11 -0
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +4 -0
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +141 -6
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +123 -4
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +9 -4
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +3 -2
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +9 -4
- package/node_modules/pi-agent-text-editor-renderer/index.ts +5 -0
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +59 -0
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-73.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-75.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-80.js +2 -0
- package/package.json +59 -39
- package/src/api/hooks.ts +168 -0
- package/src/api/text-editor.ts +2 -0
- package/src/composite/builtin-extensions.ts +7 -0
- package/src/composite/module-labels.ts +8 -0
- package/src/composite/preferences.ts +3 -3
- package/src/core/reload-resource-store.ts +34 -0
- package/src/doctor/tip-provider.ts +1 -0
- 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-25.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-22.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-80.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-76.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-40.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-41.js +2 -0
- package/src/extensions/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/src/extensions/pi-agent-read/src/api/rendering.ts +1 -1
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +32 -0
- package/src/extensions/pi-agent-read/src/core/read-core.ts +8 -0
- package/src/extensions/pi-agent-read/src/core/tools/read/raw-read.ts +38 -4
- package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +63 -4
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +105 -5
- package/src/extensions/pi-agent-search/package.json +7 -7
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +1 -1
- 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-47.js +1 -0
- 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/src/resolvers.ts +72 -39
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +6 -15
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-presentation.ts +80 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +17 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +32 -12
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +33 -4
- package/src/extensions/pi-agent-search/runtime/entry-45.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-46.js +2 -0
- package/src/extensions/pi-agent-search/src/api/search-parameters.ts +5 -1
- 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-50.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-51.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-52.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-53.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-54.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +5 -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-renderer/src/renderer.ts +59 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +2 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-70.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-71.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/edit-completion.ts +7 -1
- package/src/extensions/pi-agent-text-editor/src/api/edit-pipeline.ts +3 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-guard.ts +1 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +47 -0
- package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +6 -1
- package/src/extensions/pi-agent-text-editor/src/core/apply/apply-undo-store.ts +155 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/execution.ts +56 -77
- package/src/extensions/pi-agent-text-editor/src/core/apply/mixed-source.ts +7 -12
- package/src/extensions/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/output.ts +37 -8
- package/src/extensions/pi-agent-text-editor/src/core/apply/prompt.ts +42 -37
- package/src/extensions/pi-agent-text-editor/src/core/apply/renderer.ts +51 -15
- package/src/extensions/pi-agent-text-editor/src/core/apply/runtime.ts +119 -20
- package/src/extensions/pi-agent-text-editor/src/core/apply/tool.ts +28 -7
- package/src/extensions/pi-agent-text-editor/src/core/apply/transaction.ts +387 -0
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +3 -2
- package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +68 -71
- package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +4 -4
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +11 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +4 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +141 -6
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +123 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +9 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +3 -2
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +9 -4
- package/src/plugins/pi-agent-ide-ast/package.json +32 -11
- package/src/plugins/pi-agent-ide-ast/runtime/entry-26.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-27.js +2 -0
- package/src/plugins/pi-agent-ide-ast/src/ast/manager.ts +16 -8
- package/src/plugins/pi-agent-ide-ast/src/ast/native-parser.ts +151 -0
- package/src/plugins/pi-agent-ide-ast/src/ast/outline.ts +22 -17
- package/src/plugins/pi-agent-ide-ast/src/ast/syntax-tree.ts +25 -0
- package/src/plugins/pi-agent-ide-ast/src/doctor-plugin.ts +52 -1
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +4 -1
- package/src/plugins/pi-agent-ide-changes/index.ts +3 -1
- package/src/plugins/pi-agent-ide-changes/package.json +8 -8
- package/src/plugins/pi-agent-ide-changes/runtime/entry-28.js +0 -1
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +42 -9
- package/src/plugins/pi-agent-ide-debugger/index.ts +573 -0
- package/src/plugins/pi-agent-ide-debugger/src/breakpoint-view.ts +73 -0
- package/src/plugins/pi-agent-ide-debugger/src/catalog.ts +306 -0
- package/src/plugins/pi-agent-ide-debugger/src/dap-client.ts +338 -0
- package/src/plugins/pi-agent-ide-debugger/src/doctor-plugin.ts +349 -0
- package/src/plugins/pi-agent-ide-debugger/src/process-provider.ts +39 -0
- package/src/plugins/pi-agent-ide-debugger/src/renderer.ts +152 -0
- package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +1344 -0
- package/src/plugins/pi-agent-ide-debugger/src/ui.ts +14 -0
- package/src/plugins/pi-agent-ide-formatter/package.json +9 -4
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-lint/package.json +13 -8
- package/src/plugins/pi-agent-ide-lsp/index.ts +4 -1
- package/src/plugins/pi-agent-ide-lsp/package.json +15 -10
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-33.js +2 -0
- package/src/plugins/pi-agent-ide-processes/index.ts +28 -0
- package/src/plugins/pi-agent-ide-processes/src/registry.ts +83 -0
- package/src/plugins/pi-agent-ide-processes/src/ui.ts +260 -0
- package/src/plugins/pi-agent-ide-terminal/index.ts +19 -13
- package/src/plugins/pi-agent-ide-terminal/src/output-limits.ts +52 -0
- package/src/plugins/pi-agent-ide-terminal/src/process-provider.ts +31 -0
- package/src/plugins/pi-agent-ide-terminal/src/renderer.ts +24 -58
- package/src/plugins/pi-agent-ide-terminal/src/resources.ts +5 -14
- package/src/plugins/pi-agent-ide-terminal/src/search.ts +32 -2
- package/src/plugins/pi-agent-ide-terminal/src/session-manager.ts +114 -1
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +23 -29
- package/src/plugins/pi-agent-ide-terminal/src/types.ts +14 -1
- package/src/plugins/pi-agent-ide-terminal/src/ui.ts +116 -240
- package/dist/chunk-3SE372WC.js +0 -3
- package/dist/chunk-5MSNYFDE.js +0 -1
- package/dist/chunk-7JYQMAEL.js +0 -14
- package/dist/chunk-B5KB2I7J.js +0 -3
- package/dist/chunk-NMFQGKPE.js +0 -2
- package/dist/chunk-OVUYPHDE.js +0 -1
- package/dist/chunk-TPIHQYK2.js +0 -14
- package/dist/chunk-XSTHESNR.js +0 -25
- package/dist/entry-16.js +0 -1
- package/docs/evaluation.md +0 -14
- package/node_modules/pi-agent-doctor/runtime/entry-16.js +0 -1
- package/node_modules/pi-agent-filesystem/runtime/entry-21.js +0 -2
- package/node_modules/pi-agent-ide-ast/runtime/entry-25.js +0 -1
- package/node_modules/pi-agent-ide-changes/runtime/entry-27.js +0 -1
- package/node_modules/pi-agent-image/runtime/entry-33.js +0 -1
- package/node_modules/pi-agent-resource/runtime/entry-41.js +0 -1
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-49.js +0 -2
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-50.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-52.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-54.js +0 -1
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-73.js +0 -1
- package/node_modules/pi-agent-web/runtime/entry-75.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-22.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-21.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-76.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-75.js +0 -2
- package/src/extensions/pi-agent-read/runtime/entry-36.js +0 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-46.js +0 -2
- package/src/extensions/pi-agent-search/runtime/entry-42.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-49.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-50.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-52.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-71.js +0 -2
- package/src/extensions/pi-agent-text-editor/runtime/entry-54.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-25.js +0 -1
- package/src/plugins/pi-agent-ide-changes/runtime/entry-27.js +0 -1
- /package/node_modules/{pi-agent-filesystem-image → pi-agent-filesystem}/runtime/entry-22.js +0 -0
- /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-23.js +0 -0
- /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-24.js +0 -0
- /package/node_modules/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-29.js +0 -0
- /package/node_modules/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-30.js +0 -0
- /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-31.js +0 -0
- /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-32.js +0 -0
- /package/node_modules/{pi-agent-invariant → pi-agent-image}/runtime/entry-34.js +0 -0
- /package/node_modules/{pi-agent-pdf → pi-agent-invariant}/runtime/entry-35.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-36.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-42.js +0 -0
- /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-46.js +0 -0
- /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-48.js +0 -0
- /package/node_modules/{pi-agent-text-editor-renderer → pi-agent-text-editor}/runtime/entry-71.js +0 -0
- /package/node_modules/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-72.js +0 -0
- /package/node_modules/{pi-agent-tool-ui → pi-agent-tool-call-interception}/runtime/entry-74.js +0 -0
- /package/node_modules/{pi-agent-web-html → pi-agent-web}/runtime/entry-76.js +0 -0
- /package/node_modules/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-77.js +0 -0
- /package/node_modules/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-78.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-79.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-23.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-24.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-77.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-78.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-79.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-72.js +0 -0
- /package/src/plugins/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-29.js +0 -0
- /package/src/plugins/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-30.js +0 -0
- /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-31.js +0 -0
- /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-32.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-changes",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,20 +8,20 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./changes/change-groups": {
|
|
10
10
|
"types": "./src/changes/change-groups.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-28.js"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"diff": "^9.0.0",
|
|
16
|
-
"pi-agent-doctor": "0.
|
|
17
|
-
"pi-agent-invariant": "0.
|
|
18
|
-
"pi-agent-read": "0.
|
|
19
|
-
"pi-agent-text": "0.
|
|
20
|
-
"pi-agent-text-editor": "0.
|
|
16
|
+
"pi-agent-doctor": "0.5.1",
|
|
17
|
+
"pi-agent-invariant": "0.5.1",
|
|
18
|
+
"pi-agent-read": "0.5.1",
|
|
19
|
+
"pi-agent-text": "0.5.1",
|
|
20
|
+
"pi-agent-text-editor": "0.5.1"
|
|
21
21
|
},
|
|
22
22
|
"pi": {
|
|
23
23
|
"extensions": [
|
|
24
|
-
"./runtime/entry-
|
|
24
|
+
"./runtime/entry-29.js"
|
|
25
25
|
]
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
@@ -16,31 +16,62 @@ export const undoSchema = Type.Object(
|
|
|
16
16
|
description: "File to restore; may be omitted to inherit the previous batched source",
|
|
17
17
|
}),
|
|
18
18
|
),
|
|
19
|
-
change: Type.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
change: Type.Optional(
|
|
20
|
+
Type.String({
|
|
21
|
+
description:
|
|
22
|
+
"Complete CHANGE#HASH anchor shown by read, or last for this file's latest text-editor transaction",
|
|
23
|
+
pattern: "^(?:CHANGE#[0-9A-F]{4,64}|last)$",
|
|
24
|
+
}),
|
|
25
|
+
),
|
|
26
|
+
transaction: Type.Optional(
|
|
27
|
+
Type.String({
|
|
28
|
+
description: "APPLY# receipt returned by a successful Apply transaction",
|
|
29
|
+
pattern: "^APPLY#[0-9A-F]{12}$",
|
|
30
|
+
}),
|
|
31
|
+
),
|
|
24
32
|
},
|
|
25
33
|
{ additionalProperties: false },
|
|
26
34
|
);
|
|
27
35
|
|
|
28
36
|
interface UndoParameters {
|
|
29
37
|
readonly file?: string;
|
|
30
|
-
readonly change
|
|
38
|
+
readonly change?: string;
|
|
39
|
+
readonly transaction?: string;
|
|
31
40
|
}
|
|
32
41
|
|
|
33
42
|
export function createUndoMutationTool(
|
|
34
43
|
executor: GitCommandExecutor,
|
|
35
44
|
transactions: LastTextTransactionStore,
|
|
36
45
|
queue: IndexMutationQueue,
|
|
46
|
+
restoreApplyUndo: (
|
|
47
|
+
transaction: string,
|
|
48
|
+
signal?: AbortSignal,
|
|
49
|
+
) => Promise<{ readonly transaction: string; readonly restored: readonly string[] }>,
|
|
37
50
|
): TextMutationToolRegistration<typeof undoSchema> {
|
|
38
51
|
return {
|
|
39
52
|
name: "undo",
|
|
40
53
|
description:
|
|
41
|
-
"Use undo to revert a selected uncommitted Git change or the latest text-editor transaction for one file.
|
|
42
|
-
|
|
43
|
-
promptSnippet: "Restore
|
|
54
|
+
"Use undo to revert an APPLY# transaction receipt, a selected uncommitted Git change, or the latest text-editor transaction for one file. Apply receipts restore every touched path atomically; CHANGE# restores that change to HEAD in both worktree and index; last restores one file's latest text edit.",
|
|
55
|
+
|
|
56
|
+
promptSnippet: "Restore an Apply transaction, Git change, or latest text edit",
|
|
57
|
+
direct: {
|
|
58
|
+
matches: (input) =>
|
|
59
|
+
input !== null &&
|
|
60
|
+
typeof input === "object" &&
|
|
61
|
+
"transaction" in input &&
|
|
62
|
+
typeof input.transaction === "string",
|
|
63
|
+
async execute(context, input) {
|
|
64
|
+
if ((input as UndoParameters).change !== undefined)
|
|
65
|
+
throw new Error("transaction cannot be combined with change");
|
|
66
|
+
const transaction = String((input as UndoParameters).transaction);
|
|
67
|
+
const restored = await restoreApplyUndo(transaction, context.signal);
|
|
68
|
+
return {
|
|
69
|
+
source: transaction,
|
|
70
|
+
summary: `Restored ${String(restored.restored.length)} paths from ${transaction}.`,
|
|
71
|
+
data: { kind: "apply-undo", ok: true, transaction, restored: restored.restored },
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
},
|
|
44
75
|
parameters: undoSchema,
|
|
45
76
|
intent: "restore",
|
|
46
77
|
source: { field: "file", inherited: true },
|
|
@@ -53,6 +84,8 @@ export function createUndoMutationTool(
|
|
|
53
84
|
},
|
|
54
85
|
],
|
|
55
86
|
async mutate(context, parameters: UndoParameters) {
|
|
87
|
+
if (parameters.change === undefined)
|
|
88
|
+
throw new Error("change is required when transaction is omitted");
|
|
56
89
|
const source = context.sourceFor("file");
|
|
57
90
|
let restoredText: string;
|
|
58
91
|
let afterWrite: (() => Promise<void>) | undefined;
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-formatter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-doctor": "0.
|
|
6
|
+
"pi-agent-doctor": "0.5.1"
|
|
7
7
|
},
|
|
8
8
|
"pi": {
|
|
9
9
|
"extensions": [
|
|
10
|
-
"./runtime/entry-
|
|
10
|
+
"./runtime/entry-30.js"
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"@earendil-works/pi-coding-agent": "*",
|
|
15
|
-
"pi-agent-ide": "0.
|
|
15
|
+
"pi-agent-ide": "0.5.1"
|
|
16
|
+
},
|
|
17
|
+
"peerDependenciesMeta": {
|
|
18
|
+
"pi-agent-ide": {
|
|
19
|
+
"optional": true
|
|
20
|
+
}
|
|
16
21
|
}
|
|
17
22
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-languages",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-doctor": "0.
|
|
6
|
+
"pi-agent-doctor": "0.5.1"
|
|
7
7
|
},
|
|
8
8
|
"pi": {
|
|
9
9
|
"extensions": [
|
|
10
|
-
"./runtime/entry-
|
|
10
|
+
"./runtime/entry-31.js"
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-lint",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-doctor": "0.
|
|
7
|
-
"pi-agent-invariant": "0.
|
|
8
|
-
"pi-agent-read": "0.
|
|
9
|
-
"pi-agent-resource": "0.
|
|
10
|
-
"pi-agent-text": "0.
|
|
6
|
+
"pi-agent-doctor": "0.5.1",
|
|
7
|
+
"pi-agent-invariant": "0.5.1",
|
|
8
|
+
"pi-agent-read": "0.5.1",
|
|
9
|
+
"pi-agent-resource": "0.5.1",
|
|
10
|
+
"pi-agent-text": "0.5.1"
|
|
11
11
|
},
|
|
12
12
|
"pi": {
|
|
13
13
|
"extensions": [
|
|
14
|
-
"./runtime/entry-
|
|
14
|
+
"./runtime/entry-32.js"
|
|
15
15
|
]
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"@earendil-works/pi-coding-agent": "*",
|
|
19
|
-
"pi-agent-ide": "0.
|
|
19
|
+
"pi-agent-ide": "0.5.1"
|
|
20
|
+
},
|
|
21
|
+
"peerDependenciesMeta": {
|
|
22
|
+
"pi-agent-ide": {
|
|
23
|
+
"optional": true
|
|
24
|
+
}
|
|
20
25
|
}
|
|
21
26
|
}
|
|
@@ -115,6 +115,9 @@ export default async function registerLsp(pi: ExtensionAPI): Promise<void> {
|
|
|
115
115
|
api.describe(
|
|
116
116
|
"symbol:<file>#<selector> — declaration source, e.g. symbol:src/catalog.ts#Catalog/find. graph:<file> — top-level declarations, references and calls; members include selectors. graph:<file>#<selector> — references and incoming/outgoing calls for that declaration or member.",
|
|
117
117
|
);
|
|
118
|
+
api.addPromptGuideline(
|
|
119
|
+
"Use semantic code views first when exploring code supported by a configured language server. Use `symbols:<query>` to locate named declaration and reference candidates when the file is unknown. Use `graph:<file>` to map the declarations and relationships in a known file before reading implementation bodies. Use `graph:<file>#<selector>` to inspect references and incoming/outgoing calls for one declaration. Use `symbol:<file>#<selector>` to read that declaration’s source. Use text search for exact text, non-code files, or when semantic views are unavailable.",
|
|
120
|
+
);
|
|
118
121
|
},
|
|
119
122
|
} satisfies ReadPlugin;
|
|
120
123
|
|
|
@@ -220,7 +223,7 @@ export default async function registerLsp(pi: ExtensionAPI): Promise<void> {
|
|
|
220
223
|
setup(api): void {
|
|
221
224
|
api.addResolver({ resolver: createLspSearchResolver(managerFor) });
|
|
222
225
|
api.describe(
|
|
223
|
-
"Use `symbols:<query>` to
|
|
226
|
+
"Use `symbols:<query>` to locate named workspace declarations and references through configured language servers when the file is unknown.",
|
|
224
227
|
);
|
|
225
228
|
},
|
|
226
229
|
}),
|
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-lsp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"cross-spawn": "^7.0.6",
|
|
7
|
-
"pi-agent-doctor": "0.
|
|
8
|
-
"pi-agent-invariant": "0.
|
|
9
|
-
"pi-agent-read": "0.
|
|
10
|
-
"pi-agent-resource": "0.
|
|
11
|
-
"pi-agent-search": "0.
|
|
12
|
-
"pi-agent-text": "0.
|
|
13
|
-
"pi-agent-text-editor": "0.
|
|
7
|
+
"pi-agent-doctor": "0.5.1",
|
|
8
|
+
"pi-agent-invariant": "0.5.1",
|
|
9
|
+
"pi-agent-read": "0.5.1",
|
|
10
|
+
"pi-agent-resource": "0.5.1",
|
|
11
|
+
"pi-agent-search": "0.5.1",
|
|
12
|
+
"pi-agent-text": "0.5.1",
|
|
13
|
+
"pi-agent-text-editor": "0.5.1",
|
|
14
14
|
"vscode-jsonrpc": "^9.0.0",
|
|
15
15
|
"vscode-uri": "^3.1.0"
|
|
16
16
|
},
|
|
17
17
|
"pi": {
|
|
18
18
|
"extensions": [
|
|
19
|
-
"./runtime/entry-
|
|
19
|
+
"./runtime/entry-33.js"
|
|
20
20
|
]
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@earendil-works/pi-coding-agent": "*",
|
|
24
|
-
"pi-agent-ide": "0.
|
|
24
|
+
"pi-agent-ide": "0.5.1"
|
|
25
|
+
},
|
|
26
|
+
"peerDependenciesMeta": {
|
|
27
|
+
"pi-agent-ide": {
|
|
28
|
+
"optional": true
|
|
29
|
+
}
|
|
25
30
|
}
|
|
26
31
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-image",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
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-34.js"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"pi-agent-resource": "0.
|
|
13
|
+
"pi-agent-resource": "0.5.1"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"@earendil-works/pi-coding-agent": "*"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-invariant",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
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-35.js"
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-pdf",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
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-36.js"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"pdfjs-dist": "^6.2.108",
|
|
14
|
-
"pi-agent-resource": "0.
|
|
14
|
+
"pi-agent-resource": "0.5.1"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-read",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,31 +8,31 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./api/connect-plugin": {
|
|
10
10
|
"types": "./src/api/connect-plugin.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-37.js"
|
|
12
12
|
},
|
|
13
13
|
"./api/rendering": {
|
|
14
14
|
"types": "./src/api/rendering.ts",
|
|
15
|
-
"default": "./runtime/entry-
|
|
15
|
+
"default": "./runtime/entry-38.js"
|
|
16
16
|
},
|
|
17
17
|
"./api/plugin-protocol": {
|
|
18
18
|
"types": "./src/api/plugin-protocol.ts",
|
|
19
|
-
"default": "./runtime/entry-
|
|
19
|
+
"default": "./runtime/entry-39.js"
|
|
20
20
|
},
|
|
21
21
|
"./api/tools/read": {
|
|
22
22
|
"types": "./src/api/tools/read.ts",
|
|
23
|
-
"default": "./runtime/entry-
|
|
23
|
+
"default": "./runtime/entry-40.js"
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"pi-agent-invariant": "0.
|
|
28
|
-
"pi-agent-resource": "0.
|
|
29
|
-
"pi-agent-text": "0.
|
|
30
|
-
"pi-agent-tool-call-interception": "0.
|
|
31
|
-
"pi-agent-tool-ui": "0.
|
|
27
|
+
"pi-agent-invariant": "0.5.1",
|
|
28
|
+
"pi-agent-resource": "0.5.1",
|
|
29
|
+
"pi-agent-text": "0.5.1",
|
|
30
|
+
"pi-agent-tool-call-interception": "0.5.1",
|
|
31
|
+
"pi-agent-tool-ui": "0.5.1"
|
|
32
32
|
},
|
|
33
33
|
"pi": {
|
|
34
34
|
"extensions": [
|
|
35
|
-
"./runtime/entry-
|
|
35
|
+
"./runtime/entry-41.js"
|
|
36
36
|
]
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
@@ -5,7 +5,7 @@ import type { ReadToolPluginApi } from "#src/api/tools/read.js";
|
|
|
5
5
|
|
|
6
6
|
export const READ_PROTOCOL = "pi-agent-read";
|
|
7
7
|
|
|
8
|
-
export const READ_API_VERSION =
|
|
8
|
+
export const READ_API_VERSION = 13;
|
|
9
9
|
|
|
10
10
|
export const READ_CORE_READY_EVENT = `${READ_PROTOCOL}/core/ready`;
|
|
11
11
|
|
|
@@ -8,6 +8,6 @@ export interface ReadResultRendererOptions {
|
|
|
8
8
|
readonly nativeResources?: boolean;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export { createReadResultRenderer } from "#src/core/tools/read/read-renderer.js";
|
|
11
|
+
export { COMPACT_READ_ROWS, createReadResultRenderer } from "#src/core/tools/read/read-renderer.js";
|
|
12
12
|
|
|
13
13
|
export type { ReadResultRenderer } from "#src/api/tools/read.js";
|
|
@@ -53,9 +53,14 @@ export interface ReadFailure {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
export type ReadResultRenderer = NonNullable<ToolDefinition["renderResult"]>;
|
|
56
|
+
export type ReadCallRenderer = NonNullable<ToolDefinition["renderCall"]>;
|
|
56
57
|
|
|
57
58
|
export interface ResourceResolverRegistration {
|
|
58
59
|
readonly resolver: ResourceResolver;
|
|
60
|
+
/** Selects a resolver-specific call header before resource resolution. */
|
|
61
|
+
readonly matchesCall?: (source: string) => boolean;
|
|
62
|
+
/** Renders only the read call header; result rendering remains independent. */
|
|
63
|
+
readonly renderCall?: ReadCallRenderer;
|
|
59
64
|
readonly priority?: number;
|
|
60
65
|
readonly renderResult?: ReadResultRenderer;
|
|
61
66
|
readonly preserveTruncatedOutput?: boolean;
|
|
@@ -247,6 +252,26 @@ export type ReadOutputReducer = (
|
|
|
247
252
|
context: ResourceResolverContext,
|
|
248
253
|
budget: ReadOutputBudget,
|
|
249
254
|
) => Promise<ReadToolResult | undefined>;
|
|
255
|
+
/** A resolved Resource access check that runs before Resource.read(). */
|
|
256
|
+
export interface ReadResourceGuardEvent {
|
|
257
|
+
readonly requestedSource: string;
|
|
258
|
+
readonly resourceSource: string;
|
|
259
|
+
readonly resolvedBy: string;
|
|
260
|
+
readonly cwd: string;
|
|
261
|
+
readonly request: ReadRequest;
|
|
262
|
+
readonly audience: "agent" | "script";
|
|
263
|
+
readonly signal?: AbortSignal;
|
|
264
|
+
}
|
|
265
|
+
export type ReadResourceGuardOutcome =
|
|
266
|
+
| { readonly kind: "accepted" }
|
|
267
|
+
| { readonly kind: "rejected"; readonly reason: string };
|
|
268
|
+
export interface ReadResourceGuardRegistration {
|
|
269
|
+
readonly id: string;
|
|
270
|
+
readonly guard: (
|
|
271
|
+
event: ReadResourceGuardEvent,
|
|
272
|
+
) => ReadResourceGuardOutcome | Promise<ReadResourceGuardOutcome>;
|
|
273
|
+
}
|
|
274
|
+
|
|
250
275
|
export interface ReadToolPluginApi {
|
|
251
276
|
/** Registers a format-aware reducer shared by read and composed output. */
|
|
252
277
|
addOutputReducer(reducer: ReadOutputReducer): void;
|
|
@@ -267,6 +292,8 @@ export interface ReadToolPluginApi {
|
|
|
267
292
|
addResolver(registration: ResourceResolverRegistration): void;
|
|
268
293
|
addTargetResolver(registration: TextTargetResolverRegistration): void;
|
|
269
294
|
addHandler(registration: ReadHandlerRegistration): void;
|
|
295
|
+
/** Registers a fail-closed check over resolved Resources before their content is read. */
|
|
296
|
+
addResourceGuard(registration: ReadResourceGuardRegistration): void;
|
|
270
297
|
/** Registers a named view whose presenter runs when a request lists the view. */
|
|
271
298
|
addView(registration: ReadViewRegistration): void;
|
|
272
299
|
addFragmentResolver(registration: FragmentResolverRegistration): void;
|
|
@@ -279,6 +306,8 @@ export interface ReadToolPluginApi {
|
|
|
279
306
|
const functionSchema = Type.Function([], Type.Unknown());
|
|
280
307
|
const resourceResolverRegistrationSchema = Type.Object({
|
|
281
308
|
resolver: Type.Unknown(),
|
|
309
|
+
matchesCall: Type.Optional(functionSchema),
|
|
310
|
+
renderCall: Type.Optional(functionSchema),
|
|
282
311
|
priority: Type.Optional(Type.Number()),
|
|
283
312
|
renderResult: Type.Optional(functionSchema),
|
|
284
313
|
preserveTruncatedOutput: Type.Optional(Type.Boolean()),
|
|
@@ -342,6 +371,9 @@ export function isResourceResolverRegistration(
|
|
|
342
371
|
return (
|
|
343
372
|
registration.resolver.id !== "any" &&
|
|
344
373
|
(!("priority" in registration) || typeof registration.priority === "number") &&
|
|
374
|
+
(!("matchesCall" in registration) || typeof registration.matchesCall === "function") &&
|
|
375
|
+
(!("renderCall" in registration) || typeof registration.renderCall === "function") &&
|
|
376
|
+
"matchesCall" in registration === "renderCall" in registration &&
|
|
345
377
|
(!("renderResult" in registration) || typeof registration.renderResult === "function")
|
|
346
378
|
);
|
|
347
379
|
}
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
type PromptDescriptionSource,
|
|
15
15
|
type ReadHandlerRegistration,
|
|
16
16
|
type ReadOutputReducer,
|
|
17
|
+
type ReadResourceGuardRegistration,
|
|
17
18
|
type ReadViewRegistration,
|
|
18
19
|
type ResourceResolverRegistration,
|
|
19
20
|
type TextTargetResolverRegistration,
|
|
@@ -166,6 +167,7 @@ function createPluginContributionController(
|
|
|
166
167
|
const setupPromptContributions: PromptDescriptionSource[] = [];
|
|
167
168
|
|
|
168
169
|
const setupPromptGuidelines: PromptDescriptionSource[] = [];
|
|
170
|
+
const setupResourceGuards: ReadResourceGuardRegistration[] = [];
|
|
169
171
|
const setupResolvers: ResourceResolverRegistration[] = [];
|
|
170
172
|
const setupTargetResolvers: TextTargetResolverRegistration[] = [];
|
|
171
173
|
const setupReadHandlers: ReadHandlerRegistration[] = [];
|
|
@@ -200,6 +202,11 @@ function createPluginContributionController(
|
|
|
200
202
|
assertAvailable();
|
|
201
203
|
return read.execute(request, context, audience);
|
|
202
204
|
},
|
|
205
|
+
addResourceGuard(registration): void {
|
|
206
|
+
assertAvailable();
|
|
207
|
+
if (state === "setup") setupResourceGuards.push(registration);
|
|
208
|
+
else read.registerContributions(pluginId, { resourceGuards: [registration] });
|
|
209
|
+
},
|
|
203
210
|
addResolver(registration): void {
|
|
204
211
|
assertAvailable();
|
|
205
212
|
if (!isResourceResolverRegistration(registration)) {
|
|
@@ -305,6 +312,7 @@ function createPluginContributionController(
|
|
|
305
312
|
}
|
|
306
313
|
|
|
307
314
|
read.registerContributions(pluginId, {
|
|
315
|
+
resourceGuards: setupResourceGuards,
|
|
308
316
|
resolvers: setupResolvers,
|
|
309
317
|
targetResolvers: setupTargetResolvers,
|
|
310
318
|
handlers: setupReadHandlers,
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import { open, stat } from "node:fs/promises";
|
|
1
|
+
import { open, realpath, stat } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
|
|
5
|
-
import type {
|
|
5
|
+
import type {
|
|
6
|
+
ReadRequest,
|
|
7
|
+
ReadResourceGuardRegistration,
|
|
8
|
+
ReadToolResult,
|
|
9
|
+
} from "#src/api/tools/read.js";
|
|
6
10
|
import { failureResult } from "#src/core/tools/read/read-result.js";
|
|
7
11
|
import {
|
|
8
12
|
READ_OUTPUT_MAX_BYTES,
|
|
@@ -14,6 +18,7 @@ export async function readRaw(
|
|
|
14
18
|
request: ReadRequest,
|
|
15
19
|
context: { cwd: string; signal?: AbortSignal },
|
|
16
20
|
audience: "agent" | "script",
|
|
21
|
+
guards: readonly { readonly registration: ReadResourceGuardRegistration }[] = [],
|
|
17
22
|
): Promise<ReadToolResult> {
|
|
18
23
|
const requested = request.path ?? "";
|
|
19
24
|
try {
|
|
@@ -28,9 +33,39 @@ export async function readRaw(
|
|
|
28
33
|
throw new Error("Use an integer byte offset and a non-negative integer byte limit");
|
|
29
34
|
const input = requested.slice(4);
|
|
30
35
|
if (input.length === 0) throw new Error("Supply a local file after raw:");
|
|
31
|
-
const
|
|
36
|
+
const requestedFile = input.startsWith("file://")
|
|
32
37
|
? fileURLToPath(input)
|
|
33
38
|
: path.resolve(context.cwd, input);
|
|
39
|
+
const file = await realpath(requestedFile);
|
|
40
|
+
const source = `raw:${file}`;
|
|
41
|
+
for (const { registration } of guards) {
|
|
42
|
+
try {
|
|
43
|
+
const outcome = await registration.guard({
|
|
44
|
+
requestedSource: requested,
|
|
45
|
+
resourceSource: source,
|
|
46
|
+
resolvedBy: "raw",
|
|
47
|
+
cwd: context.cwd,
|
|
48
|
+
request,
|
|
49
|
+
audience,
|
|
50
|
+
...(context.signal !== undefined && { signal: context.signal }),
|
|
51
|
+
});
|
|
52
|
+
if (outcome.kind === "rejected")
|
|
53
|
+
return failureResult({
|
|
54
|
+
code: "READ_FAILED",
|
|
55
|
+
source,
|
|
56
|
+
resolverId: "raw",
|
|
57
|
+
message: `Read blocked by hook ${registration.id}: ${outcome.reason}`,
|
|
58
|
+
});
|
|
59
|
+
} catch (error) {
|
|
60
|
+
return failureResult({
|
|
61
|
+
code: "READ_FAILED",
|
|
62
|
+
source,
|
|
63
|
+
resolverId: "raw",
|
|
64
|
+
message: `Read blocked because hook ${registration.id} failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
65
|
+
cause: error,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
34
69
|
context.signal?.throwIfAborted();
|
|
35
70
|
if (!(await stat(file)).isFile()) throw new Error("Raw reads require a regular file");
|
|
36
71
|
const handle = await open(file, "r");
|
|
@@ -58,7 +93,6 @@ export async function readRaw(
|
|
|
58
93
|
}
|
|
59
94
|
context.signal?.throwIfAborted();
|
|
60
95
|
const bytes = buffer.subarray(0, count);
|
|
61
|
-
const source = `raw:${file}`;
|
|
62
96
|
const nextOffset = start + count;
|
|
63
97
|
const hasMore = nextOffset < stat.size;
|
|
64
98
|
const header = `${source}\nBytes ${start}..${nextOffset} (end exclusive), ${stat.size} bytes total`;
|