synabun 2026.5.14 → 2026.7.30

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 (383) hide show
  1. package/CHANGELOG.md +40 -202
  2. package/LICENSE-COMMERCIAL.md +33 -0
  3. package/NOTICE +17 -0
  4. package/README.md +926 -991
  5. package/THIRD-PARTY-LICENSES.md +93 -0
  6. package/bin/synabun.js +30 -0
  7. package/hooks/claude-code/post-plan.mjs +65 -28
  8. package/hooks/claude-code/pre-compact.mjs +2 -1
  9. package/hooks/claude-code/prompt-submit.mjs +1070 -1047
  10. package/hooks/claude-code/session-start.mjs +15 -9
  11. package/hooks/claude-code/shared.mjs +634 -419
  12. package/hooks/claude-code/stop.mjs +115 -97
  13. package/hooks/claude-code/subagent-start.mjs +72 -0
  14. package/hooks/claude-code/subagent-stop.mjs +99 -0
  15. package/lib/client-config-repair.js +136 -0
  16. package/lib/data-home-migration.js +498 -0
  17. package/lib/paths.d.ts +21 -0
  18. package/lib/paths.js +45 -16
  19. package/mcp-server/dist/config.d.ts +1 -0
  20. package/mcp-server/dist/config.d.ts.map +1 -1
  21. package/mcp-server/dist/config.js +5 -2
  22. package/mcp-server/dist/config.js.map +1 -1
  23. package/mcp-server/dist/http.d.ts +11 -1
  24. package/mcp-server/dist/http.d.ts.map +1 -1
  25. package/mcp-server/dist/http.js +172 -33
  26. package/mcp-server/dist/http.js.map +1 -1
  27. package/mcp-server/dist/index.d.ts +2 -0
  28. package/mcp-server/dist/index.d.ts.map +1 -1
  29. package/mcp-server/dist/index.js +89 -52
  30. package/mcp-server/dist/index.js.map +1 -1
  31. package/mcp-server/dist/preload-http.js +8 -6
  32. package/mcp-server/dist/preload-http.js.map +1 -1
  33. package/mcp-server/dist/preload.js +8 -6
  34. package/mcp-server/dist/preload.js.map +1 -1
  35. package/mcp-server/dist/services/categories.d.ts +2 -2
  36. package/mcp-server/dist/services/categories.d.ts.map +1 -1
  37. package/mcp-server/dist/services/categories.js +37 -16
  38. package/mcp-server/dist/services/categories.js.map +1 -1
  39. package/mcp-server/dist/services/codex-config-heal.d.ts +49 -0
  40. package/mcp-server/dist/services/codex-config-heal.d.ts.map +1 -0
  41. package/mcp-server/dist/services/codex-config-heal.js +335 -0
  42. package/mcp-server/dist/services/codex-config-heal.js.map +1 -0
  43. package/mcp-server/dist/services/fb-regions.d.ts +71 -0
  44. package/mcp-server/dist/services/fb-regions.d.ts.map +1 -0
  45. package/mcp-server/dist/services/fb-regions.js +211 -0
  46. package/mcp-server/dist/services/fb-regions.js.map +1 -0
  47. package/mcp-server/dist/services/identity.d.ts +84 -0
  48. package/mcp-server/dist/services/identity.d.ts.map +1 -0
  49. package/mcp-server/dist/services/identity.js +187 -0
  50. package/mcp-server/dist/services/identity.js.map +1 -0
  51. package/mcp-server/dist/services/local-embeddings.d.ts.map +1 -1
  52. package/mcp-server/dist/services/local-embeddings.js +5 -0
  53. package/mcp-server/dist/services/local-embeddings.js.map +1 -1
  54. package/mcp-server/dist/services/neural-interface.d.ts +102 -12
  55. package/mcp-server/dist/services/neural-interface.d.ts.map +1 -1
  56. package/mcp-server/dist/services/neural-interface.js +398 -86
  57. package/mcp-server/dist/services/neural-interface.js.map +1 -1
  58. package/mcp-server/dist/services/profiles.d.ts +18 -0
  59. package/mcp-server/dist/services/profiles.d.ts.map +1 -1
  60. package/mcp-server/dist/services/profiles.js +120 -110
  61. package/mcp-server/dist/services/profiles.js.map +1 -1
  62. package/mcp-server/dist/services/sqlite.d.ts +142 -0
  63. package/mcp-server/dist/services/sqlite.d.ts.map +1 -1
  64. package/mcp-server/dist/services/sqlite.js +651 -183
  65. package/mcp-server/dist/services/sqlite.js.map +1 -1
  66. package/mcp-server/dist/services/vector-cache.d.ts +62 -0
  67. package/mcp-server/dist/services/vector-cache.d.ts.map +1 -0
  68. package/mcp-server/dist/services/vector-cache.js +196 -0
  69. package/mcp-server/dist/services/vector-cache.js.map +1 -0
  70. package/mcp-server/dist/tools/bluesky.d.ts +23 -0
  71. package/mcp-server/dist/tools/bluesky.d.ts.map +1 -0
  72. package/mcp-server/dist/tools/bluesky.js +970 -0
  73. package/mcp-server/dist/tools/bluesky.js.map +1 -0
  74. package/mcp-server/dist/tools/browser-cheatsheet.d.ts +4 -4
  75. package/mcp-server/dist/tools/browser-cheatsheet.d.ts.map +1 -1
  76. package/mcp-server/dist/tools/browser-cheatsheet.js +42 -14
  77. package/mcp-server/dist/tools/browser-cheatsheet.js.map +1 -1
  78. package/mcp-server/dist/tools/browser-interact.d.ts +38 -19
  79. package/mcp-server/dist/tools/browser-interact.d.ts.map +1 -1
  80. package/mcp-server/dist/tools/browser-interact.js +82 -37
  81. package/mcp-server/dist/tools/browser-interact.js.map +1 -1
  82. package/mcp-server/dist/tools/browser-navigate.d.ts +3 -1
  83. package/mcp-server/dist/tools/browser-navigate.d.ts.map +1 -1
  84. package/mcp-server/dist/tools/browser-navigate.js +38 -5
  85. package/mcp-server/dist/tools/browser-navigate.js.map +1 -1
  86. package/mcp-server/dist/tools/browser-observe.d.ts +131 -20
  87. package/mcp-server/dist/tools/browser-observe.d.ts.map +1 -1
  88. package/mcp-server/dist/tools/browser-observe.js +1229 -715
  89. package/mcp-server/dist/tools/browser-observe.js.map +1 -1
  90. package/mcp-server/dist/tools/browser.d.ts +3 -2
  91. package/mcp-server/dist/tools/browser.d.ts.map +1 -1
  92. package/mcp-server/dist/tools/browser.js +12 -3
  93. package/mcp-server/dist/tools/browser.js.map +1 -1
  94. package/mcp-server/dist/tools/choice.d.ts +160 -0
  95. package/mcp-server/dist/tools/choice.d.ts.map +1 -0
  96. package/mcp-server/dist/tools/choice.js +80 -0
  97. package/mcp-server/dist/tools/choice.js.map +1 -0
  98. package/mcp-server/dist/tools/fb-groups.d.ts +98 -0
  99. package/mcp-server/dist/tools/fb-groups.d.ts.map +1 -0
  100. package/mcp-server/dist/tools/fb-groups.js +369 -0
  101. package/mcp-server/dist/tools/fb-groups.js.map +1 -0
  102. package/mcp-server/dist/tools/forget.js +1 -1
  103. package/mcp-server/dist/tools/forget.js.map +1 -1
  104. package/mcp-server/dist/tools/gsc/performance.d.ts +2 -2
  105. package/mcp-server/dist/tools/loop.d.ts.map +1 -1
  106. package/mcp-server/dist/tools/loop.js +57 -13
  107. package/mcp-server/dist/tools/loop.js.map +1 -1
  108. package/mcp-server/dist/tools/memories.d.ts +6 -3
  109. package/mcp-server/dist/tools/memories.d.ts.map +1 -1
  110. package/mcp-server/dist/tools/memories.js +19 -4
  111. package/mcp-server/dist/tools/memories.js.map +1 -1
  112. package/mcp-server/dist/tools/morelogin.d.ts +24 -0
  113. package/mcp-server/dist/tools/morelogin.d.ts.map +1 -0
  114. package/mcp-server/dist/tools/morelogin.js +79 -0
  115. package/mcp-server/dist/tools/morelogin.js.map +1 -0
  116. package/mcp-server/dist/tools/profile.d.ts +1 -1
  117. package/mcp-server/dist/tools/profile.d.ts.map +1 -1
  118. package/mcp-server/dist/tools/profile.js +25 -10
  119. package/mcp-server/dist/tools/profile.js.map +1 -1
  120. package/mcp-server/dist/tools/recall.d.ts.map +1 -1
  121. package/mcp-server/dist/tools/recall.js +3 -9
  122. package/mcp-server/dist/tools/recall.js.map +1 -1
  123. package/mcp-server/dist/tools/reflect.js +1 -1
  124. package/mcp-server/dist/tools/reflect.js.map +1 -1
  125. package/mcp-server/dist/tools/remember.d.ts +3 -3
  126. package/mcp-server/dist/tools/remember.d.ts.map +1 -1
  127. package/mcp-server/dist/tools/remember.js +28 -9
  128. package/mcp-server/dist/tools/remember.js.map +1 -1
  129. package/mcp-server/dist/tools/style-guide-tools.d.ts +16 -0
  130. package/mcp-server/dist/tools/style-guide-tools.d.ts.map +1 -0
  131. package/mcp-server/dist/tools/style-guide-tools.js +102 -0
  132. package/mcp-server/dist/tools/style-guide-tools.js.map +1 -0
  133. package/mcp-server/dist/tools/style-guide.d.ts +7 -0
  134. package/mcp-server/dist/tools/style-guide.d.ts.map +1 -0
  135. package/mcp-server/dist/tools/style-guide.js +11 -0
  136. package/mcp-server/dist/tools/style-guide.js.map +1 -0
  137. package/mcp-server/dist/tools/whiteboard-tools.d.ts +6 -6
  138. package/mcp-server/dist/tools/youtube/analytics.d.ts +46 -0
  139. package/mcp-server/dist/tools/youtube/analytics.d.ts.map +1 -0
  140. package/mcp-server/dist/tools/youtube/analytics.js +83 -0
  141. package/mcp-server/dist/tools/youtube/analytics.js.map +1 -0
  142. package/mcp-server/dist/tools/youtube/dedup.d.ts +35 -0
  143. package/mcp-server/dist/tools/youtube/dedup.d.ts.map +1 -0
  144. package/mcp-server/dist/tools/youtube/dedup.js +56 -0
  145. package/mcp-server/dist/tools/youtube/dedup.js.map +1 -0
  146. package/mcp-server/dist/tools/youtube/download.d.ts +31 -0
  147. package/mcp-server/dist/tools/youtube/download.d.ts.map +1 -0
  148. package/mcp-server/dist/tools/youtube/download.js +30 -0
  149. package/mcp-server/dist/tools/youtube/download.js.map +1 -0
  150. package/mcp-server/dist/tools/youtube/helpers.d.ts +66 -0
  151. package/mcp-server/dist/tools/youtube/helpers.d.ts.map +1 -0
  152. package/mcp-server/dist/tools/youtube/helpers.js +143 -0
  153. package/mcp-server/dist/tools/youtube/helpers.js.map +1 -0
  154. package/mcp-server/dist/tools/youtube/media.d.ts +43 -0
  155. package/mcp-server/dist/tools/youtube/media.d.ts.map +1 -0
  156. package/mcp-server/dist/tools/youtube/media.js +97 -0
  157. package/mcp-server/dist/tools/youtube/media.js.map +1 -0
  158. package/mcp-server/dist/tools/youtube/metadata.d.ts +33 -0
  159. package/mcp-server/dist/tools/youtube/metadata.d.ts.map +1 -0
  160. package/mcp-server/dist/tools/youtube/metadata.js +106 -0
  161. package/mcp-server/dist/tools/youtube/metadata.js.map +1 -0
  162. package/mcp-server/dist/tools/youtube/navigate.d.ts +30 -0
  163. package/mcp-server/dist/tools/youtube/navigate.d.ts.map +1 -0
  164. package/mcp-server/dist/tools/youtube/navigate.js +71 -0
  165. package/mcp-server/dist/tools/youtube/navigate.js.map +1 -0
  166. package/mcp-server/dist/tools/youtube/playlist.d.ts +29 -0
  167. package/mcp-server/dist/tools/youtube/playlist.d.ts.map +1 -0
  168. package/mcp-server/dist/tools/youtube/playlist.js +128 -0
  169. package/mcp-server/dist/tools/youtube/playlist.js.map +1 -0
  170. package/mcp-server/dist/tools/youtube/schedule.d.ts +31 -0
  171. package/mcp-server/dist/tools/youtube/schedule.d.ts.map +1 -0
  172. package/mcp-server/dist/tools/youtube/schedule.js +147 -0
  173. package/mcp-server/dist/tools/youtube/schedule.js.map +1 -0
  174. package/mcp-server/dist/tools/youtube/source.d.ts +36 -0
  175. package/mcp-server/dist/tools/youtube/source.d.ts.map +1 -0
  176. package/mcp-server/dist/tools/youtube/source.js +85 -0
  177. package/mcp-server/dist/tools/youtube/source.js.map +1 -0
  178. package/mcp-server/dist/tools/youtube/upload.d.ts +53 -0
  179. package/mcp-server/dist/tools/youtube/upload.d.ts.map +1 -0
  180. package/mcp-server/dist/tools/youtube/upload.js +255 -0
  181. package/mcp-server/dist/tools/youtube/upload.js.map +1 -0
  182. package/mcp-server/dist/tools/youtube.d.ts +12 -0
  183. package/mcp-server/dist/tools/youtube.d.ts.map +1 -0
  184. package/mcp-server/dist/tools/youtube.js +38 -0
  185. package/mcp-server/dist/tools/youtube.js.map +1 -0
  186. package/mcp-server/dist/tui.js +3 -4
  187. package/mcp-server/dist/tui.js.map +1 -1
  188. package/mcp-server/package-lock.json +4798 -0
  189. package/mcp-server/package.json +54 -44
  190. package/mcp-server/run.mjs +11 -6
  191. package/mcp-server/src/config.ts +11 -7
  192. package/mcp-server/src/http.ts +265 -110
  193. package/mcp-server/src/index.ts +86 -49
  194. package/mcp-server/src/preload-http.ts +19 -18
  195. package/mcp-server/src/preload.ts +19 -18
  196. package/mcp-server/src/services/categories.ts +36 -19
  197. package/mcp-server/src/services/codex-config-heal.ts +389 -0
  198. package/mcp-server/src/services/fb-regions.ts +221 -0
  199. package/mcp-server/src/services/identity.ts +230 -0
  200. package/mcp-server/src/services/local-embeddings.ts +5 -0
  201. package/mcp-server/src/services/neural-interface.ts +464 -96
  202. package/mcp-server/src/services/profiles.ts +119 -106
  203. package/mcp-server/src/services/sqlite.ts +1405 -823
  204. package/mcp-server/src/services/vector-cache.ts +199 -0
  205. package/mcp-server/src/tools/bluesky.ts +1006 -0
  206. package/mcp-server/src/tools/browser-cheatsheet.ts +44 -14
  207. package/mcp-server/src/tools/browser-interact.ts +294 -244
  208. package/mcp-server/src/tools/browser-navigate.ts +37 -5
  209. package/mcp-server/src/tools/browser-observe.ts +2018 -1472
  210. package/mcp-server/src/tools/browser.ts +18 -2
  211. package/mcp-server/src/tools/choice.ts +103 -0
  212. package/mcp-server/src/tools/fb-groups.ts +387 -0
  213. package/mcp-server/src/tools/forget.ts +1 -1
  214. package/mcp-server/src/tools/loop.ts +56 -14
  215. package/mcp-server/src/tools/memories.ts +19 -4
  216. package/mcp-server/src/tools/morelogin.ts +81 -0
  217. package/mcp-server/src/tools/profile.ts +24 -10
  218. package/mcp-server/src/tools/recall.ts +3 -9
  219. package/mcp-server/src/tools/reflect.ts +145 -145
  220. package/mcp-server/src/tools/remember.ts +137 -115
  221. package/mcp-server/src/tools/style-guide-tools.ts +129 -0
  222. package/mcp-server/src/tools/style-guide.ts +15 -0
  223. package/mcp-server/src/tools/youtube/analytics.ts +106 -0
  224. package/mcp-server/src/tools/youtube/dedup.ts +57 -0
  225. package/mcp-server/src/tools/youtube/download.ts +41 -0
  226. package/mcp-server/src/tools/youtube/helpers.ts +183 -0
  227. package/mcp-server/src/tools/youtube/media.ts +109 -0
  228. package/mcp-server/src/tools/youtube/metadata.ts +112 -0
  229. package/mcp-server/src/tools/youtube/navigate.ts +81 -0
  230. package/mcp-server/src/tools/youtube/playlist.ts +134 -0
  231. package/mcp-server/src/tools/youtube/schedule.ts +158 -0
  232. package/mcp-server/src/tools/youtube/source.ts +101 -0
  233. package/mcp-server/src/tools/youtube/upload.ts +296 -0
  234. package/mcp-server/src/tools/youtube.ts +47 -0
  235. package/mcp-server/src/tui.ts +5 -6
  236. package/neural-interface/lib/backup-service.js +604 -0
  237. package/neural-interface/lib/browser-tab-recovery.js +119 -0
  238. package/neural-interface/lib/claude-agent-bridge.js +1180 -0
  239. package/neural-interface/lib/claude-model-catalog.js +341 -0
  240. package/neural-interface/lib/codex-collaboration-mode.js +14 -0
  241. package/neural-interface/lib/codex-mcp-approvals.js +56 -0
  242. package/neural-interface/lib/codex-request-journal.js +242 -0
  243. package/neural-interface/lib/codex-runtime-path.js +146 -0
  244. package/neural-interface/lib/codex-session-catalog.js +220 -0
  245. package/neural-interface/lib/codex-sidepanel-permissions.js +110 -0
  246. package/neural-interface/lib/db.js +274 -65
  247. package/neural-interface/lib/design-md.js +179 -0
  248. package/neural-interface/lib/exec-loop-command.js +215 -0
  249. package/neural-interface/lib/loop-logger.js +32 -8
  250. package/neural-interface/lib/mcp-client-config.js +53 -0
  251. package/neural-interface/lib/memo-cache.js +84 -0
  252. package/neural-interface/lib/morelogin.js +277 -0
  253. package/neural-interface/lib/native-loop-providers.js +508 -0
  254. package/neural-interface/lib/native-loop-runtime.js +658 -0
  255. package/neural-interface/lib/opencode-history.js +253 -0
  256. package/neural-interface/lib/opencode-runtime-config.js +40 -0
  257. package/neural-interface/lib/opencode-v2-client.js +92 -1
  258. package/neural-interface/lib/project-storage.js +766 -0
  259. package/neural-interface/lib/schedule-launch-intent.js +40 -0
  260. package/neural-interface/lib/session-cache-builder.js +52 -26
  261. package/neural-interface/lib/session-indexer.js +657 -651
  262. package/neural-interface/lib/session-title-generator.js +228 -0
  263. package/neural-interface/lib/skill-prompt-bridge.js +11 -0
  264. package/neural-interface/lib/ui-blob-store.js +106 -0
  265. package/neural-interface/lib/vector-cache.js +185 -0
  266. package/neural-interface/package-lock.json +4645 -0
  267. package/neural-interface/package.json +55 -33
  268. package/neural-interface/public/apple-touch-icon.png +0 -0
  269. package/neural-interface/public/category-logos/synabun.png +0 -0
  270. package/neural-interface/public/claude-chat.js +1183 -1174
  271. package/neural-interface/public/favicon-16x16.png +0 -0
  272. package/neural-interface/public/favicon-32x32.png +0 -0
  273. package/neural-interface/public/icon-192.png +0 -0
  274. package/neural-interface/public/icon-512.png +0 -0
  275. package/neural-interface/public/index.html +2 -2
  276. package/neural-interface/public/index2d.html +2 -2
  277. package/neural-interface/public/logo-synabun.png +0 -0
  278. package/neural-interface/public/logoHD.png +0 -0
  279. package/neural-interface/public/onboarding.html +82 -29
  280. package/neural-interface/public/shared/agent-runtime-options.js +437 -0
  281. package/neural-interface/public/shared/api.js +107 -50
  282. package/neural-interface/public/shared/blob-store.js +99 -0
  283. package/neural-interface/public/shared/cdx/cdx-icons.js +11 -2
  284. package/neural-interface/public/shared/cdx/cdx-panel.js +287 -40
  285. package/neural-interface/public/shared/cdx/cdx-protocol.js +443 -0
  286. package/neural-interface/public/shared/cdx/cdx-render.js +311 -112
  287. package/neural-interface/public/shared/cdx/cdx-requests.js +259 -49
  288. package/neural-interface/public/shared/cdx/cdx-styles.js +512 -19
  289. package/neural-interface/public/shared/cdx/cdx-tabs.js +2027 -399
  290. package/neural-interface/public/shared/cdx/cdx-ws.js +63 -23
  291. package/neural-interface/public/shared/cli-status.js +1 -0
  292. package/neural-interface/public/shared/cp/cp-agents.js +166 -0
  293. package/neural-interface/public/shared/cp/cp-bash.js +216 -0
  294. package/neural-interface/public/shared/cp/cp-ctx.js +11 -0
  295. package/neural-interface/public/shared/cp/cp-diff.js +223 -0
  296. package/neural-interface/public/shared/cp/cp-permissions.js +309 -0
  297. package/neural-interface/public/shared/cp/cp-statusline.js +122 -0
  298. package/neural-interface/public/shared/cp/cp-styles.js +148 -0
  299. package/neural-interface/public/shared/html-shell.js +15 -1
  300. package/neural-interface/public/shared/node-positions-store.js +44 -0
  301. package/neural-interface/public/shared/ocp/ocp-panel.js +36 -37
  302. package/neural-interface/public/shared/ocp/ocp-questions.js +48 -0
  303. package/neural-interface/public/shared/ocp/ocp-render.js +77 -69
  304. package/neural-interface/public/shared/ocp/ocp-send.js +19 -2
  305. package/neural-interface/public/shared/ocp/ocp-styles.js +39 -3
  306. package/neural-interface/public/shared/ocp/ocp-tabs.js +27 -11
  307. package/neural-interface/public/shared/ocp-v2/ocp-v2-automation-ownership.js +54 -0
  308. package/neural-interface/public/shared/ocp-v2/ocp-v2-childpanel.js +7 -1
  309. package/neural-interface/public/shared/ocp-v2/ocp-v2-compact-button.js +5 -1
  310. package/neural-interface/public/shared/ocp-v2/ocp-v2-manager.js +22 -8
  311. package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +456 -23
  312. package/neural-interface/public/shared/ocp-v2/ocp-v2-plan.js +12 -6
  313. package/neural-interface/public/shared/ocp-v2/ocp-v2-profile-inheritance.js +64 -0
  314. package/neural-interface/public/shared/ocp-v2/ocp-v2-projectbar.js +100 -24
  315. package/neural-interface/public/shared/ocp-v2/ocp-v2-render.js +42 -62
  316. package/neural-interface/public/shared/ocp-v2/ocp-v2-send.js +38 -4
  317. package/neural-interface/public/shared/ocp-v2/ocp-v2-state.js +4 -1
  318. package/neural-interface/public/shared/ocp-v2/ocp-v2-styles.js +16 -6
  319. package/neural-interface/public/shared/ocp-v2/ocp-v2-ws.js +24 -9
  320. package/neural-interface/public/shared/session-title.js +100 -0
  321. package/neural-interface/public/shared/storage.js +13 -0
  322. package/neural-interface/public/shared/styles.css +26136 -24860
  323. package/neural-interface/public/shared/term-renderer.js +206 -0
  324. package/neural-interface/public/shared/ui-automation-studio.js +4891 -4780
  325. package/neural-interface/public/shared/ui-claude-panel.js +9947 -8770
  326. package/neural-interface/public/shared/ui-codex-panel.js +7 -1
  327. package/neural-interface/public/shared/ui-detail.js +65 -11
  328. package/neural-interface/public/shared/ui-explorer.js +378 -218
  329. package/neural-interface/public/shared/ui-file-explorer.js +187 -83
  330. package/neural-interface/public/shared/ui-menubar.js +13 -0
  331. package/neural-interface/public/shared/ui-native-loop-router-state.js +94 -0
  332. package/neural-interface/public/shared/ui-native-loop-router.js +438 -0
  333. package/neural-interface/public/shared/ui-native-window-id.js +7 -0
  334. package/neural-interface/public/shared/ui-navbar.js +261 -242
  335. package/neural-interface/public/shared/ui-opencode-panel-v2.js +2 -0
  336. package/neural-interface/public/shared/ui-opencode-panel.js +3 -3
  337. package/neural-interface/public/shared/ui-panels.js +15 -7
  338. package/neural-interface/public/shared/ui-resume.js +78 -27
  339. package/neural-interface/public/shared/ui-schedule-queue.js +172 -0
  340. package/neural-interface/public/shared/ui-schedules-studio.js +363 -110
  341. package/neural-interface/public/shared/ui-scroll-follow.js +194 -0
  342. package/neural-interface/public/shared/ui-sessions.js +2 -1
  343. package/neural-interface/public/shared/ui-settings.js +9402 -8301
  344. package/neural-interface/public/shared/ui-sidepanel-layout.js +9 -0
  345. package/neural-interface/public/shared/ui-sidepanel-tray.js +59 -12
  346. package/neural-interface/public/shared/ui-styleguide.js +764 -0
  347. package/neural-interface/public/shared/ui-sync.js +68 -26
  348. package/neural-interface/public/shared/ui-terminal.js +6706 -6710
  349. package/neural-interface/public/shared/ui-tooltip.js +15 -1
  350. package/neural-interface/public/shared/ui-tutorial-steps.js +10 -27
  351. package/neural-interface/public/shared/ui-update.js +159 -51
  352. package/neural-interface/public/shared/ui-whiteboard.js +143 -20
  353. package/neural-interface/public/shared/ui-workspaces.js +2 -1
  354. package/neural-interface/public/shared/utils.js +58 -0
  355. package/neural-interface/public/shared/vterm-buffer.js +21 -12
  356. package/neural-interface/public/synabun.png +0 -0
  357. package/neural-interface/public/variant/2d/graph.js +1683 -1635
  358. package/neural-interface/public/variant/2d/layout.js +595 -594
  359. package/neural-interface/public/variant/2d/main.js +534 -514
  360. package/neural-interface/public/variant/3d/graph.js +2580 -2400
  361. package/neural-interface/public/variant/3d/main.js +513 -492
  362. package/neural-interface/public/vendor/xterm/manifest.json +3 -0
  363. package/neural-interface/public/vendor/xterm/xterm-6.0.0.css +285 -0
  364. package/neural-interface/public/vendor/xterm/xterm-6.0.0.min.js +192 -0
  365. package/neural-interface/scripts/build-vendor.mjs +38 -0
  366. package/neural-interface/scripts/vendor-xterm-entry.js +8 -0
  367. package/neural-interface/server.js +33885 -25856
  368. package/neural-interface/templates/CLAUDE-template.md +251 -241
  369. package/neural-interface/templates/ruleset-versions.json +15 -15
  370. package/package.json +47 -15
  371. package/scripts/recover-user-config.mjs +254 -0
  372. package/scripts/restore-data-home-from-backup.mjs +225 -0
  373. package/setup.js +335 -44
  374. package/skills/synabun/SKILL.md +209 -209
  375. package/skills/synabun/icon.png +0 -0
  376. package/skills/synabun/modules/audit.md +380 -380
  377. package/skills/synabun/modules/idea.md +133 -133
  378. package/skills/synabun/modules/schedule.md +138 -225
  379. package/skills/synabun/synabunicon.png +0 -0
  380. package/updater.mjs +16 -1
  381. package/hooks/claude-code/test-user-learning.mjs +0 -533
  382. package/neural-interface/public/index-legacy.html +0 -14677
  383. package/neural-interface/public/index2d-legacy.html +0 -8193
