synabun 2.3.0 → 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 (367) hide show
  1. package/CHANGELOG.md +38 -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 +1174 -47
  103. package/neural-interface/i18n/pt-BR.json +1174 -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-profiles.js +1 -1
  135. package/neural-interface/lib/browser-tool-policy.js +1 -1
  136. package/neural-interface/lib/claude-account-links.js +301 -0
  137. package/neural-interface/lib/claude-accounts.js +45 -20
  138. package/neural-interface/lib/claude-agent-bridge.js +142 -10
  139. package/neural-interface/lib/claude-model-catalog.js +6 -0
  140. package/neural-interface/lib/claude-panel-session.js +33 -0
  141. package/neural-interface/lib/cli-install-api.js +23 -0
  142. package/neural-interface/lib/codex-accounts.js +67 -24
  143. package/neural-interface/lib/coordination/README.md +384 -0
  144. package/neural-interface/lib/coordination/service.js +563 -0
  145. package/neural-interface/lib/coordination/store.js +1138 -0
  146. package/neural-interface/lib/db.js +22 -1
  147. package/neural-interface/lib/editor-completion-opencode.js +4 -3
  148. package/neural-interface/lib/effort-levels.js +10 -1
  149. package/neural-interface/lib/maritaca/opencode-proxy.js +7 -2
  150. package/neural-interface/lib/maritaca/opencode.js +35 -0
  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 +219 -7
  157. package/neural-interface/lib/native-loop-runtime.js +24 -1
  158. package/neural-interface/lib/opencode-build-preflight.js +116 -0
  159. package/neural-interface/lib/opencode-launch-error.js +13 -0
  160. package/neural-interface/lib/opencode-native-boundary.js +800 -84
  161. package/neural-interface/lib/opencode-serve-probe.js +426 -0
  162. package/neural-interface/lib/opencode-serve-records.js +14 -9
  163. package/neural-interface/lib/opencode-serve-scan.js +108 -0
  164. package/neural-interface/lib/page-session.js +1 -1
  165. package/neural-interface/lib/peer-identity.js +60 -21
  166. package/neural-interface/lib/process-identity.js +235 -7
  167. package/neural-interface/lib/request-gate.js +3 -0
  168. package/neural-interface/lib/screenshot-location.js +33 -0
  169. package/neural-interface/lib/skills/creation.js +1 -1
  170. package/neural-interface/lib/skills/known-bridge-digests.json +40 -0
  171. package/neural-interface/lib/studio-attention.js +56 -0
  172. package/neural-interface/lib/teams/README.md +382 -0
  173. package/neural-interface/lib/teams/api.js +287 -0
  174. package/neural-interface/lib/teams/brief.js +185 -0
  175. package/neural-interface/lib/teams/claims.js +315 -0
  176. package/neural-interface/lib/teams/git.js +293 -0
  177. package/neural-interface/lib/teams/index.js +122 -0
  178. package/neural-interface/lib/teams/integration.js +580 -0
  179. package/neural-interface/lib/teams/landing.js +184 -0
  180. package/neural-interface/lib/teams/recovery.js +256 -0
  181. package/neural-interface/lib/teams/scheduler.js +1474 -0
  182. package/neural-interface/lib/teams/schema.js +559 -0
  183. package/neural-interface/lib/teams/state.js +181 -0
  184. package/neural-interface/lib/teams/test-runner.js +86 -0
  185. package/neural-interface/lib/teams/test-sandbox.js +99 -0
  186. package/neural-interface/lib/teams/worktrees.js +757 -0
  187. package/neural-interface/lib/tool-permission-choices.js +226 -0
  188. package/neural-interface/lib/whatsapp/cards.js +24 -10
  189. package/neural-interface/lib/worker-confinement.js +206 -6
  190. package/neural-interface/lib/worker-mcp-channel.js +38 -1
  191. package/neural-interface/package-lock.json +4 -2
  192. package/neural-interface/package.json +3 -1
  193. package/neural-interface/public/extension-setup.html +107 -0
  194. package/neural-interface/public/index.html +52 -12
  195. package/neural-interface/public/shared/agent-runtime-options.js +3 -1
  196. package/neural-interface/public/shared/agents/studio/ax-agent-view.js +614 -0
  197. package/neural-interface/public/shared/agents/studio/ax-api.js +198 -0
  198. package/neural-interface/public/shared/agents/studio/ax-create-view.js +221 -0
  199. package/neural-interface/public/shared/agents/studio/ax-diff.js +143 -0
  200. package/neural-interface/public/shared/agents/studio/ax-editor-view.js +392 -0
  201. package/neural-interface/public/shared/agents/studio/ax-export-view.js +94 -0
  202. package/neural-interface/public/shared/agents/studio/ax-form.js +191 -0
  203. package/neural-interface/public/shared/agents/studio/ax-icons.js +87 -0
  204. package/neural-interface/public/shared/agents/studio/ax-library-view.js +158 -0
  205. package/neural-interface/public/shared/agents/studio/ax-library.js +162 -0
  206. package/neural-interface/public/shared/agents/studio/ax-main.js +712 -0
  207. package/neural-interface/public/shared/agents/studio/ax-native-export.js +35 -0
  208. package/neural-interface/public/shared/agents/studio/ax-options.js +198 -0
  209. package/neural-interface/public/shared/agents/studio/ax-review-view.js +175 -0
  210. package/neural-interface/public/shared/agents/studio/ax-revisions-view.js +189 -0
  211. package/neural-interface/public/shared/agents/studio/ax-runs-view.js +202 -0
  212. package/neural-interface/public/shared/agents/studio/ax-runs.js +82 -0
  213. package/neural-interface/public/shared/agents/studio/ax-teams-view.js +256 -0
  214. package/neural-interface/public/shared/agents/studio/ax-teams.js +200 -0
  215. package/neural-interface/public/shared/agents/studio/ax-templates.js +50 -0
  216. package/neural-interface/public/shared/agents/studio/ax-ui.js +194 -0
  217. package/neural-interface/public/shared/agents/studio/ax-views.js +170 -0
  218. package/neural-interface/public/shared/agy/agy-panel.js +142 -28
  219. package/neural-interface/public/shared/agy/agy-styles.js +25 -5
  220. package/neural-interface/public/shared/assistant/asst-account-menu.js +13 -13
  221. package/neural-interface/public/shared/assistant/asst-ask-styles.js +2 -3
  222. package/neural-interface/public/shared/assistant/asst-brain-picker.js +91 -9
  223. package/neural-interface/public/shared/assistant/asst-control.js +3 -0
  224. package/neural-interface/public/shared/assistant/asst-interaction-hold.js +99 -0
  225. package/neural-interface/public/shared/assistant/asst-limit-dismissals.js +111 -0
  226. package/neural-interface/public/shared/assistant/asst-limit-dock.js +37 -3
  227. package/neural-interface/public/shared/assistant/asst-limit-wait.js +30 -7
  228. package/neural-interface/public/shared/assistant/asst-panel.js +177 -30
  229. package/neural-interface/public/shared/assistant/asst-rack-styles.js +15 -8
  230. package/neural-interface/public/shared/assistant/asst-render.js +36 -6
  231. package/neural-interface/public/shared/assistant/asst-route.js +78 -12
  232. package/neural-interface/public/shared/assistant/asst-routes-editor.js +148 -70
  233. package/neural-interface/public/shared/assistant/asst-roving.js +17 -1
  234. package/neural-interface/public/shared/assistant/asst-scene-styles.js +7 -2
  235. package/neural-interface/public/shared/assistant/asst-scenes.js +12 -1
  236. package/neural-interface/public/shared/assistant/asst-sidepanel.js +12 -2
  237. package/neural-interface/public/shared/assistant/asst-state.js +66 -1
  238. package/neural-interface/public/shared/assistant/asst-styles.js +98 -44
  239. package/neural-interface/public/shared/assistant/route-identity.js +16 -0
  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 +33 -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/opencode-verify-view.js +175 -0
  279. package/neural-interface/public/shared/schedules-view.js +2 -2
  280. package/neural-interface/public/shared/session-project-items.js +11 -0
  281. package/neural-interface/public/shared/settings/settings-ai-browser.js +119 -0
  282. package/neural-interface/public/shared/settings/settings-browser-extension.js +446 -0
  283. package/neural-interface/public/shared/settings/settings-ia.js +4 -2
  284. package/neural-interface/public/shared/settings/settings-morelogin-cooldown.js +63 -0
  285. package/neural-interface/public/shared/settings/settings-tool-permissions.js +70 -0
  286. package/neural-interface/public/shared/sidepanel-lazy.js +40 -0
  287. package/neural-interface/public/shared/sidepanel-session-status.js +8 -14
  288. package/neural-interface/public/shared/sidepanel-shown.js +73 -0
  289. package/neural-interface/public/shared/storage.js +6 -1
  290. package/neural-interface/public/shared/studio-attention.js +83 -0
  291. package/neural-interface/public/shared/styles.css +713 -61
  292. package/neural-interface/public/shared/term-browser-tabs.js +34 -0
  293. package/neural-interface/public/shared/transcript-rows.js +334 -0
  294. package/neural-interface/public/shared/tray-auto-close.js +106 -0
  295. package/neural-interface/public/shared/ui-agents.js +97 -0
  296. package/neural-interface/public/shared/ui-antigravity-panel.js +16 -14
  297. package/neural-interface/public/shared/ui-automation-studio.js +3 -3
  298. package/neural-interface/public/shared/ui-claude-panel.js +162 -95
  299. package/neural-interface/public/shared/ui-code-copy.js +256 -0
  300. package/neural-interface/public/shared/ui-codex-panel.js +14 -10
  301. package/neural-interface/public/shared/ui-context-menu.js +1 -1
  302. package/neural-interface/public/shared/ui-file-explorer.js +2 -3
  303. package/neural-interface/public/shared/ui-games.js +1 -1
  304. package/neural-interface/public/shared/ui-loading.js +12 -1
  305. package/neural-interface/public/shared/ui-maritaca-panel.js +12 -11
  306. package/neural-interface/public/shared/ui-menubar.js +23 -0
  307. package/neural-interface/public/shared/ui-native-loop-router.js +1 -1
  308. package/neural-interface/public/shared/ui-navbar.js +15 -9
  309. package/neural-interface/public/shared/ui-opencode-panel-v2.js +13 -11
  310. package/neural-interface/public/shared/ui-opencode-verify.js +120 -0
  311. package/neural-interface/public/shared/ui-schedules-studio.js +3 -3
  312. package/neural-interface/public/shared/ui-scroll-follow.js +39 -0
  313. package/neural-interface/public/shared/ui-sessions.js +3 -3
  314. package/neural-interface/public/shared/ui-settings-entry.js +55 -0
  315. package/neural-interface/public/shared/ui-settings.js +372 -402
  316. package/neural-interface/public/shared/ui-sidepanel-layout.js +44 -25
  317. package/neural-interface/public/shared/ui-sidepanel-session-entry.js +22 -9
  318. package/neural-interface/public/shared/ui-sidepanel-sessions.js +10 -2
  319. package/neural-interface/public/shared/ui-sidepanel-tray.js +36 -41
  320. package/neural-interface/public/shared/ui-sidepanel-windows.js +14 -1
  321. package/neural-interface/public/shared/ui-styleguide.js +10 -2
  322. package/neural-interface/public/shared/ui-sync.js +5 -0
  323. package/neural-interface/public/shared/ui-terminal.js +13 -9
  324. package/neural-interface/public/shared/ui-tooltip.js +28 -7
  325. package/neural-interface/public/shared/ui-topright-overflow.js +26 -4
  326. package/neural-interface/public/shared/ui-tray-columns.js +375 -0
  327. package/neural-interface/public/shared/ui-whiteboard.js +51 -6
  328. package/neural-interface/public/shared/ui-worker-end.js +28 -1
  329. package/neural-interface/public/shared/ui-workspaces.js +13 -0
  330. package/neural-interface/public/shared/window-keys.js +71 -0
  331. package/neural-interface/public/variant/2d/main.js +2 -0
  332. package/neural-interface/public/variant/3d/app.js +620 -0
  333. package/neural-interface/public/variant/3d/boot-reveal.js +47 -0
  334. package/neural-interface/public/variant/3d/main.js +21 -544
  335. package/neural-interface/public/variant/3d/map-controls.js +4 -2
  336. package/neural-interface/public/vendor/fonts/fonts.css +508 -0
  337. package/neural-interface/public/vendor/fonts/inter-OFL.txt +93 -0
  338. package/neural-interface/public/vendor/fonts/inter-cyrillic-ext.woff2 +0 -0
  339. package/neural-interface/public/vendor/fonts/inter-cyrillic.woff2 +0 -0
  340. package/neural-interface/public/vendor/fonts/inter-greek-ext.woff2 +0 -0
  341. package/neural-interface/public/vendor/fonts/inter-greek.woff2 +0 -0
  342. package/neural-interface/public/vendor/fonts/inter-latin-ext.woff2 +0 -0
  343. package/neural-interface/public/vendor/fonts/inter-latin.woff2 +0 -0
  344. package/neural-interface/public/vendor/fonts/inter-vietnamese.woff2 +0 -0
  345. package/neural-interface/public/vendor/fonts/jetbrains-mono-OFL.txt +93 -0
  346. package/neural-interface/public/vendor/fonts/jetbrains-mono-cyrillic-ext.woff2 +0 -0
  347. package/neural-interface/public/vendor/fonts/jetbrains-mono-cyrillic.woff2 +0 -0
  348. package/neural-interface/public/vendor/fonts/jetbrains-mono-greek.woff2 +0 -0
  349. package/neural-interface/public/vendor/fonts/jetbrains-mono-latin-ext.woff2 +0 -0
  350. package/neural-interface/public/vendor/fonts/jetbrains-mono-latin.woff2 +0 -0
  351. package/neural-interface/public/vendor/fonts/jetbrains-mono-vietnamese.woff2 +0 -0
  352. package/neural-interface/public/vendor/fonts/manifest.json +142 -0
  353. package/neural-interface/public/vendor/fonts/space-grotesk-OFL.txt +93 -0
  354. package/neural-interface/public/vendor/fonts/space-grotesk-latin-ext.woff2 +0 -0
  355. package/neural-interface/public/vendor/fonts/space-grotesk-latin.woff2 +0 -0
  356. package/neural-interface/public/vendor/fonts/space-grotesk-vietnamese.woff2 +0 -0
  357. package/neural-interface/scripts/boot-graph.mjs +270 -0
  358. package/neural-interface/scripts/vendor-fonts.mjs +124 -0
  359. package/neural-interface/server.js +1164 -157
  360. package/npm-shrinkwrap.json +2 -2
  361. package/package.json +3 -1
  362. package/skills/agent-forge/SKILL.md +182 -0
  363. package/skills/agent-forge/evals/evals.json +56 -0
  364. package/skills/agent-forge/references/definition-fields.md +61 -0
  365. package/skills/agent-forge/references/examples.md +105 -0
  366. package/skills/agent-forge/references/instructions.md +51 -0
  367. package/skills/agent-forge/references/review-and-export.md +84 -0
