sudocode 1.1.20 → 1.1.22

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 (857) hide show
  1. package/package.json +9 -9
  2. package/node_modules/@sudocode-ai/cli/README.md +0 -1629
  3. package/node_modules/@sudocode-ai/cli/dist/auth/claude.d.ts +0 -19
  4. package/node_modules/@sudocode-ai/cli/dist/auth/claude.d.ts.map +0 -1
  5. package/node_modules/@sudocode-ai/cli/dist/auth/claude.js +0 -179
  6. package/node_modules/@sudocode-ai/cli/dist/auth/claude.js.map +0 -1
  7. package/node_modules/@sudocode-ai/cli/dist/auth/clear.d.ts +0 -17
  8. package/node_modules/@sudocode-ai/cli/dist/auth/clear.d.ts.map +0 -1
  9. package/node_modules/@sudocode-ai/cli/dist/auth/clear.js +0 -68
  10. package/node_modules/@sudocode-ai/cli/dist/auth/clear.js.map +0 -1
  11. package/node_modules/@sudocode-ai/cli/dist/auth/credentials.d.ts +0 -93
  12. package/node_modules/@sudocode-ai/cli/dist/auth/credentials.d.ts.map +0 -1
  13. package/node_modules/@sudocode-ai/cli/dist/auth/credentials.js +0 -255
  14. package/node_modules/@sudocode-ai/cli/dist/auth/credentials.js.map +0 -1
  15. package/node_modules/@sudocode-ai/cli/dist/auth/index.d.ts +0 -13
  16. package/node_modules/@sudocode-ai/cli/dist/auth/index.d.ts.map +0 -1
  17. package/node_modules/@sudocode-ai/cli/dist/auth/index.js +0 -19
  18. package/node_modules/@sudocode-ai/cli/dist/auth/index.js.map +0 -1
  19. package/node_modules/@sudocode-ai/cli/dist/auth/status.d.ts +0 -17
  20. package/node_modules/@sudocode-ai/cli/dist/auth/status.d.ts.map +0 -1
  21. package/node_modules/@sudocode-ai/cli/dist/auth/status.js +0 -132
  22. package/node_modules/@sudocode-ai/cli/dist/auth/status.js.map +0 -1
  23. package/node_modules/@sudocode-ai/cli/dist/cli/auth-commands.d.ts +0 -34
  24. package/node_modules/@sudocode-ai/cli/dist/cli/auth-commands.d.ts.map +0 -1
  25. package/node_modules/@sudocode-ai/cli/dist/cli/auth-commands.js +0 -28
  26. package/node_modules/@sudocode-ai/cli/dist/cli/auth-commands.js.map +0 -1
  27. package/node_modules/@sudocode-ai/cli/dist/cli/feedback-commands.d.ts +0 -53
  28. package/node_modules/@sudocode-ai/cli/dist/cli/feedback-commands.d.ts.map +0 -1
  29. package/node_modules/@sudocode-ai/cli/dist/cli/feedback-commands.js +0 -339
  30. package/node_modules/@sudocode-ai/cli/dist/cli/feedback-commands.js.map +0 -1
  31. package/node_modules/@sudocode-ai/cli/dist/cli/init-commands.d.ts +0 -20
  32. package/node_modules/@sudocode-ai/cli/dist/cli/init-commands.d.ts.map +0 -1
  33. package/node_modules/@sudocode-ai/cli/dist/cli/init-commands.js +0 -145
  34. package/node_modules/@sudocode-ai/cli/dist/cli/init-commands.js.map +0 -1
  35. package/node_modules/@sudocode-ai/cli/dist/cli/issue-commands.d.ts +0 -46
  36. package/node_modules/@sudocode-ai/cli/dist/cli/issue-commands.d.ts.map +0 -1
  37. package/node_modules/@sudocode-ai/cli/dist/cli/issue-commands.js +0 -353
  38. package/node_modules/@sudocode-ai/cli/dist/cli/issue-commands.js.map +0 -1
  39. package/node_modules/@sudocode-ai/cli/dist/cli/merge-commands.d.ts +0 -42
  40. package/node_modules/@sudocode-ai/cli/dist/cli/merge-commands.d.ts.map +0 -1
  41. package/node_modules/@sudocode-ai/cli/dist/cli/merge-commands.js +0 -680
  42. package/node_modules/@sudocode-ai/cli/dist/cli/merge-commands.js.map +0 -1
  43. package/node_modules/@sudocode-ai/cli/dist/cli/plugin-commands.d.ts +0 -62
  44. package/node_modules/@sudocode-ai/cli/dist/cli/plugin-commands.d.ts.map +0 -1
  45. package/node_modules/@sudocode-ai/cli/dist/cli/plugin-commands.js +0 -595
  46. package/node_modules/@sudocode-ai/cli/dist/cli/plugin-commands.js.map +0 -1
  47. package/node_modules/@sudocode-ai/cli/dist/cli/query-commands.d.ts +0 -18
  48. package/node_modules/@sudocode-ai/cli/dist/cli/query-commands.d.ts.map +0 -1
  49. package/node_modules/@sudocode-ai/cli/dist/cli/query-commands.js +0 -61
  50. package/node_modules/@sudocode-ai/cli/dist/cli/query-commands.js.map +0 -1
  51. package/node_modules/@sudocode-ai/cli/dist/cli/reference-commands.d.ts +0 -22
  52. package/node_modules/@sudocode-ai/cli/dist/cli/reference-commands.d.ts.map +0 -1
  53. package/node_modules/@sudocode-ai/cli/dist/cli/reference-commands.js +0 -136
  54. package/node_modules/@sudocode-ai/cli/dist/cli/reference-commands.js.map +0 -1
  55. package/node_modules/@sudocode-ai/cli/dist/cli/relationship-commands.d.ts +0 -14
  56. package/node_modules/@sudocode-ai/cli/dist/cli/relationship-commands.d.ts.map +0 -1
  57. package/node_modules/@sudocode-ai/cli/dist/cli/relationship-commands.js +0 -83
  58. package/node_modules/@sudocode-ai/cli/dist/cli/relationship-commands.js.map +0 -1
  59. package/node_modules/@sudocode-ai/cli/dist/cli/remote-commands.d.ts +0 -59
  60. package/node_modules/@sudocode-ai/cli/dist/cli/remote-commands.d.ts.map +0 -1
  61. package/node_modules/@sudocode-ai/cli/dist/cli/remote-commands.js +0 -391
  62. package/node_modules/@sudocode-ai/cli/dist/cli/remote-commands.js.map +0 -1
  63. package/node_modules/@sudocode-ai/cli/dist/cli/server-commands.d.ts +0 -17
  64. package/node_modules/@sudocode-ai/cli/dist/cli/server-commands.d.ts.map +0 -1
  65. package/node_modules/@sudocode-ai/cli/dist/cli/server-commands.js +0 -123
  66. package/node_modules/@sudocode-ai/cli/dist/cli/server-commands.js.map +0 -1
  67. package/node_modules/@sudocode-ai/cli/dist/cli/spec-commands.d.ts +0 -38
  68. package/node_modules/@sudocode-ai/cli/dist/cli/spec-commands.d.ts.map +0 -1
  69. package/node_modules/@sudocode-ai/cli/dist/cli/spec-commands.js +0 -326
  70. package/node_modules/@sudocode-ai/cli/dist/cli/spec-commands.js.map +0 -1
  71. package/node_modules/@sudocode-ai/cli/dist/cli/status-commands.d.ts +0 -17
  72. package/node_modules/@sudocode-ai/cli/dist/cli/status-commands.d.ts.map +0 -1
  73. package/node_modules/@sudocode-ai/cli/dist/cli/status-commands.js +0 -131
  74. package/node_modules/@sudocode-ai/cli/dist/cli/status-commands.js.map +0 -1
  75. package/node_modules/@sudocode-ai/cli/dist/cli/sync-commands.d.ts +0 -24
  76. package/node_modules/@sudocode-ai/cli/dist/cli/sync-commands.d.ts.map +0 -1
  77. package/node_modules/@sudocode-ai/cli/dist/cli/sync-commands.js +0 -429
  78. package/node_modules/@sudocode-ai/cli/dist/cli/sync-commands.js.map +0 -1
  79. package/node_modules/@sudocode-ai/cli/dist/cli/update-commands.d.ts +0 -16
  80. package/node_modules/@sudocode-ai/cli/dist/cli/update-commands.d.ts.map +0 -1
  81. package/node_modules/@sudocode-ai/cli/dist/cli/update-commands.js +0 -216
  82. package/node_modules/@sudocode-ai/cli/dist/cli/update-commands.js.map +0 -1
  83. package/node_modules/@sudocode-ai/cli/dist/cli.d.ts +0 -6
  84. package/node_modules/@sudocode-ai/cli/dist/cli.d.ts.map +0 -1
  85. package/node_modules/@sudocode-ai/cli/dist/cli.js +0 -673
  86. package/node_modules/@sudocode-ai/cli/dist/cli.js.map +0 -1
  87. package/node_modules/@sudocode-ai/cli/dist/config.d.ts +0 -50
  88. package/node_modules/@sudocode-ai/cli/dist/config.d.ts.map +0 -1
  89. package/node_modules/@sudocode-ai/cli/dist/config.js +0 -76
  90. package/node_modules/@sudocode-ai/cli/dist/config.js.map +0 -1
  91. package/node_modules/@sudocode-ai/cli/dist/db.d.ts +0 -21
  92. package/node_modules/@sudocode-ai/cli/dist/db.d.ts.map +0 -1
  93. package/node_modules/@sudocode-ai/cli/dist/db.js +0 -55
  94. package/node_modules/@sudocode-ai/cli/dist/db.js.map +0 -1
  95. package/node_modules/@sudocode-ai/cli/dist/export.d.ts +0 -84
  96. package/node_modules/@sudocode-ai/cli/dist/export.d.ts.map +0 -1
  97. package/node_modules/@sudocode-ai/cli/dist/export.js +0 -265
  98. package/node_modules/@sudocode-ai/cli/dist/export.js.map +0 -1
  99. package/node_modules/@sudocode-ai/cli/dist/filename-generator.d.ts +0 -31
  100. package/node_modules/@sudocode-ai/cli/dist/filename-generator.d.ts.map +0 -1
  101. package/node_modules/@sudocode-ai/cli/dist/filename-generator.js +0 -103
  102. package/node_modules/@sudocode-ai/cli/dist/filename-generator.js.map +0 -1
  103. package/node_modules/@sudocode-ai/cli/dist/git-merge.d.ts +0 -88
  104. package/node_modules/@sudocode-ai/cli/dist/git-merge.d.ts.map +0 -1
  105. package/node_modules/@sudocode-ai/cli/dist/git-merge.js +0 -214
  106. package/node_modules/@sudocode-ai/cli/dist/git-merge.js.map +0 -1
  107. package/node_modules/@sudocode-ai/cli/dist/id-generator.d.ts +0 -63
  108. package/node_modules/@sudocode-ai/cli/dist/id-generator.d.ts.map +0 -1
  109. package/node_modules/@sudocode-ai/cli/dist/id-generator.js +0 -196
  110. package/node_modules/@sudocode-ai/cli/dist/id-generator.js.map +0 -1
  111. package/node_modules/@sudocode-ai/cli/dist/import.d.ts +0 -134
  112. package/node_modules/@sudocode-ai/cli/dist/import.d.ts.map +0 -1
  113. package/node_modules/@sudocode-ai/cli/dist/import.js +0 -751
  114. package/node_modules/@sudocode-ai/cli/dist/import.js.map +0 -1
  115. package/node_modules/@sudocode-ai/cli/dist/index.d.ts +0 -17
  116. package/node_modules/@sudocode-ai/cli/dist/index.d.ts.map +0 -1
  117. package/node_modules/@sudocode-ai/cli/dist/index.js +0 -17
  118. package/node_modules/@sudocode-ai/cli/dist/index.js.map +0 -1
  119. package/node_modules/@sudocode-ai/cli/dist/integrations/base-provider.d.ts +0 -108
  120. package/node_modules/@sudocode-ai/cli/dist/integrations/base-provider.d.ts.map +0 -1
  121. package/node_modules/@sudocode-ai/cli/dist/integrations/base-provider.js +0 -80
  122. package/node_modules/@sudocode-ai/cli/dist/integrations/base-provider.js.map +0 -1
  123. package/node_modules/@sudocode-ai/cli/dist/integrations/config-resolver.d.ts +0 -62
  124. package/node_modules/@sudocode-ai/cli/dist/integrations/config-resolver.d.ts.map +0 -1
  125. package/node_modules/@sudocode-ai/cli/dist/integrations/config-resolver.js +0 -69
  126. package/node_modules/@sudocode-ai/cli/dist/integrations/config-resolver.js.map +0 -1
  127. package/node_modules/@sudocode-ai/cli/dist/integrations/config-validator.d.ts +0 -75
  128. package/node_modules/@sudocode-ai/cli/dist/integrations/config-validator.d.ts.map +0 -1
  129. package/node_modules/@sudocode-ai/cli/dist/integrations/config-validator.js +0 -129
  130. package/node_modules/@sudocode-ai/cli/dist/integrations/config-validator.js.map +0 -1
  131. package/node_modules/@sudocode-ai/cli/dist/integrations/index.d.ts +0 -14
  132. package/node_modules/@sudocode-ai/cli/dist/integrations/index.d.ts.map +0 -1
  133. package/node_modules/@sudocode-ai/cli/dist/integrations/index.js +0 -20
  134. package/node_modules/@sudocode-ai/cli/dist/integrations/index.js.map +0 -1
  135. package/node_modules/@sudocode-ai/cli/dist/integrations/plugin-loader.d.ts +0 -77
  136. package/node_modules/@sudocode-ai/cli/dist/integrations/plugin-loader.d.ts.map +0 -1
  137. package/node_modules/@sudocode-ai/cli/dist/integrations/plugin-loader.js +0 -265
  138. package/node_modules/@sudocode-ai/cli/dist/integrations/plugin-loader.js.map +0 -1
  139. package/node_modules/@sudocode-ai/cli/dist/integrations/registry.d.ts +0 -67
  140. package/node_modules/@sudocode-ai/cli/dist/integrations/registry.d.ts.map +0 -1
  141. package/node_modules/@sudocode-ai/cli/dist/integrations/registry.js +0 -77
  142. package/node_modules/@sudocode-ai/cli/dist/integrations/registry.js.map +0 -1
  143. package/node_modules/@sudocode-ai/cli/dist/integrations/sync-coordinator.d.ts +0 -191
  144. package/node_modules/@sudocode-ai/cli/dist/integrations/sync-coordinator.d.ts.map +0 -1
  145. package/node_modules/@sudocode-ai/cli/dist/integrations/sync-coordinator.js +0 -798
  146. package/node_modules/@sudocode-ai/cli/dist/integrations/sync-coordinator.js.map +0 -1
  147. package/node_modules/@sudocode-ai/cli/dist/integrations/types.d.ts +0 -142
  148. package/node_modules/@sudocode-ai/cli/dist/integrations/types.d.ts.map +0 -1
  149. package/node_modules/@sudocode-ai/cli/dist/integrations/types.js +0 -6
  150. package/node_modules/@sudocode-ai/cli/dist/integrations/types.js.map +0 -1
  151. package/node_modules/@sudocode-ai/cli/dist/integrations/utils/conflict-resolver.d.ts +0 -79
  152. package/node_modules/@sudocode-ai/cli/dist/integrations/utils/conflict-resolver.d.ts.map +0 -1
  153. package/node_modules/@sudocode-ai/cli/dist/integrations/utils/conflict-resolver.js +0 -106
  154. package/node_modules/@sudocode-ai/cli/dist/integrations/utils/conflict-resolver.js.map +0 -1
  155. package/node_modules/@sudocode-ai/cli/dist/jsonl.d.ts +0 -69
  156. package/node_modules/@sudocode-ai/cli/dist/jsonl.d.ts.map +0 -1
  157. package/node_modules/@sudocode-ai/cli/dist/jsonl.js +0 -333
  158. package/node_modules/@sudocode-ai/cli/dist/jsonl.js.map +0 -1
  159. package/node_modules/@sudocode-ai/cli/dist/markdown.d.ts +0 -146
  160. package/node_modules/@sudocode-ai/cli/dist/markdown.d.ts.map +0 -1
  161. package/node_modules/@sudocode-ai/cli/dist/markdown.js +0 -329
  162. package/node_modules/@sudocode-ai/cli/dist/markdown.js.map +0 -1
  163. package/node_modules/@sudocode-ai/cli/dist/merge-resolver.d.ts +0 -157
  164. package/node_modules/@sudocode-ai/cli/dist/merge-resolver.d.ts.map +0 -1
  165. package/node_modules/@sudocode-ai/cli/dist/merge-resolver.js +0 -716
  166. package/node_modules/@sudocode-ai/cli/dist/merge-resolver.js.map +0 -1
  167. package/node_modules/@sudocode-ai/cli/dist/operations/events.d.ts +0 -53
  168. package/node_modules/@sudocode-ai/cli/dist/operations/events.d.ts.map +0 -1
  169. package/node_modules/@sudocode-ai/cli/dist/operations/events.js +0 -108
  170. package/node_modules/@sudocode-ai/cli/dist/operations/events.js.map +0 -1
  171. package/node_modules/@sudocode-ai/cli/dist/operations/external-links.d.ts +0 -147
  172. package/node_modules/@sudocode-ai/cli/dist/operations/external-links.d.ts.map +0 -1
  173. package/node_modules/@sudocode-ai/cli/dist/operations/external-links.js +0 -411
  174. package/node_modules/@sudocode-ai/cli/dist/operations/external-links.js.map +0 -1
  175. package/node_modules/@sudocode-ai/cli/dist/operations/feedback-anchors.d.ts +0 -92
  176. package/node_modules/@sudocode-ai/cli/dist/operations/feedback-anchors.d.ts.map +0 -1
  177. package/node_modules/@sudocode-ai/cli/dist/operations/feedback-anchors.js +0 -444
  178. package/node_modules/@sudocode-ai/cli/dist/operations/feedback-anchors.js.map +0 -1
  179. package/node_modules/@sudocode-ai/cli/dist/operations/feedback.d.ts +0 -94
  180. package/node_modules/@sudocode-ai/cli/dist/operations/feedback.d.ts.map +0 -1
  181. package/node_modules/@sudocode-ai/cli/dist/operations/feedback.js +0 -278
  182. package/node_modules/@sudocode-ai/cli/dist/operations/feedback.js.map +0 -1
  183. package/node_modules/@sudocode-ai/cli/dist/operations/index.d.ts +0 -11
  184. package/node_modules/@sudocode-ai/cli/dist/operations/index.d.ts.map +0 -1
  185. package/node_modules/@sudocode-ai/cli/dist/operations/index.js +0 -11
  186. package/node_modules/@sudocode-ai/cli/dist/operations/index.js.map +0 -1
  187. package/node_modules/@sudocode-ai/cli/dist/operations/issues.d.ts +0 -88
  188. package/node_modules/@sudocode-ai/cli/dist/operations/issues.d.ts.map +0 -1
  189. package/node_modules/@sudocode-ai/cli/dist/operations/issues.js +0 -474
  190. package/node_modules/@sudocode-ai/cli/dist/operations/issues.js.map +0 -1
  191. package/node_modules/@sudocode-ai/cli/dist/operations/references.d.ts +0 -34
  192. package/node_modules/@sudocode-ai/cli/dist/operations/references.d.ts.map +0 -1
  193. package/node_modules/@sudocode-ai/cli/dist/operations/references.js +0 -117
  194. package/node_modules/@sudocode-ai/cli/dist/operations/references.js.map +0 -1
  195. package/node_modules/@sudocode-ai/cli/dist/operations/relationships.d.ts +0 -64
  196. package/node_modules/@sudocode-ai/cli/dist/operations/relationships.d.ts.map +0 -1
  197. package/node_modules/@sudocode-ai/cli/dist/operations/relationships.js +0 -281
  198. package/node_modules/@sudocode-ai/cli/dist/operations/relationships.js.map +0 -1
  199. package/node_modules/@sudocode-ai/cli/dist/operations/specs.d.ts +0 -69
  200. package/node_modules/@sudocode-ai/cli/dist/operations/specs.d.ts.map +0 -1
  201. package/node_modules/@sudocode-ai/cli/dist/operations/specs.js +0 -330
  202. package/node_modules/@sudocode-ai/cli/dist/operations/specs.js.map +0 -1
  203. package/node_modules/@sudocode-ai/cli/dist/operations/tags.d.ts +0 -42
  204. package/node_modules/@sudocode-ai/cli/dist/operations/tags.d.ts.map +0 -1
  205. package/node_modules/@sudocode-ai/cli/dist/operations/tags.js +0 -127
  206. package/node_modules/@sudocode-ai/cli/dist/operations/tags.js.map +0 -1
  207. package/node_modules/@sudocode-ai/cli/dist/operations/transactions.d.ts +0 -41
  208. package/node_modules/@sudocode-ai/cli/dist/operations/transactions.d.ts.map +0 -1
  209. package/node_modules/@sudocode-ai/cli/dist/operations/transactions.js +0 -111
  210. package/node_modules/@sudocode-ai/cli/dist/operations/transactions.js.map +0 -1
  211. package/node_modules/@sudocode-ai/cli/dist/remote/claude-auth.d.ts +0 -65
  212. package/node_modules/@sudocode-ai/cli/dist/remote/claude-auth.d.ts.map +0 -1
  213. package/node_modules/@sudocode-ai/cli/dist/remote/claude-auth.js +0 -100
  214. package/node_modules/@sudocode-ai/cli/dist/remote/claude-auth.js.map +0 -1
  215. package/node_modules/@sudocode-ai/cli/dist/remote/config.d.ts +0 -83
  216. package/node_modules/@sudocode-ai/cli/dist/remote/config.d.ts.map +0 -1
  217. package/node_modules/@sudocode-ai/cli/dist/remote/config.js +0 -266
  218. package/node_modules/@sudocode-ai/cli/dist/remote/config.js.map +0 -1
  219. package/node_modules/@sudocode-ai/cli/dist/remote/errors.d.ts +0 -18
  220. package/node_modules/@sudocode-ai/cli/dist/remote/errors.d.ts.map +0 -1
  221. package/node_modules/@sudocode-ai/cli/dist/remote/errors.js +0 -27
  222. package/node_modules/@sudocode-ai/cli/dist/remote/errors.js.map +0 -1
  223. package/node_modules/@sudocode-ai/cli/dist/remote/git-context.d.ts +0 -51
  224. package/node_modules/@sudocode-ai/cli/dist/remote/git-context.d.ts.map +0 -1
  225. package/node_modules/@sudocode-ai/cli/dist/remote/git-context.js +0 -107
  226. package/node_modules/@sudocode-ai/cli/dist/remote/git-context.js.map +0 -1
  227. package/node_modules/@sudocode-ai/cli/dist/remote/spawn-service.d.ts +0 -86
  228. package/node_modules/@sudocode-ai/cli/dist/remote/spawn-service.d.ts.map +0 -1
  229. package/node_modules/@sudocode-ai/cli/dist/remote/spawn-service.js +0 -248
  230. package/node_modules/@sudocode-ai/cli/dist/remote/spawn-service.js.map +0 -1
  231. package/node_modules/@sudocode-ai/cli/dist/remote/types.d.ts +0 -82
  232. package/node_modules/@sudocode-ai/cli/dist/remote/types.d.ts.map +0 -1
  233. package/node_modules/@sudocode-ai/cli/dist/remote/types.js +0 -5
  234. package/node_modules/@sudocode-ai/cli/dist/remote/types.js.map +0 -1
  235. package/node_modules/@sudocode-ai/cli/dist/sync.d.ts +0 -47
  236. package/node_modules/@sudocode-ai/cli/dist/sync.d.ts.map +0 -1
  237. package/node_modules/@sudocode-ai/cli/dist/sync.js +0 -464
  238. package/node_modules/@sudocode-ai/cli/dist/sync.js.map +0 -1
  239. package/node_modules/@sudocode-ai/cli/dist/test-schema.d.ts +0 -5
  240. package/node_modules/@sudocode-ai/cli/dist/test-schema.d.ts.map +0 -1
  241. package/node_modules/@sudocode-ai/cli/dist/test-schema.js +0 -46
  242. package/node_modules/@sudocode-ai/cli/dist/test-schema.js.map +0 -1
  243. package/node_modules/@sudocode-ai/cli/dist/types.d.ts +0 -7
  244. package/node_modules/@sudocode-ai/cli/dist/types.d.ts.map +0 -1
  245. package/node_modules/@sudocode-ai/cli/dist/types.js +0 -7
  246. package/node_modules/@sudocode-ai/cli/dist/types.js.map +0 -1
  247. package/node_modules/@sudocode-ai/cli/dist/update-checker.d.ts +0 -33
  248. package/node_modules/@sudocode-ai/cli/dist/update-checker.d.ts.map +0 -1
  249. package/node_modules/@sudocode-ai/cli/dist/update-checker.js +0 -193
  250. package/node_modules/@sudocode-ai/cli/dist/update-checker.js.map +0 -1
  251. package/node_modules/@sudocode-ai/cli/dist/validation.d.ts +0 -11
  252. package/node_modules/@sudocode-ai/cli/dist/validation.d.ts.map +0 -1
  253. package/node_modules/@sudocode-ai/cli/dist/validation.js +0 -58
  254. package/node_modules/@sudocode-ai/cli/dist/validation.js.map +0 -1
  255. package/node_modules/@sudocode-ai/cli/dist/version.d.ts +0 -12
  256. package/node_modules/@sudocode-ai/cli/dist/version.d.ts.map +0 -1
  257. package/node_modules/@sudocode-ai/cli/dist/version.js +0 -23
  258. package/node_modules/@sudocode-ai/cli/dist/version.js.map +0 -1
  259. package/node_modules/@sudocode-ai/cli/dist/watcher.d.ts +0 -75
  260. package/node_modules/@sudocode-ai/cli/dist/watcher.d.ts.map +0 -1
  261. package/node_modules/@sudocode-ai/cli/dist/watcher.js +0 -797
  262. package/node_modules/@sudocode-ai/cli/dist/watcher.js.map +0 -1
  263. package/node_modules/@sudocode-ai/cli/dist/yaml-conflict-resolver.d.ts +0 -91
  264. package/node_modules/@sudocode-ai/cli/dist/yaml-conflict-resolver.d.ts.map +0 -1
  265. package/node_modules/@sudocode-ai/cli/dist/yaml-conflict-resolver.js +0 -197
  266. package/node_modules/@sudocode-ai/cli/dist/yaml-conflict-resolver.js.map +0 -1
  267. package/node_modules/@sudocode-ai/cli/dist/yaml-converter.d.ts +0 -68
  268. package/node_modules/@sudocode-ai/cli/dist/yaml-converter.d.ts.map +0 -1
  269. package/node_modules/@sudocode-ai/cli/dist/yaml-converter.js +0 -109
  270. package/node_modules/@sudocode-ai/cli/dist/yaml-converter.js.map +0 -1
  271. package/node_modules/@sudocode-ai/cli/package.json +0 -76
  272. package/node_modules/@sudocode-ai/integration-beads/package.json +0 -44
  273. package/node_modules/@sudocode-ai/integration-github/package.json +0 -41
  274. package/node_modules/@sudocode-ai/integration-openspec/package.json +0 -43
  275. package/node_modules/@sudocode-ai/integration-speckit/package.json +0 -42
  276. package/node_modules/@sudocode-ai/local-server/README.md +0 -25
  277. package/node_modules/@sudocode-ai/local-server/dist/cli.d.ts +0 -7
  278. package/node_modules/@sudocode-ai/local-server/dist/cli.d.ts.map +0 -1
  279. package/node_modules/@sudocode-ai/local-server/dist/cli.js +0 -7
  280. package/node_modules/@sudocode-ai/local-server/dist/cli.js.map +0 -1
  281. package/node_modules/@sudocode-ai/local-server/dist/errors/agent-errors.d.ts +0 -43
  282. package/node_modules/@sudocode-ai/local-server/dist/errors/agent-errors.d.ts.map +0 -1
  283. package/node_modules/@sudocode-ai/local-server/dist/errors/agent-errors.js +0 -69
  284. package/node_modules/@sudocode-ai/local-server/dist/errors/agent-errors.js.map +0 -1
  285. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/claude-adapter.d.ts +0 -63
  286. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/claude-adapter.d.ts.map +0 -1
  287. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/claude-adapter.js +0 -83
  288. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/claude-adapter.js.map +0 -1
  289. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/codex-adapter.d.ts +0 -67
  290. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/codex-adapter.d.ts.map +0 -1
  291. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/codex-adapter.js +0 -183
  292. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/codex-adapter.js.map +0 -1
  293. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/codex-config-builder.d.ts +0 -30
  294. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/codex-config-builder.d.ts.map +0 -1
  295. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/codex-config-builder.js +0 -110
  296. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/codex-config-builder.js.map +0 -1
  297. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/copilot-adapter.d.ts +0 -94
  298. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/copilot-adapter.d.ts.map +0 -1
  299. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/copilot-adapter.js +0 -163
  300. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/copilot-adapter.js.map +0 -1
  301. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/copilot-config-builder.d.ts +0 -48
  302. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/copilot-config-builder.d.ts.map +0 -1
  303. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/copilot-config-builder.js +0 -125
  304. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/copilot-config-builder.js.map +0 -1
  305. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/cursor-adapter.d.ts +0 -66
  306. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/cursor-adapter.d.ts.map +0 -1
  307. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/cursor-adapter.js +0 -121
  308. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/cursor-adapter.js.map +0 -1
  309. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/cursor-config-builder.d.ts +0 -29
  310. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/cursor-config-builder.d.ts.map +0 -1
  311. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/cursor-config-builder.js +0 -49
  312. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/cursor-config-builder.js.map +0 -1
  313. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/config-presets.d.ts +0 -102
  314. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/config-presets.d.ts.map +0 -1
  315. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/config-presets.js +0 -205
  316. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/config-presets.js.map +0 -1
  317. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/config-utils.d.ts +0 -95
  318. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/config-utils.d.ts.map +0 -1
  319. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/config-utils.js +0 -163
  320. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/config-utils.js.map +0 -1
  321. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/index.d.ts +0 -8
  322. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/index.d.ts.map +0 -1
  323. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/index.js +0 -8
  324. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/index.js.map +0 -1
  325. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/acp-executor-wrapper.d.ts +0 -331
  326. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/acp-executor-wrapper.d.ts.map +0 -1
  327. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/acp-executor-wrapper.js +0 -1126
  328. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/acp-executor-wrapper.js.map +0 -1
  329. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/agent-config-handlers.d.ts +0 -158
  330. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/agent-config-handlers.d.ts.map +0 -1
  331. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/agent-config-handlers.js +0 -352
  332. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/agent-config-handlers.js.map +0 -1
  333. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/executor-factory.d.ts +0 -170
  334. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/executor-factory.d.ts.map +0 -1
  335. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/executor-factory.js +0 -216
  336. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/executor-factory.js.map +0 -1
  337. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/legacy-shim-executor-wrapper.d.ts +0 -216
  338. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/legacy-shim-executor-wrapper.d.ts.map +0 -1
  339. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/legacy-shim-executor-wrapper.js +0 -679
  340. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/legacy-shim-executor-wrapper.js.map +0 -1
  341. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/permission-manager.d.ts +0 -118
  342. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/permission-manager.d.ts.map +0 -1
  343. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/permission-manager.js +0 -143
  344. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/permission-manager.js.map +0 -1
  345. package/node_modules/@sudocode-ai/local-server/dist/execution/handlers/file-handler.d.ts +0 -60
  346. package/node_modules/@sudocode-ai/local-server/dist/execution/handlers/file-handler.d.ts.map +0 -1
  347. package/node_modules/@sudocode-ai/local-server/dist/execution/handlers/file-handler.js +0 -115
  348. package/node_modules/@sudocode-ai/local-server/dist/execution/handlers/file-handler.js.map +0 -1
  349. package/node_modules/@sudocode-ai/local-server/dist/execution/output/coalesced-types.d.ts +0 -131
  350. package/node_modules/@sudocode-ai/local-server/dist/execution/output/coalesced-types.d.ts.map +0 -1
  351. package/node_modules/@sudocode-ai/local-server/dist/execution/output/coalesced-types.js +0 -47
  352. package/node_modules/@sudocode-ai/local-server/dist/execution/output/coalesced-types.js.map +0 -1
  353. package/node_modules/@sudocode-ai/local-server/dist/execution/output/index.d.ts +0 -16
  354. package/node_modules/@sudocode-ai/local-server/dist/execution/output/index.d.ts.map +0 -1
  355. package/node_modules/@sudocode-ai/local-server/dist/execution/output/index.js +0 -15
  356. package/node_modules/@sudocode-ai/local-server/dist/execution/output/index.js.map +0 -1
  357. package/node_modules/@sudocode-ai/local-server/dist/execution/output/normalized-to-coalesced.d.ts +0 -40
  358. package/node_modules/@sudocode-ai/local-server/dist/execution/output/normalized-to-coalesced.d.ts.map +0 -1
  359. package/node_modules/@sudocode-ai/local-server/dist/execution/output/normalized-to-coalesced.js +0 -165
  360. package/node_modules/@sudocode-ai/local-server/dist/execution/output/normalized-to-coalesced.js.map +0 -1
  361. package/node_modules/@sudocode-ai/local-server/dist/execution/output/session-update-coalescer.d.ts +0 -99
  362. package/node_modules/@sudocode-ai/local-server/dist/execution/output/session-update-coalescer.d.ts.map +0 -1
  363. package/node_modules/@sudocode-ai/local-server/dist/execution/output/session-update-coalescer.js +0 -329
  364. package/node_modules/@sudocode-ai/local-server/dist/execution/output/session-update-coalescer.js.map +0 -1
  365. package/node_modules/@sudocode-ai/local-server/dist/execution/output/types.d.ts +0 -421
  366. package/node_modules/@sudocode-ai/local-server/dist/execution/output/types.d.ts.map +0 -1
  367. package/node_modules/@sudocode-ai/local-server/dist/execution/output/types.js +0 -22
  368. package/node_modules/@sudocode-ai/local-server/dist/execution/output/types.js.map +0 -1
  369. package/node_modules/@sudocode-ai/local-server/dist/execution/process/builders/claude.d.ts +0 -53
  370. package/node_modules/@sudocode-ai/local-server/dist/execution/process/builders/claude.d.ts.map +0 -1
  371. package/node_modules/@sudocode-ai/local-server/dist/execution/process/builders/claude.js +0 -225
  372. package/node_modules/@sudocode-ai/local-server/dist/execution/process/builders/claude.js.map +0 -1
  373. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/config.d.ts +0 -74
  374. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/config.d.ts.map +0 -1
  375. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/config.js +0 -280
  376. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/config.js.map +0 -1
  377. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/conflict-detector.d.ts +0 -85
  378. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/conflict-detector.d.ts.map +0 -1
  379. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/conflict-detector.js +0 -129
  380. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/conflict-detector.js.map +0 -1
  381. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-cli.d.ts +0 -208
  382. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-cli.d.ts.map +0 -1
  383. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-cli.js +0 -280
  384. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-cli.js.map +0 -1
  385. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-sync-cli.d.ts +0 -225
  386. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-sync-cli.d.ts.map +0 -1
  387. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-sync-cli.js +0 -464
  388. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-sync-cli.js.map +0 -1
  389. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/index.d.ts +0 -16
  390. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/index.d.ts.map +0 -1
  391. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/index.js +0 -15
  392. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/index.js.map +0 -1
  393. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/manager.d.ts +0 -221
  394. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/manager.d.ts.map +0 -1
  395. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/manager.js +0 -508
  396. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/manager.js.map +0 -1
  397. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/types.d.ts +0 -90
  398. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/types.d.ts.map +0 -1
  399. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/types.js +0 -42
  400. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/types.js.map +0 -1
  401. package/node_modules/@sudocode-ai/local-server/dist/index.d.ts +0 -3
  402. package/node_modules/@sudocode-ai/local-server/dist/index.d.ts.map +0 -1
  403. package/node_modules/@sudocode-ai/local-server/dist/index.js +0 -413
  404. package/node_modules/@sudocode-ai/local-server/dist/index.js.map +0 -1
  405. package/node_modules/@sudocode-ai/local-server/dist/middleware/project-context.d.ts +0 -37
  406. package/node_modules/@sudocode-ai/local-server/dist/middleware/project-context.d.ts.map +0 -1
  407. package/node_modules/@sudocode-ai/local-server/dist/middleware/project-context.js +0 -91
  408. package/node_modules/@sudocode-ai/local-server/dist/middleware/project-context.js.map +0 -1
  409. package/node_modules/@sudocode-ai/local-server/dist/public/assets/index-6xIC1sAG.js +0 -3837
  410. package/node_modules/@sudocode-ai/local-server/dist/public/assets/index-6xIC1sAG.js.map +0 -1
  411. package/node_modules/@sudocode-ai/local-server/dist/public/assets/index-QH6t9Xqh.css +0 -1
  412. package/node_modules/@sudocode-ai/local-server/dist/public/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm +0 -0
  413. package/node_modules/@sudocode-ai/local-server/dist/public/assets/react-vendor-DoNwlLhy.js +0 -60
  414. package/node_modules/@sudocode-ai/local-server/dist/public/assets/react-vendor-DoNwlLhy.js.map +0 -1
  415. package/node_modules/@sudocode-ai/local-server/dist/public/assets/ui-vendor-DlxvBun1.js +0 -54
  416. package/node_modules/@sudocode-ai/local-server/dist/public/assets/ui-vendor-DlxvBun1.js.map +0 -1
  417. package/node_modules/@sudocode-ai/local-server/dist/public/favicon.ico +0 -0
  418. package/node_modules/@sudocode-ai/local-server/dist/public/index.html +0 -16
  419. package/node_modules/@sudocode-ai/local-server/dist/public/kokoro-test.html +0 -197
  420. package/node_modules/@sudocode-ai/local-server/dist/public/logo.png +0 -0
  421. package/node_modules/@sudocode-ai/local-server/dist/routes/agents.d.ts +0 -3
  422. package/node_modules/@sudocode-ai/local-server/dist/routes/agents.d.ts.map +0 -1
  423. package/node_modules/@sudocode-ai/local-server/dist/routes/agents.js +0 -188
  424. package/node_modules/@sudocode-ai/local-server/dist/routes/agents.js.map +0 -1
  425. package/node_modules/@sudocode-ai/local-server/dist/routes/config.d.ts +0 -3
  426. package/node_modules/@sudocode-ai/local-server/dist/routes/config.d.ts.map +0 -1
  427. package/node_modules/@sudocode-ai/local-server/dist/routes/config.js +0 -155
  428. package/node_modules/@sudocode-ai/local-server/dist/routes/config.js.map +0 -1
  429. package/node_modules/@sudocode-ai/local-server/dist/routes/editors.d.ts +0 -15
  430. package/node_modules/@sudocode-ai/local-server/dist/routes/editors.d.ts.map +0 -1
  431. package/node_modules/@sudocode-ai/local-server/dist/routes/editors.js +0 -98
  432. package/node_modules/@sudocode-ai/local-server/dist/routes/editors.js.map +0 -1
  433. package/node_modules/@sudocode-ai/local-server/dist/routes/executions.d.ts +0 -18
  434. package/node_modules/@sudocode-ai/local-server/dist/routes/executions.d.ts.map +0 -1
  435. package/node_modules/@sudocode-ai/local-server/dist/routes/executions.js +0 -1570
  436. package/node_modules/@sudocode-ai/local-server/dist/routes/executions.js.map +0 -1
  437. package/node_modules/@sudocode-ai/local-server/dist/routes/feedback.d.ts +0 -8
  438. package/node_modules/@sudocode-ai/local-server/dist/routes/feedback.d.ts.map +0 -1
  439. package/node_modules/@sudocode-ai/local-server/dist/routes/feedback.js +0 -340
  440. package/node_modules/@sudocode-ai/local-server/dist/routes/feedback.js.map +0 -1
  441. package/node_modules/@sudocode-ai/local-server/dist/routes/files.d.ts +0 -18
  442. package/node_modules/@sudocode-ai/local-server/dist/routes/files.d.ts.map +0 -1
  443. package/node_modules/@sudocode-ai/local-server/dist/routes/files.js +0 -89
  444. package/node_modules/@sudocode-ai/local-server/dist/routes/files.js.map +0 -1
  445. package/node_modules/@sudocode-ai/local-server/dist/routes/import.d.ts +0 -142
  446. package/node_modules/@sudocode-ai/local-server/dist/routes/import.d.ts.map +0 -1
  447. package/node_modules/@sudocode-ai/local-server/dist/routes/import.js +0 -896
  448. package/node_modules/@sudocode-ai/local-server/dist/routes/import.js.map +0 -1
  449. package/node_modules/@sudocode-ai/local-server/dist/routes/issues.d.ts +0 -8
  450. package/node_modules/@sudocode-ai/local-server/dist/routes/issues.d.ts.map +0 -1
  451. package/node_modules/@sudocode-ai/local-server/dist/routes/issues.js +0 -419
  452. package/node_modules/@sudocode-ai/local-server/dist/routes/issues.js.map +0 -1
  453. package/node_modules/@sudocode-ai/local-server/dist/routes/plugins.d.ts +0 -34
  454. package/node_modules/@sudocode-ai/local-server/dist/routes/plugins.d.ts.map +0 -1
  455. package/node_modules/@sudocode-ai/local-server/dist/routes/plugins.js +0 -602
  456. package/node_modules/@sudocode-ai/local-server/dist/routes/plugins.js.map +0 -1
  457. package/node_modules/@sudocode-ai/local-server/dist/routes/projects.d.ts +0 -11
  458. package/node_modules/@sudocode-ai/local-server/dist/routes/projects.d.ts.map +0 -1
  459. package/node_modules/@sudocode-ai/local-server/dist/routes/projects.js +0 -536
  460. package/node_modules/@sudocode-ai/local-server/dist/routes/projects.js.map +0 -1
  461. package/node_modules/@sudocode-ai/local-server/dist/routes/relationships.d.ts +0 -8
  462. package/node_modules/@sudocode-ai/local-server/dist/routes/relationships.d.ts.map +0 -1
  463. package/node_modules/@sudocode-ai/local-server/dist/routes/relationships.js +0 -310
  464. package/node_modules/@sudocode-ai/local-server/dist/routes/relationships.js.map +0 -1
  465. package/node_modules/@sudocode-ai/local-server/dist/routes/repo-info.d.ts +0 -3
  466. package/node_modules/@sudocode-ai/local-server/dist/routes/repo-info.d.ts.map +0 -1
  467. package/node_modules/@sudocode-ai/local-server/dist/routes/repo-info.js +0 -203
  468. package/node_modules/@sudocode-ai/local-server/dist/routes/repo-info.js.map +0 -1
  469. package/node_modules/@sudocode-ai/local-server/dist/routes/specs.d.ts +0 -8
  470. package/node_modules/@sudocode-ai/local-server/dist/routes/specs.d.ts.map +0 -1
  471. package/node_modules/@sudocode-ai/local-server/dist/routes/specs.js +0 -414
  472. package/node_modules/@sudocode-ai/local-server/dist/routes/specs.js.map +0 -1
  473. package/node_modules/@sudocode-ai/local-server/dist/routes/update.d.ts +0 -7
  474. package/node_modules/@sudocode-ai/local-server/dist/routes/update.d.ts.map +0 -1
  475. package/node_modules/@sudocode-ai/local-server/dist/routes/update.js +0 -194
  476. package/node_modules/@sudocode-ai/local-server/dist/routes/update.js.map +0 -1
  477. package/node_modules/@sudocode-ai/local-server/dist/routes/version.d.ts +0 -3
  478. package/node_modules/@sudocode-ai/local-server/dist/routes/version.d.ts.map +0 -1
  479. package/node_modules/@sudocode-ai/local-server/dist/routes/version.js +0 -25
  480. package/node_modules/@sudocode-ai/local-server/dist/routes/version.js.map +0 -1
  481. package/node_modules/@sudocode-ai/local-server/dist/routes/voice.d.ts +0 -12
  482. package/node_modules/@sudocode-ai/local-server/dist/routes/voice.d.ts.map +0 -1
  483. package/node_modules/@sudocode-ai/local-server/dist/routes/voice.js +0 -387
  484. package/node_modules/@sudocode-ai/local-server/dist/routes/voice.js.map +0 -1
  485. package/node_modules/@sudocode-ai/local-server/dist/routes/workflows.d.ts +0 -8
  486. package/node_modules/@sudocode-ai/local-server/dist/routes/workflows.d.ts.map +0 -1
  487. package/node_modules/@sudocode-ai/local-server/dist/routes/workflows.js +0 -1730
  488. package/node_modules/@sudocode-ai/local-server/dist/routes/workflows.js.map +0 -1
  489. package/node_modules/@sudocode-ai/local-server/dist/services/agent-registry.d.ts +0 -150
  490. package/node_modules/@sudocode-ai/local-server/dist/services/agent-registry.d.ts.map +0 -1
  491. package/node_modules/@sudocode-ai/local-server/dist/services/agent-registry.js +0 -312
  492. package/node_modules/@sudocode-ai/local-server/dist/services/agent-registry.js.map +0 -1
  493. package/node_modules/@sudocode-ai/local-server/dist/services/command-discovery-service.d.ts +0 -43
  494. package/node_modules/@sudocode-ai/local-server/dist/services/command-discovery-service.d.ts.map +0 -1
  495. package/node_modules/@sudocode-ai/local-server/dist/services/command-discovery-service.js +0 -114
  496. package/node_modules/@sudocode-ai/local-server/dist/services/command-discovery-service.js.map +0 -1
  497. package/node_modules/@sudocode-ai/local-server/dist/services/db.d.ts +0 -33
  498. package/node_modules/@sudocode-ai/local-server/dist/services/db.d.ts.map +0 -1
  499. package/node_modules/@sudocode-ai/local-server/dist/services/db.js +0 -90
  500. package/node_modules/@sudocode-ai/local-server/dist/services/db.js.map +0 -1
  501. package/node_modules/@sudocode-ai/local-server/dist/services/editor-service.d.ts +0 -57
  502. package/node_modules/@sudocode-ai/local-server/dist/services/editor-service.d.ts.map +0 -1
  503. package/node_modules/@sudocode-ai/local-server/dist/services/editor-service.js +0 -204
  504. package/node_modules/@sudocode-ai/local-server/dist/services/editor-service.js.map +0 -1
  505. package/node_modules/@sudocode-ai/local-server/dist/services/execution-changes-service.d.ts +0 -110
  506. package/node_modules/@sudocode-ai/local-server/dist/services/execution-changes-service.d.ts.map +0 -1
  507. package/node_modules/@sudocode-ai/local-server/dist/services/execution-changes-service.js +0 -710
  508. package/node_modules/@sudocode-ai/local-server/dist/services/execution-changes-service.js.map +0 -1
  509. package/node_modules/@sudocode-ai/local-server/dist/services/execution-event-callbacks.d.ts +0 -73
  510. package/node_modules/@sudocode-ai/local-server/dist/services/execution-event-callbacks.d.ts.map +0 -1
  511. package/node_modules/@sudocode-ai/local-server/dist/services/execution-event-callbacks.js +0 -82
  512. package/node_modules/@sudocode-ai/local-server/dist/services/execution-event-callbacks.js.map +0 -1
  513. package/node_modules/@sudocode-ai/local-server/dist/services/execution-lifecycle.d.ts +0 -145
  514. package/node_modules/@sudocode-ai/local-server/dist/services/execution-lifecycle.d.ts.map +0 -1
  515. package/node_modules/@sudocode-ai/local-server/dist/services/execution-lifecycle.js +0 -392
  516. package/node_modules/@sudocode-ai/local-server/dist/services/execution-lifecycle.js.map +0 -1
  517. package/node_modules/@sudocode-ai/local-server/dist/services/execution-logs-cleanup.d.ts +0 -88
  518. package/node_modules/@sudocode-ai/local-server/dist/services/execution-logs-cleanup.d.ts.map +0 -1
  519. package/node_modules/@sudocode-ai/local-server/dist/services/execution-logs-cleanup.js +0 -137
  520. package/node_modules/@sudocode-ai/local-server/dist/services/execution-logs-cleanup.js.map +0 -1
  521. package/node_modules/@sudocode-ai/local-server/dist/services/execution-logs-store.d.ts +0 -312
  522. package/node_modules/@sudocode-ai/local-server/dist/services/execution-logs-store.d.ts.map +0 -1
  523. package/node_modules/@sudocode-ai/local-server/dist/services/execution-logs-store.js +0 -518
  524. package/node_modules/@sudocode-ai/local-server/dist/services/execution-logs-store.js.map +0 -1
  525. package/node_modules/@sudocode-ai/local-server/dist/services/execution-service.d.ts +0 -409
  526. package/node_modules/@sudocode-ai/local-server/dist/services/execution-service.d.ts.map +0 -1
  527. package/node_modules/@sudocode-ai/local-server/dist/services/execution-service.js +0 -1694
  528. package/node_modules/@sudocode-ai/local-server/dist/services/execution-service.js.map +0 -1
  529. package/node_modules/@sudocode-ai/local-server/dist/services/execution-worker-pool.d.ts +0 -116
  530. package/node_modules/@sudocode-ai/local-server/dist/services/execution-worker-pool.d.ts.map +0 -1
  531. package/node_modules/@sudocode-ai/local-server/dist/services/execution-worker-pool.js +0 -326
  532. package/node_modules/@sudocode-ai/local-server/dist/services/execution-worker-pool.js.map +0 -1
  533. package/node_modules/@sudocode-ai/local-server/dist/services/executions.d.ts +0 -63
  534. package/node_modules/@sudocode-ai/local-server/dist/services/executions.d.ts.map +0 -1
  535. package/node_modules/@sudocode-ai/local-server/dist/services/executions.js +0 -177
  536. package/node_modules/@sudocode-ai/local-server/dist/services/executions.js.map +0 -1
  537. package/node_modules/@sudocode-ai/local-server/dist/services/export.d.ts +0 -32
  538. package/node_modules/@sudocode-ai/local-server/dist/services/export.d.ts.map +0 -1
  539. package/node_modules/@sudocode-ai/local-server/dist/services/export.js +0 -114
  540. package/node_modules/@sudocode-ai/local-server/dist/services/export.js.map +0 -1
  541. package/node_modules/@sudocode-ai/local-server/dist/services/external-refresh-service.d.ts +0 -104
  542. package/node_modules/@sudocode-ai/local-server/dist/services/external-refresh-service.d.ts.map +0 -1
  543. package/node_modules/@sudocode-ai/local-server/dist/services/external-refresh-service.js +0 -520
  544. package/node_modules/@sudocode-ai/local-server/dist/services/external-refresh-service.js.map +0 -1
  545. package/node_modules/@sudocode-ai/local-server/dist/services/feedback.d.ts +0 -56
  546. package/node_modules/@sudocode-ai/local-server/dist/services/feedback.d.ts.map +0 -1
  547. package/node_modules/@sudocode-ai/local-server/dist/services/feedback.js +0 -78
  548. package/node_modules/@sudocode-ai/local-server/dist/services/feedback.js.map +0 -1
  549. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/git-ls-files-strategy.d.ts +0 -72
  550. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/git-ls-files-strategy.d.ts.map +0 -1
  551. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/git-ls-files-strategy.js +0 -176
  552. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/git-ls-files-strategy.js.map +0 -1
  553. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/index.d.ts +0 -9
  554. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/index.d.ts.map +0 -1
  555. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/index.js +0 -10
  556. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/index.js.map +0 -1
  557. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/registry.d.ts +0 -97
  558. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/registry.d.ts.map +0 -1
  559. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/registry.js +0 -140
  560. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/registry.js.map +0 -1
  561. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/strategy.d.ts +0 -58
  562. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/strategy.d.ts.map +0 -1
  563. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/strategy.js +0 -8
  564. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/strategy.js.map +0 -1
  565. package/node_modules/@sudocode-ai/local-server/dist/services/integration-sync-service.d.ts +0 -185
  566. package/node_modules/@sudocode-ai/local-server/dist/services/integration-sync-service.d.ts.map +0 -1
  567. package/node_modules/@sudocode-ai/local-server/dist/services/integration-sync-service.js +0 -428
  568. package/node_modules/@sudocode-ai/local-server/dist/services/integration-sync-service.js.map +0 -1
  569. package/node_modules/@sudocode-ai/local-server/dist/services/issues.d.ts +0 -27
  570. package/node_modules/@sudocode-ai/local-server/dist/services/issues.d.ts.map +0 -1
  571. package/node_modules/@sudocode-ai/local-server/dist/services/issues.js +0 -35
  572. package/node_modules/@sudocode-ai/local-server/dist/services/issues.js.map +0 -1
  573. package/node_modules/@sudocode-ai/local-server/dist/services/narration-service.d.ts +0 -312
  574. package/node_modules/@sudocode-ai/local-server/dist/services/narration-service.d.ts.map +0 -1
  575. package/node_modules/@sudocode-ai/local-server/dist/services/narration-service.js +0 -749
  576. package/node_modules/@sudocode-ai/local-server/dist/services/narration-service.js.map +0 -1
  577. package/node_modules/@sudocode-ai/local-server/dist/services/project-context.d.ts +0 -93
  578. package/node_modules/@sudocode-ai/local-server/dist/services/project-context.d.ts.map +0 -1
  579. package/node_modules/@sudocode-ai/local-server/dist/services/project-context.js +0 -166
  580. package/node_modules/@sudocode-ai/local-server/dist/services/project-context.js.map +0 -1
  581. package/node_modules/@sudocode-ai/local-server/dist/services/project-manager.d.ts +0 -102
  582. package/node_modules/@sudocode-ai/local-server/dist/services/project-manager.d.ts.map +0 -1
  583. package/node_modules/@sudocode-ai/local-server/dist/services/project-manager.js +0 -500
  584. package/node_modules/@sudocode-ai/local-server/dist/services/project-manager.js.map +0 -1
  585. package/node_modules/@sudocode-ai/local-server/dist/services/project-registry.d.ts +0 -98
  586. package/node_modules/@sudocode-ai/local-server/dist/services/project-registry.d.ts.map +0 -1
  587. package/node_modules/@sudocode-ai/local-server/dist/services/project-registry.js +0 -289
  588. package/node_modules/@sudocode-ai/local-server/dist/services/project-registry.js.map +0 -1
  589. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-resolver.d.ts +0 -97
  590. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-resolver.d.ts.map +0 -1
  591. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-resolver.js +0 -377
  592. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-resolver.js.map +0 -1
  593. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-template-engine.d.ts +0 -108
  594. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-template-engine.d.ts.map +0 -1
  595. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-template-engine.js +0 -212
  596. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-template-engine.js.map +0 -1
  597. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-templates.d.ts +0 -97
  598. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-templates.d.ts.map +0 -1
  599. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-templates.js +0 -236
  600. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-templates.js.map +0 -1
  601. package/node_modules/@sudocode-ai/local-server/dist/services/relationships.d.ts +0 -35
  602. package/node_modules/@sudocode-ai/local-server/dist/services/relationships.d.ts.map +0 -1
  603. package/node_modules/@sudocode-ai/local-server/dist/services/relationships.js +0 -42
  604. package/node_modules/@sudocode-ai/local-server/dist/services/relationships.js.map +0 -1
  605. package/node_modules/@sudocode-ai/local-server/dist/services/repo-info.d.ts +0 -33
  606. package/node_modules/@sudocode-ai/local-server/dist/services/repo-info.d.ts.map +0 -1
  607. package/node_modules/@sudocode-ai/local-server/dist/services/repo-info.js +0 -136
  608. package/node_modules/@sudocode-ai/local-server/dist/services/repo-info.js.map +0 -1
  609. package/node_modules/@sudocode-ai/local-server/dist/services/specs.d.ts +0 -27
  610. package/node_modules/@sudocode-ai/local-server/dist/services/specs.d.ts.map +0 -1
  611. package/node_modules/@sudocode-ai/local-server/dist/services/specs.js +0 -35
  612. package/node_modules/@sudocode-ai/local-server/dist/services/specs.js.map +0 -1
  613. package/node_modules/@sudocode-ai/local-server/dist/services/stt-providers/index.d.ts +0 -21
  614. package/node_modules/@sudocode-ai/local-server/dist/services/stt-providers/index.d.ts.map +0 -1
  615. package/node_modules/@sudocode-ai/local-server/dist/services/stt-providers/index.js +0 -32
  616. package/node_modules/@sudocode-ai/local-server/dist/services/stt-providers/index.js.map +0 -1
  617. package/node_modules/@sudocode-ai/local-server/dist/services/stt-providers/openai-whisper.d.ts +0 -66
  618. package/node_modules/@sudocode-ai/local-server/dist/services/stt-providers/openai-whisper.d.ts.map +0 -1
  619. package/node_modules/@sudocode-ai/local-server/dist/services/stt-providers/openai-whisper.js +0 -137
  620. package/node_modules/@sudocode-ai/local-server/dist/services/stt-providers/openai-whisper.js.map +0 -1
  621. package/node_modules/@sudocode-ai/local-server/dist/services/stt-providers/whisper-local.d.ts +0 -64
  622. package/node_modules/@sudocode-ai/local-server/dist/services/stt-providers/whisper-local.d.ts.map +0 -1
  623. package/node_modules/@sudocode-ai/local-server/dist/services/stt-providers/whisper-local.js +0 -166
  624. package/node_modules/@sudocode-ai/local-server/dist/services/stt-providers/whisper-local.js.map +0 -1
  625. package/node_modules/@sudocode-ai/local-server/dist/services/stt-service.d.ts +0 -160
  626. package/node_modules/@sudocode-ai/local-server/dist/services/stt-service.d.ts.map +0 -1
  627. package/node_modules/@sudocode-ai/local-server/dist/services/stt-service.js +0 -246
  628. package/node_modules/@sudocode-ai/local-server/dist/services/stt-service.js.map +0 -1
  629. package/node_modules/@sudocode-ai/local-server/dist/services/tts-providers/browser-tts.d.ts +0 -64
  630. package/node_modules/@sudocode-ai/local-server/dist/services/tts-providers/browser-tts.d.ts.map +0 -1
  631. package/node_modules/@sudocode-ai/local-server/dist/services/tts-providers/browser-tts.js +0 -89
  632. package/node_modules/@sudocode-ai/local-server/dist/services/tts-providers/browser-tts.js.map +0 -1
  633. package/node_modules/@sudocode-ai/local-server/dist/services/tts-providers/index.d.ts +0 -20
  634. package/node_modules/@sudocode-ai/local-server/dist/services/tts-providers/index.d.ts.map +0 -1
  635. package/node_modules/@sudocode-ai/local-server/dist/services/tts-providers/index.js +0 -31
  636. package/node_modules/@sudocode-ai/local-server/dist/services/tts-providers/index.js.map +0 -1
  637. package/node_modules/@sudocode-ai/local-server/dist/services/tts-service.d.ts +0 -190
  638. package/node_modules/@sudocode-ai/local-server/dist/services/tts-service.d.ts.map +0 -1
  639. package/node_modules/@sudocode-ai/local-server/dist/services/tts-service.js +0 -296
  640. package/node_modules/@sudocode-ai/local-server/dist/services/tts-service.js.map +0 -1
  641. package/node_modules/@sudocode-ai/local-server/dist/services/tts-sidecar-manager.d.ts +0 -276
  642. package/node_modules/@sudocode-ai/local-server/dist/services/tts-sidecar-manager.d.ts.map +0 -1
  643. package/node_modules/@sudocode-ai/local-server/dist/services/tts-sidecar-manager.js +0 -665
  644. package/node_modules/@sudocode-ai/local-server/dist/services/tts-sidecar-manager.js.map +0 -1
  645. package/node_modules/@sudocode-ai/local-server/dist/services/version-service.d.ts +0 -14
  646. package/node_modules/@sudocode-ai/local-server/dist/services/version-service.d.ts.map +0 -1
  647. package/node_modules/@sudocode-ai/local-server/dist/services/version-service.js +0 -57
  648. package/node_modules/@sudocode-ai/local-server/dist/services/version-service.js.map +0 -1
  649. package/node_modules/@sudocode-ai/local-server/dist/services/watcher.d.ts +0 -49
  650. package/node_modules/@sudocode-ai/local-server/dist/services/watcher.d.ts.map +0 -1
  651. package/node_modules/@sudocode-ai/local-server/dist/services/watcher.js +0 -52
  652. package/node_modules/@sudocode-ai/local-server/dist/services/watcher.js.map +0 -1
  653. package/node_modules/@sudocode-ai/local-server/dist/services/websocket.d.ts +0 -246
  654. package/node_modules/@sudocode-ai/local-server/dist/services/websocket.d.ts.map +0 -1
  655. package/node_modules/@sudocode-ai/local-server/dist/services/websocket.js +0 -758
  656. package/node_modules/@sudocode-ai/local-server/dist/services/websocket.js.map +0 -1
  657. package/node_modules/@sudocode-ai/local-server/dist/services/workflow-broadcast-service.d.ts +0 -43
  658. package/node_modules/@sudocode-ai/local-server/dist/services/workflow-broadcast-service.d.ts.map +0 -1
  659. package/node_modules/@sudocode-ai/local-server/dist/services/workflow-broadcast-service.js +0 -155
  660. package/node_modules/@sudocode-ai/local-server/dist/services/workflow-broadcast-service.js.map +0 -1
  661. package/node_modules/@sudocode-ai/local-server/dist/services/worktree-sync-service.d.ts +0 -452
  662. package/node_modules/@sudocode-ai/local-server/dist/services/worktree-sync-service.d.ts.map +0 -1
  663. package/node_modules/@sudocode-ai/local-server/dist/services/worktree-sync-service.js +0 -1602
  664. package/node_modules/@sudocode-ai/local-server/dist/services/worktree-sync-service.js.map +0 -1
  665. package/node_modules/@sudocode-ai/local-server/dist/types/editor.d.ts +0 -49
  666. package/node_modules/@sudocode-ai/local-server/dist/types/editor.d.ts.map +0 -1
  667. package/node_modules/@sudocode-ai/local-server/dist/types/editor.js +0 -50
  668. package/node_modules/@sudocode-ai/local-server/dist/types/editor.js.map +0 -1
  669. package/node_modules/@sudocode-ai/local-server/dist/types/project.d.ts +0 -58
  670. package/node_modules/@sudocode-ai/local-server/dist/types/project.d.ts.map +0 -1
  671. package/node_modules/@sudocode-ai/local-server/dist/types/project.js +0 -10
  672. package/node_modules/@sudocode-ai/local-server/dist/types/project.js.map +0 -1
  673. package/node_modules/@sudocode-ai/local-server/dist/utils/execFileNoThrow.d.ts +0 -43
  674. package/node_modules/@sudocode-ai/local-server/dist/utils/execFileNoThrow.d.ts.map +0 -1
  675. package/node_modules/@sudocode-ai/local-server/dist/utils/execFileNoThrow.js +0 -53
  676. package/node_modules/@sudocode-ai/local-server/dist/utils/execFileNoThrow.js.map +0 -1
  677. package/node_modules/@sudocode-ai/local-server/dist/utils/executable-check.d.ts +0 -36
  678. package/node_modules/@sudocode-ai/local-server/dist/utils/executable-check.d.ts.map +0 -1
  679. package/node_modules/@sudocode-ai/local-server/dist/utils/executable-check.js +0 -79
  680. package/node_modules/@sudocode-ai/local-server/dist/utils/executable-check.js.map +0 -1
  681. package/node_modules/@sudocode-ai/local-server/dist/utils/sudocode-dir.d.ts +0 -6
  682. package/node_modules/@sudocode-ai/local-server/dist/utils/sudocode-dir.d.ts.map +0 -1
  683. package/node_modules/@sudocode-ai/local-server/dist/utils/sudocode-dir.js +0 -9
  684. package/node_modules/@sudocode-ai/local-server/dist/utils/sudocode-dir.js.map +0 -1
  685. package/node_modules/@sudocode-ai/local-server/dist/utils/voice-config.d.ts +0 -26
  686. package/node_modules/@sudocode-ai/local-server/dist/utils/voice-config.d.ts.map +0 -1
  687. package/node_modules/@sudocode-ai/local-server/dist/utils/voice-config.js +0 -48
  688. package/node_modules/@sudocode-ai/local-server/dist/utils/voice-config.js.map +0 -1
  689. package/node_modules/@sudocode-ai/local-server/dist/workers/execution-worker.d.ts +0 -18
  690. package/node_modules/@sudocode-ai/local-server/dist/workers/execution-worker.d.ts.map +0 -1
  691. package/node_modules/@sudocode-ai/local-server/dist/workers/execution-worker.js +0 -344
  692. package/node_modules/@sudocode-ai/local-server/dist/workers/execution-worker.js.map +0 -1
  693. package/node_modules/@sudocode-ai/local-server/dist/workers/worker-ipc.d.ts +0 -84
  694. package/node_modules/@sudocode-ai/local-server/dist/workers/worker-ipc.d.ts.map +0 -1
  695. package/node_modules/@sudocode-ai/local-server/dist/workers/worker-ipc.js +0 -29
  696. package/node_modules/@sudocode-ai/local-server/dist/workers/worker-ipc.js.map +0 -1
  697. package/node_modules/@sudocode-ai/local-server/dist/workflow/base-workflow-engine.d.ts +0 -188
  698. package/node_modules/@sudocode-ai/local-server/dist/workflow/base-workflow-engine.d.ts.map +0 -1
  699. package/node_modules/@sudocode-ai/local-server/dist/workflow/base-workflow-engine.js +0 -557
  700. package/node_modules/@sudocode-ai/local-server/dist/workflow/base-workflow-engine.js.map +0 -1
  701. package/node_modules/@sudocode-ai/local-server/dist/workflow/dependency-analyzer.d.ts +0 -78
  702. package/node_modules/@sudocode-ai/local-server/dist/workflow/dependency-analyzer.d.ts.map +0 -1
  703. package/node_modules/@sudocode-ai/local-server/dist/workflow/dependency-analyzer.js +0 -264
  704. package/node_modules/@sudocode-ai/local-server/dist/workflow/dependency-analyzer.js.map +0 -1
  705. package/node_modules/@sudocode-ai/local-server/dist/workflow/engines/orchestrator-engine.d.ts +0 -241
  706. package/node_modules/@sudocode-ai/local-server/dist/workflow/engines/orchestrator-engine.d.ts.map +0 -1
  707. package/node_modules/@sudocode-ai/local-server/dist/workflow/engines/orchestrator-engine.js +0 -752
  708. package/node_modules/@sudocode-ai/local-server/dist/workflow/engines/orchestrator-engine.js.map +0 -1
  709. package/node_modules/@sudocode-ai/local-server/dist/workflow/engines/sequential-engine.d.ts +0 -283
  710. package/node_modules/@sudocode-ai/local-server/dist/workflow/engines/sequential-engine.d.ts.map +0 -1
  711. package/node_modules/@sudocode-ai/local-server/dist/workflow/engines/sequential-engine.js +0 -1190
  712. package/node_modules/@sudocode-ai/local-server/dist/workflow/engines/sequential-engine.js.map +0 -1
  713. package/node_modules/@sudocode-ai/local-server/dist/workflow/index.d.ts +0 -15
  714. package/node_modules/@sudocode-ai/local-server/dist/workflow/index.d.ts.map +0 -1
  715. package/node_modules/@sudocode-ai/local-server/dist/workflow/index.js +0 -22
  716. package/node_modules/@sudocode-ai/local-server/dist/workflow/index.js.map +0 -1
  717. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/api-client.d.ts +0 -103
  718. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/api-client.d.ts.map +0 -1
  719. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/api-client.js +0 -193
  720. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/api-client.js.map +0 -1
  721. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/index.d.ts +0 -16
  722. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/index.d.ts.map +0 -1
  723. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/index.js +0 -114
  724. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/index.js.map +0 -1
  725. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/server.d.ts +0 -85
  726. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/server.d.ts.map +0 -1
  727. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/server.js +0 -520
  728. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/server.js.map +0 -1
  729. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/escalation.d.ts +0 -36
  730. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/escalation.d.ts.map +0 -1
  731. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/escalation.js +0 -47
  732. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/escalation.js.map +0 -1
  733. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/execution.d.ts +0 -59
  734. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/execution.d.ts.map +0 -1
  735. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/execution.js +0 -67
  736. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/execution.js.map +0 -1
  737. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/inspection.d.ts +0 -82
  738. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/inspection.d.ts.map +0 -1
  739. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/inspection.js +0 -57
  740. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/inspection.js.map +0 -1
  741. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/workflow.d.ts +0 -59
  742. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/workflow.d.ts.map +0 -1
  743. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/workflow.js +0 -40
  744. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/workflow.js.map +0 -1
  745. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/types.d.ts +0 -345
  746. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/types.d.ts.map +0 -1
  747. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/types.js +0 -7
  748. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/types.js.map +0 -1
  749. package/node_modules/@sudocode-ai/local-server/dist/workflow/services/prompt-builder.d.ts +0 -36
  750. package/node_modules/@sudocode-ai/local-server/dist/workflow/services/prompt-builder.d.ts.map +0 -1
  751. package/node_modules/@sudocode-ai/local-server/dist/workflow/services/prompt-builder.js +0 -329
  752. package/node_modules/@sudocode-ai/local-server/dist/workflow/services/prompt-builder.js.map +0 -1
  753. package/node_modules/@sudocode-ai/local-server/dist/workflow/services/wakeup-service.d.ts +0 -262
  754. package/node_modules/@sudocode-ai/local-server/dist/workflow/services/wakeup-service.d.ts.map +0 -1
  755. package/node_modules/@sudocode-ai/local-server/dist/workflow/services/wakeup-service.js +0 -809
  756. package/node_modules/@sudocode-ai/local-server/dist/workflow/services/wakeup-service.js.map +0 -1
  757. package/node_modules/@sudocode-ai/local-server/dist/workflow/workflow-engine.d.ts +0 -228
  758. package/node_modules/@sudocode-ai/local-server/dist/workflow/workflow-engine.d.ts.map +0 -1
  759. package/node_modules/@sudocode-ai/local-server/dist/workflow/workflow-engine.js +0 -94
  760. package/node_modules/@sudocode-ai/local-server/dist/workflow/workflow-engine.js.map +0 -1
  761. package/node_modules/@sudocode-ai/local-server/dist/workflow/workflow-event-emitter.d.ts +0 -278
  762. package/node_modules/@sudocode-ai/local-server/dist/workflow/workflow-event-emitter.d.ts.map +0 -1
  763. package/node_modules/@sudocode-ai/local-server/dist/workflow/workflow-event-emitter.js +0 -259
  764. package/node_modules/@sudocode-ai/local-server/dist/workflow/workflow-event-emitter.js.map +0 -1
  765. package/node_modules/@sudocode-ai/local-server/package.json +0 -83
  766. package/node_modules/@sudocode-ai/mcp/README.md +0 -226
  767. package/node_modules/@sudocode-ai/mcp/dist/api-client.d.ts +0 -296
  768. package/node_modules/@sudocode-ai/mcp/dist/api-client.d.ts.map +0 -1
  769. package/node_modules/@sudocode-ai/mcp/dist/api-client.js +0 -304
  770. package/node_modules/@sudocode-ai/mcp/dist/api-client.js.map +0 -1
  771. package/node_modules/@sudocode-ai/mcp/dist/client.d.ts +0 -33
  772. package/node_modules/@sudocode-ai/mcp/dist/client.d.ts.map +0 -1
  773. package/node_modules/@sudocode-ai/mcp/dist/client.js +0 -166
  774. package/node_modules/@sudocode-ai/mcp/dist/client.js.map +0 -1
  775. package/node_modules/@sudocode-ai/mcp/dist/index.d.ts +0 -6
  776. package/node_modules/@sudocode-ai/mcp/dist/index.d.ts.map +0 -1
  777. package/node_modules/@sudocode-ai/mcp/dist/index.js +0 -167
  778. package/node_modules/@sudocode-ai/mcp/dist/index.js.map +0 -1
  779. package/node_modules/@sudocode-ai/mcp/dist/scopes.d.ts +0 -126
  780. package/node_modules/@sudocode-ai/mcp/dist/scopes.d.ts.map +0 -1
  781. package/node_modules/@sudocode-ai/mcp/dist/scopes.js +0 -282
  782. package/node_modules/@sudocode-ai/mcp/dist/scopes.js.map +0 -1
  783. package/node_modules/@sudocode-ai/mcp/dist/server.d.ts +0 -37
  784. package/node_modules/@sudocode-ai/mcp/dist/server.d.ts.map +0 -1
  785. package/node_modules/@sudocode-ai/mcp/dist/server.js +0 -442
  786. package/node_modules/@sudocode-ai/mcp/dist/server.js.map +0 -1
  787. package/node_modules/@sudocode-ai/mcp/dist/tool-registry.d.ts +0 -49
  788. package/node_modules/@sudocode-ai/mcp/dist/tool-registry.d.ts.map +0 -1
  789. package/node_modules/@sudocode-ai/mcp/dist/tool-registry.js +0 -720
  790. package/node_modules/@sudocode-ai/mcp/dist/tool-registry.js.map +0 -1
  791. package/node_modules/@sudocode-ai/mcp/dist/tools/analytics.d.ts +0 -41
  792. package/node_modules/@sudocode-ai/mcp/dist/tools/analytics.d.ts.map +0 -1
  793. package/node_modules/@sudocode-ai/mcp/dist/tools/analytics.js +0 -21
  794. package/node_modules/@sudocode-ai/mcp/dist/tools/analytics.js.map +0 -1
  795. package/node_modules/@sudocode-ai/mcp/dist/tools/feedback.d.ts +0 -21
  796. package/node_modules/@sudocode-ai/mcp/dist/tools/feedback.d.ts.map +0 -1
  797. package/node_modules/@sudocode-ai/mcp/dist/tools/feedback.js +0 -30
  798. package/node_modules/@sudocode-ai/mcp/dist/tools/feedback.js.map +0 -1
  799. package/node_modules/@sudocode-ai/mcp/dist/tools/init.d.ts +0 -17
  800. package/node_modules/@sudocode-ai/mcp/dist/tools/init.d.ts.map +0 -1
  801. package/node_modules/@sudocode-ai/mcp/dist/tools/init.js +0 -15
  802. package/node_modules/@sudocode-ai/mcp/dist/tools/init.js.map +0 -1
  803. package/node_modules/@sudocode-ai/mcp/dist/tools/issues.d.ts +0 -44
  804. package/node_modules/@sudocode-ai/mcp/dist/tools/issues.d.ts.map +0 -1
  805. package/node_modules/@sudocode-ai/mcp/dist/tools/issues.js +0 -109
  806. package/node_modules/@sudocode-ai/mcp/dist/tools/issues.js.map +0 -1
  807. package/node_modules/@sudocode-ai/mcp/dist/tools/references.d.ts +0 -21
  808. package/node_modules/@sudocode-ai/mcp/dist/tools/references.d.ts.map +0 -1
  809. package/node_modules/@sudocode-ai/mcp/dist/tools/references.js +0 -49
  810. package/node_modules/@sudocode-ai/mcp/dist/tools/references.js.map +0 -1
  811. package/node_modules/@sudocode-ai/mcp/dist/tools/relationships.d.ts +0 -15
  812. package/node_modules/@sudocode-ai/mcp/dist/tools/relationships.d.ts.map +0 -1
  813. package/node_modules/@sudocode-ai/mcp/dist/tools/relationships.js +0 -18
  814. package/node_modules/@sudocode-ai/mcp/dist/tools/relationships.js.map +0 -1
  815. package/node_modules/@sudocode-ai/mcp/dist/tools/specs.d.ts +0 -35
  816. package/node_modules/@sudocode-ai/mcp/dist/tools/specs.d.ts.map +0 -1
  817. package/node_modules/@sudocode-ai/mcp/dist/tools/specs.js +0 -85
  818. package/node_modules/@sudocode-ai/mcp/dist/tools/specs.js.map +0 -1
  819. package/node_modules/@sudocode-ai/mcp/dist/types.d.ts +0 -46
  820. package/node_modules/@sudocode-ai/mcp/dist/types.d.ts.map +0 -1
  821. package/node_modules/@sudocode-ai/mcp/dist/types.js +0 -21
  822. package/node_modules/@sudocode-ai/mcp/dist/types.js.map +0 -1
  823. package/node_modules/@sudocode-ai/mcp/package.json +0 -67
  824. package/node_modules/@sudocode-ai/types/README.md +0 -7
  825. package/node_modules/@sudocode-ai/types/package.json +0 -81
  826. package/node_modules/@sudocode-ai/types/src/agents.d.ts +0 -348
  827. package/node_modules/@sudocode-ai/types/src/artifacts.d.ts +0 -66
  828. package/node_modules/@sudocode-ai/types/src/events.d.ts +0 -70
  829. package/node_modules/@sudocode-ai/types/src/index.d.ts +0 -587
  830. package/node_modules/@sudocode-ai/types/src/integrations.d.ts +0 -454
  831. package/node_modules/@sudocode-ai/types/src/voice.d.ts +0 -465
  832. package/node_modules/@sudocode-ai/types/src/workflows.d.ts +0 -501
  833. package/node_modules/commander/LICENSE +0 -22
  834. package/node_modules/commander/Readme.md +0 -1149
  835. package/node_modules/commander/esm.mjs +0 -16
  836. package/node_modules/commander/index.js +0 -24
  837. package/node_modules/commander/lib/argument.js +0 -149
  838. package/node_modules/commander/lib/command.js +0 -2662
  839. package/node_modules/commander/lib/error.js +0 -39
  840. package/node_modules/commander/lib/help.js +0 -709
  841. package/node_modules/commander/lib/option.js +0 -367
  842. package/node_modules/commander/lib/suggestSimilar.js +0 -101
  843. package/node_modules/commander/package-support.json +0 -16
  844. package/node_modules/commander/package.json +0 -82
  845. package/node_modules/commander/typings/esm.d.mts +0 -3
  846. package/node_modules/commander/typings/index.d.ts +0 -1045
  847. package/node_modules/glob/LICENSE +0 -15
  848. package/node_modules/glob/README.md +0 -1265
  849. package/node_modules/glob/package.json +0 -99
  850. package/node_modules/isexe/LICENSE +0 -15
  851. package/node_modules/isexe/README.md +0 -74
  852. package/node_modules/isexe/package.json +0 -96
  853. package/node_modules/which/LICENSE +0 -15
  854. package/node_modules/which/README.md +0 -51
  855. package/node_modules/which/bin/which.js +0 -52
  856. package/node_modules/which/lib/index.js +0 -111
  857. package/node_modules/which/package.json +0 -52
