agent-ide 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (543) hide show
  1. package/README.md +29 -355
  2. package/dist/application/events/event-bus.d.ts.map +1 -1
  3. package/dist/application/events/event-bus.js.map +1 -1
  4. package/dist/application/index.d.ts +3 -1
  5. package/dist/application/index.d.ts.map +1 -1
  6. package/dist/application/index.js +10 -5
  7. package/dist/application/index.js.map +1 -1
  8. package/dist/application/services/cache-coordinator.service.d.ts.map +1 -1
  9. package/dist/application/services/cache-coordinator.service.js.map +1 -1
  10. package/dist/application/services/error-handler.service.d.ts.map +1 -1
  11. package/dist/application/services/error-handler.service.js.map +1 -1
  12. package/dist/application/services/module-coordinator.service.d.ts +5 -14
  13. package/dist/application/services/module-coordinator.service.d.ts.map +1 -1
  14. package/dist/application/services/module-coordinator.service.js +15 -108
  15. package/dist/application/services/module-coordinator.service.js.map +1 -1
  16. package/dist/application/services/session-manager.service.d.ts.map +1 -1
  17. package/dist/application/services/session-manager.service.js.map +1 -1
  18. package/dist/application/services/workflow-engine.service.d.ts +1 -1
  19. package/dist/application/services/workflow-engine.service.d.ts.map +1 -1
  20. package/dist/application/services/workflow-engine.service.js.map +1 -1
  21. package/dist/application/state/state-manager.d.ts +3 -3
  22. package/dist/application/state/state-manager.d.ts.map +1 -1
  23. package/dist/application/state/state-manager.js +3 -3
  24. package/dist/application/state/state-manager.js.map +1 -1
  25. package/dist/application/types.d.ts.map +1 -1
  26. package/dist/application/workflows/analysis-workflow.d.ts +1 -1
  27. package/dist/application/workflows/analysis-workflow.d.ts.map +1 -1
  28. package/dist/application/workflows/analysis-workflow.js +1 -1
  29. package/dist/application/workflows/analysis-workflow.js.map +1 -1
  30. package/dist/application/workflows/base-workflow.d.ts.map +1 -1
  31. package/dist/application/workflows/base-workflow.js.map +1 -1
  32. package/dist/application/workflows/index.d.ts +2 -2
  33. package/dist/application/workflows/index.d.ts.map +1 -1
  34. package/dist/application/workflows/index.js +2 -2
  35. package/dist/application/workflows/index.js.map +1 -1
  36. package/dist/application/workflows/refactor-workflow.d.ts +1 -1
  37. package/dist/application/workflows/refactor-workflow.d.ts.map +1 -1
  38. package/dist/application/workflows/refactor-workflow.js +1 -1
  39. package/dist/application/workflows/refactor-workflow.js.map +1 -1
  40. package/dist/core/change-signature/change-signature-service.d.ts +94 -0
  41. package/dist/core/change-signature/change-signature-service.d.ts.map +1 -0
  42. package/dist/core/change-signature/change-signature-service.js +544 -0
  43. package/dist/core/change-signature/change-signature-service.js.map +1 -0
  44. package/dist/core/change-signature/index.d.ts +10 -0
  45. package/dist/core/change-signature/index.d.ts.map +1 -0
  46. package/dist/core/change-signature/index.js +12 -0
  47. package/dist/core/change-signature/index.js.map +1 -0
  48. package/dist/core/change-signature/signature-parser.d.ts +76 -0
  49. package/dist/core/change-signature/signature-parser.d.ts.map +1 -0
  50. package/dist/core/change-signature/signature-parser.js +387 -0
  51. package/dist/core/change-signature/signature-parser.js.map +1 -0
  52. package/dist/core/change-signature/types.d.ts +244 -0
  53. package/dist/core/change-signature/types.d.ts.map +1 -0
  54. package/dist/core/change-signature/types.js +73 -0
  55. package/dist/core/change-signature/types.js.map +1 -0
  56. package/dist/core/dependency/cycle-detector.d.ts +1 -1
  57. package/dist/core/dependency/cycle-detector.d.ts.map +1 -1
  58. package/dist/core/dependency/cycle-detector.js +1 -1
  59. package/dist/core/dependency/cycle-detector.js.map +1 -1
  60. package/dist/core/dependency/dependency-analyzer.d.ts +3 -1
  61. package/dist/core/dependency/dependency-analyzer.d.ts.map +1 -1
  62. package/dist/core/dependency/dependency-analyzer.js +25 -24
  63. package/dist/core/dependency/dependency-analyzer.js.map +1 -1
  64. package/dist/core/dependency/types.d.ts.map +1 -1
  65. package/dist/core/indexing/file-index.d.ts.map +1 -1
  66. package/dist/core/indexing/file-index.js +1 -1
  67. package/dist/core/indexing/file-index.js.map +1 -1
  68. package/dist/core/indexing/index-engine.d.ts +3 -1
  69. package/dist/core/indexing/index-engine.d.ts.map +1 -1
  70. package/dist/core/indexing/index-engine.js +25 -17
  71. package/dist/core/indexing/index-engine.js.map +1 -1
  72. package/dist/core/indexing/index.d.ts +1 -9
  73. package/dist/core/indexing/index.d.ts.map +1 -1
  74. package/dist/core/indexing/index.js +2 -12
  75. package/dist/core/indexing/index.js.map +1 -1
  76. package/dist/core/indexing/symbol-index.d.ts.map +1 -1
  77. package/dist/core/indexing/types.d.ts +12 -0
  78. package/dist/core/indexing/types.d.ts.map +1 -1
  79. package/dist/core/indexing/types.js +12 -0
  80. package/dist/core/indexing/types.js.map +1 -1
  81. package/dist/core/move-file/import-resolver.d.ts.map +1 -0
  82. package/dist/core/{move → move-file}/import-resolver.js +9 -10
  83. package/dist/core/move-file/import-resolver.js.map +1 -0
  84. package/dist/core/{move → move-file}/index.d.ts +2 -2
  85. package/dist/core/move-file/index.d.ts.map +1 -0
  86. package/dist/core/{move → move-file}/index.js +2 -2
  87. package/dist/core/move-file/index.js.map +1 -0
  88. package/dist/core/{move → move-file}/move-service.d.ts +3 -1
  89. package/dist/core/move-file/move-service.d.ts.map +1 -0
  90. package/dist/core/{move → move-file}/move-service.js +66 -84
  91. package/dist/core/move-file/move-service.js.map +1 -0
  92. package/dist/core/move-file/types.d.ts.map +1 -0
  93. package/dist/core/move-file/types.js.map +1 -0
  94. package/dist/core/move-member/index.d.ts +10 -0
  95. package/dist/core/move-member/index.d.ts.map +1 -0
  96. package/dist/core/move-member/index.js +12 -0
  97. package/dist/core/move-member/index.js.map +1 -0
  98. package/dist/core/move-member/member-extractor.d.ts +96 -0
  99. package/dist/core/move-member/member-extractor.d.ts.map +1 -0
  100. package/dist/core/move-member/member-extractor.js +439 -0
  101. package/dist/core/move-member/member-extractor.js.map +1 -0
  102. package/dist/core/move-member/move-member-service.d.ts +87 -0
  103. package/dist/core/move-member/move-member-service.d.ts.map +1 -0
  104. package/dist/core/move-member/move-member-service.js +412 -0
  105. package/dist/core/move-member/move-member-service.js.map +1 -0
  106. package/dist/core/move-member/types.d.ts +182 -0
  107. package/dist/core/move-member/types.d.ts.map +1 -0
  108. package/dist/core/move-member/types.js +75 -0
  109. package/dist/core/move-member/types.js.map +1 -0
  110. package/dist/core/rename/index.d.ts +3 -3
  111. package/dist/core/rename/index.d.ts.map +1 -1
  112. package/dist/core/rename/index.js +5 -3
  113. package/dist/core/rename/index.js.map +1 -1
  114. package/dist/core/rename/reference-updater.d.ts +3 -1
  115. package/dist/core/rename/reference-updater.d.ts.map +1 -1
  116. package/dist/core/rename/reference-updater.js +9 -6
  117. package/dist/core/rename/reference-updater.js.map +1 -1
  118. package/dist/core/rename/rename-engine.d.ts +3 -1
  119. package/dist/core/rename/rename-engine.d.ts.map +1 -1
  120. package/dist/core/rename/rename-engine.js +8 -5
  121. package/dist/core/rename/rename-engine.js.map +1 -1
  122. package/dist/core/rename/scope-analyzer.d.ts.map +1 -1
  123. package/dist/core/rename/scope-analyzer.js.map +1 -1
  124. package/dist/core/rename/types.d.ts.map +1 -1
  125. package/dist/core/shared/call-hierarchy-analyzer.d.ts +102 -0
  126. package/dist/core/shared/call-hierarchy-analyzer.d.ts.map +1 -0
  127. package/dist/core/shared/call-hierarchy-analyzer.js +328 -0
  128. package/dist/core/shared/call-hierarchy-analyzer.js.map +1 -0
  129. package/dist/core/shared/index.d.ts +7 -0
  130. package/dist/core/shared/index.d.ts.map +1 -0
  131. package/dist/core/shared/index.js +7 -0
  132. package/dist/core/shared/index.js.map +1 -0
  133. package/dist/core/shared/symbol-finder.d.ts +154 -0
  134. package/dist/core/shared/symbol-finder.d.ts.map +1 -0
  135. package/dist/core/shared/symbol-finder.js +433 -0
  136. package/dist/core/shared/symbol-finder.js.map +1 -0
  137. package/dist/core/snapshot/index.d.ts +3 -19
  138. package/dist/core/snapshot/index.d.ts.map +1 -1
  139. package/dist/core/snapshot/index.js +2 -23
  140. package/dist/core/snapshot/index.js.map +1 -1
  141. package/dist/core/snapshot/snapshot-generator.d.ts +66 -0
  142. package/dist/core/snapshot/snapshot-generator.d.ts.map +1 -0
  143. package/dist/core/snapshot/snapshot-generator.js +258 -0
  144. package/dist/core/snapshot/snapshot-generator.js.map +1 -0
  145. package/dist/core/snapshot/types.d.ts +41 -190
  146. package/dist/core/snapshot/types.d.ts.map +1 -1
  147. package/dist/core/snapshot/types.js +13 -67
  148. package/dist/core/snapshot/types.js.map +1 -1
  149. package/dist/infrastructure/cache/cache-manager.d.ts +1 -1
  150. package/dist/infrastructure/cache/cache-manager.d.ts.map +1 -1
  151. package/dist/infrastructure/cache/cache-manager.js +1 -1
  152. package/dist/infrastructure/cache/cache-manager.js.map +1 -1
  153. package/dist/infrastructure/cache/memory-cache.js +1 -1
  154. package/dist/infrastructure/cache/memory-cache.js.map +1 -1
  155. package/dist/infrastructure/cache/strategies.d.ts +1 -1
  156. package/dist/infrastructure/cache/strategies.d.ts.map +1 -1
  157. package/dist/infrastructure/cache/strategies.js +1 -1
  158. package/dist/infrastructure/cache/strategies.js.map +1 -1
  159. package/dist/infrastructure/formatters/diff-generator.d.ts +11 -0
  160. package/dist/infrastructure/formatters/diff-generator.d.ts.map +1 -0
  161. package/dist/infrastructure/formatters/diff-generator.js +227 -0
  162. package/dist/infrastructure/formatters/diff-generator.js.map +1 -0
  163. package/dist/infrastructure/formatters/index.d.ts +11 -0
  164. package/dist/infrastructure/formatters/index.d.ts.map +1 -0
  165. package/dist/infrastructure/formatters/index.js +13 -0
  166. package/dist/infrastructure/formatters/index.js.map +1 -0
  167. package/dist/infrastructure/formatters/preview-converter.d.ts +85 -0
  168. package/dist/infrastructure/formatters/preview-converter.d.ts.map +1 -0
  169. package/dist/infrastructure/formatters/preview-converter.js +209 -0
  170. package/dist/infrastructure/formatters/preview-converter.js.map +1 -0
  171. package/dist/infrastructure/formatters/preview-formatter.d.ts +61 -0
  172. package/dist/infrastructure/formatters/preview-formatter.d.ts.map +1 -0
  173. package/dist/infrastructure/formatters/preview-formatter.js +208 -0
  174. package/dist/infrastructure/formatters/preview-formatter.js.map +1 -0
  175. package/dist/infrastructure/formatters/query-formatter.d.ts +83 -0
  176. package/dist/infrastructure/formatters/query-formatter.d.ts.map +1 -0
  177. package/dist/infrastructure/formatters/query-formatter.js +349 -0
  178. package/dist/infrastructure/formatters/query-formatter.js.map +1 -0
  179. package/dist/infrastructure/formatters/query-types.d.ts +238 -0
  180. package/dist/infrastructure/formatters/query-types.d.ts.map +1 -0
  181. package/dist/infrastructure/formatters/query-types.js +29 -0
  182. package/dist/infrastructure/formatters/query-types.js.map +1 -0
  183. package/dist/infrastructure/formatters/types.d.ts +163 -0
  184. package/dist/infrastructure/formatters/types.d.ts.map +1 -0
  185. package/dist/infrastructure/formatters/types.js +27 -0
  186. package/dist/infrastructure/formatters/types.js.map +1 -0
  187. package/dist/infrastructure/parser/base.d.ts +1 -33
  188. package/dist/infrastructure/parser/base.d.ts.map +1 -1
  189. package/dist/infrastructure/parser/base.js +1 -65
  190. package/dist/infrastructure/parser/base.js.map +1 -1
  191. package/dist/infrastructure/parser/index.d.ts +0 -2
  192. package/dist/infrastructure/parser/index.d.ts.map +1 -1
  193. package/dist/infrastructure/parser/index.js +1 -2
  194. package/dist/infrastructure/parser/index.js.map +1 -1
  195. package/dist/infrastructure/parser/interface.d.ts +2 -59
  196. package/dist/infrastructure/parser/interface.d.ts.map +1 -1
  197. package/dist/infrastructure/parser/interface.js +1 -11
  198. package/dist/infrastructure/parser/interface.js.map +1 -1
  199. package/dist/infrastructure/parser/registry.d.ts +1 -1
  200. package/dist/infrastructure/parser/registry.d.ts.map +1 -1
  201. package/dist/infrastructure/parser/registry.js +1 -1
  202. package/dist/infrastructure/parser/registry.js.map +1 -1
  203. package/dist/infrastructure/parser/types.d.ts.map +1 -1
  204. package/dist/infrastructure/storage/file-system.d.ts +2 -1
  205. package/dist/infrastructure/storage/file-system.d.ts.map +1 -1
  206. package/dist/infrastructure/storage/file-system.interface.d.ts +69 -0
  207. package/dist/infrastructure/storage/file-system.interface.d.ts.map +1 -0
  208. package/dist/infrastructure/storage/file-system.interface.js +6 -0
  209. package/dist/infrastructure/storage/file-system.interface.js.map +1 -0
  210. package/dist/infrastructure/storage/file-system.js.map +1 -1
  211. package/dist/infrastructure/storage/index.d.ts +2 -4
  212. package/dist/infrastructure/storage/index.d.ts.map +1 -1
  213. package/dist/infrastructure/storage/index.js +1 -8
  214. package/dist/infrastructure/storage/index.js.map +1 -1
  215. package/dist/infrastructure/storage/mem-file-system.d.ts +44 -0
  216. package/dist/infrastructure/storage/mem-file-system.d.ts.map +1 -0
  217. package/dist/infrastructure/storage/mem-file-system.js +105 -0
  218. package/dist/infrastructure/storage/mem-file-system.js.map +1 -0
  219. package/dist/interfaces/cli/cli.d.ts +13 -94
  220. package/dist/interfaces/cli/cli.d.ts.map +1 -1
  221. package/dist/interfaces/cli/cli.js +47 -2450
  222. package/dist/interfaces/cli/cli.js.map +1 -1
  223. package/dist/interfaces/cli/commands/call-hierarchy.command.d.ts +11 -0
  224. package/dist/interfaces/cli/commands/call-hierarchy.command.d.ts.map +1 -0
  225. package/dist/interfaces/cli/commands/call-hierarchy.command.js +161 -0
  226. package/dist/interfaces/cli/commands/call-hierarchy.command.js.map +1 -0
  227. package/dist/interfaces/cli/commands/change-signature.command.d.ts +11 -0
  228. package/dist/interfaces/cli/commands/change-signature.command.d.ts.map +1 -0
  229. package/dist/interfaces/cli/commands/change-signature.command.js +290 -0
  230. package/dist/interfaces/cli/commands/change-signature.command.js.map +1 -0
  231. package/dist/interfaces/cli/commands/cycles.command.d.ts +11 -0
  232. package/dist/interfaces/cli/commands/cycles.command.d.ts.map +1 -0
  233. package/dist/interfaces/cli/commands/cycles.command.js +87 -0
  234. package/dist/interfaces/cli/commands/cycles.command.js.map +1 -0
  235. package/dist/interfaces/cli/commands/find-references.command.d.ts +11 -0
  236. package/dist/interfaces/cli/commands/find-references.command.d.ts.map +1 -0
  237. package/dist/interfaces/cli/commands/find-references.command.js +122 -0
  238. package/dist/interfaces/cli/commands/find-references.command.js.map +1 -0
  239. package/dist/interfaces/cli/commands/impact.command.d.ts +11 -0
  240. package/dist/interfaces/cli/commands/impact.command.d.ts.map +1 -0
  241. package/dist/interfaces/cli/commands/impact.command.js +98 -0
  242. package/dist/interfaces/cli/commands/impact.command.js.map +1 -0
  243. package/dist/interfaces/cli/commands/index.d.ts +14 -0
  244. package/dist/interfaces/cli/commands/index.d.ts.map +1 -0
  245. package/dist/interfaces/cli/commands/index.js +15 -0
  246. package/dist/interfaces/cli/commands/index.js.map +1 -0
  247. package/dist/interfaces/cli/commands/move-member.command.d.ts +11 -0
  248. package/dist/interfaces/cli/commands/move-member.command.d.ts.map +1 -0
  249. package/dist/interfaces/cli/commands/move-member.command.js +185 -0
  250. package/dist/interfaces/cli/commands/move-member.command.js.map +1 -0
  251. package/dist/interfaces/cli/commands/move.command.d.ts +11 -0
  252. package/dist/interfaces/cli/commands/move.command.d.ts.map +1 -0
  253. package/dist/interfaces/cli/commands/move.command.js +212 -0
  254. package/dist/interfaces/cli/commands/move.command.js.map +1 -0
  255. package/dist/interfaces/cli/commands/rename.command.d.ts +11 -0
  256. package/dist/interfaces/cli/commands/rename.command.d.ts.map +1 -0
  257. package/dist/interfaces/cli/commands/rename.command.js +258 -0
  258. package/dist/interfaces/cli/commands/rename.command.js.map +1 -0
  259. package/dist/interfaces/cli/commands/snapshot.command.d.ts +11 -0
  260. package/dist/interfaces/cli/commands/snapshot.command.d.ts.map +1 -0
  261. package/dist/interfaces/cli/commands/snapshot.command.js +68 -0
  262. package/dist/interfaces/cli/commands/snapshot.command.js.map +1 -0
  263. package/dist/interfaces/cli/commands/types.d.ts +18 -0
  264. package/dist/interfaces/cli/commands/types.d.ts.map +1 -0
  265. package/dist/interfaces/cli/commands/types.js +5 -0
  266. package/dist/interfaces/cli/commands/types.js.map +1 -0
  267. package/dist/interfaces/cli/index.d.ts +1 -1
  268. package/dist/interfaces/cli/index.d.ts.map +1 -1
  269. package/dist/interfaces/cli/index.js +1 -1
  270. package/dist/interfaces/cli/index.js.map +1 -1
  271. package/dist/interfaces/cli/preview-output-handler.d.ts +53 -0
  272. package/dist/interfaces/cli/preview-output-handler.d.ts.map +1 -0
  273. package/dist/interfaces/cli/preview-output-handler.js +73 -0
  274. package/dist/interfaces/cli/preview-output-handler.js.map +1 -0
  275. package/dist/interfaces/cli/unified-output-handler.d.ts +79 -0
  276. package/dist/interfaces/cli/unified-output-handler.d.ts.map +1 -0
  277. package/dist/interfaces/cli/unified-output-handler.js +149 -0
  278. package/dist/interfaces/cli/unified-output-handler.js.map +1 -0
  279. package/dist/plugins/javascript/index.d.ts +2 -2
  280. package/dist/plugins/javascript/index.d.ts.map +1 -1
  281. package/dist/plugins/javascript/index.js +1 -1
  282. package/dist/plugins/javascript/index.js.map +1 -1
  283. package/dist/plugins/javascript/types.d.ts.map +1 -1
  284. package/dist/plugins/javascript/types.js.map +1 -1
  285. package/dist/plugins/python/dependency-analyzer.d.ts +86 -0
  286. package/dist/plugins/python/dependency-analyzer.d.ts.map +1 -0
  287. package/dist/plugins/python/dependency-analyzer.js +252 -0
  288. package/dist/plugins/python/dependency-analyzer.js.map +1 -0
  289. package/dist/plugins/python/index.d.ts +9 -0
  290. package/dist/plugins/python/index.d.ts.map +1 -0
  291. package/dist/plugins/python/index.js +14 -0
  292. package/dist/plugins/python/index.js.map +1 -0
  293. package/dist/plugins/python/parser.d.ts +117 -0
  294. package/dist/plugins/python/parser.d.ts.map +1 -0
  295. package/dist/plugins/python/parser.js +414 -0
  296. package/dist/plugins/python/parser.js.map +1 -0
  297. package/dist/plugins/python/symbol-extractor.d.ts +108 -0
  298. package/dist/plugins/python/symbol-extractor.d.ts.map +1 -0
  299. package/dist/plugins/python/symbol-extractor.js +389 -0
  300. package/dist/plugins/python/symbol-extractor.js.map +1 -0
  301. package/dist/plugins/python/tree-sitter-bridge.d.ts +57 -0
  302. package/dist/plugins/python/tree-sitter-bridge.d.ts.map +1 -0
  303. package/dist/plugins/python/tree-sitter-bridge.js +267 -0
  304. package/dist/plugins/python/tree-sitter-bridge.js.map +1 -0
  305. package/dist/plugins/python/types.d.ts +179 -0
  306. package/dist/plugins/python/types.d.ts.map +1 -0
  307. package/dist/plugins/python/types.js +252 -0
  308. package/dist/plugins/python/types.js.map +1 -0
  309. package/dist/plugins/swift/dependency-analyzer.d.ts +1 -1
  310. package/dist/plugins/swift/dependency-analyzer.d.ts.map +1 -1
  311. package/dist/plugins/swift/dependency-analyzer.js +1 -1
  312. package/dist/plugins/swift/dependency-analyzer.js.map +1 -1
  313. package/dist/plugins/swift/parser.d.ts +4 -0
  314. package/dist/plugins/swift/parser.d.ts.map +1 -1
  315. package/dist/plugins/swift/parser.js +24 -6
  316. package/dist/plugins/swift/parser.js.map +1 -1
  317. package/dist/plugins/swift/symbol-extractor.d.ts +1 -1
  318. package/dist/plugins/swift/symbol-extractor.d.ts.map +1 -1
  319. package/dist/plugins/swift/symbol-extractor.js.map +1 -1
  320. package/dist/plugins/swift/types.d.ts.map +1 -1
  321. package/dist/plugins/swift/types.js.map +1 -1
  322. package/dist/plugins/typescript/parser.d.ts +4 -37
  323. package/dist/plugins/typescript/parser.d.ts.map +1 -1
  324. package/dist/plugins/typescript/parser.js +29 -331
  325. package/dist/plugins/typescript/parser.js.map +1 -1
  326. package/dist/plugins/typescript/symbol-extractor.d.ts.map +1 -1
  327. package/dist/plugins/typescript/symbol-extractor.js +12 -0
  328. package/dist/plugins/typescript/symbol-extractor.js.map +1 -1
  329. package/dist/plugins/typescript/types.d.ts.map +1 -1
  330. package/dist/plugins/typescript/types.js +10 -0
  331. package/dist/plugins/typescript/types.js.map +1 -1
  332. package/dist/shared/errors/config-error.d.ts +1 -1
  333. package/dist/shared/errors/config-error.d.ts.map +1 -1
  334. package/dist/shared/errors/config-error.js +1 -1
  335. package/dist/shared/errors/config-error.js.map +1 -1
  336. package/dist/shared/errors/file-error.d.ts +1 -1
  337. package/dist/shared/errors/file-error.d.ts.map +1 -1
  338. package/dist/shared/errors/file-error.js +1 -1
  339. package/dist/shared/errors/file-error.js.map +1 -1
  340. package/dist/shared/errors/index.d.ts +1 -1
  341. package/dist/shared/errors/index.d.ts.map +1 -1
  342. package/dist/shared/errors/index.js +4 -4
  343. package/dist/shared/errors/index.js.map +1 -1
  344. package/dist/shared/errors/parser-error.d.ts +1 -1
  345. package/dist/shared/errors/parser-error.d.ts.map +1 -1
  346. package/dist/shared/errors/parser-error.js +1 -1
  347. package/dist/shared/errors/parser-error.js.map +1 -1
  348. package/dist/shared/errors/validation-error.d.ts +1 -1
  349. package/dist/shared/errors/validation-error.d.ts.map +1 -1
  350. package/dist/shared/errors/validation-error.js +1 -1
  351. package/dist/shared/errors/validation-error.js.map +1 -1
  352. package/dist/shared/types/ast.d.ts +1 -1
  353. package/dist/shared/types/ast.d.ts.map +1 -1
  354. package/dist/shared/types/ast.js +1 -1
  355. package/dist/shared/types/ast.js.map +1 -1
  356. package/dist/shared/types/symbol.d.ts +3 -2
  357. package/dist/shared/types/symbol.d.ts.map +1 -1
  358. package/dist/shared/types/symbol.js +1 -0
  359. package/dist/shared/types/symbol.js.map +1 -1
  360. package/dist/shared/utils/index.d.ts +5 -5
  361. package/dist/shared/utils/index.d.ts.map +1 -1
  362. package/dist/shared/utils/index.js +5 -5
  363. package/dist/shared/utils/index.js.map +1 -1
  364. package/package.json +9 -8
  365. package/dist/core/analysis/index.d.ts +0 -6
  366. package/dist/core/analysis/index.d.ts.map +0 -1
  367. package/dist/core/analysis/index.js +0 -7
  368. package/dist/core/analysis/index.js.map +0 -1
  369. package/dist/core/analysis/quality-metrics.d.ts +0 -158
  370. package/dist/core/analysis/quality-metrics.d.ts.map +0 -1
  371. package/dist/core/analysis/quality-metrics.js +0 -442
  372. package/dist/core/analysis/quality-metrics.js.map +0 -1
  373. package/dist/core/indexing/file-watcher.d.ts +0 -110
  374. package/dist/core/indexing/file-watcher.d.ts.map +0 -1
  375. package/dist/core/indexing/file-watcher.js +0 -280
  376. package/dist/core/indexing/file-watcher.js.map +0 -1
  377. package/dist/core/move/import-resolver.d.ts.map +0 -1
  378. package/dist/core/move/import-resolver.js.map +0 -1
  379. package/dist/core/move/index.d.ts.map +0 -1
  380. package/dist/core/move/index.js.map +0 -1
  381. package/dist/core/move/move-service.d.ts.map +0 -1
  382. package/dist/core/move/move-service.js.map +0 -1
  383. package/dist/core/move/types.d.ts.map +0 -1
  384. package/dist/core/move/types.js.map +0 -1
  385. package/dist/core/refactor/design-patterns.d.ts +0 -178
  386. package/dist/core/refactor/design-patterns.d.ts.map +0 -1
  387. package/dist/core/refactor/design-patterns.js +0 -656
  388. package/dist/core/refactor/design-patterns.js.map +0 -1
  389. package/dist/core/refactor/extract-function.d.ts +0 -197
  390. package/dist/core/refactor/extract-function.d.ts.map +0 -1
  391. package/dist/core/refactor/extract-function.js +0 -730
  392. package/dist/core/refactor/extract-function.js.map +0 -1
  393. package/dist/core/refactor/index.d.ts +0 -8
  394. package/dist/core/refactor/index.d.ts.map +0 -1
  395. package/dist/core/refactor/index.js +0 -11
  396. package/dist/core/refactor/index.js.map +0 -1
  397. package/dist/core/refactor/inline-function.d.ts +0 -175
  398. package/dist/core/refactor/inline-function.d.ts.map +0 -1
  399. package/dist/core/refactor/inline-function.js +0 -425
  400. package/dist/core/refactor/inline-function.js.map +0 -1
  401. package/dist/core/refactor/swift-extractor.d.ts +0 -98
  402. package/dist/core/refactor/swift-extractor.d.ts.map +0 -1
  403. package/dist/core/refactor/swift-extractor.js +0 -283
  404. package/dist/core/refactor/swift-extractor.js.map +0 -1
  405. package/dist/core/search/engines/text-engine.d.ts +0 -52
  406. package/dist/core/search/engines/text-engine.d.ts.map +0 -1
  407. package/dist/core/search/engines/text-engine.js +0 -376
  408. package/dist/core/search/engines/text-engine.js.map +0 -1
  409. package/dist/core/search/index.d.ts +0 -10
  410. package/dist/core/search/index.d.ts.map +0 -1
  411. package/dist/core/search/index.js +0 -11
  412. package/dist/core/search/index.js.map +0 -1
  413. package/dist/core/search/service.d.ts +0 -105
  414. package/dist/core/search/service.d.ts.map +0 -1
  415. package/dist/core/search/service.js +0 -384
  416. package/dist/core/search/service.js.map +0 -1
  417. package/dist/core/search/types.d.ts +0 -357
  418. package/dist/core/search/types.d.ts.map +0 -1
  419. package/dist/core/search/types.js +0 -47
  420. package/dist/core/search/types.js.map +0 -1
  421. package/dist/core/shit-score/grading.d.ts +0 -39
  422. package/dist/core/shit-score/grading.d.ts.map +0 -1
  423. package/dist/core/shit-score/grading.js +0 -253
  424. package/dist/core/shit-score/grading.js.map +0 -1
  425. package/dist/core/shit-score/index.d.ts +0 -9
  426. package/dist/core/shit-score/index.d.ts.map +0 -1
  427. package/dist/core/shit-score/index.js +0 -8
  428. package/dist/core/shit-score/index.js.map +0 -1
  429. package/dist/core/shit-score/score-calculator.d.ts +0 -75
  430. package/dist/core/shit-score/score-calculator.d.ts.map +0 -1
  431. package/dist/core/shit-score/score-calculator.js +0 -240
  432. package/dist/core/shit-score/score-calculator.js.map +0 -1
  433. package/dist/core/shit-score/shit-score-analyzer.d.ts +0 -84
  434. package/dist/core/shit-score/shit-score-analyzer.d.ts.map +0 -1
  435. package/dist/core/shit-score/shit-score-analyzer.js +0 -595
  436. package/dist/core/shit-score/shit-score-analyzer.js.map +0 -1
  437. package/dist/core/shit-score/types.d.ts +0 -231
  438. package/dist/core/shit-score/types.d.ts.map +0 -1
  439. package/dist/core/shit-score/types.js +0 -73
  440. package/dist/core/shit-score/types.js.map +0 -1
  441. package/dist/core/snapshot/code-compressor.d.ts +0 -39
  442. package/dist/core/snapshot/code-compressor.d.ts.map +0 -1
  443. package/dist/core/snapshot/code-compressor.js +0 -211
  444. package/dist/core/snapshot/code-compressor.js.map +0 -1
  445. package/dist/core/snapshot/config.d.ts +0 -60
  446. package/dist/core/snapshot/config.d.ts.map +0 -1
  447. package/dist/core/snapshot/config.js +0 -136
  448. package/dist/core/snapshot/config.js.map +0 -1
  449. package/dist/core/snapshot/snapshot-differ.d.ts +0 -54
  450. package/dist/core/snapshot/snapshot-differ.d.ts.map +0 -1
  451. package/dist/core/snapshot/snapshot-differ.js +0 -262
  452. package/dist/core/snapshot/snapshot-differ.js.map +0 -1
  453. package/dist/core/snapshot/snapshot-engine.d.ts +0 -94
  454. package/dist/core/snapshot/snapshot-engine.d.ts.map +0 -1
  455. package/dist/core/snapshot/snapshot-engine.js +0 -492
  456. package/dist/core/snapshot/snapshot-engine.js.map +0 -1
  457. package/dist/infrastructure/parser/factory.d.ts +0 -141
  458. package/dist/infrastructure/parser/factory.d.ts.map +0 -1
  459. package/dist/infrastructure/parser/factory.js +0 -306
  460. package/dist/infrastructure/parser/factory.js.map +0 -1
  461. package/dist/infrastructure/storage/file-watcher.d.ts +0 -84
  462. package/dist/infrastructure/storage/file-watcher.d.ts.map +0 -1
  463. package/dist/infrastructure/storage/file-watcher.js +0 -249
  464. package/dist/infrastructure/storage/file-watcher.js.map +0 -1
  465. package/dist/infrastructure/storage/path-utils.d.ts +0 -96
  466. package/dist/infrastructure/storage/path-utils.d.ts.map +0 -1
  467. package/dist/infrastructure/storage/path-utils.js +0 -272
  468. package/dist/infrastructure/storage/path-utils.js.map +0 -1
  469. package/dist/plugins/swift/analyzers/complexity-analyzer.d.ts +0 -41
  470. package/dist/plugins/swift/analyzers/complexity-analyzer.d.ts.map +0 -1
  471. package/dist/plugins/swift/analyzers/complexity-analyzer.js +0 -206
  472. package/dist/plugins/swift/analyzers/complexity-analyzer.js.map +0 -1
  473. package/dist/plugins/swift/analyzers/duplication-detector.d.ts +0 -89
  474. package/dist/plugins/swift/analyzers/duplication-detector.d.ts.map +0 -1
  475. package/dist/plugins/swift/analyzers/duplication-detector.js +0 -271
  476. package/dist/plugins/swift/analyzers/duplication-detector.js.map +0 -1
  477. package/dist/plugins/swift/analyzers/error-handling-checker.d.ts +0 -34
  478. package/dist/plugins/swift/analyzers/error-handling-checker.d.ts.map +0 -1
  479. package/dist/plugins/swift/analyzers/error-handling-checker.js +0 -135
  480. package/dist/plugins/swift/analyzers/error-handling-checker.js.map +0 -1
  481. package/dist/plugins/swift/analyzers/naming-checker.d.ts +0 -47
  482. package/dist/plugins/swift/analyzers/naming-checker.d.ts.map +0 -1
  483. package/dist/plugins/swift/analyzers/naming-checker.js +0 -161
  484. package/dist/plugins/swift/analyzers/naming-checker.js.map +0 -1
  485. package/dist/plugins/swift/analyzers/pattern-detector.d.ts +0 -78
  486. package/dist/plugins/swift/analyzers/pattern-detector.d.ts.map +0 -1
  487. package/dist/plugins/swift/analyzers/pattern-detector.js +0 -247
  488. package/dist/plugins/swift/analyzers/pattern-detector.js.map +0 -1
  489. package/dist/plugins/swift/analyzers/security-checker.d.ts +0 -38
  490. package/dist/plugins/swift/analyzers/security-checker.d.ts.map +0 -1
  491. package/dist/plugins/swift/analyzers/security-checker.js +0 -135
  492. package/dist/plugins/swift/analyzers/security-checker.js.map +0 -1
  493. package/dist/plugins/swift/analyzers/test-coverage-checker.d.ts +0 -26
  494. package/dist/plugins/swift/analyzers/test-coverage-checker.d.ts.map +0 -1
  495. package/dist/plugins/swift/analyzers/test-coverage-checker.js +0 -63
  496. package/dist/plugins/swift/analyzers/test-coverage-checker.js.map +0 -1
  497. package/dist/plugins/swift/analyzers/type-safety-checker.d.ts +0 -41
  498. package/dist/plugins/swift/analyzers/type-safety-checker.d.ts.map +0 -1
  499. package/dist/plugins/swift/analyzers/type-safety-checker.js +0 -121
  500. package/dist/plugins/swift/analyzers/type-safety-checker.js.map +0 -1
  501. package/dist/plugins/swift/analyzers/unused-symbol-detector.d.ts +0 -38
  502. package/dist/plugins/swift/analyzers/unused-symbol-detector.d.ts.map +0 -1
  503. package/dist/plugins/swift/analyzers/unused-symbol-detector.js +0 -211
  504. package/dist/plugins/swift/analyzers/unused-symbol-detector.js.map +0 -1
  505. package/dist/plugins/typescript/analyzers/complexity-analyzer.d.ts +0 -39
  506. package/dist/plugins/typescript/analyzers/complexity-analyzer.d.ts.map +0 -1
  507. package/dist/plugins/typescript/analyzers/complexity-analyzer.js +0 -196
  508. package/dist/plugins/typescript/analyzers/complexity-analyzer.js.map +0 -1
  509. package/dist/plugins/typescript/analyzers/duplication-detector.d.ts +0 -181
  510. package/dist/plugins/typescript/analyzers/duplication-detector.d.ts.map +0 -1
  511. package/dist/plugins/typescript/analyzers/duplication-detector.js +0 -695
  512. package/dist/plugins/typescript/analyzers/duplication-detector.js.map +0 -1
  513. package/dist/plugins/typescript/analyzers/error-handling-checker.d.ts +0 -26
  514. package/dist/plugins/typescript/analyzers/error-handling-checker.d.ts.map +0 -1
  515. package/dist/plugins/typescript/analyzers/error-handling-checker.js +0 -84
  516. package/dist/plugins/typescript/analyzers/error-handling-checker.js.map +0 -1
  517. package/dist/plugins/typescript/analyzers/naming-checker.d.ts +0 -30
  518. package/dist/plugins/typescript/analyzers/naming-checker.d.ts.map +0 -1
  519. package/dist/plugins/typescript/analyzers/naming-checker.js +0 -116
  520. package/dist/plugins/typescript/analyzers/naming-checker.js.map +0 -1
  521. package/dist/plugins/typescript/analyzers/pattern-detector.d.ts +0 -80
  522. package/dist/plugins/typescript/analyzers/pattern-detector.d.ts.map +0 -1
  523. package/dist/plugins/typescript/analyzers/pattern-detector.js +0 -267
  524. package/dist/plugins/typescript/analyzers/pattern-detector.js.map +0 -1
  525. package/dist/plugins/typescript/analyzers/security-checker.d.ts +0 -34
  526. package/dist/plugins/typescript/analyzers/security-checker.d.ts.map +0 -1
  527. package/dist/plugins/typescript/analyzers/security-checker.js +0 -126
  528. package/dist/plugins/typescript/analyzers/security-checker.js.map +0 -1
  529. package/dist/plugins/typescript/analyzers/test-coverage-checker.d.ts +0 -22
  530. package/dist/plugins/typescript/analyzers/test-coverage-checker.d.ts.map +0 -1
  531. package/dist/plugins/typescript/analyzers/test-coverage-checker.js +0 -62
  532. package/dist/plugins/typescript/analyzers/test-coverage-checker.js.map +0 -1
  533. package/dist/plugins/typescript/analyzers/type-safety-checker.d.ts +0 -32
  534. package/dist/plugins/typescript/analyzers/type-safety-checker.d.ts.map +0 -1
  535. package/dist/plugins/typescript/analyzers/type-safety-checker.js +0 -86
  536. package/dist/plugins/typescript/analyzers/type-safety-checker.js.map +0 -1
  537. package/dist/plugins/typescript/analyzers/unused-symbol-detector.d.ts +0 -47
  538. package/dist/plugins/typescript/analyzers/unused-symbol-detector.d.ts.map +0 -1
  539. package/dist/plugins/typescript/analyzers/unused-symbol-detector.js +0 -152
  540. package/dist/plugins/typescript/analyzers/unused-symbol-detector.js.map +0 -1
  541. /package/dist/core/{move → move-file}/import-resolver.d.ts +0 -0
  542. /package/dist/core/{move → move-file}/types.d.ts +0 -0
  543. /package/dist/core/{move → move-file}/types.js +0 -0
