@gitkraken/core-gitlens 0.2.0 → 0.3.1

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 (448) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/dist/git/cache.d.ts +38 -8
  3. package/dist/git/cache.d.ts.map +1 -1
  4. package/dist/git/cache.js +120 -55
  5. package/dist/git/cache.js.map +1 -1
  6. package/dist/git/context.d.ts +19 -0
  7. package/dist/git/context.d.ts.map +1 -1
  8. package/dist/git/context.js.map +1 -1
  9. package/dist/git/features.d.ts +1 -1
  10. package/dist/git/features.d.ts.map +1 -1
  11. package/dist/git/features.js +1 -0
  12. package/dist/git/features.js.map +1 -1
  13. package/dist/git/models/commit.d.ts.map +1 -1
  14. package/dist/git/models/commit.js.map +1 -1
  15. package/dist/git/models/graph.d.ts +96 -0
  16. package/dist/git/models/graph.d.ts.map +1 -1
  17. package/dist/git/models/graph.js +24 -1
  18. package/dist/git/models/graph.js.map +1 -1
  19. package/dist/git/models/reference.d.ts +31 -0
  20. package/dist/git/models/reference.d.ts.map +1 -1
  21. package/dist/git/models/remote.d.ts.map +1 -1
  22. package/dist/git/models/remote.js.map +1 -1
  23. package/dist/git/models/remoteProvider.d.ts +1 -0
  24. package/dist/git/models/remoteProvider.d.ts.map +1 -1
  25. package/dist/git/models/remoteProvider.js.map +1 -1
  26. package/dist/git/models/repository.d.ts +30 -13
  27. package/dist/git/models/repository.d.ts.map +1 -1
  28. package/dist/git/models/repository.js +89 -87
  29. package/dist/git/models/repository.js.map +1 -1
  30. package/dist/git/models/search.d.ts +2 -2
  31. package/dist/git/models/search.d.ts.map +1 -1
  32. package/dist/git/models/statusFile.d.ts +9 -0
  33. package/dist/git/models/statusFile.d.ts.map +1 -1
  34. package/dist/git/models/statusFile.js +11 -0
  35. package/dist/git/models/statusFile.js.map +1 -1
  36. package/dist/git/models/worktree.d.ts +4 -1
  37. package/dist/git/models/worktree.d.ts.map +1 -1
  38. package/dist/git/models/worktree.js +2 -2
  39. package/dist/git/models/worktree.js.map +1 -1
  40. package/dist/git/parsers/diffParser.d.ts.map +1 -1
  41. package/dist/git/parsers/diffParser.js.map +1 -1
  42. package/dist/git/providers/branches.d.ts +15 -4
  43. package/dist/git/providers/branches.d.ts.map +1 -1
  44. package/dist/git/providers/commits.d.ts +4 -0
  45. package/dist/git/providers/commits.d.ts.map +1 -1
  46. package/dist/git/providers/config.d.ts +5 -4
  47. package/dist/git/providers/config.d.ts.map +1 -1
  48. package/dist/git/providers/operations.d.ts +61 -12
  49. package/dist/git/providers/operations.d.ts.map +1 -1
  50. package/dist/git/providers/pausedOperations.d.ts +3 -1
  51. package/dist/git/providers/pausedOperations.d.ts.map +1 -1
  52. package/dist/git/providers/refs.d.ts +23 -2
  53. package/dist/git/providers/refs.d.ts.map +1 -1
  54. package/dist/git/providers/staging.d.ts +16 -0
  55. package/dist/git/providers/staging.d.ts.map +1 -1
  56. package/dist/git/providers/status.d.ts +4 -1
  57. package/dist/git/providers/status.d.ts.map +1 -1
  58. package/dist/git/remotes/azure-devops.d.ts.map +1 -1
  59. package/dist/git/remotes/azure-devops.js.map +1 -1
  60. package/dist/git/remotes/custom.d.ts +2 -0
  61. package/dist/git/remotes/custom.d.ts.map +1 -1
  62. package/dist/git/remotes/custom.js +20 -0
  63. package/dist/git/remotes/custom.js.map +1 -1
  64. package/dist/git/{exec.types.d.ts → run.types.d.ts} +22 -3
  65. package/dist/git/run.types.d.ts.map +1 -0
  66. package/dist/git/run.types.js +2 -0
  67. package/dist/git/run.types.js.map +1 -0
  68. package/dist/git/service.d.ts.map +1 -1
  69. package/dist/git/service.js.map +1 -1
  70. package/dist/git/utils/autolink.utils.d.ts.map +1 -1
  71. package/dist/git/utils/autolink.utils.js.map +1 -1
  72. package/dist/git/utils/blame.utils.d.ts.map +1 -1
  73. package/dist/git/utils/blame.utils.js.map +1 -1
  74. package/dist/git/utils/conflictResolution.utils.d.ts +6 -0
  75. package/dist/git/utils/conflictResolution.utils.d.ts.map +1 -0
  76. package/dist/git/utils/conflictResolution.utils.js +25 -0
  77. package/dist/git/utils/conflictResolution.utils.js.map +1 -0
  78. package/dist/git/utils/contributor.utils.d.ts +3 -0
  79. package/dist/git/utils/contributor.utils.d.ts.map +1 -1
  80. package/dist/git/utils/contributor.utils.js +22 -0
  81. package/dist/git/utils/contributor.utils.js.map +1 -1
  82. package/dist/git/utils/fileStatus.utils.d.ts +2 -1
  83. package/dist/git/utils/fileStatus.utils.d.ts.map +1 -1
  84. package/dist/git/utils/fileStatus.utils.js +4 -0
  85. package/dist/git/utils/fileStatus.utils.js.map +1 -1
  86. package/dist/git/utils/reachability.utils.d.ts +37 -0
  87. package/dist/git/utils/reachability.utils.d.ts.map +1 -0
  88. package/dist/git/utils/reachability.utils.js +96 -0
  89. package/dist/git/utils/reachability.utils.js.map +1 -0
  90. package/dist/git/utils/search.utils.d.ts.map +1 -1
  91. package/dist/git/utils/search.utils.js +3 -0
  92. package/dist/git/utils/search.utils.js.map +1 -1
  93. package/dist/git/utils/sorting.d.ts +8 -0
  94. package/dist/git/utils/sorting.d.ts.map +1 -1
  95. package/dist/git/utils/sorting.js +15 -0
  96. package/dist/git/utils/sorting.js.map +1 -1
  97. package/dist/git/utils/status.utils.d.ts.map +1 -1
  98. package/dist/git/utils/status.utils.js.map +1 -1
  99. package/dist/git/watching/classifyChange.d.ts.map +1 -1
  100. package/dist/git/watching/classifyChange.js +8 -0
  101. package/dist/git/watching/classifyChange.js.map +1 -1
  102. package/dist/git/watching/gitIgnoreFilter.js +1 -1
  103. package/dist/git/watching/gitIgnoreFilter.js.map +1 -1
  104. package/dist/git/watching/initWatcher.d.ts.map +1 -1
  105. package/dist/git/watching/initWatcher.js.map +1 -1
  106. package/dist/git/watching/watchGroup.d.ts.map +1 -1
  107. package/dist/git/watching/watchGroup.js.map +1 -1
  108. package/dist/git/watching/watchService.d.ts +4 -2
  109. package/dist/git/watching/watchService.d.ts.map +1 -1
  110. package/dist/git/watching/watchService.js +31 -6
  111. package/dist/git/watching/watchService.js.map +1 -1
  112. package/dist/git/watching/watchSession.d.ts +14 -12
  113. package/dist/git/watching/watchSession.d.ts.map +1 -1
  114. package/dist/git/watching/watchSession.js +56 -55
  115. package/dist/git/watching/watchSession.js.map +1 -1
  116. package/dist/git-cli/exec/exec.types.d.ts +1 -1
  117. package/dist/git-cli/exec/exec.types.d.ts.map +1 -1
  118. package/dist/git-cli/exec/git.d.ts +3 -3
  119. package/dist/git-cli/exec/git.d.ts.map +1 -1
  120. package/dist/git-cli/exec/git.js.map +1 -1
  121. package/dist/git-cli/exec/gitQueue.d.ts +10 -2
  122. package/dist/git-cli/exec/gitQueue.d.ts.map +1 -1
  123. package/dist/git-cli/exec/gitQueue.js +39 -12
  124. package/dist/git-cli/exec/gitQueue.js.map +1 -1
  125. package/dist/git-cli/parsers/blameParser.d.ts.map +1 -1
  126. package/dist/git-cli/parsers/blameParser.js.map +1 -1
  127. package/dist/git-cli/parsers/logParser.js.map +1 -1
  128. package/dist/git-cli/parsers/refParser.d.ts +3 -30
  129. package/dist/git-cli/parsers/refParser.d.ts.map +1 -1
  130. package/dist/git-cli/parsers/refParser.js +30 -30
  131. package/dist/git-cli/parsers/refParser.js.map +1 -1
  132. package/dist/git-cli/providers/blame.d.ts.map +1 -1
  133. package/dist/git-cli/providers/blame.js.map +1 -1
  134. package/dist/git-cli/providers/branches.d.ts +15 -5
  135. package/dist/git-cli/providers/branches.d.ts.map +1 -1
  136. package/dist/git-cli/providers/branches.js +99 -68
  137. package/dist/git-cli/providers/branches.js.map +1 -1
  138. package/dist/git-cli/providers/commits.d.ts +1 -0
  139. package/dist/git-cli/providers/commits.d.ts.map +1 -1
  140. package/dist/git-cli/providers/commits.js +86 -30
  141. package/dist/git-cli/providers/commits.js.map +1 -1
  142. package/dist/git-cli/providers/config.d.ts +19 -6
  143. package/dist/git-cli/providers/config.d.ts.map +1 -1
  144. package/dist/git-cli/providers/config.js +86 -38
  145. package/dist/git-cli/providers/config.js.map +1 -1
  146. package/dist/git-cli/providers/diff.d.ts.map +1 -1
  147. package/dist/git-cli/providers/diff.js +5 -3
  148. package/dist/git-cli/providers/diff.js.map +1 -1
  149. package/dist/git-cli/providers/graph.d.ts.map +1 -1
  150. package/dist/git-cli/providers/graph.js +139 -16
  151. package/dist/git-cli/providers/graph.js.map +1 -1
  152. package/dist/git-cli/providers/operations.d.ts +17 -14
  153. package/dist/git-cli/providers/operations.d.ts.map +1 -1
  154. package/dist/git-cli/providers/operations.js +135 -63
  155. package/dist/git-cli/providers/operations.js.map +1 -1
  156. package/dist/git-cli/providers/patch.d.ts.map +1 -1
  157. package/dist/git-cli/providers/patch.js.map +1 -1
  158. package/dist/git-cli/providers/pausedOperations.d.ts +3 -1
  159. package/dist/git-cli/providers/pausedOperations.d.ts.map +1 -1
  160. package/dist/git-cli/providers/pausedOperations.js +7 -1
  161. package/dist/git-cli/providers/pausedOperations.js.map +1 -1
  162. package/dist/git-cli/providers/refs.d.ts +19 -2
  163. package/dist/git-cli/providers/refs.d.ts.map +1 -1
  164. package/dist/git-cli/providers/refs.js +286 -2
  165. package/dist/git-cli/providers/refs.js.map +1 -1
  166. package/dist/git-cli/providers/revision.js.map +1 -1
  167. package/dist/git-cli/providers/staging.d.ts +6 -0
  168. package/dist/git-cli/providers/staging.d.ts.map +1 -1
  169. package/dist/git-cli/providers/staging.js +32 -0
  170. package/dist/git-cli/providers/staging.js.map +1 -1
  171. package/dist/git-cli/providers/stash.d.ts.map +1 -1
  172. package/dist/git-cli/providers/stash.js +20 -2
  173. package/dist/git-cli/providers/stash.js.map +1 -1
  174. package/dist/git-cli/providers/status.d.ts +4 -1
  175. package/dist/git-cli/providers/status.d.ts.map +1 -1
  176. package/dist/git-cli/providers/status.js +8 -4
  177. package/dist/git-cli/providers/status.js.map +1 -1
  178. package/dist/git-cli/providers/tags.d.ts.map +1 -1
  179. package/dist/git-cli/providers/tags.js +10 -6
  180. package/dist/git-cli/providers/tags.js.map +1 -1
  181. package/dist/ipc/discovery.d.ts +49 -0
  182. package/dist/ipc/discovery.d.ts.map +1 -0
  183. package/dist/ipc/discovery.js +147 -0
  184. package/dist/ipc/discovery.js.map +1 -0
  185. package/dist/ipc/ipcServer.d.ts +20 -0
  186. package/dist/ipc/ipcServer.d.ts.map +1 -0
  187. package/dist/ipc/ipcServer.js +162 -0
  188. package/dist/ipc/ipcServer.js.map +1 -0
  189. package/dist/plus/agents/providers/claudeCodeProvider.d.ts +167 -0
  190. package/dist/plus/agents/providers/claudeCodeProvider.d.ts.map +1 -0
  191. package/dist/plus/agents/providers/claudeCodeProvider.js +1786 -0
  192. package/dist/plus/agents/providers/claudeCodeProvider.js.map +1 -0
  193. package/dist/plus/agents/providers/claudeCodeTranscript.d.ts +36 -0
  194. package/dist/plus/agents/providers/claudeCodeTranscript.d.ts.map +1 -0
  195. package/dist/plus/agents/providers/claudeCodeTranscript.js +171 -0
  196. package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -0
  197. package/dist/plus/agents/sanitizePrompt.d.ts +15 -0
  198. package/dist/plus/agents/sanitizePrompt.d.ts.map +1 -0
  199. package/dist/plus/agents/sanitizePrompt.js +103 -0
  200. package/dist/plus/agents/sanitizePrompt.js.map +1 -0
  201. package/dist/plus/agents/stateMachine.d.ts +32 -0
  202. package/dist/plus/agents/stateMachine.d.ts.map +1 -0
  203. package/dist/plus/agents/stateMachine.js +180 -0
  204. package/dist/plus/agents/stateMachine.js.map +1 -0
  205. package/dist/plus/agents/types.d.ts +254 -0
  206. package/dist/plus/agents/types.d.ts.map +1 -0
  207. package/dist/plus/agents/types.js +49 -0
  208. package/dist/plus/agents/types.js.map +1 -0
  209. package/dist/plus/ai/errors.d.ts +4 -1
  210. package/dist/plus/ai/errors.d.ts.map +1 -1
  211. package/dist/plus/ai/errors.js +38 -0
  212. package/dist/plus/ai/errors.js.map +1 -1
  213. package/dist/plus/ai/models/model.d.ts +1 -1
  214. package/dist/plus/ai/models/model.d.ts.map +1 -1
  215. package/dist/plus/ai/models/model.js.map +1 -1
  216. package/dist/plus/ai/models/promptTemplates.d.ts +11 -2
  217. package/dist/plus/ai/models/promptTemplates.d.ts.map +1 -1
  218. package/dist/plus/ai/models/provider.d.ts +3 -0
  219. package/dist/plus/ai/models/provider.d.ts.map +1 -1
  220. package/dist/plus/ai/prompts.d.ts +1 -0
  221. package/dist/plus/ai/prompts.d.ts.map +1 -1
  222. package/dist/plus/ai/prompts.js +48 -8
  223. package/dist/plus/ai/prompts.js.map +1 -1
  224. package/dist/plus/ai/providers/gitkrakenProvider.d.ts +1 -1
  225. package/dist/plus/ai/providers/gitkrakenProvider.d.ts.map +1 -1
  226. package/dist/plus/ai/providers/gitkrakenProvider.js +4 -1
  227. package/dist/plus/ai/providers/gitkrakenProvider.js.map +1 -1
  228. package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts +4 -3
  229. package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts.map +1 -1
  230. package/dist/plus/ai/providers/openAICompatibleProviderBase.js +9 -6
  231. package/dist/plus/ai/providers/openAICompatibleProviderBase.js.map +1 -1
  232. package/dist/plus/ai/utils/ai.utils.d.ts.map +1 -1
  233. package/dist/plus/ai/utils/ai.utils.js +2 -0
  234. package/dist/plus/ai/utils/ai.utils.js.map +1 -1
  235. package/dist/plus/ai/utils/results.utils.d.ts.map +1 -1
  236. package/dist/plus/ai/utils/results.utils.js.map +1 -1
  237. package/dist/plus/git-github/api/github.d.ts +12 -1
  238. package/dist/plus/git-github/api/github.d.ts.map +1 -1
  239. package/dist/plus/git-github/api/github.js +245 -51
  240. package/dist/plus/git-github/api/github.js.map +1 -1
  241. package/dist/plus/git-github/api/types.d.ts +8 -0
  242. package/dist/plus/git-github/api/types.d.ts.map +1 -1
  243. package/dist/plus/git-github/models.d.ts +1 -1
  244. package/dist/plus/git-github/models.d.ts.map +1 -1
  245. package/dist/plus/git-github/models.js.map +1 -1
  246. package/dist/plus/git-github/providers/github/blame.d.ts.map +1 -1
  247. package/dist/plus/git-github/providers/github/blame.js.map +1 -1
  248. package/dist/plus/git-github/providers/github/branches.d.ts +5 -1
  249. package/dist/plus/git-github/providers/github/branches.d.ts.map +1 -1
  250. package/dist/plus/git-github/providers/github/branches.js +47 -24
  251. package/dist/plus/git-github/providers/github/branches.js.map +1 -1
  252. package/dist/plus/git-github/providers/github/commits.d.ts.map +1 -1
  253. package/dist/plus/git-github/providers/github/commits.js +144 -92
  254. package/dist/plus/git-github/providers/github/commits.js.map +1 -1
  255. package/dist/plus/git-github/providers/github/diff.d.ts +1 -1
  256. package/dist/plus/git-github/providers/github/diff.d.ts.map +1 -1
  257. package/dist/plus/git-github/providers/github/diff.js +23 -9
  258. package/dist/plus/git-github/providers/github/diff.js.map +1 -1
  259. package/dist/plus/git-github/providers/github/refs.d.ts +9 -1
  260. package/dist/plus/git-github/providers/github/refs.d.ts.map +1 -1
  261. package/dist/plus/git-github/providers/github/refs.js +39 -14
  262. package/dist/plus/git-github/providers/github/refs.js.map +1 -1
  263. package/dist/plus/git-github/providers/github/revision.d.ts.map +1 -1
  264. package/dist/plus/git-github/providers/github/revision.js +1 -2
  265. package/dist/plus/git-github/providers/github/revision.js.map +1 -1
  266. package/dist/plus/git-github/providers/github/status.d.ts +4 -1
  267. package/dist/plus/git-github/providers/github/status.d.ts.map +1 -1
  268. package/dist/plus/git-github/providers/github/status.js +1 -1
  269. package/dist/plus/git-github/providers/github/status.js.map +1 -1
  270. package/dist/plus/git-github/providers/github/tags.d.ts.map +1 -1
  271. package/dist/plus/git-github/providers/github/tags.js +35 -36
  272. package/dist/plus/git-github/providers/github/tags.js.map +1 -1
  273. package/dist/plus/git-github/providers/githubGitProvider.d.ts.map +1 -1
  274. package/dist/plus/git-github/providers/githubGitProvider.js.map +1 -1
  275. package/dist/utils/color.d.ts.map +1 -1
  276. package/dist/utils/color.js.map +1 -1
  277. package/dist/utils/date.d.ts.map +1 -1
  278. package/dist/utils/date.js +6 -0
  279. package/dist/utils/date.js.map +1 -1
  280. package/dist/utils/debounce.js +1 -1
  281. package/dist/utils/decorators/serializable.d.ts.map +1 -1
  282. package/dist/utils/decorators/serializable.js.map +1 -1
  283. package/dist/utils/dedupedAsyncCache.d.ts +37 -0
  284. package/dist/utils/dedupedAsyncCache.d.ts.map +1 -0
  285. package/dist/utils/dedupedAsyncCache.js +68 -0
  286. package/dist/utils/dedupedAsyncCache.js.map +1 -0
  287. package/dist/utils/diff.d.ts +2 -0
  288. package/dist/utils/diff.d.ts.map +1 -0
  289. package/dist/utils/diff.js +53 -0
  290. package/dist/utils/diff.js.map +1 -0
  291. package/dist/utils/disposable.d.ts.map +1 -1
  292. package/dist/utils/disposable.js.map +1 -1
  293. package/dist/utils/env/node/exec.d.ts.map +1 -1
  294. package/dist/utils/env/node/exec.js.map +1 -1
  295. package/dist/utils/error.d.ts.map +1 -1
  296. package/dist/utils/error.js.map +1 -1
  297. package/dist/utils/iterable.d.ts +7 -1
  298. package/dist/utils/iterable.d.ts.map +1 -1
  299. package/dist/utils/iterable.js +12 -4
  300. package/dist/utils/iterable.js.map +1 -1
  301. package/dist/utils/logger.d.ts.map +1 -1
  302. package/dist/utils/logger.js.map +1 -1
  303. package/dist/utils/lruMap.d.ts +9 -0
  304. package/dist/utils/lruMap.d.ts.map +1 -1
  305. package/dist/utils/lruMap.js +26 -4
  306. package/dist/utils/lruMap.js.map +1 -1
  307. package/dist/utils/markdown.d.ts.map +1 -1
  308. package/dist/utils/markdown.js.map +1 -1
  309. package/dist/utils/mru.d.ts.map +1 -1
  310. package/dist/utils/mru.js.map +1 -1
  311. package/dist/utils/object.d.ts +22 -1
  312. package/dist/utils/object.d.ts.map +1 -1
  313. package/dist/utils/object.js +56 -3
  314. package/dist/utils/object.js.map +1 -1
  315. package/dist/utils/paging.js +14 -15
  316. package/dist/utils/paging.js.map +1 -1
  317. package/dist/utils/path.d.ts.map +1 -1
  318. package/dist/utils/path.js.map +1 -1
  319. package/dist/utils/promise.d.ts +1 -0
  320. package/dist/utils/promise.d.ts.map +1 -1
  321. package/dist/utils/promise.js +17 -0
  322. package/dist/utils/promise.js.map +1 -1
  323. package/dist/utils/promiseCache.d.ts +10 -0
  324. package/dist/utils/promiseCache.d.ts.map +1 -1
  325. package/dist/utils/promiseCache.js +34 -4
  326. package/dist/utils/promiseCache.js.map +1 -1
  327. package/dist/utils/string.d.ts.map +1 -1
  328. package/dist/utils/string.js +1 -1
  329. package/dist/utils/string.js.map +1 -1
  330. package/dist/utils/uri.d.ts.map +1 -1
  331. package/dist/utils/uri.js.map +1 -1
  332. package/dist/utils/version.d.ts.map +1 -1
  333. package/dist/utils/version.js.map +1 -1
  334. package/package.json +13 -1
  335. package/src/git/cache.ts +192 -90
  336. package/src/git/context.ts +21 -0
  337. package/src/git/features.ts +2 -0
  338. package/src/git/models/commit.ts +1 -0
  339. package/src/git/models/graph.ts +97 -0
  340. package/src/git/models/reference.ts +33 -0
  341. package/src/git/models/remote.ts +1 -0
  342. package/src/git/models/remoteProvider.ts +1 -0
  343. package/src/git/models/repository.ts +105 -96
  344. package/src/git/models/search.ts +2 -2
  345. package/src/git/models/statusFile.ts +12 -0
  346. package/src/git/models/worktree.ts +10 -2
  347. package/src/git/parsers/diffParser.ts +2 -0
  348. package/src/git/providers/branches.ts +22 -4
  349. package/src/git/providers/commits.ts +4 -0
  350. package/src/git/providers/config.ts +3 -5
  351. package/src/git/providers/operations.ts +65 -1
  352. package/src/git/providers/pausedOperations.ts +1 -0
  353. package/src/git/providers/refs.ts +32 -3
  354. package/src/git/providers/staging.ts +12 -0
  355. package/src/git/providers/status.ts +6 -1
  356. package/src/git/remotes/azure-devops.ts +2 -0
  357. package/src/git/remotes/custom.ts +23 -0
  358. package/src/git/{exec.types.ts → run.types.ts} +22 -2
  359. package/src/git/service.ts +1 -0
  360. package/src/git/utils/autolink.utils.ts +1 -0
  361. package/src/git/utils/blame.utils.ts +2 -0
  362. package/src/git/utils/conflictResolution.utils.ts +31 -0
  363. package/src/git/utils/contributor.utils.ts +24 -0
  364. package/src/git/utils/fileStatus.utils.ts +7 -1
  365. package/src/git/utils/reachability.utils.ts +109 -0
  366. package/src/git/utils/search.utils.ts +2 -0
  367. package/src/git/utils/sorting.ts +17 -0
  368. package/src/git/utils/status.utils.ts +1 -0
  369. package/src/git/watching/classifyChange.ts +9 -0
  370. package/src/git/watching/gitIgnoreFilter.ts +2 -2
  371. package/src/git/watching/initWatcher.ts +2 -0
  372. package/src/git/watching/watchGroup.ts +3 -0
  373. package/src/git/watching/watchService.ts +45 -7
  374. package/src/git/watching/watchSession.ts +71 -55
  375. package/src/git-cli/exec/exec.types.ts +2 -2
  376. package/src/git-cli/exec/git.ts +6 -5
  377. package/src/git-cli/exec/gitQueue.ts +41 -12
  378. package/src/git-cli/parsers/blameParser.ts +1 -0
  379. package/src/git-cli/parsers/logParser.ts +1 -0
  380. package/src/git-cli/parsers/refParser.ts +33 -34
  381. package/src/git-cli/providers/blame.ts +1 -0
  382. package/src/git-cli/providers/branches.ts +165 -93
  383. package/src/git-cli/providers/commits.ts +107 -37
  384. package/src/git-cli/providers/config.ts +101 -48
  385. package/src/git-cli/providers/diff.ts +10 -3
  386. package/src/git-cli/providers/graph.ts +156 -16
  387. package/src/git-cli/providers/operations.ts +208 -83
  388. package/src/git-cli/providers/patch.ts +1 -0
  389. package/src/git-cli/providers/pausedOperations.ts +8 -0
  390. package/src/git-cli/providers/refs.ts +247 -3
  391. package/src/git-cli/providers/revision.ts +2 -2
  392. package/src/git-cli/providers/staging.ts +33 -0
  393. package/src/git-cli/providers/stash.ts +20 -2
  394. package/src/git-cli/providers/status.ts +24 -5
  395. package/src/git-cli/providers/tags.ts +15 -16
  396. package/src/ipc/discovery.ts +186 -0
  397. package/src/ipc/ipcServer.ts +171 -0
  398. package/src/plus/agents/providers/claudeCodeProvider.ts +2122 -0
  399. package/src/plus/agents/providers/claudeCodeTranscript.ts +214 -0
  400. package/src/plus/agents/sanitizePrompt.ts +109 -0
  401. package/src/plus/agents/stateMachine.ts +197 -0
  402. package/src/plus/agents/types.ts +325 -0
  403. package/src/plus/ai/errors.ts +40 -0
  404. package/src/plus/ai/models/model.ts +1 -0
  405. package/src/plus/ai/models/promptTemplates.ts +13 -0
  406. package/src/plus/ai/models/provider.ts +7 -1
  407. package/src/plus/ai/prompts.ts +49 -8
  408. package/src/plus/ai/providers/gitkrakenProvider.ts +4 -0
  409. package/src/plus/ai/providers/openAICompatibleProviderBase.ts +21 -4
  410. package/src/plus/ai/utils/ai.utils.ts +2 -0
  411. package/src/plus/ai/utils/results.utils.ts +2 -0
  412. package/src/plus/git-github/api/github.ts +315 -57
  413. package/src/plus/git-github/api/types.ts +15 -0
  414. package/src/plus/git-github/models.ts +1 -1
  415. package/src/plus/git-github/providers/github/blame.ts +2 -0
  416. package/src/plus/git-github/providers/github/branches.ts +61 -31
  417. package/src/plus/git-github/providers/github/commits.ts +231 -160
  418. package/src/plus/git-github/providers/github/diff.ts +27 -19
  419. package/src/plus/git-github/providers/github/refs.ts +58 -23
  420. package/src/plus/git-github/providers/github/revision.ts +1 -2
  421. package/src/plus/git-github/providers/github/status.ts +6 -1
  422. package/src/plus/git-github/providers/github/tags.ts +61 -62
  423. package/src/plus/git-github/providers/githubGitProvider.ts +1 -0
  424. package/src/utils/color.ts +2 -0
  425. package/src/utils/date.ts +5 -0
  426. package/src/utils/debounce.ts +1 -1
  427. package/src/utils/decorators/serializable.ts +1 -0
  428. package/src/utils/dedupedAsyncCache.ts +74 -0
  429. package/src/utils/diff.ts +61 -0
  430. package/src/utils/disposable.ts +2 -0
  431. package/src/utils/env/node/exec.ts +2 -0
  432. package/src/utils/error.ts +1 -0
  433. package/src/utils/iterable.ts +17 -3
  434. package/src/utils/logger.ts +1 -0
  435. package/src/utils/lruMap.ts +29 -4
  436. package/src/utils/markdown.ts +1 -0
  437. package/src/utils/mru.ts +2 -0
  438. package/src/utils/object.ts +55 -4
  439. package/src/utils/paging.ts +14 -14
  440. package/src/utils/path.ts +1 -0
  441. package/src/utils/promise.ts +22 -0
  442. package/src/utils/promiseCache.ts +48 -16
  443. package/src/utils/string.ts +3 -1
  444. package/src/utils/uri.ts +1 -0
  445. package/src/utils/version.ts +1 -0
  446. package/dist/git/exec.types.d.ts.map +0 -1
  447. package/dist/git/exec.types.js +0 -2
  448. package/dist/git/exec.types.js.map +0 -1
