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
|
@@ -16,6 +16,7 @@ import { toggleClaudePanel, isClaudePanelOpen } from './ui-claude-panel.js';
|
|
|
16
16
|
import { toggleCodexPanel, isCodexPanelOpen } from './ui-codex-panel.js';
|
|
17
17
|
import { toggleOpencodePanel, isOpencodePanelOpen } from './ui-opencode-panel-v2.js';
|
|
18
18
|
import { toggleAntigravityPanel, isAntigravityPanelOpen } from './ui-antigravity-panel.js';
|
|
19
|
+
import { toggleMaritacaPanel, isMaritacaPanelOpen } from './ui-maritaca-panel.js';
|
|
19
20
|
import { toggleAssistantPanel, isAssistantPanelOpen, initAssistantPanel } from './ui-assistant-panel.js';
|
|
20
21
|
import { initAssistant } from './ui-assistant.js';
|
|
21
22
|
import { toggleSessionMonitor, fetchLoopsForBadge, fetchNotificationsForBadge } from './ui-sessions.js';
|
|
@@ -40,6 +41,7 @@ export function initNavbar() {
|
|
|
40
41
|
const codexPanelBtn = $('topright-codex-panel-btn');
|
|
41
42
|
const opencodePanelBtn = $('topright-opencode-panel-btn');
|
|
42
43
|
const antigravityPanelBtn = $('topright-antigravity-panel-btn');
|
|
44
|
+
const maritacaPanelBtn = $('topright-maritaca-panel-btn');
|
|
43
45
|
initSidepanelTrayPlaceholders();
|
|
44
46
|
// The Assistant: shared host wiring (terminal tab + sidepanel), then the
|
|
45
47
|
// sidepanel host, which restores its saved tabs as tray pills.
|
|
@@ -72,6 +74,11 @@ export function initNavbar() {
|
|
|
72
74
|
toggle: toggleAntigravityPanel,
|
|
73
75
|
button: antigravityPanelBtn,
|
|
74
76
|
},
|
|
77
|
+
maritaca: {
|
|
78
|
+
isOpen: isMaritacaPanelOpen,
|
|
79
|
+
toggle: toggleMaritacaPanel,
|
|
80
|
+
button: maritacaPanelBtn,
|
|
81
|
+
},
|
|
75
82
|
};
|
|
76
83
|
|
|
77
84
|
function syncAgentPanelButtons() {
|
|
@@ -133,6 +140,16 @@ export function initNavbar() {
|
|
|
133
140
|
syncAgentPanelButtons();
|
|
134
141
|
});
|
|
135
142
|
}
|
|
143
|
+
if (maritacaPanelBtn) {
|
|
144
|
+
maritacaPanelBtn.addEventListener('click', async (e) => {
|
|
145
|
+
e.preventDefault();
|
|
146
|
+
await toggleAgentPanel('maritaca');
|
|
147
|
+
});
|
|
148
|
+
on('maritaca-panel:visibility', (visible) => {
|
|
149
|
+
maritacaPanelBtn.classList.toggle('active', !!visible);
|
|
150
|
+
syncAgentPanelButtons();
|
|
151
|
+
});
|
|
152
|
+
}
|
|
136
153
|
on('claude-panel:visibility', () => syncAgentPanelButtons());
|
|
137
154
|
on('opencode-child:visibility', () => syncAgentPanelButtons());
|
|
138
155
|
|
|
@@ -312,7 +312,9 @@ export function initPanelSystem() {
|
|
|
312
312
|
// An explorer opening or closing, or the bar changing height, moves the frame without a window resize.
|
|
313
313
|
onFrameChange(() => clampPanelsToViewport());
|
|
314
314
|
|
|
315
|
-
//
|
|
315
|
+
// Mark a hidden tab for the shared ticker (synabun-ticker.js tickerPaused). No stylesheet
|
|
316
|
+
// keys on body.app-hidden: a universal rule under it was a full style
|
|
317
|
+
// recalculation of the page on every return to the tab (css-has-performance.test.mjs).
|
|
316
318
|
document.addEventListener('visibilitychange', () => {
|
|
317
319
|
document.body.classList.toggle('app-hidden', document.hidden);
|
|
318
320
|
});
|
|
@@ -15,6 +15,9 @@ import { registerLaunchPrefetch } from './launch-prefetch.js';
|
|
|
15
15
|
import { sendToPanel } from './ui-claude-panel.js';
|
|
16
16
|
import { openAntigravityWithPrompt } from './ui-antigravity-panel.js';
|
|
17
17
|
import { getProviderMeta } from './provider-icons.js';
|
|
18
|
+
import { fetchAutomationApprovals, openApprovalDialog } from './ui-automation-approval.js';
|
|
19
|
+
import { scheduleFlag } from './automation-approval-view.js';
|
|
20
|
+
import { moreLoginFieldHTML, readMoreLoginField, wireMoreLoginFields, ensureMoreLoginProfiles, loadMoreLoginProfiles } from './morelogin-profile-field.js';
|
|
18
21
|
import {
|
|
19
22
|
getNativeLoopRouterClaimToken,
|
|
20
23
|
getNativeLoopRouterWindowId,
|
|
@@ -26,6 +29,7 @@ import {
|
|
|
26
29
|
fetchCodexAccounts,
|
|
27
30
|
getCachedCodexAccounts,
|
|
28
31
|
getCachedToolCatalog,
|
|
32
|
+
getEffortLevelsForModel,
|
|
29
33
|
getEffortLevelsForProfile,
|
|
30
34
|
getModelsForProfile,
|
|
31
35
|
formatModelOptionLabel,
|
|
@@ -132,9 +136,15 @@ let _query = '';
|
|
|
132
136
|
const _expanded = new Set();
|
|
133
137
|
const _collapsed = new Set();
|
|
134
138
|
let _scheduleEditor = null; // the draft while the schedule editor is open
|
|
139
|
+
// The "MoreLogin profile" row of the editors and the timer form is morelogin-profile-field.js. MoreLogin's profiles
|
|
140
|
+
// change outside SynaBun: the list is asked again for every editor that opens (and by the row's Refresh).
|
|
141
|
+
let _mlProfilesFor = null; // the draft the list was last asked for
|
|
142
|
+
let _qtMoreLogin = { moreloginEnvId: null, moreloginEnvName: null }; // the timer form's choice, kept while the window lives
|
|
135
143
|
let _groupEditorId = null; // the group being edited; null with a draft = a new group
|
|
136
144
|
let _groupEditorDraft = null;
|
|
137
145
|
let _confirm = null; // { kind: 'schedule' | 'group', id, opener }
|
|
146
|
+
// What an agent changed and the owner has not approved (GET /api/automation-approvals; finding 3 of 2026-11-11).
|
|
147
|
+
let _approvals = { schedules: {}, templates: {} };
|
|
138
148
|
let _draggingScheduleId = null;
|
|
139
149
|
let _pollTimer = null;
|
|
140
150
|
let _refreshTimer = null;
|
|
@@ -243,7 +253,7 @@ const presetLabel = (preset) => (preset.key ? t(`schedules.presets.${preset.key}
|
|
|
243
253
|
// English for every window: the ones the Schedules window shows read in the page's language. A
|
|
244
254
|
// word not listed (a level or a description a provider named) shows as it is.
|
|
245
255
|
const LAUNCH_WORDS = {
|
|
246
|
-
Off: 'off', Default: 'default', Low: 'low', Med: 'medium', High: 'high', XHigh: 'xhigh', Max: 'max', Ultra: 'ultra',
|
|
256
|
+
Off: 'off', Auto: 'auto', Default: 'default', Low: 'low', Med: 'medium', High: 'high', XHigh: 'xhigh', Max: 'max', Ultra: 'ultra',
|
|
247
257
|
'No thinking': 'noThinking', Minimal: 'minimal', Balanced: 'balanced', Deep: 'deep', 'Very deep': 'veryDeep',
|
|
248
258
|
Maximum: 'maximum', 'Config default': 'configDefault', 'Model default': 'modelDefault', Light: 'light',
|
|
249
259
|
'Maximum, with delegation': 'maximumDelegated',
|
|
@@ -541,6 +551,7 @@ function wirePanel() {
|
|
|
541
551
|
_panel.addEventListener('keydown', handlePanelKeydown, { signal });
|
|
542
552
|
// The popups (cc-dropdown.js): one set of listeners for every one the window draws.
|
|
543
553
|
wireDropdowns(_panel, { signal });
|
|
554
|
+
wireMoreLoginFields(_panel, { signal });
|
|
544
555
|
_panel.addEventListener('change', event => {
|
|
545
556
|
if (!['sched-ge-browser', 'sched-ed-browser'].includes(event.target.id)) return;
|
|
546
557
|
const group = event.target.id === 'sched-ge-browser';
|
|
@@ -582,10 +593,12 @@ async function loadData() {
|
|
|
582
593
|
_launchTools = await migrateStoredTools(storage, 'as-launch-tools', 'as-launch-mcp-profile');
|
|
583
594
|
const seq = ++_loadSeq;
|
|
584
595
|
loadTimers();
|
|
585
|
-
const [schedules, templates, groups] = await Promise.allSettled([
|
|
596
|
+
const [schedules, templates, groups, approvals] = await Promise.allSettled([
|
|
586
597
|
withDeadline(fetchSchedules()), withDeadline(fetchLoopTemplates()), withDeadline(fetchScheduleGroups()),
|
|
598
|
+
withDeadline(fetchAutomationApprovals()),
|
|
587
599
|
]);
|
|
588
600
|
if (seq !== _loadSeq) return; // a newer load is under way: it finishes for both
|
|
601
|
+
_approvals = approvals.status === 'fulfilled' && approvals.value ? approvals.value : { schedules: {}, templates: {} };
|
|
589
602
|
const failed = [];
|
|
590
603
|
// A record still saved for the Gemini CLI reads as Antigravity's (migrateLaunchRecords).
|
|
591
604
|
if (schedules.status === 'fulfilled' && Array.isArray(schedules.value)) {
|
|
@@ -851,6 +864,7 @@ function groupOverridesText(group) {
|
|
|
851
864
|
if (group.tools) parts.push(t('schedules.overrides.mcp', { value: group.tools.join(', ') }));
|
|
852
865
|
if (group.usesBrowser === true) parts.push(t('schedules.overrides.browserOn'));
|
|
853
866
|
else if (group.usesBrowser === false) parts.push(t('schedules.overrides.browserOff'));
|
|
867
|
+
if (group.moreloginEnvId) parts.push(t('schedules.overrides.morelogin', { value: group.moreloginEnvName || group.moreloginEnvId }));
|
|
854
868
|
return parts.join(' · ');
|
|
855
869
|
}
|
|
856
870
|
|
|
@@ -1169,6 +1183,26 @@ function lastRunHTML(s, now, run = lastRunState(s), { ago: withAgo = true } = {}
|
|
|
1169
1183
|
<span class="sched-last-word">${RESULT_ICON[run.kind] || ICONS.never}<span>${esc(run.label)}</span></span>${ago ? `<span class="sched-last-ago">${esc(ago)}</span>` : ''}</span>`;
|
|
1170
1184
|
}
|
|
1171
1185
|
|
|
1186
|
+
// ── The flag of a schedule an agent changed (finding 3 of the re-review of 2026-11-11) ──
|
|
1187
|
+
/** The server's summary for a marked schedule, or one built from the records' own marks (an older server). */
|
|
1188
|
+
function approvalSummary(s) {
|
|
1189
|
+
const summary = _approvals.schedules?.[s.id];
|
|
1190
|
+
if (summary) return summary;
|
|
1191
|
+
const template = getTemplate(s.templateId);
|
|
1192
|
+
if (s.taskBy !== 'agent' && template?.editedBy !== 'agent') return null;
|
|
1193
|
+
return { case: 'unknown', marks: { schedule: s.taskBy === 'agent', template: template?.editedBy === 'agent', scheduleFrom: s.unreviewedFrom || 'agent', templateFrom: template?.unreviewedFrom || 'agent' }, account: null };
|
|
1194
|
+
}
|
|
1195
|
+
function approvalRowBit(s) {
|
|
1196
|
+
const flag = scheduleFlag(approvalSummary(s), t);
|
|
1197
|
+
return flag ? `<span aria-hidden="true">·</span><span class="aap-flag" data-tone="${flag.tone}" data-tooltip="${esc(flag.text)}">${esc(flag.short)}</span>` : '';
|
|
1198
|
+
}
|
|
1199
|
+
function approvalNoteHTML(s) {
|
|
1200
|
+
const flag = scheduleFlag(approvalSummary(s), t);
|
|
1201
|
+
if (!flag) return '';
|
|
1202
|
+
return `<div class="aap-flag-note" data-tone="${flag.tone}" role="note"><p>${esc(flag.text)}</p>
|
|
1203
|
+
<button type="button" class="aap-btn" data-action="schedule-approve" data-id="${esc(s.id)}">${te('automationApproval.flag.review')}</button></div>`;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1172
1206
|
function rowHTML(s, { now = Date.now(), showGroup = false } = {}) {
|
|
1173
1207
|
const run = lastRunState(s);
|
|
1174
1208
|
const failing = run.kind === 'failed';
|
|
@@ -1187,7 +1221,7 @@ function rowHTML(s, { now = Date.now(), showGroup = false } = {}) {
|
|
|
1187
1221
|
</span>
|
|
1188
1222
|
<button type="button" class="sched-row-toggle" data-action="schedule-expand" data-id="${esc(s.id)}" aria-expanded="${open}"${open ? ` aria-controls="${detailId}"` : ''}>
|
|
1189
1223
|
<span class="sched-row-name">${esc(s.name)}</span>
|
|
1190
|
-
<span class="sched-row-sub">${groupBit}${groupBit ? '<span aria-hidden="true">·</span>' : ''}<span>${esc(describeCron(s.cron))}</span
|
|
1224
|
+
<span class="sched-row-sub">${groupBit}${groupBit ? '<span aria-hidden="true">·</span>' : ''}<span>${esc(describeCron(s.cron))}</span>${approvalRowBit(s)}</span>
|
|
1191
1225
|
${failing ? `<span class="sched-row-reason">${esc(oneLine(run.reason))}</span>` : ''}
|
|
1192
1226
|
</button>
|
|
1193
1227
|
${nextRunHTML(s, now)}
|
|
@@ -1218,6 +1252,7 @@ function detailHTML(s, now, run) {
|
|
|
1218
1252
|
];
|
|
1219
1253
|
const fact = (label, value, cls = '') => `<div class="sched-fact"><dt>${esc(label)}</dt><dd${cls ? ` class="${cls}"` : ''}>${value}</dd></div>`;
|
|
1220
1254
|
return `
|
|
1255
|
+
${approvalNoteHTML(s)}
|
|
1221
1256
|
<div class="sched-detail-grid">
|
|
1222
1257
|
<section class="sched-facts-block">
|
|
1223
1258
|
<h4 class="sched-facts-title">${te('schedules.detail.runs')}</h4>
|
|
@@ -1329,12 +1364,15 @@ function renderTimersView() {
|
|
|
1329
1364
|
const profileOptions = CLI_PROFILES.map(p => opt(p.id, p.label, p.id === _launchProfile));
|
|
1330
1365
|
const modelOptions = renderModelOptions(_launchProfile, _launchModel, { accountId: _launchAccount });
|
|
1331
1366
|
const contextOptions = renderContextOptions(_launchProfile, _launchModel, _launchContextMode, { accountId: _launchAccount });
|
|
1332
|
-
const effortOptions = renderEffortOptions(_launchProfile, _launchEffort);
|
|
1367
|
+
const effortOptions = renderEffortOptions(_launchProfile, _launchEffort, { model: _launchModel, accountId: _launchAccount });
|
|
1333
1368
|
const accountOptions = renderAccountOptions(_launchAccount, false);
|
|
1334
1369
|
const showEffort = profileSupportsEffort(_launchProfile);
|
|
1335
1370
|
const showMcp = strictToolHost(_launchProfile);
|
|
1336
1371
|
const showAccount = _launchProfile === 'codex';
|
|
1337
1372
|
const usesBrowser = _qtUsesBrowser !== null ? _qtUsesBrowser : !!getTemplate(selectedTemplate)?.usesBrowser;
|
|
1373
|
+
// The form is drawn again on many changes: its MoreLogin choice is read first and put back.
|
|
1374
|
+
_qtMoreLogin = readMoreLoginField('sched-qt-mlprofile') || _qtMoreLogin;
|
|
1375
|
+
ensureMoreLoginProfiles();
|
|
1338
1376
|
const qtPresetButtons = [5, 15, 30, 60, 120, 240]
|
|
1339
1377
|
.map(min => `<button type="button" class="sched-chip" data-action="qt-select" data-minutes="${min}" aria-pressed="${_selectedQtMinutes === min}">${min >= 60 ? te('schedules.timers.presetHours', { n: min / 60 }) : te('schedules.timers.presetMinutes', { n: min })}</button>`)
|
|
1340
1378
|
.join('');
|
|
@@ -1374,6 +1412,7 @@ function renderTimersView() {
|
|
|
1374
1412
|
${toolRow('sched-qt-mcp', _launchTools, { provider: _launchProfile, usesBrowser })}
|
|
1375
1413
|
${dropdownRow('sched-qt-account', t('schedules.form.account'), accountOptions, { hidden: !showAccount, rowId: 'sched-qt-account-field' })}
|
|
1376
1414
|
${formRow('sched-qt-browser', t('schedules.timers.usesBrowser'), toggleHTML('sched-qt-browser', usesBrowser), { toggle: true })}
|
|
1415
|
+
${moreLoginFieldHTML({ id: 'sched-qt-mlprofile', value: _qtMoreLogin.moreloginEnvId || '', savedName: _qtMoreLogin.moreloginEnvName || null, context: 'run' })}
|
|
1377
1416
|
${formRow('sched-qt-custom-min', t('schedules.timers.startIn'), `<span class="sched-chip-list" role="group" aria-label="${te('schedules.timers.delay')}">${qtPresetButtons}</span>
|
|
1378
1417
|
<input class="sched-input" id="sched-qt-custom-min" type="number" min="1" max="1440" value="${esc(customMinutes)}" placeholder="${te('schedules.timers.minutesPlaceholder')}" aria-label="${te('schedules.timers.minutesFromNow')}">`, { top: true })}
|
|
1379
1418
|
</div>
|
|
@@ -1419,6 +1458,8 @@ function renderTimersView() {
|
|
|
1419
1458
|
storage.setItem('as-launch-context-mode', _launchContextMode);
|
|
1420
1459
|
const contextPopup = $('sched-qt-context');
|
|
1421
1460
|
if (contextPopup) setDropdownItems(contextPopup, renderContextOptions(_launchProfile, _launchModel, _launchContextMode, { accountId: _launchAccount }));
|
|
1461
|
+
const effortPopup = $('sched-qt-effort');
|
|
1462
|
+
if (effortPopup) setDropdownItems(effortPopup, renderEffortOptions(_launchProfile, _launchEffort, { model: _launchModel, accountId: _launchAccount }));
|
|
1422
1463
|
});
|
|
1423
1464
|
$('sched-qt-context')?.addEventListener('change', (e) => {
|
|
1424
1465
|
_launchContextMode = e.target.value || 'default';
|
|
@@ -1519,10 +1560,19 @@ function modelChoiceAvailable(profile, model, accountId = 'default') {
|
|
|
1519
1560
|
return !models.length || models.some((entry) => entry.id === model);
|
|
1520
1561
|
}
|
|
1521
1562
|
|
|
1522
|
-
//
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1563
|
+
// The model row a selector names in the profile's list (null: no model, or one the list lacks).
|
|
1564
|
+
function effortModelRow(profile, model, accountId = 'default') {
|
|
1565
|
+
if (!model) return null;
|
|
1566
|
+
return getModelsForProfile(profile, accountId).find(m => modelMatchesSelector(m, model) || m.id === model) || null;
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
// The effort choices of a profile, for the model when it is known (getEffortLevelsForModel): Auto
|
|
1570
|
+
// (`off`, the model's default), Off (`none`, thinking disabled) where the model can run it, then its
|
|
1571
|
+
// levels. `inheritLabel` adds the "no override" choice ('') of the editors, apart from an explicit
|
|
1572
|
+
// `off`, which is a value of its own: a run takes the model's default over the group's level.
|
|
1573
|
+
function renderEffortOptions(profile, selected, { inheritLabel = null, model = null, accountId = 'default' } = {}) {
|
|
1574
|
+
const row = effortModelRow(profile, model, accountId);
|
|
1575
|
+
const levels = row ? getEffortLevelsForModel(profile, row) : getEffortLevelsForProfile(profile);
|
|
1526
1576
|
const value = selected || '';
|
|
1527
1577
|
if (!inheritLabel && !levels.length) return [opt('off', t('schedules.launch.default'), true)];
|
|
1528
1578
|
const known = !!value && levels.some(e => e.id === value);
|
|
@@ -1530,7 +1580,7 @@ function renderEffortOptions(profile, selected, { inheritLabel = null } = {}) {
|
|
|
1530
1580
|
for (const e of levels) {
|
|
1531
1581
|
opts.push(opt(e.id, e.desc ? t('schedules.launch.effortOption', { level: launchWord(e.label), desc: launchWord(e.desc) }) : launchWord(e.label), e.id === value));
|
|
1532
1582
|
}
|
|
1533
|
-
// A saved level this
|
|
1583
|
+
// A saved level this model does not list (set for another CLI or model, or by hand) stays selected,
|
|
1534
1584
|
// so saving the form cannot drop it (the model, MCP and account popups do the same).
|
|
1535
1585
|
if (value && !known) opts.push(opt(value, t('schedules.launch.saved', { value }), true));
|
|
1536
1586
|
return opts;
|
|
@@ -1592,6 +1642,7 @@ function renderActiveTimersInto() {
|
|
|
1592
1642
|
timer.contextMode && timer.contextMode !== 'default' ? t('schedules.overrides.context', { value: timer.contextMode }) : '',
|
|
1593
1643
|
timer.effort ? t('schedules.overrides.thinking', { value: timer.effort }) : '',
|
|
1594
1644
|
timer.tools ? t('schedules.overrides.mcp', { value: timer.tools.join(', ') }) : '',
|
|
1645
|
+
timer.moreloginEnvId ? t('schedules.overrides.morelogin', { value: timer.moreloginEnvName || timer.moreloginEnvId }) : '',
|
|
1595
1646
|
].filter(Boolean).join(' · ');
|
|
1596
1647
|
return `
|
|
1597
1648
|
<div class="sched-timer-row" data-timer-id="${esc(timer.id)}" data-timer-kind="quick">
|
|
@@ -1679,8 +1730,9 @@ function openGroupEditor(id) {
|
|
|
1679
1730
|
// `_original` is the group as it was when the editor opened: a save sends only what the user
|
|
1680
1731
|
// changed from it, so a change made elsewhere meanwhile (a sync update) is never undone.
|
|
1681
1732
|
_groupEditorDraft = group
|
|
1682
|
-
? { name: group.name, color: group.color, mutualExclusion: !!group.mutualExclusion, profile: group.profile || null, model: group.model || null, contextMode: group.contextMode || null, effort: group.effort || null, tools: group.tools || null, codexAccountId: group.codexAccountId || null, usesBrowser: group.usesBrowser, _original: JSON.parse(JSON.stringify(group)) }
|
|
1683
|
-
: { name: '', color: DEFAULT_GROUP_COLOR, mutualExclusion: false, profile: null, model: null, contextMode: null, effort: null, tools: null, codexAccountId: null, usesBrowser: undefined };
|
|
1733
|
+
? { name: group.name, color: group.color, mutualExclusion: !!group.mutualExclusion, profile: group.profile || null, model: group.model || null, contextMode: group.contextMode || null, effort: group.effort || null, tools: group.tools || null, codexAccountId: group.codexAccountId || null, usesBrowser: group.usesBrowser, moreloginEnvId: group.moreloginEnvId || null, moreloginEnvName: group.moreloginEnvName || null, _original: JSON.parse(JSON.stringify(group)) }
|
|
1734
|
+
: { name: '', color: DEFAULT_GROUP_COLOR, mutualExclusion: false, profile: null, model: null, contextMode: null, effort: null, tools: null, codexAccountId: null, usesBrowser: undefined, moreloginEnvId: null, moreloginEnvName: null };
|
|
1735
|
+
loadMoreLoginProfiles(); // asked again for every editor that opens
|
|
1684
1736
|
ensureModelsForProfile(_groupEditorDraft.profile || 'claude-code', false, _groupEditorDraft.codexAccountId || 'default').then(() => {
|
|
1685
1737
|
if (_panel && _groupEditorDraft) {
|
|
1686
1738
|
collectGroupEditorDraft();
|
|
@@ -1704,6 +1756,9 @@ function collectGroupEditorDraft() {
|
|
|
1704
1756
|
codexAccountId: $('sched-ge-account')?.value || null,
|
|
1705
1757
|
usesBrowser: browserRaw === '' ? undefined : browserRaw === 'true',
|
|
1706
1758
|
});
|
|
1759
|
+
// Only from a row on screen: a hidden row (MoreLogin not in use) keeps what the draft holds.
|
|
1760
|
+
const mlChoice = readMoreLoginField('sched-ge-mlprofile');
|
|
1761
|
+
if (mlChoice) Object.assign(_groupEditorDraft, mlChoice);
|
|
1707
1762
|
}
|
|
1708
1763
|
|
|
1709
1764
|
function renderGroupEditor(group) {
|
|
@@ -1721,7 +1776,7 @@ function renderGroupEditor(group) {
|
|
|
1721
1776
|
];
|
|
1722
1777
|
const modelOptions = renderModelOptions(profileForModels, d.model || '', { showService: true, accountId });
|
|
1723
1778
|
const contextOptions = renderContextOptions(profileForModels, d.model, d.contextMode, { accountId, inherit: true });
|
|
1724
|
-
const effortOptions = renderEffortOptions(profileForModels, d.effort || '', { inheritLabel: t('schedules.launch.noOverride') });
|
|
1779
|
+
const effortOptions = renderEffortOptions(profileForModels, d.effort || '', { inheritLabel: t('schedules.launch.noOverride'), model: d.model, accountId });
|
|
1725
1780
|
const accountOptions = renderAccountOptions(d.codexAccountId || '', true);
|
|
1726
1781
|
const showEffort = profileSupportsEffort(profileForModels);
|
|
1727
1782
|
const showMcp = strictToolHost(profileForModels);
|
|
@@ -1763,6 +1818,7 @@ function renderGroupEditor(group) {
|
|
|
1763
1818
|
opt('true', t('schedules.launch.alwaysOn'), browserValue === 'true'),
|
|
1764
1819
|
opt('false', t('schedules.launch.alwaysOff'), browserValue === 'false'),
|
|
1765
1820
|
])}
|
|
1821
|
+
${moreLoginFieldHTML({ id: 'sched-ge-mlprofile', value: d.moreloginEnvId || '', savedName: d.moreloginEnvName || null, context: 'group' })}
|
|
1766
1822
|
</div>
|
|
1767
1823
|
</section>
|
|
1768
1824
|
${!group ? '' : `
|
|
@@ -1818,6 +1874,8 @@ function wireGroupEditor() {
|
|
|
1818
1874
|
_groupEditorDraft.contextMode = _groupEditorDraft.model ? 'default' : null;
|
|
1819
1875
|
const contextPopup = $('sched-ge-context');
|
|
1820
1876
|
if (contextPopup) setDropdownItems(contextPopup, renderContextOptions(_groupEditorDraft.profile || 'claude-code', _groupEditorDraft.model, _groupEditorDraft.contextMode, { accountId: _groupEditorDraft.codexAccountId || 'default', inherit: true }));
|
|
1877
|
+
const effortPopup = $('sched-ge-effort');
|
|
1878
|
+
if (effortPopup) setDropdownItems(effortPopup, renderEffortOptions(_groupEditorDraft.profile || 'claude-code', effortPopup.value || '', { inheritLabel: t('schedules.launch.noOverride'), model: _groupEditorDraft.model, accountId: _groupEditorDraft.codexAccountId || 'default' }));
|
|
1821
1879
|
});
|
|
1822
1880
|
$('sched-ge-context')?.addEventListener('change', (e) => { _groupEditorDraft.contextMode = e.target.value || null; });
|
|
1823
1881
|
$('sched-ge-account')?.addEventListener('change', (e) => {
|
|
@@ -1866,7 +1924,7 @@ function renderScheduleEditor() {
|
|
|
1866
1924
|
const effectiveModel = s.model || group?.model || template?.model || null;
|
|
1867
1925
|
const modelOptions = renderModelOptions(profileForModels, s.model || '', { showService: true, accountId });
|
|
1868
1926
|
const contextOptions = renderContextOptions(profileForModels, effectiveModel, s.contextMode, { accountId, inherit: true });
|
|
1869
|
-
const effortOptions = renderEffortOptions(profileForModels, s.effort || '', { inheritLabel: t('schedules.launch.templateOrDefault') });
|
|
1927
|
+
const effortOptions = renderEffortOptions(profileForModels, s.effort || '', { inheritLabel: t('schedules.launch.templateOrDefault'), model: effectiveModel, accountId });
|
|
1870
1928
|
const accountOptions = renderAccountOptions(s.codexAccountId || '', true);
|
|
1871
1929
|
const showEffort = profileSupportsEffort(profileForModels);
|
|
1872
1930
|
const showMcp = strictToolHost(profileForModels);
|
|
@@ -1910,11 +1968,19 @@ function renderScheduleEditor() {
|
|
|
1910
1968
|
if (showMcp && !getCachedToolCatalog()) {
|
|
1911
1969
|
fetchToolCatalog().then(catalog => { if (catalog && _panel && _scheduleEditor) { collectScheduleEditorDraft(); renderScheduleEditor(); } });
|
|
1912
1970
|
}
|
|
1971
|
+
// MoreLogin's profiles are asked once per editor that opens (they change outside SynaBun); Refresh asks again.
|
|
1972
|
+
if (_scheduleEditor && _mlProfilesFor !== _scheduleEditor) {
|
|
1973
|
+
_mlProfilesFor = _scheduleEditor;
|
|
1974
|
+
loadMoreLoginProfiles();
|
|
1975
|
+
}
|
|
1976
|
+
// A schedule without a profile of its own runs in its group's, when the group has one.
|
|
1977
|
+
const groupProfileName = group?.moreloginEnvId ? (group.moreloginEnvName || String(group.moreloginEnvId)) : '';
|
|
1913
1978
|
|
|
1914
1979
|
redrawEditor(main, `
|
|
1915
1980
|
<div class="sched-editor">
|
|
1916
1981
|
${editorHead({ back: 'schedule-editor-close', title: t(isEdit ? 'schedules.detail.editSchedule' : 'schedules.head.newSchedule'), sub: isEdit ? s.name : t('schedules.scheduleEditor.newSub'), titleId: 'sched-view-title' })}
|
|
1917
1982
|
<div class="sched-editor-body">
|
|
1983
|
+
${isEdit ? approvalNoteHTML(_schedules.find(x => x.id === s.id) || s) : ''}
|
|
1918
1984
|
<div class="sched-form">
|
|
1919
1985
|
<section class="sched-form-section" aria-labelledby="sched-ed-sec-basics">
|
|
1920
1986
|
<h3 class="sched-form-title" id="sched-ed-sec-basics">${te('schedules.timers.schedule')}</h3>
|
|
@@ -1960,6 +2026,8 @@ function renderScheduleEditor() {
|
|
|
1960
2026
|
opt('true', t('schedules.launch.alwaysOn'), browserValue === 'true'),
|
|
1961
2027
|
opt('false', t('schedules.launch.alwaysOff'), browserValue === 'false'),
|
|
1962
2028
|
])}
|
|
2029
|
+
${moreLoginFieldHTML({ id: 'sched-ed-mlprofile', value: s.moreloginEnvId || '', savedName: s.moreloginEnvName || null, context: 'schedule',
|
|
2030
|
+
inheritLabel: groupProfileName ? t('schedules.form.moreloginGroupProfile', { name: groupProfileName }) : '' })}
|
|
1963
2031
|
</div>
|
|
1964
2032
|
</section>
|
|
1965
2033
|
|
|
@@ -2008,6 +2076,8 @@ function renderScheduleEditor() {
|
|
|
2008
2076
|
_scheduleEditor.contextMode = _scheduleEditor.model ? 'default' : null;
|
|
2009
2077
|
const contextPopup = $('sched-ed-context');
|
|
2010
2078
|
if (contextPopup) setDropdownItems(contextPopup, renderContextOptions(profileForModels, _scheduleEditor.model || group?.model || template?.model, _scheduleEditor.contextMode, { accountId, inherit: true }));
|
|
2079
|
+
const effortPopup = $('sched-ed-effort');
|
|
2080
|
+
if (effortPopup) setDropdownItems(effortPopup, renderEffortOptions(profileForModels, effortPopup.value || '', { inheritLabel: t('schedules.launch.templateOrDefault'), model: _scheduleEditor.model || group?.model || template?.model, accountId }));
|
|
2011
2081
|
});
|
|
2012
2082
|
$('sched-ed-context')?.addEventListener('change', (e) => { _scheduleEditor.contextMode = e.target.value || null; });
|
|
2013
2083
|
$('sched-ed-account')?.addEventListener('change', (e) => {
|
|
@@ -2101,6 +2171,9 @@ function collectScheduleEditorDraft() {
|
|
|
2101
2171
|
enabled: $('sched-ed-enabled')?.checked ?? _scheduleEditor.enabled,
|
|
2102
2172
|
dayThemes,
|
|
2103
2173
|
});
|
|
2174
|
+
// Only from a row on screen: a hidden row (MoreLogin not in use) keeps what the draft holds.
|
|
2175
|
+
const mlChoice = readMoreLoginField('sched-ed-mlprofile');
|
|
2176
|
+
if (mlChoice) Object.assign(_scheduleEditor, mlChoice);
|
|
2104
2177
|
}
|
|
2105
2178
|
|
|
2106
2179
|
function markInvalid(id, message) {
|
|
@@ -2155,6 +2228,8 @@ async function saveScheduleFromEditor() {
|
|
|
2155
2228
|
|
|
2156
2229
|
collectScheduleEditorDraft(); // the day themes as shown, without the ones removed
|
|
2157
2230
|
const dayThemes = _scheduleEditor?.dayThemes || {};
|
|
2231
|
+
const moreloginEnvId = _scheduleEditor?.moreloginEnvId ? String(_scheduleEditor.moreloginEnvId) : null;
|
|
2232
|
+
const moreloginEnvName = moreloginEnvId ? (_scheduleEditor?.moreloginEnvName || null) : null;
|
|
2158
2233
|
let payload;
|
|
2159
2234
|
if (original) {
|
|
2160
2235
|
payload = {};
|
|
@@ -2166,6 +2241,13 @@ async function saveScheduleFromEditor() {
|
|
|
2166
2241
|
if (timezone !== shownZone) payload.timezone = timezone;
|
|
2167
2242
|
if (stableJson(dayThemes) !== stableJson(original.dayThemes || {})) payload.dayThemes = dayThemes;
|
|
2168
2243
|
for (const key of LAUNCH_FIELDS) if (!sameValue(launch[key], original[key])) payload[key] = launch[key];
|
|
2244
|
+
// The MoreLogin profile: sent when it changed (null goes back to the default of Settings → Browser).
|
|
2245
|
+
if (!sameValue(moreloginEnvId, original.moreloginEnvId)) {
|
|
2246
|
+
payload.moreloginEnvId = moreloginEnvId;
|
|
2247
|
+
payload.moreloginEnvName = moreloginEnvName;
|
|
2248
|
+
}
|
|
2249
|
+
// A save never approves what an agent changed (finding 3 of the re-review of 2026-11-11): it sends only what
|
|
2250
|
+
// changed, and the server keeps `taskBy` whatever it carries. The owner approves with the flag's Review button.
|
|
2169
2251
|
if (!Object.keys(payload).length) {
|
|
2170
2252
|
_scheduleEditor = null;
|
|
2171
2253
|
render({ frame: true });
|
|
@@ -2176,6 +2258,7 @@ async function saveScheduleFromEditor() {
|
|
|
2176
2258
|
} else {
|
|
2177
2259
|
payload = { name, templateId, cron, timezone, groupId, enabled, dayThemes };
|
|
2178
2260
|
for (const key of LAUNCH_FIELDS) if (launch[key] !== null) payload[key] = launch[key];
|
|
2261
|
+
if (moreloginEnvId) Object.assign(payload, { moreloginEnvId, moreloginEnvName });
|
|
2179
2262
|
}
|
|
2180
2263
|
|
|
2181
2264
|
// The save belongs to this editor: once answered, it closes only this one (an editor or a view
|
|
@@ -2225,6 +2308,14 @@ async function handleClick(e) {
|
|
|
2225
2308
|
case 'schedule-expand':
|
|
2226
2309
|
toggleExpanded(id, el);
|
|
2227
2310
|
break;
|
|
2311
|
+
case 'schedule-approve':
|
|
2312
|
+
// The owner's review of what an agent changed: the schedule and its template in one dialog (ui-automation-approval.js).
|
|
2313
|
+
openApprovalDialog({
|
|
2314
|
+
kind: 'schedule', id, opener: el,
|
|
2315
|
+
onApproved: () => { showToast(t('automationApproval.toast.approved')); loadData(); },
|
|
2316
|
+
onError: (message) => showToast(message),
|
|
2317
|
+
});
|
|
2318
|
+
break;
|
|
2228
2319
|
case 'group-collapse': {
|
|
2229
2320
|
const key = el.dataset.key;
|
|
2230
2321
|
if (!key) break;
|
|
@@ -2726,10 +2817,15 @@ async function saveGroupFromEditor(id) {
|
|
|
2726
2817
|
const panel = _panel;
|
|
2727
2818
|
const stillHere = () => !!draft && _panel === panel && _groupEditorDraft === draft;
|
|
2728
2819
|
|
|
2820
|
+
// The group's MoreLogin profile: read at launch by its schedules that have none of their own, never copied onto them.
|
|
2821
|
+
const moreloginEnvId = _groupEditorDraft?.moreloginEnvId ? String(_groupEditorDraft.moreloginEnvId) : null;
|
|
2822
|
+
const moreloginEnvName = moreloginEnvId ? (_groupEditorDraft?.moreloginEnvName || null) : null;
|
|
2823
|
+
|
|
2729
2824
|
if (!id) {
|
|
2730
2825
|
try {
|
|
2731
2826
|
const payload = { name, color, mutualExclusion };
|
|
2732
2827
|
for (const key of LAUNCH_FIELDS) if (launch[key] !== null) payload[key] = launch[key];
|
|
2828
|
+
if (moreloginEnvId) Object.assign(payload, { moreloginEnvId, moreloginEnvName });
|
|
2733
2829
|
const group = await createScheduleGroup(payload);
|
|
2734
2830
|
if (!_groups.some(g => g.id === group.id)) _groups.push(group);
|
|
2735
2831
|
showToast(t('schedules.toast.groupCreated'));
|
|
@@ -2758,6 +2854,7 @@ async function saveGroupFromEditor(id) {
|
|
|
2758
2854
|
// A new CLI: what the old one decided goes, explicitly (also what the group never set itself).
|
|
2759
2855
|
const cliChanged = !sameValue(launch.profile, existing.profile);
|
|
2760
2856
|
if (cliChanged) for (const key of CLI_DEPENDENT) payload[key] = launch[key];
|
|
2857
|
+
if (!sameValue(moreloginEnvId, existing.moreloginEnvId)) Object.assign(payload, { moreloginEnvId, moreloginEnvName });
|
|
2761
2858
|
if (!Object.keys(payload).length) {
|
|
2762
2859
|
_groupEditorId = null;
|
|
2763
2860
|
_groupEditorDraft = null;
|
|
@@ -3034,18 +3131,22 @@ async function createQuickTimerFromForm(runNow) {
|
|
|
3034
3131
|
const tools = strictToolHost(profile) ? readToolPicker($('sched-qt-mcp')) : null;
|
|
3035
3132
|
const codexAccountId = profile === 'codex' ? ($('sched-qt-account')?.value || _launchAccount || 'default') : undefined;
|
|
3036
3133
|
const usesBrowser = _qtUsesBrowser !== null ? _qtUsesBrowser : !!template?.usesBrowser;
|
|
3134
|
+
// The MoreLogin profile of this one run (none: the default of Settings → Browser).
|
|
3135
|
+
_qtMoreLogin = readMoreLoginField('sched-qt-mlprofile') || _qtMoreLogin;
|
|
3136
|
+
const moreloginEnvId = _qtMoreLogin.moreloginEnvId || undefined;
|
|
3137
|
+
const moreloginEnvName = moreloginEnvId ? (_qtMoreLogin.moreloginEnvName || undefined) : undefined;
|
|
3037
3138
|
try {
|
|
3038
3139
|
if (runNow) {
|
|
3039
3140
|
const result = await triggerQuickTimerNow(templateId, {
|
|
3040
|
-
profile, model, contextMode, effort, tools, usesBrowser, codexAccountId,
|
|
3141
|
+
profile, model, contextMode, effort, tools, usesBrowser, codexAccountId, moreloginEnvId, moreloginEnvName,
|
|
3041
3142
|
sidepanelWindowId: getNativeLoopRouterWindowId(),
|
|
3042
3143
|
sidepanelClaimToken: getNativeLoopRouterClaimToken(),
|
|
3043
3144
|
});
|
|
3044
3145
|
showToast(t('schedules.toast.runningNow', { name: result.templateName }));
|
|
3045
3146
|
} else {
|
|
3046
|
-
const result = await createQuickTimer(templateId, minutes, { profile, model, contextMode, effort, tools, usesBrowser, codexAccountId });
|
|
3147
|
+
const result = await createQuickTimer(templateId, minutes, { profile, model, contextMode, effort, tools, usesBrowser, codexAccountId, moreloginEnvId, moreloginEnvName });
|
|
3047
3148
|
if (!_quickTimers.some(t => t.id === result.timerId)) {
|
|
3048
|
-
_quickTimers.push({ id: result.timerId, templateId, templateName: result.templateName, firesAt: result.firesAt, minutes: result.minutes, profile: result.profile, model: result.model, contextMode: result.contextMode, effort: result.effort, tools: result.tools, usesBrowser: result.usesBrowser });
|
|
3149
|
+
_quickTimers.push({ id: result.timerId, templateId, templateName: result.templateName, firesAt: result.firesAt, minutes: result.minutes, profile: result.profile, model: result.model, contextMode: result.contextMode, effort: result.effort, tools: result.tools, usesBrowser: result.usesBrowser, moreloginEnvId: result.moreloginEnvId, moreloginEnvName: result.moreloginEnvName });
|
|
3049
3150
|
}
|
|
3050
3151
|
_selectedQtMinutes = null;
|
|
3051
3152
|
_panel?.querySelectorAll('[data-action="qt-select"]').forEach(chip => chip.setAttribute('aria-pressed', 'false'));
|
|
@@ -3202,7 +3303,7 @@ function setupSync() {
|
|
|
3202
3303
|
});
|
|
3203
3304
|
on('sync:quick-timer:set', (data) => {
|
|
3204
3305
|
if (data?.timerId && !_quickTimers.some(t => t.id === data.timerId)) {
|
|
3205
|
-
_quickTimers.push({ id: data.timerId, templateName: data.templateName, firesAt: data.firesAt, minutes: data.minutes, profile: data.profile, model: data.model, contextMode: data.contextMode, effort: data.effort, tools: data.tools, usesBrowser: data.usesBrowser });
|
|
3306
|
+
_quickTimers.push({ id: data.timerId, templateName: data.templateName, firesAt: data.firesAt, minutes: data.minutes, profile: data.profile, model: data.model, contextMode: data.contextMode, effort: data.effort, tools: data.tools, usesBrowser: data.usesBrowser, moreloginEnvId: data.moreloginEnvId, moreloginEnvName: data.moreloginEnvName });
|
|
3206
3307
|
if (_panel) { renderRail(); renderActiveTimersInto(); }
|
|
3207
3308
|
}
|
|
3208
3309
|
});
|
|
@@ -170,6 +170,9 @@ export function createStickyScrollController(container, options = {}) {
|
|
|
170
170
|
|
|
171
171
|
const controller = {
|
|
172
172
|
scrollToBottom,
|
|
173
|
+
// A single transcript container may host several tabs; restore each tab's
|
|
174
|
+
// following intent before its rows are replaced (and cancel stale frames).
|
|
175
|
+
setFollowing,
|
|
173
176
|
refresh: refreshPosition,
|
|
174
177
|
isFollowing: () => following,
|
|
175
178
|
setActive(next) {
|