@paysdoc/devplatform 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +122 -0
  3. package/dist/git/bootstrapIdentity.d.ts +50 -0
  4. package/dist/git/bootstrapIdentity.d.ts.map +1 -0
  5. package/dist/git/bootstrapIdentity.js +72 -0
  6. package/dist/git/bootstrapIdentity.js.map +1 -0
  7. package/dist/git/branchOps.d.ts +27 -0
  8. package/dist/git/branchOps.d.ts.map +1 -0
  9. package/dist/git/branchOps.js +91 -0
  10. package/dist/git/branchOps.js.map +1 -0
  11. package/dist/git/claimOps.d.ts +40 -0
  12. package/dist/git/claimOps.d.ts.map +1 -0
  13. package/dist/git/claimOps.js +44 -0
  14. package/dist/git/claimOps.js.map +1 -0
  15. package/dist/git/commitOps.d.ts +35 -0
  16. package/dist/git/commitOps.d.ts.map +1 -0
  17. package/dist/git/commitOps.js +131 -0
  18. package/dist/git/commitOps.js.map +1 -0
  19. package/dist/git/consoleLogger.d.ts +8 -0
  20. package/dist/git/consoleLogger.d.ts.map +1 -0
  21. package/dist/git/consoleLogger.js +9 -0
  22. package/dist/git/consoleLogger.js.map +1 -0
  23. package/dist/git/gitContext.d.ts +150 -0
  24. package/dist/git/gitContext.d.ts.map +1 -0
  25. package/dist/git/gitContext.js +405 -0
  26. package/dist/git/gitContext.js.map +1 -0
  27. package/dist/git/gitReadOps.d.ts +33 -0
  28. package/dist/git/gitReadOps.d.ts.map +1 -0
  29. package/dist/git/gitReadOps.js +38 -0
  30. package/dist/git/gitReadOps.js.map +1 -0
  31. package/dist/git/index.d.ts +49 -0
  32. package/dist/git/index.d.ts.map +1 -0
  33. package/dist/git/index.js +44 -0
  34. package/dist/git/index.js.map +1 -0
  35. package/dist/git/processCleanup.d.ts +7 -0
  36. package/dist/git/processCleanup.d.ts.map +1 -0
  37. package/dist/git/processCleanup.js +45 -0
  38. package/dist/git/processCleanup.js.map +1 -0
  39. package/dist/git/remoteOps.d.ts +25 -0
  40. package/dist/git/remoteOps.d.ts.map +1 -0
  41. package/dist/git/remoteOps.js +30 -0
  42. package/dist/git/remoteOps.js.map +1 -0
  43. package/dist/git/repoWorkspace.d.ts +72 -0
  44. package/dist/git/repoWorkspace.d.ts.map +1 -0
  45. package/dist/git/repoWorkspace.js +85 -0
  46. package/dist/git/repoWorkspace.js.map +1 -0
  47. package/dist/git/types.d.ts +182 -0
  48. package/dist/git/types.d.ts.map +1 -0
  49. package/dist/git/types.js +10 -0
  50. package/dist/git/types.js.map +1 -0
  51. package/dist/git/workingDirectoryGuard.d.ts +39 -0
  52. package/dist/git/workingDirectoryGuard.d.ts.map +1 -0
  53. package/dist/git/workingDirectoryGuard.js +53 -0
  54. package/dist/git/workingDirectoryGuard.js.map +1 -0
  55. package/dist/git/worktreeCreateOps.d.ts +45 -0
  56. package/dist/git/worktreeCreateOps.d.ts.map +1 -0
  57. package/dist/git/worktreeCreateOps.js +208 -0
  58. package/dist/git/worktreeCreateOps.js.map +1 -0
  59. package/dist/git/worktreeProbeOps.d.ts +17 -0
  60. package/dist/git/worktreeProbeOps.d.ts.map +1 -0
  61. package/dist/git/worktreeProbeOps.js +66 -0
  62. package/dist/git/worktreeProbeOps.js.map +1 -0
  63. package/dist/git/worktreeQueryOps.d.ts +45 -0
  64. package/dist/git/worktreeQueryOps.d.ts.map +1 -0
  65. package/dist/git/worktreeQueryOps.js +129 -0
  66. package/dist/git/worktreeQueryOps.js.map +1 -0
  67. package/dist/git/worktreeRemoveOps.d.ts +27 -0
  68. package/dist/git/worktreeRemoveOps.d.ts.map +1 -0
  69. package/dist/git/worktreeRemoveOps.js +132 -0
  70. package/dist/git/worktreeRemoveOps.js.map +1 -0
  71. package/dist/git/worktreeResetOps.d.ts +18 -0
  72. package/dist/git/worktreeResetOps.d.ts.map +1 -0
  73. package/dist/git/worktreeResetOps.js +68 -0
  74. package/dist/git/worktreeResetOps.js.map +1 -0
  75. package/dist/index.d.ts +13 -0
  76. package/dist/index.d.ts.map +1 -0
  77. package/dist/index.js +13 -0
  78. package/dist/index.js.map +1 -0
  79. package/dist/providers/forgeProviders.d.ts +72 -0
  80. package/dist/providers/forgeProviders.d.ts.map +1 -0
  81. package/dist/providers/forgeProviders.js +112 -0
  82. package/dist/providers/forgeProviders.js.map +1 -0
  83. package/dist/providers/github/appAuth.d.ts +70 -0
  84. package/dist/providers/github/appAuth.d.ts.map +1 -0
  85. package/dist/providers/github/appAuth.js +243 -0
  86. package/dist/providers/github/appAuth.js.map +1 -0
  87. package/dist/providers/github/cloneUrl.d.ts +12 -0
  88. package/dist/providers/github/cloneUrl.d.ts.map +1 -0
  89. package/dist/providers/github/cloneUrl.js +20 -0
  90. package/dist/providers/github/cloneUrl.js.map +1 -0
  91. package/dist/providers/github/commands/boardCommands.d.ts +22 -0
  92. package/dist/providers/github/commands/boardCommands.d.ts.map +1 -0
  93. package/dist/providers/github/commands/boardCommands.js +66 -0
  94. package/dist/providers/github/commands/boardCommands.js.map +1 -0
  95. package/dist/providers/github/commands/issueCommands.d.ts +21 -0
  96. package/dist/providers/github/commands/issueCommands.d.ts.map +1 -0
  97. package/dist/providers/github/commands/issueCommands.js +50 -0
  98. package/dist/providers/github/commands/issueCommands.js.map +1 -0
  99. package/dist/providers/github/commands/labelCommands.d.ts +3 -0
  100. package/dist/providers/github/commands/labelCommands.d.ts.map +1 -0
  101. package/dist/providers/github/commands/labelCommands.js +8 -0
  102. package/dist/providers/github/commands/labelCommands.js.map +1 -0
  103. package/dist/providers/github/commands/prCommands.d.ts +14 -0
  104. package/dist/providers/github/commands/prCommands.d.ts.map +1 -0
  105. package/dist/providers/github/commands/prCommands.js +46 -0
  106. package/dist/providers/github/commands/prCommands.js.map +1 -0
  107. package/dist/providers/github/commands/secretCommands.d.ts +2 -0
  108. package/dist/providers/github/commands/secretCommands.d.ts.map +1 -0
  109. package/dist/providers/github/commands/secretCommands.js +5 -0
  110. package/dist/providers/github/commands/secretCommands.js.map +1 -0
  111. package/dist/providers/github/contextBinding.d.ts +11 -0
  112. package/dist/providers/github/contextBinding.d.ts.map +1 -0
  113. package/dist/providers/github/contextBinding.js +15 -0
  114. package/dist/providers/github/contextBinding.js.map +1 -0
  115. package/dist/providers/github/domain/issue.d.ts +94 -0
  116. package/dist/providers/github/domain/issue.d.ts.map +1 -0
  117. package/dist/providers/github/domain/issue.js +7 -0
  118. package/dist/providers/github/domain/issue.js.map +1 -0
  119. package/dist/providers/github/domain/pullRequest.d.ts +55 -0
  120. package/dist/providers/github/domain/pullRequest.d.ts.map +1 -0
  121. package/dist/providers/github/domain/pullRequest.js +9 -0
  122. package/dist/providers/github/domain/pullRequest.js.map +1 -0
  123. package/dist/providers/github/ghAuthToken.d.ts +28 -0
  124. package/dist/providers/github/ghAuthToken.d.ts.map +1 -0
  125. package/dist/providers/github/ghAuthToken.js +39 -0
  126. package/dist/providers/github/ghAuthToken.js.map +1 -0
  127. package/dist/providers/github/ghCommandRunner.d.ts +20 -0
  128. package/dist/providers/github/ghCommandRunner.d.ts.map +1 -0
  129. package/dist/providers/github/ghCommandRunner.js +21 -0
  130. package/dist/providers/github/ghCommandRunner.js.map +1 -0
  131. package/dist/providers/github/ghIssueApi.d.ts +29 -0
  132. package/dist/providers/github/ghIssueApi.d.ts.map +1 -0
  133. package/dist/providers/github/ghIssueApi.js +37 -0
  134. package/dist/providers/github/ghIssueApi.js.map +1 -0
  135. package/dist/providers/github/ghIssueParsers.d.ts +28 -0
  136. package/dist/providers/github/ghIssueParsers.d.ts.map +1 -0
  137. package/dist/providers/github/ghIssueParsers.js +105 -0
  138. package/dist/providers/github/ghIssueParsers.js.map +1 -0
  139. package/dist/providers/github/ghPrApi.d.ts +27 -0
  140. package/dist/providers/github/ghPrApi.d.ts.map +1 -0
  141. package/dist/providers/github/ghPrApi.js +32 -0
  142. package/dist/providers/github/ghPrApi.js.map +1 -0
  143. package/dist/providers/github/ghPrParsers.d.ts +57 -0
  144. package/dist/providers/github/ghPrParsers.d.ts.map +1 -0
  145. package/dist/providers/github/ghPrParsers.js +135 -0
  146. package/dist/providers/github/ghPrParsers.js.map +1 -0
  147. package/dist/providers/github/ghRepoApi.d.ts +33 -0
  148. package/dist/providers/github/ghRepoApi.d.ts.map +1 -0
  149. package/dist/providers/github/ghRepoApi.js +89 -0
  150. package/dist/providers/github/ghRepoApi.js.map +1 -0
  151. package/dist/providers/github/githubBoardManager.d.ts +39 -0
  152. package/dist/providers/github/githubBoardManager.d.ts.map +1 -0
  153. package/dist/providers/github/githubBoardManager.js +166 -0
  154. package/dist/providers/github/githubBoardManager.js.map +1 -0
  155. package/dist/providers/github/githubCodeHost.d.ts +73 -0
  156. package/dist/providers/github/githubCodeHost.d.ts.map +1 -0
  157. package/dist/providers/github/githubCodeHost.js +217 -0
  158. package/dist/providers/github/githubCodeHost.js.map +1 -0
  159. package/dist/providers/github/githubIdentity.d.ts +51 -0
  160. package/dist/providers/github/githubIdentity.d.ts.map +1 -0
  161. package/dist/providers/github/githubIdentity.js +110 -0
  162. package/dist/providers/github/githubIdentity.js.map +1 -0
  163. package/dist/providers/github/githubIssueTracker.d.ts +69 -0
  164. package/dist/providers/github/githubIssueTracker.d.ts.map +1 -0
  165. package/dist/providers/github/githubIssueTracker.js +209 -0
  166. package/dist/providers/github/githubIssueTracker.js.map +1 -0
  167. package/dist/providers/github/githubTokenProvider.d.ts +41 -0
  168. package/dist/providers/github/githubTokenProvider.d.ts.map +1 -0
  169. package/dist/providers/github/githubTokenProvider.js +51 -0
  170. package/dist/providers/github/githubTokenProvider.js.map +1 -0
  171. package/dist/providers/github/index.d.ts +10 -0
  172. package/dist/providers/github/index.d.ts.map +1 -0
  173. package/dist/providers/github/index.js +5 -0
  174. package/dist/providers/github/index.js.map +1 -0
  175. package/dist/providers/github/mappers.d.ts +40 -0
  176. package/dist/providers/github/mappers.d.ts.map +1 -0
  177. package/dist/providers/github/mappers.js +103 -0
  178. package/dist/providers/github/mappers.js.map +1 -0
  179. package/dist/providers/github/tokenResolver.d.ts +37 -0
  180. package/dist/providers/github/tokenResolver.d.ts.map +1 -0
  181. package/dist/providers/github/tokenResolver.js +43 -0
  182. package/dist/providers/github/tokenResolver.js.map +1 -0
  183. package/dist/providers/gitlab/gitlabApiClient.d.ts +45 -0
  184. package/dist/providers/gitlab/gitlabApiClient.d.ts.map +1 -0
  185. package/dist/providers/gitlab/gitlabApiClient.js +95 -0
  186. package/dist/providers/gitlab/gitlabApiClient.js.map +1 -0
  187. package/dist/providers/gitlab/gitlabBoardManager.d.ts +11 -0
  188. package/dist/providers/gitlab/gitlabBoardManager.d.ts.map +1 -0
  189. package/dist/providers/gitlab/gitlabBoardManager.js +27 -0
  190. package/dist/providers/gitlab/gitlabBoardManager.js.map +1 -0
  191. package/dist/providers/gitlab/gitlabCodeHost.d.ts +49 -0
  192. package/dist/providers/gitlab/gitlabCodeHost.d.ts.map +1 -0
  193. package/dist/providers/gitlab/gitlabCodeHost.js +109 -0
  194. package/dist/providers/gitlab/gitlabCodeHost.js.map +1 -0
  195. package/dist/providers/gitlab/gitlabTypes.d.ts +46 -0
  196. package/dist/providers/gitlab/gitlabTypes.d.ts.map +1 -0
  197. package/dist/providers/gitlab/gitlabTypes.js +6 -0
  198. package/dist/providers/gitlab/gitlabTypes.js.map +1 -0
  199. package/dist/providers/gitlab/index.d.ts +5 -0
  200. package/dist/providers/gitlab/index.d.ts.map +1 -0
  201. package/dist/providers/gitlab/index.js +4 -0
  202. package/dist/providers/gitlab/index.js.map +1 -0
  203. package/dist/providers/gitlab/mappers.d.ts +26 -0
  204. package/dist/providers/gitlab/mappers.d.ts.map +1 -0
  205. package/dist/providers/gitlab/mappers.js +63 -0
  206. package/dist/providers/gitlab/mappers.js.map +1 -0
  207. package/dist/providers/index.d.ts +7 -0
  208. package/dist/providers/index.d.ts.map +1 -0
  209. package/dist/providers/index.js +7 -0
  210. package/dist/providers/index.js.map +1 -0
  211. package/dist/providers/jira/adfConverter.d.ts +32 -0
  212. package/dist/providers/jira/adfConverter.d.ts.map +1 -0
  213. package/dist/providers/jira/adfConverter.js +144 -0
  214. package/dist/providers/jira/adfConverter.js.map +1 -0
  215. package/dist/providers/jira/index.d.ts +8 -0
  216. package/dist/providers/jira/index.d.ts.map +1 -0
  217. package/dist/providers/jira/index.js +5 -0
  218. package/dist/providers/jira/index.js.map +1 -0
  219. package/dist/providers/jira/jiraApiClient.d.ts +42 -0
  220. package/dist/providers/jira/jiraApiClient.d.ts.map +1 -0
  221. package/dist/providers/jira/jiraApiClient.js +84 -0
  222. package/dist/providers/jira/jiraApiClient.js.map +1 -0
  223. package/dist/providers/jira/jiraBoardManager.d.ts +11 -0
  224. package/dist/providers/jira/jiraBoardManager.d.ts.map +1 -0
  225. package/dist/providers/jira/jiraBoardManager.js +27 -0
  226. package/dist/providers/jira/jiraBoardManager.js.map +1 -0
  227. package/dist/providers/jira/jiraIssueTracker.d.ts +53 -0
  228. package/dist/providers/jira/jiraIssueTracker.d.ts.map +1 -0
  229. package/dist/providers/jira/jiraIssueTracker.js +231 -0
  230. package/dist/providers/jira/jiraIssueTracker.js.map +1 -0
  231. package/dist/providers/jira/jiraTypes.d.ts +61 -0
  232. package/dist/providers/jira/jiraTypes.d.ts.map +1 -0
  233. package/dist/providers/jira/jiraTypes.js +6 -0
  234. package/dist/providers/jira/jiraTypes.js.map +1 -0
  235. package/dist/providers/types.d.ts +271 -0
  236. package/dist/providers/types.d.ts.map +1 -0
  237. package/dist/providers/types.js +52 -0
  238. package/dist/providers/types.js.map +1 -0
  239. package/dist/providers/workspaceValidation.d.ts +18 -0
  240. package/dist/providers/workspaceValidation.d.ts.map +1 -0
  241. package/dist/providers/workspaceValidation.js +37 -0
  242. package/dist/providers/workspaceValidation.js.map +1 -0
  243. package/package.json +66 -0
