synabun 2.2.2 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/README.md +1 -1
- package/docs/whatsapp.md +52 -20
- package/lib/mcp-build.js +519 -0
- package/lib/mcp-dist.js +10 -4
- package/lib/server-supervisor.js +7 -1
- package/lib/virustotal.mjs +4 -2
- package/mcp-server/dist/http.d.ts +38 -0
- package/mcp-server/dist/http.d.ts.map +1 -1
- package/mcp-server/dist/http.js +75 -7
- package/mcp-server/dist/http.js.map +1 -1
- package/mcp-server/dist/services/browser-route-flow.d.ts +3 -2
- package/mcp-server/dist/services/browser-route-flow.d.ts.map +1 -1
- package/mcp-server/dist/services/browser-route-flow.js +4 -3
- package/mcp-server/dist/services/browser-route-flow.js.map +1 -1
- package/mcp-server/dist/services/embedding-service.d.ts.map +1 -1
- package/mcp-server/dist/services/embedding-service.js +2 -1
- package/mcp-server/dist/services/embedding-service.js.map +1 -1
- package/mcp-server/dist/services/neural-interface.d.ts +21 -0
- package/mcp-server/dist/services/neural-interface.d.ts.map +1 -1
- package/mcp-server/dist/services/neural-interface.js +76 -4
- package/mcp-server/dist/services/neural-interface.js.map +1 -1
- package/mcp-server/dist/services/tool-catalog.js +2 -2
- package/mcp-server/dist/services/tool-catalog.js.map +1 -1
- package/mcp-server/dist/tools/agents.d.ts +3 -2
- package/mcp-server/dist/tools/agents.d.ts.map +1 -1
- package/mcp-server/dist/tools/agents.js +6 -4
- package/mcp-server/dist/tools/agents.js.map +1 -1
- package/mcp-server/dist/tools/browser-advanced.d.ts +3 -1
- package/mcp-server/dist/tools/browser-advanced.d.ts.map +1 -1
- package/mcp-server/dist/tools/browser-advanced.js +30 -8
- package/mcp-server/dist/tools/browser-advanced.js.map +1 -1
- package/mcp-server/dist/tools/browser-navigate.d.ts +3 -3
- package/mcp-server/dist/tools/browser-navigate.d.ts.map +1 -1
- package/mcp-server/dist/tools/browser-navigate.js +19 -16
- package/mcp-server/dist/tools/browser-navigate.js.map +1 -1
- package/mcp-server/dist/tools/browser-observe.d.ts +2 -1
- package/mcp-server/dist/tools/browser-observe.d.ts.map +1 -1
- package/mcp-server/dist/tools/browser-observe.js +61 -20
- package/mcp-server/dist/tools/browser-observe.js.map +1 -1
- package/mcp-server/dist/tools/morelogin.d.ts +13 -3
- package/mcp-server/dist/tools/morelogin.d.ts.map +1 -1
- package/mcp-server/dist/tools/morelogin.js +81 -20
- package/mcp-server/dist/tools/morelogin.js.map +1 -1
- package/mcp-server/dist/tools/youtube/upload.d.ts.map +1 -1
- package/mcp-server/dist/tools/youtube/upload.js +225 -88
- package/mcp-server/dist/tools/youtube/upload.js.map +1 -1
- package/mcp-server/package-lock.json +2 -2
- package/mcp-server/package.json +1 -1
- package/mcp-server/src/http.ts +79 -7
- package/mcp-server/src/services/browser-route-flow.ts +4 -3
- package/mcp-server/src/services/embedding-service.ts +2 -1
- package/mcp-server/src/services/neural-interface.ts +77 -4
- package/mcp-server/src/services/tool-catalog.ts +2 -2
- package/mcp-server/src/tools/agents.ts +8 -4
- package/mcp-server/src/tools/browser-advanced.ts +29 -8
- package/mcp-server/src/tools/browser-navigate.ts +19 -16
- package/mcp-server/src/tools/browser-observe.ts +62 -20
- package/mcp-server/src/tools/morelogin.ts +81 -20
- package/mcp-server/src/tools/youtube/upload.ts +218 -99
- package/neural-interface/i18n/en.json +631 -123
- package/neural-interface/i18n/pt-BR.json +518 -10
- package/neural-interface/lib/assistant-api.js +26 -0
- package/neural-interface/lib/assistant-brains/claude.js +5 -0
- package/neural-interface/lib/assistant-catalog.js +114 -1
- package/neural-interface/lib/assistant-dispatch.js +71 -1
- package/neural-interface/lib/assistant-persona.js +14 -7
- package/neural-interface/lib/assistant-router.js +6 -4
- package/neural-interface/lib/assistant-runtime.js +3 -0
- package/neural-interface/lib/assistant-task-prompt.js +5 -0
- package/neural-interface/lib/automation-approval.js +249 -0
- package/neural-interface/lib/automation-browser-owner-access.js +82 -0
- package/neural-interface/lib/backup-service.js +16 -1
- package/neural-interface/lib/browser-background-tab.js +72 -3
- package/neural-interface/lib/browser-extraction.js +106 -45
- package/neural-interface/lib/browser-profile-choices.js +143 -0
- package/neural-interface/lib/browser-profiles.js +142 -0
- package/neural-interface/lib/browser-tab-recovery.js +153 -0
- package/neural-interface/lib/browser-tool-policy.js +2 -0
- package/neural-interface/lib/chromium-on-device-model.js +67 -0
- package/neural-interface/lib/claude-agent-bridge.js +7 -4
- package/neural-interface/lib/claude-model-catalog.js +12 -0
- package/neural-interface/lib/effort-levels.js +28 -2
- package/neural-interface/lib/local-profile-proxy.js +362 -0
- package/neural-interface/lib/local-profiles.js +929 -0
- package/neural-interface/lib/loop-logger.js +25 -4
- package/neural-interface/lib/maritaca/api.js +179 -0
- package/neural-interface/lib/maritaca/attachments.js +44 -0
- package/neural-interface/lib/maritaca/client.js +362 -0
- package/neural-interface/lib/maritaca/key-store.js +122 -0
- package/neural-interface/lib/maritaca/models.js +181 -0
- package/neural-interface/lib/maritaca/modes.js +39 -0
- package/neural-interface/lib/maritaca/opencode-proxy.js +236 -0
- package/neural-interface/lib/maritaca/opencode-stream.js +345 -0
- package/neural-interface/lib/maritaca/opencode.js +218 -0
- package/neural-interface/lib/maritaca/panel-bridge.js +273 -0
- package/neural-interface/lib/maritaca/sessions.js +198 -0
- package/neural-interface/lib/morelogin-agent-profiles.js +149 -0
- package/neural-interface/lib/morelogin.js +278 -14
- package/neural-interface/lib/native-loop-providers.js +3 -1
- package/neural-interface/lib/owner-authority.js +30 -12
- package/neural-interface/lib/page-session.js +43 -17
- package/neural-interface/lib/request-gate.js +2 -0
- package/neural-interface/lib/system-activity.js +1 -1
- package/neural-interface/lib/terminal-tokens.js +82 -5
- package/neural-interface/package-lock.json +3 -2
- package/neural-interface/package.json +2 -1
- package/neural-interface/public/assets/mascot/README.md +11 -0
- package/neural-interface/public/assets/mascot/ask.gif +0 -0
- package/neural-interface/public/assets/mascot/ask.png +0 -0
- package/neural-interface/public/assets/mascot/blocked.gif +0 -0
- package/neural-interface/public/assets/mascot/blocked.png +0 -0
- package/neural-interface/public/assets/mascot/budget.gif +0 -0
- package/neural-interface/public/assets/mascot/budget.png +0 -0
- package/neural-interface/public/assets/mascot/computer.gif +0 -0
- package/neural-interface/public/assets/mascot/computer.png +0 -0
- package/neural-interface/public/assets/mascot/edit.gif +0 -0
- package/neural-interface/public/assets/mascot/edit.png +0 -0
- package/neural-interface/public/assets/mascot/error.gif +0 -0
- package/neural-interface/public/assets/mascot/error.png +0 -0
- package/neural-interface/public/assets/mascot/hover-attention.gif +0 -0
- package/neural-interface/public/assets/mascot/hover-attention.png +0 -0
- package/neural-interface/public/assets/mascot/idle-hero.gif +0 -0
- package/neural-interface/public/assets/mascot/idle-hero.png +0 -0
- package/neural-interface/public/assets/mascot/idle.gif +0 -0
- package/neural-interface/public/assets/mascot/idle.png +0 -0
- package/neural-interface/public/assets/mascot/manifest.json +254 -0
- package/neural-interface/public/assets/mascot/mcp.gif +0 -0
- package/neural-interface/public/assets/mascot/mcp.png +0 -0
- package/neural-interface/public/assets/mascot/memory.gif +0 -0
- package/neural-interface/public/assets/mascot/memory.png +0 -0
- package/neural-interface/public/assets/mascot/offline.gif +0 -0
- package/neural-interface/public/assets/mascot/offline.png +0 -0
- package/neural-interface/public/assets/mascot/pick.gif +0 -0
- package/neural-interface/public/assets/mascot/pick.png +0 -0
- package/neural-interface/public/assets/mascot/plan.gif +0 -0
- package/neural-interface/public/assets/mascot/plan.png +0 -0
- package/neural-interface/public/assets/mascot/present.gif +0 -0
- package/neural-interface/public/assets/mascot/present.png +0 -0
- package/neural-interface/public/assets/mascot/project.gif +0 -0
- package/neural-interface/public/assets/mascot/project.png +0 -0
- package/neural-interface/public/assets/mascot/read.gif +0 -0
- package/neural-interface/public/assets/mascot/read.png +0 -0
- package/neural-interface/public/assets/mascot/runs.gif +0 -0
- package/neural-interface/public/assets/mascot/runs.png +0 -0
- package/neural-interface/public/assets/mascot/scenes/automation.gif +0 -0
- package/neural-interface/public/assets/mascot/scenes/automation.png +0 -0
- package/neural-interface/public/assets/mascot/scenes/browser.gif +0 -0
- package/neural-interface/public/assets/mascot/scenes/browser.png +0 -0
- package/neural-interface/public/assets/mascot/scenes/code.gif +0 -0
- package/neural-interface/public/assets/mascot/scenes/code.png +0 -0
- package/neural-interface/public/assets/mascot/scenes/complex.gif +0 -0
- package/neural-interface/public/assets/mascot/scenes/complex.png +0 -0
- package/neural-interface/public/assets/mascot/scenes/computer.gif +0 -0
- package/neural-interface/public/assets/mascot/scenes/computer.png +0 -0
- package/neural-interface/public/assets/mascot/scenes/design.gif +0 -0
- package/neural-interface/public/assets/mascot/scenes/design.png +0 -0
- package/neural-interface/public/assets/mascot/scenes/edit.gif +0 -0
- package/neural-interface/public/assets/mascot/scenes/edit.png +0 -0
- package/neural-interface/public/assets/mascot/scenes/generic.gif +0 -0
- package/neural-interface/public/assets/mascot/scenes/generic.png +0 -0
- package/neural-interface/public/assets/mascot/scenes/image_gen.gif +0 -0
- package/neural-interface/public/assets/mascot/scenes/image_gen.png +0 -0
- package/neural-interface/public/assets/mascot/scenes/manifest.json +173 -0
- package/neural-interface/public/assets/mascot/scenes/memory.gif +0 -0
- package/neural-interface/public/assets/mascot/scenes/memory.png +0 -0
- package/neural-interface/public/assets/mascot/scenes/quick.gif +0 -0
- package/neural-interface/public/assets/mascot/scenes/quick.png +0 -0
- package/neural-interface/public/assets/mascot/scenes/read.gif +0 -0
- package/neural-interface/public/assets/mascot/scenes/read.png +0 -0
- package/neural-interface/public/assets/mascot/scenes/research.gif +0 -0
- package/neural-interface/public/assets/mascot/scenes/research.png +0 -0
- package/neural-interface/public/assets/mascot/scenes/review.gif +0 -0
- package/neural-interface/public/assets/mascot/scenes/review.png +0 -0
- package/neural-interface/public/assets/mascot/scenes/search.gif +0 -0
- package/neural-interface/public/assets/mascot/scenes/search.png +0 -0
- package/neural-interface/public/assets/mascot/scenes/shell.gif +0 -0
- package/neural-interface/public/assets/mascot/scenes/shell.png +0 -0
- package/neural-interface/public/assets/mascot/scenes/thinking.gif +0 -0
- package/neural-interface/public/assets/mascot/scenes/thinking.png +0 -0
- package/neural-interface/public/assets/mascot/scenes/video_gen.gif +0 -0
- package/neural-interface/public/assets/mascot/scenes/video_gen.png +0 -0
- package/neural-interface/public/assets/mascot/scenes/web.gif +0 -0
- package/neural-interface/public/assets/mascot/scenes/web.png +0 -0
- package/neural-interface/public/assets/mascot/search.gif +0 -0
- package/neural-interface/public/assets/mascot/search.png +0 -0
- package/neural-interface/public/assets/mascot/shell.gif +0 -0
- package/neural-interface/public/assets/mascot/shell.png +0 -0
- package/neural-interface/public/assets/mascot/skill.gif +0 -0
- package/neural-interface/public/assets/mascot/skill.png +0 -0
- package/neural-interface/public/assets/mascot/sleep.gif +0 -0
- package/neural-interface/public/assets/mascot/sleep.png +0 -0
- package/neural-interface/public/assets/mascot/subagent.gif +0 -0
- package/neural-interface/public/assets/mascot/subagent.png +0 -0
- package/neural-interface/public/assets/mascot/success.gif +0 -0
- package/neural-interface/public/assets/mascot/success.png +0 -0
- package/neural-interface/public/assets/mascot/think.gif +0 -0
- package/neural-interface/public/assets/mascot/think.png +0 -0
- package/neural-interface/public/assets/mascot/wait.gif +0 -0
- package/neural-interface/public/assets/mascot/wait.png +0 -0
- package/neural-interface/public/assets/mascot/watch.gif +0 -0
- package/neural-interface/public/assets/mascot/watch.png +0 -0
- package/neural-interface/public/assets/mascot/web.gif +0 -0
- package/neural-interface/public/assets/mascot/web.png +0 -0
- package/neural-interface/public/onboarding.html +14 -1
- package/neural-interface/public/shared/agent-runtime-options.js +49 -8
- package/neural-interface/public/shared/agy/agy-panel.js +2 -2
- package/neural-interface/public/shared/api.js +4 -4
- package/neural-interface/public/shared/assistant/asst-ask-styles.js +8 -8
- package/neural-interface/public/shared/assistant/asst-ask.js +1 -1
- package/neural-interface/public/shared/assistant/asst-brain-picker.js +99 -9
- package/neural-interface/public/shared/assistant/asst-control.js +1 -1
- package/neural-interface/public/shared/assistant/asst-limit-wait.js +4 -4
- package/neural-interface/public/shared/assistant/asst-panel.js +6 -2
- package/neural-interface/public/shared/assistant/asst-rack-styles.js +4 -4
- package/neural-interface/public/shared/assistant/asst-render.js +6 -6
- package/neural-interface/public/shared/assistant/asst-route-models.js +64 -4
- package/neural-interface/public/shared/assistant/asst-route.js +24 -7
- package/neural-interface/public/shared/assistant/asst-routes-editor.js +154 -39
- package/neural-interface/public/shared/assistant/asst-run-stage.js +3 -3
- package/neural-interface/public/shared/assistant/asst-scene-styles.js +8 -111
- package/neural-interface/public/shared/assistant/asst-scenes.js +46 -318
- package/neural-interface/public/shared/assistant/asst-sidepanel.js +2 -2
- package/neural-interface/public/shared/assistant/asst-state.js +72 -2
- package/neural-interface/public/shared/assistant/asst-styles.js +58 -14
- package/neural-interface/public/shared/automation-approval-view.js +75 -0
- package/neural-interface/public/shared/cdx/cdx-panel.js +2 -2
- package/neural-interface/public/shared/context-menu-model.js +2 -0
- package/neural-interface/public/shared/editor/editor-panel-logic.js +10 -0
- package/neural-interface/public/shared/editor/editor-panel.js +10 -2
- package/neural-interface/public/shared/html-shell.js +30 -22
- package/neural-interface/public/shared/morelogin-profile-choices.js +107 -0
- package/neural-interface/public/shared/morelogin-profile-field.js +186 -0
- package/neural-interface/public/shared/mtc/mtc-client.js +181 -0
- package/neural-interface/public/shared/mtc/mtc-compose.js +40 -0
- package/neural-interface/public/shared/mtc/mtc-copy.js +253 -0
- package/neural-interface/public/shared/mtc/mtc-logic.js +478 -0
- package/neural-interface/public/shared/mtc/mtc-panel.js +1354 -0
- package/neural-interface/public/shared/mtc/mtc-render.js +172 -0
- package/neural-interface/public/shared/mtc/mtc-styles.js +437 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +6 -2
- package/neural-interface/public/shared/provider-icons.js +3 -0
- package/neural-interface/public/shared/schedules-view.js +7 -0
- package/neural-interface/public/shared/server-back.js +50 -0
- package/neural-interface/public/shared/settings/settings-browser-owner-access.js +72 -0
- package/neural-interface/public/shared/settings/settings-data.js +1 -0
- package/neural-interface/public/shared/settings/settings-ia.js +3 -1
- package/neural-interface/public/shared/settings/settings-local-profiles.js +153 -0
- package/neural-interface/public/shared/settings/settings-maritaca-opencode.js +105 -0
- package/neural-interface/public/shared/sidepanel-session-status.js +16 -2
- package/neural-interface/public/shared/state.js +1 -1
- package/neural-interface/public/shared/styles.css +356 -157
- package/neural-interface/public/shared/synabun-mascot-assets.js +67 -0
- package/neural-interface/public/shared/synabun-mascot.js +136 -12
- package/neural-interface/public/shared/synabun-ticker.js +3 -0
- package/neural-interface/public/shared/topright-overflow-logic.js +1 -0
- package/neural-interface/public/shared/ui-automation-approval.js +188 -0
- package/neural-interface/public/shared/ui-automation-studio.js +130 -90
- package/neural-interface/public/shared/ui-claude-panel.js +50 -2
- package/neural-interface/public/shared/ui-maritaca-panel.js +15 -0
- package/neural-interface/public/shared/ui-navbar.js +17 -0
- package/neural-interface/public/shared/ui-panels.js +3 -1
- package/neural-interface/public/shared/ui-schedules-studio.js +118 -17
- package/neural-interface/public/shared/ui-scroll-follow.js +3 -0
- package/neural-interface/public/shared/ui-settings.js +590 -27
- package/neural-interface/public/shared/ui-sidepanel-session-entry.js +8 -2
- package/neural-interface/public/shared/ui-sidepanel-sessions.js +3 -3
- package/neural-interface/public/shared/ui-sidepanel-tray.js +24 -0
- package/neural-interface/public/shared/ui-sidepanel-windows.js +1 -1
- package/neural-interface/scripts/build-mascot-assets.mjs +30 -0
- package/neural-interface/server.js +1784 -195
- package/npm-shrinkwrap.json +5 -17
- package/package.json +5 -6
- package/postinstall.js +38 -39
- package/setup.js +33 -31
- package/skills/synabun/modules/changelog.md +14 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { fetchToolCatalog } from './agent-runtime-options.js';
|
|
2
|
+
import { reloadAfterRestore } from './server-back.js';
|
|
2
3
|
import { configureToolPickerTranslation, toolPickerHTML, readToolPicker, toolWord, toolServersNote } from './tool-list-picker.js';
|
|
3
4
|
import { mountMemoryMaintenance } from './ui-memory-maintenance.js';
|
|
4
5
|
import { buildJudgmentsTab, wireJudgmentsTab } from './ui-judgments.js';
|
|
@@ -12,15 +13,18 @@ import { skillFoldersHTML, wireSkillFolders, refreshSkillChips, chipState, insta
|
|
|
12
13
|
import { RULES_HOST_LABELS, describeRulesHost, describeRulesInstall, describeRulesInstallAll } from './settings/settings-rules.js';
|
|
13
14
|
import { readUserContextResponse, describeUserContext, describeUserContextSaveFailure } from './settings/settings-user-context.js';
|
|
14
15
|
import { readWorkerGuardResponse, describeWorkerGuard, describeWorkerGuardSaveFailure } from './settings/settings-worker-guard.js';
|
|
16
|
+
import { readOwnerAccessResponse, describeOwnerAccess, describeOwnerAccessSaveFailure } from './settings/settings-browser-owner-access.js';
|
|
15
17
|
import { CLAUDE_HOOK_ROWS, readClaudeHooksResponse, describeClaudeHooks, describeClaudeHooksSaveFailure } from './settings/settings-claude-hooks.js';
|
|
16
18
|
import { readGreetingStatus, describeGreeting, describeGreetingSaveFailure } from './settings/settings-greeting.js';
|
|
17
19
|
import { describeOpencodeInstall } from './settings/settings-opencode.js';
|
|
20
|
+
import { maritacaOpencodeCardView, maritacaOpencodeModelRows, MARITACA_OPENCODE_KEYS, MARITACA_OPENCODE_PROVIDER } from './settings/settings-maritaca-opencode.js';
|
|
18
21
|
import { renderGreeting, clearGreeting } from './greeting/greeting-card.js';
|
|
19
22
|
import { createTunnelCard, drawInto, mcpKeyNeededText, readTunnel } from './ui-tunnel.js';
|
|
20
23
|
import { remoteMcpAddress } from './tunnel-view.js';
|
|
21
24
|
import { recheckCliStatus, getCliStatus, addCliToPath } from './cli-status.js';
|
|
22
25
|
import { cliInstallText, setCliInstallTranslator } from './cli-install-view.js';
|
|
23
26
|
import { dropdownHTML, wireDropdowns, setDropdownItems, setDropdownValue } from './cc-dropdown.js';
|
|
27
|
+
import { PROXY_TYPES, isLocalProfile, proxySummary, defaultCreateWhere, isPlanLimit, formOfProfile, readLocalProfileForm, proxyOfForm, createAction, whereOptions, passwordNeededAgain } from './settings/settings-local-profiles.js';
|
|
24
28
|
import { setStaticBgVisible } from './static-bg-state.js';
|
|
25
29
|
setCliInstallTranslator((key, params) => kit.tx(`cliInstall.${key}`, params));
|
|
26
30
|
import { setGitBashTranslator } from './git-bash-view.js';
|
|
@@ -755,7 +759,7 @@ function buildServerTab(settings, connections = []) {
|
|
|
755
759
|
</div>`;
|
|
756
760
|
}
|
|
757
761
|
|
|
758
|
-
function buildBrowserTab() {
|
|
762
|
+
function buildBrowserTab(ownerAccess = null) {
|
|
759
763
|
const b = (key) => kit.te(`settings.redesign.browser.${key}`);
|
|
760
764
|
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>';
|
|
761
765
|
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>';
|
|
@@ -783,6 +787,24 @@ function buildBrowserTab() {
|
|
|
783
787
|
</div>`;
|
|
784
788
|
const X = '<span class="bc-x" aria-hidden="true">×</span>';
|
|
785
789
|
const unit = (invId) => `<span class="bc-unit">${kit.L(invId)}</span>`;
|
|
790
|
+
// Let the automation browser act as owner (lib/automation-browser-owner-access.js): one switch, off by default.
|
|
791
|
+
// `ownerAccess` is the view of what the server answered (describeOwnerAccess): a server started before the
|
|
792
|
+
// setting shows it off, disabled, under a line that says a restart is missing; while on, a warning line says so.
|
|
793
|
+
const oa = ownerAccess || describeOwnerAccess(null, { tx: kit.tx });
|
|
794
|
+
const oaNotes = [...(oa.note ? [oa.note] : []), ...(oa.warning ? [{ text: oa.warning, tone: 'warn' }] : [])];
|
|
795
|
+
const ownerAccessBlock = `
|
|
796
|
+
<div class="cc-hook-toggles" id="boa-row" data-boa-ready="${oa.ready ? '1' : '0'}">
|
|
797
|
+
<div class="cc-integration-item${oa.on ? ' enabled' : ''}${oa.disabled ? ' uc-disabled' : ''}" data-boa-row>
|
|
798
|
+
<div class="cc-integration-info">
|
|
799
|
+
<div class="cc-integration-label" id="boa-label">${kit.L('BRW087')}</div>
|
|
800
|
+
<div class="cc-integration-path" id="boa-help">${kit.H('BRW087')}</div>
|
|
801
|
+
<div class="uc-layer-notes" id="boa-notes" data-stg-data>${userContextNotesHTML(oaNotes)}</div>
|
|
802
|
+
</div>
|
|
803
|
+
<button type="button" class="cc-toggle${oa.on ? ' on' : ''}" id="boa-toggle" data-boa-toggle ${kit.inv('BRW087')} aria-pressed="${oa.on ? 'true' : 'false'}" aria-labelledby="boa-label" aria-describedby="boa-help boa-notes"${oa.disabled ? ' disabled' : ''}></button>
|
|
804
|
+
</div>
|
|
805
|
+
</div>
|
|
806
|
+
<div class="stg-help uc-save-status" id="boa-save-status" role="alert" data-stg-data hidden></div>
|
|
807
|
+
<div class="stg-help" id="boa-applies">${kit.esc(oa.applies)}</div>`;
|
|
786
808
|
const PERMISSIONS = [
|
|
787
809
|
['BRW050', 'geolocation'], ['BRW051', 'midi'], ['BRW052', 'midi-sysex'], ['BRW053', 'notifications'], ['BRW054', 'camera'],
|
|
788
810
|
['BRW055', 'microphone'], ['BRW056', 'background-sync'], ['BRW057', 'ambient-light-sensor'], ['BRW058', 'accelerometer'],
|
|
@@ -876,6 +898,12 @@ function buildBrowserTab() {
|
|
|
876
898
|
${tog('BRW020', 'bc-stealthFingerprint', true)}`,
|
|
877
899
|
})}
|
|
878
900
|
|
|
901
|
+
${kit.card({
|
|
902
|
+
id: 'bcg-owner-access', section: 'browser.automation_browser_owner_access',
|
|
903
|
+
body: `
|
|
904
|
+
${ownerAccessBlock}`,
|
|
905
|
+
})}
|
|
906
|
+
|
|
879
907
|
${kit.card({
|
|
880
908
|
id: 'bcg-identity', section: 'browser.identity_privacy', collapsible: true, collapsed: true, advanced: true,
|
|
881
909
|
body: `
|
|
@@ -2528,10 +2556,17 @@ function buildMoreLoginTab() {
|
|
|
2528
2556
|
${kit.field('ML004', `
|
|
2529
2557
|
<div class="settings-key-row">
|
|
2530
2558
|
${text('ml-new-name', { ph: m('ph.newName') })}
|
|
2559
|
+
<span id="ml-create-where-slot" ${kit.inv('ML020')} title="${kit.H('ML020')}"></span>
|
|
2531
2560
|
${btn('ML005', 'ml-create-btn')}
|
|
2532
2561
|
${btn('ML006', 'ml-refresh-btn')}
|
|
2533
2562
|
</div>`, { forId: 'ml-new-name' })}
|
|
2534
|
-
<div id="ml-
|
|
2563
|
+
<div class="stg-help" id="ml-local-intro" style="margin:0 0 10px">${m('local.intro')}</div>
|
|
2564
|
+
<div class="stg-help" id="ml-create-note" role="status" hidden style="margin:0 0 10px;color:var(--stg-warn)"></div>
|
|
2565
|
+
<div class="stg-help" id="ml-local-restart" role="status" hidden style="margin:0 0 10px;color:var(--stg-warn)">${m('local.restartServer')}</div>
|
|
2566
|
+
<div class="stg-help" id="ml-agents-help" style="margin:0 0 10px">${m('agentsMayChooseHelp')}</div>
|
|
2567
|
+
<div class="stg-help" id="ml-agents-warning" role="note" style="margin:0 0 10px;color:var(--stg-warn)">${m('agentsMayChooseWarning')}</div>
|
|
2568
|
+
<div class="stg-help" id="ml-agents-restart" role="status" hidden style="margin:0 0 10px;color:var(--stg-warn)">${m('agentsMayChooseRestart')}</div>
|
|
2569
|
+
<div id="ml-profile-list" ${kit.inv('ML016')} role="group" aria-label="${kit.L('ML016')}" aria-describedby="ml-agents-help ml-agents-warning" style="display:flex;flex-direction:column;gap:6px"></div>`,
|
|
2535
2570
|
})}
|
|
2536
2571
|
|
|
2537
2572
|
${kit.card({
|
|
@@ -2566,10 +2601,46 @@ function buildMoreLoginTab() {
|
|
|
2566
2601
|
</div>`;
|
|
2567
2602
|
}
|
|
2568
2603
|
|
|
2569
|
-
function wireMoreLoginTab(overlay) {
|
|
2604
|
+
function wireMoreLoginTab(overlay, signal) {
|
|
2570
2605
|
const $ = (id) => overlay.querySelector('#' + id);
|
|
2571
2606
|
if (!$('ml-status-dot')) return;
|
|
2572
2607
|
let _defaultEnvId = null;
|
|
2608
|
+
// Local profiles (SynaBun's own Chrome on this computer, lib/local-profiles.js): listed with MoreLogin's
|
|
2609
|
+
// (`kind: 'local'`), created by the "Where" popup's Local choice, and edited in a panel under their row.
|
|
2610
|
+
const lp = (key, params) => kit.tx(`settings.redesign.morelogin.local.${key}`, params);
|
|
2611
|
+
let _status = null; // the last GET /api/morelogin/status
|
|
2612
|
+
let _localKnown = false; // the running server knows local profiles
|
|
2613
|
+
let _localDetails = new Map(); // id → the editor's row (GET /api/morelogin/local-profiles)
|
|
2614
|
+
let _editing = null; // the id whose editor is open
|
|
2615
|
+
let _whereTouched = false; // the owner chose "Where" by hand
|
|
2616
|
+
let _limitHit = false; // MoreLogin refused a create for its plan's limit
|
|
2617
|
+
let _moreloginError = ''; // why MoreLogin's own profiles are missing from the list
|
|
2618
|
+
const jsend = (method, u, body) => fetch(u, { method, headers: { 'Content-Type': 'application/json' }, ...(body !== undefined ? { body: JSON.stringify(body) } : {}) })
|
|
2619
|
+
.then(r => r.json()).catch(() => ({ ok: false, error: kit.tx('settings.redesign.morelogin.networkError') }));
|
|
2620
|
+
// "Where" is drawn here, after the panel's older per-element dropdown wiring ran (wireStgDropdowns): the pane's
|
|
2621
|
+
// dropdowns are driven by cc-dropdown.js alone, as the ones drawn later (the editor's proxy type) are.
|
|
2622
|
+
{ const slot = $('ml-create-where-slot'); if (slot) slot.innerHTML = dropdownHTML('ml-create-where', [
|
|
2623
|
+
{ value: 'local', label: kit.tx('settings.redesign.morelogin.local.whereLocal') },
|
|
2624
|
+
{ value: 'morelogin', label: kit.tx('settings.redesign.morelogin.local.whereMoreLogin'), selected: true },
|
|
2625
|
+
], { classes: 'stg-dropdown', label: kit.tx('settings.redesign.control.ml020.label') }); }
|
|
2626
|
+
{ const card = $('stg-sec-ml-profiles'); if (card) wireDropdowns(card, { signal }); }
|
|
2627
|
+
$('ml-create-where')?.addEventListener('change', () => { _whereTouched = true; });
|
|
2628
|
+
// "Where" follows what MoreLogin can do until the owner picks: Local while MoreLogin is closed, refusing or full.
|
|
2629
|
+
function syncCreateWhere() {
|
|
2630
|
+
const where = $('ml-create-where');
|
|
2631
|
+
if (!where) return;
|
|
2632
|
+
// A server from before local profiles cannot make one: Local cannot be chosen there (settings-local-profiles.js
|
|
2633
|
+
// whereOptions), and Create never turns a Local choice into a MoreLogin profile (createAction).
|
|
2634
|
+
const dd = where.nextElementSibling;
|
|
2635
|
+
for (const option of whereOptions({ localKnown: _localKnown })) {
|
|
2636
|
+
const item = dd?.querySelector(`.cc-dropdown-item[data-value="${option.value}"]`);
|
|
2637
|
+
if (!item) continue;
|
|
2638
|
+
if (option.disabled) item.setAttribute('aria-disabled', 'true'); else item.removeAttribute('aria-disabled');
|
|
2639
|
+
}
|
|
2640
|
+
if (!_localKnown) { setDropdownValue(where, 'morelogin'); return; }
|
|
2641
|
+
if (_whereTouched && !_limitHit) return;
|
|
2642
|
+
setDropdownValue(where, defaultCreateWhere(_status, { limitHit: _limitHit }));
|
|
2643
|
+
}
|
|
2573
2644
|
const okBg = 'rgba(76,175,80,0.12)', errBg = 'rgba(244,67,54,0.12)';
|
|
2574
2645
|
|
|
2575
2646
|
// The answer's HTTP status rides along (`_status`): a refusal of the owner's access is told apart from a MoreLogin error.
|
|
@@ -2585,24 +2656,66 @@ function wireMoreLoginTab(overlay) {
|
|
|
2585
2656
|
const hint = $('ml-path-hint');
|
|
2586
2657
|
if (hint) hint.hidden = !!(s.installed && s.running);
|
|
2587
2658
|
_defaultEnvId = s.defaultEnvId || null;
|
|
2659
|
+
_status = s;
|
|
2588
2660
|
const ds = $('ml-default-status');
|
|
2589
2661
|
if (ds) ds.textContent = (s.isDefault && s.defaultEnvId) ? kit.tx('settings.redesign.morelogin.defaultAiBrowserSet') : kit.tx('settings.redesign.morelogin.noDefaultSet');
|
|
2590
2662
|
}
|
|
2591
2663
|
|
|
2592
|
-
|
|
2664
|
+
// `agentProfiles`: the owner's list of profiles agents may choose (GET /api/morelogin/profiles). A server from
|
|
2665
|
+
// before that list sends none: the switches are then left out and the pane says a restart is missing.
|
|
2666
|
+
function renderProfiles(envs, agentProfiles) {
|
|
2593
2667
|
const list = $('ml-profile-list');
|
|
2594
2668
|
if (!list) return;
|
|
2595
|
-
|
|
2596
|
-
|
|
2669
|
+
// The open editor's typed values outlive a redraw of the list (a Start, a switch, the quiet ask again).
|
|
2670
|
+
const keep = _editing && list.querySelector('#ml-local-editor') ? collectEditor() : null;
|
|
2671
|
+
// MoreLogin closed or refusing while local profiles exist: its own profiles are missing from the list, and why.
|
|
2672
|
+
const missing = _moreloginError ? `<div class="settings-hint" id="ml-morelogin-missing" role="status">${escapeHtml(lp('moreloginMissing', { error: String(_moreloginError) }))}</div>` : '';
|
|
2673
|
+
const listKnown = Array.isArray(agentProfiles);
|
|
2674
|
+
const allowed = new Set((listKnown ? agentProfiles : []).map(row => String(row && row.envId)));
|
|
2675
|
+
const restart = $('ml-agents-restart');
|
|
2676
|
+
if (restart) restart.hidden = listKnown;
|
|
2677
|
+
if (!envs || !envs.length) { _editing = null; list.innerHTML = missing + '<div class="settings-hint">' + kit.te('settings.redesign.morelogin.noProfilesCreateOneAboveOr') + '</div>'; return; }
|
|
2678
|
+
list.innerHTML = missing + envs.map(e => {
|
|
2597
2679
|
const id = escapeHtml(String(e.id));
|
|
2598
2680
|
const isDefault = String(e.id) === String(_defaultEnvId);
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2681
|
+
// SynaBun drives a profile over CDP: a Firefox-type one (`browser` from the server; absent = not known) cannot
|
|
2682
|
+
// be the AI browser, so "Use as default" is not offered for it. Start and Stop stay for either kind.
|
|
2683
|
+
const firefox = e.browser === 'firefox';
|
|
2684
|
+
const firefoxNote = `<span class="ml-firefox-note" data-ml-firefox="${id}" title="${kit.te('settings.redesign.morelogin.firefoxNotUsableHelp')}" style="font-size:11px;color:var(${isDefault ? '--stg-warn' : '--t-muted'})">${kit.te(isDefault ? 'settings.redesign.morelogin.firefoxDefault' : 'settings.redesign.morelogin.firefoxNotUsable')}</span>`;
|
|
2685
|
+
// A local profile says so, with its state and its proxy, and has Edit and Delete of its own.
|
|
2686
|
+
const local = isLocalProfile(e);
|
|
2687
|
+
const detail = local ? (_localDetails.get(String(e.id)) || e) : null;
|
|
2688
|
+
const proxyText = local ? proxySummary(detail, lp('proxyLogin')) : '';
|
|
2689
|
+
const localInfo = local
|
|
2690
|
+
? ` <span class="ml-local-tag" style="font-size:11px;color:var(--t-muted);border:1px solid var(--s-medium);padding:1px 5px">${escapeHtml(lp('tag'))}</span>`
|
|
2691
|
+
+ ` <span style="color:var(--t-muted);font-size:11px">(${escapeHtml(lp(e.status === 'running' ? 'running' : 'stopped'))}) · ${escapeHtml(proxyText || lp('noProxy'))}</span>`
|
|
2692
|
+
+ (e.restartNeeded ? ` <span class="ml-local-restart" role="status" style="font-size:11px;color:var(--stg-warn)">${escapeHtml(lp('restartNeeded'))}</span>` : '')
|
|
2693
|
+
: '';
|
|
2694
|
+
const localButtons = local ? `
|
|
2695
|
+
<button type="button" class="conn-add-btn ml-edit" data-env-id="${id}" ${kit.inv('ML021')} title="${kit.H('ML021')}" style="margin:0;width:auto;padding:3px 8px">${kit.L('ML021')}</button>
|
|
2696
|
+
<button type="button" class="conn-add-btn ml-delete" data-env-id="${id}" data-env-name="${escapeHtml(String(e.name ?? e.id))}" ${kit.inv('ML022')} title="${kit.H('ML022')}" style="margin:0;width:auto;padding:3px 8px">${kit.L('ML022')}</button>` : '';
|
|
2697
|
+
return `<div data-ml-row="${id}"${local ? ' data-ml-kind="local"' : ''} style="display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:8px 10px;border:1px solid ${isDefault ? 'var(--accent)' : 'var(--s-medium)'};border-radius:8px;background:var(--s-darker)">
|
|
2698
|
+
<span style="flex:1;min-width:140px;font-size:12.5px">${escapeHtml(e.name)}${local ? localInfo : (e.status ? ` <span style="color:var(--t-muted);font-size:11px">(${escapeHtml(String(e.status))})</span>` : '')}</span>
|
|
2699
|
+
${listKnown && !firefox ? `<span class="ml-agents" style="display:inline-flex;align-items:center;gap:6px;font-size:11px;color:var(--t-muted)"><span aria-hidden="true">${kit.te('settings.redesign.morelogin.agentsMayChoose')}</span>${kit.switchInput(`ml-agents-${id}`, { checked: allowed.has(String(e.id)), className: 'ml-agents-toggle', described: false, attrs: `data-env-id="${id}" data-env-name="${escapeHtml(String(e.name ?? e.id))}" aria-label="${escapeHtml(kit.tx('settings.redesign.morelogin.agentsMayChooseAria', { name: String(e.name ?? e.id) }))}" aria-describedby="ml-agents-help"` })}</span>` : ''}
|
|
2700
|
+
${firefox ? firefoxNote : (isDefault ? '<span style="font-size:11px;color:var(--accent)">' + kit.te('settings.redesign.morelogin.default') + '</span>' : `<button type="button" class="conn-add-btn ml-use" data-env-id="${id}" ${kit.inv('ML019')} title="${kit.H('ML019')}" style="margin:0;width:auto;padding:3px 8px">${kit.L('ML019')}</button>`)}
|
|
2602
2701
|
<button type="button" class="conn-add-btn ml-start" data-env-id="${id}" ${kit.inv('ML017')} title="${kit.H('ML017')}" style="margin:0;width:auto;padding:3px 8px">${kit.L('ML017')}</button>
|
|
2603
|
-
<button type="button" class="conn-add-btn ml-stop" data-env-id="${id}" ${kit.inv('ML018')} title="${kit.H('ML018')}" style="margin:0;width:auto;padding:3px 8px">${kit.L('ML018')}</button
|
|
2702
|
+
<button type="button" class="conn-add-btn ml-stop" data-env-id="${id}" ${kit.inv('ML018')} title="${kit.H('ML018')}" style="margin:0;width:auto;padding:3px 8px">${kit.L('ML018')}</button>${localButtons}
|
|
2604
2703
|
</div>`;
|
|
2605
2704
|
}).join('');
|
|
2705
|
+
if (_editing && !envs.some(e => String(e.id) === _editing && isLocalProfile(e))) _editing = null;
|
|
2706
|
+
if (_editing) openEditor(_editing, keep);
|
|
2707
|
+
// One profile per request (PUT /api/morelogin/agent-profiles, the owner's page only). A refused or failed change
|
|
2708
|
+
// puts the switch back, so it never shows what the server does not hold.
|
|
2709
|
+
list.querySelectorAll('.ml-agents-toggle').forEach(box => box.addEventListener('change', async () => {
|
|
2710
|
+
const want = box.checked;
|
|
2711
|
+
const name = box.dataset.envName || box.dataset.envId;
|
|
2712
|
+
box.disabled = true;
|
|
2713
|
+
const r = await fetch('/api/morelogin/agent-profiles', { method: 'PUT', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ envId: box.dataset.envId, name, allowed: want }) })
|
|
2714
|
+
.then(x => x.json()).catch(() => ({ ok: false, error: kit.tx('settings.redesign.morelogin.networkError') }));
|
|
2715
|
+
box.disabled = false;
|
|
2716
|
+
if (r && r.ok) showCCToast(kit.tx(want ? 'settings.redesign.morelogin.agentsMayChooseOn' : 'settings.redesign.morelogin.agentsMayChooseOff', { name }));
|
|
2717
|
+
else { box.checked = !want; showCCToast(kit.tx('settings.redesign.morelogin.agentsMayChooseFailed', { error: (r && r.error) || kit.tx('settings.redesign.morelogin.failed') })); }
|
|
2718
|
+
}));
|
|
2606
2719
|
list.querySelectorAll('.ml-use').forEach(b => b.addEventListener('click', async () => {
|
|
2607
2720
|
const r = await jpost('/api/morelogin/use-default', { envId: b.dataset.envId });
|
|
2608
2721
|
showCCToast(r.ok ? kit.tx('settings.redesign.morelogin.moreloginSetAsDefaultAiBrowser') : (r.error || kit.tx('settings.redesign.morelogin.failed')));
|
|
@@ -2618,6 +2731,153 @@ function wireMoreLoginTab(overlay) {
|
|
|
2618
2731
|
await jpost('/api/morelogin/stop', { envId: b.dataset.envId });
|
|
2619
2732
|
reload();
|
|
2620
2733
|
}));
|
|
2734
|
+
list.querySelectorAll('.ml-edit').forEach(b => b.addEventListener('click', () => {
|
|
2735
|
+
if (_editing === b.dataset.envId) { closeEditor(); return; }
|
|
2736
|
+
openEditor(b.dataset.envId);
|
|
2737
|
+
}));
|
|
2738
|
+
list.querySelectorAll('.ml-delete').forEach(b => b.addEventListener('click', async () => {
|
|
2739
|
+
const name = b.dataset.envName || b.dataset.envId;
|
|
2740
|
+
if (!confirm(lp('deleteConfirm', { name }))) return;
|
|
2741
|
+
b.disabled = true;
|
|
2742
|
+
const r = await jsend('DELETE', `/api/morelogin/local-profiles/${encodeURIComponent(b.dataset.envId)}`);
|
|
2743
|
+
b.disabled = false;
|
|
2744
|
+
if (r && r.ok) { if (_editing === b.dataset.envId) _editing = null; showCCToast(lp('deleted', { name })); }
|
|
2745
|
+
else showCCToast(lp('deleteFailed', { error: (r && r.error) || kit.tx('settings.redesign.morelogin.failed') }));
|
|
2746
|
+
reload();
|
|
2747
|
+
}));
|
|
2748
|
+
}
|
|
2749
|
+
|
|
2750
|
+
// ── The editor of a local profile: a panel under its row ──
|
|
2751
|
+
const editorField = (name) => overlay.querySelector(`#ml-local-editor [data-lp-field="${name}"]`);
|
|
2752
|
+
/** The editor's fields as typed (settings-local-profiles.js readLocalProfileForm takes them). */
|
|
2753
|
+
function collectEditor() {
|
|
2754
|
+
const value = (name) => editorField(name)?.value ?? '';
|
|
2755
|
+
return {
|
|
2756
|
+
name: value('name'), proxyType: $('ml-lp-proxy-type')?.value || 'none', host: value('host'), port: value('port'), username: value('username'),
|
|
2757
|
+
password: value('password'), passwordTouched: editorField('password')?.dataset.touched === '1', hasPassword: editorField('password')?.dataset.saved === '1',
|
|
2758
|
+
language: value('language'), timezone: value('timezone'), width: value('width'), height: value('height'), notes: value('notes'),
|
|
2759
|
+
};
|
|
2760
|
+
}
|
|
2761
|
+
function closeEditor() {
|
|
2762
|
+
_editing = null;
|
|
2763
|
+
overlay.querySelector('#ml-local-editor')?.remove();
|
|
2764
|
+
}
|
|
2765
|
+
function editorStatus(message, warn = false) {
|
|
2766
|
+
const line = overlay.querySelector('#ml-lp-status');
|
|
2767
|
+
if (!line) return;
|
|
2768
|
+
line.hidden = !message;
|
|
2769
|
+
line.textContent = message || '';
|
|
2770
|
+
line.style.color = warn ? 'var(--stg-warn)' : '';
|
|
2771
|
+
}
|
|
2772
|
+
/** Draws the editor under the profile's row. `values`: what was typed before a redraw, else the saved settings. */
|
|
2773
|
+
function openEditor(id, values = null) {
|
|
2774
|
+
const row = [...overlay.querySelectorAll('#ml-profile-list [data-ml-row]')].find(el => el.dataset.mlRow === id);
|
|
2775
|
+
const detail = _localDetails.get(id);
|
|
2776
|
+
if (!row || !detail) return;
|
|
2777
|
+
overlay.querySelector('#ml-local-editor')?.remove();
|
|
2778
|
+
_editing = id;
|
|
2779
|
+
const v = values || formOfProfile(detail);
|
|
2780
|
+
const input = (name, invId, { ph = '', type = 'text', width = '' } = {}) =>
|
|
2781
|
+
`<input type="${type}" id="ml-lp-${name}" data-lp-field="${name}" ${kit.inv(invId)} value="${escapeHtml(String(v[name] ?? ''))}"${ph ? ` placeholder="${escapeHtml(ph)}"` : ''}${width ? ` style="max-width:${width}"` : ''} autocomplete="off" spellcheck="false" aria-describedby="ml-lp-${name}-help">`;
|
|
2782
|
+
const fieldRow = (invId, name, control) => kit.field(invId, `<div class="settings-key-row">${control}</div>`, { forId: `ml-lp-${name}` });
|
|
2783
|
+
const proxyTypes = PROXY_TYPES.map(type => ({ value: type, label: lp(`proxyType.${type}`), selected: type === v.proxyType }));
|
|
2784
|
+
const panel = document.createElement('div');
|
|
2785
|
+
panel.id = 'ml-local-editor';
|
|
2786
|
+
panel.dataset.envId = id;
|
|
2787
|
+
panel.setAttribute('role', 'group');
|
|
2788
|
+
panel.setAttribute('aria-label', lp('editorTitle', { name: detail.name }));
|
|
2789
|
+
panel.style.cssText = 'padding:12px;border:1px solid var(--s-medium);border-radius:8px;background:var(--s-darker)';
|
|
2790
|
+
panel.innerHTML = `
|
|
2791
|
+
${fieldRow('ML023', 'name', input('name', 'ML023'))}
|
|
2792
|
+
${kit.field('ML024', dropdownHTML('ml-lp-proxy-type', proxyTypes, { classes: 'stg-dropdown', label: kit.tx('settings.redesign.control.ml024.label') }))}
|
|
2793
|
+
<div id="ml-lp-proxy-fields"${v.proxyType === 'none' ? ' hidden' : ''}>
|
|
2794
|
+
${fieldRow('ML025', 'host', input('host', 'ML025', { ph: lp('ph.host') }))}
|
|
2795
|
+
${fieldRow('ML026', 'port', input('port', 'ML026', { ph: lp('ph.port'), width: '120px' }))}
|
|
2796
|
+
${fieldRow('ML027', 'username', input('username', 'ML027'))}
|
|
2797
|
+
${fieldRow('ML028', 'password', `${input('password', 'ML028', { type: 'password', ph: v.hasPassword ? lp('passwordKept') : '' })}
|
|
2798
|
+
<button type="button" class="stg-action-btn compact" id="ml-lp-password-eye" ${kit.inv('ML029')} aria-label="${kit.L('ML029')}" title="${kit.L('ML029')}">${eyeClosed}</button>`)}
|
|
2799
|
+
<div class="stg-field" ${kit.inv('ML030')}>
|
|
2800
|
+
<div class="stg-action-row">
|
|
2801
|
+
<button type="button" class="stg-action-btn compact" id="ml-lp-check" aria-describedby="ml-lp-check-help">${kit.L('ML030')}</button>
|
|
2802
|
+
<span class="stg-help" id="ml-lp-check-result" role="status" aria-live="polite"></span>
|
|
2803
|
+
</div>
|
|
2804
|
+
${kit.help('ML030', { forId: 'ml-lp-check' })}
|
|
2805
|
+
</div>
|
|
2806
|
+
</div>
|
|
2807
|
+
${fieldRow('ML031', 'language', input('language', 'ML031', { ph: lp('ph.language'), width: '160px' }))}
|
|
2808
|
+
${fieldRow('ML032', 'timezone', input('timezone', 'ML032', { ph: lp('ph.timezone'), width: '260px' }))}
|
|
2809
|
+
${kit.field('ML033', `<div class="settings-key-row">
|
|
2810
|
+
${input('width', 'ML033', { ph: '1280', width: '90px' })}
|
|
2811
|
+
<span aria-hidden="true" style="color:var(--t-muted)">×</span>
|
|
2812
|
+
<input type="text" id="ml-lp-height" data-lp-field="height" value="${escapeHtml(String(v.height ?? ''))}" placeholder="800" style="max-width:90px" autocomplete="off" spellcheck="false" aria-label="${escapeHtml(lp('windowHeight'))}">
|
|
2813
|
+
</div>`, { forId: 'ml-lp-width' })}
|
|
2814
|
+
${fieldRow('ML034', 'notes', input('notes', 'ML034'))}
|
|
2815
|
+
<div class="stg-help" id="ml-lp-restart" role="status"${detail.status === 'running' ? '' : ' hidden'} style="margin:0 0 10px;color:var(--stg-warn)">${escapeHtml(lp('restartNeeded'))}</div>
|
|
2816
|
+
<div class="stg-action-row">
|
|
2817
|
+
<button type="button" class="stg-action-btn compact" id="ml-lp-save" ${kit.inv('ML035')} title="${kit.H('ML035')}">${kit.L('ML035')}</button>
|
|
2818
|
+
<button type="button" class="stg-action-btn compact" id="ml-lp-cancel" ${kit.inv('ML036')} title="${kit.H('ML036')}">${kit.L('ML036')}</button>
|
|
2819
|
+
<span class="stg-help" id="ml-lp-status" role="status" aria-live="polite" hidden></span>
|
|
2820
|
+
</div>`;
|
|
2821
|
+
row.after(panel);
|
|
2822
|
+
const password = editorField('password');
|
|
2823
|
+
if (password) {
|
|
2824
|
+
password.dataset.saved = v.hasPassword ? '1' : '0';
|
|
2825
|
+
if (v.passwordTouched) password.dataset.touched = '1';
|
|
2826
|
+
password.addEventListener('input', () => { password.dataset.touched = '1'; syncPasswordAsk(); });
|
|
2827
|
+
}
|
|
2828
|
+
// The saved password belongs to the saved proxy and login: once one of them is changed here, the field asks for
|
|
2829
|
+
// the password again (the server drops the saved one then, lib/local-profiles.js normalizeProxy).
|
|
2830
|
+
function syncPasswordAsk() {
|
|
2831
|
+
if (!password) return false;
|
|
2832
|
+
const again = passwordNeededAgain(collectEditor(), detail);
|
|
2833
|
+
password.placeholder = again ? lp('passwordAgain') : (v.hasPassword ? lp('passwordKept') : '');
|
|
2834
|
+
if (again) password.setAttribute('aria-invalid', 'true'); else password.removeAttribute('aria-invalid');
|
|
2835
|
+
return again;
|
|
2836
|
+
}
|
|
2837
|
+
for (const name of ['host', 'port', 'username']) editorField(name)?.addEventListener('input', syncPasswordAsk);
|
|
2838
|
+
panel.querySelector('#ml-lp-proxy-type')?.addEventListener('change', syncPasswordAsk);
|
|
2839
|
+
syncPasswordAsk();
|
|
2840
|
+
panel.querySelector('#ml-lp-proxy-type')?.addEventListener('change', (event) => {
|
|
2841
|
+
const fields = panel.querySelector('#ml-lp-proxy-fields');
|
|
2842
|
+
if (fields) fields.hidden = event.target.value === 'none';
|
|
2843
|
+
});
|
|
2844
|
+
panel.querySelector('#ml-lp-password-eye')?.addEventListener('click', () => { if (password) password.type = password.type === 'password' ? 'text' : 'password'; });
|
|
2845
|
+
panel.querySelector('#ml-lp-cancel')?.addEventListener('click', closeEditor);
|
|
2846
|
+
panel.querySelector('#ml-lp-check')?.addEventListener('click', async (event) => {
|
|
2847
|
+
const button = event.currentTarget;
|
|
2848
|
+
const result = panel.querySelector('#ml-lp-check-result');
|
|
2849
|
+
const typed = collectEditor();
|
|
2850
|
+
const proxy = proxyOfForm(typed);
|
|
2851
|
+
if (!proxy) { if (result) { result.textContent = lp('invalid.host'); result.style.color = 'var(--stg-warn)'; } return; }
|
|
2852
|
+
if (syncPasswordAsk()) { if (result) { result.textContent = lp('passwordAgain'); result.style.color = 'var(--stg-warn)'; } password?.focus(); return; }
|
|
2853
|
+
button.disabled = true;
|
|
2854
|
+
if (result) { result.textContent = lp('checking'); result.style.color = ''; }
|
|
2855
|
+
const r = await jsend('POST', `/api/morelogin/local-profiles/${encodeURIComponent(id)}/check-proxy`, { proxy });
|
|
2856
|
+
button.disabled = false;
|
|
2857
|
+
if (!result || !result.isConnected) return;
|
|
2858
|
+
result.style.color = r && r.ok ? '' : 'var(--stg-warn)';
|
|
2859
|
+
result.textContent = r && r.ok
|
|
2860
|
+
? (r.via === 'direct' ? lp('checkDirect', { ip: r.ip }) : lp('checkOk', { ip: r.ip, via: String(r.via).toUpperCase(), ms: r.ms }))
|
|
2861
|
+
: lp('checkFailed', { error: (r && r.error) || kit.tx('settings.redesign.morelogin.failed') });
|
|
2862
|
+
});
|
|
2863
|
+
panel.querySelector('#ml-lp-save')?.addEventListener('click', async (event) => {
|
|
2864
|
+
const button = event.currentTarget;
|
|
2865
|
+
const read = readLocalProfileForm(collectEditor());
|
|
2866
|
+
if (!read.ok) {
|
|
2867
|
+
const first = Object.keys(read.errors)[0];
|
|
2868
|
+
editorStatus(lp(`invalid.${read.errors[first]}`), true);
|
|
2869
|
+
(editorField(first === 'window' ? 'width' : first) || panel).focus?.();
|
|
2870
|
+
return;
|
|
2871
|
+
}
|
|
2872
|
+
if (syncPasswordAsk()) { editorStatus(lp('passwordAgain'), true); password?.focus(); return; }
|
|
2873
|
+
button.disabled = true;
|
|
2874
|
+
const r = await jsend('PUT', `/api/morelogin/local-profiles/${encodeURIComponent(id)}`, read.body);
|
|
2875
|
+
button.disabled = false;
|
|
2876
|
+
if (!r || !r.ok) { editorStatus(lp('saveFailed', { error: (r && r.error) || kit.tx('settings.redesign.morelogin.failed') }), true); return; }
|
|
2877
|
+
showCCToast(lp(r.restartNeeded ? 'savedRestart' : 'saved'));
|
|
2878
|
+
closeEditor();
|
|
2879
|
+
reload();
|
|
2880
|
+
});
|
|
2621
2881
|
}
|
|
2622
2882
|
|
|
2623
2883
|
async function reload() {
|
|
@@ -2636,13 +2896,32 @@ function wireMoreLoginTab(overlay) {
|
|
|
2636
2896
|
if ($('ml-api-id') && !$('ml-api-id').value) $('ml-api-id').value = cfg.config.apiId || '';
|
|
2637
2897
|
}
|
|
2638
2898
|
const p = await jget('/api/morelogin/profiles');
|
|
2899
|
+
// `local`: the running server knows local profiles. One from before them cannot create one: said, not hidden.
|
|
2900
|
+
_localKnown = !!p && typeof p.local === 'object' && p.local !== null;
|
|
2901
|
+
{ const note = $('ml-local-restart'); if (note) note.hidden = _localKnown || p._status === 403; }
|
|
2902
|
+
syncCreateWhere();
|
|
2639
2903
|
if (p.ok === false && p.error) {
|
|
2640
2904
|
const list = $('ml-profile-list');
|
|
2905
|
+
_editing = null;
|
|
2641
2906
|
if (list) list.innerHTML = '<div class="settings-hint" role="status">' + escapeHtml(String(p.error)) + '</div>';
|
|
2642
2907
|
return;
|
|
2643
2908
|
}
|
|
2644
|
-
|
|
2909
|
+
// What the editor and the rows show of each local profile (never its proxy password).
|
|
2910
|
+
if ((p.envs || []).some(isLocalProfile)) {
|
|
2911
|
+
const d = await jget('/api/morelogin/local-profiles');
|
|
2912
|
+
if (d && d.ok && Array.isArray(d.profiles)) _localDetails = new Map(d.profiles.map(row => [String(row.id), row]));
|
|
2913
|
+
} else _localDetails = new Map();
|
|
2914
|
+
_moreloginError = p.moreloginError || '';
|
|
2915
|
+
renderProfiles(p.envs || [], p.agentProfiles);
|
|
2916
|
+
// The server is still asking MoreLogin which browser some profiles run: ask again quietly, a few times.
|
|
2917
|
+
clearTimeout(_browsersTimer);
|
|
2918
|
+
if (Number(p.browsersPending) > 0 && _browsersTries < 8 && $('ml-profile-list')?.isConnected) {
|
|
2919
|
+
_browsersTries += 1;
|
|
2920
|
+
_browsersTimer = setTimeout(reload, 2500);
|
|
2921
|
+
} else _browsersTries = 0;
|
|
2645
2922
|
}
|
|
2923
|
+
let _browsersTimer = null;
|
|
2924
|
+
let _browsersTries = 0;
|
|
2646
2925
|
|
|
2647
2926
|
const saveCfg = (key, value) => fetch('/api/morelogin/config', { method: 'PUT', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ key, value }) });
|
|
2648
2927
|
|
|
@@ -2651,9 +2930,49 @@ function wireMoreLoginTab(overlay) {
|
|
|
2651
2930
|
$('ml-secret-save')?.addEventListener('click', async () => { await saveCfg('secret', $('ml-secret').value || ''); showCCToast(kit.tx('settings.redesign.morelogin.secretSaved')); });
|
|
2652
2931
|
$('ml-secret-eye')?.addEventListener('click', () => { const i = $('ml-secret'); if (i) i.type = i.type === 'password' ? 'text' : 'password'; });
|
|
2653
2932
|
$('ml-refresh-btn')?.addEventListener('click', reload);
|
|
2933
|
+
/** A new local profile under `name`; its editor opens, since a name is all it has yet. */
|
|
2934
|
+
async function createLocal(name) {
|
|
2935
|
+
const r = await jsend('POST', '/api/morelogin/local-profiles', { name: name || lp('defaultName', { n: _localDetails.size + 1 }) });
|
|
2936
|
+
if (!r || !r.ok) { showCCToast(lp('createFailed', { error: (r && r.error) || kit.tx('settings.redesign.morelogin.createFailed') })); return false; }
|
|
2937
|
+
showCCToast(lp('created'));
|
|
2938
|
+
_editing = String(r.profile.id);
|
|
2939
|
+
if ($('ml-new-name')) $('ml-new-name').value = '';
|
|
2940
|
+
const note = $('ml-create-note'); if (note) { note.hidden = true; note.textContent = ''; }
|
|
2941
|
+
await reload();
|
|
2942
|
+
overlay.querySelector('#ml-local-editor [data-lp-field="name"]')?.focus();
|
|
2943
|
+
return true;
|
|
2944
|
+
}
|
|
2654
2945
|
$('ml-create-btn')?.addEventListener('click', async () => {
|
|
2655
|
-
const
|
|
2946
|
+
const typed = ($('ml-new-name')?.value || '').trim();
|
|
2947
|
+
const action = createAction({ where: $('ml-create-where')?.value || 'morelogin', localKnown: _localKnown });
|
|
2948
|
+
if (action === 'local') { await createLocal(typed); return; }
|
|
2949
|
+
if (action === 'restart') {
|
|
2950
|
+
// Local was asked of a server older than local profiles: nothing is created (never a MoreLogin profile, which
|
|
2951
|
+
// would take one of the plan's slots), and the restart note says why.
|
|
2952
|
+
const restart = $('ml-local-restart'); if (restart) restart.hidden = false;
|
|
2953
|
+
showCCToast(lp('restartServer'));
|
|
2954
|
+
return;
|
|
2955
|
+
}
|
|
2956
|
+
const name = typed || 'SynaBun';
|
|
2656
2957
|
const r = await jpost('/api/morelogin/profiles', { name });
|
|
2958
|
+
// MoreLogin's plan holds no more profiles: said, with the way on. A local profile needs no MoreLogin slot.
|
|
2959
|
+
if (isPlanLimit(r) && _localKnown) {
|
|
2960
|
+
_limitHit = true;
|
|
2961
|
+
syncCreateWhere();
|
|
2962
|
+
const note = $('ml-create-note');
|
|
2963
|
+
if (note) {
|
|
2964
|
+
note.hidden = false;
|
|
2965
|
+
note.textContent = `${String(r.error || lp('planLimit'))} `;
|
|
2966
|
+
const offer = document.createElement('button');
|
|
2967
|
+
offer.type = 'button';
|
|
2968
|
+
offer.className = 'stg-action-btn compact';
|
|
2969
|
+
offer.id = 'ml-create-local-offer';
|
|
2970
|
+
offer.textContent = lp('planLimitCreateLocal');
|
|
2971
|
+
offer.addEventListener('click', () => createLocal(typed));
|
|
2972
|
+
note.appendChild(offer);
|
|
2973
|
+
}
|
|
2974
|
+
return;
|
|
2975
|
+
}
|
|
2657
2976
|
showCCToast(r.ok ? kit.tx('settings.redesign.morelogin.profileCreated') : (r.error || kit.tx('settings.redesign.morelogin.createFailed')));
|
|
2658
2977
|
if ($('ml-new-name')) $('ml-new-name').value = '';
|
|
2659
2978
|
reload();
|
|
@@ -3385,6 +3704,8 @@ async function openSettingsModalNow(options = {}) {
|
|
|
3385
3704
|
let userContextReading = readUserContextResponse({ status: 0 });
|
|
3386
3705
|
// Protect workers (lib/worker-guard-setting.js): what its endpoint answered, as a reading.
|
|
3387
3706
|
let workerGuardReading = readWorkerGuardResponse({ status: 0 });
|
|
3707
|
+
// Let the automation browser act as owner (lib/automation-browser-owner-access.js): what its endpoint answered.
|
|
3708
|
+
let ownerAccessReading = readOwnerAccessResponse({ status: 0 });
|
|
3388
3709
|
// SynaBun's Claude Code hooks (lib/claude-hooks-status.js): the `claudeHooks` of the integrations read, as a reading.
|
|
3389
3710
|
let claudeHooksReading = readClaudeHooksResponse({ status: 0 });
|
|
3390
3711
|
// The reads the server refused this page (it has no owner access: SynaBun's automation browser opened it). The panes
|
|
@@ -3404,6 +3725,7 @@ async function openSettingsModalNow(options = {}) {
|
|
|
3404
3725
|
const greetRes = readingOf(reads.greeting, readGreetingStatus);
|
|
3405
3726
|
const userContextRes = readingOf(reads.userContext, readUserContextResponse);
|
|
3406
3727
|
const workerGuardRes = readingOf(reads.workerGuard, readWorkerGuardResponse);
|
|
3728
|
+
const ownerAccessRes = readingOf(reads.browserOwnerAccess, readOwnerAccessResponse);
|
|
3407
3729
|
const settingsRes = reads.settings, connRes = reads.connections, ccRes = reads.integrations, skillsRes = reads.skills;
|
|
3408
3730
|
const tunnelRes = reads.tunnel, keyRes = reads.mcpKey, bridgeRes = reads.openclaw, setupRes = reads.setup, cliRes = reads.cli;
|
|
3409
3731
|
const toolPermsRes = reads.toolPermissions, toolCatsRes = reads.toolCategories, discordRes = reads.discord, skinsRes = reads.skins;
|
|
@@ -3411,6 +3733,7 @@ async function openSettingsModalNow(options = {}) {
|
|
|
3411
3733
|
if (typesafeRes.status === 'fulfilled' && typesafeRes.value.ok) typesafeConfig = typesafeRes.value;
|
|
3412
3734
|
if (userContextRes.status === 'fulfilled') userContextReading = userContextRes.value;
|
|
3413
3735
|
if (workerGuardRes.status === 'fulfilled') workerGuardReading = workerGuardRes.value;
|
|
3736
|
+
if (ownerAccessRes.status === 'fulfilled') ownerAccessReading = ownerAccessRes.value;
|
|
3414
3737
|
if (settingsRes.status === 'fulfilled') settings = settingsRes.value;
|
|
3415
3738
|
if (connRes.status === 'fulfilled' && connRes.value.connections) connections = connRes.value.connections;
|
|
3416
3739
|
// Read as it came (status and body): a refusal or an old server is said as what it is, never as hooks that are off.
|
|
@@ -3488,7 +3811,7 @@ async function openSettingsModalNow(options = {}) {
|
|
|
3488
3811
|
terminal: buildTerminalTab(cliConfig),
|
|
3489
3812
|
opencode: buildOpencodeTab(),
|
|
3490
3813
|
notifications: buildNotificationsTab(),
|
|
3491
|
-
browser: buildBrowserTab(),
|
|
3814
|
+
browser: buildBrowserTab(describeOwnerAccess(ownerAccessReading, { tx: kit.tx })),
|
|
3492
3815
|
mcp: buildMcpTab(),
|
|
3493
3816
|
setup: buildSetupTab(setupStatus),
|
|
3494
3817
|
collections: buildCollectionsTab(connections, settings),
|
|
@@ -4051,7 +4374,18 @@ async function openSettingsModalNow(options = {}) {
|
|
|
4051
4374
|
progressText.textContent = kit.tx('settings.redesign.server.doneFilesRestored', { restoredFileCount: restoredFileCount });
|
|
4052
4375
|
confirmBtn.textContent = kit.tx('settings.redesign.server.done');
|
|
4053
4376
|
|
|
4054
|
-
|
|
4377
|
+
// A restore that built a new MCP server restarts the server: reload only once a new one answers.
|
|
4378
|
+
await reloadAfterRestore(result, {
|
|
4379
|
+
reload: () => { confirmOverlay.remove(); location.reload(); },
|
|
4380
|
+
onRestarting: () => {
|
|
4381
|
+
progressDot.className = 'wiz-status-dot spin';
|
|
4382
|
+
progressText.textContent = kit.tx('settings.redesign.server.restartingAfterRestore');
|
|
4383
|
+
},
|
|
4384
|
+
onNotBack: () => {
|
|
4385
|
+
progressDot.className = 'wiz-status-dot red';
|
|
4386
|
+
progressText.textContent = kit.tx('settings.redesign.server.serverNotBackAfterRestore');
|
|
4387
|
+
},
|
|
4388
|
+
});
|
|
4055
4389
|
} catch (err) {
|
|
4056
4390
|
progressDot.className = 'wiz-status-dot red';
|
|
4057
4391
|
progressText.textContent = err.message;
|
|
@@ -4595,7 +4929,7 @@ async function openSettingsModalNow(options = {}) {
|
|
|
4595
4929
|
});
|
|
4596
4930
|
|
|
4597
4931
|
// ── MoreLogin tab handlers (self-loads status/profiles async) ──
|
|
4598
|
-
wireMoreLoginTab(overlay);
|
|
4932
|
+
wireMoreLoginTab(overlay, panelLife.signal);
|
|
4599
4933
|
|
|
4600
4934
|
// ── Judgments tab (TypeSafe / Jev) — self-loads and polls while active ──
|
|
4601
4935
|
wireJudgmentsTab(overlay, { toast: showCCToast, initial: typesafeConfig });
|
|
@@ -5143,6 +5477,47 @@ async function openSettingsModalNow(options = {}) {
|
|
|
5143
5477
|
if (!link) return;
|
|
5144
5478
|
try { applySettingsOpenOptions(overlay, JSON.parse(link.dataset.ucGoto)); } catch { /* a malformed target goes nowhere */ }
|
|
5145
5479
|
});
|
|
5480
|
+
// Let the automation browser act as owner: the switch moves at once and follows the server's answer; a save
|
|
5481
|
+
// that failed puts it back where it was, with the reason under it (a page open in the automation browser itself
|
|
5482
|
+
// is told it may never change this: 403 WORKER_BROWSER). Saves go one after the other, in the order of the clicks.
|
|
5483
|
+
{
|
|
5484
|
+
const btn = overlay.querySelector('#boa-toggle');
|
|
5485
|
+
const row = overlay.querySelector('[data-boa-row]');
|
|
5486
|
+
const status = overlay.querySelector('#boa-save-status');
|
|
5487
|
+
const notes = overlay.querySelector('#boa-notes');
|
|
5488
|
+
const setStatus = (text) => { if (status) { status.textContent = text; status.hidden = !text; } };
|
|
5489
|
+
const paint = (on) => { if (btn) { btn.classList.toggle('on', on); btn.setAttribute('aria-pressed', on ? 'true' : 'false'); } row?.classList.toggle('enabled', on); };
|
|
5490
|
+
const show = () => {
|
|
5491
|
+
const view = describeOwnerAccess(ownerAccessReading, { tx: kit.tx });
|
|
5492
|
+
paint(view.on);
|
|
5493
|
+
if (btn) btn.disabled = view.disabled;
|
|
5494
|
+
row?.classList.toggle('uc-disabled', view.disabled);
|
|
5495
|
+
if (notes) notes.innerHTML = userContextNotesHTML([...(view.note ? [view.note] : []), ...(view.warning ? [{ text: view.warning, tone: 'warn' }] : [])]);
|
|
5496
|
+
};
|
|
5497
|
+
let saves = Promise.resolve();
|
|
5498
|
+
btn?.addEventListener('click', () => {
|
|
5499
|
+
if (ownerAccessReading.state !== 'ready') return;
|
|
5500
|
+
const enabled = !ownerAccessReading.enabled;
|
|
5501
|
+
setStatus('');
|
|
5502
|
+
paint(enabled);
|
|
5503
|
+
btn.style.opacity = '0.4';
|
|
5504
|
+
saves = saves.then(async () => {
|
|
5505
|
+
let failure = null;
|
|
5506
|
+
try {
|
|
5507
|
+
const res = await fetch('/api/assistant/automation-browser-owner-access', { method: 'PUT', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ enabled }) });
|
|
5508
|
+
const body = await res.json().catch(() => null);
|
|
5509
|
+
const reading = readOwnerAccessResponse({ status: res.status, body });
|
|
5510
|
+
if (res.ok && reading.state === 'ready') ownerAccessReading = reading;
|
|
5511
|
+
else failure = { status: res.status, body };
|
|
5512
|
+
} catch (err) {
|
|
5513
|
+
failure = { status: 0, error: err?.message };
|
|
5514
|
+
}
|
|
5515
|
+
btn.style.opacity = '';
|
|
5516
|
+
show();
|
|
5517
|
+
if (failure) setStatus(describeOwnerAccessSaveFailure({ ...failure, enabled }, { tx: kit.tx }));
|
|
5518
|
+
});
|
|
5519
|
+
});
|
|
5520
|
+
}
|
|
5146
5521
|
// Protect workers: the choice is saved at once and follows the server's answer; a save that failed puts the
|
|
5147
5522
|
// dropdown back where it was, with the reason under it. Saves go one after the other, in the order of the picks.
|
|
5148
5523
|
{
|
|
@@ -6082,7 +6457,11 @@ async function openSettingsModalNow(options = {}) {
|
|
|
6082
6457
|
|
|
6083
6458
|
// ── Connection mode (mirror / attach / MoreLogin) ──
|
|
6084
6459
|
let _moreloginDesiredEnvId = '';
|
|
6085
|
-
|
|
6460
|
+
let _moreloginBrowsersTimer = null;
|
|
6461
|
+
let _moreloginBrowsersTries = 0;
|
|
6462
|
+
// keepShown: a redraw of the list (the quiet ask again, a change of the choice) keeps what the picker shows;
|
|
6463
|
+
// without it the saved default is put back, as on open and on Refresh.
|
|
6464
|
+
async function loadMoreLoginEnvs(keepShown = false) {
|
|
6086
6465
|
const sel = overlay.querySelector('#bc-morelogin-env-id');
|
|
6087
6466
|
// A placeholder choice (loading / error / not running) keeps its reason visible in the closed dropdown.
|
|
6088
6467
|
const only = (key) => setDropdownItems(sel, [{ value: '', label: kit.tx(key), selected: true }]);
|
|
@@ -6091,12 +6470,24 @@ async function openSettingsModalNow(options = {}) {
|
|
|
6091
6470
|
try {
|
|
6092
6471
|
const r = await fetch('/api/browser/morelogin-envs');
|
|
6093
6472
|
const d = await r.json();
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6473
|
+
// SynaBun's own local profiles (`kind: 'local'`) are in every answer, whatever MoreLogin does: with one or
|
|
6474
|
+
// more, the picker lists them and the line under it says why MoreLogin's are missing.
|
|
6475
|
+
const localEnvs = (d && Array.isArray(d.envs) ? d.envs : []).filter(e => e && e.kind === 'local');
|
|
6476
|
+
let moreloginNote = '';
|
|
6477
|
+
// With a local profile to list, MoreLogin's state is a note under the picker; without one it is the picker's
|
|
6478
|
+
// only choice, as before. → true when the picker was filled with the reason (nothing more to draw).
|
|
6479
|
+
const without = (message, placeholder) => {
|
|
6480
|
+
if (localEnvs.length) { moreloginNote = message; return false; }
|
|
6481
|
+
placeholder();
|
|
6482
|
+
if (statusEl) statusEl.textContent = message;
|
|
6483
|
+
return true;
|
|
6484
|
+
};
|
|
6485
|
+
if (!d || d.ok === false) { if (without((d && d.error) || kit.tx('settings.redesign.browser.failedToLoadMoreloginProfiles'), () => only('settings.redesign.browser.error'))) return; }
|
|
6486
|
+
else if (!d.installed) { if (without(kit.tx('settings.redesign.browser.moreloginDesktopAppIsNotInstalled') + ' ' + kit.tx('settings.redesign.browser.moreloginCustomPathHint'), () => only('settings.redesign.browser.moreloginNotInstalled'))) return; }
|
|
6487
|
+
else if (!d.running) { if (without(kit.tx('settings.redesign.browser.moreloginNotRunningOpenTheApp', { port: d.port }) + (d.error ? ' ' + String(d.error) : ''), () => only('settings.redesign.browser.startMorelogin'))) return; }
|
|
6488
|
+
const envs = moreloginNote ? localEnvs : (d.envs || []);
|
|
6098
6489
|
if (!envs.length) { only('settings.redesign.browser.noProfiles'); if (statusEl) statusEl.textContent = kit.tx('settings.redesign.browser.noMoreloginProfilesYetOneIs'); return; }
|
|
6099
|
-
const want = _moreloginDesiredEnvId || sel.value || '';
|
|
6490
|
+
const want = (keepShown === true && sel.value) || _moreloginDesiredEnvId || sel.value || '';
|
|
6100
6491
|
// Show each env's proxy — without it there is no way to tell from SynaBun
|
|
6101
6492
|
// whether a profile's traffic leaves the machine.
|
|
6102
6493
|
const proxyLabel = (p) => {
|
|
@@ -6104,11 +6495,27 @@ async function openSettingsModalNow(options = {}) {
|
|
|
6104
6495
|
const where = [p.host, p.port].filter(Boolean).join(':');
|
|
6105
6496
|
return ` · ${[p.type, where, p.country].filter(Boolean).join(' ')}`;
|
|
6106
6497
|
};
|
|
6498
|
+
// SynaBun drives the profile over CDP, so a Firefox-type one (`browser` from the server; absent = not known)
|
|
6499
|
+
// is listed, said as such and cannot be picked. One already saved as the default stays shown, with a warning.
|
|
6107
6500
|
// dropdownHTML escapes the labels itself.
|
|
6108
|
-
setDropdownItems(sel, envs.map(e => (
|
|
6501
|
+
setDropdownItems(sel, envs.map(e => (e.browser === 'firefox'
|
|
6502
|
+
? { value: String(e.id), label: kit.tx('settings.redesign.browser.moreloginFirefoxOption', { name: String(e.name ?? e.id) }), disabled: true }
|
|
6503
|
+
: { 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)}` })));
|
|
6109
6504
|
if (want && envs.some(e => String(e.id) === String(want))) setDropdownValue(sel, String(want));
|
|
6505
|
+
const chosenFirefox = envs.some(e => String(e.id) === String(sel.value) && e.browser === 'firefox');
|
|
6506
|
+
if (statusEl) statusEl.style.color = chosenFirefox ? 'var(--stg-warn)' : '';
|
|
6507
|
+
// The server is still asking MoreLogin which browser some profiles run: ask again quietly, a few times.
|
|
6508
|
+
clearTimeout(_moreloginBrowsersTimer);
|
|
6509
|
+
if (Number(d.browsersPending) > 0 && _moreloginBrowsersTries < 8 && sel.isConnected) {
|
|
6510
|
+
_moreloginBrowsersTries += 1;
|
|
6511
|
+
_moreloginBrowsersTimer = setTimeout(() => loadMoreLoginEnvs(true), 2500);
|
|
6512
|
+
} else _moreloginBrowsersTries = 0;
|
|
6110
6513
|
if (statusEl) {
|
|
6111
|
-
let msg =
|
|
6514
|
+
let msg = chosenFirefox
|
|
6515
|
+
? kit.tx('settings.redesign.browser.moreloginFirefoxDefault')
|
|
6516
|
+
: (moreloginNote
|
|
6517
|
+
? kit.tx('settings.redesign.browser.localProfilesOnly', { count: envs.length }) + ' ' + moreloginNote
|
|
6518
|
+
: kit.tx('settings.redesign.browser.profileSApiPort', { count: envs.length, port: d.port }));
|
|
6112
6519
|
// MoreLogin silently redirects a navigation it refuses to its stop page: a
|
|
6113
6520
|
// localhost port missing from the profile's Port scan protection list, or a
|
|
6114
6521
|
// host its website blacklist/whitelist refuses. Surface it; nothing else in
|
|
@@ -6170,6 +6577,8 @@ async function openSettingsModalNow(options = {}) {
|
|
|
6170
6577
|
});
|
|
6171
6578
|
}
|
|
6172
6579
|
{ const mlRow = overlay.querySelector('#bc-morelogin-row'); if (mlRow) wireDropdowns(mlRow, { signal: panelLife.signal }); }
|
|
6580
|
+
// Another profile chosen: the line under the picker says what holds for that one (the Firefox warning goes).
|
|
6581
|
+
overlay.querySelector('#bc-morelogin-env-id')?.addEventListener('change', () => loadMoreLoginEnvs(true), { signal: panelLife.signal });
|
|
6173
6582
|
overlay.querySelector('#bc-morelogin-refresh')?.addEventListener('click', (e) => { e.preventDefault(); loadMoreLoginEnvs(); });
|
|
6174
6583
|
const attachSeedDd = overlay.querySelector('.bc-dropdown[data-for="bc-attachSeed"]');
|
|
6175
6584
|
if (attachSeedDd) {
|
|
@@ -7623,6 +8032,10 @@ async function openSettingsModalNow(options = {}) {
|
|
|
7623
8032
|
let _ollamaPollTimer = null;
|
|
7624
8033
|
let _ollamaLastModelNames = '';
|
|
7625
8034
|
let _ollamaConfigureError = '';
|
|
8035
|
+
// ── Maritaca as an OpenCode provider (settings/settings-maritaca-opencode.js decides; this draws) ──
|
|
8036
|
+
let _mtcOcpStatus = null; // the last answer of GET /api/maritaca/opencode/status (null: not asked or failed)
|
|
8037
|
+
let _mtcOcpConfiguring = false; // a configure request in flight
|
|
8038
|
+
let _mtcOcpError = ''; // the message of the last failed configure
|
|
7626
8039
|
let _ocpHistoryStats = null;
|
|
7627
8040
|
|
|
7628
8041
|
function formatBytes(bytes) {
|
|
@@ -7851,6 +8264,153 @@ async function openSettingsModalNow(options = {}) {
|
|
|
7851
8264
|
});
|
|
7852
8265
|
}
|
|
7853
8266
|
|
|
8267
|
+
function renderMaritacaOcpCard() {
|
|
8268
|
+
if (!ocpProvidersEl) return;
|
|
8269
|
+
let card = ocpProvidersEl.querySelector('.stg-maritaca-card');
|
|
8270
|
+
if (!card) {
|
|
8271
|
+
card = document.createElement('div');
|
|
8272
|
+
card.className = 'stg-maritaca-card';
|
|
8273
|
+
const ollama = ocpProvidersEl.querySelector('.stg-ollama-card');
|
|
8274
|
+
if (ollama) ollama.after(card); else ocpProvidersEl.prepend(card);
|
|
8275
|
+
}
|
|
8276
|
+
const K = MARITACA_OPENCODE_KEYS;
|
|
8277
|
+
const tr = (key, vars) => kit.tx(`settings.redesign.opencode.${key}`, vars);
|
|
8278
|
+
const view = maritacaOpencodeCardView(_mtcOcpStatus, tr, { configuring: _mtcOcpConfiguring, error: _mtcOcpError });
|
|
8279
|
+
const count = view.modelCount;
|
|
8280
|
+
// Per-model visibility: the same denylist and markup as the other provider cards (ocp-hidden-models.js).
|
|
8281
|
+
const wasOpen = card.querySelector('.stg-model-list')?.style.display === '';
|
|
8282
|
+
const ocMaritaca = (Array.isArray(_ocpProviders) ? _ocpProviders : []).find((p) => p?.id === MARITACA_OPENCODE_PROVIDER);
|
|
8283
|
+
const modelRows = maritacaOpencodeModelRows(_mtcOcpStatus, getOcpHiddenModels(), ocMaritaca ? extractModels(ocMaritaca) : []);
|
|
8284
|
+
const expandHtml = modelRows.total ? `<button type="button" class="stg-model-expand-btn" data-provider="${MARITACA_OPENCODE_PROVIDER}" aria-expanded="${wasOpen ? 'true' : 'false'}">
|
|
8285
|
+
<svg class="stg-model-expand-icon" viewBox="0 0 24 24" aria-hidden="true"><polyline points="9 18 15 12 9 6"/></svg>
|
|
8286
|
+
<span class="stg-model-count-badge">${esc(modelsShownLabel(modelRows.enabled, modelRows.total))}</span>
|
|
8287
|
+
</button>` : '';
|
|
8288
|
+
const toolsLabel = kit.tx('settings.redesign.opencode.tools');
|
|
8289
|
+
const modelListHtml = modelRows.total ? `<div class="stg-model-list" data-provider="${MARITACA_OPENCODE_PROVIDER}" style="${wasOpen ? '' : 'display:none'}">
|
|
8290
|
+
<div class="stg-model-list-actions">
|
|
8291
|
+
<span class="stg-model-list-count">${esc(kit.tx(modelRows.total === 1 ? 'settings.redesign.opencode.modelCount.one' : 'settings.redesign.opencode.modelCount.other', { count: modelRows.total }))}</span>
|
|
8292
|
+
<button type="button" class="stg-action-btn compact stg-text-btn stg-model-all-btn" data-provider="${MARITACA_OPENCODE_PROVIDER}">${kit.te('settings.redesign.opencode.enableAll')}</button>
|
|
8293
|
+
<button type="button" class="stg-action-btn compact stg-text-btn stg-model-none-btn" data-provider="${MARITACA_OPENCODE_PROVIDER}">${kit.te('settings.redesign.opencode.disableAll')}</button>
|
|
8294
|
+
</div>
|
|
8295
|
+
${modelRows.rows.map((r) => `<label class="stg-model-toggle${r.hidden ? ' disabled' : ''}" data-full-id="${esc(r.fullId)}" title="${esc(r.name)}">
|
|
8296
|
+
<input type="checkbox" ${r.hidden ? '' : 'checked'} data-model-full-id="${esc(r.fullId)}">
|
|
8297
|
+
<span class="stg-model-toggle-name">${esc(r.id)}</span>
|
|
8298
|
+
${r.tools ? `<span class="stg-model-toggle-caps"><span class="stg-cap">${esc(toolsLabel)}</span></span>` : ''}
|
|
8299
|
+
</label>`).join('')}
|
|
8300
|
+
</div>` : '';
|
|
8301
|
+
const bodyHtml = view.state === 'registered'
|
|
8302
|
+
? `${expandHtml}<div class="stg-provider-toolbar"><span class="stg-provider-tag">${esc(view.tag)}</span><span class="stg-provider-sep">·</span><span class="stg-provider-submeta">${count} ${kit.te('settings.redesign.opencode.model')}${count !== 1 ? 's' : ''}</span></div>`
|
|
8303
|
+
: `${expandHtml}<div class="stg-provider-note">${esc(view.note)}</div>`;
|
|
8304
|
+
const actionHtml = view.actions.map((action) => {
|
|
8305
|
+
if (action === 'open-panel') return `<button type="button" class="stg-action-btn compact stg-text-btn stg-maritaca-open-panel" data-action="open-panel">${esc(tr(K.openPanel))}</button>`;
|
|
8306
|
+
if (action === 'configure') return `<button type="button" class="stg-action-btn compact stg-maritaca-configure" data-action="configure">${esc(tr(K.configure))}</button>`;
|
|
8307
|
+
if (action === 'resync') return `<button type="button" class="stg-action-btn compact stg-maritaca-configure" data-action="resync">${esc(tr(K.resync))}</button>`;
|
|
8308
|
+
return `<button type="button" class="stg-action-btn compact stg-text-btn stg-text-btn-danger stg-maritaca-remove stg-ocp-remove-btn" data-action="remove">${esc(tr(K.remove))}</button>`;
|
|
8309
|
+
}).join('');
|
|
8310
|
+
card.dataset.state = view.state;
|
|
8311
|
+
card.innerHTML = `<div class="stg-provider-card" style="--prov-accent:${view.dot}">
|
|
8312
|
+
<div class="stg-provider-head">
|
|
8313
|
+
<div class="stg-provider-ident">
|
|
8314
|
+
<span class="stg-provider-name">Maritaca <span class="stg-provider-subname">${esc(tr(K.subname))}</span></span>
|
|
8315
|
+
${bodyHtml}
|
|
8316
|
+
</div>
|
|
8317
|
+
<div class="stg-provider-side">
|
|
8318
|
+
<span class="stg-provider-status ${view.statusCls}">${esc(view.statusText)}</span>
|
|
8319
|
+
${actionHtml}
|
|
8320
|
+
</div>
|
|
8321
|
+
</div>
|
|
8322
|
+
${modelListHtml}
|
|
8323
|
+
</div>`;
|
|
8324
|
+
card.querySelector('.stg-maritaca-open-panel')?.addEventListener('click', () => {
|
|
8325
|
+
// The key is saved in the Maritaca panel (its cog): the toolbar button opens it.
|
|
8326
|
+
document.getElementById('topright-maritaca-panel-btn')?.click();
|
|
8327
|
+
});
|
|
8328
|
+
card.querySelector('.stg-maritaca-configure')?.addEventListener('click', () => configureMaritacaOcp());
|
|
8329
|
+
// Model toggles: the same save and event as the other cards; hidden ids are "maritaca/<id>".
|
|
8330
|
+
const updateMaritacaBadge = () => {
|
|
8331
|
+
const boxes = [...card.querySelectorAll('.stg-model-toggle input[type="checkbox"]')];
|
|
8332
|
+
const badge = card.querySelector('.stg-model-count-badge');
|
|
8333
|
+
if (badge) badge.textContent = modelsShownLabel(boxes.filter((c) => c.checked).length, boxes.length);
|
|
8334
|
+
};
|
|
8335
|
+
card.querySelectorAll('.stg-model-toggle input[type="checkbox"]').forEach((cb) => {
|
|
8336
|
+
cb.addEventListener('change', () => {
|
|
8337
|
+
const fullId = cb.dataset.modelFullId;
|
|
8338
|
+
if (!fullId) return;
|
|
8339
|
+
const hidden = getOcpHiddenModels();
|
|
8340
|
+
if (cb.checked) hidden.delete(fullId); else hidden.add(fullId);
|
|
8341
|
+
saveOcpHiddenModels(hidden);
|
|
8342
|
+
cb.closest('.stg-model-toggle')?.classList.toggle('disabled', !cb.checked);
|
|
8343
|
+
updateMaritacaBadge();
|
|
8344
|
+
document.dispatchEvent(new CustomEvent('ocp-hidden-models-changed'));
|
|
8345
|
+
});
|
|
8346
|
+
});
|
|
8347
|
+
for (const [sel, show] of [['.stg-model-all-btn', true], ['.stg-model-none-btn', false]]) {
|
|
8348
|
+
card.querySelector(sel)?.addEventListener('click', () => {
|
|
8349
|
+
const hidden = getOcpHiddenModels();
|
|
8350
|
+
card.querySelectorAll('.stg-model-toggle input[type="checkbox"]').forEach((cb) => {
|
|
8351
|
+
const fullId = cb.dataset.modelFullId;
|
|
8352
|
+
if (fullId) { if (show) hidden.delete(fullId); else hidden.add(fullId); }
|
|
8353
|
+
cb.checked = show;
|
|
8354
|
+
cb.closest('.stg-model-toggle')?.classList.toggle('disabled', !show);
|
|
8355
|
+
});
|
|
8356
|
+
saveOcpHiddenModels(hidden);
|
|
8357
|
+
updateMaritacaBadge();
|
|
8358
|
+
document.dispatchEvent(new CustomEvent('ocp-hidden-models-changed'));
|
|
8359
|
+
});
|
|
8360
|
+
}
|
|
8361
|
+
if (modelRows.total) card.querySelector('.stg-provider-card').style.cursor = 'pointer';
|
|
8362
|
+
card.querySelector('.stg-maritaca-remove')?.addEventListener('click', async () => {
|
|
8363
|
+
const btn = card.querySelector('.stg-maritaca-remove');
|
|
8364
|
+
if (btn) { btn.disabled = true; btn.textContent = tr(K.removing); }
|
|
8365
|
+
try {
|
|
8366
|
+
const resp = await fetch('/api/maritaca/opencode/configure', { method: 'DELETE' });
|
|
8367
|
+
const data = await resp.json().catch(() => ({}));
|
|
8368
|
+
if (!resp.ok || data.ok === false) throw new Error(data.error || `HTTP ${resp.status}`);
|
|
8369
|
+
_mtcOcpStatus = data; _mtcOcpError = '';
|
|
8370
|
+
renderMaritacaOcpCard();
|
|
8371
|
+
showCCToast(tr(K.removedToast));
|
|
8372
|
+
await refreshOcpProviders();
|
|
8373
|
+
document.dispatchEvent(new CustomEvent('ocp-providers-changed'));
|
|
8374
|
+
} catch (e) {
|
|
8375
|
+
showCCToast(tr(K.error, { message: e.message }));
|
|
8376
|
+
if (btn) { btn.disabled = false; btn.textContent = tr(K.remove); }
|
|
8377
|
+
}
|
|
8378
|
+
});
|
|
8379
|
+
}
|
|
8380
|
+
|
|
8381
|
+
async function configureMaritacaOcp() {
|
|
8382
|
+
if (_mtcOcpConfiguring) return;
|
|
8383
|
+
_mtcOcpConfiguring = true; _mtcOcpError = '';
|
|
8384
|
+
renderMaritacaOcpCard();
|
|
8385
|
+
try {
|
|
8386
|
+
const resp = await fetch('/api/maritaca/opencode/configure', { method: 'POST' });
|
|
8387
|
+
const data = await resp.json().catch(() => ({}));
|
|
8388
|
+
_mtcOcpConfiguring = false;
|
|
8389
|
+
if (!resp.ok || data.ok === false) throw new Error(data.error || `HTTP ${resp.status}`);
|
|
8390
|
+
_mtcOcpStatus = data;
|
|
8391
|
+
renderMaritacaOcpCard();
|
|
8392
|
+
showCCToast(kit.tx(`settings.redesign.opencode.${MARITACA_OPENCODE_KEYS.registeredToast}`, { count: data.modelsConfigured ?? data.modelCount ?? 0 }));
|
|
8393
|
+
// OpenCode reads the provider at once: its models are listed now.
|
|
8394
|
+
await refreshOcpProviders();
|
|
8395
|
+
document.dispatchEvent(new CustomEvent('ocp-providers-changed'));
|
|
8396
|
+
} catch (e) {
|
|
8397
|
+
_mtcOcpConfiguring = false;
|
|
8398
|
+
_mtcOcpError = e.message || 'error';
|
|
8399
|
+
renderMaritacaOcpCard();
|
|
8400
|
+
}
|
|
8401
|
+
}
|
|
8402
|
+
|
|
8403
|
+
async function refreshMaritacaOcp() {
|
|
8404
|
+
try {
|
|
8405
|
+
const resp = await fetch('/api/maritaca/opencode/status');
|
|
8406
|
+
const data = await resp.json().catch(() => null);
|
|
8407
|
+
_mtcOcpStatus = resp.ok && data && data.ok !== false ? data : null;
|
|
8408
|
+
} catch {
|
|
8409
|
+
_mtcOcpStatus = null;
|
|
8410
|
+
}
|
|
8411
|
+
if (!_mtcOcpConfiguring) renderMaritacaOcpCard();
|
|
8412
|
+
}
|
|
8413
|
+
|
|
7854
8414
|
async function ollamaDetectAndConfigure() {
|
|
7855
8415
|
try {
|
|
7856
8416
|
// Fetch status, models, and config state in parallel
|
|
@@ -7912,7 +8472,8 @@ async function openSettingsModalNow(options = {}) {
|
|
|
7912
8472
|
function startOllamaPoll() {
|
|
7913
8473
|
stopOllamaPoll();
|
|
7914
8474
|
ollamaDetectAndConfigure();
|
|
7915
|
-
|
|
8475
|
+
refreshMaritacaOcp();
|
|
8476
|
+
_ollamaPollTimer = setInterval(() => { ollamaDetectAndConfigure(); refreshMaritacaOcp(); }, 10000);
|
|
7916
8477
|
}
|
|
7917
8478
|
|
|
7918
8479
|
function stopOllamaPoll() {
|
|
@@ -8056,8 +8617,8 @@ async function openSettingsModalNow(options = {}) {
|
|
|
8056
8617
|
return;
|
|
8057
8618
|
}
|
|
8058
8619
|
|
|
8059
|
-
// Exclude Ollama —
|
|
8060
|
-
const filtered = providerCatalog.filter(p => p.id !== 'ollama');
|
|
8620
|
+
// Exclude Ollama and Maritaca — each has its own dedicated card (renderOllamaCard, renderMaritacaOcpCard)
|
|
8621
|
+
const filtered = providerCatalog.filter(p => p.id !== 'ollama' && p.id !== 'maritaca');
|
|
8061
8622
|
|
|
8062
8623
|
// Sort: connected first, then stored-key, then alphabetical
|
|
8063
8624
|
const sorted = [...filtered].sort((a, b) => {
|
|
@@ -8249,6 +8810,8 @@ async function openSettingsModalNow(options = {}) {
|
|
|
8249
8810
|
} else {
|
|
8250
8811
|
ocpProvidersEl.innerHTML = cardsHtml || emptyHtml;
|
|
8251
8812
|
}
|
|
8813
|
+
// The list was rebuilt: the Maritaca card is drawn again at once (the Ollama card returns with its poll).
|
|
8814
|
+
if (_mtcOcpStatus || _mtcOcpConfiguring || _mtcOcpError) renderMaritacaOcpCard();
|
|
8252
8815
|
|
|
8253
8816
|
// Wire model capability tooltips
|
|
8254
8817
|
ocpProvidersEl.querySelectorAll('.stg-model-hover[data-model-id]').forEach(span => {
|
|
@@ -8549,7 +9112,7 @@ async function openSettingsModalNow(options = {}) {
|
|
|
8549
9112
|
if (ocpProvidersEl) {
|
|
8550
9113
|
ocpProvidersEl.addEventListener('click', (e) => {
|
|
8551
9114
|
// Skip clicks on action buttons, inputs, expanded content
|
|
8552
|
-
if (e.target.closest('.stg-ocp-remove-btn, .stg-ocp-apikey-btn, .stg-ocp-oauth-btn, .stg-model-all-btn, .stg-model-none-btn, input, label, .stg-model-list, .stg-ocp-key-form, .stg-ocp-oauth-wait, .stg-ocp-toggle-all')) return;
|
|
9115
|
+
if (e.target.closest('.stg-ocp-remove-btn, .stg-ocp-apikey-btn, .stg-ocp-oauth-btn, .stg-model-all-btn, .stg-model-none-btn, input, label, .stg-model-list, .stg-ocp-key-form, .stg-ocp-oauth-wait, .stg-ocp-toggle-all, .stg-maritaca-configure, .stg-maritaca-open-panel')) return;
|
|
8553
9116
|
const card = e.target.closest('.stg-provider-card');
|
|
8554
9117
|
if (!card) return;
|
|
8555
9118
|
const list = card.querySelector('.stg-model-list');
|