synabun 2.0.0-beta → 2.0.5

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 (374) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/NOTICE +5 -0
  3. package/README.md +1 -1
  4. package/THIRD-PARTY-LICENSES.md +51 -0
  5. package/benchmarks/fixtures/browser/README.md +1 -1
  6. package/benchmarks/fixtures/desktop/README.md +1 -1
  7. package/docs/whatsapp.md +2 -2
  8. package/hooks/claude-code/pre-compact.mjs +11 -0
  9. package/hooks/claude-code/prompt-submit.mjs +60 -184
  10. package/hooks/claude-code/session-start.mjs +73 -16
  11. package/hooks/claude-code/shared.mjs +20 -0
  12. package/hooks/claude-code/stop.mjs +5 -5
  13. package/launcher.mjs +40 -0
  14. package/lib/claude-hooks.js +61 -8
  15. package/lib/client-config-repair.js +4 -3
  16. package/lib/data-home-migration.js +4 -0
  17. package/lib/desktop-pwa.js +206 -0
  18. package/lib/external-tools.js +221 -0
  19. package/lib/first-launch-protection.js +5 -0
  20. package/lib/packaged-runtime.js +110 -0
  21. package/lib/start-launcher.js +1396 -0
  22. package/mcp-server/package-lock.json +2 -2
  23. package/mcp-server/package.json +1 -3
  24. package/neural-interface/i18n/en.json +1540 -154
  25. package/neural-interface/i18n/pt-BR.json +1538 -153
  26. package/neural-interface/lib/assistant-api.js +62 -6
  27. package/neural-interface/lib/assistant-brains/claude.js +4 -0
  28. package/neural-interface/lib/assistant-catalog.js +179 -27
  29. package/neural-interface/lib/assistant-config.js +31 -2
  30. package/neural-interface/lib/assistant-dispatch.js +62 -13
  31. package/neural-interface/lib/assistant-envelope.js +9 -6
  32. package/neural-interface/lib/assistant-hidden-models.js +393 -66
  33. package/neural-interface/lib/assistant-memory.js +24 -10
  34. package/neural-interface/lib/assistant-persona.js +6 -2
  35. package/neural-interface/lib/assistant-pricing.js +21 -6
  36. package/neural-interface/lib/assistant-runtime.js +181 -12
  37. package/neural-interface/lib/assistant-task-prompt.js +13 -3
  38. package/neural-interface/lib/assistant-test-density.js +142 -0
  39. package/neural-interface/lib/assistant-user-context-budgets.js +123 -0
  40. package/neural-interface/lib/assistant-user-context.js +908 -0
  41. package/neural-interface/lib/assistant-user-knowledge.js +328 -0
  42. package/neural-interface/lib/assistant-user-learn.js +404 -0
  43. package/neural-interface/lib/assistant-user-threads.js +226 -0
  44. package/neural-interface/lib/assistant-user-writer.js +181 -0
  45. package/neural-interface/lib/augmented-path.js +23 -3
  46. package/neural-interface/lib/browser-background-tab.js +134 -0
  47. package/neural-interface/lib/browser-language.js +83 -0
  48. package/neural-interface/lib/browser-screenshot.js +678 -61
  49. package/neural-interface/lib/claude-agent-bridge.js +87 -153
  50. package/neural-interface/lib/claude-executable.js +241 -0
  51. package/neural-interface/lib/claude-model-catalog.js +82 -93
  52. package/neural-interface/lib/claude-temporary.js +46 -7
  53. package/neural-interface/lib/cloudflared/install.js +533 -0
  54. package/neural-interface/lib/cloudflared/manager.js +545 -0
  55. package/neural-interface/lib/cloudflared/pins.js +115 -0
  56. package/neural-interface/lib/cloudflared/pins.json +63 -0
  57. package/neural-interface/lib/cloudflared/tunnel.js +265 -0
  58. package/neural-interface/lib/editor-completion-endpoint.js +264 -0
  59. package/neural-interface/lib/editor-completion-opencode.js +436 -0
  60. package/neural-interface/lib/editor-completion.js +714 -0
  61. package/neural-interface/lib/editor-config.js +149 -0
  62. package/neural-interface/lib/editor-files-api.js +268 -0
  63. package/neural-interface/lib/editor-git-api.js +134 -0
  64. package/neural-interface/lib/file-explorer-api.js +1039 -0
  65. package/neural-interface/lib/file-explorer-system.js +355 -0
  66. package/neural-interface/lib/file-explorer-trash.ps1 +85 -0
  67. package/neural-interface/lib/file-explorer-watch.js +239 -0
  68. package/neural-interface/lib/git-diff-api.js +103 -0
  69. package/neural-interface/lib/git-read.js +202 -0
  70. package/neural-interface/lib/greeting/api.js +89 -0
  71. package/neural-interface/lib/greeting/budgets.js +90 -0
  72. package/neural-interface/lib/greeting/engine.js +461 -0
  73. package/neural-interface/lib/greeting/facts.js +320 -0
  74. package/neural-interface/lib/greeting/sources.js +252 -0
  75. package/neural-interface/lib/greeting/writer.js +139 -0
  76. package/neural-interface/lib/http-guards.js +189 -13
  77. package/neural-interface/lib/machine-names.js +88 -0
  78. package/neural-interface/lib/memory-api.js +31 -7
  79. package/neural-interface/lib/native-binary-runtime.js +69 -337
  80. package/neural-interface/lib/native-loop-providers.js +40 -49
  81. package/neural-interface/lib/offline-page.js +54 -0
  82. package/neural-interface/lib/plugin-installer.js +4 -2
  83. package/neural-interface/lib/project-storage.js +5 -7
  84. package/neural-interface/lib/request-gate.js +589 -0
  85. package/neural-interface/lib/session-title-generator.js +5 -0
  86. package/neural-interface/lib/synabun-update-plan.js +19 -0
  87. package/neural-interface/lib/ui-blob-api.js +108 -0
  88. package/neural-interface/lib/ui-blob-store.js +68 -0
  89. package/neural-interface/package-lock.json +701 -253
  90. package/neural-interface/package.json +13 -2
  91. package/neural-interface/public/install-app.html +34 -0
  92. package/neural-interface/public/manifest.json +2 -0
  93. package/neural-interface/public/offline.html +402 -66
  94. package/neural-interface/public/onboarding.html +264 -147
  95. package/neural-interface/public/shared/agent-runtime-options.js +22 -6
  96. package/neural-interface/public/shared/assistant/asst-automation.js +286 -0
  97. package/neural-interface/public/shared/assistant/asst-brain-picker.js +312 -62
  98. package/neural-interface/public/shared/assistant/asst-composer.js +11 -1
  99. package/neural-interface/public/shared/assistant/asst-mascot.js +26 -64
  100. package/neural-interface/public/shared/assistant/asst-menu.js +12 -8
  101. package/neural-interface/public/shared/assistant/asst-panel.js +150 -28
  102. package/neural-interface/public/shared/assistant/asst-rack-styles.js +0 -3
  103. package/neural-interface/public/shared/assistant/asst-render.js +219 -67
  104. package/neural-interface/public/shared/assistant/asst-route-models.js +108 -0
  105. package/neural-interface/public/shared/assistant/asst-route.js +23 -329
  106. package/neural-interface/public/shared/assistant/asst-routes-editor.js +495 -0
  107. package/neural-interface/public/shared/assistant/asst-sanitize.js +8 -1
  108. package/neural-interface/public/shared/assistant/asst-sidepanel.js +31 -9
  109. package/neural-interface/public/shared/assistant/asst-state.js +185 -1
  110. package/neural-interface/public/shared/assistant/asst-styles.js +162 -6
  111. package/neural-interface/public/shared/blob-store.js +111 -22
  112. package/neural-interface/public/shared/cdx/cdx-panel.js +32 -11
  113. package/neural-interface/public/shared/cdx/cdx-render.js +25 -89
  114. package/neural-interface/public/shared/cdx/cdx-styles.js +36 -0
  115. package/neural-interface/public/shared/cdx/cdx-tabs.js +87 -4
  116. package/neural-interface/public/shared/command-runner-model.js +30 -0
  117. package/neural-interface/public/shared/constants.js +6 -1
  118. package/neural-interface/public/shared/cp/cp-rehydrate.js +2 -1
  119. package/neural-interface/public/shared/cp/cp-styles.js +15 -0
  120. package/neural-interface/public/shared/editor/editor-ai-logic.js +409 -0
  121. package/neural-interface/public/shared/editor/editor-ai.js +619 -0
  122. package/neural-interface/public/shared/editor/editor-commands.js +212 -0
  123. package/neural-interface/public/shared/editor/editor-compare.js +103 -0
  124. package/neural-interface/public/shared/editor/editor-completion-list.js +172 -0
  125. package/neural-interface/public/shared/editor/editor-doc.js +257 -0
  126. package/neural-interface/public/shared/editor/editor-git-logic.js +131 -0
  127. package/neural-interface/public/shared/editor/editor-git.js +95 -0
  128. package/neural-interface/public/shared/editor/editor-languages.js +156 -0
  129. package/neural-interface/public/shared/editor/editor-lint.js +229 -0
  130. package/neural-interface/public/shared/editor/editor-loader.js +51 -0
  131. package/neural-interface/public/shared/editor/editor-markdown.js +90 -0
  132. package/neural-interface/public/shared/editor/editor-menu.js +233 -0
  133. package/neural-interface/public/shared/editor/editor-minimap.js +371 -0
  134. package/neural-interface/public/shared/editor/editor-palette-logic.js +192 -0
  135. package/neural-interface/public/shared/editor/editor-palette.js +125 -0
  136. package/neural-interface/public/shared/editor/editor-panel-logic.js +288 -0
  137. package/neural-interface/public/shared/editor/editor-panel.js +2099 -0
  138. package/neural-interface/public/shared/editor/editor-prefs.js +224 -0
  139. package/neural-interface/public/shared/editor/editor-safety.js +500 -0
  140. package/neural-interface/public/shared/editor/editor-search.js +352 -0
  141. package/neural-interface/public/shared/editor/editor-statusbar.js +144 -0
  142. package/neural-interface/public/shared/editor/editor-tabs-logic.js +331 -0
  143. package/neural-interface/public/shared/editor/editor-tabs.js +233 -0
  144. package/neural-interface/public/shared/editor/editor-theme.js +244 -0
  145. package/neural-interface/public/shared/editor/editor-view.js +332 -0
  146. package/neural-interface/public/shared/explorer/fx-api.js +216 -0
  147. package/neural-interface/public/shared/explorer/fx-links.js +204 -0
  148. package/neural-interface/public/shared/explorer/fx-logic.js +537 -0
  149. package/neural-interface/public/shared/explorer/fx-main.js +865 -0
  150. package/neural-interface/public/shared/explorer/fx-names.js +87 -0
  151. package/neural-interface/public/shared/explorer/fx-ops.js +370 -0
  152. package/neural-interface/public/shared/explorer/fx-popups.js +490 -0
  153. package/neural-interface/public/shared/explorer/fx-tree.js +790 -0
  154. package/neural-interface/public/shared/file-links.js +339 -0
  155. package/neural-interface/public/shared/greeting/greeting-card.js +178 -0
  156. package/neural-interface/public/shared/greeting/greeting-view.js +148 -0
  157. package/neural-interface/public/shared/html-shell.js +169 -170
  158. package/neural-interface/public/shared/ocp-v2/ocp-v2-childpanel.js +4 -0
  159. package/neural-interface/public/shared/ocp-v2/ocp-v2-greeting.js +47 -0
  160. package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +99 -17
  161. package/neural-interface/public/shared/ocp-v2/ocp-v2-render.js +7 -1
  162. package/neural-interface/public/shared/ocp-v2/ocp-v2-send.js +5 -0
  163. package/neural-interface/public/shared/ocp-v2/ocp-v2-styles.js +40 -0
  164. package/neural-interface/public/shared/ocp-v2/ocp-v2-ws.js +3 -2
  165. package/neural-interface/public/shared/pwa-install-page.js +62 -0
  166. package/neural-interface/public/shared/pwa-install.css +12 -0
  167. package/neural-interface/public/shared/pwa-install.js +127 -0
  168. package/neural-interface/public/shared/settings/settings-code-editor-pane.js +412 -0
  169. package/neural-interface/public/shared/settings/settings-code-editor.js +328 -0
  170. package/neural-interface/public/shared/settings/settings-greeting.js +133 -0
  171. package/neural-interface/public/shared/settings/settings-ia.js +18 -4
  172. package/neural-interface/public/shared/settings/settings-rules.js +160 -0
  173. package/neural-interface/public/shared/settings/settings-user-context.js +154 -0
  174. package/neural-interface/public/shared/start-bridge.js +802 -0
  175. package/neural-interface/public/shared/styleguide/sg-colors.js +5 -2
  176. package/neural-interface/public/shared/styleguide/sg-import-export.js +4 -3
  177. package/neural-interface/public/shared/styleguide/sg-kit.js +4 -1
  178. package/neural-interface/public/shared/styleguide/sg-panel.js +9 -1
  179. package/neural-interface/public/shared/styleguide/sg-typography.js +1 -0
  180. package/neural-interface/public/shared/styles.css +2219 -1117
  181. package/neural-interface/public/shared/synabun-mascot.js +20 -56
  182. package/neural-interface/public/shared/term-ready.js +307 -0
  183. package/neural-interface/public/shared/tunnel-view.js +167 -0
  184. package/neural-interface/public/shared/ui-claude-panel.js +160 -19
  185. package/neural-interface/public/shared/ui-command-runner.js +251 -468
  186. package/neural-interface/public/shared/ui-detail.js +15 -0
  187. package/neural-interface/public/shared/ui-explorer.js +22 -0
  188. package/neural-interface/public/shared/ui-file-explorer.js +481 -2496
  189. package/neural-interface/public/shared/ui-file-links.js +103 -0
  190. package/neural-interface/public/shared/ui-help.js +26 -0
  191. package/neural-interface/public/shared/ui-invite.js +126 -116
  192. package/neural-interface/public/shared/ui-judgments.js +1 -1
  193. package/neural-interface/public/shared/ui-keybinds.js +4 -0
  194. package/neural-interface/public/shared/ui-loading.js +367 -12
  195. package/neural-interface/public/shared/ui-menubar.js +21 -55
  196. package/neural-interface/public/shared/ui-native-loop-router-state.js +11 -0
  197. package/neural-interface/public/shared/ui-native-loop-router.js +15 -2
  198. package/neural-interface/public/shared/ui-navbar.js +45 -21
  199. package/neural-interface/public/shared/ui-settings.js +491 -547
  200. package/neural-interface/public/shared/ui-sidepanel-runtime.js +2 -1
  201. package/neural-interface/public/shared/ui-sync.js +16 -0
  202. package/neural-interface/public/shared/ui-terminal.js +153 -149
  203. package/neural-interface/public/shared/ui-tunnel.js +130 -0
  204. package/neural-interface/public/shared/ui-tutorial-steps.js +6 -2
  205. package/neural-interface/public/shared/ui-whiteboard.js +12 -0
  206. package/neural-interface/public/shared/ui-worker-end.js +245 -0
  207. package/neural-interface/public/shared/ui-workspaces.js +41 -27
  208. package/neural-interface/public/shared/worker-end.js +251 -0
  209. package/neural-interface/public/sw.js +3 -1
  210. package/neural-interface/public/variant/2d/main.js +2 -1
  211. package/neural-interface/public/variant/3d/main.js +2 -1
  212. package/neural-interface/public/vendor/codemirror/chunks/apl-CSDKT72Z.js +1 -0
  213. package/neural-interface/public/vendor/codemirror/chunks/asciiarmor-JYYPU5BM.js +1 -0
  214. package/neural-interface/public/vendor/codemirror/chunks/asn1-NRWCZDA6.js +1 -0
  215. package/neural-interface/public/vendor/codemirror/chunks/asterisk-5OU6D4ZQ.js +1 -0
  216. package/neural-interface/public/vendor/codemirror/chunks/brainfuck-ID4N4SYC.js +1 -0
  217. package/neural-interface/public/vendor/codemirror/chunks/chunk-4RZWGCS2.js +1 -0
  218. package/neural-interface/public/vendor/codemirror/chunks/chunk-ACTJM3JR.js +11 -0
  219. package/neural-interface/public/vendor/codemirror/chunks/chunk-S6BMAXLK.js +1 -0
  220. package/neural-interface/public/vendor/codemirror/chunks/chunk-TO2RDOHQ.js +3 -0
  221. package/neural-interface/public/vendor/codemirror/chunks/chunk-US2GMZZQ.js +13 -0
  222. package/neural-interface/public/vendor/codemirror/chunks/chunk-WYYO5ZAJ.js +1 -0
  223. package/neural-interface/public/vendor/codemirror/chunks/chunk-XALZTDJC.js +1 -0
  224. package/neural-interface/public/vendor/codemirror/chunks/chunk-YRNUTRDV.js +1 -0
  225. package/neural-interface/public/vendor/codemirror/chunks/chunk-Z3QOKH62.js +1 -0
  226. package/neural-interface/public/vendor/codemirror/chunks/clike-OWQBSOGL.js +1 -0
  227. package/neural-interface/public/vendor/codemirror/chunks/clojure-KV75UQWC.js +1 -0
  228. package/neural-interface/public/vendor/codemirror/chunks/cmake-GTEP5Y3C.js +1 -0
  229. package/neural-interface/public/vendor/codemirror/chunks/cobol-WCZ7QEGJ.js +1 -0
  230. package/neural-interface/public/vendor/codemirror/chunks/coffeescript-TGLBOT6B.js +1 -0
  231. package/neural-interface/public/vendor/codemirror/chunks/commonlisp-WVVI432V.js +1 -0
  232. package/neural-interface/public/vendor/codemirror/chunks/crystal-S6R6HLKQ.js +1 -0
  233. package/neural-interface/public/vendor/codemirror/chunks/css-PDA2RINP.js +1 -0
  234. package/neural-interface/public/vendor/codemirror/chunks/cypher-HL5QPL4C.js +1 -0
  235. package/neural-interface/public/vendor/codemirror/chunks/d-HHJH2HAJ.js +1 -0
  236. package/neural-interface/public/vendor/codemirror/chunks/diff-MN3A35BY.js +1 -0
  237. package/neural-interface/public/vendor/codemirror/chunks/dist-25SQLBVS.js +3 -0
  238. package/neural-interface/public/vendor/codemirror/chunks/dist-27ZGGJJS.js +1 -0
  239. package/neural-interface/public/vendor/codemirror/chunks/dist-4E52OJIF.js +1 -0
  240. package/neural-interface/public/vendor/codemirror/chunks/dist-6FT73XDC.js +2 -0
  241. package/neural-interface/public/vendor/codemirror/chunks/dist-BE6YGRMW.js +1 -0
  242. package/neural-interface/public/vendor/codemirror/chunks/dist-CJSGKW2O.js +1 -0
  243. package/neural-interface/public/vendor/codemirror/chunks/dist-CRPH2WLI.js +1 -0
  244. package/neural-interface/public/vendor/codemirror/chunks/dist-CTG7JEQN.js +1 -0
  245. package/neural-interface/public/vendor/codemirror/chunks/dist-I3FEVELX.js +1 -0
  246. package/neural-interface/public/vendor/codemirror/chunks/dist-IM5BBSWZ.js +1 -0
  247. package/neural-interface/public/vendor/codemirror/chunks/dist-KERUKTIF.js +1 -0
  248. package/neural-interface/public/vendor/codemirror/chunks/dist-LXTMWZAM.js +1 -0
  249. package/neural-interface/public/vendor/codemirror/chunks/dist-MABASSET.js +1 -0
  250. package/neural-interface/public/vendor/codemirror/chunks/dist-MJVBUZLL.js +3 -0
  251. package/neural-interface/public/vendor/codemirror/chunks/dist-MNB3WZVU.js +1 -0
  252. package/neural-interface/public/vendor/codemirror/chunks/dist-QYWXOE3U.js +7 -0
  253. package/neural-interface/public/vendor/codemirror/chunks/dist-TEBOFWLZ.js +1 -0
  254. package/neural-interface/public/vendor/codemirror/chunks/dist-UNXFROM3.js +1 -0
  255. package/neural-interface/public/vendor/codemirror/chunks/dist-XL2SLQO6.js +1 -0
  256. package/neural-interface/public/vendor/codemirror/chunks/dist-XO42Y3AP.js +6 -0
  257. package/neural-interface/public/vendor/codemirror/chunks/dist-Y2WWDWJK.js +1 -0
  258. package/neural-interface/public/vendor/codemirror/chunks/dist-YFEZKWMU.js +1 -0
  259. package/neural-interface/public/vendor/codemirror/chunks/dist-ZY7SWQO6.js +1 -0
  260. package/neural-interface/public/vendor/codemirror/chunks/dockerfile-3Y4R4NCH.js +1 -0
  261. package/neural-interface/public/vendor/codemirror/chunks/dtd-5343GJ4P.js +1 -0
  262. package/neural-interface/public/vendor/codemirror/chunks/dylan-FI2CXSW2.js +1 -0
  263. package/neural-interface/public/vendor/codemirror/chunks/ebnf-GNQ77YWA.js +1 -0
  264. package/neural-interface/public/vendor/codemirror/chunks/ecl-MRPUAE2L.js +1 -0
  265. package/neural-interface/public/vendor/codemirror/chunks/eiffel-DZROES27.js +1 -0
  266. package/neural-interface/public/vendor/codemirror/chunks/elm-4KICRFKQ.js +1 -0
  267. package/neural-interface/public/vendor/codemirror/chunks/erlang-3IHYC263.js +1 -0
  268. package/neural-interface/public/vendor/codemirror/chunks/factor-C6D3E5UK.js +1 -0
  269. package/neural-interface/public/vendor/codemirror/chunks/fcl-VYTWUJMI.js +1 -0
  270. package/neural-interface/public/vendor/codemirror/chunks/forth-ZBO2EH5M.js +1 -0
  271. package/neural-interface/public/vendor/codemirror/chunks/fortran-5NDCRWIK.js +1 -0
  272. package/neural-interface/public/vendor/codemirror/chunks/gas-SKRMOXFP.js +1 -0
  273. package/neural-interface/public/vendor/codemirror/chunks/gherkin-L45YXZLW.js +1 -0
  274. package/neural-interface/public/vendor/codemirror/chunks/groovy-GLPTLN44.js +1 -0
  275. package/neural-interface/public/vendor/codemirror/chunks/haskell-E7NF7P4Y.js +1 -0
  276. package/neural-interface/public/vendor/codemirror/chunks/haxe-K2NVDOB6.js +1 -0
  277. package/neural-interface/public/vendor/codemirror/chunks/http-Q6DRQIJB.js +1 -0
  278. package/neural-interface/public/vendor/codemirror/chunks/idl-MZYNJVLN.js +1 -0
  279. package/neural-interface/public/vendor/codemirror/chunks/javascript-6YRYK2HR.js +1 -0
  280. package/neural-interface/public/vendor/codemirror/chunks/julia-HXEL2T5G.js +1 -0
  281. package/neural-interface/public/vendor/codemirror/chunks/livescript-MV7CI2JZ.js +1 -0
  282. package/neural-interface/public/vendor/codemirror/chunks/lua-E36NHOOD.js +1 -0
  283. package/neural-interface/public/vendor/codemirror/chunks/mathematica-3XOZZCMC.js +1 -0
  284. package/neural-interface/public/vendor/codemirror/chunks/mbox-ODYGFKS7.js +1 -0
  285. package/neural-interface/public/vendor/codemirror/chunks/mirc-WB43AWF5.js +1 -0
  286. package/neural-interface/public/vendor/codemirror/chunks/mllike-ZT6ET7ZH.js +1 -0
  287. package/neural-interface/public/vendor/codemirror/chunks/modelica-LLMZPFGA.js +1 -0
  288. package/neural-interface/public/vendor/codemirror/chunks/mscgen-2OPNNYFH.js +1 -0
  289. package/neural-interface/public/vendor/codemirror/chunks/mumps-6P3HWJH6.js +1 -0
  290. package/neural-interface/public/vendor/codemirror/chunks/nginx-TCGKQTRW.js +1 -0
  291. package/neural-interface/public/vendor/codemirror/chunks/nsis-ATIGIXTJ.js +1 -0
  292. package/neural-interface/public/vendor/codemirror/chunks/ntriples-5PLBI5OV.js +1 -0
  293. package/neural-interface/public/vendor/codemirror/chunks/octave-QF2S3NL6.js +1 -0
  294. package/neural-interface/public/vendor/codemirror/chunks/oz-JFIVFFH2.js +1 -0
  295. package/neural-interface/public/vendor/codemirror/chunks/pascal-JG6SW76V.js +1 -0
  296. package/neural-interface/public/vendor/codemirror/chunks/perl-4B3IWVVO.js +1 -0
  297. package/neural-interface/public/vendor/codemirror/chunks/pig-ABEBH4MI.js +1 -0
  298. package/neural-interface/public/vendor/codemirror/chunks/powershell-H32XE7TL.js +1 -0
  299. package/neural-interface/public/vendor/codemirror/chunks/properties-NN644MMA.js +1 -0
  300. package/neural-interface/public/vendor/codemirror/chunks/protobuf-YKWQK2J3.js +1 -0
  301. package/neural-interface/public/vendor/codemirror/chunks/pug-RIYXEKFW.js +1 -0
  302. package/neural-interface/public/vendor/codemirror/chunks/puppet-JZQ5WPEV.js +1 -0
  303. package/neural-interface/public/vendor/codemirror/chunks/python-EBCGGHAC.js +1 -0
  304. package/neural-interface/public/vendor/codemirror/chunks/q-5UMH2YQY.js +1 -0
  305. package/neural-interface/public/vendor/codemirror/chunks/r-7XMGG453.js +1 -0
  306. package/neural-interface/public/vendor/codemirror/chunks/rpm-IEV7TSLR.js +1 -0
  307. package/neural-interface/public/vendor/codemirror/chunks/ruby-T4SPFPNM.js +1 -0
  308. package/neural-interface/public/vendor/codemirror/chunks/sas-GEDX67ET.js +1 -0
  309. package/neural-interface/public/vendor/codemirror/chunks/scheme-FTLOWKPC.js +1 -0
  310. package/neural-interface/public/vendor/codemirror/chunks/shell-HUFRKFSJ.js +1 -0
  311. package/neural-interface/public/vendor/codemirror/chunks/sieve-P5QUDVYO.js +1 -0
  312. package/neural-interface/public/vendor/codemirror/chunks/smalltalk-2SORJNQI.js +1 -0
  313. package/neural-interface/public/vendor/codemirror/chunks/solr-M22TGAR5.js +1 -0
  314. package/neural-interface/public/vendor/codemirror/chunks/sparql-4M3KL752.js +1 -0
  315. package/neural-interface/public/vendor/codemirror/chunks/spreadsheet-3K23LA4N.js +1 -0
  316. package/neural-interface/public/vendor/codemirror/chunks/sql-VHRFMUBI.js +1 -0
  317. package/neural-interface/public/vendor/codemirror/chunks/stex-QZDAQUY2.js +1 -0
  318. package/neural-interface/public/vendor/codemirror/chunks/stylus-7ZDKAKBD.js +1 -0
  319. package/neural-interface/public/vendor/codemirror/chunks/swift-WCLCLGMR.js +1 -0
  320. package/neural-interface/public/vendor/codemirror/chunks/tcl-JLMU6WOK.js +1 -0
  321. package/neural-interface/public/vendor/codemirror/chunks/textile-4CHDKZ4T.js +1 -0
  322. package/neural-interface/public/vendor/codemirror/chunks/tiddlywiki-DKMCZZQ4.js +1 -0
  323. package/neural-interface/public/vendor/codemirror/chunks/tiki-F4JIG36Q.js +1 -0
  324. package/neural-interface/public/vendor/codemirror/chunks/toml-BHMHTIM2.js +1 -0
  325. package/neural-interface/public/vendor/codemirror/chunks/troff-YQ2KV5NT.js +1 -0
  326. package/neural-interface/public/vendor/codemirror/chunks/ttcn-ZHRCVFJY.js +1 -0
  327. package/neural-interface/public/vendor/codemirror/chunks/ttcn-cfg-KJOVTY4X.js +1 -0
  328. package/neural-interface/public/vendor/codemirror/chunks/turtle-535P5N6I.js +1 -0
  329. package/neural-interface/public/vendor/codemirror/chunks/vb-76UMQHOT.js +1 -0
  330. package/neural-interface/public/vendor/codemirror/chunks/vbscript-CGNDTK6Z.js +1 -0
  331. package/neural-interface/public/vendor/codemirror/chunks/velocity-VSJDO5T5.js +1 -0
  332. package/neural-interface/public/vendor/codemirror/chunks/verilog-4T6ETXIP.js +1 -0
  333. package/neural-interface/public/vendor/codemirror/chunks/vhdl-T7FNAXUN.js +1 -0
  334. package/neural-interface/public/vendor/codemirror/chunks/webidl-P6MJSJ6J.js +1 -0
  335. package/neural-interface/public/vendor/codemirror/chunks/xquery-UOVILRGN.js +1 -0
  336. package/neural-interface/public/vendor/codemirror/chunks/yacas-CV2APROL.js +1 -0
  337. package/neural-interface/public/vendor/codemirror/chunks/z80-3KFNVM4M.js +1 -0
  338. package/neural-interface/public/vendor/codemirror/codemirror-6.43.14-75f05e67.min.js +2 -0
  339. package/neural-interface/public/vendor/codemirror/manifest.json +60 -0
  340. package/neural-interface/scripts/build-vendor.mjs +78 -2
  341. package/neural-interface/scripts/rebuild-pty.js +15 -12
  342. package/neural-interface/scripts/vendor-codemirror-entry.js +121 -0
  343. package/neural-interface/server.js +1092 -1212
  344. package/neural-interface/templates/rulesets/README.md +1 -1
  345. package/package.json +13 -7
  346. package/postinstall.js +11 -81
  347. package/setup.js +111 -6
  348. package/benchmarks/browser-live-results.json +0 -79
  349. package/benchmarks/browser-v2-results.json +0 -258
  350. package/docs/browser-v2.md +0 -109
  351. package/docs/hook-integrity.md +0 -89
  352. package/docs/judgments.md +0 -182
  353. package/docs/style-guide.md +0 -246
  354. package/neural-interface/lib/codex-capabilities.d.ts +0 -41
  355. package/neural-interface/public/category-logos/claude.svg +0 -1
  356. package/neural-interface/public/category-logos/gemini-color.svg +0 -1
  357. package/neural-interface/public/category-logos/openai.svg +0 -1
  358. package/neural-interface/public/category-logos/synabun.png +0 -0
  359. package/neural-interface/public/claude.svg +0 -1
  360. package/neural-interface/public/gallery.svg +0 -6
  361. package/neural-interface/public/leonardoai.svg +0 -1
  362. package/neural-interface/public/mcp.svg +0 -4
  363. package/neural-interface/public/opencode-logo-dark-square.svg +0 -1
  364. package/neural-interface/public/pin-svgrepo-com.svg +0 -25
  365. package/neural-interface/public/sessionicon.svg +0 -8
  366. package/neural-interface/public/toolbar-album.svg +0 -8
  367. package/neural-interface/public/toolbar-question.svg +0 -6
  368. package/neural-interface/public/toolbar-sessions.svg +0 -6
  369. package/neural-interface/scripts/codex-protocol-fixture.mjs +0 -83
  370. package/scripts/audit-claude-hook-usage.mjs +0 -12
  371. package/scripts/audit-memory-duplicates.mjs +0 -44
  372. package/scripts/measure-claude-hook-overhead.mjs +0 -77
  373. package/scripts/recover-user-config.mjs +0 -254
  374. package/skills/synabun/synabunicon.png +0 -0
