@gitkraken/core-gitlens 0.3.1 → 0.4.100

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 (1070) hide show
  1. package/CHANGELOG.md +83 -1
  2. package/README.md +22 -12
  3. package/dist/git/cache.d.ts +29 -2
  4. package/dist/git/cache.d.ts.map +1 -1
  5. package/dist/git/cache.js +67 -7
  6. package/dist/git/cache.js.map +1 -1
  7. package/dist/git/context.d.ts +4 -3
  8. package/dist/git/context.d.ts.map +1 -1
  9. package/dist/git/context.js.map +1 -1
  10. package/dist/git/errors.d.ts +31 -1
  11. package/dist/git/errors.d.ts.map +1 -1
  12. package/dist/git/errors.js +29 -0
  13. package/dist/git/errors.js.map +1 -1
  14. package/dist/git/models/author.d.ts.map +1 -1
  15. package/dist/git/models/author.js.map +1 -1
  16. package/dist/git/models/autolink.d.ts.map +1 -1
  17. package/dist/git/models/autolink.js.map +1 -1
  18. package/dist/git/models/blame.d.ts.map +1 -1
  19. package/dist/git/models/blame.js.map +1 -1
  20. package/dist/git/models/branch.d.ts.map +1 -1
  21. package/dist/git/models/branch.js.map +1 -1
  22. package/dist/git/models/commit.d.ts.map +1 -1
  23. package/dist/git/models/commit.js +1 -1
  24. package/dist/git/models/commit.js.map +1 -1
  25. package/dist/git/models/contributor.d.ts.map +1 -1
  26. package/dist/git/models/contributor.js.map +1 -1
  27. package/dist/git/models/defaultBranch.d.ts.map +1 -1
  28. package/dist/git/models/defaultBranch.js.map +1 -1
  29. package/dist/git/models/diff.d.ts.map +1 -1
  30. package/dist/git/models/diff.js.map +1 -1
  31. package/dist/git/models/file.d.ts.map +1 -1
  32. package/dist/git/models/file.js.map +1 -1
  33. package/dist/git/models/fileChange.d.ts.map +1 -1
  34. package/dist/git/models/fileChange.js.map +1 -1
  35. package/dist/git/models/fileStatus.d.ts +22 -22
  36. package/dist/git/models/fileStatus.d.ts.map +1 -1
  37. package/dist/git/models/fileStatus.js.map +1 -1
  38. package/dist/git/models/graph.d.ts +122 -1
  39. package/dist/git/models/graph.d.ts.map +1 -1
  40. package/dist/git/models/graph.js +4 -0
  41. package/dist/git/models/graph.js.map +1 -1
  42. package/dist/git/models/graphSearch.d.ts.map +1 -1
  43. package/dist/git/models/graphSearch.js.map +1 -1
  44. package/dist/git/models/graphSession.d.ts +177 -0
  45. package/dist/git/models/graphSession.d.ts.map +1 -0
  46. package/dist/git/models/graphSession.js +7 -0
  47. package/dist/git/models/graphSession.js.map +1 -0
  48. package/dist/git/models/issue.d.ts +12 -2
  49. package/dist/git/models/issue.d.ts.map +1 -1
  50. package/dist/git/models/issue.js +3 -1
  51. package/dist/git/models/issue.js.map +1 -1
  52. package/dist/git/models/issueOrPullRequest.d.ts.map +1 -1
  53. package/dist/git/models/issueOrPullRequest.js.map +1 -1
  54. package/dist/git/models/lineRange.d.ts.map +1 -1
  55. package/dist/git/models/lineRange.js.map +1 -1
  56. package/dist/git/models/log.d.ts.map +1 -1
  57. package/dist/git/models/log.js.map +1 -1
  58. package/dist/git/models/mergeConflicts.d.ts.map +1 -1
  59. package/dist/git/models/mergeConflicts.js.map +1 -1
  60. package/dist/git/models/patch.d.ts.map +1 -1
  61. package/dist/git/models/patch.js.map +1 -1
  62. package/dist/git/models/pausedOperationStatus.d.ts.map +1 -1
  63. package/dist/git/models/pausedOperationStatus.js.map +1 -1
  64. package/dist/git/models/pullRequest.d.ts +27 -2
  65. package/dist/git/models/pullRequest.d.ts.map +1 -1
  66. package/dist/git/models/pullRequest.js +7 -1
  67. package/dist/git/models/pullRequest.js.map +1 -1
  68. package/dist/git/models/rebase.d.ts.map +1 -1
  69. package/dist/git/models/rebase.js.map +1 -1
  70. package/dist/git/models/reference.d.ts.map +1 -1
  71. package/dist/git/models/reference.js.map +1 -1
  72. package/dist/git/models/reflog.d.ts.map +1 -1
  73. package/dist/git/models/reflog.js.map +1 -1
  74. package/dist/git/models/remote.d.ts.map +1 -1
  75. package/dist/git/models/remote.js.map +1 -1
  76. package/dist/git/models/remoteProvider.d.ts.map +1 -1
  77. package/dist/git/models/remoteProvider.js.map +1 -1
  78. package/dist/git/models/remoteResource.d.ts.map +1 -1
  79. package/dist/git/models/remoteResource.js.map +1 -1
  80. package/dist/git/models/repository.d.ts +20 -2
  81. package/dist/git/models/repository.d.ts.map +1 -1
  82. package/dist/git/models/repository.js +19 -0
  83. package/dist/git/models/repository.js.map +1 -1
  84. package/dist/git/models/repositoryChangeEvent.d.ts.map +1 -1
  85. package/dist/git/models/repositoryChangeEvent.js.map +1 -1
  86. package/dist/git/models/repositoryIdentities.d.ts.map +1 -1
  87. package/dist/git/models/repositoryIdentities.js.map +1 -1
  88. package/dist/git/models/repositoryMetadata.d.ts.map +1 -1
  89. package/dist/git/models/repositoryMetadata.js.map +1 -1
  90. package/dist/git/models/resourceDescriptor.d.ts +16 -0
  91. package/dist/git/models/resourceDescriptor.d.ts.map +1 -1
  92. package/dist/git/models/resourceDescriptor.js.map +1 -1
  93. package/dist/git/models/revision.d.ts.map +1 -1
  94. package/dist/git/models/revision.js.map +1 -1
  95. package/dist/git/models/search.d.ts.map +1 -1
  96. package/dist/git/models/search.js.map +1 -1
  97. package/dist/git/models/shortlog.d.ts.map +1 -1
  98. package/dist/git/models/shortlog.js.map +1 -1
  99. package/dist/git/models/signature.d.ts +14 -0
  100. package/dist/git/models/signature.d.ts.map +1 -1
  101. package/dist/git/models/signature.js.map +1 -1
  102. package/dist/git/models/staging.d.ts.map +1 -1
  103. package/dist/git/models/staging.js.map +1 -1
  104. package/dist/git/models/stash.d.ts.map +1 -1
  105. package/dist/git/models/stash.js.map +1 -1
  106. package/dist/git/models/status.d.ts.map +1 -1
  107. package/dist/git/models/status.js.map +1 -1
  108. package/dist/git/models/statusFile.d.ts.map +1 -1
  109. package/dist/git/models/statusFile.js.map +1 -1
  110. package/dist/git/models/tag.d.ts +11 -1
  111. package/dist/git/models/tag.d.ts.map +1 -1
  112. package/dist/git/models/tag.js +9 -2
  113. package/dist/git/models/tag.js.map +1 -1
  114. package/dist/git/models/tree.d.ts.map +1 -1
  115. package/dist/git/models/tree.js.map +1 -1
  116. package/dist/git/models/user.d.ts.map +1 -1
  117. package/dist/git/models/user.js.map +1 -1
  118. package/dist/git/models/worktree.d.ts.map +1 -1
  119. package/dist/git/models/worktree.js.map +1 -1
  120. package/dist/git/parsers/diffParser.d.ts.map +1 -1
  121. package/dist/git/parsers/diffParser.js +1 -1
  122. package/dist/git/parsers/diffParser.js.map +1 -1
  123. package/dist/git/parsers/rebaseTodoParser.d.ts.map +1 -1
  124. package/dist/git/parsers/rebaseTodoParser.js.map +1 -1
  125. package/dist/git/providers/blame.d.ts.map +1 -1
  126. package/dist/git/providers/blame.js.map +1 -1
  127. package/dist/git/providers/branches.d.ts +8 -1
  128. package/dist/git/providers/branches.d.ts.map +1 -1
  129. package/dist/git/providers/branches.js.map +1 -1
  130. package/dist/git/providers/commits.d.ts +6 -1
  131. package/dist/git/providers/commits.d.ts.map +1 -1
  132. package/dist/git/providers/commits.js.map +1 -1
  133. package/dist/git/providers/config.d.ts +6 -2
  134. package/dist/git/providers/config.d.ts.map +1 -1
  135. package/dist/git/providers/config.js.map +1 -1
  136. package/dist/git/providers/contributors.d.ts.map +1 -1
  137. package/dist/git/providers/contributors.js.map +1 -1
  138. package/dist/git/providers/diff.d.ts.map +1 -1
  139. package/dist/git/providers/diff.js.map +1 -1
  140. package/dist/git/providers/graph.d.ts +55 -1
  141. package/dist/git/providers/graph.d.ts.map +1 -1
  142. package/dist/git/providers/graph.js.map +1 -1
  143. package/dist/git/providers/operations.d.ts +1 -0
  144. package/dist/git/providers/operations.d.ts.map +1 -1
  145. package/dist/git/providers/operations.js.map +1 -1
  146. package/dist/git/providers/patch.d.ts.map +1 -1
  147. package/dist/git/providers/patch.js.map +1 -1
  148. package/dist/git/providers/pausedOperations.d.ts.map +1 -1
  149. package/dist/git/providers/pausedOperations.js.map +1 -1
  150. package/dist/git/providers/provider.d.ts.map +1 -1
  151. package/dist/git/providers/provider.js.map +1 -1
  152. package/dist/git/providers/refs.d.ts.map +1 -1
  153. package/dist/git/providers/refs.js.map +1 -1
  154. package/dist/git/providers/remotes.d.ts.map +1 -1
  155. package/dist/git/providers/remotes.js.map +1 -1
  156. package/dist/git/providers/revision.d.ts.map +1 -1
  157. package/dist/git/providers/revision.js.map +1 -1
  158. package/dist/git/providers/shared/remotes.d.ts.map +1 -1
  159. package/dist/git/providers/shared/remotes.js.map +1 -1
  160. package/dist/git/providers/staging.d.ts.map +1 -1
  161. package/dist/git/providers/staging.js.map +1 -1
  162. package/dist/git/providers/stash.d.ts.map +1 -1
  163. package/dist/git/providers/stash.js.map +1 -1
  164. package/dist/git/providers/status.d.ts +1 -0
  165. package/dist/git/providers/status.d.ts.map +1 -1
  166. package/dist/git/providers/status.js.map +1 -1
  167. package/dist/git/providers/tags.d.ts.map +1 -1
  168. package/dist/git/providers/tags.js.map +1 -1
  169. package/dist/git/providers/types.d.ts.map +1 -1
  170. package/dist/git/providers/types.js.map +1 -1
  171. package/dist/git/providers/worktrees.d.ts +5 -1
  172. package/dist/git/providers/worktrees.d.ts.map +1 -1
  173. package/dist/git/providers/worktrees.js.map +1 -1
  174. package/dist/git/remotes/azure-devops.d.ts.map +1 -1
  175. package/dist/git/remotes/azure-devops.js +27 -31
  176. package/dist/git/remotes/azure-devops.js.map +1 -1
  177. package/dist/git/remotes/bitbucket-server.d.ts.map +1 -1
  178. package/dist/git/remotes/bitbucket-server.js +21 -23
  179. package/dist/git/remotes/bitbucket-server.js.map +1 -1
  180. package/dist/git/remotes/bitbucket.d.ts.map +1 -1
  181. package/dist/git/remotes/bitbucket.js +21 -23
  182. package/dist/git/remotes/bitbucket.js.map +1 -1
  183. package/dist/git/remotes/custom.d.ts.map +1 -1
  184. package/dist/git/remotes/custom.js.map +1 -1
  185. package/dist/git/remotes/gerrit.d.ts.map +1 -1
  186. package/dist/git/remotes/gerrit.js +11 -13
  187. package/dist/git/remotes/gerrit.js.map +1 -1
  188. package/dist/git/remotes/gitea.d.ts.map +1 -1
  189. package/dist/git/remotes/gitea.js +12 -14
  190. package/dist/git/remotes/gitea.js.map +1 -1
  191. package/dist/git/remotes/github.d.ts.map +1 -1
  192. package/dist/git/remotes/github.js +54 -56
  193. package/dist/git/remotes/github.js.map +1 -1
  194. package/dist/git/remotes/gitlab.d.ts.map +1 -1
  195. package/dist/git/remotes/gitlab.js +93 -95
  196. package/dist/git/remotes/gitlab.js.map +1 -1
  197. package/dist/git/remotes/google-source.d.ts.map +1 -1
  198. package/dist/git/remotes/google-source.js.map +1 -1
  199. package/dist/git/remotes/matcher.d.ts.map +1 -1
  200. package/dist/git/remotes/matcher.js.map +1 -1
  201. package/dist/git/run.types.d.ts +62 -3
  202. package/dist/git/run.types.d.ts.map +1 -1
  203. package/dist/git/service.d.ts.map +1 -1
  204. package/dist/git/utils/autolink.utils.d.ts.map +1 -1
  205. package/dist/git/utils/autolink.utils.js.map +1 -1
  206. package/dist/git/utils/blame.utils.d.ts.map +1 -1
  207. package/dist/git/utils/blame.utils.js.map +1 -1
  208. package/dist/git/utils/branch.utils.d.ts.map +1 -1
  209. package/dist/git/utils/branch.utils.js +12 -1
  210. package/dist/git/utils/branch.utils.js.map +1 -1
  211. package/dist/git/utils/commit.utils.d.ts.map +1 -1
  212. package/dist/git/utils/commit.utils.js.map +1 -1
  213. package/dist/git/utils/conflictResolution.utils.d.ts +32 -0
  214. package/dist/git/utils/conflictResolution.utils.d.ts.map +1 -1
  215. package/dist/git/utils/conflictResolution.utils.js +95 -0
  216. package/dist/git/utils/conflictResolution.utils.js.map +1 -1
  217. package/dist/git/utils/contributor.utils.d.ts +1 -1
  218. package/dist/git/utils/contributor.utils.d.ts.map +1 -1
  219. package/dist/git/utils/contributor.utils.js +1 -2
  220. package/dist/git/utils/contributor.utils.js.map +1 -1
  221. package/dist/git/utils/fetch.utils.d.ts.map +1 -1
  222. package/dist/git/utils/fetch.utils.js.map +1 -1
  223. package/dist/git/utils/fileStatus.utils.d.ts +7 -0
  224. package/dist/git/utils/fileStatus.utils.d.ts.map +1 -1
  225. package/dist/git/utils/fileStatus.utils.js +6 -0
  226. package/dist/git/utils/fileStatus.utils.js.map +1 -1
  227. package/dist/git/utils/graph.utils.d.ts +20 -0
  228. package/dist/git/utils/graph.utils.d.ts.map +1 -0
  229. package/dist/git/utils/graph.utils.js +40 -0
  230. package/dist/git/utils/graph.utils.js.map +1 -0
  231. package/dist/git/utils/issue.utils.d.ts.map +1 -1
  232. package/dist/git/utils/issue.utils.js +1 -0
  233. package/dist/git/utils/issue.utils.js.map +1 -1
  234. package/dist/git/utils/issueOrPullRequest.utils.d.ts.map +1 -1
  235. package/dist/git/utils/issueOrPullRequest.utils.js.map +1 -1
  236. package/dist/git/utils/mergeConflicts.utils.d.ts.map +1 -1
  237. package/dist/git/utils/mergeConflicts.utils.js.map +1 -1
  238. package/dist/git/utils/pausedOperationStatus.utils.d.ts +13 -13
  239. package/dist/git/utils/pausedOperationStatus.utils.d.ts.map +1 -1
  240. package/dist/git/utils/pausedOperationStatus.utils.js.map +1 -1
  241. package/dist/git/utils/pullRequest.utils.d.ts.map +1 -1
  242. package/dist/git/utils/pullRequest.utils.js +9 -0
  243. package/dist/git/utils/pullRequest.utils.js.map +1 -1
  244. package/dist/git/utils/reachability.utils.d.ts +20 -2
  245. package/dist/git/utils/reachability.utils.d.ts.map +1 -1
  246. package/dist/git/utils/reachability.utils.js +68 -7
  247. package/dist/git/utils/reachability.utils.js.map +1 -1
  248. package/dist/git/utils/rebase.utils.d.ts.map +1 -1
  249. package/dist/git/utils/rebase.utils.js.map +1 -1
  250. package/dist/git/utils/reference.utils.d.ts.map +1 -1
  251. package/dist/git/utils/reference.utils.js.map +1 -1
  252. package/dist/git/utils/remote.utils.d.ts.map +1 -1
  253. package/dist/git/utils/remote.utils.js.map +1 -1
  254. package/dist/git/utils/repository.utils.d.ts.map +1 -1
  255. package/dist/git/utils/repository.utils.js.map +1 -1
  256. package/dist/git/utils/resourceDescriptor.utils.d.ts.map +1 -1
  257. package/dist/git/utils/resourceDescriptor.utils.js.map +1 -1
  258. package/dist/git/utils/revision.utils.d.ts.map +1 -1
  259. package/dist/git/utils/revision.utils.js.map +1 -1
  260. package/dist/git/utils/search.utils.d.ts.map +1 -1
  261. package/dist/git/utils/search.utils.js.map +1 -1
  262. package/dist/git/utils/sorting.d.ts.map +1 -1
  263. package/dist/git/utils/sorting.js.map +1 -1
  264. package/dist/git/utils/sshKey.utils.d.ts +7 -0
  265. package/dist/git/utils/sshKey.utils.d.ts.map +1 -0
  266. package/dist/git/utils/sshKey.utils.js +25 -0
  267. package/dist/git/utils/sshKey.utils.js.map +1 -0
  268. package/dist/git/utils/status.utils.d.ts.map +1 -1
  269. package/dist/git/utils/status.utils.js.map +1 -1
  270. package/dist/git/utils/statusFile.utils.d.ts.map +1 -1
  271. package/dist/git/utils/statusFile.utils.js.map +1 -1
  272. package/dist/git/utils/tag.utils.d.ts.map +1 -1
  273. package/dist/git/utils/tag.utils.js.map +1 -1
  274. package/dist/git/utils/tooltip.utils.d.ts.map +1 -1
  275. package/dist/git/utils/tooltip.utils.js.map +1 -1
  276. package/dist/git/utils/uriAuthority.d.ts.map +1 -1
  277. package/dist/git/utils/uriAuthority.js.map +1 -1
  278. package/dist/git/utils/user.utils.d.ts.map +1 -1
  279. package/dist/git/utils/user.utils.js.map +1 -1
  280. package/dist/git/utils/worktree.utils.d.ts.map +1 -1
  281. package/dist/git/utils/worktree.utils.js.map +1 -1
  282. package/dist/git/watching/changeEvent.d.ts.map +1 -1
  283. package/dist/git/watching/changeEvent.js.map +1 -1
  284. package/dist/git/watching/classifyChange.d.ts.map +1 -1
  285. package/dist/git/watching/classifyChange.js.map +1 -1
  286. package/dist/git/watching/gitIgnoreFilter.d.ts.map +1 -1
  287. package/dist/git/watching/gitIgnoreFilter.js.map +1 -1
  288. package/dist/git/watching/initWatcher.d.ts.map +1 -1
  289. package/dist/git/watching/initWatcher.js.map +1 -1
  290. package/dist/git/watching/provider.d.ts.map +1 -1
  291. package/dist/git/watching/provider.js.map +1 -1
  292. package/dist/git/watching/watchGroup.d.ts.map +1 -1
  293. package/dist/git/watching/watchGroup.js.map +1 -1
  294. package/dist/git/watching/watchService.d.ts +4 -0
  295. package/dist/git/watching/watchService.d.ts.map +1 -1
  296. package/dist/git/watching/watchService.js +15 -1
  297. package/dist/git/watching/watchService.js.map +1 -1
  298. package/dist/git/watching/watchSession.d.ts +7 -0
  299. package/dist/git/watching/watchSession.d.ts.map +1 -1
  300. package/dist/git/watching/watchSession.js +14 -2
  301. package/dist/git/watching/watchSession.js.map +1 -1
  302. package/dist/git/watching/watcherPatterns.d.ts.map +1 -1
  303. package/dist/git/watching/watcherPatterns.js.map +1 -1
  304. package/dist/git-cli/cliGitProvider.d.ts.map +1 -1
  305. package/dist/git-cli/exec/exec.d.ts.map +1 -1
  306. package/dist/git-cli/exec/exec.errors.d.ts.map +1 -1
  307. package/dist/git-cli/exec/exec.errors.js.map +1 -1
  308. package/dist/git-cli/exec/exec.js.map +1 -1
  309. package/dist/git-cli/exec/exec.types.d.ts.map +1 -1
  310. package/dist/git-cli/exec/exec.types.js.map +1 -1
  311. package/dist/git-cli/exec/features.d.ts.map +1 -1
  312. package/dist/git-cli/exec/features.js.map +1 -1
  313. package/dist/git-cli/exec/git.d.ts +19 -27
  314. package/dist/git-cli/exec/git.d.ts.map +1 -1
  315. package/dist/git-cli/exec/git.js +126 -34
  316. package/dist/git-cli/exec/git.js.map +1 -1
  317. package/dist/git-cli/exec/gitQueue.d.ts.map +1 -1
  318. package/dist/git-cli/exec/gitQueue.js.map +1 -1
  319. package/dist/git-cli/exec/locator.d.ts.map +1 -1
  320. package/dist/git-cli/exec/locator.js.map +1 -1
  321. package/dist/git-cli/parsers/blameParser.d.ts.map +1 -1
  322. package/dist/git-cli/parsers/blameParser.js.map +1 -1
  323. package/dist/git-cli/parsers/indexParser.d.ts.map +1 -1
  324. package/dist/git-cli/parsers/indexParser.js.map +1 -1
  325. package/dist/git-cli/parsers/logParser.d.ts +9 -1
  326. package/dist/git-cli/parsers/logParser.d.ts.map +1 -1
  327. package/dist/git-cli/parsers/logParser.js +141 -60
  328. package/dist/git-cli/parsers/logParser.js.map +1 -1
  329. package/dist/git-cli/parsers/mergeTreeParser.d.ts.map +1 -1
  330. package/dist/git-cli/parsers/mergeTreeParser.js.map +1 -1
  331. package/dist/git-cli/parsers/refParser.d.ts.map +1 -1
  332. package/dist/git-cli/parsers/refParser.js.map +1 -1
  333. package/dist/git-cli/parsers/reflogParser.d.ts.map +1 -1
  334. package/dist/git-cli/parsers/reflogParser.js.map +1 -1
  335. package/dist/git-cli/parsers/remoteParser.d.ts.map +1 -1
  336. package/dist/git-cli/parsers/remoteParser.js.map +1 -1
  337. package/dist/git-cli/parsers/shortlogParser.d.ts.map +1 -1
  338. package/dist/git-cli/parsers/shortlogParser.js.map +1 -1
  339. package/dist/git-cli/parsers/signatureParser.d.ts.map +1 -1
  340. package/dist/git-cli/parsers/signatureParser.js.map +1 -1
  341. package/dist/git-cli/parsers/sshSignatureParser.d.ts +21 -0
  342. package/dist/git-cli/parsers/sshSignatureParser.d.ts.map +1 -0
  343. package/dist/git-cli/parsers/sshSignatureParser.js +78 -0
  344. package/dist/git-cli/parsers/sshSignatureParser.js.map +1 -0
  345. package/dist/git-cli/parsers/statusParser.d.ts.map +1 -1
  346. package/dist/git-cli/parsers/statusParser.js.map +1 -1
  347. package/dist/git-cli/parsers/treeParser.d.ts.map +1 -1
  348. package/dist/git-cli/parsers/treeParser.js.map +1 -1
  349. package/dist/git-cli/parsers/worktreeParser.d.ts.map +1 -1
  350. package/dist/git-cli/parsers/worktreeParser.js +5 -7
  351. package/dist/git-cli/parsers/worktreeParser.js.map +1 -1
  352. package/dist/git-cli/providers/blame.d.ts.map +1 -1
  353. package/dist/git-cli/providers/blame.js.map +1 -1
  354. package/dist/git-cli/providers/branches.d.ts +1 -0
  355. package/dist/git-cli/providers/branches.d.ts.map +1 -1
  356. package/dist/git-cli/providers/branches.js +51 -32
  357. package/dist/git-cli/providers/branches.js.map +1 -1
  358. package/dist/git-cli/providers/commitFilesetUtils.d.ts.map +1 -1
  359. package/dist/git-cli/providers/commitFilesetUtils.js.map +1 -1
  360. package/dist/git-cli/providers/commits.d.ts +12 -1
  361. package/dist/git-cli/providers/commits.d.ts.map +1 -1
  362. package/dist/git-cli/providers/commits.js +89 -8
  363. package/dist/git-cli/providers/commits.js.map +1 -1
  364. package/dist/git-cli/providers/config.d.ts.map +1 -1
  365. package/dist/git-cli/providers/config.js.map +1 -1
  366. package/dist/git-cli/providers/contributors.d.ts.map +1 -1
  367. package/dist/git-cli/providers/contributors.js.map +1 -1
  368. package/dist/git-cli/providers/diff.d.ts.map +1 -1
  369. package/dist/git-cli/providers/diff.js.map +1 -1
  370. package/dist/git-cli/providers/graph.d.ts +35 -1
  371. package/dist/git-cli/providers/graph.d.ts.map +1 -1
  372. package/dist/git-cli/providers/graph.js +1434 -330
  373. package/dist/git-cli/providers/graph.js.map +1 -1
  374. package/dist/git-cli/providers/operations.d.ts +1 -0
  375. package/dist/git-cli/providers/operations.d.ts.map +1 -1
  376. package/dist/git-cli/providers/operations.js +22 -1
  377. package/dist/git-cli/providers/operations.js.map +1 -1
  378. package/dist/git-cli/providers/patch.d.ts.map +1 -1
  379. package/dist/git-cli/providers/patch.js.map +1 -1
  380. package/dist/git-cli/providers/pausedOperations.d.ts.map +1 -1
  381. package/dist/git-cli/providers/pausedOperations.js +3 -3
  382. package/dist/git-cli/providers/pausedOperations.js.map +1 -1
  383. package/dist/git-cli/providers/refs.d.ts.map +1 -1
  384. package/dist/git-cli/providers/refs.js.map +1 -1
  385. package/dist/git-cli/providers/remotes.d.ts.map +1 -1
  386. package/dist/git-cli/providers/remotes.js.map +1 -1
  387. package/dist/git-cli/providers/revision.d.ts +1 -0
  388. package/dist/git-cli/providers/revision.d.ts.map +1 -1
  389. package/dist/git-cli/providers/revision.js +33 -0
  390. package/dist/git-cli/providers/revision.js.map +1 -1
  391. package/dist/git-cli/providers/staging.d.ts.map +1 -1
  392. package/dist/git-cli/providers/staging.js.map +1 -1
  393. package/dist/git-cli/providers/stash.d.ts.map +1 -1
  394. package/dist/git-cli/providers/stash.js.map +1 -1
  395. package/dist/git-cli/providers/status.d.ts +28 -0
  396. package/dist/git-cli/providers/status.d.ts.map +1 -1
  397. package/dist/git-cli/providers/status.js +240 -154
  398. package/dist/git-cli/providers/status.js.map +1 -1
  399. package/dist/git-cli/providers/tags.d.ts.map +1 -1
  400. package/dist/git-cli/providers/tags.js +2 -1
  401. package/dist/git-cli/providers/tags.js.map +1 -1
  402. package/dist/git-cli/providers/worktrees.d.ts +4 -1
  403. package/dist/git-cli/providers/worktrees.d.ts.map +1 -1
  404. package/dist/git-cli/providers/worktrees.js +31 -3
  405. package/dist/git-cli/providers/worktrees.js.map +1 -1
  406. package/dist/git-cli/service.d.ts.map +1 -1
  407. package/dist/git-cli/service.js +8 -0
  408. package/dist/git-cli/service.js.map +1 -1
  409. package/dist/ipc/ipcServer.d.ts.map +1 -1
  410. package/dist/ipc/ipcServer.js +1 -1
  411. package/dist/ipc/ipcServer.js.map +1 -1
  412. package/dist/plus/agents/providers/claudeCodeProvider.d.ts +6 -1
  413. package/dist/plus/agents/providers/claudeCodeProvider.d.ts.map +1 -1
  414. package/dist/plus/agents/providers/claudeCodeProvider.js +19 -0
  415. package/dist/plus/agents/providers/claudeCodeProvider.js.map +1 -1
  416. package/dist/plus/agents/providers/claudeCodeTranscript.d.ts +68 -0
  417. package/dist/plus/agents/providers/claudeCodeTranscript.d.ts.map +1 -1
  418. package/dist/plus/agents/providers/claudeCodeTranscript.js +262 -8
  419. package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -1
  420. package/dist/plus/agents/types.d.ts +36 -2
  421. package/dist/plus/agents/types.d.ts.map +1 -1
  422. package/dist/plus/ai/constants.d.ts +1 -2
  423. package/dist/plus/ai/constants.d.ts.map +1 -1
  424. package/dist/plus/ai/constants.js +1 -8
  425. package/dist/plus/ai/constants.js.map +1 -1
  426. package/dist/plus/ai/errors.d.ts.map +1 -1
  427. package/dist/plus/ai/errors.js.map +1 -1
  428. package/dist/plus/ai/models/conversation.d.ts.map +1 -1
  429. package/dist/plus/ai/models/conversation.js.map +1 -1
  430. package/dist/plus/ai/models/model.d.ts +2 -1
  431. package/dist/plus/ai/models/model.d.ts.map +1 -1
  432. package/dist/plus/ai/models/model.js +50 -1
  433. package/dist/plus/ai/models/model.js.map +1 -1
  434. package/dist/plus/ai/models/promptTemplates.d.ts +5 -2
  435. package/dist/plus/ai/models/promptTemplates.d.ts.map +1 -1
  436. package/dist/plus/ai/models/promptTemplates.js.map +1 -1
  437. package/dist/plus/ai/models/provider.d.ts.map +1 -1
  438. package/dist/plus/ai/models/provider.js.map +1 -1
  439. package/dist/plus/ai/models/results.d.ts.map +1 -1
  440. package/dist/plus/ai/models/results.js.map +1 -1
  441. package/dist/plus/ai/prompts.d.ts +1 -1
  442. package/dist/plus/ai/prompts.d.ts.map +1 -1
  443. package/dist/plus/ai/prompts.js +15 -47
  444. package/dist/plus/ai/prompts.js.map +1 -1
  445. package/dist/plus/ai/providers/anthropicProvider.d.ts +5 -0
  446. package/dist/plus/ai/providers/anthropicProvider.d.ts.map +1 -1
  447. package/dist/plus/ai/providers/anthropicProvider.js +40 -3
  448. package/dist/plus/ai/providers/anthropicProvider.js.map +1 -1
  449. package/dist/plus/ai/providers/azureProvider.d.ts.map +1 -1
  450. package/dist/plus/ai/providers/azureProvider.js.map +1 -1
  451. package/dist/plus/ai/providers/context.d.ts.map +1 -1
  452. package/dist/plus/ai/providers/context.js.map +1 -1
  453. package/dist/plus/ai/providers/deepSeekProvider.d.ts.map +1 -1
  454. package/dist/plus/ai/providers/deepSeekProvider.js +17 -1
  455. package/dist/plus/ai/providers/deepSeekProvider.js.map +1 -1
  456. package/dist/plus/ai/providers/geminiProvider.d.ts.map +1 -1
  457. package/dist/plus/ai/providers/geminiProvider.js +25 -6
  458. package/dist/plus/ai/providers/geminiProvider.js.map +1 -1
  459. package/dist/plus/ai/providers/gitkrakenProvider.d.ts.map +1 -1
  460. package/dist/plus/ai/providers/gitkrakenProvider.js +1 -0
  461. package/dist/plus/ai/providers/gitkrakenProvider.js.map +1 -1
  462. package/dist/plus/ai/providers/huggingFaceProvider.d.ts +1 -1
  463. package/dist/plus/ai/providers/huggingFaceProvider.d.ts.map +1 -1
  464. package/dist/plus/ai/providers/huggingFaceProvider.js +21 -18
  465. package/dist/plus/ai/providers/huggingFaceProvider.js.map +1 -1
  466. package/dist/plus/ai/providers/mistralProvider.d.ts.map +1 -1
  467. package/dist/plus/ai/providers/mistralProvider.js.map +1 -1
  468. package/dist/plus/ai/providers/ollamaProvider.d.ts.map +1 -1
  469. package/dist/plus/ai/providers/ollamaProvider.js.map +1 -1
  470. package/dist/plus/ai/providers/openAICompatibleProvider.d.ts.map +1 -1
  471. package/dist/plus/ai/providers/openAICompatibleProvider.js.map +1 -1
  472. package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts +10 -1
  473. package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts.map +1 -1
  474. package/dist/plus/ai/providers/openAICompatibleProviderBase.js +9 -1
  475. package/dist/plus/ai/providers/openAICompatibleProviderBase.js.map +1 -1
  476. package/dist/plus/ai/providers/openRouterProvider.d.ts.map +1 -1
  477. package/dist/plus/ai/providers/openRouterProvider.js.map +1 -1
  478. package/dist/plus/ai/providers/openaiProvider.d.ts.map +1 -1
  479. package/dist/plus/ai/providers/openaiProvider.js.map +1 -1
  480. package/dist/plus/ai/providers/xaiProvider.d.ts.map +1 -1
  481. package/dist/plus/ai/providers/xaiProvider.js +14 -1
  482. package/dist/plus/ai/providers/xaiProvider.js.map +1 -1
  483. package/dist/plus/ai/utils/ai.utils.d.ts.map +1 -1
  484. package/dist/plus/ai/utils/ai.utils.js +5 -7
  485. package/dist/plus/ai/utils/ai.utils.js.map +1 -1
  486. package/dist/plus/ai/utils/results.utils.d.ts +3 -0
  487. package/dist/plus/ai/utils/results.utils.d.ts.map +1 -1
  488. package/dist/plus/ai/utils/results.utils.js +26 -0
  489. package/dist/plus/ai/utils/results.utils.js.map +1 -1
  490. package/dist/plus/ai/utils/truncation.utils.d.ts +1 -1
  491. package/dist/plus/ai/utils/truncation.utils.d.ts.map +1 -1
  492. package/dist/plus/ai/utils/truncation.utils.js.map +1 -1
  493. package/dist/plus/git-github/api/config.d.ts.map +1 -1
  494. package/dist/plus/git-github/api/config.js.map +1 -1
  495. package/dist/plus/git-github/api/github.d.ts +71 -15
  496. package/dist/plus/git-github/api/github.d.ts.map +1 -1
  497. package/dist/plus/git-github/api/github.js +350 -84
  498. package/dist/plus/git-github/api/github.js.map +1 -1
  499. package/dist/plus/git-github/api/github.utils.d.ts.map +1 -1
  500. package/dist/plus/git-github/api/github.utils.js.map +1 -1
  501. package/dist/plus/git-github/api/token.d.ts.map +1 -1
  502. package/dist/plus/git-github/api/token.js.map +1 -1
  503. package/dist/plus/git-github/api/tokenUtils.d.ts.map +1 -1
  504. package/dist/plus/git-github/api/tokenUtils.js.map +1 -1
  505. package/dist/plus/git-github/api/types.d.ts.map +1 -1
  506. package/dist/plus/git-github/api/types.js.map +1 -1
  507. package/dist/plus/git-github/context.d.ts.map +1 -1
  508. package/dist/plus/git-github/models.d.ts +5 -0
  509. package/dist/plus/git-github/models.d.ts.map +1 -1
  510. package/dist/plus/git-github/models.js +27 -2
  511. package/dist/plus/git-github/models.js.map +1 -1
  512. package/dist/plus/git-github/providers/github/blame.d.ts.map +1 -1
  513. package/dist/plus/git-github/providers/github/blame.js.map +1 -1
  514. package/dist/plus/git-github/providers/github/branches.d.ts +2 -1
  515. package/dist/plus/git-github/providers/github/branches.d.ts.map +1 -1
  516. package/dist/plus/git-github/providers/github/branches.js +7 -3
  517. package/dist/plus/git-github/providers/github/branches.js.map +1 -1
  518. package/dist/plus/git-github/providers/github/commits.d.ts.map +1 -1
  519. package/dist/plus/git-github/providers/github/commits.js.map +1 -1
  520. package/dist/plus/git-github/providers/github/config.d.ts.map +1 -1
  521. package/dist/plus/git-github/providers/github/config.js.map +1 -1
  522. package/dist/plus/git-github/providers/github/contributors.d.ts.map +1 -1
  523. package/dist/plus/git-github/providers/github/contributors.js.map +1 -1
  524. package/dist/plus/git-github/providers/github/diff.d.ts.map +1 -1
  525. package/dist/plus/git-github/providers/github/diff.js +2 -2
  526. package/dist/plus/git-github/providers/github/diff.js.map +1 -1
  527. package/dist/plus/git-github/providers/github/graph.d.ts +12 -1
  528. package/dist/plus/git-github/providers/github/graph.d.ts.map +1 -1
  529. package/dist/plus/git-github/providers/github/graph.js +85 -0
  530. package/dist/plus/git-github/providers/github/graph.js.map +1 -1
  531. package/dist/plus/git-github/providers/github/refs.d.ts.map +1 -1
  532. package/dist/plus/git-github/providers/github/refs.js.map +1 -1
  533. package/dist/plus/git-github/providers/github/remotes.d.ts.map +1 -1
  534. package/dist/plus/git-github/providers/github/remotes.js.map +1 -1
  535. package/dist/plus/git-github/providers/github/revision.d.ts.map +1 -1
  536. package/dist/plus/git-github/providers/github/revision.js.map +1 -1
  537. package/dist/plus/git-github/providers/github/status.d.ts.map +1 -1
  538. package/dist/plus/git-github/providers/github/status.js.map +1 -1
  539. package/dist/plus/git-github/providers/github/tags.d.ts.map +1 -1
  540. package/dist/plus/git-github/providers/github/tags.js +3 -1
  541. package/dist/plus/git-github/providers/github/tags.js.map +1 -1
  542. package/dist/plus/git-github/providers/githubGitProvider.d.ts.map +1 -1
  543. package/dist/plus/git-github/providers/githubGitProvider.js.map +1 -1
  544. package/dist/plus/git-github/providers/githubProvider.d.ts.map +1 -1
  545. package/dist/plus/git-github/providers/githubProvider.js.map +1 -1
  546. package/dist/plus/integrations/authentication/cloudIntegrationService.d.ts +30 -0
  547. package/dist/plus/integrations/authentication/cloudIntegrationService.d.ts.map +1 -0
  548. package/dist/plus/integrations/authentication/cloudIntegrationService.js +214 -0
  549. package/dist/plus/integrations/authentication/cloudIntegrationService.js.map +1 -0
  550. package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts +114 -0
  551. package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts.map +1 -0
  552. package/dist/plus/integrations/authentication/configuredIntegrationService.js +497 -0
  553. package/dist/plus/integrations/authentication/configuredIntegrationService.js.map +1 -0
  554. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts +112 -0
  555. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts.map +1 -0
  556. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js +217 -0
  557. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js.map +1 -0
  558. package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts +62 -0
  559. package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts.map +1 -0
  560. package/dist/plus/integrations/authentication/integrationAuthenticationService.js +126 -0
  561. package/dist/plus/integrations/authentication/integrationAuthenticationService.js.map +1 -0
  562. package/dist/plus/integrations/authentication/manualTokenProvider.d.ts +16 -0
  563. package/dist/plus/integrations/authentication/manualTokenProvider.d.ts.map +1 -0
  564. package/dist/plus/integrations/authentication/manualTokenProvider.js +53 -0
  565. package/dist/plus/integrations/authentication/manualTokenProvider.js.map +1 -0
  566. package/dist/plus/integrations/authentication/models.d.ts +120 -0
  567. package/dist/plus/integrations/authentication/models.d.ts.map +1 -0
  568. package/dist/plus/integrations/authentication/models.js +64 -0
  569. package/dist/plus/integrations/authentication/models.js.map +1 -0
  570. package/dist/plus/integrations/collectionMetadata.d.ts +21 -0
  571. package/dist/plus/integrations/collectionMetadata.d.ts.map +1 -0
  572. package/dist/plus/integrations/collectionMetadata.js +121 -0
  573. package/dist/plus/integrations/collectionMetadata.js.map +1 -0
  574. package/dist/plus/integrations/constants.d.ts +57 -0
  575. package/dist/plus/integrations/constants.d.ts.map +1 -0
  576. package/dist/plus/integrations/constants.js +138 -0
  577. package/dist/plus/integrations/constants.js.map +1 -0
  578. package/dist/plus/integrations/context.d.ts +358 -0
  579. package/dist/plus/integrations/context.d.ts.map +1 -0
  580. package/dist/plus/integrations/context.js +2 -0
  581. package/dist/plus/integrations/context.js.map +1 -0
  582. package/dist/plus/integrations/errors.d.ts +79 -0
  583. package/dist/plus/integrations/errors.d.ts.map +1 -0
  584. package/dist/plus/integrations/errors.js +150 -0
  585. package/dist/plus/integrations/errors.js.map +1 -0
  586. package/dist/plus/integrations/index.d.ts +77 -0
  587. package/dist/plus/integrations/index.d.ts.map +1 -0
  588. package/dist/plus/integrations/index.js +64 -0
  589. package/dist/plus/integrations/index.js.map +1 -0
  590. package/dist/plus/integrations/integrationService.d.ts +379 -0
  591. package/dist/plus/integrations/integrationService.d.ts.map +1 -0
  592. package/dist/plus/integrations/integrationService.js +1895 -0
  593. package/dist/plus/integrations/integrationService.js.map +1 -0
  594. package/dist/plus/integrations/lite.d.ts +47 -0
  595. package/dist/plus/integrations/lite.d.ts.map +1 -0
  596. package/dist/plus/integrations/lite.js +141 -0
  597. package/dist/plus/integrations/lite.js.map +1 -0
  598. package/dist/plus/integrations/manager.d.ts +332 -0
  599. package/dist/plus/integrations/manager.d.ts.map +1 -0
  600. package/dist/plus/integrations/manager.js +2 -0
  601. package/dist/plus/integrations/manager.js.map +1 -0
  602. package/dist/plus/integrations/models/gitHostIntegration.d.ts +341 -0
  603. package/dist/plus/integrations/models/gitHostIntegration.d.ts.map +1 -0
  604. package/dist/plus/integrations/models/gitHostIntegration.js +1146 -0
  605. package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -0
  606. package/dist/plus/integrations/models/integration.d.ts +212 -0
  607. package/dist/plus/integrations/models/integration.d.ts.map +1 -0
  608. package/dist/plus/integrations/models/integration.js +627 -0
  609. package/dist/plus/integrations/models/integration.js.map +1 -0
  610. package/dist/plus/integrations/models/issuesIntegration.d.ts +108 -0
  611. package/dist/plus/integrations/models/issuesIntegration.d.ts.map +1 -0
  612. package/dist/plus/integrations/models/issuesIntegration.js +216 -0
  613. package/dist/plus/integrations/models/issuesIntegration.js.map +1 -0
  614. package/dist/plus/integrations/providerFilters.d.ts +12 -0
  615. package/dist/plus/integrations/providerFilters.d.ts.map +1 -0
  616. package/dist/plus/integrations/providerFilters.js +14 -0
  617. package/dist/plus/integrations/providerFilters.js.map +1 -0
  618. package/dist/plus/integrations/providers/apiClients.d.ts +25 -0
  619. package/dist/plus/integrations/providers/apiClients.d.ts.map +1 -0
  620. package/dist/plus/integrations/providers/apiClients.js +39 -0
  621. package/dist/plus/integrations/providers/apiClients.js.map +1 -0
  622. package/dist/plus/integrations/providers/apiConfig.d.ts +52 -0
  623. package/dist/plus/integrations/providers/apiConfig.d.ts.map +1 -0
  624. package/dist/plus/integrations/providers/apiConfig.js +19 -0
  625. package/dist/plus/integrations/providers/apiConfig.js.map +1 -0
  626. package/dist/plus/integrations/providers/azure/azure.d.ts +59 -0
  627. package/dist/plus/integrations/providers/azure/azure.d.ts.map +1 -0
  628. package/dist/plus/integrations/providers/azure/azure.js +519 -0
  629. package/dist/plus/integrations/providers/azure/azure.js.map +1 -0
  630. package/dist/plus/integrations/providers/azure/models.d.ts +302 -0
  631. package/dist/plus/integrations/providers/azure/models.d.ts.map +1 -0
  632. package/dist/plus/integrations/providers/azure/models.js +203 -0
  633. package/dist/plus/integrations/providers/azure/models.js.map +1 -0
  634. package/dist/plus/integrations/providers/azureDevOps.d.ts +141 -0
  635. package/dist/plus/integrations/providers/azureDevOps.d.ts.map +1 -0
  636. package/dist/plus/integrations/providers/azureDevOps.js +925 -0
  637. package/dist/plus/integrations/providers/azureDevOps.js.map +1 -0
  638. package/dist/plus/integrations/providers/bitbucket/bitbucket.d.ts +53 -0
  639. package/dist/plus/integrations/providers/bitbucket/bitbucket.d.ts.map +1 -0
  640. package/dist/plus/integrations/providers/bitbucket/bitbucket.js +589 -0
  641. package/dist/plus/integrations/providers/bitbucket/bitbucket.js.map +1 -0
  642. package/dist/plus/integrations/providers/bitbucket/models.d.ts +222 -0
  643. package/dist/plus/integrations/providers/bitbucket/models.d.ts.map +1 -0
  644. package/dist/plus/integrations/providers/bitbucket/models.js +158 -0
  645. package/dist/plus/integrations/providers/bitbucket/models.js.map +1 -0
  646. package/dist/plus/integrations/providers/bitbucket-server/models.d.ts +138 -0
  647. package/dist/plus/integrations/providers/bitbucket-server/models.d.ts.map +1 -0
  648. package/dist/plus/integrations/providers/bitbucket-server/models.js +130 -0
  649. package/dist/plus/integrations/providers/bitbucket-server/models.js.map +1 -0
  650. package/dist/plus/integrations/providers/bitbucket-server.d.ts +84 -0
  651. package/dist/plus/integrations/providers/bitbucket-server.d.ts.map +1 -0
  652. package/dist/plus/integrations/providers/bitbucket-server.js +242 -0
  653. package/dist/plus/integrations/providers/bitbucket-server.js.map +1 -0
  654. package/dist/plus/integrations/providers/bitbucket.d.ts +84 -0
  655. package/dist/plus/integrations/providers/bitbucket.d.ts.map +1 -0
  656. package/dist/plus/integrations/providers/bitbucket.js +477 -0
  657. package/dist/plus/integrations/providers/bitbucket.js.map +1 -0
  658. package/dist/plus/integrations/providers/github/github.d.ts +5 -0
  659. package/dist/plus/integrations/providers/github/github.d.ts.map +1 -0
  660. package/dist/plus/integrations/providers/github/github.js +47 -0
  661. package/dist/plus/integrations/providers/github/github.js.map +1 -0
  662. package/dist/plus/integrations/providers/github/github.utils.d.ts +11 -0
  663. package/dist/plus/integrations/providers/github/github.utils.d.ts.map +1 -0
  664. package/dist/plus/integrations/providers/github/github.utils.js +6 -0
  665. package/dist/plus/integrations/providers/github/github.utils.js.map +1 -0
  666. package/dist/plus/integrations/providers/github/models.d.ts +3 -0
  667. package/dist/plus/integrations/providers/github/models.d.ts.map +1 -0
  668. package/dist/plus/integrations/providers/github/models.js +2 -0
  669. package/dist/plus/integrations/providers/github/models.js.map +1 -0
  670. package/dist/plus/integrations/providers/github.d.ts +116 -0
  671. package/dist/plus/integrations/providers/github.d.ts.map +1 -0
  672. package/dist/plus/integrations/providers/github.js +445 -0
  673. package/dist/plus/integrations/providers/github.js.map +1 -0
  674. package/dist/plus/integrations/providers/gitlab/gitlab.d.ts +71 -0
  675. package/dist/plus/integrations/providers/gitlab/gitlab.d.ts.map +1 -0
  676. package/dist/plus/integrations/providers/gitlab/gitlab.js +902 -0
  677. package/dist/plus/integrations/providers/gitlab/gitlab.js.map +1 -0
  678. package/dist/plus/integrations/providers/gitlab/gitlab.utils.d.ts +27 -0
  679. package/dist/plus/integrations/providers/gitlab/gitlab.utils.d.ts.map +1 -0
  680. package/dist/plus/integrations/providers/gitlab/gitlab.utils.js +53 -0
  681. package/dist/plus/integrations/providers/gitlab/gitlab.utils.js.map +1 -0
  682. package/dist/plus/integrations/providers/gitlab/models.d.ts +138 -0
  683. package/dist/plus/integrations/providers/gitlab/models.d.ts.map +1 -0
  684. package/dist/plus/integrations/providers/gitlab/models.js +99 -0
  685. package/dist/plus/integrations/providers/gitlab/models.js.map +1 -0
  686. package/dist/plus/integrations/providers/gitlab.d.ts +124 -0
  687. package/dist/plus/integrations/providers/gitlab.d.ts.map +1 -0
  688. package/dist/plus/integrations/providers/gitlab.js +519 -0
  689. package/dist/plus/integrations/providers/gitlab.js.map +1 -0
  690. package/dist/plus/integrations/providers/jira.d.ts +57 -0
  691. package/dist/plus/integrations/providers/jira.d.ts.map +1 -0
  692. package/dist/plus/integrations/providers/jira.js +425 -0
  693. package/dist/plus/integrations/providers/jira.js.map +1 -0
  694. package/dist/plus/integrations/providers/linear.d.ts +58 -0
  695. package/dist/plus/integrations/providers/linear.d.ts.map +1 -0
  696. package/dist/plus/integrations/providers/linear.js +304 -0
  697. package/dist/plus/integrations/providers/linear.js.map +1 -0
  698. package/dist/plus/integrations/providers/models.d.ts +712 -0
  699. package/dist/plus/integrations/providers/models.d.ts.map +1 -0
  700. package/dist/plus/integrations/providers/models.js +850 -0
  701. package/dist/plus/integrations/providers/models.js.map +1 -0
  702. package/dist/plus/integrations/providers/providersApi.d.ts +262 -0
  703. package/dist/plus/integrations/providers/providersApi.d.ts.map +1 -0
  704. package/dist/plus/integrations/providers/providersApi.js +1033 -0
  705. package/dist/plus/integrations/providers/providersApi.js.map +1 -0
  706. package/dist/plus/integrations/providers/trello.d.ts +47 -0
  707. package/dist/plus/integrations/providers/trello.d.ts.map +1 -0
  708. package/dist/plus/integrations/providers/trello.js +141 -0
  709. package/dist/plus/integrations/providers/trello.js.map +1 -0
  710. package/dist/plus/integrations/providers/utils/providerPaging.d.ts +29 -0
  711. package/dist/plus/integrations/providers/utils/providerPaging.d.ts.map +1 -0
  712. package/dist/plus/integrations/providers/utils/providerPaging.js +154 -0
  713. package/dist/plus/integrations/providers/utils/providerPaging.js.map +1 -0
  714. package/dist/plus/integrations/providers/utils.d.ts +75 -0
  715. package/dist/plus/integrations/providers/utils.d.ts.map +1 -0
  716. package/dist/plus/integrations/providers/utils.js +313 -0
  717. package/dist/plus/integrations/providers/utils.js.map +1 -0
  718. package/dist/plus/integrations/reads/context.d.ts +52 -0
  719. package/dist/plus/integrations/reads/context.d.ts.map +1 -0
  720. package/dist/plus/integrations/reads/context.js +2 -0
  721. package/dist/plus/integrations/reads/context.js.map +1 -0
  722. package/dist/plus/integrations/reads/cursors.d.ts +66 -0
  723. package/dist/plus/integrations/reads/cursors.d.ts.map +1 -0
  724. package/dist/plus/integrations/reads/cursors.js +133 -0
  725. package/dist/plus/integrations/reads/cursors.js.map +1 -0
  726. package/dist/plus/integrations/reads/drains.d.ts +60 -0
  727. package/dist/plus/integrations/reads/drains.d.ts.map +1 -0
  728. package/dist/plus/integrations/reads/drains.js +255 -0
  729. package/dist/plus/integrations/reads/drains.js.map +1 -0
  730. package/dist/plus/integrations/reads/filters.d.ts +81 -0
  731. package/dist/plus/integrations/reads/filters.d.ts.map +1 -0
  732. package/dist/plus/integrations/reads/filters.js +87 -0
  733. package/dist/plus/integrations/reads/filters.js.map +1 -0
  734. package/dist/plus/integrations/reads/hierarchy.d.ts +17 -0
  735. package/dist/plus/integrations/reads/hierarchy.d.ts.map +1 -0
  736. package/dist/plus/integrations/reads/hierarchy.js +348 -0
  737. package/dist/plus/integrations/reads/hierarchy.js.map +1 -0
  738. package/dist/plus/integrations/reads/hierarchy.utils.d.ts +53 -0
  739. package/dist/plus/integrations/reads/hierarchy.utils.d.ts.map +1 -0
  740. package/dist/plus/integrations/reads/hierarchy.utils.js +85 -0
  741. package/dist/plus/integrations/reads/hierarchy.utils.js.map +1 -0
  742. package/dist/plus/integrations/reads/issueTracker.d.ts +19 -0
  743. package/dist/plus/integrations/reads/issueTracker.d.ts.map +1 -0
  744. package/dist/plus/integrations/reads/issueTracker.js +346 -0
  745. package/dist/plus/integrations/reads/issueTracker.js.map +1 -0
  746. package/dist/plus/integrations/reads/issues.d.ts +34 -0
  747. package/dist/plus/integrations/reads/issues.d.ts.map +1 -0
  748. package/dist/plus/integrations/reads/issues.js +244 -0
  749. package/dist/plus/integrations/reads/issues.js.map +1 -0
  750. package/dist/plus/integrations/reads/paging.d.ts +136 -0
  751. package/dist/plus/integrations/reads/paging.d.ts.map +1 -0
  752. package/dist/plus/integrations/reads/paging.js +221 -0
  753. package/dist/plus/integrations/reads/paging.js.map +1 -0
  754. package/dist/plus/integrations/reads/pullRequests.d.ts +32 -0
  755. package/dist/plus/integrations/reads/pullRequests.d.ts.map +1 -0
  756. package/dist/plus/integrations/reads/pullRequests.js +151 -0
  757. package/dist/plus/integrations/reads/pullRequests.js.map +1 -0
  758. package/dist/plus/integrations/reads/warnings.d.ts +47 -0
  759. package/dist/plus/integrations/reads/warnings.d.ts.map +1 -0
  760. package/dist/plus/integrations/reads/warnings.js +81 -0
  761. package/dist/plus/integrations/reads/warnings.js.map +1 -0
  762. package/dist/plus/integrations/results.d.ts +189 -0
  763. package/dist/plus/integrations/results.d.ts.map +1 -0
  764. package/dist/plus/integrations/results.js +62 -0
  765. package/dist/plus/integrations/results.js.map +1 -0
  766. package/dist/plus/integrations/telemetry.d.ts +26 -0
  767. package/dist/plus/integrations/telemetry.d.ts.map +1 -0
  768. package/dist/plus/integrations/telemetry.js +11 -0
  769. package/dist/plus/integrations/telemetry.js.map +1 -0
  770. package/dist/plus/integrations/utils/domain.utils.d.ts +5 -0
  771. package/dist/plus/integrations/utils/domain.utils.d.ts.map +1 -0
  772. package/dist/plus/integrations/utils/domain.utils.js +27 -0
  773. package/dist/plus/integrations/utils/domain.utils.js.map +1 -0
  774. package/dist/plus/integrations/utils/integration.utils.d.ts +40 -0
  775. package/dist/plus/integrations/utils/integration.utils.d.ts.map +1 -0
  776. package/dist/plus/integrations/utils/integration.utils.js +182 -0
  777. package/dist/plus/integrations/utils/integration.utils.js.map +1 -0
  778. package/dist/utils/array.d.ts.map +1 -1
  779. package/dist/utils/array.js.map +1 -1
  780. package/dist/utils/brand.d.ts.map +1 -1
  781. package/dist/utils/cancellation.d.ts +13 -0
  782. package/dist/utils/cancellation.d.ts.map +1 -1
  783. package/dist/utils/cancellation.js +52 -7
  784. package/dist/utils/cancellation.js.map +1 -1
  785. package/dist/utils/charCode.d.ts.map +1 -1
  786. package/dist/utils/coalescedRun.d.ts +16 -0
  787. package/dist/utils/coalescedRun.d.ts.map +1 -0
  788. package/dist/utils/coalescedRun.js +43 -0
  789. package/dist/utils/coalescedRun.js.map +1 -0
  790. package/dist/utils/color.d.ts.map +1 -1
  791. package/dist/utils/color.js +3 -3
  792. package/dist/utils/color.js.map +1 -1
  793. package/dist/utils/date.d.ts +24 -0
  794. package/dist/utils/date.d.ts.map +1 -1
  795. package/dist/utils/date.js +62 -0
  796. package/dist/utils/date.js.map +1 -1
  797. package/dist/utils/debounce.js +1 -1
  798. package/dist/utils/debounce.js.map +1 -1
  799. package/dist/utils/decorators/debounce.d.ts.map +1 -1
  800. package/dist/utils/decorators/debounce.js.map +1 -1
  801. package/dist/utils/decorators/gate.d.ts.map +1 -1
  802. package/dist/utils/decorators/gate.js +2 -2
  803. package/dist/utils/decorators/gate.js.map +1 -1
  804. package/dist/utils/decorators/log.d.ts.map +1 -1
  805. package/dist/utils/decorators/log.js +5 -5
  806. package/dist/utils/decorators/log.js.map +1 -1
  807. package/dist/utils/decorators/memoize.d.ts.map +1 -1
  808. package/dist/utils/decorators/memoize.js +2 -2
  809. package/dist/utils/decorators/memoize.js.map +1 -1
  810. package/dist/utils/decorators/resolver.d.ts.map +1 -1
  811. package/dist/utils/decorators/resolver.js.map +1 -1
  812. package/dist/utils/decorators/sequentialize.d.ts.map +1 -1
  813. package/dist/utils/decorators/sequentialize.js +2 -2
  814. package/dist/utils/decorators/sequentialize.js.map +1 -1
  815. package/dist/utils/decorators/serializable.d.ts.map +1 -1
  816. package/dist/utils/decorators/serializable.js +1 -1
  817. package/dist/utils/decorators/serializable.js.map +1 -1
  818. package/dist/utils/dedupedAsyncCache.d.ts.map +1 -1
  819. package/dist/utils/disposable.d.ts +15 -2
  820. package/dist/utils/disposable.d.ts.map +1 -1
  821. package/dist/utils/disposable.js.map +1 -1
  822. package/dist/utils/env/browser/base64.d.ts.map +1 -1
  823. package/dist/utils/env/browser/base64.js.map +1 -1
  824. package/dist/utils/env/browser/crypto.d.ts.map +1 -1
  825. package/dist/utils/env/browser/crypto.js.map +1 -1
  826. package/dist/utils/env/browser/fs.d.ts.map +1 -1
  827. package/dist/utils/env/browser/fs.js.map +1 -1
  828. package/dist/utils/env/browser/hex.d.ts.map +1 -1
  829. package/dist/utils/env/browser/hex.js.map +1 -1
  830. package/dist/utils/env/browser/hrtime.d.ts.map +1 -1
  831. package/dist/utils/env/browser/hrtime.js.map +1 -1
  832. package/dist/utils/env/browser/logScope.d.ts.map +1 -1
  833. package/dist/utils/env/browser/logScope.js.map +1 -1
  834. package/dist/utils/env/browser/md5.d.ts.map +1 -1
  835. package/dist/utils/env/browser/md5.js.map +1 -1
  836. package/dist/utils/env/browser/platform.d.ts.map +1 -1
  837. package/dist/utils/env/browser/platform.js.map +1 -1
  838. package/dist/utils/env/node/base64.d.ts.map +1 -1
  839. package/dist/utils/env/node/base64.js.map +1 -1
  840. package/dist/utils/env/node/crypto.d.ts.map +1 -1
  841. package/dist/utils/env/node/crypto.js.map +1 -1
  842. package/dist/utils/env/node/exec.d.ts +9 -1
  843. package/dist/utils/env/node/exec.d.ts.map +1 -1
  844. package/dist/utils/env/node/exec.js +11 -4
  845. package/dist/utils/env/node/exec.js.map +1 -1
  846. package/dist/utils/env/node/fs.d.ts.map +1 -1
  847. package/dist/utils/env/node/fs.js.map +1 -1
  848. package/dist/utils/env/node/hex.d.ts.map +1 -1
  849. package/dist/utils/env/node/hex.js.map +1 -1
  850. package/dist/utils/env/node/hrtime.d.ts.map +1 -1
  851. package/dist/utils/env/node/hrtime.js.map +1 -1
  852. package/dist/utils/env/node/logScope.d.ts.map +1 -1
  853. package/dist/utils/env/node/logScope.js.map +1 -1
  854. package/dist/utils/env/node/platform.d.ts.map +1 -1
  855. package/dist/utils/env/node/platform.js.map +1 -1
  856. package/dist/utils/event.d.ts.map +1 -1
  857. package/dist/utils/event.js +18 -22
  858. package/dist/utils/event.js.map +1 -1
  859. package/dist/utils/formatter.d.ts.map +1 -1
  860. package/dist/utils/formatter.js.map +1 -1
  861. package/dist/utils/function.d.ts.map +1 -1
  862. package/dist/utils/function.js +3 -3
  863. package/dist/utils/function.js.map +1 -1
  864. package/dist/utils/hash.js.map +1 -1
  865. package/dist/utils/iterable.d.ts.map +1 -1
  866. package/dist/utils/iterable.js +2 -6
  867. package/dist/utils/iterable.js.map +1 -1
  868. package/dist/utils/lazy.d.ts.map +1 -1
  869. package/dist/utils/lazy.js.map +1 -1
  870. package/dist/utils/logger.d.ts.map +1 -1
  871. package/dist/utils/logger.js +1 -1
  872. package/dist/utils/logger.js.map +1 -1
  873. package/dist/utils/logger.scoped.js +1 -1
  874. package/dist/utils/logger.scoped.js.map +1 -1
  875. package/dist/utils/lruMap.d.ts.map +1 -1
  876. package/dist/utils/lruMap.js.map +1 -1
  877. package/dist/utils/mru.d.ts.map +1 -1
  878. package/dist/utils/mru.js.map +1 -1
  879. package/dist/utils/object.js.map +1 -1
  880. package/dist/utils/paging.d.ts +29 -0
  881. package/dist/utils/paging.d.ts.map +1 -1
  882. package/dist/utils/paging.js +18 -0
  883. package/dist/utils/paging.js.map +1 -1
  884. package/dist/utils/path.js.map +1 -1
  885. package/dist/utils/promise.d.ts +10 -0
  886. package/dist/utils/promise.d.ts.map +1 -1
  887. package/dist/utils/promise.js +26 -3
  888. package/dist/utils/promise.js.map +1 -1
  889. package/dist/utils/promiseCache.d.ts +12 -2
  890. package/dist/utils/promiseCache.d.ts.map +1 -1
  891. package/dist/utils/promiseCache.js +80 -50
  892. package/dist/utils/promiseCache.js.map +1 -1
  893. package/dist/utils/searchTree.d.ts.map +1 -1
  894. package/dist/utils/searchTree.js +4 -1
  895. package/dist/utils/searchTree.js.map +1 -1
  896. package/dist/utils/stopwatch.d.ts.map +1 -1
  897. package/dist/utils/string.js +1 -1
  898. package/dist/utils/string.js.map +1 -1
  899. package/dist/utils/subscriptionManager.d.ts.map +1 -1
  900. package/dist/utils/subscriptionManager.js.map +1 -1
  901. package/dist/utils/trie.d.ts.map +1 -1
  902. package/dist/utils/trie.js +1 -0
  903. package/dist/utils/trie.js.map +1 -1
  904. package/docs/integrations.md +372 -0
  905. package/docs/kepler-read-api-parity.md +112 -0
  906. package/package.json +238 -172
  907. package/src/git/cache.ts +75 -8
  908. package/src/git/context.ts +4 -3
  909. package/src/git/errors.ts +36 -1
  910. package/src/git/models/commit.ts +1 -1
  911. package/src/git/models/graph.ts +147 -0
  912. package/src/git/models/graphSession.ts +205 -0
  913. package/src/git/models/issue.ts +12 -1
  914. package/src/git/models/pullRequest.ts +27 -1
  915. package/src/git/models/repository.ts +24 -1
  916. package/src/git/models/resourceDescriptor.ts +17 -0
  917. package/src/git/models/signature.ts +16 -0
  918. package/src/git/models/tag.ts +6 -1
  919. package/src/git/parsers/diffParser.ts +1 -1
  920. package/src/git/providers/branches.ts +6 -1
  921. package/src/git/providers/commits.ts +6 -1
  922. package/src/git/providers/config.ts +5 -1
  923. package/src/git/providers/graph.ts +69 -2
  924. package/src/git/providers/operations.ts +1 -1
  925. package/src/git/providers/status.ts +1 -1
  926. package/src/git/providers/worktrees.ts +17 -3
  927. package/src/git/remotes/azure-devops.ts +29 -33
  928. package/src/git/remotes/bitbucket-server.ts +23 -25
  929. package/src/git/remotes/bitbucket.ts +23 -25
  930. package/src/git/remotes/gerrit.ts +12 -14
  931. package/src/git/remotes/gitea.ts +13 -15
  932. package/src/git/remotes/github.ts +56 -58
  933. package/src/git/remotes/gitlab.ts +102 -104
  934. package/src/git/run.types.ts +54 -4
  935. package/src/git/utils/branch.utils.ts +12 -1
  936. package/src/git/utils/conflictResolution.utils.ts +126 -0
  937. package/src/git/utils/contributor.utils.ts +1 -1
  938. package/src/git/utils/fileStatus.utils.ts +7 -0
  939. package/src/git/utils/graph.utils.ts +46 -0
  940. package/src/git/utils/issue.utils.ts +1 -0
  941. package/src/git/utils/pullRequest.utils.ts +9 -0
  942. package/src/git/utils/reachability.utils.ts +79 -8
  943. package/src/git/utils/sshKey.utils.ts +30 -0
  944. package/src/git/watching/watchService.ts +16 -1
  945. package/src/git/watching/watchSession.ts +20 -2
  946. package/src/git-cli/exec/git.ts +144 -42
  947. package/src/git-cli/parsers/logParser.ts +83 -1
  948. package/src/git-cli/parsers/sshSignatureParser.ts +85 -0
  949. package/src/git-cli/parsers/worktreeParser.ts +5 -7
  950. package/src/git-cli/providers/branches.ts +60 -38
  951. package/src/git-cli/providers/commits.ts +102 -9
  952. package/src/git-cli/providers/graph.ts +1771 -393
  953. package/src/git-cli/providers/operations.ts +22 -2
  954. package/src/git-cli/providers/pausedOperations.ts +3 -3
  955. package/src/git-cli/providers/revision.ts +42 -0
  956. package/src/git-cli/providers/status.ts +333 -178
  957. package/src/git-cli/providers/tags.ts +2 -0
  958. package/src/git-cli/providers/worktrees.ts +57 -6
  959. package/src/git-cli/service.ts +9 -0
  960. package/src/ipc/ipcServer.ts +1 -1
  961. package/src/plus/agents/providers/claudeCodeProvider.ts +25 -0
  962. package/src/plus/agents/providers/claudeCodeTranscript.ts +320 -8
  963. package/src/plus/agents/types.ts +34 -0
  964. package/src/plus/ai/constants.ts +1 -9
  965. package/src/plus/ai/models/model.ts +53 -2
  966. package/src/plus/ai/models/promptTemplates.ts +9 -2
  967. package/src/plus/ai/prompts.ts +16 -48
  968. package/src/plus/ai/providers/anthropicProvider.ts +45 -3
  969. package/src/plus/ai/providers/deepSeekProvider.ts +17 -1
  970. package/src/plus/ai/providers/geminiProvider.ts +25 -6
  971. package/src/plus/ai/providers/gitkrakenProvider.ts +2 -0
  972. package/src/plus/ai/providers/huggingFaceProvider.ts +28 -21
  973. package/src/plus/ai/providers/openAICompatibleProviderBase.ts +16 -1
  974. package/src/plus/ai/providers/xaiProvider.ts +14 -1
  975. package/src/plus/ai/utils/ai.utils.ts +5 -7
  976. package/src/plus/ai/utils/results.utils.ts +32 -0
  977. package/src/plus/ai/utils/truncation.utils.ts +0 -1
  978. package/src/plus/git-github/api/github.ts +497 -129
  979. package/src/plus/git-github/models.ts +33 -0
  980. package/src/plus/git-github/providers/github/branches.ts +6 -3
  981. package/src/plus/git-github/providers/github/diff.ts +1 -1
  982. package/src/plus/git-github/providers/github/graph.ts +131 -0
  983. package/src/plus/git-github/providers/github/tags.ts +2 -0
  984. package/src/plus/integrations/authentication/cloudIntegrationService.ts +292 -0
  985. package/src/plus/integrations/authentication/configuredIntegrationService.ts +651 -0
  986. package/src/plus/integrations/authentication/integrationAuthenticationProvider.ts +363 -0
  987. package/src/plus/integrations/authentication/integrationAuthenticationService.ts +148 -0
  988. package/src/plus/integrations/authentication/manualTokenProvider.ts +79 -0
  989. package/src/plus/integrations/authentication/models.ts +202 -0
  990. package/src/plus/integrations/collectionMetadata.ts +143 -0
  991. package/src/plus/integrations/constants.ts +190 -0
  992. package/src/plus/integrations/context.ts +382 -0
  993. package/src/plus/integrations/errors.ts +184 -0
  994. package/src/plus/integrations/index.ts +216 -0
  995. package/src/plus/integrations/integrationService.ts +2589 -0
  996. package/src/plus/integrations/lite.ts +233 -0
  997. package/src/plus/integrations/manager.ts +359 -0
  998. package/src/plus/integrations/models/gitHostIntegration.ts +1631 -0
  999. package/src/plus/integrations/models/integration.ts +926 -0
  1000. package/src/plus/integrations/models/issuesIntegration.ts +264 -0
  1001. package/src/plus/integrations/providerFilters.ts +12 -0
  1002. package/src/plus/integrations/providers/apiClients.ts +69 -0
  1003. package/src/plus/integrations/providers/apiConfig.ts +71 -0
  1004. package/src/plus/integrations/providers/azure/azure.ts +822 -0
  1005. package/src/plus/integrations/providers/azure/models.ts +618 -0
  1006. package/src/plus/integrations/providers/azureDevOps.ts +1342 -0
  1007. package/src/plus/integrations/providers/bitbucket/bitbucket.ts +904 -0
  1008. package/src/plus/integrations/providers/bitbucket/models.ts +445 -0
  1009. package/src/plus/integrations/providers/bitbucket-server/models.ts +283 -0
  1010. package/src/plus/integrations/providers/bitbucket-server.ts +447 -0
  1011. package/src/plus/integrations/providers/bitbucket.ts +794 -0
  1012. package/src/plus/integrations/providers/github/github.ts +64 -0
  1013. package/src/plus/integrations/providers/github/github.utils.ts +23 -0
  1014. package/src/plus/integrations/providers/github/models.ts +29 -0
  1015. package/src/plus/integrations/providers/github.ts +750 -0
  1016. package/src/plus/integrations/providers/gitlab/gitlab.ts +1320 -0
  1017. package/src/plus/integrations/providers/gitlab/gitlab.utils.ts +80 -0
  1018. package/src/plus/integrations/providers/gitlab/models.ts +271 -0
  1019. package/src/plus/integrations/providers/gitlab.ts +832 -0
  1020. package/src/plus/integrations/providers/jira.ts +564 -0
  1021. package/src/plus/integrations/providers/linear.ts +402 -0
  1022. package/src/plus/integrations/providers/models.ts +1622 -0
  1023. package/src/plus/integrations/providers/providersApi.ts +1889 -0
  1024. package/src/plus/integrations/providers/trello.ts +205 -0
  1025. package/src/plus/integrations/providers/utils/providerPaging.ts +177 -0
  1026. package/src/plus/integrations/providers/utils.ts +419 -0
  1027. package/src/plus/integrations/reads/context.ts +75 -0
  1028. package/src/plus/integrations/reads/cursors.ts +224 -0
  1029. package/src/plus/integrations/reads/drains.ts +343 -0
  1030. package/src/plus/integrations/reads/filters.ts +124 -0
  1031. package/src/plus/integrations/reads/hierarchy.ts +493 -0
  1032. package/src/plus/integrations/reads/hierarchy.utils.ts +106 -0
  1033. package/src/plus/integrations/reads/issueTracker.ts +480 -0
  1034. package/src/plus/integrations/reads/issues.ts +407 -0
  1035. package/src/plus/integrations/reads/paging.ts +277 -0
  1036. package/src/plus/integrations/reads/pullRequests.ts +267 -0
  1037. package/src/plus/integrations/reads/warnings.ts +170 -0
  1038. package/src/plus/integrations/results.ts +275 -0
  1039. package/src/plus/integrations/telemetry.ts +29 -0
  1040. package/src/plus/integrations/utils/domain.utils.ts +26 -0
  1041. package/src/plus/integrations/utils/integration.utils.ts +215 -0
  1042. package/src/utils/brand.ts +0 -2
  1043. package/src/utils/cancellation.ts +56 -7
  1044. package/src/utils/coalescedRun.ts +45 -0
  1045. package/src/utils/color.ts +3 -3
  1046. package/src/utils/date.ts +72 -0
  1047. package/src/utils/debounce.ts +1 -1
  1048. package/src/utils/decorators/gate.ts +2 -2
  1049. package/src/utils/decorators/log.ts +5 -5
  1050. package/src/utils/decorators/memoize.ts +2 -2
  1051. package/src/utils/decorators/sequentialize.ts +2 -2
  1052. package/src/utils/decorators/serializable.ts +1 -1
  1053. package/src/utils/disposable.ts +15 -2
  1054. package/src/utils/env/node/exec.ts +20 -5
  1055. package/src/utils/event.ts +19 -25
  1056. package/src/utils/function.ts +3 -3
  1057. package/src/utils/iterable.ts +2 -6
  1058. package/src/utils/logger.scoped.ts +1 -1
  1059. package/src/utils/logger.ts +1 -1
  1060. package/src/utils/paging.ts +46 -0
  1061. package/src/utils/promise.ts +33 -3
  1062. package/src/utils/promiseCache.ts +81 -51
  1063. package/src/utils/searchTree.ts +4 -2
  1064. package/src/utils/string.ts +1 -1
  1065. package/src/utils/trie.ts +1 -0
  1066. package/dist/plus/ai/providers/githubModelsProvider.d.ts +0 -19
  1067. package/dist/plus/ai/providers/githubModelsProvider.d.ts.map +0 -1
  1068. package/dist/plus/ai/providers/githubModelsProvider.js +0 -51
  1069. package/dist/plus/ai/providers/githubModelsProvider.js.map +0 -1
  1070. package/src/plus/ai/providers/githubModelsProvider.ts +0 -92
