pi-agent-ide 0.6.3 → 0.7.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 +97 -0
- package/README.md +10 -3
- package/dist/{chunk-AWXVJ5AC.js → chunk-2RTCSZB3.js} +1 -1
- package/dist/chunk-3HYXQ4YA.js +28 -0
- package/dist/chunk-3JO7QFIL.js +1 -0
- package/dist/chunk-4NIFBFFR.js +11 -0
- package/dist/{chunk-VCTK4JSN.js → chunk-64M3SQPG.js} +1 -1
- package/dist/{chunk-5QQABP47.js → chunk-7LD2OQH3.js} +1 -1
- package/dist/chunk-7LZKOHH2.js +1 -0
- package/dist/chunk-AJRIASPQ.js +2 -0
- package/dist/chunk-EAZGN5ND.js +7 -0
- package/dist/{chunk-ZM4L5AGN.js → chunk-EDURPQAV.js} +3 -2
- package/dist/{chunk-GIRAEVUJ.js → chunk-F5YZG77W.js} +1 -1
- package/dist/chunk-FK42RSF4.js +1 -0
- package/dist/{chunk-O6LE42GK.js → chunk-FXNKMNSJ.js} +1 -1
- package/dist/chunk-GBLKIB6O.js +2 -0
- package/dist/chunk-KBP3QUDT.js +2 -0
- package/dist/chunk-KR36BT5E.js +1 -0
- package/dist/{chunk-NTYXZ3EL.js → chunk-KVHDMIZS.js} +1 -1
- package/dist/{chunk-QDST6VIU.js → chunk-KZC7TI5M.js} +1 -1
- package/dist/chunk-OE7QVAI2.js +5 -0
- package/dist/{chunk-GUTQ3PWL.js → chunk-PLKYHUNT.js} +1 -1
- package/dist/chunk-PNU3E7IO.js +3 -0
- package/dist/chunk-PS2B6THP.js +3 -0
- package/dist/chunk-PYPPV2F5.js +25 -0
- package/dist/{chunk-25CZ5ZIU.js → chunk-QFTBY67N.js} +3 -3
- package/dist/chunk-S5LXX32D.js +28 -0
- package/dist/chunk-SILJ3OL4.js +9 -0
- package/dist/chunk-SQKAXYIR.js +2 -0
- package/dist/chunk-VCGNVTXQ.js +1 -0
- package/dist/chunk-XYS4FSCC.js +12 -0
- package/dist/chunk-YGGKGZO2.js +1 -0
- package/dist/{chunk-L7JMDDSD.js → chunk-YRF7OATP.js} +1 -1
- package/dist/chunk-ZPT5D4VP.js +2 -0
- package/dist/entry-0.js +1 -1
- 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-16.js +1 -1
- package/dist/entry-17.js +1 -1
- package/dist/entry-25.js +2 -2
- package/dist/entry-26.js +1 -1
- package/dist/entry-27.js +1 -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 +11 -9
- package/dist/entry-33.js +1 -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 +12 -11
- package/dist/entry-46.js +1 -1
- package/dist/entry-49.js +1 -1
- package/dist/entry-50.js +3 -6
- package/dist/entry-51.js +11 -9
- package/dist/entry-52.js +1 -1
- package/dist/entry-53.js +1 -1
- package/dist/entry-54.js +1 -1
- package/dist/entry-55.js +1 -1
- package/dist/entry-56.js +1 -1
- package/dist/entry-57.js +1 -1
- package/dist/entry-58.js +1 -1
- package/dist/entry-59.js +1 -1
- package/dist/entry-60.js +1 -1
- package/dist/entry-61.js +0 -1
- package/dist/entry-62.js +1 -0
- package/dist/entry-63.js +0 -1
- package/dist/entry-64.js +1 -0
- package/dist/entry-65.js +1 -1
- package/dist/entry-66.js +1 -1
- package/dist/entry-67.js +1 -1
- package/dist/entry-68.js +1 -1
- package/dist/entry-69.js +1 -1
- package/dist/entry-70.js +1 -1
- package/dist/entry-72.js +1 -1
- package/dist/entry-75.js +1 -1
- package/dist/entry-77.js +50 -307
- package/dist/entry-78.js +14 -26
- package/dist/entry-79.js +2 -2
- package/dist/entry-80.js +1 -1
- package/dist/entry-81.js +1 -1
- package/dist/entry-82.js +5 -3
- 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 +15 -3
- package/docs/agent-guides/editing.md +31 -3
- package/docs/agent-guides/git-changes.md +1 -1
- package/docs/agent-guides/json-reading.md +19 -3
- package/docs/agent-guides/read-resources.md +15 -1
- package/docs/agent-guides/search-code.md +43 -2
- package/docs/agent-guides/select-code.md +194 -0
- package/docs/agent-guides/terminal.md +1 -1
- package/docs/code-review.md +99 -0
- package/docs/configuration.md +36 -7
- package/docs/development.md +16 -19
- package/docs/nightly.md +7 -0
- package/docs/releases.md +42 -0
- package/docs/research/apply-native-capability-matrix.md +174 -0
- package/docs/research/apply-read-latency.md +2 -0
- package/docs/research/lpt-393-fuzzy-results/file.json +152 -0
- package/docs/research/lpt-393-fuzzy-results/repo.json +122 -0
- package/docs/research/lpt-393-search-fuzzy-fallback.md +97 -0
- package/docs/research/native-codemode-batch-decision.md +29 -0
- package/docs/research/native-codemode-batching.md +65 -0
- package/docs/structured-results.md +86 -0
- package/docs/tools.md +24 -4
- package/docs/user-hooks.md +1 -1
- 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-documentation/src/index.ts +1 -1
- package/node_modules/pi-agent-filesystem/index.ts +6 -1
- package/node_modules/pi-agent-filesystem/package.json +7 -6
- package/node_modules/pi-agent-filesystem/src/path-recovery.ts +109 -0
- 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-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 +15 -10
- package/node_modules/pi-agent-ide-ast/src/ast/constructs.ts +193 -0
- package/node_modules/pi-agent-ide-ast/src/ast/element-extent.ts +59 -0
- package/node_modules/pi-agent-ide-ast/src/ast/manager.ts +5 -1
- package/node_modules/pi-agent-ide-ast/src/ast/selection.ts +204 -0
- package/node_modules/pi-agent-ide-ast/src/ast/syntax-tree.ts +2 -0
- package/node_modules/pi-agent-ide-ast/src/extension.ts +4 -2
- package/node_modules/pi-agent-ide-ast/src/geometry-selection.ts +184 -0
- package/node_modules/pi-agent-ide-ast/src/overflow-handler.ts +6 -1
- package/node_modules/pi-agent-ide-ast/src/scope-handler.ts +6 -2
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +110 -7
- package/node_modules/pi-agent-ide-ast/src/select-presentation.ts +104 -0
- package/node_modules/pi-agent-ide-ast/src/select-schema.ts +384 -0
- package/node_modules/pi-agent-ide-ast/src/selection-region.ts +41 -0
- package/node_modules/pi-agent-ide-ast/src/source-text.ts +92 -0
- package/node_modules/pi-agent-ide-ast/src/text-selection.ts +214 -0
- package/node_modules/pi-agent-ide-ast/src/tool-select.ts +251 -0
- package/node_modules/pi-agent-ide-changes/index.ts +2 -24
- package/node_modules/pi-agent-ide-changes/package.json +8 -7
- package/node_modules/pi-agent-ide-changes/src/current-change-presenter.ts +5 -0
- package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +126 -48
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +11 -40
- 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 +2 -2
- package/node_modules/pi-agent-ide-lsp/package.json +9 -9
- package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +5 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +8 -2
- package/node_modules/pi-agent-ide-lsp/src/lsp/project.ts +19 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +204 -118
- package/node_modules/pi-agent-ide-lsp/src/rename-plan.ts +2 -17
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +92 -30
- 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 +2 -2
- package/node_modules/pi-agent-read/src/api/tools/read.ts +35 -2
- package/node_modules/pi-agent-read/src/core/extension.ts +11 -0
- package/node_modules/pi-agent-read/src/core/tools/read/raw-read.ts +9 -10
- package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +28 -15
- package/node_modules/pi-agent-read/src/core/tools/read/result-target.ts +93 -0
- package/node_modules/pi-agent-read/src/core/tools/read/structured-result.ts +218 -0
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +127 -73
- package/node_modules/pi-agent-resource/package.json +1 -1
- package/node_modules/pi-agent-resource/src/index.ts +22 -0
- package/node_modules/pi-agent-resource/src/resource-access.ts +55 -0
- package/node_modules/pi-agent-resource/src/resource-scheduler.ts +204 -0
- package/node_modules/pi-agent-resource/src/result-targets.ts +233 -0
- package/node_modules/pi-agent-resource/src/tool-result.ts +125 -0
- package/node_modules/pi-agent-search/package.json +5 -4
- package/node_modules/pi-agent-search/src/api/fuzzy.ts +208 -0
- package/node_modules/pi-agent-search/src/api/presentation.ts +68 -0
- package/node_modules/pi-agent-search/src/api/search-parameters.ts +13 -6
- package/node_modules/pi-agent-search/src/api/search-scope.ts +22 -0
- package/node_modules/pi-agent-search/src/api/search.ts +39 -0
- package/node_modules/pi-agent-search/src/api/structured-result.ts +148 -0
- package/node_modules/pi-agent-search/src/core/extension.ts +90 -24
- package/node_modules/pi-agent-search/src/core/search-core.ts +145 -78
- package/node_modules/pi-agent-search-text/index.ts +6 -1
- package/node_modules/pi-agent-search-text/package.json +7 -6
- package/node_modules/pi-agent-search-text/src/fuzzy-search.ts +164 -0
- package/node_modules/pi-agent-search-text/src/resolvers.ts +174 -26
- package/node_modules/pi-agent-search-text/src/scoped-search.ts +103 -0
- package/node_modules/pi-agent-search-text/src/search-backend.ts +201 -18
- package/node_modules/pi-agent-search-text/src/search-query.ts +42 -34
- package/node_modules/pi-agent-search-text/src/search-recipe.ts +18 -4
- package/node_modules/pi-agent-search-text/src/search-renderer.ts +90 -259
- package/node_modules/pi-agent-search-text/src/search-result.ts +77 -0
- package/node_modules/pi-agent-search-text/src/search-session.ts +110 -17
- package/node_modules/pi-agent-text/package.json +2 -2
- package/node_modules/pi-agent-text/src/text-document.ts +15 -10
- 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-exact/src/anchor.ts +4 -3
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +5 -5
- package/node_modules/pi-agent-text-editor/index.ts +4 -7
- package/node_modules/pi-agent-text-editor/package.json +20 -21
- package/node_modules/pi-agent-text-editor/src/api/mutation-preview.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +6 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +3 -1
- package/node_modules/pi-agent-text-editor/src/api/native-edit-batch-event.ts +12 -0
- package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +1 -20
- package/node_modules/pi-agent-text-editor/src/core/builtin-edit.ts +16 -0
- package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +78 -41
- package/node_modules/pi-agent-text-editor/src/core/editing-guidelines.ts +8 -0
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +12 -2
- package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +35 -4
- package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/file-result-targets.ts +76 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result-targets.ts +168 -0
- package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +820 -0
- package/node_modules/pi-agent-text-editor/src/core/post-edit-scope.ts +20 -6
- package/node_modules/pi-agent-text-editor/src/core/result-input.ts +22 -0
- package/node_modules/pi-agent-text-editor/src/core/result-target-anchors.ts +78 -0
- package/node_modules/pi-agent-text-editor/src/core/result-transfer.ts +175 -0
- package/node_modules/pi-agent-text-editor/src/core/structured-result.ts +412 -0
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +149 -139
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +236 -185
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +253 -203
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +25 -5
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +8 -4
- package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +9 -6
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +5 -5
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +5 -5
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +9 -7
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +8 -8
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +8 -3
- package/node_modules/pi-agent-text-editor-renderer/index.ts +9 -73
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -5
- package/node_modules/pi-agent-text-editor-renderer/src/diff-model.ts +276 -129
- package/node_modules/pi-agent-text-editor-renderer/src/diff-renderer.ts +36 -2
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +28 -2
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-projection.ts +40 -10
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +19 -45
- package/node_modules/pi-agent-text-editor-stale-anchor/index.ts +16 -1
- 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-tool-ui/src/index.ts +7 -0
- package/node_modules/pi-agent-tool-ui/src/result-panel.ts +298 -0
- package/node_modules/pi-agent-web/index.ts +23 -0
- package/node_modules/pi-agent-web/package.json +7 -6
- package/node_modules/pi-agent-web/src/search.ts +221 -0
- 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 +42 -37
- package/skills/capture-code-review-rule/SKILL.md +60 -0
- package/src/code-review/config.ts +68 -0
- package/src/code-review/extension.ts +105 -0
- package/src/code-review/fragments.ts +26 -0
- package/src/code-review/reviewer.ts +198 -0
- package/src/composite/host-version.ts +13 -0
- package/src/composite/module-labels.ts +1 -1
- package/src/composite/nested-tool-rendering.ts +298 -0
- package/src/composite/preferences.ts +0 -5
- package/src/composite/tool-availability.ts +90 -0
- package/src/core/extension.ts +2 -0
- package/src/documentation/extension.ts +81 -145
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +6 -1
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -6
- 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-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-filesystem/src/path-recovery.ts +109 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +23 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +7 -6
- 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/search.ts +221 -0
- package/src/extensions/pi-agent-read/package.json +7 -7
- package/src/extensions/pi-agent-read/src/api/read-parameters.ts +2 -2
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +35 -2
- package/src/extensions/pi-agent-read/src/core/extension.ts +11 -0
- package/src/extensions/pi-agent-read/src/core/tools/read/raw-read.ts +9 -10
- package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +28 -15
- package/src/extensions/pi-agent-read/src/core/tools/read/result-target.ts +93 -0
- package/src/extensions/pi-agent-read/src/core/tools/read/structured-result.ts +218 -0
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +127 -73
- package/src/extensions/pi-agent-search/package.json +5 -4
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +6 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +7 -6
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/fuzzy-search.ts +164 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +174 -26
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/scoped-search.ts +103 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +201 -18
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-query.ts +42 -34
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +18 -4
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +90 -259
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +77 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +110 -17
- package/src/extensions/pi-agent-search/src/api/fuzzy.ts +208 -0
- package/src/extensions/pi-agent-search/src/api/presentation.ts +68 -0
- package/src/extensions/pi-agent-search/src/api/search-parameters.ts +13 -6
- package/src/extensions/pi-agent-search/src/api/search-scope.ts +22 -0
- package/src/extensions/pi-agent-search/src/api/search.ts +39 -0
- package/src/extensions/pi-agent-search/src/api/structured-result.ts +148 -0
- package/src/extensions/pi-agent-search/src/core/extension.ts +90 -24
- package/src/extensions/pi-agent-search/src/core/search-core.ts +145 -78
- package/src/extensions/pi-agent-text-editor/index.ts +4 -7
- package/src/extensions/pi-agent-text-editor/package.json +20 -21
- 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-exact/src/anchor.ts +4 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +9 -73
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-model.ts +276 -129
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-renderer.ts +36 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +28 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-projection.ts +40 -10
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +19 -45
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/index.ts +16 -1
- 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/mutation-preview.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +6 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +3 -1
- package/src/extensions/pi-agent-text-editor/src/api/native-edit-batch-event.ts +12 -0
- package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +1 -20
- package/src/extensions/pi-agent-text-editor/src/core/builtin-edit.ts +16 -0
- package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +78 -41
- package/src/extensions/pi-agent-text-editor/src/core/editing-guidelines.ts +8 -0
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +12 -2
- package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +35 -4
- package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/file-result-targets.ts +76 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result-targets.ts +168 -0
- package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +820 -0
- package/src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts +20 -6
- package/src/extensions/pi-agent-text-editor/src/core/result-input.ts +22 -0
- package/src/extensions/pi-agent-text-editor/src/core/result-target-anchors.ts +78 -0
- package/src/extensions/pi-agent-text-editor/src/core/result-transfer.ts +175 -0
- package/src/extensions/pi-agent-text-editor/src/core/structured-result.ts +412 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +149 -139
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +236 -185
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +253 -203
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +25 -5
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +8 -4
- package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +9 -6
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +5 -5
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +5 -5
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +9 -7
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +8 -8
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +8 -3
- package/src/pi-agent-ide.ts +61 -8
- package/src/plugins/pi-agent-ide-ast/package.json +15 -10
- package/src/plugins/pi-agent-ide-ast/src/ast/constructs.ts +193 -0
- package/src/plugins/pi-agent-ide-ast/src/ast/element-extent.ts +59 -0
- package/src/plugins/pi-agent-ide-ast/src/ast/manager.ts +5 -1
- package/src/plugins/pi-agent-ide-ast/src/ast/selection.ts +204 -0
- package/src/plugins/pi-agent-ide-ast/src/ast/syntax-tree.ts +2 -0
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +4 -2
- package/src/plugins/pi-agent-ide-ast/src/geometry-selection.ts +184 -0
- package/src/plugins/pi-agent-ide-ast/src/overflow-handler.ts +6 -1
- package/src/plugins/pi-agent-ide-ast/src/scope-handler.ts +6 -2
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +110 -7
- package/src/plugins/pi-agent-ide-ast/src/select-presentation.ts +104 -0
- package/src/plugins/pi-agent-ide-ast/src/select-schema.ts +384 -0
- package/src/plugins/pi-agent-ide-ast/src/selection-region.ts +41 -0
- package/src/plugins/pi-agent-ide-ast/src/source-text.ts +92 -0
- package/src/plugins/pi-agent-ide-ast/src/text-selection.ts +214 -0
- package/src/plugins/pi-agent-ide-ast/src/tool-select.ts +251 -0
- package/src/plugins/pi-agent-ide-changes/index.ts +2 -24
- package/src/plugins/pi-agent-ide-changes/package.json +8 -7
- package/src/plugins/pi-agent-ide-changes/src/current-change-presenter.ts +5 -0
- package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +126 -48
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +11 -40
- package/src/plugins/pi-agent-ide-debugger/index.ts +63 -17
- package/src/plugins/pi-agent-ide-debugger/src/catalog.ts +18 -2
- package/src/plugins/pi-agent-ide-debugger/src/dap-client.ts +24 -4
- package/src/plugins/pi-agent-ide-debugger/src/doctor-plugin.ts +68 -2
- package/src/plugins/pi-agent-ide-debugger/src/java-runtime.ts +357 -0
- package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +55 -3
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +13 -13
- 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 +2 -2
- package/src/plugins/pi-agent-ide-lsp/package.json +9 -9
- package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +5 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +8 -2
- package/src/plugins/pi-agent-ide-lsp/src/lsp/project.ts +19 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +204 -118
- package/src/plugins/pi-agent-ide-lsp/src/rename-plan.ts +2 -17
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +92 -30
- package/src/plugins/pi-agent-ide-terminal/index.ts +12 -2
- package/src/plugins/pi-agent-ide-terminal/src/output-limits.ts +1 -1
- package/src/plugins/pi-agent-ide-terminal/src/resources.ts +65 -30
- package/src/plugins/pi-agent-ide-terminal/src/search.ts +16 -37
- package/src/plugins/pi-agent-ide-terminal/src/session-manager.ts +1 -0
- package/src/plugins/pi-agent-ide-terminal/src/shell-result.ts +100 -0
- package/src/plugins/pi-agent-ide-terminal/src/steering.ts +62 -0
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +98 -46
- package/src/plugins/pi-agent-ide-terminal/src/types.ts +3 -1
- package/src/plugins/pi-agent-ide-terminal/src/ui.ts +15 -6
- package/src/plugins/pi-agent-ide-vision/index.ts +35 -1
- package/dist/chunk-3E2NTWCN.js +0 -2
- package/dist/chunk-4LUW26BX.js +0 -10
- package/dist/chunk-4U2GUKNJ.js +0 -0
- package/dist/chunk-5VSE5X5R.js +0 -2
- package/dist/chunk-6EYWFBNG.js +0 -0
- package/dist/chunk-7WCZOO5I.js +0 -1
- package/dist/chunk-CEX3VOJ7.js +0 -2
- package/dist/chunk-FA6BKC5Y.js +0 -1
- package/dist/chunk-FEDVTZJG.js +0 -1
- package/dist/chunk-HMLH43ZS.js +0 -4
- package/dist/chunk-ITSNK5YG.js +0 -7
- package/dist/chunk-KII2JQC5.js +0 -1
- package/dist/chunk-LVWMWWWF.js +0 -28
- package/dist/chunk-P7XO5CIP.js +0 -2
- package/dist/chunk-PZFOOHY2.js +0 -15
- package/dist/chunk-ROXXK6TW.js +0 -0
- package/dist/chunk-S3ZPXWX7.js +0 -2
- package/dist/chunk-T7CZIACQ.js +0 -27
- package/dist/chunk-VXD6FZP5.js +0 -5
- package/dist/chunk-YHUTTZC6.js +0 -2
- package/dist/chunk-YT42LKFV.js +0 -16
- package/docs/agent-guides/apply.md +0 -333
- package/node_modules/pi-agent-text-editor/src/api/apply-renderer.ts +0 -3
- package/node_modules/pi-agent-text-editor/src/core/apply/apply-undo-store.ts +0 -155
- package/node_modules/pi-agent-text-editor/src/core/apply/execution.ts +0 -344
- package/node_modules/pi-agent-text-editor/src/core/apply/final-mutations.ts +0 -50
- package/node_modules/pi-agent-text-editor/src/core/apply/format-source.ts +0 -11
- package/node_modules/pi-agent-text-editor/src/core/apply/mixed-source.ts +0 -203
- package/node_modules/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +0 -55
- package/node_modules/pi-agent-text-editor/src/core/apply/output.ts +0 -276
- package/node_modules/pi-agent-text-editor/src/core/apply/prompt.ts +0 -13
- package/node_modules/pi-agent-text-editor/src/core/apply/queue.ts +0 -25
- package/node_modules/pi-agent-text-editor/src/core/apply/renderer.ts +0 -405
- package/node_modules/pi-agent-text-editor/src/core/apply/results.ts +0 -133
- package/node_modules/pi-agent-text-editor/src/core/apply/runtime.ts +0 -369
- package/node_modules/pi-agent-text-editor/src/core/apply/tool.ts +0 -148
- package/node_modules/pi-agent-text-editor/src/core/apply/transaction.ts +0 -920
- package/node_modules/pi-agent-text-editor/src/core/builtin-edit-filter.ts +0 -52
- package/src/extensions/pi-agent-text-editor/src/api/apply-renderer.ts +0 -3
- package/src/extensions/pi-agent-text-editor/src/core/apply/apply-undo-store.ts +0 -155
- package/src/extensions/pi-agent-text-editor/src/core/apply/execution.ts +0 -344
- package/src/extensions/pi-agent-text-editor/src/core/apply/final-mutations.ts +0 -50
- package/src/extensions/pi-agent-text-editor/src/core/apply/format-source.ts +0 -11
- package/src/extensions/pi-agent-text-editor/src/core/apply/mixed-source.ts +0 -203
- package/src/extensions/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +0 -55
- package/src/extensions/pi-agent-text-editor/src/core/apply/output.ts +0 -276
- package/src/extensions/pi-agent-text-editor/src/core/apply/prompt.ts +0 -13
- package/src/extensions/pi-agent-text-editor/src/core/apply/queue.ts +0 -25
- package/src/extensions/pi-agent-text-editor/src/core/apply/renderer.ts +0 -405
- package/src/extensions/pi-agent-text-editor/src/core/apply/results.ts +0 -133
- package/src/extensions/pi-agent-text-editor/src/core/apply/runtime.ts +0 -369
- package/src/extensions/pi-agent-text-editor/src/core/apply/tool.ts +0 -148
- package/src/extensions/pi-agent-text-editor/src/core/apply/transaction.ts +0 -920
- package/src/extensions/pi-agent-text-editor/src/core/builtin-edit-filter.ts +0 -52
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scope": "file",
|
|
3
|
+
"request": {
|
|
4
|
+
"query": "generateHintStrings",
|
|
5
|
+
"path": "tests/integration/extensions/pi-agent-search/fixtures/fuzzy-vimium/link_hints.js"
|
|
6
|
+
},
|
|
7
|
+
"node": "v24.20.0",
|
|
8
|
+
"baselineRssBytes": 147570688,
|
|
9
|
+
"baselineHeapBytes": 52466544,
|
|
10
|
+
"peakNodeRssKiB": 156064,
|
|
11
|
+
"runs": [
|
|
12
|
+
{
|
|
13
|
+
"repetition": 0,
|
|
14
|
+
"invocation": "first in this process",
|
|
15
|
+
"resolveMs": 48.63072999999986,
|
|
16
|
+
"registrationMs": 4.892467000000124,
|
|
17
|
+
"totalMs": 53.52319699999998,
|
|
18
|
+
"ordinaryMs": 6.71617399999991,
|
|
19
|
+
"status": "ready",
|
|
20
|
+
"candidates": [
|
|
21
|
+
{
|
|
22
|
+
"identifier": "hintStrings",
|
|
23
|
+
"matchCount": 5,
|
|
24
|
+
"complete": true
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"identifier": "generateHintString",
|
|
28
|
+
"matchCount": 2,
|
|
29
|
+
"complete": true
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"rssBytes": 152731648,
|
|
33
|
+
"heapBytes": 43699128
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"repetition": 1,
|
|
37
|
+
"invocation": "repeat; fresh name scan",
|
|
38
|
+
"resolveMs": 30.852624000000105,
|
|
39
|
+
"registrationMs": 2.1712270000000444,
|
|
40
|
+
"totalMs": 33.02385100000015,
|
|
41
|
+
"ordinaryMs": 7.320789000000104,
|
|
42
|
+
"status": "ready",
|
|
43
|
+
"candidates": [
|
|
44
|
+
{
|
|
45
|
+
"identifier": "hintStrings",
|
|
46
|
+
"matchCount": 5,
|
|
47
|
+
"complete": true
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"identifier": "generateHintString",
|
|
51
|
+
"matchCount": 2,
|
|
52
|
+
"complete": true
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"rssBytes": 152862720,
|
|
56
|
+
"heapBytes": 49453640
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"repetition": 2,
|
|
60
|
+
"invocation": "repeat; fresh name scan",
|
|
61
|
+
"resolveMs": 30.69540700000016,
|
|
62
|
+
"registrationMs": 1.7809270000000197,
|
|
63
|
+
"totalMs": 32.47633400000018,
|
|
64
|
+
"ordinaryMs": 7.036112000000003,
|
|
65
|
+
"status": "ready",
|
|
66
|
+
"candidates": [
|
|
67
|
+
{
|
|
68
|
+
"identifier": "hintStrings",
|
|
69
|
+
"matchCount": 5,
|
|
70
|
+
"complete": true
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"identifier": "generateHintString",
|
|
74
|
+
"matchCount": 2,
|
|
75
|
+
"complete": true
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"rssBytes": 152862720,
|
|
79
|
+
"heapBytes": 53448504
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"repetition": 3,
|
|
83
|
+
"invocation": "repeat; fresh name scan",
|
|
84
|
+
"resolveMs": 25.92471099999989,
|
|
85
|
+
"registrationMs": 1.7080989999999474,
|
|
86
|
+
"totalMs": 27.632809999999836,
|
|
87
|
+
"ordinaryMs": 6.778381999999965,
|
|
88
|
+
"status": "ready",
|
|
89
|
+
"candidates": [
|
|
90
|
+
{
|
|
91
|
+
"identifier": "hintStrings",
|
|
92
|
+
"matchCount": 5,
|
|
93
|
+
"complete": true
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"identifier": "generateHintString",
|
|
97
|
+
"matchCount": 2,
|
|
98
|
+
"complete": true
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"rssBytes": 152862720,
|
|
102
|
+
"heapBytes": 57350904
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"repetition": 4,
|
|
106
|
+
"invocation": "repeat; fresh name scan",
|
|
107
|
+
"resolveMs": 30.013942999999927,
|
|
108
|
+
"registrationMs": 2.700010999999904,
|
|
109
|
+
"totalMs": 32.71395399999983,
|
|
110
|
+
"ordinaryMs": 7.596590999999989,
|
|
111
|
+
"status": "ready",
|
|
112
|
+
"candidates": [
|
|
113
|
+
{
|
|
114
|
+
"identifier": "hintStrings",
|
|
115
|
+
"matchCount": 5,
|
|
116
|
+
"complete": true
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"identifier": "generateHintString",
|
|
120
|
+
"matchCount": 2,
|
|
121
|
+
"complete": true
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"rssBytes": 155746304,
|
|
125
|
+
"heapBytes": 61306432
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"repetition": 5,
|
|
129
|
+
"invocation": "repeat; fresh name scan",
|
|
130
|
+
"resolveMs": 30.76448000000005,
|
|
131
|
+
"registrationMs": 2.2739610000000994,
|
|
132
|
+
"totalMs": 33.03844100000015,
|
|
133
|
+
"ordinaryMs": 7.54132699999991,
|
|
134
|
+
"status": "ready",
|
|
135
|
+
"candidates": [
|
|
136
|
+
{
|
|
137
|
+
"identifier": "hintStrings",
|
|
138
|
+
"matchCount": 5,
|
|
139
|
+
"complete": true
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"identifier": "generateHintString",
|
|
143
|
+
"matchCount": 2,
|
|
144
|
+
"complete": true
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
"rssBytes": 159809536,
|
|
148
|
+
"heapBytes": 65303264
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
"note": "First invocation is not a flushed OS cache. Resolve includes ordinary search, name collection and exact verification. Registration includes bounded snapshots. RSS includes imported runtime modules; it is not the vocabulary size and does not include child-process RSS."
|
|
152
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scope": "repo",
|
|
3
|
+
"request": {
|
|
4
|
+
"query": "planSearchPresentations",
|
|
5
|
+
"path": "src"
|
|
6
|
+
},
|
|
7
|
+
"node": "v24.20.0",
|
|
8
|
+
"baselineRssBytes": 149012480,
|
|
9
|
+
"baselineHeapBytes": 52543264,
|
|
10
|
+
"peakNodeRssKiB": 253136,
|
|
11
|
+
"runs": [
|
|
12
|
+
{
|
|
13
|
+
"repetition": 0,
|
|
14
|
+
"invocation": "first in this process",
|
|
15
|
+
"resolveMs": 197.02866299999994,
|
|
16
|
+
"registrationMs": 5.886676999999963,
|
|
17
|
+
"totalMs": 202.9153399999999,
|
|
18
|
+
"ordinaryMs": 11.027428999999984,
|
|
19
|
+
"status": "ready",
|
|
20
|
+
"candidates": [
|
|
21
|
+
{
|
|
22
|
+
"identifier": "planSearchPresentation",
|
|
23
|
+
"matchCount": 10,
|
|
24
|
+
"complete": true
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"rssBytes": 192319488,
|
|
28
|
+
"heapBytes": 42126184
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"repetition": 1,
|
|
32
|
+
"invocation": "repeat; fresh name scan",
|
|
33
|
+
"resolveMs": 153.16502000000014,
|
|
34
|
+
"registrationMs": 2.6196299999999155,
|
|
35
|
+
"totalMs": 155.78465000000006,
|
|
36
|
+
"ordinaryMs": 13.262361000000055,
|
|
37
|
+
"status": "ready",
|
|
38
|
+
"candidates": [
|
|
39
|
+
{
|
|
40
|
+
"identifier": "planSearchPresentation",
|
|
41
|
+
"matchCount": 10,
|
|
42
|
+
"complete": true
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"rssBytes": 193245184,
|
|
46
|
+
"heapBytes": 43182040
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"repetition": 2,
|
|
50
|
+
"invocation": "repeat; fresh name scan",
|
|
51
|
+
"resolveMs": 140.010812,
|
|
52
|
+
"registrationMs": 2.463557999999921,
|
|
53
|
+
"totalMs": 142.4743699999999,
|
|
54
|
+
"ordinaryMs": 13.206528999999819,
|
|
55
|
+
"status": "ready",
|
|
56
|
+
"candidates": [
|
|
57
|
+
{
|
|
58
|
+
"identifier": "planSearchPresentation",
|
|
59
|
+
"matchCount": 10,
|
|
60
|
+
"complete": true
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"rssBytes": 194007040,
|
|
64
|
+
"heapBytes": 44272152
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"repetition": 3,
|
|
68
|
+
"invocation": "repeat; fresh name scan",
|
|
69
|
+
"resolveMs": 155.73641399999997,
|
|
70
|
+
"registrationMs": 2.2927649999999176,
|
|
71
|
+
"totalMs": 158.02917899999989,
|
|
72
|
+
"ordinaryMs": 13.180634999999938,
|
|
73
|
+
"status": "ready",
|
|
74
|
+
"candidates": [
|
|
75
|
+
{
|
|
76
|
+
"identifier": "planSearchPresentation",
|
|
77
|
+
"matchCount": 10,
|
|
78
|
+
"complete": true
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"rssBytes": 194613248,
|
|
82
|
+
"heapBytes": 45255216
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"repetition": 4,
|
|
86
|
+
"invocation": "repeat; fresh name scan",
|
|
87
|
+
"resolveMs": 155.2331959999999,
|
|
88
|
+
"registrationMs": 2.0157530000001316,
|
|
89
|
+
"totalMs": 157.24894900000004,
|
|
90
|
+
"ordinaryMs": 12.454251000000113,
|
|
91
|
+
"status": "ready",
|
|
92
|
+
"candidates": [
|
|
93
|
+
{
|
|
94
|
+
"identifier": "planSearchPresentation",
|
|
95
|
+
"matchCount": 10,
|
|
96
|
+
"complete": true
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"rssBytes": 195268608,
|
|
100
|
+
"heapBytes": 46803240
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"repetition": 5,
|
|
104
|
+
"invocation": "repeat; fresh name scan",
|
|
105
|
+
"resolveMs": 147.09523799999988,
|
|
106
|
+
"registrationMs": 2.65529800000013,
|
|
107
|
+
"totalMs": 149.750536,
|
|
108
|
+
"ordinaryMs": 11.426179999999931,
|
|
109
|
+
"status": "ready",
|
|
110
|
+
"candidates": [
|
|
111
|
+
{
|
|
112
|
+
"identifier": "planSearchPresentation",
|
|
113
|
+
"matchCount": 10,
|
|
114
|
+
"complete": true
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"rssBytes": 195883008,
|
|
118
|
+
"heapBytes": 47151672
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"note": "First invocation is not a flushed OS cache. Resolve includes ordinary search, name collection and exact verification. Registration includes bounded snapshots. RSS includes imported runtime modules; it is not the vocabulary size and does not include child-process RSS."
|
|
122
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# LPT-393: zero-result fuzzy Search verification
|
|
2
|
+
|
|
3
|
+
Search can now suggest nearby identifier spellings after a complete zero-result search. This is a spelling fallback, not semantic search. No model, new dependency, service, or persistent index is needed.
|
|
4
|
+
|
|
5
|
+
## How to use it
|
|
6
|
+
|
|
7
|
+
Call Search as usual with an unquoted identifier and a useful scope:
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
search({ query: "generateHintStrings", path: "content_scripts/link_hints.js" });
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The original result stays empty. On the pinned Vimium fixture, two separate groups follow:
|
|
14
|
+
|
|
15
|
+
- `hintStrings`: remove the leading `generate` component; 5 exact spans.
|
|
16
|
+
- `generateHintString`: one character edit; 2 exact spans.
|
|
17
|
+
|
|
18
|
+
These counts are occurrences, not implementations. Read the suggested source before deciding which name is relevant. Local groups provide their own Search references. Each all-reference repeats only that exact spelling if the files change, not the fuzzy ranking. Individual references become stale normally.
|
|
19
|
+
|
|
20
|
+
Inside native Codemode, the original `data.matches` remains empty. Use `data.fuzzy.candidates`, inspect each `selection.complete`, and read its `selection.all.line` when available. `selection.truncated` only describes the three-location public preview, not capture completeness. URL groups instead provide the requested URL and line ranges, with no editable Search references.
|
|
21
|
+
|
|
22
|
+
The fallback applies only to suitable unquoted ASCII identifiers, 5–80 characters long, after the ordinary search completes with zero results. Quoted queries, Boolean queries, explicit protocols, nonzero results, and incomplete searches keep their existing behavior. Ranking puts case/separator normalization first, one missing or extra edge component next, and one character edit last. Digits are not corrected. Suggestions do not claim synonyms or equivalent behavior.
|
|
23
|
+
|
|
24
|
+
## User TUI and agent results are separate
|
|
25
|
+
|
|
26
|
+
The local Search card now reports `0 exact · 10 fuzzy matches · 4 files` for the repository typo case. Below it, each candidate has a mechanical reason and a bounded source preview: file, line number and highlighted code. The preview uses at most three captured spans per name, with short context around the first highlighted span of each line. Shared source files count once in the header. Incomplete totals carry `+`; compact panels keep their expansion hint.
|
|
27
|
+
|
|
28
|
+
These previews are private renderer metadata, not agent-facing text or structured data. The agent still receives the original zero and separate exact candidate groups with Read references. URL results keep their existing URL/line output; this user-requested card revision changes the native local/repository panel.
|
|
29
|
+
|
|
30
|
+
The screenshot that showed only `No matches` came from restoring the older global renderer before merging this branch. That older renderer does not understand the new groups. Live verification uses the branch loader; global deployment still requires acceptance and merge.
|
|
31
|
+
|
|
32
|
+
## Bounds and freshness
|
|
33
|
+
|
|
34
|
+
Local collection streams unique names using the ordinary ripgrep scope and ignore/glob rules. It does not retain all occurrences just to build a vocabulary. Every invocation scans fresh names; there is no cache to invalidate after edits or checkout changes.
|
|
35
|
+
|
|
36
|
+
- At most 20,000 unique names and 8 MiB of name-stream input.
|
|
37
|
+
- At most 5 candidate groups.
|
|
38
|
+
- Exact verification captures at most 200 spans and 4 MiB of output per candidate.
|
|
39
|
+
- Collection and verification share a two-second deadline. Registration has a separate two-second phase budget and bounded snapshot reads.
|
|
40
|
+
- Source-size checks bound candidate snapshots to 8 MiB across the captured sources; registration and refresh also retain byte limits.
|
|
41
|
+
- Budget skips and extra-branch failures preserve the original zero and explain why suggestions are unavailable. Parent cancellation still aborts the call.
|
|
42
|
+
- Incomplete groups have no complete all-reference. A source race can leave readable locations without stable references; the result explains this.
|
|
43
|
+
|
|
44
|
+
URL search reuses the already fetched and converted body, with an 8 MiB content budget. It does not fetch the URL again for each candidate.
|
|
45
|
+
|
|
46
|
+
## Measured file and repository cases
|
|
47
|
+
|
|
48
|
+
Measured with Node 24.20.0 on this checkout. Each scope ran once, then five more times with a fresh name scan. Total time includes the ordinary search, vocabulary scan, exact verification, and reference registration. The ordinary backend was measured separately as a baseline.
|
|
49
|
+
|
|
50
|
+
| Scope / query | First total | Median of five repeats | Ordinary median | Node RSS before calls | Peak Node RSS |
|
|
51
|
+
| -------------------------------------------- | ----------: | ---------------------: | --------------: | --------------------: | ------------: |
|
|
52
|
+
| Pinned Vimium file / `generateHintStrings` | 53.52 ms | 32.71 ms | 7.18 ms | 140.73 MiB | 152.41 MiB |
|
|
53
|
+
| Repository `src` / `planSearchPresentations` | 202.92 ms | 155.78 ms | 12.82 ms | 142.11 MiB | 247.20 MiB |
|
|
54
|
+
|
|
55
|
+
All six file runs returned the same 5/2 groups. All six repository runs returned `planSearchPresentation` with 10 exact spans. This repository case scans `src`, not every file in the repository.
|
|
56
|
+
|
|
57
|
+
The first call is not a flushed OS-cache measurement. RSS includes imported Node/runtime modules and process allocations, not just the vocabulary, and excludes child-process RSS. These are two measured cases, not a latency or memory guarantee for arbitrary repositories. Raw measurements: [file](lpt-393-fuzzy-results/file.json) and [repository](lpt-393-fuzzy-results/repo.json).
|
|
58
|
+
|
|
59
|
+
## Verification evidence
|
|
60
|
+
|
|
61
|
+
- 18 relevant unit files, 133 tests passed; focused type-aware lint passed.
|
|
62
|
+
- Four real-Pi integration files, 11 tests passed, covering fuzzy fallback, ordinary hybrid Search, web Search, and structured results. The two fuzzy integrations were rerun after the last renderer change and passed.
|
|
63
|
+
- Contracts cover query guards, scope/ignore rules, edits/removals/checkouts, byte and capture limits, cancellation, source races, bounded refresh, dollar identifier boundaries, typed results, and persisted rendering.
|
|
64
|
+
- Native local and URL Search plus native Codemode-to-Read were exercised after reloading the working extension. `hintStrings` Read returned four unique lines containing the five spans, including the method declaration at line 886.
|
|
65
|
+
- Actual `inspect_tui` captures of Herdr pane `w3GX:p1`, 123×108 cells, revision 147, live bottom: local groups showed both names, counts, reasons and locations without raw anchors or clipping. The URL compact result showed both names/counts and its expansion hint; remaining detail is available with Ctrl+O.
|
|
66
|
+
- After the user requested explicit fuzzy status and highlighted source previews, actual viewport captures of the same pane at revisions 606 and 635 showed the new `0 exact` header, distinct fuzzy/file totals, candidate names, file/line rows and highlighted code. Renderer persistence, bounded previews, partial totals, shared-file counting and isolation from agent output are covered by tests.
|
|
67
|
+
- Normal configured startup loaded exactly one IDE extension without errors or warnings, both with the temporary worktree loader and after restoring global loading. No model prompt was sent.
|
|
68
|
+
- Full source typecheck, package boundaries, machine-path check, catalog generation/check, public package build, and diff whitespace check passed.
|
|
69
|
+
- The effective Read/Search interface was exported and read completely. New workflow guidance lives in `docs:search-code`; callable parameter schemas are unchanged.
|
|
70
|
+
|
|
71
|
+
The temporary local settings/loader and local HTTP server were removed after verification. The global runtime was restored. The user explicitly accepted the feature after the live demo and a separate real-Pi recording of the card. Acceptance authorizes the PR into develop; it does not itself deploy the feature.
|
|
72
|
+
|
|
73
|
+
## Repeat the checks
|
|
74
|
+
|
|
75
|
+
```sh
|
|
76
|
+
pnpm exec vitest run src/extensions/pi-agent-search \
|
|
77
|
+
src/extensions/pi-agent-read/extensions/pi-agent-web/test/search.test.ts
|
|
78
|
+
pnpm exec pi-test run -- pnpm exec vitest run --config vitest.integration.config.mjs \
|
|
79
|
+
tests/integration/extensions/pi-agent-search/fuzzy-fallback.integration.test.ts
|
|
80
|
+
pnpm exec oxnode scripts/dev/check-normal-startup.ts
|
|
81
|
+
pnpm typecheck
|
|
82
|
+
pnpm check:boundaries
|
|
83
|
+
pnpm check:paths
|
|
84
|
+
pnpm docs:catalog
|
|
85
|
+
pnpm check:catalog
|
|
86
|
+
pnpm check:package
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
To repeat the measured cases, bundle the tracked profiler into the ignored temporary directory, then run each scope:
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
pnpm exec esbuild dev/performance/fuzzy-search.ts --bundle --platform=node \
|
|
93
|
+
--format=esm --target=node24 --external:@earendil-works/* \
|
|
94
|
+
--external:typebox --external:typebox/* --outfile=.tmp/fuzzy-verification/profile.mjs
|
|
95
|
+
node .tmp/fuzzy-verification/profile.mjs file
|
|
96
|
+
node .tmp/fuzzy-verification/profile.mjs repo
|
|
97
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Solution decision: accumulate sequential Codemode text edits
|
|
2
|
+
|
|
3
|
+
This records the original batching decision. LPT-403 later removed Apply without changing the native batching policy.
|
|
4
|
+
|
|
5
|
+
## Question
|
|
6
|
+
|
|
7
|
+
Should sequential editor calls in native Codemode share only original coordinates, or also one combined write, and where should that batch end?
|
|
8
|
+
|
|
9
|
+
## Decision
|
|
10
|
+
|
|
11
|
+
The user chose an original snapshot and one combined write, not immediate writes with coordinate translation.
|
|
12
|
+
|
|
13
|
+
Sequential text-edit calls accept checked changes into a pending batch. Before commit, their results must say the changes are accepted and not yet applied. They must not present a final written file or claim the operation is committed.
|
|
14
|
+
|
|
15
|
+
The batch ends before another tool runs or when the script finishes. A read, search or terminal call after edits must see committed files. Later edits start a new batch with a new snapshot. A mode of an editor tool that cannot join the text batch also needs a boundary before its own effects.
|
|
16
|
+
|
|
17
|
+
An ordinary script exception does not discard accepted independent edits. Finish those edits and report both their commit result and the script failure. A rejected operation does not become an accepted edit.
|
|
18
|
+
|
|
19
|
+
Do not replace or re-register native Codemode, change Apply exposure, bypass Pi's tool pipeline, or silently repair stale anchors by searching for similar text. Preserve the existing direct-call batch behavior.
|
|
20
|
+
|
|
21
|
+
The user approved end-to-end implementation after this discussion. Pending edits are discarded on abort or script deadline. The parent Codemode result reports final file effects separately from child acceptance, while preserving native child call IDs and results.
|
|
22
|
+
|
|
23
|
+
## Why
|
|
24
|
+
|
|
25
|
+
The user wants the same original-snapshot approach as the direct editor batch. Translating coordinates while writing after every call would preserve only part of that behavior. Waiting for future awaited calls would deadlock the script, so earlier calls must return before the combined write.
|
|
26
|
+
|
|
27
|
+
Flushing before another tool gives that tool real committed files rather than an invisible virtual workspace. Keeping accepted independent edits after an ordinary script error follows the user's explicit choice.
|
|
28
|
+
|
|
29
|
+
[Research and source evidence](native-codemode-batching.md) records the existing mechanisms and the unproven boundaries. The [sequential real-Pi suite](https://github.com/alexshpunt/pi-agent-ide/blob/develop/tests/integration/native-codemode.integration.test.ts) checks this contract against real files. The original red reproduction is preserved in commit de82738.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Context research: native Codemode edit batching
|
|
2
|
+
|
|
3
|
+
This records the investigation at revision ce8e0bc, before implementation. Keep its red-probe findings as historical evidence. The [solution decision](native-codemode-batch-decision.md) describes the agreed behavior; the linked suite now tests the implementation.
|
|
4
|
+
|
|
5
|
+
## Question
|
|
6
|
+
|
|
7
|
+
Can sequential calls to the existing editor tools share an original file snapshot and one combined write through native Pi Codemode, without replacing Codemode or bypassing Pi's tool pipeline?
|
|
8
|
+
|
|
9
|
+
## Findings
|
|
10
|
+
|
|
11
|
+
### Sequential calls currently write immediately
|
|
12
|
+
|
|
13
|
+
The real-Pi probe reads anchors, awaits an insertion, then awaits a replacement and a deletion using the original anchors. The insertion writes immediately. The replacement rejects its now-stale line anchor, so the deletion is never called. The real file contains only the insertion. The stale-anchor guard works; the requested sequential batch does not.
|
|
14
|
+
|
|
15
|
+
**Evidence:** [`native-codemode.integration.test.ts`](https://github.com/alexshpunt/pi-agent-ide/blob/de82738/tests/integration/native-codemode.integration.test.ts), revision `de82738`. `pnpm test:integration tests/integration/native-codemode.integration.test.ts` returned one failing test. Its stale-error and partial-file checks passed before the batch-success assertion failed.
|
|
16
|
+
|
|
17
|
+
### The current coordinator needs all calls before execution
|
|
18
|
+
|
|
19
|
+
`rewriteMessage()` discovers adjacent editor calls in an assistant message and builds a complete plan at `message_end`. `executeWithBatchCoordinator()` executes that plan once and splits its results between the original calls. A native Codemode message contains one script call, not the editor calls the script will later issue. Those child calls therefore have no precomputed plan.
|
|
20
|
+
|
|
21
|
+
`executeRegisteredTextBatch()` resolves each operation against the same text map, rejects overlapping edits and passes the combined changes to `core.editTexts()`.
|
|
22
|
+
|
|
23
|
+
**Evidence:** [`text-edit-batch-coordinator.ts`](../../src/extensions/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts), `rewriteMessage`, `ensureBatchExecution`, `executeWithBatchCoordinator`; [`text-edit-batch-registrar.ts`](../../src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts), `executeRegisteredTextBatch`.
|
|
24
|
+
|
|
25
|
+
### Waiting for future awaited calls would deadlock
|
|
26
|
+
|
|
27
|
+
Native Codemode awaits `ctx.executeTool()` and returns its outcome to the sandbox. In a sequential script, the next child call does not exist until the previous promise resolves. Holding the first promise open until the complete batch is known would stop the script from issuing the rest of the batch.
|
|
28
|
+
|
|
29
|
+
This means an accumulating batch must return a truthful acceptance result before the combined write. It cannot return the current final-file result from the first call.
|
|
30
|
+
|
|
31
|
+
**Evidence:** Pi `v0.99.1` [`execute.ts`](https://github.com/earendil-works/pi/blob/v0.99.1/packages/coding-agent/src/extensions/codemode/execute.ts), `executeCodemode`; [`native Codemode contract`](https://github.com/earendil-works/pi/blob/v0.99.1/packages/coding-agent/src/extensions/codemode/tool.ts).
|
|
32
|
+
|
|
33
|
+
### Public hooks expose the parent and child boundaries
|
|
34
|
+
|
|
35
|
+
Pi's `tool_call`, `tool_result` and `tool_execution_*` events carry `parentToolCallId` for nested calls. Child IDs belong to the calling tool, but the coordinator should use the parent field rather than parse the ID string. These hooks offer a place to associate editor invocations with a script and to finish pending work before another tool or the parent result is returned.
|
|
36
|
+
|
|
37
|
+
A `tool_result` handler can replace content, details and error status. Execution-end notifications alone are not a substitute for reporting a failed commit through the parent result. A hook that merely throws is also not sufficient: Pi reports handler failures and may continue.
|
|
38
|
+
|
|
39
|
+
The public events make this approach plausible. They do not prove a working deferred batch; no implementation or live commit-boundary probe has been added yet.
|
|
40
|
+
|
|
41
|
+
**Evidence:** Pi `v0.99.1` [`extension contracts`](https://github.com/earendil-works/pi/blob/v0.99.1/packages/coding-agent/docs/extensions.md), Tools and Errors and cleanup; [`event types`](https://github.com/earendil-works/pi/blob/v0.99.1/packages/coding-agent/src/core/extensions/types.ts); [`nested runner`](https://github.com/earendil-works/pi/blob/v0.99.1/packages/coding-agent/src/core/nested-tool-calls.ts).
|
|
42
|
+
|
|
43
|
+
### The editor already separates planning data from writing
|
|
44
|
+
|
|
45
|
+
Mutation registrations return `TextChange` entries and optional `afterWrite` actions. The existing batch path gathers those changes before writing. `core.editTexts()` prepares resources, resolves anchors, applies combined changes, runs mutation guards and writes through the owning resource resolvers under its mutation queue.
|
|
46
|
+
|
|
47
|
+
A deferred batch can reuse these mechanisms, but the existing executor is not an appendable session. Planning must be separated from committing. Accepted operations should not be rerun to rebuild their plans at commit: that could repeat plugin work or change which selection was accepted. Resource content must be checked again at commit so external changes do not get overwritten.
|
|
48
|
+
|
|
49
|
+
Not every invocation of an editor-named tool is a text edit. Direct transactions, whole-file operations and semantic resource actions have separate execution paths. They cannot be silently treated as ordinary queued text changes.
|
|
50
|
+
|
|
51
|
+
**Evidence:** [`mutation-tool.ts`](../../src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts), `TextMutation`, `TextMutationToolRegistration`; [`text-mutation.ts`](../../src/extensions/pi-agent-text-editor/src/core/text-mutation.ts), `createTextTool`; [`text-editor-core.ts`](../../src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts), `editTexts`, `editTextResources`; [`batch registrar`](../../src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts), `expectedContent` checks and `textChangesConflict`.
|
|
52
|
+
|
|
53
|
+
### Final processing can reuse an existing scope, but it is not a pending-write batch
|
|
54
|
+
|
|
55
|
+
`createPostEditScope()` already collects final processing per resource. Its writes remain immediate, so using it alone would not fix the failing snapshot test. It is a possible reuse point for formatting and notifications after a combined write, not a replacement for the batch planner.
|
|
56
|
+
|
|
57
|
+
**Evidence:** [`post-edit-scope.ts`](../../src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts), `createPostEditScope`; [`Apply execution`](https://github.com/alexshpunt/pi-agent-ide/blob/c4ccbf9e8620976b5130e6f351f2678ce1d1a067/src/extensions/pi-agent-text-editor/src/core/apply/execution.ts), `finish`. This is an internal reuse observation, not a request to make Apply callable from Codemode.
|
|
58
|
+
|
|
59
|
+
### Some failure boundaries still need proof
|
|
60
|
+
|
|
61
|
+
Deferred work changes when disk failures can reach the script. A child promise can report acceptance, while a later commit may fail. The parent result must distinguish accepted, applied and rejected operations; child success alone cannot mean the file was written.
|
|
62
|
+
|
|
63
|
+
Native Codemode records successful script store writes before returning its own result. Finalizing edits in a later parent-result hook cannot assume those store writes are rolled back if the edit commit fails. Cancellation also differs from an ordinary JavaScript exception: queued work must not silently keep writing after an aborted parent. Concurrent scripts, interrupted child work and cleanup need dedicated runtime checks before this direction can be called safe.
|
|
64
|
+
|
|
65
|
+
**Evidence:** Pi `v0.99.1` [`execute.ts`](https://github.com/earendil-works/pi/blob/v0.99.1/packages/coding-agent/src/extensions/codemode/execute.ts), sandbox result handling and `appendEntry`; [`nested runner`](https://github.com/earendil-works/pi/blob/v0.99.1/packages/coding-agent/src/core/nested-tool-calls.ts), nested call lifetime. These cases are not covered by the existing sequential probe.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Native IDE results
|
|
2
|
+
|
|
3
|
+
Read, Search, text mutations, diff, Git index tools, and debugger creation declare an `outputSchema` and return `structuredContent`. Native Codemode receives that object. Normal calls keep their readable content and existing renderers. Renderer `details` are not a script API.
|
|
4
|
+
|
|
5
|
+
The shared envelope is:
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
{ status: "success", data: /* tool data */, errors: [] }
|
|
9
|
+
{ status: "error" | "partial", data?: /* observed data */, errors: [{ code, message, source? }] }
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
`success` means the requested operation completed, including a search with no matches. `partial` means some work completed while other work failed. Output clipping is reported separately; it does not make a successful read an execution failure. `error` and `partial` set native `isError`.
|
|
13
|
+
|
|
14
|
+
Check `status` before using data. Domain errors with structured results resolve in native Codemode; they do not automatically throw. Invalid arguments, blocked calls, and cancellation can still reject. A mutation error does not imply rollback. Check its observed effects before retrying.
|
|
15
|
+
|
|
16
|
+
## Data by tool
|
|
17
|
+
|
|
18
|
+
- **Read:** `kind` is `text`, `bytes`, `native`, or `resources`. Text has original numbered `lines`, line endings, optional editable `anchors`, and source-level `references`. Bytes have exact `bytes: number[]`, byte offset, selected length, and total size. Native content has ordered text/image `blocks`; pass an image block to `image(...)`. Multi-source selections keep separate child resources.
|
|
19
|
+
- **Search:** `matches` have a source, exact line/column range, optional matched text, and optional `references.line` / `references.match` selectors. Columns are zero-based UTF-16 offsets. `complete` describes the backend search; `truncated` describes the public window. `all` selectors exist only for complete registered selections. File searches return paths. Other resolvers return their documented JSON domain data under `kind: "custom"`.
|
|
20
|
+
- **Mutations:** `operationId` identifies the call. `effect` and per-source `files` distinguish `pending`, `applied`, `not-applied`, and `unknown`. Recovery candidates and semantic action fields are included when available. `files[].state` reports present/absent/unknown when known. `changes` records exact removed/inserted text and before-snapshot UTF-16 offsets; it is inspection data, not a selector. If that record exceeds 512 KiB serialized, it is omitted with `changesUnavailable`, without clipping text or losing applied effects. Full before/after documents are not copied into receipts.
|
|
21
|
+
- **Flush:** `operations` link final effects and errors to accepted child call IDs. It also returns per-source effects. An empty flush succeeds with no operations. A failed flush retains writes that happened and never replays accepted edits.
|
|
22
|
+
- **Diff:** returns source identities, equality, added/removed counts, and bounded unified diff text. It does not repeat both source documents.
|
|
23
|
+
- **Git index tools:** return action, change selector, file, index state, observed effect, and whether it was already in the requested state.
|
|
24
|
+
- **Debugger:** creation returns session, source, and breakpoint resource references plus configuration and status. Debugger mutation actions return selected breakpoint or evaluation fields, not full session snapshots.
|
|
25
|
+
|
|
26
|
+
## Source result composition
|
|
27
|
+
|
|
28
|
+
Exact filesystem text Read results and local text/regex, AST, and LSP Search results expose an optional `target: "RESULT#..."`. Each public Search match also has its own target. These handles resolve backend-owned source ranges and snapshots; serializable preview fields do not grant or change write authority.
|
|
29
|
+
|
|
30
|
+
Native `search.path`, `replace.path`, `delete.path`, and copy/move `path` / `target` accept a successful result envelope, its data, a target handle, or arrays of compatible results/matches. `write.path` and `undo.file` accept only a single whole-file target; partial scopes never widen to a whole file. A whole result retains its complete stored scope even when its public window is shortened. Pass a matches array to narrow the scope explicitly. Read lines projected to strings or arbitrary coordinates are not editable targets.
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
const read = await tools.read({ path: "note.txt", offset: 2, limit: 2 });
|
|
34
|
+
if (read.status !== "success") throw new Error(JSON.stringify(read.errors));
|
|
35
|
+
const found = await tools.search({ path: read, query: "old" });
|
|
36
|
+
if (found.status !== "success") throw new Error(JSON.stringify(found.errors));
|
|
37
|
+
const changed = await tools.replace({ path: found.data.matches.slice(0, 1), text: "new" });
|
|
38
|
+
if (changed.status !== "success") throw new Error(JSON.stringify(changed.errors));
|
|
39
|
+
text(changed);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Targets belong to the active session/runtime and worktree. A new session, reload or shutdown clears the store. Changing any source bytes makes a non-empty retained target stale; re-read or re-search rather than refreshing implicitly. Existing string `SEARCH#:all` selectors retain their separate refresh policy.
|
|
43
|
+
|
|
44
|
+
Scoped text Search runs each range separately through ripgrep and maps matches back to source UTF-16 coordinates. AST and LSP providers can inspect full documents internally but return only provider ranges wholly contained in one declared region. AST matches expose associated `captures.NAME` arrays of source targets, including every node of a multi capture. LSP matches expose `role` and the originating `symbol` with its provider declaration identity and exact range. Use `navigation: "references"` explicitly to follow symbols represented in the seed scope to references outside it, within the workspace. It preserves inherited completeness and deduplicates by source/range identity. Text Boolean queries and text include/exclude globs remain unsupported for result scopes; AST/LSP keep their provider filters. Unsupported provider/scope combinations fail without falling back to a wider search. Replace rejects incomplete input and contradictory snapshot versions before writing, preserves ordinary resource and mutation guards, and treats an empty set as an explicit successful no-op. Preview edits, deleted diff text, bytes, images and derived views without an exact filesystem mapping cannot supply arbitrary edit targets.
|
|
45
|
+
|
|
46
|
+
### Possible-name groups
|
|
47
|
+
|
|
48
|
+
After a complete zero result, eligible local and URL identifier searches can add `fuzzy: { status, message?, candidates }`. The original `matches` stays empty. Each candidate has `identifier`, a mechanical `kind` and `reason`, captured `matchCount` and `fileCount`, and a separate `selection` using the normal match/range/reference fields.
|
|
49
|
+
|
|
50
|
+
Candidate selections show at most three locations. Their `truncated` flag describes that display window; `complete` describes the exact alternative's capture. Limited capture has lower-bound counts and no complete `all` reference. URL candidates use URL ranges, never editable Search references. A `skipped` branch explains its budget or extra-branch failure without changing the completed ordinary zero into an error.
|
|
51
|
+
|
|
52
|
+
Registered local candidate selections also expose immutable whole-scope and per-match targets. Their stored scope retains all captured matches even when the candidate preview shows only three. The original zero result remains an empty edit scope. Structured result-scoped queries do not run fuzzy discovery.
|
|
53
|
+
|
|
54
|
+
## Native editor commits
|
|
55
|
+
|
|
56
|
+
Sequential local edits share original snapshots. Child success with `effect: "pending"` means accepted, not written. Await an explicit flush when the script needs the final receipt:
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
const found = await tools.search({ query: "old", path: "note.txt" });
|
|
60
|
+
if (found.status !== "success") throw new Error(found.errors[0].message);
|
|
61
|
+
const changed = await tools.replace({ path: found.data.matches[0].references.match, text: "new" });
|
|
62
|
+
if (changed.status !== "success") throw new Error(changed.errors[0].message);
|
|
63
|
+
const saved = await tools.flush({});
|
|
64
|
+
text(saved);
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Resource-owned selectors may commit immediately rather than joining the local batch. Another tool or parent completion also commits pending local edits. The parent Codemode result records automatic commits in `details.editorBatchResults`; those reports contain receipts, not source snapshots. Ordinary script errors keep accepted independent edits. Abort and deadline discard pending edits but do not undo earlier commits.
|
|
68
|
+
|
|
69
|
+
## Bounds and continuation
|
|
70
|
+
|
|
71
|
+
Public structured results must be finite plain JSON and fit within 1 MiB. Text windows keep at most 2,000 lines and 512 KiB of serialized line data. Raw byte windows keep at most 32,768 bytes, within the normal raw-read display budget. Ordinary Search match previews keep the first 100 matches and at most 4 KiB of matched text per match; a whole result's target retains its full registered scope. AST capture arrays retain every captured node for each visible parent match, within the shared JSON budget. Huge indivisible capture data fails explicitly rather than silently dropping nodes.
|
|
72
|
+
|
|
73
|
+
Read `continuation` is a complete next request with a resolved source and absolute offset. Follow it rather than recomputing offsets from a rendered annotation. `fullResult` identifies retained complete output when available. A huge indivisible block or invalid adapter returns an explicit error rather than a clipped success. Temporary references belong to their runtime.
|
|
74
|
+
|
|
75
|
+
Native structured content is not copied into stored session messages. Existing compact renderer details stay separate. Scripts that explicitly print large data still store what they print.
|
|
76
|
+
Guides attached to native structured child calls stay on the readable parent result, even when the script prints only selected data. They do not become fields in the public data schema.
|
|
77
|
+
|
|
78
|
+
## Resolver adapters
|
|
79
|
+
|
|
80
|
+
Search resolvers must provide `toScriptData(payload, formattedDetails)`. Select documented JSON domain fields or use `selectionData` from `pi-agent-search/api/search`. Missing adapters fail with `STRUCTURED_ADAPTER_REQUIRED`; invalid schema or non-JSON values fail with `INVALID_STRUCTURED_RESULT`. Neither case falls back to display-text parsing or raw payload dumping.
|
|
81
|
+
|
|
82
|
+
Standard Read Resources use the core text/bytes/native projection. Read handlers that return their own result must supply `script: ReadScriptData`; custom content needs an explicit supported projection. Source-level references and line anchors come from presenters, not parsed annotations.
|
|
83
|
+
|
|
84
|
+
The shared validation helpers live in `pi-agent-resource`. Read and Search export their data/output schemas through their existing public tool APIs. Text mutation schemas and `structuredMutation` are exported through `pi-agent-text-editor/api/mutation-result`.
|
|
85
|
+
|
|
86
|
+
Shell command results keep their separate native process contract. This change does not add a shared result store, cross-session handles, binary editing, or grouped rollback.
|
package/docs/tools.md
CHANGED
|
@@ -4,6 +4,10 @@ Pi Agent IDE explores a small tool surface for coding agents. The goal is to kee
|
|
|
4
4
|
|
|
5
5
|
The project is experimental. The behavior below describes the current implementation, not a performance guarantee.
|
|
6
6
|
|
|
7
|
+
## Native structured results
|
|
8
|
+
|
|
9
|
+
IDE tools declare native result schemas. Codemode receives typed data and explicit success/error/partial outcomes instead of display strings. Check status and mutation effects before continuing or retrying. See [Native IDE results](./structured-results.md) for fields, resolver adapters, bounds, and `tools.flush({})`.
|
|
10
|
+
|
|
7
11
|
## Resource references
|
|
8
12
|
|
|
9
13
|
Tool source fields take one complete resource reference. A filesystem path is the common case, but it is not the only kind of reference. Depending on the tool and loaded resolvers, a reference may name a file, URL, protocol source, temporary result, or a typed text selection.
|
|
@@ -48,7 +52,7 @@ When `path` is a typed text resource, `read` returns one independent chunk for e
|
|
|
48
52
|
|
|
49
53
|
Use `read({path: "raw:sample.bin", offset: 0, limit: 64})` to inspect original local file bytes, including PDF and image headers. In `raw:` mode only, offset is zero-based in bytes (negative from EOF), and limit is a non-negative byte count. The output shows hexadecimal offsets, hex bytes, and printable ASCII. Follow its returned byte offset to continue. No views or text anchors apply.
|
|
50
54
|
|
|
51
|
-
Inside
|
|
55
|
+
Inside native Codemode, check the result’s `status` and use `data.kind: "bytes"`, `source`, `byteOffset`, `byteLength`, `totalBytes` and `bytes: number[]`. The script receives the complete selected range; the displayed answer stays bounded. Use `text(result)` to retain the hex view rather than printing the byte array. This is read-only; byte editing and byte diff are not included.
|
|
52
56
|
|
|
53
57
|
### Diagnostic completion
|
|
54
58
|
|
|
@@ -72,14 +76,26 @@ Window and display capture use `node-screenshots` on Linux and macOS. Desktop or
|
|
|
72
76
|
|
|
73
77
|
## Terminal sessions
|
|
74
78
|
|
|
75
|
-
`
|
|
79
|
+
Native Codemode scripts receive a structured shell result. `output` holds up to 1 MiB of ANSI-free PTY output; empty output is `""`. Longer logs keep their first and last 512 KiB, cut at UTF-8 character boundaries. `truncated` reports missing output, not whether the process has finished. `output_ranges` gives the zero-based, end-exclusive byte ranges joined into `output`, with no added headings or omission marker. `full_output_path` points to the UTF-8 log, which keeps growing while the process runs and stays available until the session is deleted.
|
|
80
|
+
|
|
81
|
+
The native fields `exit_code` and `wall_time_seconds` describe the process, not tool transport. `exit_code` is absent until known. IDE fields `session`, `source`, `status`, `background`, `wait_reason`, `completion_reason`, `signal`, and `error` describe the persistent session. A wait timeout leaves a running session, not a failed command. Nonzero exits and shell startup failures still return structured data to scripts. Normal model output and stored renderer details keep the shorter terminal preview limits.
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
const result = await tools.bash({ command: "your-command" });
|
|
85
|
+
text({
|
|
86
|
+
status: result.status,
|
|
87
|
+
errors: result.output.split("\n").filter((line) => line.includes("error")),
|
|
88
|
+
});
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
`bash` (Linux/WSL) or `powershell` (Windows) starts a command in the user's configured system shell. Its schema and prompt guidance name that shell at runtime, so the agent writes Bash, zsh, PowerShell, or Command Prompt syntax as appropriate. Commands are not translated between shell languages.
|
|
76
92
|
|
|
77
93
|
Every run returns a stable `shell:<session>` source. Synchronous runs wait for the real exit status. Background runs return immediately, remain visible below the editor, and send one completion message that wakes the agent; nearby completions are combined without losing individual results. `/terminals` opens the active and recent session overlay.
|
|
78
94
|
The UI tab in `/agent-ide-settings` controls persistent active-terminal presentation: Detailed cards (default), Compact count, or Off. Detailed cards replace the separate active count instead of showing both. This setting does not hide ordinary run results or completion messages.
|
|
79
95
|
|
|
80
|
-
Use `read` on the returned source for status and bounded output. Compact cards show the latest 12 output rows and count omitted earlier rows; expanded cards show all retained rows. Add `views: ["image"]` to receive a PNG of the ANSI-aware virtual terminal screen. Use `write` to send exact text without Enter. Use `insert` for named keys and chords such as `Enter`, `Ctrl+C`, `Ctrl+Shift+Left`, or Unix caret controls such as `^U`; separate multiple keys with spaces or commas.
|
|
96
|
+
Use `read` on the returned source for status and bounded output. Compact cards show the latest 12 output rows and count omitted earlier rows; expanded cards show all retained rows. Add `views: ["image"]` to receive a PNG of the ANSI-aware virtual terminal screen. Use `write` to send exact text without Enter. Use `insert` for named keys and chords such as `Enter`, `Ctrl+C`, `Ctrl+Shift+Left`, or Unix caret controls such as `^U`; separate multiple keys with spaces or commas. A native Codemode script can send several terminal inputs without file formatting or diagnostics. Use `search` with the `shell:<session>` path to search retained output, including rows outside the current screen. `delete` terminates the owned process tree when needed, disposes the virtual screen, and removes the session. `replace` does not apply to terminal sessions.
|
|
81
97
|
|
|
82
|
-
Deleting an active session first requests graceful termination, then forcefully terminates its process tree after the grace period. Deletion does not undo file or network effects. Sessions
|
|
98
|
+
Deleting an active session first requests graceful termination, then forcefully terminates its process tree after the grace period. Deletion does not undo file or network effects. Sessions survive extension reloads in the current Pi process. Shutdown stops live processes; sessions are not reattached after restart.
|
|
83
99
|
|
|
84
100
|
## Search
|
|
85
101
|
|
|
@@ -92,6 +108,10 @@ A resolver decides whether it understands a query. The first successful resolver
|
|
|
92
108
|
|
|
93
109
|
Local text search tries literal terms first. If there are no matches, it retries unquoted terms as regex. If that also finds nothing, an ordinary multi-word query falls back to separate words. Each fallback is reported. Invalid optional regex is skipped, while I/O errors, cancellation, and regex runtime errors stay errors. `regex:<pattern>` forces regex-only matching and reports invalid patterns.
|
|
94
110
|
|
|
111
|
+
After all ordinary attempts finish with zero matches, a single unquoted ASCII identifier can return separate possible-name groups. They cover naming-style changes, one extra or missing edge component, and small typos, strongest first. Each name is verified exactly in the same scope. These are spelling suggestions, not synonyms, automatic corrections, or proof of equivalent behavior. Quoted, Boolean, explicit regex and other protocol queries do not use this branch.
|
|
112
|
+
|
|
113
|
+
Local groups provide current Read selections; a complete candidate all-reference refreshes only its exact alternative. URL groups reuse the already converted page text and provide URL line ranges without editable Search references. Name collection, capture and output have fixed budgets; a skip or limited capture is explicit. Narrow the scope if a budget is reached.
|
|
114
|
+
|
|
95
115
|
Boolean queries keep their conditions across literal and regex attempts. They support uppercase `AND`, `OR`, infix `NOT`, `||`, and space-separated `|`. Adjacent terms imply `AND`; `AND` and `NOT` bind more tightly than `OR`. Parentheses containing Boolean operators group conditions. Regex groups, classes, and escapes stay inside terms: `(?:foo|bar)\d+ AND "keep.me" NOT ignored`. An unspaced `foo|bar` is searched as literal text first, then as regex alternatives. Single or double quotes keep a term literal in every attempt. Quoted and Boolean queries never fall back to separate words. Invalid Boolean expressions report the source column and expected syntax.
|
|
96
116
|
|
|
97
117
|
Empty protocol queries such as `symbols:` and unhandled prefixes such as `unknown:needle` search their original text, including the prefix. The tool reports this fallback. Nonempty installed protocols keep their specialized behavior; service errors, timeouts, and successful protocol searches with no results do not launch local text search. Plugins mark a local fallback resolver with `fallback: true`; these resolvers run after specialists regardless of numeric priority and receive empty protocol queries directly.
|