synabun 2.2.1 → 2.3.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 (365) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +1 -1
  3. package/docs/whatsapp.md +52 -20
  4. package/hooks/claude-code/pre-websearch.mjs +4 -1
  5. package/hooks/claude-code/prompt-submit.mjs +7 -0
  6. package/lib/mcp-build.js +519 -0
  7. package/lib/mcp-dist.js +10 -4
  8. package/lib/release-scan.mjs +23 -10
  9. package/lib/server-supervisor.js +7 -1
  10. package/lib/virustotal.mjs +146 -40
  11. package/mcp-server/dist/http.d.ts +57 -0
  12. package/mcp-server/dist/http.d.ts.map +1 -1
  13. package/mcp-server/dist/http.js +128 -18
  14. package/mcp-server/dist/http.js.map +1 -1
  15. package/mcp-server/dist/index.d.ts.map +1 -1
  16. package/mcp-server/dist/index.js +14 -9
  17. package/mcp-server/dist/index.js.map +1 -1
  18. package/mcp-server/dist/services/browser-route-flow.d.ts +119 -0
  19. package/mcp-server/dist/services/browser-route-flow.d.ts.map +1 -0
  20. package/mcp-server/dist/services/browser-route-flow.js +340 -0
  21. package/mcp-server/dist/services/browser-route-flow.js.map +1 -0
  22. package/mcp-server/dist/services/desktop-client.js +2 -2
  23. package/mcp-server/dist/services/desktop-client.js.map +1 -1
  24. package/mcp-server/dist/services/embedding-service.d.ts.map +1 -1
  25. package/mcp-server/dist/services/embedding-service.js +2 -1
  26. package/mcp-server/dist/services/embedding-service.js.map +1 -1
  27. package/mcp-server/dist/services/identity.d.ts +66 -3
  28. package/mcp-server/dist/services/identity.d.ts.map +1 -1
  29. package/mcp-server/dist/services/identity.js +61 -4
  30. package/mcp-server/dist/services/identity.js.map +1 -1
  31. package/mcp-server/dist/services/neural-interface.d.ts +133 -1
  32. package/mcp-server/dist/services/neural-interface.d.ts.map +1 -1
  33. package/mcp-server/dist/services/neural-interface.js +630 -64
  34. package/mcp-server/dist/services/neural-interface.js.map +1 -1
  35. package/mcp-server/dist/services/tool-catalog.js +2 -2
  36. package/mcp-server/dist/services/tool-catalog.js.map +1 -1
  37. package/mcp-server/dist/tools/agents.d.ts +3 -2
  38. package/mcp-server/dist/tools/agents.d.ts.map +1 -1
  39. package/mcp-server/dist/tools/agents.js +6 -4
  40. package/mcp-server/dist/tools/agents.js.map +1 -1
  41. package/mcp-server/dist/tools/bluesky.d.ts +20 -7
  42. package/mcp-server/dist/tools/bluesky.d.ts.map +1 -1
  43. package/mcp-server/dist/tools/bluesky.js +147 -45
  44. package/mcp-server/dist/tools/bluesky.js.map +1 -1
  45. package/mcp-server/dist/tools/browser-advanced.d.ts +13 -2
  46. package/mcp-server/dist/tools/browser-advanced.d.ts.map +1 -1
  47. package/mcp-server/dist/tools/browser-advanced.js +153 -18
  48. package/mcp-server/dist/tools/browser-advanced.js.map +1 -1
  49. package/mcp-server/dist/tools/browser-cheatsheet.d.ts +2 -0
  50. package/mcp-server/dist/tools/browser-cheatsheet.d.ts.map +1 -1
  51. package/mcp-server/dist/tools/browser-cheatsheet.js +3 -0
  52. package/mcp-server/dist/tools/browser-cheatsheet.js.map +1 -1
  53. package/mcp-server/dist/tools/browser-navigate.d.ts +3 -3
  54. package/mcp-server/dist/tools/browser-navigate.d.ts.map +1 -1
  55. package/mcp-server/dist/tools/browser-navigate.js +19 -16
  56. package/mcp-server/dist/tools/browser-navigate.js.map +1 -1
  57. package/mcp-server/dist/tools/browser-observe.d.ts +2 -1
  58. package/mcp-server/dist/tools/browser-observe.d.ts.map +1 -1
  59. package/mcp-server/dist/tools/browser-observe.js +61 -20
  60. package/mcp-server/dist/tools/browser-observe.js.map +1 -1
  61. package/mcp-server/dist/tools/morelogin.d.ts +13 -3
  62. package/mcp-server/dist/tools/morelogin.d.ts.map +1 -1
  63. package/mcp-server/dist/tools/morelogin.js +82 -19
  64. package/mcp-server/dist/tools/morelogin.js.map +1 -1
  65. package/mcp-server/dist/tools/skill-tools.d.ts +4 -4
  66. package/mcp-server/dist/tools/youtube/helpers.d.ts +1 -0
  67. package/mcp-server/dist/tools/youtube/helpers.d.ts.map +1 -1
  68. package/mcp-server/dist/tools/youtube/helpers.js +1 -1
  69. package/mcp-server/dist/tools/youtube/helpers.js.map +1 -1
  70. package/mcp-server/dist/tools/youtube/upload.d.ts.map +1 -1
  71. package/mcp-server/dist/tools/youtube/upload.js +225 -88
  72. package/mcp-server/dist/tools/youtube/upload.js.map +1 -1
  73. package/mcp-server/package-lock.json +2 -2
  74. package/mcp-server/package.json +1 -1
  75. package/mcp-server/src/http.ts +135 -17
  76. package/mcp-server/src/index.ts +15 -9
  77. package/mcp-server/src/services/browser-route-flow.ts +403 -0
  78. package/mcp-server/src/services/desktop-client.ts +2 -2
  79. package/mcp-server/src/services/embedding-service.ts +2 -1
  80. package/mcp-server/src/services/identity.ts +80 -4
  81. package/mcp-server/src/services/neural-interface.ts +648 -73
  82. package/mcp-server/src/services/tool-catalog.ts +2 -2
  83. package/mcp-server/src/tools/agents.ts +8 -4
  84. package/mcp-server/src/tools/bluesky.ts +164 -51
  85. package/mcp-server/src/tools/browser-advanced.ts +142 -17
  86. package/mcp-server/src/tools/browser-cheatsheet.ts +3 -0
  87. package/mcp-server/src/tools/browser-navigate.ts +19 -16
  88. package/mcp-server/src/tools/browser-observe.ts +62 -20
  89. package/mcp-server/src/tools/morelogin.ts +82 -19
  90. package/mcp-server/src/tools/youtube/helpers.ts +2 -2
  91. package/mcp-server/src/tools/youtube/upload.ts +218 -99
  92. package/neural-interface/i18n/en.json +655 -123
  93. package/neural-interface/i18n/pt-BR.json +542 -10
  94. package/neural-interface/lib/assistant-api.js +90 -23
  95. package/neural-interface/lib/assistant-brains/claude.js +5 -0
  96. package/neural-interface/lib/assistant-catalog.js +134 -3
  97. package/neural-interface/lib/assistant-dispatch.js +97 -1
  98. package/neural-interface/lib/assistant-persona.js +15 -7
  99. package/neural-interface/lib/assistant-router.js +6 -4
  100. package/neural-interface/lib/assistant-runtime.js +18 -1
  101. package/neural-interface/lib/assistant-task-prompt.js +5 -0
  102. package/neural-interface/lib/assistant-tools.js +10 -1
  103. package/neural-interface/lib/automation-approval.js +249 -0
  104. package/neural-interface/lib/automation-browser-owner-access.js +82 -0
  105. package/neural-interface/lib/backup-service.js +16 -1
  106. package/neural-interface/lib/browser-automation-routes.js +84 -0
  107. package/neural-interface/lib/browser-background-tab.js +72 -3
  108. package/neural-interface/lib/browser-execution.js +16 -3
  109. package/neural-interface/lib/browser-extraction.js +106 -45
  110. package/neural-interface/lib/browser-owner.js +48 -0
  111. package/neural-interface/lib/browser-profile-choices.js +143 -0
  112. package/neural-interface/lib/browser-profiles.js +142 -0
  113. package/neural-interface/lib/browser-session-close.js +84 -0
  114. package/neural-interface/lib/browser-start-handoff.js +202 -0
  115. package/neural-interface/lib/browser-tab-recovery.js +153 -0
  116. package/neural-interface/lib/browser-tool-policy.js +23 -4
  117. package/neural-interface/lib/browser-wedge-retire.js +64 -0
  118. package/neural-interface/lib/chromium-on-device-model.js +67 -0
  119. package/neural-interface/lib/claude-agent-bridge.js +43 -5
  120. package/neural-interface/lib/claude-background-hold.js +239 -0
  121. package/neural-interface/lib/claude-model-catalog.js +12 -0
  122. package/neural-interface/lib/effort-levels.js +28 -2
  123. package/neural-interface/lib/exec-loop-command.js +8 -0
  124. package/neural-interface/lib/http-guards.js +11 -6
  125. package/neural-interface/lib/local-profile-proxy.js +362 -0
  126. package/neural-interface/lib/local-profiles.js +929 -0
  127. package/neural-interface/lib/loop-logger.js +31 -5
  128. package/neural-interface/lib/maritaca/api.js +179 -0
  129. package/neural-interface/lib/maritaca/attachments.js +44 -0
  130. package/neural-interface/lib/maritaca/client.js +362 -0
  131. package/neural-interface/lib/maritaca/key-store.js +122 -0
  132. package/neural-interface/lib/maritaca/models.js +181 -0
  133. package/neural-interface/lib/maritaca/modes.js +39 -0
  134. package/neural-interface/lib/maritaca/opencode-proxy.js +236 -0
  135. package/neural-interface/lib/maritaca/opencode-stream.js +345 -0
  136. package/neural-interface/lib/maritaca/opencode.js +218 -0
  137. package/neural-interface/lib/maritaca/panel-bridge.js +273 -0
  138. package/neural-interface/lib/maritaca/sessions.js +198 -0
  139. package/neural-interface/lib/mcp-external-servers.js +37 -10
  140. package/neural-interface/lib/morelogin-agent-profiles.js +149 -0
  141. package/neural-interface/lib/morelogin.js +278 -14
  142. package/neural-interface/lib/native-loop-providers.js +124 -11
  143. package/neural-interface/lib/native-loop-runtime.js +112 -11
  144. package/neural-interface/lib/owner-authority.js +137 -43
  145. package/neural-interface/lib/page-session.js +111 -27
  146. package/neural-interface/lib/peer-identity.js +263 -43
  147. package/neural-interface/lib/provider-panel-api-key-auth.js +7 -2
  148. package/neural-interface/lib/pty-host/core.js +36 -0
  149. package/neural-interface/lib/pty-host/protocol.js +2 -0
  150. package/neural-interface/lib/request-gate.js +2 -0
  151. package/neural-interface/lib/skills/api-v2.js +13 -2
  152. package/neural-interface/lib/skills/creation-api.js +3 -1
  153. package/neural-interface/lib/skills/evals-api.js +5 -1
  154. package/neural-interface/lib/social-write-pacing.js +151 -0
  155. package/neural-interface/lib/system-activity.js +1 -1
  156. package/neural-interface/lib/terminal-token-redaction.js +293 -0
  157. package/neural-interface/lib/terminal-tokens.js +436 -0
  158. package/neural-interface/lib/worker-mcp-channel.js +45 -10
  159. package/neural-interface/package-lock.json +3 -2
  160. package/neural-interface/package.json +2 -1
  161. package/neural-interface/public/assets/mascot/README.md +11 -0
  162. package/neural-interface/public/assets/mascot/ask.gif +0 -0
  163. package/neural-interface/public/assets/mascot/ask.png +0 -0
  164. package/neural-interface/public/assets/mascot/blocked.gif +0 -0
  165. package/neural-interface/public/assets/mascot/blocked.png +0 -0
  166. package/neural-interface/public/assets/mascot/budget.gif +0 -0
  167. package/neural-interface/public/assets/mascot/budget.png +0 -0
  168. package/neural-interface/public/assets/mascot/computer.gif +0 -0
  169. package/neural-interface/public/assets/mascot/computer.png +0 -0
  170. package/neural-interface/public/assets/mascot/edit.gif +0 -0
  171. package/neural-interface/public/assets/mascot/edit.png +0 -0
  172. package/neural-interface/public/assets/mascot/error.gif +0 -0
  173. package/neural-interface/public/assets/mascot/error.png +0 -0
  174. package/neural-interface/public/assets/mascot/hover-attention.gif +0 -0
  175. package/neural-interface/public/assets/mascot/hover-attention.png +0 -0
  176. package/neural-interface/public/assets/mascot/idle-hero.gif +0 -0
  177. package/neural-interface/public/assets/mascot/idle-hero.png +0 -0
  178. package/neural-interface/public/assets/mascot/idle.gif +0 -0
  179. package/neural-interface/public/assets/mascot/idle.png +0 -0
  180. package/neural-interface/public/assets/mascot/manifest.json +254 -0
  181. package/neural-interface/public/assets/mascot/mcp.gif +0 -0
  182. package/neural-interface/public/assets/mascot/mcp.png +0 -0
  183. package/neural-interface/public/assets/mascot/memory.gif +0 -0
  184. package/neural-interface/public/assets/mascot/memory.png +0 -0
  185. package/neural-interface/public/assets/mascot/offline.gif +0 -0
  186. package/neural-interface/public/assets/mascot/offline.png +0 -0
  187. package/neural-interface/public/assets/mascot/pick.gif +0 -0
  188. package/neural-interface/public/assets/mascot/pick.png +0 -0
  189. package/neural-interface/public/assets/mascot/plan.gif +0 -0
  190. package/neural-interface/public/assets/mascot/plan.png +0 -0
  191. package/neural-interface/public/assets/mascot/present.gif +0 -0
  192. package/neural-interface/public/assets/mascot/present.png +0 -0
  193. package/neural-interface/public/assets/mascot/project.gif +0 -0
  194. package/neural-interface/public/assets/mascot/project.png +0 -0
  195. package/neural-interface/public/assets/mascot/read.gif +0 -0
  196. package/neural-interface/public/assets/mascot/read.png +0 -0
  197. package/neural-interface/public/assets/mascot/runs.gif +0 -0
  198. package/neural-interface/public/assets/mascot/runs.png +0 -0
  199. package/neural-interface/public/assets/mascot/scenes/automation.gif +0 -0
  200. package/neural-interface/public/assets/mascot/scenes/automation.png +0 -0
  201. package/neural-interface/public/assets/mascot/scenes/browser.gif +0 -0
  202. package/neural-interface/public/assets/mascot/scenes/browser.png +0 -0
  203. package/neural-interface/public/assets/mascot/scenes/code.gif +0 -0
  204. package/neural-interface/public/assets/mascot/scenes/code.png +0 -0
  205. package/neural-interface/public/assets/mascot/scenes/complex.gif +0 -0
  206. package/neural-interface/public/assets/mascot/scenes/complex.png +0 -0
  207. package/neural-interface/public/assets/mascot/scenes/computer.gif +0 -0
  208. package/neural-interface/public/assets/mascot/scenes/computer.png +0 -0
  209. package/neural-interface/public/assets/mascot/scenes/design.gif +0 -0
  210. package/neural-interface/public/assets/mascot/scenes/design.png +0 -0
  211. package/neural-interface/public/assets/mascot/scenes/edit.gif +0 -0
  212. package/neural-interface/public/assets/mascot/scenes/edit.png +0 -0
  213. package/neural-interface/public/assets/mascot/scenes/generic.gif +0 -0
  214. package/neural-interface/public/assets/mascot/scenes/generic.png +0 -0
  215. package/neural-interface/public/assets/mascot/scenes/image_gen.gif +0 -0
  216. package/neural-interface/public/assets/mascot/scenes/image_gen.png +0 -0
  217. package/neural-interface/public/assets/mascot/scenes/manifest.json +173 -0
  218. package/neural-interface/public/assets/mascot/scenes/memory.gif +0 -0
  219. package/neural-interface/public/assets/mascot/scenes/memory.png +0 -0
  220. package/neural-interface/public/assets/mascot/scenes/quick.gif +0 -0
  221. package/neural-interface/public/assets/mascot/scenes/quick.png +0 -0
  222. package/neural-interface/public/assets/mascot/scenes/read.gif +0 -0
  223. package/neural-interface/public/assets/mascot/scenes/read.png +0 -0
  224. package/neural-interface/public/assets/mascot/scenes/research.gif +0 -0
  225. package/neural-interface/public/assets/mascot/scenes/research.png +0 -0
  226. package/neural-interface/public/assets/mascot/scenes/review.gif +0 -0
  227. package/neural-interface/public/assets/mascot/scenes/review.png +0 -0
  228. package/neural-interface/public/assets/mascot/scenes/search.gif +0 -0
  229. package/neural-interface/public/assets/mascot/scenes/search.png +0 -0
  230. package/neural-interface/public/assets/mascot/scenes/shell.gif +0 -0
  231. package/neural-interface/public/assets/mascot/scenes/shell.png +0 -0
  232. package/neural-interface/public/assets/mascot/scenes/thinking.gif +0 -0
  233. package/neural-interface/public/assets/mascot/scenes/thinking.png +0 -0
  234. package/neural-interface/public/assets/mascot/scenes/video_gen.gif +0 -0
  235. package/neural-interface/public/assets/mascot/scenes/video_gen.png +0 -0
  236. package/neural-interface/public/assets/mascot/scenes/web.gif +0 -0
  237. package/neural-interface/public/assets/mascot/scenes/web.png +0 -0
  238. package/neural-interface/public/assets/mascot/search.gif +0 -0
  239. package/neural-interface/public/assets/mascot/search.png +0 -0
  240. package/neural-interface/public/assets/mascot/shell.gif +0 -0
  241. package/neural-interface/public/assets/mascot/shell.png +0 -0
  242. package/neural-interface/public/assets/mascot/skill.gif +0 -0
  243. package/neural-interface/public/assets/mascot/skill.png +0 -0
  244. package/neural-interface/public/assets/mascot/sleep.gif +0 -0
  245. package/neural-interface/public/assets/mascot/sleep.png +0 -0
  246. package/neural-interface/public/assets/mascot/subagent.gif +0 -0
  247. package/neural-interface/public/assets/mascot/subagent.png +0 -0
  248. package/neural-interface/public/assets/mascot/success.gif +0 -0
  249. package/neural-interface/public/assets/mascot/success.png +0 -0
  250. package/neural-interface/public/assets/mascot/think.gif +0 -0
  251. package/neural-interface/public/assets/mascot/think.png +0 -0
  252. package/neural-interface/public/assets/mascot/wait.gif +0 -0
  253. package/neural-interface/public/assets/mascot/wait.png +0 -0
  254. package/neural-interface/public/assets/mascot/watch.gif +0 -0
  255. package/neural-interface/public/assets/mascot/watch.png +0 -0
  256. package/neural-interface/public/assets/mascot/web.gif +0 -0
  257. package/neural-interface/public/assets/mascot/web.png +0 -0
  258. package/neural-interface/public/onboarding.html +14 -1
  259. package/neural-interface/public/shared/agent-runtime-options.js +49 -8
  260. package/neural-interface/public/shared/agy/agy-panel.js +2 -2
  261. package/neural-interface/public/shared/agy/agy-render.js +41 -1
  262. package/neural-interface/public/shared/agy/agy-styles.js +5 -0
  263. package/neural-interface/public/shared/api.js +5 -4
  264. package/neural-interface/public/shared/assistant/asst-ask-styles.js +8 -8
  265. package/neural-interface/public/shared/assistant/asst-ask.js +1 -1
  266. package/neural-interface/public/shared/assistant/asst-brain-picker.js +99 -9
  267. package/neural-interface/public/shared/assistant/asst-computer.js +47 -2
  268. package/neural-interface/public/shared/assistant/asst-control.js +1 -1
  269. package/neural-interface/public/shared/assistant/asst-limit-wait.js +7 -5
  270. package/neural-interface/public/shared/assistant/asst-panel.js +13 -5
  271. package/neural-interface/public/shared/assistant/asst-rack-styles.js +4 -4
  272. package/neural-interface/public/shared/assistant/asst-render.js +16 -10
  273. package/neural-interface/public/shared/assistant/asst-route-models.js +64 -4
  274. package/neural-interface/public/shared/assistant/asst-route.js +24 -7
  275. package/neural-interface/public/shared/assistant/asst-routes-editor.js +154 -39
  276. package/neural-interface/public/shared/assistant/asst-run-stage.js +3 -3
  277. package/neural-interface/public/shared/assistant/asst-scene-styles.js +8 -111
  278. package/neural-interface/public/shared/assistant/asst-scenes.js +46 -318
  279. package/neural-interface/public/shared/assistant/asst-sidepanel.js +2 -2
  280. package/neural-interface/public/shared/assistant/asst-state.js +72 -2
  281. package/neural-interface/public/shared/assistant/asst-styles.js +60 -15
  282. package/neural-interface/public/shared/automation-approval-view.js +75 -0
  283. package/neural-interface/public/shared/cdx/cdx-panel.js +2 -2
  284. package/neural-interface/public/shared/cdx/cdx-render.js +73 -7
  285. package/neural-interface/public/shared/cdx/cdx-tabs.js +3 -3
  286. package/neural-interface/public/shared/context-menu-model.js +2 -0
  287. package/neural-interface/public/shared/cp/cp-agents.js +8 -0
  288. package/neural-interface/public/shared/cp/cp-permissions.js +6 -2
  289. package/neural-interface/public/shared/cp/cp-rehydrate.js +25 -1
  290. package/neural-interface/public/shared/cp/cp-tasks-model.js +33 -0
  291. package/neural-interface/public/shared/editor/editor-panel-logic.js +10 -0
  292. package/neural-interface/public/shared/editor/editor-panel.js +10 -2
  293. package/neural-interface/public/shared/html-shell.js +30 -22
  294. package/neural-interface/public/shared/judgments-log-origins.js +29 -0
  295. package/neural-interface/public/shared/morelogin-profile-choices.js +107 -0
  296. package/neural-interface/public/shared/morelogin-profile-field.js +186 -0
  297. package/neural-interface/public/shared/mtc/mtc-client.js +181 -0
  298. package/neural-interface/public/shared/mtc/mtc-compose.js +40 -0
  299. package/neural-interface/public/shared/mtc/mtc-copy.js +253 -0
  300. package/neural-interface/public/shared/mtc/mtc-logic.js +478 -0
  301. package/neural-interface/public/shared/mtc/mtc-panel.js +1354 -0
  302. package/neural-interface/public/shared/mtc/mtc-render.js +172 -0
  303. package/neural-interface/public/shared/mtc/mtc-styles.js +437 -0
  304. package/neural-interface/public/shared/ocp-v2/ocp-v2-automation-ownership.js +23 -0
  305. package/neural-interface/public/shared/ocp-v2/ocp-v2-events.js +13 -0
  306. package/neural-interface/public/shared/ocp-v2/ocp-v2-icons.js +3 -1
  307. package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +10 -4
  308. package/neural-interface/public/shared/ocp-v2/ocp-v2-render.js +6 -86
  309. package/neural-interface/public/shared/ocp-v2/ocp-v2-ws.js +5 -2
  310. package/neural-interface/public/shared/owner-access.js +134 -0
  311. package/neural-interface/public/shared/owner-authority-view.js +92 -0
  312. package/neural-interface/public/shared/page-session.js +143 -14
  313. package/neural-interface/public/shared/poll-backoff.js +59 -0
  314. package/neural-interface/public/shared/provider-icons.js +3 -0
  315. package/neural-interface/public/shared/schedules-view.js +7 -0
  316. package/neural-interface/public/shared/server-back.js +50 -0
  317. package/neural-interface/public/shared/settings/settings-browser-owner-access.js +72 -0
  318. package/neural-interface/public/shared/settings/settings-data.js +7 -1
  319. package/neural-interface/public/shared/settings/settings-ia.js +3 -1
  320. package/neural-interface/public/shared/settings/settings-kit.js +11 -3
  321. package/neural-interface/public/shared/settings/settings-local-profiles.js +153 -0
  322. package/neural-interface/public/shared/settings/settings-maritaca-opencode.js +105 -0
  323. package/neural-interface/public/shared/settings/settings-shell.js +7 -0
  324. package/neural-interface/public/shared/shown-children.js +72 -0
  325. package/neural-interface/public/shared/sidepanel-session-status.js +16 -2
  326. package/neural-interface/public/shared/state.js +1 -1
  327. package/neural-interface/public/shared/static-bg-state.js +22 -0
  328. package/neural-interface/public/shared/styles.css +457 -164
  329. package/neural-interface/public/shared/synabun-mascot-assets.js +67 -0
  330. package/neural-interface/public/shared/synabun-mascot.js +136 -12
  331. package/neural-interface/public/shared/synabun-ticker.js +3 -0
  332. package/neural-interface/public/shared/synabun-tools.js +173 -0
  333. package/neural-interface/public/shared/tool-heartbeat.js +43 -0
  334. package/neural-interface/public/shared/tool-list-picker.js +3 -1
  335. package/neural-interface/public/shared/tool-list-view.js +23 -4
  336. package/neural-interface/public/shared/topright-overflow-logic.js +1 -0
  337. package/neural-interface/public/shared/ui-automation-approval.js +188 -0
  338. package/neural-interface/public/shared/ui-automation-studio.js +138 -91
  339. package/neural-interface/public/shared/ui-claude-panel.js +209 -31
  340. package/neural-interface/public/shared/ui-judgments.js +37 -10
  341. package/neural-interface/public/shared/ui-maritaca-panel.js +15 -0
  342. package/neural-interface/public/shared/ui-navbar.js +23 -0
  343. package/neural-interface/public/shared/ui-owner-access.js +191 -0
  344. package/neural-interface/public/shared/ui-owner-authority.js +162 -0
  345. package/neural-interface/public/shared/ui-panels.js +3 -1
  346. package/neural-interface/public/shared/ui-schedules-studio.js +118 -17
  347. package/neural-interface/public/shared/ui-scroll-follow.js +3 -0
  348. package/neural-interface/public/shared/ui-sessions.js +45 -16
  349. package/neural-interface/public/shared/ui-settings.js +676 -42
  350. package/neural-interface/public/shared/ui-sidepanel-session-entry.js +8 -2
  351. package/neural-interface/public/shared/ui-sidepanel-sessions.js +3 -3
  352. package/neural-interface/public/shared/ui-sidepanel-tray.js +24 -0
  353. package/neural-interface/public/shared/ui-sidepanel-windows.js +1 -1
  354. package/neural-interface/public/shared/ui-terminal.js +15 -7
  355. package/neural-interface/public/shared/ui-tutorial-preview.js +4 -0
  356. package/neural-interface/public/shared/ui-update.js +3 -0
  357. package/neural-interface/public/shared/ui-whiteboard.js +4 -0
  358. package/neural-interface/public/shared/window-keys.js +38 -0
  359. package/neural-interface/scripts/build-mascot-assets.mjs +30 -0
  360. package/neural-interface/server.js +2903 -359
  361. package/npm-shrinkwrap.json +5 -17
  362. package/package.json +5 -6
  363. package/postinstall.js +38 -39
  364. package/setup.js +33 -31
  365. package/skills/synabun/modules/changelog.md +14 -0
