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
@@ -0,0 +1,181 @@
1
+ // ═══════════════════════════════════════════
2
+ // SynaBun — Teams: a team's record, read from and written to the store's journal
3
+ // ═══════════════════════════════════════════
4
+ //
5
+ // The coordination store's journal (lib/coordination/store.js `journal`) is append-only: an entry says "this team
6
+ // (or this slice) is in this state now", with a little data. This module is the one reading of it the teams
7
+ // modules share:
8
+ //
9
+ // - a team's record is its own entries folded together, oldest first: the newest entry's state is the team's
10
+ // state, and each entry's data is laid over what came before (a key written later replaces the earlier value);
11
+ // - a slice's record is the same fold over that slice's entries.
12
+ //
13
+ // So a step writes only what it changes, and recovery reads where a team stood from the same entries.
14
+ //
15
+ // What is written when (the full list is lib/teams/README.md → The journal):
16
+ // team creating → planned → running ⇄ integrating → ready → landing → merged, or failed / cancelled
17
+ // slice planned (its task) → pending → running → done | rejected → integrating → integrated | conflict |
18
+ // tests-failed, or failed / cancelled
19
+ //
20
+ // The plan is stored in pieces, because one entry holds at most 64 KB: the team's `creating` entry has the plan
21
+ // without the slices' task texts and owned paths, each slice's `planned` entry has its task and its `pending`
22
+ // entry its owned paths (`planPieces` cuts a plan that way, `record` puts it together again).
23
+ //
24
+ // Every entry is also announced on the store's event log (kind `team.state` / `slice.state`, addressed to nobody,
25
+ // id `team:<team>:journal:<entry id>`), so a scheduler can wake on `store.subscribe({ teamId })` instead of polling.
26
+
27
+ import { EVENT_KINDS } from '../coordination/store.js';
28
+ import { INTEGRATION_SLICE_ID, normalizeTeamPlan } from './schema.js';
29
+
30
+ /** Team states a team does not leave by itself. `merged` and `cancelled` may still have worktrees to remove. */
31
+ export const TERMINAL_TEAM_STATES = Object.freeze(['merged', 'failed', 'cancelled', 'completed']);
32
+ /** Slice states in which the slice's work is not under way and not waiting to be joined. */
33
+ export const SETTLED_SLICE_STATES = Object.freeze(['integrated', 'cancelled', 'failed', 'completed']);
34
+
35
+ export class TeamError extends Error {
36
+ /** @param {string} code @param {string} message @param {object} [extra] */
37
+ constructor(code, message, extra = {}) {
38
+ super(message);
39
+ this.name = 'TeamError';
40
+ this.code = code;
41
+ Object.assign(this, extra);
42
+ }
43
+ }
44
+
45
+ /** A refusal every teams function answers with instead of throwing: `{ ok: false, code, message, ... }`. */
46
+ export const refuse = (code, message, extra = {}) => ({ ok: false, code, message, ...extra });
47
+
48
+ const PAGE = 500;
49
+
50
+ /**
51
+ * @param {object} deps
52
+ * @param {object} deps.store a coordination store (lib/coordination/store.js)
53
+ * @param {(tag: string, detail: any) => void} [deps.log]
54
+ */
55
+ export function createTeamState({ store, log = () => {} } = {}) {
56
+ if (!store || typeof store.journal?.write !== 'function') throw new TeamError('STORE_REQUIRED', 'The teams modules need a coordination store (lib/coordination/store.js).');
57
+
58
+ function entriesOf(teamId) {
59
+ const out = [];
60
+ let afterId = 0;
61
+ for (;;) {
62
+ const page = store.journal.read({ teamId, afterId, limit: PAGE });
63
+ out.push(...page);
64
+ if (page.length < PAGE) return out;
65
+ afterId = page[page.length - 1].id;
66
+ }
67
+ }
68
+
69
+ function announce(entry) {
70
+ try {
71
+ store.append({
72
+ id: `team:${entry.teamId}:journal:${entry.id}`,
73
+ teamId: entry.teamId,
74
+ runId: entry.runId || null,
75
+ kind: entry.sliceId ? EVENT_KINDS.SLICE_STATE : EVENT_KINDS.TEAM_STATE,
76
+ payload: { teamId: entry.teamId, sliceId: entry.sliceId || null, state: entry.state, journalId: entry.id },
77
+ });
78
+ } catch (error) {
79
+ log('teams:announce-failed', { teamId: entry.teamId, error: error?.message || String(error) });
80
+ }
81
+ }
82
+
83
+ /**
84
+ * A team as the journal has it, or null for a team it does not know.
85
+ * @returns {null | { teamId: string, state: string, createdAt: string, updatedAt: string, plan: object,
86
+ * projectPath: string, baseCommit: string, baseBranch: string|null, testCommand: any, integration: object,
87
+ * removed: boolean, slices: Record<string, object>, [key: string]: any }}
88
+ */
89
+ function record(teamId) {
90
+ const entries = entriesOf(teamId);
91
+ if (!entries.length) return null;
92
+ const team = {};
93
+ const slices = {};
94
+ let first = null;
95
+ let last = null;
96
+ for (const entry of entries) {
97
+ if (!entry.sliceId) {
98
+ Object.assign(team, entry.data || {});
99
+ team.state = entry.state;
100
+ first = first || entry;
101
+ last = entry;
102
+ continue;
103
+ }
104
+ const slice = slices[entry.sliceId] || (slices[entry.sliceId] = { id: entry.sliceId });
105
+ Object.assign(slice, entry.data || {});
106
+ slice.id = entry.sliceId;
107
+ slice.state = entry.state;
108
+ slice.runId = entry.runId || slice.runId || null;
109
+ slice.updatedAt = entry.createdAt;
110
+ }
111
+ if (!first) return null;
112
+ // The plan whole again: the team's entry has it without the tasks, each slice's own entries have its task.
113
+ const stored = team.plan && typeof team.plan === 'object' ? team.plan : { teamId, slices: [] };
114
+ const plan = normalizeTeamPlan({
115
+ ...stored,
116
+ slices: (stored.slices || []).map((slice) => ({
117
+ ...slice,
118
+ task: slices[slice.id]?.task || slice.task || '',
119
+ ownedPaths: slices[slice.id]?.ownedPaths || slice.ownedPaths || [],
120
+ })),
121
+ });
122
+ return {
123
+ ...team,
124
+ teamId,
125
+ plan,
126
+ projectPath: plan.projectPath,
127
+ baseCommit: plan.baseCommit,
128
+ baseBranch: team.baseBranch ?? null,
129
+ testCommand: team.testCommand ?? null,
130
+ integration: team.integration && typeof team.integration === 'object' ? team.integration : { head: plan.baseCommit, lastGood: plan.baseCommit, tests: null },
131
+ removed: team.removed === true,
132
+ slices,
133
+ createdAt: first.createdAt,
134
+ updatedAt: last.createdAt,
135
+ };
136
+ }
137
+
138
+ /** Record that a team is in a state now, with what this step changes. */
139
+ function writeTeam(teamId, state, data = {}) {
140
+ const entry = store.journal.write({ teamId, state, data });
141
+ announce(entry);
142
+ return entry;
143
+ }
144
+
145
+ /** Record that a slice is in a state now, with what this step changes. */
146
+ function writeSlice(teamId, sliceId, state, data = {}, runId = null) {
147
+ if (sliceId === INTEGRATION_SLICE_ID) throw new TeamError('RESERVED_SLICE', '"integration" is the team\'s integration worktree, not a slice.');
148
+ const entry = store.journal.write({ teamId, sliceId, state, runId, data });
149
+ announce(entry);
150
+ return entry;
151
+ }
152
+
153
+ /** Every team the journal knows (its own newest entry), oldest team first; `states` narrows it. */
154
+ function teams({ states = null } = {}) {
155
+ return store.journal.teams(states ? { states } : {});
156
+ }
157
+
158
+ return { record, writeTeam, writeSlice, teams, entriesOf };
159
+ }
160
+
161
+ /**
162
+ * A plan cut into the pieces the journal stores: `team` (the plan without tasks and owned paths) and, per slice,
163
+ * `task` and `ownedPaths`. Each piece fits one journal entry whatever the plan's size.
164
+ */
165
+ export function planPieces(plan) {
166
+ const value = normalizeTeamPlan(plan);
167
+ return {
168
+ team: { ...value, slices: value.slices.map(({ task: _task, ownedPaths: _owned, ...rest }) => rest) },
169
+ slices: value.slices.map((slice) => ({ id: slice.id, task: slice.task, ownedPaths: slice.ownedPaths })),
170
+ };
171
+ }
172
+
173
+ /** The slice of a record's plan, or null. */
174
+ export function planSlice(record, sliceId) {
175
+ return record?.plan?.slices?.find((slice) => slice.id === sliceId) || null;
176
+ }
177
+
178
+ /** The state of a slice in a record: `pending` until it has an entry of its own that says otherwise. */
179
+ export function sliceState(record, sliceId) {
180
+ return record?.slices?.[sliceId]?.state || 'pending';
181
+ }
@@ -0,0 +1,86 @@
1
+ // ═══════════════════════════════════════════
2
+ // SynaBun — Teams: the default test-command runner
3
+ // ═══════════════════════════════════════════
4
+ //
5
+ // A team's test command is run on each commit of the integration branch, in the integration worktree, before a
6
+ // slice counts as joined (lib/teams/integration.js). The runner is injected there; this is the default one.
7
+ //
8
+ // It starts the command the owner configured, the way they would type it: text goes through the shell, a list of
9
+ // arguments is started directly. It runs with the server's own rights and is not sandboxed: the code it runs is the
10
+ // team's work, so a scheduler that wants the tests confined supplies its own runner. What it does keep away is
11
+ // SynaBun's own credentials: every SYNABUN_* and TYPESAFE_* variable is left out of the command's environment, and
12
+ // so is anything that would aim git at another repository.
13
+ //
14
+ // It answers, never throws: `{ ok, exitCode, signal, timedOut, output, durationMs }`. `output` is the end of what
15
+ // the command wrote (both streams), bounded.
16
+
17
+ import { spawn } from 'node:child_process';
18
+
19
+ export const TEAM_TEST_TIMEOUT_MS = 30 * 60_000;
20
+
21
+ const DROPPED_ENV = /^(?:SYNABUN_|TYPESAFE_|GIT_DIR$|GIT_WORK_TREE$|GIT_INDEX_FILE$|GIT_COMMON_DIR$|GIT_NAMESPACE$|GIT_PREFIX$)/;
22
+
23
+ /** The environment a test command gets: the given one without SynaBun's own variables. */
24
+ export function testEnv(env = process.env) {
25
+ const out = {};
26
+ for (const [name, value] of Object.entries(env)) if (!DROPPED_ENV.test(name) && value !== undefined) out[name] = value;
27
+ return out;
28
+ }
29
+
30
+ /**
31
+ * @param {object} [options]
32
+ * @param {object} [options.env] the environment to start from (default: this process's)
33
+ * @param {number} [options.timeoutMs] how long one run may take (default 30 minutes)
34
+ * @param {number} [options.outputBytes] how much of the output's end is kept (default 16,000 characters)
35
+ * @returns {(run: { cwd: string, command: string|string[], commit?: string, teamId?: string, sliceId?: string,
36
+ * signal?: AbortSignal, timeoutMs?: number }) => Promise<{ ok: boolean, exitCode: number|null, signal: string|null,
37
+ * timedOut: boolean, output: string, durationMs: number, error?: string }>}
38
+ */
39
+ export function createTestRunner({ env = process.env, timeoutMs = TEAM_TEST_TIMEOUT_MS, outputBytes = 16_000 } = {}) {
40
+ return function runTests({ cwd, command, signal = null, timeoutMs: limit = timeoutMs } = {}) {
41
+ const started = Date.now();
42
+ return new Promise((done) => {
43
+ const text = typeof command === 'string';
44
+ if (!cwd || (!text && !(Array.isArray(command) && command.length))) {
45
+ done({ ok: false, exitCode: null, signal: null, timedOut: false, output: '', durationMs: 0, error: 'no test command, or no folder to run it in' });
46
+ return;
47
+ }
48
+ let child;
49
+ let tail = '';
50
+ let timedOut = false;
51
+ let settled = false;
52
+ const keep = (chunk) => { tail = (tail + String(chunk)).slice(-outputBytes); };
53
+ const finish = (result) => {
54
+ if (settled) return;
55
+ settled = true;
56
+ clearTimeout(timer);
57
+ signal?.removeEventListener?.('abort', stop);
58
+ done({ timedOut, output: tail, durationMs: Date.now() - started, ...result });
59
+ };
60
+ // The command and what it started: its own process group where the platform has one.
61
+ const stop = () => {
62
+ if (!child || child.exitCode !== null) return;
63
+ try { if (process.platform !== 'win32' && child.pid) process.kill(-child.pid, 'SIGTERM'); else child.kill('SIGTERM'); } catch { /* gone already */ }
64
+ setTimeout(() => {
65
+ try { if (process.platform !== 'win32' && child.pid) process.kill(-child.pid, 'SIGKILL'); else child.kill('SIGKILL'); } catch { /* gone already */ }
66
+ }, 5000).unref();
67
+ };
68
+ const timer = setTimeout(() => { timedOut = true; stop(); }, Math.max(1000, Number(limit) || timeoutMs));
69
+ try {
70
+ child = text
71
+ ? spawn(command, { cwd, env: testEnv(env), shell: true, stdio: ['ignore', 'pipe', 'pipe'], windowsHide: true, detached: process.platform !== 'win32' })
72
+ : spawn(command[0], command.slice(1), { cwd, env: testEnv(env), shell: false, stdio: ['ignore', 'pipe', 'pipe'], windowsHide: true, detached: process.platform !== 'win32' });
73
+ } catch (error) {
74
+ finish({ ok: false, exitCode: null, signal: null, error: error?.message || String(error) });
75
+ return;
76
+ }
77
+ child.stdout?.on('data', keep);
78
+ child.stderr?.on('data', keep);
79
+ child.on('error', (error) => finish({ ok: false, exitCode: null, signal: null, error: error?.message || String(error) }));
80
+ child.on('close', (code, sig) => finish({ ok: code === 0 && !timedOut, exitCode: code, signal: sig || null }));
81
+ if (signal) {
82
+ if (signal.aborted) stop(); else signal.addEventListener('abort', stop, { once: true });
83
+ }
84
+ });
85
+ };
86
+ }
@@ -0,0 +1,99 @@
1
+ // ═══════════════════════════════════════════
2
+ // SynaBun — Teams: the integration tests under the worker sandbox (Agents system, phase P4)
3
+ // ═══════════════════════════════════════════
4
+ //
5
+ // A team's test command runs on each commit of the integration branch (lib/teams/integration.js). What it runs is
6
+ // the team's work: code several workers wrote, each held to its own worktree while it wrote it. The default runner
7
+ // (lib/teams/test-runner.js) starts it with the server's own rights, which would hand that code what its authors
8
+ // never had: SynaBun's control port (and with it the owner's authority), SynaBun's data home, and the owner's
9
+ // checkout of the project.
10
+ //
11
+ // So the scheduler's runner starts the command the way a protected worker's process tree is started
12
+ // (lib/worker-sandbox.js): on macOS, under sandbox-exec with a profile that blocks SynaBun's own port and its
13
+ // reserved relay ports on every address, blocks reads and writes of SynaBun's data home, and lets the command
14
+ // write in the project only inside the team's integration worktree (the owner's checkout and the slices'
15
+ // worktrees stay as they are, whatever a test does). The internet, reads elsewhere, the temp folder and the
16
+ // toolchains' own caches work as normal, so the project's tests run as they do for a worker.
17
+ //
18
+ // NOT EQUIVALENT OFF macOS. Where sandbox-exec is not there (Linux, Windows, a Mac without it) the command runs
19
+ // with the default runner, unconfined, and every result says so (`sandbox: 'none'`, with why).
20
+
21
+ import { mkdirSync, writeFileSync } from 'node:fs';
22
+ import { join } from 'node:path';
23
+ import { SANDBOX_EXEC, buildWorkerSandboxProfile, canonicalPath, sandboxExecAvailable, sandboxSupported } from '../worker-sandbox.js';
24
+ import { createTestRunner } from './test-runner.js';
25
+
26
+ const sexpr = (value) => `"${String(value).replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`;
27
+
28
+ /**
29
+ * The Seatbelt profile of one test run: the worker profile (ports, the data home), then the project's own files:
30
+ * written only inside the integration worktree.
31
+ * @param {object} o
32
+ * @param {string} o.projectPath the project (the owner's checkout is its root)
33
+ * @param {string} o.cwd the integration worktree
34
+ * @param {number|null} [o.serverPort]
35
+ * @param {{ from: number, to: number }|null} [o.reservedPortRange]
36
+ * @param {string[]} [o.denyPaths] trees the command neither reads nor writes (SynaBun's data home)
37
+ * @param {string} [o.note]
38
+ */
39
+ export function teamTestProfile({ projectPath, cwd, serverPort = null, reservedPortRange = null, denyPaths = [], note = '' } = {}) {
40
+ const base = buildWorkerSandboxProfile({
41
+ denyPorts: Number(serverPort) > 0 ? [Number(serverPort)] : [],
42
+ denyPortRange: reservedPortRange || null,
43
+ denyPaths, allowPaths: [], note,
44
+ });
45
+ const lines = [base.replace(/\n+$/, '')];
46
+ if (projectPath) {
47
+ lines.push('; the project: written only inside the team\'s integration worktree');
48
+ lines.push(`(deny file-write* (subpath ${sexpr(canonicalPath(projectPath))}))`);
49
+ if (cwd) lines.push(`(allow file-write* (subpath ${sexpr(canonicalPath(cwd))}))`);
50
+ }
51
+ return `${lines.join('\n')}\n`;
52
+ }
53
+
54
+ /**
55
+ * A test-command runner for createTeams({ runTests }) that confines the command where the platform can.
56
+ *
57
+ * @param {object} [o]
58
+ * @param {() => number|null} [o.serverPort] SynaBun's own port
59
+ * @param {() => ({ from: number, to: number }|null)} [o.reservedPortRange] the ports SynaBun keeps for its serves
60
+ * @param {() => string[]} [o.denyPaths] trees the tests must not read or write (the data home)
61
+ * @param {string} o.profileDir where the profiles are written (a folder of SynaBun's own)
62
+ * @param {Function} [o.base] the runner that starts the command (default: createTestRunner())
63
+ * @param {string} [o.platform]
64
+ * @param {() => boolean} [o.available] is sandbox-exec usable (default: the boot probe)
65
+ * @param {(tag: string, detail: any) => void} [o.log]
66
+ */
67
+ export function createSandboxedTestRunner({
68
+ serverPort = () => null, reservedPortRange = () => null, denyPaths = () => [], profileDir,
69
+ base = createTestRunner(), platform = process.platform, available = () => sandboxExecAvailable(), log = () => {},
70
+ } = {}) {
71
+ let warned = false;
72
+ return async function runTests(run = {}) {
73
+ const text = typeof run.command === 'string';
74
+ const usable = sandboxSupported(platform) && (() => { try { return available() === true; } catch { return false; } })();
75
+ // No command (or no folder): nothing to confine; the base runner says what is missing.
76
+ const has = text ? run.command.trim().length > 0 : Array.isArray(run.command) && run.command.length > 0;
77
+ if (!usable || !profileDir || !run.cwd || !has) {
78
+ if (!usable && !warned) { warned = true; try { log('teams:tests-unconfined', `sandbox-exec is not available on ${platform}: integration tests run unconfined`); } catch { /* a log never stops a test */ } }
79
+ const out = await base(run);
80
+ return { ...out, sandbox: 'none', sandboxNote: usable ? 'no profile folder' : `sandbox-exec is not available on ${platform}` };
81
+ }
82
+ let profilePath = null;
83
+ try {
84
+ mkdirSync(profileDir, { recursive: true });
85
+ profilePath = join(profileDir, `${String(run.teamId || 'team').replace(/[^A-Za-z0-9._-]/g, '_').slice(0, 64)}.sb`);
86
+ writeFileSync(profilePath, teamTestProfile({
87
+ projectPath: run.projectPath || null, cwd: run.cwd, serverPort: serverPort(), reservedPortRange: reservedPortRange(),
88
+ denyPaths: denyPaths() || [], note: `synabun team tests ${run.teamId || ''} ${run.sliceId || ''}`.trim(),
89
+ }), { mode: 0o600 });
90
+ } catch (error) {
91
+ // Never unconfined because a profile could not be written: the run counts as failed, and says why.
92
+ return { ok: false, exitCode: null, signal: null, timedOut: false, output: '', durationMs: 0, sandbox: 'failed', error: `the test sandbox profile could not be written: ${error?.message || error}` };
93
+ }
94
+ // Text is what the owner would type: it goes through the shell, inside the sandbox. A list is started directly.
95
+ const argv = text ? [SANDBOX_EXEC, '-f', profilePath, '/bin/sh', '-c', run.command] : [SANDBOX_EXEC, '-f', profilePath, ...run.command];
96
+ const out = await base({ ...run, command: argv });
97
+ return { ...out, sandbox: 'seatbelt' };
98
+ };
99
+ }