@gitkraken/core-gitlens 0.5.116 → 0.7.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 (1915) hide show
  1. package/CHANGELOG.md +32 -1
  2. package/README.md +9 -2
  3. package/dist/_virtual/@oxc-project+runtime/helpers/esm/decorate.js +9 -0
  4. package/dist/_virtual/@oxc-project+runtime/helpers/esm/usingCtx.js +57 -0
  5. package/dist/git/cache.d.ts +297 -297
  6. package/dist/git/cache.js +948 -1276
  7. package/dist/git/cache.js.map +1 -1
  8. package/dist/git/context.d.ts +202 -197
  9. package/dist/git/context.js +12 -8
  10. package/dist/git/context.js.map +1 -1
  11. package/dist/git/errors.d.ts +268 -281
  12. package/dist/git/errors.js +928 -706
  13. package/dist/git/errors.js.map +1 -1
  14. package/dist/git/features.d.ts +3 -2
  15. package/dist/git/features.js +34 -55
  16. package/dist/git/features.js.map +1 -1
  17. package/dist/git/gitHealth.d.ts +88 -81
  18. package/dist/git/gitHealth.js +259 -329
  19. package/dist/git/gitHealth.js.map +1 -1
  20. package/dist/git/models/author.d.ts +12 -10
  21. package/dist/git/models/author.js +0 -2
  22. package/dist/git/models/autolink.d.ts +36 -37
  23. package/dist/git/models/autolink.js +0 -2
  24. package/dist/git/models/blame.d.ts +25 -23
  25. package/dist/git/models/blame.js +0 -2
  26. package/dist/git/models/branch.d.ts +74 -72
  27. package/dist/git/models/branch.js +132 -171
  28. package/dist/git/models/branch.js.map +1 -1
  29. package/dist/git/models/commit.d.ts +135 -133
  30. package/dist/git/models/commit.js +381 -484
  31. package/dist/git/models/commit.js.map +1 -1
  32. package/dist/git/models/contributor.d.ts +30 -29
  33. package/dist/git/models/contributor.js +56 -64
  34. package/dist/git/models/contributor.js.map +1 -1
  35. package/dist/git/models/defaultBranch.d.ts +5 -3
  36. package/dist/git/models/defaultBranch.js +0 -2
  37. package/dist/git/models/diff.d.ts +49 -47
  38. package/dist/git/models/diff.js +0 -2
  39. package/dist/git/models/file.d.ts +20 -18
  40. package/dist/git/models/file.js +0 -2
  41. package/dist/git/models/fileChange.d.ts +45 -43
  42. package/dist/git/models/fileChange.js +60 -66
  43. package/dist/git/models/fileChange.js.map +1 -1
  44. package/dist/git/models/fileStatus.d.ts +25 -23
  45. package/dist/git/models/fileStatus.js +30 -26
  46. package/dist/git/models/fileStatus.js.map +1 -1
  47. package/dist/git/models/graph.d.ts +328 -320
  48. package/dist/git/models/graph.js +31 -27
  49. package/dist/git/models/graph.js.map +1 -1
  50. package/dist/git/models/graphSearch.d.ts +37 -35
  51. package/dist/git/models/graphSearch.js +0 -2
  52. package/dist/git/models/graphSession.d.ts +158 -66
  53. package/dist/git/models/graphSession.js +72 -1
  54. package/dist/git/models/graphSession.js.map +1 -1
  55. package/dist/git/models/issue.d.ts +174 -140
  56. package/dist/git/models/issue.js +86 -84
  57. package/dist/git/models/issue.js.map +1 -1
  58. package/dist/git/models/issueOrPullRequest.d.ts +16 -14
  59. package/dist/git/models/issueOrPullRequest.js +0 -2
  60. package/dist/git/models/lineRange.d.ts +6 -4
  61. package/dist/git/models/lineRange.js +0 -2
  62. package/dist/git/models/log.d.ts +18 -16
  63. package/dist/git/models/log.js +0 -2
  64. package/dist/git/models/mergeConflicts.d.ts +17 -15
  65. package/dist/git/models/mergeConflicts.js +0 -2
  66. package/dist/git/models/patch.d.ts +14 -12
  67. package/dist/git/models/patch.js +0 -2
  68. package/dist/git/models/pausedOperationStatus.d.ts +42 -40
  69. package/dist/git/models/pausedOperationStatus.js +0 -2
  70. package/dist/git/models/pullRequest.d.ts +238 -230
  71. package/dist/git/models/pullRequest.js +151 -163
  72. package/dist/git/models/pullRequest.js.map +1 -1
  73. package/dist/git/models/rebase.d.ts +30 -28
  74. package/dist/git/models/rebase.js +0 -2
  75. package/dist/git/models/reference.d.ts +57 -55
  76. package/dist/git/models/reference.js +0 -2
  77. package/dist/git/models/reflog.d.ts +29 -27
  78. package/dist/git/models/reflog.js +63 -82
  79. package/dist/git/models/reflog.js.map +1 -1
  80. package/dist/git/models/remote.d.ts +34 -32
  81. package/dist/git/models/remote.js +74 -95
  82. package/dist/git/models/remote.js.map +1 -1
  83. package/dist/git/models/remoteProvider.d.ts +86 -84
  84. package/dist/git/models/remoteProvider.js +145 -150
  85. package/dist/git/models/remoteProvider.js.map +1 -1
  86. package/dist/git/models/remoteResource.d.ts +58 -56
  87. package/dist/git/models/remoteResource.js +15 -12
  88. package/dist/git/models/remoteResource.js.map +1 -1
  89. package/dist/git/models/repository.d.ts +144 -142
  90. package/dist/git/models/repository.js +358 -406
  91. package/dist/git/models/repository.js.map +1 -1
  92. package/dist/git/models/repositoryChangeEvent.d.ts +8 -6
  93. package/dist/git/models/repositoryChangeEvent.js +26 -24
  94. package/dist/git/models/repositoryChangeEvent.js.map +1 -1
  95. package/dist/git/models/repositoryIdentities.d.ts +50 -46
  96. package/dist/git/models/repositoryIdentities.js +7 -5
  97. package/dist/git/models/repositoryIdentities.js.map +1 -1
  98. package/dist/git/models/repositoryMetadata.d.ts +9 -7
  99. package/dist/git/models/repositoryMetadata.js +0 -2
  100. package/dist/git/models/resourceDescriptor.d.ts +11 -9
  101. package/dist/git/models/resourceDescriptor.js +0 -2
  102. package/dist/git/models/revision.d.ts +2 -0
  103. package/dist/git/models/revision.js +8 -5
  104. package/dist/git/models/revision.js.map +1 -1
  105. package/dist/git/models/search.d.ts +48 -47
  106. package/dist/git/models/search.js +53 -49
  107. package/dist/git/models/search.js.map +1 -1
  108. package/dist/git/models/shortlog.d.ts +5 -3
  109. package/dist/git/models/shortlog.js +0 -2
  110. package/dist/git/models/signature.d.ts +28 -26
  111. package/dist/git/models/signature.js +0 -2
  112. package/dist/git/models/staging.d.ts +18 -16
  113. package/dist/git/models/staging.js +0 -2
  114. package/dist/git/models/stash.d.ts +5 -3
  115. package/dist/git/models/stash.js +0 -2
  116. package/dist/git/models/status.d.ts +51 -49
  117. package/dist/git/models/status.js +172 -205
  118. package/dist/git/models/status.js.map +1 -1
  119. package/dist/git/models/statusFile.d.ts +35 -34
  120. package/dist/git/models/statusFile.js +112 -125
  121. package/dist/git/models/statusFile.js.map +1 -1
  122. package/dist/git/models/tag.d.ts +34 -32
  123. package/dist/git/models/tag.js +64 -77
  124. package/dist/git/models/tag.js.map +1 -1
  125. package/dist/git/models/tree.d.ts +8 -6
  126. package/dist/git/models/tree.js +0 -2
  127. package/dist/git/models/user.d.ts +6 -4
  128. package/dist/git/models/user.js +0 -2
  129. package/dist/git/models/worktree.d.ts +50 -48
  130. package/dist/git/models/worktree.js +102 -133
  131. package/dist/git/models/worktree.js.map +1 -1
  132. package/dist/git/parsers/diffParser.d.ts +7 -5
  133. package/dist/git/parsers/diffParser.js +438 -587
  134. package/dist/git/parsers/diffParser.js.map +1 -1
  135. package/dist/git/parsers/rebaseTodoParser.d.ts +3 -1
  136. package/dist/git/parsers/rebaseTodoParser.js +165 -208
  137. package/dist/git/parsers/rebaseTodoParser.js.map +1 -1
  138. package/dist/git/providers/blame.d.ts +12 -10
  139. package/dist/git/providers/blame.js +0 -2
  140. package/dist/git/providers/branches.d.ts +96 -94
  141. package/dist/git/providers/branches.js +0 -2
  142. package/dist/git/providers/commits.d.ts +105 -104
  143. package/dist/git/providers/commits.js +0 -2
  144. package/dist/git/providers/config.d.ts +80 -78
  145. package/dist/git/providers/config.js +0 -2
  146. package/dist/git/providers/contributors.d.ts +23 -21
  147. package/dist/git/providers/contributors.js +0 -2
  148. package/dist/git/providers/diff.d.ts +68 -66
  149. package/dist/git/providers/diff.js +0 -2
  150. package/dist/git/providers/graph.d.ts +73 -62
  151. package/dist/git/providers/graph.js +0 -2
  152. package/dist/git/providers/maintenance.d.ts +180 -178
  153. package/dist/git/providers/maintenance.js +0 -20
  154. package/dist/git/providers/operations.d.ts +114 -112
  155. package/dist/git/providers/operations.js +0 -2
  156. package/dist/git/providers/patch.d.ts +26 -24
  157. package/dist/git/providers/patch.js +0 -2
  158. package/dist/git/providers/pausedOperations.d.ts +19 -17
  159. package/dist/git/providers/pausedOperations.js +0 -2
  160. package/dist/git/providers/provider.d.ts +52 -50
  161. package/dist/git/providers/provider.js +0 -2
  162. package/dist/git/providers/refs.d.ts +42 -40
  163. package/dist/git/providers/refs.js +0 -2
  164. package/dist/git/providers/remotes.d.ts +24 -22
  165. package/dist/git/providers/remotes.js +0 -2
  166. package/dist/git/providers/revision.d.ts +25 -23
  167. package/dist/git/providers/revision.js +0 -2
  168. package/dist/git/providers/shared/remotes.d.ts +24 -22
  169. package/dist/git/providers/shared/remotes.js +52 -77
  170. package/dist/git/providers/shared/remotes.js.map +1 -1
  171. package/dist/git/providers/staging.d.ts +37 -35
  172. package/dist/git/providers/staging.js +0 -2
  173. package/dist/git/providers/stash.d.ts +38 -36
  174. package/dist/git/providers/stash.js +0 -2
  175. package/dist/git/providers/status.d.ts +32 -30
  176. package/dist/git/providers/status.js +0 -2
  177. package/dist/git/providers/tags.d.ts +20 -18
  178. package/dist/git/providers/tags.js +0 -2
  179. package/dist/git/providers/types.d.ts +19 -17
  180. package/dist/git/providers/types.js +0 -2
  181. package/dist/git/providers/worktrees.d.ts +26 -24
  182. package/dist/git/providers/worktrees.js +0 -2
  183. package/dist/git/remotes/azure-devops.d.ts +49 -38
  184. package/dist/git/remotes/azure-devops.js +254 -224
  185. package/dist/git/remotes/azure-devops.js.map +1 -1
  186. package/dist/git/remotes/bitbucket-server.d.ts +30 -29
  187. package/dist/git/remotes/bitbucket-server.js +141 -142
  188. package/dist/git/remotes/bitbucket-server.js.map +1 -1
  189. package/dist/git/remotes/bitbucket.d.ts +27 -26
  190. package/dist/git/remotes/bitbucket.js +114 -111
  191. package/dist/git/remotes/bitbucket.js.map +1 -1
  192. package/dist/git/remotes/custom.d.ts +26 -25
  193. package/dist/git/remotes/custom.js +130 -130
  194. package/dist/git/remotes/custom.js.map +1 -1
  195. package/dist/git/remotes/gerrit.d.ts +29 -28
  196. package/dist/git/remotes/gerrit.js +140 -143
  197. package/dist/git/remotes/gerrit.js.map +1 -1
  198. package/dist/git/remotes/gitea.d.ts +28 -27
  199. package/dist/git/remotes/gitea.js +141 -145
  200. package/dist/git/remotes/gitea.js.map +1 -1
  201. package/dist/git/remotes/github.d.ts +35 -34
  202. package/dist/git/remotes/github.js +196 -190
  203. package/dist/git/remotes/github.js.map +1 -1
  204. package/dist/git/remotes/gitlab.d.ts +31 -30
  205. package/dist/git/remotes/gitlab.js +245 -227
  206. package/dist/git/remotes/gitlab.js.map +1 -1
  207. package/dist/git/remotes/google-source.d.ts +16 -14
  208. package/dist/git/remotes/google-source.js +33 -31
  209. package/dist/git/remotes/google-source.js.map +1 -1
  210. package/dist/git/remotes/matcher.d.ts +16 -14
  211. package/dist/git/remotes/matcher.js +141 -124
  212. package/dist/git/remotes/matcher.js.map +1 -1
  213. package/dist/git/repositoryService.d.ts +47 -47
  214. package/dist/git/repositoryService.js +47 -44
  215. package/dist/git/repositoryService.js.map +1 -1
  216. package/dist/git/run.types.d.ts +91 -76
  217. package/dist/git/run.types.js +0 -2
  218. package/dist/git/service.d.ts +73 -71
  219. package/dist/git/service.js +286 -302
  220. package/dist/git/service.js.map +1 -1
  221. package/dist/git/utils/autolink.utils.d.ts +4 -2
  222. package/dist/git/utils/autolink.utils.js +103 -139
  223. package/dist/git/utils/autolink.utils.js.map +1 -1
  224. package/dist/git/utils/blame.utils.d.ts +22 -20
  225. package/dist/git/utils/blame.utils.js +196 -230
  226. package/dist/git/utils/blame.utils.js.map +1 -1
  227. package/dist/git/utils/branch.utils.d.ts +7 -9
  228. package/dist/git/utils/branch.utils.js +89 -115
  229. package/dist/git/utils/branch.utils.js.map +1 -1
  230. package/dist/git/utils/commit.utils.d.ts +10 -16
  231. package/dist/git/utils/commit.utils.js +28 -47
  232. package/dist/git/utils/commit.utils.js.map +1 -1
  233. package/dist/git/utils/config.utils.d.ts +2 -0
  234. package/dist/git/utils/config.utils.js +14 -5
  235. package/dist/git/utils/config.utils.js.map +1 -1
  236. package/dist/git/utils/conflictResolution.utils.d.ts +16 -13
  237. package/dist/git/utils/conflictResolution.utils.js +116 -113
  238. package/dist/git/utils/conflictResolution.utils.js.map +1 -1
  239. package/dist/git/utils/contributor.utils.d.ts +10 -8
  240. package/dist/git/utils/contributor.utils.js +47 -69
  241. package/dist/git/utils/contributor.utils.js.map +1 -1
  242. package/dist/git/utils/fetch.utils.d.ts +2 -0
  243. package/dist/git/utils/fetch.utils.js +33 -44
  244. package/dist/git/utils/fetch.utils.js.map +1 -1
  245. package/dist/git/utils/fileStatus.utils.d.ts +22 -21
  246. package/dist/git/utils/fileStatus.utils.js +59 -45
  247. package/dist/git/utils/fileStatus.utils.js.map +1 -1
  248. package/dist/git/utils/graph.utils.d.ts +19 -1
  249. package/dist/git/utils/graph.utils.js +60 -35
  250. package/dist/git/utils/graph.utils.js.map +1 -1
  251. package/dist/git/utils/issue.utils.d.ts +3 -1
  252. package/dist/git/utils/issue.utils.js +154 -149
  253. package/dist/git/utils/issue.utils.js.map +1 -1
  254. package/dist/git/utils/issueOrPullRequest.utils.d.ts +3 -1
  255. package/dist/git/utils/issueOrPullRequest.utils.js +23 -20
  256. package/dist/git/utils/issueOrPullRequest.utils.js.map +1 -1
  257. package/dist/git/utils/mergeConflicts.utils.d.ts +4 -1
  258. package/dist/git/utils/mergeConflicts.utils.js +28 -15
  259. package/dist/git/utils/mergeConflicts.utils.js.map +1 -1
  260. package/dist/git/utils/pausedOperationStatus.utils.d.ts +7 -42
  261. package/dist/git/utils/pausedOperationStatus.utils.js +83 -146
  262. package/dist/git/utils/pausedOperationStatus.utils.js.map +1 -1
  263. package/dist/git/utils/pullRequest.utils.d.ts +7 -5
  264. package/dist/git/utils/pullRequest.utils.js +180 -187
  265. package/dist/git/utils/pullRequest.utils.js.map +1 -1
  266. package/dist/git/utils/reachability.utils.d.ts +6 -6
  267. package/dist/git/utils/reachability.utils.js +120 -147
  268. package/dist/git/utils/reachability.utils.js.map +1 -1
  269. package/dist/git/utils/rebase.utils.d.ts +3 -1
  270. package/dist/git/utils/rebase.utils.js +87 -71
  271. package/dist/git/utils/rebase.utils.js.map +1 -1
  272. package/dist/git/utils/reference.utils.d.ts +33 -32
  273. package/dist/git/utils/reference.utils.js +152 -179
  274. package/dist/git/utils/reference.utils.js.map +1 -1
  275. package/dist/git/utils/remote.utils.d.ts +5 -3
  276. package/dist/git/utils/remote.utils.js +77 -116
  277. package/dist/git/utils/remote.utils.js.map +1 -1
  278. package/dist/git/utils/repository.utils.d.ts +3 -1
  279. package/dist/git/utils/repository.utils.js +12 -11
  280. package/dist/git/utils/repository.utils.js.map +1 -1
  281. package/dist/git/utils/resourceDescriptor.utils.d.ts +3 -1
  282. package/dist/git/utils/resourceDescriptor.utils.js +8 -14
  283. package/dist/git/utils/resourceDescriptor.utils.js.map +1 -1
  284. package/dist/git/utils/revision.utils.d.ts +11 -10
  285. package/dist/git/utils/revision.utils.js +69 -83
  286. package/dist/git/utils/revision.utils.js.map +1 -1
  287. package/dist/git/utils/search.utils.d.ts +5 -3
  288. package/dist/git/utils/search.utils.js +383 -522
  289. package/dist/git/utils/search.utils.js.map +1 -1
  290. package/dist/git/utils/sorting.d.ts +22 -20
  291. package/dist/git/utils/sorting.js +133 -227
  292. package/dist/git/utils/sorting.js.map +1 -1
  293. package/dist/git/utils/sshKey.utils.d.ts +2 -0
  294. package/dist/git/utils/sshKey.utils.js +10 -15
  295. package/dist/git/utils/sshKey.utils.js.map +1 -1
  296. package/dist/git/utils/status.utils.d.ts +20 -15
  297. package/dist/git/utils/status.utils.js +93 -79
  298. package/dist/git/utils/status.utils.js.map +1 -1
  299. package/dist/git/utils/statusFile.utils.d.ts +6 -4
  300. package/dist/git/utils/statusFile.utils.js +71 -72
  301. package/dist/git/utils/statusFile.utils.js.map +1 -1
  302. package/dist/git/utils/tag.utils.d.ts +4 -2
  303. package/dist/git/utils/tag.utils.js +10 -8
  304. package/dist/git/utils/tag.utils.js.map +1 -1
  305. package/dist/git/utils/tooltip.utils.d.ts +5 -2
  306. package/dist/git/utils/tooltip.utils.js +49 -24
  307. package/dist/git/utils/tooltip.utils.js.map +1 -1
  308. package/dist/git/utils/uriAuthority.d.ts +9 -7
  309. package/dist/git/utils/uriAuthority.js +19 -16
  310. package/dist/git/utils/uriAuthority.js.map +1 -1
  311. package/dist/git/utils/user.utils.d.ts +3 -1
  312. package/dist/git/utils/user.utils.js +6 -10
  313. package/dist/git/utils/user.utils.js.map +1 -1
  314. package/dist/git/utils/worktree.utils.d.ts +5 -3
  315. package/dist/git/utils/worktree.utils.js +14 -12
  316. package/dist/git/utils/worktree.utils.js.map +1 -1
  317. package/dist/git/watching/changeEvent.d.ts +38 -36
  318. package/dist/git/watching/changeEvent.js +60 -67
  319. package/dist/git/watching/changeEvent.js.map +1 -1
  320. package/dist/git/watching/classifyChange.d.ts +3 -1
  321. package/dist/git/watching/classifyChange.js +50 -79
  322. package/dist/git/watching/classifyChange.js.map +1 -1
  323. package/dist/git/watching/gitIgnoreFilter.d.ts +43 -41
  324. package/dist/git/watching/gitIgnoreFilter.js +92 -107
  325. package/dist/git/watching/gitIgnoreFilter.js.map +1 -1
  326. package/dist/git/watching/initWatcher.d.ts +22 -20
  327. package/dist/git/watching/initWatcher.js +58 -57
  328. package/dist/git/watching/initWatcher.js.map +1 -1
  329. package/dist/git/watching/provider.d.ts +8 -7
  330. package/dist/git/watching/provider.js +0 -2
  331. package/dist/git/watching/watchGroup.d.ts +29 -28
  332. package/dist/git/watching/watchGroup.js +105 -137
  333. package/dist/git/watching/watchGroup.js.map +1 -1
  334. package/dist/git/watching/watchService.d.ts +70 -68
  335. package/dist/git/watching/watchService.js +275 -339
  336. package/dist/git/watching/watchService.js.map +1 -1
  337. package/dist/git/watching/watchSession.d.ts +112 -111
  338. package/dist/git/watching/watchSession.js +260 -314
  339. package/dist/git/watching/watchSession.js.map +1 -1
  340. package/dist/git/watching/watcherPatterns.d.ts +4 -2
  341. package/dist/git/watching/watcherPatterns.js +21 -24
  342. package/dist/git/watching/watcherPatterns.js.map +1 -1
  343. package/dist/git-cli/cliGitProvider.d.ts +117 -114
  344. package/dist/git-cli/cliGitProvider.js +261 -283
  345. package/dist/git-cli/cliGitProvider.js.map +1 -1
  346. package/dist/git-cli/exec/eventLoopMonitor.d.ts +26 -0
  347. package/dist/git-cli/exec/eventLoopMonitor.js +61 -0
  348. package/dist/git-cli/exec/eventLoopMonitor.js.map +1 -0
  349. package/dist/git-cli/exec/exec.d.ts +3 -4
  350. package/dist/git-cli/exec/exec.errors.d.ts +2 -2
  351. package/dist/git-cli/exec/exec.errors.js +2 -2
  352. package/dist/git-cli/exec/exec.js +3 -3
  353. package/dist/git-cli/exec/exec.types.d.ts +2 -2
  354. package/dist/git-cli/exec/exec.types.js +0 -2
  355. package/dist/git-cli/exec/features.d.ts +2 -3
  356. package/dist/git-cli/exec/features.js +2 -2
  357. package/dist/git-cli/exec/git.d.ts +224 -205
  358. package/dist/git-cli/exec/git.js +834 -1042
  359. package/dist/git-cli/exec/git.js.map +1 -1
  360. package/dist/git-cli/exec/gitQueue.d.ts +51 -48
  361. package/dist/git-cli/exec/gitQueue.js +225 -260
  362. package/dist/git-cli/exec/gitQueue.js.map +1 -1
  363. package/dist/git-cli/exec/locator.d.ts +8 -6
  364. package/dist/git-cli/exec/locator.js +95 -121
  365. package/dist/git-cli/exec/locator.js.map +1 -1
  366. package/dist/git-cli/parsers/blameParser.d.ts +22 -20
  367. package/dist/git-cli/parsers/blameParser.js +238 -332
  368. package/dist/git-cli/parsers/blameParser.js.map +1 -1
  369. package/dist/git-cli/parsers/indexParser.d.ts +3 -1
  370. package/dist/git-cli/parsers/indexParser.js +146 -221
  371. package/dist/git-cli/parsers/indexParser.js.map +1 -1
  372. package/dist/git-cli/parsers/logParser.d.ts +103 -110
  373. package/dist/git-cli/parsers/logParser.js +998 -1199
  374. package/dist/git-cli/parsers/logParser.js.map +1 -1
  375. package/dist/git-cli/parsers/mergeTreeParser.d.ts +5 -3
  376. package/dist/git-cli/parsers/mergeTreeParser.js +28 -72
  377. package/dist/git-cli/parsers/mergeTreeParser.js.map +1 -1
  378. package/dist/git-cli/parsers/refParser.d.ts +5 -4
  379. package/dist/git-cli/parsers/refParser.js +92 -137
  380. package/dist/git-cli/parsers/refParser.js.map +1 -1
  381. package/dist/git-cli/parsers/reflogParser.d.ts +7 -6
  382. package/dist/git-cli/parsers/reflogParser.js +100 -173
  383. package/dist/git-cli/parsers/reflogParser.js.map +1 -1
  384. package/dist/git-cli/parsers/remoteParser.d.ts +4 -2
  385. package/dist/git-cli/parsers/remoteParser.js +74 -126
  386. package/dist/git-cli/parsers/remoteParser.js.map +1 -1
  387. package/dist/git-cli/parsers/shortlogParser.d.ts +4 -2
  388. package/dist/git-cli/parsers/shortlogParser.js +44 -49
  389. package/dist/git-cli/parsers/shortlogParser.js.map +1 -1
  390. package/dist/git-cli/parsers/signatureParser.d.ts +3 -1
  391. package/dist/git-cli/parsers/signatureParser.js +82 -124
  392. package/dist/git-cli/parsers/signatureParser.js.map +1 -1
  393. package/dist/git-cli/parsers/sshSignatureParser.d.ts +5 -3
  394. package/dist/git-cli/parsers/sshSignatureParser.js +55 -64
  395. package/dist/git-cli/parsers/sshSignatureParser.js.map +1 -1
  396. package/dist/git-cli/parsers/statusParser.d.ts +4 -2
  397. package/dist/git-cli/parsers/statusParser.js +148 -205
  398. package/dist/git-cli/parsers/statusParser.js.map +1 -1
  399. package/dist/git-cli/parsers/treeParser.d.ts +3 -1
  400. package/dist/git-cli/parsers/treeParser.js +57 -108
  401. package/dist/git-cli/parsers/treeParser.js.map +1 -1
  402. package/dist/git-cli/parsers/worktreeParser.d.ts +4 -3
  403. package/dist/git-cli/parsers/worktreeParser.js +76 -132
  404. package/dist/git-cli/parsers/worktreeParser.js.map +1 -1
  405. package/dist/git-cli/providers/blame.d.ts +25 -23
  406. package/dist/git-cli/providers/blame.js +404 -413
  407. package/dist/git-cli/providers/blame.js.map +1 -1
  408. package/dist/git-cli/providers/branches.d.ts +117 -116
  409. package/dist/git-cli/providers/branches.js +1132 -1468
  410. package/dist/git-cli/providers/branches.js.map +1 -1
  411. package/dist/git-cli/providers/commitFilesetUtils.d.ts +4 -2
  412. package/dist/git-cli/providers/commitFilesetUtils.js +36 -18
  413. package/dist/git-cli/providers/commitFilesetUtils.js.map +1 -1
  414. package/dist/git-cli/providers/commits.d.ts +58 -56
  415. package/dist/git-cli/providers/commits.js +1084 -1423
  416. package/dist/git-cli/providers/commits.js.map +1 -1
  417. package/dist/git-cli/providers/config.d.ts +129 -127
  418. package/dist/git-cli/providers/config.js +612 -831
  419. package/dist/git-cli/providers/config.js.map +1 -1
  420. package/dist/git-cli/providers/contributors.d.ts +29 -28
  421. package/dist/git-cli/providers/contributors.js +246 -351
  422. package/dist/git-cli/providers/contributors.js.map +1 -1
  423. package/dist/git-cli/providers/diff.d.ts +97 -94
  424. package/dist/git-cli/providers/diff.js +638 -845
  425. package/dist/git-cli/providers/diff.js.map +1 -1
  426. package/dist/git-cli/providers/graph.d.ts +66 -68
  427. package/dist/git-cli/providers/graph.js +1400 -1848
  428. package/dist/git-cli/providers/graph.js.map +1 -1
  429. package/dist/git-cli/providers/maintenance.d.ts +305 -303
  430. package/dist/git-cli/providers/maintenance.js +1526 -2078
  431. package/dist/git-cli/providers/maintenance.js.map +1 -1
  432. package/dist/git-cli/providers/operations.d.ts +96 -94
  433. package/dist/git-cli/providers/operations.js +664 -724
  434. package/dist/git-cli/providers/operations.js.map +1 -1
  435. package/dist/git-cli/providers/patch.d.ts +37 -35
  436. package/dist/git-cli/providers/patch.js +206 -307
  437. package/dist/git-cli/providers/patch.js.map +1 -1
  438. package/dist/git-cli/providers/pausedOperations.d.ts +30 -28
  439. package/dist/git-cli/providers/pausedOperations.js +475 -506
  440. package/dist/git-cli/providers/pausedOperations.js.map +1 -1
  441. package/dist/git-cli/providers/refs.d.ts +50 -48
  442. package/dist/git-cli/providers/refs.js +335 -479
  443. package/dist/git-cli/providers/refs.js.map +1 -1
  444. package/dist/git-cli/providers/remotes.d.ts +23 -21
  445. package/dist/git-cli/providers/remotes.js +71 -92
  446. package/dist/git-cli/providers/remotes.js.map +1 -1
  447. package/dist/git-cli/providers/revision.d.ts +27 -25
  448. package/dist/git-cli/providers/revision.js +288 -304
  449. package/dist/git-cli/providers/revision.js.map +1 -1
  450. package/dist/git-cli/providers/staging.d.ts +31 -29
  451. package/dist/git-cli/providers/staging.js +140 -189
  452. package/dist/git-cli/providers/staging.js.map +1 -1
  453. package/dist/git-cli/providers/stash.d.ts +44 -42
  454. package/dist/git-cli/providers/stash.js +288 -387
  455. package/dist/git-cli/providers/stash.js.map +1 -1
  456. package/dist/git-cli/providers/status.d.ts +61 -59
  457. package/dist/git-cli/providers/status.js +332 -453
  458. package/dist/git-cli/providers/status.js.map +1 -1
  459. package/dist/git-cli/providers/tags.d.ts +31 -29
  460. package/dist/git-cli/providers/tags.js +158 -215
  461. package/dist/git-cli/providers/tags.js.map +1 -1
  462. package/dist/git-cli/providers/worktrees.d.ts +35 -33
  463. package/dist/git-cli/providers/worktrees.js +178 -203
  464. package/dist/git-cli/providers/worktrees.js.map +1 -1
  465. package/dist/git-cli/service.d.ts +28 -26
  466. package/dist/git-cli/service.js +38 -40
  467. package/dist/git-cli/service.js.map +1 -1
  468. package/dist/ipc/discovery.d.ts +19 -17
  469. package/dist/ipc/discovery.js +104 -128
  470. package/dist/ipc/discovery.js.map +1 -1
  471. package/dist/ipc/ipcServer.d.ts +16 -14
  472. package/dist/ipc/ipcServer.js +139 -160
  473. package/dist/ipc/ipcServer.js.map +1 -1
  474. package/dist/plus/agents/agentCapabilities.d.ts +50 -37
  475. package/dist/plus/agents/agentCapabilities.js +138 -173
  476. package/dist/plus/agents/agentCapabilities.js.map +1 -1
  477. package/dist/plus/agents/providers/claudeCodeTranscript.d.ts +153 -151
  478. package/dist/plus/agents/providers/claudeCodeTranscript.js +605 -679
  479. package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -1
  480. package/dist/plus/agents/providers/gkAgentProvider.d.ts +237 -240
  481. package/dist/plus/agents/providers/gkAgentProvider.js +2162 -3334
  482. package/dist/plus/agents/providers/gkAgentProvider.js.map +1 -1
  483. package/dist/plus/agents/sanitizePrompt.d.ts +2 -0
  484. package/dist/plus/agents/sanitizePrompt.js +58 -91
  485. package/dist/plus/agents/sanitizePrompt.js.map +1 -1
  486. package/dist/plus/agents/stateMachine.d.ts +7 -5
  487. package/dist/plus/agents/stateMachine.js +135 -163
  488. package/dist/plus/agents/stateMachine.js.map +1 -1
  489. package/dist/plus/agents/types.d.ts +333 -336
  490. package/dist/plus/agents/types.js +48 -48
  491. package/dist/plus/agents/types.js.map +1 -1
  492. package/dist/plus/ai/constants.d.ts +3 -1
  493. package/dist/plus/ai/constants.js +88 -84
  494. package/dist/plus/ai/constants.js.map +1 -1
  495. package/dist/plus/ai/errors.d.ts +22 -18
  496. package/dist/plus/ai/errors.js +158 -138
  497. package/dist/plus/ai/errors.js.map +1 -1
  498. package/dist/plus/ai/models/conversation.d.ts +11 -9
  499. package/dist/plus/ai/models/conversation.js +30 -26
  500. package/dist/plus/ai/models/conversation.js.map +1 -1
  501. package/dist/plus/ai/models/model.d.ts +29 -27
  502. package/dist/plus/ai/models/model.js +663 -471
  503. package/dist/plus/ai/models/model.js.map +1 -1
  504. package/dist/plus/ai/models/promptTemplates.d.ts +56 -55
  505. package/dist/plus/ai/models/promptTemplates.js +0 -2
  506. package/dist/plus/ai/models/provider.d.ts +79 -77
  507. package/dist/plus/ai/models/provider.js +0 -2
  508. package/dist/plus/ai/models/results.d.ts +27 -21
  509. package/dist/plus/ai/models/results.js +0 -2
  510. package/dist/plus/ai/prompts.d.ts +4 -2
  511. package/dist/plus/ai/prompts.js +301 -190
  512. package/dist/plus/ai/prompts.js.map +1 -1
  513. package/dist/plus/ai/providers/anthropicProvider.d.ts +33 -32
  514. package/dist/plus/ai/providers/anthropicProvider.js +484 -381
  515. package/dist/plus/ai/providers/anthropicProvider.js.map +1 -1
  516. package/dist/plus/ai/providers/azureProvider.d.ts +18 -16
  517. package/dist/plus/ai/providers/azureProvider.js +53 -53
  518. package/dist/plus/ai/providers/azureProvider.js.map +1 -1
  519. package/dist/plus/ai/providers/context.d.ts +23 -20
  520. package/dist/plus/ai/providers/context.js +0 -2
  521. package/dist/plus/ai/providers/deepSeekProvider.d.ts +17 -15
  522. package/dist/plus/ai/providers/deepSeekProvider.js +45 -39
  523. package/dist/plus/ai/providers/deepSeekProvider.js.map +1 -1
  524. package/dist/plus/ai/providers/geminiProvider.d.ts +16 -14
  525. package/dist/plus/ai/providers/geminiProvider.js +316 -230
  526. package/dist/plus/ai/providers/geminiProvider.js.map +1 -1
  527. package/dist/plus/ai/providers/gitkrakenProvider.d.ts +22 -20
  528. package/dist/plus/ai/providers/gitkrakenProvider.js +165 -260
  529. package/dist/plus/ai/providers/gitkrakenProvider.js.map +1 -1
  530. package/dist/plus/ai/providers/huggingFaceProvider.d.ts +16 -14
  531. package/dist/plus/ai/providers/huggingFaceProvider.js +45 -46
  532. package/dist/plus/ai/providers/huggingFaceProvider.js.map +1 -1
  533. package/dist/plus/ai/providers/mistralProvider.d.ts +22 -20
  534. package/dist/plus/ai/providers/mistralProvider.js +263 -195
  535. package/dist/plus/ai/providers/mistralProvider.js.map +1 -1
  536. package/dist/plus/ai/providers/ollamaProvider.d.ts +26 -24
  537. package/dist/plus/ai/providers/ollamaProvider.js +156 -189
  538. package/dist/plus/ai/providers/ollamaProvider.js.map +1 -1
  539. package/dist/plus/ai/providers/openAICompatibleProvider.d.ts +18 -16
  540. package/dist/plus/ai/providers/openAICompatibleProvider.js +50 -50
  541. package/dist/plus/ai/providers/openAICompatibleProvider.js.map +1 -1
  542. package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts +187 -185
  543. package/dist/plus/ai/providers/openAICompatibleProviderBase.js +356 -475
  544. package/dist/plus/ai/providers/openAICompatibleProviderBase.js.map +1 -1
  545. package/dist/plus/ai/providers/openRouterProvider.d.ts +20 -19
  546. package/dist/plus/ai/providers/openRouterProvider.js +60 -65
  547. package/dist/plus/ai/providers/openRouterProvider.js.map +1 -1
  548. package/dist/plus/ai/providers/openaiProvider.d.ts +17 -15
  549. package/dist/plus/ai/providers/openaiProvider.js +35 -34
  550. package/dist/plus/ai/providers/openaiProvider.js.map +1 -1
  551. package/dist/plus/ai/providers/responseFormatCache.d.ts +4 -2
  552. package/dist/plus/ai/providers/responseFormatCache.js +21 -17
  553. package/dist/plus/ai/providers/responseFormatCache.js.map +1 -1
  554. package/dist/plus/ai/providers/xaiProvider.d.ts +16 -14
  555. package/dist/plus/ai/providers/xaiProvider.js +61 -46
  556. package/dist/plus/ai/providers/xaiProvider.js.map +1 -1
  557. package/dist/plus/ai/utils/ai.utils.d.ts +4 -2
  558. package/dist/plus/ai/utils/ai.utils.js +50 -77
  559. package/dist/plus/ai/utils/ai.utils.js.map +1 -1
  560. package/dist/plus/ai/utils/results.utils.d.ts +7 -5
  561. package/dist/plus/ai/utils/results.utils.js +235 -269
  562. package/dist/plus/ai/utils/results.utils.js.map +1 -1
  563. package/dist/plus/ai/utils/truncation.utils.d.ts +3 -2
  564. package/dist/plus/ai/utils/truncation.utils.js +242 -205
  565. package/dist/plus/ai/utils/truncation.utils.js.map +1 -1
  566. package/dist/plus/git-github/api/config.d.ts +58 -56
  567. package/dist/plus/git-github/api/config.js +15 -11
  568. package/dist/plus/git-github/api/config.js.map +1 -1
  569. package/dist/plus/git-github/api/github.d.ts +500 -497
  570. package/dist/plus/git-github/api/github.js +2326 -3121
  571. package/dist/plus/git-github/api/github.js.map +1 -1
  572. package/dist/plus/git-github/api/github.utils.d.ts +5 -3
  573. package/dist/plus/git-github/api/github.utils.js +24 -19
  574. package/dist/plus/git-github/api/github.utils.js.map +1 -1
  575. package/dist/plus/git-github/api/issueSearchQuery.d.ts +5 -3
  576. package/dist/plus/git-github/api/issueSearchQuery.js +204 -221
  577. package/dist/plus/git-github/api/issueSearchQuery.js.map +1 -1
  578. package/dist/plus/git-github/api/pullRequestSearchQuery.d.ts +6 -5
  579. package/dist/plus/git-github/api/pullRequestSearchQuery.js +89 -116
  580. package/dist/plus/git-github/api/pullRequestSearchQuery.js.map +1 -1
  581. package/dist/plus/git-github/api/token.d.ts +10 -8
  582. package/dist/plus/git-github/api/token.js +0 -2
  583. package/dist/plus/git-github/api/tokenUtils.d.ts +4 -2
  584. package/dist/plus/git-github/api/tokenUtils.js +14 -10
  585. package/dist/plus/git-github/api/tokenUtils.js.map +1 -1
  586. package/dist/plus/git-github/api/types.d.ts +94 -92
  587. package/dist/plus/git-github/api/types.js +0 -2
  588. package/dist/plus/git-github/context.d.ts +65 -63
  589. package/dist/plus/git-github/context.js +13 -9
  590. package/dist/plus/git-github/context.js.map +1 -1
  591. package/dist/plus/git-github/models.d.ts +182 -182
  592. package/dist/plus/git-github/models.js +199 -265
  593. package/dist/plus/git-github/models.js.map +1 -1
  594. package/dist/plus/git-github/providers/github/blame.d.ts +32 -31
  595. package/dist/plus/git-github/providers/github/blame.js +137 -150
  596. package/dist/plus/git-github/providers/github/blame.js.map +1 -1
  597. package/dist/plus/git-github/providers/github/branches.d.ts +42 -40
  598. package/dist/plus/git-github/providers/github/branches.js +199 -274
  599. package/dist/plus/git-github/providers/github/branches.js.map +1 -1
  600. package/dist/plus/git-github/providers/github/commits.d.ts +35 -33
  601. package/dist/plus/git-github/providers/github/commits.js +527 -606
  602. package/dist/plus/git-github/providers/github/commits.js.map +1 -1
  603. package/dist/plus/git-github/providers/github/config.d.ts +10 -8
  604. package/dist/plus/git-github/providers/github/config.js +35 -45
  605. package/dist/plus/git-github/providers/github/config.js.map +1 -1
  606. package/dist/plus/git-github/providers/github/contributors.d.ts +25 -24
  607. package/dist/plus/git-github/providers/github/contributors.js +174 -216
  608. package/dist/plus/git-github/providers/github/contributors.js.map +1 -1
  609. package/dist/plus/git-github/providers/github/diff.d.ts +34 -32
  610. package/dist/plus/git-github/providers/github/diff.js +154 -194
  611. package/dist/plus/git-github/providers/github/diff.js.map +1 -1
  612. package/dist/plus/git-github/providers/github/graph.d.ts +33 -31
  613. package/dist/plus/git-github/providers/github/graph.js +400 -452
  614. package/dist/plus/git-github/providers/github/graph.js.map +1 -1
  615. package/dist/plus/git-github/providers/github/refs.d.ts +33 -31
  616. package/dist/plus/git-github/providers/github/refs.js +97 -131
  617. package/dist/plus/git-github/providers/github/refs.js.map +1 -1
  618. package/dist/plus/git-github/providers/github/remotes.d.ts +8 -6
  619. package/dist/plus/git-github/providers/github/remotes.js +30 -35
  620. package/dist/plus/git-github/providers/github/remotes.js.map +1 -1
  621. package/dist/plus/git-github/providers/github/revision.d.ts +13 -11
  622. package/dist/plus/git-github/providers/github/revision.js +106 -129
  623. package/dist/plus/git-github/providers/github/revision.js.map +1 -1
  624. package/dist/plus/git-github/providers/github/status.d.ts +24 -22
  625. package/dist/plus/git-github/providers/github/status.js +49 -47
  626. package/dist/plus/git-github/providers/github/status.js.map +1 -1
  627. package/dist/plus/git-github/providers/github/tags.d.ts +21 -19
  628. package/dist/plus/git-github/providers/github/tags.js +78 -103
  629. package/dist/plus/git-github/providers/github/tags.js.map +1 -1
  630. package/dist/plus/git-github/providers/githubGitProvider.d.ts +67 -64
  631. package/dist/plus/git-github/providers/githubGitProvider.js +131 -128
  632. package/dist/plus/git-github/providers/githubGitProvider.js.map +1 -1
  633. package/dist/plus/git-github/providers/githubProvider.d.ts +46 -44
  634. package/dist/plus/git-github/providers/githubProvider.js +0 -2
  635. package/dist/plus/integrations/authentication/cloudIntegrationService.d.ts +29 -27
  636. package/dist/plus/integrations/authentication/cloudIntegrationService.js +173 -208
  637. package/dist/plus/integrations/authentication/cloudIntegrationService.js.map +1 -1
  638. package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts +126 -107
  639. package/dist/plus/integrations/authentication/configuredIntegrationService.js +399 -497
  640. package/dist/plus/integrations/authentication/configuredIntegrationService.js.map +1 -1
  641. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts +73 -72
  642. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js +153 -232
  643. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js.map +1 -1
  644. package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts +61 -59
  645. package/dist/plus/integrations/authentication/integrationAuthenticationService.js +100 -124
  646. package/dist/plus/integrations/authentication/integrationAuthenticationService.js.map +1 -1
  647. package/dist/plus/integrations/authentication/manualTokenProvider.d.ts +14 -12
  648. package/dist/plus/integrations/authentication/manualTokenProvider.js +26 -51
  649. package/dist/plus/integrations/authentication/manualTokenProvider.js.map +1 -1
  650. package/dist/plus/integrations/authentication/models.d.ts +102 -85
  651. package/dist/plus/integrations/authentication/models.js +55 -54
  652. package/dist/plus/integrations/authentication/models.js.map +1 -1
  653. package/dist/plus/integrations/authentication/rejectedTokenTracker.d.ts +19 -17
  654. package/dist/plus/integrations/authentication/rejectedTokenTracker.js +53 -51
  655. package/dist/plus/integrations/authentication/rejectedTokenTracker.js.map +1 -1
  656. package/dist/plus/integrations/collectionMetadata.d.ts +12 -10
  657. package/dist/plus/integrations/collectionMetadata.js +204 -254
  658. package/dist/plus/integrations/collectionMetadata.js.map +1 -1
  659. package/dist/plus/integrations/constants.d.ts +60 -34
  660. package/dist/plus/integrations/constants.js +157 -132
  661. package/dist/plus/integrations/constants.js.map +1 -1
  662. package/dist/plus/integrations/context.d.ts +253 -252
  663. package/dist/plus/integrations/context.js +0 -2
  664. package/dist/plus/integrations/errors.d.ts +26 -25
  665. package/dist/plus/integrations/errors.js +116 -140
  666. package/dist/plus/integrations/errors.js.map +1 -1
  667. package/dist/plus/integrations/index.d.ts +36 -40
  668. package/dist/plus/integrations/index.js +46 -57
  669. package/dist/plus/integrations/index.js.map +1 -1
  670. package/dist/plus/integrations/integrationService.d.ts +445 -440
  671. package/dist/plus/integrations/integrationService.js +1054 -1324
  672. package/dist/plus/integrations/integrationService.js.map +1 -1
  673. package/dist/plus/integrations/lite.d.ts +33 -31
  674. package/dist/plus/integrations/lite.js +84 -122
  675. package/dist/plus/integrations/lite.js.map +1 -1
  676. package/dist/plus/integrations/manager.d.ts +592 -580
  677. package/dist/plus/integrations/manager.js +0 -2
  678. package/dist/plus/integrations/models/gitHostIntegration.d.ts +420 -415
  679. package/dist/plus/integrations/models/gitHostIntegration.js +1180 -1293
  680. package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
  681. package/dist/plus/integrations/models/integration.d.ts +200 -190
  682. package/dist/plus/integrations/models/integration.js +577 -722
  683. package/dist/plus/integrations/models/integration.js.map +1 -1
  684. package/dist/plus/integrations/models/issueCache.d.ts +15 -13
  685. package/dist/plus/integrations/models/issueCache.js +9 -7
  686. package/dist/plus/integrations/models/issueCache.js.map +1 -1
  687. package/dist/plus/integrations/models/issueReads.d.ts +108 -85
  688. package/dist/plus/integrations/models/issueReads.js +0 -2
  689. package/dist/plus/integrations/models/issuesIntegration.d.ts +72 -71
  690. package/dist/plus/integrations/models/issuesIntegration.js +160 -186
  691. package/dist/plus/integrations/models/issuesIntegration.js.map +1 -1
  692. package/dist/plus/integrations/models/pullRequestReads.d.ts +9 -7
  693. package/dist/plus/integrations/models/pullRequestReads.js +0 -2
  694. package/dist/plus/integrations/providerFilters.d.ts +8 -20
  695. package/dist/plus/integrations/providerFilters.js +11 -7
  696. package/dist/plus/integrations/providerFilters.js.map +1 -1
  697. package/dist/plus/integrations/providers/accounts.d.ts +7 -5
  698. package/dist/plus/integrations/providers/accounts.js +21 -31
  699. package/dist/plus/integrations/providers/accounts.js.map +1 -1
  700. package/dist/plus/integrations/providers/apiClients.d.ts +13 -10
  701. package/dist/plus/integrations/providers/apiClients.js +51 -36
  702. package/dist/plus/integrations/providers/apiClients.js.map +1 -1
  703. package/dist/plus/integrations/providers/apiConfig.d.ts +31 -29
  704. package/dist/plus/integrations/providers/apiConfig.js +18 -16
  705. package/dist/plus/integrations/providers/apiConfig.js.map +1 -1
  706. package/dist/plus/integrations/providers/azure/azure.d.ts +69 -54
  707. package/dist/plus/integrations/providers/azure/azure.js +453 -515
  708. package/dist/plus/integrations/providers/azure/azure.js.map +1 -1
  709. package/dist/plus/integrations/providers/azure/models.d.ts +258 -229
  710. package/dist/plus/integrations/providers/azure/models.js +241 -203
  711. package/dist/plus/integrations/providers/azure/models.js.map +1 -1
  712. package/dist/plus/integrations/providers/azureDevOps.d.ts +132 -130
  713. package/dist/plus/integrations/providers/azureDevOps.js +775 -921
  714. package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
  715. package/dist/plus/integrations/providers/bitbucket/bitbucket.d.ts +50 -48
  716. package/dist/plus/integrations/providers/bitbucket/bitbucket.js +417 -585
  717. package/dist/plus/integrations/providers/bitbucket/bitbucket.js.map +1 -1
  718. package/dist/plus/integrations/providers/bitbucket/models.d.ts +179 -179
  719. package/dist/plus/integrations/providers/bitbucket/models.js +96 -144
  720. package/dist/plus/integrations/providers/bitbucket/models.js.map +1 -1
  721. package/dist/plus/integrations/providers/bitbucket-server/models.d.ts +111 -109
  722. package/dist/plus/integrations/providers/bitbucket-server/models.js +102 -121
  723. package/dist/plus/integrations/providers/bitbucket-server/models.js.map +1 -1
  724. package/dist/plus/integrations/providers/bitbucket-server.d.ts +79 -79
  725. package/dist/plus/integrations/providers/bitbucket-server.js +205 -241
  726. package/dist/plus/integrations/providers/bitbucket-server.js.map +1 -1
  727. package/dist/plus/integrations/providers/bitbucket.d.ts +80 -79
  728. package/dist/plus/integrations/providers/bitbucket.js +390 -477
  729. package/dist/plus/integrations/providers/bitbucket.js.map +1 -1
  730. package/dist/plus/integrations/providers/github/github.d.ts +5 -3
  731. package/dist/plus/integrations/providers/github/github.js +38 -45
  732. package/dist/plus/integrations/providers/github/github.js.map +1 -1
  733. package/dist/plus/integrations/providers/github/github.utils.d.ts +8 -5
  734. package/dist/plus/integrations/providers/github/github.utils.js +7 -4
  735. package/dist/plus/integrations/providers/github/github.utils.js.map +1 -1
  736. package/dist/plus/integrations/providers/github/models.d.ts +2 -3
  737. package/dist/plus/integrations/providers/github/models.js +2 -2
  738. package/dist/plus/integrations/providers/github.d.ts +174 -172
  739. package/dist/plus/integrations/providers/github.js +431 -523
  740. package/dist/plus/integrations/providers/github.js.map +1 -1
  741. package/dist/plus/integrations/providers/gitlab/gitlab.d.ts +67 -66
  742. package/dist/plus/integrations/providers/gitlab/gitlab.js +546 -757
  743. package/dist/plus/integrations/providers/gitlab/gitlab.js.map +1 -1
  744. package/dist/plus/integrations/providers/gitlab/gitlab.utils.d.ts +7 -5
  745. package/dist/plus/integrations/providers/gitlab/gitlab.utils.js +45 -46
  746. package/dist/plus/integrations/providers/gitlab/gitlab.utils.js.map +1 -1
  747. package/dist/plus/integrations/providers/gitlab/models.d.ts +109 -107
  748. package/dist/plus/integrations/providers/gitlab/models.js +74 -89
  749. package/dist/plus/integrations/providers/gitlab/models.js.map +1 -1
  750. package/dist/plus/integrations/providers/gitlab.d.ts +115 -114
  751. package/dist/plus/integrations/providers/gitlab.js +440 -528
  752. package/dist/plus/integrations/providers/gitlab.js.map +1 -1
  753. package/dist/plus/integrations/providers/issueSorts.d.ts +3 -1
  754. package/dist/plus/integrations/providers/issueSorts.js +66 -62
  755. package/dist/plus/integrations/providers/issueSorts.js.map +1 -1
  756. package/dist/plus/integrations/providers/jira-server.d.ts +90 -0
  757. package/dist/plus/integrations/providers/jira-server.js +322 -0
  758. package/dist/plus/integrations/providers/jira-server.js.map +1 -0
  759. package/dist/plus/integrations/providers/jira.d.ts +41 -39
  760. package/dist/plus/integrations/providers/jira.js +378 -440
  761. package/dist/plus/integrations/providers/jira.js.map +1 -1
  762. package/dist/plus/integrations/providers/jiraIssueByKey.d.ts +3 -1
  763. package/dist/plus/integrations/providers/jiraIssueByKey.js +85 -89
  764. package/dist/plus/integrations/providers/jiraIssueByKey.js.map +1 -1
  765. package/dist/plus/integrations/providers/linear.d.ts +63 -62
  766. package/dist/plus/integrations/providers/linear.js +315 -358
  767. package/dist/plus/integrations/providers/linear.js.map +1 -1
  768. package/dist/plus/integrations/providers/models.d.ts +514 -503
  769. package/dist/plus/integrations/providers/models.js +818 -856
  770. package/dist/plus/integrations/providers/models.js.map +1 -1
  771. package/dist/plus/integrations/providers/providerErrors.d.ts +35 -2
  772. package/dist/plus/integrations/providers/providerErrors.js +120 -81
  773. package/dist/plus/integrations/providers/providerErrors.js.map +1 -1
  774. package/dist/plus/integrations/providers/providersApi.d.ts +299 -271
  775. package/dist/plus/integrations/providers/providersApi.js +1048 -1001
  776. package/dist/plus/integrations/providers/providersApi.js.map +1 -1
  777. package/dist/plus/integrations/providers/pullRequestReviews.d.ts +21 -21
  778. package/dist/plus/integrations/providers/pullRequestReviews.js +64 -90
  779. package/dist/plus/integrations/providers/pullRequestReviews.js.map +1 -1
  780. package/dist/plus/integrations/providers/trello.d.ts +35 -34
  781. package/dist/plus/integrations/providers/trello.js +136 -143
  782. package/dist/plus/integrations/providers/trello.js.map +1 -1
  783. package/dist/plus/integrations/providers/utils/providerPaging.d.ts +4 -2
  784. package/dist/plus/integrations/providers/utils/providerPaging.js +131 -156
  785. package/dist/plus/integrations/providers/utils/providerPaging.js.map +1 -1
  786. package/dist/plus/integrations/providers/utils.d.ts +51 -50
  787. package/dist/plus/integrations/providers/utils.js +185 -296
  788. package/dist/plus/integrations/providers/utils.js.map +1 -1
  789. package/dist/plus/integrations/reads/broaden.d.ts +10 -8
  790. package/dist/plus/integrations/reads/broaden.js +320 -439
  791. package/dist/plus/integrations/reads/broaden.js.map +1 -1
  792. package/dist/plus/integrations/reads/context.d.ts +47 -45
  793. package/dist/plus/integrations/reads/context.js +0 -2
  794. package/dist/plus/integrations/reads/counts.d.ts +74 -72
  795. package/dist/plus/integrations/reads/counts.js +233 -314
  796. package/dist/plus/integrations/reads/counts.js.map +1 -1
  797. package/dist/plus/integrations/reads/cursors.d.ts +26 -24
  798. package/dist/plus/integrations/reads/cursors.js +80 -115
  799. package/dist/plus/integrations/reads/cursors.js.map +1 -1
  800. package/dist/plus/integrations/reads/drains.d.ts +24 -23
  801. package/dist/plus/integrations/reads/drains.js +225 -298
  802. package/dist/plus/integrations/reads/drains.js.map +1 -1
  803. package/dist/plus/integrations/reads/filters.d.ts +84 -80
  804. package/dist/plus/integrations/reads/filters.js +326 -414
  805. package/dist/plus/integrations/reads/filters.js.map +1 -1
  806. package/dist/plus/integrations/reads/hierarchy.d.ts +14 -12
  807. package/dist/plus/integrations/reads/hierarchy.js +248 -332
  808. package/dist/plus/integrations/reads/hierarchy.js.map +1 -1
  809. package/dist/plus/integrations/reads/hierarchy.utils.d.ts +11 -9
  810. package/dist/plus/integrations/reads/hierarchy.utils.js +109 -108
  811. package/dist/plus/integrations/reads/hierarchy.utils.js.map +1 -1
  812. package/dist/plus/integrations/reads/issueBatch.d.ts +28 -26
  813. package/dist/plus/integrations/reads/issueBatch.js +83 -85
  814. package/dist/plus/integrations/reads/issueBatch.js.map +1 -1
  815. package/dist/plus/integrations/reads/issueTracker.d.ts +42 -33
  816. package/dist/plus/integrations/reads/issueTracker.js +265 -386
  817. package/dist/plus/integrations/reads/issueTracker.js.map +1 -1
  818. package/dist/plus/integrations/reads/issues.d.ts +50 -47
  819. package/dist/plus/integrations/reads/issues.js +202 -331
  820. package/dist/plus/integrations/reads/issues.js.map +1 -1
  821. package/dist/plus/integrations/reads/ordering.d.ts +32 -30
  822. package/dist/plus/integrations/reads/ordering.js +47 -43
  823. package/dist/plus/integrations/reads/ordering.js.map +1 -1
  824. package/dist/plus/integrations/reads/paging.d.ts +59 -57
  825. package/dist/plus/integrations/reads/paging.js +244 -261
  826. package/dist/plus/integrations/reads/paging.js.map +1 -1
  827. package/dist/plus/integrations/reads/pullRequests.d.ts +37 -35
  828. package/dist/plus/integrations/reads/pullRequests.js +95 -148
  829. package/dist/plus/integrations/reads/pullRequests.js.map +1 -1
  830. package/dist/plus/integrations/reads/resolveRepository.d.ts +15 -13
  831. package/dist/plus/integrations/reads/resolveRepository.js +147 -229
  832. package/dist/plus/integrations/reads/resolveRepository.js.map +1 -1
  833. package/dist/plus/integrations/reads/searchIssues.d.ts +29 -27
  834. package/dist/plus/integrations/reads/searchIssues.js +104 -153
  835. package/dist/plus/integrations/reads/searchIssues.js.map +1 -1
  836. package/dist/plus/integrations/reads/searchPullRequests.d.ts +20 -18
  837. package/dist/plus/integrations/reads/searchPullRequests.js +91 -113
  838. package/dist/plus/integrations/reads/searchPullRequests.js.map +1 -1
  839. package/dist/plus/integrations/reads/sweeps.d.ts +6 -4
  840. package/dist/plus/integrations/reads/sweeps.js +143 -178
  841. package/dist/plus/integrations/reads/sweeps.js.map +1 -1
  842. package/dist/plus/integrations/reads/trackerIssue.d.ts +24 -16
  843. package/dist/plus/integrations/reads/trackerIssue.js +52 -49
  844. package/dist/plus/integrations/reads/trackerIssue.js.map +1 -1
  845. package/dist/plus/integrations/reads/warnings.d.ts +10 -7
  846. package/dist/plus/integrations/reads/warnings.js +264 -291
  847. package/dist/plus/integrations/reads/warnings.js.map +1 -1
  848. package/dist/plus/integrations/results.d.ts +201 -199
  849. package/dist/plus/integrations/results.js +105 -119
  850. package/dist/plus/integrations/results.js.map +1 -1
  851. package/dist/plus/integrations/telemetry.d.ts +7 -5
  852. package/dist/plus/integrations/telemetry.js +9 -9
  853. package/dist/plus/integrations/telemetry.js.map +1 -1
  854. package/dist/plus/integrations/utils/domain.utils.d.ts +21 -0
  855. package/dist/plus/integrations/utils/domain.utils.js +55 -22
  856. package/dist/plus/integrations/utils/domain.utils.js.map +1 -1
  857. package/dist/plus/integrations/utils/integration.utils.d.ts +30 -6
  858. package/dist/plus/integrations/utils/integration.utils.js +154 -161
  859. package/dist/plus/integrations/utils/integration.utils.js.map +1 -1
  860. package/dist/utils/array.d.ts +9 -7
  861. package/dist/utils/array.js +110 -126
  862. package/dist/utils/array.js.map +1 -1
  863. package/dist/utils/base64.d.ts +2 -2
  864. package/dist/utils/base64.js +2 -2
  865. package/dist/utils/brand.d.ts +4 -3
  866. package/dist/utils/brand.js +0 -2
  867. package/dist/utils/cancellation.d.ts +24 -24
  868. package/dist/utils/cancellation.js +152 -167
  869. package/dist/utils/cancellation.js.map +1 -1
  870. package/dist/utils/charCode.d.ts +31 -37
  871. package/dist/utils/charCode.js +41 -37
  872. package/dist/utils/charCode.js.map +1 -1
  873. package/dist/utils/coalescedRun.d.ts +10 -8
  874. package/dist/utils/coalescedRun.js +39 -41
  875. package/dist/utils/coalescedRun.js.map +1 -1
  876. package/dist/utils/color.d.ts +137 -135
  877. package/dist/utils/color.js +535 -660
  878. package/dist/utils/color.js.map +1 -1
  879. package/dist/utils/counter.d.ts +5 -3
  880. package/dist/utils/counter.js +19 -17
  881. package/dist/utils/counter.js.map +1 -1
  882. package/dist/utils/crypto.d.ts +2 -2
  883. package/dist/utils/crypto.js +2 -2
  884. package/dist/utils/date.d.ts +10 -9
  885. package/dist/utils/date.js +312 -350
  886. package/dist/utils/date.js.map +1 -1
  887. package/dist/utils/debounce.d.ts +45 -43
  888. package/dist/utils/debounce.js +175 -206
  889. package/dist/utils/debounce.js.map +1 -1
  890. package/dist/utils/decorators/debounce.d.ts +3 -1
  891. package/dist/utils/decorators/debounce.js +16 -19
  892. package/dist/utils/decorators/debounce.js.map +1 -1
  893. package/dist/utils/decorators/gate.d.ts +13 -11
  894. package/dist/utils/decorators/gate.js +97 -124
  895. package/dist/utils/decorators/gate.js.map +1 -1
  896. package/dist/utils/decorators/log.d.ts +25 -24
  897. package/dist/utils/decorators/log.js +166 -227
  898. package/dist/utils/decorators/log.js.map +1 -1
  899. package/dist/utils/decorators/memoize.d.ts +10 -8
  900. package/dist/utils/decorators/memoize.js +49 -57
  901. package/dist/utils/decorators/memoize.js.map +1 -1
  902. package/dist/utils/decorators/resolver.d.ts +2 -0
  903. package/dist/utils/decorators/resolver.js +64 -75
  904. package/dist/utils/decorators/resolver.js.map +1 -1
  905. package/dist/utils/decorators/sequentialize.d.ts +15 -14
  906. package/dist/utils/decorators/sequentialize.js +61 -80
  907. package/dist/utils/decorators/sequentialize.js.map +1 -1
  908. package/dist/utils/decorators/serializable.d.ts +2 -0
  909. package/dist/utils/decorators/serializable.js +30 -39
  910. package/dist/utils/decorators/serializable.js.map +1 -1
  911. package/dist/utils/dedupedAsyncCache.d.ts +23 -21
  912. package/dist/utils/dedupedAsyncCache.js +63 -66
  913. package/dist/utils/dedupedAsyncCache.js.map +1 -1
  914. package/dist/utils/diff.d.ts +2 -0
  915. package/dist/utils/diff.js +41 -51
  916. package/dist/utils/diff.js.map +1 -1
  917. package/dist/utils/disposable.d.ts +15 -13
  918. package/dist/utils/disposable.js +71 -80
  919. package/dist/utils/disposable.js.map +1 -1
  920. package/dist/utils/dom.d.ts +45 -0
  921. package/dist/utils/dom.js +106 -0
  922. package/dist/utils/dom.js.map +1 -0
  923. package/dist/utils/encoding.d.ts +2 -0
  924. package/dist/utils/encoding.js +7 -5
  925. package/dist/utils/encoding.js.map +1 -1
  926. package/dist/utils/env/browser/base64.d.ts +2 -0
  927. package/dist/utils/env/browser/base64.js +32 -34
  928. package/dist/utils/env/browser/base64.js.map +1 -1
  929. package/dist/utils/env/browser/crypto.d.ts +2 -0
  930. package/dist/utils/env/browser/crypto.js +17 -13
  931. package/dist/utils/env/browser/crypto.js.map +1 -1
  932. package/dist/utils/env/browser/fs.d.ts +2 -0
  933. package/dist/utils/env/browser/fs.js +6 -2
  934. package/dist/utils/env/browser/fs.js.map +1 -1
  935. package/dist/utils/env/browser/hex.d.ts +2 -0
  936. package/dist/utils/env/browser/hex.js +271 -29
  937. package/dist/utils/env/browser/hex.js.map +1 -1
  938. package/dist/utils/env/browser/hrtime.d.ts +2 -0
  939. package/dist/utils/env/browser/hrtime.js +17 -13
  940. package/dist/utils/env/browser/hrtime.js.map +1 -1
  941. package/dist/utils/env/browser/logScope.d.ts +3 -1
  942. package/dist/utils/env/browser/logScope.js +39 -43
  943. package/dist/utils/env/browser/logScope.js.map +1 -1
  944. package/dist/utils/env/browser/md5.d.ts +2 -0
  945. package/dist/utils/env/browser/md5.js +211 -184
  946. package/dist/utils/env/browser/md5.js.map +1 -1
  947. package/dist/utils/env/browser/platform.d.ts +3 -0
  948. package/dist/utils/env/browser/platform.js +11 -4
  949. package/dist/utils/env/browser/platform.js.map +1 -1
  950. package/dist/utils/env/node/base64.d.ts +2 -0
  951. package/dist/utils/env/node/base64.js +13 -11
  952. package/dist/utils/env/node/base64.js.map +1 -1
  953. package/dist/utils/env/node/crypto.d.ts +2 -0
  954. package/dist/utils/env/node/crypto.js +13 -9
  955. package/dist/utils/env/node/crypto.js.map +1 -1
  956. package/dist/utils/env/node/exec.d.ts +66 -65
  957. package/dist/utils/env/node/exec.js +255 -267
  958. package/dist/utils/env/node/exec.js.map +1 -1
  959. package/dist/utils/env/node/fs.d.ts +2 -0
  960. package/dist/utils/env/node/fs.js +7 -3
  961. package/dist/utils/env/node/fs.js.map +1 -1
  962. package/dist/utils/env/node/hex.d.ts +2 -0
  963. package/dist/utils/env/node/hex.js +10 -6
  964. package/dist/utils/env/node/hex.js.map +1 -1
  965. package/dist/utils/env/node/hrtime.d.ts +2 -2
  966. package/dist/utils/env/node/hrtime.js +2 -2
  967. package/dist/utils/env/node/logScope.d.ts +3 -1
  968. package/dist/utils/env/node/logScope.js +52 -42
  969. package/dist/utils/env/node/logScope.js.map +1 -1
  970. package/dist/utils/env/node/platform.d.ts +3 -0
  971. package/dist/utils/env/node/platform.js +11 -4
  972. package/dist/utils/env/node/platform.js.map +1 -1
  973. package/dist/utils/error.d.ts +8 -6
  974. package/dist/utils/error.js +16 -14
  975. package/dist/utils/error.js.map +1 -1
  976. package/dist/utils/event.d.ts +27 -25
  977. package/dist/utils/event.js +141 -170
  978. package/dist/utils/event.js.map +1 -1
  979. package/dist/utils/formatter.d.ts +15 -14
  980. package/dist/utils/formatter.js +96 -129
  981. package/dist/utils/formatter.js.map +1 -1
  982. package/dist/utils/fs.d.ts +2 -2
  983. package/dist/utils/fs.js +2 -2
  984. package/dist/utils/function.d.ts +5 -6
  985. package/dist/utils/function.js +73 -90
  986. package/dist/utils/function.js.map +1 -1
  987. package/dist/utils/fuzzy.d.ts +18 -16
  988. package/dist/utils/fuzzy.js +121 -127
  989. package/dist/utils/fuzzy.js.map +1 -1
  990. package/dist/utils/gitRefs.d.ts +11 -0
  991. package/dist/utils/gitRefs.js +21 -0
  992. package/dist/utils/gitRefs.js.map +1 -0
  993. package/dist/utils/hash.d.ts +2 -0
  994. package/dist/utils/hash.js +49 -47
  995. package/dist/utils/hash.js.map +1 -1
  996. package/dist/utils/hex.d.ts +2 -2
  997. package/dist/utils/hex.js +2 -2
  998. package/dist/utils/hostingServiceType.d.ts +8 -0
  999. package/dist/utils/hostingServiceType.js +0 -0
  1000. package/dist/utils/hrtime.d.ts +4 -2
  1001. package/dist/utils/hrtime.js +8 -5
  1002. package/dist/utils/hrtime.js.map +1 -1
  1003. package/dist/utils/iterable.d.ts +3 -1
  1004. package/dist/utils/iterable.js +591 -616
  1005. package/dist/utils/iterable.js.map +1 -1
  1006. package/dist/utils/keys/chord.d.ts +27 -25
  1007. package/dist/utils/keys/chord.js +108 -122
  1008. package/dist/utils/keys/chord.js.map +1 -1
  1009. package/dist/utils/keys/keybinding.d.ts +98 -22
  1010. package/dist/utils/keys/keybinding.js +151 -53
  1011. package/dist/utils/keys/keybinding.js.map +1 -1
  1012. package/dist/utils/keys/keymapDispatcher.d.ts +66 -0
  1013. package/dist/utils/keys/keymapDispatcher.js +187 -0
  1014. package/dist/utils/keys/keymapDispatcher.js.map +1 -0
  1015. package/dist/utils/lazy.d.ts +14 -12
  1016. package/dist/utils/lazy.js +35 -36
  1017. package/dist/utils/lazy.js.map +1 -1
  1018. package/dist/utils/loggable.d.ts +3 -1
  1019. package/dist/utils/loggable.js +6 -2
  1020. package/dist/utils/loggable.js.map +1 -1
  1021. package/dist/utils/logger.d.ts +48 -46
  1022. package/dist/utils/logger.js +219 -304
  1023. package/dist/utils/logger.js.map +1 -1
  1024. package/dist/utils/logger.scoped.d.ts +30 -28
  1025. package/dist/utils/logger.scoped.js +133 -147
  1026. package/dist/utils/logger.scoped.js.map +1 -1
  1027. package/dist/utils/lruMap.d.ts +34 -32
  1028. package/dist/utils/lruMap.js +97 -101
  1029. package/dist/utils/lruMap.js.map +1 -1
  1030. package/dist/utils/markdown.d.ts +5 -3
  1031. package/dist/utils/markdown.js +52 -88
  1032. package/dist/utils/markdown.js.map +1 -1
  1033. package/dist/utils/mru.d.ts +13 -11
  1034. package/dist/utils/mru.js +57 -62
  1035. package/dist/utils/mru.js.map +1 -1
  1036. package/dist/utils/object.d.ts +9 -34
  1037. package/dist/utils/object.js +132 -191
  1038. package/dist/utils/object.js.map +1 -1
  1039. package/dist/utils/paging.d.ts +36 -34
  1040. package/dist/utils/paging.js +42 -45
  1041. package/dist/utils/paging.js.map +1 -1
  1042. package/dist/utils/path.d.ts +4 -1
  1043. package/dist/utils/path.js +129 -162
  1044. package/dist/utils/path.js.map +1 -1
  1045. package/dist/utils/pausedOperation.d.ts +42 -0
  1046. package/dist/utils/pausedOperation.js +62 -0
  1047. package/dist/utils/pausedOperation.js.map +1 -0
  1048. package/dist/utils/platform.d.ts +2 -2
  1049. package/dist/utils/platform.js +2 -2
  1050. package/dist/utils/plural.d.ts +21 -0
  1051. package/dist/utils/plural.js +136 -0
  1052. package/dist/utils/plural.js.map +1 -0
  1053. package/dist/utils/promise.d.ts +19 -18
  1054. package/dist/utils/promise.js +323 -360
  1055. package/dist/utils/promise.js.map +1 -1
  1056. package/dist/utils/promiseCache.d.ts +331 -330
  1057. package/dist/utils/promiseCache.js +602 -717
  1058. package/dist/utils/promiseCache.js.map +1 -1
  1059. package/dist/utils/resourceUsage.d.ts +2 -0
  1060. package/dist/utils/resourceUsage.js +0 -2
  1061. package/dist/utils/searchTree.d.ts +51 -49
  1062. package/dist/utils/searchTree.js +306 -396
  1063. package/dist/utils/searchTree.js.map +1 -1
  1064. package/dist/utils/stopwatch.d.ts +33 -32
  1065. package/dist/utils/stopwatch.js +67 -81
  1066. package/dist/utils/stopwatch.js.map +1 -1
  1067. package/dist/utils/string.d.ts +17 -24
  1068. package/dist/utils/string.js +787 -803
  1069. package/dist/utils/string.js.map +1 -1
  1070. package/dist/utils/subscriptionManager.d.ts +15 -14
  1071. package/dist/utils/subscriptionManager.js +36 -33
  1072. package/dist/utils/subscriptionManager.js.map +1 -1
  1073. package/dist/utils/trie.d.ts +64 -62
  1074. package/dist/utils/trie.js +438 -580
  1075. package/dist/utils/trie.js.map +1 -1
  1076. package/dist/utils/types.d.ts +8 -16
  1077. package/dist/utils/types.js +0 -2
  1078. package/dist/utils/uri.d.ts +27 -25
  1079. package/dist/utils/uri.js +42 -42
  1080. package/dist/utils/uri.js.map +1 -1
  1081. package/dist/utils/validation.d.ts +13 -12
  1082. package/dist/utils/validation.js +17 -23
  1083. package/dist/utils/validation.js.map +1 -1
  1084. package/dist/utils/version.d.ts +6 -5
  1085. package/dist/utils/version.js +77 -104
  1086. package/dist/utils/version.js.map +1 -1
  1087. package/docs/integrations.md +101 -24
  1088. package/docs/kepler-read-api-parity.md +15 -12
  1089. package/package.json +18 -8
  1090. package/dist/git/cache.d.ts.map +0 -1
  1091. package/dist/git/context.d.ts.map +0 -1
  1092. package/dist/git/errors.d.ts.map +0 -1
  1093. package/dist/git/features.d.ts.map +0 -1
  1094. package/dist/git/gitHealth.d.ts.map +0 -1
  1095. package/dist/git/models/author.d.ts.map +0 -1
  1096. package/dist/git/models/author.js.map +0 -1
  1097. package/dist/git/models/autolink.d.ts.map +0 -1
  1098. package/dist/git/models/autolink.js.map +0 -1
  1099. package/dist/git/models/blame.d.ts.map +0 -1
  1100. package/dist/git/models/blame.js.map +0 -1
  1101. package/dist/git/models/branch.d.ts.map +0 -1
  1102. package/dist/git/models/commit.d.ts.map +0 -1
  1103. package/dist/git/models/contributor.d.ts.map +0 -1
  1104. package/dist/git/models/defaultBranch.d.ts.map +0 -1
  1105. package/dist/git/models/defaultBranch.js.map +0 -1
  1106. package/dist/git/models/diff.d.ts.map +0 -1
  1107. package/dist/git/models/diff.js.map +0 -1
  1108. package/dist/git/models/file.d.ts.map +0 -1
  1109. package/dist/git/models/file.js.map +0 -1
  1110. package/dist/git/models/fileChange.d.ts.map +0 -1
  1111. package/dist/git/models/fileStatus.d.ts.map +0 -1
  1112. package/dist/git/models/graph.d.ts.map +0 -1
  1113. package/dist/git/models/graphSearch.d.ts.map +0 -1
  1114. package/dist/git/models/graphSearch.js.map +0 -1
  1115. package/dist/git/models/graphSession.d.ts.map +0 -1
  1116. package/dist/git/models/issue.d.ts.map +0 -1
  1117. package/dist/git/models/issueOrPullRequest.d.ts.map +0 -1
  1118. package/dist/git/models/issueOrPullRequest.js.map +0 -1
  1119. package/dist/git/models/lineRange.d.ts.map +0 -1
  1120. package/dist/git/models/lineRange.js.map +0 -1
  1121. package/dist/git/models/log.d.ts.map +0 -1
  1122. package/dist/git/models/log.js.map +0 -1
  1123. package/dist/git/models/mergeConflicts.d.ts.map +0 -1
  1124. package/dist/git/models/mergeConflicts.js.map +0 -1
  1125. package/dist/git/models/patch.d.ts.map +0 -1
  1126. package/dist/git/models/patch.js.map +0 -1
  1127. package/dist/git/models/pausedOperationStatus.d.ts.map +0 -1
  1128. package/dist/git/models/pausedOperationStatus.js.map +0 -1
  1129. package/dist/git/models/pullRequest.d.ts.map +0 -1
  1130. package/dist/git/models/rebase.d.ts.map +0 -1
  1131. package/dist/git/models/rebase.js.map +0 -1
  1132. package/dist/git/models/reference.d.ts.map +0 -1
  1133. package/dist/git/models/reference.js.map +0 -1
  1134. package/dist/git/models/reflog.d.ts.map +0 -1
  1135. package/dist/git/models/remote.d.ts.map +0 -1
  1136. package/dist/git/models/remoteProvider.d.ts.map +0 -1
  1137. package/dist/git/models/remoteResource.d.ts.map +0 -1
  1138. package/dist/git/models/repository.d.ts.map +0 -1
  1139. package/dist/git/models/repositoryChangeEvent.d.ts.map +0 -1
  1140. package/dist/git/models/repositoryIdentities.d.ts.map +0 -1
  1141. package/dist/git/models/repositoryMetadata.d.ts.map +0 -1
  1142. package/dist/git/models/repositoryMetadata.js.map +0 -1
  1143. package/dist/git/models/resourceDescriptor.d.ts.map +0 -1
  1144. package/dist/git/models/resourceDescriptor.js.map +0 -1
  1145. package/dist/git/models/revision.d.ts.map +0 -1
  1146. package/dist/git/models/search.d.ts.map +0 -1
  1147. package/dist/git/models/shortlog.d.ts.map +0 -1
  1148. package/dist/git/models/shortlog.js.map +0 -1
  1149. package/dist/git/models/signature.d.ts.map +0 -1
  1150. package/dist/git/models/signature.js.map +0 -1
  1151. package/dist/git/models/staging.d.ts.map +0 -1
  1152. package/dist/git/models/staging.js.map +0 -1
  1153. package/dist/git/models/stash.d.ts.map +0 -1
  1154. package/dist/git/models/stash.js.map +0 -1
  1155. package/dist/git/models/status.d.ts.map +0 -1
  1156. package/dist/git/models/statusFile.d.ts.map +0 -1
  1157. package/dist/git/models/tag.d.ts.map +0 -1
  1158. package/dist/git/models/tree.d.ts.map +0 -1
  1159. package/dist/git/models/tree.js.map +0 -1
  1160. package/dist/git/models/user.d.ts.map +0 -1
  1161. package/dist/git/models/user.js.map +0 -1
  1162. package/dist/git/models/worktree.d.ts.map +0 -1
  1163. package/dist/git/parsers/diffParser.d.ts.map +0 -1
  1164. package/dist/git/parsers/rebaseTodoParser.d.ts.map +0 -1
  1165. package/dist/git/providers/blame.d.ts.map +0 -1
  1166. package/dist/git/providers/blame.js.map +0 -1
  1167. package/dist/git/providers/branches.d.ts.map +0 -1
  1168. package/dist/git/providers/branches.js.map +0 -1
  1169. package/dist/git/providers/commits.d.ts.map +0 -1
  1170. package/dist/git/providers/commits.js.map +0 -1
  1171. package/dist/git/providers/config.d.ts.map +0 -1
  1172. package/dist/git/providers/config.js.map +0 -1
  1173. package/dist/git/providers/contributors.d.ts.map +0 -1
  1174. package/dist/git/providers/contributors.js.map +0 -1
  1175. package/dist/git/providers/diff.d.ts.map +0 -1
  1176. package/dist/git/providers/diff.js.map +0 -1
  1177. package/dist/git/providers/graph.d.ts.map +0 -1
  1178. package/dist/git/providers/graph.js.map +0 -1
  1179. package/dist/git/providers/maintenance.d.ts.map +0 -1
  1180. package/dist/git/providers/maintenance.js.map +0 -1
  1181. package/dist/git/providers/operations.d.ts.map +0 -1
  1182. package/dist/git/providers/operations.js.map +0 -1
  1183. package/dist/git/providers/patch.d.ts.map +0 -1
  1184. package/dist/git/providers/patch.js.map +0 -1
  1185. package/dist/git/providers/pausedOperations.d.ts.map +0 -1
  1186. package/dist/git/providers/pausedOperations.js.map +0 -1
  1187. package/dist/git/providers/provider.d.ts.map +0 -1
  1188. package/dist/git/providers/provider.js.map +0 -1
  1189. package/dist/git/providers/refs.d.ts.map +0 -1
  1190. package/dist/git/providers/refs.js.map +0 -1
  1191. package/dist/git/providers/remotes.d.ts.map +0 -1
  1192. package/dist/git/providers/remotes.js.map +0 -1
  1193. package/dist/git/providers/revision.d.ts.map +0 -1
  1194. package/dist/git/providers/revision.js.map +0 -1
  1195. package/dist/git/providers/shared/remotes.d.ts.map +0 -1
  1196. package/dist/git/providers/staging.d.ts.map +0 -1
  1197. package/dist/git/providers/staging.js.map +0 -1
  1198. package/dist/git/providers/stash.d.ts.map +0 -1
  1199. package/dist/git/providers/stash.js.map +0 -1
  1200. package/dist/git/providers/status.d.ts.map +0 -1
  1201. package/dist/git/providers/status.js.map +0 -1
  1202. package/dist/git/providers/tags.d.ts.map +0 -1
  1203. package/dist/git/providers/tags.js.map +0 -1
  1204. package/dist/git/providers/types.d.ts.map +0 -1
  1205. package/dist/git/providers/types.js.map +0 -1
  1206. package/dist/git/providers/worktrees.d.ts.map +0 -1
  1207. package/dist/git/providers/worktrees.js.map +0 -1
  1208. package/dist/git/remotes/azure-devops.d.ts.map +0 -1
  1209. package/dist/git/remotes/bitbucket-server.d.ts.map +0 -1
  1210. package/dist/git/remotes/bitbucket.d.ts.map +0 -1
  1211. package/dist/git/remotes/custom.d.ts.map +0 -1
  1212. package/dist/git/remotes/gerrit.d.ts.map +0 -1
  1213. package/dist/git/remotes/gitea.d.ts.map +0 -1
  1214. package/dist/git/remotes/github.d.ts.map +0 -1
  1215. package/dist/git/remotes/gitlab.d.ts.map +0 -1
  1216. package/dist/git/remotes/google-source.d.ts.map +0 -1
  1217. package/dist/git/remotes/matcher.d.ts.map +0 -1
  1218. package/dist/git/repositoryService.d.ts.map +0 -1
  1219. package/dist/git/run.types.d.ts.map +0 -1
  1220. package/dist/git/run.types.js.map +0 -1
  1221. package/dist/git/service.d.ts.map +0 -1
  1222. package/dist/git/utils/autolink.utils.d.ts.map +0 -1
  1223. package/dist/git/utils/blame.utils.d.ts.map +0 -1
  1224. package/dist/git/utils/branch.utils.d.ts.map +0 -1
  1225. package/dist/git/utils/commit.utils.d.ts.map +0 -1
  1226. package/dist/git/utils/config.utils.d.ts.map +0 -1
  1227. package/dist/git/utils/conflictResolution.utils.d.ts.map +0 -1
  1228. package/dist/git/utils/contributor.utils.d.ts.map +0 -1
  1229. package/dist/git/utils/fetch.utils.d.ts.map +0 -1
  1230. package/dist/git/utils/fileStatus.utils.d.ts.map +0 -1
  1231. package/dist/git/utils/graph.utils.d.ts.map +0 -1
  1232. package/dist/git/utils/issue.utils.d.ts.map +0 -1
  1233. package/dist/git/utils/issueOrPullRequest.utils.d.ts.map +0 -1
  1234. package/dist/git/utils/mergeConflicts.utils.d.ts.map +0 -1
  1235. package/dist/git/utils/pausedOperationStatus.utils.d.ts.map +0 -1
  1236. package/dist/git/utils/pullRequest.utils.d.ts.map +0 -1
  1237. package/dist/git/utils/reachability.utils.d.ts.map +0 -1
  1238. package/dist/git/utils/rebase.utils.d.ts.map +0 -1
  1239. package/dist/git/utils/reference.utils.d.ts.map +0 -1
  1240. package/dist/git/utils/remote.utils.d.ts.map +0 -1
  1241. package/dist/git/utils/repository.utils.d.ts.map +0 -1
  1242. package/dist/git/utils/resourceDescriptor.utils.d.ts.map +0 -1
  1243. package/dist/git/utils/revision.utils.d.ts.map +0 -1
  1244. package/dist/git/utils/search.utils.d.ts.map +0 -1
  1245. package/dist/git/utils/sorting.d.ts.map +0 -1
  1246. package/dist/git/utils/sshKey.utils.d.ts.map +0 -1
  1247. package/dist/git/utils/status.utils.d.ts.map +0 -1
  1248. package/dist/git/utils/statusFile.utils.d.ts.map +0 -1
  1249. package/dist/git/utils/tag.utils.d.ts.map +0 -1
  1250. package/dist/git/utils/tooltip.utils.d.ts.map +0 -1
  1251. package/dist/git/utils/uriAuthority.d.ts.map +0 -1
  1252. package/dist/git/utils/user.utils.d.ts.map +0 -1
  1253. package/dist/git/utils/worktree.utils.d.ts.map +0 -1
  1254. package/dist/git/watching/changeEvent.d.ts.map +0 -1
  1255. package/dist/git/watching/classifyChange.d.ts.map +0 -1
  1256. package/dist/git/watching/gitIgnoreFilter.d.ts.map +0 -1
  1257. package/dist/git/watching/initWatcher.d.ts.map +0 -1
  1258. package/dist/git/watching/provider.d.ts.map +0 -1
  1259. package/dist/git/watching/provider.js.map +0 -1
  1260. package/dist/git/watching/watchGroup.d.ts.map +0 -1
  1261. package/dist/git/watching/watchService.d.ts.map +0 -1
  1262. package/dist/git/watching/watchSession.d.ts.map +0 -1
  1263. package/dist/git/watching/watcherPatterns.d.ts.map +0 -1
  1264. package/dist/git-cli/cliGitProvider.d.ts.map +0 -1
  1265. package/dist/git-cli/exec/exec.d.ts.map +0 -1
  1266. package/dist/git-cli/exec/exec.errors.d.ts.map +0 -1
  1267. package/dist/git-cli/exec/exec.errors.js.map +0 -1
  1268. package/dist/git-cli/exec/exec.js.map +0 -1
  1269. package/dist/git-cli/exec/exec.types.d.ts.map +0 -1
  1270. package/dist/git-cli/exec/exec.types.js.map +0 -1
  1271. package/dist/git-cli/exec/features.d.ts.map +0 -1
  1272. package/dist/git-cli/exec/features.js.map +0 -1
  1273. package/dist/git-cli/exec/git.d.ts.map +0 -1
  1274. package/dist/git-cli/exec/gitQueue.d.ts.map +0 -1
  1275. package/dist/git-cli/exec/locator.d.ts.map +0 -1
  1276. package/dist/git-cli/parsers/blameParser.d.ts.map +0 -1
  1277. package/dist/git-cli/parsers/indexParser.d.ts.map +0 -1
  1278. package/dist/git-cli/parsers/logParser.d.ts.map +0 -1
  1279. package/dist/git-cli/parsers/mergeTreeParser.d.ts.map +0 -1
  1280. package/dist/git-cli/parsers/refParser.d.ts.map +0 -1
  1281. package/dist/git-cli/parsers/reflogParser.d.ts.map +0 -1
  1282. package/dist/git-cli/parsers/remoteParser.d.ts.map +0 -1
  1283. package/dist/git-cli/parsers/shortlogParser.d.ts.map +0 -1
  1284. package/dist/git-cli/parsers/signatureParser.d.ts.map +0 -1
  1285. package/dist/git-cli/parsers/sshSignatureParser.d.ts.map +0 -1
  1286. package/dist/git-cli/parsers/statusParser.d.ts.map +0 -1
  1287. package/dist/git-cli/parsers/treeParser.d.ts.map +0 -1
  1288. package/dist/git-cli/parsers/worktreeParser.d.ts.map +0 -1
  1289. package/dist/git-cli/providers/blame.d.ts.map +0 -1
  1290. package/dist/git-cli/providers/branches.d.ts.map +0 -1
  1291. package/dist/git-cli/providers/commitFilesetUtils.d.ts.map +0 -1
  1292. package/dist/git-cli/providers/commits.d.ts.map +0 -1
  1293. package/dist/git-cli/providers/config.d.ts.map +0 -1
  1294. package/dist/git-cli/providers/contributors.d.ts.map +0 -1
  1295. package/dist/git-cli/providers/diff.d.ts.map +0 -1
  1296. package/dist/git-cli/providers/graph.d.ts.map +0 -1
  1297. package/dist/git-cli/providers/maintenance.d.ts.map +0 -1
  1298. package/dist/git-cli/providers/operations.d.ts.map +0 -1
  1299. package/dist/git-cli/providers/patch.d.ts.map +0 -1
  1300. package/dist/git-cli/providers/pausedOperations.d.ts.map +0 -1
  1301. package/dist/git-cli/providers/refs.d.ts.map +0 -1
  1302. package/dist/git-cli/providers/remotes.d.ts.map +0 -1
  1303. package/dist/git-cli/providers/revision.d.ts.map +0 -1
  1304. package/dist/git-cli/providers/staging.d.ts.map +0 -1
  1305. package/dist/git-cli/providers/stash.d.ts.map +0 -1
  1306. package/dist/git-cli/providers/status.d.ts.map +0 -1
  1307. package/dist/git-cli/providers/tags.d.ts.map +0 -1
  1308. package/dist/git-cli/providers/worktrees.d.ts.map +0 -1
  1309. package/dist/git-cli/service.d.ts.map +0 -1
  1310. package/dist/ipc/discovery.d.ts.map +0 -1
  1311. package/dist/ipc/ipcServer.d.ts.map +0 -1
  1312. package/dist/plus/agents/agentCapabilities.d.ts.map +0 -1
  1313. package/dist/plus/agents/providers/claudeCodeTranscript.d.ts.map +0 -1
  1314. package/dist/plus/agents/providers/gkAgentProvider.d.ts.map +0 -1
  1315. package/dist/plus/agents/sanitizePrompt.d.ts.map +0 -1
  1316. package/dist/plus/agents/stateMachine.d.ts.map +0 -1
  1317. package/dist/plus/agents/types.d.ts.map +0 -1
  1318. package/dist/plus/ai/constants.d.ts.map +0 -1
  1319. package/dist/plus/ai/errors.d.ts.map +0 -1
  1320. package/dist/plus/ai/models/conversation.d.ts.map +0 -1
  1321. package/dist/plus/ai/models/model.d.ts.map +0 -1
  1322. package/dist/plus/ai/models/promptTemplates.d.ts.map +0 -1
  1323. package/dist/plus/ai/models/promptTemplates.js.map +0 -1
  1324. package/dist/plus/ai/models/provider.d.ts.map +0 -1
  1325. package/dist/plus/ai/models/provider.js.map +0 -1
  1326. package/dist/plus/ai/models/results.d.ts.map +0 -1
  1327. package/dist/plus/ai/models/results.js.map +0 -1
  1328. package/dist/plus/ai/prompts.d.ts.map +0 -1
  1329. package/dist/plus/ai/providers/anthropicProvider.d.ts.map +0 -1
  1330. package/dist/plus/ai/providers/azureProvider.d.ts.map +0 -1
  1331. package/dist/plus/ai/providers/context.d.ts.map +0 -1
  1332. package/dist/plus/ai/providers/context.js.map +0 -1
  1333. package/dist/plus/ai/providers/deepSeekProvider.d.ts.map +0 -1
  1334. package/dist/plus/ai/providers/geminiProvider.d.ts.map +0 -1
  1335. package/dist/plus/ai/providers/gitkrakenProvider.d.ts.map +0 -1
  1336. package/dist/plus/ai/providers/huggingFaceProvider.d.ts.map +0 -1
  1337. package/dist/plus/ai/providers/mistralProvider.d.ts.map +0 -1
  1338. package/dist/plus/ai/providers/ollamaProvider.d.ts.map +0 -1
  1339. package/dist/plus/ai/providers/openAICompatibleProvider.d.ts.map +0 -1
  1340. package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts.map +0 -1
  1341. package/dist/plus/ai/providers/openRouterProvider.d.ts.map +0 -1
  1342. package/dist/plus/ai/providers/openaiProvider.d.ts.map +0 -1
  1343. package/dist/plus/ai/providers/responseFormatCache.d.ts.map +0 -1
  1344. package/dist/plus/ai/providers/xaiProvider.d.ts.map +0 -1
  1345. package/dist/plus/ai/utils/ai.utils.d.ts.map +0 -1
  1346. package/dist/plus/ai/utils/results.utils.d.ts.map +0 -1
  1347. package/dist/plus/ai/utils/truncation.utils.d.ts.map +0 -1
  1348. package/dist/plus/git-github/api/config.d.ts.map +0 -1
  1349. package/dist/plus/git-github/api/github.d.ts.map +0 -1
  1350. package/dist/plus/git-github/api/github.utils.d.ts.map +0 -1
  1351. package/dist/plus/git-github/api/issueSearchQuery.d.ts.map +0 -1
  1352. package/dist/plus/git-github/api/pullRequestSearchQuery.d.ts.map +0 -1
  1353. package/dist/plus/git-github/api/token.d.ts.map +0 -1
  1354. package/dist/plus/git-github/api/token.js.map +0 -1
  1355. package/dist/plus/git-github/api/tokenUtils.d.ts.map +0 -1
  1356. package/dist/plus/git-github/api/types.d.ts.map +0 -1
  1357. package/dist/plus/git-github/api/types.js.map +0 -1
  1358. package/dist/plus/git-github/context.d.ts.map +0 -1
  1359. package/dist/plus/git-github/models.d.ts.map +0 -1
  1360. package/dist/plus/git-github/providers/github/blame.d.ts.map +0 -1
  1361. package/dist/plus/git-github/providers/github/branches.d.ts.map +0 -1
  1362. package/dist/plus/git-github/providers/github/commits.d.ts.map +0 -1
  1363. package/dist/plus/git-github/providers/github/config.d.ts.map +0 -1
  1364. package/dist/plus/git-github/providers/github/contributors.d.ts.map +0 -1
  1365. package/dist/plus/git-github/providers/github/diff.d.ts.map +0 -1
  1366. package/dist/plus/git-github/providers/github/graph.d.ts.map +0 -1
  1367. package/dist/plus/git-github/providers/github/refs.d.ts.map +0 -1
  1368. package/dist/plus/git-github/providers/github/remotes.d.ts.map +0 -1
  1369. package/dist/plus/git-github/providers/github/revision.d.ts.map +0 -1
  1370. package/dist/plus/git-github/providers/github/status.d.ts.map +0 -1
  1371. package/dist/plus/git-github/providers/github/tags.d.ts.map +0 -1
  1372. package/dist/plus/git-github/providers/githubGitProvider.d.ts.map +0 -1
  1373. package/dist/plus/git-github/providers/githubProvider.d.ts.map +0 -1
  1374. package/dist/plus/git-github/providers/githubProvider.js.map +0 -1
  1375. package/dist/plus/integrations/authentication/cloudIntegrationService.d.ts.map +0 -1
  1376. package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts.map +0 -1
  1377. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts.map +0 -1
  1378. package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts.map +0 -1
  1379. package/dist/plus/integrations/authentication/manualTokenProvider.d.ts.map +0 -1
  1380. package/dist/plus/integrations/authentication/models.d.ts.map +0 -1
  1381. package/dist/plus/integrations/authentication/rejectedTokenTracker.d.ts.map +0 -1
  1382. package/dist/plus/integrations/collectionMetadata.d.ts.map +0 -1
  1383. package/dist/plus/integrations/constants.d.ts.map +0 -1
  1384. package/dist/plus/integrations/context.d.ts.map +0 -1
  1385. package/dist/plus/integrations/context.js.map +0 -1
  1386. package/dist/plus/integrations/errors.d.ts.map +0 -1
  1387. package/dist/plus/integrations/index.d.ts.map +0 -1
  1388. package/dist/plus/integrations/integrationService.d.ts.map +0 -1
  1389. package/dist/plus/integrations/lite.d.ts.map +0 -1
  1390. package/dist/plus/integrations/manager.d.ts.map +0 -1
  1391. package/dist/plus/integrations/manager.js.map +0 -1
  1392. package/dist/plus/integrations/models/gitHostIntegration.d.ts.map +0 -1
  1393. package/dist/plus/integrations/models/integration.d.ts.map +0 -1
  1394. package/dist/plus/integrations/models/issueCache.d.ts.map +0 -1
  1395. package/dist/plus/integrations/models/issueReads.d.ts.map +0 -1
  1396. package/dist/plus/integrations/models/issueReads.js.map +0 -1
  1397. package/dist/plus/integrations/models/issuesIntegration.d.ts.map +0 -1
  1398. package/dist/plus/integrations/models/pullRequestReads.d.ts.map +0 -1
  1399. package/dist/plus/integrations/models/pullRequestReads.js.map +0 -1
  1400. package/dist/plus/integrations/providerFilters.d.ts.map +0 -1
  1401. package/dist/plus/integrations/providers/accounts.d.ts.map +0 -1
  1402. package/dist/plus/integrations/providers/apiClients.d.ts.map +0 -1
  1403. package/dist/plus/integrations/providers/apiConfig.d.ts.map +0 -1
  1404. package/dist/plus/integrations/providers/azure/azure.d.ts.map +0 -1
  1405. package/dist/plus/integrations/providers/azure/models.d.ts.map +0 -1
  1406. package/dist/plus/integrations/providers/azureDevOps.d.ts.map +0 -1
  1407. package/dist/plus/integrations/providers/bitbucket/bitbucket.d.ts.map +0 -1
  1408. package/dist/plus/integrations/providers/bitbucket/models.d.ts.map +0 -1
  1409. package/dist/plus/integrations/providers/bitbucket-server/models.d.ts.map +0 -1
  1410. package/dist/plus/integrations/providers/bitbucket-server.d.ts.map +0 -1
  1411. package/dist/plus/integrations/providers/bitbucket.d.ts.map +0 -1
  1412. package/dist/plus/integrations/providers/github/github.d.ts.map +0 -1
  1413. package/dist/plus/integrations/providers/github/github.utils.d.ts.map +0 -1
  1414. package/dist/plus/integrations/providers/github/models.d.ts.map +0 -1
  1415. package/dist/plus/integrations/providers/github/models.js.map +0 -1
  1416. package/dist/plus/integrations/providers/github.d.ts.map +0 -1
  1417. package/dist/plus/integrations/providers/gitlab/gitlab.d.ts.map +0 -1
  1418. package/dist/plus/integrations/providers/gitlab/gitlab.utils.d.ts.map +0 -1
  1419. package/dist/plus/integrations/providers/gitlab/models.d.ts.map +0 -1
  1420. package/dist/plus/integrations/providers/gitlab.d.ts.map +0 -1
  1421. package/dist/plus/integrations/providers/issueSorts.d.ts.map +0 -1
  1422. package/dist/plus/integrations/providers/jira.d.ts.map +0 -1
  1423. package/dist/plus/integrations/providers/jiraIssueByKey.d.ts.map +0 -1
  1424. package/dist/plus/integrations/providers/linear.d.ts.map +0 -1
  1425. package/dist/plus/integrations/providers/models.d.ts.map +0 -1
  1426. package/dist/plus/integrations/providers/providerErrors.d.ts.map +0 -1
  1427. package/dist/plus/integrations/providers/providersApi.d.ts.map +0 -1
  1428. package/dist/plus/integrations/providers/pullRequestReviews.d.ts.map +0 -1
  1429. package/dist/plus/integrations/providers/trello.d.ts.map +0 -1
  1430. package/dist/plus/integrations/providers/utils/providerPaging.d.ts.map +0 -1
  1431. package/dist/plus/integrations/providers/utils.d.ts.map +0 -1
  1432. package/dist/plus/integrations/reads/broaden.d.ts.map +0 -1
  1433. package/dist/plus/integrations/reads/context.d.ts.map +0 -1
  1434. package/dist/plus/integrations/reads/context.js.map +0 -1
  1435. package/dist/plus/integrations/reads/counts.d.ts.map +0 -1
  1436. package/dist/plus/integrations/reads/cursors.d.ts.map +0 -1
  1437. package/dist/plus/integrations/reads/drains.d.ts.map +0 -1
  1438. package/dist/plus/integrations/reads/filters.d.ts.map +0 -1
  1439. package/dist/plus/integrations/reads/hierarchy.d.ts.map +0 -1
  1440. package/dist/plus/integrations/reads/hierarchy.utils.d.ts.map +0 -1
  1441. package/dist/plus/integrations/reads/issueBatch.d.ts.map +0 -1
  1442. package/dist/plus/integrations/reads/issueTracker.d.ts.map +0 -1
  1443. package/dist/plus/integrations/reads/issues.d.ts.map +0 -1
  1444. package/dist/plus/integrations/reads/ordering.d.ts.map +0 -1
  1445. package/dist/plus/integrations/reads/paging.d.ts.map +0 -1
  1446. package/dist/plus/integrations/reads/pullRequests.d.ts.map +0 -1
  1447. package/dist/plus/integrations/reads/resolveRepository.d.ts.map +0 -1
  1448. package/dist/plus/integrations/reads/searchIssues.d.ts.map +0 -1
  1449. package/dist/plus/integrations/reads/searchPullRequests.d.ts.map +0 -1
  1450. package/dist/plus/integrations/reads/sweeps.d.ts.map +0 -1
  1451. package/dist/plus/integrations/reads/trackerIssue.d.ts.map +0 -1
  1452. package/dist/plus/integrations/reads/warnings.d.ts.map +0 -1
  1453. package/dist/plus/integrations/results.d.ts.map +0 -1
  1454. package/dist/plus/integrations/telemetry.d.ts.map +0 -1
  1455. package/dist/plus/integrations/utils/domain.utils.d.ts.map +0 -1
  1456. package/dist/plus/integrations/utils/integration.utils.d.ts.map +0 -1
  1457. package/dist/utils/array.d.ts.map +0 -1
  1458. package/dist/utils/base64.d.ts.map +0 -1
  1459. package/dist/utils/base64.js.map +0 -1
  1460. package/dist/utils/brand.d.ts.map +0 -1
  1461. package/dist/utils/brand.js.map +0 -1
  1462. package/dist/utils/cancellation.d.ts.map +0 -1
  1463. package/dist/utils/charCode.d.ts.map +0 -1
  1464. package/dist/utils/coalescedRun.d.ts.map +0 -1
  1465. package/dist/utils/color.d.ts.map +0 -1
  1466. package/dist/utils/counter.d.ts.map +0 -1
  1467. package/dist/utils/crypto.d.ts.map +0 -1
  1468. package/dist/utils/crypto.js.map +0 -1
  1469. package/dist/utils/date.d.ts.map +0 -1
  1470. package/dist/utils/debounce.d.ts.map +0 -1
  1471. package/dist/utils/decorators/debounce.d.ts.map +0 -1
  1472. package/dist/utils/decorators/gate.d.ts.map +0 -1
  1473. package/dist/utils/decorators/log.d.ts.map +0 -1
  1474. package/dist/utils/decorators/memoize.d.ts.map +0 -1
  1475. package/dist/utils/decorators/resolver.d.ts.map +0 -1
  1476. package/dist/utils/decorators/sequentialize.d.ts.map +0 -1
  1477. package/dist/utils/decorators/serializable.d.ts.map +0 -1
  1478. package/dist/utils/dedupedAsyncCache.d.ts.map +0 -1
  1479. package/dist/utils/diff.d.ts.map +0 -1
  1480. package/dist/utils/disposable.d.ts.map +0 -1
  1481. package/dist/utils/encoding.d.ts.map +0 -1
  1482. package/dist/utils/env/browser/base64.d.ts.map +0 -1
  1483. package/dist/utils/env/browser/crypto.d.ts.map +0 -1
  1484. package/dist/utils/env/browser/fs.d.ts.map +0 -1
  1485. package/dist/utils/env/browser/hex.d.ts.map +0 -1
  1486. package/dist/utils/env/browser/hrtime.d.ts.map +0 -1
  1487. package/dist/utils/env/browser/logScope.d.ts.map +0 -1
  1488. package/dist/utils/env/browser/md5.d.ts.map +0 -1
  1489. package/dist/utils/env/browser/platform.d.ts.map +0 -1
  1490. package/dist/utils/env/node/base64.d.ts.map +0 -1
  1491. package/dist/utils/env/node/crypto.d.ts.map +0 -1
  1492. package/dist/utils/env/node/exec.d.ts.map +0 -1
  1493. package/dist/utils/env/node/fs.d.ts.map +0 -1
  1494. package/dist/utils/env/node/hex.d.ts.map +0 -1
  1495. package/dist/utils/env/node/hrtime.d.ts.map +0 -1
  1496. package/dist/utils/env/node/hrtime.js.map +0 -1
  1497. package/dist/utils/env/node/logScope.d.ts.map +0 -1
  1498. package/dist/utils/env/node/platform.d.ts.map +0 -1
  1499. package/dist/utils/error.d.ts.map +0 -1
  1500. package/dist/utils/event.d.ts.map +0 -1
  1501. package/dist/utils/formatter.d.ts.map +0 -1
  1502. package/dist/utils/fs.d.ts.map +0 -1
  1503. package/dist/utils/fs.js.map +0 -1
  1504. package/dist/utils/function.d.ts.map +0 -1
  1505. package/dist/utils/fuzzy.d.ts.map +0 -1
  1506. package/dist/utils/hash.d.ts.map +0 -1
  1507. package/dist/utils/hex.d.ts.map +0 -1
  1508. package/dist/utils/hex.js.map +0 -1
  1509. package/dist/utils/hrtime.d.ts.map +0 -1
  1510. package/dist/utils/iterable.d.ts.map +0 -1
  1511. package/dist/utils/keys/chord.d.ts.map +0 -1
  1512. package/dist/utils/keys/keybinding.d.ts.map +0 -1
  1513. package/dist/utils/lazy.d.ts.map +0 -1
  1514. package/dist/utils/loggable.d.ts.map +0 -1
  1515. package/dist/utils/logger.d.ts.map +0 -1
  1516. package/dist/utils/logger.scoped.d.ts.map +0 -1
  1517. package/dist/utils/lruMap.d.ts.map +0 -1
  1518. package/dist/utils/markdown.d.ts.map +0 -1
  1519. package/dist/utils/mru.d.ts.map +0 -1
  1520. package/dist/utils/object.d.ts.map +0 -1
  1521. package/dist/utils/paging.d.ts.map +0 -1
  1522. package/dist/utils/path.d.ts.map +0 -1
  1523. package/dist/utils/platform.d.ts.map +0 -1
  1524. package/dist/utils/platform.js.map +0 -1
  1525. package/dist/utils/promise.d.ts.map +0 -1
  1526. package/dist/utils/promiseCache.d.ts.map +0 -1
  1527. package/dist/utils/resourceUsage.d.ts.map +0 -1
  1528. package/dist/utils/resourceUsage.js.map +0 -1
  1529. package/dist/utils/searchTree.d.ts.map +0 -1
  1530. package/dist/utils/stopwatch.d.ts.map +0 -1
  1531. package/dist/utils/string.d.ts.map +0 -1
  1532. package/dist/utils/subscriptionManager.d.ts.map +0 -1
  1533. package/dist/utils/trie.d.ts.map +0 -1
  1534. package/dist/utils/types.d.ts.map +0 -1
  1535. package/dist/utils/types.js.map +0 -1
  1536. package/dist/utils/uri.d.ts.map +0 -1
  1537. package/dist/utils/validation.d.ts.map +0 -1
  1538. package/dist/utils/version.d.ts.map +0 -1
  1539. package/src/git/cache.ts +0 -1859
  1540. package/src/git/context.ts +0 -301
  1541. package/src/git/errors.ts +0 -1168
  1542. package/src/git/features.ts +0 -98
  1543. package/src/git/gitHealth.ts +0 -522
  1544. package/src/git/models/author.ts +0 -19
  1545. package/src/git/models/autolink.ts +0 -59
  1546. package/src/git/models/blame.ts +0 -46
  1547. package/src/git/models/branch.ts +0 -237
  1548. package/src/git/models/commit.ts +0 -673
  1549. package/src/git/models/contributor.ts +0 -84
  1550. package/src/git/models/defaultBranch.ts +0 -6
  1551. package/src/git/models/diff.ts +0 -74
  1552. package/src/git/models/file.ts +0 -29
  1553. package/src/git/models/fileChange.ts +0 -82
  1554. package/src/git/models/fileStatus.ts +0 -36
  1555. package/src/git/models/graph.ts +0 -444
  1556. package/src/git/models/graphSearch.ts +0 -53
  1557. package/src/git/models/graphSession.ts +0 -102
  1558. package/src/git/models/issue.ts +0 -258
  1559. package/src/git/models/issueOrPullRequest.ts +0 -20
  1560. package/src/git/models/lineRange.ts +0 -7
  1561. package/src/git/models/log.ts +0 -21
  1562. package/src/git/models/mergeConflicts.ts +0 -19
  1563. package/src/git/models/patch.ts +0 -25
  1564. package/src/git/models/pausedOperationStatus.ts +0 -63
  1565. package/src/git/models/pullRequest.ts +0 -353
  1566. package/src/git/models/rebase.ts +0 -60
  1567. package/src/git/models/reference.ts +0 -80
  1568. package/src/git/models/reflog.ts +0 -88
  1569. package/src/git/models/remote.ts +0 -100
  1570. package/src/git/models/remoteProvider.ts +0 -291
  1571. package/src/git/models/remoteResource.ts +0 -87
  1572. package/src/git/models/repository.ts +0 -510
  1573. package/src/git/models/repositoryChangeEvent.ts +0 -30
  1574. package/src/git/models/repositoryIdentities.ts +0 -99
  1575. package/src/git/models/repositoryMetadata.ts +0 -12
  1576. package/src/git/models/resourceDescriptor.ts +0 -28
  1577. package/src/git/models/revision.ts +0 -12
  1578. package/src/git/models/search.ts +0 -138
  1579. package/src/git/models/shortlog.ts +0 -6
  1580. package/src/git/models/signature.ts +0 -45
  1581. package/src/git/models/staging.ts +0 -27
  1582. package/src/git/models/stash.ts +0 -6
  1583. package/src/git/models/status.ts +0 -246
  1584. package/src/git/models/statusFile.ts +0 -131
  1585. package/src/git/models/tag.ts +0 -76
  1586. package/src/git/models/tree.ts +0 -10
  1587. package/src/git/models/user.ts +0 -7
  1588. package/src/git/models/worktree.ts +0 -160
  1589. package/src/git/parsers/diffParser.ts +0 -648
  1590. package/src/git/parsers/rebaseTodoParser.ts +0 -169
  1591. package/src/git/providers/blame.ts +0 -40
  1592. package/src/git/providers/branches.ts +0 -143
  1593. package/src/git/providers/commits.ts +0 -174
  1594. package/src/git/providers/config.ts +0 -167
  1595. package/src/git/providers/contributors.ts +0 -34
  1596. package/src/git/providers/diff.ts +0 -133
  1597. package/src/git/providers/graph.ts +0 -95
  1598. package/src/git/providers/maintenance.ts +0 -224
  1599. package/src/git/providers/operations.ts +0 -164
  1600. package/src/git/providers/patch.ts +0 -31
  1601. package/src/git/providers/pausedOperations.ts +0 -23
  1602. package/src/git/providers/provider.ts +0 -64
  1603. package/src/git/providers/refs.ts +0 -68
  1604. package/src/git/providers/remotes.ts +0 -33
  1605. package/src/git/providers/revision.ts +0 -32
  1606. package/src/git/providers/shared/remotes.ts +0 -95
  1607. package/src/git/providers/staging.ts +0 -36
  1608. package/src/git/providers/stash.ts +0 -51
  1609. package/src/git/providers/status.ts +0 -48
  1610. package/src/git/providers/tags.ts +0 -29
  1611. package/src/git/providers/types.ts +0 -33
  1612. package/src/git/providers/worktrees.ts +0 -37
  1613. package/src/git/remotes/azure-devops.ts +0 -307
  1614. package/src/git/remotes/bitbucket-server.ts +0 -189
  1615. package/src/git/remotes/bitbucket.ts +0 -142
  1616. package/src/git/remotes/custom.ts +0 -162
  1617. package/src/git/remotes/gerrit.ts +0 -186
  1618. package/src/git/remotes/gitea.ts +0 -184
  1619. package/src/git/remotes/github.ts +0 -236
  1620. package/src/git/remotes/gitlab.ts +0 -270
  1621. package/src/git/remotes/google-source.ts +0 -51
  1622. package/src/git/remotes/matcher.ts +0 -215
  1623. package/src/git/repositoryService.ts +0 -180
  1624. package/src/git/run.types.ts +0 -156
  1625. package/src/git/service.ts +0 -369
  1626. package/src/git/utils/autolink.utils.ts +0 -202
  1627. package/src/git/utils/blame.utils.ts +0 -298
  1628. package/src/git/utils/branch.utils.ts +0 -165
  1629. package/src/git/utils/commit.utils.ts +0 -89
  1630. package/src/git/utils/config.utils.ts +0 -8
  1631. package/src/git/utils/conflictResolution.utils.ts +0 -157
  1632. package/src/git/utils/contributor.utils.ts +0 -105
  1633. package/src/git/utils/fetch.utils.ts +0 -48
  1634. package/src/git/utils/fileStatus.utils.ts +0 -62
  1635. package/src/git/utils/graph.utils.ts +0 -46
  1636. package/src/git/utils/issue.utils.ts +0 -177
  1637. package/src/git/utils/issueOrPullRequest.utils.ts +0 -23
  1638. package/src/git/utils/mergeConflicts.utils.ts +0 -21
  1639. package/src/git/utils/pausedOperationStatus.utils.ts +0 -184
  1640. package/src/git/utils/pullRequest.utils.ts +0 -244
  1641. package/src/git/utils/reachability.utils.ts +0 -180
  1642. package/src/git/utils/rebase.utils.ts +0 -128
  1643. package/src/git/utils/reference.utils.ts +0 -267
  1644. package/src/git/utils/remote.utils.ts +0 -146
  1645. package/src/git/utils/repository.utils.ts +0 -18
  1646. package/src/git/utils/resourceDescriptor.utils.ts +0 -26
  1647. package/src/git/utils/revision.utils.ts +0 -149
  1648. package/src/git/utils/search.utils.ts +0 -624
  1649. package/src/git/utils/sorting.ts +0 -329
  1650. package/src/git/utils/sshKey.utils.ts +0 -30
  1651. package/src/git/utils/status.utils.ts +0 -115
  1652. package/src/git/utils/statusFile.utils.ts +0 -182
  1653. package/src/git/utils/tag.utils.ts +0 -17
  1654. package/src/git/utils/tooltip.utils.ts +0 -37
  1655. package/src/git/utils/uriAuthority.ts +0 -34
  1656. package/src/git/utils/user.utils.ts +0 -20
  1657. package/src/git/utils/worktree.utils.ts +0 -21
  1658. package/src/git/watching/changeEvent.ts +0 -95
  1659. package/src/git/watching/classifyChange.ts +0 -104
  1660. package/src/git/watching/gitIgnoreFilter.ts +0 -134
  1661. package/src/git/watching/initWatcher.ts +0 -81
  1662. package/src/git/watching/provider.ts +0 -24
  1663. package/src/git/watching/watchGroup.ts +0 -185
  1664. package/src/git/watching/watchService.ts +0 -430
  1665. package/src/git/watching/watchSession.ts +0 -439
  1666. package/src/git/watching/watcherPatterns.ts +0 -51
  1667. package/src/git-cli/cliGitProvider.ts +0 -461
  1668. package/src/git-cli/exec/exec.errors.ts +0 -1
  1669. package/src/git-cli/exec/exec.ts +0 -11
  1670. package/src/git-cli/exec/exec.types.ts +0 -8
  1671. package/src/git-cli/exec/features.ts +0 -2
  1672. package/src/git-cli/exec/git.ts +0 -1371
  1673. package/src/git-cli/exec/gitQueue.ts +0 -326
  1674. package/src/git-cli/exec/locator.ts +0 -157
  1675. package/src/git-cli/parsers/blameParser.ts +0 -374
  1676. package/src/git-cli/parsers/indexParser.ts +0 -192
  1677. package/src/git-cli/parsers/logParser.ts +0 -1365
  1678. package/src/git-cli/parsers/mergeTreeParser.ts +0 -22
  1679. package/src/git-cli/parsers/refParser.ts +0 -110
  1680. package/src/git-cli/parsers/reflogParser.ts +0 -153
  1681. package/src/git-cli/parsers/remoteParser.ts +0 -95
  1682. package/src/git-cli/parsers/shortlogParser.ts +0 -59
  1683. package/src/git-cli/parsers/signatureParser.ts +0 -162
  1684. package/src/git-cli/parsers/sshSignatureParser.ts +0 -85
  1685. package/src/git-cli/parsers/statusParser.ts +0 -209
  1686. package/src/git-cli/parsers/treeParser.ts +0 -61
  1687. package/src/git-cli/parsers/worktreeParser.ts +0 -111
  1688. package/src/git-cli/providers/blame.ts +0 -598
  1689. package/src/git-cli/providers/branches.ts +0 -1931
  1690. package/src/git-cli/providers/commitFilesetUtils.ts +0 -45
  1691. package/src/git-cli/providers/commits.ts +0 -1856
  1692. package/src/git-cli/providers/config.ts +0 -1025
  1693. package/src/git-cli/providers/contributors.ts +0 -360
  1694. package/src/git-cli/providers/diff.ts +0 -1172
  1695. package/src/git-cli/providers/graph.ts +0 -2237
  1696. package/src/git-cli/providers/maintenance.ts +0 -2599
  1697. package/src/git-cli/providers/operations.ts +0 -1016
  1698. package/src/git-cli/providers/patch.ts +0 -305
  1699. package/src/git-cli/providers/pausedOperations.ts +0 -670
  1700. package/src/git-cli/providers/refs.ts +0 -486
  1701. package/src/git-cli/providers/remotes.ts +0 -115
  1702. package/src/git-cli/providers/revision.ts +0 -383
  1703. package/src/git-cli/providers/staging.ts +0 -210
  1704. package/src/git-cli/providers/stash.ts +0 -577
  1705. package/src/git-cli/providers/status.ts +0 -568
  1706. package/src/git-cli/providers/tags.ts +0 -224
  1707. package/src/git-cli/providers/worktrees.ts +0 -285
  1708. package/src/git-cli/service.ts +0 -82
  1709. package/src/ipc/discovery.ts +0 -186
  1710. package/src/ipc/ipcServer.ts +0 -171
  1711. package/src/plus/agents/agentCapabilities.ts +0 -286
  1712. package/src/plus/agents/providers/claudeCodeTranscript.ts +0 -867
  1713. package/src/plus/agents/providers/gkAgentProvider.ts +0 -4036
  1714. package/src/plus/agents/sanitizePrompt.ts +0 -109
  1715. package/src/plus/agents/stateMachine.ts +0 -197
  1716. package/src/plus/agents/types.ts +0 -500
  1717. package/src/plus/ai/constants.ts +0 -121
  1718. package/src/plus/ai/errors.ts +0 -152
  1719. package/src/plus/ai/models/conversation.ts +0 -35
  1720. package/src/plus/ai/models/model.ts +0 -528
  1721. package/src/plus/ai/models/promptTemplates.ts +0 -171
  1722. package/src/plus/ai/models/provider.ts +0 -125
  1723. package/src/plus/ai/models/results.ts +0 -31
  1724. package/src/plus/ai/prompts.ts +0 -849
  1725. package/src/plus/ai/providers/anthropicProvider.ts +0 -458
  1726. package/src/plus/ai/providers/azureProvider.ts +0 -74
  1727. package/src/plus/ai/providers/context.ts +0 -29
  1728. package/src/plus/ai/providers/deepSeekProvider.ts +0 -46
  1729. package/src/plus/ai/providers/geminiProvider.ts +0 -245
  1730. package/src/plus/ai/providers/gitkrakenProvider.ts +0 -347
  1731. package/src/plus/ai/providers/huggingFaceProvider.ts +0 -64
  1732. package/src/plus/ai/providers/mistralProvider.ts +0 -243
  1733. package/src/plus/ai/providers/ollamaProvider.ts +0 -292
  1734. package/src/plus/ai/providers/openAICompatibleProvider.ts +0 -64
  1735. package/src/plus/ai/providers/openAICompatibleProviderBase.ts +0 -654
  1736. package/src/plus/ai/providers/openRouterProvider.ts +0 -101
  1737. package/src/plus/ai/providers/openaiProvider.ts +0 -47
  1738. package/src/plus/ai/providers/responseFormatCache.ts +0 -39
  1739. package/src/plus/ai/providers/xaiProvider.ts +0 -54
  1740. package/src/plus/ai/utils/ai.utils.ts +0 -95
  1741. package/src/plus/ai/utils/results.utils.ts +0 -407
  1742. package/src/plus/ai/utils/truncation.utils.ts +0 -296
  1743. package/src/plus/git-github/api/config.ts +0 -91
  1744. package/src/plus/git-github/api/github.ts +0 -5462
  1745. package/src/plus/git-github/api/github.utils.ts +0 -36
  1746. package/src/plus/git-github/api/issueSearchQuery.ts +0 -273
  1747. package/src/plus/git-github/api/pullRequestSearchQuery.ts +0 -154
  1748. package/src/plus/git-github/api/token.ts +0 -15
  1749. package/src/plus/git-github/api/tokenUtils.ts +0 -15
  1750. package/src/plus/git-github/api/types.ts +0 -197
  1751. package/src/plus/git-github/context.ts +0 -107
  1752. package/src/plus/git-github/models.ts +0 -623
  1753. package/src/plus/git-github/providers/github/blame.ts +0 -225
  1754. package/src/plus/git-github/providers/github/branches.ts +0 -401
  1755. package/src/plus/git-github/providers/github/commits.ts +0 -929
  1756. package/src/plus/git-github/providers/github/config.ts +0 -47
  1757. package/src/plus/git-github/providers/github/contributors.ts +0 -313
  1758. package/src/plus/git-github/providers/github/diff.ts +0 -281
  1759. package/src/plus/git-github/providers/github/graph.ts +0 -635
  1760. package/src/plus/git-github/providers/github/refs.ts +0 -172
  1761. package/src/plus/git-github/providers/github/remotes.ts +0 -44
  1762. package/src/plus/git-github/providers/github/revision.ts +0 -140
  1763. package/src/plus/git-github/providers/github/status.ts +0 -69
  1764. package/src/plus/git-github/providers/github/tags.ts +0 -148
  1765. package/src/plus/git-github/providers/githubGitProvider.ts +0 -168
  1766. package/src/plus/git-github/providers/githubProvider.ts +0 -65
  1767. package/src/plus/integrations/authentication/cloudIntegrationService.ts +0 -292
  1768. package/src/plus/integrations/authentication/configuredIntegrationService.ts +0 -656
  1769. package/src/plus/integrations/authentication/integrationAuthenticationProvider.ts +0 -385
  1770. package/src/plus/integrations/authentication/integrationAuthenticationService.ts +0 -148
  1771. package/src/plus/integrations/authentication/manualTokenProvider.ts +0 -79
  1772. package/src/plus/integrations/authentication/models.ts +0 -202
  1773. package/src/plus/integrations/authentication/rejectedTokenTracker.ts +0 -56
  1774. package/src/plus/integrations/collectionMetadata.ts +0 -325
  1775. package/src/plus/integrations/constants.ts +0 -190
  1776. package/src/plus/integrations/context.ts +0 -386
  1777. package/src/plus/integrations/errors.ts +0 -188
  1778. package/src/plus/integrations/index.ts +0 -231
  1779. package/src/plus/integrations/integrationService.ts +0 -2003
  1780. package/src/plus/integrations/lite.ts +0 -233
  1781. package/src/plus/integrations/manager.ts +0 -728
  1782. package/src/plus/integrations/models/gitHostIntegration.ts +0 -1862
  1783. package/src/plus/integrations/models/integration.ts +0 -1005
  1784. package/src/plus/integrations/models/issueCache.ts +0 -29
  1785. package/src/plus/integrations/models/issueReads.ts +0 -152
  1786. package/src/plus/integrations/models/issuesIntegration.ts +0 -248
  1787. package/src/plus/integrations/models/pullRequestReads.ts +0 -18
  1788. package/src/plus/integrations/providerFilters.ts +0 -36
  1789. package/src/plus/integrations/providers/accounts.ts +0 -38
  1790. package/src/plus/integrations/providers/apiClients.ts +0 -69
  1791. package/src/plus/integrations/providers/apiConfig.ts +0 -71
  1792. package/src/plus/integrations/providers/azure/azure.ts +0 -822
  1793. package/src/plus/integrations/providers/azure/models.ts +0 -621
  1794. package/src/plus/integrations/providers/azureDevOps.ts +0 -1346
  1795. package/src/plus/integrations/providers/bitbucket/bitbucket.ts +0 -904
  1796. package/src/plus/integrations/providers/bitbucket/models.ts +0 -446
  1797. package/src/plus/integrations/providers/bitbucket-server/models.ts +0 -283
  1798. package/src/plus/integrations/providers/bitbucket-server.ts +0 -445
  1799. package/src/plus/integrations/providers/bitbucket.ts +0 -793
  1800. package/src/plus/integrations/providers/github/github.ts +0 -64
  1801. package/src/plus/integrations/providers/github/github.utils.ts +0 -23
  1802. package/src/plus/integrations/providers/github/models.ts +0 -29
  1803. package/src/plus/integrations/providers/github.ts +0 -940
  1804. package/src/plus/integrations/providers/gitlab/gitlab.ts +0 -1320
  1805. package/src/plus/integrations/providers/gitlab/gitlab.utils.ts +0 -80
  1806. package/src/plus/integrations/providers/gitlab/models.ts +0 -271
  1807. package/src/plus/integrations/providers/gitlab.ts +0 -841
  1808. package/src/plus/integrations/providers/issueSorts.ts +0 -89
  1809. package/src/plus/integrations/providers/jira.ts +0 -596
  1810. package/src/plus/integrations/providers/jiraIssueByKey.ts +0 -155
  1811. package/src/plus/integrations/providers/linear.ts +0 -484
  1812. package/src/plus/integrations/providers/models.ts +0 -1816
  1813. package/src/plus/integrations/providers/providerErrors.ts +0 -115
  1814. package/src/plus/integrations/providers/providersApi.ts +0 -1881
  1815. package/src/plus/integrations/providers/pullRequestReviews.ts +0 -122
  1816. package/src/plus/integrations/providers/trello.ts +0 -208
  1817. package/src/plus/integrations/providers/utils/providerPaging.ts +0 -212
  1818. package/src/plus/integrations/providers/utils.ts +0 -419
  1819. package/src/plus/integrations/reads/broaden.ts +0 -704
  1820. package/src/plus/integrations/reads/context.ts +0 -99
  1821. package/src/plus/integrations/reads/counts.ts +0 -610
  1822. package/src/plus/integrations/reads/cursors.ts +0 -224
  1823. package/src/plus/integrations/reads/drains.ts +0 -420
  1824. package/src/plus/integrations/reads/filters.ts +0 -614
  1825. package/src/plus/integrations/reads/hierarchy.ts +0 -486
  1826. package/src/plus/integrations/reads/hierarchy.utils.ts +0 -155
  1827. package/src/plus/integrations/reads/issueBatch.ts +0 -197
  1828. package/src/plus/integrations/reads/issueTracker.ts +0 -556
  1829. package/src/plus/integrations/reads/issues.ts +0 -600
  1830. package/src/plus/integrations/reads/ordering.ts +0 -124
  1831. package/src/plus/integrations/reads/paging.ts +0 -379
  1832. package/src/plus/integrations/reads/pullRequests.ts +0 -260
  1833. package/src/plus/integrations/reads/resolveRepository.ts +0 -272
  1834. package/src/plus/integrations/reads/searchIssues.ts +0 -274
  1835. package/src/plus/integrations/reads/searchPullRequests.ts +0 -235
  1836. package/src/plus/integrations/reads/sweeps.ts +0 -266
  1837. package/src/plus/integrations/reads/trackerIssue.ts +0 -105
  1838. package/src/plus/integrations/reads/warnings.ts +0 -535
  1839. package/src/plus/integrations/results.ts +0 -443
  1840. package/src/plus/integrations/telemetry.ts +0 -29
  1841. package/src/plus/integrations/utils/domain.utils.ts +0 -26
  1842. package/src/plus/integrations/utils/integration.utils.ts +0 -215
  1843. package/src/utils/array.ts +0 -194
  1844. package/src/utils/base64.ts +0 -1
  1845. package/src/utils/brand.ts +0 -7
  1846. package/src/utils/cancellation.ts +0 -199
  1847. package/src/utils/charCode.ts +0 -38
  1848. package/src/utils/coalescedRun.ts +0 -45
  1849. package/src/utils/color.ts +0 -817
  1850. package/src/utils/counter.ts +0 -21
  1851. package/src/utils/crypto.ts +0 -1
  1852. package/src/utils/date.ts +0 -474
  1853. package/src/utils/debounce.ts +0 -303
  1854. package/src/utils/decorators/debounce.ts +0 -31
  1855. package/src/utils/decorators/gate.ts +0 -167
  1856. package/src/utils/decorators/log.ts +0 -320
  1857. package/src/utils/decorators/memoize.ts +0 -98
  1858. package/src/utils/decorators/resolver.ts +0 -95
  1859. package/src/utils/decorators/sequentialize.ts +0 -118
  1860. package/src/utils/decorators/serializable.ts +0 -43
  1861. package/src/utils/dedupedAsyncCache.ts +0 -74
  1862. package/src/utils/diff.ts +0 -61
  1863. package/src/utils/disposable.ts +0 -156
  1864. package/src/utils/encoding.ts +0 -8
  1865. package/src/utils/env/browser/base64.ts +0 -50
  1866. package/src/utils/env/browser/crypto.ts +0 -21
  1867. package/src/utils/env/browser/fs.ts +0 -3
  1868. package/src/utils/env/browser/hex.ts +0 -41
  1869. package/src/utils/env/browser/hrtime.ts +0 -14
  1870. package/src/utils/env/browser/logScope.ts +0 -57
  1871. package/src/utils/env/browser/md5.ts +0 -217
  1872. package/src/utils/env/browser/platform.ts +0 -10
  1873. package/src/utils/env/node/base64.ts +0 -19
  1874. package/src/utils/env/node/crypto.ts +0 -17
  1875. package/src/utils/env/node/exec.ts +0 -488
  1876. package/src/utils/env/node/fs.ts +0 -5
  1877. package/src/utils/env/node/hex.ts +0 -11
  1878. package/src/utils/env/node/hrtime.ts +0 -1
  1879. package/src/utils/env/node/logScope.ts +0 -63
  1880. package/src/utils/env/node/platform.ts +0 -5
  1881. package/src/utils/error.ts +0 -18
  1882. package/src/utils/event.ts +0 -230
  1883. package/src/utils/formatter.ts +0 -198
  1884. package/src/utils/fs.ts +0 -1
  1885. package/src/utils/function.ts +0 -141
  1886. package/src/utils/fuzzy.ts +0 -185
  1887. package/src/utils/hash.ts +0 -60
  1888. package/src/utils/hex.ts +0 -1
  1889. package/src/utils/hrtime.ts +0 -8
  1890. package/src/utils/iterable.ts +0 -797
  1891. package/src/utils/keys/chord.ts +0 -184
  1892. package/src/utils/keys/keybinding.ts +0 -116
  1893. package/src/utils/lazy.ts +0 -39
  1894. package/src/utils/loggable.ts +0 -7
  1895. package/src/utils/logger.scoped.ts +0 -237
  1896. package/src/utils/logger.ts +0 -403
  1897. package/src/utils/lruMap.ts +0 -112
  1898. package/src/utils/markdown.ts +0 -115
  1899. package/src/utils/mru.ts +0 -68
  1900. package/src/utils/object.ts +0 -278
  1901. package/src/utils/paging.ts +0 -97
  1902. package/src/utils/path.ts +0 -204
  1903. package/src/utils/platform.ts +0 -1
  1904. package/src/utils/promise.ts +0 -657
  1905. package/src/utils/promiseCache.ts +0 -908
  1906. package/src/utils/resourceUsage.ts +0 -5
  1907. package/src/utils/searchTree.ts +0 -444
  1908. package/src/utils/stopwatch.ts +0 -125
  1909. package/src/utils/string.ts +0 -1003
  1910. package/src/utils/subscriptionManager.ts +0 -40
  1911. package/src/utils/trie.ts +0 -740
  1912. package/src/utils/types.ts +0 -31
  1913. package/src/utils/uri.ts +0 -118
  1914. package/src/utils/validation.ts +0 -38
  1915. package/src/utils/version.ts +0 -128
