@openchamber/web 1.23.2 → 1.24.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/bin/cli.test.js +7 -6
  2. package/bin/lib/cli-http.js +5 -1
  3. package/dist/assets/{CodeMirrorCommentWidgets-DdNGwbBw.js → CodeMirrorCommentWidgets-DvUH815P.js} +1 -1
  4. package/dist/assets/DiffView-DkC3xlRJ.js +4 -0
  5. package/dist/assets/FilesView-D0bM9FVB.js +13 -0
  6. package/dist/assets/GitView-Bxuv3dfP.js +6 -0
  7. package/dist/assets/GuestAttachDialog-B0u3Q5uO.js +1 -0
  8. package/dist/assets/{JsonTreeView-Chzx5Y6N.js → JsonTreeView-BBVPFM5K.js} +1 -1
  9. package/dist/assets/LinearIssuesView-UI1FcSC8.js +1 -0
  10. package/dist/assets/{MarkdownImageGallery-CugnrZ6f.js → MarkdownImageGallery-CUJxH8Le.js} +1 -1
  11. package/dist/assets/MarkdownRendererImpl-D5BZOg8X.js +12 -0
  12. package/dist/assets/{OnboardingScreen-hH9xcTjA.js → OnboardingScreen-5Gou9cGD.js} +1 -1
  13. package/dist/assets/{PatchDiff-DRgNYc9l.js → PatchDiff-C4rE5k6z.js} +1 -1
  14. package/dist/assets/{PierreDiffViewer-ZT2CKuzJ.js → PierreDiffViewer-ByRVu6ss.js} +5 -5
  15. package/dist/assets/PlanView-u2yi5XGJ.js +5 -0
  16. package/dist/assets/PluginPane-QxjsKYeO.js +3 -0
  17. package/dist/assets/SettingsView-Fo5ZqMaT.js +29 -0
  18. package/dist/assets/{SettingsWindow-DisOghhD.js → SettingsWindow-HVDVANjJ.js} +1 -1
  19. package/dist/assets/SubmoduleDiffSummary-D3hzkybB.js +1 -0
  20. package/dist/assets/ToolOutputDialog-3J6IRayW.js +15 -0
  21. package/dist/assets/{ToolPartDiffPreview-oWxWCu-4.js → ToolPartDiffPreview-DarxPjSd.js} +2 -2
  22. package/dist/assets/{VirtualizedFileDiff-CiyrAq_I.js → VirtualizedFileDiff-CZgXWHjU.js} +4 -4
  23. package/dist/assets/{WalkthroughView-CKTevaea.js → WalkthroughView-wSpED5L4.js} +2 -2
  24. package/dist/assets/appThemeRegistry-Cf8KitzT.js +1 -0
  25. package/dist/assets/commitAndPush-DZnzlhvc.js +1 -0
  26. package/dist/assets/{computeVirtualFileMetrics-SUWoTyPe.js → computeVirtualFileMetrics-VYnT_A2h.js} +1 -1
  27. package/dist/assets/de-BM_8EDD3.js +10 -0
  28. package/dist/assets/es-CxZjlqpo.js +16 -0
  29. package/dist/assets/fr-VCixCnMW.js +14 -0
  30. package/dist/assets/{index-C4jJ3Ur5.js → index-3U4CtS9b.js} +1 -1
  31. package/dist/assets/index-B9Hvzjwl.css +1 -0
  32. package/dist/assets/index-DLHQogv8.js +40 -0
  33. package/dist/assets/{isDiffPlainText-DfG0cZxr.js → isDiffPlainText-ImDG3Uhg.js} +1 -1
  34. package/dist/assets/{isFilePlainText-CyNivOCU.js → isFilePlainText-D_YDVYDb.js} +1 -1
  35. package/dist/assets/ja-CZ5k_GyD.js +16 -0
  36. package/dist/assets/ko-7YM3A1Xh.js +16 -0
  37. package/dist/assets/{main-B8cGozKr.js → main-CycplCph.js} +2 -2
  38. package/dist/assets/main-DFYTCx5o.js +896 -0
  39. package/dist/assets/{markdown-shiki.worker-D5fBU-lw.js → markdown-shiki.worker-CahLvHIq.js} +5 -5
  40. package/dist/assets/markdownCore-DHvqMxPn.js +5 -0
  41. package/dist/assets/{miniChat-Cay99IxR.js → miniChat-DIQKfY2V.js} +2 -2
  42. package/dist/assets/{mobile-Zfhix7nz.js → mobile-BMwz5q-m.js} +2 -2
  43. package/dist/assets/{patchFileDiff-CJ5AN9Ql.js → patchFileDiff-DDQ6Rq5e.js} +3 -3
  44. package/dist/assets/pl-BcgDO_w5.js +16 -0
  45. package/dist/assets/{pt-BR-CLosVawq.js → pt-BR-CU2u_1q5.js} +4 -4
  46. package/dist/assets/renderElectronMiniChatApp-3_d6g6CU.js +2 -0
  47. package/dist/assets/renderMobileApp-D0Y8DtkA.js +25 -0
  48. package/dist/assets/runtimeEndpointReset-DhC3REb2.js +25 -0
  49. package/dist/assets/{scheduledTasksApi-CGFV4Pap.js → scheduledTasksApi-D8pq6gQz.js} +1 -1
  50. package/dist/assets/shikiHighlight-1imXsir9.js +1 -0
  51. package/dist/assets/textMateThemeFromAppTheme-Dgqc63LZ.js +1 -0
  52. package/dist/assets/tr-DuYhOzNe.js +7 -0
  53. package/dist/assets/uk-Cuk7-uvq.js +16 -0
  54. package/dist/assets/useAppFontEffects-BItUWdo4.js +7333 -0
  55. package/dist/assets/useInlineCommentController-CkbKsm7m.js +2 -0
  56. package/dist/assets/useRootScrollLock-vmzxZjWA.js +2 -0
  57. package/dist/assets/{vendor-base-ui-BY_5qla_.js → vendor-base-ui-CsXYnR5c.js} +1 -1
  58. package/dist/assets/{vendor-codemirror-language-data-ES33GhKK.js → vendor-codemirror-language-data-BDyxuqK4.js} +2 -2
  59. package/dist/assets/vendor-framer-motion-Bq3iTZ6r.js +1 -0
  60. package/dist/assets/{vendor-motion-dom-D_o3BTI3.js → vendor-motion-dom-DcCgeG69.js} +1 -1
  61. package/dist/assets/vendor-strip-json-comments-5dJlOkP1.js +4 -0
  62. package/dist/assets/{vendor-tanstack-react-virtual-g05Cx3z9.js → vendor-tanstack-react-virtual-ClYN8CzB.js} +1 -1
  63. package/dist/assets/{vendor-tanstack-virtual-core-Dubg10g5.js → vendor-tanstack-virtual-core-BewVQryB.js} +1 -1
  64. package/dist/assets/{vendor-zod-B6551dwG.js → vendor-zod-fZppILAM.js} +4 -4
  65. package/dist/assets/{web-components-CJZwV5BE.js → web-components-D7FinaeH.js} +2 -2
  66. package/dist/assets/zh-CN-CUWoiRHd.js +16 -0
  67. package/dist/assets/zh-TW-CQ8EBSBN.js +16 -0
  68. package/dist/index.html +4 -4
  69. package/dist/mini-chat.html +4 -4
  70. package/dist/mobile.html +4 -4
  71. package/package.json +9 -6
  72. package/server/built-in-extensions/registry.json +4 -0
  73. package/server/index.d.ts +2 -0
  74. package/server/index.js +41 -10
  75. package/server/lib/changelog/update-notes.js +2 -1
  76. package/server/lib/changelog/update-notes.test.js +19 -0
  77. package/server/lib/event-stream/DOCUMENTATION.md +23 -0
  78. package/server/lib/event-stream/delta-coalescer.js +0 -0
  79. package/server/lib/event-stream/delta-coalescer.test.js +292 -0
  80. package/server/lib/event-stream/global-hub.js +53 -23
  81. package/server/lib/event-stream/global-hub.test.js +160 -0
  82. package/server/lib/event-stream/global-ws-bridge.js +1 -0
  83. package/server/lib/event-stream/index.js +4 -0
  84. package/server/lib/fs/DOCUMENTATION.md +8 -0
  85. package/server/lib/fs/git-process.test.js +77 -0
  86. package/server/lib/fs/routes.js +2 -1
  87. package/server/lib/fs/search.js +2 -1
  88. package/server/lib/git/DOCUMENTATION.md +19 -4
  89. package/server/lib/git/routes.js +16 -3
  90. package/server/lib/git/serial-refresh.js +93 -0
  91. package/server/lib/git/serial-refresh.test.js +112 -0
  92. package/server/lib/git/service.js +336 -62
  93. package/server/lib/git/service.test.js +400 -0
  94. package/server/lib/github/pr-status.js +5 -5
  95. package/server/lib/github/pr-status.test.js +1 -1
  96. package/server/lib/github/routes.js +4 -4
  97. package/server/lib/guests/DOCUMENTATION.md +68 -0
  98. package/server/lib/guests/auth-store.js +184 -0
  99. package/server/lib/guests/auth-store.test.js +112 -0
  100. package/server/lib/guests/background.test.js +83 -0
  101. package/server/lib/guests/builtins.js +34 -0
  102. package/server/lib/guests/builtins.test.js +174 -0
  103. package/server/lib/guests/catalog.js +477 -0
  104. package/server/lib/guests/catalog.test.js +390 -0
  105. package/server/lib/guests/clone.js +297 -0
  106. package/server/lib/guests/extract-zip.js +136 -0
  107. package/server/lib/guests/extract-zip.test.js +109 -0
  108. package/server/lib/guests/files.js +308 -0
  109. package/server/lib/guests/files.test.js +262 -0
  110. package/server/lib/guests/grant-scope.js +81 -0
  111. package/server/lib/guests/grant-scope.test.js +75 -0
  112. package/server/lib/guests/host-session.js +73 -0
  113. package/server/lib/guests/host-session.test.js +30 -0
  114. package/server/lib/guests/html-styles.js +6 -0
  115. package/server/lib/guests/html-styles.test.js +45 -0
  116. package/server/lib/guests/html-tokens.js +73 -0
  117. package/server/lib/guests/html-tokens.test.js +53 -0
  118. package/server/lib/guests/install.js +406 -0
  119. package/server/lib/guests/install.test.js +338 -0
  120. package/server/lib/guests/oauth.js +501 -0
  121. package/server/lib/guests/oauth.test.js +481 -0
  122. package/server/lib/guests/persist.js +336 -0
  123. package/server/lib/guests/persist.test.js +288 -0
  124. package/server/lib/guests/request.js +112 -0
  125. package/server/lib/guests/request.test.js +206 -0
  126. package/server/lib/guests/routes.js +838 -0
  127. package/server/lib/guests/service.js +538 -0
  128. package/server/lib/guests/service.test.js +277 -0
  129. package/server/lib/guests/sockets.js +129 -0
  130. package/server/lib/guests/sockets.test.js +110 -0
  131. package/server/lib/guests/ssh-install.test.js +188 -0
  132. package/server/lib/guests/storage.js +68 -0
  133. package/server/lib/guests/storage.test.js +59 -0
  134. package/server/lib/guests/updates.js +294 -0
  135. package/server/lib/guests/updates.test.js +334 -0
  136. package/server/lib/guests/upload.js +50 -0
  137. package/server/lib/guests/upload.test.js +131 -0
  138. package/server/lib/linear/DOCUMENTATION.md +1 -1
  139. package/server/lib/message-queue/DOCUMENTATION.md +6 -0
  140. package/server/lib/message-queue/runtime.js +5 -0
  141. package/server/lib/message-queue/runtime.test.js +32 -1
  142. package/server/lib/openchamber-control/DOCUMENTATION.md +6 -0
  143. package/server/lib/openchamber-sessions/routes.js +44 -11
  144. package/server/lib/openchamber-sessions/routes.test.js +47 -0
  145. package/server/lib/opencode/DOCUMENTATION.md +40 -0
  146. package/server/lib/opencode/core-routes.js +39 -1
  147. package/server/lib/opencode/feature-routes-runtime.js +15 -0
  148. package/server/lib/opencode/lifecycle-process.test.js +84 -0
  149. package/server/lib/opencode/lifecycle.js +54 -67
  150. package/server/lib/opencode/settings-helpers.js +3 -0
  151. package/server/lib/opencode/settings-normalization-runtime.js +2 -0
  152. package/server/lib/opencode/settings-normalization-runtime.test.js +13 -0
  153. package/server/lib/opencode/settings-registry.json +12 -0
  154. package/server/lib/opencode/shutdown-runtime.js +3 -0
  155. package/server/lib/opencode/shutdown-runtime.test.js +24 -0
  156. package/server/lib/opencode/theme-archive.js +53 -0
  157. package/server/lib/opencode/theme-catalog.js +171 -0
  158. package/server/lib/opencode/theme-catalog.test.js +125 -0
  159. package/server/lib/opencode/theme-import.test.js +144 -0
  160. package/server/lib/opencode/theme-runtime.js +100 -28
  161. package/server/lib/opencode/theme-runtime.test.js +15 -0
  162. package/server/lib/permission-auto-accept/DOCUMENTATION.md +8 -0
  163. package/server/lib/permission-auto-accept/runtime.js +13 -0
  164. package/server/lib/permission-auto-accept/runtime.test.js +37 -1
  165. package/server/lib/quota/DOCUMENTATION.md +0 -1
  166. package/server/lib/quota/providers/index.js +0 -7
  167. package/server/lib/routing/DOCUMENTATION.md +81 -0
  168. package/server/lib/routing/defaults.js +98 -0
  169. package/server/lib/routing/feature-flag.js +11 -0
  170. package/server/lib/routing/history.js +34 -0
  171. package/server/lib/routing/jev.js +98 -0
  172. package/server/lib/routing/routes.http.test.js +100 -0
  173. package/server/lib/routing/routes.js +81 -0
  174. package/server/lib/routing/runtime.js +217 -0
  175. package/server/lib/routing/runtime.test.js +188 -0
  176. package/server/lib/routing/store.js +249 -0
  177. package/server/lib/routing/store.test.js +96 -0
  178. package/server/lib/security/request-security.js +9 -5
  179. package/server/lib/security/request-security.test.js +37 -0
  180. package/server/lib/terminal/DOCUMENTATION.md +2 -0
  181. package/server/lib/terminal/runtime.js +17 -2
  182. package/server/lib/terminal/runtime.test.js +45 -0
  183. package/server/lib/ui-auth/DOCUMENTATION.md +8 -0
  184. package/server/lib/ui-auth/session-cookie.js +51 -0
  185. package/server/lib/ui-auth/session-cookie.test.js +46 -0
  186. package/server/lib/ui-auth/ui-auth.js +56 -17
  187. package/server/lib/ui-auth/ui-auth.test.js +96 -0
  188. package/dist/assets/DiffView-GYriC0Wk.js +0 -4
  189. package/dist/assets/DirtyBranchSwitchDialog-Bv0C99hc.js +0 -1
  190. package/dist/assets/FilesView-2Lin13wx.js +0 -13
  191. package/dist/assets/GitView-9wKba3UO.js +0 -6
  192. package/dist/assets/LinearIssuesView-DXS9QJiR.js +0 -1
  193. package/dist/assets/MarkdownRendererImpl-CaMyct2Q.js +0 -12
  194. package/dist/assets/PlanView-DiTBm2BD.js +0 -5
  195. package/dist/assets/SettingsView-CN8VeM99.js +0 -28
  196. package/dist/assets/ToolOutputDialog-BqiKydxR.js +0 -15
  197. package/dist/assets/appThemeRegistry-BK0dHKa6.js +0 -1
  198. package/dist/assets/de-DQWC94VK.js +0 -10
  199. package/dist/assets/es-DixFUD3m.js +0 -16
  200. package/dist/assets/fr-D6u8tvfA.js +0 -14
  201. package/dist/assets/index-BvpFzhLs.js +0 -40
  202. package/dist/assets/index-n5p3SnES.css +0 -1
  203. package/dist/assets/ja-4u4pCorB.js +0 -16
  204. package/dist/assets/ko-C27-LW_b.js +0 -16
  205. package/dist/assets/main-tEA-fFPg.js +0 -930
  206. package/dist/assets/markdownCore-kyGrWGsn.js +0 -5
  207. package/dist/assets/pl-FtCjsNdW.js +0 -16
  208. package/dist/assets/registerCustomTheme-BBXUCRnG.js +0 -1
  209. package/dist/assets/renderElectronMiniChatApp-CuHOGlF4.js +0 -2
  210. package/dist/assets/renderMobileApp-C4X_KUH8.js +0 -25
  211. package/dist/assets/runtimeEndpointReset-CMg-KUx3.js +0 -41
  212. package/dist/assets/shikiHighlight-DdKWYWrV.js +0 -1
  213. package/dist/assets/tr-D2j6wUez.js +0 -7
  214. package/dist/assets/uk-C6IzmwM_.js +0 -16
  215. package/dist/assets/useAppFontEffects-DgCHy6Mr.js +0 -7282
  216. package/dist/assets/useGitComparison-BIaI0WZI.js +0 -1
  217. package/dist/assets/useInlineCommentController-2wcCtpM3.js +0 -2
  218. package/dist/assets/useRootScrollLock-CbWA03xR.js +0 -1
  219. package/dist/assets/vendor-framer-motion-livSKyyV.js +0 -1
  220. package/dist/assets/zh-CN-Wl6tIDz1.js +0 -16
  221. package/dist/assets/zh-TW-hgphoWSN.js +0 -16
  222. package/server/lib/quota/providers/crof.js +0 -96
  223. package/server/lib/quota/providers/crof.test.js +0 -98
