@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
@@ -1,7 +1,7 @@
1
1
  import type { Cache } from '../../git/cache.js';
2
2
  import type { GitServiceContext } from '../../git/context.js';
3
3
  import type { GitBranchReference, GitReference } from '../../git/models/reference.js';
4
- import type { GitOperationResult, GitOperationsSubProvider } from '../../git/providers/operations.js';
4
+ import type { GitOperationResult, GitOperationRunOptions, GitOperationsSubProvider } from '../../git/providers/operations.js';
5
5
  import type { CliGitProviderInternal } from '../cliGitProvider.js';
6
6
  import type { Git } from '../exec/git.js';
7
7
  export declare class OperationsGitSubProvider implements GitOperationsSubProvider {
@@ -12,15 +12,12 @@ export declare class OperationsGitSubProvider implements GitOperationsSubProvide
12
12
  constructor(context: GitServiceContext, git: Git, cache: Cache, provider: CliGitProviderInternal);
13
13
  checkout(repoPath: string, ref: string, options?: {
14
14
  createBranch?: string;
15
- } | {
16
- path?: string;
17
- }): Promise<void>;
18
- private checkoutCore;
15
+ }, runOptions?: GitOperationRunOptions): Promise<void>;
19
16
  cherryPick(repoPath: string, revs: string[], options?: {
20
17
  edit?: boolean;
21
18
  noCommit?: boolean;
22
19
  source?: unknown;
23
- }): Promise<GitOperationResult>;
20
+ }, runOptions?: GitOperationRunOptions): Promise<GitOperationResult>;
24
21
  commit(repoPath: string, message: string, options?: {
25
22
  all?: boolean;
26
23
  allowEmpty?: boolean;
@@ -29,27 +26,27 @@ export declare class OperationsGitSubProvider implements GitOperationsSubProvide
29
26
  date?: string;
30
27
  signoff?: boolean;
31
28
  source?: unknown;
32
- }): Promise<void>;
29
+ }, runOptions?: GitOperationRunOptions): Promise<void>;
33
30
  fetch(repoPath: string, options?: {
34
31
  all?: boolean;
35
32
  branch?: GitBranchReference;
36
33
  prune?: boolean;
37
34
  pull?: boolean;
38
35
  remote?: string;
39
- }): Promise<void>;
36
+ }, runOptions?: GitOperationRunOptions): Promise<void>;
40
37
  private fetchCore;
41
38
  merge(repoPath: string, ref: string, options?: {
42
39
  fastForward?: boolean | 'only';
43
40
  noCommit?: boolean;
44
41
  squash?: boolean;
45
42
  source?: unknown;
46
- }): Promise<GitOperationResult>;
43
+ }, runOptions?: GitOperationRunOptions): Promise<GitOperationResult>;
47
44
  pull(repoPath: string, options?: {
48
45
  branch?: GitBranchReference;
49
46
  rebase?: boolean;
50
47
  tags?: boolean;
51
48
  source?: unknown;
52
- }): Promise<void>;
49
+ }, runOptions?: GitOperationRunOptions): Promise<void>;
53
50
  private pullCore;
54
51
  push(repoPath: string, options?: {
55
52
  reference?: GitReference;
@@ -57,25 +54,31 @@ export declare class OperationsGitSubProvider implements GitOperationsSubProvide
57
54
  publish?: {
58
55
  remote: string;
59
56
  };
60
- }): Promise<void>;
57
+ }, runOptions?: GitOperationRunOptions): Promise<void>;
61
58
  private pushCore;
62
59
  rebase(repoPath: string, upstream: string, options?: {
63
60
  autoStash?: boolean;
64
61
  branch?: string;
65
62
  editor?: string;
66
63
  interactive?: boolean;
64
+ programmaticEditor?: boolean;
65
+ messageEditor?: string;
67
66
  onto?: string;
68
67
  updateRefs?: boolean;
69
68
  source?: unknown;
70
- }): Promise<GitOperationResult>;
69
+ }, runOptions?: GitOperationRunOptions): Promise<GitOperationResult>;
71
70
  reset(repoPath: string, rev: string, options?: {
72
71
  mode?: 'hard' | 'keep' | 'merge' | 'mixed' | 'soft';
73
- }): Promise<void>;
72
+ }, runOptions?: GitOperationRunOptions): Promise<void>;
74
73
  private resetCore;