@@ -37,8 +37,10 @@ import {
37
37
  sanitizeDesktopGrant,
38
38
  sanitizePin,
39
39
  sanitizeRole,
40
+ sanitizeTerminalToken,
40
41
  runWithBrainCredential,
41
42
  runWithIdentity,
43
+ runWithTerminalToken,
42
44
  releaseIdentity,
43
45
  startIdentitySweeper,
44
46
  } from './services/identity.js';
@@ -78,6 +80,30 @@ export interface McpRoutesOptions {
78
80
  * answers, the session has exactly that selection and X-Synabun-Tools is ignored.
79
81
  */
80
82
  selectionFor?: (req: Request) => McpSessionSelection | null | undefined;
83
+ /**
84
+ * The host's check of a run's pin (the Neural Interface's terminal tokens, neural-interface/lib/terminal-tokens.js):
85
+ * true when this request may route as `pin` with the X-Synabun-Terminal-Token it carries (`token`, or null). A pin
86
+ * it refuses (a run SynaBun gave a token to, named without that token) is not this caller's: the request routes as
87
+ * its own MCP session, so it never shares that run's identity (its browser pins, its recovered tab) and never sends
88
+ * the run's id to the Neural Interface. Without it, every pin is taken as it is said (the standalone server).
89
+ */
90
+ terminalAuth?: (pin: string, token: string | null) => boolean;
91
+ /**
92
+ * The host's proof for a plain MCP session (neural-interface/lib/terminal-tokens.js issueSession / revokeSession):
93
+ * a CLI window's Claude Code or Codex that SynaBun did not start names no run, so its id to the Neural Interface is
94
+ * its Mcp-Session-Id. `issue` is asked once, when such a session initializes from this computer (loopback, no pin,
95
+ * not through the tunnel), and the session then sends its proof with its id on every Neural Interface request it
96
+ * makes (callerTerminalToken), so no other process can act as it there, and the Neural Interface can let it pick its
97
+ * own MoreLogin profile (`morelogin` `use`). The proof never leaves this process: it is not sent to the MCP client.
98
+ * `revoke` is called when the session closes or is evicted. Without it (the standalone server, the worker-only
99
+ * channel) a plain session has no proof, as before.
100
+ * `eligible` is the host's own answer for the initializing request, asked after wantsSessionProof and before
101
+ * `issue`: the Neural Interface says yes only on its plain /mcp mount (never /mcp/<key>, which shares this router),
102
+ * for a request that is not from outside by its own rules and whose peer process is not a relay or a proxy (review
103
+ * b6631e9d, finding 5: a loopback socket without CF-Connecting-IP is also what a local reverse proxy in front of the
104
+ * keyed mount looks like). A host that gives `issue` without `eligible` gets no proof issued: fail closed.
105
+ */
106
+ sessionProof?: { issue: (sessionId: string) => string | null; revoke: (sessionId: string) => void; eligible?: (req: Request) => boolean };
81
107
  }
