pi-agent-ide 0.7.1 → 0.7.3
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 +66 -0
- package/README.md +3 -1
- package/dist/{chunk-PKKDDIWW.js → chunk-2ZMMRINH.js} +1 -1
- package/dist/chunk-6U5OU77O.js +3 -0
- package/dist/chunk-BYZSBXUK.js +2 -0
- package/dist/{chunk-LEEQIQ7D.js → chunk-CEX73RI5.js} +6 -6
- package/dist/chunk-DZWTKF2K.js +1 -0
- package/dist/{chunk-WMO6RNE2.js → chunk-EOKEQ3YH.js} +6 -6
- package/dist/{chunk-HZEY4GT4.js → chunk-H445SHSJ.js} +2 -2
- package/dist/{chunk-4GCWGE2C.js → chunk-HZ5BNF3A.js} +1 -1
- 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-MXLSGMRZ.js +3 -0
- package/dist/{chunk-76ZK5ODR.js → chunk-NHKPP2AI.js} +13 -13
- package/dist/chunk-OB46OPMZ.js +1 -0
- package/dist/{chunk-PNU3E7IO.js → chunk-Q6CZ6GBR.js} +2 -2
- package/dist/chunk-QUYXINGZ.js +7 -0
- package/dist/{chunk-OMVRLWMX.js → chunk-SBP3ABH4.js} +1 -1
- package/dist/{chunk-YP46DVVP.js → chunk-STBJO3Z3.js} +1 -1
- package/dist/{chunk-2TRHFMCZ.js → chunk-TXOTNK6B.js} +1 -1
- package/dist/chunk-WLZIUMJL.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 +1 -1
- package/dist/entry-26.js +1 -1
- package/dist/entry-27.js +1 -1
- package/dist/entry-28.js +1 -1
- package/dist/entry-29.js +1 -1
- package/dist/entry-31.js +12 -11
- package/dist/entry-33.js +3 -1
- package/dist/entry-37.js +6 -6
- package/dist/entry-42.js +1 -1
- package/dist/entry-44.js +1 -1
- package/dist/entry-45.js +20 -12
- 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 +7 -6
- 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-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 +63 -49
- package/dist/entry-78.js +15 -14
- package/dist/entry-79.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 +34 -11
- package/docs/agent-guides/editing.md +14 -7
- package/docs/agent-guides/git-changes.md +10 -0
- package/docs/agent-guides/read-resources.md +9 -46
- package/docs/agent-guides/search-code.md +7 -1
- package/docs/agent-guides/select-code.md +1 -0
- package/docs/agent-guides/terminal.md +9 -1
- package/docs/configuration.md +22 -1
- package/docs/development.md +4 -0
- package/docs/directory-operations.md +45 -0
- package/docs/releases.md +12 -0
- package/docs/research/codemode-write-context.md +56 -0
- package/docs/research/native-codemode-batch-decision.md +2 -0
- package/docs/structured-results.md +2 -2
- package/docs/tools.md +10 -2
- package/docs/user-hooks.md +26 -0
- 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/package.json +7 -7
- package/node_modules/pi-agent-filesystem-image/package.json +3 -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 +3 -3
- package/node_modules/pi-agent-ide-ast/src/overflow-handler.ts +9 -4
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +0 -3
- package/node_modules/pi-agent-ide-ast/src/select-schema.ts +8 -6
- package/node_modules/pi-agent-ide-ast/src/tool-select.ts +13 -5
- package/node_modules/pi-agent-ide-changes/package.json +9 -8
- package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +82 -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 +1 -1
- package/node_modules/pi-agent-ide-lsp/package.json +9 -9
- package/node_modules/pi-agent-ide-lsp/src/declaration-targets.ts +2 -1
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +0 -1
- 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/read-parameters.ts +3 -3
- package/node_modules/pi-agent-read/src/api/tools/read.ts +11 -0
- package/node_modules/pi-agent-read/src/core/extension.ts +1 -1
- package/node_modules/pi-agent-read/src/core/read-core.ts +5 -1
- 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/tool-read.ts +99 -44
- 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 +6 -3
- 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-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 +2 -2
- 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/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/package.json +3 -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/delete-guard.ts +24 -0
- package/node_modules/pi-agent-text-editor/src/api/edit-completion.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/api/mutation-guard.ts +1 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +1 -2
- 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/plugin-protocol.ts +4 -1
- package/node_modules/pi-agent-text-editor/src/api/stale-anchor-message.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/delete-policy.ts +284 -0
- 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/file-operation-tools.ts +32 -3
- package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +30 -40
- package/node_modules/pi-agent-text-editor/src/core/file-result-targets.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/file-transfers.ts +164 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +36 -12
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +25 -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 +286 -162
- 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 +46 -11
- package/node_modules/pi-agent-text-editor/src/core/structured-result.ts +21 -14
- package/node_modules/pi-agent-text-editor/src/core/temporary-directories.ts +96 -0
- 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 +155 -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 +126 -32
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +428 -189
- package/node_modules/pi-agent-text-editor/src/core/write-agent-result.ts +66 -0
- package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +6 -4
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +15 -6
- 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 +6 -4
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +2 -3
- 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 +75 -11
- 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-ui/package.json +1 -1
- 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 +36 -35
- package/src/api/hooks.ts +24 -0
- package/src/composite/nested-tool-rendering.ts +184 -77
- package/src/composite/output-limits.ts +125 -0
- package/src/composite/responses-tools.ts +25 -0
- package/src/composite/text-results.ts +158 -7
- 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/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/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/read-parameters.ts +3 -3
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +11 -0
- package/src/extensions/pi-agent-read/src/core/extension.ts +1 -1
- package/src/extensions/pi-agent-read/src/core/read-core.ts +5 -1
- 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/tool-read.ts +99 -44
- package/src/extensions/pi-agent-search/package.json +5 -5
- 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 +2 -2
- 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/package.json +3 -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 +75 -11
- 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/delete-guard.ts +24 -0
- package/src/extensions/pi-agent-text-editor/src/api/edit-completion.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/api/mutation-guard.ts +1 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +1 -2
- 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/plugin-protocol.ts +4 -1
- package/src/extensions/pi-agent-text-editor/src/api/stale-anchor-message.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/delete-policy.ts +284 -0
- 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/file-operation-tools.ts +32 -3
- package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +30 -40
- package/src/extensions/pi-agent-text-editor/src/core/file-result-targets.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/file-transfers.ts +164 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +36 -12
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +25 -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 +286 -162
- 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 +46 -11
- package/src/extensions/pi-agent-text-editor/src/core/structured-result.ts +21 -14
- package/src/extensions/pi-agent-text-editor/src/core/temporary-directories.ts +96 -0
- 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 +155 -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 +126 -32
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +428 -189
- package/src/extensions/pi-agent-text-editor/src/core/write-agent-result.ts +66 -0
- package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +6 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +15 -6
- 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 +6 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +2 -3
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +10 -4
- package/src/pi-agent-ide.ts +11 -0
- package/src/plugins/pi-agent-ide-ast/package.json +13 -13
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +3 -3
- package/src/plugins/pi-agent-ide-ast/src/overflow-handler.ts +9 -4
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +0 -3
- package/src/plugins/pi-agent-ide-ast/src/select-schema.ts +8 -6
- package/src/plugins/pi-agent-ide-ast/src/tool-select.ts +13 -5
- package/src/plugins/pi-agent-ide-changes/package.json +9 -8
- package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +82 -4
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +8 -11
- package/src/plugins/pi-agent-ide-debugger/index.ts +20 -8
- 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 +3 -2
- 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 +1 -1
- package/src/plugins/pi-agent-ide-lsp/package.json +9 -9
- package/src/plugins/pi-agent-ide-lsp/src/declaration-targets.ts +2 -1
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +0 -1
- package/src/plugins/pi-agent-ide-terminal/src/output-limits.ts +3 -3
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +3 -3
- package/src/plugins/pi-agent-ide-vision/index.ts +1 -0
- package/src/post-edit/gate.ts +13 -2
- package/dist/chunk-4XMY4H4V.js +0 -1
- package/dist/chunk-64M3SQPG.js +0 -3
- package/dist/chunk-CWD4O5PM.js +0 -3
- package/dist/chunk-D3WTDA6V.js +0 -2
- package/dist/chunk-EAZGN5ND.js +0 -7
- package/dist/chunk-GXEGY7GV.js +0 -1
- package/dist/chunk-MBUXFKIW.js +0 -3
- package/dist/chunk-PGIVHICI.js +0 -1
- package/dist/chunk-VMTR74FF.js +0 -2
- package/dist/chunk-WU6ZK6YD.js +0 -1
- package/src/extensions/pi-agent-read/src/core/tools/read/temp-resource-store.ts +0 -105
|
@@ -254,18 +254,27 @@ export function createSearchCore(): SearchCore {
|
|
|
254
254
|
const missingAdapter = data === undefined;
|
|
255
255
|
return withStructuredResult(
|
|
256
256
|
{
|
|
257
|
-
content:
|
|
258
|
-
entry.registration.fallback && protocolLike
|
|
257
|
+
content: [
|
|
258
|
+
...(entry.registration.fallback && protocolLike
|
|
259
259
|
? [
|
|
260
260
|
{
|
|
261
|
-
type: "text",
|
|
261
|
+
type: "text" as const,
|
|
262
262
|
text: emptyProtocol
|
|
263
263
|
? "Search fallback: empty protocol query; searched the original text."
|
|
264
264
|
: "Search fallback: unhandled protocol query; searched the original text.",
|
|
265
265
|
},
|
|
266
266
|
...formatted.content,
|
|
267
267
|
]
|
|
268
|
-
: formatted.content,
|
|
268
|
+
: formatted.content),
|
|
269
|
+
...(isRecord(data) && data.complete === false
|
|
270
|
+
? [
|
|
271
|
+
{
|
|
272
|
+
type: "text" as const,
|
|
273
|
+
text: "Search coverage is incomplete. Do not conclude absence or use this result as an edit scope.",
|
|
274
|
+
},
|
|
275
|
+
]
|
|
276
|
+
: []),
|
|
277
|
+
],
|
|
269
278
|
details: { resolverId: resolver.id, payload: formatted.details },
|
|
270
279
|
...(audience === "script" && {
|
|
271
280
|
script: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-search-text",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"pi-agent-doctor": "0.7.
|
|
28
|
-
"pi-agent-invariant": "0.7.
|
|
29
|
-
"pi-agent-search": "0.7.
|
|
30
|
-
"pi-agent-text": "0.7.
|
|
31
|
-
"pi-agent-text-editor": "0.7.
|
|
32
|
-
"pi-agent-tool-ui": "0.7.
|
|
27
|
+
"pi-agent-doctor": "0.7.3",
|
|
28
|
+
"pi-agent-invariant": "0.7.3",
|
|
29
|
+
"pi-agent-search": "0.7.3",
|
|
30
|
+
"pi-agent-text": "0.7.3",
|
|
31
|
+
"pi-agent-text-editor": "0.7.3",
|
|
32
|
+
"pi-agent-tool-ui": "0.7.3"
|
|
33
33
|
},
|
|
34
34
|
"pi": {
|
|
35
35
|
"extensions": [
|
|
@@ -300,7 +300,7 @@ function formatSearchSession(
|
|
|
300
300
|
const heading = anchorsRegistered
|
|
301
301
|
? session.complete
|
|
302
302
|
? `SEARCH#${session.id}:all:line / SEARCH#${session.id}:all:match — ${summary}`
|
|
303
|
-
: `${summary} (
|
|
303
|
+
: `${summary} (incomplete results; no all anchors were registered)`
|
|
304
304
|
: `${summary} (files changed during search; results shown without anchors)`;
|
|
305
305
|
const lines = anchorsRegistered ? [SEARCH_ANCHOR_LEGEND, heading] : [heading];
|
|
306
306
|
const indices = new Map(session.matches.map((match, index) => [match, index + 1]));
|
|
@@ -340,6 +340,16 @@ function formatSearchSession(
|
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
|
|
343
|
+
const omittedFiles = fileCount - presentation.files.length;
|
|
344
|
+
if (omittedFiles > 0) {
|
|
345
|
+
const shownMatches = presentation.files.reduce(
|
|
346
|
+
(total, file) => total + (file.kind === "detailed" ? file.matches.length : file.matchCount),
|
|
347
|
+
0,
|
|
348
|
+
);
|
|
349
|
+
lines.push(
|
|
350
|
+
`\n… ${omittedFiles} more files (${count - shownMatches} matches) not displayed. Narrow path, include, or query to see them.`,
|
|
351
|
+
);
|
|
352
|
+
}
|
|
343
353
|
return lines.join("\n");
|
|
344
354
|
}
|
|
345
355
|
|
|
@@ -86,7 +86,7 @@ export async function runScopedSearch(
|
|
|
86
86
|
notices.push(
|
|
87
87
|
fallback.mode === "regex"
|
|
88
88
|
? "Search fallback: no literal matches; tried unquoted terms as regex."
|
|
89
|
-
: "Search fallback: no matches in earlier modes; tried separate words.",
|
|
89
|
+
: "Search fallback: no matches in earlier modes; tried separate words. Use these matches as location hints; refine the query before editing.",
|
|
90
90
|
);
|
|
91
91
|
} catch (error) {
|
|
92
92
|
if (
|
|
@@ -23,7 +23,7 @@ export interface SearchPresentation {
|
|
|
23
23
|
readonly files: readonly SearchPresentationFile[];
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
/**
|
|
26
|
+
/** Shares one item budget between complete small files, compact summaries and groups. */
|
|
27
27
|
export function planSearchPresentation(
|
|
28
28
|
matches: readonly TextSearchMatch[],
|
|
29
29
|
detailBudget: number,
|
|
@@ -36,45 +36,55 @@ export function planSearchPresentation(
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
const compacted = new Set<string>();
|
|
39
|
-
let
|
|
39
|
+
let itemCount = matches.length;
|
|
40
40
|
const noisiestFirst = [...bySource].sort(
|
|
41
41
|
([leftSource, left], [rightSource, right]) =>
|
|
42
42
|
right.length - left.length || leftSource.localeCompare(rightSource),
|
|
43
43
|
);
|
|
44
44
|
for (const [source, sourceMatches] of noisiestFirst) {
|
|
45
|
-
if (
|
|
45
|
+
if (itemCount <= detailBudget) break;
|
|
46
46
|
compacted.add(source);
|
|
47
|
-
|
|
47
|
+
itemCount -= sourceMatches.length - 1;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
const files = [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
50
|
+
const files: SearchPresentationFile[] = [];
|
|
51
|
+
let remaining = detailBudget;
|
|
52
|
+
// Keep complete small files before spending the remaining budget on noisy summaries.
|
|
53
|
+
const ordered = [...bySource].sort(
|
|
54
|
+
([left], [right]) =>
|
|
55
|
+
Number(compacted.has(left)) - Number(compacted.has(right)) || left.localeCompare(right),
|
|
56
|
+
);
|
|
57
|
+
for (const [source, sourceMatches] of ordered) {
|
|
58
|
+
if (!compacted.has(source)) {
|
|
59
|
+
if (sourceMatches.length > remaining) continue;
|
|
60
|
+
files.push({ kind: "detailed", source, matches: sourceMatches });
|
|
61
|
+
remaining -= sourceMatches.length;
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
if (remaining < 1) continue;
|
|
65
|
+
remaining--;
|
|
66
|
+
const counts = new Map<string, number>();
|
|
67
|
+
for (const match of sourceMatches)
|
|
68
|
+
counts.set(match.lineText, (counts.get(match.lineText) ?? 0) + 1);
|
|
69
|
+
const groups =
|
|
70
|
+
bySource.size === 1
|
|
71
|
+
? [...counts]
|
|
72
|
+
.sort(
|
|
73
|
+
([leftText, leftCount], [rightText, rightCount]) =>
|
|
74
|
+
rightCount - leftCount || leftText.localeCompare(rightText),
|
|
75
|
+
)
|
|
76
|
+
.slice(0, remaining)
|
|
77
|
+
.map(([text, matchCount]) => ({ text, matchCount }))
|
|
78
|
+
: [];
|
|
79
|
+
remaining -= groups.length;
|
|
80
|
+
files.push({
|
|
81
|
+
kind: "compacted",
|
|
82
|
+
source,
|
|
83
|
+
matchCount: sourceMatches.length,
|
|
84
|
+
uniqueLineCount: counts.size,
|
|
85
|
+
groups,
|
|
77
86
|
});
|
|
78
|
-
|
|
87
|
+
}
|
|
88
|
+
files.sort((left, right) => left.source.localeCompare(right.source));
|
|
79
89
|
return { files };
|
|
80
90
|
}
|
|
@@ -66,7 +66,7 @@ export async function runSearchRecipe(
|
|
|
66
66
|
notices.push(
|
|
67
67
|
fallback.mode === "regex"
|
|
68
68
|
? "Search fallback: no literal matches; tried unquoted terms as regex."
|
|
69
|
-
: "Search fallback: no matches in earlier modes; tried separate words.",
|
|
69
|
+
: "Search fallback: no matches in earlier modes; tried separate words. Use these matches as location hints; refine the query before editing.",
|
|
70
70
|
);
|
|
71
71
|
} catch (error) {
|
|
72
72
|
if (fallback.mode !== "regex" || !isRegexSyntaxError(error) || signal?.aborted) throw error;
|
|
@@ -146,6 +146,12 @@ function searchViewport(details: SearchToolDetails, expanded: boolean): readonly
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
+
if ((details.omittedFileCount ?? 0) > 0)
|
|
150
|
+
rows.push({
|
|
151
|
+
kind: "summary",
|
|
152
|
+
text: `… ${details.omittedFileCount} more files (${details.omittedMatchCount} matches) · narrow path, include, or query`,
|
|
153
|
+
});
|
|
154
|
+
|
|
149
155
|
if (details.fuzzy !== undefined || expanded || rows.length <= COMPACT_SEARCH_ROWS) {
|
|
150
156
|
return rows;
|
|
151
157
|
}
|
|
@@ -51,6 +51,9 @@ export interface SearchToolDetails {
|
|
|
51
51
|
readonly matchCount: number;
|
|
52
52
|
readonly fileCount: number;
|
|
53
53
|
readonly complete: boolean;
|
|
54
|
+
/** Files and matches retained internally but not shown within the item budget. */
|
|
55
|
+
readonly omittedFileCount?: number;
|
|
56
|
+
readonly omittedMatchCount?: number;
|
|
54
57
|
readonly files: readonly SearchResultFile[];
|
|
55
58
|
readonly fuzzy?: FuzzyResultData;
|
|
56
59
|
readonly fuzzyPresentation?: FuzzySearchPresentation;
|
|
@@ -71,6 +74,7 @@ export function createSearchToolDetails(
|
|
|
71
74
|
detailBudget = 50,
|
|
72
75
|
): SearchToolDetails {
|
|
73
76
|
const presentation = planSearchPresentation(matches, detailBudget);
|
|
77
|
+
const fileCount = new Set(matches.map((match) => match.source)).size;
|
|
74
78
|
const files = presentation.files.map((file): SearchResultFile =>
|
|
75
79
|
file.kind === "detailed"
|
|
76
80
|
? createSearchResultFile(file.source, file.matches, cwd)
|
|
@@ -88,7 +92,14 @@ export function createSearchToolDetails(
|
|
|
88
92
|
...(sessionId !== undefined && { sessionId }),
|
|
89
93
|
query,
|
|
90
94
|
matchCount: matches.length,
|
|
91
|
-
fileCount
|
|
95
|
+
fileCount,
|
|
96
|
+
...(presentation.files.length < fileCount
|
|
97
|
+
? {
|
|
98
|
+
omittedFileCount: fileCount - files.length,
|
|
99
|
+
omittedMatchCount:
|
|
100
|
+
matches.length - files.reduce((count, file) => count + file.matchCount, 0),
|
|
101
|
+
}
|
|
102
|
+
: {}),
|
|
92
103
|
complete,
|
|
93
104
|
files,
|
|
94
105
|
};
|
|
@@ -159,6 +170,8 @@ export function isSearchToolDetails(value: unknown): value is SearchToolDetails
|
|
|
159
170
|
typeof value.query !== "string" ||
|
|
160
171
|
!isCount(value.matchCount) ||
|
|
161
172
|
!isCount(value.fileCount) ||
|
|
173
|
+
(value.omittedFileCount !== undefined && !isCount(value.omittedFileCount)) ||
|
|
174
|
+
(value.omittedMatchCount !== undefined && !isCount(value.omittedMatchCount)) ||
|
|
162
175
|
typeof value.complete !== "boolean" ||
|
|
163
176
|
(value.sessionId !== undefined && typeof value.sessionId !== "string") ||
|
|
164
177
|
(value.fuzzy !== undefined && !isFuzzyResultData(value.fuzzy)) ||
|
|
@@ -171,8 +184,9 @@ export function isSearchToolDetails(value: unknown): value is SearchToolDetails
|
|
|
171
184
|
|
|
172
185
|
const files = value.files as readonly SearchResultFile[];
|
|
173
186
|
return (
|
|
174
|
-
value.fileCount === files.length &&
|
|
175
|
-
value.matchCount ===
|
|
187
|
+
value.fileCount === files.length + (value.omittedFileCount ?? 0) &&
|
|
188
|
+
value.matchCount ===
|
|
189
|
+
files.reduce((count, file) => count + file.matchCount, 0) + (value.omittedMatchCount ?? 0)
|
|
176
190
|
);
|
|
177
191
|
}
|
|
178
192
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./src/index.ts",
|
|
6
6
|
"imports": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"pi-agent-resource": "0.7.
|
|
16
|
+
"pi-agent-resource": "0.7.3"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"typebox": "*"
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-anchor-constant",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"pi-agent-text": "0.7.
|
|
10
|
-
"pi-agent-text-editor": "0.7.
|
|
9
|
+
"pi-agent-text": "0.7.3",
|
|
10
|
+
"pi-agent-text-editor": "0.7.3"
|
|
11
11
|
},
|
|
12
12
|
"pi": {
|
|
13
13
|
"extensions": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-anchor-exact",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"fast-fuzzy": "1.12.0",
|
|
16
|
-
"pi-agent-text": "0.7.
|
|
17
|
-
"pi-agent-text-editor": "0.7.
|
|
16
|
+
"pi-agent-text": "0.7.3",
|
|
17
|
+
"pi-agent-text-editor": "0.7.3"
|
|
18
18
|
},
|
|
19
19
|
"pi": {
|
|
20
20
|
"extensions": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-anchor-line-hash",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"pi-agent-invariant": "0.7.
|
|
16
|
-
"pi-agent-read": "0.7.
|
|
17
|
-
"pi-agent-text": "0.7.
|
|
18
|
-
"pi-agent-text-editor": "0.7.
|
|
15
|
+
"pi-agent-invariant": "0.7.3",
|
|
16
|
+
"pi-agent-read": "0.7.3",
|
|
17
|
+
"pi-agent-text": "0.7.3",
|
|
18
|
+
"pi-agent-text-editor": "0.7.3"
|
|
19
19
|
},
|
|
20
20
|
"pi": {
|
|
21
21
|
"extensions": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-editor",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -79,14 +79,14 @@
|
|
|
79
79
|
"fs-extra": "^11.4.0",
|
|
80
80
|
"oxfmt": "0.64.0",
|
|
81
81
|
"partial-json": "^0.1.7",
|
|
82
|
-
"pi-agent-documentation": "0.7.
|
|
83
|
-
"pi-agent-invariant": "0.7.
|
|
84
|
-
"pi-agent-read": "0.7.
|
|
85
|
-
"pi-agent-resource": "0.7.
|
|
86
|
-
"pi-agent-search": "0.7.
|
|
87
|
-
"pi-agent-text": "0.7.
|
|
88
|
-
"pi-agent-tool-call-interception": "0.7.
|
|
89
|
-
"pi-agent-tool-ui": "0.7.
|
|
82
|
+
"pi-agent-documentation": "0.7.3",
|
|
83
|
+
"pi-agent-invariant": "0.7.3",
|
|
84
|
+
"pi-agent-read": "0.7.3",
|
|
85
|
+
"pi-agent-resource": "0.7.3",
|
|
86
|
+
"pi-agent-search": "0.7.3",
|
|
87
|
+
"pi-agent-text": "0.7.3",
|
|
88
|
+
"pi-agent-tool-call-interception": "0.7.3",
|
|
89
|
+
"pi-agent-tool-ui": "0.7.3",
|
|
90
90
|
"typebox-guard": "npm:typebox@^1.1.38"
|
|
91
91
|
},
|
|
92
92
|
"pi": {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** A whole object removed from this path by Delete or directory/symlink Move, never a text selection. */
|
|
2
|
+
export interface BeforeDeleteEvent {
|
|
3
|
+
/** Absolute path supplied by the caller. */
|
|
4
|
+
readonly path: string;
|
|
5
|
+
/** Absolute identity with parent symlinks resolved, but not the final symlink. */
|
|
6
|
+
readonly resolvedPath: string;
|
|
7
|
+
readonly cwd: string;
|
|
8
|
+
readonly kind: "file" | "directory" | "symlink";
|
|
9
|
+
readonly recursive: boolean;
|
|
10
|
+
readonly signal?: AbortSignal;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** A fail-closed policy. Throwing or denying prevents removal. */
|
|
14
|
+
export interface DeleteGuardRegistration {
|
|
15
|
+
readonly id: string;
|
|
16
|
+
readonly guard: (
|
|
17
|
+
event: BeforeDeleteEvent,
|
|
18
|
+
) =>
|
|
19
|
+
| { readonly decision: "allow" }
|
|
20
|
+
| { readonly decision: "deny"; readonly reason: string }
|
|
21
|
+
| Promise<
|
|
22
|
+
{ readonly decision: "allow" } | { readonly decision: "deny"; readonly reason: string }
|
|
23
|
+
>;
|
|
24
|
+
}
|
|
@@ -3,8 +3,8 @@ import type { TextDocument } from "pi-agent-text";
|
|
|
3
3
|
export type TextEditIntent = "edit" | "restore" | "mixed";
|
|
4
4
|
|
|
5
5
|
export interface TextEditCompletion {
|
|
6
|
-
/**
|
|
7
|
-
readonly postProcessing?: "deferred" | "final" | "complete";
|
|
6
|
+
/** Saved bytes remain observable even when post-edit work is deferred or interrupted. */
|
|
7
|
+
readonly postProcessing?: "deferred" | "final" | "complete" | "interrupted";
|
|
8
8
|
readonly source: string;
|
|
9
9
|
readonly resourceSource: string;
|
|
10
10
|
readonly resolvedBy: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type { BeforeDeleteEvent, DeleteGuardRegistration } from "./delete-guard.js";
|
|
1
2
|
import type { TextEditIntent } from "#src/api/edit-completion.js";
|
|
2
3
|
import type { AppliedTextChange } from "#src/core/text-change-engine.js";
|
|
3
4
|
export type { AppliedTextChange } from "#src/core/text-change-engine.js";
|
|
@@ -28,8 +28,7 @@ export { type ChangedRange, computeChangedRanges } from "#src/core/mutation-resu
|
|
|
28
28
|
export {
|
|
29
29
|
mutationDataSchema,
|
|
30
30
|
mutationResultSchema,
|
|
31
|
-
|
|
32
|
-
type FlushData,
|
|
31
|
+
type BatchMutationData,
|
|
33
32
|
structuredMutation,
|
|
34
33
|
type MutationData,
|
|
35
34
|
} from "#src/core/structured-result.js";
|
|
@@ -5,6 +5,10 @@ import type { FileMutationBatchResult } from "./mutation-result.js";
|
|
|
5
5
|
export interface NativeEditBatchEvent {
|
|
6
6
|
readonly parentToolCallId: string;
|
|
7
7
|
readonly calls: readonly string[];
|
|
8
|
+
/** Successful Copy calls that retained identical destination text without a write. */
|
|
9
|
+
readonly unchangedCopyCalls?: readonly string[];
|
|
10
|
+
/** Per-call Copy receipts keep destination authority and rollback evidence. */
|
|
11
|
+
readonly copyResults?: ReadonlyMap<string, AgentToolResult<FileMutationBatchResult>>;
|
|
8
12
|
readonly result: AgentToolResult<FileMutationBatchResult>;
|
|
9
13
|
}
|
|
10
14
|
|
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
} from "#src/api/anchor-inspection.js";
|
|
16
16
|
import type { TextEditCompletionListener } from "#src/api/edit-completion.js";
|
|
17
17
|
import type { TextEditorToolPluginApi } from "#src/api/edit-pipeline.js";
|
|
18
|
+
import type { DeleteGuardRegistration } from "#src/api/delete-guard.js";
|
|
18
19
|
import type { TextMutationGuardRegistration } from "#src/api/mutation-guard.js";
|
|
19
20
|
import type {
|
|
20
21
|
TextMutationPreviewOutcome,
|
|
@@ -28,7 +29,7 @@ import type { TextEditorToolRendererRegistration } from "#src/api/tool-renderer.
|
|
|
28
29
|
|
|
29
30
|
export const TEXT_EDITOR_PROTOCOL = "pi-agent-text-editor";
|
|
30
31
|
|
|
31
|
-
export const TEXT_EDITOR_API_VERSION =
|
|
32
|
+
export const TEXT_EDITOR_API_VERSION = 24;
|
|
32
33
|
|
|
33
34
|
export const TEXT_POSITION_ANCHOR_KIND = "pi-agent-text-editor/position";
|
|
34
35
|
|
|
@@ -88,6 +89,8 @@ export interface TextEditorPluginApi {
|
|
|
88
89
|
addTextPresenter(registration: TextPresenterRegistration): void;
|
|
89
90
|
addMutationTool(registration: TextMutationToolRegistration): void;
|
|
90
91
|
addMutationGuard(registration: TextMutationGuardRegistration): void;
|
|
92
|
+
/** Add a fail-closed policy for whole-object filesystem deletion, not text removal. */
|
|
93
|
+
addDeleteGuard(registration: DeleteGuardRegistration): void;
|
|
91
94
|
addToolRenderer(registration: TextEditorToolRendererRegistration): void;
|
|
92
95
|
onMutationTool(listener: TextMutationToolListener): () => void;
|
|
93
96
|
onDidEdit(listener: TextEditCompletionListener): () => void;
|
|
@@ -14,7 +14,7 @@ export function formatStaleAnchorMessage(
|
|
|
14
14
|
): string {
|
|
15
15
|
const context = details.context === undefined ? "" : `\n\n${details.context}`;
|
|
16
16
|
return (
|
|
17
|
-
`[SYSTEM] ${details.toolName} blocked: ${details.field} anchor "${details.anchor}" is stale. ` +
|
|
17
|
+
`[SYSTEM] ${details.toolName} blocked: ${details.field === "anchor" ? "anchor" : `${details.field} anchor`} "${details.anchor}" is stale. ` +
|
|
18
18
|
`If the required line is represented by one of the context lines below, use that anchor. Otherwise, reread only the relevant section of "${details.path}" and regenerate the anchor. (${reason})${context}`
|
|
19
19
|
);
|
|
20
20
|
}
|