@gitkraken/core-gitlens 0.5.110 → 0.5.111

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 (362) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/dist/git/cache.d.ts +111 -6
  3. package/dist/git/cache.d.ts.map +1 -1
  4. package/dist/git/cache.js +312 -43
  5. package/dist/git/cache.js.map +1 -1
  6. package/dist/git/context.d.ts +11 -0
  7. package/dist/git/context.d.ts.map +1 -1
  8. package/dist/git/context.js.map +1 -1
  9. package/dist/git/models/fileStatus.d.ts +1 -0
  10. package/dist/git/models/fileStatus.d.ts.map +1 -1
  11. package/dist/git/models/fileStatus.js +1 -0
  12. package/dist/git/models/fileStatus.js.map +1 -1
  13. package/dist/git/models/issue.d.ts +4 -0
  14. package/dist/git/models/issue.d.ts.map +1 -1
  15. package/dist/git/models/mergeConflicts.d.ts +2 -0
  16. package/dist/git/models/mergeConflicts.d.ts.map +1 -1
  17. package/dist/git/models/pullRequest.d.ts +38 -2
  18. package/dist/git/models/pullRequest.d.ts.map +1 -1
  19. package/dist/git/models/pullRequest.js +12 -1
  20. package/dist/git/models/pullRequest.js.map +1 -1
  21. package/dist/git/models/repository.d.ts +32 -5
  22. package/dist/git/models/repository.d.ts.map +1 -1
  23. package/dist/git/models/repository.js +58 -12
  24. package/dist/git/models/repository.js.map +1 -1
  25. package/dist/git/models/statusFile.d.ts.map +1 -1
  26. package/dist/git/models/statusFile.js +3 -0
  27. package/dist/git/models/statusFile.js.map +1 -1
  28. package/dist/git/providers/branches.d.ts +2 -0
  29. package/dist/git/providers/branches.d.ts.map +1 -1
  30. package/dist/git/providers/commits.d.ts +8 -0
  31. package/dist/git/providers/commits.d.ts.map +1 -1
  32. package/dist/git/providers/config.d.ts +19 -1
  33. package/dist/git/providers/config.d.ts.map +1 -1
  34. package/dist/git/providers/operations.d.ts +1 -0
  35. package/dist/git/providers/operations.d.ts.map +1 -1
  36. package/dist/git/providers/pausedOperations.d.ts +2 -0
  37. package/dist/git/providers/pausedOperations.d.ts.map +1 -1
  38. package/dist/git/providers/status.d.ts +1 -0
  39. package/dist/git/providers/status.d.ts.map +1 -1
  40. package/dist/git/utils/config.utils.d.ts +3 -0
  41. package/dist/git/utils/config.utils.d.ts.map +1 -0
  42. package/dist/git/utils/config.utils.js +8 -0
  43. package/dist/git/utils/config.utils.js.map +1 -0
  44. package/dist/git/utils/issue.utils.d.ts.map +1 -1
  45. package/dist/git/utils/issue.utils.js +2 -0
  46. package/dist/git/utils/issue.utils.js.map +1 -1
  47. package/dist/git/utils/pausedOperationStatus.utils.d.ts +14 -0
  48. package/dist/git/utils/pausedOperationStatus.utils.d.ts.map +1 -1
  49. package/dist/git/utils/pausedOperationStatus.utils.js +23 -0
  50. package/dist/git/utils/pausedOperationStatus.utils.js.map +1 -1
  51. package/dist/git/utils/pullRequest.utils.d.ts +14 -1
  52. package/dist/git/utils/pullRequest.utils.d.ts.map +1 -1
  53. package/dist/git/utils/pullRequest.utils.js +31 -0
  54. package/dist/git/utils/pullRequest.utils.js.map +1 -1
  55. package/dist/git/watching/changeEvent.d.ts +6 -1
  56. package/dist/git/watching/changeEvent.d.ts.map +1 -1
  57. package/dist/git/watching/classifyChange.d.ts.map +1 -1
  58. package/dist/git/watching/classifyChange.js +14 -1
  59. package/dist/git/watching/classifyChange.js.map +1 -1
  60. package/dist/git/watching/watchService.d.ts.map +1 -1
  61. package/dist/git/watching/watchService.js +18 -3
  62. package/dist/git/watching/watchService.js.map +1 -1
  63. package/dist/git/watching/watchSession.d.ts +8 -1
  64. package/dist/git/watching/watchSession.d.ts.map +1 -1
  65. package/dist/git/watching/watchSession.js +38 -6
  66. package/dist/git/watching/watchSession.js.map +1 -1
  67. package/dist/git/watching/watcherPatterns.d.ts +2 -2
  68. package/dist/git/watching/watcherPatterns.d.ts.map +1 -1
  69. package/dist/git/watching/watcherPatterns.js +1 -1
  70. package/dist/git/watching/watcherPatterns.js.map +1 -1
  71. package/dist/git-cli/exec/git.d.ts +1 -1
  72. package/dist/git-cli/exec/git.d.ts.map +1 -1
  73. package/dist/git-cli/exec/git.js +13 -3
  74. package/dist/git-cli/exec/git.js.map +1 -1
  75. package/dist/git-cli/providers/branches.d.ts +19 -0
  76. package/dist/git-cli/providers/branches.d.ts.map +1 -1
  77. package/dist/git-cli/providers/branches.js +282 -78
  78. package/dist/git-cli/providers/branches.js.map +1 -1
  79. package/dist/git-cli/providers/commits.d.ts +4 -0
  80. package/dist/git-cli/providers/commits.d.ts.map +1 -1
  81. package/dist/git-cli/providers/commits.js +84 -11
  82. package/dist/git-cli/providers/commits.js.map +1 -1
  83. package/dist/git-cli/providers/config.d.ts +42 -0
  84. package/dist/git-cli/providers/config.d.ts.map +1 -1
  85. package/dist/git-cli/providers/config.js +186 -5
  86. package/dist/git-cli/providers/config.js.map +1 -1
  87. package/dist/git-cli/providers/contributors.d.ts.map +1 -1
  88. package/dist/git-cli/providers/contributors.js +1 -1
  89. package/dist/git-cli/providers/contributors.js.map +1 -1
  90. package/dist/git-cli/providers/graph.d.ts +2 -2
  91. package/dist/git-cli/providers/graph.d.ts.map +1 -1
  92. package/dist/git-cli/providers/graph.js +27 -9
  93. package/dist/git-cli/providers/graph.js.map +1 -1
  94. package/dist/git-cli/providers/operations.d.ts.map +1 -1
  95. package/dist/git-cli/providers/operations.js +40 -12
  96. package/dist/git-cli/providers/operations.js.map +1 -1
  97. package/dist/git-cli/providers/pausedOperations.d.ts +5 -0
  98. package/dist/git-cli/providers/pausedOperations.d.ts.map +1 -1
  99. package/dist/git-cli/providers/pausedOperations.js +87 -16
  100. package/dist/git-cli/providers/pausedOperations.js.map +1 -1
  101. package/dist/git-cli/providers/refs.d.ts +5 -3
  102. package/dist/git-cli/providers/refs.d.ts.map +1 -1
  103. package/dist/git-cli/providers/refs.js +33 -4
  104. package/dist/git-cli/providers/refs.js.map +1 -1
  105. package/dist/git-cli/providers/status.d.ts +1 -0
  106. package/dist/git-cli/providers/status.d.ts.map +1 -1
  107. package/dist/git-cli/providers/status.js +18 -3
  108. package/dist/git-cli/providers/status.js.map +1 -1
  109. package/dist/git-cli/providers/worktrees.d.ts.map +1 -1
  110. package/dist/git-cli/providers/worktrees.js +4 -0
  111. package/dist/git-cli/providers/worktrees.js.map +1 -1
  112. package/dist/git-cli/service.d.ts.map +1 -1
  113. package/dist/git-cli/service.js.map +1 -1
  114. package/dist/plus/agents/providers/claudeCodeProvider.d.ts +39 -1
  115. package/dist/plus/agents/providers/claudeCodeProvider.d.ts.map +1 -1
  116. package/dist/plus/agents/providers/claudeCodeProvider.js +978 -71
  117. package/dist/plus/agents/providers/claudeCodeProvider.js.map +1 -1
  118. package/dist/plus/agents/providers/claudeCodeTranscript.d.ts +24 -2
  119. package/dist/plus/agents/providers/claudeCodeTranscript.d.ts.map +1 -1
  120. package/dist/plus/agents/providers/claudeCodeTranscript.js +84 -9
  121. package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -1
  122. package/dist/plus/agents/types.d.ts +37 -2
  123. package/dist/plus/agents/types.d.ts.map +1 -1
  124. package/dist/plus/agents/types.js +2 -0
  125. package/dist/plus/agents/types.js.map +1 -1
  126. package/dist/plus/ai/errors.d.ts +10 -0
  127. package/dist/plus/ai/errors.d.ts.map +1 -1
  128. package/dist/plus/ai/errors.js +29 -0
  129. package/dist/plus/ai/errors.js.map +1 -1
  130. package/dist/plus/ai/models/model.d.ts +4 -0
  131. package/dist/plus/ai/models/model.d.ts.map +1 -1
  132. package/dist/plus/ai/models/model.js +51 -6
  133. package/dist/plus/ai/models/model.js.map +1 -1
  134. package/dist/plus/ai/models/promptTemplates.d.ts +1 -1
  135. package/dist/plus/ai/models/promptTemplates.d.ts.map +1 -1
  136. package/dist/plus/ai/models/provider.d.ts +60 -2
  137. package/dist/plus/ai/models/provider.d.ts.map +1 -1
  138. package/dist/plus/ai/prompts.d.ts +12 -0
  139. package/dist/plus/ai/prompts.d.ts.map +1 -1
  140. package/dist/plus/ai/prompts.js +177 -61
  141. package/dist/plus/ai/prompts.js.map +1 -1
  142. package/dist/plus/ai/providers/anthropicProvider.d.ts +10 -2
  143. package/dist/plus/ai/providers/anthropicProvider.d.ts.map +1 -1
  144. package/dist/plus/ai/providers/anthropicProvider.js +139 -46
  145. package/dist/plus/ai/providers/anthropicProvider.js.map +1 -1
  146. package/dist/plus/ai/providers/deepSeekProvider.d.ts +2 -0
  147. package/dist/plus/ai/providers/deepSeekProvider.d.ts.map +1 -1
  148. package/dist/plus/ai/providers/deepSeekProvider.js +10 -21
  149. package/dist/plus/ai/providers/deepSeekProvider.js.map +1 -1
  150. package/dist/plus/ai/providers/geminiProvider.d.ts +1 -0
  151. package/dist/plus/ai/providers/geminiProvider.d.ts.map +1 -1
  152. package/dist/plus/ai/providers/geminiProvider.js +19 -0
  153. package/dist/plus/ai/providers/geminiProvider.js.map +1 -1
  154. package/dist/plus/ai/providers/gitkrakenProvider.d.ts +5 -1
  155. package/dist/plus/ai/providers/gitkrakenProvider.d.ts.map +1 -1
  156. package/dist/plus/ai/providers/gitkrakenProvider.js +118 -3
  157. package/dist/plus/ai/providers/gitkrakenProvider.js.map +1 -1
  158. package/dist/plus/ai/providers/huggingFaceProvider.d.ts +1 -0
  159. package/dist/plus/ai/providers/huggingFaceProvider.d.ts.map +1 -1
  160. package/dist/plus/ai/providers/huggingFaceProvider.js +5 -0
  161. package/dist/plus/ai/providers/huggingFaceProvider.js.map +1 -1
  162. package/dist/plus/ai/providers/mistralProvider.d.ts +3 -1
  163. package/dist/plus/ai/providers/mistralProvider.d.ts.map +1 -1
  164. package/dist/plus/ai/providers/mistralProvider.js +99 -19
  165. package/dist/plus/ai/providers/mistralProvider.js.map +1 -1
  166. package/dist/plus/ai/providers/ollamaProvider.d.ts +4 -3
  167. package/dist/plus/ai/providers/ollamaProvider.d.ts.map +1 -1
  168. package/dist/plus/ai/providers/ollamaProvider.js +38 -3
  169. package/dist/plus/ai/providers/ollamaProvider.js.map +1 -1
  170. package/dist/plus/ai/providers/openAICompatibleProvider.d.ts +1 -0
  171. package/dist/plus/ai/providers/openAICompatibleProvider.d.ts.map +1 -1
  172. package/dist/plus/ai/providers/openAICompatibleProvider.js +4 -0
  173. package/dist/plus/ai/providers/openAICompatibleProvider.js.map +1 -1
  174. package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts +154 -5
  175. package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts.map +1 -1
  176. package/dist/plus/ai/providers/openAICompatibleProviderBase.js +259 -10
  177. package/dist/plus/ai/providers/openAICompatibleProviderBase.js.map +1 -1
  178. package/dist/plus/ai/providers/openRouterProvider.d.ts +4 -0
  179. package/dist/plus/ai/providers/openRouterProvider.d.ts.map +1 -1
  180. package/dist/plus/ai/providers/openRouterProvider.js +9 -0
  181. package/dist/plus/ai/providers/openRouterProvider.js.map +1 -1
  182. package/dist/plus/ai/providers/openaiProvider.d.ts +1 -0
  183. package/dist/plus/ai/providers/openaiProvider.d.ts.map +1 -1
  184. package/dist/plus/ai/providers/openaiProvider.js +1 -0
  185. package/dist/plus/ai/providers/openaiProvider.js.map +1 -1
  186. package/dist/plus/ai/providers/responseFormatCache.d.ts +8 -0
  187. package/dist/plus/ai/providers/responseFormatCache.d.ts.map +1 -0
  188. package/dist/plus/ai/providers/responseFormatCache.js +25 -0
  189. package/dist/plus/ai/providers/responseFormatCache.js.map +1 -0
  190. package/dist/plus/ai/providers/xaiProvider.d.ts +1 -0
  191. package/dist/plus/ai/providers/xaiProvider.d.ts.map +1 -1
  192. package/dist/plus/ai/providers/xaiProvider.js +10 -1
  193. package/dist/plus/ai/providers/xaiProvider.js.map +1 -1
  194. package/dist/plus/ai/utils/ai.utils.d.ts +3 -0
  195. package/dist/plus/ai/utils/ai.utils.d.ts.map +1 -1
  196. package/dist/plus/ai/utils/ai.utils.js +13 -0
  197. package/dist/plus/ai/utils/ai.utils.js.map +1 -1
  198. package/dist/plus/ai/utils/results.utils.d.ts +16 -2
  199. package/dist/plus/ai/utils/results.utils.d.ts.map +1 -1
  200. package/dist/plus/ai/utils/results.utils.js +204 -28
  201. package/dist/plus/ai/utils/results.utils.js.map +1 -1
  202. package/dist/plus/git-github/api/github.d.ts +55 -0
  203. package/dist/plus/git-github/api/github.d.ts.map +1 -1
  204. package/dist/plus/git-github/api/github.js +177 -4
  205. package/dist/plus/git-github/api/github.js.map +1 -1
  206. package/dist/plus/git-github/models.d.ts +16 -0
  207. package/dist/plus/git-github/models.d.ts.map +1 -1
  208. package/dist/plus/git-github/models.js +29 -3
  209. package/dist/plus/git-github/models.js.map +1 -1
  210. package/dist/plus/git-github/providers/github/status.d.ts +1 -0
  211. package/dist/plus/git-github/providers/github/status.d.ts.map +1 -1
  212. package/dist/plus/git-github/providers/github/status.js.map +1 -1
  213. package/dist/plus/integrations/context.d.ts +4 -0
  214. package/dist/plus/integrations/context.d.ts.map +1 -1
  215. package/dist/plus/integrations/index.d.ts.map +1 -1
  216. package/dist/plus/integrations/index.js +2 -0
  217. package/dist/plus/integrations/index.js.map +1 -1
  218. package/dist/plus/integrations/models/gitHostIntegration.d.ts +6 -3
  219. package/dist/plus/integrations/models/gitHostIntegration.d.ts.map +1 -1
  220. package/dist/plus/integrations/models/gitHostIntegration.js +12 -2
  221. package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
  222. package/dist/plus/integrations/models/integration.d.ts +3 -1
  223. package/dist/plus/integrations/models/integration.d.ts.map +1 -1
  224. package/dist/plus/integrations/models/integration.js +2 -2
  225. package/dist/plus/integrations/models/integration.js.map +1 -1
  226. package/dist/plus/integrations/providers/accounts.d.ts.map +1 -1
  227. package/dist/plus/integrations/providers/accounts.js +4 -0
  228. package/dist/plus/integrations/providers/accounts.js.map +1 -1
  229. package/dist/plus/integrations/providers/azure/models.d.ts.map +1 -1
  230. package/dist/plus/integrations/providers/azure/models.js +3 -0
  231. package/dist/plus/integrations/providers/azure/models.js.map +1 -1
  232. package/dist/plus/integrations/providers/bitbucket/models.d.ts.map +1 -1
  233. package/dist/plus/integrations/providers/bitbucket/models.js +1 -0
  234. package/dist/plus/integrations/providers/bitbucket/models.js.map +1 -1
  235. package/dist/plus/integrations/providers/github.d.ts +14 -2
  236. package/dist/plus/integrations/providers/github.d.ts.map +1 -1
  237. package/dist/plus/integrations/providers/github.js +55 -3
  238. package/dist/plus/integrations/providers/github.js.map +1 -1
  239. package/dist/plus/integrations/providers/gitlab.d.ts.map +1 -1
  240. package/dist/plus/integrations/providers/gitlab.js.map +1 -1
  241. package/dist/plus/integrations/providers/models.d.ts.map +1 -1
  242. package/dist/plus/integrations/providers/models.js +30 -4
  243. package/dist/plus/integrations/providers/models.js.map +1 -1
  244. package/dist/plus/integrations/reads/broaden.d.ts.map +1 -1
  245. package/dist/plus/integrations/reads/broaden.js +6 -1
  246. package/dist/plus/integrations/reads/broaden.js.map +1 -1
  247. package/dist/plus/integrations/reads/drains.d.ts.map +1 -1
  248. package/dist/plus/integrations/reads/drains.js +7 -4
  249. package/dist/plus/integrations/reads/drains.js.map +1 -1
  250. package/dist/plus/integrations/reads/hierarchy.d.ts.map +1 -1
  251. package/dist/plus/integrations/reads/hierarchy.js +3 -1
  252. package/dist/plus/integrations/reads/hierarchy.js.map +1 -1
  253. package/dist/plus/integrations/reads/issueTracker.d.ts.map +1 -1
  254. package/dist/plus/integrations/reads/issueTracker.js +8 -3
  255. package/dist/plus/integrations/reads/issueTracker.js.map +1 -1
  256. package/dist/plus/integrations/reads/issues.d.ts.map +1 -1
  257. package/dist/plus/integrations/reads/issues.js +9 -4
  258. package/dist/plus/integrations/reads/issues.js.map +1 -1
  259. package/dist/plus/integrations/reads/pullRequests.d.ts.map +1 -1
  260. package/dist/plus/integrations/reads/pullRequests.js +9 -4
  261. package/dist/plus/integrations/reads/pullRequests.js.map +1 -1
  262. package/dist/utils/env/browser/base64.d.ts +1 -1
  263. package/dist/utils/env/browser/base64.d.ts.map +1 -1
  264. package/dist/utils/env/node/base64.d.ts +1 -1
  265. package/dist/utils/env/node/base64.d.ts.map +1 -1
  266. package/dist/utils/env/node/base64.js +2 -0
  267. package/dist/utils/env/node/base64.js.map +1 -1
  268. package/dist/utils/keys/chord.d.ts +52 -0
  269. package/dist/utils/keys/chord.d.ts.map +1 -0
  270. package/dist/utils/keys/chord.js +135 -0
  271. package/dist/utils/keys/chord.js.map +1 -0
  272. package/dist/utils/keys/keybinding.d.ts +53 -0
  273. package/dist/utils/keys/keybinding.d.ts.map +1 -0
  274. package/dist/utils/keys/keybinding.js +58 -0
  275. package/dist/utils/keys/keybinding.js.map +1 -0
  276. package/dist/utils/path.d.ts +11 -0
  277. package/dist/utils/path.d.ts.map +1 -1
  278. package/dist/utils/path.js +13 -0
  279. package/dist/utils/path.js.map +1 -1
  280. package/package.json +13 -5
  281. package/src/git/cache.ts +383 -47
  282. package/src/git/context.ts +11 -0
  283. package/src/git/models/fileStatus.ts +1 -0
  284. package/src/git/models/issue.ts +4 -0
  285. package/src/git/models/mergeConflicts.ts +3 -2
  286. package/src/git/models/pullRequest.ts +33 -1
  287. package/src/git/models/repository.ts +58 -17
  288. package/src/git/models/statusFile.ts +3 -0
  289. package/src/git/providers/branches.ts +6 -0
  290. package/src/git/providers/commits.ts +11 -0
  291. package/src/git/providers/config.ts +18 -0
  292. package/src/git/providers/operations.ts +1 -0
  293. package/src/git/providers/pausedOperations.ts +2 -0
  294. package/src/git/providers/status.ts +1 -0
  295. package/src/git/utils/config.utils.ts +8 -0
  296. package/src/git/utils/issue.utils.ts +2 -0
  297. package/src/git/utils/pausedOperationStatus.utils.ts +28 -0
  298. package/src/git/utils/pullRequest.utils.ts +36 -0
  299. package/src/git/watching/changeEvent.ts +6 -1
  300. package/src/git/watching/classifyChange.ts +15 -1
  301. package/src/git/watching/watchService.ts +20 -3
  302. package/src/git/watching/watchSession.ts +41 -6
  303. package/src/git/watching/watcherPatterns.ts +1 -1
  304. package/src/git-cli/exec/git.ts +13 -3
  305. package/src/git-cli/providers/branches.ts +384 -132
  306. package/src/git-cli/providers/commits.ts +106 -15
  307. package/src/git-cli/providers/config.ts +229 -8
  308. package/src/git-cli/providers/contributors.ts +5 -1
  309. package/src/git-cli/providers/graph.ts +26 -13
  310. package/src/git-cli/providers/operations.ts +45 -20
  311. package/src/git-cli/providers/pausedOperations.ts +109 -17
  312. package/src/git-cli/providers/refs.ts +33 -3
  313. package/src/git-cli/providers/status.ts +25 -4
  314. package/src/git-cli/providers/worktrees.ts +5 -0
  315. package/src/git-cli/service.ts +0 -1
  316. package/src/plus/agents/providers/claudeCodeProvider.ts +1130 -87
  317. package/src/plus/agents/providers/claudeCodeTranscript.ts +95 -9
  318. package/src/plus/agents/types.ts +46 -2
  319. package/src/plus/ai/errors.ts +30 -0
  320. package/src/plus/ai/models/model.ts +56 -6
  321. package/src/plus/ai/models/promptTemplates.ts +1 -1
  322. package/src/plus/ai/models/provider.ts +69 -2
  323. package/src/plus/ai/prompts.ts +186 -61
  324. package/src/plus/ai/providers/anthropicProvider.ts +155 -47
  325. package/src/plus/ai/providers/deepSeekProvider.ts +11 -21
  326. package/src/plus/ai/providers/geminiProvider.ts +19 -0
  327. package/src/plus/ai/providers/gitkrakenProvider.ts +126 -3
  328. package/src/plus/ai/providers/huggingFaceProvider.ts +6 -0
  329. package/src/plus/ai/providers/mistralProvider.ts +102 -19
  330. package/src/plus/ai/providers/ollamaProvider.ts +55 -4
  331. package/src/plus/ai/providers/openAICompatibleProvider.ts +5 -0
  332. package/src/plus/ai/providers/openAICompatibleProviderBase.ts +360 -17
  333. package/src/plus/ai/providers/openRouterProvider.ts +17 -0
  334. package/src/plus/ai/providers/openaiProvider.ts +1 -0
  335. package/src/plus/ai/providers/responseFormatCache.ts +39 -0
  336. package/src/plus/ai/providers/xaiProvider.ts +10 -1
  337. package/src/plus/ai/utils/ai.utils.ts +14 -0
  338. package/src/plus/ai/utils/results.utils.ts +255 -31
  339. package/src/plus/git-github/api/github.ts +291 -7
  340. package/src/plus/git-github/models.ts +48 -2
  341. package/src/plus/git-github/providers/github/status.ts +1 -0
  342. package/src/plus/integrations/context.ts +4 -0
  343. package/src/plus/integrations/index.ts +2 -0
  344. package/src/plus/integrations/models/gitHostIntegration.ts +25 -2
  345. package/src/plus/integrations/models/integration.ts +23 -13
  346. package/src/plus/integrations/providers/accounts.ts +4 -0
  347. package/src/plus/integrations/providers/azure/models.ts +3 -0
  348. package/src/plus/integrations/providers/bitbucket/models.ts +1 -0
  349. package/src/plus/integrations/providers/github.ts +85 -1
  350. package/src/plus/integrations/providers/gitlab.ts +2 -10
  351. package/src/plus/integrations/providers/models.ts +36 -4
  352. package/src/plus/integrations/reads/broaden.ts +6 -1
  353. package/src/plus/integrations/reads/drains.ts +7 -4
  354. package/src/plus/integrations/reads/hierarchy.ts +3 -1
  355. package/src/plus/integrations/reads/issueTracker.ts +9 -3
  356. package/src/plus/integrations/reads/issues.ts +9 -4
  357. package/src/plus/integrations/reads/pullRequests.ts +9 -4
  358. package/src/utils/env/browser/base64.ts +1 -1
  359. package/src/utils/env/node/base64.ts +3 -1
  360. package/src/utils/keys/chord.ts +184 -0
  361. package/src/utils/keys/keybinding.ts +116 -0
  362. package/src/utils/path.ts +14 -0