package/dist/index.html CHANGED
@@ -509,16 +509,16 @@
509
509
  pointer-events: none;
510
510
  }
511
511
  </style>
512
- <script type="module" crossorigin src="/assets/main-B8cGozKr.js"></script>
512
+ <script type="module" crossorigin src="/assets/main-CycplCph.js"></script>
513
513
  <link rel="modulepreload" crossorigin href="/assets/vendor-vite-runtime-DD1OZmLC.js">
514
- <link rel="modulepreload" crossorigin href="/assets/vendor-zod-B6551dwG.js">
514
+ <link rel="modulepreload" crossorigin href="/assets/vendor-zod-fZppILAM.js">
515
515
  <link rel="modulepreload" crossorigin href="/assets/vendor-scheduler-7OC5HNn7.js">
516
516
  <link rel="modulepreload" crossorigin href="/assets/vendor-react-BUCujlKS.js">
517
517
  <link rel="modulepreload" crossorigin href="/assets/vendor-zustand-BAGL70zf.js">
518
518
  <link rel="modulepreload" crossorigin href="/assets/vendor-opencode-sdk-BJ73u-bH.js">
519
- <link rel="modulepreload" crossorigin href="/assets/index-BvpFzhLs.js">
519
+ <link rel="modulepreload" crossorigin href="/assets/index-DLHQogv8.js">
520
520
  <link rel="modulepreload" crossorigin href="/assets/contextPanelEmbeddedChat-CirXEPJq.js">