package/src/git/cache.ts CHANGED
@@ -8,19 +8,15 @@ import type { PromiseOrValue } from '../utils/promise.js';
8
8
  import type { CacheController } from '../utils/promiseCache.js';
9
9
  import { PromiseCache, PromiseMap, RepoPromiseCacheMap } from '../utils/promiseCache.js';
10
10
  import type { Uri } from '../utils/uri.js';
11
- import { getBranchId } from './utils/branch.utils.js';
12
- import { createReference } from './utils/reference.utils.js';
13
- import { getCommonRepositoryPath, getRepositoryOrWorktreePath } from './utils/repository.utils.js';
14
- import type { GitResult } from './exec.types.js';
15
11
  import type { ProgressiveGitBlame } from './models/blame.js';
16
12
  import type { BranchMetadata, GitBranch } from './models/branch.js';
17
- import type { GitStashCommit } from './models/commit.js';
13
+ import type { GitCommit, GitStashCommit } from './models/commit.js';
18
14
  import type { GitContributor, GitContributorsStats } from './models/contributor.js';
19
15
  import type { ParsedGitDiffHunks } from './models/diff.js';
20
16
  import type { GitLog } from './models/log.js';
21
17
  import type { ConflictDetectionResult } from './models/mergeConflicts.js';
22
18
  import type { GitPausedOperationStatus } from './models/pausedOperationStatus.js';
