@gitkraken/core-gitlens 0.4.0 → 0.4.101

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 (1051) hide show
  1. package/CHANGELOG.md +74 -1
  2. package/README.md +9 -2
  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.map +1 -1
  8. package/dist/git/errors.d.ts +31 -1
  9. package/dist/git/errors.d.ts.map +1 -1
  10. package/dist/git/errors.js +29 -0
  11. package/dist/git/errors.js.map +1 -1
  12. package/dist/git/models/author.d.ts.map +1 -1
  13. package/dist/git/models/author.js.map +1 -1
  14. package/dist/git/models/autolink.d.ts.map +1 -1
  15. package/dist/git/models/autolink.js.map +1 -1
  16. package/dist/git/models/blame.d.ts.map +1 -1
  17. package/dist/git/models/blame.js.map +1 -1
  18. package/dist/git/models/branch.d.ts.map +1 -1
  19. package/dist/git/models/branch.js.map +1 -1
  20. package/dist/git/models/commit.d.ts.map +1 -1
  21. package/dist/git/models/commit.js +1 -1
  22. package/dist/git/models/commit.js.map +1 -1
  23. package/dist/git/models/contributor.d.ts.map +1 -1
  24. package/dist/git/models/contributor.js.map +1 -1
  25. package/dist/git/models/defaultBranch.d.ts.map +1 -1
  26. package/dist/git/models/defaultBranch.js.map +1 -1
  27. package/dist/git/models/diff.d.ts.map +1 -1
  28. package/dist/git/models/diff.js.map +1 -1
  29. package/dist/git/models/file.d.ts.map +1 -1
  30. package/dist/git/models/file.js.map +1 -1
  31. package/dist/git/models/fileChange.d.ts.map +1 -1
  32. package/dist/git/models/fileChange.js.map +1 -1
  33. package/dist/git/models/fileStatus.d.ts +22 -22
  34. package/dist/git/models/fileStatus.d.ts.map +1 -1
  35. package/dist/git/models/fileStatus.js.map +1 -1
  36. package/dist/git/models/graph.d.ts +122 -1
  37. package/dist/git/models/graph.d.ts.map +1 -1
  38. package/dist/git/models/graph.js +4 -0
  39. package/dist/git/models/graph.js.map +1 -1
  40. package/dist/git/models/graphSearch.d.ts.map +1 -1
  41. package/dist/git/models/graphSearch.js.map +1 -1
  42. package/dist/git/models/graphSession.d.ts +177 -0
  43. package/dist/git/models/graphSession.d.ts.map +1 -0
  44. package/dist/git/models/graphSession.js +7 -0
  45. package/dist/git/models/graphSession.js.map +1 -0
  46. package/dist/git/models/issue.d.ts +12 -2
  47. package/dist/git/models/issue.d.ts.map +1 -1
  48. package/dist/git/models/issue.js +3 -1
  49. package/dist/git/models/issue.js.map +1 -1
  50. package/dist/git/models/issueOrPullRequest.d.ts.map +1 -1
  51. package/dist/git/models/issueOrPullRequest.js.map +1 -1
  52. package/dist/git/models/lineRange.d.ts.map +1 -1
  53. package/dist/git/models/lineRange.js.map +1 -1
  54. package/dist/git/models/log.d.ts.map +1 -1
  55. package/dist/git/models/log.js.map +1 -1
  56. package/dist/git/models/mergeConflicts.d.ts.map +1 -1
  57. package/dist/git/models/mergeConflicts.js.map +1 -1
  58. package/dist/git/models/patch.d.ts.map +1 -1
  59. package/dist/git/models/patch.js.map +1 -1
  60. package/dist/git/models/pausedOperationStatus.d.ts.map +1 -1
  61. package/dist/git/models/pausedOperationStatus.js.map +1 -1
  62. package/dist/git/models/pullRequest.d.ts +27 -2
  63. package/dist/git/models/pullRequest.d.ts.map +1 -1
  64. package/dist/git/models/pullRequest.js +7 -1
  65. package/dist/git/models/pullRequest.js.map +1 -1
  66. package/dist/git/models/rebase.d.ts.map +1 -1
  67. package/dist/git/models/rebase.js.map +1 -1
  68. package/dist/git/models/reference.d.ts.map +1 -1
  69. package/dist/git/models/reference.js.map +1 -1
  70. package/dist/git/models/reflog.d.ts.map +1 -1
  71. package/dist/git/models/reflog.js.map +1 -1
  72. package/dist/git/models/remote.d.ts.map +1 -1
  73. package/dist/git/models/remote.js.map +1 -1
  74. package/dist/git/models/remoteProvider.d.ts.map +1 -1
  75. package/dist/git/models/remoteProvider.js.map +1 -1
  76. package/dist/git/models/remoteResource.d.ts.map +1 -1
  77. package/dist/git/models/remoteResource.js.map +1 -1
  78. package/dist/git/models/repository.d.ts +20 -2
  79. package/dist/git/models/repository.d.ts.map +1 -1
  80. package/dist/git/models/repository.js +19 -0
  81. package/dist/git/models/repository.js.map +1 -1
  82. package/dist/git/models/repositoryChangeEvent.d.ts.map +1 -1
  83. package/dist/git/models/repositoryChangeEvent.js.map +1 -1
  84. package/dist/git/models/repositoryIdentities.d.ts.map +1 -1
  85. package/dist/git/models/repositoryIdentities.js.map +1 -1
  86. package/dist/git/models/repositoryMetadata.d.ts.map +1 -1
  87. package/dist/git/models/repositoryMetadata.js.map +1 -1
  88. package/dist/git/models/resourceDescriptor.d.ts +16 -0
  89. package/dist/git/models/resourceDescriptor.d.ts.map +1 -1
  90. package/dist/git/models/resourceDescriptor.js.map +1 -1
  91. package/dist/git/models/revision.d.ts.map +1 -1
  92. package/dist/git/models/revision.js.map +1 -1
  93. package/dist/git/models/search.d.ts.map +1 -1
  94. package/dist/git/models/search.js.map +1 -1
  95. package/dist/git/models/shortlog.d.ts.map +1 -1
  96. package/dist/git/models/shortlog.js.map +1 -1
  97. package/dist/git/models/signature.d.ts +14 -0
  98. package/dist/git/models/signature.d.ts.map +1 -1
  99. package/dist/git/models/signature.js.map +1 -1
  100. package/dist/git/models/staging.d.ts.map +1 -1
  101. package/dist/git/models/staging.js.map +1 -1
  102. package/dist/git/models/stash.d.ts.map +1 -1
  103. package/dist/git/models/stash.js.map +1 -1
  104. package/dist/git/models/status.d.ts.map +1 -1
  105. package/dist/git/models/status.js.map +1 -1
  106. package/dist/git/models/statusFile.d.ts.map +1 -1
  107. package/dist/git/models/statusFile.js.map +1 -1
  108. package/dist/git/models/tag.d.ts +11 -1
  109. package/dist/git/models/tag.d.ts.map +1 -1
  110. package/dist/git/models/tag.js +9 -2
  111. package/dist/git/models/tag.js.map +1 -1
  112. package/dist/git/models/tree.d.ts.map +1 -1
  113. package/dist/git/models/tree.js.map +1 -1
  114. package/dist/git/models/user.d.ts.map +1 -1
  115. package/dist/git/models/user.js.map +1 -1
  116. package/dist/git/models/worktree.d.ts.map +1 -1
  117. package/dist/git/models/worktree.js.map +1 -1
  118. package/dist/git/parsers/diffParser.d.ts.map +1 -1
  119. package/dist/git/parsers/diffParser.js +1 -1
  120. package/dist/git/parsers/diffParser.js.map +1 -1
  121. package/dist/git/parsers/rebaseTodoParser.d.ts.map +1 -1
  122. package/dist/git/parsers/rebaseTodoParser.js.map +1 -1
  123. package/dist/git/providers/blame.d.ts.map +1 -1
  124. package/dist/git/providers/blame.js.map +1 -1
  125. package/dist/git/providers/branches.d.ts +8 -1
  126. package/dist/git/providers/branches.d.ts.map +1 -1
  127. package/dist/git/providers/branches.js.map +1 -1
  128. package/dist/git/providers/commits.d.ts +6 -1
  129. package/dist/git/providers/commits.d.ts.map +1 -1
  130. package/dist/git/providers/commits.js.map +1 -1
  131. package/dist/git/providers/config.d.ts +6 -2
  132. package/dist/git/providers/config.d.ts.map +1 -1
  133. package/dist/git/providers/config.js.map +1 -1
  134. package/dist/git/providers/contributors.d.ts.map +1 -1
  135. package/dist/git/providers/contributors.js.map +1 -1
  136. package/dist/git/providers/diff.d.ts.map +1 -1
  137. package/dist/git/providers/diff.js.map +1 -1
  138. package/dist/git/providers/graph.d.ts +55 -1
  139. package/dist/git/providers/graph.d.ts.map +1 -1
  140. package/dist/git/providers/graph.js.map +1 -1
  141. package/dist/git/providers/operations.d.ts.map +1 -1
  142. package/dist/git/providers/operations.js.map +1 -1
  143. package/dist/git/providers/patch.d.ts.map +1 -1
  144. package/dist/git/providers/patch.js.map +1 -1
  145. package/dist/git/providers/pausedOperations.d.ts.map +1 -1
  146. package/dist/git/providers/pausedOperations.js.map +1 -1
  147. package/dist/git/providers/provider.d.ts.map +1 -1
  148. package/dist/git/providers/provider.js.map +1 -1
  149. package/dist/git/providers/refs.d.ts.map +1 -1
  150. package/dist/git/providers/refs.js.map +1 -1
  151. package/dist/git/providers/remotes.d.ts.map +1 -1
  152. package/dist/git/providers/remotes.js.map +1 -1
  153. package/dist/git/providers/revision.d.ts.map +1 -1
  154. package/dist/git/providers/revision.js.map +1 -1
  155. package/dist/git/providers/shared/remotes.d.ts.map +1 -1
  156. package/dist/git/providers/shared/remotes.js.map +1 -1
  157. package/dist/git/providers/staging.d.ts.map +1 -1
  158. package/dist/git/providers/staging.js.map +1 -1
  159. package/dist/git/providers/stash.d.ts.map +1 -1
  160. package/dist/git/providers/stash.js.map +1 -1
  161. package/dist/git/providers/status.d.ts +1 -0
  162. package/dist/git/providers/status.d.ts.map +1 -1
  163. package/dist/git/providers/status.js.map +1 -1
  164. package/dist/git/providers/tags.d.ts.map +1 -1
  165. package/dist/git/providers/tags.js.map +1 -1
  166. package/dist/git/providers/types.d.ts.map +1 -1
  167. package/dist/git/providers/types.js.map +1 -1
  168. package/dist/git/providers/worktrees.d.ts +3 -1
  169. package/dist/git/providers/worktrees.d.ts.map +1 -1
  170. package/dist/git/providers/worktrees.js.map +1 -1
  171. package/dist/git/remotes/azure-devops.d.ts.map +1 -1
  172. package/dist/git/remotes/azure-devops.js +27 -31
  173. package/dist/git/remotes/azure-devops.js.map +1 -1
  174. package/dist/git/remotes/bitbucket-server.d.ts.map +1 -1
  175. package/dist/git/remotes/bitbucket-server.js +21 -23
  176. package/dist/git/remotes/bitbucket-server.js.map +1 -1
  177. package/dist/git/remotes/bitbucket.d.ts.map +1 -1
  178. package/dist/git/remotes/bitbucket.js +21 -23
  179. package/dist/git/remotes/bitbucket.js.map +1 -1
  180. package/dist/git/remotes/custom.d.ts.map +1 -1
  181. package/dist/git/remotes/custom.js.map +1 -1
  182. package/dist/git/remotes/gerrit.d.ts.map +1 -1
  183. package/dist/git/remotes/gerrit.js +11 -13
  184. package/dist/git/remotes/gerrit.js.map +1 -1
  185. package/dist/git/remotes/gitea.d.ts.map +1 -1
  186. package/dist/git/remotes/gitea.js +12 -14
  187. package/dist/git/remotes/gitea.js.map +1 -1
  188. package/dist/git/remotes/github.d.ts.map +1 -1
  189. package/dist/git/remotes/github.js +54 -56
  190. package/dist/git/remotes/github.js.map +1 -1
  191. package/dist/git/remotes/gitlab.d.ts.map +1 -1
  192. package/dist/git/remotes/gitlab.js +93 -95
  193. package/dist/git/remotes/gitlab.js.map +1 -1
  194. package/dist/git/remotes/google-source.d.ts.map +1 -1
  195. package/dist/git/remotes/google-source.js.map +1 -1
  196. package/dist/git/remotes/matcher.d.ts.map +1 -1
  197. package/dist/git/remotes/matcher.js.map +1 -1
  198. package/dist/git/run.types.d.ts +62 -3
  199. package/dist/git/run.types.d.ts.map +1 -1
  200. package/dist/git/service.d.ts.map +1 -1
  201. package/dist/git/utils/autolink.utils.d.ts.map +1 -1
  202. package/dist/git/utils/autolink.utils.js.map +1 -1
  203. package/dist/git/utils/blame.utils.d.ts.map +1 -1
  204. package/dist/git/utils/blame.utils.js.map +1 -1
  205. package/dist/git/utils/branch.utils.d.ts.map +1 -1
  206. package/dist/git/utils/branch.utils.js +12 -1
  207. package/dist/git/utils/branch.utils.js.map +1 -1
  208. package/dist/git/utils/commit.utils.d.ts.map +1 -1
  209. package/dist/git/utils/commit.utils.js.map +1 -1
  210. package/dist/git/utils/conflictResolution.utils.d.ts.map +1 -1
  211. package/dist/git/utils/conflictResolution.utils.js.map +1 -1
  212. package/dist/git/utils/contributor.utils.d.ts +1 -1
  213. package/dist/git/utils/contributor.utils.d.ts.map +1 -1
  214. package/dist/git/utils/contributor.utils.js +1 -2
  215. package/dist/git/utils/contributor.utils.js.map +1 -1
  216. package/dist/git/utils/fetch.utils.d.ts.map +1 -1
  217. package/dist/git/utils/fetch.utils.js.map +1 -1
  218. package/dist/git/utils/fileStatus.utils.d.ts +7 -0
  219. package/dist/git/utils/fileStatus.utils.d.ts.map +1 -1
  220. package/dist/git/utils/fileStatus.utils.js +6 -0
  221. package/dist/git/utils/fileStatus.utils.js.map +1 -1
  222. package/dist/git/utils/graph.utils.d.ts +20 -0
  223. package/dist/git/utils/graph.utils.d.ts.map +1 -0
  224. package/dist/git/utils/graph.utils.js +40 -0
  225. package/dist/git/utils/graph.utils.js.map +1 -0
  226. package/dist/git/utils/issue.utils.d.ts.map +1 -1
  227. package/dist/git/utils/issue.utils.js +1 -0
  228. package/dist/git/utils/issue.utils.js.map +1 -1
  229. package/dist/git/utils/issueOrPullRequest.utils.d.ts.map +1 -1
  230. package/dist/git/utils/issueOrPullRequest.utils.js.map +1 -1
  231. package/dist/git/utils/mergeConflicts.utils.d.ts.map +1 -1
  232. package/dist/git/utils/mergeConflicts.utils.js.map +1 -1
  233. package/dist/git/utils/pausedOperationStatus.utils.d.ts +13 -13
  234. package/dist/git/utils/pausedOperationStatus.utils.d.ts.map +1 -1
  235. package/dist/git/utils/pausedOperationStatus.utils.js.map +1 -1
  236. package/dist/git/utils/pullRequest.utils.d.ts.map +1 -1
  237. package/dist/git/utils/pullRequest.utils.js +9 -0
  238. package/dist/git/utils/pullRequest.utils.js.map +1 -1
  239. package/dist/git/utils/reachability.utils.d.ts +20 -2
  240. package/dist/git/utils/reachability.utils.d.ts.map +1 -1
  241. package/dist/git/utils/reachability.utils.js +68 -7
  242. package/dist/git/utils/reachability.utils.js.map +1 -1
  243. package/dist/git/utils/rebase.utils.d.ts.map +1 -1
  244. package/dist/git/utils/rebase.utils.js.map +1 -1
  245. package/dist/git/utils/reference.utils.d.ts.map +1 -1
  246. package/dist/git/utils/reference.utils.js.map +1 -1
  247. package/dist/git/utils/remote.utils.d.ts.map +1 -1
  248. package/dist/git/utils/remote.utils.js.map +1 -1
  249. package/dist/git/utils/repository.utils.d.ts.map +1 -1
  250. package/dist/git/utils/repository.utils.js.map +1 -1
  251. package/dist/git/utils/resourceDescriptor.utils.d.ts.map +1 -1
  252. package/dist/git/utils/resourceDescriptor.utils.js.map +1 -1
  253. package/dist/git/utils/revision.utils.d.ts.map +1 -1
  254. package/dist/git/utils/revision.utils.js.map +1 -1
  255. package/dist/git/utils/search.utils.d.ts.map +1 -1
  256. package/dist/git/utils/search.utils.js.map +1 -1
  257. package/dist/git/utils/sorting.d.ts.map +1 -1
  258. package/dist/git/utils/sorting.js.map +1 -1
  259. package/dist/git/utils/sshKey.utils.d.ts +7 -0
  260. package/dist/git/utils/sshKey.utils.d.ts.map +1 -0
  261. package/dist/git/utils/sshKey.utils.js +25 -0
  262. package/dist/git/utils/sshKey.utils.js.map +1 -0
  263. package/dist/git/utils/status.utils.d.ts.map +1 -1
  264. package/dist/git/utils/status.utils.js.map +1 -1
  265. package/dist/git/utils/statusFile.utils.d.ts.map +1 -1
  266. package/dist/git/utils/statusFile.utils.js.map +1 -1
  267. package/dist/git/utils/tag.utils.d.ts.map +1 -1
  268. package/dist/git/utils/tag.utils.js.map +1 -1
  269. package/dist/git/utils/tooltip.utils.d.ts.map +1 -1
  270. package/dist/git/utils/tooltip.utils.js.map +1 -1
  271. package/dist/git/utils/uriAuthority.d.ts.map +1 -1
  272. package/dist/git/utils/uriAuthority.js.map +1 -1
  273. package/dist/git/utils/user.utils.d.ts.map +1 -1
  274. package/dist/git/utils/user.utils.js.map +1 -1
  275. package/dist/git/utils/worktree.utils.d.ts.map +1 -1
  276. package/dist/git/utils/worktree.utils.js.map +1 -1
  277. package/dist/git/watching/changeEvent.d.ts.map +1 -1
  278. package/dist/git/watching/changeEvent.js.map +1 -1
  279. package/dist/git/watching/classifyChange.d.ts.map +1 -1
  280. package/dist/git/watching/classifyChange.js.map +1 -1
  281. package/dist/git/watching/gitIgnoreFilter.d.ts.map +1 -1
  282. package/dist/git/watching/gitIgnoreFilter.js.map +1 -1
  283. package/dist/git/watching/initWatcher.d.ts.map +1 -1
  284. package/dist/git/watching/initWatcher.js.map +1 -1
  285. package/dist/git/watching/provider.d.ts.map +1 -1
  286. package/dist/git/watching/provider.js.map +1 -1
  287. package/dist/git/watching/watchGroup.d.ts.map +1 -1
  288. package/dist/git/watching/watchGroup.js.map +1 -1
  289. package/dist/git/watching/watchService.d.ts +4 -0
  290. package/dist/git/watching/watchService.d.ts.map +1 -1
  291. package/dist/git/watching/watchService.js +15 -1
  292. package/dist/git/watching/watchService.js.map +1 -1
  293. package/dist/git/watching/watchSession.d.ts +7 -0
  294. package/dist/git/watching/watchSession.d.ts.map +1 -1
  295. package/dist/git/watching/watchSession.js +14 -2
  296. package/dist/git/watching/watchSession.js.map +1 -1
  297. package/dist/git/watching/watcherPatterns.d.ts.map +1 -1
  298. package/dist/git/watching/watcherPatterns.js.map +1 -1
  299. package/dist/git-cli/cliGitProvider.d.ts.map +1 -1
  300. package/dist/git-cli/exec/exec.d.ts.map +1 -1
  301. package/dist/git-cli/exec/exec.errors.d.ts.map +1 -1
  302. package/dist/git-cli/exec/exec.errors.js.map +1 -1
  303. package/dist/git-cli/exec/exec.js.map +1 -1
  304. package/dist/git-cli/exec/exec.types.d.ts.map +1 -1
  305. package/dist/git-cli/exec/exec.types.js.map +1 -1
  306. package/dist/git-cli/exec/features.d.ts.map +1 -1
  307. package/dist/git-cli/exec/features.js.map +1 -1
  308. package/dist/git-cli/exec/git.d.ts +19 -27
  309. package/dist/git-cli/exec/git.d.ts.map +1 -1
  310. package/dist/git-cli/exec/git.js +126 -34
  311. package/dist/git-cli/exec/git.js.map +1 -1
  312. package/dist/git-cli/exec/gitQueue.d.ts.map +1 -1
  313. package/dist/git-cli/exec/gitQueue.js.map +1 -1
  314. package/dist/git-cli/exec/locator.d.ts.map +1 -1
  315. package/dist/git-cli/exec/locator.js.map +1 -1
  316. package/dist/git-cli/parsers/blameParser.d.ts.map +1 -1
  317. package/dist/git-cli/parsers/blameParser.js.map +1 -1
  318. package/dist/git-cli/parsers/indexParser.d.ts.map +1 -1
  319. package/dist/git-cli/parsers/indexParser.js.map +1 -1
  320. package/dist/git-cli/parsers/logParser.d.ts +9 -1
  321. package/dist/git-cli/parsers/logParser.d.ts.map +1 -1
  322. package/dist/git-cli/parsers/logParser.js +141 -60
  323. package/dist/git-cli/parsers/logParser.js.map +1 -1
  324. package/dist/git-cli/parsers/mergeTreeParser.d.ts.map +1 -1
  325. package/dist/git-cli/parsers/mergeTreeParser.js.map +1 -1
  326. package/dist/git-cli/parsers/refParser.d.ts.map +1 -1
  327. package/dist/git-cli/parsers/refParser.js.map +1 -1
  328. package/dist/git-cli/parsers/reflogParser.d.ts.map +1 -1
  329. package/dist/git-cli/parsers/reflogParser.js.map +1 -1
  330. package/dist/git-cli/parsers/remoteParser.d.ts.map +1 -1
  331. package/dist/git-cli/parsers/remoteParser.js.map +1 -1
  332. package/dist/git-cli/parsers/shortlogParser.d.ts.map +1 -1
  333. package/dist/git-cli/parsers/shortlogParser.js.map +1 -1
  334. package/dist/git-cli/parsers/signatureParser.d.ts.map +1 -1
  335. package/dist/git-cli/parsers/signatureParser.js.map +1 -1
  336. package/dist/git-cli/parsers/sshSignatureParser.d.ts +21 -0
  337. package/dist/git-cli/parsers/sshSignatureParser.d.ts.map +1 -0
  338. package/dist/git-cli/parsers/sshSignatureParser.js +78 -0
  339. package/dist/git-cli/parsers/sshSignatureParser.js.map +1 -0
  340. package/dist/git-cli/parsers/statusParser.d.ts.map +1 -1
  341. package/dist/git-cli/parsers/statusParser.js.map +1 -1
  342. package/dist/git-cli/parsers/treeParser.d.ts.map +1 -1
  343. package/dist/git-cli/parsers/treeParser.js.map +1 -1
  344. package/dist/git-cli/parsers/worktreeParser.d.ts.map +1 -1
  345. package/dist/git-cli/parsers/worktreeParser.js +5 -7
  346. package/dist/git-cli/parsers/worktreeParser.js.map +1 -1
  347. package/dist/git-cli/providers/blame.d.ts.map +1 -1
  348. package/dist/git-cli/providers/blame.js.map +1 -1
  349. package/dist/git-cli/providers/branches.d.ts +1 -0
  350. package/dist/git-cli/providers/branches.d.ts.map +1 -1
  351. package/dist/git-cli/providers/branches.js +51 -32
  352. package/dist/git-cli/providers/branches.js.map +1 -1
  353. package/dist/git-cli/providers/commitFilesetUtils.d.ts.map +1 -1
  354. package/dist/git-cli/providers/commitFilesetUtils.js.map +1 -1
  355. package/dist/git-cli/providers/commits.d.ts +12 -1
  356. package/dist/git-cli/providers/commits.d.ts.map +1 -1
  357. package/dist/git-cli/providers/commits.js +89 -8
  358. package/dist/git-cli/providers/commits.js.map +1 -1
  359. package/dist/git-cli/providers/config.d.ts.map +1 -1
  360. package/dist/git-cli/providers/config.js.map +1 -1
  361. package/dist/git-cli/providers/contributors.d.ts.map +1 -1
  362. package/dist/git-cli/providers/contributors.js.map +1 -1
  363. package/dist/git-cli/providers/diff.d.ts.map +1 -1
  364. package/dist/git-cli/providers/diff.js.map +1 -1
  365. package/dist/git-cli/providers/graph.d.ts +35 -1
  366. package/dist/git-cli/providers/graph.d.ts.map +1 -1
  367. package/dist/git-cli/providers/graph.js +1434 -330
  368. package/dist/git-cli/providers/graph.js.map +1 -1
  369. package/dist/git-cli/providers/operations.d.ts.map +1 -1
  370. package/dist/git-cli/providers/operations.js.map +1 -1
  371. package/dist/git-cli/providers/patch.d.ts.map +1 -1
  372. package/dist/git-cli/providers/patch.js.map +1 -1
  373. package/dist/git-cli/providers/pausedOperations.d.ts.map +1 -1
  374. package/dist/git-cli/providers/pausedOperations.js +3 -3
  375. package/dist/git-cli/providers/pausedOperations.js.map +1 -1
  376. package/dist/git-cli/providers/refs.d.ts.map +1 -1
  377. package/dist/git-cli/providers/refs.js.map +1 -1
  378. package/dist/git-cli/providers/remotes.d.ts.map +1 -1
  379. package/dist/git-cli/providers/remotes.js.map +1 -1
  380. package/dist/git-cli/providers/revision.d.ts +1 -0
  381. package/dist/git-cli/providers/revision.d.ts.map +1 -1
  382. package/dist/git-cli/providers/revision.js +33 -0
  383. package/dist/git-cli/providers/revision.js.map +1 -1
  384. package/dist/git-cli/providers/staging.d.ts.map +1 -1
  385. package/dist/git-cli/providers/staging.js.map +1 -1
  386. package/dist/git-cli/providers/stash.d.ts.map +1 -1
  387. package/dist/git-cli/providers/stash.js.map +1 -1
  388. package/dist/git-cli/providers/status.d.ts +28 -0
  389. package/dist/git-cli/providers/status.d.ts.map +1 -1
  390. package/dist/git-cli/providers/status.js +240 -154
  391. package/dist/git-cli/providers/status.js.map +1 -1
  392. package/dist/git-cli/providers/tags.d.ts.map +1 -1
  393. package/dist/git-cli/providers/tags.js +2 -1
  394. package/dist/git-cli/providers/tags.js.map +1 -1
  395. package/dist/git-cli/providers/worktrees.d.ts +2 -1
  396. package/dist/git-cli/providers/worktrees.d.ts.map +1 -1
  397. package/dist/git-cli/providers/worktrees.js +28 -3
  398. package/dist/git-cli/providers/worktrees.js.map +1 -1
  399. package/dist/git-cli/service.d.ts.map +1 -1
  400. package/dist/git-cli/service.js +8 -0
  401. package/dist/git-cli/service.js.map +1 -1
  402. package/dist/ipc/ipcServer.d.ts.map +1 -1
  403. package/dist/ipc/ipcServer.js +1 -1
  404. package/dist/ipc/ipcServer.js.map +1 -1
  405. package/dist/plus/agents/providers/claudeCodeProvider.d.ts +6 -1
  406. package/dist/plus/agents/providers/claudeCodeProvider.d.ts.map +1 -1
  407. package/dist/plus/agents/providers/claudeCodeProvider.js +19 -0
  408. package/dist/plus/agents/providers/claudeCodeProvider.js.map +1 -1
  409. package/dist/plus/agents/providers/claudeCodeTranscript.d.ts +68 -0
  410. package/dist/plus/agents/providers/claudeCodeTranscript.d.ts.map +1 -1
  411. package/dist/plus/agents/providers/claudeCodeTranscript.js +262 -8
  412. package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -1
  413. package/dist/plus/agents/types.d.ts +36 -2
  414. package/dist/plus/agents/types.d.ts.map +1 -1
  415. package/dist/plus/ai/constants.d.ts +1 -2
  416. package/dist/plus/ai/constants.d.ts.map +1 -1
  417. package/dist/plus/ai/constants.js +1 -8
  418. package/dist/plus/ai/constants.js.map +1 -1
  419. package/dist/plus/ai/errors.d.ts.map +1 -1
  420. package/dist/plus/ai/errors.js.map +1 -1
  421. package/dist/plus/ai/models/conversation.d.ts.map +1 -1
  422. package/dist/plus/ai/models/conversation.js.map +1 -1
  423. package/dist/plus/ai/models/model.d.ts +2 -1
  424. package/dist/plus/ai/models/model.d.ts.map +1 -1
  425. package/dist/plus/ai/models/model.js +50 -1
  426. package/dist/plus/ai/models/model.js.map +1 -1
  427. package/dist/plus/ai/models/promptTemplates.d.ts +5 -2
  428. package/dist/plus/ai/models/promptTemplates.d.ts.map +1 -1
  429. package/dist/plus/ai/models/promptTemplates.js.map +1 -1
  430. package/dist/plus/ai/models/provider.d.ts.map +1 -1
  431. package/dist/plus/ai/models/provider.js.map +1 -1
  432. package/dist/plus/ai/models/results.d.ts.map +1 -1
  433. package/dist/plus/ai/models/results.js.map +1 -1
  434. package/dist/plus/ai/prompts.d.ts +1 -1
  435. package/dist/plus/ai/prompts.d.ts.map +1 -1
  436. package/dist/plus/ai/prompts.js +15 -47
  437. package/dist/plus/ai/prompts.js.map +1 -1
  438. package/dist/plus/ai/providers/anthropicProvider.d.ts +5 -0
  439. package/dist/plus/ai/providers/anthropicProvider.d.ts.map +1 -1
  440. package/dist/plus/ai/providers/anthropicProvider.js +40 -3
  441. package/dist/plus/ai/providers/anthropicProvider.js.map +1 -1
  442. package/dist/plus/ai/providers/azureProvider.d.ts.map +1 -1
  443. package/dist/plus/ai/providers/azureProvider.js.map +1 -1
  444. package/dist/plus/ai/providers/context.d.ts.map +1 -1
  445. package/dist/plus/ai/providers/context.js.map +1 -1
  446. package/dist/plus/ai/providers/deepSeekProvider.d.ts.map +1 -1
  447. package/dist/plus/ai/providers/deepSeekProvider.js +17 -1
  448. package/dist/plus/ai/providers/deepSeekProvider.js.map +1 -1
  449. package/dist/plus/ai/providers/geminiProvider.d.ts.map +1 -1
  450. package/dist/plus/ai/providers/geminiProvider.js +25 -6
  451. package/dist/plus/ai/providers/geminiProvider.js.map +1 -1
  452. package/dist/plus/ai/providers/gitkrakenProvider.d.ts.map +1 -1
  453. package/dist/plus/ai/providers/gitkrakenProvider.js +1 -0
  454. package/dist/plus/ai/providers/gitkrakenProvider.js.map +1 -1
  455. package/dist/plus/ai/providers/huggingFaceProvider.d.ts +1 -1
  456. package/dist/plus/ai/providers/huggingFaceProvider.d.ts.map +1 -1
  457. package/dist/plus/ai/providers/huggingFaceProvider.js +21 -18
  458. package/dist/plus/ai/providers/huggingFaceProvider.js.map +1 -1
  459. package/dist/plus/ai/providers/mistralProvider.d.ts.map +1 -1
  460. package/dist/plus/ai/providers/mistralProvider.js.map +1 -1
  461. package/dist/plus/ai/providers/ollamaProvider.d.ts.map +1 -1
  462. package/dist/plus/ai/providers/ollamaProvider.js.map +1 -1
  463. package/dist/plus/ai/providers/openAICompatibleProvider.d.ts.map +1 -1
  464. package/dist/plus/ai/providers/openAICompatibleProvider.js.map +1 -1
  465. package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts +10 -1
  466. package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts.map +1 -1
  467. package/dist/plus/ai/providers/openAICompatibleProviderBase.js +9 -1
  468. package/dist/plus/ai/providers/openAICompatibleProviderBase.js.map +1 -1
  469. package/dist/plus/ai/providers/openRouterProvider.d.ts.map +1 -1
  470. package/dist/plus/ai/providers/openRouterProvider.js.map +1 -1
  471. package/dist/plus/ai/providers/openaiProvider.d.ts.map +1 -1
  472. package/dist/plus/ai/providers/openaiProvider.js.map +1 -1
  473. package/dist/plus/ai/providers/xaiProvider.d.ts.map +1 -1
  474. package/dist/plus/ai/providers/xaiProvider.js +14 -1
  475. package/dist/plus/ai/providers/xaiProvider.js.map +1 -1
  476. package/dist/plus/ai/utils/ai.utils.d.ts.map +1 -1
  477. package/dist/plus/ai/utils/ai.utils.js +0 -2
  478. package/dist/plus/ai/utils/ai.utils.js.map +1 -1
  479. package/dist/plus/ai/utils/results.utils.d.ts +3 -0
  480. package/dist/plus/ai/utils/results.utils.d.ts.map +1 -1
  481. package/dist/plus/ai/utils/results.utils.js +26 -0
  482. package/dist/plus/ai/utils/results.utils.js.map +1 -1
  483. package/dist/plus/ai/utils/truncation.utils.d.ts +1 -1
  484. package/dist/plus/ai/utils/truncation.utils.d.ts.map +1 -1
  485. package/dist/plus/ai/utils/truncation.utils.js.map +1 -1
  486. package/dist/plus/git-github/api/config.d.ts.map +1 -1
  487. package/dist/plus/git-github/api/config.js.map +1 -1
  488. package/dist/plus/git-github/api/github.d.ts +66 -3
  489. package/dist/plus/git-github/api/github.d.ts.map +1 -1
  490. package/dist/plus/git-github/api/github.js +345 -74
  491. package/dist/plus/git-github/api/github.js.map +1 -1
  492. package/dist/plus/git-github/api/github.utils.d.ts.map +1 -1
  493. package/dist/plus/git-github/api/github.utils.js.map +1 -1
  494. package/dist/plus/git-github/api/token.d.ts.map +1 -1
  495. package/dist/plus/git-github/api/token.js.map +1 -1
  496. package/dist/plus/git-github/api/tokenUtils.d.ts.map +1 -1
  497. package/dist/plus/git-github/api/tokenUtils.js.map +1 -1
  498. package/dist/plus/git-github/api/types.d.ts.map +1 -1
  499. package/dist/plus/git-github/api/types.js.map +1 -1
  500. package/dist/plus/git-github/context.d.ts.map +1 -1
  501. package/dist/plus/git-github/models.d.ts +5 -0
  502. package/dist/plus/git-github/models.d.ts.map +1 -1
  503. package/dist/plus/git-github/models.js +27 -2
  504. package/dist/plus/git-github/models.js.map +1 -1
  505. package/dist/plus/git-github/providers/github/blame.d.ts.map +1 -1
  506. package/dist/plus/git-github/providers/github/blame.js.map +1 -1
  507. package/dist/plus/git-github/providers/github/branches.d.ts +2 -1
  508. package/dist/plus/git-github/providers/github/branches.d.ts.map +1 -1
  509. package/dist/plus/git-github/providers/github/branches.js +7 -3
  510. package/dist/plus/git-github/providers/github/branches.js.map +1 -1
  511. package/dist/plus/git-github/providers/github/commits.d.ts.map +1 -1
  512. package/dist/plus/git-github/providers/github/commits.js.map +1 -1
  513. package/dist/plus/git-github/providers/github/config.d.ts.map +1 -1
  514. package/dist/plus/git-github/providers/github/config.js.map +1 -1
  515. package/dist/plus/git-github/providers/github/contributors.d.ts.map +1 -1
  516. package/dist/plus/git-github/providers/github/contributors.js.map +1 -1
  517. package/dist/plus/git-github/providers/github/diff.d.ts.map +1 -1
  518. package/dist/plus/git-github/providers/github/diff.js +2 -2
  519. package/dist/plus/git-github/providers/github/diff.js.map +1 -1
  520. package/dist/plus/git-github/providers/github/graph.d.ts +12 -1
  521. package/dist/plus/git-github/providers/github/graph.d.ts.map +1 -1
  522. package/dist/plus/git-github/providers/github/graph.js +85 -0
  523. package/dist/plus/git-github/providers/github/graph.js.map +1 -1
  524. package/dist/plus/git-github/providers/github/refs.d.ts.map +1 -1
  525. package/dist/plus/git-github/providers/github/refs.js.map +1 -1
  526. package/dist/plus/git-github/providers/github/remotes.d.ts.map +1 -1
  527. package/dist/plus/git-github/providers/github/remotes.js.map +1 -1
  528. package/dist/plus/git-github/providers/github/revision.d.ts.map +1 -1
  529. package/dist/plus/git-github/providers/github/revision.js.map +1 -1
  530. package/dist/plus/git-github/providers/github/status.d.ts.map +1 -1
  531. package/dist/plus/git-github/providers/github/status.js.map +1 -1
  532. package/dist/plus/git-github/providers/github/tags.d.ts.map +1 -1
  533. package/dist/plus/git-github/providers/github/tags.js +3 -1
  534. package/dist/plus/git-github/providers/github/tags.js.map +1 -1
  535. package/dist/plus/git-github/providers/githubGitProvider.d.ts.map +1 -1
  536. package/dist/plus/git-github/providers/githubGitProvider.js.map +1 -1
  537. package/dist/plus/git-github/providers/githubProvider.d.ts.map +1 -1
  538. package/dist/plus/git-github/providers/githubProvider.js.map +1 -1
  539. package/dist/plus/integrations/authentication/cloudIntegrationService.d.ts +20 -1
  540. package/dist/plus/integrations/authentication/cloudIntegrationService.d.ts.map +1 -1
  541. package/dist/plus/integrations/authentication/cloudIntegrationService.js +134 -10
  542. package/dist/plus/integrations/authentication/cloudIntegrationService.js.map +1 -1
  543. package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts +52 -5
  544. package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts.map +1 -1
  545. package/dist/plus/integrations/authentication/configuredIntegrationService.js +248 -46
  546. package/dist/plus/integrations/authentication/configuredIntegrationService.js.map +1 -1
  547. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts +24 -4
  548. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts.map +1 -1
  549. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js +58 -26
  550. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js.map +1 -1
  551. package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts.map +1 -1
  552. package/dist/plus/integrations/authentication/integrationAuthenticationService.js +7 -3
  553. package/dist/plus/integrations/authentication/integrationAuthenticationService.js.map +1 -1
  554. package/dist/plus/integrations/authentication/manualTokenProvider.d.ts +1 -0
  555. package/dist/plus/integrations/authentication/manualTokenProvider.d.ts.map +1 -1
  556. package/dist/plus/integrations/authentication/manualTokenProvider.js +9 -5
  557. package/dist/plus/integrations/authentication/manualTokenProvider.js.map +1 -1
  558. package/dist/plus/integrations/authentication/models.d.ts +33 -0
  559. package/dist/plus/integrations/authentication/models.d.ts.map +1 -1
  560. package/dist/plus/integrations/authentication/models.js.map +1 -1
  561. package/dist/plus/integrations/collectionMetadata.d.ts +21 -0
  562. package/dist/plus/integrations/collectionMetadata.d.ts.map +1 -0
  563. package/dist/plus/integrations/collectionMetadata.js +121 -0
  564. package/dist/plus/integrations/collectionMetadata.js.map +1 -0
  565. package/dist/plus/integrations/constants.d.ts +12 -2
  566. package/dist/plus/integrations/constants.d.ts.map +1 -1
  567. package/dist/plus/integrations/constants.js +10 -0
  568. package/dist/plus/integrations/constants.js.map +1 -1
  569. package/dist/plus/integrations/context.d.ts +10 -6
  570. package/dist/plus/integrations/context.d.ts.map +1 -1
  571. package/dist/plus/integrations/errors.d.ts +65 -0
  572. package/dist/plus/integrations/errors.d.ts.map +1 -1
  573. package/dist/plus/integrations/errors.js +135 -0
  574. package/dist/plus/integrations/errors.js.map +1 -1
  575. package/dist/plus/integrations/index.d.ts +57 -12
  576. package/dist/plus/integrations/index.d.ts.map +1 -1
  577. package/dist/plus/integrations/index.js +39 -37
  578. package/dist/plus/integrations/index.js.map +1 -1
  579. package/dist/plus/integrations/integrationService.d.ts +297 -13
  580. package/dist/plus/integrations/integrationService.d.ts.map +1 -1
  581. package/dist/plus/integrations/integrationService.js +672 -36
  582. package/dist/plus/integrations/integrationService.js.map +1 -1
  583. package/dist/plus/integrations/lite.d.ts +47 -0
  584. package/dist/plus/integrations/lite.d.ts.map +1 -0
  585. package/dist/plus/integrations/lite.js +141 -0
  586. package/dist/plus/integrations/lite.js.map +1 -0
  587. package/dist/plus/integrations/manager.d.ts +332 -0
  588. package/dist/plus/integrations/manager.d.ts.map +1 -0
  589. package/dist/plus/integrations/manager.js +2 -0
  590. package/dist/plus/integrations/manager.js.map +1 -0
  591. package/dist/plus/integrations/models/gitHostIntegration.d.ts +262 -10
  592. package/dist/plus/integrations/models/gitHostIntegration.d.ts.map +1 -1
  593. package/dist/plus/integrations/models/gitHostIntegration.js +675 -101
  594. package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
  595. package/dist/plus/integrations/models/integration.d.ts +88 -3
  596. package/dist/plus/integrations/models/integration.d.ts.map +1 -1
  597. package/dist/plus/integrations/models/integration.js +192 -21
  598. package/dist/plus/integrations/models/integration.js.map +1 -1
  599. package/dist/plus/integrations/models/issuesIntegration.d.ts +70 -7
  600. package/dist/plus/integrations/models/issuesIntegration.d.ts.map +1 -1
  601. package/dist/plus/integrations/models/issuesIntegration.js +108 -35
  602. package/dist/plus/integrations/models/issuesIntegration.js.map +1 -1
  603. package/dist/plus/integrations/providerFilters.d.ts +12 -0
  604. package/dist/plus/integrations/providerFilters.d.ts.map +1 -0
  605. package/dist/plus/integrations/providerFilters.js +14 -0
  606. package/dist/plus/integrations/providerFilters.js.map +1 -0
  607. package/dist/plus/integrations/providers/apiClients.d.ts.map +1 -1
  608. package/dist/plus/integrations/providers/apiClients.js +3 -3
  609. package/dist/plus/integrations/providers/apiClients.js.map +1 -1
  610. package/dist/plus/integrations/providers/apiConfig.d.ts +52 -0
  611. package/dist/plus/integrations/providers/apiConfig.d.ts.map +1 -0
  612. package/dist/plus/integrations/providers/apiConfig.js +19 -0
  613. package/dist/plus/integrations/providers/apiConfig.js.map +1 -0
  614. package/dist/plus/integrations/providers/azure/azure.d.ts +14 -2
  615. package/dist/plus/integrations/providers/azure/azure.d.ts.map +1 -1
  616. package/dist/plus/integrations/providers/azure/azure.js +107 -32
  617. package/dist/plus/integrations/providers/azure/azure.js.map +1 -1
  618. package/dist/plus/integrations/providers/azure/models.d.ts +16 -0
  619. package/dist/plus/integrations/providers/azure/models.d.ts.map +1 -1
  620. package/dist/plus/integrations/providers/azure/models.js +6 -6
  621. package/dist/plus/integrations/providers/azure/models.js.map +1 -1
  622. package/dist/plus/integrations/providers/azureDevOps.d.ts +55 -9
  623. package/dist/plus/integrations/providers/azureDevOps.d.ts.map +1 -1
  624. package/dist/plus/integrations/providers/azureDevOps.js +572 -79
  625. package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
  626. package/dist/plus/integrations/providers/bitbucket/bitbucket.d.ts +13 -2
  627. package/dist/plus/integrations/providers/bitbucket/bitbucket.d.ts.map +1 -1
  628. package/dist/plus/integrations/providers/bitbucket/bitbucket.js +108 -32
  629. package/dist/plus/integrations/providers/bitbucket/bitbucket.js.map +1 -1
  630. package/dist/plus/integrations/providers/bitbucket/models.d.ts.map +1 -1
  631. package/dist/plus/integrations/providers/bitbucket/models.js.map +1 -1
  632. package/dist/plus/integrations/providers/bitbucket-server/models.d.ts +19 -1
  633. package/dist/plus/integrations/providers/bitbucket-server/models.d.ts.map +1 -1
  634. package/dist/plus/integrations/providers/bitbucket-server/models.js +20 -1
  635. package/dist/plus/integrations/providers/bitbucket-server/models.js.map +1 -1
  636. package/dist/plus/integrations/providers/bitbucket-server.d.ts +28 -4
  637. package/dist/plus/integrations/providers/bitbucket-server.d.ts.map +1 -1
  638. package/dist/plus/integrations/providers/bitbucket-server.js +110 -6
  639. package/dist/plus/integrations/providers/bitbucket-server.js.map +1 -1
  640. package/dist/plus/integrations/providers/bitbucket.d.ts +38 -4
  641. package/dist/plus/integrations/providers/bitbucket.d.ts.map +1 -1
  642. package/dist/plus/integrations/providers/bitbucket.js +330 -34
  643. package/dist/plus/integrations/providers/bitbucket.js.map +1 -1
  644. package/dist/plus/integrations/providers/github/github.d.ts.map +1 -1
  645. package/dist/plus/integrations/providers/github/github.js +1 -1
  646. package/dist/plus/integrations/providers/github/github.js.map +1 -1
  647. package/dist/plus/integrations/providers/github/github.utils.d.ts.map +1 -1
  648. package/dist/plus/integrations/providers/github/github.utils.js.map +1 -1
  649. package/dist/plus/integrations/providers/github/models.d.ts.map +1 -1
  650. package/dist/plus/integrations/providers/github/models.js.map +1 -1
  651. package/dist/plus/integrations/providers/github.d.ts +49 -6
  652. package/dist/plus/integrations/providers/github.d.ts.map +1 -1
  653. package/dist/plus/integrations/providers/github.js +289 -4
  654. package/dist/plus/integrations/providers/github.js.map +1 -1
  655. package/dist/plus/integrations/providers/gitlab/gitlab.d.ts +11 -3
  656. package/dist/plus/integrations/providers/gitlab/gitlab.d.ts.map +1 -1
  657. package/dist/plus/integrations/providers/gitlab/gitlab.js +121 -47
  658. package/dist/plus/integrations/providers/gitlab/gitlab.js.map +1 -1
  659. package/dist/plus/integrations/providers/gitlab/gitlab.utils.d.ts +6 -0
  660. package/dist/plus/integrations/providers/gitlab/gitlab.utils.d.ts.map +1 -1
  661. package/dist/plus/integrations/providers/gitlab/gitlab.utils.js +8 -0
  662. package/dist/plus/integrations/providers/gitlab/gitlab.utils.js.map +1 -1
  663. package/dist/plus/integrations/providers/gitlab/models.d.ts +10 -0
  664. package/dist/plus/integrations/providers/gitlab/models.d.ts.map +1 -1
  665. package/dist/plus/integrations/providers/gitlab/models.js +8 -5
  666. package/dist/plus/integrations/providers/gitlab/models.js.map +1 -1
  667. package/dist/plus/integrations/providers/gitlab.d.ts +50 -5
  668. package/dist/plus/integrations/providers/gitlab.d.ts.map +1 -1
  669. package/dist/plus/integrations/providers/gitlab.js +274 -8
  670. package/dist/plus/integrations/providers/gitlab.js.map +1 -1
  671. package/dist/plus/integrations/providers/jira.d.ts +13 -2
  672. package/dist/plus/integrations/providers/jira.d.ts.map +1 -1
  673. package/dist/plus/integrations/providers/jira.js +200 -30
  674. package/dist/plus/integrations/providers/jira.js.map +1 -1
  675. package/dist/plus/integrations/providers/linear.d.ts +16 -5
  676. package/dist/plus/integrations/providers/linear.d.ts.map +1 -1
  677. package/dist/plus/integrations/providers/linear.js +127 -21
  678. package/dist/plus/integrations/providers/linear.js.map +1 -1
  679. package/dist/plus/integrations/providers/models.d.ts +339 -60
  680. package/dist/plus/integrations/providers/models.d.ts.map +1 -1
  681. package/dist/plus/integrations/providers/models.js +307 -59
  682. package/dist/plus/integrations/providers/models.js.map +1 -1
  683. package/dist/plus/integrations/providers/providersApi.d.ts +144 -11
  684. package/dist/plus/integrations/providers/providersApi.d.ts.map +1 -1
  685. package/dist/plus/integrations/providers/providersApi.js +486 -55
  686. package/dist/plus/integrations/providers/providersApi.js.map +1 -1
  687. package/dist/plus/integrations/providers/trello.d.ts +47 -0
  688. package/dist/plus/integrations/providers/trello.d.ts.map +1 -0
  689. package/dist/plus/integrations/providers/trello.js +141 -0
  690. package/dist/plus/integrations/providers/trello.js.map +1 -0
  691. package/dist/plus/integrations/providers/utils/providerPaging.d.ts +29 -0
  692. package/dist/plus/integrations/providers/utils/providerPaging.d.ts.map +1 -0
  693. package/dist/plus/integrations/providers/utils/providerPaging.js +154 -0
  694. package/dist/plus/integrations/providers/utils/providerPaging.js.map +1 -0
  695. package/dist/plus/integrations/providers/utils.d.ts +21 -0
  696. package/dist/plus/integrations/providers/utils.d.ts.map +1 -1
  697. package/dist/plus/integrations/providers/utils.js +57 -6
  698. package/dist/plus/integrations/providers/utils.js.map +1 -1
  699. package/dist/plus/integrations/reads/broaden.d.ts +20 -0
  700. package/dist/plus/integrations/reads/broaden.d.ts.map +1 -0
  701. package/dist/plus/integrations/reads/broaden.js +326 -0
  702. package/dist/plus/integrations/reads/broaden.js.map +1 -0
  703. package/dist/plus/integrations/reads/context.d.ts +74 -0
  704. package/dist/plus/integrations/reads/context.d.ts.map +1 -0
  705. package/dist/plus/integrations/reads/context.js +2 -0
  706. package/dist/plus/integrations/reads/context.js.map +1 -0
  707. package/dist/plus/integrations/reads/cursors.d.ts +66 -0
  708. package/dist/plus/integrations/reads/cursors.d.ts.map +1 -0
  709. package/dist/plus/integrations/reads/cursors.js +133 -0
  710. package/dist/plus/integrations/reads/cursors.js.map +1 -0
  711. package/dist/plus/integrations/reads/drains.d.ts +60 -0
  712. package/dist/plus/integrations/reads/drains.d.ts.map +1 -0
  713. package/dist/plus/integrations/reads/drains.js +255 -0
  714. package/dist/plus/integrations/reads/drains.js.map +1 -0
  715. package/dist/plus/integrations/reads/filters.d.ts +81 -0
  716. package/dist/plus/integrations/reads/filters.d.ts.map +1 -0
  717. package/dist/plus/integrations/reads/filters.js +87 -0
  718. package/dist/plus/integrations/reads/filters.js.map +1 -0
  719. package/dist/plus/integrations/reads/hierarchy.d.ts +17 -0
  720. package/dist/plus/integrations/reads/hierarchy.d.ts.map +1 -0
  721. package/dist/plus/integrations/reads/hierarchy.js +320 -0
  722. package/dist/plus/integrations/reads/hierarchy.js.map +1 -0
  723. package/dist/plus/integrations/reads/hierarchy.utils.d.ts +77 -0
  724. package/dist/plus/integrations/reads/hierarchy.utils.d.ts.map +1 -0
  725. package/dist/plus/integrations/reads/hierarchy.utils.js +128 -0
  726. package/dist/plus/integrations/reads/hierarchy.utils.js.map +1 -0
  727. package/dist/plus/integrations/reads/issueTracker.d.ts +19 -0
  728. package/dist/plus/integrations/reads/issueTracker.d.ts.map +1 -0
  729. package/dist/plus/integrations/reads/issueTracker.js +334 -0
  730. package/dist/plus/integrations/reads/issueTracker.js.map +1 -0
  731. package/dist/plus/integrations/reads/issues.d.ts +34 -0
  732. package/dist/plus/integrations/reads/issues.d.ts.map +1 -0
  733. package/dist/plus/integrations/reads/issues.js +244 -0
  734. package/dist/plus/integrations/reads/issues.js.map +1 -0
  735. package/dist/plus/integrations/reads/paging.d.ts +136 -0
  736. package/dist/plus/integrations/reads/paging.d.ts.map +1 -0
  737. package/dist/plus/integrations/reads/paging.js +221 -0
  738. package/dist/plus/integrations/reads/paging.js.map +1 -0
  739. package/dist/plus/integrations/reads/pullRequests.d.ts +32 -0
  740. package/dist/plus/integrations/reads/pullRequests.d.ts.map +1 -0
  741. package/dist/plus/integrations/reads/pullRequests.js +151 -0
  742. package/dist/plus/integrations/reads/pullRequests.js.map +1 -0
  743. package/dist/plus/integrations/reads/resolveRepository.d.ts +25 -0
  744. package/dist/plus/integrations/reads/resolveRepository.d.ts.map +1 -0
  745. package/dist/plus/integrations/reads/resolveRepository.js +235 -0
  746. package/dist/plus/integrations/reads/resolveRepository.js.map +1 -0
  747. package/dist/plus/integrations/reads/sweeps.d.ts +11 -0
  748. package/dist/plus/integrations/reads/sweeps.d.ts.map +1 -0
  749. package/dist/plus/integrations/reads/sweeps.js +125 -0
  750. package/dist/plus/integrations/reads/sweeps.js.map +1 -0
  751. package/dist/plus/integrations/reads/warnings.d.ts +47 -0
  752. package/dist/plus/integrations/reads/warnings.d.ts.map +1 -0
  753. package/dist/plus/integrations/reads/warnings.js +81 -0
  754. package/dist/plus/integrations/reads/warnings.js.map +1 -0
  755. package/dist/plus/integrations/results.d.ts +189 -0
  756. package/dist/plus/integrations/results.d.ts.map +1 -0
  757. package/dist/plus/integrations/results.js +62 -0
  758. package/dist/plus/integrations/results.js.map +1 -0
  759. package/dist/plus/integrations/utils/domain.utils.d.ts +5 -0
  760. package/dist/plus/integrations/utils/domain.utils.d.ts.map +1 -0
  761. package/dist/plus/integrations/utils/domain.utils.js +27 -0
  762. package/dist/plus/integrations/utils/domain.utils.js.map +1 -0
  763. package/dist/plus/integrations/utils/integration.utils.d.ts +27 -1
  764. package/dist/plus/integrations/utils/integration.utils.d.ts.map +1 -1
  765. package/dist/plus/integrations/utils/integration.utils.js +86 -15
  766. package/dist/plus/integrations/utils/integration.utils.js.map +1 -1
  767. package/dist/utils/array.d.ts.map +1 -1
  768. package/dist/utils/array.js.map +1 -1
  769. package/dist/utils/brand.d.ts.map +1 -1
  770. package/dist/utils/cancellation.d.ts +13 -0
  771. package/dist/utils/cancellation.d.ts.map +1 -1
  772. package/dist/utils/cancellation.js +52 -7
  773. package/dist/utils/cancellation.js.map +1 -1
  774. package/dist/utils/charCode.d.ts.map +1 -1
  775. package/dist/utils/coalescedRun.d.ts +16 -0
  776. package/dist/utils/coalescedRun.d.ts.map +1 -0
  777. package/dist/utils/coalescedRun.js +43 -0
  778. package/dist/utils/coalescedRun.js.map +1 -0
  779. package/dist/utils/color.d.ts.map +1 -1
  780. package/dist/utils/color.js +3 -3
  781. package/dist/utils/color.js.map +1 -1
  782. package/dist/utils/date.d.ts +24 -0
  783. package/dist/utils/date.d.ts.map +1 -1
  784. package/dist/utils/date.js +62 -0
  785. package/dist/utils/date.js.map +1 -1
  786. package/dist/utils/debounce.js +1 -1
  787. package/dist/utils/debounce.js.map +1 -1
  788. package/dist/utils/decorators/debounce.d.ts.map +1 -1
  789. package/dist/utils/decorators/debounce.js.map +1 -1
  790. package/dist/utils/decorators/gate.d.ts.map +1 -1
  791. package/dist/utils/decorators/gate.js +2 -2
  792. package/dist/utils/decorators/gate.js.map +1 -1
  793. package/dist/utils/decorators/log.d.ts.map +1 -1
  794. package/dist/utils/decorators/log.js +5 -5
  795. package/dist/utils/decorators/log.js.map +1 -1
  796. package/dist/utils/decorators/memoize.d.ts.map +1 -1
  797. package/dist/utils/decorators/memoize.js +2 -2
  798. package/dist/utils/decorators/memoize.js.map +1 -1
  799. package/dist/utils/decorators/resolver.d.ts.map +1 -1
  800. package/dist/utils/decorators/resolver.js.map +1 -1
  801. package/dist/utils/decorators/sequentialize.d.ts.map +1 -1
  802. package/dist/utils/decorators/sequentialize.js +2 -2
  803. package/dist/utils/decorators/sequentialize.js.map +1 -1
  804. package/dist/utils/decorators/serializable.d.ts.map +1 -1
  805. package/dist/utils/decorators/serializable.js +1 -1
  806. package/dist/utils/decorators/serializable.js.map +1 -1
  807. package/dist/utils/dedupedAsyncCache.d.ts.map +1 -1
  808. package/dist/utils/env/browser/base64.d.ts.map +1 -1
  809. package/dist/utils/env/browser/base64.js.map +1 -1
  810. package/dist/utils/env/browser/crypto.d.ts.map +1 -1
  811. package/dist/utils/env/browser/crypto.js.map +1 -1
  812. package/dist/utils/env/browser/fs.d.ts.map +1 -1
  813. package/dist/utils/env/browser/fs.js.map +1 -1
  814. package/dist/utils/env/browser/hex.d.ts.map +1 -1
  815. package/dist/utils/env/browser/hex.js.map +1 -1
  816. package/dist/utils/env/browser/hrtime.d.ts.map +1 -1
  817. package/dist/utils/env/browser/hrtime.js.map +1 -1
  818. package/dist/utils/env/browser/logScope.d.ts.map +1 -1
  819. package/dist/utils/env/browser/logScope.js.map +1 -1
  820. package/dist/utils/env/browser/md5.d.ts.map +1 -1
  821. package/dist/utils/env/browser/md5.js.map +1 -1
  822. package/dist/utils/env/browser/platform.d.ts.map +1 -1
  823. package/dist/utils/env/browser/platform.js.map +1 -1
  824. package/dist/utils/env/node/base64.d.ts.map +1 -1
  825. package/dist/utils/env/node/base64.js.map +1 -1
  826. package/dist/utils/env/node/crypto.d.ts.map +1 -1
  827. package/dist/utils/env/node/crypto.js.map +1 -1
  828. package/dist/utils/env/node/exec.d.ts +9 -1
  829. package/dist/utils/env/node/exec.d.ts.map +1 -1
  830. package/dist/utils/env/node/exec.js +11 -4
  831. package/dist/utils/env/node/exec.js.map +1 -1
  832. package/dist/utils/env/node/fs.d.ts.map +1 -1
  833. package/dist/utils/env/node/fs.js.map +1 -1
  834. package/dist/utils/env/node/hex.d.ts.map +1 -1
  835. package/dist/utils/env/node/hex.js.map +1 -1
  836. package/dist/utils/env/node/hrtime.d.ts.map +1 -1
  837. package/dist/utils/env/node/hrtime.js.map +1 -1
  838. package/dist/utils/env/node/logScope.d.ts.map +1 -1
  839. package/dist/utils/env/node/logScope.js.map +1 -1
  840. package/dist/utils/env/node/platform.d.ts.map +1 -1
  841. package/dist/utils/env/node/platform.js.map +1 -1
  842. package/dist/utils/event.d.ts.map +1 -1
  843. package/dist/utils/event.js +18 -22
  844. package/dist/utils/event.js.map +1 -1
  845. package/dist/utils/formatter.d.ts.map +1 -1
  846. package/dist/utils/formatter.js.map +1 -1
  847. package/dist/utils/function.d.ts.map +1 -1
  848. package/dist/utils/function.js +3 -3
  849. package/dist/utils/function.js.map +1 -1
  850. package/dist/utils/hash.js.map +1 -1
  851. package/dist/utils/iterable.d.ts.map +1 -1
  852. package/dist/utils/iterable.js +2 -6
  853. package/dist/utils/iterable.js.map +1 -1
  854. package/dist/utils/lazy.d.ts.map +1 -1
  855. package/dist/utils/lazy.js.map +1 -1
  856. package/dist/utils/logger.d.ts.map +1 -1
  857. package/dist/utils/logger.js +1 -1
  858. package/dist/utils/logger.js.map +1 -1
  859. package/dist/utils/logger.scoped.js +1 -1
  860. package/dist/utils/logger.scoped.js.map +1 -1
  861. package/dist/utils/lruMap.d.ts.map +1 -1
  862. package/dist/utils/lruMap.js.map +1 -1
  863. package/dist/utils/mru.d.ts.map +1 -1
  864. package/dist/utils/mru.js.map +1 -1
  865. package/dist/utils/object.js.map +1 -1
  866. package/dist/utils/paging.d.ts +29 -0
  867. package/dist/utils/paging.d.ts.map +1 -1
  868. package/dist/utils/paging.js +18 -0
  869. package/dist/utils/paging.js.map +1 -1
  870. package/dist/utils/path.js.map +1 -1
  871. package/dist/utils/promise.d.ts +10 -0
  872. package/dist/utils/promise.d.ts.map +1 -1
  873. package/dist/utils/promise.js +26 -3
  874. package/dist/utils/promise.js.map +1 -1
  875. package/dist/utils/promiseCache.d.ts +12 -2
  876. package/dist/utils/promiseCache.d.ts.map +1 -1
  877. package/dist/utils/promiseCache.js +80 -50
  878. package/dist/utils/promiseCache.js.map +1 -1
  879. package/dist/utils/searchTree.d.ts.map +1 -1
  880. package/dist/utils/searchTree.js +4 -1
  881. package/dist/utils/searchTree.js.map +1 -1
  882. package/dist/utils/stopwatch.d.ts.map +1 -1
  883. package/dist/utils/string.js +1 -1
  884. package/dist/utils/string.js.map +1 -1
  885. package/dist/utils/subscriptionManager.d.ts.map +1 -1
  886. package/dist/utils/subscriptionManager.js.map +1 -1
  887. package/dist/utils/trie.d.ts.map +1 -1
  888. package/dist/utils/trie.js +1 -0
  889. package/dist/utils/trie.js.map +1 -1
  890. package/docs/integrations.md +372 -0
  891. package/docs/kepler-read-api-parity.md +112 -0
  892. package/package.json +238 -213
  893. package/src/git/cache.ts +75 -8
  894. package/src/git/errors.ts +36 -1
  895. package/src/git/models/commit.ts +1 -1
  896. package/src/git/models/graph.ts +147 -0
  897. package/src/git/models/graphSession.ts +205 -0
  898. package/src/git/models/issue.ts +12 -1
  899. package/src/git/models/pullRequest.ts +27 -1
  900. package/src/git/models/repository.ts +24 -1
  901. package/src/git/models/resourceDescriptor.ts +17 -0
  902. package/src/git/models/signature.ts +16 -0
  903. package/src/git/models/tag.ts +6 -1
  904. package/src/git/parsers/diffParser.ts +1 -1
  905. package/src/git/providers/branches.ts +6 -1
  906. package/src/git/providers/commits.ts +6 -1
  907. package/src/git/providers/config.ts +5 -1
  908. package/src/git/providers/graph.ts +69 -2
  909. package/src/git/providers/status.ts +1 -1
  910. package/src/git/providers/worktrees.ts +3 -1
  911. package/src/git/remotes/azure-devops.ts +29 -33
  912. package/src/git/remotes/bitbucket-server.ts +23 -25
  913. package/src/git/remotes/bitbucket.ts +23 -25
  914. package/src/git/remotes/gerrit.ts +12 -14
  915. package/src/git/remotes/gitea.ts +13 -15
  916. package/src/git/remotes/github.ts +56 -58
  917. package/src/git/remotes/gitlab.ts +102 -104
  918. package/src/git/run.types.ts +54 -4
  919. package/src/git/utils/branch.utils.ts +12 -1
  920. package/src/git/utils/contributor.utils.ts +1 -1
  921. package/src/git/utils/fileStatus.utils.ts +7 -0
  922. package/src/git/utils/graph.utils.ts +46 -0
  923. package/src/git/utils/issue.utils.ts +1 -0
  924. package/src/git/utils/pullRequest.utils.ts +9 -0
  925. package/src/git/utils/reachability.utils.ts +79 -8
  926. package/src/git/utils/sshKey.utils.ts +30 -0
  927. package/src/git/watching/watchService.ts +16 -1
  928. package/src/git/watching/watchSession.ts +20 -2
  929. package/src/git-cli/exec/git.ts +144 -42
  930. package/src/git-cli/parsers/logParser.ts +83 -1
  931. package/src/git-cli/parsers/sshSignatureParser.ts +85 -0
  932. package/src/git-cli/parsers/worktreeParser.ts +5 -7
  933. package/src/git-cli/providers/branches.ts +60 -38
  934. package/src/git-cli/providers/commits.ts +102 -9
  935. package/src/git-cli/providers/graph.ts +1771 -393
  936. package/src/git-cli/providers/pausedOperations.ts +3 -3
  937. package/src/git-cli/providers/revision.ts +42 -0
  938. package/src/git-cli/providers/status.ts +333 -178
  939. package/src/git-cli/providers/tags.ts +2 -0
  940. package/src/git-cli/providers/worktrees.ts +40 -4
  941. package/src/git-cli/service.ts +9 -0
  942. package/src/ipc/ipcServer.ts +1 -1
  943. package/src/plus/agents/providers/claudeCodeProvider.ts +25 -0
  944. package/src/plus/agents/providers/claudeCodeTranscript.ts +320 -8
  945. package/src/plus/agents/types.ts +34 -0
  946. package/src/plus/ai/constants.ts +1 -9
  947. package/src/plus/ai/models/model.ts +53 -2
  948. package/src/plus/ai/models/promptTemplates.ts +9 -2
  949. package/src/plus/ai/prompts.ts +16 -48
  950. package/src/plus/ai/providers/anthropicProvider.ts +45 -3
  951. package/src/plus/ai/providers/deepSeekProvider.ts +17 -1
  952. package/src/plus/ai/providers/geminiProvider.ts +25 -6
  953. package/src/plus/ai/providers/gitkrakenProvider.ts +2 -0
  954. package/src/plus/ai/providers/huggingFaceProvider.ts +28 -21
  955. package/src/plus/ai/providers/openAICompatibleProviderBase.ts +16 -1
  956. package/src/plus/ai/providers/xaiProvider.ts +14 -1
  957. package/src/plus/ai/utils/ai.utils.ts +0 -2
  958. package/src/plus/ai/utils/results.utils.ts +32 -0
  959. package/src/plus/ai/utils/truncation.utils.ts +0 -1
  960. package/src/plus/git-github/api/github.ts +484 -104
  961. package/src/plus/git-github/models.ts +33 -0
  962. package/src/plus/git-github/providers/github/branches.ts +6 -3
  963. package/src/plus/git-github/providers/github/diff.ts +1 -1
  964. package/src/plus/git-github/providers/github/graph.ts +131 -0
  965. package/src/plus/git-github/providers/github/tags.ts +2 -0
  966. package/src/plus/integrations/authentication/cloudIntegrationService.ts +189 -17
  967. package/src/plus/integrations/authentication/configuredIntegrationService.ts +287 -50
  968. package/src/plus/integrations/authentication/integrationAuthenticationProvider.ts +105 -31
  969. package/src/plus/integrations/authentication/integrationAuthenticationService.ts +7 -3
  970. package/src/plus/integrations/authentication/manualTokenProvider.ts +12 -5
  971. package/src/plus/integrations/authentication/models.ts +35 -1
  972. package/src/plus/integrations/collectionMetadata.ts +143 -0
  973. package/src/plus/integrations/constants.ts +21 -0
  974. package/src/plus/integrations/context.ts +8 -9
  975. package/src/plus/integrations/errors.ts +153 -0
  976. package/src/plus/integrations/index.ts +148 -51
  977. package/src/plus/integrations/integrationService.ts +940 -49
  978. package/src/plus/integrations/lite.ts +233 -0
  979. package/src/plus/integrations/manager.ts +359 -0
  980. package/src/plus/integrations/models/gitHostIntegration.ts +1005 -134
  981. package/src/plus/integrations/models/integration.ts +293 -24
  982. package/src/plus/integrations/models/issuesIntegration.ts +132 -39
  983. package/src/plus/integrations/providerFilters.ts +12 -0
  984. package/src/plus/integrations/providers/apiClients.ts +8 -11
  985. package/src/plus/integrations/providers/apiConfig.ts +71 -0
  986. package/src/plus/integrations/providers/azure/azure.ts +164 -33
  987. package/src/plus/integrations/providers/azure/models.ts +19 -6
  988. package/src/plus/integrations/providers/azureDevOps.ts +766 -101
  989. package/src/plus/integrations/providers/bitbucket/bitbucket.ts +164 -34
  990. package/src/plus/integrations/providers/bitbucket-server/models.ts +32 -1
  991. package/src/plus/integrations/providers/bitbucket-server.ts +173 -8
  992. package/src/plus/integrations/providers/bitbucket.ts +489 -45
  993. package/src/plus/integrations/providers/github/github.ts +2 -2
  994. package/src/plus/integrations/providers/github/github.utils.ts +1 -1
  995. package/src/plus/integrations/providers/github.ts +390 -6
  996. package/src/plus/integrations/providers/gitlab/gitlab.ts +170 -60
  997. package/src/plus/integrations/providers/gitlab/gitlab.utils.ts +9 -0
  998. package/src/plus/integrations/providers/gitlab/models.ts +19 -5
  999. package/src/plus/integrations/providers/gitlab.ts +369 -10
  1000. package/src/plus/integrations/providers/jira.ts +247 -42
  1001. package/src/plus/integrations/providers/linear.ts +154 -27
  1002. package/src/plus/integrations/providers/models.ts +583 -75
  1003. package/src/plus/integrations/providers/providersApi.ts +849 -86
  1004. package/src/plus/integrations/providers/trello.ts +205 -0
  1005. package/src/plus/integrations/providers/utils/providerPaging.ts +177 -0
  1006. package/src/plus/integrations/providers/utils.ts +68 -8
  1007. package/src/plus/integrations/reads/broaden.ts +452 -0
  1008. package/src/plus/integrations/reads/context.ts +99 -0
  1009. package/src/plus/integrations/reads/cursors.ts +224 -0
  1010. package/src/plus/integrations/reads/drains.ts +343 -0
  1011. package/src/plus/integrations/reads/filters.ts +124 -0
  1012. package/src/plus/integrations/reads/hierarchy.ts +473 -0
  1013. package/src/plus/integrations/reads/hierarchy.utils.ts +155 -0
  1014. package/src/plus/integrations/reads/issueTracker.ts +468 -0
  1015. package/src/plus/integrations/reads/issues.ts +409 -0
  1016. package/src/plus/integrations/reads/paging.ts +277 -0
  1017. package/src/plus/integrations/reads/pullRequests.ts +260 -0
  1018. package/src/plus/integrations/reads/resolveRepository.ts +272 -0
  1019. package/src/plus/integrations/reads/sweeps.ts +185 -0
  1020. package/src/plus/integrations/reads/warnings.ts +170 -0
  1021. package/src/plus/integrations/results.ts +275 -0
  1022. package/src/plus/integrations/utils/domain.utils.ts +26 -0
  1023. package/src/plus/integrations/utils/integration.utils.ts +93 -16
  1024. package/src/utils/brand.ts +0 -2
  1025. package/src/utils/cancellation.ts +56 -7
  1026. package/src/utils/coalescedRun.ts +45 -0
  1027. package/src/utils/color.ts +3 -3
  1028. package/src/utils/date.ts +72 -0
  1029. package/src/utils/debounce.ts +1 -1
  1030. package/src/utils/decorators/gate.ts +2 -2
  1031. package/src/utils/decorators/log.ts +5 -5
  1032. package/src/utils/decorators/memoize.ts +2 -2
  1033. package/src/utils/decorators/sequentialize.ts +2 -2
  1034. package/src/utils/decorators/serializable.ts +1 -1
  1035. package/src/utils/env/node/exec.ts +20 -5
  1036. package/src/utils/event.ts +19 -25
  1037. package/src/utils/function.ts +3 -3
  1038. package/src/utils/iterable.ts +2 -6
  1039. package/src/utils/logger.scoped.ts +1 -1
  1040. package/src/utils/logger.ts +1 -1
  1041. package/src/utils/paging.ts +46 -0
  1042. package/src/utils/promise.ts +33 -3
  1043. package/src/utils/promiseCache.ts +81 -51
  1044. package/src/utils/searchTree.ts +4 -2
  1045. package/src/utils/string.ts +1 -1
  1046. package/src/utils/trie.ts +1 -0
  1047. package/dist/plus/ai/providers/githubModelsProvider.d.ts +0 -19
  1048. package/dist/plus/ai/providers/githubModelsProvider.d.ts.map +0 -1
  1049. package/dist/plus/ai/providers/githubModelsProvider.js +0 -51
  1050. package/dist/plus/ai/providers/githubModelsProvider.js.map +0 -1
  1051. package/src/plus/ai/providers/githubModelsProvider.ts +0 -92
