synabun 2.3.1 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (356) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +1 -1
  3. package/browser-extension/content.js +169 -0
  4. package/browser-extension/engine.js +477 -0
  5. package/browser-extension/icons/icon-128.png +0 -0
  6. package/browser-extension/icons/icon-16.png +0 -0
  7. package/browser-extension/icons/icon-32.png +0 -0
  8. package/browser-extension/icons/icon-48.png +0 -0
  9. package/browser-extension/icons/status-off-16.png +0 -0
  10. package/browser-extension/icons/status-off-32.png +0 -0
  11. package/browser-extension/icons/status-off-48.png +0 -0
  12. package/browser-extension/icons/status-on-16.png +0 -0
  13. package/browser-extension/icons/status-on-32.png +0 -0
  14. package/browser-extension/icons/status-on-48.png +0 -0
  15. package/browser-extension/manifest.json +56 -0
  16. package/browser-extension/popup-strings.js +244 -0
  17. package/browser-extension/popup-view.js +151 -0
  18. package/browser-extension/popup.css +165 -0
  19. package/browser-extension/popup.html +105 -0
  20. package/browser-extension/popup.js +347 -0
  21. package/browser-extension/protocol.js +226 -0
  22. package/browser-extension/service-worker.js +267 -0
  23. package/browser-extension/setup-content.js +36 -0
  24. package/browser-extension/tokens.css +326 -0
  25. package/docs/browser-extension-bridge.md +84 -0
  26. package/docs/whatsapp.md +1 -1
  27. package/mcp-server/dist/http.d.ts +2 -0
  28. package/mcp-server/dist/http.d.ts.map +1 -1
  29. package/mcp-server/dist/http.js +9 -1
  30. package/mcp-server/dist/http.js.map +1 -1
  31. package/mcp-server/dist/index.d.ts +11 -0
  32. package/mcp-server/dist/index.d.ts.map +1 -1
  33. package/mcp-server/dist/index.js +38 -3
  34. package/mcp-server/dist/index.js.map +1 -1
  35. package/mcp-server/dist/services/browser-route-flow.d.ts +6 -2
  36. package/mcp-server/dist/services/browser-route-flow.d.ts.map +1 -1
  37. package/mcp-server/dist/services/browser-route-flow.js +10 -3
  38. package/mcp-server/dist/services/browser-route-flow.js.map +1 -1
  39. package/mcp-server/dist/services/codex-config-heal.d.ts.map +1 -1
  40. package/mcp-server/dist/services/codex-config-heal.js +7 -0
  41. package/mcp-server/dist/services/codex-config-heal.js.map +1 -1
  42. package/mcp-server/dist/services/neural-interface.d.ts +94 -3
  43. package/mcp-server/dist/services/neural-interface.d.ts.map +1 -1
  44. package/mcp-server/dist/services/neural-interface.js +168 -23
  45. package/mcp-server/dist/services/neural-interface.js.map +1 -1
  46. package/mcp-server/dist/services/team-context.d.ts +18 -0
  47. package/mcp-server/dist/services/team-context.d.ts.map +1 -0
  48. package/mcp-server/dist/services/team-context.js +29 -0
  49. package/mcp-server/dist/services/team-context.js.map +1 -0
  50. package/mcp-server/dist/services/tool-catalog.d.ts +5 -2
  51. package/mcp-server/dist/services/tool-catalog.d.ts.map +1 -1
  52. package/mcp-server/dist/services/tool-catalog.js +22 -6
  53. package/mcp-server/dist/services/tool-catalog.js.map +1 -1
  54. package/mcp-server/dist/services/tool-list.d.ts.map +1 -1
  55. package/mcp-server/dist/services/tool-list.js +4 -0
  56. package/mcp-server/dist/services/tool-list.js.map +1 -1
  57. package/mcp-server/dist/services/tool-runtime.d.ts +8 -1
  58. package/mcp-server/dist/services/tool-runtime.d.ts.map +1 -1
  59. package/mcp-server/dist/services/tool-runtime.js +18 -1
  60. package/mcp-server/dist/services/tool-runtime.js.map +1 -1
  61. package/mcp-server/dist/tools/agent-definition.d.ts +133 -0
  62. package/mcp-server/dist/tools/agent-definition.d.ts.map +1 -0
  63. package/mcp-server/dist/tools/agent-definition.js +483 -0
  64. package/mcp-server/dist/tools/agent-definition.js.map +1 -0
  65. package/mcp-server/dist/tools/agents.d.ts +91 -9
  66. package/mcp-server/dist/tools/agents.d.ts.map +1 -1
  67. package/mcp-server/dist/tools/agents.js +161 -20
  68. package/mcp-server/dist/tools/agents.js.map +1 -1
  69. package/mcp-server/dist/tools/browser-advanced.d.ts +8 -1
  70. package/mcp-server/dist/tools/browser-advanced.d.ts.map +1 -1
  71. package/mcp-server/dist/tools/browser-advanced.js +70 -6
  72. package/mcp-server/dist/tools/browser-advanced.js.map +1 -1
  73. package/mcp-server/dist/tools/git-tools.d.ts +4 -2
  74. package/mcp-server/dist/tools/git-tools.d.ts.map +1 -1
  75. package/mcp-server/dist/tools/git-tools.js +283 -2
  76. package/mcp-server/dist/tools/git-tools.js.map +1 -1
  77. package/mcp-server/dist/tools/morelogin.d.ts +8 -2
  78. package/mcp-server/dist/tools/morelogin.d.ts.map +1 -1
  79. package/mcp-server/dist/tools/morelogin.js +22 -5
  80. package/mcp-server/dist/tools/morelogin.js.map +1 -1
  81. package/mcp-server/dist/tools/team.d.ts +32 -0
  82. package/mcp-server/dist/tools/team.d.ts.map +1 -0
  83. package/mcp-server/dist/tools/team.js +87 -0
  84. package/mcp-server/dist/tools/team.js.map +1 -0
  85. package/mcp-server/package-lock.json +2 -2
  86. package/mcp-server/package.json +1 -1
  87. package/mcp-server/src/http.ts +9 -1
  88. package/mcp-server/src/index.ts +34 -4
  89. package/mcp-server/src/services/browser-route-flow.ts +12 -5
  90. package/mcp-server/src/services/codex-config-heal.ts +7 -0
  91. package/mcp-server/src/services/neural-interface.ts +190 -29
  92. package/mcp-server/src/services/team-context.ts +27 -0
  93. package/mcp-server/src/services/tool-catalog.ts +26 -8
  94. package/mcp-server/src/services/tool-list.ts +4 -0
  95. package/mcp-server/src/services/tool-runtime.ts +21 -2
  96. package/mcp-server/src/tools/agent-definition.ts +458 -0
  97. package/mcp-server/src/tools/agents.ts +175 -19
  98. package/mcp-server/src/tools/browser-advanced.ts +60 -6
  99. package/mcp-server/src/tools/git-tools.ts +249 -3
  100. package/mcp-server/src/tools/morelogin.ts +20 -5
  101. package/mcp-server/src/tools/team.ts +97 -0
  102. package/neural-interface/i18n/en.json +1117 -47
  103. package/neural-interface/i18n/pt-BR.json +1117 -47
  104. package/neural-interface/lib/account-usage.js +1 -1
  105. package/neural-interface/lib/agents/density.js +101 -0
  106. package/neural-interface/lib/agents/forge-host.js +223 -0
  107. package/neural-interface/lib/agents/native-export-targets.js +190 -0
  108. package/neural-interface/lib/agents/native-export.js +365 -0
  109. package/neural-interface/lib/agents/registry.js +840 -0
  110. package/neural-interface/lib/agents/resolve.js +544 -0
  111. package/neural-interface/lib/agents/schema.js +642 -0
  112. package/neural-interface/lib/agents/split.js +37 -0
  113. package/neural-interface/lib/agents-studio-api.js +591 -0
  114. package/neural-interface/lib/assistant-api.js +76 -7
  115. package/neural-interface/lib/assistant-catalog.js +2 -0
  116. package/neural-interface/lib/assistant-continuity.js +49 -0
  117. package/neural-interface/lib/assistant-dispatch.js +229 -102
  118. package/neural-interface/lib/assistant-persona.js +105 -8
  119. package/neural-interface/lib/assistant-route-gate.js +24 -9
  120. package/neural-interface/lib/assistant-router.js +384 -42
  121. package/neural-interface/lib/assistant-run-tail.js +151 -0
  122. package/neural-interface/lib/assistant-run-wait.js +183 -0
  123. package/neural-interface/lib/assistant-runtime.js +440 -93
  124. package/neural-interface/lib/assistant-task-prompt.js +11 -2
  125. package/neural-interface/lib/assistant-usage.js +3 -2
  126. package/neural-interface/lib/automation-approval.js +2 -2
  127. package/neural-interface/lib/browser-close-evidence.js +80 -0
  128. package/neural-interface/lib/browser-default.js +210 -0
  129. package/neural-interface/lib/browser-extension-adapter.js +255 -0
  130. package/neural-interface/lib/browser-extension-bridge.js +418 -0
  131. package/neural-interface/lib/browser-extension-folder.js +116 -0
  132. package/neural-interface/lib/browser-extension-setup.js +140 -0
  133. package/neural-interface/lib/browser-profile-choices.js +3 -3
  134. package/neural-interface/lib/browser-tool-policy.js +1 -1
  135. package/neural-interface/lib/claude-account-links.js +301 -0
  136. package/neural-interface/lib/claude-accounts.js +45 -20
  137. package/neural-interface/lib/claude-agent-bridge.js +142 -10
  138. package/neural-interface/lib/claude-model-catalog.js +6 -0
  139. package/neural-interface/lib/claude-panel-session.js +33 -0
  140. package/neural-interface/lib/codex-accounts.js +67 -24
  141. package/neural-interface/lib/coordination/README.md +384 -0
  142. package/neural-interface/lib/coordination/service.js +563 -0
  143. package/neural-interface/lib/coordination/store.js +1138 -0
  144. package/neural-interface/lib/db.js +22 -1
  145. package/neural-interface/lib/effort-levels.js +10 -1
  146. package/neural-interface/lib/memory-list-page.js +49 -0
  147. package/neural-interface/lib/memory-list-stamp.js +60 -0
  148. package/neural-interface/lib/morelogin-outside-close.js +186 -0
  149. package/neural-interface/lib/morelogin-profile-failures.js +206 -0
  150. package/neural-interface/lib/morelogin-start-cooldown.js +160 -0
  151. package/neural-interface/lib/morelogin.js +194 -8
  152. package/neural-interface/lib/native-loop-runtime.js +20 -0
  153. package/neural-interface/lib/opencode-build-preflight.js +16 -1
  154. package/neural-interface/lib/opencode-native-boundary.js +83 -13
  155. package/neural-interface/lib/opencode-serve-records.js +14 -9
  156. package/neural-interface/lib/page-session.js +1 -1
  157. package/neural-interface/lib/peer-identity.js +60 -21
  158. package/neural-interface/lib/process-identity.js +68 -7
  159. package/neural-interface/lib/request-gate.js +3 -0
  160. package/neural-interface/lib/screenshot-location.js +33 -0
  161. package/neural-interface/lib/skills/creation.js +1 -1
  162. package/neural-interface/lib/skills/known-bridge-digests.json +40 -0
  163. package/neural-interface/lib/studio-attention.js +56 -0
  164. package/neural-interface/lib/teams/README.md +382 -0
  165. package/neural-interface/lib/teams/api.js +287 -0
  166. package/neural-interface/lib/teams/brief.js +185 -0
  167. package/neural-interface/lib/teams/claims.js +315 -0
  168. package/neural-interface/lib/teams/git.js +293 -0
  169. package/neural-interface/lib/teams/index.js +122 -0
  170. package/neural-interface/lib/teams/integration.js +580 -0
  171. package/neural-interface/lib/teams/landing.js +184 -0
  172. package/neural-interface/lib/teams/recovery.js +256 -0
  173. package/neural-interface/lib/teams/scheduler.js +1474 -0
  174. package/neural-interface/lib/teams/schema.js +559 -0
  175. package/neural-interface/lib/teams/state.js +181 -0
  176. package/neural-interface/lib/teams/test-runner.js +86 -0
  177. package/neural-interface/lib/teams/test-sandbox.js +99 -0
  178. package/neural-interface/lib/teams/worktrees.js +757 -0
  179. package/neural-interface/lib/tool-permission-choices.js +226 -0
  180. package/neural-interface/lib/whatsapp/cards.js +24 -10
  181. package/neural-interface/lib/worker-confinement.js +206 -6
  182. package/neural-interface/package-lock.json +2 -2
  183. package/neural-interface/package.json +1 -1
  184. package/neural-interface/public/extension-setup.html +107 -0
  185. package/neural-interface/public/index.html +52 -12
  186. package/neural-interface/public/shared/agent-runtime-options.js +3 -1
  187. package/neural-interface/public/shared/agents/studio/ax-agent-view.js +614 -0
  188. package/neural-interface/public/shared/agents/studio/ax-api.js +198 -0
  189. package/neural-interface/public/shared/agents/studio/ax-create-view.js +221 -0
  190. package/neural-interface/public/shared/agents/studio/ax-diff.js +143 -0
  191. package/neural-interface/public/shared/agents/studio/ax-editor-view.js +392 -0
  192. package/neural-interface/public/shared/agents/studio/ax-export-view.js +94 -0
  193. package/neural-interface/public/shared/agents/studio/ax-form.js +191 -0
  194. package/neural-interface/public/shared/agents/studio/ax-icons.js +87 -0
  195. package/neural-interface/public/shared/agents/studio/ax-library-view.js +158 -0
  196. package/neural-interface/public/shared/agents/studio/ax-library.js +162 -0
  197. package/neural-interface/public/shared/agents/studio/ax-main.js +712 -0
  198. package/neural-interface/public/shared/agents/studio/ax-native-export.js +35 -0
  199. package/neural-interface/public/shared/agents/studio/ax-options.js +198 -0
  200. package/neural-interface/public/shared/agents/studio/ax-review-view.js +175 -0
  201. package/neural-interface/public/shared/agents/studio/ax-revisions-view.js +189 -0
  202. package/neural-interface/public/shared/agents/studio/ax-runs-view.js +202 -0
  203. package/neural-interface/public/shared/agents/studio/ax-runs.js +82 -0
  204. package/neural-interface/public/shared/agents/studio/ax-teams-view.js +256 -0
  205. package/neural-interface/public/shared/agents/studio/ax-teams.js +200 -0
  206. package/neural-interface/public/shared/agents/studio/ax-templates.js +50 -0
  207. package/neural-interface/public/shared/agents/studio/ax-ui.js +194 -0
  208. package/neural-interface/public/shared/agents/studio/ax-views.js +170 -0
  209. package/neural-interface/public/shared/agy/agy-panel.js +142 -28
  210. package/neural-interface/public/shared/agy/agy-styles.js +25 -5
  211. package/neural-interface/public/shared/assistant/asst-account-menu.js +13 -13
  212. package/neural-interface/public/shared/assistant/asst-ask-styles.js +2 -3
  213. package/neural-interface/public/shared/assistant/asst-brain-picker.js +91 -9
  214. package/neural-interface/public/shared/assistant/asst-control.js +3 -0
  215. package/neural-interface/public/shared/assistant/asst-interaction-hold.js +99 -0
  216. package/neural-interface/public/shared/assistant/asst-limit-dismissals.js +111 -0
  217. package/neural-interface/public/shared/assistant/asst-limit-dock.js +37 -3
  218. package/neural-interface/public/shared/assistant/asst-limit-wait.js +30 -7
  219. package/neural-interface/public/shared/assistant/asst-panel.js +177 -30
  220. package/neural-interface/public/shared/assistant/asst-rack-styles.js +15 -8
  221. package/neural-interface/public/shared/assistant/asst-render.js +36 -6
  222. package/neural-interface/public/shared/assistant/asst-route.js +78 -12
  223. package/neural-interface/public/shared/assistant/asst-routes-editor.js +148 -70
  224. package/neural-interface/public/shared/assistant/asst-roving.js +17 -1
  225. package/neural-interface/public/shared/assistant/asst-scene-styles.js +7 -2
  226. package/neural-interface/public/shared/assistant/asst-scenes.js +12 -1
  227. package/neural-interface/public/shared/assistant/asst-sidepanel.js +12 -2
  228. package/neural-interface/public/shared/assistant/asst-state.js +66 -1
  229. package/neural-interface/public/shared/assistant/asst-styles.js +98 -44
  230. package/neural-interface/public/shared/assistant/route-identity.js +16 -0
  231. package/neural-interface/public/shared/cdx/cdx-output.js +10 -0
  232. package/neural-interface/public/shared/cdx/cdx-panel.js +18 -16
  233. package/neural-interface/public/shared/cdx/cdx-plan.js +3 -2
  234. package/neural-interface/public/shared/cdx/cdx-render.js +122 -45
  235. package/neural-interface/public/shared/cdx/cdx-requests.js +4 -4
  236. package/neural-interface/public/shared/cdx/cdx-styles.js +8 -36
  237. package/neural-interface/public/shared/cdx/cdx-tabs.js +110 -42
  238. package/neural-interface/public/shared/claude-panel-lazy.js +12 -0
  239. package/neural-interface/public/shared/code-copy.js +120 -0
  240. package/neural-interface/public/shared/constants.js +7 -0
  241. package/neural-interface/public/shared/context-menu-model.js +1 -0
  242. package/neural-interface/public/shared/cp/cp-markdown.js +7 -2
  243. package/neural-interface/public/shared/cp/cp-session-model.js +86 -5
  244. package/neural-interface/public/shared/cp/cp-session-settings.js +58 -30
  245. package/neural-interface/public/shared/cp/cp-styles.js +9 -0
  246. package/neural-interface/public/shared/dom-change-flag.js +66 -0
  247. package/neural-interface/public/shared/dom-morph.js +124 -0
  248. package/neural-interface/public/shared/extension-setup/es-page.css +134 -0
  249. package/neural-interface/public/shared/extension-setup/es-page.js +120 -0
  250. package/neural-interface/public/shared/extension-setup/es-view.js +100 -0
  251. package/neural-interface/public/shared/html-shell.js +33 -4
  252. package/neural-interface/public/shared/i18n.js +14 -1
  253. package/neural-interface/public/shared/idle-queue.js +78 -0
  254. package/neural-interface/public/shared/iface-config.js +227 -0
  255. package/neural-interface/public/shared/lazy-module.js +108 -0
  256. package/neural-interface/public/shared/memory-list.js +117 -0
  257. package/neural-interface/public/shared/morelogin-profile-choices.js +1 -1
  258. package/neural-interface/public/shared/morelogin-profile-field.js +3 -3
  259. package/neural-interface/public/shared/mtc/mtc-panel.js +3 -1
  260. package/neural-interface/public/shared/mtc/mtc-styles.js +4 -1
  261. package/neural-interface/public/shared/ocp-v2/ocp-v2-manager.js +35 -15
  262. package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +77 -23
  263. package/neural-interface/public/shared/ocp-v2/ocp-v2-projectbar.js +3 -6
  264. package/neural-interface/public/shared/ocp-v2/ocp-v2-render.js +24 -21
  265. package/neural-interface/public/shared/ocp-v2/ocp-v2-send-logic.js +16 -5
  266. package/neural-interface/public/shared/ocp-v2/ocp-v2-sessions-logic.js +16 -2
  267. package/neural-interface/public/shared/ocp-v2/ocp-v2-styles.js +27 -43
  268. package/neural-interface/public/shared/ocp-v2/ocp-v2-ws.js +73 -9
  269. package/neural-interface/public/shared/schedules-view.js +2 -2
  270. package/neural-interface/public/shared/session-project-items.js +11 -0
  271. package/neural-interface/public/shared/settings/settings-ai-browser.js +119 -0
  272. package/neural-interface/public/shared/settings/settings-browser-extension.js +446 -0
  273. package/neural-interface/public/shared/settings/settings-ia.js +4 -2
  274. package/neural-interface/public/shared/settings/settings-morelogin-cooldown.js +63 -0
  275. package/neural-interface/public/shared/settings/settings-tool-permissions.js +70 -0
  276. package/neural-interface/public/shared/sidepanel-lazy.js +40 -0
  277. package/neural-interface/public/shared/sidepanel-session-status.js +8 -14
  278. package/neural-interface/public/shared/sidepanel-shown.js +73 -0
  279. package/neural-interface/public/shared/storage.js +6 -1
  280. package/neural-interface/public/shared/studio-attention.js +83 -0
  281. package/neural-interface/public/shared/styles.css +682 -50
  282. package/neural-interface/public/shared/term-browser-tabs.js +34 -0
  283. package/neural-interface/public/shared/transcript-rows.js +334 -0
  284. package/neural-interface/public/shared/tray-auto-close.js +106 -0
  285. package/neural-interface/public/shared/ui-agents.js +97 -0
  286. package/neural-interface/public/shared/ui-antigravity-panel.js +16 -14
  287. package/neural-interface/public/shared/ui-automation-studio.js +3 -3
  288. package/neural-interface/public/shared/ui-claude-panel.js +162 -95
  289. package/neural-interface/public/shared/ui-code-copy.js +256 -0
  290. package/neural-interface/public/shared/ui-codex-panel.js +14 -10
  291. package/neural-interface/public/shared/ui-context-menu.js +1 -1
  292. package/neural-interface/public/shared/ui-file-explorer.js +2 -3
  293. package/neural-interface/public/shared/ui-games.js +1 -1
  294. package/neural-interface/public/shared/ui-loading.js +12 -1
  295. package/neural-interface/public/shared/ui-maritaca-panel.js +12 -11
  296. package/neural-interface/public/shared/ui-menubar.js +23 -0
  297. package/neural-interface/public/shared/ui-native-loop-router.js +1 -1
  298. package/neural-interface/public/shared/ui-navbar.js +15 -9
  299. package/neural-interface/public/shared/ui-opencode-panel-v2.js +13 -11
  300. package/neural-interface/public/shared/ui-schedules-studio.js +3 -3
  301. package/neural-interface/public/shared/ui-scroll-follow.js +39 -0
  302. package/neural-interface/public/shared/ui-sessions.js +3 -3
  303. package/neural-interface/public/shared/ui-settings-entry.js +55 -0
  304. package/neural-interface/public/shared/ui-settings.js +355 -400
  305. package/neural-interface/public/shared/ui-sidepanel-layout.js +44 -25
  306. package/neural-interface/public/shared/ui-sidepanel-session-entry.js +22 -9
  307. package/neural-interface/public/shared/ui-sidepanel-sessions.js +10 -2
  308. package/neural-interface/public/shared/ui-sidepanel-tray.js +36 -41
  309. package/neural-interface/public/shared/ui-sidepanel-windows.js +14 -1
  310. package/neural-interface/public/shared/ui-styleguide.js +10 -2
  311. package/neural-interface/public/shared/ui-sync.js +5 -0
  312. package/neural-interface/public/shared/ui-terminal.js +13 -9
  313. package/neural-interface/public/shared/ui-tooltip.js +28 -7
  314. package/neural-interface/public/shared/ui-topright-overflow.js +26 -4
  315. package/neural-interface/public/shared/ui-tray-columns.js +375 -0
  316. package/neural-interface/public/shared/ui-whiteboard.js +51 -6
  317. package/neural-interface/public/shared/ui-worker-end.js +28 -1
  318. package/neural-interface/public/shared/ui-workspaces.js +13 -0
  319. package/neural-interface/public/shared/window-keys.js +71 -0
  320. package/neural-interface/public/variant/2d/main.js +2 -0
  321. package/neural-interface/public/variant/3d/app.js +620 -0
  322. package/neural-interface/public/variant/3d/boot-reveal.js +47 -0
  323. package/neural-interface/public/variant/3d/main.js +21 -544
  324. package/neural-interface/public/variant/3d/map-controls.js +4 -2
  325. package/neural-interface/public/vendor/fonts/fonts.css +508 -0
  326. package/neural-interface/public/vendor/fonts/inter-OFL.txt +93 -0
  327. package/neural-interface/public/vendor/fonts/inter-cyrillic-ext.woff2 +0 -0
  328. package/neural-interface/public/vendor/fonts/inter-cyrillic.woff2 +0 -0
  329. package/neural-interface/public/vendor/fonts/inter-greek-ext.woff2 +0 -0
  330. package/neural-interface/public/vendor/fonts/inter-greek.woff2 +0 -0
  331. package/neural-interface/public/vendor/fonts/inter-latin-ext.woff2 +0 -0
  332. package/neural-interface/public/vendor/fonts/inter-latin.woff2 +0 -0
  333. package/neural-interface/public/vendor/fonts/inter-vietnamese.woff2 +0 -0
  334. package/neural-interface/public/vendor/fonts/jetbrains-mono-OFL.txt +93 -0
  335. package/neural-interface/public/vendor/fonts/jetbrains-mono-cyrillic-ext.woff2 +0 -0
  336. package/neural-interface/public/vendor/fonts/jetbrains-mono-cyrillic.woff2 +0 -0
  337. package/neural-interface/public/vendor/fonts/jetbrains-mono-greek.woff2 +0 -0
  338. package/neural-interface/public/vendor/fonts/jetbrains-mono-latin-ext.woff2 +0 -0
  339. package/neural-interface/public/vendor/fonts/jetbrains-mono-latin.woff2 +0 -0
  340. package/neural-interface/public/vendor/fonts/jetbrains-mono-vietnamese.woff2 +0 -0
  341. package/neural-interface/public/vendor/fonts/manifest.json +142 -0
  342. package/neural-interface/public/vendor/fonts/space-grotesk-OFL.txt +93 -0
  343. package/neural-interface/public/vendor/fonts/space-grotesk-latin-ext.woff2 +0 -0
  344. package/neural-interface/public/vendor/fonts/space-grotesk-latin.woff2 +0 -0
  345. package/neural-interface/public/vendor/fonts/space-grotesk-vietnamese.woff2 +0 -0
  346. package/neural-interface/scripts/boot-graph.mjs +270 -0
  347. package/neural-interface/scripts/vendor-fonts.mjs +124 -0
  348. package/neural-interface/server.js +1050 -140
  349. package/npm-shrinkwrap.json +2 -2
  350. package/package.json +3 -1
  351. package/skills/agent-forge/SKILL.md +182 -0
  352. package/skills/agent-forge/evals/evals.json +56 -0
  353. package/skills/agent-forge/references/definition-fields.md +61 -0
  354. package/skills/agent-forge/references/examples.md +105 -0
  355. package/skills/agent-forge/references/instructions.md +51 -0
  356. package/skills/agent-forge/references/review-and-export.md +84 -0
