@gitkraken/core-gitlens 0.6.0 → 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 (1914) hide show
  1. package/CHANGELOG.md +15 -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 +171 -150
  56. package/dist/git/models/issue.js +86 -88
  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 -236
  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 +46 -45
  184. package/dist/git/remotes/azure-devops.js +252 -257
  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 -158
  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 -67
  707. package/dist/plus/integrations/providers/azure/azure.js +452 -577
  708. package/dist/plus/integrations/providers/azure/azure.js.map +1 -1
  709. package/dist/plus/integrations/providers/azure/models.d.ts +228 -226
  710. package/dist/plus/integrations/providers/azure/models.js +223 -251
  711. package/dist/plus/integrations/providers/azure/models.js.map +1 -1
  712. package/dist/plus/integrations/providers/azureDevOps.d.ts +132 -131
  713. package/dist/plus/integrations/providers/azureDevOps.js +773 -931
  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 +816 -865
  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 -231
  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 +70 -26
  1088. package/package.json +18 -8
  1089. package/dist/git/cache.d.ts.map +0 -1
  1090. package/dist/git/context.d.ts.map +0 -1
  1091. package/dist/git/errors.d.ts.map +0 -1
  1092. package/dist/git/features.d.ts.map +0 -1
  1093. package/dist/git/gitHealth.d.ts.map +0 -1
  1094. package/dist/git/models/author.d.ts.map +0 -1
  1095. package/dist/git/models/author.js.map +0 -1
  1096. package/dist/git/models/autolink.d.ts.map +0 -1
  1097. package/dist/git/models/autolink.js.map +0 -1
  1098. package/dist/git/models/blame.d.ts.map +0 -1
  1099. package/dist/git/models/blame.js.map +0 -1
  1100. package/dist/git/models/branch.d.ts.map +0 -1
  1101. package/dist/git/models/commit.d.ts.map +0 -1
  1102. package/dist/git/models/contributor.d.ts.map +0 -1
  1103. package/dist/git/models/defaultBranch.d.ts.map +0 -1
  1104. package/dist/git/models/defaultBranch.js.map +0 -1
  1105. package/dist/git/models/diff.d.ts.map +0 -1
  1106. package/dist/git/models/diff.js.map +0 -1
  1107. package/dist/git/models/file.d.ts.map +0 -1
  1108. package/dist/git/models/file.js.map +0 -1
  1109. package/dist/git/models/fileChange.d.ts.map +0 -1
  1110. package/dist/git/models/fileStatus.d.ts.map +0 -1
  1111. package/dist/git/models/graph.d.ts.map +0 -1
  1112. package/dist/git/models/graphSearch.d.ts.map +0 -1
  1113. package/dist/git/models/graphSearch.js.map +0 -1
  1114. package/dist/git/models/graphSession.d.ts.map +0 -1
  1115. package/dist/git/models/issue.d.ts.map +0 -1
  1116. package/dist/git/models/issueOrPullRequest.d.ts.map +0 -1
  1117. package/dist/git/models/issueOrPullRequest.js.map +0 -1
  1118. package/dist/git/models/lineRange.d.ts.map +0 -1
  1119. package/dist/git/models/lineRange.js.map +0 -1
  1120. package/dist/git/models/log.d.ts.map +0 -1
  1121. package/dist/git/models/log.js.map +0 -1
  1122. package/dist/git/models/mergeConflicts.d.ts.map +0 -1
  1123. package/dist/git/models/mergeConflicts.js.map +0 -1
  1124. package/dist/git/models/patch.d.ts.map +0 -1
  1125. package/dist/git/models/patch.js.map +0 -1
  1126. package/dist/git/models/pausedOperationStatus.d.ts.map +0 -1
  1127. package/dist/git/models/pausedOperationStatus.js.map +0 -1
  1128. package/dist/git/models/pullRequest.d.ts.map +0 -1
  1129. package/dist/git/models/rebase.d.ts.map +0 -1
  1130. package/dist/git/models/rebase.js.map +0 -1
  1131. package/dist/git/models/reference.d.ts.map +0 -1
  1132. package/dist/git/models/reference.js.map +0 -1
  1133. package/dist/git/models/reflog.d.ts.map +0 -1
  1134. package/dist/git/models/remote.d.ts.map +0 -1
  1135. package/dist/git/models/remoteProvider.d.ts.map +0 -1
  1136. package/dist/git/models/remoteResource.d.ts.map +0 -1
  1137. package/dist/git/models/repository.d.ts.map +0 -1
  1138. package/dist/git/models/repositoryChangeEvent.d.ts.map +0 -1
  1139. package/dist/git/models/repositoryIdentities.d.ts.map +0 -1
  1140. package/dist/git/models/repositoryMetadata.d.ts.map +0 -1
  1141. package/dist/git/models/repositoryMetadata.js.map +0 -1
  1142. package/dist/git/models/resourceDescriptor.d.ts.map +0 -1
  1143. package/dist/git/models/resourceDescriptor.js.map +0 -1
  1144. package/dist/git/models/revision.d.ts.map +0 -1
  1145. package/dist/git/models/search.d.ts.map +0 -1
  1146. package/dist/git/models/shortlog.d.ts.map +0 -1
  1147. package/dist/git/models/shortlog.js.map +0 -1
  1148. package/dist/git/models/signature.d.ts.map +0 -1
  1149. package/dist/git/models/signature.js.map +0 -1
  1150. package/dist/git/models/staging.d.ts.map +0 -1
  1151. package/dist/git/models/staging.js.map +0 -1
  1152. package/dist/git/models/stash.d.ts.map +0 -1
  1153. package/dist/git/models/stash.js.map +0 -1
  1154. package/dist/git/models/status.d.ts.map +0 -1
  1155. package/dist/git/models/statusFile.d.ts.map +0 -1
  1156. package/dist/git/models/tag.d.ts.map +0 -1
  1157. package/dist/git/models/tree.d.ts.map +0 -1
  1158. package/dist/git/models/tree.js.map +0 -1
  1159. package/dist/git/models/user.d.ts.map +0 -1
  1160. package/dist/git/models/user.js.map +0 -1
  1161. package/dist/git/models/worktree.d.ts.map +0 -1
  1162. package/dist/git/parsers/diffParser.d.ts.map +0 -1
  1163. package/dist/git/parsers/rebaseTodoParser.d.ts.map +0 -1
  1164. package/dist/git/providers/blame.d.ts.map +0 -1
  1165. package/dist/git/providers/blame.js.map +0 -1
  1166. package/dist/git/providers/branches.d.ts.map +0 -1
  1167. package/dist/git/providers/branches.js.map +0 -1
  1168. package/dist/git/providers/commits.d.ts.map +0 -1
  1169. package/dist/git/providers/commits.js.map +0 -1
  1170. package/dist/git/providers/config.d.ts.map +0 -1
  1171. package/dist/git/providers/config.js.map +0 -1
  1172. package/dist/git/providers/contributors.d.ts.map +0 -1
  1173. package/dist/git/providers/contributors.js.map +0 -1
  1174. package/dist/git/providers/diff.d.ts.map +0 -1
  1175. package/dist/git/providers/diff.js.map +0 -1
  1176. package/dist/git/providers/graph.d.ts.map +0 -1
  1177. package/dist/git/providers/graph.js.map +0 -1
  1178. package/dist/git/providers/maintenance.d.ts.map +0 -1
  1179. package/dist/git/providers/maintenance.js.map +0 -1
  1180. package/dist/git/providers/operations.d.ts.map +0 -1
  1181. package/dist/git/providers/operations.js.map +0 -1
  1182. package/dist/git/providers/patch.d.ts.map +0 -1
  1183. package/dist/git/providers/patch.js.map +0 -1
  1184. package/dist/git/providers/pausedOperations.d.ts.map +0 -1
  1185. package/dist/git/providers/pausedOperations.js.map +0 -1
  1186. package/dist/git/providers/provider.d.ts.map +0 -1
  1187. package/dist/git/providers/provider.js.map +0 -1
  1188. package/dist/git/providers/refs.d.ts.map +0 -1
  1189. package/dist/git/providers/refs.js.map +0 -1
  1190. package/dist/git/providers/remotes.d.ts.map +0 -1
  1191. package/dist/git/providers/remotes.js.map +0 -1
  1192. package/dist/git/providers/revision.d.ts.map +0 -1
  1193. package/dist/git/providers/revision.js.map +0 -1
  1194. package/dist/git/providers/shared/remotes.d.ts.map +0 -1
  1195. package/dist/git/providers/staging.d.ts.map +0 -1
  1196. package/dist/git/providers/staging.js.map +0 -1
  1197. package/dist/git/providers/stash.d.ts.map +0 -1
  1198. package/dist/git/providers/stash.js.map +0 -1
  1199. package/dist/git/providers/status.d.ts.map +0 -1
  1200. package/dist/git/providers/status.js.map +0 -1
  1201. package/dist/git/providers/tags.d.ts.map +0 -1
  1202. package/dist/git/providers/tags.js.map +0 -1
  1203. package/dist/git/providers/types.d.ts.map +0 -1
  1204. package/dist/git/providers/types.js.map +0 -1
  1205. package/dist/git/providers/worktrees.d.ts.map +0 -1
  1206. package/dist/git/providers/worktrees.js.map +0 -1
  1207. package/dist/git/remotes/azure-devops.d.ts.map +0 -1
  1208. package/dist/git/remotes/bitbucket-server.d.ts.map +0 -1
  1209. package/dist/git/remotes/bitbucket.d.ts.map +0 -1
  1210. package/dist/git/remotes/custom.d.ts.map +0 -1
  1211. package/dist/git/remotes/gerrit.d.ts.map +0 -1
  1212. package/dist/git/remotes/gitea.d.ts.map +0 -1
  1213. package/dist/git/remotes/github.d.ts.map +0 -1
  1214. package/dist/git/remotes/gitlab.d.ts.map +0 -1
  1215. package/dist/git/remotes/google-source.d.ts.map +0 -1
  1216. package/dist/git/remotes/matcher.d.ts.map +0 -1
  1217. package/dist/git/repositoryService.d.ts.map +0 -1
  1218. package/dist/git/run.types.d.ts.map +0 -1
  1219. package/dist/git/run.types.js.map +0 -1
  1220. package/dist/git/service.d.ts.map +0 -1
  1221. package/dist/git/utils/autolink.utils.d.ts.map +0 -1
  1222. package/dist/git/utils/blame.utils.d.ts.map +0 -1
  1223. package/dist/git/utils/branch.utils.d.ts.map +0 -1
  1224. package/dist/git/utils/commit.utils.d.ts.map +0 -1
  1225. package/dist/git/utils/config.utils.d.ts.map +0 -1
  1226. package/dist/git/utils/conflictResolution.utils.d.ts.map +0 -1
  1227. package/dist/git/utils/contributor.utils.d.ts.map +0 -1
  1228. package/dist/git/utils/fetch.utils.d.ts.map +0 -1
  1229. package/dist/git/utils/fileStatus.utils.d.ts.map +0 -1
  1230. package/dist/git/utils/graph.utils.d.ts.map +0 -1
  1231. package/dist/git/utils/issue.utils.d.ts.map +0 -1
  1232. package/dist/git/utils/issueOrPullRequest.utils.d.ts.map +0 -1
  1233. package/dist/git/utils/mergeConflicts.utils.d.ts.map +0 -1
  1234. package/dist/git/utils/pausedOperationStatus.utils.d.ts.map +0 -1
  1235. package/dist/git/utils/pullRequest.utils.d.ts.map +0 -1
  1236. package/dist/git/utils/reachability.utils.d.ts.map +0 -1
  1237. package/dist/git/utils/rebase.utils.d.ts.map +0 -1
  1238. package/dist/git/utils/reference.utils.d.ts.map +0 -1
  1239. package/dist/git/utils/remote.utils.d.ts.map +0 -1
  1240. package/dist/git/utils/repository.utils.d.ts.map +0 -1
  1241. package/dist/git/utils/resourceDescriptor.utils.d.ts.map +0 -1
  1242. package/dist/git/utils/revision.utils.d.ts.map +0 -1
  1243. package/dist/git/utils/search.utils.d.ts.map +0 -1
  1244. package/dist/git/utils/sorting.d.ts.map +0 -1
  1245. package/dist/git/utils/sshKey.utils.d.ts.map +0 -1
  1246. package/dist/git/utils/status.utils.d.ts.map +0 -1
  1247. package/dist/git/utils/statusFile.utils.d.ts.map +0 -1
  1248. package/dist/git/utils/tag.utils.d.ts.map +0 -1
  1249. package/dist/git/utils/tooltip.utils.d.ts.map +0 -1
  1250. package/dist/git/utils/uriAuthority.d.ts.map +0 -1
  1251. package/dist/git/utils/user.utils.d.ts.map +0 -1
  1252. package/dist/git/utils/worktree.utils.d.ts.map +0 -1
  1253. package/dist/git/watching/changeEvent.d.ts.map +0 -1
  1254. package/dist/git/watching/classifyChange.d.ts.map +0 -1
  1255. package/dist/git/watching/gitIgnoreFilter.d.ts.map +0 -1
  1256. package/dist/git/watching/initWatcher.d.ts.map +0 -1
  1257. package/dist/git/watching/provider.d.ts.map +0 -1
  1258. package/dist/git/watching/provider.js.map +0 -1
  1259. package/dist/git/watching/watchGroup.d.ts.map +0 -1
  1260. package/dist/git/watching/watchService.d.ts.map +0 -1
  1261. package/dist/git/watching/watchSession.d.ts.map +0 -1
  1262. package/dist/git/watching/watcherPatterns.d.ts.map +0 -1
  1263. package/dist/git-cli/cliGitProvider.d.ts.map +0 -1
  1264. package/dist/git-cli/exec/exec.d.ts.map +0 -1
  1265. package/dist/git-cli/exec/exec.errors.d.ts.map +0 -1
  1266. package/dist/git-cli/exec/exec.errors.js.map +0 -1
  1267. package/dist/git-cli/exec/exec.js.map +0 -1
  1268. package/dist/git-cli/exec/exec.types.d.ts.map +0 -1
  1269. package/dist/git-cli/exec/exec.types.js.map +0 -1
  1270. package/dist/git-cli/exec/features.d.ts.map +0 -1
  1271. package/dist/git-cli/exec/features.js.map +0 -1
  1272. package/dist/git-cli/exec/git.d.ts.map +0 -1
  1273. package/dist/git-cli/exec/gitQueue.d.ts.map +0 -1
  1274. package/dist/git-cli/exec/locator.d.ts.map +0 -1
  1275. package/dist/git-cli/parsers/blameParser.d.ts.map +0 -1
  1276. package/dist/git-cli/parsers/indexParser.d.ts.map +0 -1
  1277. package/dist/git-cli/parsers/logParser.d.ts.map +0 -1
  1278. package/dist/git-cli/parsers/mergeTreeParser.d.ts.map +0 -1
  1279. package/dist/git-cli/parsers/refParser.d.ts.map +0 -1
  1280. package/dist/git-cli/parsers/reflogParser.d.ts.map +0 -1
  1281. package/dist/git-cli/parsers/remoteParser.d.ts.map +0 -1
  1282. package/dist/git-cli/parsers/shortlogParser.d.ts.map +0 -1
  1283. package/dist/git-cli/parsers/signatureParser.d.ts.map +0 -1
  1284. package/dist/git-cli/parsers/sshSignatureParser.d.ts.map +0 -1
  1285. package/dist/git-cli/parsers/statusParser.d.ts.map +0 -1
  1286. package/dist/git-cli/parsers/treeParser.d.ts.map +0 -1
  1287. package/dist/git-cli/parsers/worktreeParser.d.ts.map +0 -1
  1288. package/dist/git-cli/providers/blame.d.ts.map +0 -1
  1289. package/dist/git-cli/providers/branches.d.ts.map +0 -1
  1290. package/dist/git-cli/providers/commitFilesetUtils.d.ts.map +0 -1
  1291. package/dist/git-cli/providers/commits.d.ts.map +0 -1
  1292. package/dist/git-cli/providers/config.d.ts.map +0 -1
  1293. package/dist/git-cli/providers/contributors.d.ts.map +0 -1
  1294. package/dist/git-cli/providers/diff.d.ts.map +0 -1
  1295. package/dist/git-cli/providers/graph.d.ts.map +0 -1
  1296. package/dist/git-cli/providers/maintenance.d.ts.map +0 -1
  1297. package/dist/git-cli/providers/operations.d.ts.map +0 -1
  1298. package/dist/git-cli/providers/patch.d.ts.map +0 -1
  1299. package/dist/git-cli/providers/pausedOperations.d.ts.map +0 -1
  1300. package/dist/git-cli/providers/refs.d.ts.map +0 -1
  1301. package/dist/git-cli/providers/remotes.d.ts.map +0 -1
  1302. package/dist/git-cli/providers/revision.d.ts.map +0 -1
  1303. package/dist/git-cli/providers/staging.d.ts.map +0 -1
  1304. package/dist/git-cli/providers/stash.d.ts.map +0 -1
  1305. package/dist/git-cli/providers/status.d.ts.map +0 -1
  1306. package/dist/git-cli/providers/tags.d.ts.map +0 -1
  1307. package/dist/git-cli/providers/worktrees.d.ts.map +0 -1
  1308. package/dist/git-cli/service.d.ts.map +0 -1
  1309. package/dist/ipc/discovery.d.ts.map +0 -1
  1310. package/dist/ipc/ipcServer.d.ts.map +0 -1
  1311. package/dist/plus/agents/agentCapabilities.d.ts.map +0 -1
  1312. package/dist/plus/agents/providers/claudeCodeTranscript.d.ts.map +0 -1
  1313. package/dist/plus/agents/providers/gkAgentProvider.d.ts.map +0 -1
  1314. package/dist/plus/agents/sanitizePrompt.d.ts.map +0 -1
  1315. package/dist/plus/agents/stateMachine.d.ts.map +0 -1
  1316. package/dist/plus/agents/types.d.ts.map +0 -1
  1317. package/dist/plus/ai/constants.d.ts.map +0 -1
  1318. package/dist/plus/ai/errors.d.ts.map +0 -1
  1319. package/dist/plus/ai/models/conversation.d.ts.map +0 -1
  1320. package/dist/plus/ai/models/model.d.ts.map +0 -1
  1321. package/dist/plus/ai/models/promptTemplates.d.ts.map +0 -1
  1322. package/dist/plus/ai/models/promptTemplates.js.map +0 -1
  1323. package/dist/plus/ai/models/provider.d.ts.map +0 -1
  1324. package/dist/plus/ai/models/provider.js.map +0 -1
  1325. package/dist/plus/ai/models/results.d.ts.map +0 -1
  1326. package/dist/plus/ai/models/results.js.map +0 -1
  1327. package/dist/plus/ai/prompts.d.ts.map +0 -1
  1328. package/dist/plus/ai/providers/anthropicProvider.d.ts.map +0 -1
  1329. package/dist/plus/ai/providers/azureProvider.d.ts.map +0 -1
  1330. package/dist/plus/ai/providers/context.d.ts.map +0 -1
  1331. package/dist/plus/ai/providers/context.js.map +0 -1
  1332. package/dist/plus/ai/providers/deepSeekProvider.d.ts.map +0 -1
  1333. package/dist/plus/ai/providers/geminiProvider.d.ts.map +0 -1
  1334. package/dist/plus/ai/providers/gitkrakenProvider.d.ts.map +0 -1
  1335. package/dist/plus/ai/providers/huggingFaceProvider.d.ts.map +0 -1
  1336. package/dist/plus/ai/providers/mistralProvider.d.ts.map +0 -1
  1337. package/dist/plus/ai/providers/ollamaProvider.d.ts.map +0 -1
  1338. package/dist/plus/ai/providers/openAICompatibleProvider.d.ts.map +0 -1
  1339. package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts.map +0 -1
  1340. package/dist/plus/ai/providers/openRouterProvider.d.ts.map +0 -1
  1341. package/dist/plus/ai/providers/openaiProvider.d.ts.map +0 -1
  1342. package/dist/plus/ai/providers/responseFormatCache.d.ts.map +0 -1
  1343. package/dist/plus/ai/providers/xaiProvider.d.ts.map +0 -1
  1344. package/dist/plus/ai/utils/ai.utils.d.ts.map +0 -1
  1345. package/dist/plus/ai/utils/results.utils.d.ts.map +0 -1
  1346. package/dist/plus/ai/utils/truncation.utils.d.ts.map +0 -1
  1347. package/dist/plus/git-github/api/config.d.ts.map +0 -1
  1348. package/dist/plus/git-github/api/github.d.ts.map +0 -1
  1349. package/dist/plus/git-github/api/github.utils.d.ts.map +0 -1
  1350. package/dist/plus/git-github/api/issueSearchQuery.d.ts.map +0 -1
  1351. package/dist/plus/git-github/api/pullRequestSearchQuery.d.ts.map +0 -1
  1352. package/dist/plus/git-github/api/token.d.ts.map +0 -1
  1353. package/dist/plus/git-github/api/token.js.map +0 -1
  1354. package/dist/plus/git-github/api/tokenUtils.d.ts.map +0 -1
  1355. package/dist/plus/git-github/api/types.d.ts.map +0 -1
  1356. package/dist/plus/git-github/api/types.js.map +0 -1
  1357. package/dist/plus/git-github/context.d.ts.map +0 -1
  1358. package/dist/plus/git-github/models.d.ts.map +0 -1
  1359. package/dist/plus/git-github/providers/github/blame.d.ts.map +0 -1
  1360. package/dist/plus/git-github/providers/github/branches.d.ts.map +0 -1
  1361. package/dist/plus/git-github/providers/github/commits.d.ts.map +0 -1
  1362. package/dist/plus/git-github/providers/github/config.d.ts.map +0 -1
  1363. package/dist/plus/git-github/providers/github/contributors.d.ts.map +0 -1
  1364. package/dist/plus/git-github/providers/github/diff.d.ts.map +0 -1
  1365. package/dist/plus/git-github/providers/github/graph.d.ts.map +0 -1
  1366. package/dist/plus/git-github/providers/github/refs.d.ts.map +0 -1
  1367. package/dist/plus/git-github/providers/github/remotes.d.ts.map +0 -1
  1368. package/dist/plus/git-github/providers/github/revision.d.ts.map +0 -1
  1369. package/dist/plus/git-github/providers/github/status.d.ts.map +0 -1
  1370. package/dist/plus/git-github/providers/github/tags.d.ts.map +0 -1
  1371. package/dist/plus/git-github/providers/githubGitProvider.d.ts.map +0 -1
  1372. package/dist/plus/git-github/providers/githubProvider.d.ts.map +0 -1
  1373. package/dist/plus/git-github/providers/githubProvider.js.map +0 -1
  1374. package/dist/plus/integrations/authentication/cloudIntegrationService.d.ts.map +0 -1
  1375. package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts.map +0 -1
  1376. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts.map +0 -1
  1377. package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts.map +0 -1
  1378. package/dist/plus/integrations/authentication/manualTokenProvider.d.ts.map +0 -1
  1379. package/dist/plus/integrations/authentication/models.d.ts.map +0 -1
  1380. package/dist/plus/integrations/authentication/rejectedTokenTracker.d.ts.map +0 -1
  1381. package/dist/plus/integrations/collectionMetadata.d.ts.map +0 -1
  1382. package/dist/plus/integrations/constants.d.ts.map +0 -1
  1383. package/dist/plus/integrations/context.d.ts.map +0 -1
  1384. package/dist/plus/integrations/context.js.map +0 -1
  1385. package/dist/plus/integrations/errors.d.ts.map +0 -1
  1386. package/dist/plus/integrations/index.d.ts.map +0 -1
  1387. package/dist/plus/integrations/integrationService.d.ts.map +0 -1
  1388. package/dist/plus/integrations/lite.d.ts.map +0 -1
  1389. package/dist/plus/integrations/manager.d.ts.map +0 -1
  1390. package/dist/plus/integrations/manager.js.map +0 -1
  1391. package/dist/plus/integrations/models/gitHostIntegration.d.ts.map +0 -1
  1392. package/dist/plus/integrations/models/integration.d.ts.map +0 -1
  1393. package/dist/plus/integrations/models/issueCache.d.ts.map +0 -1
  1394. package/dist/plus/integrations/models/issueReads.d.ts.map +0 -1
  1395. package/dist/plus/integrations/models/issueReads.js.map +0 -1
  1396. package/dist/plus/integrations/models/issuesIntegration.d.ts.map +0 -1
  1397. package/dist/plus/integrations/models/pullRequestReads.d.ts.map +0 -1
  1398. package/dist/plus/integrations/models/pullRequestReads.js.map +0 -1
  1399. package/dist/plus/integrations/providerFilters.d.ts.map +0 -1
  1400. package/dist/plus/integrations/providers/accounts.d.ts.map +0 -1
  1401. package/dist/plus/integrations/providers/apiClients.d.ts.map +0 -1
  1402. package/dist/plus/integrations/providers/apiConfig.d.ts.map +0 -1
  1403. package/dist/plus/integrations/providers/azure/azure.d.ts.map +0 -1
  1404. package/dist/plus/integrations/providers/azure/models.d.ts.map +0 -1
  1405. package/dist/plus/integrations/providers/azureDevOps.d.ts.map +0 -1
  1406. package/dist/plus/integrations/providers/bitbucket/bitbucket.d.ts.map +0 -1
  1407. package/dist/plus/integrations/providers/bitbucket/models.d.ts.map +0 -1
  1408. package/dist/plus/integrations/providers/bitbucket-server/models.d.ts.map +0 -1
  1409. package/dist/plus/integrations/providers/bitbucket-server.d.ts.map +0 -1
  1410. package/dist/plus/integrations/providers/bitbucket.d.ts.map +0 -1
  1411. package/dist/plus/integrations/providers/github/github.d.ts.map +0 -1
  1412. package/dist/plus/integrations/providers/github/github.utils.d.ts.map +0 -1
  1413. package/dist/plus/integrations/providers/github/models.d.ts.map +0 -1
  1414. package/dist/plus/integrations/providers/github/models.js.map +0 -1
  1415. package/dist/plus/integrations/providers/github.d.ts.map +0 -1
  1416. package/dist/plus/integrations/providers/gitlab/gitlab.d.ts.map +0 -1
  1417. package/dist/plus/integrations/providers/gitlab/gitlab.utils.d.ts.map +0 -1
  1418. package/dist/plus/integrations/providers/gitlab/models.d.ts.map +0 -1
  1419. package/dist/plus/integrations/providers/gitlab.d.ts.map +0 -1
  1420. package/dist/plus/integrations/providers/issueSorts.d.ts.map +0 -1
  1421. package/dist/plus/integrations/providers/jira.d.ts.map +0 -1
  1422. package/dist/plus/integrations/providers/jiraIssueByKey.d.ts.map +0 -1
  1423. package/dist/plus/integrations/providers/linear.d.ts.map +0 -1
  1424. package/dist/plus/integrations/providers/models.d.ts.map +0 -1
  1425. package/dist/plus/integrations/providers/providerErrors.d.ts.map +0 -1
  1426. package/dist/plus/integrations/providers/providersApi.d.ts.map +0 -1
  1427. package/dist/plus/integrations/providers/pullRequestReviews.d.ts.map +0 -1
  1428. package/dist/plus/integrations/providers/trello.d.ts.map +0 -1
  1429. package/dist/plus/integrations/providers/utils/providerPaging.d.ts.map +0 -1
  1430. package/dist/plus/integrations/providers/utils.d.ts.map +0 -1
  1431. package/dist/plus/integrations/reads/broaden.d.ts.map +0 -1
  1432. package/dist/plus/integrations/reads/context.d.ts.map +0 -1
  1433. package/dist/plus/integrations/reads/context.js.map +0 -1
  1434. package/dist/plus/integrations/reads/counts.d.ts.map +0 -1
  1435. package/dist/plus/integrations/reads/cursors.d.ts.map +0 -1
  1436. package/dist/plus/integrations/reads/drains.d.ts.map +0 -1
  1437. package/dist/plus/integrations/reads/filters.d.ts.map +0 -1
  1438. package/dist/plus/integrations/reads/hierarchy.d.ts.map +0 -1
  1439. package/dist/plus/integrations/reads/hierarchy.utils.d.ts.map +0 -1
  1440. package/dist/plus/integrations/reads/issueBatch.d.ts.map +0 -1
  1441. package/dist/plus/integrations/reads/issueTracker.d.ts.map +0 -1
  1442. package/dist/plus/integrations/reads/issues.d.ts.map +0 -1
  1443. package/dist/plus/integrations/reads/ordering.d.ts.map +0 -1
  1444. package/dist/plus/integrations/reads/paging.d.ts.map +0 -1
  1445. package/dist/plus/integrations/reads/pullRequests.d.ts.map +0 -1
  1446. package/dist/plus/integrations/reads/resolveRepository.d.ts.map +0 -1
  1447. package/dist/plus/integrations/reads/searchIssues.d.ts.map +0 -1
  1448. package/dist/plus/integrations/reads/searchPullRequests.d.ts.map +0 -1
  1449. package/dist/plus/integrations/reads/sweeps.d.ts.map +0 -1
  1450. package/dist/plus/integrations/reads/trackerIssue.d.ts.map +0 -1
  1451. package/dist/plus/integrations/reads/warnings.d.ts.map +0 -1
  1452. package/dist/plus/integrations/results.d.ts.map +0 -1
  1453. package/dist/plus/integrations/telemetry.d.ts.map +0 -1
  1454. package/dist/plus/integrations/utils/domain.utils.d.ts.map +0 -1
  1455. package/dist/plus/integrations/utils/integration.utils.d.ts.map +0 -1
  1456. package/dist/utils/array.d.ts.map +0 -1
  1457. package/dist/utils/base64.d.ts.map +0 -1
  1458. package/dist/utils/base64.js.map +0 -1
  1459. package/dist/utils/brand.d.ts.map +0 -1
  1460. package/dist/utils/brand.js.map +0 -1
  1461. package/dist/utils/cancellation.d.ts.map +0 -1
  1462. package/dist/utils/charCode.d.ts.map +0 -1
  1463. package/dist/utils/coalescedRun.d.ts.map +0 -1
  1464. package/dist/utils/color.d.ts.map +0 -1
  1465. package/dist/utils/counter.d.ts.map +0 -1
  1466. package/dist/utils/crypto.d.ts.map +0 -1
  1467. package/dist/utils/crypto.js.map +0 -1
  1468. package/dist/utils/date.d.ts.map +0 -1
  1469. package/dist/utils/debounce.d.ts.map +0 -1
  1470. package/dist/utils/decorators/debounce.d.ts.map +0 -1
  1471. package/dist/utils/decorators/gate.d.ts.map +0 -1
  1472. package/dist/utils/decorators/log.d.ts.map +0 -1
  1473. package/dist/utils/decorators/memoize.d.ts.map +0 -1
  1474. package/dist/utils/decorators/resolver.d.ts.map +0 -1
  1475. package/dist/utils/decorators/sequentialize.d.ts.map +0 -1
  1476. package/dist/utils/decorators/serializable.d.ts.map +0 -1
  1477. package/dist/utils/dedupedAsyncCache.d.ts.map +0 -1
  1478. package/dist/utils/diff.d.ts.map +0 -1
  1479. package/dist/utils/disposable.d.ts.map +0 -1
  1480. package/dist/utils/encoding.d.ts.map +0 -1
  1481. package/dist/utils/env/browser/base64.d.ts.map +0 -1
  1482. package/dist/utils/env/browser/crypto.d.ts.map +0 -1
  1483. package/dist/utils/env/browser/fs.d.ts.map +0 -1
  1484. package/dist/utils/env/browser/hex.d.ts.map +0 -1
  1485. package/dist/utils/env/browser/hrtime.d.ts.map +0 -1
  1486. package/dist/utils/env/browser/logScope.d.ts.map +0 -1
  1487. package/dist/utils/env/browser/md5.d.ts.map +0 -1
  1488. package/dist/utils/env/browser/platform.d.ts.map +0 -1
  1489. package/dist/utils/env/node/base64.d.ts.map +0 -1
  1490. package/dist/utils/env/node/crypto.d.ts.map +0 -1
  1491. package/dist/utils/env/node/exec.d.ts.map +0 -1
  1492. package/dist/utils/env/node/fs.d.ts.map +0 -1
  1493. package/dist/utils/env/node/hex.d.ts.map +0 -1
  1494. package/dist/utils/env/node/hrtime.d.ts.map +0 -1
  1495. package/dist/utils/env/node/hrtime.js.map +0 -1
  1496. package/dist/utils/env/node/logScope.d.ts.map +0 -1
  1497. package/dist/utils/env/node/platform.d.ts.map +0 -1
  1498. package/dist/utils/error.d.ts.map +0 -1
  1499. package/dist/utils/event.d.ts.map +0 -1
  1500. package/dist/utils/formatter.d.ts.map +0 -1
  1501. package/dist/utils/fs.d.ts.map +0 -1
  1502. package/dist/utils/fs.js.map +0 -1
  1503. package/dist/utils/function.d.ts.map +0 -1
  1504. package/dist/utils/fuzzy.d.ts.map +0 -1
  1505. package/dist/utils/hash.d.ts.map +0 -1
  1506. package/dist/utils/hex.d.ts.map +0 -1
  1507. package/dist/utils/hex.js.map +0 -1
  1508. package/dist/utils/hrtime.d.ts.map +0 -1
  1509. package/dist/utils/iterable.d.ts.map +0 -1
  1510. package/dist/utils/keys/chord.d.ts.map +0 -1
  1511. package/dist/utils/keys/keybinding.d.ts.map +0 -1
  1512. package/dist/utils/lazy.d.ts.map +0 -1
  1513. package/dist/utils/loggable.d.ts.map +0 -1
  1514. package/dist/utils/logger.d.ts.map +0 -1
  1515. package/dist/utils/logger.scoped.d.ts.map +0 -1
  1516. package/dist/utils/lruMap.d.ts.map +0 -1
  1517. package/dist/utils/markdown.d.ts.map +0 -1
  1518. package/dist/utils/mru.d.ts.map +0 -1
  1519. package/dist/utils/object.d.ts.map +0 -1
  1520. package/dist/utils/paging.d.ts.map +0 -1
  1521. package/dist/utils/path.d.ts.map +0 -1
  1522. package/dist/utils/platform.d.ts.map +0 -1
  1523. package/dist/utils/platform.js.map +0 -1
  1524. package/dist/utils/promise.d.ts.map +0 -1
  1525. package/dist/utils/promiseCache.d.ts.map +0 -1
  1526. package/dist/utils/resourceUsage.d.ts.map +0 -1
  1527. package/dist/utils/resourceUsage.js.map +0 -1
  1528. package/dist/utils/searchTree.d.ts.map +0 -1
  1529. package/dist/utils/stopwatch.d.ts.map +0 -1
  1530. package/dist/utils/string.d.ts.map +0 -1
  1531. package/dist/utils/subscriptionManager.d.ts.map +0 -1
  1532. package/dist/utils/trie.d.ts.map +0 -1
  1533. package/dist/utils/types.d.ts.map +0 -1
  1534. package/dist/utils/types.js.map +0 -1
  1535. package/dist/utils/uri.d.ts.map +0 -1
  1536. package/dist/utils/validation.d.ts.map +0 -1
  1537. package/dist/utils/version.d.ts.map +0 -1
  1538. package/src/git/cache.ts +0 -1859
  1539. package/src/git/context.ts +0 -301
  1540. package/src/git/errors.ts +0 -1168
  1541. package/src/git/features.ts +0 -98
  1542. package/src/git/gitHealth.ts +0 -522
  1543. package/src/git/models/author.ts +0 -19
  1544. package/src/git/models/autolink.ts +0 -59
  1545. package/src/git/models/blame.ts +0 -46
  1546. package/src/git/models/branch.ts +0 -237
  1547. package/src/git/models/commit.ts +0 -673
  1548. package/src/git/models/contributor.ts +0 -84
  1549. package/src/git/models/defaultBranch.ts +0 -6
  1550. package/src/git/models/diff.ts +0 -74
  1551. package/src/git/models/file.ts +0 -29
  1552. package/src/git/models/fileChange.ts +0 -82
  1553. package/src/git/models/fileStatus.ts +0 -36
  1554. package/src/git/models/graph.ts +0 -444
  1555. package/src/git/models/graphSearch.ts +0 -53
  1556. package/src/git/models/graphSession.ts +0 -102
  1557. package/src/git/models/issue.ts +0 -273
  1558. package/src/git/models/issueOrPullRequest.ts +0 -20
  1559. package/src/git/models/lineRange.ts +0 -7
  1560. package/src/git/models/log.ts +0 -21
  1561. package/src/git/models/mergeConflicts.ts +0 -19
  1562. package/src/git/models/patch.ts +0 -25
  1563. package/src/git/models/pausedOperationStatus.ts +0 -63
  1564. package/src/git/models/pullRequest.ts +0 -357
  1565. package/src/git/models/rebase.ts +0 -60
  1566. package/src/git/models/reference.ts +0 -80
  1567. package/src/git/models/reflog.ts +0 -88
  1568. package/src/git/models/remote.ts +0 -100
  1569. package/src/git/models/remoteProvider.ts +0 -291
  1570. package/src/git/models/remoteResource.ts +0 -87
  1571. package/src/git/models/repository.ts +0 -510
  1572. package/src/git/models/repositoryChangeEvent.ts +0 -30
  1573. package/src/git/models/repositoryIdentities.ts +0 -99
  1574. package/src/git/models/repositoryMetadata.ts +0 -12
  1575. package/src/git/models/resourceDescriptor.ts +0 -28
  1576. package/src/git/models/revision.ts +0 -12
  1577. package/src/git/models/search.ts +0 -138
  1578. package/src/git/models/shortlog.ts +0 -6
  1579. package/src/git/models/signature.ts +0 -45
  1580. package/src/git/models/staging.ts +0 -27
  1581. package/src/git/models/stash.ts +0 -6
  1582. package/src/git/models/status.ts +0 -246
  1583. package/src/git/models/statusFile.ts +0 -131
  1584. package/src/git/models/tag.ts +0 -76
  1585. package/src/git/models/tree.ts +0 -10
  1586. package/src/git/models/user.ts +0 -7
  1587. package/src/git/models/worktree.ts +0 -160
  1588. package/src/git/parsers/diffParser.ts +0 -648
  1589. package/src/git/parsers/rebaseTodoParser.ts +0 -169
  1590. package/src/git/providers/blame.ts +0 -40
  1591. package/src/git/providers/branches.ts +0 -143
  1592. package/src/git/providers/commits.ts +0 -174
  1593. package/src/git/providers/config.ts +0 -167
  1594. package/src/git/providers/contributors.ts +0 -34
  1595. package/src/git/providers/diff.ts +0 -133
  1596. package/src/git/providers/graph.ts +0 -95
  1597. package/src/git/providers/maintenance.ts +0 -224
  1598. package/src/git/providers/operations.ts +0 -164
  1599. package/src/git/providers/patch.ts +0 -31
  1600. package/src/git/providers/pausedOperations.ts +0 -23
  1601. package/src/git/providers/provider.ts +0 -64
  1602. package/src/git/providers/refs.ts +0 -68
  1603. package/src/git/providers/remotes.ts +0 -33
  1604. package/src/git/providers/revision.ts +0 -32
  1605. package/src/git/providers/shared/remotes.ts +0 -95
  1606. package/src/git/providers/staging.ts +0 -36
  1607. package/src/git/providers/stash.ts +0 -51
  1608. package/src/git/providers/status.ts +0 -48
  1609. package/src/git/providers/tags.ts +0 -29
  1610. package/src/git/providers/types.ts +0 -33
  1611. package/src/git/providers/worktrees.ts +0 -37
  1612. package/src/git/remotes/azure-devops.ts +0 -361
  1613. package/src/git/remotes/bitbucket-server.ts +0 -189
  1614. package/src/git/remotes/bitbucket.ts +0 -142
  1615. package/src/git/remotes/custom.ts +0 -162
  1616. package/src/git/remotes/gerrit.ts +0 -186
  1617. package/src/git/remotes/gitea.ts +0 -184
  1618. package/src/git/remotes/github.ts +0 -236
  1619. package/src/git/remotes/gitlab.ts +0 -270
  1620. package/src/git/remotes/google-source.ts +0 -51
  1621. package/src/git/remotes/matcher.ts +0 -215
  1622. package/src/git/repositoryService.ts +0 -180
  1623. package/src/git/run.types.ts +0 -156
  1624. package/src/git/service.ts +0 -369
  1625. package/src/git/utils/autolink.utils.ts +0 -202
  1626. package/src/git/utils/blame.utils.ts +0 -298
  1627. package/src/git/utils/branch.utils.ts +0 -165
  1628. package/src/git/utils/commit.utils.ts +0 -89
  1629. package/src/git/utils/config.utils.ts +0 -8
  1630. package/src/git/utils/conflictResolution.utils.ts +0 -157
  1631. package/src/git/utils/contributor.utils.ts +0 -105
  1632. package/src/git/utils/fetch.utils.ts +0 -48
  1633. package/src/git/utils/fileStatus.utils.ts +0 -62
  1634. package/src/git/utils/graph.utils.ts +0 -46
  1635. package/src/git/utils/issue.utils.ts +0 -187
  1636. package/src/git/utils/issueOrPullRequest.utils.ts +0 -23
  1637. package/src/git/utils/mergeConflicts.utils.ts +0 -21
  1638. package/src/git/utils/pausedOperationStatus.utils.ts +0 -184
  1639. package/src/git/utils/pullRequest.utils.ts +0 -244
  1640. package/src/git/utils/reachability.utils.ts +0 -180
  1641. package/src/git/utils/rebase.utils.ts +0 -128
  1642. package/src/git/utils/reference.utils.ts +0 -267
  1643. package/src/git/utils/remote.utils.ts +0 -146
  1644. package/src/git/utils/repository.utils.ts +0 -18
  1645. package/src/git/utils/resourceDescriptor.utils.ts +0 -26
  1646. package/src/git/utils/revision.utils.ts +0 -149
  1647. package/src/git/utils/search.utils.ts +0 -624
  1648. package/src/git/utils/sorting.ts +0 -329
  1649. package/src/git/utils/sshKey.utils.ts +0 -30
  1650. package/src/git/utils/status.utils.ts +0 -115
  1651. package/src/git/utils/statusFile.utils.ts +0 -182
  1652. package/src/git/utils/tag.utils.ts +0 -17
  1653. package/src/git/utils/tooltip.utils.ts +0 -37
  1654. package/src/git/utils/uriAuthority.ts +0 -34
  1655. package/src/git/utils/user.utils.ts +0 -20
  1656. package/src/git/utils/worktree.utils.ts +0 -21
  1657. package/src/git/watching/changeEvent.ts +0 -95
  1658. package/src/git/watching/classifyChange.ts +0 -104
  1659. package/src/git/watching/gitIgnoreFilter.ts +0 -134
  1660. package/src/git/watching/initWatcher.ts +0 -81
  1661. package/src/git/watching/provider.ts +0 -24
  1662. package/src/git/watching/watchGroup.ts +0 -185
  1663. package/src/git/watching/watchService.ts +0 -430
  1664. package/src/git/watching/watchSession.ts +0 -439
  1665. package/src/git/watching/watcherPatterns.ts +0 -51
  1666. package/src/git-cli/cliGitProvider.ts +0 -461
  1667. package/src/git-cli/exec/exec.errors.ts +0 -1
  1668. package/src/git-cli/exec/exec.ts +0 -11
  1669. package/src/git-cli/exec/exec.types.ts +0 -8
  1670. package/src/git-cli/exec/features.ts +0 -2
  1671. package/src/git-cli/exec/git.ts +0 -1371
  1672. package/src/git-cli/exec/gitQueue.ts +0 -326
  1673. package/src/git-cli/exec/locator.ts +0 -157
  1674. package/src/git-cli/parsers/blameParser.ts +0 -374
  1675. package/src/git-cli/parsers/indexParser.ts +0 -192
  1676. package/src/git-cli/parsers/logParser.ts +0 -1365
  1677. package/src/git-cli/parsers/mergeTreeParser.ts +0 -22
  1678. package/src/git-cli/parsers/refParser.ts +0 -110
  1679. package/src/git-cli/parsers/reflogParser.ts +0 -153
  1680. package/src/git-cli/parsers/remoteParser.ts +0 -95
  1681. package/src/git-cli/parsers/shortlogParser.ts +0 -59
  1682. package/src/git-cli/parsers/signatureParser.ts +0 -162
  1683. package/src/git-cli/parsers/sshSignatureParser.ts +0 -85
  1684. package/src/git-cli/parsers/statusParser.ts +0 -209
  1685. package/src/git-cli/parsers/treeParser.ts +0 -61
  1686. package/src/git-cli/parsers/worktreeParser.ts +0 -111
  1687. package/src/git-cli/providers/blame.ts +0 -598
  1688. package/src/git-cli/providers/branches.ts +0 -1931
  1689. package/src/git-cli/providers/commitFilesetUtils.ts +0 -45
  1690. package/src/git-cli/providers/commits.ts +0 -1856
  1691. package/src/git-cli/providers/config.ts +0 -1025
  1692. package/src/git-cli/providers/contributors.ts +0 -360
  1693. package/src/git-cli/providers/diff.ts +0 -1172
  1694. package/src/git-cli/providers/graph.ts +0 -2237
  1695. package/src/git-cli/providers/maintenance.ts +0 -2599
  1696. package/src/git-cli/providers/operations.ts +0 -1016
  1697. package/src/git-cli/providers/patch.ts +0 -305
  1698. package/src/git-cli/providers/pausedOperations.ts +0 -670
  1699. package/src/git-cli/providers/refs.ts +0 -486
  1700. package/src/git-cli/providers/remotes.ts +0 -115
  1701. package/src/git-cli/providers/revision.ts +0 -383
  1702. package/src/git-cli/providers/staging.ts +0 -210
  1703. package/src/git-cli/providers/stash.ts +0 -577
  1704. package/src/git-cli/providers/status.ts +0 -568
  1705. package/src/git-cli/providers/tags.ts +0 -224
  1706. package/src/git-cli/providers/worktrees.ts +0 -285
  1707. package/src/git-cli/service.ts +0 -82
  1708. package/src/ipc/discovery.ts +0 -186
  1709. package/src/ipc/ipcServer.ts +0 -171
  1710. package/src/plus/agents/agentCapabilities.ts +0 -286
  1711. package/src/plus/agents/providers/claudeCodeTranscript.ts +0 -867
  1712. package/src/plus/agents/providers/gkAgentProvider.ts +0 -4036
  1713. package/src/plus/agents/sanitizePrompt.ts +0 -109
  1714. package/src/plus/agents/stateMachine.ts +0 -197
  1715. package/src/plus/agents/types.ts +0 -500
  1716. package/src/plus/ai/constants.ts +0 -121
  1717. package/src/plus/ai/errors.ts +0 -152
  1718. package/src/plus/ai/models/conversation.ts +0 -35
  1719. package/src/plus/ai/models/model.ts +0 -528
  1720. package/src/plus/ai/models/promptTemplates.ts +0 -171
  1721. package/src/plus/ai/models/provider.ts +0 -125
  1722. package/src/plus/ai/models/results.ts +0 -31
  1723. package/src/plus/ai/prompts.ts +0 -849
  1724. package/src/plus/ai/providers/anthropicProvider.ts +0 -458
  1725. package/src/plus/ai/providers/azureProvider.ts +0 -74
  1726. package/src/plus/ai/providers/context.ts +0 -29
  1727. package/src/plus/ai/providers/deepSeekProvider.ts +0 -46
  1728. package/src/plus/ai/providers/geminiProvider.ts +0 -245
  1729. package/src/plus/ai/providers/gitkrakenProvider.ts +0 -347
  1730. package/src/plus/ai/providers/huggingFaceProvider.ts +0 -64
  1731. package/src/plus/ai/providers/mistralProvider.ts +0 -243
  1732. package/src/plus/ai/providers/ollamaProvider.ts +0 -292
  1733. package/src/plus/ai/providers/openAICompatibleProvider.ts +0 -64
  1734. package/src/plus/ai/providers/openAICompatibleProviderBase.ts +0 -654
  1735. package/src/plus/ai/providers/openRouterProvider.ts +0 -101
  1736. package/src/plus/ai/providers/openaiProvider.ts +0 -47
  1737. package/src/plus/ai/providers/responseFormatCache.ts +0 -39
  1738. package/src/plus/ai/providers/xaiProvider.ts +0 -54
  1739. package/src/plus/ai/utils/ai.utils.ts +0 -95
  1740. package/src/plus/ai/utils/results.utils.ts +0 -407
  1741. package/src/plus/ai/utils/truncation.utils.ts +0 -296
  1742. package/src/plus/git-github/api/config.ts +0 -91
  1743. package/src/plus/git-github/api/github.ts +0 -5462
  1744. package/src/plus/git-github/api/github.utils.ts +0 -36
  1745. package/src/plus/git-github/api/issueSearchQuery.ts +0 -273
  1746. package/src/plus/git-github/api/pullRequestSearchQuery.ts +0 -154
  1747. package/src/plus/git-github/api/token.ts +0 -15
  1748. package/src/plus/git-github/api/tokenUtils.ts +0 -15
  1749. package/src/plus/git-github/api/types.ts +0 -197
  1750. package/src/plus/git-github/context.ts +0 -107
  1751. package/src/plus/git-github/models.ts +0 -623
  1752. package/src/plus/git-github/providers/github/blame.ts +0 -225
  1753. package/src/plus/git-github/providers/github/branches.ts +0 -401
  1754. package/src/plus/git-github/providers/github/commits.ts +0 -929
  1755. package/src/plus/git-github/providers/github/config.ts +0 -47
  1756. package/src/plus/git-github/providers/github/contributors.ts +0 -313
  1757. package/src/plus/git-github/providers/github/diff.ts +0 -281
  1758. package/src/plus/git-github/providers/github/graph.ts +0 -635
  1759. package/src/plus/git-github/providers/github/refs.ts +0 -172
  1760. package/src/plus/git-github/providers/github/remotes.ts +0 -44
  1761. package/src/plus/git-github/providers/github/revision.ts +0 -140
  1762. package/src/plus/git-github/providers/github/status.ts +0 -69
  1763. package/src/plus/git-github/providers/github/tags.ts +0 -148
  1764. package/src/plus/git-github/providers/githubGitProvider.ts +0 -168
  1765. package/src/plus/git-github/providers/githubProvider.ts +0 -65
  1766. package/src/plus/integrations/authentication/cloudIntegrationService.ts +0 -292
  1767. package/src/plus/integrations/authentication/configuredIntegrationService.ts +0 -656
  1768. package/src/plus/integrations/authentication/integrationAuthenticationProvider.ts +0 -385
  1769. package/src/plus/integrations/authentication/integrationAuthenticationService.ts +0 -148
  1770. package/src/plus/integrations/authentication/manualTokenProvider.ts +0 -79
  1771. package/src/plus/integrations/authentication/models.ts +0 -202
  1772. package/src/plus/integrations/authentication/rejectedTokenTracker.ts +0 -56
  1773. package/src/plus/integrations/collectionMetadata.ts +0 -325
  1774. package/src/plus/integrations/constants.ts +0 -190
  1775. package/src/plus/integrations/context.ts +0 -386
  1776. package/src/plus/integrations/errors.ts +0 -188
  1777. package/src/plus/integrations/index.ts +0 -231
  1778. package/src/plus/integrations/integrationService.ts +0 -2003
  1779. package/src/plus/integrations/lite.ts +0 -233
  1780. package/src/plus/integrations/manager.ts +0 -728
  1781. package/src/plus/integrations/models/gitHostIntegration.ts +0 -1862
  1782. package/src/plus/integrations/models/integration.ts +0 -1005
  1783. package/src/plus/integrations/models/issueCache.ts +0 -29
  1784. package/src/plus/integrations/models/issueReads.ts +0 -152
  1785. package/src/plus/integrations/models/issuesIntegration.ts +0 -248
  1786. package/src/plus/integrations/models/pullRequestReads.ts +0 -18
  1787. package/src/plus/integrations/providerFilters.ts +0 -36
  1788. package/src/plus/integrations/providers/accounts.ts +0 -38
  1789. package/src/plus/integrations/providers/apiClients.ts +0 -69
  1790. package/src/plus/integrations/providers/apiConfig.ts +0 -71
  1791. package/src/plus/integrations/providers/azure/azure.ts +0 -953
  1792. package/src/plus/integrations/providers/azure/models.ts +0 -723
  1793. package/src/plus/integrations/providers/azureDevOps.ts +0 -1355
  1794. package/src/plus/integrations/providers/bitbucket/bitbucket.ts +0 -904
  1795. package/src/plus/integrations/providers/bitbucket/models.ts +0 -446
  1796. package/src/plus/integrations/providers/bitbucket-server/models.ts +0 -283
  1797. package/src/plus/integrations/providers/bitbucket-server.ts +0 -445
  1798. package/src/plus/integrations/providers/bitbucket.ts +0 -793
  1799. package/src/plus/integrations/providers/github/github.ts +0 -64
  1800. package/src/plus/integrations/providers/github/github.utils.ts +0 -23
  1801. package/src/plus/integrations/providers/github/models.ts +0 -29
  1802. package/src/plus/integrations/providers/github.ts +0 -940
  1803. package/src/plus/integrations/providers/gitlab/gitlab.ts +0 -1320
  1804. package/src/plus/integrations/providers/gitlab/gitlab.utils.ts +0 -80
  1805. package/src/plus/integrations/providers/gitlab/models.ts +0 -271
  1806. package/src/plus/integrations/providers/gitlab.ts +0 -841
  1807. package/src/plus/integrations/providers/issueSorts.ts +0 -89
  1808. package/src/plus/integrations/providers/jira.ts +0 -596
  1809. package/src/plus/integrations/providers/jiraIssueByKey.ts +0 -155
  1810. package/src/plus/integrations/providers/linear.ts +0 -484
  1811. package/src/plus/integrations/providers/models.ts +0 -1833
  1812. package/src/plus/integrations/providers/providerErrors.ts +0 -115
  1813. package/src/plus/integrations/providers/providersApi.ts +0 -1881
  1814. package/src/plus/integrations/providers/pullRequestReviews.ts +0 -122
  1815. package/src/plus/integrations/providers/trello.ts +0 -208
  1816. package/src/plus/integrations/providers/utils/providerPaging.ts +0 -212
  1817. package/src/plus/integrations/providers/utils.ts +0 -419
  1818. package/src/plus/integrations/reads/broaden.ts +0 -704
  1819. package/src/plus/integrations/reads/context.ts +0 -99
  1820. package/src/plus/integrations/reads/counts.ts +0 -610
  1821. package/src/plus/integrations/reads/cursors.ts +0 -224
  1822. package/src/plus/integrations/reads/drains.ts +0 -420
  1823. package/src/plus/integrations/reads/filters.ts +0 -614
  1824. package/src/plus/integrations/reads/hierarchy.ts +0 -486
  1825. package/src/plus/integrations/reads/hierarchy.utils.ts +0 -155
  1826. package/src/plus/integrations/reads/issueBatch.ts +0 -197
  1827. package/src/plus/integrations/reads/issueTracker.ts +0 -556
  1828. package/src/plus/integrations/reads/issues.ts +0 -600
  1829. package/src/plus/integrations/reads/ordering.ts +0 -124
  1830. package/src/plus/integrations/reads/paging.ts +0 -379
  1831. package/src/plus/integrations/reads/pullRequests.ts +0 -260
  1832. package/src/plus/integrations/reads/resolveRepository.ts +0 -275
  1833. package/src/plus/integrations/reads/searchIssues.ts +0 -274
  1834. package/src/plus/integrations/reads/searchPullRequests.ts +0 -235
  1835. package/src/plus/integrations/reads/sweeps.ts +0 -266
  1836. package/src/plus/integrations/reads/trackerIssue.ts +0 -105
  1837. package/src/plus/integrations/reads/warnings.ts +0 -535
  1838. package/src/plus/integrations/results.ts +0 -443
  1839. package/src/plus/integrations/telemetry.ts +0 -29
  1840. package/src/plus/integrations/utils/domain.utils.ts +0 -26
  1841. package/src/plus/integrations/utils/integration.utils.ts +0 -215
  1842. package/src/utils/array.ts +0 -194
  1843. package/src/utils/base64.ts +0 -1
  1844. package/src/utils/brand.ts +0 -7
  1845. package/src/utils/cancellation.ts +0 -199
  1846. package/src/utils/charCode.ts +0 -38
  1847. package/src/utils/coalescedRun.ts +0 -45
  1848. package/src/utils/color.ts +0 -817
  1849. package/src/utils/counter.ts +0 -21
  1850. package/src/utils/crypto.ts +0 -1
  1851. package/src/utils/date.ts +0 -474
  1852. package/src/utils/debounce.ts +0 -303
  1853. package/src/utils/decorators/debounce.ts +0 -31
  1854. package/src/utils/decorators/gate.ts +0 -167
  1855. package/src/utils/decorators/log.ts +0 -320
  1856. package/src/utils/decorators/memoize.ts +0 -98
  1857. package/src/utils/decorators/resolver.ts +0 -95
  1858. package/src/utils/decorators/sequentialize.ts +0 -118
  1859. package/src/utils/decorators/serializable.ts +0 -43
  1860. package/src/utils/dedupedAsyncCache.ts +0 -74
  1861. package/src/utils/diff.ts +0 -61
  1862. package/src/utils/disposable.ts +0 -156
  1863. package/src/utils/encoding.ts +0 -8
  1864. package/src/utils/env/browser/base64.ts +0 -50
  1865. package/src/utils/env/browser/crypto.ts +0 -21
  1866. package/src/utils/env/browser/fs.ts +0 -3
  1867. package/src/utils/env/browser/hex.ts +0 -41
  1868. package/src/utils/env/browser/hrtime.ts +0 -14
  1869. package/src/utils/env/browser/logScope.ts +0 -57
  1870. package/src/utils/env/browser/md5.ts +0 -217
  1871. package/src/utils/env/browser/platform.ts +0 -10
  1872. package/src/utils/env/node/base64.ts +0 -19
  1873. package/src/utils/env/node/crypto.ts +0 -17
  1874. package/src/utils/env/node/exec.ts +0 -488
  1875. package/src/utils/env/node/fs.ts +0 -5
  1876. package/src/utils/env/node/hex.ts +0 -11
  1877. package/src/utils/env/node/hrtime.ts +0 -1
  1878. package/src/utils/env/node/logScope.ts +0 -63
  1879. package/src/utils/env/node/platform.ts +0 -5
  1880. package/src/utils/error.ts +0 -18
  1881. package/src/utils/event.ts +0 -230
  1882. package/src/utils/formatter.ts +0 -198
  1883. package/src/utils/fs.ts +0 -1
  1884. package/src/utils/function.ts +0 -141
  1885. package/src/utils/fuzzy.ts +0 -185
  1886. package/src/utils/hash.ts +0 -60
  1887. package/src/utils/hex.ts +0 -1
  1888. package/src/utils/hrtime.ts +0 -8
  1889. package/src/utils/iterable.ts +0 -797
  1890. package/src/utils/keys/chord.ts +0 -184
  1891. package/src/utils/keys/keybinding.ts +0 -116
  1892. package/src/utils/lazy.ts +0 -39
  1893. package/src/utils/loggable.ts +0 -7
  1894. package/src/utils/logger.scoped.ts +0 -237
  1895. package/src/utils/logger.ts +0 -403
  1896. package/src/utils/lruMap.ts +0 -112
  1897. package/src/utils/markdown.ts +0 -115
  1898. package/src/utils/mru.ts +0 -68
  1899. package/src/utils/object.ts +0 -278
  1900. package/src/utils/paging.ts +0 -97
  1901. package/src/utils/path.ts +0 -204
  1902. package/src/utils/platform.ts +0 -1
  1903. package/src/utils/promise.ts +0 -657
  1904. package/src/utils/promiseCache.ts +0 -908
  1905. package/src/utils/resourceUsage.ts +0 -5
  1906. package/src/utils/searchTree.ts +0 -444
  1907. package/src/utils/stopwatch.ts +0 -125
  1908. package/src/utils/string.ts +0 -1003
  1909. package/src/utils/subscriptionManager.ts +0 -40
  1910. package/src/utils/trie.ts +0 -740
  1911. package/src/utils/types.ts +0 -31
  1912. package/src/utils/uri.ts +0 -118
  1913. package/src/utils/validation.ts +0 -38
  1914. package/src/utils/version.ts +0 -128
