agent-ide 0.13.6 → 0.13.7
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 +14 -7
- package/dist/core/call-hierarchy/call-hierarchy-analyzer.d.ts +11 -2
- package/dist/core/call-hierarchy/call-hierarchy-analyzer.d.ts.map +1 -1
- package/dist/core/call-hierarchy/call-hierarchy-analyzer.js +233 -25
- package/dist/core/call-hierarchy/call-hierarchy-analyzer.js.map +1 -1
- package/dist/core/change-signature/call-site-updater.d.ts +0 -1
- package/dist/core/change-signature/call-site-updater.d.ts.map +1 -1
- package/dist/core/change-signature/call-site-updater.js +0 -2
- package/dist/core/change-signature/call-site-updater.js.map +1 -1
- package/dist/core/change-signature/change-signature-engine.d.ts +9 -1
- package/dist/core/change-signature/change-signature-engine.d.ts.map +1 -1
- package/dist/core/change-signature/change-signature-engine.js +190 -5
- package/dist/core/change-signature/change-signature-engine.js.map +1 -1
- package/dist/core/change-signature/signature-parser.d.ts +0 -5
- package/dist/core/change-signature/signature-parser.d.ts.map +1 -1
- package/dist/core/change-signature/signature-parser.js +6 -34
- package/dist/core/change-signature/signature-parser.js.map +1 -1
- package/dist/core/deadcode/file-operations.d.ts.map +1 -1
- package/dist/core/deadcode/file-operations.js +3 -1
- package/dist/core/deadcode/file-operations.js.map +1 -1
- package/dist/core/deadcode/import-cleaner.d.ts.map +1 -1
- package/dist/core/deadcode/import-cleaner.js +3 -1
- package/dist/core/deadcode/import-cleaner.js.map +1 -1
- package/dist/core/deadcode/range-expander.d.ts +9 -1
- package/dist/core/deadcode/range-expander.d.ts.map +1 -1
- package/dist/core/deadcode/range-expander.js +115 -41
- package/dist/core/deadcode/range-expander.js.map +1 -1
- package/dist/core/foundations/file-utils.d.ts.map +1 -1
- package/dist/core/foundations/file-utils.js +6 -3
- package/dist/core/foundations/file-utils.js.map +1 -1
- package/dist/core/foundations/indexing/file-index.d.ts +5 -2
- package/dist/core/foundations/indexing/file-index.d.ts.map +1 -1
- package/dist/core/foundations/indexing/file-index.js +11 -3
- package/dist/core/foundations/indexing/file-index.js.map +1 -1
- package/dist/core/foundations/indexing/index-cache-serializer.d.ts +133 -0
- package/dist/core/foundations/indexing/index-cache-serializer.d.ts.map +1 -0
- package/dist/core/foundations/indexing/index-cache-serializer.js +217 -0
- package/dist/core/foundations/indexing/index-cache-serializer.js.map +1 -0
- package/dist/core/foundations/indexing/index-engine.d.ts +11 -5
- package/dist/core/foundations/indexing/index-engine.d.ts.map +1 -1
- package/dist/core/foundations/indexing/index-engine.js +31 -22
- package/dist/core/foundations/indexing/index-engine.js.map +1 -1
- package/dist/core/foundations/indexing/index.d.ts +4 -1
- package/dist/core/foundations/indexing/index.d.ts.map +1 -1
- package/dist/core/foundations/indexing/index.js +2 -1
- package/dist/core/foundations/indexing/index.js.map +1 -1
- package/dist/core/foundations/indexing/symbol-index.d.ts +7 -1
- package/dist/core/foundations/indexing/symbol-index.d.ts.map +1 -1
- package/dist/core/foundations/indexing/symbol-index.js +54 -3
- package/dist/core/foundations/indexing/symbol-index.js.map +1 -1
- package/dist/core/foundations/indexing/types.d.ts +3 -2
- package/dist/core/foundations/indexing/types.d.ts.map +1 -1
- package/dist/core/foundations/indexing/types.js +8 -6
- package/dist/core/foundations/indexing/types.js.map +1 -1
- package/dist/core/foundations/symbol-finder/call-site-parser.d.ts.map +1 -1
- package/dist/core/foundations/symbol-finder/call-site-parser.js +3 -1
- package/dist/core/foundations/symbol-finder/call-site-parser.js.map +1 -1
- package/dist/core/foundations/symbol-finder/symbol-finder.d.ts +0 -2
- package/dist/core/foundations/symbol-finder/symbol-finder.d.ts.map +1 -1
- package/dist/core/foundations/symbol-finder/symbol-finder.js +15 -11
- package/dist/core/foundations/symbol-finder/symbol-finder.js.map +1 -1
- package/dist/core/impact/dependency-extractor.d.ts +11 -3
- package/dist/core/impact/dependency-extractor.d.ts.map +1 -1
- package/dist/core/impact/dependency-extractor.js +149 -34
- package/dist/core/impact/dependency-extractor.js.map +1 -1
- package/dist/core/impact/file-scanner.d.ts.map +1 -1
- package/dist/core/impact/file-scanner.js +3 -2
- package/dist/core/impact/file-scanner.js.map +1 -1
- package/dist/core/impact/impact-analyzer.d.ts +8 -1
- package/dist/core/impact/impact-analyzer.d.ts.map +1 -1
- package/dist/core/impact/impact-analyzer.js +27 -8
- package/dist/core/impact/impact-analyzer.js.map +1 -1
- package/dist/core/impact/path-resolver.d.ts.map +1 -1
- package/dist/core/impact/path-resolver.js +11 -10
- package/dist/core/impact/path-resolver.js.map +1 -1
- package/dist/core/impact/types.d.ts.map +1 -1
- package/dist/core/impact/types.js +2 -1
- package/dist/core/impact/types.js.map +1 -1
- package/dist/core/move/file-scanner.d.ts +12 -0
- package/dist/core/move/file-scanner.d.ts.map +1 -1
- package/dist/core/move/file-scanner.js +58 -30
- package/dist/core/move/file-scanner.js.map +1 -1
- package/dist/core/move/glob-move-planner.d.ts +29 -0
- package/dist/core/move/glob-move-planner.d.ts.map +1 -0
- package/dist/core/move/glob-move-planner.js +48 -0
- package/dist/core/move/glob-move-planner.js.map +1 -0
- package/dist/core/move/index.d.ts +2 -0
- package/dist/core/move/index.d.ts.map +1 -1
- package/dist/core/move/index.js +1 -0
- package/dist/core/move/index.js.map +1 -1
- package/dist/core/move/move-engine.js +2 -2
- package/dist/core/move/move-engine.js.map +1 -1
- package/dist/core/move/path-calculator.d.ts +2 -0
- package/dist/core/move/path-calculator.d.ts.map +1 -1
- package/dist/core/move/path-calculator.js +36 -16
- package/dist/core/move/path-calculator.js.map +1 -1
- package/dist/core/move/path-utils.d.ts +2 -1
- package/dist/core/move/path-utils.d.ts.map +1 -1
- package/dist/core/move/path-utils.js +18 -28
- package/dist/core/move/path-utils.js.map +1 -1
- package/dist/core/move-member/change-applier.d.ts.map +1 -1
- package/dist/core/move-member/change-applier.js +3 -1
- package/dist/core/move-member/change-applier.js.map +1 -1
- package/dist/core/move-member/extractors/typescript-extractor.d.ts.map +1 -1
- package/dist/core/move-member/extractors/typescript-extractor.js +32 -28
- package/dist/core/move-member/extractors/typescript-extractor.js.map +1 -1
- package/dist/core/move-member/file-change-preparer.d.ts +5 -0
- package/dist/core/move-member/file-change-preparer.d.ts.map +1 -1
- package/dist/core/move-member/file-change-preparer.js +51 -11
- package/dist/core/move-member/file-change-preparer.js.map +1 -1
- package/dist/core/move-member/member-extractor.d.ts +0 -2
- package/dist/core/move-member/member-extractor.d.ts.map +1 -1
- package/dist/core/move-member/member-extractor.js +13 -22
- package/dist/core/move-member/member-extractor.js.map +1 -1
- package/dist/core/move-member/move-member-engine.d.ts +0 -1
- package/dist/core/move-member/move-member-engine.d.ts.map +1 -1
- package/dist/core/move-member/move-member-engine.js +0 -2
- package/dist/core/move-member/move-member-engine.js.map +1 -1
- package/dist/core/move-member/reference-updater.d.ts.map +1 -1
- package/dist/core/move-member/reference-updater.js +7 -10
- package/dist/core/move-member/reference-updater.js.map +1 -1
- package/dist/core/rename/reference-updater.d.ts +1 -0
- package/dist/core/rename/reference-updater.d.ts.map +1 -1
- package/dist/core/rename/reference-updater.js +48 -46
- package/dist/core/rename/reference-updater.js.map +1 -1
- package/dist/core/rename/rename-engine.d.ts +0 -1
- package/dist/core/rename/rename-engine.d.ts.map +1 -1
- package/dist/core/rename/rename-engine.js +9 -22
- package/dist/core/rename/rename-engine.js.map +1 -1
- package/dist/infrastructure/cache/cache-manager.d.ts.map +1 -1
- package/dist/infrastructure/cache/cache-manager.js +4 -5
- package/dist/infrastructure/cache/cache-manager.js.map +1 -1
- package/dist/infrastructure/cache/index-disk-cache.d.ts +46 -0
- package/dist/infrastructure/cache/index-disk-cache.d.ts.map +1 -0
- package/dist/infrastructure/cache/index-disk-cache.js +150 -0
- package/dist/infrastructure/cache/index-disk-cache.js.map +1 -0
- package/dist/infrastructure/cache/index.d.ts.map +1 -1
- package/dist/infrastructure/cache/index.js +1 -0
- package/dist/infrastructure/cache/index.js.map +1 -1
- package/dist/infrastructure/cache/memory-cache.d.ts.map +1 -1
- package/dist/infrastructure/cache/memory-cache.js +3 -1
- package/dist/infrastructure/cache/memory-cache.js.map +1 -1
- package/dist/infrastructure/formatters/index.d.ts +1 -2
- package/dist/infrastructure/formatters/index.d.ts.map +1 -1
- package/dist/infrastructure/formatters/index.js +1 -2
- package/dist/infrastructure/formatters/index.js.map +1 -1
- package/dist/infrastructure/formatters/query-formatter.d.ts.map +1 -1
- package/dist/infrastructure/formatters/query-formatter.js +9 -18
- package/dist/infrastructure/formatters/query-formatter.js.map +1 -1
- package/dist/infrastructure/formatters/query-types.d.ts +15 -145
- package/dist/infrastructure/formatters/query-types.d.ts.map +1 -1
- package/dist/infrastructure/formatters/query-types.js +3 -18
- package/dist/infrastructure/formatters/query-types.js.map +1 -1
- package/dist/infrastructure/formatters/strategies/base-formatter.d.ts +1 -20
- package/dist/infrastructure/formatters/strategies/base-formatter.d.ts.map +1 -1
- package/dist/infrastructure/formatters/strategies/base-formatter.js +0 -8
- package/dist/infrastructure/formatters/strategies/base-formatter.js.map +1 -1
- package/dist/infrastructure/formatters/strategies/call-hierarchy-formatter.d.ts.map +1 -1
- package/dist/infrastructure/formatters/strategies/call-hierarchy-formatter.js +7 -0
- package/dist/infrastructure/formatters/strategies/call-hierarchy-formatter.js.map +1 -1
- package/dist/infrastructure/formatters/strategies/cycles-formatter.d.ts +15 -0
- package/dist/infrastructure/formatters/strategies/cycles-formatter.d.ts.map +1 -0
- package/dist/infrastructure/formatters/strategies/cycles-formatter.js +29 -0
- package/dist/infrastructure/formatters/strategies/cycles-formatter.js.map +1 -0
- package/dist/infrastructure/formatters/strategies/impact-formatter.d.ts +15 -0
- package/dist/infrastructure/formatters/strategies/impact-formatter.d.ts.map +1 -0
- package/dist/infrastructure/formatters/strategies/impact-formatter.js +31 -0
- package/dist/infrastructure/formatters/strategies/impact-formatter.js.map +1 -0
- package/dist/infrastructure/formatters/strategies/index.d.ts +3 -4
- package/dist/infrastructure/formatters/strategies/index.d.ts.map +1 -1
- package/dist/infrastructure/formatters/strategies/index.js +3 -4
- package/dist/infrastructure/formatters/strategies/index.js.map +1 -1
- package/dist/infrastructure/logging/index.d.ts +2 -0
- package/dist/infrastructure/logging/index.d.ts.map +1 -0
- package/dist/infrastructure/logging/index.js +2 -0
- package/dist/infrastructure/logging/index.js.map +1 -0
- package/dist/infrastructure/logging/logger.d.ts +25 -0
- package/dist/infrastructure/logging/logger.d.ts.map +1 -0
- package/dist/infrastructure/logging/logger.js +54 -0
- package/dist/infrastructure/logging/logger.js.map +1 -0
- package/dist/infrastructure/parser/analysis-types.d.ts.map +1 -1
- package/dist/infrastructure/parser/base.d.ts +1 -6
- package/dist/infrastructure/parser/base.d.ts.map +1 -1
- package/dist/infrastructure/parser/base.js +4 -16
- package/dist/infrastructure/parser/base.js.map +1 -1
- package/dist/infrastructure/parser/index.d.ts +2 -2
- package/dist/infrastructure/parser/index.d.ts.map +1 -1
- package/dist/infrastructure/parser/index.js +1 -1
- package/dist/infrastructure/parser/index.js.map +1 -1
- package/dist/infrastructure/parser/interface.d.ts +0 -7
- package/dist/infrastructure/parser/interface.d.ts.map +1 -1
- package/dist/infrastructure/parser/interface.js +0 -1
- package/dist/infrastructure/parser/interface.js.map +1 -1
- package/dist/infrastructure/parser/registry.d.ts.map +1 -1
- package/dist/infrastructure/parser/registry.js +2 -1
- package/dist/infrastructure/parser/registry.js.map +1 -1
- package/dist/infrastructure/parser/types.d.ts +12 -3
- package/dist/infrastructure/parser/types.d.ts.map +1 -1
- package/dist/infrastructure/parser/types.js +7 -2
- package/dist/infrastructure/parser/types.js.map +1 -1
- package/dist/infrastructure/storage/file-system.d.ts.map +1 -1
- package/dist/infrastructure/storage/file-system.js +5 -1
- package/dist/infrastructure/storage/file-system.js.map +1 -1
- package/dist/interfaces/cli/cached-index-engine.d.ts +25 -0
- package/dist/interfaces/cli/cached-index-engine.d.ts.map +1 -0
- package/dist/interfaces/cli/cached-index-engine.js +59 -0
- package/dist/interfaces/cli/cached-index-engine.js.map +1 -0
- package/dist/interfaces/cli/cli.d.ts +1 -0
- package/dist/interfaces/cli/cli.d.ts.map +1 -1
- package/dist/interfaces/cli/cli.js +33 -19
- package/dist/interfaces/cli/cli.js.map +1 -1
- package/dist/interfaces/cli/command-utils.d.ts +17 -1
- package/dist/interfaces/cli/command-utils.d.ts.map +1 -1
- package/dist/interfaces/cli/command-utils.js +53 -3
- package/dist/interfaces/cli/command-utils.js.map +1 -1
- package/dist/interfaces/cli/commands/call-hierarchy.command.d.ts.map +1 -1
- package/dist/interfaces/cli/commands/call-hierarchy.command.js +57 -17
- package/dist/interfaces/cli/commands/call-hierarchy.command.js.map +1 -1
- package/dist/interfaces/cli/commands/change-signature.command.d.ts +12 -0
- package/dist/interfaces/cli/commands/change-signature.command.d.ts.map +1 -1
- package/dist/interfaces/cli/commands/change-signature.command.js +131 -12
- package/dist/interfaces/cli/commands/change-signature.command.js.map +1 -1
- package/dist/interfaces/cli/commands/cycles.command.d.ts +1 -1
- package/dist/interfaces/cli/commands/cycles.command.d.ts.map +1 -1
- package/dist/interfaces/cli/commands/cycles.command.js +13 -11
- package/dist/interfaces/cli/commands/cycles.command.js.map +1 -1
- package/dist/interfaces/cli/commands/deadcode.command.d.ts.map +1 -1
- package/dist/interfaces/cli/commands/deadcode.command.js +18 -19
- package/dist/interfaces/cli/commands/deadcode.command.js.map +1 -1
- package/dist/interfaces/cli/commands/find-references.command.d.ts.map +1 -1
- package/dist/interfaces/cli/commands/find-references.command.js +35 -11
- package/dist/interfaces/cli/commands/find-references.command.js.map +1 -1
- package/dist/interfaces/cli/commands/impact.command.d.ts +1 -1
- package/dist/interfaces/cli/commands/impact.command.js +6 -13
- package/dist/interfaces/cli/commands/impact.command.js.map +1 -1
- package/dist/interfaces/cli/commands/index.d.ts +1 -1
- package/dist/interfaces/cli/commands/index.d.ts.map +1 -1
- package/dist/interfaces/cli/commands/index.js +1 -1
- package/dist/interfaces/cli/commands/index.js.map +1 -1
- package/dist/interfaces/cli/commands/move-command-options.d.ts +14 -0
- package/dist/interfaces/cli/commands/move-command-options.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/move-command-options.js +2 -0
- package/dist/interfaces/cli/commands/move-command-options.js.map +1 -0
- package/dist/interfaces/cli/commands/move-glob-command-handler.d.ts +8 -0
- package/dist/interfaces/cli/commands/move-glob-command-handler.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/move-glob-command-handler.js +186 -0
- package/dist/interfaces/cli/commands/move-glob-command-handler.js.map +1 -0
- package/dist/interfaces/cli/commands/move.command.d.ts.map +1 -1
- package/dist/interfaces/cli/commands/move.command.js +62 -241
- package/dist/interfaces/cli/commands/move.command.js.map +1 -1
- package/dist/interfaces/cli/commands/rename.command.d.ts.map +1 -1
- package/dist/interfaces/cli/commands/rename.command.js +40 -26
- package/dist/interfaces/cli/commands/rename.command.js.map +1 -1
- package/dist/interfaces/cli/commands/search.command.d.ts +11 -0
- package/dist/interfaces/cli/commands/search.command.d.ts.map +1 -0
- package/dist/interfaces/cli/commands/search.command.js +110 -0
- package/dist/interfaces/cli/commands/search.command.js.map +1 -0
- package/dist/interfaces/cli/unified-output-handler.d.ts +5 -0
- package/dist/interfaces/cli/unified-output-handler.d.ts.map +1 -1
- package/dist/interfaces/cli/unified-output-handler.js +8 -1
- package/dist/interfaces/cli/unified-output-handler.js.map +1 -1
- package/dist/plugins/javascript/declaration-analyzer.d.ts.map +1 -1
- package/dist/plugins/javascript/declaration-analyzer.js +5 -2
- package/dist/plugins/javascript/declaration-analyzer.js.map +1 -1
- package/dist/plugins/javascript/parser.d.ts +6 -4
- package/dist/plugins/javascript/parser.d.ts.map +1 -1
- package/dist/plugins/javascript/parser.js +97 -15
- package/dist/plugins/javascript/parser.js.map +1 -1
- package/dist/plugins/javascript/reference-finder.d.ts.map +1 -1
- package/dist/plugins/javascript/reference-finder.js +3 -1
- package/dist/plugins/javascript/reference-finder.js.map +1 -1
- package/dist/plugins/javascript/types.js +10 -10
- package/dist/plugins/javascript/types.js.map +1 -1
- package/dist/plugins/shared/constants.d.ts +1 -1
- package/dist/plugins/shared/constants.d.ts.map +1 -1
- package/dist/plugins/shared/constants.js +7 -1
- package/dist/plugins/shared/constants.js.map +1 -1
- package/dist/plugins/shared/parser-helpers.d.ts.map +1 -1
- package/dist/plugins/shared/parser-helpers.js +1 -0
- package/dist/plugins/shared/parser-helpers.js.map +1 -1
- package/dist/plugins/shared/utils/memory-monitor.d.ts.map +1 -1
- package/dist/plugins/shared/utils/memory-monitor.js +3 -2
- package/dist/plugins/shared/utils/memory-monitor.js.map +1 -1
- package/dist/plugins/shared/utils/object.d.ts.map +1 -1
- package/dist/plugins/shared/utils/object.js +8 -12
- package/dist/plugins/shared/utils/object.js.map +1 -1
- package/dist/plugins/typescript/declaration-analyzer.d.ts.map +1 -1
- package/dist/plugins/typescript/declaration-analyzer.js +9 -4
- package/dist/plugins/typescript/declaration-analyzer.js.map +1 -1
- package/dist/plugins/typescript/language-service.js +1 -1
- package/dist/plugins/typescript/language-service.js.map +1 -1
- package/dist/plugins/typescript/parser.d.ts +1 -6
- package/dist/plugins/typescript/parser.d.ts.map +1 -1
- package/dist/plugins/typescript/parser.js +7 -33
- package/dist/plugins/typescript/parser.js.map +1 -1
- package/dist/plugins/typescript/pattern-analyzer.d.ts.map +1 -1
- package/dist/plugins/typescript/pattern-analyzer.js +3 -1
- package/dist/plugins/typescript/pattern-analyzer.js.map +1 -1
- package/dist/plugins/typescript/reference-finder.d.ts.map +1 -1
- package/dist/plugins/typescript/reference-finder.js +3 -1
- package/dist/plugins/typescript/reference-finder.js.map +1 -1
- package/dist/plugins/typescript/tsconfig-loader.d.ts.map +1 -1
- package/dist/plugins/typescript/tsconfig-loader.js +162 -24
- package/dist/plugins/typescript/tsconfig-loader.js.map +1 -1
- package/dist/plugins/typescript/types.js +3 -3
- package/dist/plugins/typescript/types.js.map +1 -1
- package/dist/shared/errors/diagnostic-collector.d.ts +47 -0
- package/dist/shared/errors/diagnostic-collector.d.ts.map +1 -0
- package/dist/shared/errors/diagnostic-collector.js +89 -0
- package/dist/shared/errors/diagnostic-collector.js.map +1 -0
- package/dist/shared/errors/index.d.ts +3 -0
- package/dist/shared/errors/index.d.ts.map +1 -1
- package/dist/shared/errors/index.js +5 -1
- package/dist/shared/errors/index.js.map +1 -1
- package/dist/shared/types/index.d.ts +1 -0
- package/dist/shared/types/index.d.ts.map +1 -1
- package/dist/shared/types/index.js +2 -0
- package/dist/shared/types/index.js.map +1 -1
- package/dist/shared/types/source-file-extensions.d.ts +14 -0
- package/dist/shared/types/source-file-extensions.d.ts.map +1 -0
- package/dist/shared/types/source-file-extensions.js +42 -0
- package/dist/shared/types/source-file-extensions.js.map +1 -0
- package/dist/shared/types/symbol.d.ts +1 -0
- package/dist/shared/types/symbol.d.ts.map +1 -1
- package/dist/shared/types/symbol.js.map +1 -1
- package/package.json +18 -12
- package/dist/application/events/event-bus.d.ts +0 -107
- package/dist/application/events/event-bus.d.ts.map +0 -1
- package/dist/application/events/event-bus.js +0 -369
- package/dist/application/events/event-bus.js.map +0 -1
- package/dist/application/events/event-types.d.ts +0 -195
- package/dist/application/events/event-types.d.ts.map +0 -1
- package/dist/application/events/event-types.js +0 -36
- package/dist/application/events/event-types.js.map +0 -1
- package/dist/application/events/index.d.ts +0 -6
- package/dist/application/events/index.d.ts.map +0 -1
- package/dist/application/events/index.js +0 -6
- package/dist/application/events/index.js.map +0 -1
- package/dist/application/index.d.ts +0 -76
- package/dist/application/index.d.ts.map +0 -1
- package/dist/application/index.js +0 -127
- package/dist/application/index.js.map +0 -1
- package/dist/application/services/cache-coordinator.service.d.ts +0 -69
- package/dist/application/services/cache-coordinator.service.d.ts.map +0 -1
- package/dist/application/services/cache-coordinator.service.js +0 -251
- package/dist/application/services/cache-coordinator.service.js.map +0 -1
- package/dist/application/services/error-handler.service.d.ts +0 -56
- package/dist/application/services/error-handler.service.d.ts.map +0 -1
- package/dist/application/services/error-handler.service.js +0 -273
- package/dist/application/services/error-handler.service.js.map +0 -1
- package/dist/application/services/index.d.ts +0 -8
- package/dist/application/services/index.d.ts.map +0 -1
- package/dist/application/services/index.js +0 -8
- package/dist/application/services/index.js.map +0 -1
- package/dist/application/services/module-coordinator.service.d.ts +0 -55
- package/dist/application/services/module-coordinator.service.d.ts.map +0 -1
- package/dist/application/services/module-coordinator.service.js +0 -185
- package/dist/application/services/module-coordinator.service.js.map +0 -1
- package/dist/application/services/session-manager.service.d.ts +0 -86
- package/dist/application/services/session-manager.service.d.ts.map +0 -1
- package/dist/application/services/session-manager.service.js +0 -321
- package/dist/application/services/session-manager.service.js.map +0 -1
- package/dist/application/state/application-state.d.ts +0 -164
- package/dist/application/state/application-state.d.ts.map +0 -1
- package/dist/application/state/application-state.js +0 -290
- package/dist/application/state/application-state.js.map +0 -1
- package/dist/application/state/index.d.ts +0 -15
- package/dist/application/state/index.d.ts.map +0 -1
- package/dist/application/state/index.js +0 -15
- package/dist/application/state/index.js.map +0 -1
- package/dist/application/state/session-state.d.ts +0 -114
- package/dist/application/state/session-state.d.ts.map +0 -1
- package/dist/application/state/session-state.js +0 -188
- package/dist/application/state/session-state.js.map +0 -1
- package/dist/application/state/state-manager.d.ts +0 -122
- package/dist/application/state/state-manager.d.ts.map +0 -1
- package/dist/application/state/state-manager.js +0 -234
- package/dist/application/state/state-manager.js.map +0 -1
- package/dist/application/types.d.ts +0 -217
- package/dist/application/types.d.ts.map +0 -1
- package/dist/application/types.js +0 -5
- package/dist/application/types.js.map +0 -1
- package/dist/core/find-references/index.d.ts +0 -12
- package/dist/core/find-references/index.d.ts.map +0 -1
- package/dist/core/find-references/index.js +0 -14
- package/dist/core/find-references/index.js.map +0 -1
- package/dist/core/find-references/reference-finder-engine.d.ts +0 -75
- package/dist/core/find-references/reference-finder-engine.d.ts.map +0 -1
- package/dist/core/find-references/reference-finder-engine.js +0 -87
- package/dist/core/find-references/reference-finder-engine.js.map +0 -1
- package/dist/core/find-references/types.d.ts +0 -6
- package/dist/core/find-references/types.d.ts.map +0 -1
- package/dist/core/find-references/types.js +0 -7
- package/dist/core/find-references/types.js.map +0 -1
- package/dist/core/snapshot/index.d.ts +0 -9
- package/dist/core/snapshot/index.d.ts.map +0 -1
- package/dist/core/snapshot/index.js +0 -7
- package/dist/core/snapshot/index.js.map +0 -1
- package/dist/core/snapshot/snapshot-cache.d.ts +0 -103
- package/dist/core/snapshot/snapshot-cache.d.ts.map +0 -1
- package/dist/core/snapshot/snapshot-cache.js +0 -249
- package/dist/core/snapshot/snapshot-cache.js.map +0 -1
- package/dist/core/snapshot/snapshot-generator.d.ts +0 -79
- package/dist/core/snapshot/snapshot-generator.d.ts.map +0 -1
- package/dist/core/snapshot/snapshot-generator.js +0 -381
- package/dist/core/snapshot/snapshot-generator.js.map +0 -1
- package/dist/core/snapshot/types.d.ts +0 -67
- package/dist/core/snapshot/types.d.ts.map +0 -1
- package/dist/core/snapshot/types.js +0 -25
- package/dist/core/snapshot/types.js.map +0 -1
- package/dist/core/snapshot/utils/bracket-balancer.d.ts +0 -27
- package/dist/core/snapshot/utils/bracket-balancer.d.ts.map +0 -1
- package/dist/core/snapshot/utils/bracket-balancer.js +0 -70
- package/dist/core/snapshot/utils/bracket-balancer.js.map +0 -1
- package/dist/core/snapshot/utils/factory-pattern-detector.d.ts +0 -22
- package/dist/core/snapshot/utils/factory-pattern-detector.d.ts.map +0 -1
- package/dist/core/snapshot/utils/factory-pattern-detector.js +0 -70
- package/dist/core/snapshot/utils/factory-pattern-detector.js.map +0 -1
- package/dist/core/snapshot/utils/index.d.ts +0 -7
- package/dist/core/snapshot/utils/index.d.ts.map +0 -1
- package/dist/core/snapshot/utils/index.js +0 -7
- package/dist/core/snapshot/utils/index.js.map +0 -1
- package/dist/core/snapshot/utils/symbol-formatter.d.ts +0 -37
- package/dist/core/snapshot/utils/symbol-formatter.d.ts.map +0 -1
- package/dist/core/snapshot/utils/symbol-formatter.js +0 -89
- package/dist/core/snapshot/utils/symbol-formatter.js.map +0 -1
- package/dist/infrastructure/formatters/diff-utils.d.ts +0 -24
- package/dist/infrastructure/formatters/diff-utils.d.ts.map +0 -1
- package/dist/infrastructure/formatters/diff-utils.js +0 -104
- package/dist/infrastructure/formatters/diff-utils.js.map +0 -1
- package/dist/infrastructure/formatters/preview-converter.d.ts +0 -148
- package/dist/infrastructure/formatters/preview-converter.d.ts.map +0 -1
- package/dist/infrastructure/formatters/preview-converter.js +0 -329
- package/dist/infrastructure/formatters/preview-converter.js.map +0 -1
- package/dist/infrastructure/formatters/strategies/analyze-formatter.d.ts +0 -24
- package/dist/infrastructure/formatters/strategies/analyze-formatter.d.ts.map +0 -1
- package/dist/infrastructure/formatters/strategies/analyze-formatter.js +0 -102
- package/dist/infrastructure/formatters/strategies/analyze-formatter.js.map +0 -1
- package/dist/infrastructure/formatters/strategies/deps-formatter.d.ts +0 -15
- package/dist/infrastructure/formatters/strategies/deps-formatter.d.ts.map +0 -1
- package/dist/infrastructure/formatters/strategies/deps-formatter.js +0 -47
- package/dist/infrastructure/formatters/strategies/deps-formatter.js.map +0 -1
- package/dist/infrastructure/formatters/strategies/snapshot-formatter.d.ts +0 -20
- package/dist/infrastructure/formatters/strategies/snapshot-formatter.d.ts.map +0 -1
- package/dist/infrastructure/formatters/strategies/snapshot-formatter.js +0 -101
- package/dist/infrastructure/formatters/strategies/snapshot-formatter.js.map +0 -1
- package/dist/interfaces/cli/commands/snapshot.command.d.ts +0 -11
- package/dist/interfaces/cli/commands/snapshot.command.d.ts.map +0 -1
- package/dist/interfaces/cli/commands/snapshot.command.js +0 -86
- package/dist/interfaces/cli/commands/snapshot.command.js.map +0 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createAndIndexWithCache
|
|
3
|
+
* 建立 IndexEngine 並嘗試從磁碟快取載入(hit 時跳過 indexProject)
|
|
4
|
+
*/
|
|
5
|
+
import { createHash } from 'crypto';
|
|
6
|
+
import { IndexEngine, createIndexConfig } from '../../core/foundations/indexing/index.js';
|
|
7
|
+
import { IndexDiskCache } from '../../infrastructure/cache/index-disk-cache.js';
|
|
8
|
+
import { logger } from '../../infrastructure/logging/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* 建立並索引 IndexEngine,支援磁碟持久化快取
|
|
11
|
+
*
|
|
12
|
+
* 流程:
|
|
13
|
+
* 1. 建立 IndexEngine
|
|
14
|
+
* 2. noCache → 直接 indexProject
|
|
15
|
+
* 3. 計算 cache key → 嘗試載入快取
|
|
16
|
+
* 4. hit → hydrate(跳過 indexProject)
|
|
17
|
+
* 5. miss → indexProject → save cache
|
|
18
|
+
*/
|
|
19
|
+
export async function createAndIndexWithCache(projectPath, fileSystem, configDefaults, options) {
|
|
20
|
+
const indexConfig = createIndexConfig(projectPath, configDefaults);
|
|
21
|
+
const indexEngine = new IndexEngine(indexConfig, fileSystem);
|
|
22
|
+
// 測試環境自動 noCache(避免污染 ~/.cache)
|
|
23
|
+
const isTestEnv = process.env.NODE_ENV === 'test' || process.env.VITEST === 'true';
|
|
24
|
+
const effectiveNoCache = options.noCache || isTestEnv;
|
|
25
|
+
if (effectiveNoCache) {
|
|
26
|
+
logger.verbose('cache', `Cache disabled, indexing ${projectPath}`);
|
|
27
|
+
await indexEngine.indexProject(projectPath);
|
|
28
|
+
return indexEngine;
|
|
29
|
+
}
|
|
30
|
+
// configDefaults hash(前 8 碼),不同命令設定不同快取目錄隔離
|
|
31
|
+
const configKey = createHash('sha256')
|
|
32
|
+
.update(JSON.stringify(Object.fromEntries(Object.entries(configDefaults).sort())))
|
|
33
|
+
.digest('hex')
|
|
34
|
+
.slice(0, 8);
|
|
35
|
+
const diskCache = new IndexDiskCache(projectPath, configKey, options.cacheDir);
|
|
36
|
+
// 計算當前 cache key
|
|
37
|
+
const currentKey = await diskCache.computeCacheKey(projectPath, fileSystem);
|
|
38
|
+
// 嘗試載入快取
|
|
39
|
+
const cached = await diskCache.load();
|
|
40
|
+
if (cached && cached.cacheKey === currentKey) {
|
|
41
|
+
// cache hit → hydrate(跳過 indexProject)
|
|
42
|
+
const hydrated = diskCache.hydrateEngine(indexEngine, cached);
|
|
43
|
+
if (hydrated) {
|
|
44
|
+
logger.verbose('cache', 'Cache HIT — hydrating index');
|
|
45
|
+
return indexEngine;
|
|
46
|
+
}
|
|
47
|
+
// hydrate 失敗 → fallthrough 重新 index
|
|
48
|
+
logger.verbose('cache', 'Cache hydrate failed, re-indexing');
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
logger.verbose('cache', 'Cache MISS — full index');
|
|
52
|
+
}
|
|
53
|
+
// cache miss 或 hydrate 失敗 → 完整索引 + 儲存快取
|
|
54
|
+
await indexEngine.indexProject(projectPath);
|
|
55
|
+
await diskCache.save(indexEngine, currentKey);
|
|
56
|
+
logger.verbose('cache', 'Cache saved');
|
|
57
|
+
return indexEngine;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=cached-index-engine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cached-index-engine.js","sourceRoot":"","sources":["../../../src/interfaces/cli/cached-index-engine.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,EACL,WAAW,EACX,iBAAiB,EAElB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAU1D;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,WAAmB,EACnB,UAAuB,EACvB,cAAoC,EACpC,OAAqB;IAErB,MAAM,WAAW,GAAG,iBAAiB,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IACnE,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IAE7D,gCAAgC;IAChC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,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C,OAAO,CAAC,OAAO,EAAE,yBAAyB,CAAC,CAAC;IACrD,CAAC;IAED,wCAAwC;IACxC,MAAM,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IAC5C,MAAM,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IAC9C,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAEvC,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../src/interfaces/cli/cli.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../src/interfaces/cli/cli.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAwBhF,wBAAgB,kBAAkB,CAAC,UAAU,GAAE,MAAwB,GAAG,MAAM,CAa/E;AAID,qBAAa,WAAW;IACtB,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,UAAU,CAAc;IAEhC;;;OAGG;gBACS,UAAU,CAAC,EAAE,WAAW;IAQpC;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,WAAW,GAAG,WAAW;IAI7D;;OAEG;IACG,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxC,OAAO,CAAC,iBAAiB;IA6CzB,OAAO,CAAC,aAAa;IAkCrB;;OAEG;IACH,OAAO,CAAC,oBAAoB;CAK7B"}
|
|
@@ -7,7 +7,9 @@ import { ParserRegistry } from '../../infrastructure/parser/registry.js';
|
|
|
7
7
|
import { TypeScriptParser } from '../../plugins/typescript/parser.js';
|
|
8
8
|
import { JavaScriptParser } from '../../plugins/javascript/parser.js';
|
|
9
9
|
import { FileSystem } from '../../infrastructure/storage/index.js';
|
|
10
|
-
import {
|
|
10
|
+
import { logger, LogLevel } from '../../infrastructure/logging/index.js';
|
|
11
|
+
import { diagnostics } from '../../shared/errors/diagnostic-collector.js';
|
|
12
|
+
import { setupMoveCommand, setupRenameCommand, setupChangeSignatureCommand, setupCyclesCommand, setupImpactCommand, setupFindReferencesCommand, setupCallHierarchyCommand, setupDeadCodeCommand, setupSearchCommand } from '../cli/commands/index.js';
|
|
11
13
|
import { readFileSync } from 'fs';
|
|
12
14
|
import * as path from 'path';
|
|
13
15
|
import { fileURLToPath } from 'url';
|
|
@@ -15,14 +17,20 @@ import { fileURLToPath } from 'url';
|
|
|
15
17
|
const __filename = fileURLToPath(import.meta.url);
|
|
16
18
|
const __dirname = path.dirname(__filename);
|
|
17
19
|
const packageJsonPath = path.resolve(__dirname, '../../../package.json');
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
catch {
|
|
24
|
-
|
|
20
|
+
export function readPackageVersion(targetPath = packageJsonPath) {
|
|
21
|
+
let packageJson;
|
|
22
|
+
try {
|
|
23
|
+
packageJson = JSON.parse(readFileSync(targetPath, 'utf-8'));
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
throw new Error(`Cannot read package version from ${targetPath}: ${error instanceof Error ? error.message : String(error)}`);
|
|
27
|
+
}
|
|
28
|
+
if (typeof packageJson.version !== 'string' || packageJson.version.trim().length === 0) {
|
|
29
|
+
throw new Error(`Invalid package version in ${targetPath}`);
|
|
30
|
+
}
|
|
31
|
+
return packageJson.version;
|
|
25
32
|
}
|
|
33
|
+
const packageVersion = readPackageVersion();
|
|
26
34
|
export class AgentIdeCLI {
|
|
27
35
|
program;
|
|
28
36
|
fileSystem;
|
|
@@ -54,7 +62,7 @@ export class AgentIdeCLI {
|
|
|
54
62
|
const registry = ParserRegistry.getInstance();
|
|
55
63
|
// 檢查 registry 是否可用
|
|
56
64
|
if (!registry) {
|
|
57
|
-
|
|
65
|
+
logger.verbose('parser', 'Parser registry not available');
|
|
58
66
|
return;
|
|
59
67
|
}
|
|
60
68
|
// 在測試環境中,檢查是否已經有測試 Parser 註冊
|
|
@@ -74,9 +82,7 @@ export class AgentIdeCLI {
|
|
|
74
82
|
}
|
|
75
83
|
}
|
|
76
84
|
catch (tsError) {
|
|
77
|
-
|
|
78
|
-
console.debug('TypeScript parser loading failed:', tsError);
|
|
79
|
-
console.debug('TypeScript Parser initialization warning:', tsError);
|
|
85
|
+
logger.verbose('parser', `TypeScript parser loading failed: ${tsError}`);
|
|
80
86
|
}
|
|
81
87
|
// 嘗試註冊內建的 JavaScript Parser
|
|
82
88
|
try {
|
|
@@ -86,21 +92,29 @@ export class AgentIdeCLI {
|
|
|
86
92
|
}
|
|
87
93
|
}
|
|
88
94
|
catch (jsError) {
|
|
89
|
-
|
|
90
|
-
console.debug('JavaScript parser loading failed:', jsError);
|
|
91
|
-
console.debug('JavaScript Parser initialization warning:', jsError);
|
|
95
|
+
logger.verbose('parser', `JavaScript parser loading failed: ${jsError}`);
|
|
92
96
|
}
|
|
93
97
|
}
|
|
94
98
|
catch (error) {
|
|
95
|
-
|
|
96
|
-
console.debug('Parser initialization warning:', error);
|
|
99
|
+
logger.verbose('parser', `Parser initialization warning: ${error}`);
|
|
97
100
|
}
|
|
98
101
|
}
|
|
99
102
|
setupCommands() {
|
|
100
103
|
this.program
|
|
101
104
|
.name('agent-ide')
|
|
102
105
|
.description('程式碼智能工具集 for AI Agents')
|
|
103
|
-
.version(packageVersion)
|
|
106
|
+
.version(packageVersion)
|
|
107
|
+
.option('--no-cache', '停用索引快取')
|
|
108
|
+
.option('--cache-dir <path>', '覆寫索引快取目錄')
|
|
109
|
+
.option('--verbose', '顯示詳細處理資訊');
|
|
110
|
+
this.program.hook('preAction', (thisCommand) => {
|
|
111
|
+
const opts = thisCommand.optsWithGlobals();
|
|
112
|
+
logger.setLevel(opts.verbose ? LogLevel.Verbose : LogLevel.Normal);
|
|
113
|
+
diagnostics.setSink({
|
|
114
|
+
warn: (module, message) => logger.warn(module, message),
|
|
115
|
+
error: (module, message) => logger.error(module, message)
|
|
116
|
+
});
|
|
117
|
+
});
|
|
104
118
|
const context = this.createCommandContext();
|
|
105
119
|
// Transform 命令
|
|
106
120
|
setupRenameCommand(this.program, context);
|
|
@@ -109,10 +123,10 @@ export class AgentIdeCLI {
|
|
|
109
123
|
// Query 命令
|
|
110
124
|
setupCyclesCommand(this.program, context);
|
|
111
125
|
setupImpactCommand(this.program, context);
|
|
112
|
-
setupSnapshotCommand(this.program, context);
|
|
113
126
|
setupFindReferencesCommand(this.program, context);
|
|
114
127
|
setupCallHierarchyCommand(this.program, context);
|
|
115
128
|
setupDeadCodeCommand(this.program, context);
|
|
129
|
+
setupSearchCommand(this.program, context);
|
|
116
130
|
}
|
|
117
131
|
/**
|
|
118
132
|
* 建立命令共用 Context
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/interfaces/cli/cli.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAoB,MAAM,kCAAkC,CAAC;AAChF,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,2BAA2B,EAC3B,kBAAkB,EAClB,kBAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/interfaces/cli/cli.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAA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,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IAED;;OAEG;IACK,oBAAoB;QAC1B,OAAO;YACL,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* 提供格式驗證和變更類命令執行的共用邏輯
|
|
4
4
|
*/
|
|
5
5
|
import { type Changeset } from '../../infrastructure/changeset/index.js';
|
|
6
|
-
import type
|
|
6
|
+
import { PreviewCommand, type PreviewInput } from '../../infrastructure/formatters/index.js';
|
|
7
7
|
import type { IFileSystem } from '../../infrastructure/storage/file-system.interface.js';
|
|
8
8
|
import { OutputFormat, type UnifiedOutputHandler } from '../cli/unified-output-handler.js';
|
|
9
9
|
/** 格式驗證結果(使用 discriminated union 以支援類型收窄) */
|
|
@@ -30,6 +30,14 @@ export type FormatParseResult = {
|
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
32
|
export declare function tryParseOutputFormat(formatStr: string, allowDiff: boolean, outputHandler?: UnifiedOutputHandler): FormatParseResult;
|
|
33
|
+
/**
|
|
34
|
+
* 驗證 CLI 輸入路徑存在,失敗時輸出統一錯誤並設定 exitCode。
|
|
35
|
+
*/
|
|
36
|
+
export declare function ensurePathExists(pathToCheck: string, fileSystem: IFileSystem, outputHandler: UnifiedOutputHandler, format: OutputFormat): Promise<boolean>;
|
|
37
|
+
/**
|
|
38
|
+
* 驗證 CLI 輸入路徑存在且為目錄。
|
|
39
|
+
*/
|
|
40
|
+
export declare function ensureDirectoryPath(pathToCheck: string, fileSystem: IFileSystem, outputHandler: UnifiedOutputHandler, format: OutputFormat): Promise<boolean>;
|
|
33
41
|
/** 變更類命令執行選項 */
|
|
34
42
|
export interface MutationExecutionOptions {
|
|
35
43
|
/** 檔案系統 */
|
|
@@ -52,6 +60,14 @@ export interface MutationExecutionResult {
|
|
|
52
60
|
/** PreviewInput(用於輸出) */
|
|
53
61
|
previewInput?: PreviewInput;
|
|
54
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* 建立無檔案變更的 mutation preview input。
|
|
65
|
+
*/
|
|
66
|
+
export declare function createEmptyMutationPreviewInput(command: PreviewCommand, operationDescription: string): PreviewInput;
|
|
67
|
+
/**
|
|
68
|
+
* 輸出 mutation 結果,JSON 模式保留既有命令欄位並補齊統一 PreviewResult 欄位。
|
|
69
|
+
*/
|
|
70
|
+
export declare function outputMutationWithLegacyFields(outputHandler: UnifiedOutputHandler, input: PreviewInput, format: OutputFormat, legacyFields?: Record<string, unknown>): void;
|
|
55
71
|
/**
|
|
56
72
|
* 執行變更類命令的統一流程
|
|
57
73
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-utils.d.ts","sourceRoot":"","sources":["../../../src/interfaces/cli/command-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAoD,KAAK,SAAS,EAAE,MAAM,oCAAoC,CAAC;AACtH,OAAO,
|
|
1
|
+
{"version":3,"file":"command-utils.d.ts","sourceRoot":"","sources":["../../../src/interfaces/cli/command-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAoD,KAAK,SAAS,EAAE,MAAM,oCAAoC,CAAC;AACtH,OAAO,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACxF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AACpF,OAAO,EAGL,YAAY,EACZ,KAAK,oBAAoB,EAC1B,MAAM,2CAA2C,CAAC;AAEnD,6CAA6C;AAC7C,MAAM,MAAM,iBAAiB,GACzB;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE,GACvC;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC;AAE3C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAClC,SA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;;;;;;GA0BG;AACH,wBAAsB,sBAAsB,CAC1C,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,uBAAuB,CAAC,CA4ClC"}
|
|
@@ -25,13 +25,63 @@ export function tryParseOutputFormat(formatStr, allowDiff, outputHandler) {
|
|
|
25
25
|
const format = parseOutputFormat(formatStr, allowDiff);
|
|
26
26
|
return { success: true, format };
|
|
27
27
|
}
|
|
28
|
-
catch {
|
|
29
|
-
const
|
|
30
|
-
handler.outputError(
|
|
28
|
+
catch (error) {
|
|
29
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
30
|
+
handler.outputError(message, OutputFormat.Summary);
|
|
31
31
|
process.exitCode = 1;
|
|
32
32
|
return { success: false };
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* 驗證 CLI 輸入路徑存在,失敗時輸出統一錯誤並設定 exitCode。
|
|
37
|
+
*/
|
|
38
|
+
export async function ensurePathExists(pathToCheck, fileSystem, outputHandler, format) {
|
|
39
|
+
const exists = await fileSystem.exists(pathToCheck);
|
|
40
|
+
if (!exists) {
|
|
41
|
+
outputHandler.outputError(`路徑不存在: ${pathToCheck}`, format);
|
|
42
|
+
process.exitCode = 1;
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* 驗證 CLI 輸入路徑存在且為目錄。
|
|
49
|
+
*/
|
|
50
|
+
export async function ensureDirectoryPath(pathToCheck, fileSystem, outputHandler, format) {
|
|
51
|
+
const exists = await ensurePathExists(pathToCheck, fileSystem, outputHandler, format);
|
|
52
|
+
if (!exists) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
const isDirectory = await fileSystem.isDirectory(pathToCheck);
|
|
56
|
+
if (!isDirectory) {
|
|
57
|
+
outputHandler.outputError(`路徑不是目錄: ${pathToCheck}`, format);
|
|
58
|
+
process.exitCode = 1;
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* 建立無檔案變更的 mutation preview input。
|
|
65
|
+
*/
|
|
66
|
+
export function createEmptyMutationPreviewInput(command, operationDescription) {
|
|
67
|
+
return {
|
|
68
|
+
command,
|
|
69
|
+
success: true,
|
|
70
|
+
fileChanges: [],
|
|
71
|
+
operationDescription
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* 輸出 mutation 結果,JSON 模式保留既有命令欄位並補齊統一 PreviewResult 欄位。
|
|
76
|
+
*/
|
|
77
|
+
export function outputMutationWithLegacyFields(outputHandler, input, format, legacyFields = {}) {
|
|
78
|
+
if (format === OutputFormat.Json) {
|
|
79
|
+
const result = outputHandler.createMutationResult(input);
|
|
80
|
+
outputHandler.outputJson({ ...legacyFields, ...result }, 2);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
outputHandler.outputMutation(input, format);
|
|
84
|
+
}
|
|
35
85
|
/**
|
|
36
86
|
* 執行變更類命令的統一流程
|
|
37
87
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-utils.js","sourceRoot":"","sources":["../../../src/interfaces/cli/command-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,8BAA8B,EAAkB,MAAM,oCAAoC,CAAC;AAGtH,OAAO,EACL,0BAA0B,EAC1B,iBAAiB,EACjB,YAAY,EAEb,MAAM,2CAA2C,CAAC;AAOnD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,oBAAoB,CAClC,SAAiB,EACjB,SAAkB,EAClB,aAAoC;IAEpC,MAAM,OAAO,GAAG,aAAa,IAAI,0BAA0B,EAAE,CAAC;IAC9D,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,iBAAiB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACvD,OAAO,EAAE,OAAO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AI,EAAE,YAAY,EAAE,CAAC;IACzC,CAAC;SAAM,CAAC;QACN,aAAa,CAAC,WAAW,CACvB,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,EACnC,MAAM,EACN,WAAW,CACZ,CAAC;QACF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call-hierarchy.command.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/cli/commands/call-hierarchy.command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"call-hierarchy.command.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/cli/commands/call-hierarchy.command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsBzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAWxE;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAWzF"}
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
* call-hierarchy 命令
|
|
3
3
|
* 顯示函數的呼叫者(incoming)和被呼叫者(outgoing)
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { CLI_INDEX_DEFAULTS } from '../../../core/foundations/indexing/index.js';
|
|
6
|
+
import { createAndIndexWithCache } from '../../cli/cached-index-engine.js';
|
|
6
7
|
import { ParserRegistry } from '../../../infrastructure/parser/registry.js';
|
|
7
8
|
import { createCallHierarchyAnalyzer } from '../../../core/call-hierarchy/index.js';
|
|
8
9
|
import { QueryCommand } from '../../../infrastructure/formatters/index.js';
|
|
9
10
|
import { createUnifiedOutputHandler, OutputFormat } from '../../cli/unified-output-handler.js';
|
|
10
|
-
import { tryParseOutputFormat } from '../../cli/command-utils.js';
|
|
11
|
+
import { ensureDirectoryPath, tryParseOutputFormat } from '../../cli/command-utils.js';
|
|
11
12
|
import { getErrorMessage } from '../../../shared/errors/index.js';
|
|
12
13
|
/**
|
|
13
14
|
* 設定 call-hierarchy 命令
|
|
@@ -20,14 +21,14 @@ export function setupCallHierarchyCommand(program, context) {
|
|
|
20
21
|
.option('-d, --direction <direction>', '分析方向: incoming, outgoing, both', 'both')
|
|
21
22
|
.option('--depth <n>', '遞迴深度(1-10)', '1')
|
|
22
23
|
.option('--format <format>', '輸出格式 (json|summary)', 'summary')
|
|
23
|
-
.action(async (functionName, options) => {
|
|
24
|
-
await handleCallHierarchyCommand(functionName, options, context);
|
|
24
|
+
.action(async (functionName, options, command) => {
|
|
25
|
+
await handleCallHierarchyCommand(functionName, options, context, command);
|
|
25
26
|
});
|
|
26
27
|
}
|
|
27
28
|
/**
|
|
28
29
|
* 處理 call-hierarchy 命令
|
|
29
30
|
*/
|
|
30
|
-
async function handleCallHierarchyCommand(functionName, options, context) {
|
|
31
|
+
async function handleCallHierarchyCommand(functionName, options, context, command) {
|
|
31
32
|
const outputHandler = createUnifiedOutputHandler();
|
|
32
33
|
// 解析輸出格式
|
|
33
34
|
const formatResult = tryParseOutputFormat(options.format, false, outputHandler);
|
|
@@ -53,21 +54,29 @@ async function handleCallHierarchyCommand(functionName, options, context) {
|
|
|
53
54
|
console.log(`📞 分析呼叫層次: ${functionName}...`);
|
|
54
55
|
}
|
|
55
56
|
const projectPath = options.path || process.cwd();
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
const pathIsDirectory = await ensureDirectoryPath(projectPath, context.fileSystem, outputHandler, format);
|
|
58
|
+
if (!pathIsDirectory) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const globalOpts = command.optsWithGlobals();
|
|
62
|
+
const noCache = globalOpts.cache === false;
|
|
63
|
+
const indexEngine = await createAndIndexWithCache(projectPath, context.fileSystem, CLI_INDEX_DEFAULTS, { noCache, cacheDir: globalOpts.cacheDir });
|
|
59
64
|
try {
|
|
60
|
-
await indexEngine.indexProject(projectPath);
|
|
61
65
|
const indexedFiles = indexEngine.getAllIndexedFiles();
|
|
62
66
|
const filePaths = indexedFiles.map(f => f.filePath);
|
|
63
67
|
// 使用 IndexEngine 查找函數定義(與 find-references 相同的方式)
|
|
64
68
|
const symbolResults = await indexEngine.findSymbol(functionName);
|
|
65
69
|
// 過濾出函數類型的符號(function 或 variable 用於 arrow function)
|
|
66
70
|
const functionSymbols = symbolResults.filter(r => r.symbol.type === 'function' || r.symbol.type === 'variable');
|
|
71
|
+
// 優先選取 function 類型(排除 import specifier 等 variable 型別),
|
|
72
|
+
// 若無 function 類型則以 variable 為後備(arrow function 場景)
|
|
73
|
+
const purelyFunctionSymbols = functionSymbols.filter(r => r.symbol.type === 'function');
|
|
74
|
+
const preferredSymbols = purelyFunctionSymbols.length > 0 ? purelyFunctionSymbols : functionSymbols;
|
|
67
75
|
// 若無函數類型,回退到所有結果
|
|
68
|
-
const matchedSymbols =
|
|
76
|
+
const matchedSymbols = preferredSymbols.length > 0 ? preferredSymbols : symbolResults;
|
|
69
77
|
// 函數找不到的情況
|
|
70
78
|
if (matchedSymbols.length === 0) {
|
|
79
|
+
const errorMessage = `找不到函數 "${functionName}"`;
|
|
71
80
|
const errorResult = {
|
|
72
81
|
command: QueryCommand.CallHierarchy,
|
|
73
82
|
success: false,
|
|
@@ -82,7 +91,8 @@ async function handleCallHierarchyCommand(functionName, options, context) {
|
|
|
82
91
|
outgoingCount: 0,
|
|
83
92
|
uniqueFiles: 0
|
|
84
93
|
},
|
|
85
|
-
|
|
94
|
+
error: errorMessage,
|
|
95
|
+
errors: [errorMessage]
|
|
86
96
|
};
|
|
87
97
|
outputHandler.outputQuery(errorResult, format);
|
|
88
98
|
process.exitCode = 1;
|
|
@@ -98,7 +108,6 @@ async function handleCallHierarchyCommand(functionName, options, context) {
|
|
|
98
108
|
const functionSymbol = matchedSymbols[0];
|
|
99
109
|
const definitionFile = functionSymbol.symbol.location.filePath;
|
|
100
110
|
const definitionLine = functionSymbol.symbol.location.range.start.line;
|
|
101
|
-
const definitionRange = functionSymbol.symbol.location.range;
|
|
102
111
|
// 建立分析器並執行分析
|
|
103
112
|
const parserRegistry = ParserRegistry.getInstance();
|
|
104
113
|
const analyzer = createCallHierarchyAnalyzer(parserRegistry, context.fileSystem);
|
|
@@ -106,22 +115,27 @@ async function handleCallHierarchyCommand(functionName, options, context) {
|
|
|
106
115
|
direction,
|
|
107
116
|
depth
|
|
108
117
|
};
|
|
109
|
-
const
|
|
118
|
+
const analysisResults = [];
|
|
119
|
+
for (const matchedSymbol of matchedSymbols) {
|
|
120
|
+
const symbolDefinitionFile = matchedSymbol.symbol.location.filePath;
|
|
121
|
+
const symbolDefinitionRange = matchedSymbol.symbol.location.range;
|
|
122
|
+
analysisResults.push(await analyzer.analyzeWithDefinition(functionName, symbolDefinitionFile, symbolDefinitionRange, filePaths, analysisOptions));
|
|
123
|
+
}
|
|
110
124
|
// 轉換為輸出格式
|
|
111
|
-
const incoming =
|
|
125
|
+
const incoming = dedupeIncomingCalls(analysisResults.flatMap(result => result.incoming.map(call => ({
|
|
112
126
|
caller: call.caller,
|
|
113
127
|
file: call.location.filePath,
|
|
114
128
|
line: call.location.range.start.line,
|
|
115
129
|
column: call.location.range.start.column,
|
|
116
130
|
context: call.context
|
|
117
|
-
}));
|
|
118
|
-
const outgoing =
|
|
131
|
+
}))));
|
|
132
|
+
const outgoing = dedupeOutgoingCalls(analysisResults.flatMap(result => result.outgoing.map(call => ({
|
|
119
133
|
callee: call.callee,
|
|
120
134
|
file: call.location.filePath,
|
|
121
135
|
line: call.location.range.start.line,
|
|
122
136
|
column: call.location.range.start.column,
|
|
123
137
|
context: call.context
|
|
124
|
-
}));
|
|
138
|
+
}))));
|
|
125
139
|
// 計算涉及的檔案數
|
|
126
140
|
const uniqueFiles = new Set([
|
|
127
141
|
...incoming.map(i => i.file),
|
|
@@ -166,4 +180,30 @@ function validateDirection(dir) {
|
|
|
166
180
|
}
|
|
167
181
|
return null;
|
|
168
182
|
}
|
|
183
|
+
function dedupeIncomingCalls(calls) {
|
|
184
|
+
const seen = new Set();
|
|
185
|
+
const uniqueCalls = [];
|
|
186
|
+
for (const call of calls) {
|
|
187
|
+
const key = `${call.caller}:${call.file}:${call.line}:${call.column ?? ''}:${call.context ?? ''}`;
|
|
188
|
+
if (seen.has(key)) {
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
seen.add(key);
|
|
192
|
+
uniqueCalls.push(call);
|
|
193
|
+
}
|
|
194
|
+
return uniqueCalls;
|
|
195
|
+
}
|
|
196
|
+
function dedupeOutgoingCalls(calls) {
|
|
197
|
+
const seen = new Set();
|
|
198
|
+
const uniqueCalls = [];
|
|
199
|
+
for (const call of calls) {
|
|
200
|
+
const key = `${call.callee}:${call.file}:${call.line}:${call.column ?? ''}:${call.context ?? ''}`;
|
|
201
|
+
if (seen.has(key)) {
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
seen.add(key);
|
|
205
|
+
uniqueCalls.push(call);
|
|
206
|
+
}
|
|
207
|
+
return uniqueCalls;
|
|
208
|
+
}
|
|
169
209
|
//# sourceMappingURL=call-hierarchy.command.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call-hierarchy.command.js","sourceRoot":"","sources":["../../../../src/interfaces/cli/commands/call-hierarchy.command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"call-hierarchy.command.js","sourceRoot":"","sources":["../../../../src/interfaces/cli/commands/call-hierarchy.command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,uB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|
|
5
5
|
import type { Command } from 'commander';
|
|
6
6
|
import type { CommandContext } from '../../cli/commands/types.js';
|
|
7
|
+
import type { IFileSystem } from '../../../infrastructure/storage/file-system.interface.js';
|
|
7
8
|
/**
|
|
8
9
|
* 設定 change-signature 命令
|
|
9
10
|
*/
|
|
10
11
|
export declare function setupChangeSignatureCommand(program: Command, context: CommandContext): void;
|
|
12
|
+
export interface ResolveChangeSignaturePathsOptions {
|
|
13
|
+
resolvedFile: string;
|
|
14
|
+
pathOption?: string;
|
|
15
|
+
cwd: string;
|
|
16
|
+
fileSystem: IFileSystem;
|
|
17
|
+
}
|
|
18
|
+
export interface ResolvedChangeSignaturePaths {
|
|
19
|
+
projectRoot: string;
|
|
20
|
+
filePath: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function resolveChangeSignaturePaths(options: ResolveChangeSignaturePathsOptions): Promise<ResolvedChangeSignaturePaths>;
|
|
11
23
|
//# sourceMappingURL=change-signature.command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-signature.command.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/cli/commands/change-signature.command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"change-signature.command.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/cli/commands/change-signature.command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAezC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAExE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AAgBpF;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAiB3F;AAsJD,MAAM,WAAW,kCAAkC;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,WAAW,CAAC;CACzB;AAED,MAAM,WAAW,4BAA4B;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,kCAAkC,GAC1C,OAAO,CAAC,4BAA4B,CAAC,CAiBvC"}
|