82
108
 
83
109
  /**
@@ -113,8 +139,12 @@ interface McpHttpSession {
113
139
  transport: StreamableHTTPServerTransport;
114
140
  server: ReturnType<typeof createMcpServer>;
115
141
  lastSeen: number;
142
+ /** The host's proof of this session's own id (McpRoutesOptions.sessionProof), for a plain session only. */
143
+ proof?: string | null;
116
144
  }
117
145
  const mcpSessions = new Map<string, McpHttpSession>();
146
+ /** sid → the host's revoke for the proof it gave that session (the router that initialized it), or null. */
147
+ const revokeProof = new Map<string, ((sessionId: string) => void) | null>();
118
148
 
119
149
  const MCP_SESSION_TTL_MS = parseInt(process.env.SYNABUN_MCP_SESSION_TTL_MS || '', 10) || 60 * 60 * 1000;
120
150
 
@@ -126,7 +156,7 @@ function startSessionSweeper(): void {
126
156
  const now = Date.now();
127
157
  for (const [sid, entry] of mcpSessions) {
128
158
  if (now - entry.lastSeen > MCP_SESSION_TTL_MS) {
129
- console.error(`[mcp-http] session ${sid} evicted after ${Math.round((now - entry.lastSeen) / 60000)}min idle (${mcpSessions.size - 1} remain)`);
159
+ console.error(`[mcp-http] session ${sessionLogId(sid)} evicted after ${Math.round((now - entry.lastSeen) / 60000)}min idle (${mcpSessions.size - 1} remain)`);
130
160
  // transport.close() fires onclose → map cleanup + releaseIdentity + server.close.
131
161
  try { entry.transport.close(); } catch { /* already closed */ }
132
162
  }
@@ -145,12 +175,45 @@ onSchemaRefresh(() => {
145
175
  }
146
176
  });
147
177
 
178
+ /**
179
+ * What proves this request's X-Synabun-Terminal pin: its X-Synabun-Terminal-Token, else (an Assistant brain, whose pin
180
+ * the Neural Interface binds to its launch credential) its X-Synabun-Brain-Token. None for a tunnel caller (a remote
181
+ * MCP-key holder) or a malformed one.
182
+ */
183
+ export function requestTerminalToken(req: Pick<Request, 'get'>): string | null {
184
+ if (req.get('cf-connecting-ip')) return null;
185
+ return sanitizeTerminalToken(req.get('x-synabun-terminal-token')) ?? sanitizeBrainCredential(req.get('x-synabun-brain-token'));
186
+ }
187
+
188
+ const refusedPinsLogged = new Set<string>();
189
+ /**
190
+ * The X-Synabun-Terminal pin this request may route as: the header's, unless the host's terminalAuth refuses it (a
191
+ * run's pin without that run's token, or a check that threw: fail closed), then none.
192
+ */
193
+ export function acceptedTerminalPin(req: Pick<Request, 'get'>, options: McpRoutesOptions = {}): string | null {
194
+ const pin = sanitizePin(req.get('x-synabun-terminal'));
195
+ if (!pin || typeof options.terminalAuth !== 'function') return pin;
196
+ let accepted = false;
197
+ try { accepted = options.terminalAuth(pin, requestTerminalToken(req)) === true; } catch { accepted = false; }
198
+ if (accepted) return pin;
199
+ if (!refusedPinsLogged.has(pin)) {
200
+ refusedPinsLogged.add(pin);
201
+ if (refusedPinsLogged.size > 1000) refusedPinsLogged.delete(refusedPinsLogged.values().next().value as string);
202
+ // Finding 4 (re-review of 2026-11-11): the refused value may be a live Mcp-Session-Id (a bearer for that session),
203
+ // so the log line carries its short form only, never the whole value.
204
+ console.error(`[mcp-http] X-Synabun-Terminal ${sessionLogId(pin)} came without that run's terminal token: routed as its own MCP session`);
205
+ }
206
+ return null;
207
+ }
208
+
148
209
  /**
149
210
  * Per-request caller identity. Explicit X-Synabun-* headers (injected into the
150
211
  * launch config of loops, scheduled loops, and sidepanel sessions) win; plain
151
- * CLI windows fall back to their unique Mcp-Session-Id.
212
+ * CLI windows fall back to their unique Mcp-Session-Id. A pin the host's
213
+ * terminalAuth refused (`pin` null) counts as no pin, and so do the browser
214
+ * pins that came with it.
152
215
  */
153
- function deriveIdentity(req: Request, sid: string | undefined): CallerIdentity {
216
+ function deriveIdentity(req: Request, sid: string | undefined, pin: string | null = sanitizePin(req.get('x-synabun-terminal'))): CallerIdentity {
154
217
  const memoryContext = {
155
218
  project: req.get('x-synabun-project')?.slice(0,200),
156
219
  session: req.get('x-synabun-memory-session')?.slice(0,200),
@@ -163,7 +226,7 @@ function deriveIdentity(req: Request, sid: string | undefined): CallerIdentity {
163
226
  const remote = !!req.get('cf-connecting-ip');
164
227
  const role = remote ? null : sanitizeRole(req.get('x-synabun-role'));
165
228
  const desktopGrant = remote ? null : sanitizeDesktopGrant(req.get('x-synabun-desktop-grant'));
166
- const headerTerminal = sanitizePin(req.get('x-synabun-terminal'));
229
+ const headerTerminal = pin;
167
230
  if (headerTerminal) {
168
231
  const identity = obtainIdentity(headerTerminal, {
169
232
  source: 'header',
@@ -192,11 +255,53 @@ export function requestBrainCredential(req: Pick<Request, 'get'>): string | null
192
255
  }
193
256
 
194
257
  /**
195
- * Handle one request inside its caller identity and its own brain-credential context: the
196
- * X-Synabun-Brain-Token of THIS request, never one another request left on a shared identity.
258
+ * Handle one request inside its caller identity and its own credential contexts: the X-Synabun-Brain-Token and the
259
+ * X-Synabun-Terminal-Token of THIS request (the latter only with the pin it came with, which the host accepted),
260
+ * never one another request left on a shared identity.
261
+ */
262
+ function runRequest<T>(req: Request, sid: string | undefined, options: McpRoutesOptions, fn: () => T): T {
263
+ const pin = acceptedTerminalPin(req, options);
264
+ const token = pin ? requestTerminalToken(req) : null;
265
+ // A plain session (no accepted pin) routes as its Mcp-Session-Id: the proof the host gave that id at its initialize
266
+ // goes with it. Only the session's own transport (this sid, which the SDK checked) ever carries it.
267
+ const own = !pin && sid ? sessionProofGrant(sid) : null;
268
+ return runWithTerminalToken(pin && token ? { terminal: pin, token } : own, () =>
269
+ runWithBrainCredential(requestBrainCredential(req), () => runWithIdentity(deriveIdentity(req, sid, pin), fn)));
270
+ }
271
+
272
+ /** The proof of plain session `sid` as a grant for its own id, or null. */
273
+ function sessionProofGrant(sid: string): { terminal: string; token: string } | null {
274
+ const proof = mcpSessions.get(sid)?.proof;
275
+ return proof ? { terminal: sid, token: proof } : null;
276
+ }
277
+
278
+ /**
279
+ * Whether a session initializing with `req` may get the host's proof (McpRoutesOptions.sessionProof): no accepted
280
+ * pin (a run or a panel routes as its pin and proves it with its own token), from this computer's loopback, and not
281
+ * through the tunnel (a remote MCP-key holder).
282
+ */
283
+ export function wantsSessionProof(req: Pick<Request, 'get'> & { socket?: { remoteAddress?: string } }, pin: string | null): boolean {
284
+ if (pin) return false;
285
+ if (req.get('cf-connecting-ip')) return false;
286
+ const addr = String(req.socket?.remoteAddress || '');
287
+ return /^(?:::ffff:)?127\.\d+\.\d+\.\d+$/.test(addr) || addr === '::1';
288
+ }
289
+
290
+ /** The host's own check of the initializing request (McpRoutesOptions.sessionProof.eligible): absent or failing is no. */
291
+ export function hostAllowsSessionProof(req: Request, options: McpRoutesOptions): boolean {
292
+ const eligible = options.sessionProof?.eligible;
293
+ if (typeof eligible !== 'function') return false;
294
+ try { return eligible(req) === true; } catch { return false; }
295
+ }
296
+
297
+ /**
298
+ * A session id as the log shows it: its first 8 characters. The Mcp-Session-Id is all a client needs to send requests
299
+ * on a session (the SDK checks nothing else), and a session with a proof can pick its MoreLogin profile, so the whole
300
+ * id is a bearer and never goes to stderr (which the background launch writes to launcher.log; review b6631e9d, note 8).
197
301
  */
198
- function runRequest<T>(req: Request, sid: string | undefined, fn: () => T): T {
199
- return runWithBrainCredential(requestBrainCredential(req), () => runWithIdentity(deriveIdentity(req, sid), fn));
302
+ export function sessionLogId(sid: string | undefined | null): string {
303
+ const text = String(sid || '');
304
+ return text.length > 8 ? `${text.slice(0, 8)}…` : text;
200
305
  }
201
306
 
202
307
  function jsonRpcError(res: express.Response, status: number, code: number, message: string): void {
@@ -251,7 +356,7 @@ export function createMcpRoutes(options: McpRoutesOptions = {}): Router {
251
356
  // finish means the fresh schemas have left this session's HTTP response.
252
357
  res.once('finish', () => { if (res.statusCode === 200) toolListBarriers.get(entry.server)?.listed(); });
253
358
  }
254
- await runRequest(req, sid, () =>
359
+ await runRequest(req, sid, options, () =>
255
360
  entry.transport.handleRequest(req, res, req.body)
256
361
  );
257
362
  return;
@@ -271,9 +376,15 @@ export function createMcpRoutes(options: McpRoutesOptions = {}): Router {
271
376
  const transport = new StreamableHTTPServerTransport({
272
377
  sessionIdGenerator: () => randomUUID(),
273
378
  onsessioninitialized: (newSid) => {
274
- mcpSessions.set(newSid, { transport, server, lastSeen: Date.now() });
275
- deriveIdentity(req, newSid);
276
- const terminal = sanitizePin(req.get('x-synabun-terminal'));
379
+ // The pin the host accepted (terminalAuth): a refused one is no pin, here as on every later request.
380
+ const terminal = acceptedTerminalPin(req, options);
381
+ let proof: string | null = null;
382
+ if (options.sessionProof && wantsSessionProof(req, terminal) && hostAllowsSessionProof(req, options)) {
383
+ try { proof = options.sessionProof.issue(newSid) || null; } catch { proof = null; }
384
+ }
385
+ mcpSessions.set(newSid, { transport, server, lastSeen: Date.now(), proof });
386
+ revokeProof.set(newSid, proof && options.sessionProof ? options.sessionProof.revoke : null);
387
+ deriveIdentity(req, newSid, terminal);
277
388
  // The warm server was built role-less, on focus. The SDK awaits this
278
389
  // hook BEFORE dispatching the initialize request, so binding the
279
390
  // selection and the role here makes the handshake instructions and
@@ -288,7 +399,7 @@ export function createMcpRoutes(options: McpRoutesOptions = {}): Router {
288
399
  const grant = remote ? null : sanitizeDesktopGrant(req.get('x-synabun-desktop-grant'));
289
400
  if (grant) setServerCapabilities(server, { computer: true });
290
401
  const tools = selection.source === 'http' ? '' : `, tools=${selection.mode}:${selection.groups.join(',') || 'memory'}${selection.listError ? ' (unreadable)' : ''}`;
291
- console.error(`[mcp-http] session ${newSid} init (terminal=${terminal || 'none'}${role ? `, role=${role}` : ''}${grant ? ', computer' : ''}${tools}, sessions=${mcpSessions.size})`);
402
+ console.error(`[mcp-http] session ${sessionLogId(newSid)} init (terminal=${terminal || 'none'}${role ? `, role=${role}` : ''}${grant ? ', computer' : ''}${tools}, sessions=${mcpSessions.size})`);
292
403
  },
293
404
  });
294
405
  // Re-entry guard: server.close() closes its transport, which fires
@@ -299,17 +410,24 @@ export function createMcpRoutes(options: McpRoutesOptions = {}): Router {
299
410
  tornDown = true;
300
411
  const closedSid = transport.sessionId;
301
412
  if (closedSid && mcpSessions.has(closedSid)) {
413
+ // Its tab is released as the session itself (its proof, while it still holds one), then the proof stops
414
+ // working (the id stays refused: nobody can be this session afterwards). The host releases what the
415
+ // session still held in its revoke too, so a release that arrives after it is no loss.
416
+ const grant = sessionProofGrant(closedSid);
417
+ const revoke = revokeProof.get(closedSid);
418
+ revokeProof.delete(closedSid);
302
419
  mcpSessions.delete(closedSid);
303
420
  // Releases the identity's acquired browser tab (if any). Header-keyed
304
421
  // identities (loops) are keyed by terminal id, not sid — untouched.
305
- releaseIdentity(closedSid);
306
- console.error(`[mcp-http] session ${closedSid} closed (${mcpSessions.size} remain)`);
422
+ runWithTerminalToken(grant, () => releaseIdentity(closedSid));
423
+ if (revoke) { try { revoke(closedSid); } catch { /* the host's own failure */ } }
424
+ console.error(`[mcp-http] session ${sessionLogId(closedSid)} closed (${mcpSessions.size} remain)`);
307
425
  }
308
426
  try { server.close(); } catch { /* already closed */ }
309
427
  };
310
428
 
311
429
  await server.connect(transport);
312
- await runRequest(req, undefined, () =>
430
+ await runRequest(req, undefined, options, () =>
313
431
  transport.handleRequest(req, res, req.body)
314
432
  );
315
433
  } catch (error) {
@@ -330,7 +448,7 @@ export function createMcpRoutes(options: McpRoutesOptions = {}): Router {
330
448
  }
331
449
  entry.lastSeen = Date.now();
332
450
  try {
333
- await runRequest(req, sid, () =>
451
+ await runRequest(req, sid, options, () =>
334
452
  entry.transport.handleRequest(req, res)
335
453
  );
336
454
  } catch (error) {
@@ -27,6 +27,7 @@ import { registerDiscordTools } from './tools/discord.js';
27
27
  import { registerGitTools } from './tools/git.js';
28
28
  import { registerImageTools } from './tools/image.js';
29
29
  import { registerGscTools } from './tools/gsc.js';
30
+ import { withRouteFlows } from './services/browser-route-flow.js';
30
31
  import { registerYoutubeTools } from './tools/youtube.js';
31
32
  import { registerStyleGuideTools } from './tools/style-guide.js';
32
33
  import { registerMoreLoginTools } from './tools/morelogin.js';
@@ -80,17 +81,22 @@ function buildServerInstructions(runtime: ToolRuntime): string {
80
81
  let _lastInstructionsSig: string | null = null;
81
82
 
82
83
  /** One registrar per catalog group (services/tool-catalog.ts): registering is iterating the catalog. */
84
+ // Browser groups register on a server whose handlers run in a route flow (services/browser-route-flow.ts): a call
85
+ // whose tab is lost midway stops (or, for a read that opens its own page, runs once more) instead of answering for
86
+ // the blank replacement tab. Bluesky recovers by itself (bluesky.ts) and registers on the plain server.
87
+ const routed = (register: (server: McpServer) => RegisteredTool[]) => (server: McpServer) => register(withRouteFlows(server));
88
+
83
89
  const GROUP_REGISTRARS: Readonly<Record<string, (server: McpServer) => RegisteredTool[]>> = Object.freeze({
84
- browser: registerBrowserCoreTools,
85
- browser_twitter: registerBrowserTwitterTools,
86
- browser_facebook: registerBrowserFacebookTools,
87
- browser_tiktok: registerBrowserTiktokTools,
88
- browser_whatsapp: registerBrowserWhatsappTools,
89
- browser_instagram: registerBrowserInstagramTools,
90
- browser_linkedin: registerBrowserLinkedinTools,
90
+ browser: routed(registerBrowserCoreTools),
91
+ browser_twitter: routed(registerBrowserTwitterTools),
92
+ browser_facebook: routed(registerBrowserFacebookTools),
93
+ browser_tiktok: routed(registerBrowserTiktokTools),
94
+ browser_whatsapp: routed(registerBrowserWhatsappTools),
95
+ browser_instagram: routed(registerBrowserInstagramTools),
96
+ browser_linkedin: routed(registerBrowserLinkedinTools),
91
97
  browser_bluesky: registerBlueskyTools,
92
- gsc: registerGscTools,
93
- youtube: registerYoutubeTools,
98
+ gsc: routed(registerGscTools),
99
+ youtube: routed(registerYoutubeTools),
94
100
  discord: registerDiscordTools,
95
101
  whiteboard: registerWhiteboardTools,
96
102
  card: registerCardTools,