synabun 2.3.1 → 2.4.1

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 (370) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +1 -1
  3. package/browser-extension/content.js +189 -0
  4. package/browser-extension/engine.js +508 -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 +250 -0
  17. package/browser-extension/popup-view.js +151 -0
  18. package/browser-extension/popup.css +166 -0
  19. package/browser-extension/popup.html +108 -0
  20. package/browser-extension/popup.js +359 -0
  21. package/browser-extension/protocol.js +232 -0
  22. package/browser-extension/service-worker.js +275 -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/lib/data-home-files.js +45 -0
  28. package/lib/data-home-migration.js +34 -58
  29. package/mcp-server/dist/http.d.ts +2 -0
  30. package/mcp-server/dist/http.d.ts.map +1 -1
  31. package/mcp-server/dist/http.js +9 -1
  32. package/mcp-server/dist/http.js.map +1 -1
  33. package/mcp-server/dist/index.d.ts +11 -0
  34. package/mcp-server/dist/index.d.ts.map +1 -1
  35. package/mcp-server/dist/index.js +38 -3
  36. package/mcp-server/dist/index.js.map +1 -1
  37. package/mcp-server/dist/services/browser-route-flow.d.ts +6 -2
  38. package/mcp-server/dist/services/browser-route-flow.d.ts.map +1 -1
  39. package/mcp-server/dist/services/browser-route-flow.js +10 -3
  40. package/mcp-server/dist/services/browser-route-flow.js.map +1 -1
  41. package/mcp-server/dist/services/codex-config-heal.d.ts.map +1 -1
  42. package/mcp-server/dist/services/codex-config-heal.js +7 -0
  43. package/mcp-server/dist/services/codex-config-heal.js.map +1 -1
  44. package/mcp-server/dist/services/neural-interface.d.ts +95 -3
  45. package/mcp-server/dist/services/neural-interface.d.ts.map +1 -1
  46. package/mcp-server/dist/services/neural-interface.js +168 -23
  47. package/mcp-server/dist/services/neural-interface.js.map +1 -1
  48. package/mcp-server/dist/services/team-context.d.ts +18 -0
  49. package/mcp-server/dist/services/team-context.d.ts.map +1 -0
  50. package/mcp-server/dist/services/team-context.js +29 -0
  51. package/mcp-server/dist/services/team-context.js.map +1 -0
  52. package/mcp-server/dist/services/tool-catalog.d.ts +5 -2
  53. package/mcp-server/dist/services/tool-catalog.d.ts.map +1 -1
  54. package/mcp-server/dist/services/tool-catalog.js +22 -6
  55. package/mcp-server/dist/services/tool-catalog.js.map +1 -1
  56. package/mcp-server/dist/services/tool-list.d.ts.map +1 -1
  57. package/mcp-server/dist/services/tool-list.js +4 -0
  58. package/mcp-server/dist/services/tool-list.js.map +1 -1
  59. package/mcp-server/dist/services/tool-runtime.d.ts +8 -1
  60. package/mcp-server/dist/services/tool-runtime.d.ts.map +1 -1
  61. package/mcp-server/dist/services/tool-runtime.js +18 -1
  62. package/mcp-server/dist/services/tool-runtime.js.map +1 -1
  63. package/mcp-server/dist/tools/agent-definition.d.ts +133 -0
  64. package/mcp-server/dist/tools/agent-definition.d.ts.map +1 -0
  65. package/mcp-server/dist/tools/agent-definition.js +483 -0
  66. package/mcp-server/dist/tools/agent-definition.js.map +1 -0
  67. package/mcp-server/dist/tools/agents.d.ts +92 -9
  68. package/mcp-server/dist/tools/agents.d.ts.map +1 -1
  69. package/mcp-server/dist/tools/agents.js +163 -20
  70. package/mcp-server/dist/tools/agents.js.map +1 -1
  71. package/mcp-server/dist/tools/browser-advanced.d.ts +8 -1
  72. package/mcp-server/dist/tools/browser-advanced.d.ts.map +1 -1
  73. package/mcp-server/dist/tools/browser-advanced.js +70 -6
  74. package/mcp-server/dist/tools/browser-advanced.js.map +1 -1
  75. package/mcp-server/dist/tools/git-tools.d.ts +4 -2
  76. package/mcp-server/dist/tools/git-tools.d.ts.map +1 -1
  77. package/mcp-server/dist/tools/git-tools.js +283 -2
  78. package/mcp-server/dist/tools/git-tools.js.map +1 -1
  79. package/mcp-server/dist/tools/morelogin.d.ts +8 -2
  80. package/mcp-server/dist/tools/morelogin.d.ts.map +1 -1
  81. package/mcp-server/dist/tools/morelogin.js +22 -5
  82. package/mcp-server/dist/tools/morelogin.js.map +1 -1
  83. package/mcp-server/dist/tools/team.d.ts +32 -0
  84. package/mcp-server/dist/tools/team.d.ts.map +1 -0
  85. package/mcp-server/dist/tools/team.js +87 -0
  86. package/mcp-server/dist/tools/team.js.map +1 -0
  87. package/mcp-server/package-lock.json +2 -2
  88. package/mcp-server/package.json +1 -1
  89. package/mcp-server/src/http.ts +9 -1
  90. package/mcp-server/src/index.ts +34 -4
  91. package/mcp-server/src/services/browser-route-flow.ts +12 -5
  92. package/mcp-server/src/services/codex-config-heal.ts +7 -0
  93. package/mcp-server/src/services/neural-interface.ts +191 -29
  94. package/mcp-server/src/services/team-context.ts +27 -0
  95. package/mcp-server/src/services/tool-catalog.ts +26 -8
  96. package/mcp-server/src/services/tool-list.ts +4 -0
  97. package/mcp-server/src/services/tool-runtime.ts +21 -2
  98. package/mcp-server/src/tools/agent-definition.ts +458 -0
  99. package/mcp-server/src/tools/agents.ts +177 -19
  100. package/mcp-server/src/tools/browser-advanced.ts +60 -6
  101. package/mcp-server/src/tools/git-tools.ts +249 -3
  102. package/mcp-server/src/tools/morelogin.ts +20 -5
  103. package/mcp-server/src/tools/team.ts +97 -0
  104. package/neural-interface/i18n/en.json +1119 -47
  105. package/neural-interface/i18n/pt-BR.json +1119 -47
  106. package/neural-interface/lib/account-usage.js +1 -1
  107. package/neural-interface/lib/agents/builtins.json +207 -0
  108. package/neural-interface/lib/agents/density.js +101 -0
  109. package/neural-interface/lib/agents/forge-host.js +223 -0
  110. package/neural-interface/lib/agents/native-export-targets.js +190 -0
  111. package/neural-interface/lib/agents/native-export.js +365 -0
  112. package/neural-interface/lib/agents/registry.js +885 -0
  113. package/neural-interface/lib/agents/resolve.js +603 -0
  114. package/neural-interface/lib/agents/schema.js +642 -0
  115. package/neural-interface/lib/agents/split.js +37 -0
  116. package/neural-interface/lib/agents-studio-api.js +591 -0
  117. package/neural-interface/lib/assistant-api.js +76 -7
  118. package/neural-interface/lib/assistant-brains/opencode.js +60 -11
  119. package/neural-interface/lib/assistant-catalog.js +2 -0
  120. package/neural-interface/lib/assistant-continuity.js +49 -0
  121. package/neural-interface/lib/assistant-dispatch.js +351 -121
  122. package/neural-interface/lib/assistant-persona.js +105 -8
  123. package/neural-interface/lib/assistant-route-gate.js +24 -9
  124. package/neural-interface/lib/assistant-router.js +432 -47
  125. package/neural-interface/lib/assistant-run-tail.js +151 -0
  126. package/neural-interface/lib/assistant-run-wait.js +183 -0
  127. package/neural-interface/lib/assistant-runtime.js +449 -94
  128. package/neural-interface/lib/assistant-task-prompt.js +11 -2
  129. package/neural-interface/lib/assistant-usage.js +3 -2
  130. package/neural-interface/lib/automation-approval.js +2 -2
  131. package/neural-interface/lib/backup-service.js +64 -105
  132. package/neural-interface/lib/browser-close-evidence.js +80 -0
  133. package/neural-interface/lib/browser-default.js +210 -0
  134. package/neural-interface/lib/browser-extension-adapter.js +264 -0
  135. package/neural-interface/lib/browser-extension-bridge.js +441 -0
  136. package/neural-interface/lib/browser-extension-folder.js +116 -0
  137. package/neural-interface/lib/browser-extension-setup.js +140 -0
  138. package/neural-interface/lib/browser-profile-choices.js +3 -3
  139. package/neural-interface/lib/browser-tool-policy.js +1 -1
  140. package/neural-interface/lib/claude-account-links.js +301 -0
  141. package/neural-interface/lib/claude-accounts.js +45 -20
  142. package/neural-interface/lib/claude-agent-bridge.js +142 -10
  143. package/neural-interface/lib/claude-model-catalog.js +6 -0
  144. package/neural-interface/lib/claude-panel-session.js +33 -0
  145. package/neural-interface/lib/codex-accounts.js +67 -24
  146. package/neural-interface/lib/coordination/README.md +384 -0
  147. package/neural-interface/lib/coordination/service.js +563 -0
  148. package/neural-interface/lib/coordination/store.js +1138 -0
  149. package/neural-interface/lib/db.js +22 -1
  150. package/neural-interface/lib/effort-levels.js +10 -1
  151. package/neural-interface/lib/memory-list-page.js +49 -0
  152. package/neural-interface/lib/memory-list-stamp.js +60 -0
  153. package/neural-interface/lib/morelogin-outside-close.js +186 -0
  154. package/neural-interface/lib/morelogin-profile-failures.js +206 -0
  155. package/neural-interface/lib/morelogin-start-cooldown.js +160 -0
  156. package/neural-interface/lib/morelogin.js +194 -8
  157. package/neural-interface/lib/native-loop-runtime.js +26 -7
  158. package/neural-interface/lib/opencode-build-preflight.js +28 -8
  159. package/neural-interface/lib/opencode-native-boundary.js +83 -13
  160. package/neural-interface/lib/opencode-serve-records.js +14 -9
  161. package/neural-interface/lib/page-session.js +1 -1
  162. package/neural-interface/lib/peer-identity.js +73 -29
  163. package/neural-interface/lib/process-identity.js +68 -7
  164. package/neural-interface/lib/request-gate.js +3 -0
  165. package/neural-interface/lib/screenshot-location.js +33 -0
  166. package/neural-interface/lib/session-cache-builder.js +41 -3
  167. package/neural-interface/lib/skills/creation.js +1 -1
  168. package/neural-interface/lib/skills/known-bridge-digests.json +40 -0
  169. package/neural-interface/lib/studio-attention.js +56 -0
  170. package/neural-interface/lib/teams/README.md +382 -0
  171. package/neural-interface/lib/teams/api.js +287 -0
  172. package/neural-interface/lib/teams/brief.js +185 -0
  173. package/neural-interface/lib/teams/claims.js +315 -0
  174. package/neural-interface/lib/teams/git.js +293 -0
  175. package/neural-interface/lib/teams/index.js +122 -0
  176. package/neural-interface/lib/teams/integration.js +580 -0
  177. package/neural-interface/lib/teams/landing.js +184 -0
  178. package/neural-interface/lib/teams/recovery.js +256 -0
  179. package/neural-interface/lib/teams/scheduler.js +1474 -0
  180. package/neural-interface/lib/teams/schema.js +559 -0
  181. package/neural-interface/lib/teams/state.js +181 -0
  182. package/neural-interface/lib/teams/test-runner.js +86 -0
  183. package/neural-interface/lib/teams/test-sandbox.js +99 -0
  184. package/neural-interface/lib/teams/worktrees.js +757 -0
  185. package/neural-interface/lib/tool-permission-choices.js +226 -0
  186. package/neural-interface/lib/whatsapp/cards.js +24 -10
  187. package/neural-interface/lib/worker-confinement.js +206 -6
  188. package/neural-interface/package-lock.json +2 -2
  189. package/neural-interface/package.json +1 -1
  190. package/neural-interface/public/extension-setup.html +107 -0
  191. package/neural-interface/public/index.html +103 -12
  192. package/neural-interface/public/offline.html +4 -3
  193. package/neural-interface/public/shared/agent-runtime-options.js +3 -1
  194. package/neural-interface/public/shared/agents/studio/ax-agent-view.js +614 -0
  195. package/neural-interface/public/shared/agents/studio/ax-api.js +198 -0
  196. package/neural-interface/public/shared/agents/studio/ax-create-view.js +221 -0
  197. package/neural-interface/public/shared/agents/studio/ax-diff.js +143 -0
  198. package/neural-interface/public/shared/agents/studio/ax-editor-view.js +392 -0
  199. package/neural-interface/public/shared/agents/studio/ax-export-view.js +94 -0
  200. package/neural-interface/public/shared/agents/studio/ax-form.js +191 -0
  201. package/neural-interface/public/shared/agents/studio/ax-icons.js +87 -0
  202. package/neural-interface/public/shared/agents/studio/ax-library-view.js +158 -0
  203. package/neural-interface/public/shared/agents/studio/ax-library.js +162 -0
  204. package/neural-interface/public/shared/agents/studio/ax-main.js +712 -0
  205. package/neural-interface/public/shared/agents/studio/ax-native-export.js +35 -0
  206. package/neural-interface/public/shared/agents/studio/ax-options.js +198 -0
  207. package/neural-interface/public/shared/agents/studio/ax-review-view.js +175 -0
  208. package/neural-interface/public/shared/agents/studio/ax-revisions-view.js +189 -0
  209. package/neural-interface/public/shared/agents/studio/ax-runs-view.js +202 -0
  210. package/neural-interface/public/shared/agents/studio/ax-runs.js +82 -0
  211. package/neural-interface/public/shared/agents/studio/ax-teams-view.js +256 -0
  212. package/neural-interface/public/shared/agents/studio/ax-teams.js +200 -0
  213. package/neural-interface/public/shared/agents/studio/ax-templates.js +50 -0
  214. package/neural-interface/public/shared/agents/studio/ax-ui.js +194 -0
  215. package/neural-interface/public/shared/agents/studio/ax-views.js +170 -0
  216. package/neural-interface/public/shared/agy/agy-panel.js +142 -28
  217. package/neural-interface/public/shared/agy/agy-styles.js +25 -5
  218. package/neural-interface/public/shared/api.js +2 -1
  219. package/neural-interface/public/shared/assistant/asst-account-menu.js +13 -13
  220. package/neural-interface/public/shared/assistant/asst-ask-styles.js +2 -3
  221. package/neural-interface/public/shared/assistant/asst-brain-picker.js +91 -9
  222. package/neural-interface/public/shared/assistant/asst-control.js +3 -0
  223. package/neural-interface/public/shared/assistant/asst-interaction-hold.js +99 -0
  224. package/neural-interface/public/shared/assistant/asst-limit-dismissals.js +111 -0
  225. package/neural-interface/public/shared/assistant/asst-limit-dock.js +37 -3
  226. package/neural-interface/public/shared/assistant/asst-limit-wait.js +30 -7
  227. package/neural-interface/public/shared/assistant/asst-panel.js +177 -30
  228. package/neural-interface/public/shared/assistant/asst-rack-styles.js +15 -8
  229. package/neural-interface/public/shared/assistant/asst-render.js +37 -6
  230. package/neural-interface/public/shared/assistant/asst-route.js +80 -12
  231. package/neural-interface/public/shared/assistant/asst-routes-editor.js +148 -70
  232. package/neural-interface/public/shared/assistant/asst-roving.js +17 -1
  233. package/neural-interface/public/shared/assistant/asst-scene-styles.js +7 -2
  234. package/neural-interface/public/shared/assistant/asst-scenes.js +12 -1
  235. package/neural-interface/public/shared/assistant/asst-sidepanel.js +12 -2
  236. package/neural-interface/public/shared/assistant/asst-state.js +66 -1
  237. package/neural-interface/public/shared/assistant/asst-styles.js +98 -44
  238. package/neural-interface/public/shared/assistant/route-identity.js +16 -0
  239. package/neural-interface/public/shared/cc-dropdown.js +21 -15
  240. package/neural-interface/public/shared/cdx/cdx-output.js +10 -0
  241. package/neural-interface/public/shared/cdx/cdx-panel.js +18 -16
  242. package/neural-interface/public/shared/cdx/cdx-plan.js +3 -2
  243. package/neural-interface/public/shared/cdx/cdx-render.js +122 -45
  244. package/neural-interface/public/shared/cdx/cdx-requests.js +4 -4
  245. package/neural-interface/public/shared/cdx/cdx-styles.js +8 -36
  246. package/neural-interface/public/shared/cdx/cdx-tabs.js +110 -42
  247. package/neural-interface/public/shared/claude-panel-lazy.js +12 -0
  248. package/neural-interface/public/shared/code-copy.js +120 -0
  249. package/neural-interface/public/shared/constants.js +7 -0
  250. package/neural-interface/public/shared/context-menu-model.js +1 -0
  251. package/neural-interface/public/shared/cp/cp-markdown.js +7 -2
  252. package/neural-interface/public/shared/cp/cp-session-model.js +86 -5
  253. package/neural-interface/public/shared/cp/cp-session-settings.js +58 -30
  254. package/neural-interface/public/shared/cp/cp-styles.js +9 -0
  255. package/neural-interface/public/shared/dom-change-flag.js +66 -0
  256. package/neural-interface/public/shared/dom-morph.js +124 -0
  257. package/neural-interface/public/shared/extension-setup/es-page.css +134 -0
  258. package/neural-interface/public/shared/extension-setup/es-page.js +120 -0
  259. package/neural-interface/public/shared/extension-setup/es-view.js +100 -0
  260. package/neural-interface/public/shared/html-shell.js +34 -4
  261. package/neural-interface/public/shared/i18n.js +14 -1
  262. package/neural-interface/public/shared/idle-queue.js +78 -0
  263. package/neural-interface/public/shared/iface-config.js +227 -0
  264. package/neural-interface/public/shared/lazy-module.js +108 -0
  265. package/neural-interface/public/shared/memory-list.js +117 -0
  266. package/neural-interface/public/shared/morelogin-profile-choices.js +1 -1
  267. package/neural-interface/public/shared/morelogin-profile-field.js +3 -3
  268. package/neural-interface/public/shared/mtc/mtc-panel.js +3 -1
  269. package/neural-interface/public/shared/mtc/mtc-styles.js +4 -1
  270. package/neural-interface/public/shared/ocp-v2/ocp-v2-manager.js +35 -15
  271. package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +77 -23
  272. package/neural-interface/public/shared/ocp-v2/ocp-v2-projectbar.js +3 -6
  273. package/neural-interface/public/shared/ocp-v2/ocp-v2-render.js +24 -21
  274. package/neural-interface/public/shared/ocp-v2/ocp-v2-send-logic.js +16 -5
  275. package/neural-interface/public/shared/ocp-v2/ocp-v2-sessions-logic.js +16 -2
  276. package/neural-interface/public/shared/ocp-v2/ocp-v2-styles.js +27 -43
  277. package/neural-interface/public/shared/ocp-v2/ocp-v2-ws.js +73 -9
  278. package/neural-interface/public/shared/owner-authority-view.js +4 -10
  279. package/neural-interface/public/shared/page-session.js +1 -1
  280. package/neural-interface/public/shared/schedules-view.js +2 -2
  281. package/neural-interface/public/shared/session-project-items.js +11 -0
  282. package/neural-interface/public/shared/settings/settings-ai-browser.js +119 -0
  283. package/neural-interface/public/shared/settings/settings-browser-extension.js +446 -0
  284. package/neural-interface/public/shared/settings/settings-ia.js +4 -2
  285. package/neural-interface/public/shared/settings/settings-morelogin-cooldown.js +63 -0
  286. package/neural-interface/public/shared/settings/settings-tool-permissions.js +70 -0
  287. package/neural-interface/public/shared/sidepanel-lazy.js +40 -0
  288. package/neural-interface/public/shared/sidepanel-session-status.js +8 -14
  289. package/neural-interface/public/shared/sidepanel-shown.js +73 -0
  290. package/neural-interface/public/shared/start-bridge.js +2 -2
  291. package/neural-interface/public/shared/storage.js +6 -1
  292. package/neural-interface/public/shared/studio-attention.js +83 -0
  293. package/neural-interface/public/shared/styles.css +694 -50
  294. package/neural-interface/public/shared/term-browser-tabs.js +34 -0
  295. package/neural-interface/public/shared/transcript-rows.js +334 -0
  296. package/neural-interface/public/shared/tray-auto-close.js +106 -0
  297. package/neural-interface/public/shared/ui-agents.js +97 -0
  298. package/neural-interface/public/shared/ui-antigravity-panel.js +16 -14
  299. package/neural-interface/public/shared/ui-automation-studio.js +3 -3
  300. package/neural-interface/public/shared/ui-claude-panel.js +162 -95
  301. package/neural-interface/public/shared/ui-code-copy.js +256 -0
  302. package/neural-interface/public/shared/ui-codex-panel.js +14 -10
  303. package/neural-interface/public/shared/ui-context-menu.js +1 -1
  304. package/neural-interface/public/shared/ui-file-explorer.js +2 -3
  305. package/neural-interface/public/shared/ui-games.js +1 -1
  306. package/neural-interface/public/shared/ui-loading.js +83 -19
  307. package/neural-interface/public/shared/ui-maritaca-panel.js +12 -11
  308. package/neural-interface/public/shared/ui-menubar.js +23 -0
  309. package/neural-interface/public/shared/ui-native-loop-router.js +50 -21
  310. package/neural-interface/public/shared/ui-navbar.js +15 -9
  311. package/neural-interface/public/shared/ui-opencode-panel-v2.js +13 -11
  312. package/neural-interface/public/shared/ui-owner-authority.js +48 -25
  313. package/neural-interface/public/shared/ui-schedules-studio.js +3 -3
  314. package/neural-interface/public/shared/ui-scroll-follow.js +39 -0
  315. package/neural-interface/public/shared/ui-sessions.js +3 -3
  316. package/neural-interface/public/shared/ui-settings-entry.js +55 -0
  317. package/neural-interface/public/shared/ui-settings.js +363 -400
  318. package/neural-interface/public/shared/ui-sidepanel-layout.js +44 -25
  319. package/neural-interface/public/shared/ui-sidepanel-session-entry.js +22 -9
  320. package/neural-interface/public/shared/ui-sidepanel-sessions.js +10 -2
  321. package/neural-interface/public/shared/ui-sidepanel-tray.js +36 -41
  322. package/neural-interface/public/shared/ui-sidepanel-windows.js +14 -1
  323. package/neural-interface/public/shared/ui-styleguide.js +10 -2
  324. package/neural-interface/public/shared/ui-sync.js +6 -0
  325. package/neural-interface/public/shared/ui-terminal.js +13 -9
  326. package/neural-interface/public/shared/ui-tooltip.js +28 -7
  327. package/neural-interface/public/shared/ui-topright-overflow.js +26 -4
  328. package/neural-interface/public/shared/ui-tray-columns.js +375 -0
  329. package/neural-interface/public/shared/ui-whiteboard.js +51 -6
  330. package/neural-interface/public/shared/ui-worker-end.js +28 -1
  331. package/neural-interface/public/shared/ui-workspaces.js +13 -0
  332. package/neural-interface/public/shared/window-keys.js +71 -0
  333. package/neural-interface/public/sw.js +4 -3
  334. package/neural-interface/public/variant/2d/main.js +2 -0
  335. package/neural-interface/public/variant/3d/app.js +620 -0
  336. package/neural-interface/public/variant/3d/boot-reveal.js +47 -0
  337. package/neural-interface/public/variant/3d/main.js +30 -544
  338. package/neural-interface/public/variant/3d/map-controls.js +4 -2
  339. package/neural-interface/public/vendor/fonts/fonts.css +508 -0
  340. package/neural-interface/public/vendor/fonts/inter-OFL.txt +93 -0
  341. package/neural-interface/public/vendor/fonts/inter-cyrillic-ext.woff2 +0 -0
  342. package/neural-interface/public/vendor/fonts/inter-cyrillic.woff2 +0 -0
  343. package/neural-interface/public/vendor/fonts/inter-greek-ext.woff2 +0 -0
  344. package/neural-interface/public/vendor/fonts/inter-greek.woff2 +0 -0
  345. package/neural-interface/public/vendor/fonts/inter-latin-ext.woff2 +0 -0
  346. package/neural-interface/public/vendor/fonts/inter-latin.woff2 +0 -0
  347. package/neural-interface/public/vendor/fonts/inter-vietnamese.woff2 +0 -0
  348. package/neural-interface/public/vendor/fonts/jetbrains-mono-OFL.txt +93 -0
  349. package/neural-interface/public/vendor/fonts/jetbrains-mono-cyrillic-ext.woff2 +0 -0
  350. package/neural-interface/public/vendor/fonts/jetbrains-mono-cyrillic.woff2 +0 -0
  351. package/neural-interface/public/vendor/fonts/jetbrains-mono-greek.woff2 +0 -0
  352. package/neural-interface/public/vendor/fonts/jetbrains-mono-latin-ext.woff2 +0 -0
  353. package/neural-interface/public/vendor/fonts/jetbrains-mono-latin.woff2 +0 -0
  354. package/neural-interface/public/vendor/fonts/jetbrains-mono-vietnamese.woff2 +0 -0
  355. package/neural-interface/public/vendor/fonts/manifest.json +142 -0
  356. package/neural-interface/public/vendor/fonts/space-grotesk-OFL.txt +93 -0
  357. package/neural-interface/public/vendor/fonts/space-grotesk-latin-ext.woff2 +0 -0
  358. package/neural-interface/public/vendor/fonts/space-grotesk-latin.woff2 +0 -0
  359. package/neural-interface/public/vendor/fonts/space-grotesk-vietnamese.woff2 +0 -0
  360. package/neural-interface/scripts/boot-graph.mjs +270 -0
  361. package/neural-interface/scripts/vendor-fonts.mjs +124 -0
  362. package/neural-interface/server.js +1083 -164
  363. package/npm-shrinkwrap.json +2 -2
  364. package/package.json +4 -1
  365. package/skills/agent-forge/SKILL.md +182 -0
  366. package/skills/agent-forge/evals/evals.json +56 -0
  367. package/skills/agent-forge/references/definition-fields.md +61 -0
  368. package/skills/agent-forge/references/examples.md +105 -0
  369. package/skills/agent-forge/references/instructions.md +51 -0
  370. package/skills/agent-forge/references/review-and-export.md +84 -0
