pi-agent-ide 0.2.0 → 0.2.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 +57 -0
- package/dist/{chunk-XNXQYPVT.js → chunk-4LUW26BX.js} +1 -1
- package/dist/{chunk-2ZMYT6ZC.js → chunk-4U6KGABH.js} +1 -1
- package/dist/chunk-4ZTEPMJO.js +14 -0
- package/dist/{chunk-KNMWCDDK.js → chunk-6ACQQBUY.js} +1 -1
- package/dist/chunk-76WHES5H.js +7 -0
- package/dist/chunk-BHSO2MDK.js +6 -0
- package/dist/chunk-BMOJTJJJ.js +3 -0
- package/dist/chunk-GFWDXTOB.js +4 -0
- package/dist/{chunk-VSP2QQPQ.js → chunk-GIRAEVUJ.js} +1 -1
- package/dist/chunk-JJVXUL5U.js +2 -0
- package/dist/chunk-KCEOTU5Z.js +3 -0
- package/dist/chunk-KVGQG43U.js +1 -0
- package/dist/{chunk-MTTKFJV6.js → chunk-LQYZG62K.js} +1 -1
- package/dist/chunk-N34ATN52.js +1 -0
- package/dist/{chunk-PETQCA7G.js → chunk-P6T3Q7LB.js} +1 -1
- package/dist/chunk-QIJMV2P2.js +2 -0
- package/dist/chunk-QJFRAMK7.js +2 -0
- package/dist/{chunk-2SKAED2I.js → chunk-RAZOACDD.js} +2 -2
- package/dist/chunk-RIGRP3FD.js +1 -0
- package/dist/chunk-S3ZPXWX7.js +2 -0
- package/dist/{chunk-266RH77Z.js → chunk-THSCUT2L.js} +1 -1
- package/dist/{chunk-EEH4WYI7.js → chunk-WNMGUALD.js} +1 -1
- package/dist/chunk-WZI4YC2O.js +1 -0
- package/dist/{chunk-5A25RATC.js → chunk-X6MPU7UO.js} +3 -3
- package/dist/{chunk-QNZVPFSP.js → chunk-XF5PVZOS.js} +1 -1
- package/dist/{chunk-SJYDLHEF.js → chunk-ZXN3TWWW.js} +1 -1
- package/dist/entry-0.js +1 -1
- package/dist/entry-10.js +1 -1
- package/dist/entry-11.js +1 -1
- package/dist/entry-13.js +1 -1
- package/dist/entry-14.js +1 -1
- package/dist/entry-18.js +1 -1
- package/dist/entry-19.js +1 -1
- package/dist/entry-20.js +1 -1
- package/dist/entry-21.js +2 -1
- package/dist/entry-22.js +1 -1
- package/dist/entry-23.js +1 -1
- package/dist/entry-24.js +1 -1
- package/dist/entry-25.js +1 -1
- package/dist/entry-26.js +7 -1
- package/dist/entry-27.js +1 -1
- package/dist/entry-28.js +1 -1
- package/dist/entry-29.js +1 -1
- package/dist/entry-30.js +1 -1
- package/dist/entry-31.js +4 -1
- package/dist/entry-32.js +8 -1
- package/dist/entry-33.js +1 -1
- package/dist/entry-34.js +1 -1
- package/dist/entry-35.js +1 -1
- package/dist/entry-36.js +1 -1
- package/dist/entry-37.js +1 -1
- package/dist/entry-38.js +1 -1
- package/dist/entry-39.js +1 -1
- package/dist/entry-4.js +1 -1
- package/dist/entry-40.js +14 -1
- package/dist/entry-41.js +1 -1
- package/dist/entry-42.js +1 -1
- package/dist/entry-43.js +1 -1
- package/dist/entry-44.js +1 -1
- package/dist/entry-45.js +7 -1
- package/dist/entry-46.js +11 -1
- package/dist/entry-47.js +1 -1
- package/dist/entry-48.js +1 -1
- package/dist/entry-49.js +1 -1
- package/dist/entry-50.js +1 -1
- package/dist/entry-51.js +1 -1
- package/dist/entry-52.js +1 -1
- package/dist/entry-53.js +1 -0
- package/dist/entry-54.js +0 -1
- package/dist/entry-55.js +1 -0
- package/dist/entry-56.js +0 -1
- package/dist/entry-57.js +1 -1
- package/dist/entry-58.js +1 -1
- package/dist/entry-59.js +1 -1
- package/dist/entry-60.js +1 -1
- package/dist/entry-61.js +1 -1
- package/dist/entry-62.js +1 -0
- package/dist/entry-63.js +0 -1
- package/dist/entry-64.js +1 -0
- package/dist/entry-65.js +0 -1
- package/dist/entry-66.js +1 -1
- package/dist/entry-67.js +1 -1
- package/dist/entry-68.js +1 -1
- package/dist/entry-69.js +59 -1
- package/dist/entry-70.js +4 -1
- package/dist/entry-71.js +1 -1
- package/dist/entry-72.js +29 -1
- package/dist/entry-73.js +2 -1
- package/dist/entry-74.js +1 -1
- package/dist/entry-75.js +1 -1
- package/dist/entry-76.js +1 -1
- package/dist/entry-77.js +3 -1
- package/dist/entry-78.js +1 -1
- package/dist/entry-79.js +1 -1
- package/dist/entry-80.js +1 -0
- package/dist/pi-agent-ide.js +2 -13
- package/docs/configuration.md +57 -1
- package/docs/extensions.md +4 -2
- package/docs/generated/tool-catalog/cmake.md +5 -5
- package/docs/generated/tool-catalog/csharp.md +5 -5
- package/docs/generated/tool-catalog/css.md +7 -7
- package/docs/generated/tool-catalog/dart.md +9 -0
- package/docs/generated/tool-catalog/dockerfile.md +5 -5
- package/docs/generated/tool-catalog/elixir.md +9 -0
- package/docs/generated/tool-catalog/html.md +7 -6
- package/docs/generated/tool-catalog/index.md +9 -0
- package/docs/generated/tool-catalog/javascript.md +8 -8
- package/docs/generated/tool-catalog/json.md +7 -7
- package/docs/generated/tool-catalog/julia.md +8 -0
- package/docs/generated/tool-catalog/kotlin.md +6 -5
- package/docs/generated/tool-catalog/markdown.md +6 -6
- package/docs/generated/tool-catalog/powershell.md +9 -0
- package/docs/generated/tool-catalog/python.md +6 -6
- package/docs/generated/tool-catalog/r.md +9 -0
- package/docs/generated/tool-catalog/scala.md +9 -0
- package/docs/generated/tool-catalog/svelte.md +9 -0
- package/docs/generated/tool-catalog/typescript.md +9 -8
- package/docs/generated/tool-catalog/vue.md +9 -0
- package/docs/generated/tool-catalog/yaml.md +6 -6
- package/docs/generated/tool-catalog/zig.md +9 -0
- package/docs/tools.md +1 -1
- package/node_modules/pi-agent-doctor/package.json +10 -3
- package/node_modules/pi-agent-doctor/runtime/entry-20.js +1 -0
- package/node_modules/pi-agent-doctor/src/catalog.ts +27 -1
- package/node_modules/pi-agent-doctor/src/evidence.ts +118 -0
- package/node_modules/pi-agent-doctor/src/executable.ts +63 -17
- package/node_modules/pi-agent-filesystem/index.ts +2 -2
- 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-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-24.js +2 -0
- package/node_modules/pi-agent-ide-ast/package.json +11 -11
- package/node_modules/pi-agent-ide-ast/runtime/entry-25.js +0 -1
- package/node_modules/pi-agent-ide-ast/runtime/entry-26.js +2 -0
- package/node_modules/pi-agent-ide-ast/src/ast/manager.ts +3 -0
- package/node_modules/pi-agent-ide-ast/src/ast/outline.ts +92 -19
- package/node_modules/pi-agent-ide-ast/src/extension.ts +9 -14
- package/node_modules/pi-agent-ide-ast/src/overflow-handler.ts +60 -0
- package/node_modules/pi-agent-ide-ast/src/scope-resolver.ts +1 -1
- package/node_modules/pi-agent-ide-changes/index.ts +1 -5
- package/node_modules/pi-agent-ide-changes/package.json +8 -8
- package/node_modules/pi-agent-ide-changes/runtime/entry-27.js +0 -1
- package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +1 -7
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +1 -5
- package/node_modules/pi-agent-ide-formatter/package.json +4 -4
- package/node_modules/pi-agent-ide-formatter/src/catalog.ts +131 -13
- package/node_modules/pi-agent-ide-formatter/src/formatter.ts +12 -7
- package/node_modules/pi-agent-ide-formatter/src/registry.ts +20 -8
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-languages/src/languages.ts +15 -0
- package/node_modules/pi-agent-ide-lint/index.ts +4 -1
- package/node_modules/pi-agent-ide-lint/package.json +8 -8
- package/node_modules/pi-agent-ide-lint/src/catalog.ts +196 -39
- package/node_modules/pi-agent-ide-lint/src/command-linter.ts +23 -3
- package/node_modules/pi-agent-ide-lint/src/diagnostics.ts +73 -33
- package/node_modules/pi-agent-ide-lint/src/registry.ts +20 -8
- package/node_modules/pi-agent-ide-lsp/index.ts +1 -12
- package/node_modules/pi-agent-ide-lsp/package.json +9 -9
- package/node_modules/pi-agent-ide-lsp/runtime/entry-32.js +2 -0
- package/node_modules/pi-agent-ide-lsp/src/catalog.ts +161 -7
- package/node_modules/pi-agent-ide-lsp/src/diagnostic-source.ts +10 -10
- package/node_modules/pi-agent-ide-lsp/src/doctor-plugin.ts +2 -4
- package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +162 -12
- package/node_modules/pi-agent-ide-lsp/src/lsp/file-watchers.ts +88 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/initialization-options.ts +14 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +8 -4
- package/node_modules/pi-agent-ide-lsp/src/lsp/registry.ts +69 -34
- package/node_modules/pi-agent-ide-lsp/src/lsp/transport-writer.ts +24 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/types.ts +5 -0
- package/node_modules/pi-agent-image/package.json +3 -3
- package/node_modules/pi-agent-image/src/image-converter.ts +1 -1
- 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-pdf/src/pdf-converter.ts +1 -1
- package/node_modules/pi-agent-read/package.json +11 -11
- package/node_modules/pi-agent-read/runtime/entry-39.js +0 -1
- package/node_modules/pi-agent-read/runtime/entry-40.js +2 -0
- package/node_modules/pi-agent-read/src/api/rendering.ts +3 -0
- package/node_modules/pi-agent-read/src/core/read-core.ts +6 -26
- package/node_modules/pi-agent-read/src/core/tools/read/native-resource-renderer.ts +74 -0
- package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +28 -7
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +35 -30
- package/node_modules/pi-agent-resource/package.json +2 -2
- package/node_modules/pi-agent-resource/src/content-conversion/content-description.ts +1 -8
- package/node_modules/pi-agent-search/package.json +7 -7
- package/node_modules/pi-agent-search/runtime/entry-44.js +0 -1
- package/node_modules/pi-agent-search/src/core/extension.ts +7 -5
- package/node_modules/pi-agent-search/src/core/search-core.ts +10 -0
- package/node_modules/pi-agent-search-text/index.ts +42 -33
- package/node_modules/pi-agent-search-text/package.json +9 -9
- package/node_modules/pi-agent-search-text/runtime/entry-46.js +1 -0
- package/node_modules/pi-agent-search-text/src/file-search.ts +9 -1
- package/node_modules/pi-agent-search-text/src/resolvers.ts +1 -1
- package/node_modules/pi-agent-search-text/src/search-recipe.ts +2 -0
- package/node_modules/pi-agent-search-text/src/search-session.ts +48 -0
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text/runtime/entry-48.js +1 -0
- package/node_modules/pi-agent-text/src/text-converter.ts +1 -1
- package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-49.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-50.js +0 -1
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-51.js +2 -0
- package/node_modules/pi-agent-text-anchor-line-hash/index.ts +2 -6
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-52.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-53.js +2 -0
- package/node_modules/pi-agent-text-editor/package.json +22 -22
- package/node_modules/pi-agent-text-editor/runtime/entry-68.js +0 -1
- package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +3 -0
- package/node_modules/pi-agent-text-editor/src/api/post-edit.ts +71 -1
- package/node_modules/pi-agent-text-editor/src/core/builtin-edit-filter.ts +4 -12
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +7 -9
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +27 -2
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +38 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +81 -0
- package/node_modules/pi-agent-text-editor/src/core/text-anchor-registry.ts +5 -2
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +23 -0
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +5 -9
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +54 -14
- package/node_modules/pi-agent-text-editor/src/tools/text-selection.ts +45 -43
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +18 -8
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +7 -4
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +13 -5
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +18 -8
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +9 -5
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +2 -1
- package/node_modules/pi-agent-text-editor-argument-order/package.json +3 -3
- package/node_modules/pi-agent-text-editor-overwrite/package.json +4 -4
- package/node_modules/pi-agent-text-editor-renderer/index.ts +5 -1
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
- package/node_modules/pi-agent-text-editor-renderer/src/diff-model.ts +7 -0
- package/node_modules/pi-agent-text-editor-renderer/src/diff-renderer.ts +1 -1
- package/node_modules/pi-agent-text-editor-renderer/src/diff-viewport.ts +11 -2
- package/node_modules/pi-agent-text-editor-renderer/src/frozen-viewport.ts +140 -52
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +52 -4
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-result.ts +53 -1
- package/node_modules/pi-agent-text-editor-renderer/src/persisted-result.ts +8 -2
- package/node_modules/pi-agent-text-editor-renderer/src/render-resource.ts +10 -0
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +5 -3
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +2 -0
- package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
- package/node_modules/pi-agent-tool-call-interception/src/index.ts +3 -0
- package/node_modules/pi-agent-tool-ui/package.json +2 -2
- package/node_modules/pi-agent-tool-ui/runtime/entry-75.js +1 -0
- package/node_modules/pi-agent-web/index.ts +1 -6
- 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-html/src/html-converter.ts +1 -1
- package/node_modules/pi-agent-web-image/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-80.js +2 -0
- package/package.json +35 -35
- package/src/api/plugin-protocol.ts +2 -0
- package/src/api/text-editor.ts +7 -0
- package/src/api/tool-config/formatters.json +70 -12
- package/src/api/tool-config/linters.json +148 -66
- package/src/api/tool-config/lsp-servers.json +142 -7
- package/src/api/tool-config.ts +60 -24
- package/src/code-view/diagnostic-view.ts +14 -10
- package/src/composite/builtin-extensions.ts +148 -66
- package/src/composite/extensions-config.ts +18 -0
- package/src/core/diagnostic-entry.ts +94 -0
- package/src/core/diagnostic-store.ts +43 -21
- package/src/core/extension.ts +39 -17
- package/src/doctor/config-writer.ts +14 -1
- package/src/doctor/discovery.ts +13 -68
- package/src/doctor/run.ts +33 -1
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +2 -2
- 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-pdf/package.json +4 -4
- 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-24.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-21.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +1 -6
- 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/src/html-converter.ts +1 -1
- 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-pdf/package.json +4 -4
- 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-80.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-76.js +2 -0
- package/src/extensions/pi-agent-read/package.json +11 -11
- package/src/extensions/pi-agent-read/runtime/entry-39.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-40.js +2 -0
- package/src/extensions/pi-agent-read/src/api/rendering.ts +3 -0
- package/src/extensions/pi-agent-read/src/core/read-core.ts +6 -26
- package/src/extensions/pi-agent-read/src/core/tools/read/native-resource-renderer.ts +74 -0
- package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +28 -7
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +35 -30
- package/src/extensions/pi-agent-search/package.json +7 -7
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +42 -33
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +9 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-46.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-47.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/file-search.ts +9 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +1 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +2 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +48 -0
- package/src/extensions/pi-agent-search/runtime/entry-44.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-45.js +2 -0
- package/src/extensions/pi-agent-search/src/core/extension.ts +7 -5
- package/src/extensions/pi-agent-search/src/core/search-core.ts +10 -0
- package/src/extensions/pi-agent-text-editor/package.json +22 -22
- 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-49.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-50.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-51.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +2 -6
- 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-52.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-53.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/package.json +3 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/package.json +4 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +5 -1
- 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/src/diff-model.ts +7 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-renderer.ts +1 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-viewport.ts +11 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/frozen-viewport.ts +140 -52
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +52 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-result.ts +53 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/persisted-result.ts +8 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/render-resource.ts +10 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +5 -3
- 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-73.js +2 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-68.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-69.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +3 -0
- package/src/extensions/pi-agent-text-editor/src/api/post-edit.ts +71 -1
- package/src/extensions/pi-agent-text-editor/src/core/builtin-edit-filter.ts +4 -12
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +7 -9
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +27 -2
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +38 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +81 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-anchor-registry.ts +5 -2
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +23 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +5 -9
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +54 -14
- package/src/extensions/pi-agent-text-editor/src/tools/text-selection.ts +45 -43
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +18 -8
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +7 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +13 -5
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +18 -8
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +9 -5
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +2 -1
- package/src/pi-agent-ide.ts +11 -0
- package/src/plugins/pi-agent-ide-ast/package.json +11 -11
- package/src/plugins/pi-agent-ide-ast/runtime/entry-25.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-26.js +2 -0
- package/src/plugins/pi-agent-ide-ast/src/ast/manager.ts +3 -0
- package/src/plugins/pi-agent-ide-ast/src/ast/outline.ts +92 -19
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +9 -14
- package/src/plugins/pi-agent-ide-ast/src/overflow-handler.ts +60 -0
- package/src/plugins/pi-agent-ide-ast/src/scope-resolver.ts +1 -1
- package/src/plugins/pi-agent-ide-changes/index.ts +1 -5
- package/src/plugins/pi-agent-ide-changes/package.json +8 -8
- package/src/plugins/pi-agent-ide-changes/runtime/entry-27.js +0 -1
- package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +1 -7
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +1 -5
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +1 -8
- package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
- package/src/plugins/pi-agent-ide-formatter/src/catalog.ts +131 -13
- package/src/plugins/pi-agent-ide-formatter/src/formatter.ts +12 -7
- package/src/plugins/pi-agent-ide-formatter/src/registry.ts +20 -8
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-languages/src/languages.ts +15 -0
- package/src/plugins/pi-agent-ide-lint/index.ts +4 -1
- package/src/plugins/pi-agent-ide-lint/package.json +8 -8
- package/src/plugins/pi-agent-ide-lint/src/catalog.ts +196 -39
- package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +23 -3
- package/src/plugins/pi-agent-ide-lint/src/diagnostics.ts +73 -33
- package/src/plugins/pi-agent-ide-lint/src/registry.ts +20 -8
- package/src/plugins/pi-agent-ide-lsp/index.ts +1 -12
- package/src/plugins/pi-agent-ide-lsp/package.json +9 -9
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-32.js +2 -0
- package/src/plugins/pi-agent-ide-lsp/src/catalog.ts +161 -7
- package/src/plugins/pi-agent-ide-lsp/src/diagnostic-source.ts +10 -10
- package/src/plugins/pi-agent-ide-lsp/src/doctor-plugin.ts +2 -4
- package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +162 -12
- package/src/plugins/pi-agent-ide-lsp/src/lsp/file-watchers.ts +88 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/initialization-options.ts +14 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +8 -4
- package/src/plugins/pi-agent-ide-lsp/src/lsp/registry.ts +69 -34
- package/src/plugins/pi-agent-ide-lsp/src/lsp/transport-writer.ts +24 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/types.ts +5 -0
- package/src/post-edit/gate.ts +44 -15
- package/src/toolchain/types.ts +4 -0
- package/dist/chunk-34ZQTTU2.js +0 -2
- package/dist/chunk-476MR2QB.js +0 -1
- package/dist/chunk-4KQOODGE.js +0 -13
- package/dist/chunk-4SQQKEVD.js +0 -16
- package/dist/chunk-52BM6J6I.js +0 -6
- package/dist/chunk-5BWUVAR4.js +0 -1
- package/dist/chunk-6DN7NO7L.js +0 -1
- package/dist/chunk-6SMFVLTY.js +0 -1
- package/dist/chunk-7NDBZ4WX.js +0 -1
- package/dist/chunk-AP7Z3VWC.js +0 -1
- package/dist/chunk-BYWAG6X3.js +0 -6
- package/dist/chunk-E4SECPF4.js +0 -1
- package/dist/chunk-EW2KVKCN.js +0 -2
- package/dist/chunk-F6SESI3P.js +0 -4
- package/dist/chunk-GTK5AREE.js +0 -2
- package/dist/chunk-HOBTFFQR.js +0 -1
- package/dist/chunk-IMVCVPMP.js +0 -3
- package/dist/chunk-IOCABSRL.js +0 -1
- package/dist/chunk-KP37XTDI.js +0 -1
- package/dist/chunk-KYVOMBO5.js +0 -1
- package/dist/chunk-LFV6G5Z3.js +0 -1
- package/dist/chunk-MB6VVVAF.js +0 -2
- package/dist/chunk-NI2NK4JU.js +0 -1
- package/dist/chunk-OIL6BB2S.js +0 -33
- package/dist/chunk-PODWLGNO.js +0 -6
- package/dist/chunk-QW5O42QJ.js +0 -2
- package/dist/chunk-SSZB66C3.js +0 -3
- package/dist/chunk-TG6H6EOI.js +0 -1
- package/dist/chunk-TNWYEXFG.js +0 -1
- package/dist/chunk-U4D6FT66.js +0 -1
- package/dist/chunk-VUNCBASK.js +0 -10
- package/dist/chunk-VWVLBOMU.js +0 -8
- package/dist/chunk-W3XYKJ5H.js +0 -1
- package/dist/chunk-XGUAL3CA.js +0 -1
- package/dist/chunk-YQTLJ5ZV.js +0 -58
- package/node_modules/pi-agent-filesystem/runtime/entry-20.js +0 -2
- package/node_modules/pi-agent-ide-ast/runtime/entry-24.js +0 -1
- package/node_modules/pi-agent-ide-changes/runtime/entry-26.js +0 -1
- package/node_modules/pi-agent-image/runtime/entry-32.js +0 -1
- package/node_modules/pi-agent-read/src/core/tools/read/views.ts +0 -29
- package/node_modules/pi-agent-resource/runtime/entry-40.js +0 -1
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-48.js +0 -2
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-49.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-51.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-53.js +0 -1
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-73.js +0 -1
- package/node_modules/pi-agent-web/runtime/entry-75.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-21.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-20.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-76.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-75.js +0 -2
- package/src/extensions/pi-agent-read/runtime/entry-35.js +0 -1
- package/src/extensions/pi-agent-read/src/core/tools/read/views.ts +0 -29
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-45.js +0 -2
- package/src/extensions/pi-agent-search/runtime/entry-41.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-48.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-49.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-51.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/runtime/entry-69.js +0 -2
- package/src/extensions/pi-agent-text-editor/runtime/entry-53.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-24.js +0 -1
- package/src/plugins/pi-agent-ide-changes/runtime/entry-26.js +0 -1
- /package/node_modules/{pi-agent-filesystem-image → pi-agent-filesystem}/runtime/entry-21.js +0 -0
- /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-22.js +0 -0
- /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-23.js +0 -0
- /package/node_modules/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-28.js +0 -0
- /package/node_modules/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-29.js +0 -0
- /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-30.js +0 -0
- /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-31.js +0 -0
- /package/node_modules/{pi-agent-invariant → pi-agent-image}/runtime/entry-33.js +0 -0
- /package/node_modules/{pi-agent-pdf → pi-agent-invariant}/runtime/entry-34.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-35.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-41.js +0 -0
- /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-45.js +0 -0
- /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-47.js +0 -0
- /package/node_modules/{pi-agent-text-editor-argument-order → pi-agent-text-editor}/runtime/entry-69.js +0 -0
- /package/node_modules/{pi-agent-text-editor-overwrite → pi-agent-text-editor-argument-order}/runtime/entry-70.js +0 -0
- /package/node_modules/{pi-agent-text-editor-renderer → pi-agent-text-editor-overwrite}/runtime/entry-71.js +0 -0
- /package/node_modules/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-72.js +0 -0
- /package/node_modules/{pi-agent-tool-ui → pi-agent-tool-call-interception}/runtime/entry-74.js +0 -0
- /package/node_modules/{pi-agent-web-html → pi-agent-web}/runtime/entry-76.js +0 -0
- /package/node_modules/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-77.js +0 -0
- /package/node_modules/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-78.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-79.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-22.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-pdf}/runtime/entry-23.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-image → pi-agent-web-html}/runtime/entry-77.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-pdf → pi-agent-web-image}/runtime/entry-78.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-pdf}/runtime/entry-79.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-overwrite → pi-agent-text-editor-argument-order}/runtime/entry-70.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-renderer → pi-agent-text-editor-overwrite}/runtime/entry-71.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor-renderer}/runtime/entry-72.js +0 -0
- /package/src/plugins/{pi-agent-ide-formatter → pi-agent-ide-changes}/runtime/entry-28.js +0 -0
- /package/src/plugins/{pi-agent-ide-languages → pi-agent-ide-formatter}/runtime/entry-29.js +0 -0
- /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-languages}/runtime/entry-30.js +0 -0
- /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-lint}/runtime/entry-31.js +0 -0
|
@@ -25,6 +25,9 @@ const SUPPORTED_EXTENSIONS = new Set([
|
|
|
25
25
|
".py",
|
|
26
26
|
".rs",
|
|
27
27
|
".c",
|
|
28
|
+
".cc",
|
|
29
|
+
".hh",
|
|
30
|
+
".hxx",
|
|
28
31
|
".cpp",
|
|
29
32
|
".cxx",
|
|
30
33
|
".h",
|
|
@@ -131,6 +134,9 @@ export function formatAstOutline(block: SourceViewBlock): SourceMappedTextConten
|
|
|
131
134
|
export class AstOutlineManager {
|
|
132
135
|
private readonly fallbackScopeManager = new AstScopeManager();
|
|
133
136
|
|
|
137
|
+
/** Limit syntax-tree nesting for automatic overviews; explicit outlines keep their existing depth. */
|
|
138
|
+
public constructor(private readonly maxDepth = Number.POSITIVE_INFINITY) {}
|
|
139
|
+
|
|
134
140
|
public async readFileOutline(filePath: string, cwd: string): Promise<SourceViewBlock> {
|
|
135
141
|
const absolutePath = resolvePath(filePath, cwd);
|
|
136
142
|
const displayPath = path.relative(cwd, absolutePath) || absolutePath;
|
|
@@ -140,21 +146,50 @@ export class AstOutlineManager {
|
|
|
140
146
|
}
|
|
141
147
|
|
|
142
148
|
const snapshot = await readTextFile(absolutePath);
|
|
143
|
-
|
|
149
|
+
return this.readDocumentOutline(absolutePath, cwd, snapshot.lines);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** Build an outline from the read snapshot. With a finite depth and a budget
|
|
153
|
+
* predicate, reduce nesting until it fits or reaches file-only detail. Parse once.
|
|
154
|
+
*/
|
|
155
|
+
public async readDocumentOutline(
|
|
156
|
+
filePath: string,
|
|
157
|
+
cwd: string,
|
|
158
|
+
lines: readonly string[],
|
|
159
|
+
fits?: (outline: SourceViewBlock) => boolean,
|
|
160
|
+
): Promise<SourceViewBlock> {
|
|
161
|
+
const absolutePath = resolvePath(filePath, cwd);
|
|
162
|
+
const displayPath = path.relative(cwd, absolutePath) || absolutePath;
|
|
163
|
+
if (!isSupportedOutlinePath(absolutePath)) {
|
|
164
|
+
throw new Error(`AST outline is not supported for ${displayPath}.`);
|
|
165
|
+
}
|
|
166
|
+
const tree = await parseDocument(absolutePath, cwd, lines);
|
|
144
167
|
|
|
145
168
|
if (!tree) {
|
|
146
169
|
throw new Error(`No AST parser is available for ${displayPath}.`);
|
|
147
170
|
}
|
|
171
|
+
if (Number.isFinite(this.maxDepth) && tree.rootNode.hasError) {
|
|
172
|
+
throw new Error(`Cannot build an automatic outline from invalid syntax in ${displayPath}.`);
|
|
173
|
+
}
|
|
148
174
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
175
|
+
const content = lines.join("\n");
|
|
176
|
+
for (let depth = this.maxDepth; ; depth -= 1) {
|
|
177
|
+
const outline = await this.createSourceViewBlock(
|
|
178
|
+
tree.rootNode,
|
|
179
|
+
absolutePath,
|
|
180
|
+
displayPath,
|
|
181
|
+
cwd,
|
|
182
|
+
lines,
|
|
183
|
+
content,
|
|
184
|
+
path.extname(absolutePath).toLowerCase(),
|
|
185
|
+
undefined,
|
|
186
|
+
undefined,
|
|
187
|
+
depth,
|
|
188
|
+
);
|
|
189
|
+
if (fits === undefined || fits(outline) || depth <= 0 || !Number.isFinite(depth)) {
|
|
190
|
+
return outline;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
158
193
|
}
|
|
159
194
|
|
|
160
195
|
public async formatFile(filePath: string, cwd: string): Promise<SourceMappedTextContent> {
|
|
@@ -245,8 +280,9 @@ export class AstOutlineManager {
|
|
|
245
280
|
extension: string,
|
|
246
281
|
heading?: string,
|
|
247
282
|
details?: readonly string[],
|
|
283
|
+
maxDepth = this.maxDepth,
|
|
248
284
|
): Promise<SourceViewBlock> {
|
|
249
|
-
const projectedLines = renderNodeLines(node, source, extension);
|
|
285
|
+
const projectedLines = renderNodeLines(node, source, extension, maxDepth);
|
|
250
286
|
const scopes = await getOutlineScopes(this.fallbackScopeManager, filePath, cwd, sourceLines);
|
|
251
287
|
const markersByLine = buildScopeMarkers(scopes);
|
|
252
288
|
const renderedLines = projectedLines.map((line) => {
|
|
@@ -436,13 +472,18 @@ interface MappedCharacter {
|
|
|
436
472
|
readonly sourceLine?: number;
|
|
437
473
|
}
|
|
438
474
|
|
|
439
|
-
function renderNodeLines(
|
|
475
|
+
function renderNodeLines(
|
|
476
|
+
node: WTS.Node,
|
|
477
|
+
source: string,
|
|
478
|
+
extension: string,
|
|
479
|
+
maxDepth: number,
|
|
480
|
+
): ProjectedLine[] {
|
|
440
481
|
const replacements: Replacement[] = [];
|
|
441
482
|
|
|
442
483
|
if (DATA_EXTENSIONS.has(extension)) {
|
|
443
|
-
collectDataReplacements(node, extension, replacements);
|
|
484
|
+
collectDataReplacements(node, extension, replacements, maxDepth);
|
|
444
485
|
} else {
|
|
445
|
-
collectReplacements(node, extension, replacements);
|
|
486
|
+
collectReplacements(node, extension, replacements, false, maxDepth);
|
|
446
487
|
}
|
|
447
488
|
|
|
448
489
|
const start = lineStartAt(source, node.startIndex);
|
|
@@ -498,7 +539,10 @@ function mapSourceRange(source: string, start: number, end: number): MappedChara
|
|
|
498
539
|
let sourceLine = source.slice(0, start).split("\n").length;
|
|
499
540
|
const mapped: MappedCharacter[] = [];
|
|
500
541
|
|
|
501
|
-
|
|
542
|
+
// Tree-sitter offsets use UTF-16 code units, just like String.slice/splice offsets.
|
|
543
|
+
// Iterating code points would shift replacements after supplementary characters.
|
|
544
|
+
for (let index = start; index < end; index += 1) {
|
|
545
|
+
const char = requiredValue(source[index]);
|
|
502
546
|
mapped.push({ char, sourceLine });
|
|
503
547
|
|
|
504
548
|
if (char === "\n") {
|
|
@@ -528,11 +572,29 @@ function mapReplacement(replacement: Replacement): MappedCharacter[] {
|
|
|
528
572
|
return mapped;
|
|
529
573
|
}
|
|
530
574
|
|
|
575
|
+
function collapseDeepNode(
|
|
576
|
+
node: WTS.Node,
|
|
577
|
+
replacements: Replacement[],
|
|
578
|
+
depth: number,
|
|
579
|
+
maxDepth: number,
|
|
580
|
+
): boolean {
|
|
581
|
+
if (depth < maxDepth || node.namedChildCount === 0) return false;
|
|
582
|
+
replacements.push({
|
|
583
|
+
start: node.startIndex,
|
|
584
|
+
end: node.endIndex,
|
|
585
|
+
text: "…",
|
|
586
|
+
lineSourceLines: [node.startPosition.row + 1],
|
|
587
|
+
});
|
|
588
|
+
return true;
|
|
589
|
+
}
|
|
531
590
|
function collectDataReplacements(
|
|
532
591
|
node: WTS.Node,
|
|
533
592
|
extension: string,
|
|
534
593
|
replacements: Replacement[],
|
|
594
|
+
maxDepth: number,
|
|
595
|
+
depth = 0,
|
|
535
596
|
): void {
|
|
597
|
+
if (collapseDeepNode(node, replacements, depth, maxDepth)) return;
|
|
536
598
|
for (const child of node.namedChildren) {
|
|
537
599
|
if (isDataScalar(child, extension)) {
|
|
538
600
|
if (!isDataKey(child)) {
|
|
@@ -547,7 +609,7 @@ function collectDataReplacements(
|
|
|
547
609
|
continue;
|
|
548
610
|
}
|
|
549
611
|
|
|
550
|
-
collectDataReplacements(child, extension, replacements);
|
|
612
|
+
collectDataReplacements(child, extension, replacements, maxDepth, depth + 1);
|
|
551
613
|
}
|
|
552
614
|
}
|
|
553
615
|
|
|
@@ -599,9 +661,13 @@ function collectReplacements(
|
|
|
599
661
|
node: WTS.Node,
|
|
600
662
|
extension: string,
|
|
601
663
|
replacements: Replacement[],
|
|
602
|
-
topLevel
|
|
664
|
+
topLevel: boolean,
|
|
665
|
+
maxDepth: number,
|
|
666
|
+
depth = 0,
|
|
603
667
|
): void {
|
|
604
|
-
if (
|
|
668
|
+
if (collapseDeepNode(node, replacements, depth, maxDepth)) return;
|
|
669
|
+
const keepCall = Number.isFinite(maxDepth) && node.type === "expression_statement";
|
|
670
|
+
if (topLevel && !isTopLevelInterfaceNode(node) && !keepCall) {
|
|
605
671
|
replacements.push({
|
|
606
672
|
start: node.startIndex,
|
|
607
673
|
end: node.endIndex,
|
|
@@ -641,7 +707,14 @@ function collectReplacements(
|
|
|
641
707
|
}
|
|
642
708
|
|
|
643
709
|
for (const child of node.namedChildren) {
|
|
644
|
-
collectReplacements(
|
|
710
|
+
collectReplacements(
|
|
711
|
+
child,
|
|
712
|
+
extension,
|
|
713
|
+
replacements,
|
|
714
|
+
ROOT_TYPES.has(node.type),
|
|
715
|
+
maxDepth,
|
|
716
|
+
depth + 1,
|
|
717
|
+
);
|
|
645
718
|
}
|
|
646
719
|
}
|
|
647
720
|
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
import { AstScopeManager } from "./ast/manager.js";
|
|
22
22
|
import { astDoctorPlugin } from "./doctor-plugin.js";
|
|
23
23
|
import { createAstOutlineResolver } from "./outline-resolver.js";
|
|
24
|
+
import { createAstOverflowHandler } from "./overflow-handler.js";
|
|
24
25
|
import { createAstScopePostReadHandler, createAstScopePresenter } from "./scope-handler.js";
|
|
25
26
|
import { createAstScopeAnchorResolver } from "./scope-resolver.js";
|
|
26
27
|
import { createAstSearchResolver } from "./search-resolver.js";
|
|
@@ -43,19 +44,17 @@ export default async function registerAst(pi: ExtensionAPI): Promise<void> {
|
|
|
43
44
|
handler: createSourceMappedTextReadHandler(),
|
|
44
45
|
});
|
|
45
46
|
api.addView({ view: "ast", presenter });
|
|
47
|
+
const overflow = createAstOverflowHandler();
|
|
48
|
+
const scopes = createAstScopePostReadHandler();
|
|
46
49
|
api.addHandler({
|
|
47
50
|
stage: "post-read",
|
|
48
|
-
handler
|
|
51
|
+
async handler(context) {
|
|
52
|
+
const result = await overflow(context);
|
|
53
|
+
return result.kind === "return" ? result : scopes(result.context);
|
|
54
|
+
},
|
|
49
55
|
});
|
|
50
56
|
api.describe(
|
|
51
|
-
|
|
52
|
-
);
|
|
53
|
-
api.addPromptGuideline(
|
|
54
|
-
"You can use read with `ast:<path>` for a compact structural overview of a source file, including its classes, functions, signatures, and other declarations.",
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
api.addPromptGuideline(
|
|
58
|
-
'You can use read with `views: ["ast"]` to add scope boundaries alongside the file\'s source text.',
|
|
57
|
+
'ast:<path> — compact declaration outline. views: ["ast"] — scope boundaries alongside source text. Oversized code reads may return an outline with source line numbers; offset/limit read a smaller source range.',
|
|
59
58
|
);
|
|
60
59
|
},
|
|
61
60
|
} satisfies ReadPlugin;
|
|
@@ -84,11 +83,7 @@ export default async function registerAst(pi: ExtensionAPI): Promise<void> {
|
|
|
84
83
|
setup(api): void {
|
|
85
84
|
api.addResolver({ resolver: createAstSearchResolver() });
|
|
86
85
|
api.describe(
|
|
87
|
-
"
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
api.addPromptGuideline(
|
|
91
|
-
"You can use search with `ast:<pattern>` for structural code search. You can limit it with `path`, `include`, and `exclude`.",
|
|
86
|
+
"Search code structure with ast:<pattern>, using source-code syntax and placeholders such as $NAME for one node and $$$BODY for several nodes. path, include and exclude narrow the search.",
|
|
92
87
|
);
|
|
93
88
|
},
|
|
94
89
|
}),
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { truncateHead } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import type { ReadPostReadHandler } from "pi-agent-read/api/tools/read";
|
|
3
|
+
import type { SourceViewBlock } from "pi-agent-ide/api/code-view";
|
|
4
|
+
|
|
5
|
+
/** Replace an overflowing file window with a source-numbered whole-file outline.
|
|
6
|
+
* Small windows and files without a usable outline keep the normal read result.
|
|
7
|
+
*/
|
|
8
|
+
export function createAstOverflowHandler(): ReadPostReadHandler {
|
|
9
|
+
return async (context) => {
|
|
10
|
+
const { state, result } = context;
|
|
11
|
+
const block = result?.content.length === 1 ? result.content[0] : undefined;
|
|
12
|
+
if (
|
|
13
|
+
state?.contentKind !== "text" ||
|
|
14
|
+
state.resolvedBy !== "filesystem" ||
|
|
15
|
+
block?.type !== "text" ||
|
|
16
|
+
!truncateHead(block.text).truncated
|
|
17
|
+
) {
|
|
18
|
+
return { kind: "continue", context };
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
const { AstOutlineManager, isSupportedOutlinePath } = await import("./ast/outline.js");
|
|
22
|
+
if (!isSupportedOutlinePath(state.source)) {
|
|
23
|
+
return { kind: "continue", context };
|
|
24
|
+
}
|
|
25
|
+
const format = (outline: SourceViewBlock): string =>
|
|
26
|
+
[
|
|
27
|
+
`AST overview of ${outline.path}, source lines 1-${outline.totalLines}: the requested text exceeded the read buffer.`,
|
|
28
|
+
"Source line numbers are on the left. Detail is reduced to fit the buffer; omitted bodies are not exact source text. Read a small source range when needed.",
|
|
29
|
+
...outline.renderedLines.map(
|
|
30
|
+
(line) => `${line.sourceLine?.lineNumber ?? "…"} | ${line.text}`,
|
|
31
|
+
),
|
|
32
|
+
].join("\n");
|
|
33
|
+
context.resolverContext.signal?.throwIfAborted();
|
|
34
|
+
const outline = await new AstOutlineManager(12).readDocumentOutline(
|
|
35
|
+
state.source,
|
|
36
|
+
context.resolverContext.cwd,
|
|
37
|
+
state.text.lines.map((line) => line.content),
|
|
38
|
+
(candidate) => {
|
|
39
|
+
context.resolverContext.signal?.throwIfAborted();
|
|
40
|
+
return !truncateHead(format(candidate)).truncated;
|
|
41
|
+
},
|
|
42
|
+
);
|
|
43
|
+
const text = format(outline);
|
|
44
|
+
// Even a pathological source label must respect the output budget.
|
|
45
|
+
if (truncateHead(text).truncated) {
|
|
46
|
+
return { kind: "continue", context };
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
kind: "return",
|
|
50
|
+
result: {
|
|
51
|
+
content: [{ type: "text", text }],
|
|
52
|
+
details: { source: state.source, resolvedBy: "ast-overflow" },
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
} catch {
|
|
56
|
+
context.resolverContext.signal?.throwIfAborted();
|
|
57
|
+
return { kind: "continue", context };
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -7,7 +7,7 @@ export function createAstScopeAnchorResolver(manager: AstScopeManager): TextAnch
|
|
|
7
7
|
return {
|
|
8
8
|
id: "ast-scope",
|
|
9
9
|
description:
|
|
10
|
-
|
|
10
|
+
'`scope-begin-HASH` / `scope-end-HASH` from read views: ["ast"] — first/last lines of a scope. Any numeric suffix is part of the anchor.',
|
|
11
11
|
renderFull(value) {
|
|
12
12
|
return value;
|
|
13
13
|
},
|
|
@@ -39,11 +39,7 @@ export default async function registerGitChanges(pi: ExtensionAPI): Promise<void
|
|
|
39
39
|
setup(api) {
|
|
40
40
|
api.addView({ view: "changes", presenter });
|
|
41
41
|
api.describe(
|
|
42
|
-
"
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
api.addPromptGuideline(
|
|
46
|
-
'You can use read with `views: ["changes"]` to add `CHANGE#...` anchors and Git index state for current file changes.',
|
|
42
|
+
'views: ["changes"] — uncommitted edits in tracked files, staged/unstaged state, and CHANGE# anchors for stage, unstage and undo.',
|
|
47
43
|
);
|
|
48
44
|
},
|
|
49
45
|
} satisfies ReadPlugin;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-changes",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,20 +8,20 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./changes/change-groups": {
|
|
10
10
|
"types": "./src/changes/change-groups.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-27.js"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"diff": "^9.0.0",
|
|
16
|
-
"pi-agent-doctor": "0.2.
|
|
17
|
-
"pi-agent-invariant": "0.2.
|
|
18
|
-
"pi-agent-read": "0.2.
|
|
19
|
-
"pi-agent-text": "0.2.
|
|
20
|
-
"pi-agent-text-editor": "0.2.
|
|
16
|
+
"pi-agent-doctor": "0.2.2",
|
|
17
|
+
"pi-agent-invariant": "0.2.2",
|
|
18
|
+
"pi-agent-read": "0.2.2",
|
|
19
|
+
"pi-agent-text": "0.2.2",
|
|
20
|
+
"pi-agent-text-editor": "0.2.2"
|
|
21
21
|
},
|
|
22
22
|
"pi": {
|
|
23
23
|
"extensions": [
|
|
24
|
-
"./runtime/entry-
|
|
24
|
+
"./runtime/entry-28.js"
|
|
25
25
|
]
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
@@ -55,13 +55,7 @@ function createIndexChangeTool(
|
|
|
55
55
|
label: action,
|
|
56
56
|
|
|
57
57
|
promptSnippet: `${pastTense.slice(0, -1)} a selected Git change`,
|
|
58
|
-
description:
|
|
59
|
-
0,
|
|
60
|
-
-1,
|
|
61
|
-
)} one current Git change selected by a CHANGE# anchor without changing the worktree.`,
|
|
62
|
-
promptGuidelines: [
|
|
63
|
-
`You can use ${action} with a complete \`CHANGE#...\` anchor to ${action} only that current Git change without changing the worktree.`,
|
|
64
|
-
],
|
|
58
|
+
description: `Use ${action} to ${action === "stage" ? "add one current Git change to the index" : "remove one current Git change from the index"}. Select the change with a CHANGE# anchor; worktree content is kept.`,
|
|
65
59
|
parameters: indexChangeSchema,
|
|
66
60
|
async execute(_toolCallId, parameters, signal, _onUpdate, context) {
|
|
67
61
|
const file = resolveFile(parameters.file, context.cwd);
|
|
@@ -38,13 +38,9 @@ export function createUndoMutationTool(
|
|
|
38
38
|
return {
|
|
39
39
|
name: "undo",
|
|
40
40
|
description:
|
|
41
|
-
"
|
|
41
|
+
"Use undo to revert a selected uncommitted Git change or the latest text-editor transaction for one file. A CHANGE# anchor restores that change to HEAD in both worktree and index; last restores the file's state before its latest text-editor transaction.",
|
|
42
42
|
|
|
43
43
|
promptSnippet: "Restore a Git change or the latest text edit",
|
|
44
|
-
promptGuidelines: [
|
|
45
|
-
"You can use undo with a complete `CHANGE#...` anchor to restore that current Git change to HEAD in both the worktree and index.",
|
|
46
|
-
'You can use undo with `change: "last"` to restore a file to its state before its latest text-editor transaction.',
|
|
47
|
-
],
|
|
48
44
|
parameters: undoSchema,
|
|
49
45
|
intent: "restore",
|
|
50
46
|
source: { field: "file", inherited: true },
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-formatter",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-doctor": "0.2.
|
|
6
|
+
"pi-agent-doctor": "0.2.2"
|
|
7
7
|
},
|
|
8
8
|
"pi": {
|
|
9
9
|
"extensions": [
|
|
10
|
-
"./runtime/entry-
|
|
10
|
+
"./runtime/entry-29.js"
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"@earendil-works/pi-coding-agent": "*",
|
|
15
|
-
"pi-agent-ide": "0.2.
|
|
15
|
+
"pi-agent-ide": "0.2.2"
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -7,12 +7,18 @@ const web = [
|
|
|
7
7
|
".cjs",
|
|
8
8
|
".ts",
|
|
9
9
|
".tsx",
|
|
10
|
+
".mts",
|
|
11
|
+
".cts",
|
|
10
12
|
".json",
|
|
11
13
|
".jsonc",
|
|
12
14
|
".css",
|
|
13
15
|
".scss",
|
|
14
16
|
".html",
|
|
15
17
|
".md",
|
|
18
|
+
".yaml",
|
|
19
|
+
".yml",
|
|
20
|
+
".vue",
|
|
21
|
+
".svelte",
|
|
16
22
|
];
|
|
17
23
|
|
|
18
24
|
const oxfmtExtensions = [
|
|
@@ -43,6 +49,33 @@ const oxfmtExtensions = [
|
|
|
43
49
|
Formatter recipes owned by the formatter plugin.
|
|
44
50
|
*/
|
|
45
51
|
export const FORMATTER_RECIPES: readonly ToolRecipe[] = [
|
|
52
|
+
recipe(
|
|
53
|
+
"dart-format",
|
|
54
|
+
["dart"],
|
|
55
|
+
["dart"],
|
|
56
|
+
["pubspec.yaml", "analysis_options.yaml"],
|
|
57
|
+
[".dart"],
|
|
58
|
+
["dart", "format", "{file}"],
|
|
59
|
+
"https://dart.dev/tools/dart-format",
|
|
60
|
+
),
|
|
61
|
+
recipe(
|
|
62
|
+
"zig-format",
|
|
63
|
+
["zig"],
|
|
64
|
+
["zig"],
|
|
65
|
+
["build.zig", "build.zig.zon", "zls.json"],
|
|
66
|
+
[".zig", ".zon"],
|
|
67
|
+
["zig", "fmt", "{file}"],
|
|
68
|
+
"https://ziglang.org/documentation/master/",
|
|
69
|
+
),
|
|
70
|
+
recipe(
|
|
71
|
+
"styler",
|
|
72
|
+
["r"],
|
|
73
|
+
["Rscript"],
|
|
74
|
+
[".Rprofile", "DESCRIPTION"],
|
|
75
|
+
[".r"],
|
|
76
|
+
["Rscript", "-e", "styler::style_file(commandArgs(TRUE)[1])", "{file}"],
|
|
77
|
+
"https://styler.r-lib.org/",
|
|
78
|
+
),
|
|
46
79
|
recipe(
|
|
47
80
|
"clang-format",
|
|
48
81
|
["c", "cpp"],
|
|
@@ -54,20 +87,37 @@ export const FORMATTER_RECIPES: readonly ToolRecipe[] = [
|
|
|
54
87
|
),
|
|
55
88
|
recipe(
|
|
56
89
|
"prettier",
|
|
57
|
-
["javascript", "typescript", "html", "css", "json", "yaml", "markdown"],
|
|
90
|
+
["javascript", "typescript", "html", "css", "json", "yaml", "markdown", "vue", "svelte"],
|
|
58
91
|
["prettier"],
|
|
59
|
-
[
|
|
92
|
+
[
|
|
93
|
+
".prettierrc",
|
|
94
|
+
".prettierrc.json",
|
|
95
|
+
".prettierrc.json5",
|
|
96
|
+
".prettierrc.yaml",
|
|
97
|
+
".prettierrc.yml",
|
|
98
|
+
".prettierrc.toml",
|
|
99
|
+
".prettierrc.js",
|
|
100
|
+
".prettierrc.cjs",
|
|
101
|
+
".prettierrc.mjs",
|
|
102
|
+
"prettier.config.js",
|
|
103
|
+
"prettier.config.cjs",
|
|
104
|
+
"prettier.config.mjs",
|
|
105
|
+
"prettier.config.ts",
|
|
106
|
+
"prettier.config.mts",
|
|
107
|
+
"prettier.config.cts",
|
|
108
|
+
],
|
|
60
109
|
web,
|
|
61
110
|
["prettier", "--write", "{file}"],
|
|
62
111
|
"https://prettier.io/docs/",
|
|
63
112
|
["prettier"],
|
|
113
|
+
{ "package.json": ["prettier"] },
|
|
64
114
|
),
|
|
65
115
|
recipe(
|
|
66
116
|
"biome",
|
|
67
117
|
["javascript", "typescript", "json", "css"],
|
|
68
118
|
["biome"],
|
|
69
119
|
["biome.json", "biome.jsonc"],
|
|
70
|
-
|
|
120
|
+
[".js", ".jsx", ".mjs", ".cjs", ".ts", ".tsx", ".mts", ".cts", ".json", ".jsonc", ".css"],
|
|
71
121
|
["biome", "format", "--write", "{file}"],
|
|
72
122
|
"https://biomejs.dev/",
|
|
73
123
|
["@biomejs/biome"],
|
|
@@ -86,21 +136,23 @@ export const FORMATTER_RECIPES: readonly ToolRecipe[] = [
|
|
|
86
136
|
"ruff-format",
|
|
87
137
|
["python"],
|
|
88
138
|
["ruff"],
|
|
89
|
-
["
|
|
139
|
+
["ruff.toml", ".ruff.toml"],
|
|
90
140
|
[".py", ".pyi"],
|
|
91
141
|
["ruff", "format", "{file}"],
|
|
92
142
|
"https://docs.astral.sh/ruff/formatter/",
|
|
93
143
|
["ruff"],
|
|
144
|
+
{ "pyproject.toml": ["tool.ruff"] },
|
|
94
145
|
),
|
|
95
146
|
recipe(
|
|
96
147
|
"black",
|
|
97
148
|
["python"],
|
|
98
149
|
["black"],
|
|
99
|
-
[
|
|
150
|
+
[],
|
|
100
151
|
[".py", ".pyi"],
|
|
101
152
|
["black", "--quiet", "{file}"],
|
|
102
153
|
"https://black.readthedocs.io/",
|
|
103
154
|
["black"],
|
|
155
|
+
{ "pyproject.toml": ["tool.black"] },
|
|
104
156
|
),
|
|
105
157
|
recipe(
|
|
106
158
|
"gofmt",
|
|
@@ -132,10 +184,10 @@ export const FORMATTER_RECIPES: readonly ToolRecipe[] = [
|
|
|
132
184
|
recipe(
|
|
133
185
|
"csharpier",
|
|
134
186
|
["csharp"],
|
|
135
|
-
["
|
|
136
|
-
[".csharpierrc", ".csharpierrc.json"],
|
|
187
|
+
["csharpier"],
|
|
188
|
+
[".csharpierrc", ".csharpierrc.json", ".csharpierrc.yaml", ".csharpierrc.yml"],
|
|
137
189
|
[".cs"],
|
|
138
|
-
["
|
|
190
|
+
["csharpier", "format", "{file}"],
|
|
139
191
|
"https://csharpier.com/",
|
|
140
192
|
),
|
|
141
193
|
recipe(
|
|
@@ -162,7 +214,7 @@ export const FORMATTER_RECIPES: readonly ToolRecipe[] = [
|
|
|
162
214
|
["rubocop"],
|
|
163
215
|
[".rubocop.yml", "Gemfile"],
|
|
164
216
|
[".rb", ".rake"],
|
|
165
|
-
["rubocop", "-
|
|
217
|
+
["rubocop", "--fix-layout", "{file}"],
|
|
166
218
|
"https://docs.rubocop.org/",
|
|
167
219
|
),
|
|
168
220
|
recipe(
|
|
@@ -236,6 +288,9 @@ export const FORMATTER_RECIPES: readonly ToolRecipe[] = [
|
|
|
236
288
|
[".cmake"],
|
|
237
289
|
["cmake-format", "-i", "{file}"],
|
|
238
290
|
"https://cmake-format.readthedocs.io/",
|
|
291
|
+
undefined,
|
|
292
|
+
undefined,
|
|
293
|
+
["CMakeLists.txt"],
|
|
239
294
|
),
|
|
240
295
|
recipe(
|
|
241
296
|
"xmlformat",
|
|
@@ -246,14 +301,67 @@ export const FORMATTER_RECIPES: readonly ToolRecipe[] = [
|
|
|
246
301
|
["xmlformat", "--overwrite", "{file}"],
|
|
247
302
|
"https://github.com/pamoller/xmlformatter",
|
|
248
303
|
),
|
|
304
|
+
recipe(
|
|
305
|
+
"mix-format",
|
|
306
|
+
["elixir"],
|
|
307
|
+
["mix"],
|
|
308
|
+
["mix.exs", ".formatter.exs"],
|
|
309
|
+
[".ex", ".exs"],
|
|
310
|
+
["mix", "format", "{file}"],
|
|
311
|
+
"https://hexdocs.pm/mix/Mix.Tasks.Format.html",
|
|
312
|
+
),
|
|
313
|
+
recipe(
|
|
314
|
+
"scalafmt",
|
|
315
|
+
["scala"],
|
|
316
|
+
["scalafmt"],
|
|
317
|
+
[".scalafmt.conf"],
|
|
318
|
+
[".scala", ".sc", ".sbt"],
|
|
319
|
+
["scalafmt", "{file}"],
|
|
320
|
+
"https://scalameta.org/scalafmt/",
|
|
321
|
+
),
|
|
322
|
+
recipe(
|
|
323
|
+
"julia-format",
|
|
324
|
+
["julia"],
|
|
325
|
+
["julia"],
|
|
326
|
+
[".JuliaFormatter.toml", "Project.toml"],
|
|
327
|
+
[".jl"],
|
|
328
|
+
[
|
|
329
|
+
"julia",
|
|
330
|
+
"--startup-file=no",
|
|
331
|
+
"--history-file=no",
|
|
332
|
+
"-e",
|
|
333
|
+
"using JuliaFormatter; format_file(ARGS[1])",
|
|
334
|
+
"{file}",
|
|
335
|
+
],
|
|
336
|
+
"https://github.com/domluna/JuliaFormatter.jl",
|
|
337
|
+
),
|
|
338
|
+
recipe(
|
|
339
|
+
"powershell-format",
|
|
340
|
+
["powershell"],
|
|
341
|
+
["pwsh"],
|
|
342
|
+
["PSScriptAnalyzerSettings.psd1"],
|
|
343
|
+
[".ps1", ".psm1", ".psd1"],
|
|
344
|
+
[
|
|
345
|
+
"pwsh",
|
|
346
|
+
"-NoProfile",
|
|
347
|
+
"-NonInteractive",
|
|
348
|
+
"-CommandWithArgs",
|
|
349
|
+
'$ErrorActionPreference="Stop";$p=$args[0];$options=@{};if(Test-Path -LiteralPath PSScriptAnalyzerSettings.psd1){$options.Settings="PSScriptAnalyzerSettings.psd1"};[IO.File]::WriteAllText($p,(Invoke-Formatter -ScriptDefinition ([IO.File]::ReadAllText($p)) @options))',
|
|
350
|
+
"{file}",
|
|
351
|
+
],
|
|
352
|
+
"https://learn.microsoft.com/powershell/module/psscriptanalyzer/invoke-formatter",
|
|
353
|
+
),
|
|
249
354
|
recipe(
|
|
250
355
|
"dockfmt",
|
|
251
356
|
["dockerfile"],
|
|
252
357
|
["dockfmt"],
|
|
253
|
-
["Dockerfile"],
|
|
254
|
-
["
|
|
255
|
-
["dockfmt", "fmt", "{file}"],
|
|
358
|
+
["Dockerfile", "Containerfile"],
|
|
359
|
+
[".dockerfile"],
|
|
360
|
+
["dockfmt", "fmt", "--write", "{file}"],
|
|
256
361
|
"https://github.com/jessfraz/dockfmt",
|
|
362
|
+
undefined,
|
|
363
|
+
undefined,
|
|
364
|
+
["Dockerfile", "Containerfile"],
|
|
257
365
|
),
|
|
258
366
|
];
|
|
259
367
|
|
|
@@ -266,6 +374,9 @@ function recipe(
|
|
|
266
374
|
command: readonly string[],
|
|
267
375
|
documentation: string,
|
|
268
376
|
dependencies?: readonly string[],
|
|
377
|
+
configSections?: Readonly<Record<string, readonly string[]>>,
|
|
378
|
+
|
|
379
|
+
fileNames?: readonly string[],
|
|
269
380
|
): ToolRecipe {
|
|
270
381
|
return {
|
|
271
382
|
id,
|
|
@@ -276,6 +387,13 @@ function recipe(
|
|
|
276
387
|
configFiles,
|
|
277
388
|
documentation,
|
|
278
389
|
...(dependencies && { dependencies }),
|
|
279
|
-
|
|
390
|
+
|
|
391
|
+
...(configSections && { configSections }),
|
|
392
|
+
formatter: {
|
|
393
|
+
extensions,
|
|
394
|
+
...(fileNames && { fileNames }),
|
|
395
|
+
run: { command },
|
|
396
|
+
output: "in-place",
|
|
397
|
+
},
|
|
280
398
|
};
|
|
281
399
|
}
|