74
+ restore(repoPath: string, path: string | string[], options?: {
75
+ ref?: string;
76
+ side?: 'ours' | 'theirs';
77
+ }, runOptions?: GitOperationRunOptions): Promise<void>;
75
78
  revert(repoPath: string, refs: string[], options?: {
76
79
  editMessage?: boolean;
77
80
  source?: unknown;
78
- }): Promise<GitOperationResult>;
81
+ }, runOptions?: GitOperationRunOptions): Promise<GitOperationResult>;
79
82
  /**
80
83
  * Classifies `ex` as a signing failure; if so, fires the `commits.onSigningFailed`
81
84
  * hook and throws a typed {@link SigningError}. Callers should invoke this first
@@ -1 +1 @@
1
- {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/providers/operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAsB,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAcrF,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAGzF,OAAO,KAAK,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAQzG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,GAAG,EAAoB,MAAM,gBAAgB,CAAC;AAS5D,qBAAa,wBAAyB,YAAW,wBAAwB;IAEvE,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAHR,OAAO,EAAE,iBAAiB,EAC1B,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,sBAAsB;IAI5C,QAAQ,CACb,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GACrD,OAAO,CAAC,IAAI,CAAC;YAaF,YAAY;IAkCpB,UAAU,CACf,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,OA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AI,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAE,EACpD,UAAU,CAAC,EAAE,sBAAsB,GACjC,OAAO,CAAC,IAAI,CAAC;IA+DV,MAAM,CACX,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,EACrD,UAAU,CAAC,EAAE,sBAAsB,GACjC,OAAO,CAAC,kBAAkB,CAAC;IA2C9B;;;;;;;;;OASG;YACW,mBAAmB;YAwBnB,oBAAoB;CAelC"}
@@ -9,10 +9,11 @@ import { getBranchNameAndRemote, getBranchTrackingWithoutRemote } from '../../gi
9
9
  import { isBranchReference } from '../../git/utils/reference.utils.js';
10
10
  import { debug } from '../../utils/decorators/log.js';
11
11
  import { sequentialize } from '../../utils/decorators/sequentialize.js';
12
+ import { chunkByStringLength } from '../../utils/iterable.js';
12
13
  import { Logger } from '../../utils/logger.js';
13
14
  import { getScopedLogger } from '../../utils/logger.scoped.js';
14
15
  import { normalizePath, splitPath } from '../../utils/path.js';
15
- import { classifySigningError, getGitCommandError, gitConfigsPull, GitErrors, inferSigningFormatFromError, } from '../exec/git.js';
16
+ import { classifySigningError, getGitCommandError, gitConfigsPull, GitErrors, inferSigningFormatFromError, maxGitCliLength, } from '../exec/git.js';
16
17
  export class OperationsGitSubProvider {
17
18
  context;
18
19
  git;
@@ -24,38 +25,26 @@ export class OperationsGitSubProvider {
24
25
  this.cache = cache;
25
26
  this.provider = provider;
26
27
  }
27
- async checkout(repoPath, ref, options) {
28
+ async checkout(repoPath, ref, options, runOptions) {
28
29
  const scope = getScopedLogger();
29
- try {
30
- await this.checkoutCore(repoPath, ref, options);
31
- this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status');
32
- this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'index']);
33
- }
34
- catch (ex) {
35
- scope?.error(ex);
36
- throw ex;
37
- }
38
- }
39
- async checkoutCore(repoPath, ref, { createBranch, path } = {}) {
40
30
  const params = ['checkout'];
41
- if (createBranch) {
42
- params.push('-b', createBranch, ref, '--');
31
+ if (options?.createBranch) {
32
+ params.push('-b', options.createBranch, ref, '--');
43
33
  }
44
34
  else {
45
35
  params.push(ref, '--');
46
- if (path) {
47
- [path, repoPath] = splitPath(path, repoPath, true);
48
- params.push(path);
49
- }
50
36
  }
51
37
  try {
52
- await this.git.run({ cwd: repoPath }, ...params);
38
+ await this.git.run({ cwd: repoPath, errors: 'throw', ...runOptions }, ...params);
39
+ this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status');
40
+ this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'index']);
53
41
  }
54
42
  catch (ex) {
43
+ scope?.error(ex);
55
44
  throw getGitCommandError('checkout', ex, reason => new CheckoutError({ reason: reason ?? 'other', ref: ref, gitCommand: { repoPath: repoPath, args: params } }, ex));
56
45
  }
57
46
  }
58
- async cherryPick(repoPath, revs, options) {
47
+ async cherryPick(repoPath, revs, options, runOptions) {
59
48
  const scope = getScopedLogger();
60
49
  const args = ['cherry-pick'];
61
50
  if (options?.edit) {
@@ -65,7 +54,8 @@ export class OperationsGitSubProvider {
65
54
  args.push('-n');
66
55
  }
67
56
  if (revs.length > 1) {
68
- // Sort commits in topological order (oldest ancestor first) so cherry-pick applies them correctly
57
+ // Sort commits in topological order (oldest ancestor first) so cherry-pick applies them correctly.
58
+ // This is a local read-only pre-flight, not the user-initiated op — don't subject it to caller env/timeout.
69
59
  const revsSet = new Set(revs);
70
60
  const result = await this.git.run({ cwd: repoPath }, 'rev-list', '--topo-order', '--reverse', ...revs);
71
61
  const ordered = [];
@@ -83,7 +73,7 @@ export class OperationsGitSubProvider {
83
73
  }
84
74
  args.push(...revs);
85
75
  try {
86
- await this.git.run({ cwd: repoPath, errors: 'throw' }, ...args);
76
+ await this.git.run({ cwd: repoPath, errors: 'throw', ...runOptions }, ...args);
87
77
  this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status');
88
78
  this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'index']);
89
79
  return { conflicted: false };
@@ -98,7 +88,7 @@ export class OperationsGitSubProvider {
98
88
  throw mapped;
99
89
  }
100
90
  }
101
- async commit(repoPath, message, options) {
91
+ async commit(repoPath, message, options, runOptions) {
102
92
  const scope = getScopedLogger();
103
93
  const params = ['commit'];
104
94
  if (options?.all) {
@@ -122,7 +112,7 @@ export class OperationsGitSubProvider {
122
112
  // Read commit message from stdin via -F - to avoid shell escaping issues
123
113
  params.push('-F', '-');
124
114
  try {
125
- await this.git.run({ cwd: repoPath, stdin: message, stdinEncoding: 'utf8', errors: 'throw' }, ...params);
115
+ await this.git.run({ cwd: repoPath, stdin: message, stdinEncoding: 'utf8', errors: 'throw', ...runOptions }, ...params);
126
116
  this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status');
127
117
  this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'index']);
128
118
  }
@@ -132,7 +122,7 @@ export class OperationsGitSubProvider {
132
122
  throw getGitCommandError('commit', ex, reason => new CommitError({ reason: reason ?? 'other', gitCommand: { repoPath: repoPath, args: params } }, ex));
133
123
  }
134
124
  }
135
- async fetch(repoPath, options) {
125
+ async fetch(repoPath, options, runOptions) {
136
126
  const scope = getScopedLogger();
137
127
  const { branch, ...opts } = options ?? {};
138
128
  try {
@@ -145,10 +135,10 @@ export class OperationsGitSubProvider {
145
135
  remote: remoteName,
146
136
  upstream: getBranchTrackingWithoutRemote(branch),
147
137
  pull: options?.pull,
148
- });
138
+ }, runOptions);
149
139
  }
150
140
  else {
151
- await this.fetchCore(repoPath, opts);
141
+ await this.fetchCore(repoPath, opts, runOptions);
152
142
  }
153
143
  this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'tags');
154
144
  this.context.hooks?.repository?.onChanged?.(repoPath, ['remotes']);
@@ -158,7 +148,7 @@ export class OperationsGitSubProvider {
158
148
  throw ex;
159
149
  }
160
150
  }
161
- async fetchCore(repoPath, options) {
151
+ async fetchCore(repoPath, options, runOptions) {
162
152
  const params = ['fetch'];
163
153
  if (options.prune) {
164
154
  params.push('--prune');
@@ -178,7 +168,7 @@ export class OperationsGitSubProvider {
178
168
  params.push('--all');
179
169
  }
180
170
  try {
181
- await this.git.run({ cwd: repoPath }, ...params);
171
+ await this.git.run({ cwd: repoPath, errors: 'throw', ...runOptions }, ...params);
182
172
  }
183
173
  catch (ex) {
184
174
  throw getGitCommandError('fetch', ex, reason => new FetchError({
@@ -189,7 +179,7 @@ export class OperationsGitSubProvider {
189
179
  }, ex));
190
180
  }
191
181
  }
192
- async merge(repoPath, ref, options) {
182
+ async merge(repoPath, ref, options, runOptions) {
193
183
  const scope = getScopedLogger();
194
184
  const args = ['merge'];
195
185
  if (options?.fastForward === 'only') {
@@ -211,7 +201,7 @@ export class OperationsGitSubProvider {
211
201
  try {
212
202
  await this.git.run(
213
203
  // Avoid a timeout since merges can take a long time (set to 0 to disable)
214
- { cwd: repoPath, errors: 'throw', timeout: 0 }, ...args);
204
+ { cwd: repoPath, errors: 'throw', timeout: 0, ...runOptions }, ...args);
215
205
  this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status');
216
206
  this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'index']);
217
207
  return { conflicted: false };
@@ -226,7 +216,7 @@ export class OperationsGitSubProvider {
226
216
  throw mapped;
227
217
  }
228
218
  }
229
- async pull(repoPath, options) {
219
+ async pull(repoPath, options, runOptions) {
230
220
  const scope = getScopedLogger();
231
221
  try {
232
222
  if (isBranchReference(options?.branch)) {
@@ -239,13 +229,13 @@ export class OperationsGitSubProvider {
239
229
  rebase: options?.rebase,
240
230
  tags: options?.tags,
241
231
  source: options?.source,
242
- });
232
+ }, runOptions);
243
233
  this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status', 'tags');
244
234
  this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'remotes', 'index']);
245
235
  }
246
236
  else {
247
237
  // Branch is not checked out anywhere — can only fetch (no working tree to merge into)
248
- await this.fetch(repoPath, { branch: branch });
238
+ await this.fetch(repoPath, { branch: branch }, runOptions);
249
239
  }
250
240
  return;
251
241
  }
@@ -253,7 +243,7 @@ export class OperationsGitSubProvider {
253
243
  rebase: options?.rebase,
254
244
  tags: options?.tags,
255
245
  source: options?.source,
256
- });
246
+ }, runOptions);
257
247
  this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status', 'tags');
258
248
  this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'remotes', 'index']);
259
249
  }
@@ -262,7 +252,7 @@ export class OperationsGitSubProvider {
262
252
  throw ex;
263
253
  }
264
254
  }
265
- async pullCore(repoPath, options) {
255
+ async pullCore(repoPath, options, runOptions) {
266
256
  const params = ['pull'];
267
257
  if (options.tags) {
268
258
  params.push('--tags');
@@ -271,14 +261,14 @@ export class OperationsGitSubProvider {
271
261
  params.push('-r');
272
262
  }
273
263
  try {
274
- await this.git.run({ cwd: repoPath, configs: gitConfigsPull }, ...params);
264
+ await this.git.run({ cwd: repoPath, configs: gitConfigsPull, errors: 'throw', ...runOptions }, ...params);
275
265
  }
276
266
  catch (ex) {
277
267
  await this.throwIfSigningError(repoPath, params, ex, options.source);
278
268
  throw getGitCommandError('pull', ex, reason => new PullError({ reason: reason ?? 'other', gitCommand: { repoPath: repoPath, args: params } }, ex));
279
269
  }
280
270
  }
281
- async push(repoPath, options) {
271
+ async push(repoPath, options, runOptions) {
282
272
  const scope = getScopedLogger();
283
273
  let branchName;
284
274
  let remoteName;
@@ -298,10 +288,16 @@ export class OperationsGitSubProvider {
298
288
  const branch = await this.provider.branches.getBranch(repoPath);
299
289
  if (branch == null)
300
290
  return;
301
- branchName =
302
- options?.reference != null
303
- ? `${options.reference.ref}:${options?.publish != null ? 'refs/heads/' : ''}${branch.nameWithoutRemote}`
304
- : branch.name;
291
+ if (options?.reference != null) {
292
+ branchName = `${options.reference.ref}:${options?.publish != null ? 'refs/heads/' : ''}${branch.nameWithoutRemote}`;
293
+ }
294
+ else {
295
+ const tracking = options?.publish == null ? branch.trackingWithoutRemote : undefined;
296
+ branchName =
297
+ tracking != null && tracking !== branch.nameWithoutRemote
298
+ ? `${branch.name}:${tracking}`
299
+ : branch.name;
300
+ }
305
301
  remoteName = branch.remoteName ?? options?.publish?.remote;
306
302
  upstreamName = options?.reference == null && options?.publish != null ? branch.name : undefined;
307
303
  // Git can't setup upstream tracking when publishing a new branch to a specific commit, so we'll need to do it after the push
@@ -318,10 +314,12 @@ export class OperationsGitSubProvider {
318
314
  }
319
315
  let forceOpts;
320
316
  if (options?.force) {
321
- forceOpts = {
322
- withLease: true,
323
- ifIncludes: true,
324
- };
317
+ // Honor the host's force-push preferences (e.g. VS Code's `git.useForcePushWithLease` /
318
+ // `git.useForcePushIfIncludes`); fall back to the safer `--force-with-lease` behavior.
319
+ const useForceWithLease = this.context.config?.push?.useForceWithLease ?? true;
320
+ forceOpts = useForceWithLease
321
+ ? { withLease: true, ifIncludes: this.context.config?.push?.useForceIfIncludes ?? true }
322
+ : { withLease: false };
325
323
  }
326
324
  try {
327
325
  await this.pushCore(repoPath, {
@@ -330,20 +328,27 @@ export class OperationsGitSubProvider {
330
328
  upstream: upstreamName,
331
329
  force: forceOpts,
332
330
  publish: options?.publish != null,
333
- });
334
- // Since Git can't setup upstream tracking when publishing a new branch to a specific commit, do it now
331
+ }, runOptions);
332
+ // Since Git can't setup upstream tracking when publishing a new branch to a specific commit, do it now.
333
+ // Soft-fail: the push already succeeded, so don't let a local upstream-tracking failure (cancellation
334
+ // arriving mid-spawn, transient git error) suppress the post-push hook fan-out below.
335
335
  if (setUpstream != null) {
336
- await this.git.run({ cwd: repoPath }, 'branch', '--set-upstream-to', `${setUpstream.remote}/${setUpstream.remoteBranch}`, setUpstream.branch);
336
+ try {
337
+ await this.git.run({ cwd: repoPath, ...runOptions }, 'branch', '--set-upstream-to', `${setUpstream.remote}/${setUpstream.remoteBranch}`, setUpstream.branch);
338
+ }
339
+ catch (ex) {
340
+ scope?.error(ex, 'Unable to set upstream tracking after publish');
341
+ }
337
342
  }
338
343
  this.context.hooks?.cache?.onReset?.(repoPath, 'branches');
339
- this.context.hooks?.repository?.onChanged?.(repoPath, ['remotes']);
344
+ this.context.hooks?.repository?.onChanged?.(repoPath, options?.publish != null ? ['config', 'heads', 'remotes'] : ['remotes']);
340
345
  }
341
346
  catch (ex) {
342
347
  scope?.error(ex);
343
348
  throw ex;
344
349
  }
345
350
  }
346
- async pushCore(repoPath, options) {
351
+ async pushCore(repoPath, options, runOptions) {
347
352
  const params = ['push'];
348
353
  if (options.force != null) {
349
354
  if (options.force.withLease) {
@@ -376,7 +381,7 @@ export class OperationsGitSubProvider {
376
381
  params.push(options.delete.remote, `:${options.delete.branch}`);
377
382
  }
378
383
  try {
379
- await this.git.run({ cwd: repoPath }, ...params);
384
+ await this.git.run({ cwd: repoPath, errors: 'throw', ...runOptions }, ...params);
380
385
  }
381
386
  catch (ex) {
382
387
  const error = getGitCommandError('push', ex, reason => new PushError({
@@ -416,19 +421,33 @@ export class OperationsGitSubProvider {
416
421
  throw error;
417
422
  }
418
423
  }
419
- async rebase(repoPath, upstream, options) {
424
+ async rebase(repoPath, upstream, options, runOptions) {
420
425
  const scope = getScopedLogger();
421
426
  const args = ['rebase'];
422
- let configs;
427
+ const configs = [];
423
428
  if (options?.autoStash !== false) {
424
429
  args.push('--autostash');
425
430
  }
426
431
  if (options?.interactive) {
427
432
  args.push('--interactive');
428
433
  if (options.editor) {
429
- configs = ['-c', `sequence.editor=${options.editor}`];
434
+ configs.push('-c', `sequence.editor=${options.editor}`);
435
+ }
436
+ // A script-based sequence editor rewrites the todo by command word + SHA, so git must emit a
437
+ // plain, natural-order todo regardless of the user's rebase config: `rebase.autosquash` would
438
+ // reorder commits and rewrite `pick`→`fixup`, and `rebase.abbreviateCommands` would emit `p`.
439
+ if (options.programmaticEditor) {
440
+ configs.push('-c', 'rebase.autosquash=false', '-c', 'rebase.abbreviateCommands=false');
430
441
  }
431
442
  }
443
+ // Drive per-commit message editing (the combined message a `squash` produces, or a `reword`).
444
+ // `GIT_EDITOR` (not `core.editor`) is what git's interactive-rebase backend honors for the `reword`
445
+ // amend step, so set it on the environment; also set `core.editor` config as a fallback.
446
+ let env = runOptions?.env;
447
+ if (options?.messageEditor) {
448
+ configs.push('-c', `core.editor=${options.messageEditor}`);
449
+ env = { ...env, GIT_EDITOR: options.messageEditor };
450
+ }
432
451
  if (options?.updateRefs) {
433
452
  args.push('--update-refs');
434
453
  }
@@ -442,7 +461,7 @@ export class OperationsGitSubProvider {
442
461
  try {
443
462
  await this.git.run(
444
463
  // Avoid a timeout since rebases can take a long time (set to 0 to disable)
445
- { cwd: repoPath, errors: 'throw', configs: configs, timeout: 0 }, ...args);
464
+ { cwd: repoPath, errors: 'throw', configs: configs, timeout: 0, ...runOptions, env: env }, ...args);
446
465
  this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status');
447
466
  this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'index']);
448
467
  return { conflicted: false };
@@ -461,10 +480,10 @@ export class OperationsGitSubProvider {
461
480
  throw mapped;
462
481
  }
463
482
  }
464
- async reset(repoPath, rev, options) {
483
+ async reset(repoPath, rev, options, runOptions) {
465
484
  const scope = getScopedLogger();
466
485
  try {
467
- await this.resetCore(repoPath, rev, options?.mode);
486
+ await this.resetCore(repoPath, rev, options?.mode, runOptions);
468
487
  this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status');
469
488
  this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'index']);
470
489
  }
@@ -473,20 +492,69 @@ export class OperationsGitSubProvider {
473
492
  throw ex;
474
493
  }
475
494
  }
476
- async resetCore(repoPath, rev, mode) {
495
+ async resetCore(repoPath, rev, mode, runOptions) {
477
496
  const params = ['reset', '-q'];
478
497
  if (mode) {
479
498
  params.push(`--${mode}`);
480
499
  }
481
500
  params.push(rev, '--');
482
501
  try {
483
- await this.git.run({ cwd: repoPath }, ...params);
502
+ await this.git.run({ cwd: repoPath, errors: 'throw', ...runOptions }, ...params);
484
503
  }
485
504
  catch (ex) {
486
505
  throw getGitCommandError('reset', ex, reason => new ResetError({ reason: reason ?? 'other', gitCommand: { repoPath: repoPath, args: params } }, ex));
487
506
  }
488
507
  }
489
- async revert(repoPath, refs, options) {
508
+ async restore(repoPath, path, options, runOptions) {
509
+ const paths = Array.isArray(path) ? path : [path];
510
+ if (!paths.length)
511
+ return;
512
+ const scope = getScopedLogger();
513
+ const normalized = paths.map(p => splitPath(p, repoPath, true)[0]);
514
+ // `side` and `ref` are mutually exclusive in git (--ours/--theirs apply during conflict
515
+ // resolution and take no source ref); side takes precedence if both are somehow supplied.
516
+ // Use a truthy check on `ref` so an empty string falls through to index-restore rather than
517
+ // producing a malformed `git checkout '' -- …`. Implemented via `checkout` rather than
518
+ // `git restore` for compatibility with the minimum supported git (2.7.2); `git restore`
519
+ // only landed in 2.23.
520
+ const selector = options?.side != null ? `--${options.side}` : options?.ref || undefined;
521
+ const prefix = selector != null ? ['checkout', selector, '--'] : ['checkout', '--'];
522
+ try {
523
+ if (await this.git.supports('git:checkout:pathspec-from-file')) {
524
+ // Git ≥ 2.26: stream all pathspecs via stdin (NUL-separated) in a single invocation —
525
+ // no CLI-length limit (so no batching), and robust for paths with spaces/newlines.
526
+ // Pathspecs come from the file rather than argv, so `--` isn't used.
527
+ const args = ['checkout'];
528
+ if (selector != null) {
529
+ args.push(selector);
530
+ }
531
+ args.push('--pathspec-from-file=-', '--pathspec-file-nul');
532
+ await this.git.run({ cwd: repoPath, errors: 'throw', ...runOptions, stdin: normalized.join('\0') }, ...args);
533
+ }
534
+ else {
535
+ // Older git: pass pathspecs as args, one git invocation per chunk (collapsing N
536
+ // path-mode checkouts into ⌈N / chunk⌉ spawns). Reserve the command prefix length and
537
+ // a per-arg overhead (separator + possible quoting) so the assembled command line
538
+ // can't exceed the OS limit even with many short paths.
539
+ const perArgOverhead = 3;
540
+ const prefixLength = prefix.reduce((sum, arg) => sum + arg.length + perArgOverhead, 0);
541
+ for (const batch of chunkByStringLength(normalized, maxGitCliLength - prefixLength, perArgOverhead)) {
542
+ await this.git.run({ cwd: repoPath, errors: 'throw', ...runOptions }, ...prefix, ...batch);
543
+ }
544
+ }
545
+ this.context.hooks?.cache?.onReset?.(repoPath, 'status');
546
+ this.context.hooks?.repository?.onChanged?.(repoPath, ['index']);
547
+ }
548
+ catch (ex) {
549
+ scope?.error(ex);
550
+ throw getGitCommandError('checkout', ex, reason => new CheckoutError({
551
+ reason: reason ?? 'other',
552
+ ref: options?.side ?? options?.ref,
553
+ gitCommand: { repoPath: repoPath, args: [...prefix, ...normalized] },
554
+ }, ex));
555
+ }
556
+ }
557
+ async revert(repoPath, refs, options, runOptions) {
490
558
  const scope = getScopedLogger();
491
559
  const args = ['revert'];
492
560
  if (options?.editMessage === true) {
@@ -499,7 +567,7 @@ export class OperationsGitSubProvider {
499
567
  try {
500
568
  await this.git.run(
501
569
  // Avoid a timeout since reverts can take a long time (set to 0 to disable)
502
- { cwd: repoPath, errors: 'throw', timeout: 0 }, ...args);
570
+ { cwd: repoPath, errors: 'throw', timeout: 0, ...runOptions }, ...args);
503
571
  this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status');
504
572
  this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'index']);
505
573
  return { conflicted: false };
@@ -590,6 +658,10 @@ __decorate([
590
658
  __decorate([
591
659
  debug()
592
660
  ], OperationsGitSubProvider.prototype, "reset", null);
661
+ __decorate([
662
+ sequentialize({ getQueueKey: rp => rp }),
663
+ debug()
664
+ ], OperationsGitSubProvider.prototype, "restore", null);
593
665
  __decorate([
594
666
  sequentialize({ getQueueKey: rp => rp }),
595
667
  debug()