pi-agent-ide 0.6.0 → 0.6.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 +41 -0
- package/README.md +146 -68
- package/assets/social-preview.png +0 -0
- package/assets/summary/debugging.png +0 -0
- package/assets/summary/editing.png +0 -0
- package/assets/summary/read.png +0 -0
- package/assets/summary/search-and-replace.png +0 -0
- package/assets/summary/search.png +0 -0
- package/assets/summary/settings.png +0 -0
- package/assets/summary/terminal.png +0 -0
- package/assets/summary/thumbs/debugging.png +0 -0
- package/assets/summary/thumbs/editing.png +0 -0
- package/assets/summary/thumbs/read.png +0 -0
- package/assets/summary/thumbs/search-and-replace.png +0 -0
- package/assets/summary/thumbs/search.png +0 -0
- package/assets/summary/thumbs/settings.png +0 -0
- package/assets/summary/thumbs/terminal.png +0 -0
- package/assets/summary/thumbs/user_terminal.png +0 -0
- package/assets/summary/user_terminal.png +0 -0
- package/dist/chunk-3E2NTWCN.js +2 -0
- package/dist/chunk-7WCZOO5I.js +1 -0
- package/dist/chunk-CEX3VOJ7.js +2 -0
- package/dist/chunk-FA6BKC5Y.js +1 -0
- package/dist/{chunk-2527OQ4Y.js → chunk-HMLH43ZS.js} +1 -1
- package/dist/chunk-LVWMWWWF.js +28 -0
- package/dist/chunk-MPT3R4BL.js +0 -0
- package/dist/chunk-PZFOOHY2.js +15 -0
- package/dist/{chunk-HKMBQLEK.js → chunk-QDLTO5PH.js} +1 -1
- package/dist/{chunk-Z3VC3S2T.js → chunk-QIK2E64R.js} +1 -1
- package/dist/{chunk-OYWIZII6.js → chunk-S6QRG3TQ.js} +1 -1
- package/dist/chunk-T7CZIACQ.js +27 -0
- package/dist/chunk-T7I2VX3J.js +1 -0
- package/dist/chunk-VCTK4JSN.js +3 -0
- package/dist/chunk-VXD6FZP5.js +5 -0
- package/dist/chunk-W7CASEO3.js +1 -0
- package/dist/chunk-YT42LKFV.js +16 -0
- package/dist/entry-1.js +1 -1
- 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-2.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 +13 -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 +10 -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 +1 -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 +0 -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 +1 -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 +0 -30
- package/dist/entry-74.js +1 -2
- package/dist/entry-75.js +1 -1
- package/dist/entry-76.js +1 -1
- package/dist/entry-77.js +315 -3
- package/dist/entry-78.js +30 -3
- package/dist/entry-79.js +2 -1
- package/dist/entry-80.js +1 -1
- package/dist/entry-81.js +1 -1
- package/dist/entry-82.js +3 -0
- package/dist/entry-83.js +3 -0
- package/dist/entry-84.js +1 -0
- package/dist/entry-85.js +1 -0
- package/dist/entry-86.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 +12 -11
- package/node_modules/pi-agent-ide-ast/runtime/entry-30.js +1 -0
- package/node_modules/pi-agent-ide-ast/src/search-presentation.ts +117 -0
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +20 -2
- 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 +17 -9
- package/node_modules/pi-agent-search-text/runtime/entry-53.js +1 -0
- package/node_modules/pi-agent-search-text/src/persisted-result.ts +9 -7
- package/node_modules/pi-agent-search-text/src/search-renderer.ts +10 -4
- package/node_modules/pi-agent-search-text/src/search-result.ts +8 -1
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text/runtime/entry-55.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-56.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-58.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-60.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/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/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-80.js +1 -0
- package/node_modules/pi-agent-tool-ui/package.json +2 -2
- package/node_modules/pi-agent-tool-ui/runtime/entry-81.js +1 -0
- package/node_modules/pi-agent-web/package.json +7 -7
- package/node_modules/pi-agent-web/runtime/entry-82.js +2 -0
- package/node_modules/pi-agent-web-html/package.json +3 -3
- package/node_modules/pi-agent-web-html/runtime/entry-83.js +2 -0
- package/node_modules/pi-agent-web-image/package.json +4 -4
- package/node_modules/pi-agent-web-image/runtime/entry-84.js +2 -0
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/runtime/entry-85.js +2 -0
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-86.js +2 -0
- package/package.json +108 -44
- package/src/api/documentation.ts +2 -0
- package/src/api/plugin-protocol.ts +10 -4
- 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-html/runtime/entry-83.js +2 -0
- 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-84.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-85.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-86.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-82.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 +17 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-53.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/persisted-result.ts +9 -7
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +10 -4
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +8 -1
- 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-56.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-57.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-58.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-59.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-60.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-78.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/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-79.js +2 -0
- 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 +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-76.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-77.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 +12 -11
- package/src/plugins/pi-agent-ide-ast/runtime/entry-30.js +1 -0
- package/src/plugins/pi-agent-ide-ast/src/search-presentation.ts +117 -0
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +20 -2
- 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 +44 -14
- package/src/plugins/pi-agent-ide-debugger/src/renderer.ts +10 -1
- package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +39 -0
- package/src/plugins/pi-agent-ide-debugger/src/ui.ts +42 -5
- 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 +88 -12
- package/src/plugins/pi-agent-ide-terminal/src/screen-image.ts +6 -2
- 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 +10 -7
- package/src/plugins/pi-agent-ide-vision/src/vision.ts +17 -3
- package/assets/gallery/apply-editing.png +0 -0
- package/assets/gallery/debugging.png +0 -0
- package/assets/gallery/read-web.png +0 -0
- package/assets/gallery/search-replace.png +0 -0
- package/assets/gallery/terminal.png +0 -0
- package/assets/gallery/tool-editing.png +0 -0
- 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-HSM6R7IB.js +0 -27
- 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-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/runtime/entry-60.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-web-pdf/runtime/entry-80.js +0 -2
- package/node_modules/pi-agent-web-text/runtime/entry-81.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/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-81.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-77.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-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/extensions/pi-agent-text-editor/runtime/entry-59.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-60.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-anchor-line-hash → pi-agent-search-text}/runtime/entry-54.js +0 -0
- /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-exact}/runtime/entry-57.js +0 -0
- /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-line-hash}/runtime/entry-59.js +0 -0
- /package/node_modules/{pi-agent-tool-call-interception → pi-agent-text-editor}/runtime/entry-75.js +0 -0
- /package/node_modules/{pi-agent-tool-ui → pi-agent-text-editor}/runtime/entry-76.js +0 -0
- /package/node_modules/{pi-agent-web → pi-agent-text-editor}/runtime/entry-77.js +0 -0
- /package/node_modules/{pi-agent-web-html → pi-agent-text-editor-renderer}/runtime/entry-78.js +0 -0
- /package/node_modules/{pi-agent-web-image → pi-agent-text-editor-stale-anchor}/runtime/entry-79.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-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-text-editor/plugins/pi-agent-text-anchor-line-hash → pi-agent-search/plugins/pi-agent-search-text}/runtime/entry-54.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
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { AgentIdePreset } from "./presets.js";
|
|
2
|
+
import { readAgentIdePreset } from "./presets.js";
|
|
1
3
|
import { readFile } from "node:fs/promises";
|
|
2
4
|
import os from "node:os";
|
|
3
5
|
import path from "node:path";
|
|
@@ -20,6 +22,8 @@ export interface PiAgentIdeExtensionsConfig {
|
|
|
20
22
|
readonly flags?: Readonly<Record<string, boolean>>;
|
|
21
23
|
/** String preference overrides keyed by their registered IDs. */
|
|
22
24
|
readonly preferences?: Readonly<Record<string, string>>;
|
|
25
|
+
/** Built-in capability preset. */
|
|
26
|
+
readonly preset?: AgentIdePreset;
|
|
23
27
|
/** Disable decorative mutation playback while keeping final results visible. */
|
|
24
28
|
readonly noAnimations?: boolean;
|
|
25
29
|
/** Skip automatic formatting and diagnostics triggered by edits. */
|
|
@@ -73,6 +77,7 @@ export async function readPiAgentIdeExtensionsConfig(
|
|
|
73
77
|
...(globalConfig.preferences === undefined && projectConfig.preferences === undefined
|
|
74
78
|
? {}
|
|
75
79
|
: { preferences: { ...globalConfig.preferences, ...projectConfig.preferences } }),
|
|
80
|
+
preset: projectConfig.preset ?? globalConfig.preset ?? "full",
|
|
76
81
|
noAnimations: projectConfig.noAnimations ?? globalConfig.noAnimations ?? false,
|
|
77
82
|
noPostProcessing: projectConfig.noPostProcessing ?? globalConfig.noPostProcessing ?? false,
|
|
78
83
|
};
|
|
@@ -136,6 +141,7 @@ async function readConfigExtensionIds(configPath: string): Promise<PiAgentIdeExt
|
|
|
136
141
|
...(value.preferences === undefined
|
|
137
142
|
? {}
|
|
138
143
|
: { preferences: readPreferences(value.preferences, configPath) }),
|
|
144
|
+
...(value.preset === undefined ? {} : { preset: readAgentIdePreset(value.preset, configPath) }),
|
|
139
145
|
...(value.noAnimations === undefined
|
|
140
146
|
? {}
|
|
141
147
|
: { noAnimations: readBoolean(value, "noAnimations", configPath) }),
|
|
@@ -5,6 +5,10 @@ export const moduleLabels = {
|
|
|
5
5
|
"Shared services used by language, formatting and diagnostic modules.",
|
|
6
6
|
],
|
|
7
7
|
"ide.tips": ["Getting started tips", "Show contextual guidance while setting up a project."],
|
|
8
|
+
"ide.documentation": [
|
|
9
|
+
"Progressive agent documentation",
|
|
10
|
+
"Expose packaged guides and attach them on first relevant tool use.",
|
|
11
|
+
],
|
|
8
12
|
"ide.doctor": ["Setup doctor", "Check external tools and help configure project support."],
|
|
9
13
|
"ide.languages": ["Language setup", "Discover languages and their recommended toolchains."],
|
|
10
14
|
"ide.processes": [
|
|
@@ -25,6 +29,7 @@ export const moduleLabels = {
|
|
|
25
29
|
],
|
|
26
30
|
"read.core": ["Read tools", "Read sources through the configured readers and views."],
|
|
27
31
|
"read.filesystem": ["Local files", "Resolve files and folders from the local filesystem."],
|
|
32
|
+
"read.filesystem.jq": ["JSON queries", "Query local JSON files through jq read views."],
|
|
28
33
|
"read.filesystem.image": ["Local images", "Read local images as visual content."],
|
|
29
34
|
"read.filesystem.pdf": ["Local PDFs", "Extract readable content from local PDF documents."],
|
|
30
35
|
"read.filesystem.text": ["Local text", "Read local text files with their source coordinates."],
|
|
@@ -2,6 +2,7 @@ import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { withFileMutationQueue } from "@earendil-works/pi-coding-agent";
|
|
4
4
|
import { readExtensionSettingsScope } from "./extensions-config.js";
|
|
5
|
+
import type { AgentIdePreset } from "./presets.js";
|
|
5
6
|
|
|
6
7
|
/** A scope override; default removes this scope's explicit choice. */
|
|
7
8
|
export type ModuleChoice = "default" | "enabled" | "disabled";
|
|
@@ -12,6 +13,7 @@ export async function saveModuleChoices(
|
|
|
12
13
|
choices: ReadonlyMap<string, ModuleChoice>,
|
|
13
14
|
featureChoices: ReadonlyMap<string, boolean | undefined> = new Map(),
|
|
14
15
|
preferenceChoices: ReadonlyMap<string, string | undefined> = new Map(),
|
|
16
|
+
presetChoice?: AgentIdePreset,
|
|
15
17
|
): Promise<void> {
|
|
16
18
|
await withFileMutationQueue(configPath, async () => {
|
|
17
19
|
const settings = await readExtensionSettingsScope(configPath);
|
|
@@ -49,6 +51,7 @@ export async function saveModuleChoices(
|
|
|
49
51
|
...original,
|
|
50
52
|
disabled: [...disabled],
|
|
51
53
|
enabled: [...enabled],
|
|
54
|
+
...(presetChoice === undefined ? {} : { preset: presetChoice }),
|
|
52
55
|
...(featureChoices.size > 0 ? { flags } : {}),
|
|
53
56
|
...(preferenceChoices.size > 0 ? { preferences } : {}),
|
|
54
57
|
},
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
} from "./extensions-config.js";
|
|
9
9
|
import type { FeatureFlag } from "./feature-flags.js";
|
|
10
10
|
import type { AgentIdePreference } from "./preferences.js";
|
|
11
|
+
import { AGENT_IDE_PRESET_OPTIONS, disabledByPreset, type AgentIdePreset } from "./presets.js";
|
|
11
12
|
import { saveModuleChoices, type ModuleChoice } from "./module-settings-store.js";
|
|
12
13
|
import { createSettingsPanel } from "./settings-panel.js";
|
|
13
14
|
import { selectBuiltinExtensions } from "./selection.js";
|
|
@@ -34,6 +35,7 @@ export function registerModuleSettings(
|
|
|
34
35
|
const choices = new Map<string, ModuleChoice>();
|
|
35
36
|
const featureChoices = new Map<string, boolean | undefined>();
|
|
36
37
|
const preferenceChoices = new Map<string, string | undefined>();
|
|
38
|
+
let presetChoice: AgentIdePreset | undefined;
|
|
37
39
|
const saved = await ctx.ui.custom<boolean>((tui, theme, _keys, done) => {
|
|
38
40
|
const panel = createSettingsPanel(
|
|
39
41
|
theme,
|
|
@@ -48,7 +50,12 @@ export function registerModuleSettings(
|
|
|
48
50
|
}
|
|
49
51
|
const effective = selectBuiltinExtensions(
|
|
50
52
|
BUILTIN_EXTENSIONS,
|
|
51
|
-
[
|
|
53
|
+
[
|
|
54
|
+
...disabledByPreset(BUILTIN_EXTENSIONS, presetChoice ?? current.preset ?? "full"),
|
|
55
|
+
...disabled,
|
|
56
|
+
...disabledByPreset(BUILTIN_EXTENSIONS, other.preset ?? "full"),
|
|
57
|
+
...other.disabled,
|
|
58
|
+
],
|
|
52
59
|
[...enabled, ...other.enabled],
|
|
53
60
|
);
|
|
54
61
|
return {
|
|
@@ -65,9 +72,20 @@ export function registerModuleSettings(
|
|
|
65
72
|
: "default"),
|
|
66
73
|
values: ["default", "enabled", "disabled"],
|
|
67
74
|
})),
|
|
68
|
-
features: [...flagItems("features"), ...preferenceItems("features")],
|
|
75
|
+
features: [presetItem(), ...flagItems("features"), ...preferenceItems("features")],
|
|
69
76
|
ui: [...flagItems("ui"), ...preferenceItems("ui")],
|
|
70
77
|
};
|
|
78
|
+
function presetItem() {
|
|
79
|
+
const value = presetChoice ?? current.preset ?? "full";
|
|
80
|
+
return {
|
|
81
|
+
id: "preset",
|
|
82
|
+
label: "Preset",
|
|
83
|
+
description: "Choose the built-in Agent IDE capability set. Reload required.",
|
|
84
|
+
currentValue:
|
|
85
|
+
AGENT_IDE_PRESET_OPTIONS.find((item) => item.value === value)?.label ?? value,
|
|
86
|
+
values: AGENT_IDE_PRESET_OPTIONS.map((item) => item.label),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
71
89
|
function preferenceItems(group: "features" | "ui") {
|
|
72
90
|
return preferences
|
|
73
91
|
.filter((preference) => preference.group === group)
|
|
@@ -131,7 +149,9 @@ export function registerModuleSettings(
|
|
|
131
149
|
},
|
|
132
150
|
(tab, id, value) => {
|
|
133
151
|
if (tab === "modules") choices.set(id, value as ModuleChoice);
|
|
134
|
-
else if (
|
|
152
|
+
else if (id === "preset") {
|
|
153
|
+
presetChoice = AGENT_IDE_PRESET_OPTIONS.find((item) => item.label === value)?.value;
|
|
154
|
+
} else if (preferences.some((item) => item.id === id)) {
|
|
135
155
|
const preference = preferences.find((item) => item.id === id);
|
|
136
156
|
preferenceChoices.set(
|
|
137
157
|
id,
|
|
@@ -162,8 +182,22 @@ export function registerModuleSettings(
|
|
|
162
182
|
},
|
|
163
183
|
};
|
|
164
184
|
});
|
|
165
|
-
if (
|
|
166
|
-
|
|
185
|
+
if (
|
|
186
|
+
!saved ||
|
|
187
|
+
choices.size +
|
|
188
|
+
featureChoices.size +
|
|
189
|
+
preferenceChoices.size +
|
|
190
|
+
(presetChoice === undefined ? 0 : 1) ===
|
|
191
|
+
0
|
|
192
|
+
)
|
|
193
|
+
return;
|
|
194
|
+
await saveModuleChoices(
|
|
195
|
+
selectedPath,
|
|
196
|
+
choices,
|
|
197
|
+
featureChoices,
|
|
198
|
+
preferenceChoices,
|
|
199
|
+
presetChoice,
|
|
200
|
+
);
|
|
167
201
|
ctx.ui.notify(`Saved ${scope.toLowerCase()} Agent IDE settings. Reload required.`, "info");
|
|
168
202
|
if (
|
|
169
203
|
await ctx.ui.confirm(
|
|
@@ -14,8 +14,45 @@ export type AgentIdePreference =
|
|
|
14
14
|
})
|
|
15
15
|
| (AgentIdePreferenceBase & { readonly kind: "text"; readonly placeholder?: string });
|
|
16
16
|
|
|
17
|
+
function presentationPreference(id: string, name: string, description: string): AgentIdePreference {
|
|
18
|
+
return {
|
|
19
|
+
kind: "choice",
|
|
20
|
+
id,
|
|
21
|
+
name,
|
|
22
|
+
description,
|
|
23
|
+
default: "compact",
|
|
24
|
+
group: "ui",
|
|
25
|
+
values: [
|
|
26
|
+
{ value: "full", label: "Full" },
|
|
27
|
+
{ value: "compact", label: "Compact" },
|
|
28
|
+
{ value: "disabled", label: "Disabled" },
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
17
33
|
/** Registered presentation preferences. */
|
|
18
34
|
export const AGENT_IDE_PREFERENCES: readonly AgentIdePreference[] = [
|
|
35
|
+
presentationPreference(
|
|
36
|
+
"ui.applyPreview",
|
|
37
|
+
"Apply preview",
|
|
38
|
+
"Choose how Apply source previews are displayed.",
|
|
39
|
+
),
|
|
40
|
+
presentationPreference(
|
|
41
|
+
"ui.diffs",
|
|
42
|
+
"Diffs",
|
|
43
|
+
"Choose how mutation and comparison diffs are displayed.",
|
|
44
|
+
),
|
|
45
|
+
presentationPreference("ui.read", "Read", "Choose how Read calls and results are displayed."),
|
|
46
|
+
presentationPreference(
|
|
47
|
+
"ui.search",
|
|
48
|
+
"Search",
|
|
49
|
+
"Choose how Search calls and results are displayed.",
|
|
50
|
+
),
|
|
51
|
+
presentationPreference(
|
|
52
|
+
"ui.terminal",
|
|
53
|
+
"Terminal",
|
|
54
|
+
"Choose how shell commands and terminal output are displayed.",
|
|
55
|
+
),
|
|
19
56
|
{
|
|
20
57
|
kind: "choice",
|
|
21
58
|
id: "processes.activity",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type ToolPresentation = "full" | "compact" | "disabled";
|
|
2
|
+
|
|
3
|
+
/** Resolve a stored presentation choice with the compact product default. */
|
|
4
|
+
export function toolPresentation(value: string | undefined): ToolPresentation {
|
|
5
|
+
return value === "full" || value === "disabled" ? value : "compact";
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/** Expanded tools always show their full presentation. */
|
|
9
|
+
export function effectiveToolPresentation(
|
|
10
|
+
preference: ToolPresentation,
|
|
11
|
+
expanded: boolean,
|
|
12
|
+
): ToolPresentation {
|
|
13
|
+
return expanded ? "full" : preference;
|
|
14
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { BuiltinExtension } from "./selection.js";
|
|
2
|
+
|
|
3
|
+
/** Agent IDE capability presets saved in extension settings. */
|
|
4
|
+
export type AgentIdePreset = "full" | "text-editor";
|
|
5
|
+
|
|
6
|
+
/** Human-facing preset choices shown by the settings UI. */
|
|
7
|
+
export const AGENT_IDE_PRESET_OPTIONS: readonly {
|
|
8
|
+
readonly value: AgentIdePreset;
|
|
9
|
+
readonly label: string;
|
|
10
|
+
readonly description: string;
|
|
11
|
+
}[] = [
|
|
12
|
+
{
|
|
13
|
+
value: "full",
|
|
14
|
+
label: "Full IDE",
|
|
15
|
+
description: "Load every built-in Agent IDE extension unless it is explicitly disabled.",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
value: "text-editor",
|
|
19
|
+
label: "Text Editor",
|
|
20
|
+
description: "Load text read, search, editing, anchors, and AST only.",
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
const TEXT_EDITOR_EXTENSION_IDS = new Set([
|
|
25
|
+
"ide.core",
|
|
26
|
+
"ide.tips",
|
|
27
|
+
"read.core",
|
|
28
|
+
"read.filesystem",
|
|
29
|
+
"read.filesystem.text",
|
|
30
|
+
"search.core",
|
|
31
|
+
"search.text",
|
|
32
|
+
"editor.core",
|
|
33
|
+
"editor.renderer",
|
|
34
|
+
"editor.anchor.constant",
|
|
35
|
+
"editor.anchor.line-hash",
|
|
36
|
+
"editor.anchor.exact",
|
|
37
|
+
"editor.stale-anchor",
|
|
38
|
+
"ide.ast",
|
|
39
|
+
]);
|
|
40
|
+
|
|
41
|
+
/** Return the built-in IDs disabled by a preset before explicit user choices are applied. */
|
|
42
|
+
export function disabledByPreset(
|
|
43
|
+
extensions: readonly Pick<BuiltinExtension, "id">[],
|
|
44
|
+
preset: AgentIdePreset,
|
|
45
|
+
): readonly string[] {
|
|
46
|
+
if (preset === "full") return [];
|
|
47
|
+
return extensions
|
|
48
|
+
.map((extension) => extension.id)
|
|
49
|
+
.filter((id) => !TEXT_EDITOR_EXTENSION_IDS.has(id));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Validate a configured Agent IDE preset. */
|
|
53
|
+
export function readAgentIdePreset(value: unknown, configPath: string): AgentIdePreset | undefined {
|
|
54
|
+
if (value === undefined) return undefined;
|
|
55
|
+
if (value === "full" || value === "text-editor") return value;
|
|
56
|
+
throw new Error(`preset in ${configPath} must be one of: full, text-editor`);
|
|
57
|
+
}
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { connectReadPlugin } from "pi-agent-read/api/connect-plugin";
|
|
3
|
+
import { READ_API_VERSION, READ_PROTOCOL } from "pi-agent-read/api/plugin-protocol";
|
|
4
|
+
import {
|
|
5
|
+
DOCUMENTATION_API_VERSION,
|
|
6
|
+
DOCUMENTATION_PROTOCOL,
|
|
7
|
+
DOCUMENTATION_READY_EVENT,
|
|
8
|
+
DOCUMENTATION_REGISTER_EVENT,
|
|
9
|
+
type AgentDocumentation,
|
|
10
|
+
} from "#src/api/documentation.js";
|
|
11
|
+
import { AgentDocumentationRegistry } from "#src/documentation/registry.js";
|
|
12
|
+
import {
|
|
13
|
+
type InterceptResult,
|
|
14
|
+
registerToolCallInterceptor,
|
|
15
|
+
type ToolCallInterceptorHandler,
|
|
16
|
+
} from "pi-agent-text-editor/api/tool-call-interceptor";
|
|
17
|
+
|
|
18
|
+
interface RegistrationRequest {
|
|
19
|
+
readonly documents: readonly AgentDocumentation[];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Registers progressive documentation discovery, resources, and first-use attachments. */
|
|
23
|
+
export default async function registerProgressiveDocumentation(pi: ExtensionAPI): Promise<void> {
|
|
24
|
+
const registry = new AgentDocumentationRegistry();
|
|
25
|
+
const claimed = new Set<string>();
|
|
26
|
+
const fallbackGates = new Map<string, readonly AgentDocumentation[]>();
|
|
27
|
+
const gatedToolNames: string[] = [];
|
|
28
|
+
const gateHandler: ToolCallInterceptorHandler = {
|
|
29
|
+
name: "agent-documentation-first-use",
|
|
30
|
+
blockExecution: true,
|
|
31
|
+
toolNames: gatedToolNames,
|
|
32
|
+
intercept(context): InterceptResult | undefined {
|
|
33
|
+
if (process.env.PI_AGENT_IDE_TEST_SKIP_GUIDE_GATE === "1") return;
|
|
34
|
+
if (context.toolCall.id.includes("-preflight-")) return;
|
|
35
|
+
const documents = claimMatchingGuides(
|
|
36
|
+
registry,
|
|
37
|
+
claimed,
|
|
38
|
+
context.toolCall.name,
|
|
39
|
+
context.partialArgs ?? context.args,
|
|
40
|
+
);
|
|
41
|
+
if (documents.length === 0) return;
|
|
42
|
+
fallbackGates.set(context.toolCall.id, documents);
|
|
43
|
+
sendGuideToAgent(pi, documents);
|
|
44
|
+
return guideGateResult(documents);
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
registerToolCallInterceptor(pi, gateHandler);
|
|
48
|
+
const unsubscribe = pi.events.on(DOCUMENTATION_REGISTER_EVENT, (value) => {
|
|
49
|
+
if (!isRegistrationRequest(value)) throw new Error("Invalid agent documentation registration");
|
|
50
|
+
registry.register(value.documents);
|
|
51
|
+
gatedToolNames.splice(
|
|
52
|
+
0,
|
|
53
|
+
gatedToolNames.length,
|
|
54
|
+
...new Set(
|
|
55
|
+
registry.list().flatMap((document) => document.triggers.map((trigger) => trigger.tool)),
|
|
56
|
+
),
|
|
57
|
+
);
|
|
58
|
+
registerToolCallInterceptor(pi, gateHandler);
|
|
59
|
+
});
|
|
60
|
+
pi.on("session_shutdown", unsubscribe);
|
|
61
|
+
|
|
62
|
+
await connectReadPlugin(pi, {
|
|
63
|
+
protocol: READ_PROTOCOL,
|
|
64
|
+
apiVersion: READ_API_VERSION,
|
|
65
|
+
id: "agent-documentation",
|
|
66
|
+
setup(api) {
|
|
67
|
+
api.addResolver({
|
|
68
|
+
resolver: {
|
|
69
|
+
id: "agent-documentation",
|
|
70
|
+
tryResolve(source) {
|
|
71
|
+
if (!source.startsWith("docs:"))
|
|
72
|
+
return Promise.resolve({ kind: "not-handled" as const });
|
|
73
|
+
const id = source.slice("docs:".length);
|
|
74
|
+
const document = id.length === 0 ? undefined : registry.get(id);
|
|
75
|
+
const markdown = id.length === 0 ? renderListing(registry.list()) : document?.markdown;
|
|
76
|
+
if (markdown === undefined) {
|
|
77
|
+
return Promise.resolve({
|
|
78
|
+
kind: "failed" as const,
|
|
79
|
+
error: new Error(`Unknown documentation ID: ${id}`),
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return Promise.resolve({
|
|
83
|
+
kind: "resolved" as const,
|
|
84
|
+
resource: {
|
|
85
|
+
source,
|
|
86
|
+
read: () => Promise.resolve([{ type: "text" as const, text: markdown }]),
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
api.describe(() =>
|
|
93
|
+
registry.list().length === 0
|
|
94
|
+
? undefined
|
|
95
|
+
: "docs: and docs:<id> — list or read packaged agent guidance.",
|
|
96
|
+
);
|
|
97
|
+
api.addPromptGuideline(() => renderPromptGuideline(registry.list()));
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
pi.on("session_start", (_event, context) => {
|
|
102
|
+
restoreClaims(context.sessionManager.getBranch(), registry, claimed);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
pi.on("tool_call", (event, context) => {
|
|
106
|
+
if (process.env.PI_AGENT_IDE_TEST_SKIP_GUIDE_GATE === "1") return;
|
|
107
|
+
if (event.toolCallId.includes("-preflight-")) return;
|
|
108
|
+
restoreClaims(context.sessionManager.getBranch(), registry, claimed);
|
|
109
|
+
const documents = claimMatchingGuides(registry, claimed, event.toolName, event.input);
|
|
110
|
+
if (documents.length === 0) return;
|
|
111
|
+
fallbackGates.set(event.toolCallId, documents);
|
|
112
|
+
sendGuideToAgent(pi, documents);
|
|
113
|
+
return { block: true, reason: guideNotice(documents) };
|
|
114
|
+
});
|
|
115
|
+
pi.on("tool_result", (event, context) => {
|
|
116
|
+
if (event.toolCallId.includes("-preflight-")) return;
|
|
117
|
+
const fallbackDocuments = fallbackGates.get(event.toolCallId);
|
|
118
|
+
if (fallbackDocuments !== undefined) {
|
|
119
|
+
fallbackGates.delete(event.toolCallId);
|
|
120
|
+
return {
|
|
121
|
+
content: [{ type: "text" as const, text: guideNotice(fallbackDocuments) }],
|
|
122
|
+
details: documentationGateDetails(fallbackDocuments),
|
|
123
|
+
isError: true,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
restoreClaims(context.sessionManager.getBranch(), registry, claimed, event.toolCallId);
|
|
127
|
+
const docsSource = documentationSource(event.input);
|
|
128
|
+
if (docsSource !== undefined) {
|
|
129
|
+
const id = docsSource.slice("docs:".length);
|
|
130
|
+
const available = registry.list();
|
|
131
|
+
const known = id.length === 0 || registry.get(id) !== undefined;
|
|
132
|
+
if (id.length > 0 && known) claimed.add(id);
|
|
133
|
+
return {
|
|
134
|
+
content: event.content,
|
|
135
|
+
details: {
|
|
136
|
+
...(isRecord(event.details) ? event.details : {}),
|
|
137
|
+
documentation: known
|
|
138
|
+
? id.length === 0
|
|
139
|
+
? { kind: "list", ids: available.map((document) => document.id) }
|
|
140
|
+
: { kind: "document", id }
|
|
141
|
+
: { kind: "error", code: "UNKNOWN_DOCUMENTATION", id },
|
|
142
|
+
},
|
|
143
|
+
isError: event.isError,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
if (process.env.PI_AGENT_IDE_TEST_SKIP_GUIDE_GATE === "1") return;
|
|
147
|
+
const documents = registry
|
|
148
|
+
.matching(event.toolName, event.input)
|
|
149
|
+
.filter((document) => !claimed.has(document.id));
|
|
150
|
+
if (documents.length === 0) return;
|
|
151
|
+
for (const document of documents) claimed.add(document.id);
|
|
152
|
+
return {
|
|
153
|
+
content: [
|
|
154
|
+
...event.content,
|
|
155
|
+
...documents.map((document) => ({
|
|
156
|
+
type: "text" as const,
|
|
157
|
+
text: `\n\n---\n\n# Guide: ${document.id}\n\n${document.markdown.trim()}`,
|
|
158
|
+
})),
|
|
159
|
+
],
|
|
160
|
+
details: {
|
|
161
|
+
...(isRecord(event.details) ? event.details : {}),
|
|
162
|
+
documentation: { kind: "attachment", ids: documents.map((document) => document.id) },
|
|
163
|
+
},
|
|
164
|
+
isError: event.isError,
|
|
165
|
+
};
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
pi.events.emit(DOCUMENTATION_READY_EVENT, {
|
|
169
|
+
protocol: DOCUMENTATION_PROTOCOL,
|
|
170
|
+
apiVersion: DOCUMENTATION_API_VERSION,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function claimMatchingGuides(
|
|
175
|
+
registry: AgentDocumentationRegistry,
|
|
176
|
+
claimed: Set<string>,
|
|
177
|
+
toolName: string,
|
|
178
|
+
input: unknown,
|
|
179
|
+
): readonly AgentDocumentation[] {
|
|
180
|
+
const documents = registry
|
|
181
|
+
.matching(toolName, input)
|
|
182
|
+
.filter((document) => !claimed.has(document.id));
|
|
183
|
+
for (const document of documents) claimed.add(document.id);
|
|
184
|
+
return documents;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function renderGuideGate(documents: readonly AgentDocumentation[]): string {
|
|
188
|
+
return [
|
|
189
|
+
"[SYSTEM] Read the attached guide before using this tool. Repeat the tool call after reading it.",
|
|
190
|
+
...documents.map(
|
|
191
|
+
(document) => `\n\n---\n\n# Guide: ${document.id}\n\n${document.markdown.trim()}`,
|
|
192
|
+
),
|
|
193
|
+
].join("");
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function guideNotice(documents: readonly AgentDocumentation[]): string {
|
|
197
|
+
return `Guide sent to agent: ${documents.map((document) => document.id).join(", ")}. Repeat the tool call.`;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function sendGuideToAgent(pi: ExtensionAPI, documents: readonly AgentDocumentation[]): void {
|
|
201
|
+
pi.sendMessage({
|
|
202
|
+
customType: "agent-documentation-first-use",
|
|
203
|
+
content: renderGuideGate(documents),
|
|
204
|
+
display: false,
|
|
205
|
+
details: documentationGateDetails(documents),
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function documentationGateDetails(documents: readonly AgentDocumentation[]): {
|
|
210
|
+
readonly documentation: { readonly kind: "gate"; readonly ids: readonly string[] };
|
|
211
|
+
} {
|
|
212
|
+
return { documentation: { kind: "gate", ids: documents.map((document) => document.id) } };
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function guideGateResult(documents: readonly AgentDocumentation[]): InterceptResult {
|
|
216
|
+
return {
|
|
217
|
+
annotation: { kind: "blocked", reason: "Read the first-use guide, then retry." },
|
|
218
|
+
message: {
|
|
219
|
+
customType: "agent-documentation-first-use",
|
|
220
|
+
content: guideNotice(documents),
|
|
221
|
+
display: false,
|
|
222
|
+
details: documentationGateDetails(documents),
|
|
223
|
+
},
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
function renderListing(documents: readonly AgentDocumentation[]): string {
|
|
227
|
+
if (documents.length === 0) return "No agent documentation is currently available.";
|
|
228
|
+
return [
|
|
229
|
+
"# Available agent documentation",
|
|
230
|
+
"",
|
|
231
|
+
...documents.map((doc) => `- \`${doc.id}\` — ${doc.description}`),
|
|
232
|
+
].join("\n");
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function renderPromptGuideline(documents: readonly AgentDocumentation[]): string | undefined {
|
|
236
|
+
if (documents.length === 0) return undefined;
|
|
237
|
+
return [
|
|
238
|
+
"Read docs:<id> for detailed packaged guidance when needed. Available documents:",
|
|
239
|
+
...documents.map((document) => ` - ${document.id} — ${document.description}`),
|
|
240
|
+
].join("\n");
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function restoreClaims(
|
|
244
|
+
branch: readonly unknown[],
|
|
245
|
+
registry: AgentDocumentationRegistry,
|
|
246
|
+
claimed: Set<string>,
|
|
247
|
+
currentToolCallId?: string,
|
|
248
|
+
): void {
|
|
249
|
+
for (const entry of branch) {
|
|
250
|
+
if (!isRecord(entry) || entry.type !== "message" || !isRecord(entry.message)) continue;
|
|
251
|
+
const message = entry.message;
|
|
252
|
+
if (message.toolCallId === currentToolCallId) continue;
|
|
253
|
+
if (typeof message.toolCallId === "string" && message.toolCallId.includes("-preflight-"))
|
|
254
|
+
continue;
|
|
255
|
+
if (message.role !== "toolResult" || typeof message.toolName !== "string") continue;
|
|
256
|
+
if (isRecord(message.details) && isRecord(message.details.documentation)) {
|
|
257
|
+
const documentation = message.details.documentation;
|
|
258
|
+
const ids = documentation.ids;
|
|
259
|
+
if (Array.isArray(ids)) {
|
|
260
|
+
for (const id of ids)
|
|
261
|
+
if (typeof id === "string" && registry.get(id) !== undefined) claimed.add(id);
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
if (
|
|
265
|
+
documentation.kind === "document" &&
|
|
266
|
+
typeof documentation.id === "string" &&
|
|
267
|
+
registry.get(documentation.id) !== undefined
|
|
268
|
+
) {
|
|
269
|
+
claimed.add(documentation.id);
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
const input = message.input ?? sourceInput(message.details);
|
|
274
|
+
for (const document of registry.matching(message.toolName, input)) claimed.add(document.id);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
function documentationSource(input: unknown): string | undefined {
|
|
279
|
+
if (!isRecord(input) || typeof input.path !== "string" || !input.path.startsWith("docs:"))
|
|
280
|
+
return undefined;
|
|
281
|
+
return input.path;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
function sourceInput(details: unknown): { readonly path: string } | undefined {
|
|
285
|
+
if (!isRecord(details) || typeof details.source !== "string") return undefined;
|
|
286
|
+
return { path: details.source };
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function isRegistrationRequest(value: unknown): value is RegistrationRequest {
|
|
290
|
+
return isRecord(value) && Array.isArray(value.documents);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
294
|
+
return typeof value === "object" && value !== null;
|
|
295
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { AgentDocumentation } from "#src/api/documentation.js";
|
|
2
|
+
|
|
3
|
+
const DOCUMENT_ID = /^[a-z0-9]+(?:[.-][a-z0-9]+)*$/;
|
|
4
|
+
|
|
5
|
+
/** Ordered registry for currently enabled agent documentation. */
|
|
6
|
+
export class AgentDocumentationRegistry {
|
|
7
|
+
readonly #documents = new Map<string, AgentDocumentation>();
|
|
8
|
+
|
|
9
|
+
register(documents: readonly AgentDocumentation[]): void {
|
|
10
|
+
const ids = new Set(this.#documents.keys());
|
|
11
|
+
for (const document of documents) {
|
|
12
|
+
validateDocument(document, ids);
|
|
13
|
+
ids.add(document.id);
|
|
14
|
+
}
|
|
15
|
+
for (const document of documents) this.#documents.set(document.id, freezeDocument(document));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
list(): readonly AgentDocumentation[] {
|
|
19
|
+
return [...this.#documents.values()].sort((left, right) => left.id.localeCompare(right.id));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
get(id: string): AgentDocumentation | undefined {
|
|
23
|
+
return this.#documents.get(id);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
matching(toolName: string, input: unknown): readonly AgentDocumentation[] {
|
|
27
|
+
const resourcePath = readPath(input);
|
|
28
|
+
if (resourcePath?.startsWith("docs:") === true) return [];
|
|
29
|
+
return this.list().filter((document) =>
|
|
30
|
+
document.triggers.some((trigger) => {
|
|
31
|
+
if (trigger.tool !== toolName) return false;
|
|
32
|
+
const resourceMatches =
|
|
33
|
+
trigger.resourcePrefixes === undefined ||
|
|
34
|
+
(resourcePath !== undefined &&
|
|
35
|
+
trigger.resourcePrefixes.some((prefix) => resourcePath.startsWith(prefix)));
|
|
36
|
+
const viewMatches =
|
|
37
|
+
trigger.viewPrefixes === undefined ||
|
|
38
|
+
readViews(input).some((view) =>
|
|
39
|
+
trigger.viewPrefixes?.some((prefix) => view.startsWith(prefix)),
|
|
40
|
+
);
|
|
41
|
+
return resourceMatches && viewMatches;
|
|
42
|
+
}),
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function validateDocument(document: AgentDocumentation, existingIds: ReadonlySet<string>): void {
|
|
48
|
+
if (!DOCUMENT_ID.test(document.id)) throw new Error(`Invalid documentation ID: ${document.id}`);
|
|
49
|
+
if (document.description.trim().length === 0)
|
|
50
|
+
throw new Error(`Documentation ${document.id} has no description`);
|
|
51
|
+
if (document.markdown.trim().length === 0)
|
|
52
|
+
throw new Error(`Documentation ${document.id} has no Markdown content`);
|
|
53
|
+
if (
|
|
54
|
+
document.triggers.length === 0 ||
|
|
55
|
+
document.triggers.some(
|
|
56
|
+
(trigger) =>
|
|
57
|
+
trigger.tool.trim().length === 0 ||
|
|
58
|
+
trigger.resourcePrefixes?.some((prefix) => prefix.length === 0) === true ||
|
|
59
|
+
trigger.viewPrefixes?.some((prefix) => prefix.length === 0) === true,
|
|
60
|
+
)
|
|
61
|
+
)
|
|
62
|
+
throw new Error(`Documentation ${document.id} has no valid triggers`);
|
|
63
|
+
if (existingIds.has(document.id))
|
|
64
|
+
throw new Error(`Documentation ${document.id} is already registered`);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function freezeDocument(document: AgentDocumentation): AgentDocumentation {
|
|
68
|
+
return Object.freeze({
|
|
69
|
+
...document,
|
|
70
|
+
triggers: Object.freeze(
|
|
71
|
+
document.triggers.map((trigger) =>
|
|
72
|
+
Object.freeze({
|
|
73
|
+
...trigger,
|
|
74
|
+
...(trigger.resourcePrefixes === undefined
|
|
75
|
+
? {}
|
|
76
|
+
: { resourcePrefixes: Object.freeze([...trigger.resourcePrefixes]) }),
|
|
77
|
+
...(trigger.viewPrefixes === undefined
|
|
78
|
+
? {}
|
|
79
|
+
: { viewPrefixes: Object.freeze([...trigger.viewPrefixes]) }),
|
|
80
|
+
}),
|
|
81
|
+
),
|
|
82
|
+
),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function readViews(input: unknown): readonly string[] {
|
|
87
|
+
if (typeof input !== "object" || input === null) return [];
|
|
88
|
+
const views = (input as { readonly views?: unknown }).views;
|
|
89
|
+
return Array.isArray(views)
|
|
90
|
+
? views.filter((view): view is string => typeof view === "string")
|
|
91
|
+
: [];
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function readPath(input: unknown): string | undefined {
|
|
95
|
+
if (typeof input !== "object" || input === null) return undefined;
|
|
96
|
+
const path = (input as { readonly path?: unknown }).path;
|
|
97
|
+
return typeof path === "string" ? path : undefined;
|
|
98
|
+
}
|
|
@@ -37,10 +37,6 @@ export default async function registerFilesystemPlugin(pi: ExtensionAPI): Promis
|
|
|
37
37
|
readHost.listDescriptions(),
|
|
38
38
|
),
|
|
39
39
|
);
|
|
40
|
-
|
|
41
|
-
api.addPromptGuideline(
|
|
42
|
-
"Use read with paths relative to the current working directory for project files. Use read with absolute paths for files elsewhere on the system.",
|
|
43
|
-
);
|
|
44
40
|
},
|
|
45
41
|
} satisfies ReadPlugin;
|
|
46
42
|
const textEditorPlugin = {
|