agent-ide 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +678 -0
- package/bin/agent-ide.js +19 -0
- package/bin/mcp-server.js +20 -0
- package/dist/application/events/event-bus.d.ts +107 -0
- package/dist/application/events/event-bus.d.ts.map +1 -0
- package/dist/application/events/event-bus.js +364 -0
- package/dist/application/events/event-bus.js.map +1 -0
- package/dist/application/events/event-types.d.ts +195 -0
- package/dist/application/events/event-types.d.ts.map +1 -0
- package/dist/application/events/event-types.js +36 -0
- package/dist/application/events/event-types.js.map +1 -0
- package/dist/application/events/index.d.ts +6 -0
- package/dist/application/events/index.d.ts.map +1 -0
- package/dist/application/events/index.js +6 -0
- package/dist/application/events/index.js.map +1 -0
- package/dist/application/index.d.ts +85 -0
- package/dist/application/index.d.ts.map +1 -0
- package/dist/application/index.js +138 -0
- package/dist/application/index.js.map +1 -0
- package/dist/application/services/cache-coordinator.service.d.ts +69 -0
- package/dist/application/services/cache-coordinator.service.d.ts.map +1 -0
- package/dist/application/services/cache-coordinator.service.js +251 -0
- package/dist/application/services/cache-coordinator.service.js.map +1 -0
- package/dist/application/services/error-handler.service.d.ts +56 -0
- package/dist/application/services/error-handler.service.d.ts.map +1 -0
- package/dist/application/services/error-handler.service.js +273 -0
- package/dist/application/services/error-handler.service.js.map +1 -0
- package/dist/application/services/index.d.ts +8 -0
- package/dist/application/services/index.d.ts.map +1 -0
- package/dist/application/services/index.js +8 -0
- package/dist/application/services/index.js.map +1 -0
- package/dist/application/services/module-coordinator.service.d.ts +70 -0
- package/dist/application/services/module-coordinator.service.d.ts.map +1 -0
- package/dist/application/services/module-coordinator.service.js +418 -0
- package/dist/application/services/module-coordinator.service.js.map +1 -0
- package/dist/application/services/session-manager.service.d.ts +86 -0
- package/dist/application/services/session-manager.service.d.ts.map +1 -0
- package/dist/application/services/session-manager.service.js +318 -0
- package/dist/application/services/session-manager.service.js.map +1 -0
- package/dist/application/services/workflow-engine.service.d.ts +76 -0
- package/dist/application/services/workflow-engine.service.d.ts.map +1 -0
- package/dist/application/services/workflow-engine.service.js +405 -0
- package/dist/application/services/workflow-engine.service.js.map +1 -0
- package/dist/application/state/application-state.d.ts +164 -0
- package/dist/application/state/application-state.d.ts.map +1 -0
- package/dist/application/state/application-state.js +290 -0
- package/dist/application/state/application-state.js.map +1 -0
- package/dist/application/state/index.d.ts +15 -0
- package/dist/application/state/index.d.ts.map +1 -0
- package/dist/application/state/index.js +15 -0
- package/dist/application/state/index.js.map +1 -0
- package/dist/application/state/session-state.d.ts +114 -0
- package/dist/application/state/session-state.d.ts.map +1 -0
- package/dist/application/state/session-state.js +188 -0
- package/dist/application/state/session-state.js.map +1 -0
- package/dist/application/state/state-manager.d.ts +122 -0
- package/dist/application/state/state-manager.d.ts.map +1 -0
- package/dist/application/state/state-manager.js +234 -0
- package/dist/application/state/state-manager.js.map +1 -0
- package/dist/application/types.d.ts +280 -0
- package/dist/application/types.d.ts.map +1 -0
- package/dist/application/types.js +13 -0
- package/dist/application/types.js.map +1 -0
- package/dist/application/workflows/analysis-workflow.d.ts +239 -0
- package/dist/application/workflows/analysis-workflow.d.ts.map +1 -0
- package/dist/application/workflows/analysis-workflow.js +395 -0
- package/dist/application/workflows/analysis-workflow.js.map +1 -0
- package/dist/application/workflows/base-workflow.d.ts +108 -0
- package/dist/application/workflows/base-workflow.d.ts.map +1 -0
- package/dist/application/workflows/base-workflow.js +236 -0
- package/dist/application/workflows/base-workflow.js.map +1 -0
- package/dist/application/workflows/index.d.ts +115 -0
- package/dist/application/workflows/index.d.ts.map +1 -0
- package/dist/application/workflows/index.js +218 -0
- package/dist/application/workflows/index.js.map +1 -0
- package/dist/application/workflows/refactor-workflow.d.ts +107 -0
- package/dist/application/workflows/refactor-workflow.d.ts.map +1 -0
- package/dist/application/workflows/refactor-workflow.js +310 -0
- package/dist/application/workflows/refactor-workflow.js.map +1 -0
- package/dist/core/analysis/complexity-analyzer.d.ts +81 -0
- package/dist/core/analysis/complexity-analyzer.d.ts.map +1 -0
- package/dist/core/analysis/complexity-analyzer.js +254 -0
- package/dist/core/analysis/complexity-analyzer.js.map +1 -0
- package/dist/core/analysis/dead-code-detector.d.ts +123 -0
- package/dist/core/analysis/dead-code-detector.d.ts.map +1 -0
- package/dist/core/analysis/dead-code-detector.js +275 -0
- package/dist/core/analysis/dead-code-detector.js.map +1 -0
- package/dist/core/analysis/duplication-detector.d.ts +150 -0
- package/dist/core/analysis/duplication-detector.d.ts.map +1 -0
- package/dist/core/analysis/duplication-detector.js +433 -0
- package/dist/core/analysis/duplication-detector.js.map +1 -0
- package/dist/core/analysis/index.d.ts +9 -0
- package/dist/core/analysis/index.d.ts.map +1 -0
- package/dist/core/analysis/index.js +13 -0
- package/dist/core/analysis/index.js.map +1 -0
- package/dist/core/analysis/quality-metrics.d.ts +158 -0
- package/dist/core/analysis/quality-metrics.d.ts.map +1 -0
- package/dist/core/analysis/quality-metrics.js +442 -0
- package/dist/core/analysis/quality-metrics.js.map +1 -0
- package/dist/core/dependency/cycle-detector.d.ts +81 -0
- package/dist/core/dependency/cycle-detector.d.ts.map +1 -0
- package/dist/core/dependency/cycle-detector.js +300 -0
- package/dist/core/dependency/cycle-detector.js.map +1 -0
- package/dist/core/dependency/dependency-analyzer.d.ts +152 -0
- package/dist/core/dependency/dependency-analyzer.d.ts.map +1 -0
- package/dist/core/dependency/dependency-analyzer.js +458 -0
- package/dist/core/dependency/dependency-analyzer.js.map +1 -0
- package/dist/core/dependency/dependency-graph.d.ts +156 -0
- package/dist/core/dependency/dependency-graph.d.ts.map +1 -0
- package/dist/core/dependency/dependency-graph.js +371 -0
- package/dist/core/dependency/dependency-graph.js.map +1 -0
- package/dist/core/dependency/index.d.ts +27 -0
- package/dist/core/dependency/index.d.ts.map +1 -0
- package/dist/core/dependency/index.js +36 -0
- package/dist/core/dependency/index.js.map +1 -0
- package/dist/core/dependency/types.d.ts +168 -0
- package/dist/core/dependency/types.d.ts.map +1 -0
- package/dist/core/dependency/types.js +103 -0
- package/dist/core/dependency/types.js.map +1 -0
- package/dist/core/indexing/file-index.d.ts +117 -0
- package/dist/core/indexing/file-index.d.ts.map +1 -0
- package/dist/core/indexing/file-index.js +302 -0
- package/dist/core/indexing/file-index.js.map +1 -0
- package/dist/core/indexing/file-watcher.d.ts +110 -0
- package/dist/core/indexing/file-watcher.d.ts.map +1 -0
- package/dist/core/indexing/file-watcher.js +280 -0
- package/dist/core/indexing/file-watcher.js.map +1 -0
- package/dist/core/indexing/index-engine.d.ts +120 -0
- package/dist/core/indexing/index-engine.d.ts.map +1 -0
- package/dist/core/indexing/index-engine.js +445 -0
- package/dist/core/indexing/index-engine.js.map +1 -0
- package/dist/core/indexing/index.d.ts +25 -0
- package/dist/core/indexing/index.d.ts.map +1 -0
- package/dist/core/indexing/index.js +36 -0
- package/dist/core/indexing/index.js.map +1 -0
- package/dist/core/indexing/symbol-index.d.ts +107 -0
- package/dist/core/indexing/symbol-index.d.ts.map +1 -0
- package/dist/core/indexing/symbol-index.js +352 -0
- package/dist/core/indexing/symbol-index.js.map +1 -0
- package/dist/core/indexing/types.d.ts +222 -0
- package/dist/core/indexing/types.d.ts.map +1 -0
- package/dist/core/indexing/types.js +143 -0
- package/dist/core/indexing/types.js.map +1 -0
- package/dist/core/move/import-resolver.d.ts +54 -0
- package/dist/core/move/import-resolver.d.ts.map +1 -0
- package/dist/core/move/import-resolver.js +268 -0
- package/dist/core/move/import-resolver.js.map +1 -0
- package/dist/core/move/index.d.ts +10 -0
- package/dist/core/move/index.d.ts.map +1 -0
- package/dist/core/move/index.js +12 -0
- package/dist/core/move/index.js.map +1 -0
- package/dist/core/move/move-service.d.ts +67 -0
- package/dist/core/move/move-service.d.ts.map +1 -0
- package/dist/core/move/move-service.js +400 -0
- package/dist/core/move/move-service.js.map +1 -0
- package/dist/core/move/types.d.ts +266 -0
- package/dist/core/move/types.d.ts.map +1 -0
- package/dist/core/move/types.js +101 -0
- package/dist/core/move/types.js.map +1 -0
- package/dist/core/performance/analyzer.d.ts +62 -0
- package/dist/core/performance/analyzer.d.ts.map +1 -0
- package/dist/core/performance/analyzer.js +378 -0
- package/dist/core/performance/analyzer.js.map +1 -0
- package/dist/core/performance/cache-manager.d.ts +161 -0
- package/dist/core/performance/cache-manager.d.ts.map +1 -0
- package/dist/core/performance/cache-manager.js +375 -0
- package/dist/core/performance/cache-manager.js.map +1 -0
- package/dist/core/performance/index.d.ts +14 -0
- package/dist/core/performance/index.d.ts.map +1 -0
- package/dist/core/performance/index.js +17 -0
- package/dist/core/performance/index.js.map +1 -0
- package/dist/core/performance/interfaces.d.ts +188 -0
- package/dist/core/performance/interfaces.d.ts.map +1 -0
- package/dist/core/performance/interfaces.js +17 -0
- package/dist/core/performance/interfaces.js.map +1 -0
- package/dist/core/performance/memory-manager.d.ts +176 -0
- package/dist/core/performance/memory-manager.d.ts.map +1 -0
- package/dist/core/performance/memory-manager.js +364 -0
- package/dist/core/performance/memory-manager.js.map +1 -0
- package/dist/core/performance/monitor.d.ts +92 -0
- package/dist/core/performance/monitor.d.ts.map +1 -0
- package/dist/core/performance/monitor.js +228 -0
- package/dist/core/performance/monitor.js.map +1 -0
- package/dist/core/refactor/design-patterns.d.ts +178 -0
- package/dist/core/refactor/design-patterns.d.ts.map +1 -0
- package/dist/core/refactor/design-patterns.js +656 -0
- package/dist/core/refactor/design-patterns.js.map +1 -0
- package/dist/core/refactor/extract-function.d.ts +175 -0
- package/dist/core/refactor/extract-function.d.ts.map +1 -0
- package/dist/core/refactor/extract-function.js +478 -0
- package/dist/core/refactor/extract-function.js.map +1 -0
- package/dist/core/refactor/index.d.ts +8 -0
- package/dist/core/refactor/index.d.ts.map +1 -0
- package/dist/core/refactor/index.js +11 -0
- package/dist/core/refactor/index.js.map +1 -0
- package/dist/core/refactor/inline-function.d.ts +175 -0
- package/dist/core/refactor/inline-function.d.ts.map +1 -0
- package/dist/core/refactor/inline-function.js +425 -0
- package/dist/core/refactor/inline-function.js.map +1 -0
- package/dist/core/rename/index.d.ts +9 -0
- package/dist/core/rename/index.d.ts.map +1 -0
- package/dist/core/rename/index.js +13 -0
- package/dist/core/rename/index.js.map +1 -0
- package/dist/core/rename/reference-updater.d.ts +77 -0
- package/dist/core/rename/reference-updater.d.ts.map +1 -0
- package/dist/core/rename/reference-updater.js +400 -0
- package/dist/core/rename/reference-updater.js.map +1 -0
- package/dist/core/rename/rename-engine.d.ts +69 -0
- package/dist/core/rename/rename-engine.d.ts.map +1 -0
- package/dist/core/rename/rename-engine.js +350 -0
- package/dist/core/rename/rename-engine.js.map +1 -0
- package/dist/core/rename/scope-analyzer.d.ts +75 -0
- package/dist/core/rename/scope-analyzer.d.ts.map +1 -0
- package/dist/core/rename/scope-analyzer.js +269 -0
- package/dist/core/rename/scope-analyzer.js.map +1 -0
- package/dist/core/rename/types.d.ts +163 -0
- package/dist/core/rename/types.d.ts.map +1 -0
- package/dist/core/rename/types.js +80 -0
- package/dist/core/rename/types.js.map +1 -0
- package/dist/core/search/engines/text-engine.d.ts +52 -0
- package/dist/core/search/engines/text-engine.d.ts.map +1 -0
- package/dist/core/search/engines/text-engine.js +376 -0
- package/dist/core/search/engines/text-engine.js.map +1 -0
- package/dist/core/search/index.d.ts +10 -0
- package/dist/core/search/index.d.ts.map +1 -0
- package/dist/core/search/index.js +11 -0
- package/dist/core/search/index.js.map +1 -0
- package/dist/core/search/service.d.ts +105 -0
- package/dist/core/search/service.d.ts.map +1 -0
- package/dist/core/search/service.js +384 -0
- package/dist/core/search/service.js.map +1 -0
- package/dist/core/search/types.d.ts +357 -0
- package/dist/core/search/types.d.ts.map +1 -0
- package/dist/core/search/types.js +47 -0
- package/dist/core/search/types.js.map +1 -0
- package/dist/infrastructure/cache/cache-manager.d.ts +113 -0
- package/dist/infrastructure/cache/cache-manager.d.ts.map +1 -0
- package/dist/infrastructure/cache/cache-manager.js +279 -0
- package/dist/infrastructure/cache/cache-manager.js.map +1 -0
- package/dist/infrastructure/cache/index.d.ts +138 -0
- package/dist/infrastructure/cache/index.d.ts.map +1 -0
- package/dist/infrastructure/cache/index.js +266 -0
- package/dist/infrastructure/cache/index.js.map +1 -0
- package/dist/infrastructure/cache/memory-cache.d.ts +94 -0
- package/dist/infrastructure/cache/memory-cache.d.ts.map +1 -0
- package/dist/infrastructure/cache/memory-cache.js +327 -0
- package/dist/infrastructure/cache/memory-cache.js.map +1 -0
- package/dist/infrastructure/cache/strategies.d.ts +99 -0
- package/dist/infrastructure/cache/strategies.d.ts.map +1 -0
- package/dist/infrastructure/cache/strategies.js +230 -0
- package/dist/infrastructure/cache/strategies.js.map +1 -0
- package/dist/infrastructure/cache/types.d.ts +220 -0
- package/dist/infrastructure/cache/types.d.ts.map +1 -0
- package/dist/infrastructure/cache/types.js +42 -0
- package/dist/infrastructure/cache/types.js.map +1 -0
- package/dist/infrastructure/parser/base.d.ts +126 -0
- package/dist/infrastructure/parser/base.d.ts.map +1 -0
- package/dist/infrastructure/parser/base.js +269 -0
- package/dist/infrastructure/parser/base.js.map +1 -0
- package/dist/infrastructure/parser/factory.d.ts +141 -0
- package/dist/infrastructure/parser/factory.d.ts.map +1 -0
- package/dist/infrastructure/parser/factory.js +306 -0
- package/dist/infrastructure/parser/factory.js.map +1 -0
- package/dist/infrastructure/parser/index.d.ts +12 -0
- package/dist/infrastructure/parser/index.d.ts.map +1 -0
- package/dist/infrastructure/parser/index.js +12 -0
- package/dist/infrastructure/parser/index.js.map +1 -0
- package/dist/infrastructure/parser/interface.d.ts +108 -0
- package/dist/infrastructure/parser/interface.d.ts.map +1 -0
- package/dist/infrastructure/parser/interface.js +72 -0
- package/dist/infrastructure/parser/interface.js.map +1 -0
- package/dist/infrastructure/parser/registry.d.ts +141 -0
- package/dist/infrastructure/parser/registry.d.ts.map +1 -0
- package/dist/infrastructure/parser/registry.js +289 -0
- package/dist/infrastructure/parser/registry.js.map +1 -0
- package/dist/infrastructure/parser/types.d.ts +172 -0
- package/dist/infrastructure/parser/types.d.ts.map +1 -0
- package/dist/infrastructure/parser/types.js +147 -0
- package/dist/infrastructure/parser/types.js.map +1 -0
- package/dist/infrastructure/storage/file-system.d.ts +74 -0
- package/dist/infrastructure/storage/file-system.d.ts.map +1 -0
- package/dist/infrastructure/storage/file-system.js +334 -0
- package/dist/infrastructure/storage/file-system.js.map +1 -0
- package/dist/infrastructure/storage/file-watcher.d.ts +84 -0
- package/dist/infrastructure/storage/file-watcher.d.ts.map +1 -0
- package/dist/infrastructure/storage/file-watcher.js +249 -0
- package/dist/infrastructure/storage/file-watcher.js.map +1 -0
- package/dist/infrastructure/storage/index.d.ts +11 -0
- package/dist/infrastructure/storage/index.d.ts.map +1 -0
- package/dist/infrastructure/storage/index.js +16 -0
- package/dist/infrastructure/storage/index.js.map +1 -0
- package/dist/infrastructure/storage/path-utils.d.ts +96 -0
- package/dist/infrastructure/storage/path-utils.d.ts.map +1 -0
- package/dist/infrastructure/storage/path-utils.js +272 -0
- package/dist/infrastructure/storage/path-utils.js.map +1 -0
- package/dist/infrastructure/storage/types.d.ts +106 -0
- package/dist/infrastructure/storage/types.d.ts.map +1 -0
- package/dist/infrastructure/storage/types.js +53 -0
- package/dist/infrastructure/storage/types.js.map +1 -0
- package/dist/interfaces/cli/cli.d.ts +70 -0
- package/dist/interfaces/cli/cli.d.ts.map +1 -0
- package/dist/interfaces/cli/cli.js +1054 -0
- package/dist/interfaces/cli/cli.js.map +1 -0
- package/dist/interfaces/cli/index.d.ts +7 -0
- package/dist/interfaces/cli/index.d.ts.map +1 -0
- package/dist/interfaces/cli/index.js +22 -0
- package/dist/interfaces/cli/index.js.map +1 -0
- package/dist/interfaces/mcp/index.d.ts +7 -0
- package/dist/interfaces/mcp/index.d.ts.map +1 -0
- package/dist/interfaces/mcp/index.js +6 -0
- package/dist/interfaces/mcp/index.js.map +1 -0
- package/dist/interfaces/mcp/mcp-server.d.ts +34 -0
- package/dist/interfaces/mcp/mcp-server.d.ts.map +1 -0
- package/dist/interfaces/mcp/mcp-server.js +154 -0
- package/dist/interfaces/mcp/mcp-server.js.map +1 -0
- package/dist/interfaces/mcp/mcp.d.ts +44 -0
- package/dist/interfaces/mcp/mcp.d.ts.map +1 -0
- package/dist/interfaces/mcp/mcp.js +559 -0
- package/dist/interfaces/mcp/mcp.js.map +1 -0
- package/dist/plugins/javascript/index.d.ts +12 -0
- package/dist/plugins/javascript/index.d.ts.map +1 -0
- package/dist/plugins/javascript/index.js +16 -0
- package/dist/plugins/javascript/index.js.map +1 -0
- package/dist/plugins/javascript/parser.d.ts +81 -0
- package/dist/plugins/javascript/parser.d.ts.map +1 -0
- package/dist/plugins/javascript/parser.js +457 -0
- package/dist/plugins/javascript/parser.js.map +1 -0
- package/dist/plugins/javascript/types.d.ts +131 -0
- package/dist/plugins/javascript/types.d.ts.map +1 -0
- package/dist/plugins/javascript/types.js +366 -0
- package/dist/plugins/javascript/types.js.map +1 -0
- package/dist/plugins/swift/index.d.ts +11 -0
- package/dist/plugins/swift/index.d.ts.map +1 -0
- package/dist/plugins/swift/index.js +15 -0
- package/dist/plugins/swift/index.js.map +1 -0
- package/dist/plugins/swift/parser.d.ts +98 -0
- package/dist/plugins/swift/parser.d.ts.map +1 -0
- package/dist/plugins/swift/parser.js +612 -0
- package/dist/plugins/swift/parser.js.map +1 -0
- package/dist/plugins/swift/types.d.ts +196 -0
- package/dist/plugins/swift/types.d.ts.map +1 -0
- package/dist/plugins/swift/types.js +268 -0
- package/dist/plugins/swift/types.js.map +1 -0
- package/dist/plugins/typescript/dependency-analyzer.d.ts +78 -0
- package/dist/plugins/typescript/dependency-analyzer.d.ts.map +1 -0
- package/dist/plugins/typescript/dependency-analyzer.js +305 -0
- package/dist/plugins/typescript/dependency-analyzer.js.map +1 -0
- package/dist/plugins/typescript/index.d.ts +9 -0
- package/dist/plugins/typescript/index.d.ts.map +1 -0
- package/dist/plugins/typescript/index.js +8 -0
- package/dist/plugins/typescript/index.js.map +1 -0
- package/dist/plugins/typescript/parser.d.ts +117 -0
- package/dist/plugins/typescript/parser.d.ts.map +1 -0
- package/dist/plugins/typescript/parser.js +888 -0
- package/dist/plugins/typescript/parser.js.map +1 -0
- package/dist/plugins/typescript/symbol-extractor.d.ts +76 -0
- package/dist/plugins/typescript/symbol-extractor.d.ts.map +1 -0
- package/dist/plugins/typescript/symbol-extractor.js +339 -0
- package/dist/plugins/typescript/symbol-extractor.js.map +1 -0
- package/dist/plugins/typescript/types.d.ts +131 -0
- package/dist/plugins/typescript/types.d.ts.map +1 -0
- package/dist/plugins/typescript/types.js +331 -0
- package/dist/plugins/typescript/types.js.map +1 -0
- package/dist/shared/errors/base-error.d.ts +27 -0
- package/dist/shared/errors/base-error.d.ts.map +1 -0
- package/dist/shared/errors/base-error.js +58 -0
- package/dist/shared/errors/base-error.js.map +1 -0
- package/dist/shared/errors/config-error.d.ts +21 -0
- package/dist/shared/errors/config-error.d.ts.map +1 -0
- package/dist/shared/errors/config-error.js +34 -0
- package/dist/shared/errors/config-error.js.map +1 -0
- package/dist/shared/errors/file-error.d.ts +21 -0
- package/dist/shared/errors/file-error.d.ts.map +1 -0
- package/dist/shared/errors/file-error.js +34 -0
- package/dist/shared/errors/file-error.js.map +1 -0
- package/dist/shared/errors/index.d.ts +59 -0
- package/dist/shared/errors/index.d.ts.map +1 -0
- package/dist/shared/errors/index.js +114 -0
- package/dist/shared/errors/index.js.map +1 -0
- package/dist/shared/errors/parser-error.d.ts +72 -0
- package/dist/shared/errors/parser-error.d.ts.map +1 -0
- package/dist/shared/errors/parser-error.js +104 -0
- package/dist/shared/errors/parser-error.js.map +1 -0
- package/dist/shared/errors/validation-error.d.ts +21 -0
- package/dist/shared/errors/validation-error.d.ts.map +1 -0
- package/dist/shared/errors/validation-error.js +34 -0
- package/dist/shared/errors/validation-error.js.map +1 -0
- package/dist/shared/index.d.ts +11 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +22 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/types/ast.d.ts +78 -0
- package/dist/shared/types/ast.d.ts.map +1 -0
- package/dist/shared/types/ast.js +215 -0
- package/dist/shared/types/ast.js.map +1 -0
- package/dist/shared/types/core.d.ts +65 -0
- package/dist/shared/types/core.d.ts.map +1 -0
- package/dist/shared/types/core.js +114 -0
- package/dist/shared/types/core.js.map +1 -0
- package/dist/shared/types/index.d.ts +11 -0
- package/dist/shared/types/index.d.ts.map +1 -0
- package/dist/shared/types/index.js +12 -0
- package/dist/shared/types/index.js.map +1 -0
- package/dist/shared/types/symbol.d.ts +119 -0
- package/dist/shared/types/symbol.d.ts.map +1 -0
- package/dist/shared/types/symbol.js +197 -0
- package/dist/shared/types/symbol.js.map +1 -0
- package/dist/shared/utils/array.d.ts +68 -0
- package/dist/shared/utils/array.d.ts.map +1 -0
- package/dist/shared/utils/array.js +165 -0
- package/dist/shared/utils/array.js.map +1 -0
- package/dist/shared/utils/async.d.ts +87 -0
- package/dist/shared/utils/async.d.ts.map +1 -0
- package/dist/shared/utils/async.js +185 -0
- package/dist/shared/utils/async.js.map +1 -0
- package/dist/shared/utils/index.d.ts +32 -0
- package/dist/shared/utils/index.d.ts.map +1 -0
- package/dist/shared/utils/index.js +37 -0
- package/dist/shared/utils/index.js.map +1 -0
- package/dist/shared/utils/memory-monitor.d.ts +83 -0
- package/dist/shared/utils/memory-monitor.d.ts.map +1 -0
- package/dist/shared/utils/memory-monitor.js +168 -0
- package/dist/shared/utils/memory-monitor.js.map +1 -0
- package/dist/shared/utils/object.d.ts +71 -0
- package/dist/shared/utils/object.d.ts.map +1 -0
- package/dist/shared/utils/object.js +284 -0
- package/dist/shared/utils/object.js.map +1 -0
- package/dist/shared/utils/path.d.ts +59 -0
- package/dist/shared/utils/path.d.ts.map +1 -0
- package/dist/shared/utils/path.js +201 -0
- package/dist/shared/utils/path.js.map +1 -0
- package/dist/shared/utils/string.d.ts +74 -0
- package/dist/shared/utils/string.d.ts.map +1 -0
- package/dist/shared/utils/string.js +201 -0
- package/dist/shared/utils/string.js.map +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AST 相關型別定義
|
|
3
|
+
* 包含 ASTNode、ASTMetadata、AST 等型別
|
|
4
|
+
*/
|
|
5
|
+
import { isPositionInRange } from './core.js';
|
|
6
|
+
/**
|
|
7
|
+
* 建立 ASTNode 的工廠函式
|
|
8
|
+
*/
|
|
9
|
+
export function createASTNode(type, range, properties = {}, children = []) {
|
|
10
|
+
if (!type.trim()) {
|
|
11
|
+
throw new Error('ASTNode 類型不能為空');
|
|
12
|
+
}
|
|
13
|
+
// 驗證子節點範圍必須在父節點範圍內
|
|
14
|
+
for (const child of children) {
|
|
15
|
+
if (!isRangeContained(child.range, range)) {
|
|
16
|
+
throw new Error('子節點範圍必須在父節點範圍內');
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
// 先建立節點但不設定 parent
|
|
20
|
+
const childrenCopy = children.map(child => ({ ...child }));
|
|
21
|
+
const node = {
|
|
22
|
+
type,
|
|
23
|
+
range,
|
|
24
|
+
properties,
|
|
25
|
+
children: childrenCopy
|
|
26
|
+
};
|
|
27
|
+
// 然後遞歸設定所有子節點的 parent 關係
|
|
28
|
+
setParentRelationships(node);
|
|
29
|
+
return node;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* 建立 ASTMetadata 的工廠函式
|
|
33
|
+
*/
|
|
34
|
+
export function createASTMetadata(language, version, parserOptions = {}, parseTime = 0, nodeCount = 0) {
|
|
35
|
+
if (!language.trim()) {
|
|
36
|
+
throw new Error('語言名稱不能為空');
|
|
37
|
+
}
|
|
38
|
+
if (!version.trim()) {
|
|
39
|
+
throw new Error('版本號不能為空');
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
language,
|
|
43
|
+
version,
|
|
44
|
+
parserOptions,
|
|
45
|
+
parseTime: parseTime || Date.now(),
|
|
46
|
+
nodeCount
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* 建立 AST 的工廠函式
|
|
51
|
+
*/
|
|
52
|
+
export function createAST(sourceFile, root, metadata) {
|
|
53
|
+
if (!sourceFile.trim()) {
|
|
54
|
+
throw new Error('原始檔案名稱不能為空');
|
|
55
|
+
}
|
|
56
|
+
// 計算節點數量
|
|
57
|
+
const nodeCount = countNodes(root);
|
|
58
|
+
const updatedMetadata = { ...metadata, nodeCount };
|
|
59
|
+
return {
|
|
60
|
+
sourceFile,
|
|
61
|
+
root,
|
|
62
|
+
metadata: updatedMetadata
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* ASTNode 型別守衛
|
|
67
|
+
*/
|
|
68
|
+
export function isASTNode(value) {
|
|
69
|
+
if (!value || typeof value !== 'object') {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
const obj = value;
|
|
73
|
+
return (typeof obj.type === 'string' &&
|
|
74
|
+
obj.type.trim().length > 0 &&
|
|
75
|
+
obj.range && typeof obj.range === 'object' &&
|
|
76
|
+
obj.properties && typeof obj.properties === 'object' &&
|
|
77
|
+
Array.isArray(obj.children));
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* ASTMetadata 型別守衛
|
|
81
|
+
*/
|
|
82
|
+
export function isASTMetadata(value) {
|
|
83
|
+
if (!value || typeof value !== 'object') {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
const obj = value;
|
|
87
|
+
return (typeof obj.language === 'string' &&
|
|
88
|
+
obj.language.trim().length > 0 &&
|
|
89
|
+
typeof obj.version === 'string' &&
|
|
90
|
+
obj.version.trim().length > 0 &&
|
|
91
|
+
obj.parserOptions && typeof obj.parserOptions === 'object' &&
|
|
92
|
+
typeof obj.parseTime === 'number' &&
|
|
93
|
+
typeof obj.nodeCount === 'number');
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* AST 型別守衛
|
|
97
|
+
*/
|
|
98
|
+
export function isAST(value) {
|
|
99
|
+
if (!value || typeof value !== 'object') {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
const obj = value;
|
|
103
|
+
return (typeof obj.sourceFile === 'string' &&
|
|
104
|
+
obj.sourceFile.trim().length > 0 &&
|
|
105
|
+
isASTNode(obj.root) &&
|
|
106
|
+
isASTMetadata(obj.metadata));
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* 根據位置找到對應的 AST 節點
|
|
110
|
+
*/
|
|
111
|
+
export function findNodeByPosition(ast, position) {
|
|
112
|
+
return findNodeByPositionRecursive(ast.root, position);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* 根據類型找到所有匹配的 AST 節點
|
|
116
|
+
*/
|
|
117
|
+
export function findNodesByType(ast, type) {
|
|
118
|
+
const result = [];
|
|
119
|
+
findNodesByTypeRecursive(ast.root, type, result);
|
|
120
|
+
return result;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* 取得節點的路徑(從根節點到該節點的類型路徑)
|
|
124
|
+
*/
|
|
125
|
+
export function getNodePath(node) {
|
|
126
|
+
const path = [];
|
|
127
|
+
let currentNode = node;
|
|
128
|
+
while (currentNode) {
|
|
129
|
+
path.unshift(currentNode.type);
|
|
130
|
+
currentNode = currentNode.parent;
|
|
131
|
+
}
|
|
132
|
+
return path;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* 計算節點的深度
|
|
136
|
+
*/
|
|
137
|
+
export function getNodeDepth(node) {
|
|
138
|
+
let depth = 0;
|
|
139
|
+
let currentNode = node.parent;
|
|
140
|
+
while (currentNode) {
|
|
141
|
+
depth++;
|
|
142
|
+
currentNode = currentNode.parent;
|
|
143
|
+
}
|
|
144
|
+
return depth;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* 檢查一個節點是否是另一個節點的祖先
|
|
148
|
+
*/
|
|
149
|
+
export function isNodeAncestorOf(ancestor, descendant) {
|
|
150
|
+
let currentNode = descendant.parent;
|
|
151
|
+
while (currentNode) {
|
|
152
|
+
if (currentNode === ancestor) {
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
currentNode = currentNode.parent;
|
|
156
|
+
}
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
// 輔助函式
|
|
160
|
+
/**
|
|
161
|
+
* 檢查一個範圍是否完全包含在另一個範圍內
|
|
162
|
+
*/
|
|
163
|
+
function isRangeContained(inner, outer) {
|
|
164
|
+
return isPositionInRange(inner.start, outer) && isPositionInRange(inner.end, outer);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* 遞歸計算節點數量
|
|
168
|
+
*/
|
|
169
|
+
function countNodes(node) {
|
|
170
|
+
let count = 1; // 計算自己
|
|
171
|
+
for (const child of node.children) {
|
|
172
|
+
count += countNodes(child);
|
|
173
|
+
}
|
|
174
|
+
return count;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* 遞歸搜尋位置對應的節點
|
|
178
|
+
*/
|
|
179
|
+
function findNodeByPositionRecursive(node, position) {
|
|
180
|
+
if (!isPositionInRange(position, node.range)) {
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
// 先檢查子節點,找到最具體的節點
|
|
184
|
+
for (const child of node.children) {
|
|
185
|
+
const result = findNodeByPositionRecursive(child, position);
|
|
186
|
+
if (result) {
|
|
187
|
+
return result;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
// 如果子節點中沒有找到,返回當前節點
|
|
191
|
+
return node;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* 遞歸搜尋類型匹配的節點
|
|
195
|
+
*/
|
|
196
|
+
function findNodesByTypeRecursive(node, type, result) {
|
|
197
|
+
if (node.type === type) {
|
|
198
|
+
result.push(node);
|
|
199
|
+
}
|
|
200
|
+
for (const child of node.children) {
|
|
201
|
+
findNodesByTypeRecursive(child, type, result);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* 遞歸設定節點的 parent 關係
|
|
206
|
+
*/
|
|
207
|
+
function setParentRelationships(node, parent) {
|
|
208
|
+
// 設定當前節點的 parent
|
|
209
|
+
node.parent = parent;
|
|
210
|
+
// 遞歸設定所有子節點的 parent
|
|
211
|
+
for (const child of node.children) {
|
|
212
|
+
setParentRelationships(child, node);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=ast.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../../src/shared/types/ast.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAmB,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAiC/D;;GAEG;AACH,MAAM,UAAU,aAAa,CAC3B,IAAY,EACZ,KAAY,EACZ,aAAkC,EAAE,EACpC,WAAsB,EAAE;IAExB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACpC,CAAC;IAED,mBAAmB;IACnB,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;QAC7B,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;YAC1C,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IAED,mBAAmB;IACnB,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC;IAE3D,MAAM,IAAI,GAAY;QACpB,IAAI;QACJ,KAAK;QACL,UAAU;QACV,QAAQ,EAAE,YAAY;KACvB,CAAC;IAEF,yBAAyB;IACzB,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAE7B,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAC/B,QAAgB,EAChB,OAAe,E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AAG,MAAM,CAAC;IAE9B,oBAAoB;IACpB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QAClC,sBAAsB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 核心型別定義
|
|
3
|
+
* 包含 Position、Range、Location 等基礎型別
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 表示程式碼中的位置
|
|
7
|
+
*/
|
|
8
|
+
export interface Position {
|
|
9
|
+
readonly line: number;
|
|
10
|
+
readonly column: number;
|
|
11
|
+
readonly offset: number | undefined;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 表示程式碼中的範圍
|
|
15
|
+
*/
|
|
16
|
+
export interface Range {
|
|
17
|
+
readonly start: Position;
|
|
18
|
+
readonly end: Position;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 表示檔案中的位置
|
|
22
|
+
*/
|
|
23
|
+
export interface Location {
|
|
24
|
+
readonly filePath: string;
|
|
25
|
+
readonly range: Range;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* 建立 Position 的工廠函式
|
|
29
|
+
*/
|
|
30
|
+
export declare function createPosition(line: number, column: number, offset?: number): Position;
|
|
31
|
+
/**
|
|
32
|
+
* 建立 Range 的工廠函式
|
|
33
|
+
*/
|
|
34
|
+
export declare function createRange(start: Position, end: Position): Range;
|
|
35
|
+
/**
|
|
36
|
+
* 建立 Location 的工廠函式
|
|
37
|
+
*/
|
|
38
|
+
export declare function createLocation(filePath: string, range: Range): Location;
|
|
39
|
+
/**
|
|
40
|
+
* Position 型別守衛
|
|
41
|
+
*/
|
|
42
|
+
export declare function isPosition(value: unknown): value is Position;
|
|
43
|
+
/**
|
|
44
|
+
* Range 型別守衛
|
|
45
|
+
*/
|
|
46
|
+
export declare function isRange(value: unknown): value is Range;
|
|
47
|
+
/**
|
|
48
|
+
* Location 型別守衛
|
|
49
|
+
*/
|
|
50
|
+
export declare function isLocation(value: unknown): value is Location;
|
|
51
|
+
/**
|
|
52
|
+
* 比較兩個 Position 的先後順序
|
|
53
|
+
* @param pos1 第一個位置
|
|
54
|
+
* @param pos2 第二個位置
|
|
55
|
+
* @returns pos1 是否在 pos2 之前
|
|
56
|
+
*/
|
|
57
|
+
export declare function isPositionBefore(pos1: Position, pos2: Position): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* 檢查 Position 是否在 Range 範圍內(包含邊界)
|
|
60
|
+
* @param position 要檢查的位置
|
|
61
|
+
* @param range 範圍
|
|
62
|
+
* @returns 是否在範圍內
|
|
63
|
+
*/
|
|
64
|
+
export declare function isPositionInRange(position: Position, range: Range): boolean;
|
|
65
|
+
//# sourceMappingURL=core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/shared/types/core.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;CACvB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAgBtF;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,GAAG,KAAK,CASjE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,QAAQ,CASvE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAc5D;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,CAYtD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAY5D;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAKxE;AASD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAK3E"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 核心型別定義
|
|
3
|
+
* 包含 Position、Range、Location 等基礎型別
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 建立 Position 的工廠函式
|
|
7
|
+
*/
|
|
8
|
+
export function createPosition(line, column, offset) {
|
|
9
|
+
if (line < 1) {
|
|
10
|
+
throw new Error('Line 必須大於等於 1');
|
|
11
|
+
}
|
|
12
|
+
if (column < 1) {
|
|
13
|
+
throw new Error('Column 必須大於等於 1');
|
|
14
|
+
}
|
|
15
|
+
if (offset !== undefined && offset < 0) {
|
|
16
|
+
throw new Error('Offset 必須大於等於 0');
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
line,
|
|
20
|
+
column,
|
|
21
|
+
offset: offset !== undefined ? offset : undefined
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 建立 Range 的工廠函式
|
|
26
|
+
*/
|
|
27
|
+
export function createRange(start, end) {
|
|
28
|
+
if (isPositionAfter(start, end)) {
|
|
29
|
+
throw new Error('Range 的 start 不能在 end 之後');
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
start,
|
|
33
|
+
end
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* 建立 Location 的工廠函式
|
|
38
|
+
*/
|
|
39
|
+
export function createLocation(filePath, range) {
|
|
40
|
+
if (!filePath.trim()) {
|
|
41
|
+
throw new Error('檔案路徑不能為空');
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
filePath,
|
|
45
|
+
range
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Position 型別守衛
|
|
50
|
+
*/
|
|
51
|
+
export function isPosition(value) {
|
|
52
|
+
if (!value || typeof value !== 'object') {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
const obj = value;
|
|
56
|
+
return (typeof obj.line === 'number' &&
|
|
57
|
+
obj.line >= 1 &&
|
|
58
|
+
typeof obj.column === 'number' &&
|
|
59
|
+
obj.column >= 1 &&
|
|
60
|
+
(obj.offset === undefined || (typeof obj.offset === 'number' && obj.offset >= 0)));
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Range 型別守衛
|
|
64
|
+
*/
|
|
65
|
+
export function isRange(value) {
|
|
66
|
+
if (!value || typeof value !== 'object') {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
const obj = value;
|
|
70
|
+
return (isPosition(obj.start) &&
|
|
71
|
+
isPosition(obj.end) &&
|
|
72
|
+
!isPositionAfter(obj.start, obj.end));
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Location 型別守衛
|
|
76
|
+
*/
|
|
77
|
+
export function isLocation(value) {
|
|
78
|
+
if (!value || typeof value !== 'object') {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
const obj = value;
|
|
82
|
+
return (typeof obj.filePath === 'string' &&
|
|
83
|
+
obj.filePath.trim().length > 0 &&
|
|
84
|
+
isRange(obj.range));
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* 比較兩個 Position 的先後順序
|
|
88
|
+
* @param pos1 第一個位置
|
|
89
|
+
* @param pos2 第二個位置
|
|
90
|
+
* @returns pos1 是否在 pos2 之前
|
|
91
|
+
*/
|
|
92
|
+
export function isPositionBefore(pos1, pos2) {
|
|
93
|
+
if (pos1.line !== pos2.line) {
|
|
94
|
+
return pos1.line < pos2.line;
|
|
95
|
+
}
|
|
96
|
+
return pos1.column < pos2.column;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* 檢查 pos1 是否在 pos2 之後
|
|
100
|
+
*/
|
|
101
|
+
function isPositionAfter(pos1, pos2) {
|
|
102
|
+
return isPositionBefore(pos2, pos1);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* 檢查 Position 是否在 Range 範圍內(包含邊界)
|
|
106
|
+
* @param position 要檢查的位置
|
|
107
|
+
* @param range 範圍
|
|
108
|
+
* @returns 是否在範圍內
|
|
109
|
+
*/
|
|
110
|
+
export function isPositionInRange(position, range) {
|
|
111
|
+
return (!isPositionBefore(position, range.start) &&
|
|
112
|
+
!isPositionAfter(position, range.end));
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=core.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/shared/types/core.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA2BH;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,MAAc,EAAE,MAAe;IAC1E,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;IACnC,CAAC;IACD,IAAI,MAAM,GAAG,CAAC,EAAE,C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CAAC;AACtC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAkB,EAAE,KAAY;IAChE,OAAO,CACL,CAAC,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC;QACxC,CAAC,eAAe,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,CACtC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 核心型別系統統一匯出
|
|
3
|
+
*/
|
|
4
|
+
export * from './core.js';
|
|
5
|
+
export * from './symbol.js';
|
|
6
|
+
export * from './ast.js';
|
|
7
|
+
export type { Position, Range, Location } from './core.js';
|
|
8
|
+
export { SymbolType, ReferenceType, DependencyType } from './symbol.js';
|
|
9
|
+
export type { Scope, Symbol, Reference, Dependency } from './symbol.js';
|
|
10
|
+
export type { ASTNode, ASTMetadata, AST } from './ast.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,cAAc,WAAW,CAAC;AAG1B,cAAc,aAAa,CAAC;AAG5B,cAAc,UAAU,CAAC;AAGzB,YAAY,EACV,QAAQ,EACR,KAAK,EACL,QAAQ,EACT,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,UAAU,EACV,aAAa,EACb,cAAc,EACf,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,KAAK,EACL,MAAM,EACN,SAAS,EACT,UAAU,EACX,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,OAAO,EACP,WAAW,EACX,GAAG,EACJ,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 核心型別系統統一匯出
|
|
3
|
+
*/
|
|
4
|
+
// 核心型別
|
|
5
|
+
export * from './core.js';
|
|
6
|
+
// Symbol 相關型別
|
|
7
|
+
export * from './symbol.js';
|
|
8
|
+
// AST 相關型別
|
|
9
|
+
export * from './ast.js';
|
|
10
|
+
// enum 需要正常匯出
|
|
11
|
+
export { SymbolType, ReferenceType, DependencyType } from './symbol.js';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO;AACP,cAAc,WAAW,CAAC;AAE1B,cAAc;AACd,cAAc,aAAa,CAAC;AAE5B,WAAW;AACX,cAAc,UAAU,CAAC;AASzB,cAAc;AACd,OAAO,EACL,UAAU,EACV,aAAa,EACb,cAAc,EACf,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Symbol 相關型別定義
|
|
3
|
+
* 包含 SymbolType、Symbol、Reference、Dependency 等型別
|
|
4
|
+
*/
|
|
5
|
+
import { Location } from './core.js';
|
|
6
|
+
/**
|
|
7
|
+
* Symbol 類型列舉
|
|
8
|
+
*/
|
|
9
|
+
export declare enum SymbolType {
|
|
10
|
+
Class = "class",
|
|
11
|
+
Interface = "interface",
|
|
12
|
+
Function = "function",
|
|
13
|
+
Variable = "variable",
|
|
14
|
+
Constant = "constant",
|
|
15
|
+
Type = "type",
|
|
16
|
+
Enum = "enum",
|
|
17
|
+
Module = "module",
|
|
18
|
+
Namespace = "namespace"
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Scope 類型
|
|
22
|
+
*/
|
|
23
|
+
export type ScopeType = 'global' | 'module' | 'namespace' | 'class' | 'function' | 'block';
|
|
24
|
+
/**
|
|
25
|
+
* 表示程式碼作用域
|
|
26
|
+
*/
|
|
27
|
+
export interface Scope {
|
|
28
|
+
readonly type: ScopeType;
|
|
29
|
+
readonly name: string | undefined;
|
|
30
|
+
readonly parent: Scope | undefined;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 表示程式碼符號
|
|
34
|
+
*/
|
|
35
|
+
export interface Symbol {
|
|
36
|
+
readonly name: string;
|
|
37
|
+
readonly type: SymbolType;
|
|
38
|
+
readonly location: Location;
|
|
39
|
+
readonly scope: Scope | undefined;
|
|
40
|
+
readonly modifiers: readonly string[];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Reference 類型列舉
|
|
44
|
+
*/
|
|
45
|
+
export declare enum ReferenceType {
|
|
46
|
+
Definition = "definition",
|
|
47
|
+
Usage = "usage",
|
|
48
|
+
Declaration = "declaration"
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* 表示符號引用
|
|
52
|
+
*/
|
|
53
|
+
export interface Reference {
|
|
54
|
+
readonly symbol: Symbol;
|
|
55
|
+
readonly location: Location;
|
|
56
|
+
readonly type: ReferenceType;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Dependency 類型列舉
|
|
60
|
+
*/
|
|
61
|
+
export declare enum DependencyType {
|
|
62
|
+
Import = "import",
|
|
63
|
+
Require = "require",
|
|
64
|
+
Include = "include"
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* 表示模組依賴
|
|
68
|
+
*/
|
|
69
|
+
export interface Dependency {
|
|
70
|
+
readonly path: string;
|
|
71
|
+
readonly type: DependencyType;
|
|
72
|
+
readonly isRelative: boolean;
|
|
73
|
+
readonly importedSymbols: readonly string[];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* 建立 Scope 的工廠函式
|
|
77
|
+
*/
|
|
78
|
+
export declare function createScope(type: ScopeType, name?: string, parent?: Scope): Scope;
|
|
79
|
+
/**
|
|
80
|
+
* 建立 Symbol 的工廠函式
|
|
81
|
+
*/
|
|
82
|
+
export declare function createSymbol(name: string, type: SymbolType, location: Location, scope?: Scope, modifiers?: string[]): Symbol;
|
|
83
|
+
/**
|
|
84
|
+
* 建立 Reference 的工廠函式
|
|
85
|
+
*/
|
|
86
|
+
export declare function createReference(symbol: Symbol, location: Location, type: ReferenceType): Reference;
|
|
87
|
+
/**
|
|
88
|
+
* 建立 Dependency 的工廠函式
|
|
89
|
+
*/
|
|
90
|
+
export declare function createDependency(path: string, type: DependencyType, isRelative: boolean, importedSymbols?: string[]): Dependency;
|
|
91
|
+
/**
|
|
92
|
+
* Scope 型別守衛
|
|
93
|
+
*/
|
|
94
|
+
export declare function isScope(value: unknown): value is Scope;
|
|
95
|
+
/**
|
|
96
|
+
* Symbol 型別守衛
|
|
97
|
+
*/
|
|
98
|
+
export declare function isSymbol(value: unknown): value is Symbol;
|
|
99
|
+
/**
|
|
100
|
+
* Reference 型別守衛
|
|
101
|
+
*/
|
|
102
|
+
export declare function isReference(value: unknown): value is Reference;
|
|
103
|
+
/**
|
|
104
|
+
* Dependency 型別守衛
|
|
105
|
+
*/
|
|
106
|
+
export declare function isDependency(value: unknown): value is Dependency;
|
|
107
|
+
/**
|
|
108
|
+
* 計算 Scope 的深度
|
|
109
|
+
*/
|
|
110
|
+
export declare function getScopeDepth(scope: Scope): number;
|
|
111
|
+
/**
|
|
112
|
+
* 檢查兩個 Symbol 是否在同一 Scope
|
|
113
|
+
*/
|
|
114
|
+
export declare function isSameScope(symbol1: Symbol, symbol2: Symbol): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* 取得 Scope 的完整路徑
|
|
117
|
+
*/
|
|
118
|
+
export declare function getScopePath(scope: Scope): string[];
|
|
119
|
+
//# sourceMappingURL=symbol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbol.d.ts","sourceRoot":"","sources":["../../../src/shared/types/symbol.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC;;GAEG;AACH,oBAAY,UAAU;IACpB,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,QAAQ,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