@@ -0,0 +1,544 @@
1
+ /**
2
+ * Change Signature Service
3
+ * 參數重構核心服務
4
+ */
5
+ import * as path from 'path';
6
+ import { SignatureParser } from './signature-parser.js';
7
+ import { ChangeSignatureErrorCode, isAddParameterChange, isRemoveParameterChange, isReorderParametersChange, isChangeParameterTypeChange, isRenameParameterChange, isChangeDefaultValueChange, isToggleOptionalChange } from './types.js';
8
+ import { SymbolFinder } from '../shared/symbol-finder.js';
9
+ /**
10
+ * Change Signature Service
11
+ */
12
+ export class ChangeSignatureService {
13
+ parserRegistry;
14
+ fileSystem;
15
+ signatureParser;
16
+ symbolFinder;
17
+ constructor(parserRegistry, fileSystem) {
18
+ this.parserRegistry = parserRegistry;
19
+ this.fileSystem = fileSystem;
20
+ this.signatureParser = new SignatureParser(parserRegistry, fileSystem);
21
+ this.symbolFinder = new SymbolFinder(parserRegistry, fileSystem);
22
+ }
23
+ /**
24
+ * 執行 Change Signature
25
+ */
26
+ async changeSignature(options) {
27
+ // 1. 解析原始簽名
28
+ const originalSignature = await this.signatureParser.parseSignature(options.filePath, options.functionName);
29
+ if (!originalSignature) {
30
+ return this.createErrorResult(ChangeSignatureErrorCode.FunctionNotFound, `找不到函式: ${options.functionName}`);
31
+ }
32
+ // 2. 驗證變更
33
+ const validationErrors = this.validateChanges(originalSignature, options.changes);
34
+ if (validationErrors.length > 0) {
35
+ return this.createErrorResult(validationErrors[0].code, validationErrors[0].message);
36
+ }
37
+ // 3. 計算新簽名
38
+ const newSignature = this.applyChangesToSignature(originalSignature, options.changes);
39
+ // 4. 取得所有呼叫點
40
+ const projectFiles = options.targetFiles ?? await this.getProjectFiles(options.projectRoot);
41
+ const callSites = await this.symbolFinder.findCallSites(options.functionName, projectFiles);
42
+ // 5. 生成定義更新
43
+ const definitionUpdate = await this.generateDefinitionUpdate(options.filePath, originalSignature, newSignature);
44
+ // 6. 生成呼叫點更新
45
+ const callSiteUpdates = await this.generateCallSiteUpdates(callSites, originalSignature, newSignature, options.changes);
46
+ // 7. 執行或預覽
47
+ if (!options.preview) {
48
+ await this.applyChanges(definitionUpdate, callSiteUpdates);
49
+ }
50
+ // 8. 計算影響的檔案
51
+ const affectedFiles = new Set();
52
+ affectedFiles.add(definitionUpdate.filePath);
53
+ for (const update of callSiteUpdates) {
54
+ affectedFiles.add(update.filePath);
55
+ }
56
+ return {
57
+ success: true,
58
+ originalSignature,
59
+ newSignature,
60
+ definitionUpdate,
61
+ callSiteUpdates,
62
+ executed: !options.preview,
63
+ stats: {
64
+ callSitesUpdated: callSiteUpdates.length,
65
+ filesAffected: affectedFiles.size
66
+ }
67
+ };
68
+ }
69
+ /**
70
+ * 驗證變更
71
+ */
72
+ validateChanges(signature, changes) {
73
+ const errors = [];
74
+ const parameterNames = new Set(signature.parameters.map(p => p.name));
75
+ const newParameterNames = new Set(parameterNames);
76
+ for (const change of changes) {
77
+ if (isAddParameterChange(change)) {
78
+ if (newParameterNames.has(change.name)) {
79
+ errors.push({
80
+ code: ChangeSignatureErrorCode.DuplicateParameterName,
81
+ message: `參數名稱重複: ${change.name}`,
82
+ parameterName: change.name
83
+ });
84
+ }
85
+ else {
86
+ newParameterNames.add(change.name);
87
+ }
88
+ }
89
+ if (isRemoveParameterChange(change)) {
90
+ const targetName = this.resolveParameterName(signature, change.parameterNameOrIndex);
91
+ if (!targetName || !parameterNames.has(targetName)) {
92
+ errors.push({
93
+ code: ChangeSignatureErrorCode.ParameterNotFound,
94
+ message: `找不到參數: ${change.parameterNameOrIndex}`,
95
+ parameterName: String(change.parameterNameOrIndex)
96
+ });
97
+ }
98
+ else {
99
+ newParameterNames.delete(targetName);
100
+ }
101
+ }
102
+ if (isReorderParametersChange(change)) {
103
+ for (const nameOrIndex of change.newOrder) {
104
+ const targetName = this.resolveParameterName(signature, nameOrIndex);
105
+ if (!targetName || !parameterNames.has(targetName)) {
106
+ errors.push({
107
+ code: ChangeSignatureErrorCode.ParameterNotFound,
108
+ message: `找不到參數: ${nameOrIndex}`,
109
+ parameterName: String(nameOrIndex)
110
+ });
111
+ }
112
+ }
113
+ if (change.newOrder.length !== signature.parameters.length) {
114
+ errors.push({
115
+ code: ChangeSignatureErrorCode.InvalidParameterOrder,
116
+ message: '重新排序必須包含所有參數'
117
+ });
118
+ }
119
+ }
120
+ if (isChangeParameterTypeChange(change) || isRenameParameterChange(change) ||
121
+ isChangeDefaultValueChange(change) || isToggleOptionalChange(change)) {
122
+ const targetName = this.resolveParameterName(signature, change.parameterNameOrIndex);
123
+ if (!targetName || !parameterNames.has(targetName)) {
124
+ errors.push({
125
+ code: ChangeSignatureErrorCode.ParameterNotFound,
126
+ message: `找不到參數: ${change.parameterNameOrIndex}`,
127
+ parameterName: String(change.parameterNameOrIndex)
128
+ });
129
+ }
130
+ }
131
+ if (isRenameParameterChange(change)) {
132
+ if (newParameterNames.has(change.newName) && change.newName !== this.resolveParameterName(signature, change.parameterNameOrIndex)) {
133
+ errors.push({
134
+ code: ChangeSignatureErrorCode.DuplicateParameterName,
135
+ message: `參數名稱重複: ${change.newName}`,
136
+ parameterName: change.newName
137
+ });
138
+ }
139
+ }
140
+ }
141
+ return errors;
142
+ }
143
+ /**
144
+ * 套用變更到簽名
145
+ */
146
+ applyChangesToSignature(signature, changes) {
147
+ let parameters = [...signature.parameters];
148
+ for (const change of changes) {
149
+ if (isAddParameterChange(change)) {
150
+ const newParam = {
151
+ name: change.name,
152
+ type: change.parameterType,
153
+ defaultValue: change.defaultValue,
154
+ optional: change.optional,
155
+ rest: false,
156
+ range: { start: { line: 0, column: 0, offset: 0 }, end: { line: 0, column: 0, offset: 0 } }
157
+ };
158
+ if (change.position < 0 || change.position >= parameters.length) {
159
+ parameters.push(newParam);
160
+ }
161
+ else {
162
+ parameters.splice(change.position, 0, newParam);
163
+ }
164
+ }
165
+ if (isRemoveParameterChange(change)) {
166
+ const index = this.resolveParameterIndex(parameters, change.parameterNameOrIndex);
167
+ if (index >= 0) {
168
+ parameters.splice(index, 1);
169
+ }
170
+ }
171
+ if (isReorderParametersChange(change)) {
172
+ const newParams = [];
173
+ for (const nameOrIndex of change.newOrder) {
174
+ const index = this.resolveParameterIndex(parameters, nameOrIndex);
175
+ if (index >= 0) {
176
+ newParams.push(parameters[index]);
177
+ }
178
+ }
179
+ parameters = newParams;
180
+ }
181
+ if (isChangeParameterTypeChange(change)) {
182
+ const index = this.resolveParameterIndex(parameters, change.parameterNameOrIndex);
183
+ if (index >= 0) {
184
+ parameters[index] = { ...parameters[index], type: change.newType };
185
+ }
186
+ }
187
+ if (isRenameParameterChange(change)) {
188
+ const index = this.resolveParameterIndex(parameters, change.parameterNameOrIndex);
189
+ if (index >= 0) {
190
+ parameters[index] = { ...parameters[index], name: change.newName };
191
+ }
192
+ }
193
+ if (isChangeDefaultValueChange(change)) {
194
+ const index = this.resolveParameterIndex(parameters, change.parameterNameOrIndex);
195
+ if (index >= 0) {
196
+ parameters[index] = {
197
+ ...parameters[index],
198
+ defaultValue: change.newDefaultValue,
199
+ optional: change.newDefaultValue !== undefined || parameters[index].optional
200
+ };
201
+ }
202
+ }
203
+ if (isToggleOptionalChange(change)) {
204
+ const index = this.resolveParameterIndex(parameters, change.parameterNameOrIndex);
205
+ if (index >= 0) {
206
+ parameters[index] = { ...parameters[index], optional: change.optional };
207
+ }
208
+ }
209
+ }
210
+ return {
211
+ ...signature,
212
+ parameters
213
+ };
214
+ }
215
+ /**
216
+ * 生成定義更新
217
+ */
218
+ async generateDefinitionUpdate(filePath, originalSignature, newSignature) {
219
+ const content = await this.readFile(filePath);
220
+ if (!content) {
221
+ throw new Error(`無法讀取檔案: ${filePath}`);
222
+ }
223
+ const lines = content.split('\n');
224
+ const startLine = originalSignature.location.range.start.line - 1;
225
+ const originalLine = lines[startLine];
226
+ // 生成新的參數列表
227
+ const newParamsString = this.generateParameterString(newSignature, filePath);
228
+ // 替換參數部分
229
+ const funcNameIndex = originalLine.indexOf(originalSignature.name);
230
+ const openParenIndex = originalLine.indexOf('(', funcNameIndex);
231
+ const closeParenIndex = this.findMatchingParen(originalLine, openParenIndex);
232
+ const newLine = originalLine.substring(0, openParenIndex + 1) +
233
+ newParamsString +
234
+ originalLine.substring(closeParenIndex);
235
+ return {
236
+ filePath,
237
+ originalCode: originalLine,
238
+ newCode: newLine,
239
+ location: originalSignature.location
240
+ };
241
+ }
242
+ /**
243
+ * 生成呼叫點更新
244
+ */
245
+ async generateCallSiteUpdates(callSites, originalSignature, newSignature, changes) {
246
+ const updates = [];
247
+ // 建立參數映射
248
+ const parameterMapping = this.createParameterMapping(originalSignature, newSignature, changes);
249
+ for (const callSite of callSites) {
250
+ const content = await this.readFile(callSite.location.filePath);
251
+ if (!content) {
252
+ continue;
253
+ }
254
+ const lines = content.split('\n');
255
+ const lineIndex = callSite.location.range.start.line - 1;
256
+ const originalLine = lines[lineIndex];
257
+ // 建立新的參數列表
258
+ const newArgs = this.mapCallSiteArguments(callSite, parameterMapping, changes);
259
+ const newArgsString = newArgs.join(', ');
260
+ // 找到呼叫的括號位置
261
+ const funcNameIndex = originalLine.indexOf(callSite.functionName);
262
+ if (funcNameIndex < 0) {
263
+ continue;
264
+ }
265
+ const openParenIndex = originalLine.indexOf('(', funcNameIndex);
266
+ const closeParenIndex = this.findMatchingParen(originalLine, openParenIndex);
267
+ const newLine = originalLine.substring(0, openParenIndex + 1) +
268
+ newArgsString +
269
+ originalLine.substring(closeParenIndex);
270
+ if (newLine !== originalLine) {
271
+ updates.push({
272
+ filePath: callSite.location.filePath,
273
+ originalCode: originalLine,
274
+ newCode: newLine,
275
+ location: callSite.location
276
+ });
277
+ }
278
+ }
279
+ return updates;
280
+ }
281
+ /**
282
+ * 建立參數映射
283
+ */
284
+ createParameterMapping(originalSignature, newSignature, changes) {
285
+ const mapping = new Map();
286
+ // 初始化:原始索引 -> 新索引
287
+ let currentParams = originalSignature.parameters.map((p, i) => ({ name: p.name, originalIndex: i }));
288
+ // 處理每個變更
289
+ for (const change of changes) {
290
+ if (isRemoveParameterChange(change)) {
291
+ const index = this.resolveParameterIndex(currentParams.map(p => ({ name: p.name })), change.parameterNameOrIndex);
292
+ if (index >= 0) {
293
+ currentParams.splice(index, 1);
294
+ }
295
+ }
296
+ if (isReorderParametersChange(change)) {
297
+ const newOrder = [];
298
+ for (const nameOrIndex of change.newOrder) {
299
+ const index = this.resolveParameterIndex(currentParams.map(p => ({ name: p.name })), nameOrIndex);
300
+ if (index >= 0) {
301
+ newOrder.push(currentParams[index]);
302
+ }
303
+ }
304
+ currentParams = newOrder;
305
+ }
306
+ if (isAddParameterChange(change)) {
307
+ const newParam = { name: change.name, originalIndex: -1, value: change.callSiteValue || change.defaultValue };
308
+ if (change.position < 0 || change.position >= currentParams.length) {
309
+ currentParams.push(newParam);
310
+ }
311
+ else {
312
+ currentParams.splice(change.position, 0, newParam);
313
+ }
314
+ }
315
+ }
316
+ // 建立最終映射
317
+ for (let newIndex = 0; newIndex < currentParams.length; newIndex++) {
318
+ const param = currentParams[newIndex];
319
+ if (param.originalIndex >= 0) {
320
+ mapping.set(param.originalIndex, { newIndex });
321
+ }
322
+ else if ('value' in param) {
323
+ // 新增的參數,設定預設值
324
+ mapping.set(-1 - newIndex, { newIndex, value: param.value });
325
+ }
326
+ }
327
+ return mapping;
328
+ }
329
+ /**
330
+ * 映射呼叫點參數
331
+ */
332
+ mapCallSiteArguments(callSite, parameterMapping, changes) {
333
+ const result = [];
334
+ // 找出新參數的數量
335
+ let maxNewIndex = -1;
336
+ for (const { newIndex } of parameterMapping.values()) {
337
+ maxNewIndex = Math.max(maxNewIndex, newIndex);
338
+ }
339
+ // 初始化結果陣列
340
+ for (let i = 0; i <= maxNewIndex; i++) {
341
+ result.push('');
342
+ }
343
+ // 映射原始參數
344
+ for (const [originalIndex, { newIndex }] of parameterMapping.entries()) {
345
+ if (originalIndex >= 0 && originalIndex < callSite.arguments.length) {
346
+ result[newIndex] = callSite.arguments[originalIndex].value;
347
+ }
348
+ }
349
+ // 填入新增參數的值
350
+ for (const change of changes) {
351
+ if (isAddParameterChange(change)) {
352
+ const value = change.callSiteValue || change.defaultValue || '';
353
+ const position = change.position < 0 ? result.length - 1 : change.position;
354
+ if (position < result.length && !result[position]) {
355
+ result[position] = value;
356
+ }
357
+ }
358
+ }
359
+ // 移除空值(但保留有意義的空字串)
360
+ return result.filter((v, i) => v !== '' || i < callSite.arguments.length);
361
+ }
362
+ /**
363
+ * 執行變更
364
+ */
365
+ async applyChanges(definitionUpdate, callSiteUpdates) {
366
+ // 按檔案分組
367
+ const fileUpdates = new Map();
368
+ // 加入定義更新
369
+ if (!fileUpdates.has(definitionUpdate.filePath)) {
370
+ fileUpdates.set(definitionUpdate.filePath, []);
371
+ }
372
+ fileUpdates.get(definitionUpdate.filePath).push({
373
+ originalCode: definitionUpdate.originalCode,
374
+ newCode: definitionUpdate.newCode,
375
+ line: 0 // 會在下面重新計算
376
+ });
377
+ // 加入呼叫點更新
378
+ for (const update of callSiteUpdates) {
379
+ if (!fileUpdates.has(update.filePath)) {
380
+ fileUpdates.set(update.filePath, []);
381
+ }
382
+ fileUpdates.get(update.filePath).push({
383
+ originalCode: update.originalCode,
384
+ newCode: update.newCode,
385
+ line: update.location.range.start.line
386
+ });
387
+ }
388
+ // 套用到每個檔案
389
+ for (const [filePath, updates] of fileUpdates) {
390
+ let content = await this.readFile(filePath);
391
+ if (!content) {
392
+ continue;
393
+ }
394
+ // 從後往前替換,避免行號偏移
395
+ const sortedUpdates = updates.sort((a, b) => b.line - a.line);
396
+ for (const update of sortedUpdates) {
397
+ content = content.replace(update.originalCode, update.newCode);
398
+ }
399
+ await this.fileSystem.writeFile(filePath, content);
400
+ }
401
+ }
402
+ /**
403
+ * 生成參數字串
404
+ */
405
+ generateParameterString(signature, filePath) {
406
+ const extension = this.getFileExtension(filePath);
407
+ const isSwift = extension === '.swift';
408
+ const isTypeScript = extension === '.ts' || extension === '.tsx';
409
+ return signature.parameters.map(param => {
410
+ let result = '';
411
+ if (param.rest) {
412
+ result += isSwift ? '' : '...';
413
+ }
414
+ result += param.name;
415
+ if (param.optional && !param.defaultValue && !isSwift) {
416
+ result += '?';
417
+ }
418
+ if (param.type && (isTypeScript || isSwift)) {
419
+ result += isSwift ? `: ${param.type}` : `: ${param.type}`;
420
+ }
421
+ if (param.rest && isSwift) {
422
+ result += '...';
423
+ }
424
+ if (param.defaultValue) {
425
+ result += ` = ${param.defaultValue}`;
426
+ }
427
+ return result;
428
+ }).join(', ');
429
+ }
430
+ /**
431
+ * 找到匹配的括號
432
+ */
433
+ findMatchingParen(line, openIndex) {
434
+ let depth = 1;
435
+ for (let i = openIndex + 1; i < line.length; i++) {
436
+ if (line[i] === '(') {
437
+ depth++;
438
+ }
439
+ else if (line[i] === ')') {
440
+ depth--;
441
+ if (depth === 0) {
442
+ return i;
443
+ }
444
+ }
445
+ }
446
+ return line.length;
447
+ }
448
+ /**
449
+ * 解析參數名稱
450
+ */
451
+ resolveParameterName(signature, nameOrIndex) {
452
+ if (typeof nameOrIndex === 'number') {
453
+ return signature.parameters[nameOrIndex]?.name;
454
+ }
455
+ return signature.parameters.find(p => p.name === nameOrIndex)?.name;
456
+ }
457
+ /**
458
+ * 解析參數索引
459
+ */
460
+ resolveParameterIndex(parameters, nameOrIndex) {
461
+ if (typeof nameOrIndex === 'number') {
462
+ return nameOrIndex >= 0 && nameOrIndex < parameters.length ? nameOrIndex : -1;
463
+ }
464
+ return parameters.findIndex(p => p.name === nameOrIndex);
465
+ }
466
+ /**
467
+ * 取得專案檔案
468
+ */
469
+ async getProjectFiles(projectRoot) {
470
+ const files = [];
471
+ await this.collectFiles(projectRoot, files);
472
+ return files;
473
+ }
474
+ /**
475
+ * 遞迴收集檔案
476
+ */
477
+ async collectFiles(dirPath, files) {
478
+ const entries = await this.fileSystem.readDirectory(dirPath);
479
+ for (const entry of entries) {
480
+ const fullPath = path.join(dirPath, entry.name);
481
+ // 跳過 node_modules 和隱藏目錄
482
+ if (entry.name === 'node_modules' || entry.name.startsWith('.')) {
483
+ continue;
484
+ }
485
+ if (entry.isDirectory) {
486
+ await this.collectFiles(fullPath, files);
487
+ }
488
+ else if (entry.isFile && this.isSupportedFile(entry.name)) {
489
+ files.push(fullPath);
490
+ }
491
+ }
492
+ }
493
+ /**
494
+ * 檢查是否為支援的檔案類型
495
+ */
496
+ isSupportedFile(filename) {
497
+ const supportedExtensions = ['.ts', '.tsx', '.js', '.jsx', '.swift'];
498
+ return supportedExtensions.some(ext => filename.endsWith(ext));
499
+ }
500
+ /**
501
+ * 讀取檔案內容
502
+ */
503
+ async readFile(filePath) {
504
+ try {
505
+ const content = await this.fileSystem.readFile(filePath, 'utf-8');
506
+ return typeof content === 'string' ? content : content.toString('utf-8');
507
+ }
508
+ catch {
509
+ return null;
510
+ }
511
+ }
512
+ /**
513
+ * 取得檔案副檔名
514
+ */
515
+ getFileExtension(filePath) {
516
+ const lastDot = filePath.lastIndexOf('.');
517
+ return lastDot >= 0 ? filePath.substring(lastDot) : '';
518
+ }
519
+ /**
520
+ * 建立錯誤結果
521
+ */
522
+ createErrorResult(code, message) {
523
+ return {
524
+ success: false,
525
+ error: message,
526
+ originalSignature: null,
527
+ newSignature: null,
528
+ definitionUpdate: null,
529
+ callSiteUpdates: [],
530
+ executed: false,
531
+ stats: {
532
+ callSitesUpdated: 0,
533
+ filesAffected: 0
534
+ }
535
+ };
536
+ }
537
+ }
538
+ /**
539
+ * 建立 ChangeSignatureService 實例
540
+ */
541
+ export function createChangeSignatureService(parserRegistry, fileSystem) {
542
+ return new ChangeSignatureService(parserRegistry, fileSystem);
543
+ }
544
+ //# sourceMappingURL=change-signature-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"change-signature-service.js","sourceRoot":"","sources":["../../../src/core/change-signature/change-signature-service.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAG7B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EASL,wBAAwB,EACxB,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,EAC3B,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAiB,MAAM,4BAA4B,CAAC;AAEzE;;GAEG;AACH,MAAM,OAAO,sBAAsB;IAKd;IACA;IALF,eAAe,CAAkB;IACjC,YAAY,CAAe;IAE5C,YACmB,cAA8B,EAC9B,UAAuB;QADvB,mBAAc,GAAd,cAAc,CAAgB;QAC9B,eAAU,GAAV,UAAU,CAAa;QAExC,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;QACvE,IAAI,CAAC,YAAY,GAAG,IAAI,YAAY,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;IACnE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,eAAe,CAAC,OAA+B;QACnD,YAAY;QACZ,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,cAAc,CACjE,OAAO,CAAC,QAAQ,EAChB,OAAO,CAAC,YAAY,CACrB,CAAC;QAEF,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC,iBAAiB,CAC3B,wBAAwB,CAAC,gBAAgB,EACzC,UAAU,OAAO,CAAC,YAAY,EAAE,CACjC,CAAC;QACJ,CAAC;QAED,UAAU;QACV,MAAM,gBAAgB,GAAG,IAAI,CAAC,eA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AAC,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC3E,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED;;OAEG;IACK,gBAAgB,CAAC,QAAgB;QACvC,MAAM,OAAO,GAAG,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAC1C,OAAO,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACzD,CAAC;IAED;;OAEG;IACK,iBAAiB,CAAC,IAA8B,EAAE,OAAe;QACvE,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,OAAO;YACd,iBAAiB,EAAE,IAAW;YAC9B,YAAY,EAAE,IAAW;YACzB,gBAAgB,EAAE,IAAW;YAC7B,eAAe,EAAE,EAAE;YACnB,QAAQ,EAAE,KAAK;YACf,KAAK,EAAE;gBACL,gBAAgB,EAAE,CAAC;gBACnB,aAAa,EAAE,CAAC;aACjB;SACF,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,4BAA4B,CAC1C,cAA8B,EAC9B,UAAuB;IAEvB,OAAO,IAAI,sBAAsB,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;AAChE,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Change Signature 子模組
3
+ * 參數重構功能
4
+ */
5
+ export { ChangeSignatureService, createChangeSignatureService } from './change-signature-service.js';
6
+ export { SignatureParser, createSignatureParser } from './signature-parser.js';
7
+ export type { ParameterDefinition, FunctionSignature, SignatureChange, AddParameterChange, RemoveParameterChange, ReorderParametersChange, ChangeParameterTypeChange, RenameParameterChange, ChangeDefaultValueChange, ToggleOptionalChange, ChangeSignatureOptions, CallSiteUpdate, ChangeSignatureResult, ChangeSignatureValidationError } from './types.js';
8
+ export { SignatureChangeType, ChangeSignatureErrorCode } from './types.js';
9
+ export { isAddParameterChange, isRemoveParameterChange, isReorderParametersChange, isChangeParameterTypeChange, isRenameParameterChange, isChangeDefaultValueChange, isToggleOptionalChange } from './types.js';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/change-signature/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AACrG,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAG/E,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,sBAAsB,EACtB,cAAc,EACd,qBAAqB,EACrB,8BAA8B,EAC/B,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,EAC3B,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACvB,MAAM,YAAY,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Change Signature 子模組
3
+ * 參數重構功能
4
+ */
5
+ // 核心服務
6
+ export { ChangeSignatureService, createChangeSignatureService } from './change-signature-service.js';
7
+ export { SignatureParser, createSignatureParser } from './signature-parser.js';
8
+ // 列舉
9
+ export { SignatureChangeType, ChangeSignatureErrorCode } from './types.js';
10
+ // Type Guards
11
+ export { isAddParameterChange, isRemoveParameterChange, isReorderParametersChange, isChangeParameterTypeChange, isRenameParameterChange, isChangeDefaultValueChange, isToggleOptionalChange } from './types.js';
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/change-signature/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO;AACP,OAAO,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AACrG,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAoB/E,KAAK;AACL,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,YAAY,CAAC;AAEpB,cAAc;AACd,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,EAC3B,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACvB,MAAM,YAAY,CAAC"}