synabun 2.4.1 → 2.4.2

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 (295) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +1 -1
  3. package/browser-extension/content.js +56 -14
  4. package/browser-extension/engine.js +158 -8
  5. package/browser-extension/manifest.json +3 -1
  6. package/browser-extension/protocol.js +91 -6
  7. package/browser-extension/service-worker.js +13 -5
  8. package/browser-extension/tokens.css +1 -1
  9. package/docs/browser-extension-bridge.md +24 -4
  10. package/lib/data-home-files.js +4 -2
  11. package/lib/first-launch-protection.js +8 -2
  12. package/lib/update-snapshot.js +11 -4
  13. package/mcp-server/dist/http.d.ts.map +1 -1
  14. package/mcp-server/dist/http.js +25 -2
  15. package/mcp-server/dist/http.js.map +1 -1
  16. package/mcp-server/dist/index.d.ts.map +1 -1
  17. package/mcp-server/dist/index.js +62 -17
  18. package/mcp-server/dist/index.js.map +1 -1
  19. package/mcp-server/dist/services/browser-bench.d.ts +22 -22
  20. package/mcp-server/dist/services/memory-maintenance.d.ts +1 -0
  21. package/mcp-server/dist/services/memory-maintenance.d.ts.map +1 -1
  22. package/mcp-server/dist/services/memory-maintenance.js +34 -45
  23. package/mcp-server/dist/services/memory-maintenance.js.map +1 -1
  24. package/mcp-server/dist/services/memory-migration-copy.d.ts +144 -0
  25. package/mcp-server/dist/services/memory-migration-copy.d.ts.map +1 -0
  26. package/mcp-server/dist/services/memory-migration-copy.js +467 -0
  27. package/mcp-server/dist/services/memory-migration-copy.js.map +1 -0
  28. package/mcp-server/dist/services/memory-migration-worker.d.ts +2 -0
  29. package/mcp-server/dist/services/memory-migration-worker.d.ts.map +1 -0
  30. package/mcp-server/dist/services/memory-migration-worker.js +60 -0
  31. package/mcp-server/dist/services/memory-migration-worker.js.map +1 -0
  32. package/mcp-server/dist/services/memory-retrieval.d.ts +4 -0
  33. package/mcp-server/dist/services/memory-retrieval.d.ts.map +1 -1
  34. package/mcp-server/dist/services/memory-retrieval.js +188 -40
  35. package/mcp-server/dist/services/memory-retrieval.js.map +1 -1
  36. package/mcp-server/dist/services/memory-schema.d.ts +58 -2
  37. package/mcp-server/dist/services/memory-schema.d.ts.map +1 -1
  38. package/mcp-server/dist/services/memory-schema.js +190 -13
  39. package/mcp-server/dist/services/memory-schema.js.map +1 -1
  40. package/mcp-server/dist/services/memory-sessions.d.ts +19 -1
  41. package/mcp-server/dist/services/memory-sessions.d.ts.map +1 -1
  42. package/mcp-server/dist/services/memory-sessions.js +56 -20
  43. package/mcp-server/dist/services/memory-sessions.js.map +1 -1
  44. package/mcp-server/dist/services/memory-verification.d.ts.map +1 -1
  45. package/mcp-server/dist/services/memory-verification.js +8 -5
  46. package/mcp-server/dist/services/memory-verification.js.map +1 -1
  47. package/mcp-server/dist/services/neural-interface.d.ts +5 -0
  48. package/mcp-server/dist/services/neural-interface.d.ts.map +1 -1
  49. package/mcp-server/dist/services/neural-interface.js +19 -2
  50. package/mcp-server/dist/services/neural-interface.js.map +1 -1
  51. package/mcp-server/dist/services/retrieval-reader-worker.d.ts +2 -0
  52. package/mcp-server/dist/services/retrieval-reader-worker.d.ts.map +1 -0
  53. package/mcp-server/dist/services/retrieval-reader-worker.js +76 -0
  54. package/mcp-server/dist/services/retrieval-reader-worker.js.map +1 -0
  55. package/mcp-server/dist/services/retrieval-reader.d.ts +38 -0
  56. package/mcp-server/dist/services/retrieval-reader.d.ts.map +1 -0
  57. package/mcp-server/dist/services/retrieval-reader.js +145 -0
  58. package/mcp-server/dist/services/retrieval-reader.js.map +1 -0
  59. package/mcp-server/dist/services/sqlite-write.d.ts +14 -0
  60. package/mcp-server/dist/services/sqlite-write.d.ts.map +1 -0
  61. package/mcp-server/dist/services/sqlite-write.js +94 -0
  62. package/mcp-server/dist/services/sqlite-write.js.map +1 -0
  63. package/mcp-server/dist/services/sqlite.d.ts +39 -0
  64. package/mcp-server/dist/services/sqlite.d.ts.map +1 -1
  65. package/mcp-server/dist/services/sqlite.js +249 -8
  66. package/mcp-server/dist/services/sqlite.js.map +1 -1
  67. package/mcp-server/dist/services/tool-catalog.d.ts +1 -1
  68. package/mcp-server/dist/services/typesafe-config.d.ts +7 -1
  69. package/mcp-server/dist/services/typesafe-config.d.ts.map +1 -1
  70. package/mcp-server/dist/services/typesafe-config.js +32 -10
  71. package/mcp-server/dist/services/typesafe-config.js.map +1 -1
  72. package/mcp-server/dist/services/typesafe.d.ts.map +1 -1
  73. package/mcp-server/dist/services/typesafe.js +9 -7
  74. package/mcp-server/dist/services/typesafe.js.map +1 -1
  75. package/mcp-server/dist/services/vector-cache.d.ts +32 -0
  76. package/mcp-server/dist/services/vector-cache.d.ts.map +1 -1
  77. package/mcp-server/dist/services/vector-cache.js +161 -8
  78. package/mcp-server/dist/services/vector-cache.js.map +1 -1
  79. package/mcp-server/dist/tools/agent-definition.d.ts +2 -2
  80. package/mcp-server/dist/tools/agents.d.ts +11 -7
  81. package/mcp-server/dist/tools/agents.d.ts.map +1 -1
  82. package/mcp-server/dist/tools/agents.js +27 -9
  83. package/mcp-server/dist/tools/agents.js.map +1 -1
  84. package/mcp-server/dist/tools/browser-advanced.d.ts +1 -1
  85. package/mcp-server/dist/tools/browser-advanced.d.ts.map +1 -1
  86. package/mcp-server/dist/tools/browser-advanced.js +10 -3
  87. package/mcp-server/dist/tools/browser-advanced.js.map +1 -1
  88. package/mcp-server/dist/tools/browser-extension-setup.d.ts +5 -0
  89. package/mcp-server/dist/tools/browser-extension-setup.d.ts.map +1 -0
  90. package/mcp-server/dist/tools/browser-extension-setup.js +23 -0
  91. package/mcp-server/dist/tools/browser-extension-setup.js.map +1 -0
  92. package/mcp-server/dist/tools/browser-interact.d.ts.map +1 -1
  93. package/mcp-server/dist/tools/browser-interact.js +6 -1
  94. package/mcp-server/dist/tools/browser-interact.js.map +1 -1
  95. package/mcp-server/dist/tools/fb-groups.d.ts +2 -2
  96. package/mcp-server/dist/tools/skill-tools.d.ts +4 -4
  97. package/mcp-server/dist/tools/tool-groups.d.ts +1 -1
  98. package/mcp-server/package-lock.json +2 -2
  99. package/mcp-server/package.json +1 -1
  100. package/mcp-server/src/http.ts +20 -2
  101. package/mcp-server/src/index.ts +59 -17
  102. package/mcp-server/src/services/memory-maintenance.ts +31 -28
  103. package/mcp-server/src/services/memory-migration-copy.ts +419 -0
  104. package/mcp-server/src/services/memory-migration-worker.ts +55 -0
  105. package/mcp-server/src/services/memory-retrieval.ts +173 -32
  106. package/mcp-server/src/services/memory-schema.ts +194 -12
  107. package/mcp-server/src/services/memory-sessions.ts +54 -21
  108. package/mcp-server/src/services/memory-verification.ts +7 -4
  109. package/mcp-server/src/services/neural-interface.ts +22 -2
  110. package/mcp-server/src/services/retrieval-reader-worker.ts +67 -0
  111. package/mcp-server/src/services/retrieval-reader.ts +131 -0
  112. package/mcp-server/src/services/sqlite-write.ts +60 -0
  113. package/mcp-server/src/services/sqlite.ts +246 -8
  114. package/mcp-server/src/services/typesafe-config.ts +25 -6
  115. package/mcp-server/src/services/typesafe.ts +9 -7
  116. package/mcp-server/src/services/vector-cache.ts +154 -9
  117. package/mcp-server/src/tools/agents.ts +26 -9
  118. package/mcp-server/src/tools/browser-advanced.ts +10 -3
  119. package/mcp-server/src/tools/browser-extension-setup.ts +30 -0
  120. package/mcp-server/src/tools/browser-interact.ts +5 -1
  121. package/neural-interface/i18n/en.json +263 -1
  122. package/neural-interface/i18n/pt-BR.json +264 -2
  123. package/neural-interface/lib/agents/split.js +32 -4
  124. package/neural-interface/lib/assistant-api.js +19 -8
  125. package/neural-interface/lib/assistant-brains/claude.js +2 -0
  126. package/neural-interface/lib/assistant-catalog.js +2 -2
  127. package/neural-interface/lib/assistant-config.js +0 -7
  128. package/neural-interface/lib/assistant-dispatch.js +257 -95
  129. package/neural-interface/lib/assistant-persona.js +16 -4
  130. package/neural-interface/lib/assistant-pricing.js +65 -14
  131. package/neural-interface/lib/assistant-router.js +131 -47
  132. package/neural-interface/lib/assistant-run-wait.js +45 -28
  133. package/neural-interface/lib/assistant-runtime.js +39 -33
  134. package/neural-interface/lib/backup-contents.js +158 -0
  135. package/neural-interface/lib/backup-crypto-io.js +330 -0
  136. package/neural-interface/lib/backup-crypto-worker.js +130 -0
  137. package/neural-interface/lib/backup-crypto.js +525 -0
  138. package/neural-interface/lib/backup-download.js +268 -0
  139. package/neural-interface/lib/backup-encryption.js +318 -0
  140. package/neural-interface/lib/backup-groups.js +287 -0
  141. package/neural-interface/lib/backup-restore-session.js +176 -0
  142. package/neural-interface/lib/backup-restore-stage.js +60 -0
  143. package/neural-interface/lib/backup-service.js +788 -233
  144. package/neural-interface/lib/backup-zip-reader.js +30 -18
  145. package/neural-interface/lib/backup-zip-writer.js +34 -10
  146. package/neural-interface/lib/browser-extension-adapter.js +89 -13
  147. package/neural-interface/lib/browser-extension-bridge.js +18 -7
  148. package/neural-interface/lib/claude-agent-bridge.js +1 -0
  149. package/neural-interface/lib/claude-session-cleanup.js +5 -1
  150. package/neural-interface/lib/cli-update-planner.js +105 -6
  151. package/neural-interface/lib/client-diagnostics.js +42 -0
  152. package/neural-interface/lib/confined-fs.js +7 -2
  153. package/neural-interface/lib/coordination/README.md +8 -2
  154. package/neural-interface/lib/coordination/contract.js +161 -0
  155. package/neural-interface/lib/coordination/database.js +999 -0
  156. package/neural-interface/lib/coordination/operations.js +436 -0
  157. package/neural-interface/lib/coordination/service.js +68 -537
  158. package/neural-interface/lib/coordination/storage-worker.js +101 -0
  159. package/neural-interface/lib/coordination/store.js +219 -1111
  160. package/neural-interface/lib/db.js +70 -32
  161. package/neural-interface/lib/health-count.js +37 -0
  162. package/neural-interface/lib/loop-stall.js +139 -0
  163. package/neural-interface/lib/maritaca/client.js +2 -2
  164. package/neural-interface/lib/maritaca/models.js +12 -17
  165. package/neural-interface/lib/maritaca/opencode.js +4 -2
  166. package/neural-interface/lib/memory-api.js +9 -1
  167. package/neural-interface/lib/memory-session-capture.js +42 -10
  168. package/neural-interface/lib/memory-store-gate.js +313 -0
  169. package/neural-interface/lib/memory-store-migrate.js +65 -0
  170. package/neural-interface/lib/memory-timers.js +7 -7
  171. package/neural-interface/lib/native-loop-providers.js +13 -16
  172. package/neural-interface/lib/native-loop-runtime.js +28 -7
  173. package/neural-interface/lib/opencode-build-preflight.js +18 -1
  174. package/neural-interface/lib/opencode-native-boundary.js +69 -8
  175. package/neural-interface/lib/opencode-provider-view.js +14 -3
  176. package/neural-interface/lib/opencode-v2-ws-requests.js +31 -1
  177. package/neural-interface/lib/opencode2-client.js +2 -1
  178. package/neural-interface/lib/recall-impact.js +122 -0
  179. package/neural-interface/lib/scratch-evidence.js +420 -0
  180. package/neural-interface/lib/scratch-process-guard.js +139 -0
  181. package/neural-interface/lib/scratch-references.js +279 -0
  182. package/neural-interface/lib/scratch-retention-core.js +385 -0
  183. package/neural-interface/lib/scratch-retention-worker.js +37 -0
  184. package/neural-interface/lib/scratch-retention.js +151 -0
  185. package/neural-interface/lib/session-cache-builder.js +31 -43
  186. package/neural-interface/lib/session-cache-worker.js +157 -0
  187. package/neural-interface/lib/session-indexer.js +28 -21
  188. package/neural-interface/lib/session-search-index.js +85 -0
  189. package/neural-interface/lib/skills/creation.js +1 -1
  190. package/neural-interface/lib/sqlite-integrity-worker.js +3 -1
  191. package/neural-interface/lib/style-guide/store.js +43 -3
  192. package/neural-interface/lib/system-restore.js +50 -0
  193. package/neural-interface/lib/teams/api.js +15 -6
  194. package/neural-interface/lib/teams/claims.js +67 -31
  195. package/neural-interface/lib/teams/index.js +7 -7
  196. package/neural-interface/lib/teams/integration.js +40 -40
  197. package/neural-interface/lib/teams/landing.js +6 -6
  198. package/neural-interface/lib/teams/recovery.js +24 -23
  199. package/neural-interface/lib/teams/scheduler.js +194 -95
  200. package/neural-interface/lib/teams/state.js +14 -14
  201. package/neural-interface/lib/teams/worktrees.js +27 -27
  202. package/neural-interface/lib/whatsapp/bridge.js +2 -1
  203. package/neural-interface/lib/worker-confinement.js +47 -2
  204. package/neural-interface/lib/worker-mcp-channel.js +2 -0
  205. package/neural-interface/lib/worker-resume.js +5 -0
  206. package/neural-interface/lib/worker-stop.js +86 -0
  207. package/neural-interface/package-lock.json +2 -2
  208. package/neural-interface/package.json +1 -1
  209. package/neural-interface/public/index.html +233 -24
  210. package/neural-interface/public/onboarding.html +259 -34
  211. package/neural-interface/public/shared/agents/studio/ax-library.js +0 -6
  212. package/neural-interface/public/shared/agents/studio/ax-main.js +14 -7
  213. package/neural-interface/public/shared/agy/agy-options.js +11 -0
  214. package/neural-interface/public/shared/agy/agy-panel.js +29 -10
  215. package/neural-interface/public/shared/agy/agy-styles.js +14 -12
  216. package/neural-interface/public/shared/agy/agy-tabs-logic.js +4 -1
  217. package/neural-interface/public/shared/api.js +1 -1
  218. package/neural-interface/public/shared/assistant/asst-api.js +3 -3
  219. package/neural-interface/public/shared/assistant/asst-brain-picker.js +13 -6
  220. package/neural-interface/public/shared/assistant/asst-control.js +2 -0
  221. package/neural-interface/public/shared/assistant/asst-motion-gate.js +78 -4
  222. package/neural-interface/public/shared/assistant/asst-panel.js +18 -2
  223. package/neural-interface/public/shared/assistant/asst-rack-styles.js +4 -0
  224. package/neural-interface/public/shared/assistant/asst-render.js +105 -38
  225. package/neural-interface/public/shared/assistant/asst-route.js +100 -21
  226. package/neural-interface/public/shared/assistant/asst-routes-editor.js +1 -1
  227. package/neural-interface/public/shared/assistant/asst-sidepanel.js +4 -2
  228. package/neural-interface/public/shared/assistant/asst-state.js +11 -0
  229. package/neural-interface/public/shared/assistant/asst-styles.js +10 -23
  230. package/neural-interface/public/shared/assistant/route-identity.js +2 -1
  231. package/neural-interface/public/shared/cdx/cdx-render.js +9 -0
  232. package/neural-interface/public/shared/cdx/cdx-settings.js +3 -1
  233. package/neural-interface/public/shared/cdx/cdx-styles.js +6 -0
  234. package/neural-interface/public/shared/cdx/cdx-tabs.js +29 -9
  235. package/neural-interface/public/shared/client-diagnostics.js +94 -0
  236. package/neural-interface/public/shared/cp/cp-markdown.js +7 -2
  237. package/neural-interface/public/shared/cp/cp-styles.js +1 -1
  238. package/neural-interface/public/shared/effort-i18n.js +118 -0
  239. package/neural-interface/public/shared/html-shell.js +4 -52
  240. package/neural-interface/public/shared/loading-diagnostic-entry.js +64 -0
  241. package/neural-interface/public/shared/memory-store-wait.js +52 -0
  242. package/neural-interface/public/shared/morelogin-profile-field.js +1 -1
  243. package/neural-interface/public/shared/mtc/mtc-logic.js +2 -1
  244. package/neural-interface/public/shared/mtc/mtc-panel.js +8 -1
  245. package/neural-interface/public/shared/mtc/mtc-styles.js +13 -12
  246. package/neural-interface/public/shared/ocp-v2/ocp-v2-childpanel.js +7 -0
  247. package/neural-interface/public/shared/ocp-v2/ocp-v2-location-logic.js +109 -0
  248. package/neural-interface/public/shared/ocp-v2/ocp-v2-modelpicker.js +8 -1
  249. package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +118 -6
  250. package/neural-interface/public/shared/ocp-v2/ocp-v2-render.js +27 -3
  251. package/neural-interface/public/shared/ocp-v2/ocp-v2-send.js +13 -0
  252. package/neural-interface/public/shared/ocp-v2/ocp-v2-session-actions.js +2 -1
  253. package/neural-interface/public/shared/ocp-v2/ocp-v2-styles.js +27 -93
  254. package/neural-interface/public/shared/ocp-v2/ocp-v2-variantpicker.js +17 -6
  255. package/neural-interface/public/shared/output-format.js +294 -0
  256. package/neural-interface/public/shared/provider-icons.js +6 -0
  257. package/neural-interface/public/shared/schedules-view.js +2 -1
  258. package/neural-interface/public/shared/server-presence.js +77 -0
  259. package/neural-interface/public/shared/settings/settings-backup-contents.js +241 -0
  260. package/neural-interface/public/shared/settings/settings-backup-download.js +298 -0
  261. package/neural-interface/public/shared/settings/settings-backup-encryption-pane.js +335 -0
  262. package/neural-interface/public/shared/settings/settings-backup-encryption.js +545 -0
  263. package/neural-interface/public/shared/settings/settings-ia.js +1 -1
  264. package/neural-interface/public/shared/skills/studio/sx-geometry.js +12 -3
  265. package/neural-interface/public/shared/skills/studio/sx-main.js +14 -7
  266. package/neural-interface/public/shared/studio-attention.js +6 -0
  267. package/neural-interface/public/shared/styles.css +341 -437
  268. package/neural-interface/public/shared/transcript-rows.js +28 -3
  269. package/neural-interface/public/shared/tray-auto-close.js +18 -5
  270. package/neural-interface/public/shared/ui-agents.js +1 -2
  271. package/neural-interface/public/shared/ui-automation-studio.js +168 -108
  272. package/neural-interface/public/shared/ui-claude-panel.js +42 -65
  273. package/neural-interface/public/shared/ui-loading.js +124 -17
  274. package/neural-interface/public/shared/ui-native-loop-router.js +10 -0
  275. package/neural-interface/public/shared/ui-navbar.js +2 -1
  276. package/neural-interface/public/shared/ui-output.js +533 -0
  277. package/neural-interface/public/shared/ui-schedules-studio.js +165 -128
  278. package/neural-interface/public/shared/ui-scroll-follow.js +97 -6
  279. package/neural-interface/public/shared/ui-sessions.js +2 -2
  280. package/neural-interface/public/shared/ui-settings-entry.js +18 -0
  281. package/neural-interface/public/shared/ui-settings.js +224 -65
  282. package/neural-interface/public/shared/ui-sidepanel-tray.js +3 -2
  283. package/neural-interface/public/shared/ui-tooltip.js +16 -0
  284. package/neural-interface/public/shared/ui-tutorial.js +5 -6
  285. package/neural-interface/public/shared/ui-worker-end.js +27 -8
  286. package/neural-interface/public/shared/worker-end.js +9 -4
  287. package/neural-interface/public/variant/2d/main.js +5 -0
  288. package/neural-interface/public/variant/3d/app.js +10 -0
  289. package/neural-interface/public/variant/3d/main.js +5 -1
  290. package/neural-interface/scripts/scratch-retention.mjs +20 -0
  291. package/neural-interface/server.js +477 -139
  292. package/npm-shrinkwrap.json +2 -2
  293. package/package.json +1 -1
  294. package/scripts/restore-data-home-from-backup.mjs +175 -8
  295. package/setup.js +18 -4