@@ -582,6 +582,23 @@ function failureText(error) {
582
582
  return String(error?.code || error?.message || error || 'failed');
583
583
  }
584
584
 
585
+ const STDERR_NOTE_MAX = 200;
586
+ /**
587
+ * What a program wrote to stderr, for a failure's reason: ` (netstat said: "…")`, on one line and at most
588
+ * STDERR_NOTE_MAX characters, or '' when it wrote nothing.
589
+ */
590
+ export function stderrNote(text, program = 'netstat') {
591
+ const said = String(text ?? '').replace(/\s+/g, ' ').trim();
592
+ if (!said) return '';
593
+ return ` (${program} said: "${said.length > STDERR_NOTE_MAX ? `${said.slice(0, STDERR_NOTE_MAX - 1)}…` : said}")`;
594
+ }
595
+
596
+ /** A run's answer as `{ stdout, stderr }`: a run may answer stdout alone (a string) or both (`{ stdout, stderr }`). */
597
+ function outputOf(answer) {
598
+ if (answer && typeof answer === 'object' && 'stdout' in answer) return { stdout: String(answer.stdout ?? ''), stderr: String(answer.stderr ?? '') };
599
+ return { stdout: String(answer ?? ''), stderr: '' };
600
+ }
601
+
585
602
  /**
586
603
  * What a request's peer verdict means for the owner's authority: the one reading lib/page-session.js,
587
604
  * lib/owner-authority.js and lib/assistant-api.js share. Pure, never throws.
@@ -615,11 +632,16 @@ export function peerAuthority(verdict) {
615
632
 
616
633
  // ── The reader ───────────────────────────────────────────────────────────────
617
634
 
618
- function defaultRun(file, args, { timeout }) {
635
+ // `stderr: true` answers `{ stdout, stderr }` instead of stdout alone; a failure always carries what the program wrote
636
+ // to stderr (`error.stderr`).
637
+ function defaultRun(file, args, { timeout, stderr: withStderr = false }) {
619
638
  return new Promise((resolve, reject) => {
620
639
  try {
621
- execFile(file, args, { encoding: 'utf8', timeout, maxBuffer: 64 * 1024 * 1024, windowsHide: true, env: { PATH: '/usr/bin:/bin:/usr/sbin:/sbin', LANG: 'C', LC_ALL: 'C' } }, (error, stdout) => {
622
- if (error) reject(error); else resolve(String(stdout || ''));
640
+ execFile(file, args, { encoding: 'utf8', timeout, maxBuffer: 64 * 1024 * 1024, windowsHide: true, env: { PATH: '/usr/bin:/bin:/usr/sbin:/sbin', LANG: 'C', LC_ALL: 'C' } }, (error, stdout, stderr) => {
641
+ if (error) {
642
+ if (error && typeof error === 'object' && error.stderr === undefined) { try { error.stderr = String(stderr || ''); } catch { /* frozen */ } }
643
+ reject(error);
644
+ } else resolve(withStderr ? { stdout: String(stdout || ''), stderr: String(stderr || '') } : String(stdout || ''));
623
645
  });