23
- import type { GitBranchReference } from './models/reference.js';
19
+ import type { GitBranchReference, GitRefTip, RefRecord } from './models/reference.js';
24
20
  import type { GitRemote } from './models/remote.js';
25
21
  import type { RemoteProvider } from './models/remoteProvider.js';
26
22
  import type { GitDir, RepositoryChange } from './models/repository.js';
@@ -32,6 +28,10 @@ import type { BranchContributionsOverview, GitBranchMergedStatus } from './provi
32
28
  import type { GitCommitReachability, LeftRightCommitCountResult } from './providers/commits.js';
33
29
  import type { GitContributorsResult } from './providers/contributors.js';
34
30
  import type { ResolvedRevision } from './providers/revision.js';
31
+ import type { GitResult } from './run.types.js';
32
+ import { getBranchId } from './utils/branch.utils.js';
33
+ import { createReference } from './utils/reference.utils.js';
34
+ import { getCommonRepositoryPath, getRepositoryOrWorktreePath } from './utils/repository.utils.js';
35
35
  import type { GitIgnoreFilter } from './watching/gitIgnoreFilter.js';
36
36
 
37
37
  type RepoPath = string;
@@ -67,13 +67,23 @@ export type ConflictDetectionCacheKey = `apply:${string}:${string}:${string}` |
67
67
  * gkConfig keys that participate in the `branchOverviews` cache's mergeTarget/mergeBase lineage.
