sudocode 1.1.17 → 1.1.18-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (738) hide show
  1. package/node_modules/@sudocode-ai/cli/README.md +330 -0
  2. package/node_modules/@sudocode-ai/cli/dist/cli/feedback-commands.d.ts +53 -0
  3. package/node_modules/@sudocode-ai/cli/dist/cli/feedback-commands.d.ts.map +1 -0
  4. package/node_modules/@sudocode-ai/cli/dist/cli/feedback-commands.js +339 -0
  5. package/node_modules/@sudocode-ai/cli/dist/cli/feedback-commands.js.map +1 -0
  6. package/node_modules/@sudocode-ai/cli/dist/cli/init-commands.d.ts +20 -0
  7. package/node_modules/@sudocode-ai/cli/dist/cli/init-commands.d.ts.map +1 -0
  8. package/node_modules/@sudocode-ai/cli/dist/cli/init-commands.js +145 -0
  9. package/node_modules/@sudocode-ai/cli/dist/cli/init-commands.js.map +1 -0
  10. package/node_modules/@sudocode-ai/cli/dist/cli/issue-commands.d.ts +46 -0
  11. package/node_modules/@sudocode-ai/cli/dist/cli/issue-commands.d.ts.map +1 -0
  12. package/node_modules/@sudocode-ai/cli/dist/cli/issue-commands.js +353 -0
  13. package/node_modules/@sudocode-ai/cli/dist/cli/issue-commands.js.map +1 -0
  14. package/node_modules/@sudocode-ai/cli/dist/cli/merge-commands.d.ts +42 -0
  15. package/node_modules/@sudocode-ai/cli/dist/cli/merge-commands.d.ts.map +1 -0
  16. package/node_modules/@sudocode-ai/cli/dist/cli/merge-commands.js +405 -0
  17. package/node_modules/@sudocode-ai/cli/dist/cli/merge-commands.js.map +1 -0
  18. package/node_modules/@sudocode-ai/cli/dist/cli/plugin-commands.d.ts +62 -0
  19. package/node_modules/@sudocode-ai/cli/dist/cli/plugin-commands.d.ts.map +1 -0
  20. package/node_modules/@sudocode-ai/cli/dist/cli/plugin-commands.js +595 -0
  21. package/node_modules/@sudocode-ai/cli/dist/cli/plugin-commands.js.map +1 -0
  22. package/node_modules/@sudocode-ai/cli/dist/cli/query-commands.d.ts +18 -0
  23. package/node_modules/@sudocode-ai/cli/dist/cli/query-commands.d.ts.map +1 -0
  24. package/node_modules/@sudocode-ai/cli/dist/cli/query-commands.js +61 -0
  25. package/node_modules/@sudocode-ai/cli/dist/cli/query-commands.js.map +1 -0
  26. package/node_modules/@sudocode-ai/cli/dist/cli/reference-commands.d.ts +22 -0
  27. package/node_modules/@sudocode-ai/cli/dist/cli/reference-commands.d.ts.map +1 -0
  28. package/node_modules/@sudocode-ai/cli/dist/cli/reference-commands.js +136 -0
  29. package/node_modules/@sudocode-ai/cli/dist/cli/reference-commands.js.map +1 -0
  30. package/node_modules/@sudocode-ai/cli/dist/cli/relationship-commands.d.ts +14 -0
  31. package/node_modules/@sudocode-ai/cli/dist/cli/relationship-commands.d.ts.map +1 -0
  32. package/node_modules/@sudocode-ai/cli/dist/cli/relationship-commands.js +83 -0
  33. package/node_modules/@sudocode-ai/cli/dist/cli/relationship-commands.js.map +1 -0
  34. package/node_modules/@sudocode-ai/cli/dist/cli/server-commands.d.ts +17 -0
  35. package/node_modules/@sudocode-ai/cli/dist/cli/server-commands.d.ts.map +1 -0
  36. package/node_modules/@sudocode-ai/cli/dist/cli/server-commands.js +123 -0
  37. package/node_modules/@sudocode-ai/cli/dist/cli/server-commands.js.map +1 -0
  38. package/node_modules/@sudocode-ai/cli/dist/cli/spec-commands.d.ts +38 -0
  39. package/node_modules/@sudocode-ai/cli/dist/cli/spec-commands.d.ts.map +1 -0
  40. package/node_modules/@sudocode-ai/cli/dist/cli/spec-commands.js +326 -0
  41. package/node_modules/@sudocode-ai/cli/dist/cli/spec-commands.js.map +1 -0
  42. package/node_modules/@sudocode-ai/cli/dist/cli/status-commands.d.ts +17 -0
  43. package/node_modules/@sudocode-ai/cli/dist/cli/status-commands.d.ts.map +1 -0
  44. package/node_modules/@sudocode-ai/cli/dist/cli/status-commands.js +131 -0
  45. package/node_modules/@sudocode-ai/cli/dist/cli/status-commands.js.map +1 -0
  46. package/node_modules/@sudocode-ai/cli/dist/cli/sync-commands.d.ts +24 -0
  47. package/node_modules/@sudocode-ai/cli/dist/cli/sync-commands.d.ts.map +1 -0
  48. package/node_modules/@sudocode-ai/cli/dist/cli/sync-commands.js +429 -0
  49. package/node_modules/@sudocode-ai/cli/dist/cli/sync-commands.js.map +1 -0
  50. package/node_modules/@sudocode-ai/cli/dist/cli/update-commands.d.ts +16 -0
  51. package/node_modules/@sudocode-ai/cli/dist/cli/update-commands.d.ts.map +1 -0
  52. package/node_modules/@sudocode-ai/cli/dist/cli/update-commands.js +160 -0
  53. package/node_modules/@sudocode-ai/cli/dist/cli/update-commands.js.map +1 -0
  54. package/node_modules/@sudocode-ai/cli/dist/cli.d.ts +6 -0
  55. package/node_modules/@sudocode-ai/cli/dist/cli.d.ts.map +1 -0
  56. package/node_modules/@sudocode-ai/cli/dist/cli.js +543 -0
  57. package/node_modules/@sudocode-ai/cli/dist/cli.js.map +1 -0
  58. package/node_modules/@sudocode-ai/cli/dist/config.d.ts +50 -0
  59. package/node_modules/@sudocode-ai/cli/dist/config.d.ts.map +1 -0
  60. package/node_modules/@sudocode-ai/cli/dist/config.js +76 -0
  61. package/node_modules/@sudocode-ai/cli/dist/config.js.map +1 -0
  62. package/node_modules/@sudocode-ai/cli/dist/db.d.ts +21 -0
  63. package/node_modules/@sudocode-ai/cli/dist/db.d.ts.map +1 -0
  64. package/node_modules/@sudocode-ai/cli/dist/db.js +55 -0
  65. package/node_modules/@sudocode-ai/cli/dist/db.js.map +1 -0
  66. package/node_modules/@sudocode-ai/cli/dist/export.d.ts +84 -0
  67. package/node_modules/@sudocode-ai/cli/dist/export.d.ts.map +1 -0
  68. package/node_modules/@sudocode-ai/cli/dist/export.js +265 -0
  69. package/node_modules/@sudocode-ai/cli/dist/export.js.map +1 -0
  70. package/node_modules/@sudocode-ai/cli/dist/filename-generator.d.ts +31 -0
  71. package/node_modules/@sudocode-ai/cli/dist/filename-generator.d.ts.map +1 -0
  72. package/node_modules/@sudocode-ai/cli/dist/filename-generator.js +103 -0
  73. package/node_modules/@sudocode-ai/cli/dist/filename-generator.js.map +1 -0
  74. package/node_modules/@sudocode-ai/cli/dist/id-generator.d.ts +63 -0
  75. package/node_modules/@sudocode-ai/cli/dist/id-generator.d.ts.map +1 -0
  76. package/node_modules/@sudocode-ai/cli/dist/id-generator.js +196 -0
  77. package/node_modules/@sudocode-ai/cli/dist/id-generator.js.map +1 -0
  78. package/node_modules/@sudocode-ai/cli/dist/import.d.ts +134 -0
  79. package/node_modules/@sudocode-ai/cli/dist/import.d.ts.map +1 -0
  80. package/node_modules/@sudocode-ai/cli/dist/import.js +751 -0
  81. package/node_modules/@sudocode-ai/cli/dist/import.js.map +1 -0
  82. package/node_modules/@sudocode-ai/cli/dist/index.d.ts +15 -0
  83. package/node_modules/@sudocode-ai/cli/dist/index.d.ts.map +1 -0
  84. package/node_modules/@sudocode-ai/cli/dist/index.js +15 -0
  85. package/node_modules/@sudocode-ai/cli/dist/index.js.map +1 -0
  86. package/node_modules/@sudocode-ai/cli/dist/integrations/base-provider.d.ts +108 -0
  87. package/node_modules/@sudocode-ai/cli/dist/integrations/base-provider.d.ts.map +1 -0
  88. package/node_modules/@sudocode-ai/cli/dist/integrations/base-provider.js +80 -0
  89. package/node_modules/@sudocode-ai/cli/dist/integrations/base-provider.js.map +1 -0
  90. package/node_modules/@sudocode-ai/cli/dist/integrations/config-resolver.d.ts +62 -0
  91. package/node_modules/@sudocode-ai/cli/dist/integrations/config-resolver.d.ts.map +1 -0
  92. package/node_modules/@sudocode-ai/cli/dist/integrations/config-resolver.js +69 -0
  93. package/node_modules/@sudocode-ai/cli/dist/integrations/config-resolver.js.map +1 -0
  94. package/node_modules/@sudocode-ai/cli/dist/integrations/config-validator.d.ts +75 -0
  95. package/node_modules/@sudocode-ai/cli/dist/integrations/config-validator.d.ts.map +1 -0
  96. package/node_modules/@sudocode-ai/cli/dist/integrations/config-validator.js +129 -0
  97. package/node_modules/@sudocode-ai/cli/dist/integrations/config-validator.js.map +1 -0
  98. package/node_modules/@sudocode-ai/cli/dist/integrations/index.d.ts +14 -0
  99. package/node_modules/@sudocode-ai/cli/dist/integrations/index.d.ts.map +1 -0
  100. package/node_modules/@sudocode-ai/cli/dist/integrations/index.js +20 -0
  101. package/node_modules/@sudocode-ai/cli/dist/integrations/index.js.map +1 -0
  102. package/node_modules/@sudocode-ai/cli/dist/integrations/plugin-loader.d.ts +77 -0
  103. package/node_modules/@sudocode-ai/cli/dist/integrations/plugin-loader.d.ts.map +1 -0
  104. package/node_modules/@sudocode-ai/cli/dist/integrations/plugin-loader.js +265 -0
  105. package/node_modules/@sudocode-ai/cli/dist/integrations/plugin-loader.js.map +1 -0
  106. package/node_modules/@sudocode-ai/cli/dist/integrations/registry.d.ts +67 -0
  107. package/node_modules/@sudocode-ai/cli/dist/integrations/registry.d.ts.map +1 -0
  108. package/node_modules/@sudocode-ai/cli/dist/integrations/registry.js +77 -0
  109. package/node_modules/@sudocode-ai/cli/dist/integrations/registry.js.map +1 -0
  110. package/node_modules/@sudocode-ai/cli/dist/integrations/sync-coordinator.d.ts +191 -0
  111. package/node_modules/@sudocode-ai/cli/dist/integrations/sync-coordinator.d.ts.map +1 -0
  112. package/node_modules/@sudocode-ai/cli/dist/integrations/sync-coordinator.js +798 -0
  113. package/node_modules/@sudocode-ai/cli/dist/integrations/sync-coordinator.js.map +1 -0
  114. package/node_modules/@sudocode-ai/cli/dist/integrations/types.d.ts +142 -0
  115. package/node_modules/@sudocode-ai/cli/dist/integrations/types.d.ts.map +1 -0
  116. package/node_modules/@sudocode-ai/cli/dist/integrations/types.js +6 -0
  117. package/node_modules/@sudocode-ai/cli/dist/integrations/types.js.map +1 -0
  118. package/node_modules/@sudocode-ai/cli/dist/integrations/utils/conflict-resolver.d.ts +79 -0
  119. package/node_modules/@sudocode-ai/cli/dist/integrations/utils/conflict-resolver.d.ts.map +1 -0
  120. package/node_modules/@sudocode-ai/cli/dist/integrations/utils/conflict-resolver.js +106 -0
  121. package/node_modules/@sudocode-ai/cli/dist/integrations/utils/conflict-resolver.js.map +1 -0
  122. package/node_modules/@sudocode-ai/cli/dist/jsonl.d.ts +69 -0
  123. package/node_modules/@sudocode-ai/cli/dist/jsonl.d.ts.map +1 -0
  124. package/node_modules/@sudocode-ai/cli/dist/jsonl.js +333 -0
  125. package/node_modules/@sudocode-ai/cli/dist/jsonl.js.map +1 -0
  126. package/node_modules/@sudocode-ai/cli/dist/markdown.d.ts +146 -0
  127. package/node_modules/@sudocode-ai/cli/dist/markdown.d.ts.map +1 -0
  128. package/node_modules/@sudocode-ai/cli/dist/markdown.js +329 -0
  129. package/node_modules/@sudocode-ai/cli/dist/markdown.js.map +1 -0
  130. package/node_modules/@sudocode-ai/cli/dist/merge-resolver.d.ts +85 -0
  131. package/node_modules/@sudocode-ai/cli/dist/merge-resolver.d.ts.map +1 -0
  132. package/node_modules/@sudocode-ai/cli/dist/merge-resolver.js +301 -0
  133. package/node_modules/@sudocode-ai/cli/dist/merge-resolver.js.map +1 -0
  134. package/node_modules/@sudocode-ai/cli/dist/operations/events.d.ts +53 -0
  135. package/node_modules/@sudocode-ai/cli/dist/operations/events.d.ts.map +1 -0
  136. package/node_modules/@sudocode-ai/cli/dist/operations/events.js +108 -0
  137. package/node_modules/@sudocode-ai/cli/dist/operations/events.js.map +1 -0
  138. package/node_modules/@sudocode-ai/cli/dist/operations/external-links.d.ts +147 -0
  139. package/node_modules/@sudocode-ai/cli/dist/operations/external-links.d.ts.map +1 -0
  140. package/node_modules/@sudocode-ai/cli/dist/operations/external-links.js +411 -0
  141. package/node_modules/@sudocode-ai/cli/dist/operations/external-links.js.map +1 -0
  142. package/node_modules/@sudocode-ai/cli/dist/operations/feedback-anchors.d.ts +92 -0
  143. package/node_modules/@sudocode-ai/cli/dist/operations/feedback-anchors.d.ts.map +1 -0
  144. package/node_modules/@sudocode-ai/cli/dist/operations/feedback-anchors.js +444 -0
  145. package/node_modules/@sudocode-ai/cli/dist/operations/feedback-anchors.js.map +1 -0
  146. package/node_modules/@sudocode-ai/cli/dist/operations/feedback.d.ts +94 -0
  147. package/node_modules/@sudocode-ai/cli/dist/operations/feedback.d.ts.map +1 -0
  148. package/node_modules/@sudocode-ai/cli/dist/operations/feedback.js +278 -0
  149. package/node_modules/@sudocode-ai/cli/dist/operations/feedback.js.map +1 -0
  150. package/node_modules/@sudocode-ai/cli/dist/operations/index.d.ts +11 -0
  151. package/node_modules/@sudocode-ai/cli/dist/operations/index.d.ts.map +1 -0
  152. package/node_modules/@sudocode-ai/cli/dist/operations/index.js +11 -0
  153. package/node_modules/@sudocode-ai/cli/dist/operations/index.js.map +1 -0
  154. package/node_modules/@sudocode-ai/cli/dist/operations/issues.d.ts +88 -0
  155. package/node_modules/@sudocode-ai/cli/dist/operations/issues.d.ts.map +1 -0
  156. package/node_modules/@sudocode-ai/cli/dist/operations/issues.js +474 -0
  157. package/node_modules/@sudocode-ai/cli/dist/operations/issues.js.map +1 -0
  158. package/node_modules/@sudocode-ai/cli/dist/operations/references.d.ts +34 -0
  159. package/node_modules/@sudocode-ai/cli/dist/operations/references.d.ts.map +1 -0
  160. package/node_modules/@sudocode-ai/cli/dist/operations/references.js +117 -0
  161. package/node_modules/@sudocode-ai/cli/dist/operations/references.js.map +1 -0
  162. package/node_modules/@sudocode-ai/cli/dist/operations/relationships.d.ts +64 -0
  163. package/node_modules/@sudocode-ai/cli/dist/operations/relationships.d.ts.map +1 -0
  164. package/node_modules/@sudocode-ai/cli/dist/operations/relationships.js +281 -0
  165. package/node_modules/@sudocode-ai/cli/dist/operations/relationships.js.map +1 -0
  166. package/node_modules/@sudocode-ai/cli/dist/operations/specs.d.ts +69 -0
  167. package/node_modules/@sudocode-ai/cli/dist/operations/specs.d.ts.map +1 -0
  168. package/node_modules/@sudocode-ai/cli/dist/operations/specs.js +330 -0
  169. package/node_modules/@sudocode-ai/cli/dist/operations/specs.js.map +1 -0
  170. package/node_modules/@sudocode-ai/cli/dist/operations/tags.d.ts +42 -0
  171. package/node_modules/@sudocode-ai/cli/dist/operations/tags.d.ts.map +1 -0
  172. package/node_modules/@sudocode-ai/cli/dist/operations/tags.js +127 -0
  173. package/node_modules/@sudocode-ai/cli/dist/operations/tags.js.map +1 -0
  174. package/node_modules/@sudocode-ai/cli/dist/operations/transactions.d.ts +41 -0
  175. package/node_modules/@sudocode-ai/cli/dist/operations/transactions.d.ts.map +1 -0
  176. package/node_modules/@sudocode-ai/cli/dist/operations/transactions.js +111 -0
  177. package/node_modules/@sudocode-ai/cli/dist/operations/transactions.js.map +1 -0
  178. package/node_modules/@sudocode-ai/cli/dist/sync.d.ts +47 -0
  179. package/node_modules/@sudocode-ai/cli/dist/sync.d.ts.map +1 -0
  180. package/node_modules/@sudocode-ai/cli/dist/sync.js +464 -0
  181. package/node_modules/@sudocode-ai/cli/dist/sync.js.map +1 -0
  182. package/node_modules/@sudocode-ai/cli/dist/test-schema.d.ts +5 -0
  183. package/node_modules/@sudocode-ai/cli/dist/test-schema.d.ts.map +1 -0
  184. package/node_modules/@sudocode-ai/cli/dist/test-schema.js +46 -0
  185. package/node_modules/@sudocode-ai/cli/dist/test-schema.js.map +1 -0
  186. package/node_modules/@sudocode-ai/cli/dist/types.d.ts +7 -0
  187. package/node_modules/@sudocode-ai/cli/dist/types.d.ts.map +1 -0
  188. package/node_modules/@sudocode-ai/cli/dist/types.js +7 -0
  189. package/node_modules/@sudocode-ai/cli/dist/types.js.map +1 -0
  190. package/node_modules/@sudocode-ai/cli/dist/update-checker.d.ts +33 -0
  191. package/node_modules/@sudocode-ai/cli/dist/update-checker.d.ts.map +1 -0
  192. package/node_modules/@sudocode-ai/cli/dist/update-checker.js +193 -0
  193. package/node_modules/@sudocode-ai/cli/dist/update-checker.js.map +1 -0
  194. package/node_modules/@sudocode-ai/cli/dist/validation.d.ts +11 -0
  195. package/node_modules/@sudocode-ai/cli/dist/validation.d.ts.map +1 -0
  196. package/node_modules/@sudocode-ai/cli/dist/validation.js +58 -0
  197. package/node_modules/@sudocode-ai/cli/dist/validation.js.map +1 -0
  198. package/node_modules/@sudocode-ai/cli/dist/version.d.ts +12 -0
  199. package/node_modules/@sudocode-ai/cli/dist/version.d.ts.map +1 -0
  200. package/node_modules/@sudocode-ai/cli/dist/version.js +23 -0
  201. package/node_modules/@sudocode-ai/cli/dist/version.js.map +1 -0
  202. package/node_modules/@sudocode-ai/cli/dist/watcher.d.ts +69 -0
  203. package/node_modules/@sudocode-ai/cli/dist/watcher.d.ts.map +1 -0
  204. package/node_modules/@sudocode-ai/cli/dist/watcher.js +783 -0
  205. package/node_modules/@sudocode-ai/cli/dist/watcher.js.map +1 -0
  206. package/node_modules/@sudocode-ai/cli/package.json +73 -0
  207. package/node_modules/@sudocode-ai/integration-beads/package.json +44 -0
  208. package/node_modules/@sudocode-ai/integration-github/package.json +41 -0
  209. package/node_modules/@sudocode-ai/integration-openspec/package.json +43 -0
  210. package/node_modules/@sudocode-ai/integration-speckit/package.json +42 -0
  211. package/node_modules/@sudocode-ai/local-server/README.md +25 -0
  212. package/node_modules/@sudocode-ai/local-server/dist/cli.d.ts +7 -0
  213. package/node_modules/@sudocode-ai/local-server/dist/cli.d.ts.map +1 -0
  214. package/node_modules/@sudocode-ai/local-server/dist/cli.js +7 -0
  215. package/node_modules/@sudocode-ai/local-server/dist/cli.js.map +1 -0
  216. package/node_modules/@sudocode-ai/local-server/dist/errors/agent-errors.d.ts +43 -0
  217. package/node_modules/@sudocode-ai/local-server/dist/errors/agent-errors.d.ts.map +1 -0
  218. package/node_modules/@sudocode-ai/local-server/dist/errors/agent-errors.js +69 -0
  219. package/node_modules/@sudocode-ai/local-server/dist/errors/agent-errors.js.map +1 -0
  220. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/claude-adapter.d.ts +63 -0
  221. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/claude-adapter.d.ts.map +1 -0
  222. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/claude-adapter.js +83 -0
  223. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/claude-adapter.js.map +1 -0
  224. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/codex-adapter.d.ts +67 -0
  225. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/codex-adapter.d.ts.map +1 -0
  226. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/codex-adapter.js +183 -0
  227. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/codex-adapter.js.map +1 -0
  228. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/codex-config-builder.d.ts +30 -0
  229. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/codex-config-builder.d.ts.map +1 -0
  230. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/codex-config-builder.js +110 -0
  231. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/codex-config-builder.js.map +1 -0
  232. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/copilot-adapter.d.ts +94 -0
  233. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/copilot-adapter.d.ts.map +1 -0
  234. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/copilot-adapter.js +163 -0
  235. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/copilot-adapter.js.map +1 -0
  236. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/copilot-config-builder.d.ts +48 -0
  237. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/copilot-config-builder.d.ts.map +1 -0
  238. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/copilot-config-builder.js +125 -0
  239. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/copilot-config-builder.js.map +1 -0
  240. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/cursor-adapter.d.ts +66 -0
  241. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/cursor-adapter.d.ts.map +1 -0
  242. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/cursor-adapter.js +121 -0
  243. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/cursor-adapter.js.map +1 -0
  244. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/cursor-config-builder.d.ts +29 -0
  245. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/cursor-config-builder.d.ts.map +1 -0
  246. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/cursor-config-builder.js +49 -0
  247. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/cursor-config-builder.js.map +1 -0
  248. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/config-presets.d.ts +102 -0
  249. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/config-presets.d.ts.map +1 -0
  250. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/config-presets.js +205 -0
  251. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/config-presets.js.map +1 -0
  252. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/config-utils.d.ts +95 -0
  253. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/config-utils.d.ts.map +1 -0
  254. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/config-utils.js +163 -0
  255. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/config-utils.js.map +1 -0
  256. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/index.d.ts +8 -0
  257. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/index.d.ts.map +1 -0
  258. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/index.js +8 -0
  259. package/node_modules/@sudocode-ai/local-server/dist/execution/adapters/shared/index.js.map +1 -0
  260. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/agent-executor-wrapper.d.ts +154 -0
  261. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/agent-executor-wrapper.d.ts.map +1 -0
  262. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/agent-executor-wrapper.js +725 -0
  263. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/agent-executor-wrapper.js.map +1 -0
  264. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/executor-factory.d.ts +95 -0
  265. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/executor-factory.d.ts.map +1 -0
  266. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/executor-factory.js +128 -0
  267. package/node_modules/@sudocode-ai/local-server/dist/execution/executors/executor-factory.js.map +1 -0
  268. package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-adapter.d.ts +174 -0
  269. package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-adapter.d.ts.map +1 -0
  270. package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-adapter.js +436 -0
  271. package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-adapter.js.map +1 -0
  272. package/node_modules/@sudocode-ai/local-server/dist/execution/output/claude-to-ag-ui.d.ts +90 -0
  273. package/node_modules/@sudocode-ai/local-server/dist/execution/output/claude-to-ag-ui.d.ts.map +1 -0
  274. package/node_modules/@sudocode-ai/local-server/dist/execution/output/claude-to-ag-ui.js +153 -0
  275. package/node_modules/@sudocode-ai/local-server/dist/execution/output/claude-to-ag-ui.js.map +1 -0
  276. package/node_modules/@sudocode-ai/local-server/dist/execution/output/index.d.ts +15 -0
  277. package/node_modules/@sudocode-ai/local-server/dist/execution/output/index.d.ts.map +1 -0
  278. package/node_modules/@sudocode-ai/local-server/dist/execution/output/index.js +13 -0
  279. package/node_modules/@sudocode-ai/local-server/dist/execution/output/index.js.map +1 -0
  280. package/node_modules/@sudocode-ai/local-server/dist/execution/output/normalized-to-ag-ui-adapter.d.ts +108 -0
  281. package/node_modules/@sudocode-ai/local-server/dist/execution/output/normalized-to-ag-ui-adapter.d.ts.map +1 -0
  282. package/node_modules/@sudocode-ai/local-server/dist/execution/output/normalized-to-ag-ui-adapter.js +321 -0
  283. package/node_modules/@sudocode-ai/local-server/dist/execution/output/normalized-to-ag-ui-adapter.js.map +1 -0
  284. package/node_modules/@sudocode-ai/local-server/dist/execution/output/types.d.ts +421 -0
  285. package/node_modules/@sudocode-ai/local-server/dist/execution/output/types.d.ts.map +1 -0
  286. package/node_modules/@sudocode-ai/local-server/dist/execution/output/types.js +22 -0
  287. package/node_modules/@sudocode-ai/local-server/dist/execution/output/types.js.map +1 -0
  288. package/node_modules/@sudocode-ai/local-server/dist/execution/process/builders/claude.d.ts +53 -0
  289. package/node_modules/@sudocode-ai/local-server/dist/execution/process/builders/claude.d.ts.map +1 -0
  290. package/node_modules/@sudocode-ai/local-server/dist/execution/process/builders/claude.js +225 -0
  291. package/node_modules/@sudocode-ai/local-server/dist/execution/process/builders/claude.js.map +1 -0
  292. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/event-buffer.d.ts +119 -0
  293. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/event-buffer.d.ts.map +1 -0
  294. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/event-buffer.js +208 -0
  295. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/event-buffer.js.map +1 -0
  296. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/index.d.ts +10 -0
  297. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/index.d.ts.map +1 -0
  298. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/index.js +10 -0
  299. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/index.js.map +1 -0
  300. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/ipc-transport-manager.d.ts +74 -0
  301. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/ipc-transport-manager.d.ts.map +1 -0
  302. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/ipc-transport-manager.js +104 -0
  303. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/ipc-transport-manager.js.map +1 -0
  304. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/sse-transport.d.ts +146 -0
  305. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/sse-transport.d.ts.map +1 -0
  306. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/sse-transport.js +282 -0
  307. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/sse-transport.js.map +1 -0
  308. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/transport-manager.d.ts +176 -0
  309. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/transport-manager.d.ts.map +1 -0
  310. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/transport-manager.js +234 -0
  311. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/transport-manager.js.map +1 -0
  312. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/config.d.ts +74 -0
  313. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/config.d.ts.map +1 -0
  314. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/config.js +280 -0
  315. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/config.js.map +1 -0
  316. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/conflict-detector.d.ts +85 -0
  317. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/conflict-detector.d.ts.map +1 -0
  318. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/conflict-detector.js +129 -0
  319. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/conflict-detector.js.map +1 -0
  320. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-cli.d.ts +208 -0
  321. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-cli.d.ts.map +1 -0
  322. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-cli.js +280 -0
  323. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-cli.js.map +1 -0
  324. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-sync-cli.d.ts +225 -0
  325. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-sync-cli.d.ts.map +1 -0
  326. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-sync-cli.js +464 -0
  327. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-sync-cli.js.map +1 -0
  328. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/index.d.ts +16 -0
  329. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/index.d.ts.map +1 -0
  330. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/index.js +15 -0
  331. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/index.js.map +1 -0
  332. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/manager.d.ts +221 -0
  333. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/manager.d.ts.map +1 -0
  334. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/manager.js +508 -0
  335. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/manager.js.map +1 -0
  336. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/types.d.ts +90 -0
  337. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/types.d.ts.map +1 -0
  338. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/types.js +42 -0
  339. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/types.js.map +1 -0
  340. package/node_modules/@sudocode-ai/local-server/dist/index.d.ts +6 -0
  341. package/node_modules/@sudocode-ai/local-server/dist/index.d.ts.map +1 -0
  342. package/node_modules/@sudocode-ai/local-server/dist/index.js +371 -0
  343. package/node_modules/@sudocode-ai/local-server/dist/index.js.map +1 -0
  344. package/node_modules/@sudocode-ai/local-server/dist/middleware/project-context.d.ts +37 -0
  345. package/node_modules/@sudocode-ai/local-server/dist/middleware/project-context.d.ts.map +1 -0
  346. package/node_modules/@sudocode-ai/local-server/dist/middleware/project-context.js +91 -0
  347. package/node_modules/@sudocode-ai/local-server/dist/middleware/project-context.js.map +1 -0
  348. package/node_modules/@sudocode-ai/local-server/dist/public/assets/index-D4AKx6EO.css +1 -0
  349. package/node_modules/@sudocode-ai/local-server/dist/public/assets/index-DorQqwGV.js +927 -0
  350. package/node_modules/@sudocode-ai/local-server/dist/public/assets/index-DorQqwGV.js.map +1 -0
  351. package/node_modules/@sudocode-ai/local-server/dist/public/assets/react-vendor-DoNwlLhy.js +60 -0
  352. package/node_modules/@sudocode-ai/local-server/dist/public/assets/react-vendor-DoNwlLhy.js.map +1 -0
  353. package/node_modules/@sudocode-ai/local-server/dist/public/assets/ui-vendor-DlxvBun1.js +54 -0
  354. package/node_modules/@sudocode-ai/local-server/dist/public/assets/ui-vendor-DlxvBun1.js.map +1 -0
  355. package/node_modules/@sudocode-ai/local-server/dist/public/favicon.ico +0 -0
  356. package/node_modules/@sudocode-ai/local-server/dist/public/index.html +16 -0
  357. package/node_modules/@sudocode-ai/local-server/dist/public/logo.png +0 -0
  358. package/node_modules/@sudocode-ai/local-server/dist/routes/agents.d.ts +3 -0
  359. package/node_modules/@sudocode-ai/local-server/dist/routes/agents.d.ts.map +1 -0
  360. package/node_modules/@sudocode-ai/local-server/dist/routes/agents.js +62 -0
  361. package/node_modules/@sudocode-ai/local-server/dist/routes/agents.js.map +1 -0
  362. package/node_modules/@sudocode-ai/local-server/dist/routes/config.d.ts +3 -0
  363. package/node_modules/@sudocode-ai/local-server/dist/routes/config.d.ts.map +1 -0
  364. package/node_modules/@sudocode-ai/local-server/dist/routes/config.js +116 -0
  365. package/node_modules/@sudocode-ai/local-server/dist/routes/config.js.map +1 -0
  366. package/node_modules/@sudocode-ai/local-server/dist/routes/editors.d.ts +15 -0
  367. package/node_modules/@sudocode-ai/local-server/dist/routes/editors.d.ts.map +1 -0
  368. package/node_modules/@sudocode-ai/local-server/dist/routes/editors.js +98 -0
  369. package/node_modules/@sudocode-ai/local-server/dist/routes/editors.js.map +1 -0
  370. package/node_modules/@sudocode-ai/local-server/dist/routes/executions-stream.d.ts +27 -0
  371. package/node_modules/@sudocode-ai/local-server/dist/routes/executions-stream.d.ts.map +1 -0
  372. package/node_modules/@sudocode-ai/local-server/dist/routes/executions-stream.js +59 -0
  373. package/node_modules/@sudocode-ai/local-server/dist/routes/executions-stream.js.map +1 -0
  374. package/node_modules/@sudocode-ai/local-server/dist/routes/executions.d.ts +18 -0
  375. package/node_modules/@sudocode-ai/local-server/dist/routes/executions.d.ts.map +1 -0
  376. package/node_modules/@sudocode-ai/local-server/dist/routes/executions.js +1169 -0
  377. package/node_modules/@sudocode-ai/local-server/dist/routes/executions.js.map +1 -0
  378. package/node_modules/@sudocode-ai/local-server/dist/routes/feedback.d.ts +8 -0
  379. package/node_modules/@sudocode-ai/local-server/dist/routes/feedback.d.ts.map +1 -0
  380. package/node_modules/@sudocode-ai/local-server/dist/routes/feedback.js +340 -0
  381. package/node_modules/@sudocode-ai/local-server/dist/routes/feedback.js.map +1 -0
  382. package/node_modules/@sudocode-ai/local-server/dist/routes/files.d.ts +18 -0
  383. package/node_modules/@sudocode-ai/local-server/dist/routes/files.d.ts.map +1 -0
  384. package/node_modules/@sudocode-ai/local-server/dist/routes/files.js +89 -0
  385. package/node_modules/@sudocode-ai/local-server/dist/routes/files.js.map +1 -0
  386. package/node_modules/@sudocode-ai/local-server/dist/routes/import.d.ts +142 -0
  387. package/node_modules/@sudocode-ai/local-server/dist/routes/import.d.ts.map +1 -0
  388. package/node_modules/@sudocode-ai/local-server/dist/routes/import.js +896 -0
  389. package/node_modules/@sudocode-ai/local-server/dist/routes/import.js.map +1 -0
  390. package/node_modules/@sudocode-ai/local-server/dist/routes/issues.d.ts +8 -0
  391. package/node_modules/@sudocode-ai/local-server/dist/routes/issues.d.ts.map +1 -0
  392. package/node_modules/@sudocode-ai/local-server/dist/routes/issues.js +419 -0
  393. package/node_modules/@sudocode-ai/local-server/dist/routes/issues.js.map +1 -0
  394. package/node_modules/@sudocode-ai/local-server/dist/routes/plugins.d.ts +34 -0
  395. package/node_modules/@sudocode-ai/local-server/dist/routes/plugins.d.ts.map +1 -0
  396. package/node_modules/@sudocode-ai/local-server/dist/routes/plugins.js +602 -0
  397. package/node_modules/@sudocode-ai/local-server/dist/routes/plugins.js.map +1 -0
  398. package/node_modules/@sudocode-ai/local-server/dist/routes/projects.d.ts +11 -0
  399. package/node_modules/@sudocode-ai/local-server/dist/routes/projects.d.ts.map +1 -0
  400. package/node_modules/@sudocode-ai/local-server/dist/routes/projects.js +536 -0
  401. package/node_modules/@sudocode-ai/local-server/dist/routes/projects.js.map +1 -0
  402. package/node_modules/@sudocode-ai/local-server/dist/routes/relationships.d.ts +8 -0
  403. package/node_modules/@sudocode-ai/local-server/dist/routes/relationships.d.ts.map +1 -0
  404. package/node_modules/@sudocode-ai/local-server/dist/routes/relationships.js +310 -0
  405. package/node_modules/@sudocode-ai/local-server/dist/routes/relationships.js.map +1 -0
  406. package/node_modules/@sudocode-ai/local-server/dist/routes/repo-info.d.ts +3 -0
  407. package/node_modules/@sudocode-ai/local-server/dist/routes/repo-info.d.ts.map +1 -0
  408. package/node_modules/@sudocode-ai/local-server/dist/routes/repo-info.js +203 -0
  409. package/node_modules/@sudocode-ai/local-server/dist/routes/repo-info.js.map +1 -0
  410. package/node_modules/@sudocode-ai/local-server/dist/routes/specs.d.ts +8 -0
  411. package/node_modules/@sudocode-ai/local-server/dist/routes/specs.d.ts.map +1 -0
  412. package/node_modules/@sudocode-ai/local-server/dist/routes/specs.js +414 -0
  413. package/node_modules/@sudocode-ai/local-server/dist/routes/specs.js.map +1 -0
  414. package/node_modules/@sudocode-ai/local-server/dist/routes/update.d.ts +7 -0
  415. package/node_modules/@sudocode-ai/local-server/dist/routes/update.d.ts.map +1 -0
  416. package/node_modules/@sudocode-ai/local-server/dist/routes/update.js +194 -0
  417. package/node_modules/@sudocode-ai/local-server/dist/routes/update.js.map +1 -0
  418. package/node_modules/@sudocode-ai/local-server/dist/routes/version.d.ts +3 -0
  419. package/node_modules/@sudocode-ai/local-server/dist/routes/version.d.ts.map +1 -0
  420. package/node_modules/@sudocode-ai/local-server/dist/routes/version.js +25 -0
  421. package/node_modules/@sudocode-ai/local-server/dist/routes/version.js.map +1 -0
  422. package/node_modules/@sudocode-ai/local-server/dist/routes/workflows.d.ts +8 -0
  423. package/node_modules/@sudocode-ai/local-server/dist/routes/workflows.d.ts.map +1 -0
  424. package/node_modules/@sudocode-ai/local-server/dist/routes/workflows.js +1729 -0
  425. package/node_modules/@sudocode-ai/local-server/dist/routes/workflows.js.map +1 -0
  426. package/node_modules/@sudocode-ai/local-server/dist/services/agent-registry.d.ts +140 -0
  427. package/node_modules/@sudocode-ai/local-server/dist/services/agent-registry.d.ts.map +1 -0
  428. package/node_modules/@sudocode-ai/local-server/dist/services/agent-registry.js +272 -0
  429. package/node_modules/@sudocode-ai/local-server/dist/services/agent-registry.js.map +1 -0
  430. package/node_modules/@sudocode-ai/local-server/dist/services/db.d.ts +33 -0
  431. package/node_modules/@sudocode-ai/local-server/dist/services/db.d.ts.map +1 -0
  432. package/node_modules/@sudocode-ai/local-server/dist/services/db.js +90 -0
  433. package/node_modules/@sudocode-ai/local-server/dist/services/db.js.map +1 -0
  434. package/node_modules/@sudocode-ai/local-server/dist/services/editor-service.d.ts +57 -0
  435. package/node_modules/@sudocode-ai/local-server/dist/services/editor-service.d.ts.map +1 -0
  436. package/node_modules/@sudocode-ai/local-server/dist/services/editor-service.js +204 -0
  437. package/node_modules/@sudocode-ai/local-server/dist/services/editor-service.js.map +1 -0
  438. package/node_modules/@sudocode-ai/local-server/dist/services/execution-changes-service.d.ts +110 -0
  439. package/node_modules/@sudocode-ai/local-server/dist/services/execution-changes-service.d.ts.map +1 -0
  440. package/node_modules/@sudocode-ai/local-server/dist/services/execution-changes-service.js +710 -0
  441. package/node_modules/@sudocode-ai/local-server/dist/services/execution-changes-service.js.map +1 -0
  442. package/node_modules/@sudocode-ai/local-server/dist/services/execution-event-callbacks.d.ts +73 -0
  443. package/node_modules/@sudocode-ai/local-server/dist/services/execution-event-callbacks.d.ts.map +1 -0
  444. package/node_modules/@sudocode-ai/local-server/dist/services/execution-event-callbacks.js +82 -0
  445. package/node_modules/@sudocode-ai/local-server/dist/services/execution-event-callbacks.js.map +1 -0
  446. package/node_modules/@sudocode-ai/local-server/dist/services/execution-lifecycle.d.ts +145 -0
  447. package/node_modules/@sudocode-ai/local-server/dist/services/execution-lifecycle.d.ts.map +1 -0
  448. package/node_modules/@sudocode-ai/local-server/dist/services/execution-lifecycle.js +392 -0
  449. package/node_modules/@sudocode-ai/local-server/dist/services/execution-lifecycle.js.map +1 -0
  450. package/node_modules/@sudocode-ai/local-server/dist/services/execution-logs-cleanup.d.ts +88 -0
  451. package/node_modules/@sudocode-ai/local-server/dist/services/execution-logs-cleanup.d.ts.map +1 -0
  452. package/node_modules/@sudocode-ai/local-server/dist/services/execution-logs-cleanup.js +137 -0
  453. package/node_modules/@sudocode-ai/local-server/dist/services/execution-logs-cleanup.js.map +1 -0
  454. package/node_modules/@sudocode-ai/local-server/dist/services/execution-logs-store.d.ts +252 -0
  455. package/node_modules/@sudocode-ai/local-server/dist/services/execution-logs-store.d.ts.map +1 -0
  456. package/node_modules/@sudocode-ai/local-server/dist/services/execution-logs-store.js +379 -0
  457. package/node_modules/@sudocode-ai/local-server/dist/services/execution-logs-store.js.map +1 -0
  458. package/node_modules/@sudocode-ai/local-server/dist/services/execution-service.d.ts +280 -0
  459. package/node_modules/@sudocode-ai/local-server/dist/services/execution-service.d.ts.map +1 -0
  460. package/node_modules/@sudocode-ai/local-server/dist/services/execution-service.js +1240 -0
  461. package/node_modules/@sudocode-ai/local-server/dist/services/execution-service.js.map +1 -0
  462. package/node_modules/@sudocode-ai/local-server/dist/services/execution-worker-pool.d.ts +116 -0
  463. package/node_modules/@sudocode-ai/local-server/dist/services/execution-worker-pool.d.ts.map +1 -0
  464. package/node_modules/@sudocode-ai/local-server/dist/services/execution-worker-pool.js +326 -0
  465. package/node_modules/@sudocode-ai/local-server/dist/services/execution-worker-pool.js.map +1 -0
  466. package/node_modules/@sudocode-ai/local-server/dist/services/executions.d.ts +63 -0
  467. package/node_modules/@sudocode-ai/local-server/dist/services/executions.d.ts.map +1 -0
  468. package/node_modules/@sudocode-ai/local-server/dist/services/executions.js +177 -0
  469. package/node_modules/@sudocode-ai/local-server/dist/services/executions.js.map +1 -0
  470. package/node_modules/@sudocode-ai/local-server/dist/services/export.d.ts +32 -0
  471. package/node_modules/@sudocode-ai/local-server/dist/services/export.d.ts.map +1 -0
  472. package/node_modules/@sudocode-ai/local-server/dist/services/export.js +114 -0
  473. package/node_modules/@sudocode-ai/local-server/dist/services/export.js.map +1 -0
  474. package/node_modules/@sudocode-ai/local-server/dist/services/external-refresh-service.d.ts +104 -0
  475. package/node_modules/@sudocode-ai/local-server/dist/services/external-refresh-service.d.ts.map +1 -0
  476. package/node_modules/@sudocode-ai/local-server/dist/services/external-refresh-service.js +520 -0
  477. package/node_modules/@sudocode-ai/local-server/dist/services/external-refresh-service.js.map +1 -0
  478. package/node_modules/@sudocode-ai/local-server/dist/services/feedback.d.ts +56 -0
  479. package/node_modules/@sudocode-ai/local-server/dist/services/feedback.d.ts.map +1 -0
  480. package/node_modules/@sudocode-ai/local-server/dist/services/feedback.js +78 -0
  481. package/node_modules/@sudocode-ai/local-server/dist/services/feedback.js.map +1 -0
  482. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/git-ls-files-strategy.d.ts +72 -0
  483. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/git-ls-files-strategy.d.ts.map +1 -0
  484. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/git-ls-files-strategy.js +176 -0
  485. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/git-ls-files-strategy.js.map +1 -0
  486. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/index.d.ts +9 -0
  487. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/index.d.ts.map +1 -0
  488. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/index.js +10 -0
  489. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/index.js.map +1 -0
  490. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/registry.d.ts +97 -0
  491. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/registry.d.ts.map +1 -0
  492. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/registry.js +140 -0
  493. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/registry.js.map +1 -0
  494. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/strategy.d.ts +58 -0
  495. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/strategy.d.ts.map +1 -0
  496. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/strategy.js +8 -0
  497. package/node_modules/@sudocode-ai/local-server/dist/services/file-search/strategy.js.map +1 -0
  498. package/node_modules/@sudocode-ai/local-server/dist/services/integration-sync-service.d.ts +185 -0
  499. package/node_modules/@sudocode-ai/local-server/dist/services/integration-sync-service.d.ts.map +1 -0
  500. package/node_modules/@sudocode-ai/local-server/dist/services/integration-sync-service.js +428 -0
  501. package/node_modules/@sudocode-ai/local-server/dist/services/integration-sync-service.js.map +1 -0
  502. package/node_modules/@sudocode-ai/local-server/dist/services/issues.d.ts +27 -0
  503. package/node_modules/@sudocode-ai/local-server/dist/services/issues.d.ts.map +1 -0
  504. package/node_modules/@sudocode-ai/local-server/dist/services/issues.js +35 -0
  505. package/node_modules/@sudocode-ai/local-server/dist/services/issues.js.map +1 -0
  506. package/node_modules/@sudocode-ai/local-server/dist/services/project-context.d.ts +97 -0
  507. package/node_modules/@sudocode-ai/local-server/dist/services/project-context.d.ts.map +1 -0
  508. package/node_modules/@sudocode-ai/local-server/dist/services/project-context.js +170 -0
  509. package/node_modules/@sudocode-ai/local-server/dist/services/project-context.js.map +1 -0
  510. package/node_modules/@sudocode-ai/local-server/dist/services/project-manager.d.ts +102 -0
  511. package/node_modules/@sudocode-ai/local-server/dist/services/project-manager.d.ts.map +1 -0
  512. package/node_modules/@sudocode-ai/local-server/dist/services/project-manager.js +502 -0
  513. package/node_modules/@sudocode-ai/local-server/dist/services/project-manager.js.map +1 -0
  514. package/node_modules/@sudocode-ai/local-server/dist/services/project-registry.d.ts +98 -0
  515. package/node_modules/@sudocode-ai/local-server/dist/services/project-registry.d.ts.map +1 -0
  516. package/node_modules/@sudocode-ai/local-server/dist/services/project-registry.js +289 -0
  517. package/node_modules/@sudocode-ai/local-server/dist/services/project-registry.js.map +1 -0
  518. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-resolver.d.ts +97 -0
  519. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-resolver.d.ts.map +1 -0
  520. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-resolver.js +377 -0
  521. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-resolver.js.map +1 -0
  522. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-template-engine.d.ts +108 -0
  523. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-template-engine.d.ts.map +1 -0
  524. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-template-engine.js +212 -0
  525. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-template-engine.js.map +1 -0
  526. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-templates.d.ts +97 -0
  527. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-templates.d.ts.map +1 -0
  528. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-templates.js +236 -0
  529. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-templates.js.map +1 -0
  530. package/node_modules/@sudocode-ai/local-server/dist/services/relationships.d.ts +35 -0
  531. package/node_modules/@sudocode-ai/local-server/dist/services/relationships.d.ts.map +1 -0
  532. package/node_modules/@sudocode-ai/local-server/dist/services/relationships.js +42 -0
  533. package/node_modules/@sudocode-ai/local-server/dist/services/relationships.js.map +1 -0
  534. package/node_modules/@sudocode-ai/local-server/dist/services/repo-info.d.ts +33 -0
  535. package/node_modules/@sudocode-ai/local-server/dist/services/repo-info.d.ts.map +1 -0
  536. package/node_modules/@sudocode-ai/local-server/dist/services/repo-info.js +136 -0
  537. package/node_modules/@sudocode-ai/local-server/dist/services/repo-info.js.map +1 -0
  538. package/node_modules/@sudocode-ai/local-server/dist/services/specs.d.ts +27 -0
  539. package/node_modules/@sudocode-ai/local-server/dist/services/specs.d.ts.map +1 -0
  540. package/node_modules/@sudocode-ai/local-server/dist/services/specs.js +35 -0
  541. package/node_modules/@sudocode-ai/local-server/dist/services/specs.js.map +1 -0
  542. package/node_modules/@sudocode-ai/local-server/dist/services/version-service.d.ts +14 -0
  543. package/node_modules/@sudocode-ai/local-server/dist/services/version-service.d.ts.map +1 -0
  544. package/node_modules/@sudocode-ai/local-server/dist/services/version-service.js +57 -0
  545. package/node_modules/@sudocode-ai/local-server/dist/services/version-service.js.map +1 -0
  546. package/node_modules/@sudocode-ai/local-server/dist/services/watcher.d.ts +49 -0
  547. package/node_modules/@sudocode-ai/local-server/dist/services/watcher.d.ts.map +1 -0
  548. package/node_modules/@sudocode-ai/local-server/dist/services/watcher.js +52 -0
  549. package/node_modules/@sudocode-ai/local-server/dist/services/watcher.js.map +1 -0
  550. package/node_modules/@sudocode-ai/local-server/dist/services/websocket.d.ts +179 -0
  551. package/node_modules/@sudocode-ai/local-server/dist/services/websocket.d.ts.map +1 -0
  552. package/node_modules/@sudocode-ai/local-server/dist/services/websocket.js +543 -0
  553. package/node_modules/@sudocode-ai/local-server/dist/services/websocket.js.map +1 -0
  554. package/node_modules/@sudocode-ai/local-server/dist/services/workflow-broadcast-service.d.ts +43 -0
  555. package/node_modules/@sudocode-ai/local-server/dist/services/workflow-broadcast-service.d.ts.map +1 -0
  556. package/node_modules/@sudocode-ai/local-server/dist/services/workflow-broadcast-service.js +155 -0
  557. package/node_modules/@sudocode-ai/local-server/dist/services/workflow-broadcast-service.js.map +1 -0
  558. package/node_modules/@sudocode-ai/local-server/dist/services/worktree-sync-service.d.ts +437 -0
  559. package/node_modules/@sudocode-ai/local-server/dist/services/worktree-sync-service.d.ts.map +1 -0
  560. package/node_modules/@sudocode-ai/local-server/dist/services/worktree-sync-service.js +1505 -0
  561. package/node_modules/@sudocode-ai/local-server/dist/services/worktree-sync-service.js.map +1 -0
  562. package/node_modules/@sudocode-ai/local-server/dist/types/editor.d.ts +49 -0
  563. package/node_modules/@sudocode-ai/local-server/dist/types/editor.d.ts.map +1 -0
  564. package/node_modules/@sudocode-ai/local-server/dist/types/editor.js +50 -0
  565. package/node_modules/@sudocode-ai/local-server/dist/types/editor.js.map +1 -0
  566. package/node_modules/@sudocode-ai/local-server/dist/types/project.d.ts +58 -0
  567. package/node_modules/@sudocode-ai/local-server/dist/types/project.d.ts.map +1 -0
  568. package/node_modules/@sudocode-ai/local-server/dist/types/project.js +10 -0
  569. package/node_modules/@sudocode-ai/local-server/dist/types/project.js.map +1 -0
  570. package/node_modules/@sudocode-ai/local-server/dist/utils/execFileNoThrow.d.ts +43 -0
  571. package/node_modules/@sudocode-ai/local-server/dist/utils/execFileNoThrow.d.ts.map +1 -0
  572. package/node_modules/@sudocode-ai/local-server/dist/utils/execFileNoThrow.js +53 -0
  573. package/node_modules/@sudocode-ai/local-server/dist/utils/execFileNoThrow.js.map +1 -0
  574. package/node_modules/@sudocode-ai/local-server/dist/utils/executable-check.d.ts +36 -0
  575. package/node_modules/@sudocode-ai/local-server/dist/utils/executable-check.d.ts.map +1 -0
  576. package/node_modules/@sudocode-ai/local-server/dist/utils/executable-check.js +79 -0
  577. package/node_modules/@sudocode-ai/local-server/dist/utils/executable-check.js.map +1 -0
  578. package/node_modules/@sudocode-ai/local-server/dist/utils/sudocode-dir.d.ts +6 -0
  579. package/node_modules/@sudocode-ai/local-server/dist/utils/sudocode-dir.d.ts.map +1 -0
  580. package/node_modules/@sudocode-ai/local-server/dist/utils/sudocode-dir.js +9 -0
  581. package/node_modules/@sudocode-ai/local-server/dist/utils/sudocode-dir.js.map +1 -0
  582. package/node_modules/@sudocode-ai/local-server/dist/workers/execution-worker.d.ts +18 -0
  583. package/node_modules/@sudocode-ai/local-server/dist/workers/execution-worker.d.ts.map +1 -0
  584. package/node_modules/@sudocode-ai/local-server/dist/workers/execution-worker.js +340 -0
  585. package/node_modules/@sudocode-ai/local-server/dist/workers/execution-worker.js.map +1 -0
  586. package/node_modules/@sudocode-ai/local-server/dist/workers/worker-ipc.d.ts +84 -0
  587. package/node_modules/@sudocode-ai/local-server/dist/workers/worker-ipc.d.ts.map +1 -0
  588. package/node_modules/@sudocode-ai/local-server/dist/workers/worker-ipc.js +29 -0
  589. package/node_modules/@sudocode-ai/local-server/dist/workers/worker-ipc.js.map +1 -0
  590. package/node_modules/@sudocode-ai/local-server/dist/workflow/base-workflow-engine.d.ts +186 -0
  591. package/node_modules/@sudocode-ai/local-server/dist/workflow/base-workflow-engine.d.ts.map +1 -0
  592. package/node_modules/@sudocode-ai/local-server/dist/workflow/base-workflow-engine.js +557 -0
  593. package/node_modules/@sudocode-ai/local-server/dist/workflow/base-workflow-engine.js.map +1 -0
  594. package/node_modules/@sudocode-ai/local-server/dist/workflow/dependency-analyzer.d.ts +78 -0
  595. package/node_modules/@sudocode-ai/local-server/dist/workflow/dependency-analyzer.d.ts.map +1 -0
  596. package/node_modules/@sudocode-ai/local-server/dist/workflow/dependency-analyzer.js +264 -0
  597. package/node_modules/@sudocode-ai/local-server/dist/workflow/dependency-analyzer.js.map +1 -0
  598. package/node_modules/@sudocode-ai/local-server/dist/workflow/engines/orchestrator-engine.d.ts +237 -0
  599. package/node_modules/@sudocode-ai/local-server/dist/workflow/engines/orchestrator-engine.d.ts.map +1 -0
  600. package/node_modules/@sudocode-ai/local-server/dist/workflow/engines/orchestrator-engine.js +749 -0
  601. package/node_modules/@sudocode-ai/local-server/dist/workflow/engines/orchestrator-engine.js.map +1 -0
  602. package/node_modules/@sudocode-ai/local-server/dist/workflow/engines/sequential-engine.d.ts +276 -0
  603. package/node_modules/@sudocode-ai/local-server/dist/workflow/engines/sequential-engine.d.ts.map +1 -0
  604. package/node_modules/@sudocode-ai/local-server/dist/workflow/engines/sequential-engine.js +1110 -0
  605. package/node_modules/@sudocode-ai/local-server/dist/workflow/engines/sequential-engine.js.map +1 -0
  606. package/node_modules/@sudocode-ai/local-server/dist/workflow/index.d.ts +15 -0
  607. package/node_modules/@sudocode-ai/local-server/dist/workflow/index.d.ts.map +1 -0
  608. package/node_modules/@sudocode-ai/local-server/dist/workflow/index.js +22 -0
  609. package/node_modules/@sudocode-ai/local-server/dist/workflow/index.js.map +1 -0
  610. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/api-client.d.ts +103 -0
  611. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/api-client.d.ts.map +1 -0
  612. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/api-client.js +193 -0
  613. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/api-client.js.map +1 -0
  614. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/index.d.ts +16 -0
  615. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/index.d.ts.map +1 -0
  616. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/index.js +114 -0
  617. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/index.js.map +1 -0
  618. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/server.d.ts +85 -0
  619. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/server.d.ts.map +1 -0
  620. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/server.js +520 -0
  621. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/server.js.map +1 -0
  622. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/escalation.d.ts +36 -0
  623. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/escalation.d.ts.map +1 -0
  624. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/escalation.js +47 -0
  625. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/escalation.js.map +1 -0
  626. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/execution.d.ts +59 -0
  627. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/execution.d.ts.map +1 -0
  628. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/execution.js +67 -0
  629. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/execution.js.map +1 -0
  630. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/inspection.d.ts +82 -0
  631. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/inspection.d.ts.map +1 -0
  632. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/inspection.js +57 -0
  633. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/inspection.js.map +1 -0
  634. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/workflow.d.ts +59 -0
  635. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/workflow.d.ts.map +1 -0
  636. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/workflow.js +40 -0
  637. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/tools/workflow.js.map +1 -0
  638. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/types.d.ts +345 -0
  639. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/types.d.ts.map +1 -0
  640. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/types.js +7 -0
  641. package/node_modules/@sudocode-ai/local-server/dist/workflow/mcp/types.js.map +1 -0
  642. package/node_modules/@sudocode-ai/local-server/dist/workflow/services/prompt-builder.d.ts +36 -0
  643. package/node_modules/@sudocode-ai/local-server/dist/workflow/services/prompt-builder.d.ts.map +1 -0
  644. package/node_modules/@sudocode-ai/local-server/dist/workflow/services/prompt-builder.js +329 -0
  645. package/node_modules/@sudocode-ai/local-server/dist/workflow/services/prompt-builder.js.map +1 -0
  646. package/node_modules/@sudocode-ai/local-server/dist/workflow/services/wakeup-service.d.ts +262 -0
  647. package/node_modules/@sudocode-ai/local-server/dist/workflow/services/wakeup-service.d.ts.map +1 -0
  648. package/node_modules/@sudocode-ai/local-server/dist/workflow/services/wakeup-service.js +809 -0
  649. package/node_modules/@sudocode-ai/local-server/dist/workflow/services/wakeup-service.js.map +1 -0
  650. package/node_modules/@sudocode-ai/local-server/dist/workflow/workflow-engine.d.ts +221 -0
  651. package/node_modules/@sudocode-ai/local-server/dist/workflow/workflow-engine.d.ts.map +1 -0
  652. package/node_modules/@sudocode-ai/local-server/dist/workflow/workflow-engine.js +94 -0
  653. package/node_modules/@sudocode-ai/local-server/dist/workflow/workflow-engine.js.map +1 -0
  654. package/node_modules/@sudocode-ai/local-server/dist/workflow/workflow-event-emitter.d.ts +278 -0
  655. package/node_modules/@sudocode-ai/local-server/dist/workflow/workflow-event-emitter.d.ts.map +1 -0
  656. package/node_modules/@sudocode-ai/local-server/dist/workflow/workflow-event-emitter.js +259 -0
  657. package/node_modules/@sudocode-ai/local-server/dist/workflow/workflow-event-emitter.js.map +1 -0
  658. package/node_modules/@sudocode-ai/local-server/package.json +78 -0
  659. package/node_modules/@sudocode-ai/mcp/README.md +226 -0
  660. package/node_modules/@sudocode-ai/mcp/dist/client.d.ts +33 -0
  661. package/node_modules/@sudocode-ai/mcp/dist/client.d.ts.map +1 -0
  662. package/node_modules/@sudocode-ai/mcp/dist/client.js +166 -0
  663. package/node_modules/@sudocode-ai/mcp/dist/client.js.map +1 -0
  664. package/node_modules/@sudocode-ai/mcp/dist/index.d.ts +6 -0
  665. package/node_modules/@sudocode-ai/mcp/dist/index.d.ts.map +1 -0
  666. package/node_modules/@sudocode-ai/mcp/dist/index.js +64 -0
  667. package/node_modules/@sudocode-ai/mcp/dist/index.js.map +1 -0
  668. package/node_modules/@sudocode-ai/mcp/dist/server.d.ts +26 -0
  669. package/node_modules/@sudocode-ai/mcp/dist/server.d.ts.map +1 -0
  670. package/node_modules/@sudocode-ai/mcp/dist/server.js +577 -0
  671. package/node_modules/@sudocode-ai/mcp/dist/server.js.map +1 -0
  672. package/node_modules/@sudocode-ai/mcp/dist/tools/analytics.d.ts +41 -0
  673. package/node_modules/@sudocode-ai/mcp/dist/tools/analytics.d.ts.map +1 -0
  674. package/node_modules/@sudocode-ai/mcp/dist/tools/analytics.js +21 -0
  675. package/node_modules/@sudocode-ai/mcp/dist/tools/analytics.js.map +1 -0
  676. package/node_modules/@sudocode-ai/mcp/dist/tools/feedback.d.ts +21 -0
  677. package/node_modules/@sudocode-ai/mcp/dist/tools/feedback.d.ts.map +1 -0
  678. package/node_modules/@sudocode-ai/mcp/dist/tools/feedback.js +30 -0
  679. package/node_modules/@sudocode-ai/mcp/dist/tools/feedback.js.map +1 -0
  680. package/node_modules/@sudocode-ai/mcp/dist/tools/init.d.ts +17 -0
  681. package/node_modules/@sudocode-ai/mcp/dist/tools/init.d.ts.map +1 -0
  682. package/node_modules/@sudocode-ai/mcp/dist/tools/init.js +15 -0
  683. package/node_modules/@sudocode-ai/mcp/dist/tools/init.js.map +1 -0
  684. package/node_modules/@sudocode-ai/mcp/dist/tools/issues.d.ts +44 -0
  685. package/node_modules/@sudocode-ai/mcp/dist/tools/issues.d.ts.map +1 -0
  686. package/node_modules/@sudocode-ai/mcp/dist/tools/issues.js +109 -0
  687. package/node_modules/@sudocode-ai/mcp/dist/tools/issues.js.map +1 -0
  688. package/node_modules/@sudocode-ai/mcp/dist/tools/references.d.ts +21 -0
  689. package/node_modules/@sudocode-ai/mcp/dist/tools/references.d.ts.map +1 -0
  690. package/node_modules/@sudocode-ai/mcp/dist/tools/references.js +49 -0
  691. package/node_modules/@sudocode-ai/mcp/dist/tools/references.js.map +1 -0
  692. package/node_modules/@sudocode-ai/mcp/dist/tools/relationships.d.ts +15 -0
  693. package/node_modules/@sudocode-ai/mcp/dist/tools/relationships.d.ts.map +1 -0
  694. package/node_modules/@sudocode-ai/mcp/dist/tools/relationships.js +18 -0
  695. package/node_modules/@sudocode-ai/mcp/dist/tools/relationships.js.map +1 -0
  696. package/node_modules/@sudocode-ai/mcp/dist/tools/specs.d.ts +35 -0
  697. package/node_modules/@sudocode-ai/mcp/dist/tools/specs.d.ts.map +1 -0
  698. package/node_modules/@sudocode-ai/mcp/dist/tools/specs.js +85 -0
  699. package/node_modules/@sudocode-ai/mcp/dist/tools/specs.js.map +1 -0
  700. package/node_modules/@sudocode-ai/mcp/dist/types.d.ts +35 -0
  701. package/node_modules/@sudocode-ai/mcp/dist/types.d.ts.map +1 -0
  702. package/node_modules/@sudocode-ai/mcp/dist/types.js +21 -0
  703. package/node_modules/@sudocode-ai/mcp/dist/types.js.map +1 -0
  704. package/node_modules/@sudocode-ai/mcp/package.json +67 -0
  705. package/node_modules/@sudocode-ai/types/README.md +7 -0
  706. package/node_modules/@sudocode-ai/types/package.json +76 -0
  707. package/node_modules/@sudocode-ai/types/src/agents.d.ts +278 -0
  708. package/node_modules/@sudocode-ai/types/src/artifacts.d.ts +66 -0
  709. package/node_modules/@sudocode-ai/types/src/events.d.ts +70 -0
  710. package/node_modules/@sudocode-ai/types/src/index.d.ts +452 -0
  711. package/node_modules/@sudocode-ai/types/src/integrations.d.ts +454 -0
  712. package/node_modules/@sudocode-ai/types/src/workflows.d.ts +501 -0
  713. package/node_modules/commander/LICENSE +22 -0
  714. package/node_modules/commander/Readme.md +1149 -0
  715. package/node_modules/commander/esm.mjs +16 -0
  716. package/node_modules/commander/index.js +24 -0
  717. package/node_modules/commander/lib/argument.js +149 -0
  718. package/node_modules/commander/lib/command.js +2662 -0
  719. package/node_modules/commander/lib/error.js +39 -0
  720. package/node_modules/commander/lib/help.js +709 -0
  721. package/node_modules/commander/lib/option.js +367 -0
  722. package/node_modules/commander/lib/suggestSimilar.js +101 -0
  723. package/node_modules/commander/package-support.json +16 -0
  724. package/node_modules/commander/package.json +82 -0
  725. package/node_modules/commander/typings/esm.d.mts +3 -0
  726. package/node_modules/commander/typings/index.d.ts +1045 -0
  727. package/node_modules/glob/LICENSE +15 -0
  728. package/node_modules/glob/README.md +1265 -0
  729. package/node_modules/glob/package.json +99 -0
  730. package/node_modules/isexe/LICENSE +15 -0
  731. package/node_modules/isexe/README.md +74 -0
  732. package/node_modules/isexe/package.json +96 -0
  733. package/node_modules/which/LICENSE +15 -0
  734. package/node_modules/which/README.md +51 -0
  735. package/node_modules/which/bin/which.js +52 -0
  736. package/node_modules/which/lib/index.js +111 -0
  737. package/node_modules/which/package.json +52 -0
  738. package/package.json +9 -9