@@ -1,25 +1,34 @@
1
+ import type { CollectionMetadata, CollectionScope, CollectionScopeFailure } from '@gitkraken/provider-apis';
1
2
  import type { Account, UnidentifiedAuthor } from '../../../git/models/author.js';
2
3
  import type { DefaultBranch } from '../../../git/models/defaultBranch.js';
3
4
  import type { Issue, IssueShape } from '../../../git/models/issue.js';
4
5
  import type { IssueOrPullRequest, IssueOrPullRequestType } from '../../../git/models/issueOrPullRequest.js';
5
- import type { PullRequest, PullRequestMergeMethod, PullRequestState } from '../../../git/models/pullRequest.js';
6
+ import type {
7
+ PullRequest,
8
+ PullRequestMergeMethod,
9
+ PullRequestState,
10
+ PullRequestStateFilter,
11
+ } from '../../../git/models/pullRequest.js';
6
12
  import type { RepositoryMetadata } from '../../../git/models/repositoryMetadata.js';
13
+ import type { ResourceDescriptor } from '../../../git/models/resourceDescriptor.js';
7
14
  import { base64 } from '../../../utils/base64.js';
15
+ import { CancellationError } from '../../../utils/cancellation.js';
8
16
  import type { Emitter } from '../../../utils/event.js';
