sudocode 1.0.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (447) hide show
  1. package/README.md +222 -0
  2. package/build.js +75 -0
  3. package/node_modules/@sudocode-ai/cli/README.md +330 -0
  4. package/node_modules/@sudocode-ai/cli/dist/cli/feedback-commands.d.ts +53 -0
  5. package/node_modules/@sudocode-ai/cli/dist/cli/feedback-commands.d.ts.map +1 -0
  6. package/node_modules/@sudocode-ai/cli/dist/cli/feedback-commands.js +274 -0
  7. package/node_modules/@sudocode-ai/cli/dist/cli/feedback-commands.js.map +1 -0
  8. package/node_modules/@sudocode-ai/cli/dist/cli/init-commands.d.ts +22 -0
  9. package/node_modules/@sudocode-ai/cli/dist/cli/init-commands.d.ts.map +1 -0
  10. package/node_modules/@sudocode-ai/cli/dist/cli/init-commands.js +148 -0
  11. package/node_modules/@sudocode-ai/cli/dist/cli/init-commands.js.map +1 -0
  12. package/node_modules/@sudocode-ai/cli/dist/cli/issue-commands.d.ts +45 -0
  13. package/node_modules/@sudocode-ai/cli/dist/cli/issue-commands.d.ts.map +1 -0
  14. package/node_modules/@sudocode-ai/cli/dist/cli/issue-commands.js +310 -0
  15. package/node_modules/@sudocode-ai/cli/dist/cli/issue-commands.js.map +1 -0
  16. package/node_modules/@sudocode-ai/cli/dist/cli/query-commands.d.ts +18 -0
  17. package/node_modules/@sudocode-ai/cli/dist/cli/query-commands.d.ts.map +1 -0
  18. package/node_modules/@sudocode-ai/cli/dist/cli/query-commands.js +61 -0
  19. package/node_modules/@sudocode-ai/cli/dist/cli/query-commands.js.map +1 -0
  20. package/node_modules/@sudocode-ai/cli/dist/cli/reference-commands.d.ts +22 -0
  21. package/node_modules/@sudocode-ai/cli/dist/cli/reference-commands.d.ts.map +1 -0
  22. package/node_modules/@sudocode-ai/cli/dist/cli/reference-commands.js +136 -0
  23. package/node_modules/@sudocode-ai/cli/dist/cli/reference-commands.js.map +1 -0
  24. package/node_modules/@sudocode-ai/cli/dist/cli/relationship-commands.d.ts +14 -0
  25. package/node_modules/@sudocode-ai/cli/dist/cli/relationship-commands.d.ts.map +1 -0
  26. package/node_modules/@sudocode-ai/cli/dist/cli/relationship-commands.js +76 -0
  27. package/node_modules/@sudocode-ai/cli/dist/cli/relationship-commands.js.map +1 -0
  28. package/node_modules/@sudocode-ai/cli/dist/cli/server-commands.d.ts +17 -0
  29. package/node_modules/@sudocode-ai/cli/dist/cli/server-commands.d.ts.map +1 -0
  30. package/node_modules/@sudocode-ai/cli/dist/cli/server-commands.js +99 -0
  31. package/node_modules/@sudocode-ai/cli/dist/cli/server-commands.js.map +1 -0
  32. package/node_modules/@sudocode-ai/cli/dist/cli/spec-commands.d.ts +38 -0
  33. package/node_modules/@sudocode-ai/cli/dist/cli/spec-commands.d.ts.map +1 -0
  34. package/node_modules/@sudocode-ai/cli/dist/cli/spec-commands.js +321 -0
  35. package/node_modules/@sudocode-ai/cli/dist/cli/spec-commands.js.map +1 -0
  36. package/node_modules/@sudocode-ai/cli/dist/cli/status-commands.d.ts +17 -0
  37. package/node_modules/@sudocode-ai/cli/dist/cli/status-commands.d.ts.map +1 -0
  38. package/node_modules/@sudocode-ai/cli/dist/cli/status-commands.js +131 -0
  39. package/node_modules/@sudocode-ai/cli/dist/cli/status-commands.js.map +1 -0
  40. package/node_modules/@sudocode-ai/cli/dist/cli/sync-commands.d.ts +24 -0
  41. package/node_modules/@sudocode-ai/cli/dist/cli/sync-commands.d.ts.map +1 -0
  42. package/node_modules/@sudocode-ai/cli/dist/cli/sync-commands.js +416 -0
  43. package/node_modules/@sudocode-ai/cli/dist/cli/sync-commands.js.map +1 -0
  44. package/node_modules/@sudocode-ai/cli/dist/cli/update-commands.d.ts +12 -0
  45. package/node_modules/@sudocode-ai/cli/dist/cli/update-commands.d.ts.map +1 -0
  46. package/node_modules/@sudocode-ai/cli/dist/cli/update-commands.js +78 -0
  47. package/node_modules/@sudocode-ai/cli/dist/cli/update-commands.js.map +1 -0
  48. package/node_modules/@sudocode-ai/cli/dist/cli.d.ts +6 -0
  49. package/node_modules/@sudocode-ai/cli/dist/cli.d.ts.map +1 -0
  50. package/node_modules/@sudocode-ai/cli/dist/cli.js +426 -0
  51. package/node_modules/@sudocode-ai/cli/dist/cli.js.map +1 -0
  52. package/node_modules/@sudocode-ai/cli/dist/db.d.ts +21 -0
  53. package/node_modules/@sudocode-ai/cli/dist/db.d.ts.map +1 -0
  54. package/node_modules/@sudocode-ai/cli/dist/db.js +54 -0
  55. package/node_modules/@sudocode-ai/cli/dist/db.js.map +1 -0
  56. package/node_modules/@sudocode-ai/cli/dist/export.d.ts +79 -0
  57. package/node_modules/@sudocode-ai/cli/dist/export.d.ts.map +1 -0
  58. package/node_modules/@sudocode-ai/cli/dist/export.js +195 -0
  59. package/node_modules/@sudocode-ai/cli/dist/export.js.map +1 -0
  60. package/node_modules/@sudocode-ai/cli/dist/filename-generator.d.ts +30 -0
  61. package/node_modules/@sudocode-ai/cli/dist/filename-generator.d.ts.map +1 -0
  62. package/node_modules/@sudocode-ai/cli/dist/filename-generator.js +93 -0
  63. package/node_modules/@sudocode-ai/cli/dist/filename-generator.js.map +1 -0
  64. package/node_modules/@sudocode-ai/cli/dist/id-generator.d.ts +26 -0
  65. package/node_modules/@sudocode-ai/cli/dist/id-generator.d.ts.map +1 -0
  66. package/node_modules/@sudocode-ai/cli/dist/id-generator.js +123 -0
  67. package/node_modules/@sudocode-ai/cli/dist/id-generator.js.map +1 -0
  68. package/node_modules/@sudocode-ai/cli/dist/import.d.ts +118 -0
  69. package/node_modules/@sudocode-ai/cli/dist/import.d.ts.map +1 -0
  70. package/node_modules/@sudocode-ai/cli/dist/import.js +608 -0
  71. package/node_modules/@sudocode-ai/cli/dist/import.js.map +1 -0
  72. package/node_modules/@sudocode-ai/cli/dist/index.d.ts +13 -0
  73. package/node_modules/@sudocode-ai/cli/dist/index.d.ts.map +1 -0
  74. package/node_modules/@sudocode-ai/cli/dist/index.js +13 -0
  75. package/node_modules/@sudocode-ai/cli/dist/index.js.map +1 -0
  76. package/node_modules/@sudocode-ai/cli/dist/jsonl.d.ts +69 -0
  77. package/node_modules/@sudocode-ai/cli/dist/jsonl.d.ts.map +1 -0
  78. package/node_modules/@sudocode-ai/cli/dist/jsonl.js +333 -0
  79. package/node_modules/@sudocode-ai/cli/dist/jsonl.js.map +1 -0
  80. package/node_modules/@sudocode-ai/cli/dist/markdown.d.ts +146 -0
  81. package/node_modules/@sudocode-ai/cli/dist/markdown.d.ts.map +1 -0
  82. package/node_modules/@sudocode-ai/cli/dist/markdown.js +357 -0
  83. package/node_modules/@sudocode-ai/cli/dist/markdown.js.map +1 -0
  84. package/node_modules/@sudocode-ai/cli/dist/migrations.d.ts +23 -0
  85. package/node_modules/@sudocode-ai/cli/dist/migrations.d.ts.map +1 -0
  86. package/node_modules/@sudocode-ai/cli/dist/migrations.js +57 -0
  87. package/node_modules/@sudocode-ai/cli/dist/migrations.js.map +1 -0
  88. package/node_modules/@sudocode-ai/cli/dist/operations/events.d.ts +53 -0
  89. package/node_modules/@sudocode-ai/cli/dist/operations/events.d.ts.map +1 -0
  90. package/node_modules/@sudocode-ai/cli/dist/operations/events.js +108 -0
  91. package/node_modules/@sudocode-ai/cli/dist/operations/events.js.map +1 -0
  92. package/node_modules/@sudocode-ai/cli/dist/operations/feedback-anchors.d.ts +92 -0
  93. package/node_modules/@sudocode-ai/cli/dist/operations/feedback-anchors.d.ts.map +1 -0
  94. package/node_modules/@sudocode-ai/cli/dist/operations/feedback-anchors.js +444 -0
  95. package/node_modules/@sudocode-ai/cli/dist/operations/feedback-anchors.js.map +1 -0
  96. package/node_modules/@sudocode-ai/cli/dist/operations/feedback.d.ts +76 -0
  97. package/node_modules/@sudocode-ai/cli/dist/operations/feedback.d.ts.map +1 -0
  98. package/node_modules/@sudocode-ai/cli/dist/operations/feedback.js +234 -0
  99. package/node_modules/@sudocode-ai/cli/dist/operations/feedback.js.map +1 -0
  100. package/node_modules/@sudocode-ai/cli/dist/operations/index.d.ts +10 -0
  101. package/node_modules/@sudocode-ai/cli/dist/operations/index.d.ts.map +1 -0
  102. package/node_modules/@sudocode-ai/cli/dist/operations/index.js +10 -0
  103. package/node_modules/@sudocode-ai/cli/dist/operations/index.js.map +1 -0
  104. package/node_modules/@sudocode-ai/cli/dist/operations/issues.d.ts +82 -0
  105. package/node_modules/@sudocode-ai/cli/dist/operations/issues.d.ts.map +1 -0
  106. package/node_modules/@sudocode-ai/cli/dist/operations/issues.js +411 -0
  107. package/node_modules/@sudocode-ai/cli/dist/operations/issues.js.map +1 -0
  108. package/node_modules/@sudocode-ai/cli/dist/operations/references.d.ts +34 -0
  109. package/node_modules/@sudocode-ai/cli/dist/operations/references.d.ts.map +1 -0
  110. package/node_modules/@sudocode-ai/cli/dist/operations/references.js +117 -0
  111. package/node_modules/@sudocode-ai/cli/dist/operations/references.js.map +1 -0
  112. package/node_modules/@sudocode-ai/cli/dist/operations/relationships.d.ts +57 -0
  113. package/node_modules/@sudocode-ai/cli/dist/operations/relationships.d.ts.map +1 -0
  114. package/node_modules/@sudocode-ai/cli/dist/operations/relationships.js +236 -0
  115. package/node_modules/@sudocode-ai/cli/dist/operations/relationships.js.map +1 -0
  116. package/node_modules/@sudocode-ai/cli/dist/operations/specs.d.ts +64 -0
  117. package/node_modules/@sudocode-ai/cli/dist/operations/specs.d.ts.map +1 -0
  118. package/node_modules/@sudocode-ai/cli/dist/operations/specs.js +290 -0
  119. package/node_modules/@sudocode-ai/cli/dist/operations/specs.js.map +1 -0
  120. package/node_modules/@sudocode-ai/cli/dist/operations/tags.d.ts +42 -0
  121. package/node_modules/@sudocode-ai/cli/dist/operations/tags.d.ts.map +1 -0
  122. package/node_modules/@sudocode-ai/cli/dist/operations/tags.js +127 -0
  123. package/node_modules/@sudocode-ai/cli/dist/operations/tags.js.map +1 -0
  124. package/node_modules/@sudocode-ai/cli/dist/operations/transactions.d.ts +41 -0
  125. package/node_modules/@sudocode-ai/cli/dist/operations/transactions.d.ts.map +1 -0
  126. package/node_modules/@sudocode-ai/cli/dist/operations/transactions.js +111 -0
  127. package/node_modules/@sudocode-ai/cli/dist/operations/transactions.js.map +1 -0
  128. package/node_modules/@sudocode-ai/cli/dist/sync.d.ts +47 -0
  129. package/node_modules/@sudocode-ai/cli/dist/sync.d.ts.map +1 -0
  130. package/node_modules/@sudocode-ai/cli/dist/sync.js +442 -0
  131. package/node_modules/@sudocode-ai/cli/dist/sync.js.map +1 -0
  132. package/node_modules/@sudocode-ai/cli/dist/test-schema.d.ts +5 -0
  133. package/node_modules/@sudocode-ai/cli/dist/test-schema.d.ts.map +1 -0
  134. package/node_modules/@sudocode-ai/cli/dist/test-schema.js +46 -0
  135. package/node_modules/@sudocode-ai/cli/dist/test-schema.js.map +1 -0
  136. package/node_modules/@sudocode-ai/cli/dist/types.d.ts +7 -0
  137. package/node_modules/@sudocode-ai/cli/dist/types.d.ts.map +1 -0
  138. package/node_modules/@sudocode-ai/cli/dist/types.js +7 -0
  139. package/node_modules/@sudocode-ai/cli/dist/types.js.map +1 -0
  140. package/node_modules/@sudocode-ai/cli/dist/update-checker.d.ts +24 -0
  141. package/node_modules/@sudocode-ai/cli/dist/update-checker.d.ts.map +1 -0
  142. package/node_modules/@sudocode-ai/cli/dist/update-checker.js +151 -0
  143. package/node_modules/@sudocode-ai/cli/dist/update-checker.js.map +1 -0
  144. package/node_modules/@sudocode-ai/cli/dist/version.d.ts +12 -0
  145. package/node_modules/@sudocode-ai/cli/dist/version.d.ts.map +1 -0
  146. package/node_modules/@sudocode-ai/cli/dist/version.js +23 -0
  147. package/node_modules/@sudocode-ai/cli/dist/version.js.map +1 -0
  148. package/node_modules/@sudocode-ai/cli/dist/watcher.d.ts +63 -0
  149. package/node_modules/@sudocode-ai/cli/dist/watcher.d.ts.map +1 -0
  150. package/node_modules/@sudocode-ai/cli/dist/watcher.js +438 -0
  151. package/node_modules/@sudocode-ai/cli/dist/watcher.js.map +1 -0
  152. package/node_modules/@sudocode-ai/cli/package.json +65 -0
  153. package/node_modules/@sudocode-ai/local-server/README.md +19 -0
  154. package/node_modules/@sudocode-ai/local-server/dist/cli.d.ts +7 -0
  155. package/node_modules/@sudocode-ai/local-server/dist/cli.d.ts.map +1 -0
  156. package/node_modules/@sudocode-ai/local-server/dist/cli.js +7 -0
  157. package/node_modules/@sudocode-ai/local-server/dist/cli.js.map +1 -0
  158. package/node_modules/@sudocode-ai/local-server/dist/execution/engine/engine.d.ts +103 -0
  159. package/node_modules/@sudocode-ai/local-server/dist/execution/engine/engine.d.ts.map +1 -0
  160. package/node_modules/@sudocode-ai/local-server/dist/execution/engine/engine.js +10 -0
  161. package/node_modules/@sudocode-ai/local-server/dist/execution/engine/engine.js.map +1 -0
  162. package/node_modules/@sudocode-ai/local-server/dist/execution/engine/simple-engine.d.ts +190 -0
  163. package/node_modules/@sudocode-ai/local-server/dist/execution/engine/simple-engine.d.ts.map +1 -0
  164. package/node_modules/@sudocode-ai/local-server/dist/execution/engine/simple-engine.js +611 -0
  165. package/node_modules/@sudocode-ai/local-server/dist/execution/engine/simple-engine.js.map +1 -0
  166. package/node_modules/@sudocode-ai/local-server/dist/execution/engine/types.d.ts +116 -0
  167. package/node_modules/@sudocode-ai/local-server/dist/execution/engine/types.d.ts.map +1 -0
  168. package/node_modules/@sudocode-ai/local-server/dist/execution/engine/types.js +10 -0
  169. package/node_modules/@sudocode-ai/local-server/dist/execution/engine/types.js.map +1 -0
  170. package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-adapter.d.ts +176 -0
  171. package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-adapter.d.ts.map +1 -0
  172. package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-adapter.js +438 -0
  173. package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-adapter.js.map +1 -0
  174. package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-integration.d.ts +96 -0
  175. package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-integration.d.ts.map +1 -0
  176. package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-integration.js +96 -0
  177. package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-integration.js.map +1 -0
  178. package/node_modules/@sudocode-ai/local-server/dist/execution/output/claude-code-output-processor.d.ts +321 -0
  179. package/node_modules/@sudocode-ai/local-server/dist/execution/output/claude-code-output-processor.d.ts.map +1 -0
  180. package/node_modules/@sudocode-ai/local-server/dist/execution/output/claude-code-output-processor.js +769 -0
  181. package/node_modules/@sudocode-ai/local-server/dist/execution/output/claude-code-output-processor.js.map +1 -0
  182. package/node_modules/@sudocode-ai/local-server/dist/execution/output/index.d.ts +18 -0
  183. package/node_modules/@sudocode-ai/local-server/dist/execution/output/index.d.ts.map +1 -0
  184. package/node_modules/@sudocode-ai/local-server/dist/execution/output/index.js +15 -0
  185. package/node_modules/@sudocode-ai/local-server/dist/execution/output/index.js.map +1 -0
  186. package/node_modules/@sudocode-ai/local-server/dist/execution/output/types.d.ts +421 -0
  187. package/node_modules/@sudocode-ai/local-server/dist/execution/output/types.d.ts.map +1 -0
  188. package/node_modules/@sudocode-ai/local-server/dist/execution/output/types.js +22 -0
  189. package/node_modules/@sudocode-ai/local-server/dist/execution/output/types.js.map +1 -0
  190. package/node_modules/@sudocode-ai/local-server/dist/execution/process/builders/claude.d.ts +86 -0
  191. package/node_modules/@sudocode-ai/local-server/dist/execution/process/builders/claude.d.ts.map +1 -0
  192. package/node_modules/@sudocode-ai/local-server/dist/execution/process/builders/claude.js +59 -0
  193. package/node_modules/@sudocode-ai/local-server/dist/execution/process/builders/claude.js.map +1 -0
  194. package/node_modules/@sudocode-ai/local-server/dist/execution/process/index.d.ts +15 -0
  195. package/node_modules/@sudocode-ai/local-server/dist/execution/process/index.d.ts.map +1 -0
  196. package/node_modules/@sudocode-ai/local-server/dist/execution/process/index.js +15 -0
  197. package/node_modules/@sudocode-ai/local-server/dist/execution/process/index.js.map +1 -0
  198. package/node_modules/@sudocode-ai/local-server/dist/execution/process/manager.d.ts +133 -0
  199. package/node_modules/@sudocode-ai/local-server/dist/execution/process/manager.d.ts.map +1 -0
  200. package/node_modules/@sudocode-ai/local-server/dist/execution/process/manager.js +10 -0
  201. package/node_modules/@sudocode-ai/local-server/dist/execution/process/manager.js.map +1 -0
  202. package/node_modules/@sudocode-ai/local-server/dist/execution/process/simple-manager.d.ts +102 -0
  203. package/node_modules/@sudocode-ai/local-server/dist/execution/process/simple-manager.d.ts.map +1 -0
  204. package/node_modules/@sudocode-ai/local-server/dist/execution/process/simple-manager.js +336 -0
  205. package/node_modules/@sudocode-ai/local-server/dist/execution/process/simple-manager.js.map +1 -0
  206. package/node_modules/@sudocode-ai/local-server/dist/execution/process/types.d.ts +105 -0
  207. package/node_modules/@sudocode-ai/local-server/dist/execution/process/types.d.ts.map +1 -0
  208. package/node_modules/@sudocode-ai/local-server/dist/execution/process/types.js +10 -0
  209. package/node_modules/@sudocode-ai/local-server/dist/execution/process/types.js.map +1 -0
  210. package/node_modules/@sudocode-ai/local-server/dist/execution/process/utils.d.ts +53 -0
  211. package/node_modules/@sudocode-ai/local-server/dist/execution/process/utils.d.ts.map +1 -0
  212. package/node_modules/@sudocode-ai/local-server/dist/execution/process/utils.js +97 -0
  213. package/node_modules/@sudocode-ai/local-server/dist/execution/process/utils.js.map +1 -0
  214. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/circuit-breaker.d.ts +170 -0
  215. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/circuit-breaker.d.ts.map +1 -0
  216. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/circuit-breaker.js +291 -0
  217. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/circuit-breaker.js.map +1 -0
  218. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/executor.d.ts +109 -0
  219. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/executor.d.ts.map +1 -0
  220. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/executor.js +10 -0
  221. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/executor.js.map +1 -0
  222. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/index.d.ts +14 -0
  223. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/index.d.ts.map +1 -0
  224. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/index.js +15 -0
  225. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/index.js.map +1 -0
  226. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/resilient-executor.d.ts +86 -0
  227. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/resilient-executor.d.ts.map +1 -0
  228. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/resilient-executor.js +261 -0
  229. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/resilient-executor.js.map +1 -0
  230. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/retry.d.ts +161 -0
  231. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/retry.d.ts.map +1 -0
  232. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/retry.js +234 -0
  233. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/retry.js.map +1 -0
  234. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/types.d.ts +226 -0
  235. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/types.d.ts.map +1 -0
  236. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/types.js +30 -0
  237. package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/types.js.map +1 -0
  238. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/event-buffer.d.ts +119 -0
  239. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/event-buffer.d.ts.map +1 -0
  240. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/event-buffer.js +208 -0
  241. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/event-buffer.js.map +1 -0
  242. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/index.d.ts +10 -0
  243. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/index.d.ts.map +1 -0
  244. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/index.js +10 -0
  245. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/index.js.map +1 -0
  246. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/sse-transport.d.ts +146 -0
  247. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/sse-transport.d.ts.map +1 -0
  248. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/sse-transport.js +282 -0
  249. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/sse-transport.js.map +1 -0
  250. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/transport-manager.d.ts +176 -0
  251. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/transport-manager.d.ts.map +1 -0
  252. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/transport-manager.js +231 -0
  253. package/node_modules/@sudocode-ai/local-server/dist/execution/transport/transport-manager.js.map +1 -0
  254. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/index.d.ts +13 -0
  255. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/index.d.ts.map +1 -0
  256. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/index.js +13 -0
  257. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/index.js.map +1 -0
  258. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/linear-orchestrator.d.ts +216 -0
  259. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/linear-orchestrator.d.ts.map +1 -0
  260. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/linear-orchestrator.js +683 -0
  261. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/linear-orchestrator.js.map +1 -0
  262. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/memory-storage.d.ts +54 -0
  263. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/memory-storage.d.ts.map +1 -0
  264. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/memory-storage.js +68 -0
  265. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/memory-storage.js.map +1 -0
  266. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/orchestrator.d.ts +158 -0
  267. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/orchestrator.d.ts.map +1 -0
  268. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/orchestrator.js +9 -0
  269. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/orchestrator.js.map +1 -0
  270. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/types.d.ts +172 -0
  271. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/types.d.ts.map +1 -0
  272. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/types.js +9 -0
  273. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/types.js.map +1 -0
  274. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/utils.d.ts +89 -0
  275. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/utils.d.ts.map +1 -0
  276. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/utils.js +152 -0
  277. package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/utils.js.map +1 -0
  278. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/config.d.ts +74 -0
  279. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/config.d.ts.map +1 -0
  280. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/config.js +280 -0
  281. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/config.js.map +1 -0
  282. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-cli.d.ts +151 -0
  283. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-cli.d.ts.map +1 -0
  284. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-cli.js +189 -0
  285. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-cli.js.map +1 -0
  286. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/index.d.ts +16 -0
  287. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/index.d.ts.map +1 -0
  288. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/index.js +15 -0
  289. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/index.js.map +1 -0
  290. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/manager.d.ts +184 -0
  291. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/manager.d.ts.map +1 -0
  292. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/manager.js +452 -0
  293. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/manager.js.map +1 -0
  294. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/types.d.ts +90 -0
  295. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/types.d.ts.map +1 -0
  296. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/types.js +42 -0
  297. package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/types.js.map +1 -0
  298. package/node_modules/@sudocode-ai/local-server/dist/index.d.ts +8 -0
  299. package/node_modules/@sudocode-ai/local-server/dist/index.d.ts.map +1 -0
  300. package/node_modules/@sudocode-ai/local-server/dist/index.js +356 -0
  301. package/node_modules/@sudocode-ai/local-server/dist/index.js.map +1 -0
  302. package/node_modules/@sudocode-ai/local-server/dist/public/assets/index-C4SmlXoo.js +568 -0
  303. package/node_modules/@sudocode-ai/local-server/dist/public/assets/index-C4SmlXoo.js.map +1 -0
  304. package/node_modules/@sudocode-ai/local-server/dist/public/assets/index-DE59j7ti.css +1 -0
  305. package/node_modules/@sudocode-ai/local-server/dist/public/assets/react-vendor-LX0UoTxg.js +60 -0
  306. package/node_modules/@sudocode-ai/local-server/dist/public/assets/react-vendor-LX0UoTxg.js.map +1 -0
  307. package/node_modules/@sudocode-ai/local-server/dist/public/assets/ui-vendor-_cxVHaqZ.js +54 -0
  308. package/node_modules/@sudocode-ai/local-server/dist/public/assets/ui-vendor-_cxVHaqZ.js.map +1 -0
  309. package/node_modules/@sudocode-ai/local-server/dist/public/favicon.ico +0 -0
  310. package/node_modules/@sudocode-ai/local-server/dist/public/index.html +16 -0
  311. package/node_modules/@sudocode-ai/local-server/dist/public/logo.png +0 -0
  312. package/node_modules/@sudocode-ai/local-server/dist/routes/executions-stream.d.ts +24 -0
  313. package/node_modules/@sudocode-ai/local-server/dist/routes/executions-stream.d.ts.map +1 -0
  314. package/node_modules/@sudocode-ai/local-server/dist/routes/executions-stream.js +55 -0
  315. package/node_modules/@sudocode-ai/local-server/dist/routes/executions-stream.js.map +1 -0
  316. package/node_modules/@sudocode-ai/local-server/dist/routes/executions.d.ts +19 -0
  317. package/node_modules/@sudocode-ai/local-server/dist/routes/executions.d.ts.map +1 -0
  318. package/node_modules/@sudocode-ai/local-server/dist/routes/executions.js +267 -0
  319. package/node_modules/@sudocode-ai/local-server/dist/routes/executions.js.map +1 -0
  320. package/node_modules/@sudocode-ai/local-server/dist/routes/feedback.d.ts +7 -0
  321. package/node_modules/@sudocode-ai/local-server/dist/routes/feedback.d.ts.map +1 -0
  322. package/node_modules/@sudocode-ai/local-server/dist/routes/feedback.js +329 -0
  323. package/node_modules/@sudocode-ai/local-server/dist/routes/feedback.js.map +1 -0
  324. package/node_modules/@sudocode-ai/local-server/dist/routes/issues.d.ts +7 -0
  325. package/node_modules/@sudocode-ai/local-server/dist/routes/issues.d.ts.map +1 -0
  326. package/node_modules/@sudocode-ai/local-server/dist/routes/issues.js +280 -0
  327. package/node_modules/@sudocode-ai/local-server/dist/routes/issues.js.map +1 -0
  328. package/node_modules/@sudocode-ai/local-server/dist/routes/relationships.d.ts +7 -0
  329. package/node_modules/@sudocode-ai/local-server/dist/routes/relationships.d.ts.map +1 -0
  330. package/node_modules/@sudocode-ai/local-server/dist/routes/relationships.js +308 -0
  331. package/node_modules/@sudocode-ai/local-server/dist/routes/relationships.js.map +1 -0
  332. package/node_modules/@sudocode-ai/local-server/dist/routes/specs.d.ts +7 -0
  333. package/node_modules/@sudocode-ai/local-server/dist/routes/specs.d.ts.map +1 -0
  334. package/node_modules/@sudocode-ai/local-server/dist/routes/specs.js +270 -0
  335. package/node_modules/@sudocode-ai/local-server/dist/routes/specs.js.map +1 -0
  336. package/node_modules/@sudocode-ai/local-server/dist/services/db.d.ts +33 -0
  337. package/node_modules/@sudocode-ai/local-server/dist/services/db.d.ts.map +1 -0
  338. package/node_modules/@sudocode-ai/local-server/dist/services/db.js +85 -0
  339. package/node_modules/@sudocode-ai/local-server/dist/services/db.js.map +1 -0
  340. package/node_modules/@sudocode-ai/local-server/dist/services/execution-lifecycle.d.ts +108 -0
  341. package/node_modules/@sudocode-ai/local-server/dist/services/execution-lifecycle.d.ts.map +1 -0
  342. package/node_modules/@sudocode-ai/local-server/dist/services/execution-lifecycle.js +286 -0
  343. package/node_modules/@sudocode-ai/local-server/dist/services/execution-lifecycle.js.map +1 -0
  344. package/node_modules/@sudocode-ai/local-server/dist/services/execution-service.d.ts +185 -0
  345. package/node_modules/@sudocode-ai/local-server/dist/services/execution-service.d.ts.map +1 -0
  346. package/node_modules/@sudocode-ai/local-server/dist/services/execution-service.js +676 -0
  347. package/node_modules/@sudocode-ai/local-server/dist/services/execution-service.js.map +1 -0
  348. package/node_modules/@sudocode-ai/local-server/dist/services/executions.d.ts +59 -0
  349. package/node_modules/@sudocode-ai/local-server/dist/services/executions.d.ts.map +1 -0
  350. package/node_modules/@sudocode-ai/local-server/dist/services/executions.js +164 -0
  351. package/node_modules/@sudocode-ai/local-server/dist/services/executions.js.map +1 -0
  352. package/node_modules/@sudocode-ai/local-server/dist/services/export.d.ts +24 -0
  353. package/node_modules/@sudocode-ai/local-server/dist/services/export.d.ts.map +1 -0
  354. package/node_modules/@sudocode-ai/local-server/dist/services/export.js +106 -0
  355. package/node_modules/@sudocode-ai/local-server/dist/services/export.js.map +1 -0
  356. package/node_modules/@sudocode-ai/local-server/dist/services/feedback.d.ts +40 -0
  357. package/node_modules/@sudocode-ai/local-server/dist/services/feedback.d.ts.map +1 -0
  358. package/node_modules/@sudocode-ai/local-server/dist/services/feedback.js +54 -0
  359. package/node_modules/@sudocode-ai/local-server/dist/services/feedback.js.map +1 -0
  360. package/node_modules/@sudocode-ai/local-server/dist/services/issues.d.ts +27 -0
  361. package/node_modules/@sudocode-ai/local-server/dist/services/issues.d.ts.map +1 -0
  362. package/node_modules/@sudocode-ai/local-server/dist/services/issues.js +35 -0
  363. package/node_modules/@sudocode-ai/local-server/dist/services/issues.js.map +1 -0
  364. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-template-engine.d.ts +108 -0
  365. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-template-engine.d.ts.map +1 -0
  366. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-template-engine.js +212 -0
  367. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-template-engine.js.map +1 -0
  368. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-templates.d.ts +97 -0
  369. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-templates.d.ts.map +1 -0
  370. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-templates.js +236 -0
  371. package/node_modules/@sudocode-ai/local-server/dist/services/prompt-templates.js.map +1 -0
  372. package/node_modules/@sudocode-ai/local-server/dist/services/relationships.d.ts +35 -0
  373. package/node_modules/@sudocode-ai/local-server/dist/services/relationships.d.ts.map +1 -0
  374. package/node_modules/@sudocode-ai/local-server/dist/services/relationships.js +42 -0
  375. package/node_modules/@sudocode-ai/local-server/dist/services/relationships.js.map +1 -0
  376. package/node_modules/@sudocode-ai/local-server/dist/services/specs.d.ts +27 -0
  377. package/node_modules/@sudocode-ai/local-server/dist/services/specs.d.ts.map +1 -0
  378. package/node_modules/@sudocode-ai/local-server/dist/services/specs.js +35 -0
  379. package/node_modules/@sudocode-ai/local-server/dist/services/specs.js.map +1 -0
  380. package/node_modules/@sudocode-ai/local-server/dist/services/watcher.d.ts +50 -0
  381. package/node_modules/@sudocode-ai/local-server/dist/services/watcher.d.ts.map +1 -0
  382. package/node_modules/@sudocode-ai/local-server/dist/services/watcher.js +69 -0
  383. package/node_modules/@sudocode-ai/local-server/dist/services/watcher.js.map +1 -0
  384. package/node_modules/@sudocode-ai/local-server/dist/services/websocket.d.ts +127 -0
  385. package/node_modules/@sudocode-ai/local-server/dist/services/websocket.d.ts.map +1 -0
  386. package/node_modules/@sudocode-ai/local-server/dist/services/websocket.js +389 -0
  387. package/node_modules/@sudocode-ai/local-server/dist/services/websocket.js.map +1 -0
  388. package/node_modules/@sudocode-ai/local-server/dist/utils/sudocode-dir.d.ts +6 -0
  389. package/node_modules/@sudocode-ai/local-server/dist/utils/sudocode-dir.d.ts.map +1 -0
  390. package/node_modules/@sudocode-ai/local-server/dist/utils/sudocode-dir.js +9 -0
  391. package/node_modules/@sudocode-ai/local-server/dist/utils/sudocode-dir.js.map +1 -0
  392. package/node_modules/@sudocode-ai/local-server/package.json +72 -0
  393. package/node_modules/@sudocode-ai/mcp/LICENSE +21 -0
  394. package/node_modules/@sudocode-ai/mcp/README.md +226 -0
  395. package/node_modules/@sudocode-ai/mcp/dist/client.d.ts +33 -0
  396. package/node_modules/@sudocode-ai/mcp/dist/client.d.ts.map +1 -0
  397. package/node_modules/@sudocode-ai/mcp/dist/client.js +159 -0
  398. package/node_modules/@sudocode-ai/mcp/dist/client.js.map +1 -0
  399. package/node_modules/@sudocode-ai/mcp/dist/index.d.ts +6 -0
  400. package/node_modules/@sudocode-ai/mcp/dist/index.d.ts.map +1 -0
  401. package/node_modules/@sudocode-ai/mcp/dist/index.js +64 -0
  402. package/node_modules/@sudocode-ai/mcp/dist/index.js.map +1 -0
  403. package/node_modules/@sudocode-ai/mcp/dist/server.d.ts +26 -0
  404. package/node_modules/@sudocode-ai/mcp/dist/server.d.ts.map +1 -0
  405. package/node_modules/@sudocode-ai/mcp/dist/server.js +575 -0
  406. package/node_modules/@sudocode-ai/mcp/dist/server.js.map +1 -0
  407. package/node_modules/@sudocode-ai/mcp/dist/tools/analytics.d.ts +41 -0
  408. package/node_modules/@sudocode-ai/mcp/dist/tools/analytics.d.ts.map +1 -0
  409. package/node_modules/@sudocode-ai/mcp/dist/tools/analytics.js +21 -0
  410. package/node_modules/@sudocode-ai/mcp/dist/tools/analytics.js.map +1 -0
  411. package/node_modules/@sudocode-ai/mcp/dist/tools/feedback.d.ts +19 -0
  412. package/node_modules/@sudocode-ai/mcp/dist/tools/feedback.d.ts.map +1 -0
  413. package/node_modules/@sudocode-ai/mcp/dist/tools/feedback.js +24 -0
  414. package/node_modules/@sudocode-ai/mcp/dist/tools/feedback.js.map +1 -0
  415. package/node_modules/@sudocode-ai/mcp/dist/tools/init.d.ts +17 -0
  416. package/node_modules/@sudocode-ai/mcp/dist/tools/init.d.ts.map +1 -0
  417. package/node_modules/@sudocode-ai/mcp/dist/tools/init.js +15 -0
  418. package/node_modules/@sudocode-ai/mcp/dist/tools/init.js.map +1 -0
  419. package/node_modules/@sudocode-ai/mcp/dist/tools/issues.d.ts +44 -0
  420. package/node_modules/@sudocode-ai/mcp/dist/tools/issues.d.ts.map +1 -0
  421. package/node_modules/@sudocode-ai/mcp/dist/tools/issues.js +106 -0
  422. package/node_modules/@sudocode-ai/mcp/dist/tools/issues.js.map +1 -0
  423. package/node_modules/@sudocode-ai/mcp/dist/tools/references.d.ts +21 -0
  424. package/node_modules/@sudocode-ai/mcp/dist/tools/references.d.ts.map +1 -0
  425. package/node_modules/@sudocode-ai/mcp/dist/tools/references.js +49 -0
  426. package/node_modules/@sudocode-ai/mcp/dist/tools/references.js.map +1 -0
  427. package/node_modules/@sudocode-ai/mcp/dist/tools/relationships.d.ts +15 -0
  428. package/node_modules/@sudocode-ai/mcp/dist/tools/relationships.d.ts.map +1 -0
  429. package/node_modules/@sudocode-ai/mcp/dist/tools/relationships.js +18 -0
  430. package/node_modules/@sudocode-ai/mcp/dist/tools/relationships.js.map +1 -0
  431. package/node_modules/@sudocode-ai/mcp/dist/tools/specs.d.ts +35 -0
  432. package/node_modules/@sudocode-ai/mcp/dist/tools/specs.d.ts.map +1 -0
  433. package/node_modules/@sudocode-ai/mcp/dist/tools/specs.js +85 -0
  434. package/node_modules/@sudocode-ai/mcp/dist/tools/specs.js.map +1 -0
  435. package/node_modules/@sudocode-ai/mcp/dist/types.d.ts +35 -0
  436. package/node_modules/@sudocode-ai/mcp/dist/types.d.ts.map +1 -0
  437. package/node_modules/@sudocode-ai/mcp/dist/types.js +21 -0
  438. package/node_modules/@sudocode-ai/mcp/dist/types.js.map +1 -0
  439. package/node_modules/@sudocode-ai/mcp/package.json +67 -0
  440. package/node_modules/@sudocode-ai/types/README.md +7 -0
  441. package/node_modules/@sudocode-ai/types/dist/schema.d.ts +45 -0
  442. package/node_modules/@sudocode-ai/types/dist/schema.d.ts.map +1 -0
  443. package/node_modules/@sudocode-ai/types/dist/schema.js +338 -0
  444. package/node_modules/@sudocode-ai/types/dist/schema.js.map +1 -0
  445. package/node_modules/@sudocode-ai/types/package.json +46 -0
  446. package/package.json +51 -12
  447. package/index.js +0 -5
