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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { extensionSettingsHTML, wireExtensionSettings } from './settings/settings-browser-extension.js';
|
|
1
2
|
import { fetchToolCatalog } from './agent-runtime-options.js';
|
|
2
3
|
import { reloadAfterRestore } from './server-back.js';
|
|
3
4
|
import { configureToolPickerTranslation, toolPickerHTML, readToolPicker, toolWord, toolServersNote } from './tool-list-picker.js';
|
|
@@ -15,6 +16,7 @@ import { readUserContextResponse, describeUserContext, describeUserContextSaveFa
|
|
|
15
16
|
import { readWorkerGuardResponse, describeWorkerGuard, describeWorkerGuardSaveFailure } from './settings/settings-worker-guard.js';
|
|
16
17
|
import { readOwnerAccessResponse, describeOwnerAccess, describeOwnerAccessSaveFailure } from './settings/settings-browser-owner-access.js';
|
|
17
18
|
import { CLAUDE_HOOK_ROWS, readClaudeHooksResponse, describeClaudeHooks, describeClaudeHooksSaveFailure } from './settings/settings-claude-hooks.js';
|
|
19
|
+
import { masterView, masterRequests, countTools } from './settings/settings-tool-permissions.js';
|
|
18
20
|
import { readGreetingStatus, describeGreeting, describeGreetingSaveFailure } from './settings/settings-greeting.js';
|
|
19
21
|
import { describeOpencodeInstall } from './settings/settings-opencode.js';
|
|
20
22
|
import { maritacaOpencodeCardView, maritacaOpencodeModelRows, MARITACA_OPENCODE_KEYS, MARITACA_OPENCODE_PROVIDER } from './settings/settings-maritaca-opencode.js';
|
|
@@ -25,7 +27,11 @@ import { recheckCliStatus, getCliStatus, addCliToPath } from './cli-status.js';
|
|
|
25
27
|
import { cliInstallText, setCliInstallTranslator } from './cli-install-view.js';
|
|
26
28
|
import { dropdownHTML, wireDropdowns, setDropdownItems, setDropdownValue } from './cc-dropdown.js';
|
|
27
29
|
import { PROXY_TYPES, isLocalProfile, proxySummary, defaultCreateWhere, isPlanLimit, formOfProfile, readLocalProfileForm, proxyOfForm, createAction, whereOptions, passwordNeededAgain } from './settings/settings-local-profiles.js';
|
|
28
|
-
import {
|
|
30
|
+
import { startLimitNotes, closedOutsideNotes } from './settings/settings-morelogin-cooldown.js';
|
|
31
|
+
import { AI_BROWSER_EVENT, LOCAL_CONNECT_OPTIONS, LOCAL_DEFAULT_MODE, aiBrowserOf, aiBrowserOfStatus, localConnectModeOf, browserSaveFields, switchRequest, pickRequest, aiBrowserLine, profileOf, aiBrowserDetail } from './settings/settings-ai-browser.js';
|
|
32
|
+
import { IFACE_DEFAULTS, loadIfaceConfig, saveIfaceConfig, applyIfaceConfig, restoreInterfaceConfig, loadSkinStylesheet, removeSkinStylesheet, restoreSkin, setSkinsTabRefresher } from './iface-config.js';
|
|
33
|
+
// The interface config and the skin, for the modules that import them from here.
|
|
34
|
+
export { loadIfaceConfig, saveIfaceConfig, applyIfaceConfig, restoreInterfaceConfig, restoreSkin };
|
|
29
35
|
setCliInstallTranslator((key, params) => kit.tx(`cliInstall.${key}`, params));
|
|
30
36
|
import { setGitBashTranslator } from './git-bash-view.js';
|
|
31
37
|
import { gitBashRowHtml, wireGitBashRow } from './ui-git-bash.js';
|
|
@@ -133,24 +139,9 @@ function showCCToast(msg, duration = 3500) {
|
|
|
133
139
|
// INTERFACE CUSTOMIZATION — config, presets, apply
|
|
134
140
|
// ═══════════════════════════════════════════
|
|
135
141
|
|
|
136
|
-
//
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
scale: 1,
|
|
140
|
-
glassOpacity: 0.72,
|
|
141
|
-
// 16 keeps the glass look at a fraction of the compositing cost — users can
|
|
142
|
-
// still crank the slider to 80 to explicitly opt back into heavier blur
|
|
143
|
-
glassBlur: 16,
|
|
144
|
-
glassSaturate: 1.4,
|
|
145
|
-
glassBorderOpacity: 0.06,
|
|
146
|
-
glassShadowOpacity: 0.4,
|
|
147
|
-
glassShadowSpread: 20,
|
|
148
|
-
glassRadius: 14,
|
|
149
|
-
fontScale: 1,
|
|
150
|
-
accentHue: 0,
|
|
151
|
-
accentSaturation: 0,
|
|
152
|
-
accentLightness: 80,
|
|
153
|
-
};
|
|
142
|
+
// IFACE_DEFAULTS, loading / saving / applying the config and the skin stylesheet live in iface-config.js: the boot
|
|
143
|
+
// needs them before this module (the Settings window, loaded on first open or in idle time) has loaded.
|
|
144
|
+
setSkinsTabRefresher((panel) => refreshSkinsTab(panel));
|
|
154
145
|
|
|
155
146
|
const IFACE_PRESETS = {
|
|
156
147
|
default: { label: 'Default', desc: 'Standard glass look', values: { ...IFACE_DEFAULTS } },
|
|
@@ -179,197 +170,6 @@ const IFACE_SLIDERS = {
|
|
|
179
170
|
],
|
|
180
171
|
};
|
|
181
172
|
|
|
182
|
-
export function loadIfaceConfig() {
|
|
183
|
-
try {
|
|
184
|
-
const raw = storage.getItem('neural-interface-config');
|
|
185
|
-
if (raw) return { ...IFACE_DEFAULTS, ...normalizeViewConfig(JSON.parse(raw)) };
|
|
186
|
-
// Migrate legacy ui-scale if present
|
|
187
|
-
const legacyScale = storage.getItem('neural-ui-scale');
|
|
188
|
-
if (legacyScale) {
|
|
189
|
-
const cfg = { ...IFACE_DEFAULTS, scale: parseFloat(legacyScale) || 1 };
|
|
190
|
-
saveIfaceConfig(cfg);
|
|
191
|
-
return cfg;
|
|
192
|
-
}
|
|
193
|
-
return { ...IFACE_DEFAULTS };
|
|
194
|
-
} catch { return { ...IFACE_DEFAULTS }; }
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
export function saveIfaceConfig(cfg) {
|
|
198
|
-
storage.setItem('neural-interface-config', JSON.stringify(normalizeViewConfig(cfg)));
|
|
199
|
-
// Keep legacy key in sync for backwards compat
|
|
200
|
-
storage.setItem('neural-ui-scale', cfg.scale);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
export function applyIfaceConfig(cfg, { instant = false } = {}) {
|
|
204
|
-
const r = document.documentElement.style;
|
|
205
|
-
r.setProperty('--ui-scale', cfg.scale);
|
|
206
|
-
r.setProperty('--glass-opacity', cfg.glassOpacity);
|
|
207
|
-
r.setProperty('--glass-blur', cfg.glassBlur);
|
|
208
|
-
r.setProperty('--glass-saturate', cfg.glassSaturate);
|
|
209
|
-
r.setProperty('--glass-border-opacity', cfg.glassBorderOpacity);
|
|
210
|
-
r.setProperty('--glass-shadow-opacity', cfg.glassShadowOpacity);
|
|
211
|
-
r.setProperty('--glass-shadow-spread', cfg.glassShadowSpread);
|
|
212
|
-
r.setProperty('--glass-radius', cfg.glassRadius);
|
|
213
|
-
r.setProperty('--font-scale', cfg.fontScale);
|
|
214
|
-
r.setProperty('--accent-hue', cfg.accentHue);
|
|
215
|
-
r.setProperty('--accent-saturation', cfg.accentSaturation + '%');
|
|
216
|
-
r.setProperty('--accent-lightness', cfg.accentLightness + '%');
|
|
217
|
-
|
|
218
|
-
// Focus Mode — scale+blur transition with staggered controls
|
|
219
|
-
const vizEnabled = cfg.visualizationEnabled !== false;
|
|
220
|
-
const graphContainer = document.getElementById('graph-container');
|
|
221
|
-
const staticBg = document.getElementById('static-bg');
|
|
222
|
-
|
|
223
|
-
if (!vizEnabled) {
|
|
224
|
-
// ENTERING FOCUS MODE
|
|
225
|
-
|
|
226
|
-
// ── Clean up all interactive state ──
|
|
227
|
-
// Hide 3D tooltip + detach its mousemove listener
|
|
228
|
-
const $tooltip = document.getElementById('tooltip');
|
|
229
|
-
if ($tooltip) {
|
|
230
|
-
$tooltip.classList.remove('visible');
|
|
231
|
-
if ($tooltip._moveHandler) {
|
|
232
|
-
document.removeEventListener('mousemove', $tooltip._moveHandler);
|
|
233
|
-
$tooltip._moveHandler = null;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
// Hide data-tooltip tooltips
|
|
237
|
-
const uiTip = document.querySelector('.ui-tooltip');
|
|
238
|
-
if (uiTip) {
|
|
239
|
-
uiTip.classList.remove('visible');
|
|
240
|
-
uiTip.style.display = 'none';
|
|
241
|
-
}
|
|
242
|
-
// Clear hover state
|
|
243
|
-
state.hoveredNodeId = null;
|
|
244
|
-
// Clear multi-select
|
|
245
|
-
if (state.multiSelected.size > 0) {
|
|
246
|
-
state.multiSelected.clear();
|
|
247
|
-
const bar = document.getElementById('multi-select-bar');
|
|
248
|
-
if (bar) bar.classList.remove('open');
|
|
249
|
-
emit('multiselect:cleared');
|
|
250
|
-
}
|
|
251
|
-
// Reset cursor
|
|
252
|
-
document.body.style.cursor = 'default';
|
|
253
|
-
|
|
254
|
-
// Hide controls, 2D canvases, category sidebar
|
|
255
|
-
for (const id of ['controls-panel', 'stats-bar', 'category-sidebar']) {
|
|
256
|
-
const el = document.getElementById(id);
|
|
257
|
-
if (el) el.classList.add('viz-hidden');
|
|
258
|
-
}
|
|
259
|
-
for (const id of ['bg-canvas', 'hull-canvas', 'lasso-canvas']) {
|
|
260
|
-
const el = document.getElementById(id);
|
|
261
|
-
if (el) el.classList.add('viz-hidden-2d');
|
|
262
|
-
}
|
|
263
|
-
if (instant) {
|
|
264
|
-
// Page load — apply immediately without animation
|
|
265
|
-
if (graphContainer) graphContainer.classList.add('focus-active');
|
|
266
|
-
setStaticBgVisible(staticBg, true);
|
|
267
|
-
} else {
|
|
268
|
-
// User toggle — stagger: controls fade first, then iris closes
|
|
269
|
-
setTimeout(() => {
|
|
270
|
-
if (graphContainer) graphContainer.classList.add('focus-active');
|
|
271
|
-
setStaticBgVisible(staticBg, true);
|
|
272
|
-
}, 100);
|
|
273
|
-
}
|
|
274
|
-
// Notify variant-specific cleanup (lasso, context menu, etc.)
|
|
275
|
-
emit('focus:enter');
|
|
276
|
-
} else {
|
|
277
|
-
// EXITING FOCUS MODE
|
|
278
|
-
// Iris open the graph + close focus bg
|
|
279
|
-
if (graphContainer) graphContainer.classList.remove('focus-active');
|
|
280
|
-
setStaticBgVisible(staticBg, false);
|
|
281
|
-
// 2D canvases
|
|
282
|
-
for (const id of ['bg-canvas', 'hull-canvas', 'lasso-canvas']) {
|
|
283
|
-
const el = document.getElementById(id);
|
|
284
|
-
if (el) el.classList.remove('viz-hidden-2d');
|
|
285
|
-
}
|
|
286
|
-
if (instant) {
|
|
287
|
-
// Page load — show controls immediately
|
|
288
|
-
for (const id of ['controls-panel', 'stats-bar', 'category-sidebar']) {
|
|
289
|
-
const el = document.getElementById(id);
|
|
290
|
-
if (el) el.classList.remove('viz-hidden');
|
|
291
|
-
}
|
|
292
|
-
} else {
|
|
293
|
-
// User toggle — delay controls until iris starts opening
|
|
294
|
-
setTimeout(() => {
|
|
295
|
-
for (const id of ['controls-panel', 'stats-bar', 'category-sidebar']) {
|
|
296
|
-
const el = document.getElementById(id);
|
|
297
|
-
if (el) el.classList.remove('viz-hidden');
|
|
298
|
-
}
|
|
299
|
-
}, 200);
|
|
300
|
-
}
|
|
301
|
-
emit('focus:exit');
|
|
302
|
-
}
|
|
303
|
-
// Notify variants to pause/resume rendering
|
|
304
|
-
emit('viz:toggle', vizEnabled);
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
/** Call on page load to restore saved interface config */
|
|
308
|
-
export function restoreInterfaceConfig() {
|
|
309
|
-
// Suppress transitions during initial load to prevent flash
|
|
310
|
-
document.documentElement.classList.add('no-transition');
|
|
311
|
-
applyIfaceConfig(loadIfaceConfig(), { instant: true });
|
|
312
|
-
// Re-enable transitions after a frame
|
|
313
|
-
requestAnimationFrame(() => {
|
|
314
|
-
requestAnimationFrame(() => {
|
|
315
|
-
document.documentElement.classList.remove('no-transition');
|
|
316
|
-
});
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
// ═══════════════════════════════════════════
|
|
321
|
-
// SKIN LOADING — stylesheet injection + boot restore
|
|
322
|
-
// ═══════════════════════════════════════════
|
|
323
|
-
|
|
324
|
-
const SKIN_LINK_ID = 'synabun-skin-css';
|
|
325
|
-
|
|
326
|
-
/** Insert or update the skin stylesheet <link> */
|
|
327
|
-
function loadSkinStylesheet(skinId) {
|
|
328
|
-
if (!skinId || skinId === 'default') {
|
|
329
|
-
removeSkinStylesheet();
|
|
330
|
-
return;
|
|
331
|
-
}
|
|
332
|
-
let link = document.getElementById(SKIN_LINK_ID);
|
|
333
|
-
if (!link) {
|
|
334
|
-
link = document.createElement('link');
|
|
335
|
-
link.id = SKIN_LINK_ID;
|
|
336
|
-
link.rel = 'stylesheet';
|
|
337
|
-
// Insert after the main styles.css
|
|
338
|
-
const mainCSS = document.querySelector('link[href*="styles.css"]');
|
|
339
|
-
if (mainCSS && mainCSS.nextSibling) {
|
|
340
|
-
mainCSS.parentNode.insertBefore(link, mainCSS.nextSibling);
|
|
341
|
-
} else {
|
|
342
|
-
document.head.appendChild(link);
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
link.href = `/skins/${skinId}/skin.css`;
|
|
346
|
-
storage.setItem(KEYS.ACTIVE_SKIN, skinId);
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
/** Remove the skin stylesheet */
|
|
350
|
-
function removeSkinStylesheet() {
|
|
351
|
-
const link = document.getElementById(SKIN_LINK_ID);
|
|
352
|
-
if (link) link.remove();
|
|
353
|
-
storage.setItem(KEYS.ACTIVE_SKIN, 'default');
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
/** Restore active skin on page load. Export for variant main.js to call. */
|
|
357
|
-
export function restoreSkin() {
|
|
358
|
-
const skinId = storage.getItem(KEYS.ACTIVE_SKIN) || 'default';
|
|
359
|
-
if (skinId && skinId !== 'default') {
|
|
360
|
-
loadSkinStylesheet(skinId);
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
// Listen for cross-tab skin changes via WebSocket
|
|
365
|
-
on('sync:skin:changed', (msg) => {
|
|
366
|
-
const id = msg?.id || 'default';
|
|
367
|
-
if (id === 'default') removeSkinStylesheet();
|
|
368
|
-
else loadSkinStylesheet(id);
|
|
369
|
-
// Update settings panel if open
|
|
370
|
-
const panel = document.getElementById('settings-panel');
|
|
371
|
-
if (panel) refreshSkinsTab(panel);
|
|
372
|
-
});
|
|
373
173
|
|
|
374
174
|
// ═══════════════════════════════════════════
|
|
375
175
|
// SKINS TAB — builder + interaction
|
|
@@ -765,7 +565,6 @@ function buildServerTab(settings, connections = []) {
|
|
|
765
565
|
function buildBrowserTab(ownerAccess = null) {
|
|
766
566
|
const b = (key) => kit.te(`settings.redesign.browser.${key}`);
|
|
767
567
|
const SEARCH = '<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>';
|
|
768
|
-
const REFRESH = '<svg viewBox="0 0 24 24" aria-hidden="true"><polyline points="23 4 23 10 17 10"/><polyline points="1 20 1 14 7 14"/><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/></svg>';
|
|
769
568
|
const FOLDER = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z"/></svg>';
|
|
770
569
|
|
|
771
570
|
// The app's custom select, wired by the browser pane itself (.bc-dropdown). `name` picks the option labels.
|
|
@@ -821,7 +620,13 @@ function buildBrowserTab(ownerAccess = null) {
|
|
|
821
620
|
${kit.card({
|
|
822
621
|
id: 'setup-browser', section: 'browser.browser_choice',
|
|
823
622
|
body: `
|
|
824
|
-
|
|
623
|
+
<div class="stg-field" id="bc-ai-browser-row" style="display:none">
|
|
624
|
+
<div class="stg-action-row" style="align-items:center;flex-wrap:wrap;gap:8px">
|
|
625
|
+
<span class="stg-inline-status" id="bc-ai-browser-text" role="status" aria-live="polite"></span>
|
|
626
|
+
<button type="button" class="stg-action-btn compact" id="bc-ai-browser-open">${b('aiBrowser.open')}</button>
|
|
627
|
+
</div>
|
|
628
|
+
</div>
|
|
629
|
+
${kit.field('BRW003', `<div class="bc-inline-group">${dd('BRW003', 'bc-browser', 'browser', ['auto', 'chrome', 'msedge', 'chromium', 'custom'], { attrs: 'id="bc-browser-dropdown"' })}<input type="hidden" id="bc-channel" value=""></div>`)}
|
|
825
630
|
<div class="stg-field bc-card-row" id="bcg-executable" ${kit.inv('BRW001')}>
|
|
826
631
|
<label for="bc-executablePath">${kit.L('BRW001')}</label>
|
|
827
632
|
<div class="browser-cfg-input-row">
|
|
@@ -849,19 +654,10 @@ function buildBrowserTab(ownerAccess = null) {
|
|
|
849
654
|
id: 'bcg-profiles', section: 'browser.browser_profiles',
|
|
850
655
|
body: `
|
|
851
656
|
<input type="hidden" id="bc-userDataDir" value="">
|
|
852
|
-
${kit.field('BRW011', dd('BRW011', 'bc-connectMode', 'connect',
|
|
657
|
+
${kit.field('BRW011', `${dd('BRW011', 'bc-connectMode', 'connect', LOCAL_CONNECT_OPTIONS)}
|
|
658
|
+
<div class="stg-help" id="bc-connectMode-ai-note" style="display:none">${b('aiBrowser.connectionNote')}</div>`)}
|
|
659
|
+
${extensionSettingsHTML(kit)}
|
|
853
660
|
${kit.field('BRW012', dd('BRW012', 'bc-attachSeed', 'seed', ['real', 'fresh']), { attrs: 'id="bc-attachSeed-row" style="display:none"' })}
|
|
854
|
-
<div class="stg-field bc-card-row" id="bc-morelogin-row" ${kit.inv('BRW013')} style="display:none">
|
|
855
|
-
<label id="bc-morelogin-env-id-label" for="bc-morelogin-env-id-trigger">${kit.L('BRW013')}</label>
|
|
856
|
-
<div class="browser-cfg-input-row">
|
|
857
|
-
${dropdownHTML('bc-morelogin-env-id', [{ value: '', label: kit.tx('settings.redesign.browser.loadingProfiles') }], { classes: 'bc-ml-dropdown', labelledBy: 'bc-morelogin-env-id-label', attrs: 'style="flex:1;min-width:0"' }).replace('role="combobox"', 'role="combobox" aria-describedby="bc-morelogin-env-id-help"')}
|
|
858
|
-
<button type="button" class="cli-detect-btn" id="bc-morelogin-refresh" ${kit.inv('BRW014')} title="${kit.H('BRW014')}">${REFRESH}${kit.L('BRW014')}</button>
|
|
859
|
-
</div>
|
|
860
|
-
<div class="stg-help" id="bc-morelogin-env-id-help">${kit.H('BRW013')}</div>
|
|
861
|
-
</div>
|
|
862
|
-
<div class="stg-field" id="bc-morelogin-status-row" style="display:none">
|
|
863
|
-
<span class="bc-hint-inline stg-help" id="bc-morelogin-status-text" role="status" aria-live="polite"></span>
|
|
864
|
-
</div>
|
|
865
661
|
<div class="stg-field bc-card-row" ${kit.inv('BRW083')}>
|
|
866
662
|
<label id="bc-profile-list-label">${kit.L('BRW083')}</label>
|
|
867
663
|
<div class="browser-cfg-input-row">
|
|
@@ -1760,7 +1556,7 @@ function buildSkillsTab(ccSkills) {
|
|
|
1760
1556
|
</div>`;
|
|
1761
1557
|
}
|
|
1762
1558
|
|
|
1763
|
-
function buildPermissionsTab(toolCategories, toolPermissions) {
|
|
1559
|
+
function buildPermissionsTab(toolCategories, toolPermissions, capabilities = []) {
|
|
1764
1560
|
const categories = (toolCategories || []).filter(c => c.id !== 'social');
|
|
1765
1561
|
const perms = toolPermissions || {};
|
|
1766
1562
|
// The inventory ids of the "all tools of this group" switches, by group.
|
|
@@ -1777,6 +1573,12 @@ function buildPermissionsTab(toolCategories, toolPermissions) {
|
|
|
1777
1573
|
return { ...cat, onCount };
|
|
1778
1574
|
});
|
|
1779
1575
|
const allOn = !!totalAll && totalOn === totalAll;
|
|
1576
|
+
// The switch for every tool of the section, next to the total (settings/settings-tool-permissions.js): on, off
|
|
1577
|
+
// or mixed. `data-bulk`: this server takes all the groups in one request.
|
|
1578
|
+
const master = masterView(countTools(categories, perms), { tx: kit.tx });
|
|
1579
|
+
const masterHTML = !master.shown ? '' : `<button type="button" class="cc-tools-master" id="cc-tools-master" ${kit.inv('PER013')} role="checkbox" aria-checked="${master.checked}" data-state="${master.state}"${(capabilities || []).includes('categories') ? ' data-bulk="1"' : ''} title="${kit.esc(master.title)}">
|
|
1580
|
+
<span class="cc-tools-master-label">${kit.L('PER013')}</span><span class="cc-tools-master-switch" aria-hidden="true"></span>
|
|
1581
|
+
</button>`;
|
|
1780
1582
|
|
|
1781
1583
|
const categoryHTML = catData.map(cat => {
|
|
1782
1584
|
const catAllOn = cat.onCount === cat.tools.length;
|
|
@@ -1798,7 +1600,7 @@ function buildPermissionsTab(toolCategories, toolPermissions) {
|
|
|
1798
1600
|
<div class="stg-pane" data-stg-pane="permissions">
|
|
1799
1601
|
${kit.card({
|
|
1800
1602
|
id: 'stg-sec-tool-permissions', section: 'tool_access.tool_permissions',
|
|
1801
|
-
status: `<span class="cc-hooks-badge${allOn ? ' all-on' : ''}" id="cc-tools-badge" title="${kit.te('settings.redesign.permissions.badge')}">${totalOn}/${totalAll}</span
|
|
1603
|
+
status: `<span class="cc-hooks-badge${allOn ? ' all-on' : ''}" id="cc-tools-badge" title="${kit.te('settings.redesign.permissions.badge')}">${totalOn}/${totalAll}</span>${masterHTML}`,
|
|
1802
1604
|
body: categories.length
|
|
1803
1605
|
? `<div ${kit.inv('PER012')} role="group" aria-label="${kit.L('PER012')}">${categoryHTML}</div>`
|
|
1804
1606
|
: `<div class="stg-help" style="margin-top:0">${kit.te('settings.redesign.permissions.none')}</div>`,
|
|
@@ -2522,10 +2324,33 @@ function buildMoreLoginTab() {
|
|
|
2522
2324
|
const text = (id, { ph = '', type = 'text' } = {}) =>
|
|
2523
2325
|
`<input type="${type}" id="${id}" value=""${ph ? ` placeholder="${ph}"` : ''} autocomplete="off" spellcheck="false" aria-describedby="${id}-help">`;
|
|
2524
2326
|
const btn = (invId, id) => `<button type="button" class="stg-action-btn compact" id="${id}" ${kit.inv(invId)} title="${kit.H(invId)}">${kit.L(invId)}</button>`;
|
|
2327
|
+
const REFRESH = '<svg viewBox="0 0 24 24" aria-hidden="true"><polyline points="23 4 23 10 17 10"/><polyline points="1 20 1 14 7 14"/><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/></svg>';
|
|
2525
2328
|
|
|
2526
2329
|
return `
|
|
2527
2330
|
<div class="stg-pane" data-stg-pane="morelogin">
|
|
2528
2331
|
|
|
2332
|
+
${kit.card({
|
|
2333
|
+
// Everything about choosing a profile as the AI browser (settings-ai-browser.js). The Browser tab only says so.
|
|
2334
|
+
// The picker is driven by cc-dropdown.js alone (wireMoreLoginTab): never `.stg-dropdown`, which the panel's older
|
|
2335
|
+
// per-element wiring (wireStgDropdowns) also takes, and a second click handler closes it as it opens.
|
|
2336
|
+
id: 'stg-sec-ml-default', section: 'connected_tools.morelogin_default',
|
|
2337
|
+
status: kit.pill(m('aiBrowser.stateOff'), { id: 'ml-ai-state', state: 'off' }),
|
|
2338
|
+
body: `
|
|
2339
|
+
${kit.toggleField('ML037', kit.switchInput('ml-ai-on'), { forId: 'ml-ai-on' })}
|
|
2340
|
+
<div class="stg-field bc-card-row" id="ml-ai-profile-row" ${kit.inv('ML038')}>
|
|
2341
|
+
<label id="ml-ai-env-id-label" for="ml-ai-env-id-trigger">${kit.L('ML038')}</label>
|
|
2342
|
+
<div class="browser-cfg-input-row">
|
|
2343
|
+
${dropdownHTML('ml-ai-env-id', [{ value: '', label: kit.tx('settings.redesign.morelogin.aiBrowser.loadingProfiles') }], { classes: 'bc-ml-dropdown', labelledBy: 'ml-ai-env-id-label', attrs: 'style="flex:1;min-width:0"' }).replace('role="combobox"', 'role="combobox" aria-describedby="ml-ai-env-id-help"')}
|
|
2344
|
+
<button type="button" class="cli-detect-btn" id="ml-ai-refresh" ${kit.inv('ML039')} title="${kit.H('ML039')}">${REFRESH}${kit.L('ML039')}</button>
|
|
2345
|
+
</div>
|
|
2346
|
+
<div class="stg-help" id="ml-ai-env-id-help">${kit.H('ML038')}</div>
|
|
2347
|
+
</div>
|
|
2348
|
+
<div class="stg-field">
|
|
2349
|
+
<div class="stg-inline-status" id="ml-ai-line" role="status" aria-live="polite">${m('aiBrowser.line.off')}</div>
|
|
2350
|
+
<span class="bc-hint-inline stg-help" id="ml-ai-status-text" role="status" aria-live="polite"></span>
|
|
2351
|
+
</div>`,
|
|
2352
|
+
})}
|
|
2353
|
+
|
|
2529
2354
|
${kit.card({
|
|
2530
2355
|
id: 'stg-sec-ml-connection', section: 'connected_tools.morelogin_connection',
|
|
2531
2356
|
status: `<span id="ml-conn-status">…</span>`,
|
|
@@ -2628,6 +2453,7 @@ function wireMoreLoginTab(overlay, signal) {
|
|
|
2628
2453
|
{ value: 'morelogin', label: kit.tx('settings.redesign.morelogin.local.whereMoreLogin'), selected: true },
|
|
2629
2454
|
], { classes: 'stg-dropdown', label: kit.tx('settings.redesign.control.ml020.label') }); }
|
|
2630
2455
|
{ const card = $('stg-sec-ml-profiles'); if (card) wireDropdowns(card, { signal }); }
|
|
2456
|
+
{ const card = $('stg-sec-ml-default'); if (card) wireDropdowns(card, { signal }); }
|
|
2631
2457
|
$('ml-create-where')?.addEventListener('change', () => { _whereTouched = true; });
|
|
2632
2458
|
// "Where" follows what MoreLogin can do until the owner picks: Local while MoreLogin is closed, refusing or full.
|
|
2633
2459
|
function syncCreateWhere() {
|
|
@@ -2659,10 +2485,12 @@ function wireMoreLoginTab(overlay, signal) {
|
|
|
2659
2485
|
else { dot.className = 'settings-status-dot connected'; line.textContent = kit.tx('settings.redesign.morelogin.connectedProfileSPort', { profileCount: s.profileCount, port: s.port }); if (conn) conn.textContent = kit.tx('settings.redesign.morelogin.connected'); }
|
|
2660
2486
|
const hint = $('ml-path-hint');
|
|
2661
2487
|
if (hint) hint.hidden = !!(s.installed && s.running);
|
|
2662
|
-
|
|
2488
|
+
// A row is marked as the default only while a profile is the AI browser (a leftover id of a switched-off one is not).
|
|
2489
|
+
_defaultEnvId = s.isDefault ? (s.defaultEnvId || null) : null;
|
|
2663
2490
|
_status = s;
|
|
2664
2491
|
const ds = $('ml-default-status');
|
|
2665
2492
|
if (ds) ds.textContent = (s.isDefault && s.defaultEnvId) ? kit.tx('settings.redesign.morelogin.defaultAiBrowserSet') : kit.tx('settings.redesign.morelogin.noDefaultSet');
|
|
2493
|
+
noteAi(aiBrowserOfStatus(s));
|
|
2666
2494
|
}
|
|
2667
2495
|
|
|
2668
2496
|
// `agentProfiles`: the owner's list of profiles agents may choose (GET /api/morelogin/profiles). A server from
|
|
@@ -2730,10 +2558,10 @@ function wireMoreLoginTab(overlay, signal) {
|
|
|
2730
2558
|
if (!r.ok) { showCCToast(r.error || kit.tx('settings.redesign.morelogin.failed')); b.disabled = false; }
|
|
2731
2559
|
else await reload();
|
|
2732
2560
|
}));
|
|
2561
|
+
// The same request as the Default AI browser card's: the card follows (useDefault), without a reload of the page.
|
|
2733
2562
|
list.querySelectorAll('.ml-use').forEach(b => b.addEventListener('click', async () => {
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
reload();
|
|
2563
|
+
b.disabled = true;
|
|
2564
|
+
await useDefault({ envId: b.dataset.envId });
|
|
2737
2565
|
}));
|
|
2738
2566
|
list.querySelectorAll('.ml-start').forEach(b => b.addEventListener('click', async () => {
|
|
2739
2567
|
b.disabled = true; const t = b.textContent; b.textContent = kit.tx('settings.redesign.morelogin.starting');
|
|
@@ -2898,6 +2726,7 @@ function wireMoreLoginTab(overlay, signal) {
|
|
|
2898
2726
|
const s = await jget('/api/morelogin/status');
|
|
2899
2727
|
// No owner access (SynaBun's automation browser opened this page): "No access", never "not installed" or defaults.
|
|
2900
2728
|
if (markPaneRefused(overlay, 'morelogin', refusalOfError({ status: s._status, code: s.code }))) {
|
|
2729
|
+
_refused = true;
|
|
2901
2730
|
const dot = $('ml-status-dot'), line = $('ml-status-line');
|
|
2902
2731
|
if (dot) dot.className = 'settings-status-dot disconnected';
|
|
2903
2732
|
if (line) line.textContent = ownerAccessSay('panelTitle');
|
|
@@ -2926,7 +2755,9 @@ function wireMoreLoginTab(overlay, signal) {
|
|
|
2926
2755
|
if (d && d.ok && Array.isArray(d.profiles)) _localDetails = new Map(d.profiles.map(row => [String(row.id), row]));
|
|
2927
2756
|
} else _localDetails = new Map();
|
|
2928
2757
|
_moreloginError = p.moreloginError || '';
|
|
2758
|
+
_profileRows = p.envs || [];
|
|
2929
2759
|
renderProfiles(p.envs || [], p.agentProfiles, p.moreloginError ? [] : p.staleProfiles || []);
|
|
2760
|
+
drawAiBrowser();
|
|
2930
2761
|
// The server is still asking MoreLogin which browser some profiles run: ask again quietly, a few times.
|
|
2931
2762
|
clearTimeout(_browsersTimer);
|
|
2932
2763
|
if (Number(p.browsersPending) > 0 && _browsersTries < 8 && $('ml-profile-list')?.isConnected) {
|
|
@@ -2937,6 +2768,184 @@ function wireMoreLoginTab(overlay, signal) {
|
|
|
2937
2768
|
let _browsersTimer = null;
|
|
2938
2769
|
let _browsersTries = 0;
|
|
2939
2770
|
|
|
2771
|
+
// ── Default AI browser: a MoreLogin or SynaBun local profile as the browser of SynaBun's web tasks ──
|
|
2772
|
+
// The only place that turns it on or off (settings-ai-browser.js). The switch and a new pick save at once through
|
|
2773
|
+
// POST /api/morelogin/use-default, as a row's "Use as default" does: one request, one state (_ai), drawn in the card,
|
|
2774
|
+
// the list's default mark and, through AI_BROWSER_EVENT on the overlay, the Browser tab's line.
|
|
2775
|
+
let _ai = { moreLogin: false, envId: null }; // what the server holds
|
|
2776
|
+
let _aiWanted = ''; // the picker's profile: the AI browser's, or the owner's pick while it is off
|
|
2777
|
+
let _aiEnvs = []; // the picker's rows (GET /api/browser/morelogin-envs)
|
|
2778
|
+
let _profileRows = []; // the list's rows (GET /api/morelogin/profiles): names while the picker has none
|
|
2779
|
+
let _refused = false; // no owner access: nothing more is asked
|
|
2780
|
+
let _aiBrowsersTimer = null;
|
|
2781
|
+
let _aiBrowsersTries = 0;
|
|
2782
|
+
// keepShown: a redraw of the list (the quiet ask again, a change of the choice) keeps what the picker shows;
|
|
2783
|
+
// without it the AI browser's profile is put back, as on open and on Refresh.
|
|
2784
|
+
async function loadMoreLoginEnvs(keepShown = false) {
|
|
2785
|
+
const sel = $('ml-ai-env-id');
|
|
2786
|
+
// A placeholder choice (loading / error / not running) keeps its reason visible in the closed dropdown.
|
|
2787
|
+
const only = (key) => setDropdownItems(sel, [{ value: '', label: kit.tx(key), selected: true }]);
|
|
2788
|
+
const statusEl = $('ml-ai-status-text');
|
|
2789
|
+
if (!sel) return;
|
|
2790
|
+
try {
|
|
2791
|
+
const r = await fetch('/api/browser/morelogin-envs');
|
|
2792
|
+
const d = await r.json();
|
|
2793
|
+
// SynaBun's own local profiles (`kind: 'local'`) are in every answer, whatever MoreLogin does: with one or
|
|
2794
|
+
// more, the picker lists them and the line under it says why MoreLogin's are missing.
|
|
2795
|
+
const localEnvs = (d && Array.isArray(d.envs) ? d.envs : []).filter(e => e && e.kind === 'local');
|
|
2796
|
+
// MoreLogin refused a start for its plan's daily limit: SynaBun asks it for no start of that profile until
|
|
2797
|
+
// MoreLogin's day resets (lib/morelogin-start-cooldown.js). Said per profile, with the reset in local time, on
|
|
2798
|
+
// every line below: the hold stays while MoreLogin is closed, and opening it does not end the hold.
|
|
2799
|
+
const limits = startLimitNotes(d && d.startCooldowns, d && d.envs, { locale: getLocale() });
|
|
2800
|
+
const limitText = (limits.length
|
|
2801
|
+
? ' · ⚠ ' + limits.map(n => kit.tx('settings.redesign.morelogin.aiBrowser.moreloginStartLimitReached', { name: n.name, time: n.time })).join(' · ⚠ ')
|
|
2802
|
+
: '')
|
|
2803
|
+
// A profile closed outside SynaBun: no session, run, agent or script starts it again until the owner does (in
|
|
2804
|
+
// MoreLogin, or Start here) or its next scheduled run (lib/morelogin-outside-close.js). Said the same way.
|
|
2805
|
+
+ closedOutsideNotes(d && d.closedOutside, d && d.envs, { locale: getLocale() })
|
|
2806
|
+
.map(n => ' · ⚠ ' + kit.tx('settings.redesign.morelogin.aiBrowser.moreloginClosedOutside', { name: n.name, time: n.time })).join('');
|
|
2807
|
+
let moreloginNote = '';
|
|
2808
|
+
// With a local profile to list, MoreLogin's state is a note under the picker; without one it is the picker's
|
|
2809
|
+
// only choice, as before. → true when the picker was filled with the reason (nothing more to draw).
|
|
2810
|
+
const without = (message, placeholder) => {
|
|
2811
|
+
if (localEnvs.length) { moreloginNote = message; return false; }
|
|
2812
|
+
placeholder();
|
|
2813
|
+
_aiEnvs = [];
|
|
2814
|
+
if (statusEl) {
|
|
2815
|
+
statusEl.textContent = message + limitText;
|
|
2816
|
+
if (limitText) statusEl.style.color = 'var(--stg-warn)';
|
|
2817
|
+
}
|
|
2818
|
+
return true;
|
|
2819
|
+
};
|
|
2820
|
+
if (!d || d.ok === false) { if (without((d && d.error) || kit.tx('settings.redesign.morelogin.aiBrowser.failedToLoadMoreloginProfiles'), () => only('settings.redesign.morelogin.aiBrowser.error'))) return; }
|
|
2821
|
+
else if (!d.installed) { if (without(kit.tx('settings.redesign.morelogin.aiBrowser.moreloginDesktopAppIsNotInstalled') + ' ' + kit.tx('settings.redesign.morelogin.aiBrowser.moreloginCustomPathHint'), () => only('settings.redesign.morelogin.aiBrowser.moreloginNotInstalled'))) return; }
|
|
2822
|
+
else if (!d.running) { if (without(kit.tx('settings.redesign.morelogin.aiBrowser.moreloginNotRunningOpenTheApp', { port: d.port }) + (d.error ? ' ' + String(d.error) : ''), () => only('settings.redesign.morelogin.aiBrowser.startMorelogin'))) return; }
|
|
2823
|
+
const envs = moreloginNote ? localEnvs : (d.envs || []);
|
|
2824
|
+
_aiEnvs = envs;
|
|
2825
|
+
if (!envs.length) { only('settings.redesign.morelogin.aiBrowser.noProfiles'); if (statusEl) statusEl.textContent = kit.tx('settings.redesign.morelogin.aiBrowser.noMoreloginProfilesYetOneIs'); drawAiBrowser(); return; }
|
|
2826
|
+
const want = (keepShown === true && sel.value) || _aiWanted || sel.value || '';
|
|
2827
|
+
// Show each env's proxy — without it there is no way to tell from SynaBun
|
|
2828
|
+
// whether a profile's traffic leaves the machine.
|
|
2829
|
+
const proxyLabel = (p) => {
|
|
2830
|
+
if (!p) return '';
|
|
2831
|
+
const where = [p.host, p.port].filter(Boolean).join(':');
|
|
2832
|
+
return ` · ${[p.type, where, p.country].filter(Boolean).join(' ')}`;
|
|
2833
|
+
};
|
|
2834
|
+
// SynaBun drives the profile over CDP, so a Firefox-type one (`browser` from the server; absent = not known)
|
|
2835
|
+
// is listed, said as such and cannot be picked. One already saved as the default stays shown, with a warning.
|
|
2836
|
+
// dropdownHTML escapes the labels itself.
|
|
2837
|
+
setDropdownItems(sel, envs.map(e => (e.browser === 'firefox'
|
|
2838
|
+
? { value: String(e.id), label: kit.tx('settings.redesign.morelogin.aiBrowser.moreloginFirefoxOption', { name: String(e.name ?? e.id) }), disabled: true }
|
|
2839
|
+
: { value: String(e.id), label: `${e.kind === 'local' ? kit.tx('settings.redesign.morelogin.aiBrowser.moreloginLocalOption', { name: String(e.name ?? e.id) }) : (e.name ?? '')}${e.status ? ` (${String(e.status)})` : ''}${proxyLabel(e.proxy)}` })));
|
|
2840
|
+
if (want && envs.some(e => String(e.id) === String(want))) setDropdownValue(sel, String(want));
|
|
2841
|
+
const chosenFirefox = envs.some(e => String(e.id) === String(sel.value) && e.browser === 'firefox');
|
|
2842
|
+
if (statusEl) statusEl.style.color = chosenFirefox ? 'var(--stg-warn)' : '';
|
|
2843
|
+
// The server is still asking MoreLogin which browser some profiles run: ask again quietly, a few times.
|
|
2844
|
+
clearTimeout(_aiBrowsersTimer);
|
|
2845
|
+
if (Number(d.browsersPending) > 0 && _aiBrowsersTries < 8 && sel.isConnected) {
|
|
2846
|
+
_aiBrowsersTries += 1;
|
|
2847
|
+
_aiBrowsersTimer = setTimeout(() => loadMoreLoginEnvs(true), 2500);
|
|
2848
|
+
} else _aiBrowsersTries = 0;
|
|
2849
|
+
if (statusEl) {
|
|
2850
|
+
let msg = chosenFirefox
|
|
2851
|
+
? kit.tx('settings.redesign.morelogin.aiBrowser.moreloginFirefoxDefault')
|
|
2852
|
+
: (moreloginNote
|
|
2853
|
+
? kit.tx('settings.redesign.morelogin.aiBrowser.localProfilesOnly', { count: envs.length }) + ' ' + moreloginNote
|
|
2854
|
+
: kit.tx('settings.redesign.morelogin.aiBrowser.profileSApiPort', { count: envs.length, port: d.port }));
|
|
2855
|
+
// MoreLogin silently redirects a navigation it refuses to its stop page: a
|
|
2856
|
+
// localhost port missing from the profile's Port scan protection list, or a
|
|
2857
|
+
// host its website blacklist/whitelist refuses. Surface it; nothing else in
|
|
2858
|
+
// the UI can explain it.
|
|
2859
|
+
if (d.blockedNavigations > 0) {
|
|
2860
|
+
msg += (" " + kit.tx('settings.redesign.morelogin.aiBrowser.moreloginBlockedNavigationS', { blockedNavigations: d.blockedNavigations }));
|
|
2861
|
+
if (d.lastBlockedUrl) msg += kit.tx('settings.redesign.morelogin.aiBrowser.mostRecently', { lastBlockedUrl: String(d.lastBlockedUrl).slice(0, 80) });
|
|
2862
|
+
msg += kit.tx('settings.redesign.morelogin.aiBrowser.aLocalhostPortMustBeIn');
|
|
2863
|
+
}
|
|
2864
|
+
// The plan's daily start limit (limitText, above).
|
|
2865
|
+
if (limitText) {
|
|
2866
|
+
msg += limitText;
|
|
2867
|
+
statusEl.style.color = 'var(--stg-warn)';
|
|
2868
|
+
}
|
|
2869
|
+
statusEl.textContent = msg;
|
|
2870
|
+
}
|
|
2871
|
+
drawAiBrowser();
|
|
2872
|
+
} catch {
|
|
2873
|
+
only('settings.redesign.morelogin.aiBrowser.error');
|
|
2874
|
+
_aiEnvs = [];
|
|
2875
|
+
if (statusEl) statusEl.textContent = kit.tx('settings.redesign.morelogin.aiBrowser.failedToReachMorelogin');
|
|
2876
|
+
}
|
|
2877
|
+
}
|
|
2878
|
+
/** The listed profile with this id: the picker's rows first, then the list's. */
|
|
2879
|
+
const aiProfile = (envId) => profileOf(_aiEnvs, envId) || profileOf(_profileRows, envId);
|
|
2880
|
+
/** The card as _ai says, and the news for the Browser tab (it keeps the last one on the overlay, for a late reader). */
|
|
2881
|
+
function drawAiBrowser() {
|
|
2882
|
+
const box = $('ml-ai-on');
|
|
2883
|
+
if (box) box.checked = _ai.moreLogin;
|
|
2884
|
+
const profile = aiProfile(_ai.envId);
|
|
2885
|
+
const line = aiBrowserLine(_ai, profile);
|
|
2886
|
+
const text = $('ml-ai-line');
|
|
2887
|
+
if (text) text.textContent = kit.tx(`settings.redesign.morelogin.aiBrowser.line.${line.key}`, line.params);
|
|
2888
|
+
const pill = $('ml-ai-state');
|
|
2889
|
+
if (pill) {
|
|
2890
|
+
pill.textContent = kit.tx(_ai.moreLogin ? 'settings.redesign.morelogin.aiBrowser.stateOn' : 'settings.redesign.morelogin.aiBrowser.stateOff');
|
|
2891
|
+
pill.dataset.state = _ai.moreLogin ? 'ok' : 'off';
|
|
2892
|
+
}
|
|
2893
|
+
const detail = aiBrowserDetail(_ai, profile);
|
|
2894
|
+
overlay._stgAiBrowser = detail;
|
|
2895
|
+
overlay.dispatchEvent(new CustomEvent(AI_BROWSER_EVENT, { detail }));
|
|
2896
|
+
}
|
|
2897
|
+
/** What the server holds now (GET /api/morelogin/status, a use-default answer). The picker follows the AI browser's
|
|
2898
|
+
* profile; while it is off, a profile the owner picked by hand stays picked. */
|
|
2899
|
+
function noteAi(state) {
|
|
2900
|
+
_ai = { moreLogin: state.moreLogin === true, envId: state.envId || null };
|
|
2901
|
+
if (_ai.envId && (_ai.moreLogin || !_aiWanted)) {
|
|
2902
|
+
_aiWanted = _ai.envId;
|
|
2903
|
+
const sel = $('ml-ai-env-id');
|
|
2904
|
+
if (sel && _aiEnvs.some(e => String(e.id) === _ai.envId)) setDropdownValue(sel, _ai.envId);
|
|
2905
|
+
}
|
|
2906
|
+
drawAiBrowser();
|
|
2907
|
+
}
|
|
2908
|
+
/** POST /api/morelogin/use-default: `{ envId }` makes it the AI browser, `{ clear: true }` goes back to SynaBun's own
|
|
2909
|
+
* browser (connect mode 'mirror'). A refusal leaves everything as the server holds it, and says why. */
|
|
2910
|
+
async function useDefault(body) {
|
|
2911
|
+
const box = $('ml-ai-on');
|
|
2912
|
+
if (box) box.disabled = true;
|
|
2913
|
+
const r = await jpost('/api/morelogin/use-default', body);
|
|
2914
|
+
if (box) box.disabled = false;
|
|
2915
|
+
if (r && r.ok) {
|
|
2916
|
+
noteAi(aiBrowserOf(r));
|
|
2917
|
+
showCCToast(kit.tx(body.clear ? 'settings.redesign.morelogin.aiBrowser.offToast' : 'settings.redesign.morelogin.moreloginSetAsDefaultAiBrowser'));
|
|
2918
|
+
} else {
|
|
2919
|
+
showCCToast(kit.tx('settings.redesign.morelogin.aiBrowser.changeFailed', { error: (r && r.error) || kit.tx('settings.redesign.morelogin.failed') }));
|
|
2920
|
+
drawAiBrowser();
|
|
2921
|
+
}
|
|
2922
|
+
await reload();
|
|
2923
|
+
loadMoreLoginEnvs();
|
|
2924
|
+
return !!(r && r.ok);
|
|
2925
|
+
}
|
|
2926
|
+
$('ml-ai-on')?.addEventListener('change', async () => {
|
|
2927
|
+
const box = $('ml-ai-on');
|
|
2928
|
+
// What the picker shows, nothing else: a profile remembered from before but not listed now is not offered.
|
|
2929
|
+
const chosen = $('ml-ai-env-id')?.value || '';
|
|
2930
|
+
const ask = switchRequest({ on: box.checked, chosen, firefox: aiProfile(chosen)?.browser === 'firefox' });
|
|
2931
|
+
if (ask.refuse) {
|
|
2932
|
+
box.checked = _ai.moreLogin;
|
|
2933
|
+
showCCToast(kit.tx(`settings.redesign.morelogin.aiBrowser.${ask.refuse}`));
|
|
2934
|
+
return;
|
|
2935
|
+
}
|
|
2936
|
+
await useDefault(ask.body);
|
|
2937
|
+
}, { signal });
|
|
2938
|
+
// Another profile chosen: saved at once while a profile is the AI browser; the line under the picker says what
|
|
2939
|
+
// holds for that one (the Firefox warning goes).
|
|
2940
|
+
$('ml-ai-env-id')?.addEventListener('change', async () => {
|
|
2941
|
+
const chosen = $('ml-ai-env-id').value;
|
|
2942
|
+
_aiWanted = chosen;
|
|
2943
|
+
const ask = pickRequest({ on: _ai.moreLogin, chosen, current: _ai, firefox: aiProfile(chosen)?.browser === 'firefox' });
|
|
2944
|
+
if (ask) { await useDefault(ask.body); return; }
|
|
2945
|
+
loadMoreLoginEnvs(true);
|
|
2946
|
+
}, { signal });
|
|
2947
|
+
$('ml-ai-refresh')?.addEventListener('click', (e) => { e.preventDefault(); loadMoreLoginEnvs(); }, { signal });
|
|
2948
|
+
|
|
2940
2949
|
const saveCfg = (key, value) => fetch('/api/morelogin/config', { method: 'PUT', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ key, value }) });
|
|
2941
2950
|
|
|
2942
2951
|
$('ml-port-save')?.addEventListener('click', async () => { await saveCfg('port', ($('ml-port').value || '').trim()); showCCToast(kit.tx('settings.redesign.morelogin.portSaved')); reload(); });
|
|
@@ -3012,7 +3021,7 @@ function wireMoreLoginTab(overlay, signal) {
|
|
|
3012
3021
|
if (res) { res.style.display = 'block'; res.textContent = r.ok ? kit.tx('settings.redesign.morelogin.removedFrom', { targets: (r.targets || []).join(', ') || kit.tx('settings.redesign.morelogin.none') }) : (r.error || kit.tx('settings.redesign.morelogin.failed')); res.style.background = 'var(--s-darker)'; res.style.color = 'var(--t-secondary)'; }
|
|
3013
3022
|
});
|
|
3014
3023
|
|
|
3015
|
-
reload();
|
|
3024
|
+
reload().then(() => { if (!_refused) loadMoreLoginEnvs(); });
|
|
3016
3025
|
}
|
|
3017
3026
|
|
|
3018
3027
|
function buildDiscordTab(discordConfig) {
|
|
@@ -3707,6 +3716,7 @@ async function openSettingsModalNow(options = {}) {
|
|
|
3707
3716
|
let setupStatus = { claude: {}, antigravity: {}, codex: {}, opencode: {}, paths: {} };
|
|
3708
3717
|
let cliConfig = {};
|
|
3709
3718
|
let toolPermissions = {};
|
|
3719
|
+
let toolPermissionCaps = [];
|
|
3710
3720
|
let toolCategories = [];
|
|
3711
3721
|
let discordConfig = {};
|
|
3712
3722
|
let skinsData = { skins: [], active: 'default' };
|
|
@@ -3760,7 +3770,10 @@ async function openSettingsModalNow(options = {}) {
|
|
|
3760
3770
|
if (greetRes.status === 'fulfilled') greetingReading = greetRes.value;
|
|
3761
3771
|
if (setupRes.status === 'fulfilled' && setupRes.value.ok) setupStatus = setupRes.value;
|
|
3762
3772
|
if (cliRes.status === 'fulfilled' && cliRes.value.ok) cliConfig = cliRes.value.config;
|
|
3763
|
-
if (toolPermsRes.status === 'fulfilled' && toolPermsRes.value.ok)
|
|
3773
|
+
if (toolPermsRes.status === 'fulfilled' && toolPermsRes.value.ok) {
|
|
3774
|
+
toolPermissions = toolPermsRes.value.tools;
|
|
3775
|
+
toolPermissionCaps = Array.isArray(toolPermsRes.value.capabilities) ? toolPermsRes.value.capabilities : [];
|
|
3776
|
+
}
|
|
3764
3777
|
if (toolCatsRes.status === 'fulfilled' && toolCatsRes.value.ok) toolCategories = toolCatsRes.value.categories;
|
|
3765
3778
|
if (discordRes.status === 'fulfilled' && discordRes.value.ok) discordConfig = discordRes.value.config;
|
|
3766
3779
|
if (skinsRes.status === 'fulfilled' && skinsRes.value.ok) skinsData = skinsRes.value;
|
|
@@ -3836,7 +3849,7 @@ async function openSettingsModalNow(options = {}) {
|
|
|
3836
3849
|
discord: buildDiscordTab(discordConfig),
|
|
3837
3850
|
whatsapp: buildWhatsAppTab(),
|
|
3838
3851
|
morelogin: buildMoreLoginTab(),
|
|
3839
|
-
permissions: buildPermissionsTab(toolCategories, toolPermissions),
|
|
3852
|
+
permissions: buildPermissionsTab(toolCategories, toolPermissions, toolPermissionCaps),
|
|
3840
3853
|
editor: buildCodeEditorTab(),
|
|
3841
3854
|
social: buildSocialTab(toolCategories, toolPermissions),
|
|
3842
3855
|
youtube: buildYoutubeTab(youtubeConfig),
|
|
@@ -5738,6 +5751,14 @@ async function openSettingsModalNow(options = {}) {
|
|
|
5738
5751
|
badge.textContent = `${totalOn}/${totalAll}`;
|
|
5739
5752
|
badge.classList.toggle('all-on', totalOn === totalAll);
|
|
5740
5753
|
}
|
|
5754
|
+
// The switch for every tool: on, off or mixed, from the same count as the total next to it.
|
|
5755
|
+
const master = overlay.querySelector('#cc-tools-master');
|
|
5756
|
+
if (master) {
|
|
5757
|
+
const view = masterView({ on: totalOn, total: totalAll }, { tx: kit.tx });
|
|
5758
|
+
master.dataset.state = view.state;
|
|
5759
|
+
master.setAttribute('aria-checked', view.checked);
|
|
5760
|
+
master.title = view.title;
|
|
5761
|
+
}
|
|
5741
5762
|
}
|
|
5742
5763
|
|
|
5743
5764
|
function applyToolPermissionResult(tools) {
|
|
@@ -5786,6 +5807,34 @@ async function openSettingsModalNow(options = {}) {
|
|
|
5786
5807
|
});
|
|
5787
5808
|
});
|
|
5788
5809
|
|
|
5810
|
+
// The switch for every tool of the section (its header, next to the total): everything on switches all off,
|
|
5811
|
+
// anything else switches all on. One request where the server takes the groups together, else one per group.
|
|
5812
|
+
{
|
|
5813
|
+
const master = overlay.querySelector('#cc-tools-master');
|
|
5814
|
+
if (master) {
|
|
5815
|
+
master.addEventListener('click', async (e) => {
|
|
5816
|
+
e.stopPropagation(); // the header it sits in opens and closes the section
|
|
5817
|
+
const section = master.closest('.stg-card');
|
|
5818
|
+
const groups = [...(section?.querySelectorAll('.cc-tool-category[data-tool-category]') || [])].map(el => el.dataset.toolCategory);
|
|
5819
|
+
const requests = masterRequests({
|
|
5820
|
+
categories: groups, enabled: master.dataset.state !== 'on',
|
|
5821
|
+
capabilities: master.dataset.bulk === '1' ? ['categories'] : [],
|
|
5822
|
+
});
|
|
5823
|
+
if (!requests.length) return;
|
|
5824
|
+
master.disabled = true;
|
|
5825
|
+
try {
|
|
5826
|
+
for (const body of requests) {
|
|
5827
|
+
const res = await fetch('/api/claude-code/tool-permissions', { method: 'PUT', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) });
|
|
5828
|
+
const data = await res.json();
|
|
5829
|
+
if (!data.ok) { alert(data.error || kit.tx('settings.redesign.permissions.failedToToggleAll')); break; }
|
|
5830
|
+
applyToolPermissionResult(data.tools);
|
|
5831
|
+
}
|
|
5832
|
+
} catch (err) { alert(kit.tx('settings.redesign.permissions.failed', { message: err.message })); }
|
|
5833
|
+
finally { master.disabled = false; }
|
|
5834
|
+
});
|
|
5835
|
+
}
|
|
5836
|
+
}
|
|
5837
|
+
|
|
5789
5838
|
// ── User Learning threshold handler ──
|
|
5790
5839
|
{
|
|
5791
5840
|
const ulInput = overlay.querySelector('#cc-ul-threshold-input');
|
|
@@ -6308,6 +6357,9 @@ async function openSettingsModalNow(options = {}) {
|
|
|
6308
6357
|
const label = dd.querySelector('.cc-dropdown-value');
|
|
6309
6358
|
const menu = dd.querySelector('.cc-dropdown-menu');
|
|
6310
6359
|
if (!menu) return;
|
|
6360
|
+
if (label && hiddenId === 'bc-connectMode' && val === LOCAL_DEFAULT_MODE) {
|
|
6361
|
+
label.textContent = kit.tx('settings.redesign.browser.opt.connect.mirror');
|
|
6362
|
+
}
|
|
6311
6363
|
menu.querySelectorAll('.cc-dropdown-item').forEach(item => {
|
|
6312
6364
|
const isMatch = item.dataset.value === val;
|
|
6313
6365
|
item.classList.toggle('active', isMatch);
|
|
@@ -6414,25 +6466,7 @@ async function openSettingsModalNow(options = {}) {
|
|
|
6414
6466
|
const execInput = overlay.querySelector('#bc-executablePath');
|
|
6415
6467
|
const channelInput = overlay.querySelector('#bc-channel');
|
|
6416
6468
|
const pathRow = overlay.querySelector('#bc-executablePath')?.closest('.bc-card-row');
|
|
6417
|
-
const connectHidden = overlay.querySelector('#bc-connectMode');
|
|
6418
|
-
const wasMoreLogin = connectHidden?.value === 'morelogin';
|
|
6419
6469
|
|
|
6420
|
-
if (val === 'morelogin') {
|
|
6421
|
-
// MoreLogin is a browser backend — mirror it into the Connection dropdown.
|
|
6422
|
-
if (channelInput) channelInput.value = '';
|
|
6423
|
-
if (execInput) execInput.value = '';
|
|
6424
|
-
if (pathRow) pathRow.style.display = '';
|
|
6425
|
-
if (connectHidden) connectHidden.value = 'morelogin';
|
|
6426
|
-
syncBcDropdowns();
|
|
6427
|
-
applyMoreLoginMode(true);
|
|
6428
|
-
return;
|
|
6429
|
-
}
|
|
6430
|
-
// Leaving MoreLogin → revert the Connection dropdown to Mirror.
|
|
6431
|
-
if (wasMoreLogin) {
|
|
6432
|
-
if (connectHidden) connectHidden.value = 'mirror';
|
|
6433
|
-
syncBcDropdowns();
|
|
6434
|
-
applyMoreLoginMode(false);
|
|
6435
|
-
}
|
|
6436
6470
|
if (val === 'auto') {
|
|
6437
6471
|
if (execInput) execInput.value = '';
|
|
6438
6472
|
if (channelInput) channelInput.value = '';
|
|
@@ -6470,118 +6504,45 @@ async function openSettingsModalNow(options = {}) {
|
|
|
6470
6504
|
})();
|
|
6471
6505
|
}
|
|
6472
6506
|
|
|
6473
|
-
// ──
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
let
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
const
|
|
6481
|
-
|
|
6482
|
-
const
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
const proxyLabel = (p) => {
|
|
6509
|
-
if (!p) return '';
|
|
6510
|
-
const where = [p.host, p.port].filter(Boolean).join(':');
|
|
6511
|
-
return ` · ${[p.type, where, p.country].filter(Boolean).join(' ')}`;
|
|
6512
|
-
};
|
|
6513
|
-
// SynaBun drives the profile over CDP, so a Firefox-type one (`browser` from the server; absent = not known)
|
|
6514
|
-
// is listed, said as such and cannot be picked. One already saved as the default stays shown, with a warning.
|
|
6515
|
-
// dropdownHTML escapes the labels itself.
|
|
6516
|
-
setDropdownItems(sel, envs.map(e => (e.browser === 'firefox'
|
|
6517
|
-
? { value: String(e.id), label: kit.tx('settings.redesign.browser.moreloginFirefoxOption', { name: String(e.name ?? e.id) }), disabled: true }
|
|
6518
|
-
: { value: String(e.id), label: `${e.kind === 'local' ? kit.tx('settings.redesign.browser.moreloginLocalOption', { name: String(e.name ?? e.id) }) : (e.name ?? '')}${e.status ? ` (${String(e.status)})` : ''}${proxyLabel(e.proxy)}` })));
|
|
6519
|
-
if (want && envs.some(e => String(e.id) === String(want))) setDropdownValue(sel, String(want));
|
|
6520
|
-
const chosenFirefox = envs.some(e => String(e.id) === String(sel.value) && e.browser === 'firefox');
|
|
6521
|
-
if (statusEl) statusEl.style.color = chosenFirefox ? 'var(--stg-warn)' : '';
|
|
6522
|
-
// The server is still asking MoreLogin which browser some profiles run: ask again quietly, a few times.
|
|
6523
|
-
clearTimeout(_moreloginBrowsersTimer);
|
|
6524
|
-
if (Number(d.browsersPending) > 0 && _moreloginBrowsersTries < 8 && sel.isConnected) {
|
|
6525
|
-
_moreloginBrowsersTries += 1;
|
|
6526
|
-
_moreloginBrowsersTimer = setTimeout(() => loadMoreLoginEnvs(true), 2500);
|
|
6527
|
-
} else _moreloginBrowsersTries = 0;
|
|
6528
|
-
if (statusEl) {
|
|
6529
|
-
let msg = chosenFirefox
|
|
6530
|
-
? kit.tx('settings.redesign.browser.moreloginFirefoxDefault')
|
|
6531
|
-
: (moreloginNote
|
|
6532
|
-
? kit.tx('settings.redesign.browser.localProfilesOnly', { count: envs.length }) + ' ' + moreloginNote
|
|
6533
|
-
: kit.tx('settings.redesign.browser.profileSApiPort', { count: envs.length, port: d.port }));
|
|
6534
|
-
// MoreLogin silently redirects a navigation it refuses to its stop page: a
|
|
6535
|
-
// localhost port missing from the profile's Port scan protection list, or a
|
|
6536
|
-
// host its website blacklist/whitelist refuses. Surface it; nothing else in
|
|
6537
|
-
// the UI can explain it.
|
|
6538
|
-
if (d.blockedNavigations > 0) {
|
|
6539
|
-
msg += (" " + kit.tx('settings.redesign.browser.moreloginBlockedNavigationS', { blockedNavigations: d.blockedNavigations }));
|
|
6540
|
-
if (d.lastBlockedUrl) msg += kit.tx('settings.redesign.browser.mostRecently', { lastBlockedUrl: String(d.lastBlockedUrl).slice(0, 80) });
|
|
6541
|
-
msg += kit.tx('settings.redesign.browser.aLocalhostPortMustBeIn');
|
|
6542
|
-
}
|
|
6543
|
-
statusEl.textContent = msg;
|
|
6544
|
-
}
|
|
6545
|
-
} catch {
|
|
6546
|
-
only('settings.redesign.browser.error');
|
|
6547
|
-
if (statusEl) statusEl.textContent = kit.tx('settings.redesign.browser.failedToReachMorelogin');
|
|
6548
|
-
}
|
|
6549
|
-
}
|
|
6550
|
-
// Toggle MoreLogin-backend UI: show the MoreLogin profile picker, hide the
|
|
6551
|
-
// Chrome-only controls (Chrome Profile row + list, profile Path, attach Seed).
|
|
6552
|
-
function applyMoreLoginMode(on) {
|
|
6553
|
-
const mlRow = overlay.querySelector('#bc-morelogin-row');
|
|
6554
|
-
const mlStatusRow = overlay.querySelector('#bc-morelogin-status-row');
|
|
6555
|
-
if (mlRow) mlRow.style.display = on ? '' : 'none';
|
|
6556
|
-
if (mlStatusRow) mlStatusRow.style.display = on ? '' : 'none';
|
|
6557
|
-
const chromeProfRow = overlay.querySelector('#bc-detect-profiles')?.closest('.bc-card-row');
|
|
6558
|
-
const profileList = overlay.querySelector('#bc-profile-list');
|
|
6559
|
-
const profPathRow = overlay.querySelector('#bc-custom-profile-path')?.closest('.bc-card-row');
|
|
6560
|
-
if (chromeProfRow) chromeProfRow.style.display = on ? 'none' : '';
|
|
6561
|
-
if (profileList) profileList.style.display = on ? 'none' : '';
|
|
6562
|
-
if (profPathRow) profPathRow.style.display = on ? 'none' : '';
|
|
6563
|
-
if (on) {
|
|
6564
|
-
const seedRow = overlay.querySelector('#bc-attachSeed-row');
|
|
6565
|
-
if (seedRow) seedRow.style.display = 'none';
|
|
6566
|
-
loadMoreLoginEnvs();
|
|
6567
|
-
}
|
|
6568
|
-
}
|
|
6507
|
+
// ── The AI browser: a MoreLogin / local profile chosen in the MoreLogin tab (settings-ai-browser.js) ──
|
|
6508
|
+
// This tab only says so, with the way there. It never turns a profile on or off and never changes or clears it: a
|
|
6509
|
+
// save carries back what the server holds (browserSaveFields). Its own fields stay the local browser's.
|
|
6510
|
+
let _aiBrowser = { moreLogin: false, envId: null };
|
|
6511
|
+
let _aiBrowserProfile = null; // { envId, name, kind } as the MoreLogin tab listed it
|
|
6512
|
+
function showAiBrowser() {
|
|
6513
|
+
const profile = _aiBrowserProfile && _aiBrowserProfile.envId === _aiBrowser.envId ? _aiBrowserProfile : null;
|
|
6514
|
+
const line = aiBrowserLine(_aiBrowser, profile);
|
|
6515
|
+
const on = line.key !== 'off';
|
|
6516
|
+
const row = overlay.querySelector('#bc-ai-browser-row');
|
|
6517
|
+
if (row) row.style.display = on ? '' : 'none';
|
|
6518
|
+
const text = overlay.querySelector('#bc-ai-browser-text');
|
|
6519
|
+
if (text) text.textContent = on ? kit.tx(`settings.redesign.browser.aiBrowser.${line.key}`, line.params) : '';
|
|
6520
|
+
// The Connection field is the local browser's mode: not in use while a profile is the AI browser.
|
|
6521
|
+
const mode = overlay.querySelector('#bc-connectMode');
|
|
6522
|
+
if (mode) mode.disabled = on;
|
|
6523
|
+
const note = overlay.querySelector('#bc-connectMode-ai-note');
|
|
6524
|
+
if (note) note.style.display = on ? '' : 'none';
|
|
6525
|
+
syncBcDropdowns();
|
|
6526
|
+
}
|
|
6527
|
+
/** The AI browser as last heard: the MoreLogin tab's news (with the profile's name), or a read of the config. */
|
|
6528
|
+
function noteAiBrowser(detail) {
|
|
6529
|
+
if (!detail || typeof detail !== 'object') return;
|
|
6530
|
+
_aiBrowser = { moreLogin: detail.moreLogin === true, envId: detail.envId == null || detail.envId === '' ? null : String(detail.envId) };
|
|
6531
|
+
if (detail.name != null || detail.kind) _aiBrowserProfile = { envId: _aiBrowser.envId, name: detail.name ?? null, kind: detail.kind || null };
|
|
6532
|
+
showAiBrowser();
|
|
6533
|
+
}
|
|
6534
|
+
overlay.addEventListener(AI_BROWSER_EVENT, (e) => noteAiBrowser(e.detail), { signal: panelLife.signal });
|
|
6535
|
+
if (overlay._stgAiBrowser) noteAiBrowser(overlay._stgAiBrowser);
|
|
6536
|
+
overlay.querySelector('#bc-ai-browser-open')?.addEventListener('click', (e) => {
|
|
6537
|
+
e.preventDefault();
|
|
6538
|
+
applySettingsOpenOptions(overlay, { tab: 'connected-tools', expand: 'stg-sec-ml-default', scrollTo: 'stg-sec-ml-default', highlight: 'stg-sec-ml-default' });
|
|
6539
|
+
}, { signal: panelLife.signal });
|
|
6540
|
+
|
|
6541
|
+
// ── Connection mode (mirror / attach / extension) ──
|
|
6569
6542
|
function refreshAttachSeedRow() {
|
|
6570
6543
|
const mode = overlay.querySelector('#bc-connectMode')?.value || 'mirror';
|
|
6571
6544
|
const seedRow = overlay.querySelector('#bc-attachSeed-row');
|
|
6572
6545
|
if (seedRow) seedRow.style.display = mode === 'attach' ? '' : 'none';
|
|
6573
|
-
const showMl = mode === 'morelogin';
|
|
6574
|
-
// Keep the Browser dropdown in sync — MoreLogin appears in BOTH dropdowns.
|
|
6575
|
-
const browserHidden = overlay.querySelector('#bc-browser');
|
|
6576
|
-
if (showMl && browserHidden && browserHidden.value !== 'morelogin') {
|
|
6577
|
-
browserHidden.value = 'morelogin';
|
|
6578
|
-
syncBcDropdowns();
|
|
6579
|
-
} else if (!showMl && browserHidden && browserHidden.value === 'morelogin') {
|
|
6580
|
-
browserHidden.value = 'auto';
|
|
6581
|
-
const chan = overlay.querySelector('#bc-channel'); if (chan) chan.value = '';
|
|
6582
|
-
syncBcDropdowns();
|
|
6583
|
-
}
|
|
6584
|
-
applyMoreLoginMode(showMl);
|
|
6585
6546
|
updateChromeRunningWarning();
|
|
6586
6547
|
}
|
|
6587
6548
|
const connectModeDd = overlay.querySelector('.bc-dropdown[data-for="bc-connectMode"]');
|
|
@@ -6591,10 +6552,6 @@ async function openSettingsModalNow(options = {}) {
|
|
|
6591
6552
|
item.addEventListener('click', refreshAttachSeedRow);
|
|
6592
6553
|
});
|
|
6593
6554
|
}
|
|
6594
|
-
{ const mlRow = overlay.querySelector('#bc-morelogin-row'); if (mlRow) wireDropdowns(mlRow, { signal: panelLife.signal }); }
|
|
6595
|
-
// Another profile chosen: the line under the picker says what holds for that one (the Firefox warning goes).
|
|
6596
|
-
overlay.querySelector('#bc-morelogin-env-id')?.addEventListener('change', () => loadMoreLoginEnvs(true), { signal: panelLife.signal });
|
|
6597
|
-
overlay.querySelector('#bc-morelogin-refresh')?.addEventListener('click', (e) => { e.preventDefault(); loadMoreLoginEnvs(); });
|
|
6598
6555
|
const attachSeedDd = overlay.querySelector('.bc-dropdown[data-for="bc-attachSeed"]');
|
|
6599
6556
|
if (attachSeedDd) {
|
|
6600
6557
|
attachSeedDd.querySelectorAll('.cc-dropdown-item').forEach(item => {
|
|
@@ -6878,10 +6835,13 @@ async function openSettingsModalNow(options = {}) {
|
|
|
6878
6835
|
}
|
|
6879
6836
|
|
|
6880
6837
|
// Collect all config from the form
|
|
6838
|
+
const refreshExtensionSettings = wireExtensionSettings(overlay, { tx: kit.tx, signal: panelLife.signal });
|
|
6839
|
+
|
|
6881
6840
|
function collectBrowserConfig() {
|
|
6882
6841
|
const val = (id) => (overlay.querySelector(`#${id}`)?.value || '').trim();
|
|
6883
6842
|
const num = (id, def) => { const v = parseInt(val(id), 10); return isNaN(v) ? def : v; };
|
|
6884
6843
|
const numF = (id, def) => { const v = parseFloat(val(id)); return isNaN(v) ? def : v; };
|
|
6844
|
+
const connection = browserSaveFields(val('bc-connectMode'), _aiBrowser);
|
|
6885
6845
|
|
|
6886
6846
|
// Permissions
|
|
6887
6847
|
const permissions = [];
|
|
@@ -6893,11 +6853,12 @@ async function openSettingsModalNow(options = {}) {
|
|
|
6893
6853
|
// Executable
|
|
6894
6854
|
executablePath: val('bc-executablePath') || null,
|
|
6895
6855
|
userDataDir: val('bc-userDataDir') || null,
|
|
6896
|
-
browser:
|
|
6856
|
+
browser: val('bc-browser') || 'auto',
|
|
6897
6857
|
channel: val('bc-channel') || null,
|
|
6898
|
-
|
|
6858
|
+
// The AI browser goes back as the server holds it (a MoreLogin profile stays on, its id is never cleared here).
|
|
6859
|
+
connectMode: connection.connectMode,
|
|
6899
6860
|
attachSeed: val('bc-attachSeed') === 'fresh' ? 'fresh' : 'real',
|
|
6900
|
-
moreloginEnvId:
|
|
6861
|
+
moreloginEnvId: connection.moreloginEnvId,
|
|
6901
6862
|
slowMo: num('bc-slowMo', 0),
|
|
6902
6863
|
timeout: num('bc-timeout', 30000),
|
|
6903
6864
|
navigationTimeout: num('bc-navigationTimeout', 30000),
|
|
@@ -7006,16 +6967,14 @@ async function openSettingsModalNow(options = {}) {
|
|
|
7006
6967
|
setVal('bc-executablePath', cfg.executablePath);
|
|
7007
6968
|
setVal('bc-userDataDir', cfg.userDataDir || '');
|
|
7008
6969
|
matchProfileSelection(cfg.userDataDir || '', _synabunProfile);
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
setVal('bc-browser', _showMl ? 'morelogin' : (cfg.browser || 'auto'));
|
|
6970
|
+
// The local browser's own fields; a MoreLogin AI browser is shown by showAiBrowser, never as one of their values.
|
|
6971
|
+
setVal('bc-browser', cfg.browser && cfg.browser !== 'morelogin' ? cfg.browser : 'auto');
|
|
7012
6972
|
setVal('bc-channel', cfg.channel || '');
|
|
7013
|
-
setVal('bc-connectMode', cfg
|
|
6973
|
+
setVal('bc-connectMode', localConnectModeOf(cfg));
|
|
6974
|
+
refreshExtensionSettings?.();
|
|
7014
6975
|
setVal('bc-attachSeed', cfg.attachSeed || 'real');
|
|
7015
6976
|
const _seedRow = overlay.querySelector('#bc-attachSeed-row');
|
|
7016
6977
|
if (_seedRow) _seedRow.style.display = (cfg.connectMode === 'attach') ? '' : 'none';
|
|
7017
|
-
_moreloginDesiredEnvId = cfg.moreloginEnvId || '';
|
|
7018
|
-
applyMoreLoginMode(_showMl);
|
|
7019
6978
|
setVal('bc-slowMo', cfg.slowMo ?? 0);
|
|
7020
6979
|
setVal('bc-timeout', cfg.timeout ?? 30000);
|
|
7021
6980
|
setVal('bc-navigationTimeout', cfg.navigationTimeout ?? 30000);
|
|
@@ -7139,13 +7098,18 @@ async function openSettingsModalNow(options = {}) {
|
|
|
7139
7098
|
}
|
|
7140
7099
|
}
|
|
7141
7100
|
|
|
7101
|
+
// Keep the local default in the form until the saved config arrives.
|
|
7102
|
+
const connectModeInput = overlay.querySelector('#bc-connectMode');
|
|
7103
|
+
if (connectModeInput) connectModeInput.value = LOCAL_DEFAULT_MODE;
|
|
7104
|
+
syncBcDropdowns();
|
|
7105
|
+
|
|
7142
7106
|
// Load config on open, then auto-detect profiles. A refused read (no owner access) is "No access", never defaults.
|
|
7143
7107
|
fetch('/api/browser/config').then(async (r) => {
|
|
7144
7108
|
if (markPaneRefused(overlay, 'browser', await refusalOfResponse(r))) return null;
|
|
7145
7109
|
return r.json();
|
|
7146
7110
|
}).then(async (data) => {
|
|
7147
7111
|
if (!data) return;
|
|
7148
|
-
if (data.config) { applyBrowserConfig(data.config); syncBcDropdowns(); }
|
|
7112
|
+
if (data.config) { applyBrowserConfig(data.config); syncBcDropdowns(); noteAiBrowser(aiBrowserOf(data.config)); }
|
|
7149
7113
|
// Show detected path
|
|
7150
7114
|
const hint = overlay.querySelector('#bc-detected-path');
|
|
7151
7115
|
if (hint && data.detectedPath) hint.textContent = kit.tx('settings.redesign.browser.detected', { detectedPath: data.detectedPath });
|
|
@@ -7160,10 +7124,22 @@ async function openSettingsModalNow(options = {}) {
|
|
|
7160
7124
|
const saveBtn = overlay.querySelector('#bc-save-all');
|
|
7161
7125
|
if (saveBtn) {
|
|
7162
7126
|
saveBtn.addEventListener('click', async () => {
|
|
7163
|
-
const config = collectBrowserConfig();
|
|
7164
7127
|
saveBtn.style.opacity = '0.5'; saveBtn.style.pointerEvents = 'none';
|
|
7165
7128
|
const status = overlay.querySelector('#bc-save-status');
|
|
7129
|
+
// The AI browser as the server holds it now: the MoreLogin tab, or another window, may have changed it since this
|
|
7130
|
+
// page read it, and this save carries it back unchanged. A failed read keeps the last one heard.
|
|
7166
7131
|
try {
|
|
7132
|
+
const fresh = await fetch('/api/browser/config');
|
|
7133
|
+
const freshData = fresh.ok ? await fresh.json() : null;
|
|
7134
|
+
if (freshData && freshData.config) noteAiBrowser(aiBrowserOf(freshData.config));
|
|
7135
|
+
} catch { /* the last state heard stands */ }
|
|
7136
|
+
const config = collectBrowserConfig();
|
|
7137
|
+
try {
|
|
7138
|
+
// Public assets can reload before the backend. An older server normalizes an unknown mode to mirror.
|
|
7139
|
+
if (config.connectMode === 'extension') {
|
|
7140
|
+
const support = await fetch('/api/browser/extension');
|
|
7141
|
+
if (!support.ok || !(await support.json()).extensionId) throw new Error(kit.tx('browserExtension.restart'));
|
|
7142
|
+
}
|
|
7167
7143
|
const res = await fetch('/api/browser/config', {
|
|
7168
7144
|
method: 'PUT',
|
|
7169
7145
|
headers: { 'Content-Type': 'application/json' },
|
|
@@ -10410,34 +10386,21 @@ function showSyncCopiedModal(count) {
|
|
|
10410
10386
|
// INIT — wire settings button clicks
|
|
10411
10387
|
// ═══════════════════════════════════════════
|
|
10412
10388
|
|
|
10413
|
-
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
|
|
10417
|
-
const titlebarBtn = document.getElementById('titlebar-settings-btn');
|
|
10418
|
-
if (titlebarBtn) titlebarBtn.addEventListener('click', () => openSettingsModal());
|
|
10419
|
-
|
|
10420
|
-
const menubarBtn = document.getElementById('menubar-settings-btn');
|
|
10421
|
-
if (menubarBtn) menubarBtn.addEventListener('click', () => openSettingsModal());
|
|
10389
|
+
// The buttons, the shortcut, the launch prefetches and the sync listeners are wired by ui-settings-entry.js (its
|
|
10390
|
+
// initSettings, re-exported here), which loads this module on the first open or in idle time after the page shows.
|
|
10391
|
+
export { initSettings } from './ui-settings-entry.js';
|
|
10422
10392
|
|
|
10423
|
-
|
|
10424
|
-
|
|
10425
|
-
// A language change reloaded the app: open Settings again where the user was, once the rest of the app has started.
|
|
10393
|
+
/** A language change reloaded the app: open Settings again where the user was (ui-settings-entry.js, once). */
|
|
10394
|
+
export function reopenSettingsAfterReload() {
|
|
10426
10395
|
const reopenPage = takeSettingsReopen();
|
|
10427
|
-
if (reopenPage)
|
|
10428
|
-
|
|
10429
|
-
// Launch: what Settings is built from, and its search index (the English names too), read and made once the
|
|
10430
|
-
// page has painted, so the first open and the first search wait for nothing.
|
|
10431
|
-
registerLaunchPrefetch('settings-data', () => prefetchSettingsData(), { order: 60, owner: true });
|
|
10432
|
-
registerLaunchPrefetch('settings-search-index', () => prebuildSettingsSearchIndex(), { order: 62 });
|
|
10433
|
-
// Changes other windows announce: the next open shows them.
|
|
10434
|
-
on('sync:skin:changed', () => refreshSettingsData(['skins']));
|
|
10435
|
-
on('sync:greeting:changed', () => refreshSettingsData(['greeting']));
|
|
10436
|
-
on('sync:assistant:user-context-changed', () => refreshSettingsData(['userContext']));
|
|
10437
|
-
|
|
10438
|
-
// Expose sync functions for inline onclick attributes (if any remain)
|
|
10439
|
-
window.checkSyncStatus = checkSyncStatus;
|
|
10440
|
-
window.copySyncPrompt = copySyncPrompt;
|
|
10396
|
+
if (reopenPage) openSettingsModal({ tab: reopenPage, expand: ['stg-sec-language'] });
|
|
10441
10397
|
}
|
|
10442
10398
|
|
|
10399
|
+
/** The launch step that makes the Settings search index (ui-settings-entry.js registers it). */
|
|
10400
|
+
export { prebuildSettingsSearchIndex };
|
|
10401
|
+
|
|
10402
|
+
// Expose sync functions for inline onclick attributes (if any remain)
|
|
10403
|
+
window.checkSyncStatus = checkSyncStatus;
|
|
10404
|
+
window.copySyncPrompt = copySyncPrompt;
|
|
10405
|
+
|
|
10443
10406
|
configureToolPickerTranslation((key, params) => kit.tx(key, params));
|