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
|
@@ -2,68 +2,23 @@
|
|
|
2
2
|
// SynaBun Neural Interface — 3D Variant Entry Point (Memory Map)
|
|
3
3
|
// ═══════════════════════════════════════════
|
|
4
4
|
//
|
|
5
|
-
//
|
|
6
|
-
// The
|
|
7
|
-
//
|
|
5
|
+
// What the first frame needs and nothing else: the variant, the translations, the shared HTML and the loading
|
|
6
|
+
// overlay (about twenty modules). The rest of the app (app.js: the map, the shared UI, the side panels' facades,
|
|
7
|
+
// boot) is imported right after, while the overlay shows; it used to load all of it, about four hundred modules,
|
|
8
|
+
// before the first frame. The map paints as soon as /api/map arrives; the full memory list (sidebar, explorer,
|
|
9
|
+
// cards, tooltips) hydrates right behind it.
|
|
8
10
|
|
|
9
11
|
// ── Storage (self-hydrating — importing it populates the cache) ──
|
|
10
12
|
import { storage, isShowcaseMode } from '../../shared/storage.js';
|
|
11
|
-
import { posStore } from '../../shared/node-positions-store.js';
|
|
12
13
|
|
|
13
14
|
// ── Shared foundation ──
|
|
14
|
-
import {
|
|
15
|
-
import { registerVariant, registerHelpSection } from '../../shared/registry.js';
|
|
16
|
-
import { normalizeNodes } from '../../shared/utils.js';
|
|
15
|
+
import { registerVariant } from '../../shared/registry.js';
|
|
17
16
|
import { injectSharedHTML } from '../../shared/html-shell.js';
|
|
18
|
-
import { KEYS } from '../../shared/constants.js';
|
|
19
17
|
import { migrateViewPreferences, normalizeViewUrl } from '../../shared/view-variant.js';
|
|
20
18
|
import { initI18n, t } from '../../shared/i18n.js';
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
import {
|
|
24
|
-
import { initPanelSystem, initPinToggle, clampPanelsToViewport } from '../../shared/ui-panels.js';
|
|
25
|
-
import { initLoading, showLoadingError, hideLoading, rememberHealth } from '../../shared/ui-loading.js';
|
|
26
|
-
import { initNavbar } from '../../shared/ui-navbar.js';
|
|
27
|
-
import { initMenubar, closeMenubar } from '../../shared/ui-menubar.js';
|
|
28
|
-
import { initSearch, clearSearch } from '../../shared/ui-search.js';
|
|
29
|
-
import { buildCategorySidebar, initSidebar, loadCategories } from '../../shared/ui-sidebar.js';
|
|
30
|
-
import { openMemoryCard, restoreOpenCards, initDetailPanel, setDetailCallbacks } from '../../shared/ui-detail.js';
|
|
31
|
-
import { initSettings, restoreInterfaceConfig, restoreSkin, loadIfaceConfig } from '../../shared/ui-settings.js';
|
|
32
|
-
import { initTrash } from '../../shared/ui-trash.js';
|
|
33
|
-
import { initBookmarks } from '../../shared/ui-bookmarks.js';
|
|
34
|
-
import { initResume } from '../../shared/ui-resume.js';
|
|
35
|
-
import { initHelp } from '../../shared/ui-help.js';
|
|
36
|
-
import { initMultiSelect, clearMultiSelect } from '../../shared/ui-multiselect.js';
|
|
37
|
-
import { updateStats, initStats } from '../../shared/ui-stats.js';
|
|
38
|
-
import { initExplorer } from '../../shared/ui-explorer.js';
|
|
39
|
-
import { initFileExplorer } from '../../shared/ui-file-explorer.js';
|
|
40
|
-
import { initSkillsStudio } from '../../shared/ui-skills.js';
|
|
41
|
-
import { initStyleGuide } from '../../shared/ui-styleguide.js';
|
|
42
|
-
import { initTerminal } from '../../shared/ui-terminal.js';
|
|
43
|
-
import { initLink } from '../../shared/ui-link.js';
|
|
44
|
-
import { initWhiteboard } from '../../shared/ui-whiteboard.js';
|
|
45
|
-
import { initCostWidget } from '../../shared/ui-cost-widget.js';
|
|
46
|
-
import { initGames, clearGameOnLoad } from '../../shared/ui-games.js';
|
|
47
|
-
import { initWorkspaces } from '../../shared/ui-workspaces.js';
|
|
48
|
-
import { initInvite } from '../../shared/ui-invite.js';
|
|
49
|
-
import { initSync, isGuest } from '../../shared/ui-sync.js';
|
|
50
|
-
import { startLaunchPrefetch } from '../../shared/launch-prefetch.js';
|
|
51
|
-
import { initKeybinds, registerAction } from '../../shared/ui-keybinds.js';
|
|
52
|
-
import { initTutorial } from '../../shared/ui-tutorial.js';
|
|
53
|
-
import { initImageGallery } from '../../shared/ui-image-gallery.js';
|
|
54
|
-
import { initScheduleQueue } from '../../shared/ui-schedule-queue.js';
|
|
55
|
-
import { initAutomationStudio } from '../../shared/ui-automation-studio.js';
|
|
56
|
-
import { initSchedulesStudio } from '../../shared/ui-schedules-studio.js';
|
|
57
|
-
import { initNativeLoopRouter } from '../../shared/ui-native-loop-router.js';
|
|
58
|
-
import { initCommandRunner } from '../../shared/ui-command-runner.js';
|
|
59
|
-
import { initAppContextMenu, openAppContextMenu, registerContextMenuArea } from '../../shared/ui-context-menu.js';
|
|
60
|
-
|
|
61
|
-
// ── Memory map (three.js itself loads only when the map is shown) ──
|
|
62
|
-
import { createLabelLayer } from './map-labels.js';
|
|
63
|
-
import { createMapView } from './map-view.js';
|
|
64
|
-
import { initMapControls } from './map-controls.js';
|
|
65
|
-
import { fetchMap, requestRebuild } from './map-data.js';
|
|
66
|
-
|
|
19
|
+
import { fetchHealth } from '../../shared/api.js';
|
|
20
|
+
import { initLoading, showLoadingError } from '../../shared/ui-loading.js';
|
|
21
|
+
import { loadMemoryList } from '../../shared/memory-list.js';
|
|
67
22
|
|
|
68
23
|
// ═══════════════════════════════════════════
|
|
69
24
|
// 1. REGISTER VARIANT
|
|
@@ -80,7 +35,7 @@ if (canonicalUrl !== window.location.pathname + window.location.search + window.
|
|
|
80
35
|
|
|
81
36
|
|
|
82
37
|
// ═══════════════════════════════════════════
|
|
83
|
-
// 2. TRANSLATIONS, SHARED HTML
|
|
38
|
+
// 2. TRANSLATIONS, SHARED HTML (the help section is app.js's)
|
|
84
39
|
// ═══════════════════════════════════════════
|
|
85
40
|
|
|
86
41
|
// Showcase mode (?showcase): the user's own content is blurred for product captures,
|
|
@@ -95,498 +50,29 @@ if (isShowcaseMode()) {
|
|
|
95
50
|
await initI18n();
|
|
96
51
|
injectSharedHTML();
|
|
97
52
|
|
|
98
|
-
const helpRow = (keys, desc) =>
|
|
99
|
-
`<div class="help-row"><div class="help-keys">${keys.map((k) => `<span class="help-key">${k}</span>`).join('')}</div><span class="help-desc">${desc}</span></div>`;
|
|
100
|
-
registerHelpSection({
|
|
101
|
-
order: 50,
|
|
102
|
-
html: `<div class="help-section">
|
|
103
|
-
<div class="help-section-title">${t('map.help.title')}</div>
|
|
104
|
-
${helpRow(['Drag'], t('map.help.orbit'))}
|
|
105
|
-
${helpRow(['Right-drag'], t('map.help.pan'))}
|
|
106
|
-
${helpRow(['Scroll'], t('map.help.zoom'))}
|
|
107
|
-
${helpRow(['←', '→', '↑', '↓'], t('map.help.keysPan'))}
|
|
108
|
-
${helpRow(['Shift', '←', '→'], t('map.help.keysOrbit'))}
|
|
109
|
-
${helpRow(['Click'], t('map.help.open'))}
|
|
110
|
-
${helpRow(['⌘/Ctrl', 'Click'], t('map.help.multi'))}
|
|
111
|
-
${helpRow(['Click name'], t('map.help.flyTo'))}
|
|
112
|
-
${helpRow(['H'], t('map.help.frameAll'))}
|
|
113
|
-
${helpRow(['Esc'], t('map.help.clear'))}
|
|
114
|
-
<div class="help-row"><span class="help-desc">${t('map.help.legend')}</span></div>
|
|
115
|
-
</div>`,
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
// ═══════════════════════════════════════════
|
|
120
|
-
// 3. THE MAP
|
|
121
|
-
// ═══════════════════════════════════════════
|
|
122
|
-
|
|
123
|
-
let renderer = null;
|
|
124
|
-
let labels = null;
|
|
125
|
-
let view = null;
|
|
126
|
-
let mapInit = null;
|
|
127
|
-
let _vizEnabled = loadIfaceConfig().visualizationEnabled !== false;
|
|
128
|
-
let _inFocusMode = false;
|
|
129
|
-
let _bootComplete = false;
|
|
130
|
-
const _seenCategories = new Set();
|
|
131
|
-
|
|
132
|
-
function statusPill(container) {
|
|
133
|
-
let el = document.getElementById('map-status');
|
|
134
|
-
if (!el) {
|
|
135
|
-
el = document.createElement('div');
|
|
136
|
-
el.id = 'map-status';
|
|
137
|
-
container.appendChild(el);
|
|
138
|
-
}
|
|
139
|
-
return el;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
function showMapMessage(text) {
|
|
143
|
-
const container = document.getElementById('graph-container');
|
|
144
|
-
if (!container) return;
|
|
145
|
-
const el = statusPill(container);
|
|
146
|
-
el.textContent = text;
|
|
147
|
-
el.classList.add('visible', 'error');
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
/** Create renderer, labels, view and input once; three.js is fetched here. */
|
|
151
|
-
function ensureMap() {
|
|
152
|
-
if (!mapInit) {
|
|
153
|
-
mapInit = (async () => {
|
|
154
|
-
const container = document.getElementById('graph-container');
|
|
155
|
-
const { createMapRenderer } = await import('./map-renderer.js');
|
|
156
|
-
labels = createLabelLayer(container);
|
|
157
|
-
let v = null;
|
|
158
|
-
renderer = createMapRenderer(container, {
|
|
159
|
-
onFrame: (now) => (v ? v.drawLabels(now) : false),
|
|
160
|
-
onSettle: () => v?.onSettle(),
|
|
161
|
-
onResize: (w, h) => labels.resize(w, h),
|
|
162
|
-
onMorphEnd: () => v?.onMorphEnd(),
|
|
163
|
-
});
|
|
164
|
-
labels.resize(renderer.size.width, renderer.size.height);
|
|
165
|
-
v = createMapView({ renderer, labels, statusEl: statusPill(container), onMissingNodes: (ids) => addMissingMemories(ids) });
|
|
166
|
-
initMapControls({ renderer, view: v, labels, onContextMenu: openMapMenu });
|
|
167
|
-
view = v;
|
|
168
|
-
applyRunState();
|
|
169
|
-
syncMapMenuChecks();
|
|
170
|
-
return v;
|
|
171
|
-
})();
|
|
172
|
-
mapInit.catch((err) => {
|
|
173
|
-
console.error('[map] could not start:', err);
|
|
174
|
-
showMapMessage(t('map.status.noWebgl'));
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
return mapInit;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/** The map renders only while the visualisation is on and focus mode is off. */
|
|
181
|
-
function applyRunState() {
|
|
182
|
-
if (!view) return;
|
|
183
|
-
if (_vizEnabled && !_inFocusMode) view.resume();
|
|
184
|
-
else view.pause();
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
// ═══════════════════════════════════════════
|
|
189
|
-
// 4. DATA
|
|
190
|
-
// ═══════════════════════════════════════════
|
|
191
|
-
|
|
192
|
-
const prefetch = window.__synPrefetch || {};
|
|
193
|
-
|
|
194
|
-
async function fetchJson(url) {
|
|
195
|
-
const res = await fetch(url);
|
|
196
|
-
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
197
|
-
return res.json();
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
function activateNewCategories(names) {
|
|
201
|
-
for (const name of names) {
|
|
202
|
-
if (_seenCategories.has(name)) continue;
|
|
203
|
-
_seenCategories.add(name);
|
|
204
|
-
state.activeCategories.add(name);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
// Memories the map already shows but the page has no data for (written through
|
|
209
|
-
// MCP, which never broadcasts). A few are fetched one by one; the 23 MB list is
|
|
210
|
-
// re-downloaded only when many are missing, and at most once a minute.
|
|
211
|
-
const _missingAsked = new Map(); // id → when it was last requested
|
|
212
|
-
let _lastFullReload = 0;
|
|
213
|
-
async function addMissingMemories(ids) {
|
|
214
|
-
const now = Date.now();
|
|
215
|
-
if (!ids) {
|
|
216
|
-
if (now - _lastFullReload < 60_000) return;
|
|
217
|
-
_lastFullReload = now;
|
|
218
|
-
scheduleReload();
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
const want = ids.filter((id) => now - (_missingAsked.get(id) || 0) > 60_000);
|
|
222
|
-
if (!want.length) return;
|
|
223
|
-
for (const id of want) _missingAsked.set(id, now);
|
|
224
|
-
const fetched = [];
|
|
225
|
-
for (let i = 0; i < want.length; i += 6) {
|
|
226
|
-
const batch = await Promise.all(want.slice(i, i + 6).map((id) =>
|
|
227
|
-
fetch(`/api/memory/${encodeURIComponent(id)}`).then((r) => (r.ok ? r.json() : null)).catch(() => null)));
|
|
228
|
-
for (const m of batch) if (m?.id && m.payload) fetched.push({ id: m.id, payload: m.payload });
|
|
229
|
-
}
|
|
230
|
-
const known = new Set(state.allNodes.map((n) => n.id));
|
|
231
|
-
const fresh = normalizeNodes(fetched).filter((n) => !known.has(n.id));
|
|
232
|
-
if (!fresh.length) return;
|
|
233
|
-
state.allNodes = [...fresh, ...state.allNodes]; // the list is newest-first
|
|
234
|
-
const presentCats = new Set(state.allNodes.map((n) => n.payload.category));
|
|
235
|
-
activateNewCategories([...presentCats]);
|
|
236
|
-
buildCategorySidebar(presentCats);
|
|
237
|
-
view?.hydrate();
|
|
238
|
-
view?.refreshVisibility();
|
|
239
|
-
updateStats();
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
let _reloadTimer = null;
|
|
243
|
-
let _reloading = null;
|
|
244
|
-
function scheduleReload() {
|
|
245
|
-
if (_reloadTimer) return;
|
|
246
|
-
_reloadTimer = setTimeout(() => { _reloadTimer = null; reloadMemories(); }, 300);
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
/** Refetch the memory list (slim payload) and the map (304 when unchanged). */
|
|
250
|
-
async function reloadMemories() {
|
|
251
|
-
if (_reloading) return _reloading;
|
|
252
|
-
_reloading = (async () => {
|
|
253
|
-
try {
|
|
254
|
-
const data = await fetchJson('/api/memories?links=false&fields=graph');
|
|
255
|
-
state.allNodes = normalizeNodes(data.nodes);
|
|
256
|
-
state.allLinks = data.links || [];
|
|
257
|
-
await loadCategories();
|
|
258
|
-
const presentCats = new Set(state.allNodes.map((n) => n.payload.category));
|
|
259
|
-
activateNewCategories([...presentCats, ...state.allCategoryNames]);
|
|
260
|
-
buildCategorySidebar(presentCats);
|
|
261
|
-
view?.hydrate();
|
|
262
|
-
view?.refreshColors();
|
|
263
|
-
view?.refreshVisibility();
|
|
264
|
-
view?.refetch();
|
|
265
|
-
updateStats();
|
|
266
|
-
} catch (err) {
|
|
267
|
-
console.error('data:reload failed:', err);
|
|
268
|
-
} finally {
|
|
269
|
-
_reloading = null;
|
|
270
|
-
}
|
|
271
|
-
})();
|
|
272
|
-
return _reloading;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/** Old 3D renderer state that nothing reads any more. Idempotent. */
|
|
276
|
-
function dropLegacy3dState() {
|
|
277
|
-
try {
|
|
278
|
-
posStore.removeItem(KEYS.NODE_POS_3D);
|
|
279
|
-
for (const key of ['neural-gfx-config', 'neural-gfx-preset', 'neural-cam-hud-pinned', 'neural-cam-hud-pos', 'synabun-layout-version']) {
|
|
280
|
-
storage.removeItem(key);
|
|
281
|
-
}
|
|
282
|
-
} catch {}
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
// ═══════════════════════════════════════════
|
|
287
|
-
// 5. EVENT BUS
|
|
288
|
-
// ═══════════════════════════════════════════
|
|
289
|
-
|
|
290
|
-
on('graph:navigate', ({ node }) => { if (node) view?.select(node.id, { fly: true }); });
|
|
291
|
-
|
|
292
|
-
on('node-selected', (node) => {
|
|
293
|
-
if (!node) return;
|
|
294
|
-
view?.select(node.id, { fly: true });
|
|
295
|
-
openMemoryCard(node);
|
|
296
|
-
});
|
|
297
|
-
|
|
298
|
-
on('search:apply', ({ ids, results } = {}) => view?.applySearch(ids, results));
|
|
299
|
-
on('search:clear', () => view?.clearSearch());
|
|
300
|
-
|
|
301
|
-
// A category toggle emits links:dirty immediately and graph:refresh 600 ms later.
|
|
302
|
-
on('links:dirty', () => view?.refreshVisibility());
|
|
303
|
-
on('graph:refresh', () => { view?.refreshVisibility(); updateStats(); });
|
|
304
|
-
|
|
305
|
-
const onCategoriesChanged = () => { view?.refreshColors(); view?.refreshVisibility(); };
|
|
306
|
-
on('categories-changed', onCategoriesChanged);
|
|
307
|
-
on('categories:changed', onCategoriesChanged);
|
|
308
|
-
on('graph:nodeThreeObject', () => view?.refreshColors()); // a category colour changed
|
|
309
|
-
|
|
310
|
-
on('data:reload', () => scheduleReload());
|
|
311
|
-
on('graph:reload', () => scheduleReload());
|
|
312
|
-
|
|
313
|
-
on('multiselect:cleared', () => view?.refreshVisibility());
|
|
314
|
-
on('detail:opened', () => view?.syncSelectionFromState());
|
|
315
|
-
on('detail:closed', () => view?.syncSelectionFromState());
|
|
316
|
-
|
|
317
|
-
on('layout:reset', () => view?.frameAll());
|
|
318
|
-
on('sync:map:updated', (msg) => view?.onServerUpdate(msg));
|
|
319
|
-
|
|
320
|
-
on('workspace:get-scene', (callback) => callback(view ? view.getScene() : { nodePositions: {}, camera: null }));
|
|
321
|
-
on('workspace:restore-scene', (scene) => view?.restoreScene(scene));
|
|
322
|
-
|
|
323
|
-
// Visualisation off / focus mode (whiteboard): zero frames, no input.
|
|
324
|
-
on('viz:toggle', (enabled) => {
|
|
325
|
-
_vizEnabled = !!enabled;
|
|
326
|
-
if (!_bootComplete) return;
|
|
327
|
-
if (_vizEnabled && !view) {
|
|
328
|
-
ensureMap().then(async (v) => {
|
|
329
|
-
const json = await fetchMap().catch(() => null);
|
|
330
|
-
if (json) { v.applyMap(json, { morph: false }); v.hydrate(); v.refreshVisibility(); v.frameAll(0); }
|
|
331
|
-
}).catch(() => {});
|
|
332
|
-
return;
|
|
333
|
-
}
|
|
334
|
-
applyRunState();
|
|
335
|
-
});
|
|
336
|
-
on('focus:enter', () => {
|
|
337
|
-
_inFocusMode = true;
|
|
338
|
-
state.hoveredNodeId = null;
|
|
339
|
-
applyRunState();
|
|
340
|
-
});
|
|
341
|
-
on('focus:exit', () => {
|
|
342
|
-
_inFocusMode = false;
|
|
343
|
-
applyRunState();
|
|
344
|
-
});
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
// ═══════════════════════════════════════════
|
|
348
|
-
// 6. DETAIL CARD CALLBACKS (the names ui-detail.js calls)
|
|
349
|
-
// ═══════════════════════════════════════════
|
|
350
|
-
|
|
351
|
-
setDetailCallbacks({
|
|
352
|
-
applyGraphData: () => {
|
|
353
|
-
view?.hydrate();
|
|
354
|
-
view?.syncFocusFromState();
|
|
355
|
-
view?.refreshVisibility();
|
|
356
|
-
},
|
|
357
|
-
updateStats: () => updateStats(),
|
|
358
|
-
buildCategorySidebar: (cats) => buildCategorySidebar(cats),
|
|
359
|
-
clearMultiSelect: () => clearMultiSelect(),
|
|
360
|
-
fetchTrashItems: () => emit('trash:refresh'),
|
|
361
|
-
refreshNodeAppearance: () => { view?.refreshColors(); view?.refreshVisibility(); },
|
|
362
|
-
});
|
|
363
|
-
|
|
364
|
-
|
|
365
53
|
// ═══════════════════════════════════════════
|
|
366
|
-
//
|
|
54
|
+
// 3. THE LOADING OVERLAY, THEN THE APP
|
|
367
55
|
// ═══════════════════════════════════════════
|
|
368
56
|
|
|
369
|
-
|
|
57
|
+
// The first frame in index.html owns the bounded retry for a failed module graph.
|
|
58
|
+
let app = null;
|
|
59
|
+
let moduleFailed = false;
|
|
60
|
+
const retryModule = () => window.dispatchEvent(new Event('synabun:startup-module-failed'));
|
|
61
|
+
initLoading({ onInit: () => {
|
|
62
|
+
if (app) app.boot();
|
|
63
|
+
else if (moduleFailed) retryModule();
|
|
64
|
+
// While the import is pending, app.js will run its own first boot.
|
|
65
|
+
} });
|
|
370
66
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
function wireMapMenu() {
|
|
378
|
-
const click = (id, fn) => {
|
|
379
|
-
const el = document.getElementById(id);
|
|
380
|
-
if (el) el.addEventListener('click', () => { closeMenubar(); fn(el); });
|
|
381
|
-
return el;
|
|
382
|
-
};
|
|
383
|
-
click('menu-map-frame-all', () => view?.frameAll());
|
|
384
|
-
for (const [id, key] of Object.entries(MAP_TOGGLES)) {
|
|
385
|
-
click(id, () => { if (!view) return; view.setOption(key, !view.options[key]); syncMapMenuChecks(); });
|
|
386
|
-
}
|
|
387
|
-
const rebuild = click('menu-map-rebuild', () => {
|
|
388
|
-
requestRebuild().catch((err) => console.warn('[map] rebuild failed:', err?.message || err));
|
|
389
|
-
});
|
|
390
|
-
const syncGuest = () => { if (rebuild) rebuild.style.display = isGuest() ? 'none' : ''; };
|
|
391
|
-
syncGuest();
|
|
392
|
-
on('session:info', syncGuest);
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
registerAction('map-frame-all', () => view?.frameAll());
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
// ═══════════════════════════════════════════
|
|
399
|
-
// 8. CONTEXT MENU (shared/ui-context-menu.js)
|
|
400
|
-
// ═══════════════════════════════════════════
|
|
401
|
-
// A right-click (no drag) on the map opens the app's menu with the map's part on top: a memory, a name on the
|
|
402
|
-
// map, or its empty space. The same functions as the map's clicks and Apps › Map.
|
|
403
|
-
|
|
404
|
-
const mapActions = {
|
|
405
|
-
frameAll: () => view?.frameAll(),
|
|
406
|
-
toggleOption: (key) => { if (!view) return; view.setOption(key, !view.options[key]); syncMapMenuChecks(); },
|
|
407
|
-
toggleSelect: (id) => view?.toggleMulti(id),
|
|
408
|
-
flyToIsland: (name) => view?.flyToIsland(name),
|
|
409
|
-
clearSearch: () => clearSearch(),
|
|
410
|
-
clearSelection: () => view?.clearSelection(),
|
|
411
|
-
};
|
|
412
|
-
|
|
413
|
-
/** The map's part of the menu for what a press resolved to (map-controls.js resolve), null before the map exists. */
|
|
414
|
-
function mapMenuArea(hit) {
|
|
415
|
-
if (!view?.map) return null;
|
|
416
|
-
if (hit && hit.i >= 0) {
|
|
417
|
-
const d = view.describe(hit.i);
|
|
418
|
-
if (d) {
|
|
419
|
-
const island = view.map.islands[view.map.islandOf[hit.i]]?.name || d.category;
|
|
420
|
-
return {
|
|
421
|
-
kind: 'memory',
|
|
422
|
-
memory: { id: d.id, onMap: true, island, selected: state.multiSelected.has(d.id) },
|
|
423
|
-
act: { ...mapActions, openMemory: () => view.clickPoint(hit.i) },
|
|
424
|
-
};
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
const label = hit?.label && hit.label.type !== 'memory' ? hit.label : null;
|
|
428
|
-
return {
|
|
429
|
-
kind: 'map',
|
|
430
|
-
map: { options: view.options, searching: view.searching, selected: !!view.selectedId, label, variant: '3d' },
|
|
431
|
-
act: { ...mapActions, flyToLabel: () => label && view.clickLabel(label) },
|
|
432
|
-
};
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
function openMapMenu({ clientX, clientY, hit }) {
|
|
436
|
-
openAppContextMenu({ x: clientX, y: clientY, target: renderer?.canvas || null, area: mapMenuArea(hit),
|
|
437
|
-
returnFocus: renderer?.canvas || null });
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
// From the keyboard (ContextMenu key, Shift+F10) on the focused map: the selected memory, else the map.
|
|
441
|
-
registerContextMenuArea({
|
|
442
|
-
id: 'memory-map',
|
|
443
|
-
match(el) {
|
|
444
|
-
if (!renderer || el !== renderer.canvas) return null;
|
|
445
|
-
const i = view?.selectedId ? view.map?.indexOf.get(view.selectedId) : undefined;
|
|
446
|
-
return mapMenuArea(i === undefined ? null : { i, label: null });
|
|
447
|
-
},
|
|
67
|
+
import('./app.js').then((module) => { app = module; }, async (err) => {
|
|
68
|
+
moduleFailed = true;
|
|
69
|
+
console.error('Init error:', err);
|
|
70
|
+
const health = await fetchHealth().catch(() => null);
|
|
71
|
+
if (health?.ok === true && !health.restarting) { retryModule(); return; }
|
|
72
|
+
showLoadingError(t('loading.serverOffline'), t('loading.serverNotRunning'), false, true);
|
|
448
73
|
});
|
|
449
74
|
|
|
450
|
-
|
|
451
|
-
//
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
async function boot() {
|
|
456
|
-
try {
|
|
457
|
-
restoreInterfaceConfig();
|
|
458
|
-
restoreSkin();
|
|
459
|
-
dropLegacy3dState();
|
|
460
|
-
|
|
461
|
-
try {
|
|
462
|
-
const healthRes = await fetch('/api/health');
|
|
463
|
-
const health = await healthRes.json();
|
|
464
|
-
rememberHealth(health);
|
|
465
|
-
if (!health.ok) {
|
|
466
|
-
const messages = {
|
|
467
|
-
db_missing: [t('loading.health.databaseUnreachable.title'), health.detail || t('loading.health.databaseUnreachable.sub')],
|
|
468
|
-
db_error: [t('loading.health.databaseUnreachable.title'), health.detail || t('loading.health.databaseUnreachable.sub')],
|
|
469
|
-
remote_unreachable: [t('loading.health.remoteUnreachable.title'), health.detail || t('loading.health.remoteUnreachable.sub')],
|
|
470
|
-
auth_error: [t('loading.health.authError.title'), health.detail || t('loading.health.authError.sub')],
|
|
471
|
-
};
|
|
472
|
-
const [title, sub] = messages[health.reason] || [t('loading.health.connectionError.title'), health.detail || t('loading.health.connectionError.sub')];
|
|
473
|
-
showLoadingError(title, sub, !!health.canAutoStart);
|
|
474
|
-
return;
|
|
475
|
-
}
|
|
476
|
-
} catch {
|
|
477
|
-
// /api/health failed — continue to try the data
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
const memoriesP = prefetch.memories || fetchJson('/api/memories?links=false&fields=graph');
|
|
481
|
-
const mapP = prefetch.map || fetchMap().catch(() => null);
|
|
482
|
-
|
|
483
|
-
// Categories first, so the first frame already has the sidebar's colours.
|
|
484
|
-
await loadCategories();
|
|
485
|
-
|
|
486
|
-
if (_vizEnabled) {
|
|
487
|
-
try {
|
|
488
|
-
const [v, mapJson] = await Promise.all([ensureMap(), mapP]);
|
|
489
|
-
if (mapJson) {
|
|
490
|
-
state.activeCategories = new Set([...state.allCategoryNames, ...mapJson.islands.map((i) => i.name)]);
|
|
491
|
-
v.applyMap(mapJson, { morph: false });
|
|
492
|
-
v.frameAll(0);
|
|
493
|
-
hideLoading(150); // the map is up; the rest fills in behind it
|
|
494
|
-
} else {
|
|
495
|
-
showMapMessage(t('map.status.error'));
|
|
496
|
-
}
|
|
497
|
-
} catch {
|
|
498
|
-
// ensureMap already reported it; the rest of the app still works
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
const data = await memoriesP;
|
|
503
|
-
if (data?.error) throw data.error;
|
|
504
|
-
state.allNodes = normalizeNodes(data.nodes);
|
|
505
|
-
state.allLinks = data.links || [];
|
|
506
|
-
const presentCats = new Set(state.allNodes.map((n) => n.payload.category));
|
|
507
|
-
state.activeCategories = new Set([...presentCats, ...state.allCategoryNames]);
|
|
508
|
-
for (const name of state.activeCategories) _seenCategories.add(name);
|
|
509
|
-
buildCategorySidebar(presentCats);
|
|
510
|
-
view?.hydrate();
|
|
511
|
-
view?.refreshVisibility();
|
|
512
|
-
updateStats();
|
|
513
|
-
|
|
514
|
-
emit('data-loaded', data);
|
|
515
|
-
restoreOpenCards();
|
|
516
|
-
|
|
517
|
-
// Recover a selected memory handed over by a legacy 2D tab
|
|
518
|
-
const switchNodeId = sessionStorage.getItem('neural-selected-node-switch');
|
|
519
|
-
if (switchNodeId) {
|
|
520
|
-
sessionStorage.removeItem('neural-selected-node-switch');
|
|
521
|
-
const node = state.allNodes.find((n) => n.id === switchNodeId);
|
|
522
|
-
if (node) {
|
|
523
|
-
openMemoryCard(node);
|
|
524
|
-
view?.select(node.id, { fly: true });
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
try { emit('trash:refresh'); } catch {}
|
|
529
|
-
hideLoading(400);
|
|
530
|
-
_bootComplete = true;
|
|
531
|
-
// Painted: what the windows, menus and Settings wait for is read now, in idle time (launch-prefetch.js).
|
|
532
|
-
startLaunchPrefetch({ isGuest });
|
|
533
|
-
} catch (err) {
|
|
534
|
-
console.error('Init error:', err);
|
|
535
|
-
const isNetworkError = err.message === 'Failed to fetch' || err.name === 'TypeError';
|
|
536
|
-
showLoadingError(
|
|
537
|
-
isNetworkError ? t('loading.serverOffline') : t('loading.connectionFailed'),
|
|
538
|
-
isNetworkError ? t('loading.serverNotRunning') : err.message,
|
|
539
|
-
false,
|
|
540
|
-
isNetworkError,
|
|
541
|
-
);
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
// ═══════════════════════════════════════════
|
|
547
|
-
// 10. INIT ALL SHARED UI SYSTEMS
|
|
548
|
-
// ═══════════════════════════════════════════
|
|
549
|
-
|
|
550
|
-
initLoading({ onInit: boot });
|
|
551
|
-
initKeybinds();
|
|
552
|
-
initTooltip();
|
|
553
|
-
initPanelSystem();
|
|
554
|
-
initPinToggle();
|
|
555
|
-
initNavbar();
|
|
556
|
-
initMenubar();
|
|
557
|
-
initSearch();
|
|
558
|
-
initSidebar();
|
|
559
|
-
initDetailPanel();
|
|
560
|
-
initSettings();
|
|
561
|
-
initTrash();
|
|
562
|
-
initBookmarks();
|
|
563
|
-
initResume();
|
|
564
|
-
initWorkspaces();
|
|
565
|
-
initInvite();
|
|
566
|
-
initSync();
|
|
567
|
-
initHelp();
|
|
568
|
-
initMultiSelect();
|
|
569
|
-
initStats();
|
|
570
|
-
initExplorer();
|
|
571
|
-
initFileExplorer();
|
|
572
|
-
initSkillsStudio();
|
|
573
|
-
initStyleGuide();
|
|
574
|
-
initAutomationStudio();
|
|
575
|
-
initSchedulesStudio();
|
|
576
|
-
initNativeLoopRouter();
|
|
577
|
-
initImageGallery();
|
|
578
|
-
initScheduleQueue();
|
|
579
|
-
initCommandRunner();
|
|
580
|
-
initTerminal();
|
|
581
|
-
initLink();
|
|
582
|
-
clearGameOnLoad();
|
|
583
|
-
initWhiteboard();
|
|
584
|
-
initCostWidget();
|
|
585
|
-
initGames();
|
|
586
|
-
initTutorial();
|
|
587
|
-
initAppContextMenu();
|
|
588
|
-
wireMapMenu();
|
|
589
|
-
|
|
590
|
-
window.addEventListener('resize', () => clampPanelsToViewport());
|
|
591
|
-
|
|
592
|
-
boot();
|
|
75
|
+
// The memory list: index.html asked for its first page; the others are read now, one page at a time, while the app
|
|
76
|
+
// loads (shared/memory-list.js). boot() takes the whole list from here, in the shape the single answer had.
|
|
77
|
+
const prefetch = window.__synPrefetch || (window.__synPrefetch = {});
|
|
78
|
+
prefetch.memories = loadMemoryList({ first: prefetch.memories || null });
|
|
@@ -13,6 +13,7 @@ import { isGraphPointerActivity } from '../../shared/graph-activity.js';
|
|
|
13
13
|
import { clearSearch } from '../../shared/ui-search.js';
|
|
14
14
|
import { escapeHtml } from '../../shared/utils.js';
|
|
15
15
|
import { frameRect } from '../../shared/app-frame.js';
|
|
16
|
+
import { openEscapeOverlay } from '../../shared/window-keys.js';
|
|
16
17
|
|
|
17
18
|
const CLICK_SLOP = 5; // px a press may move and still count as a click
|
|
18
19
|
|
|
@@ -137,12 +138,13 @@ export function initMapControls({ renderer, view, labels, onContextMenu = null }
|
|
|
137
138
|
view.frameAll();
|
|
138
139
|
});
|
|
139
140
|
|
|
140
|
-
// Esc: search first, then selection. Backs off whenever something else owns it
|
|
141
|
+
// Esc: search first, then selection. Backs off whenever something else owns it: the focus is elsewhere, or a
|
|
142
|
+
// dialog, picker, menu or dropdown is open (the same list the whiteboard yields to: shared/window-keys.js).
|
|
141
143
|
const onKeyDown = (e) => {
|
|
142
144
|
if (e.key !== 'Escape' || e.defaultPrevented) return;
|
|
143
145
|
const active = document.activeElement;
|
|
144
146
|
const owned = active && active !== document.body && active !== canvas;
|
|
145
|
-
if (owned || document.querySelector('.menubar-item.open, .modal-overlay.open, .settings-modal.open')) return;
|
|
147
|
+
if (owned || document.querySelector('.menubar-item.open, .modal-overlay.open, .settings-modal.open') || openEscapeOverlay(document)) return;
|
|
146
148
|
if (view.searching) { clearSearch(); return; }
|
|
147
149
|
if (view.selectedId) view.clearSelection();
|
|
148
150
|
};
|