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
package/mcp-server/src/http.ts
CHANGED
|
@@ -37,8 +37,10 @@ import {
|
|
|
37
37
|
sanitizeDesktopGrant,
|
|
38
38
|
sanitizePin,
|
|
39
39
|
sanitizeRole,
|
|
40
|
+
sanitizeTerminalToken,
|
|
40
41
|
runWithBrainCredential,
|
|
41
42
|
runWithIdentity,
|
|
43
|
+
runWithTerminalToken,
|
|
42
44
|
releaseIdentity,
|
|
43
45
|
startIdentitySweeper,
|
|
44
46
|
} from './services/identity.js';
|
|
@@ -78,6 +80,30 @@ export interface McpRoutesOptions {
|
|
|
78
80
|
* answers, the session has exactly that selection and X-Synabun-Tools is ignored.
|
|
79
81
|
*/
|
|
80
82
|
selectionFor?: (req: Request) => McpSessionSelection | null | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* The host's check of a run's pin (the Neural Interface's terminal tokens, neural-interface/lib/terminal-tokens.js):
|
|
85
|
+
* true when this request may route as `pin` with the X-Synabun-Terminal-Token it carries (`token`, or null). A pin
|
|
86
|
+
* it refuses (a run SynaBun gave a token to, named without that token) is not this caller's: the request routes as
|
|
87
|
+
* its own MCP session, so it never shares that run's identity (its browser pins, its recovered tab) and never sends
|
|
88
|
+
* the run's id to the Neural Interface. Without it, every pin is taken as it is said (the standalone server).
|
|
89
|
+
*/
|
|
90
|
+
terminalAuth?: (pin: string, token: string | null) => boolean;
|
|
91
|
+
/**
|
|
92
|
+
* The host's proof for a plain MCP session (neural-interface/lib/terminal-tokens.js issueSession / revokeSession):
|
|
93
|
+
* a CLI window's Claude Code or Codex that SynaBun did not start names no run, so its id to the Neural Interface is
|
|
94
|
+
* its Mcp-Session-Id. `issue` is asked once, when such a session initializes from this computer (loopback, no pin,
|
|
95
|
+
* not through the tunnel), and the session then sends its proof with its id on every Neural Interface request it
|
|
96
|
+
* makes (callerTerminalToken), so no other process can act as it there, and the Neural Interface can let it pick its
|
|
97
|
+
* own MoreLogin profile (`morelogin` `use`). The proof never leaves this process: it is not sent to the MCP client.
|
|
98
|
+
* `revoke` is called when the session closes or is evicted. Without it (the standalone server, the worker-only
|
|
99
|
+
* channel) a plain session has no proof, as before.
|
|
100
|
+
* `eligible` is the host's own answer for the initializing request, asked after wantsSessionProof and before
|
|
101
|
+
* `issue`: the Neural Interface says yes only on its plain /mcp mount (never /mcp/<key>, which shares this router),
|
|
102
|
+
* for a request that is not from outside by its own rules and whose peer process is not a relay or a proxy (review
|
|
103
|
+
* b6631e9d, finding 5: a loopback socket without CF-Connecting-IP is also what a local reverse proxy in front of the
|
|
104
|
+
* keyed mount looks like). A host that gives `issue` without `eligible` gets no proof issued: fail closed.
|
|
105
|
+
*/
|
|
106
|
+
sessionProof?: { issue: (sessionId: string) => string | null; revoke: (sessionId: string) => void; eligible?: (req: Request) => boolean };
|
|
81
107
|
}
|
|
82
108
|
|
|
83
109
|
/**
|
|
@@ -113,8 +139,12 @@ interface McpHttpSession {
|
|
|
113
139
|
transport: StreamableHTTPServerTransport;
|
|
114
140
|
server: ReturnType<typeof createMcpServer>;
|
|
115
141
|
lastSeen: number;
|
|
142
|
+
/** The host's proof of this session's own id (McpRoutesOptions.sessionProof), for a plain session only. */
|
|
143
|
+
proof?: string | null;
|
|
116
144
|
}
|
|
117
145
|
const mcpSessions = new Map<string, McpHttpSession>();
|
|
146
|
+
/** sid → the host's revoke for the proof it gave that session (the router that initialized it), or null. */
|
|
147
|
+
const revokeProof = new Map<string, ((sessionId: string) => void) | null>();
|
|
118
148
|
|
|
119
149
|
const MCP_SESSION_TTL_MS = parseInt(process.env.SYNABUN_MCP_SESSION_TTL_MS || '', 10) || 60 * 60 * 1000;
|
|
120
150
|
|
|
@@ -126,7 +156,7 @@ function startSessionSweeper(): void {
|
|
|
126
156
|
const now = Date.now();
|
|
127
157
|
for (const [sid, entry] of mcpSessions) {
|
|
128
158
|
if (now - entry.lastSeen > MCP_SESSION_TTL_MS) {
|
|
129
|
-
console.error(`[mcp-http] session ${sid} evicted after ${Math.round((now - entry.lastSeen) / 60000)}min idle (${mcpSessions.size - 1} remain)`);
|
|
159
|
+
console.error(`[mcp-http] session ${sessionLogId(sid)} evicted after ${Math.round((now - entry.lastSeen) / 60000)}min idle (${mcpSessions.size - 1} remain)`);
|
|
130
160
|
// transport.close() fires onclose → map cleanup + releaseIdentity + server.close.
|
|
131
161
|
try { entry.transport.close(); } catch { /* already closed */ }
|
|
132
162
|
}
|
|
@@ -145,12 +175,45 @@ onSchemaRefresh(() => {
|
|
|
145
175
|
}
|
|
146
176
|
});
|
|
147
177
|
|
|
178
|
+
/**
|
|
179
|
+
* What proves this request's X-Synabun-Terminal pin: its X-Synabun-Terminal-Token, else (an Assistant brain, whose pin
|
|
180
|
+
* the Neural Interface binds to its launch credential) its X-Synabun-Brain-Token. None for a tunnel caller (a remote
|
|
181
|
+
* MCP-key holder) or a malformed one.
|
|
182
|
+
*/
|
|
183
|
+
export function requestTerminalToken(req: Pick<Request, 'get'>): string | null {
|
|
184
|
+
if (req.get('cf-connecting-ip')) return null;
|
|
185
|
+
return sanitizeTerminalToken(req.get('x-synabun-terminal-token')) ?? sanitizeBrainCredential(req.get('x-synabun-brain-token'));
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const refusedPinsLogged = new Set<string>();
|
|
189
|
+
/**
|
|
190
|
+
* The X-Synabun-Terminal pin this request may route as: the header's, unless the host's terminalAuth refuses it (a
|
|
191
|
+
* run's pin without that run's token, or a check that threw: fail closed), then none.
|
|
192
|
+
*/
|
|
193
|
+
export function acceptedTerminalPin(req: Pick<Request, 'get'>, options: McpRoutesOptions = {}): string | null {
|
|
194
|
+
const pin = sanitizePin(req.get('x-synabun-terminal'));
|
|
195
|
+
if (!pin || typeof options.terminalAuth !== 'function') return pin;
|
|
196
|
+
let accepted = false;
|
|
197
|
+
try { accepted = options.terminalAuth(pin, requestTerminalToken(req)) === true; } catch { accepted = false; }
|
|
198
|
+
if (accepted) return pin;
|
|
199
|
+
if (!refusedPinsLogged.has(pin)) {
|
|
200
|
+
refusedPinsLogged.add(pin);
|
|
201
|
+
if (refusedPinsLogged.size > 1000) refusedPinsLogged.delete(refusedPinsLogged.values().next().value as string);
|
|
202
|
+
// Finding 4 (re-review of 2026-11-11): the refused value may be a live Mcp-Session-Id (a bearer for that session),
|
|
203
|
+
// so the log line carries its short form only, never the whole value.
|
|
204
|
+
console.error(`[mcp-http] X-Synabun-Terminal ${sessionLogId(pin)} came without that run's terminal token: routed as its own MCP session`);
|
|
205
|
+
}
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
|
|
148
209
|
/**
|
|
149
210
|
* Per-request caller identity. Explicit X-Synabun-* headers (injected into the
|
|
150
211
|
* launch config of loops, scheduled loops, and sidepanel sessions) win; plain
|
|
151
|
-
* CLI windows fall back to their unique Mcp-Session-Id.
|
|
212
|
+
* CLI windows fall back to their unique Mcp-Session-Id. A pin the host's
|
|
213
|
+
* terminalAuth refused (`pin` null) counts as no pin, and so do the browser
|
|
214
|
+
* pins that came with it.
|
|
152
215
|
*/
|
|
153
|
-
function deriveIdentity(req: Request, sid: string | undefined): CallerIdentity {
|
|
216
|
+
function deriveIdentity(req: Request, sid: string | undefined, pin: string | null = sanitizePin(req.get('x-synabun-terminal'))): CallerIdentity {
|
|
154
217
|
const memoryContext = {
|
|
155
218
|
project: req.get('x-synabun-project')?.slice(0,200),
|
|
156
219
|
session: req.get('x-synabun-memory-session')?.slice(0,200),
|
|
@@ -163,7 +226,7 @@ function deriveIdentity(req: Request, sid: string | undefined): CallerIdentity {
|
|
|
163
226
|
const remote = !!req.get('cf-connecting-ip');
|
|
164
227
|
const role = remote ? null : sanitizeRole(req.get('x-synabun-role'));
|
|
165
228
|
const desktopGrant = remote ? null : sanitizeDesktopGrant(req.get('x-synabun-desktop-grant'));
|
|
166
|
-
const headerTerminal =
|
|
229
|
+
const headerTerminal = pin;
|
|
167
230
|
if (headerTerminal) {
|
|
168
231
|
const identity = obtainIdentity(headerTerminal, {
|
|
169
232
|
source: 'header',
|
|
@@ -192,11 +255,53 @@ export function requestBrainCredential(req: Pick<Request, 'get'>): string | null
|
|
|
192
255
|
}
|
|
193
256
|
|
|
194
257
|
/**
|
|
195
|
-
* Handle one request inside its caller identity and its own
|
|
196
|
-
* X-Synabun-
|
|
258
|
+
* Handle one request inside its caller identity and its own credential contexts: the X-Synabun-Brain-Token and the
|
|
259
|
+
* X-Synabun-Terminal-Token of THIS request (the latter only with the pin it came with, which the host accepted),
|
|
260
|
+
* never one another request left on a shared identity.
|
|
261
|
+
*/
|
|
262
|
+
function runRequest<T>(req: Request, sid: string | undefined, options: McpRoutesOptions, fn: () => T): T {
|
|
263
|
+
const pin = acceptedTerminalPin(req, options);
|
|
264
|
+
const token = pin ? requestTerminalToken(req) : null;
|
|
265
|
+
// A plain session (no accepted pin) routes as its Mcp-Session-Id: the proof the host gave that id at its initialize
|
|
266
|
+
// goes with it. Only the session's own transport (this sid, which the SDK checked) ever carries it.
|
|
267
|
+
const own = !pin && sid ? sessionProofGrant(sid) : null;
|
|
268
|
+
return runWithTerminalToken(pin && token ? { terminal: pin, token } : own, () =>
|
|
269
|
+
runWithBrainCredential(requestBrainCredential(req), () => runWithIdentity(deriveIdentity(req, sid, pin), fn)));
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/** The proof of plain session `sid` as a grant for its own id, or null. */
|
|
273
|
+
function sessionProofGrant(sid: string): { terminal: string; token: string } | null {
|
|
274
|
+
const proof = mcpSessions.get(sid)?.proof;
|
|
275
|
+
return proof ? { terminal: sid, token: proof } : null;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Whether a session initializing with `req` may get the host's proof (McpRoutesOptions.sessionProof): no accepted
|
|
280
|
+
* pin (a run or a panel routes as its pin and proves it with its own token), from this computer's loopback, and not
|
|
281
|
+
* through the tunnel (a remote MCP-key holder).
|
|
282
|
+
*/
|
|
283
|
+
export function wantsSessionProof(req: Pick<Request, 'get'> & { socket?: { remoteAddress?: string } }, pin: string | null): boolean {
|
|
284
|
+
if (pin) return false;
|
|
285
|
+
if (req.get('cf-connecting-ip')) return false;
|
|
286
|
+
const addr = String(req.socket?.remoteAddress || '');
|
|
287
|
+
return /^(?:::ffff:)?127\.\d+\.\d+\.\d+$/.test(addr) || addr === '::1';
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/** The host's own check of the initializing request (McpRoutesOptions.sessionProof.eligible): absent or failing is no. */
|
|
291
|
+
export function hostAllowsSessionProof(req: Request, options: McpRoutesOptions): boolean {
|
|
292
|
+
const eligible = options.sessionProof?.eligible;
|
|
293
|
+
if (typeof eligible !== 'function') return false;
|
|
294
|
+
try { return eligible(req) === true; } catch { return false; }
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* A session id as the log shows it: its first 8 characters. The Mcp-Session-Id is all a client needs to send requests
|
|
299
|
+
* on a session (the SDK checks nothing else), and a session with a proof can pick its MoreLogin profile, so the whole
|
|
300
|
+
* id is a bearer and never goes to stderr (which the background launch writes to launcher.log; review b6631e9d, note 8).
|
|
197
301
|
*/
|
|
198
|
-
function
|
|
199
|
-
|
|
302
|
+
export function sessionLogId(sid: string | undefined | null): string {
|
|
303
|
+
const text = String(sid || '');
|
|
304
|
+
return text.length > 8 ? `${text.slice(0, 8)}…` : text;
|
|
200
305
|
}
|
|
201
306
|
|
|
202
307
|
function jsonRpcError(res: express.Response, status: number, code: number, message: string): void {
|
|
@@ -251,7 +356,7 @@ export function createMcpRoutes(options: McpRoutesOptions = {}): Router {
|
|
|
251
356
|
// finish means the fresh schemas have left this session's HTTP response.
|
|
252
357
|
res.once('finish', () => { if (res.statusCode === 200) toolListBarriers.get(entry.server)?.listed(); });
|
|
253
358
|
}
|
|
254
|
-
await runRequest(req, sid, () =>
|
|
359
|
+
await runRequest(req, sid, options, () =>
|
|
255
360
|
entry.transport.handleRequest(req, res, req.body)
|
|
256
361
|
);
|
|
257
362
|
return;
|
|
@@ -271,9 +376,15 @@ export function createMcpRoutes(options: McpRoutesOptions = {}): Router {
|
|
|
271
376
|
const transport = new StreamableHTTPServerTransport({
|
|
272
377
|
sessionIdGenerator: () => randomUUID(),
|
|
273
378
|
onsessioninitialized: (newSid) => {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
379
|
+
// The pin the host accepted (terminalAuth): a refused one is no pin, here as on every later request.
|
|
380
|
+
const terminal = acceptedTerminalPin(req, options);
|
|
381
|
+
let proof: string | null = null;
|
|
382
|
+
if (options.sessionProof && wantsSessionProof(req, terminal) && hostAllowsSessionProof(req, options)) {
|
|
383
|
+
try { proof = options.sessionProof.issue(newSid) || null; } catch { proof = null; }
|
|
384
|
+
}
|
|
385
|
+
mcpSessions.set(newSid, { transport, server, lastSeen: Date.now(), proof });
|
|
386
|
+
revokeProof.set(newSid, proof && options.sessionProof ? options.sessionProof.revoke : null);
|
|
387
|
+
deriveIdentity(req, newSid, terminal);
|
|
277
388
|
// The warm server was built role-less, on focus. The SDK awaits this
|
|
278
389
|
// hook BEFORE dispatching the initialize request, so binding the
|
|
279
390
|
// selection and the role here makes the handshake instructions and
|
|
@@ -288,7 +399,7 @@ export function createMcpRoutes(options: McpRoutesOptions = {}): Router {
|
|
|
288
399
|
const grant = remote ? null : sanitizeDesktopGrant(req.get('x-synabun-desktop-grant'));
|
|
289
400
|
if (grant) setServerCapabilities(server, { computer: true });
|
|
290
401
|
const tools = selection.source === 'http' ? '' : `, tools=${selection.mode}:${selection.groups.join(',') || 'memory'}${selection.listError ? ' (unreadable)' : ''}`;
|
|
291
|
-
console.error(`[mcp-http] session ${newSid} init (terminal=${terminal || 'none'}${role ? `, role=${role}` : ''}${grant ? ', computer' : ''}${tools}, sessions=${mcpSessions.size})`);
|
|
402
|
+
console.error(`[mcp-http] session ${sessionLogId(newSid)} init (terminal=${terminal || 'none'}${role ? `, role=${role}` : ''}${grant ? ', computer' : ''}${tools}, sessions=${mcpSessions.size})`);
|
|
292
403
|
},
|
|
293
404
|
});
|
|
294
405
|
// Re-entry guard: server.close() closes its transport, which fires
|
|
@@ -299,17 +410,24 @@ export function createMcpRoutes(options: McpRoutesOptions = {}): Router {
|
|
|
299
410
|
tornDown = true;
|
|
300
411
|
const closedSid = transport.sessionId;
|
|
301
412
|
if (closedSid && mcpSessions.has(closedSid)) {
|
|
413
|
+
// Its tab is released as the session itself (its proof, while it still holds one), then the proof stops
|
|
414
|
+
// working (the id stays refused: nobody can be this session afterwards). The host releases what the
|
|
415
|
+
// session still held in its revoke too, so a release that arrives after it is no loss.
|
|
416
|
+
const grant = sessionProofGrant(closedSid);
|
|
417
|
+
const revoke = revokeProof.get(closedSid);
|
|
418
|
+
revokeProof.delete(closedSid);
|
|
302
419
|
mcpSessions.delete(closedSid);
|
|
303
420
|
// Releases the identity's acquired browser tab (if any). Header-keyed
|
|
304
421
|
// identities (loops) are keyed by terminal id, not sid — untouched.
|
|
305
|
-
releaseIdentity(closedSid);
|
|
306
|
-
|
|
422
|
+
runWithTerminalToken(grant, () => releaseIdentity(closedSid));
|
|
423
|
+
if (revoke) { try { revoke(closedSid); } catch { /* the host's own failure */ } }
|
|
424
|
+
console.error(`[mcp-http] session ${sessionLogId(closedSid)} closed (${mcpSessions.size} remain)`);
|
|
307
425
|
}
|
|
308
426
|
try { server.close(); } catch { /* already closed */ }
|
|
309
427
|
};
|
|
310
428
|
|
|
311
429
|
await server.connect(transport);
|
|
312
|
-
await runRequest(req, undefined, () =>
|
|
430
|
+
await runRequest(req, undefined, options, () =>
|
|
313
431
|
transport.handleRequest(req, res, req.body)
|
|
314
432
|
);
|
|
315
433
|
} catch (error) {
|
|
@@ -330,7 +448,7 @@ export function createMcpRoutes(options: McpRoutesOptions = {}): Router {
|
|
|
330
448
|
}
|
|
331
449
|
entry.lastSeen = Date.now();
|
|
332
450
|
try {
|
|
333
|
-
await runRequest(req, sid, () =>
|
|
451
|
+
await runRequest(req, sid, options, () =>
|
|
334
452
|
entry.transport.handleRequest(req, res)
|
|
335
453
|
);
|
|
336
454
|
} catch (error) {
|
package/mcp-server/src/index.ts
CHANGED
|
@@ -27,6 +27,7 @@ import { registerDiscordTools } from './tools/discord.js';
|
|
|
27
27
|
import { registerGitTools } from './tools/git.js';
|
|
28
28
|
import { registerImageTools } from './tools/image.js';
|
|
29
29
|
import { registerGscTools } from './tools/gsc.js';
|
|
30
|
+
import { withRouteFlows } from './services/browser-route-flow.js';
|
|
30
31
|
import { registerYoutubeTools } from './tools/youtube.js';
|
|
31
32
|
import { registerStyleGuideTools } from './tools/style-guide.js';
|
|
32
33
|
import { registerMoreLoginTools } from './tools/morelogin.js';
|
|
@@ -80,17 +81,22 @@ function buildServerInstructions(runtime: ToolRuntime): string {
|
|
|
80
81
|
let _lastInstructionsSig: string | null = null;
|
|
81
82
|
|
|
82
83
|
/** One registrar per catalog group (services/tool-catalog.ts): registering is iterating the catalog. */
|
|
84
|
+
// Browser groups register on a server whose handlers run in a route flow (services/browser-route-flow.ts): a call
|
|
85
|
+
// whose tab is lost midway stops (or, for a read that opens its own page, runs once more) instead of answering for
|
|
86
|
+
// the blank replacement tab. Bluesky recovers by itself (bluesky.ts) and registers on the plain server.
|
|
87
|
+
const routed = (register: (server: McpServer) => RegisteredTool[]) => (server: McpServer) => register(withRouteFlows(server));
|
|
88
|
+
|
|
83
89
|
const GROUP_REGISTRARS: Readonly<Record<string, (server: McpServer) => RegisteredTool[]>> = Object.freeze({
|
|
84
|
-
browser: registerBrowserCoreTools,
|
|
85
|
-
browser_twitter: registerBrowserTwitterTools,
|
|
86
|
-
browser_facebook: registerBrowserFacebookTools,
|
|
87
|
-
browser_tiktok: registerBrowserTiktokTools,
|
|
88
|
-
browser_whatsapp: registerBrowserWhatsappTools,
|
|
89
|
-
browser_instagram: registerBrowserInstagramTools,
|
|
90
|
-
browser_linkedin: registerBrowserLinkedinTools,
|
|
90
|
+
browser: routed(registerBrowserCoreTools),
|
|
91
|
+
browser_twitter: routed(registerBrowserTwitterTools),
|
|
92
|
+
browser_facebook: routed(registerBrowserFacebookTools),
|
|
93
|
+
browser_tiktok: routed(registerBrowserTiktokTools),
|
|
94
|
+
browser_whatsapp: routed(registerBrowserWhatsappTools),
|
|
95
|
+
browser_instagram: routed(registerBrowserInstagramTools),
|
|
96
|
+
browser_linkedin: routed(registerBrowserLinkedinTools),
|
|
91
97
|
browser_bluesky: registerBlueskyTools,
|
|
92
|
-
gsc: registerGscTools,
|
|
93
|
-
youtube: registerYoutubeTools,
|
|
98
|
+
gsc: routed(registerGscTools),
|
|
99
|
+
youtube: routed(registerYoutubeTools),
|
|
94
100
|
discord: registerDiscordTools,
|
|
95
101
|
whiteboard: registerWhiteboardTools,
|
|
96
102
|
card: registerCardTools,
|