synabun 2.0.10 → 2.2.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 +207 -0
- package/README.md +25 -2
- package/THIRD-PARTY-LICENSES.md +22 -0
- package/bin/synabun.js +71 -24
- package/docs/whatsapp.md +13 -13
- package/hooks/claude-code/pre-websearch.mjs +12 -1
- package/hooks/claude-code/shared.mjs +5 -0
- package/hooks/claude-code/stop.mjs +1 -1
- package/lib/claude-hooks.js +172 -18
- package/lib/client-config-repair.js +30 -17
- package/lib/desktop-app.js +7 -1
- package/lib/external-tools.js +7 -6
- package/lib/first-launch-protection.js +57 -12
- package/lib/mcp-dist.js +176 -0
- package/lib/release-npm-ci.mjs +138 -0
- package/lib/release-publish.mjs +91 -0
- package/lib/release-scan.mjs +50 -0
- package/lib/server-crash-record.js +123 -0
- package/lib/server-exit.js +318 -0
- package/lib/server-supervisor.js +508 -0
- package/lib/start-launcher.js +37 -4
- package/lib/tools-cli.js +45 -0
- package/lib/update-snapshot.js +302 -0
- package/lib/virustotal.mjs +203 -0
- package/lib/windows-crash-event.js +269 -0
- package/mcp-server/dist/http.d.ts +20 -1
- package/mcp-server/dist/http.d.ts.map +1 -1
- package/mcp-server/dist/http.js +59 -12
- package/mcp-server/dist/http.js.map +1 -1
- package/mcp-server/dist/index.d.ts +33 -27
- package/mcp-server/dist/index.d.ts.map +1 -1
- package/mcp-server/dist/index.js +128 -143
- package/mcp-server/dist/index.js.map +1 -1
- package/mcp-server/dist/preload.js +1 -1
- package/mcp-server/dist/preload.js.map +1 -1
- package/mcp-server/dist/services/budget-judgments.d.ts +1 -1
- package/mcp-server/dist/services/budget-judgments.d.ts.map +1 -1
- package/mcp-server/dist/services/budget-judgments.js +5 -3
- package/mcp-server/dist/services/budget-judgments.js.map +1 -1
- package/mcp-server/dist/services/codex-config-heal.d.ts +6 -2
- package/mcp-server/dist/services/codex-config-heal.d.ts.map +1 -1
- package/mcp-server/dist/services/codex-config-heal.js +81 -28
- package/mcp-server/dist/services/codex-config-heal.js.map +1 -1
- package/mcp-server/dist/services/identity.d.ts +2 -2
- package/mcp-server/dist/services/identity.js +2 -2
- package/mcp-server/dist/services/memory-judge-backfill.d.ts +6 -0
- package/mcp-server/dist/services/memory-judge-backfill.d.ts.map +1 -1
- package/mcp-server/dist/services/memory-judge-backfill.js +7 -1
- package/mcp-server/dist/services/memory-judge-backfill.js.map +1 -1
- package/mcp-server/dist/services/memory-sessions.d.ts +1 -1
- package/mcp-server/dist/services/memory-sessions.d.ts.map +1 -1
- package/mcp-server/dist/services/memory-sessions.js +28 -2
- package/mcp-server/dist/services/memory-sessions.js.map +1 -1
- package/mcp-server/dist/services/neural-interface.d.ts +18 -11
- package/mcp-server/dist/services/neural-interface.d.ts.map +1 -1
- package/mcp-server/dist/services/neural-interface.js +67 -11
- package/mcp-server/dist/services/neural-interface.js.map +1 -1
- package/mcp-server/dist/services/server-instructions.d.ts +7 -2
- package/mcp-server/dist/services/server-instructions.d.ts.map +1 -1
- package/mcp-server/dist/services/server-instructions.js +22 -63
- package/mcp-server/dist/services/server-instructions.js.map +1 -1
- package/mcp-server/dist/services/tool-catalog.d.ts +120 -0
- package/mcp-server/dist/services/tool-catalog.d.ts.map +1 -0
- package/mcp-server/dist/services/tool-catalog.js +339 -0
- package/mcp-server/dist/services/tool-catalog.js.map +1 -0
- package/mcp-server/dist/services/tool-list-refresh-barrier.d.ts +12 -0
- package/mcp-server/dist/services/tool-list-refresh-barrier.d.ts.map +1 -0
- package/mcp-server/dist/services/tool-list-refresh-barrier.js +40 -0
- package/mcp-server/dist/services/tool-list-refresh-barrier.js.map +1 -0
- package/mcp-server/dist/services/tool-list.d.ts +108 -0
- package/mcp-server/dist/services/tool-list.d.ts.map +1 -0
- package/mcp-server/dist/services/tool-list.js +334 -0
- package/mcp-server/dist/services/tool-list.js.map +1 -0
- package/mcp-server/dist/services/tool-runtime.d.ts +161 -0
- package/mcp-server/dist/services/tool-runtime.d.ts.map +1 -0
- package/mcp-server/dist/services/tool-runtime.js +400 -0
- package/mcp-server/dist/services/tool-runtime.js.map +1 -0
- package/mcp-server/dist/services/typesafe-config.js +1 -1
- package/mcp-server/dist/services/typesafe-config.js.map +1 -1
- package/mcp-server/dist/services/whiteboard-geometry.d.ts +26 -2
- package/mcp-server/dist/services/whiteboard-geometry.d.ts.map +1 -1
- package/mcp-server/dist/services/whiteboard-geometry.js +91 -8
- package/mcp-server/dist/services/whiteboard-geometry.js.map +1 -1
- package/mcp-server/dist/tools/agents.d.ts +14 -14
- package/mcp-server/dist/tools/agents.d.ts.map +1 -1
- package/mcp-server/dist/tools/agents.js +29 -19
- package/mcp-server/dist/tools/agents.js.map +1 -1
- package/mcp-server/dist/tools/browser-batch.d.ts +3 -3
- package/mcp-server/dist/tools/choice.d.ts +6 -0
- package/mcp-server/dist/tools/choice.d.ts.map +1 -1
- package/mcp-server/dist/tools/choice.js +18 -13
- package/mcp-server/dist/tools/choice.js.map +1 -1
- package/mcp-server/dist/tools/git-tools.js +2 -2
- package/mcp-server/dist/tools/git-tools.js.map +1 -1
- package/mcp-server/dist/tools/image-tools.d.ts +1 -1
- package/mcp-server/dist/tools/image-tools.js +1 -1
- package/mcp-server/dist/tools/morelogin.d.ts.map +1 -1
- package/mcp-server/dist/tools/morelogin.js +9 -6
- package/mcp-server/dist/tools/morelogin.js.map +1 -1
- package/mcp-server/dist/tools/skill-tools.d.ts +505 -0
- package/mcp-server/dist/tools/skill-tools.d.ts.map +1 -0
- package/mcp-server/dist/tools/skill-tools.js +642 -0
- package/mcp-server/dist/tools/skill-tools.js.map +1 -0
- package/mcp-server/dist/tools/skill.d.ts +7 -0
- package/mcp-server/dist/tools/skill.d.ts.map +1 -0
- package/mcp-server/dist/tools/skill.js +11 -0
- package/mcp-server/dist/tools/skill.js.map +1 -0
- package/mcp-server/dist/tools/tool-groups.d.ts +68 -0
- package/mcp-server/dist/tools/tool-groups.d.ts.map +1 -0
- package/mcp-server/dist/tools/tool-groups.js +147 -0
- package/mcp-server/dist/tools/tool-groups.js.map +1 -0
- package/mcp-server/dist/tools/whiteboard-format.d.ts.map +1 -1
- package/mcp-server/dist/tools/whiteboard-format.js +7 -4
- package/mcp-server/dist/tools/whiteboard-format.js.map +1 -1
- package/mcp-server/dist/tools/whiteboard-tools.d.ts +64 -13
- package/mcp-server/dist/tools/whiteboard-tools.d.ts.map +1 -1
- package/mcp-server/dist/tools/whiteboard-tools.js +30 -5
- package/mcp-server/dist/tools/whiteboard-tools.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 +75 -12
- package/mcp-server/src/index.ts +147 -154
- package/mcp-server/src/preload.ts +12 -12
- package/mcp-server/src/services/budget-judgments.ts +5 -3
- package/mcp-server/src/services/codex-config-heal.ts +80 -29
- package/mcp-server/src/services/identity.ts +2 -2
- package/mcp-server/src/services/memory-judge-backfill.ts +7 -1
- package/mcp-server/src/services/memory-sessions.ts +24 -3
- package/mcp-server/src/services/neural-interface.ts +81 -21
- package/mcp-server/src/services/server-instructions.ts +29 -64
- package/mcp-server/src/services/tool-catalog.ts +403 -0
- package/mcp-server/src/services/tool-list-refresh-barrier.ts +33 -0
- package/mcp-server/src/services/tool-list.ts +410 -0
- package/mcp-server/src/services/tool-runtime.ts +457 -0
- package/mcp-server/src/services/typesafe-config.ts +1 -1
- package/mcp-server/src/services/whiteboard-geometry.ts +94 -9
- package/mcp-server/src/tools/agents.ts +29 -20
- package/mcp-server/src/tools/choice.ts +17 -12
- package/mcp-server/src/tools/git-tools.ts +2 -2
- package/mcp-server/src/tools/image-tools.ts +1 -1
- package/mcp-server/src/tools/morelogin.ts +6 -4
- package/mcp-server/src/tools/skill-tools.ts +592 -0
- package/mcp-server/src/tools/skill.ts +13 -0
- package/mcp-server/src/tools/tool-groups.ts +164 -0
- package/mcp-server/src/tools/whiteboard-format.ts +9 -3
- package/mcp-server/src/tools/whiteboard-tools.ts +39 -5
- package/neural-interface/i18n/en.json +3953 -228
- package/neural-interface/i18n/pt-BR.json +3901 -179
- package/neural-interface/lib/agent-sandbox-elevation.js +6 -0
- package/neural-interface/lib/antigravity/acp-client-host.js +554 -0
- package/neural-interface/lib/antigravity/acp-connection.js +299 -0
- package/neural-interface/lib/antigravity/bypass.js +100 -0
- package/neural-interface/lib/antigravity/catalog.js +273 -0
- package/neural-interface/lib/antigravity/home.js +260 -0
- package/neural-interface/lib/antigravity/migrate-gemini.js +139 -0
- package/neural-interface/lib/antigravity/panel-bridge.js +1058 -0
- package/neural-interface/lib/antigravity/policy-hook.mjs +78 -0
- package/neural-interface/lib/antigravity/policy.js +74 -0
- package/neural-interface/lib/antigravity/tool-call.js +178 -0
- package/neural-interface/lib/antigravity/transcripts.js +252 -0
- package/neural-interface/lib/antigravity/usage.js +43 -0
- package/neural-interface/lib/assistant-api.js +128 -28
- package/neural-interface/lib/assistant-brains/antigravity.js +423 -0
- package/neural-interface/lib/assistant-brains/claude.js +4 -3
- package/neural-interface/lib/assistant-brains/codex-browser-policy-hook.mjs +12 -2
- package/neural-interface/lib/assistant-brains/codex-route-gate-hook.mjs +32 -9
- package/neural-interface/lib/assistant-brains/codex.js +9 -5
- package/neural-interface/lib/assistant-brains/opencode.js +120 -54
- package/neural-interface/lib/assistant-brains/opencode2-browser-policy/index.js +28 -13
- package/neural-interface/lib/assistant-brains/opencode2-route-gate/index.js +59 -19
- package/neural-interface/lib/assistant-budget-planner.js +7 -3
- package/neural-interface/lib/assistant-budget-split.js +42 -15
- package/neural-interface/lib/assistant-catalog.js +81 -15
- package/neural-interface/lib/assistant-config.js +6 -3
- package/neural-interface/lib/assistant-dispatch.js +1073 -200
- package/neural-interface/lib/assistant-envelope.js +156 -2
- package/neural-interface/lib/assistant-evidence.js +80 -0
- package/neural-interface/lib/assistant-hidden-models.js +7 -5
- package/neural-interface/lib/assistant-persona.js +93 -19
- package/neural-interface/lib/assistant-plan-permissions.js +25 -9
- package/neural-interface/lib/assistant-route-gate-codex.js +3 -0
- package/neural-interface/lib/assistant-route-gate.js +6 -4
- package/neural-interface/lib/assistant-router.js +245 -38
- package/neural-interface/lib/assistant-runtime.js +214 -30
- package/neural-interface/lib/assistant-task-prompt.js +87 -21
- package/neural-interface/lib/assistant-tools.js +51 -0
- package/neural-interface/lib/assistant-usage.js +29 -0
- package/neural-interface/lib/backup-service.js +626 -4
- package/neural-interface/lib/backup-zip-reader.js +10 -5
- package/neural-interface/lib/backup-zip-writer.js +257 -0
- package/neural-interface/lib/browser-execution.js +10 -2
- package/neural-interface/lib/browser-guard-cdp.js +84 -0
- package/neural-interface/lib/browser-network-guard.js +476 -0
- package/neural-interface/lib/browser-policy-roots.js +64 -0
- package/neural-interface/lib/browser-tool-policy.js +198 -38
- package/neural-interface/lib/claude-agent-bridge.js +11 -2
- package/neural-interface/lib/claude-history-cache.js +210 -0
- package/neural-interface/lib/claude-hooks-status.js +103 -0
- package/neural-interface/lib/claude-model-catalog.js +5 -1
- package/neural-interface/lib/claude-temporary.js +5 -11
- package/neural-interface/lib/cli-install-api.js +1 -1
- package/neural-interface/lib/cli-install.js +163 -154
- package/neural-interface/lib/cli-resolver.js +13 -3
- package/neural-interface/lib/cli-update-planner.js +52 -41
- package/neural-interface/lib/cloudflared/tunnel.js +42 -2
- package/neural-interface/lib/codex-mcp-approvals.js +11 -0
- package/neural-interface/lib/codex-rollout-reader.js +52 -0
- package/neural-interface/lib/codex-worker-app-server.js +191 -0
- package/neural-interface/lib/confined-fs.js +30 -3
- package/neural-interface/lib/crash-notice-api.js +98 -0
- package/neural-interface/lib/editor-completion-opencode.js +68 -68
- package/neural-interface/lib/editor-git-api.js +3 -20
- package/neural-interface/lib/exec-loop-command.js +13 -10
- package/neural-interface/lib/file-explorer-api.js +74 -40
- package/neural-interface/lib/file-explorer-watch.js +9 -3
- package/neural-interface/lib/git-bash/install.js +52 -6
- package/neural-interface/lib/git-bash/manager.js +59 -17
- package/neural-interface/lib/git-bash/pins.js +12 -0
- package/neural-interface/lib/git-read.js +2 -2
- package/neural-interface/lib/git-status-runner.js +390 -0
- package/neural-interface/lib/git-status-watchdog.js +40 -0
- package/neural-interface/lib/greeting/budgets.js +1 -0
- package/neural-interface/lib/greeting/engine.js +2 -2
- package/neural-interface/lib/greeting/sources.js +10 -12
- package/neural-interface/lib/greeting/writer.js +1 -1
- package/neural-interface/lib/http-guards.js +8 -2
- package/neural-interface/lib/install-details.js +4 -1
- package/neural-interface/lib/mcp-agent-servers.js +67 -0
- package/neural-interface/lib/mcp-client-config.js +35 -33
- package/neural-interface/lib/mcp-external-servers.js +332 -0
- package/neural-interface/lib/mcp-installer.js +2 -1
- package/neural-interface/lib/{mcp-profile-refresh-coordinator.js → mcp-tools-refresh-coordinator.js} +4 -4
- package/neural-interface/lib/memory-session-capture.js +17 -3
- package/neural-interface/lib/morelogin.js +177 -25
- package/neural-interface/lib/native-loop-providers.js +965 -66
- package/neural-interface/lib/native-loop-runtime.js +290 -42
- package/neural-interface/lib/opencode-config.js +557 -0
- package/neural-interface/lib/opencode-db-schema.js +17 -34
- package/neural-interface/lib/opencode-history.js +48 -218
- package/neural-interface/lib/opencode-mcp-ready.js +108 -0
- package/neural-interface/lib/opencode-native-boundary.js +53 -0
- package/neural-interface/lib/opencode-protocol.js +249 -112
- package/neural-interface/lib/opencode-runtime-config.js +32 -22
- package/neural-interface/lib/opencode-serve-records.js +39 -21
- package/neural-interface/lib/opencode-v2-client.js +48 -153
- package/neural-interface/lib/opencode-v2-ws-requests.js +36 -210
- package/neural-interface/lib/opencode-worker-data.js +27 -0
- package/neural-interface/lib/opencode2-client.js +73 -37
- package/neural-interface/lib/opencode2-proxy.js +23 -63
- package/neural-interface/lib/opencode2-translate.js +51 -2
- package/neural-interface/lib/owner-authority.js +249 -0
- package/neural-interface/lib/page-session.js +275 -0
- package/neural-interface/lib/path-confine.js +12 -9
- package/neural-interface/lib/peer-identity.js +793 -0
- package/neural-interface/lib/pty-host/core.js +28 -1
- package/neural-interface/lib/pty-host/lifetime.js +12 -0
- package/neural-interface/lib/pty-host/manager.js +12 -1
- package/neural-interface/lib/remote-policy.js +1 -1
- package/neural-interface/lib/request-gate.js +20 -2
- package/neural-interface/lib/rulesets/api.js +7 -6
- package/neural-interface/lib/rulesets/fs-safe.js +1 -1
- package/neural-interface/lib/rulesets/installer.js +180 -36
- package/neural-interface/lib/rulesets/json-edit.js +1 -1
- package/neural-interface/lib/rulesets/render.js +1 -1
- package/neural-interface/lib/session-cache-builder.js +81 -31
- package/neural-interface/lib/session-title-generator.js +58 -36
- package/neural-interface/lib/skills/api-v2.js +495 -0
- package/neural-interface/lib/skills/bundle.js +418 -0
- package/neural-interface/lib/skills/catalog.js +298 -0
- package/neural-interface/lib/skills/creation-api.js +191 -0
- package/neural-interface/lib/skills/creation-brief.js +247 -0
- package/neural-interface/lib/skills/creation-sources.js +285 -0
- package/neural-interface/lib/skills/creation.js +843 -0
- package/neural-interface/lib/skills/deploy.js +569 -0
- package/neural-interface/lib/skills/digest.js +119 -0
- package/neural-interface/lib/skills/discover.js +111 -0
- package/neural-interface/lib/skills/draft-confinement.js +216 -0
- package/neural-interface/lib/skills/eval-confinement.js +399 -0
- package/neural-interface/lib/skills/eval-sandbox.js +280 -0
- package/neural-interface/lib/skills/eval-trace.js +135 -0
- package/neural-interface/lib/skills/evals-api.js +212 -0
- package/neural-interface/lib/skills/evals.js +1573 -0
- package/neural-interface/lib/skills/export.js +203 -0
- package/neural-interface/lib/skills/frontmatter.js +64 -0
- package/neural-interface/lib/skills/health.js +75 -0
- package/neural-interface/lib/skills/json-edit.js +165 -0
- package/neural-interface/lib/skills/known-bridge-digests.json +441 -0
- package/neural-interface/lib/skills/known-bridges.js +96 -0
- package/neural-interface/lib/skills/library.js +823 -0
- package/neural-interface/lib/skills/local-store.js +21 -0
- package/neural-interface/lib/skills/migration.js +433 -0
- package/neural-interface/lib/skills/operations.js +45 -0
- package/neural-interface/lib/skills/ownership.js +427 -0
- package/neural-interface/lib/skills/packages.js +88 -0
- package/neural-interface/lib/skills/reviews.js +212 -0
- package/neural-interface/lib/skills/revision.js +80 -0
- package/neural-interface/lib/skills/roots.js +269 -0
- package/neural-interface/lib/skills/runtime-checks.js +358 -0
- package/neural-interface/lib/skills/scan-assets.js +252 -0
- package/neural-interface/lib/skills/scan-context.js +26 -0
- package/neural-interface/lib/skills/scan-shell.js +324 -0
- package/neural-interface/lib/skills/scan.js +364 -0
- package/neural-interface/lib/skills/scanners.js +54 -0
- package/neural-interface/lib/skills/service.js +530 -0
- package/neural-interface/lib/skills/telemetry.js +119 -0
- package/neural-interface/lib/sqlite-integrity-worker.js +22 -0
- package/neural-interface/lib/synabun-version.js +1 -1
- package/neural-interface/lib/system-activity.js +1 -1
- package/neural-interface/lib/tool-lists.js +124 -0
- package/neural-interface/lib/whatsapp/brain.js +7 -3
- package/neural-interface/lib/whatsapp/bridge.js +6 -3
- package/neural-interface/lib/whatsapp/cards.js +22 -9
- package/neural-interface/lib/whatsapp/config.js +1 -1
- package/neural-interface/lib/worker-confinement.js +1268 -0
- package/neural-interface/lib/worker-guard-setting.js +56 -0
- package/neural-interface/lib/worker-mcp-channel.js +175 -0
- package/neural-interface/lib/worker-question.js +74 -0
- package/neural-interface/lib/worker-relay-ports.js +227 -0
- package/neural-interface/lib/worker-resume.js +238 -0
- package/neural-interface/lib/worker-sandbox.js +329 -0
- package/neural-interface/package-lock.json +34 -12
- package/neural-interface/package.json +3 -2
- package/neural-interface/public/index.html +3 -1
- package/neural-interface/public/index2d.html +19 -11
- package/neural-interface/public/onboarding.html +3 -3
- package/neural-interface/public/shared/account-menu.js +8 -5
- package/neural-interface/public/shared/agent-runtime-options.js +125 -31
- package/neural-interface/public/shared/agy/agy-bypass.js +47 -0
- package/neural-interface/public/shared/agy/agy-client.js +266 -0
- package/neural-interface/public/shared/agy/agy-commands.js +120 -0
- package/neural-interface/public/shared/agy/agy-copy.js +326 -0
- package/neural-interface/public/shared/agy/agy-diff.js +161 -0
- package/neural-interface/public/shared/agy/agy-events.js +469 -0
- package/neural-interface/public/shared/agy/agy-greeting.js +26 -0
- package/neural-interface/public/shared/agy/agy-options.js +232 -0
- package/neural-interface/public/shared/agy/agy-panel.js +2543 -0
- package/neural-interface/public/shared/agy/agy-render.js +392 -0
- package/neural-interface/public/shared/agy/agy-setup.js +149 -0
- package/neural-interface/public/shared/agy/agy-styles.js +604 -0
- package/neural-interface/public/shared/agy/agy-tabs-logic.js +181 -0
- package/neural-interface/public/shared/api.js +1527 -1336
- package/neural-interface/public/shared/app-frame.js +192 -0
- package/neural-interface/public/shared/assistant/asst-agents-dock.js +36 -6
- package/neural-interface/public/shared/assistant/asst-api.js +1 -1
- package/neural-interface/public/shared/assistant/asst-ask-styles.js +270 -0
- package/neural-interface/public/shared/assistant/asst-ask-tail.js +118 -0
- package/neural-interface/public/shared/assistant/asst-ask.js +397 -0
- package/neural-interface/public/shared/assistant/asst-brain-picker.js +105 -44
- package/neural-interface/public/shared/assistant/asst-budget.js +5 -4
- package/neural-interface/public/shared/assistant/asst-control.js +205 -26
- package/neural-interface/public/shared/assistant/asst-followups-card.js +383 -0
- package/neural-interface/public/shared/assistant/asst-followups.js +417 -0
- package/neural-interface/public/shared/assistant/asst-hosts.js +16 -7
- package/neural-interface/public/shared/assistant/asst-limit-dock.js +45 -0
- package/neural-interface/public/shared/assistant/asst-limit-wait.js +327 -0
- package/neural-interface/public/shared/assistant/asst-limit.js +168 -0
- package/neural-interface/public/shared/assistant/asst-mascot.js +49 -12
- package/neural-interface/public/shared/assistant/asst-menu.js +7 -6
- package/neural-interface/public/shared/assistant/asst-panel.js +151 -19
- package/neural-interface/public/shared/assistant/asst-rack-styles.js +66 -49
- package/neural-interface/public/shared/assistant/asst-render.js +445 -82
- package/neural-interface/public/shared/assistant/asst-route.js +304 -53
- package/neural-interface/public/shared/assistant/asst-routes-editor.js +9 -8
- package/neural-interface/public/shared/assistant/asst-scenes.js +56 -1
- package/neural-interface/public/shared/assistant/asst-sidepanel.js +117 -10
- package/neural-interface/public/shared/assistant/asst-slash.js +17 -9
- package/neural-interface/public/shared/assistant/asst-state.js +87 -24
- package/neural-interface/public/shared/assistant/asst-stop.js +127 -0
- package/neural-interface/public/shared/assistant/asst-styles.js +93 -21
- package/neural-interface/public/shared/assistant/asst-tool-kinds.js +190 -23
- package/neural-interface/public/shared/assistant/asst-usage.js +2 -1
- package/neural-interface/public/shared/automation-context.js +5 -2
- package/neural-interface/public/shared/cc-dropdown.js +89 -19
- package/neural-interface/public/shared/cdx/cdx-context-menu.js +10 -9
- package/neural-interface/public/shared/cdx/cdx-copy.js +16 -0
- package/neural-interface/public/shared/cdx/cdx-output-model.js +22 -1
- package/neural-interface/public/shared/cdx/cdx-output.js +34 -10
- package/neural-interface/public/shared/cdx/cdx-panel.js +59 -151
- package/neural-interface/public/shared/cdx/cdx-preview.js +12 -0
- package/neural-interface/public/shared/cdx/cdx-protocol.js +39 -11
- package/neural-interface/public/shared/cdx/cdx-render.js +57 -38
- package/neural-interface/public/shared/cdx/cdx-requests.js +14 -4
- package/neural-interface/public/shared/cdx/cdx-skill-hints.js +54 -0
- package/neural-interface/public/shared/cdx/cdx-styles.js +15 -3
- package/neural-interface/public/shared/cdx/cdx-tabs.js +127 -44
- package/neural-interface/public/shared/cdx/cdx-ws.js +0 -1
- package/neural-interface/public/shared/cli-install-controller.js +218 -0
- package/neural-interface/public/shared/cli-install-view.js +11 -12
- package/neural-interface/public/shared/cli-status.js +11 -10
- package/neural-interface/public/shared/constants.js +5 -4
- package/neural-interface/public/shared/context-menu-areas.js +34 -0
- package/neural-interface/public/shared/context-menu-logic.js +243 -0
- package/neural-interface/public/shared/context-menu-model.js +367 -0
- package/neural-interface/public/shared/context-menu.js +372 -0
- package/neural-interface/public/shared/cp/cp-context-menu.js +10 -9
- package/neural-interface/public/shared/cp/cp-restore.js +162 -0
- package/neural-interface/public/shared/cp/cp-tool-cards.js +10 -3
- package/neural-interface/public/shared/crash-notice-view.js +168 -0
- package/neural-interface/public/shared/desktop-bridge.js +17 -0
- package/neural-interface/public/shared/desktop-titlebar-view.js +12 -0
- package/neural-interface/public/shared/desktop-titlebar.js +13 -4
- package/neural-interface/public/shared/desktop-update-view.js +21 -0
- package/neural-interface/public/shared/editor/editor-panel-logic.js +2 -2
- package/neural-interface/public/shared/explorer/fx-api.js +4 -4
- package/neural-interface/public/shared/explorer/fx-links.js +3 -3
- package/neural-interface/public/shared/explorer/fx-logic.js +1 -1
- package/neural-interface/public/shared/explorer/fx-main.js +48 -16
- package/neural-interface/public/shared/explorer/fx-tree.js +1 -0
- package/neural-interface/public/shared/greeting/greeting-card.js +2 -2
- package/neural-interface/public/shared/greeting/greeting-view.js +1 -0
- package/neural-interface/public/shared/html-shell.js +30 -15
- package/neural-interface/public/shared/i18n.js +2 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-approvals.js +7 -7
- package/neural-interface/public/shared/ocp-v2/ocp-v2-binding.js +4 -4
- package/neural-interface/public/shared/ocp-v2/ocp-v2-changes-logic.js +3 -101
- package/neural-interface/public/shared/ocp-v2/ocp-v2-childpanel.js +2 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-compact-button.js +1 -3
- package/neural-interface/public/shared/ocp-v2/ocp-v2-composer-logic.js +2 -6
- package/neural-interface/public/shared/ocp-v2/ocp-v2-context-menu.js +11 -11
- package/neural-interface/public/shared/ocp-v2/ocp-v2-context-model.js +0 -3
- package/neural-interface/public/shared/ocp-v2/ocp-v2-events.js +8 -4
- package/neural-interface/public/shared/ocp-v2/ocp-v2-manager.js +7 -7
- package/neural-interface/public/shared/ocp-v2/ocp-v2-outcome-notifications.js +16 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +74 -259
- package/neural-interface/public/shared/ocp-v2/ocp-v2-plan.js +1 -2
- package/neural-interface/public/shared/ocp-v2/ocp-v2-projectbar.js +95 -202
- package/neural-interface/public/shared/ocp-v2/ocp-v2-rehydrate.js +13 -4
- package/neural-interface/public/shared/ocp-v2/ocp-v2-render.js +13 -22
- package/neural-interface/public/shared/ocp-v2/ocp-v2-send.js +4 -4
- package/neural-interface/public/shared/ocp-v2/ocp-v2-session-actions.js +8 -61
- package/neural-interface/public/shared/ocp-v2/ocp-v2-sessions-logic.js +2 -91
- package/neural-interface/public/shared/ocp-v2/ocp-v2-slash-hints.js +16 -15
- package/neural-interface/public/shared/ocp-v2/ocp-v2-state.js +8 -21
- package/neural-interface/public/shared/ocp-v2/ocp-v2-status-logic.js +1 -99
- package/neural-interface/public/shared/ocp-v2/ocp-v2-status.js +5 -35
- package/neural-interface/public/shared/ocp-v2/ocp-v2-styles.js +17 -21
- package/neural-interface/public/shared/ocp-v2/{ocp-v2-profile-inheritance.js → ocp-v2-tools-inheritance.js} +16 -16
- package/neural-interface/public/shared/ocp-v2/ocp-v2-ws.js +60 -50
- package/neural-interface/public/shared/page-session.js +96 -0
- package/neural-interface/public/shared/provider-icons.js +4 -2
- package/neural-interface/public/shared/registry.js +5 -3
- package/neural-interface/public/shared/retired-2d.js +3 -0
- package/neural-interface/public/shared/schedules-view.js +195 -61
- package/neural-interface/public/shared/settings/settings-claude-hooks.js +135 -0
- package/neural-interface/public/shared/settings/settings-data.js +3 -1
- package/neural-interface/public/shared/settings/settings-ia.js +6 -6
- package/neural-interface/public/shared/settings/settings-opencode.js +89 -0
- package/neural-interface/public/shared/settings/settings-rules.js +2 -2
- package/neural-interface/public/shared/settings/settings-skill-folders-pane.js +265 -0
- package/neural-interface/public/shared/settings/settings-skill-folders.js +130 -0
- package/neural-interface/public/shared/settings/settings-worker-guard.js +72 -0
- package/neural-interface/public/shared/showcase-privacy.js +6 -1
- package/neural-interface/public/shared/sidepanel-session-status.js +3 -3
- package/neural-interface/public/shared/skills/ss-args.js +96 -0
- package/neural-interface/public/shared/skills/ss-creation.js +222 -0
- package/neural-interface/public/shared/skills/ss-dialog.js +133 -0
- package/neural-interface/public/shared/skills/ss-doc.js +173 -0
- package/neural-interface/public/shared/skills/ss-eval-adapters.js +269 -0
- package/neural-interface/public/shared/skills/ss-eval-grade.js +359 -0
- package/neural-interface/public/shared/skills/ss-eval-optimise.js +153 -0
- package/neural-interface/public/shared/skills/ss-eval-plan.js +315 -0
- package/neural-interface/public/shared/skills/ss-evals.js +417 -0
- package/neural-interface/public/shared/skills/ss-form.js +159 -0
- package/neural-interface/public/shared/skills/ss-frontmatter.js +376 -0
- package/neural-interface/public/shared/skills/ss-ids.js +32 -0
- package/neural-interface/public/shared/skills/ss-lint.js +149 -0
- package/neural-interface/public/shared/skills/ss-presets.js +117 -0
- package/neural-interface/public/shared/skills/ss-profiles.js +513 -0
- package/neural-interface/public/shared/skills/ss-resources.js +165 -0
- package/neural-interface/public/shared/skills/ss-review-view.js +190 -0
- package/neural-interface/public/shared/skills/ss-tabs.js +79 -0
- package/neural-interface/public/shared/skills/ss-unicode.js +135 -0
- package/neural-interface/public/shared/skills/studio/sx-actions.js +222 -0
- package/neural-interface/public/shared/skills/studio/sx-cm.js +101 -0
- package/neural-interface/public/shared/skills/studio/sx-create-ai-view.js +749 -0
- package/neural-interface/public/shared/skills/studio/sx-create-ai.js +237 -0
- package/neural-interface/public/shared/skills/studio/sx-create-view.js +254 -0
- package/neural-interface/public/shared/skills/studio/sx-create.js +126 -0
- package/neural-interface/public/shared/skills/studio/sx-diff-view.js +43 -0
- package/neural-interface/public/shared/skills/studio/sx-diff.js +133 -0
- package/neural-interface/public/shared/skills/studio/sx-docs.js +480 -0
- package/neural-interface/public/shared/skills/studio/sx-dom.js +230 -0
- package/neural-interface/public/shared/skills/studio/sx-edit-view.js +848 -0
- package/neural-interface/public/shared/skills/studio/sx-editor-model.js +193 -0
- package/neural-interface/public/shared/skills/studio/sx-errors.js +22 -0
- package/neural-interface/public/shared/skills/studio/sx-fixes-view.js +359 -0
- package/neural-interface/public/shared/skills/studio/sx-fixes.js +327 -0
- package/neural-interface/public/shared/skills/studio/sx-geometry.js +82 -0
- package/neural-interface/public/shared/skills/studio/sx-import.js +262 -0
- package/neural-interface/public/shared/skills/studio/sx-inspector.js +308 -0
- package/neural-interface/public/shared/skills/studio/sx-install-flow.js +282 -0
- package/neural-interface/public/shared/skills/studio/sx-install.js +313 -0
- package/neural-interface/public/shared/skills/studio/sx-library-view.js +748 -0
- package/neural-interface/public/shared/skills/studio/sx-library.js +479 -0
- package/neural-interface/public/shared/skills/studio/sx-main.js +690 -0
- package/neural-interface/public/shared/skills/studio/sx-operations-view.js +98 -0
- package/neural-interface/public/shared/skills/studio/sx-operations.js +11 -0
- package/neural-interface/public/shared/skills/studio/sx-plan.js +158 -0
- package/neural-interface/public/shared/skills/studio/sx-publish-view.js +621 -0
- package/neural-interface/public/shared/skills/studio/sx-review-view.js +369 -0
- package/neural-interface/public/shared/skills/studio/sx-review.js +148 -0
- package/neural-interface/public/shared/skills/studio/sx-scan.js +35 -0
- package/neural-interface/public/shared/skills/studio/sx-snippets.js +96 -0
- package/neural-interface/public/shared/skills/studio/sx-subject.js +249 -0
- package/neural-interface/public/shared/skills/studio/sx-test-view.js +994 -0
- package/neural-interface/public/shared/skills/studio/sx-test.js +328 -0
- package/neural-interface/public/shared/skills/studio/sx-versions-view.js +241 -0
- package/neural-interface/public/shared/skills/studio/sx-workspace-view.js +426 -0
- package/neural-interface/public/shared/state.js +1 -1
- package/neural-interface/public/shared/streaming-markdown.js +58 -0
- package/neural-interface/public/shared/styleguide/sg-panel.js +4 -2
- package/neural-interface/public/shared/styles.css +1822 -1756
- package/neural-interface/public/shared/synabun-mascot.js +1115 -9
- package/neural-interface/public/shared/text-cache.js +29 -0
- package/neural-interface/public/shared/tool-list-picker.js +55 -0
- package/neural-interface/public/shared/tool-list-storage.js +24 -0
- package/neural-interface/public/shared/tool-list-view.js +112 -0
- package/neural-interface/public/shared/topright-overflow-logic.js +54 -0
- package/neural-interface/public/shared/tour/tour-actor.js +268 -0
- package/neural-interface/public/shared/tour/tour-beats.js +336 -0
- package/neural-interface/public/shared/tour/tour-engine.js +884 -0
- package/neural-interface/public/shared/tour/tour-ink.js +390 -0
- package/neural-interface/public/shared/tour/tour-stage.js +440 -0
- package/neural-interface/public/shared/tour/tour-state.js +40 -0
- package/neural-interface/public/shared/tour/tour-tips.js +99 -0
- package/neural-interface/public/shared/tour/tour.css +144 -0
- package/neural-interface/public/shared/ui-antigravity-panel.js +19 -0
- package/neural-interface/public/shared/ui-assistant.js +2 -0
- package/neural-interface/public/shared/ui-automation-studio.js +111 -140
- package/neural-interface/public/shared/ui-claude-panel.js +376 -82
- package/neural-interface/public/shared/ui-cli-banner.js +23 -167
- package/neural-interface/public/shared/ui-command-runner.js +6 -3
- package/neural-interface/public/shared/ui-context-menu.js +295 -0
- package/neural-interface/public/shared/ui-cost-widget.js +57 -59
- package/neural-interface/public/shared/ui-crash-notice.js +187 -0
- package/neural-interface/public/shared/ui-detail.js +15 -3
- package/neural-interface/public/shared/ui-file-explorer.js +48 -6
- package/neural-interface/public/shared/ui-file-links.js +2 -2
- package/neural-interface/public/shared/ui-games.js +2 -2
- package/neural-interface/public/shared/ui-image-gallery.js +50 -47
- package/neural-interface/public/shared/ui-judgments.js +1 -1
- package/neural-interface/public/shared/ui-keybinds.js +33 -2
- package/neural-interface/public/shared/ui-link.js +3 -3
- package/neural-interface/public/shared/ui-menubar.js +10 -20
- package/neural-interface/public/shared/ui-native-loop-router-state.js +5 -0
- package/neural-interface/public/shared/ui-native-loop-router.js +11 -1
- package/neural-interface/public/shared/ui-navbar.js +49 -24
- package/neural-interface/public/shared/ui-notifications.js +1 -0
- package/neural-interface/public/shared/ui-panels.js +96 -65
- package/neural-interface/public/shared/ui-resume.js +9 -7
- package/neural-interface/public/shared/ui-schedules-studio.js +546 -431
- package/neural-interface/public/shared/ui-scroll-follow.js +16 -5
- package/neural-interface/public/shared/ui-sessions.js +27 -15
- package/neural-interface/public/shared/ui-settings.js +683 -526
- package/neural-interface/public/shared/ui-sidepanel-session-entry.js +9 -2
- package/neural-interface/public/shared/ui-sidepanel-sessions.js +4 -4
- package/neural-interface/public/shared/ui-sidepanel-state.js +23 -12
- package/neural-interface/public/shared/ui-sidepanel-tray.js +48 -7
- package/neural-interface/public/shared/ui-sidepanel-windows.js +18 -13
- package/neural-interface/public/shared/ui-skills.js +33 -2830
- package/neural-interface/public/shared/ui-styleguide.js +5 -2
- package/neural-interface/public/shared/ui-sync.js +15 -5
- package/neural-interface/public/shared/ui-terminal.js +270 -190
- package/neural-interface/public/shared/ui-tool-updates.js +6 -4
- package/neural-interface/public/shared/ui-tooltip.js +81 -51
- package/neural-interface/public/shared/ui-topright-overflow.js +233 -0
- package/neural-interface/public/shared/ui-trash.js +6 -4
- package/neural-interface/public/shared/ui-tutorial-layout.js +3 -117
- package/neural-interface/public/shared/ui-tutorial-preview.js +103 -0
- package/neural-interface/public/shared/ui-tutorial-steps.js +3 -65
- package/neural-interface/public/shared/ui-tutorial.css +47 -100
- package/neural-interface/public/shared/ui-tutorial.js +285 -509
- package/neural-interface/public/shared/ui-update.js +38 -2
- package/neural-interface/public/shared/ui-whiteboard.js +312 -59
- package/neural-interface/public/shared/ui-worker-end.js +5 -1
- package/neural-interface/public/shared/ui-workspaces.js +3 -2
- package/neural-interface/public/shared/view-variant.js +66 -0
- package/neural-interface/public/shared/whatsapp/wa-view.js +3 -3
- package/neural-interface/public/shared/whiteboard-list.js +172 -0
- package/neural-interface/public/shared/worker-end.js +10 -3
- package/neural-interface/public/shared/worker-questions.js +34 -0
- package/neural-interface/public/shared/worker-restart.js +12 -0
- package/neural-interface/public/sidepanel-session.html +2 -2
- package/neural-interface/public/variant/2d/background.js +2 -1
- package/neural-interface/public/variant/2d/context-menu.js +8 -2
- package/neural-interface/public/variant/2d/graph.js +42 -20
- package/neural-interface/public/variant/2d/hulls.js +14 -9
- package/neural-interface/public/variant/2d/lasso.js +11 -7
- package/neural-interface/public/variant/2d/main.js +32 -1
- package/neural-interface/public/variant/2d/minimap.js +11 -13
- package/neural-interface/public/variant/3d/main.js +69 -6
- package/neural-interface/public/variant/3d/map-controls.js +24 -9
- package/neural-interface/public/vendor/caveat/OFL.txt +93 -0
- package/neural-interface/public/vendor/caveat/caveat-latin-400-normal.woff2 +0 -0
- package/neural-interface/public/vendor/caveat/caveat-latin-700-normal.woff2 +0 -0
- package/neural-interface/public/vendor/caveat/caveat.css +17 -0
- package/neural-interface/public/vendor/caveat/manifest.json +12 -0
- package/neural-interface/public/vendor/yaml/LICENSE +13 -0
- package/neural-interface/public/vendor/yaml/manifest.json +4 -0
- package/neural-interface/public/vendor/yaml/yaml-2.9.1.min.js +137 -0
- package/neural-interface/scripts/build-vendor.mjs +32 -0
- package/neural-interface/server.js +4553 -2855
- package/neural-interface/templates/rulesets/README.md +1 -1
- package/neural-interface/templates/rulesets/core.md +1 -1
- package/neural-interface/templates/rulesets/legacy-hashes.json +23 -5
- package/neural-interface/templates/rulesets/manifest.json +8 -8
- package/npm-shrinkwrap.json +34 -12
- package/package.json +17 -3
- package/postinstall.js +9 -4
- package/preuninstall.js +1 -1
- package/setup.js +97 -322
- package/skills/skill-forge/SKILL.md +177 -0
- package/skills/skill-forge/evals/evals.json +54 -0
- package/skills/skill-forge/references/package.md +105 -0
- package/skills/skill-forge/references/review-and-recovery.md +63 -0
- package/skills/skill-forge/references/runtime-profiles.md +20 -0
- package/skills/skill-forge/references/sources-and-capabilities.md +51 -0
- package/skills/synabun/SKILL.md +10 -7
- package/skills/synabun/modules/audit.md +1 -5
- package/skills/synabun/modules/changelog.md +1 -5
- package/skills/synabun/modules/idea.md +1 -1
- package/skills/synabun/modules/memorize.md +6 -9
- package/skills/synabun/modules/schedule.md +6 -6
- package/mcp-server/dist/services/profiles.d.ts +0 -120
- package/mcp-server/dist/services/profiles.d.ts.map +0 -1
- package/mcp-server/dist/services/profiles.js +0 -387
- package/mcp-server/dist/services/profiles.js.map +0 -1
- package/mcp-server/dist/tools/leonardo-browser-tools.d.ts +0 -97
- package/mcp-server/dist/tools/leonardo-browser-tools.d.ts.map +0 -1
- package/mcp-server/dist/tools/leonardo-browser-tools.js +0 -228
- package/mcp-server/dist/tools/leonardo-browser-tools.js.map +0 -1
- package/mcp-server/dist/tools/leonardo.d.ts +0 -13
- package/mcp-server/dist/tools/leonardo.d.ts.map +0 -1
- package/mcp-server/dist/tools/leonardo.js +0 -21
- package/mcp-server/dist/tools/leonardo.js.map +0 -1
- package/mcp-server/dist/tools/profile.d.ts +0 -17
- package/mcp-server/dist/tools/profile.d.ts.map +0 -1
- package/mcp-server/dist/tools/profile.js +0 -114
- package/mcp-server/dist/tools/profile.js.map +0 -1
- package/mcp-server/src/services/profiles.ts +0 -428
- package/mcp-server/src/tools/leonardo-browser-tools.ts +0 -291
- package/mcp-server/src/tools/leonardo.ts +0 -30
- package/mcp-server/src/tools/profile.ts +0 -122
- package/neural-interface/lib/assistant-brains/opencode-browser-policy.js +0 -47
- package/neural-interface/lib/assistant-brains/opencode-route-gate.js +0 -62
- package/neural-interface/lib/mcp-profile-servers.js +0 -120
- package/neural-interface/public/shared/ui-tutorial-draw.js +0 -311
- package/skills/leonardo/SKILL.md +0 -168
- package/skills/leonardo/icon.svg +0 -1
- package/skills/leonardo/modules/browser-guide.md +0 -378
- package/skills/leonardo/modules/image-prompter.md +0 -283
- package/skills/leonardo/modules/model-advisor.md +0 -100
- package/skills/leonardo/modules/prompt-library.md +0 -110
- package/skills/leonardo/modules/style-guide.md +0 -186
- package/skills/leonardo/modules/video-prompter.md +0 -317
- /package/neural-interface/templates/rulesets/{gemini.md → antigravity.md} +0 -0
|
@@ -207,59 +207,6 @@ export async function forkSession(store, api, messageId) {
|
|
|
207
207
|
return at.isCurrent() ? { ok: true, session: out.data } : { ok: true, session: out.data, moved: true };
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
export async function deleteMessage(store, api, messageId) {
|
|
211
|
-
const at = captureBinding(store);
|
|
212
|
-
if (!at.sessionId || !messageId) return { ok: false, error: 'No message.' };
|
|
213
|
-
if (store.getState().running) return { ok: false, error: 'Stop the running turn before you delete a message.' };
|
|
214
|
-
const out = await call(() => api.messageDelete({ ...targetOf(at), messageID: messageId }), 'Delete failed');
|
|
215
|
-
if (!at.isCurrent()) return MOVED;
|
|
216
|
-
if (!out.ok) return out;
|
|
217
|
-
// message.removed does this too; doing it here keeps the panel right if that event is lost.
|
|
218
|
-
store.removeMessage(messageId);
|
|
219
|
-
return { ok: true };
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Publish the transcript. `confirm()` must resolve true first, every time:
|
|
224
|
-
* the caller asks in the panel (ocp-v2-confirm-logic.js), this function never
|
|
225
|
-
* shares without it. `stopped` is the panel's createStoppedShares().
|
|
226
|
-
*/
|
|
227
|
-
export async function shareSession(store, api, confirm, { stopped = null } = {}) {
|
|
228
|
-
// The session the question is about, captured before the question is asked:
|
|
229
|
-
// a confirm answered after the panel moved publishes nothing.
|
|
230
|
-
const at = captureBinding(store);
|
|
231
|
-
if (!at.sessionId) return { ok: false, error: 'No session.' };
|
|
232
|
-
let agreed = false;
|
|
233
|
-
try { agreed = (await confirm()) === true; } catch { agreed = false; }
|
|
234
|
-
if (!agreed) return { ok: false, cancelled: true };
|
|
235
|
-
if (!at.isCurrent()) return { ok: false, cancelled: true, moved: true };
|
|
236
|
-
const out = await call(() => api.sessionShare(targetOf(at)), 'Share failed');
|
|
237
|
-
// Shared again, for that session whatever is on screen by now: a link the
|
|
238
|
-
// panel had stopped before is a share once more.
|
|
239
|
-
if (out.ok) stopped?.resume(at.sessionId);
|
|
240
|
-
if (!at.isCurrent()) return MOVED;
|
|
241
|
-
if (!out.ok) return out;
|
|
242
|
-
applySession(store, at, out.data);
|
|
243
|
-
const url = out.data?.share?.url || '';
|
|
244
|
-
return url ? { ok: true, url } : { ok: false, error: 'OpenCode did not return a share link.' };
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
export async function unshareSession(store, api, { stopped = null } = {}) {
|
|
248
|
-
const at = captureBinding(store);
|
|
249
|
-
if (!at.sessionId) return { ok: false, error: 'No session.' };
|
|
250
|
-
const out = await call(() => api.sessionUnshare(targetOf(at)), 'Could not stop sharing');
|
|
251
|
-
// Sharing stopped, for that session whatever is on screen by now. OpenCode
|
|
252
|
-
// keeps the link in the session row and reports it again with every later
|
|
253
|
-
// read (createStoppedShares): the panel remembers which one it stopped.
|
|
254
|
-
if (out.ok) stopped?.stop(at.sessionId, at.sessionInfo?.share?.url || out.data?.share?.url || '');
|
|
255
|
-
if (!at.isCurrent()) return MOVED;
|
|
256
|
-
if (!out.ok) return out;
|
|
257
|
-
// The answer is read from that row too, so it can still carry the link.
|
|
258
|
-
if (out.data) applySession(store, at, { ...out.data, share: undefined });
|
|
259
|
-
else store.setSessionInfo({ share: undefined });
|
|
260
|
-
return { ok: true };
|
|
261
|
-
}
|
|
262
|
-
|
|
263
210
|
/**
|
|
264
211
|
* The transcript of the session on screen as a download: `{ ok, filename,
|
|
265
212
|
* json }`. Session id, metadata and file name are the ones captured before the
|
|
@@ -294,7 +241,7 @@ export async function loadSelectedSession(store, api, sessionId, info, apply) {
|
|
|
294
241
|
}
|
|
295
242
|
|
|
296
243
|
// ── Navigation ──────────────────────────────────────────────────────────────
|
|
297
|
-
// "New session"
|
|
244
|
+
// "New session" and a project change both end by binding the
|
|
298
245
|
// panel to a session they create. They own the panel only as long as nobody
|
|
299
246
|
// navigated meanwhile: `nav` is the binding captured at the user's gesture.
|
|
300
247
|
|
|
@@ -353,27 +300,27 @@ export async function renameSession(store, api, title, { binding } = {}) {
|
|
|
353
300
|
}
|
|
354
301
|
|
|
355
302
|
/**
|
|
356
|
-
* Switch the
|
|
303
|
+
* Switch the tool list of the session the panel is on. The answer belongs to
|
|
357
304
|
* the session it was asked for: `save(sessionId, profile)` records it under
|
|
358
305
|
* that session's key whatever is on screen by then, and the store takes it
|
|
359
306
|
* only while it is still on that binding (`applied`). Throws when the server
|
|
360
307
|
* refuses (as before). Resolves `{ sessionId, profile, applied }`, or null
|
|
361
308
|
* when there is no session.
|
|
362
309
|
*/
|
|
363
|
-
export async function
|
|
310
|
+
export async function setSessionTools(store, api, tools, { save } = {}) {
|
|
364
311
|
const at = captureBinding(store);
|
|
365
312
|
if (!at.sessionId) return null;
|
|
366
|
-
const result = await api.
|
|
313
|
+
const result = await api.toolsSet(at.sessionId, tools);
|
|
367
314
|
if (result?.error || result?.ok === false || Number(result?.status || 200) >= 400) {
|
|
368
|
-
const error = new Error(result?.error || result?.data?.error || `Could not switch
|
|
315
|
+
const error = new Error(result?.error || result?.data?.error || `Could not switch tools (${result?.status || 'unknown error'})`);
|
|
369
316
|
error.stale = !at.isCurrent();
|
|
370
317
|
throw error;
|
|
371
318
|
}
|
|
372
|
-
const effective = result?.data?.
|
|
319
|
+
const effective = result?.data?.tools || tools;
|
|
373
320
|
if (typeof save === 'function') save(at.sessionId, effective);
|
|
374
321
|
const applied = at.isCurrent();
|
|
375
|
-
if (applied) store.
|
|
376
|
-
return { sessionId: at.sessionId,
|
|
322
|
+
if (applied) store.setTools(effective);
|
|
323
|
+
return { sessionId: at.sessionId, tools: effective, applied };
|
|
377
324
|
}
|
|
378
325
|
|
|
379
326
|
/**
|
|
@@ -154,7 +154,7 @@ export function lastUserMessageId(state) {
|
|
|
154
154
|
/**
|
|
155
155
|
* Action ids a message offers, in display order. `supports(type)` is the
|
|
156
156
|
* capability check; `canOpenSessions` is false in a sub-agent panel.
|
|
157
|
-
* user: copy, undo (revert to here + text back in the composer), fork
|
|
157
|
+
* user: copy, undo (revert to here + text back in the composer), fork
|
|
158
158
|
* assistant: copy, retry (revert to the turn's prompt and send it again)
|
|
159
159
|
*/
|
|
160
160
|
export function messageActionsFor(msg, state, { supports = () => false, canOpenSessions = true, canCompose = true } = {}) {
|
|
@@ -167,7 +167,6 @@ export function messageActionsFor(msg, state, { supports = () => false, canOpenS
|
|
|
167
167
|
if (role === 'user') {
|
|
168
168
|
if (idle && canCompose && supports('session:revert')) actions.push('undo');
|
|
169
169
|
if (canOpenSessions && supports('session:fork')) actions.push('fork');
|
|
170
|
-
if (idle && supports('message:delete')) actions.push('delete');
|
|
171
170
|
} else if (idle && canCompose && supports('session:revert') && turnStartFor(state, msg.id)) {
|
|
172
171
|
actions.push('retry');
|
|
173
172
|
}
|
|
@@ -207,86 +206,6 @@ export function pickReusableEmptySession(sessions, cwd, { excludeIds = [] } = {}
|
|
|
207
206
|
)) || null;
|
|
208
207
|
}
|
|
209
208
|
|
|
210
|
-
// ── Share ───────────────────────────────────────────────────────────────────
|
|
211
|
-
|
|
212
|
-
/** What the menu offers for sharing. `policy` is OpenCode's `share` setting. */
|
|
213
|
-
export function shareView(sessionInfo, policy, supports = () => false) {
|
|
214
|
-
const url = typeof sessionInfo?.share?.url === 'string' ? sessionInfo.share.url : '';
|
|
215
|
-
const available = supports('session:share') && supports('session:unshare') && policy !== 'disabled';
|
|
216
|
-
return {
|
|
217
|
-
url,
|
|
218
|
-
canShare: available && !url && !!sessionInfo?.id,
|
|
219
|
-
canUnshare: available && !!url,
|
|
220
|
-
// A link that exists stays visible even when sharing has since been disabled.
|
|
221
|
-
showLink: !!url,
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
export const SHARE_CONFIRM_TEXT = 'Share this session?\n\nThe whole transcript (your prompts, the replies, tool output and file contents the model read) is uploaded to OpenCode and published at a public URL. Anyone with the link can read it until you stop sharing.';
|
|
226
|
-
|
|
227
|
-
// ── Sharing that was stopped ────────────────────────────────────────────────
|
|
228
|
-
// On unshare OpenCode (1.18.34) removes the share and its public page, but the
|
|
229
|
-
// link stays in the session row: the row update skips an absent `share`, so
|
|
230
|
-
// `share_url` is never cleared. Every later read of that session says it is
|
|
231
|
-
// shared again: session:get, the session list, the reply to the unshare
|
|
232
|
-
// itself, and each session.updated that is built from the stored row. So the
|
|
233
|
-
// panel remembers the link it stopped, and that link is no share wherever
|
|
234
|
-
// session info is read (the store, the session menu, the tab cache).
|
|
235
|
-
|
|
236
|
-
export const STOPPED_SHARES_MAX = 200;
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* stop(sessionId, url) sharing of this link was stopped (the unshare
|
|
240
|
-
* was answered ok)
|
|
241
|
-
* resume(sessionId) the session was shared again from the panel, or
|
|
242
|
-
* is gone
|
|
243
|
-
* isStopped(sessionId, url) `url` is the link that was stopped
|
|
244
|
-
* clean(info) session info with a stopped link taken out
|
|
245
|
-
* (`share: undefined`, so a merge clears it);
|
|
246
|
-
* `info` itself when there is nothing to take out.
|
|
247
|
-
* A session that reports another link was shared
|
|
248
|
-
* again somewhere else: that one is real.
|
|
249
|
-
* `load()` → `{ sessionId: url }` and `save(entries)` keep it across a reload.
|
|
250
|
-
* The oldest entries go first once there are more than `max`.
|
|
251
|
-
*/
|
|
252
|
-
export function createStoppedShares({ load = () => null, save = () => {}, max = STOPPED_SHARES_MAX } = {}) {
|
|
253
|
-
const stopped = new Map(); // sessionId → the link that was stopped
|
|
254
|
-
try {
|
|
255
|
-
const saved = load();
|
|
256
|
-
for (const [id, url] of Object.entries(saved && typeof saved === 'object' ? saved : {})) {
|
|
257
|
-
if (id && typeof url === 'string' && url) stopped.set(id, url);
|
|
258
|
-
}
|
|
259
|
-
} catch { /* nothing saved, or not readable: nothing is hidden */ }
|
|
260
|
-
const persist = () => { try { save(Object.fromEntries(stopped)); } catch { /* kept in memory */ } };
|
|
261
|
-
const idOf = (info) => String(info?.id || info?.sessionID || '');
|
|
262
|
-
const resume = (sessionId) => {
|
|
263
|
-
if (!stopped.delete(String(sessionId || ''))) return false;
|
|
264
|
-
persist();
|
|
265
|
-
return true;
|
|
266
|
-
};
|
|
267
|
-
return {
|
|
268
|
-
stop(sessionId, url) {
|
|
269
|
-
const id = String(sessionId || '');
|
|
270
|
-
if (!id || typeof url !== 'string' || !url) return false;
|
|
271
|
-
stopped.delete(id);
|
|
272
|
-
stopped.set(id, url);
|
|
273
|
-
while (stopped.size > max) stopped.delete(stopped.keys().next().value);
|
|
274
|
-
persist();
|
|
275
|
-
return true;
|
|
276
|
-
},
|
|
277
|
-
resume,
|
|
278
|
-
isStopped: (sessionId, url) => !!url && stopped.get(String(sessionId || '')) === url,
|
|
279
|
-
clean(info) {
|
|
280
|
-
const id = idOf(info);
|
|
281
|
-
const url = info?.share?.url;
|
|
282
|
-
if (!id || typeof url !== 'string' || !url || !stopped.has(id)) return info;
|
|
283
|
-
if (stopped.get(id) !== url) { resume(id); return info; }
|
|
284
|
-
return { ...info, share: undefined };
|
|
285
|
-
},
|
|
286
|
-
size: () => stopped.size,
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
|
|
290
209
|
// ── Tabs that are not on screen ─────────────────────────────────────────────
|
|
291
210
|
// The panel shows one session; its other tabs go on running their turns in
|
|
292
211
|
// OpenCode. What each of them does comes from OpenCode's own run events (every
|
|
@@ -323,6 +242,7 @@ export function sessionBusyFromStatus(res) {
|
|
|
323
242
|
* each iteration starts the next.
|
|
324
243
|
*/
|
|
325
244
|
export function automationTurnPhase(run) {
|
|
245
|
+
if (run?.status === 'suspended') return 'idle';
|
|
326
246
|
if (run?.status !== 'starting' && run?.status !== 'running') return null;
|
|
327
247
|
switch (run.turnState) {
|
|
328
248
|
case 'awaiting_permission': case 'needs_input': return 'waiting';
|
|
@@ -347,15 +267,6 @@ export function tabPillState({ sessionId, activeSessionId, running = false, busy
|
|
|
347
267
|
return turn ? 'working' : 'idle';
|
|
348
268
|
}
|
|
349
269
|
|
|
350
|
-
// ── Deleting a message ──────────────────────────────────────────────────────
|
|
351
|
-
|
|
352
|
-
/** The question before a message is deleted: which one, and that it is final. */
|
|
353
|
-
export function deleteMessageConfirmText(msg) {
|
|
354
|
-
const text = messageText(msg).replace(/\s+/g, ' ').trim();
|
|
355
|
-
const excerpt = text.length > 80 ? `${text.slice(0, 80)}…` : text;
|
|
356
|
-
return `Delete ${excerpt ? `the message “${excerpt}”` : 'this message'} from the session? This cannot be undone.`;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
270
|
// ── Renames that are waiting for their answer ───────────────────────────────
|
|
360
271
|
|
|
361
272
|
/**
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import { api, capabilities, supports } from './ocp-v2-ws.js';
|
|
9
9
|
import { buildSlashCatalog, createSlashCatalogCache } from './ocp-v2-composer-logic.js';
|
|
10
10
|
import { replyFailed } from './ocp-v2-caps.js';
|
|
11
|
+
import { on } from '../state.js';
|
|
11
12
|
|
|
12
13
|
// The catalog is built by buildSlashCatalog (ocp-v2-composer-logic.js):
|
|
13
14
|
// local a panel action → options.onLocalSelect / send.js
|
|
@@ -33,17 +34,9 @@ async function fetchLegacyLists() {
|
|
|
33
34
|
|
|
34
35
|
async function fetchCatalog(cwd) {
|
|
35
36
|
if (supports('command:list', 'command:run')) {
|
|
36
|
-
const
|
|
37
|
-
api.commandList({ cwd: cwd || undefined }),
|
|
38
|
-
// /share is not offered when the OpenCode config disables sharing.
|
|
39
|
-
api.sessionSharePolicy({ cwd: cwd || undefined }).catch(() => null),
|
|
40
|
-
]);
|
|
37
|
+
const res = await api.commandList({ cwd: cwd || undefined });
|
|
41
38
|
if (replyFailed(res)) throw new Error(res?.error || 'command list failed');
|
|
42
|
-
return buildSlashCatalog({
|
|
43
|
-
serverCommands: res.data,
|
|
44
|
-
supports,
|
|
45
|
-
sharePolicy: replyFailed(policy) ? null : policy.data?.share,
|
|
46
|
-
});
|
|
39
|
+
return buildSlashCatalog({ serverCommands: res.data, supports });
|
|
47
40
|
}
|
|
48
41
|
return buildSlashCatalog({ legacy: await fetchLegacyLists(), supports });
|
|
49
42
|
}
|
|
@@ -67,13 +60,21 @@ export async function loadSlashCatalog(cwd = '') {
|
|
|
67
60
|
return catalog;
|
|
68
61
|
}
|
|
69
62
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
capabilities.subscribe(() => {
|
|
63
|
+
/** Every catalog built again, each composer asking for its own directory (the server or the skills changed). */
|
|
64
|
+
export function reloadSlashCatalogs() {
|
|
73
65
|
_catalogs.invalidate();
|
|
74
66
|
const wanted = new Set([..._instances].map((inst) => String(inst.getCwd() || '')));
|
|
75
|
-
for (const cwd of wanted) loadSlashCatalog(cwd).catch((err) => console.warn('[ocp-v2-slash-hints] catalog load failed', err));
|
|
76
|
-
}
|
|
67
|
+
for (const cwd of wanted) loadSlashCatalog(cwd).then(() => { for (const inst of _instances) if (String(inst.getCwd() || '') === cwd) inst.refresh(); }).catch((err) => console.warn('[ocp-v2-slash-hints] catalog load failed', err));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// A restarted server may list more (or fewer) request types: every catalog is
|
|
71
|
+
// built again, each composer asking for its own directory.
|
|
72
|
+
capabilities.subscribe(() => reloadSlashCatalogs());
|
|
73
|
+
|
|
74
|
+
// A skill was installed, removed or changed (Skills Studio, Settings, an agent): OpenCode's serve reads its skill
|
|
75
|
+
// folders again on every listing (opencode 2.1.4, checked 2026-10-23), so asking again is enough for the slash
|
|
76
|
+
// hints to list it; nothing waits for the next "/".
|
|
77
|
+
on('sync:skills:changed', () => reloadSlashCatalogs());
|
|
77
78
|
|
|
78
79
|
// ── Public mount API ────────────────────────────────────────────────────────
|
|
79
80
|
|
|
@@ -84,7 +84,7 @@ export function createPanelStore() {
|
|
|
84
84
|
model: null,
|
|
85
85
|
variant: null,
|
|
86
86
|
cwd: null,
|
|
87
|
-
|
|
87
|
+
tools: null,
|
|
88
88
|
contextGauge: createDefaultContextGauge(),
|
|
89
89
|
|
|
90
90
|
planTurnActive: false,
|
|
@@ -161,20 +161,7 @@ export function createPanelStore() {
|
|
|
161
161
|
notify({ type: 'server:status' });
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
|
|
165
|
-
// takes out a share link whose sharing it stopped (createStoppedShares in
|
|
166
|
-
// ocp-v2-sessions-logic.js): OpenCode goes on reporting it.
|
|
167
|
-
let _sessionInfoFilter = null;
|
|
168
|
-
function setSessionInfoFilter(filter) {
|
|
169
|
-
_sessionInfoFilter = typeof filter === 'function' ? filter : null;
|
|
170
|
-
}
|
|
171
|
-
const filteredInfo = (info) => {
|
|
172
|
-
if (!info || !_sessionInfoFilter) return info;
|
|
173
|
-
try { return _sessionInfoFilter(info) || info; } catch { return info; }
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
function setSession(sessionId, rawInfo = null) {
|
|
177
|
-
const info = filteredInfo(rawInfo);
|
|
164
|
+
function setSession(sessionId, info = null) {
|
|
178
165
|
const prevSessionId = _state.sessionId;
|
|
179
166
|
_state.sessionId = sessionId;
|
|
180
167
|
_state.sessionInfo = info;
|
|
@@ -217,7 +204,7 @@ export function createPanelStore() {
|
|
|
217
204
|
if (!info || !_state.sessionId) return;
|
|
218
205
|
const id = info.id || info.sessionID;
|
|
219
206
|
if (id && id !== _state.sessionId) return;
|
|
220
|
-
_state.sessionInfo =
|
|
207
|
+
_state.sessionInfo = { ...(_state.sessionInfo || {}), ...info };
|
|
221
208
|
_state.knownSessions.set(_state.sessionId, _state.sessionInfo);
|
|
222
209
|
const compacting = !!info.time?.compacting;
|
|
223
210
|
if (compacting !== _state.compacting) {
|
|
@@ -501,7 +488,7 @@ export function createPanelStore() {
|
|
|
501
488
|
function setKnownSessions(list) {
|
|
502
489
|
_state.knownSessions.clear();
|
|
503
490
|
for (const s of list || []) {
|
|
504
|
-
if (s?.id) _state.knownSessions.set(s.id,
|
|
491
|
+
if (s?.id) _state.knownSessions.set(s.id, s);
|
|
505
492
|
}
|
|
506
493
|
notify({ type: 'sessions:list' });
|
|
507
494
|
}
|
|
@@ -608,7 +595,7 @@ export function createPanelStore() {
|
|
|
608
595
|
function setModel(model) { _state.model = model; notify({ type: 'config:model' }); }
|
|
609
596
|
function setVariant(variant) { _state.variant = variant; notify({ type: 'config:variant' }); }
|
|
610
597
|
function setCwd(cwd) { _state.cwd = cwd; notify({ type: 'config:cwd' }); }
|
|
611
|
-
function
|
|
598
|
+
function setTools(tools) { _state.tools = Array.isArray(tools) ? [...tools] : null; notify({ type: 'config:tools' }); }
|
|
612
599
|
|
|
613
600
|
function setContextGauge(value = {}) {
|
|
614
601
|
_state.contextGauge = { ...(_state.contextGauge || createDefaultContextGauge()), ...value };
|
|
@@ -677,8 +664,8 @@ export function createPanelStore() {
|
|
|
677
664
|
setAutoAccept, setTodos, setSessionDiff,
|
|
678
665
|
setPendingQuestions, addPendingQuestion, removePendingQuestion,
|
|
679
666
|
pushError, dismissError, clearErrors, setHealing, setKnownSessions,
|
|
680
|
-
|
|
681
|
-
setMode, setAgent, setModel, setVariant, setCwd,
|
|
667
|
+
setHelpCard,
|
|
668
|
+
setMode, setAgent, setModel, setVariant, setCwd, setTools,
|
|
682
669
|
setContextGauge, resetContextGauge,
|
|
683
670
|
beginPlanTurn, completePlanTurn, setPlanContent,
|
|
684
671
|
setPostPlanActions, setPlanMaterializing, clearPlanState,
|
|
@@ -729,7 +716,7 @@ export const setAgent = (...a) => _defaultStore.setAgent(...a);
|
|
|
729
716
|
export const setModel = (...a) => _defaultStore.setModel(...a);
|
|
730
717
|
export const setVariant = (...a) => _defaultStore.setVariant(...a);
|
|
731
718
|
export const setCwd = (...a) => _defaultStore.setCwd(...a);
|
|
732
|
-
export const
|
|
719
|
+
export const setTools = (...a) => _defaultStore.setTools(...a);
|
|
733
720
|
export const setContextGauge = (...a) => _defaultStore.setContextGauge(...a);
|
|
734
721
|
export const resetContextGauge = (...a) => _defaultStore.resetContextGauge(...a);
|
|
735
722
|
export const beginPlanTurn = (...a) => _defaultStore.beginPlanTurn(...a);
|
|
@@ -8,7 +8,7 @@ const MCP_VIEW = {
|
|
|
8
8
|
connected: { label: 'connected', tone: 'ok', action: 'disconnect', actionLabel: 'Disconnect' },
|
|
9
9
|
disabled: { label: 'disabled', tone: 'muted', action: 'connect', actionLabel: 'Connect' },
|
|
10
10
|
failed: { label: 'failed', tone: 'error', action: 'connect', actionLabel: 'Retry' },
|
|
11
|
-
needs_auth: { label: 'needs sign-in', tone: 'warn', action:
|
|
11
|
+
needs_auth: { label: 'needs sign-in', tone: 'warn', action: null, actionLabel: '' },
|
|
12
12
|
needs_client_registration: { label: 'needs client registration', tone: 'warn', action: null, actionLabel: '' },
|
|
13
13
|
};
|
|
14
14
|
|
|
@@ -247,101 +247,3 @@ export function isProviderCatalogEvent(eventType) {
|
|
|
247
247
|
return PROVIDER_CATALOG_EVENTS.includes(type) || type.startsWith('integration.');
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
-
// ── Sign-in pages OpenCode could not open itself ────────────────────────────
|
|
251
|
-
// `mcp.browser.open.failed` carries a server name and a URL and nothing about
|
|
252
|
-
// who asked. The URL is a sign-in for one server of one session's serve, so it
|
|
253
|
-
// is shown only there. What identifies the attempt on this page is the request
|
|
254
|
-
// that is out for it: the popover opens an attempt (`expect`) before its
|
|
255
|
-
// request leaves and closes it (`done()`) when the request has ended. A
|
|
256
|
-
// failure is attributed only while exactly one session has an attempt open for
|
|
257
|
-
// that server name. When two sessions are signing in to a server of the same
|
|
258
|
-
// name at once, nothing says whose page it is, and it is shown to neither; one
|
|
259
|
-
// nobody on this page has open (another window, the CLI, a request that has
|
|
260
|
-
// already ended) has no owner here and is not shown either.
|
|
261
|
-
// The link is kept on the attempt it was attributed to and lives exactly as
|
|
262
|
-
// long: it goes when the attempt ends (`done()`), when it expires (a request
|
|
263
|
-
// that never ends), when its session is forgotten, and when another attempt
|
|
264
|
-
// for the same server name begins (the same session asks again: the earlier
|
|
265
|
-
// page is no longer the one to open; another session asks: nothing says any
|
|
266
|
-
// more whose page a link is). `onChange` is called whenever a link went that
|
|
267
|
-
// way, so that open popovers are painted again.
|
|
268
|
-
export const SIGN_IN_EXPECT_MS = 10 * 60 * 1000;
|
|
269
|
-
|
|
270
|
-
export function createSignInFailures({ now = () => Date.now(), ttlMs = SIGN_IN_EXPECT_MS, onChange = () => {} } = {}) {
|
|
271
|
-
let attempts = []; // open attempts: { id, sessionId, mcpName, at, url, timer }
|
|
272
|
-
let seq = 0;
|
|
273
|
-
const changed = () => { try { onChange(); } catch { /* listener's problem */ } };
|
|
274
|
-
// These attempts are over. Their links go with them.
|
|
275
|
-
const close = (list) => {
|
|
276
|
-
const over = list.filter((e) => attempts.includes(e));
|
|
277
|
-
if (!over.length) return;
|
|
278
|
-
attempts = attempts.filter((e) => !over.includes(e));
|
|
279
|
-
for (const e of over) clearTimeout(e.timer);
|
|
280
|
-
if (over.some((e) => e.url)) changed();
|
|
281
|
-
};
|
|
282
|
-
const expired = (e) => now() - e.at > ttlMs;
|
|
283
|
-
// A request that never ends (a socket that died under it) does not keep its
|
|
284
|
-
// attempt open for ever.
|
|
285
|
-
const prune = () => close(attempts.filter(expired));
|
|
286
|
-
const closed = Object.freeze({ id: 0, done() {} });
|
|
287
|
-
return {
|
|
288
|
-
/**
|
|
289
|
-
* `sessionId` is about to ask its serve to sign in to (or start) `mcpName`.
|
|
290
|
-
* Returns the attempt: call `done()` when the request has ended, however
|
|
291
|
-
* it ended. (Several attempts of one session for one server may be open.)
|
|
292
|
-
*/
|
|
293
|
-
expect(sessionId, mcpName) {
|
|
294
|
-
const sid = String(sessionId || '');
|
|
295
|
-
const name = String(mcpName || '');
|
|
296
|
-
if (!sid || !name) return closed;
|
|
297
|
-
prune();
|
|
298
|
-
// A new attempt for this server name: no link recorded for an earlier
|
|
299
|
-
// one is offered any more, in this session or in another.
|
|
300
|
-
const outdated = attempts.filter((e) => e.mcpName === name && e.url);
|
|
301
|
-
for (const e of outdated) e.url = '';
|
|
302
|
-
seq += 1;
|
|
303
|
-
const attempt = { id: seq, sessionId: sid, mcpName: name, at: now(), url: '', timer: null };
|
|
304
|
-
// It expires by itself, should nobody call anything until then.
|
|
305
|
-
attempt.timer = setTimeout(prune, ttlMs + 1);
|
|
306
|
-
attempt.timer?.unref?.();
|
|
307
|
-
attempts.push(attempt);
|
|
308
|
-
if (outdated.length) changed();
|
|
309
|
-
return { id: attempt.id, done() { close([attempt]); } };
|
|
310
|
-
},
|
|
311
|
-
/** The event. Returns the session it was attributed to, or '' (shown nowhere). */
|
|
312
|
-
record({ mcpName, url } = {}) {
|
|
313
|
-
const name = String(mcpName || '');
|
|
314
|
-
const link = String(url || '');
|
|
315
|
-
if (!name || !link) return '';
|
|
316
|
-
prune();
|
|
317
|
-
const open = attempts.filter((e) => e.mcpName === name);
|
|
318
|
-
const owners = new Set(open.map((e) => e.sessionId));
|
|
319
|
-
// Nobody here has it open, or more than one session does: no owner.
|
|
320
|
-
if (owners.size !== 1) return '';
|
|
321
|
-
for (const e of open) e.url = link;
|
|
322
|
-
return open[0].sessionId;
|
|
323
|
-
},
|
|
324
|
-
/** The pages to offer in `sessionId`'s popover: only for servers it lists. */
|
|
325
|
-
forSession(sessionId, rows = []) {
|
|
326
|
-
const sid = String(sessionId || '');
|
|
327
|
-
if (!sid) return [];
|
|
328
|
-
const out = [];
|
|
329
|
-
for (const row of Array.isArray(rows) ? rows : []) {
|
|
330
|
-
const name = String(row?.name || '');
|
|
331
|
-
const held = attempts.filter((e) => e.sessionId === sid && e.mcpName === name && e.url && !expired(e)).pop();
|
|
332
|
-
// Signed in meanwhile: nothing left to open.
|
|
333
|
-
if (held && row?.status !== 'connected') out.push({ mcpName: name, url: held.url });
|
|
334
|
-
}
|
|
335
|
-
return out;
|
|
336
|
-
},
|
|
337
|
-
/** The session is gone. */
|
|
338
|
-
forget(sessionId) {
|
|
339
|
-
const sid = String(sessionId || '');
|
|
340
|
-
close(attempts.filter((e) => e.sessionId === sid));
|
|
341
|
-
},
|
|
342
|
-
/** Links on offer. */
|
|
343
|
-
size: () => attempts.filter((e) => e.url && !expired(e)).length,
|
|
344
|
-
/** Attempts still open (their request has not ended). */
|
|
345
|
-
open: () => { prune(); return attempts.length; },
|
|
346
|
-
};
|
|
347
|
-
}
|
|
@@ -11,7 +11,7 @@ import { api, supports, onEvent, capabilities } from './ocp-v2-ws.js';
|
|
|
11
11
|
import { getDefaultStore } from './ocp-v2-state.js';
|
|
12
12
|
import { replyFailed, replyError } from './ocp-v2-caps.js';
|
|
13
13
|
import {
|
|
14
|
-
mcpRowView, updateNoticeText, isProviderCatalogEvent, addMcpServer,
|
|
14
|
+
mcpRowView, updateNoticeText, isProviderCatalogEvent, addMcpServer,
|
|
15
15
|
} from './ocp-v2-status-logic.js';
|
|
16
16
|
import { openProviderSettings } from './ocp-v2-settings-link.js';
|
|
17
17
|
import { captureBinding, boundReader, onRebind } from './ocp-v2-binding.js';
|
|
@@ -24,17 +24,10 @@ const _listeners = new Set();
|
|
|
24
24
|
const notifyAll = () => { for (const fn of _listeners) { try { fn(); } catch { /* listener's problem */ } } };
|
|
25
25
|
/** The OpenCode version an update notice named, '' when there is none. */
|
|
26
26
|
export const updateAvailableVersion = () => _updateAvailable;
|
|
27
|
-
// Sign-in pages OpenCode could not open itself, each kept for the session and
|
|
28
|
-
// the server whose sign-in it is (never one global link for every popover),
|
|
29
|
-
// and only for as long as that sign-in's request is out: when a link goes
|
|
30
|
-
// (the request ended, expired, or another one for that server name began),
|
|
31
|
-
// every open popover is painted again.
|
|
32
|
-
const _signInFailures = createSignInFailures({ onChange: () => notifyAll() });
|
|
33
27
|
|
|
34
28
|
onEvent((eventType, ev) => {
|
|
35
29
|
if (eventType === 'installation.update-available' && ev?.version) { _updateAvailable = String(ev.version); notifyAll(); }
|
|
36
30
|
else if (eventType === 'installation.updated') { _updateAvailable = ''; notifyAll(); }
|
|
37
|
-
else if (eventType === 'mcp.browser.open.failed' && ev?.url) { if (_signInFailures.record({ mcpName: ev.mcpName, url: ev.url })) notifyAll(); }
|
|
38
31
|
else if (eventType === 'mcp.tools.changed' || eventType === 'lsp.updated') notifyAll();
|
|
39
32
|
// The model catalog or a provider connection changed: every picker re-reads it.
|
|
40
33
|
else if (isProviderCatalogEvent(eventType) && typeof document !== 'undefined') {
|
|
@@ -97,15 +90,8 @@ export function mountEnvironmentPopover(panelEl, store = getDefaultStore(), opts
|
|
|
97
90
|
async function switchMcp(row, view) {
|
|
98
91
|
const at = captureBinding(store);
|
|
99
92
|
const params = { sessionId: at.sessionId, name: row.name, cwd: at.cwd || undefined };
|
|
100
|
-
|
|
101
|
-
// to open it, the link is this session's and this server's.
|
|
102
|
-
// The attempt is open for as long as its request is out, and no longer.
|
|
103
|
-
const attempt = view.action !== 'disconnect' ? _signInFailures.expect(at.sessionId, row.name) : null;
|
|
104
|
-
const call = view.action === 'authenticate' ? api.mcpAuthenticate(params)
|
|
105
|
-
: view.action === 'disconnect' ? api.mcpDisconnect(params)
|
|
106
|
-
: api.mcpConnect(params);
|
|
93
|
+
const call = view.action === 'disconnect' ? api.mcpDisconnect(params) : api.mcpConnect(params);
|
|
107
94
|
const res = await call.catch((err) => ({ ok: false, error: err?.message }));
|
|
108
|
-
attempt?.done();
|
|
109
95
|
// The answer is about that session's serve. On another binding the
|
|
110
96
|
// popover already shows (or is reading) the new session's servers.
|
|
111
97
|
if (!at.isCurrent()) return;
|
|
@@ -162,13 +148,9 @@ export function mountEnvironmentPopover(panelEl, store = getDefaultStore(), opts
|
|
|
162
148
|
// Settings route is not used: it would start the server a second time
|
|
163
149
|
// on the shared serve.
|
|
164
150
|
canPersist: supports('feature:mcp-add-persist'),
|
|
165
|
-
register: ({ name: serverName, config, persist }) => {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
return api.mcpAdd({
|
|
169
|
-
sessionId: targetSessionId, name: serverName, config, persist, cwd: targetCwd || undefined,
|
|
170
|
-
}).finally(() => attempt.done());
|
|
171
|
-
},
|
|
151
|
+
register: ({ name: serverName, config, persist }) => api.mcpAdd({
|
|
152
|
+
sessionId: targetSessionId, name: serverName, config, persist, cwd: targetCwd || undefined,
|
|
153
|
+
}),
|
|
172
154
|
});
|
|
173
155
|
// The server was added to (or refused by) the session the form was
|
|
174
156
|
// submitted on. On another binding its note is not shown: the form
|
|
@@ -247,18 +229,6 @@ export function mountEnvironmentPopover(panelEl, store = getDefaultStore(), opts
|
|
|
247
229
|
node.appendChild(action);
|
|
248
230
|
}
|
|
249
231
|
}
|
|
250
|
-
// Only the sign-in pages of this session's own servers (`at` is the
|
|
251
|
-
// binding these rows were read for).
|
|
252
|
-
for (const failed of _signInFailures.forSession(at.sessionId, rows)) {
|
|
253
|
-
const manual = el('div', 'ocpv2-env-note');
|
|
254
|
-
manual.appendChild(document.createTextNode(`Open this page to sign in to ${failed.mcpName || 'the server'}: `));
|
|
255
|
-
const link = el('a', 'ocpv2-inline-action', 'Open');
|
|
256
|
-
if (/^https?:\/\//i.test(failed.url)) link.href = failed.url;
|
|
257
|
-
link.target = '_blank';
|
|
258
|
-
link.rel = 'noopener noreferrer';
|
|
259
|
-
manual.appendChild(link);
|
|
260
|
-
mcp.appendChild(manual);
|
|
261
|
-
}
|
|
262
232
|
renderAddServer(mcp, at);
|
|
263
233
|
}
|
|
264
234
|
|
|
@@ -45,6 +45,10 @@ const CSS = `
|
|
|
45
45
|
opacity: 1;
|
|
46
46
|
overflow: visible;
|
|
47
47
|
}
|
|
48
|
+
/* Windows: the shell is 92% opaque, so the blur behind it barely shows, yet Chromium recomputes it on every
|
|
49
|
+
repaint inside the panel (a transcript rendering, a stream). There it goes; the colour stays. */
|
|
50
|
+
html.platform-win32 .ocpv2-panel,
|
|
51
|
+
html.desktop-titlebar--win32 .ocpv2-panel { backdrop-filter: none; -webkit-backdrop-filter: none; }
|
|
48
52
|
/* Keep footer menus above focused floating terminal windows. */
|
|
49
53
|
.ocpv2-panel:has(.ocpv2-dropdown.open) {
|
|
50
54
|
z-index: 99999;
|
|
@@ -464,6 +468,19 @@ const CSS = `
|
|
|
464
468
|
rgba(232,224,220,0.0) 100%
|
|
465
469
|
);
|
|
466
470
|
}
|
|
471
|
+
html.platform-win32 .ocpv2-session-pill.ocpv2-pill-running,
|
|
472
|
+
html.desktop-titlebar--win32 .ocpv2-session-pill.ocpv2-pill-running {
|
|
473
|
+
border-color: rgba(232, 224, 220, 0.38);
|
|
474
|
+
}
|
|
475
|
+
html.platform-win32 .ocpv2-session-pill.ocpv2-pill-running:hover,
|
|
476
|
+
html.desktop-titlebar--win32 .ocpv2-session-pill.ocpv2-pill-running:hover {
|
|
477
|
+
border-color: rgba(232, 224, 220, 0.58);
|
|
478
|
+
}
|
|
479
|
+
html.platform-win32 .ocpv2-session-pill.ocpv2-pill-running::before,
|
|
480
|
+
html.desktop-titlebar--win32 .ocpv2-session-pill.ocpv2-pill-running::before {
|
|
481
|
+
animation: none;
|
|
482
|
+
opacity: 0;
|
|
483
|
+
}
|
|
467
484
|
.ocpv2-session-pill.ocpv2-pill-running .term-minimized-pill-label::before {
|
|
468
485
|
content: '';
|
|
469
486
|
display: inline-block;
|
|
@@ -3564,27 +3581,6 @@ const PARITY_CSS = `
|
|
|
3564
3581
|
.ocpv2-changes-deleted { color: rgba(220,140,140,0.82); }
|
|
3565
3582
|
.ocpv2-changes-file .ocpv2-tool-output { max-height: 320px; }
|
|
3566
3583
|
|
|
3567
|
-
/* ── New-session dialog: worktree option ──────────────────────────────── */
|
|
3568
|
-
.ocpv2-name-modal-worktree[hidden],
|
|
3569
|
-
.ocpv2-name-modal-worktrees[hidden] { display: none; }
|
|
3570
|
-
.ocpv2-name-modal-check {
|
|
3571
|
-
display: inline-flex;
|
|
3572
|
-
align-items: center;
|
|
3573
|
-
gap: 6px;
|
|
3574
|
-
font-size: 11px;
|
|
3575
|
-
color: rgba(255,255,255,0.78);
|
|
3576
|
-
cursor: pointer;
|
|
3577
|
-
}
|
|
3578
|
-
.ocpv2-name-modal-worktrees {
|
|
3579
|
-
display: flex;
|
|
3580
|
-
flex-direction: column;
|
|
3581
|
-
gap: 2px;
|
|
3582
|
-
font-size: 10px;
|
|
3583
|
-
color: rgba(255,255,255,0.4);
|
|
3584
|
-
max-height: 72px;
|
|
3585
|
-
overflow-y: auto;
|
|
3586
|
-
}
|
|
3587
|
-
|
|
3588
3584
|
/* ── Environment popover ("Manage" in Context settings), under the header ── */
|
|
3589
3585
|
.ocpv2-env-popover {
|
|
3590
3586
|
position: absolute;
|