synabun 2.3.1 → 2.4.0

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 (356) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +1 -1
  3. package/browser-extension/content.js +169 -0
  4. package/browser-extension/engine.js +477 -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 +244 -0
  17. package/browser-extension/popup-view.js +151 -0
  18. package/browser-extension/popup.css +165 -0
  19. package/browser-extension/popup.html +105 -0
  20. package/browser-extension/popup.js +347 -0
  21. package/browser-extension/protocol.js +226 -0
  22. package/browser-extension/service-worker.js +267 -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/mcp-server/dist/http.d.ts +2 -0
  28. package/mcp-server/dist/http.d.ts.map +1 -1
  29. package/mcp-server/dist/http.js +9 -1
  30. package/mcp-server/dist/http.js.map +1 -1
  31. package/mcp-server/dist/index.d.ts +11 -0
  32. package/mcp-server/dist/index.d.ts.map +1 -1
  33. package/mcp-server/dist/index.js +38 -3
  34. package/mcp-server/dist/index.js.map +1 -1
  35. package/mcp-server/dist/services/browser-route-flow.d.ts +6 -2
  36. package/mcp-server/dist/services/browser-route-flow.d.ts.map +1 -1
  37. package/mcp-server/dist/services/browser-route-flow.js +10 -3
  38. package/mcp-server/dist/services/browser-route-flow.js.map +1 -1
  39. package/mcp-server/dist/services/codex-config-heal.d.ts.map +1 -1
  40. package/mcp-server/dist/services/codex-config-heal.js +7 -0
  41. package/mcp-server/dist/services/codex-config-heal.js.map +1 -1
  42. package/mcp-server/dist/services/neural-interface.d.ts +94 -3
  43. package/mcp-server/dist/services/neural-interface.d.ts.map +1 -1
  44. package/mcp-server/dist/services/neural-interface.js +168 -23
  45. package/mcp-server/dist/services/neural-interface.js.map +1 -1
  46. package/mcp-server/dist/services/team-context.d.ts +18 -0
  47. package/mcp-server/dist/services/team-context.d.ts.map +1 -0
  48. package/mcp-server/dist/services/team-context.js +29 -0
  49. package/mcp-server/dist/services/team-context.js.map +1 -0
  50. package/mcp-server/dist/services/tool-catalog.d.ts +5 -2
  51. package/mcp-server/dist/services/tool-catalog.d.ts.map +1 -1
  52. package/mcp-server/dist/services/tool-catalog.js +22 -6
  53. package/mcp-server/dist/services/tool-catalog.js.map +1 -1
  54. package/mcp-server/dist/services/tool-list.d.ts.map +1 -1
  55. package/mcp-server/dist/services/tool-list.js +4 -0
  56. package/mcp-server/dist/services/tool-list.js.map +1 -1
  57. package/mcp-server/dist/services/tool-runtime.d.ts +8 -1
  58. package/mcp-server/dist/services/tool-runtime.d.ts.map +1 -1
  59. package/mcp-server/dist/services/tool-runtime.js +18 -1
  60. package/mcp-server/dist/services/tool-runtime.js.map +1 -1
  61. package/mcp-server/dist/tools/agent-definition.d.ts +133 -0
  62. package/mcp-server/dist/tools/agent-definition.d.ts.map +1 -0
  63. package/mcp-server/dist/tools/agent-definition.js +483 -0
  64. package/mcp-server/dist/tools/agent-definition.js.map +1 -0
  65. package/mcp-server/dist/tools/agents.d.ts +91 -9
  66. package/mcp-server/dist/tools/agents.d.ts.map +1 -1
  67. package/mcp-server/dist/tools/agents.js +161 -20
  68. package/mcp-server/dist/tools/agents.js.map +1 -1
  69. package/mcp-server/dist/tools/browser-advanced.d.ts +8 -1
  70. package/mcp-server/dist/tools/browser-advanced.d.ts.map +1 -1
  71. package/mcp-server/dist/tools/browser-advanced.js +70 -6
  72. package/mcp-server/dist/tools/browser-advanced.js.map +1 -1
  73. package/mcp-server/dist/tools/git-tools.d.ts +4 -2
  74. package/mcp-server/dist/tools/git-tools.d.ts.map +1 -1
  75. package/mcp-server/dist/tools/git-tools.js +283 -2
  76. package/mcp-server/dist/tools/git-tools.js.map +1 -1
  77. package/mcp-server/dist/tools/morelogin.d.ts +8 -2
  78. package/mcp-server/dist/tools/morelogin.d.ts.map +1 -1
  79. package/mcp-server/dist/tools/morelogin.js +22 -5
  80. package/mcp-server/dist/tools/morelogin.js.map +1 -1
  81. package/mcp-server/dist/tools/team.d.ts +32 -0
  82. package/mcp-server/dist/tools/team.d.ts.map +1 -0
  83. package/mcp-server/dist/tools/team.js +87 -0
  84. package/mcp-server/dist/tools/team.js.map +1 -0
  85. package/mcp-server/package-lock.json +2 -2
  86. package/mcp-server/package.json +1 -1
  87. package/mcp-server/src/http.ts +9 -1
  88. package/mcp-server/src/index.ts +34 -4
  89. package/mcp-server/src/services/browser-route-flow.ts +12 -5
  90. package/mcp-server/src/services/codex-config-heal.ts +7 -0
  91. package/mcp-server/src/services/neural-interface.ts +190 -29
  92. package/mcp-server/src/services/team-context.ts +27 -0
  93. package/mcp-server/src/services/tool-catalog.ts +26 -8
  94. package/mcp-server/src/services/tool-list.ts +4 -0
  95. package/mcp-server/src/services/tool-runtime.ts +21 -2
  96. package/mcp-server/src/tools/agent-definition.ts +458 -0
  97. package/mcp-server/src/tools/agents.ts +175 -19
  98. package/mcp-server/src/tools/browser-advanced.ts +60 -6
  99. package/mcp-server/src/tools/git-tools.ts +249 -3
  100. package/mcp-server/src/tools/morelogin.ts +20 -5
  101. package/mcp-server/src/tools/team.ts +97 -0
  102. package/neural-interface/i18n/en.json +1117 -47
  103. package/neural-interface/i18n/pt-BR.json +1117 -47
  104. package/neural-interface/lib/account-usage.js +1 -1
  105. package/neural-interface/lib/agents/density.js +101 -0
  106. package/neural-interface/lib/agents/forge-host.js +223 -0
  107. package/neural-interface/lib/agents/native-export-targets.js +190 -0
  108. package/neural-interface/lib/agents/native-export.js +365 -0
  109. package/neural-interface/lib/agents/registry.js +840 -0
  110. package/neural-interface/lib/agents/resolve.js +544 -0
  111. package/neural-interface/lib/agents/schema.js +642 -0
  112. package/neural-interface/lib/agents/split.js +37 -0
  113. package/neural-interface/lib/agents-studio-api.js +591 -0
  114. package/neural-interface/lib/assistant-api.js +76 -7
  115. package/neural-interface/lib/assistant-catalog.js +2 -0
  116. package/neural-interface/lib/assistant-continuity.js +49 -0
  117. package/neural-interface/lib/assistant-dispatch.js +229 -102
  118. package/neural-interface/lib/assistant-persona.js +105 -8
  119. package/neural-interface/lib/assistant-route-gate.js +24 -9
  120. package/neural-interface/lib/assistant-router.js +384 -42
  121. package/neural-interface/lib/assistant-run-tail.js +151 -0
  122. package/neural-interface/lib/assistant-run-wait.js +183 -0
  123. package/neural-interface/lib/assistant-runtime.js +440 -93
  124. package/neural-interface/lib/assistant-task-prompt.js +11 -2
  125. package/neural-interface/lib/assistant-usage.js +3 -2
  126. package/neural-interface/lib/automation-approval.js +2 -2
  127. package/neural-interface/lib/browser-close-evidence.js +80 -0
  128. package/neural-interface/lib/browser-default.js +210 -0
  129. package/neural-interface/lib/browser-extension-adapter.js +255 -0
  130. package/neural-interface/lib/browser-extension-bridge.js +418 -0
  131. package/neural-interface/lib/browser-extension-folder.js +116 -0
  132. package/neural-interface/lib/browser-extension-setup.js +140 -0
  133. package/neural-interface/lib/browser-profile-choices.js +3 -3
  134. package/neural-interface/lib/browser-tool-policy.js +1 -1
  135. package/neural-interface/lib/claude-account-links.js +301 -0
  136. package/neural-interface/lib/claude-accounts.js +45 -20
  137. package/neural-interface/lib/claude-agent-bridge.js +142 -10
  138. package/neural-interface/lib/claude-model-catalog.js +6 -0
  139. package/neural-interface/lib/claude-panel-session.js +33 -0
  140. package/neural-interface/lib/codex-accounts.js +67 -24
  141. package/neural-interface/lib/coordination/README.md +384 -0
  142. package/neural-interface/lib/coordination/service.js +563 -0
  143. package/neural-interface/lib/coordination/store.js +1138 -0
  144. package/neural-interface/lib/db.js +22 -1
  145. package/neural-interface/lib/effort-levels.js +10 -1
  146. package/neural-interface/lib/memory-list-page.js +49 -0
  147. package/neural-interface/lib/memory-list-stamp.js +60 -0
  148. package/neural-interface/lib/morelogin-outside-close.js +186 -0
  149. package/neural-interface/lib/morelogin-profile-failures.js +206 -0
  150. package/neural-interface/lib/morelogin-start-cooldown.js +160 -0
  151. package/neural-interface/lib/morelogin.js +194 -8
  152. package/neural-interface/lib/native-loop-runtime.js +20 -0
  153. package/neural-interface/lib/opencode-build-preflight.js +16 -1
  154. package/neural-interface/lib/opencode-native-boundary.js +83 -13
  155. package/neural-interface/lib/opencode-serve-records.js +14 -9
  156. package/neural-interface/lib/page-session.js +1 -1
  157. package/neural-interface/lib/peer-identity.js +60 -21
  158. package/neural-interface/lib/process-identity.js +68 -7
  159. package/neural-interface/lib/request-gate.js +3 -0
  160. package/neural-interface/lib/screenshot-location.js +33 -0
  161. package/neural-interface/lib/skills/creation.js +1 -1
  162. package/neural-interface/lib/skills/known-bridge-digests.json +40 -0
  163. package/neural-interface/lib/studio-attention.js +56 -0
  164. package/neural-interface/lib/teams/README.md +382 -0
  165. package/neural-interface/lib/teams/api.js +287 -0
  166. package/neural-interface/lib/teams/brief.js +185 -0
  167. package/neural-interface/lib/teams/claims.js +315 -0
  168. package/neural-interface/lib/teams/git.js +293 -0
  169. package/neural-interface/lib/teams/index.js +122 -0
  170. package/neural-interface/lib/teams/integration.js +580 -0
  171. package/neural-interface/lib/teams/landing.js +184 -0
  172. package/neural-interface/lib/teams/recovery.js +256 -0
  173. package/neural-interface/lib/teams/scheduler.js +1474 -0
  174. package/neural-interface/lib/teams/schema.js +559 -0
  175. package/neural-interface/lib/teams/state.js +181 -0
  176. package/neural-interface/lib/teams/test-runner.js +86 -0
  177. package/neural-interface/lib/teams/test-sandbox.js +99 -0
  178. package/neural-interface/lib/teams/worktrees.js +757 -0
  179. package/neural-interface/lib/tool-permission-choices.js +226 -0
  180. package/neural-interface/lib/whatsapp/cards.js +24 -10
  181. package/neural-interface/lib/worker-confinement.js +206 -6
  182. package/neural-interface/package-lock.json +2 -2
  183. package/neural-interface/package.json +1 -1
  184. package/neural-interface/public/extension-setup.html +107 -0
  185. package/neural-interface/public/index.html +52 -12
  186. package/neural-interface/public/shared/agent-runtime-options.js +3 -1
  187. package/neural-interface/public/shared/agents/studio/ax-agent-view.js +614 -0
  188. package/neural-interface/public/shared/agents/studio/ax-api.js +198 -0
  189. package/neural-interface/public/shared/agents/studio/ax-create-view.js +221 -0
  190. package/neural-interface/public/shared/agents/studio/ax-diff.js +143 -0
  191. package/neural-interface/public/shared/agents/studio/ax-editor-view.js +392 -0
  192. package/neural-interface/public/shared/agents/studio/ax-export-view.js +94 -0
  193. package/neural-interface/public/shared/agents/studio/ax-form.js +191 -0
  194. package/neural-interface/public/shared/agents/studio/ax-icons.js +87 -0
  195. package/neural-interface/public/shared/agents/studio/ax-library-view.js +158 -0
  196. package/neural-interface/public/shared/agents/studio/ax-library.js +162 -0
  197. package/neural-interface/public/shared/agents/studio/ax-main.js +712 -0
  198. package/neural-interface/public/shared/agents/studio/ax-native-export.js +35 -0
  199. package/neural-interface/public/shared/agents/studio/ax-options.js +198 -0
  200. package/neural-interface/public/shared/agents/studio/ax-review-view.js +175 -0
  201. package/neural-interface/public/shared/agents/studio/ax-revisions-view.js +189 -0
  202. package/neural-interface/public/shared/agents/studio/ax-runs-view.js +202 -0
  203. package/neural-interface/public/shared/agents/studio/ax-runs.js +82 -0
  204. package/neural-interface/public/shared/agents/studio/ax-teams-view.js +256 -0
  205. package/neural-interface/public/shared/agents/studio/ax-teams.js +200 -0
  206. package/neural-interface/public/shared/agents/studio/ax-templates.js +50 -0
  207. package/neural-interface/public/shared/agents/studio/ax-ui.js +194 -0
  208. package/neural-interface/public/shared/agents/studio/ax-views.js +170 -0
  209. package/neural-interface/public/shared/agy/agy-panel.js +142 -28
  210. package/neural-interface/public/shared/agy/agy-styles.js +25 -5
  211. package/neural-interface/public/shared/assistant/asst-account-menu.js +13 -13
  212. package/neural-interface/public/shared/assistant/asst-ask-styles.js +2 -3
  213. package/neural-interface/public/shared/assistant/asst-brain-picker.js +91 -9
  214. package/neural-interface/public/shared/assistant/asst-control.js +3 -0
  215. package/neural-interface/public/shared/assistant/asst-interaction-hold.js +99 -0
  216. package/neural-interface/public/shared/assistant/asst-limit-dismissals.js +111 -0
  217. package/neural-interface/public/shared/assistant/asst-limit-dock.js +37 -3
  218. package/neural-interface/public/shared/assistant/asst-limit-wait.js +30 -7
  219. package/neural-interface/public/shared/assistant/asst-panel.js +177 -30
  220. package/neural-interface/public/shared/assistant/asst-rack-styles.js +15 -8
  221. package/neural-interface/public/shared/assistant/asst-render.js +36 -6
  222. package/neural-interface/public/shared/assistant/asst-route.js +78 -12
  223. package/neural-interface/public/shared/assistant/asst-routes-editor.js +148 -70
  224. package/neural-interface/public/shared/assistant/asst-roving.js +17 -1
  225. package/neural-interface/public/shared/assistant/asst-scene-styles.js +7 -2
  226. package/neural-interface/public/shared/assistant/asst-scenes.js +12 -1
  227. package/neural-interface/public/shared/assistant/asst-sidepanel.js +12 -2
  228. package/neural-interface/public/shared/assistant/asst-state.js +66 -1
  229. package/neural-interface/public/shared/assistant/asst-styles.js +98 -44
  230. package/neural-interface/public/shared/assistant/route-identity.js +16 -0
  231. package/neural-interface/public/shared/cdx/cdx-output.js +10 -0
  232. package/neural-interface/public/shared/cdx/cdx-panel.js +18 -16
  233. package/neural-interface/public/shared/cdx/cdx-plan.js +3 -2
  234. package/neural-interface/public/shared/cdx/cdx-render.js +122 -45
  235. package/neural-interface/public/shared/cdx/cdx-requests.js +4 -4
  236. package/neural-interface/public/shared/cdx/cdx-styles.js +8 -36
  237. package/neural-interface/public/shared/cdx/cdx-tabs.js +110 -42
  238. package/neural-interface/public/shared/claude-panel-lazy.js +12 -0
  239. package/neural-interface/public/shared/code-copy.js +120 -0
  240. package/neural-interface/public/shared/constants.js +7 -0
  241. package/neural-interface/public/shared/context-menu-model.js +1 -0
  242. package/neural-interface/public/shared/cp/cp-markdown.js +7 -2
  243. package/neural-interface/public/shared/cp/cp-session-model.js +86 -5
  244. package/neural-interface/public/shared/cp/cp-session-settings.js +58 -30
  245. package/neural-interface/public/shared/cp/cp-styles.js +9 -0
  246. package/neural-interface/public/shared/dom-change-flag.js +66 -0
  247. package/neural-interface/public/shared/dom-morph.js +124 -0
  248. package/neural-interface/public/shared/extension-setup/es-page.css +134 -0
  249. package/neural-interface/public/shared/extension-setup/es-page.js +120 -0
  250. package/neural-interface/public/shared/extension-setup/es-view.js +100 -0
  251. package/neural-interface/public/shared/html-shell.js +33 -4
  252. package/neural-interface/public/shared/i18n.js +14 -1
  253. package/neural-interface/public/shared/idle-queue.js +78 -0
  254. package/neural-interface/public/shared/iface-config.js +227 -0
  255. package/neural-interface/public/shared/lazy-module.js +108 -0
  256. package/neural-interface/public/shared/memory-list.js +117 -0
  257. package/neural-interface/public/shared/morelogin-profile-choices.js +1 -1
  258. package/neural-interface/public/shared/morelogin-profile-field.js +3 -3
  259. package/neural-interface/public/shared/mtc/mtc-panel.js +3 -1
  260. package/neural-interface/public/shared/mtc/mtc-styles.js +4 -1
  261. package/neural-interface/public/shared/ocp-v2/ocp-v2-manager.js +35 -15
  262. package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +77 -23
  263. package/neural-interface/public/shared/ocp-v2/ocp-v2-projectbar.js +3 -6
  264. package/neural-interface/public/shared/ocp-v2/ocp-v2-render.js +24 -21
  265. package/neural-interface/public/shared/ocp-v2/ocp-v2-send-logic.js +16 -5
  266. package/neural-interface/public/shared/ocp-v2/ocp-v2-sessions-logic.js +16 -2
  267. package/neural-interface/public/shared/ocp-v2/ocp-v2-styles.js +27 -43
  268. package/neural-interface/public/shared/ocp-v2/ocp-v2-ws.js +73 -9
  269. package/neural-interface/public/shared/schedules-view.js +2 -2
  270. package/neural-interface/public/shared/session-project-items.js +11 -0
  271. package/neural-interface/public/shared/settings/settings-ai-browser.js +119 -0
  272. package/neural-interface/public/shared/settings/settings-browser-extension.js +446 -0
  273. package/neural-interface/public/shared/settings/settings-ia.js +4 -2
  274. package/neural-interface/public/shared/settings/settings-morelogin-cooldown.js +63 -0
  275. package/neural-interface/public/shared/settings/settings-tool-permissions.js +70 -0
  276. package/neural-interface/public/shared/sidepanel-lazy.js +40 -0
  277. package/neural-interface/public/shared/sidepanel-session-status.js +8 -14
  278. package/neural-interface/public/shared/sidepanel-shown.js +73 -0
  279. package/neural-interface/public/shared/storage.js +6 -1
  280. package/neural-interface/public/shared/studio-attention.js +83 -0
  281. package/neural-interface/public/shared/styles.css +682 -50
  282. package/neural-interface/public/shared/term-browser-tabs.js +34 -0
  283. package/neural-interface/public/shared/transcript-rows.js +334 -0
  284. package/neural-interface/public/shared/tray-auto-close.js +106 -0
  285. package/neural-interface/public/shared/ui-agents.js +97 -0
  286. package/neural-interface/public/shared/ui-antigravity-panel.js +16 -14
  287. package/neural-interface/public/shared/ui-automation-studio.js +3 -3
  288. package/neural-interface/public/shared/ui-claude-panel.js +162 -95
  289. package/neural-interface/public/shared/ui-code-copy.js +256 -0
  290. package/neural-interface/public/shared/ui-codex-panel.js +14 -10
  291. package/neural-interface/public/shared/ui-context-menu.js +1 -1
  292. package/neural-interface/public/shared/ui-file-explorer.js +2 -3
  293. package/neural-interface/public/shared/ui-games.js +1 -1
  294. package/neural-interface/public/shared/ui-loading.js +12 -1
  295. package/neural-interface/public/shared/ui-maritaca-panel.js +12 -11
  296. package/neural-interface/public/shared/ui-menubar.js +23 -0
  297. package/neural-interface/public/shared/ui-native-loop-router.js +1 -1
  298. package/neural-interface/public/shared/ui-navbar.js +15 -9
  299. package/neural-interface/public/shared/ui-opencode-panel-v2.js +13 -11
  300. package/neural-interface/public/shared/ui-schedules-studio.js +3 -3
  301. package/neural-interface/public/shared/ui-scroll-follow.js +39 -0
  302. package/neural-interface/public/shared/ui-sessions.js +3 -3
  303. package/neural-interface/public/shared/ui-settings-entry.js +55 -0
  304. package/neural-interface/public/shared/ui-settings.js +355 -400
  305. package/neural-interface/public/shared/ui-sidepanel-layout.js +44 -25
  306. package/neural-interface/public/shared/ui-sidepanel-session-entry.js +22 -9
  307. package/neural-interface/public/shared/ui-sidepanel-sessions.js +10 -2
  308. package/neural-interface/public/shared/ui-sidepanel-tray.js +36 -41
  309. package/neural-interface/public/shared/ui-sidepanel-windows.js +14 -1
  310. package/neural-interface/public/shared/ui-styleguide.js +10 -2
  311. package/neural-interface/public/shared/ui-sync.js +5 -0
  312. package/neural-interface/public/shared/ui-terminal.js +13 -9
  313. package/neural-interface/public/shared/ui-tooltip.js +28 -7
  314. package/neural-interface/public/shared/ui-topright-overflow.js +26 -4
  315. package/neural-interface/public/shared/ui-tray-columns.js +375 -0
  316. package/neural-interface/public/shared/ui-whiteboard.js +51 -6
  317. package/neural-interface/public/shared/ui-worker-end.js +28 -1
  318. package/neural-interface/public/shared/ui-workspaces.js +13 -0
  319. package/neural-interface/public/shared/window-keys.js +71 -0
  320. package/neural-interface/public/variant/2d/main.js +2 -0
  321. package/neural-interface/public/variant/3d/app.js +620 -0
  322. package/neural-interface/public/variant/3d/boot-reveal.js +47 -0
  323. package/neural-interface/public/variant/3d/main.js +21 -544
  324. package/neural-interface/public/variant/3d/map-controls.js +4 -2
  325. package/neural-interface/public/vendor/fonts/fonts.css +508 -0
  326. package/neural-interface/public/vendor/fonts/inter-OFL.txt +93 -0
  327. package/neural-interface/public/vendor/fonts/inter-cyrillic-ext.woff2 +0 -0
  328. package/neural-interface/public/vendor/fonts/inter-cyrillic.woff2 +0 -0
  329. package/neural-interface/public/vendor/fonts/inter-greek-ext.woff2 +0 -0
  330. package/neural-interface/public/vendor/fonts/inter-greek.woff2 +0 -0
  331. package/neural-interface/public/vendor/fonts/inter-latin-ext.woff2 +0 -0
  332. package/neural-interface/public/vendor/fonts/inter-latin.woff2 +0 -0
  333. package/neural-interface/public/vendor/fonts/inter-vietnamese.woff2 +0 -0
  334. package/neural-interface/public/vendor/fonts/jetbrains-mono-OFL.txt +93 -0
  335. package/neural-interface/public/vendor/fonts/jetbrains-mono-cyrillic-ext.woff2 +0 -0
  336. package/neural-interface/public/vendor/fonts/jetbrains-mono-cyrillic.woff2 +0 -0
  337. package/neural-interface/public/vendor/fonts/jetbrains-mono-greek.woff2 +0 -0
  338. package/neural-interface/public/vendor/fonts/jetbrains-mono-latin-ext.woff2 +0 -0
  339. package/neural-interface/public/vendor/fonts/jetbrains-mono-latin.woff2 +0 -0
  340. package/neural-interface/public/vendor/fonts/jetbrains-mono-vietnamese.woff2 +0 -0
  341. package/neural-interface/public/vendor/fonts/manifest.json +142 -0
  342. package/neural-interface/public/vendor/fonts/space-grotesk-OFL.txt +93 -0
  343. package/neural-interface/public/vendor/fonts/space-grotesk-latin-ext.woff2 +0 -0
  344. package/neural-interface/public/vendor/fonts/space-grotesk-latin.woff2 +0 -0
  345. package/neural-interface/public/vendor/fonts/space-grotesk-vietnamese.woff2 +0 -0
  346. package/neural-interface/scripts/boot-graph.mjs +270 -0
  347. package/neural-interface/scripts/vendor-fonts.mjs +124 -0
  348. package/neural-interface/server.js +1050 -140
  349. package/npm-shrinkwrap.json +2 -2
  350. package/package.json +3 -1
  351. package/skills/agent-forge/SKILL.md +182 -0
  352. package/skills/agent-forge/evals/evals.json +56 -0
  353. package/skills/agent-forge/references/definition-fields.md +61 -0
  354. package/skills/agent-forge/references/examples.md +105 -0
  355. package/skills/agent-forge/references/instructions.md +51 -0
  356. package/skills/agent-forge/references/review-and-export.md +84 -0
