pi-agent-ide 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -0
- package/README.md +7 -6
- 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-AWXVJ5AC.js +1 -0
- package/dist/chunk-BGUSBUUD.js +26 -0
- package/dist/{chunk-CW53ZTU3.js → chunk-DQXPQOF7.js} +1 -1
- package/dist/chunk-EJ5OACQM.js +1 -0
- 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-J34VKQGJ.js +1 -0
- package/dist/chunk-J4RTW44E.js +1 -0
- package/dist/{chunk-HGPUI7F3.js → chunk-KII2JQC5.js} +1 -1
- package/dist/{chunk-CEKXBS55.js → chunk-L7JMDDSD.js} +1 -1
- package/dist/{chunk-EWNWKDMP.js → chunk-LY6U5EAD.js} +1 -1
- package/dist/{chunk-ERVMDQGX.js → chunk-MGCHOGQD.js} +1 -1
- package/dist/{chunk-LRYE2WCN.js → chunk-O6LE42GK.js} +1 -1
- package/dist/{chunk-KAB3AYA2.js → chunk-OBNING2A.js} +1 -1
- package/dist/chunk-QH4ZUDOD.js +1 -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-SSHZEWWV.js → chunk-WGGIQ7IJ.js} +1 -1
- package/dist/chunk-ZG2MWXCR.js +2 -0
- package/dist/chunk-ZUMN6U77.js +27 -0
- package/dist/entry-10.js +1 -1
- package/dist/entry-11.js +1 -1
- package/dist/entry-12.js +1 -1
- package/dist/entry-13.js +1 -1
- package/dist/entry-14.js +1 -1
- package/dist/entry-15.js +1 -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 +1 -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/tools.md +11 -0
- 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 +66 -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-resource/src/resource.ts +2 -0
- 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 +47 -19
- 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 +6 -3
- 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/api/tool-renderer.ts +3 -0
- 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 +182 -10
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +135 -6
- 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 +60 -2
- 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-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 +61 -38
- package/src/api/hooks.ts +168 -0
- package/src/api/text-editor.ts +2 -0
- package/src/composite/builtin-extensions.ts +13 -0
- package/src/composite/extensions-config.ts +18 -0
- package/src/composite/module-labels.ts +12 -0
- package/src/composite/module-settings-store.ts +17 -1
- package/src/composite/module-settings.ts +34 -4
- package/src/composite/preferences.ts +26 -0
- package/src/composite/settings-panel.ts +62 -30
- 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/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 +66 -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 +47 -19
- 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 +6 -3
- 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 +60 -2
- 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/api/tool-renderer.ts +3 -0
- 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 +182 -10
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +135 -6
- 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/pi-agent-ide.ts +2 -1
- 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 +81 -0
- package/src/plugins/pi-agent-ide-processes/src/ui.ts +252 -0
- package/src/plugins/pi-agent-ide-terminal/index.ts +40 -0
- package/src/plugins/pi-agent-ide-terminal/src/output-limits.ts +52 -0
- package/src/plugins/pi-agent-ide-terminal/src/process-provider.ts +30 -0
- package/src/plugins/pi-agent-ide-terminal/src/renderer.ts +204 -0
- package/src/plugins/pi-agent-ide-terminal/src/resources.ts +452 -0
- package/src/plugins/pi-agent-ide-terminal/src/screen-image.ts +127 -0
- package/src/plugins/pi-agent-ide-terminal/src/search.ts +159 -0
- package/src/plugins/pi-agent-ide-terminal/src/session-manager.ts +642 -0
- package/src/plugins/pi-agent-ide-terminal/src/shell-profile.ts +56 -0
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +151 -0
- package/src/plugins/pi-agent-ide-terminal/src/types.ts +78 -0
- package/src/plugins/pi-agent-ide-terminal/src/ui.ts +212 -0
- package/dist/chunk-5MSNYFDE.js +0 -1
- package/dist/chunk-B5KB2I7J.js +0 -3
- package/dist/chunk-NMFQGKPE.js +0 -2
- package/dist/chunk-OVUYPHDE.js +0 -1
- package/dist/chunk-RHV5STR3.js +0 -3
- package/dist/chunk-TPIHQYK2.js +0 -14
- package/dist/chunk-VCCMVQXU.js +0 -1
- package/dist/chunk-VZJIZXSH.js +0 -14
- package/dist/entry-16.js +0 -1
- 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
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
type Resource,
|
|
9
9
|
type ResourceResolver,
|
|
10
10
|
type ResourceResolverContext,
|
|
11
|
-
type ResourceWrite,
|
|
12
11
|
} from "pi-agent-resource";
|
|
13
12
|
import {
|
|
14
13
|
createTextDocument,
|
|
@@ -36,6 +35,7 @@ import {
|
|
|
36
35
|
type AnyTextMutationToolRegistration,
|
|
37
36
|
assertTextMutationToolRegistration,
|
|
38
37
|
type TextMutationToolListener,
|
|
38
|
+
type TextSemanticMutationHandler,
|
|
39
39
|
} from "#src/api/mutation-tool.js";
|
|
40
40
|
import {
|
|
41
41
|
isResourceResolverRegistration,
|
|
@@ -74,6 +74,11 @@ import {
|
|
|
74
74
|
} from "#src/core/text-change-engine.js";
|
|
75
75
|
import { previewTextMutation } from "#src/core/text-mutation.js";
|
|
76
76
|
import { loadTextEditorConfig, recoverySection } from "#src/core/text-editor-config.js";
|
|
77
|
+
import {
|
|
78
|
+
ApplyUndoStore,
|
|
79
|
+
type ApplyUndoBeforeState,
|
|
80
|
+
type ApplyUndoResult,
|
|
81
|
+
} from "#src/core/apply/apply-undo-store.js";
|
|
77
82
|
|
|
78
83
|
import type {
|
|
79
84
|
TextAnchorInspectionOutcome,
|
|
@@ -106,6 +111,11 @@ interface RegisteredPlugin {
|
|
|
106
111
|
readonly ready: Promise<void>;
|
|
107
112
|
}
|
|
108
113
|
|
|
114
|
+
interface RegisteredSemanticHandler {
|
|
115
|
+
readonly pluginId: string;
|
|
116
|
+
readonly handler: TextSemanticMutationHandler;
|
|
117
|
+
readonly tool: TextEditorToolId;
|
|
118
|
+
}
|
|
109
119
|
interface RegisteredHandler {
|
|
110
120
|
readonly pluginId: string;
|
|
111
121
|
readonly registration: TextEditHandlerRegistration;
|
|
@@ -152,6 +162,7 @@ interface PluginContributionDraft {
|
|
|
152
162
|
readonly anchorResolvers: TextAnchorResolverContribution[];
|
|
153
163
|
readonly presenters?: TextPresenterContribution[];
|
|
154
164
|
readonly handlers: RegisteredHandler[];
|
|
165
|
+
readonly semanticHandlers?: RegisteredSemanticHandler[];
|
|
155
166
|
readonly promptContributions: PromptContribution[];
|
|
156
167
|
readonly writablePromptContributions: WritablePromptContribution[];
|
|
157
168
|
readonly tools: TextEditorToolId[];
|
|
@@ -223,11 +234,15 @@ export interface TextResourceEditRequest {
|
|
|
223
234
|
readonly source: string;
|
|
224
235
|
readonly read: boolean;
|
|
225
236
|
readonly allowReadFailure?: boolean;
|
|
237
|
+
/** Allow an anchored semantic action to use a read-only resource. */
|
|
238
|
+
readonly requireWrite?: boolean;
|
|
226
239
|
}
|
|
227
240
|
|
|
228
241
|
export interface TextResourcesMutationResult<Result> {
|
|
229
242
|
readonly changes: ReadonlyMap<string, readonly TextChange[]>;
|
|
230
243
|
readonly result: Result;
|
|
244
|
+
/** Complete without document writes, mutation guards, post-edit work, or edit completions. */
|
|
245
|
+
readonly resourceEffect?: boolean;
|
|
231
246
|
}
|
|
232
247
|
|
|
233
248
|
export type TextResourcesEditOutcome<Result> =
|
|
@@ -266,6 +281,12 @@ export interface TextResourcesEditContext
|
|
|
266
281
|
extends ResourceResolverContext, TextMutationGuardContext {}
|
|
267
282
|
|
|
268
283
|
export interface TextEditorCore {
|
|
284
|
+
/** Record the complete pre-Apply state and return a session-scoped undo receipt. */
|
|
285
|
+
recordApplyUndo(before: readonly ApplyUndoBeforeState[]): Promise<string>;
|
|
286
|
+
/** Atomically restore one Apply receipt. */
|
|
287
|
+
restoreApplyUndo(transaction: string, signal?: AbortSignal): Promise<ApplyUndoResult>;
|
|
288
|
+
/** Return whether an Apply receipt is still active in this session. */
|
|
289
|
+
hasApplyUndo(transaction: string): boolean;
|
|
269
290
|
/** Finalize a surviving local text file after a whole-file operation; binary files are untouched. */
|
|
270
291
|
postProcessFile(source: string, context: ResourceResolverContext): Promise<void>;
|
|
271
292
|
/** Serialize whole-file effects with text edits; the action must not enqueue another edit. */
|
|
@@ -304,6 +325,10 @@ export interface TextEditorCore {
|
|
|
304
325
|
resolveAnchor: ResolveResourceTextAnchor,
|
|
305
326
|
) => TextResourcesMutationResult<unknown> | Promise<TextResourcesMutationResult<unknown>>,
|
|
306
327
|
): Promise<TextMutationPreviewOutcome>;
|
|
328
|
+
getSemanticMutationHandler(
|
|
329
|
+
tool: TextEditorToolId,
|
|
330
|
+
input: unknown,
|
|
331
|
+
): TextSemanticMutationHandler | undefined;
|
|
307
332
|
executeEdit<Input, Result>(
|
|
308
333
|
tool: TextEditorToolId,
|
|
309
334
|
initialState: TextPreEditState<Input>,
|
|
@@ -336,6 +361,7 @@ export function createTextEditorCore(
|
|
|
336
361
|
const resolvers: RegisteredResolver[] = [];
|
|
337
362
|
const anchorRegistry = new TextAnchorRegistry();
|
|
338
363
|
const handlers: RegisteredHandler[] = [];
|
|
364
|
+
const semanticHandlers: RegisteredSemanticHandler[] = [];
|
|
339
365
|
const presenters: RegisteredPresenter[] = [];
|
|
340
366
|
const postEditHandlers = new Map<string, TextPostEditHandlerRegistration>();
|
|
341
367
|
const pendingPlugins = new Set<Promise<void>>();
|
|
@@ -346,6 +372,15 @@ export function createTextEditorCore(
|
|
|
346
372
|
const mutationTools = new Map<string, AnyTextMutationToolRegistration>();
|
|
347
373
|
const mutationListeners = new Set<TextMutationToolListener>();
|
|
348
374
|
const editCompletionListeners = new Set<TextEditCompletionListener>();
|
|
375
|
+
const applyUndoStore = new ApplyUndoStore();
|
|
376
|
+
editCompletionListeners.add((completion) => {
|
|
377
|
+
applyUndoStore.observeTextChange(
|
|
378
|
+
path.resolve(completion.cwd, completion.resourceSource),
|
|
379
|
+
completion.before.content,
|
|
380
|
+
completion.after.content,
|
|
381
|
+
completion.postProcessing ?? "complete",
|
|
382
|
+
);
|
|
383
|
+
});
|
|
349
384
|
const mutationGuards: TextMutationGuardRegistration[] = [];
|
|
350
385
|
const toolRenderers = new Map<TextEditorToolId, TextEditorToolRendererRegistration>();
|
|
351
386
|
const scriptIndexOperations = new Map<string, ScriptIndexOperation>();
|
|
@@ -369,6 +404,7 @@ export function createTextEditorCore(
|
|
|
369
404
|
draft,
|
|
370
405
|
resolvers,
|
|
371
406
|
handlers,
|
|
407
|
+
semanticHandlers,
|
|
372
408
|
promptContributions,
|
|
373
409
|
writablePromptContributions,
|
|
374
410
|
);
|
|
@@ -437,6 +473,7 @@ export function createTextEditorCore(
|
|
|
437
473
|
}
|
|
438
474
|
|
|
439
475
|
handlers.push(...draft.handlers);
|
|
476
|
+
semanticHandlers.push(...(draft.semanticHandlers ?? []));
|
|
440
477
|
for (const operation of draft.scriptIndexOperations ?? [])
|
|
441
478
|
scriptIndexOperations.set(operation.name, operation);
|
|
442
479
|
mutationGuards.push(...(draft.mutationGuards ?? []));
|
|
@@ -474,6 +511,15 @@ export function createTextEditorCore(
|
|
|
474
511
|
};
|
|
475
512
|
|
|
476
513
|
const core: TextEditorCore = {
|
|
514
|
+
recordApplyUndo(before) {
|
|
515
|
+
return applyUndoStore.record(before);
|
|
516
|
+
},
|
|
517
|
+
restoreApplyUndo(transaction, signal) {
|
|
518
|
+
return enqueueMutation(() => applyUndoStore.restore(transaction), signal);
|
|
519
|
+
},
|
|
520
|
+
hasApplyUndo(transaction) {
|
|
521
|
+
return applyUndoStore.has(transaction);
|
|
522
|
+
},
|
|
477
523
|
async postProcessFile(source, context) {
|
|
478
524
|
await enqueueMutation(async () => {
|
|
479
525
|
const file = path.resolve(context.cwd, source);
|
|
@@ -536,6 +582,15 @@ export function createTextEditorCore(
|
|
|
536
582
|
getScriptIndexOperation(name) {
|
|
537
583
|
return scriptIndexOperations.get(name);
|
|
538
584
|
},
|
|
585
|
+
getSemanticMutationHandler(tool, input): TextSemanticMutationHandler | undefined {
|
|
586
|
+
const matches = semanticHandlers.filter(
|
|
587
|
+
(registered) => registered.tool === tool && registered.handler.matches(input),
|
|
588
|
+
);
|
|
589
|
+
if (matches.length > 1) {
|
|
590
|
+
throw new Error(`More than one semantic handler accepted ${tool}`);
|
|
591
|
+
}
|
|
592
|
+
return matches[0]?.handler;
|
|
593
|
+
},
|
|
539
594
|
getToolRenderer(tool): TextEditorToolRendererRegistration | undefined {
|
|
540
595
|
return toolRenderers.get(tool);
|
|
541
596
|
},
|
|
@@ -729,6 +784,7 @@ export function createTextEditorCore(
|
|
|
729
784
|
(listener) => core.onDidEdit(listener),
|
|
730
785
|
(request) => previewTextMutation(core, request),
|
|
731
786
|
(section) => recoverySection(projectConfig, section),
|
|
787
|
+
(transaction, signal) => core.restoreApplyUndo(transaction, signal),
|
|
732
788
|
);
|
|
733
789
|
const ready = registrationQueue.then(async () => {
|
|
734
790
|
try {
|
|
@@ -930,6 +986,7 @@ async function previewTextResources(
|
|
|
930
986
|
source,
|
|
931
987
|
request.read,
|
|
932
988
|
request.allowReadFailure ?? false,
|
|
989
|
+
request.requireWrite ?? true,
|
|
933
990
|
context,
|
|
934
991
|
resolvers,
|
|
935
992
|
);
|
|
@@ -981,7 +1038,7 @@ async function previewTextResources(
|
|
|
981
1038
|
|
|
982
1039
|
interface PreparedTextResource {
|
|
983
1040
|
readonly requestedSource: string;
|
|
984
|
-
readonly resource: Resource
|
|
1041
|
+
readonly resource: Resource;
|
|
985
1042
|
readonly resolverId: string;
|
|
986
1043
|
readonly existed: boolean;
|
|
987
1044
|
readonly before: TextDocument;
|
|
@@ -1022,6 +1079,7 @@ async function editTextResources<Result>(
|
|
|
1022
1079
|
source,
|
|
1023
1080
|
request.read,
|
|
1024
1081
|
request.allowReadFailure ?? false,
|
|
1082
|
+
request.requireWrite ?? true,
|
|
1025
1083
|
context,
|
|
1026
1084
|
resolvers,
|
|
1027
1085
|
);
|
|
@@ -1048,6 +1106,20 @@ async function editTextResources<Result>(
|
|
|
1048
1106
|
);
|
|
1049
1107
|
});
|
|
1050
1108
|
|
|
1109
|
+
if (mutation.resourceEffect === true) {
|
|
1110
|
+
if (mutation.changes.size !== 0) {
|
|
1111
|
+
return {
|
|
1112
|
+
kind: "failed",
|
|
1113
|
+
failure: {
|
|
1114
|
+
code: "INVALID_WRITE_CONTENT",
|
|
1115
|
+
source: sources[0] ?? "",
|
|
1116
|
+
message: "A resource effect cannot also contain document changes",
|
|
1117
|
+
},
|
|
1118
|
+
completed: [],
|
|
1119
|
+
};
|
|
1120
|
+
}
|
|
1121
|
+
return { kind: "completed", resources: [], result: mutation.result };
|
|
1122
|
+
}
|
|
1051
1123
|
for (const source of mutation.changes.keys()) {
|
|
1052
1124
|
if (!prepared.has(source)) {
|
|
1053
1125
|
return {
|
|
@@ -1146,7 +1218,7 @@ async function editTextResources<Result>(
|
|
|
1146
1218
|
}
|
|
1147
1219
|
|
|
1148
1220
|
try {
|
|
1149
|
-
await item.resource.write(
|
|
1221
|
+
await requiredValue(item.resource.write)(
|
|
1150
1222
|
finalContent,
|
|
1151
1223
|
context.signal === undefined ? {} : { signal: context.signal },
|
|
1152
1224
|
);
|
|
@@ -1155,7 +1227,7 @@ async function editTextResources<Result>(
|
|
|
1155
1227
|
for (const writtenSource of [source, ...written].reverse()) {
|
|
1156
1228
|
const writtenItem = requiredValue(prepared.get(writtenSource));
|
|
1157
1229
|
try {
|
|
1158
|
-
await writtenItem.resource.write(
|
|
1230
|
+
await requiredValue(writtenItem.resource.write)(
|
|
1159
1231
|
[{ type: "text", text: writtenItem.before.content }],
|
|
1160
1232
|
{},
|
|
1161
1233
|
);
|
|
@@ -1212,6 +1284,7 @@ async function prepareTextResource(
|
|
|
1212
1284
|
source: string,
|
|
1213
1285
|
read: boolean,
|
|
1214
1286
|
allowReadFailure: boolean,
|
|
1287
|
+
requireWrite: boolean,
|
|
1215
1288
|
context: ResourceResolverContext,
|
|
1216
1289
|
resolvers: readonly RegisteredResolver[],
|
|
1217
1290
|
): Promise<PreparedTextResource | { readonly failure: TextResourceEditFailure }> {
|
|
@@ -1260,7 +1333,10 @@ async function prepareTextResource(
|
|
|
1260
1333
|
};
|
|
1261
1334
|
}
|
|
1262
1335
|
|
|
1263
|
-
if (
|
|
1336
|
+
if (
|
|
1337
|
+
(requireWrite && attempt.resource.write === undefined) ||
|
|
1338
|
+
(read && attempt.resource.read === undefined)
|
|
1339
|
+
) {
|
|
1264
1340
|
return {
|
|
1265
1341
|
failure: {
|
|
1266
1342
|
code: "UNSUPPORTED_CAPABILITY",
|
|
@@ -1352,7 +1428,13 @@ interface FinalizeTextResourceRequest<Result> {
|
|
|
1352
1428
|
async function finalizeTextResource<Result>(
|
|
1353
1429
|
request: FinalizeTextResourceRequest<Result>,
|
|
1354
1430
|
): Promise<Exclude<TextResourceEditOutcome<Result>, { readonly kind: "failed" }>> {
|
|
1355
|
-
|
|
1431
|
+
const skipPostEdit = request.resource.skipPostEdit === true;
|
|
1432
|
+
if (
|
|
1433
|
+
!skipPostEdit &&
|
|
1434
|
+
request.postProcessingFinal &&
|
|
1435
|
+
!request.context.signal?.aborted &&
|
|
1436
|
+
request.resource.read
|
|
1437
|
+
) {
|
|
1356
1438
|
const current = await request.resource.read(
|
|
1357
1439
|
request.context.signal ? { signal: request.context.signal } : {},
|
|
1358
1440
|
);
|
|
@@ -1368,6 +1450,7 @@ async function finalizeTextResource<Result>(
|
|
|
1368
1450
|
);
|
|
1369
1451
|
}
|
|
1370
1452
|
const deferred =
|
|
1453
|
+
!skipPostEdit &&
|
|
1371
1454
|
!request.postProcessingFinal &&
|
|
1372
1455
|
deferPostEdit(request.resource.source, () =>
|
|
1373
1456
|
finalizeTextResource({ ...request, postProcessingFinal: true }),
|
|
@@ -1386,7 +1469,7 @@ async function finalizeTextResource<Result>(
|
|
|
1386
1469
|
? [{ id: "post-edit-scope", data: { formatting: { status: "deferred" } } }]
|
|
1387
1470
|
: [];
|
|
1388
1471
|
|
|
1389
|
-
for (const registration of deferred || request.context.signal?.aborted
|
|
1472
|
+
for (const registration of skipPostEdit || deferred || request.context.signal?.aborted
|
|
1390
1473
|
? []
|
|
1391
1474
|
: request.postEditHandlers) {
|
|
1392
1475
|
try {
|
|
@@ -1402,7 +1485,7 @@ async function finalizeTextResource<Result>(
|
|
|
1402
1485
|
|
|
1403
1486
|
let finalText = request.requestedText;
|
|
1404
1487
|
|
|
1405
|
-
if (request.resource.read !== undefined) {
|
|
1488
|
+
if (!skipPostEdit && request.resource.read !== undefined) {
|
|
1406
1489
|
try {
|
|
1407
1490
|
const reread = await request.resource.read(
|
|
1408
1491
|
request.context.signal === undefined ? {} : { signal: request.context.signal },
|
|
@@ -1431,7 +1514,20 @@ async function finalizeTextResource<Result>(
|
|
|
1431
1514
|
|
|
1432
1515
|
for (const listener of request.editCompletionListeners) {
|
|
1433
1516
|
try {
|
|
1434
|
-
await listener(completion);
|
|
1517
|
+
const feedback = await listener(completion);
|
|
1518
|
+
if (feedback !== undefined && feedback.feedback.trim().length > 0) {
|
|
1519
|
+
postEditContributions.push({
|
|
1520
|
+
id: "after-edit",
|
|
1521
|
+
data: {
|
|
1522
|
+
diffStatuses: [
|
|
1523
|
+
{
|
|
1524
|
+
text: feedback.feedback,
|
|
1525
|
+
tone: feedback.tone === "info" ? "muted" : feedback.tone,
|
|
1526
|
+
},
|
|
1527
|
+
],
|
|
1528
|
+
},
|
|
1529
|
+
});
|
|
1530
|
+
}
|
|
1435
1531
|
} catch {
|
|
1436
1532
|
// Completion observers cannot turn a successful write into a failure.
|
|
1437
1533
|
}
|
|
@@ -1763,12 +1859,14 @@ function createPluginContributionController(
|
|
|
1763
1859
|
onDidEdit: (listener: TextEditCompletionListener) => () => void,
|
|
1764
1860
|
previewMutation: (request: TextMutationPreviewRequest) => Promise<TextMutationPreviewOutcome>,
|
|
1765
1861
|
recoveryConfig: (section: string) => TextEditorRecoveryConfigSection,
|
|
1862
|
+
restoreApplyUndo: TextEditorPluginApi["restoreApplyUndo"],
|
|
1766
1863
|
): PluginContributionController {
|
|
1767
1864
|
const setupDraft: PluginContributionDraft = {
|
|
1768
1865
|
resolvers: [],
|
|
1769
1866
|
anchorResolvers: [],
|
|
1770
1867
|
presenters: [],
|
|
1771
1868
|
handlers: [],
|
|
1869
|
+
semanticHandlers: [],
|
|
1772
1870
|
promptContributions: [],
|
|
1773
1871
|
writablePromptContributions: [],
|
|
1774
1872
|
tools: [],
|
|
@@ -1786,6 +1884,30 @@ function createPluginContributionController(
|
|
|
1786
1884
|
}
|
|
1787
1885
|
};
|
|
1788
1886
|
const createToolApi = (tool: TextEditorToolId): TextEditorToolPluginApi => ({
|
|
1887
|
+
addSemanticHandler(handler): void {
|
|
1888
|
+
assertAvailable();
|
|
1889
|
+
if (typeof handler.matches !== "function" || typeof handler.execute !== "function") {
|
|
1890
|
+
throw new TypeError(`Plugin ${pluginId} provided an invalid semantic handler for ${tool}`);
|
|
1891
|
+
}
|
|
1892
|
+
const contribution: RegisteredSemanticHandler = { pluginId, handler, tool };
|
|
1893
|
+
if (state === "setup") {
|
|
1894
|
+
const existing = requiredValue(setupDraft.semanticHandlers);
|
|
1895
|
+
if (existing.some((item) => item.pluginId === pluginId && item.tool === tool)) {
|
|
1896
|
+
throw new Error(`Plugin ${pluginId} already provides a semantic handler for ${tool}`);
|
|
1897
|
+
}
|
|
1898
|
+
existing.push(contribution);
|
|
1899
|
+
return;
|
|
1900
|
+
}
|
|
1901
|
+
registerContributions({
|
|
1902
|
+
resolvers: [],
|
|
1903
|
+
anchorResolvers: [],
|
|
1904
|
+
handlers: [],
|
|
1905
|
+
semanticHandlers: [contribution],
|
|
1906
|
+
promptContributions: [],
|
|
1907
|
+
writablePromptContributions: [],
|
|
1908
|
+
tools: [],
|
|
1909
|
+
});
|
|
1910
|
+
},
|
|
1789
1911
|
addHandler(registration): void {
|
|
1790
1912
|
assertAvailable();
|
|
1791
1913
|
|
|
@@ -1835,6 +1957,7 @@ function createPluginContributionController(
|
|
|
1835
1957
|
},
|
|
1836
1958
|
});
|
|
1837
1959
|
const api: TextEditorPluginApi = {
|
|
1960
|
+
restoreApplyUndo,
|
|
1838
1961
|
addMutationTool(registration): void {
|
|
1839
1962
|
assertAvailable();
|
|
1840
1963
|
assertTextMutationToolRegistration(registration);
|
|
@@ -2105,6 +2228,7 @@ function validateContributionDraft(
|
|
|
2105
2228
|
draft: PluginContributionDraft,
|
|
2106
2229
|
registeredResolvers: readonly RegisteredResolver[],
|
|
2107
2230
|
registeredHandlers: readonly RegisteredHandler[],
|
|
2231
|
+
semanticHandlers: readonly RegisteredSemanticHandler[],
|
|
2108
2232
|
registeredPromptContributions: readonly PromptContribution[],
|
|
2109
2233
|
registeredWritablePromptContributions: readonly WritablePromptContribution[],
|
|
2110
2234
|
): void {
|
|
@@ -2124,6 +2248,24 @@ function validateContributionDraft(
|
|
|
2124
2248
|
resolverIds.add(resolverId);
|
|
2125
2249
|
}
|
|
2126
2250
|
|
|
2251
|
+
const semanticKeys = new Set(
|
|
2252
|
+
semanticHandlers.map((handler) => `${handler.pluginId}\0${handler.tool}`),
|
|
2253
|
+
);
|
|
2254
|
+
for (const handler of draft.semanticHandlers ?? []) {
|
|
2255
|
+
if (
|
|
2256
|
+
typeof handler.handler.matches !== "function" ||
|
|
2257
|
+
typeof handler.handler.execute !== "function"
|
|
2258
|
+
) {
|
|
2259
|
+
throw new TypeError(`Plugin ${handler.pluginId} provided an invalid semantic handler`);
|
|
2260
|
+
}
|
|
2261
|
+
const key = `${handler.pluginId}\0${handler.tool}`;
|
|
2262
|
+
if (semanticKeys.has(key)) {
|
|
2263
|
+
throw new Error(
|
|
2264
|
+
`Plugin ${handler.pluginId} already provides a semantic handler for ${handler.tool}`,
|
|
2265
|
+
);
|
|
2266
|
+
}
|
|
2267
|
+
semanticKeys.add(key);
|
|
2268
|
+
}
|
|
2127
2269
|
const handlerKeys = new Set(registeredHandlers.map(handlerKey));
|
|
2128
2270
|
|
|
2129
2271
|
for (const handler of draft.handlers) {
|
|
@@ -2296,11 +2438,41 @@ function mergeToolRenderer(
|
|
|
2296
2438
|
current: TextEditorToolRendererRegistration | undefined,
|
|
2297
2439
|
registration: TextEditorToolRendererRegistration,
|
|
2298
2440
|
): TextEditorToolRendererRegistration {
|
|
2441
|
+
if (registration.matches !== undefined) {
|
|
2442
|
+
const renderCall = registration.renderCall;
|
|
2443
|
+
const renderResult = registration.renderResult;
|
|
2444
|
+
const currentRenderCall = current?.renderCall;
|
|
2445
|
+
const currentRenderResult = current?.renderResult;
|
|
2446
|
+
return {
|
|
2447
|
+
...current,
|
|
2448
|
+
tool: registration.tool,
|
|
2449
|
+
...(renderCall === undefined
|
|
2450
|
+
? {}
|
|
2451
|
+
: currentRenderCall === undefined
|
|
2452
|
+
? { renderCall }
|
|
2453
|
+
: {
|
|
2454
|
+
renderCall: (...arguments_: Parameters<typeof renderCall>) =>
|
|
2455
|
+
registration.matches?.(arguments_[0], "call") === true
|
|
2456
|
+
? renderCall(...arguments_)
|
|
2457
|
+
: currentRenderCall(...arguments_),
|
|
2458
|
+
}),
|
|
2459
|
+
...(renderResult === undefined
|
|
2460
|
+
? {}
|
|
2461
|
+
: currentRenderResult === undefined
|
|
2462
|
+
? { renderResult }
|
|
2463
|
+
: {
|
|
2464
|
+
renderResult: (...arguments_: Parameters<typeof renderResult>) =>
|
|
2465
|
+
registration.matches?.(arguments_[0], "result") === true
|
|
2466
|
+
? renderResult(...arguments_)
|
|
2467
|
+
: currentRenderResult(...arguments_),
|
|
2468
|
+
}),
|
|
2469
|
+
};
|
|
2470
|
+
}
|
|
2299
2471
|
const merged =
|
|
2300
2472
|
registration.fallback === true
|
|
2301
2473
|
? { ...registration, ...current, tool: registration.tool }
|
|
2302
2474
|
: { ...current, ...registration, tool: registration.tool };
|
|
2303
|
-
const { fallback: _fallback, ...renderer } = merged;
|
|
2475
|
+
const { fallback: _fallback, matches: _matches, ...renderer } = merged;
|
|
2304
2476
|
return renderer;
|
|
2305
2477
|
}
|
|
2306
2478
|
|
|
@@ -75,6 +75,7 @@ import { TextSelectionAnchor } from "#src/api/text-selection-anchor.js";
|
|
|
75
75
|
import type { ToolCallAnchorRenderState } from "pi-agent-tool-call-interception";
|
|
76
76
|
import type { Static, TSchema } from "typebox";
|
|
77
77
|
import type { ScriptMutationOutcome } from "#src/core/apply/mutation-outcome.js";
|
|
78
|
+
import { executeWholeFileTool, isWholeFileInvocation } from "#src/core/file-operation-tools.js";
|
|
78
79
|
|
|
79
80
|
export function createTextTool<TParameters extends TSchema>(
|
|
80
81
|
core: TextEditorCore,
|
|
@@ -84,6 +85,8 @@ export function createTextTool<TParameters extends TSchema>(
|
|
|
84
85
|
getLastResolvedSource: () => string | undefined,
|
|
85
86
|
): ToolDefinition<TParameters, FileMutationBatchResult> {
|
|
86
87
|
const renderer = core.getToolRenderer(definition.name);
|
|
88
|
+
const initialRenderCall = renderer?.renderCall;
|
|
89
|
+
const initialRenderResult = renderer?.renderResult;
|
|
87
90
|
|
|
88
91
|
const tool = withToolCallInterceptionRendering<TParameters, FileMutationBatchResult, unknown>(
|
|
89
92
|
defineTool<TParameters, FileMutationBatchResult, unknown>({
|
|
@@ -103,16 +106,55 @@ export function createTextTool<TParameters extends TSchema>(
|
|
|
103
106
|
definition.source.inherited ? definition.source.field : undefined,
|
|
104
107
|
getLastResolvedSource(),
|
|
105
108
|
definition.anchors ?? [],
|
|
109
|
+
definition.wholeFileOperation !== undefined,
|
|
106
110
|
),
|
|
107
111
|
...(renderer?.renderShell !== undefined && { renderShell: renderer.renderShell }),
|
|
108
|
-
...(
|
|
109
|
-
|
|
112
|
+
...(initialRenderCall !== undefined && {
|
|
113
|
+
renderCall: (...arguments_: Parameters<typeof initialRenderCall>) =>
|
|
114
|
+
(core.getToolRenderer(definition.name)?.renderCall ?? initialRenderCall)(...arguments_),
|
|
115
|
+
}),
|
|
116
|
+
...(initialRenderResult !== undefined && {
|
|
117
|
+
renderResult: (...arguments_: Parameters<typeof initialRenderResult>) =>
|
|
118
|
+
(core.getToolRenderer(definition.name)?.renderResult ?? initialRenderResult)(
|
|
119
|
+
...arguments_,
|
|
120
|
+
),
|
|
121
|
+
}),
|
|
110
122
|
async execute(toolCallId, parameters, signal, onUpdate, context) {
|
|
123
|
+
const input = asMutationParameters<TParameters>(parameters);
|
|
124
|
+
if (definition.direct?.matches(input) === true) {
|
|
125
|
+
try {
|
|
126
|
+
const action = await definition.direct.execute(
|
|
127
|
+
{ cwd: context.cwd, ...(signal !== undefined && { signal }) },
|
|
128
|
+
input,
|
|
129
|
+
);
|
|
130
|
+
return {
|
|
131
|
+
content: [{ type: "text", text: action.summary }],
|
|
132
|
+
details: {
|
|
133
|
+
results: [],
|
|
134
|
+
metadata: { semanticAction: { ...action.data, source: action.source } },
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
} catch (error) {
|
|
138
|
+
const code =
|
|
139
|
+
error !== null && typeof error === "object" && "code" in error
|
|
140
|
+
? String(error.code)
|
|
141
|
+
: "DIRECT_MUTATION_FAILED";
|
|
142
|
+
return failureToolResult(
|
|
143
|
+
"transaction" in input ? String(input.transaction) : "",
|
|
144
|
+
code,
|
|
145
|
+
error instanceof Error ? error.message : String(error),
|
|
146
|
+
"not-applied",
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (isWholeFileInvocation(definition.wholeFileOperation, input)) {
|
|
151
|
+
return executeWholeFileTool(core, definition.wholeFileOperation, input, signal, context);
|
|
152
|
+
}
|
|
111
153
|
const directExecute = () =>
|
|
112
154
|
executeTextMutation(
|
|
113
155
|
core,
|
|
114
156
|
definition,
|
|
115
|
-
|
|
157
|
+
input,
|
|
116
158
|
signal,
|
|
117
159
|
context,
|
|
118
160
|
(field, state) =>
|
|
@@ -132,7 +174,9 @@ export function createTextTool<TParameters extends TSchema>(
|
|
|
132
174
|
return [
|
|
133
175
|
definition.description,
|
|
134
176
|
definition.source.inherited
|
|
135
|
-
?
|
|
177
|
+
? definition.wholeFileOperation === undefined
|
|
178
|
+
? `When ${definition.source.field} is omitted, the tool can reuse the file identified by the supplied anchor, the last read, or the preceding edit in the same batch.`
|
|
179
|
+
: `When ${definition.source.field} is omitted, the tool can reuse the file identified by a supplied text anchor.`
|
|
136
180
|
: "",
|
|
137
181
|
pluginPromptGuideline() ?? "",
|
|
138
182
|
]
|
|
@@ -149,6 +193,7 @@ function prepareGuardedArguments<TParameters extends TSchema>(
|
|
|
149
193
|
sourceField: string | undefined,
|
|
150
194
|
lastResolvedSource: string | undefined,
|
|
151
195
|
anchorFields: NonNullable<TextMutationToolRegistration["anchors"]>,
|
|
196
|
+
hasWholeFileMode: boolean,
|
|
152
197
|
): ReturnType<
|
|
153
198
|
NonNullable<ToolDefinition<TParameters, FileMutationBatchResult>["prepareArguments"]>
|
|
154
199
|
> {
|
|
@@ -167,7 +212,8 @@ function prepareGuardedArguments<TParameters extends TSchema>(
|
|
|
167
212
|
sourceField !== undefined &&
|
|
168
213
|
!(sourceField in prepared) &&
|
|
169
214
|
lastResolvedSource !== undefined &&
|
|
170
|
-
!hasExplicitAnchor
|
|
215
|
+
!hasExplicitAnchor &&
|
|
216
|
+
!hasWholeFileMode
|
|
171
217
|
) {
|
|
172
218
|
prepared[sourceField] = lastResolvedSource;
|
|
173
219
|
}
|
|
@@ -686,11 +732,14 @@ export async function previewTextMutation(
|
|
|
686
732
|
|
|
687
733
|
try {
|
|
688
734
|
const sources = await resolveMutationSources(core, definition, request.input, request);
|
|
735
|
+
const semanticHandler = core.getSemanticMutationHandler(definition.name, request.input);
|
|
689
736
|
return await core.previewTexts(
|
|
690
737
|
sources.resources.map((source) => ({
|
|
691
738
|
source,
|
|
692
739
|
read: true,
|
|
693
|
-
...(
|
|
740
|
+
...(semanticHandler === undefined
|
|
741
|
+
? definition.name === "write" && { allowReadFailure: true }
|
|
742
|
+
: { requireWrite: false }),
|
|
694
743
|
})),
|
|
695
744
|
{ cwd: request.cwd, ...(request.signal !== undefined && { signal: request.signal }) },
|
|
696
745
|
async (texts, resolveAnchor) => {
|
|
@@ -703,6 +752,9 @@ export async function previewTextMutation(
|
|
|
703
752
|
resolveAnchor,
|
|
704
753
|
);
|
|
705
754
|
await preflightMutationAnchors(definition, request.input, mutationContext);
|
|
755
|
+
if (semanticHandler !== undefined) {
|
|
756
|
+
return { changes: new Map(), result: { edits: new Map() } };
|
|
757
|
+
}
|
|
706
758
|
const mutation = await definition.mutate(mutationContext, request.input);
|
|
707
759
|
|
|
708
760
|
return {
|
|
@@ -814,6 +866,52 @@ export async function executeTextMutationPipeline<TParameters extends TSchema>(
|
|
|
814
866
|
state,
|
|
815
867
|
lastResolvedSource,
|
|
816
868
|
);
|
|
869
|
+
const semanticHandler = core.getSemanticMutationHandler(definition.name, state.input);
|
|
870
|
+
if (semanticHandler !== undefined) {
|
|
871
|
+
return await core.editTexts(
|
|
872
|
+
sources.resources.map((resourceSource) => ({
|
|
873
|
+
source: resourceSource,
|
|
874
|
+
read: true,
|
|
875
|
+
requireWrite: false,
|
|
876
|
+
})),
|
|
877
|
+
{
|
|
878
|
+
cwd: state.cwd,
|
|
879
|
+
intent: definition.intent ?? "edit",
|
|
880
|
+
...(state.signal !== undefined && { signal: state.signal }),
|
|
881
|
+
},
|
|
882
|
+
async (texts, resolveAnchor) => {
|
|
883
|
+
for (const target of sources.targets) {
|
|
884
|
+
if (
|
|
885
|
+
target.expectedContent !== undefined &&
|
|
886
|
+
texts.get(target.source) !== target.expectedContent
|
|
887
|
+
) {
|
|
888
|
+
throw new Error(
|
|
889
|
+
"The selected source changed before the semantic action. Resolve it again.",
|
|
890
|
+
);
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
const mutationContext = createMutationContext(
|
|
894
|
+
definition,
|
|
895
|
+
state.input,
|
|
896
|
+
state,
|
|
897
|
+
sources,
|
|
898
|
+
texts,
|
|
899
|
+
resolveAnchor,
|
|
900
|
+
publishAnchorRenderState,
|
|
901
|
+
);
|
|
902
|
+
await preflightMutationAnchors(definition, state.input, mutationContext);
|
|
903
|
+
const semanticAction = await semanticHandler.execute(mutationContext, state.input);
|
|
904
|
+
return {
|
|
905
|
+
changes: new Map(),
|
|
906
|
+
result: withResultPresentations(
|
|
907
|
+
{ edits: new Map(), semanticAction },
|
|
908
|
+
mutationContext,
|
|
909
|
+
),
|
|
910
|
+
resourceEffect: true,
|
|
911
|
+
};
|
|
912
|
+
},
|
|
913
|
+
);
|
|
914
|
+
}
|
|
817
915
|
const outcome = await core.editTexts(
|
|
818
916
|
sources.resources.map((resourceSource) => ({
|
|
819
917
|
source: resourceSource,
|
|
@@ -905,6 +1003,7 @@ export async function executeScriptMutation<TParameters extends TSchema>(
|
|
|
905
1003
|
definition.source.inherited ? definition.source.field : undefined,
|
|
906
1004
|
lastResolvedSource,
|
|
907
1005
|
definition.anchors ?? [],
|
|
1006
|
+
definition.wholeFileOperation !== undefined,
|
|
908
1007
|
);
|
|
909
1008
|
if (!Value.Check(definition.parameters, parameters)) {
|
|
910
1009
|
throw Object.assign(new Error(`Invalid arguments for ${definition.name}`), {
|
|
@@ -968,6 +1067,22 @@ export async function executeScriptMutation<TParameters extends TSchema>(
|
|
|
968
1067
|
recoveries: await scriptAnchorRecoveries(outcome.failure.cause),
|
|
969
1068
|
};
|
|
970
1069
|
const mutation = outcome.result as ExecutedTextMutation;
|
|
1070
|
+
if (mutation.semanticAction !== undefined) {
|
|
1071
|
+
return {
|
|
1072
|
+
operation: definition.name,
|
|
1073
|
+
ok: true,
|
|
1074
|
+
effect: "applied",
|
|
1075
|
+
files: [],
|
|
1076
|
+
completed: [mutation.semanticAction.source],
|
|
1077
|
+
metadata: {
|
|
1078
|
+
semanticAction: {
|
|
1079
|
+
...mutation.semanticAction.data,
|
|
1080
|
+
source: mutation.semanticAction.source,
|
|
1081
|
+
},
|
|
1082
|
+
},
|
|
1083
|
+
errors: [],
|
|
1084
|
+
};
|
|
1085
|
+
}
|
|
971
1086
|
const files = outcome.resources.flatMap((resource) => {
|
|
972
1087
|
const edit = mutation.edits.get(resource.source);
|
|
973
1088
|
if (edit === undefined) return [];
|
|
@@ -1165,6 +1280,20 @@ async function buildToolResult(
|
|
|
1165
1280
|
}
|
|
1166
1281
|
|
|
1167
1282
|
const mutation = outcome.result as ExecutedTextMutation;
|
|
1283
|
+
if (mutation.semanticAction !== undefined) {
|
|
1284
|
+
return {
|
|
1285
|
+
content: [{ type: "text", text: mutation.semanticAction.summary }],
|
|
1286
|
+
details: {
|
|
1287
|
+
results: [],
|
|
1288
|
+
metadata: {
|
|
1289
|
+
semanticAction: {
|
|
1290
|
+
...mutation.semanticAction.data,
|
|
1291
|
+
source: mutation.semanticAction.source,
|
|
1292
|
+
},
|
|
1293
|
+
},
|
|
1294
|
+
},
|
|
1295
|
+
};
|
|
1296
|
+
}
|
|
1168
1297
|
const results = outcome.resources.flatMap((resource) => {
|
|
1169
1298
|
const resultSource = resource.source;
|
|
1170
1299
|
const edit = mutation.edits.get(resultSource);
|