agent-ide 0.2.0 → 0.4.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/README.md +29 -355
- package/dist/application/events/event-bus.d.ts.map +1 -1
- package/dist/application/events/event-bus.js.map +1 -1
- package/dist/application/index.d.ts +3 -1
- package/dist/application/index.d.ts.map +1 -1
- package/dist/application/index.js +10 -5
- package/dist/application/index.js.map +1 -1
- package/dist/application/services/cache-coordinator.service.d.ts.map +1 -1
- package/dist/application/services/cache-coordinator.service.js.map +1 -1
- package/dist/application/services/error-handler.service.d.ts.map +1 -1
- package/dist/application/services/error-handler.service.js.map +1 -1
- package/dist/application/services/module-coordinator.service.d.ts +5 -14
- package/dist/application/services/module-coordinator.service.d.ts.map +1 -1
- package/dist/application/services/module-coordinator.service.js +15 -108
- package/dist/application/services/module-coordinator.service.js.map +1 -1
- package/dist/application/services/session-manager.service.d.ts.map +1 -1
- package/dist/application/services/session-manager.service.js.map +1 -1
- package/dist/application/services/workflow-engine.service.d.ts +1 -1
- package/dist/application/services/workflow-engine.service.d.ts.map +1 -1
- package/dist/application/services/workflow-engine.service.js.map +1 -1
- package/dist/application/state/state-manager.d.ts +3 -3
- package/dist/application/state/state-manager.d.ts.map +1 -1
- package/dist/application/state/state-manager.js +3 -3
- package/dist/application/state/state-manager.js.map +1 -1
- package/dist/application/types.d.ts.map +1 -1
- package/dist/application/workflows/analysis-workflow.d.ts +1 -1
- package/dist/application/workflows/analysis-workflow.d.ts.map +1 -1
- package/dist/application/workflows/analysis-workflow.js +1 -1
- package/dist/application/workflows/analysis-workflow.js.map +1 -1
- package/dist/application/workflows/base-workflow.d.ts.map +1 -1
- package/dist/application/workflows/base-workflow.js.map +1 -1
- package/dist/application/workflows/index.d.ts +2 -2
- package/dist/application/workflows/index.d.ts.map +1 -1
- package/dist/application/workflows/index.js +2 -2
- package/dist/application/workflows/index.js.map +1 -1
- package/dist/application/workflows/refactor-workflow.d.ts +1 -1
- package/dist/application/workflows/refactor-workflow.d.ts.map +1 -1
- package/dist/application/workflows/refactor-workflow.js +1 -1
- package/dist/application/workflows/refactor-workflow.js.map +1 -1
- package/dist/core/change-signature/change-signature-service.d.ts +94 -0
- package/dist/core/change-signature/change-signature-service.d.ts.map +1 -0
- package/dist/core/change-signature/change-signature-service.js +544 -0
- package/dist/core/change-signature/change-signature-service.js.map +1 -0
- package/dist/core/change-signature/index.d.ts +10 -0
- package/dist/core/change-signature/index.d.ts.map +1 -0
- package/dist/core/change-signature/index.js +12 -0
- package/dist/core/change-signature/index.js.map +1 -0
- package/dist/core/change-signature/signature-parser.d.ts +76 -0
- package/dist/core/change-signature/signature-parser.d.ts.map +1 -0
- package/dist/core/change-signature/signature-parser.js +387 -0
- package/dist/core/change-signature/signature-parser.js.map +1 -0
- package/dist/core/change-signature/types.d.ts +244 -0
- package/dist/core/change-signature/types.d.ts.map +1 -0
- package/dist/core/change-signature/types.js +73 -0
- package/dist/core/change-signature/types.js.map +1 -0
- package/dist/core/dependency/cycle-detector.d.ts +1 -1
- package/dist/core/dependency/cycle-detector.d.ts.map +1 -1
- package/dist/core/dependency/cycle-detector.js +1 -1
- package/dist/core/dependency/cycle-detector.js.map +1 -1
- package/dist/core/dependency/dependency-analyzer.d.ts +3 -1
- package/dist/core/dependency/dependency-analyzer.d.ts.map +1 -1
- package/dist/core/dependency/dependency-analyzer.js +25 -24
- package/dist/core/dependency/dependency-analyzer.js.map +1 -1
- package/dist/core/dependency/types.d.ts.map +1 -1
- package/dist/core/indexing/file-index.d.ts.map +1 -1
- package/dist/core/indexing/file-index.js +1 -1
- package/dist/core/indexing/file-index.js.map +1 -1
- package/dist/core/indexing/index-engine.d.ts +3 -1
- package/dist/core/indexing/index-engine.d.ts.map +1 -1
- package/dist/core/indexing/index-engine.js +25 -17
- package/dist/core/indexing/index-engine.js.map +1 -1
- package/dist/core/indexing/index.d.ts +1 -9
- package/dist/core/indexing/index.d.ts.map +1 -1
- package/dist/core/indexing/index.js +2 -12
- package/dist/core/indexing/index.js.map +1 -1
- package/dist/core/indexing/symbol-index.d.ts.map +1 -1
- package/dist/core/indexing/types.d.ts +12 -0
- package/dist/core/indexing/types.d.ts.map +1 -1
- package/dist/core/indexing/types.js +12 -0
- package/dist/core/indexing/types.js.map +1 -1
- package/dist/core/move-file/import-resolver.d.ts.map +1 -0
- package/dist/core/{move → move-file}/import-resolver.js +9 -10
- package/dist/core/move-file/import-resolver.js.map +1 -0
- package/dist/core/{move → move-file}/index.d.ts +2 -2
- package/dist/core/move-file/index.d.ts.map +1 -0
- package/dist/core/{move → move-file}/index.js +2 -2
- package/dist/core/move-file/index.js.map +1 -0
- package/dist/core/{move → move-file}/move-service.d.ts +3 -1
- package/dist/core/move-file/move-service.d.ts.map +1 -0
- package/dist/core/{move → move-file}/move-service.js +66 -84
- package/dist/core/move-file/move-service.js.map +1 -0
- package/dist/core/move-file/types.d.ts.map +1 -0
- package/dist/core/move-file/types.js.map +1 -0
- package/dist/core/move-member/index.d.ts +10 -0
- package/dist/core/move-member/index.d.ts.map +1 -0
- package/dist/core/move-member/index.js +12 -0
- package/dist/core/move-member/index.js.map +1 -0
- package/dist/core/move-member/member-extractor.d.ts +96 -0
- package/dist/core/move-member/member-extractor.d.ts.map +1 -0
- package/dist/core/move-member/member-extractor.js +439 -0
- package/dist/core/move-member/member-extractor.js.map +1 -0
- package/dist/core/move-member/move-member-service.d.ts +87 -0
- package/dist/core/move-member/move-member-service.d.ts.map +1 -0
- package/dist/core/move-member/move-member-service.js +412 -0
- package/dist/core/move-member/move-member-service.js.map +1 -0
- package/dist/core/move-member/types.d.ts +182 -0
- package/dist/core/move-member/types.d.ts.map +1 -0
- package/dist/core/move-member/types.js +75 -0
- package/dist/core/move-member/types.js.map +1 -0
- package/dist/core/rename/index.d.ts +3 -3
- package/dist/core/rename/index.d.ts.map +1 -1
- package/dist/core/rename/index.js +5 -3
- package/dist/core/rename/index.js.map +1 -1
- package/dist/core/rename/reference-updater.d.ts +3 -1
- package/dist/core/rename/reference-updater.d.ts.map +1 -1
- package/dist/core/rename/reference-updater.js +9 -6
- package/dist/core/rename/reference-updater.js.map +1 -1
- package/dist/core/rename/rename-engine.d.ts +3 -1
- package/dist/core/rename/rename-engine.d.ts.map +1 -1
- package/dist/core/rename/rename-engine.js +8 -5
- package/dist/core/rename/rename-engine.js.map +1 -1
- package/dist/core/rename/scope-analyzer.d.ts.map +1 -1
- package/dist/core/rename/scope-analyzer.js.map +1 -1
- package/dist/core/rename/types.d.ts.map +1 -1
- package/dist/core/shared/call-hierarchy-analyzer.d.ts +102 -0
- package/dist/core/shared/call-hierarchy-analyzer.d.ts.map +1 -0
- package/dist/core/shared/call-hierarchy-analyzer.js +328 -0
- package/dist/core/shared/call-hierarchy-analyzer.js.map +1 -0
- package/dist/core/shared/index.d.ts +7 -0
- package/dist/core/shared/index.d.ts.map +1 -0
- package/dist/core/shared/index.js +7 -0
- package/dist/core/shared/index.js.map +1 -0
- package/dist/core/shared/symbol-finder.d.ts +154 -0
- package/dist/core/shared/symbol-finder.d.ts.map +1 -0
- package/dist/core/shared/symbol-finder.js +433 -0
- package/dist/core/shared/symbol-finder.js.map +1 -0
- package/dist/core/snapshot/index.d.ts +3 -19
- package/dist/core/snapshot/index.d.ts.map +1 -1
- package/dist/core/snapshot/index.js +2 -23
- package/dist/core/snapshot/index.js.map +1 -1
- package/dist/core/snapshot/snapshot-generator.d.ts +66 -0
- package/dist/core/snapshot/snapshot-generator.d.ts.map +1 -0
- package/dist/core/snapshot/snapshot-generator.js +258 -0
- package/dist/core/snapshot/snapshot-generator.js.map +1 -0
- package/dist/core/snapshot/types.d.ts +41 -190
- package/dist/core/snapshot/types.d.ts.map +1 -1
- package/dist/core/snapshot/types.js +13 -67
- package/dist/core/snapshot/types.js.map +1 -1
- package/dist/infrastructure/cache/cache-manager.d.ts +1 -1
- package/dist/infrastructure/cache/cache-manager.d.ts.map +1 -1
- package/dist/infrastructure/cache/cache-manager.js +1 -1
- package/dist/infrastructure/cache/cache-manager.js.map +1 -1
- package/dist/infrastructure/cache/memory-cache.js +1 -1
- package/dist/infrastructure/cache/memory-cache.js.map +1 -1
- package/dist/infrastructure/cache/strategies.d.ts +1 -1
- package/dist/infrastructure/cache/strategies.d.ts.map +1 -1
- package/dist/infrastructure/cache/strategies.js +1 -1
- package/dist/infrastructure/cache/strategies.js.map +1 -1
- package/dist/infrastructure/formatters/diff-generator.d.ts +11 -0
- package/dist/infrastructure/formatters/diff-generator.d.ts.map +1 -0
- package/dist/infrastructure/formatters/diff-generator.js +227 -0
- package/dist/infrastructure/formatters/diff-generator.js.map +1 -0
- package/dist/infrastructure/formatters/index.d.ts +11 -0
- package/dist/infrastructure/formatters/index.d.ts.map +1 -0
- package/dist/infrastructure/formatters/index.js +13 -0
- package/dist/infrastructure/formatters/index.js.map +1 -0
- package/dist/infrastructure/formatters/preview-converter.d.ts +85 -0
- package/dist/infrastructure/formatters/preview-converter.d.ts.map +1 -0
- package/dist/infrastructure/formatters/preview-converter.js +209 -0
- package/dist/infrastructure/formatters/preview-converter.js.map +1 -0
- package/dist/infrastructure/formatters/preview-formatter.d.ts +61 -0
- package/dist/infrastructure/formatters/preview-formatter.d.ts.map +1 -0
- package/dist/infrastructure/formatters/preview-formatter.js +208 -0
- package/dist/infrastructure/formatters/preview-formatter.js.map +1 -0
- package/dist/infrastructure/formatters/query-formatter.d.ts +83 -0
- package/dist/infrastructure/formatters/query-formatter.d.ts.map +1 -0
- package/dist/infrastructure/formatters/query-formatter.js +349 -0
- package/dist/infrastructure/formatters/query-formatter.js.map +1 -0
- package/dist/infrastructure/formatters/query-types.d.ts +238 -0
- package/dist/infrastructure/formatters/query-types.d.ts.map +1 -0
- package/dist/infrastructure/formatters/query-types.js +29 -0
- package/dist/infrastructure/formatters/query-types.js.map +1 -0
- package/dist/infrastructure/formatters/types.d.ts +163 -0
- package/dist/infrastructure/formatters/types.d.ts.map +1 -0
- package/dist/infrastructure/formatters/types.js +27 -0
- package/dist/infrastructure/formatters/types.js.map +1 -0
- package/dist/infrastructure/parser/base.d.ts +1 -33
- package/dist/infrastructure/parser/base.d.ts.map +1 -1
- package/dist/infrastructure/parser/base.js +1 -65
- package/dist/infrastructure/parser/base.js.map +1 -1
- package/dist/infrastructure/parser/index.d.ts +0 -2
- package/dist/infrastructure/parser/index.d.ts.map +1 -1
- package/dist/infrastructure/parser/index.js +1 -2
- package/dist/infrastructure/parser/index.js.map +1 -1
- package/dist/infrastructure/parser/interface.d.ts +2 -59
- package/dist/infrastructure/parser/interface.d.ts.map +1 -1
- package/dist/infrastructure/parser/interface.js +1 -11
- package/dist/infrastructure/parser/interface.js.map +1 -1
- package/dist/infrastructure/parser/registry.d.ts +1 -1
- package/dist/infrastructure/parser/registry.d.ts.map +1 -1
- package/dist/infrastructure/parser/registry.js +1 -1
- package/dist/infrastructure/parser/registry.js.map +1 -1
- package/dist/infrastructure/parser/types.d.ts.map +1 -1
- package/dist/infrastructure/storage/file-system.d.ts +2 -1
- package/dist/infrastructure/storage/file-system.d.ts.map +1 -1
- package/dist/infrastructure/storage/file-system.interface.d.ts +69 -0
- package/dist/infrastructure/storage/file-system.interface.d.ts.map +1 -0
- package/dist/infrastructure/storage/file-system.interface.js +6 -0
- package/dist/infrastructure/storage/file-system.interface.js.map +1 -0
- package/dist/infrastructure/storage/file-system.js.map +1 -1
- package/dist/infrastructure/storage/index.d.ts +2 -4
- package/dist/infrastructure/storage/index.d.ts.map +1 -1
- package/dist/infrastructure/storage/index.js +1 -8
- package/dist/infrastructure/storage/index.js.map +1 -1
- package/dist/infrastructure/storage/mem-file-system.d.ts +44 -0
- package/dist/infrastructure/storage/mem-file-system.d.ts.map +1 -0
- package/dist/infrastructure/storage/mem-file-system.js +105 -0
- package/dist/infrastructure/storage/mem-file-system.js.map +1 -0
- package/dist/interfaces/cli/cli.d.ts +13 -94
- package/dist/interfaces/cli/cli.d.ts.map +1 -1
- package/dist/interfaces/cli/cli.js +47 -2450
- package/dist/interfaces/cli/cli.js.map +1 -1
- package/dist/interfaces/cli/commands/call-hierarchy.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/call-hierarchy.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/call-hierarchy.command.js +161 -0
- package/dist/interfaces/cli/commands/call-hierarchy.command.js.map +1 -0
- package/dist/interfaces/cli/commands/change-signature.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/change-signature.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/change-signature.command.js +290 -0
- package/dist/interfaces/cli/commands/change-signature.command.js.map +1 -0
- package/dist/interfaces/cli/commands/cycles.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/cycles.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/cycles.command.js +87 -0
- package/dist/interfaces/cli/commands/cycles.command.js.map +1 -0
- package/dist/interfaces/cli/commands/find-references.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/find-references.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/find-references.command.js +122 -0
- package/dist/interfaces/cli/commands/find-references.command.js.map +1 -0
- package/dist/interfaces/cli/commands/impact.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/impact.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/impact.command.js +98 -0
- package/dist/interfaces/cli/commands/impact.command.js.map +1 -0
- package/dist/interfaces/cli/commands/index.d.ts +14 -0
- package/dist/interfaces/cli/commands/index.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/index.js +15 -0
- package/dist/interfaces/cli/commands/index.js.map +1 -0
- package/dist/interfaces/cli/commands/move-member.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/move-member.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/move-member.command.js +185 -0
- package/dist/interfaces/cli/commands/move-member.command.js.map +1 -0
- package/dist/interfaces/cli/commands/move.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/move.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/move.command.js +212 -0
- package/dist/interfaces/cli/commands/move.command.js.map +1 -0
- package/dist/interfaces/cli/commands/rename.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/rename.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/rename.command.js +258 -0
- package/dist/interfaces/cli/commands/rename.command.js.map +1 -0
- package/dist/interfaces/cli/commands/snapshot.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/snapshot.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/snapshot.command.js +68 -0
- package/dist/interfaces/cli/commands/snapshot.command.js.map +1 -0
- package/dist/interfaces/cli/commands/types.d.ts +18 -0
- package/dist/interfaces/cli/commands/types.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/types.js +5 -0
- package/dist/interfaces/cli/commands/types.js.map +1 -0
- package/dist/interfaces/cli/index.d.ts +1 -1
- package/dist/interfaces/cli/index.d.ts.map +1 -1
- package/dist/interfaces/cli/index.js +1 -1
- package/dist/interfaces/cli/index.js.map +1 -1
- package/dist/interfaces/cli/preview-output-handler.d.ts +53 -0
- package/dist/interfaces/cli/preview-output-handler.d.ts.map +1 -0
- package/dist/interfaces/cli/preview-output-handler.js +73 -0
- package/dist/interfaces/cli/preview-output-handler.js.map +1 -0
- package/dist/interfaces/cli/unified-output-handler.d.ts +79 -0
- package/dist/interfaces/cli/unified-output-handler.d.ts.map +1 -0
- package/dist/interfaces/cli/unified-output-handler.js +149 -0
- package/dist/interfaces/cli/unified-output-handler.js.map +1 -0
- package/dist/plugins/javascript/index.d.ts +2 -2
- package/dist/plugins/javascript/index.d.ts.map +1 -1
- package/dist/plugins/javascript/index.js +1 -1
- package/dist/plugins/javascript/index.js.map +1 -1
- package/dist/plugins/javascript/types.d.ts.map +1 -1
- package/dist/plugins/javascript/types.js.map +1 -1
- package/dist/plugins/python/dependency-analyzer.d.ts +86 -0
- package/dist/plugins/python/dependency-analyzer.d.ts.map +1 -0
- package/dist/plugins/python/dependency-analyzer.js +252 -0
- package/dist/plugins/python/dependency-analyzer.js.map +1 -0
- package/dist/plugins/python/index.d.ts +9 -0
- package/dist/plugins/python/index.d.ts.map +1 -0
- package/dist/plugins/python/index.js +14 -0
- package/dist/plugins/python/index.js.map +1 -0
- package/dist/plugins/python/parser.d.ts +117 -0
- package/dist/plugins/python/parser.d.ts.map +1 -0
- package/dist/plugins/python/parser.js +414 -0
- package/dist/plugins/python/parser.js.map +1 -0
- package/dist/plugins/python/symbol-extractor.d.ts +108 -0
- package/dist/plugins/python/symbol-extractor.d.ts.map +1 -0
- package/dist/plugins/python/symbol-extractor.js +389 -0
- package/dist/plugins/python/symbol-extractor.js.map +1 -0
- package/dist/plugins/python/tree-sitter-bridge.d.ts +57 -0
- package/dist/plugins/python/tree-sitter-bridge.d.ts.map +1 -0
- package/dist/plugins/python/tree-sitter-bridge.js +267 -0
- package/dist/plugins/python/tree-sitter-bridge.js.map +1 -0
- package/dist/plugins/python/types.d.ts +179 -0
- package/dist/plugins/python/types.d.ts.map +1 -0
- package/dist/plugins/python/types.js +252 -0
- package/dist/plugins/python/types.js.map +1 -0
- package/dist/plugins/swift/dependency-analyzer.d.ts +1 -1
- package/dist/plugins/swift/dependency-analyzer.d.ts.map +1 -1
- package/dist/plugins/swift/dependency-analyzer.js +1 -1
- package/dist/plugins/swift/dependency-analyzer.js.map +1 -1
- package/dist/plugins/swift/parser.d.ts +4 -0
- package/dist/plugins/swift/parser.d.ts.map +1 -1
- package/dist/plugins/swift/parser.js +24 -6
- package/dist/plugins/swift/parser.js.map +1 -1
- package/dist/plugins/swift/symbol-extractor.d.ts +1 -1
- package/dist/plugins/swift/symbol-extractor.d.ts.map +1 -1
- package/dist/plugins/swift/symbol-extractor.js.map +1 -1
- package/dist/plugins/swift/types.d.ts.map +1 -1
- package/dist/plugins/swift/types.js.map +1 -1
- package/dist/plugins/typescript/parser.d.ts +4 -37
- package/dist/plugins/typescript/parser.d.ts.map +1 -1
- package/dist/plugins/typescript/parser.js +29 -331
- package/dist/plugins/typescript/parser.js.map +1 -1
- package/dist/plugins/typescript/symbol-extractor.d.ts.map +1 -1
- package/dist/plugins/typescript/symbol-extractor.js +12 -0
- package/dist/plugins/typescript/symbol-extractor.js.map +1 -1
- package/dist/plugins/typescript/types.d.ts.map +1 -1
- package/dist/plugins/typescript/types.js +10 -0
- package/dist/plugins/typescript/types.js.map +1 -1
- package/dist/shared/errors/config-error.d.ts +1 -1
- package/dist/shared/errors/config-error.d.ts.map +1 -1
- package/dist/shared/errors/config-error.js +1 -1
- package/dist/shared/errors/config-error.js.map +1 -1
- package/dist/shared/errors/file-error.d.ts +1 -1
- package/dist/shared/errors/file-error.d.ts.map +1 -1
- package/dist/shared/errors/file-error.js +1 -1
- package/dist/shared/errors/file-error.js.map +1 -1
- package/dist/shared/errors/index.d.ts +1 -1
- package/dist/shared/errors/index.d.ts.map +1 -1
- package/dist/shared/errors/index.js +4 -4
- package/dist/shared/errors/index.js.map +1 -1
- package/dist/shared/errors/parser-error.d.ts +1 -1
- package/dist/shared/errors/parser-error.d.ts.map +1 -1
- package/dist/shared/errors/parser-error.js +1 -1
- package/dist/shared/errors/parser-error.js.map +1 -1
- package/dist/shared/errors/validation-error.d.ts +1 -1
- package/dist/shared/errors/validation-error.d.ts.map +1 -1
- package/dist/shared/errors/validation-error.js +1 -1
- package/dist/shared/errors/validation-error.js.map +1 -1
- package/dist/shared/types/ast.d.ts +1 -1
- package/dist/shared/types/ast.d.ts.map +1 -1
- package/dist/shared/types/ast.js +1 -1
- package/dist/shared/types/ast.js.map +1 -1
- package/dist/shared/types/symbol.d.ts +3 -2
- package/dist/shared/types/symbol.d.ts.map +1 -1
- package/dist/shared/types/symbol.js +1 -0
- package/dist/shared/types/symbol.js.map +1 -1
- package/dist/shared/utils/index.d.ts +5 -5
- package/dist/shared/utils/index.d.ts.map +1 -1
- package/dist/shared/utils/index.js +5 -5
- package/dist/shared/utils/index.js.map +1 -1
- package/package.json +9 -8
- package/dist/core/analysis/index.d.ts +0 -6
- package/dist/core/analysis/index.d.ts.map +0 -1
- package/dist/core/analysis/index.js +0 -7
- package/dist/core/analysis/index.js.map +0 -1
- package/dist/core/analysis/quality-metrics.d.ts +0 -158
- package/dist/core/analysis/quality-metrics.d.ts.map +0 -1
- package/dist/core/analysis/quality-metrics.js +0 -442
- package/dist/core/analysis/quality-metrics.js.map +0 -1
- package/dist/core/indexing/file-watcher.d.ts +0 -110
- package/dist/core/indexing/file-watcher.d.ts.map +0 -1
- package/dist/core/indexing/file-watcher.js +0 -280
- package/dist/core/indexing/file-watcher.js.map +0 -1
- package/dist/core/move/import-resolver.d.ts.map +0 -1
- package/dist/core/move/import-resolver.js.map +0 -1
- package/dist/core/move/index.d.ts.map +0 -1
- package/dist/core/move/index.js.map +0 -1
- package/dist/core/move/move-service.d.ts.map +0 -1
- package/dist/core/move/move-service.js.map +0 -1
- package/dist/core/move/types.d.ts.map +0 -1
- package/dist/core/move/types.js.map +0 -1
- package/dist/core/refactor/design-patterns.d.ts +0 -178
- package/dist/core/refactor/design-patterns.d.ts.map +0 -1
- package/dist/core/refactor/design-patterns.js +0 -656
- package/dist/core/refactor/design-patterns.js.map +0 -1
- package/dist/core/refactor/extract-function.d.ts +0 -197
- package/dist/core/refactor/extract-function.d.ts.map +0 -1
- package/dist/core/refactor/extract-function.js +0 -730
- package/dist/core/refactor/extract-function.js.map +0 -1
- package/dist/core/refactor/index.d.ts +0 -8
- package/dist/core/refactor/index.d.ts.map +0 -1
- package/dist/core/refactor/index.js +0 -11
- package/dist/core/refactor/index.js.map +0 -1
- package/dist/core/refactor/inline-function.d.ts +0 -175
- package/dist/core/refactor/inline-function.d.ts.map +0 -1
- package/dist/core/refactor/inline-function.js +0 -425
- package/dist/core/refactor/inline-function.js.map +0 -1
- package/dist/core/refactor/swift-extractor.d.ts +0 -98
- package/dist/core/refactor/swift-extractor.d.ts.map +0 -1
- package/dist/core/refactor/swift-extractor.js +0 -283
- package/dist/core/refactor/swift-extractor.js.map +0 -1
- package/dist/core/search/engines/text-engine.d.ts +0 -52
- package/dist/core/search/engines/text-engine.d.ts.map +0 -1
- package/dist/core/search/engines/text-engine.js +0 -376
- package/dist/core/search/engines/text-engine.js.map +0 -1
- package/dist/core/search/index.d.ts +0 -10
- package/dist/core/search/index.d.ts.map +0 -1
- package/dist/core/search/index.js +0 -11
- package/dist/core/search/index.js.map +0 -1
- package/dist/core/search/service.d.ts +0 -105
- package/dist/core/search/service.d.ts.map +0 -1
- package/dist/core/search/service.js +0 -384
- package/dist/core/search/service.js.map +0 -1
- package/dist/core/search/types.d.ts +0 -357
- package/dist/core/search/types.d.ts.map +0 -1
- package/dist/core/search/types.js +0 -47
- package/dist/core/search/types.js.map +0 -1
- package/dist/core/shit-score/grading.d.ts +0 -39
- package/dist/core/shit-score/grading.d.ts.map +0 -1
- package/dist/core/shit-score/grading.js +0 -253
- package/dist/core/shit-score/grading.js.map +0 -1
- package/dist/core/shit-score/index.d.ts +0 -9
- package/dist/core/shit-score/index.d.ts.map +0 -1
- package/dist/core/shit-score/index.js +0 -8
- package/dist/core/shit-score/index.js.map +0 -1
- package/dist/core/shit-score/score-calculator.d.ts +0 -75
- package/dist/core/shit-score/score-calculator.d.ts.map +0 -1
- package/dist/core/shit-score/score-calculator.js +0 -240
- package/dist/core/shit-score/score-calculator.js.map +0 -1
- package/dist/core/shit-score/shit-score-analyzer.d.ts +0 -84
- package/dist/core/shit-score/shit-score-analyzer.d.ts.map +0 -1
- package/dist/core/shit-score/shit-score-analyzer.js +0 -595
- package/dist/core/shit-score/shit-score-analyzer.js.map +0 -1
- package/dist/core/shit-score/types.d.ts +0 -231
- package/dist/core/shit-score/types.d.ts.map +0 -1
- package/dist/core/shit-score/types.js +0 -73
- package/dist/core/shit-score/types.js.map +0 -1
- package/dist/core/snapshot/code-compressor.d.ts +0 -39
- package/dist/core/snapshot/code-compressor.d.ts.map +0 -1
- package/dist/core/snapshot/code-compressor.js +0 -211
- package/dist/core/snapshot/code-compressor.js.map +0 -1
- package/dist/core/snapshot/config.d.ts +0 -60
- package/dist/core/snapshot/config.d.ts.map +0 -1
- package/dist/core/snapshot/config.js +0 -136
- package/dist/core/snapshot/config.js.map +0 -1
- package/dist/core/snapshot/snapshot-differ.d.ts +0 -54
- package/dist/core/snapshot/snapshot-differ.d.ts.map +0 -1
- package/dist/core/snapshot/snapshot-differ.js +0 -262
- package/dist/core/snapshot/snapshot-differ.js.map +0 -1
- package/dist/core/snapshot/snapshot-engine.d.ts +0 -94
- package/dist/core/snapshot/snapshot-engine.d.ts.map +0 -1
- package/dist/core/snapshot/snapshot-engine.js +0 -492
- package/dist/core/snapshot/snapshot-engine.js.map +0 -1
- package/dist/infrastructure/parser/factory.d.ts +0 -141
- package/dist/infrastructure/parser/factory.d.ts.map +0 -1
- package/dist/infrastructure/parser/factory.js +0 -306
- package/dist/infrastructure/parser/factory.js.map +0 -1
- package/dist/infrastructure/storage/file-watcher.d.ts +0 -84
- package/dist/infrastructure/storage/file-watcher.d.ts.map +0 -1
- package/dist/infrastructure/storage/file-watcher.js +0 -249
- package/dist/infrastructure/storage/file-watcher.js.map +0 -1
- package/dist/infrastructure/storage/path-utils.d.ts +0 -96
- package/dist/infrastructure/storage/path-utils.d.ts.map +0 -1
- package/dist/infrastructure/storage/path-utils.js +0 -272
- package/dist/infrastructure/storage/path-utils.js.map +0 -1
- package/dist/plugins/swift/analyzers/complexity-analyzer.d.ts +0 -41
- package/dist/plugins/swift/analyzers/complexity-analyzer.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/complexity-analyzer.js +0 -206
- package/dist/plugins/swift/analyzers/complexity-analyzer.js.map +0 -1
- package/dist/plugins/swift/analyzers/duplication-detector.d.ts +0 -89
- package/dist/plugins/swift/analyzers/duplication-detector.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/duplication-detector.js +0 -271
- package/dist/plugins/swift/analyzers/duplication-detector.js.map +0 -1
- package/dist/plugins/swift/analyzers/error-handling-checker.d.ts +0 -34
- package/dist/plugins/swift/analyzers/error-handling-checker.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/error-handling-checker.js +0 -135
- package/dist/plugins/swift/analyzers/error-handling-checker.js.map +0 -1
- package/dist/plugins/swift/analyzers/naming-checker.d.ts +0 -47
- package/dist/plugins/swift/analyzers/naming-checker.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/naming-checker.js +0 -161
- package/dist/plugins/swift/analyzers/naming-checker.js.map +0 -1
- package/dist/plugins/swift/analyzers/pattern-detector.d.ts +0 -78
- package/dist/plugins/swift/analyzers/pattern-detector.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/pattern-detector.js +0 -247
- package/dist/plugins/swift/analyzers/pattern-detector.js.map +0 -1
- package/dist/plugins/swift/analyzers/security-checker.d.ts +0 -38
- package/dist/plugins/swift/analyzers/security-checker.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/security-checker.js +0 -135
- package/dist/plugins/swift/analyzers/security-checker.js.map +0 -1
- package/dist/plugins/swift/analyzers/test-coverage-checker.d.ts +0 -26
- package/dist/plugins/swift/analyzers/test-coverage-checker.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/test-coverage-checker.js +0 -63
- package/dist/plugins/swift/analyzers/test-coverage-checker.js.map +0 -1
- package/dist/plugins/swift/analyzers/type-safety-checker.d.ts +0 -41
- package/dist/plugins/swift/analyzers/type-safety-checker.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/type-safety-checker.js +0 -121
- package/dist/plugins/swift/analyzers/type-safety-checker.js.map +0 -1
- package/dist/plugins/swift/analyzers/unused-symbol-detector.d.ts +0 -38
- package/dist/plugins/swift/analyzers/unused-symbol-detector.d.ts.map +0 -1
- package/dist/plugins/swift/analyzers/unused-symbol-detector.js +0 -211
- package/dist/plugins/swift/analyzers/unused-symbol-detector.js.map +0 -1
- package/dist/plugins/typescript/analyzers/complexity-analyzer.d.ts +0 -39
- package/dist/plugins/typescript/analyzers/complexity-analyzer.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/complexity-analyzer.js +0 -196
- package/dist/plugins/typescript/analyzers/complexity-analyzer.js.map +0 -1
- package/dist/plugins/typescript/analyzers/duplication-detector.d.ts +0 -181
- package/dist/plugins/typescript/analyzers/duplication-detector.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/duplication-detector.js +0 -695
- package/dist/plugins/typescript/analyzers/duplication-detector.js.map +0 -1
- package/dist/plugins/typescript/analyzers/error-handling-checker.d.ts +0 -26
- package/dist/plugins/typescript/analyzers/error-handling-checker.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/error-handling-checker.js +0 -84
- package/dist/plugins/typescript/analyzers/error-handling-checker.js.map +0 -1
- package/dist/plugins/typescript/analyzers/naming-checker.d.ts +0 -30
- package/dist/plugins/typescript/analyzers/naming-checker.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/naming-checker.js +0 -116
- package/dist/plugins/typescript/analyzers/naming-checker.js.map +0 -1
- package/dist/plugins/typescript/analyzers/pattern-detector.d.ts +0 -80
- package/dist/plugins/typescript/analyzers/pattern-detector.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/pattern-detector.js +0 -267
- package/dist/plugins/typescript/analyzers/pattern-detector.js.map +0 -1
- package/dist/plugins/typescript/analyzers/security-checker.d.ts +0 -34
- package/dist/plugins/typescript/analyzers/security-checker.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/security-checker.js +0 -126
- package/dist/plugins/typescript/analyzers/security-checker.js.map +0 -1
- package/dist/plugins/typescript/analyzers/test-coverage-checker.d.ts +0 -22
- package/dist/plugins/typescript/analyzers/test-coverage-checker.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/test-coverage-checker.js +0 -62
- package/dist/plugins/typescript/analyzers/test-coverage-checker.js.map +0 -1
- package/dist/plugins/typescript/analyzers/type-safety-checker.d.ts +0 -32
- package/dist/plugins/typescript/analyzers/type-safety-checker.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/type-safety-checker.js +0 -86
- package/dist/plugins/typescript/analyzers/type-safety-checker.js.map +0 -1
- package/dist/plugins/typescript/analyzers/unused-symbol-detector.d.ts +0 -47
- package/dist/plugins/typescript/analyzers/unused-symbol-detector.d.ts.map +0 -1
- package/dist/plugins/typescript/analyzers/unused-symbol-detector.js +0 -152
- package/dist/plugins/typescript/analyzers/unused-symbol-detector.js.map +0 -1
- /package/dist/core/{move → move-file}/import-resolver.d.ts +0 -0
- /package/dist/core/{move → move-file}/types.d.ts +0 -0
- /package/dist/core/{move → move-file}/types.js +0 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preview 輸入轉換器
|
|
3
|
+
* 將各 Core 模組的 preview 結果轉換為統一的 PreviewInput 格式
|
|
4
|
+
*/
|
|
5
|
+
import { PreviewCommand } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* 從 Rename 模組的 preview 結果轉換為 PreviewInput
|
|
8
|
+
*/
|
|
9
|
+
export function convertRenamePreview(operations, conflicts, originalContents, options) {
|
|
10
|
+
const baseInput = convertOperationsToPreviewInput(PreviewCommand.Rename, operations, originalContents, convertRenameConflicts(conflicts));
|
|
11
|
+
return {
|
|
12
|
+
...baseInput,
|
|
13
|
+
operationDescription: options?.oldName && options?.newName
|
|
14
|
+
? `Renamed '${options.oldName}' to '${options.newName}'`
|
|
15
|
+
: undefined
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 從 Move 模組的結果轉換為 PreviewInput
|
|
20
|
+
*/
|
|
21
|
+
export function convertMovePreview(sourceFile, targetFile, pathUpdates, originalContents) {
|
|
22
|
+
const fileChanges = [];
|
|
23
|
+
// 處理 import 更新
|
|
24
|
+
const groupedUpdates = new Map();
|
|
25
|
+
for (const update of pathUpdates) {
|
|
26
|
+
const existing = groupedUpdates.get(update.filePath) ?? [];
|
|
27
|
+
existing.push({ oldImport: update.oldImport, newImport: update.newImport, line: update.line });
|
|
28
|
+
groupedUpdates.set(update.filePath, existing);
|
|
29
|
+
}
|
|
30
|
+
for (const [filePath, updates] of groupedUpdates) {
|
|
31
|
+
const originalContent = originalContents.get(filePath) ?? '';
|
|
32
|
+
const changes = updates.map(u => ({
|
|
33
|
+
line: u.line,
|
|
34
|
+
oldContent: u.oldImport,
|
|
35
|
+
newContent: u.newImport
|
|
36
|
+
}));
|
|
37
|
+
fileChanges.push({ filePath, originalContent, changes });
|
|
38
|
+
}
|
|
39
|
+
// 從路徑提取檔名
|
|
40
|
+
const sourceFileName = sourceFile.split('/').pop() ?? sourceFile;
|
|
41
|
+
const targetFileName = targetFile.split('/').pop() ?? targetFile;
|
|
42
|
+
return {
|
|
43
|
+
command: PreviewCommand.Move,
|
|
44
|
+
success: true,
|
|
45
|
+
fileChanges,
|
|
46
|
+
operationDescription: `Moved '${sourceFileName}' to '${targetFileName}'`
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* 從 Shift 模組的結果轉換為 PreviewInput
|
|
51
|
+
*/
|
|
52
|
+
export function convertShiftPreview(sourceFile, targetFile, fromLine, toLine, position, sourceOriginalContent, targetOriginalContent, movedLines) {
|
|
53
|
+
const fileChanges = [];
|
|
54
|
+
const isSameFile = sourceFile === targetFile;
|
|
55
|
+
if (isSameFile) {
|
|
56
|
+
// 同檔案移動
|
|
57
|
+
const changes = [];
|
|
58
|
+
// 標記刪除的行
|
|
59
|
+
for (let line = fromLine; line <= toLine; line++) {
|
|
60
|
+
const originalLines = sourceOriginalContent.split('\n');
|
|
61
|
+
changes.push({
|
|
62
|
+
line,
|
|
63
|
+
oldContent: originalLines[line - 1] ?? '',
|
|
64
|
+
newContent: null
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
// 標記插入的行
|
|
68
|
+
const insertPosition = position > toLine ? position - (toLine - fromLine + 1) : position;
|
|
69
|
+
movedLines.forEach((content, index) => {
|
|
70
|
+
changes.push({
|
|
71
|
+
line: insertPosition + index,
|
|
72
|
+
oldContent: null,
|
|
73
|
+
newContent: content
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
fileChanges.push({
|
|
77
|
+
filePath: sourceFile,
|
|
78
|
+
originalContent: sourceOriginalContent,
|
|
79
|
+
changes
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
// 跨檔案移動
|
|
84
|
+
// Source: 刪除行
|
|
85
|
+
const sourceChanges = [];
|
|
86
|
+
for (let line = fromLine; line <= toLine; line++) {
|
|
87
|
+
const originalLines = sourceOriginalContent.split('\n');
|
|
88
|
+
sourceChanges.push({
|
|
89
|
+
line,
|
|
90
|
+
oldContent: originalLines[line - 1] ?? '',
|
|
91
|
+
newContent: null
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
fileChanges.push({
|
|
95
|
+
filePath: sourceFile,
|
|
96
|
+
originalContent: sourceOriginalContent,
|
|
97
|
+
changes: sourceChanges
|
|
98
|
+
});
|
|
99
|
+
// Target: 插入行
|
|
100
|
+
const targetChanges = movedLines.map((content, index) => ({
|
|
101
|
+
line: position + index,
|
|
102
|
+
oldContent: null,
|
|
103
|
+
newContent: content
|
|
104
|
+
}));
|
|
105
|
+
fileChanges.push({
|
|
106
|
+
filePath: targetFile,
|
|
107
|
+
originalContent: targetOriginalContent ?? '',
|
|
108
|
+
changes: targetChanges
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
// 生成操作描述
|
|
112
|
+
const linesCount = toLine - fromLine + 1;
|
|
113
|
+
const operationDescription = isSameFile
|
|
114
|
+
? `Moved ${linesCount} line${linesCount > 1 ? 's' : ''} within file (${fromLine}-${toLine} → ${position})`
|
|
115
|
+
: `Moved ${linesCount} line${linesCount > 1 ? 's' : ''} to '${targetFile.split('/').pop()}'`;
|
|
116
|
+
return {
|
|
117
|
+
command: PreviewCommand.Shift,
|
|
118
|
+
success: true,
|
|
119
|
+
fileChanges,
|
|
120
|
+
operationDescription
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* 從 Refactor/Extract 模組的結果轉換為 PreviewInput
|
|
125
|
+
*/
|
|
126
|
+
export function convertRefactorPreview(edits, filePath, originalContent, targetFileContent, targetFilePath, options) {
|
|
127
|
+
const fileChanges = [];
|
|
128
|
+
const originalLines = originalContent.split('\n');
|
|
129
|
+
// 主檔案變更
|
|
130
|
+
const changes = edits.map(edit => {
|
|
131
|
+
const startLine = edit.range.start.line;
|
|
132
|
+
const endLine = edit.range.end.line;
|
|
133
|
+
// 組合原始內容
|
|
134
|
+
const oldContent = originalLines.slice(startLine - 1, endLine).join('\n');
|
|
135
|
+
return {
|
|
136
|
+
line: startLine,
|
|
137
|
+
oldContent,
|
|
138
|
+
newContent: edit.newText
|
|
139
|
+
};
|
|
140
|
+
});
|
|
141
|
+
fileChanges.push({ filePath, originalContent, changes });
|
|
142
|
+
// 目標檔案(跨檔案提取)
|
|
143
|
+
if (targetFilePath && targetFileContent) {
|
|
144
|
+
fileChanges.push({
|
|
145
|
+
filePath: targetFilePath,
|
|
146
|
+
originalContent: '', // 新檔案
|
|
147
|
+
changes: [{
|
|
148
|
+
line: 1,
|
|
149
|
+
oldContent: null,
|
|
150
|
+
newContent: targetFileContent
|
|
151
|
+
}]
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
// 生成操作描述
|
|
155
|
+
let operationDescription;
|
|
156
|
+
if (options?.functionName) {
|
|
157
|
+
operationDescription = `Extracted function '${options.functionName}'`;
|
|
158
|
+
}
|
|
159
|
+
else if (options?.action) {
|
|
160
|
+
operationDescription = options.action;
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
command: PreviewCommand.Refactor,
|
|
164
|
+
success: true,
|
|
165
|
+
fileChanges,
|
|
166
|
+
operationDescription
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* 通用操作轉換函數
|
|
171
|
+
*/
|
|
172
|
+
function convertOperationsToPreviewInput(command, operations, originalContents, conflicts, errors) {
|
|
173
|
+
// 按檔案分組操作
|
|
174
|
+
const groupedOps = new Map();
|
|
175
|
+
for (const op of operations) {
|
|
176
|
+
const existing = groupedOps.get(op.filePath) ?? [];
|
|
177
|
+
existing.push(op);
|
|
178
|
+
groupedOps.set(op.filePath, existing);
|
|
179
|
+
}
|
|
180
|
+
const fileChanges = [];
|
|
181
|
+
for (const [filePath, ops] of groupedOps) {
|
|
182
|
+
const originalContent = originalContents.get(filePath) ?? '';
|
|
183
|
+
const changes = ops.map(op => ({
|
|
184
|
+
line: op.range.start.line,
|
|
185
|
+
oldContent: op.oldText,
|
|
186
|
+
newContent: op.newText
|
|
187
|
+
}));
|
|
188
|
+
fileChanges.push({ filePath, originalContent, changes });
|
|
189
|
+
}
|
|
190
|
+
return {
|
|
191
|
+
command,
|
|
192
|
+
success: true,
|
|
193
|
+
fileChanges,
|
|
194
|
+
conflicts,
|
|
195
|
+
errors
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* 轉換 rename 模組的衝突格式
|
|
200
|
+
*/
|
|
201
|
+
function convertRenameConflicts(conflicts) {
|
|
202
|
+
return conflicts.map(c => ({
|
|
203
|
+
type: c.type,
|
|
204
|
+
message: c.message,
|
|
205
|
+
filePath: c.location?.filePath ?? null,
|
|
206
|
+
line: c.location?.range?.start.line ?? null
|
|
207
|
+
}));
|
|
208
|
+
}
|
|
209
|
+
//# sourceMappingURL=preview-converter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-converter.js","sourceRoot":"","sources":["../../../src/infrastructure/formatters/preview-converter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,cAAc,EAKf,MAAM,YAAY,CAAC;AAqCpB;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAClC,UAAoC,EACpC,SAAkC,EAClC,gBAAqC,EACrC,OAA8B;IAE9B,MAAM,SAAS,GAAG,+BAA+B,CAC/C,cAAc,CAAC,MAAM,EACrB,UAAU,EACV,gBAAgB,EAChB,sBAAsB,CAAC,SAAS,CAAC,CAClC,CAAC;IAEF,OAAO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G,CAAC,IAAI,UAAU,EAAE,CAAC;QACzC,MAAM,eAAe,GAAG,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QAE7D,MAAM,OAAO,GAAiB,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YAC3C,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI;YACzB,UAAU,EAAE,EAAE,CAAC,OAAO;YACtB,UAAU,EAAE,EAAE,CAAC,OAAO;SACvB,CAAC,CAAC,CAAC;QAEJ,WAAW,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED,OAAO;QACL,OAAO;QACP,OAAO,EAAE,IAAI;QACb,WAAW;QACX,SAAS;QACT,MAAM;KACP,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,sBAAsB,CAAC,SAAkC;IAChE,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACzB,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,OAAO,EAAE,CAAC,CAAC,OAAO;QAClB,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,QAAQ,IAAI,IAAI;QACtC,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,IAAI,IAAI;KAC5C,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preview 格式化器
|
|
3
|
+
* 將 PreviewResult 轉換為 diff 或 json 格式輸出
|
|
4
|
+
*/
|
|
5
|
+
import { PreviewFormat, type PreviewFormatterOptions, type PreviewResult, type PreviewInput } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Preview 格式化器
|
|
8
|
+
* 統一處理所有命令的 dry-run 輸出
|
|
9
|
+
*/
|
|
10
|
+
export declare class PreviewFormatter {
|
|
11
|
+
private readonly contextLines;
|
|
12
|
+
private readonly color;
|
|
13
|
+
constructor(options?: Partial<PreviewFormatterOptions>);
|
|
14
|
+
/**
|
|
15
|
+
* 從原始輸入資料生成 PreviewResult
|
|
16
|
+
*/
|
|
17
|
+
createPreview(input: PreviewInput): PreviewResult;
|
|
18
|
+
/**
|
|
19
|
+
* 格式化 PreviewResult 為指定格式
|
|
20
|
+
*/
|
|
21
|
+
format(result: PreviewResult, outputFormat?: PreviewFormat): string;
|
|
22
|
+
/**
|
|
23
|
+
* 轉換為 unified diff 格式
|
|
24
|
+
*/
|
|
25
|
+
toDiff(result: PreviewResult): string;
|
|
26
|
+
/**
|
|
27
|
+
* 轉換為 JSON 格式(含上下文)
|
|
28
|
+
*/
|
|
29
|
+
toJson(result: PreviewResult): string;
|
|
30
|
+
/**
|
|
31
|
+
* 轉換為 summary 格式
|
|
32
|
+
* 統計 + 每個檔案的簡短變更描述
|
|
33
|
+
*/
|
|
34
|
+
toSummary(result: PreviewResult): string;
|
|
35
|
+
/**
|
|
36
|
+
* 格式化單一檔案的 diff
|
|
37
|
+
*/
|
|
38
|
+
private formatFileDiff;
|
|
39
|
+
/**
|
|
40
|
+
* 格式化單一 hunk
|
|
41
|
+
*/
|
|
42
|
+
private formatHunk;
|
|
43
|
+
/**
|
|
44
|
+
* 格式化單一變更行
|
|
45
|
+
*/
|
|
46
|
+
private formatChangeLine;
|
|
47
|
+
/**
|
|
48
|
+
* 格式化摘要行
|
|
49
|
+
*/
|
|
50
|
+
private formatSummary;
|
|
51
|
+
/**
|
|
52
|
+
* 套用顏色(如果啟用)
|
|
53
|
+
*/
|
|
54
|
+
private colorize;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* 建立 PreviewFormatter 的工廠函數
|
|
58
|
+
* 根據終端機環境自動決定是否啟用顏色
|
|
59
|
+
*/
|
|
60
|
+
export declare function createPreviewFormatter(options?: Partial<PreviewFormatterOptions>): PreviewFormatter;
|
|
61
|
+
//# sourceMappingURL=preview-formatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-formatter.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/formatters/preview-formatter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEL,aAAa,EACb,KAAK,uBAAuB,EAC5B,KAAK,aAAa,EAIlB,KAAK,YAAY,EAClB,MAAM,YAAY,CAAC;AAYpB;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAU;gBAEpB,OAAO,GAAE,OAAO,CAAC,uBAAuB,CAAM;IAK1D;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,aAAa;IAIjD;;OAEG;IACH,MAAM,CAAC,MAAM,EAAE,aAAa,EAAE,YAAY,GAAE,aAAkC,GAAG,MAAM;IAavF;;OAEG;IACH,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM;IAiCrC;;OAEG;IACH,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM;IAIrC;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM;IAiDxC;;OAEG;IACH,OAAO,CAAC,cAAc;IAetB;;OAEG;IACH,OAAO,CAAC,UAAU;IAclB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAaxB;;OAEG;IACH,OAAO,CAAC,aAAa;IAgBrB;;OAEG;IACH,OAAO,CAAC,QAAQ;CAMjB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,OAAO,CAAC,uBAAuB,CAAM,GAAG,gBAAgB,CAMvG"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preview 格式化器
|
|
3
|
+
* 將 PreviewResult 轉換為 diff 或 json 格式輸出
|
|
4
|
+
*/
|
|
5
|
+
import { ChangeLineType, PreviewFormat } from './types.js';
|
|
6
|
+
import { generatePreviewResult } from '../formatters/diff-generator.js';
|
|
7
|
+
/** ANSI 顏色碼 */
|
|
8
|
+
const Colors = {
|
|
9
|
+
reset: '\x1b[0m',
|
|
10
|
+
red: '\x1b[31m',
|
|
11
|
+
green: '\x1b[32m',
|
|
12
|
+
cyan: '\x1b[36m',
|
|
13
|
+
dim: '\x1b[2m'
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Preview 格式化器
|
|
17
|
+
* 統一處理所有命令的 dry-run 輸出
|
|
18
|
+
*/
|
|
19
|
+
export class PreviewFormatter {
|
|
20
|
+
contextLines;
|
|
21
|
+
color;
|
|
22
|
+
constructor(options = {}) {
|
|
23
|
+
this.contextLines = options.contextLines ?? 3;
|
|
24
|
+
this.color = options.color ?? false;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 從原始輸入資料生成 PreviewResult
|
|
28
|
+
*/
|
|
29
|
+
createPreview(input) {
|
|
30
|
+
return generatePreviewResult(input, this.contextLines);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 格式化 PreviewResult 為指定格式
|
|
34
|
+
*/
|
|
35
|
+
format(result, outputFormat = PreviewFormat.Diff) {
|
|
36
|
+
switch (outputFormat) {
|
|
37
|
+
case PreviewFormat.Diff:
|
|
38
|
+
return this.toDiff(result);
|
|
39
|
+
case PreviewFormat.Json:
|
|
40
|
+
return this.toJson(result);
|
|
41
|
+
case PreviewFormat.Summary:
|
|
42
|
+
return this.toSummary(result);
|
|
43
|
+
default:
|
|
44
|
+
return this.toDiff(result);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* 轉換為 unified diff 格式
|
|
49
|
+
*/
|
|
50
|
+
toDiff(result) {
|
|
51
|
+
const lines = [];
|
|
52
|
+
// 檔案變更
|
|
53
|
+
result.files.forEach(file => {
|
|
54
|
+
lines.push(...this.formatFileDiff(file));
|
|
55
|
+
lines.push(''); // 檔案之間空行
|
|
56
|
+
});
|
|
57
|
+
// 摘要
|
|
58
|
+
lines.push(this.formatSummary(result));
|
|
59
|
+
// 衝突警告
|
|
60
|
+
if (result.conflicts && result.conflicts.length > 0) {
|
|
61
|
+
lines.push('');
|
|
62
|
+
lines.push(this.colorize('Conflicts:', Colors.red));
|
|
63
|
+
result.conflicts.forEach(conflict => {
|
|
64
|
+
lines.push(this.colorize(` - ${conflict.message}`, Colors.red));
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
// 錯誤訊息
|
|
68
|
+
if (result.errors && result.errors.length > 0) {
|
|
69
|
+
lines.push('');
|
|
70
|
+
lines.push(this.colorize('Errors:', Colors.red));
|
|
71
|
+
result.errors.forEach(error => {
|
|
72
|
+
lines.push(this.colorize(` - ${error}`, Colors.red));
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return lines.join('\n');
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* 轉換為 JSON 格式(含上下文)
|
|
79
|
+
*/
|
|
80
|
+
toJson(result) {
|
|
81
|
+
return JSON.stringify(result, null, 2);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 轉換為 summary 格式
|
|
85
|
+
* 統計 + 每個檔案的簡短變更描述
|
|
86
|
+
*/
|
|
87
|
+
toSummary(result) {
|
|
88
|
+
const lines = [];
|
|
89
|
+
// 操作描述
|
|
90
|
+
if (result.operationDescription) {
|
|
91
|
+
lines.push(result.operationDescription);
|
|
92
|
+
lines.push('');
|
|
93
|
+
}
|
|
94
|
+
// 統計摘要
|
|
95
|
+
const { summary } = result;
|
|
96
|
+
const addPart = this.colorize(`+${summary.additions}`, Colors.green);
|
|
97
|
+
const delPart = this.colorize(`-${summary.deletions}`, Colors.red);
|
|
98
|
+
lines.push(`Files: ${summary.totalFiles}`);
|
|
99
|
+
lines.push(`Changes: ${summary.totalChanges} (${addPart} ${delPart})`);
|
|
100
|
+
// 檔案變更列表
|
|
101
|
+
if (result.fileSummaries && result.fileSummaries.length > 0) {
|
|
102
|
+
lines.push('');
|
|
103
|
+
lines.push('Files:');
|
|
104
|
+
result.fileSummaries.forEach(fs => {
|
|
105
|
+
const stats = this.colorize(`+${fs.additions}`, Colors.green)
|
|
106
|
+
+ ' '
|
|
107
|
+
+ this.colorize(`-${fs.deletions}`, Colors.red);
|
|
108
|
+
lines.push(` ${fs.filePath}: ${fs.changeType} (${stats})`);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
// 衝突警告
|
|
112
|
+
if (result.conflicts && result.conflicts.length > 0) {
|
|
113
|
+
lines.push('');
|
|
114
|
+
lines.push(this.colorize('Conflicts:', Colors.red));
|
|
115
|
+
result.conflicts.forEach(conflict => {
|
|
116
|
+
lines.push(this.colorize(` - ${conflict.message}`, Colors.red));
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
// 錯誤訊息
|
|
120
|
+
if (result.errors && result.errors.length > 0) {
|
|
121
|
+
lines.push('');
|
|
122
|
+
lines.push(this.colorize('Errors:', Colors.red));
|
|
123
|
+
result.errors.forEach(error => {
|
|
124
|
+
lines.push(this.colorize(` - ${error}`, Colors.red));
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
return lines.join('\n');
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* 格式化單一檔案的 diff
|
|
131
|
+
*/
|
|
132
|
+
formatFileDiff(file) {
|
|
133
|
+
const lines = [];
|
|
134
|
+
// 檔案 header
|
|
135
|
+
lines.push(this.colorize(`--- a/${file.filePath}`, Colors.dim));
|
|
136
|
+
lines.push(this.colorize(`+++ b/${file.filePath}`, Colors.dim));
|
|
137
|
+
// Hunks
|
|
138
|
+
file.hunks.forEach(hunk => {
|
|
139
|
+
lines.push(...this.formatHunk(hunk));
|
|
140
|
+
});
|
|
141
|
+
return lines;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* 格式化單一 hunk
|
|
145
|
+
*/
|
|
146
|
+
formatHunk(hunk) {
|
|
147
|
+
const lines = [];
|
|
148
|
+
// Hunk header
|
|
149
|
+
lines.push(this.colorize(hunk.header, Colors.cyan));
|
|
150
|
+
// 變更行
|
|
151
|
+
hunk.lines.forEach(line => {
|
|
152
|
+
lines.push(this.formatChangeLine(line));
|
|
153
|
+
});
|
|
154
|
+
return lines;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* 格式化單一變更行
|
|
158
|
+
*/
|
|
159
|
+
formatChangeLine(line) {
|
|
160
|
+
switch (line.type) {
|
|
161
|
+
case ChangeLineType.Add:
|
|
162
|
+
return this.colorize(`+${line.content}`, Colors.green);
|
|
163
|
+
case ChangeLineType.Delete:
|
|
164
|
+
return this.colorize(`-${line.content}`, Colors.red);
|
|
165
|
+
case ChangeLineType.Context:
|
|
166
|
+
return ` ${line.content}`;
|
|
167
|
+
default:
|
|
168
|
+
return ` ${line.content}`;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* 格式化摘要行
|
|
173
|
+
*/
|
|
174
|
+
formatSummary(result) {
|
|
175
|
+
const { summary } = result;
|
|
176
|
+
const parts = [
|
|
177
|
+
`${summary.totalFiles} file${summary.totalFiles !== 1 ? 's' : ''}`,
|
|
178
|
+
`${summary.totalChanges} change${summary.totalChanges !== 1 ? 's' : ''}`
|
|
179
|
+
];
|
|
180
|
+
if (summary.additions > 0 || summary.deletions > 0) {
|
|
181
|
+
const addPart = this.colorize(`+${summary.additions}`, Colors.green);
|
|
182
|
+
const delPart = this.colorize(`-${summary.deletions}`, Colors.red);
|
|
183
|
+
parts.push(`(${addPart} ${delPart})`);
|
|
184
|
+
}
|
|
185
|
+
return `Summary: ${parts.join(', ')}`;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* 套用顏色(如果啟用)
|
|
189
|
+
*/
|
|
190
|
+
colorize(text, color) {
|
|
191
|
+
if (!this.color) {
|
|
192
|
+
return text;
|
|
193
|
+
}
|
|
194
|
+
return `${color}${text}${Colors.reset}`;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* 建立 PreviewFormatter 的工廠函數
|
|
199
|
+
* 根據終端機環境自動決定是否啟用顏色
|
|
200
|
+
*/
|
|
201
|
+
export function createPreviewFormatter(options = {}) {
|
|
202
|
+
const finalOptions = {
|
|
203
|
+
contextLines: options.contextLines ?? 3,
|
|
204
|
+
color: options.color ?? (process.stdout.isTTY ?? false)
|
|
205
|
+
};
|
|
206
|
+
return new PreviewFormatter(finalOptions);
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=preview-formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-formatter.js","sourceRoot":"","sources":["../../../src/infrastructure/formatters/preview-formatter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,cAAc,EACd,aAAa,EAOd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAErF,eAAe;AACf,MAAM,MAAM,GAAG;IACb,KAAK,EAAE,SAAS;IAChB,GAAG,EAAE,UAAU;IACf,KAAK,EAAE,UAAU;IACjB,IAAI,EAAE,UAAU;IAChB,GAAG,EAAE,SAAS;CACN,CAAC;AAEX;;;GAGG;AACH,MAAM,OAAO,gBAAgB;IACV,YAAY,CAAS;IACrB,KAAK,CAAU;IAEhC,YAAY,UAA4C,EAAE;QACxD,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,CAAC,CAAC;QAC9C,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,KAAmB;QAC/B,OAAO,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,MAAqB,EAAE,eAA8B,aAAa,CAAC,IAAI;Q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AAO,CAAC,SAAS,GAAG,CAAC,EAAE,CAAC;YACnD,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;YACrE,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;YACnE,KAAK,CAAC,IAAI,CAAC,IAAI,OAAO,IAAI,OAAO,GAAG,CAAC,CAAC;QACxC,CAAC;QAED,OAAO,YAAY,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IACxC,CAAC;IAED;;OAEG;IACK,QAAQ,CAAC,IAAY,EAAE,KAAa;QAC1C,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,GAAG,KAAK,GAAG,IAAI,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC;IAC1C,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,UAA4C,EAAE;IACnF,MAAM,YAAY,GAAqC;QACrD,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,CAAC;QACvC,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,KAAK,CAAC;KACxD,CAAC;IACF,OAAO,IAAI,gBAAgB,CAAC,YAAY,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 唯讀命令格式化器
|
|
3
|
+
* 提供 json 和 summary 兩種輸出格式
|
|
4
|
+
*/
|
|
5
|
+
import { type QueryResult } from './query-types.js';
|
|
6
|
+
/** QueryFormatter 選項 */
|
|
7
|
+
export interface QueryFormatterOptions {
|
|
8
|
+
/** 是否啟用顏色輸出 */
|
|
9
|
+
color: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** 輸出格式 */
|
|
12
|
+
export declare enum QueryFormat {
|
|
13
|
+
Json = "json",
|
|
14
|
+
Summary = "summary"
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 唯讀命令格式化器
|
|
18
|
+
*/
|
|
19
|
+
export declare class QueryFormatter {
|
|
20
|
+
private readonly color;
|
|
21
|
+
constructor(options?: Partial<QueryFormatterOptions>);
|
|
22
|
+
/**
|
|
23
|
+
* 格式化結果
|
|
24
|
+
*/
|
|
25
|
+
format(result: QueryResult, outputFormat: QueryFormat): string;
|
|
26
|
+
/**
|
|
27
|
+
* 轉換為 JSON 格式
|
|
28
|
+
*/
|
|
29
|
+
toJson(result: QueryResult): string;
|
|
30
|
+
/**
|
|
31
|
+
* 轉換為 summary 格式
|
|
32
|
+
*/
|
|
33
|
+
toSummary(result: QueryResult): string;
|
|
34
|
+
/**
|
|
35
|
+
* 格式化 Search 摘要
|
|
36
|
+
*/
|
|
37
|
+
private formatSearchSummary;
|
|
38
|
+
/**
|
|
39
|
+
* 格式化 Deps 摘要
|
|
40
|
+
*/
|
|
41
|
+
private formatDepsSummary;
|
|
42
|
+
/**
|
|
43
|
+
* 格式化 Analyze 摘要
|
|
44
|
+
*/
|
|
45
|
+
private formatAnalyzeSummary;
|
|
46
|
+
/**
|
|
47
|
+
* 格式化 Snapshot 摘要
|
|
48
|
+
*/
|
|
49
|
+
private formatSnapshotSummary;
|
|
50
|
+
/**
|
|
51
|
+
* 格式化 FindReferences 摘要
|
|
52
|
+
*/
|
|
53
|
+
private formatFindReferencesSummary;
|
|
54
|
+
/**
|
|
55
|
+
* 按檔案分組引用
|
|
56
|
+
*/
|
|
57
|
+
private groupReferencesByFile;
|
|
58
|
+
/**
|
|
59
|
+
* 取得引用類型圖示
|
|
60
|
+
*/
|
|
61
|
+
private getReferenceTypeIcon;
|
|
62
|
+
/**
|
|
63
|
+
* 格式化 CallHierarchy 摘要
|
|
64
|
+
*/
|
|
65
|
+
private formatCallHierarchySummary;
|
|
66
|
+
/**
|
|
67
|
+
* 按檔案分組呼叫項目
|
|
68
|
+
*/
|
|
69
|
+
private groupCallsByFile;
|
|
70
|
+
/**
|
|
71
|
+
* 格式化預設摘要(fallback)
|
|
72
|
+
*/
|
|
73
|
+
private formatDefaultSummary;
|
|
74
|
+
/**
|
|
75
|
+
* 套用顏色(如果啟用)
|
|
76
|
+
*/
|
|
77
|
+
private colorize;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* 建立 QueryFormatter 的工廠函數
|
|
81
|
+
*/
|
|
82
|
+
export declare function createQueryFormatter(options?: Partial<QueryFormatterOptions>): QueryFormatter;
|
|
83
|
+
//# sourceMappingURL=query-formatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-formatter.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/formatters/query-formatter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGL,KAAK,WAAW,EAYjB,MAAM,kBAAkB,CAAC;AAqB1B,wBAAwB;AACxB,MAAM,WAAW,qBAAqB;IACpC,eAAe;IACf,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,WAAW;AACX,oBAAY,WAAW;IACrB,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAU;gBAEpB,OAAO,GAAE,OAAO,CAAC,qBAAqB,CAAM;IAIxD;;OAEG;IACH,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,GAAG,MAAM;IAO9D;;OAEG;IACH,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM;IAInC;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM;IAmBtC;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAyB3B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAkCzB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IA0B5B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IA2B7B;;OAEG;IACH,OAAO,CAAC,2BAA2B;IAyCnC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAU7B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAU5B;;OAEG;IACH,OAAO,CAAC,0BAA0B;IA0DlC;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAUxB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAsB5B;;OAEG;IACH,OAAO,CAAC,QAAQ;CAIjB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,OAAO,CAAC,qBAAqB,CAAM,GAAG,cAAc,CAKjG"}
|