@@ -1,1470 +1,1134 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
8
- if (value !== null && value !== void 0) {
9
- if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
10
- var dispose, inner;
11
- if (async) {
12
- if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
13
- dispose = value[Symbol.asyncDispose];
14
- }
15
- if (dispose === void 0) {
16
- if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
17
- dispose = value[Symbol.dispose];
18
- if (async) inner = dispose;
19
- }
20
- if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
21
- if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
22
- env.stack.push({ value: value, dispose: dispose, async: async });
23
- }
24
- else if (async) {
25
- env.stack.push({ async: true });
26
- }
27
- return value;
28
- };
29
- var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
30
- return function (env) {
31
- function fail(e) {
32
- env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
33
- env.hasError = true;
34
- }
35
- var r, s = 0;
36
- function next() {
37
- while (r = env.stack.pop()) {
38
- try {
39
- if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
40
- if (r.dispose) {
41
- var result = r.dispose.call(r.value);
42
- if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
43
- }
44
- else s |= 1;
45
- }
46
- catch (e) {
47
- fail(e);
48
- }
49
- }
50
- if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
51
- if (env.hasError) throw env.error;
52
- }
53
- return next();
54
- };
55
- })(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
56
- var e = new Error(message);
57
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
58
- });
59
- import { BranchError } from '../../git/errors.js';
60
- import { GitBranch } from '../../git/models/branch.js';
61
- import { formatDetachedHeadName, getBranchId, getLocalBranchByUpstream, isDetachedHead, isRemoteHEAD, parseRefName, parseUpstream, } from '../../git/utils/branch.utils.js';
62
- import { createConflictDetectionError } from '../../git/utils/mergeConflicts.utils.js';
63
- import { createReference } from '../../git/utils/reference.utils.js';
64
- import { createRevisionRange, shortenRevision } from '../../git/utils/revision.utils.js';
65
- import { sortBranches, sortContributors } from '../../git/utils/sorting.js';
66
- import { ensureArray, filterMap } from '../../utils/array.js';
67
- import { CancellationError, isCancellationError } from '../../utils/cancellation.js';
68
- import { debounce } from '../../utils/decorators/debounce.js';
69
- import { debug } from '../../utils/decorators/log.js';
70
- import { Logger } from '../../utils/logger.js';
71
- import { getScopedLogger } from '../../utils/logger.scoped.js';
72
- import { emptyPagedResult, PageableResult } from '../../utils/paging.js';
73
- import { normalizePath } from '../../utils/path.js';
74
- import { getSettledValue } from '../../utils/promise.js';
75
- import { maybeStopWatch } from '../../utils/stopwatch.js';
76
- import { getGitCommandError, gitConfigsBranch, gitConfigsLog, GitError, GitErrors, GitWarnings } from '../exec/git.js';
77
- import { parseMergeTreeConflict } from '../parsers/mergeTreeParser.js';
1
+ import { ensureArray, filterMap } from "../../utils/array.js";
2
+ import { CancellationError, isCancellationError } from "../../utils/cancellation.js";
3
+ import { Logger as _logger } from "../../utils/logger.js";
4
+ import { getScopedLogger } from "../../utils/logger.scoped.js";
5
+ import { getSettledValue } from "../../utils/promise.js";
6
+ import { debug } from "../../utils/decorators/log.js";
7
+ import { getBranchId } from "../../utils/gitRefs.js";
8
+ import { normalizePath } from "../../utils/path.js";
9
+ import { createRevisionRange, shortenRevision } from "../../git/utils/revision.utils.js";
10
+ import { createReference } from "../../git/utils/reference.utils.js";
11
+ import __decorate from "../../_virtual/@oxc-project+runtime/helpers/esm/decorate.js";
12
+ import { BranchError, GitWarnings } from "../../git/errors.js";
13
+ import { GitError, GitErrors, getGitCommandError, gitConfigsBranch, gitConfigsLog } from "../exec/git.js";
14
+ import { maybeStopWatch } from "../../utils/stopwatch.js";
15
+ import _usingCtx from "../../_virtual/@oxc-project+runtime/helpers/esm/usingCtx.js";
16
+ import { formatDetachedHeadName, getLocalBranchByUpstream, isDetachedHead, isRemoteHEAD, parseRefName, parseUpstream } from "../../git/utils/branch.utils.js";
17
+ import { GitBranch } from "../../git/models/branch.js";
18
+ import { createConflictDetectionError } from "../../git/utils/mergeConflicts.utils.js";
19
+ import { sortBranches, sortContributors } from "../../git/utils/sorting.js";
20
+ import { debounce } from "../../utils/decorators/debounce.js";
21
+ import { PageableResult, emptyPagedResult } from "../../utils/paging.js";
22
+ import { parseMergeTreeConflict } from "../parsers/mergeTreeParser.js";
23
+ //#region ../git-cli/src/providers/branches.ts
78
24
  /** Minimum time between writes to the config for last accessed/modified dates */