@@ -1,4 +1,5 @@
1
1
  import type { PromptTemplate } from './models/promptTemplates.js';
2
+ import type { AIResponseFormat, JSONSchema } from './models/provider.js';
2
3
 
3
4
  export const generateCommitMessage: PromptTemplate<'generate-commitMessage'> = {
4
5
  id: 'generate-commitMessage_v2',
@@ -326,8 +327,19 @@ User Query: \${query}
326
327
  Convert the user's natural language query into the appropriate search operators. Return only the search query string without any explanatory text. If the query cannot be converted to search operators, return the original query as a message search. For complex temporal expressions that might be ambiguous, prefer simpler, more reliable relative date formats.`,
327
328
  };
328
329
 
330
+ /** Example output block shared by the {@link generateCommits} template and its structural-retry prompt */
331
+ export const generateCommitsExampleJson = `{
332
+ "commits": [
333
+ {
334
+ "message": "[commit message here]",
335
+ "explanation": "[detailed explanation of changes here]",
336
+ "hunks": [{"hunk": [index from hunk_map]}, {"hunk": [index from hunk_map]}]
337
+ }
338
+ ]
339
+ }`;
340
+
329
341
  export const generateCommits: PromptTemplate<'generate-commits'> = {
330
- id: 'generate-commits_v2',
342
+ id: 'generate-commits_v3',
331
343
  variables: ['hunks', 'existingCommits', 'commitMessages', 'hunkMap', 'instructions'],
332
344
  template: `You are an advanced AI programming assistant tasked with organizing code changes into commits. Your goal is to create a complete set of commits that are related, grouped logically, atomic, and easy to review. You will be working with individual code hunks and may have some existing commits that already have hunks assigned.
333
345
 
@@ -392,22 +404,14 @@ Follow these guidelines:
392
404
 
393
405
  8. Write a detailed explanation for each commit (separate from the commit message), walking through the changes in further detail as if explaining them to a reviewer.
394
406
 
395
- Output your complete commit organization as a JSON array. Each commit in the array should be an object with the following properties:
407
+ Output your complete commit organization as a single JSON object with a "commits" property. The "commits" property is an array where each commit is an object with the following properties:
396
408
  - "message": A string containing the commit message
397
409
  - "explanation": A string with a detailed explanation of the changes in the commit. Note that this is separate from the commit message and provides more detail than in the message itself.
398
410
  - "hunks": An array of objects, each representing a hunk in the commit. Each hunk object should have:
399
411
  - "hunk": The hunk index (number) from the hunk_map
400
412
 
401
- Write the JSON structure below inside a <output> tag and include no other text:
402
- <output>
403
- [
404
- {
405
- "message": "[commit message here]",
406
- "explanation": "[detailed explanation of changes here]",
407
- "hunks": [{"hunk": [index from hunk_map]}, {"hunk": [index from hunk_map]}]
408
- }
409
- ]
410
- </output>
413
+ Example output structure:
414
+ ${generateCommitsExampleJson}
411
415
 
412
416
  Remember:
413
417
  - Text in [] brackets above should be replaced with your own text, not including the brackets
@@ -418,10 +422,43 @@ Remember:
418
422
 
419
423
  \${instructions}
420
424
 
421
- Now, proceed with your analysis and organization of the commits. Return only the <output> tag and no other text.
425
+ Now, proceed with your analysis and organization of the commits. Return only the JSON object and no other text — no code fences, no XML tags, and no explanatory text.
422
426
  `,
423
427
  };
