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
|
@@ -34,9 +34,15 @@ if (hostedSidepanelId && host) {
|
|
|
34
34
|
end = panel.endHostedAntigravitySessions;
|
|
35
35
|
// The active tab's project (the picker's hidden input holds '' until the project list has loaded).
|
|
36
36
|
defaults = panel.antigravityPanelDefaults;
|
|
37
|
+
} else if (provider === 'maritaca') {
|
|
38
|
+
const panel = await import('./ui-maritaca-panel.js');
|
|
39
|
+
await panel.toggleMaritacaPanel();
|
|
40
|
+
receivePath = () => false; // Maritaca takes no files: it is a chat API
|
|
41
|
+
end = panel.endHostedMaritacaSessions;
|
|
42
|
+
defaults = panel.maritacaPanelDefaults;
|
|
37
43
|
} else throw new Error('Unknown session provider');
|
|
38
|
-
const focus = () => document.querySelector('#cp-input, #cxp-input, .ocpv2-compose textarea, .agy-input')?.focus();
|
|
39
|
-
const title = document.querySelector('.cp-session-label, .cxp-session-label, .ocpv2-session-label, .agy-session-btn span');
|
|
44
|
+
const focus = () => document.querySelector('#cp-input, #cxp-input, .ocpv2-compose textarea, .agy-input, .mtc-input')?.focus();
|
|
45
|
+
const title = document.querySelector('.cp-session-label, .cxp-session-label, .ocpv2-session-label, .agy-session-btn span, .mtc-session-label');
|
|
40
46
|
const syncTitle = () => host.title(hostedSidepanelId, title?.textContent?.trim());
|
|
41
47
|
if (title) new MutationObserver(syncTitle).observe(title, { childList: true, subtree: true, characterData: true });
|
|
42
48
|
syncTitle();
|
|
@@ -7,9 +7,9 @@ import { normalizeSessionWindowStatus } from './sidepanel-session-status.js';
|
|
|
7
7
|
import { savedTabsStatus } from './ui-sidepanel-tray.js';
|
|
8
8
|
|
|
9
9
|
let manifestKey;
|
|
10
|
-
const PROVIDERS = { claude: 'Claude', codex: 'Codex', opencode: 'OpenCode', antigravity: 'Antigravity' };
|
|
10
|
+
const PROVIDERS = { claude: 'Claude', codex: 'Codex', opencode: 'OpenCode', antigravity: 'Antigravity', maritaca: 'Maritaca' };
|
|
11
11
|
// provider-icons.js ids: the window's pill wears its provider's icon and colour.
|
|
12
|
-
const PROVIDER_IDS = { claude: 'claude-code', codex: 'codex', opencode: 'opencode', antigravity: 'antigravity' };
|
|
12
|
+
const PROVIDER_IDS = { claude: 'claude-code', codex: 'codex', opencode: 'opencode', antigravity: 'antigravity', maritaca: 'maritaca' };
|
|
13
13
|
const STATUS_WORDS = { working: 'working', action: 'needs you' };
|
|
14
14
|
const entries = new Map();
|
|
15
15
|
const editorOwners = new Map();
|
|
@@ -22,7 +22,7 @@ function save() {
|
|
|
22
22
|
function storageFor(id) {
|
|
23
23
|
// Session lists/registries share one live cache. Unscoped defaults and legacy
|
|
24
24
|
// session pointers belong to the individual document, never another session.
|
|
25
|
-
const scoped = key => /^(synabun-(claude|codex|antigravity)-panel-(session|thread|title|project|model|effort|autoaccept|default-model|permission-mode)|opencode-v2-project)$/.test(key);
|
|
25
|
+
const scoped = key => /^(synabun-(claude|codex|antigravity|maritaca)-panel-(session|thread|title|project|model|effort|autoaccept|default-model|permission-mode)|opencode-v2-project)$/.test(key);
|
|
26
26
|
const keyFor = key => scoped(key) ? `synabun-session-pref-${id}:${key}` : key;
|
|
27
27
|
return {
|
|
28
28
|
getItem(key) {
|
|
@@ -12,6 +12,7 @@ import { toggleClaudePanel, isClaudePanelOpen, bootClaudePanel } from './ui-clau
|
|
|
12
12
|
import { toggleCodexPanel, isCodexPanelOpen, bootCodexPanel } from './ui-codex-panel.js';
|
|
13
13
|
import { toggleOpencodePanel, isOpencodePanelOpen, bootOpencodePanel } from './ui-opencode-panel-v2.js';
|
|
14
14
|
import { toggleAntigravityPanel, isAntigravityPanelOpen, bootAntigravityPanel } from './ui-antigravity-panel.js';
|
|
15
|
+
import { toggleMaritacaPanel, isMaritacaPanelOpen, bootMaritacaPanel } from './ui-maritaca-panel.js';
|
|
15
16
|
import { nativeLoopWindowId } from './ui-native-window-id.js';
|
|
16
17
|
|
|
17
18
|
const PLACEHOLDER_CLASS = 'sidepanel-tray-placeholder';
|
|
@@ -62,6 +63,13 @@ const PROVIDERS = {
|
|
|
62
63
|
attentionClass: 'agy-pill-attention',
|
|
63
64
|
eventName: 'antigravity-panel:show',
|
|
64
65
|
},
|
|
66
|
+
maritaca: {
|
|
67
|
+
providerId: 'maritaca',
|
|
68
|
+
windowKey: 'mtc-window-id',
|
|
69
|
+
tabsKeyPrefix: 'synabun-maritaca-panel-tabs',
|
|
70
|
+
pillClass: 'mtc-session-pill',
|
|
71
|
+
eventName: 'maritaca-panel:show',
|
|
72
|
+
},
|
|
65
73
|
};
|
|
66
74
|
|
|
67
75
|
// How each panel boots without showing itself, and whether it should: OpenCode only
|
|
@@ -73,6 +81,8 @@ const BOOT_HIDDEN = {
|
|
|
73
81
|
// An Antigravity turn ends with the page that ran it (its `agy acp` belongs to the panel socket), so a saved tab is
|
|
74
82
|
// never working after a reload: booting would only start Antigravity to say so.
|
|
75
83
|
antigravity: { boot: () => bootAntigravityPanel(), ready: async () => false },
|
|
84
|
+
// Maritaca turns outlive a page reload; boot hidden to recover their live partial and pill.
|
|
85
|
+
maritaca: { boot: () => bootMaritacaPanel(), ready: async () => (await (await fetch('/api/maritaca/panel')).json())?.turns > 0 },
|
|
76
86
|
opencode: {
|
|
77
87
|
boot: () => bootOpencodePanel(),
|
|
78
88
|
ready: async () => (await (await fetch('/api/opencode-v2/status')).json())?.running === true,
|
|
@@ -176,8 +186,17 @@ function hasAntigravityState(tab) {
|
|
|
176
186
|
);
|
|
177
187
|
}
|
|
178
188
|
|
|
189
|
+
function hasMaritacaState(tab) {
|
|
190
|
+
return !!(tab.sessionId || tab.running || tab.attachments?.length || normalizeLabel(tab.draft) || normalizeLabel(tab.title));
|
|
191
|
+
}
|
|
192
|
+
|
|
179
193
|
function tabLabel(provider, tab) {
|
|
180
194
|
if (provider === 'claude') return normalizeLabel(tab.label) || 'New chat';
|
|
195
|
+
if (provider === 'maritaca') {
|
|
196
|
+
const title = normalizeLabel(tab.title);
|
|
197
|
+
if (title) return title;
|
|
198
|
+
return tab.sessionId ? `Maritaca · ${String(tab.sessionId).slice(0, 8)}` : 'New conversation';
|
|
199
|
+
}
|
|
181
200
|
if (provider === 'antigravity') {
|
|
182
201
|
const title = normalizeLabel(tab.title || tab.label);
|
|
183
202
|
if (title && !isDefaultLabel(title, ['new session'])) return title;
|
|
@@ -199,6 +218,7 @@ function tabId(provider, tab, index) {
|
|
|
199
218
|
if (provider === 'codex' && tab.threadId) return String(tab.threadId);
|
|
200
219
|
if (provider === 'opencode' && tab.sessionId) return String(tab.sessionId);
|
|
201
220
|
if (provider === 'antigravity' && tab.sessionId) return String(tab.sessionId);
|
|
221
|
+
if (provider === 'maritaca' && tab.sessionId) return String(tab.sessionId);
|
|
202
222
|
return `${provider}-${index}`;
|
|
203
223
|
}
|
|
204
224
|
|
|
@@ -369,6 +389,7 @@ function statePredicate(provider) {
|
|
|
369
389
|
if (provider === 'claude') return hasClaudeState;
|
|
370
390
|
if (provider === 'codex') return hasCodexState;
|
|
371
391
|
if (provider === 'antigravity') return hasAntigravityState;
|
|
392
|
+
if (provider === 'maritaca') return hasMaritacaState;
|
|
372
393
|
return hasOpenCodeState;
|
|
373
394
|
}
|
|
374
395
|
|
|
@@ -376,6 +397,7 @@ function dedupeKeyForTab(provider, tab) {
|
|
|
376
397
|
if (provider === 'claude') return tab.sessionId ? `cp:${tab.sessionId}` : null;
|
|
377
398
|
if (provider === 'codex') return tab.threadId ? `cxp:${tab.threadId}` : null;
|
|
378
399
|
if (provider === 'antigravity') return tab.sessionId ? `agy:${tab.sessionId}` : null;
|
|
400
|
+
if (provider === 'maritaca') return tab.sessionId ? `mtc:${tab.sessionId}` : null;
|
|
379
401
|
return tab.sessionId ? `ocp:${tab.sessionId}` : null;
|
|
380
402
|
}
|
|
381
403
|
|
|
@@ -547,6 +569,8 @@ async function openProvider(provider, tabIdValue, sourceKey) {
|
|
|
547
569
|
if (!isOpencodePanelOpen()) await toggleOpencodePanel();
|
|
548
570
|
} else if (provider === 'antigravity') {
|
|
549
571
|
if (!isAntigravityPanelOpen()) await toggleAntigravityPanel();
|
|
572
|
+
} else if (provider === 'maritaca') {
|
|
573
|
+
if (!isMaritacaPanelOpen()) await toggleMaritacaPanel();
|
|
550
574
|
}
|
|
551
575
|
emit(PROVIDERS[provider]?.eventName, { tabId: tabIdValue });
|
|
552
576
|
} finally {
|
|
@@ -7,7 +7,7 @@ import { FRAMED_CLASS, frameRect } from './app-frame.js';
|
|
|
7
7
|
|
|
8
8
|
const STORAGE_PREFIX = 'synabun-sidepanel-layout-';
|
|
9
9
|
const surfaces = new Map();
|
|
10
|
-
const LABELS = { claude: 'Claude', codex: 'Codex', opencode: 'OpenCode', antigravity: 'Antigravity', assistant: 'SynaBun Assistant' };
|
|
10
|
+
const LABELS = { claude: 'Claude', codex: 'Codex', opencode: 'OpenCode', antigravity: 'Antigravity', maritaca: 'Maritaca', assistant: 'SynaBun Assistant' };
|
|
11
11
|
const DETACH_ICON = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><rect x="3" y="7" width="14" height="14" rx="2"/><path d="M13 3h8v8M21 3l-9 9"/></svg>';
|
|
12
12
|
const DOCK_ICON = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><rect x="3" y="4" width="18" height="16" rx="2"/><path d="M15 4v16M6 12h6m-3-3 3 3-3 3"/></svg>';
|
|
13
13
|
const MOVE_ICON = '<svg viewBox="0 0 16 16" fill="currentColor"><circle cx="5" cy="4" r="1"/><circle cx="11" cy="4" r="1"/><circle cx="5" cy="8" r="1"/><circle cx="11" cy="8" r="1"/><circle cx="5" cy="12" r="1"/><circle cx="11" cy="12" r="1"/></svg>';
|
|
@@ -14,6 +14,7 @@ import { registerAction } from './ui-keybinds.js';
|
|
|
14
14
|
import { isGuest, hasPermission } from './ui-sync.js';
|
|
15
15
|
import { getWhiteboardElementById } from './ui-whiteboard.js';
|
|
16
16
|
import { createFrameRenderer } from './utils.js';
|
|
17
|
+
import { refreshPageSession } from './page-session.js';
|
|
17
18
|
import { frameRect, onFrameChange, clampBox, clampBoxLoose } from './app-frame.js';
|
|
18
19
|
import { notify, NOTIF_TYPE } from './ui-notifications.js';
|
|
19
20
|
import { getProviderMeta } from './provider-icons.js';
|
|
@@ -22,6 +23,7 @@ import { initRendererManager, acquireRenderer, disposeRenderer, hasWebgl, noteFo
|
|
|
22
23
|
import { mountAssistant } from './assistant/asst-panel.js';
|
|
23
24
|
import { getAssistantSession } from './assistant/asst-api.js';
|
|
24
25
|
import { mascotCameoSvg } from './synabun-mascot.js';
|
|
26
|
+
import { refusalOfError } from './owner-access.js';
|
|
25
27
|
import { brainLabel, normalizeBrain, readStoredBrain, restoredSessionName, sessionNameGivenUp } from './assistant/asst-state.js';
|
|
26
28
|
import { initAssistant, registerAssistantHost, openAssistant, assistantOwnerOf, readLiveAssistantSessions, assistantBlocked, isAssistantSessionLive } from './ui-assistant.js';
|
|
27
29
|
|
|
@@ -3051,7 +3053,9 @@ async function openBrowserSession(url, fresh, _unused, force) {
|
|
|
3051
3053
|
if (!_wsReconnectAttempted) {
|
|
3052
3054
|
_wsReconnectAttempted = true;
|
|
3053
3055
|
console.log('[browser] WS closed unexpectedly, attempting reconnect for', sessionId);
|
|
3054
|
-
setTimeout(() => {
|
|
3056
|
+
setTimeout(async () => {
|
|
3057
|
+
// A socket refused for an earlier boot's page secret never says why: ask for this boot's first.
|
|
3058
|
+
await refreshPageSession(window);
|
|
3055
3059
|
const sess2 = _sessions.find(s => s.id === sessionId);
|
|
3056
3060
|
if (!sess2 || sess2.dead) return;
|
|
3057
3061
|
const proto2 = location.protocol === 'https:' ? 'wss:' : 'ws:';
|
|
@@ -3300,7 +3304,9 @@ async function reconnectBrowserSession(sessionId, liveData, saved) {
|
|
|
3300
3304
|
if (!_wsReconnAttempted) {
|
|
3301
3305
|
_wsReconnAttempted = true;
|
|
3302
3306
|
console.log('[browser] Reconnect WS closed, retrying once for', sessionId);
|
|
3303
|
-
setTimeout(() => {
|
|
3307
|
+
setTimeout(async () => {
|
|
3308
|
+
// A socket refused for an earlier boot's page secret never says why: ask for this boot's first.
|
|
3309
|
+
await refreshPageSession(window);
|
|
3304
3310
|
const sess2 = _sessions.find(s => s.id === sessionId);
|
|
3305
3311
|
if (!sess2 || sess2.dead) return;
|
|
3306
3312
|
const proto2 = location.protocol === 'https:' ? 'wss:' : 'ws:';
|
|
@@ -6219,12 +6225,14 @@ export async function initTerminal() {
|
|
|
6219
6225
|
// ── Auto-reconnect to surviving sessions on page load ──
|
|
6220
6226
|
const registry = loadSessionRegistry();
|
|
6221
6227
|
if (registry.length > 0) {
|
|
6222
|
-
// Fetch live terminal sessions
|
|
6228
|
+
// Fetch live terminal sessions. A read the server refused this page (no owner access: SynaBun's automation
|
|
6229
|
+
// browser opened it) says nothing about which sessions live: the saved list is then left as it is (below).
|
|
6230
|
+
let refusedRead = false;
|
|
6223
6231
|
let liveSessions = [];
|
|
6224
6232
|
try {
|
|
6225
6233
|
const data = await fetchTerminalSessions();
|
|
6226
6234
|
liveSessions = data.sessions || [];
|
|
6227
|
-
} catch {}
|
|
6235
|
+
} catch (err) { if (refusalOfError(err)) refusedRead = true; }
|
|
6228
6236
|
const liveMap = new Map(liveSessions.map(s => [s.id, s]));
|
|
6229
6237
|
|
|
6230
6238
|
// Fetch live browser sessions + check stream config
|
|
@@ -6233,7 +6241,7 @@ export async function initTerminal() {
|
|
|
6233
6241
|
try {
|
|
6234
6242
|
const data = await fetchBrowserSessions();
|
|
6235
6243
|
liveBrowserSessions = data.sessions || [];
|
|
6236
|
-
} catch {}
|
|
6244
|
+
} catch (err) { if (refusalOfError(err)) refusedRead = true; }
|
|
6237
6245
|
try {
|
|
6238
6246
|
const cfgRes = await fetch('/api/browser/config');
|
|
6239
6247
|
const cfgData = await cfgRes.json();
|
|
@@ -6319,8 +6327,8 @@ export async function initTerminal() {
|
|
|
6319
6327
|
|
|
6320
6328
|
_markLatePaneSwitches();
|
|
6321
6329
|
|
|
6322
|
-
// Clean up dead sessions from registry
|
|
6323
|
-
if (toReconnect.length !== registry.length) {
|
|
6330
|
+
// Clean up dead sessions from registry (never after a refused read: those sessions may well be alive)
|
|
6331
|
+
if (toReconnect.length !== registry.length && !refusedRead) {
|
|
6324
6332
|
saveSessionRegistry();
|
|
6325
6333
|
}
|
|
6326
6334
|
}
|
|
@@ -15,6 +15,7 @@ import { createBrainPicker } from './assistant/asst-brain-picker.js';
|
|
|
15
15
|
import { createComposer } from './assistant/asst-composer.js';
|
|
16
16
|
import { createComputerToggle } from './assistant/asst-computer.js';
|
|
17
17
|
import { createRouteModeControl } from './assistant/asst-route.js';
|
|
18
|
+
import { watchEmpty } from './shown-children.js';
|
|
18
19
|
|
|
19
20
|
const macLike = () => /Mac/i.test(navigator.platform || navigator.userAgent || '');
|
|
20
21
|
|
|
@@ -28,6 +29,8 @@ export function createTutorialPreview(panel, { onSend = () => {} } = {}) {
|
|
|
28
29
|
bar.innerHTML = '<div class="asst-bar"><div class="asst-bar-left"><div class="asst-bar-group" data-group="route"></div><div class="asst-bar-group" data-group="context"></div><div class="asst-bar-group" data-group="computer"></div></div><div class="asst-bar-right"></div></div>';
|
|
29
30
|
panel.querySelector('.asp-body').append(viewport);
|
|
30
31
|
panel.querySelector('.asp-bar-slot').append(bar);
|
|
32
|
+
// A group with nothing to show is hidden through data-empty, as in the panel (asst-panel.js).
|
|
33
|
+
const barEmpty = watchEmpty(bar, '.asst-bar-group');
|
|
31
34
|
const root = viewport.querySelector('.asst-root');
|
|
32
35
|
const transcript = root.querySelector('.asst-transcript');
|
|
33
36
|
transcript.setAttribute('aria-label', t('assistant.transcript'));
|
|
@@ -96,6 +99,7 @@ export function createTutorialPreview(panel, { onSend = () => {} } = {}) {
|
|
|
96
99
|
route.destroy();
|
|
97
100
|
computer.destroy();
|
|
98
101
|
renderer.destroy?.();
|
|
102
|
+
barEmpty.disconnect();
|
|
99
103
|
viewport.remove();
|
|
100
104
|
bar.remove();
|
|
101
105
|
},
|
|
@@ -71,6 +71,9 @@ function applyTopRightButton(data) {
|
|
|
71
71
|
if (!btn) return;
|
|
72
72
|
const has = !!data?.updateAvailable;
|
|
73
73
|
btn.style.display = has ? '' : 'none';
|
|
74
|
+
// The same state on <html> for styles.css (the row's width, the dot on the tools toggle): a selector reading the
|
|
75
|
+
// button's inline style from the root re-styled the whole page on every style change (css-has-performance test).
|
|
76
|
+
document.documentElement.classList.toggle('topright-update-shown', has);
|
|
74
77
|
if (badge) {
|
|
75
78
|
badge.classList.add('update-click-target');
|
|
76
79
|
badge.textContent = has ? '!' : '';
|
|
@@ -15,6 +15,7 @@ import { openSettingsModal } from './ui-settings.js';
|
|
|
15
15
|
import { fetchRulesStatus } from './api.js';
|
|
16
16
|
import { registerContextMenuArea } from './context-menu-areas.js';
|
|
17
17
|
import { frameRect } from './app-frame.js';
|
|
18
|
+
import { windowTakesKey } from './window-keys.js';
|
|
18
19
|
import { readListItems, writeListItems, fitListLevels, indentListItem, outdentListItem, listMarkers } from './whiteboard-list.js';
|
|
19
20
|
|
|
20
21
|
// ── Helpers ──
|
|
@@ -3090,6 +3091,9 @@ function onKeyDown(e) {
|
|
|
3090
3091
|
// Nor while it is in the File Explorer, or in what it opens over the page (its menu, preview and questions):
|
|
3091
3092
|
// Delete there deletes a file, and a letter is the name of a row being typed.
|
|
3092
3093
|
if (ae?.closest?.('#file-explorer-panel, .fe-ctx-flyout, .fe-modal-overlay, .fe-git-popover')) return;
|
|
3094
|
+
// Nor a key of an open Notifications or Automation Studio window, and their Escape wherever the focus is (they
|
|
3095
|
+
// close on it; window-keys.js): taken here first, it never reached them.
|
|
3096
|
+
if (windowTakesKey(e, ae)) return;
|
|
3093
3097
|
|
|
3094
3098
|
const isEditingText = !!document.activeElement?.closest('.wb-text.editing');
|
|
3095
3099
|
const editingListLi = document.activeElement?.closest('.wb-list.editing li') || null;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════
|
|
2
|
+
// SynaBun Neural Interface — which keys a floating window takes from the whiteboard
|
|
3
|
+
// ═══════════════════════════════════════════
|
|
4
|
+
//
|
|
5
|
+
// The whiteboard listens for keys at the document in the capture phase, ahead of every element, and stops the ones
|
|
6
|
+
// it acts on (Escape deselects and resets the tool there). The Notifications window (ui-sessions.js) and Automation
|
|
7
|
+
// Studio (ui-automation-studio.js) close on Escape from a listener at the document, so on a page showing the board
|
|
8
|
+
// that Escape never reached them. While one of these windows is open:
|
|
9
|
+
// • a key pressed inside it (target or focus) is the window's, never a board shortcut;
|
|
10
|
+
// • Escape is the window's wherever the focus is (the window is the top layer: its backdrop covers the board, and
|
|
11
|
+
// its own Escape handling closes a list, a popover or the search first), except while a text on the board is
|
|
12
|
+
// being edited (the focus is inside the board): that Escape still ends the edit.
|
|
13
|
+
// Text fields keep their own Escape: the whiteboard leaves keys typed in a field alone already.
|
|
14
|
+
//
|
|
15
|
+
// No DOM needed: `node --test` passes stand-ins with closest / querySelector (tests/window-keys.test.mjs).
|
|
16
|
+
|
|
17
|
+
/** The windows that close on Escape and take it from the board. */
|
|
18
|
+
export const ESCAPE_WINDOWS = Object.freeze(['#session-monitor-panel', '#automation-studio-panel']);
|
|
19
|
+
const SELECTOR = ESCAPE_WINDOWS.join(', ');
|
|
20
|
+
const BOARD = '#static-bg';
|
|
21
|
+
|
|
22
|
+
const inside = (node, selector) => {
|
|
23
|
+
try { return !!(node && typeof node.closest === 'function' && node.closest(selector)); } catch { return false; }
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** Whether one of ESCAPE_WINDOWS is on the page. */
|
|
27
|
+
export function escapeWindowOpen(doc = globalThis.document) {
|
|
28
|
+
try { return !!(doc && typeof doc.querySelector === 'function' && doc.querySelector(SELECTOR)); } catch { return false; }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Whether the board must leave this key to an open window (see above). */
|
|
32
|
+
export function windowTakesKey(event, active = globalThis.document?.activeElement, doc = globalThis.document) {
|
|
33
|
+
if (!event) return false;
|
|
34
|
+
if (inside(event.target, SELECTOR) || inside(active, SELECTOR)) return true;
|
|
35
|
+
if (event.key !== 'Escape') return false;
|
|
36
|
+
if (inside(active, BOARD)) return false;
|
|
37
|
+
return escapeWindowOpen(doc);
|
|
38
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Optimise approved v3 drawings without resizing, redrawing or changing timing.
|
|
3
|
+
import { readFile, writeFile, readdir, rm, mkdir } from 'node:fs/promises';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import sharp from 'sharp';
|
|
7
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const SRC = path.resolve(here, '../../.synabun/design/mascot-animations-v3');
|
|
9
|
+
const OUT = path.resolve(here, '../public/assets/mascot');
|
|
10
|
+
async function buildSet(src, out, mascot = false) {
|
|
11
|
+
const source = JSON.parse(await readFile(path.join(src, 'manifest.json'), 'utf8'));
|
|
12
|
+
await mkdir(out, { recursive: true });
|
|
13
|
+
for (const f of await readdir(out)) if (/\.(gif|png)$/.test(f)) await rm(path.join(out, f));
|
|
14
|
+
const manifest = {};
|
|
15
|
+
for (const state of source.states) {
|
|
16
|
+
const key = mascot && state.id === 'thinking' ? 'think' : state.id;
|
|
17
|
+
const input = await readFile(path.join(src, state.gif));
|
|
18
|
+
const meta = await sharp(input, { animated: true }).metadata();
|
|
19
|
+
const once = !state.intended_behavior.includes('loop');
|
|
20
|
+
const gif = await sharp(input, { animated: true }).gif({ loop: once ? 1 : 0, delay: meta.delay, colours: 16, dither: 0, effort: 10 }).toBuffer();
|
|
21
|
+
const png = await sharp(path.join(src, state.still)).png({ compressionLevel: 9 }).toBuffer();
|
|
22
|
+
await writeFile(path.join(out, `${key}.gif`), gif);
|
|
23
|
+
await writeFile(path.join(out, `${key}.png`), png);
|
|
24
|
+
manifest[key] = { source: state.gif, duration: meta.delay.reduce((a, b) => a + b, 0), once, width: meta.width, height: meta.pageHeight || meta.height, frames: meta.pages, bytes: gif.length };
|
|
25
|
+
}
|
|
26
|
+
await writeFile(path.join(out, 'manifest.json'), JSON.stringify(manifest, null, 2) + '\n');
|
|
27
|
+
console.log(`${out}: ${Object.keys(manifest).length} assets`);
|
|
28
|
+
}
|
|
29
|
+
await buildSet(SRC, OUT, true);
|
|
30
|
+
await buildSet(path.join(SRC, 'scenes'), path.join(OUT, 'scenes'));
|