agent-ide 0.3.3 → 0.4.1

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.
Files changed (452) hide show
  1. package/README.md +11 -10
  2. package/dist/application/services/module-coordinator.service.d.ts +1 -21
  3. package/dist/application/services/module-coordinator.service.d.ts.map +1 -1
  4. package/dist/application/services/module-coordinator.service.js +10 -149
  5. package/dist/application/services/module-coordinator.service.js.map +1 -1
  6. package/dist/core/{transform/symbol/change-signature → change-signature}/change-signature-service.d.ts +2 -2
  7. package/dist/core/change-signature/change-signature-service.d.ts.map +1 -0
  8. package/dist/core/{transform/symbol/change-signature → change-signature}/change-signature-service.js +1 -1
  9. package/dist/core/change-signature/change-signature-service.js.map +1 -0
  10. package/dist/core/change-signature/index.d.ts.map +1 -0
  11. package/dist/core/change-signature/index.js.map +1 -0
  12. package/dist/core/{transform/symbol/change-signature → change-signature}/signature-parser.d.ts +2 -2
  13. package/dist/core/change-signature/signature-parser.d.ts.map +1 -0
  14. package/dist/core/change-signature/signature-parser.js.map +1 -0
  15. package/dist/core/{transform/symbol/change-signature → change-signature}/types.d.ts +1 -1
  16. package/dist/core/change-signature/types.d.ts.map +1 -0
  17. package/dist/core/change-signature/types.js.map +1 -0
  18. package/dist/core/indexing/index-engine.d.ts.map +1 -1
  19. package/dist/core/indexing/index-engine.js +1 -2
  20. package/dist/core/indexing/index-engine.js.map +1 -1
  21. package/dist/core/indexing/index.d.ts +1 -9
  22. package/dist/core/indexing/index.d.ts.map +1 -1
  23. package/dist/core/indexing/index.js +2 -12
  24. package/dist/core/indexing/index.js.map +1 -1
  25. package/dist/core/indexing/types.d.ts +12 -0
  26. package/dist/core/indexing/types.d.ts.map +1 -1
  27. package/dist/core/indexing/types.js +12 -0
  28. package/dist/core/indexing/types.js.map +1 -1
  29. package/dist/core/{transform/location/move-file → move-file}/import-resolver.d.ts +1 -1
  30. package/dist/core/move-file/import-resolver.d.ts.map +1 -0
  31. package/dist/core/{transform/location/move-file → move-file}/import-resolver.js +2 -2
  32. package/dist/core/move-file/import-resolver.js.map +1 -0
  33. package/dist/core/move-file/index.d.ts.map +1 -0
  34. package/dist/core/move-file/index.js.map +1 -0
  35. package/dist/core/{transform/location/move-file → move-file}/move-service.d.ts +3 -3
  36. package/dist/core/move-file/move-service.d.ts.map +1 -0
  37. package/dist/core/{transform/location/move-file → move-file}/move-service.js +1 -1
  38. package/dist/core/move-file/move-service.js.map +1 -0
  39. package/dist/core/{transform/location/move-file → move-file}/types.d.ts +1 -1
  40. package/dist/core/move-file/types.d.ts.map +1 -0
  41. package/dist/core/move-file/types.js.map +1 -0
  42. package/dist/core/move-member/index.d.ts.map +1 -0
  43. package/dist/core/move-member/index.js.map +1 -0
  44. package/dist/core/{transform/location/move-member → move-member}/member-extractor.d.ts +2 -2
  45. package/dist/core/move-member/member-extractor.d.ts.map +1 -0
  46. package/dist/core/move-member/member-extractor.js.map +1 -0
  47. package/dist/core/{transform/location/move-member → move-member}/move-member-service.d.ts +2 -2
  48. package/dist/core/move-member/move-member-service.d.ts.map +1 -0
  49. package/dist/core/{transform/location/move-member → move-member}/move-member-service.js +1 -1
  50. package/dist/core/move-member/move-member-service.js.map +1 -0
  51. package/dist/core/{transform/location/move-member → move-member}/types.d.ts +1 -1
  52. package/dist/core/move-member/types.d.ts.map +1 -0
  53. package/dist/core/move-member/types.js.map +1 -0
  54. package/dist/core/rename/index.d.ts.map +1 -0
  55. package/dist/core/rename/index.js.map +1 -0
  56. package/dist/core/{transform/symbol/rename → rename}/reference-updater.d.ts +5 -3
  57. package/dist/core/rename/reference-updater.d.ts.map +1 -0
  58. package/dist/core/{transform/symbol/rename → rename}/reference-updater.js +9 -6
  59. package/dist/core/rename/reference-updater.js.map +1 -0
  60. package/dist/core/{transform/symbol/rename → rename}/rename-engine.d.ts +5 -3
  61. package/dist/core/rename/rename-engine.d.ts.map +1 -0
  62. package/dist/core/{transform/symbol/rename → rename}/rename-engine.js +11 -8
  63. package/dist/core/rename/rename-engine.js.map +1 -0
  64. package/dist/core/{transform/symbol/rename → rename}/scope-analyzer.d.ts +3 -3
  65. package/dist/core/rename/scope-analyzer.d.ts.map +1 -0
  66. package/dist/core/{transform/symbol/rename → rename}/scope-analyzer.js +2 -2
  67. package/dist/core/rename/scope-analyzer.js.map +1 -0
  68. package/dist/core/{transform/symbol/rename → rename}/types.d.ts +2 -2
  69. package/dist/core/rename/types.d.ts.map +1 -0
  70. package/dist/core/rename/types.js.map +1 -0
  71. package/dist/core/shared/call-hierarchy-analyzer.d.ts +102 -0
  72. package/dist/core/shared/call-hierarchy-analyzer.d.ts.map +1 -0
  73. package/dist/core/shared/call-hierarchy-analyzer.js +328 -0
  74. package/dist/core/shared/call-hierarchy-analyzer.js.map +1 -0
  75. package/dist/core/shared/index.d.ts +7 -0
  76. package/dist/core/shared/index.d.ts.map +1 -0
  77. package/dist/core/shared/index.js +7 -0
  78. package/dist/core/shared/index.js.map +1 -0
  79. package/dist/core/{transform/shared → shared}/symbol-finder.d.ts +4 -4
  80. package/dist/core/shared/symbol-finder.d.ts.map +1 -0
  81. package/dist/core/shared/symbol-finder.js.map +1 -0
  82. package/dist/infrastructure/formatters/diff-generator.d.ts.map +1 -1
  83. package/dist/infrastructure/formatters/diff-generator.js +11 -1
  84. package/dist/infrastructure/formatters/diff-generator.js.map +1 -1
  85. package/dist/infrastructure/formatters/index.d.ts +1 -1
  86. package/dist/infrastructure/formatters/index.d.ts.map +1 -1
  87. package/dist/infrastructure/formatters/index.js.map +1 -1
  88. package/dist/infrastructure/formatters/query-formatter.d.ts +20 -0
  89. package/dist/infrastructure/formatters/query-formatter.d.ts.map +1 -1
  90. package/dist/infrastructure/formatters/query-formatter.js +145 -14
  91. package/dist/infrastructure/formatters/query-formatter.js.map +1 -1
  92. package/dist/infrastructure/formatters/query-types.d.ts +99 -26
  93. package/dist/infrastructure/formatters/query-types.d.ts.map +1 -1
  94. package/dist/infrastructure/formatters/query-types.js +2 -3
  95. package/dist/infrastructure/formatters/query-types.js.map +1 -1
  96. package/dist/infrastructure/formatters/types.d.ts +10 -0
  97. package/dist/infrastructure/formatters/types.d.ts.map +1 -1
  98. package/dist/infrastructure/parser/base.d.ts +0 -32
  99. package/dist/infrastructure/parser/base.d.ts.map +1 -1
  100. package/dist/infrastructure/parser/base.js +0 -64
  101. package/dist/infrastructure/parser/base.js.map +1 -1
  102. package/dist/infrastructure/parser/index.d.ts +0 -2
  103. package/dist/infrastructure/parser/index.d.ts.map +1 -1
  104. package/dist/infrastructure/parser/index.js +1 -2
  105. package/dist/infrastructure/parser/index.js.map +1 -1
  106. package/dist/infrastructure/parser/interface.d.ts +1 -58
  107. package/dist/infrastructure/parser/interface.d.ts.map +1 -1
  108. package/dist/infrastructure/parser/interface.js +1 -11
  109. package/dist/infrastructure/parser/interface.js.map +1 -1
  110. package/dist/infrastructure/storage/index.d.ts +0 -2
  111. package/dist/infrastructure/storage/index.d.ts.map +1 -1
  112. package/dist/infrastructure/storage/index.js +0 -2
  113. package/dist/infrastructure/storage/index.js.map +1 -1
  114. package/dist/interfaces/cli/cli.d.ts.map +1 -1
  115. package/dist/interfaces/cli/cli.js +11 -17
  116. package/dist/interfaces/cli/cli.js.map +1 -1
  117. package/dist/interfaces/cli/commands/call-hierarchy.command.d.ts +11 -0
  118. package/dist/interfaces/cli/commands/call-hierarchy.command.d.ts.map +1 -0
  119. package/dist/interfaces/cli/commands/call-hierarchy.command.js +161 -0
  120. package/dist/interfaces/cli/commands/call-hierarchy.command.js.map +1 -0
  121. package/dist/interfaces/cli/commands/change-signature.command.js +8 -17
  122. package/dist/interfaces/cli/commands/change-signature.command.js.map +1 -1
  123. package/dist/interfaces/cli/commands/cycles.command.d.ts +11 -0
  124. package/dist/interfaces/cli/commands/cycles.command.d.ts.map +1 -0
  125. package/dist/interfaces/cli/commands/cycles.command.js +87 -0
  126. package/dist/interfaces/cli/commands/cycles.command.js.map +1 -0
  127. package/dist/interfaces/cli/commands/find-references.command.d.ts +11 -0
  128. package/dist/interfaces/cli/commands/find-references.command.d.ts.map +1 -0
  129. package/dist/interfaces/cli/commands/find-references.command.js +122 -0
  130. package/dist/interfaces/cli/commands/find-references.command.js.map +1 -0
  131. package/dist/interfaces/cli/commands/impact.command.d.ts +11 -0
  132. package/dist/interfaces/cli/commands/impact.command.d.ts.map +1 -0
  133. package/dist/interfaces/cli/commands/impact.command.js +98 -0
  134. package/dist/interfaces/cli/commands/impact.command.js.map +1 -0
  135. package/dist/interfaces/cli/commands/index.d.ts +4 -6
  136. package/dist/interfaces/cli/commands/index.d.ts.map +1 -1
  137. package/dist/interfaces/cli/commands/index.js +6 -6
  138. package/dist/interfaces/cli/commands/index.js.map +1 -1
  139. package/dist/interfaces/cli/commands/move-member.command.js +7 -16
  140. package/dist/interfaces/cli/commands/move-member.command.js.map +1 -1
  141. package/dist/interfaces/cli/commands/move.command.js +21 -29
  142. package/dist/interfaces/cli/commands/move.command.js.map +1 -1
  143. package/dist/interfaces/cli/commands/rename.command.js +105 -119
  144. package/dist/interfaces/cli/commands/rename.command.js.map +1 -1
  145. package/dist/interfaces/cli/unified-output-handler.d.ts +3 -1
  146. package/dist/interfaces/cli/unified-output-handler.d.ts.map +1 -1
  147. package/dist/interfaces/cli/unified-output-handler.js +11 -2
  148. package/dist/interfaces/cli/unified-output-handler.js.map +1 -1
  149. package/dist/plugins/python/index.d.ts +0 -8
  150. package/dist/plugins/python/index.d.ts.map +1 -1
  151. package/dist/plugins/python/index.js +0 -9
  152. package/dist/plugins/python/index.js.map +1 -1
  153. package/dist/plugins/python/parser.d.ts +8 -41
  154. package/dist/plugins/python/parser.d.ts.map +1 -1
  155. package/dist/plugins/python/parser.js +30 -92
  156. package/dist/plugins/python/parser.js.map +1 -1
  157. package/dist/plugins/swift/parser.d.ts +4 -0
  158. package/dist/plugins/swift/parser.d.ts.map +1 -1
  159. package/dist/plugins/swift/parser.js +22 -4
  160. package/dist/plugins/swift/parser.js.map +1 -1
  161. package/dist/plugins/typescript/parser.d.ts +4 -37
  162. package/dist/plugins/typescript/parser.d.ts.map +1 -1
  163. package/dist/plugins/typescript/parser.js +17 -328
  164. package/dist/plugins/typescript/parser.js.map +1 -1
  165. package/dist/shared/types/symbol.d.ts +2 -1
  166. package/dist/shared/types/symbol.d.ts.map +1 -1
  167. package/dist/shared/types/symbol.js +1 -0
  168. package/dist/shared/types/symbol.js.map +1 -1
  169. package/package.json +8 -6
  170. package/dist/core/indexing/file-watcher.d.ts +0 -112
  171. package/dist/core/indexing/file-watcher.d.ts.map +0 -1
  172. package/dist/core/indexing/file-watcher.js +0 -284
  173. package/dist/core/indexing/file-watcher.js.map +0 -1
  174. package/dist/core/search/engines/text-engine.d.ts +0 -55
  175. package/dist/core/search/engines/text-engine.d.ts.map +0 -1
  176. package/dist/core/search/engines/text-engine.js +0 -377
  177. package/dist/core/search/engines/text-engine.js.map +0 -1
  178. package/dist/core/search/index.d.ts +0 -10
  179. package/dist/core/search/index.d.ts.map +0 -1
  180. package/dist/core/search/index.js +0 -11
  181. package/dist/core/search/index.js.map +0 -1
  182. package/dist/core/search/service.d.ts +0 -106
  183. package/dist/core/search/service.d.ts.map +0 -1
  184. package/dist/core/search/service.js +0 -384
  185. package/dist/core/search/service.js.map +0 -1
  186. package/dist/core/search/types.d.ts +0 -357
  187. package/dist/core/search/types.d.ts.map +0 -1
  188. package/dist/core/search/types.js +0 -47
  189. package/dist/core/search/types.js.map +0 -1
  190. package/dist/core/transform/index.d.ts +0 -10
  191. package/dist/core/transform/index.d.ts.map +0 -1
  192. package/dist/core/transform/index.js +0 -21
  193. package/dist/core/transform/index.js.map +0 -1
  194. package/dist/core/transform/location/index.d.ts +0 -8
  195. package/dist/core/transform/location/index.d.ts.map +0 -1
  196. package/dist/core/transform/location/index.js +0 -9
  197. package/dist/core/transform/location/index.js.map +0 -1
  198. package/dist/core/transform/location/move-file/import-resolver.d.ts.map +0 -1
  199. package/dist/core/transform/location/move-file/import-resolver.js.map +0 -1
  200. package/dist/core/transform/location/move-file/index.d.ts.map +0 -1
  201. package/dist/core/transform/location/move-file/index.js.map +0 -1
  202. package/dist/core/transform/location/move-file/move-service.d.ts.map +0 -1
  203. package/dist/core/transform/location/move-file/move-service.js.map +0 -1
  204. package/dist/core/transform/location/move-file/types.d.ts.map +0 -1
  205. package/dist/core/transform/location/move-file/types.js.map +0 -1
  206. package/dist/core/transform/location/move-member/index.d.ts.map +0 -1
  207. package/dist/core/transform/location/move-member/index.js.map +0 -1
  208. package/dist/core/transform/location/move-member/member-extractor.d.ts.map +0 -1
  209. package/dist/core/transform/location/move-member/member-extractor.js.map +0 -1
  210. package/dist/core/transform/location/move-member/move-member-service.d.ts.map +0 -1
  211. package/dist/core/transform/location/move-member/move-member-service.js.map +0 -1
  212. package/dist/core/transform/location/move-member/types.d.ts.map +0 -1
  213. package/dist/core/transform/location/move-member/types.js.map +0 -1
  214. package/dist/core/transform/location/shift/file-generator.d.ts +0 -45
  215. package/dist/core/transform/location/shift/file-generator.d.ts.map +0 -1
  216. package/dist/core/transform/location/shift/file-generator.js +0 -94
  217. package/dist/core/transform/location/shift/file-generator.js.map +0 -1
  218. package/dist/core/transform/location/shift/index.d.ts +0 -11
  219. package/dist/core/transform/location/shift/index.d.ts.map +0 -1
  220. package/dist/core/transform/location/shift/index.js +0 -13
  221. package/dist/core/transform/location/shift/index.js.map +0 -1
  222. package/dist/core/transform/location/shift/line-extractor.d.ts +0 -55
  223. package/dist/core/transform/location/shift/line-extractor.d.ts.map +0 -1
  224. package/dist/core/transform/location/shift/line-extractor.js +0 -123
  225. package/dist/core/transform/location/shift/line-extractor.js.map +0 -1
  226. package/dist/core/transform/location/shift/shift-service.d.ts +0 -57
  227. package/dist/core/transform/location/shift/shift-service.d.ts.map +0 -1
  228. package/dist/core/transform/location/shift/shift-service.js +0 -199
  229. package/dist/core/transform/location/shift/shift-service.js.map +0 -1
  230. package/dist/core/transform/location/shift/types.d.ts +0 -195
  231. package/dist/core/transform/location/shift/types.d.ts.map +0 -1
  232. package/dist/core/transform/location/shift/types.js +0 -89
  233. package/dist/core/transform/location/shift/types.js.map +0 -1
  234. package/dist/core/transform/shared/code-editor.d.ts +0 -70
  235. package/dist/core/transform/shared/code-editor.d.ts.map +0 -1
  236. package/dist/core/transform/shared/code-editor.js +0 -206
  237. package/dist/core/transform/shared/code-editor.js.map +0 -1
  238. package/dist/core/transform/shared/index.d.ts +0 -7
  239. package/dist/core/transform/shared/index.d.ts.map +0 -1
  240. package/dist/core/transform/shared/index.js +0 -7
  241. package/dist/core/transform/shared/index.js.map +0 -1
  242. package/dist/core/transform/shared/symbol-finder.d.ts.map +0 -1
  243. package/dist/core/transform/shared/symbol-finder.js.map +0 -1
  244. package/dist/core/transform/structure/extract/extract-function.d.ts +0 -197
  245. package/dist/core/transform/structure/extract/extract-function.d.ts.map +0 -1
  246. package/dist/core/transform/structure/extract/extract-function.js +0 -730
  247. package/dist/core/transform/structure/extract/extract-function.js.map +0 -1
  248. package/dist/core/transform/structure/extract/index.d.ts +0 -7
  249. package/dist/core/transform/structure/extract/index.d.ts.map +0 -1
  250. package/dist/core/transform/structure/extract/index.js +0 -9
  251. package/dist/core/transform/structure/extract/index.js.map +0 -1
  252. package/dist/core/transform/structure/extract/swift-extractor.d.ts +0 -98
  253. package/dist/core/transform/structure/extract/swift-extractor.d.ts.map +0 -1
  254. package/dist/core/transform/structure/extract/swift-extractor.js +0 -283
  255. package/dist/core/transform/structure/extract/swift-extractor.js.map +0 -1
  256. package/dist/core/transform/structure/index.d.ts +0 -8
  257. package/dist/core/transform/structure/index.d.ts.map +0 -1
  258. package/dist/core/transform/structure/index.js +0 -8
  259. package/dist/core/transform/structure/index.js.map +0 -1
  260. package/dist/core/transform/structure/inline/index.d.ts +0 -6
  261. package/dist/core/transform/structure/inline/index.d.ts.map +0 -1
  262. package/dist/core/transform/structure/inline/index.js +0 -6
  263. package/dist/core/transform/structure/inline/index.js.map +0 -1
  264. package/dist/core/transform/structure/inline/inline-function.d.ts +0 -175
  265. package/dist/core/transform/structure/inline/inline-function.d.ts.map +0 -1
  266. package/dist/core/transform/structure/inline/inline-function.js +0 -436
  267. package/dist/core/transform/structure/inline/inline-function.js.map +0 -1
  268. package/dist/core/transform/structure/patterns/design-patterns.d.ts +0 -178
  269. package/dist/core/transform/structure/patterns/design-patterns.d.ts.map +0 -1
  270. package/dist/core/transform/structure/patterns/design-patterns.js +0 -656
  271. package/dist/core/transform/structure/patterns/design-patterns.js.map +0 -1
  272. package/dist/core/transform/structure/patterns/index.d.ts +0 -6
  273. package/dist/core/transform/structure/patterns/index.d.ts.map +0 -1
  274. package/dist/core/transform/structure/patterns/index.js +0 -6
  275. package/dist/core/transform/structure/patterns/index.js.map +0 -1
  276. package/dist/core/transform/symbol/change-signature/change-signature-service.d.ts.map +0 -1
  277. package/dist/core/transform/symbol/change-signature/change-signature-service.js.map +0 -1
  278. package/dist/core/transform/symbol/change-signature/index.d.ts.map +0 -1
  279. package/dist/core/transform/symbol/change-signature/index.js.map +0 -1
  280. package/dist/core/transform/symbol/change-signature/signature-parser.d.ts.map +0 -1
  281. package/dist/core/transform/symbol/change-signature/signature-parser.js.map +0 -1
  282. package/dist/core/transform/symbol/change-signature/types.d.ts.map +0 -1
  283. package/dist/core/transform/symbol/change-signature/types.js.map +0 -1
  284. package/dist/core/transform/symbol/index.d.ts +0 -7
  285. package/dist/core/transform/symbol/index.d.ts.map +0 -1
  286. package/dist/core/transform/symbol/index.js +0 -7
  287. package/dist/core/transform/symbol/index.js.map +0 -1
  288. package/dist/core/transform/symbol/rename/index.d.ts.map +0 -1
  289. package/dist/core/transform/symbol/rename/index.js.map +0 -1
  290. package/dist/core/transform/symbol/rename/reference-updater.d.ts.map +0 -1
  291. package/dist/core/transform/symbol/rename/reference-updater.js.map +0 -1
  292. package/dist/core/transform/symbol/rename/rename-engine.d.ts.map +0 -1
  293. package/dist/core/transform/symbol/rename/rename-engine.js.map +0 -1
  294. package/dist/core/transform/symbol/rename/scope-analyzer.d.ts.map +0 -1
  295. package/dist/core/transform/symbol/rename/scope-analyzer.js.map +0 -1
  296. package/dist/core/transform/symbol/rename/types.d.ts.map +0 -1
  297. package/dist/core/transform/symbol/rename/types.js.map +0 -1
  298. package/dist/core/transform/types.d.ts +0 -185
  299. package/dist/core/transform/types.d.ts.map +0 -1
  300. package/dist/core/transform/types.js +0 -150
  301. package/dist/core/transform/types.js.map +0 -1
  302. package/dist/infrastructure/parser/factory.d.ts +0 -141
  303. package/dist/infrastructure/parser/factory.d.ts.map +0 -1
  304. package/dist/infrastructure/parser/factory.js +0 -306
  305. package/dist/infrastructure/parser/factory.js.map +0 -1
  306. package/dist/infrastructure/storage/file-watcher.d.ts +0 -84
  307. package/dist/infrastructure/storage/file-watcher.d.ts.map +0 -1
  308. package/dist/infrastructure/storage/file-watcher.js +0 -249
  309. package/dist/infrastructure/storage/file-watcher.js.map +0 -1
  310. package/dist/infrastructure/storage/path-utils.d.ts +0 -96
  311. package/dist/infrastructure/storage/path-utils.d.ts.map +0 -1
  312. package/dist/infrastructure/storage/path-utils.js +0 -272
  313. package/dist/infrastructure/storage/path-utils.js.map +0 -1
  314. package/dist/interfaces/cli/commands/analyze.command.d.ts +0 -11
  315. package/dist/interfaces/cli/commands/analyze.command.d.ts.map +0 -1
  316. package/dist/interfaces/cli/commands/analyze.command.js +0 -460
  317. package/dist/interfaces/cli/commands/analyze.command.js.map +0 -1
  318. package/dist/interfaces/cli/commands/deps.command.d.ts +0 -11
  319. package/dist/interfaces/cli/commands/deps.command.d.ts.map +0 -1
  320. package/dist/interfaces/cli/commands/deps.command.js +0 -143
  321. package/dist/interfaces/cli/commands/deps.command.js.map +0 -1
  322. package/dist/interfaces/cli/commands/extract.command.d.ts +0 -11
  323. package/dist/interfaces/cli/commands/extract.command.d.ts.map +0 -1
  324. package/dist/interfaces/cli/commands/extract.command.js +0 -314
  325. package/dist/interfaces/cli/commands/extract.command.js.map +0 -1
  326. package/dist/interfaces/cli/commands/inline.command.d.ts +0 -11
  327. package/dist/interfaces/cli/commands/inline.command.d.ts.map +0 -1
  328. package/dist/interfaces/cli/commands/inline.command.js +0 -208
  329. package/dist/interfaces/cli/commands/inline.command.js.map +0 -1
  330. package/dist/interfaces/cli/commands/refactor.command.d.ts +0 -11
  331. package/dist/interfaces/cli/commands/refactor.command.d.ts.map +0 -1
  332. package/dist/interfaces/cli/commands/refactor.command.js +0 -414
  333. package/dist/interfaces/cli/commands/refactor.command.js.map +0 -1
  334. package/dist/interfaces/cli/commands/search.command.d.ts +0 -11
  335. package/dist/interfaces/cli/commands/search.command.d.ts.map +0 -1
  336. package/dist/interfaces/cli/commands/search.command.js +0 -409
  337. package/dist/interfaces/cli/commands/search.command.js.map +0 -1
  338. package/dist/interfaces/cli/commands/shift.command.d.ts +0 -11
  339. package/dist/interfaces/cli/commands/shift.command.d.ts.map +0 -1
  340. package/dist/interfaces/cli/commands/shift.command.js +0 -143
  341. package/dist/interfaces/cli/commands/shift.command.js.map +0 -1
  342. package/dist/plugins/python/analyzers/complexity-analyzer.d.ts +0 -50
  343. package/dist/plugins/python/analyzers/complexity-analyzer.d.ts.map +0 -1
  344. package/dist/plugins/python/analyzers/complexity-analyzer.js +0 -172
  345. package/dist/plugins/python/analyzers/complexity-analyzer.js.map +0 -1
  346. package/dist/plugins/python/analyzers/duplication-detector.d.ts +0 -39
  347. package/dist/plugins/python/analyzers/duplication-detector.d.ts.map +0 -1
  348. package/dist/plugins/python/analyzers/duplication-detector.js +0 -146
  349. package/dist/plugins/python/analyzers/duplication-detector.js.map +0 -1
  350. package/dist/plugins/python/analyzers/error-handling-checker.d.ts +0 -28
  351. package/dist/plugins/python/analyzers/error-handling-checker.d.ts.map +0 -1
  352. package/dist/plugins/python/analyzers/error-handling-checker.js +0 -143
  353. package/dist/plugins/python/analyzers/error-handling-checker.js.map +0 -1
  354. package/dist/plugins/python/analyzers/naming-checker.d.ts +0 -56
  355. package/dist/plugins/python/analyzers/naming-checker.d.ts.map +0 -1
  356. package/dist/plugins/python/analyzers/naming-checker.js +0 -220
  357. package/dist/plugins/python/analyzers/naming-checker.js.map +0 -1
  358. package/dist/plugins/python/analyzers/pattern-detector.d.ts +0 -44
  359. package/dist/plugins/python/analyzers/pattern-detector.d.ts.map +0 -1
  360. package/dist/plugins/python/analyzers/pattern-detector.js +0 -222
  361. package/dist/plugins/python/analyzers/pattern-detector.js.map +0 -1
  362. package/dist/plugins/python/analyzers/security-checker.d.ts +0 -56
  363. package/dist/plugins/python/analyzers/security-checker.d.ts.map +0 -1
  364. package/dist/plugins/python/analyzers/security-checker.js +0 -279
  365. package/dist/plugins/python/analyzers/security-checker.js.map +0 -1
  366. package/dist/plugins/python/analyzers/type-safety-checker.d.ts +0 -44
  367. package/dist/plugins/python/analyzers/type-safety-checker.d.ts.map +0 -1
  368. package/dist/plugins/python/analyzers/type-safety-checker.js +0 -177
  369. package/dist/plugins/python/analyzers/type-safety-checker.js.map +0 -1
  370. package/dist/plugins/python/analyzers/unused-symbol-detector.d.ts +0 -37
  371. package/dist/plugins/python/analyzers/unused-symbol-detector.d.ts.map +0 -1
  372. package/dist/plugins/python/analyzers/unused-symbol-detector.js +0 -141
  373. package/dist/plugins/python/analyzers/unused-symbol-detector.js.map +0 -1
  374. package/dist/plugins/swift/analyzers/complexity-analyzer.d.ts +0 -41
  375. package/dist/plugins/swift/analyzers/complexity-analyzer.d.ts.map +0 -1
  376. package/dist/plugins/swift/analyzers/complexity-analyzer.js +0 -206
  377. package/dist/plugins/swift/analyzers/complexity-analyzer.js.map +0 -1
  378. package/dist/plugins/swift/analyzers/duplication-detector.d.ts +0 -89
  379. package/dist/plugins/swift/analyzers/duplication-detector.d.ts.map +0 -1
  380. package/dist/plugins/swift/analyzers/duplication-detector.js +0 -271
  381. package/dist/plugins/swift/analyzers/duplication-detector.js.map +0 -1
  382. package/dist/plugins/swift/analyzers/error-handling-checker.d.ts +0 -34
  383. package/dist/plugins/swift/analyzers/error-handling-checker.d.ts.map +0 -1
  384. package/dist/plugins/swift/analyzers/error-handling-checker.js +0 -135
  385. package/dist/plugins/swift/analyzers/error-handling-checker.js.map +0 -1
  386. package/dist/plugins/swift/analyzers/naming-checker.d.ts +0 -47
  387. package/dist/plugins/swift/analyzers/naming-checker.d.ts.map +0 -1
  388. package/dist/plugins/swift/analyzers/naming-checker.js +0 -161
  389. package/dist/plugins/swift/analyzers/naming-checker.js.map +0 -1
  390. package/dist/plugins/swift/analyzers/pattern-detector.d.ts +0 -78
  391. package/dist/plugins/swift/analyzers/pattern-detector.d.ts.map +0 -1
  392. package/dist/plugins/swift/analyzers/pattern-detector.js +0 -247
  393. package/dist/plugins/swift/analyzers/pattern-detector.js.map +0 -1
  394. package/dist/plugins/swift/analyzers/security-checker.d.ts +0 -38
  395. package/dist/plugins/swift/analyzers/security-checker.d.ts.map +0 -1
  396. package/dist/plugins/swift/analyzers/security-checker.js +0 -135
  397. package/dist/plugins/swift/analyzers/security-checker.js.map +0 -1
  398. package/dist/plugins/swift/analyzers/type-safety-checker.d.ts +0 -41
  399. package/dist/plugins/swift/analyzers/type-safety-checker.d.ts.map +0 -1
  400. package/dist/plugins/swift/analyzers/type-safety-checker.js +0 -121
  401. package/dist/plugins/swift/analyzers/type-safety-checker.js.map +0 -1
  402. package/dist/plugins/swift/analyzers/unused-symbol-detector.d.ts +0 -38
  403. package/dist/plugins/swift/analyzers/unused-symbol-detector.d.ts.map +0 -1
  404. package/dist/plugins/swift/analyzers/unused-symbol-detector.js +0 -211
  405. package/dist/plugins/swift/analyzers/unused-symbol-detector.js.map +0 -1
  406. package/dist/plugins/typescript/analyzers/complexity-analyzer.d.ts +0 -39
  407. package/dist/plugins/typescript/analyzers/complexity-analyzer.d.ts.map +0 -1
  408. package/dist/plugins/typescript/analyzers/complexity-analyzer.js +0 -196
  409. package/dist/plugins/typescript/analyzers/complexity-analyzer.js.map +0 -1
  410. package/dist/plugins/typescript/analyzers/duplication-detector.d.ts +0 -181
  411. package/dist/plugins/typescript/analyzers/duplication-detector.d.ts.map +0 -1
  412. package/dist/plugins/typescript/analyzers/duplication-detector.js +0 -695
  413. package/dist/plugins/typescript/analyzers/duplication-detector.js.map +0 -1
  414. package/dist/plugins/typescript/analyzers/error-handling-checker.d.ts +0 -26
  415. package/dist/plugins/typescript/analyzers/error-handling-checker.d.ts.map +0 -1
  416. package/dist/plugins/typescript/analyzers/error-handling-checker.js +0 -84
  417. package/dist/plugins/typescript/analyzers/error-handling-checker.js.map +0 -1
  418. package/dist/plugins/typescript/analyzers/naming-checker.d.ts +0 -30
  419. package/dist/plugins/typescript/analyzers/naming-checker.d.ts.map +0 -1
  420. package/dist/plugins/typescript/analyzers/naming-checker.js +0 -116
  421. package/dist/plugins/typescript/analyzers/naming-checker.js.map +0 -1
  422. package/dist/plugins/typescript/analyzers/pattern-detector.d.ts +0 -80
  423. package/dist/plugins/typescript/analyzers/pattern-detector.d.ts.map +0 -1
  424. package/dist/plugins/typescript/analyzers/pattern-detector.js +0 -267
  425. package/dist/plugins/typescript/analyzers/pattern-detector.js.map +0 -1
  426. package/dist/plugins/typescript/analyzers/security-checker.d.ts +0 -34
  427. package/dist/plugins/typescript/analyzers/security-checker.d.ts.map +0 -1
  428. package/dist/plugins/typescript/analyzers/security-checker.js +0 -126
  429. package/dist/plugins/typescript/analyzers/security-checker.js.map +0 -1
  430. package/dist/plugins/typescript/analyzers/type-safety-checker.d.ts +0 -32
  431. package/dist/plugins/typescript/analyzers/type-safety-checker.d.ts.map +0 -1
  432. package/dist/plugins/typescript/analyzers/type-safety-checker.js +0 -86
  433. package/dist/plugins/typescript/analyzers/type-safety-checker.js.map +0 -1
  434. package/dist/plugins/typescript/analyzers/unused-symbol-detector.d.ts +0 -47
  435. package/dist/plugins/typescript/analyzers/unused-symbol-detector.d.ts.map +0 -1
  436. package/dist/plugins/typescript/analyzers/unused-symbol-detector.js +0 -152
  437. package/dist/plugins/typescript/analyzers/unused-symbol-detector.js.map +0 -1
  438. /package/dist/core/{transform/symbol/change-signature → change-signature}/index.d.ts +0 -0
  439. /package/dist/core/{transform/symbol/change-signature → change-signature}/index.js +0 -0
  440. /package/dist/core/{transform/symbol/change-signature → change-signature}/signature-parser.js +0 -0
  441. /package/dist/core/{transform/symbol/change-signature → change-signature}/types.js +0 -0
  442. /package/dist/core/{transform/location/move-file → move-file}/index.d.ts +0 -0
  443. /package/dist/core/{transform/location/move-file → move-file}/index.js +0 -0
  444. /package/dist/core/{transform/location/move-file → move-file}/types.js +0 -0
  445. /package/dist/core/{transform/location/move-member → move-member}/index.d.ts +0 -0
  446. /package/dist/core/{transform/location/move-member → move-member}/index.js +0 -0
  447. /package/dist/core/{transform/location/move-member → move-member}/member-extractor.js +0 -0
  448. /package/dist/core/{transform/location/move-member → move-member}/types.js +0 -0
  449. /package/dist/core/{transform/symbol/rename → rename}/index.d.ts +0 -0
  450. /package/dist/core/{transform/symbol/rename → rename}/index.js +0 -0
  451. /package/dist/core/{transform/symbol/rename → rename}/types.js +0 -0
  452. /package/dist/core/{transform/shared → shared}/symbol-finder.js +0 -0
