synabun 2.3.1 → 2.4.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 (370) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +1 -1
  3. package/browser-extension/content.js +189 -0
  4. package/browser-extension/engine.js +508 -0
  5. package/browser-extension/icons/icon-128.png +0 -0
  6. package/browser-extension/icons/icon-16.png +0 -0
  7. package/browser-extension/icons/icon-32.png +0 -0
  8. package/browser-extension/icons/icon-48.png +0 -0
  9. package/browser-extension/icons/status-off-16.png +0 -0
  10. package/browser-extension/icons/status-off-32.png +0 -0
  11. package/browser-extension/icons/status-off-48.png +0 -0
  12. package/browser-extension/icons/status-on-16.png +0 -0
  13. package/browser-extension/icons/status-on-32.png +0 -0
  14. package/browser-extension/icons/status-on-48.png +0 -0
  15. package/browser-extension/manifest.json +56 -0
  16. package/browser-extension/popup-strings.js +250 -0
  17. package/browser-extension/popup-view.js +151 -0
  18. package/browser-extension/popup.css +166 -0
  19. package/browser-extension/popup.html +108 -0
  20. package/browser-extension/popup.js +359 -0
  21. package/browser-extension/protocol.js +232 -0
  22. package/browser-extension/service-worker.js +275 -0
  23. package/browser-extension/setup-content.js +36 -0
  24. package/browser-extension/tokens.css +326 -0
  25. package/docs/browser-extension-bridge.md +84 -0
  26. package/docs/whatsapp.md +1 -1
  27. package/lib/data-home-files.js +45 -0
  28. package/lib/data-home-migration.js +34 -58
  29. package/mcp-server/dist/http.d.ts +2 -0
  30. package/mcp-server/dist/http.d.ts.map +1 -1
  31. package/mcp-server/dist/http.js +9 -1
  32. package/mcp-server/dist/http.js.map +1 -1
  33. package/mcp-server/dist/index.d.ts +11 -0
  34. package/mcp-server/dist/index.d.ts.map +1 -1
  35. package/mcp-server/dist/index.js +38 -3
  36. package/mcp-server/dist/index.js.map +1 -1
  37. package/mcp-server/dist/services/browser-route-flow.d.ts +6 -2
  38. package/mcp-server/dist/services/browser-route-flow.d.ts.map +1 -1
  39. package/mcp-server/dist/services/browser-route-flow.js +10 -3
  40. package/mcp-server/dist/services/browser-route-flow.js.map +1 -1
  41. package/mcp-server/dist/services/codex-config-heal.d.ts.map +1 -1
  42. package/mcp-server/dist/services/codex-config-heal.js +7 -0
  43. package/mcp-server/dist/services/codex-config-heal.js.map +1 -1
  44. package/mcp-server/dist/services/neural-interface.d.ts +95 -3
  45. package/mcp-server/dist/services/neural-interface.d.ts.map +1 -1
  46. package/mcp-server/dist/services/neural-interface.js +168 -23
  47. package/mcp-server/dist/services/neural-interface.js.map +1 -1
  48. package/mcp-server/dist/services/team-context.d.ts +18 -0
  49. package/mcp-server/dist/services/team-context.d.ts.map +1 -0
  50. package/mcp-server/dist/services/team-context.js +29 -0
  51. package/mcp-server/dist/services/team-context.js.map +1 -0
  52. package/mcp-server/dist/services/tool-catalog.d.ts +5 -2
  53. package/mcp-server/dist/services/tool-catalog.d.ts.map +1 -1
  54. package/mcp-server/dist/services/tool-catalog.js +22 -6
  55. package/mcp-server/dist/services/tool-catalog.js.map +1 -1
  56. package/mcp-server/dist/services/tool-list.d.ts.map +1 -1
  57. package/mcp-server/dist/services/tool-list.js +4 -0
  58. package/mcp-server/dist/services/tool-list.js.map +1 -1
  59. package/mcp-server/dist/services/tool-runtime.d.ts +8 -1
  60. package/mcp-server/dist/services/tool-runtime.d.ts.map +1 -1
  61. package/mcp-server/dist/services/tool-runtime.js +18 -1
  62. package/mcp-server/dist/services/tool-runtime.js.map +1 -1
  63. package/mcp-server/dist/tools/agent-definition.d.ts +133 -0
  64. package/mcp-server/dist/tools/agent-definition.d.ts.map +1 -0
  65. package/mcp-server/dist/tools/agent-definition.js +483 -0
  66. package/mcp-server/dist/tools/agent-definition.js.map +1 -0
  67. package/mcp-server/dist/tools/agents.d.ts +92 -9
  68. package/mcp-server/dist/tools/agents.d.ts.map +1 -1
  69. package/mcp-server/dist/tools/agents.js +163 -20
  70. package/mcp-server/dist/tools/agents.js.map +1 -1
  71. package/mcp-server/dist/tools/browser-advanced.d.ts +8 -1
  72. package/mcp-server/dist/tools/browser-advanced.d.ts.map +1 -1
  73. package/mcp-server/dist/tools/browser-advanced.js +70 -6
  74. package/mcp-server/dist/tools/browser-advanced.js.map +1 -1
  75. package/mcp-server/dist/tools/git-tools.d.ts +4 -2
  76. package/mcp-server/dist/tools/git-tools.d.ts.map +1 -1
  77. package/mcp-server/dist/tools/git-tools.js +283 -2
  78. package/mcp-server/dist/tools/git-tools.js.map +1 -1
  79. package/mcp-server/dist/tools/morelogin.d.ts +8 -2
  80. package/mcp-server/dist/tools/morelogin.d.ts.map +1 -1
  81. package/mcp-server/dist/tools/morelogin.js +22 -5
  82. package/mcp-server/dist/tools/morelogin.js.map +1 -1
  83. package/mcp-server/dist/tools/team.d.ts +32 -0
  84. package/mcp-server/dist/tools/team.d.ts.map +1 -0
  85. package/mcp-server/dist/tools/team.js +87 -0
  86. package/mcp-server/dist/tools/team.js.map +1 -0
  87. package/mcp-server/package-lock.json +2 -2
  88. package/mcp-server/package.json +1 -1
  89. package/mcp-server/src/http.ts +9 -1
  90. package/mcp-server/src/index.ts +34 -4
  91. package/mcp-server/src/services/browser-route-flow.ts +12 -5
  92. package/mcp-server/src/services/codex-config-heal.ts +7 -0
  93. package/mcp-server/src/services/neural-interface.ts +191 -29
  94. package/mcp-server/src/services/team-context.ts +27 -0
  95. package/mcp-server/src/services/tool-catalog.ts +26 -8
  96. package/mcp-server/src/services/tool-list.ts +4 -0
  97. package/mcp-server/src/services/tool-runtime.ts +21 -2
  98. package/mcp-server/src/tools/agent-definition.ts +458 -0
  99. package/mcp-server/src/tools/agents.ts +177 -19
  100. package/mcp-server/src/tools/browser-advanced.ts +60 -6
  101. package/mcp-server/src/tools/git-tools.ts +249 -3
  102. package/mcp-server/src/tools/morelogin.ts +20 -5
  103. package/mcp-server/src/tools/team.ts +97 -0
  104. package/neural-interface/i18n/en.json +1119 -47
  105. package/neural-interface/i18n/pt-BR.json +1119 -47
  106. package/neural-interface/lib/account-usage.js +1 -1
  107. package/neural-interface/lib/agents/builtins.json +207 -0
  108. package/neural-interface/lib/agents/density.js +101 -0
  109. package/neural-interface/lib/agents/forge-host.js +223 -0
  110. package/neural-interface/lib/agents/native-export-targets.js +190 -0
  111. package/neural-interface/lib/agents/native-export.js +365 -0
  112. package/neural-interface/lib/agents/registry.js +885 -0
  113. package/neural-interface/lib/agents/resolve.js +603 -0
  114. package/neural-interface/lib/agents/schema.js +642 -0
  115. package/neural-interface/lib/agents/split.js +37 -0
  116. package/neural-interface/lib/agents-studio-api.js +591 -0
  117. package/neural-interface/lib/assistant-api.js +76 -7
  118. package/neural-interface/lib/assistant-brains/opencode.js +60 -11
  119. package/neural-interface/lib/assistant-catalog.js +2 -0
  120. package/neural-interface/lib/assistant-continuity.js +49 -0
  121. package/neural-interface/lib/assistant-dispatch.js +351 -121
  122. package/neural-interface/lib/assistant-persona.js +105 -8
  123. package/neural-interface/lib/assistant-route-gate.js +24 -9
  124. package/neural-interface/lib/assistant-router.js +432 -47
  125. package/neural-interface/lib/assistant-run-tail.js +151 -0
  126. package/neural-interface/lib/assistant-run-wait.js +183 -0
  127. package/neural-interface/lib/assistant-runtime.js +449 -94
  128. package/neural-interface/lib/assistant-task-prompt.js +11 -2
  129. package/neural-interface/lib/assistant-usage.js +3 -2
  130. package/neural-interface/lib/automation-approval.js +2 -2
  131. package/neural-interface/lib/backup-service.js +64 -105
  132. package/neural-interface/lib/browser-close-evidence.js +80 -0
  133. package/neural-interface/lib/browser-default.js +210 -0
  134. package/neural-interface/lib/browser-extension-adapter.js +264 -0
  135. package/neural-interface/lib/browser-extension-bridge.js +441 -0
  136. package/neural-interface/lib/browser-extension-folder.js +116 -0
  137. package/neural-interface/lib/browser-extension-setup.js +140 -0
  138. package/neural-interface/lib/browser-profile-choices.js +3 -3
  139. package/neural-interface/lib/browser-tool-policy.js +1 -1
  140. package/neural-interface/lib/claude-account-links.js +301 -0
  141. package/neural-interface/lib/claude-accounts.js +45 -20
  142. package/neural-interface/lib/claude-agent-bridge.js +142 -10
  143. package/neural-interface/lib/claude-model-catalog.js +6 -0
  144. package/neural-interface/lib/claude-panel-session.js +33 -0
  145. package/neural-interface/lib/codex-accounts.js +67 -24
  146. package/neural-interface/lib/coordination/README.md +384 -0
  147. package/neural-interface/lib/coordination/service.js +563 -0
  148. package/neural-interface/lib/coordination/store.js +1138 -0
  149. package/neural-interface/lib/db.js +22 -1
  150. package/neural-interface/lib/effort-levels.js +10 -1
  151. package/neural-interface/lib/memory-list-page.js +49 -0
  152. package/neural-interface/lib/memory-list-stamp.js +60 -0
  153. package/neural-interface/lib/morelogin-outside-close.js +186 -0
  154. package/neural-interface/lib/morelogin-profile-failures.js +206 -0
  155. package/neural-interface/lib/morelogin-start-cooldown.js +160 -0
  156. package/neural-interface/lib/morelogin.js +194 -8
  157. package/neural-interface/lib/native-loop-runtime.js +26 -7
  158. package/neural-interface/lib/opencode-build-preflight.js +28 -8
  159. package/neural-interface/lib/opencode-native-boundary.js +83 -13
  160. package/neural-interface/lib/opencode-serve-records.js +14 -9
  161. package/neural-interface/lib/page-session.js +1 -1
  162. package/neural-interface/lib/peer-identity.js +73 -29
  163. package/neural-interface/lib/process-identity.js +68 -7
  164. package/neural-interface/lib/request-gate.js +3 -0
  165. package/neural-interface/lib/screenshot-location.js +33 -0
  166. package/neural-interface/lib/session-cache-builder.js +41 -3
  167. package/neural-interface/lib/skills/creation.js +1 -1
  168. package/neural-interface/lib/skills/known-bridge-digests.json +40 -0
  169. package/neural-interface/lib/studio-attention.js +56 -0
  170. package/neural-interface/lib/teams/README.md +382 -0
  171. package/neural-interface/lib/teams/api.js +287 -0
  172. package/neural-interface/lib/teams/brief.js +185 -0
  173. package/neural-interface/lib/teams/claims.js +315 -0
  174. package/neural-interface/lib/teams/git.js +293 -0
  175. package/neural-interface/lib/teams/index.js +122 -0
  176. package/neural-interface/lib/teams/integration.js +580 -0
  177. package/neural-interface/lib/teams/landing.js +184 -0
  178. package/neural-interface/lib/teams/recovery.js +256 -0
  179. package/neural-interface/lib/teams/scheduler.js +1474 -0
  180. package/neural-interface/lib/teams/schema.js +559 -0
  181. package/neural-interface/lib/teams/state.js +181 -0
  182. package/neural-interface/lib/teams/test-runner.js +86 -0
  183. package/neural-interface/lib/teams/test-sandbox.js +99 -0
  184. package/neural-interface/lib/teams/worktrees.js +757 -0
  185. package/neural-interface/lib/tool-permission-choices.js +226 -0
  186. package/neural-interface/lib/whatsapp/cards.js +24 -10
  187. package/neural-interface/lib/worker-confinement.js +206 -6
  188. package/neural-interface/package-lock.json +2 -2
  189. package/neural-interface/package.json +1 -1
  190. package/neural-interface/public/extension-setup.html +107 -0
  191. package/neural-interface/public/index.html +103 -12
  192. package/neural-interface/public/offline.html +4 -3
  193. package/neural-interface/public/shared/agent-runtime-options.js +3 -1
  194. package/neural-interface/public/shared/agents/studio/ax-agent-view.js +614 -0
  195. package/neural-interface/public/shared/agents/studio/ax-api.js +198 -0
  196. package/neural-interface/public/shared/agents/studio/ax-create-view.js +221 -0
  197. package/neural-interface/public/shared/agents/studio/ax-diff.js +143 -0
  198. package/neural-interface/public/shared/agents/studio/ax-editor-view.js +392 -0
  199. package/neural-interface/public/shared/agents/studio/ax-export-view.js +94 -0
  200. package/neural-interface/public/shared/agents/studio/ax-form.js +191 -0
  201. package/neural-interface/public/shared/agents/studio/ax-icons.js +87 -0
  202. package/neural-interface/public/shared/agents/studio/ax-library-view.js +158 -0
  203. package/neural-interface/public/shared/agents/studio/ax-library.js +162 -0
  204. package/neural-interface/public/shared/agents/studio/ax-main.js +712 -0
  205. package/neural-interface/public/shared/agents/studio/ax-native-export.js +35 -0
  206. package/neural-interface/public/shared/agents/studio/ax-options.js +198 -0
  207. package/neural-interface/public/shared/agents/studio/ax-review-view.js +175 -0
  208. package/neural-interface/public/shared/agents/studio/ax-revisions-view.js +189 -0
  209. package/neural-interface/public/shared/agents/studio/ax-runs-view.js +202 -0
  210. package/neural-interface/public/shared/agents/studio/ax-runs.js +82 -0
  211. package/neural-interface/public/shared/agents/studio/ax-teams-view.js +256 -0
  212. package/neural-interface/public/shared/agents/studio/ax-teams.js +200 -0
  213. package/neural-interface/public/shared/agents/studio/ax-templates.js +50 -0
  214. package/neural-interface/public/shared/agents/studio/ax-ui.js +194 -0
  215. package/neural-interface/public/shared/agents/studio/ax-views.js +170 -0
  216. package/neural-interface/public/shared/agy/agy-panel.js +142 -28
  217. package/neural-interface/public/shared/agy/agy-styles.js +25 -5
  218. package/neural-interface/public/shared/api.js +2 -1
  219. package/neural-interface/public/shared/assistant/asst-account-menu.js +13 -13
  220. package/neural-interface/public/shared/assistant/asst-ask-styles.js +2 -3
  221. package/neural-interface/public/shared/assistant/asst-brain-picker.js +91 -9
  222. package/neural-interface/public/shared/assistant/asst-control.js +3 -0
  223. package/neural-interface/public/shared/assistant/asst-interaction-hold.js +99 -0
  224. package/neural-interface/public/shared/assistant/asst-limit-dismissals.js +111 -0
  225. package/neural-interface/public/shared/assistant/asst-limit-dock.js +37 -3
  226. package/neural-interface/public/shared/assistant/asst-limit-wait.js +30 -7
  227. package/neural-interface/public/shared/assistant/asst-panel.js +177 -30
  228. package/neural-interface/public/shared/assistant/asst-rack-styles.js +15 -8
  229. package/neural-interface/public/shared/assistant/asst-render.js +37 -6
  230. package/neural-interface/public/shared/assistant/asst-route.js +80 -12
  231. package/neural-interface/public/shared/assistant/asst-routes-editor.js +148 -70
  232. package/neural-interface/public/shared/assistant/asst-roving.js +17 -1
  233. package/neural-interface/public/shared/assistant/asst-scene-styles.js +7 -2
  234. package/neural-interface/public/shared/assistant/asst-scenes.js +12 -1
  235. package/neural-interface/public/shared/assistant/asst-sidepanel.js +12 -2
  236. package/neural-interface/public/shared/assistant/asst-state.js +66 -1
  237. package/neural-interface/public/shared/assistant/asst-styles.js +98 -44
  238. package/neural-interface/public/shared/assistant/route-identity.js +16 -0
  239. package/neural-interface/public/shared/cc-dropdown.js +21 -15
  240. package/neural-interface/public/shared/cdx/cdx-output.js +10 -0
  241. package/neural-interface/public/shared/cdx/cdx-panel.js +18 -16
  242. package/neural-interface/public/shared/cdx/cdx-plan.js +3 -2
  243. package/neural-interface/public/shared/cdx/cdx-render.js +122 -45
  244. package/neural-interface/public/shared/cdx/cdx-requests.js +4 -4
  245. package/neural-interface/public/shared/cdx/cdx-styles.js +8 -36
  246. package/neural-interface/public/shared/cdx/cdx-tabs.js +110 -42
  247. package/neural-interface/public/shared/claude-panel-lazy.js +12 -0
  248. package/neural-interface/public/shared/code-copy.js +120 -0
  249. package/neural-interface/public/shared/constants.js +7 -0
  250. package/neural-interface/public/shared/context-menu-model.js +1 -0
  251. package/neural-interface/public/shared/cp/cp-markdown.js +7 -2
  252. package/neural-interface/public/shared/cp/cp-session-model.js +86 -5
  253. package/neural-interface/public/shared/cp/cp-session-settings.js +58 -30
  254. package/neural-interface/public/shared/cp/cp-styles.js +9 -0
  255. package/neural-interface/public/shared/dom-change-flag.js +66 -0
  256. package/neural-interface/public/shared/dom-morph.js +124 -0
  257. package/neural-interface/public/shared/extension-setup/es-page.css +134 -0
  258. package/neural-interface/public/shared/extension-setup/es-page.js +120 -0
  259. package/neural-interface/public/shared/extension-setup/es-view.js +100 -0
  260. package/neural-interface/public/shared/html-shell.js +34 -4
  261. package/neural-interface/public/shared/i18n.js +14 -1
  262. package/neural-interface/public/shared/idle-queue.js +78 -0
  263. package/neural-interface/public/shared/iface-config.js +227 -0
  264. package/neural-interface/public/shared/lazy-module.js +108 -0
  265. package/neural-interface/public/shared/memory-list.js +117 -0
  266. package/neural-interface/public/shared/morelogin-profile-choices.js +1 -1
  267. package/neural-interface/public/shared/morelogin-profile-field.js +3 -3
  268. package/neural-interface/public/shared/mtc/mtc-panel.js +3 -1
  269. package/neural-interface/public/shared/mtc/mtc-styles.js +4 -1
  270. package/neural-interface/public/shared/ocp-v2/ocp-v2-manager.js +35 -15
  271. package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +77 -23
  272. package/neural-interface/public/shared/ocp-v2/ocp-v2-projectbar.js +3 -6
  273. package/neural-interface/public/shared/ocp-v2/ocp-v2-render.js +24 -21
  274. package/neural-interface/public/shared/ocp-v2/ocp-v2-send-logic.js +16 -5
  275. package/neural-interface/public/shared/ocp-v2/ocp-v2-sessions-logic.js +16 -2
  276. package/neural-interface/public/shared/ocp-v2/ocp-v2-styles.js +27 -43
  277. package/neural-interface/public/shared/ocp-v2/ocp-v2-ws.js +73 -9
  278. package/neural-interface/public/shared/owner-authority-view.js +4 -10
  279. package/neural-interface/public/shared/page-session.js +1 -1
  280. package/neural-interface/public/shared/schedules-view.js +2 -2
  281. package/neural-interface/public/shared/session-project-items.js +11 -0
  282. package/neural-interface/public/shared/settings/settings-ai-browser.js +119 -0
  283. package/neural-interface/public/shared/settings/settings-browser-extension.js +446 -0
  284. package/neural-interface/public/shared/settings/settings-ia.js +4 -2
  285. package/neural-interface/public/shared/settings/settings-morelogin-cooldown.js +63 -0
  286. package/neural-interface/public/shared/settings/settings-tool-permissions.js +70 -0
  287. package/neural-interface/public/shared/sidepanel-lazy.js +40 -0
  288. package/neural-interface/public/shared/sidepanel-session-status.js +8 -14
  289. package/neural-interface/public/shared/sidepanel-shown.js +73 -0
  290. package/neural-interface/public/shared/start-bridge.js +2 -2
  291. package/neural-interface/public/shared/storage.js +6 -1
  292. package/neural-interface/public/shared/studio-attention.js +83 -0
  293. package/neural-interface/public/shared/styles.css +694 -50
  294. package/neural-interface/public/shared/term-browser-tabs.js +34 -0
  295. package/neural-interface/public/shared/transcript-rows.js +334 -0
  296. package/neural-interface/public/shared/tray-auto-close.js +106 -0
  297. package/neural-interface/public/shared/ui-agents.js +97 -0
  298. package/neural-interface/public/shared/ui-antigravity-panel.js +16 -14
  299. package/neural-interface/public/shared/ui-automation-studio.js +3 -3
  300. package/neural-interface/public/shared/ui-claude-panel.js +162 -95
  301. package/neural-interface/public/shared/ui-code-copy.js +256 -0
  302. package/neural-interface/public/shared/ui-codex-panel.js +14 -10
  303. package/neural-interface/public/shared/ui-context-menu.js +1 -1
  304. package/neural-interface/public/shared/ui-file-explorer.js +2 -3
  305. package/neural-interface/public/shared/ui-games.js +1 -1
  306. package/neural-interface/public/shared/ui-loading.js +83 -19
  307. package/neural-interface/public/shared/ui-maritaca-panel.js +12 -11
  308. package/neural-interface/public/shared/ui-menubar.js +23 -0
  309. package/neural-interface/public/shared/ui-native-loop-router.js +50 -21
  310. package/neural-interface/public/shared/ui-navbar.js +15 -9
  311. package/neural-interface/public/shared/ui-opencode-panel-v2.js +13 -11
  312. package/neural-interface/public/shared/ui-owner-authority.js +48 -25
  313. package/neural-interface/public/shared/ui-schedules-studio.js +3 -3
  314. package/neural-interface/public/shared/ui-scroll-follow.js +39 -0
  315. package/neural-interface/public/shared/ui-sessions.js +3 -3
  316. package/neural-interface/public/shared/ui-settings-entry.js +55 -0
  317. package/neural-interface/public/shared/ui-settings.js +363 -400
  318. package/neural-interface/public/shared/ui-sidepanel-layout.js +44 -25
  319. package/neural-interface/public/shared/ui-sidepanel-session-entry.js +22 -9
  320. package/neural-interface/public/shared/ui-sidepanel-sessions.js +10 -2
  321. package/neural-interface/public/shared/ui-sidepanel-tray.js +36 -41
  322. package/neural-interface/public/shared/ui-sidepanel-windows.js +14 -1
  323. package/neural-interface/public/shared/ui-styleguide.js +10 -2
  324. package/neural-interface/public/shared/ui-sync.js +6 -0
  325. package/neural-interface/public/shared/ui-terminal.js +13 -9
  326. package/neural-interface/public/shared/ui-tooltip.js +28 -7
  327. package/neural-interface/public/shared/ui-topright-overflow.js +26 -4
  328. package/neural-interface/public/shared/ui-tray-columns.js +375 -0
  329. package/neural-interface/public/shared/ui-whiteboard.js +51 -6
  330. package/neural-interface/public/shared/ui-worker-end.js +28 -1
  331. package/neural-interface/public/shared/ui-workspaces.js +13 -0
  332. package/neural-interface/public/shared/window-keys.js +71 -0
  333. package/neural-interface/public/sw.js +4 -3
  334. package/neural-interface/public/variant/2d/main.js +2 -0
  335. package/neural-interface/public/variant/3d/app.js +620 -0
  336. package/neural-interface/public/variant/3d/boot-reveal.js +47 -0
  337. package/neural-interface/public/variant/3d/main.js +30 -544
  338. package/neural-interface/public/variant/3d/map-controls.js +4 -2
  339. package/neural-interface/public/vendor/fonts/fonts.css +508 -0
  340. package/neural-interface/public/vendor/fonts/inter-OFL.txt +93 -0
  341. package/neural-interface/public/vendor/fonts/inter-cyrillic-ext.woff2 +0 -0
  342. package/neural-interface/public/vendor/fonts/inter-cyrillic.woff2 +0 -0
  343. package/neural-interface/public/vendor/fonts/inter-greek-ext.woff2 +0 -0
  344. package/neural-interface/public/vendor/fonts/inter-greek.woff2 +0 -0
  345. package/neural-interface/public/vendor/fonts/inter-latin-ext.woff2 +0 -0
  346. package/neural-interface/public/vendor/fonts/inter-latin.woff2 +0 -0
  347. package/neural-interface/public/vendor/fonts/inter-vietnamese.woff2 +0 -0
  348. package/neural-interface/public/vendor/fonts/jetbrains-mono-OFL.txt +93 -0
  349. package/neural-interface/public/vendor/fonts/jetbrains-mono-cyrillic-ext.woff2 +0 -0
  350. package/neural-interface/public/vendor/fonts/jetbrains-mono-cyrillic.woff2 +0 -0
  351. package/neural-interface/public/vendor/fonts/jetbrains-mono-greek.woff2 +0 -0
  352. package/neural-interface/public/vendor/fonts/jetbrains-mono-latin-ext.woff2 +0 -0
  353. package/neural-interface/public/vendor/fonts/jetbrains-mono-latin.woff2 +0 -0
  354. package/neural-interface/public/vendor/fonts/jetbrains-mono-vietnamese.woff2 +0 -0
  355. package/neural-interface/public/vendor/fonts/manifest.json +142 -0
  356. package/neural-interface/public/vendor/fonts/space-grotesk-OFL.txt +93 -0
  357. package/neural-interface/public/vendor/fonts/space-grotesk-latin-ext.woff2 +0 -0
  358. package/neural-interface/public/vendor/fonts/space-grotesk-latin.woff2 +0 -0
  359. package/neural-interface/public/vendor/fonts/space-grotesk-vietnamese.woff2 +0 -0
  360. package/neural-interface/scripts/boot-graph.mjs +270 -0
  361. package/neural-interface/scripts/vendor-fonts.mjs +124 -0
  362. package/neural-interface/server.js +1083 -164
  363. package/npm-shrinkwrap.json +2 -2
  364. package/package.json +4 -1
  365. package/skills/agent-forge/SKILL.md +182 -0
  366. package/skills/agent-forge/evals/evals.json +56 -0
  367. package/skills/agent-forge/references/definition-fields.md +61 -0
  368. package/skills/agent-forge/references/examples.md +105 -0
  369. package/skills/agent-forge/references/instructions.md +51 -0
  370. package/skills/agent-forge/references/review-and-export.md +84 -0
