@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
@@ -17,7 +17,7 @@
17
17
  */
18
18
  export const INTEGRATION_CAPABILITIES = [
19
19
  'agent-tools',
20
- /** Issues, pull requests and CI — the Issues & PRs surface. */
20
+ /** Issues, pull requests and CI — the hosting view of the Git panel. */
21
21
  'work',
22
22
  'deployments',
23
23
  'database',
@@ -42,8 +42,52 @@ export type IntegrationAuthMethod =
42
42
  | 'oauth-code'
43
43
  | 'mcp-oauth'
44
44
  | 'connection-string'
45
+ /** Borrowed from a CLI already signed in on this machine — `gh`, `glab`, `tea`, or git's own keychain. */
46
+ | 'cli'
45
47
  | 'none';
46
48
 
49
+ /**
50
+ * Sign-in facts for a provider that hosts git repositories.
51
+ *
52
+ * Declared per provider so the connect dialog can offer every method the
53
+ * service supports, in the order that costs the user least: a CLI that is
54
+ * already signed in, then a browser sign-in, then a pasted token.
55
+ */
56
+ export interface IntegrationHostingInfo {
57
+ /** `github.com`, `gitlab.com` — null when the service is self-hosted only. */
58
+ defaultHost: string | null;
59
+ /** True when a server URL may (or must) be given. */
60
+ selfHosted: boolean;
61
+ /** True when the server URL is required — there is no cloud default. */
62
+ requiresServerUrl: boolean;
63
+ /** The CLI whose login can be borrowed, when there is one. */
64
+ cli: 'gh' | 'glab' | 'tea' | null;
65
+ /** OAuth device flow is available (a client id may still be needed). */
66
+ deviceFlow: boolean;
67
+ /** OAuth authorization-code + PKCE in the browser is available. */
68
+ browserFlow: boolean;
69
+ /**
70
+ * Whether Clopen ships a client id for the cloud host. Without one, OAuth
71
+ * needs the user's own app's client id — always true for a self-hosted
72
+ * server, which Clopen has no app on.
73
+ */
74
+ hasBundledClientId: boolean;
75
+ /** Where to register an OAuth app on this service, for the "use your own" hint. */
76
+ oauthAppUrl: string | null;
77
+ /** Scopes Clopen asks for, shown before the user consents. */
78
+ scopes: string[];
79
+ }
80
+
81
+ /** Hosting facts about one connected account — never the credential. */
82
+ export interface IntegrationAccountHosting {
83
+ host: string;
84
+ login: string | null;
85
+ /** The CLI this account re-reads its token from on every use, when linked. */
86
+ linkedCli: 'gh' | 'glab' | 'tea' | null;
87
+ /** When an OAuth token stops working without a refresh. Null = no expiry. */
88
+ expiresAt: string | null;
89
+ }
90
+
47
91
  /**
48
92
  * Declared as a const array rather than a bare union so the WebSocket schema can
49
93
  * be generated from it. A `t.String()` there would widen `category` back to
@@ -95,9 +139,13 @@ export interface IntegrationProviderInfo {
95
139
  */
96
140
  consoleUrl?: string;
97
141
  authMethod: IntegrationAuthMethod;
142
+ /** Every way this provider can be connected, preferred first. Always includes `authMethod`. */
143
+ authMethods: IntegrationAuthMethod[];
98
144
  credentialFields: IntegrationCredentialField[];
99
145
  capabilities: IntegrationCapability[];
100
146
  defaultCapabilities: IntegrationCapability[];
147
+ /** Present for providers that host git repositories. */
148
+ hosting?: IntegrationHostingInfo;
101
149
  /** True when connecting projects an MCP server row. */
102
150
  providesAgentTools: boolean;
103
151
  /** True when the provider can receive inbound webhooks. */
@@ -122,6 +170,8 @@ export interface IntegrationAccountInfo {
122
170
  updatedAt: string;
123
171
  /** Surfaces this account currently owns a row on. */
124
172
  projections: IntegrationProjectionInfo[];
173
+ /** Present for accounts of a git hosting provider. */
174
+ hosting?: IntegrationAccountHosting;
125
175
  }
126
176
 
127
177
  export interface IntegrationProjectionInfo {
@@ -351,40 +351,19 @@ export interface RetrievalResult {
351
351
  // Visualization
352
352
  // ─────────────────────────────────────────────────────────────────────────────
353
353
 
354
- /** A node as sent to the graph view: display fields plus its community. */
355
- export interface GraphViewNode {
356
- id: string;
357
- subkind: GraphNodeSubkind;
358
- scope: GraphScope;
359
- label: string;
360
- projectId: string | null;
361
- /** Degree, used to size the node. */
362
- degree: number;
363
- weight: number;
364
- pinned: boolean;
365
- /** Louvain community index — the "lobe" a node belongs to. */
366
- community: number;
367
- createdAt: string;
368
- /**
369
- * Where the persisted layout put this node, when it has been laid out.
370
- *
371
- * Absent means "no position yet" — a memory written since the last layout
372
- * pass — and the client seeds those from their neighbours rather than
373
- * re-solving the whole graph. See `backend/memory/layout.ts`.
374
- */
375
- x?: number;
376
- y?: number;
377
- }
378
-
379
- export interface GraphViewEdge {
380
- id: number;
381
- source: string;
382
- target: string;
383
- rel: GraphRelation;
384
- weight: number;
354
+ /**
355
+ * The square the graph view is cut into tiles from, in layout coordinates.
356
+ *
357
+ * Fixed between layout passes that change the map, so a tile's address means
358
+ * the same rectangle for as long as the client's `epoch` matches the server's.
359
+ */
360
+ export interface GraphWorld {
361
+ minX: number;
362
+ minY: number;
363
+ size: number;
385
364
  }
386
365
 
387
- /** A rectangle in layout space — what a zoomed-in view is scoped to. */
366
+ /** A rectangle in layout space. */
388
367
  export interface GraphRegion {
389
368
  minX: number;
390
369
  maxX: number;
@@ -393,65 +372,109 @@ export interface GraphRegion {
393
372
  }
394
373
 
395
374
  /**
396
- * Several memories that fell in one cell of the layout grid, drawn as one mark.
375
+ * Everything the view needs before it can ask for a single tile.
397
376
  *
398
- * This is what keeps the view's cost bounded without taking anything out of the
399
- * picture, and the distinction from the alternative matters. Grouping by
400
- * COMMUNITY replaces the picture — you see lobes instead of memories, and
401
- * reaching a memory means opening one. Grouping by POSITION keeps the picture:
402
- * marks merge only where their dots would have overlapped anyway, so the
403
- * silhouette, the lobes and the colours are the ones the full graph would have
404
- * drawn. Below the render budget nothing merges at all and every memory is its
405
- * own mark, exactly as before.
377
+ * The counts are the FILTER's, not the screen's: how many memories match, how
378
+ * many of those have a place on the map, and where they are — which is what
379
+ * "Fit" frames.
380
+ */
381
+ export interface GraphViewMeta {
382
+ /** Changes whenever the world does; a tile from another epoch is from another map. */
383
+ epoch: number;
384
+ /** Changes whenever a layout pass writes; tiles from an older stamp may be missing memories. */
385
+ stamp: number;
386
+ /** Null until the first layout pass has placed anything. */
387
+ world: GraphWorld | null;
388
+ /** Median distance between a memory and its nearest neighbour, in layout units. */
389
+ spacing: number;
390
+ /** Memories matching the filter. */
391
+ total: number;
392
+ /** Of those, how many have no position yet — they appear once a pass places them. */
393
+ unplaced: number;
394
+ /** Where the placed matches are; null when none are. */
395
+ extent: GraphRegion | null;
396
+ /** The degree that counts as "fully connected" when sizing nodes; see `degreeScale`. */
397
+ degreeScale: number;
398
+ }
399
+
400
+ /** A memory as a tile carries it: enough to draw and hover, nothing to inspect. */
401
+ export interface GraphTileNode {
402
+ id: string;
403
+ label: string;
404
+ /** Louvain community index — the "lobe" a node belongs to, and its colour. */
405
+ community: number;
406
+ /** Connections in the whole graph, stored and derived. Sizes the node. */
407
+ degree: number;
408
+ x: number;
409
+ y: number;
410
+ }
411
+
412
+ /**
413
+ * Several memories sharing one cell of a crowded tile, drawn as one mark.
406
414
  *
407
- * A bin is not a memory — it has no body, no scope and nothing to inspect —
408
- * which is why it travels in its own array rather than as a node wearing a fake
409
- * subkind.
415
+ * Only a tile with more memories than its budget is folded like this, and only
416
+ * where a cell holds more than one; zooming in asks for smaller tiles, which
417
+ * fit, so a cluster always resolves into its memories by zooming alone.
410
418
  */
411
- export interface GraphViewBin {
412
- /** `bin:<cellX>:<cellY>` — namespaced so it cannot collide with a node id. */
419
+ export interface GraphTileCluster {
420
+ /** `cluster:<z>:<cellX>:<cellY>` — namespaced so it cannot collide with a node id. */
413
421
  id: string;
414
- /** How many memories it stands for; drives its size. */
415
422
  members: number;
416
423
  /** The most reinforced member's summary, for the hover pill. */
417
424
  label: string;
418
425
  /** Community of that same member, so the mark keeps its lobe's colour. */
419
426
  community: number;
420
- /** Centroid of its members — not the cell's centre, which would grid the map. */
427
+ /** Centroid of the members. */
421
428
  x: number;
422
429
  y: number;
423
- /** The cell itself, so opening the mark asks for exactly this rectangle. */
424
- region: GraphRegion;
430
+ /** The cell, in global cell coordinates at this tile's zoom. */
431
+ cellX: number;
432
+ cellY: number;
425
433
  }
426
434
 
427
- /** A connection between two bins, weighted by the edges that cross between them. */
428
- export interface GraphViewBinEdge {
435
+ /**
436
+ * An edge from one of a tile's memories, with where its far end sits.
437
+ *
438
+ * The far end may be in a tile the client has not loaded, or folded into a
439
+ * cluster there — its position is what lets the client attach the edge to
440
+ * whichever mark currently stands for it.
441
+ */
442
+ export interface GraphTileEdge {
429
443
  source: string;
430
444
  target: string;
431
445
  weight: number;
446
+ targetX: number;
447
+ targetY: number;
432
448
  }
433
449
 
434
- export interface GraphView {
435
- /**
436
- * `flat` when every matching memory is drawn individually — the ordinary case,
437
- * and the only one below the render budget. `binned` when some marks stand for
438
- * more than one memory.
439
- *
440
- * Both populate `nodes`: a cell holding a single memory returns that memory,
441
- * not a bin of one. So the two are not alternatives to each other — a binned
442
- * view is a full-fidelity view everywhere it can afford to be.
443
- */
444
- level: 'flat' | 'binned';
445
- nodes: GraphViewNode[];
446
- edges: GraphViewEdge[];
447
- bins: GraphViewBin[];
448
- binEdges: GraphViewBinEdge[];
449
- /** The rectangle this view was scoped to, when the caller zoomed into one. */
450
- region: GraphRegion | null;
451
- /** Total nodes matching the filter before any display cap was applied. */
452
- totalNodes: number;
453
- /** True when `totalNodes` exceeded the cap and the view was trimmed. */
454
- truncated: boolean;
450
+ /** An edge out of a crowded tile, rolled up to the cell it lands in. */
451
+ export interface GraphTileCellEdge {
452
+ /** The mark in this tile it leaves from — a cluster id or a memory id. */
453
+ source: string;
454
+ targetCellX: number;
455
+ targetCellY: number;
456
+ weight: number;
457
+ }
458
+
459
+ /** One square of the map at one zoom level. */
460
+ export interface GraphTile {
461
+ z: number;
462
+ x: number;
463
+ y: number;
464
+ /** Cells per tile side when this tile was folded; 0 when it was not. */
465
+ cells: number;
466
+ nodes: GraphTileNode[];
467
+ clusters: GraphTileCluster[];
468
+ edges: GraphTileEdge[];
469
+ cellEdges: GraphTileCellEdge[];
470
+ }
471
+
472
+ export interface GraphTilesResponse {
473
+ /** The server's epoch. When it is not the one asked about, `stale` is set. */
474
+ epoch: number;
475
+ /** The map changed since the client last read the meta; nothing was served. */
476
+ stale: boolean;
477
+ tiles: GraphTile[];
455
478
  }
456
479
 
457
480
  /**
@@ -0,0 +1,96 @@
1
+ /**
2
+ * `@` mentions — everything a message can point at besides its own files.
3
+ *
4
+ * A mention becomes a numbered attachment of the message, like a dropped file:
5
+ * the same `@N`, the same card, the same renumbering. What the attachment holds
6
+ * is a snapshot taken at the moment it was mentioned — a terminal's output, a
7
+ * diff, a page element — written as a document whose first line says what it
8
+ * is (see `shared/utils/context-document.ts`). Every snapshot is saved into the
9
+ * session's folder and the engine is given its path, so a big one costs the
10
+ * model a read, not its context window.
11
+ */
12
+
13
+ import type { IconName } from './ui/icons';
14
+
15
+ /** What a mention is of. */
16
+ export type ContextKind =
17
+ | 'file'
18
+ | 'folder'
19
+ | 'code'
20
+ | 'terminal'
21
+ | 'terminal-selection'
22
+ | 'git-changes'
23
+ | 'git-staged'
24
+ | 'git-file'
25
+ | 'git-commit'
26
+ | 'git-branch'
27
+ | 'git-stash'
28
+ | 'git-conflicts'
29
+ | 'preview-tab'
30
+ | 'preview-element'
31
+ | 'preview-console'
32
+ | 'chat-session'
33
+ | 'chat-message'
34
+ | 'project'
35
+ | 'ai-changes'
36
+ | 'work-item'
37
+ | 'note'
38
+ | 'memory'
39
+ | 'db-connection'
40
+ | 'db-table'
41
+ | 'db-result'
42
+ | 'deployment'
43
+ | 'container'
44
+ | 'port'
45
+ | 'env-file';
46
+
47
+ /**
48
+ * What a context attachment is, read from its own first line. Carried on the
49
+ * saved message too (`FileBlock.source`), so the timeline can draw the card
50
+ * without reading the file.
51
+ */
52
+ export interface ContextSource {
53
+ kind: ContextKind;
54
+ /** Short name: a tab title, a file path, a commit subject. */
55
+ label: string;
56
+ /** One line of extra detail: "1,240 lines", "src/app.ts · L10–24". */
57
+ detail?: string;
58
+ /**
59
+ * For a `file` mention, the file itself, relative to the workspace root:
60
+ * the engine is pointed at the real file rather than at a copy of it.
61
+ */
62
+ path?: string;
63
+ /** ISO time the snapshot was taken. */
64
+ capturedAt: string;
65
+ }
66
+
67
+ /** Where a mentionable thing is looked up when it is picked. */
68
+ export type MentionRef = Record<string, string | number | boolean | null>;
69
+
70
+ /** One row of the `@` picker. */
71
+ export interface MentionCandidate {
72
+ /** Unique within one result list. */
73
+ key: string;
74
+ kind: ContextKind;
75
+ /** Heading the row is listed under. */
76
+ group: string;
77
+ label: string;
78
+ /** Every row has one, so the list reads evenly. */
79
+ detail: string;
80
+ icon: IconName;
81
+ /** Handed back to `mentions:capture` when the row is picked. */
82
+ ref: MentionRef;
83
+ /**
84
+ * Set on a row that opens a list rather than being picked — a category, a
85
+ * database to look into. The value is the category asked for next.
86
+ */
87
+ browse?: string;
88
+ }
89
+
90
+ /** A file a capture produced: a context document, or an image beside it. */
91
+ export interface CapturedAttachment {
92
+ fileName: string;
93
+ mediaType: string;
94
+ /** Base64 bytes. */
95
+ data: string;
96
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * A GitHub release, read for the people who use Clopen rather than the people
3
+ * who build it: conventional-commit prefixes become a kind, author handles and
4
+ * pull-request URLs become a number. See backend/update/release-notes.ts.
5
+ */
6
+
7
+ export type ReleaseChangeKind = 'feature' | 'improvement' | 'fix' | 'other';
8
+
9
+ export interface ReleaseChange {
10
+ kind: ReleaseChangeKind;
11
+ /** The commit scope — `chat`, `git`, `server` — when the entry had one. */
12
+ scope?: string;
13
+ /** The entry itself, first letter capitalised, author and link removed. */
14
+ summary: string;
15
+ breaking: boolean;
16
+ pullNumber?: number;
17
+ pullUrl?: string;
18
+ }
19
+
20
+ export interface ReleaseNote {
21
+ /** `0.4.50`, no prefix. */
22
+ version: string;
23
+ tagName: string;
24
+ url: string;
25
+ publishedAt: string;
26
+ changes: ReleaseChange[];
27
+ /** GitHub handles from the "New Contributors" section. */
28
+ newContributors: string[];
29
+ /** Hand-written markdown that is not a change entry, if the release had any. */
30
+ notes: string;
31
+ }
@@ -0,0 +1,175 @@
1
+ /**
2
+ * Settings → Storage: what Clopen keeps on disk, and what can be removed.
3
+ *
4
+ * One report answers both questions. The scanner measures every category once,
5
+ * attributes what it can to a project, and prices every cleanup at the same
6
+ * time, so the numbers a cleanup promises are the numbers the report shows.
7
+ */
8
+
9
+ import type { EngineType } from './unified';
10
+
11
+ export type StorageCategoryId =
12
+ | 'chats'
13
+ | 'engine-transcripts'
14
+ | 'engine-caches'
15
+ | 'snapshots'
16
+ | 'worktrees'
17
+ | 'preview-profiles'
18
+ | 'stack'
19
+ | 'other';
20
+
21
+ export interface StorageCategory {
22
+ id: StorageCategoryId;
23
+ bytes: number;
24
+ /** Bytes the safe cleanups would free from this category right now. */
25
+ reclaimableBytes: number;
26
+ }
27
+
28
+ /** Clopen data attributable to one project. */
29
+ export interface StorageProjectBreakdown {
30
+ chats: number;
31
+ engineTranscripts: number;
32
+ snapshots: number;
33
+ worktrees: number;
34
+ previewProfiles: number;
35
+ }
36
+
37
+ export interface StorageProjectEntry {
38
+ projectId: string;
39
+ name: string;
40
+ path: string;
41
+ /** Sum of `breakdown` — Clopen's data for this project, not the project folder. */
42
+ bytes: number;
43
+ breakdown: StorageProjectBreakdown;
44
+ sessionCount: number;
45
+ slimmedSessionCount: number;
46
+ worktreeCount: number;
47
+ lastActivityAt: string | null;
48
+ }
49
+
50
+ export interface StorageEngineEntry {
51
+ engine: EngineType;
52
+ /** Session transcripts and stores. */
53
+ transcriptBytes: number;
54
+ transcriptCount: number;
55
+ /** Transcripts no chat in Clopen refers to any more. */
56
+ orphanBytes: number;
57
+ orphanCount: number;
58
+ /** Transcripts fully contained in a later one (Claude forks). */
59
+ redundantBytes: number;
60
+ redundantCount: number;
61
+ /** Everything else under the engine's home: tool caches, logs, plugins, config. */
62
+ otherBytes: number;
63
+ }
64
+
65
+ export type CleanupActionId =
66
+ | 'orphan-transcripts'
67
+ | 'dedupe-transcripts'
68
+ | 'orphan-snapshots'
69
+ | 'orphan-profiles'
70
+ | 'orphan-worktree-dirs'
71
+ | 'legacy-engine-data'
72
+ | 'browser-cache'
73
+ | 'tool-caches'
74
+ | 'engine-logs'
75
+ | 'compact-database'
76
+ | 'stale-worktrees'
77
+ | 'project-profiles'
78
+ | 'slim-old-chats'
79
+ | 'delete-old-chats';
80
+
81
+ /**
82
+ * - `safe` — nothing anyone uses: leftovers, duplicates, caches.
83
+ * - `caution` — removes something in use that comes back on its own, at a
84
+ * cost (a sign-in, a download, a short pause).
85
+ * - `destructive` — removes something that does not come back.
86
+ */
87
+ export type CleanupTier = 'safe' | 'caution' | 'destructive';
88
+
89
+ export interface CleanupActionMeta {
90
+ id: CleanupActionId;
91
+ tier: CleanupTier;
92
+ /** Takes an age threshold in days. */
93
+ usesAge: boolean;
94
+ /** Can be narrowed to one project. */
95
+ projectScoped: boolean;
96
+ /** Can run on a schedule. */
97
+ automatable: boolean;
98
+ }
99
+
100
+ export interface CleanupEstimate {
101
+ action: CleanupActionId;
102
+ bytes: number;
103
+ items: number;
104
+ }
105
+
106
+ export interface CleanupRequest {
107
+ action: CleanupActionId;
108
+ projectId?: string | null;
109
+ olderThanDays?: number;
110
+ }
111
+
112
+ export interface CleanupResult {
113
+ action: CleanupActionId;
114
+ freedBytes: number;
115
+ items: number;
116
+ errors: string[];
117
+ /** Set when the action did nothing because something was in use. */
118
+ skippedReason?: string;
119
+ }
120
+
121
+ export interface StorageReport {
122
+ generatedAt: string;
123
+ durationMs: number;
124
+ dataDir: string;
125
+ totalBytes: number;
126
+ /** The volume the data directory lives on. Null where it cannot be read. */
127
+ disk: { totalBytes: number; freeBytes: number } | null;
128
+ categories: StorageCategory[];
129
+ projects: StorageProjectEntry[];
130
+ /** Clopen data no project owns: caches, Stack, the database's own overhead. */
131
+ unattributedBytes: number;
132
+ engines: StorageEngineEntry[];
133
+ /** Priced at scan time for every action that needs no parameters. */
134
+ estimates: CleanupEstimate[];
135
+ database: {
136
+ fileBytes: number;
137
+ /** Pages SQLite holds free inside the file; VACUUM returns them to the disk. */
138
+ freeBytes: number;
139
+ incrementalVacuum: boolean;
140
+ };
141
+ }
142
+
143
+ export interface StorageScanStatus {
144
+ scanning: boolean;
145
+ phase: string | null;
146
+ /** 0..1, null when the phase cannot tell. */
147
+ progress: number | null;
148
+ startedAt: string | null;
149
+ error: string | null;
150
+ }
151
+
152
+ export interface StoragePolicyAction {
153
+ enabled: boolean;
154
+ olderThanDays?: number;
155
+ }
156
+
157
+ export interface StoragePolicy {
158
+ /** Master switch for scheduled cleanup. */
159
+ enabled: boolean;
160
+ /** Hours between scheduled runs. */
161
+ intervalHours: number;
162
+ actions: Partial<Record<CleanupActionId, StoragePolicyAction>>;
163
+ lastRunAt: string | null;
164
+ }
165
+
166
+ export interface StorageCleanupRun {
167
+ id: number;
168
+ action: CleanupActionId;
169
+ trigger: 'manual' | 'auto' | 'delete';
170
+ startedAt: string;
171
+ finishedAt: string | null;
172
+ freedBytes: number;
173
+ items: number;
174
+ error: string | null;
175
+ }
@@ -96,6 +96,22 @@ export interface AppSettings {
96
96
  * level chosen per model. Absent key → use the engine/model default.
97
97
  */
98
98
  reasoningDefaults: Record<string, string>;
99
+ /** How the preview browser's screenshot button captures and saves. */
100
+ previewScreenshot: PreviewScreenshotSettings;
101
+ }
102
+
103
+ /** Preview browser screenshot preferences, remembered per user. */
104
+ export interface PreviewScreenshotSettings {
105
+ /** Format for downloads and saves. Copies are always PNG — clipboards take nothing else. */
106
+ format: 'png' | 'jpeg';
107
+ /** JPEG quality, 1–100. */
108
+ quality: number;
109
+ /** Capture the whole scrollable page instead of what is on screen. */
110
+ fullPage: boolean;
111
+ /** Draw the device mockup around an on-screen capture. */
112
+ deviceFrame: boolean;
113
+ /** Workspace-relative folder that "Save to project" writes into. */
114
+ folder: string;
99
115
  }
100
116
 
101
117
  /** Authentication mode */
@@ -118,6 +118,7 @@ export type {
118
118
  TextBlock,
119
119
  ImageBlock,
120
120
  DocumentBlock,
121
+ FileBlock,
121
122
  UserContentBlock,
122
123
  AssistantContentBlock,
123
124
  UserMessage,
@@ -146,6 +147,7 @@ export type {
146
147
  RateLimitEvent,
147
148
  RateLimitType,
148
149
  NotificationEvent,
150
+ BackgroundWorkEvent,
149
151
  EngineOutput,
150
152
  StreamEventType,
151
153
  StreamStatus,
@@ -7,6 +7,7 @@
7
7
 
8
8
  import type { TokenUsage, StopReason } from './common';
9
9
  import type { ToolUseBlock, ToolResult } from './tool';
10
+ import type { ContextSource } from '../mentions';
10
11
 
11
12
  // ============================================================
12
13
  // Message Base
@@ -71,6 +72,8 @@ export interface ImageBlock {
71
72
  data: string;
72
73
  /** Original file name, so the message (and editing it) shows what was attached. */
73
74
  title?: string | null;
75
+ /** Attachment number within its message, from 1 — what `@1` in the text names. */
76
+ index?: number;
74
77
  }
75
78
 
76
79
  export interface DocumentBlock {
@@ -78,13 +81,35 @@ export interface DocumentBlock {
78
81
  mediaType: string;
79
82
  data: string;
80
83
  title: string | null;
84
+ /** Attachment number within its message, from 1 — what `@1` in the text names. */
85
+ index?: number;
86
+ }
87
+
88
+ /**
89
+ * An attachment the model does not read inline: saved into the session's
90
+ * working tree and named in the prompt instead (see backend/chat/attachments).
91
+ * The message keeps where it went, not its bytes.
92
+ */
93
+ export interface FileBlock {
94
+ type: 'file';
95
+ mediaType: string;
96
+ title: string | null;
97
+ /** Size in bytes. */
98
+ size: number;
99
+ /** Absolute path of the saved copy — or of the file itself, for a mentioned project file. */
100
+ path: string;
101
+ /** Attachment number within its message, from 1 — what `@1` in the text names. */
102
+ index?: number;
103
+ /** What an `@` mention attached: read from the document's header when it was saved. */
104
+ source?: ContextSource;
81
105
  }
82
106
 
83
107
  export type UserContentBlock =
84
108
  | TextBlock
85
109
  | ToolResult
86
110
  | ImageBlock
87
- | DocumentBlock;
111
+ | DocumentBlock
112
+ | FileBlock;
88
113
 
89
114
  export type AssistantContentBlock =
90
115
  | TextBlock