521
- <link rel="stylesheet" crossorigin href="/assets/index-n5p3SnES.css">
521
+ <link rel="stylesheet" crossorigin href="/assets/index-B9Hvzjwl.css">
522
522
  </head>
523
523
  <body class="h-full bg-background text-foreground">
524
524
  <div id="root" class="h-full">
@@ -74,15 +74,15 @@
74
74
  }
75
75
  </style>
76
76
 
77
- <script type="module" crossorigin src="/assets/miniChat-Cay99IxR.js"></script>
77
+ <script type="module" crossorigin src="/assets/miniChat-DIQKfY2V.js"></script>
78
78
  <link rel="modulepreload" crossorigin href="/assets/vendor-vite-runtime-DD1OZmLC.js">
79
- <link rel="modulepreload" crossorigin href="/assets/vendor-zod-B6551dwG.js">
79
+ <link rel="modulepreload" crossorigin href="/assets/vendor-zod-fZppILAM.js">
80
80
  <link rel="modulepreload" crossorigin href="/assets/vendor-scheduler-7OC5HNn7.js">
81
81
  <link rel="modulepreload" crossorigin href="/assets/vendor-react-BUCujlKS.js">
82
82
  <link rel="modulepreload" crossorigin href="/assets/vendor-zustand-BAGL70zf.js">