@@ -1,1866 +1,1418 @@
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 { GitSearchError } from '../../git/errors.js';
60
- import { getBranchId, getBranchNameWithoutRemote, getRemoteNameFromBranchName, } from '../../git/utils/branch.utils.js';
61
- import { appendRowsAtCursor, mergeAvatarsForward } from '../../git/utils/graph.utils.js';
62
- import { computeGraphRowContextFlags, createReachabilityTableBuilder } from '../../git/utils/reachability.utils.js';
63
- import { isUncommitted } from '../../git/utils/revision.utils.js';
64
- import { getSearchQueryComparisonKey, parseSearchQueryGitCommand } from '../../git/utils/search.utils.js';
65
- import { getTagId } from '../../git/utils/tag.utils.js';
66
- import { isUserMatch } from '../../git/utils/user.utils.js';
67
- import { getWorktreeId, groupWorktreesByBranch } from '../../git/utils/worktree.utils.js';
68
- import { isCancellationError } from '../../utils/cancellation.js';
69
- import { debug } from '../../utils/decorators/log.js';
70
- import { createDisposable } from '../../utils/disposable.js';
71
- import { fnv1aHash64 } from '../../utils/hash.js';
72
- import { find, first, join, last } from '../../utils/iterable.js';
73
- import { getScopedLogger } from '../../utils/logger.scoped.js';
74
- import { getSettledValue } from '../../utils/promise.js';
75
- import { classifySearchError, gitConfigsLog } from '../exec/git.js';
76
- import { getGraphParser, getShaAndDatesLogParser, getShaAndDatesWithFilesLogParser, getShaAndStatsLogParser, getShaLogParser, } from '../parsers/logParser.js';
77
- import { convertStashesToStdin } from './stash.js';
78
- const progressiveSearchResultsBatchTimeMs = 500; // Send updates every 500ms (2 updates/second)
1
+ import { find, first, join, last } from "../../utils/iterable.js";
2
+ import { CancellationError, isCancellationError } from "../../utils/cancellation.js";
3
+ import { getScopedLogger } from "../../utils/logger.scoped.js";
4
+ import { getSettledValue } from "../../utils/promise.js";
5
+ import { debug } from "../../utils/decorators/log.js";
6
+ import { getBranchId, getBranchNameWithoutRemote, getRemoteNameFromBranchName } from "../../utils/gitRefs.js";
7
+ import { isUncommitted } from "../../git/utils/revision.utils.js";
8
+ import __decorate from "../../_virtual/@oxc-project+runtime/helpers/esm/decorate.js";
9
+ import { GitSearchError } from "../../git/errors.js";
10
+ import { createDisposable } from "../../utils/disposable.js";
11
+ import { classifySearchError, gitConfigsLog } from "../exec/git.js";
12
+ import { fnv1aHash64 } from "../../utils/hash.js";
13
+ import { isUserMatch } from "../../git/utils/user.utils.js";
14
+ import _usingCtx from "../../_virtual/@oxc-project+runtime/helpers/esm/usingCtx.js";
15
+ import { getSearchQueryComparisonKey, parseSearchQueryGitCommand } from "../../git/utils/search.utils.js";
16
+ import { getGraphParser, getShaAndDatesLogParser, getShaAndDatesWithFilesLogParser, getShaAndStatsLogParser, getShaLogParser } from "../parsers/logParser.js";
17
+ import { convertStashesToStdin } from "./stash.js";
18
+ import { GraphSessionWriteQueue } from "../../git/models/graphSession.js";
19
+ import { appendRowsAtCursor, mergeAvatarsForward, restampGraphRowIds } from "../../git/utils/graph.utils.js";
20
+ import { computeGraphRowContextFlags, createReachabilityTableBuilder } from "../../git/utils/reachability.utils.js";
21
+ import { getTagId } from "../../git/utils/tag.utils.js";
22
+ import { getWorktreeId, groupWorktreesByBranch } from "../../git/utils/worktree.utils.js";
23
+ //#region ../git-cli/src/providers/graph.ts
24
+ const progressiveSearchResultsBatchTimeMs = 500;
79
25
  /**
80
- * Whether a ref participates in graph row decoration (a branch/remote/tag badge) and so must be diffed by
81
- * the R6b tip gate. Excludes `refs/stash` (handled by the stash gate) and symbolic `…/HEAD` refs (they
82
- * mirror another ref and produce no badge of their own).
83
- */
26
+ * Whether a ref participates in graph row decoration (a branch/remote/tag badge) and so must be diffed by
27
+ * the R6b tip gate. Excludes `refs/stash` (handled by the stash gate) and symbolic `…/HEAD` refs (they
28
+ * mirror another ref and produce no badge of their own).
29
+ */
84
30
  function isMoveableGraphRef(refname) {
85
- if (refname === 'refs/stash' || refname === 'HEAD' || refname.endsWith('/HEAD'))
86
- return false;
87
- return refname.startsWith('refs/heads/') || refname.startsWith('refs/remotes/') || refname.startsWith('refs/tags/');
31
+ if (refname === "refs/stash" || refname === "HEAD" || refname.endsWith("/HEAD")) return false;
32
+ return refname.startsWith("refs/heads/") || refname.startsWith("refs/remotes/") || refname.startsWith("refs/tags/");
88
33
  }