424
428
 
429
+ /** Schema counterpart of the {@link generateCommits} template's described output shape */
430
+ export const generateCommitsSchema: AIResponseFormat = {
431
+ name: 'generate_commits',
432
+ schema: {
433
+ type: 'object',
434
+ additionalProperties: false,
435
+ required: ['commits'],
436
+ properties: {
437
+ commits: {
438
+ type: 'array',
439
+ items: {
440
+ type: 'object',
441
+ additionalProperties: false,
442
+ required: ['message', 'explanation', 'hunks'],
443
+ properties: {
444
+ message: { type: 'string', description: 'The commit message' },
445
+ explanation: { type: 'string', description: 'Detailed explanation of the changes' },
446
+ hunks: {
447
+ type: 'array',
448
+ items: {
449
+ type: 'object',
450
+ additionalProperties: false,
451
+ required: ['hunk'],
452
+ properties: { hunk: { type: 'integer', description: 'Hunk index from the hunk_map' } },
453
+ },
454
+ },
455
+ },
456
+ },
457
+ },
458
+ },
459
+ },
460
+ };
461
+
425
462
  export const startWorkFromIssue: PromptTemplate<'start-work-issue'> = {
426
463
  id: 'start-work-issue',
427
464
  variables: ['issue', 'instructions'],
@@ -479,8 +516,11 @@ You can use GitKraken MCP tools to gather additional context about the repositor
479
516
  Now, proceed with your analysis and provide a comprehensive review of the PR. Return only the relevant information without any additional text.`,
480
517
  };
481
518
 
519
+ // Shared by the reviewChanges and reviewDetail templates so line-citation rules can't drift apart
520
+ const lineCitationGuidance = `- For "lines", copy the "start" and "end" numbers from the \`[NNNNN]\` annotations of the specific lines your finding concerns. Do not count, infer, or estimate — use only the annotated numbers. Removed lines (blank brackets \`[ ]\`) cannot be cited; pick the nearest surrounding new-file line instead. Anchor the range tightly to the lines the finding actually concerns; do not span an entire hunk. If a finding is not tied to specific lines, set "lines" to null; if not tied to a single file, set "file" to null`;
521
+
482
522
  export const reviewChanges: PromptTemplate<'review-changes'> = {
483
- id: 'review-changes',
523
+ id: 'review-changes_v2',
484
524
  variables: ['diff', 'message', 'context', 'instructions'],
485
525
  template: `You are an expert code reviewer analyzing a set of code changes. Your goal is to identify meaningful issues — bugs, logic errors, security vulnerabilities, missing error handling, and potential regressions — while ignoring style preferences and linter-level concerns. Focus on problems a careful human reviewer would catch.
486
526
 
@@ -501,40 +541,117 @@ Author's description of the changes:
501
541
  Related work items (known pull requests and issues for this change set). Use these for *intent*: what the change is trying to accomplish. They are not authoritative spec — if a finding contradicts the stated intent, flag it rather than defer to it. May be empty.
502
542
  \${context}
503
543
 
504
- Produce a structured review in the following XML format. Include ONLY the XML tags described — no other text:
505
-
506
- <overview>
507
- A concise 1-3 sentence summary of what these changes do and their overall quality. Note any systemic concerns.
508
- </overview>
509
- <focus-areas>
510
- <area severity="critical|warning|suggestion" files="comma-separated file paths">
511
- <label>Short title of the concern (under 60 chars)</label>
512
- <rationale>Why this matters — what could go wrong or what is suboptimal</rationale>
513
- <findings>
514
- <finding severity="critical|warning|suggestion" file="path/to/file.ts" lines="start-end">
515
- <title>Specific issue title</title>
516
- <description>Clear explanation of the problem and how to address it</description>
517
- </finding>
518
- </findings>
519
- </area>
520
- </focus-areas>
544
+ Produce a structured review as a single JSON object with this exact structure:
545
+
546
+ {
547
+ "overview": "A concise 1-3 sentence summary of what these changes do and their overall quality. Note any systemic concerns.",
548
+ "focusAreas": [
549
+ {
550
+ "label": "Short title of the concern (under 60 chars)",
551
+ "rationale": "Why this matters what could go wrong or what is suboptimal",
552
+ "severity": "critical|warning|suggestion",
553
+ "files": ["path/to/file.ts"],
554
+ "findings": [
555
+ {
556
+ "severity": "critical|warning|suggestion",
557
+ "title": "Specific issue title",
558
+ "description": "Clear explanation of the problem and how to address it",
559
+ "file": "path/to/file.ts",
560
+ "lines": { "start": 42, "end": 45 }
561
+ }
562
+ ]
563
+ }
564
+ ]
565
+ }
521
566
 
522
567
  Guidelines:
523
568
  - Severity levels: "critical" = bugs, security issues, data loss risks; "warning" = logic concerns, missing error handling, potential regressions; "suggestion" = improvements, maintainability, performance
524
569
  - Group related findings into focus areas by theme, not by file
525
- - If changes look correct and well-structured, say so in the overview and include zero focus areas
570
+ - If changes look correct and well-structured, say so in the overview and use an empty "focusAreas" array
526
571
  - 3-5 high-quality findings are better than 15 low-quality ones
527
- - For \`lines="start-end"\`, copy the numbers from the \`[NNNNN]\` annotations of the specific lines your finding concerns. Do not count, infer, or estimate — use only the annotated numbers. Removed lines (blank brackets \`[ ]\`) cannot be cited; pick the nearest surrounding new-file line instead. Anchor the range tightly to the lines the finding actually concerns; do not span an entire hunk.
572
+ ${lineCitationGuidance}
528
573
  - Do not flag style issues, naming preferences, or things a linter would catch
529
574
  - Base conclusions only on the code shown — do not speculate about unseen code
530
575
 
531
576
  \${instructions}
532
577
 
533
- Review the changes and produce the structured XML output above.`,
578
+ Review the changes and return only the JSON object above — no other text, no code fences.`,
579
+ };
580
+
581
+ // Nullable so the same schema passes OpenAI strict mode (all properties required, optionals as
582
+ // null-unions) and Anthropic's structured outputs (which allow optionals natively)
583
+ const reviewFindingSchema: JSONSchema = {
584
+ type: 'object',
585
+ additionalProperties: false,
586
+ required: ['severity', 'title', 'description', 'file', 'lines'],
587
+ properties: {
588
+ severity: { type: 'string', enum: ['critical', 'warning', 'suggestion'] },
589
+ title: { type: 'string' },
590
+ description: { type: 'string' },
591
+ file: { type: ['string', 'null'] },
592
+ lines: {
593
+ type: ['object', 'null'],
594
+ additionalProperties: false,
595
+ required: ['start', 'end'],
596
+ properties: { start: { type: 'integer' }, end: { type: 'integer' } },
597
+ },
598
+ },
599
+ };
600
+
601
+ function buildReviewResultSchema(name: string, findings: JSONSchema): AIResponseFormat {
602
+ return {
603
+ name: name,
604
+ schema: {
605
+ type: 'object',
606
+ additionalProperties: false,
607
+ required: ['overview', 'focusAreas'],
608
+ properties: {
609
+ overview: { type: 'string' },
610
+ focusAreas: {
611
+ type: 'array',
612
+ items: {
613
+ type: 'object',
614
+ additionalProperties: false,
615
+ required: ['label', 'rationale', 'severity', 'files', 'findings'],
616
+ properties: {
617
+ label: { type: 'string' },
618
+ rationale: { type: 'string' },
619
+ severity: { type: 'string', enum: ['critical', 'warning', 'suggestion'] },
620
+ files: { type: 'array', items: { type: 'string' } },
621
+ findings: findings,
622
+ },
623
+ },
624
+ },
625
+ },
626
+ },
627
+ };
628
+ }
629
+
630
+ /** Schema counterpart of the {@link reviewChanges} template's output shape */
631
+ export const reviewResultSchema: AIResponseFormat = buildReviewResultSchema('review_result', {
632
+ type: ['array', 'null'],
633
+ items: reviewFindingSchema,
634
+ });
635
+
636
+ /** Schema counterpart of the {@link reviewOverview} template — the manifest-only pass has no diffs,
637
+ * so the grammar itself forbids findings (the template mandates `"findings": null`) */
638
+ export const reviewOverviewSchema: AIResponseFormat = buildReviewResultSchema('review_overview', { type: 'null' });
639
+
640
+ /** Schema counterpart of the {@link reviewDetail} template's output shape */
641
+ export const reviewDetailSchema: AIResponseFormat = {
642
+ name: 'review_detail',
643
+ schema: {
644
+ type: 'object',
645
+ additionalProperties: false,
646
+ required: ['findings'],
647
+ properties: {
648
+ findings: { type: 'array', items: reviewFindingSchema },
649
+ },
650
+ },
534
651
  };
535
652
 
536
653
  export const reviewOverview: PromptTemplate<'review-overview'> = {
537
- id: 'review-overview',
654
+ id: 'review-overview_v2',
538
655
  variables: ['files', 'message', 'context', 'instructions'],
539
656
  template: `You are an expert code reviewer performing an initial assessment of a set of code changes. You are given a file manifest (not full diffs) — use the file paths, change types, and line counts to identify which areas deserve closer inspection.
540
657
 
@@ -551,32 +668,35 @@ Author's description of the changes:
551
668
  Related work items (known pull requests and issues for this change set). Use these for *intent* — what the change is trying to accomplish — when ranking which areas deserve closer review. May be empty.
552
669
  \${context}
553
670
 
554
- Produce a structured assessment in the following XML format. Include ONLY the XML tags described — no other text:
555
-
556
- <overview>
557
- A concise 1-3 sentence summary of the scope and nature of these changes based on the file manifest and description.
558
- </overview>
559
- <focus-areas>
560
- <area severity="critical|warning|suggestion" files="comma-separated file paths">
561
- <label>Short title of the area to inspect (under 60 chars)</label>
562
- <rationale>Why this area deserves closer review — based on the types of files changed, the volume of changes, and potential risk</rationale>
563
- </area>
564
- </focus-areas>
671
+ Produce a structured assessment as a single JSON object with this exact structure:
672
+
673
+ {
674
+ "overview": "A concise 1-3 sentence summary of the scope and nature of these changes based on the file manifest and description.",
675
+ "focusAreas": [
676
+ {
677
+ "label": "Short title of the area to inspect (under 60 chars)",
678
+ "rationale": "Why this area deserves closer review — based on the types of files changed, the volume of changes, and potential risk",
679
+ "severity": "critical|warning|suggestion",
680
+ "files": ["path/to/file.ts"],
681
+ "findings": null
682
+ }
683
+ ]
684
+ }
565
685
 
566
686
  Guidelines:
567
687
  - Severity reflects potential risk: "critical" = security-sensitive files, auth/crypto/payment paths, database migrations; "warning" = core logic changes, API changes, large modifications; "suggestion" = refactoring, config changes, documentation
568
688
  - Rank focus areas from highest to lowest risk
569
689
  - Group related files into focus areas by theme
570
690
  - Include 2-6 focus areas. If changes are very simple, fewer is fine
571
- - Do NOT include <findings>those come in a later pass when full diffs are available
691
+ - Always set "findings" to null findings come in a later pass when full diffs are available
572
692
 
573
693
  \${instructions}
574
694
 
575
- Assess the changes and produce the structured XML output above.`,
695
+ Assess the changes and return only the JSON object above — no other text, no code fences.`,
576
696
  };
577
697
 
578
698
  export const reviewRefine: PromptTemplate<'review-refine'> = {
579
- id: 'review-refine',
699
+ id: 'review-refine_v2',
580
700
  variables: ['instructions'],
581
701
  template: `The user has follow-up guidance for the review you produced above. Produce an updated review that incorporates it:
582
702
  - Keep prior findings that remain valid — do not drop them just because the guidance doesn't mention them
@@ -588,7 +708,7 @@ export const reviewRefine: PromptTemplate<'review-refine'> = {
588
708
  \${instructions}
589
709
  </~~instructions~~>
590
710
 
591
- Produce the full updated review in the same structured XML format as your previous response (<overview> + <focus-areas>). Include ONLY the XML tags — no other text.`,
711
+ Produce the full updated review as a single JSON object in the same structure as your previous response. Return only the JSON object — no other text, no code fences.`,
592
712
  };
593
713
 
594
714
  export const addressReviewFindings: PromptTemplate<'address-review-findings'> = {
@@ -616,7 +736,7 @@ Guidelines:
616
736
  };
617
737
 
618
738
  export const reviewDetail: PromptTemplate<'review-detail'> = {
619
- id: 'review-detail',
739
+ id: 'review-detail_v2',
620
740
  variables: ['diff', 'overview', 'message', 'focusArea', 'context', 'instructions'],
621
741
  template: `You are an expert code reviewer performing a detailed inspection of specific files that were flagged for closer review. You have the context from an initial overview assessment.
622
742
 
@@ -644,23 +764,28 @@ Code changes for the files in this focus area (Git diff format). Each non-header
644
764
  \${diff}
645
765
  </~~diff~~>
646
766
 
647
- Produce detailed findings in the following XML format. Include ONLY the XML tags — no other text:
767
+ Produce detailed findings as a single JSON object with this exact structure:
648
768
 
649
- <findings>
650
- <finding severity="critical|warning|suggestion" file="path/to/file.ts" lines="start-end">
651
- <title>Specific issue title</title>
652
- <description>Clear explanation of the problem and how to address it</description>
653
- </finding>
654
- </findings>
769
+ {
770
+ "findings": [
771
+ {
772
+ "severity": "critical|warning|suggestion",
773
+ "title": "Specific issue title",
774
+ "description": "Clear explanation of the problem and how to address it",
775
+ "file": "path/to/file.ts",
776
+ "lines": { "start": 42, "end": 45 }
777
+ }
778
+ ]
779
+ }
655
780
 
656
781
  Guidelines:
657
782
  - Severity: "critical" = bugs, security, data loss; "warning" = logic concerns, error handling, regressions; "suggestion" = improvements, maintainability
658
- - For \`lines="start-end"\`, copy the numbers from the \`[NNNNN]\` annotations of the specific lines your finding concerns. Do not count, infer, or estimate — use only the annotated numbers. Removed lines (blank brackets \`[ ]\`) cannot be cited; pick the nearest surrounding new-file line instead. Anchor the range tightly to the lines the finding actually concerns; do not span an entire hunk.
783
+ ${lineCitationGuidance}
659
784
  - Be concrete — explain what the problem is and how to fix it
660
- - If the code in this area looks correct, return an empty <findings></findings> block
785
+ - If the code in this area looks correct, return {"findings": []}
661
786
  - Do not flag style issues or things a linter would catch
662
787
 
663
788
  \${instructions}
664
789
 
665
- Inspect the diff for this focus area and produce the structured XML findings above.`,
790
+ Inspect the diff for this focus area and return only the JSON object above — no other text, no code fences.`,
666
791
  };