83
83
  <link rel="modulepreload" crossorigin href="/assets/vendor-opencode-sdk-BJ73u-bH.js">
84
- <link rel="modulepreload" crossorigin href="/assets/index-BvpFzhLs.js">
85
- <link rel="stylesheet" crossorigin href="/assets/index-n5p3SnES.css">
84
+ <link rel="modulepreload" crossorigin href="/assets/index-DLHQogv8.js">
85
+ <link rel="stylesheet" crossorigin href="/assets/index-B9Hvzjwl.css">
86
86
  </head>
87
87
  <body class="h-full bg-background text-foreground">
88
88
  <div id="root" class="h-full">
package/dist/mobile.html CHANGED
@@ -63,15 +63,15 @@
63
63
  })();
64
64
  </script>
65
65
 
66
- <script type="module" crossorigin src="/assets/mobile-Zfhix7nz.js"></script>
66
+ <script type="module" crossorigin src="/assets/mobile-BMwz5q-m.js"></script>
67
67
  <link rel="modulepreload" crossorigin href="/assets/vendor-vite-runtime-DD1OZmLC.js">
68
- <link rel="modulepreload" crossorigin href="/assets/vendor-zod-B6551dwG.js">
68
+ <link rel="modulepreload" crossorigin href="/assets/vendor-zod-fZppILAM.js">
69
69
  <link rel="modulepreload" crossorigin href="/assets/vendor-scheduler-7OC5HNn7.js">