89
34
  /**
90
- * Fingerprints the GLOBAL side inputs row construction embeds into row decorations — the default branch
91
- * (and whether a local branch shadows it), HEAD's upstream, remote urls/providers, secondary-worktree
92
- * assignments, and the current user. These can all change WITHOUT moving any ref tip (`git remote
93
- * set-head`, remote/user config edits, `git worktree add`), and the R6b fast path reuses prior rows
94
- * wholesale (only flags/reachability are re-derived) — so it compares this against the seed's and falls
95
- * back to the full walk (which rebuilds every decoration) on ANY change. Deliberately EXCLUDES what other
96
- * gates already own — ref existence/tips (tip gate), the default worktree's checkout (HEAD gate), and
97
- * per-branch upstream mappings (checked row-by-row against the seed's embedded pills, so tracking-branch
98
- * CREATES stay fast) — keeping the high-frequency events (commits, branch/tag creates, fetches,
99
- * checkouts) on the fast path. Sorted so map/list iteration order can't produce spurious mismatches.
100
- */
35
+ * Fingerprints the GLOBAL side inputs row construction embeds into row decorations — the default branch
36
+ * (and whether a local branch shadows it), HEAD's upstream, remote urls/providers, secondary-worktree
37
+ * assignments, and the current user. These can all change WITHOUT moving any ref tip (`git remote
38
+ * set-head`, remote/user config edits, `git worktree add`), and the R6b fast path reuses prior rows
39
+ * wholesale (only flags/reachability are re-derived) — so it compares this against the seed's and falls
40
+ * back to the full walk (which rebuilds every decoration) on ANY change. Deliberately EXCLUDES what other
41
+ * gates already own — ref existence/tips (tip gate), the default worktree's checkout (HEAD gate), and
42
+ * per-branch upstream mappings (checked row-by-row against the seed's embedded pills, so tracking-branch
43
+ * CREATES stay fast) — keeping the high-frequency events (commits, branch/tag creates, fetches,
44
+ * checkouts) on the fast path. Sorted so map/list iteration order can't produce spurious mismatches.
45
+ */
101
46
  function computeDecorationFingerprint(repoPath, defaultBranchName, defaultLocalName, headRefUpstreamName, branches, remotes, worktrees, currentUser) {
102
- // Remote-head default markers read `!branchMap.has(defaultLocalName)` a local branch appearing at (or
103
- // vanishing from) the default's local name flips them even though the DEFAULT ref itself didn't move.
104
- const localShadowsDefault = defaultLocalName != null && (branches?.some(b => b.name === defaultLocalName) ?? false);
105
- const parts = [
106
- `d:${defaultBranchName ?? ''}|${localShadowsDefault ? 's' : ''}`,
107
- `h:${headRefUpstreamName ?? ''}`,
108
- `u:${currentUser?.name ?? ''}|${currentUser?.email ?? ''}`,
109
- ];
110
- if (branches != null) {
111
- for (const b of branches) {
112
- // `+starred` is baked into branch pills' serialized contexts (local AND remote heads); a
113
- // disposition change moves no ref tip, so it must bust the fingerprint. Star/unstar is rare —
114
- // one full walk per transition is fine.
115
- if (b.starred) {
116
- parts.push(`s:${b.name}`);
117
- }
118
- }
119
- }
120
- if (remotes != null) {
121
- for (const r of remotes) {
122
- parts.push(`r:${r.name}|${r.url}|${r.provider?.gkProviderId ?? ''}`);
123
- }
124
- }
125
- let defaultWorktreeBranch;
126
- let defaultWorktreePath;
127
- for (const w of worktrees) {
128
- if (w.isDefault) {
129
- defaultWorktreeBranch = w.branch?.name;
130
- defaultWorktreePath = w.path;
131
- continue;
132
- }
133
- // Only branch-attached SECONDARY worktrees decorate rows: bare/detached ones are excluded from
134
- // `worktreesByBranch` (no pill). NOTE: `w.name` is deliberately avoided; it embeds the checked-out
135
- // branch (and a detached sha), which would bust this on every checkout.
136
- if (w.type !== 'branch')
137
- continue;
138
- parts.push(`w:${w.branch?.name ?? ''}|${w.path}`);
139
- }
140
- // The DEFAULT worktree's checkout flips `+checkedout` / the main-path worktree recovery on two branch
141
- // pills. When the graph IS the default worktree, that's the ordinary HEAD move (the HEAD gate refetches
142
- // both endpoint rows) — but a graph on a SECONDARY worktree sees no HEAD move when the MAIN worktree
143
- // checks out, so the assignment must fingerprint there. (`w.path` for the default worktree equals the
144
- // main repo path in this provider's normalization — pinned by a WorktreesSubProvider test.)
145
- if (defaultWorktreePath != null && defaultWorktreePath !== repoPath) {
146
- parts.push(`wd:${defaultWorktreeBranch ?? ''}`);
147
- }
148
- parts.sort();
149
- return fnv1aHash64(parts.join('\x00'));
47
+ const localShadowsDefault = defaultLocalName != null && (branches?.some((b) => b.name === defaultLocalName) ?? false);
48
+ const parts = [
49
+ `d:${defaultBranchName ?? ""}|${localShadowsDefault ? "s" : ""}`,
50
+ `h:${headRefUpstreamName ?? ""}`,
51
+ `u:${currentUser?.name ?? ""}|${currentUser?.email ?? ""}`
52
+ ];
53
+ if (branches != null) {
54
+ for (const b of branches) if (b.starred) parts.push(`s:${b.name}`);
55
+ }
56
+ if (remotes != null) for (const r of remotes) parts.push(`r:${r.name}|${r.url}|${r.provider?.gkProviderId ?? ""}`);
57
+ let defaultWorktreeBranch;
58
+ let defaultWorktreePath;
59
+ for (const w of worktrees) {
60
+ if (w.isDefault) {
61
+ defaultWorktreeBranch = w.branch?.name;
62
+ defaultWorktreePath = w.path;
63
+ continue;
64
+ }
65
+ if (w.type !== "branch") continue;
66
+ parts.push(`w:${w.branch?.name ?? ""}|${w.path}`);
67
+ }
68
+ if (defaultWorktreePath != null && defaultWorktreePath !== repoPath) parts.push(`wd:${defaultWorktreeBranch ?? ""}`);
69
+ parts.sort();
70
+ return fnv1aHash64(parts.join("\0"));
150
71
  }
151
72
  /**
152
- * Whether the shared reachability TABLE changed between two refresh generations. The table is append-only
153
- * within a generation (`id`), so a new `id` or a grown dictionary/sets length is an EXACT signal — a per-row
154
- * index that re-points to an already-present set doesn't grow the table (that change rides the rows channel).
155
- */
73
+ * Whether the shared reachability TABLE changed between two refresh generations. The table is append-only
74
+ * within a generation (`id`), so a new `id` or a grown dictionary/sets length is an EXACT signal — a per-row
75
+ * index that re-points to an already-present set doesn't grow the table (that change rides the rows channel).
76
+ */
156
77
  function reachabilityTableChanged(prior, next) {
157
- if (prior == null || next == null)
158
- return prior !== next;
159
- return (prior.id !== next.id ||
160
- prior.dictionary.length !== next.dictionary.length ||
161
- prior.sets.length !== next.sets.length);
78
+ if (prior == null || next == null) return prior !== next;
79
+ return prior.id !== next.id || prior.dictionary.length !== next.dictionary.length || prior.sets.length !== next.sets.length;
162
80
  }
163
81
  /**
164
- * Whether the downstreams map (upstream name → tracking branch names) changed between two refresh
165
- * generations. Order-sensitive on the arrays: a mere reorder reports "changed" and re-ships the full map,
166
- * which is harmless — a false negative would silently drop a real upstream change, so err toward "changed".
167
- */
82
+ * Whether the downstreams map (upstream name → tracking branch names) changed between two refresh
83
+ * generations. Order-sensitive on the arrays: a mere reorder reports "changed" and re-ships the full map,
84
+ * which is harmless — a false negative would silently drop a real upstream change, so err toward "changed".
85
+ */
168
86
  function downstreamsChanged(prior, next) {
169
- if (prior.size !== next.size)
170
- return true;
171
- for (const [key, priorNames] of prior) {
172
- const nextNames = next.get(key);
173
- if (nextNames == null || nextNames.length !== priorNames.length)
174
- return true;
175
- for (let i = 0; i < priorNames.length; i++) {
176
- if (priorNames[i] !== nextNames[i])
177
- return true;
178
- }
179
- }
180
- return false;
87
+ if (prior.size !== next.size) return true;
88
+ for (const [key, priorNames] of prior) {
89
+ const nextNames = next.get(key);
90
+ if (nextNames == null || nextNames.length !== priorNames.length) return true;
91
+ for (let i = 0; i < priorNames.length; i++) if (priorNames[i] !== nextNames[i]) return true;
92
+ }
93
+ return false;
181
94
  }
182
95
  /** The walk-shape key (`ordering|onlyFollowFirstParent`) an incremental seed is gated on — one builder so the
183
- * refresh/rebuild sites can't drift in how they stringify it. */
96
+ * refresh/rebuild sites can't drift in how they stringify it. */
184
97
  function buildShapeKey(shape) {
185
- return `${shape.ordering}|${shape.onlyFollowFirstParent}`;
98
+ return `${shape.ordering}|${shape.onlyFollowFirstParent}`;
186
99
  }
