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.
- package/CHANGELOG.md +38 -0
- package/README.md +1 -1
- package/browser-extension/content.js +169 -0
- package/browser-extension/engine.js +477 -0
- package/browser-extension/icons/icon-128.png +0 -0
- package/browser-extension/icons/icon-16.png +0 -0
- package/browser-extension/icons/icon-32.png +0 -0
- package/browser-extension/icons/icon-48.png +0 -0
- package/browser-extension/icons/status-off-16.png +0 -0
- package/browser-extension/icons/status-off-32.png +0 -0
- package/browser-extension/icons/status-off-48.png +0 -0
- package/browser-extension/icons/status-on-16.png +0 -0
- package/browser-extension/icons/status-on-32.png +0 -0
- package/browser-extension/icons/status-on-48.png +0 -0
- package/browser-extension/manifest.json +56 -0
- package/browser-extension/popup-strings.js +244 -0
- package/browser-extension/popup-view.js +151 -0
- package/browser-extension/popup.css +165 -0
- package/browser-extension/popup.html +105 -0
- package/browser-extension/popup.js +347 -0
- package/browser-extension/protocol.js +226 -0
- package/browser-extension/service-worker.js +267 -0
- package/browser-extension/setup-content.js +36 -0
- package/browser-extension/tokens.css +326 -0
- package/docs/browser-extension-bridge.md +84 -0
- package/docs/whatsapp.md +1 -1
- package/mcp-server/dist/http.d.ts +2 -0
- package/mcp-server/dist/http.d.ts.map +1 -1
- package/mcp-server/dist/http.js +9 -1
- package/mcp-server/dist/http.js.map +1 -1
- package/mcp-server/dist/index.d.ts +11 -0
- package/mcp-server/dist/index.d.ts.map +1 -1
- package/mcp-server/dist/index.js +38 -3
- package/mcp-server/dist/index.js.map +1 -1
- package/mcp-server/dist/services/browser-route-flow.d.ts +6 -2
- package/mcp-server/dist/services/browser-route-flow.d.ts.map +1 -1
- package/mcp-server/dist/services/browser-route-flow.js +10 -3
- package/mcp-server/dist/services/browser-route-flow.js.map +1 -1
- package/mcp-server/dist/services/codex-config-heal.d.ts.map +1 -1
- package/mcp-server/dist/services/codex-config-heal.js +7 -0
- package/mcp-server/dist/services/codex-config-heal.js.map +1 -1
- package/mcp-server/dist/services/neural-interface.d.ts +94 -3
- package/mcp-server/dist/services/neural-interface.d.ts.map +1 -1
- package/mcp-server/dist/services/neural-interface.js +168 -23
- package/mcp-server/dist/services/neural-interface.js.map +1 -1
- package/mcp-server/dist/services/team-context.d.ts +18 -0
- package/mcp-server/dist/services/team-context.d.ts.map +1 -0
- package/mcp-server/dist/services/team-context.js +29 -0
- package/mcp-server/dist/services/team-context.js.map +1 -0
- package/mcp-server/dist/services/tool-catalog.d.ts +5 -2
- package/mcp-server/dist/services/tool-catalog.d.ts.map +1 -1
- package/mcp-server/dist/services/tool-catalog.js +22 -6
- package/mcp-server/dist/services/tool-catalog.js.map +1 -1
- package/mcp-server/dist/services/tool-list.d.ts.map +1 -1
- package/mcp-server/dist/services/tool-list.js +4 -0
- package/mcp-server/dist/services/tool-list.js.map +1 -1
- package/mcp-server/dist/services/tool-runtime.d.ts +8 -1
- package/mcp-server/dist/services/tool-runtime.d.ts.map +1 -1
- package/mcp-server/dist/services/tool-runtime.js +18 -1
- package/mcp-server/dist/services/tool-runtime.js.map +1 -1
- package/mcp-server/dist/tools/agent-definition.d.ts +133 -0
- package/mcp-server/dist/tools/agent-definition.d.ts.map +1 -0
- package/mcp-server/dist/tools/agent-definition.js +483 -0
- package/mcp-server/dist/tools/agent-definition.js.map +1 -0
- package/mcp-server/dist/tools/agents.d.ts +91 -9
- package/mcp-server/dist/tools/agents.d.ts.map +1 -1
- package/mcp-server/dist/tools/agents.js +161 -20
- package/mcp-server/dist/tools/agents.js.map +1 -1
- package/mcp-server/dist/tools/browser-advanced.d.ts +8 -1
- package/mcp-server/dist/tools/browser-advanced.d.ts.map +1 -1
- package/mcp-server/dist/tools/browser-advanced.js +70 -6
- package/mcp-server/dist/tools/browser-advanced.js.map +1 -1
- package/mcp-server/dist/tools/git-tools.d.ts +4 -2
- package/mcp-server/dist/tools/git-tools.d.ts.map +1 -1
- package/mcp-server/dist/tools/git-tools.js +283 -2
- package/mcp-server/dist/tools/git-tools.js.map +1 -1
- package/mcp-server/dist/tools/morelogin.d.ts +8 -2
- package/mcp-server/dist/tools/morelogin.d.ts.map +1 -1
- package/mcp-server/dist/tools/morelogin.js +22 -5
- package/mcp-server/dist/tools/morelogin.js.map +1 -1
- package/mcp-server/dist/tools/team.d.ts +32 -0
- package/mcp-server/dist/tools/team.d.ts.map +1 -0
- package/mcp-server/dist/tools/team.js +87 -0
- package/mcp-server/dist/tools/team.js.map +1 -0
- package/mcp-server/package-lock.json +2 -2
- package/mcp-server/package.json +1 -1
- package/mcp-server/src/http.ts +9 -1
- package/mcp-server/src/index.ts +34 -4
- package/mcp-server/src/services/browser-route-flow.ts +12 -5
- package/mcp-server/src/services/codex-config-heal.ts +7 -0
- package/mcp-server/src/services/neural-interface.ts +190 -29
- package/mcp-server/src/services/team-context.ts +27 -0
- package/mcp-server/src/services/tool-catalog.ts +26 -8
- package/mcp-server/src/services/tool-list.ts +4 -0
- package/mcp-server/src/services/tool-runtime.ts +21 -2
- package/mcp-server/src/tools/agent-definition.ts +458 -0
- package/mcp-server/src/tools/agents.ts +175 -19
- package/mcp-server/src/tools/browser-advanced.ts +60 -6
- package/mcp-server/src/tools/git-tools.ts +249 -3
- package/mcp-server/src/tools/morelogin.ts +20 -5
- package/mcp-server/src/tools/team.ts +97 -0
- package/neural-interface/i18n/en.json +1174 -47
- package/neural-interface/i18n/pt-BR.json +1174 -47
- package/neural-interface/lib/account-usage.js +1 -1
- package/neural-interface/lib/agents/density.js +101 -0
- package/neural-interface/lib/agents/forge-host.js +223 -0
- package/neural-interface/lib/agents/native-export-targets.js +190 -0
- package/neural-interface/lib/agents/native-export.js +365 -0
- package/neural-interface/lib/agents/registry.js +840 -0
- package/neural-interface/lib/agents/resolve.js +544 -0
- package/neural-interface/lib/agents/schema.js +642 -0
- package/neural-interface/lib/agents/split.js +37 -0
- package/neural-interface/lib/agents-studio-api.js +591 -0
- package/neural-interface/lib/assistant-api.js +76 -7
- package/neural-interface/lib/assistant-catalog.js +2 -0
- package/neural-interface/lib/assistant-continuity.js +49 -0
- package/neural-interface/lib/assistant-dispatch.js +229 -102
- package/neural-interface/lib/assistant-persona.js +105 -8
- package/neural-interface/lib/assistant-route-gate.js +24 -9
- package/neural-interface/lib/assistant-router.js +384 -42
- package/neural-interface/lib/assistant-run-tail.js +151 -0
- package/neural-interface/lib/assistant-run-wait.js +183 -0
- package/neural-interface/lib/assistant-runtime.js +440 -93
- package/neural-interface/lib/assistant-task-prompt.js +11 -2
- package/neural-interface/lib/assistant-usage.js +3 -2
- package/neural-interface/lib/automation-approval.js +2 -2
- package/neural-interface/lib/browser-close-evidence.js +80 -0
- package/neural-interface/lib/browser-default.js +210 -0
- package/neural-interface/lib/browser-extension-adapter.js +255 -0
- package/neural-interface/lib/browser-extension-bridge.js +418 -0
- package/neural-interface/lib/browser-extension-folder.js +116 -0
- package/neural-interface/lib/browser-extension-setup.js +140 -0
- package/neural-interface/lib/browser-profile-choices.js +3 -3
- package/neural-interface/lib/browser-profiles.js +1 -1
- package/neural-interface/lib/browser-tool-policy.js +1 -1
- package/neural-interface/lib/claude-account-links.js +301 -0
- package/neural-interface/lib/claude-accounts.js +45 -20
- package/neural-interface/lib/claude-agent-bridge.js +142 -10
- package/neural-interface/lib/claude-model-catalog.js +6 -0
- package/neural-interface/lib/claude-panel-session.js +33 -0
- package/neural-interface/lib/cli-install-api.js +23 -0
- package/neural-interface/lib/codex-accounts.js +67 -24
- package/neural-interface/lib/coordination/README.md +384 -0
- package/neural-interface/lib/coordination/service.js +563 -0
- package/neural-interface/lib/coordination/store.js +1138 -0
- package/neural-interface/lib/db.js +22 -1
- package/neural-interface/lib/editor-completion-opencode.js +4 -3
- package/neural-interface/lib/effort-levels.js +10 -1
- package/neural-interface/lib/maritaca/opencode-proxy.js +7 -2
- package/neural-interface/lib/maritaca/opencode.js +35 -0
- package/neural-interface/lib/memory-list-page.js +49 -0
- package/neural-interface/lib/memory-list-stamp.js +60 -0
- package/neural-interface/lib/morelogin-outside-close.js +186 -0
- package/neural-interface/lib/morelogin-profile-failures.js +206 -0
- package/neural-interface/lib/morelogin-start-cooldown.js +160 -0
- package/neural-interface/lib/morelogin.js +219 -7
- package/neural-interface/lib/native-loop-runtime.js +24 -1
- package/neural-interface/lib/opencode-build-preflight.js +116 -0
- package/neural-interface/lib/opencode-launch-error.js +13 -0
- package/neural-interface/lib/opencode-native-boundary.js +800 -84
- package/neural-interface/lib/opencode-serve-probe.js +426 -0
- package/neural-interface/lib/opencode-serve-records.js +14 -9
- package/neural-interface/lib/opencode-serve-scan.js +108 -0
- package/neural-interface/lib/page-session.js +1 -1
- package/neural-interface/lib/peer-identity.js +60 -21
- package/neural-interface/lib/process-identity.js +235 -7
- package/neural-interface/lib/request-gate.js +3 -0
- package/neural-interface/lib/screenshot-location.js +33 -0
- package/neural-interface/lib/skills/creation.js +1 -1
- package/neural-interface/lib/skills/known-bridge-digests.json +40 -0
- package/neural-interface/lib/studio-attention.js +56 -0
- package/neural-interface/lib/teams/README.md +382 -0
- package/neural-interface/lib/teams/api.js +287 -0
- package/neural-interface/lib/teams/brief.js +185 -0
- package/neural-interface/lib/teams/claims.js +315 -0
- package/neural-interface/lib/teams/git.js +293 -0
- package/neural-interface/lib/teams/index.js +122 -0
- package/neural-interface/lib/teams/integration.js +580 -0
- package/neural-interface/lib/teams/landing.js +184 -0
- package/neural-interface/lib/teams/recovery.js +256 -0
- package/neural-interface/lib/teams/scheduler.js +1474 -0
- package/neural-interface/lib/teams/schema.js +559 -0
- package/neural-interface/lib/teams/state.js +181 -0
- package/neural-interface/lib/teams/test-runner.js +86 -0
- package/neural-interface/lib/teams/test-sandbox.js +99 -0
- package/neural-interface/lib/teams/worktrees.js +757 -0
- package/neural-interface/lib/tool-permission-choices.js +226 -0
- package/neural-interface/lib/whatsapp/cards.js +24 -10
- package/neural-interface/lib/worker-confinement.js +206 -6
- package/neural-interface/lib/worker-mcp-channel.js +38 -1
- package/neural-interface/package-lock.json +4 -2
- package/neural-interface/package.json +3 -1
- package/neural-interface/public/extension-setup.html +107 -0
- package/neural-interface/public/index.html +52 -12
- package/neural-interface/public/shared/agent-runtime-options.js +3 -1
- package/neural-interface/public/shared/agents/studio/ax-agent-view.js +614 -0
- package/neural-interface/public/shared/agents/studio/ax-api.js +198 -0
- package/neural-interface/public/shared/agents/studio/ax-create-view.js +221 -0
- package/neural-interface/public/shared/agents/studio/ax-diff.js +143 -0
- package/neural-interface/public/shared/agents/studio/ax-editor-view.js +392 -0
- package/neural-interface/public/shared/agents/studio/ax-export-view.js +94 -0
- package/neural-interface/public/shared/agents/studio/ax-form.js +191 -0
- package/neural-interface/public/shared/agents/studio/ax-icons.js +87 -0
- package/neural-interface/public/shared/agents/studio/ax-library-view.js +158 -0
- package/neural-interface/public/shared/agents/studio/ax-library.js +162 -0
- package/neural-interface/public/shared/agents/studio/ax-main.js +712 -0
- package/neural-interface/public/shared/agents/studio/ax-native-export.js +35 -0
- package/neural-interface/public/shared/agents/studio/ax-options.js +198 -0
- package/neural-interface/public/shared/agents/studio/ax-review-view.js +175 -0
- package/neural-interface/public/shared/agents/studio/ax-revisions-view.js +189 -0
- package/neural-interface/public/shared/agents/studio/ax-runs-view.js +202 -0
- package/neural-interface/public/shared/agents/studio/ax-runs.js +82 -0
- package/neural-interface/public/shared/agents/studio/ax-teams-view.js +256 -0
- package/neural-interface/public/shared/agents/studio/ax-teams.js +200 -0
- package/neural-interface/public/shared/agents/studio/ax-templates.js +50 -0
- package/neural-interface/public/shared/agents/studio/ax-ui.js +194 -0
- package/neural-interface/public/shared/agents/studio/ax-views.js +170 -0
- package/neural-interface/public/shared/agy/agy-panel.js +142 -28
- package/neural-interface/public/shared/agy/agy-styles.js +25 -5
- package/neural-interface/public/shared/assistant/asst-account-menu.js +13 -13
- package/neural-interface/public/shared/assistant/asst-ask-styles.js +2 -3
- package/neural-interface/public/shared/assistant/asst-brain-picker.js +91 -9
- package/neural-interface/public/shared/assistant/asst-control.js +3 -0
- package/neural-interface/public/shared/assistant/asst-interaction-hold.js +99 -0
- package/neural-interface/public/shared/assistant/asst-limit-dismissals.js +111 -0
- package/neural-interface/public/shared/assistant/asst-limit-dock.js +37 -3
- package/neural-interface/public/shared/assistant/asst-limit-wait.js +30 -7
- package/neural-interface/public/shared/assistant/asst-panel.js +177 -30
- package/neural-interface/public/shared/assistant/asst-rack-styles.js +15 -8
- package/neural-interface/public/shared/assistant/asst-render.js +36 -6
- package/neural-interface/public/shared/assistant/asst-route.js +78 -12
- package/neural-interface/public/shared/assistant/asst-routes-editor.js +148 -70
- package/neural-interface/public/shared/assistant/asst-roving.js +17 -1
- package/neural-interface/public/shared/assistant/asst-scene-styles.js +7 -2
- package/neural-interface/public/shared/assistant/asst-scenes.js +12 -1
- package/neural-interface/public/shared/assistant/asst-sidepanel.js +12 -2
- package/neural-interface/public/shared/assistant/asst-state.js +66 -1
- package/neural-interface/public/shared/assistant/asst-styles.js +98 -44
- package/neural-interface/public/shared/assistant/route-identity.js +16 -0
- package/neural-interface/public/shared/cdx/cdx-output.js +10 -0
- package/neural-interface/public/shared/cdx/cdx-panel.js +18 -16
- package/neural-interface/public/shared/cdx/cdx-plan.js +3 -2
- package/neural-interface/public/shared/cdx/cdx-render.js +122 -45
- package/neural-interface/public/shared/cdx/cdx-requests.js +4 -4
- package/neural-interface/public/shared/cdx/cdx-styles.js +8 -36
- package/neural-interface/public/shared/cdx/cdx-tabs.js +110 -42
- package/neural-interface/public/shared/claude-panel-lazy.js +12 -0
- package/neural-interface/public/shared/code-copy.js +120 -0
- package/neural-interface/public/shared/constants.js +7 -0
- package/neural-interface/public/shared/context-menu-model.js +1 -0
- package/neural-interface/public/shared/cp/cp-markdown.js +7 -2
- package/neural-interface/public/shared/cp/cp-session-model.js +86 -5
- package/neural-interface/public/shared/cp/cp-session-settings.js +58 -30
- package/neural-interface/public/shared/cp/cp-styles.js +9 -0
- package/neural-interface/public/shared/dom-change-flag.js +66 -0
- package/neural-interface/public/shared/dom-morph.js +124 -0
- package/neural-interface/public/shared/extension-setup/es-page.css +134 -0
- package/neural-interface/public/shared/extension-setup/es-page.js +120 -0
- package/neural-interface/public/shared/extension-setup/es-view.js +100 -0
- package/neural-interface/public/shared/html-shell.js +33 -4
- package/neural-interface/public/shared/i18n.js +14 -1
- package/neural-interface/public/shared/idle-queue.js +78 -0
- package/neural-interface/public/shared/iface-config.js +227 -0
- package/neural-interface/public/shared/lazy-module.js +108 -0
- package/neural-interface/public/shared/memory-list.js +117 -0
- package/neural-interface/public/shared/morelogin-profile-choices.js +1 -1
- package/neural-interface/public/shared/morelogin-profile-field.js +3 -3
- package/neural-interface/public/shared/mtc/mtc-panel.js +3 -1
- package/neural-interface/public/shared/mtc/mtc-styles.js +4 -1
- package/neural-interface/public/shared/ocp-v2/ocp-v2-manager.js +35 -15
- package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +77 -23
- package/neural-interface/public/shared/ocp-v2/ocp-v2-projectbar.js +3 -6
- package/neural-interface/public/shared/ocp-v2/ocp-v2-render.js +24 -21
- package/neural-interface/public/shared/ocp-v2/ocp-v2-send-logic.js +16 -5
- package/neural-interface/public/shared/ocp-v2/ocp-v2-sessions-logic.js +16 -2
- package/neural-interface/public/shared/ocp-v2/ocp-v2-styles.js +27 -43
- package/neural-interface/public/shared/ocp-v2/ocp-v2-ws.js +73 -9
- package/neural-interface/public/shared/opencode-verify-view.js +175 -0
- package/neural-interface/public/shared/schedules-view.js +2 -2
- package/neural-interface/public/shared/session-project-items.js +11 -0
- package/neural-interface/public/shared/settings/settings-ai-browser.js +119 -0
- package/neural-interface/public/shared/settings/settings-browser-extension.js +446 -0
- package/neural-interface/public/shared/settings/settings-ia.js +4 -2
- package/neural-interface/public/shared/settings/settings-morelogin-cooldown.js +63 -0
- package/neural-interface/public/shared/settings/settings-tool-permissions.js +70 -0
- package/neural-interface/public/shared/sidepanel-lazy.js +40 -0
- package/neural-interface/public/shared/sidepanel-session-status.js +8 -14
- package/neural-interface/public/shared/sidepanel-shown.js +73 -0
- package/neural-interface/public/shared/storage.js +6 -1
- package/neural-interface/public/shared/studio-attention.js +83 -0
- package/neural-interface/public/shared/styles.css +713 -61
- package/neural-interface/public/shared/term-browser-tabs.js +34 -0
- package/neural-interface/public/shared/transcript-rows.js +334 -0
- package/neural-interface/public/shared/tray-auto-close.js +106 -0
- package/neural-interface/public/shared/ui-agents.js +97 -0
- package/neural-interface/public/shared/ui-antigravity-panel.js +16 -14
- package/neural-interface/public/shared/ui-automation-studio.js +3 -3
- package/neural-interface/public/shared/ui-claude-panel.js +162 -95
- package/neural-interface/public/shared/ui-code-copy.js +256 -0
- package/neural-interface/public/shared/ui-codex-panel.js +14 -10
- package/neural-interface/public/shared/ui-context-menu.js +1 -1
- package/neural-interface/public/shared/ui-file-explorer.js +2 -3
- package/neural-interface/public/shared/ui-games.js +1 -1
- package/neural-interface/public/shared/ui-loading.js +12 -1
- package/neural-interface/public/shared/ui-maritaca-panel.js +12 -11
- package/neural-interface/public/shared/ui-menubar.js +23 -0
- package/neural-interface/public/shared/ui-native-loop-router.js +1 -1
- package/neural-interface/public/shared/ui-navbar.js +15 -9
- package/neural-interface/public/shared/ui-opencode-panel-v2.js +13 -11
- package/neural-interface/public/shared/ui-opencode-verify.js +120 -0
- package/neural-interface/public/shared/ui-schedules-studio.js +3 -3
- package/neural-interface/public/shared/ui-scroll-follow.js +39 -0
- package/neural-interface/public/shared/ui-sessions.js +3 -3
- package/neural-interface/public/shared/ui-settings-entry.js +55 -0
- package/neural-interface/public/shared/ui-settings.js +372 -402
- package/neural-interface/public/shared/ui-sidepanel-layout.js +44 -25
- package/neural-interface/public/shared/ui-sidepanel-session-entry.js +22 -9
- package/neural-interface/public/shared/ui-sidepanel-sessions.js +10 -2
- package/neural-interface/public/shared/ui-sidepanel-tray.js +36 -41
- package/neural-interface/public/shared/ui-sidepanel-windows.js +14 -1
- package/neural-interface/public/shared/ui-styleguide.js +10 -2
- package/neural-interface/public/shared/ui-sync.js +5 -0
- package/neural-interface/public/shared/ui-terminal.js +13 -9
- package/neural-interface/public/shared/ui-tooltip.js +28 -7
- package/neural-interface/public/shared/ui-topright-overflow.js +26 -4
- package/neural-interface/public/shared/ui-tray-columns.js +375 -0
- package/neural-interface/public/shared/ui-whiteboard.js +51 -6
- package/neural-interface/public/shared/ui-worker-end.js +28 -1
- package/neural-interface/public/shared/ui-workspaces.js +13 -0
- package/neural-interface/public/shared/window-keys.js +71 -0
- package/neural-interface/public/variant/2d/main.js +2 -0
- package/neural-interface/public/variant/3d/app.js +620 -0
- package/neural-interface/public/variant/3d/boot-reveal.js +47 -0
- package/neural-interface/public/variant/3d/main.js +21 -544
- package/neural-interface/public/variant/3d/map-controls.js +4 -2
- package/neural-interface/public/vendor/fonts/fonts.css +508 -0
- package/neural-interface/public/vendor/fonts/inter-OFL.txt +93 -0
- package/neural-interface/public/vendor/fonts/inter-cyrillic-ext.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/inter-cyrillic.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/inter-greek-ext.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/inter-greek.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/inter-latin-ext.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/inter-latin.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/inter-vietnamese.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/jetbrains-mono-OFL.txt +93 -0
- package/neural-interface/public/vendor/fonts/jetbrains-mono-cyrillic-ext.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/jetbrains-mono-cyrillic.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/jetbrains-mono-greek.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/jetbrains-mono-latin-ext.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/jetbrains-mono-latin.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/jetbrains-mono-vietnamese.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/manifest.json +142 -0
- package/neural-interface/public/vendor/fonts/space-grotesk-OFL.txt +93 -0
- package/neural-interface/public/vendor/fonts/space-grotesk-latin-ext.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/space-grotesk-latin.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/space-grotesk-vietnamese.woff2 +0 -0
- package/neural-interface/scripts/boot-graph.mjs +270 -0
- package/neural-interface/scripts/vendor-fonts.mjs +124 -0
- package/neural-interface/server.js +1164 -157
- package/npm-shrinkwrap.json +2 -2
- package/package.json +3 -1
- package/skills/agent-forge/SKILL.md +182 -0
- package/skills/agent-forge/evals/evals.json +56 -0
- package/skills/agent-forge/references/definition-fields.md +61 -0
- package/skills/agent-forge/references/examples.md +105 -0
- package/skills/agent-forge/references/instructions.md +51 -0
- package/skills/agent-forge/references/review-and-export.md +84 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// The browser tabs of the terminal panel that a fresh browser session replaces. DOM-free (ui-terminal.js is
|
|
2
|
+
// the page side); tests/terminal-browser-tabs.test.mjs.
|
|
3
|
+
//
|
|
4
|
+
// A fresh session (openBrowser({ fresh: true })) ends every browser session on the server and must take their
|
|
5
|
+
// tabs out of the panel too. It used to look each tab up by its position in the tab bar and close it with a
|
|
6
|
+
// function that did not exist; the error went into a catch that ignored everything, so the old tabs stayed,
|
|
7
|
+
// each on a session the server no longer had.
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Close every browser tab in `sessions` through `closeSession(index)`.
|
|
11
|
+
*
|
|
12
|
+
* By session, never by position in the tab bar: closing one takes it out of `sessions` and redraws the bar,
|
|
13
|
+
* so every index and every tab element read before it is stale. A session whose server side this fresh start
|
|
14
|
+
* already ended (`deletedIds`) is marked so its teardown does not ask the server to end it again.
|
|
15
|
+
*
|
|
16
|
+
* @param {Array<object>} sessions the live session list (mutated by `closeSession`)
|
|
17
|
+
* @param {(index: number) => unknown} closeSession
|
|
18
|
+
* @param {{ deletedIds?: Iterable<string> }} [options]
|
|
19
|
+
* @returns {string[]} the ids of the sessions it closed
|
|
20
|
+
*/
|
|
21
|
+
export function closeBrowserTabs(sessions, closeSession, { deletedIds = [] } = {}) {
|
|
22
|
+
if (!Array.isArray(sessions)) throw new TypeError('closeBrowserTabs: sessions must be the session list');
|
|
23
|
+
if (typeof closeSession !== 'function') throw new TypeError('closeBrowserTabs: closeSession must be a function');
|
|
24
|
+
const ended = new Set(deletedIds);
|
|
25
|
+
const closed = [];
|
|
26
|
+
for (const session of sessions.filter((entry) => entry && entry._isBrowser)) {
|
|
27
|
+
const index = sessions.indexOf(session);
|
|
28
|
+
if (index < 0) continue; // closed with an earlier one
|
|
29
|
+
if (ended.has(session.id)) session._skipServerDelete = true;
|
|
30
|
+
closeSession(index);
|
|
31
|
+
closed.push(session.id);
|
|
32
|
+
}
|
|
33
|
+
return closed;
|
|
34
|
+
}
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════
|
|
2
|
+
// SynaBun Neural Interface — the rows of a long transcript that are far from the screen cost nothing
|
|
3
|
+
// ═══════════════════════════════════════════
|
|
4
|
+
// A side panel's transcript keeps every row in the page: a long Claude session is 13,000 elements, and each
|
|
5
|
+
// restyle of the whole page (a variable written on <html> for every frame of a panel resize or a terminal
|
|
6
|
+
// drag, a class on <body>) walked all of them, on screen or not; a resize laid all of them out again, every
|
|
7
|
+
// frame. A closed panel is skipped whole (ui-sidepanel-windows.js). This is the same for the panel that is
|
|
8
|
+
// open: a row more than a screenful away from the visible part of its transcript is handed to
|
|
9
|
+
// `content-visibility: auto` at the exact size it was last laid out at, so the engine leaves what is inside
|
|
10
|
+
// it out of style, layout and paint until it comes near again.
|
|
11
|
+
//
|
|
12
|
+
// What keeps this invisible:
|
|
13
|
+
// - A row on screen, or within one screen height above or below it, carries nothing: no containment, no
|
|
14
|
+
// clip, no stacking context. What the user can see is drawn exactly as before (hover buttons that stick out
|
|
15
|
+
// of a row, a card's glow, a menu opened in a row).
|
|
16
|
+
// - A far row keeps its place and its size to the pixel: the size is the one a ResizeObserver reported for
|
|
17
|
+
// it, never an estimate, and a row is only ever made far after it has been laid out. The transcript's
|
|
18
|
+
// scroll height, the scroll position and the scrollbar do not move.
|
|
19
|
+
// - `auto`, not `hidden`: find-in-page, a selection, focus, scrollIntoView and an anchor reach into a far
|
|
20
|
+
// row, and the engine draws a far row by itself the moment it reaches the screen (a jump with the
|
|
21
|
+
// scrollbar or End), before this module has even heard of it.
|
|
22
|
+
// - The newest rows (the tail, where a session streams) are never far, so a session that writes while the
|
|
23
|
+
// user reads further up grows the transcript as it always did.
|
|
24
|
+
// - A row whose children's margins would collapse through it is left alone: containment would stop that
|
|
25
|
+
// collapse and change the row's height.
|
|
26
|
+
// - A far row whose content changed, or whose panel was resized meanwhile, has a stale size until it comes
|
|
27
|
+
// near; it then takes its real one while still off screen. Rows above the visible part changing height
|
|
28
|
+
// is what scroll anchoring is for; where the engine has none (Safari) the scroll position is moved by the
|
|
29
|
+
// same amount here, so what is on screen stays where it is.
|
|
30
|
+
// - Everything is three inline declarations on the row (content-visibility, its size, flex-shrink: 0),
|
|
31
|
+
// written and removed together. Nothing here adds an
|
|
32
|
+
// element, a class or an attribute, and a snapshot of a transcript is stored without them
|
|
33
|
+
// (stripFarRowStyles, isFarRowStyleRecord).
|
|
34
|
+
//
|
|
35
|
+
// The deciding part is page-free and unit-tested (tests/transcript-rows.test.mjs); the observers are injected.
|
|
36
|
+
|
|
37
|
+
/** How far beyond the visible part of the transcript a row stays plain: one height of it, above and below. */
|
|
38
|
+
export const NEAR_MARGIN = '100% 0px';
|
|
39
|
+
/** The rows at the end that are never far: the row a session is writing, and the one before it. */
|
|
40
|
+
export const LIVE_TAIL_ROWS = 2;
|
|
41
|
+
/** A row smaller than this is not worth skipping (and a 0 px row is one that is not laid out at all). */
|
|
42
|
+
export const MIN_FAR_HEIGHT = 8;
|
|
43
|
+
|
|
44
|
+
/** How long after a far row is made plain a change of its height is still the stale size being corrected. */
|
|
45
|
+
const SETTLE_MS = 400;
|
|
46
|
+
|
|
47
|
+
const CV = 'content-visibility';
|
|
48
|
+
const CIS = 'contain-intrinsic-size';
|
|
49
|
+
const FS = 'flex-shrink';
|
|
50
|
+
|
|
51
|
+
// `display` values that make an element lay its children out in a context of its own: their margins never
|
|
52
|
+
// collapse through it, with or without containment.
|
|
53
|
+
const SELF_CONTAINED_DISPLAY = /^(?:inline-)?(?:flex|grid|table|flow-root)$|^inline-block$|^table-/;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Would layout containment change this row's height? It does when a child's vertical margin collapses
|
|
57
|
+
* through the row's top or bottom edge today: containment stops that. Pure: takes a computed style (or
|
|
58
|
+
* anything with these fields) and what the row's parent is.
|
|
59
|
+
*
|
|
60
|
+
* @param {{ display?: string, overflowY?: string, paddingTop?: string, paddingBottom?: string,
|
|
61
|
+
* borderTopWidth?: string, borderBottomWidth?: string, contain?: string, position?: string, float?: string }} style
|
|
62
|
+
*/
|
|
63
|
+
export function rowKeepsItsHeight(style) {
|
|
64
|
+
if (!style) return false;
|
|
65
|
+
const display = String(style.display || '');
|
|
66
|
+
if (display === 'none' || display === 'contents') return false;
|
|
67
|
+
if (SELF_CONTAINED_DISPLAY.test(display)) return true;
|
|
68
|
+
if (style.overflowY && style.overflowY !== 'visible') return true;
|
|
69
|
+
if (/\b(?:layout|content|strict|paint)\b/.test(String(style.contain || ''))) return true;
|
|
70
|
+
if (style.position === 'absolute' || style.position === 'fixed') return true;
|
|
71
|
+
if (style.float && style.float !== 'none') return true;
|
|
72
|
+
const px = (value) => parseFloat(value) || 0;
|
|
73
|
+
const topClosed = px(style.paddingTop) > 0 || px(style.borderTopWidth) > 0;
|
|
74
|
+
const bottomClosed = px(style.paddingBottom) > 0 || px(style.borderBottomWidth) > 0;
|
|
75
|
+
return topClosed && bottomClosed;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Should this row be far? Pure.
|
|
80
|
+
* @param {{ near: boolean | undefined, width: number, height: number, safe: boolean, tail: boolean }} row
|
|
81
|
+
*/
|
|
82
|
+
export function shouldBeFar({ near, width, height, safe, tail }) {
|
|
83
|
+
return near === false && safe === true && tail === false
|
|
84
|
+
&& Number.isFinite(height) && height >= MIN_FAR_HEIGHT && Number.isFinite(width) && width > 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The value of `contain-intrinsic-size` for a far row: its last laid out CONTENT box, exactly. The
|
|
89
|
+
* property sizes the content box; padding and border are added to it as always, so the row's outer size is
|
|
90
|
+
* what it was. (The border box here would grow every far row by its own padding.)
|
|
91
|
+
*/
|
|
92
|
+
export function farSize(width, height) {
|
|
93
|
+
// As reported, never rounded: engines lay out in fractions of a pixel (1/64, 1/60), and a size rounded to
|
|
94
|
+
// a hundredth lands on the next fraction down for some rows. A sixty-fourth of a pixel per row is nothing,
|
|
95
|
+
// and eight pixels of scroll height over five hundred of them.
|
|
96
|
+
return `${width}px ${height}px`;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** Take this module's two declarations off an element. Returns true when it carried them. */
|
|
100
|
+
export function clearFarRow(el) {
|
|
101
|
+
const style = el?.style;
|
|
102
|
+
if (!style || typeof style.getPropertyValue !== 'function') return false;
|
|
103
|
+
if (style.getPropertyValue(CV) !== 'auto') return false;
|
|
104
|
+
style.removeProperty(CV);
|
|
105
|
+
style.removeProperty(CIS);
|
|
106
|
+
style.removeProperty(FS);
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Take the far declarations off every row of a copy of a transcript (what a snapshot stores): a stored
|
|
112
|
+
* transcript must not come back with the sizes of another day and another width.
|
|
113
|
+
*/
|
|
114
|
+
export function stripFarRowStyles(container) {
|
|
115
|
+
let stripped = 0;
|
|
116
|
+
for (const row of container?.children || []) if (clearFarRow(row)) stripped += 1;
|
|
117
|
+
return stripped;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Is this mutation record one of this module's own writes: the `style` attribute of a row of `container`?
|
|
122
|
+
* A watcher that asks "did the transcript change?" (dom-change-flag.js) leaves these out, since what is
|
|
123
|
+
* stored never holds them. Any other style change on a row counts as before only when it is not paired with
|
|
124
|
+
* a far declaration, which is the best that can be told from a record: rows do not carry other inline styles.
|
|
125
|
+
*/
|
|
126
|
+
export function isFarRowStyleRecord(record, container) {
|
|
127
|
+
return !!record && record.type === 'attributes' && record.attributeName === 'style'
|
|
128
|
+
&& !!record.target && record.target.parentNode === container;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Watch the rows of a transcript.
|
|
133
|
+
*
|
|
134
|
+
* @param {Element} scroller the element that scrolls
|
|
135
|
+
* @param {object} [options]
|
|
136
|
+
* @param {Element} [options.container] the element whose children are the rows (default: the scroller)
|
|
137
|
+
* @param {(row: Element) => boolean} [options.skip] rows to leave alone whatever else holds
|
|
138
|
+
* @returns {{ refresh(): void, disconnect(): void, farCount(): number }}
|
|
139
|
+
*/
|
|
140
|
+
export function watchTranscriptRows(scroller, {
|
|
141
|
+
container = scroller,
|
|
142
|
+
skip = null,
|
|
143
|
+
view = scroller?.ownerDocument?.defaultView || globalThis,
|
|
144
|
+
IntersectionObserver: IO = view.IntersectionObserver,
|
|
145
|
+
ResizeObserver: RO = view.ResizeObserver,
|
|
146
|
+
MutationObserver: MO = view.MutationObserver,
|
|
147
|
+
getComputedStyle: computed = typeof view.getComputedStyle === 'function' ? view.getComputedStyle.bind(view) : null,
|
|
148
|
+
supportsContentVisibility = () => {
|
|
149
|
+
try { return !!view.CSS?.supports?.(CV, 'auto') && !!view.CSS.supports(CIS, '1px 1px'); } catch { return false; }
|
|
150
|
+
},
|
|
151
|
+
now = () => (typeof view.performance?.now === 'function' ? view.performance.now() : Date.now()),
|
|
152
|
+
nativeScrollAnchoring = () => {
|
|
153
|
+
try {
|
|
154
|
+
if (!view.CSS?.supports?.('overflow-anchor', 'auto')) return false;
|
|
155
|
+
return !computed || computed(scroller).overflowAnchor !== 'none';
|
|
156
|
+
} catch { return false; }
|
|
157
|
+
},
|
|
158
|
+
} = {}) {
|
|
159
|
+
const inert = { refresh() {}, disconnect() {}, farCount: () => 0 };
|
|
160
|
+
if (!scroller || !container) return inert;
|
|
161
|
+
// An engine without the property, or without the observers this needs to be exact: every row stays plain.
|
|
162
|
+
if (typeof IO !== 'function' || typeof RO !== 'function' || typeof MO !== 'function' || !computed) return inert;
|
|
163
|
+
if (!supportsContentVisibility()) return inert;
|
|
164
|
+
|
|
165
|
+
/** @type {Map<Element, { near: boolean | undefined, above: boolean, width: number, height: number, safe: boolean | undefined, far: boolean, settleUntil: number }>} */
|
|
166
|
+
const rows = new Map();
|
|
167
|
+
let disposed = false;
|
|
168
|
+
let anchoring = null; // asked once, on the first height change that needs it
|
|
169
|
+
let parentContains = null; // the rows are flex or grid items: asked once, with the first row that could be far
|
|
170
|
+
|
|
171
|
+
const isTail = (row) => {
|
|
172
|
+
let el = container.lastElementChild;
|
|
173
|
+
for (let i = 0; i < LIVE_TAIL_ROWS && el; i++, el = el.previousElementSibling) if (el === row) return true;
|
|
174
|
+
return false;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
const safeOf = (row, state) => {
|
|
178
|
+
if (state.safe === undefined) {
|
|
179
|
+
try {
|
|
180
|
+
if (parentContains === null) parentContains = /^(?:inline-)?(?:flex|grid)$/.test(String(computed(container).display || ''));
|
|
181
|
+
// Items of a flex or grid transcript need no look at their own style.
|
|
182
|
+
state.safe = parentContains || rowKeepsItsHeight(computed(row));
|
|
183
|
+
} catch { state.safe = false; }
|
|
184
|
+
}
|
|
185
|
+
return state.safe;
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
function apply(row, state) {
|
|
189
|
+
const want = !disposed && row.parentNode === container
|
|
190
|
+
&& shouldBeFar({
|
|
191
|
+
near: state.near, width: state.width, height: state.height, tail: isTail(row),
|
|
192
|
+
// asked last: it reads a computed style, and only a row that would otherwise be far needs it
|
|
193
|
+
safe: state.near === false && state.height >= MIN_FAR_HEIGHT && !(skip && skip(row)) ? safeOf(row, state) : false,
|
|
194
|
+
});
|
|
195
|
+
if (want) {
|
|
196
|
+
const size = farSize(state.width, state.height);
|
|
197
|
+
// All of them, always: a row with the first and not the size would collapse to nothing. The third
|
|
198
|
+
// keeps a flex transcript from squeezing a row whose content it no longer sees: a row never shrinks
|
|
199
|
+
// today (its content is its minimum), and a skipped row must not depend on how an engine reads the
|
|
200
|
+
// minimum of a contained box.
|
|
201
|
+
if (!state.far || row.style.getPropertyValue(CV) !== 'auto' || row.style.getPropertyValue(CIS) !== size) {
|
|
202
|
+
row.style.setProperty(CIS, size);
|
|
203
|
+
row.style.setProperty(FS, '0');
|
|
204
|
+
row.style.setProperty(CV, 'auto');
|
|
205
|
+
}
|
|
206
|
+
state.far = true;
|
|
207
|
+
} else if (state.far || row.style.getPropertyValue(CV) === 'auto') {
|
|
208
|
+
row.style.removeProperty(CV);
|
|
209
|
+
row.style.removeProperty(CIS);
|
|
210
|
+
row.style.removeProperty(FS);
|
|
211
|
+
// Laid out for real again: if its height is not what it was given, that is this module's doing
|
|
212
|
+
// (the sizes observer keeps the scroll position, below).
|
|
213
|
+
if (state.far) state.settleUntil = now() + SETTLE_MS;
|
|
214
|
+
state.far = false;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
const intersections = new IO((entries) => {
|
|
219
|
+
if (disposed) return;
|
|
220
|
+
for (const entry of entries) {
|
|
221
|
+
const state = rows.get(entry.target);
|
|
222
|
+
if (!state) continue;
|
|
223
|
+
// No box to compare with: the transcript is not laid out (a closed panel, a tab that is not showing).
|
|
224
|
+
// What was known stays; a row is not declared far because its panel was closed.
|
|
225
|
+
const bounds = entry.rootBounds;
|
|
226
|
+
if (!bounds || !(bounds.height > 0) || !(bounds.width > 0)) continue;
|
|
227
|
+
state.near = !!entry.isIntersecting;
|
|
228
|
+
// The bounds are the visible part with one height of it added above and below (NEAR_MARGIN): the
|
|
229
|
+
// visible part starts a third of the way down.
|
|
230
|
+
state.above = entry.boundingClientRect.bottom <= bounds.top + bounds.height / 3 + 1;
|
|
231
|
+
apply(entry.target, state);
|
|
232
|
+
}
|
|
233
|
+
}, { root: scroller, rootMargin: NEAR_MARGIN, threshold: 0 });
|
|
234
|
+
|
|
235
|
+
const sizes = new RO((entries) => {
|
|
236
|
+
if (disposed) return;
|
|
237
|
+
let shift = 0;
|
|
238
|
+
for (const entry of entries) {
|
|
239
|
+
const row = entry.target;
|
|
240
|
+
const state = rows.get(row);
|
|
241
|
+
if (!state) continue;
|
|
242
|
+
const box = Array.isArray(entry.contentBoxSize) ? entry.contentBoxSize[0] : entry.contentBoxSize;
|
|
243
|
+
const width = box ? box.inlineSize : entry.contentRect?.width;
|
|
244
|
+
const height = box ? box.blockSize : entry.contentRect?.height;
|
|
245
|
+
if (!Number.isFinite(width) || !Number.isFinite(height)) continue;
|
|
246
|
+
// A far row that is skipped reports the size it was given; that says nothing new.
|
|
247
|
+
if (state.far && Math.abs(height - state.height) < 0.01 && Math.abs(width - state.width) < 0.01) continue;
|
|
248
|
+
if (!(height > 0)) continue; // not laid out (display: none): the last real size stays
|
|
249
|
+
// A row above the visible part that was far took its real height (the engine drew it as it came
|
|
250
|
+
// near, or it was just made plain): its stale size was this module's, so the correction is too.
|
|
251
|
+
// Without scroll anchoring it would push what is on screen down, or pull it up, by the difference.
|
|
252
|
+
// A plain row that grows by itself is left to the engine, as it always was.
|
|
253
|
+
if (state.above && state.height > 0 && (state.far || now() < state.settleUntil)) shift += height - state.height;
|
|
254
|
+
state.settleUntil = 0;
|
|
255
|
+
state.width = width;
|
|
256
|
+
state.height = height;
|
|
257
|
+
apply(row, state);
|
|
258
|
+
}
|
|
259
|
+
if (shift && Math.abs(shift) >= 0.5) {
|
|
260
|
+
if (anchoring === null) anchoring = !!nativeScrollAnchoring();
|
|
261
|
+
if (!anchoring) {
|
|
262
|
+
// At once, never as a smooth scroll (a transcript may set scroll-behavior: smooth): this is a
|
|
263
|
+
// correction of the position, not a movement.
|
|
264
|
+
const top = scroller.scrollTop + shift;
|
|
265
|
+
if (typeof scroller.scrollTo === 'function') scroller.scrollTo({ top, behavior: 'instant' });
|
|
266
|
+
else scroller.scrollTop = top;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
function adopt(row) {
|
|
272
|
+
if (!row || row.nodeType !== 1 || rows.has(row)) return;
|
|
273
|
+
// A row that came with the declarations of another time (a stored transcript, a moved node) starts plain.
|
|
274
|
+
clearFarRow(row);
|
|
275
|
+
rows.set(row, { near: undefined, above: false, width: 0, height: 0, safe: undefined, far: false, settleUntil: 0 });
|
|
276
|
+
intersections.observe(row);
|
|
277
|
+
sizes.observe(row); // the content box: what contain-intrinsic-size sizes
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function release(row) {
|
|
281
|
+
const state = rows.get(row);
|
|
282
|
+
if (!state) return;
|
|
283
|
+
rows.delete(row);
|
|
284
|
+
intersections.unobserve(row);
|
|
285
|
+
sizes.unobserve(row);
|
|
286
|
+
if (state.far) clearFarRow(row);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/** The rows that just stopped being the tail (a row was added after them), and the new tail. */
|
|
290
|
+
function settleTail() {
|
|
291
|
+
let el = container.lastElementChild;
|
|
292
|
+
for (let i = 0; i < LIVE_TAIL_ROWS + 2 && el; i++, el = el.previousElementSibling) {
|
|
293
|
+
const state = rows.get(el);
|
|
294
|
+
if (state) apply(el, state);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
const changes = new MO((records) => {
|
|
299
|
+
if (disposed) return;
|
|
300
|
+
let touched = false;
|
|
301
|
+
for (const record of records) {
|
|
302
|
+
if (record.type !== 'childList' || record.target !== container) continue;
|
|
303
|
+
for (const node of record.removedNodes) if (node.parentNode !== container) release(node);
|
|
304
|
+
for (const node of record.addedNodes) if (node.parentNode === container) adopt(node);
|
|
305
|
+
touched = true;
|
|
306
|
+
}
|
|
307
|
+
if (touched) settleTail();
|
|
308
|
+
});
|
|
309
|
+
changes.observe(container, { childList: true });
|
|
310
|
+
for (const row of container.children) adopt(row);
|
|
311
|
+
|
|
312
|
+
return {
|
|
313
|
+
/** Forget what was decided about each row's formatting (a skin or a stylesheet changed) and decide again. */
|
|
314
|
+
refresh() {
|
|
315
|
+
if (disposed) return;
|
|
316
|
+
parentContains = null;
|
|
317
|
+
for (const [row, state] of rows) { state.safe = undefined; apply(row, state); }
|
|
318
|
+
},
|
|
319
|
+
disconnect() {
|
|
320
|
+
if (disposed) return;
|
|
321
|
+
disposed = true;
|
|
322
|
+
changes.disconnect();
|
|
323
|
+
intersections.disconnect();
|
|
324
|
+
sizes.disconnect();
|
|
325
|
+
for (const [row, state] of rows) if (state.far) clearFarRow(row);
|
|
326
|
+
rows.clear();
|
|
327
|
+
},
|
|
328
|
+
farCount() {
|
|
329
|
+
let n = 0;
|
|
330
|
+
for (const state of rows.values()) if (state.far) n += 1;
|
|
331
|
+
return n;
|
|
332
|
+
},
|
|
333
|
+
};
|
|
334
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { KEYS } from './constants.js';
|
|
2
|
+
import { trayColumnOf } from './ui-tray-columns.js';
|
|
3
|
+
|
|
4
|
+
const agents = ['cp', 'cxp', 'ocpv2', 'agy', 'mtc'].map(prefix => prefix + '-session-pill');
|
|
5
|
+
const excluded = ['asp-session-pill', 'sp-session-pill', 'sidepanel-tray-placeholder', 'ocpv2-session-pill-child'];
|
|
6
|
+
const unfinishedOrFailed = /^(?:running|waiting|error|errored|failed)$/i;
|
|
7
|
+
|
|
8
|
+
// Only direct provider pills can close. A collapsed Done column is still eligible.
|
|
9
|
+
export function canAutoClose(pill, tray) {
|
|
10
|
+
if (pill.parentElement !== tray || pill.dataset.trayCol !== 'done' || pill.hidden || pill.style.display === 'none') return false;
|
|
11
|
+
const classes = pill.classList;
|
|
12
|
+
if (!agents.some(name => classes.contains(name)) || excluded.some(name => classes.contains(name))) return false;
|
|
13
|
+
if (pill.querySelector('.cli-status-badge') || unfinishedOrFailed.test(pill.dataset.status) ||
|
|
14
|
+
/\S+-pill-(?:error|errored|failed)(?:\s|$)/.test(pill.className)) return false;
|
|
15
|
+
// The producer may have started another turn before the tray's next animation frame.
|
|
16
|
+
return trayColumnOf(pill) === 'done';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function initTrayAutoClose(tray, button, storage, t) {
|
|
20
|
+
if (!button) return;
|
|
21
|
+
// The standalone glass buttons have ID-scoped surfaces in styles.css.
|
|
22
|
+
const style = button.ownerDocument.createElement('style');
|
|
23
|
+
style.textContent = `
|
|
24
|
+
:root { --topright-buttons: 298px; }
|
|
25
|
+
#topright-auto-close-btn {
|
|
26
|
+
width: 32px; height: 32px; border-radius: 10px;
|
|
27
|
+
background: rgba(18, 18, 22, 0.65); border: 1px solid rgba(255, 255, 255, 0.06);
|
|
28
|
+
backdrop-filter: blur(var(--blur-heavy)) saturate(1.3);
|
|
29
|
+
-webkit-backdrop-filter: blur(var(--blur-heavy)) saturate(1.3);
|
|
30
|
+
box-shadow: var(--shadow-md), var(--shadow-highlight);
|
|
31
|
+
}
|
|
32
|
+
#topright-auto-close-btn:hover { background: rgba(24, 24, 30, 0.8); border-color: rgba(255, 255, 255, 0.1); }
|
|
33
|
+
`;
|
|
34
|
+
button.ownerDocument.head.append(style);
|
|
35
|
+
|
|
36
|
+
let enabled = storage.getItem(KEYS.TRAY_AUTO_CLOSE) === 'true';
|
|
37
|
+
const pending = new Map();
|
|
38
|
+
let requested = new WeakSet();
|
|
39
|
+
|
|
40
|
+
function cancel(pill) {
|
|
41
|
+
clearTimeout(pending.get(pill));
|
|
42
|
+
pending.delete(pill);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function close(pill) {
|
|
46
|
+
pending.delete(pill);
|
|
47
|
+
if (!enabled || !canAutoClose(pill, tray) || requested.has(pill)) return;
|
|
48
|
+
const x = pill.querySelector(':scope > .term-minimized-pill-close');
|
|
49
|
+
if (x) {
|
|
50
|
+
requested.add(pill); // Some close handlers remove the pill asynchronously.
|
|
51
|
+
x.click();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function reconcile(pill, immediate = false) {
|
|
56
|
+
if (!canAutoClose(pill, tray)) {
|
|
57
|
+
cancel(pill);
|
|
58
|
+
requested.delete(pill);
|
|
59
|
+
} else if (!requested.has(pill) && !pending.has(pill)) {
|
|
60
|
+
if (immediate) close(pill);
|
|
61
|
+
else pending.set(pill, setTimeout(() => close(pill), 1500));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const observer = new MutationObserver(records => {
|
|
66
|
+
const changed = new Set();
|
|
67
|
+
for (const record of records) {
|
|
68
|
+
if (record.type === 'childList' && record.target === tray) {
|
|
69
|
+
for (const node of record.removedNodes) cancel(node);
|
|
70
|
+
for (const node of record.addedNodes) if (node.nodeType === 1) changed.add(node);
|
|
71
|
+
} else {
|
|
72
|
+
// A complete round trip out of Done can be delivered in one observer batch.
|
|
73
|
+
if (record.attributeName === 'data-tray-col' && record.oldValue === 'done') {
|
|
74
|
+
cancel(record.target);
|
|
75
|
+
requested.delete(record.target);
|
|
76
|
+
}
|
|
77
|
+
const pill = record.target.closest('.term-minimized-pill');
|
|
78
|
+
if (pill?.parentElement === tray) changed.add(pill);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
for (const pill of changed) reconcile(pill);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
function apply(immediate) {
|
|
85
|
+
const label = t(enabled ? 'toolbar.trayAutoCloseOn' : 'toolbar.trayAutoCloseOff');
|
|
86
|
+
button.dataset.tooltip = label;
|
|
87
|
+
button.setAttribute('aria-label', label);
|
|
88
|
+
button.setAttribute('aria-pressed', String(enabled));
|
|
89
|
+
button.classList.toggle('active', enabled);
|
|
90
|
+
if (enabled) {
|
|
91
|
+
observer.observe(tray, { subtree: true, childList: true, attributes: true, attributeOldValue: true,
|
|
92
|
+
attributeFilter: ['data-tray-col', 'data-status', 'class', 'style', 'hidden'] });
|
|
93
|
+
for (const pill of [...tray.children]) reconcile(pill, immediate);
|
|
94
|
+
} else {
|
|
95
|
+
observer.disconnect();
|
|
96
|
+
requested = new WeakSet();
|
|
97
|
+
for (const pill of pending.keys()) cancel(pill);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
apply(false);
|
|
101
|
+
button.addEventListener('click', () => {
|
|
102
|
+
enabled = !enabled;
|
|
103
|
+
storage.setItem(KEYS.TRAY_AUTO_CLOSE, String(enabled));
|
|
104
|
+
apply(true);
|
|
105
|
+
});
|
|
106
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════
|
|
2
|
+
// SynaBun Neural Interface — Agents Studio
|
|
3
|
+
// ═══════════════════════════════════════════
|
|
4
|
+
//
|
|
5
|
+
// The window where the owner keeps its agents: named, reviewed ways to launch a worker (docs/agents.md → Agents
|
|
6
|
+
// Studio). The Studio is public/shared/agents/studio/, loaded the first time it is opened. This file is what the
|
|
7
|
+
// 2D and 3D pages load: it answers the menu's events, keeps the count of drafts that wait for review on the
|
|
8
|
+
// menu's "Review queue" entry, marks each Studio label when it needs the owner, and passes
|
|
9
|
+
// on the changes the Assistant, an agent or another window make.
|
|
10
|
+
//
|
|
11
|
+
// agents:open { view | place: 'library' | 'create' | 'review' | 'teams', id, scope, tab, create, teamId }
|
|
12
|
+
// with nothing said, the Studio opens where it was left
|
|
13
|
+
// sync:assistant:agents-changed an agent definition changed (lib/agents/registry.js through server.js)
|
|
14
|
+
// sync:assistant:team-changed a team changed (the team scheduler)
|
|
15
|
+
|
|
16
|
+
import { on } from './state.js';
|
|
17
|
+
import { isGuest } from './ui-sync.js';
|
|
18
|
+
import { watchStudioAttention } from './studio-attention.js';
|
|
19
|
+
import { t } from './i18n.js';
|
|
20
|
+
import { badgeText } from './agents/studio/ax-library.js';
|
|
21
|
+
|
|
22
|
+
let _studio = null;
|
|
23
|
+
const studio = () => {
|
|
24
|
+
if (!_studio) _studio = import('./agents/studio/ax-main.js').catch((err) => { _studio = null; throw err; });
|
|
25
|
+
return _studio;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
function paintAttention(count, attention) {
|
|
29
|
+
for (const button of document.querySelectorAll('[data-studio-attention]')) {
|
|
30
|
+
const waiting = attention[button.dataset.studioAttention];
|
|
31
|
+
button.querySelector('.menubar-attention-dot').hidden = !waiting;
|
|
32
|
+
if (waiting) button.setAttribute('aria-description', t('menu.studioAttention'));
|
|
33
|
+
else button.removeAttribute('aria-description');
|
|
34
|
+
}
|
|
35
|
+
const badge = document.getElementById('menu-agents-review-count');
|
|
36
|
+
if (!badge) return;
|
|
37
|
+
badge.textContent = badgeText(count);
|
|
38
|
+
badge.hidden = !count;
|
|
39
|
+
if (count) {
|
|
40
|
+
const label = t(count === 1 ? 'menu.agents.reviewWaitingOne' : 'menu.agents.reviewWaiting', { count });
|
|
41
|
+
badge.setAttribute('aria-label', label);
|
|
42
|
+
badge.title = label;
|
|
43
|
+
} else {
|
|
44
|
+
badge.removeAttribute('aria-label');
|
|
45
|
+
badge.removeAttribute('title');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function initAgentsStudio() {
|
|
50
|
+
const attention = watchStudioAttention({
|
|
51
|
+
paint: paintAttention,
|
|
52
|
+
read: async (sources) => {
|
|
53
|
+
const res = await fetch('/api/studio-attention?sources=' + sources.join(','), { credentials: 'same-origin', signal: AbortSignal.timeout(10000) });
|
|
54
|
+
if (!res.ok) throw new Error('Studio attention is unavailable');
|
|
55
|
+
return res.json();
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
on('agents:open', (detail) => { studio().then((m) => m.openStudio(detail && typeof detail === 'object' ? detail : {})).catch(failed); });
|
|
59
|
+
on('sync:assistant:agents-changed', (msg) => {
|
|
60
|
+
attention.refresh('drafts');
|
|
61
|
+
if (_studio) _studio.then((m) => m.onAgentsChanged(msg || {})).catch(() => {});
|
|
62
|
+
});
|
|
63
|
+
on('sync:assistant:team-changed', (msg) => {
|
|
64
|
+
attention.refresh('teams');
|
|
65
|
+
if (msg?.event === 'recovered') attention.refresh('workers');
|
|
66
|
+
if (_studio) _studio.then((m) => m.onTeamChanged(msg || {})).catch(() => {});
|
|
67
|
+
});
|
|
68
|
+
on('sync:skills:changed', (msg) => {
|
|
69
|
+
if (!msg?.event?.type || msg.event.type === 'review.changed') attention.refresh('skills');
|
|
70
|
+
});
|
|
71
|
+
on('sync:assistant:automation-records-changed', ({ templates, schedules }) => {
|
|
72
|
+
if (templates) attention.refresh('automations');
|
|
73
|
+
if (schedules) attention.refresh('schedules');
|
|
74
|
+
});
|
|
75
|
+
for (const event of ['assistant:dispatch', 'assistant:run-removed']) {
|
|
76
|
+
on('sync:' + event, () => attention.refresh('workers'));
|
|
77
|
+
}
|
|
78
|
+
for (const event of ['sidepanel:run-created', 'sidepanel:run-updated',
|
|
79
|
+
'sidepanel:run-completed', 'sidepanel:run-failed', 'sidepanel:run-stopped']) {
|
|
80
|
+
on('sync:' + event, () => attention.refresh('runs'));
|
|
81
|
+
}
|
|
82
|
+
const showMenu = (guest) => {
|
|
83
|
+
const item = document.querySelector('.menubar-item[data-menu="agents"]');
|
|
84
|
+
if (item) item.hidden = guest;
|
|
85
|
+
};
|
|
86
|
+
// The sync handshake identifies the owner on first paint and again after every reconnect.
|
|
87
|
+
on('session:info', ({ isGuest: guest }) => {
|
|
88
|
+
showMenu(guest);
|
|
89
|
+
attention.setOwner(!guest);
|
|
90
|
+
});
|
|
91
|
+
window.addEventListener('focus', () => attention.refresh());
|
|
92
|
+
showMenu(isGuest());
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function failed(err) {
|
|
96
|
+
console.error('Agents Studio could not be loaded', err);
|
|
97
|
+
}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
// ═══════════════════════════════════════════
|
|
2
|
-
// SynaBun — Antigravity Panel (
|
|
2
|
+
// SynaBun — Antigravity Panel (facade)
|
|
3
3
|
// The Antigravity side panel's entry point: one stable surface for the shared
|
|
4
4
|
// UI modules (navbar, tray, detached session windows, the native-loop router,
|
|
5
|
-
// the File Explorer's Send to). Implementation lives in ./agy
|
|
5
|
+
// the File Explorer's Send to). Implementation lives in ./agy/, loaded on first
|
|
6
|
+
// use or in idle time after the page is shown (sidepanel-lazy.js). A panel that
|
|
7
|
+
// has not loaded is not open.
|
|
6
8
|
// ═══════════════════════════════════════════
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
import { antigravityPanelModule as panel } from './sidepanel-lazy.js';
|
|
11
|
+
|
|
12
|
+
export const toggleAntigravityPanel = panel.asyncExport('toggleAntigravityPanel');
|
|
13
|
+
export const isAntigravityPanelOpen = panel.syncExport('isAntigravityPanelOpen', false);
|
|
14
|
+
export const bootAntigravityPanel = panel.deferredExport('bootAntigravityPanel');
|
|
15
|
+
export const openAntigravityWithPrompt = panel.asyncExport('openAntigravityWithPrompt');
|
|
16
|
+
export const attachPathToAntigravity = panel.deferredExport('attachPathToAntigravity');
|
|
17
|
+
export const attachAntigravityAutomation = panel.asyncExport('attachAntigravityAutomation');
|
|
18
|
+
export const detachAntigravityAutomation = panel.deferredExport('detachAntigravityAutomation');
|
|
19
|
+
export const handleAntigravityAutomationEvent = panel.deferredExport('handleAntigravityAutomationEvent');
|
|
20
|
+
export const antigravityPanelDefaults = panel.syncExport('antigravityPanelDefaults', () => ({ project: '' }));
|
|
21
|
+
export const endHostedAntigravitySessions = panel.syncExport('endHostedAntigravitySessions', undefined);
|
|
@@ -936,8 +936,8 @@ function showLaunchInline(params) {
|
|
|
936
936
|
|
|
937
937
|
const iterCount = params.iterations || 10;
|
|
938
938
|
const timeCount = params.maxMinutes || 30;
|
|
939
|
-
// The MoreLogin profile of this one launch (morelogin-profile-field.js). Every dialog opens on the default
|
|
940
|
-
//
|
|
939
|
+
// The MoreLogin profile of this one launch (morelogin-profile-field.js). Every dialog opens on the default
|
|
940
|
+
// AI browser: a profile is never carried over from the launch before.
|
|
941
941
|
ensureMoreLoginProfiles();
|
|
942
942
|
|
|
943
943
|
contentEl.innerHTML = `
|
|
@@ -1509,7 +1509,7 @@ async function confirmLaunch() {
|
|
|
1509
1509
|
const effort = normalizeEffortForProfile(_launchProfile, _launchEffort) || undefined;
|
|
1510
1510
|
const tools = strictToolHost(_launchProfile) ? _launchTools : undefined;
|
|
1511
1511
|
const codexAccountId = _launchProfile === 'codex' ? (_launchAccount || 'default') : undefined;
|
|
1512
|
-
// Read before the panel closes. None chosen (or the field not shown): the default
|
|
1512
|
+
// Read before the panel closes. None chosen (or the field not shown): the default AI browser.
|
|
1513
1513
|
const moreLoginChoice = readMoreLoginField('as-launch-mlprofile');
|
|
1514
1514
|
const moreloginEnvId = moreLoginChoice?.moreloginEnvId || undefined;
|
|
1515
1515
|
const moreloginEnvName = moreloginEnvId ? (moreLoginChoice.moreloginEnvName || undefined) : undefined;
|