synabun 2.3.1 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/README.md +1 -1
- package/browser-extension/content.js +189 -0
- package/browser-extension/engine.js +508 -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 +250 -0
- package/browser-extension/popup-view.js +151 -0
- package/browser-extension/popup.css +166 -0
- package/browser-extension/popup.html +108 -0
- package/browser-extension/popup.js +359 -0
- package/browser-extension/protocol.js +232 -0
- package/browser-extension/service-worker.js +275 -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/lib/data-home-files.js +45 -0
- package/lib/data-home-migration.js +34 -58
- 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 +95 -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 +92 -9
- package/mcp-server/dist/tools/agents.d.ts.map +1 -1
- package/mcp-server/dist/tools/agents.js +163 -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 +191 -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 +177 -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 +1119 -47
- package/neural-interface/i18n/pt-BR.json +1119 -47
- package/neural-interface/lib/account-usage.js +1 -1
- package/neural-interface/lib/agents/builtins.json +207 -0
- 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 +885 -0
- package/neural-interface/lib/agents/resolve.js +603 -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-brains/opencode.js +60 -11
- 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 +351 -121
- 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 +432 -47
- 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 +449 -94
- 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/backup-service.js +64 -105
- 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 +264 -0
- package/neural-interface/lib/browser-extension-bridge.js +441 -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-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/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/effort-levels.js +10 -1
- 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 +194 -8
- package/neural-interface/lib/native-loop-runtime.js +26 -7
- package/neural-interface/lib/opencode-build-preflight.js +28 -8
- package/neural-interface/lib/opencode-native-boundary.js +83 -13
- package/neural-interface/lib/opencode-serve-records.js +14 -9
- package/neural-interface/lib/page-session.js +1 -1
- package/neural-interface/lib/peer-identity.js +73 -29
- package/neural-interface/lib/process-identity.js +68 -7
- package/neural-interface/lib/request-gate.js +3 -0
- package/neural-interface/lib/screenshot-location.js +33 -0
- package/neural-interface/lib/session-cache-builder.js +41 -3
- 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/package-lock.json +2 -2
- package/neural-interface/package.json +1 -1
- package/neural-interface/public/extension-setup.html +107 -0
- package/neural-interface/public/index.html +103 -12
- package/neural-interface/public/offline.html +4 -3
- 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/api.js +2 -1
- 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 +37 -6
- package/neural-interface/public/shared/assistant/asst-route.js +80 -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/cc-dropdown.js +21 -15
- 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 +34 -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/owner-authority-view.js +4 -10
- package/neural-interface/public/shared/page-session.js +1 -1
- 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/start-bridge.js +2 -2
- 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 +694 -50
- 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 +83 -19
- 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 +50 -21
- 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-owner-authority.js +48 -25
- 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 +363 -400
- 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 +6 -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/sw.js +4 -3
- 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 +30 -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 +1083 -164
- package/npm-shrinkwrap.json +2 -2
- package/package.json +4 -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,256 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════
|
|
2
|
+
// SynaBun Neural Interface — the Copy button of a code block: the page side
|
|
3
|
+
// ═══════════════════════════════════════════
|
|
4
|
+
//
|
|
5
|
+
// One Copy button on every block an agent shows for the user to copy, in the six side panels (Assistant, Claude
|
|
6
|
+
// Code, Codex, OpenCode, Antigravity, Maritaca), their detached windows and their worker and sub-agent views. What
|
|
7
|
+
// the button is, what a block copies and how it is copied are decided in code-copy.js; this module gives that the
|
|
8
|
+
// page:
|
|
9
|
+
//
|
|
10
|
+
// installCodeCopy(doc) the stylesheet and ONE click listener for the whole document (a panel's style
|
|
11
|
+
// injector calls it, so a detached window gets its own). A button needs nothing
|
|
12
|
+
// else: one in a stored transcript, drawn by a stream or put back by a re-render
|
|
13
|
+
// works the moment it is on the page.
|
|
14
|
+
// decorateCodeBlocks(root) the button on every <pre> under `root` that has none, for a block drawn without
|
|
15
|
+
// the Markdown renderers (a tool result, an older stored transcript); idempotent,
|
|
16
|
+
// and it replaces the panels' earlier buttons.
|
|
17
|
+
//
|
|
18
|
+
// The Markdown renderers write the button into their output (withCodeCopyButtons), so it survives every redraw
|
|
19
|
+
// without a timer or an observer. No imports but code-copy.js, and nothing runs at import: `node --test` loads it.
|
|
20
|
+
|
|
21
|
+
import {
|
|
22
|
+
ANY_CODE_COPY_SELECTOR, CODE_COPY_CLASS, CODE_COPY_FEEDBACK_MS,
|
|
23
|
+
codeBlockText, codeCopyText, setCodeCopyTranslator, writeClipboard,
|
|
24
|
+
} from './code-copy.js';
|
|
25
|
+
|
|
26
|
+
export const CODE_COPY_STYLE_ID = 'sb-code-copy-styles';
|
|
27
|
+
|
|
28
|
+
// The style guide's tokens (DESIGN.md): the app's text and surface variables with their dark values as fallbacks
|
|
29
|
+
// (a panel styles its own scope; a detached window may load styles.css late), JetBrains Mono, the 5px control
|
|
30
|
+
// radius, status.success / status.danger for the outcome. The icons are masks, coloured by `currentColor`.
|
|
31
|
+
const ICON_COPY = "url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linejoin='round'%3E%3Crect x='5.5' y='5.5' width='8' height='8' rx='1.5'/%3E%3Cpath d='M10.5 5.5V3.5a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2'/%3E%3C/svg%3E\")";
|
|
32
|
+
const ICON_DONE = "url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3.5 7.2 6 9.6l4.6-5.2' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\")";
|
|
33
|
+
const ICON_FAILED = "url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M7 3.5v4.2M7 10.2v.1' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E\")";
|
|
34
|
+
|
|
35
|
+
export const CODE_COPY_CSS = `
|
|
36
|
+
/* ── The Copy button of a code block (code-copy.js, ui-code-copy.js) ──
|
|
37
|
+
The block keeps a strip of its own above its first line for the button, so the button never covers code,
|
|
38
|
+
at any panel width. A block's code scrolls sideways inside it, so a long line never carries the button away.
|
|
39
|
+
!important: each panel sets its own padding on its <pre>, with selectors of every weight. */
|
|
40
|
+
pre:has(> .${CODE_COPY_CLASS}) { position: relative !important; padding-top: 28px !important; }
|
|
41
|
+
pre:has(> .${CODE_COPY_CLASS}) > code { display: block; overflow-x: auto; }
|
|
42
|
+
pre > button.${CODE_COPY_CLASS} {
|
|
43
|
+
position: absolute; top: 4px; right: 4px; z-index: 1;
|
|
44
|
+
display: inline-flex; align-items: center; gap: 4px;
|
|
45
|
+
box-sizing: border-box; height: 20px; min-width: 20px; margin: 0; padding: 0 6px;
|
|
46
|
+
border: 1px solid transparent; border-radius: 5px;
|
|
47
|
+
background: transparent; box-shadow: none;
|
|
48
|
+
color: var(--t-secondary, rgba(255,255,255,0.5));
|
|
49
|
+
font: 500 10px/1 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
50
|
+
letter-spacing: 0.02em; text-transform: none; white-space: nowrap;
|
|
51
|
+
cursor: pointer; user-select: none; -webkit-user-select: none;
|
|
52
|
+
opacity: 0.6;
|
|
53
|
+
transition: opacity 0.15s, color 0.15s, background-color 0.15s, border-color 0.15s;
|
|
54
|
+
}
|
|
55
|
+
pre > button.${CODE_COPY_CLASS}::before {
|
|
56
|
+
content: ''; flex: none; width: 11px; height: 11px; background: currentColor;
|
|
57
|
+
-webkit-mask: ${ICON_COPY} center / contain no-repeat; mask: ${ICON_COPY} center / contain no-repeat;
|
|
58
|
+
}
|
|
59
|
+
pre > button.${CODE_COPY_CLASS}::after { content: attr(data-label); }
|
|
60
|
+
pre:hover > button.${CODE_COPY_CLASS}, pre > button.${CODE_COPY_CLASS}:focus-visible,
|
|
61
|
+
pre > button.${CODE_COPY_CLASS}[data-state] { opacity: 1; }
|
|
62
|
+
pre > button.${CODE_COPY_CLASS}:hover {
|
|
63
|
+
color: var(--t-bright, rgba(255,255,255,0.9));
|
|
64
|
+
background: var(--s-hover, rgba(255,255,255,0.08)); border-color: var(--b-light, rgba(255,255,255,0.10));
|
|
65
|
+
}
|
|
66
|
+
pre > button.${CODE_COPY_CLASS}:focus-visible {
|
|
67
|
+
color: var(--t-bright, rgba(255,255,255,0.9));
|
|
68
|
+
outline: 1px solid var(--b-visible, rgba(255,255,255,0.22)); outline-offset: 1px;
|
|
69
|
+
}
|
|
70
|
+
pre > button.${CODE_COPY_CLASS}[data-state="copied"] { color: #86efac; }
|
|
71
|
+
pre > button.${CODE_COPY_CLASS}[data-state="copied"]::before { -webkit-mask-image: ${ICON_DONE}; mask-image: ${ICON_DONE}; }
|
|
72
|
+
pre > button.${CODE_COPY_CLASS}[data-state="failed"] { color: #fca5a5; }
|
|
73
|
+
pre > button.${CODE_COPY_CLASS}[data-state="failed"]::before { -webkit-mask-image: ${ICON_FAILED}; mask-image: ${ICON_FAILED}; }
|
|
74
|
+
/* A touch screen has no hover: the button is always shown there. */
|
|
75
|
+
@media (hover: none) { pre > button.${CODE_COPY_CLASS} { opacity: 1; } }
|
|
76
|
+
@media (prefers-reduced-motion: reduce) { pre > button.${CODE_COPY_CLASS} { transition: none; } }
|
|
77
|
+
`;
|
|
78
|
+
|
|
79
|
+
const installed = new WeakSet();
|
|
80
|
+
const timers = new WeakMap();
|
|
81
|
+
let askedI18n = false;
|
|
82
|
+
|
|
83
|
+
const tagOf = (node) => String(node?.localName || node?.nodeName || '').toLowerCase();
|
|
84
|
+
|
|
85
|
+
/** The shared stylesheet in `doc`, once. */
|
|
86
|
+
export function injectCodeCopyStyles(doc = globalThis.document) {
|
|
87
|
+
if (!doc?.createElement || !doc.head || doc.getElementById?.(CODE_COPY_STYLE_ID)) return;
|
|
88
|
+
const style = doc.createElement('style');
|
|
89
|
+
style.id = CODE_COPY_STYLE_ID;
|
|
90
|
+
style.textContent = CODE_COPY_CSS;
|
|
91
|
+
doc.head.appendChild(style);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// The app's locale, read where the app has one. Loaded on demand: i18n.js needs a page, and this module must not.
|
|
95
|
+
function askI18n() {
|
|
96
|
+
if (askedI18n || typeof window === 'undefined') return;
|
|
97
|
+
askedI18n = true;
|
|
98
|
+
import('./i18n.js')
|
|
99
|
+
.then(({ t }) => {
|
|
100
|
+
if (typeof t !== 'function') return;
|
|
101
|
+
setCodeCopyTranslator((key, params) => {
|
|
102
|
+
const id = `codeCopy.${key}`;
|
|
103
|
+
const text = t(id, params);
|
|
104
|
+
return text && text !== id ? text : '';
|
|
105
|
+
});
|
|
106
|
+
})
|
|
107
|
+
.catch(() => { /* no i18n here (a detached window before its bundle, a test page): the English */ });
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* The Copy buttons of code blocks work in `doc`: the stylesheet and one click listener (capture phase, so the
|
|
112
|
+
* click never reaches a card header or a link under the block). Safe to call any number of times.
|
|
113
|
+
* @returns {boolean} true the first time for this document
|
|
114
|
+
*/
|
|
115
|
+
export function installCodeCopy(doc = globalThis.document) {
|
|
116
|
+
if (!doc || typeof doc.addEventListener !== 'function' || installed.has(doc)) return false;
|
|
117
|
+
installed.add(doc);
|
|
118
|
+
injectCodeCopyStyles(doc);
|
|
119
|
+
doc.addEventListener('click', onDocumentClick, true);
|
|
120
|
+
askI18n();
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function newButton(doc) {
|
|
125
|
+
const button = doc.createElement('button');
|
|
126
|
+
button.type = 'button';
|
|
127
|
+
button.className = CODE_COPY_CLASS;
|
|
128
|
+
button.setAttribute('data-label', codeCopyText('copy'));
|
|
129
|
+
button.setAttribute('aria-label', codeCopyText('label'));
|
|
130
|
+
return button;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function resetButton(button) {
|
|
134
|
+
const view = button.ownerDocument?.defaultView || globalThis;
|
|
135
|
+
const timer = timers.get(button);
|
|
136
|
+
if (timer) view.clearTimeout(timer);
|
|
137
|
+
timers.delete(button);
|
|
138
|
+
button.removeAttribute('data-state');
|
|
139
|
+
button.setAttribute('data-label', codeCopyText('copy'));
|
|
140
|
+
button.setAttribute('aria-label', codeCopyText('label'));
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function showOutcome(button, state) {
|
|
144
|
+
const view = button.ownerDocument?.defaultView || globalThis;
|
|
145
|
+
const timer = timers.get(button);
|
|
146
|
+
if (timer) view.clearTimeout(timer);
|
|
147
|
+
button.setAttribute('data-state', state);
|
|
148
|
+
button.setAttribute('data-label', codeCopyText(state));
|
|
149
|
+
button.setAttribute('aria-label', codeCopyText(state === 'copied' ? 'copiedLabel' : 'failedLabel'));
|
|
150
|
+
timers.set(button, view.setTimeout(() => resetButton(button), CODE_COPY_FEEDBACK_MS[state] || 1500));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function skipped(pre, skip) {
|
|
154
|
+
if (pre.closest('[data-no-code-copy]')) return true;
|
|
155
|
+
if (typeof skip === 'function') return !!skip(pre);
|
|
156
|
+
return typeof skip === 'string' && skip ? !!pre.closest(skip) : false;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* One Copy button on every <pre> under `root` (and `root` itself when it is one): a block with none gets one, an
|
|
161
|
+
* earlier panel's button is replaced, a second one is removed, and a button a stored transcript kept in its
|
|
162
|
+
* "Copied" state shows "Copy" again. A block matched by `skip` (a selector of an ancestor, or a function of the
|
|
163
|
+
* <pre>) or inside `[data-no-code-copy]` has a copy control of its own and keeps no shared button.
|
|
164
|
+
* @returns {number} the buttons added
|
|
165
|
+
*/
|
|
166
|
+
export function decorateCodeBlocks(root, { skip = null } = {}) {
|
|
167
|
+
if (!root || typeof root.querySelectorAll !== 'function') return 0;
|
|
168
|
+
const doc = root.ownerDocument || globalThis.document;
|
|
169
|
+
const pres = tagOf(root) === 'pre' ? [root, ...root.querySelectorAll('pre')] : [...root.querySelectorAll('pre')];
|
|
170
|
+
let added = 0;
|
|
171
|
+
for (const pre of pres) {
|
|
172
|
+
const buttons = [...pre.children].filter((child) => child.matches?.(ANY_CODE_COPY_SELECTOR));
|
|
173
|
+
if (skipped(pre, skip)) { for (const button of buttons) button.remove(); continue; }
|
|
174
|
+
const keep = buttons.find((button) => button.classList.contains(CODE_COPY_CLASS)) || null;
|
|
175
|
+
for (const button of buttons) if (button !== keep) button.remove();
|
|
176
|
+
if (keep) {
|
|
177
|
+
if (keep.hasAttribute('data-state') && !timers.has(keep)) resetButton(keep);
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
pre.appendChild(newButton(doc));
|
|
181
|
+
added += 1;
|
|
182
|
+
}
|
|
183
|
+
return added;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// The block's text through a hidden textarea and execCommand('copy'): what copies where the Clipboard API is
|
|
187
|
+
// missing or refused. Focus goes back where it was (the button, for a keyboard user).
|
|
188
|
+
function execCopy(doc, text) {
|
|
189
|
+
if (typeof doc?.execCommand !== 'function' || !doc.body) return false;
|
|
190
|
+
const active = doc.activeElement;
|
|
191
|
+
const area = doc.createElement('textarea');
|
|
192
|
+
area.value = text;
|
|
193
|
+
area.setAttribute('readonly', '');
|
|
194
|
+
area.setAttribute('aria-hidden', 'true');
|
|
195
|
+
area.tabIndex = -1;
|
|
196
|
+
area.style.cssText = 'position:fixed;top:0;left:0;width:1px;height:1px;padding:0;border:0;margin:0;opacity:0;pointer-events:none;';
|
|
197
|
+
doc.body.appendChild(area);
|
|
198
|
+
let ok = false;
|
|
199
|
+
try {
|
|
200
|
+
area.focus({ preventScroll: true });
|
|
201
|
+
area.select();
|
|
202
|
+
area.setSelectionRange(0, text.length);
|
|
203
|
+
ok = doc.execCommand('copy') === true;
|
|
204
|
+
} catch { ok = false; }
|
|
205
|
+
area.remove();
|
|
206
|
+
try { active?.focus?.({ preventScroll: true }); } catch { /* the button left the page */ }
|
|
207
|
+
return ok;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Nothing could copy: the block's text is selected, for the keyboard shortcut.
|
|
211
|
+
function selectBlock(pre) {
|
|
212
|
+
try {
|
|
213
|
+
const doc = pre.ownerDocument;
|
|
214
|
+
const range = doc.createRange();
|
|
215
|
+
range.selectNodeContents(pre.querySelector(':scope > code') || pre);
|
|
216
|
+
const selection = doc.getSelection();
|
|
217
|
+
selection.removeAllRanges();
|
|
218
|
+
selection.addRange(range);
|
|
219
|
+
} catch { /* no selection API */ }
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Copy the block a button belongs to, then say how it went on the button ("Copied", or "Not copied" with the
|
|
224
|
+
* code selected). `clipboard` / `fallback` stand in for the page's in a test.
|
|
225
|
+
* @returns {Promise<'clipboard' | 'fallback' | null>}
|
|
226
|
+
*/
|
|
227
|
+
export async function copyCodeBlock(button, { clipboard, fallback } = {}) {
|
|
228
|
+
const pre = button?.closest?.('pre');
|
|
229
|
+
if (!pre) return null;
|
|
230
|
+
const doc = button.ownerDocument || globalThis.document;
|
|
231
|
+
const view = doc.defaultView || globalThis;
|
|
232
|
+
const how = await writeClipboard(codeBlockText(pre), {
|
|
233
|
+
clipboard: clipboard === undefined ? view.navigator?.clipboard : clipboard,
|
|
234
|
+
fallback: fallback === undefined ? (text) => execCopy(doc, text) : fallback,
|
|
235
|
+
});
|
|
236
|
+
if (!button.isConnected) return how;
|
|
237
|
+
if (how) showOutcome(button, 'copied');
|
|
238
|
+
else { selectBlock(pre); showOutcome(button, 'failed'); }
|
|
239
|
+
return how;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function onDocumentClick(event) {
|
|
243
|
+
const found = event.target?.closest?.(ANY_CODE_COPY_SELECTOR);
|
|
244
|
+
if (!found || tagOf(found.parentElement) !== 'pre') return;
|
|
245
|
+
event.preventDefault();
|
|
246
|
+
event.stopPropagation();
|
|
247
|
+
let button = found;
|
|
248
|
+
if (!found.classList.contains(CODE_COPY_CLASS)) {
|
|
249
|
+
// A button an earlier build stored with the transcript: the shared one takes its place, then copies.
|
|
250
|
+
const hadFocus = found.ownerDocument?.activeElement === found;
|
|
251
|
+
button = newButton(found.ownerDocument);
|
|
252
|
+
found.replaceWith(button);
|
|
253
|
+
if (hadFocus) button.focus({ preventScroll: true });
|
|
254
|
+
}
|
|
255
|
+
copyCodeBlock(button).catch(() => {});
|
|
256
|
+
}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
// ═══════════════════════════════════════════
|
|
2
|
-
// SynaBun — Codex Panel (
|
|
3
|
-
// Actual implementation in ./cdx/ directory
|
|
2
|
+
// SynaBun — Codex Panel (facade)
|
|
3
|
+
// Actual implementation in ./cdx/ directory, loaded on first use or in idle time after the page
|
|
4
|
+
// is shown (sidepanel-lazy.js). The names are the panel's own; a panel that has not loaded is
|
|
5
|
+
// not open.
|
|
4
6
|
// ═══════════════════════════════════════════
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
import { codexPanelModule as panel, codexTabsModule as tabs } from './sidepanel-lazy.js';
|
|
9
|
+
|
|
10
|
+
export const toggleCodexPanel = panel.asyncExport('toggleCodexPanel');
|
|
11
|
+
export const isCodexPanelOpen = panel.syncExport('isCodexPanelOpen', false);
|
|
12
|
+
export const bootCodexPanel = panel.deferredExport('bootCodexPanel');
|
|
13
|
+
export const attachCodexAutomation = panel.asyncExport('attachCodexAutomation');
|
|
14
|
+
export const detachCodexAutomation = panel.asyncExport('detachCodexAutomation');
|
|
15
|
+
export const handleCodexAutomationEvent = panel.deferredExport('handleCodexAutomationEvent');
|
|
16
|
+
// A path chip in the active Codex tab (the File Explorer's Send to, after the panel opened).
|
|
17
|
+
export const addPathChip = tabs.deferredExport('addPathChip');
|
|
@@ -32,7 +32,7 @@ import { t } from './i18n.js';
|
|
|
32
32
|
import { state, emit } from './state.js';
|
|
33
33
|
import { actionForKey, getShortcutLabel, hasAction, runAction } from './ui-keybinds.js';
|
|
34
34
|
import { isGuest, hasPermission } from './ui-sync.js';
|
|
35
|
-
import { sendToPanel } from './
|
|
35
|
+
import { sendToPanel } from './claude-panel-lazy.js';
|
|
36
36
|
import { closeMemoryCard, focusLinkedMemories, getOpenCardsSnapshot } from './ui-detail.js';
|
|
37
37
|
import { formatMemoryForCLI } from './ui-terminal.js';
|
|
38
38
|
import { fetchMemory } from './api.js';
|
|
@@ -16,11 +16,10 @@ import { sendToFocusedSession } from './ui-sidepanel-windows.js';
|
|
|
16
16
|
import { KEYS } from './constants.js';
|
|
17
17
|
import { registerAction } from './ui-keybinds.js';
|
|
18
18
|
import { storage } from './storage.js';
|
|
19
|
-
import { sendToPanel as sendToClaudePanel } from './
|
|
19
|
+
import { sendToPanel as sendToClaudePanel } from './claude-panel-lazy.js';
|
|
20
20
|
import { attachPathToOpencode } from './ui-opencode-panel-v2.js';
|
|
21
21
|
import { attachPathToAntigravity, isAntigravityPanelOpen, toggleAntigravityPanel } from './ui-antigravity-panel.js';
|
|
22
|
-
import { isCodexPanelOpen, toggleCodexPanel } from './
|
|
23
|
-
import { addPathChip as addCodexPathChip } from './cdx/cdx-tabs.js';
|
|
22
|
+
import { isCodexPanelOpen, toggleCodexPanel, addPathChip as addCodexPathChip } from './ui-codex-panel.js';
|
|
24
23
|
import { on, emit, state } from './state.js';
|
|
25
24
|
import {
|
|
26
25
|
closeEditorPanel, initEditorPanel, isEditorPanelOpen,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// ═══════════════════════════════════════════
|
|
4
4
|
|
|
5
5
|
import { emit, on } from './state.js';
|
|
6
|
-
import { loadIfaceConfig, applyIfaceConfig, saveIfaceConfig } from './
|
|
6
|
+
import { loadIfaceConfig, applyIfaceConfig, saveIfaceConfig } from './iface-config.js';
|
|
7
7
|
import { storage } from './storage.js';
|
|
8
8
|
import { KEYS } from './constants.js';
|
|
9
9
|
|
|
@@ -32,6 +32,9 @@ let _mascot = null;
|
|
|
32
32
|
// held (sockets, terminals, panel sessions) was the old server's, so once the
|
|
33
33
|
// server is back the page loads again instead of carrying on.
|
|
34
34
|
let _restartShown = false;
|
|
35
|
+
let currentBoot = '';
|
|
36
|
+
let appWasVisible = false;
|
|
37
|
+
let reloadPending = false;
|
|
35
38
|
// The tab's title from before the restart, for when it is refused.
|
|
36
39
|
let _restartTitle = null;
|
|
37
40
|
|
|
@@ -128,7 +131,22 @@ export function showLoadingError(title, sub, canStart, serverOffline) {
|
|
|
128
131
|
*/
|
|
129
132
|
export function hideLoading(delay = 400) {
|
|
130
133
|
const $overlay = $('loading-overlay');
|
|
131
|
-
if ($overlay) setTimeout(() =>
|
|
134
|
+
if ($overlay) setTimeout(() => {
|
|
135
|
+
if (_offlineBridge) return;
|
|
136
|
+
markOnce(OVERLAY_HIDDEN_MARK);
|
|
137
|
+
concealOverlay($overlay);
|
|
138
|
+
}, delay);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** The moment the overlay started to fade for the first time on this page (the time the user waited). */
|
|
142
|
+
export const OVERLAY_HIDDEN_MARK = 'synabun:overlay-hidden';
|
|
143
|
+
|
|
144
|
+
function markOnce(name) {
|
|
145
|
+
try {
|
|
146
|
+
if (typeof performance?.mark !== 'function') return;
|
|
147
|
+
if (performance.getEntriesByName?.(name, 'mark')?.length) return;
|
|
148
|
+
performance.mark(name);
|
|
149
|
+
} catch {}
|
|
132
150
|
}
|
|
133
151
|
|
|
134
152
|
/**
|
|
@@ -154,11 +172,13 @@ function resetLoadingToConnecting() {
|
|
|
154
172
|
const $sub = $('loading-sub');
|
|
155
173
|
const $action = $('loading-action');
|
|
156
174
|
const $actionStatus = $('loading-action-status');
|
|
175
|
+
const $retryStatus = $('loading-retry-status');
|
|
157
176
|
|
|
158
177
|
if ($text) $text.textContent = t('loading.connecting');
|
|
159
178
|
if ($sub) $sub.textContent = t('loading.initializingNeural');
|
|
160
179
|
if ($action) $action.style.display = 'none';
|
|
161
180
|
if ($actionStatus) $actionStatus.textContent = '';
|
|
181
|
+
if ($retryStatus) $retryStatus.textContent = '';
|
|
162
182
|
clearStartStatus();
|
|
163
183
|
clearRestartLook();
|
|
164
184
|
if (_statusDot) _statusDot.classList.remove('error');
|
|
@@ -175,6 +195,7 @@ function resetLoadingToConnecting() {
|
|
|
175
195
|
*/
|
|
176
196
|
export function rememberHealth(health) {
|
|
177
197
|
if (!health) return;
|
|
198
|
+
if (!currentBoot && health.bootId) currentBoot = health.bootId;
|
|
178
199
|
try {
|
|
179
200
|
if (health.projectDir) {
|
|
180
201
|
localStorage.setItem('synabun-project-dir', health.projectDir);
|
|
@@ -271,6 +292,12 @@ function mountMascot() {
|
|
|
271
292
|
try {
|
|
272
293
|
const still = host.querySelector('svg');
|
|
273
294
|
_mascot = createMascot(host, { width: 160, height: 80, pose: 'sleep', active: false });
|
|
295
|
+
// The rig already paints a vector face for every pose. Show it until the
|
|
296
|
+
// current raster artwork loads, and again if the next pose cannot load.
|
|
297
|
+
const svg = _mascot.el;
|
|
298
|
+
const art = svg?.querySelector('.syna-art');
|
|
299
|
+
art?.addEventListener('load', () => svg.classList.add('art-ready'));
|
|
300
|
+
art?.addEventListener('error', () => svg.classList.remove('art-ready'));
|
|
274
301
|
if (still && still !== _mascot.el) still.style.display = 'none';
|
|
275
302
|
} catch {
|
|
276
303
|
_mascot = null;
|
|
@@ -395,7 +422,7 @@ function watchForServer() {
|
|
|
395
422
|
async function probeServer() {
|
|
396
423
|
const health = await fetchHealth();
|
|
397
424
|
return {
|
|
398
|
-
up:
|
|
425
|
+
up: health?.ok === true,
|
|
399
426
|
boot: typeof health?.bootId === 'string' ? health.bootId : '',
|
|
400
427
|
stopping: health?.restarting === true,
|
|
401
428
|
};
|
|
@@ -414,23 +441,35 @@ function openBridge() {
|
|
|
414
441
|
if (_offlineBridge !== bridge) return;
|
|
415
442
|
renderStart(snap);
|
|
416
443
|
},
|
|
417
|
-
onState(state) {
|
|
418
|
-
if (_offlineBridge
|
|
419
|
-
if (state !== 'online') return;
|
|
420
|
-
// Back from a restart: the page loads again, after the frame that says so.
|
|
421
|
-
if (_restartShown) {
|
|
422
|
-
setTimeout(() => window.location.reload(), START_LIMITS.reloadDelayMs);
|
|
423
|
-
return;
|
|
424
|
-
}
|
|
425
|
-
resetLoadingToConnecting();
|
|
426
|
-
emit('loading:retried');
|
|
427
|
-
if (_initCallback) _initCallback();
|
|
444
|
+
onState(state, { boot }) {
|
|
445
|
+
if (_offlineBridge === bridge && state === 'online') recoverConnection(boot);
|
|
428
446
|
},
|
|
429
447
|
});
|
|
430
448
|
_offlineBridge = bridge;
|
|
431
449
|
return bridge;
|
|
432
450
|
}
|
|
433
451
|
|
|
452
|
+
/** Complete a healthy retry, whether the person pressed Retry or the bridge saw it first. */
|
|
453
|
+
function recoverConnection(boot) {
|
|
454
|
+
if (reloadPending) return;
|
|
455
|
+
// Older servers have no boot ID. A running page then needs a fresh session
|
|
456
|
+
// after an outage, while an unfinished first boot can retry initialization.
|
|
457
|
+
const needsReload = currentBoot && boot ? currentBoot !== boot : appWasVisible;
|
|
458
|
+
if (_restartShown || needsReload) {
|
|
459
|
+
reloadPending = true;
|
|
460
|
+
setTimeout(() => window.location.reload(), START_LIMITS.reloadDelayMs);
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
resetLoadingToConnecting();
|
|
464
|
+
if (appWasVisible) {
|
|
465
|
+
appWasVisible = false;
|
|
466
|
+
concealOverlay($('loading-overlay'));
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
emit('loading:retried');
|
|
470
|
+
if (_initCallback) _initCallback();
|
|
471
|
+
}
|
|
472
|
+
|
|
434
473
|
// ═══════════════════════════════════════════
|
|
435
474
|
// Restart Server
|
|
436
475
|
// ═══════════════════════════════════════════
|
|
@@ -572,24 +611,23 @@ function handleCopyCommand() {
|
|
|
572
611
|
* Pings /api/health and re-triggers init on success.
|
|
573
612
|
*/
|
|
574
613
|
async function handleRetryConnection() {
|
|
614
|
+
const bridge = _offlineBridge;
|
|
575
615
|
const $status = $('loading-retry-status');
|
|
576
616
|
if ($status) $status.textContent = t('loading.checking');
|
|
577
617
|
|
|
578
618
|
try {
|
|
579
619
|
const health = await fetchHealth();
|
|
620
|
+
if (_offlineBridge !== bridge) return;
|
|
580
621
|
// fetchHealth uses AbortSignal.timeout(3000) internally
|
|
581
|
-
if (health && health.
|
|
622
|
+
if (health?.ok === true && !health.restarting && !_restartShown) {
|
|
582
623
|
if ($status) $status.textContent = t('loading.connectedLoading');
|
|
583
|
-
|
|
584
|
-
if (_restartShown) { window.location.reload(); return; }
|
|
585
|
-
resetLoadingToConnecting();
|
|
586
|
-
emit('loading:retried');
|
|
587
|
-
if (_initCallback) _initCallback();
|
|
624
|
+
recoverConnection(health.bootId);
|
|
588
625
|
} else {
|
|
589
626
|
if ($status) $status.textContent = t('loading.notReadyYet');
|
|
590
627
|
setTimeout(() => { if ($status) $status.textContent = ''; }, 3000);
|
|
591
628
|
}
|
|
592
629
|
} catch {
|
|
630
|
+
if (_offlineBridge !== bridge) return;
|
|
593
631
|
if ($status) $status.textContent = t('loading.stillOffline');
|
|
594
632
|
setTimeout(() => { if ($status) $status.textContent = ''; }, 3000);
|
|
595
633
|
}
|
|
@@ -630,6 +668,32 @@ export function initLoading({ onInit } = {}) {
|
|
|
630
668
|
const retryBtn = $('loading-retry-btn');
|
|
631
669
|
if (retryBtn) retryBtn.addEventListener('click', handleRetryConnection);
|
|
632
670
|
|
|
671
|
+
let probing = false;
|
|
672
|
+
async function checkConnection() {
|
|
673
|
+
if (probing || _offlineBridge) return;
|
|
674
|
+
probing = true;
|
|
675
|
+
try {
|
|
676
|
+
let seen = await probeServer().catch(() => null);
|
|
677
|
+
// A close or a timed-out request after sleep can precede a healthy
|
|
678
|
+
// answer. Confirm the miss immediately, without waiting for another interval.
|
|
679
|
+
if (!seen && currentBoot && !_offlineBridge) seen = await probeServer().catch(() => null);
|
|
680
|
+
if (_offlineBridge) return;
|
|
681
|
+
if (seen?.up && !seen.stopping && !(currentBoot && seen.boot && currentBoot !== seen.boot)) {
|
|
682
|
+
currentBoot ||= seen.boot;
|
|
683
|
+
return;
|
|
684
|
+
}
|
|
685
|
+
// Preserve a specific startup database error until the app actually ran.
|
|
686
|
+
const overlay = $('loading-overlay');
|
|
687
|
+
if (!overlay || (seen && !seen.up && overlay.classList.contains('error') && !overlay.classList.contains('hidden'))) return;
|
|
688
|
+
appWasVisible = overlay.classList.contains('hidden');
|
|
689
|
+
revealOverlay(overlay);
|
|
690
|
+
showLoadingError(t('loading.serverOffline'), t('loading.serverNotRunning'), false, true);
|
|
691
|
+
if (appWasVisible) overlay.classList.add('over-app');
|
|
692
|
+
} finally { probing = false; }
|
|
693
|
+
}
|
|
694
|
+
setInterval(checkConnection, 3000);
|
|
695
|
+
on('sync:disconnected', checkConnection);
|
|
696
|
+
|
|
633
697
|
// ── The server says it is restarting (ui-sync.js): every window shows it ──
|
|
634
698
|
on('server:restarting', (msg) => beginRestart({ announced: true, boot: typeof msg?.bootId === 'string' ? msg.bootId : '' }));
|
|
635
699
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
// ═══════════════════════════════════════════
|
|
2
|
-
// SynaBun — Maritaca Panel (
|
|
2
|
+
// SynaBun — Maritaca Panel (facade)
|
|
3
3
|
// The Maritaca side panel's entry point: one stable surface for the shared UI modules (navbar, tray, detached
|
|
4
|
-
// session windows). Implementation lives in ./mtc
|
|
4
|
+
// session windows). Implementation lives in ./mtc/, loaded on first use or in idle time after the page is shown
|
|
5
|
+
// (sidepanel-lazy.js). A panel that has not loaded is not open.
|
|
5
6
|
// ═══════════════════════════════════════════
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
import { maritacaPanelModule as panel } from './sidepanel-lazy.js';
|
|
9
|
+
|
|
10
|
+
export const toggleMaritacaPanel = panel.asyncExport('toggleMaritacaPanel');
|
|
11
|
+
export const isMaritacaPanelOpen = panel.syncExport('isMaritacaPanelOpen', false);
|
|
12
|
+
export const bootMaritacaPanel = panel.deferredExport('bootMaritacaPanel');
|
|
13
|
+
export const openMaritacaWithPrompt = panel.asyncExport('openMaritacaWithPrompt');
|
|
14
|
+
export const maritacaPanelDefaults = panel.syncExport('maritacaPanelDefaults', () => ({ project: '' }));
|
|
15
|
+
export const endHostedMaritacaSessions = panel.syncExport('endHostedMaritacaSessions', undefined);
|
|
16
|
+
export const maritacaPanelDebug = panel.syncExport('maritacaPanelDebug', null);
|
|
@@ -140,6 +140,7 @@ export function initMenubar() {
|
|
|
140
140
|
wireViewMenu();
|
|
141
141
|
wireGraphMenu();
|
|
142
142
|
wireSkillsMenu();
|
|
143
|
+
wireAgentsMenu();
|
|
143
144
|
wireAutomationsMenu();
|
|
144
145
|
wireSchedulesButton();
|
|
145
146
|
wireTerminalMenu();
|
|
@@ -520,6 +521,28 @@ function wireSkillsMenu() {
|
|
|
520
521
|
registerAction('open-skills', () => emit('skills:open'));
|
|
521
522
|
}
|
|
522
523
|
|
|
524
|
+
// ── Agents Menu (agents-p5: Agents Studio, ui-agents.js answers agents:open) ──
|
|
525
|
+
|
|
526
|
+
function wireAgentsMenu() {
|
|
527
|
+
const items = {
|
|
528
|
+
'menu-open-agents-studio': () => emit('agents:open'),
|
|
529
|
+
'menu-agents-new': () => emit('agents:open', { view: 'create' }),
|
|
530
|
+
'menu-agents-review': () => emit('agents:open', { view: 'review' }),
|
|
531
|
+
'menu-agents-teams': () => emit('agents:open', { view: 'teams' }),
|
|
532
|
+
};
|
|
533
|
+
for (const [id, run] of Object.entries(items)) {
|
|
534
|
+
const item = $(id);
|
|
535
|
+
if (!item) continue;
|
|
536
|
+
item.addEventListener('click', () => {
|
|
537
|
+
closeAll();
|
|
538
|
+
run();
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
// Keyboard shortcut: open Agents Studio (via central keybinds)
|
|
543
|
+
registerAction('open-agents', () => emit('agents:open'));
|
|
544
|
+
}
|
|
545
|
+
|
|
523
546
|
// ── Automations Menu ──
|
|
524
547
|
|
|
525
548
|
function wireAutomationsMenu() {
|