9
- import { flatSettled } from '../../../utils/promise.js';
10
17
  import type { IntegrationAuthenticationProviderDescriptor } from '../authentication/integrationAuthenticationProvider.js';
11
18
  import type { IntegrationAuthenticationService } from '../authentication/integrationAuthenticationService.js';
12
- import type { IntegrationServiceContext } from '../context.js';
13
19
  import type {
14
20
  AuthenticationSessionLike as AuthenticationSession,
15
21
  ProviderAuthenticationSession,
16
22
  TokenWithInfo,
17
23
  } from '../authentication/models.js';
18
24
  import { toTokenWithInfo } from '../authentication/models.js';
25
+ import { toCollectionScopeFailure } from '../collectionMetadata.js';
19
26
  import { GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId } from '../constants.js';
27
+ import type { IntegrationServiceContext } from '../context.js';
20
28
  import type { IntegrationConnectionChangeEvent } from '../integrationService.js';
29
+ import type { SearchMyPullRequestsOptions } from '../models/gitHostIntegration.js';
21
30
  import { GitHostIntegration } from '../models/gitHostIntegration.js';
22
- import type { IntegrationKey } from '../models/integration.js';
31
+ import type { AccountWideIssuesResult, IntegrationKey, SearchMyIssuesOptions } from '../models/integration.js';
23
32
  import type {
24
33
  AzureOrganizationDescriptor,
25
34
  AzureProjectDescriptor,
@@ -27,9 +36,49 @@ import type {
27
36
  AzureRemoteRepositoryDescriptor,
28
37
  AzureRepositoryDescriptor,
29
38
  } from './azure/models.js';
30
- import type { ProviderPullRequest, ProviderRepository } from './models.js';
31
- import { fromProviderIssue, fromProviderPullRequest, providersMetadata } from './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';
32
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
+ }
33
82
 