187
- export class GraphGitSubProvider {
188
- context;
189
- git;
190
- cache;
191
- provider;
192
- constructor(context, git, cache, provider) {
193
- this.context = context;
194
- this.git = git;
195
- this.cache = cache;
196
- this.provider = provider;
197
- }
198
- /**
199
- * Current ref tips (canonical refname → PEELED commit sha), for the R6b fast path's gate. Peeled so an
200
- * annotated tag maps to the commit its badge sits on — the same convention {@link GraphIncrementalSeed.tips}
201
- * uses — and so the seed↔current diff is by commit identity. Covers heads/remotes/tags/replace (all the
202
- * namespaces the gate consumers read); the caller filters to the ref classes it cares about.
203
- */
204
- async getCurrentRefTips(repoPath, cancellation) {
205
- const tips = new Map();
206
- try {
207
- // `force: true` invalidates the shared refs cache so this spawns fresh (this gate needs a
208
- // point-in-time read, not a possibly-stale cached one) while ALSO repopulating that cache —
209
- // one `for-each-ref` serves both this gate and any sibling `getRefs`/`getBranches`/`getTags`
210
- // call racing it (they attach to the same in-flight spawn).
211
- const records = await this.provider.refs.getRefs(repoPath, cancellation, { force: true });
212
- for (const record of records) {
213
- if (!record.name)
214
- continue;
215
- // Peeled objectname is set only for annotated tags; everything else uses objectname.
216
- tips.set(record.name, record.peeledObjectname || record.objectname);
217
- }
218
- }
219
- catch {
220
- // Preserve the prelude's "never rejects" contract (see the bare `await` at the call site):
221
- // a per-caller cancellation race through the shared cache (or any other failure) degrades
222
- // to no tips, same as the direct `errors: 'ignore'` spawn this replaced.
223
- }
224
- return tips;
225
- }
226
- /**
227
- * Whether the repo is a SHALLOW clone right now (a `$GIT_DIR/shallow` file exists). `git` resolves the git
228
- * dir itself (correct in worktrees / bare / separate git-dirs), so this makes no `.git`-is-a-dir assumption.
229
- * Returned as {@link GitGraph.shallow} and diffed by the R6b fast path's gate — an un-shallow (or re-shallow)
230
- * while the graph was closed leaves every branch tip put yet changes what history exists below the window.
231
- * Errors ignored → treated as NOT shallow: a git too old for `--is-shallow-repository` degrades to no-op
232
- * detection (consistent on both the seed and the current side, so the gate can't over-fire), and a transient
233
- * read error biases toward `false`, which — when the seed was shallow — only forces a SAFE full-walk fallback.
234
- */
235
- async getShallowState(repoPath, cancellation) {
236
- const result = await this.git.run({ cwd: repoPath, configs: gitConfigsLog, cancellation: cancellation, errors: 'ignore' }, 'rev-parse', '--is-shallow-repository');
237
- return result.stdout.trim() === 'true';
238
- }
239
- /** Whether `oldSha` is an ancestor of `newSha` (i.e. the ref moved fast-forward). */
240
- async isFastForward(repoPath, oldSha, newSha, cancellation) {
241
- const result = await this.git.run({ cwd: repoPath, cancellation: cancellation, errors: 'ignore' }, 'merge-base', '--is-ancestor', oldSha, newSha);
242
- return result.exitCode === 0;
243
- }
244
- async openGraphSession(repoPath, options, cancellation) {
245
- // The session computes the walk shape (`ordering|onlyFollowFirstParent`) the SAME way `getGraph`
246
- // derives it, so it can gate its incremental seed on a shape change (which reshapes every row's
247
- // parents/order) exactly as the host's former `_graphBuildShape` gate did.
248
- const getWalkShape = () => {
249
- const cfg = this.context.config;
250
- return {
251
- ordering: cfg?.graph?.commitOrdering ?? cfg?.commits.ordering ?? 'date',
252
- onlyFollowFirstParent: cfg?.graph?.onlyFollowFirstParent ?? false,
253
- };
254
- };
255
- const session = new GraphSession(this, repoPath, options?.rowProcessor, getWalkShape);
256
- await session.initialize(options, cancellation);
257
- return session;
258
- }
259
- async getGraph(repoPath, rev, options, cancellation) {
260
- const scope = getScopedLogger();
261
- const cfg = this.context.config;
262
- const defaultLimit = options?.limit ?? 5000;
263
- const ordering = cfg?.graph?.commitOrdering ?? cfg?.commits.ordering ?? 'date';
264
- const onlyFollowFirstParent = cfg?.graph?.onlyFollowFirstParent ?? false;
265
- const deferStats = options?.include?.stats;
266
- // `let`: cleared before the fallback walk when the fast path bailed for a parent-rewriting reason
267
- // (unshallow / replace-ref change) — those alter boundary commits' true diffs, so per-sha stats
268
- // carried from the prior generation may be stale and must recompute.
269
- let rowsStatsSeed = options?.rowsStatsSeed;
270
- const parser = getGraphParser(options?.include?.stats && !deferStats);
271
- const shaParser = getShaLogParser();
272
- const statsParser = getShaAndStatsLogParser();
273
- const stashPromise = this.provider.stash?.getStash(repoPath, { includeFiles: false }, cancellation);
274
- // Pre-BUILD the first walk's stream as soon as the stash list (the spawn's only argv/stdin
275
- // input) resolves. NOTE: `git.stream` is a lazy async generator — the process does NOT spawn
276
- // until the walk loop's first iteration, so this achieves argv/stdin PREPARATION overlap only,
277
- // not the git-startup overlap the original design intended (make the spawn eager — priming the
278
- // generator — or delete this seam; tracked as a follow-up). Consumed exactly once by the first
279
- // `getCommitsForGraphCore` call; never iterated = never spawned, so an unconsumed pre-build
280
- // (fast-path win, error fallback) leaks nothing.
281
- const prespawnAborter = new AbortController();
282
- const onPrespawnCancel = () => prespawnAborter.abort();
283
- cancellation?.addEventListener('abort', onPrespawnCancel, { once: true });
284
- // An ALREADY-aborted signal never fires listeners added after the fact — propagate it by hand.
285
- if (cancellation?.aborted) {
286
- onPrespawnCancel();
287
- }
288
- let prespawn = (async () => {
289
- try {
290
- const gitStash = await stashPromise;
291
- const { stdin } = convertStashesToStdin(gitStash?.stashes);
292
- const args = ['log', ...parser.arguments, `--${ordering}-order`, '--all'];
293
- if (stdin) {
294
- args.push('--stdin');
295
- }
296
- if (onlyFollowFirstParent) {
297
- args.push('--first-parent');
298
- }
299
- const stream = this.git.stream({
300
- cwd: repoPath,
301
- configs: gitConfigsLog,
302
- cancellation: prespawnAborter.signal,
303
- stdin: stdin,
304
- // See the walk spawn below for why GIT_FLUSH=0.
305
- env: { GIT_FLUSH: '0' },
306
- }, ...args, '--');
307
- return { stream: stream };
308
- }
309
- catch {
310
- return undefined;
311
- }
312
- })();
313
- // Current ref tips (peeled), captured ONCE at walk entry, overlapped with the rest of the prelude (a
314
- // single `for-each-ref`, off the rows-walk critical path). Attached to the returned graph as `refTips`
315
- // so the host can seed the NEXT rebuild's tip diff; the R6b fast path also reuses this same map for its
316
- // own tip-diff gate (so there's exactly one `for-each-ref` per call whether it goes fast or full).
317
- // ALWAYS forced, including on a cold build. It's tempting to skip the force when there's no seed to
318
- // diff against — the cold build only records these tips for the NEXT build — but the tips it records
319
- // must describe the same repo state the rows walk observed, and the rows walk always reads live git.
320
- // A cached (stale) enumeration breaks that pairing in a way a later build can't detect: if a ref moves
321
- // A→B before the cold load and is then reverted B→A, the seed says A, the next forced read says A, the
322
- // tip diff sees no change and takes the fast path — while the cached rows were built at B and still
323
- // carry the discarded commit. Staleness here is not "more work, never wrong"; only the seed side can
324
- // be stale, so a move-and-revert admits a genuinely wrong fast path.
325
- const refTipsPromise = this.getCurrentRefTips(repoPath, cancellation);
326
- // Shallow state (peeled off the same prelude, off the rows-walk critical path) — stamped on the returned
327
- // graph so the NEXT rebuild's seed can gate on an un-shallow/re-shallow, and reused by the R6b fast path's
328
- // own shallow gate (one `rev-parse` per call whether it goes fast or full).
329
- const shallowPromise = this.getShallowState(repoPath, cancellation);
330
- const [shaResult, stashResult, branchesResult, remotesResult, currentUserResult, worktreesResult, defaultBranchResult,] = await Promise.allSettled([
331
- !isUncommitted(rev, true)
332
- ? this.git.run({ cwd: repoPath, configs: gitConfigsLog }, 'log', ...shaParser.arguments, '-n1', rev ?? 'HEAD', '--')
333
- : undefined,
334
- stashPromise,
335
- this.provider.branches.getBranches(repoPath, undefined, cancellation),
336
- this.provider.remotes.getRemotes(repoPath, undefined, cancellation),
337
- this.provider.config.getCurrentUser(repoPath),
338
- this.provider.worktrees
339
- ?.getWorktrees(repoPath, cancellation)
340
- .then((w) => [
341
- w,
342
- groupWorktreesByBranch(w, { includeDefault: true }),
343
- ]),
344
- // Local-only: never contact the remote on the graph's hot fetch path. `isDefault` is additive,
345
- // so it's simply absent until a background networked caller resolves origin/HEAD.
346
- this.provider.branches.getDefaultBranchName(repoPath, undefined, { local: true }, cancellation),
347
- ]);
348
- const branches = getSettledValue(branchesResult)?.values;
349
- const branchMap = branches != null ? new Map(branches.map(r => [r.name, r])) : new Map();
350
- const headBranch = branches?.find(b => b.current);
351
- const headRefUpstreamName = headBranch?.upstream?.name;
352
- const [worktrees, worktreesByBranch] = getSettledValue(worktreesResult) ?? [[], new Map()];
353
- // The repo's default branch (e.g. `origin/main`) reduced to its local branch name (`main`) so it
354
- // can be matched against each local head's `tip` to flag the default-branch head additively.
355
- const defaultBranchName = getSettledValue(defaultBranchResult);
356
- const defaultLocalName = defaultBranchName != null ? getBranchNameWithoutRemote(defaultBranchName) : undefined;
357
- let branchIdOfMainWorktree;
358
- let mainWorktree;
359
- if (worktreesByBranch != null) {
360
- const defaultEntry = find(worktreesByBranch, ([, wt]) => wt.isDefault);
361
- if (defaultEntry != null) {
362
- [branchIdOfMainWorktree, mainWorktree] = defaultEntry;
363
- // Remove the main/default worktree so the branch-row decoration shows `+checkedout`
364
- // (not `+worktree`) for the main checkout. `mainWorktree` is retained below purely so
365
- // Undo Commit can still reach the main worktree's HEAD from a secondary worktree's graph.
366
- worktreesByBranch.delete(branchIdOfMainWorktree);
367
- }
368
- }
369
- const currentUser = getSettledValue(currentUserResult);
370
- const remotes = getSettledValue(remotesResult);
371
- const remoteMap = remotes != null ? new Map(remotes.map(r => [r.name, r])) : new Map();
372
- // Decoration side inputs, fingerprinted for the NEXT rebuild's metadata gate (and compared against
373
- // the seed's by this call's fast path). Computed from the prelude's fresh queries — the same values
374
- // row construction below embeds into row decorations.
375
- const decorationFingerprint = computeDecorationFingerprint(repoPath, defaultBranchName, defaultLocalName, headRefUpstreamName, branches, remotes, worktrees, currentUser);
376
- const shas = getSettledValue(shaResult)?.stdout;
377
- const selectSha = shas != null ? first(shaParser.parse(shas)) : undefined;
378
- // Resolved off the critical path (started in the prelude). Same map for the full walk's `refTips`, the
379
- // fast path's tip-diff gate, and the fast path's `refTips`. Never rejects (errors ignored → empty map).
380
- const refTips = await refTipsPromise;
381
- // Same value for the full walk's `shallow`, the fast path's shallow gate, and the fast path's `shallow`.
382
- const shallow = await shallowPromise;
383
- const downstreamMap = new Map();
384
- // There *HAS* to be a better way to get git log to return stashes, but this is the best we've found
385
- const gitStash = getSettledValue(stashResult);
386
- const { stdin, remappedIds } = convertStashesToStdin(gitStash?.stashes);
387
- const avatars = new Map();
388
- const ids = new Set();
389
- const reachableFromHEAD = new Set();
390
- // SHAs on the first-parent chain from HEAD up to (excluding) the first merge commit — the only
391
- // commits a plain (non-`--rebase-merges`) interactive rebase can safely rewrite. `headSha` seeds
392
- // the chain; `rewriteableNextSha` tracks the next sha expected on it. Outer scope so they persist
393
- // across `more()` pagination, like `reachableFromHEAD`.
394
- const rewriteableFromHEAD = new Set();
395
- let headSha;
396
- let rewriteableNextSha;
397
- // Undo Commit is offered only on a worktree HEAD that is a LEAF (nothing is built on it) —
398
- // undoing a commit other work is stacked on is unsafe. The leaf check is only needed for the
399
- // undo-eligible tips (the active HEAD + each worktree's HEAD), so track just those shas rather
400
- // than every commit, keeping this O(#worktrees) instead of O(#commits).
401
- const undoableTipShas = new Set();
402
- if (headBranch?.sha != null) {
403
- undoableTipShas.add(headBranch.sha);
404
- }
405
- for (const wt of worktrees) {
406
- if (wt.sha != null) {
407
- undoableTipShas.add(wt.sha);
408
- }
409
- }
410
- // The subset of `undoableTipShas` that turn out to have a child (are an ancestor of another
411
- // commit) — i.e. NOT leaves. Built newest-first during the walk, so by the time a tip's row is
412
- // processed every newer commit (its only possible children) has been seen. Undo is withheld for
413
- // shas recorded here. Stash rows are excluded (a stash sitting on a tip must not block undoing it).
414
- const tipShasWithChildren = new Set();
415
- // SHAs reachable from HEAD's tracking upstream tip. Combined with `reachableFromHEAD`,
416
- // this lets us mark commits as unpushed (reachable from HEAD but not from HEAD's upstream).
417
- const reachableFromHeadUpstream = new Set();
418
- // Map<sha, Map<refKey, ref>> — inner map deduplicates refs during propagation
419
- const reachableRefs = new Map();
420
- // Stable, append-only reachability table built as we walk — the PRIMARY representation shipped to
421
- // consumers. Lives in the outer scope so it accumulates across `more()` pagination; indices
422
- // already assigned never change, since git reachability only propagates to older (later-walked)
423
- // commits. Per-row ref arrays are NOT retained — each row keeps only its set index
424
- // (`contexts.reachabilityIndex`), and the working `reachableRefs` entry is dropped once emitted.
425
- // The encoder lives next to its decoder in `reachability.utils` so the wire format can't drift.
426
- // A caller-supplied seed CONTINUES the prior generation's table (same id, stable indices) so
427
- // rows retained across a rebuild keep valid `reachabilityIndex` values.
428
- const reachabilityBuilder = createReachabilityTableBuilder(options?.reachabilitySeed);
429
- // Set-index cache keyed by the working ref-map INSTANCE: the propagation below transfers a
430
- // row's map wholesale to its (first) parent, so an entire chain interns the same object —
431
- // one real intern per chain instead of one per row. Maps only ever GROW (ref seeding adds
432
- // entries), so an unchanged size proves the cached index is still exact.
433
- const internCache = new WeakMap();
434
- function finalizeRowReachability(row, sha, refs) {
435
- let setIndex;
436
- const cached = refs != null ? internCache.get(refs) : undefined;
437
- if (cached != null && cached.size === refs.size) {
438
- setIndex = cached.index;
439
- }
440
- else {
441
- setIndex = reachabilityBuilder.intern(refs?.values());
442
- if (refs != null) {
443
- internCache.set(refs, { size: refs.size, index: setIndex });
444
- }
445
- }
446
- if (setIndex != null) {
447
- (row.contexts ??= {}).reachabilityIndex = setIndex;
448
- }
449
- // Drop the transient per-row arrays so emitted rows don't retain reachability, and release the
450
- // working entry — once a commit is emitted its children are all walked and its parents already
451
- // seeded, so nothing reads `reachableRefs.get(sha)` again (orderings keep parents after children).
452
- row.reachability = undefined;
453
- reachableRefs.delete(sha);
454
- }
455
- const rowStats = new Map();
456
- let pendingRowsStatsCount = 0;
457
- let iterations = 0;
458
- let total = 0;
459
- // Hoisted so the ordered walk AND the R6b incremental fast path share one context. It holds the
460
- // outer accumulator sets BY REFERENCE (they mutate in place across `more()` pagination / replay), so
461
- // building it once is equivalent to the prior per-call construction.
462
- const rowProcessor = options?.rowProcessor;
463
- const graphCtx = rowProcessor != null
464
- ? {
465
- repoPath: repoPath,
466
- useAvatars: cfg?.graph?.avatars ?? true,
467
- branches: branchMap,
468
- remotes: remoteMap,
469
- worktreesByBranch: worktreesByBranch,
470
- branchIdOfMainWorktree: branchIdOfMainWorktree,
471
- stashes: gitStash?.stashes,
472
- reachableFromHEAD: reachableFromHEAD,
473
- rewriteableFromHEAD: rewriteableFromHEAD,
474
- tipShasWithChildren: tipShasWithChildren,
475
- // `undefined` when HEAD has no upstream, so the processor flags nothing as
476
- // unpublished; otherwise the live set (mutated during the walk, read by ref).
477
- reachableFromHeadUpstream: headRefUpstreamName != null ? reachableFromHeadUpstream : undefined,
478
- avatars: avatars,
479
- }
480
- : undefined;
481
- // Parses one commit record into a row (ref badges, parents, stash vs commit) but performs NO
482
- // reachability/HEAD/downstream accumulation — that half lives in `accumulateRowState`, so the ordered
483
- // walk and the fast path (which replays accumulation over reused rows, deriving ref lists from their
484
- // own decoration) share one propagation implementation. Returns `undefined` when the record dedups to
485
- // an already-seen remapped-stash sha. Faithful extraction of the walk's former inline body — must stay
486
- // byte-identical to it (the equivalence harness pins this).
487
- function buildRowFromCommit(commit) {
488
- total++;
489
- let shaOrRemapped = remappedIds.get(commit.sha);
490
- if (shaOrRemapped && ids.has(shaOrRemapped))
491
- return undefined;
492
- shaOrRemapped ??= commit.sha;
493
- ids.add(shaOrRemapped);
494
- const refHeads = [];
495
- const refRemoteHeads = [];
496
- const refTags = [];
497
- // `head` is per-tip (drives `isCurrentHead` on the branch it decorates); `sawHead` sticks once ANY
498
- // tip is HEAD so `accumulateRowState` seeds `reachableFromHEAD` even when HEAD isn't the last tip.
499
- let head = false;
500
- let sawHead = false;
501
- if (commit.tips) {
502
- for (let tip of commit.tips.split(', ')) {
503
- head = false;
504
- if (tip === 'refs/stash')
505
- continue;
506
- if (tip.startsWith('tag: ')) {
507
- const tagName = tip.substring(5);
508
- refTags.push({
509
- id: getTagId(repoPath, tagName),
510
- name: tagName,
511
- // Not currently used, so don't bother looking it up
512
- annotated: true,
513
- });
514
- continue;
515
- }
516
- if (tip.startsWith('HEAD')) {
517
- head = true;
518
- sawHead = true;
519
- if (tip !== 'HEAD') {
520
- tip = tip.substring(8);
521
- }
522
- }
523
- const remoteName = getRemoteNameFromBranchName(tip);
524
- if (remoteName) {
525
- const remote = remoteMap.get(remoteName);
526
- if (remote != null) {
527
- const branchName = getBranchNameWithoutRemote(tip);
528
- if (branchName === 'HEAD')
529
- continue;
530
- refRemoteHeads.push({
531
- id: getBranchId(repoPath, true, tip),
532
- name: branchName,
533
- owner: remote.name,
534
- url: remote.url,
535
- current: tip === headRefUpstreamName,
536
- // `defaultLocalName!` is non-null here because `tip === defaultBranchName` short-circuits when `defaultBranchName` is null.
537
- isDefault: tip === defaultBranchName && !branchMap.has(defaultLocalName),
538
- hostingServiceType: remote.provider?.gkProviderId,
539
- // `branchMap` is keyed by full name, so the remote ref resolves here — the same
540
- // lookup the host does today to bake `+starred` into the context string.
541
- starred: branchMap.get(tip)?.starred || undefined,
542
- });
543
- continue;
544
- }
545
- }
546
- const branch = branchMap.get(tip);
547
- const branchId = branch?.id ?? getBranchId(repoPath, false, tip);
548
- // `worktreesByBranch` has the main/default worktree removed, so recover it here.
549
- const worktree = worktreesByBranch?.get(branchId) ??
550
- (branchId === branchIdOfMainWorktree ? mainWorktree : undefined);
551
- const worktreeRef = worktree != null
552
- ? {
553
- id: getWorktreeId(repoPath, worktree.name),
554
- path: worktree.path,
555
- isDefault: worktree.isDefault === true,
556
- }
557
- : undefined;
558
- refHeads.push({
559
- id: branchId,
560
- name: tip,
561
- isCurrentHead: head,
562
- upstream: branch?.upstream != null
563
- ? {
564
- name: branch.upstream.name,
565
- id: getBranchId(repoPath, true, branch.upstream.name),
566
- missing: branch.upstream.missing,
567
- state: {
568
- ahead: branch.upstream.state.ahead,
569
- behind: branch.upstream.state.behind,
570
- },
571
- }
572
- : undefined,
573
- worktree: worktreeRef,
574
- isDefault: defaultLocalName != null && tip === defaultLocalName,
575
- starred: branch?.starred || undefined,
576
- });
577
- }
578
- }
579
- const parents = commit.parents ? commit.parents.split(' ') : [];
580
- const stash = gitStash?.stashes.get(shaOrRemapped);
581
- let row;
582
- if (stash != null) {
583
- row = {
584
- sha: shaOrRemapped,
585
- // Always only return the first parent for stashes, as it is a Git implementation for the index and untracked files
586
- parents: parents.slice(0, 1),
587
- author: currentUser?.name ?? commit.author,
588
- email: commit.authorEmail,
589
- date: Number(ordering === 'author-date' ? commit.authorDate : commit.committerDate) * 1000,
590
- commitDate: Number(commit.committerDate) * 1000,
591
- message: (stash.message ?? commit.message).trim(),
592
- kind: 'stash',
593
- stashNumber: stash.stashNumber,
594
- heads: refHeads.length ? refHeads : undefined,
595
- remotes: refRemoteHeads.length ? refRemoteHeads : undefined,
596
- tags: refTags.length ? refTags : undefined,
597
- isCurrentUser: true,
598
- };
599
- // Don't seed `rowStats` from `stash.stats` here: the graph's stash list is fetched with
600
- // `includeFiles: false`, so the commit model SYNTHESIZES a zero-stats object from its empty
601
- // fileset — seeding it marks the stash "covered" and permanently blanks it. The deferred
602
- // stats pass owns stash stats (first-parent diff, keyed by stash sha).
603
- }
604
- else {
605
- const isCurrentUser = isUserMatch(currentUser, commit.author, commit.authorEmail);
606
- row = {
607
- sha: shaOrRemapped,
608
- parents: onlyFollowFirstParent ? parents.slice(0, 1) : parents,
609
- author: commit.author,
610
- email: commit.authorEmail,
611
- date: Number(ordering === 'author-date' ? commit.authorDate : commit.committerDate) * 1000,
612
- commitDate: Number(commit.committerDate) * 1000,
613
- message: commit.message.trim(),
614
- kind: parents.length > 1 ? 'merge' : 'commit',
615
- heads: refHeads.length ? refHeads : undefined,
616
- remotes: refRemoteHeads.length ? refRemoteHeads : undefined,
617
- tags: refTags.length ? refTags : undefined,
618
- isCurrentUser: isCurrentUser || undefined,
619
- };
620
- if (commit.stats != null) {
621
- rowStats.set(shaOrRemapped, commit.stats);
622
- }
623
- }
624
- return {
625
- row: row,
626
- refHeads: refHeads,
627
- refRemoteHeads: refRemoteHeads,
628
- refTags: refTags,
629
- head: sawHead,
630
- parents: parents,
631
- };
632
- }
633
- // The propagation half of the walk, factored out so the fast path can replay it in memory over reused
634
- // rows (passing their own `heads`/`remotes`/`tags` as the ref lists and their full `parents`). Mutates
635
- // the shared reachability/HEAD/downstream accumulators and returns the row's post-propagation
636
- // reachable-ref map (for interning + flag derivation). `parents` is the FULL parent list (the walk
637
- // always propagates through every parent, even when the emitted row stores a sliced set). Faithful
638
- // extraction of the walk's former inline body — must stay byte-identical to it.
639
- function accumulateRowState(sha, parents, refHeads, refRemoteHeads, refTags, head, isStash) {
640
- if (head) {
641
- reachableFromHEAD.add(sha);
642
- headSha ??= sha;
643
- }
644
- if (reachableFromHEAD.has(sha)) {
645
- for (const parent of parents) {
646
- reachableFromHEAD.add(parent);
647
- }
648
- }
649
- // First-parent rewriteable chain from HEAD (see the field's declaration for the full rationale).
650
- if (sha === headSha || sha === rewriteableNextSha) {
651
- if (parents.length === 1) {
652
- rewriteableFromHEAD.add(sha);
653
- rewriteableNextSha = parents[0];
654
- }
655
- else {
656
- rewriteableNextSha = undefined;
657
- }
658
- }
659
- // A remote head with `current` set IS HEAD's tracking upstream tip (see `buildRowFromCommit`).
660
- if (refRemoteHeads.some(r => r.current)) {
661
- reachableFromHeadUpstream.add(sha);
662
- }
663
- if (reachableFromHeadUpstream.has(sha)) {
664
- for (const parent of parents) {
665
- reachableFromHeadUpstream.add(parent);
666
- }
667
- }
668
- // Seed reachability from all ref types on this commit.
669
- if (refHeads.length > 0 || refRemoteHeads.length > 0 || refTags.length > 0) {
670
- let refs = reachableRefs.get(sha);
671
- if (refs == null) {
672
- refs = new Map();
673
- reachableRefs.set(sha, refs);
674
- }
675
- for (const h of refHeads) {
676
- refs.set(`b:${h.name}`, {
677
- refType: 'branch',
678
- name: h.name,
679
- remote: false,
680
- current: h.isCurrentHead,
681
- });
682
- }
683
- for (const r of refRemoteHeads) {
684
- const name = `${r.owner}/${r.name}`;
685
- refs.set(`r:${name}`, { refType: 'branch', name: name, remote: true });
686
- }
687
- for (const t of refTags) {
688
- refs.set(`t:${t.name}`, { refType: 'tag', name: t.name });
689
- }
690
- }
691
- // Propagate reachability to parents (ownership-transfer fast path; see the `reachableRefs`
692
- // declaration + `finalizeRowReachability` for why the first childless parent may alias the map).
693
- const currentRefs = reachableRefs.get(sha);
694
- if (currentRefs != null && currentRefs.size > 0) {
695
- let transferred = false;
696
- for (const parent of parents) {
697
- const parentRefs = reachableRefs.get(parent);
698
- if (parentRefs == null) {
699
- if (transferred) {
700
- reachableRefs.set(parent, new Map(currentRefs));
701
- }
702
- else {
703
- transferred = true;
704
- reachableRefs.set(parent, currentRefs);
705
- }
706
- continue;
707
- }
708
- for (const [key, ref] of currentRefs) {
709
- if (!parentRefs.has(key)) {
710
- parentRefs.set(key, ref);
711
- }
712
- }
713
- }
714
- }
715
- // Mark any undo-eligible tip that THIS non-stash commit builds on as non-leaf (stash rows excluded).
716
- if (!isStash) {
717
- for (const parent of parents) {
718
- if (undoableTipShas.has(parent)) {
719
- tipShasWithChildren.add(parent);
720
- }
721
- }
722
- }
723
- // Downstreams: each branch tip → its upstream name.
724
- for (const h of refHeads) {
725
- if (h.upstream?.name != null) {
726
- let downstreams = downstreamMap.get(h.upstream.name);
727
- if (downstreams == null) {
728
- downstreams = [];
729
- downstreamMap.set(h.upstream.name, downstreams);
730
- }
731
- downstreams.push(h.name);
732
- }
733
- }
734
- return reachableRefs.get(sha);
735
- }
736
- // Builds the deferred `--shortstat` query for the given rows (only shas the seed doesn't cover),
737
- // shared by the ordered walk and the fast path. Increments `pendingRowsStatsCount` and resolves it
738
- // when the background query completes; returns `undefined` when stats aren't requested.
739
- const buildRowsStatsDeferred = (rows) => {
740
- if (!deferStats)
741
- return undefined;
742
- pendingRowsStatsCount++;
743
- // oxlint-disable-next-line no-async-promise-executor
744
- const promise = new Promise(async (resolve) => {
745
- try {
746
- // Stats are immutable per sha — only query shas the seed doesn't already cover.
747
- let missingStdin = '';
748
- let missingStashStdin = '';
749
- for (const row of rows) {
750
- if (rowStats.has(row.sha))
751
- continue;
752
- const seeded = rowsStatsSeed?.get(row.sha);
753
- if (seeded != null) {
754
- rowStats.set(row.sha, seeded);
755
- continue;
756
- }
757
- if (row.kind === 'stash') {
758
- missingStashStdin += `${row.sha}\n`;
759
- }
760
- else {
761
- missingStdin += `${row.sha}\n`;
762
- }
763
- }
764
- // Fully seeded — nothing new to compute, so no git process at all.
765
- if (!missingStdin && !missingStashStdin)
766
- return;
767
- // A stash is a merge commit, so its own shortstat record is empty. Stashes get their own
768
- // query diffed against the first parent (`-m --first-parent` — what `git stash show`
769
- // reports), keyed directly by stash sha: no parent remapping, so none of the old
770
- // `--no-walk` time-order races that could let the empty record win and blank the stash.
771
- const [statsResult, stashStatsResult] = await Promise.allSettled([
772
- missingStdin
773
- ? this.git.run({
774
- cwd: repoPath,
775
- configs: gitConfigsLog,
776
- stdin: missingStdin,
777
- priority: 'background',
778
- }, 'log', '--no-walk', '--stdin', ...statsParser.arguments, '--')
779
- : undefined,
780
- missingStashStdin
781
- ? this.git.run({
782
- cwd: repoPath,
783
- configs: gitConfigsLog,
784
- stdin: missingStashStdin,
785
- priority: 'background',
786
- }, 'log', '--no-walk', '--stdin', '-m', '--first-parent', ...statsParser.arguments, '--')
787
- : undefined,
788
- ]);
789
- for (const result of [getSettledValue(statsResult), getSettledValue(stashStatsResult)]) {
790
- if (!result?.stdout)
791
- continue;
792
- for (const stat of statsParser.parse(result.stdout)) {
793
- // Don't overwrite stats already populated for this sha
794
- if (rowStats.has(stat.sha))
795
- continue;
796
- rowStats.set(stat.sha, stat.stats);
797
- }
798
- }
799
- }
800
- finally {
801
- pendingRowsStatsCount--;
802
- resolve();
803
- }
804
- });
805
- return { isLoaded: () => pendingRowsStatsCount === 0, promise: promise };
806
- };
807
- const args = ['log', ...parser.arguments, `--${ordering}-order`, '--all'];
808
- if (stdin) {
809
- args.push('--stdin');
810
- }
811
- if (onlyFollowFirstParent) {
812
- args.push('--first-parent');
813
- }
814
- async function getCommitsForGraphCore(limit, sha, cursor, cancellation) {
815
- try {
816
- const env_1 = { stack: [], error: void 0, hasError: false };
817
- try {
818
- iterations++;
819
- // Consume the pre-spawned first walk when available (argv identical by construction:
820
- // no cursor on the first call); paging/retry calls spawn normally. The pre-spawn's
821
- // aborter doubles as this call's so the limit-stop kills the right process.
822
- const prespawned = cursor == null && prespawn != null ? await prespawn : undefined;
823
- prespawn = undefined;
824
- const aborter = prespawned != null ? prespawnAborter : new AbortController();
825
- const onAbort = () => {
826
- aborter.abort();
827
- };
828
- cancellation?.addEventListener('abort', onAbort, { once: true });
829
- // An ALREADY-aborted signal (e.g. `toAbortSignal` of a cancelled token) never fires listeners
830
- // added after the fact — without this the walk would run to completion unabortably.
831
- if (cancellation?.aborted) {
832
- onAbort();
833
- }
834
- const _disposable = __addDisposableResource(env_1, createDisposable(() => cancellation?.removeEventListener('abort', onAbort)), false);
835
- const stream = prespawned?.stream ??
836
- this.git.stream({
837
- cwd: repoPath,
838
- configs: gitConfigsLog,
839
- cancellation: aborter.signal,
840
- stdin: stdin,
841
- // Git flushes stdout per record to a pipe, producing thousands of tiny chunks the
842
- // node side must individually await. Full stdio buffering delivers the same bytes
843
- // in far fewer, larger chunks — right for this bulk walk (an incremental consumer
844
- // wanting per-record latency should NOT set this).
845
- env: { GIT_FLUSH: '0' },
846
- }, ...args, cursor?.skip ? `--skip=${cursor.skip}` : undefined, '--');
847
- const _streamDisposer = __addDisposableResource(env_1, createDisposable(() => void stream.return?.(undefined)), false);
848
- const rows = [];
849
- let count = 0;
850
- let found = false;
851
- let hasMore = false;
852
- // Batched parse when available: one awaited yield per stream chunk instead of two
853
- // promise hops per record — the walk's async-iterator overhead collapses. The
854
- // with-stats parser (unused here — stats are always deferred) has no batched mode,
855
- // so wrap its per-record stream into singleton batches to keep one loop shape.
856
- const batches = parser.parseAsyncBatched?.(stream) ??
857
- (async function* (it) {
858
- for await (const commit of it) {
859
- yield [commit];
860
- }
861
- })(parser.parseAsync(stream));
862
- outer: for await (const batch of batches) {
863
- for (const commit of batch) {
864
- // Stopping logic (check AFTER processing the commit):
865
- // - SHA + limit > 0: Find SHA, ensure at least `limit` commits loaded
866
- // - SHA + limit = 0: Find SHA, stop immediately
867
- // - No SHA + limit > 0: Load exactly `limit` commits
868
- // - No SHA + limit = 0: Load everything remaining
869
- // - SHA + limit > 0 + still unfound past 10× limit: defensive cap so an unreachable
870
- // SHA (e.g. a stale merge-base the webview hasn't yet seen invalidated) can't
871
- // walk the entire history. `hasMore=true` lets callers retry; the graph-wrapper
872
- // side deduplicates re-requests so the cap doesn't loop.
873
- if ((limit && count >= limit && (!sha || found || count >= limit * 10)) ||
874
- (!limit && sha && found)) {
875
- hasMore = true;
876
- aborter.abort();
877
- break outer;
878
- }
879
- if (sha && !found && commit.sha === sha) {
880
- found = true;
881
- }
882
- count++;
883
- if (ids.has(commit.sha))
884
- continue;
885
- const built = buildRowFromCommit(commit);
886
- if (built == null)
887
- continue; // remapped-stash dedup
888
- const { row, refHeads, refRemoteHeads, refTags, head, parents } = built;
889
- const refs = accumulateRowState(row.sha, parents, refHeads, refRemoteHeads, refTags, head, row.kind === 'stash');
890
- // Transient: the row processor's `+unique` decision reads this; stripped by finalize.
891
- // Unsorted (the consumer re-sorts after decoding) — order doesn't affect interning.
892
- row.reachability = refs?.size ? { partial: true, refs: [...refs.values()] } : undefined;
893
- rowProcessor?.processRow(row, graphCtx);
894
- finalizeRowReachability(row, row.sha, refs);
895
- rows.push(row);
896
- }
897
- }
898
- const startingCursor = cursor?.sha;
899
- const lastSha = last(ids);
900
- cursor = lastSha != null ? { sha: lastSha, skip: total - iterations } : undefined;
901
- const rowsStatsDeferred = buildRowsStatsDeferred(rows);
902
- return {
903
- repoPath: repoPath,
904
- avatars: avatars,
905
- ids: ids,
906
- includes: options?.include,
907
- branches: branchMap,
908
- remotes: remoteMap,
909
- downstreams: downstreamMap,
910
- stashes: gitStash?.stashes,
911
- worktrees: worktrees,
912
- worktreesByBranch: worktreesByBranch,
913
- reachableFromHEAD: reachableFromHEAD,
914
- rewriteableFromHEAD: rewriteableFromHEAD,
915
- reachability: reachabilityBuilder.build(),
916
- refTips: refTips,
917
- decorationFingerprint: decorationFingerprint,
918
- shallow: shallow,
919
- rows: rows,
920
- id: sha ?? rev,
921
- rowsStats: rowStats,
922
- rowsStatsDeferred: rowsStatsDeferred,
923
- paging: {
924
- limit: limit === 0 ? count : limit,
925
- startingCursor: startingCursor,
926
- hasMore: hasMore,
927
- },
928
- more: async (limit, sha, cancellation) => getCommitsForGraphCore.call(this, limit, sha, cursor, cancellation),
929
- };
930
- }
931
- catch (e_1) {
932
- env_1.error = e_1;
933
- env_1.hasError = true;
934
- }
935
- finally {
936
- __disposeResources(env_1);
937
- }
938
- }
939
- catch (ex) {
940
- scope?.error(ex);
941
- debugger;
942
- throw ex;
943
- }
944
- }
945
- // R6b incremental head-walk fast path: enumerate ONLY the new commits, stitch the seed's cached tail,
946
- // and re-derive flags/reachability in memory — instead of re-walking every loaded row. Returns
947
- // `undefined` (→ full walk below) on any structural change. Reports the outcome via `onIncrementalResult`.
948
- let incrementalFallbackReason;
949
- const tryIncrementalGraph = async (seed) => {
950
- const onResult = options?.onIncrementalResult;
951
- // Reports a fallback outcome; callers then `return undefined` to take the full walk.
952
- const fallback = (reason) => {
953
- incrementalFallbackReason = reason;
954
- onResult?.({ path: 'fallback', reason: reason });
955
- };
956
- // Cheap gates (no git).
957
- if (rowProcessor == null || graphCtx == null) {
958
- fallback('no-row-processor');
959
- return undefined;
960
- }
961
- // The convergence + date-boundary reasoning is only sound for `date` order.
962
- if (ordering !== 'date' || seed.ordering !== 'date') {
963
- fallback('ordering-not-date');
964
- return undefined;
965
- }
966
- const seedShas = new Set(seed.rows.map(r => r.sha));
967
- // A `rev` narrows the walk's find/stop semantics. The host's same-repo rebuild passes a rebuild
968
- // ANCHOR sha (the loaded window's bottom) to pin that boundary — the anchor is by construction inside
969
- // the seed, and the stitch + trim below preserve the seed tail, so the fast path can honor it (it
970
- // grows the window down to the anchor; see the window/limit shape below). A rev NOT in the seed is a
971
- // real out-of-window target (deep link, reveal) the fast path can't reach → full walk.
972
- if (rev != null && !seedShas.has(rev)) {
973
- fallback('rev-outside-seed');
974
- return undefined;
975
- }
976
- // First-parent (now or in the seed) means the emitted rows carry sliced parents the in-memory
977
- // re-derivation can't expand back to the full set the walk propagates through.
978
- if (onlyFollowFirstParent || seed.onlyFollowFirstParent) {
979
- fallback('first-parent');
980
- return undefined;
981
- }
982
- // The ACTUAL current HEAD sha (to seed reachable-from-HEAD and detect a checkout). Distinct from
983
- // `selectSha`, which resolves the `rev` ANCHOR — not HEAD — when a rev is passed: with no rev
984
- // `selectSha` already IS the resolved HEAD, otherwise take the current branch tip (also populated for
985
- // a detached HEAD). The graph `id` still mirrors the full walk's `selectSha ?? rev` (below).
986
- const currentHeadSha = rev == null ? selectSha : headBranch?.sha;
987
- // Reuse the prelude's tips (same repo state — nothing mutates between the prelude and here).
988
- const currentTips = refTips;
989
- // Shallow-state gate: an un-shallow (or re-shallow) while the graph was closed leaves every branch
990
- // tip put — so it passes the tip diff below — yet changes what history exists BELOW the loaded window
991
- // (a stale-false `hasMore` would hide the newly deepened commits). Any change → full walk. Checked
992
- // against the prelude's already-captured `shallow` (no extra git).
993
- if ((seed.shallow ?? false) !== shallow) {
994
- fallback('shallow-changed');
995
- return undefined;
996
- }
997
- // Replace-ref gate: `git replace` (and grafts) rewrite ancestry PRESENTATION globally, so any
998
- // change to the replace-ref set (`refs/replace/*`) invalidates the cached rows' parent links even when
999
- // no branch tip moved. An UNCHANGED set (including non-empty) stays fast-path-eligible — the seed rows
1000
- // were built under the same replacement view. Replace refs aren't `isMoveableGraphRef`s (no badge), so
1001
- // the tip diff below skips them; diff them here on their own.
1002
- let seedReplaceCount = 0;
1003
- for (const [refname, oldSha] of seed.tips) {
1004
- if (!refname.startsWith('refs/replace/'))
1005
- continue;
1006
- seedReplaceCount++;
1007
- // Removed (gone from current) or retargeted (points at a different replacement object).
1008
- if (currentTips.get(refname) !== oldSha) {
1009
- fallback('replace-refs-changed');
1010
- return undefined;
1011
- }
1012
- }
1013
- let currentReplaceCount = 0;
1014
- for (const refname of currentTips.keys()) {
1015
- if (refname.startsWith('refs/replace/')) {
1016
- currentReplaceCount++;
1017
- }
1018
- }
1019
- // Every seed replace ref is present-and-equal in current (checked above); an unequal count means a
1020
- // replace ref was ADDED.
1021
- if (seedReplaceCount !== currentReplaceCount) {
1022
- fallback('replace-refs-changed');
1023
- return undefined;
1024
- }
1025
- // Ref-tip diff gate: deletions + non-fast-forward moves force a full walk.
1026
- // Reused rows whose ref badges / current-HEAD flag changed and must be rebuilt from raw git.
1027
- const affected = new Set();
1028
- const ffPairs = [];
1029
- // A moved/new REMOTE ref also changes its tracking branches' ahead/behind — baked into those
1030
- // branch pills' serialized contexts (`+ahead`/`+behind` drive Push/Pull menu gating) — while the
1031
- // LOCAL tips stay put; refetch those rows too so a plain fetch corrects them without a full walk.
1032
- const addTrackingBranchRows = (remoteRefname) => {
1033
- if (branches == null || !remoteRefname.startsWith('refs/remotes/'))
1034
- return;
1035
- const upstreamName = remoteRefname.substring('refs/remotes/'.length);
1036
- for (const b of branches) {
1037
- if (b.upstream?.name === upstreamName && b.sha != null && seedShas.has(b.sha)) {
1038
- affected.add(b.sha);
1039
- }
1040
- }
1041
- };
1042
- for (const [refname, oldSha] of seed.tips) {
1043
- if (!isMoveableGraphRef(refname))
1044
- continue;
1045
- const cur = currentTips.get(refname);
1046
- if (cur == null) {
1047
- fallback('ref-deleted');
1048
- return undefined;
1049
- }
1050
- if (cur !== oldSha) {
1051
- ffPairs.push([oldSha, cur]);
1052
- if (seedShas.has(oldSha)) {
1053
- affected.add(oldSha);
1054
- }
1055
- if (seedShas.has(cur)) {
1056
- affected.add(cur);
1057
- }
1058
- addTrackingBranchRows(refname);
1059
- }
1060
- }
1061
- // New refs (present now, absent from the seed) landing on an already-loaded row.
1062
- for (const [refname, cur] of currentTips) {
1063
- if (!isMoveableGraphRef(refname) || seed.tips.has(refname))
1064
- continue;
1065
- if (seedShas.has(cur)) {
1066
- affected.add(cur);
1067
- }
1068
- addTrackingBranchRows(refname);
1069
- }
1070
- if (ffPairs.length > 0) {
1071
- // Bounded fan-out: a mass-moved-ref fetch can produce hundreds of pairs — an unbounded
1072
- // `Promise.all` would monopolize (or overflow) the git queue. Small chunks stay well under the
1073
- // queue's slot count, and the first non-fast-forward bails without paying for the rest.
1074
- const ffCheckChunkSize = 4;
1075
- for (let i = 0; i < ffPairs.length; i += ffCheckChunkSize) {
1076
- const results = await Promise.all(ffPairs
1077
- .slice(i, i + ffCheckChunkSize)
1078
- .map(([oldSha, newSha]) => this.isFastForward(repoPath, oldSha, newSha, cancellation)));
1079
- if (results.some(ok => !ok)) {
1080
- fallback('ref-non-fast-forward');
1081
- return undefined;
1082
- }
1083
- }
1084
- }
1085
- // HEAD move (checkout) — old/new HEAD rows need their `isCurrentHead` re-derived from raw git. A
1086
- // checkout between two branches sitting on the SAME commit moves no sha yet flips which head carries
1087
- // `isCurrentHead`, so compare the current-head ref NAME too (both are git short refnames; a detached
1088
- // HEAD has an undefined branch name). Either sha or name differing re-derives both endpoints' rows.
1089
- const priorHeadRow = seed.rows.find(r => r.heads?.some(h => h.isCurrentHead));
1090
- const priorHeadSha = priorHeadRow?.sha;
1091
- const priorHeadName = priorHeadRow?.heads?.find(h => h.isCurrentHead)?.name;
1092
- const currentHeadName = headBranch?.name;
1093
- if (priorHeadSha !== currentHeadSha || priorHeadName !== currentHeadName) {
1094
- if (priorHeadSha != null && seedShas.has(priorHeadSha)) {
1095
- affected.add(priorHeadSha);
1096
- }
1097
- if (currentHeadSha != null && seedShas.has(currentHeadSha)) {
1098
- affected.add(currentHeadSha);
1099
- }
1100
- }
1101
- // Stash-set gate: any push/pop/drop changes the injected rows.
1102
- const currentStashShas = gitStash?.stashes != null ? new Set(gitStash.stashes.keys()) : new Set();
1103
- const priorStashShas = seed.rows.filter(r => r.kind === 'stash').map(r => r.sha);
1104
- if (priorStashShas.length !== currentStashShas.size || priorStashShas.some(s => !currentStashShas.has(s))) {
1105
- fallback('stash-changed');
1106
- return undefined;
1107
- }
1108
- // Decoration-metadata gate: rows EMBED metadata derived from side inputs (default branch,
1109
- // upstreams, worktree assignments, remote urls/providers, current user) that can change without
1110
- // moving any ref tip — e.g. `git remote set-head`, `branch --set-upstream-to`, `worktree add`.
1111
- // Reused rows keep their prior decorations (only flags/reachability are re-derived below), so ANY
1112
- // change here must take the full walk that rebuilds them. An absent seed fingerprint never matches —
1113
- // safe full fallback. Deliberately LAST of the gates so the structural gates above keep their precise
1114
- // reasons (a deleted tracking branch reports `ref-deleted`, not this).
1115
- if (seed.decorationFingerprint !== decorationFingerprint) {
1116
- fallback('metadata-changed');
1117
- return undefined;
1118
- }
1119
- // Per-branch upstream retargets/removals/additions on RETAINED rows: a branch pill embeds its
1120
- // upstream, and a tip-stationary branch's row is reused as-is — so compare every seed-row pill's
1121
- // embedded upstream against the current mapping. Kept OUT of the fingerprint so a NEW tracking
1122
- // branch stays fast (its row is rebuilt via the `affected` refetch; a deleted one is `ref-deleted`).
1123
- for (const r of seed.rows) {
1124
- if (r.heads == null)
1125
- continue;
1126
- for (const h of r.heads) {
1127
- const currentBranch = branchMap.get(h.name);
1128
- if (currentBranch == null)
1129
- continue;
1130
- if (h.upstream?.name !== currentBranch.upstream?.name) {
1131
- fallback('metadata-changed');
1132
- return undefined;
1133
- }
1134
- }
1135
- }
1136
- // Enumerate the new commits (reachable now but not from any prior tip) + boundary check.
1137
- // Stashes' rows are already in the seed, so their shas join the EXCLUSIONS (passing them via
1138
- // `--all` would re-emit them as "new"). The exclusions are fed as `^sha` lines over stdin, NOT
1139
- // argv — a repo can carry more distinct ref tips (tags, PR refs) than a command line holds
1140
- // (Windows caps ~32K chars), and stdin is unbounded.
1141
- const notShas = new Set(seed.tips.values());
1142
- for (const s of currentStashShas) {
1143
- notShas.add(s);
1144
- }
1145
- let exclusionsStdin = '';
1146
- for (const s of notShas) {
1147
- exclusionsStdin += `^${s}\n`;
1148
- }
1149
- const enumResult = await this.git.run({ cwd: repoPath, configs: gitConfigsLog, cancellation: cancellation, stdin: exclusionsStdin }, 'log', ...parser.arguments, '--date-order', '--all', '--stdin', '--');
1150
- const newCommits = [...parser.parse(enumResult.stdout)];
1151
- // Stitch soundness: the result must equal [...new, ...seed]. That holds iff every new commit is
1152
- // strictly newer than the seam (the max date across the seed window) — an equal/older date could
1153
- // interleave under `--date-order`, so bail. Checked on raw dates BEFORE any mutation.
1154
- let maxSeedDate = Number.NEGATIVE_INFINITY;
1155
- for (const r of seed.rows) {
1156
- if (r.date > maxSeedDate) {
1157
- maxSeedDate = r.date;
1158
- }
1159
- }
1160
- for (const c of newCommits) {
1161
- if (Number(c.committerDate) * 1000 <= maxSeedDate) {
1162
- fallback('date-boundary');
1163
- return undefined;
1164
- }
1165
- }
1166
- // Window/limit shape.
1167
- const stitchedSize = newCommits.length + seed.rows.length;
1168
- const seedHasMore = seed.hasMore === true;
1169
- const noLimit = defaultLimit === 0;
1170
- // The rev anchor (a seed sha) bounds the walk's BOTTOM: the full walk with `sha=rev` grows its window
1171
- // down to (and INCLUDING) rev before honoring the limit — and with no limit it stops the instant it
1172
- // finds rev — so the anchor row survives the trim even when `limit` alone would cut above it. Its index
1173
- // in the assembled window `[new…, seed…]` (new commits never dedup, so `newRows.length` equals
1174
- // `newCommits.length`): `newCommits.length + <its index in seed.rows>`.
1175
- const revWindowIndex = rev != null ? newCommits.length + seed.rows.findIndex(r => r.sha === rev) : -1;
1176
- // Rows the walk targets: `defaultLimit`, raised to at least include the rev anchor (with no limit + rev,
1177
- // exactly `revWindowIndex + 1`, since the walk stops on finding rev).
1178
- const targetRows = rev != null
1179
- ? noLimit
1180
- ? revWindowIndex + 1
1181
- : Math.max(defaultLimit, revWindowIndex + 1)
1182
- : defaultLimit;
1183
- // The fast path can only serve rows the seed carries; if more is wanted than it holds AND there was
1184
- // more below it, git is needed for the gap → full walk. (No rev + no limit wants everything below.)
1185
- const wantsBelowWindow = rev != null ? targetRows > stitchedSize : noLimit || defaultLimit > stitchedSize;
1186
- if (wantsBelowWindow && seedHasMore) {
1187
- fallback('limit-exceeds-seed');
1188
- return undefined;
1189
- }
1190
- const trimTo = rev != null
1191
- ? Math.min(targetRows, stitchedSize)
1192
- : noLimit
1193
- ? stitchedSize
1194
- : Math.min(defaultLimit, stitchedSize);
1195
- const hasMore = trimTo < stitchedSize || seedHasMore;
1196
- // Stashes present in the window make the `more()` skip math (records vs unique ids) ambiguous —
1197
- // only take the fast path when nothing pages below.
1198
- if (currentStashShas.size > 0 && hasMore) {
1199
- fallback('stash-window-conflict');
1200
- return undefined;
1201
- }
1202
- // Commit to the fast path — mutations begin here (all fallbacks are above).
1203
- const newRows = [];
1204
- for (const c of newCommits) {
1205
- const built = buildRowFromCommit(c);
1206
- if (built != null) {
1207
- newRows.push(built.row);
1208
- }
1209
- }
1210
- // Rebuild the affected reused rows from raw git (bounded `--no-walk`) so their ref badges + emojified
1211
- // message + current-HEAD flag are exactly what a full walk would produce (git owns %D ordering).
1212
- const refetched = new Map();
1213
- if (affected.size > 0) {
1214
- // SHAs over stdin, not argv — a mass-moved-ref fetch can put hundreds of retained rows in
1215
- // `affected`, past what a command line holds (see the enumeration above).
1216
- const refetchResult = await this.git.run({ cwd: repoPath, configs: gitConfigsLog, cancellation: cancellation, stdin: join(affected, '\n') }, 'log', ...parser.arguments, '--no-walk', '--stdin', '--');
1217
- for (const c of parser.parse(refetchResult.stdout)) {
1218
- const built = buildRowFromCommit(c);
1219
- if (built != null) {
1220
- refetched.set(built.row.sha, built.row);
1221
- }
1222
- }
1223
- }
1224
- const freshShas = new Set([...newRows.map(r => r.sha), ...refetched.keys()]);
1225
- // Assemble [new…, reused/refetched…] and trim to the requested window (new commits push the
1226
- // bottom rows out — exactly what a full walk at this limit does).
1227
- const windowRows = [...newRows];
1228
- for (const r of seed.rows) {
1229
- windowRows.push(refetched.get(r.sha) ?? r);
1230
- }
1231
- windowRows.length = Math.min(windowRows.length, trimTo);
1232
- // Building the fresh rows above populated `ids`/`total` (via `buildRowFromCommit`); reset and rebuild
1233
- // them from the FINAL trimmed window so `ids`/`total`/the reachability boundary match a full walk
1234
- // exactly (this is what makes `more()` continue identically).
1235
- ids.clear();
1236
- total = 0;
1237
- for (const row of windowRows) {
1238
- ids.add(row.sha);
1239
- total++;
1240
- const refs = accumulateRowState(row.sha, row.parents, row.heads ?? [], row.remotes ?? [], row.tags ?? [], row.sha === currentHeadSha, row.kind === 'stash');
1241
- if (freshShas.has(row.sha)) {
1242
- // Fresh rows are raw — run the full processor (contexts, emojify, avatar). Reused rows keep
1243
- // their already-processed contexts/message; only their flags (below) are recomputed.
1244
- row.reachability = refs?.size ? { partial: true, refs: [...refs.values()] } : undefined;
1245
- rowProcessor.processRow(row, graphCtx);
1246
- }
1247
- // Authoritative flags for every commit row (membership can shift on reused rows too — e.g. a new
1248
- // interior branch flips `+unique`). Stash rows carry none.
1249
- if (row.kind !== 'stash') {
1250
- (row.contexts ??= {}).flags = computeGraphRowContextFlags(row.sha, refs?.values(), graphCtx);
1251
- }
1252
- finalizeRowReachability(row, row.sha, refs);
1253
- }
1254
- // Reconstruct the walk's first-call cursor so `more()` (which re-spawns git from `--skip`) continues
1255
- // byte-identically off the trimmed window.
1256
- iterations = 1;
1257
- const lastSha = last(ids);
1258
- const cursor = lastSha != null ? { sha: lastSha, skip: total - iterations } : undefined;
1259
- const rowsStatsDeferred = buildRowsStatsDeferred(windowRows);
1260
- onResult?.({ path: 'fast', added: newRows.length });
1261
- return {
1262
- repoPath: repoPath,
1263
- avatars: avatars,
1264
- ids: ids,
1265
- includes: options?.include,
1266
- branches: branchMap,
1267
- remotes: remoteMap,
1268
- downstreams: downstreamMap,
1269
- stashes: gitStash?.stashes,
1270
- worktrees: worktrees,
1271
- worktreesByBranch: worktreesByBranch,
1272
- reachableFromHEAD: reachableFromHEAD,
1273
- rewriteableFromHEAD: rewriteableFromHEAD,
1274
- reachability: reachabilityBuilder.build(),
1275
- refTips: refTips,
1276
- decorationFingerprint: decorationFingerprint,
1277
- shallow: shallow,
1278
- rows: windowRows,
1279
- // Mirror the full walk's `id` (`sha ?? rev`, sha = the resolved rev-or-HEAD) — NOT the actual HEAD,
1280
- // which `currentHeadSha` now tracks separately when a rev anchor is passed.
1281
- id: selectSha ?? rev,
1282
- rowsStats: rowStats,
1283
- rowsStatsDeferred: rowsStatsDeferred,
1284
- paging: {
1285
- limit: noLimit ? total : defaultLimit,
1286
- startingCursor: undefined,
1287
- hasMore: hasMore,
1288
- },
1289
- more: async (limit, sha, cancellation) => getCommitsForGraphCore.call(this, limit, sha, cursor, cancellation),
1290
- };
1291
- };
1292
- if (options?.incrementalSeed != null) {
1293
- let fast;
1294
- try {
1295
- fast = await tryIncrementalGraph(options.incrementalSeed);
1296
- }
1297
- catch (ex) {
1298
- // The fast path must never fail where the full walk it accelerates would succeed — its git
1299
- // operations have failure modes the `--all` walk doesn't (per-tip `--not` argv on huge ref
1300
- // sets, queue-depth overflow fanning out FF checks, transient git errors). Cancellation
1301
- // still propagates; anything else degrades to the full walk below.
1302
- if (isCancellationError(ex) || cancellation?.aborted)
1303
- throw ex;
1304
- // The fast path may have died AFTER its mutation barrier (the affected-row refetch, or the
1305
- // row processor) with the walk accumulators partially populated — a full walk over polluted
1306
- // `ids` would silently DROP those rows (its loop dedups on `ids.has`). Reset every closure
1307
- // accumulator to its pristine pre-walk state; the seeded reachability builder is append-only
1308
- // and tolerates orphaned interns by design, and mutated reused-row objects are superseded by
1309
- // the full walk's fresh rows.
1310
- ids.clear();
1311
- total = 0;
1312
- iterations = 0;
1313
- rowStats.clear();
1314
- avatars.clear();
1315
- reachableFromHEAD.clear();
1316
- rewriteableFromHEAD.clear();
1317
- reachableFromHeadUpstream.clear();
1318
- reachableRefs.clear();
1319
- tipShasWithChildren.clear();
1320
- downstreamMap.clear();
1321
- headSha = undefined;
1322
- rewriteableNextSha = undefined;
1323
- scope?.warn(`incremental graph walk failed; falling back to full walk; ${String(ex)}`);
1324
- incrementalFallbackReason = 'error';
1325
- options.onIncrementalResult?.({ path: 'fallback', reason: 'error' });
1326
- }
1327
- if (fast != null) {
1328
- void this.provider.maintenance?.request(repoPath, 'commit-graph');
1329
- return fast;
1330
- }
1331
- // Parent-rewriting fallbacks change boundary commits' true diffs — an unshallowed parent or a
1332
- // replace-ref retarget makes previously-computed per-sha stats stale, so the fallback walk must
1333
- // recompute them instead of carrying the prior generation's values forward. An `error` fallback
1334
- // recomputes too: the throw may have preceded the replace-ref/shallow gates, so staleness can't
1335
- // be ruled out.
1336
- if (incrementalFallbackReason === 'shallow-changed' ||
1337
- incrementalFallbackReason === 'replace-refs-changed' ||
1338
- incrementalFallbackReason === 'error') {
1339
- rowsStatsSeed = undefined;
1340
- }
1341
- }
1342
- let graph = await getCommitsForGraphCore.call(this, defaultLimit, selectSha, undefined, cancellation);
1343
- // Spurious-empty guard: the repo has branches (so `git log --all` should yield commits) yet the
1344
- // log returned no rows. That's an inconsistent result — almost always a transient ref-read race
1345
- // while a concurrent git operation rewrites refs/packed-refs — not a genuinely empty repo.
1346
- // Returning it would flash "No commits" in the graph. Retry once (transient glitches clear within
1347
- // ms). A truly empty repo has no branches and is left untouched.
1348
- if (graph.rows.length === 0 && branches?.length && !cancellation?.aborted) {
1349
- scope?.warn(`graph returned 0 rows but repo has ${branches.length} branches; retrying`);
1350
- graph = await getCommitsForGraphCore.call(this, defaultLimit, selectSha, undefined, cancellation);
1351
- }
1352
- // After the first load, hint the maintenance service to backfill the commit-graph file (background)
1353
- // so the NEXT open's ordered walk starts emitting rows immediately instead of sorting the whole
1354
- // history first. Fire-and-forget — the service's demand throttle decides whether it actually runs.
1355
- void this.provider.maintenance?.request(repoPath, 'commit-graph');
1356
- return graph;
1357
- }
1358
- async *searchGraph(repoPath, search, options, cancellation) {
1359
- return yield* this.searchGraphCore(repoPath, search, undefined, undefined, options, cancellation);
1360
- }
1361
- async *continueSearchGraph(repoPath, cursor, existingResults, options, cancellation) {
1362
- return yield* this.searchGraphCore(repoPath, cursor.search, cursor, existingResults, options, cancellation);
1363
- }
1364
- /**
1365
- * Cheap commit count for `search`, no result materialization — used to probe a candidate relaxed
1366
- * query before offering it. Never throws: any failure (including a sha-only `commit:` query, which
1367
- * can't be meaningfully "relaxed") returns 0, since this is a probe, not a search.
1368
- */
1369
- async countSearchResults(repoPath, search, options, cancellation) {
1370
- try {
1371
- search = { matchAll: false, matchCase: false, matchRegex: true, matchWholeWord: false, ...search };
1372
- const currentUser = search.query.includes('@me')
1373
- ? await this.provider.config.getCurrentUser(repoPath)
1374
- : undefined;
1375
- const { args: searchArgs, files, shas, filters } = parseSearchQueryGitCommand(search, currentUser);
1376
- // An exact sha lookup can't be relaxed by dropping filter groups — nothing to count.
1377
- if (shas?.size)
1378
- return 0;
1379
- // `--merges` matches stash commits too (they have 2-3 parents). `rev-list` gets no stdin, so the
1380
- // only stash that can leak in here is refs/stash's tip via `--all` -- exclude it up front
1381
- if (filters.type === 'merge') {
1382
- const allIndex = searchArgs.indexOf('--all');
1383
- if (allIndex !== -1) {
1384
- searchArgs.splice(allIndex, 0, '--exclude=refs/stash');
1385
- }
1386
- }
1387
- const maxCount = options?.maxCount ?? 1000;
1388
- const result = await this.git.run({ cwd: repoPath, configs: gitConfigsLog, cancellation: cancellation, errors: 'ignore' }, 'rev-list', '--count', `--max-count=${maxCount}`, ...searchArgs, '--', ...files);
1389
- const count = Number.parseInt(result.stdout.trim(), 10);
1390
- return Number.isFinite(count) ? count : 0;
1391
- }
1392
- catch {
1393
- return 0;
1394
- }
1395
- }
1396
- async *searchGraphCore(repoPath, search, cursor, existingResults, options, cancellation) {
1397
- search = { matchAll: false, matchCase: false, matchRegex: true, matchWholeWord: false, ...search };
1398
- const comparisonKey = getSearchQueryComparisonKey(search);
1399
- try {
1400
- const currentUser = search.query.includes('@me')
1401
- ? await this.provider.config.getCurrentUser(repoPath)
1402
- : undefined;
1403
- const { args: searchArgs, files, shas, filters } = parseSearchQueryGitCommand(search, currentUser);
1404
- const tipsOnly = filters.type === 'tip';
1405
- // Stash commits have 2-3 parents, so `--merges` matches them; excluded from results below.
1406
- // Derived from the args git actually runs rather than `filters.type`, since a multi-value
1407
- // `type:` query (e.g. `type:merge type:tip`) leaves `--merges` in the args while
1408
- // `filters.type` reflects only the last value parsed
1409
- const mergesOnly = searchArgs.includes('--merges');
1410
- const parser = filters.files
1411
- ? getShaAndDatesWithFilesLogParser(tipsOnly)
1412
- : getShaAndDatesLogParser(tipsOnly);
1413
- const similarityThreshold = this.context.config?.commits.similarityThreshold ?? undefined;
1414
- const args = [
1415
- 'log',
1416
- ...parser.arguments,
1417
- `-M${similarityThreshold == null ? '' : `${similarityThreshold}%`}`,
1418
- '--use-mailmap',
1419
- ];
1420
- let stashes;
1421
- let stdin;
1422
- let remappedIds;
1423
- let resolvedShas;
1424
- if (shas?.size) {
1425
- resolvedShas = await this.provider.revision.resolveShas(repoPath, shas, cancellation);
1426
- // Never throw on cancellation here: the outer catch wraps non-GitSearchError into
1427
- // GitSearchError, which surfaces as a false "Invalid search pattern". Return instead.
1428
- if (cancellation?.aborted) {
1429
- return {
1430
- repoPath: repoPath,
1431
- query: search,
1432
- queryFilters: filters,
1433
- comparisonKey: comparisonKey,
1434
- results: existingResults ?? new Map(),
1435
- hasMore: true,
1436
- };
1437
- }
1438
- // Short SHA(s) matched no commit: return empty (empty stdin to `--no-walk --stdin`
1439
- // would return HEAD, so we must not fall through to git).
1440
- if (!resolvedShas.size) {
1441
- return {
1442
- repoPath: repoPath,
1443
- query: search,
1444
- queryFilters: filters,
1445
- comparisonKey: comparisonKey,
1446
- results: existingResults ?? new Map(),
1447
- hasMore: false,
1448
- };
1449
- }
1450
- }
1451
- if (resolvedShas?.size) {
1452
- stdin = join(resolvedShas, '\n');
1453
- args.push('--no-walk');
1454
- remappedIds = new Map();
1455
- }
1456
- else if (!filters.refs) {
1457
- // Don't include stashes when using ref: filter, as they would add unrelated commits
1458
- // There *HAS* to be a better way to get git log to return stashes, but this is the best we've found
1459
- const converted = convertStashesToStdin(await this.provider.stash?.getStash(repoPath, { includeFiles: false }, cancellation));
1460
- stashes = converted.stashes;
1461
- remappedIds = converted.remappedIds;
1462
- // `--all` already surfaces refs/stash's tip on its own, so when merges-only there's no need
1463
- // to walk the rest of the stash stack via stdin -- the results filter below still excludes
1464
- // any stash sha that slips through via refs/stash
1465
- stdin = mergesOnly ? undefined : converted.stdin;
1466
- }
1467
- else if (mergesOnly) {
1468
- // `ref:` skips walking stashes into the results (they're unrelated to the ref), but a
1469
- // stash's tip can still leak in via `--merges` if the ref reaches refs/stash -- fetch
1470
- // stashes here purely so the results filter below can exclude them, without widening
1471
- // the walk via stdin
1472
- const converted = convertStashesToStdin(await this.provider.stash?.getStash(repoPath, { includeFiles: false }, cancellation));
1473
- stashes = converted.stashes;
1474
- remappedIds = converted.remappedIds;
1475
- }
1476
- else {
1477
- remappedIds = new Map();
1478
- }
1479
- if (stdin) {
1480
- args.push('--stdin');
1481
- }
1482
- const limit = options?.limit ?? this.context.config?.graph?.maxSearchItems ?? 0;
1483
- const ordering = options?.ordering ?? this.context.config?.commits.ordering ?? undefined;
1484
- if (ordering) {
1485
- args.push(`--${ordering}-order`);
1486
- }
1487
- // Add the search args, but skip any shas (as they are already included in the stdin)
1488
- for (const arg of searchArgs) {
1489
- if (shas?.has(arg) || args.includes(arg))
1490
- continue;
1491
- args.push(arg);
1492
- }
1493
- const results = existingResults ?? new Map();
1494
- // Use state from cursor, if provided
1495
- const cursorState = cursor?.state != null && typeof cursor.state === 'object' ? cursor.state : undefined;
1496
- let iterations = cursorState?.iterations ?? 0;
1497
- let totalSeen = cursorState?.totalSeen ?? 0;
1498
- let skipCursor = cursorState ? { sha: cursorState.sha, skip: cursorState.skip } : undefined;
1499
- let count = 0;
1500
- try {
1501
- const env_2 = { stack: [], error: void 0, hasError: false };
1502
- try {
1503
- iterations++;
1504
- const aborter = new AbortController();
1505
- const onAbort = () => {
1506
- aborter.abort();
1507
- };
1508
- cancellation?.addEventListener('abort', onAbort, { once: true });
1509
- // An ALREADY-aborted signal (e.g. `toAbortSignal` of a cancelled token) never fires listeners
1510
- // added after the fact — without this the walk would run to completion unabortably.
1511
- if (cancellation?.aborted) {
1512
- onAbort();
1513
- }
1514
- const _disposable = __addDisposableResource(env_2, createDisposable(() => cancellation?.removeEventListener('abort', onAbort)), false);
1515
- const stream = this.git.stream({
1516
- cwd: repoPath,
1517
- cancellation: aborter.signal,
1518
- configs: ['-C', repoPath, ...gitConfigsLog],
1519
- stdin: stdin,
1520
- }, ...args, skipCursor?.skip ? `--skip=${skipCursor.skip}` : undefined, '--', ...files);
1521
- const _streamDisposer = __addDisposableResource(env_2, createDisposable(() => void stream.return?.(undefined)), false);
1522
- let hasMore = false;
1523
- let sha;
1524
- const stashesOnly = filters.type === 'stash';
1525
- // Progressive results support - time-based batching for consistent UI updates
1526
- const batch = [];
1527
- let lastProgressTime = Date.now();
1528
- for await (const r of parser.parseAsync(stream)) {
1529
- // Check for cancellation early in each iteration
1530
- if (cancellation?.aborted) {
1531
- // When paused/cancelled, assume there are more results
1532
- hasMore = true;
1533
- break;
1534
- }
1535
- count++;
1536
- if (limit && count > limit) {
1537
- hasMore = true;
1538
- aborter.abort();
1539
- break;
1540
- }
1541
- sha = remappedIds.get(r.sha) ?? r.sha;
1542
- if (results.has(sha) ||
1543
- (stashesOnly && !stashes?.has(sha)) ||
1544
- (mergesOnly && stashes?.has(sha)) ||
1545
- (tipsOnly && !r.tips)) {
1546
- continue;
1547
- }
1548
- const resultData = {
1549
- i: results.size,
1550
- date: Number(options?.ordering === 'author-date' ? r.authorDate : r.committerDate) * 1000,
1551
- files: r.files,
1552
- };
1553
- results.set(sha, resultData);
1554
- batch.push([sha, resultData]);
1555
- // Send progress updates with incremental results
1556
- const timeSinceLastProgress = Date.now() - lastProgressTime;
1557
- // Send batch when enough time has passed and we have new results
1558
- const shouldSendBatch = timeSinceLastProgress >= progressiveSearchResultsBatchTimeMs && batch.length > 0;
1559
- if (shouldSendBatch) {
1560
- // Send only the NEW results since last batch (incremental)
1561
- yield {
1562
- repoPath: repoPath,
1563
- query: search,
1564
- queryFilters: filters,
1565
- comparisonKey: comparisonKey,
1566
- results: new Map(batch),
1567
- runningTotal: results.size,
1568
- hasMore: true,
1569
- };
1570
- batch.length = 0;
1571
- lastProgressTime = Date.now();
1572
- }
1573
- }
1574
- // Send final progress update if there are remaining results
1575
- if (batch.length) {
1576
- yield {
1577
- repoPath: repoPath,
1578
- query: search,
1579
- queryFilters: filters,
1580
- comparisonKey: comparisonKey,
1581
- results: new Map(batch),
1582
- runningTotal: results.size,
1583
- hasMore: hasMore,
1584
- };
1585
- }
1586
- totalSeen += count;
1587
- const lastSha = last(results)?.[0];
1588
- skipCursor = lastSha != null ? { sha: lastSha, skip: totalSeen - iterations } : undefined;
1589
- return {
1590
- repoPath: repoPath,
1591
- query: search,
1592
- queryFilters: filters,
1593
- comparisonKey: comparisonKey,
1594
- results: results,
1595
- hasMore: hasMore,
1596
- paging: limit || hasMore
1597
- ? {
1598
- limit: limit || count,
1599
- cursor: hasMore && skipCursor
1600
- ? {
1601
- search: search,
1602
- state: {
1603
- iterations: iterations,
1604
- totalSeen: totalSeen,
1605
- sha: skipCursor.sha,
1606
- skip: skipCursor.skip,
1607
- },
1608
- }
1609
- : undefined,
1610
- }
1611
- : undefined,
1612
- };
1613
- }
1614
- catch (e_2) {
1615
- env_2.error = e_2;
1616
- env_2.hasError = true;
1617
- }
1618
- finally {
1619
- __disposeResources(env_2);
1620
- }
1621
- }
1622
- catch (ex) {
1623
- if (isCancellationError(ex) || cancellation?.aborted) {
1624
- // When cancelled, preserve cursor so search can be resumed
1625
- // Update totalSeen with the count from this iteration
1626
- totalSeen += count;
1627
- const lastSha = last(results)?.[0];
1628
- const skipCursor = lastSha != null ? { sha: lastSha, skip: totalSeen - iterations } : undefined;
1629
- return {
1630
- repoPath: repoPath,
1631
- query: search,
1632
- queryFilters: filters,
1633
- comparisonKey: comparisonKey,
1634
- results: results,
1635
- hasMore: true, // Assume there are more results since we were cancelled mid-search
1636
- paging: limit || skipCursor
1637
- ? {
1638
- limit: limit || count,
1639
- cursor: skipCursor
1640
- ? {
1641
- search: search,
1642
- state: {
1643
- iterations: iterations,
1644
- totalSeen: totalSeen,
1645
- sha: skipCursor.sha,
1646
- skip: skipCursor.skip,
1647
- },
1648
- }
1649
- : undefined,
1650
- }
1651
- : undefined,
1652
- };
1653
- }
1654
- const classified = classifySearchError(ex);
1655
- throw new GitSearchError(ex, classified?.reason, classified?.detail);
1656
- }
1657
- }
1658
- catch (ex) {
1659
- if (ex instanceof GitSearchError)
1660
- throw ex;
1661
- const classified = classifySearchError(ex);
1662
- throw new GitSearchError(ex, classified?.reason, classified?.detail);
1663
- }
1664
- }
100
+ /** Compare the inputs that can rewrite existing commits without moving branch tips. */
101
+ function getAncestryChange(prior, current) {
102
+ if (prior.shallowBoundary == null || current.shallowBoundary == null || prior.shallowBoundary !== current.shallowBoundary) return "shallow-changed";
103
+ if (prior.refTips == null || current.refTips == null) return "replace-refs-changed";
104
+ for (const [ref, sha] of prior.refTips) if (ref.startsWith("refs/replace/") && current.refTips.get(ref) !== sha) return "replace-refs-changed";
105
+ for (const ref of current.refTips.keys()) if (ref.startsWith("refs/replace/") && !prior.refTips.has(ref)) return "replace-refs-changed";
1665
106
  }
1666
- __decorate([
1667
- debug({
1668
- // The seed params (`incrementalSeed`, `reachabilitySeed`, `rowsStatsSeed`) hold cached rows/stats
1669
- // for potentially thousands of commits — logging them via the default formatting would dump
1670
- // megabytes per call, so only log their presence (and key summary fields).
1671
- args: (repoPath, rev, options) => ({
1672
- repoPath: repoPath,
1673
- rev: rev,
1674
- limit: options?.limit,
1675
- stats: options?.include?.stats,
1676
- incrementalSeed: options?.incrementalSeed && {
1677
- rows: options.incrementalSeed.rows.length,
1678
- tips: options.incrementalSeed.tips.size,
1679
- ordering: options.incrementalSeed.ordering,
1680
- },
1681
- reachabilitySeed: options?.reachabilitySeed != null,
1682
- rowsStatsSeed: options?.rowsStatsSeed != null,
1683
- }),
1684
- })
1685
- ], GraphGitSubProvider.prototype, "getGraph", null);
1686
- __decorate([
1687
- debug({
1688
- args: (repoPath, s, o) => ({
1689
- repoPath: repoPath,
1690
- search: `[${s.matchAll ? 'A' : ''}${s.matchCase ? 'C' : ''}${s.matchRegex ? 'R' : ''}${s.matchWholeWord ? 'W' : ''}]: ${s.query.length > 500 ? `${s.query.substring(0, 500)}...` : s.query}`,
1691
- options: `limit=${o?.limit}, ordering=${o?.ordering}`,
1692
- }),
1693
- })
1694
- ], GraphGitSubProvider.prototype, "searchGraph", null);
1695
- __decorate([
1696
- debug({
1697
- args: (repoPath, c, r, o) => ({
1698
- repoPath: repoPath,
1699
- cursor: `[${c.search.matchAll ? 'A' : ''}${c.search.matchCase ? 'C' : ''}${c.search.matchRegex ? 'R' : ''}${c.search.matchWholeWord ? 'W' : ''}]: ${c.search.query.length > 500 ? `${c.search.query.substring(0, 500)}...` : c.search.query} (continue)`,
1700
- existingResults: `results=${r.size}`,
1701
- options: `limit=${o?.limit}`,
1702
- }),
1703
- })
1704
- ], GraphGitSubProvider.prototype, "continueSearchGraph", null);
107
+ var GraphGitSubProvider = class {
108
+ context;
109
+ git;
110
+ cache;
111
+ provider;
112
+ constructor(context, git, cache, provider) {
113
+ this.context = context;
114
+ this.git = git;
115
+ this.cache = cache;
116
+ this.provider = provider;
117
+ }
118
+ /**
119
+ * Current ref tips (canonical refname → PEELED commit sha), for the R6b fast path's gate. Peeled so an
120
+ * annotated tag maps to the commit its badge sits on — the same convention {@link GraphIncrementalSeed.tips}
121
+ * uses — and so the seed↔current diff is by commit identity. Covers heads/remotes/tags/replace (all the
122
+ * namespaces the gate consumers read); the caller filters to the ref classes it cares about.
123
+ */
124
+ async getCurrentRefTips(repoPath, cancellation) {
125
+ const tips = /* @__PURE__ */ new Map();
126
+ try {
127
+ const records = await this.provider.refs.getRefs(repoPath, cancellation, { force: true });
128
+ for (const record of records) {
129
+ if (!record.name) continue;
130
+ tips.set(record.name, record.peeledObjectname || record.objectname);
131
+ }
132
+ } catch (ex) {
133
+ if (isCancellationError(ex) || cancellation?.aborted) throw ex;
134
+ }
135
+ return tips;
136
+ }
137
+ /** Read the actual boundary from the common git directory, including linked worktrees and bare repos. */
138
+ async getShallowBoundary(repoPath, cancellation) {
139
+ const scope = getScopedLogger();
140
+ try {
141
+ const path = (await this.git.run({
142
+ cwd: repoPath,
143
+ configs: gitConfigsLog,
144
+ cancellation,
145
+ errors: "throw"
146
+ }, "rev-parse", "--git-path", "shallow")).stdout.trim();
147
+ if (!path) return void 0;
148
+ const contents = await this.context.fs.readFile(this.provider.getAbsoluteUri(path, repoPath)).catch((ex) => {
149
+ const code = ex.code;
150
+ if (code === "ENOENT" || code === "FileNotFound") return void 0;
151
+ throw ex;
152
+ });
153
+ if (cancellation?.aborted) throw new CancellationError();
154
+ return contents == null ? "" : new TextDecoder().decode(contents).trim().split(/\s+/).sort().join("\n");
155
+ } catch (ex) {
156
+ if (cancellation?.aborted) throw new CancellationError();
157
+ if (isCancellationError(ex)) throw ex;
158
+ scope?.warn(`Unable to read shallow boundary for '${repoPath}': ${String(ex)}`);
159
+ return;
160
+ }
161
+ }
162
+ /** Whether `oldSha` is an ancestor of `newSha` (i.e. the ref moved fast-forward). */
163
+ async isFastForward(repoPath, oldSha, newSha, cancellation) {
164
+ return (await this.git.run({
165
+ cwd: repoPath,
166
+ cancellation,
167
+ errors: "ignore"
168
+ }, "merge-base", "--is-ancestor", oldSha, newSha)).exitCode === 0;
169
+ }
170
+ async openGraphSession(repoPath, options, cancellation) {
171
+ const getWalkShape = () => {
172
+ const cfg = this.context.config;
173
+ return {
174
+ ordering: cfg?.graph?.commitOrdering ?? cfg?.commits.ordering ?? "date",
175
+ onlyFollowFirstParent: cfg?.graph?.onlyFollowFirstParent ?? false
176
+ };
177
+ };
178
+ const session = new GraphSession(this, repoPath, options?.rowProcessor, getWalkShape);
179
+ await session.initialize(options, cancellation);
180
+ return session;
181
+ }
182
+ async getGraph(repoPath, rev, options, cancellation) {
183
+ const scope = getScopedLogger();
184
+ const cfg = this.context.config;
185
+ const defaultLimit = options?.limit ?? 5e3;
186
+ const ordering = cfg?.graph?.commitOrdering ?? cfg?.commits.ordering ?? "date";
187
+ const onlyFollowFirstParent = cfg?.graph?.onlyFollowFirstParent ?? false;
188
+ const deferStats = options?.include?.stats;
189
+ let rowsStatsSeed = options?.rowsStatsSeed;
190
+ const parser = getGraphParser(options?.include?.stats && !deferStats);
191
+ const shaParser = getShaLogParser();
192
+ const statsParser = getShaAndStatsLogParser();
193
+ const stashPromise = this.provider.stash?.getStash(repoPath, { includeFiles: false }, cancellation);
194
+ const prespawnAborter = new AbortController();
195
+ const onPrespawnCancel = () => prespawnAborter.abort();
196
+ cancellation?.addEventListener("abort", onPrespawnCancel, { once: true });
197
+ if (cancellation?.aborted) onPrespawnCancel();
198
+ let prespawn = (async () => {
199
+ try {
200
+ const gitStash = await stashPromise;
201
+ const { stdin } = convertStashesToStdin(gitStash?.stashes);
202
+ const args = [
203
+ "log",
204
+ ...parser.arguments,
205
+ `--${ordering}-order`,
206
+ "--all"
207
+ ];
208
+ if (stdin) args.push("--stdin");
209
+ if (onlyFollowFirstParent) args.push("--first-parent");
210
+ return { stream: this.git.stream({
211
+ cwd: repoPath,
212
+ configs: gitConfigsLog,
213
+ cancellation: prespawnAborter.signal,
214
+ stdin,
215
+ env: { GIT_FLUSH: "0" }
216
+ }, ...args, "--") };
217
+ } catch {
218
+ return;
219
+ }
220
+ })();
221
+ const refTipsPromise = this.getCurrentRefTips(repoPath, cancellation);
222
+ const shallowBoundaryPromise = this.getShallowBoundary(repoPath, cancellation);
223
+ const [shaResult, stashResult, branchesResult, remotesResult, currentUserResult, worktreesResult, defaultBranchResult, refTipsResult, shallowBoundaryResult] = await Promise.allSettled([
224
+ !isUncommitted(rev, true) ? this.git.run({
225
+ cwd: repoPath,
226
+ configs: gitConfigsLog
227
+ }, "log", ...shaParser.arguments, "-n1", rev ?? "HEAD", "--") : void 0,
228
+ stashPromise,
229
+ this.provider.branches.getBranches(repoPath, void 0, cancellation),
230
+ this.provider.remotes.getRemotes(repoPath, void 0, cancellation),
231
+ this.provider.config.getCurrentUser(repoPath),
232
+ this.provider.worktrees?.getWorktrees(repoPath, cancellation).then((w) => [w, groupWorktreesByBranch(w, { includeDefault: true })]),
233
+ this.provider.branches.getDefaultBranchName(repoPath, void 0, { local: true }, cancellation),
234
+ refTipsPromise,
235
+ shallowBoundaryPromise
236
+ ]);
237
+ const branches = getSettledValue(branchesResult)?.values;
238
+ const branchMap = branches != null ? new Map(branches.map((r) => [r.name, r])) : /* @__PURE__ */ new Map();
239
+ const headBranch = branches?.find((b) => b.current);
240
+ const headRefUpstreamName = headBranch?.upstream?.name;
241
+ const [worktrees, worktreesByBranch] = getSettledValue(worktreesResult) ?? [[], /* @__PURE__ */ new Map()];
242
+ const defaultBranchName = getSettledValue(defaultBranchResult);
243
+ const defaultLocalName = defaultBranchName != null ? getBranchNameWithoutRemote(defaultBranchName) : void 0;
244
+ let branchIdOfMainWorktree;
245
+ let mainWorktree;
246
+ if (worktreesByBranch != null) {
247
+ const defaultEntry = find(worktreesByBranch, ([, wt]) => wt.isDefault);
248
+ if (defaultEntry != null) {
249
+ [branchIdOfMainWorktree, mainWorktree] = defaultEntry;
250
+ worktreesByBranch.delete(branchIdOfMainWorktree);
251
+ }
252
+ }
253
+ const currentUser = getSettledValue(currentUserResult);
254
+ const remotes = getSettledValue(remotesResult);
255
+ const remoteMap = remotes != null ? new Map(remotes.map((r) => [r.name, r])) : /* @__PURE__ */ new Map();
256
+ const decorationFingerprint = computeDecorationFingerprint(repoPath, defaultBranchName, defaultLocalName, headRefUpstreamName, branches, remotes, worktrees, currentUser);
257
+ const shas = getSettledValue(shaResult)?.stdout;
258
+ const selectSha = shas != null ? first(shaParser.parse(shas)) : void 0;
259
+ let refTips;
260
+ if (refTipsResult.status === "rejected") throw refTipsResult.reason;
261
+ else refTips = refTipsResult.value;
262
+ if (shallowBoundaryResult.status === "rejected") throw shallowBoundaryResult.reason;
263
+ const shallowBoundary = shallowBoundaryResult.value;
264
+ const ancestrySeed = options?.ancestrySeed ?? (options?.incrementalSeed != null ? {
265
+ shallowBoundary: options.incrementalSeed.shallowBoundary,
266
+ refTips: options.incrementalSeed.tips
267
+ } : void 0);
268
+ const ancestryChange = ancestrySeed != null ? getAncestryChange(ancestrySeed, {
269
+ shallowBoundary,
270
+ refTips
271
+ }) : void 0;
272
+ if (ancestryChange != null || ancestrySeed == null) rowsStatsSeed = void 0;
273
+ const downstreamMap = /* @__PURE__ */ new Map();
274
+ const gitStash = getSettledValue(stashResult);
275
+ const { stdin, remappedIds } = convertStashesToStdin(gitStash?.stashes);
276
+ const avatars = /* @__PURE__ */ new Map();
277
+ const ids = /* @__PURE__ */ new Set();
278
+ const reachableFromHEAD = /* @__PURE__ */ new Set();
279
+ const rewriteableFromHEAD = /* @__PURE__ */ new Set();
280
+ let headSha;
281
+ let rewriteableNextSha;
282
+ const undoableTipShas = /* @__PURE__ */ new Set();
283
+ if (headBranch?.sha != null) undoableTipShas.add(headBranch.sha);
284
+ for (const wt of worktrees) if (wt.sha != null) undoableTipShas.add(wt.sha);
285
+ const tipShasWithChildren = /* @__PURE__ */ new Set();
286
+ const reachableFromHeadUpstream = /* @__PURE__ */ new Set();
287
+ const reachableRefs = /* @__PURE__ */ new Map();
288
+ const reachabilityBuilder = createReachabilityTableBuilder(options?.reachabilitySeed);
289
+ const internCache = /* @__PURE__ */ new WeakMap();
290
+ function finalizeRowReachability(row, sha, refs) {
291
+ let setIndex;
292
+ const cached = refs != null ? internCache.get(refs) : void 0;
293
+ if (cached != null && cached.size === refs.size) setIndex = cached.index;
294
+ else {
295
+ setIndex = reachabilityBuilder.intern(refs?.values());
296
+ if (refs != null) internCache.set(refs, {
297
+ size: refs.size,
298
+ index: setIndex
299
+ });
300
+ }
301
+ if (setIndex != null) (row.contexts ??= {}).reachabilityIndex = setIndex;
302
+ row.reachability = void 0;
303
+ reachableRefs.delete(sha);
304
+ }
305
+ const rowStats = /* @__PURE__ */ new Map();
306
+ let pendingRowsStatsCount = 0;
307
+ let iterations = 0;
308
+ let total = 0;
309
+ const rowProcessor = options?.rowProcessor;
310
+ const graphCtx = rowProcessor != null ? {
311
+ repoPath,
312
+ useAvatars: cfg?.graph?.avatars ?? true,
313
+ branches: branchMap,
314
+ remotes: remoteMap,
315
+ worktreesByBranch,
316
+ branchIdOfMainWorktree,
317
+ stashes: gitStash?.stashes,
318
+ reachableFromHEAD,
319
+ rewriteableFromHEAD,
320
+ tipShasWithChildren,
321
+ reachableFromHeadUpstream: headRefUpstreamName != null ? reachableFromHeadUpstream : void 0,
322
+ avatars
323
+ } : void 0;
324
+ function buildRowFromCommit(commit) {
325
+ total++;
326
+ let shaOrRemapped = remappedIds.get(commit.sha);
327
+ if (shaOrRemapped && ids.has(shaOrRemapped)) return void 0;
328
+ shaOrRemapped ??= commit.sha;
329
+ ids.add(shaOrRemapped);
330
+ const refHeads = [];
331
+ const refRemoteHeads = [];
332
+ const refTags = [];
333
+ let head = false;
334
+ let sawHead = false;
335
+ if (commit.tips) for (let tip of commit.tips.split(", ")) {
336
+ head = false;
337
+ if (tip === "refs/stash") continue;
338
+ if (tip.startsWith("tag: ")) {
339
+ const tagName = tip.substring(5);
340
+ refTags.push({
341
+ id: getTagId(repoPath, tagName),
342
+ name: tagName,
343
+ annotated: true
344
+ });
345
+ continue;
346
+ }
347
+ if (tip.startsWith("HEAD")) {
348
+ head = true;
349
+ sawHead = true;
350
+ if (tip !== "HEAD") tip = tip.substring(8);
351
+ }
352
+ const remoteName = getRemoteNameFromBranchName(tip);
353
+ if (remoteName) {
354
+ const remote = remoteMap.get(remoteName);
355
+ if (remote != null) {
356
+ const branchName = getBranchNameWithoutRemote(tip);
357
+ if (branchName === "HEAD") continue;
358
+ refRemoteHeads.push({
359
+ id: getBranchId(repoPath, true, tip),
360
+ name: branchName,
361
+ owner: remote.name,
362
+ url: remote.url,
363
+ current: tip === headRefUpstreamName,
364
+ isDefault: tip === defaultBranchName && !branchMap.has(defaultLocalName),
365
+ hostingServiceType: remote.provider?.gkProviderId,
366
+ starred: branchMap.get(tip)?.starred || void 0
367
+ });
368
+ continue;
369
+ }
370
+ }
371
+ const branch = branchMap.get(tip);
372
+ const branchId = branch?.id ?? getBranchId(repoPath, false, tip);
373
+ const worktree = worktreesByBranch?.get(branchId) ?? (branchId === branchIdOfMainWorktree ? mainWorktree : void 0);
374
+ const worktreeRef = worktree != null ? {
375
+ id: getWorktreeId(repoPath, worktree.name),
376
+ path: worktree.path,
377
+ isDefault: worktree.isDefault === true
378
+ } : void 0;
379
+ refHeads.push({
380
+ id: branchId,
381
+ name: tip,
382
+ isCurrentHead: head,
383
+ upstream: branch?.upstream != null ? {
384
+ name: branch.upstream.name,
385
+ id: getBranchId(repoPath, true, branch.upstream.name),
386
+ missing: branch.upstream.missing,
387
+ state: {
388
+ ahead: branch.upstream.state.ahead,
389
+ behind: branch.upstream.state.behind
390
+ }
391
+ } : void 0,
392
+ worktree: worktreeRef,
393
+ isDefault: defaultLocalName != null && tip === defaultLocalName,
394
+ starred: branch?.starred || void 0
395
+ });
396
+ }
397
+ const parents = commit.parents ? commit.parents.split(" ") : [];
398
+ const stash = gitStash?.stashes.get(shaOrRemapped);
399
+ let row;
400
+ if (stash != null) row = {
401
+ sha: shaOrRemapped,
402
+ parents: parents.slice(0, 1),
403
+ author: currentUser?.name ?? commit.author,
404
+ email: commit.authorEmail,
405
+ date: Number(ordering === "author-date" ? commit.authorDate : commit.committerDate) * 1e3,
406
+ commitDate: Number(commit.committerDate) * 1e3,
407
+ message: (stash.message ?? commit.message).trim(),
408
+ kind: "stash",
409
+ stashNumber: stash.stashNumber,
410
+ heads: refHeads.length ? refHeads : void 0,
411
+ remotes: refRemoteHeads.length ? refRemoteHeads : void 0,
412
+ tags: refTags.length ? refTags : void 0,
413
+ isCurrentUser: true
414
+ };
415
+ else {
416
+ const isCurrentUser = isUserMatch(currentUser, commit.author, commit.authorEmail);
417
+ row = {
418
+ sha: shaOrRemapped,
419
+ parents: onlyFollowFirstParent ? parents.slice(0, 1) : parents,
420
+ author: commit.author,
421
+ email: commit.authorEmail,
422
+ date: Number(ordering === "author-date" ? commit.authorDate : commit.committerDate) * 1e3,
423
+ commitDate: Number(commit.committerDate) * 1e3,
424
+ message: commit.message.trim(),
425
+ kind: parents.length > 1 ? "merge" : "commit",
426
+ heads: refHeads.length ? refHeads : void 0,
427
+ remotes: refRemoteHeads.length ? refRemoteHeads : void 0,
428
+ tags: refTags.length ? refTags : void 0,
429
+ isCurrentUser: isCurrentUser || void 0
430
+ };
431
+ if (commit.stats != null) rowStats.set(shaOrRemapped, commit.stats);
432
+ }
433
+ return {
434
+ row,
435
+ refHeads,
436
+ refRemoteHeads,
437
+ refTags,
438
+ head: sawHead,
439
+ parents
440
+ };
441
+ }
442
+ function accumulateRowState(sha, parents, refHeads, refRemoteHeads, refTags, head, isStash) {
443
+ if (head) {
444
+ reachableFromHEAD.add(sha);
445
+ headSha ??= sha;
446
+ }
447
+ if (reachableFromHEAD.has(sha)) for (const parent of parents) reachableFromHEAD.add(parent);
448
+ if (sha === headSha || sha === rewriteableNextSha) {
449
+ if (parents.length === 1) {
450
+ rewriteableFromHEAD.add(sha);
451
+ rewriteableNextSha = parents[0];
452
+ } else rewriteableNextSha = void 0;
453
+ }
454
+ if (refRemoteHeads.some((r) => r.current)) reachableFromHeadUpstream.add(sha);
455
+ if (reachableFromHeadUpstream.has(sha)) for (const parent of parents) reachableFromHeadUpstream.add(parent);
456
+ if (refHeads.length > 0 || refRemoteHeads.length > 0 || refTags.length > 0) {
457
+ let refs = reachableRefs.get(sha);
458
+ if (refs == null) {
459
+ refs = /* @__PURE__ */ new Map();
460
+ reachableRefs.set(sha, refs);
461
+ }
462
+ for (const h of refHeads) refs.set(`b:${h.name}`, {
463
+ refType: "branch",
464
+ name: h.name,
465
+ remote: false,
466
+ current: h.isCurrentHead
467
+ });
468
+ for (const r of refRemoteHeads) {
469
+ const name = `${r.owner}/${r.name}`;
470
+ refs.set(`r:${name}`, {
471
+ refType: "branch",
472
+ name,
473
+ remote: true
474
+ });
475
+ }
476
+ for (const t of refTags) refs.set(`t:${t.name}`, {
477
+ refType: "tag",
478
+ name: t.name
479
+ });
480
+ }
481
+ const currentRefs = reachableRefs.get(sha);
482
+ if (currentRefs != null && currentRefs.size > 0) {
483
+ let transferred = false;
484
+ for (const parent of parents) {
485
+ const parentRefs = reachableRefs.get(parent);
486
+ if (parentRefs == null) {
487
+ if (transferred) reachableRefs.set(parent, new Map(currentRefs));
488
+ else {
489
+ transferred = true;
490
+ reachableRefs.set(parent, currentRefs);
491
+ }
492
+ continue;
493
+ }
494
+ for (const [key, ref] of currentRefs) if (!parentRefs.has(key)) parentRefs.set(key, ref);
495
+ }
496
+ }
497
+ if (!isStash) {
498
+ for (const parent of parents) if (undoableTipShas.has(parent)) tipShasWithChildren.add(parent);
499
+ }
500
+ for (const h of refHeads) if (h.upstream?.name != null) {
501
+ let downstreams = downstreamMap.get(h.upstream.name);
502
+ if (downstreams == null) {
503
+ downstreams = [];
504
+ downstreamMap.set(h.upstream.name, downstreams);
505
+ }
506
+ downstreams.push(h.name);
507
+ }
508
+ return reachableRefs.get(sha);
509
+ }
510
+ const buildRowsStatsDeferred = (rows) => {
511
+ if (!deferStats) return void 0;
512
+ pendingRowsStatsCount++;
513
+ return {
514
+ isLoaded: () => pendingRowsStatsCount === 0,
515
+ promise: new Promise(async (resolve) => {
516
+ try {
517
+ let missingStdin = "";
518
+ let missingStashStdin = "";
519
+ for (const row of rows) {
520
+ if (rowStats.has(row.sha)) continue;
521
+ const seeded = rowsStatsSeed?.get(row.sha);
522
+ if (seeded != null) {
523
+ rowStats.set(row.sha, seeded);
524
+ continue;
525
+ }
526
+ if (row.kind === "stash") missingStashStdin += `${row.sha}\n`;
527
+ else missingStdin += `${row.sha}\n`;
528
+ }
529
+ if (!missingStdin && !missingStashStdin) return;
530
+ const [statsResult, stashStatsResult] = await Promise.allSettled([missingStdin ? this.git.run({
531
+ cwd: repoPath,
532
+ configs: gitConfigsLog,
533
+ stdin: missingStdin,
534
+ priority: "background"
535
+ }, "log", "--no-walk", "--stdin", ...statsParser.arguments, "--") : void 0, missingStashStdin ? this.git.run({
536
+ cwd: repoPath,
537
+ configs: gitConfigsLog,
538
+ stdin: missingStashStdin,
539
+ priority: "background"
540
+ }, "log", "--no-walk", "--stdin", "-m", "--first-parent", ...statsParser.arguments, "--") : void 0]);
541
+ for (const result of [getSettledValue(statsResult), getSettledValue(stashStatsResult)]) {
542
+ if (!result?.stdout) continue;
543
+ for (const stat of statsParser.parse(result.stdout)) {
544
+ if (rowStats.has(stat.sha)) continue;
545
+ rowStats.set(stat.sha, stat.stats);
546
+ }
547
+ }
548
+ } finally {
549
+ pendingRowsStatsCount--;
550
+ resolve();
551
+ }
552
+ })
553
+ };
554
+ };
555
+ const args = [
556
+ "log",
557
+ ...parser.arguments,
558
+ `--${ordering}-order`,
559
+ "--all"
560
+ ];
561
+ if (stdin) args.push("--stdin");
562
+ if (onlyFollowFirstParent) args.push("--first-parent");
563
+ async function getCommitsForGraphCore(limit, sha, cursor, cancellation) {
564
+ try {
565
+ try {
566
+ var _usingCtx$1 = _usingCtx();
567
+ iterations++;
568
+ const prespawned = cursor == null && prespawn != null ? await prespawn : void 0;
569
+ prespawn = void 0;
570
+ const aborter = prespawned != null ? prespawnAborter : new AbortController();
571
+ const onAbort = () => {
572
+ aborter.abort();
573
+ };
574
+ cancellation?.addEventListener("abort", onAbort, { once: true });
575
+ if (cancellation?.aborted) onAbort();
576
+ _usingCtx$1.u(createDisposable(() => cancellation?.removeEventListener("abort", onAbort)));
577
+ const stream = prespawned?.stream ?? this.git.stream({
578
+ cwd: repoPath,
579
+ configs: gitConfigsLog,
580
+ cancellation: aborter.signal,
581
+ stdin,
582
+ env: { GIT_FLUSH: "0" }
583
+ }, ...args, cursor?.skip ? `--skip=${cursor.skip}` : void 0, "--");
584
+ _usingCtx$1.u(createDisposable(() => void stream.return?.(void 0)));
585
+ const rows = [];
586
+ let count = 0;
587
+ let found = false;
588
+ let hasMore = false;
589
+ const batches = parser.parseAsyncBatched?.(stream) ?? (async function* (it) {
590
+ for await (const commit of it) yield [commit];
591
+ })(parser.parseAsync(stream));
592
+ outer: for await (const batch of batches) for (const commit of batch) {
593
+ if (limit && count >= limit && (!sha || found || count >= limit * 10) || !limit && sha && found) {
594
+ hasMore = true;
595
+ aborter.abort();
596
+ break outer;
597
+ }
598
+ if (sha && !found && commit.sha === sha) found = true;
599
+ count++;
600
+ if (ids.has(commit.sha)) continue;
601
+ const built = buildRowFromCommit(commit);
602
+ if (built == null) continue;
603
+ const { row, refHeads, refRemoteHeads, refTags, head, parents } = built;
604
+ const refs = accumulateRowState(row.sha, parents, refHeads, refRemoteHeads, refTags, head, row.kind === "stash");
605
+ row.reachability = refs?.size ? {
606
+ partial: true,
607
+ refs: [...refs.values()]
608
+ } : void 0;
609
+ rowProcessor?.processRow(row, graphCtx);
610
+ finalizeRowReachability(row, row.sha, refs);
611
+ rows.push(row);
612
+ }
613
+ const startingCursor = cursor?.sha;
614
+ const lastSha = last(ids);
615
+ cursor = lastSha != null ? {
616
+ sha: lastSha,
617
+ skip: total - iterations
618
+ } : void 0;
619
+ const rowsStatsDeferred = buildRowsStatsDeferred(rows);
620
+ return {
621
+ repoPath,
622
+ avatars,
623
+ ids,
624
+ includes: options?.include,
625
+ branches: branchMap,
626
+ remotes: remoteMap,
627
+ downstreams: downstreamMap,
628
+ stashes: gitStash?.stashes,
629
+ worktrees,
630
+ worktreesByBranch,
631
+ reachableFromHEAD,
632
+ rewriteableFromHEAD,
633
+ reachability: reachabilityBuilder.build(),
634
+ refTips,
635
+ decorationFingerprint,
636
+ shallowBoundary,
637
+ rows,
638
+ id: sha ?? rev,
639
+ rowsStats: rowStats,
640
+ rowsStatsDeferred,
641
+ paging: {
642
+ limit: limit === 0 ? count : limit,
643
+ startingCursor,
644
+ hasMore
645
+ },
646
+ more: async (limit, sha, cancellation) => getCommitsForGraphCore.call(this, limit, sha, cursor, cancellation)
647
+ };
648
+ } catch (_) {
649
+ _usingCtx$1.e = _;
650
+ } finally {
651
+ _usingCtx$1.d();
652
+ }
653
+ } catch (ex) {
654
+ scope?.error(ex);
655
+ debugger;
656
+ throw ex;
657
+ }
658
+ }
659
+ let incrementalFallbackReason;
660
+ const tryIncrementalGraph = async (seed) => {
661
+ const onResult = options?.onIncrementalResult;
662
+ const rebindFromRepoPath = options?.rebindFromRepoPath;
663
+ const fallback = (reason) => {
664
+ incrementalFallbackReason = reason;
665
+ onResult?.({
666
+ path: "fallback",
667
+ reason
668
+ });
669
+ };
670
+ if (ancestryChange != null) {
671
+ fallback(ancestryChange);
672
+ return;
673
+ }
674
+ if (rowProcessor == null || graphCtx == null) {
675
+ fallback("no-row-processor");
676
+ return;
677
+ }
678
+ if (ordering !== "date" || seed.ordering !== "date") {
679
+ fallback("ordering-not-date");
680
+ return;
681
+ }
682
+ const seedShas = new Set(seed.rows.map((r) => r.sha));
683
+ if (rev != null && !seedShas.has(rev)) {
684
+ fallback("rev-outside-seed");
685
+ return;
686
+ }
687
+ if (onlyFollowFirstParent || seed.onlyFollowFirstParent) {
688
+ fallback("first-parent");
689
+ return;
690
+ }
691
+ const currentHeadSha = rev == null ? selectSha : headBranch?.sha;
692
+ const currentTips = refTips;
693
+ const affected = /* @__PURE__ */ new Set();
694
+ const ffPairs = [];
695
+ const addTrackingBranchRows = (remoteRefname) => {
696
+ if (branches == null || !remoteRefname.startsWith("refs/remotes/")) return;
697
+ const upstreamName = remoteRefname.substring(13);
698
+ for (const b of branches) if (b.upstream?.name === upstreamName && b.sha != null && seedShas.has(b.sha)) affected.add(b.sha);
699
+ };
700
+ for (const [refname, oldSha] of seed.tips) {
701
+ if (!isMoveableGraphRef(refname)) continue;
702
+ const cur = currentTips.get(refname);
703
+ if (cur == null) {
704
+ fallback("ref-deleted");
705
+ return;
706
+ }
707
+ if (cur !== oldSha) {
708
+ ffPairs.push([oldSha, cur]);
709
+ if (seedShas.has(oldSha)) affected.add(oldSha);
710
+ if (seedShas.has(cur)) affected.add(cur);
711
+ addTrackingBranchRows(refname);
712
+ }
713
+ }
714
+ for (const [refname, cur] of currentTips) {
715
+ if (!isMoveableGraphRef(refname) || seed.tips.has(refname)) continue;
716
+ if (seedShas.has(cur)) affected.add(cur);
717
+ addTrackingBranchRows(refname);
718
+ }
719
+ if (ffPairs.length > 0) {
720
+ const ffCheckChunkSize = 4;
721
+ for (let i = 0; i < ffPairs.length; i += ffCheckChunkSize) if ((await Promise.all(ffPairs.slice(i, i + ffCheckChunkSize).map(([oldSha, newSha]) => this.isFastForward(repoPath, oldSha, newSha, cancellation)))).some((ok) => !ok)) {
722
+ fallback("ref-non-fast-forward");
723
+ return;
724
+ }
725
+ }
726
+ const priorHeadRow = seed.rows.find((r) => r.heads?.some((h) => h.isCurrentHead));
727
+ const priorHeadSha = priorHeadRow?.sha;
728
+ const priorHeadName = priorHeadRow?.heads?.find((h) => h.isCurrentHead)?.name;
729
+ const currentHeadName = headBranch?.name;
730
+ if (priorHeadSha !== currentHeadSha || priorHeadName !== currentHeadName) {
731
+ if (priorHeadSha != null && seedShas.has(priorHeadSha)) affected.add(priorHeadSha);
732
+ if (currentHeadSha != null && seedShas.has(currentHeadSha)) affected.add(currentHeadSha);
733
+ }
734
+ const currentStashShas = gitStash?.stashes != null ? new Set(gitStash.stashes.keys()) : /* @__PURE__ */ new Set();
735
+ const priorStashShas = seed.rows.filter((r) => r.kind === "stash").map((r) => r.sha);
736
+ if (priorStashShas.length !== currentStashShas.size || priorStashShas.some((s) => !currentStashShas.has(s))) {
737
+ fallback("stash-changed");
738
+ return;
739
+ }
740
+ const seedComparableFingerprint = rebindFromRepoPath != null ? computeDecorationFingerprint(rebindFromRepoPath, defaultBranchName, defaultLocalName, seed.headRefUpstreamName, branches, remotes, worktrees, currentUser) : decorationFingerprint;
741
+ if (seed.decorationFingerprint !== seedComparableFingerprint) {
742
+ fallback("metadata-changed");
743
+ return;
744
+ }
745
+ if (rebindFromRepoPath != null) {
746
+ const defaultWorktree = worktrees.find((w) => w.isDefault);
747
+ if (rebindFromRepoPath === defaultWorktree?.path) {
748
+ if (priorHeadName !== defaultWorktree.branch?.name) {
749
+ fallback("metadata-changed");
750
+ return;
751
+ }
752
+ }
753
+ }
754
+ for (const r of seed.rows) {
755
+ if (r.heads == null) continue;
756
+ for (const h of r.heads) {
757
+ const currentBranch = branchMap.get(h.name);
758
+ if (currentBranch == null) continue;
759
+ if (h.upstream?.name !== currentBranch.upstream?.name) {
760
+ fallback("metadata-changed");
761
+ return;
762
+ }
763
+ }
764
+ }
765
+ const notShas = new Set(seed.tips.values());
766
+ for (const s of currentStashShas) notShas.add(s);
767
+ let exclusionsStdin = "";
768
+ for (const s of notShas) exclusionsStdin += `^${s}\n`;
769
+ const enumResult = await this.git.run({
770
+ cwd: repoPath,
771
+ configs: gitConfigsLog,
772
+ cancellation,
773
+ stdin: exclusionsStdin
774
+ }, "log", ...parser.arguments, "--date-order", "--all", "--stdin", "--");
775
+ const newCommits = [...parser.parse(enumResult.stdout)];
776
+ let maxSeedDate = Number.NEGATIVE_INFINITY;
777
+ for (const r of seed.rows) if (r.date > maxSeedDate) maxSeedDate = r.date;
778
+ for (const c of newCommits) if (Number(c.committerDate) * 1e3 <= maxSeedDate) {
779
+ fallback("date-boundary");
780
+ return;
781
+ }
782
+ const stitchedSize = newCommits.length + seed.rows.length;
783
+ const seedHasMore = seed.hasMore === true;
784
+ const noLimit = defaultLimit === 0;
785
+ const revWindowIndex = rev != null ? newCommits.length + seed.rows.findIndex((r) => r.sha === rev) : -1;
786
+ const targetRows = rev != null ? noLimit ? revWindowIndex + 1 : Math.max(defaultLimit, revWindowIndex + 1) : defaultLimit;
787
+ if ((rev != null ? targetRows > stitchedSize : noLimit || defaultLimit > stitchedSize) && seedHasMore) {
788
+ fallback("limit-exceeds-seed");
789
+ return;
790
+ }
791
+ const trimTo = rev != null ? Math.min(targetRows, stitchedSize) : noLimit ? stitchedSize : Math.min(defaultLimit, stitchedSize);
792
+ const hasMore = trimTo < stitchedSize || seedHasMore;
793
+ if (currentStashShas.size > 0 && hasMore) {
794
+ fallback("stash-window-conflict");
795
+ return;
796
+ }
797
+ const newRows = [];
798
+ for (const c of newCommits) {
799
+ const built = buildRowFromCommit(c);
800
+ if (built != null) newRows.push(built.row);
801
+ }
802
+ const refetched = /* @__PURE__ */ new Map();
803
+ if (affected.size > 0) {
804
+ const refetchResult = await this.git.run({
805
+ cwd: repoPath,
806
+ configs: gitConfigsLog,
807
+ cancellation,
808
+ stdin: join(affected, "\n")
809
+ }, "log", ...parser.arguments, "--no-walk", "--stdin", "--");
810
+ for (const c of parser.parse(refetchResult.stdout)) {
811
+ const built = buildRowFromCommit(c);
812
+ if (built != null) refetched.set(built.row.sha, built.row);
813
+ }
814
+ }
815
+ const freshShas = /* @__PURE__ */ new Set([...newRows.map((r) => r.sha), ...refetched.keys()]);
816
+ const windowRows = [...newRows];
817
+ for (const r of seed.rows) windowRows.push(refetched.get(r.sha) ?? r);
818
+ windowRows.length = Math.min(windowRows.length, trimTo);
819
+ ids.clear();
820
+ total = 0;
821
+ for (const row of windowRows) {
822
+ ids.add(row.sha);
823
+ total++;
824
+ const fresh = freshShas.has(row.sha);
825
+ if (!fresh) options?.onMutationStart?.();
826
+ if (rebindFromRepoPath != null && !fresh && row.remotes != null) for (const remoteHead of row.remotes) remoteHead.current = `${remoteHead.owner}/${remoteHead.name}` === headRefUpstreamName;
827
+ const refs = accumulateRowState(row.sha, row.parents, row.heads ?? [], row.remotes ?? [], row.tags ?? [], row.sha === currentHeadSha, row.kind === "stash");
828
+ if (fresh) {
829
+ row.reachability = refs?.size ? {
830
+ partial: true,
831
+ refs: [...refs.values()]
832
+ } : void 0;
833
+ rowProcessor.processRow(row, graphCtx);
834
+ } else if (rebindFromRepoPath != null && restampGraphRowIds(row, rebindFromRepoPath, repoPath)) rowProcessor.restampRow?.(row, graphCtx);
835
+ if (row.kind !== "stash") (row.contexts ??= {}).flags = computeGraphRowContextFlags(row.sha, refs?.values(), graphCtx);
836
+ finalizeRowReachability(row, row.sha, refs);
837
+ }
838
+ iterations = 1;
839
+ const lastSha = last(ids);
840
+ const cursor = lastSha != null ? {
841
+ sha: lastSha,
842
+ skip: total - iterations
843
+ } : void 0;
844
+ const rowsStatsDeferred = buildRowsStatsDeferred(windowRows);
845
+ onResult?.({
846
+ path: "fast",
847
+ added: newRows.length
848
+ });
849
+ return {
850
+ repoPath,
851
+ avatars,
852
+ ids,
853
+ includes: options?.include,
854
+ branches: branchMap,
855
+ remotes: remoteMap,
856
+ downstreams: downstreamMap,
857
+ stashes: gitStash?.stashes,
858
+ worktrees,
859
+ worktreesByBranch,
860
+ reachableFromHEAD,
861
+ rewriteableFromHEAD,
862
+ reachability: reachabilityBuilder.build(),
863
+ refTips,
864
+ decorationFingerprint,
865
+ shallowBoundary,
866
+ rows: windowRows,
867
+ id: selectSha ?? rev,
868
+ rowsStats: rowStats,
869
+ rowsStatsDeferred,
870
+ paging: {
871
+ limit: noLimit ? total : defaultLimit,
872
+ startingCursor: void 0,
873
+ hasMore
874
+ },
875
+ more: async (limit, sha, cancellation) => getCommitsForGraphCore.call(this, limit, sha, cursor, cancellation)
876
+ };
877
+ };
878
+ if (options?.incrementalSeed != null) {
879
+ let fast;
880
+ try {
881
+ fast = await tryIncrementalGraph(options.incrementalSeed);
882
+ } catch (ex) {
883
+ if (isCancellationError(ex) || cancellation?.aborted) throw ex;
884
+ ids.clear();
885
+ total = 0;
886
+ iterations = 0;
887
+ rowStats.clear();
888
+ avatars.clear();
889
+ reachableFromHEAD.clear();
890
+ rewriteableFromHEAD.clear();
891
+ reachableFromHeadUpstream.clear();
892
+ reachableRefs.clear();
893
+ tipShasWithChildren.clear();
894
+ downstreamMap.clear();
895
+ headSha = void 0;
896
+ rewriteableNextSha = void 0;
897
+ scope?.warn(`incremental graph walk failed; falling back to full walk; ${String(ex)}`);
898
+ incrementalFallbackReason = "error";
899
+ options.onIncrementalResult?.({
900
+ path: "fallback",
901
+ reason: "error"
902
+ });
903
+ }
904
+ if (fast != null) {
905
+ this.provider.maintenance?.request(repoPath, "commit-graph");
906
+ return fast;
907
+ }
908
+ if (incrementalFallbackReason === "error") rowsStatsSeed = void 0;
909
+ }
910
+ let graph = await getCommitsForGraphCore.call(this, defaultLimit, selectSha, void 0, cancellation);
911
+ if (graph.rows.length === 0 && branches?.length && !cancellation?.aborted) {
912
+ scope?.warn(`graph returned 0 rows but repo has ${branches.length} branches; retrying`);
913
+ graph = await getCommitsForGraphCore.call(this, defaultLimit, selectSha, void 0, cancellation);
914
+ }
915
+ this.provider.maintenance?.request(repoPath, "commit-graph");
916
+ return graph;
917
+ }
918
+ async *searchGraph(repoPath, search, options, cancellation) {
919
+ return yield* this.searchGraphCore(repoPath, search, void 0, void 0, options, cancellation);
920
+ }
921
+ async *continueSearchGraph(repoPath, cursor, existingResults, options, cancellation) {
922
+ return yield* this.searchGraphCore(repoPath, cursor.search, cursor, existingResults, options, cancellation);
923
+ }
924
+ /**
925
+ * Cheap commit count for `search`, no result materialization — used to probe a candidate relaxed
926
+ * query before offering it. Never throws: any failure (including a sha-only `commit:` query, which
927
+ * can't be meaningfully "relaxed") returns 0, since this is a probe, not a search.
928
+ */
929
+ async countSearchResults(repoPath, search, options, cancellation) {
930
+ try {
931
+ search = {
932
+ matchAll: false,
933
+ matchCase: false,
934
+ matchRegex: true,
935
+ matchWholeWord: false,
936
+ ...search
937
+ };
938
+ const currentUser = search.query.includes("@me") ? await this.provider.config.getCurrentUser(repoPath) : void 0;
939
+ const { args: searchArgs, files, shas, filters } = parseSearchQueryGitCommand(search, currentUser);
940
+ if (shas?.size) return 0;
941
+ if (filters.type === "merge") {
942
+ const allIndex = searchArgs.indexOf("--all");
943
+ if (allIndex !== -1) searchArgs.splice(allIndex, 0, "--exclude=refs/stash");
944
+ }
945
+ const maxCount = options?.maxCount ?? 1e3;
946
+ const result = await this.git.run({
947
+ cwd: repoPath,
948
+ configs: gitConfigsLog,
949
+ cancellation,
950
+ errors: "ignore"
951
+ }, "rev-list", "--count", `--max-count=${maxCount}`, ...searchArgs, "--", ...files);
952
+ const count = Number.parseInt(result.stdout.trim(), 10);
953
+ return Number.isFinite(count) ? count : 0;
954
+ } catch {
955
+ return 0;
956
+ }
957
+ }
958
+ async *searchGraphCore(repoPath, search, cursor, existingResults, options, cancellation) {
959
+ search = {
960
+ matchAll: false,
961
+ matchCase: false,
962
+ matchRegex: true,
963
+ matchWholeWord: false,
964
+ ...search
965
+ };
966
+ const comparisonKey = getSearchQueryComparisonKey(search);
967
+ try {
968
+ const currentUser = search.query.includes("@me") ? await this.provider.config.getCurrentUser(repoPath) : void 0;
969
+ const { args: searchArgs, files, shas, filters } = parseSearchQueryGitCommand(search, currentUser);
970
+ const tipsOnly = filters.type === "tip";
971
+ const mergesOnly = searchArgs.includes("--merges");
972
+ const parser = filters.files ? getShaAndDatesWithFilesLogParser(tipsOnly) : getShaAndDatesLogParser(tipsOnly);
973
+ const similarityThreshold = this.context.config?.commits.similarityThreshold ?? void 0;
974
+ const args = [
975
+ "log",
976
+ ...parser.arguments,
977
+ `-M${similarityThreshold == null ? "" : `${similarityThreshold}%`}`,
978
+ "--use-mailmap"
979
+ ];
980
+ let stashes;
981
+ let stdin;
982
+ let remappedIds;
983
+ let resolvedShas;
984
+ if (shas?.size) {
985
+ resolvedShas = await this.provider.revision.resolveShas(repoPath, shas, cancellation);
986
+ if (cancellation?.aborted) return {
987
+ repoPath,
988
+ query: search,
989
+ queryFilters: filters,
990
+ comparisonKey,
991
+ results: existingResults ?? /* @__PURE__ */ new Map(),
992
+ hasMore: true
993
+ };
994
+ if (!resolvedShas.size) return {
995
+ repoPath,
996
+ query: search,
997
+ queryFilters: filters,
998
+ comparisonKey,
999
+ results: existingResults ?? /* @__PURE__ */ new Map(),
1000
+ hasMore: false
1001
+ };
1002
+ }
1003
+ if (resolvedShas?.size) {
1004
+ stdin = join(resolvedShas, "\n");
1005
+ args.push("--no-walk");
1006
+ remappedIds = /* @__PURE__ */ new Map();
1007
+ } else if (!filters.refs) {
1008
+ const converted = convertStashesToStdin(await this.provider.stash?.getStash(repoPath, { includeFiles: false }, cancellation));
1009
+ stashes = converted.stashes;
1010
+ remappedIds = converted.remappedIds;
1011
+ stdin = mergesOnly ? void 0 : converted.stdin;
1012
+ } else if (mergesOnly) {
1013
+ const converted = convertStashesToStdin(await this.provider.stash?.getStash(repoPath, { includeFiles: false }, cancellation));
1014
+ stashes = converted.stashes;
1015
+ remappedIds = converted.remappedIds;
1016
+ } else remappedIds = /* @__PURE__ */ new Map();
1017
+ if (stdin) args.push("--stdin");
1018
+ const limit = options?.limit ?? this.context.config?.graph?.maxSearchItems ?? 0;
1019
+ const ordering = options?.ordering ?? this.context.config?.commits.ordering ?? void 0;
1020
+ if (ordering) args.push(`--${ordering}-order`);
1021
+ for (const arg of searchArgs) {
1022
+ if (shas?.has(arg) || args.includes(arg)) continue;
1023
+ args.push(arg);
1024
+ }
1025
+ const results = existingResults ?? /* @__PURE__ */ new Map();
1026
+ const cursorState = cursor?.state != null && typeof cursor.state === "object" ? cursor.state : void 0;
1027
+ let iterations = cursorState?.iterations ?? 0;
1028
+ let totalSeen = cursorState?.totalSeen ?? 0;
1029
+ let skipCursor = cursorState ? {
1030
+ sha: cursorState.sha,
1031
+ skip: cursorState.skip
1032
+ } : void 0;
1033
+ let count = 0;
1034
+ try {
1035
+ try {
1036
+ var _usingCtx3 = _usingCtx();
1037
+ iterations++;
1038
+ const aborter = new AbortController();
1039
+ const onAbort = () => {
1040
+ aborter.abort();
1041
+ };
1042
+ cancellation?.addEventListener("abort", onAbort, { once: true });
1043
+ if (cancellation?.aborted) onAbort();
1044
+ _usingCtx3.u(createDisposable(() => cancellation?.removeEventListener("abort", onAbort)));
1045
+ const stream = this.git.stream({
1046
+ cwd: repoPath,
1047
+ cancellation: aborter.signal,
1048
+ configs: [
1049
+ "-C",
1050
+ repoPath,
1051
+ ...gitConfigsLog
1052
+ ],
1053
+ stdin
1054
+ }, ...args, skipCursor?.skip ? `--skip=${skipCursor.skip}` : void 0, "--", ...files);
1055
+ _usingCtx3.u(createDisposable(() => void stream.return?.(void 0)));
1056
+ let hasMore = false;
1057
+ let sha;
1058
+ const stashesOnly = filters.type === "stash";
1059
+ const batch = [];
1060
+ let lastProgressTime = Date.now();
1061
+ for await (const r of parser.parseAsync(stream)) {
1062
+ if (cancellation?.aborted) {
1063
+ hasMore = true;
1064
+ break;
1065
+ }
1066
+ count++;
1067
+ if (limit && count > limit) {
1068
+ hasMore = true;
1069
+ aborter.abort();
1070
+ break;
1071
+ }
1072
+ sha = remappedIds.get(r.sha) ?? r.sha;
1073
+ if (results.has(sha) || stashesOnly && !stashes?.has(sha) || mergesOnly && stashes?.has(sha) || tipsOnly && !r.tips) continue;
1074
+ const resultData = {
1075
+ i: results.size,
1076
+ date: Number(options?.ordering === "author-date" ? r.authorDate : r.committerDate) * 1e3,
1077
+ files: r.files
1078
+ };
1079
+ results.set(sha, resultData);
1080
+ batch.push([sha, resultData]);
1081
+ if (Date.now() - lastProgressTime >= progressiveSearchResultsBatchTimeMs && batch.length > 0) {
1082
+ yield {
1083
+ repoPath,
1084
+ query: search,
1085
+ queryFilters: filters,
1086
+ comparisonKey,
1087
+ results: new Map(batch),
1088
+ runningTotal: results.size,
1089
+ hasMore: true
1090
+ };
1091
+ batch.length = 0;
1092
+ lastProgressTime = Date.now();
1093
+ }
1094
+ }
1095
+ if (batch.length) yield {
1096
+ repoPath,
1097
+ query: search,
1098
+ queryFilters: filters,
1099
+ comparisonKey,
1100
+ results: new Map(batch),
1101
+ runningTotal: results.size,
1102
+ hasMore
1103
+ };
1104
+ totalSeen += count;
1105
+ const lastSha = last(results)?.[0];
1106
+ skipCursor = lastSha != null ? {
1107
+ sha: lastSha,
1108
+ skip: totalSeen - iterations
1109
+ } : void 0;
1110
+ return {
1111
+ repoPath,
1112
+ query: search,
1113
+ queryFilters: filters,
1114
+ comparisonKey,
1115
+ results,
1116
+ hasMore,
1117
+ paging: limit || hasMore ? {
1118
+ limit: limit || count,
1119
+ cursor: hasMore && skipCursor ? {
1120
+ search,
1121
+ state: {
1122
+ iterations,
1123
+ totalSeen,
1124
+ sha: skipCursor.sha,
1125
+ skip: skipCursor.skip
1126
+ }
1127
+ } : void 0
1128
+ } : void 0
1129
+ };
1130
+ } catch (_) {
1131
+ _usingCtx3.e = _;
1132
+ } finally {
1133
+ _usingCtx3.d();
1134
+ }
1135
+ } catch (ex) {
1136
+ if (isCancellationError(ex) || cancellation?.aborted) {
1137
+ totalSeen += count;
1138
+ const lastSha = last(results)?.[0];
1139
+ const skipCursor = lastSha != null ? {
1140
+ sha: lastSha,
1141
+ skip: totalSeen - iterations
1142
+ } : void 0;
1143
+ return {
1144
+ repoPath,
1145
+ query: search,
1146
+ queryFilters: filters,
1147
+ comparisonKey,
1148
+ results,
1149
+ hasMore: true,
1150
+ paging: limit || skipCursor ? {
1151
+ limit: limit || count,
1152
+ cursor: skipCursor ? {
1153
+ search,
1154
+ state: {
1155
+ iterations,
1156
+ totalSeen,
1157
+ sha: skipCursor.sha,
1158
+ skip: skipCursor.skip
1159
+ }
1160
+ } : void 0
1161
+ } : void 0
1162
+ };
1163
+ }
1164
+ const classified = classifySearchError(ex);
1165
+ throw new GitSearchError(ex, classified?.reason, classified?.detail);
1166
+ }
1167
+ } catch (ex) {
1168
+ if (ex instanceof GitSearchError) throw ex;
1169
+ const classified = classifySearchError(ex);
1170
+ throw new GitSearchError(ex, classified?.reason, classified?.detail);
1171
+ }
1172
+ }
1173
+ };
1174
+ __decorate([debug({ args: (repoPath, rev, options) => ({
1175
+ repoPath,
1176
+ rev,
1177
+ limit: options?.limit,
1178
+ stats: options?.include?.stats,
1179
+ incrementalSeed: options?.incrementalSeed && {
1180
+ rows: options.incrementalSeed.rows.length,
1181
+ tips: options.incrementalSeed.tips.size,
1182
+ ordering: options.incrementalSeed.ordering
1183
+ },
1184
+ reachabilitySeed: options?.reachabilitySeed != null,
1185
+ rowsStatsSeed: options?.rowsStatsSeed != null,
1186
+ rebindFrom: options?.rebindFromRepoPath
1187
+ }) })], GraphGitSubProvider.prototype, "getGraph", null);
1188
+ __decorate([debug({ args: (repoPath, s, o) => ({
1189
+ repoPath,
1190
+ search: `[${s.matchAll ? "A" : ""}${s.matchCase ? "C" : ""}${s.matchRegex ? "R" : ""}${s.matchWholeWord ? "W" : ""}]: ${s.query.length > 500 ? `${s.query.substring(0, 500)}...` : s.query}`,
1191
+ options: `limit=${o?.limit}, ordering=${o?.ordering}`
1192
+ }) })], GraphGitSubProvider.prototype, "searchGraph", null);
1193
+ __decorate([debug({ args: (repoPath, c, r, o) => ({
1194
+ repoPath,
1195
+ cursor: `[${c.search.matchAll ? "A" : ""}${c.search.matchCase ? "C" : ""}${c.search.matchRegex ? "R" : ""}${c.search.matchWholeWord ? "W" : ""}]: ${c.search.query.length > 500 ? `${c.search.query.substring(0, 500)}...` : c.search.query} (continue)`,
1196
+ existingResults: `results=${r.size}`,
1197
+ options: `limit=${o?.limit}`
1198
+ }) })], GraphGitSubProvider.prototype, "continueSearchGraph", null);
1705
1199
  /**
1706
- * CLI-backed {@link GitGraphSession}: a stateful facade over {@link GraphGitSubProvider.getGraph}. It
1707
- * owns the canonical accumulated window and builds the R6b incremental seed internally (from the window,
1708
- * the prior walk's tips/reachability/stats, and the walk shape), so the host no longer mirrors loaded
1709
- * rows, stamps ref tips, or hand-assembles a seed. Behavior-neutral: `refresh`/`more` reproduce exactly
1710
- * what the host's `getState` seed construction + `setGraph` mirror maintenance + write-once avatar merge
1711
- * did.
1712
- */
1713
- class GraphSession {
1714
- provider;
1715
- repoPath;
1716
- rowProcessor;
1717
- getWalkShape;
1718
- // Assigned by `initialize` before the session is handed out; never read before then.
1719
- _current;
1720
- _window = [];
1721
- // The walk shape (`ordering|onlyFollowFirstParent`) the current window was produced under — the
1722
- // incremental seed is only valid when the NEXT walk uses the SAME shape (a graph object doesn't
1723
- // record its shape, so it's tracked here). Undefined until the first walk lands.
1724
- _buildShape;
1725
- constructor(provider, repoPath, rowProcessor, getWalkShape) {
1726
- this.provider = provider;
1727
- this.repoPath = repoPath;
1728
- this.rowProcessor = rowProcessor;
1729
- this.getWalkShape = getWalkShape;
1730
- }
1731
- get window() {
1732
- return this._window;
1733
- }
1734
- get current() {
1735
- return this._current;
1736
- }
1737
- /** First walk no seed (nothing accumulated yet), equivalent to a plain `getGraph`. */
1738
- async initialize(options, cancellation) {
1739
- const shape = this.getWalkShape();
1740
- const graph = await this.provider.getGraph(this.repoPath, options?.rev, { include: options?.include, limit: options?.limit, rowProcessor: this.rowProcessor }, cancellation);
1741
- this.applyRebuild(graph, shape);
1742
- }
1743
- async refresh(options, cancellation) {
1744
- const shape = this.getWalkShape();
1745
- const buildShape = buildShapeKey(shape);
1746
- const prior = this._current;
1747
- // Incremental head-walk seed: the FULL accumulated window + the prior walk's tips/reachability/stats,
1748
- // gated on an unchanged walk shape (a first-parent/ordering change reshapes every row's parents/order,
1749
- // so the cached rows can't be reused). Mirrors the host's former `incrementalSeed` construction and
1750
- // `_graphBuildShape` gate — the session owns the shape, so it can't be handed a lying seed. The provider
1751
- // still re-validates ordering/first-parent internally and falls back on any structural change.
1752
- const incrementalSeed = options?.rebuild !== true && prior.refTips != null && this._buildShape === buildShape
1753
- ? {
1754
- rows: this._window,
1755
- tips: prior.refTips,
1756
- ordering: shape.ordering,
1757
- reachability: prior.reachability,
1758
- rowsStats: prior.rowsStats,
1759
- hasMore: prior.paging?.hasMore ?? false,
1760
- onlyFollowFirstParent: shape.onlyFollowFirstParent,
1761
- shallow: prior.shallow,
1762
- decorationFingerprint: prior.decorationFingerprint,
1763
- }
1764
- : undefined;
1765
- let outcome;
1766
- let graph = await this.provider.getGraph(this.repoPath, options?.rev, {
1767
- include: options?.include,
1768
- limit: options?.limit,
1769
- rowProcessor: this.rowProcessor,
1770
- // Same-repo rebuild: continue the prior reachability generation (stable indices for retained
1771
- // rows) and reuse immutable per-sha stats exactly the host's former same-repo seeds.
1772
- reachabilitySeed: prior.reachability,
1773
- rowsStatsSeed: prior.rowsStats,
1774
- incrementalSeed: incrementalSeed,
1775
- onIncrementalResult: o => {
1776
- outcome = o;
1777
- },
1778
- }, cancellation);
1779
- // Host-serialization backstop: the host serializes refresh against more() per repo. Should a more() still
1780
- // land mid-refresh (`_current` swapped out from under this await), the rebuild predates that appended page
1781
- // — refresh carries newer repo truth so we still apply it, but when the accumulated window outran the
1782
- // rebuild the dropped page must re-page, not vanish. `paging.hasMore` is readonly, so re-wrap it truthful.
1783
- if (this._current !== prior && graph.paging != null && this._window.length > graph.rows.length) {
1784
- graph = { ...graph, paging: { ...graph.paging, hasMore: true } };
1785
- }
1786
- // Write-once cross-generation avatar merge (formerly in host `setGraph`): carry prior URLs forward
1787
- // into the fresh graph's map without overwriting its own entries.
1788
- mergeAvatarsForward(prior.avatars, graph.avatars);
1789
- this.applyRebuild(graph, shape);
1790
- // The full path (seeded fallback or unseeded full walk) re-derives everything → every channel changed.
1791
- // The fast path derives each channel honestly from what it actually touched — a false negative is data
1792
- // loss, so a channel is `false` only when it PROVABLY didn't change (never merely when uncertain).
1793
- if (outcome?.path === 'fast') {
1794
- const changed = {
1795
- // A head-walk always reshapes the window; the publisher's ledger diff derives the precise splice
1796
- // (including reused-row flag / reachability-index changes the re-derivation makes in place).
1797
- rows: true,
1798
- // The builder continues the prior generation (same id); a grown table means new dict/set entries
1799
- // to append. A per-row index that re-points to an EXISTING set rides the rows channel, not this.
1800
- reachability: reachabilityTableChanged(prior.reachability, graph.reachability),
1801
- // Only NEW commit shas need stats (reused rows carry seeded, already-shipped stats), and only when
1802
- // stats were requested at all. The host's deferred-completion hook re-marks this channel when the
1803
- // background query lands, so this is just the synchronous signal.
1804
- rowsStats: graph.includes?.stats === true && (outcome.added ?? 0) > 0,
1805
- // Avatars are write-once merged across generations, so the map only grows — a larger size means
1806
- // new emails. Value replacements (avatar proxy) ride the host's dedicated avatar path, not this.
1807
- avatars: graph.avatars.size !== prior.avatars.size,
1808
- // The fast path rebuilds the downstreams map from all rows; compare it against the prior.
1809
- downstreams: downstreamsChanged(prior.downstreams, graph.downstreams),
1810
- };
1811
- return { path: 'fast', added: outcome.added, changed: changed };
1812
- }
1813
- const changed = {
1814
- rows: true,
1815
- reachability: true,
1816
- rowsStats: true,
1817
- // Ties to the rowsStatsSeed drop above: these fallbacks recompute stats for shas already shipped
1818
- // (`error` included — it drops the seed too, so its recompute must be re-shipped, not dedup-skipped).
1819
- rowsStatsRecomputed: outcome?.path === 'fallback' &&
1820
- (outcome.reason === 'shallow-changed' ||
1821
- outcome.reason === 'replace-refs-changed' ||
1822
- outcome.reason === 'error'),
1823
- avatars: true,
1824
- downstreams: true,
1825
- };
1826
- // A seeded fallback carries its reason; an unseeded full walk (no `onIncrementalResult` fired) carries none.
1827
- if (outcome?.path === 'fallback')
1828
- return { path: 'full', reason: outcome.reason, changed: changed };
1829
- return { path: 'full', changed: changed };
1830
- }
1831
- async more(limit, targetId, cancellation) {
1832
- const prior = this._current;
1833
- const updated = await prior.more?.(limit ?? 0, targetId, cancellation);
1834
- // A refresh swapped `current` out from under the page walk (stale generation) — benign; drop it and
1835
- // the host re-requests on the next scroll.
1836
- if (this._current !== prior)
1837
- return false;
1838
- // A live page walk yielding nothing is unexpected (hasMore said otherwise).
1839
- if (updated == null) {
1840
- debugger;
1841
- return false;
1842
- }
1843
- mergeAvatarsForward(prior.avatars, updated.avatars);
1844
- this.applyPage(updated);
1845
- return true;
1846
- }
1847
- dispose() {
1848
- // No-op the window lives entirely in memory and dies with the session.
1849
- }
1850
- /** A cursor-less rebuild (full walk / fast path) IS the full window. */
1851
- applyRebuild(graph, shape) {
1852
- this._current = graph;
1853
- this._window = graph.rows;
1854
- this._buildShape = buildShapeKey(shape);
1855
- }
1856
- /** A page-append: keep the window up to the cursor and append the page (the reducer's cursor-anchored
1857
- * concatenation); the walk shape is unchanged (same generation). */
1858
- applyPage(page) {
1859
- this._current = page;
1860
- const startingCursor = page.paging?.startingCursor;
1861
- // A page always carries a cursor; a cursor-less page (shouldn't happen) is treated as a full window,
1862
- // matching the host mirror's former fallback.
1863
- this._window = startingCursor == null ? page.rows : appendRowsAtCursor(this._window, startingCursor, page.rows);
1864
- }
1865
- }
1200
+ * CLI-backed {@link GitGraphSession}: a stateful facade over {@link GraphGitSubProvider.getGraph}. It
1201
+ * owns the canonical accumulated window and builds the R6b incremental seed internally (from the window,
1202
+ * the prior walk's tips/reachability/stats, and the walk shape), so the host no longer mirrors loaded
1203
+ * rows, stamps ref tips, or hand-assembles a seed. Behavior-neutral: `refresh`/`more` reproduce exactly
1204
+ * what the host's `getState` seed construction + `setGraph` mirror maintenance + write-once avatar merge
1205
+ * did.
1206
+ */
1207
+ var GraphSession = class {
1208
+ provider;
1209
+ _repoPath;
1210
+ rowProcessor;
1211
+ getWalkShape;
1212
+ _current;
1213
+ _window = [];
1214
+ _buildShape;
1215
+ _rebindMutationStarted = false;
1216
+ constructor(provider, _repoPath, rowProcessor, getWalkShape) {
1217
+ this.provider = provider;
1218
+ this._repoPath = _repoPath;
1219
+ this.rowProcessor = rowProcessor;
1220
+ this.getWalkShape = getWalkShape;
1221
+ }
1222
+ /** The CURRENT bound path — the repo the session was opened for, or the worktree {@link rebind} last
1223
+ * moved it onto. Mutable internally ONLY through `rebind`, which re-walks the window at the new path. */
1224
+ get repoPath() {
1225
+ return this._repoPath;
1226
+ }
1227
+ get window() {
1228
+ return this._window;
1229
+ }
1230
+ /** See {@link GitGraphSession.tainted} — owned by the write queue, raised by `rebindCore`'s failure
1231
+ * path and cleared by the rebuild that repairs it. */
1232
+ get tainted() {
1233
+ return this.writes.tainted;
1234
+ }
1235
+ get current() {
1236
+ return this._current;
1237
+ }
1238
+ /**
1239
+ * First walk — no seed (nothing accumulated yet), equivalent to a plain `getGraph`.
1240
+ *
1241
+ * Deliberately NOT queued through {@link writes}: `openGraphSession` awaits this before it returns the
1242
+ * session, so no caller can hold a reference yet and there is nothing to race with.
1243
+ */
1244
+ async initialize(options, cancellation) {
1245
+ const shape = this.getWalkShape();
1246
+ const graph = await this.provider.getGraph(this.repoPath, options?.rev, {
1247
+ include: options?.include,
1248
+ limit: options?.limit,
1249
+ rowProcessor: this.rowProcessor
1250
+ }, cancellation);
1251
+ this.applyRebuild(graph, shape);
1252
+ }
1253
+ /**
1254
+ * The shared serialization + generation machinery — see {@link GraphSessionWriteQueue}, which owns the
1255
+ * contract so this implementation and the GitHub one cannot drift apart on it. Every mutating op below
1256
+ * goes through it; `initialize` is the one exception (see there).
1257
+ */
1258
+ writes = new GraphSessionWriteQueue();
1259
+ refresh(options, cancellation) {
1260
+ return this.writes.run(() => this.refreshCore(options, void 0, cancellation));
1261
+ }
1262
+ rebind(repoPath, cancellation) {
1263
+ return this.writes.run(() => this.rebindCore(repoPath, cancellation));
1264
+ }
1265
+ /** {@link rebind}'s body inside the exclusive chain, so `_repoPath` here is the binding a queued
1266
+ * predecessor left behind, not the one that was live when the caller asked. */
1267
+ async rebindCore(repoPath, cancellation) {
1268
+ if (repoPath === this._repoPath) return {
1269
+ path: "fast",
1270
+ added: 0,
1271
+ changed: {
1272
+ rows: false,
1273
+ reachability: false,
1274
+ rowsStats: false,
1275
+ avatars: false,
1276
+ downstreams: false
1277
+ }
1278
+ };
1279
+ const fromRepoPath = this._repoPath;
1280
+ this._repoPath = repoPath;
1281
+ this._rebindMutationStarted = false;
1282
+ try {
1283
+ return await this.refreshCore(this.computeWindowAnchor(), fromRepoPath, cancellation);
1284
+ } catch (ex) {
1285
+ this._repoPath = fromRepoPath;
1286
+ if (this._rebindMutationStarted) {
1287
+ this._buildShape = void 0;
1288
+ this.writes.taint();
1289
+ }
1290
+ throw ex;
1291
+ }
1292
+ }
1293
+ async refreshCore(options, rebindFromRepoPath, cancellation) {
1294
+ const shape = this.getWalkShape();
1295
+ const buildShape = buildShapeKey(shape);
1296
+ const prior = this._current;
1297
+ const incrementalSeed = options?.rebuild !== true && prior.refTips != null && this._buildShape === buildShape ? {
1298
+ rows: this._window,
1299
+ tips: prior.refTips,
1300
+ ordering: shape.ordering,
1301
+ reachability: prior.reachability,
1302
+ rowsStats: prior.rowsStats,
1303
+ hasMore: prior.paging?.hasMore ?? false,
1304
+ onlyFollowFirstParent: shape.onlyFollowFirstParent,
1305
+ shallowBoundary: prior.shallowBoundary,
1306
+ decorationFingerprint: prior.decorationFingerprint,
1307
+ headRefUpstreamName: find(prior.branches.values(), (b) => b.current)?.upstream?.name
1308
+ } : void 0;
1309
+ let outcome;
1310
+ const graph = await this.provider.getGraph(this.repoPath, options?.rev, {
1311
+ include: options?.include,
1312
+ limit: options?.limit,
1313
+ rowProcessor: this.rowProcessor,
1314
+ reachabilitySeed: prior.reachability,
1315
+ rowsStatsSeed: prior.rowsStats,
1316
+ ancestrySeed: prior,
1317
+ incrementalSeed,
1318
+ onIncrementalResult: (o) => {
1319
+ outcome = o;
1320
+ },
1321
+ rebindFromRepoPath,
1322
+ onMutationStart: () => {
1323
+ this._rebindMutationStarted = true;
1324
+ }
1325
+ }, cancellation);
1326
+ mergeAvatarsForward(prior.avatars, graph.avatars);
1327
+ this.applyRebuild(graph, shape);
1328
+ if (outcome?.path === "fast") {
1329
+ const changed = {
1330
+ rows: true,
1331
+ reachability: reachabilityTableChanged(prior.reachability, graph.reachability),
1332
+ rowsStats: graph.includes?.stats === true && (outcome.added ?? 0) > 0,
1333
+ avatars: graph.avatars.size !== prior.avatars.size,
1334
+ downstreams: downstreamsChanged(prior.downstreams, graph.downstreams)
1335
+ };
1336
+ return {
1337
+ path: "fast",
1338
+ added: outcome.added,
1339
+ changed
1340
+ };
1341
+ }
1342
+ const changed = {
1343
+ rows: true,
1344
+ reachability: true,
1345
+ rowsStats: true,
1346
+ rowsStatsRecomputed: getAncestryChange(prior, graph) != null || outcome?.path === "fallback" && outcome.reason === "error",
1347
+ avatars: true,
1348
+ downstreams: true
1349
+ };
1350
+ if (outcome?.path === "fallback") return {
1351
+ path: "full",
1352
+ reason: outcome.reason,
1353
+ changed
1354
+ };
1355
+ return {
1356
+ path: "full",
1357
+ changed
1358
+ };
1359
+ }
1360
+ /**
1361
+ * Refresh options that reproduce the CURRENT window: the oldest loaded COMMIT row as the rev anchor
1362
+ * (pinning the walk's bottom boundary) and the window's size as the limit. Stash rows are skipped —
1363
+ * their shas aren't in `git log --all`, so anchoring on one triggers the walk's defensive over-walk.
1364
+ */
1365
+ computeWindowAnchor() {
1366
+ const rows = this._window;
1367
+ if (!rows.length) return void 0;
1368
+ let rev;
1369
+ for (let i = rows.length - 1; i >= 0 && i >= rows.length - 10; i--) {
1370
+ const kind = rows[i].kind;
1371
+ if (kind === "commit" || kind === "merge") {
1372
+ rev = rows[i].sha;
1373
+ break;
1374
+ }
1375
+ }
1376
+ return {
1377
+ rev,
1378
+ limit: rows.length,
1379
+ include: this._current.includes
1380
+ };
1381
+ }
1382
+ more(limit, targetId, cancellation) {
1383
+ return this.writes.runPage(() => this.moreCore(limit, targetId, cancellation));
1384
+ }
1385
+ /** {@link more}'s body — runs inside the write queue, and only when the window it was requested
1386
+ * against is still the current one, so nothing can rebuild underneath it. */
1387
+ async moreCore(limit, targetId, cancellation) {
1388
+ if (cancellation?.aborted === true) return "none";
1389
+ const prior = this._current;
1390
+ const updated = await prior.more?.(limit ?? 0, targetId, cancellation);
1391
+ if (updated == null) {
1392
+ debugger;
1393
+ return "none";
1394
+ }
1395
+ mergeAvatarsForward(prior.avatars, updated.avatars);
1396
+ this.applyPage(updated);
1397
+ return "added";
1398
+ }
1399
+ dispose() {}
1400
+ /** A cursor-less rebuild (full walk / fast path) IS the full window. */
1401
+ applyRebuild(graph, shape) {
1402
+ this._current = graph;
1403
+ this._window = graph.rows;
1404
+ this._buildShape = buildShapeKey(shape);
1405
+ this.writes.invalidate();
1406
+ }
1407
+ /** A page-append: keep the window up to the cursor and append the page (the reducer's cursor-anchored
1408
+ * concatenation); the walk shape is unchanged (same generation). */
1409
+ applyPage(page) {
1410
+ this._current = page;
1411
+ const startingCursor = page.paging?.startingCursor;
1412
+ this._window = startingCursor == null ? page.rows : appendRowsAtCursor(this._window, startingCursor, page.rows);
1413
+ }
1414
+ };
1415
+ //#endregion
1416
+ export { GraphGitSubProvider };
1417
+
1866
1418
  //# sourceMappingURL=graph.js.map