68
68
  * Capture group 1 is the ref name (which may itself contain `.`/`/`).
69
69
  */
70
- const branchOverviewGkConfigKeyPattern = /^branch\.(.+)\.(?:gk-merge-(?:base|target(?:-user)?)|gk-target-base)$/;
70
+ const branchOverviewGkConfigKeysRegex = /^branch\.(.+)\.(?:gk-merge-(?:base|target(?:-user)?)|gk-target-base)$/;
71
+
72
+ /**
73
+ * Downstream caches that `deleteGkConfig` may invalidate when a `branch.<ref>.gk-...` key changes.
74
+ * Callers performing a "self-write" (where the value being written matches what they just resolved,
75
+ * so the about-to-be-evicted entry is exactly the entry they want to preserve) can opt out by
76
+ * naming the targets to skip via `skipInvalidation`.
77
+ */
78
+ export type GkConfigInvalidationTarget = 'branchOverviews' | 'baseBranchName';
71
79
 
72
80
  /** Per-worktree caches — cleared by repoPath directly */
73
81
  interface Caches {
74
82
  bestRemotes: PromiseMap<RepoPath, GitRemote<RemoteProvider>[]> | undefined;
75
83
  blame: RepoPromiseCacheMap<string, ProgressiveGitBlame | undefined> | undefined;
76
84
  branch: PromiseMap<RepoPath, GitBranch | undefined> | undefined;
85
+ commit: RepoPromiseCacheMap<string, GitCommit | undefined> | undefined;
86
+ commitCount: RepoPromiseCacheMap<string, number | undefined> | undefined;
77
87
  conflictDetection: RepoPromiseCacheMap<ConflictDetectionCacheKey, ConflictDetectionResult> | undefined;
78
88
  currentBranchReference: PromiseCache<RepoPath, GitBranchReference | undefined> | undefined;
79
89
  currentUser: Map<RepoPath, GitUser | null> | undefined;
@@ -83,8 +93,8 @@ interface Caches {
83
93
  gitDir: Map<RepoPath, GitDir> | undefined;
84
94
  gitIgnore: Map<RepoPath, GitIgnoreFilter> | undefined;
85
95
  ignoreRevsFile: PromiseCache<string, boolean> | undefined;
86
- lastFetched: PromiseCache<RepoPath, number | undefined> | undefined;
87
96
  leftRightCommitCount: RepoPromiseCacheMap<string, LeftRightCommitCountResult | undefined> | undefined;
97
+ mergeBase: RepoPromiseCacheMap<string, string | undefined> | undefined;
88
98
  pausedOperationStatus: PromiseMap<RepoPath, GitPausedOperationStatus | undefined> | undefined;
89
99
  reachability: RepoPromiseCacheMap<string, GitCommitReachability | undefined> | undefined;
90
100
  resolvedRevisions: RepoPromiseCacheMap<string, ResolvedRevision> | undefined;
@@ -105,10 +115,13 @@ interface SharedCaches {
105
115
  contributorsStats: RepoPromiseCacheMap<string, GitContributorsStats | undefined> | undefined;
106
116
  defaultBranchName: RepoPromiseCacheMap<string, string | undefined> | undefined;
107
117
  gitResults: RepoPromiseCacheMap<string, GitResult> | undefined;
108
- gkConfigKeys: RepoPromiseCacheMap<string, string | undefined> | undefined;
109
- gkConfigPatterns: RepoPromiseCacheMap<string, Map<string, string>> | undefined;
118
+ gkConfigMap: PromiseMap<RepoPath, Map<string, string>> | undefined;
110
119
  initialCommitSha: PromiseMap<RepoPath, string | undefined> | undefined;
120
+ /** Keyed by commonPath — `FETCH_HEAD` lives in the common git dir, shared across worktrees. */
121
+ lastFetched: PromiseCache<RepoPath, number | undefined> | undefined;
111
122
  logShas: RepoPromiseCacheMap<string, string[]> | undefined;
123
+ refs: PromiseMap<RepoPath, RefRecord[]> | undefined;
124
+ refTips: PromiseMap<RepoPath, GitRefTip[]> | undefined;
112
125
  remotes: PromiseMap<RepoPath, GitRemote[]> | undefined;
113
126
  sharedBranches: PromiseMap<RepoPath, PagedResult<GitBranch>> | undefined;
114
127
  stashes: RepoPromiseCacheMap<string, GitStash> | undefined;
@@ -133,10 +146,12 @@ const sharedCacheKeys: ReadonlySet<keyof AllCaches> = new Set(
133
146
  'contributorsStats',
134
147
  'defaultBranchName',
135
148
  'gitResults',
136
- 'gkConfigKeys',
137
- 'gkConfigPatterns',
149
+ 'gkConfigMap',
138
150
  'initialCommitSha',
151
+ 'lastFetched',
139
152
  'logShas',
153
+ 'refs',
154
+ 'refTips',
140
155
  'remotes',
141
156
  'sharedBranches',
142
157
  'stashes',
@@ -155,9 +170,12 @@ function createEmptyCaches(): AllCaches {
155
170
  branchMetadataMap: undefined,
156
171
  branchOverviews: undefined,
157
172
  branches: undefined,
173
+ commit: undefined,
174
+ commitCount: undefined,
158
175
  fileExistence: undefined,
159
176
  ignoreRevsFile: undefined,
160
177
  leftRightCommitCount: undefined,
178
+ mergeBase: undefined,
161
179
  configKeys: undefined,
162
180
  configPatterns: undefined,
163
181
  conflictDetection: undefined,
@@ -172,14 +190,15 @@ function createEmptyCaches(): AllCaches {
172
190
  gitDir: undefined,
173
191
  gitIgnore: undefined,
174
192
  gitResults: undefined,
175
- gkConfigKeys: undefined,
176
- gkConfigPatterns: undefined,
193
+ gkConfigMap: undefined,
177
194
  initialCommitSha: undefined,
178
195
  lastFetched: undefined,
179
196
  logShas: undefined,
180
197
  pausedOperationStatus: undefined,
181
198
  resolvedRevisions: undefined,
182
199
  reachability: undefined,
200
+ refs: undefined,
201
+ refTips: undefined,
183
202
  remotes: undefined,
184
203
  sharedBranches: undefined,
185
204
  stashes: undefined,
@@ -279,12 +298,8 @@ export class Cache implements Disposable {
279
298
  }));
280
299
  }
281
300
 
282
- private get gkConfigKeys(): RepoPromiseCacheMap<string, string | undefined> {
283
- return (this._caches.gkConfigKeys ??= new RepoPromiseCacheMap<string, string | undefined>());
284
- }
285
-
286
- private get gkConfigPatterns(): RepoPromiseCacheMap<string, Map<string, string>> {
287
- return (this._caches.gkConfigPatterns ??= new RepoPromiseCacheMap<string, Map<string, string>>());
301
+ private get gkConfigMap(): PromiseMap<RepoPath, Map<string, string>> {
302
+ return (this._caches.gkConfigMap ??= new PromiseMap<RepoPath, Map<string, string>>());
288
303
  }
289
304
 
290
305
  get currentBranchReference(): PromiseCache<RepoPath, GitBranchReference | undefined> {
@@ -364,17 +379,25 @@ export class Cache implements Disposable {
364
379
  }));
365
380
  }
366
381
 
367
- getLeftRightCommitCount(
368
- repoPath: string,
369
- key: string,
370
- factory: () => PromiseOrValue<LeftRightCommitCountResult | undefined>,
371
- ): Promise<LeftRightCommitCountResult | undefined> {
372
- const cached = this.leftRightCommitCount.get(repoPath, key);
373
- if (cached != null) return cached;
382
+ get commit(): RepoPromiseCacheMap<string, GitCommit | undefined> {
383
+ return (this._caches.commit ??= new RepoPromiseCacheMap<string, GitCommit | undefined>({
384
+ accessTTL: 1000 * 60 * 60, // 60 minutes
385
+ capacity: 100, // Limit to 100 commits per repo
386
+ }));
387
+ }
374
388
 
375
- const factoryPromise = Promise.resolve(factory());
376
- this.leftRightCommitCount.set(repoPath, key, factoryPromise);
377
- return factoryPromise;
389
+ get commitCount(): RepoPromiseCacheMap<string, number | undefined> {
390
+ return (this._caches.commitCount ??= new RepoPromiseCacheMap<string, number | undefined>({
391
+ accessTTL: 1000 * 60 * 60, // 60 minutes
392
+ capacity: 50,
393
+ }));
394
+ }
395
+
396
+ get mergeBase(): RepoPromiseCacheMap<string, string | undefined> {
397
+ return (this._caches.mergeBase ??= new RepoPromiseCacheMap<string, string | undefined>({
398
+ accessTTL: 1000 * 60 * 60, // 60 minutes
399
+ capacity: 50,
400
+ }));
378
401
  }
379
402
 
380
403
  get logShas(): RepoPromiseCacheMap<string, string[]> {
@@ -398,6 +421,14 @@ export class Cache implements Disposable {
398
421
  }));
399
422
  }
400
423
 
424
+ get refs(): PromiseMap<RepoPath, RefRecord[]> {
425
+ return (this._caches.refs ??= new PromiseMap<RepoPath, RefRecord[]>());
426
+ }
427
+
428
+ get refTips(): PromiseMap<RepoPath, GitRefTip[]> {
429
+ return (this._caches.refTips ??= new PromiseMap<RepoPath, GitRefTip[]>());
430
+ }
431
+
401
432
  get reachability(): RepoPromiseCacheMap<string, GitCommitReachability | undefined> {
402
433
  return (this._caches.reachability ??= new RepoPromiseCacheMap<string, GitCommitReachability | undefined>({
403
434
  accessTTL: 1000 * 60 * 60, // 60 minutes
@@ -479,9 +510,15 @@ export class Cache implements Disposable {
479
510
  keysToClear.add('branch');
480
511
  keysToClear.add('branchMergedStatus');
481
512
  keysToClear.add('branchOverviews');
513
+ // `commit`/`commitCount` are keyed by symbolic ref or SHA — symbolic-ref entries
514
+ // can drift when branches move; cascade-clear conservatively.
515
+ keysToClear.add('commit');
516
+ keysToClear.add('commitCount');
482
517
  keysToClear.add('conflictDetection');
483
518
  keysToClear.add('currentBranchReference');
484
519
  keysToClear.add('leftRightCommitCount');
520
+ // `mergeBase` keyed by ref-pairs — symbolic refs can move; cascade-clear.
521
+ keysToClear.add('mergeBase');
485
522
  keysToClear.add('reachability');
486
523
  keysToClear.add('resolvedRevisions');
487
524
  }
@@ -495,6 +532,8 @@ export class Cache implements Disposable {
495
532
  keysToClear.add('defaultBranchName');
496
533
  keysToClear.add('initialCommitSha');
497
534
  keysToClear.add('logShas');
535
+ keysToClear.add('refs');
536
+ keysToClear.add('refTips');
498
537
  }
499
538
 
500
539
  if (types.includes('config')) {
@@ -502,7 +541,10 @@ export class Cache implements Disposable {
502
541
  keysToClear.add('configPatterns');
503
542
  keysToClear.add('currentBranchReference');
504
543
  keysToClear.add('currentUser');
505
- keysToClear.add('gitDir');
544
+ // `gitDir` is immutable repo topology (toplevel/git-dir/common-dir/superproject) — a
545
+ // `.git/config` content change never relocates it, and it's owned by the repo lifecycle
546
+ // (registerRepoPath/unregisterRepoPath). Clearing it here forced a redundant `git rev-parse`
547
+ // re-spawn (gitDir is read by getGkConfigPath→getGitDir on every gk op), so leave it warm.
506
548
  }
507
549
 
508
550
  if (types.includes('contributors')) {
@@ -517,13 +559,12 @@ export class Cache implements Disposable {
517
559
  }
518
560
 
519
561
  if (types.includes('gkConfig')) {
520
- keysToClear.add('gkConfigKeys');
521
- keysToClear.add('gkConfigPatterns');
562
+ keysToClear.add('gkConfigMap');
522
563
  // Derived from `branch.<ref>.gk-merge-base`/`vscode-merge-base`; clear so external
523
564
  // gkConfig mutations don't leave stale base-branch resolutions cached.
524
565
  keysToClear.add('baseBranchName');
525
- // Cached overviews use Tier 1's stored merge target as their key-stability anchor;
526
- // stored-target changes must invalidate or readers see stale `mergeTarget`/stats.
566
+ // Cached overviews are keyed by `${ref}|${mergeTarget}`; bulk gkConfig changes can
567
+ // affect any of the merge-target sources (stored, base, default), so clear all.
527
568
  keysToClear.add('branchOverviews');
528
569
  }
529
570
 
@@ -551,6 +592,8 @@ export class Cache implements Disposable {
551
592
  }
552
593
  if (types.includes('tags')) {
553
594
  keysToClear.add('tags');
595
+ keysToClear.add('refs');
596
+ keysToClear.add('refTips');
554
597
  }
555
598
 
556
599
  if (types.includes('tracking')) {
@@ -587,12 +630,14 @@ export class Cache implements Disposable {
587
630
  invalidate.call(cache, commonPath);
588
631
  for (const worktreePath of this.getWorktreePaths(commonPath)) {
589
632
  if (worktreePath === commonPath) continue;
633
+
590
634
  invalidate.call(cache, worktreePath);
591
635
  }
592
636
  } else {
593
637
  cache.delete(commonPath);
594
638
  for (const worktreePath of this.getWorktreePaths(commonPath)) {
595
639
  if (worktreePath === commonPath) continue;
640
+
596
641
  cache.delete(worktreePath);
597
642
  }
598
643
  }
@@ -825,14 +870,18 @@ export class Cache implements Disposable {
825
870
  // On factory invalidation, propagate to the derived per-worktree mapper entries
826
871
  // via soft-invalidate — existing waiters on the mapper complete, and the entry
827
872
  // self-evicts on mapper settle so the next callers build fresh derived entries.
828
- void p.finally(() => {
829
- if (cacheable.invalidated) {
830
- this.branches.invalidate(commonPath);
831
- for (const worktreePath of this.getWorktreePaths(commonPath)) {
832
- this.branches.invalidate(worktreePath);
873
+ void p
874
+ .finally(() => {
875
+ if (cacheable.invalidated) {
876
+ this.branches.invalidate(commonPath);
877
+ for (const worktreePath of this.getWorktreePaths(commonPath)) {
878
+ this.branches.invalidate(worktreePath);
879
+ }
833
880
  }
834
- }
835
- });
881
+ })
882
+ // Swallow the cleanup chain's rejection so a rejected factory (e.g. cancellation)
883
+ // doesn't surface as an unhandled rejection; the caller-facing promise handles it.
884
+ .catch(() => {});
836
885
  return p;
837
886
  },
838
887
  cancellation,
@@ -894,49 +943,56 @@ export class Cache implements Disposable {
894
943
  this._caches.configPatterns?.delete(cacheKey);
895
944
  }
896
945
 
897
- getGkConfig(
898
- repoPath: string,
899
- key: string,
900
- factory: () => PromiseOrValue<string | undefined>,
901
- ): Promise<string | undefined> {
902
- const cacheKey = this.getCommonPath(repoPath);
903
-
904
- const result = this.gkConfigKeys.get(cacheKey, key);
905
- if (result != null) return result;
906
-
907
- const factoryPromise = Promise.resolve(factory());
908
- this.gkConfigKeys.set(cacheKey, key, factoryPromise);
909
- return factoryPromise;
946
+ /**
947
+ * The whole `.git/gk/config` is read once and cached as a single map per commonPath; per-key and
948
+ * per-namespace gk lookups are served from it in-memory (see `getGkConfigMap` in the CLI config
949
+ * sub-provider). Invalidated by `deleteGkConfig` (write) and the coarse `'gkConfig'` clear (watcher).
950
+ */
951
+ getGkConfigMap(repoPath: string, factory: () => PromiseOrValue<Map<string, string>>): Promise<Map<string, string>> {
952
+ return this.getSharedSimple(this.gkConfigMap, repoPath, factory);
910
953
  }
911
954
 
912
- getGkConfigRegex(
955
+ /**
956
+ * Clears the cached `.git/gk/config` map and invalidates the derived caches
957
+ * (`baseBranchName`/`branchOverviews`) for the written key's ref.
958
+ *
959
+ * @param options.skipInvalidation Downstream caches the caller wants preserved despite this
960
+ * write. Use when the value being written is exactly what was just resolved — e.g. the Tier 2
961
+ * `storeMergeTargetBranchName` self-write inside `getBranchContributionsOverview` (skip
962
+ * `'branchOverviews'`) or the Tier 3 `storeBaseBranchName` self-write inside `getBaseBranchName`
963
+ * (skip both `'baseBranchName'` and `'branchOverviews'`). The bulk `gkConfigMap` map always
964
+ * invalidates so subsequent reads see the new value.
965
+ */
966
+ deleteGkConfig(
913
967
  repoPath: string,
914
- pattern: string,
915
- factory: () => PromiseOrValue<Map<string, string>>,
916
- ): Promise<Map<string, string>> {
968
+ key: string,
969
+ options?: { skipInvalidation?: readonly GkConfigInvalidationTarget[] },
970
+ ): void {
917
971
  const cacheKey = this.getCommonPath(repoPath);
972
+ this._caches.gkConfigMap?.delete(cacheKey);
918
973
 
919
- const result = this.gkConfigPatterns.get(cacheKey, pattern);
920
- if (result != null) return result;
974
+ const refMatch = key.match(branchOverviewGkConfigKeysRegex);
975
+ if (refMatch == null) return;
921
976
 
922
- const factoryPromise = Promise.resolve(factory());
923
- this.gkConfigPatterns.set(cacheKey, pattern, factoryPromise);
924
- return factoryPromise;
925
- }
977
+ const ref = refMatch[1];
978
+ const skip = options?.skipInvalidation;
926
979
 
927
- deleteGkConfig(repoPath: string, key: string): void {
928
- const cacheKey = this.getCommonPath(repoPath);
929
- this._caches.gkConfigKeys?.delete(cacheKey, key);
930
- this._caches.gkConfigPatterns?.delete(cacheKey);
980
+ // `getBaseBranchName` reads `branch.<ref>.gk-merge-base` and caches the resolved value
981
+ // per-ref. A write to that key must invalidate the cached base or Tier 3 of
982
+ // `getBranchContributionsOverview` will resolve `mergeTarget` against the pre-write value.
983
+ if (key.endsWith('.gk-merge-base') && !skip?.includes('baseBranchName')) {
984
+ this._caches.baseBranchName?.delete(cacheKey, ref);
985
+ }
986
+
987
+ if (skip?.includes('branchOverviews')) return;
931
988
 
932
989
  // When the change affects a branch's merge-target/base lineage, invalidate that branch's
933
- // cached overview so subsequent reads pick up the new stored value rather than stale data.
934
- // `getBranchContributionsOverview` keys `branchOverviews` by ref, with Tier 1's stored
935
- // target as the key-stability anchor so any write to those keys must invalidate.
936
- const refMatch = key.match(branchOverviewGkConfigKeyPattern);
937
- if (refMatch != null) {
938
- this._caches.branchOverviews?.delete(cacheKey, refMatch[1]);
939
- }
990
+ // cached overviews so subsequent reads pick up the new stored value rather than stale data.
991
+ // `getBranchContributionsOverview` keys `branchOverviews` by `${ref}|${mergeTarget}`, so
992
+ // invalidate every entry for the affected ref regardless of which target it resolved to.
993
+ // Uses `invalidateByKeyPrefix` (not `deleteByKeyPrefix`) so an in-flight factory is still
994
+ // shared with new callers instead of triggering a duplicate fetch.
995
+ this._caches.branchOverviews?.invalidateByKeyPrefix(cacheKey, `${ref}|`);
940
996
  }
941
997
 
942
998
  async getBranchOverview(
@@ -1094,6 +1150,42 @@ export class Cache implements Disposable {
1094
1150
  return this.getSharedSimple(this.lastFetched, repoPath, factory);
1095
1151
  }
1096
1152
 
1153
+ getRefs(
1154
+ repoPath: string,
1155
+ factory: (
1156
+ commonPath: string,
1157
+ cacheable: CacheController,
1158
+ cancellation?: AbortSignal,
1159
+ ) => PromiseOrValue<RefRecord[]>,
1160
+ cancellation?: AbortSignal,
1161
+ ): Promise<RefRecord[]> {
1162
+ // Raw ref records are repoPath-agnostic (no per-worktree binding to remap), so we key only
1163
+ // by commonPath and skip the per-worktree mapper that `getBranches`/`getTags` need.
1164
+ const commonPath = this.getCommonPath(repoPath);
1165
+ return this.refs.getOrCreate(
1166
+ commonPath,
1167
+ (cacheable, signal) => Promise.resolve(factory(commonPath, cacheable, signal)),
1168
+ cancellation,
1169
+ );
1170
+ }
1171
+
1172
+ getRefTips(
1173
+ repoPath: string,
1174
+ factory: (
1175
+ commonPath: string,
1176
+ cacheable: CacheController,
1177
+ cancellation?: AbortSignal,
1178
+ ) => PromiseOrValue<GitRefTip[]>,
1179
+ cancellation?: AbortSignal,
1180
+ ): Promise<GitRefTip[]> {
1181
+ const commonPath = this.getCommonPath(repoPath);
1182
+ return this.refTips.getOrCreate(
1183
+ commonPath,
1184
+ (cacheable, signal) => Promise.resolve(factory(commonPath, cacheable, signal)),
1185
+ cancellation,
1186
+ );
1187
+ }
1188
+
1097
1189
  async getRemotes(
1098
1190
  repoPath: string,
1099
1191
  factory: (
@@ -1196,14 +1288,19 @@ export class Cache implements Disposable {
1196
1288
  // On factory invalidation (without rejection), propagate to the derived per-worktree
1197
1289
  // mapper entries so they don't persist past the shared factory's settle. Mapper
1198
1290
  // entries cached via `cache.set()` have no controller, so `invalidate` hard-deletes.
1199
- void p.finally(() => {
1200
- if (cacheable.invalidated) {
1201
- for (const worktreePath of this.getWorktreePaths(commonPath)) {
1202
- if (worktreePath === commonPath) continue;
1203
- cache.invalidate(worktreePath);
1291
+ void p
1292
+ .finally(() => {
1293
+ if (cacheable.invalidated) {
1294
+ for (const worktreePath of this.getWorktreePaths(commonPath)) {
1295
+ if (worktreePath === commonPath) continue;
1296
+
1297
+ cache.invalidate(worktreePath);
1298
+ }
1204
1299
  }
1205
- }
1206
- });
1300
+ })
1301
+ // Swallow the cleanup chain's rejection so a rejected factory (e.g. cancellation)
1302
+ // doesn't surface as an unhandled rejection; the caller-facing promise handles it.
1303
+ .catch(() => {});
1207
1304
  return p;
1208
1305
  },
1209
1306
  cancellation,
@@ -1252,14 +1349,19 @@ export class Cache implements Disposable {
1252
1349
  // mapper entries for this `cacheKey` so they don't persist past the shared factory's
1253
1350
  // settle. Mapper entries cached via `cache.set()` have no controller, so `invalidate`
1254
1351
  // hard-deletes.
1255
- void p.finally(() => {
1256
- if (cacheable.invalidated) {
1257
- for (const worktreePath of this.getWorktreePaths(commonPath)) {
1258
- if (worktreePath === commonPath) continue;
1259
- cache.invalidate(worktreePath, cacheKey);
1352
+ void p
1353
+ .finally(() => {
1354
+ if (cacheable.invalidated) {
1355
+ for (const worktreePath of this.getWorktreePaths(commonPath)) {
1356
+ if (worktreePath === commonPath) continue;
1357
+
1358
+ cache.invalidate(worktreePath, cacheKey);
1359
+ }
1260
1360
  }
1261
- }
1262
- });
1361
+ })
1362
+ // Swallow the cleanup chain's rejection so a rejected factory (e.g. cancellation)
1363
+ // doesn't surface as an unhandled rejection; the caller-facing promise handles it.
1364
+ .catch(() => {});
1263
1365
  return p;
1264
1366
  },
1265
1367
  options,
@@ -85,6 +85,27 @@ export interface GitServiceConfig {
85
85
  /** Maximum search items (0 = unlimited). */
86
86
  readonly maxSearchItems?: number;
87
87
  };
88
+
89
+ /** Force-push preferences. */
90
+ readonly push?: {
91
+ /** Whether to use `--force-with-lease` instead of a plain `--force` when force-pushing. Defaults to `true`. */
92
+ readonly useForceWithLease?: boolean;
93
+ /**
94
+ * Whether to add `--force-if-includes` when force-pushing. Only applies when `useForceWithLease` is `true`
95
+ * and the installed Git supports it. Defaults to `true`.
96
+ */
97
+ readonly useForceIfIncludes?: boolean;
98
+ };
99
+
100
+ /** Commit-signing preferences. */
101
+ readonly signing?: {
102
+ /**
103
+ * Host-level override for whether commit signing is enabled (e.g. VS Code's `git.enableCommitSigning`).
104
+ * When `true`, signing is treated as enabled even if the repo's `commit.gpgsign` is unset/false. It never
105
+ * forces signing off.
106
+ */
107
+ readonly enabled?: boolean;
108
+ };
88
109
  }
89
110
 
90
111
  /** Git command types that can produce conflicts. */
@@ -1,5 +1,6 @@
1
1
  // GitFeature's must start with `git:` to be recognized in all usages
2
2
  export type GitFeatures =
3
+ | 'git:checkout:pathspec-from-file'
3
4
  | 'git:for-each-ref:worktreePath'
4
5
  | 'git:ignoreRevsFile'
5
6
  | 'git:merge-tree'
@@ -28,6 +29,7 @@ export type FilteredGitFeatures<T extends GitFeatureOrPrefix> = T extends GitFea
28
29
 
29
30
  export const gitMinimumVersion = '2.7.2';
30
31
  export const gitFeaturesByVersion = new Map<GitFeatures, string>([
32
+ ['git:checkout:pathspec-from-file', '2.26'],
31
33
  ['git:for-each-ref:worktreePath', '2.23'],
32
34
  ['git:ignoreRevsFile', '2.23'],
33
35
  ['git:merge-tree', '2.33'],
@@ -521,6 +521,7 @@ export class GitCommit implements GitRevisionReference {
521
521
 
522
522
  protected computeFileStats(): void {
523
523
  if (!this._recomputeStats || this._fileset == null) return;
524
+
524
525
  this._recomputeStats = false;
525
526
 
526
527
  const changedFiles = { added: 0, deleted: 0, changed: 0 };