pi-agent-ide 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/dist/chunk-6U5OU77O.js +3 -0
- package/dist/{chunk-6CZO43OH.js → chunk-BU7IZLKB.js} +1 -1
- package/dist/chunk-EURHXLN3.js +2 -0
- package/dist/{chunk-PYPPV2F5.js → chunk-F6IWZKOG.js} +6 -6
- package/dist/{chunk-GBLKIB6O.js → chunk-H445SHSJ.js} +2 -2
- package/dist/chunk-IG56UGSO.js +2 -0
- package/dist/chunk-IICJXZBU.js +6 -0
- package/dist/{chunk-XYS4FSCC.js → chunk-IM24DB3K.js} +1 -1
- package/dist/{chunk-YRF7OATP.js → chunk-KOVPDKSJ.js} +1 -1
- package/dist/chunk-MXLSGMRZ.js +3 -0
- package/dist/chunk-NRZO5KJT.js +9 -0
- package/dist/chunk-OB46OPMZ.js +1 -0
- package/dist/chunk-PKSQT6TC.js +1 -0
- package/dist/{chunk-PNU3E7IO.js → chunk-Q6CZ6GBR.js} +2 -2
- package/dist/{chunk-EDURPQAV.js → chunk-QRJLIV6P.js} +6 -6
- package/dist/chunk-QUYXINGZ.js +7 -0
- package/dist/{chunk-OBNING2A.js → chunk-S5PL5DFQ.js} +1 -1
- package/dist/chunk-SBP3ABH4.js +5 -0
- package/dist/{chunk-FXNKMNSJ.js → chunk-SJ4UZ4GU.js} +1 -1
- package/dist/chunk-SNF7PDDX.js +11 -0
- package/dist/{chunk-AJRIASPQ.js → chunk-STBJO3Z3.js} +1 -1
- package/dist/{chunk-3HYXQ4YA.js → chunk-TQGE7RH6.js} +13 -13
- package/dist/{chunk-S5LXX32D.js → chunk-XDG7EQRN.js} +3 -3
- package/dist/{chunk-F5YZG77W.js → chunk-XH5WN5XA.js} +1 -1
- package/dist/chunk-YWQS33DF.js +1 -0
- package/dist/chunk-ZIWPKIBZ.js +1 -0
- package/dist/entry-11.js +1 -1
- package/dist/entry-13.js +1 -1
- package/dist/entry-14.js +1 -1
- package/dist/entry-15.js +1 -1
- package/dist/entry-17.js +1 -1
- package/dist/entry-25.js +2 -2
- package/dist/entry-26.js +1 -1
- package/dist/entry-27.js +2 -2
- package/dist/entry-28.js +1 -1
- package/dist/entry-29.js +1 -1
- package/dist/entry-31.js +15 -13
- package/dist/entry-33.js +2 -1
- package/dist/entry-37.js +6 -6
- package/dist/entry-41.js +1 -1
- package/dist/entry-42.js +1 -1
- package/dist/entry-43.js +1 -1
- package/dist/entry-44.js +1 -1
- package/dist/entry-45.js +20 -13
- package/dist/entry-46.js +1 -1
- package/dist/entry-49.js +1 -1
- package/dist/entry-50.js +1 -1
- package/dist/entry-51.js +8 -7
- package/dist/entry-52.js +1 -1
- package/dist/entry-53.js +1 -1
- package/dist/entry-54.js +1 -1
- package/dist/entry-56.js +1 -1
- package/dist/entry-57.js +1 -1
- package/dist/entry-58.js +1 -1
- package/dist/entry-60.js +1 -1
- package/dist/entry-62.js +1 -1
- package/dist/entry-65.js +1 -1
- package/dist/entry-66.js +1 -1
- package/dist/entry-68.js +1 -1
- package/dist/entry-70.js +1 -1
- package/dist/entry-75.js +1 -1
- package/dist/entry-77.js +51 -43
- package/dist/entry-78.js +14 -14
- package/dist/entry-79.js +1 -1
- package/dist/entry-80.js +1 -1
- package/dist/entry-82.js +5 -5
- package/dist/entry-83.js +1 -1
- package/dist/entry-84.js +1 -1
- package/dist/entry-85.js +1 -1
- package/dist/entry-86.js +1 -1
- package/dist/pi-agent-ide.js +37 -9
- package/docs/agent-guides/editing.md +35 -46
- package/docs/agent-guides/git-changes.md +10 -0
- package/docs/agent-guides/read-resources.md +9 -50
- package/docs/agent-guides/search-code.md +18 -17
- package/docs/agent-guides/select-code.md +62 -140
- package/docs/agent-guides/terminal.md +9 -1
- package/docs/configuration.md +1 -1
- package/docs/releases.md +4 -0
- package/docs/research/native-codemode-batch-decision.md +2 -0
- package/docs/structured-results.md +27 -62
- package/docs/tools.md +15 -11
- package/node_modules/pi-agent-doctor/package.json +1 -1
- package/node_modules/pi-agent-documentation/package.json +1 -1
- package/node_modules/pi-agent-filesystem/index.ts +7 -6
- package/node_modules/pi-agent-filesystem/package.json +7 -7
- package/node_modules/pi-agent-filesystem-image/package.json +3 -3
- package/node_modules/pi-agent-filesystem-jq/index.ts +4 -3
- package/node_modules/pi-agent-filesystem-jq/package.json +5 -5
- package/node_modules/pi-agent-filesystem-jq/src/jq.ts +4 -1
- package/node_modules/pi-agent-filesystem-pdf/package.json +3 -3
- package/node_modules/pi-agent-filesystem-text/package.json +3 -3
- package/node_modules/pi-agent-ide-ast/package.json +13 -13
- package/node_modules/pi-agent-ide-ast/src/extension.ts +5 -4
- package/node_modules/pi-agent-ide-ast/src/overflow-handler.ts +2 -2
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +35 -9
- package/node_modules/pi-agent-ide-ast/src/select-presentation.ts +1 -1
- package/node_modules/pi-agent-ide-ast/src/select-schema.ts +10 -8
- package/node_modules/pi-agent-ide-ast/src/tool-select.ts +28 -3
- package/node_modules/pi-agent-ide-changes/index.ts +4 -3
- package/node_modules/pi-agent-ide-changes/package.json +8 -8
- package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +66 -4
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +8 -11
- package/node_modules/pi-agent-ide-formatter/package.json +3 -3
- package/node_modules/pi-agent-ide-languages/package.json +2 -2
- package/node_modules/pi-agent-ide-lint/package.json +7 -7
- package/node_modules/pi-agent-ide-lsp/index.ts +3 -3
- package/node_modules/pi-agent-ide-lsp/package.json +9 -9
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +5 -2
- package/node_modules/pi-agent-image/package.json +2 -2
- package/node_modules/pi-agent-invariant/package.json +1 -1
- package/node_modules/pi-agent-pdf/package.json +2 -2
- package/node_modules/pi-agent-read/package.json +7 -7
- package/node_modules/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/node_modules/pi-agent-read/src/api/read-parameters.ts +38 -1
- package/node_modules/pi-agent-read/src/api/tools/read.ts +18 -1
- package/node_modules/pi-agent-read/src/core/extension.ts +8 -2
- package/node_modules/pi-agent-read/src/core/read-core.ts +54 -35
- package/node_modules/pi-agent-read/src/core/tools/read/output-truncation.ts +91 -18
- package/node_modules/pi-agent-read/src/core/tools/read/raw-read.ts +8 -2
- package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +38 -1
- package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +57 -2
- package/node_modules/pi-agent-read/src/core/tools/read/structured-result.ts +3 -3
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +108 -46
- package/node_modules/pi-agent-resource/package.json +1 -1
- package/node_modules/pi-agent-resource/src/index.ts +1 -0
- package/node_modules/pi-agent-resource/src/result-targets.ts +186 -9
- package/node_modules/{pi-agent-read/src/core/tools/read → pi-agent-resource/src}/temp-resource-store.ts +17 -7
- package/node_modules/pi-agent-resource/src/tool-result.ts +13 -1
- package/node_modules/pi-agent-search/package.json +5 -5
- package/node_modules/pi-agent-search/src/api/fuzzy.ts +5 -1
- package/node_modules/pi-agent-search/src/api/search-parameters.ts +3 -3
- package/node_modules/pi-agent-search/src/core/extension.ts +2 -1
- package/node_modules/pi-agent-search/src/core/search-core.ts +13 -4
- package/node_modules/pi-agent-search-text/index.ts +1 -1
- package/node_modules/pi-agent-search-text/package.json +7 -7
- package/node_modules/pi-agent-search-text/src/resolvers.ts +11 -1
- package/node_modules/pi-agent-search-text/src/scoped-search.ts +1 -1
- package/node_modules/pi-agent-search-text/src/search-presentation.ts +42 -32
- package/node_modules/pi-agent-search-text/src/search-recipe.ts +1 -1
- package/node_modules/pi-agent-search-text/src/search-renderer.ts +6 -0
- package/node_modules/pi-agent-search-text/src/search-result.ts +17 -3
- package/node_modules/pi-agent-text/package.json +2 -2
- package/node_modules/pi-agent-text-anchor-constant/package.json +3 -3
- package/node_modules/pi-agent-text-anchor-exact/index.ts +65 -4
- package/node_modules/pi-agent-text-anchor-exact/package.json +3 -3
- package/node_modules/pi-agent-text-anchor-exact/src/anchor.ts +12 -2
- package/node_modules/pi-agent-text-anchor-line-hash/index.ts +4 -3
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +5 -5
- package/node_modules/pi-agent-text-editor/package.json +9 -9
- package/node_modules/pi-agent-text-editor/src/api/edit-completion.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +2 -1
- package/node_modules/pi-agent-text-editor/src/api/native-edit-batch-event.ts +4 -0
- package/node_modules/pi-agent-text-editor/src/api/stale-anchor-message.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +54 -12
- package/node_modules/pi-agent-text-editor/src/core/editing-guidelines.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +10 -3
- package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +3 -13
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +35 -6
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +19 -1
- package/node_modules/pi-agent-text-editor/src/core/mutation-result-targets.ts +132 -11
- package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +232 -144
- package/node_modules/pi-agent-text-editor/src/core/post-edit-scope.ts +34 -10
- package/node_modules/pi-agent-text-editor/src/core/result-input.ts +24 -4
- package/node_modules/pi-agent-text-editor/src/core/result-transfer.ts +7 -2
- package/node_modules/pi-agent-text-editor/src/core/structured-result.ts +49 -214
- package/node_modules/pi-agent-text-editor/src/core/text-change-engine.ts +5 -1
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +152 -22
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +4 -0
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +76 -32
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +409 -209
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +6 -9
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +10 -3
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +9 -4
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +7 -8
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +3 -4
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +10 -4
- package/node_modules/pi-agent-text-editor-renderer/package.json +5 -5
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +11 -0
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +54 -5
- package/node_modules/pi-agent-text-editor-renderer/src/status-summary.ts +18 -3
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +4 -4
- package/node_modules/pi-agent-tool-call-interception/package.json +2 -2
- package/node_modules/pi-agent-tool-call-interception/src/index.ts +3 -0
- package/node_modules/pi-agent-tool-ui/package.json +1 -1
- package/node_modules/pi-agent-web/index.ts +4 -3
- package/node_modules/pi-agent-web/package.json +7 -7
- package/node_modules/pi-agent-web/src/resolver.ts +11 -13
- package/node_modules/pi-agent-web-html/package.json +2 -2
- package/node_modules/pi-agent-web-image/package.json +3 -3
- package/node_modules/pi-agent-web-pdf/package.json +3 -3
- package/node_modules/pi-agent-web-text/package.json +3 -3
- package/package.json +35 -35
- package/src/composite/nested-tool-rendering.ts +64 -6
- package/src/composite/output-limits.ts +125 -0
- package/src/composite/responses-tools.ts +25 -0
- package/src/composite/text-results.ts +372 -0
- package/src/documentation/extension.ts +11 -9
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +7 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/index.ts +4 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +5 -5
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/src/jq.ts +4 -1
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +4 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +7 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +2 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/resolver.ts +11 -13
- package/src/extensions/pi-agent-read/package.json +7 -7
- package/src/extensions/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/src/extensions/pi-agent-read/src/api/read-parameters.ts +38 -1
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +18 -1
- package/src/extensions/pi-agent-read/src/core/extension.ts +8 -2
- package/src/extensions/pi-agent-read/src/core/read-core.ts +54 -35
- package/src/extensions/pi-agent-read/src/core/tools/read/output-truncation.ts +91 -18
- package/src/extensions/pi-agent-read/src/core/tools/read/raw-read.ts +8 -2
- package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +38 -1
- package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +57 -2
- package/src/extensions/pi-agent-read/src/core/tools/read/structured-result.ts +3 -3
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +108 -46
- package/src/extensions/pi-agent-search/package.json +5 -5
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +1 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +7 -7
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +11 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/scoped-search.ts +1 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-presentation.ts +42 -32
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +1 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +6 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +17 -3
- package/src/extensions/pi-agent-search/src/api/fuzzy.ts +5 -1
- package/src/extensions/pi-agent-search/src/api/search-parameters.ts +3 -3
- package/src/extensions/pi-agent-search/src/core/extension.ts +2 -1
- package/src/extensions/pi-agent-search/src/core/search-core.ts +13 -4
- package/src/extensions/pi-agent-text-editor/package.json +9 -9
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +3 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.ts +65 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +3 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/anchor.ts +12 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +4 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +11 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +54 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/status-summary.ts +18 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +4 -4
- package/src/extensions/pi-agent-text-editor/src/api/edit-completion.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +2 -1
- package/src/extensions/pi-agent-text-editor/src/api/native-edit-batch-event.ts +4 -0
- package/src/extensions/pi-agent-text-editor/src/api/stale-anchor-message.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +54 -12
- package/src/extensions/pi-agent-text-editor/src/core/editing-guidelines.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +10 -3
- package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +3 -13
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +35 -6
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +19 -1
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result-targets.ts +132 -11
- package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +232 -144
- package/src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts +34 -10
- package/src/extensions/pi-agent-text-editor/src/core/result-input.ts +24 -4
- package/src/extensions/pi-agent-text-editor/src/core/result-transfer.ts +7 -2
- package/src/extensions/pi-agent-text-editor/src/core/structured-result.ts +49 -214
- package/src/extensions/pi-agent-text-editor/src/core/text-change-engine.ts +5 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +152 -22
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +4 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +76 -32
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +409 -209
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +6 -9
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +10 -3
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +9 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +7 -8
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +3 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +10 -4
- package/src/pi-agent-ide.ts +15 -1
- package/src/plugins/pi-agent-ide-ast/package.json +13 -13
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +5 -4
- package/src/plugins/pi-agent-ide-ast/src/overflow-handler.ts +2 -2
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +35 -9
- package/src/plugins/pi-agent-ide-ast/src/select-presentation.ts +1 -1
- package/src/plugins/pi-agent-ide-ast/src/select-schema.ts +10 -8
- package/src/plugins/pi-agent-ide-ast/src/tool-select.ts +28 -3
- package/src/plugins/pi-agent-ide-changes/index.ts +4 -3
- package/src/plugins/pi-agent-ide-changes/package.json +8 -8
- package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +66 -4
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +8 -11
- package/src/plugins/pi-agent-ide-debugger/index.ts +22 -10
- package/src/plugins/pi-agent-ide-debugger/src/dap-client.ts +5 -0
- package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +93 -38
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +6 -3
- package/src/plugins/pi-agent-ide-formatter/package.json +3 -3
- package/src/plugins/pi-agent-ide-languages/package.json +2 -2
- package/src/plugins/pi-agent-ide-lint/package.json +7 -7
- package/src/plugins/pi-agent-ide-lsp/index.ts +3 -3
- package/src/plugins/pi-agent-ide-lsp/package.json +9 -9
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +5 -2
- package/src/plugins/pi-agent-ide-terminal/src/output-limits.ts +3 -3
- package/src/plugins/pi-agent-ide-terminal/src/resources.ts +8 -6
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +3 -3
- package/src/plugins/pi-agent-ide-vision/index.ts +13 -4
- package/src/post-edit/gate.ts +13 -2
- package/dist/chunk-3JO7QFIL.js +0 -1
- package/dist/chunk-4NIFBFFR.js +0 -11
- package/dist/chunk-64M3SQPG.js +0 -3
- package/dist/chunk-7LZKOHH2.js +0 -1
- package/dist/chunk-EAZGN5ND.js +0 -7
- package/dist/chunk-FK42RSF4.js +0 -1
- package/dist/chunk-KBP3QUDT.js +0 -2
- package/dist/chunk-KR36BT5E.js +0 -1
- package/dist/chunk-MBUXFKIW.js +0 -3
- package/dist/chunk-OE7QVAI2.js +0 -5
- package/dist/chunk-SILJ3OL4.js +0 -9
- package/dist/chunk-SQKAXYIR.js +0 -2
- package/dist/chunk-VCGNVTXQ.js +0 -1
- package/src/extensions/pi-agent-read/src/core/tools/read/temp-resource-store.ts +0 -105
|
@@ -1,151 +1,102 @@
|
|
|
1
1
|
# Select source boundaries
|
|
2
2
|
|
|
3
|
-
Use Search
|
|
3
|
+
Use Search for predicates and existing captures. Use Select to derive new text or syntax boundaries. Pass the unchanged Read/Search/Select/edit result as `path`; ordinary paths and returned item references also work. Outside Codemode, you can pass the result's UUID.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Select returns readable selected text with item references. The whole result retains all selected ranges, even when its preview is shortened. Use a displayed item reference when you need only that item. Do not build a selection from copied preview text or invented coordinates.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Syntax operations
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Syntax operations support JavaScript (.js/.mjs/.cjs) and TypeScript (.ts/.mts/.cts), without JSX/TSX. Missing providers and syntax errors are errors, not evidence of absence. Text operations need no parser.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
### Enclosing constructs
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`{kind:"object", object:"function"}` selects the nearest function containing the entire seed. An exact function selects itself. `level:2` selects the next outer function; levels count only the requested category. A seed crossing separate constructs is rejected. Enclosing can expand outside the original window and reports that expansion.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
- call: calls and new expressions.
|
|
17
|
-
- class, if, switch, loop (for/for-in/for-of/while/do), try and catch.
|
|
18
|
-
- binding: a variable declarator, not the surrounding const/let/var statement. assignment: ordinary and compound assignment expressions.
|
|
19
|
-
- object/array: literals and destructuring patterns; property: key/value pairs and shorthand object properties.
|
|
20
|
-
- return and throw.
|
|
15
|
+
Supported categories: function, call, class, if, switch, loop, try, catch, binding, assignment, object, property, array, return and throw. Call includes new expressions. Function includes methods, arrows, async/generator forms and bodyless TS signatures. Default parameter expressions belong to their function. Binding selects one variable declarator, not the whole declaration statement.
|
|
21
16
|
|
|
22
|
-
These are syntax categories, not
|
|
17
|
+
These are syntax categories, not semantic identities. Parser-only wrappers, punctuation, comments, class fields, JSX/TSX and unlisted forms do not become extra categories. `ownBody` is not implemented.
|
|
23
18
|
|
|
24
19
|
### Navigate
|
|
25
20
|
|
|
26
|
-
|
|
21
|
+
`{kind:"navigate", relation:"parent"}` requires an exact named syntax node and skips parser-only wrappers. Exact parts and captures work; first use enclosing when a range cuts through a node. A whole-file seed is not implicitly split into functions.
|
|
27
22
|
|
|
28
|
-
- parent
|
|
29
|
-
- ancestors
|
|
30
|
-
- children
|
|
31
|
-
- siblings
|
|
23
|
+
- parent selects the nearest normalized ancestor, excluding the starting node.
|
|
24
|
+
- ancestors selects all normalized ancestors in source order.
|
|
25
|
+
- children selects nearest nested constructs; descendants selects all nested constructs.
|
|
26
|
+
- siblings selects other constructs with the same normalized parent. previous/next selects the immediate neighbor; all selects every sibling. Missing neighbors are valid absence.
|
|
32
27
|
|
|
33
|
-
|
|
28
|
+
An `object` filter is applied after navigation; it never changes topology. Parent with object:function does not jump past an intervening call. Children with object:call does not jump through an if. Use ancestors/descendants for deeper matches.
|
|
34
29
|
|
|
35
|
-
Ancestors and descendants can overlap.
|
|
30
|
+
Ancestors and descendants can overlap. Narrow to disjoint targets before editing; edit tools reject overlapping writes.
|
|
36
31
|
|
|
37
32
|
### Named parts
|
|
38
33
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
| Construct
|
|
42
|
-
|
|
|
43
|
-
| function
|
|
44
|
-
| call/new
|
|
45
|
-
| class
|
|
46
|
-
| if
|
|
47
|
-
| switch
|
|
48
|
-
| classic for
|
|
49
|
-
| for-in / for-of
|
|
50
|
-
| while / do
|
|
51
|
-
| try
|
|
52
|
-
| catch
|
|
53
|
-
| finally clause
|
|
54
|
-
| binding
|
|
55
|
-
| assignment
|
|
56
|
-
| property
|
|
57
|
-
| return / throw
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
Structural items include parser-derived syntax.object and, for part selections, syntax.part where a normalized owner exists. These labels are descriptive, not editable authority. Read takes the item's target string; its displayed line context never widens the exact part's source scope.
|
|
34
|
+
`{kind:"part", part:"arguments"}` requires an exact construct. Parts keep their delimiters: block bodies include braces, argument/parameter lists include parentheses, annotations include colons, and else/finalizer clauses include their keywords. Expression arrow bodies are exact expressions.
|
|
35
|
+
|
|
36
|
+
| Construct | Supported parts |
|
|
37
|
+
| --------------- | ---------------------------------------------------------- |
|
|
38
|
+
| function | name, parameters, returnType, body |
|
|
39
|
+
| call/new | callee, arguments |
|
|
40
|
+
| class | name, body |
|
|
41
|
+
| if | condition, then, else |
|
|
42
|
+
| switch | condition, body |
|
|
43
|
+
| classic for | initializer, condition, update, body |
|
|
44
|
+
| for-in / for-of | left, iterable, body |
|
|
45
|
+
| while / do | condition, body |
|
|
46
|
+
| try | body, handler, finalizer |
|
|
47
|
+
| catch | parameter, body |
|
|
48
|
+
| finally clause | body |
|
|
49
|
+
| binding | name, type, value |
|
|
50
|
+
| assignment | left, right |
|
|
51
|
+
| property | key, value; shorthand selects the same identifier for both |
|
|
52
|
+
| return / throw | value |
|
|
53
|
+
|
|
54
|
+
An absent optional part produces no selection. An unsupported part reports available names. Objects and arrays do not invent body or arguments parts.
|
|
62
55
|
|
|
63
56
|
```js
|
|
64
57
|
const found = await tools.search({ path: "client.ts", query: "ast:send($$$ARGS)" });
|
|
65
58
|
const call = await tools.select({ path: found, operation: { kind: "object", object: "call" } });
|
|
66
59
|
const args = await tools.select({ path: call, operation: { kind: "part", part: "arguments" } });
|
|
67
|
-
await tools.read({ path: args
|
|
60
|
+
text(await tools.read({ path: args }));
|
|
68
61
|
const number = await tools.search({ path: args, query: "10" });
|
|
69
62
|
await tools.replace({ path: number, text: "20" });
|
|
70
63
|
```
|
|
71
64
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
Use `{kind:"elementExtent", extent:"inside"}` on an exact direct JS/TS call/new argument or parenthesized function/method/arrow parameter. AST captures can provide those element targets. Variadic captures may also contain punctuation; choose the element items in JavaScript before passing them here. Commas themselves are not elements. A typed/default parameter must include its type/default, not just its name. Partial expressions, whole lists, array/object elements and unparenthesized arrow parameters are unsupported; this operation never silently selects an enclosing element.
|
|
75
|
-
|
|
76
|
-
`inside` keeps only the element. `around` adds owned comma/whitespace, reports expansion and preserves list parentheses:
|
|
65
|
+
### List element extents
|
|
77
66
|
|
|
78
|
-
|
|
79
|
-
| ----------------------------------- | -------------------------------------------------------------------------------------- |
|
|
80
|
-
| First or middle with a next element | Element through the next element's start, including the following comma and whitespace |
|
|
81
|
-
| Last with a trailing comma | Element through the closing parenthesis, excluding the parenthesis |
|
|
82
|
-
| Last without a trailing comma | Previous element's end through this element's end; keeps closing whitespace |
|
|
83
|
-
| Only element | Entire list interior, including leading/trailing whitespace and any trailing comma |
|
|
67
|
+
`{kind:"elementExtent", extent:"inside"}` requires an exact direct call/new argument or parenthesized function parameter. Use a displayed Search capture reference for that element. Variadic captures can include punctuation; punctuation is not an element. Typed/default parameters must include their type/default.
|
|
84
68
|
|
|
85
|
-
|
|
69
|
+
Inside keeps the element. Around adds owned comma/whitespace and preserves list parentheses. First/middle elements own the following gap. A last element with a trailing comma owns that following gap; without one it owns the preceding gap. An only element owns the whole list interior.
|
|
86
70
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
Copy/move transports precisely the selected bytes, not a refactoring. A following-comma extent can be inserted before an existing destination element; a preceding-comma extent can be inserted after one. Destination syntax, parameter ordering and semantic validity are the caller's responsibility. Read the extent's target to preview it before editing. No new edit input contract or implicit syntax repair is provided.
|
|
90
|
-
|
|
91
|
-
```js
|
|
92
|
-
const found = await tools.search({ path: "client.ts", query: "ast:send($FIRST, $MIDDLE, $LAST)" });
|
|
93
|
-
const element = await tools.select({
|
|
94
|
-
path: found.data.matches[0].captures.MIDDLE,
|
|
95
|
-
operation: { kind: "elementExtent", extent: "around" },
|
|
96
|
-
});
|
|
97
|
-
await tools.read({ path: element.data.target });
|
|
98
|
-
await tools.delete({ path: element });
|
|
99
|
-
```
|
|
71
|
+
Adjacent comments make around ambiguous; inside remains available. Several around extents may overlap, so do not assume bulk deletion repairs syntax. Copy/move transports exact selected bytes, not a refactoring. Destination syntax and parameter ordering remain the caller's responsibility. Arrays, objects, partial expressions, whole lists and unparenthesized arrow parameters are unsupported here.
|
|
100
72
|
|
|
101
73
|
## Text operations
|
|
102
74
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
-
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
- `position` with edge before/after returns each region's zero-width start/end. Use a whole-file Read for file edges.
|
|
113
|
-
- `columns` with from/to returns the exclusive UTF-16 column interval on each touched line, without line endings. Every interval must fit both its line and input scope.
|
|
114
|
-
|
|
115
|
-
Except for range/lines, apply each operation independently to every input region. Keep files and sparse gaps separate; markers or delimiters cannot span those gaps. Invalid bounds, short-line columns and boundaries inside surrogate pairs or CRLF are errors, not clipped ranges. Preserve original CRLF/LF/bare-CR endings and unterminated EOF. Only linesOf and between/lines explicitly expand text input and report expansion.
|
|
116
|
-
|
|
117
|
-
Resolve registered anchors through existing Read inputs, then pass their verified target to Select. Use Search for regex captures rather than a second regex language inside Select. Use JavaScript array slice/filter to choose items; use sliceText to derive source boundaries.
|
|
118
|
-
|
|
119
|
-
```js
|
|
120
|
-
const source = await tools.read({ path: "notes.txt", offset: 2, limit: 1 });
|
|
121
|
-
const inside = await tools.select({
|
|
122
|
-
path: source,
|
|
123
|
-
operation: { kind: "between", start: "<", end: ">", extent: "inside" },
|
|
124
|
-
});
|
|
125
|
-
const value = await tools.select({
|
|
126
|
-
path: inside,
|
|
127
|
-
operation: { kind: "trim", side: "both" },
|
|
128
|
-
});
|
|
129
|
-
await tools.read({ path: value.data.target });
|
|
130
|
-
await tools.replace({ path: value, text: "new value" });
|
|
131
|
-
```
|
|
75
|
+
- range: absolute startLine/startColumn/endLine/endColumn in one source; lines are one-based, columns UTF-16, end exclusive. Must fit one input region.
|
|
76
|
+
- lines: inclusive first/last complete source lines, including existing endings; must fit one region.
|
|
77
|
+
- between: pairs each non-empty start marker with the nearest following end, without nesting, then resumes after the pair. Extent inside excludes markers, around includes them, lines expands to containing lines. Unmatched openings are errors; no openings is valid absence.
|
|
78
|
+
- sliceText: relative UTF-16 from/to in each region; to is exclusive and defaults to its end. Equal offsets select a point.
|
|
79
|
+
- trim: removes whitespace from start/end/both edges. Whitespace-only input selects a point at its end.
|
|
80
|
+
- split: divides by a non-empty literal delimiter, excluding delimiters and retaining empty segments as points.
|
|
81
|
+
- linesOf: expands to complete containing lines. An exclusive end at next-line column zero does not include that line.
|
|
82
|
+
- position: before/after points of each region. Use a whole-file Read for file edges.
|
|
83
|
+
- columns: exclusive from/to columns on each touched line, excluding endings. Every interval must fit its line and input scope.
|
|
132
84
|
|
|
133
|
-
|
|
85
|
+
Except for range/lines, operations apply independently to each region. Sparse gaps stay separate. Markers cannot cross gaps. Bounds inside surrogate pairs or CRLF are errors; ranges are never silently clipped. Only linesOf and between/lines explicitly expand text input.
|
|
134
86
|
|
|
135
87
|
## Range sets
|
|
136
88
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
- within retains a complete candidate only when one scope contains it. It does not clip or join adjacent scopes for containment.
|
|
140
|
-
- intersection clips each candidate to the union of comparison scopes.
|
|
141
|
-
- difference subtracts the union of scopes from each candidate and returns separate surviving fragments.
|
|
142
|
-
- merge explicitly joins overlapping candidates. Set adjacent:true to also join touching nonempty ranges; default false. Never fill a real gap.
|
|
89
|
+
Pass candidates in `path` and comparison results in `operation.scopes`. Both accept unchanged results, issued references or arrays. Match by source and snapshot, not array order. Every input is verified, even without a counterpart.
|
|
143
90
|
|
|
144
|
-
|
|
91
|
+
- within retains a candidate only if one scope contains it; no clipping or joining for containment.
|
|
92
|
+
- intersection clips each candidate to the union of scopes.
|
|
93
|
+
- difference subtracts scopes and retains separate surviving fragments.
|
|
94
|
+
- merge joins overlapping candidates. adjacent:true also joins touching nonempty ranges, never real gaps.
|
|
145
95
|
|
|
146
|
-
|
|
96
|
+
Points belong to a nonempty range at its included start, not its excluded end. Equal points match. Intersection with a contained point keeps it; touching ranges do not create points. Difference removes covered candidate points but point scopes do not cut text. Merge absorbs covered points without extending ranges. EOF points are outside a range ending at EOF.
|
|
147
97
|
|
|
148
|
-
Empty
|
|
98
|
+
Empty scopes make within/intersection empty and difference unchanged. Incomplete inputs cannot establish absence or authorize edits. Select never writes or formats.
|
|
99
|
+
Repeat the operation after interruption. Do not treat cancellation as an empty result.
|
|
149
100
|
|
|
150
101
|
```js
|
|
151
102
|
const candidates = await tools.search({ path: "notes.txt", query: "regex:<[^>]+>" });
|
|
@@ -158,37 +109,8 @@ const found = await tools.search({ path: editable, query: "old" });
|
|
|
158
109
|
await tools.replace({ path: found, text: "new" });
|
|
159
110
|
```
|
|
160
111
|
|
|
161
|
-
##
|
|
162
|
-
|
|
163
|
-
path accepts compatible Read/Search/mutation/Select results, their data, RESULT# references and arrays of returned items. A file path obtains a fresh whole-file Read snapshot; the chosen operation still must make sense for that entire seed. A multi-function file is not implicitly split into functions.
|
|
164
|
-
|
|
165
|
-
The result has kind selection, a complete stored target, items with individual targets, exact ranges and original-input associations, complete, totalItems, missingInputs and truncated. Lines are one-based and columns are UTF-16; character ends are exclusive. Identical output geometry is deduplicated while origins retain the separate input ranges. Empty results remain valid source sets. Unsupported part inputs, ambiguity and stale/expired inputs are errors.
|
|
166
|
-
|
|
167
|
-
Items are limited to 100 and each text preview to 1000 UTF-16 code units. truncated describes presentation, not execution completeness. The top-level target retains all selected ranges. complete inherits input completeness; an incomplete result cannot establish absence or safely authorize edits. Source snapshots stay strict: refresh Read/Search after edits, session changes or reload. Select never writes or runs formatting.
|
|
168
|
-
|
|
169
|
-
## Compose with existing tools
|
|
170
|
-
|
|
171
|
-
```js
|
|
172
|
-
const calls = await tools.search({ path: "client.ts", query: "ast:legacyRequest($OPTIONS)" });
|
|
173
|
-
const owners = await tools.select({
|
|
174
|
-
path: calls,
|
|
175
|
-
operation: {
|
|
176
|
-
kind: "object",
|
|
177
|
-
object: "function",
|
|
178
|
-
relation: "enclosing",
|
|
179
|
-
level: 1,
|
|
180
|
-
extent: "around",
|
|
181
|
-
},
|
|
182
|
-
});
|
|
183
|
-
const body = await tools.select({
|
|
184
|
-
path: owners.data.items[0],
|
|
185
|
-
operation: { kind: "part", part: "body" },
|
|
186
|
-
});
|
|
187
|
-
const retry = await tools.search({ path: body, query: "ast:retry($$$ARGS)" });
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
A body includes nested functions. To test for retry in that function's own body, select each retry call's nearest enclosing function and compare its source/range to the original owner. This keeps outer retry calls containing callbacks while excluding calls in nested functions or their default parameters. Do not establish absence from incomplete Search or clipped items.
|
|
112
|
+
## Composition limits
|
|
191
113
|
|
|
192
|
-
|
|
114
|
+
Read may show whole-line context around a selection, but later tools remain within its exact selected ranges. Whole-file write/undo reject partial selections. Insert remains line-based. Changed files, new sessions and reloads retire IDs; final Codemode formatting may also retire earlier results.
|
|
193
115
|
|
|
194
|
-
|
|
116
|
+
A function body includes nested functions. To check a call in a function's own body, compare the call's nearest enclosing function with the original owner using their source-local selections. Syntax names alone do not establish semantic identity. Do not establish absence from incomplete results.
|
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Use the registered shell tool (`bash` or `powershell`) for project commands. Check its command parameter for the actual shell and write that shell's syntax; do not infer syntax from the tool name or operating system. Keep short commands in the foreground. Start servers, watchers, and long builds with `background: true`; continue other work rather than polling. Read the returned `shell:<session>` resource for status and bounded output. Search that resource to locate retained output outside the current tail.
|
|
4
4
|
|
|
5
|
+
Check `status` and `exitCode` before treating a process as successfully completed. A returned background session or a released foreground wait is not a completion report. A timeout, detected input prompt, or turn interruption releases the wait without stopping a live process. Read the same `shell:` source to continue; it also survives extension reloads.
|
|
6
|
+
|
|
7
|
+
Send input only when `status` is `running`. Do not treat `stopping`, `stopped`, or `cancelled` as a preserved interactive wait. Before retrying a failed or interrupted command, inspect any returned session. If no source was returned, use `process:<query>` search to check for a process that may have started. Failure does not undo command side effects.
|
|
8
|
+
|
|
9
|
+
Use the log path in a truncation notice to inspect omitted output.
|
|
10
|
+
|
|
5
11
|
Use `write` on a shell resource to send exact text without Enter. Use `insert` for named keys and chords such as `Enter`, `Ctrl+C`, or `Up`. Delete a shell resource to terminate and remove the session. Add the `image` view only when cursor position, ANSI layout, or a full-screen interface matters. Use a bounded `sequence:duration=<seconds>,interval=<seconds>,scale=<ratio>` view when changes over time matter.
|
|
6
12
|
|
|
7
|
-
Use `process:<query>` search before reading `process:<PID>` or capturing `window:<PID>`.
|
|
13
|
+
Use `process:<query>` search before reading `process:<PID>` or capturing `window:<PID>`.
|
|
14
|
+
|
|
15
|
+
If a session returns as running in background and no independent work remains, finish your turn instead of polling. Pi wakes the agent when the session completes. A still-running session also gets one inspection notice after two minutes without terminal activity, once the agent is idle. Read the session when that notice arrives and decide whether to keep waiting, send input, or delete it. An inspection notice is not proof of failure or completion.
|
package/docs/configuration.md
CHANGED
|
@@ -75,7 +75,7 @@ Built-in entry modules are imported only after selection. Disabled built-ins, in
|
|
|
75
75
|
|
|
76
76
|
## Animations and post-edit processing
|
|
77
77
|
|
|
78
|
-
Standalone editing tools validate source snapshots before writing. Native Codemode
|
|
78
|
+
Standalone editing tools validate source snapshots before writing. Native Codemode commits eligible pending local edits before a dependent tool or when the script ends. Accepted child calls are not proof of persistence. Ordinary script errors keep accepted edits; aborts discard only pending work. Batched edits finish formatting and diagnostics at script end. Write commits earlier pending edits and finishes its own post-edit processing before returning. Text copy/move destinations receive post-processing; binary contents stay unchanged.
|
|
79
79
|
|
|
80
80
|
Automatic diagnostic findings are grouped for five seconds from the first finding. The UI tab’s **Immediate diagnostic notices** option (`pi-agent-ide-no-diagnostic-buffer`) disables this delay. Combined notices keep each file and reporting tool identifiable. Empty completed diagnostic reads tell the agent that checks finished without findings, but do not draw an empty diagnostic panel. Pending, unavailable and incomplete checks are not reported as clean.
|
|
81
81
|
|
package/docs/releases.md
CHANGED
|
@@ -14,6 +14,10 @@ Squash-merging `develop` into `main` makes their histories diverge. The **Synchr
|
|
|
14
14
|
|
|
15
15
|
See [Develop nightly](nightly.md). Nightlies test a pinned `develop` commit and keep an installable package and test reports in GitHub Actions for 30 days. They do not publish to npm.
|
|
16
16
|
|
|
17
|
+
## Flaky debugger checks
|
|
18
|
+
|
|
19
|
+
Real debugger integration tests and adapter/platform jobs still run, but their results are non-blocking and kept outside the shared CI test totals and badges. They have separate jobs and reports marked flaky. A failed debugger job does not reject a release candidate. Pure debugger unit tests, other source/runtime checks, and editor tests remain blocking. In particular, Delete is not part of this exception.
|
|
20
|
+
|
|
17
21
|
## Start a release
|
|
18
22
|
|
|
19
23
|
Choose a release cut by its full commit SHA. If that commit is not yet on main, promote it through a separate pinned branch such as `chore/promote-X.Y.Z`, not a PR whose head is the moving `develop` branch. Keep that promotion head unchanged while CI runs. New develop merges do not join the release unless its scope is explicitly changed. After promotion and main-to-develop synchronization succeed, start the versioned release below. See `.pi/skills/publish-pi-agent-ide/SKILL.md` for the agent runbook.
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
This records the original batching decision. LPT-403 later removed Apply without changing the native batching policy.
|
|
4
4
|
|
|
5
|
+
LPT-439 later made Write immediate: pending edits commit before Write, and Write saves and finishes its post-edit processing before returning. If an existing file already matches the supplied content, Write returns its whole-file selection without writing or running post-edit handlers. A missing empty file is still created. Write does not join the pending batch. The policy below still applies to other eligible text edits.
|
|
6
|
+
|
|
5
7
|
## Question
|
|
6
8
|
|
|
7
9
|
Should sequential editor calls in native Codemode share only original coordinates, or also one combined write, and where should that batch end?
|
|
@@ -1,86 +1,51 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Readable IDE results and private records
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
IDE tools expose readable text in direct calls and native Codemode. The existing Read views, Search anchors, edit effects and diffs remain the agent-facing output. Select shows its selected text and item references. Agents do not receive the private result records or need to inspect their fields.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Composition
|
|
6
6
|
|
|
7
|
-
|
|
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.
|
|
7
|
+
Each result starts with a labelled system-result envelope containing a random UUID. It is not part of a file and must not be edited or inserted into file contents.
|
|
31
8
|
|
|
32
9
|
```js
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
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);
|
|
10
|
+
const source = await tools.read({ path: "notes.txt" });
|
|
11
|
+
const matches = await tools.search({ path: source, query: "old" });
|
|
12
|
+
const selected = await tools.select({ path: matches, operation: { kind: "trim", side: "both" } });
|
|
13
|
+
text(await tools.replace({ path: selected, text: "new" }));
|
|
40
14
|
```
|
|
41
15
|
|
|
42
|
-
|
|
16
|
+
Pass the unchanged result to a supported source parameter. Direct calls also accept its UUID. Store/load retains the result string across scripts in the same session. Displayed item and capture references allow narrower selections without inspecting private arrays.
|
|
43
17
|
|
|
44
|
-
|
|
18
|
+
A result identifies its backend-owned ranges, not the text in its preview. Shortened output does not clip a complete selection or make an incomplete selection complete. Read around a selection may show context without granting authority to edit it.
|
|
45
19
|
|
|
46
|
-
|
|
20
|
+
## Reference ownership
|
|
47
21
|
|
|
48
|
-
|
|
22
|
+
The session registry issues UUIDs and maps them to source handles. A guessed or computed hash has no authority unless the registry issued that reference. UUIDs are opaque references, not content hashes or signatures.
|
|
49
23
|
|
|
50
|
-
|
|
24
|
+
The registry validates session/worktree ownership, exact full-output identity, successful source status and live snapshots. Copying a valid ID within its session is intentional reuse, not forgery. Altering the body while keeping the envelope is rejected. An ID cannot grant wider ranges than its original selection.
|
|
51
25
|
|
|
52
|
-
|
|
26
|
+
Changed files permanently retire old source and derived references. Restoring the old bytes does not revive them. Actual edit completions and script boundaries observe filesystem generations; retained source bytes are verified before use. Reload and session changes clear the registry.
|
|
53
27
|
|
|
54
|
-
|
|
28
|
+
Pending edits reserve source handles without granting authority to unconfirmed writes. A dependent source operation commits the batch before using such a handle. Failed or cancelled edits cannot confirm it. Independent peer edits retain their original snapshots until the common commit.
|
|
55
29
|
|
|
56
|
-
|
|
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
|
-
```
|
|
30
|
+
Read-only views, raw bytes, images and directory listings do not acquire text-edit authority. Their IDs can identify the resource for another read. Live shell/debugger references can be used only with their owning resource operations. File deletion supplies no reusable text selection.
|
|
66
31
|
|
|
67
|
-
|
|
32
|
+
## Internal records
|
|
68
33
|
|
|
69
|
-
|
|
34
|
+
Each tool owns its validated record. Read, Search, Select, Diff, terminals, Git and debugger operations keep their own domain adapters. File edit receipts contain only operation, observed effect, file states and an optional verified selection handle. Delete omits selection fields. The parent Codemode result retains committed operation effects and errors.
|
|
70
35
|
|
|
71
|
-
|
|
36
|
+
The text registry stores only ownership, a digest of the issued text, source references, resource identities and whether the result can be consumed. It does not copy line arrays, removed file contents, image bytes or debugger records into a second ledger. Source ranges and snapshots remain in the source-target store.
|
|
72
37
|
|
|
73
|
-
|
|
38
|
+
The unified registration adapter omits public outputSchema. Pi's supported Codemode execution path therefore returns each tool's existing text instead of structuredContent. Public tool_result hooks register the private source metadata and return the readable text with its envelope. This does not modify Pi, rewrite scripts, add VM methods, or recognize JSON in Codemode output.
|
|
74
39
|
|
|
75
|
-
|
|
76
|
-
|
|
40
|
+
Nested image blocks are delivered on the parent Codemode result; their bytes are not printed as text. Images remain ordinary native image content.
|
|
41
|
+
Read's private native record contains image type and MIME metadata, not another copy of the image bytes. Large images therefore do not overflow the JSON-record budget while their native content stays unchanged.
|
|
77
42
|
|
|
78
|
-
##
|
|
43
|
+
## Errors and writes
|
|
79
44
|
|
|
80
|
-
|
|
45
|
+
Failed tools reject in Codemode. Use try/catch or Promise.allSettled when independent calls may fail. Inspect the readable file/operation effects and final parent result before retrying. An error does not prove rollback.
|
|
81
46
|
|
|
82
|
-
|
|
47
|
+
Automatic batch boundaries save pending edits, not their final formatting. Write finishes its own post-edit processing before returning. Final post-edit processing can retire earlier snapshots. Ordinary script errors keep accepted edits; abort/deadline discards pending writes, not already committed batches.
|
|
83
48
|
|
|
84
|
-
|
|
49
|
+
After an exact-text selector fails, the tool returns current anchors and blocks further exact-text edits for that file. Use a current anchor for the next successful edit. Exact text is then available again.
|
|
85
50
|
|
|
86
|
-
|
|
51
|
+
See [editing](./agent-guides/editing.md), [Read](./agent-guides/read-resources.md) and [Select](./agent-guides/select-code.md) for their source and boundary contracts.
|
package/docs/tools.md
CHANGED
|
@@ -4,9 +4,17 @@ 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
|
-
##
|
|
7
|
+
## Readable results and composition
|
|
8
8
|
|
|
9
|
-
IDE tools
|
|
9
|
+
IDE tools return readable text in direct calls and Codemode. A leading system-result envelope carries a registered UUID; it is not file content. Pass the unchanged result to another source parameter, or use its UUID in a direct call. The system resolves the private source records. Check the readable file effects before retrying failed edits. See [IDE result composition](./structured-results.md) for reference lifetime and automatic commit boundaries.
|
|
10
|
+
|
|
11
|
+
## Shared output limits
|
|
12
|
+
|
|
13
|
+
Every IDE tool, including nested calls and the combined Codemode result, shares a useful-text limit of 50 KiB or 2,000 lines. Images share a limit of 20 frames, 4,000,000 pixels and 20 MiB of image bytes per result. Notices, guides and composition references are added afterward and are not part of these budgets.
|
|
14
|
+
|
|
15
|
+
When the shared text limit truncates a result, the complete useful text is saved to a private temporary file. The result names that file. Use Read with `offset` and `limit` to continue, or `raw:` byte windows for a line that is too large. The file is removed when its owning runtime is disposed. Media is resized or omitted, not archived.
|
|
16
|
+
|
|
17
|
+
An explicit request limit still selects what the tool produces; the saved file does not undo that filter. Truncation does not shorten private source selections or change file-edit effects. Terminal results also link to their complete session log.
|
|
10
18
|
|
|
11
19
|
## Resource references
|
|
12
20
|
|
|
@@ -38,7 +46,7 @@ A source field such as `path` or mutation `target` is therefore a resource field
|
|
|
38
46
|
- AST-aware code views;
|
|
39
47
|
- LSP diagnostics, symbols, references, and call graphs.
|
|
40
48
|
|
|
41
|
-
A read result may include anchors, diagnostics, Git changes, or structural markers. Large text results are bounded
|
|
49
|
+
A read result may include anchors, diagnostics, Git changes, or structural markers. Large text results are bounded. The shared limiter retains complete truncated text in a temporary file.
|
|
42
50
|
|
|
43
51
|
Read sources are not assumed to be writable. The read and text-editor cores keep separate resolver registries so a derived view cannot be edited by accident.
|
|
44
52
|
|
|
@@ -52,7 +60,7 @@ When `path` is a typed text resource, `read` returns one independent chunk for e
|
|
|
52
60
|
|
|
53
61
|
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.
|
|
54
62
|
|
|
55
|
-
|
|
63
|
+
Codemode receives the same bounded hex view as a direct call. Use `text(result)` or return it to display that view. Follow the displayed offset or continuation reference. This is read-only; byte editing and byte diff are not included.
|
|
56
64
|
|
|
57
65
|
### Diagnostic completion
|
|
58
66
|
|
|
@@ -76,16 +84,12 @@ Window and display capture use `node-screenshots` on Linux and macOS. Desktop or
|
|
|
76
84
|
|
|
77
85
|
## Terminal sessions
|
|
78
86
|
|
|
79
|
-
|
|
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.
|
|
87
|
+
Codemode receives the same readable shell status and output as direct calls. The result includes its session source and a reference to the complete log when output is shortened. A wait timeout leaves a running session, not a failed command. Inspect the reported exit status and effects; failed tools can reject.
|
|
82
88
|
|
|
83
89
|
```ts
|
|
84
90
|
const result = await tools.bash({ command: "your-command" });
|
|
85
|
-
text(
|
|
86
|
-
|
|
87
|
-
errors: result.output.split("\n").filter((line) => line.includes("error")),
|
|
88
|
-
});
|
|
91
|
+
text(result);
|
|
92
|
+
text(await tools.read({ path: result }));
|
|
89
93
|
```
|
|
90
94
|
|
|
91
95
|
`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.
|