synabun 2.3.0 → 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 (367) hide show
  1. package/CHANGELOG.md +38 -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 +1174 -47
  103. package/neural-interface/i18n/pt-BR.json +1174 -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-profiles.js +1 -1
  135. package/neural-interface/lib/browser-tool-policy.js +1 -1
  136. package/neural-interface/lib/claude-account-links.js +301 -0
  137. package/neural-interface/lib/claude-accounts.js +45 -20
  138. package/neural-interface/lib/claude-agent-bridge.js +142 -10
  139. package/neural-interface/lib/claude-model-catalog.js +6 -0
  140. package/neural-interface/lib/claude-panel-session.js +33 -0
  141. package/neural-interface/lib/cli-install-api.js +23 -0
  142. package/neural-interface/lib/codex-accounts.js +67 -24
  143. package/neural-interface/lib/coordination/README.md +384 -0
  144. package/neural-interface/lib/coordination/service.js +563 -0
  145. package/neural-interface/lib/coordination/store.js +1138 -0
  146. package/neural-interface/lib/db.js +22 -1
  147. package/neural-interface/lib/editor-completion-opencode.js +4 -3
  148. package/neural-interface/lib/effort-levels.js +10 -1
  149. package/neural-interface/lib/maritaca/opencode-proxy.js +7 -2
  150. package/neural-interface/lib/maritaca/opencode.js +35 -0
  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 +219 -7
  157. package/neural-interface/lib/native-loop-runtime.js +24 -1
  158. package/neural-interface/lib/opencode-build-preflight.js +116 -0
  159. package/neural-interface/lib/opencode-launch-error.js +13 -0
  160. package/neural-interface/lib/opencode-native-boundary.js +800 -84
  161. package/neural-interface/lib/opencode-serve-probe.js +426 -0
  162. package/neural-interface/lib/opencode-serve-records.js +14 -9
  163. package/neural-interface/lib/opencode-serve-scan.js +108 -0
  164. package/neural-interface/lib/page-session.js +1 -1
  165. package/neural-interface/lib/peer-identity.js +60 -21
  166. package/neural-interface/lib/process-identity.js +235 -7
  167. package/neural-interface/lib/request-gate.js +3 -0
  168. package/neural-interface/lib/screenshot-location.js +33 -0
  169. package/neural-interface/lib/skills/creation.js +1 -1
  170. package/neural-interface/lib/skills/known-bridge-digests.json +40 -0
  171. package/neural-interface/lib/studio-attention.js +56 -0
  172. package/neural-interface/lib/teams/README.md +382 -0
  173. package/neural-interface/lib/teams/api.js +287 -0
  174. package/neural-interface/lib/teams/brief.js +185 -0
  175. package/neural-interface/lib/teams/claims.js +315 -0
  176. package/neural-interface/lib/teams/git.js +293 -0
  177. package/neural-interface/lib/teams/index.js +122 -0
  178. package/neural-interface/lib/teams/integration.js +580 -0
  179. package/neural-interface/lib/teams/landing.js +184 -0
  180. package/neural-interface/lib/teams/recovery.js +256 -0
  181. package/neural-interface/lib/teams/scheduler.js +1474 -0
  182. package/neural-interface/lib/teams/schema.js +559 -0
  183. package/neural-interface/lib/teams/state.js +181 -0
  184. package/neural-interface/lib/teams/test-runner.js +86 -0
  185. package/neural-interface/lib/teams/test-sandbox.js +99 -0
  186. package/neural-interface/lib/teams/worktrees.js +757 -0
  187. package/neural-interface/lib/tool-permission-choices.js +226 -0
  188. package/neural-interface/lib/whatsapp/cards.js +24 -10
  189. package/neural-interface/lib/worker-confinement.js +206 -6
  190. package/neural-interface/lib/worker-mcp-channel.js +38 -1
  191. package/neural-interface/package-lock.json +4 -2
  192. package/neural-interface/package.json +3 -1
  193. package/neural-interface/public/extension-setup.html +107 -0
  194. package/neural-interface/public/index.html +52 -12
  195. package/neural-interface/public/shared/agent-runtime-options.js +3 -1
  196. package/neural-interface/public/shared/agents/studio/ax-agent-view.js +614 -0
  197. package/neural-interface/public/shared/agents/studio/ax-api.js +198 -0
  198. package/neural-interface/public/shared/agents/studio/ax-create-view.js +221 -0
  199. package/neural-interface/public/shared/agents/studio/ax-diff.js +143 -0
  200. package/neural-interface/public/shared/agents/studio/ax-editor-view.js +392 -0
  201. package/neural-interface/public/shared/agents/studio/ax-export-view.js +94 -0
  202. package/neural-interface/public/shared/agents/studio/ax-form.js +191 -0
  203. package/neural-interface/public/shared/agents/studio/ax-icons.js +87 -0
  204. package/neural-interface/public/shared/agents/studio/ax-library-view.js +158 -0
  205. package/neural-interface/public/shared/agents/studio/ax-library.js +162 -0
  206. package/neural-interface/public/shared/agents/studio/ax-main.js +712 -0
  207. package/neural-interface/public/shared/agents/studio/ax-native-export.js +35 -0
  208. package/neural-interface/public/shared/agents/studio/ax-options.js +198 -0
  209. package/neural-interface/public/shared/agents/studio/ax-review-view.js +175 -0
  210. package/neural-interface/public/shared/agents/studio/ax-revisions-view.js +189 -0
  211. package/neural-interface/public/shared/agents/studio/ax-runs-view.js +202 -0
  212. package/neural-interface/public/shared/agents/studio/ax-runs.js +82 -0
  213. package/neural-interface/public/shared/agents/studio/ax-teams-view.js +256 -0
  214. package/neural-interface/public/shared/agents/studio/ax-teams.js +200 -0
  215. package/neural-interface/public/shared/agents/studio/ax-templates.js +50 -0
  216. package/neural-interface/public/shared/agents/studio/ax-ui.js +194 -0
  217. package/neural-interface/public/shared/agents/studio/ax-views.js +170 -0
  218. package/neural-interface/public/shared/agy/agy-panel.js +142 -28
  219. package/neural-interface/public/shared/agy/agy-styles.js +25 -5
  220. package/neural-interface/public/shared/assistant/asst-account-menu.js +13 -13
  221. package/neural-interface/public/shared/assistant/asst-ask-styles.js +2 -3
  222. package/neural-interface/public/shared/assistant/asst-brain-picker.js +91 -9
  223. package/neural-interface/public/shared/assistant/asst-control.js +3 -0
  224. package/neural-interface/public/shared/assistant/asst-interaction-hold.js +99 -0
  225. package/neural-interface/public/shared/assistant/asst-limit-dismissals.js +111 -0
  226. package/neural-interface/public/shared/assistant/asst-limit-dock.js +37 -3
  227. package/neural-interface/public/shared/assistant/asst-limit-wait.js +30 -7
  228. package/neural-interface/public/shared/assistant/asst-panel.js +177 -30
  229. package/neural-interface/public/shared/assistant/asst-rack-styles.js +15 -8
  230. package/neural-interface/public/shared/assistant/asst-render.js +36 -6
  231. package/neural-interface/public/shared/assistant/asst-route.js +78 -12
  232. package/neural-interface/public/shared/assistant/asst-routes-editor.js +148 -70
  233. package/neural-interface/public/shared/assistant/asst-roving.js +17 -1
  234. package/neural-interface/public/shared/assistant/asst-scene-styles.js +7 -2
  235. package/neural-interface/public/shared/assistant/asst-scenes.js +12 -1
  236. package/neural-interface/public/shared/assistant/asst-sidepanel.js +12 -2
  237. package/neural-interface/public/shared/assistant/asst-state.js +66 -1
  238. package/neural-interface/public/shared/assistant/asst-styles.js +98 -44
  239. package/neural-interface/public/shared/assistant/route-identity.js +16 -0
  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 +33 -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/opencode-verify-view.js +175 -0
  279. package/neural-interface/public/shared/schedules-view.js +2 -2
  280. package/neural-interface/public/shared/session-project-items.js +11 -0
  281. package/neural-interface/public/shared/settings/settings-ai-browser.js +119 -0
  282. package/neural-interface/public/shared/settings/settings-browser-extension.js +446 -0
  283. package/neural-interface/public/shared/settings/settings-ia.js +4 -2
  284. package/neural-interface/public/shared/settings/settings-morelogin-cooldown.js +63 -0
  285. package/neural-interface/public/shared/settings/settings-tool-permissions.js +70 -0
  286. package/neural-interface/public/shared/sidepanel-lazy.js +40 -0
  287. package/neural-interface/public/shared/sidepanel-session-status.js +8 -14
  288. package/neural-interface/public/shared/sidepanel-shown.js +73 -0
  289. package/neural-interface/public/shared/storage.js +6 -1
  290. package/neural-interface/public/shared/studio-attention.js +83 -0
  291. package/neural-interface/public/shared/styles.css +713 -61
  292. package/neural-interface/public/shared/term-browser-tabs.js +34 -0
  293. package/neural-interface/public/shared/transcript-rows.js +334 -0
  294. package/neural-interface/public/shared/tray-auto-close.js +106 -0
  295. package/neural-interface/public/shared/ui-agents.js +97 -0
  296. package/neural-interface/public/shared/ui-antigravity-panel.js +16 -14
  297. package/neural-interface/public/shared/ui-automation-studio.js +3 -3
  298. package/neural-interface/public/shared/ui-claude-panel.js +162 -95
  299. package/neural-interface/public/shared/ui-code-copy.js +256 -0
  300. package/neural-interface/public/shared/ui-codex-panel.js +14 -10
  301. package/neural-interface/public/shared/ui-context-menu.js +1 -1
  302. package/neural-interface/public/shared/ui-file-explorer.js +2 -3
  303. package/neural-interface/public/shared/ui-games.js +1 -1
  304. package/neural-interface/public/shared/ui-loading.js +12 -1
  305. package/neural-interface/public/shared/ui-maritaca-panel.js +12 -11
  306. package/neural-interface/public/shared/ui-menubar.js +23 -0
  307. package/neural-interface/public/shared/ui-native-loop-router.js +1 -1
  308. package/neural-interface/public/shared/ui-navbar.js +15 -9
  309. package/neural-interface/public/shared/ui-opencode-panel-v2.js +13 -11
  310. package/neural-interface/public/shared/ui-opencode-verify.js +120 -0
  311. package/neural-interface/public/shared/ui-schedules-studio.js +3 -3
  312. package/neural-interface/public/shared/ui-scroll-follow.js +39 -0
  313. package/neural-interface/public/shared/ui-sessions.js +3 -3
  314. package/neural-interface/public/shared/ui-settings-entry.js +55 -0
  315. package/neural-interface/public/shared/ui-settings.js +372 -402
  316. package/neural-interface/public/shared/ui-sidepanel-layout.js +44 -25
  317. package/neural-interface/public/shared/ui-sidepanel-session-entry.js +22 -9
  318. package/neural-interface/public/shared/ui-sidepanel-sessions.js +10 -2
  319. package/neural-interface/public/shared/ui-sidepanel-tray.js +36 -41
  320. package/neural-interface/public/shared/ui-sidepanel-windows.js +14 -1
  321. package/neural-interface/public/shared/ui-styleguide.js +10 -2
  322. package/neural-interface/public/shared/ui-sync.js +5 -0
  323. package/neural-interface/public/shared/ui-terminal.js +13 -9
  324. package/neural-interface/public/shared/ui-tooltip.js +28 -7
  325. package/neural-interface/public/shared/ui-topright-overflow.js +26 -4
  326. package/neural-interface/public/shared/ui-tray-columns.js +375 -0
  327. package/neural-interface/public/shared/ui-whiteboard.js +51 -6
  328. package/neural-interface/public/shared/ui-worker-end.js +28 -1
  329. package/neural-interface/public/shared/ui-workspaces.js +13 -0
  330. package/neural-interface/public/shared/window-keys.js +71 -0
  331. package/neural-interface/public/variant/2d/main.js +2 -0
  332. package/neural-interface/public/variant/3d/app.js +620 -0
  333. package/neural-interface/public/variant/3d/boot-reveal.js +47 -0
  334. package/neural-interface/public/variant/3d/main.js +21 -544
  335. package/neural-interface/public/variant/3d/map-controls.js +4 -2
  336. package/neural-interface/public/vendor/fonts/fonts.css +508 -0
  337. package/neural-interface/public/vendor/fonts/inter-OFL.txt +93 -0
  338. package/neural-interface/public/vendor/fonts/inter-cyrillic-ext.woff2 +0 -0
  339. package/neural-interface/public/vendor/fonts/inter-cyrillic.woff2 +0 -0
  340. package/neural-interface/public/vendor/fonts/inter-greek-ext.woff2 +0 -0
  341. package/neural-interface/public/vendor/fonts/inter-greek.woff2 +0 -0
  342. package/neural-interface/public/vendor/fonts/inter-latin-ext.woff2 +0 -0
  343. package/neural-interface/public/vendor/fonts/inter-latin.woff2 +0 -0
  344. package/neural-interface/public/vendor/fonts/inter-vietnamese.woff2 +0 -0
  345. package/neural-interface/public/vendor/fonts/jetbrains-mono-OFL.txt +93 -0
  346. package/neural-interface/public/vendor/fonts/jetbrains-mono-cyrillic-ext.woff2 +0 -0
  347. package/neural-interface/public/vendor/fonts/jetbrains-mono-cyrillic.woff2 +0 -0
  348. package/neural-interface/public/vendor/fonts/jetbrains-mono-greek.woff2 +0 -0
  349. package/neural-interface/public/vendor/fonts/jetbrains-mono-latin-ext.woff2 +0 -0
  350. package/neural-interface/public/vendor/fonts/jetbrains-mono-latin.woff2 +0 -0
  351. package/neural-interface/public/vendor/fonts/jetbrains-mono-vietnamese.woff2 +0 -0
  352. package/neural-interface/public/vendor/fonts/manifest.json +142 -0
  353. package/neural-interface/public/vendor/fonts/space-grotesk-OFL.txt +93 -0
  354. package/neural-interface/public/vendor/fonts/space-grotesk-latin-ext.woff2 +0 -0
  355. package/neural-interface/public/vendor/fonts/space-grotesk-latin.woff2 +0 -0
  356. package/neural-interface/public/vendor/fonts/space-grotesk-vietnamese.woff2 +0 -0
  357. package/neural-interface/scripts/boot-graph.mjs +270 -0
  358. package/neural-interface/scripts/vendor-fonts.mjs +124 -0
  359. package/neural-interface/server.js +1164 -157
  360. package/npm-shrinkwrap.json +2 -2
  361. package/package.json +3 -1
  362. package/skills/agent-forge/SKILL.md +182 -0
  363. package/skills/agent-forge/evals/evals.json +56 -0
  364. package/skills/agent-forge/references/definition-fields.md +61 -0
  365. package/skills/agent-forge/references/examples.md +105 -0
  366. package/skills/agent-forge/references/instructions.md +51 -0
  367. package/skills/agent-forge/references/review-and-export.md +84 -0