@@ -98,6 +98,7 @@ export const DEFAULT_BRAIN = Object.freeze({
98
98
  project: null,
99
99
  tools: Object.freeze(['all']),
100
100
  accountId: null,
101
+ accountPolicy: 'manual',
101
102
  permissionMode: 'default',
102
103
  planMode: false,
103
104
  });
@@ -183,6 +184,7 @@ export function normalizeBrain(raw, fallback = DEFAULT_BRAIN) {
183
184
  project: str(src.project ?? src.cwd) || null,
184
185
  tools: provider === 'opencode' ? (Array.isArray(src.tools) ? [...src.tools] : null) : ['all'],
185
186
  accountId: ACCOUNT_PROVIDERS.has(provider) ? (str(src.accountId) || null) : null,
187
+ accountPolicy: ACCOUNT_PROVIDERS.has(provider) && (src.accountId === 'auto' || src.accountPolicy === 'auto') ? 'auto' : 'manual',
186
188
  permissionMode: modes.some(m => m.id === mode) ? mode : 'default',
187
189
  planMode: PLAN_MODE_PROVIDERS.has(provider) && (src.planMode === true || legacyPlan),
188
190
  };
@@ -516,6 +518,28 @@ export function sessionStatus(own, workers = {}) {
516
518
  return own === 'done' ? 'done' : 'idle';
517
519
  }