@@ -1,258 +0,0 @@
1
- {
2
- "generatedAt": "2026-09-08T03:42:40.330Z",
3
- "runsPerVariant": 20,
4
- "coldLaunchMs": 139.725417,
5
- "benchmarkType": "local browser components; not full MCP/provider end-to-end",
6
- "comparison": "Same required task data. Legacy performance path versus V2; article adds explicit selector, extraction adds explicit field projection. Both snapshot paths include correctness fixes.",
7
- "limitations": [
8
- "Intentional social write spacing excluded; no real publishing.",
9
- "HTTP counts derived from component algorithm, not measured network requests.",
10
- "Text token counts are character estimates, not provider usage.",
11
- "Fixture results alone do not authorize default rollout or establish real-site accuracy."
12
- ],
13
- "processingReduction": 0.7819843114275185,
14
- "estimatedTokenReduction": 0.23104780299372285,
15
- "satisfiesOriginalOutputTokenTarget": false,
16
- "results": [
17
- {
18
- "name": "article",
19
- "group": "general",
20
- "cold": {
21
- "legacy": {
22
- "durationMs": 29.35145799999998,
23
- "bytes": 102,
24
- "estimatedTokens": 26,
25
- "captures": 0,
26
- "componentHttpCalls": 1,
27
- "success": true
28
- },
29
- "improved": {
30
- "durationMs": 4.151542000000006,
31
- "bytes": 102,
32
- "estimatedTokens": 26,
33
- "captures": 0,
34
- "componentHttpCalls": 1,
35
- "success": true
36
- }
37
- },
38
- "legacy": {
39
- "medianMs": 1.4932909999999993,
40
- "p95Ms": 3.069416999999987,
41
- "medianEstimatedTokens": 26,
42
- "medianBytes": 102,
43
- "medianCaptures": 0,
44
- "medianComponentHttpCalls": 1,
45
- "successful": 20
46
- },
47
- "improved": {
48
- "medianMs": 1.8262080000000083,
49
- "p95Ms": 2.4752920000000245,
50
- "medianEstimatedTokens": 26,
51
- "medianBytes": 102,
52
- "medianCaptures": 0,
53
- "medianComponentHttpCalls": 1,
54
- "successful": 20
55
- }
56
- },
57
- {
58
- "name": "search",
59
- "group": "general",
60
- "cold": {
61
- "legacy": {
62
- "durationMs": 52.18983400000002,
63
- "bytes": 5927,
64
- "estimatedTokens": 1482,
65
- "captures": 4,
66
- "componentHttpCalls": 1,
67
- "success": true
68
- },
69
- "improved": {
70
- "durationMs": 21.844041999999945,
71
- "bytes": 5968,
72
- "estimatedTokens": 1492,
73
- "captures": 2,
74
- "componentHttpCalls": 1,
75
- "success": true
76
- }
77
- },
78
- "legacy": {
79
- "medianMs": 41.34229200000004,
80
- "p95Ms": 48.7930409999999,
81
- "medianEstimatedTokens": 1491,
82
- "medianBytes": 5962,
83
- "medianCaptures": 4,
84
- "medianComponentHttpCalls": 1,
85
- "successful": 20
86
- },
87
- "improved": {
88
- "medianMs": 21.11720800000012,
89
- "p95Ms": 27.33666600000015,
90
- "medianEstimatedTokens": 1491,
91
- "medianBytes": 5962,
92
- "medianCaptures": 2,
93
- "medianComponentHttpCalls": 1,
94
- "successful": 20
95
- }
96
- },
97
- {
98
- "name": "dynamic-form",
99
- "group": "general",
100
- "cold": {
101
- "legacy": {
102
- "durationMs": 128.6755830000002,
103
- "bytes": 200,
104
- "estimatedTokens": 50,
105
- "captures": 1,
106
- "componentHttpCalls": 1,
107
- "success": true
108
- },
109
- "improved": {
110
- "durationMs": 101.52687500000002,
111
- "bytes": 200,
112
- "estimatedTokens": 50,
113
- "captures": 1,
114
- "componentHttpCalls": 1,
115
- "success": true
116
- }
117
- },
118
- "legacy": {
119
- "medianMs": 99.1424590000006,
120
- "p95Ms": 99.58995899999991,
121
- "medianEstimatedTokens": 50,
122
- "medianBytes": 200,
123
- "medianCaptures": 1,
124
- "medianComponentHttpCalls": 1,
125
- "successful": 20
126
- },
127
- "improved": {
128
- "medianMs": 99.46520800000008,
129
- "p95Ms": 115.59787500000039,
130
- "medianEstimatedTokens": 50,
131
- "medianBytes": 200,
132
- "medianCaptures": 1,
133
- "medianComponentHttpCalls": 1,
134
- "successful": 20
135
- }
136
- },
137
- {
138
- "name": "feed",
139
- "group": "social",
140
- "cold": {
141
- "legacy": {
142
- "durationMs": 74.53483299999971,
143
- "bytes": 5982,
144
- "estimatedTokens": 1496,
145
- "captures": 4,
146
- "componentHttpCalls": 1,
147
- "success": true
148
- },
149
- "improved": {
150
- "durationMs": 34.15445799999998,
151
- "bytes": 5982,
152
- "estimatedTokens": 1496,
153
- "captures": 2,
154
- "componentHttpCalls": 1,
155
- "success": true
156
- }
157
- },
158
- "legacy": {
159
- "medianMs": 48.56779099999949,
160
- "p95Ms": 69.0288330000003,
161
- "medianEstimatedTokens": 1496,
162
- "medianBytes": 5982,
163
- "medianCaptures": 4,
164
- "medianComponentHttpCalls": 1,
165
- "successful": 20
166
- },
167
- "improved": {
168
- "medianMs": 25.403291999999965,
169
- "p95Ms": 42.17279100000087,
170
- "medianEstimatedTokens": 1496,
171
- "medianBytes": 5982,
172
- "medianCaptures": 2,
173
- "medianComponentHttpCalls": 1,
174
- "successful": 20
175
- }
176
- },
177
- {
178
- "name": "composer",
179
- "group": "social",
180
- "cold": {
181
- "legacy": {
182
- "durationMs": 110.75312499999927,
183
- "bytes": 206,
184
- "estimatedTokens": 52,
185
- "captures": 1,
186
- "componentHttpCalls": 1,
187
- "success": true
188
- },
189
- "improved": {
190
- "durationMs": 96.46404099999927,
191
- "bytes": 206,
192
- "estimatedTokens": 52,
193
- "captures": 1,
194
- "componentHttpCalls": 1,
195
- "success": true
196
- }
197
- },
198
- "legacy": {
199
- "medianMs": 99.20062499999949,
200
- "p95Ms": 100.52170800000022,
201
- "medianEstimatedTokens": 52,
202
- "medianBytes": 206,
203
- "medianCaptures": 1,
204
- "medianComponentHttpCalls": 1,
205
- "successful": 20
206
- },
207
- "improved": {
208
- "medianMs": 99.04683299999851,
209
- "p95Ms": 100.07870899999944,
210
- "medianEstimatedTokens": 52,
211
- "medianBytes": 206,
212
- "medianCaptures": 1,
213
- "medianComponentHttpCalls": 1,
214
- "successful": 20
215
- }
216
- },
217
- {
218
- "name": "virtualized-feed",
219
- "group": "social",
220
- "cold": {
221
- "legacy": {
222
- "durationMs": 1812.5526250000003,
223
- "bytes": 4105,
224
- "estimatedTokens": 1027,
225
- "captures": 0,
226
- "componentHttpCalls": 5,
227
- "success": true
228
- },
229
- "improved": {
230
- "durationMs": 210.59279200000128,
231
- "bytes": 277,
232
- "estimatedTokens": 70,
233
- "captures": 0,
234
- "componentHttpCalls": 1,
235
- "success": true
236
- }
237
- },
238
- "legacy": {
239
- "medianMs": 1805.112334000005,
240
- "p95Ms": 1811.6639170000053,
241
- "medianEstimatedTokens": 1027,
242
- "medianBytes": 4105,
243
- "medianCaptures": 0,
244
- "medianComponentHttpCalls": 5,
245
- "successful": 20
246
- },
247
- "improved": {
248
- "medianMs": 209.8533329999991,
249
- "p95Ms": 213.98037499999919,
250
- "medianEstimatedTokens": 70,
251
- "medianBytes": 277,
252
- "medianCaptures": 0,
253
- "medianComponentHttpCalls": 1,
254
- "successful": 20
255
- }
256
- }
257
- ]
258
- }
@@ -1,109 +0,0 @@
1
- # Browser execution and efficiency
2
-
3
- SynaBun still uses its configured browser and the existing MCP tools. This change fixes action correctness and enables the faster browser path by default in version **2.0.0**, for general browsing and social automations.
4
-
5
- ## Rollout
6
-
7
- Correctness fixes apply after the updated Neural Interface and MCP processes restart: compatible delivered snapshot baselines, cancellation/deadline handling, ref-aware publishing guards, caller/tab ownership checks, and protection against selectors changing targets during pacing.
8
-
9
- Performance changes are **on by default**; no opt-in variable is needed. After the updated Neural Interface and MCP processes restart, this enables bounded automatic snapshot capture, cached session routing, server-side paged extraction, omission of non-writing think pauses, and registration of `browser_batch`. Leave existing `SYNABUN_BROWSER_FAST`, `SYNABUN_BROWSER_COMPACT` and `SYNABUN_BROWSER_AUTOSNAPSHOT` settings as they are.
10
-
11
- For rollback, set `SYNABUN_BROWSER_V2=0` in the environment used by **both Neural Interface and its MCP processes**, then restart them normally. Remove that override to return to the new default. Correctness fixes remain enabled. No database migration or saved automation rewrite is required. This implementation does not change the running service's environment or restart active automations.
12
-
13
- Social engagement writes retain the existing randomized 30–90-second spacing, serialized within each browser session. It applies to the resolved target whether the caller uses refs or selectors. A blocked preflight does not consume a write slot; an attempted write with an uncertain outcome does. Typing cadence is preserved.
14
-
15
- ## Interfaces and workflow
16
-
17
- - `browser_snapshot` accepts optional `baselineId` and returns a compact snapshot ID. A diff requires a compatible delivered observation from the same caller, page generation, scope, depth settings and budget. Removals are explicit. `force:true` requests a full view. Aborted requests never establish a baseline.
18
- - Navigation, click and scroll observations use the same budget at capture and formatting. Click defaults to 6,000 characters; navigation and scroll use 12,000; explicit snapshots retain 30,000. Truncation ends at complete lines. V2 automatic captures start at depth 12 and make at most one shallower retry; callers can override depth or scope to inspect deeper controls.
19
- - Playwright refs identify elements in its latest captured scope. A scoped snapshot can remove previously observed refs from that map. Re-snapshot when a ref is stale; do not assume every previously returned ref remains usable after another capture.
20
- - Paged `browser_extract_*` tools accept optional `fields` and `maxChars`. Identity deduplication occurs before projection; repeated identities update their fields. Results report stopping reasons and partial failures. Known loading states must finish before newly discovered items are accepted. FB group classification occurs before field projection.
21
- - `browser_content` accepts `selector` for one element's subtree with plain text or Markdown. Existing offsets and budgets remain supported. Missing/ambiguous scopes return an error. Relative source links are made absolute, and extraction does not modify the live DOM.
22
- - `browser_batch` accepts 1–10 `{tool,args,observe?}` steps, one `sessionId`/`tabId`, and final `snapshot:full|diff|none` (default `full`). It invokes the existing guarded tool handlers sequentially, validates every step before acting, and returns completed outcomes if a later step fails. Steps cannot change routing or use arbitrary evaluation.
23
-
24
- ### MoreLogin as the default browser
25
-
26
- While Browser Settings name MoreLogin as the default (`connectMode: "morelogin"`), every loop, schedule, dispatched run, recovery and interactive acquisition drives the default MoreLogin profile (`moreloginEnvId`). Reuse and a caller-requested session count only when the session is MoreLogin on that exact env. If MoreLogin cannot be reached after the auto-launch wait, the run fails and its log, `lastRunResult` and the `schedule:failed` toast carry the reason (`Could not start the shared browser session: MoreLogin connect failed: …`). Nothing falls back to Chrome.
27
-
28
- The server decides which session may carry pages. `GET /api/browser/sessions` reports `servesDefault` per session and `defaultBrowser` for the list: with MoreLogin as the default only a MoreLogin session on the default env serves it; in managed and real-Chrome setups every session does, so nothing changes there. The MCP requires `servesDefault` for every page tool (navigations, localhost included, platform tools, screenshots, snapshots, content, console, clicks, typing, batches) and a run's pinned browser. A pinned session that does not serve the default fails the call with the reason. Navigations and platform tools drop an explicit id that does not serve it, then resolve the default browser; any other page tool refuses it (`Browser session <id> is not the default browser (…), so SynaBun's browser tools do not act on it`), since the page it names is in the other browser. The server holds the same line at its REST boundary: an agent request (one that carries `X-Synabun-Terminal`, as every MCP call does) on a session that does not serve the default is refused with 409 `NOT_DEFAULT_BROWSER` before anything runs, for any page action, a new tab or CDP; closing the session or a tab and listing its tabs stay allowed, and the Neural Interface's own UI (no header) keeps working with any session. Every `/api/browser` response names the default browser in `X-Synabun-Browser-Default` (`morelogin:<env>`, `other:<mode>`, or `unreadable`), and the MCP keys its route caches on it, so a change of connect mode or MoreLogin env drops every cached route; the in-process MCP is told the moment the settings are saved, and a `NOT_DEFAULT_BROWSER` refusal also forgets the caller's cached route and tab. Affinity, auto-selection and adoption skip it. When Browser V2 recovery of a cached route fails, the action returns the recovery's own reason (for example `MoreLogin connect failed: …`) with `recoveryFailed: true`, not a bare "Session not found".
29
-
30
- `bluesky_*` tools renew an expired access token themselves. They wait for bsky.app to refresh it (a freshly initialized tab is still booting), then reload the assigned bsky.app tab at most once. "Not logged in" is reported only when the page holds no session. A token the server still rejects gets one renewal and one re-run, and only when nothing was written yet. The whole call has one 48 s deadline, under the roughly 60 s tool limit of OpenCode and Codex. Finding and opening the tab, the token checks, the reload and image uploads must end 12 s before it, so the request itself always has time. A step that runs out of time returns a clear error. A request that doesn't answer in time is reported as possibly finished (check before repeating) and is never retried.
31
-
32
- #### Localhost in MoreLogin
33
-
34
- Localhost pages open in the MoreLogin profile like any other page; nothing reroutes them to another browser. MoreLogin's per-profile **Port scan protection** decides which local ports load: a port listed under Edit profile → Advanced settings → Port scan protection (allowed ports, read when the profile starts) loads normally, and any other local port is redirected to `getip.morelogin.com/black_whiteList_stop_page_v2.html?blockedUrl=<url>`. Keep protection on and list the dev-server ports (P-1 allows 3344, 3100, 3210, 3917, 9003 and 9017), then restart the profile. A blocked navigation, back, forward or click fails with `moreLoginBlocked: true` and the stop page's URL, and, for a local port, the error is `MoreLogin blocked localhost:<port>. Most likely the profile's Port scan protection: add <port> to its Advanced settings → Port scan protection allowed ports in MoreLogin. If a URL Access Restriction in MoreLogin's Security Center blocks localhost, remove localhost from that block policy. Then restart the profile.` (other hosts keep the website-whitelist message). A session created at a blocked URL is still created and says so (`moreLoginBlocked`, `notice`). `/api/morelogin/status` counts observed blocks (`blockedNavigations`, `lastBlockedUrl`). The earlier loopback sidecar (system Google Chrome on the leftover `userDataDir`), its page-level handoff and `LOOPBACK_ONLY_SESSION` are gone.
35
-
36
- #### Screenshots for visual QA
37
-
38
- `browser_screenshot` (`GET /api/browser/sessions/:id/screenshot-base64`, `lib/browser-screenshot.js`) returns the tab as an image, localhost included. Without options it is the viewport as JPEG (quality 60), downscaled to `maxWidth` (default 1024 px of real pixels; `0` = native resolution). Options:
39
-
40
- - `width` / `height` (100–4096 CSS px): the viewport for this capture only, as a CDP `Emulation.setDeviceMetricsOverride` (`deviceScaleFactor: 1`, `mobile` below 768 px) sent from a CDP session opened for the capture. Chromium keeps one override per page and a detach alone leaves it in place, so it is always cleared with `Emulation.clearDeviceMetricsOverride`, on errors and timeouts too, and then confirmed: the tab's `innerWidth` and `devicePixelRatio` must equal what they were before the capture. A clear that fails, hangs (2 s) or does not take is sent once more from a fresh CDP session, which first sets an empty override (0 width, height and scale), because Chromium ignores a clear from a session that never set one. A tab still not confirmed is closed (its session's other tabs stay; the only tab's page is closed and the next call opens a fresh one) and the result says so (`tabClosed: true` and a `notice`, or the notice appended to the error), so a MoreLogin tab never keeps a window size, DPR or mobile flag its profile does not have.
41
- - `fullPage`: the whole document (`captureBeyondViewport`, up to 16384 px; longer pages report `truncated`).
42
- - `format` (`png` | `jpeg`): the returned image is a JPEG unless PNG is asked for; a saved file is a PNG unless JPEG is asked for (saved JPEG quality 90).
43
- - `save` / `path`: also write the full-resolution image and return `savedPath`. The default file is `~/.synabun/data/media/screenshots/<yyyy-mm-dd>/<host>-<width>x<height>-<hhmmss>.png` (never an existing file). An explicit `path` must be absolute, end in .png, .jpg or .jpeg, and lie inside a registered project (`claude-code-projects.json`, never one at or above the home folder) or the screenshots folder, resolved through symlinks; parent folders are created, and only an existing PNG or JPEG is ever replaced. The file is checked again as it is written (a capture can take up to a minute): the parent's real path must still lie inside those folders, a symlink or a non-image at the name is refused, the bytes go to a temp file created `O_CREAT | O_EXCL | O_NOFOLLOW` in that real folder, the folder's real path is read again, and a rename puts it in place (a rename replaces a symlink, it never follows one). `savedPath` is the real path written.
44
-
45
- The returned image never exceeds 7900 px on a side. Its size is measured from a small capture of the same CDP session, not taken from the page's `devicePixelRatio` (a fingerprint value in MoreLogin). The MCP client waits the long timeout (30 s) for it. A saving screenshot is not a read-only call for plan mode and remote read-only sessions (`lib/assistant-plan-permissions.js`).
46
-
47
- #### Console and page errors
48
-
49
- `browser_console` (`GET /api/browser/sessions/:id/console?tabId=&level=&since=&limit=&clear=`, `lib/browser-console.js`) reads a per-page ring buffer of the last 200 console messages (`{ kind: "console", level, type, text, location, at }`, network errors such as a 404 script included) and uncaught page errors (`{ kind: "pageerror", level: "error", message, stack, at }`). The buffer is attached before the first navigation of every tab SynaBun registers (a new session, MoreLogin attach included, a new tab, a recovered tab) and follows their popups; attaching twice is a no-op. A popup is not a tab of its session, so its entries come back with the tab that opened it, each with `popup: <the popup's URL at the time>` and in the order they happened (the last 5 popups of a tab, popups of popups too; `popups` counts them, and `clear` empties them with the tab). The MCP shows them as `[popup <url>]`. `level` (`all` | `error` | `warning` | `info` | `log`) keeps that level and the more severe ones; `since` (ISO or epoch ms, e.g. the `latest` of the previous read) keeps newer entries; `limit` (1–200, default 50) returns the newest matches; `clear` empties the buffer after reading. The console arguments' JS handles are released as each message arrives, so a chatty page pins nothing. A tab registered before the buffer existed starts recording on its first read (`attached: false`).
50
-
51
- #### Browser settings file
52
-
53
- `browser-config.json` is written atomically (a temp file renamed over it). `loadBrowserConfig()` keeps the text of the last good read or write: when the file is torn, unparsable or not a JSON object it returns that config (logging a warning once per failure streak, then at most once a minute) instead of `{}`, which used to switch MoreLogin mode off for whatever read it at that moment. A missing file is `{}` (the defaults). A file that exists but has never been read well (no earlier good config) is not treated as unconfigured: `loadBrowserConfig()` returns `{}` marked unreadable, `createBrowserSession` refuses with `browser-config.json is unreadable; fix it in Settings → Browser (<reason>)` instead of taking the Chrome path, `GET /api/browser/config` adds `configError`, and saving the settings in Settings → Browser replaces the file.
54
-
55
- ### Jev assistance (advisory)
56
-
57
- Three TypeSafe surfaces (`browser-page-state`, `browser-target`, `browser-social`; full contract in `docs/judgments.md`) add a typed reading of the page to the tools above. It is text only, bounded, and never part of the control flow: with TypeSafe off, a surface off, a timeout or a rate limit, every tool answers exactly as it did before.
58
-
59
- - `browser_navigate` accepts optional `intent`. One line may follow the snapshot: `Jev assessment: authentication_required (94%) — pause for human sign-in`. A blocker (`authentication_required`, `verification_required`, `consent_blocker`) means stop and hand over to the human; `loading` means wait and inspect again; a consent dialog is never dismissed automatically. With an `intent`, the line also says whether the page already satisfies it.
60
- - `browser_snapshot` accepts optional `intent` in AI mode and may append `Jev target: ref e12 "Account settings" (choice 91%, match 96%); alternatives: e15, e31`, or `no candidate qualified`. The refs come from the same capture that was delivered, so the recommendation is a fresh ref. It never executes.
61
- - A failed or ambiguous `browser_click`, `browser_fill`, `browser_type`, `browser_hover`, `browser_select` or `browser_upload` (the last two now accept `textHint`) returns its usual hints, reordered and annotated with each candidate's risk class when Jev found a confident match. Shadow mode sends no second request: the caller decides and acts with a new call.
62
- - An empty social extractor keeps its message verbatim as the first line and appends a diagnosis: genuinely empty, still loading, wrong surface, sign-in, verification, consent, or a rendered error. Populated output is byte-identical.
63
- - `browser_fb_composer_state` and `browser_x_compose_state` add a `judgment` key only when the probe itself is ambiguous. `recommendedAction`, `boostRisk` and the locale lists stay authoritative; a suggested control is a suggestion, and Boost / Promote controls are removed before Jev sees the options.
64
- - Inside `browser_batch` there is no assistance at all. A batch that navigated gets one `assessment` of its final page after it ends; steps are never added, replaced or replayed.
65
-
66
- **The one-retry invariant.** Safe auto-heal is off and locked until the browser benchmark passes for the exact running configuration (Settings → AI decisions → Browser assistance). When armed it permits exactly one retry, only for `browser_click`, only when the selector matched nothing or failed to parse, and only onto a plain same-origin navigation link that the server re-verifies on the element it is about to click. It never follows `actionStarted:true`, an uncertain outcome, a transport error, a cancellation or a guard; it never types, submits, publishes, likes, follows, pays, uploads or changes a toggle; a refused, failed or uncertain heal is final. A healed click says so in its result, `(auto-healed via Jev to "Pricing": choice 93%, match 97%; selector … matched nothing)`, and the route's body carries `autoHealed:true`.
67
-
68
- Page text is adversarial data. It reaches Jev only as `state`, never inside an instruction, and a control whose label addresses the agent disqualifies the whole page from healing.
69
-
70
- Use extraction for data and scoped snapshots for interaction. Choose fields needed by the task instead of returning avatars/media URLs by default. Use a batch only when the selectors and sequence are already known; otherwise inspect between actions. A local form example, after observing its selectors:
71
-
72
- ```json
73
- {
74
- "steps": [
75
- {"tool":"browser_fill","args":{"selector":"#email","value":"fixture@example.invalid"}},
76
- {"tool":"browser_click","args":{"selector":"#save"}}
77
- ]
78
- }
79
- ```
80
-
81
- Tool names inside batches are the unprefixed names shown above. Call the batch itself using the exact host-provided MCP name. Host cancellation stops pending HTTP calls and prevents subsequent batch steps. Never replay a whole batch or an uncertain click; inspect the current state first.
82
-
83
- ## Metrics and measurements
84
-
85
- Set `SYNABUN_BROWSER_METRICS=1` on the same processes for diagnostic JSON on stderr. Client and server correlate with `X-Synabun-Request-Id` and share an absolute `X-Synabun-Deadline`. Records contain timings, operation names, response sizes and estimated tokens, without URLs, page text, selectors, scripts, form values or credentials. Intentional pacing is reported separately from processing. Metrics are disabled by default.
86
-
87
- The local benchmark behind these numbers uses isolated Chromium fixtures, no user profiles or external requests, alternates variant order, and runs at least 20 samples per variant for articles, search, dynamic forms, feeds, composers and virtualized extraction. Its report holds cold startup and per-scenario median/p95 processing time, required-data assertions, captures, response bytes and text-token estimates: [browser-v2-results.json](../benchmarks/browser-v2-results.json).
88
-
89
- The final measured run reduced the sum of scenario median processing times by about **78%**, and estimated output text tokens by **23%**. The largest change was virtualized extraction (about 1.8 seconds to 0.2 seconds for three items). Dense snapshots went from four captures to two. All required fixture data was retained. Optional field projection accounts for the measured output-token saving; it is not an automatic saving on every call.
90
-
91
- Deferred full-profile server instructions use concise capability summaries instead of repeating the entire tool catalog: **5,289 → 3,219 characters**, approximately **39% less instruction text** (~1,323 → ~805 estimated tokens). Legacy profiled-host instructions remain identical. This separate instruction measurement is not included in the 23% response-token result, and does not measure provider billing or how frequently a particular host injects instructions.
92
-
93
- These are component measurements, not full MCP/provider automation measurements. HTTP call counts in this fixture report are derived from the implementation, not network instrumentation. Deliberate social write delays and model reasoning time are excluded. Estimates are not provider-billed tokens. The provisional 30% output-token target remains an optimization goal rather than a release blocker. The measured processing and instruction reductions, full automated suites, and read-only real-page checks support the default rollout with an explicit rollback switch. Live checks exercise the updated algorithms through an adapter to the configured SynaBun browser; changed route wiring and mutating actions are verified separately using local Express/Chromium fixtures. They do not establish real-site publishing success, and no live posting is used for validation.
94
-
95
- ## Validation
96
-
97
- The figures below are from the validation run of this change in September 2026. The suites that ship with 2.0.0 are larger.
98
-
99
- - Complete Node suite: **520 passed, 0 failed, 1 Windows-only skip**; includes four live Claude bridge scenarios.
100
- - Complete MCP suite: **130 passed, 0 failed**, including compiled Codex discovery of `browser_batch` with no opt-in.
101
- - All five local browser/UI suites: **19 passed**, including memory maintenance and sidepanel windows.
102
- - The MCP test command invokes Vitest through Node, so a launcher file that is not executable does not break it.
103
- - Real-page checks use a new test tab for each site, scoped snapshots/content and projected extraction without posting. Results and their transport limitations are recorded in [browser-live-results.json](../benchmarks/browser-live-results.json).
104
-
105
-
106
- - Node tests exercise cancellation, actual write spacing, selector ambiguity/identity, snapshot delivery and diffs, extraction completeness, browser recovery and policy contracts.
107
- - MCP Vitest tests exercise routing isolation, one safe pre-execution recovery, no ambiguous replay, cancellation, batch validation/partial outcomes, extraction projection and snapshot formatting.
108
- - Browser-driven suites, which are not part of this package, exercise the installed Playwright/Chromium against local fixtures and real Express route handlers. They cover live refs, deletions, reloads, truncation, background-frame deadlines, foreign-tab rejection, guarded publishing, cancelled clicks, replaced targets and hydration before extraction. macOS sandboxed runners may need permission to launch Chromium and bind loopback.
109
- - `npm run build` in `mcp-server` compiles the implementation and its generated runtime files.
@@ -1,89 +0,0 @@
1
- # Hook identity, state, and measurement
2
-
3
- SynaBun has 10 executable hook scripts with 11 registrations covering nine Claude Code events. The canonical
4
- definitions live in `lib/claude-hooks.js`. Every settings scope gets the same
5
- handler command, matcher, and timeout. Claude Code can therefore deduplicate
6
- the handler for each event even when both project and global hooks are installed.
7
-
8
- The command resolves a SynaBun checkout from the current project (including
9
- subdirectories), then falls back to the installer-managed `SYNABUN_HOOK_ROOT`.
10
- The tracked template contains no machine-specific root. Server startup repairs
11
- recognized old commands in global settings and registered projects' settings
12
- and local settings. Other handlers, including plugins, retain their own behavior.
13
- Repairing one settings file without the other can temporarily retain duplicate
14
- execution; no event is suppressed by a guessed identity or a marker file.
15
-
16
- ## State integrity
17
-
18
- - `post-plan` and MCP `remember` use the same transactional writer. A plan's
19
- retry key includes its project, canonical source path, and content hash.
20
- Concurrent retries return the same UUID. An edited plan gets a new entry.
21
- - A verified old plan receipt can acquire a retry key without copying its row.
22
- Stop records a retry count, never a successful receipt before storage succeeds.
23
- - Short JSON read–modify–write operations are serialized with SQLite's writer
24
- lock in `data/hook-state-lock.sqlite`. JSON replacement is atomic. The
25
- coordination database contains no memories; process death releases its lock.
26
- - Compaction flags carry a session ID and generation. The matching conversation
27
- remember must carry `source_ref: synabun-compaction:<session>:<generation>`.
28
- Hook instructions supply this value. Legacy generationless flags can only be
29
- cleared by their own session. An old completion cannot clear a new generation.
30
-
31
- Runtime state resides under `SYNABUN_DATA_HOME` (normally `~/.synabun`). Existing
32
- memory rows are not deleted by this repair.
33
-
34
- ## Recall admission
35
-
36
- Hybrid `score` remains a ranking value, preserving compatibility. Retrieval also
37
- exposes `semantic_score`, `passage_score`, `keyword_coverage`, and `fusion_score`.
38
- An absent channel value means that channel was not measured or did not qualify;
39
- it is not a zero or a probability.
40
-
41
- Automatic injection requires document or passage similarity of at least 0.4.
42
- Explicit recall can still retrieve keyword-only evidence such as error codes.
43
- Short referential questions such as “is there a better setting for that?” do not
44
- start another automatic search. Repeatedly supplied evidence produces no new
45
- context. MiniLM and its existing vectors are retained.
46
-
47
- ## Reproducible accounting
48
-
49
- From the repository root:
50
-
51
- ```sh
52
- node scripts/audit-claude-hook-usage.mjs --since 2026-09-14T06:27:59.243Z --until 2026-09-15T06:27:59.243Z --output benchmarks/hook-repair-usage-24h.json
53
- node scripts/audit-memory-duplicates.mjs --output benchmarks/hook-repair-duplicate-candidates.json
54
- ```
55
-
56
- Usage records are deduplicated by API message ID. Uncached input, cache writes,
57
- cache reads, and output remain separate. Payloads retain request provenance,
58
- Unicode character counts, UTF-8 byte counts, image counts, and hashes. The join
59
- to the next recorded request does not prove subsequent retention or billing.
60
- Unknown component token counts are `null`, never character-based estimates.
61
-
62
- The duplicate audit is read-only. Exact hashes and near-duplicate candidates
63
- include UUIDs and metadata for review; they are not deletion instructions.
64
-
65
- For an isolated provider measurement, supply a transcript containing an exact
66
- duplicate SynaBun SessionStart block:
67
-
68
- ```sh
69
- node scripts/measure-claude-hook-overhead.mjs --run --transcript /path/to/session.jsonl --output benchmarks/hook-repair-provider-measurement.json
70
- ```
71
-
72
- This runs four short Claude requests: two reversed-order pairs with identical
73
- system/user text and the recorded context. Only temporary fixture hooks run;
74
- tools and MCP servers are disabled. It also checks native handler multiplicity.
75
-
76
- The September 15, 2026 probe used `claude-sonnet-5` and a 525-character recorded
77
- startup block. Legacy registrations ran SessionStart, UserPromptSubmit, and Stop
78
- twice each; canonical registrations ran them once each. Both pairs measured
79
- **940 versus 748 input tokens: 192 tokens removed per startup fixture**. This is
80
- not an attribution of historical account-wide usage or every hook's token cost.
81
-
82
- ## Watchdogs and rollout
83
-
84
- Both sidepanel engines use `high: 120s`, `xhigh: 300s`, `max: 300s`. Lower efforts
85
- retain the engine's existing default. Legacy retries retain their budget across
86
- respawns.
87
-
88
- After changing MCP code, build with `npm run mcp:build` and restart the Neural
89
- Interface server. A build alone leaves the running server's ESM imports cached.