package/CHANGELOG.md CHANGED
@@ -1,220 +1,58 @@
1
- # Project Changelog
2
-
3
- ## OpenCode Sidepanel V2
4
-
5
- ### Added — OpenCode Sidepanel V2 (Clean-Slate Rebuild)
6
- - **Fresh SDK wrapper `lib/opencode-v2-client.js`** — New ~190-line wrapper around `@opencode-ai/sdk/v2`'s `createOpencodeClient`. Pass-through philosophy: NO `normalizeV2Event` translation, NO `buildSystemForPlanMode` injection, NO legacy shape massaging. `connect({ port })` runs an `event.subscribe()` loop with 1s→10s exponential-backoff auto-reconnect via `AbortController`, emitting `{ eventType, event }` envelopes verbatim through an internal `event.onEvent(listener)` registry. Surfaces `session.list/create/get/delete/abort/messages/prompt` and `permission.reply`; `unwrap()` translates hey-api `{ data, error, response }` to `{ status, data }` and throws on error; `clean()` strips `undefined` keys so the URL builder doesn't append `?foo=undefined`. Verbose log gated on `OCPV2_VERBOSE=1`.
7
- - **New WS route `/ws/opencode-v2` + REST endpoints** — `neural-interface/server.js` adds `_ocpV2WsClients` Set, `broadcastToOpencodeV2Clients()`, `installOpencodeV2Listener()` (independent bridge from legacy `installOpencodeClientListener`), and `handleOpencodeV2Ws(ws)`. The handler implements `init / session:list / session:create / session:get / session:delete / session:messages / message:send / message:abort / permission:reply` over id-correlated JSON frames, with per-session `AbortController` map so a fresh send cancels the previous in-flight prompt cleanly. New REST: `GET /api/opencode-v2/status`, `POST /api/opencode-v2/serve/start`, `POST /api/opencode-v2/serve/stop`. Wired `opencodeV2Client.connect/disconnect` into both `ensureOpencodeServer` boot points and `stopOpencodeServer`, sharing the same `opencode serve` process on port 4096 as the legacy panel. `/ws/opencode-v2` added to the upgrade allowlist and connection router; legacy `/ws/opencode-skin` route remains registered (orphaned).
8
- - **Browser modules under `public/shared/ocp-v2/`** — Six fresh modules totaling under 1500 lines:
9
- - `ocp-v2-styles.js` — `.ocpv2-*` CSS injected once, slide-in panel, message bubbles, tool cards with status badges, reasoning collapsibles, permission cards, error banners, compose footer with autosizing textarea.
10
- - `ocp-v2-state.js` — pub/sub state store: `serverStatus`, `sessionId`/`sessionInfo`, `messageOrder[]`, `messages: Map<id,{parts:Map}>`, `running`, `pendingPermission`, `errors[]`. Setters fire `notify()` to all `subscribe()` listeners.
11
- - `ocp-v2-ws.js` — WebSocket client. `api.{init,sessionList,sessionCreate,sessionGet,sessionDelete,sessionMessages,send,abort,permissionReply}` returns id-correlated promises. `handleEvent()` dispatches `message.updated` / `message.removed` / `message.part.updated` / `session.idle` / `session.error` / `permission.asked` / `permission.replied` into state mutations; auto-reconnect after 1.5s on close.
12
- - `ocp-v2-render.js` — full CLI parity renderers: text (minimal Markdown — paragraphs, fences, inline code, **bold**, *italic*, lists, links — no external deps), reasoning (collapsible `<details>`, open while streaming), tool (header with name + status badge, input JSON, output `<pre>`, error variant), file chip, step markers, permission card with `Allow once / Always / Reject` buttons that lock on click and call `api.permissionReply()`, error banner. Mounts on the messages container and re-renders on every state notification.
13
- - `ocp-v2-send.js` — compose textarea + Send/Abort button. Enter sends, Shift+Enter newline, optimistic user message rendered before SDK echoes back, button toggles to Abort while `running`. `doAbort()` calls `api.abort(sessionId)` and force-clears `running`.
14
- - `ocp-v2-panel.js` — slide-in panel container. Lazy boot on first toggle: `api.init()` → `setServerStatus` → `startFreshSession()` (auto-creates one fresh session per panel open, matches CLI single-session model). Header shows `OpenCode · {sid8}` + status pill (`ready` / `running` / `error`) + a `New` button to spawn a new session. Emits `opencode-panel:visibility` so the existing navbar binding still highlights the topright button.
15
- - **Barrel + navbar swap** — New `public/shared/ui-opencode-panel-v2.js` re-exports `toggleOpencodePanel` / `isOpencodePanelOpen` / `openOpencodeWithPrompt` from `ocp-v2/ocp-v2-panel.js`. Single-line edit in `public/shared/ui-navbar.js` repoints the import from `./ui-opencode-panel.js` → `./ui-opencode-panel-v2.js`. Topright OpenCode button now opens the V2 panel; old `public/shared/ocp/**` (13 files, ~14000 lines), `public/shared/ui-opencode-panel.js`, and `lib/opencode-client.js` remain unmodified on disk as a rollback safety net.
16
-
17
- ### Added — Reasoning Effort Picker in OpenCode V2 Sidepanel
18
- - **Variant picker in compose footer** — New `neural-interface/public/shared/ocp-v2/ocp-v2-variantpicker.js` module renders a small dropdown beside the model picker that lets users pick a reasoning/thinking effort (`low` / `medium` / `high` / `max` / `xhigh` / `minimal` / `none`) for any OpenCode model that exposes a `variants` map. Auto-hides when the active model has no variants. Includes a "default" entry that clears the variant so the SDK falls back to its built-in default.
19
- - Persists per-model selection in `localStorage` under `ocp-v2-model-variants` so each model remembers its preferred effort across sessions.
20
- - Subscribes to `config:model` and restores the saved variant whenever the user switches models.
21
- - Variants ordered by `PREFERRED_ORDER` (`none, minimal, low, medium, high, max, xhigh`); unknown variant names appended alphabetically; entries with `disabled: true` filtered out.
22
- - **State plumbing** — Added `variant: null` field plus `setVariant()` setter to `neural-interface/public/shared/ocp-v2/ocp-v2-state.js` (emits `config:variant` event).
23
- - **Send pipeline** — `neural-interface/public/shared/ocp-v2/ocp-v2-send.js` mounts the variant picker before the model picker in `.ocpv2-footer-right` and forwards `variant: s.variant || undefined` on every `api.send()` call. WS API in `neural-interface/public/shared/ocp-v2/ocp-v2-ws.js` carries the field through to the server, and `neural-interface/server.js` forwards it to `opencodeV2Client.session.prompt(...)` (the v2 client already passes through arbitrary fields via `...rest`).
24
- - **Styles** — Added `#ocpv2-variant-dd` rules to `neural-interface/public/shared/ocp-v2/ocp-v2-styles.js`: brain icon, capitalised variant names, smaller right-anchored menu, reused `ocpv2-model-menu-in` animation.
25
-
26
- ### Fixed — OpenCode V2 Sidepanel Error Auto-Heal
27
- - **Stale header error pill recovery** — `ocp-v2-state.js` now has explicit `healing`, `clearErrors()`, and `setHealing()` state so transient OpenCode/WebSocket failures no longer leave the sidepanel header stuck on `error` after the connection recovers.
28
- - **Debounced panel auto-heal** — `ocp-v2-panel.js` now reacts to recoverable errors, `offline`, and `reconnecting` statuses by reconnecting the sidepanel WebSocket, calling `api.init()` to ensure `opencode serve` is healthy, rehydrating the active session/messages, and only creating a fresh session when the current one is unavailable.
29
- - **Recovery-aware status propagation** — `ocp-v2-ws.js` broadcasts `reconnecting`/`error` status into registered panel stores on WebSocket close/open failure, and the header now shows `healing` / `reconnecting` states instead of immediately surfacing a red error pill.
30
- - **Child panel stale badge cleanup** — `ocp-v2-childpanel.js` clears recoverable child/sub-agent errors once the server reports ready, preventing minimized child pills from retaining false error badges after recovery.
31
-
32
- ### Fixed — OpenCode V2 Sidepanel Notification Wiring (DONE/ERROR)
33
- - **Missing DONE notification on turn completion** — `ocp-v2-ws.js` previously only fired ASK notifications for permissions/questions; `session.idle` only flipped the running flag without notifying. Added a `running→idle` transition check that fires `NOTIF_TYPE.DONE` via `uiNotify('panel', ...)` only on a real transition, so idle echoes after reconnect do not re-fire.
34
- - **Missing ERROR notification on session failure** — `session.error` only pushed the error into state; now also fires `NOTIF_TYPE.ERROR` via `uiNotify` so the user is alerted when not focused on the panel.
35
- - **Per-turn dedup for outcome notifications** — Added `_outcomeKey` `WeakMap<store, NOTIF_TYPE>` to dedup repeated DONE/ERROR fires within a single turn; previous ERROR locks out subsequent DONE for the same turn, mirroring the legacy `ocp-tabs.js` lockout. Reset is wired via `_ensureOutcomeReset(store)` which subscribes once to `running:set` from `subscribeSession()`, so the dedup clears whenever a new turn starts — including local sends from `ocp-v2-send.js` that flip `running` directly on the store rather than through a ws event.
36
- - **Parent-aware notification labels** — Sub-agent (child panel) outcomes display as `↳ {title}` to visually distinguish them from primary-session toasts, matching the existing ASK and ACTION label conventions.
37
-
38
- ### Fixed — OpenCode V2 Cascading Close & Phantom Pill Swap
39
- - **`switchToSession` no longer resurrects the just-closed tab** — `handlePillClose()` in `ocp-v2-panel.js` called `removeTab(sid)` then `switchToSession(next)`, but `switchToSession()` ran `if (prevSid) ensureTab(prevSid, getState().sessionInfo)` while `state.sessionId` still pointed at the deleted session — re-adding it to `_tabSessionIds` every time. Fix: clear `setSession(null, null)` BEFORE `removeTab` when the closing session is active, and guard `switchToSession`'s ensureTab call with `if (prevSid && _tabSessionIds.includes(prevSid))` so no other call path can resurrect a removed tab either.
40
- - **Pill X now matches header X destructiveness** — Tray pill close on `.ocpv2-session-pill` previously only ran the local `handlePillClose()` (no server delete), leaving orphan sessions on the OpenCode backend. Pill X now `await api.sessionDelete(sessionId)` before the local cleanup, mirroring the header X "Delete + switch" behavior.
41
-
42
- ### Fixed — OpenCode V2 Tray Placeholder Mismatch
43
- - **`ui-sidepanel-tray.js` now reads the v2 storage shape** — `PROVIDERS.opencode.tabsKeyPrefix` was pinned at the legacy v1 per-window key `synabun-ocp-tabs`, but OCP v2 writes to the single global key `opencode-v2-tabs` holding a plain `string[]` of session IDs. The tray rendered ghost placeholder pills from stale v1 data alongside real v2 pills; clicking a placeholder ran `openProvider('opencode')` → `toggleOpencodePanel()` which closes-if-open, perceived as a cascading panel swap. Added a `v2Plain: true` flag to the opencode provider config; `scopedTabsKey()`, `readPayload()`, `writeProviderPayload()`, and `pickMostRecentMeaningfulPayload()` now branch on it to handle the unscoped single-key `string[]` shape.
44
- - **One-shot legacy v1 cleanup** — New `cleanupLegacyV1Once()` in `ui-sidepanel-tray.js` deletes every stale `synabun-ocp-tabs-*` storage key on first opencode read, then sets `opencode-v1-cleanup-done` so it only runs once. Eliminates phantom v1 placeholders permanently.
45
- - **OCP v2 now dispatches `sidepanel-tray:provider-loaded`** — Claude (`ui-claude-panel.js`) and Codex (`cdx-panel.js`) emit this event after boot so `ui-sidepanel-tray.js` can drop its placeholder pills; OCP v2's `boot()` silently skipped the dispatch, so placeholders survived even after the real panel rendered its own pills. Added the `window.dispatchEvent(new CustomEvent('sidepanel-tray:provider-loaded', { detail: { provider: 'opencode' } }))` call inside `boot()` after `_booted = true`.
46
- - **`hasOpenCodeState` short-circuits on `sessionId`** — V2 plain entries have no `draft`/`plan`/`title` fields; predicate now treats any entry with a `sessionId` as meaningful so placeholder pills render correctly during the pre-boot window.
47
- - **`tabLabel` fallback for unbooted v2 placeholders** — Placeholder pills show `OpenCode · {sid8}` when no title is persisted yet (v2 plain payload doesn't store titles), instead of a generic "New session" label.
48
-
49
- ### Fixed — OpenCode V2 Sub-Agent Sidepanel Reliability
50
- - **Sub-agent tray pill no longer disappears on spawn** — Sub-agent sessions (e.g. the `Task` / `Explore` tool) used to fire server-side without producing a tray pill, leaving the user to dig through the Resume header. Multiple detection gaps fixed in `ocp-v2-manager.js`: new `readParentID()` helper reads `parentID` / `parentId` / `parent_id` / `session.parentID` variants; `AGENT_TOOL_NAMES` expanded with `invoke` / `subagent` / `spawn` / `explore` / `plan` casing variants; new `scanForOrphanChildren()` calls `api.sessionList()` on `registerPrimaryPanel` and `bindPrimarySession` to find children whose `parentID` matches the active session; a new `session.updated` listener catches sub-agents whose `parentID` arrives after creation; the fallback tool-event path no longer requires strict parent-equality so a mid-spawn tab switch still attaches.
51
- - **Late `session.created` events buffered** — `ocp-v2-ws.js` now keeps a 32-entry / 60 s TTL ring of `session.created` events and replays them to every new `subscribeSessionCreated` subscriber. The panel manager registers only after `boot()` finishes, so child spawns that fired during boot used to be dropped silently — now they are seen.
52
- - **Child pill survives a missing tray** — `ocp-v2-childpanel.js` split pill mounting into `buildPillElement()` + `attachPillToTray()`. If `#term-minimized-tray` isn't in the DOM yet (panel never opened), the pill polls every 250 ms (up to 15 s) until it can attach, instead of returning `null` and never appearing. Pill also stamps its own `data-session-id` and is inserted directly after the matching parent pill.
53
- - **Header status stuck on "idle" while server still streaming** — Both primary and child panel headers showed `idle` even while the agent was streaming. `store.setRunning(true)` was only called from `ocp-v2-send.js` when the user pressed Send locally. `ocp-v2-ws.js` `dispatchEvent` now flips `running` on for any incoming `message.updated` whose assistant `info.time.completed` is `null` / `0`, and for any `message.part.updated` with `state.status` of `running` or `pending`. `ocp-v2-panel.js` gained `syncRunningFromHydration()` which scans the transcript after every hydrate (`boot()` tab-restore, `switchToSession()`, `refreshSessionMessages()` auto-heal). `ocp-v2-manager.js` `hydrateChildPanel()` runs the same scan for the child store so the sub-agent header reflects in-flight state after reload.
54
-
55
- ### Added — OpenCode V2 Sub-Agent Transition Polish
56
- - **Spawn entrance animation** — When a sub-agent attaches, the new child pill in the tray now slides in from +28 px with a soft overshoot (`@keyframes ocpv2-child-pill-spawn`, 0.55 s `cubic-bezier(0.34, 1.18, 0.5, 1)`), a radial glow `::after` burst (`@keyframes ocpv2-child-pill-flash`, 1.4 s), and an outer blue-accent `box-shadow`. The `ocpv2-pill-spawning` class auto-removes after 1.6 s so subsequent hover styles aren't shadowed.
57
- - **Child panel cross-panel flash** — `.ocpv2-panel-child.ocpv2-open` now runs `@keyframes ocpv2-child-panel-flash` for 0.9 s on open, briefly tinting the panel's `box-shadow` with the blue sub-agent accent so the handoff from parent → child sidepanel reads unmistakably.
58
- - **Spawn toast notification** — `ocp-v2-manager.js` now calls `uiNotify('panel', NOTIF_TYPE.ACTION, '↳ Sub-agent of <parent>')` when a child is created, giving the user immediate visual feedback in the notifications drawer.
59
- - **Parent pill state-change transitions** — `.ocpv2-pill-has-child` got an explicit `transition: transform 0.4s cubic-bezier(0.34, 1.2, 0.5, 1), border-color 0.2s, box-shadow 0.2s` so the parent pill animates smoothly into its "child attached" appearance instead of snapping.
60
-
61
- ### Changed — OpenCode V2 Sub-Agent Header Affordances
62
- - **Header status shows the task, not "idle"** — `ocp-v2-childpanel.js` accepts a new `taskInfo` option and exposes `instance.setTaskInfo()`. New `currentTaskLabel(s)` builds the badge from (priority) the currently-running tool name → `${subagentType} · ${summary}` → summary alone → subagent type alone. `syncHeader()` displays the label both while running and while idle, with the same string as `data-tooltip`. `ocp-v2-manager.js` added `describeAgentTask(part, ev, toolName)` to extract `{subagentType, summary}` from the parent's tool input (`state.input.description` / `state.input.prompt` / `subagent_type` / `agent`) and `lookupParentTaskInfo(childSid)` which scans the parent store's recent tool parts when no replay part is available (session.created / session.updated / orphan-scan paths). Task info is threaded through `ensureChildSpawn` → `spawnChildPanel` → `createChildPanel`.
63
- - **Child pill tooltip pops left, not above** — `ocp-v2-childpanel.js` sets `data-tooltip-pos="left"` on both the child tray pill and its close button. The tray is right-anchored, so `above` tooltips were getting clipped at the screen edge; left placement uses `ui-tooltip.js`'s existing left path. The tray pill tooltip also appends ` — ${taskLabel}` so the minimized state still surfaces the agent's task.
1
+ # SynaBun v.2026.07.30
64
2
 
65
- ---
66
-
67
- ## OpenCode Sidepanel (Legacy)
68
-
69
- ### Added — OpenCode Sidepanel Trace System
70
- - **`ocp-trace.js` client trace bus** — New `neural-interface/public/shared/ocp/ocp-trace.js` exporting `trace()`, `traceTimer()`, `setTraceLevel()`, `setTraceContext()`, `onTrace()`, and `exportTraceLog()`. 5000-event ring buffer, level-gated routing (silent/errors/normal/verbose, persisted in `localStorage:ocp.traceLevel`), CSS-styled `[ocp-trace]` `console.debug` mirror, 250ms batched POST to `/api/ocp/trace/ingest`, `keepalive: true` flush on `pagehide`/`visibilitychange`.
71
- - **Server trace endpoints** — Added `POST /api/ocp/trace/ingest`, `GET /api/ocp/trace/snapshot?tail=N`, `POST /api/ocp/trace/clear`, and `WS /ws/ocp-trace` to `neural-interface/server.js`. Appends each batch to `data/ocp-trace.jsonl` (rotates at 50MB), broadcasts to live `/ws/ocp-trace` viewer clients. New `ocpTraceEmit(tag, fields)` helper for server-originated events.
72
- - **Trace points across all OCP modules** — `ocp-ws.js` (request lifecycle with timing), `ocp-events.js` (`event:in` router decisions, `q:asked`/`queued`/`render`), `ocp-stream.js` (`stream:finalize`), `ocp-plan.js` (`plan:exitPlanMode`, `onTurnTerminal`, `proseDetected`, `postUI:show`, `watchdog:fire`), `ocp-questions.js` (`q:reply` timer, `q:list`, `perm:render`/`respond`, `q:poll`), `ocp-send.js` (`send:start`, `send:fetch` timer, `send:turn:end`, `send:error`), `ocp-tabs.js` (`tab:switch` + `setTraceContext` on switch).
73
- - **Server-side `ocpTraceEmit`** — `q:reply:recv`/`q:reply:done` (with `via` and ms), `q:list:done`, `perm:respond:done`, `send:dispatch` (records `planSystemInjected` when `agent==='plan'`), `sse:relay` for high-signal SSE events (`question.*`/`permission.*`/`session.*`).
74
-
75
- ### Added — OpenCode Plan-Mode "Force Question Tool" Recovery
76
- - **4th recovery button** — `renderProseQuestionRecoveryCard()` in `neural-interface/public/shared/ocp/ocp-render.js` now renders a "Force question tool now" button alongside the existing Reply directly / Re-ask / Dismiss buttons. Wired in `ocp-plan.js` to send a hard prompt with a literal `question({ questions: [...] })` one-shot example so models like Kimi K2.6 can pattern-match the tool-call shape.
77
- - **`question:list` polling fallback** — `startQuestionPolling()` / `stopQuestionPolling()` in `neural-interface/public/shared/ocp/ocp-questions.js`. While a plan turn is active and no question card is visible, polls `question.list()` every 2.5s and surfaces any pending question via `backfillPendingQuestions()`. Wired from `ocp-send.js` to start on plan-mode turn start and stop on resolve / abort / error.
78
-
79
- ### Fixed — OpenCode Plan Mode Forces `question` Tool + Prose-Question Recovery
80
- - **Plan-mode prompt-prefix injection** — `neural-interface/server.js` previously sent `body.mode='plan'` and `body.tools={...}` without any prompt instruction, so models like Kimi K2.6 wrote clarification questions as prose ("Before I proceed, a couple of quick questions:") instead of calling the OpenCode `question` tool — the sidepanel only renders interactive cards for actual `question` tool calls, so prose questions stranded the user. New `OPENCODE_PLAN_MODE_INSTRUCTION` constant (mirroring the existing `CODEX_PLAN_MODE_PREFIXES` at ~line 2828) is now prepended to the first text part in every `body.mode === 'plan'` send: it explicitly states `You MUST call the \`question\` tool`, forbids prose questions, and reminds the model to call `ExitPlanMode` when ready. Idempotent via a `startsWith('[PLAN MODE]')` guard so the prefix isn't double-injected on multi-turn plan refinement.
81
- - **Per-turn question-tool usage tracking** — `neural-interface/public/shared/ocp/ocp-tabs.js` adds a `tab._questionToolUsedThisTurn` flag set to `true` in all three question-detection sites (`message.part.updated` tool branch, `tool.start` handler, and the dedicated `question.asked` SSE event), reset to `false` at the start of `sendMessage()`, when entering plan mode in `setTabMode()`, and on tab clear.
82
- - **Prose-question detector** — New `looksLikeProseQuestions(content)` helper scans the last 400 chars of captured plan text for trailing patterns: `quick/a couple of/two/before i proceed … questions:`, `Question N:` markers, or 2+ trailing `?` per line.
83
- - **`maybeShowPostPlanUI` recovery reroute** — When `!force && !_exitPlanDetected && !_questionToolUsedThisTurn && looksLikeProseQuestions(planContent)`, the function now calls `showProseQuestionRecoveryUI(tab)` and returns `false` instead of stamping the misleading PLAN COMPLETE card. Fixes the long-standing "press STOP after prose questions → PLAN COMPLETE for half-finished plan" trap.
84
- - **`MODEL ASKED QUESTIONS IN PROSE` recovery card** — New `renderProseQuestionRecoveryCard()` / `removeProseQuestionRecoveryCards()` exports in `neural-interface/public/shared/ocp/ocp-render.js`, plus a new `.ocp-prose-question-card` block in `neural-interface/public/shared/ocp/ocp-styles.js` (amber accent so it's visually distinct from the green-ish PLAN COMPLETE). Three actions: **Reply directly** focuses the OCP input field; **Re-ask using question tool** sends a follow-up prompt instructing the model to re-ask using the `question` tool; **Dismiss** removes the card. Cards are also cleared on next `sendMessage()` and on `setTabMode()` exit-plan.
85
-
86
- ### Changed — OpenCode Plan-Mode System Instruction
87
- - **One-shot `question` tool example** — `PLAN_MODE_INSTRUCTION` in `neural-interface/lib/opencode-client.js` and the duplicate `OPENCODE_PLAN_MODE_INSTRUCTION` in `neural-interface/server.js` now include a literal `question({ questions: [{ question, header, options: [{label, description}], multiSelect }] })` example block plus a "If you find yourself writing 'let me ask a few questions'… STOP and call the `question` tool" reinforcement. Kimi K2.6 ignored the abstract directive but pattern-matches the concrete example.
88
-
89
- ### Fixed — OpenCode Plan-Mode Stall Recovery Now Always Shows PLAN COMPLETE (Followup)
90
- - **PLAN COMPLETE always renders after a stall** — In `neural-interface/public/shared/ocp/ocp-tabs.js`, the `executePlanStallRecovery()` added in the prior fix took the wrong fallback when `tab.planContent` ended up shorter than 40 chars: it called `showProseQuestionRecoveryUI(tab)` (which renders a card titled `MODEL ASKED QUESTIONS IN PROSE`), instead of the user-expected `PLAN COMPLETE`. Reproduced on `opencode-go/kimi-k2.6` plan mode where the user reported "the agent asked a few questions … then automatically returned an error … but why isn't it presenting the plan complete normally?". Recovery now unconditionally calls `maybeShowPostPlanUI(tab, { source: \`stall:${reason}\`, force: true })` — `force: true` skips both the 40-char gate AND the prose-question guard. The prose-question recovery card is for a different bug class (model wrote questions as text instead of using the `question` tool) and should never be the stall fallback.
91
- - **Broader content extraction via `extractPlanTextLoose`** — The previous recovery called `capturePlanContent(tab)` which only adopts DOM text > 80 chars from the *last* `.ocp-msg-assistant` bubble, missing two key paths used by kimi-k2.6: (1) the live thinking block content (rendered into `.ocp-think-content-live` by the new inline `<think>` parser), and (2) `tab.planContent` not being populated by `message.part.delta` events (deltas update the DOM only — only `message.part.updated` updates `tab.planContent`). Recovery now calls `extractPlanTextLoose(tab)` which already covers all six extraction sources: existing `tab.planContent` → `ExitPlanMode` tool args → `todowrite`/`tasks` todos → final assistant text bubble (>40 chars) → standalone `.ocp-think-block .ocp-think-content` (matches both finalized AND live-streaming thinking blocks since the live block carries both classes) → subagent (Agent/task) tool result → last-resort any assistant bubble.
92
-
93
- ### Fixed — OpenCode Sidepanel Plan Mode Hang on Non-Anthropic Models (Tiered Stall Watchdog)
94
- - **Auto-recovers when the model never finalizes** — In `neural-interface/public/shared/ocp/ocp-tabs.js`, plan-mode turns on non-Anthropic providers (e.g., `opencode-go/kimi-k2.6`) often hang because the model never calls `ExitPlanMode` and the OpenCode server never delivers a terminal `session.idle` / `session.status:idle` / `message.completed`. The synchronous POST blocks for up to 30 min, so the user had to manually press STOP for the PLAN COMPLETE card to appear (manual STOP triggers `message:abort` → server emits `session.idle` → post-plan funnel). New `schedulePlanStallWatchdog(tab)` runs a single-shot silence timer that is re-armed on every SSE event in `handleSSEEvent`, plus a one-shot hard-cap timer set in `sendMessage`.
95
- - **Tiered behavior** — `PLAN_STALL_SOFT_MS` (60 s of silence) renders a soft prompt card with `Abort & show captured plan` / `Wait longer` / `Cancel turn`; `PLAN_STALL_AUTO_MS` (180 s of silence) auto-recovers without prompting; `PLAN_STALL_HARD_CAP_MS` (8 min total turn duration) force-recovers regardless of activity.
96
- - **Recovery path (`executePlanStallRecovery`)** — Captures latest plan content via `capturePlanContent`, rejects the pending WS request via `rejectPending`, sends `message:abort` so the OpenCode server fires `session.idle` and stops burning model compute, force-finalizes tab UI (`tab.running = false; endTurn(tab); setTurnStatus(tab)`), then renders PLAN COMPLETE card if `tab.planContent.length >= 40` else falls back to the prose-question recovery card.
97
- - **Suppressed during interactive question** — `hasActiveQuestion(tab)` short-circuits both arm and fire so a user taking 90 s to answer a `question` tool prompt doesn't trigger a false stall.
98
- - **Couples with finalization watchdog clearing** — `clearPlanFinalizationWatchdog(tab)` now also calls `clearPlanStallTimers(tab)`, so all 16 existing terminal/abort sites (message.completed, session.status:idle, session.idle, session.error, abortTab, sendMessage start/resolved/catch, setTabMode, etc.) clear stall timers without per-site edits.
99
- - **Soft-prompt card** — New `renderPlanStallSoftCard()` in `neural-interface/public/shared/ocp/ocp-render.js` mirrors the prose-question recovery card with a cool-blue accent (vs. amber) so users can visually distinguish "stuck" from "asked questions in prose". CSS in `neural-interface/public/shared/ocp/ocp-styles.js` (`.ocp-plan-stall-card` and friends).
100
-
101
- ### Fixed — OpenCode Plan Mode Auto-Finalizes After ExitPlanMode
102
- - **PLAN COMPLETE without manual STOP** — When a plan-mode model emitted `ExitPlanMode` but the OpenCode server never delivered a terminal `session.idle` / `message.completed`, the post-plan card stayed buried until the user pressed STOP (which triggered `message:abort` → server-emitted `session.idle` → post-plan funnel). The `schedulePlanFinalizationWatchdog()` in `neural-interface/public/shared/ocp/ocp-tabs.js` was previously armed only inside `recordAgentChildEvent` for the Deepseek subagent-idle case, never for parent-level `ExitPlanMode` without subagents (e.g., Anthropic plan mode). The watchdog is now armed (with a 5 s timeout) in BOTH ExitPlanMode detection sites — the legacy `tool.start` handler and the modern `message.part.updated` handler — replacing the lone `clearPlanFinalizationWatchdog(tab)` call with a clear-then-schedule pair.
103
- - **Parameterized timeout** — `schedulePlanFinalizationWatchdog(tab, { timeoutMs = 8000 } = {})` accepts an optional `timeoutMs`; the subagent-idle case keeps the 8 s default while ExitPlanMode-detected uses 5 s (the tool already returned, terminal event should arrive in 1–3 s).
104
- - **Relaxed min-length guard on watchdog fire** — When `_exitPlanDetected = true`, the 40-char `tab.planContent` minimum is bypassed so plans whose text only lives on `toolInput.plan` (no separate assistant prose) still render. The existing `maybeShowPostPlanUI(tab, { force: tab._exitPlanDetected })` already passes `force: true` for the tool-detected path.
105
-
106
- ### Fixed — OpenCode Question Reply "Fetch Failed" Frozen UI
107
- - **Non-terminal reply error path** — In `neural-interface/public/shared/ocp/ocp-questions.js renderOpencodeQuestion`, the `requestWs('question:reply')` catch handler no longer flips `tab.running=false` / `endTurn(tab)`. Instead it re-enables the question card (`locked=''`, buttons re-enabled) and shows "Click an answer again to retry." Previously a transient SDK fetch error caused the entire turn to be marked complete, freezing the UI behind a stale card.
108
- - **Composer unblocking on prose-recovery dismiss** — `onReplyDirectly` and `onDismiss` callbacks in `ocp-plan.js showProseQuestionRecoveryUI` now defensively clear `tab.showPostPlanActions = false` so the composer always re-enables when the user closes the prose-recovery card.
109
-
110
- ### Fixed — OpenCode Sidepanel Question Card Multi-Question Routing Trace
111
- - **`event:in` + `q:queued` diagnostics** — `neural-interface/public/shared/ocp/ocp-events.js` now traces every routed SDK event with `eventType`, `sid`, `partType`, `toolName`, plus `q:asked` (with question count) and `q:queued` (with `reason: no-container | active-question-busy`). Makes it possible to determine — from the trace alone — whether the model emitted `question.asked`, whether the router rendered or queued it, and why.
112
-
113
- ### Fixed — OpenCode Sidepanel Live Thinking Stream for Inline `<think>` Tag Models
114
- - **CLI-style typing for Kimi K2 / DeepSeek R1 / Qwen QwQ via opencode-go** — In `neural-interface/public/shared/ocp/ocp-render.js`, models that emit reasoning as inline `<think>…</think>` tags (rather than as a structured `partType === 'reasoning'` part) previously had their reasoning render as raw `<think>` text in the live bubble, with `<think>` parsing only happening at `finalizeStreamingMessage()`. The user complaint: thinking should "type into" the sidepanel as it does in the OpenCode CLI. New stateful parser `_routeStreamingChunk(el, container, chunk)` walks each delta, splits at `<think>` / `</think>` boundaries, and routes inside-tag content to the live thinking block via `_appendThinkTextOnly` and outside-tag content to the live text node via `_appendRawTextOnly`.
115
- - **Element-level state** — `el._thinkInside` tracks whether subsequent deltas continue inside an unclosed `<think>` block. `el._thinkPendingTag` buffers a partial tag that lands at a chunk boundary (e.g., delta ending with `<thi` or `</thin`); `_matchTrailingTagPrefix(s, target)` finds the longest suffix of `s` that prefixes `target`, so the partial flushes correctly when the rest of the tag arrives in the next delta.
116
- - **`setStreamRawText` split path** — Full-payload `message.part.updated` events that include `<think>…</think>` no longer clobber the live split. When the full text contains `<think>`, the parser uses `parseThinkSegments` to compute the canonical `textJoined` (non-thinking) and `thinkJoined` (thinking) strings and adopts each side independently with the existing length-gate. Sets `el._thinkInside` from the trailing segment so subsequent deltas continue correctly. Fast path (no inline tags) keeps the original direct-write behavior.
117
- - **No regression for explicit reasoning parts** — Anthropic and other providers that emit `partType === 'reasoning'` with structured deltas continue to flow through `appendThinkChunk` directly; only the `appendStreamChunk` (text delta) path got the new inline parser.
118
-
119
- ### Fixed — OpenCode Sidepanel Live Thinking Stream (CLI Parity)
120
- - **Token-by-token reasoning typing** — Reasoning deltas in `neural-interface/public/shared/ocp/ocp-render.js` previously routed through `scheduleStreamingRender()` which rebuilt the entire `<details>` block via `slot.innerHTML = thinkBlockHtml(...)` every 16 ms (O(n) per tick over the growing buffer). The block now lives in a persistent `<details class="ocp-think-block ocp-think-block-live" open>` skeleton built once by the new `getOrCreateLiveThinkContent(el)`; each delta does `live.appendChild(document.createTextNode(chunk))` (O(1)) so reasoning text "types in" character-by-character, mirroring the OpenCode CLI feel.
121
- - **Snapshot suffix append** — `setStreamThinkText()` now slices the new suffix when a `message.part.updated` snapshot arrives longer than the current buffer and appends only that suffix as a single text node, preserving the persistent live element (no flicker, no scroll-position loss).
122
- - **Auto-scroll respects manual scroll-up** — New `autoScrollLiveThink(live)` only scrolls the live content to the bottom when the user is within 32 px of it, so scrolling up to read earlier reasoning isn't fought.
123
- - **Removed obsolete render path** — Deleted `renderStreamingElement()` and `scheduleStreamingRender()` (the 16 ms `innerHTML`-rebuild path) since the live append path replaces it.
124
- - **Live styling cues** — Added `.ocp-think-block-live` (slightly brighter border) and a pulsing `Thinking…` summary label via `@keyframes ocp-think-pulse` in `neural-interface/public/shared/ocp/ocp-styles.js`, plus `scroll-behavior: smooth` on `.ocp-think-content-live`.
125
-
126
- ### Fixed — OpenCode Sidepanel Project Selector Lost the Project Path
127
- - **Session created in the right directory** — The `session:create` WS handler in `neural-interface/server.js` now forwards the panel-supplied cwd to OpenCode as `POST /session?directory=<encoded path>`. OpenCode binds each session to the directory passed in this query parameter (`session.directory`); previously the call omitted it, so every OpenCode session inherited the serve cwd (`PACKAGE_ROOT` = SynaBun) and ALL agent tool calls (Read, Bash, Edit, Write) resolved relative to SynaBun even when the user had picked a different project in the footer. With the query param wired through, OpenCode's tools natively resolve at the project root the user selected.
128
- - **Fresh-session cwd routing** — Switching the project via the OpenCode footer dropdown previously mutated only `tab.project` in `neural-interface/public/shared/ocp/ocp-panel.js`, leaving the existing OpenCode session bound to the cwd it was first created with. Added `setActiveProject()` in `neural-interface/public/shared/ocp/ocp-tabs.js` that updates `tab.project` + `STOR.project`, drops the bound `tab.sessionId` (along with title, token usage, plan/post-plan, watchdogs, tool activity, question/permission queues, and snapshot flush), refreshes the project chip label, and clears the messages container so the next `sendMessage()` creates a fresh OpenCode session at the new cwd. The projectbar dropdown click handler and the name-modal commit now both route through `setActiveProject()` instead of touching `tab.project` directly.
129
- - **Greeting carries the absolute project path** — Updated `buildOpencodeGreetingUserPrompt()` in `neural-interface/server.js` to spell out the absolute project working directory (`Project working directory: \`/abs/path\``) and instruct the agent to use it for all file operations whenever the selected project differs from `PACKAGE_ROOT`. Belt-and-suspenders alongside the new `?directory=` query param, so the agent's first turn explicitly states the cwd it should be operating in.
130
-
131
- ---
132
-
133
- ## Claude Sidepanel
3
+ A point release on top of 2026.07.20, focused on correct Claude Code model selection, a new project storage cleanup tool, and a stricter default browser policy.
134
4
 
135
- ### Fixed — Sidepanel Pills Open Blank Session After Server Restart
136
- - **Pill click landed on "New chat" instead of resuming the underlying Claude session** — `loadConfig()` in `neural-interface/public/shared/ui-claude-panel.js` detected a server-bootId mismatch and `removeItem`'d `STOR.tabs` / `STOR.tabsLegacy` / `STOR.session` outright. Pills (rendered by `ui-sidepanel-tray.js`) read those same keys but render before the panel inits, so they survived the restart visually — but the first pill click triggered `toggleClaudePanel` → `loadConfig` → wipe → `restoreTabs` found nothing → fell through to `createTab(null, 'New chat')`.
137
- - Replaced the wipe with a new `_scrubStaleTabState(key)` helper added above `restoreTabs()`. On bootId mismatch it now **preserves** resumable identity (`id`, `sessionId`, `label`, `project`, `model`, `effort`) and **drops** runtime-only state that would lie post-restart (`running` / `_wasRunning`, `queue` / `queuePaused`, `planMode` / `planFilePath`, `sessionCost` — re-synced via `syncSessionCosts()`). Tabs with no `sessionId` and only a default label ("New chat", "New session", "Claude") are pruned; the legacy `STOR.session` single-sessionId key is left intact.
138
- - Codex and OpenCode panels never had a bootId wipe, so their pills already worked across restarts — Claude was the lone outlier.
5
+ ## ✨ New
139
6
 
140
- ### Fixed — Claude Sidepanel Plan-Mode "Plan Text Was Empty" Edit Flow
141
- - **Server-side plan file authoring before `killProc()`** — `neural-interface/server.js` ExitPlanMode hook (`handleClaudeSkinWebSocket`, ~line 6616) now calls `writePlanFile(inputPlan || planText, { cwd: workDir })` before the kill. Previously the kill (intentional, prevents `--print`-mode auto-implementation) ran before `PostToolUse` could fire, so `post-plan.mjs` never authored a plan file from `tool_input.plan`. Result: clicking "Edit Plan" hit `noFile()` with "Plan text was empty — ask Claude to re-output the plan…". Server now writes `data/plans/YYYY-MM-DD/<slug>.md` directly from `ExitPlanMode.input.plan` (or the preceding text block as fallback).
142
- - **`writePlanFile()` helper extracted from `/api/create-plan`** — both the new ExitPlanMode hook and the existing `POST /api/create-plan` route share one writer. Helper is idempotent: same slug + identical content returns the existing path so server-side and client-side races never produce `slug-2.md` duplicates.
143
- - **Tightened narration-prefix filter `_NARRATION_PREFIX`** — regex now catches `now i (have|see|need)`, `here's`, `looking at`, `based on (the|my|your)`, `the user (wants|asked|is asking|needs)`, `okay/alright` openers, `found it`, `the recent` — preventing prose narration from being slugified into garbage filenames like `now-i-have-a-good-understanding-of-the-context.md` or `here-s-the-refined-plan-based-on-your-selections.md`.
144
- - **New `plan_file_written` system event** — server emits `{ type: 'system', subtype: 'plan_file_written', path, name }` to the client BEFORE the assistant event so `handleTabEvent()` in `neural-interface/public/shared/ui-claude-panel.js` sets `tab.planFilePath` immediately. Edit Plan now takes `openPlan(tab.planFilePath)` on the very first click — no race, no fallback chain, no `requestAnimationFrame` retry needed in the happy path.
145
- - **Removed redundant `/api/create-plan` POST from 3 eager-capture sites** — `renderAssistant()` (ExitPlanMode-detection block, partial-message dedup branch, new-message branch) no longer POSTs the captured plan content. Capture still stashes `tab._planContent` from `exitBlock.input.plan` for the implementation-prompt flow, but file authoring is exclusively server-side.
146
- - **Removed `extractPlanText`/`materialize` DOM-scrape fallback from Edit Plan click handler** — `renderPostPlanActions()`'s `a.action === 'plan'` branch no longer scrapes `.msg-body` rendered prose and POSTs it to `/api/create-plan`. The DOM only ever held rendered prose narration, never authoritative plan markdown — that path was the source of the garbage-named plan files. Click flow simplified to: `tab.planFilePath` → `openPlan` immediately; else one `requestAnimationFrame` retry for in-flight `plan_file_written`; else `diskFallback` via `GET /api/latest-plan`; else `noFile()`.
7
+ - **Live Claude Code model discovery** — The model list is now read from the installed Claude Code CLI at runtime rather than from two hand-maintained lists that had drifted out of date. Adds `GET /api/claude/models`, and `/api/claude/config` now reports a `modelsSource`. Every picker is covered: sidepanel, standalone chat, Automation Studio, Schedules Studio, and the resume/provider picker. Discovery falls back to a small static list when the CLI cannot be reached.
8
+ - **Project storage cleanup** — A new Projects area in Settings measures and clears build, test, cache, and dependency directories across macOS, Windows, and Linux, backed by admin-only `GET`/`POST /api/settings/project-storage` endpoints. Git-tracked files, nested repositories, SynaBun's own runtime dependencies, incomplete scans, and broad cache roots all fail closed, and cleanup revalidates the complete selection before deleting anything.
9
+ - **`xhigh` thinking is reachable** — The CLI has advertised `low/medium/high/xhigh/max` for some time, but `xhigh` was being filtered out at six spawn sites, including the engine the sidepanel actually uses. All six now share one effort list, and models that advertise no effort levels disable the toggle instead of passing a flag the CLI ignores.
147
10
 
148
- ### Changed — Empty-Plan Re-Prompt Button (Claude Panel)
149
- - **Replaced "Plan text was empty" status text with an interactive button** — When the user clicks `Edit plan` in the post-plan card but the plan extractor and `/api/latest-plan` disk fallback both fail to surface a plan file, `neural-interface/public/shared/ui-claude-panel.js` previously printed a static `appendStatus()` line ("Plan text was empty — ask Claude to re-output the plan, or click Continue with implementation to proceed."). The `noFile()` callback in the `'plan'` action handler now renders an inline `msg-status` row containing the short text "Plan text was empty." plus a primary `post-plan-action pp-primary` button labeled "Ask Claude to re-output the plan". Clicking the button populates `#cp-input` with a re-prompt instruction (`Please re-output the full plan you were preparing. Use ExitPlanMode with the complete plan text...`) and calls `send()`. Button disables on click, and falls back to a status if the WebSocket is closed. Scoped to the Claude panel only — `ocp-panel.js` retains the existing `renderErrorMessage` pattern.
11
+ ## 🛠 Fixed
150
12
 
151
- ---
13
+ - **Sidepanel launched Opus 4.8 when Opus 5 was picked** — The model picker read its list from the standalone Claude Code CLI, while sidepanel chats ran on the Agent SDK's own bundled CLI. Both accept the same alias selectors and each resolved them against its own model table, so the picker could show one model while the session launched another. `@anthropic-ai/claude-agent-sdk` moves `0.3.174` → `0.3.220` so both sides resolve identically, and a version skew between the two is now reported instead of passing silently. Takes effect after a server restart, not just an install.
14
+ - **Claude model pricing** — Corrected against published list prices. Opus 5 was missing from the table entirely and fell through to a Sonnet fallback, while the Opus and Fable rows were inflated roughly 3x. Displayed cost for past Opus and Fable sessions drops accordingly and now tracks what was actually billed.
15
+ - **Coexistence ruleset preview included neighbouring sections** — The extraction boundary matched an LF-only marker that was absent from the template's CRLF section, so the preview could return the condensed rulesets alongside the requested coexistence rules. It now stops at a stable heading.
16
+ - **Duplicate OpenCode model names in schedule selectors** — Group launch-override and Cron schedule editors now render provider-aware `Model — Service` labels while preserving the stored selector value.
152
17
 
153
- ## Codex Sidepanel
18
+ ## ⚙️ Changed
154
19
 
155
- ### Fixed — Codex Sidepanel Project Switching
156
- - **Fresh-session cwd routing** — Fixed the Codex footer project selector so changing projects updates the bound `_project` state in `neural-interface/public/shared/cdx/cdx-tabs.js` instead of only mutating `tab.project` in `neural-interface/public/shared/cdx/cdx-panel.js`; the new `setActiveProject()` keeps `tab.project`, `STOR.project`, branch UI, and fresh thread reset state in sync before `dispatchPrompt()` sends `query.cwd`.
157
- - **Sandbox root refresh** — Sends `reset_thread` to the Codex websocket after a project change and clears `_threadId` when the server explicitly returns `threadId: null`, preventing stale app-server thread IDs from leaking into fresh sessions and causing workspace-write permissions to target the old folder.
20
+ - **The SynaBun browser is the default public-web path** — Public-web browsing, search, and page retrieval now go through the configured SynaBun browser. Other web tools require an explicit request, and agent-facing Playwright and Chrome DevTools default to localhost and loopback testing. Unavailable browser access is reported rather than silently substituted. All five provider rulesets move `1.0.0` → `1.1.0`, so existing users are notified to refresh their defaults.
158
21
 
159
22
  ---
160
23
 
161
- ## Sidepanel Header & Tray
162
-
163
- ### Changed — Sidepanel Header & Tray Pill Polish
164
- - **`stopPropagation` on OCP header buttons** — `+` (new session), Minimize, Close, and Slide buttons in `ocp-v2-panel.js` now `event.stopPropagation()` so a click no longer bubbles into the session-menu open/close handler. Removes a race where a stray header click could toggle the session dropdown.
165
- - **`data-tooltip-pos` on every sidepanel pill close button** — Tray pill X buttons in `ui-claude-panel.js` (`.cp-session-pill`), `cdx/cdx-tabs.js` (`.cxp-session-pill`), `ocp-v2-panel.js` (`.ocpv2-session-pill`), and the placeholder pills in `ui-sidepanel-tray.js` all got `data-tooltip-pos="top"` so the "Close" tooltip stops clipping at the bottom edge of the tray. OCP header buttons got `data-tooltip-pos="bottom"` for symmetry.
24
+ # SynaBun v.2026.07.20
166
25
 
167
- ---
26
+ Two months of work focused on native agent workflows, safer concurrent automation, broader browser tooling, and a much more resilient Neural Interface.
168
27
 
169
- ## Terminal
28
+ ## ✨ New
170
29
 
171
- ### Fixed — Terminal ESC Key Now Aborts CLI TUIs On First Press (Floating + Docked)
172
- - **Single ESC reaches the PTY instead of `\x1b\x1b`** — In `neural-interface/public/shared/ui-terminal.js`, the global window-capture ESC handler in `initTerminal()` sent `\x1b` over the WS without `e.preventDefault()` / `e.stopImmediatePropagation()`, so xterm.js's own keydown listener on `.xterm-helper-textarea` fired afterwards and re-emitted ESC via `term.onData(...)` (line 1915). The PTY received `\x1b\x1b`, which Bubbletea-based TUIs (OpenCode, Claude Code, Codex) interpret as a Meta-prefix and ignore — so the running task never aborted. Handler now sends one `\x1b`, calls `e.preventDefault()` + `e.stopImmediatePropagation()` to block the duplicate, and re-focuses via `requestAnimationFrame(() => session.term?.focus())` instead of the old `term?.blur()` / `ta.blur()` pair (focus loss had forced the user to click back into the terminal between keystrokes).
173
- - **Docked terminal now has ESC coverage** — Previous early return `if (!isXterm) return;` left the docked panel without any ESC fallback when focus drifted to a tab title or panel chrome. Handler now resolves the target session by DOM ancestry: xterm helper textarea → its viewport's `dataset.sessionId`, else `.term-float-tab` → that tab's session, else inside `_panel` (`#terminal-panel`) → `_sessions[_activeIdx]`. Skips non-terminal `input/textarea/select/[contenteditable]` so search/rename/path inputs still consume ESC normally.
174
- - **Removed redundant per-floating-window ESC branch** — `attachTab()`'s `win.addEventListener('keydown', ...)` had a duplicate ESC sender that was unreachable for the common case (skipped when target was a textarea). Stripped the ESC branch; the Ctrl+C copy-on-selection branch stays as the floating-window-only fallback.
30
+ - **Native automation sidepanels** — Claude Code, Codex, and OpenCode loops and schedules now run in their native SynaBun sidepanels instead of terminal PTYs, with faster launches, background execution, and correct focus for manual runs.
31
+ - **Claude Code Agent SDK engine** — The Claude sidepanel now delivers full CLI-style sessions with tool calls, permissions, plan review, multiple tabs, account-safe ownership, and restored-session support.
32
+ - **Bluesky MCP tools** — A new 15-tool AT Protocol suite covers feeds, search, profiles, threads, notifications, DMs, posting, images, engagement, and moderation through the logged-in `bsky.app` session.
33
+ - **MoreLogin browser support** — MoreLogin anti-detect profiles are now a first-class browser backend, with profile management in Settings and an MCP action tool for status, creation, start, stop, and default-profile selection.
34
+ - **Reference-based browser snapshots** — AI browser sessions can work from compact element references instead of repeatedly consuming full page snapshots, cutting tokens while keeping interactions deterministic.
35
+ - **Session-scoped MCP profiles** — Codex tabs, OpenCode sessions, loops, and schedules can own isolated tool profiles that switch in place without changing another runtime or the default for future sessions.
36
+ - **Codex workflow upgrades** — Added project-aware `@` file mentions, multi-account switching and resume, inline plan refinement, persistent MCP approvals, interactive SynaBun choices, live model metadata, and dynamic reasoning controls.
37
+ - **Stronger scheduling controls** — Added queue visibility, cross-group mutual exclusion, group-level launch overrides, per-launch OpenAI accounts, and shared runtime options across Automation Studio and Schedules Studio.
38
+ - **Current Claude model lineup** — Added selectable 1M-context variants across launchers, Claude Sonnet 5, Fable 5, and Opus 4.8, while keeping legacy saved selections compatible.
175
39
 
176
- ### Changed — Floating Terminal Drag Compositing
177
- - **Simplified `.term-float-tab.float-dragging` shadow** — In `styles.css`, replaced the multi-layer `box-shadow: var(--shadow-2xl), 0 0 0 1px rgba(0,0,0,0.4)` with a single `0 8px 24px rgba(0,0,0,0.45), 0 0 0 1px rgba(0,0,0,0.4)`, dropped the `box-shadow` transition (kept `border-radius`), and added `will-change: transform, left, top` so the dragging window stays on its own composited layer. Removes per-frame GPU compositing thrash during drag.
178
-
179
- ---
40
+ ## 🛠 Fixed
180
41
 
181
- ## Performance & Stability
42
+ - **Cross-session isolation** — Codex and OpenCode events, transcripts, child agents, approvals, tabs, projects, and accounts no longer leak into unrelated sidepanels or resumed sessions.
43
+ - **Concurrent browser automation** — Server-authoritative tab ownership now keeps loops, schedules, agents, and interactive sessions on dedicated tabs; recovery repairs wedged pages without stealing or destroying another automation’s work.
44
+ - **Schedule reliability** — Run Now launches no longer queue silently, missed jobs recover after macOS clamshell sleep, automatic runs stay in the background, and startup failures are persisted and shown instead of disappearing.
45
+ - **Agent interaction deadlocks** — Fixed permission stalls, premature prompt rejection, broken plan-approval actions, missing tool results, and loop hangs after transient API or socket errors across Claude, Codex, and OpenCode.
46
+ - **Codex resume and MCP recovery** — Resumable sessions are discovered across every configured account, stale entries are filtered out, MCP startup errors stay contained, and authentication can be completed directly from the failure notice.
47
+ - **Crash and corruption paths** — Fixed Playwright lifecycle crashes, graph-link heap exhaustion, `onnxruntime-node` shutdown failures, frozen supervised logs, and backup replacement errors in macOS-protected folders.
48
+ - **Sidepanel usability** — Streaming transcripts respect manual scrolling, scrollbars are easier to grab, project menus stay above terminals, and plan or permission cards no longer duplicate or become unresponsive.
182
49
 
183
- ### Fixed — Long-Session Memory Leaks
184
- - **Bounded `_orphanedProcs` map** — Claude-skin orphan processes accumulated in `server.js` when a kill timer never fired (crash, kill -9, sleep) and an entry was never reattached. Added a 60-second sweep (`setInterval(...).unref()`) that deletes entries whose `proc` is null/killed/exited and clears the stale `killTimer`.
185
- - **Pruned `_ocpSessionOwners` / `_ocpSessionActivity`** — `_ocpStartSilenceWatchdog` in `server.js` now removes session entries with no live clients and `lastEventAt` older than 30 minutes. Watchdog scan no longer iterates dead sessions for the lifetime of the process.
186
- - **Idle screencast frame waste** — `onScreencastFrame` in `server.js` now bails out early (still ack'ing `Page.screencastFrameAck` to keep the CDP pipeline alive) when `session.clients` is empty, skipping JPEG buffer allocation and broadcast. Removed the per-frame `frameCount++` and conditional `console.log` that allocated even when not logging.
187
-
188
- ### Changed — Whiteboard Drag Hot Path
189
- - **rAF-batched `renderAll()`** — `ui-whiteboard.js` now schedules renders through `requestAnimationFrame` via `_renderRafId`. Multiple mousemove handlers used to call `renderAll()` synchronously per pointer event; renders are coalesced to one per frame. Added `renderAllImmediate()` for explicit flushes.
190
- - **`_elementMap` O(1) lookups** — Added `_findEl(id)` Map cache. Rebuilt lazily when `_elements.length` changes; `_invalidateElementMap()` is called from `undo()`/`redo()` to cover same-length object replacement. Replaced 8 `_elements.find(el2 => el2.id === ...)` calls inside `onMouseMove` (move-multi, shape-create, section-create, move, move-arrow, move-pen, rotate, resize).
191
- - **Cached root rect** — Added `_rootRectCached` + `_getRootRect()`/`_invalidateRootRect()`. `clientToCanvas()` and the pen-drawing path reuse the cached rect for the duration of a gesture; cache is cleared at mouseup and on window resize. Eliminates `_root.getBoundingClientRect()` layout flushes inside the 60 Hz mousemove loop.
192
-
193
- ### Changed — Sidepanel Markdown Rendering
194
- - **OCP v2 incremental render** — Rewrote `render()` in `ocp-v2-render.js` to use a key/sig reconciler (`_reconcile`, `_partSig`, `_msgSig`) instead of `_container.innerHTML = ''` followed by a full rebuild. User messages, assistant part bubbles, error banners, permission cards, question cards, and the post-plan card now have stable composite keys and content signatures so unchanged nodes are reused. Scroll position is far more stable across streaming deltas.
195
- - **LRU markdown memoization** — Added a 512-entry insertion-order LRU cache around `renderMarkdown()` in `ocp-v2-render.js`, `md()` in `cdx/cdx-render.js`, and `md()` in `ocp/ocp-render.js`. Identical text re-rendered during streaming/state-change passes now returns cached HTML instead of re-invoking `marked.parse()`.
196
-
197
- ### Changed — Storage Layer
198
- - **Deferred `JSON.parse` to flush time** — `storage.js` introduces `STR_SENTINEL`. `setItem()` no longer parses the caller-provided string on every call; `_dirty[key] = STR_SENTINEL` records "parse the current cache string at flush time". `_flushToServer()` and the `beforeunload` `sendBeacon` path resolve sentinels by parsing the cached string once when actually flushing. Big win for callers that store large snapshots (whiteboard, codex transcripts) where every keystroke previously triggered a redundant `JSON.parse`.
199
-
200
- ---
201
-
202
- ## Notifications
203
-
204
- ### Added — Pending Remember Picker on Notifications Health Tab
205
- - **Inline provider/model picker** — New "Run Pending Remembers" button on the Notifications drawer Health tab in `neural-interface/public/shared/ui-sessions.js`. Clicking expands an inline picker with provider buttons (Claude Code / Codex / OpenCode), a per-provider model dropdown, and Cancel/Run actions, so each orphaned `pending-remember` flag can be summarized into a real memory by the user's chosen sidepanel CLI instead of an isolated background agent.
206
- - **Per-provider model loading** — Claude models pulled from `/api/claude/config`, OpenCode models flattened from `/api/opencode/providers/full` as `provider/model` ids, Codex falls back to a static list (`gpt-5-codex`, `gpt-5`, `o4`, `o4-mini`) since its model list is WebSocket-only.
207
- - **Sidepanel routing** — Run dispatches the prompt to the chosen sidepanel: Claude via `sendToPanel({ newTab: true, autoSubmit: true })`, OpenCode via `openOpencodeWithPrompt({ autoSend: true })`, Codex by toggling the panel and pre-filling `#cxp-input` (auto-send is unreliable from outside the Codex panel).
208
- - **Server endpoint** — New `GET /api/sessions/pending-remember-prompt` in `neural-interface/server.js` returns `{ ok, count, prompt }`; resolves each orphaned session id to its `~/.claude/projects/<projKey>/<sessionId>.jsonl` transcript and embeds those paths in the prompt so the executing CLI can read them.
209
- - **Picker styling** — Added `.sm-pr-picker` / `.sm-pr-row` / `.sm-pr-providers` / `.sm-pr-select` rules in `neural-interface/public/shared/styles.css`, including an `active` pill state for the selected provider.
210
-
211
- ---
50
+ ## ⚙️ Improved
212
51
 
213
- ## Testing
52
+ - **Safer application data** — Mutable state now lives outside the Git checkout by default, with verified migration, conflict detection, `synabun doctor`, rotating checksum-verified backups, recovery tooling, and automatic MCP client path repair.
53
+ - **Neural Interface performance** — Memory Explorer virtualization, faster file-tree scanning, shared debounce/throttle utilities, idle render-loop pausing, cheaper graph interactions, reduced screencast work, and lower-cost terminal rendering improve large projects and long sessions.
54
+ - **Browser lifecycle diagnostics** — MoreLogin/CDP teardown, pinned-tab recovery, co-ownership, route validation, and failure reporting now fail closed and expose clearer recovery state.
55
+ - **Automation throughput** — Leaner iteration delays, reusable Facebook composer-state probing, full-content memory fetch by ID, and more efficient browser typing/snapshot guidance reduce repeated work and token use.
56
+ - **Accessible UI polish** — Added global reduced-motion support, refined navigation styling, responsive permissions layouts, and smoother window dragging, resizing, tooltips, and detail cards.
214
57
 
215
- ### Added — AskUserQuestion Manual QA Test Suite
216
- - **Test suite at `tests/ask-user-question/`** — Manual QA suite for the `AskUserQuestion` interactive question card across Claude, Codex, and OpenCode sidepanels. Each scenario is a directive copy-paste prompt that forces the panel CLI to invoke its `AskUserQuestion` equivalent (Claude `control_request`, Codex `request_user_input`, OpenCode `tool.start` / `question.asked`) with a specific shape, so visual and functional rendering can be verified across all three panels.
217
- - **`README.md`** — Master entry with the panel-to-render-function map (`renderAskUserQuestion()` in `neural-interface/public/shared/ui-claude-panel.js`, `renderUserInputRequest()` in `neural-interface/public/shared/cdx/cdx-requests.js`, `renderQuestionCard()` in `neural-interface/public/shared/ocp/ocp-render.js`), pre-flight steps, and recommended run order.
218
- - **`checklist.md`** — Per-panel verification checklist covering visual checks (header chip, options layout, `Submit (x/y)` progress, locked state, inter-block spacing) and functional checks (selection toggling, multi-select, "Other" / custom-input path, submit transmission, queue behavior). Includes a scenario × panel scoreboard.
219
- - **`master-prompt.md`** — Single 4-question stress prompt (mixed multi/single-select, long labels, descriptions) for end-to-end smoke testing after granular scenarios.
220
- - **`scenarios/01-12-*.md`** — 12 numbered scenarios covering single-select min/max, multi-select, batched 2/4-question cards with mixed types, `Other` / custom typed answer, sequential queue (`_questionQueue` / `processQuestionQueue`), plan-mode integration, long-content overflow, header-only cards, no-options free-text fallback, and cancel-mid-answer queue clearing.
58
+ Detailed technical notes: [v.2026.07.20-RAW.md](changelog/v.2026.07.20-RAW.md)
@@ -0,0 +1,33 @@
1
+ # SynaBun Commercial Licensing
2
+
3
+ ## Open Core Model
4
+
5
+ SynaBun uses an **Open Core** licensing model:
6
+
7
+ - **Open core** (this repository) — licensed under the [Apache License 2.0](./LICENSE). Free to use, modify, and distribute — including for commercial purposes.
8
+ - **Premium features** — enterprise extensions and premium capabilities may be offered under a separate commercial license.
9
+
10
+ ## What's in the Open Core?
11
+
12
+ Everything in this repository is Apache 2.0 licensed:
13
+
14
+ - The MCP server and bundled tool profiles
15
+ - The Neural Interface and agent sidepanels
16
+ - Lifecycle hooks and bundled skills
17
+ - Onboarding wizard and setup tooling
18
+ - All documentation
19
+
20
+ ## Premium & Enterprise
21
+
22
+ Premium features, enterprise support, and commercial extensions are available separately. These are not part of the open-source repository and are offered under their own terms.
23
+
24
+ For commercial licensing inquiries, contact:
25
+
26
+ - **Email:** chat@synabun.ai
27
+ - **GitHub:** [github.com/danilokhury/Synabun/issues](https://github.com/danilokhury/Synabun/issues)
28
+
29
+ ## Trademark
30
+
31
+ "SynaBun" is a trademark of its authors. The Apache 2.0 license does not grant permission to use the SynaBun name, logo, or branding. If you fork or redistribute this project, you must use a different name. You may reference SynaBun as the original project, but you must not imply official endorsement or affiliation.
32
+
33
+ See the [Trademark Notice](./README.md#trademark-notice) in the README for details.
package/NOTICE ADDED
@@ -0,0 +1,17 @@
1
+ SynaBun
2
+ Copyright 2025-2026 The SynaBun Authors
3
+
4
+ This product includes software developed at or by third parties,
5
+ licensed under the Apache License 2.0:
6
+
7
+ - Hugging Face Transformers.js (@huggingface/transformers)
8
+ Copyright 2023-2025 Hugging Face
9
+ https://github.com/huggingface/transformers.js
10
+
11
+ - TypeScript
12
+ Copyright 2012-2024 Microsoft Corporation
13
+ https://github.com/microsoft/TypeScript
14
+
15
+ This product also includes software licensed under the MIT License
16
+ and BSD-2-Clause License. See THIRD-PARTY-LICENSES.md for a complete
17
+ listing of all third-party software and their respective licenses.