synabun 2.4.1 → 2.4.3

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 (345) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +1 -1
  3. package/docs/browser-extension-bridge.md +46 -6
  4. package/lib/data-home-files.js +4 -2
  5. package/lib/first-launch-protection.js +8 -2
  6. package/lib/release-npm-ci.mjs +23 -1
  7. package/lib/update-snapshot.js +11 -4
  8. package/mcp-server/dist/http.d.ts.map +1 -1
  9. package/mcp-server/dist/http.js +25 -2
  10. package/mcp-server/dist/http.js.map +1 -1
  11. package/mcp-server/dist/index.d.ts.map +1 -1
  12. package/mcp-server/dist/index.js +62 -17
  13. package/mcp-server/dist/index.js.map +1 -1
  14. package/mcp-server/dist/services/browser-bench.d.ts +22 -22
  15. package/mcp-server/dist/services/memory-maintenance.d.ts +1 -0
  16. package/mcp-server/dist/services/memory-maintenance.d.ts.map +1 -1
  17. package/mcp-server/dist/services/memory-maintenance.js +34 -45
  18. package/mcp-server/dist/services/memory-maintenance.js.map +1 -1
  19. package/mcp-server/dist/services/memory-migration-copy.d.ts +144 -0
  20. package/mcp-server/dist/services/memory-migration-copy.d.ts.map +1 -0
  21. package/mcp-server/dist/services/memory-migration-copy.js +467 -0
  22. package/mcp-server/dist/services/memory-migration-copy.js.map +1 -0
  23. package/mcp-server/dist/services/memory-migration-worker.d.ts +2 -0
  24. package/mcp-server/dist/services/memory-migration-worker.d.ts.map +1 -0
  25. package/mcp-server/dist/services/memory-migration-worker.js +60 -0
  26. package/mcp-server/dist/services/memory-migration-worker.js.map +1 -0
  27. package/mcp-server/dist/services/memory-retrieval.d.ts +4 -0
  28. package/mcp-server/dist/services/memory-retrieval.d.ts.map +1 -1
  29. package/mcp-server/dist/services/memory-retrieval.js +188 -40
  30. package/mcp-server/dist/services/memory-retrieval.js.map +1 -1
  31. package/mcp-server/dist/services/memory-schema.d.ts +58 -2
  32. package/mcp-server/dist/services/memory-schema.d.ts.map +1 -1
  33. package/mcp-server/dist/services/memory-schema.js +190 -13
  34. package/mcp-server/dist/services/memory-schema.js.map +1 -1
  35. package/mcp-server/dist/services/memory-sessions.d.ts +19 -1
  36. package/mcp-server/dist/services/memory-sessions.d.ts.map +1 -1
  37. package/mcp-server/dist/services/memory-sessions.js +56 -20
  38. package/mcp-server/dist/services/memory-sessions.js.map +1 -1
  39. package/mcp-server/dist/services/memory-verification.d.ts.map +1 -1
  40. package/mcp-server/dist/services/memory-verification.js +8 -5
  41. package/mcp-server/dist/services/memory-verification.js.map +1 -1
  42. package/mcp-server/dist/services/neural-interface.d.ts +5 -0
  43. package/mcp-server/dist/services/neural-interface.d.ts.map +1 -1
  44. package/mcp-server/dist/services/neural-interface.js +19 -2
  45. package/mcp-server/dist/services/neural-interface.js.map +1 -1
  46. package/mcp-server/dist/services/retrieval-reader-worker.d.ts +2 -0
  47. package/mcp-server/dist/services/retrieval-reader-worker.d.ts.map +1 -0
  48. package/mcp-server/dist/services/retrieval-reader-worker.js +76 -0
  49. package/mcp-server/dist/services/retrieval-reader-worker.js.map +1 -0
  50. package/mcp-server/dist/services/retrieval-reader.d.ts +38 -0
  51. package/mcp-server/dist/services/retrieval-reader.d.ts.map +1 -0
  52. package/mcp-server/dist/services/retrieval-reader.js +145 -0
  53. package/mcp-server/dist/services/retrieval-reader.js.map +1 -0
  54. package/mcp-server/dist/services/sqlite-write.d.ts +14 -0
  55. package/mcp-server/dist/services/sqlite-write.d.ts.map +1 -0
  56. package/mcp-server/dist/services/sqlite-write.js +94 -0
  57. package/mcp-server/dist/services/sqlite-write.js.map +1 -0
  58. package/mcp-server/dist/services/sqlite.d.ts +39 -0
  59. package/mcp-server/dist/services/sqlite.d.ts.map +1 -1
  60. package/mcp-server/dist/services/sqlite.js +249 -8
  61. package/mcp-server/dist/services/sqlite.js.map +1 -1
  62. package/mcp-server/dist/services/tool-catalog.d.ts +1 -1
  63. package/mcp-server/dist/services/typesafe-config.d.ts +7 -1
  64. package/mcp-server/dist/services/typesafe-config.d.ts.map +1 -1
  65. package/mcp-server/dist/services/typesafe-config.js +32 -10
  66. package/mcp-server/dist/services/typesafe-config.js.map +1 -1
  67. package/mcp-server/dist/services/typesafe.d.ts.map +1 -1
  68. package/mcp-server/dist/services/typesafe.js +9 -7
  69. package/mcp-server/dist/services/typesafe.js.map +1 -1
  70. package/mcp-server/dist/services/vector-cache.d.ts +32 -0
  71. package/mcp-server/dist/services/vector-cache.d.ts.map +1 -1
  72. package/mcp-server/dist/services/vector-cache.js +161 -8
  73. package/mcp-server/dist/services/vector-cache.js.map +1 -1
  74. package/mcp-server/dist/tools/agent-definition.d.ts +2 -2
  75. package/mcp-server/dist/tools/agents.d.ts +11 -7
  76. package/mcp-server/dist/tools/agents.d.ts.map +1 -1
  77. package/mcp-server/dist/tools/agents.js +27 -9
  78. package/mcp-server/dist/tools/agents.js.map +1 -1
  79. package/mcp-server/dist/tools/browser-advanced.d.ts +1 -1
  80. package/mcp-server/dist/tools/browser-advanced.d.ts.map +1 -1
  81. package/mcp-server/dist/tools/browser-advanced.js +10 -3
  82. package/mcp-server/dist/tools/browser-advanced.js.map +1 -1
  83. package/mcp-server/dist/tools/browser-extension-setup.d.ts +5 -0
  84. package/mcp-server/dist/tools/browser-extension-setup.d.ts.map +1 -0
  85. package/mcp-server/dist/tools/browser-extension-setup.js +29 -0
  86. package/mcp-server/dist/tools/browser-extension-setup.js.map +1 -0
  87. package/mcp-server/dist/tools/browser-interact.d.ts.map +1 -1
  88. package/mcp-server/dist/tools/browser-interact.js +6 -1
  89. package/mcp-server/dist/tools/browser-interact.js.map +1 -1
  90. package/mcp-server/dist/tools/fb-groups.d.ts +2 -2
  91. package/mcp-server/dist/tools/skill-tools.d.ts +4 -4
  92. package/mcp-server/dist/tools/tool-groups.d.ts +1 -1
  93. package/mcp-server/package-lock.json +5 -5
  94. package/mcp-server/package.json +1 -1
  95. package/mcp-server/src/http.ts +20 -2
  96. package/mcp-server/src/index.ts +59 -17
  97. package/mcp-server/src/services/memory-maintenance.ts +31 -28
  98. package/mcp-server/src/services/memory-migration-copy.ts +419 -0
  99. package/mcp-server/src/services/memory-migration-worker.ts +55 -0
  100. package/mcp-server/src/services/memory-retrieval.ts +173 -32
  101. package/mcp-server/src/services/memory-schema.ts +194 -12
  102. package/mcp-server/src/services/memory-sessions.ts +54 -21
  103. package/mcp-server/src/services/memory-verification.ts +7 -4
  104. package/mcp-server/src/services/neural-interface.ts +22 -2
  105. package/mcp-server/src/services/retrieval-reader-worker.ts +67 -0
  106. package/mcp-server/src/services/retrieval-reader.ts +131 -0
  107. package/mcp-server/src/services/sqlite-write.ts +60 -0
  108. package/mcp-server/src/services/sqlite.ts +246 -8
  109. package/mcp-server/src/services/typesafe-config.ts +25 -6
  110. package/mcp-server/src/services/typesafe.ts +9 -7
  111. package/mcp-server/src/services/vector-cache.ts +154 -9
  112. package/mcp-server/src/tools/agents.ts +26 -9
  113. package/mcp-server/src/tools/browser-advanced.ts +10 -3
  114. package/mcp-server/src/tools/browser-extension-setup.ts +36 -0
  115. package/mcp-server/src/tools/browser-interact.ts +5 -1
  116. package/neural-interface/i18n/en.json +313 -2
  117. package/neural-interface/i18n/pt-BR.json +321 -10
  118. package/neural-interface/lib/agents/split.js +32 -4
  119. package/neural-interface/lib/assistant-api.js +52 -8
  120. package/neural-interface/lib/assistant-brains/claude.js +2 -0
  121. package/neural-interface/lib/assistant-brains/opencode.js +121 -7
  122. package/neural-interface/lib/assistant-catalog.js +2 -2
  123. package/neural-interface/lib/assistant-config.js +0 -7
  124. package/neural-interface/lib/assistant-dispatch.js +281 -95
  125. package/neural-interface/lib/assistant-envelope.js +40 -0
  126. package/neural-interface/lib/assistant-persona.js +16 -4
  127. package/neural-interface/lib/assistant-pricing.js +65 -14
  128. package/neural-interface/lib/assistant-router.js +131 -47
  129. package/neural-interface/lib/assistant-run-wait.js +45 -28
  130. package/neural-interface/lib/assistant-runtime.js +133 -42
  131. package/neural-interface/lib/backup-contents.js +158 -0
  132. package/neural-interface/lib/backup-crypto-io.js +330 -0
  133. package/neural-interface/lib/backup-crypto-worker.js +130 -0
  134. package/neural-interface/lib/backup-crypto.js +525 -0
  135. package/neural-interface/lib/backup-download.js +268 -0
  136. package/neural-interface/lib/backup-encryption.js +318 -0
  137. package/neural-interface/lib/backup-groups.js +287 -0
  138. package/neural-interface/lib/backup-restore-session.js +176 -0
  139. package/neural-interface/lib/backup-restore-stage.js +60 -0
  140. package/neural-interface/lib/backup-service.js +788 -233
  141. package/neural-interface/lib/backup-zip-reader.js +30 -18
  142. package/neural-interface/lib/backup-zip-writer.js +34 -10
  143. package/neural-interface/lib/browser-extension-adapter.js +89 -15
  144. package/neural-interface/lib/browser-extension-archive.js +149 -0
  145. package/neural-interface/lib/browser-extension-bridge.js +24 -10
  146. package/neural-interface/lib/browser-extension-folder.js +596 -76
  147. package/neural-interface/lib/browser-extension-package.js +200 -0
  148. package/neural-interface/lib/browser-extension-pin.js +84 -0
  149. package/neural-interface/lib/browser-extension-pin.json +33 -0
  150. package/{browser-extension/protocol.js → neural-interface/lib/browser-extension-protocol.js} +91 -6
  151. package/neural-interface/lib/browser-extension-setup.js +105 -18
  152. package/neural-interface/lib/claude-agent-bridge.js +1 -0
  153. package/neural-interface/lib/claude-session-cleanup.js +5 -1
  154. package/neural-interface/lib/cli-install.js +23 -3
  155. package/neural-interface/lib/cli-update-planner.js +171 -9
  156. package/neural-interface/lib/client-diagnostics.js +42 -0
  157. package/neural-interface/lib/confined-fs.js +7 -2
  158. package/neural-interface/lib/coordination/README.md +8 -2
  159. package/neural-interface/lib/coordination/contract.js +161 -0
  160. package/neural-interface/lib/coordination/database.js +999 -0
  161. package/neural-interface/lib/coordination/operations.js +436 -0
  162. package/neural-interface/lib/coordination/service.js +68 -537
  163. package/neural-interface/lib/coordination/storage-worker.js +101 -0
  164. package/neural-interface/lib/coordination/store.js +219 -1111
  165. package/neural-interface/lib/db.js +70 -32
  166. package/neural-interface/lib/health-count.js +37 -0
  167. package/neural-interface/lib/loop-stall.js +139 -0
  168. package/neural-interface/lib/maritaca/client.js +2 -2
  169. package/neural-interface/lib/maritaca/models.js +12 -17
  170. package/neural-interface/lib/maritaca/opencode.js +4 -2
  171. package/neural-interface/lib/memory-api.js +9 -1
  172. package/neural-interface/lib/memory-session-capture.js +42 -10
  173. package/neural-interface/lib/memory-store-gate.js +313 -0
  174. package/neural-interface/lib/memory-store-migrate.js +65 -0
  175. package/neural-interface/lib/memory-timers.js +7 -7
  176. package/neural-interface/lib/native-loop-providers.js +23 -17
  177. package/neural-interface/lib/native-loop-runtime.js +48 -9
  178. package/neural-interface/lib/opencode-build-preflight.js +18 -1
  179. package/neural-interface/lib/opencode-native-boundary.js +69 -8
  180. package/neural-interface/lib/opencode-provider-view.js +14 -3
  181. package/neural-interface/lib/opencode-shell-read.js +107 -0
  182. package/neural-interface/lib/opencode-stop-failures.js +40 -0
  183. package/neural-interface/lib/opencode-turn-release.js +173 -0
  184. package/neural-interface/lib/opencode-v2-client.js +4 -1
  185. package/neural-interface/lib/opencode-v2-ws-requests.js +65 -1
  186. package/neural-interface/lib/opencode2-client.js +343 -7
  187. package/neural-interface/lib/opencode2-translate.js +161 -4
  188. package/neural-interface/lib/recall-impact.js +122 -0
  189. package/neural-interface/lib/scratch-evidence.js +420 -0
  190. package/neural-interface/lib/scratch-process-guard.js +139 -0
  191. package/neural-interface/lib/scratch-references.js +279 -0
  192. package/neural-interface/lib/scratch-retention-core.js +385 -0
  193. package/neural-interface/lib/scratch-retention-worker.js +37 -0
  194. package/neural-interface/lib/scratch-retention.js +151 -0
  195. package/neural-interface/lib/session-cache-builder.js +31 -43
  196. package/neural-interface/lib/session-cache-worker.js +157 -0
  197. package/neural-interface/lib/session-indexer.js +28 -21
  198. package/neural-interface/lib/session-search-index.js +85 -0
  199. package/neural-interface/lib/skills/creation.js +1 -1
  200. package/neural-interface/lib/sqlite-integrity-worker.js +3 -1
  201. package/neural-interface/lib/style-guide/store.js +43 -3
  202. package/neural-interface/lib/system-restore.js +50 -0
  203. package/neural-interface/lib/teams/api.js +15 -6
  204. package/neural-interface/lib/teams/claims.js +67 -31
  205. package/neural-interface/lib/teams/index.js +7 -7
  206. package/neural-interface/lib/teams/integration.js +40 -40
  207. package/neural-interface/lib/teams/landing.js +6 -6
  208. package/neural-interface/lib/teams/recovery.js +24 -23
  209. package/neural-interface/lib/teams/scheduler.js +194 -95
  210. package/neural-interface/lib/teams/state.js +14 -14
  211. package/neural-interface/lib/teams/worktrees.js +27 -27
  212. package/neural-interface/lib/terminal-token-redaction.js +83 -0
  213. package/neural-interface/lib/whatsapp/bridge.js +54 -7
  214. package/neural-interface/lib/worker-confinement.js +47 -2
  215. package/neural-interface/lib/worker-mcp-channel.js +2 -0
  216. package/neural-interface/lib/worker-resume.js +5 -0
  217. package/neural-interface/lib/worker-stop.js +86 -0
  218. package/neural-interface/package-lock.json +5 -5
  219. package/neural-interface/package.json +1 -1
  220. package/neural-interface/public/extension-setup.html +5 -2
  221. package/neural-interface/public/index.html +233 -24
  222. package/neural-interface/public/onboarding.html +259 -34
  223. package/neural-interface/public/shared/agents/studio/ax-library.js +0 -6
  224. package/neural-interface/public/shared/agents/studio/ax-main.js +14 -7
  225. package/neural-interface/public/shared/agy/agy-options.js +11 -0
  226. package/neural-interface/public/shared/agy/agy-panel.js +67 -20
  227. package/neural-interface/public/shared/agy/agy-styles.js +14 -12
  228. package/neural-interface/public/shared/agy/agy-tabs-logic.js +4 -1
  229. package/neural-interface/public/shared/api.js +1 -1
  230. package/neural-interface/public/shared/assistant/asst-api.js +28 -3
  231. package/neural-interface/public/shared/assistant/asst-brain-picker.js +13 -6
  232. package/neural-interface/public/shared/assistant/asst-control.js +2 -0
  233. package/neural-interface/public/shared/assistant/asst-motion-gate.js +78 -4
  234. package/neural-interface/public/shared/assistant/asst-panel.js +87 -3
  235. package/neural-interface/public/shared/assistant/asst-rack-styles.js +27 -0
  236. package/neural-interface/public/shared/assistant/asst-render.js +243 -44
  237. package/neural-interface/public/shared/assistant/asst-route.js +100 -21
  238. package/neural-interface/public/shared/assistant/asst-routes-editor.js +1 -1
  239. package/neural-interface/public/shared/assistant/asst-shell-logic.js +200 -0
  240. package/neural-interface/public/shared/assistant/asst-shell.js +111 -0
  241. package/neural-interface/public/shared/assistant/asst-sidepanel.js +4 -2
  242. package/neural-interface/public/shared/assistant/asst-state.js +11 -0
  243. package/neural-interface/public/shared/assistant/asst-styles.js +11 -23
  244. package/neural-interface/public/shared/assistant/route-identity.js +2 -1
  245. package/neural-interface/public/shared/cdx/cdx-render.js +9 -0
  246. package/neural-interface/public/shared/cdx/cdx-settings.js +3 -1
  247. package/neural-interface/public/shared/cdx/cdx-styles.js +6 -0
  248. package/neural-interface/public/shared/cdx/cdx-tabs.js +54 -9
  249. package/neural-interface/public/shared/client-diagnostics.js +94 -0
  250. package/neural-interface/public/shared/cp/cp-markdown.js +7 -2
  251. package/neural-interface/public/shared/cp/cp-styles.js +1 -1
  252. package/neural-interface/public/shared/effort-i18n.js +118 -0
  253. package/neural-interface/public/shared/extension-setup/es-page.js +10 -4
  254. package/neural-interface/public/shared/extension-setup/es-view.js +25 -10
  255. package/neural-interface/public/shared/html-shell.js +4 -52
  256. package/neural-interface/public/shared/loading-diagnostic-entry.js +64 -0
  257. package/neural-interface/public/shared/memory-store-wait.js +52 -0
  258. package/neural-interface/public/shared/morelogin-profile-field.js +1 -1
  259. package/neural-interface/public/shared/mtc/mtc-logic.js +2 -1
  260. package/neural-interface/public/shared/mtc/mtc-panel.js +25 -3
  261. package/neural-interface/public/shared/mtc/mtc-styles.js +13 -12
  262. package/neural-interface/public/shared/ocp-v2/ocp-v2-childpanel.js +7 -0
  263. package/neural-interface/public/shared/ocp-v2/ocp-v2-events.js +5 -0
  264. package/neural-interface/public/shared/ocp-v2/ocp-v2-location-logic.js +109 -0
  265. package/neural-interface/public/shared/ocp-v2/ocp-v2-manager.js +1 -0
  266. package/neural-interface/public/shared/ocp-v2/ocp-v2-modelpicker.js +8 -1
  267. package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +152 -8
  268. package/neural-interface/public/shared/ocp-v2/ocp-v2-rehydrate.js +7 -1
  269. package/neural-interface/public/shared/ocp-v2/ocp-v2-render.js +53 -4
  270. package/neural-interface/public/shared/ocp-v2/ocp-v2-send.js +52 -6
  271. package/neural-interface/public/shared/ocp-v2/ocp-v2-session-actions.js +22 -2
  272. package/neural-interface/public/shared/ocp-v2/ocp-v2-shell-block.js +165 -0
  273. package/neural-interface/public/shared/ocp-v2/ocp-v2-shell-logic.js +346 -0
  274. package/neural-interface/public/shared/ocp-v2/ocp-v2-shell.js +108 -0
  275. package/neural-interface/public/shared/ocp-v2/ocp-v2-state.js +49 -3
  276. package/neural-interface/public/shared/ocp-v2/ocp-v2-styles.js +67 -93
  277. package/neural-interface/public/shared/ocp-v2/ocp-v2-tools-logic.js +20 -5
  278. package/neural-interface/public/shared/ocp-v2/ocp-v2-tools.js +7 -1
  279. package/neural-interface/public/shared/ocp-v2/ocp-v2-variantpicker.js +17 -6
  280. package/neural-interface/public/shared/ocp-v2/ocp-v2-ws.js +7 -2
  281. package/neural-interface/public/shared/output-format.js +294 -0
  282. package/neural-interface/public/shared/provider-icons.js +6 -0
  283. package/neural-interface/public/shared/schedules-view.js +2 -1
  284. package/neural-interface/public/shared/server-presence.js +77 -0
  285. package/neural-interface/public/shared/settings/settings-backup-contents.js +241 -0
  286. package/neural-interface/public/shared/settings/settings-backup-download.js +298 -0
  287. package/neural-interface/public/shared/settings/settings-backup-encryption-pane.js +335 -0
  288. package/neural-interface/public/shared/settings/settings-backup-encryption.js +545 -0
  289. package/neural-interface/public/shared/settings/settings-browser-extension.js +54 -12
  290. package/neural-interface/public/shared/settings/settings-ia.js +1 -1
  291. package/neural-interface/public/shared/shell-stop-view.js +83 -0
  292. package/neural-interface/public/shared/skills/studio/sx-geometry.js +12 -3
  293. package/neural-interface/public/shared/skills/studio/sx-main.js +14 -7
  294. package/neural-interface/public/shared/studio-attention.js +6 -0
  295. package/neural-interface/public/shared/styles.css +341 -437
  296. package/neural-interface/public/shared/tour/tour-actor.js +14 -3
  297. package/neural-interface/public/shared/transcript-rows.js +28 -3
  298. package/neural-interface/public/shared/tray-auto-close.js +49 -6
  299. package/neural-interface/public/shared/ui-agents.js +1 -2
  300. package/neural-interface/public/shared/ui-automation-studio.js +168 -108
  301. package/neural-interface/public/shared/ui-claude-panel.js +62 -65
  302. package/neural-interface/public/shared/ui-loading.js +124 -17
  303. package/neural-interface/public/shared/ui-native-loop-router.js +52 -0
  304. package/neural-interface/public/shared/ui-navbar.js +2 -1
  305. package/neural-interface/public/shared/ui-output.js +533 -0
  306. package/neural-interface/public/shared/ui-schedules-studio.js +165 -128
  307. package/neural-interface/public/shared/ui-scroll-follow.js +101 -6
  308. package/neural-interface/public/shared/ui-sessions.js +2 -2
  309. package/neural-interface/public/shared/ui-settings-entry.js +18 -0
  310. package/neural-interface/public/shared/ui-settings.js +224 -65
  311. package/neural-interface/public/shared/ui-sidepanel-tray.js +3 -2
  312. package/neural-interface/public/shared/ui-tooltip.js +16 -0
  313. package/neural-interface/public/shared/ui-tutorial.js +5 -6
  314. package/neural-interface/public/shared/ui-worker-end.js +27 -8
  315. package/neural-interface/public/shared/worker-end.js +9 -4
  316. package/neural-interface/public/variant/2d/main.js +5 -0
  317. package/neural-interface/public/variant/3d/app.js +10 -0
  318. package/neural-interface/public/variant/3d/main.js +5 -1
  319. package/neural-interface/scripts/scratch-retention.mjs +20 -0
  320. package/neural-interface/server.js +725 -173
  321. package/npm-shrinkwrap.json +5 -5
  322. package/package.json +1 -2
  323. package/scripts/restore-data-home-from-backup.mjs +175 -8
  324. package/setup.js +18 -4
  325. package/browser-extension/content.js +0 -189
  326. package/browser-extension/engine.js +0 -508
  327. package/browser-extension/icons/icon-128.png +0 -0
  328. package/browser-extension/icons/icon-16.png +0 -0
  329. package/browser-extension/icons/icon-32.png +0 -0
  330. package/browser-extension/icons/icon-48.png +0 -0
  331. package/browser-extension/icons/status-off-16.png +0 -0
  332. package/browser-extension/icons/status-off-32.png +0 -0
  333. package/browser-extension/icons/status-off-48.png +0 -0
  334. package/browser-extension/icons/status-on-16.png +0 -0
  335. package/browser-extension/icons/status-on-32.png +0 -0
  336. package/browser-extension/icons/status-on-48.png +0 -0
  337. package/browser-extension/manifest.json +0 -56
  338. package/browser-extension/popup-strings.js +0 -250
  339. package/browser-extension/popup-view.js +0 -151
  340. package/browser-extension/popup.css +0 -166
  341. package/browser-extension/popup.html +0 -108
  342. package/browser-extension/popup.js +0 -359
  343. package/browser-extension/service-worker.js +0 -275
  344. package/browser-extension/setup-content.js +0 -36
  345. package/browser-extension/tokens.css +0 -326
