synabun 2.2.1 → 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 +53 -0
- package/README.md +1 -1
- package/docs/whatsapp.md +52 -20
- package/hooks/claude-code/pre-websearch.mjs +4 -1
- package/hooks/claude-code/prompt-submit.mjs +7 -0
- package/lib/mcp-build.js +519 -0
- package/lib/mcp-dist.js +10 -4
- package/lib/release-scan.mjs +23 -10
- package/lib/server-supervisor.js +7 -1
- package/lib/virustotal.mjs +146 -40
- package/mcp-server/dist/http.d.ts +57 -0
- package/mcp-server/dist/http.d.ts.map +1 -1
- package/mcp-server/dist/http.js +128 -18
- package/mcp-server/dist/http.js.map +1 -1
- package/mcp-server/dist/index.d.ts.map +1 -1
- package/mcp-server/dist/index.js +14 -9
- package/mcp-server/dist/index.js.map +1 -1
- package/mcp-server/dist/services/browser-route-flow.d.ts +119 -0
- package/mcp-server/dist/services/browser-route-flow.d.ts.map +1 -0
- package/mcp-server/dist/services/browser-route-flow.js +340 -0
- package/mcp-server/dist/services/browser-route-flow.js.map +1 -0
- package/mcp-server/dist/services/desktop-client.js +2 -2
- package/mcp-server/dist/services/desktop-client.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/identity.d.ts +66 -3
- package/mcp-server/dist/services/identity.d.ts.map +1 -1
- package/mcp-server/dist/services/identity.js +61 -4
- package/mcp-server/dist/services/identity.js.map +1 -1
- package/mcp-server/dist/services/neural-interface.d.ts +133 -1
- package/mcp-server/dist/services/neural-interface.d.ts.map +1 -1
- package/mcp-server/dist/services/neural-interface.js +630 -64
- 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/bluesky.d.ts +20 -7
- package/mcp-server/dist/tools/bluesky.d.ts.map +1 -1
- package/mcp-server/dist/tools/bluesky.js +147 -45
- package/mcp-server/dist/tools/bluesky.js.map +1 -1
- package/mcp-server/dist/tools/browser-advanced.d.ts +13 -2
- package/mcp-server/dist/tools/browser-advanced.d.ts.map +1 -1
- package/mcp-server/dist/tools/browser-advanced.js +153 -18
- package/mcp-server/dist/tools/browser-advanced.js.map +1 -1
- package/mcp-server/dist/tools/browser-cheatsheet.d.ts +2 -0
- package/mcp-server/dist/tools/browser-cheatsheet.d.ts.map +1 -1
- package/mcp-server/dist/tools/browser-cheatsheet.js +3 -0
- package/mcp-server/dist/tools/browser-cheatsheet.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 +82 -19
- package/mcp-server/dist/tools/morelogin.js.map +1 -1
- package/mcp-server/dist/tools/skill-tools.d.ts +4 -4
- package/mcp-server/dist/tools/youtube/helpers.d.ts +1 -0
- package/mcp-server/dist/tools/youtube/helpers.d.ts.map +1 -1
- package/mcp-server/dist/tools/youtube/helpers.js +1 -1
- package/mcp-server/dist/tools/youtube/helpers.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 +135 -17
- package/mcp-server/src/index.ts +15 -9
- package/mcp-server/src/services/browser-route-flow.ts +403 -0
- package/mcp-server/src/services/desktop-client.ts +2 -2
- package/mcp-server/src/services/embedding-service.ts +2 -1
- package/mcp-server/src/services/identity.ts +80 -4
- package/mcp-server/src/services/neural-interface.ts +648 -73
- package/mcp-server/src/services/tool-catalog.ts +2 -2
- package/mcp-server/src/tools/agents.ts +8 -4
- package/mcp-server/src/tools/bluesky.ts +164 -51
- package/mcp-server/src/tools/browser-advanced.ts +142 -17
- package/mcp-server/src/tools/browser-cheatsheet.ts +3 -0
- 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 +82 -19
- package/mcp-server/src/tools/youtube/helpers.ts +2 -2
- package/mcp-server/src/tools/youtube/upload.ts +218 -99
- package/neural-interface/i18n/en.json +655 -123
- package/neural-interface/i18n/pt-BR.json +542 -10
- package/neural-interface/lib/assistant-api.js +90 -23
- package/neural-interface/lib/assistant-brains/claude.js +5 -0
- package/neural-interface/lib/assistant-catalog.js +134 -3
- package/neural-interface/lib/assistant-dispatch.js +97 -1
- package/neural-interface/lib/assistant-persona.js +15 -7
- package/neural-interface/lib/assistant-router.js +6 -4
- package/neural-interface/lib/assistant-runtime.js +18 -1
- package/neural-interface/lib/assistant-task-prompt.js +5 -0
- package/neural-interface/lib/assistant-tools.js +10 -1
- 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-automation-routes.js +84 -0
- package/neural-interface/lib/browser-background-tab.js +72 -3
- package/neural-interface/lib/browser-execution.js +16 -3
- package/neural-interface/lib/browser-extraction.js +106 -45
- package/neural-interface/lib/browser-owner.js +48 -0
- package/neural-interface/lib/browser-profile-choices.js +143 -0
- package/neural-interface/lib/browser-profiles.js +142 -0
- package/neural-interface/lib/browser-session-close.js +84 -0
- package/neural-interface/lib/browser-start-handoff.js +202 -0
- package/neural-interface/lib/browser-tab-recovery.js +153 -0
- package/neural-interface/lib/browser-tool-policy.js +23 -4
- package/neural-interface/lib/browser-wedge-retire.js +64 -0
- package/neural-interface/lib/chromium-on-device-model.js +67 -0
- package/neural-interface/lib/claude-agent-bridge.js +43 -5
- package/neural-interface/lib/claude-background-hold.js +239 -0
- package/neural-interface/lib/claude-model-catalog.js +12 -0
- package/neural-interface/lib/effort-levels.js +28 -2
- package/neural-interface/lib/exec-loop-command.js +8 -0
- package/neural-interface/lib/http-guards.js +11 -6
- 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 +31 -5
- 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/mcp-external-servers.js +37 -10
- 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 +124 -11
- package/neural-interface/lib/native-loop-runtime.js +112 -11
- package/neural-interface/lib/owner-authority.js +137 -43
- package/neural-interface/lib/page-session.js +111 -27
- package/neural-interface/lib/peer-identity.js +263 -43
- package/neural-interface/lib/provider-panel-api-key-auth.js +7 -2
- package/neural-interface/lib/pty-host/core.js +36 -0
- package/neural-interface/lib/pty-host/protocol.js +2 -0
- package/neural-interface/lib/request-gate.js +2 -0
- package/neural-interface/lib/skills/api-v2.js +13 -2
- package/neural-interface/lib/skills/creation-api.js +3 -1
- package/neural-interface/lib/skills/evals-api.js +5 -1
- package/neural-interface/lib/social-write-pacing.js +151 -0
- package/neural-interface/lib/system-activity.js +1 -1
- package/neural-interface/lib/terminal-token-redaction.js +293 -0
- package/neural-interface/lib/terminal-tokens.js +436 -0
- package/neural-interface/lib/worker-mcp-channel.js +45 -10
- 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/agy/agy-render.js +41 -1
- package/neural-interface/public/shared/agy/agy-styles.js +5 -0
- package/neural-interface/public/shared/api.js +5 -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-computer.js +47 -2
- package/neural-interface/public/shared/assistant/asst-control.js +1 -1
- package/neural-interface/public/shared/assistant/asst-limit-wait.js +7 -5
- package/neural-interface/public/shared/assistant/asst-panel.js +13 -5
- package/neural-interface/public/shared/assistant/asst-rack-styles.js +4 -4
- package/neural-interface/public/shared/assistant/asst-render.js +16 -10
- 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 +60 -15
- 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/cdx/cdx-render.js +73 -7
- package/neural-interface/public/shared/cdx/cdx-tabs.js +3 -3
- package/neural-interface/public/shared/context-menu-model.js +2 -0
- package/neural-interface/public/shared/cp/cp-agents.js +8 -0
- package/neural-interface/public/shared/cp/cp-permissions.js +6 -2
- package/neural-interface/public/shared/cp/cp-rehydrate.js +25 -1
- package/neural-interface/public/shared/cp/cp-tasks-model.js +33 -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/judgments-log-origins.js +29 -0
- 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-automation-ownership.js +23 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-events.js +13 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-icons.js +3 -1
- package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +10 -4
- package/neural-interface/public/shared/ocp-v2/ocp-v2-render.js +6 -86
- package/neural-interface/public/shared/ocp-v2/ocp-v2-ws.js +5 -2
- package/neural-interface/public/shared/owner-access.js +134 -0
- package/neural-interface/public/shared/owner-authority-view.js +92 -0
- package/neural-interface/public/shared/page-session.js +143 -14
- package/neural-interface/public/shared/poll-backoff.js +59 -0
- 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 +7 -1
- package/neural-interface/public/shared/settings/settings-ia.js +3 -1
- package/neural-interface/public/shared/settings/settings-kit.js +11 -3
- 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/settings/settings-shell.js +7 -0
- package/neural-interface/public/shared/shown-children.js +72 -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/static-bg-state.js +22 -0
- package/neural-interface/public/shared/styles.css +457 -164
- 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/synabun-tools.js +173 -0
- package/neural-interface/public/shared/tool-heartbeat.js +43 -0
- package/neural-interface/public/shared/tool-list-picker.js +3 -1
- package/neural-interface/public/shared/tool-list-view.js +23 -4
- 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 +138 -91
- package/neural-interface/public/shared/ui-claude-panel.js +209 -31
- package/neural-interface/public/shared/ui-judgments.js +37 -10
- package/neural-interface/public/shared/ui-maritaca-panel.js +15 -0
- package/neural-interface/public/shared/ui-navbar.js +23 -0
- package/neural-interface/public/shared/ui-owner-access.js +191 -0
- package/neural-interface/public/shared/ui-owner-authority.js +162 -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-sessions.js +45 -16
- package/neural-interface/public/shared/ui-settings.js +676 -42
- 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/public/shared/ui-terminal.js +15 -7
- package/neural-interface/public/shared/ui-tutorial-preview.js +4 -0
- package/neural-interface/public/shared/ui-update.js +3 -0
- package/neural-interface/public/shared/ui-whiteboard.js +4 -0
- package/neural-interface/public/shared/window-keys.js +38 -0
- package/neural-interface/scripts/build-mascot-assets.mjs +30 -0
- package/neural-interface/server.js +2903 -359
- 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
|
@@ -39,6 +39,7 @@ import { isGuest, hasPermission } from '../ui-sync.js';
|
|
|
39
39
|
import { getWhiteboardElementById } from '../ui-whiteboard.js';
|
|
40
40
|
import { focusNativeLoopRun } from '../ui-native-loop-router.js';
|
|
41
41
|
import { wireFileLinks } from '../ui-file-links.js';
|
|
42
|
+
import { watchEmpty } from '../shown-children.js';
|
|
42
43
|
import { injectAssistantStyles } from './asst-styles.js';
|
|
43
44
|
import { tipsSeen, tourOffered } from '../tour/tour-state.js';
|
|
44
45
|
import { createAssistantSocket } from './asst-ws.js';
|
|
@@ -58,16 +59,17 @@ import { activityOf } from './asst-scenes.js';
|
|
|
58
59
|
import { createUsageGauge } from './asst-usage.js';
|
|
59
60
|
import { closeMenu, currentMenuAnchor, isMenuOpen, openMenu } from './asst-menu.js';
|
|
60
61
|
import { createRouteModeControl, openModelsManager, openRoutesEditor, refreshModelsManager, renderRouteCard, routeModeLabel } from './asst-route.js';
|
|
62
|
+
import { prewarmRoutesEditor } from './asst-route-models.js';
|
|
61
63
|
import { budgetChipText, budgetSpendText, budgetTone, closeBudgetEditor, createBudgetController, mountBudgetChip, openBudgetEditor } from './asst-budget.js';
|
|
62
|
-
import { computerRemoteView, createComputerPanel, createComputerToggle, normalizeComputerRemote, openFrameLightbox, closeFrameLightbox, requestDesktopStop } from './asst-computer.js';
|
|
64
|
+
import { computerRemoteView, createComputerPanel, createComputerToggle, normalizeComputerRemote, openFrameLightbox, closeFrameLightbox, requestDesktopStatus, requestDesktopStop } from './asst-computer.js';
|
|
63
65
|
import {
|
|
64
66
|
applyLimit, applyLimitPacket, applyUsagePacket, BRAIN_PROVIDERS, brainLabel, createRenameWriter, createTabState, DEFAULT_ROUTE_MODE, deserializeTabState, fmtCost, fmtRunLine, limitExpiresIn, limitNoticeText, modelShortName,
|
|
65
67
|
brainModePatch, isBrainProvider, normalizeBrain, normalizeComputerMode, permissionModeLabel, normalizeRouteMode, normalizeTestDensity, projectLabel, providerMeta, providerShortLabel, readStoredBrain, runFromPayload,
|
|
66
|
-
serializeTabState, sessionStatus, tabStorageKey, userSessionTitle,
|
|
68
|
+
serializeTabState, sessionStatus, slashBrainEffort, tabStorageKey, userSessionTitle,
|
|
67
69
|
} from './asst-state.js';
|
|
68
70
|
import {
|
|
69
71
|
closeAssistantSession, dispatchAssistantRun, escalateAssistantRun, focusAssistantRun, getAssistantRun,
|
|
70
|
-
fetchManageCatalog, getAssistantRunResult, getAssistantSession, getAssistantSessionUsage,
|
|
72
|
+
fetchManageCatalog, getAssistantRunResult, getAssistantSession, getAssistantSessionUsage, getRouting, killAllAssistantRuns, removeAssistantRun, clearFinishedAssistantRuns,
|
|
71
73
|
listAssistantSessions, patchAssistantSession, patchHiddenModels, setAdminSandbox, stopAssistantRun, uploadAssistantAttachment,
|
|
72
74
|
} from './asst-api.js';
|
|
73
75
|
|
|
@@ -230,6 +232,8 @@ export function mountAssistant(viewport, { sessionId, brain, host = {}, session
|
|
|
230
232
|
|
|
231
233
|
const barEl = root.querySelector('.asst-bar');
|
|
232
234
|
const barGroups = Object.fromEntries([...barEl.querySelectorAll('.asst-bar-group')].map((g) => [g.dataset.group, g]));
|
|
235
|
+
// A group none of whose controls shows is hidden through data-empty (shown-children.js), never a :has().
|
|
236
|
+
const barEmpty = watchEmpty(barEl, '.asst-bar-group');
|
|
233
237
|
const costEl = root.querySelector('.asst-cost');
|
|
234
238
|
const bannersEl = root.querySelector('.asst-banners');
|
|
235
239
|
const transcriptEl = root.querySelector('.asst-transcript');
|
|
@@ -1043,6 +1047,8 @@ export function mountAssistant(viewport, { sessionId, brain, host = {}, session
|
|
|
1043
1047
|
}
|
|
1044
1048
|
if (meta.features && typeof meta.features === 'object') {
|
|
1045
1049
|
if (typeof meta.features.routing === 'boolean') st.features.routing = meta.features.routing;
|
|
1050
|
+
// The Model routes editor paints from these at once: read them now, in idle time, not at its first open.
|
|
1051
|
+
if (st.features.routing === true) prewarmRoutesEditor();
|
|
1046
1052
|
if (typeof meta.features.computer === 'boolean') st.features.computer = meta.features.computer;
|
|
1047
1053
|
if (typeof meta.features.testDensity === 'boolean') st.features.testDensity = meta.features.testDensity;
|
|
1048
1054
|
if (typeof meta.features.rename === 'boolean') st.features.rename = meta.features.rename;
|
|
@@ -1111,7 +1117,7 @@ export function mountAssistant(viewport, { sessionId, brain, host = {}, session
|
|
|
1111
1117
|
}
|
|
1112
1118
|
if (st.features.computer == null && !st.desktopProbe) {
|
|
1113
1119
|
st.desktopProbe = true;
|
|
1114
|
-
|
|
1120
|
+
requestDesktopStatus()
|
|
1115
1121
|
.then((status) => {
|
|
1116
1122
|
st.desktopSupported = status?.supported === true;
|
|
1117
1123
|
st.features.computer = status?.supported === true;
|
|
@@ -1515,7 +1521,8 @@ export function mountAssistant(viewport, { sessionId, brain, host = {}, session
|
|
|
1515
1521
|
let requiresSwitch = false;
|
|
1516
1522
|
if (parsed.provider && parsed.provider !== st.brain.provider) { next.provider = parsed.provider; next.model = ''; next.effort = null; next.agent = null; next.accountId = null; requiresSwitch = true; }
|
|
1517
1523
|
if (parsed.model) next.model = parsed.model;
|
|
1518
|
-
|
|
1524
|
+
// Claude Code: `off` is Off (no thinking, `none`), as the picker's Off; auto / default is the model's default.
|
|
1525
|
+
if (parsed.effort) next.effort = slashBrainEffort(next.provider, parsed.effort);
|
|
1519
1526
|
applyBrain(normalizeBrain(next), { requiresSwitch, field: 'model' });
|
|
1520
1527
|
picker.refresh().catch(() => {});
|
|
1521
1528
|
return true;
|
|
@@ -2322,6 +2329,7 @@ export function mountAssistant(viewport, { sessionId, brain, host = {}, session
|
|
|
2322
2329
|
dock.destroy();
|
|
2323
2330
|
composer.destroy();
|
|
2324
2331
|
renderer.destroy();
|
|
2332
|
+
barEmpty.disconnect();
|
|
2325
2333
|
barEl.remove(); // it may live in the host's header
|
|
2326
2334
|
root.remove();
|
|
2327
2335
|
if (closeServer) {
|
|
@@ -104,7 +104,7 @@ export const RACK_CSS = `
|
|
|
104
104
|
mascot and the bubble's notch: under the mascot here (the bubble is beside it), after it ≤400 (the bubble is under it). */
|
|
105
105
|
.asst-rack-set { grid-area: face; align-self: start; display: flex; flex-direction: column; align-items: center; gap: 4px 6px; min-width: 0; line-height: 0; }
|
|
106
106
|
.asst-rack-face { color: var(--rk-text); line-height: 0; }
|
|
107
|
-
.asst-rack-face svg { display: block; width:
|
|
107
|
+
.asst-rack-face svg { display: block; width: 144px; height: 72px; }
|
|
108
108
|
.asst-rack-scene { color: var(--rk-text-2); line-height: 0; }
|
|
109
109
|
.asst-rack-scene:empty { display: none; }
|
|
110
110
|
/* 96×32 (the 120×40 scene at .8, strokes held near the run stage's weight). */
|
|
@@ -305,7 +305,7 @@ export const RACK_CSS = `
|
|
|
305
305
|
.asst-rack.is-staged > .asst-rack-receipt,
|
|
306
306
|
.asst-rack.is-live.is-nested > .asst-rack-receipt { display: none; }
|
|
307
307
|
.asst-rack-receipt-face { flex: none; align-self: stretch; display: inline-flex; align-items: center; justify-content: center; width: 46px; box-shadow: inset -1px 0 0 var(--rk-line); color: var(--rk-text-2); line-height: 0; }
|
|
308
|
-
.asst-rack-receipt-face svg { display: block; width:
|
|
308
|
+
.asst-rack-receipt-face svg { display: block; width: 64px; height: 32px; }
|
|
309
309
|
.asst-rack-receipt-text {
|
|
310
310
|
flex: 0 1 auto;
|
|
311
311
|
min-width: 0;
|
|
@@ -387,7 +387,7 @@ export const RACK_CSS = `
|
|
|
387
387
|
.asst-station[data-state="waiting"] > .asst-station-hdr { box-shadow: inset 0 0 0 1px var(--rk-line-2); }
|
|
388
388
|
/* The glyph slot: the kind's prop alone (rows differ at a squint); the awake row wears the eyes. */
|
|
389
389
|
.asst-station-face { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 16px; color: var(--rk-text-2); line-height: 0; }
|
|
390
|
-
.asst-station-face svg { display: block; width:
|
|
390
|
+
.asst-station-face svg { display: block; width: 56px; height: 28px; }
|
|
391
391
|
.asst-station-face svg.asst-prop-glyph { width: 24px; height: 16px; }
|
|
392
392
|
.asst-station[data-state="awake"] .asst-station-face { color: var(--rk-text); }
|
|
393
393
|
.asst-station-label { flex: 0 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--rk-text-2); font-weight: 500; }
|
|
@@ -586,7 +586,7 @@ export const RACK_CSS = `
|
|
|
586
586
|
.asst-bubble-meta { display: none; }
|
|
587
587
|
}
|
|
588
588
|
@container asst (max-width: 299px) {
|
|
589
|
-
.asst-rack-face svg { width:
|
|
589
|
+
.asst-rack-face svg { width: 112px; height: 56px; }
|
|
590
590
|
.asst-rack-scene .asst-scene { width: 72px; height: 24px; stroke-width: 2.2; }
|
|
591
591
|
.asst-bubble::before { left: 22px; }
|
|
592
592
|
}
|
|
@@ -67,6 +67,8 @@ import { createAskTail } from './asst-ask-tail.js';
|
|
|
67
67
|
import { limitFromText } from './asst-limit.js';
|
|
68
68
|
import { createLimitDock } from './asst-limit-dock.js';
|
|
69
69
|
import { createLimitWait } from './asst-limit-wait.js';
|
|
70
|
+
import { synabunToolKey, synabunToolLabel } from '../synabun-tools.js';
|
|
71
|
+
import { normalizeToolHeartbeat } from '../tool-heartbeat.js';
|
|
70
72
|
|
|
71
73
|
// ── Markdown (lazy marked, the vendored build the sidepanels use too) ───────────────
|
|
72
74
|
let _marked = null;
|
|
@@ -111,9 +113,8 @@ export function mdInto(node, text) {
|
|
|
111
113
|
export const ICON_ASSISTANT = '<svg viewBox="0 0 24 24" fill="currentColor"><rect x="8" y="5.5" width="11" height="5" rx="2.5" transform="rotate(-12 13.5 8)"/><rect x="4.5" y="12.5" width="11" height="5" rx="2.5" transform="rotate(-12 10 15)"/></svg>';
|
|
112
114
|
const ICON_MEMORY = '<svg viewBox="0 0 24 24" fill="currentColor"><rect x="8" y="5.5" width="11" height="5" rx="2.5" transform="rotate(-12 13.5 8)"/><rect x="4.5" y="12.5" width="11" height="5" rx="2.5" transform="rotate(-12 10 15)"/></svg>';
|
|
113
115
|
const ICON_ESCALATE = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 19V5M5 12l7-7 7 7"/></svg>';
|
|
114
|
-
// SynaBun's own MCP tools: Claude/Codex `mcp__SynaBun__x`, OpenCode `SynaBun_x
|
|
115
|
-
|
|
116
|
-
export function synabunToolName(name) { const m = SYNABUN_TOOL_RE.exec(String(name || '')); return m ? m[1] : null; }
|
|
116
|
+
// SynaBun's own MCP tools: Claude/Codex `mcp__SynaBun__x`, OpenCode `SynaBun_x` (synabun-tools.js, every panel's).
|
|
117
|
+
export function synabunToolName(name) { return synabunToolKey(name); }
|
|
117
118
|
const RESULT_ERRORS = { error_max_turns: 'Stopped: the turn limit was reached.', error_max_budget_usd: 'Stopped: the budget cap was reached.', error_during_execution: 'The turn failed.', error_max_structured_output_retries: 'Stopped: structured output kept failing.' };
|
|
118
119
|
const INTERRUPTED_RE = /\b(?:interrupted|aborted|cancell?ed)\b/i;
|
|
119
120
|
|
|
@@ -1839,7 +1840,7 @@ export function createRenderer(transcriptEl, hooks = {}) {
|
|
|
1839
1840
|
rack.row.classList.add('is-staged');
|
|
1840
1841
|
watchStageWidth(rack, true);
|
|
1841
1842
|
if (!rack.rig) {
|
|
1842
|
-
try { rack.rig = mascotLib.createMascot(rack.stage.face, { width:
|
|
1843
|
+
try { rack.rig = mascotLib.createMascot(rack.stage.face, { width: 144, height: 72, rangeX: 10, rangeY: 7, pose: 'idle' }); } catch { rack.rig = null; }
|
|
1843
1844
|
rack.pose = null;
|
|
1844
1845
|
rack.target = rack.rig ? stageTarget(rack) : null;
|
|
1845
1846
|
if (hero?.parked) dropHero(); // the stage is the character now: a hero still on its way out goes at once
|
|
@@ -2334,7 +2335,7 @@ export function createRenderer(transcriptEl, hooks = {}) {
|
|
|
2334
2335
|
* and observes nothing. Without poses: the plain mascot (receipt) or the
|
|
2335
2336
|
* kind's glyph (rows). Returns the SVG to repaint, or null.
|
|
2336
2337
|
*/
|
|
2337
|
-
function mountStill(host, pose, glyph, { staticGlyph = false, width =
|
|
2338
|
+
function mountStill(host, pose, glyph, { staticGlyph = false, width = 56, height = 28 } = {}) {
|
|
2338
2339
|
host.textContent = '';
|
|
2339
2340
|
if (typeof mascotLib.paintMascot === 'function' && typeof mascotLib.stillFrame === 'function') {
|
|
2340
2341
|
try {
|
|
@@ -2509,7 +2510,10 @@ export function createRenderer(transcriptEl, hooks = {}) {
|
|
|
2509
2510
|
function stepTitle(step) {
|
|
2510
2511
|
if (step.type === 'think') return t('assistant.rack.kind.think', 'Thinking');
|
|
2511
2512
|
if (step.kind === 'computer') { const base = computerToolName(step.name) || 'computer'; return t(`assistant.computer.tool.${base}`, COMPUTER_TOOL_TITLES[base] || 'Computer'); }
|
|
2512
|
-
|
|
2513
|
+
// A SynaBun tool by the name every panel gives it ('Bluesky · Post'); any other MCP tool by its words.
|
|
2514
|
+
const sbKey = synabunToolName(step.name);
|
|
2515
|
+
if (sbKey != null) return synabunToolLabel(sbKey);
|
|
2516
|
+
if (step.kind === 'mcp') return toolWords(step.name);
|
|
2513
2517
|
return step.name || 'tool';
|
|
2514
2518
|
}
|
|
2515
2519
|
|
|
@@ -2569,7 +2573,7 @@ export function createRenderer(transcriptEl, hooks = {}) {
|
|
|
2569
2573
|
if (!r.faceBuilt && !rack.staged && !(rack.nested && live)) {
|
|
2570
2574
|
r.faceBuilt = true;
|
|
2571
2575
|
r.pose = pose;
|
|
2572
|
-
r.svg = mountStill(r.face, pose, '✓', { width:
|
|
2576
|
+
r.svg = mountStill(r.face, pose, '✓', { width: 64, height: 32 });
|
|
2573
2577
|
} else if (r.faceBuilt && r.pose !== pose) {
|
|
2574
2578
|
r.pose = pose;
|
|
2575
2579
|
repaintStill(r.svg, pose);
|
|
@@ -3144,11 +3148,11 @@ export function createRenderer(transcriptEl, hooks = {}) {
|
|
|
3144
3148
|
if (workingFace && workingFace.still === calm()) return;
|
|
3145
3149
|
dropWorkingFace();
|
|
3146
3150
|
if (calm()) {
|
|
3147
|
-
workingFace = { still: true, el: mountStill(host, 'think', '…', { width:
|
|
3151
|
+
workingFace = { still: true, el: mountStill(host, 'think', '…', { width: 112, height: 56 }) };
|
|
3148
3152
|
return;
|
|
3149
3153
|
}
|
|
3150
3154
|
try {
|
|
3151
|
-
const rig = mascotLib.createMascot(host, { width:
|
|
3155
|
+
const rig = mascotLib.createMascot(host, { width: 112, height: 56, pose: 'think' });
|
|
3152
3156
|
const face = { still: false, rig, el: rig.el, held: false };
|
|
3153
3157
|
face.target = { kind: 'working', rig, el: rig.el, hold(on) { face.held = !!on; }, restore() { if (workingFace === face) rig.setPose('think'); } };
|
|
3154
3158
|
workingFace = face;
|
|
@@ -3609,7 +3613,7 @@ export function createRenderer(transcriptEl, hooks = {}) {
|
|
|
3609
3613
|
<div class="asst-empty-project" role="group" aria-label="${esc(t('assistant.empty.context', 'Context'))}" hidden></div>`;
|
|
3610
3614
|
const box = emptyEl.querySelector('.asst-empty-mascot');
|
|
3611
3615
|
try {
|
|
3612
|
-
const rig = mascotLib.createMascot(box, { width:
|
|
3616
|
+
const rig = mascotLib.createMascot(box, { width: 280, height: 140, idleVariant: 'hero' });
|
|
3613
3617
|
hero = { rig, el: rig.el, box, parked: false, leaving: false, held: false, dock: null, egg: false, leaveTimer: 0 };
|
|
3614
3618
|
hero.target = heroTarget(hero);
|
|
3615
3619
|
wireEgg(hero);
|
|
@@ -3880,6 +3884,8 @@ export function createRenderer(transcriptEl, hooks = {}) {
|
|
|
3880
3884
|
}
|
|
3881
3885
|
|
|
3882
3886
|
function dispatch(ev, silent) {
|
|
3887
|
+
// A long call's heartbeat names the call as its parent: progress of that call, not a subagent's feed.
|
|
3888
|
+
ev = normalizeToolHeartbeat(ev);
|
|
3883
3889
|
if (ev.type !== 'stream_event') for (const k of idKeys(ev)) markSeen(k); // deltas are never replayed as themselves
|
|
3884
3890
|
const parentId = ev.parent_tool_use_id || ev.message?.parent_tool_use_id || null;
|
|
3885
3891
|
const scope = scopeFor(parentId);
|
|
@@ -11,12 +11,72 @@
|
|
|
11
11
|
// list of models: a label, a tier, a price or an effort level is read from the
|
|
12
12
|
// catalog row each time it is drawn.
|
|
13
13
|
|
|
14
|
-
import {
|
|
14
|
+
import { fetchClaudeAccounts, fetchCodexAccounts } from '../agent-runtime-options.js';
|
|
15
|
+
import { on } from '../state.js';
|
|
16
|
+
import { getRouting } from './asst-api.js';
|
|
17
|
+
import { cachedModelCatalog, catalogModelRow, loadModelCatalog, modelCatalogStatus, onModelCatalogChange } from './asst-brain-picker.js';
|
|
15
18
|
import { routeTargetLabel } from './asst-state.js';
|
|
16
19
|
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
/**
|
|
21
|
+
* A new build of the catalog, never the copy another menu loaded a minute ago.
|
|
22
|
+
* The editor paints from cachedRouteModels() first and asks for this in the
|
|
23
|
+
* background; Reload models asks for it too.
|
|
24
|
+
*/
|
|
25
|
+
export function loadRouteModels({ force = true } = {}) {
|
|
26
|
+
return loadModelCatalog({ force });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** The last catalog this page loaded, synchronously (null before the first load): what the editor paints from at once. */
|
|
30
|
+
export function cachedRouteModels() { return cachedModelCatalog(); }
|
|
31
|
+
|
|
32
|
+
// ── Routing settings kept for the next open ──────────────────────────────────
|
|
33
|
+
// GET /api/assistant/routing is small and fast, but it is still a round trip the
|
|
34
|
+
// first paint would wait for. The last answer is kept for the page's lifetime;
|
|
35
|
+
// the editor paints from it and reads the live one right after. A version the
|
|
36
|
+
// server moved past is caught by the PUT (409) and by the refresh on open.
|
|
37
|
+
let _routing = null;
|
|
38
|
+
let _routingLoading = null;
|
|
39
|
+
|
|
40
|
+
/** The last routing answer (null before the first load or after a change elsewhere). */
|
|
41
|
+
export function cachedRouting() { return _routing; }
|
|
42
|
+
|
|
43
|
+
/** Keep a routing answer (the editor's own load, or a save's reply merged over the last one). */
|
|
44
|
+
export function rememberRouting(data) {
|
|
45
|
+
if (!data || typeof data !== 'object' || !data.routing) return _routing;
|
|
46
|
+
_routing = { ..._routing, ...data, taskClasses: Array.isArray(data.taskClasses) ? data.taskClasses : _routing?.taskClasses || [] };
|
|
47
|
+
return _routing;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Drop the kept answer (a change in another window): the next open reads the server before it paints. */
|
|
51
|
+
export function forgetRouting() { _routing = null; }
|
|
52
|
+
|
|
53
|
+
/** GET the routing settings, once at a time, and keep the answer. */
|
|
54
|
+
export function loadRouting({ get = getRouting } = {}) {
|
|
55
|
+
if (_routingLoading) return _routingLoading;
|
|
56
|
+
_routingLoading = Promise.resolve().then(get).then(data => { rememberRouting(data); return data; }).finally(() => { _routingLoading = null; });
|
|
57
|
+
return _routingLoading;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (typeof document !== 'undefined') on('sync:assistant:routing-changed', forgetRouting);
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Warm what the editor's first paint reads, in idle time, once the Assistant
|
|
64
|
+
* panel learns that routing is available: the routing settings, the catalog
|
|
65
|
+
* (the page's cached build is enough: an open asks for a new one in the
|
|
66
|
+
* background) and the account lists. Every failure is silent; an open loads
|
|
67
|
+
* again whatever is missing. Once per page; returns the promise for tests.
|
|
68
|
+
*/
|
|
69
|
+
let _prewarmed = null;
|
|
70
|
+
export function prewarmRoutesEditor({ routing = loadRouting, catalog = () => loadModelCatalog(), accounts = () => Promise.allSettled([fetchClaudeAccounts(), fetchCodexAccounts()]), idle = defaultIdle, force = false } = {}) {
|
|
71
|
+
if (_prewarmed && !force) return _prewarmed;
|
|
72
|
+
_prewarmed = new Promise(resolve => idle(() => {
|
|
73
|
+
Promise.allSettled([Promise.resolve().then(routing), Promise.resolve().then(catalog), Promise.resolve().then(accounts)]).then(() => resolve(true), () => resolve(false));
|
|
74
|
+
}));
|
|
75
|
+
return _prewarmed;
|
|
76
|
+
}
|
|
77
|
+
function defaultIdle(fn) {
|
|
78
|
+
if (typeof requestIdleCallback === 'function') requestIdleCallback(() => fn(), { timeout: 2000 });
|
|
79
|
+
else setTimeout(fn, 250);
|
|
20
80
|
}
|
|
21
81
|
|
|
22
82
|
/** Loading/partial state belongs to the same model source, without changing the catalog shape. */
|
|
@@ -38,11 +38,28 @@ import {
|
|
|
38
38
|
ROUTE_MODES,
|
|
39
39
|
routeKindLabel,
|
|
40
40
|
routeTargetLabel,
|
|
41
|
+
routeEffortWord,
|
|
42
|
+
ROUTE_EFFORT_OFF,
|
|
41
43
|
OPTIONAL_PROVIDERS,
|
|
42
44
|
UNPRICED_PROVIDERS,
|
|
43
45
|
} from './asst-state.js';
|
|
44
46
|
|
|
45
47
|
function str(v) { return v == null ? '' : String(v).trim(); }
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The route card's effort choices for a model (Auto is the card's own first item): Off (`none`, no
|
|
51
|
+
* thinking) first where the model can honor it, then its levels. Mirrors lib/effort-levels.js
|
|
52
|
+
* supportsEffortOff: Claude Code whenever the model thinks at all (the SDK disables thinking);
|
|
53
|
+
* Codex / OpenCode only when the model lists `none`; Antigravity never. → [{ id, label, off }].
|
|
54
|
+
*/
|
|
55
|
+
export function routeEffortChoices(provider, row) {
|
|
56
|
+
const levels = getEffortLevelsForModel(provider, row).filter(e => e.id !== 'off');
|
|
57
|
+
const offId = ROUTE_EFFORT_OFF;
|
|
58
|
+
const rest = levels.filter(e => String(e.id).toLowerCase() !== offId).map(e => ({ id: e.id, label: e.label || e.id, off: false }));
|
|
59
|
+
const listsOff = levels.some(e => String(e.id).toLowerCase() === offId);
|
|
60
|
+
const canOff = provider === 'claude-code' ? rest.length > 0 : provider === 'antigravity' ? false : listsOff;
|
|
61
|
+
return canOff ? [{ id: offId, label: 'Off', off: true }, ...rest] : rest;
|
|
62
|
+
}
|
|
46
63
|
function num(v) { const n = Number(v); return v != null && v !== '' && typeof v !== 'boolean' && Number.isFinite(n) ? n : null; }
|
|
47
64
|
function obj(v) { return v && typeof v === 'object' && !Array.isArray(v) ? v : null; }
|
|
48
65
|
function arr(v) { return Array.isArray(v) ? v : []; }
|
|
@@ -497,7 +514,7 @@ export function routeLineParts(route, phase = 'decided', { brainLabel = '', t =
|
|
|
497
514
|
const meta = [];
|
|
498
515
|
const accountLabel = routeDisplayAccount(target, t);
|
|
499
516
|
if (accountLabel) meta.push(accountLabel);
|
|
500
|
-
if (effort && effort !== 'off') meta.push(effort);
|
|
517
|
+
if (effort && effort !== 'off') meta.push(routeEffortWord(effort));
|
|
501
518
|
if (confidence) meta.push(confidence);
|
|
502
519
|
return {
|
|
503
520
|
taskClass: cls,
|
|
@@ -877,7 +894,7 @@ export function renderRouteCard(container, input, hooks = {}) {
|
|
|
877
894
|
row.setAttribute('aria-disabled', o.disabled ? 'true' : 'false');
|
|
878
895
|
row.tabIndex = -1;
|
|
879
896
|
const kindWord = o.kind && o.kind !== 'direct' ? routeKindWord(o.kind, hooks.t) : '';
|
|
880
|
-
const sub = [kindWord, routeDisplayAccount(o, hooks.t), o.effort && o.effort !== 'off' ? o.effort : '', o.price ? priceText(o.price) : '', o.vision ? tr('assistant.brain.vision', 'vision') : '', o.reason].filter(Boolean).join(' · ');
|
|
897
|
+
const sub = [kindWord, routeDisplayAccount(o, hooks.t), o.effort && o.effort !== 'off' ? routeEffortWord(o.effort) : '', o.price ? priceText(o.price) : '', o.vision ? tr('assistant.brain.vision', 'vision') : '', o.reason].filter(Boolean).join(' · ');
|
|
881
898
|
row.innerHTML = `
|
|
882
899
|
<span class="asst-route-num" aria-hidden="true">${esc(o.number)}</span>
|
|
883
900
|
<span class="asst-route-opt-icon asst-icon" aria-hidden="true"${o.provider ? ` style="color:${esc(providerColor(o.provider))}"` : ''}>${providerIconHtml(o.provider, hooks)}</span>
|
|
@@ -996,12 +1013,12 @@ export function renderRouteCard(container, input, hooks = {}) {
|
|
|
996
1013
|
setFieldLabel(otherBtn, target ? routeTargetLabel(target) : tr('assistant.routes.other', 'Other model…'));
|
|
997
1014
|
otherBtn.setAttribute('aria-label', tr('assistant.brain.model', 'Model'));
|
|
998
1015
|
otherBtn.disabled = busy();
|
|
999
|
-
setFieldLabel(effortBtn, target?.effort
|
|
1016
|
+
setFieldLabel(effortBtn, !target?.effort ? tr('assistant.routes.editorEffortAuto', 'Auto')
|
|
1017
|
+
: target.effort === ROUTE_EFFORT_OFF ? tr('assistant.routes.editorEffortOff', 'Off') : target.effort);
|
|
1000
1018
|
effortBtn.setAttribute('aria-label', tr('assistant.brain.effort', 'Thinking effort'));
|
|
1001
1019
|
setFieldLabel(accountBtn, routeDisplayAccount(target, hooks.t) || tr('assistant.routes.account.workersDefault', 'Workers default'));
|
|
1002
1020
|
accountBtn.setAttribute('aria-label', tr('assistant.brain.account', 'Account profile'));
|
|
1003
|
-
|
|
1004
|
-
effortBtn.disabled = busy() || !target || !levels.some(e => e.id !== 'off');
|
|
1021
|
+
effortBtn.disabled = busy() || !target || !routeEffortChoices(target.provider, catalogModelRow(target.provider, target.model)).length;
|
|
1005
1022
|
// Here runs on this conversation's own account (another one is a worker): only a worker picks one.
|
|
1006
1023
|
accountBtn.hidden = state.side === 'direct' || !['claude-code', 'codex'].includes(target?.provider);
|
|
1007
1024
|
accountBtn.disabled = busy();
|
|
@@ -1009,10 +1026,10 @@ export function renderRouteCard(container, input, hooks = {}) {
|
|
|
1009
1026
|
effortBtn.addEventListener('click', () => {
|
|
1010
1027
|
const target = selected();
|
|
1011
1028
|
if (!target) return;
|
|
1012
|
-
const
|
|
1029
|
+
const choices = routeEffortChoices(target.provider, catalogModelRow(target.provider, target.model));
|
|
1013
1030
|
openMenu(effortBtn, { title: tr('assistant.brain.effort', 'Thinking effort'), placement: 'auto', items: [
|
|
1014
1031
|
{ kind: 'radio', label: tr('assistant.routes.editorEffortAuto', 'Auto'), selected: !target.effort, onSelect: () => editTarget({ effort: null }) },
|
|
1015
|
-
...
|
|
1032
|
+
...choices.map(e => ({ kind: 'radio', label: e.off ? tr('assistant.routes.editorEffortOff', 'Off') : e.label, selected: target.effort === e.id, onSelect: () => editTarget({ effort: e.id }) })),
|
|
1016
1033
|
] });
|
|
1017
1034
|
});
|
|
1018
1035
|
accountBtn.addEventListener('click', async () => {
|