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
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Raster artwork shared by live rigs and transcript stills. All names are
|
|
2
|
+
// allowlisted; tool data can never become a URL. Timing belongs to the rig.
|
|
3
|
+
// v3 (approved 2026-11-11): every file is the whole drawn character (eyes,
|
|
4
|
+
// smile and props together); the rig never draws over it.
|
|
5
|
+
const ROOT = '/assets/mascot/';
|
|
6
|
+
export const MASCOT_ASSET_VERSION = '3';
|
|
7
|
+
export const MASCOT_ASSET_POSES = Object.freeze([
|
|
8
|
+
'shell', 'read', 'edit', 'search', 'web', 'subagent', 'plan', 'memory',
|
|
9
|
+
'runs', 'computer', 'think', 'mcp', 'idle', 'sleep', 'watch', 'wait',
|
|
10
|
+
'success', 'error', 'blocked', 'offline', 'project', 'budget', 'skill',
|
|
11
|
+
'present', 'pick', 'ask',
|
|
12
|
+
]);
|
|
13
|
+
const count = (v, lo, hi, fallback) => v != null && Number.isFinite(Number(v))
|
|
14
|
+
? Math.max(lo, Math.min(hi, Math.round(Number(v)))) : fallback;
|
|
15
|
+
|
|
16
|
+
export function mascotAssetKey(pose, options = {}, { hero = false } = {}) {
|
|
17
|
+
const name = MASCOT_ASSET_POSES.includes(pose) ? pose : 'idle';
|
|
18
|
+
if (name === 'idle' && hero) return 'idle-hero';
|
|
19
|
+
if (name === 'memory' && options.mode === 'remember') return 'memory-remember';
|
|
20
|
+
if (name === 'budget' && options.unlimited) return 'budget-unlimited';
|
|
21
|
+
if (name === 'subagent') {
|
|
22
|
+
const n = count(options.count, 1, 3, 1);
|
|
23
|
+
return n === 1 ? name : `${name}-${n}`;
|
|
24
|
+
}
|
|
25
|
+
if (name === 'pick' || name === 'plan') {
|
|
26
|
+
const n = count(options.ticks, 0, 3, 1);
|
|
27
|
+
return n === 1 ? name : `${name}-${n}`;
|
|
28
|
+
}
|
|
29
|
+
return name;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Every file shipped (one GIF + one still PNG each); also the asset integrity
|
|
33
|
+
// test's source of truth. `hover-attention` is the empty page's one-shot.
|
|
34
|
+
export const MASCOT_ASSET_KEYS = Object.freeze([...MASCOT_ASSET_POSES, 'idle-hero', 'hover-attention']);
|
|
35
|
+
// Keys the rig still tells apart that v3 draws with the base state's art.
|
|
36
|
+
export const MASCOT_ASSET_FALLBACKS = Object.freeze({
|
|
37
|
+
'memory-remember': 'memory', 'budget-unlimited': 'budget',
|
|
38
|
+
'subagent-2': 'subagent', 'subagent-3': 'subagent',
|
|
39
|
+
'plan-0': 'plan', 'plan-2': 'plan', 'plan-3': 'plan',
|
|
40
|
+
'pick-0': 'pick', 'pick-2': 'pick', 'pick-3': 'pick',
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
/** The shipped file a key is drawn from: its own, else its base state's, else idle. */
|
|
44
|
+
export function mascotAssetFile(key) {
|
|
45
|
+
if (MASCOT_ASSET_KEYS.includes(key)) return key;
|
|
46
|
+
return Object.hasOwn(MASCOT_ASSET_FALLBACKS, key) ? MASCOT_ASSET_FALLBACKS[key] : 'idle';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** URL of a key's art (allowlisted: an unknown key is idle). */
|
|
50
|
+
export function mascotAssetUrl(key, { animated = false } = {}) {
|
|
51
|
+
return `${ROOT}${mascotAssetFile(key)}.${animated ? 'gif' : 'png'}?v=${MASCOT_ASSET_VERSION}`;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function mascotAsset(pose, options, { animated = false, hero = false } = {}) {
|
|
55
|
+
return mascotAssetUrl(mascotAssetKey(pose, options, { hero }), { animated });
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Scene names are independent of tool input and always pass through this list.
|
|
59
|
+
export const SCENE_ASSET_KEYS = Object.freeze([
|
|
60
|
+
'quick', 'code', 'complex', 'review', 'research', 'browser', 'computer',
|
|
61
|
+
'automation', 'design', 'image_gen', 'video_gen', 'generic',
|
|
62
|
+
'edit', 'shell', 'read', 'search', 'web', 'memory', 'thinking',
|
|
63
|
+
]);
|
|
64
|
+
export function sceneAsset(scene, { animated = false } = {}) {
|
|
65
|
+
const id = SCENE_ASSET_KEYS.includes(scene) ? scene : 'generic';
|
|
66
|
+
return `${ROOT}scenes/${id}.${animated ? 'gif' : 'png'}?v=${MASCOT_ASSET_VERSION}`;
|
|
67
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ═══════════════════════════════════════════
|
|
2
|
-
// SynaBun mascot —
|
|
2
|
+
// SynaBun mascot — generated block eyes and a smile, on the shared rig
|
|
3
3
|
// ═══════════════════════════════════════════
|
|
4
4
|
// The onboarding character (onboarding.html initEyesSVG / updateEyesSVG): the
|
|
5
5
|
// same 280×140 geometry and blink timing, as a module any page can mount, now
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
// function of time (poseFrame) over a few parameters per eye, the mouth and
|
|
8
8
|
// the face, plus one prop drawn in the face's own pill geometry. Rigs draw
|
|
9
9
|
// from the shared ticker (shared/synabun-ticker.js): 30 fps while a pose
|
|
10
|
-
// loops, 60 fps for blends and reactions, no frames at all while still.
|
|
10
|
+
// loops, 60 fps for blends and reactions, no frames at all while still. The
|
|
11
|
+
// task artwork plays from compact GIFs; PNGs serve stills and reduced motion.
|
|
12
|
+
// The SVG geometry remains the gaze/reaction/pointing rig and asset encoder. One
|
|
11
13
|
// loop, one pointermove listener and one IntersectionObserver serve every rig,
|
|
12
14
|
// and every rig that is active and on screen plays its own pose: N rigs move
|
|
13
15
|
// at once, each on its own clock. No rig waits for another; a host that wants
|
|
@@ -39,6 +41,7 @@
|
|
|
39
41
|
* one-shot (success, error, blocked) has played and held. The same pose with
|
|
40
42
|
* a new count or ticks keeps its loop running. `opts.unlimited` selects the
|
|
41
43
|
* budget pose's relaxed infinity variant; project peeks into a folder.
|
|
44
|
+
* `idleVariant: 'hero'` selects the richer empty-page idle artwork.
|
|
42
45
|
* The card poses (`MASCOT_CARD_POSES`, the Assistant's follow-ups and
|
|
43
46
|
* question cards): `present` (a warm smile toward what it offers), `pick`
|
|
44
47
|
* (the plan's clipboard, one tick per picked item: `opts.ticks`) and `ask`
|
|
@@ -105,9 +108,10 @@
|
|
|
105
108
|
*/
|
|
106
109
|
|
|
107
110
|
import {
|
|
108
|
-
isReducedMotion, lastInputAt, now as tickerNow, onKey, onPointer, onReducedMotionChange,
|
|
109
|
-
pointerPosition, requestFrames, subscribe,
|
|
111
|
+
clearTickerTimeout, isReducedMotion, lastInputAt, now as tickerNow, onKey, onPointer, onReducedMotionChange,
|
|
112
|
+
pointerPosition, requestFrames, subscribe, tickerPaused, tickerTimeout,
|
|
110
113
|
} from './synabun-ticker.js';
|
|
114
|
+
import { mascotAsset, mascotAssetUrl } from './synabun-mascot-assets.js';
|
|
111
115
|
|
|
112
116
|
export const MASCOT_VIEWBOX = '0 0 280 140';
|
|
113
117
|
|
|
@@ -119,14 +123,51 @@ export const MASCOT_CARD_POSES = Object.freeze(['present', 'pick', 'ask']);
|
|
|
119
123
|
export const MASCOT_POSES = Object.freeze([...MASCOT_KINDS, ...MASCOT_STATES, 'project', 'budget', 'skill', ...MASCOT_CARD_POSES]);
|
|
120
124
|
export const MASCOT_REACTIONS = Object.freeze(['hop', 'wince', 'nod', 'pop', 'startle', 'pulse', 'click']);
|
|
121
125
|
|
|
122
|
-
/**
|
|
123
|
-
|
|
126
|
+
/**
|
|
127
|
+
* GIF/PNG art (v3): each file is the whole drawn character (eyes, smile,
|
|
128
|
+
* props), one square image centred in the 280×140 box. It is never
|
|
129
|
+
* clipped into layers and nothing of the vector rig is drawn over it; the
|
|
130
|
+
* live rig moves it only as a whole (a small translate / tilt / scale).
|
|
131
|
+
*/
|
|
132
|
+
// v3 still alpha union (47,43)–(461,469), expanded for GIF cels
|
|
133
|
+
// (10,9)–(469,469). Uniform fit centres the content with vertical clearance.
|
|
134
|
+
export const ART_BOX = Object.freeze({ x: 68, y: -2, size: 144 });
|
|
135
|
+
/** Approved v3 hover-attention.gif duration. */
|
|
136
|
+
export const HOVER_ATTENTION_MS = 1740;
|
|
137
|
+
const ART_GAZE_K = 0.35; // the drawn eyes cannot move: a gaze nudges the whole image a little
|
|
138
|
+
const ART_GAZE_MAX = 6; // viewBox units
|
|
139
|
+
const clampTo = (v, m) => Math.max(-m, Math.min(m, v));
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* The whole-image transform of the art for frame `f` over the pose's own
|
|
143
|
+
* frame `base`: the face's translate / tilt (blends, reactions), a small
|
|
144
|
+
* gaze nudge and a reaction's horizontal squash as a scale. Blinks (eye
|
|
145
|
+
* height) are never applied: the GIF draws its own eyes.
|
|
146
|
+
*/
|
|
147
|
+
export function artTransform(f, base) {
|
|
148
|
+
const r = (v) => Math.round(v * 100) / 100;
|
|
149
|
+
if (!f || !base) return 'translate(0,0) rotate(0 140 70) scale(1)';
|
|
150
|
+
const eyes = (k) => ((f.eyes?.[0]?.[k] ?? 0) - (base.eyes?.[0]?.[k] ?? 0) + (f.eyes?.[1]?.[k] ?? 0) - (base.eyes?.[1]?.[k] ?? 0)) / 2;
|
|
151
|
+
const dx = (f.face.dx - base.face.dx) + clampTo(eyes('dx') * ART_GAZE_K, ART_GAZE_MAX);
|
|
152
|
+
const dy = (f.face.dy - base.face.dy) + clampTo(eyes('dy') * ART_GAZE_K, ART_GAZE_MAX);
|
|
153
|
+
const rot = f.face.rot - base.face.rot;
|
|
154
|
+
const sx = (k) => (f.eyes?.[k]?.sx ?? 1) / ((base.eyes?.[k]?.sx) || 1);
|
|
155
|
+
const s = Math.max(0.9, Math.min(1.1, (sx(0) + sx(1)) / 2));
|
|
156
|
+
return `translate(${r(dx)},${r(dy)}) rotate(${r(rot)} 140 70) translate(140,70) scale(${r(s)}) translate(-140,-70)`;
|
|
157
|
+
}
|
|
158
|
+
function artworkSvg() {
|
|
159
|
+
return `<g class="syna-art-face"><image class="syna-art" x="${ART_BOX.x}" y="${ART_BOX.y}" width="${ART_BOX.size}" height="${ART_BOX.size}" preserveAspectRatio="xMidYMid meet" href="${mascotAsset('idle')}"/></g>`;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** Keep the original geometry for bounds, pointing arms and the encoder. */
|
|
163
|
+
export function mascotSvg({ width = 280, height = 140, className = '', artwork = true } = {}) {
|
|
124
164
|
return `<svg${className ? ` class="${className}"` : ''} viewBox="${MASCOT_VIEWBOX}" width="${width}" height="${height}" style="overflow:visible" aria-hidden="true" focusable="false">`
|
|
165
|
+
+ (artwork ? artworkSvg() : '')
|
|
125
166
|
+ '<g class="syna-face">'
|
|
126
|
-
+
|
|
127
|
-
+
|
|
128
|
-
+
|
|
129
|
-
+
|
|
167
|
+
+ `<g class="syna-eye"${artwork ? ' visibility="hidden"' : ''}><g class="syna-lid"><rect x="80" y="24" width="38" height="72" rx="19" fill="currentColor"/></g></g>`
|
|
168
|
+
+ `<g class="syna-eye"${artwork ? ' visibility="hidden"' : ''}><g class="syna-lid"><rect x="162" y="24" width="38" height="72" rx="19" fill="currentColor"/></g></g>`
|
|
169
|
+
+ `<path class="syna-mouth"${artwork ? ' visibility="hidden"' : ''} d="M118,116 Q140,130 162,116" fill="none" stroke="currentColor" stroke-opacity=".25" stroke-width="2.5" stroke-linecap="round"/>`
|
|
170
|
+
+ `<g class="syna-props"${artwork ? ' visibility="hidden"' : ''}></g>`
|
|
130
171
|
+ '</g></svg>';
|
|
131
172
|
}
|
|
132
173
|
|
|
@@ -728,6 +769,12 @@ export function poseFrame(name, t = 0, opts = {}) {
|
|
|
728
769
|
const time = Number.isFinite(t) && t > 0 ? t : 0;
|
|
729
770
|
const o = poseOptions(opts);
|
|
730
771
|
const frame = def.frame(time, o);
|
|
772
|
+
// Nonenumerable provenance lets paintMascot(stillFrame(...)) select its
|
|
773
|
+
// PNG, without changing the public frame geometry or blend calculations.
|
|
774
|
+
Object.defineProperties(frame, {
|
|
775
|
+
pose: { value: POSES[name] ? name : 'idle' },
|
|
776
|
+
poseOptions: { value: o },
|
|
777
|
+
});
|
|
731
778
|
return o.still ? markStill(frame) : frame; // the painter makes a still's prop legible at a glance
|
|
732
779
|
}
|
|
733
780
|
|
|
@@ -1939,6 +1986,11 @@ export function paintMascot(svg, frame) {
|
|
|
1939
1986
|
let painter = painters.get(svg);
|
|
1940
1987
|
if (!painter) { painter = createPainter(svg, nextUid()); painters.set(svg, painter); }
|
|
1941
1988
|
painter.paint(frame);
|
|
1989
|
+
const art = svg.querySelector('.syna-art');
|
|
1990
|
+
if (art) {
|
|
1991
|
+
const url = mascotAsset(frame.pose || frame.prop?.name || 'idle', frame.poseOptions);
|
|
1992
|
+
if (art.getAttribute('href') !== url) art.setAttribute('href', url);
|
|
1993
|
+
}
|
|
1942
1994
|
}
|
|
1943
1995
|
|
|
1944
1996
|
// ── Shared runtime: one observer and one motion listener for every rig ──
|
|
@@ -1949,6 +2001,20 @@ const rigs = new Set();
|
|
|
1949
2001
|
let stopMotionWatch = null;
|
|
1950
2002
|
let io = null;
|
|
1951
2003
|
const ioRigs = new WeakMap();
|
|
2004
|
+
let stopArtWatch = null;
|
|
2005
|
+
|
|
2006
|
+
// GIFs do not obey animation-play-state. Replace their source with a PNG
|
|
2007
|
+
// while the shared ticker is paused, including hidden tabs and window drags.
|
|
2008
|
+
// One observer serves all rigs and is released with the last one.
|
|
2009
|
+
function watchArt() {
|
|
2010
|
+
if (stopArtWatch || typeof document === 'undefined') return;
|
|
2011
|
+
const update = () => { for (const rig of rigs) rig.artChanged(); };
|
|
2012
|
+
const observer = typeof MutationObserver === 'function' && document.body
|
|
2013
|
+
? new MutationObserver(update) : null;
|
|
2014
|
+
observer?.observe(document.body, { attributes: true, attributeFilter: ['class'] });
|
|
2015
|
+
document.addEventListener('visibilitychange', update);
|
|
2016
|
+
stopArtWatch = () => { observer?.disconnect(); document.removeEventListener('visibilitychange', update); };
|
|
2017
|
+
}
|
|
1952
2018
|
|
|
1953
2019
|
function observe(el, rig) {
|
|
1954
2020
|
if (typeof IntersectionObserver !== 'function') return;
|
|
@@ -1968,6 +2034,7 @@ function unobserve(el) {
|
|
|
1968
2034
|
|
|
1969
2035
|
function register(rig) {
|
|
1970
2036
|
rigs.add(rig);
|
|
2037
|
+
watchArt();
|
|
1971
2038
|
stopMotionWatch ||= onReducedMotionChange(() => {
|
|
1972
2039
|
for (const r of Array.from(rigs)) r.motionChanged();
|
|
1973
2040
|
});
|
|
@@ -1976,6 +2043,7 @@ function register(rig) {
|
|
|
1976
2043
|
function unregister(rig) {
|
|
1977
2044
|
rigs.delete(rig);
|
|
1978
2045
|
if (!rigs.size && stopMotionWatch) { stopMotionWatch(); stopMotionWatch = null; }
|
|
2046
|
+
if (!rigs.size && stopArtWatch) { stopArtWatch(); stopArtWatch = null; }
|
|
1979
2047
|
}
|
|
1980
2048
|
|
|
1981
2049
|
const BLEND_MS = 160;
|
|
@@ -2003,6 +2071,7 @@ export function createMascot(container, options) {
|
|
|
2003
2071
|
const {
|
|
2004
2072
|
width = 128, height = 64, rangeX, rangeY, className = 'synabun-mascot',
|
|
2005
2073
|
pose: firstPose = 'idle', poseOptions: firstOptions, active: startActive, arms: armsOption,
|
|
2074
|
+
idleVariant = 'default',
|
|
2006
2075
|
} = opts || {};
|
|
2007
2076
|
const markup = mascotSvg({ width, height, className });
|
|
2008
2077
|
let svg;
|
|
@@ -2016,6 +2085,20 @@ export function createMascot(container, options) {
|
|
|
2016
2085
|
svg.remove();
|
|
2017
2086
|
}
|
|
2018
2087
|
const painter = createPainter(svg, nextUid());
|
|
2088
|
+
const art = svg.querySelector('.syna-art');
|
|
2089
|
+
const artFace = svg.querySelector('.syna-art-face');
|
|
2090
|
+
let artSource = '';
|
|
2091
|
+
// The empty page's hero: hovering it (or attention()) plays hover-attention
|
|
2092
|
+
// once over idle-hero, then idle-hero again. Never under reduced motion.
|
|
2093
|
+
const hero = idleVariant === 'hero';
|
|
2094
|
+
let attentionUntil = -Infinity;
|
|
2095
|
+
let attentionTimer = 0;
|
|
2096
|
+
let stopHover = null;
|
|
2097
|
+
if (hero && art && typeof svg.addEventListener === 'function') {
|
|
2098
|
+
const onEnter = () => attention();
|
|
2099
|
+
svg.addEventListener('pointerenter', onEnter);
|
|
2100
|
+
stopHover = () => svg.removeEventListener('pointerenter', onEnter);
|
|
2101
|
+
}
|
|
2019
2102
|
painters.set(svg, painter); // paintMascot() on a live rig's SVG reuses its props
|
|
2020
2103
|
const range = { x: Math.max(RANGE.x, Number(rangeX) || 0), y: Math.max(RANGE.y, Number(rangeY) || 0) };
|
|
2021
2104
|
|
|
@@ -2273,7 +2356,40 @@ export function createMascot(container, options) {
|
|
|
2273
2356
|
/** Paint a face frame; while an arm is out its eyes keep to MASCOT_ARM.gaze (never toward an arm). */
|
|
2274
2357
|
function paintFace(f) {
|
|
2275
2358
|
if (arms) arms.sim.prop(f?.prop?.name || null); // an arm whose shoulder this prop covers roots under it
|
|
2276
|
-
|
|
2359
|
+
const shown = arms ? armGaze(f, arms.sim.presence()) : f;
|
|
2360
|
+
painter.paint(shown);
|
|
2361
|
+
paintArt(shown);
|
|
2362
|
+
}
|
|
2363
|
+
|
|
2364
|
+
function paintArt(f = lastFrame || stillFrameNow()) {
|
|
2365
|
+
if (!art) return;
|
|
2366
|
+
const animated = animating() && !tickerPaused() && !destroyed;
|
|
2367
|
+
const attending = animated && hero && pose.name === 'idle' && tickerNow() < attentionUntil;
|
|
2368
|
+
const url = attending
|
|
2369
|
+
? mascotAssetUrl('hover-attention', { animated: true })
|
|
2370
|
+
: mascotAsset(pose.name, { ...pose.raw, ticks }, { animated, hero });
|
|
2371
|
+
// Never rewrite a running GIF's href every frame: that restarts playback.
|
|
2372
|
+
if (artSource !== url) {
|
|
2373
|
+
artSource = url;
|
|
2374
|
+
// Separate playback identities let two panels acknowledge completion
|
|
2375
|
+
// independently, and a later turn can replay the same one-shot.
|
|
2376
|
+
art.setAttribute('href', animated ? `${url}&play=${nextUid()}` : url);
|
|
2377
|
+
}
|
|
2378
|
+
if (artFace) {
|
|
2379
|
+
const value = artTransform(f, poseFrame(pose.name, poseTime(), { ...pose.raw, ticks, still: !playing() }));
|
|
2380
|
+
if (artFace.getAttribute('transform') !== value) artFace.setAttribute('transform', value);
|
|
2381
|
+
}
|
|
2382
|
+
}
|
|
2383
|
+
|
|
2384
|
+
/** Play hover-attention once over the hero's idle (no-op elsewhere or under reduced motion). */
|
|
2385
|
+
function attention() {
|
|
2386
|
+
if (destroyed || !hero || !art || !animating() || pose.name !== 'idle') return api;
|
|
2387
|
+
if (tickerNow() < attentionUntil) return api; // already playing: never restart mid-way
|
|
2388
|
+
attentionUntil = tickerNow() + HOVER_ATTENTION_MS;
|
|
2389
|
+
clearTickerTimeout(attentionTimer);
|
|
2390
|
+
attentionTimer = tickerTimeout(() => { attentionTimer = 0; if (!destroyed) paintArt(); }, HOVER_ATTENTION_MS + 20);
|
|
2391
|
+
paintArt();
|
|
2392
|
+
return api;
|
|
2277
2393
|
}
|
|
2278
2394
|
|
|
2279
2395
|
function compose() {
|
|
@@ -2642,12 +2758,17 @@ export function createMascot(container, options) {
|
|
|
2642
2758
|
function destroy() {
|
|
2643
2759
|
if (destroyed) return;
|
|
2644
2760
|
destroyed = true;
|
|
2761
|
+
paintArt();
|
|
2645
2762
|
setRate(0);
|
|
2646
2763
|
clearWake();
|
|
2647
2764
|
stopPointer?.();
|
|
2648
2765
|
stopPointer = null;
|
|
2649
2766
|
stopKey?.();
|
|
2650
2767
|
stopKey = null;
|
|
2768
|
+
stopHover?.();
|
|
2769
|
+
stopHover = null;
|
|
2770
|
+
clearTickerTimeout(attentionTimer);
|
|
2771
|
+
attentionTimer = 0;
|
|
2651
2772
|
unobserve(svg);
|
|
2652
2773
|
stopArmWatch();
|
|
2653
2774
|
svg.removeEventListener('animationend', onAnimationEnd);
|
|
@@ -2657,6 +2778,7 @@ export function createMascot(container, options) {
|
|
|
2657
2778
|
}
|
|
2658
2779
|
|
|
2659
2780
|
const rig = {
|
|
2781
|
+
artChanged() { paintArt(); },
|
|
2660
2782
|
visibilityChanged(inView) {
|
|
2661
2783
|
if (destroyed) return;
|
|
2662
2784
|
if (svg.isConnected) seenConnected = true;
|
|
@@ -2680,6 +2802,8 @@ export function createMascot(container, options) {
|
|
|
2680
2802
|
blink,
|
|
2681
2803
|
setPose,
|
|
2682
2804
|
react,
|
|
2805
|
+
/** The empty page hero only: play hover-attention once, then idle-hero again. */
|
|
2806
|
+
attention,
|
|
2683
2807
|
setActive,
|
|
2684
2808
|
point,
|
|
2685
2809
|
/** Two quick pokes toward what the arm points at (the beat landed). */
|
|
@@ -2746,7 +2870,7 @@ export function createMascot(container, options) {
|
|
|
2746
2870
|
register(rig);
|
|
2747
2871
|
svg.addEventListener('animationend', onAnimationEnd);
|
|
2748
2872
|
lastFrame = stillFrameNow();
|
|
2749
|
-
|
|
2873
|
+
paintFace(lastFrame);
|
|
2750
2874
|
observe(svg, rig);
|
|
2751
2875
|
if (animating()) {
|
|
2752
2876
|
scheduleIdle();
|
|
@@ -84,6 +84,9 @@ function cafFn() {
|
|
|
84
84
|
}
|
|
85
85
|
const later = (fn, ms) => (env?.setTimeout || globalThis.setTimeout)(fn, ms);
|
|
86
86
|
const unlater = id => (env?.clearTimeout || globalThis.clearTimeout)(id);
|
|
87
|
+
/** A timer on the ticker's clock (the injected one under test). */
|
|
88
|
+
export const tickerTimeout = (fn, ms) => later(fn, ms);
|
|
89
|
+
export const clearTickerTimeout = (id) => { if (id) unlater(id); };
|
|
87
90
|
|
|
88
91
|
function report(err) {
|
|
89
92
|
try { console.error('[synabun-ticker]', err); } catch { /* no console */ }
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════
|
|
2
|
+
// SynaBun — what a SynaBun MCP tool call is called, one way for every panel
|
|
3
|
+
// ═══════════════════════════════════════════
|
|
4
|
+
//
|
|
5
|
+
// Every side panel draws SynaBun's own tools with the SynaBun card (logo, a
|
|
6
|
+
// friendly name, a one-line summary). Which call is SynaBun's, what it is
|
|
7
|
+
// called and what it says on its card are decided here, once:
|
|
8
|
+
//
|
|
9
|
+
// synabunToolKey(name, server?) the bare tool name ('bluesky_post') of a SynaBun call, else null.
|
|
10
|
+
// Claude Code / Codex `mcp__SynaBun__x` (any letter case, also a
|
|
11
|
+
// plugin's `mcp__plugin_<p>_SynaBun__x`), OpenCode `SynaBun_x`, or a
|
|
12
|
+
// tool name with its server given apart (Codex items, Antigravity).
|
|
13
|
+
// isSynabunTool(name, server?) synabunToolKey(...) != null
|
|
14
|
+
// synabunToolGroup(key) what the card's icon is picked by: 'memory' for the memory tools, else
|
|
15
|
+
// the first word of the name (bluesky, browser, gsc, git). Which
|
|
16
|
+
// tool group a tool belongs to is the MCP server's tool catalog
|
|
17
|
+
// (mcp-server/src/services/tool-catalog.ts), never a table here.
|
|
18
|
+
// synabunToolLabel(key) 'Bluesky · Post', 'Recall', 'Search Console · Inspect URL'
|
|
19
|
+
// synabunToolSummary(key, input) one line from the call's input ('' when there is nothing to say)
|
|
20
|
+
//
|
|
21
|
+
// A tool nobody listed still gets a card: its group and action come from its
|
|
22
|
+
// name. No imports and no DOM: node --test, the panels and DOM-free modules
|
|
23
|
+
// (agy-render.js, ocp-v2-*) all load it.
|
|
24
|
+
|
|
25
|
+
const SERVER_RE = /^(?:synabun|plugin_.+_synabun)$/i;
|
|
26
|
+
|
|
27
|
+
/** True when `server` names SynaBun's MCP server (any letter case; a Claude Code plugin's copy too). */
|
|
28
|
+
export function isSynabunServer(server) {
|
|
29
|
+
return SERVER_RE.test(String(server ?? '').trim());
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The bare tool name of a SynaBun MCP call, else null.
|
|
34
|
+
* `server`, when the caller knows it apart from the name (Codex item.server, Antigravity ServerName),
|
|
35
|
+
* decides alone: the name is then the tool's own (a prefixed one is unwrapped too).
|
|
36
|
+
*/
|
|
37
|
+
export function synabunToolKey(name, server) {
|
|
38
|
+
const raw = String(name ?? '').trim();
|
|
39
|
+
if (server != null && String(server).trim() !== '') {
|
|
40
|
+
if (!isSynabunServer(server)) return null;
|
|
41
|
+
return unwrap(raw) || raw || null;
|
|
42
|
+
}
|
|
43
|
+
return unwrap(raw);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function unwrap(raw) {
|
|
47
|
+
const mcp = /^mcp__(.+?)__(.+)$/i.exec(raw);
|
|
48
|
+
if (mcp) return isSynabunServer(mcp[1]) ? mcp[2] : null;
|
|
49
|
+
const oc = /^synabun_(.+)$/i.exec(raw);
|
|
50
|
+
return oc ? oc[1] : null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** synabunToolKey(name, server) != null */
|
|
54
|
+
export function isSynabunTool(name, server) {
|
|
55
|
+
return synabunToolKey(name, server) != null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// ── Names ──
|
|
59
|
+
|
|
60
|
+
// Display names only (what a card says), keyed by the tool's own name.
|
|
61
|
+
// Tools that are one thing, not a group's action:
|
|
62
|
+
const SINGLE = Object.freeze({
|
|
63
|
+
recall: 'Recall', remember: 'Remember', reflect: 'Reflect', forget: 'Forget', restore: 'Restore',
|
|
64
|
+
memories: 'Memories', sync: 'Sync', category: 'Category',
|
|
65
|
+
tool_groups: 'Tool groups', choice: 'Choice', git: 'Git', loop: 'Loop', tictactoe: 'Tic-Tac-Toe',
|
|
66
|
+
style_guide: 'Style Guide', image_staged: 'Staged images', morelogin: 'MoreLogin', skill: 'Skill',
|
|
67
|
+
computer: 'Computer', fb_groups: 'Facebook · Groups', whatsapp_send_file: 'WhatsApp · Send file',
|
|
68
|
+
});
|
|
69
|
+
// The memory tools (their cards share the memory icon).
|
|
70
|
+
const MEMORY = Object.freeze({ recall: 1, remember: 1, reflect: 1, forget: 1, restore: 1, memories: 1, sync: 1, category: 1 });
|
|
71
|
+
// The name a tool's first words stand for; the longest that fits wins.
|
|
72
|
+
const PREFIX_NAMES = Object.freeze({
|
|
73
|
+
browser_extract: 'Extract', browser: 'Browser', bluesky: 'Bluesky', youtube: 'YouTube', gsc: 'Search Console',
|
|
74
|
+
discord: 'Discord', whiteboard: 'Whiteboard', card: 'Cards', agent: 'Agent', computer: 'Computer',
|
|
75
|
+
whatsapp: 'WhatsApp', image: 'Image',
|
|
76
|
+
});
|
|
77
|
+
const PREFIXES = Object.freeze(Object.keys(PREFIX_NAMES).sort((a, b) => b.length - a.length));
|
|
78
|
+
|
|
79
|
+
// Words that are not written in lower case.
|
|
80
|
+
const WORDS = Object.freeze({
|
|
81
|
+
dm: 'DM', ax: 'AX', url: 'URL', urls: 'URLs', id: 'ID', ig: 'IG', li: 'LI', fb: 'FB', wa: 'WA', x: 'X',
|
|
82
|
+
tiktok: 'TikTok', cwv: 'CWV', https: 'HTTPS', api: 'API', ai: 'AI', ui: 'UI', faq: 'FAQ',
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// Names a reader knows better than the words of the tool's name.
|
|
86
|
+
const ACTION_NAMES = Object.freeze({
|
|
87
|
+
browser_go_back: 'Back',
|
|
88
|
+
browser_go_forward: 'Forward',
|
|
89
|
+
browser_extract_tweets: 'Tweets',
|
|
90
|
+
browser_extract_fb_posts: 'Facebook posts',
|
|
91
|
+
browser_extract_fb_groups: 'Facebook groups',
|
|
92
|
+
browser_fb_composer_state: 'Facebook composer',
|
|
93
|
+
browser_x_compose_state: 'X composer',
|
|
94
|
+
bluesky_search_actors: 'Search users',
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
function words(text) {
|
|
98
|
+
const parts = String(text || '').split(/[_\s-]+/).filter(Boolean)
|
|
99
|
+
.map((w) => WORDS[w.toLowerCase()] || w.toLowerCase());
|
|
100
|
+
if (!parts.length) return '';
|
|
101
|
+
const first = parts[0];
|
|
102
|
+
parts[0] = first === first.toLowerCase() ? first.charAt(0).toUpperCase() + first.slice(1) : first;
|
|
103
|
+
return parts.join(' ');
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function prefixOf(key) {
|
|
107
|
+
for (const prefix of PREFIXES) {
|
|
108
|
+
if (key === prefix || key.startsWith(`${prefix}_`)) return { prefix, label: PREFIX_NAMES[prefix] };
|
|
109
|
+
}
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** What a SynaBun card's icon is picked by: 'memory', or the first word of the tool's name. */
|
|
114
|
+
export function synabunToolGroup(key) {
|
|
115
|
+
const k = String(key || '').trim().toLowerCase();
|
|
116
|
+
if (!k) return '';
|
|
117
|
+
if (Object.prototype.hasOwnProperty.call(MEMORY, k)) return 'memory';
|
|
118
|
+
return k.split('_')[0];
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** 'Bluesky · Post', 'Recall', 'Browser · Navigate': the name a SynaBun card shows. */
|
|
122
|
+
export function synabunToolLabel(key) {
|
|
123
|
+
const k = String(key || '').trim().toLowerCase();
|
|
124
|
+
if (!k) return 'SynaBun';
|
|
125
|
+
if (Object.prototype.hasOwnProperty.call(SINGLE, k)) return SINGLE[k];
|
|
126
|
+
const g = prefixOf(k);
|
|
127
|
+
if (!g) return words(k);
|
|
128
|
+
const action = ACTION_NAMES[k] || words(k.slice(g.prefix.length + 1));
|
|
129
|
+
return action ? `${g.label} · ${action}` : g.label;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// ── Summaries ──
|
|
133
|
+
|
|
134
|
+
const MAX_SUMMARY = 90;
|
|
135
|
+
|
|
136
|
+
function line(value) {
|
|
137
|
+
if (value == null) return '';
|
|
138
|
+
if (typeof value === 'number' || typeof value === 'boolean') return String(value);
|
|
139
|
+
if (typeof value !== 'string') return '';
|
|
140
|
+
const s = value.replace(/\s+/g, ' ').trim();
|
|
141
|
+
return s.length > MAX_SUMMARY ? `${s.slice(0, MAX_SUMMARY - 1)}…` : s;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// What a call is about, in the order a reader looks for it. `action` is put in front of it.
|
|
145
|
+
const SUBJECT_FIELDS = ['query', 'q', 'url', 'text', 'content', 'title', 'prompt', 'task', 'message', 'handle', 'actor',
|
|
146
|
+
'uri', 'name', 'property', 'site', 'video_id', 'videoId', 'channel_id', 'selector', 'label', 'key', 'path', 'memory_id', 'id'];
|
|
147
|
+
|
|
148
|
+
const BY_TOOL = Object.freeze({
|
|
149
|
+
remember: (i) => [i.category, i.content].map(line).filter(Boolean).join(': '),
|
|
150
|
+
reflect: (i) => line(i.content) || (i.memory_id ? `Update ${String(i.memory_id).slice(0, 8)}` : ''),
|
|
151
|
+
forget: (i) => line(String(i.memory_id || '').slice(0, 8)),
|
|
152
|
+
restore: (i) => line(String(i.memory_id || '').slice(0, 8)),
|
|
153
|
+
sync: () => '',
|
|
154
|
+
browser_press: (i) => line(i.key),
|
|
155
|
+
browser_scroll: (i) => line(i.direction || i.selector),
|
|
156
|
+
browser_evaluate: (i) => line(i.script || i.expression),
|
|
157
|
+
browser_type: (i) => line(i.text || i.selector),
|
|
158
|
+
browser_fill: (i) => line(i.value || i.text || i.selector),
|
|
159
|
+
browser_select: (i) => line(i.value || i.selector),
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
/** One line from a SynaBun call's input: what it is about, '' when there is nothing to say. */
|
|
163
|
+
export function synabunToolSummary(key, input) {
|
|
164
|
+
const i = input && typeof input === 'object' && !Array.isArray(input) ? input : {};
|
|
165
|
+
const k = String(key || '').toLowerCase();
|
|
166
|
+
const own = BY_TOOL[k];
|
|
167
|
+
if (own) { try { return own(i) || ''; } catch { return ''; } }
|
|
168
|
+
const action = line(i.action);
|
|
169
|
+
let subject = '';
|
|
170
|
+
for (const f of SUBJECT_FIELDS) { subject = line(i[f]); if (subject) break; }
|
|
171
|
+
if (action && subject) return line(`${action} · ${subject}`);
|
|
172
|
+
return action || subject;
|
|
173
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// ── Claude Code tool heartbeats (DOM-free, no imports) ──
|
|
2
|
+
// A tool call that runs past 30 s gets a heartbeat from the CLI every 30 s:
|
|
3
|
+
//
|
|
4
|
+
// { type: 'tool_progress', tool_use_id: '<call id>-heartbeat-0',
|
|
5
|
+
// parent_tool_use_id: '<call id>', heartbeat: true, elapsed_time_seconds: 30 }
|
|
6
|
+
//
|
|
7
|
+
// Its parent_tool_use_id is the call itself, not a subagent that made it, so it
|
|
8
|
+
// must not be routed the way a subagent's messages are (by parent_tool_use_id):
|
|
9
|
+
// the Claude panel drew a fallback subagent card for it at the root of the
|
|
10
|
+
// transcript (a purple bar between two tool rows, which also split one run of
|
|
11
|
+
// calls into rows), and the Assistant opened a subagent feed inside the call.
|
|
12
|
+
// Both panels read a heartbeat as progress of the call it names instead.
|
|
13
|
+
// (Seen live with Claude Code 2.1.316: Bash and MCP calls alike.)
|
|
14
|
+
|
|
15
|
+
const HEARTBEAT_SUFFIX = /-heartbeat-\d+$/;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The id of the tool call a heartbeat is about, or null when the event is not a
|
|
19
|
+
* heartbeat. The CLI's `heartbeat: true` decides; an id of the `-heartbeat-N`
|
|
20
|
+
* form counts too (a producer that leaves the flag out).
|
|
21
|
+
*/
|
|
22
|
+
export function heartbeatToolId(ev) {
|
|
23
|
+
if (!ev || ev.type !== 'tool_progress') return null;
|
|
24
|
+
const own = typeof ev.tool_use_id === 'string' ? ev.tool_use_id : '';
|
|
25
|
+
const flagged = ev.heartbeat === true;
|
|
26
|
+
if (!flagged && !HEARTBEAT_SUFFIX.test(own)) return null;
|
|
27
|
+
const parent = typeof ev.parent_tool_use_id === 'string' ? ev.parent_tool_use_id : '';
|
|
28
|
+
// The call named in the heartbeat's own id; else its parent.
|
|
29
|
+
const named = own.replace(HEARTBEAT_SUFFIX, '');
|
|
30
|
+
if (named && named !== own) return named;
|
|
31
|
+
return parent || own || null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* A heartbeat as the progress of its call, at the level the call was made: the
|
|
36
|
+
* same event with `tool_use_id` set to the call and no parent. Any other event is
|
|
37
|
+
* returned unchanged (the same object).
|
|
38
|
+
*/
|
|
39
|
+
export function normalizeToolHeartbeat(ev) {
|
|
40
|
+
const id = heartbeatToolId(ev);
|
|
41
|
+
if (!id) return ev;
|
|
42
|
+
return { ...ev, tool_use_id: id, parent_tool_use_id: null, heartbeat_of: id };
|
|
43
|
+
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
// Shared cc-dropdown rendering; the pure view owns labels and catalog-derived choices.
|
|
2
2
|
import { dropdownHTML, setDropdownItems, dropdownOf } from './cc-dropdown.js';
|
|
3
|
-
import { toolListView, toolListWord, toolsFromInput, strictToolHost, taskToolHost } from './tool-list-view.js';
|
|
3
|
+
import { toolListView, toolListWord, toolsFromInput, strictToolHost, taskToolHost, unreadableServersNote } from './tool-list-view.js';
|
|
4
4
|
import { getCachedToolCatalog, fetchToolCatalog } from './agent-runtime-options.js';
|
|
5
5
|
let translate;
|
|
6
6
|
export function configureToolPickerTranslation(fn) { if (typeof fn === 'function') translate = fn; }
|
|
7
7
|
export { toolsFromInput, strictToolHost, taskToolHost };
|
|
8
8
|
export const toolWord = (key, params) => toolListWord(key, params, translate);
|
|
9
|
+
/** The sentence naming the providers whose MCP configuration the server could not read, or null. */
|
|
10
|
+
export const toolServersNote = (catalog, provider = 'all') => unreadableServersNote(catalog, provider, translate);
|
|
9
11
|
export function toolPickerHTML(id, tools, options = {}) {
|
|
10
12
|
const catalog = options.catalog || getCachedToolCatalog(options.cwd);
|
|
11
13
|
if (!catalog) return '';
|
|
@@ -23,6 +23,8 @@ export const TOOL_LIST_COPY = Object.freeze({
|
|
|
23
23
|
noServers: 'No external servers',
|
|
24
24
|
blockedServer: 'Blocked by Agents may use it',
|
|
25
25
|
unavailableServer: 'Unavailable on this provider',
|
|
26
|
+
unknownServer: 'Not checked: the provider\'s MCP configuration could not be read',
|
|
27
|
+
serversUnreadable: 'Could not read the MCP configuration of {providers}; servers configured only there are not listed.',
|
|
26
28
|
agentAccess: 'Agents may use it',
|
|
27
29
|
agentAccessHelp: 'Applies to task workers and automations on Codex, OpenCode and Claude, including FleetView, plus the OpenCode tools picker. Other sessions you drive keep their servers.',
|
|
28
30
|
loadFailed: 'Could not load the tool catalog. Try again.',
|
|
@@ -45,7 +47,20 @@ function groupWord(group, field, translate) {
|
|
|
45
47
|
return group[field];
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
// Product names, never translated.
|
|
51
|
+
const PROVIDER_NAMES = Object.freeze({ codex: 'Codex', opencode: 'OpenCode', 'claude-code': 'Claude Code', antigravity: 'Antigravity' });
|
|
52
|
+
/** Providers whose MCP configuration the server could not read (`externalServerErrors`), for `provider` or every one. */
|
|
53
|
+
export function unreadableProviders(catalog, provider = 'all') {
|
|
54
|
+
const rows = Array.isArray(catalog?.externalServerErrors) ? catalog.externalServerErrors : [];
|
|
55
|
+
return [...new Set(rows.map(row => row?.provider).filter(id => typeof id === 'string' && (!provider || provider === 'all' || id === provider)))];
|
|
56
|
+
}
|
|
57
|
+
/** One sentence naming those providers, or null when every provider was read. */
|
|
58
|
+
export function unreadableServersNote(catalog, provider = 'all', translate) {
|
|
59
|
+
const providers = unreadableProviders(catalog, provider);
|
|
60
|
+
return providers.length ? toolListWord('serversUnreadable', { providers: providers.map(id => PROVIDER_NAMES[id] || id).join(', ') }, translate) : null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export const strictToolHost =provider => provider === 'opencode' || provider === 'antigravity';
|
|
49
64
|
export const taskToolHost = provider => strictToolHost(provider) || provider === 'claude-code' || provider === 'codex';
|
|
50
65
|
|
|
51
66
|
/** Hidden-input encoding: inheritance differs from an explicit empty group list. */
|
|
@@ -92,13 +107,17 @@ export function toolListView(catalog, tools, { inheritLabel = null, usesBrowser,
|
|
|
92
107
|
const rows = (catalog.servers || []).filter(row => row.selectable !== false);
|
|
93
108
|
// A saved unavailable ref stays visible and round-trips; loading a catalog never silently clears it.
|
|
94
109
|
for (const ref of refs) if (ref !== 'mcp:*' && !rows.some(row => row.ref === ref)) rows.push({ ref, label: ref.slice(4), providers: {} });
|
|
110
|
+
// A provider the server could not read is `unknown` on every row: disabled like an unavailable one, said apart.
|
|
111
|
+
const unreadable = unreadableServersNote(catalog, provider, translate);
|
|
95
112
|
const options = [
|
|
96
|
-
{ value: 'mcp:*', scope: 'servers', label: word('allServers'), exclusive: true, selected: !inherited && wildcard },
|
|
113
|
+
{ value: 'mcp:*', scope: 'servers', label: word('allServers'), exclusive: true, selected: !inherited && wildcard, ...(unreadable ? { caption: unreadable } : {}) },
|
|
97
114
|
{ value: '__no_servers__', scope: 'servers', label: word('noServers'), exclusive: true, selected: !inherited && !refs.length },
|
|
98
115
|
...rows.map(row => {
|
|
99
116
|
const availability = row.providers?.[provider];
|
|
100
|
-
const
|
|
101
|
-
|
|
117
|
+
const specific = provider && provider !== 'all';
|
|
118
|
+
const unavailable = specific ? availability !== 'deliverable' : !Object.values(row.providers || {}).includes('deliverable');
|
|
119
|
+
const unknown = unavailable && (specific ? availability === 'unknown' : Object.values(row.providers || {}).includes('unknown'));
|
|
120
|
+
return { value: row.ref, scope: 'servers', label: row.label || row.ref.slice(4), selected: !inherited && !wildcard && refs.includes(row.ref), disabled: row.blocked || unavailable, caption: row.blocked ? word('blockedServer') : unknown ? word('unknownServer') : unavailable ? word('unavailableServer') : row.ref };
|
|
102
121
|
}),
|
|
103
122
|
];
|
|
104
123
|
entries.push({ group: word('servers'), options });
|