@myrialabs/clopen 0.4.49 → 0.4.51

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 (486) hide show
  1. package/README.md +2 -1
  2. package/backend/chat/attachments.test.ts +106 -17
  3. package/backend/chat/attachments.ts +131 -34
  4. package/backend/chat/background-wait.test.ts +28 -0
  5. package/backend/chat/engine-handoff.ts +42 -6
  6. package/backend/chat/message-pages.test.ts +17 -0
  7. package/backend/chat/message-pages.ts +6 -2
  8. package/backend/chat/stream-manager.ts +114 -19
  9. package/backend/containers/actions.ts +22 -0
  10. package/backend/control/actions/projects.ts +93 -37
  11. package/backend/control/folders.test.ts +27 -2
  12. package/backend/control/index.ts +2 -1
  13. package/backend/database/migrations/056_support_mssql_driver.ts +7 -0
  14. package/backend/database/migrations/077_create_integration_db_links.ts +7 -0
  15. package/backend/database/migrations/086_single_owner.ts +66 -73
  16. package/backend/database/migrations/088_create_messages_fts_map.ts +52 -0
  17. package/backend/database/migrations/089_add_memory_layout_tiles.ts +58 -0
  18. package/backend/database/migrations/090_create_storage_tables.ts +83 -0
  19. package/backend/database/migrations/index.ts +25 -2
  20. package/backend/database/queries/graph-queries.ts +392 -135
  21. package/backend/database/queries/integration-queries.ts +10 -0
  22. package/backend/database/queries/memory-queue-queries.ts +11 -0
  23. package/backend/database/queries/message-fts.test.ts +120 -0
  24. package/backend/database/queries/message-queries.ts +45 -9
  25. package/backend/database/queries/project-queries.ts +6 -0
  26. package/backend/database/queries/session-queries.ts +6 -2
  27. package/backend/database/queries/utils-queries.ts +3 -0
  28. package/backend/database/utils/migration-runner.test.ts +196 -0
  29. package/backend/database/utils/migration-runner.ts +61 -16
  30. package/backend/database/utils/seeder-runner.ts +22 -16
  31. package/backend/engine/adapters/claude/environment.ts +4 -0
  32. package/backend/engine/adapters/claude/input-gate.test.ts +59 -0
  33. package/backend/engine/adapters/claude/input-gate.ts +74 -0
  34. package/backend/engine/adapters/claude/message-converter.test.ts +16 -0
  35. package/backend/engine/adapters/claude/message-converter.ts +8 -0
  36. package/backend/engine/adapters/claude/stream.ts +20 -0
  37. package/backend/engine/adapters/cursor/environment.ts +1 -1
  38. package/backend/engine/adapters/qwen/session-store.ts +10 -1
  39. package/backend/engine/types.ts +7 -0
  40. package/backend/git/identity/cli.ts +35 -0
  41. package/backend/git/identity/env.test.ts +52 -1
  42. package/backend/git/identity/env.ts +69 -10
  43. package/backend/git/identity/index.ts +25 -6
  44. package/backend/git/identity/resolve.ts +2 -1
  45. package/backend/git/identity/scope-config.test.ts +7 -4
  46. package/backend/git/identity/scope-config.ts +13 -7
  47. package/backend/git-hosts/accounts.ts +106 -0
  48. package/backend/git-hosts/auth/client-ids.ts +34 -0
  49. package/backend/git-hosts/auth/connect.ts +110 -0
  50. package/backend/git-hosts/auth/endpoints.ts +130 -0
  51. package/backend/git-hosts/auth/flows.ts +355 -0
  52. package/backend/git-hosts/auth/local.ts +152 -0
  53. package/backend/git-hosts/ci.ts +18 -0
  54. package/backend/git-hosts/cli.test.ts +82 -0
  55. package/backend/git-hosts/cli.ts +342 -0
  56. package/backend/git-hosts/credentials.ts +173 -0
  57. package/backend/git-hosts/git-credential.ts +30 -0
  58. package/backend/git-hosts/health.ts +39 -0
  59. package/backend/git-hosts/http.ts +174 -0
  60. package/backend/git-hosts/index.ts +34 -0
  61. package/backend/git-hosts/providers/bitbucket.ts +186 -0
  62. package/backend/git-hosts/providers/gitea.ts +208 -0
  63. package/backend/git-hosts/providers/github.ts +270 -0
  64. package/backend/git-hosts/providers/gitlab-client.ts +70 -0
  65. package/backend/git-hosts/providers/gitlab.ts +285 -0
  66. package/backend/git-hosts/providers/locators.test.ts +68 -0
  67. package/backend/git-hosts/registry.ts +50 -0
  68. package/backend/git-hosts/service.ts +432 -0
  69. package/backend/git-hosts/types.ts +82 -0
  70. package/backend/git-hosts/urls.test.ts +42 -0
  71. package/backend/git-hosts/urls.ts +69 -0
  72. package/backend/index.ts +84 -17
  73. package/backend/integrations/accounts.ts +50 -3
  74. package/backend/integrations/registry/define.ts +9 -0
  75. package/backend/integrations/registry/index.ts +11 -0
  76. package/backend/integrations/registry/providers/bitbucket.ts +51 -0
  77. package/backend/integrations/registry/providers/gitea.ts +53 -0
  78. package/backend/integrations/registry/providers/github.ts +24 -7
  79. package/backend/integrations/registry/providers/gitlab.ts +57 -0
  80. package/backend/integrations/registry/types.ts +13 -1
  81. package/backend/mcp/internal/servers/browser-automation/actions/inspect.ts +115 -31
  82. package/backend/mcp/internal/servers/browser-automation/description.ts +5 -0
  83. package/backend/memory/README.md +7 -4
  84. package/backend/memory/layout.test.ts +377 -0
  85. package/backend/memory/layout.ts +1029 -265
  86. package/backend/memory/view.ts +257 -386
  87. package/backend/mentions/diff.ts +63 -0
  88. package/backend/mentions/index.ts +109 -0
  89. package/backend/mentions/mentions.test.ts +27 -0
  90. package/backend/mentions/shared.ts +82 -0
  91. package/backend/mentions/sources/ai-changes.ts +140 -0
  92. package/backend/mentions/sources/chats.ts +122 -0
  93. package/backend/mentions/sources/database.ts +211 -0
  94. package/backend/mentions/sources/files.ts +240 -0
  95. package/backend/mentions/sources/git.ts +308 -0
  96. package/backend/mentions/sources/notes-memory.ts +121 -0
  97. package/backend/mentions/sources/ops.ts +125 -0
  98. package/backend/mentions/sources/preview.ts +153 -0
  99. package/backend/mentions/sources/projects.ts +114 -0
  100. package/backend/mentions/sources/system.ts +135 -0
  101. package/backend/mentions/sources/terminal.ts +50 -0
  102. package/backend/mentions/types.ts +75 -0
  103. package/backend/preview/browser/bot-check-frames.test.ts +49 -0
  104. package/backend/preview/browser/bot-check-frames.ts +66 -0
  105. package/backend/preview/browser/browser-dialog-handler.ts +6 -5
  106. package/backend/preview/browser/browser-host-bridge.ts +4 -2
  107. package/backend/preview/browser/browser-native-ui-handler.ts +21 -0
  108. package/backend/preview/browser/browser-pool.ts +26 -17
  109. package/backend/preview/browser/browser-preview-service.ts +164 -2
  110. package/backend/preview/browser/browser-screenshot.test.ts +113 -0
  111. package/backend/preview/browser/browser-screenshot.ts +396 -0
  112. package/backend/preview/browser/browser-tab-manager.ts +35 -186
  113. package/backend/preview/browser/browser-video-capture.ts +12 -17
  114. package/backend/preview/browser/element-describe.ts +125 -0
  115. package/backend/preview/browser/page-binding.ts +141 -0
  116. package/backend/preview/browser/screenshot-files.test.ts +117 -0
  117. package/backend/preview/browser/screenshot-files.ts +134 -0
  118. package/backend/preview/browser/user-agent.test.ts +25 -0
  119. package/backend/preview/browser/user-agent.ts +100 -0
  120. package/backend/project/status-manager.ts +4 -2
  121. package/backend/projects/engine-transcripts.ts +153 -0
  122. package/backend/projects/folder-guard.ts +55 -0
  123. package/backend/projects/move.test.ts +208 -0
  124. package/backend/projects/move.ts +277 -0
  125. package/backend/projects/project-cleanup.integration.test.ts +3 -1
  126. package/backend/projects/project-cleanup.ts +10 -0
  127. package/backend/storage/actions.ts +260 -0
  128. package/backend/storage/chats.test.ts +57 -0
  129. package/backend/storage/chats.ts +170 -0
  130. package/backend/storage/database.ts +105 -0
  131. package/backend/storage/engine-homes.ts +145 -0
  132. package/backend/storage/fs-size.ts +111 -0
  133. package/backend/storage/history.ts +39 -0
  134. package/backend/storage/policy.ts +156 -0
  135. package/backend/storage/preview-profiles.ts +169 -0
  136. package/backend/storage/purge.ts +158 -0
  137. package/backend/storage/scanner.ts +339 -0
  138. package/backend/storage/session-index.ts +208 -0
  139. package/backend/storage/snapshots.ts +99 -0
  140. package/backend/storage/storage-flow.test.ts +137 -0
  141. package/backend/storage/transcripts/aliases.ts +75 -0
  142. package/backend/storage/transcripts/claude-dedupe.test.ts +101 -0
  143. package/backend/storage/transcripts/claude-dedupe.ts +152 -0
  144. package/backend/storage/transcripts/claude.ts +155 -0
  145. package/backend/storage/transcripts/cursor.ts +165 -0
  146. package/backend/storage/transcripts/file-stores.ts +224 -0
  147. package/backend/storage/transcripts/index.ts +207 -0
  148. package/backend/storage/transcripts/opencode.ts +124 -0
  149. package/backend/storage/transcripts/references.ts +42 -0
  150. package/backend/storage/transcripts/types.ts +58 -0
  151. package/backend/storage/worktrees.ts +114 -0
  152. package/backend/terminal/ptykit.ts +25 -0
  153. package/backend/update/registry.ts +24 -0
  154. package/backend/update/release-notes.test.ts +110 -0
  155. package/backend/update/release-notes.ts +132 -0
  156. package/backend/update/restart.ts +159 -0
  157. package/backend/utils/env.test.ts +64 -0
  158. package/backend/utils/env.ts +23 -55
  159. package/backend/utils/port-utils.ts +13 -0
  160. package/backend/work/index.ts +13 -2
  161. package/backend/work/providers/github/actions-logs.ts +1 -1
  162. package/backend/work/providers/github/adapter.ts +32 -1
  163. package/backend/work/providers/github/client.ts +7 -3
  164. package/backend/work/providers/gitlab/adapter.ts +770 -0
  165. package/backend/work/providers/gitlab/system-notes.test.ts +24 -0
  166. package/backend/work/service.ts +60 -36
  167. package/backend/work/start-work.ts +1 -1
  168. package/backend/work/types.ts +4 -0
  169. package/backend/worktrees/index.ts +1 -0
  170. package/backend/worktrees/service.ts +23 -2
  171. package/backend/ws/chat/composer.ts +47 -6
  172. package/backend/ws/chat/stream.ts +19 -10
  173. package/backend/ws/files/search.ts +1 -1
  174. package/backend/ws/files/write.ts +27 -0
  175. package/backend/ws/hosting/index.ts +231 -0
  176. package/backend/ws/index.ts +12 -2
  177. package/backend/ws/integrations/crud.ts +31 -5
  178. package/backend/ws/integrations/hosting-auth.ts +227 -0
  179. package/backend/ws/integrations/index.ts +2 -0
  180. package/backend/ws/memory/crud.ts +118 -81
  181. package/backend/ws/mentions/index.ts +81 -0
  182. package/backend/ws/messages/crud.ts +3 -1
  183. package/backend/ws/preview/browser/screenshot.ts +184 -0
  184. package/backend/ws/preview/index.ts +23 -0
  185. package/backend/ws/projects/crud.ts +66 -58
  186. package/backend/ws/sessions/crud.ts +7 -95
  187. package/backend/ws/snapshot/changes.ts +3 -3
  188. package/backend/ws/storage/index.ts +102 -0
  189. package/backend/ws/system/index.ts +7 -0
  190. package/backend/ws/system/operations.ts +125 -69
  191. package/backend/ws/work/context.ts +3 -4
  192. package/backend/ws/work/crud.ts +33 -0
  193. package/backend/ws/work/schemas.ts +4 -1
  194. package/bin/clopen.ts +18 -18
  195. package/dist/assets/{index-DD0-3EWg.js → index-B9rHDvjg.js} +1 -1
  196. package/dist/assets/index-B9rHDvjg.js.br +0 -0
  197. package/dist/assets/index-B9rHDvjg.js.gz +0 -0
  198. package/dist/assets/{index-CrVWZH_D.js → index-DFlwOd7k.js} +1 -1
  199. package/dist/assets/index-DFlwOd7k.js.br +0 -0
  200. package/dist/assets/index-DFlwOd7k.js.gz +0 -0
  201. package/dist/assets/main-Bz_brxxS.css +1 -0
  202. package/dist/assets/main-Bz_brxxS.css.br +0 -0
  203. package/dist/assets/main-Bz_brxxS.css.gz +0 -0
  204. package/dist/assets/main-DRcX9SHx.js +1273 -0
  205. package/dist/assets/main-DRcX9SHx.js.br +0 -0
  206. package/dist/assets/main-DRcX9SHx.js.gz +0 -0
  207. package/dist/assets/pdf-DfwfQPLy.js +57 -0
  208. package/dist/assets/pdf-DfwfQPLy.js.br +0 -0
  209. package/dist/assets/pdf-DfwfQPLy.js.gz +0 -0
  210. package/dist/assets/pdf.worker.min-B5Yc7dP4.mjs +27 -0
  211. package/dist/assets/pdf.worker.min-B5Yc7dP4.mjs.br +0 -0
  212. package/dist/assets/pdf.worker.min-B5Yc7dP4.mjs.gz +0 -0
  213. package/dist/assets/pdf.worker.min-BOrSNwfp.js +1 -0
  214. package/dist/index.html +2 -2
  215. package/dist/index.html.br +0 -0
  216. package/dist/index.html.gz +0 -0
  217. package/dist/vendor/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
  218. package/dist/vendor/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
  219. package/dist/vendor/pdfjs/cmaps/78-H.bcmap +0 -0
  220. package/dist/vendor/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
  221. package/dist/vendor/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
  222. package/dist/vendor/pdfjs/cmaps/78-V.bcmap +0 -0
  223. package/dist/vendor/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
  224. package/dist/vendor/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
  225. package/dist/vendor/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
  226. package/dist/vendor/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
  227. package/dist/vendor/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
  228. package/dist/vendor/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
  229. package/dist/vendor/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
  230. package/dist/vendor/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
  231. package/dist/vendor/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
  232. package/dist/vendor/pdfjs/cmaps/Add-H.bcmap +0 -0
  233. package/dist/vendor/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
  234. package/dist/vendor/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
  235. package/dist/vendor/pdfjs/cmaps/Add-V.bcmap +0 -0
  236. package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
  237. package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
  238. package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
  239. package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
  240. package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
  241. package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
  242. package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
  243. package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  244. package/dist/vendor/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
  245. package/dist/vendor/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
  246. package/dist/vendor/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
  247. package/dist/vendor/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
  248. package/dist/vendor/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
  249. package/dist/vendor/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
  250. package/dist/vendor/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  251. package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
  252. package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
  253. package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
  254. package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
  255. package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
  256. package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
  257. package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
  258. package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  259. package/dist/vendor/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
  260. package/dist/vendor/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
  261. package/dist/vendor/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
  262. package/dist/vendor/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  263. package/dist/vendor/pdfjs/cmaps/B5-H.bcmap +0 -0
  264. package/dist/vendor/pdfjs/cmaps/B5-V.bcmap +0 -0
  265. package/dist/vendor/pdfjs/cmaps/B5pc-H.bcmap +0 -0
  266. package/dist/vendor/pdfjs/cmaps/B5pc-V.bcmap +0 -0
  267. package/dist/vendor/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
  268. package/dist/vendor/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
  269. package/dist/vendor/pdfjs/cmaps/CNS1-H.bcmap +0 -0
  270. package/dist/vendor/pdfjs/cmaps/CNS1-V.bcmap +0 -0
  271. package/dist/vendor/pdfjs/cmaps/CNS2-H.bcmap +0 -0
  272. package/dist/vendor/pdfjs/cmaps/CNS2-V.bcmap +3 -0
  273. package/dist/vendor/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
  274. package/dist/vendor/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
  275. package/dist/vendor/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
  276. package/dist/vendor/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
  277. package/dist/vendor/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
  278. package/dist/vendor/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
  279. package/dist/vendor/pdfjs/cmaps/EUC-H.bcmap +0 -0
  280. package/dist/vendor/pdfjs/cmaps/EUC-V.bcmap +0 -0
  281. package/dist/vendor/pdfjs/cmaps/Ext-H.bcmap +0 -0
  282. package/dist/vendor/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
  283. package/dist/vendor/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
  284. package/dist/vendor/pdfjs/cmaps/Ext-V.bcmap +0 -0
  285. package/dist/vendor/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
  286. package/dist/vendor/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
  287. package/dist/vendor/pdfjs/cmaps/GB-H.bcmap +6 -0
  288. package/dist/vendor/pdfjs/cmaps/GB-V.bcmap +0 -0
  289. package/dist/vendor/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
  290. package/dist/vendor/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
  291. package/dist/vendor/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
  292. package/dist/vendor/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
  293. package/dist/vendor/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
  294. package/dist/vendor/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
  295. package/dist/vendor/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
  296. package/dist/vendor/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
  297. package/dist/vendor/pdfjs/cmaps/GBT-H.bcmap +0 -0
  298. package/dist/vendor/pdfjs/cmaps/GBT-V.bcmap +0 -0
  299. package/dist/vendor/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
  300. package/dist/vendor/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
  301. package/dist/vendor/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
  302. package/dist/vendor/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
  303. package/dist/vendor/pdfjs/cmaps/H.bcmap +0 -0
  304. package/dist/vendor/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
  305. package/dist/vendor/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
  306. package/dist/vendor/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
  307. package/dist/vendor/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
  308. package/dist/vendor/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
  309. package/dist/vendor/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
  310. package/dist/vendor/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
  311. package/dist/vendor/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
  312. package/dist/vendor/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
  313. package/dist/vendor/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
  314. package/dist/vendor/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
  315. package/dist/vendor/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
  316. package/dist/vendor/pdfjs/cmaps/Hankaku.bcmap +0 -0
  317. package/dist/vendor/pdfjs/cmaps/Hiragana.bcmap +0 -0
  318. package/dist/vendor/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
  319. package/dist/vendor/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
  320. package/dist/vendor/pdfjs/cmaps/KSC-H.bcmap +0 -0
  321. package/dist/vendor/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
  322. package/dist/vendor/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
  323. package/dist/vendor/pdfjs/cmaps/KSC-V.bcmap +0 -0
  324. package/dist/vendor/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
  325. package/dist/vendor/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  326. package/dist/vendor/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  327. package/dist/vendor/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
  328. package/dist/vendor/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
  329. package/dist/vendor/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
  330. package/dist/vendor/pdfjs/cmaps/Katakana.bcmap +0 -0
  331. package/dist/vendor/pdfjs/cmaps/LICENSE +36 -0
  332. package/dist/vendor/pdfjs/cmaps/NWP-H.bcmap +0 -0
  333. package/dist/vendor/pdfjs/cmaps/NWP-V.bcmap +0 -0
  334. package/dist/vendor/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
  335. package/dist/vendor/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
  336. package/dist/vendor/pdfjs/cmaps/Roman.bcmap +0 -0
  337. package/dist/vendor/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  338. package/dist/vendor/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  339. package/dist/vendor/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  340. package/dist/vendor/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  341. package/dist/vendor/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  342. package/dist/vendor/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  343. package/dist/vendor/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  344. package/dist/vendor/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  345. package/dist/vendor/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
  346. package/dist/vendor/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
  347. package/dist/vendor/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
  348. package/dist/vendor/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
  349. package/dist/vendor/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
  350. package/dist/vendor/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
  351. package/dist/vendor/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
  352. package/dist/vendor/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
  353. package/dist/vendor/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  354. package/dist/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  355. package/dist/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  356. package/dist/vendor/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  357. package/dist/vendor/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  358. package/dist/vendor/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  359. package/dist/vendor/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  360. package/dist/vendor/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  361. package/dist/vendor/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  362. package/dist/vendor/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  363. package/dist/vendor/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  364. package/dist/vendor/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  365. package/dist/vendor/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  366. package/dist/vendor/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  367. package/dist/vendor/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  368. package/dist/vendor/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  369. package/dist/vendor/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  370. package/dist/vendor/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  371. package/dist/vendor/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  372. package/dist/vendor/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  373. package/dist/vendor/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  374. package/dist/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  375. package/dist/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  376. package/dist/vendor/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
  377. package/dist/vendor/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
  378. package/dist/vendor/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
  379. package/dist/vendor/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
  380. package/dist/vendor/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
  381. package/dist/vendor/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
  382. package/dist/vendor/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
  383. package/dist/vendor/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
  384. package/dist/vendor/pdfjs/cmaps/V.bcmap +0 -0
  385. package/dist/vendor/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
  386. package/dist/vendor/pdfjs/iccs/CGATS001Compat-v2-micro.icc +0 -0
  387. package/dist/vendor/pdfjs/iccs/LICENSE +116 -0
  388. package/dist/vendor/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
  389. package/dist/vendor/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
  390. package/dist/vendor/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
  391. package/dist/vendor/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
  392. package/dist/vendor/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
  393. package/dist/vendor/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
  394. package/dist/vendor/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
  395. package/dist/vendor/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
  396. package/dist/vendor/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
  397. package/dist/vendor/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
  398. package/dist/vendor/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
  399. package/dist/vendor/pdfjs/standard_fonts/LICENSE_LIBERATION +363 -0
  400. package/dist/vendor/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
  401. package/dist/vendor/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
  402. package/dist/vendor/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
  403. package/dist/vendor/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
  404. package/dist/vendor/pdfjs/wasm/LICENSE_JBIG2 +196 -0
  405. package/dist/vendor/pdfjs/wasm/LICENSE_OPENJPEG +39 -0
  406. package/dist/vendor/pdfjs/wasm/LICENSE_PDFJS_JBIG2 +13 -0
  407. package/dist/vendor/pdfjs/wasm/LICENSE_PDFJS_OPENJPEG +22 -0
  408. package/dist/vendor/pdfjs/wasm/LICENSE_PDFJS_QCMS +19 -0
  409. package/dist/vendor/pdfjs/wasm/LICENSE_PDFJS_QUICKJS +21 -0
  410. package/dist/vendor/pdfjs/wasm/LICENSE_QCMS +21 -0
  411. package/dist/vendor/pdfjs/wasm/LICENSE_QUICKJS +22 -0
  412. package/dist/vendor/pdfjs/wasm/jbig2.wasm +0 -0
  413. package/dist/vendor/pdfjs/wasm/jbig2.wasm.br +0 -0
  414. package/dist/vendor/pdfjs/wasm/jbig2.wasm.gz +0 -0
  415. package/dist/vendor/pdfjs/wasm/jbig2_nowasm_fallback.js +2 -0
  416. package/dist/vendor/pdfjs/wasm/jbig2_nowasm_fallback.js.br +0 -0
  417. package/dist/vendor/pdfjs/wasm/jbig2_nowasm_fallback.js.gz +0 -0
  418. package/dist/vendor/pdfjs/wasm/openjpeg.wasm +0 -0
  419. package/dist/vendor/pdfjs/wasm/openjpeg.wasm.br +0 -0
  420. package/dist/vendor/pdfjs/wasm/openjpeg.wasm.gz +0 -0
  421. package/dist/vendor/pdfjs/wasm/openjpeg_nowasm_fallback.js +2 -0
  422. package/dist/vendor/pdfjs/wasm/openjpeg_nowasm_fallback.js.br +0 -0
  423. package/dist/vendor/pdfjs/wasm/openjpeg_nowasm_fallback.js.gz +0 -0
  424. package/dist/vendor/pdfjs/wasm/qcms_bg.wasm +0 -0
  425. package/dist/vendor/pdfjs/wasm/qcms_bg.wasm.br +0 -0
  426. package/dist/vendor/pdfjs/wasm/qcms_bg.wasm.gz +0 -0
  427. package/dist/vendor/pdfjs/wasm/quickjs-eval.js +16 -0
  428. package/dist/vendor/pdfjs/wasm/quickjs-eval.js.br +0 -0
  429. package/dist/vendor/pdfjs/wasm/quickjs-eval.js.gz +0 -0
  430. package/dist/vendor/pdfjs/wasm/quickjs-eval.wasm +0 -0
  431. package/dist/vendor/pdfjs/wasm/quickjs-eval.wasm.br +0 -0
  432. package/dist/vendor/pdfjs/wasm/quickjs-eval.wasm.gz +0 -0
  433. package/package.json +8 -9
  434. package/scripts/start.ts +21 -4
  435. package/shared/constants/binary-extensions.ts +20 -4
  436. package/shared/constants/support.test.ts +27 -0
  437. package/shared/constants/support.ts +79 -0
  438. package/shared/constants/tool-icons.ts +7 -1
  439. package/shared/types/database/schema.ts +6 -0
  440. package/shared/types/git-hosting.ts +241 -0
  441. package/shared/types/integrations.ts +51 -1
  442. package/shared/types/memory.ts +96 -73
  443. package/shared/types/mentions.ts +96 -0
  444. package/shared/types/release-notes.ts +31 -0
  445. package/shared/types/storage.ts +175 -0
  446. package/shared/types/stores/settings.ts +16 -0
  447. package/shared/types/unified/index.ts +2 -0
  448. package/shared/types/unified/message.ts +26 -1
  449. package/shared/types/unified/stream.ts +22 -1
  450. package/shared/types/unified/tool.ts +4 -0
  451. package/shared/types/work.ts +6 -0
  452. package/shared/utils/attachment-mentions.test.ts +39 -0
  453. package/shared/utils/attachment-mentions.ts +100 -0
  454. package/shared/utils/context-document.test.ts +53 -0
  455. package/shared/utils/context-document.ts +226 -0
  456. package/shared/utils/device-frame.test.ts +73 -0
  457. package/shared/utils/device-frame.ts +320 -0
  458. package/shared/utils/fuzzy.ts +79 -0
  459. package/shared/utils/launcher-fingerprint.test.ts +73 -0
  460. package/shared/utils/launcher-fingerprint.ts +108 -0
  461. package/shared/utils/logger.ts +2 -0
  462. package/shared/utils/page-colors.test.ts +17 -0
  463. package/shared/utils/page-colors.ts +24 -0
  464. package/shared/utils/process-supervisor.test.ts +88 -1
  465. package/shared/utils/process-supervisor.ts +123 -29
  466. package/shared/utils/process-tree.ts +99 -0
  467. package/shared/utils/restart-intent.test.ts +57 -0
  468. package/shared/utils/restart-intent.ts +80 -0
  469. package/shared/utils/semver.test.ts +33 -0
  470. package/shared/utils/semver.ts +35 -0
  471. package/shared/utils/supervised-child.ts +44 -0
  472. package/shared/utils/supervisor-protocol.ts +20 -0
  473. package/.env.example +0 -9
  474. package/dist/assets/graph-layout.worker-CRFqN7ZQ.js +0 -1
  475. package/dist/assets/graph-layout.worker-CRFqN7ZQ.js.br +0 -0
  476. package/dist/assets/graph-layout.worker-CRFqN7ZQ.js.gz +0 -0
  477. package/dist/assets/index-CrVWZH_D.js.br +0 -0
  478. package/dist/assets/index-CrVWZH_D.js.gz +0 -0
  479. package/dist/assets/index-DD0-3EWg.js.br +0 -0
  480. package/dist/assets/index-DD0-3EWg.js.gz +0 -0
  481. package/dist/assets/main-D2_TmcwQ.js +0 -1240
  482. package/dist/assets/main-D2_TmcwQ.js.br +0 -0
  483. package/dist/assets/main-D2_TmcwQ.js.gz +0 -0
  484. package/dist/assets/main-Yucigcmf.css +0 -1
  485. package/dist/assets/main-Yucigcmf.css.br +0 -0
  486. package/dist/assets/main-Yucigcmf.css.gz +0 -0
