@sudocode-ai/local-server 0.1.7 → 0.1.8

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 (274) hide show
  1. package/README.md +6 -0
  2. package/dist/errors/agent-errors.d.ts +43 -0
  3. package/dist/errors/agent-errors.d.ts.map +1 -0
  4. package/dist/errors/agent-errors.js +69 -0
  5. package/dist/errors/agent-errors.js.map +1 -0
  6. package/dist/execution/adapters/claude-adapter.d.ts +63 -0
  7. package/dist/execution/adapters/claude-adapter.d.ts.map +1 -0
  8. package/dist/execution/adapters/claude-adapter.js +82 -0
  9. package/dist/execution/adapters/claude-adapter.js.map +1 -0
  10. package/dist/execution/adapters/codex-adapter.d.ts +67 -0
  11. package/dist/execution/adapters/codex-adapter.d.ts.map +1 -0
  12. package/dist/execution/adapters/codex-adapter.js +183 -0
  13. package/dist/execution/adapters/codex-adapter.js.map +1 -0
  14. package/dist/execution/adapters/codex-config-builder.d.ts +30 -0
  15. package/dist/execution/adapters/codex-config-builder.d.ts.map +1 -0
  16. package/dist/execution/adapters/codex-config-builder.js +110 -0
  17. package/dist/execution/adapters/codex-config-builder.js.map +1 -0
  18. package/dist/execution/adapters/copilot-adapter.d.ts +94 -0
  19. package/dist/execution/adapters/copilot-adapter.d.ts.map +1 -0
  20. package/dist/execution/adapters/copilot-adapter.js +163 -0
  21. package/dist/execution/adapters/copilot-adapter.js.map +1 -0
  22. package/dist/execution/adapters/copilot-config-builder.d.ts +48 -0
  23. package/dist/execution/adapters/copilot-config-builder.d.ts.map +1 -0
  24. package/dist/execution/adapters/copilot-config-builder.js +125 -0
  25. package/dist/execution/adapters/copilot-config-builder.js.map +1 -0
  26. package/dist/execution/adapters/cursor-adapter.d.ts +66 -0
  27. package/dist/execution/adapters/cursor-adapter.d.ts.map +1 -0
  28. package/dist/execution/adapters/cursor-adapter.js +121 -0
  29. package/dist/execution/adapters/cursor-adapter.js.map +1 -0
  30. package/dist/execution/adapters/cursor-config-builder.d.ts +29 -0
  31. package/dist/execution/adapters/cursor-config-builder.d.ts.map +1 -0
  32. package/dist/execution/adapters/cursor-config-builder.js +49 -0
  33. package/dist/execution/adapters/cursor-config-builder.js.map +1 -0
  34. package/dist/execution/adapters/shared/config-presets.d.ts +102 -0
  35. package/dist/execution/adapters/shared/config-presets.d.ts.map +1 -0
  36. package/dist/execution/adapters/shared/config-presets.js +205 -0
  37. package/dist/execution/adapters/shared/config-presets.js.map +1 -0
  38. package/dist/execution/adapters/shared/config-utils.d.ts +95 -0
  39. package/dist/execution/adapters/shared/config-utils.d.ts.map +1 -0
  40. package/dist/execution/adapters/shared/config-utils.js +163 -0
  41. package/dist/execution/adapters/shared/config-utils.js.map +1 -0
  42. package/dist/execution/adapters/shared/index.d.ts +8 -0
  43. package/dist/execution/adapters/shared/index.d.ts.map +1 -0
  44. package/dist/execution/adapters/shared/index.js +8 -0
  45. package/dist/execution/adapters/shared/index.js.map +1 -0
  46. package/dist/execution/executors/agent-executor-wrapper.d.ts +153 -0
  47. package/dist/execution/executors/agent-executor-wrapper.d.ts.map +1 -0
  48. package/dist/execution/executors/agent-executor-wrapper.js +652 -0
  49. package/dist/execution/executors/agent-executor-wrapper.js.map +1 -0
  50. package/dist/execution/executors/executor-factory.d.ts +95 -0
  51. package/dist/execution/executors/executor-factory.d.ts.map +1 -0
  52. package/dist/execution/executors/executor-factory.js +120 -0
  53. package/dist/execution/executors/executor-factory.js.map +1 -0
  54. package/dist/execution/output/ag-ui-adapter.d.ts +0 -2
  55. package/dist/execution/output/ag-ui-adapter.d.ts.map +1 -1
  56. package/dist/execution/output/ag-ui-adapter.js +0 -2
  57. package/dist/execution/output/ag-ui-adapter.js.map +1 -1
  58. package/dist/execution/output/index.d.ts +0 -3
  59. package/dist/execution/output/index.d.ts.map +1 -1
  60. package/dist/execution/output/index.js +0 -2
  61. package/dist/execution/output/index.js.map +1 -1
  62. package/dist/execution/output/normalized-to-ag-ui-adapter.d.ts +108 -0
  63. package/dist/execution/output/normalized-to-ag-ui-adapter.d.ts.map +1 -0
  64. package/dist/execution/output/normalized-to-ag-ui-adapter.js +321 -0
  65. package/dist/execution/output/normalized-to-ag-ui-adapter.js.map +1 -0
  66. package/dist/execution/process/builders/claude.d.ts +24 -57
  67. package/dist/execution/process/builders/claude.d.ts.map +1 -1
  68. package/dist/execution/process/builders/claude.js +153 -19
  69. package/dist/execution/process/builders/claude.js.map +1 -1
  70. package/dist/execution/transport/ipc-transport-manager.d.ts +74 -0
  71. package/dist/execution/transport/ipc-transport-manager.d.ts.map +1 -0
  72. package/dist/execution/transport/ipc-transport-manager.js +104 -0
  73. package/dist/execution/transport/ipc-transport-manager.js.map +1 -0
  74. package/dist/execution/transport/transport-manager.d.ts.map +1 -1
  75. package/dist/execution/transport/transport-manager.js +3 -0
  76. package/dist/execution/transport/transport-manager.js.map +1 -1
  77. package/dist/execution/worktree/conflict-detector.d.ts +85 -0
  78. package/dist/execution/worktree/conflict-detector.d.ts.map +1 -0
  79. package/dist/execution/worktree/conflict-detector.js +129 -0
  80. package/dist/execution/worktree/conflict-detector.js.map +1 -0
  81. package/dist/execution/worktree/git-cli.d.ts +9 -0
  82. package/dist/execution/worktree/git-cli.d.ts.map +1 -1
  83. package/dist/execution/worktree/git-cli.js +10 -0
  84. package/dist/execution/worktree/git-cli.js.map +1 -1
  85. package/dist/execution/worktree/git-sync-cli.d.ts +187 -0
  86. package/dist/execution/worktree/git-sync-cli.d.ts.map +1 -0
  87. package/dist/execution/worktree/git-sync-cli.js +350 -0
  88. package/dist/execution/worktree/git-sync-cli.js.map +1 -0
  89. package/dist/execution/worktree/manager.d.ts +18 -0
  90. package/dist/execution/worktree/manager.d.ts.map +1 -1
  91. package/dist/execution/worktree/manager.js +9 -3
  92. package/dist/execution/worktree/manager.js.map +1 -1
  93. package/dist/index.d.ts +1 -3
  94. package/dist/index.d.ts.map +1 -1
  95. package/dist/index.js +132 -211
  96. package/dist/index.js.map +1 -1
  97. package/dist/middleware/project-context.d.ts +37 -0
  98. package/dist/middleware/project-context.d.ts.map +1 -0
  99. package/dist/middleware/project-context.js +91 -0
  100. package/dist/middleware/project-context.js.map +1 -0
  101. package/dist/public/assets/index-Bb_W5bUr.css +1 -0
  102. package/dist/public/assets/index-CFKL113G.js +710 -0
  103. package/dist/public/assets/index-CFKL113G.js.map +1 -0
  104. package/dist/public/assets/{react-vendor-ByUx1V_q.js → react-vendor-DiL5hC7l.js} +2 -2
  105. package/dist/public/assets/{react-vendor-ByUx1V_q.js.map → react-vendor-DiL5hC7l.js.map} +1 -1
  106. package/dist/public/assets/ui-vendor-B4WMPEfa.js +54 -0
  107. package/dist/public/assets/ui-vendor-B4WMPEfa.js.map +1 -0
  108. package/dist/public/index.html +4 -4
  109. package/dist/routes/agents.d.ts +3 -0
  110. package/dist/routes/agents.d.ts.map +1 -0
  111. package/dist/routes/agents.js +62 -0
  112. package/dist/routes/agents.js.map +1 -0
  113. package/dist/routes/config.d.ts +3 -0
  114. package/dist/routes/config.d.ts.map +1 -0
  115. package/dist/routes/config.js +25 -0
  116. package/dist/routes/config.js.map +1 -0
  117. package/dist/routes/editors.d.ts +15 -0
  118. package/dist/routes/editors.d.ts.map +1 -0
  119. package/dist/routes/editors.js +98 -0
  120. package/dist/routes/editors.js.map +1 -0
  121. package/dist/routes/executions-stream.d.ts +8 -5
  122. package/dist/routes/executions-stream.d.ts.map +1 -1
  123. package/dist/routes/executions-stream.js +10 -6
  124. package/dist/routes/executions-stream.js.map +1 -1
  125. package/dist/routes/executions.d.ts +6 -10
  126. package/dist/routes/executions.d.ts.map +1 -1
  127. package/dist/routes/executions.js +506 -54
  128. package/dist/routes/executions.js.map +1 -1
  129. package/dist/routes/feedback.d.ts +3 -2
  130. package/dist/routes/feedback.d.ts.map +1 -1
  131. package/dist/routes/feedback.js +12 -10
  132. package/dist/routes/feedback.js.map +1 -1
  133. package/dist/routes/files.d.ts +18 -0
  134. package/dist/routes/files.d.ts.map +1 -0
  135. package/dist/routes/files.js +89 -0
  136. package/dist/routes/files.js.map +1 -0
  137. package/dist/routes/issues.d.ts +3 -2
  138. package/dist/routes/issues.d.ts.map +1 -1
  139. package/dist/routes/issues.js +19 -18
  140. package/dist/routes/issues.js.map +1 -1
  141. package/dist/routes/projects.d.ts +11 -0
  142. package/dist/routes/projects.d.ts.map +1 -0
  143. package/dist/routes/projects.js +447 -0
  144. package/dist/routes/projects.js.map +1 -0
  145. package/dist/routes/relationships.d.ts +3 -2
  146. package/dist/routes/relationships.d.ts.map +1 -1
  147. package/dist/routes/relationships.js +12 -10
  148. package/dist/routes/relationships.js.map +1 -1
  149. package/dist/routes/repo-info.d.ts +3 -0
  150. package/dist/routes/repo-info.d.ts.map +1 -0
  151. package/dist/routes/repo-info.js +126 -0
  152. package/dist/routes/repo-info.js.map +1 -0
  153. package/dist/routes/specs.d.ts +3 -2
  154. package/dist/routes/specs.d.ts.map +1 -1
  155. package/dist/routes/specs.js +19 -18
  156. package/dist/routes/specs.js.map +1 -1
  157. package/dist/services/agent-registry.d.ts +140 -0
  158. package/dist/services/agent-registry.d.ts.map +1 -0
  159. package/dist/services/agent-registry.js +272 -0
  160. package/dist/services/agent-registry.js.map +1 -0
  161. package/dist/services/editor-service.d.ts +57 -0
  162. package/dist/services/editor-service.d.ts.map +1 -0
  163. package/dist/services/editor-service.js +204 -0
  164. package/dist/services/editor-service.js.map +1 -0
  165. package/dist/services/execution-changes-service.d.ts +92 -0
  166. package/dist/services/execution-changes-service.d.ts.map +1 -0
  167. package/dist/services/execution-changes-service.js +546 -0
  168. package/dist/services/execution-changes-service.js.map +1 -0
  169. package/dist/services/execution-lifecycle.d.ts +1 -0
  170. package/dist/services/execution-lifecycle.d.ts.map +1 -1
  171. package/dist/services/execution-lifecycle.js +37 -7
  172. package/dist/services/execution-lifecycle.js.map +1 -1
  173. package/dist/services/execution-logs-store.d.ts +75 -0
  174. package/dist/services/execution-logs-store.d.ts.map +1 -1
  175. package/dist/services/execution-logs-store.js +142 -2
  176. package/dist/services/execution-logs-store.js.map +1 -1
  177. package/dist/services/execution-service.d.ts +50 -58
  178. package/dist/services/execution-service.d.ts.map +1 -1
  179. package/dist/services/execution-service.js +433 -469
  180. package/dist/services/execution-service.js.map +1 -1
  181. package/dist/services/execution-worker-pool.d.ts +116 -0
  182. package/dist/services/execution-worker-pool.d.ts.map +1 -0
  183. package/dist/services/execution-worker-pool.js +326 -0
  184. package/dist/services/execution-worker-pool.js.map +1 -0
  185. package/dist/services/executions.d.ts +3 -0
  186. package/dist/services/executions.d.ts.map +1 -1
  187. package/dist/services/executions.js +11 -17
  188. package/dist/services/executions.js.map +1 -1
  189. package/dist/services/export.d.ts +8 -2
  190. package/dist/services/export.d.ts.map +1 -1
  191. package/dist/services/export.js +29 -23
  192. package/dist/services/export.js.map +1 -1
  193. package/dist/services/file-search/git-ls-files-strategy.d.ts +72 -0
  194. package/dist/services/file-search/git-ls-files-strategy.d.ts.map +1 -0
  195. package/dist/services/file-search/git-ls-files-strategy.js +176 -0
  196. package/dist/services/file-search/git-ls-files-strategy.js.map +1 -0
  197. package/dist/services/file-search/index.d.ts +9 -0
  198. package/dist/services/file-search/index.d.ts.map +1 -0
  199. package/dist/services/file-search/index.js +10 -0
  200. package/dist/services/file-search/index.js.map +1 -0
  201. package/dist/services/file-search/registry.d.ts +97 -0
  202. package/dist/services/file-search/registry.d.ts.map +1 -0
  203. package/dist/services/file-search/registry.js +140 -0
  204. package/dist/services/file-search/registry.js.map +1 -0
  205. package/dist/services/file-search/strategy.d.ts +58 -0
  206. package/dist/services/file-search/strategy.d.ts.map +1 -0
  207. package/dist/services/file-search/strategy.js +8 -0
  208. package/dist/services/file-search/strategy.js.map +1 -0
  209. package/dist/services/project-context.d.ts +69 -0
  210. package/dist/services/project-context.d.ts.map +1 -0
  211. package/dist/services/project-context.js +113 -0
  212. package/dist/services/project-context.js.map +1 -0
  213. package/dist/services/project-manager.d.ts +95 -0
  214. package/dist/services/project-manager.d.ts.map +1 -0
  215. package/dist/services/project-manager.js +388 -0
  216. package/dist/services/project-manager.js.map +1 -0
  217. package/dist/services/project-registry.d.ts +98 -0
  218. package/dist/services/project-registry.d.ts.map +1 -0
  219. package/dist/services/project-registry.js +289 -0
  220. package/dist/services/project-registry.js.map +1 -0
  221. package/dist/services/prompt-resolver.d.ts +97 -0
  222. package/dist/services/prompt-resolver.d.ts.map +1 -0
  223. package/dist/services/prompt-resolver.js +377 -0
  224. package/dist/services/prompt-resolver.js.map +1 -0
  225. package/dist/services/repo-info.d.ts +12 -0
  226. package/dist/services/repo-info.d.ts.map +1 -1
  227. package/dist/services/repo-info.js +46 -0
  228. package/dist/services/repo-info.js.map +1 -1
  229. package/dist/services/watcher.d.ts +3 -4
  230. package/dist/services/watcher.d.ts.map +1 -1
  231. package/dist/services/watcher.js +18 -35
  232. package/dist/services/watcher.js.map +1 -1
  233. package/dist/services/websocket.d.ts +30 -16
  234. package/dist/services/websocket.d.ts.map +1 -1
  235. package/dist/services/websocket.js +102 -37
  236. package/dist/services/websocket.js.map +1 -1
  237. package/dist/services/worktree-sync-service.d.ts +228 -0
  238. package/dist/services/worktree-sync-service.d.ts.map +1 -0
  239. package/dist/services/worktree-sync-service.js +563 -0
  240. package/dist/services/worktree-sync-service.js.map +1 -0
  241. package/dist/types/editor.d.ts +49 -0
  242. package/dist/types/editor.d.ts.map +1 -0
  243. package/dist/types/editor.js +50 -0
  244. package/dist/types/editor.js.map +1 -0
  245. package/dist/types/project.d.ts +58 -0
  246. package/dist/types/project.d.ts.map +1 -0
  247. package/dist/types/project.js +10 -0
  248. package/dist/types/project.js.map +1 -0
  249. package/dist/utils/executable-check.d.ts +36 -0
  250. package/dist/utils/executable-check.d.ts.map +1 -0
  251. package/dist/utils/executable-check.js +79 -0
  252. package/dist/utils/executable-check.js.map +1 -0
  253. package/dist/workers/execution-worker.d.ts +18 -0
  254. package/dist/workers/execution-worker.d.ts.map +1 -0
  255. package/dist/workers/execution-worker.js +340 -0
  256. package/dist/workers/execution-worker.js.map +1 -0
  257. package/dist/workers/worker-ipc.d.ts +84 -0
  258. package/dist/workers/worker-ipc.d.ts.map +1 -0
  259. package/dist/workers/worker-ipc.js +29 -0
  260. package/dist/workers/worker-ipc.js.map +1 -0
  261. package/package.json +6 -5
  262. package/dist/execution/output/ag-ui-integration.d.ts +0 -96
  263. package/dist/execution/output/ag-ui-integration.d.ts.map +0 -1
  264. package/dist/execution/output/ag-ui-integration.js +0 -96
  265. package/dist/execution/output/ag-ui-integration.js.map +0 -1
  266. package/dist/execution/output/claude-code-output-processor.d.ts +0 -321
  267. package/dist/execution/output/claude-code-output-processor.d.ts.map +0 -1
  268. package/dist/execution/output/claude-code-output-processor.js +0 -769
  269. package/dist/execution/output/claude-code-output-processor.js.map +0 -1
  270. package/dist/public/assets/index-B3SEMufD.js +0 -580
  271. package/dist/public/assets/index-B3SEMufD.js.map +0 -1
  272. package/dist/public/assets/index-D2YGL3gX.css +0 -1
  273. package/dist/public/assets/ui-vendor-CotR6bx9.js +0 -54
  274. package/dist/public/assets/ui-vendor-CotR6bx9.js.map +0 -1
