synabun 2.0.10 → 2.1.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 +86 -0
- package/README.md +25 -2
- package/THIRD-PARTY-LICENSES.md +22 -0
- package/bin/synabun.js +71 -24
- package/docs/whatsapp.md +2 -2
- 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 +17 -8
- package/lib/desktop-app.js +7 -1
- package/lib/external-tools.js +1 -1
- 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 +228 -0
- package/lib/virustotal.mjs +192 -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/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/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/neural-interface.d.ts +16 -10
- 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 +20 -62
- 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/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 +10 -10
- package/mcp-server/dist/tools/agents.d.ts.map +1 -1
- package/mcp-server/dist/tools/agents.js +22 -13
- 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/image-tools.d.ts +1 -1
- package/mcp-server/dist/tools/image-tools.js +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 +639 -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/codex-config-heal.ts +80 -29
- package/mcp-server/src/services/memory-judge-backfill.ts +7 -1
- package/mcp-server/src/services/neural-interface.ts +79 -20
- package/mcp-server/src/services/server-instructions.ts +27 -63
- 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/whiteboard-geometry.ts +94 -9
- package/mcp-server/src/tools/agents.ts +22 -14
- package/mcp-server/src/tools/image-tools.ts +1 -1
- package/mcp-server/src/tools/skill-tools.ts +589 -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 +3463 -200
- package/neural-interface/i18n/pt-BR.json +3411 -151
- package/neural-interface/lib/assistant-api.js +127 -28
- 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-catalog.js +6 -7
- package/neural-interface/lib/assistant-dispatch.js +871 -156
- package/neural-interface/lib/assistant-envelope.js +3 -1
- package/neural-interface/lib/assistant-persona.js +80 -11
- package/neural-interface/lib/assistant-plan-permissions.js +10 -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 +13 -8
- package/neural-interface/lib/assistant-runtime.js +56 -18
- package/neural-interface/lib/assistant-task-prompt.js +78 -14
- package/neural-interface/lib/assistant-tools.js +51 -0
- package/neural-interface/lib/backup-service.js +620 -3
- 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 +83 -0
- package/neural-interface/lib/browser-network-guard.js +284 -0
- package/neural-interface/lib/browser-policy-roots.js +64 -0
- package/neural-interface/lib/browser-tool-policy.js +186 -31
- package/neural-interface/lib/claude-agent-bridge.js +4 -2
- package/neural-interface/lib/claude-hooks-status.js +103 -0
- package/neural-interface/lib/claude-temporary.js +5 -11
- package/neural-interface/lib/cli-install.js +18 -138
- package/neural-interface/lib/cli-resolver.js +4 -1
- package/neural-interface/lib/cli-update-planner.js +32 -31
- package/neural-interface/lib/cloudflared/tunnel.js +42 -2
- package/neural-interface/lib/codex-mcp-approvals.js +11 -0
- package/neural-interface/lib/codex-worker-app-server.js +172 -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/exec-loop-command.js +4 -8
- 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 +0 -29
- package/neural-interface/lib/mcp-external-servers.js +323 -0
- package/neural-interface/lib/{mcp-profile-refresh-coordinator.js → mcp-tools-refresh-coordinator.js} +4 -4
- package/neural-interface/lib/morelogin.js +30 -0
- package/neural-interface/lib/native-loop-providers.js +547 -47
- package/neural-interface/lib/native-loop-runtime.js +268 -41
- 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 +44 -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/peer-identity.js +763 -0
- package/neural-interface/lib/request-gate.js +17 -2
- package/neural-interface/lib/rulesets/api.js +1 -1
- package/neural-interface/lib/rulesets/fs-safe.js +1 -1
- package/neural-interface/lib/rulesets/installer.js +92 -27
- package/neural-interface/lib/rulesets/json-edit.js +1 -1
- package/neural-interface/lib/session-cache-builder.js +17 -30
- 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 +294 -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 +267 -0
- package/neural-interface/lib/skills/creation.js +843 -0
- package/neural-interface/lib/skills/deploy.js +564 -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 +214 -0
- package/neural-interface/lib/skills/eval-confinement.js +397 -0
- package/neural-interface/lib/skills/eval-sandbox.js +280 -0
- package/neural-interface/lib/skills/eval-trace.js +119 -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 +200 -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 +387 -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 +262 -0
- package/neural-interface/lib/skills/runtime-checks.js +355 -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 +522 -0
- package/neural-interface/lib/skills/telemetry.js +113 -0
- package/neural-interface/lib/sqlite-integrity-worker.js +22 -0
- package/neural-interface/lib/tool-lists.js +124 -0
- package/neural-interface/lib/whatsapp/bridge.js +6 -3
- package/neural-interface/lib/worker-confinement.js +1192 -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-relay-ports.js +227 -0
- package/neural-interface/lib/worker-resume.js +229 -0
- package/neural-interface/lib/worker-sandbox.js +299 -0
- package/neural-interface/package-lock.json +18 -12
- package/neural-interface/package.json +2 -2
- package/neural-interface/public/index.html +3 -1
- package/neural-interface/public/index2d.html +19 -11
- package/neural-interface/public/onboarding.html +2 -2
- package/neural-interface/public/shared/account-menu.js +8 -5
- package/neural-interface/public/shared/agent-runtime-options.js +35 -19
- 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 +33 -2
- 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 +49 -35
- package/neural-interface/public/shared/assistant/asst-control.js +157 -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-limit-dock.js +40 -0
- package/neural-interface/public/shared/assistant/asst-limit-wait.js +294 -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 +106 -11
- package/neural-interface/public/shared/assistant/asst-rack-styles.js +66 -49
- package/neural-interface/public/shared/assistant/asst-render.js +401 -77
- package/neural-interface/public/shared/assistant/asst-route.js +83 -12
- package/neural-interface/public/shared/assistant/asst-scenes.js +2 -0
- package/neural-interface/public/shared/assistant/asst-sidepanel.js +67 -4
- package/neural-interface/public/shared/assistant/asst-slash.js +9 -7
- package/neural-interface/public/shared/assistant/asst-state.js +11 -15
- package/neural-interface/public/shared/assistant/asst-stop.js +127 -0
- package/neural-interface/public/shared/assistant/asst-styles.js +59 -21
- package/neural-interface/public/shared/assistant/asst-tool-kinds.js +156 -16
- 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 +8 -7
- package/neural-interface/public/shared/cdx/cdx-panel.js +45 -149
- package/neural-interface/public/shared/cdx/cdx-protocol.js +28 -1
- package/neural-interface/public/shared/cdx/cdx-render.js +47 -29
- package/neural-interface/public/shared/cdx/cdx-requests.js +3 -3
- package/neural-interface/public/shared/cdx/cdx-skill-hints.js +54 -0
- package/neural-interface/public/shared/cdx/cdx-styles.js +11 -3
- package/neural-interface/public/shared/cdx/cdx-tabs.js +52 -39
- package/neural-interface/public/shared/cdx/cdx-ws.js +0 -1
- package/neural-interface/public/shared/cli-install-view.js +4 -8
- package/neural-interface/public/shared/cli-status.js +2 -2
- package/neural-interface/public/shared/constants.js +2 -2
- 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 +366 -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/crash-notice-view.js +168 -0
- package/neural-interface/public/shared/desktop-update-view.js +20 -0
- package/neural-interface/public/shared/editor/editor-panel-logic.js +2 -2
- package/neural-interface/public/shared/html-shell.js +9 -11
- 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 +47 -252
- 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-render.js +6 -21
- 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 +0 -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 +14 -47
- package/neural-interface/public/shared/page-session.js +96 -0
- 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-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/skills/ss-args.js +96 -0
- package/neural-interface/public/shared/skills/ss-creation.js +219 -0
- package/neural-interface/public/shared/skills/ss-dialog.js +130 -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 +141 -0
- package/neural-interface/public/shared/skills/ss-presets.js +117 -0
- package/neural-interface/public/shared/skills/ss-profiles.js +475 -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 +236 -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 +229 -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-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 +279 -0
- package/neural-interface/public/shared/skills/studio/sx-install.js +296 -0
- package/neural-interface/public/shared/skills/studio/sx-library-view.js +639 -0
- package/neural-interface/public/shared/skills/studio/sx-library.js +475 -0
- package/neural-interface/public/shared/skills/studio/sx-main.js +681 -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 +248 -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 +425 -0
- package/neural-interface/public/shared/styleguide/sg-panel.js +4 -2
- package/neural-interface/public/shared/styles.css +1525 -1779
- package/neural-interface/public/shared/synabun-mascot.js +1115 -9
- 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/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-automation-studio.js +91 -128
- package/neural-interface/public/shared/ui-claude-panel.js +77 -5
- 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-image-gallery.js +50 -47
- package/neural-interface/public/shared/ui-keybinds.js +26 -1
- package/neural-interface/public/shared/ui-menubar.js +8 -18
- package/neural-interface/public/shared/ui-native-loop-router-state.js +5 -0
- package/neural-interface/public/shared/ui-native-loop-router.js +7 -1
- package/neural-interface/public/shared/ui-navbar.js +4 -24
- package/neural-interface/public/shared/ui-panels.js +96 -65
- package/neural-interface/public/shared/ui-schedules-studio.js +507 -423
- package/neural-interface/public/shared/ui-sessions.js +5 -3
- package/neural-interface/public/shared/ui-settings.js +594 -462
- package/neural-interface/public/shared/ui-sidepanel-sessions.js +1 -1
- package/neural-interface/public/shared/ui-sidepanel-state.js +23 -12
- package/neural-interface/public/shared/ui-sidepanel-windows.js +16 -11
- 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 +124 -180
- package/neural-interface/public/shared/ui-tool-updates.js +3 -1
- package/neural-interface/public/shared/ui-tooltip.js +10 -5
- 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 +311 -58
- package/neural-interface/public/shared/ui-worker-end.js +4 -0
- 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 +1 -1
- 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-restart.js +12 -0
- package/neural-interface/public/sidepanel-session.html +1 -1
- 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 +3934 -2454
- package/neural-interface/templates/rulesets/core.md +1 -1
- package/neural-interface/templates/rulesets/legacy-hashes.json +18 -0
- package/neural-interface/templates/rulesets/manifest.json +8 -8
- package/npm-shrinkwrap.json +18 -12
- package/package.json +16 -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 +4 -4
- 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
|
@@ -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
|
|
|
@@ -3564,27 +3564,6 @@ const PARITY_CSS = `
|
|
|
3564
3564
|
.ocpv2-changes-deleted { color: rgba(220,140,140,0.82); }
|
|
3565
3565
|
.ocpv2-changes-file .ocpv2-tool-output { max-height: 320px; }
|
|
3566
3566
|
|
|
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
3567
|
/* ── Environment popover ("Manage" in Context settings), under the header ── */
|
|
3589
3568
|
.ocpv2-env-popover {
|
|
3590
3569
|
position: absolute;
|
|
@@ -16,12 +16,12 @@ export function readOpenCodeSessionLink(event = {}) {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export function
|
|
19
|
+
export function bindOpenCodeChildSessionTools({
|
|
20
20
|
eventType,
|
|
21
21
|
event,
|
|
22
22
|
sourceRuntime,
|
|
23
23
|
sessionToRuntime,
|
|
24
|
-
|
|
24
|
+
sessionTools,
|
|
25
25
|
runtimes,
|
|
26
26
|
}) {
|
|
27
27
|
if (!CHILD_LINK_EVENT_TYPES.has(eventType)) return { bound: false, reason: 'event-type' };
|
|
@@ -41,10 +41,10 @@ export function bindOpenCodeChildSessionProfile({
|
|
|
41
41
|
runtimes?.get(previousRuntimeId)?.sessions?.delete(childSessionId);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
const
|
|
44
|
+
const tools = sourceRuntime.tools || sessionTools?.get(parentSessionId) || null;
|
|
45
45
|
sessionToRuntime.set(childSessionId, sourceRuntimeId);
|
|
46
|
-
if (
|
|
47
|
-
else
|
|
46
|
+
if (tools) sessionTools.set(childSessionId, tools);
|
|
47
|
+
else sessionTools.delete(childSessionId);
|
|
48
48
|
sourceRuntime.sessions?.add(childSessionId);
|
|
49
49
|
|
|
50
50
|
return {
|
|
@@ -52,27 +52,27 @@ export function bindOpenCodeChildSessionProfile({
|
|
|
52
52
|
childSessionId,
|
|
53
53
|
parentSessionId,
|
|
54
54
|
runtimeId: sourceRuntimeId,
|
|
55
|
-
|
|
55
|
+
tools,
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
|
-
* The MCP
|
|
60
|
+
* The MCP tools a sub-agent panel starts with: its parent's. The primary
|
|
61
61
|
* panel's store speaks for the parent only while it is bound to that parent
|
|
62
|
-
* (`parentSessionId`): after a switch its
|
|
63
|
-
* then the parent's saved choice (`
|
|
62
|
+
* (`parentSessionId`): after a switch its tools is another session's, and
|
|
63
|
+
* then the parent's saved choice (`savedTools(parentSessionId)`) or what the
|
|
64
64
|
* child session itself carries is used. Without `parentSessionId` the parent
|
|
65
65
|
* store is trusted as before.
|
|
66
66
|
*/
|
|
67
|
-
export function
|
|
67
|
+
export function inheritChildPanelTools(childStore, parentStore, childInfo = null, { parentSessionId, savedTools } = {}) {
|
|
68
68
|
const parentState = parentStore?.getState?.() || null;
|
|
69
69
|
const parentIsBound = !parentSessionId || parentState?.sessionId === parentSessionId;
|
|
70
|
-
const
|
|
70
|
+
const parentTools = parentIsBound ? (parentState?.tools || null) : null;
|
|
71
71
|
let saved = null;
|
|
72
|
-
if (!
|
|
73
|
-
try { saved =
|
|
72
|
+
if (!parentTools && parentSessionId && typeof savedTools === 'function') {
|
|
73
|
+
try { saved = savedTools(parentSessionId) || null; } catch { saved = null; }
|
|
74
74
|
}
|
|
75
|
-
const
|
|
76
|
-
if (
|
|
77
|
-
return
|
|
75
|
+
const tools = parentTools || saved || childInfo?.tools || null;
|
|
76
|
+
if (tools) childStore?.setTools?.(tools);
|
|
77
|
+
return tools;
|
|
78
78
|
}
|