@@ -0,0 +1,120 @@
1
+ // The "Connect your browser" page's DOM glue (public/extension-setup.html). What it shows is decided by es-view.js;
2
+ // this reads the server's setup status, renders, and does the page's few actions. The one-time token goes into
3
+ // #synabun-setup-ticket only while the extension's content script is on this page and the server waits for it, and is
4
+ // taken out again as soon as the setup moves on.
5
+ import { makeTranslator, pageLocale, revealKey, setupView, wantsTicket } from './es-view.js';
6
+
7
+ const $ = id => document.getElementById(id);
8
+ let t = key => key;
9
+ const tx = (key, params) => t(`browserExtension.setup.${key}`, params);
10
+ const API = '/api/browser/extension/setup';
11
+ let status = { state: 'idle' }, offeredAt = 0, tickets = 0, busy = false;
12
+
13
+ async function call(path, body) {
14
+ const res = await fetch(`${API}/${path}`, body === undefined ? { cache: 'no-store' }
15
+ : { method: 'POST', cache: 'no-store', headers: { 'Content-Type': 'application/json', 'X-SynaBun-UI': '1' }, body: JSON.stringify(body) });
16
+ const value = await res.json().catch(() => ({}));
17
+ if (!res.ok) throw Object.assign(new Error(value.error || res.statusText), { code: value.code });
18
+ return value;
19
+ }
20
+ const extensionSeen = () => document.documentElement.dataset.synabunExtension || '';
21
+ const pairAnswer = () => document.documentElement.dataset.synabunPair || '';
22
+ function clearTicket() { const node = $('synabun-setup-ticket'); delete node.dataset.token; delete node.dataset.bridgePort; }
23
+
24
+ // Text that changed only: the same words set again would be read out again by a screen reader on every poll.
25
+ const put = (node, text) => { if (node.textContent !== text) node.textContent = text; };
26
+ // The words that never change while the page is open.
27
+ function fixedText() {
28
+ put($('es-browser-label'), tx('browserLabel'));
29
+ put($('es-copy-url'), tx('copyAddress')); put($('es-copy-folder'), tx('copyFolder'));
30
+ put($('es-folder-label'), tx('folderLabel'));
31
+ put($('es-reveal'), tx(revealKey(navigator.userAgentData?.platform || navigator.platform || '')));
32
+ put($('es-alternatives-title'), tx('alternativesTitle')); put($('es-restart'), tx('restart'));
33
+ put($('es-back'), tx('backToApp')); put($('es-pin'), tx('pinTip'));
34
+ put($('es-full-title'), tx('fullTitle')); put($('es-full-help'), tx('fullHelp'));
35
+ put($('es-trouble-title'), tx('needHelp')); put($('es-trouble-help'), tx('helpText')); put($('es-policy-help'), tx('policyText'));
36
+ }
37
+ function render() {
38
+ const view = setupView(status, { extensionVersion: extensionSeen(), pairAnswer: pairAnswer() });
39
+ const main = $('es-setup');
40
+ main.dataset.state = view.state; main.dataset.layout = view.layout; main.setAttribute('aria-busy', 'false');
41
+ put($('es-title'), tx(view.title));
42
+ put($('es-lead'), tx(view.lead, { browser: view.browser }));
43
+ $('es-eyebrow').hidden = !view.eyebrow; put($('es-eyebrow'), view.eyebrow ? tx(view.eyebrow, { browser: view.browser }) : '');
44
+ const live = $('es-live'); put(live, tx(view.live, view.liveParams)); live.dataset.tone = view.tone;
45
+ $('es-status').dataset.tone = view.tone || 'idle';
46
+ put($('es-status-title'), tx(view.statusTitle));
47
+ $('es-help').hidden = !view.help; put($('es-help'), view.help ? tx(view.help) : '');
48
+ $('es-browser').hidden = !view.browser; put($('es-browser-name'), view.browser);
49
+ $('es-steps').hidden = !view.showSteps;
50
+ for (const step of view.steps) {
51
+ const id = { stepOpenTitle: 'open', stepDeveloperTitle: 'developer', stepLoadTitle: 'load', stepPairTitle: 'pair' }[step.title];
52
+ put($(`es-step-${id}-title`), tx(step.title));
53
+ put($(`es-step-${id}`), tx(step.key, { ...step.params, browser: view.browser }));
54
+ main.querySelector(`[data-step="${id}"]`).dataset.done = String(step.done);
55
+ }
56
+ put($('es-extensions-url'), view.extensionsUrl || '');
57
+ $('es-copy-url').hidden = !view.extensionsUrl;
58
+ put($('es-folder'), view.folder);
59
+ $('es-copy-folder').hidden = $('es-reveal').hidden = !view.folder;
60
+ $('es-alternatives').hidden = !view.showAlternatives;
61
+ const list = $('es-alternatives-list'), wanted = view.alternatives.map(b => `${b.id}:${b.name}`).join('|');
62
+ if (list.dataset.shown !== wanted) {
63
+ list.dataset.shown = wanted; list.replaceChildren();
64
+ for (const browser of view.alternatives) {
65
+ const button = document.createElement('button'); button.type = 'button'; button.className = 'es-button';
66
+ button.dataset.action = 'open-in'; button.dataset.browser = browser.id; button.textContent = tx('openIn', { browser: browser.name });
67
+ list.append(button);
68
+ }
69
+ }
70
+ $('es-reload').hidden = !view.reloadNeeded; put($('es-reload'), tx('reloadNeeded', { browser: view.browser }));
71
+ $('es-restart').hidden = !view.restart;
72
+ $('es-back').hidden = !view.back; $('es-pin').hidden = !view.pinTip;
73
+ // The row is hidden by the code that fills it (never found by a :has(), which every hidden toggle re-checks).
74
+ $('es-actions').hidden = !view.restart && !view.back;
75
+ if (!['waiting-for-extension', 'extension-found'].includes(view.state)) clearTicket();
76
+ }
77
+
78
+ async function poll() {
79
+ if (busy) return;
80
+ busy = true;
81
+ try {
82
+ status = await call('status');
83
+ if (wantsTicket(status, { extensionVersion: extensionSeen(), pairAnswer: pairAnswer(), offeredAt, tickets })) {
84
+ tickets++;
85
+ const ticket = await call('ticket', {});
86
+ delete document.documentElement.dataset.synabunPair;
87
+ const node = $('synabun-setup-ticket'); node.dataset.bridgePort = String(ticket.bridgePort); node.dataset.token = ticket.token;
88
+ offeredAt = Date.now();
89
+ }
90
+ } catch (error) { if (status.state !== 'connected') status = { ...status, state: 'error', code: error.code || '' }; }
91
+ finally { busy = false; render(); }
92
+ }
93
+
94
+ async function act(action, target) {
95
+ const note = $('es-copied');
96
+ try {
97
+ if (action === 'copy-url') { await navigator.clipboard.writeText(status.browser?.extensionsUrl || '').then(() => { note.textContent = tx('copiedAddress'); }, () => { note.textContent = tx('copyFailed'); }); }
98
+ else if (action === 'copy-folder') { await navigator.clipboard.writeText(status.folder || '').then(() => { note.textContent = tx('copiedFolder'); }, () => { note.textContent = tx('copyFailed'); }); }
99
+ else if (action === 'reveal') { const r = await call('reveal', {}); note.textContent = tx(r.ok === false ? 'revealFailed' : 'revealed'); }
100
+ else if (action === 'open-in') { status = await call('start', { browser: target.dataset.browser }); offeredAt = 0; tickets = 0; note.textContent = tx('openedIn', { browser: status.browser?.name || '' }); }
101
+ else if (action === 'restart') { status = await call('start', {}); offeredAt = 0; tickets = 0; note.textContent = ''; }
102
+ } catch (error) { note.textContent = error.message; }
103
+ render();
104
+ }
105
+
106
+ // The browser's language (pt → Português, else English), English behind it key by key.
107
+ {
108
+ const locale = pageLocale(navigator.languages?.length ? navigator.languages : [navigator.language]);
109
+ const load = name => fetch(`/i18n/${name}.json`).then(r => (r.ok ? r.json() : {})).catch(() => ({}));
110
+ const [english, active] = await Promise.all([load('en'), locale === 'en' ? null : load(locale)]);
111
+ t = makeTranslator(active || english, english);
112
+ document.documentElement.lang = locale;
113
+ }
114
+ document.title = tx('documentTitle');
115
+ fixedText();
116
+ document.addEventListener('click', event => { const target = event.target.closest('[data-action]'); if (target) void act(target.dataset.action, target); });
117
+ // The content script announces the extension and its answer on <html>: render (and offer a ticket) at once.
118
+ new MutationObserver(() => { render(); void poll(); }).observe(document.documentElement, { attributes: true, attributeFilter: ['data-synabun-extension', 'data-synabun-pair'] });
119
+ await poll();
120
+ setInterval(() => { void poll(); }, 1500);
@@ -0,0 +1,100 @@
1
+ // The "Connect your browser" page's decisions (public/extension-setup.html; docs/browser-extension-bridge.md →
2
+ // One-button setup). DOM-free and import-free: node --test loads it. The page (es-page.js) renders what this returns.
3
+ //
4
+ // Page states (data-state on <main>): the server's setup state (idle, waiting-for-extension, pairing, connected,
5
+ // unsupported, error), with one page-only refinement: `extension-found` while the server still waits but the
6
+ // extension's content script has announced itself on this page (it then gets the one-time token and pairs).
7
+
8
+ /** The server's setup states, and the page's own. */
9
+ export const SETUP_STATES = Object.freeze(['idle', 'waiting-for-extension', 'pairing', 'connected', 'unsupported', 'error']);
10
+ export const PAGE_STATES = Object.freeze([...SETUP_STATES, 'extension-found']);
11
+ /** What the extension's service worker may answer the content script (setup-content.js writes it to data-synabun-pair). */
12
+ export const PAIR_ANSWERS = Object.freeze(['sent', 'started', 'ALREADY_CONNECTED', 'ALREADY_PAIRED', 'PAUSED', 'BUSY', 'NOT_OWNED', 'INVALID_MESSAGE', 'REFUSED', 'EXTENSION_UNAVAILABLE']);
13
+ /** Error codes the page has a sentence for (browserExtension.setup.error<CODE>); any other is `error`. */
14
+ export const SETUP_ERRORS = Object.freeze(['SETUP_EXPIRED', 'EXTENSION_FOLDER_FAILED', 'OPEN_FAILED', 'SETUP_NOT_ACTIVE', 'SETUP_TICKETS_USED', 'PAGE_SECRET_REQUIRED', 'PEER_UNAVAILABLE']);
15
+ /** Answers after which the page asks for a fresh ticket (a new token) once its wait has passed. */
16
+ const RETRY_AFTER = Object.freeze({ ALREADY_PAIRED: 8000, BUSY: 2500, REFUSED: 5000, EXTENSION_UNAVAILABLE: 5000, started: 20000 });
17
+
18
+ /**
19
+ * The page's view of a status (GET /api/browser/extension/setup/status) and what the page saw of the extension:
20
+ * `extensionVersion` (data-synabun-extension, '' when absent) and `pairAnswer` (data-synabun-pair).
21
+ * Returns { state, title, lead, steps, browser, extensionsUrl, folder, alternatives, live, tone, reloadNeeded, retry }.
22
+ * Strings are i18n keys under browserExtension.setup (the page translates them); `params` fill their {placeholders}.
23
+ */
24
+ export function setupView(status = {}, { extensionVersion = '', pairAnswer = '' } = {}) {
25
+ const server = SETUP_STATES.includes(status.state) ? status.state : 'error';
26
+ const found = !!extensionVersion;
27
+ const state = server === 'waiting-for-extension' && found ? 'extension-found' : server;
28
+ const browser = status.browser || null;
29
+ const name = browser?.name || '';
30
+ const extensionsUrl = browser?.supported ? browser.extensionsUrl || null : null;
31
+ // The three steps no app may do for the owner, then the pairing SynaBun does.
32
+ const installed = found || ['pairing', 'connected'].includes(server);
33
+ // Developer mode sits in a different place per browser (docs/design/browser-extension → Browser-specific installation).
34
+ const developer = { edge: 'stepDeveloperEdge', opera: 'stepDeveloperOpera', arc: 'stepDeveloperOther', vivaldi: 'stepDeveloperOther' }[browser?.id] || 'stepDeveloper';
35
+ const steps = [
36
+ { key: 'stepOpen', title: 'stepOpenTitle', params: { url: extensionsUrl || '' }, done: installed },
37
+ { key: developer, title: 'stepDeveloperTitle', params: {}, done: installed },
38
+ { key: 'stepLoad', title: 'stepLoadTitle', params: {}, done: installed },
39
+ { key: 'stepPair', title: 'stepPairTitle', params: {}, done: server === 'connected' },
40
+ ];
41
+ // "Open in X instead": the installed supported browsers other than the one this setup uses.
42
+ const alternatives = (status.installedBrowsers || []).filter(b => b?.supported && b.id !== browser?.id).map(b => ({ id: b.id, name: b.name }));
43
+ const live = {
44
+ idle: 'liveIdle', 'waiting-for-extension': 'liveWaiting', 'extension-found': PAIR_ANSWERS.includes(pairAnswer) && pairAnswer !== 'sent' && pairAnswer !== 'started' ? `answer${pairAnswer}` : 'liveFound',
45
+ pairing: 'livePairing', connected: 'liveConnected', unsupported: 'liveUnsupported', error: `error${SETUP_ERRORS.includes(status.code) ? status.code : ''}`,
46
+ }[state];
47
+ const tone = state === 'connected' ? 'ok' : state === 'error' || state === 'unsupported' ? 'err' : state === 'idle' ? '' : 'warn';
48
+ const showSteps = !['unsupported', 'idle'].includes(state) && !(state === 'error' && !status.folder);
49
+ // The guide (the steps beside the status) while the owner installs; one result card once there is nothing to do there.
50
+ const layout = showSteps && state !== 'connected' ? 'guide' : 'result';
51
+ const statusTitle = { 'waiting-for-extension': 'waitingTitle', 'extension-found': 'foundTitle', pairing: 'pairingTitle', connected: 'titleConnected',
52
+ unsupported: 'titleUnsupported', idle: 'idleTitle', error: 'errorTitle' }[state];
53
+ return {
54
+ layout, statusTitle, eyebrow: name ? 'eyebrow' : '',
55
+ help: state === 'connected' ? 'connectedHelp' : '',
56
+ state, title: state === 'connected' ? 'titleConnected' : state === 'unsupported' ? 'titleUnsupported' : 'title',
57
+ lead: state === 'unsupported' ? 'leadUnsupported' : 'lead', steps, browser: name, extensionsUrl,
58
+ folder: typeof status.folder === 'string' ? status.folder : '', alternatives, live, liveParams: { browser: name }, tone,
59
+ reloadNeeded: status.reloadNeeded === true,
60
+ showSteps,
61
+ // What the page offers: start again (idle, error), back to SynaBun and the pin tip (connected).
62
+ restart: ['error', 'idle'].includes(state), back: state === 'connected', pinTip: state === 'connected',
63
+ // "Open in X instead" while there is still something to install here; never once pairing began.
64
+ showAlternatives: alternatives.length > 0 && !['pairing', 'connected'].includes(state),
65
+ };
66
+ }
67
+ /** The words for "show the folder" on this computer: Finder, Explorer or the file manager. */
68
+ export function revealKey(platform = '') {
69
+ const p = String(platform || '').toLowerCase();
70
+ return /mac|darwin|iphone|ipad/.test(p) ? 'showFolderMac' : /win/.test(p) ? 'showFolderWindows' : /linux|x11|cros|bsd/.test(p) ? 'showFolderLinux' : 'showFolder';
71
+ }
72
+ /**
73
+ * Whether the page should ask for a (new) ticket now: the server waits for the extension, the extension is on the
74
+ * page, and either no token was offered yet or the extension's answer calls for another try after its wait.
75
+ * `offeredAt`: when the current token was put on the page (0: never). `now`: the clock.
76
+ */
77
+ export function wantsTicket(status = {}, { extensionVersion = '', pairAnswer = '', offeredAt = 0, now = Date.now(), tickets = 0, maxTickets = 5 } = {}) {
78
+ if (status.state !== 'waiting-for-extension' || !extensionVersion || tickets >= maxTickets) return false;
79
+ if (!offeredAt) return true;
80
+ const wait = RETRY_AFTER[pairAnswer];
81
+ return wait !== undefined && now - offeredAt >= wait;
82
+ }
83
+
84
+ /**
85
+ * The page's translator: the active locale's strings with English behind them, key by key, `{name}` filled from
86
+ * params. The page loads the two JSON files itself (es-page.js), never the app's i18n module: that one brings the
87
+ * app's server-synced storage, which this page must not read or write.
88
+ */
89
+ export function pageLocale(languages = []) {
90
+ return (Array.isArray(languages) ? languages : [languages]).some(l => /^pt\b/i.test(String(l))) ? 'pt-BR' : 'en';
91
+ }
92
+ export function makeTranslator(messages = {}, fallback = {}) {
93
+ const find = (tree, key) => key.split('.').reduce((node, part) => (node && typeof node === 'object' ? node[part] : undefined), tree);
94
+ return (key, params) => {
95
+ let value = find(messages, key);
96
+ if (typeof value !== 'string') value = find(fallback, key);
97
+ if (typeof value !== 'string') return key;
98
+ return params ? value.replace(/\{(\w+)\}/g, (all, name) => (params[name] != null ? String(params[name]) : all)) : value;
99
+ };
100
+ }
@@ -90,6 +90,7 @@ export function getEditorPanelHTML() {
90
90
  export function getSharedHTML() {
91
91
  const variant = getVariant() || '3d';
92
92
  const is3D = variant === '3d';
93
+ const attentionDot = '<span class="menubar-attention-dot" aria-hidden="true" hidden></span>';
93
94
 
94
95
  return `
95
96
  <!-- App frame (styles.css APP FRAME): the card's interior under the graph, its border and gutter over the windows -->
@@ -409,7 +410,7 @@ ${is3D ? '' : `
409
410
  `}
410
411
  <!-- Skills menu -->
411
412
  <div class="menubar-item" data-menu="skills">
412
- <button class="menubar-label">${t('nav.skills')}</button>
413
+ <button class="menubar-label" data-studio-attention="skills">${t('nav.skills')}${attentionDot}</button>
413
414
  <div class="menubar-dropdown glass">
414
415
  <div class="menu-item" id="menu-open-skills-studio">
415
416
  <span class="menu-check"></span>
@@ -432,9 +433,34 @@ ${is3D ? '' : `
432
433
  </div>
433
434
  </div>
434
435
 
436
+ <!-- Agents menu (agents-p5: Agents Studio, public/shared/ui-agents.js) -->
437
+ <div class="menubar-item" data-menu="agents">
438
+ <button class="menubar-label" id="menubar-agents" data-studio-attention="agents">${t('nav.agents')}${attentionDot}</button>
439
+ <div class="menubar-dropdown glass">
440
+ <div class="menu-item" id="menu-open-agents-studio">
441
+ <span class="menu-check"></span>
442
+ <span class="menu-text"><span class="menu-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="5" y="8" width="14" height="11" rx="2.5"/><path d="M12 8V4"/><path d="M9.5 13v1.5"/><path d="M14.5 13v1.5"/><path d="M2.5 13v3"/><path d="M21.5 13v3"/></svg></span> ${t('menu.agents.studio')}</span>
443
+ <span class="menu-shortcut" data-keybind-for="open-agents"></span>
444
+ </div>
445
+ <div class="menu-item" id="menu-agents-new">
446
+ <span class="menu-check"></span>
447
+ <span class="menu-text"><span class="menu-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 5v14"/><path d="M5 12h14"/></svg></span> ${t('menu.agents.newAgent')}</span>
448
+ </div>
449
+ <div class="menu-sep"></div>
450
+ <div class="menu-item" id="menu-agents-review">
451
+ <span class="menu-check"></span>
452
+ <span class="menu-text"><span class="menu-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12l4 4 10-10"/></svg></span> ${t('menu.agents.reviewQueue')} <span class="count-badge count-badge--gold" id="menu-agents-review-count" hidden></span></span>
453
+ </div>
454
+ <div class="menu-item" id="menu-agents-teams">
455
+ <span class="menu-check"></span>
456
+ <span class="menu-text"><span class="menu-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="9" r="3"/><path d="M3.5 19a5.5 5.5 0 0 1 11 0"/><circle cx="17" cy="10" r="2.3"/><path d="M16 14.6a4.5 4.5 0 0 1 4.5 4.4"/></svg></span> ${t('menu.agents.teams')}</span>
457
+ </div>
458
+ </div>
459
+ </div>
460
+
435
461
  <!-- Automations menu -->
436
462
  <div class="menubar-item" data-menu="automations">
437
- <button class="menubar-label">${t('nav.automations')}</button>
463
+ <button class="menubar-label" data-studio-attention="automations">${t('nav.automations')}${attentionDot}</button>
438
464
  <div class="menubar-dropdown glass">
439
465
  <div class="menu-item" id="menu-open-automation-studio">
440
466
  <span class="menu-check"></span>
@@ -454,7 +480,7 @@ ${is3D ? '' : `
454
480
  </div>
455
481
 
456
482
  <!-- Schedules (opens and closes the Schedules window; no dropdown) -->
457
- <button type="button" class="menubar-label menubar-action" id="menubar-schedules-btn" aria-expanded="false" aria-controls="schedules-studio-panel">${t('nav.schedules')}</button>
483
+ <button type="button" class="menubar-label menubar-action" id="menubar-schedules-btn" aria-expanded="false" aria-controls="schedules-studio-panel" data-studio-attention="schedules">${t('nav.schedules')}${attentionDot}</button>
458
484
 
459
485
  <!-- Settings (text button) -->
460
486
  <button class="menubar-label menubar-action" id="menubar-settings-btn">${t('nav.settings')}</button>
@@ -503,7 +529,7 @@ ${is3D ? '' : `
503
529
  ⋯ (#topright-overflow-btn: what does not fit the band, ui-topright-overflow.js), the tools toggle
504
530
  (#topright-tools-btn, shows and hides the dock) and the agent side panels. Always one row, never wrapped.
505
531
  Snap to grid and Tile terminals are on the whiteboard rail (#wb-toolbar) and in View. The session pills
506
- (#term-minimized-tray) are a row under the bar, right-aligned with it (styles.css: "Fit"). -->
532
+ (#term-minimized-tray) are in status columns under the bar, right-aligned with it (styles.css: "Fit"). -->
507
533
  <div id="topright-controls">
508
534
  <div id="topright-inner">
509
535
  <div id="workspace-overlay">
@@ -605,6 +631,9 @@ ${is3D ? '' : `
605
631
  <button id="topright-maritaca-panel-btn" class="topright-icon-btn" data-tooltip="${t('maritacaPanel.toolbar')}">
606
632
  <svg viewBox="0 0 12.48 13.73" fill="currentColor"><path d="M10.11 11.01h1.9S7.21 5.97 5.72 4.4a.62.62 0 0 0-.93.04c-.48.59-.76 1.33-.81 2.1-.06 1.04.32 2.06 1.04 2.8l4.35 4.4h3.1l-2.37-2.72Z"/><path d="M5.69 11 4.52 9.82c-.86-.89-1.31-2.1-1.24-3.33s.67-2.38 1.62-3.16c.35.06.71-.02 1.01-.24-.07-.24-.16-.55-.22-.75-.02-.07.06-.13.12-.09l1.16.77c.3-.61.22-1.37-.26-1.9.1-.18.06-.44-.15-.57C6.07.26 5.36 0 4.41 0 2.76 0 0 1.5 0 5.18c0 2.12 1.36 4.57 3.86 5.47l-1.43 3.08h1.05L4.8 10.9c.29.05.58.09.89.1l-1.27 2.73h1.05l.94-2.01L5.7 11ZM4.84.67c.23 0 .42.19.42.42s-.19.42-.42.42-.42-.19-.42-.42.19-.42.42-.42"/></svg>
607
633
  </button>
634
+ <button id="topright-auto-close-btn" class="topright-icon-btn" type="button" aria-pressed="false" aria-label="${t('toolbar.trayAutoCloseOff')}" data-tooltip="${t('toolbar.trayAutoCloseOff')}">
635
+ <svg viewBox="0 0 24 24" aria-hidden="true" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="16" rx="2"/><path d="M3 8h18m-13 6 3 3 5-6"/></svg>
636
+ </button>
608
637
  </div>
609
638
  <div id="term-minimized-tray"></div>
610
639
  </div>
@@ -201,8 +201,21 @@ function detectLocale() {
201
201
  return choice === SYSTEM_LOCALE ? getSystemLocale() : choice;
202
202
  }
203
203
 
204
+ /**
205
+ * A request index.html started before any module loaded (window.__synPrefetch.early[url], a fetch() promise), taken
206
+ * once: a later load of the same file fetches it again. null when the page started none.
207
+ */
208
+ function takeEarlyFetch(url) {
209
+ const early = globalThis.__synPrefetch?.early;
210
+ const pending = early?.[url];
211
+ if (!pending) return null;
212
+ early[url] = null;
213
+ return pending;
214
+ }
215
+
204
216
  async function loadMessages(locale) {
205
- const resp = await fetch(LOCALE_FILES[locale] || `/i18n/${locale}.json`);
217
+ const url = LOCALE_FILES[locale] || `/i18n/${locale}.json`;
218
+ const resp = await (takeEarlyFetch(url) || fetch(url));
206
219
  if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
207
220
  return resp.json();
208
221
  }
@@ -0,0 +1,78 @@
1
+ // ═══════════════════════════════════════════
2
+ // SynaBun Neural Interface — work for when the page is idle, one job at a time
3
+ // ═══════════════════════════════════════════
4
+ // What nobody is looking at yet (the conversation of an Assistant tab that is not on screen) waits here
5
+ // instead of running in the page's start: each job gets an idle period of its own, so ten of them are ten
6
+ // short tasks between frames, never one long one. A job that is wanted sooner (its tab is shown) is taken out
7
+ // by the function `add()` returned and run by its owner.
8
+ //
9
+ // const queue = createIdleQueue();
10
+ // const cancel = queue.add(() => loadIt());
11
+ //
12
+ // DOM-free: the idle callback is injected (requestIdleCallback where there is one, a timer elsewhere: Safari).
13
+ // tests/idle-queue.test.mjs.
14
+
15
+ const DEFAULT_TIMEOUT_MS = 2500; // a busy page still gets to it
16
+ const FALLBACK_DELAY_MS = 200;
17
+
18
+ function defaultRequestIdle(fn, options) {
19
+ if (typeof globalThis.requestIdleCallback === 'function') return { idle: globalThis.requestIdleCallback(fn, options) };
20
+ return { timer: setTimeout(fn, FALLBACK_DELAY_MS) };
21
+ }
22
+
23
+ function defaultCancelIdle(handle) {
24
+ if (!handle) return;
25
+ if ('idle' in handle && typeof globalThis.cancelIdleCallback === 'function') globalThis.cancelIdleCallback(handle.idle);
26
+ if ('timer' in handle) clearTimeout(handle.timer);
27
+ }
28
+
29
+ export function createIdleQueue({
30
+ requestIdle = defaultRequestIdle,
31
+ cancelIdle = defaultCancelIdle,
32
+ timeout = DEFAULT_TIMEOUT_MS,
33
+ onError = (error) => { try { console.error('[idle-queue] a job failed', error); } catch { /* no console */ } },
34
+ } = {}) {
35
+ const jobs = [];
36
+ let handle = null;
37
+ let armed = false;
38
+
39
+ const arm = () => {
40
+ if (armed || !jobs.length) return;
41
+ armed = true;
42
+ handle = requestIdle(pump, { timeout });
43
+ };
44
+
45
+ function pump() {
46
+ armed = false;
47
+ handle = null;
48
+ const job = jobs.shift();
49
+ if (job) {
50
+ try { job(); } catch (error) { onError(error); }
51
+ }
52
+ arm(); // the next one in an idle period of its own
53
+ }
54
+
55
+ return {
56
+ /** Queue `job`. Returns a function that takes it out again (true when it was still waiting). */
57
+ add(job) {
58
+ if (typeof job !== 'function') throw new TypeError('createIdleQueue: a job is a function');
59
+ jobs.push(job);
60
+ arm();
61
+ return () => {
62
+ const at = jobs.indexOf(job);
63
+ if (at < 0) return false;
64
+ jobs.splice(at, 1);
65
+ if (!jobs.length && armed) { cancelIdle(handle); armed = false; handle = null; }
66
+ return true;
67
+ };
68
+ },
69
+ size: () => jobs.length,
70
+ };
71
+ }
72
+
73
+ /** The page's one queue: every module that defers start-up work shares it, so their jobs take turns. */
74
+ let shared = null;
75
+ export function idleQueue() {
76
+ if (!shared) shared = createIdleQueue();
77
+ return shared;
78
+ }
@@ -0,0 +1,227 @@
1
+ // SynaBun — the interface config (scale, glass, font scale, accent, Focus Mode) and the skin stylesheet.
2
+ //
3
+ // Moved out of ui-settings.js unchanged: the boot applies both before the Settings window exists (its module, about
4
+ // 2 MB with what it imports, loads on first open or in idle time: ui-settings-entry.js). ui-settings.js imports and
5
+ // re-exports them. A skin changed in another window is applied here at once; the open Settings window refreshes its
6
+ // Skins tab through setSkinsTabRefresher.
7
+
8
+ import { storage } from './storage.js';
9
+ import { state, emit, on } from './state.js';
10
+ import { KEYS } from './constants.js';
11
+ import { normalizeViewConfig } from './view-variant.js';
12
+ import { setStaticBgVisible } from './static-bg-state.js';
13
+
14
+ // Optional legacy view preferences must never reintroduce a 2D selection.
15
+ export const IFACE_DEFAULTS = {
16
+ visualizationEnabled: true,
17
+ scale: 1,
18
+ glassOpacity: 0.72,
19
+ // 16 keeps the glass look at a fraction of the compositing cost — users can
20
+ // still crank the slider to 80 to explicitly opt back into heavier blur
21
+ glassBlur: 16,
22
+ glassSaturate: 1.4,
23
+ glassBorderOpacity: 0.06,
24
+ glassShadowOpacity: 0.4,
25
+ glassShadowSpread: 20,
26
+ glassRadius: 14,
27
+ fontScale: 1,
28
+ accentHue: 0,
29
+ accentSaturation: 0,
30
+ accentLightness: 80,
31
+ };
32
+
33
+ export function loadIfaceConfig() {
34
+ try {
35
+ const raw = storage.getItem('neural-interface-config');
36
+ if (raw) return { ...IFACE_DEFAULTS, ...normalizeViewConfig(JSON.parse(raw)) };
37
+ // Migrate legacy ui-scale if present
38
+ const legacyScale = storage.getItem('neural-ui-scale');
39
+ if (legacyScale) {
40
+ const cfg = { ...IFACE_DEFAULTS, scale: parseFloat(legacyScale) || 1 };
41
+ saveIfaceConfig(cfg);
42
+ return cfg;
43
+ }
44
+ return { ...IFACE_DEFAULTS };
45
+ } catch { return { ...IFACE_DEFAULTS }; }
46
+ }
47
+
48
+ export function saveIfaceConfig(cfg) {
49
+ storage.setItem('neural-interface-config', JSON.stringify(normalizeViewConfig(cfg)));
50
+ // Keep legacy key in sync for backwards compat
51
+ storage.setItem('neural-ui-scale', cfg.scale);
52
+ }
53
+
54
+ export function applyIfaceConfig(cfg, { instant = false } = {}) {
55
+ const r = document.documentElement.style;
56
+ r.setProperty('--ui-scale', cfg.scale);
57
+ r.setProperty('--glass-opacity', cfg.glassOpacity);
58
+ r.setProperty('--glass-blur', cfg.glassBlur);
59
+ r.setProperty('--glass-saturate', cfg.glassSaturate);
60
+ r.setProperty('--glass-border-opacity', cfg.glassBorderOpacity);
61
+ r.setProperty('--glass-shadow-opacity', cfg.glassShadowOpacity);
62
+ r.setProperty('--glass-shadow-spread', cfg.glassShadowSpread);
63
+ r.setProperty('--glass-radius', cfg.glassRadius);
64
+ r.setProperty('--font-scale', cfg.fontScale);
65
+ r.setProperty('--accent-hue', cfg.accentHue);
66
+ r.setProperty('--accent-saturation', cfg.accentSaturation + '%');
67
+ r.setProperty('--accent-lightness', cfg.accentLightness + '%');
68
+
69
+ // Focus Mode — scale+blur transition with staggered controls
70
+ const vizEnabled = cfg.visualizationEnabled !== false;
71
+ const graphContainer = document.getElementById('graph-container');
72
+ const staticBg = document.getElementById('static-bg');
73
+
74
+ if (!vizEnabled) {
75
+ // ENTERING FOCUS MODE
76
+
77
+ // ── Clean up all interactive state ──
78
+ // Hide 3D tooltip + detach its mousemove listener
79
+ const $tooltip = document.getElementById('tooltip');
80
+ if ($tooltip) {
81
+ $tooltip.classList.remove('visible');
82
+ if ($tooltip._moveHandler) {
83
+ document.removeEventListener('mousemove', $tooltip._moveHandler);
84
+ $tooltip._moveHandler = null;
85
+ }
86
+ }
87
+ // Hide data-tooltip tooltips
88
+ const uiTip = document.querySelector('.ui-tooltip');
89
+ if (uiTip) {
90
+ uiTip.classList.remove('visible');
91
+ uiTip.style.display = 'none';
92
+ }
93
+ // Clear hover state
94
+ state.hoveredNodeId = null;
95
+ // Clear multi-select
96
+ if (state.multiSelected.size > 0) {
97
+ state.multiSelected.clear();
98
+ const bar = document.getElementById('multi-select-bar');
99
+ if (bar) bar.classList.remove('open');
100
+ emit('multiselect:cleared');
101
+ }
102
+ // Reset cursor
103
+ document.body.style.cursor = 'default';
104
+
105
+ // Hide controls, 2D canvases, category sidebar
106
+ for (const id of ['controls-panel', 'stats-bar', 'category-sidebar']) {
107
+ const el = document.getElementById(id);
108
+ if (el) el.classList.add('viz-hidden');
109
+ }
110
+ for (const id of ['bg-canvas', 'hull-canvas', 'lasso-canvas']) {
111
+ const el = document.getElementById(id);
112
+ if (el) el.classList.add('viz-hidden-2d');
113
+ }
114
+ if (instant) {
115
+ // Page load — apply immediately without animation
116
+ if (graphContainer) graphContainer.classList.add('focus-active');
117
+ setStaticBgVisible(staticBg, true);
118
+ } else {
119
+ // User toggle — stagger: controls fade first, then iris closes
120
+ setTimeout(() => {
121
+ if (graphContainer) graphContainer.classList.add('focus-active');
122
+ setStaticBgVisible(staticBg, true);
123
+ }, 100);
124
+ }
125
+ // Notify variant-specific cleanup (lasso, context menu, etc.)
126
+ emit('focus:enter');
127
+ } else {
128
+ // EXITING FOCUS MODE
129
+ // Iris open the graph + close focus bg
130
+ if (graphContainer) graphContainer.classList.remove('focus-active');
131
+ setStaticBgVisible(staticBg, false);
132
+ // 2D canvases
133
+ for (const id of ['bg-canvas', 'hull-canvas', 'lasso-canvas']) {
134
+ const el = document.getElementById(id);
135
+ if (el) el.classList.remove('viz-hidden-2d');
136
+ }
137
+ if (instant) {
138
+ // Page load — show controls immediately
139
+ for (const id of ['controls-panel', 'stats-bar', 'category-sidebar']) {
140
+ const el = document.getElementById(id);
141
+ if (el) el.classList.remove('viz-hidden');
142
+ }
143
+ } else {
144
+ // User toggle — delay controls until iris starts opening
145
+ setTimeout(() => {
146
+ for (const id of ['controls-panel', 'stats-bar', 'category-sidebar']) {
147
+ const el = document.getElementById(id);
148
+ if (el) el.classList.remove('viz-hidden');
149
+ }
150
+ }, 200);
151
+ }
152
+ emit('focus:exit');
153
+ }
154
+ // Notify variants to pause/resume rendering
155
+ emit('viz:toggle', vizEnabled);
156
+ }
157
+
158
+ /** Call on page load to restore saved interface config */
159
+ export function restoreInterfaceConfig() {
160
+ // Suppress transitions during initial load to prevent flash
161
+ document.documentElement.classList.add('no-transition');
162
+ applyIfaceConfig(loadIfaceConfig(), { instant: true });
163
+ // Re-enable transitions after a frame
164
+ requestAnimationFrame(() => {
165
+ requestAnimationFrame(() => {
166
+ document.documentElement.classList.remove('no-transition');
167
+ });
168
+ });
169
+ }
170
+
171
+ // ═══════════════════════════════════════════
172
+ // SKIN LOADING — stylesheet injection + boot restore
173
+ // ═══════════════════════════════════════════
174
+
175
+ export const SKIN_LINK_ID = 'synabun-skin-css';
176
+
177
+ /** Insert or update the skin stylesheet <link> */
178
+ export function loadSkinStylesheet(skinId) {
179
+ if (!skinId || skinId === 'default') {
180
+ removeSkinStylesheet();
181
+ return;
182
+ }
183
+ let link = document.getElementById(SKIN_LINK_ID);
184
+ if (!link) {
185
+ link = document.createElement('link');
186
+ link.id = SKIN_LINK_ID;
187
+ link.rel = 'stylesheet';
188
+ // Insert after the main styles.css
189
+ const mainCSS = document.querySelector('link[href*="styles.css"]');
190
+ if (mainCSS && mainCSS.nextSibling) {
191
+ mainCSS.parentNode.insertBefore(link, mainCSS.nextSibling);
192
+ } else {
193
+ document.head.appendChild(link);
194
+ }
195
+ }
196
+ link.href = `/skins/${skinId}/skin.css`;
197
+ storage.setItem(KEYS.ACTIVE_SKIN, skinId);
198
+ }
199
+
200
+ /** Remove the skin stylesheet */
201
+ export function removeSkinStylesheet() {
202
+ const link = document.getElementById(SKIN_LINK_ID);
203
+ if (link) link.remove();
204
+ storage.setItem(KEYS.ACTIVE_SKIN, 'default');
205
+ }
206
+
207
+ /** Restore active skin on page load. Export for variant main.js to call. */
208
+ export function restoreSkin() {
209
+ const skinId = storage.getItem(KEYS.ACTIVE_SKIN) || 'default';
210
+ if (skinId && skinId !== 'default') {
211
+ loadSkinStylesheet(skinId);
212
+ }
213
+ }
214
+
215
+ /** The open Settings window's Skins tab, redrawn when another window changes the skin (set by ui-settings.js). */
216
+ let _refreshSkinsTab = null;
217
+ export function setSkinsTabRefresher(fn) { _refreshSkinsTab = typeof fn === 'function' ? fn : null; }
218
+
219
+ // Listen for cross-tab skin changes via WebSocket
220
+ on('sync:skin:changed', (msg) => {
221
+ const id = msg?.id || 'default';
222
+ if (id === 'default') removeSkinStylesheet();
223
+ else loadSkinStylesheet(id);
224
+ // Update settings panel if open
225
+ const panel = document.getElementById('settings-panel');
226
+ if (panel) _refreshSkinsTab?.(panel);
227
+ });