34
83
  export abstract class AzureDevOpsIntegrationBase<
35
84
  TIntegrationId extends GitCloudHostIntegrationId.AzureDevOps | GitSelfManagedHostIntegrationId.AzureDevOpsServer,
@@ -110,11 +159,19 @@ export abstract class AzureDevOpsIntegrationBase<
110
159
  }
111
160
 
112
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
+ */
113
169
  private async getProviderProjectsForResources(
114
170
  session: ProviderAuthenticationSession,
115
171
  resources: AzureOrganizationDescriptor[],
116
172
  force: boolean = false,
117
- ): Promise<AzureProjectDescriptor[] | undefined> {
173
+ failures?: CollectionScopeFailure[],
174
+ ): Promise<ProviderApiCollectionResult<AzureProjectDescriptor>> {
118
175
  this._projects ??= new Map<string, AzureProjectDescriptor[] | undefined>();
119
176
  const { accessToken } = session;
120
177
 
@@ -131,40 +188,115 @@ export abstract class AzureDevOpsIntegrationBase<
131
188
  }
132
189
  }
133
190
 
191
+ const allProjects: AzureProjectDescriptor[] = [];
192
+ let resultMetadata: CollectionMetadata | undefined;
193
+
134
194
  if (resourcesWithoutProjects.length > 0) {
135
195
  const api = await this.getProvidersApi();
136
196
  const { tokenWithInfo, options } = this.getApiOptions(session);
137
- const azureProjects = await flatSettled(
138
- resourcesWithoutProjects.map(
139
- async resource =>
140
- (await api.getAzureProjectsForResource(tokenWithInfo, resource.name, options)).values,
141
- ),
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
+ })),
142
217
  );