@@ -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 {
@@ -1970,7 +1955,9 @@ export function injectAssistantStyles() {
1970
1955
  .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
1956
  .asst-routes-group { display: grid; grid-template-columns: 96px minmax(0, 1fr); min-width: 0; padding: 4px 8px; column-gap: 8px; }
1972
1957
  .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; }
1958
+ /* The label stands beside its group, over the first three rows: one that wraps in its narrow column
1959
+ ("Web & desktop") takes that height from them, never from the first row alone (it was stretched to 48.78px). */
1960
+ .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
1961
  .asst-routes-overlay .asst-routes-row { display: block; padding: 0; grid-column: 2; border: 0; }
1975
1962
  .asst-routes-overlay .asst-routes-row + .asst-routes-row { border-top: 1px solid var(--asst-line); }
1976
1963
  .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 +2070,7 @@ export function injectAssistantStyles() {
2083
2070
  .asst-status.warn { color: var(--asst-warn); }
2084
2071
  .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
2072
  .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; }
2073
+ .asst-local-output .asst-md { --sbo-text: var(--asst-text-2); --sbo-size: 13px; }
2087
2074
 
2088
2075
  /* The panel's one status line for screen readers (the transcript is not a live region). */
2089
2076
  .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
  // ═══════════════════════════════════════════
@@ -1972,16 +1973,32 @@ function formatContextTrackerState(meta) {
1972
1973
  return 'pending';
1973
1974
  }
1974
1975
 
1976
+ // List-price equivalents ($/MTok) matching neural-interface/lib/assistant-pricing.js (verified 2026-11-20).
1975
1977
  const CODEX_MODEL_PRICING = {
1978
+ 'gpt-6.2-astra': { input: 8.00, cachedInput: 0.40, cacheWrite: 10.00, output: 40.00 },
1979
+ 'gpt-6.2-sol': { input: 2.00, cachedInput: 0.10, cacheWrite: 2.50, output: 10.00 },
1980
+ 'gpt-6-astra': { input: 10.00, cachedInput: 1.00, cacheWrite: 12.50, output: 50.00 },
1981
+ 'gpt-6.1-sol': { input: 2.00, cachedInput: 0.10, cacheWrite: 2.50, output: 10.00 },
1982
+ 'gpt-6.1-terra': { input: 1.00, cachedInput: 0.05, cacheWrite: 1.25, output: 5.00 },
1983
+ 'gpt-6-sol': { input: 2.00, cachedInput: 0.20, cacheWrite: 2.50, output: 10.00 },
1984
+ 'gpt-6-luna': { input: 0.10, cachedInput: 0.01, cacheWrite: 0.125, output: 0.50 },
1985
+ 'gpt-5.6-sol': { input: 4.00, cachedInput: 0.40, cacheWrite: 5.00, output: 20.00 },
1986
+ 'gpt-5.6-terra': { input: 2.00, cachedInput: 0.20, cacheWrite: 2.50, output: 12.00 },
1987
+ 'gpt-5.6-luna': { input: 0.20, cachedInput: 0.02, cacheWrite: 0.25, output: 1.20 },
1988
+ 'gpt-5.5': { input: 5.00, cachedInput: 0.50, output: 30.00 },
1989
+ 'gpt-5.4': { input: 2.50, cachedInput: 0.25, output: 15.00 },
1990
+ 'gpt-5.4-mini': { input: 0.75, cachedInput: 0.075, output: 4.50 },
1991
+ 'gpt-5.3-codex': { input: 1.75, cachedInput: 0.175, output: 14.00 },
1976
1992
  'gpt-5.2-codex': { input: 1.75, cachedInput: 0.175, output: 14.00 },
1977
1993
  'gpt-5.1-codex-max': { input: 1.25, cachedInput: 0.125, output: 10.00 },
1978
1994
  'gpt-5.1-codex': { input: 1.25, cachedInput: 0.125, output: 10.00 },
1979
1995
  'gpt-5.1-codex-mini': { input: 0.25, cachedInput: 0.025, output: 2.00 },
1980
1996
  'gpt-5-codex': { input: 1.25, cachedInput: 0.125, output: 10.00 },
1997
+ 'chat-latest': { input: 5.00, cachedInput: 0.50, output: 30.00 },
1981
1998
  };
1982
1999
 
1983
2000
  function getModelPricing(model) {
1984
- const key = String(model || '').trim().toLowerCase();
2001
+ const key = String(model || '').trim().toLowerCase().replace(/\[[^\]]*\]$/, '').replace(/^.*\//, '').replace(/-\d{8}$/, '');
1985
2002
  return CODEX_MODEL_PRICING[key] || null;
1986
2003
  }
1987
2004
 
@@ -2751,6 +2768,7 @@ function createTrayPill(tab) {
2751
2768
  const pill = document.createElement('div');
2752
2769
  pill.className = 'term-minimized-pill cxp-session-pill';
2753
2770
  pill.dataset.tabId = tab.id;
2771
+ pill.getAutomationRunId = () => tab.automationRunId;
2754
2772
  pill.innerHTML = `
2755
2773
  <span class="term-minimized-pill-icon">${OPENAI_ICON}</span>
2756
2774
  <span class="term-minimized-pill-label">${esc(tab.sessionLabel || 'New session')}</span>
@@ -3055,7 +3073,7 @@ export function closeTab(idx, { detachAutomation = false } = {}) {
3055
3073
  endWorkerRunOnClose(runId, () => fetch('/api/loop/stop', {
3056
3074
  method: 'POST',
3057
3075
  headers: { 'Content-Type': 'application/json' },
3058
- body: JSON.stringify({ runId }),
3076
+ body: JSON.stringify({ runId, action: 'tab_close' }),
3059
3077
  }).catch(() => {}));
3060
3078
  }
3061
3079
  if (tab.automationRunId) forgetWorkerEnd(tab.automationRunId);
@@ -5976,10 +5994,10 @@ export function renderEffortMenu() {
5976
5994
  item.dataset.value = option.id;
5977
5995
  const label = document.createElement('span');
5978
5996
  label.className = 'cxp-effort-menu-label';
5979
- label.textContent = option.label;
5997
+ label.textContent = codexEffortLabel(option.id, option.label, cxpText);
5980
5998
  const description = document.createElement('span');
5981
5999
  description.className = 'cxp-effort-menu-desc';
5982
- description.textContent = option.description || (option.id === 'off' ? 'Use the model default' : option.id);
6000
+ description.textContent = codexEffortDesc(option.id, option.description, cxpText) || (translatedEffortWord(option.id, t) ?? option.id);
5983
6001
  item.append(label, description);
5984
6002
  item.addEventListener('click', (event) => {
5985
6003
  event.stopPropagation();
@@ -6105,7 +6123,7 @@ export function syncToolbarState() {
6105
6123
  const options = effortOptionsForTab(tab);
6106
6124
  const selected = options.find((option) => option.id === effort) || options[0];
6107
6125
  effortBtn.dataset.effort = effort;
6108
- effortBtn.title = `Reasoning effort: ${selected?.label || effort}`;
6126
+ effortBtn.title = `${cxpText('effort', 'Reasoning effort')}: ${(selected && codexEffortLabel(selected.id, selected.label, cxpText)) || effort}`;
6109
6127
  effortBtn.classList.toggle('active', effort !== 'off');
6110
6128
  const label = effortBtn.querySelector('.cxp-btn-label');
6111
6129
  if (label) label.textContent = effort === 'off' ? cxpText('effortLabel', 'Effort') : cxpText(`effort_${effort}`, selected?.label || effort);
@@ -6290,8 +6308,9 @@ export function updateCostEstimate(tokenUsage) {
6290
6308
  if (!tab) return;
6291
6309
  const total = tokenUsage.total;
6292
6310
  const pricing = getModelPricing(tab.model || _threadContextMeta?.model) || {
6293
- input: 2.50,
6294
- cachedInput: 2.50,
6311
+ input: 2.00,
6312
+ cachedInput: 0.10,
6313
+ cacheWrite: 2.50,
6295
6314
  output: 10.00,
6296
6315
  };
6297
6316
  const uncachedInputTokens = Number(total.inputTokens) || 0;
@@ -6299,7 +6318,8 @@ export function updateCostEstimate(tokenUsage) {
6299
6318
  const cacheCreationInputTokens = Number(total.cacheCreationInputTokens) || 0;
6300
6319
  const outputTokens = (total.outputTokens || 0) + (total.reasoningOutputTokens || 0);
6301
6320
  tab.estimatedCost = (
6302
- ((uncachedInputTokens + cacheCreationInputTokens) / 1_000_000) * pricing.input
6321
+ (uncachedInputTokens / 1_000_000) * pricing.input
6322
+ + (cacheCreationInputTokens / 1_000_000) * (pricing.cacheWrite ?? pricing.input)
6303
6323
  + (cachedInputTokens / 1_000_000) * pricing.cachedInput
6304
6324
  + (outputTokens / 1_000_000) * pricing.output
6305
6325
  );
@@ -6338,7 +6358,7 @@ export function interruptTab(tab = activeTab()) {
6338
6358
  fetch('/api/loop/stop', {
6339
6359
  method: 'POST',
6340
6360
  headers: { 'Content-Type': 'application/json' },
6341
- body: JSON.stringify({ runId: tab.automationRunId }),
6361
+ body: JSON.stringify({ runId: tab.automationRunId, action: 'stop' }),
6342
6362
  }).catch(() => {});
6343
6363
  return withTab(tab, () => {
6344
6364
  setRunning(false);
@@ -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
+ }
@@ -97,56 +97,6 @@ export function getSharedHTML() {
97
97
  <div id="app-frame-surface" aria-hidden="true"></div>
98
98
  <div id="app-frame" aria-hidden="true"></div>
99
99
 
100
- <!-- Loading Overlay -->
101
- <div id="loading-overlay">
102
- <div id="loading-mascot" data-state="asleep">
103
- <svg viewBox="0 0 280 140" width="160" height="80" style="overflow:visible" aria-hidden="true">
104
- <g class="syna-eye">
105
- <g class="syna-lid" transform="translate(0,60) scale(1,0.08) translate(0,-60)">
106
- <rect x="80" y="24" width="38" height="72" rx="19" fill="#ffffff"/>
107
- </g>
108
- </g>
109
- <g class="syna-eye">
110
- <g class="syna-lid" transform="translate(0,60) scale(1,0.08) translate(0,-60)">
111
- <rect x="162" y="24" width="38" height="72" rx="19" fill="#ffffff"/>
112
- </g>
113
- </g>
114
- <path d="M125,112 Q140,118 155,112" fill="none" stroke="rgba(255,255,255,0.15)" stroke-width="2.5" stroke-linecap="round"/>
115
- </svg>
116
- <span id="loading-zzz">z</span>
117
- </div>
118
- <img src="synabun.png?v=2" alt="SynaBun" class="loading-logo">
119
- <div id="loading-text">${t('loading.connecting')}</div>
120
- <div id="loading-sub">${t('loading.initializingNeural')}</div>
121
- <div id="loading-action">
122
- <button id="loading-action-btn" type="button">
123
- <svg viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round"><polygon points="5 3 19 12 5 21 5 3"/></svg>
124
- <span id="loading-action-label">${t('loading.startServer')}</span>
125
- </button>
126
- <div id="loading-action-status" role="status" aria-live="polite" aria-atomic="true"></div>
127
- <div id="loading-action-elapsed" role="timer" aria-live="off"></div>
128
- <div id="loading-action-hint"></div>
129
- <ul id="loading-action-trail"></ul>
130
- <div id="loading-action-log"></div>
131
- </div>
132
- <div id="loading-server-cmd">
133
- <div id="loading-server-cmd-hint">${t('loading.runCommand')}</div>
134
- <div id="loading-server-cmd-box">
135
- <code id="loading-cmd-text">npm start</code>
136
- <button id="loading-cmd-copy" title="${t('loading.copyToClipboard')}">
137
- <svg viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>
138
- </button>
139
- </div>
140
- <br>
141
- <button id="loading-retry-btn" type="button">
142
- <svg viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/></svg>
143
- ${t('loading.retryConnection')}
144
- </button>
145
- <div id="loading-retry-status"></div>
146
- <img src="synabun.png?v=2" alt="SynaBun" style="margin-top:6px;height:32px;width:auto;filter:grayscale(0.5);opacity:0.18;">
147
- </div>
148
- </div>
149
-
150
100
  <!-- Node Hover Tooltip -->
151
101
  <div id="tooltip" class="glass">
152
102
  <div id="tooltip-category"></div>
@@ -914,6 +864,8 @@ export function injectSharedHTML() {
914
864
  // The workspace sits in the inset rounded frame (app-frame.js): set before the shell lands, so nothing is laid
915
865
  // out once without it.
916
866
  document.documentElement.classList.add(FRAMED_CLASS);
917
- document.body.insertAdjacentHTML('afterbegin', getSharedHTML());
918
- document.getElementById('startup-status')?.remove();
867
+ // Once per document: a second call would duplicate every id. The loading overlay is never part of the shell: the
868
+ // first frame (index.html) owns it and the shell takes that one over.
869
+ if (!document.getElementById('app-frame')) document.body.insertAdjacentHTML('afterbegin', getSharedHTML());
870
+ window.synabunAdoptLoading?.(t);
919
871
  }