@@ -1,5 +1,5 @@
1
1
  import { on } from './state.js';
2
- import { attachClaudeAutomation, detachClaudeAutomation, handleClaudeAutomationEvent } from './ui-claude-panel.js';
2
+ import { attachClaudeAutomation, detachClaudeAutomation, handleClaudeAutomationEvent } from './claude-panel-lazy.js';
3
3
  import { attachCodexAutomation, detachCodexAutomation, handleCodexAutomationEvent } from './ui-codex-panel.js';
4
4
  import { attachOpenCodeAutomation, detachOpenCodeAutomation } from './ui-opencode-panel-v2.js';
5
5
  import { attachAntigravityAutomation, detachAntigravityAutomation, handleAntigravityAutomationEvent } from './ui-antigravity-panel.js';
@@ -29,6 +29,8 @@ const _providerEventBuffers = new Map();
29
29
  const _localReleases = new LocalReleaseTracker();
30
30
  let _initialized = false;
31
31
  let _claimHeartbeat = null;
32
+ let _renewing = false;
33
+ let _retryClaimsAt = 0;
32
34
  let _suspended = false;
33
35
  let _suspendedClaims = new Map();
34
36
  let _reconcilePromise = null;
@@ -118,6 +120,7 @@ function trimLatestRuns() {
118
120
  }
