pi-agent-ide 0.6.0 → 0.6.1
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 +29 -0
- package/README.md +79 -53
- package/assets/social-preview.png +0 -0
- package/dist/chunk-4KUFOHWP.js +2 -0
- package/dist/chunk-4LDOV7QS.js +28 -0
- package/dist/chunk-FA6BKC5Y.js +1 -0
- package/dist/{chunk-HSM6R7IB.js → chunk-I6Y3W4X6.js} +13 -13
- package/dist/chunk-MPT3R4BL.js +0 -0
- package/dist/chunk-PZFOOHY2.js +15 -0
- package/dist/{chunk-OYWIZII6.js → chunk-S6QRG3TQ.js} +1 -1
- package/dist/chunk-T7I2VX3J.js +1 -0
- package/dist/chunk-VCTK4JSN.js +3 -0
- package/dist/chunk-W7CASEO3.js +1 -0
- package/dist/chunk-YEQOQMU7.js +5 -0
- package/dist/chunk-YT42LKFV.js +16 -0
- package/dist/entry-10.js +1 -1
- package/dist/entry-11.js +1 -1
- package/dist/entry-12.js +1 -1
- package/dist/entry-13.js +1 -1
- package/dist/entry-14.js +1 -1
- package/dist/entry-15.js +1 -1
- package/dist/entry-16.js +1 -1
- package/dist/entry-17.js +1 -0
- package/dist/entry-19.js +1 -1
- package/dist/entry-20.js +1 -1
- package/dist/entry-21.js +1 -1
- package/dist/entry-22.js +1 -1
- package/dist/entry-23.js +1 -2
- package/dist/entry-24.js +1 -1
- package/dist/entry-25.js +2 -1
- package/dist/entry-26.js +1 -1
- package/dist/entry-27.js +2 -1
- package/dist/entry-28.js +1 -12
- package/dist/entry-29.js +1 -1
- package/dist/entry-30.js +1 -1
- package/dist/entry-31.js +12 -1
- package/dist/entry-32.js +1 -1
- package/dist/entry-33.js +1 -4
- package/dist/entry-34.js +1 -9
- package/dist/entry-35.js +1 -1
- package/dist/entry-36.js +4 -1
- package/dist/entry-37.js +9 -1
- package/dist/entry-38.js +1 -1
- package/dist/entry-39.js +1 -1
- package/dist/entry-40.js +1 -1
- package/dist/entry-41.js +1 -1
- package/dist/entry-42.js +1 -18
- package/dist/entry-43.js +1 -1
- package/dist/entry-44.js +1 -1
- package/dist/entry-45.js +17 -1
- package/dist/entry-46.js +1 -1
- package/dist/entry-47.js +1 -7
- package/dist/entry-48.js +1 -11
- package/dist/entry-49.js +1 -1
- package/dist/entry-50.js +6 -1
- package/dist/entry-51.js +11 -1
- package/dist/entry-52.js +1 -1
- package/dist/entry-53.js +1 -1
- package/dist/entry-54.js +1 -1
- package/dist/entry-55.js +1 -1
- package/dist/entry-56.js +1 -1
- package/dist/entry-57.js +1 -0
- package/dist/entry-58.js +1 -1
- package/dist/entry-59.js +1 -0
- package/dist/entry-60.js +0 -1
- package/dist/entry-61.js +1 -1
- package/dist/entry-62.js +0 -1
- package/dist/entry-63.js +1 -1
- package/dist/entry-64.js +1 -1
- package/dist/entry-65.js +1 -1
- package/dist/entry-66.js +1 -0
- package/dist/entry-67.js +1 -1
- package/dist/entry-68.js +1 -0
- package/dist/entry-69.js +0 -1
- package/dist/entry-70.js +1 -1
- package/dist/entry-71.js +0 -1
- package/dist/entry-72.js +1 -259
- package/dist/entry-73.js +1 -30
- package/dist/entry-74.js +1 -2
- package/dist/entry-75.js +315 -1
- package/dist/entry-76.js +30 -1
- package/dist/entry-77.js +2 -3
- package/dist/entry-78.js +1 -3
- package/dist/entry-79.js +1 -1
- package/dist/entry-80.js +3 -1
- package/dist/entry-81.js +3 -1
- package/dist/entry-82.js +1 -0
- package/dist/entry-83.js +1 -0
- package/dist/entry-84.js +1 -0
- package/dist/entry-9.js +1 -1
- package/dist/pi-agent-ide.js +3 -3
- package/docs/agent-guides/apply.md +333 -0
- package/docs/agent-guides/debugger.md +5 -0
- package/docs/agent-guides/diagnostics.md +5 -0
- package/docs/agent-guides/editing.md +44 -0
- package/docs/agent-guides/git-changes.md +5 -0
- package/docs/agent-guides/json-reading.md +41 -0
- package/docs/agent-guides/read-resources.md +44 -0
- package/docs/agent-guides/search-code.md +29 -0
- package/docs/agent-guides/terminal.md +7 -0
- package/docs/agent-guides/vision.md +5 -0
- package/docs/configuration.md +6 -14
- package/docs/research/apply-read-latency.md +219 -0
- package/node_modules/pi-agent-doctor/package.json +6 -6
- package/node_modules/pi-agent-doctor/runtime/entry-23.js +1 -0
- package/node_modules/pi-agent-documentation/package.json +15 -0
- package/node_modules/pi-agent-documentation/runtime/entry-24.js +1 -0
- package/node_modules/pi-agent-documentation/src/index.ts +69 -0
- package/node_modules/pi-agent-filesystem/index.ts +0 -4
- package/node_modules/pi-agent-filesystem/package.json +7 -7
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- package/node_modules/pi-agent-filesystem-jq/index.ts +134 -0
- package/node_modules/pi-agent-filesystem-jq/package.json +23 -0
- package/node_modules/pi-agent-filesystem-jq/runtime/entry-27.js +2 -0
- package/node_modules/pi-agent-filesystem-jq/src/jq.ts +107 -0
- package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/runtime/entry-29.js +2 -0
- package/node_modules/pi-agent-ide-ast/package.json +11 -11
- package/node_modules/pi-agent-ide-ast/runtime/entry-30.js +1 -0
- package/node_modules/pi-agent-ide-changes/index.ts +8 -0
- package/node_modules/pi-agent-ide-changes/package.json +9 -8
- package/node_modules/pi-agent-ide-changes/runtime/entry-32.js +1 -0
- package/node_modules/pi-agent-ide-formatter/package.json +4 -4
- package/node_modules/pi-agent-ide-formatter/src/formatter.ts +1 -1
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-languages/runtime/entry-35.js +2 -0
- package/node_modules/pi-agent-ide-lint/index.ts +1 -1
- package/node_modules/pi-agent-ide-lint/package.json +8 -8
- package/node_modules/pi-agent-ide-lint/runtime/entry-36.js +2 -0
- package/node_modules/pi-agent-ide-lint/src/command-linter.ts +17 -1
- package/node_modules/pi-agent-ide-lsp/index.ts +0 -3
- package/node_modules/pi-agent-ide-lsp/package.json +10 -10
- package/node_modules/pi-agent-ide-lsp/runtime/entry-37.js +2 -0
- package/node_modules/pi-agent-image/package.json +3 -3
- package/node_modules/pi-agent-invariant/package.json +2 -2
- package/node_modules/pi-agent-pdf/package.json +3 -3
- package/node_modules/pi-agent-read/package.json +12 -11
- package/node_modules/pi-agent-read/runtime/entry-42.js +0 -1
- package/node_modules/pi-agent-read/runtime/entry-45.js +2 -0
- package/node_modules/pi-agent-read/src/api/read-parameters.ts +2 -2
- package/node_modules/pi-agent-read/src/core/extension.ts +16 -2
- package/node_modules/pi-agent-read/src/core/read-core.ts +4 -5
- package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +62 -8
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +19 -12
- package/node_modules/pi-agent-resource/package.json +2 -2
- package/node_modules/pi-agent-search/package.json +8 -7
- package/node_modules/pi-agent-search/runtime/entry-47.js +0 -1
- package/node_modules/pi-agent-search/runtime/entry-48.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-50.js +2 -0
- package/node_modules/pi-agent-search/src/core/extension.ts +29 -10
- package/node_modules/pi-agent-search-text/package.json +9 -9
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text/runtime/entry-53.js +1 -0
- package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-54.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/package.json +5 -5
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-55.js +1 -0
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-56.js +2 -0
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-58.js +2 -0
- package/node_modules/pi-agent-text-editor/index.ts +15 -0
- package/node_modules/pi-agent-text-editor/package.json +26 -25
- package/node_modules/pi-agent-text-editor/runtime/entry-72.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-73.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-74.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-75.js +2 -0
- package/node_modules/pi-agent-text-editor/src/core/apply/execution.ts +24 -18
- package/node_modules/pi-agent-text-editor/src/core/apply/output.ts +4 -2
- package/node_modules/pi-agent-text-editor/src/core/apply/prompt.ts +5 -44
- package/node_modules/pi-agent-text-editor/src/core/apply/renderer.ts +13 -5
- package/node_modules/pi-agent-text-editor/src/core/apply/runtime.ts +124 -26
- package/node_modules/pi-agent-text-editor/src/core/apply/tool.ts +2 -6
- package/node_modules/pi-agent-text-editor/src/core/apply/transaction.ts +186 -1
- package/node_modules/pi-agent-text-editor/src/core/builtin-edit-filter.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +0 -11
- package/node_modules/pi-agent-text-editor/src/core/text-editor-config.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +0 -2
- package/node_modules/pi-agent-text-editor-renderer/index.ts +17 -4
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-76.js +2 -0
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +23 -11
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +21 -16
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-78.js +1 -0
- package/node_modules/pi-agent-tool-ui/package.json +2 -2
- package/node_modules/pi-agent-tool-ui/runtime/entry-79.js +1 -0
- package/node_modules/pi-agent-web/package.json +7 -7
- package/node_modules/pi-agent-web-html/package.json +3 -3
- package/node_modules/pi-agent-web-image/package.json +4 -4
- package/node_modules/pi-agent-web-image/runtime/entry-82.js +2 -0
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/runtime/entry-83.js +2 -0
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-84.js +2 -0
- package/package.json +108 -44
- package/src/api/documentation.ts +2 -0
- package/src/composite/builtin-extensions.ts +7 -0
- package/src/composite/extensions-config.ts +6 -0
- package/src/composite/module-labels.ts +5 -0
- package/src/composite/module-settings-store.ts +3 -0
- package/src/composite/module-settings.ts +39 -5
- package/src/composite/preferences.ts +37 -0
- package/src/composite/presentation.ts +14 -0
- package/src/composite/presets.ts +57 -0
- package/src/documentation/extension.ts +295 -0
- package/src/documentation/registry.ts +98 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +0 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/index.ts +134 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +23 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-27.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/src/jq.ts +107 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-28.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-29.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-25.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +7 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-82.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-83.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-84.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-80.js +2 -0
- package/src/extensions/pi-agent-read/package.json +12 -11
- package/src/extensions/pi-agent-read/runtime/entry-42.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-43.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-45.js +2 -0
- package/src/extensions/pi-agent-read/src/api/read-parameters.ts +2 -2
- package/src/extensions/pi-agent-read/src/core/extension.ts +16 -2
- package/src/extensions/pi-agent-read/src/core/read-core.ts +4 -5
- package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +62 -8
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +19 -12
- package/src/extensions/pi-agent-search/package.json +8 -7
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +9 -9
- package/src/extensions/pi-agent-search/runtime/entry-47.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-48.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-49.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-50.js +2 -0
- package/src/extensions/pi-agent-search/src/core/extension.ts +29 -10
- package/src/extensions/pi-agent-text-editor/index.ts +15 -0
- package/src/extensions/pi-agent-text-editor/package.json +26 -25
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-54.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-55.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-56.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-57.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-58.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +17 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-76.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +23 -11
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +21 -16
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/runtime/entry-72.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-73.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-74.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-75.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/core/apply/execution.ts +24 -18
- package/src/extensions/pi-agent-text-editor/src/core/apply/output.ts +4 -2
- package/src/extensions/pi-agent-text-editor/src/core/apply/prompt.ts +5 -44
- package/src/extensions/pi-agent-text-editor/src/core/apply/renderer.ts +13 -5
- package/src/extensions/pi-agent-text-editor/src/core/apply/runtime.ts +124 -26
- package/src/extensions/pi-agent-text-editor/src/core/apply/tool.ts +2 -6
- package/src/extensions/pi-agent-text-editor/src/core/apply/transaction.ts +186 -1
- package/src/extensions/pi-agent-text-editor/src/core/builtin-edit-filter.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +0 -11
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-config.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +0 -2
- package/src/pi-agent-ide.ts +7 -10
- package/src/plugins/pi-agent-ide-ast/package.json +11 -11
- package/src/plugins/pi-agent-ide-ast/runtime/entry-30.js +1 -0
- package/src/plugins/pi-agent-ide-changes/index.ts +8 -0
- package/src/plugins/pi-agent-ide-changes/package.json +9 -8
- package/src/plugins/pi-agent-ide-changes/runtime/entry-32.js +1 -0
- package/src/plugins/pi-agent-ide-debugger/index.ts +12 -4
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +9 -4
- package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
- package/src/plugins/pi-agent-ide-formatter/src/formatter.ts +1 -1
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-languages/runtime/entry-35.js +2 -0
- package/src/plugins/pi-agent-ide-lint/index.ts +1 -1
- package/src/plugins/pi-agent-ide-lint/package.json +8 -8
- package/src/plugins/pi-agent-ide-lint/runtime/entry-36.js +2 -0
- package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +17 -1
- package/src/plugins/pi-agent-ide-lsp/index.ts +0 -3
- package/src/plugins/pi-agent-ide-lsp/package.json +10 -10
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-37.js +2 -0
- package/src/plugins/pi-agent-ide-terminal/index.ts +27 -2
- package/src/plugins/pi-agent-ide-terminal/src/renderer.ts +27 -2
- package/src/plugins/pi-agent-ide-terminal/src/resources.ts +1 -4
- package/src/plugins/pi-agent-ide-terminal/src/search.ts +0 -3
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +7 -4
- package/src/plugins/pi-agent-ide-vision/index.ts +8 -6
- package/dist/chunk-22CLOM2D.js +0 -1
- package/dist/chunk-3XJ3KDPZ.js +0 -16
- package/dist/chunk-526E364R.js +0 -3
- package/dist/chunk-DDKHZZDO.js +0 -5
- package/dist/chunk-EJ5OACQM.js +0 -1
- package/dist/chunk-PCZH7GOX.js +0 -26
- package/dist/chunk-SQ7ZTGOP.js +0 -2
- package/dist/entry-18.js +0 -1
- package/node_modules/pi-agent-doctor/runtime/entry-18.js +0 -1
- package/node_modules/pi-agent-filesystem/runtime/entry-23.js +0 -2
- package/node_modules/pi-agent-filesystem-image/runtime/entry-24.js +0 -2
- package/node_modules/pi-agent-ide-ast/runtime/entry-27.js +0 -1
- package/node_modules/pi-agent-ide-changes/runtime/entry-29.js +0 -1
- package/node_modules/pi-agent-ide-changes/runtime/entry-30.js +0 -2
- package/node_modules/pi-agent-ide-languages/runtime/entry-32.js +0 -2
- package/node_modules/pi-agent-image/runtime/entry-35.js +0 -1
- package/node_modules/pi-agent-invariant/runtime/entry-36.js +0 -1
- package/node_modules/pi-agent-pdf/runtime/entry-37.js +0 -1
- package/node_modules/pi-agent-search/runtime/entry-45.js +0 -1
- package/node_modules/pi-agent-search-text/runtime/entry-48.js +0 -2
- package/node_modules/pi-agent-text/runtime/entry-50.js +0 -1
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-53.js +0 -2
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-54.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-55.js +0 -2
- package/node_modules/pi-agent-text-editor/runtime/entry-56.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-58.js +0 -1
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-73.js +0 -2
- package/node_modules/pi-agent-text-editor-renderer/src/config.ts +0 -73
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-74.js +0 -2
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-75.js +0 -1
- package/node_modules/pi-agent-tool-ui/runtime/entry-76.js +0 -1
- package/node_modules/pi-agent-web-html/runtime/entry-78.js +0 -2
- package/node_modules/pi-agent-web-image/runtime/entry-79.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-24.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-25.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-23.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-78.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-79.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-80.js +0 -2
- package/src/extensions/pi-agent-read/runtime/entry-38.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-39.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-40.js +0 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-48.js +0 -2
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-49.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-45.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-46.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-53.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-54.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-55.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-73.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/config.ts +0 -73
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-74.js +0 -2
- package/src/extensions/pi-agent-text-editor/runtime/entry-56.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-57.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-58.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-27.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-28.js +0 -2
- package/src/plugins/pi-agent-ide-changes/runtime/entry-29.js +0 -1
- package/src/plugins/pi-agent-ide-changes/runtime/entry-30.js +0 -2
- package/src/plugins/pi-agent-ide-languages/runtime/entry-32.js +0 -2
- /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem}/runtime/entry-25.js +0 -0
- /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-image}/runtime/entry-26.js +0 -0
- /package/node_modules/{pi-agent-ide-ast → pi-agent-filesystem-pdf}/runtime/entry-28.js +0 -0
- /package/node_modules/{pi-agent-ide-formatter → pi-agent-ide-ast}/runtime/entry-31.js +0 -0
- /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-changes}/runtime/entry-33.js +0 -0
- /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-formatter}/runtime/entry-34.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-image}/runtime/entry-38.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-invariant}/runtime/entry-39.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-40.js +0 -0
- /package/node_modules/{pi-agent-resource → pi-agent-read}/runtime/entry-43.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-read}/runtime/entry-44.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-46.js +0 -0
- /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-49.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-constant → pi-agent-search-text}/runtime/entry-51.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-exact → pi-agent-search-text}/runtime/entry-52.js +0 -0
- /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-line-hash}/runtime/entry-57.js +0 -0
- /package/node_modules/{pi-agent-web → pi-agent-text-editor-stale-anchor}/runtime/entry-77.js +0 -0
- /package/node_modules/{pi-agent-web-pdf → pi-agent-web}/runtime/entry-80.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web-html}/runtime/entry-81.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-image}/runtime/entry-26.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-html}/runtime/entry-81.js +0 -0
- /package/src/extensions/{pi-agent-search → pi-agent-read}/runtime/entry-44.js +0 -0
- /package/src/extensions/{pi-agent-text-editor/plugins/pi-agent-text-anchor-constant → pi-agent-search/plugins/pi-agent-search-text}/runtime/entry-51.js +0 -0
- /package/src/extensions/{pi-agent-text-editor/plugins/pi-agent-text-anchor-exact → pi-agent-search/plugins/pi-agent-search-text}/runtime/entry-52.js +0 -0
- /package/src/extensions/{pi-agent-read/extensions/pi-agent-web → pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor}/runtime/entry-77.js +0 -0
- /package/src/plugins/{pi-agent-ide-formatter → pi-agent-ide-ast}/runtime/entry-31.js +0 -0
- /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-changes}/runtime/entry-33.js +0 -0
- /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-formatter}/runtime/entry-34.js +0 -0
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
# Apply scripting reference
|
|
2
|
+
|
|
3
|
+
## Before using Apply
|
|
4
|
+
|
|
5
|
+
Read this guide before writing an Apply script. Use Apply only for computed or conditional edits, selection composition, explicit checkpoints, or one coherent cross-file transaction.
|
|
6
|
+
|
|
7
|
+
When each change is already known and independent, use standalone text tools instead. Submit those tools together in one assistant response; they share the original file snapshots and work for several edits in one file or across files. Do not write a JavaScript Apply program merely to group straightforward replacements, insertions, removals, copies, or moves. Read `docs:editing` for that workflow.
|
|
8
|
+
|
|
9
|
+
Open every source first, select from immutable snapshots, stage operations, and let normal completion commit once. A thrown script commits no pending operations. Check every operation outcome: independent valid edits may succeed when another edit is rejected. Keep each returned `APPLY#` receipt for atomic undo of that checkpoint.
|
|
10
|
+
|
|
11
|
+
## Choosing a selection
|
|
12
|
+
|
|
13
|
+
Choose boundaries from the request's source of truth. Prefer content-based selections when content identifies the target:
|
|
14
|
+
|
|
15
|
+
1. Use `find` for exact occurrences.
|
|
16
|
+
2. Use `between` for blocks identified by opening and closing content.
|
|
17
|
+
3. Use `select` for a structured search result.
|
|
18
|
+
4. Use `within`, `slice`, or `union` to narrow or combine those selections.
|
|
19
|
+
5. Use `linesOf` or `between(..., { lines: true })` when the operation must include complete lines.
|
|
20
|
+
6. Use `line(first, last)` only when the user supplied those line numbers or you independently verified both inclusive bounds.
|
|
21
|
+
|
|
22
|
+
Do not infer line ranges from the starting lines of nearby blocks. Do not include a following blank line unless the requested change includes that separator.
|
|
23
|
+
|
|
24
|
+
Selections are immutable and belong to one file snapshot. A flush refreshes open documents and makes earlier selections stale. Build new selections after each checkpoint.
|
|
25
|
+
|
|
26
|
+
## Read-only helpers
|
|
27
|
+
|
|
28
|
+
### `read({...})`
|
|
29
|
+
|
|
30
|
+
Use it to inspect a resource from inside an Apply script. It accepts the same arguments as the standalone Read tool and records its result automatically.
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
read({ path: "config.json", offset: 1, limit: 40 });
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Effect: reads the requested window without staging a mutation.
|
|
37
|
+
|
|
38
|
+
### `search({...})`
|
|
39
|
+
|
|
40
|
+
Use it to discover files, text, symbols, or structures before opening a document. It accepts the standalone Search arguments and records its result automatically.
|
|
41
|
+
|
|
42
|
+
```js
|
|
43
|
+
const matches = search({ query: '"oldName"', path: "src" });
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Effect: returns structured matches without changing files.
|
|
47
|
+
|
|
48
|
+
### `diff({before, after})`
|
|
49
|
+
|
|
50
|
+
Use it to compare two sources before deciding what to edit. It accepts the standalone Diff arguments and records its result automatically.
|
|
51
|
+
|
|
52
|
+
```js
|
|
53
|
+
diff({ before: "old\n", after: "new\n" });
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Effect: returns a read-only textual comparison.
|
|
57
|
+
|
|
58
|
+
## Opening documents
|
|
59
|
+
|
|
60
|
+
### `open(path | { path, views? })`
|
|
61
|
+
|
|
62
|
+
Use it before selecting or editing an existing text resource.
|
|
63
|
+
|
|
64
|
+
```js
|
|
65
|
+
const file = open("src/example.ts");
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Effect: creates an editor handle backed by an immutable snapshot. `file.source`, `file.content`, and `file.lines` expose its source, full canonical text, and line count. Supplying `views` changes how the source is opened when that resource supports views.
|
|
69
|
+
|
|
70
|
+
## Selection primitives
|
|
71
|
+
|
|
72
|
+
### `file.find(text)`
|
|
73
|
+
|
|
74
|
+
Use it when an exact string identifies one or more targets.
|
|
75
|
+
|
|
76
|
+
```js
|
|
77
|
+
const names = file.find("oldName");
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Effect: returns every exact occurrence in source order. It does not silently choose one occurrence. Use `slice` or `within` when only some occurrences are intended.
|
|
81
|
+
|
|
82
|
+
### `file.select(searchMatch)`
|
|
83
|
+
|
|
84
|
+
Use it to turn one structured Search match into a selection in its source document.
|
|
85
|
+
|
|
86
|
+
```js
|
|
87
|
+
const target = file.select(matches[0]);
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Effect: maps the match's line and column range to the open snapshot. It rejects matches from another file and matches whose recorded text is stale.
|
|
91
|
+
|
|
92
|
+
### `file.between(start, end, options?)`
|
|
93
|
+
|
|
94
|
+
Use it for blocks whose boundaries are identified by content or existing selections.
|
|
95
|
+
|
|
96
|
+
```js
|
|
97
|
+
const block = file.between("BEGIN", "END", { lines: true });
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Effect: pairs each start with the first end after that start, then continues with later non-overlapping pairs. By default both boundaries are included. `{ inside: true }` excludes both boundaries. `{ lines: true }` expands through the complete lines containing both boundaries, including the closing line's newline but not a following blank separator. `inside` and `lines` cannot be combined.
|
|
101
|
+
|
|
102
|
+
If repeated boundaries produce several blocks, narrow the result with `slice` rather than assuming only one pair exists.
|
|
103
|
+
|
|
104
|
+
### `file.line(first, last?)`
|
|
105
|
+
|
|
106
|
+
Use it only when the 1-based line bounds are authoritative or already verified.
|
|
107
|
+
|
|
108
|
+
```js
|
|
109
|
+
const header = file.line(1, 3);
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Effect: selects complete lines from `first` through `last`, inclusive. Omitting `last` selects one line. Invalid, negative, reversed, or out-of-range bounds are rejected.
|
|
113
|
+
|
|
114
|
+
### `file.start()` and `file.end()`
|
|
115
|
+
|
|
116
|
+
Use them as zero-width destinations when `copy` or `move` should insert at the beginning or end of a document.
|
|
117
|
+
|
|
118
|
+
```js
|
|
119
|
+
copy(source.find("preamble"), target.start());
|
|
120
|
+
move(source.find("appendix"), target.end());
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Effect: returns a zero-width linewise selection at byte zero or end of file. These are positions, not existing text.
|
|
124
|
+
|
|
125
|
+
### `file.before(selection)` and `file.after(selection)`
|
|
126
|
+
|
|
127
|
+
Use them to convert selected content into insertion positions.
|
|
128
|
+
|
|
129
|
+
```js
|
|
130
|
+
const destination = file.before(file.find("export default"));
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Effect: returns zero-width positions immediately before or after every selected range. Linewise selections retain linewise insertion behavior.
|
|
134
|
+
|
|
135
|
+
### `file.slice(selection, start?, end?)`
|
|
136
|
+
|
|
137
|
+
Use it to choose occurrences by position after a broader selector has found them.
|
|
138
|
+
|
|
139
|
+
```js
|
|
140
|
+
const first = file.slice(file.find("token"), 0, 1);
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Effect: returns the same ranges that normal JavaScript array `slice(start, end)` would retain. It does not alter the document.
|
|
144
|
+
|
|
145
|
+
### `file.union(...selections)`
|
|
146
|
+
|
|
147
|
+
Use it to combine separate selections from the same snapshot into one mutation target.
|
|
148
|
+
|
|
149
|
+
```js
|
|
150
|
+
const targets = file.union(file.find("alpha"), file.find("beta"));
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Effect: sorts ranges, removes exact duplicates, and rejects overlaps. It never turns sparse targets into one wide range containing the text between them.
|
|
154
|
+
|
|
155
|
+
### `file.within(candidates, scopes)`
|
|
156
|
+
|
|
157
|
+
Use it to keep only candidates fully contained by selected scopes.
|
|
158
|
+
|
|
159
|
+
```js
|
|
160
|
+
const localNames = file.within(file.find("name"), file.between("class A", "}"));
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Effect: returns each candidate whose complete range lies inside at least one scope.
|
|
164
|
+
|
|
165
|
+
### `file.linesOf(selection)`
|
|
166
|
+
|
|
167
|
+
Use it when content matches identify targets but the operation must affect their complete containing lines.
|
|
168
|
+
|
|
169
|
+
```js
|
|
170
|
+
const declarations = file.linesOf(file.find("const obsolete ="));
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Effect: expands every range to its containing line, preserves line endings, and removes duplicate line ranges.
|
|
174
|
+
|
|
175
|
+
## Text mutations
|
|
176
|
+
|
|
177
|
+
Every text mutation stages one operation for every selected range. Empty selections produce a warning rather than a guessed edit. Global forms infer the document from the SelectionSet; document methods provide the same behavior and may also accept a directly resolvable string target.
|
|
178
|
+
|
|
179
|
+
### `replace(selection, text)` and `file.replace(target, text)`
|
|
180
|
+
|
|
181
|
+
Use them to replace selected text.
|
|
182
|
+
|
|
183
|
+
```js
|
|
184
|
+
replace(file.find("oldName"), "newName");
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Effect: replaces every selected range with `text` in one transaction.
|
|
188
|
+
|
|
189
|
+
### `remove(selection)` and `file.remove(target)`
|
|
190
|
+
|
|
191
|
+
Use them to remove selected text, not files.
|
|
192
|
+
|
|
193
|
+
```js
|
|
194
|
+
remove(file.linesOf(file.find("obsolete();")));
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Effect: replaces every selected range with an empty string. Use precise sparse selections instead of a broad range spanning unrelated content.
|
|
198
|
+
|
|
199
|
+
### `insertBefore(selection, text)` and `file.insertBefore(target, text)`
|
|
200
|
+
|
|
201
|
+
Use them to insert text immediately before each selected range.
|
|
202
|
+
|
|
203
|
+
```js
|
|
204
|
+
insertBefore(file.linesOf(file.find("function run")), "// Entry point\n");
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Effect: keeps the selected text and inserts before it. For linewise selections, Apply supplies the needed line boundary.
|
|
208
|
+
|
|
209
|
+
### `insertAfter(selection, text)` and `file.insertAfter(target, text)`
|
|
210
|
+
|
|
211
|
+
Use them to insert text immediately after each selected range.
|
|
212
|
+
|
|
213
|
+
```js
|
|
214
|
+
insertAfter(file.linesOf(file.find("import value")), 'import other from "./other.js";\n');
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Effect: keeps the selected text and inserts after it. For linewise selections, Apply supplies the needed line boundary, including at an unterminated final line.
|
|
218
|
+
|
|
219
|
+
## Moving and copying text
|
|
220
|
+
|
|
221
|
+
### `copy(source, destination)`
|
|
222
|
+
|
|
223
|
+
Use it to duplicate selected text within one file or across open files.
|
|
224
|
+
|
|
225
|
+
```js
|
|
226
|
+
copy(source.find("sharedValue"), target.end());
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Effect: concatenates source ranges in selection order. A zero-width destination inserts that text; a non-empty destination replaces it. Source text remains unchanged.
|
|
230
|
+
|
|
231
|
+
### `move(source, destination)`
|
|
232
|
+
|
|
233
|
+
Use it to relocate selected text within one file or across open files.
|
|
234
|
+
|
|
235
|
+
```js
|
|
236
|
+
move(source.between("BEGIN", "END", { lines: true }), target.end());
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Effect: performs the same destination insertion or replacement as `copy`, then removes every source range in the same coherent transaction. Prefer linewise selections when moving complete blocks so separators remain stable.
|
|
240
|
+
|
|
241
|
+
## Whole-file operations
|
|
242
|
+
|
|
243
|
+
### `createFile(path, content)`
|
|
244
|
+
|
|
245
|
+
Use it to create a new file from complete content.
|
|
246
|
+
|
|
247
|
+
```js
|
|
248
|
+
createFile("src/new.ts", "export const value = 1;\n");
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Effect: stages creation at `path`. It does not overwrite an existing file.
|
|
252
|
+
|
|
253
|
+
### `file.delete()` and `deleteFile(path)`
|
|
254
|
+
|
|
255
|
+
Use `file.delete()` when an opened file should be deleted after its earlier staged operations. Use `deleteFile(path)` when no document handle is needed.
|
|
256
|
+
|
|
257
|
+
```js
|
|
258
|
+
const obsolete = open("src/obsolete.ts");
|
|
259
|
+
obsolete.delete();
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Effect: stages whole-file deletion. This is distinct from `remove(selection)`, which removes text.
|
|
263
|
+
|
|
264
|
+
### `copyFile(path, target, { overwrite? })`
|
|
265
|
+
|
|
266
|
+
Use it to copy one complete file.
|
|
267
|
+
|
|
268
|
+
```js
|
|
269
|
+
copyFile("config.example.json", "config.json");
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
Effect: stages a file copy. An existing regular target is rejected unless `overwrite: true` is explicit.
|
|
273
|
+
|
|
274
|
+
### `moveFile(path, target, { overwrite? })`
|
|
275
|
+
|
|
276
|
+
Use it to rename or relocate one complete file.
|
|
277
|
+
|
|
278
|
+
```js
|
|
279
|
+
moveFile("src/old.ts", "src/new.ts");
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Effect: stages a file move. An existing regular target is rejected unless `overwrite: true` is explicit.
|
|
283
|
+
|
|
284
|
+
## Checkpoints and transaction guarantees
|
|
285
|
+
|
|
286
|
+
### `file.flush()`
|
|
287
|
+
|
|
288
|
+
Use it to checkpoint independent operations staged for one document when later work needs a refreshed snapshot.
|
|
289
|
+
|
|
290
|
+
```js
|
|
291
|
+
file.replace(file.find("old"), "new");
|
|
292
|
+
file.flush();
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
Effect: commits that file's independent pending operations, refreshes its open handle, and makes its earlier selections stale. If the file participates in a pending cross-file `copy` or `move`, nothing for that file is flushed so the transfer keeps one coherent snapshot.
|
|
296
|
+
|
|
297
|
+
### `flush()`
|
|
298
|
+
|
|
299
|
+
Use it only when the script deliberately needs a global checkpoint before continuing.
|
|
300
|
+
|
|
301
|
+
```js
|
|
302
|
+
flush();
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
Effect: commits every pending operation, refreshes affected open handles, and can return an `APPLY#` receipt. Normal successful completion already performs one global flush. A later thrown error does not undo an earlier explicit checkpoint.
|
|
306
|
+
|
|
307
|
+
## Failure, ordering, and undo
|
|
308
|
+
|
|
309
|
+
Operations are evaluated against their captured snapshots, not against text shifted by earlier staged edits. This makes several non-overlapping edits safe without compensating line numbers. Overlapping or stale selections are rejected rather than guessed.
|
|
310
|
+
|
|
311
|
+
A successful checkpoint may return an `APPLY#` receipt. Restore every path touched by that checkpoint atomically with:
|
|
312
|
+
|
|
313
|
+
```js
|
|
314
|
+
undo({ transaction: "APPLY#..." });
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
Separate explicit checkpoints can produce separate receipts. Do not assume one receipt covers changes committed by an earlier flush.
|
|
318
|
+
|
|
319
|
+
## Standalone anchors and specialized resources
|
|
320
|
+
|
|
321
|
+
Standalone text tools support line anchors, syntax-scope anchors, search selections, and unique exact strings. With an `end` selector, they operate on complete lines through the line containing the end boundary. Without `end`, an exact string selects only that fragment.
|
|
322
|
+
|
|
323
|
+
When a standalone text tool allows an omitted path, it can inherit the source identified by its anchor, the last read, or the preceding edit in the same batch. Supply the path explicitly when that inheritance would be ambiguous.
|
|
324
|
+
|
|
325
|
+
Some resources attach non-text actions to the same tools:
|
|
326
|
+
|
|
327
|
+
- `shell:<session>` — `write` sends exact input, `insert` sends named keys, and `delete` terminates the session.
|
|
328
|
+
- `debug:<session>` — `insert` controls the debugger and `delete` removes a breakpoint or terminates the session.
|
|
329
|
+
- `symbol:<file>#<selector>#name` — `replace` performs a native language-server rename when available.
|
|
330
|
+
|
|
331
|
+
Read `docs:terminal`, `docs:debugger`, or `docs:search-code` before using those specialized resources.
|
|
332
|
+
|
|
333
|
+
Never guess after a stale snapshot, empty selection, ambiguous target, or unknown rollback effect.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Debugger workflow
|
|
2
|
+
|
|
3
|
+
Create a session with `debug`, then read the returned `debug:<session>` resource before choosing a breakpoint. Read a source resource with `views: ["anchors"]`; insert `breakpoint` at a current source anchor. Start and control the session by inserting `start`, `continue`, `step over`, `step into`, or `step out` on the session resource.
|
|
4
|
+
|
|
5
|
+
Read stopped state before the next action. Use `views: ["breakpoints"]` when breakpoint locations matter. Delete the returned breakpoint resource to remove that breakpoint. Delete the session resource to terminate it. Debug resources survive extension reloads, but program files and anchors may change, so re-read before acting.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Diagnostics workflow
|
|
2
|
+
|
|
3
|
+
Read `diagnostics:<path>` or add the `diagnostics` view to inspect file findings. Reports name the actual source and distinguish completed results, snapshots, pending checks, and unavailable providers. Silence and empty snapshots do not prove a file is clean.
|
|
4
|
+
|
|
5
|
+
Use diagnostics for focused file feedback; use the project's build or test command for whole-project verification. After edits, wait for or explicitly request the relevant completed check. Do not run a fixer when the task only calls for diagnosis.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Precise text editing
|
|
2
|
+
|
|
3
|
+
Use standalone `replace`, `insert`, `delete`, `copy`, and `move` whenever each intended change is known in advance and does not depend on another change. Submit several independent edits together as separate tool calls in one assistant response, whether they affect one file or several files.
|
|
4
|
+
|
|
5
|
+
Use `apply` only when the work requires computation, conditions, selection composition, checkpoints, or one coherent cross-file transaction. Do not replace a straightforward standalone batch with a JavaScript Apply program. Read `docs:apply` before writing an Apply script.
|
|
6
|
+
|
|
7
|
+
Use `write` only to create a file or deliberately replace its complete contents. Use `diff` for read-only comparison.
|
|
8
|
+
|
|
9
|
+
## Selecting text
|
|
10
|
+
|
|
11
|
+
Use a returned anchor when it identifies the intended text. Otherwise use the smallest unique exact string.
|
|
12
|
+
|
|
13
|
+
Supported selectors include:
|
|
14
|
+
|
|
15
|
+
- `LINE#HASH` — one current source line returned by the `anchors` view.
|
|
16
|
+
- `scope-begin-HASH` and `scope-end-HASH` — syntax-scope boundaries returned by the `ast` view.
|
|
17
|
+
- `SEARCH#...:line` — the complete containing line of a search result.
|
|
18
|
+
- `SEARCH#...:match` — only the exact search match.
|
|
19
|
+
- `begin` and `end` — the first and last existing source lines.
|
|
20
|
+
- A unique exact string — that text fragment itself.
|
|
21
|
+
|
|
22
|
+
With an `end` selector, the operation covers complete lines from the first line containing `start` through the last line containing `end`, inclusive. Without `end`, an exact string targets only that fragment, while a line or structured anchor targets its selected line or range.
|
|
23
|
+
|
|
24
|
+
Selections are revision-sensitive. Re-read after a mutation before reusing a single-file line, scope, or search anchor. Complete `SEARCH#...:all` selections can refresh their original query.
|
|
25
|
+
|
|
26
|
+
## Standalone mutation behavior
|
|
27
|
+
|
|
28
|
+
Batch independent mutations as separate tool calls in one assistant response. Every call in that batch is evaluated against the original file contents. Combine overlapping changes into one mutation. A rejected call does not cancel successful independent calls; retry only what was not applied.
|
|
29
|
+
|
|
30
|
+
When a text tool allows an omitted path, it can inherit the source identified by its anchor, the last read, or the preceding edit in the same batch. Supply the path when that inheritance would be ambiguous.
|
|
31
|
+
|
|
32
|
+
Use `delete` with a path and no text selector to delete one complete file. Use a selector to remove text. Use `copy` or `move` with no text selectors for whole-file operations; add source and destination selectors for text transfers.
|
|
33
|
+
|
|
34
|
+
## Specialized resources
|
|
35
|
+
|
|
36
|
+
Some resources attach non-text actions to the same tools:
|
|
37
|
+
|
|
38
|
+
- `shell:<session>` — `write` sends exact input, `insert` sends named keys, and `delete` terminates the session.
|
|
39
|
+
- `debug:<session>` — `insert` controls the debugger and `delete` removes a breakpoint or terminates the session.
|
|
40
|
+
- `symbol:<file>#<selector>#name` — `replace` performs a native language-server rename when available.
|
|
41
|
+
|
|
42
|
+
Read `docs:terminal`, `docs:debugger`, or `docs:search-code` before using those specialized resources.
|
|
43
|
+
|
|
44
|
+
Never guess after a stale snapshot, empty selection, ambiguous target, or unknown rollback effect.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Git changes and undo workflow
|
|
2
|
+
|
|
3
|
+
Read a tracked file with `views: ["changes"]` to see staged and unstaged hunks and current `CHANGE#` anchors. Stage or unstage only the selected current change. Anchors are revision-sensitive, so re-read after index or worktree changes.
|
|
4
|
+
|
|
5
|
+
Use `undo` with an `APPLY#` receipt to restore every path from one Apply checkpoint atomically. Use a `CHANGE#` anchor to restore that selected Git change to `HEAD` in both worktree and index. Use `last` with a file only for that file's latest text-editor transaction. Inspect current changes before destructive restoration.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Read JSON with jq
|
|
2
|
+
|
|
3
|
+
Use a `jq:` view when a JSON resource is too large or you need a structured subset.
|
|
4
|
+
|
|
5
|
+
```json
|
|
6
|
+
{ "path": "package.json", "views": ["jq:.scripts"] }
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
The text after `jq:` is a normal jq filter. It is passed as one argument to the installed `jq` executable, while the selected resource is sent through standard input.
|
|
10
|
+
|
|
11
|
+
## Common filters
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
jq:.
|
|
15
|
+
jq:.dependencies | keys
|
|
16
|
+
jq:.users[] | select(.active) | {id, name}
|
|
17
|
+
jq:[.items[].price] | add
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
A filter may produce no values, one value, or several values. Output keeps jq's normal pretty-printed JSON form.
|
|
21
|
+
|
|
22
|
+
## Read part of the result
|
|
23
|
+
|
|
24
|
+
`offset` and `limit` select lines from the transformed jq output, not from the original file.
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{ "path": "large.json", "views": ["jq:.items"], "offset": 101, "limit": 100 }
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Follow the continuation offset returned by Read. Oversized complete output may also provide a temporary resource.
|
|
31
|
+
|
|
32
|
+
## Limits
|
|
33
|
+
|
|
34
|
+
- Supply exactly one non-empty `jq:` view.
|
|
35
|
+
- Do not combine `jq:` with annotation views. Their source coordinates would not describe the transformed JSON.
|
|
36
|
+
- The resource must contain valid JSON.
|
|
37
|
+
- jq must be installed and available on the project or system `PATH`.
|
|
38
|
+
- Module loading is disabled. The process receives only a minimal environment and the selected JSON on standard input.
|
|
39
|
+
- Execution is limited to five seconds and 10 MB of jq output.
|
|
40
|
+
|
|
41
|
+
Use ordinary Read when you need the original source lines or anchors. Use the jq view for inspection and computation only; it does not edit the file.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Read resources workflow
|
|
2
|
+
|
|
3
|
+
## Selecting a source
|
|
4
|
+
|
|
5
|
+
`path` selects a resource. Supported providers include regular files and directories, `file:` URLs, HTTP(S) URLs, PDFs, images, returned `temp:` references, `SEARCH#` references, and enabled protocol resources.
|
|
6
|
+
|
|
7
|
+
Common protocol resources include:
|
|
8
|
+
|
|
9
|
+
- `raw:<file>` — original bytes without decoding.
|
|
10
|
+
- `docs:` and `docs:<id>` — packaged agent guidance.
|
|
11
|
+
- `ast:<path>` — compact syntax outline.
|
|
12
|
+
- `symbol:<file>#<selector>` — one declaration.
|
|
13
|
+
- `graph:<file>` and `graph:<file>#<selector>` — declarations and relationships.
|
|
14
|
+
- `diagnostics:<path>` — lint and language-server findings.
|
|
15
|
+
- `process:<PID>` — process metadata.
|
|
16
|
+
- `window:<PID>` and `display:` — visual capture when enabled.
|
|
17
|
+
- `shell:<session>` — terminal state and retained output.
|
|
18
|
+
- `debug:<session>` — debugger state.
|
|
19
|
+
|
|
20
|
+
A source may also include a returned anchor, such as `notes.txt#12#A4F0`. A `SEARCH#` reference already identifies its source, so pass it directly as `path`.
|
|
21
|
+
|
|
22
|
+
## Windows and continuation
|
|
23
|
+
|
|
24
|
+
For text resources, `offset` is a one-based starting line and `limit` is the maximum number of lines. Zero starts at the first line; negative offsets count from the end. On an anchored path, offsets are relative to the containing source line. Follow returned continuation offsets or temporary references instead of repeating an oversized read.
|
|
25
|
+
|
|
26
|
+
For `raw:` resources, offsets and limits count bytes. A negative offset counts from the end and a zero limit reads no bytes. Raw resources do not accept text anchors or views.
|
|
27
|
+
|
|
28
|
+
Temporary resources remain available only in their owning runtime.
|
|
29
|
+
|
|
30
|
+
## Views
|
|
31
|
+
|
|
32
|
+
Views request source-specific presentations without changing the selected resource. Common views include:
|
|
33
|
+
|
|
34
|
+
- `anchors` — editable `LINE#HASH` references.
|
|
35
|
+
- `ast` — syntax-scope boundaries.
|
|
36
|
+
- `changes` — staged and unstaged Git changes with `CHANGE#` anchors.
|
|
37
|
+
- `diagnostics` — findings beside source text.
|
|
38
|
+
- `breakpoints` — current debugger breakpoint locations.
|
|
39
|
+
- `image` — one visual frame or terminal screen.
|
|
40
|
+
- `sequence` — several ordered visual frames.
|
|
41
|
+
|
|
42
|
+
Combine views only when both presentations are needed. Read the smallest useful source window and treat unsupported source/view combinations as errors rather than silently substituting another resource.
|
|
43
|
+
|
|
44
|
+
For image grid selection, `limit` is the square cell size in output pixels and `offset` is the zero-based row-major cell number. `limit` without `offset` selects cell zero; `offset` without `limit` is invalid.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Search, AST, and LSP workflow
|
|
2
|
+
|
|
3
|
+
## Text and path search
|
|
4
|
+
|
|
5
|
+
Use ordinary queries for literal text. If no literal result exists, unquoted input is tried as a regular expression and then ordinary multi-word input may be broadened to separate words. Quoted terms stay literal. Treat broadened results as location hints rather than safe edit selections.
|
|
6
|
+
|
|
7
|
+
Use uppercase `AND` and `OR`, infix `NOT`, `||`, or a space-separated `|` for Boolean queries. Parentheses group Boolean conditions. An unspaced `|`, regex groups, and character classes remain regular-expression syntax. Use `regex:<pattern>` to force regex matching.
|
|
8
|
+
|
|
9
|
+
Use `files:<pattern>` for paths. Slash-containing globs match workspace-relative paths; basename globs match at any depth. Narrow with `path`, `include`, and `exclude` before broadening a noisy query.
|
|
10
|
+
|
|
11
|
+
## Search resources
|
|
12
|
+
|
|
13
|
+
Every result exposes `SEARCH#HASH:N:line` for its containing line and `SEARCH#HASH:N:match` for the exact match. Complete selections use `:all:line` or `:all:match`. Pass these references directly to read or editing tools; omit the file path when an all-selection spans files.
|
|
14
|
+
|
|
15
|
+
A single-result reference becomes stale after its file changes. Re-run the search before reuse. A complete `:all` reference refreshes its original query when selected files change. Compacted output retains complete all-selections.
|
|
16
|
+
|
|
17
|
+
## AST search
|
|
18
|
+
|
|
19
|
+
Use `ast:<pattern>` for syntax-aware matching. `$NAME` captures one syntax node and `$$$BODY` captures several nodes. Returned search references can select multiline matches for read, replace, copy, move, delete, and Apply. An incomplete result does not provide a complete all-selection. Text replacement through an AST selection does not update imports or references automatically.
|
|
20
|
+
|
|
21
|
+
## Symbols and graphs
|
|
22
|
+
|
|
23
|
+
Use `symbols:<query>` to locate declarations and references when the source file is unknown. Use `symbol:<file>#<selector>` to read one declaration. Use `graph:<file>` for the file's top-level declarations and relationships, or `graph:<file>#<selector>` for incoming and outgoing references of one declaration.
|
|
24
|
+
|
|
25
|
+
Append `#name` to an exact symbol resource only for a native language-server rename across references. If semantic support is unavailable, use a precise text or AST operation instead of pretending it was a semantic rename. Pending or empty language-server output does not prove that no declaration or reference exists.
|
|
26
|
+
|
|
27
|
+
## Other search protocols
|
|
28
|
+
|
|
29
|
+
Use `process:<query>` for running processes. Use `path: "shell:<session>"` to search retained terminal output beyond its current tail.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Terminal and process workflow
|
|
2
|
+
|
|
3
|
+
Use `bash` for project commands. 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
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
Use `process:<query>` search before reading `process:<PID>` or capturing `window:<PID>`. Do not assume silent background work has completed.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Visual capture workflow
|
|
2
|
+
|
|
3
|
+
Discover a process first with `process:<query>`, then read `window:<PID>` for an allowed application window. Use `display:` or `display:#N` only when display capture is enabled. Add `views: ["image"]` for a still image or `views: ["sequence"]` when motion or timing requires multiple frames.
|
|
4
|
+
|
|
5
|
+
Tune sequence duration, interval, scale, and region only when defaults do not fit. Region uses normalized `x,y,width,height` and is applied before scaling. For image grids, use `limit` as the square cell size and `offset` as a zero-based row-major cell index. Avoid capturing unrelated desktop content.
|
package/docs/configuration.md
CHANGED
|
@@ -12,8 +12,9 @@ The Features tab includes **Disable Apply** (`pi-agent-ide-no-apply`). Enable it
|
|
|
12
12
|
|
|
13
13
|
Agent Vision adds separate opt-ins for **Capture arbitrary windows** and **Capture full displays**. Both default to off. Its text settings control the default sequence duration, frame interval, image scale, and a comma-separated list of exact executable file names that may be captured without arbitrary-window access. Press Enter to edit a text value, Enter again to commit it, then Ctrl+S to save.
|
|
14
14
|
|
|
15
|
-
The UI tab contains
|
|
16
|
-
|
|
15
|
+
The UI tab contains separate presentation settings for Apply previews, diffs, Read, Search, and terminal output. Each setting supports **Full**, **Compact**, and **Disabled**. Compact is the product default. Full shows all available content, while Disabled keeps only a concise, honest status and still shows failures and warnings. Expanding a tool call always shows the full presentation, regardless of its collapsed preference. These settings affect only the TUI; agent-facing results and tool behavior do not change.
|
|
16
|
+
|
|
17
|
+
Apply previews never execute arguments and do not indicate successful edits; operation results are shown separately. In compact mode, completed source is formatted before recognized helper calls are projected into concise operation headers. Incomplete code uses the recoverable source preview. Headers keep supplied anchors and compact long argument expressions with their source size; those sizes are not counts of applied edits. Full mode shows the complete display copy. Execution always receives the original source.
|
|
17
18
|
|
|
18
19
|
All user-configurable presentation and behavior preferences belong in Agent IDE settings. New options must carry a human name, explanation and default in their registration. Presentation options belong in the UI tab.
|
|
19
20
|
|
|
@@ -106,6 +107,7 @@ A project can override it in `<project>/.pi/pi-agent-ide/search.json`. Set `time
|
|
|
106
107
|
|
|
107
108
|
Pi Agent IDE ships formatter, linter, and LSP mappings. You do not need to copy them into each project. Install the tools and their required modules separately. Pi looks in project `node_modules/.bin`, Python `.venv` and `venv` executable directories, `vendor/bin`, and `PATH`. Python environments use `Scripts` on Windows and `bin` elsewhere. Windows command lookup respects `PATHEXT`, including `.cmd` launchers.
|
|
108
109
|
|
|
110
|
+
Built-in formatters run only when the project contains matching evidence, such as `go.mod`, `Cargo.toml`, `.clang-format`, or a formatter configuration file. An executable being present on the machine and a matching file extension are not enough. Explicit project or global formatter entries remain opt-in configuration and do not require built-in evidence.
|
|
109
111
|
You can replace built-in entries or add custom entries in either of these directories:
|
|
110
112
|
|
|
111
113
|
```text
|
|
@@ -223,19 +225,9 @@ Exact text anchors work without configuration. Optional recovery settings live i
|
|
|
223
225
|
|
|
224
226
|
Missing fields use these defaults. Invalid values stop the editor from loading. Fuzzy recovery only returns candidates; it never applies an edit. The safe maxima are 100 exact candidates, 20 fuzzy candidates, 20 context lines, a 10-second timeout, a 100 MiB file, a 4 MiB query, 10 seed lines, and a block variance of 10 lines.
|
|
225
227
|
|
|
226
|
-
### Diff
|
|
227
|
-
|
|
228
|
-
Edit tool diffs show every diff row by default. The panel keeps completed rows visible and grows as the edit streams in. Set `renderer.diffView` to `"compact"` in `.pi/pi-agent-ide/text-editor.json` to choose a sliding window instead:
|
|
229
|
-
|
|
230
|
-
```json
|
|
231
|
-
{
|
|
232
|
-
"renderer": {
|
|
233
|
-
"diffView": "compact"
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
```
|
|
228
|
+
### Diff presentation
|
|
237
229
|
|
|
238
|
-
|
|
230
|
+
Use **Diff presentation** in the Agent IDE settings UI to choose Full, Compact, or Disabled diff panels. Compact is the default and shows a focused sliding window. Full shows every available diff row. Disabled hides diff rows but keeps mutation totals, status, failures, and warnings visible. Expanding a tool call temporarily shows the full diff. The setting applies to standalone mutations, the `diff` tool, and Apply results.
|
|
239
231
|
|
|
240
232
|
## Extension config behavior
|
|
241
233
|
|