pi-agent-ide 0.1.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/LICENSE +21 -0
- package/README.md +53 -0
- package/assets/banner.png +0 -0
- package/docs/architecture.md +100 -0
- package/docs/configuration.md +104 -0
- package/docs/development.md +102 -0
- package/docs/evaluation.md +14 -0
- package/docs/extensions.md +298 -0
- package/docs/tools.md +104 -0
- package/node_modules/pi-agent-filesystem/index.ts +60 -0
- package/node_modules/pi-agent-filesystem/package.json +23 -0
- package/node_modules/pi-agent-filesystem/src/resolver.ts +175 -0
- package/node_modules/pi-agent-filesystem-image/index.ts +14 -0
- package/node_modules/pi-agent-filesystem-image/package.json +20 -0
- package/node_modules/pi-agent-filesystem-pdf/index.ts +14 -0
- package/node_modules/pi-agent-filesystem-pdf/package.json +17 -0
- package/node_modules/pi-agent-filesystem-text/index.ts +23 -0
- package/node_modules/pi-agent-filesystem-text/package.json +20 -0
- package/node_modules/pi-agent-ide-ast/index.ts +1 -0
- package/node_modules/pi-agent-ide-ast/package.json +39 -0
- package/node_modules/pi-agent-ide-ast/src/api/scope.ts +1 -0
- package/node_modules/pi-agent-ide-ast/src/ast/collect-files.ts +24 -0
- package/node_modules/pi-agent-ide-ast/src/ast/manager.ts +374 -0
- package/node_modules/pi-agent-ide-ast/src/ast/outline.ts +813 -0
- package/node_modules/pi-agent-ide-ast/src/ast/read-text.ts +30 -0
- package/node_modules/pi-agent-ide-ast/src/extension.ts +85 -0
- package/node_modules/pi-agent-ide-ast/src/outline-resolver.ts +69 -0
- package/node_modules/pi-agent-ide-ast/src/scope-handler.ts +221 -0
- package/node_modules/pi-agent-ide-ast/src/scope-resolver.ts +45 -0
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +141 -0
- package/node_modules/pi-agent-ide-changes/index.ts +68 -0
- package/node_modules/pi-agent-ide-changes/package.json +29 -0
- package/node_modules/pi-agent-ide-changes/src/change-anchor.ts +103 -0
- package/node_modules/pi-agent-ide-changes/src/changes/change-groups.ts +309 -0
- package/node_modules/pi-agent-ide-changes/src/changes/change-service.ts +223 -0
- package/node_modules/pi-agent-ide-changes/src/changes/change-types.ts +105 -0
- package/node_modules/pi-agent-ide-changes/src/changes/git-changes-backend.ts +325 -0
- package/node_modules/pi-agent-ide-changes/src/current-change-presenter.ts +232 -0
- package/node_modules/pi-agent-ide-changes/src/index-mutation-queue.ts +11 -0
- package/node_modules/pi-agent-ide-changes/src/last-text-transaction-store.ts +88 -0
- package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +116 -0
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +153 -0
- package/node_modules/pi-agent-ide-formatter/index.ts +33 -0
- package/node_modules/pi-agent-ide-formatter/package.json +14 -0
- package/node_modules/pi-agent-ide-formatter/src/formatter.ts +50 -0
- package/node_modules/pi-agent-ide-formatter/src/registry.ts +30 -0
- package/node_modules/pi-agent-ide-formatter/src/types.ts +10 -0
- package/node_modules/pi-agent-ide-lint/index.ts +237 -0
- package/node_modules/pi-agent-ide-lint/package.json +19 -0
- package/node_modules/pi-agent-ide-lint/src/command-linter.ts +160 -0
- package/node_modules/pi-agent-ide-lint/src/command-runner.ts +51 -0
- package/node_modules/pi-agent-ide-lint/src/registry.ts +30 -0
- package/node_modules/pi-agent-ide-lint/src/types.ts +10 -0
- package/node_modules/pi-agent-ide-lsp/index.ts +250 -0
- package/node_modules/pi-agent-ide-lsp/package.json +23 -0
- package/node_modules/pi-agent-ide-lsp/src/code-view-resolvers.ts +139 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +463 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/code-views.ts +577 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/diagnostics.ts +179 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/index.ts +59 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/language-map.ts +57 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/lsp-compiler.ts +85 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +485 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/navigation.ts +85 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/registry.ts +97 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/rename.ts +50 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +149 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbols.ts +151 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/types.ts +95 -0
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +42 -0
- package/node_modules/pi-agent-image/package.json +18 -0
- package/node_modules/pi-agent-image/src/image-converter.ts +318 -0
- package/node_modules/pi-agent-image/src/index.ts +6 -0
- package/node_modules/pi-agent-pdf/package.json +16 -0
- package/node_modules/pi-agent-pdf/src/index.ts +5 -0
- package/node_modules/pi-agent-pdf/src/pdf-converter.ts +197 -0
- package/node_modules/pi-agent-read/index.ts +1 -0
- package/node_modules/pi-agent-read/package.json +41 -0
- package/node_modules/pi-agent-read/src/api/connect-plugin.ts +67 -0
- package/node_modules/pi-agent-read/src/api/plugin-protocol.ts +67 -0
- package/node_modules/pi-agent-read/src/api/rendering.ts +11 -0
- package/node_modules/pi-agent-read/src/api/tools/read.ts +208 -0
- package/node_modules/pi-agent-read/src/core/extension.ts +40 -0
- package/node_modules/pi-agent-read/src/core/read-core.ts +390 -0
- package/node_modules/pi-agent-read/src/core/tools/read/output-truncation.ts +193 -0
- package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +400 -0
- package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +187 -0
- package/node_modules/pi-agent-read/src/core/tools/read/temp-resource-store.ts +218 -0
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +828 -0
- package/node_modules/pi-agent-resource/package.json +17 -0
- package/node_modules/pi-agent-resource/src/content-conversion/connect-plugin.ts +84 -0
- package/node_modules/pi-agent-resource/src/content-conversion/content-converter.ts +49 -0
- package/node_modules/pi-agent-resource/src/content-conversion/content-description.ts +29 -0
- package/node_modules/pi-agent-resource/src/content-conversion/content-host.ts +73 -0
- package/node_modules/pi-agent-resource/src/content-conversion/content-runner.ts +152 -0
- package/node_modules/pi-agent-resource/src/content-conversion/plugin-protocol.ts +74 -0
- package/node_modules/pi-agent-resource/src/content-conversion/validation.ts +149 -0
- package/node_modules/pi-agent-resource/src/content.ts +17 -0
- package/node_modules/pi-agent-resource/src/index.ts +65 -0
- package/node_modules/pi-agent-resource/src/resolver.ts +23 -0
- package/node_modules/pi-agent-resource/src/resource.ts +41 -0
- package/node_modules/pi-agent-resource/src/validation.ts +139 -0
- package/node_modules/pi-agent-search/index.ts +1 -0
- package/node_modules/pi-agent-search/package.json +35 -0
- package/node_modules/pi-agent-search/src/api/connect-plugin.ts +61 -0
- package/node_modules/pi-agent-search/src/api/plugin-protocol.ts +60 -0
- package/node_modules/pi-agent-search/src/api/search.ts +91 -0
- package/node_modules/pi-agent-search/src/core/extension.ts +126 -0
- package/node_modules/pi-agent-search/src/core/search-core.ts +400 -0
- package/node_modules/pi-agent-search-semantic/index.ts +105 -0
- package/node_modules/pi-agent-search-semantic/package.json +17 -0
- package/node_modules/pi-agent-search-text/index.ts +54 -0
- package/node_modules/pi-agent-search-text/package.json +33 -0
- package/node_modules/pi-agent-search-text/src/file-search.ts +105 -0
- package/node_modules/pi-agent-search-text/src/lucene-query-parser.d.ts +22 -0
- package/node_modules/pi-agent-search-text/src/resolvers.ts +192 -0
- package/node_modules/pi-agent-search-text/src/search-backend.ts +295 -0
- package/node_modules/pi-agent-search-text/src/search-query.ts +139 -0
- package/node_modules/pi-agent-search-text/src/search-renderer.ts +420 -0
- package/node_modules/pi-agent-search-text/src/search-result.ts +193 -0
- package/node_modules/pi-agent-search-text/src/search-session.ts +338 -0
- package/node_modules/pi-agent-search-web/index.ts +74 -0
- package/node_modules/pi-agent-search-web/package.json +19 -0
- package/node_modules/pi-agent-search-web/src/config.ts +499 -0
- package/node_modules/pi-agent-search-web/src/providers/duckduckgo-html.ts +78 -0
- package/node_modules/pi-agent-search-web/src/providers/endpoints.ts +89 -0
- package/node_modules/pi-agent-search-web/src/providers/request.ts +430 -0
- package/node_modules/pi-agent-search-web/src/providers/response.ts +402 -0
- package/node_modules/pi-agent-search-web/src/search-format.ts +29 -0
- package/node_modules/pi-agent-search-web/src/search.ts +434 -0
- package/node_modules/pi-agent-search-web/src/types.ts +153 -0
- package/node_modules/pi-agent-text/package.json +18 -0
- package/node_modules/pi-agent-text/src/index.ts +31 -0
- package/node_modules/pi-agent-text/src/presented-text.ts +24 -0
- package/node_modules/pi-agent-text/src/source-line.ts +49 -0
- package/node_modules/pi-agent-text/src/text-anchor.ts +157 -0
- package/node_modules/pi-agent-text/src/text-converter.ts +109 -0
- package/node_modules/pi-agent-text/src/text-document.ts +149 -0
- package/node_modules/pi-agent-text-anchor-constant/index.ts +30 -0
- package/node_modules/pi-agent-text-anchor-constant/package.json +17 -0
- package/node_modules/pi-agent-text-anchor-constant/src/resolver.ts +47 -0
- package/node_modules/pi-agent-text-anchor-line-hash/index.ts +48 -0
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +24 -0
- package/node_modules/pi-agent-text-anchor-line-hash/src/anchor.ts +110 -0
- package/node_modules/pi-agent-text-anchor-line-hash/src/read-handler.ts +47 -0
- package/node_modules/pi-agent-text-editor/index.ts +19 -0
- package/node_modules/pi-agent-text-editor/package.json +92 -0
- package/node_modules/pi-agent-text-editor/src/api/anchor-inspection.ts +24 -0
- package/node_modules/pi-agent-text-editor/src/api/connect-plugin.ts +67 -0
- package/node_modules/pi-agent-text-editor/src/api/edit-completion.ts +19 -0
- package/node_modules/pi-agent-text-editor/src/api/edit-pipeline.ts +64 -0
- package/node_modules/pi-agent-text-editor/src/api/last-resolved-resource.ts +46 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-guard.ts +46 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-preview.ts +30 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +23 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +180 -0
- package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +217 -0
- package/node_modules/pi-agent-text-editor/src/api/post-edit.ts +147 -0
- package/node_modules/pi-agent-text-editor/src/api/stale-anchor-message.ts +17 -0
- package/node_modules/pi-agent-text-editor/src/api/text-selection-anchor.ts +121 -0
- package/node_modules/pi-agent-text-editor/src/api/tool-call-interceptor.ts +11 -0
- package/node_modules/pi-agent-text-editor/src/api/tool-renderer.ts +39 -0
- package/node_modules/pi-agent-text-editor/src/core/builtin-edit-filter.ts +59 -0
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +150 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/agent-diff.ts +386 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/diff.ts +129 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +359 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +648 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/inline-hints.ts +117 -0
- package/node_modules/pi-agent-text-editor/src/core/text-anchor-recovery.ts +24 -0
- package/node_modules/pi-agent-text-editor/src/core/text-anchor-registry.ts +381 -0
- package/node_modules/pi-agent-text-editor/src/core/text-change-engine.ts +273 -0
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +607 -0
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-execution.ts +127 -0
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-recovery.ts +45 -0
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +432 -0
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +115 -0
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +2348 -0
- package/node_modules/pi-agent-text-editor/src/core/text-mutation-anchor-error.ts +28 -0
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +756 -0
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +1235 -0
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/partial-json-resolver.ts +43 -0
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/partial-tool-recovery.ts +308 -0
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/rendering.ts +4 -0
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +467 -0
- package/node_modules/pi-agent-text-editor/src/core/tool-description.ts +16 -0
- package/node_modules/pi-agent-text-editor/src/tools/extension.ts +19 -0
- package/node_modules/pi-agent-text-editor/src/tools/text-selection.ts +106 -0
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +121 -0
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +79 -0
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +56 -0
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +142 -0
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +72 -0
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +28 -0
- package/node_modules/pi-agent-text-editor-argument-order/index.ts +29 -0
- package/node_modules/pi-agent-text-editor-argument-order/package.json +16 -0
- package/node_modules/pi-agent-text-editor-argument-order/src/argument-order-guard.ts +112 -0
- package/node_modules/pi-agent-text-editor-overwrite/index.ts +391 -0
- package/node_modules/pi-agent-text-editor-overwrite/package.json +16 -0
- package/node_modules/pi-agent-text-editor-renderer/index.ts +22 -0
- package/node_modules/pi-agent-text-editor-renderer/package.json +21 -0
- package/node_modules/pi-agent-text-editor-renderer/src/diff-model.ts +452 -0
- package/node_modules/pi-agent-text-editor-renderer/src/diff-renderer.ts +271 -0
- package/node_modules/pi-agent-text-editor-renderer/src/diff-theme.ts +411 -0
- package/node_modules/pi-agent-text-editor-renderer/src/diff-viewport.ts +38 -0
- package/node_modules/pi-agent-text-editor-renderer/src/frozen-viewport.ts +205 -0
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +229 -0
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-projection.ts +407 -0
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-result.ts +153 -0
- package/node_modules/pi-agent-text-editor-renderer/src/render-resource.ts +8 -0
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +728 -0
- package/node_modules/pi-agent-text-editor-renderer/src/typing-interpolation.ts +219 -0
- package/node_modules/pi-agent-text-editor-stale-anchor/index.ts +375 -0
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +17 -0
- package/node_modules/pi-agent-tool-call-interception/package.json +17 -0
- package/node_modules/pi-agent-tool-call-interception/src/index.ts +418 -0
- package/node_modules/pi-agent-web/index.ts +37 -0
- package/node_modules/pi-agent-web/package.json +24 -0
- package/node_modules/pi-agent-web/src/resolver.ts +182 -0
- package/node_modules/pi-agent-web-html/index.ts +15 -0
- package/node_modules/pi-agent-web-html/package.json +18 -0
- package/node_modules/pi-agent-web-html/src/extract-readable-html.ts +101 -0
- package/node_modules/pi-agent-web-html/src/html-converter.ts +91 -0
- package/node_modules/pi-agent-web-image/index.ts +14 -0
- package/node_modules/pi-agent-web-image/package.json +17 -0
- package/node_modules/pi-agent-web-pdf/index.ts +14 -0
- package/node_modules/pi-agent-web-pdf/package.json +17 -0
- package/node_modules/pi-agent-web-text/index.ts +14 -0
- package/node_modules/pi-agent-web-text/package.json +17 -0
- package/package.json +176 -0
- package/src/api/code-view.ts +25 -0
- package/src/api/connect-plugin.ts +64 -0
- package/src/api/plugin-protocol.ts +63 -0
- package/src/api/read.ts +5 -0
- package/src/api/resource.ts +2 -0
- package/src/api/search.ts +4 -0
- package/src/api/text-editor.ts +3 -0
- package/src/api/text.ts +2 -0
- package/src/api/toolchain.ts +24 -0
- package/src/code-view/diagnostic-view.ts +82 -0
- package/src/code-view/reference.ts +113 -0
- package/src/code-view/source-view.ts +229 -0
- package/src/composite/builtin-extensions.ts +68 -0
- package/src/composite/config.ts +94 -0
- package/src/composite/selection.ts +66 -0
- package/src/core/extension.ts +48 -0
- package/src/core/ide-core.ts +117 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +60 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +23 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/index.ts +14 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +20 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/index.ts +14 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +17 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/index.ts +23 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +20 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/src/resolver.ts +175 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +37 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +24 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/index.ts +15 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +18 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/src/extract-readable-html.ts +101 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/src/html-converter.ts +91 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/index.ts +14 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +17 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/index.ts +14 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +17 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/index.ts +14 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +17 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/resolver.ts +182 -0
- package/src/extensions/pi-agent-read/index.ts +1 -0
- package/src/extensions/pi-agent-read/package.json +41 -0
- package/src/extensions/pi-agent-read/src/api/connect-plugin.ts +67 -0
- package/src/extensions/pi-agent-read/src/api/plugin-protocol.ts +67 -0
- package/src/extensions/pi-agent-read/src/api/rendering.ts +11 -0
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +208 -0
- package/src/extensions/pi-agent-read/src/core/extension.ts +40 -0
- package/src/extensions/pi-agent-read/src/core/read-core.ts +390 -0
- package/src/extensions/pi-agent-read/src/core/tools/read/output-truncation.ts +193 -0
- package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +400 -0
- package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +187 -0
- package/src/extensions/pi-agent-read/src/core/tools/read/temp-resource-store.ts +218 -0
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +828 -0
- package/src/extensions/pi-agent-search/index.ts +1 -0
- package/src/extensions/pi-agent-search/package.json +35 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-semantic/index.ts +105 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-semantic/package.json +17 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +54 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +33 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/file-search.ts +105 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/lucene-query-parser.d.ts +22 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +192 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +295 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-query.ts +139 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +420 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +193 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +338 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/index.ts +74 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/package.json +19 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/config.ts +499 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/duckduckgo-html.ts +78 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/endpoints.ts +89 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/request.ts +430 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/providers/response.ts +402 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/search-format.ts +29 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/search.ts +434 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-web/src/types.ts +153 -0
- package/src/extensions/pi-agent-search/src/api/connect-plugin.ts +61 -0
- package/src/extensions/pi-agent-search/src/api/plugin-protocol.ts +60 -0
- package/src/extensions/pi-agent-search/src/api/search.ts +91 -0
- package/src/extensions/pi-agent-search/src/core/extension.ts +126 -0
- package/src/extensions/pi-agent-search/src/core/search-core.ts +400 -0
- package/src/extensions/pi-agent-text-editor/index.ts +19 -0
- package/src/extensions/pi-agent-text-editor/package.json +92 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/index.ts +30 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +17 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/src/resolver.ts +47 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +48 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +24 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/anchor.ts +110 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/read-handler.ts +47 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/index.ts +29 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/package.json +16 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-argument-order/src/argument-order-guard.ts +112 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/index.ts +391 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-overwrite/package.json +16 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +22 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +21 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-model.ts +452 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-renderer.ts +271 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-theme.ts +411 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-viewport.ts +38 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/frozen-viewport.ts +205 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +229 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-projection.ts +407 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-result.ts +153 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/render-resource.ts +8 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +728 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/typing-interpolation.ts +219 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/index.ts +375 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +17 -0
- package/src/extensions/pi-agent-text-editor/src/api/anchor-inspection.ts +24 -0
- package/src/extensions/pi-agent-text-editor/src/api/connect-plugin.ts +67 -0
- package/src/extensions/pi-agent-text-editor/src/api/edit-completion.ts +19 -0
- package/src/extensions/pi-agent-text-editor/src/api/edit-pipeline.ts +64 -0
- package/src/extensions/pi-agent-text-editor/src/api/last-resolved-resource.ts +46 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-guard.ts +46 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-preview.ts +30 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +23 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +180 -0
- package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +217 -0
- package/src/extensions/pi-agent-text-editor/src/api/post-edit.ts +147 -0
- package/src/extensions/pi-agent-text-editor/src/api/stale-anchor-message.ts +17 -0
- package/src/extensions/pi-agent-text-editor/src/api/text-selection-anchor.ts +121 -0
- package/src/extensions/pi-agent-text-editor/src/api/tool-call-interceptor.ts +11 -0
- package/src/extensions/pi-agent-text-editor/src/api/tool-renderer.ts +39 -0
- package/src/extensions/pi-agent-text-editor/src/core/builtin-edit-filter.ts +59 -0
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +150 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/agent-diff.ts +386 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/diff.ts +129 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +359 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +648 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/inline-hints.ts +117 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-anchor-recovery.ts +24 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-anchor-registry.ts +381 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-change-engine.ts +273 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +607 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-execution.ts +127 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-recovery.ts +45 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +432 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +115 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +2348 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation-anchor-error.ts +28 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +756 -0
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +1235 -0
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/partial-json-resolver.ts +43 -0
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/partial-tool-recovery.ts +308 -0
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/rendering.ts +4 -0
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/streaming-provider.ts +467 -0
- package/src/extensions/pi-agent-text-editor/src/core/tool-description.ts +16 -0
- package/src/extensions/pi-agent-text-editor/src/tools/extension.ts +19 -0
- package/src/extensions/pi-agent-text-editor/src/tools/text-selection.ts +106 -0
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +121 -0
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +79 -0
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +56 -0
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +142 -0
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +72 -0
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +28 -0
- package/src/index.ts +1 -0
- package/src/pi-agent-ide.ts +17 -0
- package/src/plugins/pi-agent-ide-ast/index.ts +1 -0
- package/src/plugins/pi-agent-ide-ast/package.json +39 -0
- package/src/plugins/pi-agent-ide-ast/src/api/scope.ts +1 -0
- package/src/plugins/pi-agent-ide-ast/src/ast/collect-files.ts +24 -0
- package/src/plugins/pi-agent-ide-ast/src/ast/manager.ts +374 -0
- package/src/plugins/pi-agent-ide-ast/src/ast/outline.ts +813 -0
- package/src/plugins/pi-agent-ide-ast/src/ast/read-text.ts +30 -0
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +85 -0
- package/src/plugins/pi-agent-ide-ast/src/outline-resolver.ts +69 -0
- package/src/plugins/pi-agent-ide-ast/src/scope-handler.ts +221 -0
- package/src/plugins/pi-agent-ide-ast/src/scope-resolver.ts +45 -0
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +141 -0
- package/src/plugins/pi-agent-ide-changes/index.ts +68 -0
- package/src/plugins/pi-agent-ide-changes/package.json +29 -0
- package/src/plugins/pi-agent-ide-changes/src/change-anchor.ts +103 -0
- package/src/plugins/pi-agent-ide-changes/src/changes/change-groups.ts +309 -0
- package/src/plugins/pi-agent-ide-changes/src/changes/change-service.ts +223 -0
- package/src/plugins/pi-agent-ide-changes/src/changes/change-types.ts +105 -0
- package/src/plugins/pi-agent-ide-changes/src/changes/git-changes-backend.ts +325 -0
- package/src/plugins/pi-agent-ide-changes/src/current-change-presenter.ts +232 -0
- package/src/plugins/pi-agent-ide-changes/src/index-mutation-queue.ts +11 -0
- package/src/plugins/pi-agent-ide-changes/src/last-text-transaction-store.ts +88 -0
- package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +116 -0
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +153 -0
- package/src/plugins/pi-agent-ide-formatter/index.ts +33 -0
- package/src/plugins/pi-agent-ide-formatter/package.json +14 -0
- package/src/plugins/pi-agent-ide-formatter/src/formatter.ts +50 -0
- package/src/plugins/pi-agent-ide-formatter/src/registry.ts +30 -0
- package/src/plugins/pi-agent-ide-formatter/src/types.ts +10 -0
- package/src/plugins/pi-agent-ide-lint/index.ts +237 -0
- package/src/plugins/pi-agent-ide-lint/package.json +19 -0
- package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +160 -0
- package/src/plugins/pi-agent-ide-lint/src/command-runner.ts +51 -0
- package/src/plugins/pi-agent-ide-lint/src/registry.ts +30 -0
- package/src/plugins/pi-agent-ide-lint/src/types.ts +10 -0
- package/src/plugins/pi-agent-ide-lsp/index.ts +250 -0
- package/src/plugins/pi-agent-ide-lsp/package.json +23 -0
- package/src/plugins/pi-agent-ide-lsp/src/code-view-resolvers.ts +139 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +463 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/code-views.ts +577 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/diagnostics.ts +179 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/index.ts +59 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/language-map.ts +57 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/lsp-compiler.ts +85 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +485 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/navigation.ts +85 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/registry.ts +97 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/rename.ts +50 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +149 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbols.ts +151 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/types.ts +95 -0
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +42 -0
- package/src/post-edit/gate.ts +153 -0
- package/src/toolchain/diagnostic.ts +7 -0
- package/src/toolchain/gate.ts +322 -0
- package/src/toolchain/registry.ts +223 -0
- package/src/toolchain/types.ts +164 -0
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path"; /**/
|
|
3
|
+
|
|
4
|
+
import type {
|
|
5
|
+
ActiveToolchain,
|
|
6
|
+
CompileResult,
|
|
7
|
+
Diagnostic,
|
|
8
|
+
FileGateResult,
|
|
9
|
+
FormatResult,
|
|
10
|
+
GatePhaseCallback,
|
|
11
|
+
GatePhaseEntry,
|
|
12
|
+
GateResult,
|
|
13
|
+
LintResult,
|
|
14
|
+
} from "./types.js";
|
|
15
|
+
|
|
16
|
+
function extensionOf(filePath: string): string
|
|
17
|
+
{
|
|
18
|
+
return path.extname(filePath).toLowerCase();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function matches(tool: { extensions: readonly string[]; }, ext: string): boolean
|
|
22
|
+
{
|
|
23
|
+
return tool.extensions.includes(ext) || tool.extensions.includes("*");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const skipCompile: CompileResult = {
|
|
27
|
+
ok: true,
|
|
28
|
+
diagnostics: [],
|
|
29
|
+
syntaxErrors: [],
|
|
30
|
+
otherDiagnostics: [],
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const skipFormat: FormatResult = { ok: true, edits: 0 };
|
|
34
|
+
|
|
35
|
+
const skipLint: LintResult = { ok: true, diagnostics: [] };
|
|
36
|
+
|
|
37
|
+
export class Gate
|
|
38
|
+
{
|
|
39
|
+
constructor(private readonly toolchain: ActiveToolchain)
|
|
40
|
+
{}
|
|
41
|
+
|
|
42
|
+
async runDiagnostics(filePaths: string[]): Promise<Map<string, Diagnostic[]>>
|
|
43
|
+
{
|
|
44
|
+
const result = new Map<string, Diagnostic[]>();
|
|
45
|
+
const ctx = this.toolchain.ctx;
|
|
46
|
+
|
|
47
|
+
for (const filePath of filePaths)
|
|
48
|
+
{
|
|
49
|
+
const ext = extensionOf(filePath);
|
|
50
|
+
const compile = await this.runCompile(filePath, ext, ctx);
|
|
51
|
+
|
|
52
|
+
if (compile.syntaxErrors.length > 0)
|
|
53
|
+
{
|
|
54
|
+
result.set(filePath, compile.syntaxErrors);
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (compile.otherDiagnostics.length > 0)
|
|
59
|
+
{
|
|
60
|
+
result.set(filePath, compile.otherDiagnostics);
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const lint = await this.runLint(filePath, ext, ctx, false);
|
|
65
|
+
result.set(filePath, lint.diagnostics);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async runAll(filePaths: string[], options?: { onPhase?: GatePhaseCallback; }): Promise<GateResult>
|
|
72
|
+
{
|
|
73
|
+
const ctx = this.toolchain.ctx;
|
|
74
|
+
const onPhase = options?.onPhase;
|
|
75
|
+
|
|
76
|
+
// ── Read pre-gate content for all files ──
|
|
77
|
+
const sourceContents: Record<string, string> = {};
|
|
78
|
+
|
|
79
|
+
for (const fp of filePaths)
|
|
80
|
+
{
|
|
81
|
+
try
|
|
82
|
+
{
|
|
83
|
+
sourceContents[fp] = await readFile(fp, "utf8");
|
|
84
|
+
}
|
|
85
|
+
catch
|
|
86
|
+
{
|
|
87
|
+
sourceContents[fp] = "";
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// ── Phase setup: detect tools from ALL edited extensions ──
|
|
92
|
+
const exts = new Set(filePaths.map((fp) => extensionOf(fp)));
|
|
93
|
+
const compiler = exts.size > 0
|
|
94
|
+
? this.toolchain.compilers.find((c) => [...exts].some((e) => matches(c, e)))
|
|
95
|
+
: undefined;
|
|
96
|
+
const linter = exts.size > 0
|
|
97
|
+
? this.toolchain.linters.find((l) => [...exts].some((e) => matches(l, e)))
|
|
98
|
+
: undefined;
|
|
99
|
+
const formatter = exts.size > 0
|
|
100
|
+
? this.toolchain.formatters.find((f) => [...exts].some((e) => matches(f, e)))
|
|
101
|
+
: undefined;
|
|
102
|
+
|
|
103
|
+
const phaseDefs: { phase: string; toolName: string; }[] = [];
|
|
104
|
+
|
|
105
|
+
if (compiler)
|
|
106
|
+
{
|
|
107
|
+
phaseDefs.push({ phase: "compile", toolName: compiler.name });
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (linter)
|
|
111
|
+
{
|
|
112
|
+
phaseDefs.push({ phase: "lint", toolName: linter.name });
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (formatter)
|
|
116
|
+
{
|
|
117
|
+
phaseDefs.push({ phase: "format", toolName: formatter.name });
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const phaseEntries: GatePhaseEntry[] = phaseDefs.map((p) => ({
|
|
121
|
+
phase: p.phase,
|
|
122
|
+
toolName: p.toolName,
|
|
123
|
+
status: "pending" as const,
|
|
124
|
+
}));
|
|
125
|
+
onPhase?.([...phaseEntries]);
|
|
126
|
+
|
|
127
|
+
function emit(): void
|
|
128
|
+
{
|
|
129
|
+
onPhase?.([...phaseEntries]);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Restart LSP compiler to clear stale project state after syntax errors
|
|
133
|
+
// (tsserver caches broken AST after a syntax error edit)
|
|
134
|
+
// await compiler?.restart?.();
|
|
135
|
+
// ── 1. Compile (per-file — LSP diagnostics per document) ──
|
|
136
|
+
const compilePhase = phaseEntries.find((p) => p.phase === "compile");
|
|
137
|
+
const compileResults = new Map<string, CompileResult>();
|
|
138
|
+
const tCompileStart = performance.now();
|
|
139
|
+
|
|
140
|
+
// Run compile for each file in the gate
|
|
141
|
+
for (const fp of filePaths)
|
|
142
|
+
{
|
|
143
|
+
if (compilePhase && compilePhase.status !== "running")
|
|
144
|
+
{
|
|
145
|
+
compilePhase.status = "running";
|
|
146
|
+
emit();
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const result = await this.runCompile(fp, extensionOf(fp), ctx);
|
|
150
|
+
compileResults.set(fp, result);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (compilePhase)
|
|
154
|
+
{
|
|
155
|
+
compilePhase.status = "done";
|
|
156
|
+
compilePhase.duration = Math.round(performance.now() - tCompileStart);
|
|
157
|
+
emit();
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// If any file has syntax errors, skip lint and format early
|
|
161
|
+
const anySyntaxErrors = [...compileResults.values()].some((r) => r.syntaxErrors.length > 0);
|
|
162
|
+
|
|
163
|
+
if (anySyntaxErrors)
|
|
164
|
+
{
|
|
165
|
+
const files: FileGateResult[] = filePaths.map((fp) => ({
|
|
166
|
+
filePath: fp,
|
|
167
|
+
finalContent: sourceContents[fp] ?? "",
|
|
168
|
+
sourceContent: sourceContents[fp] ?? "",
|
|
169
|
+
compile: compileResults.get(fp)
|
|
170
|
+
?? { ok: true, diagnostics: [], syntaxErrors: [], otherDiagnostics: [] },
|
|
171
|
+
format: { ok: true, edits: 0 },
|
|
172
|
+
lint: { ok: true, diagnostics: [] },
|
|
173
|
+
}));
|
|
174
|
+
|
|
175
|
+
return { stage: "compile", rollback: false, files };
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// ── 2. Lint (per-file — eslint_d per file) ──
|
|
179
|
+
const lintPhase = phaseEntries.find((p) => p.phase === "lint");
|
|
180
|
+
const lintResults = new Map<string, LintResult>();
|
|
181
|
+
const tLintStart = performance.now();
|
|
182
|
+
|
|
183
|
+
for (const fp of filePaths)
|
|
184
|
+
{
|
|
185
|
+
if (lintPhase && lintPhase.status !== "running")
|
|
186
|
+
{
|
|
187
|
+
lintPhase.status = "running";
|
|
188
|
+
emit();
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const compileResult = compileResults.get(fp);
|
|
192
|
+
const result = compileResult !== undefined
|
|
193
|
+
&& (compileResult.syntaxErrors.length > 0 || compileResult.otherDiagnostics.length > 0)
|
|
194
|
+
? skipLint
|
|
195
|
+
: await this.runLint(fp, extensionOf(fp), ctx);
|
|
196
|
+
lintResults.set(fp, result);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (lintPhase)
|
|
200
|
+
{
|
|
201
|
+
lintPhase.status = "done";
|
|
202
|
+
lintPhase.duration = Math.round(performance.now() - tLintStart);
|
|
203
|
+
emit();
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// ── 3. Format (per-file — dprint fmt per file) ──
|
|
207
|
+
const formatPhase = phaseEntries.find((p) => p.phase === "format");
|
|
208
|
+
const formatResults = new Map<string, FormatResult>();
|
|
209
|
+
const tFormatStart = performance.now();
|
|
210
|
+
|
|
211
|
+
for (const fp of filePaths)
|
|
212
|
+
{
|
|
213
|
+
if (formatPhase !== undefined && formatPhase.status !== "running")
|
|
214
|
+
{
|
|
215
|
+
formatPhase.status = "running";
|
|
216
|
+
emit();
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const result = await this.runFormat(fp, extensionOf(fp), ctx);
|
|
220
|
+
formatResults.set(fp, result);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (formatPhase)
|
|
224
|
+
{
|
|
225
|
+
formatPhase.status = "done";
|
|
226
|
+
formatPhase.duration = Math.round(performance.now() - tFormatStart);
|
|
227
|
+
emit();
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// ── 5. Read final content for ALL files ──
|
|
231
|
+
const finalContents: Record<string, string> = {};
|
|
232
|
+
|
|
233
|
+
for (const fp of filePaths)
|
|
234
|
+
{
|
|
235
|
+
try
|
|
236
|
+
{
|
|
237
|
+
finalContents[fp] = await readFile(fp, "utf8");
|
|
238
|
+
}
|
|
239
|
+
catch
|
|
240
|
+
{
|
|
241
|
+
finalContents[fp] = sourceContents[fp] ?? "";
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
const files: FileGateResult[] = filePaths.map((fp) => ({
|
|
246
|
+
filePath: fp,
|
|
247
|
+
finalContent: finalContents[fp] ?? "",
|
|
248
|
+
sourceContent: sourceContents[fp] ?? "",
|
|
249
|
+
compile: compileResults.get(fp) ?? { ok: true, diagnostics: [], syntaxErrors: [], otherDiagnostics: [] },
|
|
250
|
+
format: formatResults.get(fp) ?? { ok: true, edits: 0 },
|
|
251
|
+
lint: lintResults.get(fp) ?? { ok: true, diagnostics: [] },
|
|
252
|
+
}));
|
|
253
|
+
|
|
254
|
+
return { stage: "done", rollback: false, files: files };
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// ── compile ───────────────────────────────────────────────────
|
|
258
|
+
|
|
259
|
+
private async runCompile(filePath: string, ext: string, ctx: ActiveToolchain["ctx"]): Promise<CompileResult>
|
|
260
|
+
{
|
|
261
|
+
const compiler = this.toolchain.compilers.find((c) => matches(c, ext));
|
|
262
|
+
|
|
263
|
+
if (compiler === undefined)
|
|
264
|
+
{
|
|
265
|
+
return { ...skipCompile };
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
try
|
|
269
|
+
{
|
|
270
|
+
return await compiler.compile({ filePath }, ctx);
|
|
271
|
+
}
|
|
272
|
+
catch (error)
|
|
273
|
+
{
|
|
274
|
+
console.error(`[pi-agent-ide] compile failed for "${compiler.name}":`, error);
|
|
275
|
+
return { ...skipCompile };
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// ── format ─────────────────────────────────────────────────────
|
|
280
|
+
|
|
281
|
+
private async runFormat(filePath: string, ext: string, ctx: ActiveToolchain["ctx"]): Promise<FormatResult>
|
|
282
|
+
{
|
|
283
|
+
const formatter = this.toolchain.formatters.find((f) => matches(f, ext));
|
|
284
|
+
|
|
285
|
+
if (formatter === undefined)
|
|
286
|
+
{
|
|
287
|
+
return { ...skipFormat };
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
try
|
|
291
|
+
{
|
|
292
|
+
return await formatter.format({ filePath }, ctx);
|
|
293
|
+
}
|
|
294
|
+
catch (error)
|
|
295
|
+
{
|
|
296
|
+
console.error(`[pi-agent-ide] format failed for "${formatter.name}":`, error);
|
|
297
|
+
return { ok: false, edits: 0 };
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// ── lint ──────────────────────────────────────────────────────
|
|
302
|
+
|
|
303
|
+
private async runLint(filePath: string, ext: string, ctx: ActiveToolchain["ctx"], fix = true): Promise<LintResult>
|
|
304
|
+
{
|
|
305
|
+
const linter = this.toolchain.linters.find((l) => matches(l, ext));
|
|
306
|
+
|
|
307
|
+
if (linter === undefined)
|
|
308
|
+
{
|
|
309
|
+
return { ...skipLint };
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
try
|
|
313
|
+
{
|
|
314
|
+
return await linter.lint({ filePath, fix }, ctx);
|
|
315
|
+
}
|
|
316
|
+
catch (error)
|
|
317
|
+
{
|
|
318
|
+
console.error(`[pi-agent-ide] lint failed for "${linter.name}":`, error);
|
|
319
|
+
return { ok: false, diagnostics: [] };
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import type { ActiveToolchain, Compiler, Formatter, IdeTool, Linter, ToolContext } from "./types.js";
|
|
2
|
+
|
|
3
|
+
const formatters: Formatter[] = [];
|
|
4
|
+
const compilers: Compiler[] = [];
|
|
5
|
+
const linters: Linter[] = [];
|
|
6
|
+
|
|
7
|
+
let activeToolchain: ActiveToolchain | undefined;
|
|
8
|
+
|
|
9
|
+
// ── Registration ──────────────────────────────────────────────────
|
|
10
|
+
|
|
11
|
+
function assertUniqueName(kind: string, list: readonly { name: string; }[], name: string): void
|
|
12
|
+
{
|
|
13
|
+
if (list.some((tool) => tool.name === name))
|
|
14
|
+
{
|
|
15
|
+
throw new Error(
|
|
16
|
+
`[pi-agent-ide] ${kind} "${name}" is already registered. Use a unique name.`,
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function registerTools(tools: readonly IdeTool[]): void
|
|
22
|
+
{
|
|
23
|
+
const draftNames = new Set<string>();
|
|
24
|
+
|
|
25
|
+
for (const tool of tools)
|
|
26
|
+
{
|
|
27
|
+
const key = `${tool.kind}:${tool.name}`;
|
|
28
|
+
|
|
29
|
+
if (draftNames.has(key))
|
|
30
|
+
{
|
|
31
|
+
throw new Error(`[pi-agent-ide] ${tool.kind} "${tool.name}" is registered twice by one plugin.`);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
draftNames.add(key);
|
|
35
|
+
|
|
36
|
+
switch (tool.kind)
|
|
37
|
+
{
|
|
38
|
+
case "compiler":
|
|
39
|
+
{
|
|
40
|
+
assertUniqueName(tool.kind, compilers, tool.name);
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
case "formatter":
|
|
44
|
+
{
|
|
45
|
+
assertUniqueName(tool.kind, formatters, tool.name);
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
case "linter":
|
|
49
|
+
{
|
|
50
|
+
assertUniqueName(tool.kind, linters, tool.name);
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
for (const tool of tools)
|
|
57
|
+
{
|
|
58
|
+
switch (tool.kind)
|
|
59
|
+
{
|
|
60
|
+
case "compiler":
|
|
61
|
+
{
|
|
62
|
+
compilers.push(tool);
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
case "formatter":
|
|
66
|
+
{
|
|
67
|
+
formatters.push(tool);
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
case "linter":
|
|
71
|
+
{
|
|
72
|
+
linters.push(tool);
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function registerFormatter(formatter: Formatter): void
|
|
80
|
+
{
|
|
81
|
+
registerTools([formatter]);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function registerCompiler(compiler: Compiler): void
|
|
85
|
+
{
|
|
86
|
+
registerTools([compiler]);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function registerLinter(linter: Linter): void
|
|
90
|
+
{
|
|
91
|
+
registerTools([linter]);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// ── Introspection ──────────────────────────────────────────────────
|
|
95
|
+
|
|
96
|
+
export interface RegisteredToolInfo
|
|
97
|
+
{
|
|
98
|
+
name: string;
|
|
99
|
+
priority: number;
|
|
100
|
+
extensions: readonly string[];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface RegisteredSnapshot
|
|
104
|
+
{
|
|
105
|
+
formatters: RegisteredToolInfo[];
|
|
106
|
+
compilers: RegisteredToolInfo[];
|
|
107
|
+
linters: RegisteredToolInfo[];
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function listRegistered(): RegisteredSnapshot
|
|
111
|
+
{
|
|
112
|
+
const toInfo = (t: { name: string; priority: number; extensions: readonly string[]; }): RegisteredToolInfo => ({
|
|
113
|
+
name: t.name,
|
|
114
|
+
priority: t.priority,
|
|
115
|
+
extensions: t.extensions,
|
|
116
|
+
});
|
|
117
|
+
return {
|
|
118
|
+
formatters: formatters.map((t) => toInfo(t)),
|
|
119
|
+
compilers: compilers.map((t) => toInfo(t)),
|
|
120
|
+
linters: linters.map((t) => toInfo(t)),
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// ── Warmup ────────────────────────────────────────────────────────
|
|
125
|
+
|
|
126
|
+
interface DetectableTool
|
|
127
|
+
{
|
|
128
|
+
name: string;
|
|
129
|
+
priority: number;
|
|
130
|
+
extensions: readonly string[];
|
|
131
|
+
detect(ctx: ToolContext): Promise<boolean>;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
async function filterActive<T extends DetectableTool>(tools: readonly T[], ctx: ToolContext): Promise<T[]>
|
|
135
|
+
{
|
|
136
|
+
const active: T[] = [];
|
|
137
|
+
|
|
138
|
+
for (const tool of tools)
|
|
139
|
+
{
|
|
140
|
+
try
|
|
141
|
+
{
|
|
142
|
+
if (await tool.detect(ctx))
|
|
143
|
+
{
|
|
144
|
+
active.push(tool);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
catch (error)
|
|
148
|
+
{
|
|
149
|
+
console.error(`[pi-agent-ide] detect failed for "${tool.name}":`, error);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
active.sort((a, b) => b.priority - a.priority);
|
|
154
|
+
assertNoPriorityConflicts(active);
|
|
155
|
+
return active;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Two active tools of the same kind with the same priority claiming the same
|
|
160
|
+
* extension is ambiguous — reject it loudly instead of picking one silently.
|
|
161
|
+
* "*" is treated as a distinct extension slot that can only be held by one tool
|
|
162
|
+
* per priority (typically the skip/fallback).
|
|
163
|
+
*/
|
|
164
|
+
function assertNoPriorityConflicts(active: readonly DetectableTool[]): void
|
|
165
|
+
{
|
|
166
|
+
const seen = new Map<string, string>();
|
|
167
|
+
|
|
168
|
+
for (const tool of active)
|
|
169
|
+
{
|
|
170
|
+
for (const ext of tool.extensions)
|
|
171
|
+
{
|
|
172
|
+
const key = `${ext}@${tool.priority}`;
|
|
173
|
+
const prev = seen.get(key);
|
|
174
|
+
|
|
175
|
+
if (prev !== undefined)
|
|
176
|
+
{
|
|
177
|
+
throw new Error(
|
|
178
|
+
`[pi-agent-ide] priority conflict: tools "${prev}" and "${tool.name}" both claim "${ext}" at priority ${tool.priority}.`,
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
seen.set(key, tool.name);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export async function warmup(ctx: ToolContext): Promise<ActiveToolchain>
|
|
188
|
+
{
|
|
189
|
+
const [fmts, comps, lnts] = await Promise.all([
|
|
190
|
+
filterActive(formatters, ctx),
|
|
191
|
+
filterActive(compilers, ctx),
|
|
192
|
+
filterActive(linters, ctx),
|
|
193
|
+
]);
|
|
194
|
+
|
|
195
|
+
activeToolchain = { ctx, formatters: fmts, compilers: comps, linters: lnts };
|
|
196
|
+
return activeToolchain;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export function getActiveToolchain(): ActiveToolchain
|
|
200
|
+
{
|
|
201
|
+
if (activeToolchain === undefined)
|
|
202
|
+
{
|
|
203
|
+
// Graceful default: no tools active → everything resolves to skip-like.
|
|
204
|
+
return { ctx: { cwd: process.cwd() }, formatters: [], compilers: [], linters: [] };
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return activeToolchain;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export function isToolchainReady(): boolean
|
|
211
|
+
{
|
|
212
|
+
return activeToolchain !== undefined;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// ── Runtime lifecycle ─────────────────────────────────────────────
|
|
216
|
+
|
|
217
|
+
export function resetRegistry(): void
|
|
218
|
+
{
|
|
219
|
+
formatters.length = 0;
|
|
220
|
+
compilers.length = 0;
|
|
221
|
+
linters.length = 0;
|
|
222
|
+
activeToolchain = undefined;
|
|
223
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pi-agent-ide — compile / format / lint pipeline gate.
|
|
3
|
+
*
|
|
4
|
+
* Three independent tool kinds, each with a registry of self-describing
|
|
5
|
+
* implementations. The gate composes them: compile → format → lint.
|
|
6
|
+
*
|
|
7
|
+
* Diagnostic coordinates are 1-based (line/column), matching the
|
|
8
|
+
* VS Code language bridge convention used across lpt.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export type Severity = "error" | "warning" | "info" | "hint";
|
|
12
|
+
|
|
13
|
+
export interface Diagnostic
|
|
14
|
+
{
|
|
15
|
+
code: string;
|
|
16
|
+
message: string;
|
|
17
|
+
/** 1-based line. */
|
|
18
|
+
line: number;
|
|
19
|
+
/** 1-based column. */
|
|
20
|
+
column: number;
|
|
21
|
+
severity: Severity;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface ToolContext
|
|
25
|
+
{
|
|
26
|
+
cwd: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// ── Formatter ───────────────────────────────────────────────────────
|
|
30
|
+
|
|
31
|
+
export interface FormatInput
|
|
32
|
+
{
|
|
33
|
+
filePath: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface FormatResult
|
|
37
|
+
{
|
|
38
|
+
ok: boolean;
|
|
39
|
+
/** Number of edits applied. 0 = no change. */
|
|
40
|
+
edits: number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface Formatter
|
|
44
|
+
{
|
|
45
|
+
readonly kind: "formatter";
|
|
46
|
+
readonly name: string;
|
|
47
|
+
readonly priority: number;
|
|
48
|
+
/** File extensions this tool handles (lowercased with leading dot, or "*"). */
|
|
49
|
+
readonly extensions: readonly string[];
|
|
50
|
+
/** Returns true if this tool applies to the project (warmup detection). */
|
|
51
|
+
detect(ctx: ToolContext): Promise<boolean>;
|
|
52
|
+
format(input: FormatInput, ctx: ToolContext): Promise<FormatResult>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// ── Compiler ────────────────────────────────────────────────────────
|
|
56
|
+
|
|
57
|
+
export interface CompileInput
|
|
58
|
+
{
|
|
59
|
+
filePath: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface CompileResult
|
|
63
|
+
{
|
|
64
|
+
ok: boolean;
|
|
65
|
+
/** All diagnostics from the compiler. */
|
|
66
|
+
diagnostics: Diagnostic[];
|
|
67
|
+
/** Syntax errors (e.g. TS1001-1999) — these trigger rollback in the gate. */
|
|
68
|
+
syntaxErrors: Diagnostic[];
|
|
69
|
+
/** Non-syntax diagnostics — warnings only, never rollback. */
|
|
70
|
+
otherDiagnostics: Diagnostic[];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface Compiler
|
|
74
|
+
{
|
|
75
|
+
readonly kind: "compiler";
|
|
76
|
+
readonly name: string;
|
|
77
|
+
readonly priority: number;
|
|
78
|
+
readonly extensions: readonly string[];
|
|
79
|
+
detect(ctx: ToolContext): Promise<boolean>;
|
|
80
|
+
compile(input: CompileInput, ctx: ToolContext): Promise<CompileResult>;
|
|
81
|
+
restart?(): Promise<void>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// ── Linter ───────────────────────────────────────────────────────────
|
|
85
|
+
|
|
86
|
+
export interface LintInput
|
|
87
|
+
{
|
|
88
|
+
filePath: string;
|
|
89
|
+
/** Request the existing auto-fix command when running the edit gate. */
|
|
90
|
+
fix?: boolean;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface LintResult
|
|
94
|
+
{
|
|
95
|
+
ok: boolean;
|
|
96
|
+
diagnostics: Diagnostic[];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface Linter
|
|
100
|
+
{
|
|
101
|
+
readonly kind: "linter";
|
|
102
|
+
readonly name: string;
|
|
103
|
+
readonly priority: number;
|
|
104
|
+
readonly extensions: readonly string[];
|
|
105
|
+
detect(ctx: ToolContext): Promise<boolean>;
|
|
106
|
+
lint(input: LintInput, ctx: ToolContext): Promise<LintResult>;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export type IdeTool = Compiler | Formatter | Linter;
|
|
110
|
+
|
|
111
|
+
// ── Toolchain & gate result ──────────────────────────────────────────
|
|
112
|
+
|
|
113
|
+
export interface ActiveToolchain
|
|
114
|
+
{
|
|
115
|
+
ctx: ToolContext;
|
|
116
|
+
formatters: readonly Formatter[];
|
|
117
|
+
compilers: readonly Compiler[];
|
|
118
|
+
linters: readonly Linter[];
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export type GateStage = "compile" | "format" | "lint" | "done";
|
|
122
|
+
|
|
123
|
+
/** Phase descriptor for gate progress callbacks. */
|
|
124
|
+
export interface GatePhaseEntry
|
|
125
|
+
{
|
|
126
|
+
/** Phase identifier: "compile" | "lint" | "format" */
|
|
127
|
+
phase: string;
|
|
128
|
+
/** Human-readable tool name, e.g. "TypeScript", "ESLint", "dprint" */
|
|
129
|
+
toolName: string;
|
|
130
|
+
/** Current phase status */
|
|
131
|
+
status: "pending" | "running" | "done";
|
|
132
|
+
/** Duration in ms (only set when status === "done") */
|
|
133
|
+
duration?: number;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Callback emitted by Gate.runAll for TUI progress updates.
|
|
138
|
+
* First call: all phases sent with status="pending" — UI allocates height immediately.
|
|
139
|
+
* Subsequent calls: individual phase status changes.
|
|
140
|
+
* Always sends the complete array so consumer can replace, not merge.
|
|
141
|
+
*/
|
|
142
|
+
export type GatePhaseCallback = (phases: GatePhaseEntry[]) => void;
|
|
143
|
+
|
|
144
|
+
/** Per-file gate result inside a multi-file gate run. */
|
|
145
|
+
export interface FileGateResult
|
|
146
|
+
{
|
|
147
|
+
filePath: string;
|
|
148
|
+
finalContent: string;
|
|
149
|
+
sourceContent: string;
|
|
150
|
+
compile: CompileResult;
|
|
151
|
+
format: FormatResult;
|
|
152
|
+
lint: LintResult;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/** Gate result for multiple files (always array, even for single file). */
|
|
156
|
+
export interface GateResult
|
|
157
|
+
{
|
|
158
|
+
/** Stage where the gate stopped. "done" = full pipeline ran. */
|
|
159
|
+
stage: GateStage;
|
|
160
|
+
/** True when a compile syntax error means the edit should roll back. */
|
|
161
|
+
rollback: boolean;
|
|
162
|
+
/** Per-file results. Always populated, never empty. */
|
|
163
|
+
files: FileGateResult[];
|
|
164
|
+
}
|