@@ -0,0 +1,770 @@
1
+ /**
2
+ * GitLab, behind the provider-agnostic work interface.
3
+ *
4
+ * What GitLab does differently, absorbed here so the panel never learns it:
5
+ *
6
+ * - Pull requests are MERGE REQUESTS, numbered per project by `iid`, and an
7
+ * issue and a merge request each have their own number space.
8
+ * - The discussion is NOTES. System notes ("added ~bug label") are the
9
+ * timeline, so they become events rather than comments.
10
+ * - A note is addressed through the item it belongs to, while the interface
11
+ * hands an edit only the comment. So a comment id carries its item:
12
+ * `issue:12:3456` — opaque to the panel, enough for the adapter.
13
+ * - Assignees are set by USER ID, so logins are resolved first.
14
+ * - CI is PIPELINES, and a pipeline's logs are its failed jobs' traces.
15
+ */
16
+
17
+ import type {
18
+ CheckLogBundle,
19
+ CheckRun,
20
+ CheckStatus,
21
+ CommitDetail,
22
+ CommitRef,
23
+ FileChange,
24
+ FileContent,
25
+ MergeMethod,
26
+ PullRequestDraft,
27
+ PullRequestMergeability,
28
+ TimelineEventKind,
29
+ WorkItem,
30
+ WorkItemComment,
31
+ WorkItemDetail,
32
+ WorkItemEvent,
33
+ WorkItemKind,
34
+ WorkItemPage,
35
+ WorkItemQuery,
36
+ WorkItemStateOption,
37
+ WorkProviderCapabilities,
38
+ WorkRateLimit
39
+ } from '$shared/types/work';
40
+ import type { ResolvedBinding, UnboundContext, WorkContext, WorkProviderAdapter } from '../../types';
41
+ import { HostApiError } from '$backend/git-hosts/http';
42
+ import { gitlabHost } from '$backend/git-hosts/providers/gitlab';
43
+ import { gitlabPaged, gitlabRequest, gitlabWebBase, projectRef } from '$backend/git-hosts/providers/gitlab-client';
44
+ import { keepTail } from '../github/actions-logs';
45
+ import { debug } from '$shared/utils/logger';
46
+
47
+ const CAPABILITIES: WorkProviderCapabilities = {
48
+ pullRequests: true,
49
+ checks: true,
50
+ comments: true,
51
+ editComments: true,
52
+ transitions: true,
53
+ editTitle: true,
54
+ createPullRequest: true,
55
+ createIssue: true,
56
+ merge: true,
57
+ assign: true,
58
+ labels: true,
59
+ reviewers: true,
60
+ diff: true
61
+ };
62
+
63
+ const PAGE_SIZE = 50;
64
+ const MAX_PATCH_BYTES = 60 * 1024;
65
+ const MAX_RENDER_BYTES = 2 * 1024 * 1024;
66
+ const TOTAL_LOG_BUDGET = 24 * 1024;
67
+ const PER_JOB_BUDGET = 12 * 1024;
68
+
69
+ // ---------------------------------------------------------------------------
70
+ // Wire shapes
71
+ // ---------------------------------------------------------------------------
72
+
73
+ interface GitLabUser { id: number; username: string }
74
+
75
+ interface GitLabItemWire {
76
+ id: number;
77
+ iid: number;
78
+ title: string;
79
+ description: string | null;
80
+ web_url: string;
81
+ state: 'opened' | 'closed' | 'merged' | 'locked';
82
+ labels: string[];
83
+ assignees?: GitLabUser[];
84
+ reviewers?: GitLabUser[];
85
+ author: GitLabUser | null;
86
+ user_notes_count?: number;
87
+ created_at: string;
88
+ updated_at: string;
89
+ // merge requests
90
+ draft?: boolean;
91
+ work_in_progress?: boolean;
92
+ source_branch?: string;
93
+ target_branch?: string;
94
+ sha?: string;
95
+ merge_status?: string;
96
+ detailed_merge_status?: string;
97
+ has_conflicts?: boolean;
98
+ squash_on_merge?: boolean;
99
+ }
100
+
101
+ interface GitLabNoteWire {
102
+ id: number;
103
+ body: string;
104
+ author: GitLabUser;
105
+ created_at: string;
106
+ system: boolean;
107
+ type: string | null;
108
+ position?: { new_path?: string; old_path?: string; new_line?: number | null; old_line?: number | null } | null;
109
+ }
110
+
111
+ interface GitLabPipelineWire {
112
+ id: number;
113
+ status: string;
114
+ ref: string;
115
+ sha: string;
116
+ source?: string;
117
+ web_url: string;
118
+ created_at: string;
119
+ updated_at: string;
120
+ started_at?: string | null;
121
+ finished_at?: string | null;
122
+ name?: string | null;
123
+ }
124
+
125
+ interface GitLabDiffWire {
126
+ old_path: string;
127
+ new_path: string;
128
+ diff: string;
129
+ new_file: boolean;
130
+ renamed_file: boolean;
131
+ deleted_file: boolean;
132
+ }
133
+
134
+ interface GitLabCommitWire {
135
+ id: string;
136
+ short_id: string;
137
+ title: string;
138
+ message?: string;
139
+ author_name: string | null;
140
+ created_at: string;
141
+ committed_date?: string;
142
+ web_url: string;
143
+ stats?: { additions: number; deletions: number };
144
+ }
145
+
146
+ // ---------------------------------------------------------------------------
147
+ // Normalisation
148
+ // ---------------------------------------------------------------------------
149
+
150
+ function itemsPath(kind: WorkItemKind): string {
151
+ return kind === 'pull-request' ? 'merge_requests' : 'issues';
152
+ }
153
+
154
+ function categorise(raw: GitLabItemWire, kind: WorkItemKind): WorkItem['stateCategory'] {
155
+ if (raw.state === 'merged') return 'merged';
156
+ if (raw.state === 'closed' || raw.state === 'locked') return 'closed';
157
+ if (kind === 'pull-request' && (raw.draft || raw.work_in_progress)) return 'draft';
158
+ return 'open';
159
+ }
160
+
161
+ function stateName(raw: GitLabItemWire, kind: WorkItemKind): string {
162
+ if (raw.state === 'opened') return kind === 'pull-request' && (raw.draft || raw.work_in_progress) ? 'draft' : 'open';
163
+ return raw.state;
164
+ }
165
+
166
+ function toWorkItem(raw: GitLabItemWire, kind: WorkItemKind): WorkItem {
167
+ return {
168
+ id: String(raw.iid),
169
+ identifier: String(raw.iid),
170
+ kind,
171
+ title: raw.title,
172
+ url: raw.web_url,
173
+ state: stateName(raw, kind),
174
+ stateCategory: categorise(raw, kind),
175
+ labels: raw.labels ?? [],
176
+ assignees: (raw.assignees ?? []).map((user) => user.username),
177
+ author: raw.author?.username ?? null,
178
+ commentCount: raw.user_notes_count ?? 0,
179
+ createdAt: raw.created_at,
180
+ updatedAt: raw.updated_at,
181
+ ...(kind === 'pull-request' && {
182
+ headBranch: raw.source_branch,
183
+ ...(raw.sha && { headSha: raw.sha }),
184
+ baseBranch: raw.target_branch,
185
+ isDraft: raw.draft === true || raw.work_in_progress === true,
186
+ ...(raw.reviewers && { reviewers: raw.reviewers.map((user) => user.username) })
187
+ })
188
+ };
189
+ }
190
+
191
+ /** `kind:iid:noteId` — the item a note belongs to travels with it. */
192
+ function commentId(kind: WorkItemKind, iid: string, noteId: number): string {
193
+ return `${kind === 'pull-request' ? 'mr' : 'issue'}:${iid}:${noteId}`;
194
+ }
195
+
196
+ function parseCommentId(id: string): { path: string; iid: string; noteId: string } {
197
+ const [kind, iid, noteId] = id.split(':');
198
+ if (!kind || !iid || !noteId) throw new Error('That comment cannot be addressed');
199
+ return { path: kind === 'mr' ? 'merge_requests' : 'issues', iid, noteId };
200
+ }
201
+
202
+ function toComment(raw: GitLabNoteWire, kind: WorkItemKind, iid: string, viewer: string | null): WorkItemComment {
203
+ const path = raw.position?.new_path ?? raw.position?.old_path;
204
+ return {
205
+ id: commentId(kind, iid, raw.id),
206
+ author: raw.author?.username ?? 'unknown',
207
+ body: raw.body ?? '',
208
+ createdAt: raw.created_at,
209
+ source: raw.type === 'DiffNote' ? 'review' : 'conversation',
210
+ // GitLab lets the author edit their note; deleting someone else's needs
211
+ // a role the API does not report per note, so only the author is offered.
212
+ canModify: viewer !== null && raw.author?.username === viewer,
213
+ ...(path && { path, line: raw.position?.new_line ?? raw.position?.old_line ?? null })
214
+ };
215
+ }
216
+
217
+ /**
218
+ * System notes are GitLab's timeline, written as sentences. The ones worth
219
+ * drawing are recognised by their wording; the rest are dropped rather than
220
+ * rendered as a vague "something happened".
221
+ */
222
+ const SYSTEM_PATTERNS: { pattern: RegExp; kind: TimelineEventKind }[] = [
223
+ { pattern: /^added ~"?([^"~]+?)"? label/i, kind: 'labeled' },
224
+ { pattern: /^removed ~"?([^"~]+?)"? label/i, kind: 'unlabeled' },
225
+ { pattern: /^assigned to @(\S+)/i, kind: 'assigned' },
226
+ { pattern: /^unassigned @(\S+)/i, kind: 'unassigned' },
227
+ { pattern: /^changed title from .* to \*\*(.+)\*\*/i, kind: 'renamed' },
228
+ { pattern: /^requested review from @(\S+)/i, kind: 'review-requested' },
229
+ { pattern: /^mentioned in (.+)$/i, kind: 'cross-referenced' },
230
+ { pattern: /^closed$/i, kind: 'closed' },
231
+ { pattern: /^reopened$/i, kind: 'reopened' },
232
+ { pattern: /^merged$/i, kind: 'merged' }
233
+ ];
234
+
235
+ export function systemNoteToEvent(raw: Pick<GitLabNoteWire, 'id' | 'body' | 'author' | 'created_at'>): WorkItemEvent | null {
236
+ const body = (raw.body ?? '').trim();
237
+ for (const { pattern, kind } of SYSTEM_PATTERNS) {
238
+ const match = pattern.exec(body);
239
+ if (!match) continue;
240
+ return {
241
+ id: String(raw.id),
242
+ kind,
243
+ actor: raw.author?.username ?? null,
244
+ createdAt: raw.created_at,
245
+ ...(match[1] && kind !== 'cross-referenced' && { subject: match[1].replace(/\*\*/g, '') }),
246
+ ...(kind === 'cross-referenced' && match[1] && { referenceTitle: match[1] })
247
+ };
248
+ }
249
+ return null;
250
+ }
251
+
252
+ function toCheckStatus(status: string): CheckStatus {
253
+ switch (status) {
254
+ case 'success':
255
+ return 'success';
256
+ case 'failed':
257
+ return 'failure';
258
+ case 'canceled':
259
+ case 'canceling':
260
+ return 'cancelled';
261
+ case 'skipped':
262
+ return 'skipped';
263
+ case 'created':
264
+ case 'pending':
265
+ case 'waiting_for_resource':
266
+ case 'waiting_for_callback':
267
+ case 'preparing':
268
+ case 'scheduled':
269
+ case 'manual':
270
+ return 'queued';
271
+ case 'running':
272
+ return 'running';
273
+ default:
274
+ return 'unknown';
275
+ }
276
+ }
277
+
278
+ function toCheckRun(raw: GitLabPipelineWire): CheckRun {
279
+ const status = toCheckStatus(raw.status);
280
+ const finished = ['success', 'failure', 'cancelled', 'skipped'].includes(status);
281
+ return {
282
+ id: String(raw.id),
283
+ name: raw.name || `Pipeline #${raw.id}`,
284
+ status,
285
+ url: raw.web_url,
286
+ headBranch: raw.ref,
287
+ headSha: raw.sha,
288
+ event: raw.source ?? 'push',
289
+ startedAt: raw.started_at ?? raw.created_at,
290
+ finishedAt: finished ? (raw.finished_at ?? raw.updated_at) : null,
291
+ canFetchLogs: status === 'failure'
292
+ };
293
+ }
294
+
295
+ /** Lines added and removed in a GitLab hunk body, which carries no counts of its own. */
296
+ function countDiff(diff: string): { additions: number; deletions: number } {
297
+ let additions = 0;
298
+ let deletions = 0;
299
+ for (const line of diff.split('\n')) {
300
+ if (line.startsWith('+') && !line.startsWith('+++')) additions += 1;
301
+ else if (line.startsWith('-') && !line.startsWith('---')) deletions += 1;
302
+ }
303
+ return { additions, deletions };
304
+ }
305
+
306
+ function toFileChange(raw: GitLabDiffWire, url: string): FileChange {
307
+ const counts = countDiff(raw.diff ?? '');
308
+ const status = raw.new_file ? 'added' : raw.deleted_file ? 'removed' : raw.renamed_file ? 'renamed' : 'modified';
309
+ return {
310
+ path: raw.new_path,
311
+ status,
312
+ additions: counts.additions,
313
+ deletions: counts.deletions,
314
+ ...(raw.diff && raw.diff.length <= MAX_PATCH_BYTES && { patch: raw.diff }),
315
+ url,
316
+ ...(raw.renamed_file && raw.old_path !== raw.new_path && { previousPath: raw.old_path })
317
+ };
318
+ }
319
+
320
+ function toCommit(raw: GitLabCommitWire): CommitRef {
321
+ return {
322
+ hash: raw.short_id || raw.id.slice(0, 8),
323
+ subject: raw.title,
324
+ author: raw.author_name,
325
+ date: raw.committed_date ?? raw.created_at,
326
+ url: raw.web_url
327
+ };
328
+ }
329
+
330
+ // ---------------------------------------------------------------------------
331
+ // Helpers
332
+ // ---------------------------------------------------------------------------
333
+
334
+ function project(context: WorkContext): string {
335
+ return `/projects/${projectRef(context.binding.locator)}`;
336
+ }
337
+
338
+ function startOfDay(date: string): string {
339
+ const value = new Date(date);
340
+ value.setHours(0, 0, 0, 0);
341
+ return value.toISOString();
342
+ }
343
+
344
+ function endOfDay(date: string): string {
345
+ const value = new Date(date);
346
+ value.setHours(23, 59, 59, 999);
347
+ return value.toISOString();
348
+ }
349
+
350
+ async function viewerLogin(credentials: Record<string, string>): Promise<string> {
351
+ const response = await gitlabRequest<{ username: string }>(credentials, '/user');
352
+ return response.data.username;
353
+ }
354
+
355
+ /** Logins → user ids, the form GitLab's assignee fields take. Unknown logins are dropped. */
356
+ async function userIds(credentials: Record<string, string>, logins: string[]): Promise<number[]> {
357
+ const ids = await Promise.all(logins.map(async (login) => {
358
+ const response = await gitlabRequest<GitLabUser[]>(credentials, `/users?username=${encodeURIComponent(login)}`);
359
+ return response.data?.[0]?.id ?? null;
360
+ }));
361
+ return ids.filter((id): id is number => id !== null);
362
+ }
363
+
364
+ function toHostError(error: unknown): unknown {
365
+ return error instanceof HostApiError && error.kind === 'config'
366
+ ? new HostApiError(`${error.message} Check that the token has the "api" scope and the project is visible to it.`, error.status, 'config')
367
+ : error;
368
+ }
369
+
370
+ async function onProject<T>(run: () => Promise<T>): Promise<T> {
371
+ try {
372
+ return await run();
373
+ } catch (error) {
374
+ throw toHostError(error);
375
+ }
376
+ }
377
+
378
+ // ---------------------------------------------------------------------------
379
+ // Listing
380
+ // ---------------------------------------------------------------------------
381
+
382
+ async function listPage(
383
+ context: WorkContext,
384
+ kind: WorkItemKind,
385
+ query: WorkItemQuery,
386
+ extra: Record<string, string>
387
+ ): Promise<{ items: WorkItem[]; rateLimit: WorkRateLimit | null; nextPage: number | null }> {
388
+ const params = new URLSearchParams({
389
+ per_page: String(PAGE_SIZE),
390
+ page: String(query.page ?? 1),
391
+ order_by: 'updated_at',
392
+ sort: 'desc',
393
+ ...extra
394
+ });
395
+ // `closed` here means "not open", which for a merge request includes merged —
396
+ // the same as GitHub, where a merged PR is closed.
397
+ if (query.state === 'open') params.set('state', 'opened');
398
+ if (query.author) params.set('author_username', query.author);
399
+ if (query.labels?.length) params.set('labels', query.labels.join(','));
400
+ if (query.since) params.set('updated_after', startOfDay(query.since));
401
+ if (query.until) params.set('updated_before', endOfDay(query.until));
402
+ if (query.search?.trim()) params.set('search', query.search.trim());
403
+
404
+ const response = await gitlabRequest<GitLabItemWire[]>(
405
+ context.credentials,
406
+ `${project(context)}/${itemsPath(kind)}?${params.toString()}`
407
+ );
408
+ let rows = response.data ?? [];
409
+ if (query.state === 'closed') rows = rows.filter((row) => row.state !== 'opened');
410
+ return { items: rows.map((row) => toWorkItem(row, kind)), rateLimit: response.rateLimit, nextPage: response.nextPage };
411
+ }
412
+
413
+ // ---------------------------------------------------------------------------
414
+ // Adapter
415
+ // ---------------------------------------------------------------------------
416
+
417
+ export const gitlabWorkAdapter: WorkProviderAdapter = {
418
+ provider: 'gitlab',
419
+ capabilities: CAPABILITIES,
420
+
421
+ locatorFromRemote(url, credentials) {
422
+ const locator = gitlabHost.locatorFromRemote(url, credentials);
423
+ // A web URL deeper than the project (`…/-/tree/main`) names a page, not a
424
+ // project; everything from GitLab's `-` separator on is not part of it.
425
+ return locator ? locator.split('/-/')[0]!.replace(/\/-$/, '') || null : null;
426
+ },
427
+
428
+ describeLocator: (locator) => locator,
429
+
430
+ async probe(context: UnboundContext, binding: ResolvedBinding | null) {
431
+ if (!context.credentials.token) return { status: 'needs_config' as const, detail: 'No token stored' };
432
+ try {
433
+ const login = await viewerLogin(context.credentials);
434
+ if (!binding) {
435
+ return { status: 'needs_config' as const, detail: `Signed in as ${login}. No project selected yet.` };
436
+ }
437
+ await gitlabRequest(context.credentials, `/projects/${projectRef(binding.locator)}`);
438
+ return { status: 'ok' as const, detail: `${login} → ${binding.locator}` };
439
+ } catch (error) {
440
+ if (error instanceof HostApiError) {
441
+ const status = error.kind === 'auth' ? 'needs_auth' as const
442
+ : error.kind === 'config' ? 'needs_config' as const
443
+ : 'error' as const;
444
+ return { status, detail: error.message };
445
+ }
446
+ return { status: 'error' as const, detail: error instanceof Error ? error.message : String(error) };
447
+ }
448
+ },
449
+
450
+ async listStates(): Promise<WorkItemStateOption[]> {
451
+ return [
452
+ { value: 'open', label: 'Open', category: 'open' },
453
+ { value: 'closed', label: 'Closed', category: 'closed' }
454
+ ];
455
+ },
456
+
457
+ async list(context: WorkContext, query: WorkItemQuery): Promise<WorkItemPage> {
458
+ return onProject(async () => {
459
+ if (!query.mineOnly) {
460
+ const page = await listPage(context, query.kind, query, { scope: 'all' });
461
+ return { items: page.items, rateLimit: page.rateLimit, hasMore: page.nextPage !== null, nextPage: page.nextPage };
462
+ }
463
+
464
+ // "Mine" is assigned-to-me for an issue; for a merge request it is
465
+ // also the ones I opened, which GitLab answers as a separate scope.
466
+ const scopes = query.kind === 'pull-request' ? ['assigned_to_me', 'created_by_me'] : ['assigned_to_me'];
467
+ const pages = await Promise.all(scopes.map((scope) => listPage(context, query.kind, query, { scope })));
468
+ const seen = new Set<string>();
469
+ const items = pages
470
+ .flatMap((page) => page.items)
471
+ .filter((item) => (seen.has(item.id) ? false : (seen.add(item.id), true)))
472
+ .sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));
473
+ const nextPage = pages.some((page) => page.nextPage !== null) ? (query.page ?? 1) + 1 : null;
474
+ return { items, rateLimit: pages[0]?.rateLimit ?? null, hasMore: nextPage !== null, nextPage };
475
+ });
476
+ },
477
+
478
+ async get(context: WorkContext, kind: WorkItemKind, id: string): Promise<WorkItemDetail> {
479
+ return onProject(async () => {
480
+ const base = `${project(context)}/${itemsPath(kind)}/${id}`;
481
+ const [item, notes, viewer] = await Promise.all([
482
+ gitlabRequest<GitLabItemWire>(context.credentials, base),
483
+ gitlabPaged<GitLabNoteWire>(context.credentials, `${base}/notes?sort=asc&order_by=created_at`, 5),
484
+ viewerLogin(context.credentials).catch(() => null)
485
+ ]);
486
+
487
+ const comments: WorkItemComment[] = [];
488
+ const events: WorkItemEvent[] = [];
489
+ for (const note of notes) {
490
+ if (note.system) {
491
+ const event = systemNoteToEvent(note);
492
+ if (event) events.push(event);
493
+ } else {
494
+ comments.push(toComment(note, kind, id, viewer));
495
+ }
496
+ }
497
+
498
+ let mergeability: PullRequestMergeability | undefined;
499
+ if (kind === 'pull-request') {
500
+ const settings = await gitlabRequest<{ squash_option?: string; merge_method?: string }>(
501
+ context.credentials,
502
+ project(context)
503
+ ).catch(() => null);
504
+ const allowed: MergeMethod[] = ['merge'];
505
+ if (settings?.data.squash_option !== 'never') allowed.push('squash');
506
+ const status = item.data.merge_status;
507
+ mergeability = {
508
+ mergeable: status === 'can_be_merged' ? true : status === 'cannot_be_merged' ? false : null,
509
+ state: item.data.detailed_merge_status ?? status ?? 'unknown',
510
+ allowedMethods: allowed,
511
+ merged: item.data.state === 'merged'
512
+ };
513
+ }
514
+
515
+ return {
516
+ ...toWorkItem(item.data, kind),
517
+ body: item.data.description ?? '',
518
+ comments,
519
+ events,
520
+ ...(mergeability && { mergeability })
521
+ };
522
+ });
523
+ },
524
+
525
+ async comment(context, kind, id, body) {
526
+ const response = await onProject(() => gitlabRequest<GitLabNoteWire>(
527
+ context.credentials,
528
+ `${project(context)}/${itemsPath(kind)}/${id}/notes`,
529
+ { method: 'POST', body: { body } }
530
+ ));
531
+ return toComment(response.data, kind, id, response.data.author?.username ?? null);
532
+ },
533
+
534
+ async transition(context, kind, id, state) {
535
+ await onProject(() => gitlabRequest(context.credentials, `${project(context)}/${itemsPath(kind)}/${id}`, {
536
+ method: 'PUT',
537
+ body: { state_event: state === 'open' ? 'reopen' : 'close' }
538
+ }));
539
+ },
540
+
541
+ async defaultBranch(context) {
542
+ const response = await onProject(() => gitlabRequest<{ default_branch?: string }>(context.credentials, project(context)));
543
+ return response.data.default_branch || 'main';
544
+ },
545
+
546
+ async listChecks(context, branch) {
547
+ const params = new URLSearchParams({ ref: branch, per_page: '20', order_by: 'id', sort: 'desc' });
548
+ const response = await onProject(() => gitlabRequest<GitLabPipelineWire[]>(
549
+ context.credentials,
550
+ `${project(context)}/pipelines?${params.toString()}`
551
+ ));
552
+ return (response.data ?? []).map(toCheckRun);
553
+ },
554
+
555
+ async fetchCheckLogs(context, runId): Promise<CheckLogBundle> {
556
+ const runName = `Pipeline #${runId}`;
557
+ const jobs = await onProject(() => gitlabRequest<{ id: number; name: string; stage: string; status: string }[]>(
558
+ context.credentials,
559
+ `${project(context)}/pipelines/${runId}/jobs?scope[]=failed&per_page=100`
560
+ ));
561
+ const failed = jobs.data ?? [];
562
+ if (failed.length === 0) {
563
+ return {
564
+ runId,
565
+ runName,
566
+ text: 'The pipeline reported a failure but no job failed — this is usually a cancelled or infrastructure-level failure.',
567
+ truncated: false
568
+ };
569
+ }
570
+
571
+ const sections: string[] = [];
572
+ let used = 0;
573
+ let truncated = false;
574
+ for (const job of failed) {
575
+ const header = `### Job "${job.name}" (stage ${job.stage}) — failed`;
576
+ if (used >= TOTAL_LOG_BUDGET) {
577
+ sections.push(`${header}\n(log omitted — the earlier jobs used the available context)`);
578
+ truncated = true;
579
+ continue;
580
+ }
581
+ let body: string;
582
+ try {
583
+ const trace = await gitlabRequest<string>(context.credentials, `${project(context)}/jobs/${job.id}/trace`, { text: true });
584
+ // GitLab traces carry ANSI colour and section markers; both are
585
+ // noise to a model and a large share of the bytes.
586
+ const clean = trace.data
587
+ .replace(/\u001b\[[0-9;]*m/g, '')
588
+ .replace(/section_(start|end):\d+:[\w.-]+\r?/g, '')
589
+ .trimEnd();
590
+ const clipped = keepTail(clean, Math.min(PER_JOB_BUDGET, TOTAL_LOG_BUDGET - used));
591
+ if (clipped.truncated) truncated = true;
592
+ body = clipped.text;
593
+ used += clipped.text.length;
594
+ } catch (error) {
595
+ debug.warn('work', `Could not read the trace for GitLab job ${job.id}:`, error);
596
+ body = `(log unavailable: ${error instanceof Error ? error.message : String(error)})`;
597
+ }
598
+ sections.push(`${header}\n\n\`\`\`\n${body}\n\`\`\``);
599
+ }
600
+ return { runId, runName, text: sections.join('\n\n'), truncated };
601
+ },
602
+
603
+ async createPullRequest(context, draft: PullRequestDraft) {
604
+ const title = draft.isDraft && !/^draft:/i.test(draft.title) ? `Draft: ${draft.title}` : draft.title;
605
+ const response = await onProject(() => gitlabRequest<GitLabItemWire>(context.credentials, `${project(context)}/merge_requests`, {
606
+ method: 'POST',
607
+ body: {
608
+ source_branch: draft.head,
609
+ target_branch: draft.base,
610
+ title,
611
+ description: draft.body,
612
+ remove_source_branch: false
613
+ }
614
+ }));
615
+ return toWorkItem(response.data, 'pull-request');
616
+ },
617
+
618
+ async findPullRequestForBranch(context, branch) {
619
+ const params = new URLSearchParams({ source_branch: branch, state: 'opened', per_page: '5' });
620
+ const response = await gitlabRequest<GitLabItemWire[]>(
621
+ context.credentials,
622
+ `${project(context)}/merge_requests?${params.toString()}`
623
+ );
624
+ const found = (response.data ?? [])[0];
625
+ return found ? toWorkItem(found, 'pull-request') : null;
626
+ },
627
+
628
+ async viewer(context) {
629
+ try {
630
+ return await viewerLogin(context.credentials);
631
+ } catch {
632
+ return null;
633
+ }
634
+ },
635
+
636
+ async updateItem(context, kind, id, patch) {
637
+ await onProject(() => gitlabRequest(context.credentials, `${project(context)}/${itemsPath(kind)}/${id}`, {
638
+ method: 'PUT',
639
+ body: {
640
+ ...(patch.title !== undefined && { title: patch.title }),
641
+ ...(patch.body !== undefined && { description: patch.body })
642
+ }
643
+ }));
644
+ },
645
+
646
+ async listLabels(context) {
647
+ const labels = await onProject(() => gitlabPaged<{ name: string }>(context.credentials, `${project(context)}/labels`, 2));
648
+ return labels.map((label) => label.name);
649
+ },
650
+
651
+ async updateComment(context, comment, body) {
652
+ const { path, iid, noteId } = parseCommentId(comment.id);
653
+ const response = await onProject(() => gitlabRequest<GitLabNoteWire>(
654
+ context.credentials,
655
+ `${project(context)}/${path}/${iid}/notes/${noteId}`,
656
+ { method: 'PUT', body: { body } }
657
+ ));
658
+ return toComment(response.data, path === 'merge_requests' ? 'pull-request' : 'issue', iid, response.data.author?.username ?? null);
659
+ },
660
+
661
+ async deleteComment(context, comment) {
662
+ const { path, iid, noteId } = parseCommentId(comment.id);
663
+ await onProject(() => gitlabRequest(context.credentials, `${project(context)}/${path}/${iid}/notes/${noteId}`, { method: 'DELETE' }));
664
+ },
665
+
666
+ async mergePullRequest(context, id, options) {
667
+ await onProject(() => gitlabRequest(context.credentials, `${project(context)}/merge_requests/${id}/merge`, {
668
+ method: 'PUT',
669
+ body: {
670
+ squash: options.method === 'squash',
671
+ ...(options.title && options.method === 'squash' && { squash_commit_message: options.title }),
672
+ ...(options.title && options.method !== 'squash' && { merge_commit_message: options.title })
673
+ }
674
+ }));
675
+ },
676
+
677
+ async listCommits(context, id) {
678
+ const commits = await onProject(() => gitlabPaged<GitLabCommitWire>(
679
+ context.credentials,
680
+ `${project(context)}/merge_requests/${id}/commits`,
681
+ 2
682
+ ));
683
+ return commits.map(toCommit);
684
+ },
685
+
686
+ async commitDetail(context, sha): Promise<CommitDetail> {
687
+ const base = `${project(context)}/repository/commits/${encodeURIComponent(sha)}`;
688
+ const [commit, diffs] = await onProject(() => Promise.all([
689
+ gitlabRequest<GitLabCommitWire>(context.credentials, base),
690
+ gitlabPaged<GitLabDiffWire>(context.credentials, `${base}/diff`, 3)
691
+ ]));
692
+ const message = commit.data.message ?? commit.data.title;
693
+ return {
694
+ commit: toCommit(commit.data),
695
+ body: message.split('\n').slice(1).join('\n').trim(),
696
+ additions: commit.data.stats?.additions ?? 0,
697
+ deletions: commit.data.stats?.deletions ?? 0,
698
+ files: diffs.map((diff) => toFileChange(diff, commit.data.web_url))
699
+ };
700
+ },
701
+
702
+ async fetchFileContent(context, path, ref): Promise<FileContent> {
703
+ const response = await onProject(() => gitlabRequest<string>(
704
+ context.credentials,
705
+ `${project(context)}/repository/files/${encodeURIComponent(path)}/raw?ref=${encodeURIComponent(ref)}`,
706
+ { text: true }
707
+ ));
708
+ const text = response.data;
709
+ if (text.length <= MAX_RENDER_BYTES) return { content: text, truncated: false };
710
+ const head = text.slice(0, MAX_RENDER_BYTES);
711
+ return { content: head.slice(0, head.lastIndexOf('\n') + 1 || head.length), truncated: true };
712
+ },
713
+
714
+ async listFiles(context, id) {
715
+ const url = `${gitlabWebBase(context.credentials)}/${context.binding.locator}/-/merge_requests/${id}/diffs`;
716
+ const diffs = await onProject(() => gitlabPaged<GitLabDiffWire>(
717
+ context.credentials,
718
+ `${project(context)}/merge_requests/${id}/diffs`,
719
+ 3
720
+ ));
721
+ return diffs.map((diff) => toFileChange(diff, url));
722
+ },
723
+
724
+ async listAssignees(context) {
725
+ const members = await onProject(() => gitlabPaged<{ username: string; state?: string }>(
726
+ context.credentials,
727
+ `${project(context)}/members/all`,
728
+ 2
729
+ ));
730
+ return [...new Set(members.filter((member) => member.state !== 'blocked').map((member) => member.username))];
731
+ },
732
+
733
+ async setAssignees(context, kind, id, logins) {
734
+ const ids = await userIds(context.credentials, logins);
735
+ await onProject(() => gitlabRequest(context.credentials, `${project(context)}/${itemsPath(kind)}/${id}`, {
736
+ method: 'PUT',
737
+ // An empty list must be sent as [0] to clear, per GitLab's API.
738
+ body: { assignee_ids: ids.length > 0 ? ids : [0] }
739
+ }));
740
+ },
741
+
742
+ async setLabels(context, kind, id, labels) {
743
+ await onProject(() => gitlabRequest(context.credentials, `${project(context)}/${itemsPath(kind)}/${id}`, {
744
+ method: 'PUT',
745
+ body: { labels: labels.join(',') }
746
+ }));
747
+ },
748
+
749
+ async setReviewers(context, id, logins) {
750
+ const ids = await userIds(context.credentials, logins);
751
+ await onProject(() => gitlabRequest(context.credentials, `${project(context)}/merge_requests/${id}`, {
752
+ method: 'PUT',
753
+ body: { reviewer_ids: ids.length > 0 ? ids : [0] }
754
+ }));
755
+ },
756
+
757
+ async createIssue(context, draft) {
758
+ const ids = draft.assignees.length > 0 ? await userIds(context.credentials, draft.assignees) : [];
759
+ const response = await onProject(() => gitlabRequest<GitLabItemWire>(context.credentials, `${project(context)}/issues`, {
760
+ method: 'POST',
761
+ body: {
762
+ title: draft.title,
763
+ description: draft.body,
764
+ ...(draft.labels.length > 0 && { labels: draft.labels.join(',') }),
765
+ ...(ids.length > 0 && { assignee_ids: ids })
766
+ }
767
+ }));
768
+ return toWorkItem(response.data, 'issue');
769
+ }
770
+ };