@@ -1,460 +0,0 @@
1
- /**
2
- * Analyze 命令
3
- * 分析程式碼品質
4
- */
5
- import * as path from 'path';
6
- import { ParserRegistry } from '../../../infrastructure/parser/registry.js';
7
- import { QueryCommand, AnalyzeType, IssueSeverity } from '../../../infrastructure/formatters/index.js';
8
- import { createUnifiedOutputHandler, parseOutputFormat, OutputFormat } from '../../cli/unified-output-handler.js';
9
- /**
10
- * 設定 analyze 命令
11
- */
12
- export function setupAnalyzeCommand(program, context) {
13
- program
14
- .command('analyze [type]')
15
- .description('分析程式碼品質')
16
- .option('-p, --path <path>', '分析路徑', '.')
17
- .option('--pattern <pattern>', '分析模式')
18
- .option('--format <format>', '輸出格式 (json|summary)', 'summary')
19
- .option('--all', '顯示所有掃描結果(預設只顯示有問題的項目)', false)
20
- .action(async (type, options) => {
21
- await handleAnalyzeCommand(type, options, context);
22
- });
23
- }
24
- /**
25
- * 處理 analyze 命令
26
- */
27
- async function handleAnalyzeCommand(type, options, context) {
28
- const outputHandler = createUnifiedOutputHandler();
29
- let format;
30
- try {
31
- format = parseOutputFormat(options.format, false);
32
- }
33
- catch {
34
- outputHandler.outputError('不支援的輸出格式。可用格式: json, summary', OutputFormat.Summary);
35
- process.exitCode = 1;
36
- return;
37
- }
38
- const analyzeType = type || 'complexity';
39
- if (format !== OutputFormat.Json) {
40
- console.log('🔍 分析程式碼品質...');
41
- }
42
- try {
43
- const analyzePath = options.path || process.cwd();
44
- if (analyzeType === 'complexity') {
45
- await analyzeComplexity(analyzePath, options, context, format, outputHandler);
46
- }
47
- else if (analyzeType === 'dead-code') {
48
- await analyzeDeadCode(analyzePath, options, context, format, outputHandler);
49
- }
50
- else if (analyzeType === 'best-practices') {
51
- await analyzeBestPractices(analyzePath, options, context, format, outputHandler);
52
- }
53
- else if (analyzeType === 'patterns') {
54
- await analyzePatterns(analyzePath, options, context, format, outputHandler);
55
- }
56
- else if (analyzeType === 'quality') {
57
- await analyzeQuality(analyzePath, options, context, format, outputHandler);
58
- }
59
- else {
60
- throw new Error(`不支援的分析類型: ${analyzeType}`);
61
- }
62
- }
63
- catch (error) {
64
- handleError(error, format);
65
- }
66
- }
67
- /**
68
- * 分析複雜度
69
- */
70
- async function analyzeComplexity(analyzePath, options, context, format, outputHandler) {
71
- const registry = ParserRegistry.getInstance();
72
- const files = await getAllProjectFiles(analyzePath, context);
73
- const results = [];
74
- for (const file of files) {
75
- try {
76
- const parser = registry.getParser(path.extname(file));
77
- if (!parser) {
78
- continue;
79
- }
80
- const content = await context.fileSystem.readFile(file, 'utf-8');
81
- const ast = await parser.parse(content, file);
82
- const complexity = await parser.analyzeComplexity(content, ast);
83
- results.push({ file, complexity });
84
- }
85
- catch {
86
- // 忽略無法分析的檔案
87
- }
88
- }
89
- const highComplexityFiles = results.filter(r => r.complexity.evaluation === 'high' || r.complexity.cyclomaticComplexity > 10);
90
- const complexities = results.map(r => r.complexity.cyclomaticComplexity);
91
- const averageComplexity = complexities.length > 0
92
- ? complexities.reduce((sum, c) => sum + c, 0) / complexities.length
93
- : 0;
94
- const maxComplexity = complexities.length > 0
95
- ? Math.max(...complexities)
96
- : 0;
97
- // 建立 AnalyzeResult
98
- const issues = highComplexityFiles.map(r => ({
99
- type: 'complexity',
100
- severity: r.complexity.cyclomaticComplexity > 20 ? IssueSeverity.High : IssueSeverity.Medium,
101
- message: `複雜度 ${r.complexity.cyclomaticComplexity},認知複雜度 ${r.complexity.cognitiveComplexity}`,
102
- filePath: r.file,
103
- score: r.complexity.cyclomaticComplexity
104
- }));
105
- const result = {
106
- command: QueryCommand.Analyze,
107
- success: true,
108
- analyzeType: AnalyzeType.Complexity,
109
- summary: {
110
- totalScanned: results.length,
111
- issuesFound: highComplexityFiles.length,
112
- averageComplexity,
113
- maxComplexity
114
- },
115
- issues,
116
- metrics: options.all ? {
117
- all: results.map(r => ({
118
- path: r.file,
119
- complexity: r.complexity.cyclomaticComplexity,
120
- cognitiveComplexity: r.complexity.cognitiveComplexity,
121
- evaluation: r.complexity.evaluation
122
- }))
123
- } : undefined
124
- };
125
- outputHandler.outputQuery(result, format);
126
- }
127
- /**
128
- * 分析死代碼
129
- */
130
- async function analyzeDeadCode(analyzePath, options, context, format, outputHandler) {
131
- const registry = ParserRegistry.getInstance();
132
- const files = await getAllProjectFiles(analyzePath, context);
133
- const results = [];
134
- for (const file of files) {
135
- try {
136
- const parser = registry.getParser(path.extname(file));
137
- if (!parser) {
138
- continue;
139
- }
140
- const content = await context.fileSystem.readFile(file, 'utf-8');
141
- const ast = await parser.parse(content, file);
142
- const symbols = await parser.extractSymbols(ast);
143
- const deadCode = await parser.detectUnusedSymbols(ast, symbols);
144
- results.push({ file, deadCode });
145
- }
146
- catch {
147
- // 忽略無法分析的檔案
148
- }
149
- }
150
- const filesWithDeadCode = results.filter(r => r.deadCode.length > 0);
151
- const allDeadCode = results.flatMap(r => r.deadCode.map(d => ({ ...d, file: r.file })));
152
- const deadFunctions = allDeadCode.filter(d => d.type === 'function');
153
- const deadVariables = allDeadCode.filter(d => d.type === 'variable');
154
- // 建立 AnalyzeResult
155
- const issues = allDeadCode.map(d => ({
156
- type: 'dead-code',
157
- severity: d.type === 'function' ? IssueSeverity.Medium : IssueSeverity.Low,
158
- message: `未使用的${d.type === 'function' ? '函式' : '變數'}: ${d.name ?? 'unknown'}`,
159
- filePath: d.file,
160
- line: d.line
161
- }));
162
- const result = {
163
- command: QueryCommand.Analyze,
164
- success: true,
165
- analyzeType: AnalyzeType.DeadCode,
166
- summary: {
167
- totalScanned: results.length,
168
- issuesFound: allDeadCode.length,
169
- filesWithIssues: filesWithDeadCode.length,
170
- totalDeadFunctions: deadFunctions.length,
171
- totalDeadVariables: deadVariables.length
172
- },
173
- issues,
174
- metrics: options.all ? {
175
- all: results.map(r => ({ path: r.file, deadCode: r.deadCode }))
176
- } : undefined
177
- };
178
- outputHandler.outputQuery(result, format);
179
- }
180
- /**
181
- * 分析最佳實踐
182
- */
183
- async function analyzeBestPractices(analyzePath, options, context, format, outputHandler) {
184
- const files = await getAllProjectFiles(analyzePath, context);
185
- const recommendations = [];
186
- const hasEsmImports = files.some(async (file) => {
187
- const content = await context.fileSystem.readFile(file, 'utf-8');
188
- return content.includes('import ') && content.includes('from ');
189
- });
190
- if (hasEsmImports) {
191
- recommendations.push({
192
- type: 'es-modules',
193
- status: 'good',
194
- message: '專案使用 ES Module'
195
- });
196
- }
197
- const result = {
198
- command: QueryCommand.Analyze,
199
- success: true,
200
- analyzeType: AnalyzeType.BestPractices,
201
- summary: {
202
- totalScanned: files.length,
203
- issuesFound: 0,
204
- recommendations: recommendations.length
205
- },
206
- issues: [],
207
- metrics: { recommendations }
208
- };
209
- outputHandler.outputQuery(result, format);
210
- }
211
- /**
212
- * 分析模式
213
- */
214
- async function analyzePatterns(analyzePath, options, context, format, outputHandler) {
215
- const files = await getAllProjectFiles(analyzePath, context);
216
- const patterns = [];
217
- let asyncFunctionCount = 0;
218
- for (const file of files) {
219
- const content = await context.fileSystem.readFile(file, 'utf-8');
220
- if (content.includes('async ')) {
221
- asyncFunctionCount++;
222
- if (!patterns.includes('async-functions')) {
223
- patterns.push('async-functions');
224
- }
225
- }
226
- if (content.includes('Promise') || content.includes('.then(')) {
227
- if (!patterns.includes('promise-usage')) {
228
- patterns.push('promise-usage');
229
- }
230
- }
231
- if (file.endsWith('.ts') || file.endsWith('.tsx')) {
232
- if (content.includes('interface ') && !patterns.includes('interface-usage')) {
233
- patterns.push('interface-usage');
234
- }
235
- if (content.match(/<[A-Z]\w*(\s*extends\s+\w+)?>/g) && !patterns.includes('generic-types')) {
236
- patterns.push('generic-types');
237
- }
238
- if (content.includes('enum ') && !patterns.includes('enum-usage')) {
239
- patterns.push('enum-usage');
240
- }
241
- }
242
- }
243
- const result = {
244
- command: QueryCommand.Analyze,
245
- success: true,
246
- analyzeType: AnalyzeType.Patterns,
247
- summary: {
248
- totalScanned: files.length,
249
- issuesFound: 0,
250
- patternsFound: patterns.length
251
- },
252
- issues: [],
253
- metrics: {
254
- patterns,
255
- statistics: { asyncFunctions: asyncFunctionCount }
256
- }
257
- };
258
- outputHandler.outputQuery(result, format);
259
- }
260
- /**
261
- * 分析品質
262
- */
263
- async function analyzeQuality(analyzePath, options, context, format, outputHandler) {
264
- const registry = ParserRegistry.getInstance();
265
- const files = await getAllProjectFiles(analyzePath, context);
266
- if (files.length === 0) {
267
- const pathExists = await context.fileSystem.exists(analyzePath);
268
- if (!pathExists) {
269
- throw new Error(`路徑不存在: ${analyzePath}`);
270
- }
271
- throw new Error(`在路徑 ${analyzePath} 中找不到支援的檔案`);
272
- }
273
- const allIssues = [];
274
- const recommendations = [];
275
- let typeSafetyScore = 100;
276
- let errorHandlingScore = 100;
277
- let securityScore = 100;
278
- let namingScore = 100;
279
- let testCoverageScore = 0;
280
- let testFileCount = 0;
281
- for (const file of files) {
282
- try {
283
- const parser = registry.getParser(path.extname(file));
284
- if (!parser) {
285
- continue;
286
- }
287
- const content = await context.fileSystem.readFile(file, 'utf-8');
288
- const ast = await parser.parse(content, file);
289
- if (parser.isTestFile && parser.isTestFile(file)) {
290
- testFileCount++;
291
- continue;
292
- }
293
- if (parser.checkTypeSafety) {
294
- const typeSafetyIssues = await parser.checkTypeSafety(content, ast);
295
- typeSafetyIssues.forEach((issue) => {
296
- allIssues.push({
297
- type: 'type-safety',
298
- severity: issue.severity === 'error' ? IssueSeverity.High : IssueSeverity.Medium,
299
- message: issue.message,
300
- filePath: issue.location.filePath,
301
- line: issue.location.line
302
- });
303
- typeSafetyScore -= issue.severity === 'error' ? 10 : 5;
304
- });
305
- }
306
- if (parser.checkErrorHandling) {
307
- const errorHandlingIssues = await parser.checkErrorHandling(content, ast);
308
- errorHandlingIssues.forEach((issue) => {
309
- allIssues.push({
310
- type: 'error-handling',
311
- severity: issue.severity === 'error' ? IssueSeverity.High : IssueSeverity.Medium,
312
- message: issue.message,
313
- filePath: issue.location.filePath,
314
- line: issue.location.line
315
- });
316
- errorHandlingScore -= issue.severity === 'error' ? 10 : 5;
317
- });
318
- }
319
- if (parser.checkSecurity) {
320
- const securityIssues = await parser.checkSecurity(content, ast);
321
- securityIssues.forEach((issue) => {
322
- allIssues.push({
323
- type: 'security',
324
- severity: issue.severity === 'critical' ? IssueSeverity.Critical : IssueSeverity.High,
325
- message: issue.message,
326
- filePath: issue.location.filePath,
327
- line: issue.location.line
328
- });
329
- securityScore -= issue.severity === 'critical' ? 15 : 10;
330
- });
331
- }
332
- if (parser.checkNamingConventions) {
333
- const symbols = await parser.extractSymbols(ast);
334
- const namingIssues = await parser.checkNamingConventions(symbols, file);
335
- namingIssues.forEach((issue) => {
336
- allIssues.push({
337
- type: 'naming',
338
- severity: IssueSeverity.Low,
339
- message: issue.message,
340
- filePath: issue.location.filePath,
341
- line: issue.location.line
342
- });
343
- namingScore -= 3;
344
- });
345
- }
346
- }
347
- catch {
348
- // 忽略無法分析的檔案
349
- }
350
- }
351
- const testFileRatio = files.length > 0 ? testFileCount / files.length : 0;
352
- testCoverageScore = Math.min(100, testFileRatio * 200);
353
- typeSafetyScore = Math.max(0, typeSafetyScore);
354
- errorHandlingScore = Math.max(0, errorHandlingScore);
355
- securityScore = Math.max(0, securityScore);
356
- namingScore = Math.max(0, namingScore);
357
- const overallScore = Math.round(typeSafetyScore * 0.30 +
358
- testCoverageScore * 0.25 +
359
- errorHandlingScore * 0.20 +
360
- namingScore * 0.15 +
361
- securityScore * 0.10);
362
- if (typeSafetyScore < 80) {
363
- recommendations.push('型別安全:建議使用可選綁定(if let, guard let)代替強制解包');
364
- }
365
- if (errorHandlingScore < 80) {
366
- recommendations.push('錯誤處理:建議使用 do-catch 明確處理錯誤,避免空 catch 區塊');
367
- }
368
- if (securityScore < 80) {
369
- recommendations.push('安全性:建議使用 Keychain 或環境變數儲存敏感資訊');
370
- }
371
- if (namingScore < 80) {
372
- recommendations.push('命名規範:建議遵循 Swift API Design Guidelines 命名規範');
373
- }
374
- if (testCoverageScore < 50) {
375
- recommendations.push('測試覆蓋率:建議提升測試覆蓋率至 50% 以上');
376
- }
377
- const result = {
378
- command: QueryCommand.Analyze,
379
- success: true,
380
- analyzeType: AnalyzeType.Quality,
381
- summary: {
382
- totalScanned: files.length,
383
- issuesFound: allIssues.length,
384
- qualityScore: overallScore
385
- },
386
- issues: allIssues,
387
- metrics: {
388
- typeSafety: { score: typeSafetyScore },
389
- errorHandling: { score: errorHandlingScore },
390
- security: { score: securityScore },
391
- namingConventions: { score: namingScore },
392
- testCoverage: { score: testCoverageScore, testFileRatio, testFiles: testFileCount, totalFiles: files.length },
393
- overallScore,
394
- recommendations
395
- }
396
- };
397
- outputHandler.outputQuery(result, format);
398
- }
399
- /**
400
- * 獲取專案中的所有檔案
401
- */
402
- async function getAllProjectFiles(projectPath, context) {
403
- const files = [];
404
- const registry = ParserRegistry.getInstance();
405
- const allowedExtensions = registry.getSupportedExtensions();
406
- const excludePatterns = ['node_modules', 'dist', '.git', 'coverage'];
407
- try {
408
- const isFile = await context.fileSystem.isFile(projectPath);
409
- if (isFile) {
410
- if (allowedExtensions.some(ext => projectPath.endsWith(ext))) {
411
- return [projectPath];
412
- }
413
- return [];
414
- }
415
- }
416
- catch {
417
- return [];
418
- }
419
- async function walkDir(dir) {
420
- try {
421
- const entries = await context.fileSystem.readDirectory(dir);
422
- for (const entry of entries) {
423
- const fullPath = entry.path;
424
- if (entry.isDirectory) {
425
- if (excludePatterns.some(pattern => entry.name.includes(pattern))) {
426
- continue;
427
- }
428
- await walkDir(fullPath);
429
- }
430
- else if (entry.isFile) {
431
- if (allowedExtensions.some(ext => entry.name.endsWith(ext))) {
432
- files.push(fullPath);
433
- }
434
- }
435
- }
436
- }
437
- catch {
438
- // 忽略無法存取的目錄
439
- }
440
- }
441
- await walkDir(projectPath);
442
- return files;
443
- }
444
- /**
445
- * 處理錯誤
446
- */
447
- function handleError(error, format) {
448
- const errorMessage = error instanceof Error ? error.message : String(error);
449
- if (format === OutputFormat.Json) {
450
- console.error(JSON.stringify({ error: errorMessage }));
451
- }
452
- else {
453
- console.error('\n❌ 分析失敗:', errorMessage);
454
- }
455
- process.exitCode = 1;
456
- if (process.env.NODE_ENV !== 'test') {
457
- process.exit(1);
458
- }
459
- }
460
- //# sourceMappingURL=analyze.command.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"analyze.command.js","sourceRoot":"","sources":["../../../../src/interfaces/cli/commands/analyze.command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAuC,MAAM,qCAAqC,CAAC;AACpI,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAWxH;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAgB,EAAE,OAAuB;IAC3E,OAAO;SACJ,OAAO,CAAC,gBAAgB,CAAC;SACzB,WAAW,CAAC,SAAS,CAAC;SACtB,MAAM,CAAC,mBA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K,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACrB,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;QAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAAC,CAAC;AAC3D,CAAC"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Deps 命令
3
- * 分析依賴關係
4
- */
5
- import type { Command } from 'commander';
6
- import type { CommandContext } from '../../cli/commands/types.js';
7
- /**
8
- * 設定 deps 命令
9
- */
10
- export declare function setupDepsCommand(program: Command, context: CommandContext): void;
11
- //# sourceMappingURL=deps.command.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deps.command.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/cli/commands/deps.command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAUxE;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAWhF"}
@@ -1,143 +0,0 @@
1
- /**
2
- * Deps 命令
3
- * 分析依賴關係
4
- */
5
- import { DependencyAnalyzer } from '../../../core/dependency/dependency-analyzer.js';
6
- import { QueryCommand } from '../../../infrastructure/formatters/index.js';
7
- import { createUnifiedOutputHandler, parseOutputFormat, OutputFormat } from '../../cli/unified-output-handler.js';
8
- /**
9
- * 設定 deps 命令
10
- */
11
- export function setupDepsCommand(program, context) {
12
- program
13
- .command('deps [subcommand]')
14
- .description('分析依賴關係 (subcommand: graph|cycles|impact|orphans)')
15
- .option('-p, --path <path>', '分析路徑', '.')
16
- .option('-f, --file <file>', '特定檔案分析')
17
- .option('--format <format>', '輸出格式 (json|summary)', 'summary')
18
- .option('--all', '顯示完整依賴圖(預設只顯示循環依賴和孤立檔案)', false)
19
- .action(async (subcommand, options) => {
20
- await handleDepsCommand(subcommand, options, context);
21
- });
22
- }
23
- /**
24
- * 處理 deps 命令
25
- */
26
- async function handleDepsCommand(subcommand, options, context) {
27
- const outputHandler = createUnifiedOutputHandler();
28
- let format;
29
- try {
30
- format = parseOutputFormat(options.format, false);
31
- }
32
- catch {
33
- outputHandler.outputError('不支援的輸出格式。可用格式: json, summary', OutputFormat.Summary);
34
- process.exitCode = 1;
35
- return;
36
- }
37
- if (format !== OutputFormat.Json) {
38
- const titles = {
39
- 'graph': '🔗 依賴圖分析...',
40
- 'cycles': '🔄 循環依賴分析...',
41
- 'impact': '💥 影響分析...',
42
- 'orphans': '🏝️ 孤立檔案分析...'
43
- };
44
- console.log(titles[subcommand] || '🔍 分析依賴關係...');
45
- }
46
- try {
47
- const analyzePath = options.path || process.cwd();
48
- // 初始化依賴分析器
49
- const dependencyAnalyzer = new DependencyAnalyzer(context.fileSystem);
50
- // 分析專案依賴
51
- const projectDeps = await dependencyAnalyzer.analyzeProject(analyzePath);
52
- // 獲取統計資訊
53
- const stats = dependencyAnalyzer.getStats();
54
- // 使用 CycleDetector 檢測循環依賴
55
- const cycleDetector = new (await import('../../../core/dependency/cycle-detector.js')).CycleDetector();
56
- const graph = await buildGraphFromProjectDeps(projectDeps);
57
- const cycles = cycleDetector.detectCycles(graph);
58
- // 建立 DepsResult
59
- const result = buildDepsResult(graph, cycles, stats, options.all);
60
- // 輸出結果
61
- outputHandler.outputQuery(result, format);
62
- }
63
- catch (error) {
64
- handleError(error, format);
65
- }
66
- }
67
- /**
68
- * 建立 DepsResult
69
- */
70
- function buildDepsResult(graph, cycles, stats, includeGraph) {
71
- // 轉換 cycles 為 CycleInfo
72
- const cycleInfos = cycles.map(c => ({
73
- cycle: [...c.cycle],
74
- length: c.length
75
- }));
76
- // 建立孤立檔案列表
77
- const allNodes = graph.getAllNodes();
78
- const orphans = [];
79
- for (const node of allNodes) {
80
- const dependents = graph.getDependents(node);
81
- if (dependents.length === 0) {
82
- orphans.push(node);
83
- }
84
- }
85
- // 基本結果
86
- const result = {
87
- command: QueryCommand.Deps,
88
- success: true,
89
- cycles: cycleInfos,
90
- orphans,
91
- summary: {
92
- totalScanned: stats.totalFiles,
93
- issuesFound: cycles.length + orphans.length,
94
- totalFiles: stats.totalFiles,
95
- totalDependencies: stats.totalDependencies,
96
- cyclesFound: cycles.length,
97
- orphanedFiles: orphans.length
98
- }
99
- };
100
- // 如果需要完整圖
101
- if (includeGraph) {
102
- const nodes = allNodes.map(id => ({ id }));
103
- const edges = [];
104
- for (const nodeId of allNodes) {
105
- for (const depId of graph.getDependencies(nodeId)) {
106
- edges.push({ from: nodeId, to: depId });
107
- }
108
- }
109
- result.graph = { nodes, edges };
110
- }
111
- return result;
112
- }
113
- /**
114
- * 處理錯誤
115
- */
116
- function handleError(error, format) {
117
- const errorMessage = error instanceof Error ? error.message : String(error);
118
- if (format === OutputFormat.Json) {
119
- console.error(JSON.stringify({ error: errorMessage }));
120
- }
121
- else {
122
- console.error('\n❌ 依賴分析失敗:', errorMessage);
123
- }
124
- process.exitCode = 1;
125
- if (process.env.NODE_ENV !== 'test') {
126
- process.exit(1);
127
- }
128
- }
129
- /**
130
- * 從專案依賴資訊建立依賴圖
131
- */
132
- async function buildGraphFromProjectDeps(projectDeps) {
133
- const { DependencyGraph } = await import('../../../core/dependency/dependency-graph.js');
134
- const graph = new DependencyGraph();
135
- for (const fileDep of projectDeps.fileDependencies) {
136
- graph.addNode(fileDep.filePath);
137
- for (const dep of fileDep.dependencies) {
138
- graph.addDependency(fileDep.filePath, dep.path);
139
- }
140
- }
141
- return graph;
142
- }
143
- //# sourceMappingURL=deps.command.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deps.command.js","sourceRoot":"","sources":["../../../../src/interfaces/cli/commands/deps.command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,y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AAC;QAClD,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Extract 命令
3
- * 提取函式 (extract-function | extract-closure)
4
- */
5
- import type { Command } from 'commander';
6
- import type { CommandContext } from '../../cli/commands/types.js';
7
- /**
8
- * 設定 extract 命令(包含 extract-function 和 extract-closure)
9
- */
10
- export declare function setupExtractCommand(program: Command, context: CommandContext): void;
11
- //# sourceMappingURL=extract.command.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extract.command.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/cli/commands/extract.command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAexE;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAiCnF"}