@@ -9,6 +9,7 @@ import { KEYS } from '../constants.js';
9
9
  import { isNewerRunDescriptor } from '../ui-native-loop-router-state.js';
10
10
  import { modelEffortIds } from '../agent-runtime-options.js';
11
11
  import { getProviderMeta } from '../provider-icons.js';
12
+ import { translatedEffortWord } from '../effort-i18n.js';
12
13
  import { usagePacketIsStale } from './asst-usage.js';
13
14
 
14
15
  // The providers the Assistant itself can run on (its brain): the brain picker, /model and /new.
@@ -746,6 +747,16 @@ export function brainEffortChoices(provider, levels) {
746
747
  return rest.length ? [auto, { id: ROUTE_EFFORT_OFF, label: 'Off', desc: 'No thinking', key: 'none' }, ...rest] : [auto];
747
748
  }
748
749
 
750
+ /**
751
+ * A footer effort level's word in the user's language, for display only (the id that is stored and sent
752
+ * never changes). Reads `assistant.routes.effortWord.<id>`; a locale that only repeats the English word, a
753
+ * level with no such key (OpenCode variants, Auto / Default) and a missing translator keep `label`.
754
+ */
755
+ export function brainEffortWord(id, label, t) {
756
+ // Auto / Default (`off`) rows have words of their own (assistant.brain.effortAuto), never an effort word.
757
+ return translatedEffortWord(str(id), t) ?? label;
758
+ }
759
+
749
760
  /**
750
761
  * The effort a typed `/model <model> <effort>` stores. Claude Code: off / none / no / disabled is Off
751
762
  * (`none`: no thinking, as the picker's Off) and auto / default is the model's default (null); a level
@@ -16,10 +16,13 @@
16
16
  // prefers-reduced-motion.
17
17
 
18
18
  import { installCodeCopy } from '../ui-code-copy.js';
19
+ import { installOutput } from '../ui-output.js';
19
20
 
20
21
  export function injectAssistantStyles() {
21
22
  // The Copy button of every code block: its stylesheet and its one click listener, in this document.
22
23
  installCodeCopy(document);
24
+ // The reading layer of an agent's answer (prose, tables, code): one stylesheet for the six panels.
25
+ installOutput(document);
23
26
  if (document.getElementById('assistant-panel-styles')) return;
24
27
  const style = document.createElement('style');
25
28
  style.id = 'assistant-panel-styles';
@@ -431,27 +434,9 @@ export function injectAssistantStyles() {
431
434
  /* A prompt written outside the panel (WhatsApp Link). */