79
- const dateMetadataStaleThresholdMs = 5 * 60 * 1000; // 5 minutes
80
- export class BranchesGitSubProvider {
81
- context;
82
- git;
83
- cache;
84
- provider;
85
- constructor(context, git, cache, provider) {
86
- this.context = context;
87
- this.git = git;
88
- this.cache = cache;
89
- this.provider = provider;
90
- }
91
- async getBranch(repoPath, name, cancellation) {
92
- if (name != null) {
93
- const { values: [branch], } = await this.getBranches(repoPath, { filter: b => b.name === name }, cancellation);
94
- return branch;
95
- }
96
- const branchPromise = this.cache.branch.getOrCreate(repoPath, async (_cacheable, signal) => {
97
- const { values: [branch], } = await this.getBranches(repoPath, { filter: b => b.current }, signal);
98
- return branch ?? this.getCurrentBranch(repoPath, undefined, undefined, signal);
99
- }, cancellation);
100
- if (branchPromise == null) {
101
- const { values: [branch], } = await this.getBranches(repoPath, { filter: b => b.current }, cancellation);
102
- return branch ?? this.getCurrentBranch(repoPath, undefined, undefined, cancellation);
103
- }
104
- return branchPromise;
105
- }
106
- async getCurrentBranch(repoPath, metadataMap, ordering, cancellation) {
107
- const ref = await this.getCurrentBranchReferenceCore(repoPath, ordering, cancellation);
108
- if (ref == null)
109
- return undefined;
110
- const [pausedOpStatusResult, committerDateResult, defaultWorktreePathResult, metadataMapResult] = await Promise.allSettled([
111
- isDetachedHead(ref.name)
112
- ? this.provider.pausedOps?.getPausedOperationStatus(repoPath, undefined, cancellation)
113
- : undefined,
114
- this.git
115
- .run({
116
- cwd: repoPath,
117
- cancellation: cancellation,
118
- configs: gitConfigsLog,
119
- errors: 'ignore',
120
- }, 'log', '-n1', '--format=%ct', ordering ? `--${ordering}-order` : undefined, '--')
121
- .then(result => (result.stdout ? result.stdout.trim() : undefined)),
122
- this.provider.config.getDefaultWorktreePath?.(repoPath),
123
- metadataMap != null ? Promise.resolve(metadataMap) : this.getBranchMetadataMap(repoPath),
124
- ]);
125
- const committerDate = getSettledValue(committerDateResult);
126
- const pausedOpStatus = getSettledValue(pausedOpStatusResult);
127
- const rebaseStatus = pausedOpStatus?.type === 'rebase' ? pausedOpStatus : undefined;
128
- const defaultWorktreePath = getSettledValue(defaultWorktreePathResult);
129
- metadataMap ??= getSettledValue(metadataMapResult);
130
- const metadata = metadataMap?.get(ref.name);
131
- if (cancellation?.aborted)
132
- throw new CancellationError();
133
- const branchRefName = rebaseStatus?.incoming.name ?? `refs/heads/${ref.name}`;
134
- const branch = new GitBranch(repoPath, // Use worktree-specific path for consistent IDs within each worktree
135
- branchRefName, true, committerDate != null ? new Date(Number(committerDate) * 1000) : undefined, metadata, ref.sha, ref.upstream ? { ...ref.upstream, state: { ahead: 0, behind: 0 } } : undefined, { path: repoPath, isDefault: repoPath === defaultWorktreePath }, undefined, rebaseStatus != null);
136
- return branch;
137
- }
138
- async getBranches(repoPath, options, cancellation) {
139
- if (repoPath == null)
140
- return emptyPagedResult;
141
- const scope = getScopedLogger();
142
- const getCore = async (commonPath, cacheable, signal) => {
143
- // Prefer the aggregate signal from the cache when present; fall back to the caller's
144
- // own cancellation when bypassing the cache (e.g. paging-cursor path).
145
- signal ??= cancellation;
146
- try {
147
- const env_1 = { stack: [], error: void 0, hasError: false };
148
- try {
149
- const [recordsResult, supportedResult, defaultWorktreePathResult, metadataMapResult] = await Promise.allSettled([
150
- this.provider.refs.getRefs(commonPath, signal),
151
- this.git.supported('git:for-each-ref'),
152
- this.provider.config.getDefaultWorktreePath?.(commonPath),
153
- this.getBranchMetadataMap(commonPath),
154
- ]);
155
- const records = getSettledValue(recordsResult) ?? [];
156
- const supported = getSettledValue(supportedResult) ?? [];
157
- const metadataMap = getSettledValue(metadataMapResult) ?? new Map();
158
- const defaultWorktreePath = getSettledValue(defaultWorktreePathResult);
159
- const worktreePathSupported = supported.includes('git:for-each-ref:worktreePath');
160
- // If we don't get any data, assume the repo doesn't have any commits yet so check if we have a current branch
161
- if (!records.length) {
162
- // Never CACHE that conclusion. `getRefs` reports a failed enumeration the same way as a
163
- // genuinely ref-less repo — an empty array (it invalidates its own entry but doesn't
164
- // throw) — so a transient `for-each-ref` failure would otherwise pin this degraded
165
- // current-branch-only list in a map with no TTL, and every branch consumer would see a
166
- // one-branch repo for the session. A truly empty repo re-reads cheaply, so refusing the
167
- // entry costs nothing in the case this is actually meant to serve.
168
- cacheable?.invalidate();
169
- const current = await this.getCurrentBranch(commonPath, metadataMap, options?.ordering ?? this.context.config?.commits.ordering ?? undefined, signal);
170
- return current != null ? { values: [current] } : emptyPagedResult;
171
- }
172
- const sw = __addDisposableResource(env_1, maybeStopWatch(scope, { log: { onlyExit: true, level: 'debug' } }), false);
173
- const branches = [];
174
- for (const record of records) {
175
- const fullName = record.name;
176
- // Filter to branches and remote-tracking branches; skip tags from the unified records.
177
- if (!fullName.startsWith('refs/heads/') && !fullName.startsWith('refs/remotes/'))
178
- continue;
179
- // Skip HEAD refs in remote branches
180
- if (isRemoteHEAD(fullName))
181
- continue;
182
- const upstream = parseUpstream(record.upstream, record.upstreamTracking);
183
- const metadata = metadataMap.get(parseRefName(fullName).name);
184
- const worktreePath = record.worktreePath ? normalizePath(record.worktreePath) : undefined;
185
- branches.push(new GitBranch(commonPath, fullName, false, // Don't trust %(HEAD) for current as it's per-worktree -- we will set it later
186
- record.committerDate ? new Date(record.committerDate) : undefined, metadata, record.objectname, upstream, worktreePathSupported
187
- ? worktreePath
188
- ? { path: worktreePath, isDefault: worktreePath === defaultWorktreePath }
189
- : false
190
- : undefined));
191
- }
192
- sw?.stop({ suffix: ` parsed ${branches.length} branches` });
193
- // Pre-populate current branch cache for worktrees based on worktreePath info
194
- // This eliminates the need for rev-parse calls during branch reconstruction
195
- for (const branch of branches) {
196
- // oxlint-disable-next-line typescript/prefer-optional-chain
197
- if (branch.worktree && branch.worktree.path) {
198
- const { name } = parseRefName(branch.refName);
199
- const reference = createReference(name, branch.worktree.path, {
200
- refType: 'branch',
201
- name: name,
202
- id: getBranchId(branch.worktree.path, false, name),
203
- remote: false,
204
- upstream: branch.upstream?.name
205
- ? { name: branch.upstream.name, missing: branch.upstream.missing }
206
- : undefined,
207
- sha: branch.sha,
208
- });
209
- this.cache.setCurrentBranchReferenceIfAbsent(branch.worktree.path, reference);
210
- }
211
- }
212
- return branches.length ? { values: branches } : emptyPagedResult;
213
- }
214
- catch (e_1) {
215
- env_1.error = e_1;
216
- env_1.hasError = true;
217
- }
218
- finally {
219
- __disposeResources(env_1);
220
- }
221
- }
222
- catch (ex) {
223
- // Signal cache invalidation so the shared cache entry is cleaned up
224
- cacheable?.invalidate();
225
- if (isCancellationError(ex))
226
- throw ex;
227
- return emptyPagedResult;
228
- }
229
- };
230
- // Mapper function that adjusts branches for a specific worktree
231
- const mapBranches = async (shared, targetRepoPath, commonPath, mapperSignal) => {
232
- if (!shared.values.length)
233
- return shared;
234
- // Prefer the mapper's per-entry aggregate signal when present; fall back to the
235
- // caller's own cancellation when bypassing the cache (paging-cursor path).
236
- mapperSignal ??= cancellation;
237
- // Get current branch info and default worktree path for the target worktree
238
- const [currentRefResult, defaultWorktreePathResult] = await Promise.allSettled([
239
- this.getCurrentBranchReferenceCore(targetRepoPath, undefined, mapperSignal),
240
- this.provider.config.getDefaultWorktreePath?.(commonPath),
241
- ]);
242
- const currentRef = getSettledValue(currentRefResult);
243
- const defaultWorktreePath = getSettledValue(defaultWorktreePathResult);
244
- const isDetached = currentRef != null && isDetachedHead(currentRef.name);
245
- // Clone branches with correct repoPath and current flag
246
- const branches = shared.values.map(b => {
247
- // Check if this branch is current in the target worktree
248
- const isCurrent = !b.remote && b.name === currentRef?.name && !isDetached;
249
- // Only create new object if something changed
250
- if (!isCurrent && targetRepoPath === commonPath)
251
- return b;
252
- return new GitBranch(targetRepoPath, // Use target worktree path
253
- b.refName, isCurrent, b.date, b.metadata, b.sha, b.upstream,
254
- // For current branch, ensure worktree is set (fallback when git doesn't support worktreePath)
255
- isCurrent
256
- ? (b.worktree ?? { path: targetRepoPath, isDefault: targetRepoPath === defaultWorktreePath })
257
- : b.worktree, false, // detached - only true for detached HEAD branch itself
258
- false);
259
- });
260
- // Handle detached HEAD - need to create a special branch for it
261
- if (isDetached || (currentRef != null && !branches.some(b => b.current))) {
262
- const metadataMap = await this.getBranchMetadataMap(commonPath);
263
- const current = await this.getCurrentBranch(targetRepoPath, metadataMap, options?.ordering ?? this.context.config?.commits.ordering ?? undefined, mapperSignal);
264
- if (current != null) {
265
- // Replace if exists (by id), otherwise prepend
266
- const index = branches.findIndex(b => b.id === current.id);
267
- if (index !== -1) {
268
- branches[index] = current;
269
- }
270
- else {
271
- branches.unshift(current);
272
- }
273
- }
274
- }
275
- return { ...shared, values: branches };
276
- };
277
- let result;
278
- // Use paging cursor to bypass cache if paginating
279
- if (options?.paging?.cursor != null) {
280
- const commonPath = this.cache.getCommonPath(repoPath);
281
- const shared = await getCore(commonPath);
282
- // Still apply the mapper to ensure correct repoPath and current flag for the requesting worktree
283
- result = await mapBranches(shared, repoPath, commonPath);
284
- }
285
- else {
286
- result = await this.cache.getBranches(repoPath, getCore, mapBranches, cancellation);
287
- }
288
- if (options?.filter != null) {
289
- result = {
290
- ...result,
291
- values: result.values.filter(options.filter),
292
- };
293
- }
294
- if (options?.sort) {
295
- sortBranches(result.values, typeof options.sort === 'boolean' ? undefined : options.sort);
296
- }
297
- return result;
298
- }
299
- async getBranchContributionsOverview(repoPath, ref, options, cancellation) {
300
- const scope = getScopedLogger();
301
- const priority = options?.priority;
302
- const priorityOpts = priority != null ? { priority: priority } : undefined;
303
- // Expensive body — runs only on cache miss. Closes over `mergeTarget` so the cache key
304
- // (`${ref}|${mergeTarget}`) fully captures every input that affects the result.
305
- const fetchBody = async (mergeTarget, signal) => {
306
- const mergeBase = await this.provider.refs.getMergeBase(repoPath, ref, mergeTarget, priorityOpts, signal);
307
- if (mergeBase == null)
308
- return undefined;
309
- // Fetch the merge-base commit's dates in parallel with contributors so consumers
310
- // (e.g. the graph minimap scope window) don't pay a separate round-trip for them.
311
- // `allSettled` so a transient failure in one side doesn't drop the overview entirely.
312
- const [contributorsSettled, mergeBaseDatesSettled] = await Promise.allSettled([
313
- this.provider.contributors.getContributors(repoPath, createRevisionRange(mergeBase, ref, '..'), { stats: true }, signal),
314
- this.provider.commits.getCommitDates(repoPath, mergeBase, signal),
315
- ]);
316
- if (signal?.aborted)
317
- throw new CancellationError();
318
- const result = getSettledValue(contributorsSettled) ?? { contributors: [] };
319
- const mergeBaseDates = getSettledValue(mergeBaseDatesSettled);
320
- sortContributors(result.contributors, { orderBy: 'score:desc' });
321
- let totalCommits = 0;
322
- let totalFiles = 0;
323
- let totalAdditions = 0;
324
- let totalDeletions = 0;
325
- let firstCommitTimestamp;
326
- let latestCommitTimestamp;
327
- for (const c of result.contributors) {
328
- totalCommits += c.contributionCount;
329
- totalFiles += c.stats?.files ?? 0;
330
- totalAdditions += c.stats?.additions ?? 0;
331
- totalDeletions += c.stats?.deletions ?? 0;
332
- const firstTimestamp = c.firstCommitDate?.getTime();
333
- const latestTimestamp = c.latestCommitDate?.getTime();
334
- if (firstTimestamp != null || latestTimestamp != null) {
335
- firstCommitTimestamp =
336
- firstCommitTimestamp != null
337
- ? Math.min(firstCommitTimestamp, firstTimestamp ?? Infinity, latestTimestamp ?? Infinity)
338
- : (firstTimestamp ?? latestTimestamp);
339
- latestCommitTimestamp =
340
- latestCommitTimestamp != null
341
- ? Math.max(latestCommitTimestamp, firstTimestamp ?? -Infinity, latestTimestamp ?? -Infinity)
342
- : (latestTimestamp ?? firstTimestamp);
343
- }
344
- }
345
- return {
346
- repoPath: repoPath,
347
- branch: ref,
348
- mergeTarget: mergeTarget,
349
- mergeBase: mergeBase,
350
- mergeBaseDate: mergeBaseDates?.committerDate,
351
- commits: totalCommits,
352
- files: totalFiles,
353
- additions: totalAdditions,
354
- deletions: totalDeletions,
355
- latestCommitDate: latestCommitTimestamp != null ? new Date(latestCommitTimestamp) : undefined,
356
- firstCommitDate: firstCommitTimestamp != null ? new Date(firstCommitTimestamp) : undefined,
357
- contributors: result.contributors,
358
- };
359
- };
360
- try {
361
- // Resolve `mergeTarget` through Tier 1 → Tier 2 → Tier 3. The pieces of each tier are
362
- // already individually cached (`getStoredMergeTargetBranchName`, `getBaseBranchName`,
363
- // `getDefaultBranchName`), so this resolution path is cheap on warm caches. Only the
364
- // expensive body below (`getMergeBase` + `getContributors` w/ stats + `getCommitDates`)
365
- // is wrapped by `cache.getBranchOverview`, keyed on the resolved `mergeTarget` so any
366
- // caller that resolves to the same target shares; differing targets get independent
367
- // slots, which is the correctness constraint that previously forced the Tier 2/3 paths
368
- // to bypass the cache entirely.
369
- let mergeTarget;
370
- // Tier 1: Stored merge target (user-set or previously detected from PR).
371
- const storedTarget = await this.getStoredMergeTargetBranchName(repoPath, ref);
372
- if (storedTarget) {
373
- const validated = await this.provider.refs.getSymbolicReferenceName(repoPath, storedTarget, priorityOpts, cancellation);
374
- mergeTarget = validated || storedTarget;
375
- }
376
- // Tier 2: PR-based lookup. The branch object is only needed here (for `remoteName`),
377
- // so lazy-load it on the cold path instead of paying for it on every call.
378
- if (mergeTarget == null && options?.associatedPullRequest != null) {
379
- const pr = await options.associatedPullRequest;
380
- if (pr?.refs?.base != null) {
381
- const branch = await this.getBranch(repoPath, ref, cancellation);
382
- if (branch == null)
383
- return undefined;
384
- mergeTarget = `${branch.remoteName}/${pr.refs.base.branch}`;
385
- // A stacked PR's base is the layer below it, which is deleted when the stack merges.
386
- // Storing it would leave a stored target naming a branch that no longer exists — and
387
- // a stored target beats every other tier, so it would keep winning until cleared by
388
- // hand. Use it for this lookup, but don't persist it.
389
- if (pr.stack == null) {
390
- // Store for future reuse — turns the next call into a Tier 1 path. Skip the
391
- // `branchOverviews` invalidation that the write would otherwise trigger: we're
392
- // about to populate `${ref}|${mergeTarget}` with this exact target, so evicting
393
- // it would just force the next caller to redo the body. (gk-merge-target writes
394
- // do not affect `baseBranchName`, so no need to skip that target.)
395
- void this.storeMergeTargetBranchName(repoPath, ref, mergeTarget, {
396
- skipInvalidation: ['branchOverviews'],
397
- });
398
- }
399
- }
400
- }
401
- // Tier 3: Base branch, then default branch.
402
- mergeTarget ??= await this.getBaseBranchName(repoPath, ref, priorityOpts, cancellation);
403
- mergeTarget ??= await this.getDefaultBranchName(repoPath, undefined, priorityOpts, cancellation);
404
- if (mergeTarget == null)
405
- return undefined;
406
- const resolvedTarget = mergeTarget;
407
- return await this.cache.getBranchOverview(repoPath, `${ref}|${resolvedTarget}`, (_commonPath, _cacheable, signal) => fetchBody(resolvedTarget, signal ?? cancellation), { cancellation: cancellation });
408
- }
409
- catch (ex) {
410
- scope?.error(ex);
411
- if (isCancellationError(ex))
412
- throw ex;
413
- return undefined;
414
- }
415
- }
416
- async getBranchesWithCommits(repoPath, commits, branch, options, cancellation) {
417
- if (branch != null) {
418
- const result = await this.branchesContainingCore(repoPath, commits, { mode: 'contains', name: branch }, cancellation);
419
- const data = result.stdout.trim();
420
- return data ? [data] : [];
421
- }
422
- const result = await this.branchesContainingCore(repoPath, commits, options, cancellation);
423
- if (!result.stdout)
424
- return [];
425
- return filterMap(result.stdout.split('\n'), b => b.trim() || undefined);
426
- }
427
- async branchesContainingCore(repoPath, refs, options, cancellation) {
428
- const params = ['branch'];
429
- if (options?.all) {
430
- params.push('-a');
431
- }
432
- else if (options?.remotes) {
433
- params.push('-r');
434
- }
435
- params.push('--format=%(refname:short)');
436
- for (const ref of refs) {
437
- params.push(options?.mode === 'pointsAt' ? `--points-at=${ref}` : `--contains=${ref}`);
438
- }
439
- if (options?.name != null) {
440
- params.push(options.name);
441
- }
442
- return this.git.run({
443
- cwd: repoPath,
444
- cancellation: cancellation,
445
- configs: gitConfigsBranch,
446
- errors: 'ignore',
447
- }, ...params);
448
- }
449
- async getCurrentBranchReference(repoPath, cancellation) {
450
- let ref = await this.getCurrentBranchReferenceCore(repoPath, undefined, cancellation);
451
- if (ref != null && isDetachedHead(ref.name)) {
452
- ref = createReference(ref.sha, repoPath, {
453
- refType: 'branch',
454
- name: formatDetachedHeadName(ref.sha),
455
- id: getBranchId(repoPath, ref.remote, ref.sha),
456
- remote: ref.remote,
457
- upstream: ref.upstream,
458
- sha: ref.sha,
459
- });
460
- }
461
- return ref;
462
- }
463
- getCurrentBranchReferenceCore(repoPath, ordering, cancellation) {
464
- return this.cache.currentBranchReference.getOrCreate(repoPath, async (_cacheable, signal) => {
465
- const commitOrdering = ordering;
466
- let data;
467
- let result;
468
- try {
469
- result = await this.git.run({ cwd: repoPath, cancellation: signal, errors: 'throw' }, 'rev-parse', '--abbrev-ref', '--symbolic-full-name', '@', '@{u}', '--');
470
- data = [result.stdout, undefined];
471
- }
472
- catch (ex) {
473
- if (isCancellationError(ex))
474
- throw ex;
475
- const msg = ex?.toString() ?? '';
476
- if (GitErrors.badRevision.test(msg) || GitWarnings.noUpstream.test(msg)) {
477
- if (ex.stdout != null && ex.stdout.length !== 0) {
478
- data = [ex.stdout, undefined];
479
- }
480
- else {
481
- try {
482
- result = await this.git.run({ cwd: repoPath, cancellation: signal }, 'symbolic-ref', '--short', 'HEAD');
483
- if (result.stdout) {
484
- data = [result.stdout.trim(), undefined];
485
- }
486
- }
487
- catch {
488
- if (isCancellationError(ex))
489
- throw ex;
490
- }
491
- if (data == null) {
492
- const symbolicRef = await this.getDefaultBranchName(repoPath, 'origin', undefined, signal);
493
- if (symbolicRef != null) {
494
- data = [
495
- symbolicRef.startsWith('origin/')
496
- ? symbolicRef.substring('origin/'.length)
497
- : symbolicRef,
498
- undefined,
499
- ];
500
- }
501
- }
502
- if (data == null) {
503
- const defaultBranch = (await this.provider.config.getConfig(repoPath, 'init.defaultBranch')) ?? 'main';
504
- const configMap = await this.provider.config.getConfigRegex(repoPath, `branch\\.${defaultBranch}\\.+`, { runGitLocally: true });
505
- const remote = configMap.get(`branch.${defaultBranch}.remote`);
506
- const merge = configMap.get(`branch.${defaultBranch}.merge`);
507
- const remoteBranch = merge?.startsWith('refs/heads/')
508
- ? merge.substring('refs/heads/'.length)
509
- : undefined;
510
- data = [
511
- `${defaultBranch}${remote && remoteBranch ? `\n${remote}/${remoteBranch}` : ''}`,
512
- undefined,
513
- ];
514
- }
515
- }
516
- }
517
- else if (GitWarnings.headNotABranch.test(msg)) {
518
- result = await this.git.run({
519
- cwd: repoPath,
520
- cancellation: signal,
521
- configs: gitConfigsLog,
522
- errors: 'ignore',
523
- }, 'log', '-n1', '--format=%H', commitOrdering ? `--${commitOrdering}-order` : undefined, '--');
524
- if (result.completion.status === 'cancelled' || signal?.aborted) {
525
- throw new CancellationError();
526
- }
527
- const sha = result.stdout.trim();
528
- if (sha) {
529
- data = [`(HEAD detached at ${shortenRevision(sha)})`, sha];
530
- }
531
- }
532
- else {
533
- Logger.warn(`[${repoPath}] Unable to get current branch: ${ex}`);
534
- }
535
- }
536
- if (data == null)
537
- return undefined;
538
- const [name, upstream] = data[0].split('\n');
539
- return createReference(name, repoPath, {
540
- refType: 'branch',
541
- name: name,
542
- id: getBranchId(repoPath, false, name),
543
- remote: false,
544
- upstream: upstream ? { name: upstream, missing: false } : undefined,
545
- sha: data[1],
546
- });
547
- }, { cancellation: cancellation });
548
- }
549
- async getDefaultBranchName(repoPath, remote, options, cancellation) {
550
- if (repoPath == null)
551
- return undefined;
552
- remote ??= 'origin';
553
- const priority = options?.priority;
554
- const priorityOpts = priority != null ? { priority: priority } : undefined;
555
- // Local-only: read just the existing local symref, never contacting the remote. Cached under a
556
- // `${remote}:local` key — a colon can't appear in a refname component, so it can never collide
557
- // with a real remote name used by the networked variant below. Invalidated by the same
558
- // remotes/branches cache cascades as the networked lookup.
559
- if (options?.local) {
560
- return this.cache.getDefaultBranchName(repoPath, `${remote}:local`, async (commonPath, cacheable, signal) => {
561
- try {
562
- // Bind to the aggregate `signal` (fires only when ALL current callers abort), not
563
- // this-caller's `cancellation` otherwise a superseded caller's abort would kill the
564
- // shared command and reject concurrent riders that never cancelled.
565
- const result = await this.git.run({ cwd: commonPath, cancellation: signal ?? cancellation, ...priorityOpts }, 'symbolic-ref', '--short', `refs/remotes/${remote}/HEAD`);
566
- return result.stdout.trim() || undefined;
567
- }
568
- catch (ex) {
569
- if (isCancellationError(ex))
570
- throw ex;
571
- // `symbolic-ref` on an absent `refs/remotes/<remote>/HEAD` exits fatal rather than
572
- // empty, and that message matches no `GitWarnings` entry, so it arrives here as a
573
- // throw. It is still an ANSWER — the ref genuinely isn't set — and the overwhelmingly
574
- // common one, so cache it. Invalidating instead means every caller re-probes and the
575
- // whole point of caching this lookup is lost.
576
- const stderr = ex.stderr ?? '';
577
- if (stderr.includes('is not a symbolic ref'))
578
- return undefined;
579
- // Anything else never produced an answer (spawn failure, queue rejection). This entry
580
- // has no TTL, so caching that would pin "no default branch" for the session.
581
- cacheable.invalidate();
582
- return undefined;
583
- }
584
- }, cancellation);
585
- }
586
- return this.cache.getDefaultBranchName(repoPath, remote, async (commonPath, cacheable, signal) => {
587
- let retried = false;
588
- while (true) {
589
- try {
590
- const result = await this.git.run({ cwd: commonPath, cancellation: signal ?? cancellation, ...priorityOpts }, 'symbolic-ref', '--short', `refs/remotes/${remote}/HEAD`);
591
- return result.stdout.trim() || undefined;
592
- }
593
- catch (ex) {
594
- // Only "no HEAD ref configured" is an ANSWER here; every other throw means the lookup
595
- // never happened. This entry has no TTL, so caching a failure — an offline `ls-remote`
596
- // being the likely one — would pin "no default branch" for the session.
597
- let answered = false;
598
- if (/is not a symbolic ref/.test(ex.stderr)) {
599
- try {
600
- if (!retried) {
601
- retried = true;
602
- await this.git.run({ cwd: commonPath, cancellation: signal ?? cancellation, ...priorityOpts }, 'remote', 'set-head', '-a', remote);
603
- // This just created `refs/remotes/<remote>/HEAD`, which the `local` variant
604
- // may already have cached a miss for. The watcher would also catch the new
605
- // ref, but evict directly so consumers of this package that don't wire up a
606
- // watcher aren't stuck with that miss.
607
- this.cache.deleteDefaultBranchName(commonPath, `${remote}:local`);
608
- continue;
609
- }
610
- const result = await this.git.run({ cwd: commonPath, cancellation: signal ?? cancellation, ...priorityOpts }, 'ls-remote', '--symref', remote, 'HEAD');
611
- if (result.stdout) {
612
- const match = /ref:\s(\S+)\s+HEAD/m.exec(result.stdout);
613
- if (match != null) {
614
- const [, branch] = match;
615
- return `${remote}/${branch.substring('refs/heads/'.length).trim()}`;
616
- }
617
- }
618
- // `ls-remote` ran and the remote advertised no HEAD — a real "none".
619
- answered = true;
620
- }
621
- catch {
622
- if (isCancellationError(ex))
623
- throw ex;
624
- }
625
- }
626
- if (!answered) {
627
- cacheable.invalidate();
628
- }
629
- return undefined;
630
- }
631
- }
632
- }, cancellation);
633
- }
634
- async createBranch(repoPath, name, ref, options) {
635
- const args = ['branch', name, ref];
636
- if (options?.noTracking) {
637
- args.push('--no-track');
638
- }
639
- try {
640
- await this.git.run({ cwd: repoPath }, ...args);
641
- // Evict the cached base so the new branch re-derives its own. The PERSISTED `branch.<ref>.gk-*`
642
- // keys are left alone: they're dropped when GitLens deletes a branch, never when one is created.
643
- // Removing them here would mean treating a reused name as proof of a different branch, which
644
- // nothing can establish — so the trade is that a branch reusing a name deleted outside GitLens
645
- // inherits the orphaned section.
646
- this.cache.deleteBaseBranchName(repoPath, name);
647
- this.context.hooks?.cache?.onReset?.(repoPath, 'branches');
648
- this.context.hooks?.repository?.onChanged?.(repoPath, ['heads']);
649
- }
650
- catch (ex) {
651
- throw getGitCommandError('branch', ex, reason => new BranchError({
652
- reason: reason ?? 'other',
653
- action: 'create',
654
- branch: name,
655
- gitCommand: { repoPath: repoPath, args: args },
656
- }, ex));
657
- }
658
- }
659
- async deleteLocalBranch(repoPath, names, options) {
660
- const branches = ensureArray(names);
661
- const args = ['branch', options?.force ? '-D' : '-d', ...branches];
662
- try {
663
- await this.git.run({ cwd: repoPath }, ...args);
664
- for (const branch of branches) {
665
- this.cache.deleteBaseBranchName(repoPath, branch);
666
- // Drop the persisted gk metadata too, not just the cached resolution. `getBaseBranchName`
667
- // reads `branch.<ref>.gk-merge-base` before falling back to the reflog, so leaving it behind
668
- // would hand a later branch reusing this name its predecessor's base — evicting the cache
669
- // alone just forces a re-derivation that reads the same stale value back.
670
- await this.provider.config.removeGkConfigBranchSection(repoPath, branch);
671
- }
672
- this.context.hooks?.cache?.onReset?.(repoPath, 'branches');
673
- this.context.hooks?.repository?.onChanged?.(repoPath, ['heads']);
674
- }
675
- catch (ex) {
676
- // A multi-name delete partially succeeds: `git branch -d a bad c` removes `a` and `c`, refuses
677
- // `bad`, and still exits non-zero — so the loop above never ran for the branches that did go.
678
- // Clean those up here rather than leave persisted gk metadata behind for a name a later branch
679
- // can reuse.
680
- const anyDeleted = await this.cleanupDeletedBranchMetadata(repoPath, branches);
681
- // The success path's notifications never ran, but some branches DID go — without these the
682
- // branch caches stay stale and consumers wait on the filesystem watcher (which never fires
683
- // for a packed ref).
684
- if (anyDeleted) {
685
- this.context.hooks?.cache?.onReset?.(repoPath, 'branches');
686
- this.context.hooks?.repository?.onChanged?.(repoPath, ['heads']);
687
- }
688
- if (ex instanceof BranchError) {
689
- throw ex.update({
690
- action: options?.force ? 'force delete' : 'delete',
691
- branch: branches.join(', '),
692
- gitCommand: { repoPath: repoPath, args: args },
693
- });
694
- }
695
- // Classify the failure (e.g. not fully merged) so consumers like the delete wizard can offer a
696
- // force retry — without this the reason would be undefined and every failure reads as 'other'.
697
- throw getGitCommandError('branch', ex, reason => new BranchError({
698
- reason: reason ?? 'other',
699
- action: options?.force ? 'force delete' : 'delete',
700
- branch: branches.join(', '),
701
- gitCommand: { repoPath: repoPath, args: args },
702
- }, ex));
703
- }
704
- }
705
- /**
706
- * Drops the cached and persisted per-branch metadata for whichever of `names` no longer exists. Only
707
- * for the partial-failure path — one extra `for-each-ref` is cheap while already handling an error,
708
- * and keeps the success path free of it.
709
- *
710
- * Returns whether any of `names` is confirmed gone; `false` when the probe couldn't answer, so a
711
- * spurious notification is never fired on an unrelated failure.
712
- */
713
- async cleanupDeletedBranchMetadata(repoPath, names) {
714
- try {
715
- const result = await this.git.run({ cwd: repoPath, errors: 'ignore' }, 'for-each-ref',
716
- // Full refname, stripped here rather than by git. NOT `%(refname:short)`: that yields the
717
- // shortest UNAMBIGUOUS name, so a branch with a same-named tag comes back as `heads/<name>`,
718
- // never matches the requested name, and would read as deleted — wiping a live branch's
719
- // metadata. `%(refname:strip=2)` also solves that, but `%(refname)` is the oldest, plainest
720
- // field and needs no assumption about which git version gained `strip`.
721
- '--format=%(refname)', ...names.map(n => `refs/heads/${n}`));
722
- // `errors: 'ignore'` means a failed probe RESOLVES empty, which is indistinguishable from "none
723
- // of them survived" — and would delete every name's metadata, including user-owned keys like
724
- // `gk-disposition` and `gk-associated-issues`. Only act on a genuine answer.
725
- //
726
- // BOTH conditions: `exitCode !== 0` catches a probe git ran and rejected, `status !== 'exited'`
727
- // catches one that never produced an answer — a spawn failure or queue rejection (no exit code at
728
- // all), or a swallowed warning (which carries git's real code, so the exit-code test alone can
729
- // still read it as "none survived").
730
- if (result.completion.status !== 'exited' || result.exitCode !== 0)
731
- return false;
732
- const prefix = 'refs/heads/';
733
- const surviving = new Set(result.stdout
734
- .split('\n')
735
- .map(l => l.trim())
736
- .filter(l => l.startsWith(prefix))
737
- .map(l => l.substring(prefix.length)));
738
- let anyDeleted = false;
739
- for (const name of names) {
740
- if (surviving.has(name))
741
- continue;
742
- anyDeleted = true;
743
- this.cache.deleteBaseBranchName(repoPath, name);
744
- await this.provider.config.removeGkConfigBranchSection(repoPath, name);
745
- }
746
- return anyDeleted;
747
- }
748
- catch {
749
- // Best-effort bookkeeping while already unwinding a failure — never mask the original error.
750
- return false;
751
- }
752
- }
753
- async deleteRemoteBranch(repoPath, names, remote) {
754
- const branches = ensureArray(names);
755
- const args = ['push', '-d', remote, ...branches];
756
- try {
757
- await this.git.run({ cwd: repoPath }, ...args);
758
- this.context.hooks?.cache?.onReset?.(repoPath, 'branches');
759
- this.context.hooks?.repository?.onChanged?.(repoPath, ['remotes']);
760
- }
761
- catch (ex) {
762
- if (ex instanceof BranchError) {
763
- throw ex.update({
764
- action: 'delete',
765
- branch: branches.join(', '),
766
- gitCommand: { repoPath: repoPath, args: args },
767
- });
768
- }
769
- // Classify against the underlying `git push -d` failure modes; map the "remote ref does not
770
- // exist" case onto BranchError's noRemoteReference so consumers get an actionable reason.
771
- throw getGitCommandError('push', ex, reason => new BranchError({
772
- reason: reason === 'rejectedRefDoesNotExist' ? 'noRemoteReference' : 'other',
773
- action: 'delete',
774
- branch: branches.join(', '),
775
- gitCommand: { repoPath: repoPath, args: args },
776
- }, ex));
777
- }
778
- }
779
- async getBranchMergedStatus(repoPath, branch, into, cancellation) {
780
- if (branch.name === into.name || branch.upstream?.name === into.name) {
781
- return { merged: false };
782
- }
783
- // Hoisted so it can feed the cache key below (its tip is a 3rd key input) and the mapper
784
- // below reuses it instead of resolving it a second time.
785
- const localInto = into.remote
786
- ? await this.getLocalBranchByUpstream(repoPath, into.name, cancellation)
787
- : undefined;
788
- // Cache key omits repoPath so worktrees of the same common repo share the cached answer.
789
- // Content-keyed on the involved tip shas (the result is a pure function of them), so tip
790
- // movement mints a new key instead of relying on eviction; falls back to the name-only
791
- // identity when a sha is missing (defensive — the sole caller always supplies both tips).
792
- const cacheKey = branch.sha != null && into.sha != null
793
- ? `${branch.remote ? 'r' : 'l'}:${branch.name}@${branch.sha}|${into.remote ? 'r' : 'l'}:${into.name}@${into.sha}${localInto?.sha != null ? `|L:${localInto.name}@${localInto.sha}` : ''}`
794
- : `${branch.remote ? 'r' : 'l'}:${branch.name}|${into.remote ? 'r' : 'l'}:${into.name}`;
795
- return this.cache.getBranchMergedStatus(repoPath, cacheKey, async (commonPath, _cacheable, signal) => {
796
- const result = await this.getBranchMergedStatusCore(commonPath, branch, into, signal);
797
- if (result.merged)
798
- return result;
799
- // If there is a local branch and it is not the branch we are checking, check if it has been merged into it
800
- if (localInto != null && localInto.name !== branch.name) {
801
- // Skip the second full merge-check cycle when the local branch points at the same commit as the remote —
802
- // the merge-base/cherry/diff/apply pipeline would produce the same answer we already got for `into` above
803
- if (localInto.sha != null && localInto.sha === into.sha) {
804
- return { merged: false };
805
- }
806
- const result = await this.getBranchMergedStatusCore(commonPath, branch, localInto, signal);
807
- if (result.merged) {
808
- // `localBranchOnly` is built against `commonPath` here; the cache mapper rewrites
809
- // `repoPath`/`id` to the requesting worktree on retrieval.
810
- return {
811
- ...result,
812
- localBranchOnly: createReference(localInto.ref, commonPath, {
813
- id: getBranchId(commonPath, localInto.remote, localInto.name),
814
- refType: 'branch',
815
- name: localInto.name,
816
- remote: localInto.remote,
817
- upstream: localInto.upstream,
818
- sha: localInto.sha,
819
- }),
820
- };
821
- }
822
- }
823
- return { merged: false };
824
- }, cancellation);
825
- }
826
- async getBranchMergedStatusCore(repoPath, branch, into, cancellation) {
827
- const scope = getScopedLogger();
828
- try {
829
- // Check if branch is direct ancestor (handles FF merges)
830
- try {
831
- await this.git.run({ cwd: repoPath, cancellation: cancellation, errors: 'throw' }, 'merge-base', '--is-ancestor', branch.name, into.name);
832
- return { merged: true, confidence: 'highest' };
833
- }
834
- catch (ex) {
835
- if (isCancellationError(ex))
836
- throw ex;
837
- }
838
- // Cherry-pick detection (handles cherry-picks, rebases, etc)
839
- let result = await this.git.run({ cwd: repoPath, cancellation: cancellation }, 'cherry', '--abbrev', '-v', into.name, branch.name);
840
- // Check if there are no lines or all lines startwith a `-` (i.e. likely merged)
841
- if (!result.stdout ||
842
- result.stdout
843
- .trim()
844
- .split('\n')
845
- .every(l => l.startsWith('-'))) {
846
- return { merged: true, confidence: 'high' };
847
- }
848
- // Attempt to detect squash merges by checking if the diff of the branch can be cleanly removed from the target
849
- const mergeBase = await this.provider.refs.getMergeBase(repoPath, into.name, branch.name, undefined, cancellation);
850
- result = await this.git.run({ cwd: repoPath, cancellation: cancellation }, 'diff', mergeBase, branch.name);
851
- if (result.stdout) {
852
- const env_2 = { stack: [], error: void 0, hasError: false };
853
- try {
854
- // Create a temporary index file
855
- const disposableIndex = __addDisposableResource(env_2, await this.provider.staging.createTemporaryIndex(repoPath, 'ref', into.name), true);
856
- const { env } = disposableIndex;
857
- result = await this.git.run({
858
- cwd: repoPath,
859
- cancellation: cancellation,
860
- env: env,
861
- errors: 'ignore',
862
- stdin: result.stdout,
863
- }, 'apply', '--cached', '--reverse', '--check', '-');
864
- if (result.exitCode === 0 && !result.stdout.trim() && !result.stderr?.trim()) {
865
- return { merged: true, confidence: 'medium' };
866
- }
867
- }
868
- catch (e_2) {
869
- env_2.error = e_2;
870
- env_2.hasError = true;
871
- }
872
- finally {
873
- const result_1 = __disposeResources(env_2);
874
- if (result_1)
875
- await result_1;
876
- }
877
- }
878
- return { merged: false };
879
- }
880
- catch (ex) {
881
- if (Logger.enabled('trace')) {
882
- scope?.error(ex);
883
- }
884
- if (isCancellationError(ex))
885
- throw ex;
886
- return { merged: false };
887
- }
888
- }
889
- async getLocalBranchByUpstream(repoPath, remoteBranchName, cancellation) {
890
- const branches = new PageableResult(p => this.getBranches(repoPath, p != null ? { paging: p } : undefined, cancellation));
891
- return getLocalBranchByUpstream(remoteBranchName, branches);
892
- }
893
- /** Detects potential conflicts when applying commits onto a target branch (git rebase and cherry-pick) */
894
- async getPotentialApplyConflicts(repoPath, targetBranch, shas, options, cancellation) {
895
- if (!shas.length)
896
- return { status: 'clean' };
897
- const cacheKey = `apply:${targetBranch}:${shas.join(',')}:${options?.stopOnFirstConflict ?? false}`;
898
- return this.cache.conflictDetection.getOrCreate(repoPath, cacheKey, async (_cacheable, signal) => {
899
- // Resolve all parent refs in a single call - fails if any commit is a root commit (no parent)
900
- const parentRefs = shas.map(c => `${c}^`);
901
- let parentShas;
902
- try {
903
- const result = await this.git.run({ cwd: repoPath, cancellation: signal, errors: 'throw' }, 'rev-parse', ...parentRefs);
904
- parentShas = result.stdout.trim().split('\n');
905
- }
906
- catch (ex) {
907
- if (isCancellationError(ex))
908
- throw ex;
909
- // If any commit doesn't have a parent (root commit), we can't do conflict detection
910
- return createConflictDetectionError('noParent');
911
- }
912
- if (parentShas.length !== shas.length) {
913
- return createConflictDetectionError('refNotFound');
914
- }
915
- const commitsWithParents = shas.map((c, i) => ({ sha: c, parent: parentShas[i] }));
916
- return this.checkForPotentialConflicts(repoPath, commitsWithParents, targetBranch, signal, options);
917
- }, { cancellation: cancellation });
918
- }
919
- /** Detects potential conflict when merge a branch into a target branch (git merge) */
920
- async getPotentialMergeConflicts(repoPath, branch, targetBranch, cancellation) {
921
- const scope = getScopedLogger();
922
- const cacheKey = `merge:${branch}:${targetBranch}`;
923
- return this.cache.conflictDetection.getOrCreate(repoPath, cacheKey, async (_cacheable, signal) => {
924
- // Requires Git v2.33+
925
- if (!(await this.git.supports('git:merge-tree'))) {
926
- return createConflictDetectionError('unsupported');
927
- }
928
- let data;
929
- try {
930
- const result = await this.git.run({ cwd: repoPath, cancellation: signal, errors: 'throw' }, 'merge-tree', '-z', '--name-only', '--no-messages', branch, targetBranch);
931
- data = result.stdout;
932
- }
933
- catch (ex) {
934
- if (isCancellationError(ex))
935
- throw ex;
936
- const msg = ex?.toString() ?? '';
937
- if (GitErrors.notAValidObjectName.test(msg)) {
938
- scope?.error(ex, `'${targetBranch}' or '${branch}' not found - ensure the branches exist and are fully qualified (e.g. 'refs/heads/main')`);
939
- return createConflictDetectionError('refNotFound');
940
- }
941
- else if (GitErrors.badRevision.test(msg)) {
942
- scope?.error(ex, `Invalid branch name: ${msg.slice(msg.indexOf("'"))}`);
943
- return createConflictDetectionError('refNotFound');
944
- }
945
- else if (GitErrors.noMergeBase.test(msg)) {
946
- scope?.error(ex, `Unable to merge '${branch}' and '${targetBranch}' as they have no common ancestor`);
947
- return createConflictDetectionError('noMergeBase');
948
- }
949
- else if (ex instanceof GitError) {
950
- data = ex.stdout;
951
- }
952
- else {
953
- scope?.error(ex);
954
- return createConflictDetectionError('other');
955
- }
956
- }
957
- if (!data)
958
- return { status: 'clean' };
959
- const mergeConflict = parseMergeTreeConflict(data);
960
- if (!mergeConflict.conflicts.length)
961
- return { status: 'clean', treeOid: mergeConflict.treeOid };
962
- return {
963
- status: 'conflicts',
964
- conflict: {
965
- repoPath: repoPath,
966
- branch: branch,
967
- target: targetBranch,
968
- files: mergeConflict.conflicts,
969
- shas: undefined, // Merge conflicts don't have a specific commit SHA
970
- },
971
- treeOid: mergeConflict.treeOid,
972
- };
973
- }, { cancellation: cancellation });
974
- }
975
- /** Detects conflicts when an autostash is reapplied onto the tree an integration produced */
976
- async getPotentialStashReapplyConflicts(repoPath, ontoTreeOid, cancellation) {
977
- // Requires Git v2.38+ for --write-tree with 3-arg form
978
- if (!(await this.git.supports('git:merge-tree:write-tree'))) {
979
- return createConflictDetectionError('unsupported');
980
- }
981
- // git stash create writes commit objects but touches neither the working tree nor the stash ref, and
982
- // captures tracked changes only — which is exactly what autostash does
983
- let stashSha;
984
- try {
985
- const result = await this.git.run({ cwd: repoPath, cancellation: cancellation, errors: 'throw' }, 'stash', 'create');
986
- stashSha = result.stdout.trim();
987
- }
988
- catch (ex) {
989
- if (isCancellationError(ex))
990
- throw ex;
991
- return createConflictDetectionError('other');
992
- }
993
- if (!stashSha)
994
- return { status: 'clean' };
995
- // Key on what the simulation actually consumes — the stash's tree and its first parent (the HEAD it was
996
- // taken against, and so the merge base). The stash SHA itself embeds a commit timestamp, so two runs over
997
- // an identical tree produce different SHAs and a SHA-keyed entry could never be hit.
998
- let stashTree;
999
- let stashParent;
1000
- try {
1001
- const result = await this.git.run({ cwd: repoPath, cancellation: cancellation, errors: 'throw' }, 'rev-parse', `${stashSha}^{tree}`, `${stashSha}^`);
1002
- [stashTree, stashParent] = result.stdout.trim().split('\n');
1003
- }
1004
- catch (ex) {
1005
- if (isCancellationError(ex))
1006
- throw ex;
1007
- return createConflictDetectionError('other');
1008
- }
1009
- const cacheKey = `reapply:${ontoTreeOid}:${stashTree}.${stashParent}`;
1010
- return this.cache.conflictDetection.getOrCreate(repoPath, cacheKey, async (_cacheable, signal) => {
1011
- // The stash commit's first parent is the HEAD it was taken against, which is the correct merge
1012
- // base for a reapply — ours is the post-integration tree, theirs is the stash
1013
- const step = await this.runMergeTreeStep(repoPath, `${stashSha}^`, ontoTreeOid, stashSha, signal);
1014
- if (!step.ok)
1015
- return createConflictDetectionError(step.reason);
1016
- if (!step.result.conflicts.length)
1017
- return { status: 'clean', treeOid: step.result.treeOid };
1018
- return {
1019
- status: 'conflicts',
1020
- conflict: {
1021
- repoPath: repoPath,
1022
- branch: stashSha,
1023
- target: ontoTreeOid,
1024
- files: step.result.conflicts,
1025
- shas: undefined,
1026
- },
1027
- treeOid: step.result.treeOid,
1028
- };
1029
- }, { cancellation: cancellation });
1030
- }
1031
- async runMergeTreeStep(repoPath, base, ours, theirs, cancellation) {
1032
- const scope = getScopedLogger();
1033
- let data;
1034
- try {
1035
- const result = await this.git.run({ cwd: repoPath, cancellation: cancellation, errors: 'throw' }, 'merge-tree', '--write-tree', '-z', '--name-only', '--no-messages', `--merge-base=${base}`, ours, theirs);
1036
- data = result.stdout;
1037
- }
1038
- catch (ex) {
1039
- if (isCancellationError(ex))
1040
- throw ex;
1041
- const msg = ex?.toString() ?? '';
1042
- if (GitErrors.notAValidObjectName.test(msg)) {
1043
- scope?.error(ex, `'${ours}' or '${theirs}' not found - ensure the branches/commits exist`);
1044
- return { ok: false, reason: 'refNotFound' };
1045
- }
1046
- else if (GitErrors.badRevision.test(msg)) {
1047
- scope?.error(ex, `Invalid revision: ${msg.slice(msg.indexOf("'"))}`);
1048
- return { ok: false, reason: 'refNotFound' };
1049
- }
1050
- else if (GitErrors.noMergeBase.test(msg)) {
1051
- scope?.error(ex, `Unable to merge '${ours}' and '${theirs}' as they have no common ancestor`);
1052
- return { ok: false, reason: 'noMergeBase' };
1053
- }
1054
- else if (ex instanceof GitError) {
1055
- data = ex.stdout;
1056
- }
1057
- else {
1058
- scope?.error(ex, 'Failed to execute merge-tree for conflict check');
1059
- return { ok: false, reason: 'other' };
1060
- }
1061
- }
1062
- return { ok: true, result: parseMergeTreeConflict(data ?? '') };
1063
- }
1064
- async checkForPotentialConflicts(repoPath, commits, targetBranch, cancellation, options) {
1065
- const scope = getScopedLogger();
1066
- // Requires Git v2.38+ for --write-tree with 3-arg form
1067
- if (!(await this.git.supports('git:merge-tree:write-tree'))) {
1068
- return createConflictDetectionError('unsupported');
1069
- }
1070
- let currentTreeOid;
1071
- try {
1072
- // Get the initial target branch tree OID
1073
- const treeResult = await this.git.run({ cwd: repoPath, cancellation: cancellation, errors: 'throw' }, 'rev-parse', `${targetBranch}^{tree}`);
1074
- currentTreeOid = treeResult.stdout.trim();
1075
- }
1076
- catch (ex) {
1077
- if (isCancellationError(ex))
1078
- throw ex;
1079
- scope?.error(ex, `Failed to resolve target branch '${targetBranch}'`);
1080
- return createConflictDetectionError('refNotFound');
1081
- }
1082
- const conflictingShas = [];
1083
- const conflictingFilePaths = new Set();
1084
- for (const commit of commits) {
1085
- if (cancellation?.aborted)
1086
- throw new CancellationError();
1087
- // Use merge-tree --write-tree with --merge-base to simulate cherry-pick:
1088
- // merge-tree --write-tree --merge-base=<commit-parent> <current-tree> <commit>
1089
- // This performs a 3-way merge where:
1090
- // - base = commit.parent (where the commit started)
1091
- // - ours = currentTreeOid (current state of the target)
1092
- // - theirs = commit.sha (what we're cherry-picking)
1093
- const step = await this.runMergeTreeStep(repoPath, commit.parent, currentTreeOid, commit.sha, cancellation);
1094
- if (!step.ok)
1095
- return createConflictDetectionError(step.reason);
1096
- const mergeConflict = step.result;
1097
- if (mergeConflict.conflicts.length) {
1098
- conflictingShas.push(commit.sha);
1099
- for (const file of mergeConflict.conflicts) {
1100
- conflictingFilePaths.add(file.path);
1101
- }
1102
- if (options?.stopOnFirstConflict) {
1103
- return {
1104
- status: 'conflicts',
1105
- conflict: {
1106
- repoPath: repoPath,
1107
- branch: commit.sha,
1108
- target: targetBranch,
1109
- files: mergeConflict.conflicts,
1110
- shas: [commit.sha],
1111
- },
1112
- stoppedOnFirstConflict: true,
1113
- treeOid: mergeConflict.treeOid || undefined,
1114
- };
1115
- }
1116
- }
1117
- // Update currentTreeOid to the result tree OID for the next iteration
1118
- // This works even when there are conflicts - the tree contains conflict markers
1119
- if (mergeConflict.treeOid) {
1120
- currentTreeOid = mergeConflict.treeOid;
1121
- }
1122
- }
1123
- if (conflictingShas.length) {
1124
- return {
1125
- status: 'conflicts',
1126
- conflict: {
1127
- repoPath: repoPath,
1128
- branch: conflictingShas[0],
1129
- target: targetBranch,
1130
- files: Array.from(conflictingFilePaths, path => ({ path: path })),
1131
- shas: conflictingShas,
1132
- },
1133
- stoppedOnFirstConflict: false,
1134
- treeOid: currentTreeOid,
1135
- };
1136
- }
1137
- return { status: 'clean', treeOid: currentTreeOid };
1138
- }
1139
- getBaseBranchName(repoPath, ref, options, cancellation) {
1140
- const priority = options?.priority;
1141
- const priorityOpts = priority != null ? { priority: priority } : undefined;
1142
- return this.cache.getBaseBranchName(repoPath, ref, async (commonPath, cacheable, signal) => {
1143
- try {
1144
- // getGkConfig has built-in fallback to regular config for backward compatibility
1145
- let mergeBase = await this.provider.config.getGkConfig(commonPath, `branch.${ref}.gk-merge-base`);
1146
- let update = false;
1147
- // Also check vscode-merge-base in regular config (VS Code compatibility)
1148
- if (mergeBase == null) {
1149
- mergeBase = await this.provider.config.getConfig(commonPath, `branch.${ref}.vscode-merge-base`);
1150
- update = mergeBase != null;
1151
- }
1152
- if (mergeBase != null) {
1153
- const branch = await this.provider.refs.getSymbolicReferenceName(commonPath, mergeBase, priorityOpts);
1154
- if (branch != null) {
1155
- if (update) {
1156
- // Self-write: the value we're storing is exactly what this factory is
1157
- // returning, so any in-flight `branchOverviews` or `baseBranchName` entry
1158
- // being populated against this resolution should NOT be evicted.
1159
- void this.storeBaseBranchName(commonPath, ref, branch, {
1160
- skipInvalidation: ['branchOverviews', 'baseBranchName'],
1161
- });
1162
- }
1163
- return branch;
1164
- }
1165
- }
1166
- }
1167
- catch { }
1168
- const reflog = await this.getBaseBranchFromReflog(commonPath, ref, { upstream: true, priority: priority }, signal);
1169
- if (reflog.branch != null) {
1170
- // Self-write: see comment on the migration path above.
1171
- void this.storeBaseBranchName(commonPath, ref, reflog.branch, {
1172
- skipInvalidation: ['branchOverviews', 'baseBranchName'],
1173
- });
1174
- return reflog.branch;
1175
- }
1176
- // This entry has no TTL and the `'branches'` cascade no longer clears it (a tip move can't
1177
- // change a base), so a failed read cached as `undefined` would read as "no base branch" for
1178
- // the rest of the session. Only a reflog that actually RAN and found nothing is an answer.
1179
- if (reflog.failed) {
1180
- cacheable.invalidate();
1181
- }
1182
- return undefined;
1183
- }, cancellation);
1184
- }
1185
- /**
1186
- * `failed` separates "the reflog ran and had no answer" from "the read never happened" — the caller
1187
- * caches the former forever and must not cache the latter.
1188
- */
1189
- async getBaseBranchFromReflog(repoPath, ref, options, cancellation) {
1190
- const priority = options?.priority;
1191
- const priorityOpts = priority != null ? { priority: priority } : undefined;
1192
- try {
1193
- let result = await this.git.run({ cwd: repoPath, cancellation: cancellation, ...priorityOpts }, 'reflog', ref, '--grep-reflog=branch: Created from *.');
1194
- let entries = result.stdout.split('\n').filter(entry => Boolean(entry));
1195
- if (entries.length !== 1)
1196
- return { branch: undefined, failed: false };
1197
- // Check if branch created from an explicit branch
1198
- let match = entries[0].match(/branch: Created from (.*)$/);
1199
- if (match?.length === 2) {
1200
- let name = match[1];
1201
- if (name !== 'HEAD') {
1202
- if (options?.upstream) {
1203
- const upstream = await this.provider.refs.getSymbolicReferenceName(repoPath, `${name}@{u}`, priorityOpts);
1204
- if (upstream)
1205
- return { branch: upstream, failed: false };
1206
- }
1207
- name = await this.provider.refs.getSymbolicReferenceName(repoPath, name, priorityOpts);
1208
- if (name)
1209
- return { branch: name, failed: false };
1210
- }
1211
- }
1212
- // Check if branch was created from HEAD
1213
- result = await this.git.run({ cwd: repoPath, cancellation: cancellation, ...priorityOpts }, 'reflog', 'HEAD', `--grep-reflog=checkout: moving from .* to ${ref.replace('refs/heads/', '')}`);
1214
- entries = result.stdout.split('\n').filter(entry => Boolean(entry));
1215
- if (!entries.length)
1216
- return { branch: undefined, failed: false };
1217
- match = entries.at(-1).match(/checkout: moving from ([^\s]+)\s/);
1218
- if (match?.length === 2) {
1219
- let name = match[1];
1220
- if (options?.upstream) {
1221
- const upstream = await this.provider.refs.getSymbolicReferenceName(repoPath, `${name}@{u}`, priorityOpts);
1222
- if (upstream)
1223
- return { branch: upstream, failed: false };
1224
- }
1225
- name = await this.provider.refs.getSymbolicReferenceName(repoPath, name, priorityOpts);
1226
- if (name)
1227
- return { branch: name, failed: false };
1228
- }
1229
- }
1230
- catch (ex) {
1231
- if (isCancellationError(ex))
1232
- throw ex;
1233
- // The reads use default error handling, so a spawn failure, queue rejection or swallowed
1234
- // `GitWarnings` match lands here rather than producing an empty answer.
1235
- return { branch: undefined, failed: true };
1236
- }
1237
- return { branch: undefined, failed: false };
1238
- }
1239
- async getStoredMergeTargetBranchName(repoPath, ref) {
1240
- const target = (await this.getStoredUserMergeTargetBranchName?.(repoPath, ref)) ??
1241
- (await this.getStoredDetectedMergeTargetBranchName?.(repoPath, ref));
1242
- return target?.trim() || undefined;
1243
- }
1244
- async getStoredDetectedMergeTargetBranchName(repoPath, ref) {
1245
- const target = (await this.provider.config.getGkConfig(repoPath, `branch.${ref}.gk-merge-target`)) ??
1246
- (await this.provider.config.getGkConfig(repoPath, `branch.${ref}.gk-target-base`)); // legacy key
1247
- return target?.trim() || undefined;
1248
- }
1249
- async getStoredUserMergeTargetBranchName(repoPath, ref) {
1250
- const target = await this.provider.config.getGkConfig(repoPath, `branch.${ref}.gk-merge-target-user`);
1251
- return target?.trim() || undefined;
1252
- }
1253
- /** Updates the last accessed timestamp for the current branch */
1254
- async onCurrentBranchAccessed(repoPath) {
1255
- const branch = await this.getBranch(repoPath);
1256
- if (branch == null || branch.remote || branch.detached)
1257
- return;
1258
- await this.storeBranchMetadata(repoPath, 'gk-last-accessed', branch.name, new Date());
1259
- }
1260
- /** Updates the last accessed and modified timestamp for the current branch */
1261
- async onCurrentBranchModified(repoPath) {
1262
- const branch = await this.getBranch(repoPath);
1263
- if (branch == null || branch.remote || branch.detached)
1264
- return;
1265
- const now = new Date();
1266
- await this.storeBranchMetadata(repoPath, 'gk-last-accessed', branch.name, now);
1267
- await this.storeBranchMetadata(repoPath, 'gk-last-modified', branch.name, now);
1268
- }
1269
- /** Updates the agent last activity timestamp for the current branch */
1270
- async onCurrentBranchAgentActivity(repoPath) {
1271
- const branch = await this.getBranch(repoPath);
1272
- if (branch == null || branch.remote || branch.detached)
1273
- return;
1274
- await this.storeBranchMetadata(repoPath, 'gk-agent-last-activity', branch.name, new Date());
1275
- }
1276
- async renameBranch(repoPath, oldName, newName) {
1277
- const args = ['branch', '-m', oldName, newName];
1278
- try {
1279
- await this.git.run({ cwd: repoPath }, ...args);
1280
- // The branch keeps its identity across a rename, so move its stored gk metadata with it —
1281
- // otherwise the new name re-derives a base it already had, and the old name is left holding
1282
- // metadata for a branch that no longer exists under it.
1283
- await this.provider.config.renameGkConfigBranchSection(repoPath, oldName, newName);
1284
- // Old name's entry is now orphaned; the new name must not inherit a predecessor's base
1285
- this.cache.deleteBaseBranchName(repoPath, oldName);
1286
- this.cache.deleteBaseBranchName(repoPath, newName);
1287
- this.context.hooks?.cache?.onReset?.(repoPath, 'branches');
1288
- this.context.hooks?.repository?.onChanged?.(repoPath, ['heads']);
1289
- }
1290
- catch (ex) {
1291
- throw getGitCommandError('branch', ex, reason => new BranchError({
1292
- reason: reason ?? 'other',
1293
- action: 'rename',
1294
- branch: oldName,
1295
- gitCommand: { repoPath: repoPath, args: args },
1296
- }, ex));
1297
- }
1298
- }
1299
- async setUpstreamBranch(repoPath, name, upstream) {
1300
- const args = upstream == null ? ['branch', '--unset-upstream', name] : ['branch', '--set-upstream-to', upstream, name];
1301
- try {
1302
- await this.git.run({ cwd: repoPath }, ...args);
1303
- this.context.hooks?.cache?.onReset?.(repoPath, 'branches');
1304
- this.context.hooks?.repository?.onChanged?.(repoPath, ['heads']);
1305
- }
1306
- catch (ex) {
1307
- throw getGitCommandError('branch', ex, reason => new BranchError({
1308
- reason: reason ?? 'other',
1309
- action: upstream == null ? 'unset upstream of' : `set upstream to '${upstream}' for`,
1310
- branch: name,
1311
- gitCommand: { repoPath: repoPath, args: args },
1312
- }, ex));
1313
- }
1314
- }
1315
- async storeBaseBranchName(repoPath, ref, base, options) {
1316
- await this.provider.config.setGkConfig(repoPath, `branch.${ref}.gk-merge-base`, base, options);
1317
- }
1318
- async storeMergeTargetBranchName(repoPath, ref, target, options) {
1319
- await this.provider.config.setGkConfig(repoPath, `branch.${ref}.gk-merge-target`, target, options);
1320
- }
1321
- async storeUserMergeTargetBranchName(repoPath, ref, target) {
1322
- await this.provider.config.setGkConfig(repoPath, `branch.${ref}.gk-merge-target-user`, target);
1323
- }
1324
- /**
1325
- * Gets all branch metadata (dates and disposition) from git config in a single batch operation.
1326
- * @returns A map of branch name to metadata.
1327
- */
1328
- getBranchMetadataMap(repoPath) {
1329
- return this.cache.getBranchMetadataMap(repoPath, async (commonPath) => {
1330
- const scope = getScopedLogger();
1331
- const metadataMap = new Map();
1332
- try {
1333
- // Use git config --get-regexp to load all gk-* branch metadata in one call
1334
- const configMap = await this.provider.config.getGkConfigRegex(commonPath, '^branch\\..*\\.gk-(last-(accessed|modified)|disposition|agent-last-activity)$');
1335
- if (!configMap.size)
1336
- return metadataMap;
1337
- for (const [key, value] of configMap) {
1338
- // Extract branch name and metadata key from "branch.{name}.gk-{key}"
1339
- if (!key.startsWith('branch.'))
1340
- continue;
1341
- const keyParts = key.split('.');
1342
- if (keyParts.length < 3)
1343
- continue;
1344
- // Branch name is everything between "branch." and the last ".gk-*"
1345
- const metaKey = keyParts.at(-1);
1346
- const branchName = keyParts.slice(1, -1).join('.');
1347
- let metadata = metadataMap.get(branchName);
1348
- if (metadata == null) {
1349
- metadata = {};
1350
- metadataMap.set(branchName, metadata);
1351
- }
1352
- if (metaKey === 'gk-last-accessed') {
1353
- metadata.lastAccessedAt = value;
1354
- }
1355
- else if (metaKey === 'gk-last-modified') {
1356
- metadata.lastModifiedAt = value;
1357
- }
1358
- else if (metaKey === 'gk-agent-last-activity') {
1359
- metadata.agentLastActivityAt = value;
1360
- }
1361
- else if (metaKey === 'gk-disposition') {
1362
- if (value === 'starred' || value === 'archived') {
1363
- metadata.disposition = value;
1364
- }
1365
- }
1366
- }
1367
- }
1368
- catch (ex) {
1369
- debugger;
1370
- scope?.error(ex);
1371
- }
1372
- return metadataMap;
1373
- });
1374
- }
1375
- async storeBranchMetadata(repoPath, key, ref, date) {
1376
- const value = await this.provider.config.getGkConfig(repoPath, `branch.${ref}.${key}`);
1377
- // Skip if incoming date is not at least 5 minutes newer than stored date
1378
- if (value != null && date.getTime() - new Date(value).getTime() < dateMetadataStaleThresholdMs) {
1379
- return;
1380
- }
1381
- return this.provider.config.setGkConfig(repoPath, `branch.${ref}.${key}`, date.toISOString());
1382
- }
1383
- async setBranchDisposition(repoPath, branchName, disposition) {
1384
- await this.provider.config.setGkConfig(repoPath, `branch.${branchName}.gk-disposition`, disposition);
1385
- this.context.hooks?.cache?.onReset?.(repoPath, 'branches');
1386
- this.context.hooks?.repository?.onChanged?.(repoPath, ['starred']);
1387
- }
1388
- }
1389
- __decorate([
1390
- debug()
1391
- ], BranchesGitSubProvider.prototype, "getBranch", null);
1392
- __decorate([
1393
- debug({ args: repoPath => ({ repoPath: repoPath }) })
1394
- ], BranchesGitSubProvider.prototype, "getBranches", null);
1395
- __decorate([
1396
- debug()
1397
- ], BranchesGitSubProvider.prototype, "getBranchContributionsOverview", null);
1398
- __decorate([
1399
- debug()
1400
- ], BranchesGitSubProvider.prototype, "getBranchesWithCommits", null);
1401
- __decorate([
1402
- debug()
1403
- ], BranchesGitSubProvider.prototype, "getCurrentBranchReference", null);
1404
- __decorate([
1405
- debug({ exit: true })
1406
- ], BranchesGitSubProvider.prototype, "getDefaultBranchName", null);
1407
- __decorate([
1408
- debug()
1409
- ], BranchesGitSubProvider.prototype, "createBranch", null);
1410
- __decorate([
1411
- debug()
1412
- ], BranchesGitSubProvider.prototype, "deleteLocalBranch", null);
1413
- __decorate([
1414
- debug()
1415
- ], BranchesGitSubProvider.prototype, "deleteRemoteBranch", null);
1416
- __decorate([
1417
- debug()
1418
- ], BranchesGitSubProvider.prototype, "getBranchMergedStatus", null);
1419
- __decorate([
1420
- debug()
1421
- ], BranchesGitSubProvider.prototype, "getLocalBranchByUpstream", null);
1422
- __decorate([
1423
- debug()
1424
- ], BranchesGitSubProvider.prototype, "getPotentialApplyConflicts", null);
1425
- __decorate([
1426
- debug()
1427
- ], BranchesGitSubProvider.prototype, "getPotentialMergeConflicts", null);
1428
- __decorate([
1429
- debug()
1430
- ], BranchesGitSubProvider.prototype, "getPotentialStashReapplyConflicts", null);
1431
- __decorate([
1432
- debug({ exit: true })
1433
- ], BranchesGitSubProvider.prototype, "getBaseBranchName", null);
1434
- __decorate([
1435
- debug({ exit: true })
1436
- ], BranchesGitSubProvider.prototype, "getStoredMergeTargetBranchName", null);
1437
- __decorate([
1438
- debug({ exit: true })
1439
- ], BranchesGitSubProvider.prototype, "getStoredDetectedMergeTargetBranchName", null);
1440
- __decorate([
1441
- debug()
1442
- ], BranchesGitSubProvider.prototype, "getStoredUserMergeTargetBranchName", null);
1443
- __decorate([
1444
- debounce(2.5 * 60 * 1000),
1445
- debug()
1446
- ], BranchesGitSubProvider.prototype, "onCurrentBranchAccessed", null);
1447
- __decorate([
1448
- debounce(2.5 * 60 * 1000),
1449
- debug()
1450
- ], BranchesGitSubProvider.prototype, "onCurrentBranchModified", null);
1451
- __decorate([
1452
- debounce(2.5 * 60 * 1000),
1453
- debug()
1454
- ], BranchesGitSubProvider.prototype, "onCurrentBranchAgentActivity", null);
1455
- __decorate([
1456
- debug()
1457
- ], BranchesGitSubProvider.prototype, "renameBranch", null);
1458
- __decorate([
1459
- debug()
1460
- ], BranchesGitSubProvider.prototype, "setUpstreamBranch", null);
1461
- __decorate([
1462
- debug()
1463
- ], BranchesGitSubProvider.prototype, "storeBaseBranchName", null);
1464
- __decorate([
1465
- debug()
1466
- ], BranchesGitSubProvider.prototype, "storeMergeTargetBranchName", null);
1467
- __decorate([
1468
- debug()
1469
- ], BranchesGitSubProvider.prototype, "storeUserMergeTargetBranchName", null);
25
+ const dateMetadataStaleThresholdMs = 3e5;
26
+ var BranchesGitSubProvider = class {
27
+ context;
28
+ git;
29
+ cache;
30
+ provider;
31
+ constructor(context, git, cache, provider) {
32
+ this.context = context;
33
+ this.git = git;
34
+ this.cache = cache;
35
+ this.provider = provider;
36
+ }
37
+ async getBranch(repoPath, name, cancellation) {
38
+ if (name != null) {
39
+ const { values: [branch] } = await this.getBranches(repoPath, { filter: (b) => b.name === name }, cancellation);
40
+ return branch;
41
+ }
42
+ const branchPromise = this.cache.branch.getOrCreate(repoPath, async (_cacheable, signal) => {
43
+ const { values: [branch] } = await this.getBranches(repoPath, { filter: (b) => b.current }, signal);
44
+ return branch ?? this.getCurrentBranch(repoPath, void 0, void 0, signal);
45
+ }, cancellation);
46
+ if (branchPromise == null) {
47
+ const { values: [branch] } = await this.getBranches(repoPath, { filter: (b) => b.current }, cancellation);
48
+ return branch ?? this.getCurrentBranch(repoPath, void 0, void 0, cancellation);
49
+ }
50
+ return branchPromise;
51
+ }
52
+ async getCurrentBranch(repoPath, metadataMap, ordering, cancellation) {
53
+ const ref = await this.getCurrentBranchReferenceCore(repoPath, ordering, cancellation);
54
+ if (ref == null) return void 0;
55
+ const [pausedOpStatusResult, committerDateResult, defaultWorktreePathResult, metadataMapResult] = await Promise.allSettled([
56
+ isDetachedHead(ref.name) ? this.provider.pausedOps?.getPausedOperationStatus(repoPath, void 0, cancellation) : void 0,
57
+ this.git.run({
58
+ cwd: repoPath,
59
+ cancellation,
60
+ configs: gitConfigsLog,
61
+ errors: "ignore"
62
+ }, "log", "-n1", "--format=%ct", ordering ? `--${ordering}-order` : void 0, "--").then((result) => result.stdout ? result.stdout.trim() : void 0),
63
+ this.provider.config.getDefaultWorktreePath?.(repoPath),
64
+ metadataMap != null ? Promise.resolve(metadataMap) : this.getBranchMetadataMap(repoPath)
65
+ ]);
66
+ const committerDate = getSettledValue(committerDateResult);
67
+ const pausedOpStatus = getSettledValue(pausedOpStatusResult);
68
+ const rebaseStatus = pausedOpStatus?.type === "rebase" ? pausedOpStatus : void 0;
69
+ const defaultWorktreePath = getSettledValue(defaultWorktreePathResult);
70
+ metadataMap ??= getSettledValue(metadataMapResult);
71
+ const metadata = metadataMap?.get(ref.name);
72
+ if (cancellation?.aborted) throw new CancellationError();
73
+ const branchRefName = rebaseStatus?.incoming.name ?? `refs/heads/${ref.name}`;
74
+ return new GitBranch(repoPath, branchRefName, true, committerDate != null ? /* @__PURE__ */ new Date(Number(committerDate) * 1e3) : void 0, metadata, ref.sha, ref.upstream ? {
75
+ ...ref.upstream,
76
+ state: {
77
+ ahead: 0,
78
+ behind: 0
79
+ }
80
+ } : void 0, {
81
+ path: repoPath,
82
+ isDefault: repoPath === defaultWorktreePath
83
+ }, void 0, rebaseStatus != null);
84
+ }
85
+ async getBranches(repoPath, options, cancellation) {
86
+ if (repoPath == null) return emptyPagedResult;
87
+ const scope = getScopedLogger();
88
+ const getCore = async (commonPath, cacheable, signal) => {
89
+ signal ??= cancellation;
90
+ try {
91
+ try {
92
+ var _usingCtx$1 = _usingCtx();
93
+ const [recordsResult, supportedResult, defaultWorktreePathResult, metadataMapResult] = await Promise.allSettled([
94
+ this.provider.refs.getRefs(commonPath, signal),
95
+ this.git.supported("git:for-each-ref"),
96
+ this.provider.config.getDefaultWorktreePath?.(commonPath),
97
+ this.getBranchMetadataMap(commonPath)
98
+ ]);
99
+ const records = getSettledValue(recordsResult) ?? [];
100
+ const supported = getSettledValue(supportedResult) ?? [];
101
+ const metadataMap = getSettledValue(metadataMapResult) ?? /* @__PURE__ */ new Map();
102
+ const defaultWorktreePath = getSettledValue(defaultWorktreePathResult);
103
+ const worktreePathSupported = supported.includes("git:for-each-ref:worktreePath");
104
+ if (!records.length) {
105
+ cacheable?.invalidate();
106
+ const current = await this.getCurrentBranch(commonPath, metadataMap, options?.ordering ?? this.context.config?.commits.ordering ?? void 0, signal);
107
+ return current != null ? { values: [current] } : emptyPagedResult;
108
+ }
109
+ const sw = _usingCtx$1.u(maybeStopWatch(scope, { log: {
110
+ onlyExit: true,
111
+ level: "debug"
112
+ } }));
113
+ const branches = [];
114
+ for (const record of records) {
115
+ const fullName = record.name;
116
+ if (!fullName.startsWith("refs/heads/") && !fullName.startsWith("refs/remotes/")) continue;
117
+ if (isRemoteHEAD(fullName)) continue;
118
+ const upstream = parseUpstream(record.upstream, record.upstreamTracking);
119
+ const metadata = metadataMap.get(parseRefName(fullName).name);
120
+ const worktreePath = record.worktreePath ? normalizePath(record.worktreePath) : void 0;
121
+ branches.push(new GitBranch(commonPath, fullName, false, record.committerDate ? new Date(record.committerDate) : void 0, metadata, record.objectname, upstream, worktreePathSupported ? worktreePath ? {
122
+ path: worktreePath,
123
+ isDefault: worktreePath === defaultWorktreePath
124
+ } : false : void 0));
125
+ }
126
+ sw?.stop({ suffix: ` parsed ${branches.length} branches` });
127
+ for (const branch of branches) if (branch.worktree && branch.worktree.path) {
128
+ const { name } = parseRefName(branch.refName);
129
+ const reference = createReference(name, branch.worktree.path, {
130
+ refType: "branch",
131
+ name,
132
+ id: getBranchId(branch.worktree.path, false, name),
133
+ remote: false,
134
+ upstream: branch.upstream?.name ? {
135
+ name: branch.upstream.name,
136
+ missing: branch.upstream.missing
137
+ } : void 0,
138
+ sha: branch.sha
139
+ });
140
+ this.cache.setCurrentBranchReferenceIfAbsent(branch.worktree.path, reference);
141
+ }
142
+ return branches.length ? { values: branches } : emptyPagedResult;
143
+ } catch (_) {
144
+ _usingCtx$1.e = _;
145
+ } finally {
146
+ _usingCtx$1.d();
147
+ }
148
+ } catch (ex) {
149
+ cacheable?.invalidate();
150
+ if (isCancellationError(ex)) throw ex;
151
+ return emptyPagedResult;
152
+ }
153
+ };
154
+ const mapBranches = async (shared, targetRepoPath, commonPath, mapperSignal) => {
155
+ if (!shared.values.length) return shared;
156
+ mapperSignal ??= cancellation;
157
+ const [currentRefResult, defaultWorktreePathResult] = await Promise.allSettled([this.getCurrentBranchReferenceCore(targetRepoPath, void 0, mapperSignal), this.provider.config.getDefaultWorktreePath?.(commonPath)]);
158
+ const currentRef = getSettledValue(currentRefResult);
159
+ const defaultWorktreePath = getSettledValue(defaultWorktreePathResult);
160
+ const isDetached = currentRef != null && isDetachedHead(currentRef.name);
161
+ const branches = shared.values.map((b) => {
162
+ const isCurrent = !b.remote && b.name === currentRef?.name && !isDetached;
163
+ if (!isCurrent && targetRepoPath === commonPath) return b;
164
+ return new GitBranch(targetRepoPath, b.refName, isCurrent, b.date, b.metadata, b.sha, b.upstream, isCurrent ? b.worktree ?? {
165
+ path: targetRepoPath,
166
+ isDefault: targetRepoPath === defaultWorktreePath
167
+ } : b.worktree, false, false);
168
+ });
169
+ if (isDetached || currentRef != null && !branches.some((b) => b.current)) {
170
+ const metadataMap = await this.getBranchMetadataMap(commonPath);
171
+ const current = await this.getCurrentBranch(targetRepoPath, metadataMap, options?.ordering ?? this.context.config?.commits.ordering ?? void 0, mapperSignal);
172
+ if (current != null) {
173
+ const index = branches.findIndex((b) => b.id === current.id);
174
+ if (index !== -1) branches[index] = current;
175
+ else branches.unshift(current);
176
+ }
177
+ }
178
+ return {
179
+ ...shared,
180
+ values: branches
181
+ };
182
+ };
183
+ let result;
184
+ if (options?.paging?.cursor != null) {
185
+ const commonPath = this.cache.getCommonPath(repoPath);
186
+ result = await mapBranches(await getCore(commonPath), repoPath, commonPath);
187
+ } else result = await this.cache.getBranches(repoPath, getCore, mapBranches, cancellation);
188
+ if (options?.filter != null) result = {
189
+ ...result,
190
+ values: result.values.filter(options.filter)
191
+ };
192
+ if (options?.sort) sortBranches(result.values, typeof options.sort === "boolean" ? void 0 : options.sort);
193
+ return result;
194
+ }
195
+ async getBranchContributionsOverview(repoPath, ref, options, cancellation) {
196
+ const scope = getScopedLogger();
197
+ const priority = options?.priority;
198
+ const priorityOpts = priority != null ? { priority } : void 0;
199
+ const fetchBody = async (mergeTarget, signal) => {
200
+ const mergeBase = await this.provider.refs.getMergeBase(repoPath, ref, mergeTarget, priorityOpts, signal);
201
+ if (mergeBase == null) return void 0;
202
+ const [contributorsSettled, mergeBaseDatesSettled] = await Promise.allSettled([this.provider.contributors.getContributors(repoPath, createRevisionRange(mergeBase, ref, ".."), { stats: true }, signal), this.provider.commits.getCommitDates(repoPath, mergeBase, signal)]);
203
+ if (signal?.aborted) throw new CancellationError();
204
+ const result = getSettledValue(contributorsSettled) ?? { contributors: [] };
205
+ const mergeBaseDates = getSettledValue(mergeBaseDatesSettled);
206
+ sortContributors(result.contributors, { orderBy: "score:desc" });
207
+ let totalCommits = 0;
208
+ let totalFiles = 0;
209
+ let totalAdditions = 0;
210
+ let totalDeletions = 0;
211
+ let firstCommitTimestamp;
212
+ let latestCommitTimestamp;
213
+ for (const c of result.contributors) {
214
+ totalCommits += c.contributionCount;
215
+ totalFiles += c.stats?.files ?? 0;
216
+ totalAdditions += c.stats?.additions ?? 0;
217
+ totalDeletions += c.stats?.deletions ?? 0;
218
+ const firstTimestamp = c.firstCommitDate?.getTime();
219
+ const latestTimestamp = c.latestCommitDate?.getTime();
220
+ if (firstTimestamp != null || latestTimestamp != null) {
221
+ firstCommitTimestamp = firstCommitTimestamp != null ? Math.min(firstCommitTimestamp, firstTimestamp ?? Infinity, latestTimestamp ?? Infinity) : firstTimestamp ?? latestTimestamp;
222
+ latestCommitTimestamp = latestCommitTimestamp != null ? Math.max(latestCommitTimestamp, firstTimestamp ?? -Infinity, latestTimestamp ?? -Infinity) : latestTimestamp ?? firstTimestamp;
223
+ }
224
+ }
225
+ return {
226
+ repoPath,
227
+ branch: ref,
228
+ mergeTarget,
229
+ mergeBase,
230
+ mergeBaseDate: mergeBaseDates?.committerDate,
231
+ commits: totalCommits,
232
+ files: totalFiles,
233
+ additions: totalAdditions,
234
+ deletions: totalDeletions,
235
+ latestCommitDate: latestCommitTimestamp != null ? new Date(latestCommitTimestamp) : void 0,
236
+ firstCommitDate: firstCommitTimestamp != null ? new Date(firstCommitTimestamp) : void 0,
237
+ contributors: result.contributors
238
+ };
239
+ };
240
+ try {
241
+ let mergeTarget;
242
+ const storedTarget = await this.getStoredMergeTargetBranchName(repoPath, ref);
243
+ if (storedTarget) mergeTarget = await this.provider.refs.getSymbolicReferenceName(repoPath, storedTarget, priorityOpts, cancellation) || storedTarget;
244
+ if (mergeTarget == null && options?.associatedPullRequest != null) {
245
+ const pr = await options.associatedPullRequest;
246
+ if (pr?.refs?.base != null) {
247
+ const branch = await this.getBranch(repoPath, ref, cancellation);
248
+ if (branch == null) return void 0;
249
+ mergeTarget = `${branch.remoteName}/${pr.refs.base.branch}`;
250
+ if (pr.stack == null) this.storeMergeTargetBranchName(repoPath, ref, mergeTarget, { skipInvalidation: ["branchOverviews"] });
251
+ }
252
+ }
253
+ mergeTarget ??= await this.getBaseBranchName(repoPath, ref, priorityOpts, cancellation);
254
+ mergeTarget ??= await this.getDefaultBranchName(repoPath, void 0, priorityOpts, cancellation);
255
+ if (mergeTarget == null) return void 0;
256
+ const resolvedTarget = mergeTarget;
257
+ return await this.cache.getBranchOverview(repoPath, `${ref}|${resolvedTarget}`, (_commonPath, _cacheable, signal) => fetchBody(resolvedTarget, signal ?? cancellation), { cancellation });
258
+ } catch (ex) {
259
+ scope?.error(ex);
260
+ if (isCancellationError(ex)) throw ex;
261
+ return;
262
+ }
263
+ }
264
+ async getBranchesWithCommits(repoPath, commits, branch, options, cancellation) {
265
+ if (branch != null) {
266
+ const data = (await this.branchesContainingCore(repoPath, commits, {
267
+ mode: "contains",
268
+ name: branch
269
+ }, cancellation)).stdout.trim();
270
+ return data ? [data] : [];
271
+ }
272
+ const result = await this.branchesContainingCore(repoPath, commits, options, cancellation);
273
+ if (!result.stdout) return [];
274
+ return filterMap(result.stdout.split("\n"), (b) => b.trim() || void 0);
275
+ }
276
+ async branchesContainingCore(repoPath, refs, options, cancellation) {
277
+ const params = ["branch"];
278
+ if (options?.all) params.push("-a");
279
+ else if (options?.remotes) params.push("-r");
280
+ params.push("--format=%(refname:short)");
281
+ for (const ref of refs) params.push(options?.mode === "pointsAt" ? `--points-at=${ref}` : `--contains=${ref}`);
282
+ if (options?.name != null) params.push(options.name);
283
+ return this.git.run({
284
+ cwd: repoPath,
285
+ cancellation,
286
+ configs: gitConfigsBranch,
287
+ errors: "ignore"
288
+ }, ...params);
289
+ }
290
+ async getCurrentBranchReference(repoPath, cancellation) {
291
+ let ref = await this.getCurrentBranchReferenceCore(repoPath, void 0, cancellation);
292
+ if (ref != null && isDetachedHead(ref.name)) ref = createReference(ref.sha, repoPath, {
293
+ refType: "branch",
294
+ name: formatDetachedHeadName(ref.sha),
295
+ id: getBranchId(repoPath, ref.remote, ref.sha),
296
+ remote: ref.remote,
297
+ upstream: ref.upstream,
298
+ sha: ref.sha
299
+ });
300
+ return ref;
301
+ }
302
+ getCurrentBranchReferenceCore(repoPath, ordering, cancellation) {
303
+ return this.cache.currentBranchReference.getOrCreate(repoPath, async (_cacheable, signal) => {
304
+ const commitOrdering = ordering;
305
+ let data;
306
+ let result;
307
+ try {
308
+ result = await this.git.run({
309
+ cwd: repoPath,
310
+ cancellation: signal,
311
+ errors: "throw"
312
+ }, "rev-parse", "--abbrev-ref", "--symbolic-full-name", "@", "@{u}", "--");
313
+ data = [result.stdout, void 0];
314
+ } catch (ex) {
315
+ if (isCancellationError(ex)) throw ex;
316
+ const msg = ex?.toString() ?? "";
317
+ if (GitErrors.badRevision.test(msg) || GitWarnings.noUpstream.test(msg)) {
318
+ if (ex.stdout != null && ex.stdout.length !== 0) data = [ex.stdout, void 0];
319
+ else {
320
+ try {
321
+ result = await this.git.run({
322
+ cwd: repoPath,
323
+ cancellation: signal
324
+ }, "symbolic-ref", "--short", "HEAD");
325
+ if (result.stdout) data = [result.stdout.trim(), void 0];
326
+ } catch {
327
+ if (isCancellationError(ex)) throw ex;
328
+ }
329
+ if (data == null) {
330
+ const symbolicRef = await this.getDefaultBranchName(repoPath, "origin", void 0, signal);
331
+ if (symbolicRef != null) data = [symbolicRef.startsWith("origin/") ? symbolicRef.substring(7) : symbolicRef, void 0];
332
+ }
333
+ if (data == null) {
334
+ const defaultBranch = await this.provider.config.getConfig(repoPath, "init.defaultBranch") ?? "main";
335
+ const configMap = await this.provider.config.getConfigRegex(repoPath, `branch\\.${defaultBranch}\\.+`, { runGitLocally: true });
336
+ const remote = configMap.get(`branch.${defaultBranch}.remote`);
337
+ const merge = configMap.get(`branch.${defaultBranch}.merge`);
338
+ const remoteBranch = merge?.startsWith("refs/heads/") ? merge.substring(11) : void 0;
339
+ data = [`${defaultBranch}${remote && remoteBranch ? `\n${remote}/${remoteBranch}` : ""}`, void 0];
340
+ }
341
+ }
342
+ } else if (GitWarnings.headNotABranch.test(msg)) {
343
+ result = await this.git.run({
344
+ cwd: repoPath,
345
+ cancellation: signal,
346
+ configs: gitConfigsLog,
347
+ errors: "ignore"
348
+ }, "log", "-n1", "--format=%H", commitOrdering ? `--${commitOrdering}-order` : void 0, "--");
349
+ if (result.completion.status === "cancelled" || signal?.aborted) throw new CancellationError();
350
+ const sha = result.stdout.trim();
351
+ if (sha) data = [`(HEAD detached at ${shortenRevision(sha)})`, sha];
352
+ } else _logger.warn(`[${repoPath}] Unable to get current branch: ${ex}`);
353
+ }
354
+ if (data == null) return void 0;
355
+ const [name, upstream] = data[0].split("\n");
356
+ return createReference(name, repoPath, {
357
+ refType: "branch",
358
+ name,
359
+ id: getBranchId(repoPath, false, name),
360
+ remote: false,
361
+ upstream: upstream ? {
362
+ name: upstream,
363
+ missing: false
364
+ } : void 0,
365
+ sha: data[1]
366
+ });
367
+ }, { cancellation });
368
+ }
369
+ async getDefaultBranchName(repoPath, remote, options, cancellation) {
370
+ if (repoPath == null) return void 0;
371
+ remote ??= "origin";
372
+ const priority = options?.priority;
373
+ const priorityOpts = priority != null ? { priority } : void 0;
374
+ if (options?.local) return this.cache.getDefaultBranchName(repoPath, `${remote}:local`, async (commonPath, cacheable, signal) => {
375
+ try {
376
+ return (await this.git.run({
377
+ cwd: commonPath,
378
+ cancellation: signal ?? cancellation,
379
+ ...priorityOpts
380
+ }, "symbolic-ref", "--short", `refs/remotes/${remote}/HEAD`)).stdout.trim() || void 0;
381
+ } catch (ex) {
382
+ if (isCancellationError(ex)) throw ex;
383
+ if ((ex.stderr ?? "").includes("is not a symbolic ref")) return void 0;
384
+ cacheable.invalidate();
385
+ return;
386
+ }
387
+ }, cancellation);
388
+ return this.cache.getDefaultBranchName(repoPath, remote, async (commonPath, cacheable, signal) => {
389
+ let retried = false;
390
+ while (true) try {
391
+ return (await this.git.run({
392
+ cwd: commonPath,
393
+ cancellation: signal ?? cancellation,
394
+ ...priorityOpts
395
+ }, "symbolic-ref", "--short", `refs/remotes/${remote}/HEAD`)).stdout.trim() || void 0;
396
+ } catch (ex) {
397
+ let answered = false;
398
+ if (/is not a symbolic ref/.test(ex.stderr)) try {
399
+ if (!retried) {
400
+ retried = true;
401
+ await this.git.run({
402
+ cwd: commonPath,
403
+ cancellation: signal ?? cancellation,
404
+ ...priorityOpts
405
+ }, "remote", "set-head", "-a", remote);
406
+ this.cache.deleteDefaultBranchName(commonPath, `${remote}:local`);
407
+ continue;
408
+ }
409
+ const result = await this.git.run({
410
+ cwd: commonPath,
411
+ cancellation: signal ?? cancellation,
412
+ ...priorityOpts
413
+ }, "ls-remote", "--symref", remote, "HEAD");
414
+ if (result.stdout) {
415
+ const match = /ref:\s(\S+)\s+HEAD/m.exec(result.stdout);
416
+ if (match != null) {
417
+ const [, branch] = match;
418
+ return `${remote}/${branch.substring(11).trim()}`;
419
+ }
420
+ }
421
+ answered = true;
422
+ } catch {
423
+ if (isCancellationError(ex)) throw ex;
424
+ }
425
+ if (!answered) cacheable.invalidate();
426
+ return;
427
+ }
428
+ }, cancellation);
429
+ }
430
+ async createBranch(repoPath, name, ref, options) {
431
+ const args = [
432
+ "branch",
433
+ name,
434
+ ref
435
+ ];
436
+ if (options?.noTracking) args.push("--no-track");
437
+ try {
438
+ await this.git.run({ cwd: repoPath }, ...args);
439
+ this.cache.deleteBaseBranchName(repoPath, name);
440
+ this.context.hooks?.cache?.onReset?.(repoPath, "branches");
441
+ this.context.hooks?.repository?.onChanged?.(repoPath, ["heads"]);
442
+ } catch (ex) {
443
+ throw getGitCommandError("branch", ex, (reason) => new BranchError({
444
+ reason: reason ?? "other",
445
+ action: "create",
446
+ branch: name,
447
+ gitCommand: {
448
+ repoPath,
449
+ args
450
+ }
451
+ }, ex));
452
+ }
453
+ }
454
+ async deleteLocalBranch(repoPath, names, options) {
455
+ const branches = ensureArray(names);
456
+ const args = [
457
+ "branch",
458
+ options?.force ? "-D" : "-d",
459
+ ...branches
460
+ ];
461
+ try {
462
+ await this.git.run({ cwd: repoPath }, ...args);
463
+ for (const branch of branches) {
464
+ this.cache.deleteBaseBranchName(repoPath, branch);
465
+ await this.provider.config.removeGkConfigBranchSection(repoPath, branch);
466
+ }
467
+ this.context.hooks?.cache?.onReset?.(repoPath, "branches");
468
+ this.context.hooks?.repository?.onChanged?.(repoPath, ["heads"]);
469
+ } catch (ex) {
470
+ if (await this.cleanupDeletedBranchMetadata(repoPath, branches)) {
471
+ this.context.hooks?.cache?.onReset?.(repoPath, "branches");
472
+ this.context.hooks?.repository?.onChanged?.(repoPath, ["heads"]);
473
+ }
474
+ if (ex instanceof BranchError) throw ex.update({
475
+ action: options?.force ? "force delete" : "delete",
476
+ branch: branches.join(", "),
477
+ gitCommand: {
478
+ repoPath,
479
+ args
480
+ }
481
+ });
482
+ throw getGitCommandError("branch", ex, (reason) => new BranchError({
483
+ reason: reason ?? "other",
484
+ action: options?.force ? "force delete" : "delete",
485
+ branch: branches.join(", "),
486
+ gitCommand: {
487
+ repoPath,
488
+ args
489
+ }
490
+ }, ex));
491
+ }
492
+ }
493
+ /**
494
+ * Drops the cached and persisted per-branch metadata for whichever of `names` no longer exists. Only
495
+ * for the partial-failure path — one extra `for-each-ref` is cheap while already handling an error,
496
+ * and keeps the success path free of it.
497
+ *
498
+ * Returns whether any of `names` is confirmed gone; `false` when the probe couldn't answer, so a
499
+ * spurious notification is never fired on an unrelated failure.
500
+ */
501
+ async cleanupDeletedBranchMetadata(repoPath, names) {
502
+ try {
503
+ const result = await this.git.run({
504
+ cwd: repoPath,
505
+ errors: "ignore"
506
+ }, "for-each-ref", "--format=%(refname)", ...names.map((n) => `refs/heads/${n}`));
507
+ if (result.completion.status !== "exited" || result.exitCode !== 0) return false;
508
+ const prefix = "refs/heads/";
509
+ const surviving = new Set(result.stdout.split("\n").map((l) => l.trim()).filter((l) => l.startsWith(prefix)).map((l) => l.substring(11)));
510
+ let anyDeleted = false;
511
+ for (const name of names) {
512
+ if (surviving.has(name)) continue;
513
+ anyDeleted = true;
514
+ this.cache.deleteBaseBranchName(repoPath, name);
515
+ await this.provider.config.removeGkConfigBranchSection(repoPath, name);
516
+ }
517
+ return anyDeleted;
518
+ } catch {
519
+ return false;
520
+ }
521
+ }
522
+ async deleteRemoteBranch(repoPath, names, remote) {
523
+ const branches = ensureArray(names);
524
+ const args = [
525
+ "push",
526
+ "-d",
527
+ remote,
528
+ ...branches
529
+ ];
530
+ try {
531
+ await this.git.run({ cwd: repoPath }, ...args);
532
+ this.context.hooks?.cache?.onReset?.(repoPath, "branches");
533
+ this.context.hooks?.repository?.onChanged?.(repoPath, ["remotes"]);
534
+ } catch (ex) {
535
+ if (ex instanceof BranchError) throw ex.update({
536
+ action: "delete",
537
+ branch: branches.join(", "),
538
+ gitCommand: {
539
+ repoPath,
540
+ args
541
+ }
542
+ });
543
+ throw getGitCommandError("push", ex, (reason) => new BranchError({
544
+ reason: reason === "rejectedRefDoesNotExist" ? "noRemoteReference" : "other",
545
+ action: "delete",
546
+ branch: branches.join(", "),
547
+ gitCommand: {
548
+ repoPath,
549
+ args
550
+ }
551
+ }, ex));
552
+ }
553
+ }
554
+ async getBranchMergedStatus(repoPath, branch, into, cancellation) {
555
+ if (branch.name === into.name || branch.upstream?.name === into.name) return { merged: false };
556
+ const localInto = into.remote ? await this.getLocalBranchByUpstream(repoPath, into.name, cancellation) : void 0;
557
+ const cacheKey = branch.sha != null && into.sha != null ? `${branch.remote ? "r" : "l"}:${branch.name}@${branch.sha}|${into.remote ? "r" : "l"}:${into.name}@${into.sha}${localInto?.sha != null ? `|L:${localInto.name}@${localInto.sha}` : ""}` : `${branch.remote ? "r" : "l"}:${branch.name}|${into.remote ? "r" : "l"}:${into.name}`;
558
+ return this.cache.getBranchMergedStatus(repoPath, cacheKey, async (commonPath, _cacheable, signal) => {
559
+ const result = await this.getBranchMergedStatusCore(commonPath, branch, into, signal);
560
+ if (result.merged) return result;
561
+ if (localInto != null && localInto.name !== branch.name) {
562
+ if (localInto.sha != null && localInto.sha === into.sha) return { merged: false };
563
+ const result = await this.getBranchMergedStatusCore(commonPath, branch, localInto, signal);
564
+ if (result.merged) return {
565
+ ...result,
566
+ localBranchOnly: createReference(localInto.ref, commonPath, {
567
+ id: getBranchId(commonPath, localInto.remote, localInto.name),
568
+ refType: "branch",
569
+ name: localInto.name,
570
+ remote: localInto.remote,
571
+ upstream: localInto.upstream,
572
+ sha: localInto.sha
573
+ })
574
+ };
575
+ }
576
+ return { merged: false };
577
+ }, cancellation);
578
+ }
579
+ async getBranchMergedStatusCore(repoPath, branch, into, cancellation) {
580
+ const scope = getScopedLogger();
581
+ try {
582
+ try {
583
+ await this.git.run({
584
+ cwd: repoPath,
585
+ cancellation,
586
+ errors: "throw"
587
+ }, "merge-base", "--is-ancestor", branch.name, into.name);
588
+ return {
589
+ merged: true,
590
+ confidence: "highest"
591
+ };
592
+ } catch (ex) {
593
+ if (isCancellationError(ex)) throw ex;
594
+ }
595
+ let result = await this.git.run({
596
+ cwd: repoPath,
597
+ cancellation
598
+ }, "cherry", "--abbrev", "-v", into.name, branch.name);
599
+ if (!result.stdout || result.stdout.trim().split("\n").every((l) => l.startsWith("-"))) return {
600
+ merged: true,
601
+ confidence: "high"
602
+ };
603
+ const mergeBase = await this.provider.refs.getMergeBase(repoPath, into.name, branch.name, void 0, cancellation);
604
+ result = await this.git.run({
605
+ cwd: repoPath,
606
+ cancellation
607
+ }, "diff", mergeBase, branch.name);
608
+ if (result.stdout) try {
609
+ var _usingCtx3 = _usingCtx();
610
+ const { env } = _usingCtx3.a(await this.provider.staging.createTemporaryIndex(repoPath, "ref", into.name));
611
+ result = await this.git.run({
612
+ cwd: repoPath,
613
+ cancellation,
614
+ env,
615
+ errors: "ignore",
616
+ stdin: result.stdout
617
+ }, "apply", "--cached", "--reverse", "--check", "-");
618
+ if (result.exitCode === 0 && !result.stdout.trim() && !result.stderr?.trim()) return {
619
+ merged: true,
620
+ confidence: "medium"
621
+ };
622
+ } catch (_) {
623
+ _usingCtx3.e = _;
624
+ } finally {
625
+ await _usingCtx3.d();
626
+ }
627
+ return { merged: false };
628
+ } catch (ex) {
629
+ if (_logger.enabled("trace")) scope?.error(ex);
630
+ if (isCancellationError(ex)) throw ex;
631
+ return { merged: false };
632
+ }
633
+ }
634
+ async getLocalBranchByUpstream(repoPath, remoteBranchName, cancellation) {
635
+ const branches = new PageableResult((p) => this.getBranches(repoPath, p != null ? { paging: p } : void 0, cancellation));
636
+ return getLocalBranchByUpstream(remoteBranchName, branches);
637
+ }
638
+ /** Detects potential conflicts when applying commits onto a target branch (git rebase and cherry-pick) */
639
+ async getPotentialApplyConflicts(repoPath, targetBranch, shas, options, cancellation) {
640
+ if (!shas.length) return { status: "clean" };
641
+ const cacheKey = `apply:${targetBranch}:${shas.join(",")}:${options?.stopOnFirstConflict ?? false}`;
642
+ return this.cache.conflictDetection.getOrCreate(repoPath, cacheKey, async (_cacheable, signal) => {
643
+ const parentRefs = shas.map((c) => `${c}^`);
644
+ let parentShas;
645
+ try {
646
+ parentShas = (await this.git.run({
647
+ cwd: repoPath,
648
+ cancellation: signal,
649
+ errors: "throw"
650
+ }, "rev-parse", ...parentRefs)).stdout.trim().split("\n");
651
+ } catch (ex) {
652
+ if (isCancellationError(ex)) throw ex;
653
+ return createConflictDetectionError("noParent");
654
+ }
655
+ if (parentShas.length !== shas.length) return createConflictDetectionError("refNotFound");
656
+ const commitsWithParents = shas.map((c, i) => ({
657
+ sha: c,
658
+ parent: parentShas[i]
659
+ }));
660
+ return this.checkForPotentialConflicts(repoPath, commitsWithParents, targetBranch, signal, options);
661
+ }, { cancellation });
662
+ }
663
+ /** Detects potential conflict when merge a branch into a target branch (git merge) */
664
+ async getPotentialMergeConflicts(repoPath, branch, targetBranch, cancellation) {
665
+ const scope = getScopedLogger();
666
+ const cacheKey = `merge:${branch}:${targetBranch}`;
667
+ return this.cache.conflictDetection.getOrCreate(repoPath, cacheKey, async (_cacheable, signal) => {
668
+ if (!await this.git.supports("git:merge-tree:write-tree")) return createConflictDetectionError("unsupported");
669
+ let data;
670
+ try {
671
+ data = (await this.git.run({
672
+ cwd: repoPath,
673
+ cancellation: signal,
674
+ errors: "throw"
675
+ }, "merge-tree", "-z", "--name-only", "--no-messages", branch, targetBranch)).stdout;
676
+ } catch (ex) {
677
+ if (isCancellationError(ex)) throw ex;
678
+ const msg = ex?.toString() ?? "";
679
+ if (GitErrors.notAValidObjectName.test(msg)) {
680
+ scope?.error(ex, `'${targetBranch}' or '${branch}' not found - ensure the branches exist and are fully qualified (e.g. 'refs/heads/main')`);
681
+ return createConflictDetectionError("refNotFound");
682
+ } else if (GitErrors.badRevision.test(msg)) {
683
+ scope?.error(ex, `Invalid branch name: ${msg.slice(msg.indexOf("'"))}`);
684
+ return createConflictDetectionError("refNotFound");
685
+ } else if (GitErrors.noMergeBase.test(msg)) {
686
+ scope?.error(ex, `Unable to merge '${branch}' and '${targetBranch}' as they have no common ancestor`);
687
+ return createConflictDetectionError("noMergeBase");
688
+ } else if (ex instanceof GitError) data = ex.stdout;
689
+ else {
690
+ scope?.error(ex);
691
+ return createConflictDetectionError("other");
692
+ }
693
+ }
694
+ if (!data) return { status: "clean" };
695
+ const mergeConflict = parseMergeTreeConflict(data);
696
+ if (!mergeConflict.conflicts.length) return {
697
+ status: "clean",
698
+ treeOid: mergeConflict.treeOid
699
+ };
700
+ return {
701
+ status: "conflicts",
702
+ conflict: {
703
+ repoPath,
704
+ branch,
705
+ target: targetBranch,
706
+ files: mergeConflict.conflicts,
707
+ shas: void 0
708
+ },
709
+ treeOid: mergeConflict.treeOid
710
+ };
711
+ }, { cancellation });
712
+ }
713
+ /** Detects conflicts when an autostash is reapplied onto the tree an integration produced */
714
+ async getPotentialStashReapplyConflicts(repoPath, ontoTreeOid, cancellation) {
715
+ if (!await this.git.supports("git:merge-tree:merge-base")) return createConflictDetectionError("unsupported");
716
+ let stashSha;
717
+ try {
718
+ stashSha = (await this.git.run({
719
+ cwd: repoPath,
720
+ cancellation,
721
+ errors: "throw"
722
+ }, "stash", "create")).stdout.trim();
723
+ } catch (ex) {
724
+ if (isCancellationError(ex)) throw ex;
725
+ return createConflictDetectionError("other");
726
+ }
727
+ if (!stashSha) return { status: "clean" };
728
+ let stashTree;
729
+ let stashParent;
730
+ try {
731
+ const result = await this.git.run({
732
+ cwd: repoPath,
733
+ cancellation,
734
+ errors: "throw"
735
+ }, "rev-parse", `${stashSha}^{tree}`, `${stashSha}^`);
736
+ [stashTree, stashParent] = result.stdout.trim().split("\n");
737
+ } catch (ex) {
738
+ if (isCancellationError(ex)) throw ex;
739
+ return createConflictDetectionError("other");
740
+ }
741
+ const cacheKey = `reapply:${ontoTreeOid}:${stashTree}.${stashParent}`;
742
+ return this.cache.conflictDetection.getOrCreate(repoPath, cacheKey, async (_cacheable, signal) => {
743
+ const step = await this.runMergeTreeStep(repoPath, `${stashSha}^`, ontoTreeOid, stashSha, signal);
744
+ if (!step.ok) return createConflictDetectionError(step.reason);
745
+ if (!step.result.conflicts.length) return {
746
+ status: "clean",
747
+ treeOid: step.result.treeOid
748
+ };
749
+ return {
750
+ status: "conflicts",
751
+ conflict: {
752
+ repoPath,
753
+ branch: stashSha,
754
+ target: ontoTreeOid,
755
+ files: step.result.conflicts,
756
+ shas: void 0
757
+ },
758
+ treeOid: step.result.treeOid
759
+ };
760
+ }, { cancellation });
761
+ }
762
+ async runMergeTreeStep(repoPath, base, ours, theirs, cancellation) {
763
+ const scope = getScopedLogger();
764
+ let data;
765
+ try {
766
+ data = (await this.git.run({
767
+ cwd: repoPath,
768
+ cancellation,
769
+ errors: "throw"
770
+ }, "merge-tree", "--write-tree", "-z", "--name-only", "--no-messages", `--merge-base=${base}`, ours, theirs)).stdout;
771
+ } catch (ex) {
772
+ if (isCancellationError(ex)) throw ex;
773
+ const msg = ex?.toString() ?? "";
774
+ if (GitErrors.notAValidObjectName.test(msg)) {
775
+ scope?.error(ex, `'${ours}' or '${theirs}' not found - ensure the branches/commits exist`);
776
+ return {
777
+ ok: false,
778
+ reason: "refNotFound"
779
+ };
780
+ } else if (GitErrors.badRevision.test(msg)) {
781
+ scope?.error(ex, `Invalid revision: ${msg.slice(msg.indexOf("'"))}`);
782
+ return {
783
+ ok: false,
784
+ reason: "refNotFound"
785
+ };
786
+ } else if (GitErrors.noMergeBase.test(msg)) {
787
+ scope?.error(ex, `Unable to merge '${ours}' and '${theirs}' as they have no common ancestor`);
788
+ return {
789
+ ok: false,
790
+ reason: "noMergeBase"
791
+ };
792
+ } else if (ex instanceof GitError) data = ex.stdout;
793
+ else {
794
+ scope?.error(ex, "Failed to execute merge-tree for conflict check");
795
+ return {
796
+ ok: false,
797
+ reason: "other"
798
+ };
799
+ }
800
+ }
801
+ return {
802
+ ok: true,
803
+ result: parseMergeTreeConflict(data ?? "")
804
+ };
805
+ }
806
+ async checkForPotentialConflicts(repoPath, commits, targetBranch, cancellation, options) {
807
+ const scope = getScopedLogger();
808
+ if (!await this.git.supports("git:merge-tree:merge-base")) return createConflictDetectionError("unsupported");
809
+ let currentTreeOid;
810
+ try {
811
+ currentTreeOid = (await this.git.run({
812
+ cwd: repoPath,
813
+ cancellation,
814
+ errors: "throw"
815
+ }, "rev-parse", `${targetBranch}^{tree}`)).stdout.trim();
816
+ } catch (ex) {
817
+ if (isCancellationError(ex)) throw ex;
818
+ scope?.error(ex, `Failed to resolve target branch '${targetBranch}'`);
819
+ return createConflictDetectionError("refNotFound");
820
+ }
821
+ const conflictingShas = [];
822
+ const conflictingFilePaths = /* @__PURE__ */ new Set();
823
+ for (const commit of commits) {
824
+ if (cancellation?.aborted) throw new CancellationError();
825
+ const step = await this.runMergeTreeStep(repoPath, commit.parent, currentTreeOid, commit.sha, cancellation);
826
+ if (!step.ok) return createConflictDetectionError(step.reason);
827
+ const mergeConflict = step.result;
828
+ if (mergeConflict.conflicts.length) {
829
+ conflictingShas.push(commit.sha);
830
+ for (const file of mergeConflict.conflicts) conflictingFilePaths.add(file.path);
831
+ if (options?.stopOnFirstConflict) return {
832
+ status: "conflicts",
833
+ conflict: {
834
+ repoPath,
835
+ branch: commit.sha,
836
+ target: targetBranch,
837
+ files: mergeConflict.conflicts,
838
+ shas: [commit.sha]
839
+ },
840
+ stoppedOnFirstConflict: true,
841
+ treeOid: mergeConflict.treeOid || void 0
842
+ };
843
+ }
844
+ if (mergeConflict.treeOid) currentTreeOid = mergeConflict.treeOid;
845
+ }
846
+ if (conflictingShas.length) return {
847
+ status: "conflicts",
848
+ conflict: {
849
+ repoPath,
850
+ branch: conflictingShas[0],
851
+ target: targetBranch,
852
+ files: Array.from(conflictingFilePaths, (path) => ({ path })),
853
+ shas: conflictingShas
854
+ },
855
+ stoppedOnFirstConflict: false,
856
+ treeOid: currentTreeOid
857
+ };
858
+ return {
859
+ status: "clean",
860
+ treeOid: currentTreeOid
861
+ };
862
+ }
863
+ getBaseBranchName(repoPath, ref, options, cancellation) {
864
+ const priority = options?.priority;
865
+ const priorityOpts = priority != null ? { priority } : void 0;
866
+ return this.cache.getBaseBranchName(repoPath, ref, async (commonPath, cacheable, signal) => {
867
+ try {
868
+ let mergeBase = await this.provider.config.getGkConfig(commonPath, `branch.${ref}.gk-merge-base`);
869
+ let update = false;
870
+ if (mergeBase == null) {
871
+ mergeBase = await this.provider.config.getConfig(commonPath, `branch.${ref}.vscode-merge-base`);
872
+ update = mergeBase != null;
873
+ }
874
+ if (mergeBase != null) {
875
+ const branch = await this.provider.refs.getSymbolicReferenceName(commonPath, mergeBase, priorityOpts);
876
+ if (branch != null) {
877
+ if (update) this.storeBaseBranchName(commonPath, ref, branch, { skipInvalidation: ["branchOverviews", "baseBranchName"] });
878
+ return branch;
879
+ }
880
+ }
881
+ } catch {}
882
+ const reflog = await this.getBaseBranchFromReflog(commonPath, ref, {
883
+ upstream: true,
884
+ priority
885
+ }, signal);
886
+ if (reflog.branch != null) {
887
+ this.storeBaseBranchName(commonPath, ref, reflog.branch, { skipInvalidation: ["branchOverviews", "baseBranchName"] });
888
+ return reflog.branch;
889
+ }
890
+ if (reflog.failed) cacheable.invalidate();
891
+ }, cancellation);
892
+ }
893
+ /**
894
+ * `failed` separates "the reflog ran and had no answer" from "the read never happened" — the caller
895
+ * caches the former forever and must not cache the latter.
896
+ */
897
+ async getBaseBranchFromReflog(repoPath, ref, options, cancellation) {
898
+ const priority = options?.priority;
899
+ const priorityOpts = priority != null ? { priority } : void 0;
900
+ try {
901
+ let result = await this.git.run({
902
+ cwd: repoPath,
903
+ cancellation,
904
+ ...priorityOpts
905
+ }, "reflog", ref, "--grep-reflog=branch: Created from *.");
906
+ let entries = result.stdout.split("\n").filter((entry) => Boolean(entry));
907
+ if (entries.length !== 1) return {
908
+ branch: void 0,
909
+ failed: false
910
+ };
911
+ let match = entries[0].match(/branch: Created from (.*)$/);
912
+ if (match?.length === 2) {
913
+ let name = match[1];
914
+ if (name !== "HEAD") {
915
+ if (options?.upstream) {
916
+ const upstream = await this.provider.refs.getSymbolicReferenceName(repoPath, `${name}@{u}`, priorityOpts);
917
+ if (upstream) return {
918
+ branch: upstream,
919
+ failed: false
920
+ };
921
+ }
922
+ name = await this.provider.refs.getSymbolicReferenceName(repoPath, name, priorityOpts);
923
+ if (name) return {
924
+ branch: name,
925
+ failed: false
926
+ };
927
+ }
928
+ }
929
+ result = await this.git.run({
930
+ cwd: repoPath,
931
+ cancellation,
932
+ ...priorityOpts
933
+ }, "reflog", "HEAD", `--grep-reflog=checkout: moving from .* to ${ref.replace("refs/heads/", "")}`);
934
+ entries = result.stdout.split("\n").filter((entry) => Boolean(entry));
935
+ if (!entries.length) return {
936
+ branch: void 0,
937
+ failed: false
938
+ };
939
+ match = entries.at(-1).match(/checkout: moving from ([^\s]+)\s/);
940
+ if (match?.length === 2) {
941
+ let name = match[1];
942
+ if (options?.upstream) {
943
+ const upstream = await this.provider.refs.getSymbolicReferenceName(repoPath, `${name}@{u}`, priorityOpts);
944
+ if (upstream) return {
945
+ branch: upstream,
946
+ failed: false
947
+ };
948
+ }
949
+ name = await this.provider.refs.getSymbolicReferenceName(repoPath, name, priorityOpts);
950
+ if (name) return {
951
+ branch: name,
952
+ failed: false
953
+ };
954
+ }
955
+ } catch (ex) {
956
+ if (isCancellationError(ex)) throw ex;
957
+ return {
958
+ branch: void 0,
959
+ failed: true
960
+ };
961
+ }
962
+ return {
963
+ branch: void 0,
964
+ failed: false
965
+ };
966
+ }
967
+ async getStoredMergeTargetBranchName(repoPath, ref) {
968
+ return (await this.getStoredUserMergeTargetBranchName?.(repoPath, ref) ?? await this.getStoredDetectedMergeTargetBranchName?.(repoPath, ref))?.trim() || void 0;
969
+ }
970
+ async getStoredDetectedMergeTargetBranchName(repoPath, ref) {
971
+ return (await this.provider.config.getGkConfig(repoPath, `branch.${ref}.gk-merge-target`) ?? await this.provider.config.getGkConfig(repoPath, `branch.${ref}.gk-target-base`))?.trim() || void 0;
972
+ }
973
+ async getStoredUserMergeTargetBranchName(repoPath, ref) {
974
+ return (await this.provider.config.getGkConfig(repoPath, `branch.${ref}.gk-merge-target-user`))?.trim() || void 0;
975
+ }
976
+ /** Updates the last accessed timestamp for the current branch */
977
+ async onCurrentBranchAccessed(repoPath) {
978
+ const branch = await this.getBranch(repoPath);
979
+ if (branch == null || branch.remote || branch.detached) return;
980
+ await this.storeBranchMetadata(repoPath, "gk-last-accessed", branch.name, /* @__PURE__ */ new Date());
981
+ }
982
+ /** Updates the last accessed and modified timestamp for the current branch */
983
+ async onCurrentBranchModified(repoPath) {
984
+ const branch = await this.getBranch(repoPath);
985
+ if (branch == null || branch.remote || branch.detached) return;
986
+ const now = /* @__PURE__ */ new Date();
987
+ await this.storeBranchMetadata(repoPath, "gk-last-accessed", branch.name, now);
988
+ await this.storeBranchMetadata(repoPath, "gk-last-modified", branch.name, now);
989
+ }
990
+ /** Updates the agent last activity timestamp for the current branch */
991
+ async onCurrentBranchAgentActivity(repoPath) {
992
+ const branch = await this.getBranch(repoPath);
993
+ if (branch == null || branch.remote || branch.detached) return;
994
+ await this.storeBranchMetadata(repoPath, "gk-agent-last-activity", branch.name, /* @__PURE__ */ new Date());
995
+ }
996
+ async renameBranch(repoPath, oldName, newName) {
997
+ const args = [
998
+ "branch",
999
+ "-m",
1000
+ oldName,
1001
+ newName
1002
+ ];
1003
+ try {
1004
+ await this.git.run({ cwd: repoPath }, ...args);
1005
+ await this.provider.config.renameGkConfigBranchSection(repoPath, oldName, newName);
1006
+ this.cache.deleteBaseBranchName(repoPath, oldName);
1007
+ this.cache.deleteBaseBranchName(repoPath, newName);
1008
+ this.context.hooks?.cache?.onReset?.(repoPath, "branches");
1009
+ this.context.hooks?.repository?.onChanged?.(repoPath, ["heads"]);
1010
+ } catch (ex) {
1011
+ throw getGitCommandError("branch", ex, (reason) => new BranchError({
1012
+ reason: reason ?? "other",
1013
+ action: "rename",
1014
+ branch: oldName,
1015
+ gitCommand: {
1016
+ repoPath,
1017
+ args
1018
+ }
1019
+ }, ex));
1020
+ }
1021
+ }
1022
+ async setUpstreamBranch(repoPath, name, upstream) {
1023
+ const args = upstream == null ? [
1024
+ "branch",
1025
+ "--unset-upstream",
1026
+ name
1027
+ ] : [
1028
+ "branch",
1029
+ "--set-upstream-to",
1030
+ upstream,
1031
+ name
1032
+ ];
1033
+ try {
1034
+ await this.git.run({ cwd: repoPath }, ...args);
1035
+ this.context.hooks?.cache?.onReset?.(repoPath, "branches");
1036
+ this.context.hooks?.repository?.onChanged?.(repoPath, ["heads"]);
1037
+ } catch (ex) {
1038
+ throw getGitCommandError("branch", ex, (reason) => new BranchError({
1039
+ reason: reason ?? "other",
1040
+ action: upstream == null ? "unset upstream of" : `set upstream to '${upstream}' for`,
1041
+ branch: name,
1042
+ gitCommand: {
1043
+ repoPath,
1044
+ args
1045
+ }
1046
+ }, ex));
1047
+ }
1048
+ }
1049
+ async storeBaseBranchName(repoPath, ref, base, options) {
1050
+ await this.provider.config.setGkConfig(repoPath, `branch.${ref}.gk-merge-base`, base, options);
1051
+ }
1052
+ async storeMergeTargetBranchName(repoPath, ref, target, options) {
1053
+ await this.provider.config.setGkConfig(repoPath, `branch.${ref}.gk-merge-target`, target, options);
1054
+ }
1055
+ async storeUserMergeTargetBranchName(repoPath, ref, target) {
1056
+ await this.provider.config.setGkConfig(repoPath, `branch.${ref}.gk-merge-target-user`, target);
1057
+ }
1058
+ /**
1059
+ * Gets all branch metadata (dates and disposition) from git config in a single batch operation.
1060
+ * @returns A map of branch name to metadata.
1061
+ */
1062
+ getBranchMetadataMap(repoPath) {
1063
+ return this.cache.getBranchMetadataMap(repoPath, async (commonPath) => {
1064
+ const scope = getScopedLogger();
1065
+ const metadataMap = /* @__PURE__ */ new Map();
1066
+ try {
1067
+ const configMap = await this.provider.config.getGkConfigRegex(commonPath, "^branch\\..*\\.gk-(last-(accessed|modified)|disposition|agent-last-activity)$");
1068
+ if (!configMap.size) return metadataMap;
1069
+ for (const [key, value] of configMap) {
1070
+ if (!key.startsWith("branch.")) continue;
1071
+ const keyParts = key.split(".");
1072
+ if (keyParts.length < 3) continue;
1073
+ const metaKey = keyParts.at(-1);
1074
+ const branchName = keyParts.slice(1, -1).join(".");
1075
+ let metadata = metadataMap.get(branchName);
1076
+ if (metadata == null) {
1077
+ metadata = {};
1078
+ metadataMap.set(branchName, metadata);
1079
+ }
1080
+ if (metaKey === "gk-last-accessed") metadata.lastAccessedAt = value;
1081
+ else if (metaKey === "gk-last-modified") metadata.lastModifiedAt = value;
1082
+ else if (metaKey === "gk-agent-last-activity") metadata.agentLastActivityAt = value;
1083
+ else if (metaKey === "gk-disposition") {
1084
+ if (value === "starred" || value === "archived") metadata.disposition = value;
1085
+ }
1086
+ }
1087
+ } catch (ex) {
1088
+ debugger;
1089
+ scope?.error(ex);
1090
+ }
1091
+ return metadataMap;
1092
+ });
1093
+ }
1094
+ async storeBranchMetadata(repoPath, key, ref, date) {
1095
+ const value = await this.provider.config.getGkConfig(repoPath, `branch.${ref}.${key}`);
1096
+ if (value != null && date.getTime() - new Date(value).getTime() < dateMetadataStaleThresholdMs) return;
1097
+ return this.provider.config.setGkConfig(repoPath, `branch.${ref}.${key}`, date.toISOString());
1098
+ }
1099
+ async setBranchDisposition(repoPath, branchName, disposition) {
1100
+ await this.provider.config.setGkConfig(repoPath, `branch.${branchName}.gk-disposition`, disposition);
1101
+ this.context.hooks?.cache?.onReset?.(repoPath, "branches");
1102
+ this.context.hooks?.repository?.onChanged?.(repoPath, ["starred"]);
1103
+ }
1104
+ };
1105
+ __decorate([debug()], BranchesGitSubProvider.prototype, "getBranch", null);
1106
+ __decorate([debug({ args: (repoPath) => ({ repoPath }) })], BranchesGitSubProvider.prototype, "getBranches", null);
1107
+ __decorate([debug()], BranchesGitSubProvider.prototype, "getBranchContributionsOverview", null);
1108
+ __decorate([debug()], BranchesGitSubProvider.prototype, "getBranchesWithCommits", null);
1109
+ __decorate([debug()], BranchesGitSubProvider.prototype, "getCurrentBranchReference", null);
1110
+ __decorate([debug({ exit: true })], BranchesGitSubProvider.prototype, "getDefaultBranchName", null);
1111
+ __decorate([debug()], BranchesGitSubProvider.prototype, "createBranch", null);
1112
+ __decorate([debug()], BranchesGitSubProvider.prototype, "deleteLocalBranch", null);
1113
+ __decorate([debug()], BranchesGitSubProvider.prototype, "deleteRemoteBranch", null);
1114
+ __decorate([debug()], BranchesGitSubProvider.prototype, "getBranchMergedStatus", null);
1115
+ __decorate([debug()], BranchesGitSubProvider.prototype, "getLocalBranchByUpstream", null);
1116
+ __decorate([debug()], BranchesGitSubProvider.prototype, "getPotentialApplyConflicts", null);
1117
+ __decorate([debug()], BranchesGitSubProvider.prototype, "getPotentialMergeConflicts", null);
1118
+ __decorate([debug()], BranchesGitSubProvider.prototype, "getPotentialStashReapplyConflicts", null);
1119
+ __decorate([debug({ exit: true })], BranchesGitSubProvider.prototype, "getBaseBranchName", null);
1120
+ __decorate([debug({ exit: true })], BranchesGitSubProvider.prototype, "getStoredMergeTargetBranchName", null);
1121
+ __decorate([debug({ exit: true })], BranchesGitSubProvider.prototype, "getStoredDetectedMergeTargetBranchName", null);
1122
+ __decorate([debug()], BranchesGitSubProvider.prototype, "getStoredUserMergeTargetBranchName", null);
1123
+ __decorate([debounce(15e4), debug()], BranchesGitSubProvider.prototype, "onCurrentBranchAccessed", null);
1124
+ __decorate([debounce(15e4), debug()], BranchesGitSubProvider.prototype, "onCurrentBranchModified", null);
1125
+ __decorate([debounce(15e4), debug()], BranchesGitSubProvider.prototype, "onCurrentBranchAgentActivity", null);
1126
+ __decorate([debug()], BranchesGitSubProvider.prototype, "renameBranch", null);
1127
+ __decorate([debug()], BranchesGitSubProvider.prototype, "setUpstreamBranch", null);
1128
+ __decorate([debug()], BranchesGitSubProvider.prototype, "storeBaseBranchName", null);
1129
+ __decorate([debug()], BranchesGitSubProvider.prototype, "storeMergeTargetBranchName", null);
1130
+ __decorate([debug()], BranchesGitSubProvider.prototype, "storeUserMergeTargetBranchName", null);
1131
+ //#endregion
1132
+ export { BranchesGitSubProvider };
1133
+
1470
1134
  //# sourceMappingURL=branches.js.map