synabun 2.4.1 → 2.4.3
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 +50 -0
- package/README.md +1 -1
- package/docs/browser-extension-bridge.md +46 -6
- package/lib/data-home-files.js +4 -2
- package/lib/first-launch-protection.js +8 -2
- package/lib/release-npm-ci.mjs +23 -1
- package/lib/update-snapshot.js +11 -4
- package/mcp-server/dist/http.d.ts.map +1 -1
- package/mcp-server/dist/http.js +25 -2
- package/mcp-server/dist/http.js.map +1 -1
- package/mcp-server/dist/index.d.ts.map +1 -1
- package/mcp-server/dist/index.js +62 -17
- package/mcp-server/dist/index.js.map +1 -1
- package/mcp-server/dist/services/browser-bench.d.ts +22 -22
- package/mcp-server/dist/services/memory-maintenance.d.ts +1 -0
- package/mcp-server/dist/services/memory-maintenance.d.ts.map +1 -1
- package/mcp-server/dist/services/memory-maintenance.js +34 -45
- package/mcp-server/dist/services/memory-maintenance.js.map +1 -1
- package/mcp-server/dist/services/memory-migration-copy.d.ts +144 -0
- package/mcp-server/dist/services/memory-migration-copy.d.ts.map +1 -0
- package/mcp-server/dist/services/memory-migration-copy.js +467 -0
- package/mcp-server/dist/services/memory-migration-copy.js.map +1 -0
- package/mcp-server/dist/services/memory-migration-worker.d.ts +2 -0
- package/mcp-server/dist/services/memory-migration-worker.d.ts.map +1 -0
- package/mcp-server/dist/services/memory-migration-worker.js +60 -0
- package/mcp-server/dist/services/memory-migration-worker.js.map +1 -0
- package/mcp-server/dist/services/memory-retrieval.d.ts +4 -0
- package/mcp-server/dist/services/memory-retrieval.d.ts.map +1 -1
- package/mcp-server/dist/services/memory-retrieval.js +188 -40
- package/mcp-server/dist/services/memory-retrieval.js.map +1 -1
- package/mcp-server/dist/services/memory-schema.d.ts +58 -2
- package/mcp-server/dist/services/memory-schema.d.ts.map +1 -1
- package/mcp-server/dist/services/memory-schema.js +190 -13
- package/mcp-server/dist/services/memory-schema.js.map +1 -1
- package/mcp-server/dist/services/memory-sessions.d.ts +19 -1
- package/mcp-server/dist/services/memory-sessions.d.ts.map +1 -1
- package/mcp-server/dist/services/memory-sessions.js +56 -20
- package/mcp-server/dist/services/memory-sessions.js.map +1 -1
- package/mcp-server/dist/services/memory-verification.d.ts.map +1 -1
- package/mcp-server/dist/services/memory-verification.js +8 -5
- package/mcp-server/dist/services/memory-verification.js.map +1 -1
- package/mcp-server/dist/services/neural-interface.d.ts +5 -0
- package/mcp-server/dist/services/neural-interface.d.ts.map +1 -1
- package/mcp-server/dist/services/neural-interface.js +19 -2
- package/mcp-server/dist/services/neural-interface.js.map +1 -1
- package/mcp-server/dist/services/retrieval-reader-worker.d.ts +2 -0
- package/mcp-server/dist/services/retrieval-reader-worker.d.ts.map +1 -0
- package/mcp-server/dist/services/retrieval-reader-worker.js +76 -0
- package/mcp-server/dist/services/retrieval-reader-worker.js.map +1 -0
- package/mcp-server/dist/services/retrieval-reader.d.ts +38 -0
- package/mcp-server/dist/services/retrieval-reader.d.ts.map +1 -0
- package/mcp-server/dist/services/retrieval-reader.js +145 -0
- package/mcp-server/dist/services/retrieval-reader.js.map +1 -0
- package/mcp-server/dist/services/sqlite-write.d.ts +14 -0
- package/mcp-server/dist/services/sqlite-write.d.ts.map +1 -0
- package/mcp-server/dist/services/sqlite-write.js +94 -0
- package/mcp-server/dist/services/sqlite-write.js.map +1 -0
- package/mcp-server/dist/services/sqlite.d.ts +39 -0
- package/mcp-server/dist/services/sqlite.d.ts.map +1 -1
- package/mcp-server/dist/services/sqlite.js +249 -8
- package/mcp-server/dist/services/sqlite.js.map +1 -1
- package/mcp-server/dist/services/tool-catalog.d.ts +1 -1
- package/mcp-server/dist/services/typesafe-config.d.ts +7 -1
- package/mcp-server/dist/services/typesafe-config.d.ts.map +1 -1
- package/mcp-server/dist/services/typesafe-config.js +32 -10
- package/mcp-server/dist/services/typesafe-config.js.map +1 -1
- package/mcp-server/dist/services/typesafe.d.ts.map +1 -1
- package/mcp-server/dist/services/typesafe.js +9 -7
- package/mcp-server/dist/services/typesafe.js.map +1 -1
- package/mcp-server/dist/services/vector-cache.d.ts +32 -0
- package/mcp-server/dist/services/vector-cache.d.ts.map +1 -1
- package/mcp-server/dist/services/vector-cache.js +161 -8
- package/mcp-server/dist/services/vector-cache.js.map +1 -1
- package/mcp-server/dist/tools/agent-definition.d.ts +2 -2
- package/mcp-server/dist/tools/agents.d.ts +11 -7
- package/mcp-server/dist/tools/agents.d.ts.map +1 -1
- package/mcp-server/dist/tools/agents.js +27 -9
- package/mcp-server/dist/tools/agents.js.map +1 -1
- package/mcp-server/dist/tools/browser-advanced.d.ts +1 -1
- package/mcp-server/dist/tools/browser-advanced.d.ts.map +1 -1
- package/mcp-server/dist/tools/browser-advanced.js +10 -3
- package/mcp-server/dist/tools/browser-advanced.js.map +1 -1
- package/mcp-server/dist/tools/browser-extension-setup.d.ts +5 -0
- package/mcp-server/dist/tools/browser-extension-setup.d.ts.map +1 -0
- package/mcp-server/dist/tools/browser-extension-setup.js +29 -0
- package/mcp-server/dist/tools/browser-extension-setup.js.map +1 -0
- package/mcp-server/dist/tools/browser-interact.d.ts.map +1 -1
- package/mcp-server/dist/tools/browser-interact.js +6 -1
- package/mcp-server/dist/tools/browser-interact.js.map +1 -1
- package/mcp-server/dist/tools/fb-groups.d.ts +2 -2
- package/mcp-server/dist/tools/skill-tools.d.ts +4 -4
- package/mcp-server/dist/tools/tool-groups.d.ts +1 -1
- package/mcp-server/package-lock.json +5 -5
- package/mcp-server/package.json +1 -1
- package/mcp-server/src/http.ts +20 -2
- package/mcp-server/src/index.ts +59 -17
- package/mcp-server/src/services/memory-maintenance.ts +31 -28
- package/mcp-server/src/services/memory-migration-copy.ts +419 -0
- package/mcp-server/src/services/memory-migration-worker.ts +55 -0
- package/mcp-server/src/services/memory-retrieval.ts +173 -32
- package/mcp-server/src/services/memory-schema.ts +194 -12
- package/mcp-server/src/services/memory-sessions.ts +54 -21
- package/mcp-server/src/services/memory-verification.ts +7 -4
- package/mcp-server/src/services/neural-interface.ts +22 -2
- package/mcp-server/src/services/retrieval-reader-worker.ts +67 -0
- package/mcp-server/src/services/retrieval-reader.ts +131 -0
- package/mcp-server/src/services/sqlite-write.ts +60 -0
- package/mcp-server/src/services/sqlite.ts +246 -8
- package/mcp-server/src/services/typesafe-config.ts +25 -6
- package/mcp-server/src/services/typesafe.ts +9 -7
- package/mcp-server/src/services/vector-cache.ts +154 -9
- package/mcp-server/src/tools/agents.ts +26 -9
- package/mcp-server/src/tools/browser-advanced.ts +10 -3
- package/mcp-server/src/tools/browser-extension-setup.ts +36 -0
- package/mcp-server/src/tools/browser-interact.ts +5 -1
- package/neural-interface/i18n/en.json +313 -2
- package/neural-interface/i18n/pt-BR.json +321 -10
- package/neural-interface/lib/agents/split.js +32 -4
- package/neural-interface/lib/assistant-api.js +52 -8
- package/neural-interface/lib/assistant-brains/claude.js +2 -0
- package/neural-interface/lib/assistant-brains/opencode.js +121 -7
- package/neural-interface/lib/assistant-catalog.js +2 -2
- package/neural-interface/lib/assistant-config.js +0 -7
- package/neural-interface/lib/assistant-dispatch.js +281 -95
- package/neural-interface/lib/assistant-envelope.js +40 -0
- package/neural-interface/lib/assistant-persona.js +16 -4
- package/neural-interface/lib/assistant-pricing.js +65 -14
- package/neural-interface/lib/assistant-router.js +131 -47
- package/neural-interface/lib/assistant-run-wait.js +45 -28
- package/neural-interface/lib/assistant-runtime.js +133 -42
- package/neural-interface/lib/backup-contents.js +158 -0
- package/neural-interface/lib/backup-crypto-io.js +330 -0
- package/neural-interface/lib/backup-crypto-worker.js +130 -0
- package/neural-interface/lib/backup-crypto.js +525 -0
- package/neural-interface/lib/backup-download.js +268 -0
- package/neural-interface/lib/backup-encryption.js +318 -0
- package/neural-interface/lib/backup-groups.js +287 -0
- package/neural-interface/lib/backup-restore-session.js +176 -0
- package/neural-interface/lib/backup-restore-stage.js +60 -0
- package/neural-interface/lib/backup-service.js +788 -233
- package/neural-interface/lib/backup-zip-reader.js +30 -18
- package/neural-interface/lib/backup-zip-writer.js +34 -10
- package/neural-interface/lib/browser-extension-adapter.js +89 -15
- package/neural-interface/lib/browser-extension-archive.js +149 -0
- package/neural-interface/lib/browser-extension-bridge.js +24 -10
- package/neural-interface/lib/browser-extension-folder.js +596 -76
- package/neural-interface/lib/browser-extension-package.js +200 -0
- package/neural-interface/lib/browser-extension-pin.js +84 -0
- package/neural-interface/lib/browser-extension-pin.json +33 -0
- package/{browser-extension/protocol.js → neural-interface/lib/browser-extension-protocol.js} +91 -6
- package/neural-interface/lib/browser-extension-setup.js +105 -18
- package/neural-interface/lib/claude-agent-bridge.js +1 -0
- package/neural-interface/lib/claude-session-cleanup.js +5 -1
- package/neural-interface/lib/cli-install.js +23 -3
- package/neural-interface/lib/cli-update-planner.js +171 -9
- package/neural-interface/lib/client-diagnostics.js +42 -0
- package/neural-interface/lib/confined-fs.js +7 -2
- package/neural-interface/lib/coordination/README.md +8 -2
- package/neural-interface/lib/coordination/contract.js +161 -0
- package/neural-interface/lib/coordination/database.js +999 -0
- package/neural-interface/lib/coordination/operations.js +436 -0
- package/neural-interface/lib/coordination/service.js +68 -537
- package/neural-interface/lib/coordination/storage-worker.js +101 -0
- package/neural-interface/lib/coordination/store.js +219 -1111
- package/neural-interface/lib/db.js +70 -32
- package/neural-interface/lib/health-count.js +37 -0
- package/neural-interface/lib/loop-stall.js +139 -0
- package/neural-interface/lib/maritaca/client.js +2 -2
- package/neural-interface/lib/maritaca/models.js +12 -17
- package/neural-interface/lib/maritaca/opencode.js +4 -2
- package/neural-interface/lib/memory-api.js +9 -1
- package/neural-interface/lib/memory-session-capture.js +42 -10
- package/neural-interface/lib/memory-store-gate.js +313 -0
- package/neural-interface/lib/memory-store-migrate.js +65 -0
- package/neural-interface/lib/memory-timers.js +7 -7
- package/neural-interface/lib/native-loop-providers.js +23 -17
- package/neural-interface/lib/native-loop-runtime.js +48 -9
- package/neural-interface/lib/opencode-build-preflight.js +18 -1
- package/neural-interface/lib/opencode-native-boundary.js +69 -8
- package/neural-interface/lib/opencode-provider-view.js +14 -3
- package/neural-interface/lib/opencode-shell-read.js +107 -0
- package/neural-interface/lib/opencode-stop-failures.js +40 -0
- package/neural-interface/lib/opencode-turn-release.js +173 -0
- package/neural-interface/lib/opencode-v2-client.js +4 -1
- package/neural-interface/lib/opencode-v2-ws-requests.js +65 -1
- package/neural-interface/lib/opencode2-client.js +343 -7
- package/neural-interface/lib/opencode2-translate.js +161 -4
- package/neural-interface/lib/recall-impact.js +122 -0
- package/neural-interface/lib/scratch-evidence.js +420 -0
- package/neural-interface/lib/scratch-process-guard.js +139 -0
- package/neural-interface/lib/scratch-references.js +279 -0
- package/neural-interface/lib/scratch-retention-core.js +385 -0
- package/neural-interface/lib/scratch-retention-worker.js +37 -0
- package/neural-interface/lib/scratch-retention.js +151 -0
- package/neural-interface/lib/session-cache-builder.js +31 -43
- package/neural-interface/lib/session-cache-worker.js +157 -0
- package/neural-interface/lib/session-indexer.js +28 -21
- package/neural-interface/lib/session-search-index.js +85 -0
- package/neural-interface/lib/skills/creation.js +1 -1
- package/neural-interface/lib/sqlite-integrity-worker.js +3 -1
- package/neural-interface/lib/style-guide/store.js +43 -3
- package/neural-interface/lib/system-restore.js +50 -0
- package/neural-interface/lib/teams/api.js +15 -6
- package/neural-interface/lib/teams/claims.js +67 -31
- package/neural-interface/lib/teams/index.js +7 -7
- package/neural-interface/lib/teams/integration.js +40 -40
- package/neural-interface/lib/teams/landing.js +6 -6
- package/neural-interface/lib/teams/recovery.js +24 -23
- package/neural-interface/lib/teams/scheduler.js +194 -95
- package/neural-interface/lib/teams/state.js +14 -14
- package/neural-interface/lib/teams/worktrees.js +27 -27
- package/neural-interface/lib/terminal-token-redaction.js +83 -0
- package/neural-interface/lib/whatsapp/bridge.js +54 -7
- package/neural-interface/lib/worker-confinement.js +47 -2
- package/neural-interface/lib/worker-mcp-channel.js +2 -0
- package/neural-interface/lib/worker-resume.js +5 -0
- package/neural-interface/lib/worker-stop.js +86 -0
- package/neural-interface/package-lock.json +5 -5
- package/neural-interface/package.json +1 -1
- package/neural-interface/public/extension-setup.html +5 -2
- package/neural-interface/public/index.html +233 -24
- package/neural-interface/public/onboarding.html +259 -34
- package/neural-interface/public/shared/agents/studio/ax-library.js +0 -6
- package/neural-interface/public/shared/agents/studio/ax-main.js +14 -7
- package/neural-interface/public/shared/agy/agy-options.js +11 -0
- package/neural-interface/public/shared/agy/agy-panel.js +67 -20
- package/neural-interface/public/shared/agy/agy-styles.js +14 -12
- package/neural-interface/public/shared/agy/agy-tabs-logic.js +4 -1
- package/neural-interface/public/shared/api.js +1 -1
- package/neural-interface/public/shared/assistant/asst-api.js +28 -3
- package/neural-interface/public/shared/assistant/asst-brain-picker.js +13 -6
- package/neural-interface/public/shared/assistant/asst-control.js +2 -0
- package/neural-interface/public/shared/assistant/asst-motion-gate.js +78 -4
- package/neural-interface/public/shared/assistant/asst-panel.js +87 -3
- package/neural-interface/public/shared/assistant/asst-rack-styles.js +27 -0
- package/neural-interface/public/shared/assistant/asst-render.js +243 -44
- package/neural-interface/public/shared/assistant/asst-route.js +100 -21
- package/neural-interface/public/shared/assistant/asst-routes-editor.js +1 -1
- package/neural-interface/public/shared/assistant/asst-shell-logic.js +200 -0
- package/neural-interface/public/shared/assistant/asst-shell.js +111 -0
- package/neural-interface/public/shared/assistant/asst-sidepanel.js +4 -2
- package/neural-interface/public/shared/assistant/asst-state.js +11 -0
- package/neural-interface/public/shared/assistant/asst-styles.js +11 -23
- package/neural-interface/public/shared/assistant/route-identity.js +2 -1
- package/neural-interface/public/shared/cdx/cdx-render.js +9 -0
- package/neural-interface/public/shared/cdx/cdx-settings.js +3 -1
- package/neural-interface/public/shared/cdx/cdx-styles.js +6 -0
- package/neural-interface/public/shared/cdx/cdx-tabs.js +54 -9
- package/neural-interface/public/shared/client-diagnostics.js +94 -0
- package/neural-interface/public/shared/cp/cp-markdown.js +7 -2
- package/neural-interface/public/shared/cp/cp-styles.js +1 -1
- package/neural-interface/public/shared/effort-i18n.js +118 -0
- package/neural-interface/public/shared/extension-setup/es-page.js +10 -4
- package/neural-interface/public/shared/extension-setup/es-view.js +25 -10
- package/neural-interface/public/shared/html-shell.js +4 -52
- package/neural-interface/public/shared/loading-diagnostic-entry.js +64 -0
- package/neural-interface/public/shared/memory-store-wait.js +52 -0
- package/neural-interface/public/shared/morelogin-profile-field.js +1 -1
- package/neural-interface/public/shared/mtc/mtc-logic.js +2 -1
- package/neural-interface/public/shared/mtc/mtc-panel.js +25 -3
- package/neural-interface/public/shared/mtc/mtc-styles.js +13 -12
- package/neural-interface/public/shared/ocp-v2/ocp-v2-childpanel.js +7 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-events.js +5 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-location-logic.js +109 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-manager.js +1 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-modelpicker.js +8 -1
- package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +152 -8
- package/neural-interface/public/shared/ocp-v2/ocp-v2-rehydrate.js +7 -1
- package/neural-interface/public/shared/ocp-v2/ocp-v2-render.js +53 -4
- package/neural-interface/public/shared/ocp-v2/ocp-v2-send.js +52 -6
- package/neural-interface/public/shared/ocp-v2/ocp-v2-session-actions.js +22 -2
- package/neural-interface/public/shared/ocp-v2/ocp-v2-shell-block.js +165 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-shell-logic.js +346 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-shell.js +108 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-state.js +49 -3
- package/neural-interface/public/shared/ocp-v2/ocp-v2-styles.js +67 -93
- package/neural-interface/public/shared/ocp-v2/ocp-v2-tools-logic.js +20 -5
- package/neural-interface/public/shared/ocp-v2/ocp-v2-tools.js +7 -1
- package/neural-interface/public/shared/ocp-v2/ocp-v2-variantpicker.js +17 -6
- package/neural-interface/public/shared/ocp-v2/ocp-v2-ws.js +7 -2
- package/neural-interface/public/shared/output-format.js +294 -0
- package/neural-interface/public/shared/provider-icons.js +6 -0
- package/neural-interface/public/shared/schedules-view.js +2 -1
- package/neural-interface/public/shared/server-presence.js +77 -0
- package/neural-interface/public/shared/settings/settings-backup-contents.js +241 -0
- package/neural-interface/public/shared/settings/settings-backup-download.js +298 -0
- package/neural-interface/public/shared/settings/settings-backup-encryption-pane.js +335 -0
- package/neural-interface/public/shared/settings/settings-backup-encryption.js +545 -0
- package/neural-interface/public/shared/settings/settings-browser-extension.js +54 -12
- package/neural-interface/public/shared/settings/settings-ia.js +1 -1
- package/neural-interface/public/shared/shell-stop-view.js +83 -0
- package/neural-interface/public/shared/skills/studio/sx-geometry.js +12 -3
- package/neural-interface/public/shared/skills/studio/sx-main.js +14 -7
- package/neural-interface/public/shared/studio-attention.js +6 -0
- package/neural-interface/public/shared/styles.css +341 -437
- package/neural-interface/public/shared/tour/tour-actor.js +14 -3
- package/neural-interface/public/shared/transcript-rows.js +28 -3
- package/neural-interface/public/shared/tray-auto-close.js +49 -6
- package/neural-interface/public/shared/ui-agents.js +1 -2
- package/neural-interface/public/shared/ui-automation-studio.js +168 -108
- package/neural-interface/public/shared/ui-claude-panel.js +62 -65
- package/neural-interface/public/shared/ui-loading.js +124 -17
- package/neural-interface/public/shared/ui-native-loop-router.js +52 -0
- package/neural-interface/public/shared/ui-navbar.js +2 -1
- package/neural-interface/public/shared/ui-output.js +533 -0
- package/neural-interface/public/shared/ui-schedules-studio.js +165 -128
- package/neural-interface/public/shared/ui-scroll-follow.js +101 -6
- package/neural-interface/public/shared/ui-sessions.js +2 -2
- package/neural-interface/public/shared/ui-settings-entry.js +18 -0
- package/neural-interface/public/shared/ui-settings.js +224 -65
- package/neural-interface/public/shared/ui-sidepanel-tray.js +3 -2
- package/neural-interface/public/shared/ui-tooltip.js +16 -0
- package/neural-interface/public/shared/ui-tutorial.js +5 -6
- package/neural-interface/public/shared/ui-worker-end.js +27 -8
- package/neural-interface/public/shared/worker-end.js +9 -4
- package/neural-interface/public/variant/2d/main.js +5 -0
- package/neural-interface/public/variant/3d/app.js +10 -0
- package/neural-interface/public/variant/3d/main.js +5 -1
- package/neural-interface/scripts/scratch-retention.mjs +20 -0
- package/neural-interface/server.js +725 -173
- package/npm-shrinkwrap.json +5 -5
- package/package.json +1 -2
- package/scripts/restore-data-home-from-backup.mjs +175 -8
- package/setup.js +18 -4
- package/browser-extension/content.js +0 -189
- package/browser-extension/engine.js +0 -508
- package/browser-extension/icons/icon-128.png +0 -0
- package/browser-extension/icons/icon-16.png +0 -0
- package/browser-extension/icons/icon-32.png +0 -0
- package/browser-extension/icons/icon-48.png +0 -0
- package/browser-extension/icons/status-off-16.png +0 -0
- package/browser-extension/icons/status-off-32.png +0 -0
- package/browser-extension/icons/status-off-48.png +0 -0
- package/browser-extension/icons/status-on-16.png +0 -0
- package/browser-extension/icons/status-on-32.png +0 -0
- package/browser-extension/icons/status-on-48.png +0 -0
- package/browser-extension/manifest.json +0 -56
- package/browser-extension/popup-strings.js +0 -250
- package/browser-extension/popup-view.js +0 -151
- package/browser-extension/popup.css +0 -166
- package/browser-extension/popup.html +0 -108
- package/browser-extension/popup.js +0 -359
- package/browser-extension/service-worker.js +0 -275
- package/browser-extension/setup-content.js +0 -36
- package/browser-extension/tokens.css +0 -326
|
@@ -29,10 +29,10 @@ function fixedText() {
|
|
|
29
29
|
put($('es-copy-url'), tx('copyAddress')); put($('es-copy-folder'), tx('copyFolder'));
|
|
30
30
|
put($('es-folder-label'), tx('folderLabel'));
|
|
31
31
|
put($('es-reveal'), tx(revealKey(navigator.userAgentData?.platform || navigator.platform || '')));
|
|
32
|
-
put($('es-alternatives-title'), tx('alternativesTitle'));
|
|
32
|
+
put($('es-alternatives-title'), tx('alternativesTitle'));
|
|
33
33
|
put($('es-back'), tx('backToApp')); put($('es-pin'), tx('pinTip'));
|
|
34
34
|
put($('es-full-title'), tx('fullTitle')); put($('es-full-help'), tx('fullHelp'));
|
|
35
|
-
put($('es-trouble-title'), tx('needHelp')); put($('es-trouble-help'), tx('helpText')); put($('es-policy-help'), tx('policyText'));
|
|
35
|
+
put($('es-trouble-title'), tx('needHelp')); put($('es-trouble-help'), tx('helpText')); put($('es-moved-help'), tx('movedText')); put($('es-policy-help'), tx('policyText'));
|
|
36
36
|
}
|
|
37
37
|
function render() {
|
|
38
38
|
const view = setupView(status, { extensionVersion: extensionSeen(), pairAnswer: pairAnswer() });
|
|
@@ -45,6 +45,7 @@ function render() {
|
|
|
45
45
|
$('es-status').dataset.tone = view.tone || 'idle';
|
|
46
46
|
put($('es-status-title'), tx(view.statusTitle));
|
|
47
47
|
$('es-help').hidden = !view.help; put($('es-help'), view.help ? tx(view.help) : '');
|
|
48
|
+
$('es-progress').hidden = !view.progress; put($('es-progress'), view.progress ? tx('downloadProgress', view.progress) : '');
|
|
48
49
|
$('es-browser').hidden = !view.browser; put($('es-browser-name'), view.browser);
|
|
49
50
|
$('es-steps').hidden = !view.showSteps;
|
|
50
51
|
for (const step of view.steps) {
|
|
@@ -67,8 +68,8 @@ function render() {
|
|
|
67
68
|
list.append(button);
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
|
-
$('es-reload').hidden = !view.reloadNeeded; put($('es-reload'), tx('reloadNeeded', { browser: view.browser }));
|
|
71
|
-
$('es-restart').hidden = !view.restart;
|
|
71
|
+
$('es-reload').hidden = !view.reloadNeeded && !view.updateNeeded; put($('es-reload'), tx(view.updateNeeded ? 'updateNeeded' : view.reloadRepaired ? 'reloadRepaired' : 'reloadNeeded', { browser: view.browser }));
|
|
72
|
+
$('es-restart').hidden = !view.restart; put($('es-restart'), tx(view.restartLabel));
|
|
72
73
|
$('es-back').hidden = !view.back; $('es-pin').hidden = !view.pinTip;
|
|
73
74
|
// The row is hidden by the code that fills it (never found by a :has(), which every hidden toggle re-checks).
|
|
74
75
|
$('es-actions').hidden = !view.restart && !view.back;
|
|
@@ -80,6 +81,11 @@ async function poll() {
|
|
|
80
81
|
busy = true;
|
|
81
82
|
try {
|
|
82
83
|
status = await call('status');
|
|
84
|
+
// The extension's content script ran on this page, on this port: the browser runs the folder's manifest for it, so
|
|
85
|
+
// the Reload a port change asked for is done (the server keeps saying "reload" until then). Never for a repair: the
|
|
86
|
+
// copy the browser still runs would answer the same, so this page only says to confirm in SynaBun Settings (and the
|
|
87
|
+
// server ignores `seen` for it anyway).
|
|
88
|
+
if (status.reloadNeeded && !status.reloadRepaired && extensionSeen() && extensionSeen() === status.folderVersion) status = await call('seen', {});
|
|
83
89
|
if (wantsTicket(status, { extensionVersion: extensionSeen(), pairAnswer: pairAnswer(), offeredAt, tickets })) {
|
|
84
90
|
tickets++;
|
|
85
91
|
const ticket = await call('ticket', {});
|
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
// The "Connect your browser" page's decisions (public/extension-setup.html; docs/browser-extension-bridge.md →
|
|
2
2
|
// One-button setup). DOM-free and import-free: node --test loads it. The page (es-page.js) renders what this returns.
|
|
3
3
|
//
|
|
4
|
-
// Page states (data-state on <main>): the server's setup state (idle, waiting-for-extension, pairing,
|
|
5
|
-
// unsupported, error), with one page-only refinement: `extension-found` while the server still waits but the
|
|
4
|
+
// Page states (data-state on <main>): the server's setup state (idle, downloading, waiting-for-extension, pairing,
|
|
5
|
+
// connected, unsupported, error), with one page-only refinement: `extension-found` while the server still waits but the
|
|
6
6
|
// extension's content script has announced itself on this page (it then gets the one-time token and pairs).
|
|
7
7
|
|
|
8
8
|
/** The server's setup states, and the page's own. */
|
|
9
|
-
export const SETUP_STATES = Object.freeze(['idle', 'waiting-for-extension', 'pairing', 'connected', 'unsupported', 'error']);
|
|
9
|
+
export const SETUP_STATES = Object.freeze(['idle', 'downloading', 'waiting-for-extension', 'pairing', 'connected', 'unsupported', 'error']);
|
|
10
10
|
export const PAGE_STATES = Object.freeze([...SETUP_STATES, 'extension-found']);
|
|
11
11
|
/** What the extension's service worker may answer the content script (setup-content.js writes it to data-synabun-pair). */
|
|
12
12
|
export const PAIR_ANSWERS = Object.freeze(['sent', 'started', 'ALREADY_CONNECTED', 'ALREADY_PAIRED', 'PAUSED', 'BUSY', 'NOT_OWNED', 'INVALID_MESSAGE', 'REFUSED', 'EXTENSION_UNAVAILABLE']);
|
|
13
13
|
/** Error codes the page has a sentence for (browserExtension.setup.error<CODE>); any other is `error`. */
|
|
14
|
-
export const SETUP_ERRORS = Object.freeze(['SETUP_EXPIRED', 'EXTENSION_FOLDER_FAILED', 'OPEN_FAILED', 'SETUP_NOT_ACTIVE', 'SETUP_TICKETS_USED', 'PAGE_SECRET_REQUIRED', 'PEER_UNAVAILABLE']);
|
|
14
|
+
export const SETUP_ERRORS = Object.freeze(['SETUP_EXPIRED', 'EXTENSION_FOLDER_FAILED', 'EXTENSION_FOLDER_UNSAFE','EXTENSION_DOWNLOAD_OFFLINE', 'EXTENSION_DOWNLOAD_UNAVAILABLE', 'EXTENSION_VERIFY_FAILED', 'OPEN_FAILED', 'SETUP_NOT_ACTIVE', 'SETUP_TICKETS_USED', 'PAGE_SECRET_REQUIRED', 'PEER_UNAVAILABLE']);
|
|
15
|
+
/** The errors of the extension's download (the package was not fetched or did not verify): the page offers to try again. */
|
|
16
|
+
export const DOWNLOAD_ERRORS = Object.freeze(['EXTENSION_DOWNLOAD_OFFLINE', 'EXTENSION_DOWNLOAD_UNAVAILABLE', 'EXTENSION_VERIFY_FAILED']);
|
|
15
17
|
/** Answers after which the page asks for a fresh ticket (a new token) once its wait has passed. */
|
|
16
18
|
const RETRY_AFTER = Object.freeze({ ALREADY_PAIRED: 8000, BUSY: 2500, REFUSED: 5000, EXTENSION_UNAVAILABLE: 5000, started: 20000 });
|
|
17
19
|
|
|
18
20
|
/**
|
|
19
21
|
* The page's view of a status (GET /api/browser/extension/setup/status) and what the page saw of the extension:
|
|
20
22
|
* `extensionVersion` (data-synabun-extension, '' when absent) and `pairAnswer` (data-synabun-pair).
|
|
21
|
-
* Returns { state, title, lead, steps, browser, extensionsUrl, folder, alternatives, live, tone, reloadNeeded,
|
|
23
|
+
* Returns { state, title, lead, steps, browser, extensionsUrl, folder, alternatives, live, tone, reloadNeeded, reloadRepaired, updateNeeded,
|
|
24
|
+
* progress, restart, restartLabel }.
|
|
22
25
|
* Strings are i18n keys under browserExtension.setup (the page translates them); `params` fill their {placeholders}.
|
|
23
26
|
*/
|
|
24
27
|
export function setupView(status = {}, { extensionVersion = '', pairAnswer = '' } = {}) {
|
|
@@ -41,25 +44,37 @@ export function setupView(status = {}, { extensionVersion = '', pairAnswer = ''
|
|
|
41
44
|
// "Open in X instead": the installed supported browsers other than the one this setup uses.
|
|
42
45
|
const alternatives = (status.installedBrowsers || []).filter(b => b?.supported && b.id !== browser?.id).map(b => ({ id: b.id, name: b.name }));
|
|
43
46
|
const live = {
|
|
44
|
-
idle: 'liveIdle', 'waiting-for-extension': 'liveWaiting', 'extension-found': PAIR_ANSWERS.includes(pairAnswer) && pairAnswer !== 'sent' && pairAnswer !== 'started' ? `answer${pairAnswer}` : 'liveFound',
|
|
47
|
+
idle: 'liveIdle', downloading: 'liveDownloading', 'waiting-for-extension': 'liveWaiting', 'extension-found': PAIR_ANSWERS.includes(pairAnswer) && pairAnswer !== 'sent' && pairAnswer !== 'started' ? `answer${pairAnswer}` : 'liveFound',
|
|
45
48
|
pairing: 'livePairing', connected: 'liveConnected', unsupported: 'liveUnsupported', error: `error${SETUP_ERRORS.includes(status.code) ? status.code : ''}`,
|
|
46
49
|
}[state];
|
|
47
50
|
const tone = state === 'connected' ? 'ok' : state === 'error' || state === 'unsupported' ? 'err' : state === 'idle' ? '' : 'warn';
|
|
48
|
-
|
|
51
|
+
// No steps while the extension is on its way: there is no folder to load yet.
|
|
52
|
+
const showSteps = !['unsupported', 'idle', 'downloading'].includes(state) && !(state === 'error' && !status.folder);
|
|
53
|
+
const downloadFailed = state === 'error' && DOWNLOAD_ERRORS.includes(status.code);
|
|
54
|
+
// The bytes so far, in whole KB (the page shows them beside the status; never in the live region, which would be read out at every poll).
|
|
55
|
+
const kb = n => Math.max(0, Math.round((Number(n) || 0) / 1024));
|
|
56
|
+
const progress = state === 'downloading' && status.download && Number(status.download.total) > 0 ? { received: kb(Math.min(status.download.received, status.download.total)), total: kb(status.download.total) } : null;
|
|
49
57
|
// The guide (the steps beside the status) while the owner installs; one result card once there is nothing to do there.
|
|
50
58
|
const layout = showSteps && state !== 'connected' ? 'guide' : 'result';
|
|
51
|
-
const statusTitle = { 'waiting-for-extension': 'waitingTitle', 'extension-found': 'foundTitle', pairing: 'pairingTitle', connected: 'titleConnected',
|
|
52
|
-
unsupported: 'titleUnsupported', idle: 'idleTitle', error: 'errorTitle' }[state];
|
|
59
|
+
const statusTitle = { downloading: 'downloadingTitle', 'waiting-for-extension': 'waitingTitle', 'extension-found': 'foundTitle', pairing: 'pairingTitle', connected: 'titleConnected',
|
|
60
|
+
unsupported: 'titleUnsupported', idle: 'idleTitle', error: downloadFailed ? 'downloadErrorTitle' : 'errorTitle' }[state];
|
|
53
61
|
return {
|
|
54
62
|
layout, statusTitle, eyebrow: name ? 'eyebrow' : '',
|
|
55
|
-
help: state === 'connected' ? 'connectedHelp' : '',
|
|
63
|
+
help: state === 'connected' ? 'connectedHelp' : state === 'downloading' ? 'downloadingHelp' : '',
|
|
64
|
+
progress,
|
|
56
65
|
state, title: state === 'connected' ? 'titleConnected' : state === 'unsupported' ? 'titleUnsupported' : 'title',
|
|
57
66
|
lead: state === 'unsupported' ? 'leadUnsupported' : 'lead', steps, browser: name, extensionsUrl,
|
|
58
67
|
folder: typeof status.folder === 'string' ? status.folder : '', alternatives, live, liveParams: { browser: name }, tone,
|
|
59
68
|
reloadNeeded: status.reloadNeeded === true,
|
|
69
|
+
// SynaBun replaced files that were not its extension: the same Reload, in the words of a repair.
|
|
70
|
+
reloadRepaired: status.reloadNeeded === true && status.reloadRepaired === true,
|
|
71
|
+
// The folder holds an older extension than this release's: SynaBun downloads the new one; a Reload comes after.
|
|
72
|
+
updateNeeded: status.updateNeeded === true && status.reloadNeeded !== true,
|
|
60
73
|
showSteps,
|
|
61
74
|
// What the page offers: start again (idle, error), back to SynaBun and the pin tip (connected).
|
|
62
75
|
restart: ['error', 'idle'].includes(state), back: state === 'connected', pinTip: state === 'connected',
|
|
76
|
+
// A download that failed is tried again by the same button, under its own words.
|
|
77
|
+
restartLabel: downloadFailed ? 'retryDownload' : 'restart',
|
|
63
78
|
// "Open in X instead" while there is still something to install here; never once pairing began.
|
|
64
79
|
showAlternatives: alternatives.length > 0 && !['pairing', 'connected'].includes(state),
|
|
65
80
|
};
|
|
@@ -97,56 +97,6 @@ export function getSharedHTML() {
|
|
|
97
97
|
<div id="app-frame-surface" aria-hidden="true"></div>
|
|
98
98
|
<div id="app-frame" aria-hidden="true"></div>
|
|
99
99
|
|
|
100
|
-
<!-- Loading Overlay -->
|
|
101
|
-
<div id="loading-overlay">
|
|
102
|
-
<div id="loading-mascot" data-state="asleep">
|
|
103
|
-
<svg viewBox="0 0 280 140" width="160" height="80" style="overflow:visible" aria-hidden="true">
|
|
104
|
-
<g class="syna-eye">
|
|
105
|
-
<g class="syna-lid" transform="translate(0,60) scale(1,0.08) translate(0,-60)">
|
|
106
|
-
<rect x="80" y="24" width="38" height="72" rx="19" fill="#ffffff"/>
|
|
107
|
-
</g>
|
|
108
|
-
</g>
|
|
109
|
-
<g class="syna-eye">
|
|
110
|
-
<g class="syna-lid" transform="translate(0,60) scale(1,0.08) translate(0,-60)">
|
|
111
|
-
<rect x="162" y="24" width="38" height="72" rx="19" fill="#ffffff"/>
|
|
112
|
-
</g>
|
|
113
|
-
</g>
|
|
114
|
-
<path d="M125,112 Q140,118 155,112" fill="none" stroke="rgba(255,255,255,0.15)" stroke-width="2.5" stroke-linecap="round"/>
|
|
115
|
-
</svg>
|
|
116
|
-
<span id="loading-zzz">z</span>
|
|
117
|
-
</div>
|
|
118
|
-
<img src="synabun.png?v=2" alt="SynaBun" class="loading-logo">
|
|
119
|
-
<div id="loading-text">${t('loading.connecting')}</div>
|
|
120
|
-
<div id="loading-sub">${t('loading.initializingNeural')}</div>
|
|
121
|
-
<div id="loading-action">
|
|
122
|
-
<button id="loading-action-btn" type="button">
|
|
123
|
-
<svg viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round"><polygon points="5 3 19 12 5 21 5 3"/></svg>
|
|
124
|
-
<span id="loading-action-label">${t('loading.startServer')}</span>
|
|
125
|
-
</button>
|
|
126
|
-
<div id="loading-action-status" role="status" aria-live="polite" aria-atomic="true"></div>
|
|
127
|
-
<div id="loading-action-elapsed" role="timer" aria-live="off"></div>
|
|
128
|
-
<div id="loading-action-hint"></div>
|
|
129
|
-
<ul id="loading-action-trail"></ul>
|
|
130
|
-
<div id="loading-action-log"></div>
|
|
131
|
-
</div>
|
|
132
|
-
<div id="loading-server-cmd">
|
|
133
|
-
<div id="loading-server-cmd-hint">${t('loading.runCommand')}</div>
|
|
134
|
-
<div id="loading-server-cmd-box">
|
|
135
|
-
<code id="loading-cmd-text">npm start</code>
|
|
136
|
-
<button id="loading-cmd-copy" title="${t('loading.copyToClipboard')}">
|
|
137
|
-
<svg viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>
|
|
138
|
-
</button>
|
|
139
|
-
</div>
|
|
140
|
-
<br>
|
|
141
|
-
<button id="loading-retry-btn" type="button">
|
|
142
|
-
<svg viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/></svg>
|
|
143
|
-
${t('loading.retryConnection')}
|
|
144
|
-
</button>
|
|
145
|
-
<div id="loading-retry-status"></div>
|
|
146
|
-
<img src="synabun.png?v=2" alt="SynaBun" style="margin-top:6px;height:32px;width:auto;filter:grayscale(0.5);opacity:0.18;">
|
|
147
|
-
</div>
|
|
148
|
-
</div>
|
|
149
|
-
|
|
150
100
|
<!-- Node Hover Tooltip -->
|
|
151
101
|
<div id="tooltip" class="glass">
|
|
152
102
|
<div id="tooltip-category"></div>
|
|
@@ -914,6 +864,8 @@ export function injectSharedHTML() {
|
|
|
914
864
|
// The workspace sits in the inset rounded frame (app-frame.js): set before the shell lands, so nothing is laid
|
|
915
865
|
// out once without it.
|
|
916
866
|
document.documentElement.classList.add(FRAMED_CLASS);
|
|
917
|
-
document.
|
|
918
|
-
|
|
867
|
+
// Once per document: a second call would duplicate every id. The loading overlay is never part of the shell: the
|
|
868
|
+
// first frame (index.html) owns it and the shell takes that one over.
|
|
869
|
+
if (!document.getElementById('app-frame')) document.body.insertAdjacentHTML('afterbegin', getSharedHTML());
|
|
870
|
+
window.synabunAdoptLoading?.(t);
|
|
919
871
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// The complete wire format. Neither a health body, a translated subtitle, a URL,
|
|
2
|
+
// nor an exception/refusal message belongs in the trail or the server log.
|
|
3
|
+
export const DIAGNOSTIC_BATCH = 20;
|
|
4
|
+
const loadingTitles = [
|
|
5
|
+
'loading.serverOffline', 'loading.connectionFailed', 'loading.health.databaseUnreachable.title',
|
|
6
|
+
'loading.health.remoteUnreachable.title', 'loading.health.authError.title', 'loading.health.connectionError.title',
|
|
7
|
+
];
|
|
8
|
+
|
|
9
|
+
const bool = value => typeof value === 'boolean';
|
|
10
|
+
const count = value => Number.isInteger(value) && value >= 1 && value <= 20;
|
|
11
|
+
const oneOf = (...values) => value => values.includes(value);
|
|
12
|
+
const states = oneOf('idle', 'launching', 'starting', 'waiting', 'stalled', 'failed', 'online', 'restarting', 'refused');
|
|
13
|
+
const moduleName = oneOf('entry', 'app');
|
|
14
|
+
const bootTag = value => typeof value === 'string' && /^(?:[0-9a-f]{8})?$/.test(value);
|
|
15
|
+
const events = {
|
|
16
|
+
'startup-shown': {},
|
|
17
|
+
'startup-status': { reason: oneOf('offline', 'loading', 'manual-retry') },
|
|
18
|
+
'boot-complete': {},
|
|
19
|
+
// The first frame's overlay handed to the app's shell (taken over, or a shell's own overlay replaced it), and the
|
|
20
|
+
// first frame's fallback ended by the app's boot.
|
|
21
|
+
'startup-adopt': { mode: oneOf('adopted', 'duplicate') },
|
|
22
|
+
'boot-cleanup': { adopted: bool, removed: bool, hidden: bool, aborted: bool },
|
|
23
|
+
'overlay-dedupe': { removed: count },
|
|
24
|
+
'overlay-error': { title: oneOf(...loadingTitles, 'other'), serverOffline: bool },
|
|
25
|
+
'overlay-reveal': { reason: oneOf('init', 'show', 'restart', 'probe') },
|
|
26
|
+
'overlay-conceal': { reason: oneOf('hide', 'recovered', 'dismissed') },
|
|
27
|
+
'hide-skipped': { state: states },
|
|
28
|
+
'bridge-created': { reason: oneOf('restart', 'offline'), state: states },
|
|
29
|
+
'bridge-stopped': { state: states },
|
|
30
|
+
'bridge-state': { state: states },
|
|
31
|
+
'bridge-probe': { result: oneOf('healthy', 'stopping', 'unhealthy', 'unreachable'), seenBoot: bootTag },
|
|
32
|
+
'restart-request': { asked: bool, announced: bool, restartShown: bool, hasBridge: bool },
|
|
33
|
+
'restart-snapshot': { asked: bool, accepted: bool, down: bool, refused: bool },
|
|
34
|
+
'recover': { seenBoot: bootTag, needsReload: bool, appWasVisible: bool, restartShown: bool, reloadPending: bool },
|
|
35
|
+
'reload-scheduled': { reason: oneOf('startup', 'restart', 'boot-changed', 'unknown-boot') },
|
|
36
|
+
'probe-miss': { reason: oneOf('unreachable', 'unhealthy', 'stopping', 'boot-changed'), confirmation: bool },
|
|
37
|
+
// Probes went unanswered and the offline screen was held back (server-presence.js): the server is only slow, or
|
|
38
|
+
// the tab is hidden and cannot tell. Then the answer that ended that row, with how long it lasted.
|
|
39
|
+
'probe-held': { reason: oneOf('slow', 'hidden'), misses: count },
|
|
40
|
+
'probe-answered': { misses: count, seconds: value => Number.isInteger(value) && value >= 0 && value <= 3600 },
|
|
41
|
+
'import-failed': { module: moduleName },
|
|
42
|
+
'import-retry': { module: moduleName },
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
function matches(object, fields) {
|
|
46
|
+
return object !== null && typeof object === 'object' && !Array.isArray(object)
|
|
47
|
+
&& Object.keys(object).length === Object.keys(fields).length
|
|
48
|
+
&& Object.entries(fields).every(([key, accepts]) => Object.hasOwn(object, key) && accepts(object[key]));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const envelope = {
|
|
52
|
+
iso: s => typeof s === 'string' && /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d{3}Z$/.test(s)
|
|
53
|
+
&& Number.isFinite(Date.parse(s)) && new Date(s).toISOString() === s,
|
|
54
|
+
pageId: s => typeof s === 'string' && /^[a-f0-9]{12}$/.test(s),
|
|
55
|
+
currentBoot: bootTag,
|
|
56
|
+
visibility: oneOf('visible', 'hidden', 'prerender'),
|
|
57
|
+
event: s => typeof s === 'string' && Object.hasOwn(events, s),
|
|
58
|
+
data: value => value !== null && typeof value === 'object',
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export function validDiagnosticEntry(entry) {
|
|
62
|
+
return matches(entry, envelope) && matches(entry.data, events[entry.event]);
|
|
63
|
+
}
|
|
64
|
+
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// SynaBun — the page while the memory database is being upgraded.
|
|
2
|
+
//
|
|
3
|
+
// /api/health answers `ok: true` with a `store` block while the store is migrating (or its upgrade failed): the server
|
|
4
|
+
// is up, so this is never the offline screen. A page that starts then waits here, says what is happening, and goes on
|
|
5
|
+
// with its normal boot when the store is back, instead of reading a 503 as "connection failed".
|
|
6
|
+
//
|
|
7
|
+
// No imports and no DOM unless `show` touches it: tests/memory-store-wait.test.mjs runs it under node.
|
|
8
|
+
|
|
9
|
+
/** What a health answer asks the page to show, or null when the store can be read. */
|
|
10
|
+
export function memoryStoreHold(health) {
|
|
11
|
+
const state = health?.store?.state;
|
|
12
|
+
if (state === 'migrating') return { state, titleKey: 'loading.memoryStore.migratingTitle', subKey: 'loading.memoryStore.migratingSub' };
|
|
13
|
+
if (state === 'failed') return { state, titleKey: 'loading.memoryStore.failedTitle', detail: String(health.store.note || '') };
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Wait until the store can be read. Resolves true when it had to wait (what was fetched meanwhile is stale), false
|
|
19
|
+
* when it did not. A health request that fails is not a verdict: the page's own presence check decides about offline.
|
|
20
|
+
* @param {object} health the answer the page already has
|
|
21
|
+
* @param {{ fetchHealth: () => Promise<object>, show: (hold: object) => void, sleep?: (ms: number) => Promise<void>, intervalMs?: number }} io
|
|
22
|
+
*/
|
|
23
|
+
export async function waitForMemoryStore(health, { fetchHealth, show, sleep = (ms) => new Promise((done) => setTimeout(done, ms)), intervalMs = 2000 }) {
|
|
24
|
+
let hold = memoryStoreHold(health);
|
|
25
|
+
if (!hold) return false;
|
|
26
|
+
let shown = '';
|
|
27
|
+
while (hold) {
|
|
28
|
+
const key = `${hold.state}\n${hold.detail || ''}`;
|
|
29
|
+
if (key !== shown) { shown = key; show(hold); }
|
|
30
|
+
await sleep(intervalMs);
|
|
31
|
+
const next = await fetchHealth().catch(() => null);
|
|
32
|
+
// No answer, or an answer without the block from a server that is restarting: keep what is shown and ask again.
|
|
33
|
+
if (next?.ok === true) hold = memoryStoreHold(next);
|
|
34
|
+
}
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** The page's side: the loading overlay says it, in the page's language. */
|
|
39
|
+
export function holdForMemoryStore(health, { fetchHealth, t, showLoadingError, document: doc = globalThis.document }) {
|
|
40
|
+
return waitForMemoryStore(health, {
|
|
41
|
+
fetchHealth,
|
|
42
|
+
show(hold) {
|
|
43
|
+
if (hold.state === 'failed') { showLoadingError(t(hold.titleKey), hold.detail, false); return; }
|
|
44
|
+
const overlay = doc?.getElementById('loading-overlay');
|
|
45
|
+
overlay?.classList.remove('error', 'server-offline');
|
|
46
|
+
const text = doc?.getElementById('loading-text');
|
|
47
|
+
const sub = doc?.getElementById('loading-sub');
|
|
48
|
+
if (text) text.textContent = t(hold.titleKey);
|
|
49
|
+
if (sub) sub.textContent = t(hold.subKey);
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
}
|
|
@@ -178,7 +178,7 @@ function fieldHTML(field) {
|
|
|
178
178
|
<div class="sched-form-stack">
|
|
179
179
|
<div class="sched-form-control">
|
|
180
180
|
${popup}
|
|
181
|
-
${refresh('sched-icon-btn')}
|
|
181
|
+
${refresh('sx-icon-btn sched-icon-btn')}
|
|
182
182
|
</div>
|
|
183
183
|
<p class="sched-help${warn ? ' sched-help--warn' : ''}" id="${esc(id)}-help"${status}>${help}</p>
|
|
184
184
|
</div>
|
|
@@ -416,7 +416,8 @@ export function usageParts(usage, costBrl, T) {
|
|
|
416
416
|
if (output) parts.push(T('usage_out', { value: fmt(output) }));
|
|
417
417
|
if (cached) parts.push(T('usage_cached', { value: fmt(cached) }));
|
|
418
418
|
}
|
|
419
|
-
// A cost of exactly 0 is a free model's answer (
|
|
419
|
+
// A cost of exactly 0 is a free model's answer (none is listed since S5-free was retired on 2026-11-18) and is
|
|
420
|
+
// shown as R$ 0,00; null is "no price known".
|
|
420
421
|
if (costBrl !== null && costBrl !== undefined && Number.isFinite(Number(costBrl)) && (Number(costBrl) > 0 || usage)) parts.push(T('costBrl', { value: formatBrl(costBrl) }));
|
|
421
422
|
return parts;
|
|
422
423
|
}
|
|
@@ -33,6 +33,7 @@ import { dropdownHTML, dropdownOf, setDropdownDisabled, setDropdownItems, wireDr
|
|
|
33
33
|
import { renderMarkdown } from '../cp/cp-markdown.js';
|
|
34
34
|
import { fetchProjects } from '../api.js';
|
|
35
35
|
import { createStickyScrollController } from '../ui-scroll-follow.js';
|
|
36
|
+
import { composerHoldsDraft, markAutoCloseKeep } from '../tray-auto-close.js';
|
|
36
37
|
|
|
37
38
|
export const PANEL_OWNER = 'maritaca-sidepanel';
|
|
38
39
|
const ICON = ICONS.mark;
|
|
@@ -368,7 +369,7 @@ async function stageFiles(files) {
|
|
|
368
369
|
}
|
|
369
370
|
saveTabs();
|
|
370
371
|
} catch (error) { showBanner(T('attachmentFailed', { name: '', error: error.message }), 'error'); }
|
|
371
|
-
finally { tab.pendingAttachments = false; renderComposer(); }
|
|
372
|
+
finally { tab.pendingAttachments = false; renderComposer(); renderPills(); }
|
|
372
373
|
}
|
|
373
374
|
|
|
374
375
|
async function copyText(text) {
|
|
@@ -738,6 +739,18 @@ async function switchBranch(branch) {
|
|
|
738
739
|
await loadBranches(project);
|
|
739
740
|
}
|
|
740
741
|
}
|
|
742
|
+
// What the tray's auto-close must leave open (tray-auto-close.js), or '': a tab holding an unsent draft, its text (in
|
|
743
|
+
// the composer while the tab is the one on screen) or its staged attachments, and while a message is being edited the
|
|
744
|
+
// draft and attachments the edit put aside. Its X (closeTab) throws them away; the user's X closes it as before.
|
|
745
|
+
function autoCloseKeepOf(tab) {
|
|
746
|
+
if (!tab) return '';
|
|
747
|
+
const input = tab === activeTab() ? $('.mtc-input') : null;
|
|
748
|
+
const editing = tab.editingIndex != null;
|
|
749
|
+
const held = composerHoldsDraft(input ? input.value : tab.draft, tab.attachments)
|
|
750
|
+
|| (editing && composerHoldsDraft(tab.beforeEdit, tab.beforeEditAttachments));
|
|
751
|
+
return held ? 'draft' : '';
|
|
752
|
+
}
|
|
753
|
+
|
|
741
754
|
function renderPills() {
|
|
742
755
|
const tray = document.getElementById('term-minimized-tray');
|
|
743
756
|
for (const tab of _tabs) {
|
|
@@ -748,6 +761,7 @@ function renderPills() {
|
|
|
748
761
|
pill.dataset.tabId = tab.id;
|
|
749
762
|
pill.tabIndex = 0;
|
|
750
763
|
pill.setAttribute('role', 'button');
|
|
764
|
+
pill.keepFromAutoClose = () => autoCloseKeepOf(tab);
|
|
751
765
|
pill.innerHTML = `<span class="mtc-pill-ring" aria-hidden="true"><i></i></span><span class="term-minimized-pill-icon mtc-mark">${ICON}</span><span class="term-minimized-pill-label"></span><button class="term-minimized-pill-close" data-tooltip="${esc(T('closeTab'))}" aria-label="${esc(T('closeTab'))}">×</button>`;
|
|
752
766
|
// A closed panel goes to this tab first and is shown after: showing it first drew, and loaded the session
|
|
753
767
|
// of, the tab it was left on before the one that was clicked.
|
|
@@ -762,6 +776,7 @@ function renderPills() {
|
|
|
762
776
|
const label = tab.pillEl.querySelector('.term-minimized-pill-label');
|
|
763
777
|
if (label) label.textContent = tabLabel(tab, T);
|
|
764
778
|
tab.pillEl.classList.toggle('mtc-pill-running', !!tab.running);
|
|
779
|
+
markAutoCloseKeep(tab.pillEl, autoCloseKeepOf(tab));
|
|
765
780
|
const meaningful = !!(tab.sessionId || tab.running || tab.draft || tab.attachments?.length);
|
|
766
781
|
tab.pillEl.style.display = meaningful && (!_visible || tab !== activeTab()) ? '' : 'none';
|
|
767
782
|
}
|
|
@@ -1164,7 +1179,14 @@ function wire() {
|
|
|
1164
1179
|
transcript?.addEventListener('keydown', (event) => {
|
|
1165
1180
|
if (event.target.matches?.('.mtc-plan-feedback') && event.key === 'Enter' && (event.metaKey || event.ctrlKey)) { event.preventDefault(); runPlanAction('feedback'); }
|
|
1166
1181
|
});
|
|
1167
|
-
$('.mtc-jump')?.addEventListener('click', () => {
|
|
1182
|
+
$('.mtc-jump')?.addEventListener('click', () => {
|
|
1183
|
+
const rt = runtimeOf(activeTab());
|
|
1184
|
+
if (rt) rt.scrolledUp = false;
|
|
1185
|
+
_scroll?.scrollToBottom({ force: true, immediate: true });
|
|
1186
|
+
const jump = $('.mtc-jump');
|
|
1187
|
+
if (jump) jump.hidden = true;
|
|
1188
|
+
updateScrollEdges();
|
|
1189
|
+
});
|
|
1168
1190
|
const form = $('.mtc-composer');
|
|
1169
1191
|
const input = $('.mtc-input');
|
|
1170
1192
|
form?.addEventListener('submit', (event) => { event.preventDefault(); if (activeTab()?.running) stop(); else send(); });
|
|
@@ -1189,7 +1211,7 @@ function wire() {
|
|
|
1189
1211
|
$('#mtc-model')?.addEventListener('change', (event) => { const tab = activeTab(); if (!tab) return; tab.model = event.target.value || null; tab.effort = null; saveTabs(); renderComposer(); renderHeader(); renderContextPop(); });
|
|
1190
1212
|
$('.mtc-attach')?.addEventListener('click', () => $('.mtc-file-input')?.click());
|
|
1191
1213
|
$('.mtc-file-input')?.addEventListener('change', (event) => { stageFiles([...event.target.files]); event.target.value = ''; });
|
|
1192
|
-
$('.mtc-staged')?.addEventListener('click', (event) => { const remove = event.target.closest('[data-remove-attachment]'); const tab = activeTab(); if (!remove || tab?.submitting) return; tab.attachments.splice(Number(remove.dataset.removeAttachment), 1); saveTabs(); renderComposer(); });
|
|
1214
|
+
$('.mtc-staged')?.addEventListener('click', (event) => { const remove = event.target.closest('[data-remove-attachment]'); const tab = activeTab(); if (!remove || tab?.submitting) return; tab.attachments.splice(Number(remove.dataset.removeAttachment), 1); saveTabs(); renderComposer(); renderPills(); });
|
|
1193
1215
|
input?.addEventListener('paste', (event) => { const files = [...(event.clipboardData?.files || [])]; if (files.length) { event.preventDefault(); stageFiles(files); } });
|
|
1194
1216
|
let dragDepth = 0;
|
|
1195
1217
|
_panel.addEventListener('dragenter', (event) => { if (![...(event.dataTransfer?.types || [])].includes('Files')) return; event.preventDefault(); dragDepth++; _panel.classList.add('mtc-dragging'); });
|
|
@@ -6,10 +6,13 @@
|
|
|
6
6
|
// its mark and nothing else. Every rule below uses a token; add a value to the block first.
|
|
7
7
|
|
|
8
8
|
import { installCodeCopy } from '../ui-code-copy.js';
|
|
9
|
+
import { installOutput } from '../ui-output.js';
|
|
9
10
|
|
|
10
11
|
export function injectMaritacaStyles() {
|
|
11
12
|
// The Copy button of every code block: its stylesheet and its one click listener, in this document.
|
|
12
13
|
installCodeCopy(document);
|
|
14
|
+
// The reading layer of an agent's answer (prose, tables, code): one stylesheet for the six panels.
|
|
15
|
+
installOutput(document);
|
|
13
16
|
if (document.getElementById('maritaca-panel-styles')) return;
|
|
14
17
|
const style = document.createElement('style');
|
|
15
18
|
style.id = 'maritaca-panel-styles';
|
|
@@ -146,18 +149,9 @@ export function injectMaritacaStyles() {
|
|
|
146
149
|
.mtc-msg-user .mtc-msg-card { max-width: 85%; border-radius: var(--mtc-radius-lg); background: var(--mtc-surface-2); padding: var(--mtc-space-2) var(--mtc-space-3); }
|
|
147
150
|
.mtc-msg-text { white-space: pre-wrap; word-break: break-word; font-size: var(--mtc-fs-md); line-height: var(--mtc-lh); }
|
|
148
151
|
.mtc-msg-agent { flex-direction: column; color: var(--mtc-text); word-break: break-word; gap: 4px; }
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
.mtc-md
|
|
152
|
-
.mtc-md :is(h1, h2, h3, h4) { margin: 12px 0 6px; font-size: var(--mtc-fs-lg); font-weight: 600; line-height: var(--mtc-lh-tight); }
|
|
153
|
-
.mtc-md :is(ul, ol) { padding-left: 18px; }
|
|
154
|
-
.mtc-md a { color: var(--mtc-link); }
|
|
155
|
-
.mtc-md code { font-family: var(--mtc-mono); font-size: 0.92em; background: var(--mtc-surface-2); padding: 1px 4px; border-radius: var(--mtc-radius-sm); }
|
|
156
|
-
.mtc-md pre { background: var(--mtc-surface-1); border-radius: var(--mtc-radius-md); padding: 8px 10px; overflow-x: auto; font: var(--mtc-fs-sm)/1.55 var(--mtc-mono); }
|
|
157
|
-
.mtc-md pre code { background: none; padding: 0; }
|
|
158
|
-
.mtc-md blockquote { border-left: 2px solid var(--mtc-border-strong); padding-left: 10px; color: var(--mtc-text-2); }
|
|
159
|
-
.mtc-md table { border-collapse: collapse; display: block; overflow-x: auto; }
|
|
160
|
-
.mtc-md :is(th, td) { border: 1px solid var(--mtc-border); padding: 3px 8px; text-align: left; }
|
|
152
|
+
/* An answer's prose, tables and code are the shared reading layer (../ui-output.js): one system for the six
|
|
153
|
+
side panels. A tag is never styled here again; this panel's voice is its link colour. */
|
|
154
|
+
.mtc-md { --sbo-link: var(--mtc-link); }
|
|
161
155
|
.mtc-thought { margin: 2px 0; font-size: var(--mtc-fs-sm); color: var(--mtc-text-3); flex-shrink: 0; }
|
|
162
156
|
.mtc-thought summary { cursor: pointer; list-style: none; padding: 4px 0; display: inline-flex; align-items: center; gap: 6px; }
|
|
163
157
|
.mtc-thought summary::-webkit-details-marker { display: none; }
|
|
@@ -435,6 +429,13 @@ export function injectMaritacaStyles() {
|
|
|
435
429
|
@media (prefers-reduced-motion: reduce) {
|
|
436
430
|
.mtc-panel, .mtc-panel *, .mtc-panel *::before, .mtc-panel *::after, .mtc-session-pill, .mtc-session-pill *, .mtc-pop, .mtc-pop * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
|
|
437
431
|
}
|
|
432
|
+
|
|
433
|
+
/* ── Reading pass (2026-11-21) ──
|
|
434
|
+
An answer's prose, tables and code are ../ui-output.js. Here: what the user wrote reads at the answer's size,
|
|
435
|
+
a turn's footer is legible, and a touch screen (no hover) always shows a message's Copy / Edit / Retry. */
|
|
436
|
+
.mtc-msg-text { font-size: var(--mtc-fs-lg); }
|
|
437
|
+
.mtc-turn-foot { font-size: var(--mtc-fs-sm); }
|
|
438
|
+
@media (hover: none) { .mtc-turn-actions { opacity: 1; } }
|
|
438
439
|
`;
|
|
439
440
|
document.head.appendChild(style);
|
|
440
441
|
}
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
// shown: a session with many sub-agents costs a store and a pill each.
|
|
17
17
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
18
18
|
|
|
19
|
+
import { getProviderMeta, isMaritacaModel } from '../provider-icons.js';
|
|
20
|
+
|
|
19
21
|
import { state, emit } from '../state.js';
|
|
20
22
|
import { injectStyles } from './ocp-v2-styles.js';
|
|
21
23
|
import { getDefaultStore } from './ocp-v2-state.js';
|
|
@@ -547,6 +549,11 @@ export function createChildPanel({
|
|
|
547
549
|
function renderPill() {
|
|
548
550
|
if (!_trayPill || _destroyed) return;
|
|
549
551
|
const s = store.getState();
|
|
552
|
+
const brand = isMaritacaModel(s.model || s.sessionInfo?.model) ? 'maritaca' : 'opencode';
|
|
553
|
+
if (_trayPill.dataset.modelBrand !== brand) {
|
|
554
|
+
_trayPill.querySelector('.term-minimized-pill-icon').innerHTML = brand === 'maritaca' ? getProviderMeta(brand).icon : OPENCODE_ICON;
|
|
555
|
+
_trayPill.dataset.modelBrand = brand;
|
|
556
|
+
}
|
|
550
557
|
const said = pillState(s, { visible: _visible, started });
|
|
551
558
|
const arrows = '↳'.repeat(Math.max(1, Math.min(3, (Number(depth) || 0) + 1)));
|
|
552
559
|
_pillLabel.textContent = `${arrows} ${sessionTitleFor(store)}`;
|
|
@@ -196,6 +196,11 @@ export function applyEvent(store, eventType, ev = {}, hooks = {}) {
|
|
|
196
196
|
hooks.onOutcome?.(store, 'error');
|
|
197
197
|
break;
|
|
198
198
|
}
|
|
199
|
+
case 'shell.updated':
|
|
200
|
+
// A tool call's shell command: started, running on after its call (in the
|
|
201
|
+
// background), ended. What it prints is read apart (ocp-v2-shell-logic.js).
|
|
202
|
+
if (ev.shell) store.upsertShell?.(ev.shell);
|
|
203
|
+
break;
|
|
199
204
|
case 'todo.updated':
|
|
200
205
|
store.setTodos(ev.todos);
|
|
201
206
|
break;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
2
|
+
// OpenCode V2 — a session whose folder is gone
|
|
3
|
+
//
|
|
4
|
+
// OpenCode binds a session to the folder it was created in, for good. When that
|
|
5
|
+
// folder no longer exists (a worktree that was removed, a project that was
|
|
6
|
+
// moved), OpenCode 2 still lists the session and even creates a new one there,
|
|
7
|
+
// and then refuses every prompt of it: 404 "Location not found: <folder>".
|
|
8
|
+
// Sending another folder with the prompt changes nothing.
|
|
9
|
+
//
|
|
10
|
+
// So the panel cannot repair such a session: it moves on. This module decides
|
|
11
|
+
// (DOM-free, unit-tested; the server imports the message and the code):
|
|
12
|
+
// • which folder an error says is gone, and whether it is this panel's;
|
|
13
|
+
// • where to go instead: the registered project the folder was inside (the
|
|
14
|
+
// project root of a removed worktree), else no project at all, which is the
|
|
15
|
+
// folder SynaBun's OpenCode serve runs in;
|
|
16
|
+
// • what to tell the user.
|
|
17
|
+
// ocp-v2-panel.js does the moving (a new session in the other folder).
|
|
18
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
19
|
+
|
|
20
|
+
/** The `code` of a refusal SynaBun's server makes for a folder that does not exist. */
|
|
21
|
+
export const LOCATION_MISSING_CODE = 'LOCATION_MISSING';
|
|
22
|
+
|
|
23
|
+
/** OpenCode's own sentence for it; SynaBun's server refuses in the same words, so one reading covers both. */
|
|
24
|
+
export function locationNotFoundMessage(directory) {
|
|
25
|
+
return `Location not found: ${String(directory || '').trim()}`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const LOCATION_NOT_FOUND_RE = /Location not found:\s*(\S.*?)\s*$/i;
|
|
29
|
+
|
|
30
|
+
/** The folder an error message says is gone, or null when it says nothing of the kind. */
|
|
31
|
+
export function missingLocationOf(message) {
|
|
32
|
+
const text = typeof message === 'string' ? message : String(message?.message || message?.error || '');
|
|
33
|
+
const match = text.match(LOCATION_NOT_FOUND_RE);
|
|
34
|
+
return match ? match[1] : null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// A folder as it is compared: one kind of separator, no trailing one, and no
|
|
38
|
+
// letter case on a Windows drive path.
|
|
39
|
+
function folderKey(folder) {
|
|
40
|
+
let key = String(folder || '').trim().replace(/\\/g, '/');
|
|
41
|
+
if (key.length > 1) key = key.replace(/\/+$/, '') || '/';
|
|
42
|
+
if (/^[A-Za-z]:(\/|$)/.test(key)) key = key.toLowerCase();
|
|
43
|
+
return key;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Whether two paths name the same folder (separators, a trailing slash, a Windows drive's case). */
|
|
47
|
+
export function sameFolder(a, b) {
|
|
48
|
+
const left = folderKey(a);
|
|
49
|
+
return !!left && left === folderKey(b);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Whether `folder` is `parent` or inside it. */
|
|
53
|
+
export function folderInside(folder, parent) {
|
|
54
|
+
const inner = folderKey(folder);
|
|
55
|
+
const outer = folderKey(parent);
|
|
56
|
+
if (!inner || !outer) return false;
|
|
57
|
+
if (inner === outer) return true;
|
|
58
|
+
return inner.startsWith(outer.endsWith('/') ? outer : `${outer}/`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const projectPathOf = (project) => (typeof project === 'string' ? project : String(project?.path || ''));
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Where to work instead of a folder that is gone: the deepest registered
|
|
65
|
+
* project that contains it (and is not one of `avoid`, the folders already
|
|
66
|
+
* found gone), else '' — no project, the folder the serve itself runs in.
|
|
67
|
+
*/
|
|
68
|
+
export function fallbackProjectFor(missing, projects, { avoid = [] } = {}) {
|
|
69
|
+
const gone = [missing, ...avoid].filter(Boolean);
|
|
70
|
+
let best = '';
|
|
71
|
+
for (const project of Array.isArray(projects) ? projects : []) {
|
|
72
|
+
const path = projectPathOf(project);
|
|
73
|
+
if (!path || !folderInside(missing, path)) continue;
|
|
74
|
+
if (gone.some((folder) => sameFolder(folder, path))) continue;
|
|
75
|
+
if (folderKey(path).length > folderKey(best).length) best = path;
|
|
76
|
+
}
|
|
77
|
+
return best;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The folder an error names as gone, when it is this panel's: the project it
|
|
82
|
+
* is on, or the folder of the session on screen. Null otherwise (an error about
|
|
83
|
+
* something else, or about a folder that is not this panel's to leave).
|
|
84
|
+
*/
|
|
85
|
+
export function missingPanelLocation({ message, cwd = '', sessionDirectory = '' } = {}) {
|
|
86
|
+
const missing = missingLocationOf(message);
|
|
87
|
+
if (!missing) return null;
|
|
88
|
+
return sameFolder(missing, cwd) || sameFolder(missing, sessionDirectory) ? missing : null;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** What the user is told once the panel has moved on. */
|
|
92
|
+
export function locationRecoveryNotice({ missing, fallback } = {}) {
|
|
93
|
+
const gone = `The folder ${missing} no longer exists, so OpenCode cannot run a session there.`;
|
|
94
|
+
return fallback
|
|
95
|
+
? `${gone} A new session was started in ${fallback}. Send your message again.`
|
|
96
|
+
: `${gone} A new session was started without a project: choose one in the project menu, then send your message again.`;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The move for a folder that is gone: `{ missing, fallback, notice }`, or null
|
|
101
|
+
* when there is nowhere better to go (the panel is already on no project, and
|
|
102
|
+
* no registered project holds the folder: moving again would change nothing).
|
|
103
|
+
*/
|
|
104
|
+
export function planLocationRecovery({ missing, cwd = '', projects = [], avoid = [] } = {}) {
|
|
105
|
+
if (!missing) return null;
|
|
106
|
+
const fallback = fallbackProjectFor(missing, projects, { avoid });
|
|
107
|
+
if (!fallback && !folderKey(cwd)) return null;
|
|
108
|
+
return { missing, fallback, notice: locationRecoveryNotice({ missing, fallback }) };
|
|
109
|
+
}
|
|
@@ -978,6 +978,7 @@ let _lastWaitingPill = null;
|
|
|
978
978
|
// when it is first shown.
|
|
979
979
|
const PILL_API = {
|
|
980
980
|
sessionStatus: (args) => api.sessionStatus(args),
|
|
981
|
+
shellList: (args) => api.shellList(args),
|
|
981
982
|
permissionList: (args) => api.permissionList(args),
|
|
982
983
|
questionList: (args) => api.questionList(args),
|
|
983
984
|
};
|