@@ -0,0 +1,1240 @@
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 { PromptResolver } from "./prompt-resolver.js";
22
+ import { execFileNoThrow } from "../utils/execFileNoThrow.js";
23
+ /**
24
+ * Build worktree context string to append to system prompt.
25
+ *
26
+ * This helps agents understand they're working in an isolated worktree
27
+ * and should only edit files within that worktree.
28
+ *
29
+ * @param worktreePath - Path to the worktree directory
30
+ * @param branchName - Name of the branch in the worktree
31
+ * @param repoPath - Path to the main repository
32
+ * @returns System prompt context string, or empty string if not in worktree mode
33
+ */
34
+ function buildWorktreeSystemPromptContext(worktreePath, branchName, repoPath) {
35
+ if (!worktreePath) {
36
+ return "";
37
+ }
38
+ return `
39
+ ## Worktree Context
40
+
41
+ You are working in an **isolated git worktree**, not the main repository.
42
+
43
+ - **Worktree path**: ${worktreePath}
44
+ - **Branch**: ${branchName || "unknown"}
45
+ - **Main repository**: ${repoPath}
46
+
47
+ **IMPORTANT**: You MUST only read and edit files within the worktree directory (${worktreePath}).
48
+ Do NOT attempt to read or edit files in the main repository (${repoPath}) or any other directory outside the worktree.
49
+ All file paths you use should be relative to or within: ${worktreePath}
50
+
51
+ This isolation ensures your changes don't affect other work in progress.
52
+ `;
53
+ }
54
+ /**
55
+ * ExecutionService
56
+ *
57
+ * Manages the full lifecycle of issue-based executions:
58
+ * - Creating and starting executions with worktree isolation
59
+ * - Creating follow-up executions that reuse worktrees
60
+ * - Canceling and cleaning up executions
61
+ */
62
+ export class ExecutionService {
63
+ db;
64
+ projectId;
65
+ lifecycleService;
66
+ repoPath;
67
+ transportManager;
68
+ logsStore;
69
+ workerPool;
70
+ /**
71
+ * Create a new ExecutionService
72
+ *
73
+ * @param db - Database instance
74
+ * @param projectId - Project ID for WebSocket broadcasts
75
+ * @param repoPath - Path to the git repository
76
+ * @param lifecycleService - Optional execution lifecycle service (creates one if not provided)
77
+ * @param transportManager - Optional transport manager for SSE streaming
78
+ * @param logsStore - Optional execution logs store (creates one if not provided)
79
+ * @param workerPool - Optional worker pool for isolated execution processes
80
+ */
81
+ constructor(db, projectId, repoPath, lifecycleService, transportManager, logsStore, workerPool) {
82
+ this.db = db;
83
+ this.projectId = projectId;
84
+ this.repoPath = repoPath;
85
+ this.lifecycleService =
86
+ lifecycleService || new ExecutionLifecycleService(db, repoPath);
87
+ this.transportManager = transportManager;
88
+ this.logsStore = logsStore || new ExecutionLogsStore(db);
89
+ this.workerPool = workerPool;
90
+ }
91
+ /**
92
+ * Create and start execution
93
+ *
94
+ * Creates an execution record, sets up worktree (if needed), and starts
95
+ * workflow execution. Returns the execution record immediately while
96
+ * workflow runs in the background.
97
+ *
98
+ * @param issueId - ID of issue to execute, or null for orchestrator executions
99
+ * @param config - Execution configuration
100
+ * @param prompt - Rendered prompt to execute
101
+ * @param agentType - Type of agent to use (defaults to 'claude-code')
102
+ * @param workflowContext - Optional workflow context for workflow-spawned executions
103
+ * @returns Created execution record
104
+ */
105
+ async createExecution(issueId, config, prompt, agentType = "claude-code", workflowContext) {
106
+ // 1. Validate
107
+ if (!prompt.trim()) {
108
+ throw new Error("Prompt cannot be empty");
109
+ }
110
+ // 2. Build execution config with auto-injected MCP servers
111
+ const mergedConfig = await this.buildExecutionConfig(agentType, config);
112
+ // Get issue if issueId is provided (orchestrator executions don't have an issue)
113
+ let issue;
114
+ if (issueId) {
115
+ issue = this.db
116
+ .prepare("SELECT * FROM issues WHERE id = ?")
117
+ .get(issueId);
118
+ if (!issue) {
119
+ throw new Error(`Issue ${issueId} not found`);
120
+ }
121
+ }
122
+ // Get the current branch as default (instead of hardcoding "main")
123
+ let defaultBranch = "main";
124
+ try {
125
+ defaultBranch = execSync("git rev-parse --abbrev-ref HEAD", {
126
+ cwd: this.repoPath,
127
+ encoding: "utf-8",
128
+ }).trim();
129
+ }
130
+ catch {
131
+ // Fall back to "main" if we can't determine current branch
132
+ }
133
+ // 3. Determine execution mode and create execution with worktree
134
+ // Store the original (unexpanded) prompt in the database
135
+ const mode = mergedConfig.mode || "worktree";
136
+ let execution;
137
+ let workDir;
138
+ // Worktree mode requires either an issue or a reuseWorktreePath
139
+ if (mode === "worktree" && !issueId && !mergedConfig.reuseWorktreePath) {
140
+ throw new Error("Worktree mode requires either an issueId or reuseWorktreePath");
141
+ }
142
+ if (mode === "worktree" && (issueId || mergedConfig.reuseWorktreePath)) {
143
+ // Check if we're reusing an existing worktree
144
+ if (mergedConfig.reuseWorktreePath) {
145
+ // Validate worktree exists
146
+ if (!fs.existsSync(mergedConfig.reuseWorktreePath)) {
147
+ throw new Error(`Cannot reuse worktree: path does not exist: ${mergedConfig.reuseWorktreePath}`);
148
+ }
149
+ // Validate it's a git worktree by checking for .git
150
+ const gitPath = path.join(mergedConfig.reuseWorktreePath, ".git");
151
+ if (!fs.existsSync(gitPath)) {
152
+ throw new Error(`Cannot reuse worktree: not a valid git worktree: ${mergedConfig.reuseWorktreePath}`);
153
+ }
154
+ // Get branch name from the worktree
155
+ let branchName;
156
+ try {
157
+ branchName = execSync("git rev-parse --abbrev-ref HEAD", {
158
+ cwd: mergedConfig.reuseWorktreePath,
159
+ encoding: "utf-8",
160
+ }).trim();
161
+ }
162
+ catch {
163
+ throw new Error(`Cannot reuse worktree: failed to get branch name from: ${mergedConfig.reuseWorktreePath}`);
164
+ }
165
+ // Capture before_commit from the reused worktree
166
+ let beforeCommit;
167
+ try {
168
+ beforeCommit = execSync("git rev-parse HEAD", {
169
+ cwd: mergedConfig.reuseWorktreePath,
170
+ encoding: "utf-8",
171
+ }).trim();
172
+ console.log(`[ExecutionService] Captured before_commit for reused worktree: ${beforeCommit}`);
173
+ }
174
+ catch (error) {
175
+ console.warn("[ExecutionService] Failed to capture before_commit for reused worktree:", error instanceof Error ? error.message : String(error));
176
+ // Continue - this is supplementary data
177
+ }
178
+ // Create execution record with the reused worktree path
179
+ const executionId = randomUUID();
180
+ execution = createExecution(this.db, {
181
+ id: executionId,
182
+ issue_id: issueId,
183
+ agent_type: agentType,
184
+ mode: mode,
185
+ prompt: prompt,
186
+ config: JSON.stringify(mergedConfig),
187
+ target_branch: mergedConfig.baseBranch || branchName,
188
+ branch_name: branchName,
189
+ worktree_path: mergedConfig.reuseWorktreePath,
190
+ parent_execution_id: mergedConfig.parentExecutionId,
191
+ before_commit: beforeCommit,
192
+ });
193
+ workDir = mergedConfig.reuseWorktreePath;
194
+ }
195
+ else {
196
+ // Create execution with isolated worktree
197
+ // This path requires issueId and issue (reuseWorktreePath not provided)
198
+ if (!issueId || !issue) {
199
+ throw new Error("Creating new worktree requires an issueId (use reuseWorktreePath for issue-less executions)");
200
+ }
201
+ const result = await this.lifecycleService.createExecutionWithWorktree({
202
+ issueId,
203
+ issueTitle: issue.title,
204
+ agentType: agentType,
205
+ targetBranch: mergedConfig.baseBranch || defaultBranch,
206
+ repoPath: this.repoPath,
207
+ mode: mode,
208
+ prompt: prompt, // Store original (unexpanded) prompt
209
+ config: JSON.stringify(mergedConfig),
210
+ createTargetBranch: mergedConfig.createBaseBranch || false,
211
+ parentExecutionId: mergedConfig.parentExecutionId,
212
+ });
213
+ execution = result.execution;
214
+ workDir = result.worktreePath;
215
+ }
216
+ }
217
+ else {
218
+ // Local mode - create execution without worktree
219
+ const executionId = randomUUID();
220
+ execution = createExecution(this.db, {
221
+ id: executionId,
222
+ issue_id: issueId,
223
+ agent_type: agentType,
224
+ mode: mode,
225
+ prompt: prompt, // Store original (unexpanded) prompt
226
+ config: JSON.stringify(mergedConfig),
227
+ target_branch: mergedConfig.baseBranch || defaultBranch,
228
+ branch_name: mergedConfig.baseBranch || defaultBranch,
229
+ parent_execution_id: mergedConfig.parentExecutionId,
230
+ });
231
+ workDir = this.repoPath;
232
+ // Capture current commit as before_commit for local mode
233
+ try {
234
+ const beforeCommit = execSync("git rev-parse HEAD", {
235
+ cwd: this.repoPath,
236
+ encoding: "utf-8",
237
+ }).trim();
238
+ updateExecution(this.db, executionId, {
239
+ before_commit: beforeCommit,
240
+ });
241
+ // Reload execution to get updated before_commit
242
+ const updatedExecution = getExecution(this.db, executionId);
243
+ if (updatedExecution) {
244
+ execution = updatedExecution;
245
+ }
246
+ }
247
+ catch (error) {
248
+ console.warn("[ExecutionService] Failed to capture before_commit for local mode:", error instanceof Error ? error.message : String(error));
249
+ // Continue - this is supplementary data
250
+ }
251
+ }
252
+ // 3. Update workflow context if provided
253
+ if (workflowContext) {
254
+ updateExecution(this.db, execution.id, {
255
+ workflow_execution_id: workflowContext.workflowId,
256
+ });
257
+ // Reload execution to get updated workflow_execution_id
258
+ const updatedExecution = getExecution(this.db, execution.id);
259
+ if (updatedExecution) {
260
+ execution = updatedExecution;
261
+ }
262
+ }
263
+ // 4. Resolve prompt references for execution (done after storing original)
264
+ // Pass the issue ID so the issue content is automatically included even if not explicitly mentioned
265
+ const resolver = new PromptResolver(this.db);
266
+ const { resolvedPrompt, errors } = await resolver.resolve(prompt, new Set(), issueId ?? undefined);
267
+ if (errors.length > 0) {
268
+ console.warn(`[ExecutionService] Prompt resolution warnings:`, errors);
269
+ }
270
+ // Initialize empty logs for this execution
271
+ try {
272
+ this.logsStore.initializeLogs(execution.id);
273
+ }
274
+ catch (error) {
275
+ console.error("[ExecutionService] Failed to initialize logs (non-critical):", {
276
+ executionId: execution.id,
277
+ error: error instanceof Error ? error.message : String(error),
278
+ });
279
+ // Don't fail execution creation - logs are nice-to-have
280
+ }
281
+ // 3. Start execution (use worker pool if available, otherwise fall back to in-process)
282
+ if (this.workerPool) {
283
+ // Worker pool handles all execution logic in isolated process
284
+ const dbPath = this.db.name;
285
+ await this.workerPool.startExecution(execution, this.repoPath, dbPath);
286
+ // Broadcast execution creation
287
+ broadcastExecutionUpdate(this.projectId, execution.id, "created", execution, execution.issue_id || undefined);
288
+ return execution;
289
+ }
290
+ // 4. In-process execution with executor wrapper (fallback when no worker pool)
291
+ // Extract agent-relevant config fields (exclude sudocode-specific fields like mode,
292
+ // baseBranch, createBaseBranch, branchName, reuseWorktreePath, etc.)
293
+ const { mode: _mode, baseBranch: _baseBranch, createBaseBranch: _createBaseBranch, branchName: _branchName, reuseWorktreePath: _reuseWorktreePath, checkpointInterval: _checkpointInterval, continueOnStepFailure: _continueOnStepFailure, captureFileChanges: _captureFileChanges, captureToolCalls: _captureToolCalls, ...agentConfig } = mergedConfig;
294
+ const wrapper = createExecutorForAgent(agentType, {
295
+ workDir: this.repoPath,
296
+ ...agentConfig,
297
+ }, {
298
+ workDir: this.repoPath,
299
+ lifecycleService: this.lifecycleService,
300
+ logsStore: this.logsStore,
301
+ projectId: this.projectId,
302
+ db: this.db,
303
+ transportManager: this.transportManager,
304
+ });
305
+ // Log incoming config for debugging
306
+ console.log("[ExecutionService] createExecution mergedConfig:", {
307
+ hasMcpServers: !!mergedConfig.mcpServers,
308
+ mcpServerNames: mergedConfig.mcpServers
309
+ ? Object.keys(mergedConfig.mcpServers)
310
+ : "none",
311
+ hasAppendSystemPrompt: !!mergedConfig.appendSystemPrompt,
312
+ dangerouslySkipPermissions: mergedConfig.dangerouslySkipPermissions,
313
+ });
314
+ // Log agentConfig being passed to executor
315
+ console.log("[ExecutionService] agentConfig passed to executor:", {
316
+ hasMcpServers: !!agentConfig.mcpServers,
317
+ mcpServerNames: agentConfig.mcpServers
318
+ ? Object.keys(agentConfig.mcpServers)
319
+ : "none",
320
+ hasAppendSystemPrompt: !!agentConfig.appendSystemPrompt,
321
+ dangerouslySkipPermissions: agentConfig
322
+ .dangerouslySkipPermissions,
323
+ allKeys: Object.keys(agentConfig),
324
+ });
325
+ // Build worktree context for system prompt (if in worktree mode)
326
+ const worktreeContext = buildWorktreeSystemPromptContext(execution.worktree_path ?? undefined, execution.branch_name ?? undefined, this.repoPath);
327
+ // Merge worktree context with any existing appendSystemPrompt
328
+ const combinedAppendSystemPrompt = [
329
+ worktreeContext,
330
+ mergedConfig.appendSystemPrompt || "",
331
+ ]
332
+ .filter(Boolean)
333
+ .join("\n");
334
+ // Build execution task (prompt already resolved above)
335
+ const task = {
336
+ id: execution.id,
337
+ type: "issue",
338
+ entityId: issueId ?? undefined,
339
+ prompt: resolvedPrompt,
340
+ workDir: workDir,
341
+ config: {
342
+ timeout: mergedConfig.timeout,
343
+ },
344
+ metadata: {
345
+ model: mergedConfig.model || "claude-sonnet-4",
346
+ captureFileChanges: mergedConfig.captureFileChanges ?? true,
347
+ captureToolCalls: mergedConfig.captureToolCalls ?? true,
348
+ issueId: issueId ?? undefined,
349
+ executionId: execution.id,
350
+ mcpServers: mergedConfig.mcpServers,
351
+ appendSystemPrompt: combinedAppendSystemPrompt || undefined,
352
+ dangerouslySkipPermissions: mergedConfig.dangerouslySkipPermissions,
353
+ resume: mergedConfig.resume,
354
+ },
355
+ priority: 0,
356
+ dependencies: [],
357
+ createdAt: new Date(),
358
+ };
359
+ console.log("[ExecutionService] Task metadata mcpServers:", {
360
+ hasMcpServers: !!task.metadata?.mcpServers,
361
+ mcpServerNames: task.metadata?.mcpServers
362
+ ? Object.keys(task.metadata.mcpServers)
363
+ : "none",
364
+ });
365
+ // Execute with full lifecycle management (non-blocking)
366
+ wrapper.executeWithLifecycle(execution.id, task, workDir).catch((error) => {
367
+ console.error(`[ExecutionService] Execution ${execution.id} failed:`, error);
368
+ // Error is already handled by wrapper (status updated, broadcasts sent)
369
+ });
370
+ // Broadcast execution creation
371
+ broadcastExecutionUpdate(this.projectId, execution.id, "created", execution, execution.issue_id || undefined);
372
+ return execution;
373
+ }
374
+ /**
375
+ * Create follow-up execution
376
+ *
377
+ * For worktree-based executions: reuses the worktree and resumes the session.
378
+ * For local/non-worktree executions: creates a new execution with feedback context.
379
+ *
380
+ * @param executionId - ID of previous execution to follow up on
381
+ * @param feedback - Additional feedback/context to append to prompt
382
+ * @param options - Optional configuration
383
+ * @param options.includeOriginalPrompt - Whether to prepend the original issue content (default: false, assumes session resumption with full history)
384
+ * @returns Created follow-up execution record
385
+ */
386
+ async createFollowUp(executionId, feedback, options) {
387
+ // 1. Get previous execution
388
+ const prevExecution = getExecution(this.db, executionId);
389
+ if (!prevExecution) {
390
+ throw new Error(`Execution ${executionId} not found`);
391
+ }
392
+ const hasWorktree = !!prevExecution.worktree_path;
393
+ // For worktree executions, check if worktree still exists on filesystem, recreate if needed
394
+ if (hasWorktree && this.lifecycleService) {
395
+ const fs = await import("fs");
396
+ const worktreeExists = fs.existsSync(prevExecution.worktree_path);
397
+ if (!worktreeExists) {
398
+ console.log(`Recreating worktree for follow-up execution: ${prevExecution.worktree_path}`);
399
+ // Recreate the worktree using the same path and branch
400
+ const worktreeManager = this.lifecycleService.worktreeManager;
401
+ await worktreeManager.createWorktree({
402
+ repoPath: this.repoPath,
403
+ branchName: prevExecution.branch_name,
404
+ worktreePath: prevExecution.worktree_path,
405
+ baseBranch: prevExecution.target_branch,
406
+ createBranch: false, // Branch already exists, just recreate worktree
407
+ });
408
+ }
409
+ }
410
+ // TODO: Make it so follow-ups don't require an issue id.
411
+ // 2. Build follow-up prompt (default: just feedback, assumes session resumption)
412
+ let followUpPrompt = feedback;
413
+ if (options?.includeOriginalPrompt) {
414
+ // Optional: include original issue content if explicitly requested
415
+ if (!prevExecution.issue_id) {
416
+ throw new Error("Previous execution must have an issue_id to include original prompt");
417
+ }
418
+ // Get issue content directly from database
419
+ const issue = this.db
420
+ .prepare("SELECT content FROM issues WHERE id = ?")
421
+ .get(prevExecution.issue_id);
422
+ if (!issue) {
423
+ throw new Error(`Issue ${prevExecution.issue_id} not found`);
424
+ }
425
+ followUpPrompt = `${issue.content}
426
+
427
+ ${feedback}`;
428
+ }
429
+ // 3. Create new execution record that references previous execution
430
+ // Default to 'claude-code' if agent_type is null (for backwards compatibility)
431
+ const agentType = (prevExecution.agent_type || "claude-code");
432
+ // Determine working directory: worktree path if available, otherwise repo path (local mode)
433
+ const workDir = hasWorktree ? prevExecution.worktree_path : this.repoPath;
434
+ const newExecutionId = randomUUID();
435
+ const newExecution = createExecution(this.db, {
436
+ id: newExecutionId,
437
+ issue_id: prevExecution.issue_id,
438
+ agent_type: agentType, // Use same agent as previous execution
439
+ mode: prevExecution.mode || (hasWorktree ? "worktree" : "local"), // Inherit mode from parent
440
+ target_branch: prevExecution.target_branch,
441
+ branch_name: prevExecution.branch_name,
442
+ worktree_path: prevExecution.worktree_path || undefined, // Reuse same worktree (undefined for local)
443
+ config: prevExecution.config || undefined, // Preserve config (including cleanupMode) from previous execution
444
+ parent_execution_id: executionId, // Link to parent execution for follow-up chain
445
+ prompt: followUpPrompt, // Store original (unexpanded) follow-up prompt
446
+ });
447
+ // Initialize empty logs for this execution
448
+ try {
449
+ this.logsStore.initializeLogs(newExecution.id);
450
+ }
451
+ catch (error) {
452
+ console.error("[ExecutionService] Failed to initialize logs (non-critical):", {
453
+ executionId: newExecution.id,
454
+ error: error instanceof Error ? error.message : String(error),
455
+ });
456
+ // Don't fail execution creation - logs are nice-to-have
457
+ }
458
+ // Collect already-expanded entities from parent execution chain
459
+ const alreadyExpandedIds = await this.collectExpandedEntitiesFromChain(executionId);
460
+ // Resolve prompt references for execution (done after storing original)
461
+ // Skip entities that were already expanded in parent executions
462
+ const resolver = new PromptResolver(this.db);
463
+ const { resolvedPrompt, errors } = await resolver.resolve(followUpPrompt, alreadyExpandedIds);
464
+ if (errors.length > 0) {
465
+ console.warn(`[ExecutionService] Follow-up prompt resolution warnings:`, errors);
466
+ }
467
+ // Parse config to get model and other settings
468
+ // This is done early so we can pass it to the executor
469
+ const parsedConfig = prevExecution.config
470
+ ? JSON.parse(prevExecution.config)
471
+ : {};
472
+ // 4. Use executor wrapper with session resumption
473
+ // IMPORTANT: Pass the full config from parent execution to preserve mcpServers,
474
+ // dangerouslySkipPermissions, appendSystemPrompt, and other settings
475
+ // Extract agent-relevant config fields (exclude sudocode-specific fields)
476
+ const { mode: _mode, baseBranch: _baseBranch, createBaseBranch: _createBaseBranch, branchName: _branchName, reuseWorktreePath: _reuseWorktreePath, checkpointInterval: _checkpointInterval, continueOnStepFailure: _continueOnStepFailure, captureFileChanges: _captureFileChanges, captureToolCalls: _captureToolCalls, ...parentAgentConfig } = parsedConfig;
477
+ const wrapper = createExecutorForAgent(agentType, {
478
+ workDir: this.repoPath,
479
+ ...parentAgentConfig,
480
+ }, {
481
+ workDir: this.repoPath,
482
+ lifecycleService: this.lifecycleService,
483
+ logsStore: this.logsStore,
484
+ projectId: this.projectId,
485
+ db: this.db,
486
+ transportManager: this.transportManager,
487
+ });
488
+ // Use previous execution's session_id (the actual Claude UUID) if available
489
+ // This enables proper session resumption with Claude Code's --resume-session flag
490
+ // If no session_id was captured, we can't resume - this would start a new session
491
+ const sessionId = prevExecution.session_id;
492
+ if (!sessionId) {
493
+ console.warn(`[ExecutionService] No session_id found for execution ${executionId}, follow-up will start a new session`);
494
+ }
495
+ // Build worktree context for system prompt (if in worktree mode)
496
+ const followUpWorktreeContext = buildWorktreeSystemPromptContext(newExecution.worktree_path ?? undefined, newExecution.branch_name ?? undefined, this.repoPath);
497
+ // Merge worktree context with any existing appendSystemPrompt from parent config
498
+ const followUpCombinedAppendSystemPrompt = [
499
+ followUpWorktreeContext,
500
+ parsedConfig.appendSystemPrompt || "",
501
+ ]
502
+ .filter(Boolean)
503
+ .join("\n");
504
+ // Build execution task for follow-up (use resolved prompt for agent)
505
+ // IMPORTANT: Inherit ALL config from parent execution
506
+ // This ensures orchestrator follow-ups retain dangerouslySkipPermissions, mcpServers,
507
+ // appendSystemPrompt, and any other config fields
508
+ const task = {
509
+ id: newExecution.id,
510
+ type: "issue",
511
+ entityId: prevExecution.issue_id ?? undefined,
512
+ prompt: resolvedPrompt,
513
+ workDir: workDir,
514
+ config: {
515
+ timeout: parsedConfig.timeout,
516
+ },
517
+ metadata: {
518
+ // Spread all config fields from parent execution first
519
+ ...parsedConfig,
520
+ // Then override specific fields for this follow-up
521
+ model: parsedConfig.model || "claude-sonnet-4",
522
+ captureFileChanges: parsedConfig.captureFileChanges ?? true,
523
+ captureToolCalls: parsedConfig.captureToolCalls ?? true,
524
+ issueId: prevExecution.issue_id ?? undefined,
525
+ executionId: newExecution.id,
526
+ followUpOf: executionId,
527
+ // Override appendSystemPrompt with combined worktree context
528
+ appendSystemPrompt: followUpCombinedAppendSystemPrompt || undefined,
529
+ },
530
+ priority: 0,
531
+ dependencies: [],
532
+ createdAt: new Date(),
533
+ };
534
+ console.log("[ExecutionService] Follow-up task metadata:", {
535
+ executionId: newExecution.id,
536
+ parentExecutionId: executionId,
537
+ inheritedConfigKeys: Object.keys(parsedConfig),
538
+ hasMcpServers: !!parsedConfig.mcpServers,
539
+ mcpServerNames: parsedConfig.mcpServers
540
+ ? Object.keys(parsedConfig.mcpServers)
541
+ : "none",
542
+ dangerouslySkipPermissions: parsedConfig.dangerouslySkipPermissions,
543
+ hasAppendSystemPrompt: !!parsedConfig.appendSystemPrompt,
544
+ model: parsedConfig.model,
545
+ });
546
+ // Execute follow-up (non-blocking)
547
+ // If we have a session ID, resume the session; otherwise start a new one
548
+ if (sessionId) {
549
+ wrapper
550
+ .resumeWithLifecycle(newExecution.id, sessionId, task, workDir)
551
+ .catch((error) => {
552
+ console.error(`[ExecutionService] Follow-up execution ${newExecution.id} failed:`, error);
553
+ // Error is already handled by wrapper (status updated, broadcasts sent)
554
+ });
555
+ }
556
+ else {
557
+ // No session to resume, start a new execution with the follow-up prompt
558
+ wrapper
559
+ .executeWithLifecycle(newExecution.id, task, workDir)
560
+ .catch((error) => {
561
+ console.error(`[ExecutionService] Follow-up execution ${newExecution.id} failed:`, error);
562
+ });
563
+ }
564
+ // Broadcast execution creation
565
+ broadcastExecutionUpdate(this.projectId, newExecution.id, "created", newExecution, newExecution.issue_id || undefined);
566
+ // Also broadcast to parent execution channel
567
+ if (newExecution.parent_execution_id) {
568
+ broadcastExecutionUpdate(this.projectId, newExecution.parent_execution_id, "updated", newExecution, newExecution.issue_id || undefined);
569
+ }
570
+ return newExecution;
571
+ }
572
+ /**
573
+ * Cancel a running execution
574
+ *
575
+ * Stops the workflow execution and marks the execution as cancelled.
576
+ * Optionally cleans up the worktree based on config.
577
+ *
578
+ * @param executionId - ID of execution to cancel
579
+ */
580
+ async cancelExecution(executionId) {
581
+ const execution = getExecution(this.db, executionId);
582
+ if (!execution) {
583
+ throw new Error(`Execution ${executionId} not found`);
584
+ }
585
+ if (execution.status !== "running") {
586
+ throw new Error(`Cannot cancel execution in ${execution.status} state`);
587
+ }
588
+ // Use worker pool cancellation if available
589
+ if (this.workerPool && this.workerPool.hasWorker(executionId)) {
590
+ await this.workerPool.cancelExecution(executionId);
591
+ return; // Worker pool handles DB updates and broadcasts
592
+ }
593
+ // For in-process executions using AgentExecutorWrapper:
594
+ // The wrapper manages its own lifecycle and cancellation.
595
+ // We update the database status, which the wrapper may check,
596
+ // or we rely on process termination to stop execution.
597
+ // TODO: Add cancellation registry in AgentExecutorWrapper for direct process control
598
+ // Update status in database
599
+ updateExecution(this.db, executionId, {
600
+ status: "stopped",
601
+ completed_at: new Date().toISOString(),
602
+ });
603
+ // Broadcast status change
604
+ const updated = getExecution(this.db, executionId);
605
+ if (updated) {
606
+ broadcastExecutionUpdate(this.projectId, executionId, "status_changed", updated, updated.issue_id || undefined);
607
+ }
608
+ }
609
+ /**
610
+ * Clean up execution resources
611
+ *
612
+ * Removes the worktree and associated files. This is called automatically
613
+ * on workflow completion, or can be called manually.
614
+ *
615
+ * @param executionId - ID of execution to clean up
616
+ */
617
+ async cleanupExecution(executionId) {
618
+ await this.lifecycleService.cleanupExecution(executionId);
619
+ }
620
+ /**
621
+ * Check if worktree exists in filesystem for an execution
622
+ *
623
+ * @param executionId - ID of execution to check
624
+ * @returns true if worktree exists, false otherwise
625
+ */
626
+ async worktreeExists(executionId) {
627
+ const execution = getExecution(this.db, executionId);
628
+ if (!execution || !execution.worktree_path) {
629
+ return false;
630
+ }
631
+ const fs = await import("fs");
632
+ return fs.existsSync(execution.worktree_path);
633
+ }
634
+ /**
635
+ * Delete worktree for an execution
636
+ *
637
+ * Manually deletes the worktree for a specific execution, regardless of
638
+ * cleanupMode configuration. This allows users to manually cleanup worktrees
639
+ * when they're configured for manual cleanup.
640
+ *
641
+ * @param executionId - ID of execution whose worktree to delete
642
+ * @param deleteBranch - Whether to also delete the execution's branch (default: false)
643
+ * @throws Error if execution not found, has no worktree, or worktree doesn't exist
644
+ */
645
+ async deleteWorktree(executionId, deleteBranch = false) {
646
+ const execution = getExecution(this.db, executionId);
647
+ if (!execution) {
648
+ throw new Error(`Execution ${executionId} not found`);
649
+ }
650
+ if (!execution.worktree_path) {
651
+ throw new Error(`Execution ${executionId} has no worktree to delete`);
652
+ }
653
+ // Check if worktree exists in the filesystem
654
+ const fs = await import("fs");
655
+ const worktreeExists = fs.existsSync(execution.worktree_path);
656
+ if (!worktreeExists) {
657
+ throw new Error(`Worktree does not exist in filesystem: ${execution.worktree_path}`);
658
+ }
659
+ // TODO: Cancel any running execution.
660
+ // Get worktree manager from lifecycle service
661
+ const worktreeManager = this.lifecycleService.worktreeManager;
662
+ // Clean up the worktree
663
+ await worktreeManager.cleanupWorktree(execution.worktree_path, this.repoPath);
664
+ // Delete branch if requested and it was created by this execution
665
+ if (deleteBranch && execution.branch_name) {
666
+ try {
667
+ // A branch was created for this execution if:
668
+ // - branch_name is DIFFERENT from target_branch (autoCreateBranches was true)
669
+ // - This means a new worktree-specific branch was created
670
+ const wasCreatedByExecution = execution.branch_name !== execution.target_branch &&
671
+ execution.branch_name !== "(detached)";
672
+ if (wasCreatedByExecution) {
673
+ await worktreeManager.git.deleteBranch(this.repoPath, execution.branch_name, true // Force deletion
674
+ );
675
+ console.log(`[ExecutionService] Deleted execution-created branch: ${execution.branch_name}`);
676
+ }
677
+ else {
678
+ console.log(`[ExecutionService] Skipping branch deletion - branch ${execution.branch_name} is the target branch (not created by execution)`);
679
+ }
680
+ }
681
+ catch (err) {
682
+ console.warn(`Failed to delete branch ${execution.branch_name} during worktree deletion:`, err);
683
+ // Continue even if branch deletion fails
684
+ }
685
+ }
686
+ }
687
+ /**
688
+ * Delete an execution and its entire chain
689
+ *
690
+ * Deletes the execution and all its follow-ups (descendants).
691
+ * Optionally deletes the worktree and/or branch.
692
+ *
693
+ * @param executionId - ID of execution to delete (can be root or any execution in chain)
694
+ * @param deleteBranch - Whether to also delete the execution's branch (default: false)
695
+ * @param deleteWorktree - Whether to also delete the execution's worktree (default: false)
696
+ * @throws Error if execution not found
697
+ */
698
+ async deleteExecution(executionId, deleteBranch = false, deleteWorktree = false) {
699
+ const execution = getExecution(this.db, executionId);
700
+ if (!execution) {
701
+ throw new Error(`Execution ${executionId} not found`);
702
+ }
703
+ // Find the root execution by traversing up parent_execution_id
704
+ let rootId = executionId;
705
+ let current = execution;
706
+ while (current.parent_execution_id) {
707
+ rootId = current.parent_execution_id;
708
+ const parent = getExecution(this.db, rootId);
709
+ if (!parent)
710
+ break;
711
+ current = parent;
712
+ }
713
+ // Get all executions in the chain (root + all descendants)
714
+ const chain = this.db
715
+ .prepare(`
716
+ WITH RECURSIVE execution_chain AS (
717
+ -- Base case: the root execution
718
+ SELECT * FROM executions WHERE id = ?
719
+ UNION ALL
720
+ -- Recursive case: children of executions in the chain
721
+ SELECT e.* FROM executions e
722
+ INNER JOIN execution_chain ec ON e.parent_execution_id = ec.id
723
+ )
724
+ SELECT * FROM execution_chain
725
+ `)
726
+ .all(rootId);
727
+ // Cancel any running executions in the chain
728
+ for (const exec of chain) {
729
+ if (exec.status === "running" || exec.status === "pending") {
730
+ try {
731
+ await this.cancelExecution(exec.id);
732
+ }
733
+ catch (err) {
734
+ console.warn(`Failed to cancel execution ${exec.id} during deletion:`, err);
735
+ // Continue with deletion even if cancel fails
736
+ }
737
+ }
738
+ }
739
+ // Delete worktree if requested and it exists (only for root execution)
740
+ const rootExecution = chain.find((e) => e.id === rootId);
741
+ if (deleteWorktree && rootExecution?.worktree_path) {
742
+ try {
743
+ const fs = await import("fs");
744
+ if (fs.existsSync(rootExecution.worktree_path)) {
745
+ await this.deleteWorktree(rootId);
746
+ }
747
+ }
748
+ catch (err) {
749
+ console.warn(`Failed to delete worktree during execution deletion:`, err);
750
+ // Continue with deletion even if worktree cleanup fails
751
+ }
752
+ }
753
+ // Delete branch if requested and it exists
754
+ // IMPORTANT: Only delete branches that were created specifically for this execution
755
+ if (deleteBranch && rootExecution?.branch_name) {
756
+ try {
757
+ // A branch was created for this execution if:
758
+ // - branch_name is DIFFERENT from target_branch (autoCreateBranches was true)
759
+ // - This means a new worktree-specific branch was created
760
+ //
761
+ // A branch was NOT created (reusing existing) if:
762
+ // - branch_name === target_branch (autoCreateBranches was false)
763
+ // - This means the worktree reused the target branch directly
764
+ const wasCreatedByExecution = rootExecution.branch_name !== rootExecution.target_branch &&
765
+ rootExecution.branch_name !== "(detached)";
766
+ if (wasCreatedByExecution) {
767
+ // Get worktree manager from lifecycle service to access git operations
768
+ const worktreeManager = this.lifecycleService
769
+ .worktreeManager;
770
+ await worktreeManager.git.deleteBranch(this.repoPath, rootExecution.branch_name, true // Force deletion
771
+ );
772
+ console.log(`[ExecutionService] Deleted execution-created branch: ${rootExecution.branch_name}`);
773
+ }
774
+ else {
775
+ console.log(`[ExecutionService] Skipping branch deletion - branch ${rootExecution.branch_name} is the target branch (not created by execution)`);
776
+ }
777
+ }
778
+ catch (err) {
779
+ console.warn(`Failed to delete branch ${rootExecution.branch_name} during execution deletion:`, err);
780
+ // Continue with deletion even if branch deletion fails
781
+ }
782
+ }
783
+ // Delete execution logs for all executions in the chain
784
+ for (const exec of chain) {
785
+ try {
786
+ this.logsStore.deleteLogs(exec.id);
787
+ }
788
+ catch (err) {
789
+ console.warn(`Failed to delete logs for execution ${exec.id}:`, err);
790
+ // Continue with deletion even if log cleanup fails
791
+ }
792
+ }
793
+ // Delete all executions in the chain from database
794
+ // Delete in reverse order (children first) to avoid foreign key issues
795
+ const chainIds = chain.map((e) => e.id);
796
+ const placeholders = chainIds.map(() => "?").join(",");
797
+ this.db
798
+ .prepare(`DELETE FROM executions WHERE id IN (${placeholders})`)
799
+ .run(...chainIds);
800
+ // Broadcast deletion event for each execution
801
+ for (const exec of chain) {
802
+ broadcastExecutionUpdate(this.projectId, exec.id, "deleted", { executionId: exec.id }, exec.issue_id || undefined);
803
+ }
804
+ }
805
+ /**
806
+ * Shutdown execution service - cancel all active executions
807
+ *
808
+ * This is called during server shutdown to gracefully terminate
809
+ * all running executions before the server exits.
810
+ */
811
+ async shutdown() {
812
+ // Shutdown worker pool if available
813
+ if (this.workerPool) {
814
+ await this.workerPool.shutdown();
815
+ }
816
+ // For in-process executions using AgentExecutorWrapper:
817
+ // The wrapper manages its own lifecycle. Processes will be terminated
818
+ // when the Node.js process exits.
819
+ // TODO: Add active execution tracking to AgentExecutorWrapper for graceful shutdown
820
+ }
821
+ /**
822
+ * List all executions for an issue
823
+ *
824
+ * Returns all executions associated with a specific issue,
825
+ * ordered by creation time (most recent first).
826
+ *
827
+ * @param issueId - ID of issue to list executions for
828
+ * @returns Array of executions for the issue
829
+ */
830
+ listExecutions(issueId) {
831
+ const executions = this.db
832
+ .prepare(`
833
+ SELECT * FROM executions
834
+ WHERE issue_id = ?
835
+ ORDER BY created_at DESC
836
+ `)
837
+ .all(issueId);
838
+ return executions;
839
+ }
840
+ /**
841
+ * Get a single execution by ID
842
+ *
843
+ * @param executionId - ID of execution to retrieve
844
+ * @returns Execution or null if not found
845
+ */
846
+ getExecution(executionId) {
847
+ return getExecution(this.db, executionId);
848
+ }
849
+ /**
850
+ * List all executions with filtering and pagination
851
+ *
852
+ * Returns executions across all issues with support for filtering
853
+ * by status, issueId, and pagination.
854
+ *
855
+ * @param options - Filtering and pagination options
856
+ * @param options.limit - Maximum number of executions to return (default: 50)
857
+ * @param options.offset - Number of executions to skip (default: 0)
858
+ * @param options.status - Filter by execution status (single or array)
859
+ * @param options.issueId - Filter by issue ID
860
+ * @param options.sortBy - Field to sort by (default: 'created_at')
861
+ * @param options.order - Sort order (default: 'desc')
862
+ * @param options.since - Only return executions created after this ISO date
863
+ * @param options.includeRunning - When used with 'since', also include running executions regardless of age
864
+ * @returns Object containing executions array, total count, and hasMore flag
865
+ */
866
+ listAll(options = {}) {
867
+ const limit = options.limit ?? 50;
868
+ const offset = options.offset ?? 0;
869
+ const sortBy = options.sortBy ?? "created_at";
870
+ const order = options.order ?? "desc";
871
+ // Validate inputs
872
+ if (limit < 0 || offset < 0) {
873
+ throw new Error("Limit and offset must be non-negative");
874
+ }
875
+ // Build WHERE clause dynamically
876
+ const whereClauses = [];
877
+ const params = [];
878
+ // Filter by status (single or array)
879
+ if (options.status) {
880
+ const statuses = Array.isArray(options.status)
881
+ ? options.status
882
+ : [options.status];
883
+ const placeholders = statuses.map(() => "?").join(",");
884
+ whereClauses.push(`status IN (${placeholders})`);
885
+ params.push(...statuses);
886
+ }
887
+ // Filter by issueId
888
+ if (options.issueId) {
889
+ whereClauses.push("issue_id = ?");
890
+ params.push(options.issueId);
891
+ }
892
+ // Filter by since date (with optional includeRunning)
893
+ if (options.since) {
894
+ if (options.includeRunning) {
895
+ // Include executions created after 'since' OR that are currently running
896
+ whereClauses.push("(created_at >= ? OR status = 'running')");
897
+ params.push(options.since);
898
+ }
899
+ else {
900
+ // Only include executions created after 'since'
901
+ whereClauses.push("created_at >= ?");
902
+ params.push(options.since);
903
+ }
904
+ }
905
+ // Build WHERE clause
906
+ const whereClause = whereClauses.length > 0 ? `WHERE ${whereClauses.join(" AND ")}` : "";
907
+ // Get total count
908
+ const countQuery = `SELECT COUNT(*) as count FROM executions ${whereClause}`;
909
+ const countResult = this.db.prepare(countQuery).get(...params);
910
+ const total = countResult.count;
911
+ // Get executions with pagination
912
+ const query = `
913
+ SELECT * FROM executions
914
+ ${whereClause}
915
+ ORDER BY ${sortBy} ${order.toUpperCase()}
916
+ LIMIT ? OFFSET ?
917
+ `;
918
+ const executions = this.db
919
+ .prepare(query)
920
+ .all(...params, limit, offset);
921
+ // Calculate hasMore
922
+ const hasMore = offset + executions.length < total;
923
+ return {
924
+ executions,
925
+ total,
926
+ hasMore,
927
+ };
928
+ }
929
+ /**
930
+ * Check if there are any active executions
931
+ *
932
+ * @returns true if there are active worker pool executions
933
+ */
934
+ hasActiveExecutions() {
935
+ // Check worker pool for active executions
936
+ if (this.workerPool) {
937
+ return this.workerPool.getActiveWorkerCount() > 0;
938
+ }
939
+ // For in-process executions, we don't track them anymore
940
+ // Query the database for running executions as a fallback
941
+ const runningExecutions = this.db
942
+ .prepare("SELECT COUNT(*) as count FROM executions WHERE status = 'running'")
943
+ .get();
944
+ return runningExecutions.count > 0;
945
+ }
946
+ /**
947
+ * Collect entity IDs that were already expanded in parent executions
948
+ *
949
+ * Walks the execution chain backwards and resolves each prompt to extract
950
+ * which entities were referenced (and thus expanded) in previous executions.
951
+ * This prevents redundant expansion of the same entities in follow-ups.
952
+ *
953
+ * @param executionId - ID of the current execution
954
+ * @returns Set of entity IDs that were already expanded
955
+ */
956
+ async collectExpandedEntitiesFromChain(executionId) {
957
+ const expandedIds = new Set();
958
+ const resolver = new PromptResolver(this.db);
959
+ // Walk backwards through the execution chain
960
+ let currentExecId = executionId;
961
+ while (currentExecId) {
962
+ const execution = getExecution(this.db, currentExecId);
963
+ if (!execution || !execution.prompt)
964
+ break;
965
+ // Resolve the prompt to extract what entities were referenced
966
+ // Pass empty set so we expand everything in this pass (just to collect IDs)
967
+ // Pass the execution's issue_id as implicit to track if it was auto-included
968
+ const { expandedEntityIds } = await resolver.resolve(execution.prompt, new Set(), execution.issue_id || undefined);
969
+ // Add all expanded entity IDs from this execution
970
+ expandedEntityIds.forEach((id) => expandedIds.add(id));
971
+ // Move to parent execution
972
+ currentExecId = execution.parent_execution_id || null;
973
+ }
974
+ return expandedIds;
975
+ }
976
+ /**
977
+ * Build execution config with auto-injected MCP servers
978
+ *
979
+ * This method handles the auto-injection of sudocode-mcp into the execution config
980
+ * when it's not already configured. It:
981
+ * 1. Checks if sudocode-mcp package is installed (throws error if not)
982
+ * 2. Checks if the agent already has sudocode-mcp configured
983
+ * 3. Auto-injects sudocode-mcp to mcpServers if needed
984
+ * 4. Preserves all user-provided MCP servers
985
+ *
986
+ * @param agentType - The type of agent to execute
987
+ * @param userConfig - User-provided execution configuration
988
+ * @returns Merged execution configuration with auto-injected MCP servers
989
+ * @throws Error if sudocode-mcp package is not installed
990
+ */
991
+ async buildExecutionConfig(agentType, userConfig) {
992
+ // Start with user config
993
+ const mergedConfig = { ...userConfig };
994
+ // 1. Detect if sudocode-mcp package is installed
995
+ const isInstalled = await this.detectSudocodeMcp();
996
+ if (!isInstalled) {
997
+ throw new Error("sudocode-mcp package not found. Please install sudocode to enable MCP tools.\nVisit: https://github.com/sudocode-ai/sudocode");
998
+ }
999
+ // 2. Check if agent already has sudocode-mcp configured
1000
+ const mcpPresent = await this.detectAgentMcp(agentType);
1001
+ // 3. For Cursor, MCP MUST be configured (no CLI injection available)
1002
+ if (agentType === "cursor" && !mcpPresent) {
1003
+ throw new Error("Cursor agent requires sudocode-mcp to be configured in .cursor/mcp.json.\n" +
1004
+ "Please create .cursor/mcp.json in your project root with:\n\n" +
1005
+ JSON.stringify({
1006
+ mcpServers: {
1007
+ "sudocode-mcp": {
1008
+ command: "sudocode-mcp",
1009
+ },
1010
+ },
1011
+ }, null, 2) +
1012
+ "\n\nVisit: https://github.com/sudocode-ai/sudocode");
1013
+ }
1014
+ // For Cursor with sudocode-mcp, auto-approve MCP servers in headless mode
1015
+ if (agentType === "cursor" && mcpPresent) {
1016
+ console.info("[ExecutionService] Enabling approveMcps for Cursor (sudocode-mcp detected)");
1017
+ mergedConfig.approveMcps = true;
1018
+ }
1019
+ // 4. Auto-inject sudocode-mcp if not configured and not already in userConfig
1020
+ if (!mcpPresent && !userConfig.mcpServers?.["sudocode-mcp"]) {
1021
+ console.info("[ExecutionService] Adding sudocode-mcp to mcpServers (auto-injection)");
1022
+ mergedConfig.mcpServers = {
1023
+ ...(userConfig.mcpServers || {}),
1024
+ "sudocode-mcp": {
1025
+ command: "sudocode-mcp",
1026
+ },
1027
+ };
1028
+ }
1029
+ else if (mcpPresent) {
1030
+ console.info("[ExecutionService] Removing sudocode-mcp from CLI config (using plugin instead)");
1031
+ // Remove sudocode-mcp from mcpServers to avoid duplication with plugin
1032
+ if (userConfig.mcpServers) {
1033
+ const { "sudocode-mcp": _removed, ...rest } = userConfig.mcpServers;
1034
+ mergedConfig.mcpServers = Object.keys(rest).length > 0 ? rest : undefined;
1035
+ }
1036
+ }
1037
+ else if (userConfig.mcpServers?.["sudocode-mcp"]) {
1038
+ console.info("[ExecutionService] Skipping sudocode-mcp injection (user provided in config)");
1039
+ }
1040
+ return mergedConfig;
1041
+ }
1042
+ /**
1043
+ * Detect if sudocode-mcp command is available in PATH
1044
+ *
1045
+ * This checks if the sudocode-mcp package is installed on the system by
1046
+ * attempting to locate the command using `which` (Unix) or `where` (Windows).
1047
+ *
1048
+ * @returns true if sudocode-mcp is available, false otherwise
1049
+ * @internal Used by buildExecutionConfig
1050
+ */
1051
+ async detectSudocodeMcp() {
1052
+ try {
1053
+ // Use 'which' on Unix systems, 'where' on Windows
1054
+ const command = process.platform === "win32" ? "where" : "which";
1055
+ const result = await execFileNoThrow(command, ["sudocode-mcp"]);
1056
+ if (result.status === 0) {
1057
+ return true;
1058
+ }
1059
+ else {
1060
+ // Command failed - sudocode-mcp not found in PATH
1061
+ console.warn("[ExecutionService] sudocode-mcp command not found in PATH");
1062
+ return false;
1063
+ }
1064
+ }
1065
+ catch (error) {
1066
+ // Unexpected error during detection
1067
+ console.warn("[ExecutionService] Failed to detect sudocode-mcp:", error instanceof Error ? error.message : String(error));
1068
+ return false;
1069
+ }
1070
+ }
1071
+ /**
1072
+ * Detect if sudocode-mcp is configured for the given agent
1073
+ *
1074
+ * For claude-code: Checks if the sudocode plugin is enabled in ~/.claude/settings.json
1075
+ * For cursor: Checks .cursor/mcp.json in project root for sudocode-mcp command
1076
+ * For codex: Checks ~/.codex/config.toml for sudocode-mcp in mcp_servers
1077
+ * For copilot: Checks ~/.copilot/mcp-config.json for sudocode-mcp command
1078
+ *
1079
+ * @param agentType - The type of agent to check
1080
+ * @returns true if configured, false otherwise
1081
+ * @internal Used by buildExecutionConfig
1082
+ */
1083
+ async detectAgentMcp(agentType) {
1084
+ // For claude-code, check ~/.claude/settings.json
1085
+ // This is not foolproof, but covers the default case
1086
+ if (agentType === "claude-code") {
1087
+ try {
1088
+ const claudeSettingsPath = path.join(os.homedir(), ".claude", "settings.json");
1089
+ const settingsContent = await fsPromises.readFile(claudeSettingsPath, "utf-8");
1090
+ const settings = JSON.parse(settingsContent);
1091
+ // Check if sudocode@sudocode-marketplace is enabled
1092
+ const isEnabled = settings.enabledPlugins?.["sudocode@sudocode-marketplace"] === true;
1093
+ if (isEnabled) {
1094
+ console.info("[ExecutionService] sudocode-mcp detected for claude-code (plugin enabled)");
1095
+ }
1096
+ else {
1097
+ console.info("[ExecutionService] sudocode-mcp not detected for claude-code (plugin not enabled)");
1098
+ }
1099
+ return isEnabled;
1100
+ }
1101
+ catch (error) {
1102
+ // Handle file read errors gracefully
1103
+ if (error instanceof Error &&
1104
+ "code" in error &&
1105
+ error.code === "ENOENT") {
1106
+ // File not found - plugin definitely not configured
1107
+ console.warn("[ExecutionService] ~/.claude/settings.json not found - plugin not configured");
1108
+ return false;
1109
+ }
1110
+ else if (error instanceof SyntaxError) {
1111
+ // Malformed JSON - can't determine, assume configured (conservative)
1112
+ console.error("[ExecutionService] Failed to parse ~/.claude/settings.json - malformed JSON:", error.message);
1113
+ return true;
1114
+ }
1115
+ else {
1116
+ // Other errors (permission denied, etc.) - can't determine, assume configured (conservative)
1117
+ console.warn("[ExecutionService] Failed to read ~/.claude/settings.json:", error instanceof Error ? error.message : String(error));
1118
+ return true;
1119
+ }
1120
+ }
1121
+ }
1122
+ // For cursor, check .cursor/mcp.json in project root
1123
+ if (agentType === "cursor") {
1124
+ try {
1125
+ // NOTE: .cursor/mcp.json is in project root, not home directory
1126
+ const cursorConfigPath = path.join(this.repoPath, ".cursor", "mcp.json");
1127
+ const configContent = await fsPromises.readFile(cursorConfigPath, "utf-8");
1128
+ const config = JSON.parse(configContent);
1129
+ // Check if any mcpServer has command "sudocode-mcp"
1130
+ const hasSudocodeMcp = Object.values(config.mcpServers || {}).some((server) => server.command === "sudocode-mcp");
1131
+ if (hasSudocodeMcp) {
1132
+ console.info("[ExecutionService] sudocode-mcp detected for cursor");
1133
+ }
1134
+ else {
1135
+ console.info("[ExecutionService] sudocode-mcp not detected for cursor");
1136
+ }
1137
+ return hasSudocodeMcp;
1138
+ }
1139
+ catch (error) {
1140
+ // Handle ENOENT, JSON parse errors, etc.
1141
+ if (error instanceof Error &&
1142
+ "code" in error &&
1143
+ error.code === "ENOENT") {
1144
+ // File not found - MCP definitely not configured
1145
+ console.warn("[ExecutionService] .cursor/mcp.json not found in project root - MCP not configured");
1146
+ return false;
1147
+ }
1148
+ else if (error instanceof SyntaxError) {
1149
+ // Malformed JSON - can't determine configuration
1150
+ console.error("[ExecutionService] Failed to parse .cursor/mcp.json - malformed JSON:", error.message);
1151
+ return false;
1152
+ }
1153
+ else {
1154
+ // Other errors (permission denied, etc.)
1155
+ console.warn("[ExecutionService] Failed to read .cursor/mcp.json:", error instanceof Error ? error.message : String(error));
1156
+ return false;
1157
+ }
1158
+ }
1159
+ }
1160
+ // For codex, check ~/.codex/config.toml
1161
+ if (agentType === "codex") {
1162
+ try {
1163
+ const codexConfigPath = path.join(os.homedir(), ".codex", "config.toml");
1164
+ const configContent = await fsPromises.readFile(codexConfigPath, "utf-8");
1165
+ const config = TOML.parse(configContent);
1166
+ // Check if any mcp_servers section has command "sudocode-mcp"
1167
+ const mcpServers = config.mcp_servers;
1168
+ const hasSudocodeMcp = mcpServers &&
1169
+ Object.values(mcpServers).some((server) => server.command === "sudocode-mcp");
1170
+ if (hasSudocodeMcp) {
1171
+ console.info("[ExecutionService] sudocode-mcp detected for codex");
1172
+ }
1173
+ else {
1174
+ console.info("[ExecutionService] sudocode-mcp not detected for codex");
1175
+ }
1176
+ return !!hasSudocodeMcp;
1177
+ }
1178
+ catch (error) {
1179
+ // Handle ENOENT, TOML parse errors, etc.
1180
+ if (error instanceof Error &&
1181
+ "code" in error &&
1182
+ error.code === "ENOENT") {
1183
+ // File not found - MCP definitely not configured
1184
+ console.warn("[ExecutionService] ~/.codex/config.toml not found - MCP not configured");
1185
+ return false;
1186
+ }
1187
+ else if (error instanceof Error && error.message.includes("parse")) {
1188
+ // Malformed TOML - can't determine configuration
1189
+ console.error("[ExecutionService] Failed to parse ~/.codex/config.toml - malformed TOML:", error.message);
1190
+ return false;
1191
+ }
1192
+ else {
1193
+ // Other errors (permission denied, etc.)
1194
+ console.warn("[ExecutionService] Failed to detect codex MCP config:", error instanceof Error ? error.message : String(error));
1195
+ return false;
1196
+ }
1197
+ }
1198
+ }
1199
+ // For copilot, check ~/.copilot/mcp-config.json
1200
+ if (agentType === "copilot") {
1201
+ try {
1202
+ const copilotConfigPath = path.join(os.homedir(), ".copilot", "mcp-config.json");
1203
+ const configContent = await fsPromises.readFile(copilotConfigPath, "utf-8");
1204
+ const config = JSON.parse(configContent);
1205
+ // Check if any mcpServer has command "sudocode-mcp"
1206
+ const hasSudocodeMcp = Object.values(config.mcpServers || {}).some((server) => server.command === "sudocode-mcp");
1207
+ if (hasSudocodeMcp) {
1208
+ console.info("[ExecutionService] sudocode-mcp detected for copilot");
1209
+ }
1210
+ else {
1211
+ console.info("[ExecutionService] sudocode-mcp not detected for copilot");
1212
+ }
1213
+ return hasSudocodeMcp;
1214
+ }
1215
+ catch (error) {
1216
+ // Handle ENOENT, JSON parse errors, etc.
1217
+ if (error instanceof Error &&
1218
+ "code" in error &&
1219
+ error.code === "ENOENT") {
1220
+ // File not found - MCP definitely not configured
1221
+ console.warn("[ExecutionService] ~/.copilot/mcp-config.json not found - MCP not configured");
1222
+ return false;
1223
+ }
1224
+ else if (error instanceof SyntaxError) {
1225
+ // Malformed JSON - can't determine configuration
1226
+ console.error("[ExecutionService] Failed to parse ~/.copilot/mcp-config.json - malformed JSON:", error.message);
1227
+ return false;
1228
+ }
1229
+ else {
1230
+ // Other errors (permission denied, etc.)
1231
+ console.warn("[ExecutionService] Failed to detect copilot MCP config:", error instanceof Error ? error.message : String(error));
1232
+ return false;
1233
+ }
1234
+ }
1235
+ }
1236
+ // For other agents, return true (safe default)
1237
+ return true;
1238
+ }
1239
+ }
1240
+ //# sourceMappingURL=execution-service.js.map