@@ -27,45 +27,64 @@ function px(value) {
27
27
  return `${Math.max(0, Math.round(Number(value) || 0))}px`;
28
28
  }
29
29
 
30
- function setVarPair(primary, legacy, value) {
31
- const rootStyle = document.documentElement.style;
32
- rootStyle.setProperty(primary, value);
33
- rootStyle.setProperty(legacy, value);
34
- }
35
-
36
30
  function ownerCssVar(owner) {
37
31
  return String(owner || '').replace(/[^a-zA-Z0-9_-]/g, '_');
38
32
  }
39
33
 
40
- function clearAllOffsetVars() {
41
- const rootStyle = document.documentElement.style;
42
- for (let i = rootStyle.length - 1; i >= 0; i--) {
43
- const name = rootStyle[i];
44
- if (name && name.startsWith(OFFSET_VAR_PREFIX)) rootStyle.removeProperty(name);
45
- }
46
- }
47
-
48
- function applyStackedReservation() {
49
- const rootStyle = document.documentElement.style;
34
+ /**
35
+ * The variables <html> must carry for these reservations (insertion order = stack order), by name.
36
+ * Pure: `applyStackedReservation` writes the difference between this and what <html> has.
37
+ */
38
+ export function stackedReservationVars(reservations) {
39
+ const vars = new Map();
50
40
  let totalWidth = 0;
51
41
  let maxGap = 0;
52
-
53
- for (const entry of _reservations.values()) {
42
+ for (const entry of reservations.values()) {
54
43
  totalWidth += entry.reservedWidth || 0;
55
44
  if ((entry.gap || 0) > maxGap) maxGap = entry.gap || 0;
56
45
  }
57
-
58
- setVarPair(RESERVED_WIDTH_VAR, LEGACY_WIDTH_VAR, px(totalWidth));
59
- setVarPair(RESERVED_GAP_VAR, LEGACY_GAP_VAR, px(maxGap));
60
-
46
+ vars.set(RESERVED_WIDTH_VAR, px(totalWidth));
47
+ vars.set(LEGACY_WIDTH_VAR, px(totalWidth));
48
+ vars.set(RESERVED_GAP_VAR, px(maxGap));
49
+ vars.set(LEGACY_GAP_VAR, px(maxGap));
61
50
  // Per-owner offset = sum of widths of panels to its RIGHT
62
51
  // (= panels inserted BEFORE this one in the Map).
63
- clearAllOffsetVars();
64
52
  let offset = 0;
65
- for (const [owner, entry] of _reservations) {
66
- rootStyle.setProperty(`${OFFSET_VAR_PREFIX}${ownerCssVar(owner)}`, px(offset));
53
+ for (const [owner, entry] of reservations) {
54
+ vars.set(`${OFFSET_VAR_PREFIX}${ownerCssVar(owner)}`, px(offset));
67
55
  offset += entry.reservedWidth || 0;
68
56
  }
57
+ return vars;
58
+ }
59
+
60
+ /**
61
+ * Bring an inline style in line with `vars`: write only what differs, remove only the offset variables
62
+ * that are no longer wanted. Returns how many declarations it touched.
63
+ *
64
+ * A custom property written on <html> restyles every element of the page, and a layout read after it
65
+ * (the next panel's measurement, a window clamp) pays for that at once. The reservation is asked for
66
+ * again and again with nothing new (every panel on every window resize, twice per panel show or hide):
67
+ * taking the offsets out and putting the same ones back made each of those a whole-page restyle.
68
+ */
69
+ export function syncReservationVars(style, vars) {
70
+ let touched = 0;
71
+ for (let i = style.length - 1; i >= 0; i--) {
72
+ const name = style[i];
73
+ if (name && name.startsWith(OFFSET_VAR_PREFIX) && !vars.has(name)) {
74
+ style.removeProperty(name);
75
+ touched += 1;
76
+ }
77
+ }
78
+ for (const [name, value] of vars) {
79
+ if (style.getPropertyValue(name).trim() === value) continue;
80
+ style.setProperty(name, value);
81
+ touched += 1;
82
+ }
83
+ return touched;
84
+ }
85
+
86
+ function applyStackedReservation() {
87
+ syncReservationVars(document.documentElement.style, stackedReservationVars(_reservations));
69
88
  }
70
89
 
71
90
  export function measureRightPanelReservation(panel, outerGap = 20) {
@@ -2,10 +2,29 @@ import { hostedSidepanelId, sidepanelHost } from './ui-sidepanel-runtime.js';
2
2
  import { emit } from './state.js';
3
3
  import { sessionWindowStatus } from './sidepanel-session-status.js';
4
4
 
5
+ export function observeSessionWindowStatus(tray, reportStatus) {
6
+ let sentStatus = '';
7
+ const syncStatus = () => {
8
+ const pills = Array.from(tray?.querySelectorAll('.term-minimized-pill') || [], (pill) => ({
9
+ classes: pill.classList,
10
+ status: pill.dataset.status,
11
+ badgeStatus: pill.querySelector('.cli-status-badge')?.dataset.status,
12
+ }));
13
+ const status = sessionWindowStatus(pills);
14
+ if (status === sentStatus) return;
15
+ sentStatus = status;
16
+ reportStatus(status);
17
+ };
18
+ if (tray) new MutationObserver(syncStatus).observe(tray, {
19
+ childList: true, subtree: true, attributes: true, attributeFilter: ['class', 'data-status'],
20
+ });
21
+ syncStatus();
22
+ }
23
+
5
24
  const host = sidepanelHost();
6
- const provider = new URLSearchParams(location.search).get('provider');
7
25
  if (hostedSidepanelId && host) {
8
26
  try {
27
+ const provider = new URLSearchParams(location.search).get('provider');
9
28
  let receivePath, end, defaults;
10
29
  if (provider === 'claude') {
11
30
  const panel = await import('./ui-claude-panel.js');
@@ -49,15 +68,9 @@ if (hostedSidepanelId && host) {
49
68
  // What its sessions do, for this window's pill in the main window: read from this document's own tray
50
69
  // pills, which the panel paints from its sessions' state, and sent when it changes.
51
70
  const tray = document.getElementById('term-minimized-tray');
52
- let sentStatus = '';
53
- const syncStatus = () => {
54
- const status = sessionWindowStatus([...(tray?.querySelectorAll('.term-minimized-pill') || [])].map((pill) => [...pill.classList]));
55
- if (status === sentStatus) return;
56
- sentStatus = status;
71
+ observeSessionWindowStatus(tray, (status) => {
57
72
  host.status?.(hostedSidepanelId, status);
58
- };
59
- if (tray) new MutationObserver(syncStatus).observe(tray, { childList: true, subtree: true, attributes: true, attributeFilter: ['class'] });
60
- syncStatus();
73
+ });
61
74
  host.ready(hostedSidepanelId, { focus, defaults, end, receive(kind, data) {
62
75
  if (kind === 'path') return receivePath(data);
63
76
  emit(kind === 'image' ? 'wb:send-to-panel' : kind, data);
@@ -154,7 +154,9 @@ async function end(entry) {
154
154
  // A restored, unopened window may still own a server-side turn.
155
155
  const raw = storage.getItem(`synabun-${entry.provider}-panel-tabs-${entry.id}`);
156
156
  const sessions = entry.provider === 'opencode'
157
- ? JSON.parse(storage.getItem(`opencode-v2-tabs-${entry.id}`) || '[]').map(sessionId => ({ sessionId }))
157
+ ? JSON.parse(storage.getItem(`opencode-v2-tabs-${entry.id}`) || '[]')
158
+ .map(tab => typeof tab === 'string' ? { sessionId: tab } : tab)
159
+ .filter(tab => typeof tab?.sessionId === 'string' && tab.sessionId)
158
160
  : JSON.parse(raw || '{"tabs":[]}').tabs;
159
161
  for (const session of sessions) {
160
162
  await fetch('/api/sidepanel/kill-session', { method: 'POST', headers: { 'Content-Type': 'application/json' },
@@ -221,7 +223,13 @@ export function initDetachedAgentSessions() {
221
223
  if (entry.title === next) return;
222
224
  entry.title = next; if (entry.label) entry.label.textContent = next; renderPill(entry); save();
223
225
  },
224
- fail: (id, error) => { const entry = entries.get(id); if (entry) showError(entry, error); },
226
+ fail(id, error) {
227
+ const entry = entries.get(id);
228
+ if (!entry) return;
229
+ showError(entry, error);
230
+ entry.status = 'idle';
231
+ renderPill(entry);
232
+ },
225
233
  // What the window's sessions do, sent by the window when it changes (sidepanel-session-status.js).
226
234
  status(id, status) {
227
235
  const entry = entries.get(id);
@@ -1,14 +1,13 @@
1
1
  // SynaBun sidepanel tray placeholders.
2
2
  // Renders minimized pills for persisted sidepanel tabs before a panel is booted.
3
- // A tab saved while it was working may still be working (its turn outlives the
4
- // page on the server): its provider's panel boots then, hidden, and asks, and
5
- // its own pills (its styles, the sessions' real state) take the placeholders'
6
- // places. Panels whose saved tabs were all idle stay lazy.
3
+ // A turn or prompt can outlive the page on the server. A provider can boot
4
+ // hidden to check and replace its placeholders with live pills. Panels whose
5
+ // saved tabs were all idle stay lazy.
7
6
 
8
7
  import { storage } from './storage.js';
9
8
  import { emit } from './state.js';
10
9
  import { getProviderMeta } from './provider-icons.js';
11
- import { toggleClaudePanel, isClaudePanelOpen, bootClaudePanel } from './ui-claude-panel.js';
10
+ import { toggleClaudePanel, isClaudePanelOpen, bootClaudePanel } from './claude-panel-lazy.js';
12
11
  import { toggleCodexPanel, isCodexPanelOpen, bootCodexPanel } from './ui-codex-panel.js';
13
12
  import { toggleOpencodePanel, isOpencodePanelOpen, bootOpencodePanel } from './ui-opencode-panel-v2.js';
14
13
  import { toggleAntigravityPanel, isAntigravityPanelOpen, bootAntigravityPanel } from './ui-antigravity-panel.js';
@@ -39,8 +38,8 @@ const PROVIDERS = {
39
38
  opencode: {
40
39
  providerId: 'opencode',
41
40
  windowKey: 'ocp-window-id',
42
- // OCP v2 stores a plain string[] of session IDs, now scoped per window so
43
- // a claimed automation cannot become an editable tab in another window.
41
+ // OCP v2 scopes the tab list per window so a claimed automation cannot
42
+ // become an editable tab in another window.
44
43
  tabsKeyPrefix: 'opencode-v2-tabs',
45
44
  automationKeyPrefix: 'opencode-v2-automations',
46
45
  v2Plain: true,
@@ -49,9 +48,8 @@ const PROVIDERS = {
49
48
  busyKeyPrefix: 'opencode-v2-busy',
50
49
  legacyV1Prefix: 'synabun-ocp-tabs',
51
50
  legacyV1CleanupFlag: 'opencode-v1-cleanup-done',
52
- // The v2 panel's own pill (the v1 panel and its ocp-session-pill styles are gone), so a
53
- // working placeholder wears ocpv2-pill-running like the real one.
54
51
  pillClass: 'ocpv2-session-pill',
52
+ attentionClass: 'ocpv2-pill-waiting',
55
53
  eventName: 'opencode-panel:show',
56
54
  },
57
55
  antigravity: {
@@ -160,7 +158,7 @@ function hasCodexState(tab) {
160
158
  }
161
159
 
162
160
  function hasOpenCodeState(tab) {
163
- // v2 plain payload only carries sessionId — that's enough to be meaningful.
161
+ // A saved session ID is enough for a placeholder.
164
162
  if (tab.sessionId) return true;
165
163
  const label = normalizeLabel(tab.sessionTitle);
166
164
  const draft = normalizeLabel(tab.draft);
@@ -228,10 +226,9 @@ function isRunning(tab) {
228
226
  return !!(tab.running || tab.startingThread || Number(tab.backgroundWork) > 0);
229
227
  }
230
228
 
231
- // Waiting on the user when it was saved (Claude, Codex: `needsYou`): its placeholder says so before it says
232
- // working, and the panel boots to ask, as for a working tab (the reattach brings the card back).
229
+ // A saved prompt takes precedence over a running turn. Reattaching the panel can recover the prompt.
233
230
  function needsYou(tab) {
234
- return tab.needsYou === true;
231
+ return tab?.needsYou === true;
235
232
  }
236
233
 
237
234
  function isForeignActiveAutomation(tab) {
@@ -255,21 +252,25 @@ function readPayload(key, meta = null) {
255
252
  ? parseJson(storage.getItem(`${meta.busyKeyPrefix}-${windowId}`), [])
256
253
  : [];
257
254
  const busy = new Set(Array.isArray(busyRows) ? busyRows : []);
258
- const tabs = arr
259
- .filter((s) => typeof s === 'string' && s)
260
- .map((sid) => {
261
- const automation = automationBySession.get(sid);
262
- return {
263
- sessionId: sid,
264
- automationRunId: automation?.runId || null,
265
- automationActive: !!automation?.running,
266
- automationOwnerId: automation?.ownerId || null,
267
- // An automation's pill follows its turn: a warm worker saved between turns ('idle') rests.
268
- running: (!!automation?.running && automation.turn !== 'idle') || busy.has(sid),
269
- };
270
- });
271
- if (!tabs.length) return null;
272
- return { key, activeIdx: 0, tabs, v2Plain: true };
255
+ const savedTabs = arr.filter((tab) => {
256
+ const id = typeof tab === 'string' ? tab : tab?.sessionId;
257
+ return typeof id === 'string' && id.length > 0;
258
+ });
259
+ if (!savedTabs.length) return null;
260
+ const tabs = savedTabs.map((tab) => {
261
+ const sid = typeof tab === 'string' ? tab : tab.sessionId;
262
+ const automation = automationBySession.get(sid);
263
+ return {
264
+ sessionId: sid,
265
+ needsYou: needsYou(tab),
266
+ automationRunId: automation?.runId || null,
267
+ automationActive: !!automation?.running,
268
+ automationOwnerId: automation?.ownerId || null,
269
+ // An automation's pill follows its turn: a warm worker saved between turns ('idle') rests.
270
+ running: (!!automation?.running && automation.turn !== 'idle') || busy.has(sid),
271
+ };
272
+ });
273
+ return { key, activeIdx: 0, tabs, savedTabs, v2Plain: true };
273
274
  }
274
275
  return null;
275
276
  }
@@ -295,8 +296,7 @@ function providerPayloads(provider) {
295
296
  const predicate = statePredicate(provider);
296
297
 
297
298
  if (meta.v2Plain) {
298
- // OCP v2: single global key. Wipe legacy v1 per-window entries once so they
299
- // can never resurface as phantom placeholder pills next to the real ones.
299
+ // Wipe legacy v1 entries once so they can't resurface next to the real pills.
300
300
  cleanupLegacyV1Once(meta);
301
301
  }
302
302
 
@@ -441,15 +441,10 @@ function writeProviderPayload(provider, payload, removeIndex) {
441
441
  }
442
442
 
443
443
  if (payload.v2Plain) {
444
- // v2 stores a plain string[] of session IDs, not a {tabs, activeIdx}
445
- // envelope. Rewrite in the same shape so the panel reads it cleanly when
446
- // it boots next.
447
- const ids = payload.tabs
448
- .filter((_, index) => index !== removeIndex)
449
- .map((t) => t.sessionId)
450
- .filter(Boolean);
451
- if (!ids.length) storage.removeItem(payload.key);
452
- else storage.setItem(payload.key, JSON.stringify(ids));
444
+ // Preserve saved tab records, including the waiting state of other sessions.
445
+ const remainingTabs = payload.savedTabs.filter((_, index) => index !== removeIndex);
446
+ if (!remainingTabs.length) storage.removeItem(payload.key);
447
+ else storage.setItem(payload.key, JSON.stringify(remainingTabs));
453
448
  const meta = PROVIDERS[provider];
454
449
  const windowId = windowIdFromKey(meta, payload.key);
455
450
  if (windowId && meta?.automationKeyPrefix) {
@@ -625,7 +620,7 @@ function createPlaceholder(provider, payload, tab, index) {
625
620
  /**
626
621
  * Whether a provider's panel should boot, hidden, to ask after its tabs: one of this window's own
627
622
  * saved tabs (the ones its restore brings back; never another window's, which a click migrates)
628
- * was working when it was saved. Pure: `pills` is meaningfulPills(), `currentKey` this window's key.
623
+ * was working or waiting when it was saved. `pills` is meaningfulPills(), `currentKey` this window's key.
629
624
  */
630
625
  export function placeholdersNeedBoot(pills, currentKey) {
631
626
  return (Array.isArray(pills) ? pills : [])
@@ -641,7 +636,7 @@ export function savedTabsStatus(provider, windowId) {
641
636
  const meta = PROVIDERS[provider];
642
637
  if (!meta || !windowId) return 'idle';
643
638
  const tabs = readPayload(`${meta.tabsKeyPrefix}-${windowId}`, meta)?.tabs || [];
644
- if (tabs.some((tab) => needsYou(tab))) return 'action';
639
+ if (tabs.some(needsYou)) return 'action';
645
640
  return tabs.some((tab) => isRunning(tab)) ? 'working' : 'idle';
646
641
  }
647
642
 
@@ -53,7 +53,20 @@ function injectStyles() {
53
53
  style.id = 'sidepanel-window-styles';
54
54
  style.textContent = `
55
55
  html .sp-sidepanel { z-index: var(--sp-window-layer, 11000) !important; }
56
- html .sp-sidepanel[data-sp-visible="false"] { visibility: hidden; pointer-events: none; }
56
+ /* A closed panel stays in the page with its transcripts (thousands of elements each). content-visibility
57
+ takes what is inside it out of style and layout as well as paint until it is shown again: every restyle
58
+ of the whole page (a variable on <html>, a class on <body>, each frame of a drag) used to walk all of
59
+ them, and a session streaming in a closed panel was laid out every frame. The panel's own box is sized by
60
+ its position and width, never by what it holds, so nothing moves; engines without the property keep
61
+ visibility: hidden alone.
62
+ Its glass goes with it: a panel nobody sees must not keep a blurred surface the size of the panel for
63
+ the compositor to carry (five panels, each 28px of blur over hundreds of thousands of pixels). The same
64
+ rule that hides it takes the filter, and showing it gives it back in the same frame, so the glass of a
65
+ panel on screen is what it always was, on every platform (Windows included: tests/windows-visuals.test.mjs). */
66
+ html .sp-sidepanel[data-sp-visible="false"] {
67
+ visibility: hidden; pointer-events: none; content-visibility: hidden;
68
+ backdrop-filter: none; -webkit-backdrop-filter: none;
69
+ }
57
70
  html .sp-sidepanel.sp-floating {
58
71
  right: auto; bottom: auto; min-width: 0; max-width: none; min-height: 0;
59
72
  transform: none !important; transition: opacity .15s ease;
@@ -2,10 +2,16 @@
2
2
  import { on } from './state.js';
3
3
  import { initI18n, isReady, t } from './i18n.js';
4
4
  import { isGuest, hasPermission, showGuestToast } from './ui-sync.js';
5
- import { createPanel } from './styleguide/sg-panel.js';
6
5
  import { centeredInFrame } from './app-frame.js';
6
+ import { registerLaunchPrefetch } from './launch-prefetch.js';
7
+ // The window (styleguide/, about twenty modules) loads when it is opened, or in idle time after the page is shown
8
+ // (a launch step), not before the first frame. Nothing in it runs at load: it only defines the window.
9
+ const loadPanel = () => import('./styleguide/sg-panel.js');
7
10
  let current = null, opening = false;
8
- export function initStyleGuide() { on('styleguide:open', options => openPanel(options)); }
11
+ export function initStyleGuide() {
12
+ on('styleguide:open', options => openPanel(options));
13
+ registerLaunchPrefetch('style-guide-module', () => loadPanel(), { order: 78 });
14
+ }
9
15
  async function openPanel(options = {}) {
10
16
  if (opening)
11
17
  return;
@@ -21,6 +27,8 @@ async function openPanel(options = {}) {
21
27
  showGuestToast(t('styleguide.permissionDenied'));
22
28
  return;
23
29
  }
30
+ // Before the backdrop: the backdrop and the window still appear together.
31
+ const { createPanel } = await loadPanel();
24
32
  const backdrop = document.createElement('div');
25
33
  backdrop.className = 'studio-backdrop open';
26
34
  document.body.append(backdrop);
@@ -142,6 +142,11 @@ const SYNC_HANDLERS = {
142
142
  // Skills Service (lib/skills/service.js): a skill, a revision, a review or an installation changed (owner only) —
143
143
  // the Studio reads its library again, Settings its chips, the Codex panel its skill hints
144
144
  'skills:changed': (msg) => emit('sync:skills:changed', msg),
145
+ // Agents (agents-p5): an agent definition changed (lib/agents/registry.js through server.js) or a team did (the
146
+ // team scheduler): Agents Studio reads its library, its Review queue and its teams again (ui-agents.js)
147
+ 'assistant:automation-records-changed': (msg) => emit('sync:assistant:automation-records-changed', msg),
148
+ 'assistant:agents-changed': (msg) => emit('sync:assistant:agents-changed', msg),
149
+ 'assistant:team-changed': (msg) => emit('sync:assistant:team-changed', msg),
145
150
 
146
151
  // WhatsApp Link — states and counters only (never a QR, code, number or text); Settings → WhatsApp re-reads /api/whatsapp/status
147
152
  'whatsapp:status': (msg) => emit('sync:whatsapp:status', msg),
@@ -19,6 +19,7 @@ import { frameRect, onFrameChange, clampBox, clampBoxLoose } from './app-frame.j
19
19
  import { notify, NOTIF_TYPE } from './ui-notifications.js';
20
20
  import { getProviderMeta } from './provider-icons.js';
21
21
  import { readinessKind, typeWhenReady } from './term-ready.js';
22
+ import { closeBrowserTabs } from './term-browser-tabs.js';
22
23
  import { initRendererManager, acquireRenderer, disposeRenderer, hasWebgl, noteFocus, adoptRenderer, rendererState, rendererStats } from './term-renderer.js';
23
24
  import { mountAssistant } from './assistant/asst-panel.js';
24
25
  import { getAssistantSession } from './assistant/asst-api.js';
@@ -1742,6 +1743,9 @@ function pickProject(profile) {
1742
1743
  // Cancel on outside click or Escape
1743
1744
  overlay.addEventListener('click', (e) => { if (e.target === overlay) { overlay.remove(); resolve(undefined); } });
1744
1745
  document.addEventListener('keydown', function onEsc(e) {
1746
+ // The picker closed some other way (a project picked, a click outside): this listener goes with it,
1747
+ // instead of one more staying on the document after every launch.
1748
+ if (!overlay.isConnected) { document.removeEventListener('keydown', onEsc); return; }
1745
1749
  if (e.key === 'Escape') { overlay.remove(); document.removeEventListener('keydown', onEsc); resolve(undefined); }
1746
1750
  });
1747
1751
 
@@ -2918,20 +2922,20 @@ async function openBrowserSession(url, fresh, _unused, force) {
2918
2922
 
2919
2923
  // fresh=true: close ALL existing browser sessions so MCP tools auto-select ours
2920
2924
  if (fresh) {
2925
+ // The server's sessions: a request that fails must not stop the fresh one from opening, and is said.
2926
+ const endedIds = [];
2921
2927
  try {
2922
2928
  const existing = await fetchBrowserSessions();
2923
2929
  const sessions = existing?.sessions || [];
2924
2930
  for (const s of sessions) {
2925
- await deleteBrowserSession(s.id).catch(() => {});
2931
+ await deleteBrowserSession(s.id).then(() => { endedIds.push(s.id); }, () => {});
2926
2932
  }
2927
- // Also close any existing browser tabs in the UI
2928
- if (!_streamOff) {
2929
- document.querySelectorAll('.term-tab[data-profile="browser"]').forEach(tab => {
2930
- const idx = Array.from(document.querySelectorAll('.term-tab')).indexOf(tab);
2931
- if (idx >= 0 && _sessions[idx]) closeTab(idx);
2932
- });
2933
- }
2934
- } catch (e) { /* ignore cleanup errors */ }
2933
+ } catch (e) {
2934
+ console.warn('[browser] could not end the old browser sessions:', e);
2935
+ }
2936
+ // Their tabs in the panel (term-browser-tabs.js). Outside the catch above on purpose: it once hid a call
2937
+ // to a function that did not exist, and the old tabs stayed for good.
2938
+ if (!_streamOff) closeBrowserTabs(_sessions, closeSession, { deletedIds: endedIds });
2935
2939
  }
2936
2940
 
2937
2941
  const startUrl = url || 'https://www.google.com';
@@ -6,6 +6,17 @@
6
6
  import { boundsForPoint, frameRect } from './app-frame.js';
7
7
  import { isWindowsPlatform } from './desktop-bridge.js';
8
8
 
9
+ /**
10
+ * Whether a scroll of `scroller` (a scroll event's target) can move `control`: the document's own scroll moves
11
+ * everything, an element's scroll moves what is inside it. Anything that is not an element counts as the page.
12
+ */
13
+ export function scrollCanMove(scroller, control) {
14
+ if (!control) return false;
15
+ if (!scroller || scroller.nodeType !== 1) return true;
16
+ if (scroller === control) return true;
17
+ try { return scroller.contains(control); } catch { return true; }
18
+ }
19
+
9
20
  /**
10
21
  * Initialize the tooltip system.
11
22
  * Creates a body-appended tooltip element and delegates
@@ -27,6 +38,7 @@ export function initTooltip() {
27
38
  let showTimer = null;
28
39
  let hideTimer = null;
29
40
  let currentTarget = null;
41
+ let pendingTarget = null; // the control whose tooltip is due (showTimer)
30
42
  let repositionRunHandler = null;
31
43
  let repositionEndHandler = null;
32
44
  let repositionRafId = 0;
@@ -227,6 +239,7 @@ export function initTooltip() {
227
239
  clearTimeout(showTimer);
228
240
  clearTimeout(hideTimer);
229
241
  showTimer = null;
242
+ pendingTarget = null;
230
243
  if (repositionRafId) {
231
244
  cancelAnimationFrame(repositionRafId);
232
245
  repositionRafId = 0;
@@ -253,12 +266,10 @@ export function initTooltip() {
253
266
  if (el === currentTarget) { clearTimeout(hideTimer); return; }
254
267
  clearTimeout(showTimer);
255
268
  clearTimeout(hideTimer);
256
- if (currentTarget) {
257
- hide();
258
- showTimer = setTimeout(() => show(el), 16);
259
- } else {
260
- showTimer = setTimeout(() => show(el), 20);
261
- }
269
+ const delay = currentTarget ? 16 : 20;
270
+ if (currentTarget) hide();
271
+ pendingTarget = el;
272
+ showTimer = setTimeout(() => { pendingTarget = null; show(el); }, delay);
262
273
  });
263
274
 
264
275
  document.addEventListener('mouseout', (e) => {
@@ -270,7 +281,17 @@ export function initTooltip() {
270
281
  hide();
271
282
  });
272
283
 
273
- document.addEventListener('scroll', hide, true);
284
+ // A scroll takes the tooltip away when it can move the control the tooltip is for: the page itself, or a
285
+ // scroller that holds the control. Any other scroller leaves the control where it is. Hiding on every scroll
286
+ // of the document meant that a transcript following a streaming session (one scroll per frame, in any open
287
+ // panel) cancelled each tooltip before its 20 ms delay ran out: a session pill hovered meanwhile showed its
288
+ // name late, in flashes or not at all. With nothing shown or due, there is nothing to do.
289
+ document.addEventListener('scroll', (e) => {
290
+ const target = currentTarget || pendingTarget;
291
+ if (!target) return;
292
+ if (!scrollCanMove(e.target, target)) return;
293
+ hide();
294
+ }, true);
274
295
  document.addEventListener('pointerdown', hide, true);
275
296
 
276
297
  // Keyboard focus shows the tooltip too, but only inside the Assistant
@@ -83,15 +83,37 @@ export function initToprightOverflow() {
83
83
  // The dock's dividers: the 2px margins and gaps they free are not counted above, so the row only gets narrower.
84
84
  tidyDividers();
85
85
  if (controls.classList.contains('has-overflow') !== hidden.length > 0) controls.classList.toggle('has-overflow', hidden.length > 0);
86
+ lastAmbient = ambientKey();
86
87
  if (!hidden.length && open) close();
87
88
  else if (open) render();
88
89
  };
89
90
 
91
+ // What a class or a style on <html> / <body> can change for the row: its band (max-width), its gaps, and
92
+ // which rules apply (the class lists). A pass puts every button back in the row, measures it and takes the
93
+ // overflowed ones out again: two layouts. <html> and <body> change all the time for other reasons (a
94
+ // variable written on each frame of a drag, the cursor and user-select of every drag, the same class set
95
+ // again), and none of that moves the row: when those were the only wake-ups and this key is what it was
96
+ // after the last pass, there is nothing to fit. A size change of the row or of a button always fits.
97
+ let lastAmbient = null;
98
+ const ambientKey = () => [
99
+ document.documentElement.className, document.body.className,
100
+ getComputedStyle(controls).maxWidth, getComputedStyle(controls).columnGap,
101
+ getComputedStyle(inner).columnGap, getComputedStyle(group).columnGap,
102
+ ].join('|');
103
+
90
104
  let frame = 0;
91
- const schedule = () => {
105
+ let ambientOnly = true; // every wake-up since the last pass was a class or a style of <html> / <body>
106
+ const schedule = (ambient) => {
107
+ if (ambient !== true) ambientOnly = false;
92
108
  if (frame) return;
93
- frame = requestAnimationFrame(() => { frame = 0; fit(); });
109
+ frame = requestAnimationFrame(() => {
110
+ frame = 0;
111
+ const nothingMoved = ambientOnly && lastAmbient !== null && ambientKey() === lastAmbient;
112
+ ambientOnly = true;
113
+ if (!nothingMoved) fit();
114
+ });
94
115
  };
116
+ const scheduleAmbient = () => schedule(true);
95
117
 
96
118
  const render = () => {
97
119
  menu.textContent = '';
@@ -192,8 +214,8 @@ export function initToprightOverflow() {
192
214
  ro.observe(controls);
193
215
  for (const e of entries) ro.observe(e.item);
194
216
  ro.observe(inner.querySelector('#workspace-overlay') || inner);
195
- new MutationObserver(schedule).observe(document.documentElement, { attributes: true, attributeFilter: ['style', 'class'] });
196
- new MutationObserver(schedule).observe(document.body, { attributes: true, attributeFilter: ['style', 'class'] });
217
+ new MutationObserver(scheduleAmbient).observe(document.documentElement, { attributes: true, attributeFilter: ['style', 'class'] });
218
+ new MutationObserver(scheduleAmbient).observe(document.body, { attributes: true, attributeFilter: ['style', 'class'] });
197
219
  new MutationObserver(schedule).observe(controls, { attributes: true, attributeFilter: ['class'] });
198
220
  for (const e of entries) new MutationObserver(schedule).observe(e.item, { attributes: true, attributeFilter: ['style'] });
199
221
  const bg = $('static-bg');