432
435
  .asst-msg-origin { margin-top: 3px; padding: 0 4px; color: var(--asst-text-3, var(--asst-text-2)); font-size: 11px; line-height: 1.3; }
433
436
 
434
- .asst-md { color: var(--asst-text); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
435
- .asst-md > :first-child { margin-top: 0; }
436
- .asst-md > :last-child { margin-bottom: 0; }
437
- .asst-md p { margin: 0 0 10px; }
438
- .asst-md :is(h1, h2, h3, h4) { margin: 16px 0 8px; color: var(--asst-text); font-weight: 600; line-height: 1.3; }
439
- .asst-md h1 { font-size: 18px; }
440
- .asst-md h2 { font-size: 16px; }
441
- .asst-md :is(h3, h4) { font-size: 14px; }
442
- .asst-md :is(ul, ol) { margin: 0 0 10px; padding-left: 22px; }
443
- .asst-md li { margin: 3px 0; }
444
- .asst-md li::marker { color: var(--asst-text-3); }
445
- .asst-md code { padding: 1px 5px; border-radius: 5px; background: var(--asst-fill-2); font-family: var(--asst-mono); font-size: .86em; }
446
- .asst-md pre { margin: 8px 0 12px; padding: 10px 12px; overflow-x: auto; border: 1px solid var(--asst-line); border-radius: 8px; background: var(--asst-field); }
447
- .asst-md pre code { padding: 0; background: transparent; font-size: 12.5px; line-height: 1.55; }
448
- .asst-md blockquote { margin: 8px 0; padding: 2px 12px; border-left: 2px solid var(--asst-line-2); color: var(--asst-text-2); }
449
- .asst-md :is(a, .file-link) { color: var(--asst-focus); text-decoration: none; cursor: pointer; }
450
- .asst-md a:hover { text-decoration: underline; }
451
- .asst-md table { display: block; max-width: 100%; overflow-x: auto; margin: 8px 0 12px; border-collapse: collapse; font-size: 12.5px; }
452
- .asst-md :is(th, td) { padding: 5px 10px; border: 1px solid var(--asst-line); text-align: left; }
453
- .asst-md th { color: var(--asst-text-2); font-weight: 600; background: var(--asst-field); }
454
- .asst-md hr { margin: 12px 0; border: 0; border-top: 1px solid var(--asst-line); }
437
+ /* An answer's prose, tables and code are the shared reading layer (../ui-output.js): one system for the six
438
+ side panels. A tag is never styled here again; this panel's voice is the --sbo-* values that sheet gives .asst-md. */
439
+ .asst-md .file-link { cursor: pointer; }
455
440
 
456
441
  .asst-thinking { color: var(--asst-text-3); font-size: 12.5px; }
457
442
  .asst-thinking summary {
@@ -484,6 +469,7 @@ export function injectAssistantStyles() {
484
469
  .asst-status { color: var(--asst-text-3); font-size: 12px; }
485
470
  .asst-status.info { color: var(--asst-text-2); }
486
471
  .asst-status.error { color: var(--asst-live); }
472
+ .asst-status .asst-stop-anyway { margin-left: 8px; vertical-align: baseline; }
487
473
  .asst-divider { display: flex; align-items: center; gap: 10px; color: var(--asst-text-3); font-size: 11px; }
488
474
  .asst-divider::before, .asst-divider::after { content: ''; flex: 1; height: 1px; background: var(--asst-line); }
489
475
 
@@ -1970,7 +1956,9 @@ export function injectAssistantStyles() {
1970
1956
  .asst-routes-overlay .asst-routes-list { display: block; background: var(--asst-field); border: 1px solid var(--asst-line-2); border-radius: var(--asst-r-field); padding: 0; }
1971
1957
  .asst-routes-group { display: grid; grid-template-columns: 96px minmax(0, 1fr); min-width: 0; padding: 4px 8px; column-gap: 8px; }
1972
1958
  .asst-routes-group + .asst-routes-group { border-top: 1px solid var(--asst-line-2); }
1973
- .asst-routes-group > h3 { grid-area: 1 / 1; margin: 0; padding: 7px 4px; font-size: 12px; line-height: 1.45; font-weight: 600; color: var(--asst-text-2); overflow-wrap: anywhere; }
1959
+ /* The label stands beside its group, over the first three rows: one that wraps in its narrow column
1960
+ ("Web & desktop") takes that height from them, never from the first row alone (it was stretched to 48.78px). */
1961
+ .asst-routes-group > h3 { grid-area: 1 / 1 / span 3; margin: 0; padding: 7px 4px; font-size: 12px; line-height: 1.45; font-weight: 600; color: var(--asst-text-2); overflow-wrap: anywhere; }
1974
1962
  .asst-routes-overlay .asst-routes-row { display: block; padding: 0; grid-column: 2; border: 0; }
1975
1963
  .asst-routes-overlay .asst-routes-row + .asst-routes-row { border-top: 1px solid var(--asst-line); }
1976
1964
  .asst-routes-toggle { display: grid; grid-template-columns: minmax(0, 37%) minmax(0, 1fr) auto 12px; align-items: center; gap: 6px; width: 100%; min-height: 30px; padding: 4px 6px; border: 0; border-radius: var(--asst-pill-r-xs); background: transparent; color: var(--asst-text); text-align: start; font: inherit; cursor: pointer; }
@@ -2083,7 +2071,7 @@ export function injectAssistantStyles() {
2083
2071
  .asst-status.warn { color: var(--asst-warn); }
2084
2072
  .asst-msg.asst-msg-error .asst-msg-content { padding: 6px 10px; border-radius: var(--asst-r-field); box-shadow: inset 2px 0 0 var(--asst-live), inset 0 0 0 1px color-mix(in srgb, var(--asst-live) 28%, transparent); }
2085
2073
  .asst-local-output { padding-left: 12px; border-left: 2px solid var(--asst-line-2); }
2086
- .asst-local-output .asst-md { color: var(--asst-text-2); font-size: 13px; }
2074
+ .asst-local-output .asst-md { --sbo-text: var(--asst-text-2); --sbo-size: 13px; }
2087
2075
 
2088
2076
  /* The panel's one status line for screen readers (the transcript is not a live region). */
2089
2077
  .asst-announce { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@@ -7,7 +7,8 @@ export function routeTaskIdentity(route) {
7
7
  // Control packets and transcript events can arrive in either order on attach/reconnect.
8
8
  export function createRouteReplayGuard() {
9
9
  const seen = new Set();
10
- const keys = route => [route?.routeId, routeTaskIdentity(route)].filter(Boolean);
10
+ // A host-only replacement can share a task with a retired worker card.
11
+ const keys = route => [route?.routeId, route?.needsHost ? null : routeTaskIdentity(route)].filter(Boolean);
11
12
  return {
12
13
  has: route => keys(route).some(key => seen.has(key)),
13
14
  record: route => { for (const key of keys(route)) seen.add(key); },
@@ -23,6 +23,8 @@ import { createTextCache } from '../text-cache.js';
23
23
  import { morphChildren } from '../dom-morph.js';
24
24
  import { withCodeCopyButtons } from '../code-copy.js';
25
25
  import { decorateCodeBlocks, installCodeCopy } from '../ui-code-copy.js';
26
+ import { withOutputFrames } from '../output-format.js';
27
+ import { decorateOutput, installOutput } from '../ui-output.js';
26
28
  import { isSynabunServer, synabunToolKey, synabunToolLabel, synabunToolSummary } from '../synabun-tools.js';
27
29
  export { setCardExpanded } from './cdx-cards.js';
28
30
 
@@ -92,6 +94,8 @@ export function setRenderContext(ctx) {
92
94
  // The Copy button of every code block works in this document (its stylesheet and one click listener). Here, not
93
95
  // in injectStyles: cdx-styles.js is also run as a plain script (tests/provider-panel-terminal-auth-fixture.mjs).
94
96
  if (typeof document !== 'undefined') installCodeCopy(document);
97
+ // The same for the reading layer of an answer (prose, tables, code): ../ui-output.js.
98
+ if (typeof document !== 'undefined') installOutput(document);
95
99
  }
96
100
 
97
101
  // ═══════════════════════════════════════════
@@ -157,6 +161,9 @@ export function md(text) {
157
161
  catch { html = markdownFallback(key); }
158
162
  // Every code block carries the shared Copy button, written in after the sanitiser (../code-copy.js).
159
163
  html = withCodeCopyButtons(html);
164
+ // The reading layer all six panels share: a table's frame, task items, a block's language (../output-format.js).
165
+ // highlight.js colours a diff here, so its lines are left to it.
166
+ html = withOutputFrames(html, { diff: false });
160
167
  _mdCache.set(key, html);
161
168
  return html;
162
169
  }
@@ -838,6 +845,8 @@ export function sanitizeStoredTranscriptDom(container) {
838
845
  restoreDiffViews(container, { cwd: _ctx.boundTab?.project || _ctx.project });
839
846
  // A snapshot's blocks get the shared Copy button; an older one's own button (.cxp-copy-btn) is replaced.
840
847
  decorateCodeBlocks(container, { skip: codexOwnCopy });
848
+ // And an answer saved before the reading layer gets its tables framed (../ui-output.js): Markdown bodies only.
849
+ container.querySelectorAll('.cxp-msg-assistant .cxp-msg-body, .cxp-plan-card .cxp-msg-body').forEach((body) => decorateOutput(body, { diff: false }));
841
850
  }
842
851
 
843
852
  // ═══════════════════════════════════════════
@@ -1,5 +1,7 @@
1
1
  import { t, getLocale } from '../i18n.js';
2
2
  import { accountSummary } from '../account-view.js';
3
+ import { codexEffortLabel } from '../effort-i18n.js';
4
+ import { cxpText } from './cdx-copy.js';
3
5
  import { configChanges, configRestriction, configValue, SESSION_CONFIG_FIELDS, sessionSettings, modelServiceTiers, capabilityAvailability } from './cdx-commands.js';
4
6
  import { mountCodexAccountSecurity } from './cdx-features.js';
5
7
 
@@ -23,7 +25,7 @@ export function codexSettingsDefinitions(schema, models, cfg) {
23
25
  if (key === 'service_tier' && cfg.model_provider && cfg.model_provider !== 'openai') return [];
24
26
  let options = (field.values || []).map(value => ({ value, label: tr(`values.${value}`) === `codexSettings.values.${value}` ? value : tr(`values.${value}`) }));
25
27
  if (key === 'model' || key === 'review_model') options = modelOptions;
26
- if (key === 'model_reasoning_effort') options = (model?.supportedReasoningEfforts || []).map(e => ({ value: e.reasoningEffort, label: e.reasoningEffort }));
28
+ if (key === 'model_reasoning_effort') options = (model?.supportedReasoningEfforts || []).map(e => ({ value: e.reasoningEffort, label: codexEffortLabel(e.reasoningEffort, e.reasoningEffort, cxpText) }));
27
29
  if (key === 'service_tier') options = modelServiceTiers(model);
28
30
  if (key === 'personality' && !model?.supportsPersonality) return [];
29
31
  // The provider list is configured locally. Built-in OpenAI plus named providers.
@@ -3331,6 +3331,12 @@ export function injectStyles() {
3331
3331
  transition: none !important;
3332
3332
  }
3333
3333
  }
3334
+
3335
+ /* ── Reading pass (2026-11-21) ──
3336
+ An answer's prose, tables and code are ../ui-output.js (it overrides the .cxp-msg-body rules above for an
3337
+ answer and a plan; they still style a card's body). Here: what the user wrote reads at the answer's size. */
3338
+ .cxp-msg-user .cxp-msg-body, .cxp-msg-user-text { font-size: var(--cxp-fs-lg); }
3339
+ .cxp-msg-assistant[data-phase="final_answer"] .cxp-msg-phase { color: var(--cxp-text-2); }
3334
3340
  `;
3335
3341
  document.head.appendChild(style);
3336
3342
  }
@@ -4,6 +4,7 @@ import { cxpText, cxpSessionLabel } from './cdx-copy.js';
4
4
  import { codexWantsRolloutPreview, rolloutPreviewApplies } from './cdx-preview.js';
5
5
  import { mountCodexSettings } from './cdx-settings.js';
6
6
  import { t } from '../i18n.js';
7
+ import { codexEffortDesc, codexEffortLabel, translatedEffortWord } from '../effort-i18n.js';
7
8
  import { getCliState, isCliInstalling } from '../cli-status.js';
8
9
  import { cliInstallText } from '../cli-install-view.js';
9
10
  // ═══════════════════════════════════════════
@@ -44,6 +45,7 @@ import { isFarRowStyleRecord, stripFarRowStyles, watchTranscriptRows } from '../
44
45
  import { requestGeneratedSessionTitle } from '../session-title.js';
45
46
  import { fileLinkText } from '../ui-file-links.js';
46
47
  import { WORKER_END_CLASS, buildWorkerEndCard, endWorkerRunOnClose, forgetWorkerEnd, leaveWorkerTab } from '../ui-worker-end.js';
48
+ import { composerHoldsDraft, markAutoCloseKeep } from '../tray-auto-close.js';
47
49
  import {
48
50
  CODEX_COMMANDS, CODEX_COMMAND_BY_NAME, parseCodexCommand, codexCommandHints,
49
51
  capabilityAvailability, latestCompletedCodexText, configValue,
@@ -1972,16 +1974,32 @@ function formatContextTrackerState(meta) {
1972
1974
  return 'pending';
1973
1975
  }
1974
1976
 
1977
+ // List-price equivalents ($/MTok) matching neural-interface/lib/assistant-pricing.js (verified 2026-11-20).
1975
1978
  const CODEX_MODEL_PRICING = {
1979
+ 'gpt-6.2-astra': { input: 8.00, cachedInput: 0.40, cacheWrite: 10.00, output: 40.00 },
1980
+ 'gpt-6.2-sol': { input: 2.00, cachedInput: 0.10, cacheWrite: 2.50, output: 10.00 },
1981
+ 'gpt-6-astra': { input: 10.00, cachedInput: 1.00, cacheWrite: 12.50, output: 50.00 },
1982
+ 'gpt-6.1-sol': { input: 2.00, cachedInput: 0.10, cacheWrite: 2.50, output: 10.00 },
1983
+ 'gpt-6.1-terra': { input: 1.00, cachedInput: 0.05, cacheWrite: 1.25, output: 5.00 },
1984
+ 'gpt-6-sol': { input: 2.00, cachedInput: 0.20, cacheWrite: 2.50, output: 10.00 },
1985
+ 'gpt-6-luna': { input: 0.10, cachedInput: 0.01, cacheWrite: 0.125, output: 0.50 },
1986
+ 'gpt-5.6-sol': { input: 4.00, cachedInput: 0.40, cacheWrite: 5.00, output: 20.00 },
1987
+ 'gpt-5.6-terra': { input: 2.00, cachedInput: 0.20, cacheWrite: 2.50, output: 12.00 },
1988
+ 'gpt-5.6-luna': { input: 0.20, cachedInput: 0.02, cacheWrite: 0.25, output: 1.20 },
1989
+ 'gpt-5.5': { input: 5.00, cachedInput: 0.50, output: 30.00 },
1990
+ 'gpt-5.4': { input: 2.50, cachedInput: 0.25, output: 15.00 },
1991
+ 'gpt-5.4-mini': { input: 0.75, cachedInput: 0.075, output: 4.50 },
1992
+ 'gpt-5.3-codex': { input: 1.75, cachedInput: 0.175, output: 14.00 },
1976
1993
  'gpt-5.2-codex': { input: 1.75, cachedInput: 0.175, output: 14.00 },
1977
1994
  'gpt-5.1-codex-max': { input: 1.25, cachedInput: 0.125, output: 10.00 },
1978
1995
  'gpt-5.1-codex': { input: 1.25, cachedInput: 0.125, output: 10.00 },
1979
1996
  'gpt-5.1-codex-mini': { input: 0.25, cachedInput: 0.025, output: 2.00 },
1980
1997
  'gpt-5-codex': { input: 1.25, cachedInput: 0.125, output: 10.00 },
1998
+ 'chat-latest': { input: 5.00, cachedInput: 0.50, output: 30.00 },
1981
1999
  };
1982
2000
 
1983
2001
  function getModelPricing(model) {
1984
- const key = String(model || '').trim().toLowerCase();
2002
+ const key = String(model || '').trim().toLowerCase().replace(/\[[^\]]*\]$/, '').replace(/^.*\//, '').replace(/-\d{8}$/, '');
1985
2003
  return CODEX_MODEL_PRICING[key] || null;
1986
2004
  }
1987
2005
 
@@ -2668,6 +2686,24 @@ function hasMeaningfulTrayState(tab) {
2668
2686
  );
2669
2687
  }
2670
2688
 
2689
+ /**
2690
+ * What the tray's auto-close must leave open (tray-auto-close.js), or '': a tab with prompts in its queue that
2691
+ * were never sent ('queue': a paused queue, or one held behind a request or a plan approval), else a tab holding
2692
+ * an unsent draft, its text (in the composer while the tab is the one on screen), images, paths and @ mentions.
2693
+ * The user's X closes it as before. markQueueKeep repaints the mark at every change of a queue.
2694
+ */
2695
+ function autoCloseKeepOf(tab) {
2696
+ if (!tab) return '';
2697
+ if (tab.queue?.length) return 'queue';
2698
+ const input = isActiveTab(tab) ? panelEl('#cxp-input') : null;
2699
+ return composerHoldsDraft(input ? input.value : tab.draft, tab.attachedImages, tab.pendingPaths, tab.pendingMentions) ? 'draft' : '';
2700
+ }
2701
+
2702
+ /** Says a tab's keep reason to its pill: wherever a queue changes, the tab on screen's or one in the background. */
2703
+ function markQueueKeep(tab) {
2704
+ if (tab?.pillEl) markAutoCloseKeep(tab.pillEl, autoCloseKeepOf(tab));
2705
+ }
2706
+
2671
2707
  function hasCustomSessionLabel(tab) {
2672
2708
  const label = normalizeSessionLabel(tab?.pendingSessionLabel || tab?.sessionLabel || '');
2673
2709
  if (!label) return false;
@@ -2751,6 +2787,8 @@ function createTrayPill(tab) {
2751
2787
  const pill = document.createElement('div');
2752
2788
  pill.className = 'term-minimized-pill cxp-session-pill';
2753
2789
  pill.dataset.tabId = tab.id;
2790
+ pill.getAutomationRunId = () => tab.automationRunId;
2791
+ pill.keepFromAutoClose = () => autoCloseKeepOf(tab);
2754
2792
  pill.innerHTML = `
2755
2793
  <span class="term-minimized-pill-icon">${OPENAI_ICON}</span>
2756
2794
  <span class="term-minimized-pill-label">${esc(tab.sessionLabel || 'New session')}</span>
@@ -2796,6 +2834,7 @@ export function renderPills() {
2796
2834
  const name = tab.sessionLabel || 'New session';
2797
2835
  if (label && label.textContent !== name) label.textContent = name;
2798
2836
  paintTrayPill(tab.pillEl, tab);
2837
+ markAutoCloseKeep(tab.pillEl, autoCloseKeepOf(tab));
2799
2838
  const shouldShow = hasMeaningfulTrayState(tab) && (!_getVisible() || tab !== active);
2800
2839
  tab.pillEl.style.display = shouldShow ? '' : 'none';
2801
2840
  }
@@ -3055,7 +3094,7 @@ export function closeTab(idx, { detachAutomation = false } = {}) {
3055
3094
  endWorkerRunOnClose(runId, () => fetch('/api/loop/stop', {
3056
3095
  method: 'POST',
3057
3096
  headers: { 'Content-Type': 'application/json' },
3058
- body: JSON.stringify({ runId }),
3097
+ body: JSON.stringify({ runId, action: 'tab_close' }),
3059
3098
  }).catch(() => {}));
3060
3099
  }
3061
3100
  if (tab.automationRunId) forgetWorkerEnd(tab.automationRunId);
@@ -5976,10 +6015,10 @@ export function renderEffortMenu() {
5976
6015
  item.dataset.value = option.id;
5977
6016
  const label = document.createElement('span');
5978
6017
  label.className = 'cxp-effort-menu-label';
5979
- label.textContent = option.label;
6018
+ label.textContent = codexEffortLabel(option.id, option.label, cxpText);
5980
6019
  const description = document.createElement('span');
5981
6020
  description.className = 'cxp-effort-menu-desc';
5982
- description.textContent = option.description || (option.id === 'off' ? 'Use the model default' : option.id);
6021
+ description.textContent = codexEffortDesc(option.id, option.description, cxpText) || (translatedEffortWord(option.id, t) ?? option.id);
5983
6022
  item.append(label, description);
5984
6023
  item.addEventListener('click', (event) => {
5985
6024
  event.stopPropagation();
@@ -6105,7 +6144,7 @@ export function syncToolbarState() {
6105
6144
  const options = effortOptionsForTab(tab);
6106
6145
  const selected = options.find((option) => option.id === effort) || options[0];
6107
6146
  effortBtn.dataset.effort = effort;
6108
- effortBtn.title = `Reasoning effort: ${selected?.label || effort}`;
6147
+ effortBtn.title = `${cxpText('effort', 'Reasoning effort')}: ${(selected && codexEffortLabel(selected.id, selected.label, cxpText)) || effort}`;
6109
6148
  effortBtn.classList.toggle('active', effort !== 'off');
6110
6149
  const label = effortBtn.querySelector('.cxp-btn-label');
6111
6150
  if (label) label.textContent = effort === 'off' ? cxpText('effortLabel', 'Effort') : cxpText(`effort_${effort}`, selected?.label || effort);
@@ -6290,8 +6329,9 @@ export function updateCostEstimate(tokenUsage) {
6290
6329
  if (!tab) return;
6291
6330
  const total = tokenUsage.total;
6292
6331
  const pricing = getModelPricing(tab.model || _threadContextMeta?.model) || {
6293
- input: 2.50,
6294
- cachedInput: 2.50,
6332
+ input: 2.00,
6333
+ cachedInput: 0.10,
6334
+ cacheWrite: 2.50,
6295
6335
  output: 10.00,
6296
6336
  };
6297
6337
  const uncachedInputTokens = Number(total.inputTokens) || 0;
@@ -6299,7 +6339,8 @@ export function updateCostEstimate(tokenUsage) {
6299
6339
  const cacheCreationInputTokens = Number(total.cacheCreationInputTokens) || 0;
6300
6340
  const outputTokens = (total.outputTokens || 0) + (total.reasoningOutputTokens || 0);
6301
6341
  tab.estimatedCost = (
6302
- ((uncachedInputTokens + cacheCreationInputTokens) / 1_000_000) * pricing.input
6342
+ (uncachedInputTokens / 1_000_000) * pricing.input
6343
+ + (cacheCreationInputTokens / 1_000_000) * (pricing.cacheWrite ?? pricing.input)
6303
6344
  + (cachedInputTokens / 1_000_000) * pricing.cachedInput
6304
6345
  + (outputTokens / 1_000_000) * pricing.output
6305
6346
  );
@@ -6338,7 +6379,7 @@ export function interruptTab(tab = activeTab()) {
6338
6379
  fetch('/api/loop/stop', {
6339
6380
  method: 'POST',
6340
6381
  headers: { 'Content-Type': 'application/json' },
6341
- body: JSON.stringify({ runId: tab.automationRunId }),
6382
+ body: JSON.stringify({ runId: tab.automationRunId, action: 'stop' }),
6342
6383
  }).catch(() => {});
6343
6384
  return withTab(tab, () => {
6344
6385
  setRunning(false);
@@ -7180,6 +7221,7 @@ function tabTurnRunning(tab) {
7180
7221
  export function syncQueueTray() {
7181
7222
  const tab = activeTab();
7182
7223
  if (!tab) return;
7224
+ markQueueKeep(tab);
7183
7225
  const queue = tab.queue || [];
7184
7226
  const count = queue.length;
7185
7227
  const tray = panelEl('#cxp-queue-tray');
@@ -7292,6 +7334,7 @@ export function advanceQueue(tab = activeTab()) {
7292
7334
  if (!sent) {
7293
7335
  // Not sent: it stays first in its tab's queue.
7294
7336
  tab.queue.unshift(next);
7337
+ markQueueKeep(tab);
7295
7338
  syncQueueTray();
7296
7339
  return false;
7297
7340
  }
@@ -7300,6 +7343,8 @@ export function advanceQueue(tab = activeTab()) {
7300
7343
  appendLocalUserMessage(next.text || '', queueImages);
7301
7344
  tab._pendingSendImages = queueImages;
7302
7345
  }
7346
+ // A background tab's pill too: syncQueueTray paints the tab on screen's only.
7347
+ markQueueKeep(tab);
7303
7348
  syncQueueTray();
7304
7349
  return true;
7305
7350
  }
@@ -0,0 +1,94 @@
1
+ import { DIAGNOSTIC_BATCH, validDiagnosticEntry } from './loading-diagnostic-entry.js';
2
+
3
+ const KEY = 'synabun-loading-diagnostics-v1';
4
+ const CAP = 200;
5
+
6
+ // The shell passes the original fetch, before the UI installs its owner-access
7
+ // notifications. A diagnostic refusal must never raise a banner over the app.
8
+ export function createLoadingDiagnostics(page, { send = page.fetch.bind(page), early = [] } = {}) {
9
+ let entries = [];
10
+ let sent = 0;
11
+ let timer = null;
12
+ let sending = false;
13
+ let retryDelay = 1000;
14
+ // After a refused batch: one entry a request until the trail is drained, so the refused entry is found and dropped.
15
+ let narrow = false;
16
+
17
+ try {
18
+ const saved = JSON.parse(page.sessionStorage.getItem(KEY));
19
+ if (Array.isArray(saved?.entries) && saved.entries.length <= CAP && saved.entries.every(validDiagnosticEntry)) {
20
+ entries = saved.entries;
21
+ if (Number.isInteger(saved.sent) && saved.sent >= 0 && saved.sent <= entries.length) sent = saved.sent;
22
+ }
23
+ } catch { /* Storage may be disabled. Delivery can still run in memory. */ }
24
+
25
+ function save() {
26
+ try { page.sessionStorage.setItem(KEY, JSON.stringify({ entries, sent })); } catch {}
27
+ }
28
+
29
+ function schedule(delay) {
30
+ if (timer === null && !sending && sent < entries.length) timer = page.setTimeout(flush, delay);
31
+ }
32
+
33
+ async function flush() {
34
+ timer = null;
35
+ const batch = [];
36
+ for (const entry of entries.slice(sent, sent + (narrow ? 1 : DIAGNOSTIC_BATCH))) {
37
+ if (batch.length && entry.pageId !== batch[0].pageId) break;
38
+ batch.push(entry);
39
+ }
40
+ if (!batch.length) return;
41
+ sending = true;
42
+ let delay = null;
43
+ const options = { credentials: 'same-origin', mode: 'same-origin', redirect: 'error', cache: 'no-store' };
44
+ const post = () => send('/api/client-diagnostics', {
45
+ ...options, method: 'POST', keepalive: true, signal: AbortSignal.timeout(5000),
46
+ headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(batch),
47
+ });
48
+ try {
49
+ let response = await post();
50
+ if (response.status === 403 && (await response.json()).code === 'PAGE_SECRET_REQUIRED') {
51
+ // A tab surviving a restart can still have the previous boot's HttpOnly cookie.
52
+ const refresh = await send('/api/page-session', { ...options, signal: AbortSignal.timeout(5000) });
53
+ if (refresh.ok) response = await post();
54
+ }
55
+ if (response.status === 204) {
56
+ // Recording continues while the request is in flight, including evictions.
57
+ const last = entries.indexOf(batch.at(-1));
58
+ if (last >= 0) sent = last + 1;
59
+ if (sent >= entries.length) narrow = false;
60
+ else if (narrow) delay = 100;
61
+ save();
62
+ retryDelay = 1000;
63
+ } else if (response.status === 400) {
64
+ // The server can never take this batch: its validator predates an event this page records (the page's
65
+ // files are newer than the running server). Sending it again would hold back the whole trail; the
66
+ // refused entry is dropped and the rest still reach the log.
67
+ if (batch.length === 1) {
68
+ const at = entries.indexOf(batch[0]);
69
+ if (at >= 0) sent = at + 1;
70
+ save();
71
+ }
72
+ narrow = true;
73
+ retryDelay = 1000;
74
+ delay = 0;
75
+ } else {
76
+ retryDelay = Math.min(60000, retryDelay * 2);
77
+ }
78
+ } catch { retryDelay = Math.min(60000, retryDelay * 2); }
79
+ finally { sending = false; schedule(delay ?? retryDelay); }
80
+ }
81
+
82
+ function append(entry) {
83
+ try {
84
+ if (!validDiagnosticEntry(entry)) return;
85
+ entries.push(entry);
86
+ if (entries.length > CAP) { entries.shift(); sent = Math.max(0, sent - 1); }
87
+ try { if (page.localStorage.getItem('synabun-diag') === '1') page.console.info('[client-diag]', entry); } catch {}
88
+ } catch { /* Observation must not interrupt startup or recovery. */ }
89
+ }
90
+ for (const entry of early) append(entry);
91
+ if (early.length) save();
92
+ schedule(0); // Drain entries from earlier documents even if the app module never loads.
93
+ return entry => { append(entry); save(); schedule(250); };
94
+ }
@@ -9,6 +9,7 @@
9
9
 
10
10
  import { sanitizeHtmlString } from '../assistant/asst-sanitize.js';
11
11
  import { withCodeCopyButtons } from '../code-copy.js';
12
+ import { withOutputFrames } from '../output-format.js';
12
13
 
13
14
  // ── The panel's one escaper ──
14
15
  // Every value the panel puts into markup it builds itself (a session's title or
@@ -38,14 +39,18 @@ const plain = (text) => escapeHtml(text).replace(/\n/g, '<br>');
38
39
  * Every code block carries the shared Copy button (../code-copy.js), written in
39
40
  * after the sanitiser: a stream, a re-render and a string-keyed transcript keep
40
41
  * it, and a model cannot write one. `codeCopy: false` leaves it out.
42
+ * The same way, and for the same reason, a table gets its frame and a task item,
43
+ * a code block's language and a diff's lines their marks (../output-format.js):
44
+ * the reading layer all six panels share. `frames: false` leaves them out.
41
45
  */
42
- export function renderMarkdown(text, { parse = null, sanitize = sanitizeHtmlString, doc = globalThis.document, codeCopy = true } = {}) {
46
+ export function renderMarkdown(text, { parse = null, sanitize = sanitizeHtmlString, doc = globalThis.document, codeCopy = true, frames = true } = {}) {
43
47
  const src = String(text ?? '');
44
48
  if (typeof parse !== 'function') return plain(src);
45
49
  try {
46
50
  const html = sanitize(parse(src), doc);
47
51
  if (typeof html !== 'string') return plain(src);
48
- return codeCopy ? withCodeCopyButtons(html) : html;
52
+ const shown = codeCopy ? withCodeCopyButtons(html) : html;
53
+ return frames ? withOutputFrames(shown) : shown;
49
54
  } catch {
50
55
  return plain(src);
51
56
  }
@@ -81,7 +81,7 @@ export const CP_STYLES = `
81
81
  .cp-agent-feed .msg { margin: 4px 0; }
82
82
  .cp-agent-feed .msg-avatar { display: none; }
83
83
  .cp-agent-feed .msg-content { margin-left: 0; }
84
- .cp-agent-feed .msg-body { font-size: 11px; }
84
+ .cp-agent-feed .msg-body { --sbo-size: 12px; --sbo-code-size: 11px; --sbo-table-size: 11px; }
85
85
  .cp-agent-feed .tool-card { transform: scale(0.98); transform-origin: left top; }
86
86
  .cp-agent-result { font: 10.5px/1.5 Inter, sans-serif; color: rgba(255,255,255,0.55); background: rgba(150,120,200,0.07); border-radius: 6px; padding: 6px 8px; margin: 6px 0 2px; }
87
87
 
@@ -0,0 +1,118 @@
1
+ // Reasoning-effort words in the user's language. DOM-free, no imports (node --test and the panels load it).
2
+ // Display only: the id a panel stores or sends is never translated, and no code reads a label back.
3
+ //
4
+ // Words: `assistant.routes.effortWord.<id>`; menu descriptions: `assistant.routes.effortDesc.<slug>`.
5
+ // A locale that only repeats the English word, a key it lacks, an unknown id (an OpenCode variant name) and
6
+ // a missing translator all keep the text the caller had.
7
+
8
+ const lower = (value) => String(value ?? '').trim().toLowerCase();
9
+
10
+ /** The English forms a standard level goes by, so a label a provider wrote itself ("Balanced") is left alone. */
11
+ export const EFFORT_ENGLISH_FORMS = Object.freeze({
12
+ none: ['none', 'off'],
13
+ minimal: ['minimal'],
14
+ low: ['low', 'lo'],
15
+ medium: ['medium', 'med'],
16
+ high: ['high', 'hi'],
17
+ xhigh: ['xhigh', 'x-high', 'extra high', 'extra-high', 'xhi'],
18
+ max: ['max', 'maximum'],
19
+ ultra: ['ultra'],
20
+ });
21
+
22
+ /** The menu descriptions the effort lists carry, by their exact English text (the key under `effortDesc`). */
23
+ export const EFFORT_DESC_SLUGS = Object.freeze({
24
+ Minimal: 'minimal',
25
+ Light: 'light',
26
+ Balanced: 'balanced',
27
+ Deep: 'deep',
28
+ 'Very deep': 'veryDeep',
29
+ Maximum: 'maximum',
30
+ 'Maximum, with delegation': 'maximumDelegation',
31
+ 'Config default': 'configDefault',
32
+ 'Model default': 'modelDefault',
33
+ 'No thinking': 'noThinking',
34
+ });
35
+
36
+ /** The translated word for a level id, or null when there is none to show (Auto / Default `off`, unknown, English). */
37
+ export function translatedEffortWord(id, t) {
38
+ const key = lower(id);
39
+ // Only the standard ids have a word: an unknown id never asks the translator (it would log a missing key).
40
+ if (!key || key === 'off' || !EFFORT_ENGLISH_FORMS[key] || typeof t !== 'function') return null;
41
+ const path = `assistant.routes.effortWord.${key}`;
42
+ const value = t(path);
43
+ const english = key === 'none' ? 'off' : key;
44
+ return typeof value === 'string' && value && value !== path && value !== english ? value : null;
45
+ }
46
+
47
+ /**
48
+ * The word for a level whose label is a standard English one (or the id itself); any other label is the
49
+ * provider's own and stays as it is.
50
+ */
51
+ export function effortLabelFor(id, label, t) {
52
+ const key = lower(id);
53
+ const forms = EFFORT_ENGLISH_FORMS[key];
54
+ if (!forms) return label;
55
+ const shown = lower(label);
56
+ if (shown && !forms.includes(shown)) return label;
57
+ return translatedEffortWord(key, t) ?? label;
58
+ }
59
+
60
+ /** A menu description in the user's language when it is one of the standard English ones. */
61
+ export function effortDescFor(desc, t) {
62
+ const slug = EFFORT_DESC_SLUGS[desc];
63
+ if (!slug || typeof t !== 'function') return desc;
64
+ const path = `assistant.routes.effortDesc.${slug}`;
65
+ const value = t(path);
66
+ return typeof value === 'string' && value && value !== path ? value : desc;
67
+ }
68
+
69
+ // ── Claude Code panel: the Think toggle ──
70
+
71
+ /** The toggle's English text, per level: the button's short label and its tooltip. */
72
+ export const THINK_TOGGLE_ENGLISH = Object.freeze({
73
+ label: Object.freeze({ off: 'Think', low: 'lo', medium: 'med', high: 'hi', xhigh: 'xhi', max: 'max' }),
74
+ title: Object.freeze({
75
+ off: 'Thinking off',
76
+ low: 'Thinking: low',
77
+ medium: 'Thinking: medium',
78
+ high: 'Thinking: high',
79
+ xhigh: 'Thinking: extra high',
80
+ max: 'Thinking: max',
81
+ }),
82
+ });
83
+
84
+ /** The Think toggle's `label` or `title` for a level in the user's language (`effortUi.think.<part>.<level>`). */
85
+ export function thinkToggleText(part, level, t) {
86
+ const english = THINK_TOGGLE_ENGLISH[part]?.[level];
87
+ if (english === undefined) return part === 'label' ? THINK_TOGGLE_ENGLISH.label.off : '';
88
+ if (typeof t !== 'function') return english;
89
+ const path = `effortUi.think.${part}.${level}`;
90
+ const value = t(path);
91
+ return typeof value === 'string' && value && value !== path ? value : english;
92
+ }
93
+
94
+ // ── Codex panel: its own words (codexPanel.effort_<id>, so the button and the menu agree) ──
95
+
96
+ const CODEX_STANDARD_LABELS = Object.freeze({
97
+ off: 'Default', minimal: 'Minimal', low: 'Low', medium: 'Medium', high: 'High', xhigh: 'Extra high', max: 'Max', ultra: 'Ultra',
98
+ });
99
+
100
+ /**
101
+ * A Codex effort row's label through `text(key, english)` (cxpText). A label the model supplied itself, or any
102
+ * other level id, stays as it is; the raw id counts as the standard label (Settings lists `reasoningEffort`).
103
+ */
104
+ export function codexEffortLabel(id, label, text) {
105
+ const standard = CODEX_STANDARD_LABELS[id];
106
+ if (!standard || typeof text !== 'function' || (label !== standard && label !== id)) return label;
107
+ const word = text(id === 'off' ? 'default' : `effort_${id}`, standard);
108
+ return word === standard ? label : word;
109
+ }
110
+
111
+ /**
112
+ * A Codex effort row's description. The Default row's text comes from the panel's own words (the protocol
113
+ * helper only carries the English one); a description the model list supplied stays as it is.
114
+ */
115
+ export function codexEffortDesc(id, description, text) {
116
+ if (id === 'off') return typeof text === 'function' ? text('effortDefaultDesc', 'Use the model default') : 'Use the model default';
117
+ return description || '';
118
+ }