518
520
 
521
+ // Statuses of a session record in which nothing is going on.
522
+ const QUIET_STATUSES = new Set(['', 'idle', 'done', 'ended']);
523
+
524
+ /**
525
+ * May a tab's conversation be read and drawn later (in the page's idle time, or when the tab is shown)
526
+ * instead of as the tab is made?
527
+ *
528
+ * Only for a tab nobody is looking at whose session is known and known to be quiet. On screen: now. No
529
+ * record of the session (a new one, a host that passes none): now, as before. At work, waiting on an answer,
530
+ * or in a state this page does not know: now, so its pill and its agents say at once what it does.
531
+ *
532
+ * @param {{ visible: boolean, session?: object | null }} tab
533
+ */
534
+ export function conversationCanWait({ visible, session } = {}) {
535
+ if (visible !== false) return false;
536
+ if (!session || typeof session !== 'object') return false;
537
+ if (session.running || session.busy || session.pending) return false;
538
+ if (Number(session.activeRuns) > 0 || Number(session.waiting) > 0) return false;
539
+ const status = session.status == null ? '' : String(session.status);
540
+ return QUIET_STATUSES.has(status);
541
+ }
542
+
519
543
  function toMs(value) {
520
544
  if (value == null || value === '') return 0;
521
545
  if (typeof value === 'number') return Number.isFinite(value) ? value : 0;
@@ -606,6 +630,29 @@ export function testDensityBars(level) {
606
630
  return TEST_DENSITIES.indexOf(normalizeTestDensity(level));
607
631
  }
608
632
 
633
+ // agents-p4: Agent density: how many workers ONE task may get (server: lib/agents/density.js; the numbers and the
634
+ // default are copies, tests/agents-density-wiring.test.mjs fails when one drifts). `null` means "server default"
635
+ // in a tab's own state; a missing or unknown value reads as the default level, Solo.
636
+ export const AGENT_DENSITIES = ['solo', 'pair', 'team', 'swarm'];
637
+ export const DEFAULT_AGENT_DENSITY = 'solo';
638
+ export const AGENT_DENSITY_WORKERS = { solo: 1, pair: 2, team: 4, swarm: 6 };
639
+
640
+ /** A known level, else `fallback` (the default level; pass null to tell "not set" apart). */
641
+ export function normalizeAgentDensity(value, fallback = DEFAULT_AGENT_DENSITY) {
642
+ const key = str(value).toLowerCase();
643
+ return AGENT_DENSITIES.includes(key) ? key : fallback;
644
+ }
645
+
646
+ /** The most workers one task gets at a level: solo 1 · pair 2 · team 4 · swarm 6. */
647
+ export function agentDensityWorkers(level) {
648
+ return AGENT_DENSITY_WORKERS[normalizeAgentDensity(level)];
649
+ }
650
+
651
+ /** Figures of the composer's glyph that are drawn at full strength at a level: solo 1 · pair 2 · team 3 · swarm 4. */
652
+ export function agentDensityFigures(level) {
653
+ return AGENT_DENSITIES.indexOf(normalizeAgentDensity(level)) + 1;
654
+ }
655
+
609
656
  const COMPUTER_ON = new Set(['on', 'true', '1', 'yes', 'enable', 'enabled']);
610
657
  const COMPUTER_OFF = new Set(['off', 'false', '0', 'no', 'disable', 'disabled']);
611
658
 
@@ -634,7 +681,22 @@ export function routeTargetLabel(target, { effort = false } = {}) {
634
681
  const label = str(target.label) || modelShortName(target.model) || providerShortLabel(provider);
635
682
  if (!effort) return label;
636
683
  const level = str(target.effort);
637
- return level && level !== 'off' ? `${label} · ${routeEffortWord(level)}` : label;
684
+ if (!level || level === 'off') return label;
685
+ // A router label of a worker already ends in its effort ("Claude Code · Sonnet 5 · high", "… · thinking off"): once.
686
+ return routeLabelEffortWord(label, level) ? label : `${label} · ${routeEffortWord(level)}`;
687
+ }
688
+
689
+ /**
690
+ * The effort word `label` ends in (" · high", " · off", or the router's " · thinking off" for `none`),
691
+ * as written there, else ''. No effort, or the auto "off": ''.
692
+ */
693
+ export function routeLabelEffortWord(label, effort) {
694
+ const level = str(effort);
695
+ if (!level || level === 'off') return '';
696
+ const text = str(label).toLowerCase();
697
+ const words = level.toLowerCase() === ROUTE_EFFORT_OFF ? ['thinking off', routeEffortWord(level)] : [routeEffortWord(level)];
698
+ const word = words.find((w) => text.endsWith(` · ${w.toLowerCase()}`)) || '';
699
+ return word ? str(label).slice(-word.length) : '';
638
700
  }
639
701
 
640
702
  /** Off for a route is the effort id `none` (no thinking); shown as "off". Other ids as they are. */
@@ -877,6 +939,7 @@ export function createTabState(sessionId, brain, extra = {}) {
877
939
  routeMode: null, // explicit per-session route mode; null = server default
878
940
  computerUse: null, // explicit per-session computer use; null = server default
879
941
  testDensity: null, // explicit per-session test density; null = server default
942
+ agentDensity: null, // agents-p4: explicit per-session Agent density; null = server default (Solo)
880
943
  usageView: null,
881
944
  limit: null, // the provider's usage limit notice (applyLimit); never persisted, the server re-sends it on attach
882
945
  ...extra,
@@ -898,6 +961,7 @@ export function serializeTabState(state) {
898
961
  routeMode: normalizeRouteMode(state.routeMode, null),
899
962
  computerUse: normalizeComputerMode(state.computerUse, null),
900
963
  testDensity: normalizeTestDensity(state.testDensity, null),
964
+ agentDensity: normalizeAgentDensity(state.agentDensity, null), // agents-p4
901
965
  usageView: compactUsageView(state.usageView),
902
966
  updatedAt: Date.now(),
903
967
  };
@@ -921,6 +985,7 @@ export function deserializeTabState(raw) {
921
985
  routeMode: normalizeRouteMode(data.routeMode, null),
922
986
  computerUse: normalizeComputerMode(data.computerUse, null),
923
987
  testDensity: normalizeTestDensity(data.testDensity, null),
988
+ agentDensity: normalizeAgentDensity(data.agentDensity, null), // agents-p4: an older payload reads as the server default
924
989
  usageView: compactUsageView(data.usageView),
925
990
  };
926
991
  }
@@ -15,7 +15,11 @@
15
15
  // Infinite animations pause during drags (body.ui-interacting) and stop under
16
16
  // prefers-reduced-motion.
17
17
 
18
+ import { installCodeCopy } from '../ui-code-copy.js';
19
+
18
20
  export function injectAssistantStyles() {
21
+ // The Copy button of every code block: its stylesheet and its one click listener, in this document.
22
+ installCodeCopy(document);
19
23
  if (document.getElementById('assistant-panel-styles')) return;
20
24
  const style = document.createElement('style');
21
25
  style.id = 'assistant-panel-styles';
@@ -545,7 +549,7 @@ export function injectAssistantStyles() {
545
549
  cursor: zoom-in;
546
550
  }
547
551
  .asst-computer-frame:hover { box-shadow: 0 0 0 1px var(--asst-line-2); }
548
- .asst-computer-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
552
+ .asst-computer-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
549
553
  .asst-computer-frame.failed { display: none; }
550
554
  .asst-computer-frame.compact {
551
555
  display: inline-flex;
@@ -614,8 +618,8 @@ export function injectAssistantStyles() {
614
618
  }
615
619
 
616
620
  /* ── Route lines ────────────────────────────────────────────────────
617
- One line at any width, in the cards' column (the rack's 560px, no
618
- hang): the glyph, arrow, kind and mark hold; the rest (model ·
621
+ One line at any width, spanning the column like the rack and the
622
+ ask cards (no hang): the glyph, arrow, kind and mark hold; the rest (model ·
619
623
  account · usage, or the state) takes only the room left (flex-basis 0)
620
624
  and ellipsizes first; the class gives way once the rest is down to
621
625
  its "…". The head's title carries the whole text. */
@@ -625,8 +629,7 @@ export function injectAssistantStyles() {
625
629
  display: flex;
626
630
  align-items: center;
627
631
  gap: 6px;
628
- width: fit-content;
629
- max-width: min(100%, 560px);
632
+ width: 100%;
630
633
  min-width: 0;
631
634
  min-height: 26px;
632
635
  padding: 3px 8px;
@@ -759,7 +762,7 @@ export function injectAssistantStyles() {
759
762
  .asst-run-media { grid-column: 2 / span 2; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
760
763
  .asst-run-media-thumb { display: block; width: 88px; height: 88px; padding: 0; border: 0; border-radius: var(--asst-r-field); overflow: hidden; background: var(--asst-field); box-shadow: 0 0 0 1px var(--asst-line); cursor: zoom-in; }
761
764
  .asst-run-media-thumb:hover { box-shadow: 0 0 0 1px var(--asst-line-2); }
762
- .asst-run-media-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
765
+ .asst-run-media-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
763
766
  .asst-run-media-thumb.failed { display: none; }
764
767
  .asst-run-media-video { display: block; width: min(100%, 320px); max-height: 220px; border-radius: var(--asst-r-field); background: #000; box-shadow: 0 0 0 1px var(--asst-line); }
765
768
  .asst-run-escalate { grid-column: 2 / span 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
@@ -1112,7 +1115,7 @@ export function injectAssistantStyles() {
1112
1115
  box-shadow: 0 0 0 1px var(--asst-line);
1113
1116
  cursor: zoom-in;
1114
1117
  }
1115
- .asst-computer-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
1118
+ .asst-computer-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
1116
1119
  .asst-computer-activity-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
1117
1120
  .asst-computer-activity-title, .asst-computer-activity-sub { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
1118
1121
  .asst-computer-activity-title { color: var(--asst-text); font-size: 12.5px; font-weight: 500; }
@@ -1818,7 +1821,18 @@ export function injectAssistantStyles() {
1818
1821
  /* Model routes editor: Settings density on a desktop pointer. Scoped here
1819
1822
  so route cards, the model manager and other Assistant menus keep their UI. */
1820
1823
  .asst-routes-overlay { font-family: var(--stg-font, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Inter, sans-serif); }
1821
- .asst-routes-overlay .asst-routes-modal { width: min(960px, 100%); max-height: calc(100dvh - 24px); border-radius: var(--asst-r-card); line-height: 1.4; }
1824
+ .asst-routes-overlay .asst-routes-modal {
1825
+ --asst-routes-max-height: calc(100dvh - 48px);
1826
+ width: min(660px, 100%);
1827
+ height: var(--asst-routes-collapsed-height, auto);
1828
+ max-height: var(--asst-routes-max-height);
1829
+ border-radius: var(--asst-r-card);
1830
+ line-height: 1.4;
1831
+ }
1832
+ .asst-routes-overlay .asst-routes-modal:has(.asst-routes-assignments[data-opening], .asst-routes-confirm:not([hidden])) { height: auto; }
1833
+ .asst-routes-overlay .asst-routes-modal[data-measure-collapsed] { height: auto; max-height: none; }
1834
+ .asst-routes-modal[data-measure-collapsed] :is(.asst-routes-row > .asst-routes-reveal, .asst-routes-scroll-cue) { position: absolute; }
1835
+ .asst-routes-modal[data-measure-collapsed] .asst-routes-assignments[data-opening] { max-height: none !important; }
1822
1836
  .asst-routes-modal :is(.asst-btn, .asst-dd, .asst-iconbtn) { --cap-h: var(--asst-pill-h-sm); --cap-r: var(--asst-pill-r-xs); --cap-px: var(--asst-pill-px-sm); --cap-icon: 12px; --cap-gap: 4px; }
1823
1837
  .asst-routes-modal .asst-modal-head { min-height: 36px; padding: 6px 12px 6px 18px; font-size: 13px; }
1824
1838
  .asst-routes-modal .asst-modal-head .asst-icon { color: var(--asst-text-2); }
@@ -1908,7 +1922,7 @@ export function injectAssistantStyles() {
1908
1922
  }
1909
1923
  @media (max-width: 600px) {
1910
1924
  .asst-routes-overlay { padding: 8px; }
1911
- .asst-routes-overlay .asst-routes-modal { max-height: calc(100dvh - 16px); }
1925
+ .asst-routes-overlay .asst-routes-modal { --asst-routes-max-height: calc(100dvh - 32px); }
1912
1926
  .asst-routes-modal .asst-modal-body { padding: 14px; gap: 16px; }
1913
1927
  .asst-routes-modal .asst-modal-head { padding-inline: 14px 8px; }
1914
1928
  .asst-routes-modal .asst-routes-modes { grid-template-columns: 1fr; }
@@ -1931,38 +1945,77 @@ export function injectAssistantStyles() {
1931
1945
  .asst-routes-confirm { padding: 10px 14px; }
1932
1946
  }
1933
1947
 
1934
- /* Model routes: grouped summaries with a single task editor. */
1935
- .asst-routes-modal .asst-routes-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; padding: 0; border: 0; background: transparent; }
1936
- .asst-routes-group { min-width: 0; }
1937
- .asst-routes-group > h3 { margin: 8px 0 4px; color: var(--asst-text-2); font-size: 12px; font-weight: 600; }
1938
- .asst-routes-modal .asst-routes-row { display: block; padding: 0; border-top: 1px solid var(--asst-line); }
1939
- .asst-routes-toggle { display: grid; grid-template-columns: minmax(90px, .8fr) minmax(0, 1.3fr) auto 12px; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 8px 4px; border: 0; background: transparent; color: var(--asst-text); text-align: start; font: inherit; cursor: pointer; border-radius: var(--asst-pill-r-xs); }
1940
- .asst-routes-toggle:hover, .asst-routes-toggle[aria-expanded="true"] { background: var(--asst-fill-1); }
1941
- .asst-routes-toggle:focus-visible { outline: 2px solid var(--asst-focus); outline-offset: -2px; }
1942
- .asst-routes-summary-name { font-size: 13px; overflow-wrap: anywhere; }
1943
- .asst-routes-summary-value { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 2px 6px; font-size: 12px; }
1948
+ /* The Models manager shares the base modal. The routing layout belongs to its overlay. */
1949
+ .asst-models-modal .asst-routes-row { display: block; padding: 0; }
1950
+ .asst-models-modal .asst-routes-row-main { padding: 0 4px; }
1951
+ .asst-models-modal .asst-routes-row-main > :not([hidden]) { white-space: normal; margin: 0 0 8px; line-height: 1.45; }
1952
+
1953
+ .asst-routes-overlay .asst-modal-body { gap: 8px; padding: 12px 16px; }
1954
+ .asst-routes-overlay .asst-routes-ask { gap: 8px; padding-bottom: 8px; }
1955
+ .asst-routes-overlay .asst-routes-ask-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
1956
+ .asst-routes-overlay .asst-routes-ask-head .asst-routes-modes { grid-template-columns: repeat(3, auto); max-width: none; }
1957
+ .asst-routes-overlay .asst-routes-mode { height: auto; min-height: var(--asst-pill-h-sm); }
1958
+ .asst-routes-overlay .asst-routes-mode-label { white-space: normal; text-align: center; overflow-wrap: anywhere; line-height: 1.35; }
1959
+ .asst-routes-overlay :is(.asst-routes-mode-desc, .asst-routes-session-note) { white-space: normal; overflow-wrap: anywhere; line-height: 1.45; }
1960
+ .asst-routes-session-note { border-inline-start: 2px solid var(--asst-line-2); padding-inline-start: 8px; }
1961
+ .asst-routes-task-head { border-top: 1px solid var(--asst-line-2); padding-top: 8px; }
1962
+ .asst-routes-disclosure { display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 0 4px; background: transparent; border: 0; border-radius: var(--asst-pill-r-xs); color: inherit; font: inherit; text-align: start; cursor: pointer; }
1963
+ .asst-routes-disclosure:hover { background: var(--asst-fill-1); }
1964
+ .asst-routes-choice-count { font-size: 12px; font-weight: 400; color: var(--asst-text-2); }
1965
+ .asst-routes-chevron { display: inline-flex; justify-content: center; align-items: center; color: var(--asst-text-2); transform: rotate(-90deg); }
1966
+ [dir="rtl"] .asst-routes-chevron { transform: rotate(90deg); }
1967
+ .asst-routes-chevron svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
1968
+ .asst-routes-overlay [aria-expanded="true"] > .asst-routes-chevron { transform: none; }
1969
+ .asst-routes-validation { margin: 0; font-size: 12px; color: var(--asst-warn); }
1970
+ .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
+ .asst-routes-group { display: grid; grid-template-columns: 96px minmax(0, 1fr); min-width: 0; padding: 4px 8px; column-gap: 8px; }
1972
+ .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; }
1974
+ .asst-routes-overlay .asst-routes-row { display: block; padding: 0; grid-column: 2; border: 0; }
1975
+ .asst-routes-overlay .asst-routes-row + .asst-routes-row { border-top: 1px solid var(--asst-line); }
1976
+ .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; }
1977
+ .asst-routes-toggle .asst-routes-chevron { grid-column: 4; }
1978
+ .asst-routes-toggle:hover, .asst-routes-toggle[aria-expanded="true"] { background: var(--asst-fill-2); }
1979
+ .asst-routes-overlay :is(.asst-routes-toggle, .asst-routes-disclosure):focus-visible { outline: 2px solid var(--asst-focus); outline-offset: -2px; }
1980
+ .asst-routes-overlay .asst-routes-summary-name { white-space: normal; overflow-wrap: anywhere; }
1981
+ .asst-routes-summary-value { display: flex; min-width: 0; align-items: center; gap: 6px; font-size: 12px; }
1944
1982
  .asst-routes-summary-model { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
1945
- .asst-routes-summary-value:not(:has(.asst-icon)) .asst-routes-summary-model { grid-column: 1 / -1; color: var(--asst-text-2); }
1946
- .asst-routes-summary-meta { grid-column: 2; color: var(--asst-text-2); font-size: 11.5px; overflow-wrap: anywhere; }
1947
- .asst-routes-summary-status { font-size: 11px; color: var(--asst-text-2); max-width: 64px; }
1983
+ .asst-routes-summary-value:not(:has(.asst-icon)), .asst-routes-summary-status { color: var(--asst-text-2); }
1984
+ .asst-routes-summary-status { max-width: 12ch; overflow-wrap: anywhere; font-size: 12px; }
1948
1985
  .asst-routes-row[data-issue="true"] .asst-routes-summary-status { color: var(--asst-warn); }
1949
- .asst-routes-chevron svg { width: 12px; height: 12px; }
1950
- .asst-routes-toggle[aria-expanded="true"] .asst-routes-chevron { transform: rotate(180deg); }
1951
- .asst-routes-modal .asst-routes-row-main { padding: 0 4px; }
1952
- .asst-routes-modal .asst-routes-row-main > :not([hidden]) { white-space: normal; margin: 0 0 8px; line-height: 1.45; }
1953
- .asst-routes-details { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 24px; gap: 12px 8px; padding: 8px; margin-bottom: 8px; border-radius: var(--asst-r-field); background: var(--asst-fill-1); }
1954
- .asst-routes-details[hidden] { display: none; }
1955
- .asst-routes-details .asst-routes-cell { flex-direction: column; gap: 4px; min-width: 0; }
1956
- .asst-routes-details .asst-routes-cell-label { display: block; color: var(--asst-text-2); font-size: 12px; }
1957
- .asst-routes-details .asst-routes-model-cell, .asst-routes-details .asst-routes-account-cell { grid-column: 1 / -1; }
1958
- .asst-routes-details .asst-routes-reset-cell { align-self: end; }
1959
- .asst-routes-modal .asst-routes-mode-desc, .asst-routes-modal .asst-routes-session-note { white-space: normal; }
1960
- .asst-routes-modal .asst-routes-ask-head .asst-routes-session-note { flex-basis: 100%; text-align: start; }
1961
- @media (max-width: 700px) {
1962
- .asst-routes-modal .asst-routes-list { grid-template-columns: 1fr; gap: 12px; }
1963
- .asst-routes-modal .asst-routes-details { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; }
1964
- .asst-routes-modal .asst-routes-details :is(.asst-routes-effort-cell, .asst-routes-run-cell) { grid-column: auto; }
1965
- .asst-routes-modal .asst-routes-summary-status { max-width: 54px; }
1986
+ .asst-routes-reveal { display: flow-root; flex-shrink: 0; }
1987
+ @media (prefers-reduced-motion: no-preference) {
1988
+ .asst-routes-reveal[data-opening] { overflow: clip; animation: asst-routes-reveal var(--asst-dur-base) var(--asst-ease-standard); }
1989
+ }
1990
+ @keyframes asst-routes-reveal {
1991
+ from { max-height: 0; }
1992
+ to { max-height: var(--asst-routes-reveal-height); }
1993
+ }
1994
+ .asst-routes-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 8px 12px; padding: 8px 12px 12px; margin-block: 2px 8px; border-inline-start: 2px solid var(--asst-line-2); background: var(--asst-fill-1); }
1995
+ .asst-routes-details .asst-routes-row-main { grid-column: 1 / -1; }
1996
+ .asst-routes-details .asst-routes-row-main > :not([hidden]) { white-space: normal; overflow-wrap: anywhere; line-height: 1.45; }
1997
+ .asst-routes-details .asst-routes-cell { flex-direction: column; gap: 4px; }
1998
+ .asst-routes-details .asst-routes-cell-label { display: block; font-size: 12px; color: var(--asst-text-2); }
1999
+ .asst-routes-details .asst-routes-model-cell { grid-column: 1 / -1; }
2000
+ .asst-routes-details .asst-routes-reset-cell { grid-column: 3; grid-row: 4; align-self: end; }
2001
+ .asst-routes-details .asst-routes-run-cell { grid-column: 2 / -1; }
2002
+ .asst-routes-details .asst-routes-account-cell { grid-column: 1 / 3; }
2003
+ .asst-routes-details .asst-dd { height: auto; padding-block: 3px; }
2004
+ .asst-routes-details .asst-dd .asst-dd-label { white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
2005
+ .asst-routes-overlay[hidden] { display: none; }
2006
+ @media (pointer: coarse), (max-width: 600px) {
2007
+ .asst-routes-overlay :is(.asst-routes-mode, .asst-routes-toggle, .asst-routes-disclosure, .asst-routes-list-actions .asst-btn) { min-height: 44px; }
2008
+ }
2009
+ @media (max-width: 600px) {
2010
+ .asst-routes-overlay .asst-modal-body { padding: 12px; }
2011
+ .asst-routes-overlay .asst-routes-ask-head { grid-template-columns: minmax(0, 1fr); }
2012
+ .asst-routes-group { display: block; }
2013
+ .asst-routes-group > h3 { padding-bottom: 0; }
2014
+ .asst-routes-toggle { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) 12px; gap: 2px 8px; }
2015
+ .asst-routes-summary-status { grid-column: 2; max-width: none; }
2016
+ .asst-routes-toggle .asst-routes-chevron { grid-area: 1 / 3; }
2017
+ .asst-routes-overlay .asst-routes-details .asst-routes-account-cell { grid-column: 1 / 3; }
2018
+ .asst-routes-task-head { gap: 0 8px; }
1966
2019
  }
1967
2020
 
1968
2021
  /* ── Frame lightbox ─────────────────────────────────────────────── */
@@ -2041,8 +2094,9 @@ export function injectAssistantStyles() {
2041
2094
  /* ── Narrow / short containers (the tab or float window) ──────────
2042
2095
  Toolbar priority, highest first: route mode · Computer · project ·
2043
2096
  MCP. The composer row (attach · model · effort · permission mode ·
2044
- test density · account) keeps model; account hides ≤720px, where test
2045
- density is its gauge alone. A capsule that runs out of
2097
+ test density · agent density · account) keeps model; account hides
2098
+ ≤720px, where test density and agent density are their glyphs alone
2099
+ (agents-p4). A capsule that runs out of
2046
2100
  room drops its label half first and stays a glyph (its words remain in
2047
2101
  aria-label and the tooltip): route mode and Computer ≤960px, the mode
2048
2102
  ≤540px, every composer field but the model ≤440px, where the model
@@ -2064,9 +2118,9 @@ export function injectAssistantStyles() {
2064
2118
  }
2065
2119
  @container asst (max-width: 720px) {
2066
2120
  :is(.asst-dd-mcp, .asst-dd-account, .asst-dd-project, .asst-bar-group[data-group="context"]) { display: none !important; }
2067
- .asst-composer-brain .asst-dd.asst-dd-tests { display: grid; place-content: center; place-items: center; padding: 0; }
2068
- .asst-composer-brain .asst-dd.asst-dd-tests > :is(.asst-dd-label, .asst-dd-caret) { display: none; }
2069
- .asst-composer-brain .asst-dd.asst-dd-tests > .asst-icon:not([hidden]) { margin: 0; padding: 0 var(--cap-glyph-pad); box-shadow: none; }
2121
+ .asst-composer-brain .asst-dd:is(.asst-dd-tests, .asst-dd-agents) { display: grid; place-content: center; place-items: center; padding: 0; }
2122
+ .asst-composer-brain .asst-dd:is(.asst-dd-tests, .asst-dd-agents) > :is(.asst-dd-label, .asst-dd-caret) { display: none; }
2123
+ .asst-composer-brain .asst-dd:is(.asst-dd-tests, .asst-dd-agents) > .asst-icon:not([hidden]) { margin: 0; padding: 0 var(--cap-glyph-pad); box-shadow: none; }
2070
2124
  .asst-route-keys { display: none; }
2071
2125
  }
2072
2126
  @container asst (max-width: 540px) {
@@ -0,0 +1,16 @@
1
+ // The runtime's request identity, shared by the router and the panel. Wording is never identity.
2
+ export function routeTaskIdentity(route) {
3
+ if (!route?.taskId) return null; // Old transcripts predate task identities.
4
+ return JSON.stringify([route.sessionId || '', route.taskId, route.taskKey || '']);
5
+ }
6
+
7
+ // Control packets and transcript events can arrive in either order on attach/reconnect.
8
+ export function createRouteReplayGuard() {
9
+ const seen = new Set();
10
+ const keys = route => [route?.routeId, routeTaskIdentity(route)].filter(Boolean);
11
+ return {
12
+ has: route => keys(route).some(key => seen.has(key)),
13
+ record: route => { for (const key of keys(route)) seen.add(key); },
14
+ clear: () => seen.clear(),
15
+ };
16
+ }
@@ -57,7 +57,17 @@ function releaseMeasurements(root) {
57
57
  }
58
58
  }
59
59
 
60
+ // A closed side panel is not drawn (ui-sidepanel-windows.js: data-sp-visible="false", content-visibility: hidden).
61
+ // A block in it cannot be judged now: checkVisibility() says no for everything in there, and reading its height
62
+ // would make the engine lay the whole closed panel out. The note stays as it is and the block is measured when it
63
+ // is next on screen (the observer that builds the diffs lazily): when the panel is shown, or when it scrolls near.
64
+ const CLOSED_PANEL = '.sp-sidepanel[data-sp-visible="false"]';
65
+
60
66
  export function updateOverflowNote(block, note) {
67
+ if (observer && block.closest?.(CLOSED_PANEL)) {
68
+ if (!pending.has(block)) { pending.set(block, () => queueMeasurement(block)); observer.observe(block); }
69
+ return !note.hidden;
70
+ }
61
71
  const clipped = outputOverflows(block.scrollHeight, block.clientHeight) && block.checkVisibility?.() !== false;
62
72
  if (note.hidden !== !clipped) note.hidden = !clipped;
63
73
  const ids = (block.getAttribute('aria-describedby') || '').split(/\s+/).filter(id => id && id !== note.id);
@@ -86,7 +86,6 @@ let _freshThread = false;
86
86
  let _threadId = null;
87
87
  let _project = '';
88
88
  let _boundTab = null;
89
- let _tabs = [];
90
89
  let _activeTabIdx = -1;
91
90
  let _sessionLabel = 'New session';
92
91
  let _items = new Map();
@@ -154,7 +153,6 @@ export function syncBoundState(s) {
154
153
  _threadId = s.threadId ?? _threadId;
155
154
  _project = s.project ?? _project;
156
155
  _boundTab = s.boundTab ?? _boundTab;
157
- _tabs = s.tabs ?? _tabs;
158
156
  _activeTabIdx = s.activeTabIdx ?? _activeTabIdx;
159
157
  _sessionLabel = s.sessionLabel ?? _sessionLabel;
160
158
  _items = s.items ?? _items;
@@ -518,7 +516,9 @@ function applyVisibility(nextVisible) {
518
516
  if (_visible) {
519
517
  window.addEventListener('keydown', _cdxPanelEscHandler, { capture: true });
520
518
  document.addEventListener('keydown', _cdxDocEscHandler, { capture: true });
521
- if (!_tabs.length) createTab({ project: storage.getItem(STOR.project) || '' });
519
+ // The tabs are cdx-tabs.js's own (allTabs()), never a copy kept here: a copy that nothing kept up to date
520
+ // read as empty, and every show made a blank tab and put it in front of the one a pill had just chosen.
521
+ if (!allTabs().length) createTab({ project: storage.getItem(STOR.project) || '' });
522
522
  state.lastActivePanel = 'codex';
523
523
  updateActiveTabView();
524
524
  loadRecallProfile();
@@ -535,22 +535,22 @@ function applyVisibility(nextVisible) {
535
535
  // loadBranches — Fetch git branches for project
536
536
  // ═══════════════════════════════════════════
537
537
 
538
+ let _branchRequest = 0;
538
539
  async function loadBranches(path) {
540
+ const request = ++_branchRequest;
539
541
  const $branch = panelEl('#cxp-branch');
540
542
  if (!$branch) return;
541
- if (!path) { $branch.dataset.current = ''; ddPopulate($branch, [], ''); return; }
543
+ $branch.dataset.current = '';
544
+ ddPopulate($branch, [], '');
545
+ if (!path) return;
542
546
  try {
543
547
  const res = await fetch(`/api/terminal/branches?path=${encodeURIComponent(path)}`).then(r => r.json());
548
+ if (request !== _branchRequest || activeTab()?.project !== path) return;
544
549
  $branch.dataset.current = res.current || '';
545
- const tab = activeTab();
546
- if (tab && tab.project === path) tab.branch = res.current || '';
547
- if (res.branches?.length) {
548
- const items = res.branches.map(b => ({ value: b, label: b }));
549
- ddPopulate($branch, items, res.current || '');
550
- } else {
551
- ddPopulate($branch, [], '');
552
- }
553
- } catch {}
550
+ activeTab().branch = res.current || '';
551
+ const items = (Array.isArray(res.branches) ? res.branches : []).map(b => ({ value: b, label: b }));
552
+ ddPopulate($branch, items, res.current || '');
553
+ } catch { /* keep the cleared selector */ }
554
554
  }
555
555
 
556
556
  // ═══════════════════════════════════════════
@@ -826,7 +826,7 @@ function wireEvents() {
826
826
  const result = await response.json().catch(() => ({}));
827
827
  if (!response.ok || !result.ok) throw new Error(result.error || 'Branch checkout failed');
828
828
  branchDd.dataset.current = result.branch || branch;
829
- for (const entry of _tabs) {
829
+ for (const entry of allTabs()) {
830
830
  if (entry.project === project) entry.branch = result.branch || branch;
831
831
  }
832
832
  hideComposerHints();
@@ -931,7 +931,7 @@ function wireEvents() {
931
931
 
932
932
  on('codex-panel:show', async (data) => {
933
933
  if (data?.tabId) {
934
- const idx = _tabs.findIndex((entry) => entry.id === data.tabId);
934
+ const idx = allTabs().findIndex((entry) => entry.id === data.tabId);
935
935
  if (idx >= 0) switchTab(idx);
936
936
  }
937
937
  setVisible(true);
@@ -940,7 +940,7 @@ function wireEvents() {
940
940
 
941
941
  const findPlanEditorTab = ({ source, tabId, planId, accountId, threadId } = {}) => {
942
942
  if (source !== 'codex' || !tabId || !planId || !accountId || !threadId) return null;
943
- return _tabs.find((entry) => entry.id === tabId
943
+ return allTabs().find((entry) => entry.id === tabId
944
944
  && entry.planDocument?.id === planId
945
945
  && entry.planDocument?.accountId === accountId
946
946
  && entry.planDocument?.threadId === threadId) || null;
@@ -1162,6 +1162,7 @@ export async function attachCodexAutomation(run, {
1162
1162
  tab.automationAwaits = runAwaitsAnswer(run);
1163
1163
  tab.automationOwnerId = nativeLoopWindowId;
1164
1164
  tab.threadId = threadId;
1165
+ const projectChanged = !!run.cwd && run.cwd !== tab.project;
1165
1166
  tab.project = run.cwd || tab.project;
1166
1167
  tab.automationTitle = run.title || tab.automationTitle || tab.sessionLabel || 'Automation';
1167
1168
  tab.sessionLabel = tab.automationTitle;
@@ -1208,6 +1209,7 @@ export async function attachCodexAutomation(run, {
1208
1209
  const idx = allTabs().indexOf(tab);
1209
1210
  if (idx >= 0) switchTab(idx);
1210
1211
  }
1212
+ if (projectChanged && isActiveTab(tab)) updateActiveTabView();
1211
1213
  if (!restart.active && isActiveTab(tab) && _visible) connectTab(tab);
1212
1214
  return { ok: true, tabId: tab.id };
1213
1215
  }
@@ -76,8 +76,8 @@ export function syncPlanMirrors(tab) {
76
76
  const document = planBelongsToTab(tab?.planDocument, tab) ? tab.planDocument : null;
77
77
  tab.planContent = document?.markdown || '';
78
78
  tab.editedPlanContent = document?.source === 'editor' ? document.markdown : '';
79
- tab.planApprovalPending = !!document && document.status === 'complete' && document.approvedRevision !== document.revision;
80
- tab.showPostPlanActions = tab.planApprovalPending && !tab.planTurnActive;
79
+ tab.planApprovalPending = !tab.planTurnActive && !!document && document.status === 'complete' && document.approvedRevision !== document.revision;
80
+ tab.showPostPlanActions = tab.planApprovalPending;
81
81
  return document;
82
82
  }
83
83
 
@@ -87,6 +87,7 @@ export function beginPlanTurn(tab, turnId = '') {
87
87
  tab.lastPlanTurnId = turnId;
88
88
  recordPlanTurn(tab, turnId);
89
89
  tab.planCandidate = null;
90
+ tab.planApprovalPending = false;
90
91
  tab.showPostPlanActions = false;
91
92
  // A failed revision must leave the previous reviewable document intact.
92
93
  }