@@ -0,0 +1,563 @@
1
+ /**
2
+ * Worktree Sync Service
3
+ *
4
+ * Orchestrates worktree sync operations including conflict detection,
5
+ * JSONL resolution, git operations, and database updates.
6
+ *
7
+ * @module services/worktree-sync-service
8
+ */
9
+ import * as fs from "fs";
10
+ import * as path from "path";
11
+ import { execSync } from "child_process";
12
+ import { GitSyncCli } from "../execution/worktree/git-sync-cli.js";
13
+ import { ConflictDetector } from "../execution/worktree/conflict-detector.js";
14
+ import { mergeThreeWay } from "@sudocode-ai/cli/dist/merge-resolver.js";
15
+ import { writeJSONL } from "@sudocode-ai/cli/dist/jsonl.js";
16
+ /**
17
+ * Worktree sync error codes
18
+ */
19
+ export var WorktreeSyncErrorCode;
20
+ (function (WorktreeSyncErrorCode) {
21
+ WorktreeSyncErrorCode["NO_WORKTREE"] = "NO_WORKTREE";
22
+ WorktreeSyncErrorCode["WORKTREE_MISSING"] = "WORKTREE_MISSING";
23
+ WorktreeSyncErrorCode["BRANCH_MISSING"] = "BRANCH_MISSING";
24
+ WorktreeSyncErrorCode["DIRTY_WORKING_TREE"] = "DIRTY_WORKING_TREE";
25
+ WorktreeSyncErrorCode["TARGET_BRANCH_MISSING"] = "TARGET_BRANCH_MISSING";
26
+ WorktreeSyncErrorCode["NO_COMMON_BASE"] = "NO_COMMON_BASE";
27
+ WorktreeSyncErrorCode["CODE_CONFLICTS"] = "CODE_CONFLICTS";
28
+ WorktreeSyncErrorCode["MERGE_FAILED"] = "MERGE_FAILED";
29
+ WorktreeSyncErrorCode["JSONL_RESOLUTION_FAILED"] = "JSONL_RESOLUTION_FAILED";
30
+ WorktreeSyncErrorCode["DATABASE_SYNC_FAILED"] = "DATABASE_SYNC_FAILED";
31
+ WorktreeSyncErrorCode["EXECUTION_NOT_FOUND"] = "EXECUTION_NOT_FOUND";
32
+ })(WorktreeSyncErrorCode || (WorktreeSyncErrorCode = {}));
33
+ /**
34
+ * Worktree sync error class
35
+ */
36
+ export class WorktreeSyncError extends Error {
37
+ code;
38
+ cause;
39
+ constructor(message, code, cause) {
40
+ super(message);
41
+ this.code = code;
42
+ this.cause = cause;
43
+ this.name = "WorktreeSyncError";
44
+ }
45
+ }
46
+ /**
47
+ * WorktreeSyncService
48
+ *
49
+ * Main service class for orchestrating worktree sync operations
50
+ */
51
+ export class WorktreeSyncService {
52
+ db;
53
+ repoPath;
54
+ gitSync;
55
+ conflictDetector;
56
+ constructor(db, repoPath) {
57
+ this.db = db;
58
+ this.repoPath = repoPath;
59
+ this.gitSync = new GitSyncCli(repoPath);
60
+ this.conflictDetector = new ConflictDetector(repoPath);
61
+ }
62
+ /**
63
+ * Preview sync without making changes
64
+ *
65
+ * @param executionId - Execution ID to preview sync for
66
+ * @returns Preview result with conflicts, diff, and warnings
67
+ */
68
+ async previewSync(executionId) {
69
+ // 1. Load execution and validate
70
+ const execution = await this._loadAndValidateExecution(executionId);
71
+ // 2. Validate preconditions
72
+ try {
73
+ await this._validateSyncPreconditions(execution);
74
+ }
75
+ catch (error) {
76
+ // Return preview with error details
77
+ return {
78
+ canSync: false,
79
+ conflicts: {
80
+ hasConflicts: false,
81
+ codeConflicts: [],
82
+ jsonlConflicts: [],
83
+ totalFiles: 0,
84
+ summary: "",
85
+ },
86
+ diff: { files: [], additions: 0, deletions: 0 },
87
+ commits: [],
88
+ mergeBase: "",
89
+ uncommittedJSONLChanges: [],
90
+ executionStatus: execution.status,
91
+ warnings: [error.message],
92
+ };
93
+ }
94
+ // 3. Find merge base
95
+ const mergeBase = this.gitSync.getMergeBase(execution.branch_name, execution.target_branch);
96
+ // 4. Get commit list
97
+ const commits = this.gitSync.getCommitList(mergeBase, execution.branch_name);
98
+ // 5. Get diff summary
99
+ const diff = this.gitSync.getDiff(mergeBase, execution.branch_name);
100
+ // 6. Detect conflicts
101
+ const conflicts = this.conflictDetector.detectConflicts(execution.branch_name, execution.target_branch);
102
+ // 7. Check for uncommitted JSONL changes
103
+ const uncommittedJSONL = this._getUncommittedJSONLFiles(execution.worktree_path);
104
+ // 8. Generate warnings
105
+ const warnings = [];
106
+ // Warn if execution is running/paused
107
+ if (execution.status === "running" ||
108
+ execution.status === "paused") {
109
+ warnings.push("Execution is currently active. Synced state may not reflect final execution result.");
110
+ }
111
+ // Warn about code conflicts
112
+ if (conflicts.codeConflicts.length > 0) {
113
+ warnings.push(`${conflicts.codeConflicts.length} code conflict(s) detected. Manual resolution required.`);
114
+ }
115
+ // Warn about uncommitted JSONL
116
+ if (uncommittedJSONL.length > 0) {
117
+ warnings.push(`${uncommittedJSONL.length} uncommitted JSONL file(s) will be included in sync.`);
118
+ }
119
+ // 9. Determine if sync can proceed
120
+ const canSync = conflicts.codeConflicts.length === 0;
121
+ return {
122
+ canSync,
123
+ conflicts,
124
+ diff,
125
+ commits,
126
+ mergeBase,
127
+ uncommittedJSONLChanges: uncommittedJSONL,
128
+ executionStatus: execution.status,
129
+ warnings,
130
+ };
131
+ }
132
+ /**
133
+ * Load execution from database and validate it exists
134
+ *
135
+ * Used by previewSync() and will be used in i-9gz4 (squash sync)
136
+ *
137
+ * @param executionId - Execution ID to load
138
+ * @returns Execution record
139
+ * @throws WorktreeSyncError if execution not found
140
+ */
141
+ async _loadAndValidateExecution(executionId) {
142
+ const stmt = this.db.prepare("SELECT * FROM executions WHERE id = ?");
143
+ const execution = stmt.get(executionId);
144
+ if (!execution) {
145
+ throw new WorktreeSyncError(`Execution ${executionId} not found`, WorktreeSyncErrorCode.EXECUTION_NOT_FOUND);
146
+ }
147
+ return execution;
148
+ }
149
+ /**
150
+ * Validate preconditions for sync
151
+ *
152
+ * Used by previewSync() and will be used in i-9gz4 (squash sync)
153
+ *
154
+ * Checks:
155
+ * - Worktree exists
156
+ * - Worktree branch exists
157
+ * - Local working tree is clean
158
+ * - Target branch exists
159
+ * - Branches have common base
160
+ *
161
+ * @param execution - Execution to validate
162
+ * @throws WorktreeSyncError if any precondition fails
163
+ */
164
+ async _validateSyncPreconditions(execution) {
165
+ // 1. Check worktree path exists
166
+ if (!execution.worktree_path) {
167
+ throw new WorktreeSyncError("No worktree path for execution", WorktreeSyncErrorCode.NO_WORKTREE);
168
+ }
169
+ // 2. Check worktree still exists on filesystem
170
+ if (!fs.existsSync(execution.worktree_path)) {
171
+ throw new WorktreeSyncError("Worktree no longer exists", WorktreeSyncErrorCode.WORKTREE_MISSING);
172
+ }
173
+ // 3. Get list of branches
174
+ const branches = this._getBranches();
175
+ // 4. Check worktree branch exists
176
+ if (!branches.includes(execution.branch_name)) {
177
+ throw new WorktreeSyncError(`Worktree branch '${execution.branch_name}' not found`, WorktreeSyncErrorCode.BRANCH_MISSING);
178
+ }
179
+ // 5. Check target branch exists
180
+ if (!branches.includes(execution.target_branch)) {
181
+ throw new WorktreeSyncError(`Target branch '${execution.target_branch}' not found`, WorktreeSyncErrorCode.TARGET_BRANCH_MISSING);
182
+ }
183
+ // 6. Check local working tree is clean
184
+ if (!this.gitSync.isWorkingTreeClean()) {
185
+ throw new WorktreeSyncError("Local working tree has uncommitted changes. Stash or commit them first.", WorktreeSyncErrorCode.DIRTY_WORKING_TREE);
186
+ }
187
+ // 7. Verify branches have common base
188
+ try {
189
+ this.gitSync.getMergeBase(execution.branch_name, execution.target_branch);
190
+ }
191
+ catch (error) {
192
+ throw new WorktreeSyncError("Worktree and target branch have diverged without common history", WorktreeSyncErrorCode.NO_COMMON_BASE, error);
193
+ }
194
+ }
195
+ /**
196
+ * Create safety snapshot before sync
197
+ *
198
+ * Creates a git tag pointing to current target branch HEAD
199
+ * for rollback capability
200
+ *
201
+ * @param executionId - Execution ID
202
+ * @param targetBranch - Target branch name
203
+ * @returns Tag name created
204
+ */
205
+ async _createSafetySnapshot(executionId, targetBranch) {
206
+ const tagName = `sudocode-sync-before-${executionId}`;
207
+ // Get current commit of target branch
208
+ const currentCommit = this._getCurrentCommit(targetBranch);
209
+ // Create annotated tag
210
+ this.gitSync.createSafetyTag(tagName, currentCommit);
211
+ return tagName;
212
+ }
213
+ /**
214
+ * Get uncommitted JSONL files from worktree
215
+ *
216
+ * Used by previewSync() and will be used in i-3wmx (JSONL conflict resolution)
217
+ *
218
+ * @param worktreePath - Path to worktree
219
+ * @returns Array of uncommitted JSONL file paths
220
+ */
221
+ _getUncommittedJSONLFiles(worktreePath) {
222
+ const gitSyncWorktree = new GitSyncCli(worktreePath);
223
+ // Get all uncommitted files
224
+ const uncommitted = gitSyncWorktree.getUncommittedFiles();
225
+ // Filter for JSONL files in .sudocode/
226
+ return uncommitted.filter((file) => file.endsWith(".jsonl") &&
227
+ (file.includes(".sudocode/") || file.startsWith(".sudocode/")));
228
+ }
229
+ /**
230
+ * Check if local working tree is clean
231
+ *
232
+ * TODO: Will be used in i-7ya6 (sync preview)
233
+ *
234
+ * @returns true if clean, false if dirty
235
+ */
236
+ // @ts-expect-error - Foundation method, will be used in i-7ya6
237
+ _isLocalTreeClean() {
238
+ return this.gitSync.isWorkingTreeClean();
239
+ }
240
+ /**
241
+ * Get list of branches in repository
242
+ *
243
+ * @returns Array of branch names
244
+ */
245
+ _getBranches() {
246
+ try {
247
+ const output = execSync("git branch --format='%(refname:short)'", {
248
+ cwd: this.repoPath,
249
+ encoding: "utf8",
250
+ stdio: "pipe",
251
+ shell: "/bin/bash",
252
+ });
253
+ return output
254
+ .split("\n")
255
+ .map((line) => line.trim())
256
+ .filter((line) => line.length > 0);
257
+ }
258
+ catch (error) {
259
+ throw new WorktreeSyncError(`Failed to get branch list: ${error.message}`, WorktreeSyncErrorCode.BRANCH_MISSING, error);
260
+ }
261
+ }
262
+ /**
263
+ * Get current commit SHA for a branch
264
+ *
265
+ * @param branchName - Branch name
266
+ * @returns Commit SHA
267
+ */
268
+ _getCurrentCommit(branchName) {
269
+ try {
270
+ const output = execSync(`git rev-parse ${this._escapeShellArg(branchName)}`, {
271
+ cwd: this.repoPath,
272
+ encoding: "utf8",
273
+ stdio: "pipe",
274
+ });
275
+ return output.trim();
276
+ }
277
+ catch (error) {
278
+ throw new WorktreeSyncError(`Failed to get commit for branch ${branchName}: ${error.message}`, WorktreeSyncErrorCode.BRANCH_MISSING, error);
279
+ }
280
+ }
281
+ /**
282
+ * Escape shell argument for safe command execution
283
+ *
284
+ * @param arg - Argument to escape
285
+ * @returns Escaped argument
286
+ */
287
+ _escapeShellArg(arg) {
288
+ // Escape single quotes and wrap in single quotes
289
+ return `'${arg.replace(/'/g, "'\\''")}'`;
290
+ }
291
+ /**
292
+ * Resolve JSONL conflicts using three-way merge
293
+ *
294
+ * Used in squash sync to auto-resolve JSONL conflicts
295
+ *
296
+ * @param execution - Execution record
297
+ * @param jsonlConflicts - List of JSONL conflicts to resolve
298
+ * @throws WorktreeSyncError if resolution fails
299
+ */
300
+ async resolveJSONLConflicts(execution, jsonlConflicts) {
301
+ if (jsonlConflicts.length === 0) {
302
+ return;
303
+ }
304
+ const mergeBase = this.gitSync.getMergeBase(execution.branch_name, execution.target_branch);
305
+ for (const conflict of jsonlConflicts) {
306
+ try {
307
+ // Read three versions of the file
308
+ const baseVersion = await this._readJSONLVersion(conflict.filePath, mergeBase);
309
+ const ourVersion = await this._readJSONLVersion(conflict.filePath, execution.target_branch);
310
+ const theirVersion = await this._readJSONLVersion(conflict.filePath, execution.branch_name);
311
+ // Perform three-way merge
312
+ const { entities: merged } = mergeThreeWay(baseVersion, ourVersion, theirVersion);
313
+ // Write resolved version to local repo
314
+ const resolvedPath = path.join(this.repoPath, conflict.filePath);
315
+ await writeJSONL(resolvedPath, merged);
316
+ // Stage the resolved file
317
+ execSync(`git add ${this._escapeShellArg(conflict.filePath)}`, {
318
+ cwd: this.repoPath,
319
+ stdio: "pipe",
320
+ });
321
+ }
322
+ catch (error) {
323
+ throw new WorktreeSyncError(`Failed to resolve JSONL conflict in ${conflict.filePath}: ${error.message}`, WorktreeSyncErrorCode.JSONL_RESOLUTION_FAILED, error);
324
+ }
325
+ }
326
+ }
327
+ /**
328
+ * Read JSONL file at a specific git revision
329
+ *
330
+ * @param filePath - Relative path to JSONL file
331
+ * @param revision - Git revision (commit SHA or branch name)
332
+ * @returns Array of JSONL entities
333
+ */
334
+ async _readJSONLVersion(filePath, revision) {
335
+ try {
336
+ // Get file content at revision using git show
337
+ const content = execSync(`git show ${this._escapeShellArg(revision)}:${this._escapeShellArg(filePath)}`, {
338
+ cwd: this.repoPath,
339
+ encoding: "utf8",
340
+ stdio: "pipe",
341
+ });
342
+ // Parse JSONL content
343
+ const lines = content.split("\n").filter((line) => line.trim().length > 0);
344
+ return lines.map((line) => JSON.parse(line));
345
+ }
346
+ catch (error) {
347
+ // File might not exist at this revision (new file)
348
+ if (error.status === 128) {
349
+ return [];
350
+ }
351
+ throw error;
352
+ }
353
+ }
354
+ /**
355
+ * Commit uncommitted JSONL files in worktree
356
+ *
357
+ * Used during sync to include uncommitted JSONL changes
358
+ *
359
+ * @param worktreePath - Path to worktree
360
+ * @param uncommittedFiles - List of uncommitted JSONL file paths
361
+ * @throws WorktreeSyncError if commit fails
362
+ */
363
+ async commitUncommittedJSONL(worktreePath, uncommittedFiles) {
364
+ if (uncommittedFiles.length === 0) {
365
+ return;
366
+ }
367
+ try {
368
+ // Stage all uncommitted JSONL files
369
+ for (const file of uncommittedFiles) {
370
+ execSync(`git add ${this._escapeShellArg(file)}`, {
371
+ cwd: worktreePath,
372
+ stdio: "pipe",
373
+ });
374
+ }
375
+ // Create commit with descriptive message
376
+ const fileList = uncommittedFiles.join(", ");
377
+ const message = `Auto-commit uncommitted JSONL changes before sync\n\nFiles: ${fileList}`;
378
+ execSync(`git commit -m ${this._escapeShellArg(message)}`, {
379
+ cwd: worktreePath,
380
+ stdio: "pipe",
381
+ });
382
+ }
383
+ catch (error) {
384
+ throw new WorktreeSyncError(`Failed to commit uncommitted JSONL files: ${error.message}`, WorktreeSyncErrorCode.DATABASE_SYNC_FAILED, error);
385
+ }
386
+ }
387
+ /**
388
+ * Perform git merge --squash operation
389
+ *
390
+ * @param sourceBranch - Branch to merge from (worktree branch)
391
+ * @param targetBranch - Branch to merge into
392
+ * @returns Object with filesChanged count
393
+ * @throws WorktreeSyncError if merge fails
394
+ */
395
+ _performSquashMerge(sourceBranch, targetBranch) {
396
+ try {
397
+ // Checkout target branch
398
+ execSync(`git checkout ${this._escapeShellArg(targetBranch)}`, {
399
+ cwd: this.repoPath,
400
+ stdio: "pipe",
401
+ });
402
+ // Perform squash merge
403
+ execSync(`git merge --squash ${this._escapeShellArg(sourceBranch)}`, {
404
+ cwd: this.repoPath,
405
+ stdio: "pipe",
406
+ });
407
+ // Count staged files
408
+ const statusOutput = execSync("git diff --cached --name-only", {
409
+ cwd: this.repoPath,
410
+ encoding: "utf8",
411
+ stdio: "pipe",
412
+ });
413
+ const filesChanged = statusOutput
414
+ .split("\n")
415
+ .filter((line) => line.trim().length > 0).length;
416
+ return { filesChanged };
417
+ }
418
+ catch (error) {
419
+ throw new WorktreeSyncError(`Failed to perform squash merge: ${error.message}`, WorktreeSyncErrorCode.MERGE_FAILED, error);
420
+ }
421
+ }
422
+ /**
423
+ * Generate commit message for squash sync
424
+ *
425
+ * @param execution - Execution record
426
+ * @param commitCount - Number of commits being squashed
427
+ * @returns Generated commit message
428
+ */
429
+ _generateCommitMessage(execution, commitCount) {
430
+ const issueId = execution.issue_id || "unknown";
431
+ const branchName = execution.branch_name;
432
+ return `Squash merge from ${branchName} (${commitCount} commit${commitCount !== 1 ? "s" : ""})
433
+
434
+ Issue: ${issueId}
435
+ Execution: ${execution.id}
436
+
437
+ Synced changes from worktree execution.`;
438
+ }
439
+ /**
440
+ * Create commit with staged changes
441
+ *
442
+ * @param message - Commit message
443
+ * @returns Commit SHA
444
+ * @throws WorktreeSyncError if commit fails
445
+ */
446
+ _createCommit(message) {
447
+ try {
448
+ execSync(`git commit -m ${this._escapeShellArg(message)}`, {
449
+ cwd: this.repoPath,
450
+ stdio: "pipe",
451
+ });
452
+ // Get the commit SHA
453
+ const sha = execSync("git rev-parse HEAD", {
454
+ cwd: this.repoPath,
455
+ encoding: "utf8",
456
+ stdio: "pipe",
457
+ }).trim();
458
+ return sha;
459
+ }
460
+ catch (error) {
461
+ throw new WorktreeSyncError(`Failed to create commit: ${error.message}`, WorktreeSyncErrorCode.MERGE_FAILED, error);
462
+ }
463
+ }
464
+ /**
465
+ * Rollback to safety snapshot
466
+ *
467
+ * @param targetBranch - Target branch to reset
468
+ * @param tagName - Safety tag to rollback to
469
+ * @throws WorktreeSyncError if rollback fails
470
+ */
471
+ async _rollbackToSnapshot(targetBranch, tagName) {
472
+ try {
473
+ // Checkout target branch
474
+ execSync(`git checkout ${this._escapeShellArg(targetBranch)}`, {
475
+ cwd: this.repoPath,
476
+ stdio: "pipe",
477
+ });
478
+ // Reset to tag
479
+ execSync(`git reset --hard ${this._escapeShellArg(tagName)}`, {
480
+ cwd: this.repoPath,
481
+ stdio: "pipe",
482
+ });
483
+ console.log(`Rolled back ${targetBranch} to ${tagName}`);
484
+ }
485
+ catch (error) {
486
+ throw new WorktreeSyncError(`Failed to rollback to snapshot ${tagName}: ${error.message}`, WorktreeSyncErrorCode.MERGE_FAILED, error);
487
+ }
488
+ }
489
+ /**
490
+ * Perform squash sync operation
491
+ *
492
+ * Squashes all worktree commits into a single commit on the target branch.
493
+ * Auto-resolves JSONL conflicts but blocks on code conflicts.
494
+ *
495
+ * @param executionId - Execution ID to sync
496
+ * @param customCommitMessage - Optional custom commit message
497
+ * @returns Sync result with details
498
+ * @throws WorktreeSyncError if sync fails
499
+ */
500
+ async squashSync(executionId, customCommitMessage) {
501
+ // 1. Load and validate execution
502
+ const execution = await this._loadAndValidateExecution(executionId);
503
+ // 2. Validate preconditions
504
+ await this._validateSyncPreconditions(execution);
505
+ // 3. Preview sync to check for conflicts
506
+ const preview = await this.previewSync(executionId);
507
+ // 4. Block if code conflicts exist
508
+ if (preview.conflicts.codeConflicts.length > 0) {
509
+ return {
510
+ success: false,
511
+ filesChanged: 0,
512
+ conflictsResolved: 0,
513
+ uncommittedJSONLIncluded: false,
514
+ error: `Cannot sync: ${preview.conflicts.codeConflicts.length} code conflict(s) detected. Please resolve manually.`,
515
+ };
516
+ }
517
+ let safetyTag;
518
+ try {
519
+ // 5. Handle uncommitted JSONL files
520
+ const uncommittedJSONL = preview.uncommittedJSONLChanges;
521
+ if (uncommittedJSONL.length > 0) {
522
+ await this.commitUncommittedJSONL(execution.worktree_path, uncommittedJSONL);
523
+ }
524
+ // 6. Create safety snapshot
525
+ safetyTag = await this._createSafetySnapshot(executionId, execution.target_branch);
526
+ // 7. Perform git merge --squash
527
+ const mergeResult = this._performSquashMerge(execution.branch_name, execution.target_branch);
528
+ // 8. Resolve JSONL conflicts
529
+ let conflictsResolved = 0;
530
+ if (preview.conflicts.jsonlConflicts.length > 0) {
531
+ await this.resolveJSONLConflicts(execution, preview.conflicts.jsonlConflicts);
532
+ conflictsResolved = preview.conflicts.jsonlConflicts.length;
533
+ }
534
+ // 9. Generate commit message
535
+ const commitMessage = customCommitMessage ||
536
+ this._generateCommitMessage(execution, preview.commits.length);
537
+ // 10. Create commit
538
+ const finalCommit = this._createCommit(commitMessage);
539
+ // 11. Return success result
540
+ return {
541
+ success: true,
542
+ finalCommit,
543
+ filesChanged: mergeResult.filesChanged,
544
+ conflictsResolved,
545
+ uncommittedJSONLIncluded: uncommittedJSONL.length > 0,
546
+ cleanupOffered: true,
547
+ };
548
+ }
549
+ catch (error) {
550
+ // Rollback to safety snapshot on failure
551
+ if (safetyTag) {
552
+ try {
553
+ await this._rollbackToSnapshot(execution.target_branch, safetyTag);
554
+ }
555
+ catch (rollbackError) {
556
+ console.error(`Failed to rollback to snapshot ${safetyTag}:`, rollbackError);
557
+ }
558
+ }
559
+ throw new WorktreeSyncError(`Squash sync failed: ${error.message}`, WorktreeSyncErrorCode.MERGE_FAILED, error);
560
+ }
561
+ }
562
+ }
563
+ //# sourceMappingURL=worktree-sync-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktree-sync-service.js","sourceRoot":"","sources":["../../src/services/worktree-sync-service.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,UAAU,EAAgC,MAAM,uCAAuC,CAAC;AACjG,OAAO,EAAE,gBAAgB,EAA2C,MAAM,4CAA4C,CAAC;AACvH,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D;;GAEG;AACH,MAAM,CAAN,IAAY,qBAYX;AAZD,WAAY,qBAAqB;IAC/B,oDAA2B,CAAA;IAC3B,8DAAqC,CAAA;IACrC,0DAAiC,CAAA;IACjC,kEAAyC,CAAA;IACzC,wEAA+C,CAAA;IAC/C,0DAAiC,CAAA;IACjC,0DAAiC,CAAA;IACjC,sDAA6B,CAAA;IAC7B,4EAAmD,CAAA;IACnD,sEAA6C,CAAA;IAC7C,oEAA2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or types and configuration for IDE opening functionality
3
+ */
4
+ /**
5
+ * Supported editor types for opening worktrees
6
+ */
7
+ export declare enum EditorType {
8
+ VS_CODE = "vs-code",
9
+ CURSOR = "cursor",
10
+ WINDSURF = "windsurf",
11
+ INTELLIJ = "intellij",
12
+ ZED = "zed",
13
+ XCODE = "xcode",
14
+ CUSTOM = "custom"
15
+ }
16
+ /**
17
+ * Editor configuration interface
18
+ * Loaded from .sudocode/config.local.json
19
+ */
20
+ export interface EditorConfig {
21
+ editorType: EditorType;
22
+ customCommand?: string;
23
+ }
24
+ /**
25
+ * Error codes for editor opening failures
26
+ */
27
+ export type EditorErrorCode = "EDITOR_NOT_FOUND" | "WORKTREE_MISSING" | "SPAWN_FAILED";
28
+ /**
29
+ * Custom error class for editor opening failures
30
+ * Provides structured error information for API responses
31
+ */
32
+ export declare class EditorOpenError extends Error {
33
+ code: EditorErrorCode;
34
+ editorType: EditorType;
35
+ details?: string | undefined;
36
+ constructor(code: EditorErrorCode, editorType: EditorType, message: string, details?: string | undefined);
37
+ /**
38
+ * Convert error to JSON for API responses
39
+ */
40
+ toJSON(): {
41
+ error: {
42
+ code: EditorErrorCode;
43
+ message: string;
44
+ details: string | undefined;
45
+ editorType: EditorType;
46
+ };
47
+ };
48
+ }
49
+ //# sourceMappingURL=editor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../src/types/editor.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,oBAAY,UAAU;IACpB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,UAAU,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GACvB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,CAAC;AAEnB;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IAE/B,IAAI,EAAE,eAAe;IACrB,UAAU,EAAE,UAAU;IAEtB,OAAO,CAAC,EAAE,MAAM;gBAHhB,IAAI,EAAE,eAAe,EACrB,UAAU,EAAE,UAAU,EAC7B,OAAO,EAAE,MAAM,EACR,OAAO,CAAC,EAAE,MAAM,YAAA;IAWzB;;OAEG;IACH,MAAM;;;;;;;;CAUP"}