@@ -1,1602 +0,0 @@
1
- /**
2
- * Worktree Sync Service
3
- *
4
- * Orchestrates worktree sync operations including conflict detection,
5
- * JSONL resolution, git operations, and database updates.
6
- *
7
- * @module services/worktree-sync-service
8
- */
9
- import * as fs from "fs";
10
- import * as path from "path";
11
- import { execSync } from "child_process";
12
- import { GitSyncCli, } from "../execution/worktree/git-sync-cli.js";
13
- import { ConflictDetector, } from "../execution/worktree/conflict-detector.js";
14
- import { mergeThreeWay, hasGitConflictMarkers, parseMergeConflictFile, resolveEntities, } from "@sudocode-ai/cli/dist/merge-resolver.js";
15
- import { writeJSONL, readJSONLSync, } from "@sudocode-ai/cli/dist/jsonl.js";
16
- import * as os from "os";
17
- /**
18
- * Worktree sync error codes
19
- */
20
- export var WorktreeSyncErrorCode;
21
- (function (WorktreeSyncErrorCode) {
22
- WorktreeSyncErrorCode["NO_WORKTREE"] = "NO_WORKTREE";
23
- WorktreeSyncErrorCode["WORKTREE_MISSING"] = "WORKTREE_MISSING";
24
- WorktreeSyncErrorCode["BRANCH_MISSING"] = "BRANCH_MISSING";
25
- WorktreeSyncErrorCode["DIRTY_WORKING_TREE"] = "DIRTY_WORKING_TREE";
26
- WorktreeSyncErrorCode["TARGET_BRANCH_MISSING"] = "TARGET_BRANCH_MISSING";
27
- WorktreeSyncErrorCode["NO_COMMON_BASE"] = "NO_COMMON_BASE";
28
- WorktreeSyncErrorCode["CODE_CONFLICTS"] = "CODE_CONFLICTS";
29
- WorktreeSyncErrorCode["MERGE_FAILED"] = "MERGE_FAILED";
30
- WorktreeSyncErrorCode["JSONL_RESOLUTION_FAILED"] = "JSONL_RESOLUTION_FAILED";
31
- WorktreeSyncErrorCode["DATABASE_SYNC_FAILED"] = "DATABASE_SYNC_FAILED";
32
- WorktreeSyncErrorCode["EXECUTION_NOT_FOUND"] = "EXECUTION_NOT_FOUND";
33
- })(WorktreeSyncErrorCode || (WorktreeSyncErrorCode = {}));
34
- /**
35
- * Worktree sync error class
36
- */
37
- export class WorktreeSyncError extends Error {
38
- code;
39
- cause;
40
- constructor(message, code, cause) {
41
- super(message);
42
- this.code = code;
43
- this.cause = cause;
44
- this.name = "WorktreeSyncError";
45
- }
46
- }
47
- /**
48
- * WorktreeSyncService
49
- *
50
- * Main service class for orchestrating worktree sync operations
51
- */
52
- export class WorktreeSyncService {
53
- db;
54
- repoPath;
55
- gitSync;
56
- constructor(db, repoPath) {
57
- this.db = db;
58
- this.repoPath = repoPath;
59
- this.gitSync = new GitSyncCli(repoPath);
60
- }
61
- /**
62
- * Preview sync without making changes
63
- *
64
- * @param executionId - Execution ID to preview sync for
65
- * @returns Preview result with conflicts, diff, and warnings
66
- */
67
- async previewSync(executionId) {
68
- // 1. Load execution and validate
69
- const execution = await this._loadAndValidateExecution(executionId);
70
- // 2. Validate critical preconditions (ones that prevent us from getting any info)
71
- // These are "hard" failures - we can't get diff/commits if these fail
72
- const criticalPreconditionError = await this._validateCriticalPreconditions(execution);
73
- if (criticalPreconditionError) {
74
- return {
75
- canSync: false,
76
- conflicts: {
77
- hasConflicts: false,
78
- codeConflicts: [],
79
- jsonlConflicts: [],
80
- totalFiles: 0,
81
- summary: "",
82
- },
83
- diff: { files: [], additions: 0, deletions: 0 },
84
- commits: [],
85
- mergeBase: "",
86
- uncommittedJSONLChanges: [],
87
- uncommittedChanges: { files: [], additions: 0, deletions: 0 },
88
- executionStatus: execution.status,
89
- warnings: [criticalPreconditionError],
90
- };
91
- }
92
- // 3. Create ConflictDetector instance for worktree context
93
- const worktreeConflictDetector = new ConflictDetector(execution.worktree_path);
94
- // 4. Find merge base (use main repo since it has both branches)
95
- const mergeBase = this.gitSync.getMergeBase(execution.branch_name, execution.target_branch);
96
- // 4. Get commit list
97
- const commits = this.gitSync.getCommitList(mergeBase, execution.branch_name);
98
- // 6. Get diff summary (use main repo to see all changes)
99
- const diff = this.gitSync.getDiff(mergeBase, execution.branch_name);
100
- // 7. Detect conflicts (use worktree for conflict detection)
101
- const conflicts = worktreeConflictDetector.detectConflicts(execution.branch_name, execution.target_branch);
102
- // 7. Check for uncommitted changes in worktree (not included by default)
103
- const uncommittedFiles = this._getUncommittedFiles(execution.worktree_path);
104
- const uncommittedJSONL = uncommittedFiles.filter((file) => file.endsWith(".jsonl") &&
105
- (file.includes(".sudocode/") || file.startsWith(".sudocode/")));
106
- const uncommittedChanges = this._getUncommittedFileStats(execution.worktree_path);
107
- // 8. Generate warnings and check "soft" preconditions
108
- const warnings = [];
109
- let canSync = true;
110
- // Check local working tree status (categorizes JSONL vs other uncommitted changes)
111
- const localWorkingTreeStatus = this.gitSync.getWorkingTreeStatus();
112
- let localUncommittedJsonl;
113
- if (!localWorkingTreeStatus.isClean) {
114
- if (localWorkingTreeStatus.hasOnlyJsonlChanges) {
115
- // Only JSONL files uncommitted - can still sync, will auto-merge
116
- localUncommittedJsonl = {
117
- files: localWorkingTreeStatus.uncommittedJsonlFiles,
118
- willAutoMerge: true,
119
- };
120
- // Don't add warning - info will be shown in UI
121
- }
122
- else {
123
- // Non-JSONL files are uncommitted - block sync
124
- warnings.push("Local working tree has uncommitted changes. Stash or commit them first.");
125
- canSync = false;
126
- // Still include JSONL info for context
127
- if (localWorkingTreeStatus.uncommittedJsonlFiles.length > 0) {
128
- localUncommittedJsonl = {
129
- files: localWorkingTreeStatus.uncommittedJsonlFiles,
130
- willAutoMerge: false, // Can't auto-merge if there are other uncommitted files
131
- };
132
- }
133
- }
134
- }
135
- // Warn if execution is running/paused
136
- if (execution.status === "running" || execution.status === "paused") {
137
- warnings.push("Execution is currently active. Synced state may not reflect final execution result.");
138
- }
139
- // Warn about code conflicts
140
- if (conflicts.codeConflicts.length > 0) {
141
- warnings.push(`${conflicts.codeConflicts.length} code conflict(s) detected. Manual resolution may be required.`);
142
- }
143
- // Note about uncommitted files (not included by default)
144
- // if (uncommittedChanges && uncommittedChanges.files.length > 0) {
145
- // warnings.push(
146
- // `${uncommittedChanges.files.length} uncommitted file(s) in worktree will NOT be included (only committed changes are synced).`
147
- // );
148
- // }
149
- // 9. Detect potential local conflicts for uncommitted files
150
- // These are files in worktree that also have local changes or are untracked locally
151
- const potentialLocalConflicts = this._detectPotentialLocalConflicts(uncommittedChanges?.files || []);
152
- return {
153
- canSync,
154
- conflicts,
155
- diff,
156
- commits,
157
- mergeBase,
158
- uncommittedJSONLChanges: uncommittedJSONL,
159
- uncommittedChanges,
160
- potentialLocalConflicts,
161
- localUncommittedJsonl,
162
- executionStatus: execution.status,
163
- warnings,
164
- };
165
- }
166
- /**
167
- * Validate critical preconditions that prevent us from getting any sync info
168
- *
169
- * These are "hard" failures - if these fail, we can't get diff/commits info.
170
- * Returns an error message if validation fails, null if validation passes.
171
- *
172
- * @param execution - Execution to validate
173
- * @returns Error message if validation fails, null if validation passes
174
- */
175
- async _validateCriticalPreconditions(execution) {
176
- // 1. Check worktree path exists
177
- if (!execution.worktree_path) {
178
- return "No worktree path for execution";
179
- }
180
- // 2. Check worktree still exists on filesystem
181
- if (!fs.existsSync(execution.worktree_path)) {
182
- return "Worktree no longer exists";
183
- }
184
- // 3. Get list of branches
185
- const branches = this._getBranches();
186
- // 4. Check worktree branch exists
187
- if (!branches.includes(execution.branch_name)) {
188
- return `Worktree branch '${execution.branch_name}' not found`;
189
- }
190
- // 5. Check target branch exists
191
- if (!branches.includes(execution.target_branch)) {
192
- return `Target branch '${execution.target_branch}' not found`;
193
- }
194
- // 6. Verify branches have common base
195
- try {
196
- this.gitSync.getMergeBase(execution.branch_name, execution.target_branch);
197
- }
198
- catch (error) {
199
- return "Worktree and target branch have diverged without common history";
200
- }
201
- return null;
202
- }
203
- /**
204
- * Load execution from database and validate it exists
205
- *
206
- * Used by previewSync() and will be used in i-9gz4 (squash sync)
207
- *
208
- * @param executionId - Execution ID to load
209
- * @returns Execution record
210
- * @throws WorktreeSyncError if execution not found
211
- */
212
- async _loadAndValidateExecution(executionId) {
213
- const stmt = this.db.prepare("SELECT * FROM executions WHERE id = ?");
214
- const execution = stmt.get(executionId);
215
- if (!execution) {
216
- throw new WorktreeSyncError(`Execution ${executionId} not found`, WorktreeSyncErrorCode.EXECUTION_NOT_FOUND);
217
- }
218
- return execution;
219
- }
220
- /**
221
- * Validate preconditions for sync
222
- *
223
- * Used by previewSync() and will be used in i-9gz4 (squash sync)
224
- *
225
- * Checks:
226
- * - Worktree exists
227
- * - Worktree branch exists
228
- * - Local working tree is clean (or only has JSONL changes which can be auto-merged)
229
- * - Target branch exists
230
- * - Branches have common base
231
- *
232
- * @param execution - Execution to validate
233
- * @param options - Options to control validation behavior
234
- * @param options.skipDirtyWorkingTreeCheck - Skip the dirty working tree check entirely
235
- * @param options.allowJsonlOnlyChanges - Allow sync if only JSONL files are uncommitted (they'll be auto-merged)
236
- * @throws WorktreeSyncError if any precondition fails
237
- */
238
- async _validateSyncPreconditions(execution, options) {
239
- const { skipDirtyWorkingTreeCheck = false, allowJsonlOnlyChanges = false } = options || {};
240
- // 1. Check worktree path exists
241
- if (!execution.worktree_path) {
242
- throw new WorktreeSyncError("No worktree path for execution", WorktreeSyncErrorCode.NO_WORKTREE);
243
- }
244
- // 2. Check worktree still exists on filesystem
245
- if (!fs.existsSync(execution.worktree_path)) {
246
- throw new WorktreeSyncError("Worktree no longer exists", WorktreeSyncErrorCode.WORKTREE_MISSING);
247
- }
248
- // 3. Get list of branches
249
- const branches = this._getBranches();
250
- // 4. Check worktree branch exists
251
- if (!branches.includes(execution.branch_name)) {
252
- throw new WorktreeSyncError(`Worktree branch '${execution.branch_name}' not found`, WorktreeSyncErrorCode.BRANCH_MISSING);
253
- }
254
- // 5. Check target branch exists
255
- if (!branches.includes(execution.target_branch)) {
256
- throw new WorktreeSyncError(`Target branch '${execution.target_branch}' not found`, WorktreeSyncErrorCode.TARGET_BRANCH_MISSING);
257
- }
258
- // 6. Check local working tree is clean (skip for stage mode since it doesn't commit)
259
- if (!skipDirtyWorkingTreeCheck) {
260
- const workingTreeStatus = this.gitSync.getWorkingTreeStatus();
261
- if (!workingTreeStatus.isClean) {
262
- // If only JSONL files are uncommitted and allowJsonlOnlyChanges is true, allow sync
263
- if (allowJsonlOnlyChanges && workingTreeStatus.hasOnlyJsonlChanges) {
264
- // This is OK - JSONL files will be auto-merged
265
- }
266
- else if (workingTreeStatus.uncommittedOtherFiles.length > 0) {
267
- // Non-JSONL files are uncommitted - block sync
268
- throw new WorktreeSyncError("Local working tree has uncommitted changes. Stash or commit them first.", WorktreeSyncErrorCode.DIRTY_WORKING_TREE);
269
- }
270
- else {
271
- // Only JSONL files but allowJsonlOnlyChanges is false - block sync
272
- throw new WorktreeSyncError("Local working tree has uncommitted changes. Stash or commit them first.", WorktreeSyncErrorCode.DIRTY_WORKING_TREE);
273
- }
274
- }
275
- }
276
- // 7. Verify branches have common base
277
- try {
278
- this.gitSync.getMergeBase(execution.branch_name, execution.target_branch);
279
- }
280
- catch (error) {
281
- throw new WorktreeSyncError("Worktree and target branch have diverged without common history", WorktreeSyncErrorCode.NO_COMMON_BASE, error);
282
- }
283
- }
284
- /**
285
- * Saved state of uncommitted JSONL files for restoration after merge
286
- */
287
- _savedUncommittedJsonl = null;
288
- /**
289
- * Save uncommitted JSONL files before merge operation
290
- *
291
- * Reads both the uncommitted (working tree) and committed (HEAD) versions
292
- * of each JSONL file, then resets the working tree copy to HEAD.
293
- * The saved versions can be restored with _restoreUncommittedJsonl().
294
- *
295
- * @returns Map of file paths to their uncommitted and pre-committed content
296
- */
297
- async _saveUncommittedJsonl() {
298
- const status = this.gitSync.getWorkingTreeStatus();
299
- const savedFiles = new Map();
300
- for (const filePath of status.uncommittedJsonlFiles) {
301
- const fullPath = path.join(this.repoPath, filePath);
302
- // Read current uncommitted content from working tree
303
- let uncommittedContent = "";
304
- if (fs.existsSync(fullPath)) {
305
- uncommittedContent = fs.readFileSync(fullPath, "utf8");
306
- }
307
- // Read committed version from HEAD
308
- let preCommittedContent = "";
309
- try {
310
- preCommittedContent = execSync(`git show HEAD:${this._escapeShellArg(filePath)}`, {
311
- cwd: this.repoPath,
312
- encoding: "utf8",
313
- stdio: "pipe",
314
- });
315
- }
316
- catch {
317
- // File might not exist at HEAD (new file), use empty content
318
- preCommittedContent = "";
319
- }
320
- savedFiles.set(filePath, { uncommittedContent, preCommittedContent });
321
- // Reset the file to HEAD so it doesn't interfere with merge
322
- try {
323
- execSync(`git checkout HEAD -- ${this._escapeShellArg(filePath)}`, {
324
- cwd: this.repoPath,
325
- stdio: "pipe",
326
- });
327
- }
328
- catch {
329
- // If file doesn't exist at HEAD, remove it from working tree
330
- if (fs.existsSync(fullPath)) {
331
- fs.unlinkSync(fullPath);
332
- }
333
- }
334
- }
335
- this._savedUncommittedJsonl = savedFiles;
336
- return savedFiles;
337
- }
338
- /**
339
- * Restore uncommitted JSONL files after merge operation
340
- *
341
- * Performs a three-way merge:
342
- * - base: pre-merge committed version (from HEAD before merge)
343
- * - ours: saved uncommitted local changes
344
- * - theirs: post-merge result
345
- *
346
- * The merged result is written back to the working tree.
347
- */
348
- async _restoreUncommittedJsonl() {
349
- if (!this._savedUncommittedJsonl || this._savedUncommittedJsonl.size === 0) {
350
- return;
351
- }
352
- for (const [filePath, saved] of this._savedUncommittedJsonl) {
353
- const fullPath = path.join(this.repoPath, filePath);
354
- // Read post-merge version from working tree
355
- let postMergeContent = "";
356
- if (fs.existsSync(fullPath)) {
357
- postMergeContent = fs.readFileSync(fullPath, "utf8");
358
- }
359
- // Parse all three versions as JSONL entities
360
- const parseJsonl = (content) => {
361
- if (!content.trim())
362
- return [];
363
- return content
364
- .split("\n")
365
- .filter((line) => line.trim())
366
- .map((line) => {
367
- try {
368
- return JSON.parse(line);
369
- }
370
- catch {
371
- return null;
372
- }
373
- })
374
- .filter((entity) => entity !== null);
375
- };
376
- const baseEntities = parseJsonl(saved.preCommittedContent);
377
- const oursEntities = parseJsonl(saved.uncommittedContent);
378
- const theirsEntities = parseJsonl(postMergeContent);
379
- // Perform three-way merge using the merge resolver
380
- const { entities: merged } = mergeThreeWay(baseEntities, oursEntities, theirsEntities);
381
- // Write merged result back to working tree
382
- await writeJSONL(fullPath, merged);
383
- }
384
- // Clear saved state
385
- this._savedUncommittedJsonl = null;
386
- }
387
- /**
388
- * Create safety snapshot before sync
389
- *
390
- * Creates a git tag pointing to current target branch HEAD
391
- * for rollback capability
392
- *
393
- * @param executionId - Execution ID
394
- * @param targetBranch - Target branch name
395
- * @returns Tag name created
396
- */
397
- async _createSafetySnapshot(executionId, targetBranch) {
398
- const tagName = `sudocode-sync-before-${executionId}`;
399
- // Get current commit of target branch
400
- const currentCommit = this._getCurrentCommit(targetBranch);
401
- // Create annotated tag
402
- this.gitSync.createSafetyTag(tagName, currentCommit);
403
- return tagName;
404
- }
405
- /**
406
- * Get all uncommitted files from worktree
407
- *
408
- * @param worktreePath - Path to worktree
409
- * @returns Array of all uncommitted file paths
410
- */
411
- _getUncommittedFiles(worktreePath) {
412
- const gitSyncWorktree = new GitSyncCli(worktreePath);
413
- return gitSyncWorktree.getUncommittedFiles();
414
- }
415
- /**
416
- * Get uncommitted file stats from worktree
417
- *
418
- * Returns list of files and aggregate additions/deletions stats
419
- * for uncommitted changes in the worktree.
420
- *
421
- * @param worktreePath - Path to worktree
422
- * @returns Uncommitted file stats
423
- */
424
- _getUncommittedFileStats(worktreePath) {
425
- try {
426
- // Get modified files
427
- const modifiedOutput = execSync("git diff --numstat", {
428
- cwd: worktreePath,
429
- encoding: "utf8",
430
- stdio: "pipe",
431
- });
432
- // Get untracked files
433
- const untrackedFiles = execSync("git ls-files --others --exclude-standard", {
434
- cwd: worktreePath,
435
- encoding: "utf8",
436
- stdio: "pipe",
437
- })
438
- .split("\n")
439
- .filter((line) => line.trim().length > 0);
440
- // Parse modified file stats
441
- let additions = 0;
442
- let deletions = 0;
443
- const modifiedFiles = [];
444
- for (const line of modifiedOutput.split("\n")) {
445
- if (!line.trim())
446
- continue;
447
- const parts = line.split("\t");
448
- if (parts.length >= 3) {
449
- const add = parts[0] === "-" ? 0 : parseInt(parts[0], 10) || 0;
450
- const del = parts[1] === "-" ? 0 : parseInt(parts[1], 10) || 0;
451
- additions += add;
452
- deletions += del;
453
- modifiedFiles.push(parts[2]);
454
- }
455
- }
456
- // Count lines in untracked files as additions
457
- for (const filePath of untrackedFiles) {
458
- try {
459
- const fullPath = path.join(worktreePath, filePath);
460
- if (fs.existsSync(fullPath) && fs.statSync(fullPath).isFile()) {
461
- const content = fs.readFileSync(fullPath, "utf-8");
462
- additions += content.split("\n").length;
463
- }
464
- }
465
- catch (e) {
466
- // Skip files we can't read
467
- }
468
- }
469
- // Combine all files
470
- const allFiles = [...new Set([...modifiedFiles, ...untrackedFiles])];
471
- return {
472
- files: allFiles,
473
- additions,
474
- deletions,
475
- };
476
- }
477
- catch (error) {
478
- // Return empty stats on error
479
- return {
480
- files: [],
481
- additions: 0,
482
- deletions: 0,
483
- };
484
- }
485
- }
486
- /**
487
- * Check if local working tree is clean
488
- *
489
- * TODO: Will be used in i-7ya6 (sync preview)
490
- *
491
- * @returns true if clean, false if dirty
492
- */
493
- // @ts-expect-error - Foundation method, will be used in i-7ya6
494
- _isLocalTreeClean() {
495
- return this.gitSync.isWorkingTreeClean();
496
- }
497
- /**
498
- * Get list of branches in repository
499
- *
500
- * @returns Array of branch names
501
- */
502
- _getBranches() {
503
- try {
504
- const output = execSync("git branch --format='%(refname:short)'", {
505
- cwd: this.repoPath,
506
- encoding: "utf8",
507
- stdio: "pipe",
508
- shell: "/bin/bash",
509
- });
510
- return output
511
- .split("\n")
512
- .map((line) => line.trim())
513
- .filter((line) => line.length > 0);
514
- }
515
- catch (error) {
516
- throw new WorktreeSyncError(`Failed to get branch list: ${error.message}`, WorktreeSyncErrorCode.BRANCH_MISSING, error);
517
- }
518
- }
519
- /**
520
- * Get current commit SHA for a branch
521
- *
522
- * @param branchName - Branch name
523
- * @returns Commit SHA
524
- */
525
- _getCurrentCommit(branchName) {
526
- try {
527
- const output = execSync(`git rev-parse ${this._escapeShellArg(branchName)}`, {
528
- cwd: this.repoPath,
529
- encoding: "utf8",
530
- stdio: "pipe",
531
- });
532
- return output.trim();
533
- }
534
- catch (error) {
535
- throw new WorktreeSyncError(`Failed to get commit for branch ${branchName}: ${error.message}`, WorktreeSyncErrorCode.BRANCH_MISSING, error);
536
- }
537
- }
538
- /**
539
- * Escape shell argument for safe command execution
540
- *
541
- * @param arg - Argument to escape
542
- * @returns Escaped argument
543
- */
544
- _escapeShellArg(arg) {
545
- // Escape single quotes and wrap in single quotes
546
- return `'${arg.replace(/'/g, "'\\''")}'`;
547
- }
548
- /**
549
- * Resolve JSONL conflicts using three-way merge
550
- *
551
- * Used in squash sync to auto-resolve JSONL conflicts
552
- *
553
- * @param execution - Execution record
554
- * @param jsonlConflicts - List of JSONL conflicts to resolve
555
- * @throws WorktreeSyncError if resolution fails
556
- */
557
- async resolveJSONLConflicts(execution, jsonlConflicts) {
558
- if (jsonlConflicts.length === 0) {
559
- return;
560
- }
561
- const mergeBase = this.gitSync.getMergeBase(execution.branch_name, execution.target_branch);
562
- for (const conflict of jsonlConflicts) {
563
- try {
564
- // Read three versions of the file
565
- const baseVersion = await this._readJSONLVersion(conflict.filePath, mergeBase);
566
- const ourVersion = await this._readJSONLVersion(conflict.filePath, execution.target_branch);
567
- const theirVersion = await this._readJSONLVersion(conflict.filePath, execution.branch_name);
568
- // Perform three-way merge
569
- const { entities: merged } = mergeThreeWay(baseVersion, ourVersion, theirVersion);
570
- // Write resolved version to local repo
571
- const resolvedPath = path.join(this.repoPath, conflict.filePath);
572
- await writeJSONL(resolvedPath, merged);
573
- // Stage the resolved file
574
- execSync(`git add ${this._escapeShellArg(conflict.filePath)}`, {
575
- cwd: this.repoPath,
576
- stdio: "pipe",
577
- });
578
- }
579
- catch (error) {
580
- throw new WorktreeSyncError(`Failed to resolve JSONL conflict in ${conflict.filePath}: ${error.message}`, WorktreeSyncErrorCode.JSONL_RESOLUTION_FAILED, error);
581
- }
582
- }
583
- }
584
- /**
585
- * Read JSONL file at a specific git revision
586
- *
587
- * @param filePath - Relative path to JSONL file
588
- * @param revision - Git revision (commit SHA or branch name)
589
- * @returns Array of JSONL entities
590
- */
591
- async _readJSONLVersion(filePath, revision) {
592
- try {
593
- // Get file content at revision using git show
594
- const content = execSync(`git show ${this._escapeShellArg(revision)}:${this._escapeShellArg(filePath)}`, {
595
- cwd: this.repoPath,
596
- encoding: "utf8",
597
- stdio: "pipe",
598
- });
599
- // Parse JSONL content
600
- const lines = content
601
- .split("\n")
602
- .filter((line) => line.trim().length > 0);
603
- return lines.map((line) => JSON.parse(line));
604
- }
605
- catch (error) {
606
- // File might not exist at this revision (new file)
607
- if (error.status === 128) {
608
- return [];
609
- }
610
- throw error;
611
- }
612
- }
613
- /**
614
- * Commit uncommitted JSONL files in worktree
615
- *
616
- * Used during sync to include uncommitted JSONL changes
617
- *
618
- * @param worktreePath - Path to worktree
619
- * @param uncommittedFiles - List of uncommitted JSONL file paths
620
- * @throws WorktreeSyncError if commit fails
621
- */
622
- async commitUncommittedJSONL(worktreePath, uncommittedFiles) {
623
- if (uncommittedFiles.length === 0) {
624
- return;
625
- }
626
- try {
627
- // Stage all uncommitted JSONL files
628
- for (const file of uncommittedFiles) {
629
- execSync(`git add ${this._escapeShellArg(file)}`, {
630
- cwd: worktreePath,
631
- stdio: "pipe",
632
- });
633
- }
634
- // Create commit with descriptive message
635
- const fileList = uncommittedFiles.join(", ");
636
- const message = `Auto-commit uncommitted JSONL changes before sync\n\nFiles: ${fileList}`;
637
- execSync(`git commit --no-verify -m ${this._escapeShellArg(message)}`, {
638
- cwd: worktreePath,
639
- stdio: "pipe",
640
- });
641
- }
642
- catch (error) {
643
- throw new WorktreeSyncError(`Failed to commit uncommitted JSONL files: ${error.message}`, WorktreeSyncErrorCode.DATABASE_SYNC_FAILED, error);
644
- }
645
- }
646
- /**
647
- * Perform git merge --squash operation, allowing conflicts
648
- *
649
- * This method doesn't throw on conflicts.
650
- * Instead, it returns information about whether conflicts occurred.
651
- *
652
- * @param sourceBranch - Branch to merge from (worktree branch)
653
- * @param targetBranch - Branch to merge into
654
- * @returns Object with filesChanged count and hasConflicts flag
655
- */
656
- _performSquashMergeAllowConflicts(sourceBranch, targetBranch) {
657
- // Checkout target branch
658
- execSync(`git checkout ${this._escapeShellArg(targetBranch)}`, {
659
- cwd: this.repoPath,
660
- stdio: "pipe",
661
- });
662
- // Perform squash merge - may fail with conflicts
663
- let hasConflicts = false;
664
- try {
665
- execSync(`git merge --squash ${this._escapeShellArg(sourceBranch)}`, {
666
- cwd: this.repoPath,
667
- stdio: "pipe",
668
- });
669
- }
670
- catch (error) {
671
- // Check if this is a conflict situation (exit code 1) or a real error
672
- // git merge --squash returns 1 on conflicts but stages what it can
673
- hasConflicts = true;
674
- }
675
- // Count staged files (including conflicted ones)
676
- const statusOutput = execSync("git diff --cached --name-only", {
677
- cwd: this.repoPath,
678
- encoding: "utf8",
679
- stdio: "pipe",
680
- });
681
- const filesChanged = statusOutput
682
- .split("\n")
683
- .filter((line) => line.trim().length > 0).length;
684
- // Check for actual conflicts in the working tree
685
- try {
686
- const conflictCheck = execSync("git diff --name-only --diff-filter=U", {
687
- cwd: this.repoPath,
688
- encoding: "utf8",
689
- stdio: "pipe",
690
- });
691
- hasConflicts = conflictCheck.trim().length > 0;
692
- }
693
- catch (e) {
694
- // If this fails, assume no conflicts
695
- }
696
- return { filesChanged, hasConflicts };
697
- }
698
- /**
699
- * Check if a file has local uncommitted changes compared to HEAD
700
- *
701
- * @param filePath - Relative path to the file
702
- * @returns true if file has uncommitted changes, false otherwise
703
- */
704
- _hasLocalUncommittedChanges(filePath) {
705
- try {
706
- // git diff --quiet exits with 1 if there are changes, 0 if clean
707
- execSync(`git diff --quiet HEAD -- ${this._escapeShellArg(filePath)}`, {
708
- cwd: this.repoPath,
709
- stdio: "pipe",
710
- });
711
- return false; // Exit 0 = no changes
712
- }
713
- catch {
714
- return true; // Exit 1 = has changes
715
- }
716
- }
717
- /**
718
- * Detect potential local conflicts for uncommitted worktree files
719
- *
720
- * Checks which uncommitted worktree files also exist locally with changes
721
- * or are untracked locally. These files may have merge conflicts when synced.
722
- *
723
- * @param worktreeFiles - List of uncommitted files in worktree
724
- * @returns Info about files that may have conflicts
725
- */
726
- _detectPotentialLocalConflicts(worktreeFiles) {
727
- const conflictFiles = [];
728
- for (const filePath of worktreeFiles) {
729
- const localPath = path.join(this.repoPath, filePath);
730
- const localFileExists = fs.existsSync(localPath);
731
- if (localFileExists) {
732
- // Check if local file has uncommitted changes vs HEAD or is untracked
733
- const hasChangesVsHead = this._hasLocalUncommittedChanges(filePath);
734
- const isUntracked = this._isFileUntracked(filePath);
735
- if (hasChangesVsHead || isUntracked) {
736
- conflictFiles.push(filePath);
737
- }
738
- }
739
- }
740
- return {
741
- count: conflictFiles.length,
742
- files: conflictFiles,
743
- };
744
- }
745
- /**
746
- * Check if a file is untracked by git (not in the index)
747
- *
748
- * @param filePath - Relative path to the file
749
- * @returns true if file is untracked, false if tracked
750
- */
751
- _isFileUntracked(filePath) {
752
- try {
753
- // git ls-files returns the file path if it's tracked, empty if not
754
- const result = execSync(`git ls-files -- ${this._escapeShellArg(filePath)}`, {
755
- cwd: this.repoPath,
756
- encoding: "utf8",
757
- stdio: "pipe",
758
- });
759
- return result.trim().length === 0; // Empty = untracked
760
- }
761
- catch {
762
- return true; // Assume untracked on error
763
- }
764
- }
765
- /**
766
- * Check if a file is a JSONL file in the .sudocode directory
767
- *
768
- * @param filePath - Relative path to the file
769
- * @returns true if file is a .sudocode JSONL file
770
- */
771
- _isJSONLFile(filePath) {
772
- return (filePath.endsWith(".jsonl") &&
773
- (filePath.startsWith(".sudocode/") || filePath.includes("/.sudocode/")));
774
- }
775
- /**
776
- * Perform three-way merge on a file using git merge-file
777
- *
778
- * Uses HEAD as base, local working copy as "ours", and worktree version as "theirs".
779
- * Modifies the local file in place, inserting conflict markers if needed.
780
- *
781
- * @param filePath - Relative path to the file in local repo
782
- * @param worktreeFilePath - Absolute path to the file in worktree
783
- * @returns true if there are conflicts, false if merge was clean
784
- */
785
- _threeWayMergeFile(filePath, worktreeFilePath) {
786
- const localFilePath = path.join(this.repoPath, filePath);
787
- // Create temp file for base version from HEAD
788
- const tempDir = os.tmpdir();
789
- const baseTempFile = path.join(tempDir, `sudocode-merge-base-${Date.now()}-${path.basename(filePath)}`);
790
- try {
791
- // Get base version from HEAD
792
- let baseContent = "";
793
- try {
794
- baseContent = execSync(`git show HEAD:${this._escapeShellArg(filePath)}`, {
795
- cwd: this.repoPath,
796
- encoding: "utf8",
797
- stdio: "pipe",
798
- });
799
- }
800
- catch {
801
- // File might be new (not in HEAD), use empty base
802
- baseContent = "";
803
- }
804
- fs.writeFileSync(baseTempFile, baseContent, "utf8");
805
- // git merge-file modifies the first file in place
806
- // Returns 0 if clean merge, >0 for number of conflicts, -1 for error
807
- try {
808
- execSync(`git merge-file -L "LOCAL" -L "BASE" -L "WORKTREE" ${this._escapeShellArg(localFilePath)} ${this._escapeShellArg(baseTempFile)} ${this._escapeShellArg(worktreeFilePath)}`, {
809
- cwd: this.repoPath,
810
- stdio: "pipe",
811
- });
812
- return false; // Exit 0 = clean merge, no conflicts
813
- }
814
- catch (error) {
815
- // Exit code > 0 means conflicts (number of conflicts)
816
- // Exit code < 0 means error
817
- if (error.status > 0) {
818
- return true; // Has conflicts
819
- }
820
- // Real error - rethrow
821
- throw error;
822
- }
823
- }
824
- finally {
825
- // Clean up temp file
826
- if (fs.existsSync(baseTempFile)) {
827
- fs.unlinkSync(baseTempFile);
828
- }
829
- }
830
- }
831
- /**
832
- * Merge two JSONL files using UUID-based resolution
833
- *
834
- * This is a TWO-WAY merge (no base version available).
835
- * Used for merging uncommitted local + worktree JSONL files during stage sync.
836
- *
837
- * Uses `resolveEntities` for simple UUID-based deduplication, which is appropriate
838
- * for two-way scenarios where we don't have a common base version.
839
- *
840
- * @param localFilePath - Absolute path to local JSONL file
841
- * @param worktreeFilePath - Absolute path to worktree JSONL file
842
- */
843
- async _mergeJSONLFiles(localFilePath, worktreeFilePath) {
844
- // Read both versions
845
- const localEntities = readJSONLSync(localFilePath, { skipErrors: true });
846
- const worktreeEntities = readJSONLSync(worktreeFilePath, {
847
- skipErrors: true,
848
- });
849
- // Two-way merge: Combine and resolve using UUID-based deduplication
850
- // This is correct for two-way scenarios (no base version)
851
- const allEntities = [...localEntities, ...worktreeEntities];
852
- const { entities: merged } = resolveEntities(allEntities);
853
- // Write merged result back to local file
854
- await writeJSONL(localFilePath, merged);
855
- }
856
- /**
857
- * Copy uncommitted files from worktree to local repo with safe merging
858
- *
859
- * For files with local uncommitted changes:
860
- * - JSONL files: Uses UUID-based merge resolution
861
- * - Other files: Uses git merge-file for three-way merge with conflict markers
862
- *
863
- * Files without local changes are copied directly.
864
- *
865
- * @param worktreePath - Path to the worktree
866
- * @param options - Optional settings
867
- * @param options.overrideLocalChanges - If true, skip merge and overwrite local changes
868
- * @returns Object with filesCopied count and list of files with conflicts
869
- */
870
- async _copyUncommittedFiles(worktreePath, options) {
871
- const { overrideLocalChanges = false } = options || {};
872
- // Get list of uncommitted/untracked files in worktree
873
- const modifiedOutput = execSync("git diff --name-only", {
874
- cwd: worktreePath,
875
- encoding: "utf8",
876
- stdio: "pipe",
877
- });
878
- const untrackedOutput = execSync("git ls-files --others --exclude-standard", {
879
- cwd: worktreePath,
880
- encoding: "utf8",
881
- stdio: "pipe",
882
- });
883
- const modifiedFiles = modifiedOutput
884
- .split("\n")
885
- .filter((line) => line.trim().length > 0);
886
- const untrackedFiles = untrackedOutput
887
- .split("\n")
888
- .filter((line) => line.trim().length > 0);
889
- const allFiles = [...new Set([...modifiedFiles, ...untrackedFiles])];
890
- if (allFiles.length === 0) {
891
- return { filesCopied: 0, filesWithConflicts: [] };
892
- }
893
- // Process each file from worktree
894
- let filesCopied = 0;
895
- const filesWithConflicts = [];
896
- for (const filePath of allFiles) {
897
- const srcPath = path.join(worktreePath, filePath);
898
- const destPath = path.join(this.repoPath, filePath);
899
- // Check if source file exists
900
- if (!fs.existsSync(srcPath)) {
901
- continue;
902
- }
903
- // Create destination directory if needed
904
- const destDir = path.dirname(destPath);
905
- if (!fs.existsSync(destDir)) {
906
- fs.mkdirSync(destDir, { recursive: true });
907
- }
908
- // Check if local file has uncommitted changes or is untracked
909
- // We need to merge if: (1) file exists locally AND (2) either has changes vs HEAD or is untracked
910
- const localFileExists = fs.existsSync(destPath);
911
- const localHasChangesVsHead = localFileExists && this._hasLocalUncommittedChanges(filePath);
912
- const localIsUntracked = localFileExists && this._isFileUntracked(filePath);
913
- const needsMerge = !overrideLocalChanges && (localHasChangesVsHead || localIsUntracked);
914
- let hasConflicts = false;
915
- if (!needsMerge) {
916
- // No local changes OR override mode - copy directly (overwrites local)
917
- fs.copyFileSync(srcPath, destPath);
918
- }
919
- else if (this._isJSONLFile(filePath)) {
920
- // JSONL file with local changes - use UUID-based merge
921
- await this._mergeJSONLFiles(destPath, srcPath);
922
- }
923
- else {
924
- // Other file with local changes - use three-way merge
925
- hasConflicts = this._threeWayMergeFile(filePath, srcPath);
926
- if (hasConflicts) {
927
- filesWithConflicts.push(filePath);
928
- }
929
- }
930
- // Stage the file ONLY if it doesn't have conflicts
931
- // Files with conflict markers should remain unstaged so VS Code can detect them
932
- if (!hasConflicts) {
933
- execSync(`git add ${this._escapeShellArg(filePath)}`, {
934
- cwd: this.repoPath,
935
- stdio: "pipe",
936
- });
937
- }
938
- filesCopied++;
939
- }
940
- return { filesCopied, filesWithConflicts };
941
- }
942
- /**
943
- * Resolve JSONL merge conflicts in the local repository
944
- *
945
- * Checks for git conflict markers in issues.jsonl and specs.jsonl,
946
- * and resolves them using the merge-resolver logic.
947
- *
948
- * @returns Number of files resolved
949
- */
950
- async _resolveJSONLConflicts() {
951
- const sudocodePath = path.join(this.repoPath, ".sudocode");
952
- const issuesPath = path.join(sudocodePath, "issues.jsonl");
953
- const specsPath = path.join(sudocodePath, "specs.jsonl");
954
- let filesResolved = 0;
955
- // Check and resolve issues.jsonl
956
- if (fs.existsSync(issuesPath) && hasGitConflictMarkers(issuesPath)) {
957
- await this._resolveJSONLFile(issuesPath);
958
- filesResolved++;
959
- }
960
- // Check and resolve specs.jsonl
961
- if (fs.existsSync(specsPath) && hasGitConflictMarkers(specsPath)) {
962
- await this._resolveJSONLFile(specsPath);
963
- filesResolved++;
964
- }
965
- return filesResolved;
966
- }
967
- /**
968
- * Resolve conflicts in a single JSONL file
969
- *
970
- * Uses three-way merge when we have base/ours/theirs versions from git.
971
- * This enables proper three-way merge semantics with YAML-based line-level merging.
972
- *
973
- * @param filePath - Path to the JSONL file with conflicts
974
- */
975
- async _resolveJSONLFile(filePath) {
976
- // Read file with conflict markers
977
- const content = fs.readFileSync(filePath, "utf8");
978
- // Parse conflicts
979
- const sections = parseMergeConflictFile(content);
980
- // Try to use three-way merge by getting base/ours/theirs from git
981
- // This is more accurate than parsing conflict markers
982
- const relativePath = path.relative(this.repoPath, filePath);
983
- try {
984
- // Get base version from merge-base (git stage 1)
985
- let baseEntities = [];
986
- try {
987
- // Note: Using execSync with _escapeShellArg for consistency with rest of file
988
- const baseContent = execSync(`git show :1:${this._escapeShellArg(relativePath)}`, {
989
- cwd: this.repoPath,
990
- encoding: "utf8",
991
- stdio: "pipe",
992
- });
993
- baseEntities = this._parseJSONLContent(baseContent);
994
- }
995
- catch {
996
- // No base version (new file or file didn't exist at merge-base)
997
- baseEntities = [];
998
- }
999
- // Get ours version (git stage 2)
1000
- let oursEntities = [];
1001
- try {
1002
- const oursContent = execSync(`git show :2:${this._escapeShellArg(relativePath)}`, {
1003
- cwd: this.repoPath,
1004
- encoding: "utf8",
1005
- stdio: "pipe",
1006
- });
1007
- oursEntities = this._parseJSONLContent(oursContent);
1008
- }
1009
- catch {
1010
- // No ours version
1011
- oursEntities = [];
1012
- }
1013
- // Get theirs version (git stage 3)
1014
- let theirsEntities = [];
1015
- try {
1016
- const theirsContent = execSync(`git show :3:${this._escapeShellArg(relativePath)}`, {
1017
- cwd: this.repoPath,
1018
- encoding: "utf8",
1019
- stdio: "pipe",
1020
- });
1021
- theirsEntities = this._parseJSONLContent(theirsContent);
1022
- }
1023
- catch {
1024
- // No theirs version
1025
- theirsEntities = [];
1026
- }
1027
- // If we have at least ours and theirs (or base), use three-way merge
1028
- // This provides proper three-way semantics with YAML-based line-level merging
1029
- if (oursEntities.length > 0 || theirsEntities.length > 0 || baseEntities.length > 0) {
1030
- const { entities: resolved } = mergeThreeWay(baseEntities, oursEntities, theirsEntities);
1031
- // Write back resolved entities
1032
- await writeJSONL(filePath, resolved);
1033
- // Stage the resolved file
1034
- execSync(`git add ${this._escapeShellArg(relativePath)}`, {
1035
- cwd: this.repoPath,
1036
- stdio: "pipe",
1037
- });
1038
- return;
1039
- }
1040
- }
1041
- catch (error) {
1042
- // If three-way merge fails, fall back to two-way resolution below
1043
- console.warn(`Three-way merge failed for ${relativePath}, using fallback resolution:`, error);
1044
- }
1045
- // Fallback: Use two-way resolution from conflict markers
1046
- // This is used when git stages are not available (manual conflict resolution)
1047
- const allEntities = [];
1048
- for (const section of sections) {
1049
- if (section.type === "clean") {
1050
- for (const line of section.lines) {
1051
- if (line.trim()) {
1052
- try {
1053
- allEntities.push(JSON.parse(line));
1054
- }
1055
- catch {
1056
- // Skip malformed lines
1057
- }
1058
- }
1059
- }
1060
- }
1061
- else {
1062
- // Conflict section - include both ours and theirs
1063
- for (const line of [
1064
- ...(section.ours || []),
1065
- ...(section.theirs || []),
1066
- ]) {
1067
- if (line.trim()) {
1068
- try {
1069
- allEntities.push(JSON.parse(line));
1070
- }
1071
- catch {
1072
- // Skip malformed lines
1073
- }
1074
- }
1075
- }
1076
- }
1077
- }
1078
- // Two-way resolution: Use resolveEntities for UUID-based deduplication
1079
- // This is appropriate when we don't have a true base version
1080
- const { entities: resolved } = resolveEntities(allEntities, {
1081
- verbose: false,
1082
- });
1083
- // Write back resolved entities
1084
- await writeJSONL(filePath, resolved);
1085
- // Stage the resolved file
1086
- execSync(`git add ${this._escapeShellArg(relativePath)}`, {
1087
- cwd: this.repoPath,
1088
- stdio: "pipe",
1089
- });
1090
- }
1091
- /**
1092
- * Parse JSONL content into entities
1093
- *
1094
- * Helper function for parsing JSONL content from git or files.
1095
- *
1096
- * @param content - JSONL content as string
1097
- * @returns Array of parsed entities
1098
- */
1099
- _parseJSONLContent(content) {
1100
- if (!content.trim())
1101
- return [];
1102
- return content
1103
- .split("\n")
1104
- .filter((line) => line.trim())
1105
- .map((line) => {
1106
- try {
1107
- return JSON.parse(line);
1108
- }
1109
- catch {
1110
- return null;
1111
- }
1112
- })
1113
- .filter((entity) => entity !== null);
1114
- }
1115
- /**
1116
- * Generate commit message for squash sync
1117
- *
1118
- * @param execution - Execution record
1119
- * @param commitCount - Number of commits being squashed
1120
- * @returns Generated commit message
1121
- */
1122
- _generateCommitMessage(execution, commitCount) {
1123
- const issueId = execution.issue_id || "unknown";
1124
- const branchName = execution.branch_name;
1125
- return `Squash merge from ${branchName} (${commitCount} commit${commitCount !== 1 ? "s" : ""})
1126
-
1127
- Issue: ${issueId}
1128
- Execution: ${execution.id}
1129
-
1130
- Synced changes from worktree execution.`;
1131
- }
1132
- /**
1133
- * Create commit with staged changes
1134
- *
1135
- * @param message - Commit message
1136
- * @returns Commit SHA
1137
- * @throws WorktreeSyncError if commit fails
1138
- */
1139
- _createCommit(message) {
1140
- try {
1141
- execSync(`git commit --no-verify -m ${this._escapeShellArg(message)}`, {
1142
- cwd: this.repoPath,
1143
- stdio: "pipe",
1144
- });
1145
- // Get the commit SHA
1146
- const sha = execSync("git rev-parse HEAD", {
1147
- cwd: this.repoPath,
1148
- encoding: "utf8",
1149
- stdio: "pipe",
1150
- }).trim();
1151
- return sha;
1152
- }
1153
- catch (error) {
1154
- throw new WorktreeSyncError(`Failed to create commit: ${error.message}`, WorktreeSyncErrorCode.MERGE_FAILED, error);
1155
- }
1156
- }
1157
- /**
1158
- * Rollback to safety snapshot
1159
- *
1160
- * @param targetBranch - Target branch to reset
1161
- * @param tagName - Safety tag to rollback to
1162
- * @throws WorktreeSyncError if rollback fails
1163
- */
1164
- async _rollbackToSnapshot(targetBranch, tagName) {
1165
- try {
1166
- // Checkout target branch
1167
- execSync(`git checkout ${this._escapeShellArg(targetBranch)}`, {
1168
- cwd: this.repoPath,
1169
- stdio: "pipe",
1170
- });
1171
- // Reset to tag
1172
- execSync(`git reset --hard ${this._escapeShellArg(tagName)}`, {
1173
- cwd: this.repoPath,
1174
- stdio: "pipe",
1175
- });
1176
- console.log(`Rolled back ${targetBranch} to ${tagName}`);
1177
- }
1178
- catch (error) {
1179
- throw new WorktreeSyncError(`Failed to rollback to snapshot ${tagName}: ${error.message}`, WorktreeSyncErrorCode.MERGE_FAILED, error);
1180
- }
1181
- }
1182
- /**
1183
- * Perform squash sync operation
1184
- *
1185
- * Squashes all committed worktree changes into a single commit on the target branch.
1186
- * Only includes committed changes - uncommitted changes are excluded.
1187
- * If merge conflicts occur, they are left for the user to resolve manually.
1188
- *
1189
- * @param executionId - Execution ID to sync
1190
- * @param customCommitMessage - Optional custom commit message
1191
- * @returns Sync result with details
1192
- * @throws WorktreeSyncError if sync fails
1193
- */
1194
- async squashSync(executionId, customCommitMessage) {
1195
- // 1. Load and validate execution
1196
- const execution = await this._loadAndValidateExecution(executionId);
1197
- // 2. Validate preconditions (allow JSONL-only changes, they'll be auto-merged)
1198
- await this._validateSyncPreconditions(execution, { allowJsonlOnlyChanges: true });
1199
- // 3. Save uncommitted JSONL files before merge (will be restored after)
1200
- const savedJsonlFiles = await this._saveUncommittedJsonl();
1201
- const hasUncommittedJsonl = savedJsonlFiles.size > 0;
1202
- // 4. Preview sync to get info (we'll proceed even with conflicts)
1203
- const preview = await this.previewSync(executionId);
1204
- // 4. Check if there are any commits to merge
1205
- if (preview.commits.length === 0) {
1206
- return {
1207
- success: false,
1208
- filesChanged: 0,
1209
- error: "No commits to merge. Only committed changes are included in sync.",
1210
- };
1211
- }
1212
- // 5. Check if worktree branch is already merged into target
1213
- if (this._isAncestor(execution.branch_name, execution.target_branch)) {
1214
- return {
1215
- success: false,
1216
- filesChanged: 0,
1217
- error: "Target branch is already up to date with worktree changes. Nothing to merge.",
1218
- };
1219
- }
1220
- let safetyTag;
1221
- try {
1222
- // 6. Create safety snapshot (before any changes)
1223
- safetyTag = await this._createSafetySnapshot(executionId, execution.target_branch);
1224
- // 7. Perform git merge --squash (may have conflicts)
1225
- const mergeResult = this._performSquashMergeAllowConflicts(execution.branch_name, execution.target_branch);
1226
- // 8. Check if there are unresolved conflicts
1227
- if (mergeResult.hasConflicts) {
1228
- // Get list of files with conflicts
1229
- let filesWithConflicts = [];
1230
- try {
1231
- const conflictCheck = execSync("git diff --name-only --diff-filter=U", {
1232
- cwd: this.repoPath,
1233
- encoding: "utf8",
1234
- stdio: "pipe",
1235
- });
1236
- filesWithConflicts = conflictCheck
1237
- .trim()
1238
- .split("\n")
1239
- .filter((f) => f.length > 0);
1240
- }
1241
- catch {
1242
- // If command fails, leave empty
1243
- }
1244
- // Return with conflicts info - user must resolve manually
1245
- return {
1246
- success: false,
1247
- filesChanged: mergeResult.filesChanged,
1248
- hasConflicts: true,
1249
- filesWithConflicts,
1250
- error: "Merge conflicts detected. Please resolve them manually and commit.",
1251
- cleanupOffered: false,
1252
- };
1253
- }
1254
- // 9. Generate commit message
1255
- const commitMessage = customCommitMessage ||
1256
- this._generateCommitMessage(execution, preview.commits.length);
1257
- // 10. Create commit
1258
- const finalCommit = this._createCommit(commitMessage);
1259
- // 11. Restore uncommitted JSONL files with three-way merge
1260
- if (hasUncommittedJsonl) {
1261
- await this._restoreUncommittedJsonl();
1262
- }
1263
- // 12. Return success result
1264
- return {
1265
- success: true,
1266
- finalCommit,
1267
- filesChanged: mergeResult.filesChanged,
1268
- cleanupOffered: true,
1269
- };
1270
- }
1271
- catch (error) {
1272
- // Restore uncommitted JSONL files even on failure (to avoid losing user changes)
1273
- if (hasUncommittedJsonl) {
1274
- try {
1275
- await this._restoreUncommittedJsonl();
1276
- }
1277
- catch (restoreError) {
1278
- console.error("Failed to restore uncommitted JSONL files:", restoreError);
1279
- }
1280
- }
1281
- // Rollback to safety snapshot on failure
1282
- if (safetyTag) {
1283
- try {
1284
- await this._rollbackToSnapshot(execution.target_branch, safetyTag);
1285
- }
1286
- catch (rollbackError) {
1287
- console.error(`Failed to rollback to snapshot ${safetyTag}:`, rollbackError);
1288
- }
1289
- }
1290
- throw new WorktreeSyncError(`Squash sync failed: ${error.message}`, WorktreeSyncErrorCode.MERGE_FAILED, error);
1291
- }
1292
- }
1293
- /**
1294
- * Perform stage sync operation
1295
- *
1296
- * Applies committed worktree changes to the working directory without committing.
1297
- * Changes are left staged, ready for the user to commit manually.
1298
- * Only includes committed changes by default - uncommitted changes are excluded
1299
- * unless includeUncommitted is true.
1300
- *
1301
- * @param executionId - Execution ID to sync
1302
- * @param options - Optional settings
1303
- * @param options.includeUncommitted - If true, also copy uncommitted files from worktree
1304
- * @param options.overrideLocalChanges - If true, overwrite local changes instead of merging
1305
- * @returns Sync result with details
1306
- * @throws WorktreeSyncError if sync fails
1307
- */
1308
- async stageSync(executionId, options) {
1309
- const { includeUncommitted = false, overrideLocalChanges = false } = options || {};
1310
- // 1. Load and validate execution
1311
- const execution = await this._loadAndValidateExecution(executionId);
1312
- // 2. Validate preconditions (skip dirty working tree check - stage mode doesn't commit)
1313
- await this._validateSyncPreconditions(execution, {
1314
- skipDirtyWorkingTreeCheck: true,
1315
- });
1316
- // 3. Preview sync to get info
1317
- const preview = await this.previewSync(executionId);
1318
- // 4. Check if there's anything to sync
1319
- const hasCommits = preview.commits.length > 0;
1320
- if (!hasCommits && !includeUncommitted) {
1321
- return {
1322
- success: false,
1323
- filesChanged: 0,
1324
- error: "No commits to merge. Only committed changes are included in sync.",
1325
- };
1326
- }
1327
- let safetyTag;
1328
- try {
1329
- // 5. Create safety snapshot (before any changes)
1330
- safetyTag = await this._createSafetySnapshot(executionId, execution.target_branch);
1331
- let filesChanged = 0;
1332
- let hasConflicts = false;
1333
- // 6. Perform git merge --squash for committed changes (if any)
1334
- if (hasCommits) {
1335
- const mergeResult = this._performSquashMergeAllowConflicts(execution.branch_name, execution.target_branch);
1336
- filesChanged = mergeResult.filesChanged;
1337
- hasConflicts = mergeResult.hasConflicts;
1338
- }
1339
- // 7. Copy uncommitted files from worktree if requested (with safe merging)
1340
- let uncommittedFilesCopied = 0;
1341
- let filesWithConflicts = [];
1342
- if (includeUncommitted && execution.worktree_path) {
1343
- const copyResult = await this._copyUncommittedFiles(execution.worktree_path, { overrideLocalChanges });
1344
- uncommittedFilesCopied = copyResult.filesCopied;
1345
- filesWithConflicts = copyResult.filesWithConflicts;
1346
- filesChanged += uncommittedFilesCopied;
1347
- // If we have conflicts from uncommitted files merge, mark hasConflicts
1348
- if (filesWithConflicts.length > 0) {
1349
- hasConflicts = true;
1350
- }
1351
- }
1352
- // 8. Auto-resolve JSONL conflicts if any (from git merge --squash)
1353
- const jsonlFilesResolved = await this._resolveJSONLConflicts();
1354
- if (jsonlFilesResolved > 0) {
1355
- // Re-check for remaining conflicts after JSONL resolution
1356
- try {
1357
- const conflictCheck = execSync("git diff --name-only --diff-filter=U", {
1358
- cwd: this.repoPath,
1359
- encoding: "utf8",
1360
- stdio: "pipe",
1361
- });
1362
- const remainingConflictFiles = conflictCheck
1363
- .trim()
1364
- .split("\n")
1365
- .filter((f) => f.length > 0);
1366
- hasConflicts = remainingConflictFiles.length > 0;
1367
- // Add any remaining conflict files not already tracked
1368
- for (const file of remainingConflictFiles) {
1369
- if (!filesWithConflicts.includes(file)) {
1370
- filesWithConflicts.push(file);
1371
- }
1372
- }
1373
- }
1374
- catch {
1375
- // If command fails, assume no additional conflicts
1376
- }
1377
- }
1378
- // 9. Check if there are unresolved (non-JSONL) conflicts
1379
- if (hasConflicts) {
1380
- return {
1381
- success: false,
1382
- filesChanged,
1383
- hasConflicts: true,
1384
- filesWithConflicts,
1385
- uncommittedFilesIncluded: uncommittedFilesCopied,
1386
- error: "Merge conflicts detected. Please resolve them manually.",
1387
- cleanupOffered: false,
1388
- };
1389
- }
1390
- // 10. Return success result WITHOUT creating a commit
1391
- // Changes remain staged for user to commit manually
1392
- return {
1393
- success: true,
1394
- filesChanged,
1395
- uncommittedFilesIncluded: uncommittedFilesCopied,
1396
- cleanupOffered: true,
1397
- };
1398
- }
1399
- catch (error) {
1400
- // Rollback to safety snapshot on failure
1401
- if (safetyTag) {
1402
- try {
1403
- await this._rollbackToSnapshot(execution.target_branch, safetyTag);
1404
- }
1405
- catch (rollbackError) {
1406
- console.error(`Failed to rollback to snapshot ${safetyTag}:`, rollbackError);
1407
- }
1408
- }
1409
- throw new WorktreeSyncError(`Stage sync failed: ${error.message}`, WorktreeSyncErrorCode.MERGE_FAILED, error);
1410
- }
1411
- }
1412
- /**
1413
- * Check if worktree branch is an ancestor of target branch
1414
- *
1415
- * If the worktree branch is an ancestor, it means target already has all
1416
- * the commits from the worktree (e.g., via a previous sync).
1417
- *
1418
- * @param worktreeBranch - Worktree branch name
1419
- * @param targetBranch - Target branch name
1420
- * @returns true if worktree branch is an ancestor of target branch
1421
- */
1422
- _isAncestor(worktreeBranch, targetBranch) {
1423
- try {
1424
- execSync(`git merge-base --is-ancestor ${this._escapeShellArg(worktreeBranch)} ${this._escapeShellArg(targetBranch)}`, {
1425
- cwd: this.repoPath,
1426
- stdio: "pipe",
1427
- });
1428
- // Exit code 0 means worktreeBranch IS an ancestor of targetBranch
1429
- return true;
1430
- }
1431
- catch {
1432
- // Exit code 1 means NOT an ancestor, which is what we want for merging
1433
- return false;
1434
- }
1435
- }
1436
- /**
1437
- * Perform preserve sync operation
1438
- *
1439
- * Merges all commits from worktree branch to target branch, preserving commit history.
1440
- * Only includes committed changes - uncommitted changes are excluded.
1441
- * If merge conflicts occur, they are left for the user to resolve manually.
1442
- *
1443
- * @param executionId - Execution ID to sync
1444
- * @returns Sync result with details
1445
- * @throws WorktreeSyncError if sync fails
1446
- */
1447
- async preserveSync(executionId) {
1448
- // 1. Load and validate execution
1449
- const execution = await this._loadAndValidateExecution(executionId);
1450
- // 2. Validate preconditions (allow JSONL-only changes, they'll be auto-merged)
1451
- await this._validateSyncPreconditions(execution, { allowJsonlOnlyChanges: true });
1452
- // 3. Save uncommitted JSONL files before merge (will be restored after)
1453
- const savedJsonlFiles = await this._saveUncommittedJsonl();
1454
- const hasUncommittedJsonl = savedJsonlFiles.size > 0;
1455
- // 4. Preview sync to get info
1456
- const preview = await this.previewSync(executionId);
1457
- // 4. Check if there are any commits to merge
1458
- if (preview.commits.length === 0) {
1459
- return {
1460
- success: false,
1461
- filesChanged: 0,
1462
- error: "No commits to merge. Only committed changes are included in sync.",
1463
- };
1464
- }
1465
- // 5. Check if worktree branch is already merged into target
1466
- // This happens if a previous sync (squash or preserve) already merged these commits
1467
- if (this._isAncestor(execution.branch_name, execution.target_branch)) {
1468
- return {
1469
- success: false,
1470
- filesChanged: 0,
1471
- error: "Target branch is already up to date with worktree changes. Nothing to merge.",
1472
- };
1473
- }
1474
- let safetyTag;
1475
- try {
1476
- // 6. Create safety snapshot (before any changes)
1477
- safetyTag = await this._createSafetySnapshot(executionId, execution.target_branch);
1478
- // 7. Checkout target branch
1479
- execSync(`git checkout ${this._escapeShellArg(execution.target_branch)}`, {
1480
- cwd: this.repoPath,
1481
- stdio: "pipe",
1482
- });
1483
- // 8. Perform regular merge (preserves commit history)
1484
- let hasConflicts = false;
1485
- let filesChanged = 0;
1486
- try {
1487
- execSync(`git merge ${this._escapeShellArg(execution.branch_name)}`, {
1488
- cwd: this.repoPath,
1489
- stdio: "pipe",
1490
- });
1491
- }
1492
- catch (error) {
1493
- // Merge may have failed due to conflicts
1494
- hasConflicts = true;
1495
- }
1496
- // 9. Count files changed
1497
- try {
1498
- const diffOutput = execSync(`git diff --name-only ${this._escapeShellArg(safetyTag)}..HEAD`, {
1499
- cwd: this.repoPath,
1500
- encoding: "utf8",
1501
- stdio: "pipe",
1502
- });
1503
- filesChanged = diffOutput
1504
- .split("\n")
1505
- .filter((line) => line.trim().length > 0).length;
1506
- }
1507
- catch {
1508
- // If merge is in progress, count staged/conflicted files
1509
- const statusOutput = execSync("git diff --name-only --cached", {
1510
- cwd: this.repoPath,
1511
- encoding: "utf8",
1512
- stdio: "pipe",
1513
- });
1514
- filesChanged = statusOutput
1515
- .split("\n")
1516
- .filter((line) => line.trim().length > 0).length;
1517
- }
1518
- // 10. Auto-resolve JSONL conflicts if any
1519
- const jsonlFilesResolved = await this._resolveJSONLConflicts();
1520
- if (jsonlFilesResolved > 0) {
1521
- // Re-check for remaining conflicts
1522
- try {
1523
- const conflictCheck = execSync("git diff --name-only --diff-filter=U", {
1524
- cwd: this.repoPath,
1525
- encoding: "utf8",
1526
- stdio: "pipe",
1527
- });
1528
- hasConflicts = conflictCheck.trim().length > 0;
1529
- }
1530
- catch {
1531
- hasConflicts = false;
1532
- }
1533
- }
1534
- // 11. Check if there are unresolved conflicts
1535
- if (hasConflicts) {
1536
- // Get list of files with conflicts
1537
- let filesWithConflicts = [];
1538
- try {
1539
- const conflictCheck = execSync("git diff --name-only --diff-filter=U", {
1540
- cwd: this.repoPath,
1541
- encoding: "utf8",
1542
- stdio: "pipe",
1543
- });
1544
- filesWithConflicts = conflictCheck
1545
- .trim()
1546
- .split("\n")
1547
- .filter((f) => f.length > 0);
1548
- }
1549
- catch {
1550
- // If command fails, leave empty
1551
- }
1552
- return {
1553
- success: false,
1554
- filesChanged,
1555
- hasConflicts: true,
1556
- filesWithConflicts,
1557
- error: "Merge conflicts detected. Please resolve them manually and commit.",
1558
- cleanupOffered: false,
1559
- };
1560
- }
1561
- // 12. Get the final commit SHA
1562
- const finalCommit = execSync("git rev-parse HEAD", {
1563
- cwd: this.repoPath,
1564
- encoding: "utf8",
1565
- stdio: "pipe",
1566
- }).trim();
1567
- // 13. Restore uncommitted JSONL files with three-way merge
1568
- if (hasUncommittedJsonl) {
1569
- await this._restoreUncommittedJsonl();
1570
- }
1571
- // 14. Return success result
1572
- return {
1573
- success: true,
1574
- finalCommit,
1575
- filesChanged,
1576
- cleanupOffered: true,
1577
- };
1578
- }
1579
- catch (error) {
1580
- // Restore uncommitted JSONL files even on failure (to avoid losing user changes)
1581
- if (hasUncommittedJsonl) {
1582
- try {
1583
- await this._restoreUncommittedJsonl();
1584
- }
1585
- catch (restoreError) {
1586
- console.error("Failed to restore uncommitted JSONL files:", restoreError);
1587
- }
1588
- }
1589
- // Rollback to safety snapshot on failure
1590
- if (safetyTag) {
1591
- try {
1592
- await this._rollbackToSnapshot(execution.target_branch, safetyTag);
1593
- }
1594
- catch (rollbackError) {
1595
- console.error(`Failed to rollback to snapshot ${safetyTag}:`, rollbackError);
1596
- }
1597
- }
1598
- throw new WorktreeSyncError(`Preserve sync failed: ${error.message}`, WorktreeSyncErrorCode.MERGE_FAILED, error);
1599
- }
1600
- }
1601
- }
1602
- //# sourceMappingURL=worktree-sync-service.js.map