pi-agent-ide 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/dist/chunk-6U5OU77O.js +3 -0
- package/dist/{chunk-6CZO43OH.js → chunk-BU7IZLKB.js} +1 -1
- package/dist/chunk-EURHXLN3.js +2 -0
- package/dist/{chunk-PYPPV2F5.js → chunk-F6IWZKOG.js} +6 -6
- package/dist/{chunk-GBLKIB6O.js → chunk-H445SHSJ.js} +2 -2
- package/dist/chunk-IG56UGSO.js +2 -0
- package/dist/chunk-IICJXZBU.js +6 -0
- package/dist/{chunk-XYS4FSCC.js → chunk-IM24DB3K.js} +1 -1
- package/dist/{chunk-YRF7OATP.js → chunk-KOVPDKSJ.js} +1 -1
- package/dist/chunk-MXLSGMRZ.js +3 -0
- package/dist/chunk-NRZO5KJT.js +9 -0
- package/dist/chunk-OB46OPMZ.js +1 -0
- package/dist/chunk-PKSQT6TC.js +1 -0
- package/dist/{chunk-PNU3E7IO.js → chunk-Q6CZ6GBR.js} +2 -2
- package/dist/{chunk-EDURPQAV.js → chunk-QRJLIV6P.js} +6 -6
- package/dist/chunk-QUYXINGZ.js +7 -0
- package/dist/{chunk-OBNING2A.js → chunk-S5PL5DFQ.js} +1 -1
- package/dist/chunk-SBP3ABH4.js +5 -0
- package/dist/{chunk-FXNKMNSJ.js → chunk-SJ4UZ4GU.js} +1 -1
- package/dist/chunk-SNF7PDDX.js +11 -0
- package/dist/{chunk-AJRIASPQ.js → chunk-STBJO3Z3.js} +1 -1
- package/dist/{chunk-3HYXQ4YA.js → chunk-TQGE7RH6.js} +13 -13
- package/dist/{chunk-S5LXX32D.js → chunk-XDG7EQRN.js} +3 -3
- package/dist/{chunk-F5YZG77W.js → chunk-XH5WN5XA.js} +1 -1
- package/dist/chunk-YWQS33DF.js +1 -0
- package/dist/chunk-ZIWPKIBZ.js +1 -0
- package/dist/entry-11.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-17.js +1 -1
- package/dist/entry-25.js +2 -2
- package/dist/entry-26.js +1 -1
- package/dist/entry-27.js +2 -2
- package/dist/entry-28.js +1 -1
- package/dist/entry-29.js +1 -1
- package/dist/entry-31.js +15 -13
- package/dist/entry-33.js +2 -1
- package/dist/entry-37.js +6 -6
- package/dist/entry-41.js +1 -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 +20 -13
- package/dist/entry-46.js +1 -1
- package/dist/entry-49.js +1 -1
- package/dist/entry-50.js +1 -1
- package/dist/entry-51.js +8 -7
- package/dist/entry-52.js +1 -1
- package/dist/entry-53.js +1 -1
- package/dist/entry-54.js +1 -1
- package/dist/entry-56.js +1 -1
- package/dist/entry-57.js +1 -1
- package/dist/entry-58.js +1 -1
- package/dist/entry-60.js +1 -1
- package/dist/entry-62.js +1 -1
- package/dist/entry-65.js +1 -1
- package/dist/entry-66.js +1 -1
- package/dist/entry-68.js +1 -1
- package/dist/entry-70.js +1 -1
- package/dist/entry-75.js +1 -1
- package/dist/entry-77.js +51 -43
- package/dist/entry-78.js +14 -14
- package/dist/entry-79.js +1 -1
- package/dist/entry-80.js +1 -1
- package/dist/entry-82.js +5 -5
- package/dist/entry-83.js +1 -1
- package/dist/entry-84.js +1 -1
- package/dist/entry-85.js +1 -1
- package/dist/entry-86.js +1 -1
- package/dist/pi-agent-ide.js +37 -9
- package/docs/agent-guides/editing.md +35 -46
- package/docs/agent-guides/git-changes.md +10 -0
- package/docs/agent-guides/read-resources.md +9 -50
- package/docs/agent-guides/search-code.md +18 -17
- package/docs/agent-guides/select-code.md +62 -140
- package/docs/agent-guides/terminal.md +9 -1
- package/docs/configuration.md +1 -1
- package/docs/releases.md +4 -0
- package/docs/research/native-codemode-batch-decision.md +2 -0
- package/docs/structured-results.md +27 -62
- package/docs/tools.md +15 -11
- package/node_modules/pi-agent-doctor/package.json +1 -1
- package/node_modules/pi-agent-documentation/package.json +1 -1
- package/node_modules/pi-agent-filesystem/index.ts +7 -6
- package/node_modules/pi-agent-filesystem/package.json +7 -7
- package/node_modules/pi-agent-filesystem-image/package.json +3 -3
- package/node_modules/pi-agent-filesystem-jq/index.ts +4 -3
- package/node_modules/pi-agent-filesystem-jq/package.json +5 -5
- package/node_modules/pi-agent-filesystem-jq/src/jq.ts +4 -1
- package/node_modules/pi-agent-filesystem-pdf/package.json +3 -3
- package/node_modules/pi-agent-filesystem-text/package.json +3 -3
- package/node_modules/pi-agent-ide-ast/package.json +13 -13
- package/node_modules/pi-agent-ide-ast/src/extension.ts +5 -4
- package/node_modules/pi-agent-ide-ast/src/overflow-handler.ts +2 -2
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +35 -9
- package/node_modules/pi-agent-ide-ast/src/select-presentation.ts +1 -1
- package/node_modules/pi-agent-ide-ast/src/select-schema.ts +10 -8
- package/node_modules/pi-agent-ide-ast/src/tool-select.ts +28 -3
- package/node_modules/pi-agent-ide-changes/index.ts +4 -3
- package/node_modules/pi-agent-ide-changes/package.json +8 -8
- package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +66 -4
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +8 -11
- package/node_modules/pi-agent-ide-formatter/package.json +3 -3
- package/node_modules/pi-agent-ide-languages/package.json +2 -2
- package/node_modules/pi-agent-ide-lint/package.json +7 -7
- package/node_modules/pi-agent-ide-lsp/index.ts +3 -3
- package/node_modules/pi-agent-ide-lsp/package.json +9 -9
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +5 -2
- package/node_modules/pi-agent-image/package.json +2 -2
- package/node_modules/pi-agent-invariant/package.json +1 -1
- package/node_modules/pi-agent-pdf/package.json +2 -2
- package/node_modules/pi-agent-read/package.json +7 -7
- package/node_modules/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/node_modules/pi-agent-read/src/api/read-parameters.ts +38 -1
- package/node_modules/pi-agent-read/src/api/tools/read.ts +18 -1
- package/node_modules/pi-agent-read/src/core/extension.ts +8 -2
- package/node_modules/pi-agent-read/src/core/read-core.ts +54 -35
- package/node_modules/pi-agent-read/src/core/tools/read/output-truncation.ts +91 -18
- package/node_modules/pi-agent-read/src/core/tools/read/raw-read.ts +8 -2
- package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +38 -1
- package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +57 -2
- package/node_modules/pi-agent-read/src/core/tools/read/structured-result.ts +3 -3
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +108 -46
- package/node_modules/pi-agent-resource/package.json +1 -1
- package/node_modules/pi-agent-resource/src/index.ts +1 -0
- package/node_modules/pi-agent-resource/src/result-targets.ts +186 -9
- package/node_modules/{pi-agent-read/src/core/tools/read → pi-agent-resource/src}/temp-resource-store.ts +17 -7
- package/node_modules/pi-agent-resource/src/tool-result.ts +13 -1
- package/node_modules/pi-agent-search/package.json +5 -5
- package/node_modules/pi-agent-search/src/api/fuzzy.ts +5 -1
- package/node_modules/pi-agent-search/src/api/search-parameters.ts +3 -3
- package/node_modules/pi-agent-search/src/core/extension.ts +2 -1
- package/node_modules/pi-agent-search/src/core/search-core.ts +13 -4
- package/node_modules/pi-agent-search-text/index.ts +1 -1
- package/node_modules/pi-agent-search-text/package.json +7 -7
- package/node_modules/pi-agent-search-text/src/resolvers.ts +11 -1
- package/node_modules/pi-agent-search-text/src/scoped-search.ts +1 -1
- package/node_modules/pi-agent-search-text/src/search-presentation.ts +42 -32
- package/node_modules/pi-agent-search-text/src/search-recipe.ts +1 -1
- package/node_modules/pi-agent-search-text/src/search-renderer.ts +6 -0
- package/node_modules/pi-agent-search-text/src/search-result.ts +17 -3
- package/node_modules/pi-agent-text/package.json +2 -2
- package/node_modules/pi-agent-text-anchor-constant/package.json +3 -3
- package/node_modules/pi-agent-text-anchor-exact/index.ts +65 -4
- package/node_modules/pi-agent-text-anchor-exact/package.json +3 -3
- package/node_modules/pi-agent-text-anchor-exact/src/anchor.ts +12 -2
- package/node_modules/pi-agent-text-anchor-line-hash/index.ts +4 -3
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +5 -5
- package/node_modules/pi-agent-text-editor/package.json +9 -9
- package/node_modules/pi-agent-text-editor/src/api/edit-completion.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +2 -1
- package/node_modules/pi-agent-text-editor/src/api/native-edit-batch-event.ts +4 -0
- package/node_modules/pi-agent-text-editor/src/api/stale-anchor-message.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +54 -12
- package/node_modules/pi-agent-text-editor/src/core/editing-guidelines.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +10 -3
- package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +3 -13
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +35 -6
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +19 -1
- package/node_modules/pi-agent-text-editor/src/core/mutation-result-targets.ts +132 -11
- package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +232 -144
- package/node_modules/pi-agent-text-editor/src/core/post-edit-scope.ts +34 -10
- package/node_modules/pi-agent-text-editor/src/core/result-input.ts +24 -4
- package/node_modules/pi-agent-text-editor/src/core/result-transfer.ts +7 -2
- package/node_modules/pi-agent-text-editor/src/core/structured-result.ts +49 -214
- package/node_modules/pi-agent-text-editor/src/core/text-change-engine.ts +5 -1
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +152 -22
- 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 +76 -32
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +409 -209
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +6 -9
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +10 -3
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +9 -4
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +7 -8
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +3 -4
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +10 -4
- package/node_modules/pi-agent-text-editor-renderer/package.json +5 -5
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +11 -0
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +54 -5
- package/node_modules/pi-agent-text-editor-renderer/src/status-summary.ts +18 -3
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +4 -4
- package/node_modules/pi-agent-tool-call-interception/package.json +2 -2
- package/node_modules/pi-agent-tool-call-interception/src/index.ts +3 -0
- package/node_modules/pi-agent-tool-ui/package.json +1 -1
- package/node_modules/pi-agent-web/index.ts +4 -3
- package/node_modules/pi-agent-web/package.json +7 -7
- package/node_modules/pi-agent-web/src/resolver.ts +11 -13
- package/node_modules/pi-agent-web-html/package.json +2 -2
- package/node_modules/pi-agent-web-image/package.json +3 -3
- package/node_modules/pi-agent-web-pdf/package.json +3 -3
- package/node_modules/pi-agent-web-text/package.json +3 -3
- package/package.json +35 -35
- package/src/composite/nested-tool-rendering.ts +64 -6
- package/src/composite/output-limits.ts +125 -0
- package/src/composite/responses-tools.ts +25 -0
- package/src/composite/text-results.ts +372 -0
- package/src/documentation/extension.ts +11 -9
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +7 -6
- 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 +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/index.ts +4 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +5 -5
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/src/jq.ts +4 -1
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +4 -3
- 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 +2 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/resolver.ts +11 -13
- package/src/extensions/pi-agent-read/package.json +7 -7
- package/src/extensions/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/src/extensions/pi-agent-read/src/api/read-parameters.ts +38 -1
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +18 -1
- package/src/extensions/pi-agent-read/src/core/extension.ts +8 -2
- package/src/extensions/pi-agent-read/src/core/read-core.ts +54 -35
- package/src/extensions/pi-agent-read/src/core/tools/read/output-truncation.ts +91 -18
- package/src/extensions/pi-agent-read/src/core/tools/read/raw-read.ts +8 -2
- package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +38 -1
- package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +57 -2
- package/src/extensions/pi-agent-read/src/core/tools/read/structured-result.ts +3 -3
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +108 -46
- package/src/extensions/pi-agent-search/package.json +5 -5
- 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 +7 -7
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +11 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/scoped-search.ts +1 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-presentation.ts +42 -32
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +1 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +6 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +17 -3
- package/src/extensions/pi-agent-search/src/api/fuzzy.ts +5 -1
- package/src/extensions/pi-agent-search/src/api/search-parameters.ts +3 -3
- package/src/extensions/pi-agent-search/src/core/extension.ts +2 -1
- package/src/extensions/pi-agent-search/src/core/search-core.ts +13 -4
- package/src/extensions/pi-agent-text-editor/package.json +9 -9
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +3 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.ts +65 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +3 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/anchor.ts +12 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +4 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +11 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +54 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/status-summary.ts +18 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +4 -4
- package/src/extensions/pi-agent-text-editor/src/api/edit-completion.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +2 -1
- package/src/extensions/pi-agent-text-editor/src/api/native-edit-batch-event.ts +4 -0
- package/src/extensions/pi-agent-text-editor/src/api/stale-anchor-message.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +54 -12
- package/src/extensions/pi-agent-text-editor/src/core/editing-guidelines.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +10 -3
- package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +3 -13
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +35 -6
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +19 -1
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result-targets.ts +132 -11
- package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +232 -144
- package/src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts +34 -10
- package/src/extensions/pi-agent-text-editor/src/core/result-input.ts +24 -4
- package/src/extensions/pi-agent-text-editor/src/core/result-transfer.ts +7 -2
- package/src/extensions/pi-agent-text-editor/src/core/structured-result.ts +49 -214
- package/src/extensions/pi-agent-text-editor/src/core/text-change-engine.ts +5 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +152 -22
- 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 +76 -32
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +409 -209
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +6 -9
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +10 -3
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +9 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +7 -8
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +3 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +10 -4
- package/src/pi-agent-ide.ts +15 -1
- package/src/plugins/pi-agent-ide-ast/package.json +13 -13
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +5 -4
- package/src/plugins/pi-agent-ide-ast/src/overflow-handler.ts +2 -2
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +35 -9
- package/src/plugins/pi-agent-ide-ast/src/select-presentation.ts +1 -1
- package/src/plugins/pi-agent-ide-ast/src/select-schema.ts +10 -8
- package/src/plugins/pi-agent-ide-ast/src/tool-select.ts +28 -3
- package/src/plugins/pi-agent-ide-changes/index.ts +4 -3
- package/src/plugins/pi-agent-ide-changes/package.json +8 -8
- package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +66 -4
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +8 -11
- package/src/plugins/pi-agent-ide-debugger/index.ts +22 -10
- package/src/plugins/pi-agent-ide-debugger/src/dap-client.ts +5 -0
- package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +93 -38
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +6 -3
- package/src/plugins/pi-agent-ide-formatter/package.json +3 -3
- package/src/plugins/pi-agent-ide-languages/package.json +2 -2
- package/src/plugins/pi-agent-ide-lint/package.json +7 -7
- package/src/plugins/pi-agent-ide-lsp/index.ts +3 -3
- package/src/plugins/pi-agent-ide-lsp/package.json +9 -9
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +5 -2
- package/src/plugins/pi-agent-ide-terminal/src/output-limits.ts +3 -3
- package/src/plugins/pi-agent-ide-terminal/src/resources.ts +8 -6
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +3 -3
- package/src/plugins/pi-agent-ide-vision/index.ts +13 -4
- package/src/post-edit/gate.ts +13 -2
- package/dist/chunk-3JO7QFIL.js +0 -1
- package/dist/chunk-4NIFBFFR.js +0 -11
- package/dist/chunk-64M3SQPG.js +0 -3
- package/dist/chunk-7LZKOHH2.js +0 -1
- package/dist/chunk-EAZGN5ND.js +0 -7
- package/dist/chunk-FK42RSF4.js +0 -1
- package/dist/chunk-KBP3QUDT.js +0 -2
- package/dist/chunk-KR36BT5E.js +0 -1
- package/dist/chunk-MBUXFKIW.js +0 -3
- package/dist/chunk-OE7QVAI2.js +0 -5
- package/dist/chunk-SILJ3OL4.js +0 -9
- package/dist/chunk-SQKAXYIR.js +0 -2
- package/dist/chunk-VCGNVTXQ.js +0 -1
- package/src/extensions/pi-agent-read/src/core/tools/read/temp-resource-store.ts +0 -105
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ExtensionAPI,
|
|
3
|
+
ExtensionHandler,
|
|
4
|
+
ToolCallEvent,
|
|
5
|
+
ToolCallEventResult,
|
|
6
|
+
AgentToolResult,
|
|
7
|
+
} from "@earendil-works/pi-coding-agent";
|
|
8
|
+
import { connectResultTargets, TempResourceStore } from "pi-agent-resource";
|
|
9
|
+
import { connectReadPlugin } from "pi-agent-read/api/connect-plugin";
|
|
10
|
+
import { READ_PROTOCOL, READ_API_VERSION } from "pi-agent-read/api/plugin-protocol";
|
|
11
|
+
import { limitIdeOutput } from "./output-limits.js";
|
|
12
|
+
|
|
13
|
+
const sourceFields: Record<string, readonly string[]> = {
|
|
14
|
+
read: ["path"],
|
|
15
|
+
search: ["path"],
|
|
16
|
+
select: ["path"],
|
|
17
|
+
replace: ["path"],
|
|
18
|
+
insert: ["path"],
|
|
19
|
+
delete: ["path"],
|
|
20
|
+
write: ["path"],
|
|
21
|
+
copy: ["path", "target"],
|
|
22
|
+
move: ["path", "target"],
|
|
23
|
+
undo: ["file"],
|
|
24
|
+
diff: ["before", "after"],
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** Keep tool records private while strings carry registered composition references. */
|
|
28
|
+
export function createIdeTextResults(pi: ExtensionAPI) {
|
|
29
|
+
const store = connectResultTargets(pi);
|
|
30
|
+
const names = new Set<string>();
|
|
31
|
+
const outputs = new TempResourceStore();
|
|
32
|
+
const saveFullOutput = (text: string) => outputs.saveFile(text);
|
|
33
|
+
const boundedErrors = new Set<string>();
|
|
34
|
+
const contextErrors = new Map<string, Promise<AgentToolResult<unknown>["content"]>>();
|
|
35
|
+
// Read core owns deferred registration and reports setup failures.
|
|
36
|
+
void connectReadPlugin(pi, {
|
|
37
|
+
protocol: READ_PROTOCOL,
|
|
38
|
+
apiVersion: READ_API_VERSION,
|
|
39
|
+
id: "ide-output-retention",
|
|
40
|
+
setup(api) {
|
|
41
|
+
api.setOutputSaver(saveFullOutput);
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
pi.on("session_shutdown", () => outputs.dispose());
|
|
45
|
+
const on: ExtensionAPI["on"] = (event, handler) => {
|
|
46
|
+
// The SDK overloads describe event/handler pairs; forwarding keeps the original pair.
|
|
47
|
+
const toolCallHandler = handler as ExtensionHandler<ToolCallEvent, ToolCallEventResult>;
|
|
48
|
+
if (event !== "tool_call") return pi.on(event as "tool_call", toolCallHandler);
|
|
49
|
+
return pi.on("tool_call", async (call, context) => {
|
|
50
|
+
const result = await toolCallHandler(call, context);
|
|
51
|
+
if (!result?.block || !names.has(call.toolName) || result.reason === undefined) return result;
|
|
52
|
+
const limited = await limitIdeOutput(
|
|
53
|
+
[{ type: "text", text: result.reason }],
|
|
54
|
+
"",
|
|
55
|
+
saveFullOutput,
|
|
56
|
+
);
|
|
57
|
+
boundedErrors.add(call.toolCallId);
|
|
58
|
+
return {
|
|
59
|
+
...result,
|
|
60
|
+
reason: limited.text + (limited.notices.length ? `\n\n${limited.notices.join("\n")}` : ""),
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
const parents = new Map<string, string>();
|
|
65
|
+
const images = new Map<
|
|
66
|
+
string,
|
|
67
|
+
Extract<AgentToolResult<unknown>["content"][number], { type: "image" }>[]
|
|
68
|
+
>();
|
|
69
|
+
const clear = () => {
|
|
70
|
+
parents.clear();
|
|
71
|
+
images.clear();
|
|
72
|
+
boundedErrors.clear();
|
|
73
|
+
contextErrors.clear();
|
|
74
|
+
};
|
|
75
|
+
pi.on("session_start", clear);
|
|
76
|
+
pi.on("session_shutdown", clear);
|
|
77
|
+
pi.on("before_agent_start", (event) => ({
|
|
78
|
+
systemPrompt: `${event.systemPrompt}\n\n<ide_results>\nIDE tools return readable text. The leading system-result envelope is an internal reference, not file content; do not edit it. Compose tools by passing the unchanged result to a source parameter. Outside Codemode, pass the same text or its UUID. Store/load preserves these strings within the session. Use returned anchors to choose individual selections. Changed snapshots and previous sessions cannot be reused.\n</ide_results>`,
|
|
79
|
+
}));
|
|
80
|
+
pi.on("tool_execution_start", (event) => {
|
|
81
|
+
if (event.parentToolCallId !== undefined)
|
|
82
|
+
parents.set(event.toolCallId, parents.get(event.parentToolCallId) ?? event.parentToolCallId);
|
|
83
|
+
});
|
|
84
|
+
on("tool_call", (event, context) => {
|
|
85
|
+
if (!names.has(event.toolName)) return;
|
|
86
|
+
const input: Record<string, unknown> = { ...event.input };
|
|
87
|
+
try {
|
|
88
|
+
for (const field of sourceFields[event.toolName] ?? []) {
|
|
89
|
+
const value = input[field];
|
|
90
|
+
if (value === undefined) continue;
|
|
91
|
+
if (
|
|
92
|
+
event.toolName === "diff" &&
|
|
93
|
+
value !== null &&
|
|
94
|
+
typeof value === "object" &&
|
|
95
|
+
"path" in value
|
|
96
|
+
) {
|
|
97
|
+
input[field] = { ...value, path: store.source(value.path, context.cwd, true) };
|
|
98
|
+
} else {
|
|
99
|
+
const source = store.source(
|
|
100
|
+
value,
|
|
101
|
+
context.cwd,
|
|
102
|
+
event.toolName === "read"
|
|
103
|
+
? true
|
|
104
|
+
: ["write", "insert", "delete"].includes(event.toolName)
|
|
105
|
+
? "live"
|
|
106
|
+
: false,
|
|
107
|
+
);
|
|
108
|
+
if (event.toolName === "read" && Array.isArray(source)) {
|
|
109
|
+
const selected = store.resolve(source, context.cwd);
|
|
110
|
+
input[field] = store.register(selected.targets, context.cwd, selected.complete);
|
|
111
|
+
} else input[field] = source;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (
|
|
115
|
+
event.toolName === "select" &&
|
|
116
|
+
input.operation &&
|
|
117
|
+
typeof input.operation === "object" &&
|
|
118
|
+
"scopes" in input.operation
|
|
119
|
+
) {
|
|
120
|
+
input.operation = {
|
|
121
|
+
...input.operation,
|
|
122
|
+
scopes: store.source(input.operation.scopes, context.cwd),
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
for (const field of ["text", "content"]) {
|
|
126
|
+
const value = input[field];
|
|
127
|
+
if (
|
|
128
|
+
typeof value === "string" &&
|
|
129
|
+
(value.trimStart().startsWith("<system-result") ||
|
|
130
|
+
/<system-result\b[^>]*><uuid>[a-f\d-]{36}<\/uuid><\/system-result>/iu.test(value))
|
|
131
|
+
) {
|
|
132
|
+
return {
|
|
133
|
+
block: true,
|
|
134
|
+
reason: "A system result reference is not file content. Do not insert it into a file.",
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
Object.assign(event.input, input);
|
|
139
|
+
} catch (error) {
|
|
140
|
+
return { block: true, reason: error instanceof Error ? error.message : String(error) };
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
const registerTool: ExtensionAPI["registerTool"] = (definition) => {
|
|
144
|
+
names.add(definition.name);
|
|
145
|
+
const publicDefinition = {} as typeof definition;
|
|
146
|
+
const descriptors = Object.getOwnPropertyDescriptors(definition);
|
|
147
|
+
delete descriptors.outputSchema;
|
|
148
|
+
const execute: typeof definition.execute = async (...args) => {
|
|
149
|
+
const result = await definition.execute(...args).catch(async (error: unknown) => {
|
|
150
|
+
const limited = await limitIdeOutput(
|
|
151
|
+
[{ type: "text", text: error instanceof Error ? error.message : String(error) }],
|
|
152
|
+
"",
|
|
153
|
+
saveFullOutput,
|
|
154
|
+
);
|
|
155
|
+
boundedErrors.add(args[0]);
|
|
156
|
+
if (limited.notices.length === 0) throw error;
|
|
157
|
+
throw new Error(limited.text + `\n\n${limited.notices.join("\n")}`, { cause: error });
|
|
158
|
+
});
|
|
159
|
+
const limited = await limitIdeOutput(
|
|
160
|
+
result.content,
|
|
161
|
+
outputNotices(result.details),
|
|
162
|
+
saveFullOutput,
|
|
163
|
+
);
|
|
164
|
+
const text = limited.text + limited.metadataSuffix;
|
|
165
|
+
return {
|
|
166
|
+
...result,
|
|
167
|
+
content: [
|
|
168
|
+
{
|
|
169
|
+
type: "text",
|
|
170
|
+
text: text + (limited.notices.length ? `\n\n${limited.notices.join("\n")}` : ""),
|
|
171
|
+
},
|
|
172
|
+
...limited.images,
|
|
173
|
+
],
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
descriptors.execute = { value: execute, enumerable: true, configurable: true, writable: true };
|
|
177
|
+
const render = definition.renderCall;
|
|
178
|
+
if (render) {
|
|
179
|
+
const renderCall: typeof render = (args, theme, context) =>
|
|
180
|
+
render(displaySources(definition.name, args), theme, context);
|
|
181
|
+
descriptors.renderCall = {
|
|
182
|
+
value: renderCall,
|
|
183
|
+
enumerable: true,
|
|
184
|
+
configurable: true,
|
|
185
|
+
writable: true,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
const renderResult = definition.renderResult;
|
|
189
|
+
if (renderResult) {
|
|
190
|
+
const renderer: typeof renderResult = (result, options, theme, context) =>
|
|
191
|
+
renderResult(
|
|
192
|
+
{
|
|
193
|
+
...result,
|
|
194
|
+
content: result.content.map((block) =>
|
|
195
|
+
block.type === "text"
|
|
196
|
+
? {
|
|
197
|
+
...block,
|
|
198
|
+
text: block.text.replace(
|
|
199
|
+
/^<system-result\b[^>]*><uuid>[a-f\d-]{36}<\/uuid><\/system-result>\n/u,
|
|
200
|
+
"",
|
|
201
|
+
),
|
|
202
|
+
}
|
|
203
|
+
: block,
|
|
204
|
+
),
|
|
205
|
+
},
|
|
206
|
+
options,
|
|
207
|
+
theme,
|
|
208
|
+
context,
|
|
209
|
+
);
|
|
210
|
+
descriptors.renderResult = {
|
|
211
|
+
value: renderer,
|
|
212
|
+
enumerable: true,
|
|
213
|
+
configurable: true,
|
|
214
|
+
writable: true,
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
Object.defineProperties(publicDefinition, descriptors);
|
|
218
|
+
pi.registerTool(publicDefinition);
|
|
219
|
+
};
|
|
220
|
+
const finalize = () => {
|
|
221
|
+
// Host argument validation can fail before tool_call, execute and tool_result run.
|
|
222
|
+
// Bound those unpublished errors at the provider boundary; keep saved records unchanged.
|
|
223
|
+
pi.on("context", async (event) => ({
|
|
224
|
+
messages: await Promise.all(
|
|
225
|
+
event.messages.map(async (message) => {
|
|
226
|
+
if (
|
|
227
|
+
message.role !== "toolResult" ||
|
|
228
|
+
!message.isError ||
|
|
229
|
+
!names.has(message.toolName) ||
|
|
230
|
+
boundedErrors.has(message.toolCallId) ||
|
|
231
|
+
message.content.some(
|
|
232
|
+
(block) => block.type === "text" && block.text.startsWith("<system-result"),
|
|
233
|
+
)
|
|
234
|
+
)
|
|
235
|
+
return message;
|
|
236
|
+
let content = contextErrors.get(message.toolCallId);
|
|
237
|
+
if (content === undefined) {
|
|
238
|
+
content = limitIdeOutput(message.content, "", saveFullOutput).then((limited) => [
|
|
239
|
+
{
|
|
240
|
+
type: "text" as const,
|
|
241
|
+
text:
|
|
242
|
+
limited.text +
|
|
243
|
+
(limited.notices.length ? `\n\n${limited.notices.join("\n")}` : ""),
|
|
244
|
+
},
|
|
245
|
+
...limited.images,
|
|
246
|
+
]);
|
|
247
|
+
contextErrors.set(message.toolCallId, content);
|
|
248
|
+
}
|
|
249
|
+
return { ...message, content: await content };
|
|
250
|
+
}),
|
|
251
|
+
),
|
|
252
|
+
}));
|
|
253
|
+
pi.on("tool_result", async (event, context) => {
|
|
254
|
+
if (event.toolName === "codemode") {
|
|
255
|
+
store.refreshAll();
|
|
256
|
+
const generated = images.get(event.toolCallId) ?? [];
|
|
257
|
+
images.delete(event.toolCallId);
|
|
258
|
+
for (const [child, parent] of parents)
|
|
259
|
+
if (parent === event.toolCallId) parents.delete(child);
|
|
260
|
+
const metadata = event.content.filter(
|
|
261
|
+
(block) => block.type === "text" && block.text.startsWith("\n\n---\n\n# Guide:"),
|
|
262
|
+
);
|
|
263
|
+
const content = event.content.filter((block) => !metadata.includes(block));
|
|
264
|
+
const limited = await limitIdeOutput([...content, ...generated], "", saveFullOutput);
|
|
265
|
+
return {
|
|
266
|
+
content: [
|
|
267
|
+
...(limited.textTruncated
|
|
268
|
+
? [{ type: "text" as const, text: limited.text }]
|
|
269
|
+
: content.filter((block) => block.type === "text")),
|
|
270
|
+
...limited.images,
|
|
271
|
+
...(limited.notices.length
|
|
272
|
+
? [{ type: "text" as const, text: `\n\n${limited.notices.join("\n")}` }]
|
|
273
|
+
: []),
|
|
274
|
+
...metadata,
|
|
275
|
+
],
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
if (!names.has(event.toolName)) return;
|
|
279
|
+
const original = event.content
|
|
280
|
+
.filter((block) => block.type === "text")
|
|
281
|
+
.map((block) => block.text)
|
|
282
|
+
.join("\n");
|
|
283
|
+
const record = event.structuredContent;
|
|
284
|
+
const outcome =
|
|
285
|
+
record !== null && typeof record === "object" && "data" in record
|
|
286
|
+
? record
|
|
287
|
+
: { status: event.isError ? "error" : "success", data: record };
|
|
288
|
+
const data = outcome.data;
|
|
289
|
+
const targetUnavailable =
|
|
290
|
+
data !== null &&
|
|
291
|
+
typeof data === "object" &&
|
|
292
|
+
"effect" in data &&
|
|
293
|
+
data.effect === "applied" &&
|
|
294
|
+
"targetUnavailable" in data &&
|
|
295
|
+
typeof data.targetUnavailable === "string"
|
|
296
|
+
? data.targetUnavailable
|
|
297
|
+
: undefined;
|
|
298
|
+
const readable =
|
|
299
|
+
targetUnavailable === undefined
|
|
300
|
+
? original
|
|
301
|
+
: `${original}\n\nThis result has no verified text selection: ${targetUnavailable}\nRead/Search the file before the next edit; do not repeat the applied edit.`;
|
|
302
|
+
const resources = resultResources(outcome);
|
|
303
|
+
const shown = store.publish(outcome, readable, context.cwd, resources);
|
|
304
|
+
const parent = parents.get(event.toolCallId);
|
|
305
|
+
parents.delete(event.toolCallId);
|
|
306
|
+
if (parent !== undefined) {
|
|
307
|
+
const generated = event.content.filter((block) => block.type === "image");
|
|
308
|
+
if (generated.length) images.set(parent, [...(images.get(parent) ?? []), ...generated]);
|
|
309
|
+
}
|
|
310
|
+
return {
|
|
311
|
+
content: [
|
|
312
|
+
{ type: "text" as const, text: shown },
|
|
313
|
+
...event.content.filter((block) => block.type !== "text"),
|
|
314
|
+
],
|
|
315
|
+
};
|
|
316
|
+
});
|
|
317
|
+
};
|
|
318
|
+
return { api: { ...pi, on, registerTool }, finalize };
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/** Read range notices belong to metadata, including reads spanning several resources. */
|
|
322
|
+
function outputNotices(details: unknown): string[] {
|
|
323
|
+
if (details === null || typeof details !== "object") return [];
|
|
324
|
+
const notices =
|
|
325
|
+
"outputNotice" in details && typeof details.outputNotice === "string"
|
|
326
|
+
? [details.outputNotice]
|
|
327
|
+
: [];
|
|
328
|
+
if ("resources" in details && Array.isArray(details.resources)) {
|
|
329
|
+
const resources: unknown[] = details.resources;
|
|
330
|
+
for (const result of resources) {
|
|
331
|
+
if (result !== null && typeof result === "object" && "details" in result)
|
|
332
|
+
notices.push(...outputNotices(result.details));
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return notices;
|
|
336
|
+
}
|
|
337
|
+
/** Keep opaque result bodies out of user-facing tool titles without changing execution inputs. */
|
|
338
|
+
function displaySources<Args extends Record<string, unknown>>(name: string, args: Args): Args {
|
|
339
|
+
const label = (value: unknown): unknown => {
|
|
340
|
+
if (Array.isArray(value)) return value.map(label);
|
|
341
|
+
if (typeof value !== "string") return value;
|
|
342
|
+
const uuid = /^<system-result\b[^>]*><uuid>([a-f\d-]{36})<\/uuid>/u.exec(value)?.[1];
|
|
343
|
+
return uuid ? `RESULT#${uuid}` : value;
|
|
344
|
+
};
|
|
345
|
+
const shown = { ...args };
|
|
346
|
+
for (const field of sourceFields[name] ?? [])
|
|
347
|
+
Object.assign(shown, { [field]: label(args[field]) });
|
|
348
|
+
return shown;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
function resultResources(outcome: unknown): string[] {
|
|
352
|
+
if (outcome === null || typeof outcome !== "object" || !("data" in outcome)) return [];
|
|
353
|
+
const data = outcome.data;
|
|
354
|
+
if (data === null || typeof data !== "object") return [];
|
|
355
|
+
if ("resources" in data && Array.isArray(data.resources)) {
|
|
356
|
+
const resources: unknown[] = data.resources;
|
|
357
|
+
return resources.flatMap((resource) => resultResources({ data: resource }));
|
|
358
|
+
}
|
|
359
|
+
if ("files" in data && Array.isArray(data.files)) {
|
|
360
|
+
const files: unknown[] = data.files;
|
|
361
|
+
return files.flatMap((file) =>
|
|
362
|
+
file !== null &&
|
|
363
|
+
typeof file === "object" &&
|
|
364
|
+
"source" in file &&
|
|
365
|
+
typeof file.source === "string" &&
|
|
366
|
+
/^(?:shell|debug):/u.test(file.source)
|
|
367
|
+
? [file.source]
|
|
368
|
+
: [],
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
return "source" in data && typeof data.source === "string" ? [data.source] : [];
|
|
372
|
+
}
|
|
@@ -65,11 +65,12 @@ export default async function registerProgressiveDocumentation(pi: ExtensionAPI)
|
|
|
65
65
|
},
|
|
66
66
|
},
|
|
67
67
|
});
|
|
68
|
-
api.describe(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
api.describe({
|
|
69
|
+
path: () =>
|
|
70
|
+
registry.list().length === 0
|
|
71
|
+
? undefined
|
|
72
|
+
: "docs: lists packaged agent guidance; docs:<id> reads a listed guide.",
|
|
73
|
+
});
|
|
73
74
|
api.addPromptGuideline(() => renderPromptGuideline(registry.list()));
|
|
74
75
|
},
|
|
75
76
|
});
|
|
@@ -123,10 +124,11 @@ export default async function registerProgressiveDocumentation(pi: ExtensionAPI)
|
|
|
123
124
|
];
|
|
124
125
|
if (documents.length === 0) return;
|
|
125
126
|
remember(documents.map((document) => document.id));
|
|
126
|
-
//
|
|
127
|
-
|
|
128
|
-
if (parent !== undefined && event.structuredContent !== undefined)
|
|
127
|
+
// Keep nested source strings minimal and deliver guidance once on the parent result.
|
|
128
|
+
if (parent !== undefined) {
|
|
129
129
|
pendingGuides.set(parent, [...(pendingGuides.get(parent) ?? []), ...documents]);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
130
132
|
return {
|
|
131
133
|
content: [
|
|
132
134
|
...event.content,
|
|
@@ -163,7 +165,7 @@ function renderPromptGuideline(documents: readonly AgentDocumentation[]): string
|
|
|
163
165
|
if (documents.length === 0) return undefined;
|
|
164
166
|
return [
|
|
165
167
|
"Read the matching docs:<id> before using any tool or feature with packaged guidance, including tools discovered later or called through Codemode. Read each guide once per branch. Tool descriptions and docs: listings do not replace the full guide.",
|
|
166
|
-
"If a result includes a Guide, read it before your next use. The call has already run: do not repeat it just to obtain documentation.
|
|
168
|
+
"If a result includes a Guide, read it before your next use. The call has already run: do not repeat it just to obtain documentation. Nested calls keep their guides on the parent result, even when the script does not print the child output.",
|
|
167
169
|
"Available documents:",
|
|
168
170
|
...documents.map((document) => ` - ${document.id} — ${document.description}`),
|
|
169
171
|
].join("\n");
|
|
@@ -36,12 +36,13 @@ export default async function registerFilesystemPlugin(pi: ExtensionAPI): Promis
|
|
|
36
36
|
renderResult: renderReadResult,
|
|
37
37
|
recoverFailure: recoverFilesystemPath,
|
|
38
38
|
});
|
|
39
|
-
api.describe(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
api.describe({
|
|
40
|
+
path: () =>
|
|
41
|
+
renderContentDescription(
|
|
42
|
+
"File path — file content; directory path — entry listing. Relative, absolute and file:// paths accepted.",
|
|
43
|
+
readHost.listDescriptions(),
|
|
44
|
+
),
|
|
45
|
+
});
|
|
45
46
|
},
|
|
46
47
|
} satisfies ReadPlugin;
|
|
47
48
|
const textEditorPlugin = {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-filesystem",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"pi-agent-image": "0.7.
|
|
10
|
-
"pi-agent-invariant": "0.7.
|
|
11
|
-
"pi-agent-read": "0.7.
|
|
12
|
-
"pi-agent-resource": "0.7.
|
|
13
|
-
"pi-agent-text": "0.7.
|
|
14
|
-
"pi-agent-text-editor": "0.7.
|
|
9
|
+
"pi-agent-image": "0.7.2",
|
|
10
|
+
"pi-agent-invariant": "0.7.2",
|
|
11
|
+
"pi-agent-read": "0.7.2",
|
|
12
|
+
"pi-agent-resource": "0.7.2",
|
|
13
|
+
"pi-agent-text": "0.7.2",
|
|
14
|
+
"pi-agent-text-editor": "0.7.2"
|
|
15
15
|
},
|
|
16
16
|
"pi": {
|
|
17
17
|
"extensions": [
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-filesystem-image",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#extension": "./index.ts"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"pi-agent-image": "0.7.
|
|
10
|
-
"pi-agent-resource": "0.7.
|
|
9
|
+
"pi-agent-image": "0.7.2",
|
|
10
|
+
"pi-agent-resource": "0.7.2"
|
|
11
11
|
},
|
|
12
12
|
"pi": {
|
|
13
13
|
"extensions": [
|
|
@@ -71,9 +71,10 @@ const readPlugin = {
|
|
|
71
71
|
return { kind: "continue", context: { ...context, state: transformed } };
|
|
72
72
|
},
|
|
73
73
|
});
|
|
74
|
-
api.describe(
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
api.describe({
|
|
75
|
+
views:
|
|
76
|
+
'jq:<filter> — query local JSON text with the installed jq executable, e.g. ["jq:.scripts | keys"]. Exactly one non-empty jq filter is required; it cannot be combined with other views. offset/limit apply to the transformed output, not original source lines.',
|
|
77
|
+
});
|
|
77
78
|
},
|
|
78
79
|
} satisfies ReadPlugin;
|
|
79
80
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-filesystem-jq",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"cross-spawn": "^7.0.6",
|
|
10
|
-
"pi-agent-doctor": "0.7.
|
|
11
|
-
"pi-agent-documentation": "0.7.
|
|
12
|
-
"pi-agent-read": "0.7.
|
|
13
|
-
"pi-agent-text": "0.7.
|
|
10
|
+
"pi-agent-doctor": "0.7.2",
|
|
11
|
+
"pi-agent-documentation": "0.7.2",
|
|
12
|
+
"pi-agent-read": "0.7.2",
|
|
13
|
+
"pi-agent-text": "0.7.2"
|
|
14
14
|
},
|
|
15
15
|
"pi": {
|
|
16
16
|
"extensions": [
|
|
@@ -16,7 +16,10 @@ export function parseJqView(views: readonly string[] | undefined): JqView | unde
|
|
|
16
16
|
const jqViews = views?.filter((view) => view === "jq" || view.startsWith("jq:")) ?? [];
|
|
17
17
|
if (jqViews.length === 0) return undefined;
|
|
18
18
|
if (jqViews.length > 1) throw new Error("Read accepts only one jq view");
|
|
19
|
-
if (views?.length !== 1)
|
|
19
|
+
if (views?.length !== 1)
|
|
20
|
+
throw new Error(
|
|
21
|
+
"The jq view cannot be combined with other views. Keep only one jq:<filter> in views.",
|
|
22
|
+
);
|
|
20
23
|
const selected = jqViews[0];
|
|
21
24
|
if (selected === undefined || selected === "jq" || selected.slice(3).trim().length === 0)
|
|
22
25
|
throw new Error('The jq view requires a filter, for example views: ["jq:.scripts"]');
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-filesystem-pdf",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-pdf": "0.7.
|
|
7
|
-
"pi-agent-resource": "0.7.
|
|
6
|
+
"pi-agent-pdf": "0.7.2",
|
|
7
|
+
"pi-agent-resource": "0.7.2"
|
|
8
8
|
},
|
|
9
9
|
"pi": {
|
|
10
10
|
"extensions": [
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-filesystem-text",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#extension": "./index.ts"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"pi-agent-resource": "0.7.
|
|
10
|
-
"pi-agent-text": "0.7.
|
|
9
|
+
"pi-agent-resource": "0.7.2",
|
|
10
|
+
"pi-agent-text": "0.7.2"
|
|
11
11
|
},
|
|
12
12
|
"pi": {
|
|
13
13
|
"extensions": [
|
|
@@ -35,9 +35,10 @@ export default async function registerWeb(pi: ExtensionAPI): Promise<void> {
|
|
|
35
35
|
renderResult: renderWebResult,
|
|
36
36
|
preserveTruncatedOutput: true,
|
|
37
37
|
});
|
|
38
|
-
api.describe(
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
api.describe({
|
|
39
|
+
path: () =>
|
|
40
|
+
renderContentDescription("HTTP(S) URL — remote content.", readHost.listDescriptions()),
|
|
41
|
+
});
|
|
41
42
|
},
|
|
42
43
|
} satisfies ReadPlugin;
|
|
43
44
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-web",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"defuddle": "^0.19.1",
|
|
10
10
|
"linkedom": "^0.18.12",
|
|
11
|
-
"pi-agent-doctor": "0.7.
|
|
12
|
-
"pi-agent-image": "0.7.
|
|
13
|
-
"pi-agent-read": "0.7.
|
|
14
|
-
"pi-agent-resource": "0.7.
|
|
15
|
-
"pi-agent-search": "0.7.
|
|
16
|
-
"pi-agent-text": "0.7.
|
|
11
|
+
"pi-agent-doctor": "0.7.2",
|
|
12
|
+
"pi-agent-image": "0.7.2",
|
|
13
|
+
"pi-agent-read": "0.7.2",
|
|
14
|
+
"pi-agent-resource": "0.7.2",
|
|
15
|
+
"pi-agent-search": "0.7.2",
|
|
16
|
+
"pi-agent-text": "0.7.2",
|
|
17
17
|
"playwright-core": "^1.62.1"
|
|
18
18
|
},
|
|
19
19
|
"pi": {
|
package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-web-html",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"defuddle": "^0.19.1",
|
|
10
10
|
"linkedom": "^0.18.12",
|
|
11
|
-
"pi-agent-resource": "0.7.
|
|
11
|
+
"pi-agent-resource": "0.7.2"
|
|
12
12
|
},
|
|
13
13
|
"pi": {
|
|
14
14
|
"extensions": [
|
package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-web-image",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-image": "0.7.
|
|
7
|
-
"pi-agent-resource": "0.7.
|
|
6
|
+
"pi-agent-image": "0.7.2",
|
|
7
|
+
"pi-agent-resource": "0.7.2"
|
|
8
8
|
},
|
|
9
9
|
"pi": {
|
|
10
10
|
"extensions": [
|
package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-web-pdf",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-pdf": "0.7.
|
|
7
|
-
"pi-agent-resource": "0.7.
|
|
6
|
+
"pi-agent-pdf": "0.7.2",
|
|
7
|
+
"pi-agent-resource": "0.7.2"
|
|
8
8
|
},
|
|
9
9
|
"pi": {
|
|
10
10
|
"extensions": [
|
package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-web-text",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-resource": "0.7.
|
|
7
|
-
"pi-agent-text": "0.7.
|
|
6
|
+
"pi-agent-resource": "0.7.2",
|
|
7
|
+
"pi-agent-text": "0.7.2"
|
|
8
8
|
},
|
|
9
9
|
"pi": {
|
|
10
10
|
"extensions": [
|