143
218
 
144
- for (const resource of resourcesWithoutProjects) {
145
- const projects = azureProjects?.filter(p => p.namespace === resource.name);
146
- if (projects != null) {
147
- this._projects.set(
148
- `${accessToken}:${resource.id}`,
149
- projects.map(p => ({
150
- id: p.id,
151
- name: p.name,
152
- resourceId: resource.id,
153
- resourceName: resource.name,
154
- key: p.id,
155
- })),
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,
156
229
  );
230
+ failures?.push(failure);
231
+ resultMetadata = mergeCollectionMetadata(resultMetadata, {
232
+ completeness: 'partial',
233
+ failures: [failure],
234
+ });
235
+ return;
157
236
  }
158
- }
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
+ });
159
280
  }
160
281
 
161
- return resources.reduce<AzureProjectDescriptor[]>((projects, resource) => {
282
+ const cachedProjects = resources.reduce<AzureProjectDescriptor[]>((projects, resource) => {
162
283
  const resourceProjects = this._projects!.get(`${accessToken}:${resource.id}`);
163
284
  if (resourceProjects != null) {
164
285
  projects.push(...resourceProjects);
165
286
  }
166
287
  return projects;
167
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 };
168
300
  }
169
301
 
170
302
  private async getRepoDescriptorsForProjects(
@@ -203,6 +335,124 @@ export abstract class AzureDevOpsIntegrationBase<
203
335
  return descriptors;
204
336
  }
205
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
+
206
456
  protected override async mergeProviderPullRequest(
207
457
  session: ProviderAuthenticationSession,
208
458
  pr: PullRequest,
@@ -264,10 +514,18 @@ export abstract class AzureDevOpsIntegrationBase<
264
514
  }
265
515
 
266
516
  protected override async getProviderDefaultBranch(
267
- _session: AuthenticationSession,
268
- _repo: AzureRepositoryDescriptor,
517
+ session: ProviderAuthenticationSession,
518
+ repo: AzureRepositoryDescriptor,
519
+ cancellation?: AbortSignal,
269
520
  ): Promise<DefaultBranch | undefined> {
270
- return Promise.resolve(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
+ );
271
529
  }
272
530
 
273
531
  protected override async getProviderLinkedIssueOrPullRequest(
@@ -301,9 +559,9 @@ export abstract class AzureDevOpsIntegrationBase<
301
559
  if (orgs == null || orgs.length === 0) return undefined;
302
560
 
303
561
  const projects = await this.getProviderProjectsForResources(session, orgs);
304
- if (projects == null || projects.length === 0) return undefined;
562
+ if (projects.values.length === 0) return undefined;
305
563
 
306
- const matchingProject = projects.find(p => p.resourceName === project.owner && p.name === project.name);
564
+ const matchingProject = projects.values.find(p => p.resourceName === project.owner && p.name === project.name);
307
565
  if (matchingProject == null) return undefined;
308
566
 
309
567
  return (await this.authenticationService.apis.azure)?.getIssue(
@@ -356,26 +614,49 @@ export abstract class AzureDevOpsIntegrationBase<
356
614
  public override async getRepoInfo(repo: {
357
615
  owner: string;
358
616
  name: string;
359
- project: string;
617
+ project?: string;
618
+ connectionId?: string;
360
619
  }): Promise<ProviderRepository | undefined> {
620
+ const identity = getAzureRepositoryIdentity(repo);
621
+ if (identity.projectName == null) return undefined;
622
+
361
623
  const api = await this.getProvidersApi();
362
- if (this._session == null) return undefined;
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;
363
627
 
364
- const { tokenWithInfo, options } = this.getApiOptions(this._session);
365
- return api.getRepo(tokenWithInfo, repo.owner, repo.name, repo.project, options);
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
+ );
366
636
  }
367
637
 
368
638
  protected override async getProviderRepositoryMetadata(
369
- _session: AuthenticationSession,
370
- _repo: AzureRepositoryDescriptor,
371
- _cancellation?: AbortSignal,
639
+ session: ProviderAuthenticationSession,
640
+ repo: AzureRepositoryDescriptor,
641
+ cancellation?: AbortSignal,
372
642
  ): Promise<RepositoryMetadata | undefined> {
373
- return Promise.resolve(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
+ );
374
651
  }
375
652
 
376
653
  protected override async searchProviderMyPullRequests(
377
654
  session: ProviderAuthenticationSession,
378
655
  repos?: AzureRepositoryDescriptor[],
656
+ _cancellation?: AbortSignal,
657
+ _silent?: boolean,
658
+ state?: PullRequestStateFilter,
659
+ _options?: SearchMyPullRequestsOptions,
379
660
  ): Promise<PullRequest[] | undefined> {
380
661
  const api = await this.getProvidersApi();
381
662
  if (repos != null) {
@@ -383,41 +664,50 @@ export abstract class AzureDevOpsIntegrationBase<
383
664
  return undefined;
384
665
  }
385
666
 
667
+ const states = toProviderPullRequestStates(state);
668
+
386
669
  const user = await this.getProviderCurrentAccount(session);
387
- if (user?.username == null) return undefined;
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;
388
673
 
389
674
  const orgs = await this.getProviderResourcesForUser(session);
390
675
  if (orgs == null || orgs.length === 0) return undefined;
391
676
 
392
677
  const projects = await this.getProviderProjectsForResources(session, orgs);
393
- if (projects == null || projects.length === 0) return undefined;
678
+ if (projects.values.length === 0) return undefined;
394
679
 
395
680
  const repoDescriptors = [
396
- ...((await this.getRepoDescriptorsForProjects(session, projects)) ?? new Map()).values(),
681
+ ...((await this.getRepoDescriptorsForProjects(session, projects.values)) ?? new Map()).values(),
397
682
  ]
398
683
  .filter(r => r != null)
399
684
  .flat();
400
685
 
401
686
  const { tokenWithInfo, options } = this.getApiOptions(session);
402
- const projectInputs = projects.map(p => ({ namespace: p.resourceName, project: p.name }));
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.
403
691
  const assignedPrs = (
404
692
  await api.getPullRequestsForAzureProjects(tokenWithInfo, projectInputs, {
405
693
  ...options,
406
- assigneeLogins: [user.username],
694
+ assigneeLogins: [user.id],
695
+ states: states,
407
696
  })
408
- )?.map(pr => this.fromAzureProviderPullRequest(pr, repoDescriptors, projects));
697
+ ).values.map(pr => this.fromAzureProviderPullRequest(pr, repoDescriptors, projects.values));
409
698
  const authoredPrs = (
410
699
  await api.getPullRequestsForAzureProjects(tokenWithInfo, projectInputs, {
411
700
  ...options,
412
- authorLogin: user.username,
701
+ authorLogin: user.id,
702
+ states: states,
413
703
  })
414
- )?.map(pr => this.fromAzureProviderPullRequest(pr, repoDescriptors, projects));
704
+ ).values.map(pr => this.fromAzureProviderPullRequest(pr, repoDescriptors, projects.values));
415
705
  const prsById = new Map<string, PullRequest>();
416
- for (const pr of authoredPrs ?? []) {
706
+ for (const pr of authoredPrs) {
417
707
  prsById.set(pr.id, pr);
418
708
  }
419
709
 
420
- for (const pr of assignedPrs ?? []) {
710
+ for (const pr of assignedPrs) {
421
711
  const existing = prsById.get(pr.id);
422
712
  if (existing == null) {
423
713
  prsById.set(pr.id, pr);
@@ -427,64 +717,418 @@ export abstract class AzureDevOpsIntegrationBase<
427
717
  return [...prsById.values()];
428
718
  }
429
719
 
430
- protected override async searchProviderMyIssues(
720
+ protected override async getProviderMyPullRequestsForUser(
431
721
  session: ProviderAuthenticationSession,
432
- _repos?: AzureRepositoryDescriptor[],
433
- ): Promise<IssueShape[] | undefined> {
722
+ options?: { state?: PullRequestStateFilter[]; cursor?: string; filters?: PullRequestFilter[] },
723
+ ): Promise<ProviderApiPagedResult<ProviderPullRequest> | undefined> {
434
724
  const api = await this.getProvidersApi();
435
-
436
725
  const user = await this.getProviderCurrentAccount(session);
437
- if (user?.username == null) return undefined;
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();
438
889
 
439
890
  const orgs = await this.getProviderResourcesForUser(session);
891
+ if (cancellation?.aborted) throw new CancellationError();
440
892
  if (orgs == null || orgs.length === 0) return undefined;
441
893
 
442
- const projects = await this.getProviderProjectsForResources(session, orgs);
443
- if (projects == null || projects.length === 0) return undefined;
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 [];
444
917
 
445
- const { tokenWithInfo, options } = this.getApiOptions(session);
446
- const assignedIssues = await flatSettled(
447
- projects.map(async p => {
448
- const issuesResponse = (
449
- await api.getIssuesForAzureProject(tokenWithInfo, p.resourceName, p.name, {
450
- ...options,
451
- assigneeLogins: [user.username!],
452
- })
453
- ).values;
454
- return issuesResponse.map(i => fromProviderIssue(i, this as any, { project: p }));
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;
455
963
  }),
456
964
  );
457
- const authoredIssues = await flatSettled(
458
- projects.map(async p => {
459
- const issuesResponse = (
460
- await api.getIssuesForAzureProject(tokenWithInfo, p.resourceName, p.name, {
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, {
461
1057
  ...options,
462
- authorLogin: user.username!,
463
- })
464
- ).values;
465
- return issuesResponse.map(i => fromProviderIssue(i, this as any, { project: p }));
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, { 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;
466
1096
  }),
467
1097
  );
468
- // TODO: Add mentioned issues
469
- const issuesById = new Map<string, IssueShape>();
470
1098
 
471
- for (const issue of authoredIssues ?? []) {
472
- issuesById.set(issue.id, issue);
473
- }
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
+ }
474
1109
 
475
- for (const issue of assignedIssues ?? []) {
476
- const existing = issuesById.get(issue.id);
477
- if (existing == null) {
478
- issuesById.set(issue.id, issue);
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
+ }
479
1115
  }
480
1116
  }
481
1117
 
482
- return [...issuesById.values()];
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 };
483
1124
  }
484
1125
 
485
1126
  protected override async providerOnConnect(): Promise<void> {
486
1127
  if (this._session == null) return;
487
1128
 
1129
+ const canHydrateStoredProjects = (metadata: CollectionMetadata | undefined): boolean =>
1130
+ metadata == null || metadata.completeness === 'complete';
1131
+
488
1132
  const storedAccount = this.ctx.storage.get(`azure:${this._session.accessToken}:account`);
489
1133
  const storedOrganizations = this.ctx.storage.get(`azure:${this._session.accessToken}:organizations`);
490
1134
  const storedProjects = this.ctx.storage.get(`azure:${this._session.accessToken}:projects`);
@@ -492,7 +1136,20 @@ export abstract class AzureDevOpsIntegrationBase<
492
1136
 
493
1137
  let organizations = storedOrganizations?.data?.map((o: AzureOrganizationDescriptor) => ({ ...o }));
494
1138
 
495
- let projects = storedProjects?.data?.map((p: AzureProjectDescriptor) => ({ ...p }));
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
+ }
496
1153
 
497
1154
  if (storedAccount == null) {
498
1155
  account = await this.getProviderCurrentAccount(this._session);
@@ -528,23 +1185,29 @@ export abstract class AzureDevOpsIntegrationBase<
528
1185
  this._organizations ??= new Map<string, AzureOrganizationDescriptor[] | undefined>();
529
1186
  this._organizations.set(this._session.accessToken, organizations);
530
1187
 
531
- if (storedProjects == null && organizations?.length) {
1188
+ if (projects == null && organizations?.length) {
532
1189
  projects = await this.getProviderProjectsForResources(this._session, organizations);
533
- await this.ctx.storage.store(`azure:${this._session.accessToken}:projects`, {
534
- v: 1,
535
- timestamp: Date.now(),
536
- data: projects,
537
- });
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
+ }
538
1199
  }
539
1200
 
540
1201
  this._projects ??= new Map<string, AzureProjectDescriptor[] | undefined>();
541
- for (const project of projects ?? []) {
542
- const projectKey = `${this._session.accessToken}:${project.resourceId}`;
543
- const projects = this._projects.get(projectKey);
544
- if (projects == null) {
545
- this._projects.set(projectKey, [project]);
546
- } else if (!projects.some(p => p.id === project.id)) {
547
- projects.push(project);
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
+ }
548
1211
  }
549
1212
  }
550
1213
  }
@@ -560,10 +1223,10 @@ export abstract class AzureDevOpsIntegrationBase<
560
1223
  repoDescriptors: AzureRemoteRepositoryDescriptor[],
561
1224
  projectDescriptors: AzureProjectDescriptor[],
562
1225
  ): PullRequest {
563
- const baseRepoDescriptor = repoDescriptors.find(r => r.name === azurePullRequest.repository.name);
1226
+ const baseRepoDescriptor = repoDescriptors.find(r => r.id === azurePullRequest.repository.id);
564
1227
  const headRepoDescriptor =
565
1228
  azurePullRequest.headRepository != null
566
- ? repoDescriptors.find(r => r.name === azurePullRequest.headRepository!.name)
1229
+ ? repoDescriptors.find(r => r.id === azurePullRequest.headRepository!.id)
567
1230
  : undefined;
568
1231
  let project: AzureProjectDescriptor | undefined;
569
1232
  if (baseRepoDescriptor != null) {
@@ -591,7 +1254,9 @@ export abstract class AzureDevOpsIntegrationBase<
591
1254
  }
592
1255
 
593
1256
  if (baseRepoDescriptor?.projectName != null) {
594
- project = projectDescriptors.find(p => p.name === baseRepoDescriptor.projectName);
1257
+ project = projectDescriptors.find(
1258
+ p => p.resourceName === baseRepoDescriptor.resourceName && p.name === baseRepoDescriptor.projectName,
1259
+ );
595
1260
  }
596
1261
  return fromProviderPullRequest(azurePullRequest, this, { project: project });
597
1262
  }