pi-agent-ide 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/README.md +11 -5
- package/dist/chunk-266RH77Z.js +1 -0
- package/dist/chunk-2SKAED2I.js +2 -0
- package/dist/chunk-2ZMYT6ZC.js +1 -0
- package/dist/chunk-34ZQTTU2.js +2 -0
- package/dist/chunk-3H2EU7VQ.js +0 -0
- package/dist/chunk-3YK4XMWB.js +0 -0
- package/dist/chunk-476MR2QB.js +1 -0
- package/dist/chunk-4KQOODGE.js +13 -0
- package/dist/chunk-4SQQKEVD.js +16 -0
- package/dist/chunk-52BM6J6I.js +6 -0
- package/dist/chunk-5A25RATC.js +3 -0
- package/dist/chunk-5BWUVAR4.js +1 -0
- package/dist/chunk-6DN7NO7L.js +1 -0
- package/dist/chunk-6SMFVLTY.js +1 -0
- package/dist/chunk-7NDBZ4WX.js +1 -0
- package/dist/chunk-AP7Z3VWC.js +1 -0
- package/dist/chunk-BYWAG6X3.js +6 -0
- package/dist/chunk-DEP55R35.js +1 -0
- package/dist/chunk-E2RESHYR.js +1 -0
- package/dist/chunk-E4SECPF4.js +1 -0
- package/dist/chunk-EEH4WYI7.js +1 -0
- package/dist/chunk-EI7MMDWY.js +1 -0
- package/dist/chunk-ERVMDQGX.js +1 -0
- package/dist/chunk-EW2KVKCN.js +2 -0
- package/dist/chunk-F6SESI3P.js +4 -0
- package/dist/chunk-GTK5AREE.js +2 -0
- package/dist/chunk-HOBTFFQR.js +1 -0
- package/dist/chunk-IMVCVPMP.js +3 -0
- package/dist/chunk-IOCABSRL.js +1 -0
- package/dist/chunk-JASLOB2X.js +1 -0
- package/dist/chunk-JMVDFOTQ.js +1 -0
- package/dist/chunk-K4ZMRDEI.js +0 -0
- package/dist/chunk-KINKBPPX.js +1 -0
- package/dist/chunk-KNMWCDDK.js +7 -0
- package/dist/chunk-KP37XTDI.js +1 -0
- package/dist/chunk-KYVOMBO5.js +1 -0
- package/dist/chunk-KZBAJFCV.js +1 -0
- package/dist/chunk-LFV6G5Z3.js +1 -0
- package/dist/chunk-MB6VVVAF.js +2 -0
- package/dist/chunk-MBUXFKIW.js +3 -0
- package/dist/chunk-MTTKFJV6.js +1 -0
- package/dist/chunk-NI2NK4JU.js +1 -0
- package/dist/chunk-NNCZYO4Q.js +0 -0
- package/dist/chunk-OBWZ5RYN.js +1 -0
- package/dist/chunk-OIL6BB2S.js +33 -0
- package/dist/chunk-ORAPGW7W.js +1 -0
- package/dist/chunk-OVUYPHDE.js +1 -0
- package/dist/chunk-PETQCA7G.js +1 -0
- package/dist/chunk-PODWLGNO.js +6 -0
- package/dist/chunk-QNZVPFSP.js +3 -0
- package/dist/chunk-QW5O42QJ.js +2 -0
- package/dist/chunk-SJYDLHEF.js +108 -0
- package/dist/chunk-SSZB66C3.js +3 -0
- package/dist/chunk-STUZZM5B.js +1 -0
- package/dist/chunk-T2RPMEM2.js +1 -0
- package/dist/chunk-TG6H6EOI.js +1 -0
- package/dist/chunk-TNWYEXFG.js +1 -0
- package/dist/chunk-U4D6FT66.js +1 -0
- package/dist/chunk-VCCMVQXU.js +1 -0
- package/dist/chunk-VFBLX4TG.js +1 -0
- package/dist/chunk-VSP2QQPQ.js +2 -0
- package/dist/chunk-VUNCBASK.js +10 -0
- package/dist/chunk-VWVLBOMU.js +8 -0
- package/dist/chunk-W3XYKJ5H.js +1 -0
- package/dist/chunk-XGUAL3CA.js +1 -0
- package/dist/chunk-XNXQYPVT.js +10 -0
- package/dist/chunk-YHUTTZC6.js +2 -0
- package/dist/chunk-YPHXLAQF.js +1 -0
- package/dist/chunk-YQTLJ5ZV.js +58 -0
- package/dist/chunk-ZC65Z3CK.js +1 -0
- package/dist/entry-0.js +1 -0
- package/dist/entry-1.js +1 -0
- package/dist/entry-10.js +1 -0
- package/dist/entry-11.js +1 -0
- package/dist/entry-12.js +1 -0
- package/dist/entry-13.js +1 -0
- package/dist/entry-14.js +1 -0
- package/dist/entry-16.js +1 -0
- package/dist/entry-17.js +1 -0
- package/dist/entry-18.js +1 -0
- package/dist/entry-19.js +1 -0
- package/dist/entry-2.js +1 -0
- package/dist/entry-20.js +1 -0
- package/dist/entry-21.js +1 -0
- package/dist/entry-22.js +1 -0
- package/dist/entry-23.js +1 -0
- package/dist/entry-24.js +1 -0
- package/dist/entry-25.js +1 -0
- package/dist/entry-26.js +1 -0
- package/dist/entry-27.js +1 -0
- package/dist/entry-28.js +1 -0
- package/dist/entry-29.js +1 -0
- package/dist/entry-3.js +1 -0
- package/dist/entry-30.js +1 -0
- package/dist/entry-31.js +1 -0
- package/dist/entry-32.js +1 -0
- package/dist/entry-33.js +1 -0
- package/dist/entry-34.js +1 -0
- package/dist/entry-35.js +1 -0
- package/dist/entry-36.js +1 -0
- package/dist/entry-37.js +1 -0
- package/dist/entry-38.js +1 -0
- package/dist/entry-39.js +1 -0
- package/dist/entry-4.js +1 -0
- package/dist/entry-40.js +1 -0
- package/dist/entry-41.js +1 -0
- package/dist/entry-42.js +1 -0
- package/dist/entry-43.js +1 -0
- package/dist/entry-44.js +1 -0
- package/dist/entry-45.js +1 -0
- package/dist/entry-46.js +1 -0
- package/dist/entry-47.js +1 -0
- package/dist/entry-48.js +1 -0
- package/dist/entry-49.js +1 -0
- package/dist/entry-5.js +1 -0
- package/dist/entry-50.js +1 -0
- package/dist/entry-51.js +1 -0
- package/dist/entry-52.js +1 -0
- package/dist/entry-53.js +0 -0
- package/dist/entry-54.js +1 -0
- package/dist/entry-55.js +0 -0
- package/dist/entry-56.js +1 -0
- package/dist/entry-57.js +1 -0
- package/dist/entry-58.js +1 -0
- package/dist/entry-59.js +1 -0
- package/dist/entry-6.js +1 -0
- package/dist/entry-60.js +1 -0
- package/dist/entry-61.js +1 -0
- package/dist/entry-62.js +0 -0
- package/dist/entry-63.js +1 -0
- package/dist/entry-64.js +0 -0
- package/dist/entry-65.js +1 -0
- package/dist/entry-66.js +1 -0
- package/dist/entry-67.js +1 -0
- package/dist/entry-68.js +1 -0
- package/dist/entry-69.js +1 -0
- package/dist/entry-7.js +1 -0
- package/dist/entry-70.js +1 -0
- package/dist/entry-71.js +1 -0
- package/dist/entry-72.js +1 -0
- package/dist/entry-73.js +1 -0
- package/dist/entry-74.js +1 -0
- package/dist/entry-75.js +1 -0
- package/dist/entry-76.js +1 -0
- package/dist/entry-77.js +1 -0
- package/dist/entry-78.js +1 -0
- package/dist/entry-79.js +1 -0
- package/dist/entry-8.js +1 -0
- package/dist/entry-9.js +1 -0
- package/dist/pi-agent-ide.js +13 -0
- package/docs/architecture.md +21 -17
- package/docs/configuration.md +149 -52
- package/docs/development.md +105 -5
- package/docs/extensions.md +64 -4
- package/docs/generated/tool-catalog/css.md +7 -6
- package/docs/generated/tool-catalog/html.md +6 -5
- package/docs/generated/tool-catalog/javascript.md +8 -6
- package/docs/generated/tool-catalog/json.md +7 -6
- package/docs/generated/tool-catalog/markdown.md +6 -5
- package/docs/generated/tool-catalog/toml.md +6 -5
- package/docs/generated/tool-catalog/typescript.md +8 -6
- package/docs/generated/tool-catalog/yaml.md +6 -5
- package/docs/tools.md +88 -6
- package/node_modules/pi-agent-doctor/package.json +8 -5
- package/node_modules/pi-agent-doctor/runtime/entry-16.js +1 -0
- package/node_modules/pi-agent-doctor/runtime/entry-17.js +1 -0
- package/node_modules/pi-agent-doctor/runtime/entry-18.js +1 -0
- package/node_modules/pi-agent-doctor/runtime/entry-19.js +1 -0
- package/node_modules/pi-agent-doctor/src/executable.ts +33 -0
- package/node_modules/pi-agent-doctor/src/plugin-protocol.ts +30 -4
- package/node_modules/pi-agent-filesystem/index.ts +4 -3
- package/node_modules/pi-agent-filesystem/package.json +7 -7
- package/node_modules/pi-agent-filesystem/runtime/entry-20.js +2 -0
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- package/node_modules/pi-agent-filesystem-image/runtime/entry-21.js +2 -0
- package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
- package/node_modules/pi-agent-filesystem-pdf/runtime/entry-22.js +2 -0
- package/node_modules/pi-agent-filesystem-text/package.json +4 -4
- package/node_modules/pi-agent-filesystem-text/runtime/entry-23.js +2 -0
- package/node_modules/pi-agent-ide-ast/package.json +11 -10
- package/node_modules/pi-agent-ide-ast/runtime/entry-24.js +1 -0
- package/node_modules/pi-agent-ide-ast/runtime/entry-25.js +2 -0
- package/node_modules/pi-agent-ide-ast/src/api/scope.ts +1 -1
- package/node_modules/pi-agent-ide-ast/src/ast/outline.ts +1 -1
- package/node_modules/pi-agent-ide-ast/src/doctor-plugin.ts +25 -0
- package/node_modules/pi-agent-ide-ast/src/extension.ts +13 -5
- package/node_modules/pi-agent-ide-ast/src/scope-resolver.ts +6 -0
- package/node_modules/pi-agent-ide-changes/index.ts +6 -2
- package/node_modules/pi-agent-ide-changes/package.json +8 -7
- package/node_modules/pi-agent-ide-changes/runtime/entry-26.js +1 -0
- package/node_modules/pi-agent-ide-changes/runtime/entry-27.js +2 -0
- package/node_modules/pi-agent-ide-changes/src/change-anchor.ts +6 -0
- package/node_modules/pi-agent-ide-changes/src/changes/change-groups.ts +1 -1
- package/node_modules/pi-agent-ide-changes/src/changes/change-service.ts +1 -1
- package/node_modules/pi-agent-ide-changes/src/changes/git-changes-backend.ts +1 -0
- package/node_modules/pi-agent-ide-changes/src/current-change-presenter.ts +1 -1
- package/node_modules/pi-agent-ide-changes/src/doctor-plugin.ts +31 -1
- package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +5 -0
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +7 -0
- package/node_modules/pi-agent-ide-formatter/package.json +4 -4
- package/node_modules/pi-agent-ide-formatter/runtime/entry-28.js +2 -0
- package/node_modules/pi-agent-ide-formatter/src/catalog.ts +34 -0
- package/node_modules/pi-agent-ide-formatter/src/doctor-plugin.ts +115 -63
- package/node_modules/pi-agent-ide-formatter/src/registry.ts +71 -28
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-languages/runtime/entry-29.js +2 -0
- package/node_modules/pi-agent-ide-lint/index.ts +30 -155
- package/node_modules/pi-agent-ide-lint/package.json +8 -7
- package/node_modules/pi-agent-ide-lint/runtime/entry-30.js +2 -0
- package/node_modules/pi-agent-ide-lint/src/catalog.ts +14 -2
- package/node_modules/pi-agent-ide-lint/src/command-linter.ts +60 -4
- package/node_modules/pi-agent-ide-lint/src/diagnostics.ts +3 -1
- package/node_modules/pi-agent-ide-lint/src/doctor-plugin.ts +115 -64
- package/node_modules/pi-agent-ide-lint/src/registry.ts +72 -27
- package/node_modules/pi-agent-ide-lsp/index.ts +35 -134
- package/node_modules/pi-agent-ide-lsp/package.json +9 -8
- package/node_modules/pi-agent-ide-lsp/runtime/entry-31.js +2 -0
- package/node_modules/pi-agent-ide-lsp/src/code-view-resolvers.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/src/diagnostic-source.ts +113 -0
- package/node_modules/pi-agent-ide-lsp/src/doctor-plugin.ts +108 -53
- package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +94 -27
- package/node_modules/pi-agent-ide-lsp/src/lsp/code-views.ts +2 -1
- package/node_modules/pi-agent-ide-lsp/src/lsp/diagnostic-adapters.ts +76 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/diagnostics.ts +137 -144
- package/node_modules/pi-agent-ide-lsp/src/lsp/lsp-compiler.ts +2 -2
- package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +9 -32
- package/node_modules/pi-agent-ide-lsp/src/lsp/registry.ts +86 -50
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +1 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/types.ts +8 -6
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +5 -5
- package/node_modules/pi-agent-image/package.json +3 -3
- package/node_modules/pi-agent-image/runtime/entry-32.js +1 -0
- package/node_modules/pi-agent-invariant/package.json +12 -0
- package/node_modules/pi-agent-invariant/runtime/entry-33.js +1 -0
- package/node_modules/pi-agent-pdf/package.json +3 -3
- package/node_modules/pi-agent-pdf/runtime/entry-34.js +1 -0
- package/node_modules/pi-agent-pdf/src/pdf-converter.ts +3 -2
- package/node_modules/pi-agent-read/package.json +11 -9
- package/node_modules/pi-agent-read/runtime/entry-35.js +1 -0
- package/node_modules/pi-agent-read/runtime/entry-36.js +1 -0
- package/node_modules/pi-agent-read/runtime/entry-37.js +1 -0
- package/node_modules/pi-agent-read/runtime/entry-38.js +1 -0
- package/node_modules/pi-agent-read/runtime/entry-39.js +2 -0
- package/node_modules/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/node_modules/pi-agent-read/src/api/tools/read.ts +113 -2
- package/node_modules/pi-agent-read/src/core/extension.ts +19 -0
- package/node_modules/pi-agent-read/src/core/read-core.ts +85 -13
- package/node_modules/pi-agent-read/src/core/tools/read/output-truncation.ts +26 -10
- package/node_modules/pi-agent-read/src/core/tools/read/persisted-result.ts +72 -0
- package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +102 -12
- package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +27 -3
- package/node_modules/pi-agent-read/src/core/tools/read/views.ts +29 -0
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +532 -46
- package/node_modules/pi-agent-resource/package.json +5 -2
- package/node_modules/pi-agent-resource/runtime/entry-40.js +1 -0
- package/node_modules/pi-agent-resource/src/content-conversion/content-converter.ts +1 -1
- package/node_modules/pi-agent-resource/src/content-conversion/content-host.ts +1 -1
- package/node_modules/pi-agent-resource/src/content-conversion/content-runner.ts +1 -1
- package/node_modules/pi-agent-resource/src/content-conversion/validation.ts +1 -1
- package/node_modules/pi-agent-search/package.json +7 -6
- package/node_modules/pi-agent-search/runtime/entry-41.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-42.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-43.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-44.js +2 -0
- package/node_modules/pi-agent-search/src/api/search.ts +4 -0
- package/node_modules/pi-agent-search/src/core/extension.ts +99 -27
- package/node_modules/pi-agent-search/src/core/search-config.ts +98 -0
- package/node_modules/pi-agent-search/src/core/search-core.ts +32 -28
- package/node_modules/pi-agent-search/src/core/search-timeout.ts +54 -0
- package/node_modules/pi-agent-search-text/index.ts +53 -3
- package/node_modules/pi-agent-search-text/package.json +9 -9
- package/node_modules/pi-agent-search-text/runtime/entry-45.js +2 -0
- package/node_modules/pi-agent-search-text/runtime/entry-46.js +1 -0
- package/node_modules/pi-agent-search-text/src/doctor-plugin.ts +20 -1
- package/node_modules/pi-agent-search-text/src/persisted-result.ts +56 -0
- package/node_modules/pi-agent-search-text/src/resolvers.ts +36 -34
- package/node_modules/pi-agent-search-text/src/search-query.ts +254 -71
- package/node_modules/pi-agent-search-text/src/search-recipe.ts +68 -0
- package/node_modules/pi-agent-search-text/src/search-renderer.ts +71 -117
- package/node_modules/pi-agent-search-text/src/search-result.ts +1 -0
- package/node_modules/pi-agent-search-text/src/search-session.ts +276 -110
- package/node_modules/pi-agent-text/package.json +6 -3
- package/node_modules/pi-agent-text/runtime/entry-47.js +1 -0
- package/node_modules/pi-agent-text/src/index.ts +23 -0
- package/node_modules/pi-agent-text/src/stored-text.ts +14 -0
- package/node_modules/pi-agent-text/src/text-anchor.ts +160 -16
- package/node_modules/pi-agent-text/src/text-document.ts +26 -5
- package/node_modules/pi-agent-text/src/text-target.ts +105 -0
- package/node_modules/pi-agent-text-anchor-constant/package.json +7 -4
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-48.js +2 -0
- package/node_modules/pi-agent-text-anchor-constant/src/resolver.ts +6 -0
- package/node_modules/pi-agent-text-anchor-exact/index.ts +34 -0
- package/node_modules/pi-agent-text-anchor-exact/package.json +27 -0
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-49.js +1 -0
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-50.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/src/anchor.ts +230 -0
- package/node_modules/pi-agent-text-anchor-exact/src/config.ts +159 -0
- package/node_modules/pi-agent-text-anchor-exact/src/fuzzy-worker.ts +100 -0
- package/node_modules/pi-agent-text-anchor-exact/src/recovery.ts +151 -0
- package/node_modules/pi-agent-text-anchor-line-hash/index.ts +8 -2
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +10 -6
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-51.js +1 -0
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-52.js +2 -0
- package/node_modules/pi-agent-text-anchor-line-hash/src/anchor.ts +32 -1
- package/node_modules/pi-agent-text-anchor-line-hash/src/read-handler.ts +20 -12
- package/node_modules/pi-agent-text-editor/package.json +22 -21
- package/node_modules/pi-agent-text-editor/runtime/entry-53.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-54.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-55.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-56.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-57.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-58.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-59.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-60.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-61.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-62.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-63.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-64.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-65.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-66.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-67.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-68.js +2 -0
- package/node_modules/pi-agent-text-editor/src/api/anchor-inspection.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +1 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +38 -0
- package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +30 -15
- package/node_modules/pi-agent-text-editor/src/api/text-selection-anchor.ts +10 -13
- package/node_modules/pi-agent-text-editor/src/api/tool-call-interceptor.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/builtin-edit-filter.ts +12 -5
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +15 -1
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/agent-diff.ts +14 -10
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/diff.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +3 -2
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +19 -2
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +64 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/inline-hints.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/read-fragment-resolver.ts +83 -0
- package/node_modules/pi-agent-text-editor/src/core/text-anchor-registry.ts +96 -8
- package/node_modules/pi-agent-text-editor/src/core/text-change-engine.ts +4 -1
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +194 -35
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +43 -13
- package/node_modules/pi-agent-text-editor/src/core/text-editor-config.ts +95 -0
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +75 -5
- package/node_modules/pi-agent-text-editor/src/core/text-mutation-anchor-error.ts +7 -0
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +541 -130
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +5 -9
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/rendering.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/tools/text-selection.ts +228 -6
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +50 -70
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +25 -26
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +30 -21
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +57 -71
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +30 -27
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +2 -0
- package/node_modules/pi-agent-text-editor-argument-order/package.json +3 -3
- package/node_modules/pi-agent-text-editor-argument-order/runtime/entry-69.js +2 -0
- package/node_modules/pi-agent-text-editor-overwrite/index.ts +1 -1
- package/node_modules/pi-agent-text-editor-overwrite/package.json +4 -3
- package/node_modules/pi-agent-text-editor-overwrite/runtime/entry-70.js +2 -0
- package/node_modules/pi-agent-text-editor-renderer/index.ts +21 -1
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -3
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-71.js +2 -0
- package/node_modules/pi-agent-text-editor-renderer/src/animation-pressure.ts +50 -0
- package/node_modules/pi-agent-text-editor-renderer/src/config.ts +73 -0
- package/node_modules/pi-agent-text-editor-renderer/src/diff-model.ts +1 -1
- package/node_modules/pi-agent-text-editor-renderer/src/diff-renderer.ts +77 -22
- package/node_modules/pi-agent-text-editor-renderer/src/diff-theme.ts +1 -1
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +140 -24
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-projection.ts +274 -43
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-result.ts +33 -6
- package/node_modules/pi-agent-text-editor-renderer/src/persisted-result.ts +47 -0
- package/node_modules/pi-agent-text-editor-renderer/src/render-resource.ts +7 -0
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +265 -105
- package/node_modules/pi-agent-text-editor-renderer/src/typing-interpolation.ts +96 -15
- package/node_modules/pi-agent-text-editor-stale-anchor/index.ts +22 -6
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -4
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-72.js +2 -0
- package/node_modules/pi-agent-tool-call-interception/package.json +5 -2
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-73.js +1 -0
- package/node_modules/pi-agent-tool-call-interception/src/index.ts +175 -32
- package/node_modules/pi-agent-tool-ui/package.json +15 -0
- package/node_modules/pi-agent-tool-ui/runtime/entry-74.js +1 -0
- package/node_modules/pi-agent-tool-ui/src/index.ts +318 -0
- package/node_modules/pi-agent-web/index.ts +16 -6
- package/node_modules/pi-agent-web/package.json +8 -6
- package/node_modules/pi-agent-web/runtime/entry-75.js +2 -0
- package/node_modules/pi-agent-web/src/browser-loader.ts +180 -0
- package/node_modules/pi-agent-web/src/doctor-plugin.ts +41 -0
- package/node_modules/pi-agent-web/src/resolver.ts +128 -24
- package/node_modules/pi-agent-web-html/package.json +6 -3
- package/node_modules/pi-agent-web-html/runtime/entry-76.js +2 -0
- package/node_modules/pi-agent-web-html/src/extract-readable-html.ts +19 -6
- package/node_modules/pi-agent-web-image/package.json +4 -4
- package/node_modules/pi-agent-web-image/runtime/entry-77.js +2 -0
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/runtime/entry-78.js +2 -0
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-79.js +2 -0
- package/package.json +68 -54
- package/src/api/code-view.ts +4 -0
- package/src/api/connect-tip-provider.ts +49 -0
- package/src/api/plugin-protocol.ts +41 -2
- package/src/api/tips.ts +77 -0
- package/src/api/tool-config/formatters.json +215 -0
- package/src/api/tool-config/linters.json +257 -0
- package/src/api/tool-config/lsp-servers.json +275 -0
- package/src/api/tool-config.ts +217 -13
- package/src/api/toolchain.ts +0 -5
- package/src/code-view/diagnostic-view.ts +117 -26
- package/src/code-view/source-view.ts +1 -1
- package/src/composite/builtin-extensions.ts +12 -6
- package/src/composite/extensions-config.ts +137 -0
- package/src/composite/selection.ts +58 -3
- package/src/core/diagnostic-store.ts +244 -0
- package/src/core/extension.ts +40 -0
- package/src/core/ide-core.ts +48 -3
- package/src/doctor/config-writer.ts +1 -1
- package/src/doctor/core.ts +47 -0
- package/src/doctor/discovery.ts +10 -2
- package/src/doctor/extension.ts +12 -1
- package/src/doctor/inventory.ts +24 -6
- package/src/doctor/run.ts +68 -87
- package/src/doctor/tip-provider.ts +92 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +4 -3
- 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-image/runtime/entry-21.js +2 -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-22.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-23.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-20.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +16 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +6 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-76.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/src/extract-readable-html.ts +19 -6
- 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-77.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-78.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-79.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-75.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/browser-loader.ts +180 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/doctor-plugin.ts +41 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/resolver.ts +128 -24
- package/src/extensions/pi-agent-read/package.json +11 -9
- package/src/extensions/pi-agent-read/runtime/entry-35.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-36.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-37.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-38.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-39.js +2 -0
- package/src/extensions/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +113 -2
- package/src/extensions/pi-agent-read/src/core/extension.ts +19 -0
- package/src/extensions/pi-agent-read/src/core/read-core.ts +85 -13
- package/src/extensions/pi-agent-read/src/core/tools/read/output-truncation.ts +26 -10
- package/src/extensions/pi-agent-read/src/core/tools/read/persisted-result.ts +72 -0
- package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +102 -12
- package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +27 -3
- package/src/extensions/pi-agent-read/src/core/tools/read/views.ts +29 -0
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +532 -46
- package/src/extensions/pi-agent-search/package.json +7 -6
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +53 -3
- 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-45.js +2 -0
- 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/src/doctor-plugin.ts +20 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/persisted-result.ts +56 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +36 -34
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-query.ts +254 -71
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +68 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +71 -117
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +276 -110
- package/src/extensions/pi-agent-search/runtime/entry-41.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-42.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-43.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-44.js +2 -0
- package/src/extensions/pi-agent-search/src/api/search.ts +4 -0
- package/src/extensions/pi-agent-search/src/core/extension.ts +99 -27
- package/src/extensions/pi-agent-search/src/core/search-config.ts +98 -0
- package/src/extensions/pi-agent-search/src/core/search-core.ts +32 -28
- package/src/extensions/pi-agent-search/src/core/search-timeout.ts +54 -0
- package/src/extensions/pi-agent-text-editor/package.json +22 -21
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +7 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-48.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/src/resolver.ts +6 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.ts +34 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +27 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-49.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-50.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/anchor.ts +230 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/config.ts +159 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/fuzzy-worker.ts +100 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/recovery.ts +151 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +8 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +10 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-51.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-52.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/anchor.ts +32 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/read-handler.ts +20 -12
- 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-argument-order/runtime/entry-69.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/index.ts +1 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/package.json +4 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/runtime/entry-70.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +21 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-71.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/animation-pressure.ts +50 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/config.ts +73 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-model.ts +1 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-renderer.ts +77 -22
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-theme.ts +1 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +140 -24
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-projection.ts +274 -43
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-result.ts +33 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/persisted-result.ts +47 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/render-resource.ts +7 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +265 -105
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/typing-interpolation.ts +96 -15
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/index.ts +22 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-72.js +2 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-53.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-54.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-55.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-56.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-57.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-58.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-59.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-60.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-61.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-62.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-63.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-64.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-65.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-66.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-67.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-68.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/anchor-inspection.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +1 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +38 -0
- package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +30 -15
- package/src/extensions/pi-agent-text-editor/src/api/text-selection-anchor.ts +10 -13
- package/src/extensions/pi-agent-text-editor/src/api/tool-call-interceptor.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/builtin-edit-filter.ts +12 -5
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +15 -1
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/agent-diff.ts +14 -10
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/diff.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +3 -2
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +19 -2
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +64 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/inline-hints.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/read-fragment-resolver.ts +83 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-anchor-registry.ts +96 -8
- package/src/extensions/pi-agent-text-editor/src/core/text-change-engine.ts +4 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +194 -35
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +43 -13
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-config.ts +95 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +75 -5
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation-anchor-error.ts +7 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +541 -130
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +5 -9
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/rendering.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/tools/text-selection.ts +228 -6
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +50 -70
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +25 -26
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +30 -21
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +57 -71
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +30 -27
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +2 -0
- package/src/pi-agent-ide.ts +15 -3
- package/src/plugins/pi-agent-ide-ast/package.json +11 -10
- package/src/plugins/pi-agent-ide-ast/runtime/entry-24.js +1 -0
- package/src/plugins/pi-agent-ide-ast/runtime/entry-25.js +2 -0
- package/src/plugins/pi-agent-ide-ast/src/api/scope.ts +1 -1
- package/src/plugins/pi-agent-ide-ast/src/ast/outline.ts +1 -1
- package/src/plugins/pi-agent-ide-ast/src/doctor-plugin.ts +25 -0
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +13 -5
- package/src/plugins/pi-agent-ide-ast/src/scope-resolver.ts +6 -0
- package/src/plugins/pi-agent-ide-changes/index.ts +6 -2
- package/src/plugins/pi-agent-ide-changes/package.json +8 -7
- package/src/plugins/pi-agent-ide-changes/runtime/entry-26.js +1 -0
- package/src/plugins/pi-agent-ide-changes/runtime/entry-27.js +2 -0
- package/src/plugins/pi-agent-ide-changes/src/change-anchor.ts +6 -0
- package/src/plugins/pi-agent-ide-changes/src/changes/change-groups.ts +1 -1
- package/src/plugins/pi-agent-ide-changes/src/changes/change-service.ts +1 -1
- package/src/plugins/pi-agent-ide-changes/src/changes/git-changes-backend.ts +1 -0
- package/src/plugins/pi-agent-ide-changes/src/current-change-presenter.ts +1 -1
- package/src/plugins/pi-agent-ide-changes/src/doctor-plugin.ts +31 -1
- package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +5 -0
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +7 -0
- package/src/plugins/pi-agent-ide-diagnostics/index.ts +1 -0
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +191 -0
- package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
- package/src/plugins/pi-agent-ide-formatter/runtime/entry-28.js +2 -0
- package/src/plugins/pi-agent-ide-formatter/src/catalog.ts +34 -0
- package/src/plugins/pi-agent-ide-formatter/src/doctor-plugin.ts +115 -63
- package/src/plugins/pi-agent-ide-formatter/src/registry.ts +71 -28
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-languages/runtime/entry-29.js +2 -0
- package/src/plugins/pi-agent-ide-lint/index.ts +30 -155
- package/src/plugins/pi-agent-ide-lint/package.json +8 -7
- package/src/plugins/pi-agent-ide-lint/runtime/entry-30.js +2 -0
- package/src/plugins/pi-agent-ide-lint/src/catalog.ts +14 -2
- package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +60 -4
- package/src/plugins/pi-agent-ide-lint/src/diagnostics.ts +3 -1
- package/src/plugins/pi-agent-ide-lint/src/doctor-plugin.ts +115 -64
- package/src/plugins/pi-agent-ide-lint/src/registry.ts +72 -27
- package/src/plugins/pi-agent-ide-lsp/index.ts +35 -134
- package/src/plugins/pi-agent-ide-lsp/package.json +9 -8
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-31.js +2 -0
- package/src/plugins/pi-agent-ide-lsp/src/code-view-resolvers.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/src/diagnostic-source.ts +113 -0
- package/src/plugins/pi-agent-ide-lsp/src/doctor-plugin.ts +108 -53
- package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +94 -27
- package/src/plugins/pi-agent-ide-lsp/src/lsp/code-views.ts +2 -1
- package/src/plugins/pi-agent-ide-lsp/src/lsp/diagnostic-adapters.ts +76 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/diagnostics.ts +137 -144
- package/src/plugins/pi-agent-ide-lsp/src/lsp/lsp-compiler.ts +2 -2
- package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +9 -32
- package/src/plugins/pi-agent-ide-lsp/src/lsp/registry.ts +86 -50
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +1 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/types.ts +8 -6
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +5 -5
- package/src/post-edit/gate.ts +17 -141
- package/src/tips/core.ts +86 -0
- package/src/tips/extension.ts +115 -0
- package/src/tips/persistence.ts +225 -0
- package/src/tips/tip-callout.ts +77 -0
- package/src/toolchain/registry.ts +8 -23
- package/src/toolchain/types.ts +6 -74
- package/node_modules/pi-agent-search-semantic/index.ts +0 -97
- package/node_modules/pi-agent-search-semantic/package.json +0 -17
- package/node_modules/pi-agent-search-text/src/lucene-query-parser.d.ts +0 -20
- package/node_modules/pi-agent-search-web/index.ts +0 -82
- package/node_modules/pi-agent-search-web/package.json +0 -20
- package/node_modules/pi-agent-search-web/src/config.ts +0 -560
- package/node_modules/pi-agent-search-web/src/doctor-plugin.ts +0 -40
- package/node_modules/pi-agent-search-web/src/providers/duckduckgo-html.ts +0 -74
- package/node_modules/pi-agent-search-web/src/providers/endpoints.ts +0 -81
- package/node_modules/pi-agent-search-web/src/providers/request.ts +0 -427
- package/node_modules/pi-agent-search-web/src/providers/response.ts +0 -353
- package/node_modules/pi-agent-search-web/src/search-format.ts +0 -24
- package/node_modules/pi-agent-search-web/src/search.ts +0 -376
- package/node_modules/pi-agent-search-web/src/types.ts +0 -141
- package/src/composite/config.ts +0 -100
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-semantic/index.ts +0 -97
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-semantic/package.json +0 -17
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/lucene-query-parser.d.ts +0 -20
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/index.ts +0 -82
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/package.json +0 -20
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/config.ts +0 -560
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/doctor-plugin.ts +0 -40
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/duckduckgo-html.ts +0 -74
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/endpoints.ts +0 -81
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/request.ts +0 -427
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/response.ts +0 -353
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/search-format.ts +0 -24
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/search.ts +0 -376
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/types.ts +0 -141
- package/src/toolchain/gate.ts +0 -305
- /package/{src/utils/required-value.ts → node_modules/pi-agent-invariant/src/index.ts} +0 -0
|
@@ -39,6 +39,12 @@ export function createUndoMutationTool(
|
|
|
39
39
|
name: "undo",
|
|
40
40
|
description:
|
|
41
41
|
"Restore one selected current Git change to HEAD in the worktree and index, or restore one file to its state before its latest text-editor transaction.",
|
|
42
|
+
|
|
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
|
+
],
|
|
42
48
|
parameters: undoSchema,
|
|
43
49
|
intent: "restore",
|
|
44
50
|
source: { field: "file", inherited: true },
|
|
@@ -47,6 +53,7 @@ export function createUndoMutationTool(
|
|
|
47
53
|
field: "change",
|
|
48
54
|
sourceField: "file",
|
|
49
55
|
kinds: [CHANGE_ANCHOR_KIND],
|
|
56
|
+
nonAnchorValues: ["last"],
|
|
50
57
|
},
|
|
51
58
|
],
|
|
52
59
|
async mutate(context, parameters: UndoParameters) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./src/extension.js";
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
addDiagnosticAnnotations,
|
|
5
|
+
diagnosticStatus,
|
|
6
|
+
createDiagnosticViewContent,
|
|
7
|
+
createSourceMappedTextReadHandler,
|
|
8
|
+
formatDiagnosticViewSource,
|
|
9
|
+
resolveDiagnosticViewPath,
|
|
10
|
+
} from "pi-agent-ide/api/code-view";
|
|
11
|
+
import { connectIdePlugin } from "pi-agent-ide/api/connect-plugin";
|
|
12
|
+
import {
|
|
13
|
+
IDE_API_VERSION,
|
|
14
|
+
IDE_PROTOCOL,
|
|
15
|
+
type IdePlugin,
|
|
16
|
+
type IdePluginApi,
|
|
17
|
+
} from "pi-agent-ide/api/plugin-protocol";
|
|
18
|
+
import { connectReadPlugin } from "pi-agent-read/api/connect-plugin";
|
|
19
|
+
import {
|
|
20
|
+
READ_API_VERSION,
|
|
21
|
+
READ_PROTOCOL,
|
|
22
|
+
type ReadPlugin,
|
|
23
|
+
} from "pi-agent-read/api/plugin-protocol";
|
|
24
|
+
import { createReadResultRenderer } from "pi-agent-read/api/rendering";
|
|
25
|
+
|
|
26
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
27
|
+
import type { ResourceResolutionAttempt, ResourceResolver } from "pi-agent-resource";
|
|
28
|
+
import type { TextDocument, TextLinePresenter } from "pi-agent-text";
|
|
29
|
+
import type { ReadRequest } from "pi-agent-read/api/tools/read";
|
|
30
|
+
|
|
31
|
+
const DIAGNOSTIC_SCHEME = "diagnostics";
|
|
32
|
+
const renderReadResult = createReadResultRenderer({ kind: "code-view", label: "Diagnostics" });
|
|
33
|
+
|
|
34
|
+
type ReadDiagnostics = IdePluginApi["readDiagnostics"];
|
|
35
|
+
|
|
36
|
+
export default async function registerDiagnostics(pi: ExtensionAPI): Promise<void> {
|
|
37
|
+
let readDiagnostics: ReadDiagnostics | undefined;
|
|
38
|
+
const collect = (filePath: string, cwd: string) => {
|
|
39
|
+
if (readDiagnostics === undefined) {
|
|
40
|
+
throw new Error("IDE diagnostics are not connected");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return readDiagnostics(filePath, { cwd });
|
|
44
|
+
};
|
|
45
|
+
const idePlugin = {
|
|
46
|
+
protocol: IDE_PROTOCOL,
|
|
47
|
+
apiVersion: IDE_API_VERSION,
|
|
48
|
+
id: "diagnostics",
|
|
49
|
+
setup(api): void {
|
|
50
|
+
readDiagnostics = api.readDiagnostics;
|
|
51
|
+
},
|
|
52
|
+
} satisfies IdePlugin;
|
|
53
|
+
// Keep readiness outside source-line projection, including empty and ranged reads.
|
|
54
|
+
const documents = new WeakMap<ReadRequest, TextDocument>();
|
|
55
|
+
const statuses = new WeakMap<TextDocument, string>();
|
|
56
|
+
const readPlugin = {
|
|
57
|
+
protocol: READ_PROTOCOL,
|
|
58
|
+
apiVersion: READ_API_VERSION,
|
|
59
|
+
id: "diagnostics",
|
|
60
|
+
setup(api) {
|
|
61
|
+
api.addResolver({
|
|
62
|
+
resolver: createDiagnosticResolver(collect),
|
|
63
|
+
renderResult: renderReadResult,
|
|
64
|
+
});
|
|
65
|
+
const mapSource = createSourceMappedTextReadHandler();
|
|
66
|
+
api.addView({
|
|
67
|
+
view: "diagnostics",
|
|
68
|
+
priority: 100,
|
|
69
|
+
presenter: createDiagnosticPresenter(collect, statuses),
|
|
70
|
+
});
|
|
71
|
+
api.addHandler({
|
|
72
|
+
stage: "read",
|
|
73
|
+
when: { resolvedBy: "any", contentKind: "text" },
|
|
74
|
+
handler(context) {
|
|
75
|
+
if (context.state?.resolvedBy === "diagnostics") return mapSource(context);
|
|
76
|
+
if (
|
|
77
|
+
context.state?.contentKind === "text" &&
|
|
78
|
+
context.request.views?.includes("diagnostics")
|
|
79
|
+
) {
|
|
80
|
+
documents.set(context.request, context.state.text);
|
|
81
|
+
}
|
|
82
|
+
return { kind: "continue", context };
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
api.addHandler({
|
|
86
|
+
stage: "post-read",
|
|
87
|
+
handler(context) {
|
|
88
|
+
const document = documents.get(context.request);
|
|
89
|
+
const status = document && statuses.get(document);
|
|
90
|
+
const result = context.result;
|
|
91
|
+
const first = result?.content[0];
|
|
92
|
+
if (!status || !result || first?.type !== "text") return { kind: "continue", context };
|
|
93
|
+
return {
|
|
94
|
+
kind: "continue",
|
|
95
|
+
context: {
|
|
96
|
+
...context,
|
|
97
|
+
result: {
|
|
98
|
+
...result,
|
|
99
|
+
content: [
|
|
100
|
+
{ ...first, text: `${status}\n${first.text}` },
|
|
101
|
+
...result.content.slice(1),
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
api.describe(
|
|
109
|
+
"`diagnostics:<path>` returns lint and LSP diagnostics with five lines of source context on each side. The `diagnostics` view adds the same diagnostics alongside a normal file read. Both reuse background results, wait briefly for current checks, and report pending, unavailable, snapshot, or unversioned sources explicitly. A snapshot is the latest push update, not a completed check; an empty snapshot does not mean the file is clean.",
|
|
110
|
+
);
|
|
111
|
+
api.addPromptGuideline(
|
|
112
|
+
"Use read with `diagnostics:<path>` or the `diagnostics` view for per-file diagnostics instead of running equivalent checks through Bash. Project builds and tests remain separate verification.",
|
|
113
|
+
);
|
|
114
|
+
api.addPromptGuideline(
|
|
115
|
+
'You can use read with `views: ["diagnostics"]` to add lint and LSP diagnostics alongside file content.',
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
api.addPromptGuideline(
|
|
119
|
+
"Treat diagnostic snapshots as incomplete observations, not completed checks; an empty snapshot is not evidence that the file is clean.",
|
|
120
|
+
);
|
|
121
|
+
},
|
|
122
|
+
} satisfies ReadPlugin;
|
|
123
|
+
|
|
124
|
+
await Promise.all([connectIdePlugin(pi, idePlugin), connectReadPlugin(pi, readPlugin)]);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function createDiagnosticResolver(collect: CollectDiagnostics): ResourceResolver {
|
|
128
|
+
return {
|
|
129
|
+
id: "diagnostics",
|
|
130
|
+
tryResolve(source, context) {
|
|
131
|
+
return Promise.resolve(resolveDiagnosticSource(source, context.cwd, collect));
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
type CollectDiagnostics = (
|
|
137
|
+
filePath: string,
|
|
138
|
+
cwd: string,
|
|
139
|
+
) => ReturnType<IdePluginApi["readDiagnostics"]>;
|
|
140
|
+
|
|
141
|
+
function resolveDiagnosticSource(
|
|
142
|
+
source: string,
|
|
143
|
+
cwd: string,
|
|
144
|
+
collect: CollectDiagnostics,
|
|
145
|
+
): ResourceResolutionAttempt {
|
|
146
|
+
let filePath: string | undefined;
|
|
147
|
+
|
|
148
|
+
try {
|
|
149
|
+
filePath = resolveDiagnosticViewPath(source, DIAGNOSTIC_SCHEME, cwd);
|
|
150
|
+
} catch (error) {
|
|
151
|
+
return { kind: "failed", error };
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (filePath === undefined) {
|
|
155
|
+
return { kind: "not-handled" };
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return {
|
|
159
|
+
kind: "resolved",
|
|
160
|
+
resource: {
|
|
161
|
+
source: formatDiagnosticViewSource(DIAGNOSTIC_SCHEME, filePath),
|
|
162
|
+
async read() {
|
|
163
|
+
const snapshot = await collect(filePath, cwd);
|
|
164
|
+
return [createDiagnosticViewContent(filePath, snapshot.content, snapshot.results)];
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function createDiagnosticPresenter(
|
|
171
|
+
collect: CollectDiagnostics,
|
|
172
|
+
statuses: WeakMap<TextDocument, string>,
|
|
173
|
+
): TextLinePresenter {
|
|
174
|
+
return {
|
|
175
|
+
id: "diagnostics",
|
|
176
|
+
async present(document, context) {
|
|
177
|
+
if (context.purpose !== "read" || !path.isAbsolute(document.source)) {
|
|
178
|
+
return document;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const snapshot = await collect(document.source, context.cwd);
|
|
182
|
+
if (snapshot.content !== document.content) {
|
|
183
|
+
throw new Error(
|
|
184
|
+
"File changed during diagnostic read; read it again for current source lines.",
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
statuses.set(document, diagnosticStatus(snapshot.results));
|
|
188
|
+
return addDiagnosticAnnotations(document, snapshot.results);
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-formatter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-doctor": "0.
|
|
6
|
+
"pi-agent-doctor": "0.2.0"
|
|
7
7
|
},
|
|
8
8
|
"pi": {
|
|
9
9
|
"extensions": [
|
|
10
|
-
"./
|
|
10
|
+
"./runtime/entry-28.js"
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"@earendil-works/pi-coding-agent": "*",
|
|
15
|
-
"pi-agent-ide": "0.
|
|
15
|
+
"pi-agent-ide": "0.2.0"
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -15,6 +15,30 @@ const web = [
|
|
|
15
15
|
".md",
|
|
16
16
|
];
|
|
17
17
|
|
|
18
|
+
const oxfmtExtensions = [
|
|
19
|
+
".js",
|
|
20
|
+
".jsx",
|
|
21
|
+
".mjs",
|
|
22
|
+
".cjs",
|
|
23
|
+
".ts",
|
|
24
|
+
".tsx",
|
|
25
|
+
".mts",
|
|
26
|
+
".cts",
|
|
27
|
+
".json",
|
|
28
|
+
".jsonc",
|
|
29
|
+
".css",
|
|
30
|
+
".scss",
|
|
31
|
+
".less",
|
|
32
|
+
".html",
|
|
33
|
+
".htm",
|
|
34
|
+
".md",
|
|
35
|
+
".markdown",
|
|
36
|
+
".mdx",
|
|
37
|
+
".yaml",
|
|
38
|
+
".yml",
|
|
39
|
+
".toml",
|
|
40
|
+
];
|
|
41
|
+
|
|
18
42
|
/**
|
|
19
43
|
Formatter recipes owned by the formatter plugin.
|
|
20
44
|
*/
|
|
@@ -48,6 +72,16 @@ export const FORMATTER_RECIPES: readonly ToolRecipe[] = [
|
|
|
48
72
|
"https://biomejs.dev/",
|
|
49
73
|
["@biomejs/biome"],
|
|
50
74
|
),
|
|
75
|
+
recipe(
|
|
76
|
+
"oxfmt",
|
|
77
|
+
["javascript", "typescript", "json", "css", "html", "markdown", "yaml", "toml"],
|
|
78
|
+
["oxfmt"],
|
|
79
|
+
[".oxfmtrc.json", ".oxfmtrc.jsonc", "oxfmt.config.ts", "oxfmt.config.mts"],
|
|
80
|
+
oxfmtExtensions,
|
|
81
|
+
["oxfmt", "--write", "{file}"],
|
|
82
|
+
"https://oxc.rs/docs/guide/usage/formatter.html",
|
|
83
|
+
["oxfmt"],
|
|
84
|
+
),
|
|
51
85
|
recipe(
|
|
52
86
|
"ruff-format",
|
|
53
87
|
["python"],
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
import { copyFile, mkdtemp,
|
|
1
|
+
import { copyFile, mkdtemp, rm } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
|
|
4
4
|
import { DOCTOR_API_VERSION, DOCTOR_PROTOCOL } from "pi-agent-doctor/api/plugin-protocol";
|
|
5
|
-
import {
|
|
6
|
-
parseFormattersConfig,
|
|
7
|
-
projectIdeConfigPath,
|
|
8
|
-
runConfiguredFormatter,
|
|
9
|
-
} from "pi-agent-ide/api/tool-config";
|
|
5
|
+
import { hasConfiguredExecutable, runConfiguredFormatter } from "pi-agent-ide/api/tool-config";
|
|
10
6
|
|
|
11
7
|
import { FORMATTER_RECIPES } from "./catalog.js";
|
|
8
|
+
import { FormatterCommandRegistry } from "./registry.js";
|
|
12
9
|
|
|
13
|
-
import type {
|
|
10
|
+
import type {
|
|
11
|
+
DoctorContext,
|
|
12
|
+
DoctorFinding,
|
|
13
|
+
DoctorPlugin,
|
|
14
|
+
DoctorSetupInspection,
|
|
15
|
+
} from "pi-agent-doctor/api/plugin-protocol";
|
|
16
|
+
import type {
|
|
17
|
+
EffectiveToolConfigEntry,
|
|
18
|
+
FormatterCommandConfig,
|
|
19
|
+
} from "pi-agent-ide/api/tool-config";
|
|
14
20
|
|
|
15
21
|
/**
|
|
16
22
|
Doctor contribution owned by the formatter plugin.
|
|
@@ -24,73 +30,61 @@ export const formatterDoctorPlugin: DoctorPlugin = {
|
|
|
24
30
|
api.addToolRecipe(recipe);
|
|
25
31
|
}
|
|
26
32
|
|
|
33
|
+
api.addSetupCheck({
|
|
34
|
+
id: "effective-config",
|
|
35
|
+
inspect: inspectFormatterSetup,
|
|
36
|
+
});
|
|
37
|
+
|
|
27
38
|
api.addCheck({
|
|
28
39
|
id: "config",
|
|
29
40
|
title: "Formatter",
|
|
30
41
|
async run(context) {
|
|
31
|
-
const file = projectIdeConfigPath(context.cwd, "formatters");
|
|
32
|
-
|
|
33
42
|
try {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
message: `${Object.keys(config.formatters).length} formatter mappings loaded`,
|
|
39
|
-
detail: file,
|
|
40
|
-
},
|
|
41
|
-
];
|
|
43
|
+
const registry = await FormatterCommandRegistry.fromDirectory(context.cwd, {
|
|
44
|
+
environment: context.env,
|
|
45
|
+
});
|
|
46
|
+
const applicable = applicableFormatters(registry, context.files, context.cwd);
|
|
42
47
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
formatter
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (source === undefined) {
|
|
49
|
-
continue;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const directory = await mkdtemp(
|
|
53
|
-
path.join(path.dirname(source), ".pi-agent-ide-doctor-"),
|
|
54
|
-
);
|
|
55
|
-
const probe = path.join(directory, path.basename(source));
|
|
56
|
-
|
|
57
|
-
try {
|
|
58
|
-
await copyFile(source, probe);
|
|
59
|
-
const result = await runConfiguredFormatter(formatter, {
|
|
60
|
-
projectRoot: context.cwd,
|
|
61
|
-
filePath: probe,
|
|
62
|
-
env: context.env,
|
|
63
|
-
});
|
|
64
|
-
findings.push(
|
|
65
|
-
result.ok
|
|
66
|
-
? { status: "pass", message: `${id} probe passed`, detail: path.basename(source) }
|
|
67
|
-
: {
|
|
68
|
-
status: "fail",
|
|
69
|
-
message: `${id} probe failed`,
|
|
70
|
-
detail: path.basename(source),
|
|
71
|
-
},
|
|
72
|
-
);
|
|
73
|
-
} catch (error) {
|
|
74
|
-
findings.push({
|
|
75
|
-
status: "fail",
|
|
76
|
-
message: `${id}: ${error instanceof Error ? error.message : String(error)}`,
|
|
77
|
-
});
|
|
78
|
-
} finally {
|
|
79
|
-
await rm(directory, { recursive: true, force: true });
|
|
80
|
-
}
|
|
48
|
+
if (applicable.length === 0) {
|
|
49
|
+
return [
|
|
50
|
+
{ status: "skip", message: "No formatter matches the inspected project files" },
|
|
51
|
+
];
|
|
81
52
|
}
|
|
82
53
|
|
|
83
|
-
return
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
54
|
+
return await Promise.all(
|
|
55
|
+
applicable.map(async ({ entry, source }): Promise<DoctorFinding> => {
|
|
56
|
+
const label = `${entry.id} [${entry.layer}] command ${JSON.stringify(entry.config.run.command)}`;
|
|
57
|
+
const directory = await mkdtemp(
|
|
58
|
+
path.join(path.dirname(source), ".pi-agent-ide-doctor-"),
|
|
59
|
+
);
|
|
60
|
+
const probe = path.join(directory, path.basename(source));
|
|
88
61
|
|
|
62
|
+
try {
|
|
63
|
+
await copyFile(source, probe);
|
|
64
|
+
const result = await runConfiguredFormatter(entry.config, {
|
|
65
|
+
projectRoot: context.cwd,
|
|
66
|
+
filePath: probe,
|
|
67
|
+
env: context.env,
|
|
68
|
+
});
|
|
69
|
+
return result.ok
|
|
70
|
+
? { status: "pass", message: `${label}: probe passed`, detail: entry.sourcePath }
|
|
71
|
+
: { status: "fail", message: `${label}: probe failed`, detail: entry.sourcePath };
|
|
72
|
+
} catch (error) {
|
|
73
|
+
return {
|
|
74
|
+
status: "fail",
|
|
75
|
+
message: `${label}: ${error instanceof Error ? error.message : String(error)}`,
|
|
76
|
+
detail: entry.sourcePath,
|
|
77
|
+
};
|
|
78
|
+
} finally {
|
|
79
|
+
await rm(directory, { recursive: true, force: true });
|
|
80
|
+
}
|
|
81
|
+
}),
|
|
82
|
+
);
|
|
83
|
+
} catch (error) {
|
|
89
84
|
return [
|
|
90
85
|
{
|
|
91
86
|
status: "fail",
|
|
92
87
|
message: error instanceof Error ? error.message : String(error),
|
|
93
|
-
detail: file,
|
|
94
88
|
},
|
|
95
89
|
];
|
|
96
90
|
}
|
|
@@ -99,6 +93,64 @@ export const formatterDoctorPlugin: DoctorPlugin = {
|
|
|
99
93
|
},
|
|
100
94
|
};
|
|
101
95
|
|
|
102
|
-
function
|
|
103
|
-
|
|
96
|
+
async function inspectFormatterSetup(context: DoctorContext): Promise<DoctorSetupInspection> {
|
|
97
|
+
try {
|
|
98
|
+
const registry = await FormatterCommandRegistry.fromDirectory(context.cwd, {
|
|
99
|
+
environment: context.env,
|
|
100
|
+
});
|
|
101
|
+
const selections = [];
|
|
102
|
+
const actions = new Map<string, { readonly id: string; readonly message: string }>();
|
|
103
|
+
|
|
104
|
+
for (const [languageId, files] of context.detectedLanguages) {
|
|
105
|
+
const selected = files
|
|
106
|
+
.map((file) => registry.resolveEntry(file, context.cwd))
|
|
107
|
+
.find((entry) => entry !== undefined);
|
|
108
|
+
if (selected === undefined) {
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
selections.push({ kind: "formatter" as const, languageId, toolId: selected.id });
|
|
113
|
+
if (!(await hasConfiguredExecutable(selected.config.run, context.cwd, context.env))) {
|
|
114
|
+
actions.set(selected.id, {
|
|
115
|
+
id: `formatter-${selected.id}-unavailable`,
|
|
116
|
+
message: `Configured formatter ${selected.id} cannot run ${JSON.stringify(selected.config.run.command)}`,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return { selections, actions: [...actions.values()] };
|
|
122
|
+
} catch (error) {
|
|
123
|
+
return {
|
|
124
|
+
actions: [
|
|
125
|
+
{
|
|
126
|
+
id: "formatter-config-invalid",
|
|
127
|
+
message: `Formatter configuration cannot load: ${error instanceof Error ? error.message : String(error)}`,
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function applicableFormatters(
|
|
135
|
+
registry: FormatterCommandRegistry,
|
|
136
|
+
files: readonly string[],
|
|
137
|
+
projectRoot: string,
|
|
138
|
+
): readonly {
|
|
139
|
+
readonly entry: EffectiveToolConfigEntry<FormatterCommandConfig>;
|
|
140
|
+
readonly source: string;
|
|
141
|
+
}[] {
|
|
142
|
+
const applicable = new Map<
|
|
143
|
+
string,
|
|
144
|
+
{ entry: EffectiveToolConfigEntry<FormatterCommandConfig>; source: string }
|
|
145
|
+
>();
|
|
146
|
+
|
|
147
|
+
for (const source of files) {
|
|
148
|
+
const entry = registry.resolveEntry(source, projectRoot);
|
|
149
|
+
|
|
150
|
+
if (entry !== undefined && !applicable.has(entry.id)) {
|
|
151
|
+
applicable.set(entry.id, { entry, source });
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return [...applicable.values()];
|
|
104
156
|
}
|
|
@@ -1,54 +1,97 @@
|
|
|
1
|
-
import { readFile } from "node:fs/promises";
|
|
2
1
|
import path from "node:path";
|
|
3
2
|
|
|
4
3
|
import {
|
|
4
|
+
hasConfiguredExecutable,
|
|
5
|
+
loadLayeredToolConfig,
|
|
5
6
|
matchesConfiguredFile,
|
|
6
7
|
parseFormattersConfig,
|
|
7
|
-
projectIdeConfigPath,
|
|
8
8
|
} from "pi-agent-ide/api/tool-config";
|
|
9
9
|
|
|
10
|
-
import type {
|
|
10
|
+
import type {
|
|
11
|
+
EffectiveToolConfigEntry,
|
|
12
|
+
FormatterCommandConfig,
|
|
13
|
+
FormattersConfig,
|
|
14
|
+
LayeredToolConfigOptions,
|
|
15
|
+
} from "pi-agent-ide/api/tool-config";
|
|
11
16
|
|
|
12
17
|
/**
|
|
13
|
-
Validated formatter commands
|
|
18
|
+
Validated formatter commands in project, global, and built-in priority order.
|
|
14
19
|
*/
|
|
15
20
|
export class FormatterCommandRegistry {
|
|
16
|
-
private constructor(
|
|
21
|
+
private constructor(
|
|
22
|
+
private readonly formatters: readonly EffectiveToolConfigEntry<FormatterCommandConfig>[],
|
|
23
|
+
private readonly availableBuiltIns: ReadonlySet<string>,
|
|
24
|
+
) {}
|
|
17
25
|
|
|
18
26
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
public static async fromDirectory(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
Loads and merges project, global, and built-in `formatters.json` files.
|
|
28
|
+
*/
|
|
29
|
+
public static async fromDirectory(
|
|
30
|
+
directory: string,
|
|
31
|
+
options: LayeredToolConfigOptions = {},
|
|
32
|
+
): Promise<FormatterCommandRegistry> {
|
|
33
|
+
const effective = await loadLayeredToolConfig(
|
|
34
|
+
directory,
|
|
35
|
+
"formatters",
|
|
36
|
+
(value) => parseFormattersConfig(value).formatters,
|
|
37
|
+
options,
|
|
38
|
+
);
|
|
39
|
+
const environment = options.environment ?? process.env;
|
|
40
|
+
const available = await Promise.all(
|
|
41
|
+
effective.entries
|
|
42
|
+
.filter((entry) => entry.layer === "built-in")
|
|
43
|
+
.map(async (entry) => ({
|
|
44
|
+
id: entry.id,
|
|
45
|
+
available: await hasConfiguredExecutable(entry.config.run, directory, environment),
|
|
46
|
+
})),
|
|
47
|
+
);
|
|
48
|
+
return new FormatterCommandRegistry(
|
|
49
|
+
effective.entries,
|
|
50
|
+
new Set(available.filter((entry) => entry.available).map((entry) => entry.id)),
|
|
51
|
+
);
|
|
32
52
|
}
|
|
33
53
|
|
|
34
54
|
/**
|
|
35
|
-
|
|
36
|
-
|
|
55
|
+
Creates a project-layer registry from a validated value.
|
|
56
|
+
*/
|
|
37
57
|
public static fromConfig(config: FormattersConfig): FormatterCommandRegistry {
|
|
38
|
-
return new FormatterCommandRegistry(
|
|
58
|
+
return new FormatterCommandRegistry(
|
|
59
|
+
Object.entries(config.formatters).map(([id, formatter]) => ({
|
|
60
|
+
id,
|
|
61
|
+
config: formatter,
|
|
62
|
+
layer: "project",
|
|
63
|
+
sourcePath: "<memory>",
|
|
64
|
+
})),
|
|
65
|
+
new Set(),
|
|
66
|
+
);
|
|
39
67
|
}
|
|
40
68
|
|
|
41
69
|
/**
|
|
42
|
-
|
|
43
|
-
|
|
70
|
+
Returns the first command matching this file.
|
|
71
|
+
*/
|
|
44
72
|
public resolve(filePath: string, projectRoot: string): FormatterCommandConfig | undefined {
|
|
73
|
+
return this.resolveEntry(filePath, projectRoot)?.config;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
Returns the first matching command together with its stable ID and source layer.
|
|
78
|
+
*/
|
|
79
|
+
public resolveEntry(
|
|
80
|
+
filePath: string,
|
|
81
|
+
projectRoot: string,
|
|
82
|
+
): EffectiveToolConfigEntry<FormatterCommandConfig> | undefined {
|
|
45
83
|
const absolute = path.isAbsolute(filePath) ? filePath : path.join(projectRoot, filePath);
|
|
46
|
-
return this.formatters.find(
|
|
47
|
-
|
|
84
|
+
return this.formatters.find(
|
|
85
|
+
(formatter) =>
|
|
86
|
+
(formatter.layer !== "built-in" || this.availableBuiltIns.has(formatter.id)) &&
|
|
87
|
+
matchesConfiguredFile(formatter.config, absolute, projectRoot),
|
|
48
88
|
);
|
|
49
89
|
}
|
|
50
|
-
}
|
|
51
90
|
|
|
52
|
-
|
|
53
|
-
|
|
91
|
+
/**
|
|
92
|
+
Lists all merged entries in runtime resolution order.
|
|
93
|
+
*/
|
|
94
|
+
public get entries(): readonly EffectiveToolConfigEntry<FormatterCommandConfig>[] {
|
|
95
|
+
return this.formatters;
|
|
96
|
+
}
|
|
54
97
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-languages",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-doctor": "0.
|
|
6
|
+
"pi-agent-doctor": "0.2.0"
|
|
7
7
|
},
|
|
8
8
|
"pi": {
|
|
9
9
|
"extensions": [
|
|
10
|
-
"./
|
|
10
|
+
"./runtime/entry-29.js"
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|