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,5 +1,5 @@
|
|
|
1
1
|
import { migrateStoredTools } from './tool-list-storage.js';
|
|
2
|
-
import { wireDropdowns } from './cc-dropdown.js';
|
|
2
|
+
import { dropdownHTML, setDropdownItems, setDropdownValue, wireDropdowns } from './cc-dropdown.js';
|
|
3
3
|
import { configureToolPickerTranslation, toolPickerHTML, readToolPicker, updateToolPicker, taskToolHost as strictToolHost, toolWord } from './tool-list-picker.js';
|
|
4
4
|
// ═══════════════════════════════════════════
|
|
5
5
|
// SynaBun Neural Interface — Automation Studio
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
fetchCodexAccounts,
|
|
27
27
|
getCachedCodexAccounts,
|
|
28
28
|
getEffortLevelsForProfile,
|
|
29
|
+
getEffortLevelsKeeping,
|
|
29
30
|
getModelsForProfile,
|
|
30
31
|
isDynamicModelProfile,
|
|
31
32
|
migrateLaunchRecords,
|
|
@@ -77,9 +78,15 @@ import {
|
|
|
77
78
|
} from './api.js';
|
|
78
79
|
import { centeredInFrame, placementArea } from './app-frame.js';
|
|
79
80
|
import { noAccessHTML, refusalOfError } from './ui-owner-access.js';
|
|
81
|
+
import { openApprovalDialog } from './ui-automation-approval.js';
|
|
82
|
+
import { templateFlag } from './automation-approval-view.js';
|
|
83
|
+
import { moreLoginFieldHTML, readMoreLoginField, wireMoreLoginFields, ensureMoreLoginProfiles } from './morelogin-profile-field.js';
|
|
80
84
|
|
|
81
85
|
const $ = (id) => document.getElementById(id);
|
|
82
86
|
|
|
87
|
+
// A styled dropdown's choice (cc-dropdown.js entries): escaping is cc-dropdown's own.
|
|
88
|
+
const opt = (value, label, selected = false) => ({ value: value ?? '', label: String(label ?? ''), selected: !!selected });
|
|
89
|
+
|
|
83
90
|
// ── Module-local state ──
|
|
84
91
|
let _panel = null;
|
|
85
92
|
let _backdrop = null;
|
|
@@ -515,8 +522,8 @@ const PRESET_TEMPLATES = [
|
|
|
515
522
|
<input type="checkbox" data-key="useProjectStyleGuide" ${state.useProjectStyleGuide ? 'checked' : ''}>
|
|
516
523
|
${esc(t('styleguide.automationToggle'))}
|
|
517
524
|
</label>
|
|
518
|
-
<label
|
|
519
|
-
|
|
525
|
+
<label id="awiz-style-project-label" style="font-size:13px">${esc(t('styleguide.automationProject'))}</label>
|
|
526
|
+
${dropdownHTML('awiz-style-project', [], { labelledBy: 'awiz-style-project-label', inputAttrs: 'data-key="styleGuideProject"', attrs: 'style="font-size:13px;max-width:100%"' })}
|
|
520
527
|
<span class="awiz-hint" style="font-size:12px">${esc(t('styleguide.automationHelp'))}</span>
|
|
521
528
|
</div>
|
|
522
529
|
<div class="awiz-field">
|
|
@@ -929,6 +936,9 @@ function showLaunchInline(params) {
|
|
|
929
936
|
|
|
930
937
|
const iterCount = params.iterations || 10;
|
|
931
938
|
const timeCount = params.maxMinutes || 30;
|
|
939
|
+
// The MoreLogin profile of this one launch (morelogin-profile-field.js). Every dialog opens on the default of
|
|
940
|
+
// Settings → Browser: a profile is never carried over from the launch before.
|
|
941
|
+
ensureMoreLoginProfiles();
|
|
932
942
|
|
|
933
943
|
contentEl.innerHTML = `
|
|
934
944
|
<div class="as-launch-inline">
|
|
@@ -970,7 +980,7 @@ function showLaunchInline(params) {
|
|
|
970
980
|
</div>
|
|
971
981
|
</div>
|
|
972
982
|
<div class="as-launch-section" id="as-launch-context-section">
|
|
973
|
-
<label class="as-launch-label">Context</label>
|
|
983
|
+
<label class="as-launch-label" id="as-launch-context-label">Context</label>
|
|
974
984
|
${renderAutomationContextSelect(profile, currentModel, _launchContextMode, 'as-launch-context')}
|
|
975
985
|
</div>
|
|
976
986
|
<div class="as-launch-section" id="as-launch-effort-section" style="${profileSupportsEffort(profile) ? '' : 'display:none'}">
|
|
@@ -989,6 +999,7 @@ function showLaunchInline(params) {
|
|
|
989
999
|
${renderAccountChips(_launchAccount)}
|
|
990
1000
|
</div>
|
|
991
1001
|
</div>
|
|
1002
|
+
${moreLoginFieldHTML({ id: 'as-launch-mlprofile', value: '', context: 'run', variant: 'as', wrapClass: 'as-launch-section', dropdownClasses: 'as-select' })}
|
|
992
1003
|
<div class="as-launch-section as-launch-summary">
|
|
993
1004
|
<div class="as-launch-summary-row">
|
|
994
1005
|
<span class="as-launch-summary-key">Task</span>
|
|
@@ -1141,18 +1152,18 @@ function automationModels(profileId, selectedModel = null, accountId = _launchAc
|
|
|
1141
1152
|
automationModelOptions(profileId, getModelsForProfile(profileId, accountId)), selectedModel);
|
|
1142
1153
|
}
|
|
1143
1154
|
|
|
1144
|
-
function
|
|
1155
|
+
function automationContextEntries(profileId, model, mode, accountId = _launchAccount) {
|
|
1145
1156
|
const choices = automationContextOptions(profileId, model, getModelsForProfile(profileId, accountId));
|
|
1146
1157
|
const selected = mode || 'default';
|
|
1147
|
-
const
|
|
1158
|
+
const entries = choices.map((choice) => opt(choice.id, choice.label, selected === choice.id));
|
|
1148
1159
|
if (!choices.some((choice) => choice.id === selected)) {
|
|
1149
|
-
|
|
1160
|
+
entries.push(opt(selected, `${selected} (unavailable — choose another)`, true));
|
|
1150
1161
|
}
|
|
1151
|
-
return
|
|
1162
|
+
return entries;
|
|
1152
1163
|
}
|
|
1153
1164
|
|
|
1154
1165
|
function renderAutomationContextSelect(profileId, model, mode, id, accountId = _launchAccount) {
|
|
1155
|
-
return
|
|
1166
|
+
return dropdownHTML(id, automationContextEntries(profileId, model, mode, accountId), { classes: 'as-select', labelledBy: `${id}-label` });
|
|
1156
1167
|
}
|
|
1157
1168
|
|
|
1158
1169
|
function automationContextAvailable(profileId, model, mode, accountId = _launchAccount) {
|
|
@@ -1189,8 +1200,8 @@ function renderModelChips(profileId, selectedModel) {
|
|
|
1189
1200
|
function refreshManualContext(root) {
|
|
1190
1201
|
const field = root?.querySelector('#as-launch-context-section');
|
|
1191
1202
|
if (!field) return;
|
|
1192
|
-
field.innerHTML = `<label class="as-launch-label">Context</label>${renderAutomationContextSelect(_launchProfile, _launchModel, _launchContextMode, 'as-launch-context')}`;
|
|
1193
|
-
field.querySelector('
|
|
1203
|
+
field.innerHTML = `<label class="as-launch-label" id="as-launch-context-label">Context</label>${renderAutomationContextSelect(_launchProfile, _launchModel, _launchContextMode, 'as-launch-context')}`;
|
|
1204
|
+
field.querySelector('input')?.addEventListener('change', (event) => setLaunchContextMode(event.target.value));
|
|
1194
1205
|
}
|
|
1195
1206
|
|
|
1196
1207
|
function _escLaunch(s) {
|
|
@@ -1498,8 +1509,14 @@ async function confirmLaunch() {
|
|
|
1498
1509
|
const effort = normalizeEffortForProfile(_launchProfile, _launchEffort) || undefined;
|
|
1499
1510
|
const tools = strictToolHost(_launchProfile) ? _launchTools : undefined;
|
|
1500
1511
|
const codexAccountId = _launchProfile === 'codex' ? (_launchAccount || 'default') : undefined;
|
|
1512
|
+
// Read before the panel closes. None chosen (or the field not shown): the default of Settings → Browser.
|
|
1513
|
+
const moreLoginChoice = readMoreLoginField('as-launch-mlprofile');
|
|
1514
|
+
const moreloginEnvId = moreLoginChoice?.moreloginEnvId || undefined;
|
|
1515
|
+
const moreloginEnvName = moreloginEnvId ? (moreLoginChoice.moreloginEnvName || undefined) : undefined;
|
|
1501
1516
|
const params = {
|
|
1502
1517
|
..._pendingLaunchParams,
|
|
1518
|
+
moreloginEnvId,
|
|
1519
|
+
moreloginEnvName,
|
|
1503
1520
|
profile: _launchProfile,
|
|
1504
1521
|
model: _launchModel,
|
|
1505
1522
|
contextMode: _launchContextMode,
|
|
@@ -1535,6 +1552,8 @@ async function confirmLaunch() {
|
|
|
1535
1552
|
withSynabun,
|
|
1536
1553
|
tools: tools ?? (withSynabun ? getCachedToolCatalog()?.defaultTools ?? ['mcp:*'] : []),
|
|
1537
1554
|
browserProfile: (withSynabun && params.usesBrowser) ? true : undefined,
|
|
1555
|
+
moreloginEnvId: withSynabun ? moreloginEnvId : undefined,
|
|
1556
|
+
moreloginEnvName: withSynabun ? moreloginEnvName : undefined,
|
|
1538
1557
|
mode: agentSubmode,
|
|
1539
1558
|
iterations: agentSubmode === 'loop' ? agentIterations : 1,
|
|
1540
1559
|
maxMinutes: agentSubmode === 'loop' ? agentMaxMinutes : 30,
|
|
@@ -1563,7 +1582,9 @@ async function confirmLaunch() {
|
|
|
1563
1582
|
streamDisabled = cfgData.config?.screencast?.disabled !== false;
|
|
1564
1583
|
} catch {}
|
|
1565
1584
|
|
|
1566
|
-
|
|
1585
|
+
// A launch with a MoreLogin profile of its own never opens the default browser first: the server starts that
|
|
1586
|
+
// profile (a session opened here would be the default's, which the run may not use, and would stay open).
|
|
1587
|
+
if (!streamDisabled && !moreloginEnvId) {
|
|
1567
1588
|
showToast('Opening browser...');
|
|
1568
1589
|
const browserReady = new Promise((resolve) => {
|
|
1569
1590
|
const unsub = on('sync:browser:created', (data) => { unsub(); resolve(data?.sessionId || null); });
|
|
@@ -1575,7 +1596,7 @@ async function confirmLaunch() {
|
|
|
1575
1596
|
console.log('[AS] confirmLaunch: created dedicated browser session', dedicatedBrowserSessionId);
|
|
1576
1597
|
}
|
|
1577
1598
|
} else {
|
|
1578
|
-
console.log('[AS] confirmLaunch: stream disabled
|
|
1599
|
+
console.log('[AS] confirmLaunch: no client-side browser (stream disabled or a MoreLogin profile chosen): the server creates it');
|
|
1579
1600
|
}
|
|
1580
1601
|
}
|
|
1581
1602
|
|
|
@@ -1724,6 +1745,7 @@ async function openPanel(opts = {}) {
|
|
|
1724
1745
|
_dropdownAbort?.abort();
|
|
1725
1746
|
_dropdownAbort = new AbortController();
|
|
1726
1747
|
wireDropdowns(_panel, { signal: _dropdownAbort.signal });
|
|
1748
|
+
wireMoreLoginFields(_panel, { signal: _dropdownAbort.signal });
|
|
1727
1749
|
_panel.addEventListener('change', event => {
|
|
1728
1750
|
if (event.target.id === 'as-qt-tools') {
|
|
1729
1751
|
_launchTools = readToolPicker(event.target);
|
|
@@ -2430,6 +2452,18 @@ function renderView() {
|
|
|
2430
2452
|
|
|
2431
2453
|
// ── Sidebar ──
|
|
2432
2454
|
|
|
2455
|
+
// ── The flag of a template an agent changed or an import brought (finding 3 of the re-review of 2026-11-11) ──
|
|
2456
|
+
function templateFlagBit(tpl) {
|
|
2457
|
+
const flag = templateFlag(tpl, null, t);
|
|
2458
|
+
return flag ? ` \u00B7 <span class="aap-flag" data-tone="${flag.tone}" data-tooltip="${esc(flag.text)}">${esc(flag.short)}</span>` : '';
|
|
2459
|
+
}
|
|
2460
|
+
function templateApprovalNote(tpl) {
|
|
2461
|
+
const flag = templateFlag(tpl, null, t);
|
|
2462
|
+
if (!flag) return '';
|
|
2463
|
+
return `<div class="aap-flag-note" data-tone="${flag.tone}" role="note"><p>${esc(flag.text)}</p>
|
|
2464
|
+
<button type="button" class="aap-btn" data-action="template-approve" data-id="${esc(tpl.id)}">${esc(t('automationApproval.flag.review'))}</button></div>`;
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2433
2467
|
function renderSidebarItem(t, opts = {}) {
|
|
2434
2468
|
const active = _selected?.id === t.id ? ' active' : '';
|
|
2435
2469
|
const isPreset = t.id.startsWith('__preset_');
|
|
@@ -2439,7 +2473,7 @@ function renderSidebarItem(t, opts = {}) {
|
|
|
2439
2473
|
<div class="as-sidebar-icon">${icon(t.icon)}</div>
|
|
2440
2474
|
<div class="as-sidebar-info">
|
|
2441
2475
|
<div class="as-sidebar-name">${dot}${esc(t.name)}</div>
|
|
2442
|
-
<div class="as-sidebar-desc">${t.iterations}x \u00B7 ${t.maxMinutes}m${t.usesBrowser ? ' \u00B7 <span class="as-browser-dot"></span>' : ''}</div>
|
|
2476
|
+
<div class="as-sidebar-desc">${t.iterations}x \u00B7 ${t.maxMinutes}m${t.usesBrowser ? ' \u00B7 <span class="as-browser-dot"></span>' : ''}${templateFlagBit(t)}</div>
|
|
2443
2477
|
</div>
|
|
2444
2478
|
</div>`;
|
|
2445
2479
|
}
|
|
@@ -2652,6 +2686,7 @@ function renderDetailMain() {
|
|
|
2652
2686
|
</div>
|
|
2653
2687
|
|
|
2654
2688
|
<div class="as-detail-body">
|
|
2689
|
+
${isPreset ? '' : templateApprovalNote(t)}
|
|
2655
2690
|
<div class="as-detail-meta" id="as-detail-meta">
|
|
2656
2691
|
${buildDetailMeta(t, isPreset)}
|
|
2657
2692
|
</div>
|
|
@@ -2699,6 +2734,14 @@ function renderDetailMain() {
|
|
|
2699
2734
|
wireDetailView(isPreset);
|
|
2700
2735
|
}
|
|
2701
2736
|
|
|
2737
|
+
function folderEntries(folderId) {
|
|
2738
|
+
return [
|
|
2739
|
+
opt('', 'Unsorted', !folderId),
|
|
2740
|
+
...[..._folders].sort((a, b) => (a.order ?? 0) - (b.order ?? 0)).map(f => opt(f.id, f.name, f.id === folderId)),
|
|
2741
|
+
opt('__new__', '+ New folder…'),
|
|
2742
|
+
];
|
|
2743
|
+
}
|
|
2744
|
+
|
|
2702
2745
|
function buildDetailMeta(t, isPreset) {
|
|
2703
2746
|
const disabled = isPreset ? 'disabled readonly' : '';
|
|
2704
2747
|
const tProfile = t.profile || 'claude-code';
|
|
@@ -2755,16 +2798,9 @@ function buildDetailMeta(t, isPreset) {
|
|
|
2755
2798
|
</div>
|
|
2756
2799
|
${isPreset ? '' : `
|
|
2757
2800
|
<div class="as-field">
|
|
2758
|
-
<label>Folder</label>
|
|
2801
|
+
<label id="as-f-folder-label">Folder</label>
|
|
2759
2802
|
<div class="as-folder-picker" id="as-folder-picker">
|
|
2760
|
-
|
|
2761
|
-
<select class="as-input" id="as-f-folder-select">
|
|
2762
|
-
<option value=""${!t.folderId ? ' selected' : ''}>Unsorted</option>
|
|
2763
|
-
${[..._folders].sort((a, b) => (a.order ?? 0) - (b.order ?? 0)).map(f =>
|
|
2764
|
-
`<option value="${esc(f.id)}"${f.id === t.folderId ? ' selected' : ''}>${esc(f.name)}</option>`
|
|
2765
|
-
).join('')}
|
|
2766
|
-
<option value="__new__">+ New folder\u2026</option>
|
|
2767
|
-
</select>
|
|
2803
|
+
${dropdownHTML('as-f-folder', folderEntries(t.folderId), { labelledBy: 'as-f-folder-label' })}
|
|
2768
2804
|
</div>
|
|
2769
2805
|
</div>
|
|
2770
2806
|
`}
|
|
@@ -2802,28 +2838,22 @@ function buildDetailMeta(t, isPreset) {
|
|
|
2802
2838
|
</div>
|
|
2803
2839
|
<div class="as-runtime-row">
|
|
2804
2840
|
<div class="as-runtime-field">
|
|
2805
|
-
<label>CLI</label>
|
|
2806
|
-
|
|
2807
|
-
${CLI_PROFILES.map(p => `<option value="${esc(p.id)}"${p.id === tProfile ? ' selected' : ''}>${esc(p.label)} \u00B7 ${esc(p.desc)}</option>`).join('')}
|
|
2808
|
-
</select>
|
|
2841
|
+
<label id="as-f-profile-label">CLI</label>
|
|
2842
|
+
${dropdownHTML('as-f-profile', CLI_PROFILES.map(p => opt(p.id, `${p.label} \u00B7 ${p.desc}`, p.id === tProfile)), { classes: 'as-select', labelledBy: 'as-f-profile-label' })}
|
|
2809
2843
|
</div>
|
|
2810
2844
|
<div class="as-runtime-field">
|
|
2811
|
-
<label>Model</label>
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
: `<option value="">${esc(dynamicModelEmptyText(tProfile))}</option>`}
|
|
2816
|
-
</select>
|
|
2845
|
+
<label id="as-f-model-label">Model</label>
|
|
2846
|
+
${dropdownHTML('as-f-model', tModelsList.length
|
|
2847
|
+
? tModelsList.map(m => opt(modelSelectorValue(m), m.desc ? `${m.label} \u2014 ${m.desc}` : m.label, modelMatchesSelector(m, tModel)))
|
|
2848
|
+
: [opt('', dynamicModelEmptyText(tProfile), true)], { classes: 'as-select', labelledBy: 'as-f-model-label' })}
|
|
2817
2849
|
</div>
|
|
2818
2850
|
<div class="as-runtime-field">
|
|
2819
|
-
<label>Context</label>
|
|
2851
|
+
<label id="as-f-context-label">Context</label>
|
|
2820
2852
|
${renderAutomationContextSelect(tProfile, tModel, tContextMode, 'as-f-context', templateAccountId)}
|
|
2821
2853
|
</div>
|
|
2822
2854
|
<div class="as-runtime-field" id="as-f-effort-field" style="${profileSupportsEffort(tProfile) ? '' : 'display:none'}">
|
|
2823
|
-
<label>Think</label>
|
|
2824
|
-
|
|
2825
|
-
${getEffortLevelsForProfile(tProfile).map(e => `<option value="${esc(e.id)}"${e.id === tEffort ? ' selected' : ''}>${esc(e.label)} \u2014 ${esc(e.desc)}</option>`).join('')}
|
|
2826
|
-
</select>
|
|
2855
|
+
<label id="as-f-effort-label">Think</label>
|
|
2856
|
+
${dropdownHTML('as-f-effort', getEffortLevelsKeeping(tProfile, tEffort).map(e => opt(e.id, `${e.label} \u2014 ${e.desc}`, e.id === tEffort)), { classes: 'as-select', labelledBy: 'as-f-effort-label' })}
|
|
2827
2857
|
</div>
|
|
2828
2858
|
<div class="as-runtime-field" id="as-f-mcp-field">
|
|
2829
2859
|
<label>${toolWord('label')}</label>
|
|
@@ -3000,32 +3030,22 @@ function wireCategoryPicker(isPreset) {
|
|
|
3000
3030
|
|
|
3001
3031
|
function wireFolderPicker(isPreset) {
|
|
3002
3032
|
if (isPreset) return;
|
|
3003
|
-
const sel = $('as-f-folder-select');
|
|
3004
3033
|
const hidden = $('as-f-folder');
|
|
3005
|
-
if (!
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3034
|
+
if (!hidden) return;
|
|
3035
|
+
hidden.dataset.confirmed = hidden.value || '';
|
|
3036
|
+
hidden.addEventListener('change', async () => {
|
|
3037
|
+
if (hidden.value === '__new__') {
|
|
3038
|
+
// Revert to the last confirmed choice while the popover is up.
|
|
3039
|
+
setDropdownValue(hidden, hidden.dataset.confirmed || '');
|
|
3010
3040
|
const created = await promptCreateFolder();
|
|
3011
3041
|
if (created) {
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
if (!existingIds.has(created.id)) {
|
|
3015
|
-
const opt = document.createElement('option');
|
|
3016
|
-
opt.value = created.id;
|
|
3017
|
-
opt.textContent = created.name;
|
|
3018
|
-
// Insert before the "__new__" option
|
|
3019
|
-
const newOpt = Array.from(sel.options).find(o => o.value === '__new__');
|
|
3020
|
-
sel.insertBefore(opt, newOpt);
|
|
3021
|
-
}
|
|
3022
|
-
sel.value = created.id;
|
|
3023
|
-
hidden.value = created.id;
|
|
3042
|
+
setDropdownItems(hidden, folderEntries(created.id));
|
|
3043
|
+
hidden.dataset.confirmed = created.id;
|
|
3024
3044
|
markDirty();
|
|
3025
3045
|
}
|
|
3026
3046
|
return;
|
|
3027
3047
|
}
|
|
3028
|
-
hidden.
|
|
3048
|
+
hidden.dataset.confirmed = hidden.value;
|
|
3029
3049
|
markDirty();
|
|
3030
3050
|
});
|
|
3031
3051
|
}
|
|
@@ -3058,24 +3078,20 @@ function wireLaunchDefaults(isPreset) {
|
|
|
3058
3078
|
const models = automationModels(profileId, preferredId, templateAccountId);
|
|
3059
3079
|
const def = models.find(m => m.tier === 'default') || models[0];
|
|
3060
3080
|
const selectedId = preferredId && models.some(m => modelMatchesSelector(m, preferredId)) ? preferredId : modelSelectorValue(def);
|
|
3061
|
-
modelSel
|
|
3062
|
-
? models.map(m =>
|
|
3063
|
-
|
|
3064
|
-
).join('')
|
|
3065
|
-
: `<option value="">${esc(dynamicModelEmptyText(profileId))}</option>`;
|
|
3081
|
+
setDropdownItems(modelSel, models.length
|
|
3082
|
+
? models.map(m => opt(modelSelectorValue(m), m.desc ? `${m.label} \u2014 ${m.desc}` : m.label, modelMatchesSelector(m, selectedId)))
|
|
3083
|
+
: [opt('', dynamicModelEmptyText(profileId), true)]);
|
|
3066
3084
|
};
|
|
3067
3085
|
|
|
3068
3086
|
const renderContextOptions = (mode = contextSel?.value || 'default') => {
|
|
3069
|
-
if (contextSel) contextSel
|
|
3087
|
+
if (contextSel) setDropdownItems(contextSel, automationContextEntries(profileSel.value, modelSel?.value, mode, templateAccountId));
|
|
3070
3088
|
};
|
|
3071
3089
|
|
|
3072
3090
|
const renderEffortOptions = (profileId, preferredId) => {
|
|
3073
3091
|
if (!effortSel) return;
|
|
3074
|
-
const levels =
|
|
3092
|
+
const levels = getEffortLevelsKeeping(profileId, preferredId);
|
|
3075
3093
|
const selectedId = preferredId && levels.some(e => e.id === preferredId) ? preferredId : 'off';
|
|
3076
|
-
effortSel
|
|
3077
|
-
`<option value="${esc(e.id)}"${e.id === selectedId ? ' selected' : ''}>${esc(e.label)} \u2014 ${esc(e.desc)}</option>`
|
|
3078
|
-
).join('');
|
|
3094
|
+
setDropdownItems(effortSel, levels.map(e => opt(e.id, `${e.label} \u2014 ${e.desc}`, e.id === selectedId)));
|
|
3079
3095
|
};
|
|
3080
3096
|
|
|
3081
3097
|
const refreshDynamicModelOptionsIfNeeded = (profileId, preferredId) => {
|
|
@@ -3590,9 +3606,9 @@ function wireWizardStyleGuide(container) {
|
|
|
3590
3606
|
const state = _wizardState;
|
|
3591
3607
|
fetchStyleGuideProjects().then(projects => {
|
|
3592
3608
|
if (_wizardState !== state || !project.isConnected) return;
|
|
3593
|
-
project.innerHTML = projects.map(p => `<option value="${esc(p.path)}">${esc(p.label || p.path)}</option>`).join('');
|
|
3594
3609
|
const selected = projects.some(p => p.path === state.styleGuideProject) ? state.styleGuideProject : projects[0]?.path || '';
|
|
3595
|
-
project.
|
|
3610
|
+
setDropdownItems(project, projects.map(p => opt(p.path, p.label || p.path, p.path === selected)));
|
|
3611
|
+
state.styleGuideProject = selected;
|
|
3596
3612
|
if(state.useProjectStyleGuide) refreshWizardStyleGuide(state).then(updateWizardPreview).catch(err=>showToast(err.message));
|
|
3597
3613
|
}).catch(err=>showToast(err.message));
|
|
3598
3614
|
const update = () => { state.styleGuideProject = project.value; refreshWizardStyleGuide(state).then(updateWizardPreview).catch(err=>showToast(err.message)); };
|
|
@@ -3607,7 +3623,7 @@ function updateWizardPreview() {
|
|
|
3607
3623
|
|
|
3608
3624
|
function collectInputValues() {
|
|
3609
3625
|
if (!_panel) return;
|
|
3610
|
-
_panel.querySelectorAll('.awiz-step-content input[data-key], .awiz-step-content textarea[data-key]
|
|
3626
|
+
_panel.querySelectorAll('.awiz-step-content input[data-key], .awiz-step-content textarea[data-key]').forEach(input => {
|
|
3611
3627
|
_wizardState[input.dataset.key] = input.type === 'checkbox' ? input.checked : input.type === 'number' ? Number(input.value) : input.value;
|
|
3612
3628
|
});
|
|
3613
3629
|
_panel.querySelectorAll('.awiz-chips').forEach(group => {
|
|
@@ -3935,7 +3951,7 @@ function setupScheduleWebSocket() {
|
|
|
3935
3951
|
// Quick timer events
|
|
3936
3952
|
on('sync:quick-timer:set', (data) => {
|
|
3937
3953
|
if (data?.timerId && !_quickTimers.some(t => t.id === data.timerId)) {
|
|
3938
|
-
_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 });
|
|
3954
|
+
_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 });
|
|
3939
3955
|
if (_view === 'schedules') renderSchedulesMain();
|
|
3940
3956
|
}
|
|
3941
3957
|
});
|
|
@@ -4141,6 +4157,24 @@ async function handlePanelClick(e) {
|
|
|
4141
4157
|
break;
|
|
4142
4158
|
}
|
|
4143
4159
|
|
|
4160
|
+
case 'template-approve': {
|
|
4161
|
+
// The owner's review of instructions an agent wrote or an import brought (ui-automation-approval.js).
|
|
4162
|
+
openApprovalDialog({
|
|
4163
|
+
kind: 'template', id, opener: btn,
|
|
4164
|
+
onApproved: async () => {
|
|
4165
|
+
showToast(t('automationApproval.toast.approved'));
|
|
4166
|
+
try {
|
|
4167
|
+
_templates = migrateLaunchRecords(await fetchLoopTemplates());
|
|
4168
|
+
const updated = _templates.find(x => x.id === id);
|
|
4169
|
+
if (updated && _selected?.id === id) _selected = updated;
|
|
4170
|
+
} catch { /* the next load shows it */ }
|
|
4171
|
+
renderView();
|
|
4172
|
+
},
|
|
4173
|
+
onError: (message) => showToast(message),
|
|
4174
|
+
});
|
|
4175
|
+
break;
|
|
4176
|
+
}
|
|
4177
|
+
|
|
4144
4178
|
case 'export-one': {
|
|
4145
4179
|
const tpl = _templates.find(t => t.id === id);
|
|
4146
4180
|
if (tpl) downloadJson({ version: 1, type: 'synabun-loop-template', template: tpl }, `loop-${tpl.name.toLowerCase().replace(/\s+/g, '-')}.json`);
|
|
@@ -4338,7 +4372,7 @@ async function handlePanelClick(e) {
|
|
|
4338
4372
|
storage.setItem('as-launch-model', _launchModel);
|
|
4339
4373
|
setLaunchContextMode('default');
|
|
4340
4374
|
const contextSelect = $('as-qt-context');
|
|
4341
|
-
if (contextSelect) contextSelect
|
|
4375
|
+
if (contextSelect) setDropdownItems(contextSelect, automationContextEntries(_launchProfile, _launchModel, _launchContextMode));
|
|
4342
4376
|
// Update visual selection inline (avoid full re-render)
|
|
4343
4377
|
$('as-qt-models')?.querySelectorAll('.as-launch-model').forEach(b => b.classList.remove('active'));
|
|
4344
4378
|
btn.classList.add('active');
|
|
@@ -4396,11 +4430,13 @@ async function handlePanelClick(e) {
|
|
|
4396
4430
|
const qtEffort = normalizeEffortForProfile(qtProfile, _launchEffort) || undefined;
|
|
4397
4431
|
const qtTools = strictToolHost(qtProfile) ? readToolPicker($('as-qt-tools')) : undefined;
|
|
4398
4432
|
const qtAccount = qtProfile === 'codex' ? (_launchAccount || 'default') : undefined;
|
|
4433
|
+
const qtMoreLogin = readMoreLoginField('as-qt-mlprofile');
|
|
4434
|
+
const qtMoreLoginId = qtMoreLogin?.moreloginEnvId || undefined;
|
|
4399
4435
|
try {
|
|
4400
|
-
const result = await createQuickTimer(templateId, mins, { profile: qtProfile, model: qtModel, contextMode: qtContextMode, usesBrowser: qtBrowser, effort: qtEffort, tools: qtTools, codexAccountId: qtAccount });
|
|
4436
|
+
const result = await createQuickTimer(templateId, mins, { profile: qtProfile, model: qtModel, contextMode: qtContextMode, usesBrowser: qtBrowser, effort: qtEffort, tools: qtTools, codexAccountId: qtAccount, moreloginEnvId: qtMoreLoginId, moreloginEnvName: qtMoreLoginId ? (qtMoreLogin.moreloginEnvName || undefined) : undefined });
|
|
4401
4437
|
// Guard: WebSocket sync:quick-timer:set may arrive before this HTTP response
|
|
4402
4438
|
if (!_quickTimers.some(t => t.id === result.timerId)) {
|
|
4403
|
-
_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 });
|
|
4439
|
+
_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 });
|
|
4404
4440
|
}
|
|
4405
4441
|
_selectedQtMinutes = null;
|
|
4406
4442
|
_qtUsesBrowser = null;
|
|
@@ -4423,8 +4459,12 @@ async function handlePanelClick(e) {
|
|
|
4423
4459
|
const qtEffort = normalizeEffortForProfile(qtProfile, _launchEffort) || undefined;
|
|
4424
4460
|
const qtTools = strictToolHost(qtProfile) ? readToolPicker($('as-qt-tools')) : undefined;
|
|
4425
4461
|
const qtAccount = qtProfile === 'codex' ? (_launchAccount || 'default') : undefined;
|
|
4462
|
+
const qtMoreLogin = readMoreLoginField('as-qt-mlprofile');
|
|
4463
|
+
const qtMoreLoginId = qtMoreLogin?.moreloginEnvId || undefined;
|
|
4426
4464
|
try {
|
|
4427
4465
|
const result = await triggerQuickTimerNow(templateId, {
|
|
4466
|
+
moreloginEnvId: qtMoreLoginId,
|
|
4467
|
+
moreloginEnvName: qtMoreLoginId ? (qtMoreLogin.moreloginEnvName || undefined) : undefined,
|
|
4428
4468
|
profile: qtProfile,
|
|
4429
4469
|
model: qtModel,
|
|
4430
4470
|
contextMode: qtContextMode,
|
|
@@ -4577,7 +4617,7 @@ function wireChipEvents(container) {
|
|
|
4577
4617
|
}
|
|
4578
4618
|
|
|
4579
4619
|
function wireInputSync(container) {
|
|
4580
|
-
container.querySelectorAll('.awiz-step-content input[data-key], .awiz-step-content textarea[data-key]
|
|
4620
|
+
container.querySelectorAll('.awiz-step-content input[data-key], .awiz-step-content textarea[data-key]').forEach(input => {
|
|
4581
4621
|
input.addEventListener('input', () => {
|
|
4582
4622
|
_wizardState[input.dataset.key] = input.type === 'checkbox' ? input.checked : input.type === 'number' ? Number(input.value) : input.value;
|
|
4583
4623
|
});
|
|
@@ -4703,7 +4743,7 @@ function renderSchedulesMain() {
|
|
|
4703
4743
|
const profileLabel = CLI_PROFILES.find(p => p.id === qt.profile)?.label || qt.profile || 'Claude Code';
|
|
4704
4744
|
const modelObj = qt.model ? getModelsForProfile(qt.profile || 'claude-code').find(m => modelMatchesSelector(m, qt.model)) : null;
|
|
4705
4745
|
const modelLabel = modelObj?.label || (qt.profile === 'opencode' ? qt.model : '');
|
|
4706
|
-
const metaParts = [profileLabel, modelLabel, qt.contextMode && qt.contextMode !== 'default' ? `context:${qt.contextMode}` : '', qt.effort ? `think:${qt.effort}` : '', qt.tools ? `${toolWord('label')}: ${qt.tools.join(', ')}` : '', qt.usesBrowser ? 'Browser' : ''].filter(Boolean);
|
|
4746
|
+
const metaParts = [profileLabel, modelLabel, qt.contextMode && qt.contextMode !== 'default' ? `context:${qt.contextMode}` : '', qt.effort ? `think:${qt.effort}` : '', qt.tools ? `${toolWord('label')}: ${qt.tools.join(', ')}` : '', qt.usesBrowser ? 'Browser' : '', qt.moreloginEnvId ? t('schedules.overrides.morelogin', { value: qt.moreloginEnvName || qt.moreloginEnvId }) : ''].filter(Boolean);
|
|
4707
4747
|
timerCards += `
|
|
4708
4748
|
<div class="as-qt-active-card">
|
|
4709
4749
|
<div class="as-qt-active-pulse"></div>
|
|
@@ -4721,9 +4761,10 @@ function renderSchedulesMain() {
|
|
|
4721
4761
|
// ── Quick Timer Creator ──
|
|
4722
4762
|
const selectedTpl = $('as-qt-template')?.value || '';
|
|
4723
4763
|
const customMinutes = $('as-qt-custom-min')?.value || '';
|
|
4724
|
-
const
|
|
4725
|
-
|
|
4726
|
-
|
|
4764
|
+
const templateEntries = [
|
|
4765
|
+
opt('', 'Select template...', !selectedTpl),
|
|
4766
|
+
...allTemplates.map(t => opt(t.id, t.name, selectedTpl === t.id)),
|
|
4767
|
+
];
|
|
4727
4768
|
|
|
4728
4769
|
const qtPresetButtons = [
|
|
4729
4770
|
{ minutes: 5, label: '5m' }, { minutes: 15, label: '15m' }, { minutes: 30, label: '30m' },
|
|
@@ -4787,12 +4828,12 @@ function renderSchedulesMain() {
|
|
|
4787
4828
|
const selectedTemplate = selectedTpl ? allTemplates.find(t => t.id === selectedTpl) : null;
|
|
4788
4829
|
const qtBrowserDefault = _qtUsesBrowser !== null ? _qtUsesBrowser : (selectedTemplate ? !!selectedTemplate.usesBrowser : false);
|
|
4789
4830
|
|
|
4831
|
+
// The timer's MoreLogin profile: the field keeps what it shows when the form is drawn again (value left out).
|
|
4832
|
+
ensureMoreLoginProfiles();
|
|
4833
|
+
|
|
4790
4834
|
const qtCreatorHTML = `
|
|
4791
4835
|
<div class="as-qt-creator">
|
|
4792
|
-
|
|
4793
|
-
<option value="">Select template...</option>
|
|
4794
|
-
${templateOptions}
|
|
4795
|
-
</select>
|
|
4836
|
+
${dropdownHTML('as-qt-template', templateEntries, { classes: 'as-qt-select', label: 'Select template' })}
|
|
4796
4837
|
<div class="as-qt-group">
|
|
4797
4838
|
<span class="as-launch-label">CLI</span>
|
|
4798
4839
|
<div class="as-launch-profiles" id="as-qt-profiles">${qtProfileChips}</div>
|
|
@@ -4802,7 +4843,7 @@ function renderSchedulesMain() {
|
|
|
4802
4843
|
<div class="as-launch-models" id="as-qt-models">${qtModelChips}</div>
|
|
4803
4844
|
</div>
|
|
4804
4845
|
<div class="as-qt-group">
|
|
4805
|
-
<span class="as-launch-label">Context</span>
|
|
4846
|
+
<span class="as-launch-label" id="as-qt-context-label">Context</span>
|
|
4806
4847
|
${renderAutomationContextSelect(qtProfile, qtCurrentModel, _launchContextMode, 'as-qt-context')}
|
|
4807
4848
|
</div>
|
|
4808
4849
|
<div class="as-qt-group" id="as-qt-effort-section" style="${profileSupportsEffort(qtProfile) ? '' : 'display:none'}">
|
|
@@ -4822,6 +4863,7 @@ function renderSchedulesMain() {
|
|
|
4822
4863
|
<span class="as-qt-browser-label">Uses browser</span>
|
|
4823
4864
|
</label>
|
|
4824
4865
|
</div>
|
|
4866
|
+
${moreLoginFieldHTML({ id: 'as-qt-mlprofile', context: 'run', variant: 'as', wrapClass: 'as-qt-group', dropdownClasses: 'as-qt-select' })}
|
|
4825
4867
|
<div class="as-qt-group">
|
|
4826
4868
|
<span class="as-launch-label">Timer</span>
|
|
4827
4869
|
<div class="as-qt-presets">${qtPresetButtons}
|
|
@@ -4935,7 +4977,7 @@ function renderSchedulesMain() {
|
|
|
4935
4977
|
storage.setItem('as-launch-model', _launchModel);
|
|
4936
4978
|
setLaunchContextMode('default');
|
|
4937
4979
|
const contextSelect = $('as-qt-context');
|
|
4938
|
-
if (contextSelect) contextSelect
|
|
4980
|
+
if (contextSelect) setDropdownItems(contextSelect, automationContextEntries(_launchProfile, _launchModel, _launchContextMode));
|
|
4939
4981
|
});
|
|
4940
4982
|
}
|
|
4941
4983
|
$('as-qt-context')?.addEventListener('change', (event) => setLaunchContextMode(event.target.value));
|
|
@@ -4957,9 +4999,7 @@ function renderScheduleEditorMain() {
|
|
|
4957
4999
|
</div>
|
|
4958
5000
|
</div>`).join('');
|
|
4959
5001
|
|
|
4960
|
-
const
|
|
4961
|
-
`<option value="${esc(t.id)}"${(s?.templateId === t.id) ? ' selected' : ''}>${esc(t.name)} (${esc(t.category)})</option>`
|
|
4962
|
-
).join('');
|
|
5002
|
+
const templateEntries = allTemplates.map(t => opt(t.id, `${t.name} (${t.category})`, s?.templateId === t.id));
|
|
4963
5003
|
|
|
4964
5004
|
// Reorder: Mon(1)–Sat(6) then Sun(0) so 2-column grid pairs weekdays nicely
|
|
4965
5005
|
const dayOrder = [1, 2, 3, 4, 5, 6, 0];
|
|
@@ -4989,8 +5029,8 @@ function renderScheduleEditorMain() {
|
|
|
4989
5029
|
<input type="text" id="as-sched-name" placeholder="e.g. Morning Social Post" value="${esc(s?.name || '')}" />
|
|
4990
5030
|
</div>
|
|
4991
5031
|
<div class="as-sched-field as-sched-field--flex">
|
|
4992
|
-
<label>Template</label>
|
|
4993
|
-
|
|
5032
|
+
<label id="as-sched-template-label">Template</label>
|
|
5033
|
+
${dropdownHTML('as-sched-template', templateEntries, { labelledBy: 'as-sched-template-label' })}
|
|
4994
5034
|
</div>
|
|
4995
5035
|
</div>
|
|
4996
5036
|
|
|
@@ -27,7 +27,7 @@ import { requestGeneratedSessionTitle } from './session-title.js';
|
|
|
27
27
|
import { wireFileLinks } from './ui-file-links.js';
|
|
28
28
|
import { WORKER_END_CLASS, backToAssistant, buildWorkerEndCard, endWorkerRunOnClose, forgetWorkerEnd, trackWorkerEnd, updateWorkerEndBusy } from './ui-worker-end.js';
|
|
29
29
|
import { isDispatchedRun, isEndOfRunAbort, workerEndView } from './worker-end.js';
|
|
30
|
-
import { runAwaitsAnswer } from './sidepanel-session-status.js';
|
|
30
|
+
import { runAwaitsAnswer, runTurnLive } from './sidepanel-session-status.js';
|
|
31
31
|
// ── cp/ feature modules (SDK-engine CLI parity: diffs, agents, bash, perms, statusline) ──
|
|
32
32
|
import { setCpCtx } from './cp/cp-ctx.js';
|
|
33
33
|
import { buildDiffCard, buildDiffPreviewEl, finalizeDiffCard } from './cp/cp-diff.js';
|
|
@@ -3490,6 +3490,31 @@ function _loadHistoryIfWorking(tab, saved) {
|
|
|
3490
3490
|
loadSessionHistory(tab.sessionId, tab.messagesEl);
|
|
3491
3491
|
}
|
|
3492
3492
|
|
|
3493
|
+
// A tab restored as owned by a live run: the run may have ended while this window was away, and the router
|
|
3494
|
+
// brings back only recent ended runs (ui-native-loop-router.js reconcileRuns: the last day, ten at most), so
|
|
3495
|
+
// such a tab would say "owned by a running automation" for good. The run's own record decides: an ended run
|
|
3496
|
+
// (or one the server no longer keeps) frees the tab (not working, not owned, its pill at rest) and gets its
|
|
3497
|
+
// end card; a live one is the router's, whose attach does the same when the run ends.
|
|
3498
|
+
async function _settleRestoredAutomation(tab) {
|
|
3499
|
+
const runId = tab?.automationRunId;
|
|
3500
|
+
if (!runId) return;
|
|
3501
|
+
let run = null;
|
|
3502
|
+
try {
|
|
3503
|
+
const response = await fetch(`/api/sidepanel-runs/${encodeURIComponent(runId)}`);
|
|
3504
|
+
if (response.status === 404) run = { runId, missing: true };
|
|
3505
|
+
else if (response.ok) run = (await response.json())?.run || null;
|
|
3506
|
+
} catch {}
|
|
3507
|
+
if (!run || tab.closed || tab.automationRunId !== runId || tab._automationHydrated) return;
|
|
3508
|
+
if (!run.missing && (run.status === 'starting' || run.status === 'running' || run.status === 'suspended')) return;
|
|
3509
|
+
tab.automationActive = false;
|
|
3510
|
+
tab.automationAwaits = false;
|
|
3511
|
+
if (tab.running) finishTab(tab, true); else updatePillRunning(tab);
|
|
3512
|
+
if (!run.missing) trackWorkerEnd(run, { apply: (view) => showWorkerEnd(tab, view) });
|
|
3513
|
+
if (tab === activeTab()) populateModeDropdown(_panel?.querySelector('#cp-mode'), tab);
|
|
3514
|
+
renderPills();
|
|
3515
|
+
saveTabs();
|
|
3516
|
+
}
|
|
3517
|
+
|
|
3493
3518
|
function restoreTabs() {
|
|
3494
3519
|
_cleanStaleWindows();
|
|
3495
3520
|
const pickRestoredTabIdx = (activeIdx) => {
|
|
@@ -3530,6 +3555,7 @@ function restoreTabs() {
|
|
|
3530
3555
|
if (t && saved.automationRunId) t.automationOwnerId = saved.automationOwnerId || null;
|
|
3531
3556
|
if (t && saved.releasedRunId && !saved.automationRunId) t.releasedRunId = saved.releasedRunId;
|
|
3532
3557
|
if (t) _loadHistoryIfWorking(t, saved);
|
|
3558
|
+
if (t && saved.automationRunId && saved.automationActive) _settleRestoredAutomation(t);
|
|
3533
3559
|
}
|
|
3534
3560
|
if (_tabs.length) {
|
|
3535
3561
|
switchTab(pickRestoredTabIdx(data.activeIdx));
|
|
@@ -5011,6 +5037,8 @@ function loadSessionHistory(sid, $msgs) {
|
|
|
5011
5037
|
if (!ownerTab) return;
|
|
5012
5038
|
ownerTab._historyHold = Math.max(0, (ownerTab._historyHold || 1) - 1);
|
|
5013
5039
|
if (!ownerTab._historyHold && ownerTab._msgBuffer?.length && !ownerTab.closed) _flushMsgBuffer(ownerTab);
|
|
5040
|
+
// The transcript was drawn again: the end card of a dispatched worker (the last row) goes back under it.
|
|
5041
|
+
if (!ownerTab._historyHold) placeWorkerEnd(ownerTab);
|
|
5014
5042
|
});
|
|
5015
5043
|
}
|
|
5016
5044
|
|
|
@@ -10792,7 +10820,14 @@ export async function attachClaudeAutomation(run, { focus = !!run?.focus, isCanc
|
|
|
10792
10820
|
tab.effort = run.effort || tab.effort;
|
|
10793
10821
|
// A warm worker whose turn ended on a question needs you, like one with a card up (setRunning repaints).
|
|
10794
10822
|
tab.automationAwaits = runAwaitsAnswer(run);
|
|
10795
|
-
|
|
10823
|
+
// Whether a turn is in progress is the run's word (runTurnLive): a warm worker between turns is alive, not
|
|
10824
|
+
// working, and a run that ended works no more. A tab still showing a turn the run says is over ends it here
|
|
10825
|
+
// (finishTab: the spinner, the thinking row, the stream, the statusline), whether or not that turn's result
|
|
10826
|
+
// event ever reached this window; the run's own events keep it at work only while the run says so.
|
|
10827
|
+
const working = runTurnLive(run);
|
|
10828
|
+
if (working) setRunning(tab, true);
|
|
10829
|
+
else if (tab.running) finishTab(tab, true);
|
|
10830
|
+
else setRunning(tab, false);
|
|
10796
10831
|
updatePillLabel(tab);
|
|
10797
10832
|
tab._automationIteration = run.currentIteration;
|
|
10798
10833
|
// Resumed after a server restart: what the run did while this window was away (the continuation prompt, its first
|
|
@@ -10835,6 +10870,8 @@ export async function attachClaudeAutomation(run, { focus = !!run?.focus, isCanc
|
|
|
10835
10870
|
},
|
|
10836
10871
|
});
|
|
10837
10872
|
trackWorkerEnd(run, { apply: (view) => showWorkerEnd(tab, view), busy: hasLiveBackgroundWork(tab) });
|
|
10873
|
+
// (The card is drawn only when what it says changes: a transcript read again meanwhile gets it back.)
|
|
10874
|
+
placeWorkerEnd(tab);
|
|
10838
10875
|
// The mode control is hidden while the run is active and back when it ended.
|
|
10839
10876
|
if (tab === activeTab()) populateModeDropdown(_panel?.querySelector('#cp-mode'), tab);
|
|
10840
10877
|
const idx = _tabs.indexOf(tab);
|
|
@@ -10984,6 +11021,17 @@ function showWorkerEnd(tab, view) {
|
|
|
10984
11021
|
if (tab === activeTab()) scrollEnd(true);
|
|
10985
11022
|
}
|
|
10986
11023
|
|
|
11024
|
+
// The card is drawn once per change of what it says (ui-worker-end.js), and a transcript read again
|
|
11025
|
+
// meanwhile (a reconnect, a resume after a server restart) drops it with the rest: put it back, as the last
|
|
11026
|
+
// row, from what the tab keeps of it. Nothing happens for a tab without a card or with its card in place.
|
|
11027
|
+
function placeWorkerEnd(tab) {
|
|
11028
|
+
const view = tab?._workerEnd;
|
|
11029
|
+
const $msgs = tab?.messagesEl;
|
|
11030
|
+
if (!view || !$msgs || tab.closed) return;
|
|
11031
|
+
if ($msgs.querySelector(`.${WORKER_END_CLASS}`)) return;
|
|
11032
|
+
showWorkerEnd(tab, view);
|
|
11033
|
+
}
|
|
11034
|
+
|
|
10987
11035
|
// The user sends a message of their own in the tab of a run that ended (Codex's
|
|
10988
11036
|
// releaseAutomationForManualUse): the run's end card goes, the tab stops following
|
|
10989
11037
|
// the run, and the router leaves the run alone, so nothing of it comes back here.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════
|
|
2
|
+
// SynaBun — Maritaca Panel (barrel re-export)
|
|
3
|
+
// The Maritaca side panel's entry point: one stable surface for the shared UI modules (navbar, tray, detached
|
|
4
|
+
// session windows). Implementation lives in ./mtc/.
|
|
5
|
+
// ═══════════════════════════════════════════
|
|
6
|
+
|
|
7
|
+
export {
|
|
8
|
+
toggleMaritacaPanel,
|
|
9
|
+
isMaritacaPanelOpen,
|
|
10
|
+
bootMaritacaPanel,
|
|
11
|
+
openMaritacaWithPrompt,
|
|
12
|
+
maritacaPanelDefaults,
|
|
13
|
+
endHostedMaritacaSessions,
|
|
14
|
+
maritacaPanelDebug,
|
|
15
|
+
} from './mtc/mtc-panel.js';
|