@@ -0,0 +1,1342 @@
1
+ import type { CollectionMetadata, CollectionScope, CollectionScopeFailure } from '@gitkraken/provider-apis';
2
+ import type { Account, UnidentifiedAuthor } from '../../../git/models/author.js';
3
+ import type { DefaultBranch } from '../../../git/models/defaultBranch.js';
4
+ import type { Issue, IssueShape } from '../../../git/models/issue.js';
5
+ import type { IssueOrPullRequest, IssueOrPullRequestType } from '../../../git/models/issueOrPullRequest.js';
6
+ import type {
7
+ PullRequest,
8
+ PullRequestMergeMethod,
9
+ PullRequestState,
10
+ PullRequestStateFilter,
11
+ } from '../../../git/models/pullRequest.js';
12
+ import type { RepositoryMetadata } from '../../../git/models/repositoryMetadata.js';
13
+ import type { ResourceDescriptor } from '../../../git/models/resourceDescriptor.js';
14
+ import { base64 } from '../../../utils/base64.js';
15
+ import { CancellationError } from '../../../utils/cancellation.js';
16
+ import type { Emitter } from '../../../utils/event.js';
17
+ import type { IntegrationAuthenticationProviderDescriptor } from '../authentication/integrationAuthenticationProvider.js';
18
+ import type { IntegrationAuthenticationService } from '../authentication/integrationAuthenticationService.js';
19
+ import type {
20
+ AuthenticationSessionLike as AuthenticationSession,
21
+ ProviderAuthenticationSession,
22
+ TokenWithInfo,
23
+ } from '../authentication/models.js';
24
+ import { toTokenWithInfo } from '../authentication/models.js';
25
+ import { toCollectionScopeFailure } from '../collectionMetadata.js';
26
+ import { GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId } from '../constants.js';
27
+ import type { IntegrationServiceContext } from '../context.js';
28
+ import type { IntegrationConnectionChangeEvent } from '../integrationService.js';
29
+ import type { SearchMyPullRequestsOptions } from '../models/gitHostIntegration.js';
30
+ import { GitHostIntegration } from '../models/gitHostIntegration.js';
31
+ import type { AccountWideIssuesResult, IntegrationKey, SearchMyIssuesOptions } from '../models/integration.js';
32
+ import type {
33
+ AzureOrganizationDescriptor,
34
+ AzureProjectDescriptor,
35
+ AzureProjectInputDescriptor,
36
+ AzureRemoteRepositoryDescriptor,
37
+ AzureRepositoryDescriptor,
38
+ } from './azure/models.js';
39
+ import type {
40
+ ProviderApiCollectionResult,
41
+ ProviderApiPagedResult,
42
+ ProviderHierarchyResult,
43
+ ProviderOrganization,
44
+ ProviderPullRequest,
45
+ ProviderRepoInput,
46
+ ProviderRepository,
47
+ } from './models.js';
48
+ import {
49
+ fromProviderIssue,
50
+ fromProviderPullRequest,
51
+ getProviderPullRequestIdentity,
52
+ IssueFilter,
53
+ providerPullRequestMatchesSearch,
54
+ providersMetadata,
55
+ PullRequestFilter,
56
+ toProviderPullRequestStates,
57
+ } from './models.js';
58
+ import type { ProvidersApi } from './providersApi.js';
59
+ import { collectProviderPagedResult, flatSettledOrThrow, mergeCollectionMetadata } from './utils/providerPaging.js';
60
+
61
+ function getAzureRepositoryIdentity(repo: Pick<AzureRepositoryDescriptor, 'owner' | 'name' | 'project'>): {
62
+ resourceName: string;
63
+ projectName?: string;
64
+ repositoryName: string;
65
+ } {
66
+ const match = /^([^/]+)\/_git\/([^/]+)$/i.exec(repo.name);
67
+ return {
68
+ resourceName: repo.owner,
69
+ projectName: repo.project ?? match?.[1],
70
+ repositoryName: match?.[2] ?? repo.name,
71
+ };
72
+ }
73
+
74
+ /**
75
+ * Matches an org/project descriptor against a caller-supplied name, mirroring the facade's own
76
+ * key/id/name comparison so `listIssuesPage({ org, project })` narrows on the same identifiers a consumer
77
+ * already got back from `listOrgs`/`listProjects`.
78
+ */
79
+ function azureResourceMatches(resource: { key?: string; id?: string; name?: string }, value: string): boolean {
80
+ return resource.key === value || resource.id === value || resource.name === value;
81
+ }
82
+
83
+ export abstract class AzureDevOpsIntegrationBase<
84
+ TIntegrationId extends GitCloudHostIntegrationId.AzureDevOps | GitSelfManagedHostIntegrationId.AzureDevOpsServer,
85
+ TRepositoryDescriptor extends AzureRepositoryDescriptor = AzureRepositoryDescriptor,
86
+ > extends GitHostIntegration<TIntegrationId, TRepositoryDescriptor> {
87
+ protected abstract get apiBaseUrl(): string;
88
+ protected getApiOptions(
89
+ session: ProviderAuthenticationSession,
90
+ doNotConvertToPat: boolean = false,
91
+ ): {
92
+ tokenWithInfo: TokenWithInfo<TIntegrationId>;
93
+ options: { isPAT: boolean; baseUrl?: string };
94
+ } {
95
+ const usePat = !doNotConvertToPat;
96
+ const accessToken = usePat ? convertTokentoPAT(session.accessToken) : session.accessToken;
97
+ const tokenWithInfo = toTokenWithInfo<TIntegrationId>(this.id, session, accessToken);
98
+ return {
99
+ tokenWithInfo: tokenWithInfo,
100
+ options: { isPAT: usePat },
101
+ };
102
+ }
103
+
104
+ private _accounts: Map<string, Account | undefined> | undefined;
105
+ protected override async getProviderCurrentAccount(
106
+ session: ProviderAuthenticationSession,
107
+ ): Promise<Account | undefined> {
108
+ const { accessToken } = session;
109
+ this._accounts ??= new Map<string, Account | undefined>();
110
+
111
+ const cachedAccount = this._accounts.get(accessToken);
112
+ if (cachedAccount == null) {
113
+ const user = await this._requestForCurrentUser(session);
114
+ this._accounts.set(accessToken, user);
115
+ }
116
+
117
+ return this._accounts.get(accessToken);
118
+ }
119
+
120
+ protected async _requestForCurrentUser(session: ProviderAuthenticationSession): Promise<Account | undefined> {
121
+ const api = await this.getProvidersApi();
122
+ const { tokenWithInfo, options } = this.getApiOptions(session, true);
123
+ const user = await api.getCurrentUser(tokenWithInfo, options);
124
+ return user
125
+ ? {
126
+ provider: this,
127
+ id: user.id,
128
+ name: user.name ?? undefined,
129
+ email: user.email ?? undefined,
130
+ avatarUrl: user.avatarUrl ?? undefined,
131
+ username: user.username ?? undefined,
132
+ }
133
+ : undefined;
134
+ }
135
+
136
+ private _organizations: Map<string, AzureOrganizationDescriptor[] | undefined> | undefined;
137
+ private async getProviderResourcesForUser(
138
+ session: ProviderAuthenticationSession,
139
+ force: boolean = false,
140
+ ): Promise<AzureOrganizationDescriptor[] | undefined> {
141
+ this._organizations ??= new Map<string, AzureOrganizationDescriptor[] | undefined>();
142
+ const { accessToken } = session;
143
+ const cachedResources = this._organizations.get(accessToken);
144
+
145
+ if (cachedResources == null || force) {
146
+ const api = await this.getProvidersApi();
147
+ const account = await this.getProviderCurrentAccount(session);
148
+ if (account?.id == null) return undefined;
149
+
150
+ const { tokenWithInfo, options } = this.getApiOptions(session);
151
+ const resources = await api.getAzureResourcesForUser(tokenWithInfo, account.id, options);
152
+ this._organizations.set(
153
+ accessToken,
154
+ resources != null ? resources.map(r => ({ ...r, key: r.id })) : undefined,
155
+ );
156
+ }
157
+
158
+ return this._organizations.get(accessToken);
159
+ }
160
+
161
+ private _projects: Map<string, AzureProjectDescriptor[] | undefined> | undefined;
162
+ /**
163
+ * Discovers (and caches) each resource's projects. Only resources whose drain completed cleanly are cached;
164
+ * a rejected or backstop-truncated drain is left uncached (retried next call). When `failures` is supplied,
165
+ * a rejected resource is recorded there as a structured {@link CollectionScopeFailure} so an account-wide
166
+ * caller can surface the incomplete project set (a whole org's PRs/issues silently missing otherwise) as a
167
+ * scope-aware warning + `fetchFailed` rather than an all-pages success over a hole.
168
+ */
169
+ private async getProviderProjectsForResources(
170
+ session: ProviderAuthenticationSession,
171
+ resources: AzureOrganizationDescriptor[],
172
+ force: boolean = false,
173
+ failures?: CollectionScopeFailure[],
174
+ ): Promise<ProviderApiCollectionResult<AzureProjectDescriptor>> {
175
+ this._projects ??= new Map<string, AzureProjectDescriptor[] | undefined>();
176
+ const { accessToken } = session;
177
+
178
+ let resourcesWithoutProjects = [];
179
+ if (force) {
180
+ resourcesWithoutProjects = resources;
181
+ } else {
182
+ for (const resource of resources) {
183
+ const resourceKey = `${accessToken}:${resource.id}`;
184
+ const cachedProjects = this._projects.get(resourceKey);
185
+ if (cachedProjects == null) {
186
+ resourcesWithoutProjects.push(resource);
187
+ }
188
+ }
189
+ }
190
+
191
+ const allProjects: AzureProjectDescriptor[] = [];
192
+ let resultMetadata: CollectionMetadata | undefined;
193
+
194
+ if (resourcesWithoutProjects.length > 0) {
195
+ const api = await this.getProvidersApi();
196
+ const { tokenWithInfo, options } = this.getApiOptions(session);
197
+ // The projects API is paginated; a single call would drop every project past the first page (and
198
+ // with it their repos and PRs). Drain all pages per resource, threading the returned cursor.
199
+ // Per-resource (not a shared flatSettled) so a resource whose drain was truncated (hit the paging
200
+ // backstop) or rejected is NOT cached — caching a partial list here would make every later repo/PR/
201
+ // issue read for that org silently inherit an incomplete project set. Leaving it uncached means the
202
+ // next call retries it. The scope is passed so a page-level failure preserves the prefix already
203
+ // fetched and records a structured failure instead of re-throwing.
204
+ const drains = await Promise.allSettled(
205
+ resourcesWithoutProjects.map(async resource => ({
206
+ resource: resource,
207
+ result: await collectProviderPagedResult(
208
+ cursor =>
209
+ api.getAzureProjectsForResource(tokenWithInfo, resource.name, {
210
+ ...options,
211
+ cursor: cursor,
212
+ }),
213
+ 20,
214
+ { providerId: this.id, resourceId: resource.id },
215
+ ),
216
+ })),
217
+ );
218
+
219
+ // `allSettled` preserves order, so `drains[i]` is `resourcesWithoutProjects[i]`.
220
+ drains.forEach((drain, i) => {
221
+ // A rejected resource drain contributes nothing and is left uncached (retried next call). Record
222
+ // it as a structured failure so an account-wide caller can warn on the org whose projects (and
223
+ // thus PRs/issues) are missing, instead of silently narrowing the read.
224
+ if (drain.status !== 'fulfilled') {
225
+ const resource = resourcesWithoutProjects[i];
226
+ const failure = toCollectionScopeFailure(
227
+ { providerId: this.id, resourceId: resource.id },
228
+ drain.reason,
229
+ );
230
+ failures?.push(failure);
231
+ resultMetadata = mergeCollectionMetadata(resultMetadata, {
232
+ completeness: 'partial',
233
+ failures: [failure],
234
+ });
235
+ return;
236
+ }
237
+
238
+ const { resource, result } = drain.value;
239
+ const projects = result.values
240
+ .filter(p => p.namespace === resource.name)
241
+ .map(p => ({
242
+ id: p.id,
243
+ name: p.name,
244
+ resourceId: resource.id,
245
+ resourceName: resource.name,
246
+ key: p.id,
247
+ }));
248
+
249
+ if (result.metadata != null) {
250
+ resultMetadata = mergeCollectionMetadata(resultMetadata, result.metadata);
251
+ }
252
+
253
+ const metadataIncomplete = result.metadata != null && result.metadata.completeness !== 'complete';
254
+ if (result.truncated || metadataIncomplete) {
255
+ // A truncated drain is an incomplete project set; include its partial values in the current
256
+ // result but don't cache it as if complete. Add a structured failure for the truncation unless
257
+ // the drain already recorded a page-level failure for this resource.
258
+ if (
259
+ result.truncated &&
260
+ !result.metadata?.failures?.some(
261
+ f => f.scope?.resourceId === resource.id && f.kind !== 'unknown',
262
+ )
263
+ ) {
264
+ const failure = toCollectionScopeFailure(
265
+ { providerId: this.id, resourceId: resource.id },
266
+ new Error('Project discovery was truncated before all pages were read'),
267
+ );
268
+ failures?.push(failure);
269
+ resultMetadata = mergeCollectionMetadata(resultMetadata, {
270
+ completeness: 'partial',
271
+ failures: [failure],
272
+ });
273
+ }
274
+ allProjects.push(...projects);
275
+ return;
276
+ }
277
+
278
+ this._projects!.set(`${accessToken}:${resource.id}`, projects);
279
+ });
280
+ }
281
+
282
+ const cachedProjects = resources.reduce<AzureProjectDescriptor[]>((projects, resource) => {
283
+ const resourceProjects = this._projects!.get(`${accessToken}:${resource.id}`);
284
+ if (resourceProjects != null) {
285
+ projects.push(...resourceProjects);
286
+ }
287
+ return projects;
288
+ }, []);
289
+ allProjects.push(...cachedProjects);
290
+
291
+ const projectsByIdentity = new Map<string, AzureProjectDescriptor>();
292
+ for (const project of allProjects) {
293
+ const identity = `${project.resourceId}:${project.id}`;
294
+ if (!projectsByIdentity.has(identity)) {
295
+ projectsByIdentity.set(identity, project);
296
+ }
297
+ }
298
+ const values = [...projectsByIdentity.values()];
299
+ return resultMetadata != null ? { values: values, metadata: resultMetadata } : { values: values };
300
+ }
301
+
302
+ private async getRepoDescriptorsForProjects(
303
+ session: ProviderAuthenticationSession,
304
+ projects: AzureProjectDescriptor[],
305
+ ): Promise<Map<string, AzureRemoteRepositoryDescriptor[] | undefined>> {
306
+ const descriptors = new Map<string, AzureRemoteRepositoryDescriptor[] | undefined>();
307
+ if (projects.length === 0) return descriptors;
308
+
309
+ const api = await this.getProvidersApi();
310
+ const { tokenWithInfo, options } = this.getApiOptions(session);
311
+ await Promise.all(
312
+ projects.map(async project => {
313
+ const repos = (
314
+ await api.getReposForAzureProject(tokenWithInfo, project.resourceName, project.name, options)
315
+ )?.values;
316
+ if (repos != null && repos.length > 0) {
317
+ descriptors.set(
318
+ project.id,
319
+ repos.map(r => ({
320
+ id: r.id,
321
+ nodeId: r.graphQLId ?? undefined,
322
+ resourceName: project.resourceName,
323
+ name: r.name,
324
+ projectName: project.name,
325
+ url: r.webUrl ?? undefined,
326
+ cloneUrlHttps: r.httpsUrl ?? undefined,
327
+ cloneUrlSsh: r.sshUrl ?? undefined,
328
+ key: r.id,
329
+ })),
330
+ );
331
+ }
332
+ }),
333
+ );
334
+
335
+ return descriptors;
336
+ }
337
+
338
+ protected override async getProviderOrganizationsForUser(
339
+ session: ProviderAuthenticationSession,
340
+ ): Promise<ProviderHierarchyResult<ProviderOrganization> | undefined> {
341
+ const orgs = await this.getProviderResourcesForUser(session);
342
+ if (orgs == null) return undefined;
343
+
344
+ return {
345
+ values: orgs.map(o => ({
346
+ id: o.id,
347
+ providerId: this.id,
348
+ name: o.name,
349
+ url: `${this.apiBaseUrl}/${o.name}`,
350
+ })),
351
+ };
352
+ }
353
+
354
+ protected override async getProviderProjectsForOrg(
355
+ session: ProviderAuthenticationSession,
356
+ org?: string,
357
+ ): Promise<ProviderHierarchyResult<ProviderOrganization> | undefined> {
358
+ // Azure is the one git host with a project tier: repos live under org (resource) → project. Enumerate
359
+ // the user's orgs (optionally scoped to `org`), read their projects, and surface each as an org-shaped
360
+ // entry so the ProviderBackend facade can list them uniformly.
361
+ const orgs = await this.getProviderResourcesForUser(session);
362
+ if (orgs == null) return undefined;
363
+ if (orgs.length === 0) {
364
+ return { values: [], paging: { cursor: '{}', more: false } };
365
+ }
366
+
367
+ const scopedOrgs = org != null ? orgs.filter(o => o.name === org || o.id === org) : orgs;
368
+ if (scopedOrgs.length === 0) return { values: [] };
369
+
370
+ const projects = await this.getProviderProjectsForResources(session, scopedOrgs);
371
+ if (projects.values.length === 0 && projects.metadata == null) return { values: [] };
372
+
373
+ return {
374
+ values: projects.values.map(p => ({
375
+ id: p.id,
376
+ providerId: this.id,
377
+ name: p.name,
378
+ org: p.resourceName,
379
+ url: `${this.apiBaseUrl}/${p.resourceName}/${p.name}`,
380
+ })),
381
+ ...(projects.metadata != null ? { metadata: projects.metadata } : {}),
382
+ };
383
+ }
384
+
385
+ /**
386
+ * With `options.project`, returns one page of that project's repos (follow `paging.cursor` to page).
387
+ * Without a project it fans out across every project under `org` and returns them all at once — there's
388
+ * no single cursor to page a parallel merge — skipping any project that fails to list rather than
389
+ * failing the whole org. If any successful project drain hits the defensive page backstop, the merged
390
+ * result is marked `truncated` without exposing a synthetic cursor.
391
+ */
392
+ protected override async getProviderRepositoriesForOrg(
393
+ session: ProviderAuthenticationSession,
394
+ org: string,
395
+ options?: { project?: string; cursor?: string },
396
+ ): Promise<ProviderHierarchyResult<ProviderRepository> | undefined> {
397
+ const api = await this.getProvidersApi();
398
+ const { tokenWithInfo, options: apiOptions } = this.getApiOptions(session);
399
+
400
+ if (options?.project) {
401
+ return api.getReposForAzureProject(tokenWithInfo, org, options.project, {
402
+ ...apiOptions,
403
+ cursor: options.cursor,
404
+ });
405
+ }
406
+
407
+ const orgDescriptor = (await this.getProviderResourcesForUser(session))?.find(o => o.name === org);
408
+ if (orgDescriptor == null) return undefined;
409
+
410
+ const discoveryFailures: CollectionScopeFailure[] = [];
411
+ const projects = await this.getProviderProjectsForResources(session, [orgDescriptor], false, discoveryFailures);
412
+ // An empty result is only proven-empty when discovery itself succeeded; a rejected project-discovery
413
+ // leaves the repo set unknowable, so surface the discovery metadata rather than publishing a hole as a
414
+ // complete list.
415
+ if (projects.values.length === 0) {
416
+ return { values: [], metadata: projects.metadata };
417
+ }
418
+
419
+ let repoMetadata: CollectionMetadata | undefined;
420
+ const results = await Promise.allSettled(
421
+ projects.values.map(p =>
422
+ collectProviderPagedResult(
423
+ cursor =>
424
+ api.getReposForAzureProject(tokenWithInfo, org, p.name, { ...apiOptions, cursor: cursor }),
425
+ 20,
426
+ { providerId: this.id, resourceId: org, projectId: p.name },
427
+ ),
428
+ ),
429
+ );
430
+
431
+ const values: ProviderRepository[] = [];
432
+ let truncated = false;
433
+ for (const result of results) {
434
+ // With a per-project scope, collectProviderPagedResult catches page-level failures itself and returns
435
+ // them as metadata rather than rejecting. A rejected promise here is an unexpected internal error.
436
+ if (result.status !== 'fulfilled') {
437
+ truncated = true;
438
+ continue;
439
+ }
440
+
441
+ values.push(...result.value.values);
442
+ if (result.value.metadata != null) {
443
+ repoMetadata = mergeCollectionMetadata(repoMetadata, result.value.metadata);
444
+ }
445
+ truncated ||= result.value.truncated === true;
446
+ }
447
+
448
+ const metadata = mergeCollectionMetadata(repoMetadata, projects.metadata);
449
+ return {
450
+ values: values,
451
+ ...(metadata != null ? { metadata: metadata } : {}),
452
+ ...(truncated || (metadata != null && metadata.completeness !== 'complete') ? { truncated: true } : {}),
453
+ };
454
+ }
455
+
456
+ protected override async mergeProviderPullRequest(
457
+ session: ProviderAuthenticationSession,
458
+ pr: PullRequest,
459
+ options?: {
460
+ mergeMethod?: PullRequestMergeMethod;
461
+ },
462
+ ): Promise<boolean> {
463
+ const api = await this.getProvidersApi();
464
+ if (pr.refs == null || pr.project == null) return false;
465
+
466
+ const { tokenWithInfo, options: apiOptions } = this.getApiOptions(session);
467
+
468
+ try {
469
+ const merged = await api.mergePullRequest(tokenWithInfo, pr, {
470
+ ...options,
471
+ ...apiOptions,
472
+ });
473
+ return merged;
474
+ } catch (ex) {
475
+ this.showMergeErrorMessage(ex);
476
+ return false;
477
+ }
478
+ }
479
+
480
+ protected showMergeErrorMessage(ex: Error): void {
481
+ this.ctx.hooks?.ui?.onError?.(
482
+ `${ex.message}. Check branch policies, and ensure you have the necessary permissions to merge the pull request.`,
483
+ );
484
+ }
485
+
486
+ protected override async getProviderAccountForCommit(
487
+ session: ProviderAuthenticationSession,
488
+ repo: AzureRepositoryDescriptor,
489
+ rev: string,
490
+ options?: {
491
+ avatarSize?: number;
492
+ },
493
+ ): Promise<UnidentifiedAuthor | undefined> {
494
+ return (await this.authenticationService.apis.azure)?.getAccountForCommit(
495
+ this,
496
+ toTokenWithInfo(this.id, session),
497
+ repo.owner,
498
+ repo.name,
499
+ rev,
500
+ this.apiBaseUrl,
501
+ options,
502
+ );
503
+ }
504
+
505
+ protected override async getProviderAccountForEmail(
506
+ _session: AuthenticationSession,
507
+ _repo: AzureRepositoryDescriptor,
508
+ _email: string,
509
+ _options?: {
510
+ avatarSize?: number;
511
+ },
512
+ ): Promise<Account | undefined> {
513
+ return Promise.resolve(undefined);
514
+ }
515
+
516
+ protected override async getProviderDefaultBranch(
517
+ session: ProviderAuthenticationSession,
518
+ repo: AzureRepositoryDescriptor,
519
+ cancellation?: AbortSignal,
520
+ ): Promise<DefaultBranch | undefined> {
521
+ return (await this.authenticationService.apis.azure)?.getDefaultBranch(
522
+ this,
523
+ toTokenWithInfo(this.id, session),
524
+ repo.owner,
525
+ repo.name,
526
+ { baseUrl: this.apiBaseUrl },
527
+ cancellation,
528
+ );
529
+ }
530
+
531
+ protected override async getProviderLinkedIssueOrPullRequest(
532
+ session: ProviderAuthenticationSession,
533
+ repo: AzureRepositoryDescriptor,
534
+ { id }: { id: string; key: string },
535
+ type: undefined | IssueOrPullRequestType,
536
+ ): Promise<IssueOrPullRequest | undefined> {
537
+ return (await this.authenticationService.apis.azure)?.getIssueOrPullRequest(
538
+ this,
539
+ toTokenWithInfo(this.id, session),
540
+ repo.owner,
541
+ repo.name,
542
+ id,
543
+ {
544
+ baseUrl: this.apiBaseUrl,
545
+ type: type,
546
+ },
547
+ );
548
+ }
549
+
550
+ protected override async getProviderIssue(
551
+ session: ProviderAuthenticationSession,
552
+ project: AzureProjectInputDescriptor,
553
+ id: string,
554
+ ): Promise<Issue | undefined> {
555
+ const user = await this.getProviderCurrentAccount(session);
556
+ if (user?.username == null) return undefined;
557
+
558
+ const orgs = await this.getProviderResourcesForUser(session);
559
+ if (orgs == null || orgs.length === 0) return undefined;
560
+
561
+ const projects = await this.getProviderProjectsForResources(session, orgs);
562
+ if (projects.values.length === 0) return undefined;
563
+
564
+ const matchingProject = projects.values.find(p => p.resourceName === project.owner && p.name === project.name);
565
+ if (matchingProject == null) return undefined;
566
+
567
+ return (await this.authenticationService.apis.azure)?.getIssue(
568
+ this,
569
+ toTokenWithInfo(this.id, session),
570
+ matchingProject,
571
+ id,
572
+ {
573
+ baseUrl: this.apiBaseUrl,
574
+ },
575
+ );
576
+ }
577
+
578
+ protected override async getProviderPullRequestForBranch(
579
+ session: ProviderAuthenticationSession,
580
+ repo: AzureRepositoryDescriptor,
581
+ branch: string,
582
+ _options?: {
583
+ avatarSize?: number;
584
+ include?: PullRequestState[];
585
+ },
586
+ ): Promise<PullRequest | undefined> {
587
+ return (await this.authenticationService.apis.azure)?.getPullRequestForBranch(
588
+ this,
589
+ toTokenWithInfo(this.id, session),
590
+ repo.owner,
591
+ repo.name,
592
+ branch,
593
+ {
594
+ baseUrl: this.apiBaseUrl,
595
+ },
596
+ );
597
+ }
598
+
599
+ protected override async getProviderPullRequestForCommit(
600
+ session: ProviderAuthenticationSession,
601
+ repo: AzureRepositoryDescriptor,
602
+ rev: string,
603
+ ): Promise<PullRequest | undefined> {
604
+ return (await this.authenticationService.apis.azure)?.getPullRequestForCommit(
605
+ this,
606
+ toTokenWithInfo(this.id, session),
607
+ repo.owner,
608
+ repo.name,
609
+ rev,
610
+ this.apiBaseUrl,
611
+ );
612
+ }
613
+
614
+ public override async getRepoInfo(repo: {
615
+ owner: string;
616
+ name: string;
617
+ project?: string;
618
+ connectionId?: string;
619
+ }): Promise<ProviderRepository | undefined> {
620
+ const identity = getAzureRepositoryIdentity(repo);
621
+ if (identity.projectName == null) return undefined;
622
+
623
+ const api = await this.getProvidersApi();
624
+ // `connectionId` targets a specific account (multi-account); omitted reads the primary.
625
+ const session = await this.resolveReadSession(repo.connectionId, undefined);
626
+ if (session == null) return undefined;
627
+
628
+ const { tokenWithInfo, options } = this.getApiOptions(session);
629
+ return api.getRepo(
630
+ tokenWithInfo,
631
+ identity.resourceName,
632
+ identity.repositoryName,
633
+ identity.projectName,
634
+ options,
635
+ );
636
+ }
637
+
638
+ protected override async getProviderRepositoryMetadata(
639
+ session: ProviderAuthenticationSession,
640
+ repo: AzureRepositoryDescriptor,
641
+ cancellation?: AbortSignal,
642
+ ): Promise<RepositoryMetadata | undefined> {
643
+ return (await this.authenticationService.apis.azure)?.getRepositoryMetadata(
644
+ this,
645
+ toTokenWithInfo(this.id, session),
646
+ repo.owner,
647
+ repo.name,
648
+ { baseUrl: this.apiBaseUrl },
649
+ cancellation,
650
+ );
651
+ }
652
+
653
+ protected override async searchProviderMyPullRequests(
654
+ session: ProviderAuthenticationSession,
655
+ repos?: AzureRepositoryDescriptor[],
656
+ _cancellation?: AbortSignal,
657
+ _silent?: boolean,
658
+ state?: PullRequestStateFilter,
659
+ _options?: SearchMyPullRequestsOptions,
660
+ ): Promise<PullRequest[] | undefined> {
661
+ const api = await this.getProvidersApi();
662
+ if (repos != null) {
663
+ // TODO: implement repos version
664
+ return undefined;
665
+ }
666
+
667
+ const states = toProviderPullRequestStates(state);
668
+
669
+ const user = await this.getProviderCurrentAccount(session);
670
+ // Azure filters key on the identity GUID (account id), not the display name — see
671
+ // getProviderMyPullRequestsForUser and the repo-scoped path in gitHostIntegration.ts.
672
+ if (user?.id == null) return undefined;
673
+
674
+ const orgs = await this.getProviderResourcesForUser(session);
675
+ if (orgs == null || orgs.length === 0) return undefined;
676
+
677
+ const projects = await this.getProviderProjectsForResources(session, orgs);
678
+ if (projects.values.length === 0) return undefined;
679
+
680
+ const repoDescriptors = [
681
+ ...((await this.getRepoDescriptorsForProjects(session, projects.values)) ?? new Map()).values(),
682
+ ]
683
+ .filter(r => r != null)
684
+ .flat();
685
+
686
+ const { tokenWithInfo, options } = this.getApiOptions(session);
687
+ const projectInputs = projects.values.map(p => ({ namespace: p.resourceName, project: p.name }));
688
+ // Legacy array-returning path (Launchpad/focus view): unwrap `.values` from the SDK collection result.
689
+ // The metadata (partial/failures) isn't surfaced here because this path's return type has no warning
690
+ // channel; the metadata-aware ProviderBackend surface is getProviderMyPullRequestsForUser above.
691
+ const assignedPrs = (
692
+ await api.getPullRequestsForAzureProjects(tokenWithInfo, projectInputs, {
693
+ ...options,
694
+ assigneeLogins: [user.id],
695
+ states: states,
696
+ })
697
+ ).values.map(pr => this.fromAzureProviderPullRequest(pr, repoDescriptors, projects.values));
698
+ const authoredPrs = (
699
+ await api.getPullRequestsForAzureProjects(tokenWithInfo, projectInputs, {
700
+ ...options,
701
+ authorLogin: user.id,
702
+ states: states,
703
+ })
704
+ ).values.map(pr => this.fromAzureProviderPullRequest(pr, repoDescriptors, projects.values));
705
+ const prsById = new Map<string, PullRequest>();
706
+ for (const pr of authoredPrs) {
707
+ prsById.set(pr.id, pr);
708
+ }
709
+
710
+ for (const pr of assignedPrs) {
711
+ const existing = prsById.get(pr.id);
712
+ if (existing == null) {
713
+ prsById.set(pr.id, pr);
714
+ }
715
+ }
716
+
717
+ return [...prsById.values()];
718
+ }
719
+
720
+ protected override async getProviderMyPullRequestsForUser(
721
+ session: ProviderAuthenticationSession,
722
+ options?: { state?: PullRequestStateFilter[]; cursor?: string; filters?: PullRequestFilter[] },
723
+ ): Promise<ProviderApiPagedResult<ProviderPullRequest> | undefined> {
724
+ const api = await this.getProvidersApi();
725
+ const user = await this.getProviderCurrentAccount(session);
726
+ // Azure routes authorLogin/assigneeLogins to `searchCriteria.creatorId`/`reviewerId`, which require the
727
+ // identity GUID (account id), not the display name — matching the repo-scoped path in
728
+ // gitHostIntegration.ts. Using `username` here would match nothing and return zero PRs.
729
+ if (user?.id == null) return undefined;
730
+
731
+ // Azure PRs are org + project scoped: enumerate the user's orgs and their projects, then read authored
732
+ // and assigned PRs across all of them. Return the raw provider shape (not the normalized model) so the
733
+ // ProviderBackend surface stays uniform with the other providers.
734
+ const orgs = await this.getProviderResourcesForUser(session);
735
+ if (orgs == null || orgs.length === 0) return undefined;
736
+
737
+ // Structured per-scope failures from BOTH project discovery (a whole org dropped) and the per-project PR
738
+ // drains, so the facade warns on the failed scope + sets `fetchFailed` instead of silently narrowing.
739
+ const failures: CollectionScopeFailure[] = [];
740
+ const projects = await this.getProviderProjectsForResources(session, orgs, false, failures);
741
+ if (projects.values.length === 0) {
742
+ // Project discovery itself was incomplete (e.g. a truncated org); surface the metadata so the facade
743
+ // can warn and set fetchFailed rather than reporting an empty account.
744
+ const incomplete = projects.metadata != null && projects.metadata.completeness !== 'complete';
745
+ return {
746
+ values: [],
747
+ paging: { cursor: '{}', more: false, truncated: incomplete || undefined },
748
+ ...(projects.metadata != null ? { metadata: projects.metadata } : {}),
749
+ };
750
+ }
751
+
752
+ const { tokenWithInfo, options: apiOptions } = this.getApiOptions(session);
753
+ const states = toProviderPullRequestStates(options?.state);
754
+ const maxPagesPerProject = 20;
755
+
756
+ // Drain each project fully (numbered pages) for both the authored and assigned reads. Azure has no
757
+ // single cross-project cursor, so the aggregate is one page; `truncated` is set only if a project hit
758
+ // the backstop with more pages remaining.
759
+ let truncated = projects.metadata != null && projects.metadata.completeness !== 'complete';
760
+ // Drain one project's numbered pages, returning its PRs and any per-page failure. Returns per-project
761
+ // (not mutating shared state) so the fan-out below can be settled independently: one project's read
762
+ // failure must not discard every other project's already-drained PRs.
763
+ const drainProject = async (
764
+ project: { namespace: string; project: string },
765
+ scope: CollectionScope,
766
+ filter: { authorLogin?: string; assigneeLogins?: string[]; reviewerId?: string },
767
+ ): Promise<{ prs: ProviderPullRequest[]; projectIdentity: string; failure?: CollectionScopeFailure }> => {
768
+ const collected: ProviderPullRequest[] = [];
769
+ const projectIdentity = `${project.namespace}/${project.project}`;
770
+ let page: number | undefined;
771
+ for (let i = 0; i < maxPagesPerProject; i++) {
772
+ try {
773
+ const result = await api.getPullRequestsForAzureProject(tokenWithInfo, project, {
774
+ ...apiOptions,
775
+ ...filter,
776
+ states: states,
777
+ page: page,
778
+ });
779
+ if (result == null) {
780
+ if (page == null) break;
781
+
782
+ truncated = true;
783
+ return {
784
+ prs: collected,
785
+ projectIdentity: projectIdentity,
786
+ failure: toCollectionScopeFailure(
787
+ scope,
788
+ new Error('Azure DevOps returned no page after advertising a continuation'),
789
+ ),
790
+ };
791
+ }
792
+
793
+ collected.push(...result.data);
794
+ if (!result.hasMore) break;
795
+ if (result.nextPage == null || result.nextPage === page) {
796
+ truncated = true;
797
+ return {
798
+ prs: collected,
799
+ projectIdentity: projectIdentity,
800
+ failure: toCollectionScopeFailure(
801
+ scope,
802
+ new Error('Azure DevOps returned no advancing pull request continuation'),
803
+ ),
804
+ };
805
+ }
806
+
807
+ page = result.nextPage;
808
+ if (i === maxPagesPerProject - 1) {
809
+ truncated = true;
810
+ }
811
+ } catch (ex) {
812
+ // A page failure after the first page leaves the already-drained prefix intact; record the
813
+ // failure at the project scope instead of re-throwing and discarding the prefix.
814
+ truncated = true;
815
+ return {
816
+ prs: collected,
817
+ projectIdentity: projectIdentity,
818
+ failure: toCollectionScopeFailure(scope, ex),
819
+ };
820
+ }
821
+ }
822
+ return { prs: collected, projectIdentity: projectIdentity };
823
+ };
824
+
825
+ // Settle per-project failures instead of rejecting the whole sweep. `drainProject` already catches its own
826
+ // page-level failures, so the structured failure (attributed to that project) is preserved rather than
827
+ // re-thrown — re-throwing an auth/rate-limit rejection would discard every other project's already-drained
828
+ // PRs. Auth/rate-limit stay actionable through the failure's kind (the facade maps it to an `auth`/`rate-limit`
829
+ // warning + `fetchFailed`), matching the SDK's model. `failures` was declared above so project-discovery
830
+ // failures and per-project drain failures share it.
831
+ const requested = options?.filters?.length ? new Set(options.filters) : undefined;
832
+ const wantAuthored = requested == null || requested.has(PullRequestFilter.Author);
833
+ // Azure has no assignee concept distinct from reviewer. Both neutral relationships map to reviewerId.
834
+ const wantReviewed =
835
+ requested == null ||
836
+ requested.has(PullRequestFilter.Assignee) ||
837
+ requested.has(PullRequestFilter.ReviewRequested);
838
+ const outcomes = await Promise.all(
839
+ projects.values.flatMap(p => {
840
+ const project = { namespace: p.resourceName, project: p.name };
841
+ const scope = { providerId: this.id, resourceId: p.resourceId, projectId: p.name };
842
+ const drains = [];
843
+ if (wantAuthored) {
844
+ drains.push(drainProject(project, scope, { authorLogin: user.id }));
845
+ }
846
+ if (wantReviewed) {
847
+ drains.push(drainProject(project, scope, { reviewerId: user.id }));
848
+ }
849
+ return drains;
850
+ }),
851
+ );
852
+
853
+ // Azure's `pullRequestId` is not account-global. Prefer repository + PR id, then the org-qualified URL.
854
+ // If neither is available, preserve the row instead of collapsing unrelated repositories by numeric id.
855
+ const prsByIdentity = new Map<string, ProviderPullRequest>();
856
+ for (const outcome of outcomes) {
857
+ if (outcome.failure != null) {
858
+ failures.push(outcome.failure);
859
+ }
860
+ for (const pr of outcome.prs) {
861
+ const key =
862
+ getProviderPullRequestIdentity(pr) ?? `project:${outcome.projectIdentity}:pull-request:${pr.id}`;
863
+ if (!prsByIdentity.has(key)) {
864
+ prsByIdentity.set(key, pr);
865
+ }
866
+ }
867
+ }
868
+
869
+ const metadata: CollectionMetadata | undefined = mergeCollectionMetadata(
870
+ failures.length > 0 ? { completeness: 'partial', failures: failures } : undefined,
871
+ projects.metadata,
872
+ );
873
+
874
+ return {
875
+ values: [...prsByIdentity.values()],
876
+ paging: { cursor: '{}', more: false, truncated: truncated || undefined },
877
+ metadata: metadata,
878
+ };
879
+ }
880
+
881
+ protected override async searchProviderPullRequests(
882
+ session: ProviderAuthenticationSession,
883
+ searchQuery: string,
884
+ repos?: AzureRepositoryDescriptor[],
885
+ cancellation?: AbortSignal,
886
+ options?: { include?: PullRequestState[] },
887
+ ): Promise<PullRequest[] | undefined> {
888
+ if (cancellation?.aborted) throw new CancellationError();
889
+
890
+ const orgs = await this.getProviderResourcesForUser(session);
891
+ if (cancellation?.aborted) throw new CancellationError();
892
+ if (orgs == null || orgs.length === 0) return undefined;
893
+
894
+ // `getProviderProjectsForResources` returns a collection result ({ values, metadata }); this search
895
+ // path only needs the resolved projects, so read `.values`.
896
+ const projects = (await this.getProviderProjectsForResources(session, orgs)).values;
897
+ if (cancellation?.aborted) throw new CancellationError();
898
+ if (projects.length === 0) return undefined;
899
+
900
+ const repoDescriptorsByProject = await this.getRepoDescriptorsForProjects(session, projects);
901
+ if (cancellation?.aborted) throw new CancellationError();
902
+
903
+ const repoDescriptors = [...repoDescriptorsByProject.values()].filter(r => r != null).flat();
904
+ const requestedRepos = repos?.map(getAzureRepositoryIdentity);
905
+ const repoInputs =
906
+ requestedRepos == null
907
+ ? undefined
908
+ : repoDescriptors.filter(r =>
909
+ requestedRepos.some(
910
+ repo =>
911
+ repo.resourceName === r.resourceName &&
912
+ repo.repositoryName === r.name &&
913
+ (repo.projectName == null || repo.projectName === r.projectName),
914
+ ),
915
+ );
916
+ if (repoInputs?.length === 0) return [];
917
+
918
+ const api = await this.getProvidersApi();
919
+ const { tokenWithInfo, options: apiOptions } = this.getApiOptions(session);
920
+ const states = toProviderPullRequestStates(options?.include);
921
+ const searchScopes: { project: { namespace: string; project: string }; repo?: ProviderRepoInput }[] =
922
+ repoInputs != null
923
+ ? repoInputs.flatMap(repo =>
924
+ repo.projectName == null
925
+ ? []
926
+ : [
927
+ {
928
+ project: { namespace: repo.resourceName, project: repo.projectName },
929
+ repo: {
930
+ id: repo.id,
931
+ name: repo.name,
932
+ namespace: repo.resourceName,
933
+ project: repo.projectName,
934
+ },
935
+ },
936
+ ],
937
+ )
938
+ : projects.map(project => ({
939
+ project: { namespace: project.resourceName, project: project.name },
940
+ }));
941
+
942
+ const providerPullRequests = await flatSettledOrThrow(
943
+ searchScopes.map(async scope => {
944
+ const values: ProviderPullRequest[] = [];
945
+ let page: number | undefined;
946
+ for (let i = 0; i < 20; i++) {
947
+ if (cancellation?.aborted) throw new CancellationError();
948
+
949
+ const result = await api.getPullRequestsForAzureProject(tokenWithInfo, scope.project, {
950
+ ...apiOptions,
951
+ page: page,
952
+ repo: scope.repo,
953
+ states: states,
954
+ });
955
+ if (result == null) break;
956
+
957
+ values.push(...result.data);
958
+ if (!result.hasMore || result.nextPage == null) break;
959
+
960
+ page = result.nextPage;
961
+ }
962
+ return values;
963
+ }),
964
+ );
965
+ if (cancellation?.aborted) throw new CancellationError();
966
+
967
+ return [...new Map(providerPullRequests.map(pr => [pr.url ?? `${pr.repository.id}:${pr.id}`, pr])).values()]
968
+ .filter(pr => providerPullRequestMatchesSearch(pr, searchQuery))
969
+ .map(pr => this.fromAzureProviderPullRequest(pr, repoDescriptors, projects));
970
+ }
971
+
972
+ protected override async searchProviderMyIssues(
973
+ session: ProviderAuthenticationSession,
974
+ repos?: AzureRepositoryDescriptor[],
975
+ ): Promise<IssueShape[] | undefined> {
976
+ return (await this.searchProviderMyIssuesWithTruncation(session, repos))?.values;
977
+ }
978
+
979
+ /**
980
+ * Account-wide "my issues" for Azure = the user's authored + assigned work items across every project of
981
+ * every org. Azure's issue read is numbered-page, so each (project × filter) read is drained to exhaustion
982
+ * (bounded by a defensive per-read backstop). Unlike a silent `flatSettled`, a project read that was
983
+ * truncated by the backstop or rejected outright is recorded as `truncated`, so the facade reports an
984
+ * incomplete read instead of publishing a partial list as complete.
985
+ *
986
+ * `searchOptions.org`/`.project` narrow the fan-out server-side (each drain is already a per-project read,
987
+ * so scoping just selects which projects to drain). Without this there was no way to ask for "work items in
988
+ * project P": a consumer had to filter the account-wide page client-side, which desynchronizes the filtered
989
+ * `items` from the `hasMore`/`currentPage` of the pre-filter read — a project-less page reads as "no issues"
990
+ * while `hasMore` is still true.
991
+ */
992
+ protected override async searchProviderMyIssuesWithTruncation(
993
+ session: ProviderAuthenticationSession,
994
+ _resources?: ResourceDescriptor[],
995
+ _cancellation?: AbortSignal,
996
+ searchOptions?: SearchMyIssuesOptions,
997
+ ): Promise<AccountWideIssuesResult | undefined> {
998
+ const api = await this.getProvidersApi();
999
+
1000
+ const user = await this.getProviderCurrentAccount(session);
1001
+ if (user?.username == null) return undefined;
1002
+
1003
+ const allOrgs = await this.getProviderResourcesForUser(session);
1004
+ if (allOrgs == null) return undefined;
1005
+ if (allOrgs.length === 0) return { values: [], truncated: false };
1006
+
1007
+ // Scope by org first so project discovery only fans out over the requested account. An org filter that
1008
+ // matches nothing is an empty-but-successful read, not an unsupported one: returning `undefined` here
1009
+ // would be reported as "account-wide issue search is not supported by this provider".
1010
+ const orgs =
1011
+ searchOptions?.org != null ? allOrgs.filter(o => azureResourceMatches(o, searchOptions.org!)) : allOrgs;
1012
+ if (orgs.length === 0) return { values: [], truncated: false };
1013
+
1014
+ // Structured per-scope failures from BOTH project discovery (a whole org dropped) and the per-project
1015
+ // issue drains, so the facade warns on the failed scope + sets `fetchFailed` instead of narrowing silently.
1016
+ const failures: CollectionScopeFailure[] = [];
1017
+ const discovered = await this.getProviderProjectsForResources(session, orgs, false, failures);
1018
+ const projects =
1019
+ searchOptions?.project != null
1020
+ ? {
1021
+ ...discovered,
1022
+ values: discovered.values.filter(p => azureResourceMatches(p, searchOptions.project!)),
1023
+ }
1024
+ : discovered;
1025
+ if (projects.values.length === 0) {
1026
+ // An explicitly-scoped read that found no matching project is an empty SUCCESS: `undefined` here is
1027
+ // reported as "account-wide issue search is not supported by this provider", which would send the
1028
+ // consumer down a repo-scoped fallback for what is simply an empty scope. Only an incomplete discovery
1029
+ // (which may itself have dropped the requested project) is truncated, and its metadata is forwarded so
1030
+ // the facade still warns on the failed scope.
1031
+ return projects.metadata != null
1032
+ ? {
1033
+ values: [],
1034
+ truncated: projects.metadata.completeness !== 'complete',
1035
+ metadata: projects.metadata,
1036
+ }
1037
+ : { values: [], truncated: false };
1038
+ }
1039
+
1040
+ const { tokenWithInfo, options } = this.getApiOptions(session);
1041
+
1042
+ // Drain one (project × filter) read fully, threading the provider's paging cursor. The scope is passed so
1043
+ // a page-level failure preserves the already-drained prefix and records a structured failure instead of
1044
+ // re-throwing.
1045
+ const drain = async (
1046
+ p: AzureProjectDescriptor,
1047
+ filter: { assigneeLogins?: string[]; authorLogin?: string },
1048
+ ): Promise<{
1049
+ issues: IssueShape[];
1050
+ projectKey: string;
1051
+ truncated: boolean;
1052
+ metadata?: CollectionMetadata;
1053
+ }> => {
1054
+ const result = await collectProviderPagedResult(
1055
+ cursor =>
1056
+ api.getIssuesForAzureProject(tokenWithInfo, p.resourceName, p.name, {
1057
+ ...options,
1058
+ ...filter,
1059
+ cursor: cursor,
1060
+ }),
1061
+ 20,
1062
+ { providerId: this.id, resourceId: p.resourceId, projectId: p.name },
1063
+ );
1064
+ return {
1065
+ issues: result.values.map(i => fromProviderIssue(i, this as any, { project: p })),
1066
+ // Azure work-item ids are organization-scoped. Include both org and project so the
1067
+ // assigned/authored passes dedupe the same item without collapsing another org's item.
1068
+ projectKey: `${p.resourceId}:${p.id}`,
1069
+ truncated: result.truncated ?? false,
1070
+ metadata: result.metadata,
1071
+ };
1072
+ };
1073
+
1074
+ // `includeAllAssignees` broadens to every issue in each project (any assignee, any author), so a single
1075
+ // unfiltered drain per project replaces the assigned+authored pair — an unfiltered assignee drain already
1076
+ // subsumes the authored one.
1077
+ //
1078
+ // `filters` narrows the other way: unfiltered, "my issues" here is assigned ∪ authored, which is wider than
1079
+ // `assignee:@me`. Selecting the drains is the only correct place to narrow — dropping authored-only items
1080
+ // from the returned page would leave them counted in the per-project paging that produced it.
1081
+ const filters = searchOptions?.filters;
1082
+ const wantAssigned = !filters?.length || filters.includes(IssueFilter.Assignee);
1083
+ const wantAuthored = !filters?.length || filters.includes(IssueFilter.Author);
1084
+ const outcomes = await Promise.all(
1085
+ projects.values.flatMap(p => {
1086
+ if (searchOptions?.includeAllAssignees) return [drain(p, {})];
1087
+
1088
+ const drains = [];
1089
+ if (wantAssigned) {
1090
+ drains.push(drain(p, { assigneeLogins: [user.username!] }));
1091
+ }
1092
+ if (wantAuthored) {
1093
+ drains.push(drain(p, { authorLogin: user.username! }));
1094
+ }
1095
+ return drains;
1096
+ }),
1097
+ );
1098
+
1099
+ const issuesById = new Map<string, IssueShape>();
1100
+ let truncated = projects.metadata != null && projects.metadata.completeness !== 'complete';
1101
+ let drainMetadata: CollectionMetadata | undefined;
1102
+ for (const outcome of outcomes) {
1103
+ if (outcome.truncated) {
1104
+ truncated = true;
1105
+ }
1106
+ if (outcome.metadata != null) {
1107
+ drainMetadata = mergeCollectionMetadata(drainMetadata, outcome.metadata);
1108
+ }
1109
+
1110
+ for (const issue of outcome.issues) {
1111
+ const key = `${outcome.projectKey}:${issue.nodeId ?? issue.id}`;
1112
+ if (!issuesById.has(key)) {
1113
+ issuesById.set(key, issue);
1114
+ }
1115
+ }
1116
+ }
1117
+
1118
+ const metadata: CollectionMetadata | undefined = mergeCollectionMetadata(
1119
+ failures.length > 0 ? { completeness: 'partial', failures: failures } : undefined,
1120
+ mergeCollectionMetadata(drainMetadata, projects.metadata),
1121
+ );
1122
+
1123
+ return { values: [...issuesById.values()], truncated: truncated, metadata: metadata };
1124
+ }
1125
+
1126
+ protected override async providerOnConnect(): Promise<void> {
1127
+ if (this._session == null) return;
1128
+
1129
+ const canHydrateStoredProjects = (metadata: CollectionMetadata | undefined): boolean =>
1130
+ metadata == null || metadata.completeness === 'complete';
1131
+
1132
+ const storedAccount = this.ctx.storage.get(`azure:${this._session.accessToken}:account`);
1133
+ const storedOrganizations = this.ctx.storage.get(`azure:${this._session.accessToken}:organizations`);
1134
+ const storedProjects = this.ctx.storage.get(`azure:${this._session.accessToken}:projects`);
1135
+ let account: Account | undefined = storedAccount?.data ? { ...storedAccount.data, provider: this } : undefined;
1136
+
1137
+ let organizations = storedOrganizations?.data?.map((o: AzureOrganizationDescriptor) => ({ ...o }));
1138
+
1139
+ const storedProjectsData = storedProjects?.data as
1140
+ | ProviderApiCollectionResult<AzureProjectDescriptor>
1141
+ | AzureProjectDescriptor[]
1142
+ | undefined;
1143
+ let projects: ProviderApiCollectionResult<AzureProjectDescriptor> | undefined;
1144
+ if (!Array.isArray(storedProjectsData) && Array.isArray(storedProjectsData?.values)) {
1145
+ const hydrated = {
1146
+ values: storedProjectsData.values.map((p: AzureProjectDescriptor) => ({ ...p })),
1147
+ ...(storedProjectsData.metadata != null ? { metadata: storedProjectsData.metadata } : {}),
1148
+ };
1149
+ if (canHydrateStoredProjects(hydrated.metadata)) {
1150
+ projects = hydrated;
1151
+ }
1152
+ }
1153
+
1154
+ if (storedAccount == null) {
1155
+ account = await this.getProviderCurrentAccount(this._session);
1156
+ if (account != null) {
1157
+ // Clear all other stored organizations and projects and accounts when our session changes
1158
+ await this.ctx.storage.deleteWithPrefix('azure');
1159
+ await this.ctx.storage.store(`azure:${this._session.accessToken}:account`, {
1160
+ v: 1,
1161
+ timestamp: Date.now(),
1162
+ data: {
1163
+ id: account.id,
1164
+ name: account.name,
1165
+ email: account.email,
1166
+ avatarUrl: account.avatarUrl,
1167
+ username: account.username,
1168
+ },
1169
+ });
1170
+ }
1171
+ }
1172
+
1173
+ this._accounts ??= new Map<string, Account | undefined>();
1174
+ this._accounts.set(this._session.accessToken, account);
1175
+
1176
+ if (storedOrganizations == null) {
1177
+ organizations = await this.getProviderResourcesForUser(this._session, true);
1178
+ await this.ctx.storage.store(`azure:${this._session.accessToken}:organizations`, {
1179
+ v: 1,
1180
+ timestamp: Date.now(),
1181
+ data: organizations,
1182
+ });
1183
+ }
1184
+
1185
+ this._organizations ??= new Map<string, AzureOrganizationDescriptor[] | undefined>();
1186
+ this._organizations.set(this._session.accessToken, organizations);
1187
+
1188
+ if (projects == null && organizations?.length) {
1189
+ projects = await this.getProviderProjectsForResources(this._session, organizations);
1190
+ if (projects != null && canHydrateStoredProjects(projects.metadata)) {
1191
+ await this.ctx.storage.store(`azure:${this._session.accessToken}:projects`, {
1192
+ v: 2,
1193
+ timestamp: Date.now(),
1194
+ data: projects,
1195
+ });
1196
+ } else {
1197
+ await this.ctx.storage.delete(`azure:${this._session.accessToken}:projects`);
1198
+ }
1199
+ }
1200
+
1201
+ this._projects ??= new Map<string, AzureProjectDescriptor[] | undefined>();
1202
+ if (projects != null && canHydrateStoredProjects(projects.metadata)) {
1203
+ for (const project of projects.values) {
1204
+ const projectKey = `${this._session.accessToken}:${project.resourceId}`;
1205
+ const projects = this._projects.get(projectKey);
1206
+ if (projects == null) {
1207
+ this._projects.set(projectKey, [project]);
1208
+ } else if (!projects.some(p => p.id === project.id)) {
1209
+ projects.push(project);
1210
+ }
1211
+ }
1212
+ }
1213
+ }
1214
+
1215
+ protected override providerOnDisconnect(): void {
1216
+ this._organizations = undefined;
1217
+ this._projects = undefined;
1218
+ this._accounts = undefined;
1219
+ }
1220
+
1221
+ protected fromAzureProviderPullRequest(
1222
+ azurePullRequest: ProviderPullRequest,
1223
+ repoDescriptors: AzureRemoteRepositoryDescriptor[],
1224
+ projectDescriptors: AzureProjectDescriptor[],
1225
+ ): PullRequest {
1226
+ const baseRepoDescriptor = repoDescriptors.find(r => r.id === azurePullRequest.repository.id);
1227
+ const headRepoDescriptor =
1228
+ azurePullRequest.headRepository != null
1229
+ ? repoDescriptors.find(r => r.id === azurePullRequest.headRepository!.id)
1230
+ : undefined;
1231
+ let project: AzureProjectDescriptor | undefined;
1232
+ if (baseRepoDescriptor != null) {
1233
+ azurePullRequest.repository.remoteInfo = {
1234
+ ...azurePullRequest.repository.remoteInfo,
1235
+ cloneUrlHTTPS: baseRepoDescriptor.cloneUrlHttps ?? '',
1236
+ cloneUrlSSH: baseRepoDescriptor.cloneUrlSsh ?? '',
1237
+ };
1238
+ }
1239
+
1240
+ if (headRepoDescriptor != null) {
1241
+ azurePullRequest.headRepository = {
1242
+ ...azurePullRequest.headRepository,
1243
+ id: azurePullRequest.headRepository?.id ?? headRepoDescriptor.id,
1244
+ name: azurePullRequest.headRepository?.name ?? headRepoDescriptor.name,
1245
+ owner: {
1246
+ login: azurePullRequest.headRepository?.owner.login ?? headRepoDescriptor.resourceName,
1247
+ },
1248
+ remoteInfo: {
1249
+ ...azurePullRequest.headRepository?.remoteInfo,
1250
+ cloneUrlHTTPS: headRepoDescriptor.cloneUrlHttps ?? '',
1251
+ cloneUrlSSH: headRepoDescriptor.cloneUrlSsh ?? '',
1252
+ },
1253
+ };
1254
+ }
1255
+
1256
+ if (baseRepoDescriptor?.projectName != null) {
1257
+ project = projectDescriptors.find(
1258
+ p => p.resourceName === baseRepoDescriptor.resourceName && p.name === baseRepoDescriptor.projectName,
1259
+ );
1260
+ }
1261
+ return fromProviderPullRequest(azurePullRequest, this, { project: project });
1262
+ }
1263
+ }
1264
+
1265
+ const cloudMetadata = providersMetadata[GitCloudHostIntegrationId.AzureDevOps];
1266
+ const cloudAuthProvider = Object.freeze({ id: cloudMetadata.id, scopes: cloudMetadata.scopes });
1267
+
1268
+ export class AzureDevOpsIntegration extends AzureDevOpsIntegrationBase<GitCloudHostIntegrationId.AzureDevOps> {
1269
+ readonly authProvider: IntegrationAuthenticationProviderDescriptor = cloudAuthProvider;
1270
+ readonly id = GitCloudHostIntegrationId.AzureDevOps;
1271
+ protected readonly key = this.id;
1272
+ readonly name: string = 'Azure DevOps';
1273
+ get domain(): string {
1274
+ return cloudMetadata.domain;
1275
+ }
1276
+ protected override get apiBaseUrl(): string {
1277
+ return 'https://dev.azure.com';
1278
+ }
1279
+ }
1280
+
1281
+ const serverMetadata = providersMetadata[GitSelfManagedHostIntegrationId.AzureDevOpsServer];
1282
+ const serverAuthProvider = Object.freeze({ id: serverMetadata.id, scopes: serverMetadata.scopes });
1283
+
1284
+ export class AzureDevOpsServerIntegration extends AzureDevOpsIntegrationBase<GitSelfManagedHostIntegrationId.AzureDevOpsServer> {
1285
+ readonly authProvider: IntegrationAuthenticationProviderDescriptor = serverAuthProvider;
1286
+ readonly id = GitSelfManagedHostIntegrationId.AzureDevOpsServer;
1287
+ protected readonly key: IntegrationKey<GitSelfManagedHostIntegrationId.AzureDevOpsServer>;
1288
+ readonly name: string = 'Azure DevOps Server';
1289
+
1290
+ constructor(
1291
+ ctx: IntegrationServiceContext,
1292
+ authenticationService: IntegrationAuthenticationService,
1293
+ getProvidersApi: () => Promise<ProvidersApi>,
1294
+ didChangeConnection: Emitter<IntegrationConnectionChangeEvent>,
1295
+ readonly domain: string,
1296
+ ) {
1297
+ super(ctx, authenticationService, getProvidersApi, didChangeConnection);
1298
+ this.key = `${this.id}:${this.domain}`;
1299
+ }
1300
+
1301
+ protected override get apiBaseUrl(): string {
1302
+ const protocol = this._session?.protocol ?? 'https:';
1303
+ return `${protocol}//${this.domain}`;
1304
+ }
1305
+
1306
+ protected override getApiOptions(
1307
+ session: ProviderAuthenticationSession,
1308
+ doNotConvertToPat: boolean = false,
1309
+ ): {
1310
+ tokenWithInfo: TokenWithInfo<GitSelfManagedHostIntegrationId.AzureDevOpsServer>;
1311
+ options: { isPAT: boolean; baseUrl?: string };
1312
+ } {
1313
+ const { options, ...rest } = super.getApiOptions(session, doNotConvertToPat);
1314
+ return {
1315
+ ...rest,
1316
+ options: { ...options, baseUrl: this.apiBaseUrl },
1317
+ };
1318
+ }
1319
+
1320
+ protected override async _requestForCurrentUser(
1321
+ session: ProviderAuthenticationSession,
1322
+ ): Promise<Account | undefined> {
1323
+ const azure = await this.authenticationService.apis.azure;
1324
+ const user = azure
1325
+ ? await azure.getCurrentUserOnServer(this, toTokenWithInfo(this.id, session), this.apiBaseUrl)
1326
+ : undefined;
1327
+ return user
1328
+ ? {
1329
+ provider: this,
1330
+ id: user.id,
1331
+ name: user.name ?? undefined,
1332
+ email: user.email ?? undefined,
1333
+ avatarUrl: user.avatarUrl ?? undefined,
1334
+ username: user.username ?? undefined,
1335
+ }
1336
+ : undefined;
1337
+ }
1338
+ }
1339
+
1340
+ export function convertTokentoPAT(accessToken: string): string {
1341
+ return base64(`PAT:${accessToken}`);
1342
+ }