624
646
  } catch (error) { reject(error); }
625
647
  });
@@ -671,7 +693,7 @@ export function createPeerIdentity({ platform = process.platform, selfPid = proc
671
693
  return typeof real === 'string' && real !== written ? [written, real] : [written];
672
694
  }))];
673
695
  const logged = new Map(); // key → last time
674
- const stats = { lookups: 0, tableReads: 0, psReads: 0, envReads: 0, refused: 0, unknown: 0, failed: 0, retries: 0, gone: 0, totalMs: 0, maxMs: 0 };
696
+ const stats = { lookups: 0, tableReads: 0, tableRetries: 0, psReads: 0, envReads: 0, refused: 0, unknown: 0, failed: 0, retries: 0, gone: 0, totalMs: 0, maxMs: 0 };
675
697
  let addrCache = null;
676
698
  let addrAt = 0;
677
699
 
@@ -738,11 +760,10 @@ export function createPeerIdentity({ platform = process.platform, selfPid = proc
738
760
  probed = (async () => {
739
761
  const failures = [];
740
762
  let retryable = false;
741
- try {
742
- const table = parseNetstatTcp(await run(NETSTAT, NETSTAT_ARGS, { timeout: TABLE_TIMEOUT_MS }));
743
- if (!table.rows.length) failures.push('netstat listed no TCP sockets');
744
- else if (!table.rows.some((r) => r.pid > 0)) failures.push('netstat named no processes (an unknown output layout)');
745
- } catch (error) { failures.push(`netstat: ${failureText(error)}`); retryable = retryable || isTransientLookupError(error); }
763
+ try { await readNetstat(); } catch (error) {
764
+ failures.push(error?.netstatTable ? error.message : netstatFailure(error));
765
+ retryable = retryable || isTransientLookupError(error);
766
+ }
746
767
  try {
747
768
  const parents = parsePsParents(await run(PS, ['-Ao', 'pid=,ppid=,ucomm='], { timeout: PS_TIMEOUT_MS }));
748
769
  if (!parents.size) failures.push('ps listed no processes');
@@ -763,6 +784,34 @@ export function createPeerIdentity({ platform = process.platform, selfPid = proc
763
784
  return addrCache.has(addr);
764
785
  };
765
786
 
787
+ /**
788
+ * netstat's TCP table: `{ rows, listening, startedAt }` (when the read that gave it started). A table that lists no
789
+ * socket at all is read again once, at once: a busy system can answer one read with nothing (seen at a cold start,
790
+ * right after login), and that is not worth the owner's 503s. What netstat wrote to stderr is kept in the reason of a
791
+ * table that stays unreadable. Rejects with the reason (`error.netstatTable`: the table, not the program, failed);
792
+ * a program that cannot run rejects with its own error (netstatFailure).
793
+ */
794
+ async function readNetstat() {
795
+ let said = '';
796
+ for (let attempt = 0; attempt < 2; attempt++) {
797
+ if (attempt) stats.tableRetries++;
798
+ const startedAt = now();
799
+ // -l: full IPv6 addresses (without it macOS cuts a long one, fe80::105e:de82:…, and the client's row would not
800
+ // be found: a connection taken for one that closed, refused).
801
+ const out = outputOf(await run(NETSTAT, NETSTAT_ARGS, { timeout: TABLE_TIMEOUT_MS, stderr: true }));
802
+ if (out.stderr.trim()) said = out.stderr;
803
+ const table = parseNetstatTcp(out.stdout);
804
+ if (!table.rows.length) continue;
805
+ // A layout this parser does not read gives no process at all: that is a lookup that cannot run (the rules from
806
+ // before), never "every client left". Not read again: the layout does not change between two reads.
807
+ if (!table.rows.some((r) => r.pid > 0)) throw Object.assign(new Error(`netstat named no processes (an unknown output layout)${stderrNote(said)}`), { netstatTable: true });
808
+ return { ...table, startedAt };
809
+ }
810
+ throw Object.assign(new Error(`netstat listed no TCP sockets${stderrNote(said)}`), { netstatTable: true });
811
+ }
812
+ /** The reason of a netstat that failed as a program: `netstat: <why>`, with what it wrote to stderr. */
813
+ const netstatFailure = (error) => `netstat: ${failureText(error)}${error && typeof error === 'object' && !error.netstatTable ? stderrNote(error.stderr) : ''}`;
814
+
766
815
  // One TCP table read serves every lookup that was waiting when it STARTED (a socket accepted after a read began
767
816
  // may not be in it, so its lookup waits for the next read).
768
817
  let tableRunning = null;
@@ -773,17 +822,7 @@ export function createPeerIdentity({ platform = process.platform, selfPid = proc
773
822
  tableNext = after.catch(() => {}).then(() => {
774
823
  tableNext = null;
775
824
  stats.tableReads++;
776
- const startedAt = now();
777
- // -l: full IPv6 addresses (without it macOS cuts a long one, fe80::105e:de82:…, and the client's row would not
778
- // be found: a connection taken for one that closed, refused).
779
- const read = run(NETSTAT, NETSTAT_ARGS, { timeout: TABLE_TIMEOUT_MS }).then((text) => {
780
- const table = parseNetstatTcp(text);
781
- if (!table.rows.length) throw new Error('netstat listed no TCP sockets');
782
- // A layout this parser does not read gives no process at all: that is a lookup that cannot run (the rules from
783
- // before), never "every client left".
784
- if (!table.rows.some((r) => r.pid > 0)) throw new Error('netstat named no processes (an unknown output layout)');
785
- return { ...table, startedAt };
786
- });
825
+ const read = readNetstat();
787
826
  tableRunning = read;
788
827
  read.catch(() => {}).then(() => { if (tableRunning === read) tableRunning = null; });
789
828
  return read;
@@ -875,7 +914,7 @@ export function createPeerIdentity({ platform = process.platform, selfPid = proc
875
914
  if (!isThisMachine(remote)) return { status: 'remote' };
876
915
  if (!supported) return unsupportedPeerVerdict(unsupportedReason);
877
916
  let table;
878
- try { table = await tcpTable(); } catch (error) { return failedPeerVerdict(`netstat: ${failureText(error)}`, { retryable: isTransientLookupError(error) }); }
917
+ try { table = await tcpTable(); } catch (error) { return failedPeerVerdict(netstatFailure(error), { retryable: isTransientLookupError(error) }); }
879
918
  const row = table.rows.find((r) => r.local.port === remotePort && r.local.addr === remote && r.foreign.port === localPort && (r.foreign.addr === local || !local));
880
919
  if (!row || !row.pid) return { status: 'gone', reason: 'the connection closed before its request was identified', ms: now() - started };
881
920
  if (row.pid === selfPid) return { status: 'ok', self: true, pid: row.pid, name: row.name, chain: [], refuse: null, ms: now() - started };
@@ -119,9 +119,12 @@ export async function readProcessIdentityAsync(pid, { platform = process.platfor
119
119
  }
120
120
  }
121
121
 
122
- function runFile(file, args, options) {
122
+ function runFile(file, args, { rejectStderr = false, ...options }) {
123
123
  return new Promise((resolve, reject) => {
124
- execFile(file, args, options, (error, stdout, stderr) => (error ? reject(Object.assign(error, { stdout, stderr })) : resolve(stdout)));
124
+ execFile(file, args, options, (error, stdout, stderr) => {
125
+ if (error || (rejectStderr && String(stderr || '').trim())) reject(Object.assign(error || new Error('OS query warning'), { stdout, stderr }));
126
+ else resolve(stdout);
127
+ });
125
128
  });
126
129
  }
127
130
 
@@ -327,11 +330,229 @@ export async function readProcessParentAsync(pid, { platform = process.platform,
327
330
  }
328
331
  }
329
332
 
333
+ /**
334
+ * Every TCP address a process listens on, as the OS reports its sockets: `[{ host, port }]` (host without brackets:
335
+ * `127.0.0.1`, `::1`, `*` for every address), an empty list when it listens on none, or null when the OS could not be
336
+ * asked. macOS and Linux: `lsof -nP -a -p <pid> -iTCP -sTCP:LISTEN -Fn` (exit 1 with nothing printed is "none");
337
+ * Windows: Get-NetTCPConnection by its owning process. What the serve's command line says is never read here: the
338
+ * sockets are what a page could reach.
339
+ * @param {number} pid
340
+ * @param {{ platform?: string, run?: (file: string, args: string[], options: object) => Promise<string> }} [o]
341
+ */
342
+ export async function listListenAddressesAsync(pid, { platform = process.platform, run = runFile } = {}) {
343
+ const n = pidOf(pid);
344
+ if (!n) return null;
345
+ const parse = (lines) => {
346
+ const out = [];
347
+ for (const raw of lines) {
348
+ const text = raw.trim();
349
+ if (!text) continue;
350
+ // "[::1]:4096", "127.0.0.1:4096", "*:4096" (lsof); "::1 4096" or "0.0.0.0 4096" (PowerShell below).
351
+ const m = /^\[?([^\]\s]*?)\]?[:\s](\d{1,5})$/.exec(text);
352
+ if (!m || !m[1]) return null;
353
+ out.push({ host: m[1].toLowerCase(), port: Number(m[2]) });
354
+ }
355
+ return out;
356
+ };
357
+ if (platform === 'win32') {
358
+ const query = powershell(`Get-NetTCPConnection -OwningProcess ${n} -State Listen -ErrorAction SilentlyContinue | ForEach-Object { "$($_.LocalAddress) $($_.LocalPort)" }`);
359
+ try { return parse(String(await run(query.file, query.args, query.options)).split(/\r?\n/)); } catch { return null; }
360
+ }
361
+ const names = (out) => String(out ?? '').split(/\r?\n/).filter((l) => l.startsWith('n')).map((l) => l.slice(1));
362
+ try {
363
+ return parse(names(await run('lsof', ['-nP', '-a', '-p', String(n), '-iTCP', '-sTCP:LISTEN', '-Fn'], { encoding: 'utf8', timeout: 5000, env: C_ENV() })));
364
+ } catch (error) {
365
+ // lsof exits 1 when nothing matched, and for errors too. Only a clean "nothing" (no output at all) is "listens on
366
+ // none"; sockets printed next to an error, or an error alone, are a partial answer: unknown, refused by callers.
367
+ if (error?.code !== 1) return null;
368
+ if (String(error.stdout ?? '').trim() || String(error.stderr ?? '').trim()) return null;
369
+ return [];
370
+ }
371
+ }
372
+
373
+ /**
374
+ * `readProcessIdentityAsync` for many pids in one question to the OS: a Map pid → `{ pid, startedAt, command }`; a
375
+ * pid the OS did not report (gone, or unreadable) is absent. null when the OS could not be asked at all.
376
+ * @param {number[]} pids
377
+ */
378
+ export async function readProcessIdentitiesAsync(pids, { platform = process.platform, run = runFile } = {}) {
379
+ const list = [...new Set((pids || []).map(pidOf).filter(Boolean))];
380
+ const out = new Map();
381
+ if (!list.length) return out;
382
+ if (platform === 'win32') {
383
+ const filter = list.map((n) => `ProcessId=${n}`).join(' or ');
384
+ const query = powershell(`Get-CimInstance Win32_Process -Filter "${filter}" | ForEach-Object { [pscustomobject]@{ pid = $_.ProcessId; name = $_.Name; startedAt = $(if ($_.CreationDate) { $_.CreationDate.ToUniversalTime().ToString('o') } else { '' }); command = $_.CommandLine } } | ConvertTo-Json -Compress`);
385
+ try {
386
+ const text = String(await run(query.file, query.args, query.options)).trim();
387
+ const rows = text ? JSON.parse(text) : [];
388
+ for (const row of Array.isArray(rows) ? rows : [rows]) {
389
+ const n = pidOf(row?.pid);
390
+ // A protected system process has no command line for another user: its name is all there is ('' command).
391
+ if (n && (row.command || row.name)) out.set(n, { pid: n, startedAt: String(row.startedAt || ''), command: String(row.command || '').trim(), name: String(row.name || '') });
392
+ }
393
+ return out;
394
+ } catch { return null; }
395
+ }
396
+ let text;
397
+ try {
398
+ text = await run('ps', ['-ww', '-o', 'pid=', '-o', 'lstart=', '-o', 'command=', '-p', list.join(',')], { encoding: 'utf8', timeout: 5000, env: C_ENV() });
399
+ } catch (error) {
400
+ // ps exits 1 when some pid ran nothing: what it printed for the others still stands.
401
+ if (error?.code !== 1) return null;
402
+ text = error.stdout;
403
+ }
404
+ for (const line of String(text ?? '').split(/\r?\n/)) {
405
+ const m = PS_LINE.exec(line.trim());
406
+ const n = pidOf(m?.[1]);
407
+ if (m && n) out.set(n, { pid: n, startedAt: m[2].replace(/\s+/g, ' '), command: m[3].trim() });
408
+ }
409
+ return out;
410
+ }
411
+
412
+ /**
413
+ * Every process listening on TCP, as the OS reports its sockets: `[{ pid, name, addresses: [{ host, port }] }]` (an
414
+ * empty list when nothing listens), or null when the OS could not be asked or answered only in part. macOS and Linux:
415
+ * `lsof -nP -iTCP -sTCP:LISTEN -F pcn` (the user's own processes; exit 1 with nothing printed at all is "none", any
416
+ * other exit or any output next to an error is null); Windows: Get-NetTCPConnection as JSON. `selfPid` is left out.
417
+ * @param {{ platform?: string, run?: (file: string, args: string[], options: object) => Promise<string>, selfPid?: number }} [o]
418
+ */
419
+ export async function listTcpListenersAsync({ platform = process.platform, run = runFile, selfPid = process.pid } = {}) {
420
+ const byPid = new Map();
421
+ const add = (pid, name, host, port) => {
422
+ const n = pidOf(pid);
423
+ const p = Number(port);
424
+ if (!n || !Number.isInteger(p) || p <= 0 || p > 65535 || !host) return false;
425
+ if (n === selfPid) return true;
426
+ const entry = byPid.get(n) || { pid: n, name: name || '', addresses: [] };
427
+ if (!entry.addresses.some((a) => a.host === host && a.port === p)) entry.addresses.push({ host, port: p });
428
+ byPid.set(n, entry);
429
+ return true;
430
+ };
431
+ if (platform === 'win32') {
432
+ const query = powershell('Get-NetTCPConnection -State Listen -ErrorAction Stop | ForEach-Object { [pscustomobject]@{ pid = $_.OwningProcess; host = $_.LocalAddress; port = $_.LocalPort } } | ConvertTo-Json -Compress');
433
+ let rows;
434
+ try {
435
+ const text = String(await run(query.file, query.args, query.options)).trim();
436
+ rows = text ? JSON.parse(text) : [];
437
+ } catch { return null; }
438
+ for (const row of Array.isArray(rows) ? rows : [rows]) {
439
+ // pid 0 / 4 are the kernel's own listeners (System Idle, System): never OpenCode.
440
+ if (row && (Number(row.pid) === 0 || Number(row.pid) === 4)) continue;
441
+ if (!row || !add(row.pid, '', String(row.host ?? '').toLowerCase(), row.port)) return null;
442
+ }
443
+ return [...byPid.values()];
444
+ }
445
+ let out;
446
+ try {
447
+ out = await run('lsof', ['-nP', '-iTCP', '-sTCP:LISTEN', '-F', 'pcn'], { encoding: 'utf8', timeout: 5000, env: C_ENV(), maxBuffer: 16 * 1024 * 1024 });
448
+ } catch (error) {
449
+ if (error?.code !== 1) return null;
450
+ if (String(error.stdout ?? '').trim() || String(error.stderr ?? '').trim()) return null;
451
+ return [];
452
+ }
453
+ let pid = null;
454
+ let name = '';
455
+ for (const raw of String(out ?? '').split(/\r?\n/)) {
456
+ if (!raw) continue;
457
+ const tag = raw[0];
458
+ const value = raw.slice(1);
459
+ if (tag === 'p') { pid = pidOf(value); name = ''; if (!pid) return null; continue; }
460
+ if (tag === 'c') { name = value; continue; }
461
+ if (tag === 'f') continue;
462
+ if (tag === 'n') {
463
+ const m = /^\[?([^\]\s]*?)\]?:(\d{1,5})$/.exec(value.trim());
464
+ if (!m || !m[1] || !pid || !add(pid, name, m[1].toLowerCase(), m[2])) return null;
465
+ continue;
466
+ }
467
+ // A field SynaBun did not ask for: the output is not the one this parser knows.
468
+ return null;
469
+ }
470
+ return [...byPid.values()];
471
+ }
472
+
473
+ /**
474
+ * The executable file a running process was started from, as the OS maps it (a symbolic link already followed):
475
+ * a path, or null when it cannot be read. macOS: the first `txt` file lsof reports for the pid; Linux:
476
+ * /proc/<pid>/exe; Windows: the process's ExecutablePath.
477
+ * @param {number} pid
478
+ */
479
+ export async function readProcessExecutableAsync(pid, { platform = process.platform, run = runFile, readlink = null } = {}) {
480
+ const n = pidOf(pid);
481
+ if (!n) return null;
482
+ if (platform === 'linux') {
483
+ try {
484
+ const link = readlink || (await import('node:fs/promises')).readlink;
485
+ const target = String(await link(`/proc/${n}/exe`));
486
+ return target && !target.endsWith(' (deleted)') ? target : null;
487
+ } catch { return null; }
488
+ }
489
+ if (platform === 'win32') {
490
+ const query = powershell(`(Get-CimInstance Win32_Process -Filter "ProcessId=${n}").ExecutablePath`);
491
+ try { return firstLine(await run(query.file, query.args, query.options)) || null; } catch { return null; }
492
+ }
493
+ try {
494
+ const out = String(await run('lsof', ['-nP', '-a', '-p', String(n), '-d', 'txt', '-F', 'n'], { encoding: 'utf8', timeout: 5000, env: C_ENV() }));
495
+ const first = out.split(/\r?\n/).find((l) => l.startsWith('n'));
496
+ return first ? first.slice(1) : null;
497
+ } catch { return null; }
498
+ }
499
+
500
+ // Evidence: peer-identity.js / peer-identity.test.mjs identify MoreLogin.app and MoreLogin Helper under
501
+ // Application Support/MoreLogin/env-kit/Core/chrome_64_*. morelogin-kernel.test.mjs also records Windows
502
+ // AppData/Roaming/MoreLogin/env-kit/Core/{chrome,firefox}_64_* driver paths. isMoreLoginInstalled uses the
503
+ // MoreLogin directory on Linux. Match those directory components and kernel names, never arbitrary arguments
504
+ // (a node test runner's arguments often contain "morelogin"). Include the desktop/helpers conservatively.
505
+ const MORELOGIN_EXECUTABLE = /(?:^|\/)morelogin(?: [^/]*)?\.app(?:\/|$)|(?:^|\/)morelogin(?:\/|$)|\/env-kit\/core\/(?:chrome|firefox)_/i;
506
+ const MORELOGIN_NAME = /^morelogin(?:[ ._-]|$)/i;
507
+ const POSSIBLE_PROFILE_BROWSER = /^(?:chrome|chromium|firefox|morelogin)(?:[ ._-]|$)/i;
508
+
509
+ /**
510
+ * true when a MoreLogin process survives its API, false only after a readable process snapshot excludes it,
511
+ * null on unreadable/partial output. No process is signalled. macOS reports full executable paths via ps;
512
+ * Windows uses CIM Name/ExecutablePath; Linux resolves browser names through /proc/<pid>/exe because ps comm
513
+ * may be only a basename. Missing paths for a possible profile browser are unknown, never evidence of absence.
514
+ */
515
+ export async function moreLoginProcessesRunning({ platform = process.platform, run = runFile,
516
+ executable = (pid) => readProcessExecutableAsync(pid, { platform, run }) } = {}) {
517
+ if (!['darwin', 'linux', 'win32'].includes(platform)) return null;
518
+ let rows;
519
+ try {
520
+ if (platform === 'win32') {
521
+ const query = powershell("$WarningPreference = 'Stop'; try { $rows = @(Get-CimInstance Win32_Process -ErrorAction Stop | Select-Object ProcessId,Name,ExecutablePath); ConvertTo-Json -Compress -InputObject $rows } catch { exit 1 }");
522
+ const data = JSON.parse(await run(query.file, query.args, { ...query.options, rejectStderr: true, maxBuffer: 16 * 1024 * 1024 }));
523
+ if (!Array.isArray(data) || !data.length || data.some(p => !Number.isInteger(p?.ProcessId) || p.ProcessId < 0
524
+ || typeof p.Name !== 'string' || !p.Name.trim() || (p.ExecutablePath != null && typeof p.ExecutablePath !== 'string'))) return null;
525
+ rows = data.map(p => ({ pid: p.ProcessId, name: p.Name.trim(), path: p.ExecutablePath?.trim() || '' }));
526
+ } else {
527
+ const out = await run('ps', ['-A', '-ww', '-o', 'pid=', '-o', 'comm='],
528
+ { encoding: 'utf8', timeout: 5000, env: C_ENV(), rejectStderr: true, maxBuffer: 16 * 1024 * 1024 });
529
+ const lines = String(out ?? '').trim().split(/\r?\n/);
530
+ rows = [];
531
+ for (const line of lines) {
532
+ const m = /^\s*(\d+)\s+(\S.*)$/.exec(line);
533
+ if (!m || !pidOf(m[1])) return null;
534
+ const path = m[2].trim();
535
+ rows.push({ pid: Number(m[1]), name: path.split('/').at(-1), path: path.startsWith('/') ? path : '' });
536
+ }
537
+ }
538
+ let unknown = false;
539
+ for (const row of rows) {
540
+ if (MORELOGIN_NAME.test(row.name) || MORELOGIN_EXECUTABLE.test(row.path.replaceAll('\\', '/'))) return true;
541
+ if (!POSSIBLE_PROFILE_BROWSER.test(row.name)) continue;
542
+ let path = row.path;
543
+ if (!path && platform === 'linux') path = await executable(row.pid);
544
+ if (!path) { unknown = true; continue; }
545
+ if (MORELOGIN_EXECUTABLE.test(path.replaceAll('\\', '/'))) return true;
546
+ }
547
+ return unknown ? null : false;
548
+ } catch { return null; }
549
+ }
550
+
330
551
  /**
331
552
  * The pids that listen on a local TCP port: a list (empty: nothing listens that the user may see), or null when the
332
553
  * OS could not be asked. macOS and Linux: lsof (exit 1 with nothing printed is "none"; no lsof is null); Windows:
333
- * Get-NetTCPConnection, where an empty answer is null too (it lists every user's listeners: something answered on
334
- * the port a moment ago).
554
+ * Get-NetTCPConnection, with an explicit JSON array after a successful query. [] confirms the listener is gone;
555
+ * missing output, a failed query or malformed data is still unknown (null).
335
556
  * @param {number} port
336
557
  * @param {{ platform?: string, run?: (file: string, args: string[], options: object) => Promise<string> }} [o]
337
558
  */
@@ -341,10 +562,17 @@ export async function listPortListenersAsync(port, { platform = process.platform
341
562
  const pidsIn = (out) => [...new Set(String(out ?? '').split(/\r?\n/).map((l) => l.trim()).filter((l) => /^\d+$/.test(l)).map(Number))]
342
563
  .filter((n) => n > 0 && n !== selfPid);
343
564
  if (platform === 'win32') {
344
- const query = powershell(`Get-NetTCPConnection -LocalPort ${p} -State Listen -ErrorAction SilentlyContinue | ForEach-Object { $_.OwningProcess }`);
565
+ // Filter in CIM: querying all TCP connections on every gone() poll is expensive on a busy machine. Only
566
+ // the cmdlet's specific CIM "no matching objects" error proves absence. Denials/timeouts/warnings do not.
567
+ const query = powershell(`$WarningPreference = 'Stop'; try { $listeners = @(Get-NetTCPConnection -LocalPort ${p} -State Listen -ErrorAction Stop); ConvertTo-Json -Compress -InputObject @($listeners | ForEach-Object { $_.OwningProcess }) } catch { ConvertTo-Json -Compress -InputObject @{ category = [string]$_.CategoryInfo.Category; reason = [string]$_.CategoryInfo.Reason; id = [string]$_.FullyQualifiedErrorId } }`);
345
568
  try {
346
- const pids = pidsIn(await run(query.file, query.args, query.options));
347
- return pids.length ? pids : null;
569
+ const pids = JSON.parse(await run(query.file, query.args, { ...query.options, rejectStderr: true }));
570
+ // Get-NetTCPConnection's no-match exception is CimJobException (some CIM versions report CimException).
571
+ // Do not use localized error text or a generic ObjectNotFound: a missing command/module is not absence.
572
+ if (pids?.category === 'ObjectNotFound' && ['CimJobException', 'CimException'].includes(pids.reason)
573
+ && /^CmdletizationQuery_NotFound(?:_[A-Za-z]+)?,Get-NetTCPConnection$/.test(pids.id)) return [];
574
+ if (!Array.isArray(pids) || pids.some(n => !Number.isSafeInteger(n) || n <= 0)) return null;
575
+ return [...new Set(pids)].filter(n => n !== selfPid);
348
576
  } catch {
349
577
  return null;
350
578
  }
@@ -79,6 +79,9 @@ export const ADMIN_ONLY_PREFIXES = Object.freeze([
79
79
  // The Skills Service's installs, rollbacks and removals, the move of the old bridges, and its settings: the
80
80
  // owner's, from the app's own page (lib/skills/api-v2.js refuses guests and agents on its own too).
81
81
  '/api/skills-studio/v2/installations', '/api/skills-studio/v2/migrations', '/api/skills-studio/v2/config',
82
+ // Agent definitions (their instructions, what they may touch) and their runs: the owner's (lib/agents-studio-api.js
83
+ // refuses guests on every route on its own too). The Assistant and agents reach it with their own headers.
84
+ '/api/agents-studio',
82
85
  '/api/tunnel/start', '/api/tunnel/stop',
83
86
  '/api/bridges', '/api/keybinds',
84
87
  '/api/cli',
@@ -0,0 +1,33 @@
1
+ // Where macOS saves screenshots, for the screenshot watcher (server.js: a new screenshot is pasted on the whiteboard).
2
+ //
3
+ // The folder chosen in the Screenshot app is `defaults read com.apple.screencapture location`. When none was ever
4
+ // chosen (the usual case), `defaults` exits 1 and writes "Could not find key 'location' in domain
5
+ // 'com.apple.screencapture'" to stderr: that is the default (~/Desktop), not an error, so its stderr is never passed
6
+ // through to SynaBun's own output (it used to show up in the boot log as a bare "Error: …" line).
7
+
8
+ import { execFileSync } from 'node:child_process';
9
+ import { existsSync } from 'node:fs';
10
+ import { homedir } from 'node:os';
11
+ import { join } from 'node:path';
12
+
13
+ export const DEFAULTS = '/usr/bin/defaults';
14
+ export const SCREENCAPTURE_LOCATION_ARGS = Object.freeze(['read', 'com.apple.screencapture', 'location']);
15
+ const READ_TIMEOUT_MS = 5000;
16
+
17
+ /**
18
+ * The folder macOS saves screenshots in: the one set in the Screenshot app when it exists, else ~/Desktop.
19
+ * Never throws and never writes to the console.
20
+ * @param {{ run?: typeof execFileSync, exists?: (path: string) => boolean, home?: string }} [o] tests inject these.
21
+ * @returns {string}
22
+ */
23
+ export function macScreenshotDir({ run = execFileSync, exists = existsSync, home = homedir() } = {}) {
24
+ let dir = '';
25
+ try {
26
+ dir = String(run(DEFAULTS, [...SCREENCAPTURE_LOCATION_ARGS], {
27
+ encoding: 'utf8', timeout: READ_TIMEOUT_MS, windowsHide: true, stdio: ['ignore', 'pipe', 'ignore'],
28
+ }) ?? '').trim();
29
+ } catch { dir = ''; } // never set (exit 1), or `defaults` could not run: the default
30
+ let found = false;
31
+ try { found = !!dir && exists(dir) === true; } catch { found = false; }
32
+ return found ? dir : join(home, 'Desktop');
33
+ }
@@ -216,7 +216,7 @@ export function createSkillCreations({
216
216
  if (!ok) throw new CreationError(400, problems.length === 1 ? `The request is not valid (${problems[0].field}: ${problems[0].code}).` : `${problems.length} problems with the request.`, 'invalid_request', { problems });
217
217
  const missing = request.sources.find((s) => typeof gather[s.kind === 'import' ? 'importSource' : s.kind] !== 'function');
218
218
  if (missing) throw new CreationError(409, `This server cannot read a ${missing.kind} source.`, 'source_unavailable', { problems: [{ field: 'sources', code: `${missing.kind}-unavailable` }] });
219
- if (request.sources.some((s) => s.kind === 'url') && !canBrowse()) throw new CreationError(409, 'A web page is read with the SynaBun browser, which cannot open pages now (Settings → Browser).', 'needs_browser');
219
+ if (request.sources.some((s) => s.kind === 'url') && !canBrowse()) throw new CreationError(409, 'A web page is read with the SynaBun browser, which cannot open pages now (Settings → Browser, or the profile chosen in Settings → Connected tools → MoreLogin (Default AI browser)).', 'needs_browser');
220
220
  // A project target is one of the registered projects (the install plan reads its folders).
221
221
  const registered = new Set(safeList(projects).map((p) => resolve(String(p))));
222
222
  const strange = request.targets.map((t, i) => ({ t, i })).filter(({ t }) => t.scope === 'project' && !registered.has(resolve(t.projectPath)));
@@ -24,6 +24,32 @@
24
24
  ],
25
25
  "bridges": {
26
26
  "codex": {
27
+ "agent-forge": [
28
+ {
29
+ "digest": "55c19a925599f4e5f93c45b52eabeaa8a9b72f70c8b1aa30055cd45ecc45188c",
30
+ "sep": "\\",
31
+ "generators": [
32
+ "g3"
33
+ ],
34
+ "skillMd": [
35
+ "f307dffbdeb0"
36
+ ],
37
+ "firstCommit": "28fd65720aa8",
38
+ "firstDate": "2026-11-15"
39
+ },
40
+ {
41
+ "digest": "efe8e3151f97e31a09cc9ba52635da53eb55d79c3341856b99769f17795352fd",
42
+ "sep": "/",
43
+ "generators": [
44
+ "g3"
45
+ ],
46
+ "skillMd": [
47
+ "f307dffbdeb0"
48
+ ],
49
+ "firstCommit": "28fd65720aa8",
50
+ "firstDate": "2026-11-15"
51
+ }
52
+ ],
27
53
  "leonardo": [
28
54
  {
29
55
  "digest": "7865862f6cb04aba6b68641bfa5d308b16c9c78ac3bbc7f486a8d12d0094724b",
@@ -212,6 +238,20 @@
212
238
  ]
213
239
  },
214
240
  "opencode": {
241
+ "agent-forge": [
242
+ {
243
+ "digest": "6d42616e24a211f48b06ea8a35ed17913395c7c3b06a4b079e9c6c01c73ce3b6",
244
+ "sep": "any",
245
+ "generators": [
246
+ "g3"
247
+ ],
248
+ "skillMd": [
249
+ "f307dffbdeb0"
250
+ ],
251
+ "firstCommit": "28fd65720aa8",
252
+ "firstDate": "2026-11-15"
253
+ }
254
+ ],
215
255
  "leonardo": [
216
256
  {
217
257
  "digest": "64b005834dd226dfc4287e2b27e8a6931a386268a5907494c30ccbaec4aeab32",
@@ -0,0 +1,56 @@
1
+ // Source-scoped reads let run events update their labels without rereading unrelated Studios.
2
+ import { reviewCountOf } from '../public/shared/agents/studio/ax-library.js';
3
+ import { needsAttention, OVERDUE_AFTER } from '../public/shared/schedules-view.js';
4
+ import { runAwaitsAnswer } from '../public/shared/sidepanel-session-status.js';
5
+ import { scheduleMarked, templateMarked } from './automation-approval.js';
6
+
7
+ // The scheduler stamps scheduleId even for Run now and quick timers. Older descriptors can
8
+ // still identify a scheduler launch by its source (resolveScheduleRunPresentation).
9
+ const SCHEDULE_SOURCES = new Set(['schedule', 'schedule-manual', 'quick-timer', 'quick-timer-manual']);
10
+
11
+ function loopAttention(runs) {
12
+ const waiting = { automations: false, schedules: false };
13
+ for (const run of runs) {
14
+ // The dispatcher owns task runs, including their route/permission cards and removal.
15
+ if (!runAwaitsAnswer(run) || run.runMode === 'task' || run.source === 'assistant') continue;
16
+ if (run.scheduleId || SCHEDULE_SOURCES.has(run.source)) waiting.schedules = true;
17
+ else if (run.source === 'manual') waiting.automations = true;
18
+ }
19
+ return waiting;
20
+ }
21
+
22
+ function scheduleAttention(rows, now) {
23
+ let recheckInMs = null;
24
+ for (const schedule of rows) {
25
+ if (scheduleMarked(schedule) || needsAttention(schedule, now)) return { waiting: true, recheckInMs: null };
26
+ // A missed fire can become actionable without any record changing. The view uses a strict inequality.
27
+ const delay = Date.parse(schedule.nextRun) + OVERDUE_AFTER + 1 - now;
28
+ if (schedule.enabled && delay > 0 && (recheckInMs === null || delay < recheckInMs)) recheckInMs = delay;
29
+ }
30
+ return { waiting: false, recheckInMs };
31
+ }
32
+
33
+ export function registerStudioAttention(app, { ownerPage, agents, teams, reviews, templates, schedules, workers, nativeRuns }) {
34
+ const readers = {
35
+ drafts: () => reviewCountOf({ agents: agents() }),
36
+ teams: () => teams().some(team => team.status === 'needs_attention' || team.status === 'ready'),
37
+ skills: () => reviews().some(review => review.state === 'pending' && !review.supersededBy),
38
+ automations: () => templates().some(templateMarked),
39
+ schedules: () => scheduleAttention(schedules(), Date.now()),
40
+ workers,
41
+ runs: () => loopAttention(nativeRuns()),
42
+ };
43
+ app.get('/api/studio-attention', ownerPage, (req, res) => {
44
+ const sources = req.query.sources === undefined ? Object.keys(readers) : String(req.query.sources).split(',');
45
+ if (!sources.every(key => Object.hasOwn(readers, key))) return res.sendStatus(400);
46
+ const answer = {};
47
+ for (const key of new Set(sources)) {
48
+ try { answer[key] = readers[key](); }
49
+ catch (error) {
50
+ console.warn(`[studio-attention] ${key} unavailable:`, error.message);
51
+ answer[key] = null;
52
+ }
53
+ }
54
+ res.set('Cache-Control', 'no-store').json(answer);
55
+ });
56
+ }