@@ -1,3 +1,4 @@
1
+ import { sessionProjectItems } from '../session-project-items.js';
1
2
  import { t } from '../i18n.js';
2
3
  import { migrateStoredTools } from '../tool-list-storage.js';
3
4
  import { wireDropdowns, closeDropdowns, setDropdownDisabled, dropdownOf } from '../cc-dropdown.js';
@@ -307,12 +308,8 @@ function wireProjectDd() {
307
308
  }
308
309
 
309
310
  function paintProjectMenu() {
310
- const projects = _ctx.getProjects?.() || [];
311
- const items = projects.map((p) => {
312
- const path = (p && (p.path || p)) || '';
313
- const label = typeof path === 'string' ? path.split('/').filter(Boolean).pop() : '';
314
- return { value: String(path), label: label || String(path), title: String(path) };
315
- }).filter((it) => it.value);
311
+ const items = sessionProjectItems(_ctx.getProjects?.() || [], getState().cwd || '')
312
+ .map(item => ({ ...item, title: item.value }));
316
313
 
317
314
  ddPopulate(_projectDd, items, getState().cwd || '', (value) => {
318
315
  _ctx.setActiveProject?.(value);
@@ -23,7 +23,9 @@ import { TOOL_ICONS } from './ocp-v2-icons.js';
23
23
  import { renderToolCard } from './ocp-v2-tools.js';
24
24
  import { messageMetaText } from './ocp-v2-tools-logic.js';
25
25
  import { createStickyScrollController } from '../ui-scroll-follow.js';
26
+ import { watchTranscriptRows } from '../transcript-rows.js';
26
27
  import { sanitizeHtmlString } from '../assistant/asst-sanitize.js';
28
+ import { withCodeCopyButtons } from '../code-copy.js';
27
29
  import { openProviderSettings } from './ocp-v2-settings-link.js';
28
30
  import {
29
31
  visibleParts, partSignature, messageErrorView, retryBannerView, retryPartText,
@@ -82,6 +84,10 @@ export function mountRenderer(containerEl, store = getDefaultStore(), opts = {})
82
84
  let _container = containerEl;
83
85
  let _renderScheduled = false;
84
86
  const scrollController = createStickyScrollController(_container);
87
+ // Rows far from the screen are skipped by the engine, at their exact size (transcript-rows.js). The rows
88
+ // are the keyed children _reconcile keeps; the declarations are inline, so a kept row keeps them and a
89
+ // rebuilt one starts plain.
90
+ const rowWatcher = watchTranscriptRows(_container);
85
91
 
86
92
  const doRender = () => {
87
93
  render(_container, store, opts);
@@ -108,6 +114,7 @@ export function mountRenderer(containerEl, store = getDefaultStore(), opts = {})
108
114
  unmount: () => {
109
115
  try { unsubscribe(); } catch {}
110
116
  scrollController?.destroy();
117
+ rowWatcher.disconnect();
111
118
  _activeRenderers.delete(instance);
112
119
  _container = null;
113
120
  },
@@ -124,7 +131,18 @@ export function unmountRenderer() {
124
131
  for (const r of _activeRenderers) { try { r.unmount(); } catch {} }
125
132
  }
126
133
 
127
- const _partSig = partSignature;
134
+ // A part's signature, kept per part object. The store never changes a part in place (an update or a streamed
135
+ // chunk puts a new object in its place: ocp-v2-state.js upsertPart / appendPartDelta), so one object has one
136
+ // signature. A render pass signs every part of the transcript, and a tool part's signature serialises its
137
+ // input, output and metadata to measure them: without this, every frame of a stream did that again for every
138
+ // tool call the session ever made.
139
+ const _partSigs = new WeakMap();
140
+ function _partSig(part) {
141
+ if (!part || typeof part !== 'object') return partSignature(part);
142
+ let sig = _partSigs.get(part);
143
+ if (sig === undefined) { sig = partSignature(part); _partSigs.set(part, sig); }
144
+ return sig;
145
+ }
128
146
 
129
147
  function _msgSig(msg) {
130
148
  let sig = `m:${msg.role || 'assistant'}`;
@@ -647,28 +665,11 @@ function renderPart(part, store) {
647
665
  function renderTextPart(part) {
648
666
  const el = document.createElement('div');
649
667
  el.className = 'ocpv2-part ocpv2-part-text';
668
+ // Every fenced block carries the shared Copy button: renderMarkdown writes it in (../code-copy.js).
650
669
  el.innerHTML = renderMarkdown(part.text || '');
651
- decorateCodeBlocks(el);
652
670
  return el;
653
671
  }
654
672
 
655
- // A Copy button on every fenced block.
656
- function decorateCodeBlocks(root) {
657
- for (const pre of root.querySelectorAll('pre')) {
658
- const btn = document.createElement('button');
659
- btn.type = 'button';
660
- btn.className = 'ocpv2-code-copy';
661
- btn.textContent = 'Copy';
662
- btn.addEventListener('click', (event) => {
663
- event.stopPropagation();
664
- const code = pre.querySelector('code');
665
- copyText((code || pre).textContent || '', btn).catch(() => {});
666
- });
667
- pre.classList.add('ocpv2-code-block');
668
- pre.appendChild(btn);
669
- }
670
- }
671
-
672
673
  function renderReasoningPart(part) {
673
674
  const streaming = !part?.time?.end;
674
675
  // While streaming → single thin row with an animated "Thinking…" label
@@ -1777,13 +1778,15 @@ function renderMarkdown(src) {
1777
1778
  } else {
1778
1779
  html = escapeHtml(text).replace(/\n/g, '<br>');
1779
1780
  }
1781
+ // Every code block gets the shared Copy button, written in after the sanitiser (../code-copy.js).
1782
+ const shown = withCodeCopyButtons(html);
1780
1783
  if (_markdownCache.size >= _markdownCacheLimit) {
1781
1784
  // Evict oldest insertion (Map preserves insertion order)
1782
1785
  const firstKey = _markdownCache.keys().next().value;
1783
1786
  if (firstKey !== undefined) _markdownCache.delete(firstKey);
1784
1787
  }
1785
- _markdownCache.set(text, html);
1786
- return html;
1788
+ _markdownCache.set(text, shown);
1789
+ return shown;
1787
1790
  }
1788
1791
 
1789
1792
  function escapeHtml(s) {
@@ -196,8 +196,8 @@ function applyAskEvent(open, eventType, ev) {
196
196
  return known?.owner !== owner;
197
197
  }
198
198
  if (ANSWERED.has(eventType)) return open.delete(askIdOf(ev));
199
- if (eventType === 'session.idle' || eventType === 'session.error') {
200
- const sid = String(ev?.sessionID || ev?.sessionId || '');
199
+ if (eventType === 'session.idle' || eventType === 'session.error' || eventType === 'session.deleted') {
200
+ const sid = String(ev?.sessionID || ev?.sessionId || ev?.info?.id || '');
201
201
  let gone = false;
202
202
  for (const [id, entry] of open) if (entry.owner === sid) { open.delete(id); gone = true; }
203
203
  return gone;
@@ -249,6 +249,15 @@ export function createAskTracker({ parentOf = new Map(), attempts = ASK_READ_ATT
249
249
  }
250
250
  };
251
251
  const under = (owner, root) => owner === root || knownDescendant(owner, root, parentOf);
252
+ const openAsksOf = (sid) => {
253
+ const requests = [];
254
+ if (sid) for (const [id, ask] of open) if (under(ask.owner, sid)) requests.push({ id, ...ask });
255
+ return requests;
256
+ };
257
+ const hasOpenAsks = (sid) => {
258
+ if (sid) for (const { owner } of open.values()) if (under(owner, sid)) return true;
259
+ return false;
260
+ };
252
261
  const expect = (sessionId, kinds) => {
253
262
  let set = pending.get(sessionId);
254
263
  if (!set) pending.set(sessionId, (set = new Set()));
@@ -274,15 +283,17 @@ export function createAskTracker({ parentOf = new Map(), attempts = ASK_READ_ATT
274
283
  return {
275
284
  note(eventType, ev) {
276
285
  replay?.push([eventType, ev]);
277
- if (applyAskEvent(open, eventType, ev) && !held) changed();
286
+ if (applyAskEvent(open, eventType, ev)) changed();
278
287
  },
288
+ // Pills need a concrete request. A reconnect can pause a turn clock while lists are still out.
289
+ hasOpenAsks,
290
+ openAsksOf,
279
291
  waits(sessionId) {
280
292
  const sid = String(sessionId || '');
281
293
  if (!sid) return false;
282
294
  if (held) return true;
283
295
  for (const [root, kinds] of pending) if (kinds.size && under(sid, root)) return true;
284
- for (const { owner } of open.values()) if (owner === sid || knownDescendant(owner, sid, parentOf)) return true;
285
- return false;
296
+ return hasOpenAsks(sid);
286
297
  },
287
298
  hold() {
288
299
  generation += 1;
@@ -254,19 +254,33 @@ export function automationTurnPhase(run) {
254
254
 
255
255
  /**
256
256
  * A tab's tray pill: 'waiting' while its session waits on the user, 'working'
257
- * while a turn of it runs, else 'idle'. A live automation run's own phase
257
+ * while a turn of it runs, else 'idle'. Pending asks take priority over turn state.
258
+ * A live automation run's own phase
258
259
  * (`automation`, automationTurnPhase) decides: an idle warm worker rests,
259
260
  * whatever its run (and the store of the session on screen, which follows the
260
261
  * run) says; nobody else can start a turn in it meanwhile (canSend). Otherwise
261
262
  * the session on screen reads its store (`running`) and another tab what
262
263
  * OpenCode said of it (`busy`).
263
264
  */
264
- export function tabPillState({ sessionId, activeSessionId, running = false, busy = false, automation = null } = {}) {
265
+ export function tabPillState({
266
+ sessionId, activeSessionId, running = false, busy = false, automation = null,
267
+ pendingPermissions = [], pendingQuestions = [], familyWaiting = false,
268
+ } = {}) {
269
+ if (pendingPermissions.length || pendingQuestions.length || familyWaiting) return 'waiting';
265
270
  if (automation === 'working' || automation === 'waiting' || automation === 'idle') return automation;
266
271
  const turn = sessionId && sessionId === activeSessionId ? !!running : !!busy;
267
272
  return turn ? 'working' : 'idle';
268
273
  }
269
274
 
275
+ /** OpenCode stored bare session IDs before tab records included attention state. */
276
+ export function readSavedTabs(value) {
277
+ if (!Array.isArray(value)) return [];
278
+ return value
279
+ .map((row) => typeof row === 'string' ? { sessionId: row } : row)
280
+ .filter((row) => typeof row?.sessionId === 'string' && row.sessionId)
281
+ .map((row) => ({ ...row, needsYou: row.needsYou === true }));
282
+ }
283
+
270
284
  // ── Renames that are waiting for their answer ───────────────────────────────
271
285
 
272
286
  /**
@@ -5,6 +5,8 @@
5
5
  // so the renderer doesn't change.
6
6
  // ─────────────────────────────────────────────────────────────────────────────
7
7
 
8
+ import { installCodeCopy } from '../ui-code-copy.js';
9
+
8
10
  const STYLE_ID = 'ocp-v2-styles';
9
11
 
10
12
  const CSS = `
@@ -45,10 +47,6 @@ const CSS = `
45
47
  opacity: 1;
46
48
  overflow: visible;
47
49
  }
48
- /* Windows: the shell is 92% opaque, so the blur behind it barely shows, yet Chromium recomputes it on every
49
- repaint inside the panel (a transcript rendering, a stream). There it goes; the colour stays. */
50
- html.platform-win32 .ocpv2-panel,
51
- html.desktop-titlebar--win32 .ocpv2-panel { backdrop-filter: none; -webkit-backdrop-filter: none; }
52
50
  /* Keep footer menus above focused floating terminal windows. */
53
51
  .ocpv2-panel:has(.ocpv2-dropdown.open) {
54
52
  z-index: 99999;
@@ -469,18 +467,8 @@ html.desktop-titlebar--win32 .ocpv2-panel { backdrop-filter: none; -webkit-backd
469
467
  rgba(232,224,220,0.0) 100%
470
468
  );
471
469
  }
472
- html.platform-win32 .ocpv2-session-pill.ocpv2-pill-running,
473
- html.desktop-titlebar--win32 .ocpv2-session-pill.ocpv2-pill-running {
474
- border-color: rgba(232, 224, 220, 0.38);
475
- }
476
- html.platform-win32 .ocpv2-session-pill.ocpv2-pill-running:hover,
477
- html.desktop-titlebar--win32 .ocpv2-session-pill.ocpv2-pill-running:hover {
478
- border-color: rgba(232, 224, 220, 0.58);
479
- }
480
- html.platform-win32 .ocpv2-session-pill.ocpv2-pill-running .ocpv2-pill-ring,
481
- html.desktop-titlebar--win32 .ocpv2-session-pill.ocpv2-pill-running .ocpv2-pill-ring {
482
- display: none;
483
- }
470
+ /* The ring turns on Windows as everywhere (it was a still border there until 2026-11-15): the turn is the
471
+ compositor's, nothing is restyled or repainted per frame (tests/windows-visuals.test.mjs). */
484
472
  body.ui-interacting .ocpv2-pill-ring > i { animation-play-state: paused; }
485
473
  .ocpv2-session-pill.ocpv2-pill-running .term-minimized-pill-label::before {
486
474
  content: '';
@@ -2073,7 +2061,7 @@ body.ui-interacting .ocpv2-spin-ring > i { animation-play-state: paused !importa
2073
2061
  .ocpv2-image-chip img {
2074
2062
  width: 100%;
2075
2063
  height: 100%;
2076
- object-fit: cover;
2064
+ object-fit: contain;
2077
2065
  display: block;
2078
2066
  }
2079
2067
  .ocpv2-image-chip-remove {
@@ -2104,7 +2092,8 @@ body.ui-interacting .ocpv2-spin-ring > i { animation-play-state: paused !importa
2104
2092
  }
2105
2093
  .ocpv2-part-image-wrap img,
2106
2094
  img.ocpv2-part-image {
2107
- max-width: 240px;
2095
+ box-sizing: border-box;
2096
+ max-width: min(240px, 100%);
2108
2097
  max-height: 200px;
2109
2098
  width: auto;
2110
2099
  height: auto;
@@ -2116,7 +2105,7 @@ img.ocpv2-part-image {
2116
2105
  }
2117
2106
  .ocpv2-msg-user .ocpv2-part-image-wrap { margin-top: 6px; }
2118
2107
  .ocpv2-msg-user img.ocpv2-part-image {
2119
- max-width: 240px;
2108
+ max-width: min(240px, 100%);
2120
2109
  max-height: 200px;
2121
2110
  }
2122
2111
 
@@ -2127,6 +2116,7 @@ img.ocpv2-part-image {
2127
2116
  }
2128
2117
  img.ocpv2-tool-screenshot {
2129
2118
  display: block;
2119
+ box-sizing: border-box;
2130
2120
  max-width: 100%;
2131
2121
  max-height: 320px;
2132
2122
  width: auto;
@@ -2906,6 +2896,11 @@ const CHILD_CSS = `
2906
2896
  display: flex;
2907
2897
  flex-direction: column;
2908
2898
  align-items: flex-end;
2899
+ align-self: start;
2900
+ justify-self: stretch;
2901
+ box-sizing: border-box;
2902
+ min-width: 0;
2903
+ max-width: 100%;
2909
2904
  gap: 4px;
2910
2905
  max-height: min(310px, 45vh);
2911
2906
  overflow-y: auto;
@@ -2919,12 +2914,18 @@ const CHILD_CSS = `
2919
2914
  margin-top: -5px;
2920
2915
  padding-top: 0;
2921
2916
  }
2922
- .ocpv2-subagent-pills > .term-minimized-pill { flex-shrink: 0; }
2917
+ .ocpv2-subagent-pills > .term-minimized-pill {
2918
+ flex-shrink: 0;
2919
+ box-sizing: border-box;
2920
+ min-width: 0;
2921
+ max-width: calc(100% - var(--ocpv2-child-inset, 0px));
2922
+ margin-right: var(--ocpv2-child-inset, 0px);
2923
+ }
2923
2924
  .ocpv2-subagent-pills .ocpv2-session-pill-child:hover { transform: none; }
2924
2925
  /* A sub-agent of a sub-agent sits a step in from the edge. */
2925
- .ocpv2-session-pill-child[data-depth="1"] { margin-right: 10px; }
2926
- .ocpv2-session-pill-child[data-depth="2"] { margin-right: 20px; }
2927
- .ocpv2-session-pill-child[data-depth="3"] { margin-right: 30px; }
2926
+ .ocpv2-session-pill-child[data-depth="1"] { --ocpv2-child-inset: 10px; }
2927
+ .ocpv2-session-pill-child[data-depth="2"] { --ocpv2-child-inset: 20px; }
2928
+ .ocpv2-session-pill-child[data-depth="3"] { --ocpv2-child-inset: 30px; }
2928
2929
  /* How many there are and how many need attention: shown once the group scrolls. */
2929
2930
  .ocpv2-subagent-summary {
2930
2931
  position: sticky;
@@ -3223,26 +3224,7 @@ const PARITY_CSS = `
3223
3224
  .ocpv2-msg-action:disabled { opacity: 0.4; cursor: default; }
3224
3225
  .ocpv2-msg-action[data-action="delete"]:hover:not(:disabled) { color: rgba(255,166,166,0.92); }
3225
3226
 
3226
- /* ── Copy button on code blocks ───────────────────────────────────────── */
3227
- .ocpv2-code-block { position: relative; }
3228
- .ocpv2-code-copy {
3229
- position: absolute;
3230
- top: 4px;
3231
- right: 4px;
3232
- background: rgba(22, 22, 26, 0.95);
3233
- border: 1px solid rgba(255,255,255,0.08);
3234
- color: rgba(255,255,255,0.55);
3235
- border-radius: 6px;
3236
- padding: 1px 6px;
3237
- font-family: 'JetBrains Mono', ui-monospace, monospace;
3238
- font-size: 9px;
3239
- cursor: pointer;
3240
- opacity: 0;
3241
- transition: opacity 0.15s, color 0.15s;
3242
- }
3243
- .ocpv2-code-block:hover .ocpv2-code-copy,
3244
- .ocpv2-code-copy:focus { opacity: 1; }
3245
- .ocpv2-code-copy:hover { color: rgba(255,255,255,0.9); }
3227
+ /* A code block's Copy button is the shared one (../code-copy.js, ../ui-code-copy.js), styled there. */
3246
3228
 
3247
3229
  /* ── Reverted (undone) banner: the retry banner in neutral tones ──────── */
3248
3230
  .ocpv2-revert-banner {
@@ -3778,6 +3760,8 @@ const PARITY_CSS = `
3778
3760
  `;
3779
3761
 
3780
3762
  export function injectStyles() {
3763
+ // The Copy button of every code block: its stylesheet and its one click listener, in this document.
3764
+ installCodeCopy(document);
3781
3765
  const full = CSS + '\n' + PARITY_CSS + '\n' + CHILD_CSS;
3782
3766
  const existing = document.getElementById(STYLE_ID);
3783
3767
  if (existing) {
@@ -13,8 +13,8 @@ import { getDefaultStore } from './ocp-v2-state.js';
13
13
  import { notify as uiNotify, NOTIF_TYPE } from '../ui-notifications.js';
14
14
  import { nativeLoopWindowId } from '../ui-native-window-id.js';
15
15
  import { registerAutomationSession, automationRunAnswersAsks } from './ocp-v2-automation-ownership.js';
16
- import { applyEvent, resolveEventTargets, askNotifies } from './ocp-v2-events.js';
17
- import { createCapabilities, gatedRequest } from './ocp-v2-caps.js';
16
+ import { applyEvent, resolveEventTargets, askNotifies, eventSessionId, permissionRequestId } from './ocp-v2-events.js';
17
+ import { createCapabilities, gatedRequest, replyFailed } from './ocp-v2-caps.js';
18
18
  import { shouldAutoAccept, autoAcceptRequest, autoAcceptInherited } from './ocp-v2-approvals.js';
19
19
  import { verifyDescendant, descendantState, knownDescendant, createReconnectNotifier, requestOwner } from './ocp-v2-rehydrate.js';
20
20
  import { createAskTracker, createTurnClock, readOpenAsks, unreadAsksNotice, TURN_LIMIT_MS } from './ocp-v2-send-logic.js';
@@ -246,6 +246,10 @@ function handleMessage(msg) {
246
246
  }
247
247
 
248
248
  function handleEvent(eventType, ev) {
249
+ if (eventType === 'session.idle' || eventType === 'session.error' || eventType === 'session.deleted') {
250
+ const sessionId = eventSessionId(ev);
251
+ if (sessionId) clearStoredAsks((owner) => owner === sessionId);
252
+ }
249
253
  // session.created → broadcast to manager listeners (child-panel spawning).
250
254
  // Don't dispatch as a state mutation — the spawned panel's own subscribeSession
251
255
  // call will catch its own subsequent message events.
@@ -285,9 +289,28 @@ const _parentOf = new Map();
285
289
  const _asks = createAskTracker({ parentOf: _parentOf });
286
290
  /** True while `sessionId`, or a sub-agent below it, waits on a permission or a question. */
287
291
  export const sessionWaitsOnUser = (sessionId) => _asks.waits(sessionId);
292
+ export const sessionHasOpenAsks = (sessionId) => _asks.hasOpenAsks(sessionId);
288
293
  /** `listener()` whenever what waits on the user may have changed; returns an unsubscribe. */
289
294
  export const onAsksChanged = (listener) => _asks.subscribe(listener);
290
295
 
296
+ function storedAsks(belongsTo) {
297
+ const asks = [];
298
+ for (const store of _allStores) {
299
+ const state = store.getState();
300
+ for (const req of state.pendingPermissions || []) {
301
+ if (belongsTo(requestOwner(req) || state.sessionId)) asks.push([store, 'removePendingPermission', permissionRequestId(req)]);
302
+ }
303
+ for (const req of state.pendingQuestions || []) {
304
+ if (belongsTo(requestOwner(req) || state.sessionId)) asks.push([store, 'removePendingQuestion', req.id]);
305
+ }
306
+ }
307
+ return asks;
308
+ }
309
+
310
+ function clearStoredAsks(belongsTo) {
311
+ for (const [store, remove, id] of storedAsks(belongsTo)) store[remove](id);
312
+ }
313
+
291
314
  function rememberParent(ev) {
292
315
  const info = ev?.info || ev?.session || ev || {};
293
316
  const childId = info.id || ev?.sessionID || ev?.sessionId;
@@ -382,6 +405,7 @@ function underSession(sessionId, isAncestor) {
382
405
 
383
406
  // The sessions whose lists were read (or are out) since the socket opened.
384
407
  const _asksRead = new Set();
408
+ let _askTabs = new Map(); // session ID → cwd, including tabs with no bound panel
385
409
  // Bound sessions waiting for the socket to say what it serves before their lists are read.
386
410
  const _asksUnread = new Set();
387
411
  let _asksReady = false;
@@ -389,9 +413,20 @@ let _asksReadyTimer = null;
389
413
  let _asksFlushTimer = null;
390
414
  const asksKnown = (sessionId) => _asksRead.has(sessionId) || underSession(sessionId, (id) => _asksRead.has(id));
391
415
 
416
+ export function trackTabAsks(tabs) {
417
+ for (const sessionId of _askTabs.keys()) {
418
+ if (tabs.has(sessionId) || hasSessionStore(sessionId)) continue;
419
+ _asksRead.delete(sessionId);
420
+ _asksUnread.delete(sessionId);
421
+ _asks.release([sessionId]);
422
+ }
423
+ _askTabs = tabs;
424
+ for (const sessionId of tabs.keys()) readAsksOf(sessionId);
425
+ }
426
+
392
427
  function askSession(sessionId, kinds) {
393
428
  const s = [...(_storesBySession.get(sessionId) || [])][0]?.getState?.() || {};
394
- return { sessionId, cwd: s.cwd || s.sessionInfo?.directory || undefined, ...(kinds ? { kinds } : {}) };
429
+ return { sessionId, cwd: s.cwd || s.sessionInfo?.directory || _askTabs.get(sessionId), ...(kinds ? { kinds } : {}) };
395
430
  }
396
431
 
397
432
  // `want`: null for every bound session (not one under another), else the sessions (and lists) to read.
@@ -400,7 +435,7 @@ function askSession(sessionId, kinds) {
400
435
  // learned (a list holding a request whose place is not known yet is unresolved meanwhile: its session waits).
401
436
  // After a reconnect the tree is known; only a sub-agent spawned during the outage is looked up.
402
437
  function readAsks(want, { attempt = 1, partial = false } = {}) {
403
- const bound = new Set(_storesBySession.keys());
438
+ const bound = new Set([..._storesBySession.keys(), ..._askTabs.keys()]);
404
439
  const sessions = want
405
440
  ? want.filter(({ sessionId }) => bound.has(sessionId)).map(({ sessionId, kinds }) => askSession(sessionId, kinds))
406
441
  : [...bound].filter((sessionId) => !underSession(sessionId, (id) => bound.has(id))).map((sessionId) => askSession(sessionId));
@@ -450,7 +485,7 @@ function flushAsksSoon() {
450
485
  // A sub-agent read in the same go as its parent is read with it.
451
486
  const batch = [..._asksUnread];
452
487
  const known = batch.filter((sessionId) => _storesBySession.has(sessionId)
453
- && (asksKnown(sessionId) || underSession(sessionId, (id) => id !== sessionId && batch.includes(id) && _storesBySession.has(id))));
488
+ && (asksKnown(sessionId) || underSession(sessionId, (id) => id !== sessionId && batch.includes(id) && (hasSessionStore(id) || _askTabs.has(id)))));
454
489
  const sessions = batch.filter((sessionId) => !known.includes(sessionId));
455
490
  _asksUnread.clear();
456
491
  if (known.length) _asks.release(known);
@@ -673,6 +708,28 @@ async function answerOpenCodeWorker({ sessionId, requestId, answers }, reject =
673
708
  return { ok: true, data: true };
674
709
  }
675
710
 
711
+ async function settleAsk(eventType, sessionId, requestId, response) {
712
+ const result = await response;
713
+ if (!replyFailed(result)) {
714
+ const event = { sessionID: sessionId, requestID: requestId };
715
+ _asks.note(eventType, event);
716
+ handleEvent(eventType, event);
717
+ }
718
+ return result;
719
+ }
720
+
721
+ async function abortSession(sessionId) {
722
+ const pending = _asks.openAsksOf(sessionId);
723
+ const stored = storedAsks((owner) => owner === sessionId || knownDescendant(owner, sessionId, _parentOf));
724
+ const result = await request({ type: 'message:abort', sessionId });
725
+ if (!replyFailed(result)) {
726
+ // Stop can finish after a new turn has started. Clear only the requests seen when Stop was pressed.
727
+ for (const ask of pending) _asks.note(`${ask.kind}.replied`, { requestID: ask.id, sessionID: ask.owner });
728
+ for (const [store, remove, id] of stored) store[remove](id);
729
+ }
730
+ return result;
731
+ }
732
+
676
733
  export const api = {
677
734
  init: () => request({ type: 'init', windowId: nativeLoopWindowId }),
678
735
  // options: { search, archived, roots, limit }. A server without
@@ -687,13 +744,20 @@ export const api = {
687
744
  // `human` / `greetingId`: lib/greeting/ (a server that does not know them ignores them).
688
745
  send: ({ sessionId, parts, model, agent, mode, variant, cwd, tools, noAbortPrev, human, greetingId }) =>
689
746
  request({ type: 'message:send', sessionId, parts, model, agent, mode, variant, cwd, tools, noAbortPrev: !!noAbortPrev, ...(human ? { human: true } : {}), ...(greetingId ? { greetingId } : {}) }, TURN_LIMIT_MS, { turnOf: sessionId }),
690
- abort: (sessionId) => request({ type: 'message:abort', sessionId }),
747
+ abort: abortSession,
691
748
  compact: ({ sessionId, cwd, tools } = {}) => request({ type: 'session:compact', sessionId, cwd, tools }, 5 * 60 * 1000),
692
749
  permissionReply: ({ sessionId, permissionId, response, cwd, message }) =>
693
- request({ type: 'permission:reply', sessionId, permissionId, response, cwd, message }),
750
+ settleAsk('permission.replied', sessionId, permissionId,
751
+ request({ type: 'permission:reply', sessionId, permissionId, response, cwd, message })),
694
752
  questionList: ({ cwd, sessionId } = {}) => workerQuestionRuns.has(sessionId) ? Promise.resolve({ data: workerQuestions(workerQuestionRuns.get(sessionId)) }) : request({ type: 'question:list', cwd, sessionId }),
695
- questionReply: ({ requestId, answers, cwd, sessionId }) => workerQuestionRuns.has(sessionId) ? answerOpenCodeWorker({ requestId, answers, sessionId }) : request({ type: 'question:reply', requestId, answers, cwd, sessionId }),
696
- questionReject: ({ requestId, sessionId }) => workerQuestionRuns.has(sessionId) ? answerOpenCodeWorker({ requestId, sessionId }, true) : request({ type: 'question:reject', requestId, sessionId }),
753
+ questionReply: ({ requestId, answers, cwd, sessionId }) =>
754
+ settleAsk('question.replied', sessionId, requestId, workerQuestionRuns.has(sessionId)
755
+ ? answerOpenCodeWorker({ requestId, answers, sessionId })
756
+ : request({ type: 'question:reply', requestId, answers, cwd, sessionId })),
757
+ questionReject: ({ requestId, sessionId }) =>
758
+ settleAsk('question.rejected', sessionId, requestId, workerQuestionRuns.has(sessionId)
759
+ ? answerOpenCodeWorker({ requestId, sessionId }, true)
760
+ : request({ type: 'question:reject', requestId, sessionId })),
697
761
  toolsGet: (sessionId) => gated({ type: 'mcp:tools:get', sessionId }),
698
762
  toolsSet: (sessionId, tools) => gated({ type: 'mcp:tools:set', sessionId, tools }, 45_000),
699
763
 
@@ -6,9 +6,8 @@
6
6
  // the connection (lib/peer-identity.js). When it cannot look that process up (netstat or ps missing, denied because
7
7
  // the server was started inside a sandbox, slow past its cap), it proves nothing about who is asking and pauses the
8
8
  // owner's actions: no page secret, and the owner's writes, reads and sockets answer 503 PEER_UNAVAILABLE. GET
9
- // /api/health says so (`ownerAuthority: { state: 'degraded', reason, retryable, since }`), and so does every 503
10
- // PEER_UNAVAILABLE a request of the page gets (public/shared/page-session.js turns it into the
11
- // `synabun:peer-unavailable` event). This module decides the words of the banner; ui-owner-authority.js asks the
9
+ // /api/health says so (`ownerAuthority: { state: 'degraded', reason, retryable, since }`). A request refused with
10
+ // PEER_UNAVAILABLE prompts the page to check health. This module decides the words of the banner; ui-owner-authority.js asks the
12
11
  // server, listens and draws them. `unsupported` (Windows, Linux) and `off` (SYNABUN_PEER_IDENTITY=off) show nothing:
13
12
  // there the rules from before apply and nothing is paused.
14
13
  //
@@ -27,7 +26,7 @@ export const OWNER_AUTHORITY_NOTICE_COPY = Object.freeze({
27
26
  });
28
27
 
29
28
  /** The states GET /api/health can name (lib/peer-identity.js authorityState). */
30
- export const OWNER_AUTHORITY_STATES = Object.freeze(['ok', 'degraded', 'unsupported', 'off']);
29
+ export const OWNER_AUTHORITY_STATES = Object.freeze(['pending', 'ok', 'degraded', 'unsupported', 'off']);
31
30
  /** The longest reason the banner shows (the server's reasons are short; a longer one is cut). */
32
31
  export const REASON_MAX = 200;
33
32
 
@@ -58,13 +57,8 @@ export function readOwnerAuthority(health) {
58
57
  };
59
58
  }
60
59
 
61
- /** The state a 503 PEER_UNAVAILABLE answer stands for (the event's detail, or the answer's body). */
62
- export function unavailableAuthority(detail) {
63
- return { state: 'degraded', reason: cleanReason(detail?.reason) || null, retryable: detail?.retryable === true, since: null };
64
- }
65
-
66
60
  /**
67
- * What the banner shows for a state, or null when it shows nothing (ok, unsupported, off, nothing known).
61
+ * What the banner shows for a state, or null when it shows nothing (pending, ok, unsupported, off, nothing known).
68
62
  * `t(key, params)` is the page's translator for `ownerAuthorityNotice.*` (English by default).
69
63
  * → { key, label, title, body, reason, hint, actions: [{ id: 'reload'|'dismiss', label }] }. `key` is what a
70
64
  * dismissal is remembered by: the same outage stays dismissed, a new reason shows again.
@@ -25,7 +25,7 @@
25
25
  // lookup of the calling process failed: lib/peer-identity.js), so it hands out no page secret and refuses the owner's
26
26
  // actions until a lookup works again. Nothing here cures that, so nothing is retried: the answer goes back as it came,
27
27
  // and the page is told once per answer (the `synabun:peer-unavailable` event on the window, which
28
- // ui-owner-authority.js turns into its banner). A refresh that met it (GET /api/page-session answered 503) is not asked
28
+ // ui-owner-authority.js uses to recheck verifier health). A refresh that met it (GET /api/page-session answered 503) is not asked
29
29
  // again for a few seconds: a burst of refused writes costs the server one lookup, not one each.
30
30
  //
31
31
  // A refusal nothing here cures (403 WORKER_BROWSER, OWNER_ROUTE, or PAGE_SECRET_REQUIRED the refresh did not cure) is
@@ -449,8 +449,8 @@ export function launchFacts(schedule, { group = null, template = null, profiles
449
449
  }
450
450
  const browser = pick('usesBrowser');
451
451
  facts.push({ key: 'usesBrowser', label: scheduleWord('factBrowser'), value: scheduleWord(browser.value === true ? 'valueOn' : 'valueOff'), source: browser.source });
452
- // The MoreLogin profile the run opens: the schedule's own, else its group's (none: the default of Settings →
453
- // Browser, which the list does not repeat). An automation has none.
452
+ // The MoreLogin profile the run opens: the schedule's own, else its group's (none: the default AI
453
+ // browser, which the list does not repeat). An automation has none.
454
454
  const moreLoginOwner = schedule?.moreloginEnvId ? schedule : (group?.moreloginEnvId ? group : null);
455
455
  if (moreLoginOwner) {
456
456
  facts.push({ key: 'moreloginEnvId', label: scheduleWord('factMoreLogin'), value: moreLoginOwner.moreloginEnvName || String(moreLoginOwner.moreloginEnvId), source: moreLoginOwner === schedule ? 'schedule' : 'group' });
@@ -0,0 +1,11 @@
1
+ /** Include the session checkout without registering it as a global project or changing Git. */
2
+ export function sessionProjectItems(projects, cwd = '') {
3
+ const items = projects.map(p => {
4
+ const path = typeof p === 'string' ? p : p.path;
5
+ return { value: path, label: p.label || path.split(/[/\\]/).filter(Boolean).pop() || path };
6
+ });
7
+ if (cwd && !items.some(item => item.value === cwd)) {
8
+ items.unshift({ value: cwd, label: cwd.split(/[/\\]/).filter(Boolean).pop() || cwd });
9
+ }
10
+ return items;
11
+ }