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,1694 +0,0 @@
1
- /**
2
- * Execution Service
3
- *
4
- * High-level service for managing issue-to-execution transformations.
5
- * Coordinates between template rendering, worktree management, and workflow execution.
6
- *
7
- * @module services/execution-service
8
- */
9
- import fs from "fs";
10
- import fsPromises from "fs/promises";
11
- import path from "path";
12
- import os from "os";
13
- import * as TOML from "@iarna/toml";
14
- import { ExecutionLifecycleService } from "./execution-lifecycle.js";
15
- import { createExecution, getExecution, updateExecution, } from "./executions.js";
16
- import { randomUUID } from "crypto";
17
- import { execSync } from "child_process";
18
- import { ExecutionLogsStore } from "./execution-logs-store.js";
19
- import { broadcastExecutionUpdate } from "./websocket.js";
20
- import { createExecutorForAgent, } from "../execution/executors/executor-factory.js";
21
- import { AcpExecutorWrapper } from "../execution/executors/acp-executor-wrapper.js";
22
- import { PromptResolver } from "./prompt-resolver.js";
23
- import { execFileNoThrow } from "../utils/execFileNoThrow.js";
24
- import { getNarrationConfig } from "./narration-service.js";
25
- import { readVoiceConfig, isVoiceBroadcastEnabled, } from "../utils/voice-config.js";
26
- /**
27
- * Build worktree context string to append to system prompt.
28
- *
29
- * This helps agents understand they're working in an isolated worktree
30
- * and should only edit files within that worktree.
31
- *
32
- * @param worktreePath - Path to the worktree directory
33
- * @param branchName - Name of the branch in the worktree
34
- * @param repoPath - Path to the main repository
35
- * @returns System prompt context string, or empty string if not in worktree mode
36
- */
37
- function buildWorktreeSystemPromptContext(worktreePath, branchName, repoPath) {
38
- if (!worktreePath) {
39
- return "";
40
- }
41
- return `
42
- ## Worktree Context
43
-
44
- You are working in an **isolated git worktree**, not the main repository.
45
-
46
- - **Worktree path**: ${worktreePath}
47
- - **Branch**: ${branchName || "unknown"}
48
- - **Main repository**: ${repoPath}
49
-
50
- **IMPORTANT**: You MUST only read and edit files within the worktree directory (${worktreePath}).
51
- Do NOT attempt to read or edit files in the main repository (${repoPath}) or any other directory outside the worktree.
52
- All file paths you use should be relative to or within: ${worktreePath}
53
-
54
- This isolation ensures your changes don't affect other work in progress.
55
- `;
56
- }
57
- /**
58
- * ExecutionService
59
- *
60
- * Manages the full lifecycle of issue-based executions:
61
- * - Creating and starting executions with worktree isolation
62
- * - Creating follow-up executions that reuse worktrees
63
- * - Canceling and cleaning up executions
64
- */
65
- export class ExecutionService {
66
- db;
67
- projectId;
68
- lifecycleService;
69
- repoPath;
70
- logsStore;
71
- workerPool;
72
- serverUrl;
73
- /** Active executors by execution ID (for permission responses, etc.) */
74
- activeExecutors = new Map();
75
- /**
76
- * Create a new ExecutionService
77
- *
78
- * @param db - Database instance
79
- * @param projectId - Project ID for WebSocket broadcasts
80
- * @param repoPath - Path to the git repository
81
- * @param lifecycleService - Optional execution lifecycle service (creates one if not provided)
82
- * @param logsStore - Optional execution logs store (creates one if not provided)
83
- * @param workerPool - Optional worker pool for isolated execution processes
84
- */
85
- constructor(db, projectId, repoPath, lifecycleService, logsStore, workerPool) {
86
- this.db = db;
87
- this.projectId = projectId;
88
- this.repoPath = repoPath;
89
- this.lifecycleService =
90
- lifecycleService || new ExecutionLifecycleService(db, repoPath);
91
- this.logsStore = logsStore || new ExecutionLogsStore(db);
92
- this.workerPool = workerPool;
93
- }
94
- /**
95
- * Update the server URL after dynamic port discovery.
96
- * Called by ProjectContext when the actual server port is known.
97
- * Required for project-assistant MCP injection.
98
- */
99
- setServerUrl(serverUrl) {
100
- this.serverUrl = serverUrl;
101
- }
102
- /**
103
- * Create and start execution
104
- *
105
- * Creates an execution record, sets up worktree (if needed), and starts
106
- * workflow execution. Returns the execution record immediately while
107
- * workflow runs in the background.
108
- *
109
- * @param issueId - ID of issue to execute, or null for orchestrator executions
110
- * @param config - Execution configuration
111
- * @param prompt - Rendered prompt to execute
112
- * @param agentType - Type of agent to use (defaults to 'claude-code')
113
- * @param workflowContext - Optional workflow context for workflow-spawned executions
114
- * @returns Created execution record
115
- */
116
- async createExecution(issueId, config, prompt, agentType = "claude-code", workflowContext) {
117
- // 1. Validate
118
- if (!prompt.trim()) {
119
- throw new Error("Prompt cannot be empty");
120
- }
121
- // 2. Build execution config with auto-injected MCP servers
122
- const mergedConfig = await this.buildExecutionConfig(agentType, config);
123
- // Get issue if issueId is provided (orchestrator executions don't have an issue)
124
- let issue;
125
- if (issueId) {
126
- issue = this.db
127
- .prepare("SELECT * FROM issues WHERE id = ?")
128
- .get(issueId);
129
- if (!issue) {
130
- throw new Error(`Issue ${issueId} not found`);
131
- }
132
- }
133
- // Get the current branch as default (instead of hardcoding "main")
134
- let defaultBranch = "main";
135
- try {
136
- defaultBranch = execSync("git rev-parse --abbrev-ref HEAD", {
137
- cwd: this.repoPath,
138
- encoding: "utf-8",
139
- }).trim();
140
- }
141
- catch {
142
- // Fall back to "main" if we can't determine current branch
143
- }
144
- // 3. Determine execution mode and create execution with worktree
145
- // Store the original (unexpanded) prompt in the database
146
- const mode = mergedConfig.mode || "worktree";
147
- let execution;
148
- let workDir;
149
- // Worktree mode requires either an issue or a reuseWorktreePath
150
- if (mode === "worktree" && !issueId && !mergedConfig.reuseWorktreePath) {
151
- throw new Error("Worktree mode requires either an issueId or reuseWorktreePath");
152
- }
153
- if (mode === "worktree" && (issueId || mergedConfig.reuseWorktreePath)) {
154
- // Check if we're reusing an existing worktree
155
- if (mergedConfig.reuseWorktreePath) {
156
- // Validate worktree exists
157
- if (!fs.existsSync(mergedConfig.reuseWorktreePath)) {
158
- throw new Error(`Cannot reuse worktree: path does not exist: ${mergedConfig.reuseWorktreePath}`);
159
- }
160
- // Validate it's a git worktree by checking for .git
161
- const gitPath = path.join(mergedConfig.reuseWorktreePath, ".git");
162
- if (!fs.existsSync(gitPath)) {
163
- throw new Error(`Cannot reuse worktree: not a valid git worktree: ${mergedConfig.reuseWorktreePath}`);
164
- }
165
- // Get branch name from the worktree
166
- let branchName;
167
- try {
168
- branchName = execSync("git rev-parse --abbrev-ref HEAD", {
169
- cwd: mergedConfig.reuseWorktreePath,
170
- encoding: "utf-8",
171
- }).trim();
172
- }
173
- catch {
174
- throw new Error(`Cannot reuse worktree: failed to get branch name from: ${mergedConfig.reuseWorktreePath}`);
175
- }
176
- // Capture before_commit from the reused worktree
177
- let beforeCommit;
178
- try {
179
- beforeCommit = execSync("git rev-parse HEAD", {
180
- cwd: mergedConfig.reuseWorktreePath,
181
- encoding: "utf-8",
182
- }).trim();
183
- console.log(`[ExecutionService] Captured before_commit for reused worktree: ${beforeCommit}`);
184
- }
185
- catch (error) {
186
- console.warn("[ExecutionService] Failed to capture before_commit for reused worktree:", error instanceof Error ? error.message : String(error));
187
- // Continue - this is supplementary data
188
- }
189
- // Create execution record with the reused worktree path
190
- const executionId = randomUUID();
191
- execution = createExecution(this.db, {
192
- id: executionId,
193
- issue_id: issueId,
194
- agent_type: agentType,
195
- mode: mode,
196
- prompt: prompt,
197
- config: JSON.stringify(mergedConfig),
198
- target_branch: mergedConfig.baseBranch || branchName,
199
- branch_name: branchName,
200
- worktree_path: mergedConfig.reuseWorktreePath,
201
- parent_execution_id: mergedConfig.parentExecutionId,
202
- before_commit: beforeCommit,
203
- });
204
- workDir = mergedConfig.reuseWorktreePath;
205
- }
206
- else {
207
- // Create execution with isolated worktree
208
- // This path requires issueId and issue (reuseWorktreePath not provided)
209
- if (!issueId || !issue) {
210
- throw new Error("Creating new worktree requires an issueId (use reuseWorktreePath for issue-less executions)");
211
- }
212
- const result = await this.lifecycleService.createExecutionWithWorktree({
213
- issueId,
214
- issueTitle: issue.title,
215
- agentType: agentType,
216
- targetBranch: mergedConfig.baseBranch || defaultBranch,
217
- repoPath: this.repoPath,
218
- mode: mode,
219
- prompt: prompt, // Store original (unexpanded) prompt
220
- config: JSON.stringify(mergedConfig),
221
- createTargetBranch: mergedConfig.createBaseBranch || false,
222
- parentExecutionId: mergedConfig.parentExecutionId,
223
- });
224
- execution = result.execution;
225
- workDir = result.worktreePath;
226
- }
227
- }
228
- else {
229
- // Local mode - create execution without worktree
230
- const executionId = randomUUID();
231
- execution = createExecution(this.db, {
232
- id: executionId,
233
- issue_id: issueId,
234
- agent_type: agentType,
235
- mode: mode,
236
- prompt: prompt, // Store original (unexpanded) prompt
237
- config: JSON.stringify(mergedConfig),
238
- target_branch: mergedConfig.baseBranch || defaultBranch,
239
- branch_name: mergedConfig.baseBranch || defaultBranch,
240
- parent_execution_id: mergedConfig.parentExecutionId,
241
- });
242
- workDir = this.repoPath;
243
- // Capture current commit as before_commit for local mode
244
- try {
245
- const beforeCommit = execSync("git rev-parse HEAD", {
246
- cwd: this.repoPath,
247
- encoding: "utf-8",
248
- }).trim();
249
- updateExecution(this.db, executionId, {
250
- before_commit: beforeCommit,
251
- });
252
- // Reload execution to get updated before_commit
253
- const updatedExecution = getExecution(this.db, executionId);
254
- if (updatedExecution) {
255
- execution = updatedExecution;
256
- }
257
- }
258
- catch (error) {
259
- console.warn("[ExecutionService] Failed to capture before_commit for local mode:", error instanceof Error ? error.message : String(error));
260
- // Continue - this is supplementary data
261
- }
262
- }
263
- // 3. Update workflow context if provided
264
- if (workflowContext) {
265
- updateExecution(this.db, execution.id, {
266
- workflow_execution_id: workflowContext.workflowId,
267
- });
268
- // Reload execution to get updated workflow_execution_id
269
- const updatedExecution = getExecution(this.db, execution.id);
270
- if (updatedExecution) {
271
- execution = updatedExecution;
272
- }
273
- }
274
- // 4. Resolve prompt references for execution (done after storing original)
275
- // Pass the issue ID so the issue content is automatically included even if not explicitly mentioned
276
- const resolver = new PromptResolver(this.db);
277
- const { resolvedPrompt, errors } = await resolver.resolve(prompt, new Set(), issueId ?? undefined);
278
- if (errors.length > 0) {
279
- console.warn(`[ExecutionService] Prompt resolution warnings:`, errors);
280
- }
281
- // Initialize empty logs for this execution
282
- try {
283
- this.logsStore.initializeLogs(execution.id);
284
- }
285
- catch (error) {
286
- console.error("[ExecutionService] Failed to initialize logs (non-critical):", {
287
- executionId: execution.id,
288
- error: error instanceof Error ? error.message : String(error),
289
- });
290
- // Don't fail execution creation - logs are nice-to-have
291
- }
292
- // 3. Start execution (use worker pool if available, otherwise fall back to in-process)
293
- if (this.workerPool) {
294
- // Worker pool handles all execution logic in isolated process
295
- const dbPath = this.db.name;
296
- await this.workerPool.startExecution(execution, this.repoPath, dbPath);
297
- // Broadcast execution creation
298
- broadcastExecutionUpdate(this.projectId, execution.id, "created", execution, execution.issue_id || undefined);
299
- return execution;
300
- }
301
- // 4. In-process execution with executor wrapper (fallback when no worker pool)
302
- // Extract agent-relevant config fields (exclude sudocode-specific fields like mode,
303
- // baseBranch, createBaseBranch, branchName, reuseWorktreePath, etc.)
304
- const { mode: _mode, baseBranch: _baseBranch, createBaseBranch: _createBaseBranch, branchName: _branchName, reuseWorktreePath: _reuseWorktreePath, checkpointInterval: _checkpointInterval, continueOnStepFailure: _continueOnStepFailure, captureFileChanges: _captureFileChanges, captureToolCalls: _captureToolCalls, narrationConfig, ...agentConfig } = mergedConfig;
305
- // Read voice config to determine if voice narration broadcasts are enabled
306
- // Also get narration settings (narrateToolUse, narrateAssistantMessages, etc.)
307
- const voiceConfig = readVoiceConfig(this.repoPath);
308
- const voiceEnabled = isVoiceBroadcastEnabled(voiceConfig);
309
- const voiceNarrationSettings = getNarrationConfig(voiceConfig);
310
- const wrapper = createExecutorForAgent(agentType, {
311
- workDir: this.repoPath,
312
- ...agentConfig,
313
- }, {
314
- workDir: this.repoPath,
315
- lifecycleService: this.lifecycleService,
316
- logsStore: this.logsStore,
317
- projectId: this.projectId,
318
- db: this.db,
319
- // Merge narration config: voiceSettings from config.json, then execution overrides, then enabled flag
320
- narrationConfig: {
321
- ...voiceNarrationSettings,
322
- ...narrationConfig,
323
- enabled: voiceEnabled,
324
- },
325
- });
326
- // Log incoming config for debugging
327
- console.log("[ExecutionService] createExecution mergedConfig:", {
328
- hasMcpServers: !!mergedConfig.mcpServers,
329
- mcpServerNames: mergedConfig.mcpServers
330
- ? Object.keys(mergedConfig.mcpServers)
331
- : "none",
332
- hasAppendSystemPrompt: !!mergedConfig.appendSystemPrompt,
333
- dangerouslySkipPermissions: mergedConfig.dangerouslySkipPermissions,
334
- });
335
- // Log agentConfig being passed to executor
336
- console.log("[ExecutionService] agentConfig passed to executor:", {
337
- hasMcpServers: !!agentConfig.mcpServers,
338
- mcpServerNames: agentConfig.mcpServers
339
- ? Object.keys(agentConfig.mcpServers)
340
- : "none",
341
- hasAppendSystemPrompt: !!agentConfig.appendSystemPrompt,
342
- dangerouslySkipPermissions: agentConfig
343
- .dangerouslySkipPermissions,
344
- allKeys: Object.keys(agentConfig),
345
- });
346
- // Build worktree context for system prompt (if in worktree mode)
347
- const worktreeContext = buildWorktreeSystemPromptContext(execution.worktree_path ?? undefined, execution.branch_name ?? undefined, this.repoPath);
348
- // Merge worktree context with any existing appendSystemPrompt
349
- const combinedAppendSystemPrompt = [
350
- worktreeContext,
351
- mergedConfig.appendSystemPrompt || "",
352
- ]
353
- .filter(Boolean)
354
- .join("\n");
355
- // Build execution task (prompt already resolved above)
356
- const task = {
357
- id: execution.id,
358
- type: "issue",
359
- entityId: issueId ?? undefined,
360
- prompt: resolvedPrompt,
361
- workDir: workDir,
362
- config: {
363
- timeout: mergedConfig.timeout,
364
- },
365
- metadata: {
366
- model: mergedConfig.model || "claude-sonnet-4",
367
- captureFileChanges: mergedConfig.captureFileChanges ?? true,
368
- captureToolCalls: mergedConfig.captureToolCalls ?? true,
369
- issueId: issueId ?? undefined,
370
- executionId: execution.id,
371
- mcpServers: mergedConfig.mcpServers,
372
- appendSystemPrompt: combinedAppendSystemPrompt || undefined,
373
- dangerouslySkipPermissions: mergedConfig.dangerouslySkipPermissions,
374
- resume: mergedConfig.resume,
375
- },
376
- priority: 0,
377
- dependencies: [],
378
- createdAt: new Date(),
379
- };
380
- console.log("[ExecutionService] Task metadata mcpServers:", {
381
- hasMcpServers: !!task.metadata?.mcpServers,
382
- mcpServerNames: task.metadata?.mcpServers
383
- ? Object.keys(task.metadata.mcpServers)
384
- : "none",
385
- });
386
- // Store executor for interactive operations (permission responses, etc.)
387
- this.activeExecutors.set(execution.id, wrapper);
388
- // Execute with full lifecycle management (non-blocking)
389
- wrapper
390
- .executeWithLifecycle(execution.id, task, workDir, {
391
- sessionMode: mergedConfig.sessionMode,
392
- sessionEndMode: mergedConfig.sessionEndMode,
393
- })
394
- .catch((error) => {
395
- console.error(`[ExecutionService] Execution ${execution.id} failed:`, error);
396
- // Error is already handled by wrapper (status updated, broadcasts sent)
397
- })
398
- .finally(() => {
399
- // Don't cleanup persistent sessions that are still active
400
- if (wrapper instanceof AcpExecutorWrapper &&
401
- wrapper.isPersistentSession(execution.id)) {
402
- console.log(`[ExecutionService] Keeping executor for active persistent session ${execution.id}`);
403
- return;
404
- }
405
- // Cleanup executor from active map for discrete sessions or ended persistent sessions
406
- this.activeExecutors.delete(execution.id);
407
- });
408
- // Broadcast execution creation
409
- broadcastExecutionUpdate(this.projectId, execution.id, "created", execution, execution.issue_id || undefined);
410
- return execution;
411
- }
412
- /**
413
- * Create follow-up execution
414
- *
415
- * For worktree-based executions: reuses the worktree and resumes the session.
416
- * For local/non-worktree executions: creates a new execution with feedback context.
417
- *
418
- * @param executionId - ID of previous execution to follow up on
419
- * @param feedback - Additional feedback/context to append to prompt
420
- * @param options - Optional configuration
421
- * @param options.includeOriginalPrompt - Whether to prepend the original issue content (default: false, assumes session resumption with full history)
422
- * @returns Created follow-up execution record
423
- */
424
- async createFollowUp(executionId, feedback, options) {
425
- // 1. Get previous execution
426
- const prevExecution = getExecution(this.db, executionId);
427
- if (!prevExecution) {
428
- throw new Error(`Execution ${executionId} not found`);
429
- }
430
- const hasWorktree = !!prevExecution.worktree_path;
431
- // For worktree executions, check if worktree still exists on filesystem, recreate if needed
432
- if (hasWorktree && this.lifecycleService) {
433
- const fs = await import("fs");
434
- const worktreeExists = fs.existsSync(prevExecution.worktree_path);
435
- if (!worktreeExists) {
436
- console.log(`Recreating worktree for follow-up execution: ${prevExecution.worktree_path}`);
437
- // Recreate the worktree using the same path and branch
438
- const worktreeManager = this.lifecycleService.worktreeManager;
439
- await worktreeManager.createWorktree({
440
- repoPath: this.repoPath,
441
- branchName: prevExecution.branch_name,
442
- worktreePath: prevExecution.worktree_path,
443
- baseBranch: prevExecution.target_branch,
444
- createBranch: false, // Branch already exists, just recreate worktree
445
- });
446
- }
447
- }
448
- // TODO: Make it so follow-ups don't require an issue id.
449
- // 2. Build follow-up prompt (default: just feedback, assumes session resumption)
450
- let followUpPrompt = feedback;
451
- if (options?.includeOriginalPrompt) {
452
- // Optional: include original issue content if explicitly requested
453
- if (!prevExecution.issue_id) {
454
- throw new Error("Previous execution must have an issue_id to include original prompt");
455
- }
456
- // Get issue content directly from database
457
- const issue = this.db
458
- .prepare("SELECT content FROM issues WHERE id = ?")
459
- .get(prevExecution.issue_id);
460
- if (!issue) {
461
- throw new Error(`Issue ${prevExecution.issue_id} not found`);
462
- }
463
- followUpPrompt = `${issue.content}
464
-
465
- ${feedback}`;
466
- }
467
- // 3. Create new execution record that references previous execution
468
- // Default to 'claude-code' if agent_type is null (for backwards compatibility)
469
- const agentType = (prevExecution.agent_type || "claude-code");
470
- // Determine working directory: worktree path if available, otherwise repo path (local mode)
471
- const workDir = hasWorktree ? prevExecution.worktree_path : this.repoPath;
472
- const newExecutionId = randomUUID();
473
- // Merge config: parent config + any overrides (for features like skip-all-permissions)
474
- // Deep merge agentConfig to preserve existing settings while applying overrides
475
- let mergedConfigForStorage = prevExecution.config;
476
- if (options?.configOverrides) {
477
- const parentConfig = prevExecution.config
478
- ? JSON.parse(prevExecution.config)
479
- : {};
480
- const overrides = options.configOverrides;
481
- // Deep merge agentConfig if both parent and overrides have it
482
- const mergedAgentConfig = parentConfig.agentConfig || overrides.agentConfig
483
- ? {
484
- ...(parentConfig.agentConfig || {}),
485
- ...(overrides.agentConfig || {}),
486
- }
487
- : undefined;
488
- mergedConfigForStorage = JSON.stringify({
489
- ...parentConfig,
490
- ...overrides,
491
- ...(mergedAgentConfig ? { agentConfig: mergedAgentConfig } : {}),
492
- });
493
- }
494
- const newExecution = createExecution(this.db, {
495
- id: newExecutionId,
496
- issue_id: prevExecution.issue_id,
497
- agent_type: agentType, // Use same agent as previous execution
498
- mode: prevExecution.mode || (hasWorktree ? "worktree" : "local"), // Inherit mode from parent
499
- target_branch: prevExecution.target_branch,
500
- branch_name: prevExecution.branch_name,
501
- worktree_path: prevExecution.worktree_path || undefined, // Reuse same worktree (undefined for local)
502
- config: mergedConfigForStorage || undefined, // Preserve config with any overrides
503
- parent_execution_id: executionId, // Link to parent execution for follow-up chain
504
- prompt: followUpPrompt, // Store original (unexpanded) follow-up prompt
505
- });
506
- // Initialize empty logs for this execution
507
- try {
508
- this.logsStore.initializeLogs(newExecution.id);
509
- }
510
- catch (error) {
511
- console.error("[ExecutionService] Failed to initialize logs (non-critical):", {
512
- executionId: newExecution.id,
513
- error: error instanceof Error ? error.message : String(error),
514
- });
515
- // Don't fail execution creation - logs are nice-to-have
516
- }
517
- // Collect already-expanded entities from parent execution chain
518
- const alreadyExpandedIds = await this.collectExpandedEntitiesFromChain(executionId);
519
- // Resolve prompt references for execution (done after storing original)
520
- // Skip entities that were already expanded in parent executions
521
- const resolver = new PromptResolver(this.db);
522
- const { resolvedPrompt, errors } = await resolver.resolve(followUpPrompt, alreadyExpandedIds);
523
- if (errors.length > 0) {
524
- console.warn(`[ExecutionService] Follow-up prompt resolution warnings:`, errors);
525
- }
526
- // Parse config to get model and other settings
527
- // This is done early so we can pass it to the executor
528
- // Merge any config overrides provided (e.g., for skip-all-permissions)
529
- // Deep merge agentConfig to preserve existing settings
530
- const parentConfigForExecutor = prevExecution.config
531
- ? JSON.parse(prevExecution.config)
532
- : {};
533
- const overridesForExecutor = options?.configOverrides || {};
534
- const mergedAgentConfigForExecutor = parentConfigForExecutor.agentConfig || overridesForExecutor.agentConfig
535
- ? {
536
- ...(parentConfigForExecutor.agentConfig || {}),
537
- ...(overridesForExecutor.agentConfig ||
538
- {}),
539
- }
540
- : undefined;
541
- const parsedConfig = {
542
- ...parentConfigForExecutor,
543
- ...overridesForExecutor,
544
- ...(mergedAgentConfigForExecutor
545
- ? { agentConfig: mergedAgentConfigForExecutor }
546
- : {}),
547
- };
548
- // 4. Use executor wrapper with session resumption
549
- // IMPORTANT: Pass the full config from parent execution to preserve mcpServers,
550
- // dangerouslySkipPermissions, appendSystemPrompt, and other settings
551
- // Extract agent-relevant config fields (exclude sudocode-specific fields)
552
- const { mode: _mode, baseBranch: _baseBranch, createBaseBranch: _createBaseBranch, branchName: _branchName, reuseWorktreePath: _reuseWorktreePath, checkpointInterval: _checkpointInterval, continueOnStepFailure: _continueOnStepFailure, captureFileChanges: _captureFileChanges, captureToolCalls: _captureToolCalls, narrationConfig: parentNarrationConfig, ...parentAgentConfig } = parsedConfig;
553
- // Read voice config to determine if voice narration broadcasts are enabled
554
- // Also get narration settings (narrateToolUse, narrateAssistantMessages, etc.)
555
- const voiceConfig = readVoiceConfig(this.repoPath);
556
- const voiceEnabled = isVoiceBroadcastEnabled(voiceConfig);
557
- const voiceNarrationSettings = getNarrationConfig(voiceConfig);
558
- const sessionId = prevExecution.session_id;
559
- const wrapper = createExecutorForAgent(agentType, {
560
- workDir: this.repoPath,
561
- ...parentAgentConfig,
562
- }, {
563
- workDir: this.repoPath,
564
- lifecycleService: this.lifecycleService,
565
- logsStore: this.logsStore,
566
- projectId: this.projectId,
567
- db: this.db,
568
- // Merge narration config: voiceSettings from config.json, then execution overrides, then enabled flag
569
- narrationConfig: {
570
- ...voiceNarrationSettings,
571
- ...parentNarrationConfig,
572
- enabled: voiceEnabled,
573
- },
574
- isResume: true,
575
- sessionId: sessionId ?? undefined,
576
- });
577
- if (!sessionId) {
578
- console.warn(`[ExecutionService] No session_id found for execution ${executionId}, follow-up will start a new session`);
579
- }
580
- // Build worktree context for system prompt (if in worktree mode)
581
- const followUpWorktreeContext = buildWorktreeSystemPromptContext(newExecution.worktree_path ?? undefined, newExecution.branch_name ?? undefined, this.repoPath);
582
- // Merge worktree context with any existing appendSystemPrompt from parent config
583
- const followUpCombinedAppendSystemPrompt = [
584
- followUpWorktreeContext,
585
- parsedConfig.appendSystemPrompt || "",
586
- ]
587
- .filter(Boolean)
588
- .join("\n");
589
- // Build execution task for follow-up (use resolved prompt for agent)
590
- // IMPORTANT: Inherit ALL config from parent execution
591
- // This ensures orchestrator follow-ups retain dangerouslySkipPermissions, mcpServers,
592
- // appendSystemPrompt, and any other config fields
593
- const task = {
594
- id: newExecution.id,
595
- type: "issue",
596
- entityId: prevExecution.issue_id ?? undefined,
597
- prompt: resolvedPrompt,
598
- workDir: workDir,
599
- config: {
600
- timeout: parsedConfig.timeout,
601
- },
602
- metadata: {
603
- // Spread all config fields from parent execution first
604
- ...parsedConfig,
605
- // Then override specific fields for this follow-up
606
- model: parsedConfig.model || "claude-sonnet-4",
607
- captureFileChanges: parsedConfig.captureFileChanges ?? true,
608
- captureToolCalls: parsedConfig.captureToolCalls ?? true,
609
- issueId: prevExecution.issue_id ?? undefined,
610
- executionId: newExecution.id,
611
- followUpOf: executionId,
612
- // Override appendSystemPrompt with combined worktree context
613
- appendSystemPrompt: followUpCombinedAppendSystemPrompt || undefined,
614
- },
615
- priority: 0,
616
- dependencies: [],
617
- createdAt: new Date(),
618
- };
619
- console.log("[ExecutionService] Follow-up task metadata:", {
620
- executionId: newExecution.id,
621
- parentExecutionId: executionId,
622
- inheritedConfigKeys: Object.keys(parsedConfig),
623
- hasMcpServers: !!parsedConfig.mcpServers,
624
- mcpServerNames: parsedConfig.mcpServers
625
- ? Object.keys(parsedConfig.mcpServers)
626
- : "none",
627
- dangerouslySkipPermissions: parsedConfig.dangerouslySkipPermissions,
628
- hasAppendSystemPrompt: !!parsedConfig.appendSystemPrompt,
629
- model: parsedConfig.model,
630
- sessionMode: parsedConfig.sessionMode ?? "discrete",
631
- });
632
- // Store executor for interactive operations (permission responses, etc.)
633
- this.activeExecutors.set(newExecution.id, wrapper);
634
- // Execute follow-up (non-blocking)
635
- // If we have a session ID, resume the session; otherwise start a new one
636
- const cleanupExecutor = () => {
637
- // Don't cleanup persistent sessions that are still active
638
- if (wrapper instanceof AcpExecutorWrapper &&
639
- wrapper.isPersistentSession(newExecution.id)) {
640
- console.log(`[ExecutionService] Keeping executor for active persistent session ${newExecution.id}`);
641
- return;
642
- }
643
- this.activeExecutors.delete(newExecution.id);
644
- };
645
- // Build session mode options from parent config
646
- const sessionModeOptions = {
647
- sessionMode: parsedConfig.sessionMode,
648
- sessionEndMode: parsedConfig.sessionEndMode,
649
- };
650
- if (sessionId) {
651
- wrapper
652
- .resumeWithLifecycle(newExecution.id, sessionId, task, workDir, sessionModeOptions)
653
- .catch((error) => {
654
- console.error(`[ExecutionService] Follow-up execution ${newExecution.id} failed:`, error);
655
- // Error is already handled by wrapper (status updated, broadcasts sent)
656
- })
657
- .finally(cleanupExecutor);
658
- }
659
- else {
660
- // No session to resume, start a new execution with the follow-up prompt
661
- wrapper
662
- .executeWithLifecycle(newExecution.id, task, workDir, sessionModeOptions)
663
- .catch((error) => {
664
- console.error(`[ExecutionService] Follow-up execution ${newExecution.id} failed:`, error);
665
- })
666
- .finally(cleanupExecutor);
667
- }
668
- // Broadcast execution creation
669
- broadcastExecutionUpdate(this.projectId, newExecution.id, "created", newExecution, newExecution.issue_id || undefined);
670
- // Also broadcast to parent execution channel
671
- if (newExecution.parent_execution_id) {
672
- broadcastExecutionUpdate(this.projectId, newExecution.parent_execution_id, "updated", newExecution, newExecution.issue_id || undefined);
673
- }
674
- return newExecution;
675
- }
676
- /**
677
- * Cancel a running execution
678
- *
679
- * Stops the workflow execution and marks the execution as cancelled.
680
- * Optionally cleans up the worktree based on config.
681
- *
682
- * @param executionId - ID of execution to cancel
683
- */
684
- async cancelExecution(executionId) {
685
- const execution = getExecution(this.db, executionId);
686
- if (!execution) {
687
- throw new Error(`Execution ${executionId} not found`);
688
- }
689
- if (execution.status !== "running") {
690
- throw new Error(`Cannot cancel execution in ${execution.status} state`);
691
- }
692
- // Use worker pool cancellation if available
693
- if (this.workerPool && this.workerPool.hasWorker(executionId)) {
694
- await this.workerPool.cancelExecution(executionId);
695
- return; // Worker pool handles DB updates and broadcasts
696
- }
697
- // For in-process executions using AcpExecutorWrapper/LegacyShimExecutorWrapper:
698
- // The wrapper manages its own lifecycle and cancellation.
699
- // We update the database status, which the wrapper may check,
700
- // or we rely on process termination to stop execution.
701
- // Update status in database
702
- updateExecution(this.db, executionId, {
703
- status: "stopped",
704
- completed_at: new Date().toISOString(),
705
- });
706
- // Broadcast status change
707
- const updated = getExecution(this.db, executionId);
708
- if (updated) {
709
- broadcastExecutionUpdate(this.projectId, executionId, "status_changed", updated, updated.issue_id || undefined);
710
- }
711
- }
712
- /**
713
- * Respond to a permission request
714
- *
715
- * For ACP-based executions running in interactive permission mode,
716
- * this forwards the user's response to the agent session.
717
- *
718
- * @param executionId - ID of the execution
719
- * @param requestId - ID of the permission request
720
- * @param optionId - Selected option ID (e.g., 'allow_once', 'reject_always')
721
- * @returns true if the permission was found and responded to
722
- * @throws Error if execution not found or not an ACP execution
723
- */
724
- respondToPermission(executionId, requestId, optionId) {
725
- const executor = this.activeExecutors.get(executionId);
726
- if (!executor) {
727
- throw new Error(`Execution ${executionId} not found or not active`);
728
- }
729
- // Only ACP executors support permission responses
730
- if (!(executor instanceof AcpExecutorWrapper)) {
731
- throw new Error(`Execution ${executionId} is not an ACP execution and does not support permission responses`);
732
- }
733
- return executor.respondToPermission(executionId, requestId, optionId);
734
- }
735
- /**
736
- * Check if an execution has pending permissions
737
- *
738
- * @param executionId - ID of the execution
739
- * @returns true if there are pending permission requests
740
- */
741
- hasPendingPermissions(executionId) {
742
- const executor = this.activeExecutors.get(executionId);
743
- if (!executor || !(executor instanceof AcpExecutorWrapper)) {
744
- return false;
745
- }
746
- return executor.hasPendingPermissions(executionId);
747
- }
748
- /**
749
- * Get pending permission request IDs for an execution
750
- *
751
- * @param executionId - ID of the execution
752
- * @returns Array of pending request IDs
753
- */
754
- getPendingPermissionIds(executionId) {
755
- const executor = this.activeExecutors.get(executionId);
756
- if (!executor || !(executor instanceof AcpExecutorWrapper)) {
757
- return [];
758
- }
759
- return executor.getPendingPermissionIds(executionId);
760
- }
761
- /**
762
- * Set the session mode for an active execution
763
- *
764
- * @param executionId - ID of the execution
765
- * @param mode - The mode to set (e.g., "code", "plan", "architect")
766
- * @returns true if mode was set successfully
767
- * @throws Error if execution not found or not an ACP execution
768
- */
769
- setMode(executionId, mode) {
770
- const executor = this.activeExecutors.get(executionId);
771
- if (!executor) {
772
- throw new Error(`Execution ${executionId} not found or not active`);
773
- }
774
- // Only ACP executors support mode switching
775
- if (!(executor instanceof AcpExecutorWrapper)) {
776
- throw new Error(`Execution ${executionId} is not an ACP execution and does not support mode switching`);
777
- }
778
- return executor.setMode(executionId, mode);
779
- }
780
- /**
781
- * Fork an active execution into a new independent execution
782
- *
783
- * Creates a new execution that inherits the conversation history from the parent
784
- * session. The forked execution runs independently but preserves context.
785
- *
786
- * This is useful for:
787
- * - Exploring alternative approaches without losing progress
788
- * - Creating checkpoint branches for experimentation
789
- * - Parallel exploration of different solutions
790
- *
791
- * @param executionId - ID of the source execution to fork
792
- * @returns The new forked execution record
793
- * @throws Error if execution not found, not active, or not an ACP execution
794
- * @experimental This relies on the unstable session/fork ACP capability
795
- */
796
- async forkExecution(executionId) {
797
- // 1. Get the source execution
798
- const sourceExecution = getExecution(this.db, executionId);
799
- if (!sourceExecution) {
800
- throw new Error(`Execution ${executionId} not found`);
801
- }
802
- // 2. Get the active executor
803
- const executor = this.activeExecutors.get(executionId);
804
- if (!executor) {
805
- throw new Error(`Execution ${executionId} not found or not active`);
806
- }
807
- // 3. Only ACP executors support forking
808
- if (!(executor instanceof AcpExecutorWrapper)) {
809
- throw new Error(`Execution ${executionId} is not an ACP execution and does not support forking`);
810
- }
811
- // 4. Create new execution record linked to the source
812
- const newExecutionId = randomUUID();
813
- const newExecution = createExecution(this.db, {
814
- id: newExecutionId,
815
- issue_id: sourceExecution.issue_id, // Can be null for adhoc executions
816
- agent_type: (sourceExecution.agent_type || "claude-code"),
817
- mode: sourceExecution.mode || "worktree",
818
- prompt: `[Forked from ${executionId}] ${sourceExecution.prompt || ""}`,
819
- config: sourceExecution.config ?? undefined,
820
- target_branch: sourceExecution.target_branch || "main",
821
- branch_name: sourceExecution.branch_name || "main",
822
- worktree_path: sourceExecution.worktree_path ?? undefined,
823
- parent_execution_id: executionId,
824
- });
825
- // 5. Initialize logs for the new execution
826
- try {
827
- this.logsStore.initializeLogs(newExecutionId);
828
- }
829
- catch (error) {
830
- console.error("[ExecutionService] Failed to initialize logs for forked execution:", {
831
- executionId: newExecutionId,
832
- error: error instanceof Error ? error.message : String(error),
833
- });
834
- }
835
- // 6. Fork the session in the executor
836
- const forkedSession = await executor.forkSession(executionId, newExecutionId);
837
- if (!forkedSession) {
838
- // Clean up the execution record if fork failed
839
- this.db
840
- .prepare("DELETE FROM executions WHERE id = ?")
841
- .run(newExecutionId);
842
- throw new Error(`Failed to fork session for execution ${executionId}`);
843
- }
844
- // 7. Store the executor for the forked session
845
- this.activeExecutors.set(newExecutionId, executor);
846
- // 8. Broadcast the new execution
847
- broadcastExecutionUpdate(this.projectId, newExecutionId, "created", newExecution, newExecution.issue_id || undefined);
848
- return newExecution;
849
- }
850
- /**
851
- * Interrupt an active execution
852
- *
853
- * Cancels the current prompt without providing new instructions.
854
- * The session remains valid for follow-up prompts.
855
- *
856
- * @param executionId - ID of the execution to interrupt
857
- * @returns true if interrupted successfully
858
- * @throws Error if execution not found, not active, or not an ACP execution
859
- */
860
- async interruptExecution(executionId) {
861
- const executor = this.activeExecutors.get(executionId);
862
- if (!executor) {
863
- throw new Error(`Execution ${executionId} not found or not active`);
864
- }
865
- // Only ACP executors support interruption
866
- if (!(executor instanceof AcpExecutorWrapper)) {
867
- throw new Error(`Execution ${executionId} is not an ACP execution and does not support interruption`);
868
- }
869
- return executor.cancelSession(executionId);
870
- }
871
- /**
872
- * Interrupt an active execution and continue with new content
873
- *
874
- * Cancels the current prompt and immediately starts processing the new prompt.
875
- * The new prompt's output is streamed to subscribers.
876
- *
877
- * @param executionId - ID of the execution to interrupt
878
- * @param newPrompt - New prompt to continue with
879
- * @throws Error if execution not found, not active, or not an ACP execution
880
- * @experimental This relies on the interruptWith ACP capability
881
- */
882
- async interruptWithPrompt(executionId, newPrompt) {
883
- const executor = this.activeExecutors.get(executionId);
884
- if (!executor) {
885
- throw new Error(`Execution ${executionId} not found or not active`);
886
- }
887
- // Only ACP executors support interruption
888
- if (!(executor instanceof AcpExecutorWrapper)) {
889
- throw new Error(`Execution ${executionId} is not an ACP execution and does not support interruption`);
890
- }
891
- // Consume the generator and broadcast updates
892
- // The executor will handle broadcasting each update
893
- for await (const _update of executor.interruptWithNewPrompt(executionId, newPrompt)) {
894
- // Updates are automatically streamed via the executor's broadcast mechanism
895
- // We consume the generator to drive the iteration
896
- }
897
- }
898
- /**
899
- * Clean up execution resources
900
- *
901
- * Removes the worktree and associated files. This is called automatically
902
- * on workflow completion, or can be called manually.
903
- *
904
- * @param executionId - ID of execution to clean up
905
- */
906
- async cleanupExecution(executionId) {
907
- await this.lifecycleService.cleanupExecution(executionId);
908
- }
909
- /**
910
- * Check if worktree exists in filesystem for an execution
911
- *
912
- * @param executionId - ID of execution to check
913
- * @returns true if worktree exists, false otherwise
914
- */
915
- async worktreeExists(executionId) {
916
- const execution = getExecution(this.db, executionId);
917
- if (!execution || !execution.worktree_path) {
918
- return false;
919
- }
920
- const fs = await import("fs");
921
- return fs.existsSync(execution.worktree_path);
922
- }
923
- /**
924
- * Delete worktree for an execution
925
- *
926
- * Manually deletes the worktree for a specific execution, regardless of
927
- * cleanupMode configuration. This allows users to manually cleanup worktrees
928
- * when they're configured for manual cleanup.
929
- *
930
- * @param executionId - ID of execution whose worktree to delete
931
- * @param deleteBranch - Whether to also delete the execution's branch (default: false)
932
- * @throws Error if execution not found, has no worktree, or worktree doesn't exist
933
- */
934
- async deleteWorktree(executionId, deleteBranch = false) {
935
- const execution = getExecution(this.db, executionId);
936
- if (!execution) {
937
- throw new Error(`Execution ${executionId} not found`);
938
- }
939
- if (!execution.worktree_path) {
940
- throw new Error(`Execution ${executionId} has no worktree to delete`);
941
- }
942
- // Check if worktree exists in the filesystem
943
- const fs = await import("fs");
944
- const worktreeExists = fs.existsSync(execution.worktree_path);
945
- if (!worktreeExists) {
946
- throw new Error(`Worktree does not exist in filesystem: ${execution.worktree_path}`);
947
- }
948
- // TODO: Cancel any running execution.
949
- // Get worktree manager from lifecycle service
950
- const worktreeManager = this.lifecycleService.worktreeManager;
951
- // Clean up the worktree
952
- await worktreeManager.cleanupWorktree(execution.worktree_path, this.repoPath);
953
- // Delete branch if requested and it was created by this execution
954
- if (deleteBranch && execution.branch_name) {
955
- try {
956
- // A branch was created for this execution if:
957
- // - branch_name is DIFFERENT from target_branch (autoCreateBranches was true)
958
- // - This means a new worktree-specific branch was created
959
- const wasCreatedByExecution = execution.branch_name !== execution.target_branch &&
960
- execution.branch_name !== "(detached)";
961
- if (wasCreatedByExecution) {
962
- await worktreeManager.git.deleteBranch(this.repoPath, execution.branch_name, true // Force deletion
963
- );
964
- console.log(`[ExecutionService] Deleted execution-created branch: ${execution.branch_name}`);
965
- }
966
- else {
967
- console.log(`[ExecutionService] Skipping branch deletion - branch ${execution.branch_name} is the target branch (not created by execution)`);
968
- }
969
- }
970
- catch (err) {
971
- console.warn(`Failed to delete branch ${execution.branch_name} during worktree deletion:`, err);
972
- // Continue even if branch deletion fails
973
- }
974
- }
975
- }
976
- /**
977
- * Delete an execution and its entire chain
978
- *
979
- * Deletes the execution and all its follow-ups (descendants).
980
- * Optionally deletes the worktree and/or branch.
981
- *
982
- * @param executionId - ID of execution to delete (can be root or any execution in chain)
983
- * @param deleteBranch - Whether to also delete the execution's branch (default: false)
984
- * @param deleteWorktree - Whether to also delete the execution's worktree (default: false)
985
- * @throws Error if execution not found
986
- */
987
- async deleteExecution(executionId, deleteBranch = false, deleteWorktree = false) {
988
- const execution = getExecution(this.db, executionId);
989
- if (!execution) {
990
- throw new Error(`Execution ${executionId} not found`);
991
- }
992
- // Find the root execution by traversing up parent_execution_id
993
- let rootId = executionId;
994
- let current = execution;
995
- while (current.parent_execution_id) {
996
- rootId = current.parent_execution_id;
997
- const parent = getExecution(this.db, rootId);
998
- if (!parent)
999
- break;
1000
- current = parent;
1001
- }
1002
- // Get all executions in the chain (root + all descendants)
1003
- const chain = this.db
1004
- .prepare(`
1005
- WITH RECURSIVE execution_chain AS (
1006
- -- Base case: the root execution
1007
- SELECT * FROM executions WHERE id = ?
1008
- UNION ALL
1009
- -- Recursive case: children of executions in the chain
1010
- SELECT e.* FROM executions e
1011
- INNER JOIN execution_chain ec ON e.parent_execution_id = ec.id
1012
- )
1013
- SELECT * FROM execution_chain
1014
- `)
1015
- .all(rootId);
1016
- // Cancel any running executions in the chain
1017
- for (const exec of chain) {
1018
- if (exec.status === "running" || exec.status === "pending") {
1019
- try {
1020
- await this.cancelExecution(exec.id);
1021
- }
1022
- catch (err) {
1023
- console.warn(`Failed to cancel execution ${exec.id} during deletion:`, err);
1024
- // Continue with deletion even if cancel fails
1025
- }
1026
- }
1027
- }
1028
- // Delete worktree if requested and it exists (only for root execution)
1029
- const rootExecution = chain.find((e) => e.id === rootId);
1030
- if (deleteWorktree && rootExecution?.worktree_path) {
1031
- try {
1032
- const fs = await import("fs");
1033
- if (fs.existsSync(rootExecution.worktree_path)) {
1034
- await this.deleteWorktree(rootId);
1035
- }
1036
- }
1037
- catch (err) {
1038
- console.warn(`Failed to delete worktree during execution deletion:`, err);
1039
- // Continue with deletion even if worktree cleanup fails
1040
- }
1041
- }
1042
- // Delete branch if requested and it exists
1043
- // IMPORTANT: Only delete branches that were created specifically for this execution
1044
- if (deleteBranch && rootExecution?.branch_name) {
1045
- try {
1046
- // A branch was created for this execution if:
1047
- // - branch_name is DIFFERENT from target_branch (autoCreateBranches was true)
1048
- // - This means a new worktree-specific branch was created
1049
- //
1050
- // A branch was NOT created (reusing existing) if:
1051
- // - branch_name === target_branch (autoCreateBranches was false)
1052
- // - This means the worktree reused the target branch directly
1053
- const wasCreatedByExecution = rootExecution.branch_name !== rootExecution.target_branch &&
1054
- rootExecution.branch_name !== "(detached)";
1055
- if (wasCreatedByExecution) {
1056
- // Get worktree manager from lifecycle service to access git operations
1057
- const worktreeManager = this.lifecycleService
1058
- .worktreeManager;
1059
- await worktreeManager.git.deleteBranch(this.repoPath, rootExecution.branch_name, true // Force deletion
1060
- );
1061
- console.log(`[ExecutionService] Deleted execution-created branch: ${rootExecution.branch_name}`);
1062
- }
1063
- else {
1064
- console.log(`[ExecutionService] Skipping branch deletion - branch ${rootExecution.branch_name} is the target branch (not created by execution)`);
1065
- }
1066
- }
1067
- catch (err) {
1068
- console.warn(`Failed to delete branch ${rootExecution.branch_name} during execution deletion:`, err);
1069
- // Continue with deletion even if branch deletion fails
1070
- }
1071
- }
1072
- // Delete execution logs for all executions in the chain
1073
- for (const exec of chain) {
1074
- try {
1075
- this.logsStore.deleteLogs(exec.id);
1076
- }
1077
- catch (err) {
1078
- console.warn(`Failed to delete logs for execution ${exec.id}:`, err);
1079
- // Continue with deletion even if log cleanup fails
1080
- }
1081
- }
1082
- // Delete all executions in the chain from database
1083
- // Delete in reverse order (children first) to avoid foreign key issues
1084
- const chainIds = chain.map((e) => e.id);
1085
- const placeholders = chainIds.map(() => "?").join(",");
1086
- this.db
1087
- .prepare(`DELETE FROM executions WHERE id IN (${placeholders})`)
1088
- .run(...chainIds);
1089
- // Broadcast deletion event for each execution
1090
- for (const exec of chain) {
1091
- broadcastExecutionUpdate(this.projectId, exec.id, "deleted", { executionId: exec.id }, exec.issue_id || undefined);
1092
- }
1093
- }
1094
- /**
1095
- * Shutdown execution service - cancel all active executions
1096
- *
1097
- * This is called during server shutdown to gracefully terminate
1098
- * all running executions before the server exits.
1099
- */
1100
- async shutdown() {
1101
- // Shutdown worker pool if available
1102
- if (this.workerPool) {
1103
- await this.workerPool.shutdown();
1104
- }
1105
- // For in-process executions using AcpExecutorWrapper/LegacyShimExecutorWrapper:
1106
- // The wrapper manages its own lifecycle. Processes will be terminated
1107
- // when the Node.js process exits.
1108
- }
1109
- /**
1110
- * List all executions for an issue
1111
- *
1112
- * Returns all executions associated with a specific issue,
1113
- * ordered by creation time (most recent first).
1114
- *
1115
- * @param issueId - ID of issue to list executions for
1116
- * @returns Array of executions for the issue
1117
- */
1118
- listExecutions(issueId) {
1119
- const executions = this.db
1120
- .prepare(`
1121
- SELECT * FROM executions
1122
- WHERE issue_id = ?
1123
- ORDER BY created_at DESC
1124
- `)
1125
- .all(issueId);
1126
- return executions;
1127
- }
1128
- /**
1129
- * Get a single execution by ID
1130
- *
1131
- * @param executionId - ID of execution to retrieve
1132
- * @returns Execution or null if not found
1133
- */
1134
- getExecution(executionId) {
1135
- return getExecution(this.db, executionId);
1136
- }
1137
- /**
1138
- * List all executions with filtering and pagination
1139
- *
1140
- * Returns executions across all issues with support for filtering
1141
- * by status, issueId, and pagination.
1142
- *
1143
- * @param options - Filtering and pagination options
1144
- * @param options.limit - Maximum number of executions to return (default: 50)
1145
- * @param options.offset - Number of executions to skip (default: 0)
1146
- * @param options.status - Filter by execution status (single or array)
1147
- * @param options.issueId - Filter by issue ID
1148
- * @param options.sortBy - Field to sort by (default: 'created_at')
1149
- * @param options.order - Sort order (default: 'desc')
1150
- * @param options.since - Only return executions created after this ISO date
1151
- * @param options.includeRunning - When used with 'since', also include running executions regardless of age
1152
- * @returns Object containing executions array, total count, and hasMore flag
1153
- */
1154
- listAll(options = {}) {
1155
- const limit = options.limit ?? 50;
1156
- const offset = options.offset ?? 0;
1157
- const sortBy = options.sortBy ?? "created_at";
1158
- const order = options.order ?? "desc";
1159
- // Validate inputs
1160
- if (limit < 0 || offset < 0) {
1161
- throw new Error("Limit and offset must be non-negative");
1162
- }
1163
- // Build WHERE clause dynamically
1164
- const whereClauses = [];
1165
- const params = [];
1166
- // Filter by status (single or array)
1167
- if (options.status) {
1168
- const statuses = Array.isArray(options.status)
1169
- ? options.status
1170
- : [options.status];
1171
- const placeholders = statuses.map(() => "?").join(",");
1172
- whereClauses.push(`status IN (${placeholders})`);
1173
- params.push(...statuses);
1174
- }
1175
- // Filter by issueId
1176
- if (options.issueId) {
1177
- whereClauses.push("issue_id = ?");
1178
- params.push(options.issueId);
1179
- }
1180
- // Filter by since date (with optional includeRunning)
1181
- if (options.since) {
1182
- if (options.includeRunning) {
1183
- // Include executions created after 'since' OR that are currently running
1184
- whereClauses.push("(created_at >= ? OR status = 'running')");
1185
- params.push(options.since);
1186
- }
1187
- else {
1188
- // Only include executions created after 'since'
1189
- whereClauses.push("created_at >= ?");
1190
- params.push(options.since);
1191
- }
1192
- }
1193
- // Filter by tags (stored in config JSON field)
1194
- // Uses json_each to check if any of the specified tags exist in config.tags array
1195
- if (options.tags && options.tags.length > 0) {
1196
- const tagConditions = options.tags
1197
- .map(() => "EXISTS (SELECT 1 FROM json_each(json_extract(config, '$.tags')) WHERE value = ?)")
1198
- .join(" OR ");
1199
- whereClauses.push(`(${tagConditions})`);
1200
- params.push(...options.tags);
1201
- }
1202
- // Build WHERE clause
1203
- const whereClause = whereClauses.length > 0 ? `WHERE ${whereClauses.join(" AND ")}` : "";
1204
- // Get total count
1205
- const countQuery = `SELECT COUNT(*) as count FROM executions ${whereClause}`;
1206
- const countResult = this.db.prepare(countQuery).get(...params);
1207
- const total = countResult.count;
1208
- // Get executions with pagination
1209
- const query = `
1210
- SELECT * FROM executions
1211
- ${whereClause}
1212
- ORDER BY ${sortBy} ${order.toUpperCase()}
1213
- LIMIT ? OFFSET ?
1214
- `;
1215
- const executions = this.db
1216
- .prepare(query)
1217
- .all(...params, limit, offset);
1218
- // Calculate hasMore
1219
- const hasMore = offset + executions.length < total;
1220
- return {
1221
- executions,
1222
- total,
1223
- hasMore,
1224
- };
1225
- }
1226
- /**
1227
- * Check if there are any active executions
1228
- *
1229
- * @returns true if there are active worker pool executions
1230
- */
1231
- hasActiveExecutions() {
1232
- // Check worker pool for active executions
1233
- if (this.workerPool) {
1234
- return this.workerPool.getActiveWorkerCount() > 0;
1235
- }
1236
- // For in-process executions, we don't track them anymore
1237
- // Query the database for running executions as a fallback
1238
- const runningExecutions = this.db
1239
- .prepare("SELECT COUNT(*) as count FROM executions WHERE status = 'running'")
1240
- .get();
1241
- return runningExecutions.count > 0;
1242
- }
1243
- /**
1244
- * Collect entity IDs that were already expanded in parent executions
1245
- *
1246
- * Walks the execution chain backwards and resolves each prompt to extract
1247
- * which entities were referenced (and thus expanded) in previous executions.
1248
- * This prevents redundant expansion of the same entities in follow-ups.
1249
- *
1250
- * @param executionId - ID of the current execution
1251
- * @returns Set of entity IDs that were already expanded
1252
- */
1253
- async collectExpandedEntitiesFromChain(executionId) {
1254
- const expandedIds = new Set();
1255
- const resolver = new PromptResolver(this.db);
1256
- // Walk backwards through the execution chain
1257
- let currentExecId = executionId;
1258
- while (currentExecId) {
1259
- const execution = getExecution(this.db, currentExecId);
1260
- if (!execution || !execution.prompt)
1261
- break;
1262
- // Resolve the prompt to extract what entities were referenced
1263
- // Pass empty set so we expand everything in this pass (just to collect IDs)
1264
- // Pass the execution's issue_id as implicit to track if it was auto-included
1265
- const { expandedEntityIds } = await resolver.resolve(execution.prompt, new Set(), execution.issue_id || undefined);
1266
- // Add all expanded entity IDs from this execution
1267
- expandedEntityIds.forEach((id) => expandedIds.add(id));
1268
- // Move to parent execution
1269
- currentExecId = execution.parent_execution_id || null;
1270
- }
1271
- return expandedIds;
1272
- }
1273
- /**
1274
- * Build execution config with auto-injected MCP servers
1275
- *
1276
- * This method handles the auto-injection of sudocode-mcp into the execution config
1277
- * when it's not already configured. It:
1278
- * 1. Checks if sudocode-mcp package is installed (throws error if not)
1279
- * 2. Checks if the agent already has sudocode-mcp configured
1280
- * 3. Auto-injects sudocode-mcp to mcpServers if needed
1281
- * 4. Preserves all user-provided MCP servers
1282
- *
1283
- * @param agentType - The type of agent to execute
1284
- * @param userConfig - User-provided execution configuration
1285
- * @returns Merged execution configuration with auto-injected MCP servers
1286
- * @throws Error if sudocode-mcp package is not installed
1287
- */
1288
- async buildExecutionConfig(agentType, userConfig) {
1289
- // Start with user config
1290
- const mergedConfig = { ...userConfig };
1291
- // 1. Detect if sudocode-mcp package is installed
1292
- const isInstalled = await this.detectSudocodeMcp();
1293
- if (!isInstalled) {
1294
- throw new Error("sudocode-mcp package not found. Please install sudocode to enable MCP tools.\nVisit: https://github.com/sudocode-ai/sudocode");
1295
- }
1296
- // 2. Check if agent already has sudocode-mcp configured
1297
- const mcpPresent = await this.detectAgentMcp(agentType);
1298
- // 3. For Cursor, MCP must be configured via .cursor/mcp.json (no CLI injection available)
1299
- // If not configured, log a warning and skip MCP injection instead of failing
1300
- if (agentType === "cursor" && !mcpPresent) {
1301
- console.warn("[ExecutionService] Cursor agent does not have sudocode-mcp configured.\n" +
1302
- "To enable MCP tools, create .cursor/mcp.json in your project root with:\n\n" +
1303
- JSON.stringify({
1304
- mcpServers: {
1305
- "sudocode-mcp": {
1306
- command: "sudocode-mcp",
1307
- },
1308
- },
1309
- }, null, 2) +
1310
- "\n\nVisit: https://github.com/sudocode-ai/sudocode");
1311
- // Skip MCP injection for Cursor - return config as-is
1312
- return mergedConfig;
1313
- }
1314
- // For Cursor with sudocode-mcp, auto-approve MCP servers in headless mode
1315
- if (agentType === "cursor" && mcpPresent) {
1316
- console.info("[ExecutionService] Enabling approveMcps for Cursor (sudocode-mcp detected)");
1317
- mergedConfig.approveMcps = true;
1318
- }
1319
- // 4. Auto-inject sudocode-mcp if not configured and not already in userConfig
1320
- // When tagged with 'project-assistant', add extended scopes to the MCP server
1321
- const isProjectAssistant = userConfig.tags?.includes("project-assistant");
1322
- // TODO: Build scope list incrementally instead of per-use case.
1323
- if (!mcpPresent && !userConfig.mcpServers?.["sudocode-mcp"]) {
1324
- // Build args for sudocode-mcp based on tags, server availability, and narration config
1325
- const mcpArgs = [];
1326
- // Check if narration is enabled - if so, we'll add the voice scope
1327
- const narrationEnabled = userConfig.narrationConfig?.enabled ?? false;
1328
- if (isProjectAssistant) {
1329
- if (this.serverUrl) {
1330
- // Build scope list: start with "all" and optionally add "voice"
1331
- const scopes = narrationEnabled ? "all,voice" : "all";
1332
- // Enable project-assistant scope with server URL for extended tools
1333
- mcpArgs.push("--scope", scopes, "--server-url", this.serverUrl, "--project-id", this.projectId);
1334
- console.info(`[ExecutionService] Adding sudocode-mcp with scopes: ${scopes} (auto-injection)`);
1335
- }
1336
- else {
1337
- console.warn("[ExecutionService] Cannot enable project-assistant scopes: serverUrl not set. " +
1338
- "Only default scope will be available.");
1339
- console.info("[ExecutionService] Adding sudocode-mcp with default scope (auto-injection)");
1340
- }
1341
- }
1342
- else if (narrationEnabled && this.serverUrl) {
1343
- // Not project-assistant but narration is enabled - add voice scope
1344
- mcpArgs.push("--scope", "default,voice", "--server-url", this.serverUrl, "--project-id", this.projectId);
1345
- console.info("[ExecutionService] Adding sudocode-mcp with default,voice scopes (narration enabled)");
1346
- }
1347
- else {
1348
- console.info("[ExecutionService] Adding sudocode-mcp with default scope (auto-injection)");
1349
- }
1350
- mergedConfig.mcpServers = {
1351
- ...(userConfig.mcpServers || {}),
1352
- "sudocode-mcp": {
1353
- command: "sudocode-mcp",
1354
- ...(mcpArgs.length > 0 ? { args: mcpArgs } : {}),
1355
- },
1356
- };
1357
- if (mcpArgs.length > 0) {
1358
- console.log("[ExecutionService] sudocode-mcp configured with args:", mcpArgs.join(" "));
1359
- }
1360
- }
1361
- else if (mcpPresent) {
1362
- console.info("[ExecutionService] Removing sudocode-mcp from CLI config (using plugin instead)");
1363
- // Remove sudocode-mcp from mcpServers to avoid duplication with plugin
1364
- if (userConfig.mcpServers) {
1365
- const { "sudocode-mcp": _removed, ...rest } = userConfig.mcpServers;
1366
- mergedConfig.mcpServers =
1367
- Object.keys(rest).length > 0 ? rest : undefined;
1368
- }
1369
- // Note: When using the plugin, project-assistant scopes need to be configured
1370
- // in the plugin settings, not via CLI injection
1371
- if (isProjectAssistant) {
1372
- console.warn("[ExecutionService] project-assistant tag detected but sudocode plugin is active. " +
1373
- "Extended scopes must be configured in plugin settings.");
1374
- }
1375
- }
1376
- else if (userConfig.mcpServers?.["sudocode-mcp"]) {
1377
- console.info("[ExecutionService] Skipping sudocode-mcp injection (user provided in config)");
1378
- }
1379
- return mergedConfig;
1380
- }
1381
- /**
1382
- * Detect if sudocode-mcp command is available in PATH
1383
- *
1384
- * This checks if the sudocode-mcp package is installed on the system by
1385
- * attempting to locate the command using `which` (Unix) or `where` (Windows).
1386
- *
1387
- * @returns true if sudocode-mcp is available, false otherwise
1388
- * @internal Used by buildExecutionConfig
1389
- */
1390
- async detectSudocodeMcp() {
1391
- try {
1392
- // Use 'which' on Unix systems, 'where' on Windows
1393
- const command = process.platform === "win32" ? "where" : "which";
1394
- const result = await execFileNoThrow(command, ["sudocode-mcp"]);
1395
- if (result.status === 0) {
1396
- return true;
1397
- }
1398
- else {
1399
- // Command failed - sudocode-mcp not found in PATH
1400
- console.warn("[ExecutionService] sudocode-mcp command not found in PATH");
1401
- return false;
1402
- }
1403
- }
1404
- catch (error) {
1405
- // Unexpected error during detection
1406
- console.warn("[ExecutionService] Failed to detect sudocode-mcp:", error instanceof Error ? error.message : String(error));
1407
- return false;
1408
- }
1409
- }
1410
- /**
1411
- * Detect if sudocode-mcp is configured for the given agent
1412
- *
1413
- * For claude-code: Checks if the sudocode plugin is enabled in ~/.claude/settings.json
1414
- * For cursor: Checks .cursor/mcp.json in project root for sudocode-mcp command
1415
- * For codex: Checks ~/.codex/config.toml for sudocode-mcp in mcp_servers
1416
- * For copilot: Checks ~/.copilot/mcp-config.json for sudocode-mcp command
1417
- *
1418
- * @param agentType - The type of agent to check
1419
- * @returns true if configured, false otherwise
1420
- * @internal Used by buildExecutionConfig
1421
- */
1422
- async detectAgentMcp(agentType) {
1423
- // For claude-code, check ~/.claude/settings.json
1424
- // This is not foolproof, but covers the default case
1425
- if (agentType === "claude-code") {
1426
- try {
1427
- const claudeSettingsPath = path.join(os.homedir(), ".claude", "settings.json");
1428
- const settingsContent = await fsPromises.readFile(claudeSettingsPath, "utf-8");
1429
- const settings = JSON.parse(settingsContent);
1430
- // Check if sudocode@sudocode-marketplace is enabled
1431
- const isEnabled = settings.enabledPlugins?.["sudocode@sudocode-marketplace"] === true;
1432
- if (isEnabled) {
1433
- console.info("[ExecutionService] sudocode-mcp detected for claude-code (plugin enabled)");
1434
- }
1435
- else {
1436
- console.info("[ExecutionService] sudocode-mcp not detected for claude-code (plugin not enabled)");
1437
- }
1438
- return isEnabled;
1439
- }
1440
- catch (error) {
1441
- // Handle file read errors gracefully
1442
- if (error instanceof Error &&
1443
- "code" in error &&
1444
- error.code === "ENOENT") {
1445
- // File not found - plugin definitely not configured
1446
- console.warn("[ExecutionService] ~/.claude/settings.json not found - plugin not configured");
1447
- return false;
1448
- }
1449
- else if (error instanceof SyntaxError) {
1450
- // Malformed JSON - can't determine, assume configured (conservative)
1451
- console.error("[ExecutionService] Failed to parse ~/.claude/settings.json - malformed JSON:", error.message);
1452
- return true;
1453
- }
1454
- else {
1455
- // Other errors (permission denied, etc.) - can't determine, assume configured (conservative)
1456
- console.warn("[ExecutionService] Failed to read ~/.claude/settings.json:", error instanceof Error ? error.message : String(error));
1457
- return true;
1458
- }
1459
- }
1460
- }
1461
- // For cursor, check .cursor/mcp.json in project root
1462
- if (agentType === "cursor") {
1463
- try {
1464
- // NOTE: .cursor/mcp.json is in project root, not home directory
1465
- const cursorConfigPath = path.join(this.repoPath, ".cursor", "mcp.json");
1466
- const configContent = await fsPromises.readFile(cursorConfigPath, "utf-8");
1467
- const config = JSON.parse(configContent);
1468
- // Check if any mcpServer has command "sudocode-mcp"
1469
- const hasSudocodeMcp = Object.values(config.mcpServers || {}).some((server) => server.command === "sudocode-mcp");
1470
- if (hasSudocodeMcp) {
1471
- console.info("[ExecutionService] sudocode-mcp detected for cursor");
1472
- }
1473
- else {
1474
- console.info("[ExecutionService] sudocode-mcp not detected for cursor");
1475
- }
1476
- return hasSudocodeMcp;
1477
- }
1478
- catch (error) {
1479
- // Handle ENOENT, JSON parse errors, etc.
1480
- if (error instanceof Error &&
1481
- "code" in error &&
1482
- error.code === "ENOENT") {
1483
- // File not found - MCP definitely not configured
1484
- console.warn("[ExecutionService] .cursor/mcp.json not found in project root - MCP not configured");
1485
- return false;
1486
- }
1487
- else if (error instanceof SyntaxError) {
1488
- // Malformed JSON - can't determine configuration
1489
- console.error("[ExecutionService] Failed to parse .cursor/mcp.json - malformed JSON:", error.message);
1490
- return false;
1491
- }
1492
- else {
1493
- // Other errors (permission denied, etc.)
1494
- console.warn("[ExecutionService] Failed to read .cursor/mcp.json:", error instanceof Error ? error.message : String(error));
1495
- return false;
1496
- }
1497
- }
1498
- }
1499
- // For codex, check ~/.codex/config.toml
1500
- if (agentType === "codex") {
1501
- try {
1502
- const codexConfigPath = path.join(os.homedir(), ".codex", "config.toml");
1503
- const configContent = await fsPromises.readFile(codexConfigPath, "utf-8");
1504
- const config = TOML.parse(configContent);
1505
- // Check if any mcp_servers section has command "sudocode-mcp"
1506
- const mcpServers = config.mcp_servers;
1507
- const hasSudocodeMcp = mcpServers &&
1508
- Object.values(mcpServers).some((server) => server.command === "sudocode-mcp");
1509
- if (hasSudocodeMcp) {
1510
- console.info("[ExecutionService] sudocode-mcp detected for codex");
1511
- }
1512
- else {
1513
- console.info("[ExecutionService] sudocode-mcp not detected for codex");
1514
- }
1515
- return !!hasSudocodeMcp;
1516
- }
1517
- catch (error) {
1518
- // Handle ENOENT, TOML parse errors, etc.
1519
- if (error instanceof Error &&
1520
- "code" in error &&
1521
- error.code === "ENOENT") {
1522
- // File not found - MCP definitely not configured
1523
- console.warn("[ExecutionService] ~/.codex/config.toml not found - MCP not configured");
1524
- return false;
1525
- }
1526
- else if (error instanceof Error && error.message.includes("parse")) {
1527
- // Malformed TOML - can't determine configuration
1528
- console.error("[ExecutionService] Failed to parse ~/.codex/config.toml - malformed TOML:", error.message);
1529
- return false;
1530
- }
1531
- else {
1532
- // Other errors (permission denied, etc.)
1533
- console.warn("[ExecutionService] Failed to detect codex MCP config:", error instanceof Error ? error.message : String(error));
1534
- return false;
1535
- }
1536
- }
1537
- }
1538
- // For copilot, check ~/.copilot/mcp-config.json
1539
- if (agentType === "copilot") {
1540
- try {
1541
- const copilotConfigPath = path.join(os.homedir(), ".copilot", "mcp-config.json");
1542
- const configContent = await fsPromises.readFile(copilotConfigPath, "utf-8");
1543
- const config = JSON.parse(configContent);
1544
- // Check if any mcpServer has command "sudocode-mcp"
1545
- const hasSudocodeMcp = Object.values(config.mcpServers || {}).some((server) => server.command === "sudocode-mcp");
1546
- if (hasSudocodeMcp) {
1547
- console.info("[ExecutionService] sudocode-mcp detected for copilot");
1548
- }
1549
- else {
1550
- console.info("[ExecutionService] sudocode-mcp not detected for copilot");
1551
- }
1552
- return hasSudocodeMcp;
1553
- }
1554
- catch (error) {
1555
- // Handle ENOENT, JSON parse errors, etc.
1556
- if (error instanceof Error &&
1557
- "code" in error &&
1558
- error.code === "ENOENT") {
1559
- // File not found - MCP definitely not configured
1560
- console.warn("[ExecutionService] ~/.copilot/mcp-config.json not found - MCP not configured");
1561
- return false;
1562
- }
1563
- else if (error instanceof SyntaxError) {
1564
- // Malformed JSON - can't determine configuration
1565
- console.error("[ExecutionService] Failed to parse ~/.copilot/mcp-config.json - malformed JSON:", error.message);
1566
- return false;
1567
- }
1568
- else {
1569
- // Other errors (permission denied, etc.)
1570
- console.warn("[ExecutionService] Failed to detect copilot MCP config:", error instanceof Error ? error.message : String(error));
1571
- return false;
1572
- }
1573
- }
1574
- }
1575
- // For gemini and opencode, MCP is not yet configured
1576
- // Return false to allow auto-injection
1577
- if (agentType === "gemini" || agentType === "opencode") {
1578
- console.info(`[ExecutionService] MCP detection not implemented for ${agentType} - will auto-inject`);
1579
- return false;
1580
- }
1581
- // For other/unknown agents, return true (safe default - skip injection)
1582
- console.warn(`[ExecutionService] Unknown agent type for MCP detection: ${agentType}`);
1583
- return true;
1584
- }
1585
- // ============================================================================
1586
- // Persistent Session Operations
1587
- // ============================================================================
1588
- /**
1589
- * Send a prompt to a persistent session
1590
- *
1591
- * Returns immediately - output streams via WebSocket subscription.
1592
- *
1593
- * @param executionId - Execution ID with an active persistent session
1594
- * @param prompt - The prompt to send
1595
- * @throws Error if execution not found, not a persistent session, or session not in pending/paused state
1596
- */
1597
- async sendPrompt(executionId, prompt) {
1598
- const wrapper = this.activeExecutors.get(executionId);
1599
- if (!wrapper) {
1600
- throw new Error(`No active executor found for execution ${executionId}. ` +
1601
- `The execution may have completed or is not a persistent session.`);
1602
- }
1603
- if (!(wrapper instanceof AcpExecutorWrapper)) {
1604
- throw new Error(`Execution ${executionId} does not support persistent sessions`);
1605
- }
1606
- await wrapper.sendPrompt(executionId, prompt);
1607
- }
1608
- /**
1609
- * End a persistent session explicitly
1610
- *
1611
- * @param executionId - Execution ID with an active persistent session
1612
- * @throws Error if execution not found or not a persistent session
1613
- */
1614
- async endSession(executionId) {
1615
- const wrapper = this.activeExecutors.get(executionId);
1616
- if (!wrapper) {
1617
- // No active executor - check if execution is stuck in pending/paused state
1618
- const execution = getExecution(this.db, executionId);
1619
- if (!execution) {
1620
- throw new Error(`Execution ${executionId} not found`);
1621
- }
1622
- // If execution is stuck in pending/paused without an active executor,
1623
- // update it to stopped state
1624
- if (execution.status === "pending" || execution.status === "paused") {
1625
- console.log(`[ExecutionService] No active executor for ${executionId} but status is ${execution.status}. ` +
1626
- `Updating to stopped.`);
1627
- updateExecution(this.db, executionId, {
1628
- status: "stopped",
1629
- completed_at: new Date().toISOString(),
1630
- });
1631
- broadcastExecutionUpdate(this.projectId, executionId, "status_changed", {
1632
- id: executionId,
1633
- status: "stopped",
1634
- });
1635
- return;
1636
- }
1637
- // Execution is already in a terminal state
1638
- throw new Error(`No active executor found for execution ${executionId}. ` +
1639
- `The execution may have already completed.`);
1640
- }
1641
- if (!(wrapper instanceof AcpExecutorWrapper)) {
1642
- throw new Error(`Execution ${executionId} does not support persistent sessions`);
1643
- }
1644
- await wrapper.endSession(executionId);
1645
- // Clean up the executor from activeExecutors now that session has ended
1646
- this.activeExecutors.delete(executionId);
1647
- console.log(`[ExecutionService] Cleaned up executor for ended session ${executionId}`);
1648
- }
1649
- /**
1650
- * Get session state for an execution
1651
- *
1652
- * Works for both discrete and persistent sessions.
1653
- *
1654
- * @param executionId - Execution ID to get state for
1655
- * @returns Session state including mode, state, promptCount, and idleTimeMs
1656
- */
1657
- getSessionState(executionId) {
1658
- const wrapper = this.activeExecutors.get(executionId);
1659
- // If no active executor, check if it's a completed discrete execution
1660
- if (!wrapper) {
1661
- // Check if execution exists in database
1662
- const execution = getExecution(this.db, executionId);
1663
- if (!execution) {
1664
- throw new Error(`Execution ${executionId} not found`);
1665
- }
1666
- // Return discrete mode info for completed executions
1667
- return {
1668
- mode: "discrete",
1669
- state: null,
1670
- promptCount: 1, // Discrete executions have exactly one prompt
1671
- };
1672
- }
1673
- // Check if wrapper supports persistent sessions
1674
- if (!(wrapper instanceof AcpExecutorWrapper)) {
1675
- return {
1676
- mode: "discrete",
1677
- state: null,
1678
- promptCount: 1,
1679
- };
1680
- }
1681
- // Get persistent session state from wrapper
1682
- const persistentState = wrapper.getSessionState(executionId);
1683
- if (persistentState) {
1684
- return persistentState;
1685
- }
1686
- // Wrapper exists but no persistent state - it's running in discrete mode
1687
- return {
1688
- mode: "discrete",
1689
- state: null,
1690
- promptCount: 1,
1691
- };
1692
- }
1693
- }
1694
- //# sourceMappingURL=execution-service.js.map