119
121
 
120
122
  async function claim(run) {
123
+ if (Date.now() < _retryClaimsAt) return false;
121
124
  const claimToken = _claimToken;
122
125
  const claimEpoch = _claimEpoch;
123
126
  try {
@@ -126,7 +129,10 @@ async function claim(run) {
126
129
  headers: { 'Content-Type': 'application/json' },
127
130
  body: JSON.stringify({ windowId: _windowId, claimToken }),
128
131
  });
129
- if (!response.ok) return false;
132
+ if (!response.ok) {
133
+ if (response.status === 503) _retryClaimsAt = Date.now() + 2000;
134
+ return false;
135
+ }
130
136
  if (_suspended || claimEpoch !== _claimEpoch || claimToken !== _claimToken) {
131
137
  fetch(`/api/sidepanel-runs/${encodeURIComponent(run.runId)}/release`, {
132
138
  method: 'POST',
@@ -138,7 +144,7 @@ async function claim(run) {
138
144
  }
139
145
  const data = await response.json();
140
146
  const claimedRun = data?.run || run;
141
- _ownedClaims.set(run.runId, { provider: run.provider, status: claimedRun.status });
147
+ _ownedClaims.set(run.runId, { provider: run.provider, status: claimedRun.status, renewedAt: Date.now() });
142
148
  recordLatestRun(claimedRun);
143
149
  return claimedRun;
144
150
  } catch {
@@ -272,6 +278,7 @@ async function routeLatest(runId) {
272
278
  return false;
273
279
  }
274
280
  if (result?.ok) {
281
+ if (owned) owned.attachedVersion = run.version;
275
282
  _attached.set(run.runId, {
276
283
  provider: run.provider,
277
284
  iteration: run.currentIteration,
@@ -359,18 +366,26 @@ async function reconcileRuns() {
359
366
  if (!response.ok) return;
360
367
  const data = await response.json();
361
368
  const cutoff = Date.now() - 24 * 60 * 60 * 1000;
369
+ // Older servers moved updatedAt on a claim or release. A renewed lease
370
+ // does not make a finished conversation recent again.
371
+ const activityAt = (run) => run.completedAt || run.updatedAt || run.startedAt || '';
362
372
  const newestFirst = (data.runs || [])
363
373
  .filter(hasIdentity)
364
- .sort((a, b) => String(b.updatedAt || b.startedAt || '').localeCompare(String(a.updatedAt || a.startedAt || '')));
374
+ .sort((a, b) => activityAt(b).localeCompare(activityAt(a)));
365
375
  const activeRuns = newestFirst.filter((run) => LIVE_STATUSES.has(run.status));
366
376
  const terminalRuns = newestFirst.filter((run) => {
367
377
  if (!TERMINAL_STATUSES.has(run.status)) return false;
368
- if (new Date(run.updatedAt || run.startedAt || 0).getTime() < cutoff) return false;
378
+ if (!(Date.parse(activityAt(run)) >= cutoff)) return false;
369
379
  const claimAge = run.claimedAt ? Date.now() - new Date(run.claimedAt).getTime() : Infinity;
370
380
  return !run.claimedBy || run.claimedBy === _windowId || claimAge > CLAIM_TTL_MS;
371
381
  }).slice(0, TERMINAL_RESTORE_LIMIT);
372
- for (const run of activeRuns) await routeNativeLoopRun(run, { focus: false, retry: true });
373
- for (const run of terminalRuns) await routeNativeLoopRun(run, { focus: false, retry: true });
382
+ const restore = async (run) => {
383
+ const owned = _ownedClaims.get(run.runId);
384
+ if (run.claimedBy === _windowId && owned && Number.isFinite(run.version) && owned.attachedVersion === run.version) return;
385
+ await routeNativeLoopRun(run, { focus: false, retry: true });
386
+ };
387
+ for (const run of activeRuns) await restore(run);
388
+ for (const run of terminalRuns) await restore(run);
374
389
  } catch {}
375
390
  }
376
391
 
@@ -388,7 +403,7 @@ export function initNativeLoopRouter() {
388
403
  on('sync:sidepanel:run-created', route);
389
404
  on('sync:sidepanel:run-updated', (message) => {
390
405
  const run = descriptorFrom(message);
391
- if (message?.reason === 'claim-released' && run?.runId && _localReleases.consume(run.runId)) {
406
+ if (message?.reason === 'claim-released' && run?.runId && (_localReleases.consume(run.runId) || TERMINAL_STATUSES.has(run.status))) {
392
407
  recordLatestRun(run);
393
408
  return;
394
409
  }
@@ -500,19 +515,33 @@ export function initNativeLoopRouter() {
500
515
 
501
516
  function startClaimHeartbeat() {
502
517
  if (_claimHeartbeat) return;
503
- _claimHeartbeat = setInterval(() => {
504
- if (_suspended) return;
505
- for (const [runId, owned] of _ownedClaims) {
506
- fetch(`/api/sidepanel-runs/${encodeURIComponent(runId)}/claim`, {
507
- method: 'POST',
508
- headers: { 'Content-Type': 'application/json' },
509
- body: JSON.stringify({ windowId: _windowId, claimToken: _claimToken }),
510
- }).then((response) => {
511
- if (!response.ok) {
512
- loseClaim(runId, owned.provider);
518
+ _claimHeartbeat = setInterval(async () => {
519
+ if (_suspended || _renewing) return;
520
+ _renewing = true;
521
+ const epoch = _claimEpoch;
522
+ try {
523
+ for (const [runId, owned] of [..._ownedClaims]) {
524
+ if (_suspended || epoch !== _claimEpoch) return;
525
+ if (_ownedClaims.get(runId) !== owned) continue;
526
+ let response;
527
+ if (Date.now() >= _retryClaimsAt) {
528
+ try {
529
+ response = await fetch(`/api/sidepanel-runs/${encodeURIComponent(runId)}/claim`, {
530
+ method: 'POST',
531
+ headers: { 'Content-Type': 'application/json' },
532
+ body: JSON.stringify({ windowId: _windowId, claimToken: _claimToken }),
533
+ signal: AbortSignal.timeout(8000),
534
+ });
535
+ } catch { /* retry at the next heartbeat while the lease is valid */ }
536
+ if (_ownedClaims.get(runId) !== owned || epoch !== _claimEpoch) continue;
537
+ if (!response || response.status === 503) _retryClaimsAt = Date.now() + 2000;
513
538
  }
514
- }).catch(() => {});
515
- }
516
- scheduleReconcile();
539
+ if (response?.ok) owned.renewedAt = Date.now();
540
+ else if ((response && response.status !== 503) || Date.now() - owned.renewedAt >= CLAIM_TTL_MS) {
541
+ await loseClaim(runId, owned.provider);
542
+ }
543
+ }
544
+ if (_claimEpoch === epoch && Date.now() >= _retryClaimsAt) scheduleReconcile();
545
+ } finally { _renewing = false; }
517
546
  }, 30_000);
518
547
  }
@@ -9,10 +9,10 @@ import { state, emit, on } from './state.js';
9
9
  import { KEYS } from './constants.js';
10
10
  import { storage } from './storage.js';
11
11
  import { t } from './i18n.js';
12
- import { loadIfaceConfig, saveIfaceConfig, applyIfaceConfig } from './ui-settings.js';
12
+ import { loadIfaceConfig, saveIfaceConfig, applyIfaceConfig } from './iface-config.js';
13
13
  import { registerAction } from './ui-keybinds.js';
14
14
  import { startTutorial } from './ui-tutorial.js';
15
- import { toggleClaudePanel, isClaudePanelOpen } from './ui-claude-panel.js';
15
+ import { toggleClaudePanel, isClaudePanelOpen } from './claude-panel-lazy.js';
16
16
  import { toggleCodexPanel, isCodexPanelOpen } from './ui-codex-panel.js';
17
17
  import { toggleOpencodePanel, isOpencodePanelOpen } from './ui-opencode-panel-v2.js';
18
18
  import { toggleAntigravityPanel, isAntigravityPanelOpen } from './ui-antigravity-panel.js';
@@ -30,6 +30,8 @@ import { initOwnerAccessNotice } from './ui-owner-access.js';
30
30
  import { initSidepanelTrayPlaceholders } from './ui-sidepanel-tray.js';
31
31
  import { initDesktopTitleBar } from './desktop-titlebar.js';
32
32
  import { initToprightOverflow } from './ui-topright-overflow.js';
33
+ import { initTrayAutoClose } from './tray-auto-close.js';
34
+ import { initTrayColumns } from './ui-tray-columns.js';
33
35
 
34
36
  const $ = (id) => document.getElementById(id);
35
37
 
@@ -164,7 +166,7 @@ export function initNavbar() {
164
166
  }
165
167
 
166
168
  // ── Settings ──
167
- // Note: Settings button click is handled by initSettings() in ui-settings.js.
169
+ // Note: Settings button click is handled by initSettings() in ui-settings-entry.js (re-exported by ui-settings.js).
168
170
  // Do NOT add a click handler here — it would cause duplicate openSettingsModal() calls.
169
171
 
170
172
  // ── Trash ──
@@ -392,14 +394,18 @@ export function initNavbar() {
392
394
  // ── One row, always: what does not fit the band goes into the ⋯ menu ──
393
395
  initToprightOverflow();
394
396
 
395
- // ── Session pills in the row: the whole name is the tooltip ──
396
- // Laid out in a row, a pill keeps its width on hover (styles.css): widening, it would push the others onto another
397
- // line under the pointer. A name cut short is read from the tooltip instead; a pill that brings a tooltip of its own
398
- // (the Assistant's) keeps it.
397
+ // A pill keeps its width on hover. The tooltip shows its full name unless the producer supplies its own.
399
398
  const tray = $('term-minimized-tray');
400
- if (controls && tray && controls.contains(tray)) {
401
- const nameTips = () => {
399
+ if (controls && tray?.parentElement === controls) {
400
+ initTrayColumns(tray, storage);
401
+ initTrayAutoClose(tray, $('topright-auto-close-btn'), storage, t);
402
+ const nameTips = (records) => {
403
+ if (records && !records.some(({ target }) => {
404
+ const element = target.nodeType === 1 ? target : target.parentElement;
405
+ return element && !element.closest('.tray-col-head');
406
+ })) return;
402
407
  for (const pill of tray.children) {
408
+ if (pill.classList.contains('tray-col-head')) continue;
403
409
  const name = pill.querySelector('.term-minimized-pill-label')?.textContent.trim() || '';
404
410
  if (pill.hasAttribute('data-tooltip') && pill.dataset.tooltip !== pill.dataset.nameTip) {
405
411
  delete pill.dataset.nameTip;
@@ -1,18 +1,20 @@
1
1
  // ═══════════════════════════════════════════
2
- // SynaBun — OpenCode V2 Panel (barrel re-export)
2
+ // SynaBun — OpenCode V2 Panel (facade)
3
3
  // The OpenCode panel's entry point: one stable surface (toggleOpencodePanel /
4
4
  // isOpencodePanelOpen / openOpencodeWithPrompt / attachPathToOpencode and the
5
5
  // automation attach pair) for the shared UI modules to bind to.
6
- // Implementation lives in ./ocp-v2/. The earlier panel (./ocp/ and its
6
+ // Implementation lives in ./ocp-v2/, loaded on first use or in idle time after
7
+ // the page is shown (sidepanel-lazy.js; its module-level `opencode-panel:*`
8
+ // listeners are kept working before that). The earlier panel (./ocp/ and its
7
9
  // ./ui-opencode-panel.js barrel) was removed on 2026-10-04.
8
10
  // ═══════════════════════════════════════════
9
11
 
10
- export {
11
- toggleOpencodePanel,
12
- isOpencodePanelOpen,
13
- bootOpencodePanel,
14
- openOpencodeWithPrompt,
15
- attachPathToOpencode,
16
- attachOpenCodeAutomation,
17
- detachOpenCodeAutomation,
18
- } from './ocp-v2/ocp-v2-panel.js';
12
+ import { opencodePanelModule as panel } from './sidepanel-lazy.js';
13
+
14
+ export const toggleOpencodePanel = panel.asyncExport('toggleOpencodePanel');
15
+ export const isOpencodePanelOpen = panel.syncExport('isOpencodePanelOpen', false);
16
+ export const bootOpencodePanel = panel.asyncExport('bootOpencodePanel');
17
+ export const openOpencodeWithPrompt = panel.asyncExport('openOpencodeWithPrompt');
18
+ export const attachPathToOpencode = panel.asyncExport('attachPathToOpencode');
19
+ export const attachOpenCodeAutomation = panel.asyncExport('attachOpenCodeAutomation');
20
+ export const detachOpenCodeAutomation = panel.asyncExport('detachOpenCodeAutomation');
@@ -5,12 +5,9 @@
5
5
  // When the server cannot identify the program calling it (macOS, lib/peer-identity.js: netstat or ps missing,
6
6
  // denied, slow past their cap), it pauses the owner's actions (503 PEER_UNAVAILABLE). This banner says so, with the
7
7
  // reason and Reload to retry, in the update toast's glass at the top centre of the page (styles.css .owner-authority-notice):
8
- // non-modal, nothing behind it is blocked. It shows when
9
- // • GET /api/health says `ownerAuthority.state: 'degraded'` (asked when the page starts and every time the sync
10
- // socket connects: a page that was open through a restart is not reloaded), or
11
- // • a request of the page got 503 PEER_UNAVAILABLE (public/shared/page-session.js dispatches
12
- // `synabun:peer-unavailable` on the window).
13
- // While it shows, /api/health is asked again now and then, and the banner goes once the state is ok again (the
8
+ // non-modal, nothing behind it is blocked. Only GET /api/health can report a degraded verifier. The page checks
9
+ // at startup, on sync reconnect and when any request gets 503 PEER_UNAVAILABLE (including socket-specific failures).
10
+ // While verification is pending or the banner shows, the page rechecks health. The banner goes on recovery (the
14
11
  // page's next write then gets this boot's page secret by itself). Dismiss hides it until another reason comes. Never
15
12
  // on an invite guest's page (the owner's authority is not a guest's concern). What it says is
16
13
  // owner-authority-view.js (DOM-free, tested under node).
@@ -19,11 +16,11 @@ import { on } from './state.js';
19
16
  import { t } from './i18n.js';
20
17
  import { isGuest } from './ui-sync.js';
21
18
  import { PEER_UNAVAILABLE_EVENT } from './page-session.js';
22
- import { ownerAuthorityNoticeView, readOwnerAuthority, unavailableAuthority } from './owner-authority-view.js';
19
+ import { ownerAuthorityNoticeView, readOwnerAuthority } from './owner-authority-view.js';
23
20
 
24
21
  const HEALTH_URL = '/api/health';
25
22
  const NOTICE_ID = 'owner-authority-notice';
26
- /** How often /api/health is asked again while the banner shows. */
23
+ /** How often to check pending verification or a visible outage. */
27
24
  export const RECHECK_MS = 15_000;
28
25
 
29
26
  const translate = (key, params) => t(`ownerAuthorityNotice.${key}`, params);
@@ -31,6 +28,8 @@ const translate = (key, params) => t(`ownerAuthorityNotice.${key}`, params);
31
28
  let _wired = false;
32
29
  let _guest = false;
33
30
  let _asking = null;
31
+ let _checkAgain = false;
32
+ let _loadingWatch = null;
34
33
  let _current = null; // { key, el }
35
34
  let _dismissed = null; // the key this page dismissed
36
35
  let _recheck = null;
@@ -52,6 +51,8 @@ function startRecheck() {
52
51
 
53
52
  function hide() {
54
53
  stopRecheck();
54
+ _loadingWatch?.disconnect();
55
+ _loadingWatch = null;
55
56
  const current = _current;
56
57
  _current = null;
57
58
  if (!current) return;
@@ -66,9 +67,11 @@ function whenPageShown(run) {
66
67
  const watch = new MutationObserver(() => {
67
68
  if (!overlay.classList.contains('hidden')) return;
68
69
  watch.disconnect();
70
+ _loadingWatch = null;
69
71
  run();
70
72
  });
71
73
  watch.observe(overlay, { attributes: true, attributeFilter: ['class'] });
74
+ _loadingWatch = watch;
72
75
  }
73
76
 
74
77
  function draw(view) {
@@ -98,9 +101,8 @@ function draw(view) {
98
101
  });
99
102
  });
100
103
  document.body.appendChild(el);
101
- requestAnimationFrame(() => el.classList.add('show'));
102
104
  _current = { key: view.key, el };
103
- startRecheck();
105
+ requestAnimationFrame(() => { if (_current?.el === el) el.classList.add('show'); });
104
106
  }
105
107
 
106
108
  /** Reload to retry: the page asks for everything again, the page secret included (a lookup that works hands it out). */
@@ -116,10 +118,18 @@ function dismiss(key) {
116
118
  /** Show the banner for this owner authority (or none): never on a guest's page, never one this page dismissed. */
117
119
  export function presentOwnerAuthority(authority) {
118
120
  const view = ownerAuthorityNoticeView(authority, { t: translate });
119
- if (!view || guestPage()) { hide(); if (!view) _dismissed = null; return null; }
121
+ if (!view || guestPage()) {
122
+ hide();
123
+ if (!view) _dismissed = null;
124
+ if (authority?.state === 'pending' && !guestPage()) startRecheck();
125
+ return null;
126
+ }
120
127
  // A banner something else took off the page is drawn again.
121
128
  if (_current && !_current.el.isConnected) _current = null;
122
- if (_dismissed === view.key) return null;
129
+ if (_dismissed === view.key) { hide(); return null; }
130
+ _loadingWatch?.disconnect();
131
+ _loadingWatch = null;
132
+ startRecheck();
123
133
  if (_current?.key === view.key) return view;
124
134
  whenPageShown(() => {
125
135
  if (guestPage() || _dismissed === view.key || _current?.key === view.key) return;
@@ -129,19 +139,30 @@ export function presentOwnerAuthority(authority) {
129
139
  }
130
140
 
131
141
  /** Ask GET /api/health; an older server (no `ownerAuthority`) or a failed request changes nothing. */
132
- export function checkOwnerAuthority() {
142
+ export function checkOwnerAuthority({ fresh = false } = {}) {
133
143
  if (guestPage()) return Promise.resolve(null);
134
- if (_asking) return _asking;
144
+ if (_asking) {
145
+ if (fresh) _checkAgain = true;
146
+ return _asking;
147
+ }
135
148
  _asking = (async () => {
136
- try {
137
- const res = await fetch(HEALTH_URL, { headers: { Accept: 'application/json' }, cache: 'no-store' });
138
- if (!res.ok) return null;
139
- const authority = readOwnerAuthority(await res.json());
140
- if (authority) presentOwnerAuthority(authority);
141
- return authority;
142
- } catch {
143
- return null;
144
- }
149
+ let authority;
150
+ let previousState;
151
+ do {
152
+ _checkAgain = false;
153
+ authority = null;
154
+ try {
155
+ const res = await fetch(HEALTH_URL, { headers: { Accept: 'application/json' }, cache: 'no-store' });
156
+ if (res.ok) authority = readOwnerAuthority(await res.json());
157
+ } catch { /* keep the last confirmed state */ }
158
+ // A refusal or reconnect during this read merits a fresh sample. Two matching
159
+ // samples can already be shown, even if refusals arrive faster than health replies.
160
+ if (authority && !guestPage() && (!_checkAgain || authority.state === previousState)) {
161
+ presentOwnerAuthority(authority);
162
+ }
163
+ previousState = authority?.state;
164
+ } while (_checkAgain && !guestPage());
165
+ return authority;
145
166
  })().finally(() => { _asking = null; });
146
167
  return _asking;
147
168
  }
@@ -153,10 +174,12 @@ export function initOwnerAuthorityNotice() {
153
174
  on('session:info', (info) => {
154
175
  _guest = !!info?.isGuest;
155
176
  if (_guest) hide();
156
- else checkOwnerAuthority();
177
+ else checkOwnerAuthority({ fresh: true });
157
178
  });
158
179
  if (typeof window !== 'undefined' && typeof window.addEventListener === 'function') {
159
- window.addEventListener(PEER_UNAVAILABLE_EVENT, (event) => { presentOwnerAuthority(unavailableAuthority(event?.detail)); });
180
+ window.addEventListener(PEER_UNAVAILABLE_EVENT, (event) => {
181
+ if (event?.detail?.url !== HEALTH_URL) checkOwnerAuthority({ fresh: true });
182
+ });
160
183
  }
161
184
  checkOwnerAuthority();
162
185
  }
@@ -12,7 +12,7 @@ import { t, tp, getLocale } from './i18n.js';
12
12
  import { KEYS } from './constants.js';
13
13
  import { isGuest, hasPermission, showGuestToast } from './ui-sync.js';
14
14
  import { registerLaunchPrefetch } from './launch-prefetch.js';
15
- import { sendToPanel } from './ui-claude-panel.js';
15
+ import { sendToPanel } from './claude-panel-lazy.js';
16
16
  import { openAntigravityWithPrompt } from './ui-antigravity-panel.js';
17
17
  import { getProviderMeta } from './provider-icons.js';
18
18
  import { fetchAutomationApprovals, openApprovalDialog } from './ui-automation-approval.js';
@@ -2241,7 +2241,7 @@ async function saveScheduleFromEditor() {
2241
2241
  if (timezone !== shownZone) payload.timezone = timezone;
2242
2242
  if (stableJson(dayThemes) !== stableJson(original.dayThemes || {})) payload.dayThemes = dayThemes;
2243
2243
  for (const key of LAUNCH_FIELDS) if (!sameValue(launch[key], original[key])) payload[key] = launch[key];
2244
- // The MoreLogin profile: sent when it changed (null goes back to the default of Settings → Browser).
2244
+ // The MoreLogin profile: sent when it changed (null goes back to the default AI browser).
2245
2245
  if (!sameValue(moreloginEnvId, original.moreloginEnvId)) {
2246
2246
  payload.moreloginEnvId = moreloginEnvId;
2247
2247
  payload.moreloginEnvName = moreloginEnvName;
@@ -3131,7 +3131,7 @@ async function createQuickTimerFromForm(runNow) {
3131
3131
  const tools = strictToolHost(profile) ? readToolPicker($('sched-qt-mcp')) : null;
3132
3132
  const codexAccountId = profile === 'codex' ? ($('sched-qt-account')?.value || _launchAccount || 'default') : undefined;
3133
3133
  const usesBrowser = _qtUsesBrowser !== null ? _qtUsesBrowser : !!template?.usesBrowser;
3134
- // The MoreLogin profile of this one run (none: the default of Settings → Browser).
3134
+ // The MoreLogin profile of this one run (none: the default AI browser).
3135
3135
  _qtMoreLogin = readMoreLoginField('sched-qt-mlprofile') || _qtMoreLogin;
3136
3136
  const moreloginEnvId = _qtMoreLogin.moreloginEnvId || undefined;
3137
3137
  const moreloginEnvName = moreloginEnvId ? (_qtMoreLogin.moreloginEnvName || undefined) : undefined;
@@ -1,4 +1,7 @@
1
1
  const DEFAULT_THRESHOLD_PX = 48;
2
+ // A side panel that is closed (ui-sidepanel-windows.js keeps data-sp-visible on every registered panel).
3
+ const HOST_VISIBLE_ATTR = 'data-sp-visible';
4
+ const CLOSED_HOST = `.sp-sidepanel[${HOST_VISIBLE_ATTR}="false"]`;
2
5
 
3
6
  const controllers = new WeakMap();
4
7
 
@@ -59,10 +62,45 @@ export function createStickyScrollController(container, options = {}) {
59
62
  lastScrollTop = container.scrollTop;
60
63
  };
61
64
 
65
+ // A transcript inside a closed side panel is not drawn (ui-sidepanel-windows.js: data-sp-visible="false",
66
+ // content-visibility: hidden). Scrolling it reads its height, which makes the engine lay the whole hidden
67
+ // panel out: once per frame for as long as a session streams there. The follow is kept instead and the
68
+ // scroll is made when the panel is shown: the attribute changes inside the task that opens it, the
69
+ // observer answers right after that task and the frame that draws the panel is already at the bottom.
70
+ let waitingHost = null;
71
+ let hostObserver = null;
72
+ const stopWaitingForHost = () => {
73
+ try { hostObserver?.disconnect(); } catch { /* already gone */ }
74
+ hostObserver = null;
75
+ waitingHost = null;
76
+ };
77
+ const closedHost = () => (typeof container.closest === 'function' ? container.closest(CLOSED_HOST) : null);
78
+ const waitForHost = (host) => {
79
+ if (waitingHost === host) return true;
80
+ const HostObserver = view.MutationObserver || globalThis.MutationObserver;
81
+ if (typeof HostObserver !== 'function') return false;
82
+ stopWaitingForHost();
83
+ waitingHost = host;
84
+ hostObserver = new HostObserver(() => {
85
+ if (disposed) { stopWaitingForHost(); return; }
86
+ if (host.getAttribute(HOST_VISIBLE_ATTR) === 'false' && host.contains(container)) return;
87
+ stopWaitingForHost();
88
+ scrollToBottom();
89
+ });
90
+ hostObserver.observe(host, { attributes: true, attributeFilter: [HOST_VISIBLE_ATTR] });
91
+ return true;
92
+ };
93
+
62
94
  const scrollToBottom = ({ force = false, immediate = false } = {}) => {
63
95
  if (disposed) return false;
64
96
  if (force) setFollowing(true);
65
97
  if (!following || !active) return false;
98
+ const host = closedHost();
99
+ if (host && waitForHost(host)) {
100
+ cancelScheduled();
101
+ return true;
102
+ }
103
+ if (!host && waitingHost) stopWaitingForHost(); // moved out of the closed panel (a detached window)
66
104
  if (immediate) {
67
105
  cancelScheduled();
68
106
  writeBottom();
@@ -185,6 +223,7 @@ export function createStickyScrollController(container, options = {}) {
185
223
  if (disposed) return;
186
224
  disposed = true;
187
225
  cancelScheduled();
226
+ stopWaitingForHost();
188
227
  resizeObserver?.disconnect();
189
228
  observedChildren.clear();
190
229
  mutationObserver?.disconnect();
@@ -11,10 +11,10 @@
11
11
  import { emit, on } from './state.js';
12
12
  import { getSynabunUpdateData, openSynabunUpdateModal, syncSynabunUpdateData, synabunUpdateMeta } from './ui-update.js';
13
13
  import { getToolUpdateData, runToolUpdate, TOOL_LABELS } from './ui-tool-updates.js';
14
- import { openSettingsModal } from './ui-settings.js';
14
+ import { openSettingsModal } from './ui-settings-entry.js';
15
15
  import { getProviderMeta } from './provider-icons.js';
16
- import { sendToPanel as sendToClaudePanel, isClaudePanelOpen } from './ui-claude-panel.js';
17
- import { toggleCodexPanel, isCodexPanelOpen } from './cdx/cdx-panel.js';
16
+ import { sendToPanel as sendToClaudePanel, isClaudePanelOpen } from './claude-panel-lazy.js';
17
+ import { toggleCodexPanel, isCodexPanelOpen } from './ui-codex-panel.js';
18
18
  import { openOpencodeWithPrompt } from './ui-opencode-panel-v2.js';
19
19
  import { openAntigravityWithPrompt } from './ui-antigravity-panel.js';
20
20
  import { dropdownHTML, wireDropdowns } from './cc-dropdown.js';
@@ -0,0 +1,55 @@
1
+ // SynaBun — the Settings window's entry: everything the page needs from Settings before it is opened.
2
+ //
3
+ // ui-settings.js, with what it imports, is about 2 MB of modules. The boot used to load it before the first frame;
4
+ // now the window loads on its first open, or in idle time after the page is shown (its search index is a launch
5
+ // step, launch-prefetch.js, which loads it), whichever comes first. What must work before that is wired here, as
6
+ // ui-settings.js's initSettings did: the three Settings buttons, the `open-settings` shortcut, reopening after a
7
+ // language change, the launch prefetches and the listeners that keep Settings' data current. The interface config
8
+ // and the skin are iface-config.js.
9
+
10
+ import { on } from './state.js';
11
+ import { registerAction } from './ui-keybinds.js';
12
+ import { registerLaunchPrefetch } from './launch-prefetch.js';
13
+ import { prefetchSettingsData, refreshSettingsData } from './settings/settings-data.js';
14
+ import { createLazyModule } from './lazy-module.js';
15
+
16
+ export const settingsModule = createLazyModule(() => import('./ui-settings.js'), { name: 'Settings' });
17
+
18
+ /** Open Settings (`{ tab, expand, scrollTo }`, ui-settings.js), loading the window first when it has not loaded. */
19
+ export const openSettingsModal = settingsModule.asyncExport('openSettingsModal');
20
+
21
+ /** ui-settings.js's SETTINGS_REOPEN_KEY: the page a language change asked Settings to reopen on. */
22
+ export const SETTINGS_REOPEN_KEY = 'synabun-settings-reopen';
23
+
24
+ function reopenWanted() {
25
+ try { return !!globalThis.sessionStorage?.getItem(SETTINGS_REOPEN_KEY); } catch { return false; }
26
+ }
27
+
28
+ let _initialized = false;
29
+ export function initSettings() {
30
+ if (_initialized) return;
31
+ _initialized = true;
32
+ const settingsBtn = document.getElementById('settings-btn');
33
+ if (settingsBtn) settingsBtn.addEventListener('click', () => openSettingsModal());
34
+
35
+ const titlebarBtn = document.getElementById('titlebar-settings-btn');
36
+ if (titlebarBtn) titlebarBtn.addEventListener('click', () => openSettingsModal());
37
+
38
+ const menubarBtn = document.getElementById('menubar-settings-btn');
39
+ if (menubarBtn) menubarBtn.addEventListener('click', () => openSettingsModal());
40
+
41
+ registerAction('open-settings', openSettingsModal);
42
+
43
+ // A language change reloaded the app: open Settings again where the user was, once the rest of the app has started.
44
+ if (reopenWanted()) setTimeout(() => { settingsModule.call('reopenSettingsAfterReload', []); }, 0);
45
+
46
+ // Launch: what Settings is built from, and its search index (the English names too), read and made once the
47
+ // page has painted, so the first open and the first search wait for nothing. The index needs the window's module:
48
+ // this step is what loads it in idle time.
49
+ registerLaunchPrefetch('settings-data', () => prefetchSettingsData(), { order: 60, owner: true });
50
+ registerLaunchPrefetch('settings-search-index', () => settingsModule.call('prebuildSettingsSearchIndex', []), { order: 62 });
51
+ // Changes other windows announce: the next open shows them.
52
+ on('sync:skin:changed', () => refreshSettingsData(['skins']));
53
+ on('sync:greeting:changed', () => refreshSettingsData(['greeting']));
54
+ on('sync:assistant:user-context-changed', () => refreshSettingsData(['userContext']));
55
+ }