70
70
  <link rel="modulepreload" crossorigin href="/assets/vendor-react-BUCujlKS.js">
71
71
  <link rel="modulepreload" crossorigin href="/assets/vendor-zustand-BAGL70zf.js">
72
72
  <link rel="modulepreload" crossorigin href="/assets/vendor-opencode-sdk-BJ73u-bH.js">
73
- <link rel="modulepreload" crossorigin href="/assets/index-BvpFzhLs.js">
74
- <link rel="stylesheet" crossorigin href="/assets/index-n5p3SnES.css">
73
+ <link rel="modulepreload" crossorigin href="/assets/index-DLHQogv8.js">
74
+ <link rel="stylesheet" crossorigin href="/assets/index-B9Hvzjwl.css">
75
75
  </head>
76
76
  <body class="h-full bg-background text-foreground">
77
77
  <div id="root" class="h-full"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openchamber/web",
3
- "version": "1.23.2",
3
+ "version": "1.24.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./server/index.js",
@@ -13,10 +13,11 @@
13
13
  },
14
14
  "scripts": {
15
15
  "dev": "bun run build:watch",
16
- "dev:server": "OPENCHAMBER_RELAY_HOST=${OPENCHAMBER_RELAY_HOST:-off} bun server/index.js --port ${OPENCHAMBER_PORT:-3001}",
17
- "dev:server:watch": "node ./scripts/dev-server-watch.mjs",
18
- "build": "vite build",
19
- "build:watch": "vite build --watch",
16
+ "dev:server": "bun ../../scripts/build-builtin-extensions.mjs && OPENCHAMBER_RELAY_HOST=${OPENCHAMBER_RELAY_HOST:-off} bun server/index.js --port ${OPENCHAMBER_PORT:-3001}",
17
+ "dev:server:watch": "bun ../../scripts/build-builtin-extensions.mjs && node ./scripts/dev-server-watch.mjs",
18
+ "build": "bun ../../scripts/build-builtin-extensions.mjs && vite build",
19
+ "build:watch": "bun ../../scripts/build-builtin-extensions.mjs && vite build --watch",
20
+ "prepack": "bun ../../scripts/build-builtin-extensions.mjs",
20
21
  "type-check": "tsc --noEmit",
21
22
  "lint": "eslint \"./src/**/*.{ts,tsx}\" --config ../../eslint.config.js",
22
23
  "test": "vitest run",
@@ -25,6 +26,7 @@
25
26
  "dependencies": {
26
27
  "@clack/prompts": "^1.1.0",
27
28
  "@octokit/rest": "^22.0.1",
29
+ "@openchamber/sdk": "1.24.1",
28
30
  "@opencode-ai/sdk": "1.18.31",
29
31
  "@simplewebauthn/server": "13.3.1",
30
32
  "bun-pty": "^0.4.5",
@@ -43,7 +45,8 @@
43
45
  "simple-git": "^3.36.0",
44
46
  "web-push": "^3.6.7",
45
47
  "ws": "^8.18.3",
46
- "yaml": "^2.8.1"
48
+ "yaml": "^2.8.1",
49
+ "zod": "^4.3.6"
47
50
  },
48
51
  "devDependencies": {
49
52
  "@base-ui/react": "^1.4.0",
@@ -0,0 +1,4 @@
1
+ {
2
+ "version": 1,
3
+ "extensions": []
4
+ }
package/server/index.d.ts CHANGED
@@ -32,6 +32,8 @@ export interface StartWebUiServerOptions {
32
32
  exitOnShutdown?: boolean;
33
33
  uiPassword?: string | null;
34
34
  desktopUpdater?: DesktopUpdater;
35
+ /** App-owned built-in resources outside Electron's ASAR archive. */
36
+ builtInExtensionsDir?: string;
35
37
  }
36
38
 
37
39
  export declare function startWebUiServer(
package/server/index.js CHANGED
@@ -43,6 +43,7 @@ import {
43
43
  createGlobalUiEventBroadcaster,
44
44
  createGlobalMessageStreamHub,
45
45
  createMessageStreamWsRuntime,
46
+ resolveDeltaCoalesceWindowMs,
46
47
  DEFAULT_UPSTREAM_STALL_TIMEOUT_MS,
47
48
  UPSTREAM_STALL_TIMEOUT_CONCURRENT_MS,
48
49
  } from './lib/event-stream/index.js';
@@ -92,7 +93,9 @@ import { createApnsRuntime } from './lib/notifications/apns-runtime.js';
92
93
  import { createNotificationTemplateRuntime } from './lib/notifications/template-runtime.js';
93
94
  import { createPermissionAutoAcceptRuntime } from './lib/permission-auto-accept/runtime.js';
94
95
  import { createMessageQueueRuntime } from './lib/message-queue/runtime.js';
96
+ import { createRoutingRuntime } from './lib/routing/runtime.js';
95
97
  import { createGracefulShutdownRuntime } from './lib/opencode/shutdown-runtime.js';
98
+ import { stopAllGuestServices } from './lib/guests/service.js';
96
99
  import { createProjectConfigRuntime } from './lib/projects/project-config.js';
97
100
  import { migrateLegacyUserDirs } from './lib/data-dir-migration.js';
98
101
  import { createProjectContextRuntime } from './lib/project-context/runtime.js';
@@ -297,6 +300,8 @@ const themeRuntime = createThemeRuntime({
297
300
  });
298
301
 
299
302
  const readCustomThemesFromDisk = (...args) => themeRuntime.readCustomThemesFromDisk(...args);
303
+ const saveImportedTheme = (...args) => themeRuntime.saveImportedTheme(...args);
304
+ const deleteImportedTheme = (...args) => themeRuntime.deleteImportedTheme(...args);
300
305
 
301
306
  let notificationTemplateRuntime = null;
302
307
  let agentToolRuntime = null;
@@ -889,6 +894,25 @@ const globalMessageStreamHub = createGlobalMessageStreamHub({
889
894
  buildOpenCodeUrl,
890
895
  getOpenCodeAuthHeaders,
891
896
  upstreamStallTimeoutMs: getUpstreamStallTimeoutMs,
897
+ deltaCoalesceWindowMs: resolveDeltaCoalesceWindowMs(),
898
+ });
899
+
900
+ // OpenChamber-owned events for the UI control stream (SSE) plus the WS fan-out.
901
+ // OpenCode's /global/event proxy cannot carry them.
902
+ const broadcastOpenChamberUiEvent = createGlobalUiEventBroadcaster({
903
+ sseClients: uiOpenChamberEventClients,
904
+ wsClients: uiNotificationWsClients,
905
+ writeSseEvent,
906
+ });
907
+
908
+ // Jev model routing and the permission safety net. Dark unless
909
+ // OPENCHAMBER_ROUTING_ENABLE is set; every failure keeps the user's own model
910
+ // or the auto-accept reply it was asked about.
911
+ const routingRuntime = createRoutingRuntime({
912
+ dataDir: OPENCHAMBER_DATA_DIR,
913
+ buildOpenCodeUrl,
914
+ getOpenCodeAuthHeaders,
915
+ broadcastGlobalUiEvent: broadcastOpenChamberUiEvent,
892
916
  });
893
917
 
894
918
  const permissionAutoAcceptRuntime = createPermissionAutoAcceptRuntime({
@@ -898,6 +922,8 @@ const permissionAutoAcceptRuntime = createPermissionAutoAcceptRuntime({
898
922
  readSettingsFromDiskMigrated,
899
923
  persistSettings,
900
924
  broadcastGlobalUiEvent,
925
+ evaluatePermission: (permission, directory) => routingRuntime.evaluatePermission(permission, directory),
926
+ onPermissionReplied: (permissionId) => routingRuntime.forgetPermission(permissionId),
901
927
  });
902
928
  permissionAutoAcceptRuntime.start();
903
929
  notificationTriggerRuntime.setGetIsSessionAutoAccepting(
@@ -911,13 +937,8 @@ const messageQueueRuntime = createMessageQueueRuntime({
911
937
  buildOpenCodeUrl,
912
938
  getOpenCodeAuthHeaders,
913
939
  sessionKnowledgeRuntime,
914
- // OpenCode's /global/event SSE proxy cannot carry OpenChamber-owned events.
915
- // Use the shared control stream for SSE clients and the existing WS fan-out.
916
- broadcastGlobalUiEvent: createGlobalUiEventBroadcaster({
917
- sseClients: uiOpenChamberEventClients,
918
- wsClients: uiNotificationWsClients,
919
- writeSseEvent,
920
- }),
940
+ broadcastGlobalUiEvent: broadcastOpenChamberUiEvent,
941
+ resolvePromptBody: (body, target) => routingRuntime.resolvePromptBody(body, target),
921
942
  onPromptSent: (sessionId) => sessionRuntime.markUserMessageSent(sessionId),
922
943
  dataDir: OPENCHAMBER_DATA_DIR,
923
944
  });
@@ -1345,14 +1366,14 @@ const resolveMemoryProjectId = createMemoryProjectResolver({
1345
1366
  });
1346
1367
 
1347
1368
  /**
1348
- * Tells open panels that the agent changed what it remembers, so what it just
1369
+ * Tells open panels that the service changed what it remembers, so what it just
1349
1370
  * stored is visible without reopening anything.
1350
1371
  */
1351
1372
  const emitAgentMemoryChangedEvent = (event) => {
1352
1373
  for (const client of uiOpenChamberEventClients) {
1353
1374
  try {
1354
1375
  writeSseEvent(client, {
1355
- type: 'openchamber:agent-memory-changed',
1376
+ type: 'openchamber:service-memory-changed',
1356
1377
  properties: {
1357
1378
  scope: event.scope,
1358
1379
  ...(event.projectId ? { projectId: event.projectId } : {}),
@@ -1933,6 +1954,8 @@ async function main(options = {}) {
1933
1954
  resolveGitBinaryForSpawn,
1934
1955
  createFsSearchRuntime: createFsSearchRuntimeFactory,
1935
1956
  openchamberDataDir: OPENCHAMBER_DATA_DIR,
1957
+ openchamberVersion: OPENCHAMBER_VERSION,
1958
+ builtInExtensionsDir: options.builtInExtensionsDir,
1936
1959
  openchamberUserConfigRoot: OPENCHAMBER_USER_CONFIG_ROOT,
1937
1960
  managedChatsRoot: OPENCHAMBER_CHATS_DIR,
1938
1961
  normalizeDirectoryPath,
@@ -1940,6 +1963,8 @@ async function main(options = {}) {
1940
1963
  resolveOptionalProjectDirectory,
1941
1964
  validateDirectoryPath,
1942
1965
  readCustomThemesFromDisk,
1966
+ saveImportedTheme,
1967
+ deleteImportedTheme,
1943
1968
  refreshOpenCodeAfterConfigChange,
1944
1969
  getOpenCodeResolutionSnapshot,
1945
1970
  getOpenCodeUpgradeCapability,
@@ -1973,6 +1998,7 @@ async function main(options = {}) {
1973
1998
  writeSseEvent,
1974
1999
  permissionAutoAcceptRuntime,
1975
2000
  messageQueueRuntime,
2001
+ routingRuntime,
1976
2002
  });
1977
2003
 
1978
2004
  const startupPipelineResult = await startupPipelineRuntime.run({
@@ -2077,7 +2103,7 @@ async function main(options = {}) {
2077
2103
  port: managed ? openCodePort : null,
2078
2104
  };
2079
2105
  },
2080
- stop: (shutdownOptions = {}) => {
2106
+ stop: async (shutdownOptions = {}) => {
2081
2107
  realtimeProxyRuntime.stop();
2082
2108
  clearInterval(relayReconcileTimer);
2083
2109
  try {
@@ -2090,6 +2116,11 @@ async function main(options = {}) {
2090
2116
  } catch {
2091
2117
  // best-effort shutdown of the dictation worker
2092
2118
  }
2119
+ // Guest services are child processes; leaving before SIGTERM lands
2120
+ // (and the SIGKILL fallback fires) orphans them on the user's machine.
2121
+ await stopAllGuestServices().catch(() => {
2122
+ // best-effort teardown of guest service processes
2123
+ });
2093
2124
  return gracefulShutdown({ exitProcess: shutdownOptions.exitProcess ?? false });
2094
2125
  }
2095
2126
  };
@@ -2,7 +2,7 @@
2
2
  //
3
3
  // The repo publishes `changelog/index.json` on `main`: one object per release,
4
4
  // newest first, with the app notes grouped as New / Improvements / Fixes /
5
- // Misc. This module fetches it and renders the releases between the installed
5
+ // SDK / Misc. This module fetches it and renders the releases between the installed
6
6
  // version (exclusive) and the offered one (inclusive) as the Markdown the
7
7
  // dialog already understands: a `## [x.y.z] - YYYY-MM-DD` header per release,
8
8
  // the release title in bold, the intro, then the groups.
@@ -16,6 +16,7 @@ const GROUPS = [
16
16
  ['new', 'New'],
17
17
  ['improvements', 'Improvements'],
18
18
  ['fixes', 'Fixes'],
19
+ ['sdk', 'SDK'],
19
20
  ['misc', 'Misc'],
20
21
  ];
21
22
 
@@ -37,6 +37,25 @@ A short intro.
37
37
  - Faster.`);
38
38
  });
39
39
 
40
+ it('shows SDK notes between Fixes and Misc and omits an empty SDK group', () => {
41
+ const withSdk = [{
42
+ ...index[0],
43
+ app: { ...index[0].app, sdk: ['Actions: background execution.'], misc: ['Packaging update.'] },
44
+ }];
45
+ expect(renderUpdateNotes(withSdk, '1.2.2', '1.2.3', compare)).toContain(`### Fixes
46
+
47
+ - Chat: no freeze.
48
+
49
+ ### SDK
50
+
51
+ - Actions: background execution.
52
+
53
+ ### Misc
54
+
55
+ - Packaging update.`);
56
+ expect(renderUpdateNotes([{ ...index[0], app: { sdk: [] } }], '1.2.2', '1.2.3', compare)).not.toContain('### SDK');
57
+ });
58
+
40
59
  it('returns null when nothing lies in the range or the payload is not an index', () => {
41
60
  expect(renderUpdateNotes(index, '1.2.3', '1.2.3', compare)).toBe(null);
42
61
  expect(renderUpdateNotes({ entries: [] }, '1.0.0', '9.9.9', compare)).toBe(null);
@@ -6,6 +6,7 @@ This module contains the OpenChamber message-stream WebSocket protocol and runti
6
6
  ## Entrypoints and structure
7
7
  - `packages/web/server/lib/event-stream/index.js`: public entrypoint re-exporting protocol and runtime helpers.
8
8
  - `packages/web/server/lib/event-stream/global-hub.js`: shared global upstream SSE hub for server-side subscribers and browser WS fan-out.
9
+ - `packages/web/server/lib/event-stream/delta-coalescer.js`: merges consecutive `message.part.delta` events before replay and fan-out. Pure, with injectable clock and timers.
9
10
  - `packages/web/server/lib/event-stream/global-ws-bridge.js`: browser-facing global WS bridge that subscribes clients to the shared global hub.
10
11
  - `packages/web/server/lib/event-stream/directory-ws-bridge.js`: browser-facing per-directory WS bridge that owns one scoped upstream reader per connection.
11
12
  - `packages/web/server/lib/event-stream/protocol.js`: path constants, SSE envelope parsing, and WebSocket frame serialization helpers.
@@ -31,6 +32,9 @@ This module contains the OpenChamber message-stream WebSocket protocol and runti
31
32
  - `createGlobalUiEventBroadcaster({ sseClients, wsClients, writeSseEvent })`: returns a broadcaster that fans out the same synthetic UI event to SSE and WS clients.
32
33
  - `createMessageStreamWsRuntime(...)`: mounts the message-stream WS server, upgrade handler, and SSE-to-WS bridge onto the web HTTP server.
33
34
 
35
+ ### Coalescing helpers
36
+ - `resolveDeltaCoalesceWindowMs(env)`: reads `OPENCHAMBER_EVENT_DELTA_COALESCE_MS`. Unset means 50ms, `0` turns coalescing off, and anything that is not a whole number from 0 to 1000 keeps the default with a warning.
37
+
34
38
  ### Upstream reader helpers
35
39
  - `DEFAULT_UPSTREAM_STALL_TIMEOUT_MS`: default idle timeout before an attached upstream SSE fetch is aborted for reconnect.
36
40
  - `DEFAULT_UPSTREAM_RECONNECT_DELAY_MS`: default delay between upstream reconnect attempts.
@@ -42,6 +46,7 @@ This module contains the OpenChamber message-stream WebSocket protocol and runti
42
46
  - The web server creates one shared global message-stream hub. OpenCode watcher side effects and global WS clients subscribe to that hub, so there is one upstream `/global/event` SSE reader for both server-side processing and browser fan-out.
43
47
  - The global hub keeps a bounded replay buffer keyed by SSE `eventId` so reconnecting browser clients can receive buffered events after their requested `Last-Event-ID`.
44
48
  - Replay retains at most 2,048 events and 8 MiB of UTF-8 wire frames. It stores encoded frames rather than retaining parsed payloads as well. Encoding is shared with live WS fanout. An oversized event still reaches live clients in full, but clears the retained suffix so replay cannot cross its gap. A missing replay cursor returns `null`, distinct from a complete empty tail; the bridge sends `ready` with `replayReset: true` and no partial replay. The client retires its cursor and requests authoritative repair, including during the early-boot reconnect grace period. A stopped hub retains its bounded suffix for clients reconnecting after the last socket closed.
49
+ - The hub numbers every event that arrives without an SSE id (`oc-<process>-<sequence>`). OpenCode 1.18 sends no ids at all, and an event without an id used to skip the replay buffer, so reconnecting clients had no cursor and lost whatever fell into the gap. The process prefix makes a cursor from before a server restart miss, which reports `replayReset`, instead of matching an unrelated sequence number.
45
50
  - Directory WS clients still attach one upstream `/event?directory=...` SSE reader per connection because directory streams are scoped.
46
51
  - If an upstream SSE stream stalls after the browser WS is already ready, the reader aborts that upstream fetch and reconnects upstream with `Last-Event-ID`, keeping the browser WS alive when recovery is fast.
47
52
  - When the shared global upstream reconnects after it was previously ready, the global WS bridge sends a fresh `ready` frame to already-ready browser clients. The browser treats this as a reconnect edge and can run scoped state repair without requiring the browser WS to close.
@@ -52,6 +57,23 @@ This module contains the OpenChamber message-stream WebSocket protocol and runti
52
57
  - The reusable upstream reader centralizes SSE fetch/parsing/reconnect behavior for the WS runtime and OpenCode watcher. Additional event consumers should move to it only with parity tests for their lifecycle and error semantics.
53
58
  - Browser transport concerns live in the WS bridge modules; server-side global stream ownership lives in `global-hub.js`.
54
59
 
60
+ ## Delta coalescing
61
+ OpenCode publishes one `message.part.delta` per token fragment. A 5.7 KB answer measured 3,402 delta events of 1.7 characters each, 97% of all frames and 1.3 MB on the wire. The hub merges them before replay and fan-out, which cut that stream to 483 frames and 197 KB with identical text. Replay holds merged frames too, so its 2,048 entries cover about seven times more streaming time.
62
+
63
+ Merging is lossless because of three rules. Change one only with the randomized test in `delta-coalescer.test.js` still passing.
64
+
65
+ - Every event that is not a well-formed delta is a barrier. All pending text is emitted before it, so a delta never crosses a part snapshot or a status change.
66
+ - Deltas of different part fields commute, so several stay pending at once. They are emitted in the order their latest fragment arrived, which keeps event ids in upstream order.
67
+ - A merged event carries the id of its last fragment. A client cursor is the id of the last frame it received, so it always names a boundary between merged events.
68
+
69
+ Pending text is bounded by time (the 50ms window), by size (64 KiB), and by part fields (64). Reaching a bound emits early. Nothing is dropped. The first delta after a quiet spell is emitted at once, so time to first text does not grow.
70
+
71
+ The hub commits pending text when it stops, so it reaches the retained replay suffix, and the global bridge commits it before it marks a socket ready. A client readied later therefore receives exactly the events that arrived after it was ready, as it did before coalescing, and a reconnecting client receives the committed text through replay.
72
+
73
+ Verified against a live server by dropping the socket every 150ms to 3s during a stream and resuming from the cursor: the reconstructed text matched byte for byte with no duplicate ids. Server-side hub subscribers receive merged events as well. None of them reads individual deltas.
74
+
75
+ The directory WS bridge and the SSE proxy (`/api/global/event`, used by Capacitor) still forward unmerged events.
76
+
55
77
  ## Notes for contributors
56
78
  - Keep protocol helpers pure and small so they can be unit tested without spinning up a server.
57
79
  - Keep `runtime.js` focused on WebSocket upgrade and endpoint dispatch. Put global browser-client lifecycle in `global-ws-bridge.js`, directory stream lifecycle in `directory-ws-bridge.js`, and upstream stream sharing in `global-hub.js`.
@@ -59,6 +81,7 @@ This module contains the OpenChamber message-stream WebSocket protocol and runti
59
81
  - Keep global replay bounded; do not turn it into an unbounded event log.
60
82
 
61
83
  ## Testing
84
+ - Run `bunx vitest run server/lib/event-stream` from `packages/web` for the whole module, including `delta-coalescer.test.js` and the resume-from-any-cursor cases in `global-hub.test.js`.
62
85
  - Run `bun test packages/web/server/lib/event-stream/protocol.test.js`
63
86
  - Run `bun test packages/web/server/lib/event-stream/upstream-reader.test.js`
64
87
  - Run `bun test packages/web/server/lib/event-stream/runtime.test.js`