@@ -0,0 +1,208 @@
1
+ /**
2
+ * Package-private worktree create/ensure ops for GitContext.
3
+ * Injects runner, fs and a logger port for testability — no base-path
4
+ * computation here.
5
+ */
6
+ import { worktreeQueryOps } from './worktreeQueryOps.js';
7
+ function isBranchCheckedOutElsewhere(run, baseCwd, branchName) {
8
+ try {
9
+ const output = run('git worktree list --porcelain', baseCwd);
10
+ const lines = output.split('\n');
11
+ let currentWorktreePath = null;
12
+ let mainRepoPath = null;
13
+ for (const line of lines) {
14
+ if (line.startsWith('worktree ')) {
15
+ currentWorktreePath = line.substring('worktree '.length);
16
+ if (!currentWorktreePath.includes('.worktrees') && !mainRepoPath) {
17
+ mainRepoPath = currentWorktreePath;
18
+ }
19
+ }
20
+ else if (line.startsWith('branch ') && currentWorktreePath) {
21
+ const checkedOutBranch = line.substring('branch '.length).replace('refs/heads/', '');
22
+ if (checkedOutBranch === branchName) {
23
+ return {
24
+ checkedOut: true,
25
+ path: currentWorktreePath,
26
+ isMainRepo: currentWorktreePath === mainRepoPath,
27
+ };
28
+ }
29
+ }
30
+ }
31
+ return { checkedOut: false, path: null, isMainRepo: false };
32
+ }
33
+ catch {
34
+ return { checkedOut: false, path: null, isMainRepo: false };
35
+ }
36
+ }
37
+ function freeBranchFromMainRepo(run, baseCwd, branchName, log) {
38
+ log(`Freeing branch '${branchName}' from main repository at ${baseCwd}`, 'info');
39
+ try {
40
+ const status = run('git status --porcelain', baseCwd);
41
+ if (status.trim()) {
42
+ log('Found uncommitted changes in main repository, auto-committing...', 'info');
43
+ run('git add -A', baseCwd);
44
+ run('git commit -m "WIP: auto-commit before switching to worktree"', baseCwd);
45
+ log('Auto-committed changes', 'success');
46
+ try {
47
+ run(`git push -u origin "${branchName}"`, baseCwd);
48
+ log(`Pushed branch '${branchName}' to origin`, 'success');
49
+ }
50
+ catch (pushError) {
51
+ log(`Warning: Could not push branch to origin: ${pushError}`, 'info');
52
+ }
53
+ }
54
+ // get default branch by inspecting origin/HEAD
55
+ let defaultBranch = 'main';
56
+ try {
57
+ defaultBranch = run('git rev-parse --abbrev-ref origin/HEAD', baseCwd).replace('origin/', '').trim();
58
+ }
59
+ catch {
60
+ // fall back to 'main'
61
+ }
62
+ run(`git checkout "${defaultBranch}"`, baseCwd);
63
+ log(`Switched main repository to '${defaultBranch}'`, 'success');
64
+ }
65
+ catch (error) {
66
+ throw new Error(`Failed to free branch '${branchName}' from main repository: ${error}`);
67
+ }
68
+ }
69
+ /**
70
+ * Copies .env and .env.local from baseCwd (the repo root) to the worktree.
71
+ */
72
+ function copyEnvToWorktree(fs, log, baseCwd, worktreePath) {
73
+ for (const name of ['.env', '.env.local']) {
74
+ const src = baseCwd + '/' + name;
75
+ const dest = worktreePath + '/' + name;
76
+ if (fs.existsSync(src)) {
77
+ fs.copyFileSync(src, dest);
78
+ log(`Copied ${name} file to worktree at ${worktreePath}`, 'info');
79
+ }
80
+ else {
81
+ log(`No ${name} file found in ${baseCwd}, skipping copy`, 'info');
82
+ }
83
+ }
84
+ }
85
+ function resolveBranchExists(run, baseCwd, branchName, log) {
86
+ try {
87
+ run(`git rev-parse --verify "${branchName}"`, baseCwd);
88
+ return true;
89
+ }
90
+ catch { /* branch not found locally */ }
91
+ try {
92
+ run(`git rev-parse --verify "origin/${branchName}"`, baseCwd);
93
+ return true;
94
+ }
95
+ catch { /* branch not found on remote */ }
96
+ try {
97
+ run(`git fetch origin "${branchName}"`, baseCwd);
98
+ run(`git rev-parse --verify "origin/${branchName}"`, baseCwd);
99
+ log(`Fetched branch '${branchName}' from origin`, 'info');
100
+ return true;
101
+ }
102
+ catch {
103
+ return false;
104
+ }
105
+ }
106
+ /**
107
+ * Creates a worktree for an existing branch (or creates a new one from baseBranch).
108
+ * Returns the worktree path.
109
+ */
110
+ function createWorktree(run, fs, log, paths, branchName, baseBranch) {
111
+ if (!branchName || !branchName.trim())
112
+ throw new Error('branchName must be a non-empty string');
113
+ const { worktreesDir, worktreePath, baseCwd } = paths;
114
+ if (!fs.existsSync(worktreesDir)) {
115
+ fs.mkdirSync(worktreesDir, { recursive: true });
116
+ }
117
+ try {
118
+ const branchExists = resolveBranchExists(run, baseCwd, branchName, log);
119
+ if (branchExists) {
120
+ const checkoutStatus = isBranchCheckedOutElsewhere(run, baseCwd, branchName);
121
+ if (checkoutStatus.checkedOut) {
122
+ if (checkoutStatus.isMainRepo) {
123
+ log(`Branch '${branchName}' is checked out in main repository, freeing it...`, 'info');
124
+ freeBranchFromMainRepo(run, baseCwd, branchName, log);
125
+ }
126
+ else if (checkoutStatus.path) {
127
+ log(`Branch '${branchName}' is already checked out at ${checkoutStatus.path}, reusing`, 'info');
128
+ return checkoutStatus.path;
129
+ }
130
+ }
131
+ run(`git worktree add "${worktreePath}" "${branchName}"`, baseCwd);
132
+ log(`Created worktree for existing branch '${branchName}' at ${worktreePath}`, 'success');
133
+ }
134
+ else if (baseBranch) {
135
+ try {
136
+ run(`git fetch origin "${baseBranch}"`, baseCwd);
137
+ }
138
+ catch { /* non-fatal */ }
139
+ try {
140
+ const localHash = run(`git rev-parse "${baseBranch}"`, baseCwd);
141
+ const remoteHash = run(`git rev-parse "origin/${baseBranch}"`, baseCwd);
142
+ if (localHash !== remoteHash) {
143
+ log(`Local ${baseBranch} differs from origin/${baseBranch}, using remote ref`, 'warn');
144
+ }
145
+ }
146
+ catch { /* non-fatal */ }
147
+ run(`git worktree add -b "${branchName}" "${worktreePath}" "origin/${baseBranch}"`, baseCwd);
148
+ log(`Created worktree with new branch '${branchName}' from 'origin/${baseBranch}' at ${worktreePath}`, 'success');
149
+ }
150
+ else {
151
+ throw new Error(`Branch '${branchName}' does not exist and no base branch was provided`);
152
+ }
153
+ return worktreePath;
154
+ }
155
+ catch (error) {
156
+ throw new Error(`Failed to create worktree for branch '${branchName}': ${error}`);
157
+ }
158
+ }
159
+ /**
160
+ * Creates a worktree with a new branch from an optional base (defaults to HEAD).
161
+ */
162
+ function createWorktreeForNewBranch(run, fs, log, paths, branchName, baseBranch) {
163
+ if (!branchName || !branchName.trim())
164
+ throw new Error('branchName must be a non-empty string');
165
+ const { worktreesDir, worktreePath, baseCwd } = paths;
166
+ if (!fs.existsSync(worktreesDir)) {
167
+ fs.mkdirSync(worktreesDir, { recursive: true });
168
+ }
169
+ try {
170
+ let base = 'HEAD';
171
+ if (baseBranch) {
172
+ try {
173
+ run(`git fetch origin "${baseBranch}"`, baseCwd);
174
+ }
175
+ catch { /* non-fatal */ }
176
+ base = `origin/${baseBranch}`;
177
+ }
178
+ run(`git worktree add -b "${branchName}" "${worktreePath}" "${base}"`, baseCwd);
179
+ log(`Created worktree with new branch '${branchName}' at ${worktreePath}`, 'success');
180
+ return worktreePath;
181
+ }
182
+ catch (error) {
183
+ throw new Error(`Failed to create worktree with new branch '${branchName}': ${error}`);
184
+ }
185
+ }
186
+ /**
187
+ * Ensures a worktree exists for the branch, creating if needed.
188
+ * Copies env files into the worktree.
189
+ */
190
+ function ensureWorktree(run, fs, log, paths, branchName, baseBranch) {
191
+ const existingPath = worktreeQueryOps.getWorktreeForBranch(run, fs, paths.baseCwd, paths.worktreePath, branchName);
192
+ if (existingPath) {
193
+ log(`Worktree for branch '${branchName}' already exists at ${existingPath}, reusing`, 'info');
194
+ copyEnvToWorktree(fs, log, paths.baseCwd, existingPath);
195
+ return existingPath;
196
+ }
197
+ log(`Worktree for branch '${branchName}' does not exist, creating new worktree...`, 'info');
198
+ const worktreePath = createWorktree(run, fs, log, paths, branchName, baseBranch);
199
+ copyEnvToWorktree(fs, log, paths.baseCwd, worktreePath);
200
+ return worktreePath;
201
+ }
202
+ export const worktreeCreateOps = {
203
+ createWorktree,
204
+ createWorktreeForNewBranch,
205
+ ensureWorktree,
206
+ copyEnvToWorktree,
207
+ };
208
+ //# sourceMappingURL=worktreeCreateOps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktreeCreateOps.js","sourceRoot":"","sources":["../../src/git/worktreeCreateOps.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAwBzD,SAAS,2BAA2B,CAAC,GAAW,EAAE,OAAe,EAAE,UAAkB;IACnF,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,GA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AC,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QACxD,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,GAAG,CAAC,wBAAwB,UAAU,4CAA4C,EAAE,MAAM,CAAC,CAAC;IAC5F,MAAM,YAAY,GAAG,cAAc,CAAC,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IACjF,iBAAiB,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACxD,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,cAAc;IACd,0BAA0B;IAC1B,cAAc;IACd,iBAAiB;CAClB,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Package-private worktree-probe op module for GitContext.
3
+ * Handles reads that inspect an arbitrary worktree path supplied by the caller,
4
+ * as opposed to the context's own base path (which worktreeQueryOps covers).
5
+ */
6
+ export type WorktreeRegistration = 'healthy' | 'locked' | 'prunable' | 'missing';
7
+ type Runner = (command: string, cwd: string) => string;
8
+ declare function resolveGitDir(run: Runner, worktreePath: string): string | null;
9
+ declare function currentBranchSymbolic(run: Runner, worktreePath: string): string | null;
10
+ declare function worktreeRegistration(run: Runner, worktreePath: string): WorktreeRegistration;
11
+ export declare const worktreeProbeOps: {
12
+ resolveGitDir: typeof resolveGitDir;
13
+ currentBranchSymbolic: typeof currentBranchSymbolic;
14
+ worktreeRegistration: typeof worktreeRegistration;
15
+ };
16
+ export {};
17
+ //# sourceMappingURL=worktreeProbeOps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktreeProbeOps.d.ts","sourceRoot":"","sources":["../../src/git/worktreeProbeOps.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;AAEjF,KAAK,MAAM,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;AAEvD,iBAAS,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOvE;AAED,iBAAS,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAM/E;AAED,iBAAS,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,oBAAoB,CAiCrF;AAED,eAAO,MAAM,gBAAgB;;;;CAAiE,CAAC"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Package-private worktree-probe op module for GitContext.
3
+ * Handles reads that inspect an arbitrary worktree path supplied by the caller,
4
+ * as opposed to the context's own base path (which worktreeQueryOps covers).
5
+ */
6
+ import * as path from 'path';
7
+ function resolveGitDir(run, worktreePath) {
8
+ try {
9
+ const raw = run('git rev-parse --git-dir', worktreePath).trim();
10
+ return path.isAbsolute(raw) ? raw : path.resolve(worktreePath, raw);
11
+ }
12
+ catch {
13
+ return null;
14
+ }
15
+ }
16
+ function currentBranchSymbolic(run, worktreePath) {
17
+ try {
18
+ return run('git symbolic-ref --short HEAD', worktreePath).trim() || null;
19
+ }
20
+ catch {
21
+ return null;
22
+ }
23
+ }
24
+ function worktreeRegistration(run, worktreePath) {
25
+ try {
26
+ const output = run('git worktree list --porcelain', worktreePath);
27
+ const lines = output.split('\n');
28
+ let currentPath = null;
29
+ let isLocked = false;
30
+ let isPrunable = false;
31
+ for (const line of lines) {
32
+ if (line.startsWith('worktree ')) {
33
+ currentPath = line.slice('worktree '.length);
34
+ isLocked = false;
35
+ isPrunable = false;
36
+ }
37
+ else if (line.startsWith('locked') && currentPath === worktreePath) {
38
+ isLocked = true;
39
+ }
40
+ else if (line.startsWith('prunable') && currentPath === worktreePath) {
41
+ isPrunable = true;
42
+ }
43
+ else if (line === '' && currentPath === worktreePath) {
44
+ if (isLocked)
45
+ return 'locked';
46
+ if (isPrunable)
47
+ return 'prunable';
48
+ return 'healthy';
49
+ }
50
+ }
51
+ // Handle the last entry when trailing blank line is absent (e.g. after .trim())
52
+ if (currentPath === worktreePath) {
53
+ if (isLocked)
54
+ return 'locked';
55
+ if (isPrunable)
56
+ return 'prunable';
57
+ return 'healthy';
58
+ }
59
+ return 'missing';
60
+ }
61
+ catch {
62
+ return 'missing';
63
+ }
64
+ }
65
+ export const worktreeProbeOps = { resolveGitDir, currentBranchSymbolic, worktreeRegistration };
66
+ //# sourceMappingURL=worktreeProbeOps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktreeProbeOps.js","sourceRoot":"","sources":["../../src/git/worktreeProbeOps.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAM7B,SAAS,aAAa,CAAC,GAAW,EAAE,YAAoB;IACtD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,GAAG,CAAC,yBAAyB,EAAE,YAAY,CAAC,CAAC,IAAI,EAAE,CAAC;QAChE,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;IACtE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,qBAAqB,CAAC,GAAW,EAAE,YAAoB;IAC9D,IAAI,CAAC;QACH,OAAO,GAAG,CAAC,+BAA+B,EAAE,YAAY,CAAC,CAAC,IAAI,EAAE,IAAI,IAAI,CAAC;IAC3E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,oBAAoB,CAAC,GAAW,EAAE,YAAoB;IAC7D,IAAI,CAA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IACnB,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,aAAa,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Package-private worktree query ops for GitContext.
3
+ * Injects the runner and fs for testability — no base-path computation here.
4
+ */
5
+ export type Runner = (command: string, cwd: string) => string;
6
+ export interface FsDeps {
7
+ existsSync: (p: string) => boolean;
8
+ }
9
+ export interface WorktreeForIssueResult {
10
+ worktreePath: string;
11
+ branchName: string;
12
+ }
13
+ /**
14
+ * Lists all worktrees under the .worktrees/ directory (excludes the main repo).
15
+ */
16
+ declare function listWorktrees(run: Runner, baseCwd: string): string[];
17
+ /**
18
+ * Finds the first worktree matching the given issue prefixes and number.
19
+ * Accepts a pre-resolved prefixes array so the package stays free of ADW core imports.
20
+ */
21
+ declare function findWorktreeForIssue(run: Runner, baseCwd: string, prefixes: readonly string[], issueNumber: number): WorktreeForIssueResult | null;
22
+ /**
23
+ * Gets the existing worktree path for a branch, or null if not found.
24
+ * Checks by exact path, then by branch name under .worktrees/, then by orphan directory.
25
+ */
26
+ declare function getWorktreeForBranch(run: Runner, fs: FsDeps, baseCwd: string, expectedWorktreePath: string, branchName: string): string | null;
27
+ /**
28
+ * Returns the path of the main repository (the first worktree entry NOT under .worktrees).
29
+ * Throws if no such entry is found — preserves the throw-on-failure contract of the legacy caller.
30
+ */
31
+ declare function mainRepoPath(run: Runner, cwd: string): string;
32
+ /**
33
+ * Returns branch names from `git worktree list --porcelain`.
34
+ * Strips `refs/heads/` prefix; returns [] on failure.
35
+ */
36
+ declare function worktreeBranches(run: Runner, cwd: string): string[];
37
+ export declare const worktreeQueryOps: {
38
+ listWorktrees: typeof listWorktrees;
39
+ findWorktreeForIssue: typeof findWorktreeForIssue;
40
+ getWorktreeForBranch: typeof getWorktreeForBranch;
41
+ mainRepoPath: typeof mainRepoPath;
42
+ worktreeBranches: typeof worktreeBranches;
43
+ };
44
+ export {};
45
+ //# sourceMappingURL=worktreeQueryOps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktreeQueryOps.d.ts","sourceRoot":"","sources":["../../src/git/worktreeQueryOps.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;AAE9D,MAAM,WAAW,MAAM;IACrB,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;CACpC;AAED,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,iBAAS,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAc7D;AAED;;;GAGG;AACH,iBAAS,oBAAoB,CAC3B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,WAAW,EAAE,MAAM,GAClB,sBAAsB,GAAG,IAAI,CA+B/B;AAED;;;GAGG;AACH,iBAAS,oBAAoB,CAC3B,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,MAAM,EACf,oBAAoB,EAAE,MAAM,EAC5B,UAAU,EAAE,MAAM,GACjB,MAAM,GAAG,IAAI,CAuBf;AAED;;;GAGG;AACH,iBAAS,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAStD;AAED;;;GAGG;AACH,iBAAS,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAc5D;AAED,eAAO,MAAM,gBAAgB;;;;;;CAAgG,CAAC"}
@@ -0,0 +1,129 @@
1
+ /**
2
+ * Package-private worktree query ops for GitContext.
3
+ * Injects the runner and fs for testability — no base-path computation here.
4
+ */
5
+ import * as path from 'path';
6
+ /**
7
+ * Lists all worktrees under the .worktrees/ directory (excludes the main repo).
8
+ */
9
+ function listWorktrees(run, baseCwd) {
10
+ try {
11
+ const output = run('git worktree list --porcelain', baseCwd);
12
+ const worktrees = [];
13
+ for (const line of output.split('\n')) {
14
+ if (line.startsWith('worktree ')) {
15
+ const wtPath = line.substring('worktree '.length);
16
+ if (wtPath.includes('.worktrees'))
17
+ worktrees.push(wtPath);
18
+ }
19
+ }
20
+ return worktrees;
21
+ }
22
+ catch {
23
+ return [];
24
+ }
25
+ }
26
+ /**
27
+ * Finds the first worktree matching the given issue prefixes and number.
28
+ * Accepts a pre-resolved prefixes array so the package stays free of ADW core imports.
29
+ */
30
+ function findWorktreeForIssue(run, baseCwd, prefixes, issueNumber) {
31
+ try {
32
+ const pattern = new RegExp('^(' + prefixes.join('|') + ')-issue-' + issueNumber + '-');
33
+ const output = run('git worktree list --porcelain', baseCwd);
34
+ const lines = output.split('\n');
35
+ let currentWorktreePath = null;
36
+ let currentBranch = null;
37
+ for (const line of lines) {
38
+ if (line.startsWith('worktree ')) {
39
+ currentWorktreePath = line.substring('worktree '.length);
40
+ currentBranch = null;
41
+ }
42
+ else if (line.startsWith('branch ')) {
43
+ currentBranch = line.substring('branch '.length).replace('refs/heads/', '');
44
+ }
45
+ else if (line === '' && currentWorktreePath && currentBranch) {
46
+ if (currentWorktreePath.includes('.worktrees/')) {
47
+ const dirName = path.basename(currentWorktreePath);
48
+ if (pattern.test(dirName)) {
49
+ return { worktreePath: currentWorktreePath, branchName: currentBranch };
50
+ }
51
+ }
52
+ currentWorktreePath = null;
53
+ currentBranch = null;
54
+ }
55
+ }
56
+ return null;
57
+ }
58
+ catch {
59
+ return null;
60
+ }
61
+ }
62
+ /**
63
+ * Gets the existing worktree path for a branch, or null if not found.
64
+ * Checks by exact path, then by branch name under .worktrees/, then by orphan directory.
65
+ */
66
+ function getWorktreeForBranch(run, fs, baseCwd, expectedWorktreePath, branchName) {
67
+ try {
68
+ const output = run('git worktree list --porcelain', baseCwd);
69
+ const lines = output.split('\n');
70
+ let currentWorktreePath = null;
71
+ for (const line of lines) {
72
+ if (line.startsWith('worktree ')) {
73
+ currentWorktreePath = line.substring('worktree '.length);
74
+ if (currentWorktreePath === expectedWorktreePath)
75
+ return expectedWorktreePath;
76
+ }
77
+ else if (line.startsWith('branch ') && currentWorktreePath) {
78
+ const checkedOutBranch = line.substring('branch '.length).replace('refs/heads/', '');
79
+ if (checkedOutBranch === branchName && currentWorktreePath.includes('.worktrees')) {
80
+ return currentWorktreePath;
81
+ }
82
+ }
83
+ }
84
+ if (fs.existsSync(expectedWorktreePath))
85
+ return expectedWorktreePath;
86
+ return null;
87
+ }
88
+ catch {
89
+ return null;
90
+ }
91
+ }
92
+ /**
93
+ * Returns the path of the main repository (the first worktree entry NOT under .worktrees).
94
+ * Throws if no such entry is found — preserves the throw-on-failure contract of the legacy caller.
95
+ */
96
+ function mainRepoPath(run, cwd) {
97
+ const output = run('git worktree list --porcelain', cwd);
98
+ for (const line of output.split('\n')) {
99
+ if (line.startsWith('worktree ')) {
100
+ const wtPath = line.substring('worktree '.length);
101
+ if (!wtPath.includes('.worktrees'))
102
+ return wtPath;
103
+ }
104
+ }
105
+ throw new Error('Could not find main repository in worktree list');
106
+ }
107
+ /**
108
+ * Returns branch names from `git worktree list --porcelain`.
109
+ * Strips `refs/heads/` prefix; returns [] on failure.
110
+ */
111
+ function worktreeBranches(run, cwd) {
112
+ try {
113
+ const output = run('git worktree list --porcelain', cwd);
114
+ const branches = [];
115
+ for (const line of output.split('\n')) {
116
+ if (line.startsWith('branch ')) {
117
+ const branch = line.substring('branch '.length).replace('refs/heads/', '').trim();
118
+ if (branch)
119
+ branches.push(branch);
120
+ }
121
+ }
122
+ return branches;
123
+ }
124
+ catch {
125
+ return [];
126
+ }
127
+ }
128
+ export const worktreeQueryOps = { listWorktrees, findWorktreeForIssue, getWorktreeForBranch, mainRepoPath, worktreeBranches };
129
+ //# sourceMappingURL=worktreeQueryOps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktreeQueryOps.js","sourceRoot":"","sources":["../../src/git/worktreeQueryOps.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAa7B;;GAEG;AACH,SAAS,aAAa,CAAC,GAAW,EAAE,OAAe;IACjD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,GAAG,CAAC,+BAA+B,EAAE,OAAO,CAAC,CAAC;QAC7D,MAAM,SAAS,GAAa,EAAE,CAAC;QAC/B,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YACtC,IAAI,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;gBACjC,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;gBAClD,IAAI,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC;oBAAE,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,oBAAoB,CAC3B,GAAW,EACX,OAAe,EACf,QAA2B,EAC3B,WAAmB;IAEnB,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,UAAU,GAAG,WAAW,GAAG,GAAG,CAAC,CAAC;QACvF,MAAM,MAAM,GAAG,GAAG,CAAC,+BAA+B,EAAE,OAAO,CAAC,CAAC;QAC7D,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAEjC,IAAI,mBAAmB,GAAkB,IAAI,CAAC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AQ,CAAC,YAAY,CAAC;gBAAE,OAAO,MAAM,CAAC;QACpD,CAAC;IACH,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;AACrE,CAAC;AAED;;;GAGG;AACH,SAAS,gBAAgB,CAAC,GAAW,EAAE,GAAW;IAChD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,GAAG,CAAC,+BAA+B,EAAE,GAAG,CAAC,CAAC;QACzD,MAAM,QAAQ,GAAa,EAAE,CAAC;QAC9B,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YACtC,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;gBAClF,IAAI,MAAM;oBAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACpC,CAAC;QACH,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,aAAa,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Package-private worktree remove ops for GitContext.
3
+ * Injects runner, fs, a logger port, and killProcesses for testability.
4
+ */
5
+ import type { Logger } from './types.js';
6
+ type Runner = (command: string, cwd: string) => string;
7
+ interface FsDeps {
8
+ existsSync: (p: string) => boolean;
9
+ rmSync: (p: string, opts?: {
10
+ force?: boolean;
11
+ recursive?: boolean;
12
+ }) => void;
13
+ }
14
+ /**
15
+ * Removes a worktree for the given branch. Falls back to prune + rmSync on failure.
16
+ */
17
+ declare function removeWorktree(run: Runner, fs: FsDeps, log: Logger, worktreePath: string, branchName: string, deleteLocalBranchFn: (branch: string) => boolean, baseCwd: string, killProcs?: (dir: string) => void): boolean;
18
+ /**
19
+ * Removes all worktrees matching the given issue number.
20
+ */
21
+ declare function removeWorktreesForIssue(run: Runner, fs: FsDeps, log: Logger, baseCwd: string, issueNumber: number, deleteLocalBranchFn: (branch: string) => boolean, killProcs?: (dir: string) => void): number;
22
+ export declare const worktreeRemoveOps: {
23
+ removeWorktree: typeof removeWorktree;
24
+ removeWorktreesForIssue: typeof removeWorktreesForIssue;
25
+ };
26
+ export {};
27
+ //# sourceMappingURL=worktreeRemoveOps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktreeRemoveOps.d.ts","sourceRoot":"","sources":["../../src/git/worktreeRemoveOps.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGzC,KAAK,MAAM,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;AAEvD,UAAU,MAAM;IACd,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;IACnC,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;CAC9E;AAiDD;;GAEG;AACH,iBAAS,cAAc,CACrB,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,mBAAmB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,EAChD,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAA+B,GAC1D,OAAO,CAUT;AA8CD;;GAEG;AACH,iBAAS,uBAAuB,CAC9B,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,mBAAmB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,EAChD,SAAS,GAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAA+B,GAC1D,MAAM,CAuCR;AAED,eAAO,MAAM,iBAAiB;;;CAA8C,CAAC"}