@@ -0,0 +1,452 @@
1
+ /**
2
+ * Worktree Manager
3
+ *
4
+ * Manages git worktrees for session isolation.
5
+ *
6
+ * WORKTREE ISOLATION:
7
+ * ===================
8
+ * Each worktree created by this manager is completely isolated from the main
9
+ * repository. This prevents race conditions and unexpected modifications during
10
+ * concurrent executions.
11
+ *
12
+ * Isolation is achieved through:
13
+ * 1. Local database (.sudocode/cache.db) in each worktree
14
+ * 2. Synced JSONL files with latest state (including uncommitted changes)
15
+ * 3. Claude config (.claude/config.json) that forces MCP to use local database
16
+ *
17
+ * Key Benefit: Multiple executions can run concurrently without interfering
18
+ * with each other or the main repository. All MCP/CLI operations in a worktree
19
+ * stay contained within that worktree.
20
+ *
21
+ * See setupWorktreeEnvironment() method for detailed implementation.
22
+ *
23
+ * @module execution/worktree/manager
24
+ */
25
+ import { Mutex } from "async-mutex";
26
+ import fs from "fs";
27
+ import path from "path";
28
+ import { WorktreeError, WorktreeErrorCode } from "./types.js";
29
+ import { GitCli } from "./git-cli.js";
30
+ import { initDatabase } from "@sudocode-ai/cli/dist/db.js";
31
+ import { importFromJSONL } from "@sudocode-ai/cli/dist/import.js";
32
+ import { execSync } from "child_process";
33
+ /**
34
+ * WorktreeManager - Implementation of IWorktreeManager
35
+ *
36
+ * Manages git worktrees with proper locking, cleanup, and error recovery.
37
+ * Uses git CLI commands for reliability.
38
+ */
39
+ export class WorktreeManager {
40
+ /** Per-path locks to prevent concurrent operations */
41
+ locks = new Map();
42
+ /** Configuration loaded from .sudocode/config.json */
43
+ config;
44
+ /** Git CLI wrapper */
45
+ git;
46
+ /**
47
+ * Create a new WorktreeManager
48
+ *
49
+ * @param config - Worktree configuration
50
+ * @param git - Optional git CLI implementation (defaults to GitCli)
51
+ */
52
+ constructor(config, git) {
53
+ this.config = config;
54
+ this.git = git || new GitCli();
55
+ }
56
+ /**
57
+ * Get or create a lock for a specific path
58
+ *
59
+ * @param path - Path to lock
60
+ * @returns Mutex for the path
61
+ */
62
+ getLock(path) {
63
+ let lock = this.locks.get(path);
64
+ if (!lock) {
65
+ lock = new Mutex();
66
+ this.locks.set(path, lock);
67
+ }
68
+ return lock;
69
+ }
70
+ async createWorktree(params) {
71
+ const { repoPath, branchName, worktreePath, baseBranch: _baseBranch, createBranch, commitSha, } = params;
72
+ try {
73
+ // 1. Create branch if requested
74
+ if (createBranch) {
75
+ // Use the specified commit SHA or the current HEAD commit SHA to branch from
76
+ const targetCommit = commitSha || (await this.git.getCurrentCommit(repoPath));
77
+ await this.git.createBranch(repoPath, branchName, targetCommit);
78
+ }
79
+ // 2. Create parent directory if needed
80
+ const parentDir = path.dirname(worktreePath);
81
+ if (!fs.existsSync(parentDir)) {
82
+ fs.mkdirSync(parentDir, { recursive: true });
83
+ }
84
+ // 3. Call git worktree add
85
+ await this.git.worktreeAdd(repoPath, worktreePath, branchName);
86
+ // 4. Apply sparse-checkout if configured
87
+ if (this.config.enableSparseCheckout &&
88
+ this.config.sparseCheckoutPatterns) {
89
+ await this.git.configureSparseCheckout(worktreePath, this.config.sparseCheckoutPatterns);
90
+ }
91
+ // 5. Validate creation
92
+ if (!fs.existsSync(worktreePath)) {
93
+ throw new WorktreeError(`Worktree creation succeeded but path does not exist: ${worktreePath}`, WorktreeErrorCode.REPOSITORY_ERROR);
94
+ }
95
+ // 6. Setup isolated worktree environment
96
+ // This is critical for preventing the worktree from modifying the main repository.
97
+ // It creates a local database, syncs JSONL files, and configures Claude to use
98
+ // the local environment. See setupWorktreeEnvironment() for detailed explanation.
99
+ await this.setupWorktreeEnvironment(repoPath, worktreePath);
100
+ }
101
+ catch (error) {
102
+ if (error instanceof WorktreeError) {
103
+ throw error;
104
+ }
105
+ throw new WorktreeError(`Failed to create worktree: ${error}`, WorktreeErrorCode.REPOSITORY_ERROR, error);
106
+ }
107
+ }
108
+ /**
109
+ * Setup isolated environment for worktree
110
+ *
111
+ * WORKTREE ISOLATION ARCHITECTURE:
112
+ * ================================
113
+ * Problem: Previously, MCP/CLI tools running in worktrees would search upward
114
+ * and find the main repository's database, causing race conditions and
115
+ * unexpected modifications to the main repo during execution.
116
+ *
117
+ * Solution: Each worktree gets its own isolated environment:
118
+ * - Local database (.sudocode/cache.db in worktree)
119
+ * - Synced JSONL files with latest state (including uncommitted changes)
120
+ * - Claude config that forces MCP to use the local database
121
+ *
122
+ * Benefits:
123
+ * - Worktree operations never affect main repository
124
+ * - Multiple executions can run concurrently without conflicts
125
+ * - Worktree gets consistent state (newly created issues are available)
126
+ * - Easy to inspect/debug worktree state after execution
127
+ *
128
+ * Flow:
129
+ * 1. Git creates worktree → checks out files from committed git tree
130
+ * 2. This method runs → copies latest JSONL (including uncommitted changes)
131
+ * 3. Initializes local DB from JSONL → worktree has complete state
132
+ * 4. Creates .claude/config.json → MCP uses local DB via env vars
133
+ * 5. Claude runs → all MCP operations stay in worktree
134
+ * 6. (Future) Merge worktree changes back to main after execution
135
+ *
136
+ * @param repoPath - Path to the main git repository
137
+ * @param worktreePath - Path to the worktree directory
138
+ */
139
+ async setupWorktreeEnvironment(repoPath, worktreePath) {
140
+ console.debug("[WorktreeManager] Setting up isolated worktree environment", {
141
+ repoPath,
142
+ worktreePath,
143
+ });
144
+ const mainSudocodeDir = path.join(repoPath, ".sudocode");
145
+ const worktreeSudocodeDir = path.join(worktreePath, ".sudocode");
146
+ console.debug("[WorktreeManager] Directory paths", {
147
+ mainSudocodeDir,
148
+ worktreeSudocodeDir,
149
+ });
150
+ // Ensure .sudocode directory exists in worktree
151
+ if (!fs.existsSync(worktreeSudocodeDir)) {
152
+ fs.mkdirSync(worktreeSudocodeDir, { recursive: true });
153
+ console.debug(`[WorktreeManager] Created .sudocode directory in worktree: ${worktreeSudocodeDir}`);
154
+ }
155
+ else {
156
+ console.debug(`[WorktreeManager] .sudocode directory already exists in worktree`);
157
+ }
158
+ // STEP 1: Copy uncommitted JSONL files from main repo to worktree
159
+ // ================================================================
160
+ // Why: Git worktree checkout only gets committed files from git history.
161
+ // If the user created new issues/specs before starting the execution,
162
+ // those changes are in the main repo's JSONL files but not committed.
163
+ // We need to copy them so the worktree has the complete, up-to-date state.
164
+ //
165
+ // Example: User creates ISSUE-144, starts execution immediately.
166
+ // - Git tree: has 138 issues (old state)
167
+ // - Main JSONL: has 140 issues (includes ISSUE-144, uncommitted)
168
+ // - Without this copy: worktree would only have 138 issues, ISSUE-144 missing!
169
+ // - With this copy: worktree gets all 140 issues, execution can reference ISSUE-144
170
+ const jsonlFiles = ["issues.jsonl", "specs.jsonl"];
171
+ for (const file of jsonlFiles) {
172
+ const mainFile = path.join(mainSudocodeDir, file);
173
+ const worktreeFile = path.join(worktreeSudocodeDir, file);
174
+ console.debug(`[WorktreeManager] Processing ${file}`, {
175
+ mainFile,
176
+ worktreeFile,
177
+ mainFileExists: fs.existsSync(mainFile),
178
+ });
179
+ if (fs.existsSync(mainFile)) {
180
+ const mainStats = fs.statSync(mainFile);
181
+ fs.copyFileSync(mainFile, worktreeFile);
182
+ const worktreeStats = fs.statSync(worktreeFile);
183
+ console.debug(`[WorktreeManager] Synced ${file} from main repo to worktree`, {
184
+ mainFileSize: mainStats.size,
185
+ worktreeFileSize: worktreeStats.size,
186
+ });
187
+ }
188
+ else {
189
+ console.debug(`[WorktreeManager] Main file does not exist: ${mainFile}`);
190
+ }
191
+ }
192
+ // STEP 2: Copy config.json
193
+ // ========================
194
+ // Copy sudocode configuration to maintain consistency
195
+ const mainConfig = path.join(mainSudocodeDir, "config.json");
196
+ const worktreeConfig = path.join(worktreeSudocodeDir, "config.json");
197
+ if (fs.existsSync(mainConfig)) {
198
+ fs.copyFileSync(mainConfig, worktreeConfig);
199
+ console.debug(`[WorktreeManager] Copied config.json from main repo to worktree`);
200
+ }
201
+ else {
202
+ console.debug(`[WorktreeManager] No config.json to copy from main repo`);
203
+ }
204
+ // STEP 3: Initialize local database in worktree
205
+ // ==============================================
206
+ // Create a brand new SQLite database in the worktree and import the JSONL
207
+ // files we just copied. This gives the worktree its own isolated database
208
+ // with the complete current state.
209
+ //
210
+ // Important: This database is completely separate from the main repo's DB.
211
+ // All MCP/CLI operations in the worktree will use THIS database, not the main one.
212
+ const worktreeDbPath = path.join(worktreeSudocodeDir, "cache.db");
213
+ // Initialize database with CLI's initDatabase (creates all tables)
214
+ const db = initDatabase({ path: worktreeDbPath, verbose: false });
215
+ try {
216
+ await importFromJSONL(db, {
217
+ inputDir: worktreeSudocodeDir,
218
+ });
219
+ console.debug(`[WorktreeManager] Successfully initialized local database in worktree at ${worktreeDbPath}`);
220
+ // Verify database was created
221
+ if (fs.existsSync(worktreeDbPath)) {
222
+ const dbStats = fs.statSync(worktreeDbPath);
223
+ console.debug("[WorktreeManager] Database file created", {
224
+ path: worktreeDbPath,
225
+ size: dbStats.size,
226
+ });
227
+ }
228
+ else {
229
+ console.error("[WorktreeManager] ERROR: Database file was not created!");
230
+ }
231
+ }
232
+ catch (error) {
233
+ console.error("[WorktreeManager] Failed to initialize database", error);
234
+ throw error;
235
+ }
236
+ finally {
237
+ db.close();
238
+ }
239
+ console.debug("[WorktreeManager] Worktree environment setup complete");
240
+ }
241
+ async ensureWorktreeExists(repoPath, branchName, worktreePath) {
242
+ // Get lock for this specific path
243
+ const lock = this.getLock(worktreePath);
244
+ const release = await lock.acquire();
245
+ try {
246
+ // Check if already exists and valid
247
+ if (await this.isWorktreeValid(repoPath, worktreePath)) {
248
+ return;
249
+ }
250
+ // Recreate worktree
251
+ await this.recreateWorktree(repoPath, branchName, worktreePath);
252
+ }
253
+ finally {
254
+ release();
255
+ }
256
+ }
257
+ async cleanupWorktree(worktreePath, repoPath) {
258
+ // Get lock for this specific path
259
+ const lock = this.getLock(worktreePath);
260
+ const release = await lock.acquire();
261
+ try {
262
+ // Infer repoPath if not provided (try to find from worktree)
263
+ const effectiveRepoPath = repoPath || (await this.inferRepoPath(worktreePath));
264
+ if (!effectiveRepoPath) {
265
+ // Can't determine repo path, just cleanup the directory
266
+ if (fs.existsSync(worktreePath)) {
267
+ fs.rmSync(worktreePath, { recursive: true, force: true });
268
+ }
269
+ return;
270
+ }
271
+ // Get worktree info to find branch name (for optional deletion)
272
+ let branchName;
273
+ try {
274
+ const worktrees = await this.git.worktreeList(effectiveRepoPath);
275
+ // Normalize paths for comparison (resolves symlinks like /var -> /private/var on macOS)
276
+ const normalizedWorktreePath = fs.realpathSync(worktreePath);
277
+ const worktreeInfo = worktrees.find((w) => {
278
+ try {
279
+ const normalizedGitPath = fs.realpathSync(w.path);
280
+ return normalizedGitPath === normalizedWorktreePath;
281
+ }
282
+ catch {
283
+ // If path doesn't exist, try direct comparison
284
+ return w.path === worktreePath;
285
+ }
286
+ });
287
+ if (worktreeInfo) {
288
+ branchName = worktreeInfo.branch;
289
+ }
290
+ }
291
+ catch (error) {
292
+ // Ignore errors, branch deletion is optional
293
+ }
294
+ // 1. Remove git worktree registration
295
+ try {
296
+ await this.git.worktreeRemove(effectiveRepoPath, worktreePath, true);
297
+ }
298
+ catch (error) {
299
+ // Worktree might already be removed or invalid, continue cleanup
300
+ }
301
+ // 2. Force cleanup metadata directory
302
+ const worktreeName = path.basename(worktreePath);
303
+ const metadataPath = path.join(effectiveRepoPath, ".git", "worktrees", worktreeName);
304
+ if (fs.existsSync(metadataPath)) {
305
+ fs.rmSync(metadataPath, { recursive: true, force: true });
306
+ }
307
+ // 3. Remove filesystem directory
308
+ if (fs.existsSync(worktreePath)) {
309
+ fs.rmSync(worktreePath, { recursive: true, force: true });
310
+ }
311
+ // 4. Prune stale worktree entries
312
+ try {
313
+ await this.git.worktreePrune(effectiveRepoPath);
314
+ }
315
+ catch (error) {
316
+ // Prune is best-effort, continue even if it fails
317
+ }
318
+ // 5. Delete branch if configured
319
+ if (this.config.autoDeleteBranches &&
320
+ branchName &&
321
+ branchName !== "(detached)") {
322
+ try {
323
+ await this.git.deleteBranch(effectiveRepoPath, branchName, true);
324
+ }
325
+ catch (error) {
326
+ // Branch deletion is optional, don't fail the cleanup
327
+ }
328
+ }
329
+ }
330
+ finally {
331
+ release();
332
+ }
333
+ }
334
+ async isWorktreeValid(repoPath, worktreePath) {
335
+ try {
336
+ // 1. Check filesystem path exists
337
+ if (!fs.existsSync(worktreePath)) {
338
+ return false;
339
+ }
340
+ // 2. Check worktree is registered in git metadata
341
+ const worktrees = await this.git.worktreeList(repoPath);
342
+ // Normalize paths for comparison (resolves symlinks like /var -> /private/var on macOS)
343
+ const normalizedWorktreePath = fs.realpathSync(worktreePath);
344
+ const isRegistered = worktrees.some((w) => {
345
+ try {
346
+ const normalizedGitPath = fs.realpathSync(w.path);
347
+ return normalizedGitPath === normalizedWorktreePath;
348
+ }
349
+ catch {
350
+ // If path doesn't exist, try direct comparison
351
+ return w.path === worktreePath;
352
+ }
353
+ });
354
+ return isRegistered;
355
+ }
356
+ catch (error) {
357
+ // On any error, consider invalid
358
+ return false;
359
+ }
360
+ }
361
+ async listWorktrees(repoPath) {
362
+ return await this.git.worktreeList(repoPath);
363
+ }
364
+ getConfig() {
365
+ return { ...this.config };
366
+ }
367
+ async isValidRepo(repoPath) {
368
+ return this.git.isValidRepo(repoPath);
369
+ }
370
+ async listBranches(repoPath) {
371
+ return this.git.listBranches(repoPath);
372
+ }
373
+ /**
374
+ * Recreate a worktree (internal method)
375
+ *
376
+ * @param repoPath - Path to repository
377
+ * @param branchName - Branch name
378
+ * @param worktreePath - Worktree path
379
+ */
380
+ async recreateWorktree(repoPath, branchName, worktreePath) {
381
+ // 1. Comprehensive cleanup of existing worktree
382
+ await this.cleanupWorktree(worktreePath, repoPath);
383
+ // 2. Create parent directory if needed
384
+ const parentDir = path.dirname(worktreePath);
385
+ if (!fs.existsSync(parentDir)) {
386
+ fs.mkdirSync(parentDir, { recursive: true });
387
+ }
388
+ // 3. Create worktree with retry logic
389
+ let lastError;
390
+ const maxRetries = 1;
391
+ for (let attempt = 0; attempt <= maxRetries; attempt++) {
392
+ try {
393
+ await this.git.worktreeAdd(repoPath, worktreePath, branchName);
394
+ // Apply sparse-checkout if configured
395
+ if (this.config.enableSparseCheckout &&
396
+ this.config.sparseCheckoutPatterns) {
397
+ await this.git.configureSparseCheckout(worktreePath, this.config.sparseCheckoutPatterns);
398
+ }
399
+ // Validate creation
400
+ if (!fs.existsSync(worktreePath)) {
401
+ throw new WorktreeError(`Worktree creation succeeded but path does not exist: ${worktreePath}`, WorktreeErrorCode.REPOSITORY_ERROR);
402
+ }
403
+ // Setup isolated worktree environment (see setupWorktreeEnvironment for details)
404
+ await this.setupWorktreeEnvironment(repoPath, worktreePath);
405
+ return; // Success!
406
+ }
407
+ catch (error) {
408
+ lastError = error;
409
+ if (attempt < maxRetries) {
410
+ // Cleanup metadata and try again
411
+ const worktreeName = path.basename(worktreePath);
412
+ const metadataPath = path.join(repoPath, ".git", "worktrees", worktreeName);
413
+ if (fs.existsSync(metadataPath)) {
414
+ fs.rmSync(metadataPath, { recursive: true, force: true });
415
+ }
416
+ }
417
+ }
418
+ }
419
+ // All retries failed
420
+ throw new WorktreeError(`Failed to recreate worktree after ${maxRetries + 1} attempts: ${lastError}`, WorktreeErrorCode.REPOSITORY_ERROR, lastError);
421
+ }
422
+ /**
423
+ * Infer git repository path from a worktree
424
+ * Uses git rev-parse --git-common-dir
425
+ *
426
+ * @param worktreePath - Path to worktree
427
+ * @returns Repository path or undefined
428
+ */
429
+ async inferRepoPath(worktreePath) {
430
+ try {
431
+ if (!fs.existsSync(worktreePath)) {
432
+ return undefined;
433
+ }
434
+ // Try to use git to find the common git directory
435
+ const gitCommonDir = execSync("git rev-parse --git-common-dir", {
436
+ cwd: worktreePath,
437
+ encoding: "utf8",
438
+ }).trim();
439
+ // git-common-dir gives us the .git directory
440
+ // We need the working directory (parent of .git)
441
+ const gitDirPath = path.resolve(worktreePath, gitCommonDir);
442
+ if (path.basename(gitDirPath) === ".git") {
443
+ return path.dirname(gitDirPath);
444
+ }
445
+ return gitDirPath;
446
+ }
447
+ catch (error) {
448
+ return undefined;
449
+ }
450
+ }
451
+ }
452
+ //# sourceMappingURL=manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manager.js","sourceRoot":"","sources":["../../../src/execution/worktree/manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAMxB,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAgB,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAuFzC;;;;;GAKG;AACH,MAAM,OAAO,eAAe;IAC1B,sDAAsD;IAC9C,KAAK,GAAG,IAAI,GAAG,EAAiB,CAAC;IAEzC,sDAAsD;IAC9C,MAAM,CAAiB;IAE/B,s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,EAAE,CAAC;gBACzC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;YAClC,CAAC;YAED,OAAO,UAAU,CAAC;QACpB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Worktree Types
3
+ *
4
+ * Type definitions for worktree management system.
5
+ *
6
+ * @module execution/worktree/types
7
+ */
8
+ /**
9
+ * Worktree creation parameters
10
+ */
11
+ export interface WorktreeCreateParams {
12
+ /** Path to the main git repository */
13
+ repoPath: string;
14
+ /** Branch name for the worktree */
15
+ branchName: string;
16
+ /** Where to create the worktree */
17
+ worktreePath: string;
18
+ /** Branch to base the new branch on */
19
+ baseBranch: string;
20
+ /** Whether to create the branch */
21
+ createBranch: boolean;
22
+ /** Commit SHA to branch from */
23
+ commitSha?: string;
24
+ }
25
+ /**
26
+ * Worktree information returned from git worktree list
27
+ */
28
+ export interface WorktreeInfo {
29
+ /** Path to the worktree */
30
+ path: string;
31
+ /** Branch name */
32
+ branch: string;
33
+ /** Git commit hash */
34
+ commit: string;
35
+ /** Whether this is the main worktree */
36
+ isMain: boolean;
37
+ /** Whether the worktree is locked */
38
+ isLocked: boolean;
39
+ /** Reason for lock (if locked) */
40
+ lockReason?: string;
41
+ }
42
+ /**
43
+ * Worktree configuration (will be implemented in ISSUE-111)
44
+ * Placeholder type for now
45
+ */
46
+ export interface WorktreeConfig {
47
+ /** Where to store worktrees */
48
+ worktreeStoragePath: string;
49
+ /** Auto-create branches for new sessions */
50
+ autoCreateBranches: boolean;
51
+ /** Auto-delete branches when session is cleaned up */
52
+ autoDeleteBranches: boolean;
53
+ /** Use sparse-checkout for worktrees */
54
+ enableSparseCheckout: boolean;
55
+ /** Patterns for sparse-checkout */
56
+ sparseCheckoutPatterns?: string[];
57
+ /** Branch naming prefix */
58
+ branchPrefix: string;
59
+ /** Cleanup orphaned worktrees on server startup */
60
+ cleanupOrphanedWorktreesOnStartup: boolean;
61
+ }
62
+ /**
63
+ * Worktree manager errors
64
+ */
65
+ export declare class WorktreeError extends Error {
66
+ code: WorktreeErrorCode;
67
+ cause?: Error | undefined;
68
+ constructor(message: string, code: WorktreeErrorCode, cause?: Error | undefined);
69
+ }
70
+ export declare enum WorktreeErrorCode {
71
+ /** Git operation failed */
72
+ GIT_ERROR = "GIT_ERROR",
73
+ /** Worktree path already exists */
74
+ PATH_EXISTS = "PATH_EXISTS",
75
+ /** Worktree path not found */
76
+ PATH_NOT_FOUND = "PATH_NOT_FOUND",
77
+ /** Invalid path */
78
+ INVALID_PATH = "INVALID_PATH",
79
+ /** Branch not found */
80
+ BRANCH_NOT_FOUND = "BRANCH_NOT_FOUND",
81
+ /** Repository error */
82
+ REPOSITORY_ERROR = "REPOSITORY_ERROR",
83
+ /** Configuration error */
84
+ CONFIG_ERROR = "CONFIG_ERROR",
85
+ /** Locking error */
86
+ LOCK_ERROR = "LOCK_ERROR",
87
+ /** Cleanup failed */
88
+ CLEANUP_FAILED = "CLEANUP_FAILED"
89
+ }
90
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/execution/worktree/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,YAAY,EAAE,OAAO,CAAC;IACtB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,kB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.
5
+ *
6
+ * @module execution/worktree/types
7
+ */
8
+ /**
9
+ * Worktree manager errors
10
+ */
11
+ export class WorktreeError extends Error {
12
+ code;
13
+ cause;
14
+ constructor(message, code, cause) {
15
+ super(message);
16
+ this.code = code;
17
+ this.cause = cause;
18
+ this.name = "WorktreeError";
19
+ }
20
+ }
21
+ export var WorktreeErrorCode;
22
+ (function (WorktreeErrorCode) {
23
+ /** Git operation failed */
24
+ WorktreeErrorCode["GIT_ERROR"] = "GIT_ERROR";
25
+ /** Worktree path already exists */
26
+ WorktreeErrorCode["PATH_EXISTS"] = "PATH_EXISTS";
27
+ /** Worktree path not found */
28
+ WorktreeErrorCode["PATH_NOT_FOUND"] = "PATH_NOT_FOUND";
29
+ /** Invalid path */
30
+ WorktreeErrorCode["INVALID_PATH"] = "INVALID_PATH";
31
+ /** Branch not found */
32
+ WorktreeErrorCode["BRANCH_NOT_FOUND"] = "BRANCH_NOT_FOUND";
33
+ /** Repository error */
34
+ WorktreeErrorCode["REPOSITORY_ERROR"] = "REPOSITORY_ERROR";
35
+ /** Configuration error */
36
+ WorktreeErrorCode["CONFIG_ERROR"] = "CONFIG_ERROR";
37
+ /** Locking error */
38
+ WorktreeErrorCode["LOCK_ERROR"] = "LOCK_ERROR";
39
+ /** Cleanup failed */
40
+ WorktreeErrorCode["CLEANUP_FAILED"] = "CLEANUP_FAILED";
41
+ })(WorktreeErrorCode || (WorktreeErrorCode = {}));
42
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/execution/worktree/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA2DH;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IAG7B;IACA;IAHT,YACE,OAAe,EACR,IAAuB,EACvB,KAAa;QAEpB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHR,SAAI,GAAJ,IAAI,CAAmB;QACvB,UAAK,GAAL,KAAK,CAAQ;QAGpB,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AAED,MAAM,CAAN,IAAY,iBAmBX;AAnBD,WAAY,iBAAiB;IAC3B,2BAA2B;IAC3B,4CAAuB,CAAA;IACvB,mCAAmC;IACnC,gDAA2B,CAAA;IAC3B,8BAA8B;IAC9B,sDAAiC,CAAA;IACjC,mBAAmB;IACnB,kDAA6B,CAAA;IAC7B,uBAAuB;IACvB,0DAAqC,CAAA;IACrC,uBAAuB;IACvB,0DAAqC,CAAA;IACrC,0BAA0B;IAC1B,kDAA6B,CAAA;IAC7B,oBAAoB;IACpB,8CAAyB,CAAA;IACzB,qBAAqB;IACrB,sDAAiC,CAAA;AACnC,CAAC,EAnBW,iBAAiB,KAAjB,iBAAiB,QAmB5B"}
@@ -0,0 +1,8 @@
1
+ import type Database from "better-sqlite3";
2
+ import { TransportManager } from "./execution/transport/transport-manager.js";
3
+ declare const app: import("express-serve-static-core").Express;
4
+ declare let db: Database.Database;
5
+ declare let transportManager: TransportManager;
6
+ export default app;
7
+ export { db, transportManager };
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAgB3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAkB9E,QAAA,MAAM,GAAG,6CAAY,CAAC;AAetB,QAAA,IAAI,EAAE,EAAG,QAAQ,CAAC,QAAQ,CAAC;AAE3B,QAAA,IAAI,gBAAgB,EAAG,gBAAgB,CAAC;AAkYxC,eAAe,GAAG,CAAC;AACnB,OAAO,EAAE,EAAE,EAAE,gBAAgB,EAAE,CAAC"}