synabun 2.4.0 → 2.4.2
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 +47 -0
- package/README.md +1 -1
- package/browser-extension/content.js +73 -11
- package/browser-extension/engine.js +196 -15
- package/browser-extension/manifest.json +4 -2
- package/browser-extension/popup-strings.js +10 -4
- package/browser-extension/popup-view.js +1 -1
- package/browser-extension/popup.css +1 -0
- package/browser-extension/popup.html +4 -1
- package/browser-extension/popup.js +22 -10
- package/browser-extension/protocol.js +102 -11
- package/browser-extension/service-worker.js +20 -4
- package/browser-extension/tokens.css +1 -1
- package/docs/browser-extension-bridge.md +25 -5
- package/lib/data-home-files.js +47 -0
- package/lib/data-home-migration.js +34 -58
- package/lib/first-launch-protection.js +8 -2
- 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 +6 -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 +13 -8
- package/mcp-server/dist/tools/agents.d.ts.map +1 -1
- package/mcp-server/dist/tools/agents.js +35 -15
- 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 +23 -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 +2 -2
- 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 +23 -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 +33 -14
- package/mcp-server/src/tools/browser-advanced.ts +10 -3
- package/mcp-server/src/tools/browser-extension-setup.ts +30 -0
- package/mcp-server/src/tools/browser-interact.ts +5 -1
- package/neural-interface/i18n/en.json +266 -2
- package/neural-interface/i18n/pt-BR.json +267 -3
- package/neural-interface/lib/agents/builtins.json +207 -0
- package/neural-interface/lib/agents/registry.js +60 -15
- package/neural-interface/lib/agents/resolve.js +69 -10
- package/neural-interface/lib/agents/split.js +32 -4
- package/neural-interface/lib/assistant-api.js +19 -8
- package/neural-interface/lib/assistant-brains/claude.js +2 -0
- package/neural-interface/lib/assistant-brains/opencode.js +60 -11
- 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 +384 -119
- package/neural-interface/lib/assistant-persona.js +17 -5
- package/neural-interface/lib/assistant-pricing.js +65 -14
- package/neural-interface/lib/assistant-router.js +181 -54
- package/neural-interface/lib/assistant-run-wait.js +45 -28
- package/neural-interface/lib/assistant-runtime.js +48 -34
- 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 +836 -322
- 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 +109 -24
- package/neural-interface/lib/browser-extension-bridge.js +42 -8
- 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-update-planner.js +105 -6
- 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 +13 -16
- package/neural-interface/lib/native-loop-runtime.js +34 -14
- package/neural-interface/lib/opencode-build-preflight.js +30 -8
- 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-v2-ws-requests.js +31 -1
- package/neural-interface/lib/opencode2-client.js +2 -1
- package/neural-interface/lib/peer-identity.js +13 -8
- 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 +70 -44
- 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 +196 -97
- package/neural-interface/lib/teams/schema.js +1 -1
- package/neural-interface/lib/teams/state.js +14 -14
- package/neural-interface/lib/teams/worktrees.js +27 -27
- package/neural-interface/lib/whatsapp/bridge.js +2 -1
- 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 +2 -2
- package/neural-interface/package.json +1 -1
- package/neural-interface/public/index.html +260 -0
- package/neural-interface/public/offline.html +4 -3
- package/neural-interface/public/onboarding.html +259 -34
- package/neural-interface/public/shared/agents/studio/ax-agent-view.js +2 -2
- package/neural-interface/public/shared/agents/studio/ax-editor-view.js +1 -1
- 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/agents/studio/ax-ui.js +2 -2
- package/neural-interface/public/shared/agy/agy-options.js +11 -0
- package/neural-interface/public/shared/agy/agy-panel.js +29 -10
- 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 +3 -2
- package/neural-interface/public/shared/assistant/asst-api.js +3 -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 +18 -2
- package/neural-interface/public/shared/assistant/asst-rack-styles.js +4 -0
- package/neural-interface/public/shared/assistant/asst-render.js +106 -38
- package/neural-interface/public/shared/assistant/asst-route.js +102 -21
- package/neural-interface/public/shared/assistant/asst-routes-editor.js +1 -1
- 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 +10 -23
- package/neural-interface/public/shared/assistant/route-identity.js +2 -1
- package/neural-interface/public/shared/cc-dropdown.js +21 -15
- 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 +29 -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/html-shell.js +4 -51
- 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 +8 -1
- 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-location-logic.js +109 -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 +118 -6
- package/neural-interface/public/shared/ocp-v2/ocp-v2-render.js +27 -3
- package/neural-interface/public/shared/ocp-v2/ocp-v2-send.js +13 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-session-actions.js +2 -1
- package/neural-interface/public/shared/ocp-v2/ocp-v2-styles.js +27 -93
- package/neural-interface/public/shared/ocp-v2/ocp-v2-variantpicker.js +17 -6
- package/neural-interface/public/shared/output-format.js +294 -0
- package/neural-interface/public/shared/owner-authority-view.js +4 -10
- package/neural-interface/public/shared/page-session.js +1 -1
- 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-ai-browser.js +5 -5
- 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-ia.js +1 -1
- 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/start-bridge.js +2 -2
- package/neural-interface/public/shared/studio-attention.js +6 -0
- package/neural-interface/public/shared/styles.css +354 -438
- package/neural-interface/public/shared/transcript-rows.js +28 -3
- package/neural-interface/public/shared/tray-auto-close.js +18 -5
- 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 +42 -65
- package/neural-interface/public/shared/ui-loading.js +185 -25
- package/neural-interface/public/shared/ui-native-loop-router.js +59 -20
- 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-owner-authority.js +48 -25
- package/neural-interface/public/shared/ui-schedules-studio.js +165 -128
- package/neural-interface/public/shared/ui-scroll-follow.js +97 -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 +234 -67
- package/neural-interface/public/shared/ui-sidepanel-tray.js +3 -2
- package/neural-interface/public/shared/ui-sync.js +1 -0
- 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/sw.js +4 -3
- 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 +17 -4
- package/neural-interface/scripts/scratch-retention.mjs +20 -0
- package/neural-interface/server.js +507 -160
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -1
- package/scripts/restore-data-home-from-backup.mjs +175 -8
- package/setup.js +18 -4
|
@@ -30,7 +30,6 @@ import { brainLabel, readStoredBrain, restoredSessionName } from './asst-state.j
|
|
|
30
30
|
import { closeMenu, isMenuOpen, openMenu } from './asst-menu.js';
|
|
31
31
|
import { injectAssistantSidepanelStyles } from './asst-sidepanel-styles.js';
|
|
32
32
|
import { createMascot, mascotCameoSvg } from '../synabun-mascot.js';
|
|
33
|
-
import { createTutorialPreview } from '../ui-tutorial-preview.js';
|
|
34
33
|
|
|
35
34
|
const PANEL_OWNER = 'assistant-sidepanel';
|
|
36
35
|
const HOST_ID = 'sidepanel';
|
|
@@ -652,8 +651,11 @@ export function assistantPanelPeekable() {
|
|
|
652
651
|
* Assistant is blocked. restore() puts back the panel's visibility, the docked
|
|
653
652
|
* peers and the last-active panels, unless the tour ended on its hand-off to a
|
|
654
653
|
* live tab ('done'): then the panel stays and the tab's composer takes the focus.
|
|
654
|
+
* The preview loads here, before anything of the panel changes: only a tour needs it.
|
|
655
655
|
*/
|
|
656
|
-
export function beginAssistantTour({ onPreviewSend = () => {} } = {}) {
|
|
656
|
+
export async function beginAssistantTour({ onPreviewSend = () => {} } = {}) {
|
|
657
|
+
if (assistantBlocked()) return null;
|
|
658
|
+
const { createTutorialPreview } = await import('../ui-tutorial-preview.js');
|
|
657
659
|
if (assistantBlocked()) return null;
|
|
658
660
|
ensurePanel();
|
|
659
661
|
const wasVisible = _visible;
|
|
@@ -9,6 +9,7 @@ import { KEYS } from '../constants.js';
|
|
|
9
9
|
import { isNewerRunDescriptor } from '../ui-native-loop-router-state.js';
|
|
10
10
|
import { modelEffortIds } from '../agent-runtime-options.js';
|
|
11
11
|
import { getProviderMeta } from '../provider-icons.js';
|
|
12
|
+
import { translatedEffortWord } from '../effort-i18n.js';
|
|
12
13
|
import { usagePacketIsStale } from './asst-usage.js';
|
|
13
14
|
|
|
14
15
|
// The providers the Assistant itself can run on (its brain): the brain picker, /model and /new.
|
|
@@ -746,6 +747,16 @@ export function brainEffortChoices(provider, levels) {
|
|
|
746
747
|
return rest.length ? [auto, { id: ROUTE_EFFORT_OFF, label: 'Off', desc: 'No thinking', key: 'none' }, ...rest] : [auto];
|
|
747
748
|
}
|
|
748
749
|
|
|
750
|
+
/**
|
|
751
|
+
* A footer effort level's word in the user's language, for display only (the id that is stored and sent
|
|
752
|
+
* never changes). Reads `assistant.routes.effortWord.<id>`; a locale that only repeats the English word, a
|
|
753
|
+
* level with no such key (OpenCode variants, Auto / Default) and a missing translator keep `label`.
|
|
754
|
+
*/
|
|
755
|
+
export function brainEffortWord(id, label, t) {
|
|
756
|
+
// Auto / Default (`off`) rows have words of their own (assistant.brain.effortAuto), never an effort word.
|
|
757
|
+
return translatedEffortWord(str(id), t) ?? label;
|
|
758
|
+
}
|
|
759
|
+
|
|
749
760
|
/**
|
|
750
761
|
* The effort a typed `/model <model> <effort>` stores. Claude Code: off / none / no / disabled is Off
|
|
751
762
|
* (`none`: no thinking, as the picker's Off) and auto / default is the model's default (null); a level
|
|
@@ -16,10 +16,13 @@
|
|
|
16
16
|
// prefers-reduced-motion.
|
|
17
17
|
|
|
18
18
|
import { installCodeCopy } from '../ui-code-copy.js';
|
|
19
|
+
import { installOutput } from '../ui-output.js';
|
|
19
20
|
|
|
20
21
|
export function injectAssistantStyles() {
|
|
21
22
|
// The Copy button of every code block: its stylesheet and its one click listener, in this document.
|
|
22
23
|
installCodeCopy(document);
|
|
24
|
+
// The reading layer of an agent's answer (prose, tables, code): one stylesheet for the six panels.
|
|
25
|
+
installOutput(document);
|
|
23
26
|
if (document.getElementById('assistant-panel-styles')) return;
|
|
24
27
|
const style = document.createElement('style');
|
|
25
28
|
style.id = 'assistant-panel-styles';
|
|
@@ -431,27 +434,9 @@ export function injectAssistantStyles() {
|
|
|
431
434
|
/* A prompt written outside the panel (WhatsApp Link). */
|
|
432
435
|
.asst-msg-origin { margin-top: 3px; padding: 0 4px; color: var(--asst-text-3, var(--asst-text-2)); font-size: 11px; line-height: 1.3; }
|
|
433
436
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
.asst-md
|
|
437
|
-
.asst-md p { margin: 0 0 10px; }
|
|
438
|
-
.asst-md :is(h1, h2, h3, h4) { margin: 16px 0 8px; color: var(--asst-text); font-weight: 600; line-height: 1.3; }
|
|
439
|
-
.asst-md h1 { font-size: 18px; }
|
|
440
|
-
.asst-md h2 { font-size: 16px; }
|
|
441
|
-
.asst-md :is(h3, h4) { font-size: 14px; }
|
|
442
|
-
.asst-md :is(ul, ol) { margin: 0 0 10px; padding-left: 22px; }
|
|
443
|
-
.asst-md li { margin: 3px 0; }
|
|
444
|
-
.asst-md li::marker { color: var(--asst-text-3); }
|
|
445
|
-
.asst-md code { padding: 1px 5px; border-radius: 5px; background: var(--asst-fill-2); font-family: var(--asst-mono); font-size: .86em; }
|
|
446
|
-
.asst-md pre { margin: 8px 0 12px; padding: 10px 12px; overflow-x: auto; border: 1px solid var(--asst-line); border-radius: 8px; background: var(--asst-field); }
|
|
447
|
-
.asst-md pre code { padding: 0; background: transparent; font-size: 12.5px; line-height: 1.55; }
|
|
448
|
-
.asst-md blockquote { margin: 8px 0; padding: 2px 12px; border-left: 2px solid var(--asst-line-2); color: var(--asst-text-2); }
|
|
449
|
-
.asst-md :is(a, .file-link) { color: var(--asst-focus); text-decoration: none; cursor: pointer; }
|
|
450
|
-
.asst-md a:hover { text-decoration: underline; }
|
|
451
|
-
.asst-md table { display: block; max-width: 100%; overflow-x: auto; margin: 8px 0 12px; border-collapse: collapse; font-size: 12.5px; }
|
|
452
|
-
.asst-md :is(th, td) { padding: 5px 10px; border: 1px solid var(--asst-line); text-align: left; }
|
|
453
|
-
.asst-md th { color: var(--asst-text-2); font-weight: 600; background: var(--asst-field); }
|
|
454
|
-
.asst-md hr { margin: 12px 0; border: 0; border-top: 1px solid var(--asst-line); }
|
|
437
|
+
/* An answer's prose, tables and code are the shared reading layer (../ui-output.js): one system for the six
|
|
438
|
+
side panels. A tag is never styled here again; this panel's voice is the --sbo-* values that sheet gives .asst-md. */
|
|
439
|
+
.asst-md .file-link { cursor: pointer; }
|
|
455
440
|
|
|
456
441
|
.asst-thinking { color: var(--asst-text-3); font-size: 12.5px; }
|
|
457
442
|
.asst-thinking summary {
|
|
@@ -1970,7 +1955,9 @@ export function injectAssistantStyles() {
|
|
|
1970
1955
|
.asst-routes-overlay .asst-routes-list { display: block; background: var(--asst-field); border: 1px solid var(--asst-line-2); border-radius: var(--asst-r-field); padding: 0; }
|
|
1971
1956
|
.asst-routes-group { display: grid; grid-template-columns: 96px minmax(0, 1fr); min-width: 0; padding: 4px 8px; column-gap: 8px; }
|
|
1972
1957
|
.asst-routes-group + .asst-routes-group { border-top: 1px solid var(--asst-line-2); }
|
|
1973
|
-
|
|
1958
|
+
/* The label stands beside its group, over the first three rows: one that wraps in its narrow column
|
|
1959
|
+
("Web & desktop") takes that height from them, never from the first row alone (it was stretched to 48.78px). */
|
|
1960
|
+
.asst-routes-group > h3 { grid-area: 1 / 1 / span 3; margin: 0; padding: 7px 4px; font-size: 12px; line-height: 1.45; font-weight: 600; color: var(--asst-text-2); overflow-wrap: anywhere; }
|
|
1974
1961
|
.asst-routes-overlay .asst-routes-row { display: block; padding: 0; grid-column: 2; border: 0; }
|
|
1975
1962
|
.asst-routes-overlay .asst-routes-row + .asst-routes-row { border-top: 1px solid var(--asst-line); }
|
|
1976
1963
|
.asst-routes-toggle { display: grid; grid-template-columns: minmax(0, 37%) minmax(0, 1fr) auto 12px; align-items: center; gap: 6px; width: 100%; min-height: 30px; padding: 4px 6px; border: 0; border-radius: var(--asst-pill-r-xs); background: transparent; color: var(--asst-text); text-align: start; font: inherit; cursor: pointer; }
|
|
@@ -2083,7 +2070,7 @@ export function injectAssistantStyles() {
|
|
|
2083
2070
|
.asst-status.warn { color: var(--asst-warn); }
|
|
2084
2071
|
.asst-msg.asst-msg-error .asst-msg-content { padding: 6px 10px; border-radius: var(--asst-r-field); box-shadow: inset 2px 0 0 var(--asst-live), inset 0 0 0 1px color-mix(in srgb, var(--asst-live) 28%, transparent); }
|
|
2085
2072
|
.asst-local-output { padding-left: 12px; border-left: 2px solid var(--asst-line-2); }
|
|
2086
|
-
.asst-local-output .asst-md {
|
|
2073
|
+
.asst-local-output .asst-md { --sbo-text: var(--asst-text-2); --sbo-size: 13px; }
|
|
2087
2074
|
|
|
2088
2075
|
/* The panel's one status line for screen readers (the transcript is not a live region). */
|
|
2089
2076
|
.asst-announce { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
|
|
@@ -7,7 +7,8 @@ export function routeTaskIdentity(route) {
|
|
|
7
7
|
// Control packets and transcript events can arrive in either order on attach/reconnect.
|
|
8
8
|
export function createRouteReplayGuard() {
|
|
9
9
|
const seen = new Set();
|
|
10
|
-
|
|
10
|
+
// A host-only replacement can share a task with a retired worker card.
|
|
11
|
+
const keys = route => [route?.routeId, route?.needsHost ? null : routeTaskIdentity(route)].filter(Boolean);
|
|
11
12
|
return {
|
|
12
13
|
has: route => keys(route).some(key => seen.has(key)),
|
|
13
14
|
record: route => { for (const key of keys(route)) seen.add(key); },
|
|
@@ -124,21 +124,21 @@ const multipleText = (options, values) => options.filter(o => values.includes(St
|
|
|
124
124
|
|
|
125
125
|
// ── Markup ──
|
|
126
126
|
|
|
127
|
-
function optionHTML(id, option, index, chosen) {
|
|
127
|
+
function optionHTML(id, option, index, chosen, fitTrigger) {
|
|
128
128
|
const label = String(option.label ?? '');
|
|
129
129
|
const active = Array.isArray(chosen) ? (chosen.includes(String(option.value ?? '')) || (option.automatic && option.selected)) : index === chosen;
|
|
130
130
|
return `<div class="cc-dropdown-item${active ? ' active' : ''}" id="${esc(id)}-opt-${index}" role="option" aria-selected="${active}"`
|
|
131
|
-
+ `${option.disabled ? ' aria-disabled="true"' : ''} data-value="${esc(option.value ?? '')}" data-index="${index}"${option.exclusive ? ' data-exclusive="true"' : ''}${option.scope ? ` data-scope="${esc(option.scope)}"` : ''}${option.automatic ? ' data-automatic="true"' : ''} data-label="${esc(label)}" title="${esc(option.caption || label)}">${Array.isArray(chosen) ? '<span class="cc-dropdown-check" aria-hidden="true"></span>' : ''}<span>${esc(label)}${option.caption ? `<small class="cc-dropdown-caption">${esc(option.caption)}</small>` : ''}</span></div>`;
|
|
131
|
+
+ `${option.disabled ? ' aria-disabled="true"' : ''} data-value="${esc(option.value ?? '')}" data-index="${index}"${option.exclusive ? ' data-exclusive="true"' : ''}${option.scope ? ` data-scope="${esc(option.scope)}"` : ''}${option.automatic ? ' data-automatic="true"' : ''} data-label="${esc(label)}"${fitTrigger ? '' : ` title="${esc(option.caption || label)}"`}>${Array.isArray(chosen) ? '<span class="cc-dropdown-check" aria-hidden="true"></span>' : ''}<span>${esc(label)}${option.caption ? `<small class="cc-dropdown-caption">${esc(option.caption)}</small>` : ''}</span></div>`;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
/** The menu's options (and headings) for `entries`, the `chosen` index marked. */
|
|
135
|
-
export function menuHTML(id, entries, chosen = chosenIndex(flatOptions(entries))) {
|
|
135
|
+
export function menuHTML(id, entries, chosen = chosenIndex(flatOptions(entries)), fitTrigger = false) {
|
|
136
136
|
let index = 0;
|
|
137
137
|
let group = 0;
|
|
138
138
|
return (entries || []).filter(Boolean).map((entry) => {
|
|
139
|
-
if (!Array.isArray(entry.options)) return optionHTML(id, entry, index++, chosen);
|
|
139
|
+
if (!Array.isArray(entry.options)) return optionHTML(id, entry, index++, chosen, fitTrigger);
|
|
140
140
|
const headId = `${id}-grp-${group++}`;
|
|
141
|
-
const options = entry.options.filter(Boolean).map(option => optionHTML(id, option, index++, chosen)).join('');
|
|
141
|
+
const options = entry.options.filter(Boolean).map(option => optionHTML(id, option, index++, chosen, fitTrigger)).join('');
|
|
142
142
|
return `<div class="cc-dropdown-optgroup" role="group" aria-labelledby="${esc(headId)}"><div class="cc-dropdown-group" id="${esc(headId)}" role="presentation">${esc(entry.group ?? '')}</div>${options}</div>`;
|
|
143
143
|
}).join('');
|
|
144
144
|
}
|
|
@@ -148,17 +148,17 @@ export function menuHTML(id, entries, chosen = chosenIndex(flatOptions(entries))
|
|
|
148
148
|
* Name it with `labelledBy` (the id of its visible label) or `label`. `classes` and `attrs` go on
|
|
149
149
|
* the `.cc-dropdown`.
|
|
150
150
|
*/
|
|
151
|
-
export function dropdownHTML(id, entries, { classes = '', labelledBy = '', label = '', attrs = '', inputAttrs = '', disabled = false, multiple = false, summary = '' } = {}) {
|
|
151
|
+
export function dropdownHTML(id, entries, { classes = '', labelledBy = '', label = '', attrs = '', inputAttrs = '', disabled = false, multiple = false, summary = '', fitTrigger = false } = {}) {
|
|
152
152
|
const options = flatOptions(entries);
|
|
153
153
|
const chosen = multiple ? multipleValues(options) : chosenIndex(options);
|
|
154
154
|
const current = chosen >= 0 ? options[chosen] : null;
|
|
155
155
|
const name = labelledBy ? ` aria-labelledby="${esc(labelledBy)}"` : label ? ` aria-label="${esc(label)}"` : '';
|
|
156
156
|
const text = multiple ? (summary || multipleText(options, chosen)) : String(current?.label ?? '');
|
|
157
157
|
return `<input type="hidden" id="${esc(id)}" value="${esc(multiple ? chosen.join(',') : current?.value ?? '')}"${disabled ? ' disabled' : ''}${inputAttrs ? ` ${inputAttrs}` : ''}>`
|
|
158
|
-
+ `<div class="cc-dropdown${classes ? ` ${classes}` : ''}${disabled ? ' disabled' : ''}" data-for="${esc(id)}"${multiple ? ' data-multiple="true"' : ''}${attrs ? ` ${attrs}` : ''}>`
|
|
158
|
+
+ `<div class="cc-dropdown${classes ? ` ${classes}` : ''}${disabled ? ' disabled' : ''}" data-for="${esc(id)}"${fitTrigger ? ' data-fit-trigger="true"' : ''}${multiple ? ' data-multiple="true"' : ''}${attrs ? ` ${attrs}` : ''}>`
|
|
159
159
|
+ `<button type="button" class="cc-dropdown-trigger" id="${esc(id)}-trigger" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-controls="${esc(id)}-menu"${name}${disabled ? ' disabled' : ''}>`
|
|
160
|
-
+ `<span class="cc-dropdown-value" title="${esc(text)}">${esc(text)}</span>${ARROW}</button>`
|
|
161
|
-
+ `<div class="cc-dropdown-menu" id="${esc(id)}-menu" role="listbox"${multiple ? ' aria-multiselectable="true"' : ''}${name} tabindex="-1">${menuHTML(id, entries, chosen)}</div>`
|
|
160
|
+
+ `<span class="cc-dropdown-value"${fitTrigger ? '' : ` title="${esc(text)}"`}>${esc(text)}</span>${ARROW}</button>`
|
|
161
|
+
+ `<div class="cc-dropdown-menu" id="${esc(id)}-menu" role="listbox"${multiple ? ' aria-multiselectable="true"' : ''}${name} tabindex="-1">${menuHTML(id, entries, chosen, fitTrigger)}</div>`
|
|
162
162
|
+ '</div>';
|
|
163
163
|
}
|
|
164
164
|
|
|
@@ -218,7 +218,7 @@ function showChosen(dd, index) {
|
|
|
218
218
|
if (input) input.value = item ? item.dataset.value ?? '' : '';
|
|
219
219
|
if (label) {
|
|
220
220
|
label.textContent = item ? item.textContent : '';
|
|
221
|
-
label.title = label.textContent;
|
|
221
|
+
if (dd.dataset.fitTrigger !== 'true') label.title = label.textContent;
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
|
|
@@ -233,7 +233,7 @@ function showMultiple(dd, values) {
|
|
|
233
233
|
if (input) input.value = values.join(',');
|
|
234
234
|
if (label) {
|
|
235
235
|
label.textContent = multipleText(optionsOf(items), values);
|
|
236
|
-
label.title = label.textContent;
|
|
236
|
+
if (dd.dataset.fitTrigger !== 'true') label.title = label.textContent;
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
|
|
@@ -285,6 +285,10 @@ function place(dd) {
|
|
|
285
285
|
const roomWidth = Math.max(0, room.right - room.left);
|
|
286
286
|
style.maxWidth = `${roomWidth}px`;
|
|
287
287
|
style.minWidth = `${Math.min(t.width, roomWidth)}px`;
|
|
288
|
+
if (dd.dataset.fitTrigger === 'true') {
|
|
289
|
+
style.width = style.minWidth;
|
|
290
|
+
style.maxHeight = 'var(--cc-menu-max-height)';
|
|
291
|
+
}
|
|
288
292
|
const height = menu.offsetHeight;
|
|
289
293
|
const below = room.bottom - t.bottom - GAP;
|
|
290
294
|
const above = t.top - GAP - room.top;
|
|
@@ -333,7 +337,7 @@ function close(dd, { focus = false, cancel = false } = {}) {
|
|
|
333
337
|
if (cancel && changed) {
|
|
334
338
|
if (menu && dd._ccBeforeMenu != null) menu.innerHTML = dd._ccBeforeMenu;
|
|
335
339
|
showMultiple(dd, dd._ccBefore === '' ? [''] : dd._ccBefore.split(','));
|
|
336
|
-
if (label) { label.textContent = dd._ccBeforeLabel; label.title = label.textContent; }
|
|
340
|
+
if (label) { label.textContent = dd._ccBeforeLabel; if (dd.dataset.fitTrigger !== 'true') label.title = label.textContent; }
|
|
337
341
|
}
|
|
338
342
|
dd.classList.remove('open', 'drop-up');
|
|
339
343
|
trigger?.setAttribute('aria-expanded', 'false');
|
|
@@ -382,7 +386,7 @@ export function setDropdownItems(input, entries) {
|
|
|
382
386
|
const options = flatOptions(entries);
|
|
383
387
|
const multiple = dd.dataset.multiple === 'true';
|
|
384
388
|
const chosen = multiple ? multipleValues(options) : chosenIndex(options);
|
|
385
|
-
menu.innerHTML = menuHTML(input.id, entries, chosen);
|
|
389
|
+
menu.innerHTML = menuHTML(input.id, entries, chosen, dd.dataset.fitTrigger === 'true');
|
|
386
390
|
if (multiple) showMultiple(dd, chosen); else showChosen(dd, chosen);
|
|
387
391
|
if (!wasOpen) return;
|
|
388
392
|
place(dd);
|
|
@@ -458,11 +462,13 @@ export function wireDropdowns(root, { signal } = {}) {
|
|
|
458
462
|
|
|
459
463
|
// The focus stays on the trigger while a choice is clicked.
|
|
460
464
|
on(root, 'mousedown', (e) => { if (e.target.closest?.('.cc-dropdown-menu')) e.preventDefault(); });
|
|
461
|
-
|
|
465
|
+
// Scrolling an item under a stationary pointer generates mouseover. Only an actual move
|
|
466
|
+
// should replace the keyboard highlight after End/PageDown scrolled the listbox.
|
|
467
|
+
on(root, 'pointermove', (e) => {
|
|
462
468
|
const item = e.target.closest?.('.cc-dropdown-item');
|
|
463
469
|
if (!item || item.getAttribute('aria-disabled') === 'true') return;
|
|
464
470
|
const dd = item.closest('.cc-dropdown');
|
|
465
|
-
if (isOpen(dd)) highlight(dd, itemsOf(dd).indexOf(item));
|
|
471
|
+
if (isOpen(dd) && !item.classList.contains('highlight')) highlight(dd, itemsOf(dd).indexOf(item));
|
|
466
472
|
});
|
|
467
473
|
|
|
468
474
|
on(root, 'keydown', (e) => {
|
|
@@ -23,6 +23,8 @@ import { createTextCache } from '../text-cache.js';
|
|
|
23
23
|
import { morphChildren } from '../dom-morph.js';
|
|
24
24
|
import { withCodeCopyButtons } from '../code-copy.js';
|
|
25
25
|
import { decorateCodeBlocks, installCodeCopy } from '../ui-code-copy.js';
|
|
26
|
+
import { withOutputFrames } from '../output-format.js';
|
|
27
|
+
import { decorateOutput, installOutput } from '../ui-output.js';
|
|
26
28
|
import { isSynabunServer, synabunToolKey, synabunToolLabel, synabunToolSummary } from '../synabun-tools.js';
|
|
27
29
|
export { setCardExpanded } from './cdx-cards.js';
|
|
28
30
|
|
|
@@ -92,6 +94,8 @@ export function setRenderContext(ctx) {
|
|
|
92
94
|
// The Copy button of every code block works in this document (its stylesheet and one click listener). Here, not
|
|
93
95
|
// in injectStyles: cdx-styles.js is also run as a plain script (tests/provider-panel-terminal-auth-fixture.mjs).
|
|
94
96
|
if (typeof document !== 'undefined') installCodeCopy(document);
|
|
97
|
+
// The same for the reading layer of an answer (prose, tables, code): ../ui-output.js.
|
|
98
|
+
if (typeof document !== 'undefined') installOutput(document);
|
|
95
99
|
}
|
|
96
100
|
|
|
97
101
|
// ═══════════════════════════════════════════
|
|
@@ -157,6 +161,9 @@ export function md(text) {
|
|
|
157
161
|
catch { html = markdownFallback(key); }
|
|
158
162
|
// Every code block carries the shared Copy button, written in after the sanitiser (../code-copy.js).
|
|
159
163
|
html = withCodeCopyButtons(html);
|
|
164
|
+
// The reading layer all six panels share: a table's frame, task items, a block's language (../output-format.js).
|
|
165
|
+
// highlight.js colours a diff here, so its lines are left to it.
|
|
166
|
+
html = withOutputFrames(html, { diff: false });
|
|
160
167
|
_mdCache.set(key, html);
|
|
161
168
|
return html;
|
|
162
169
|
}
|
|
@@ -838,6 +845,8 @@ export function sanitizeStoredTranscriptDom(container) {
|
|
|
838
845
|
restoreDiffViews(container, { cwd: _ctx.boundTab?.project || _ctx.project });
|
|
839
846
|
// A snapshot's blocks get the shared Copy button; an older one's own button (.cxp-copy-btn) is replaced.
|
|
840
847
|
decorateCodeBlocks(container, { skip: codexOwnCopy });
|
|
848
|
+
// And an answer saved before the reading layer gets its tables framed (../ui-output.js): Markdown bodies only.
|
|
849
|
+
container.querySelectorAll('.cxp-msg-assistant .cxp-msg-body, .cxp-plan-card .cxp-msg-body').forEach((body) => decorateOutput(body, { diff: false }));
|
|
841
850
|
}
|
|
842
851
|
|
|
843
852
|
// ═══════════════════════════════════════════
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { t, getLocale } from '../i18n.js';
|
|
2
2
|
import { accountSummary } from '../account-view.js';
|
|
3
|
+
import { codexEffortLabel } from '../effort-i18n.js';
|
|
4
|
+
import { cxpText } from './cdx-copy.js';
|
|
3
5
|
import { configChanges, configRestriction, configValue, SESSION_CONFIG_FIELDS, sessionSettings, modelServiceTiers, capabilityAvailability } from './cdx-commands.js';
|
|
4
6
|
import { mountCodexAccountSecurity } from './cdx-features.js';
|
|
5
7
|
|
|
@@ -23,7 +25,7 @@ export function codexSettingsDefinitions(schema, models, cfg) {
|
|
|
23
25
|
if (key === 'service_tier' && cfg.model_provider && cfg.model_provider !== 'openai') return [];
|
|
24
26
|
let options = (field.values || []).map(value => ({ value, label: tr(`values.${value}`) === `codexSettings.values.${value}` ? value : tr(`values.${value}`) }));
|
|
25
27
|
if (key === 'model' || key === 'review_model') options = modelOptions;
|
|
26
|
-
if (key === 'model_reasoning_effort') options = (model?.supportedReasoningEfforts || []).map(e => ({ value: e.reasoningEffort, label: e.reasoningEffort }));
|
|
28
|
+
if (key === 'model_reasoning_effort') options = (model?.supportedReasoningEfforts || []).map(e => ({ value: e.reasoningEffort, label: codexEffortLabel(e.reasoningEffort, e.reasoningEffort, cxpText) }));
|
|
27
29
|
if (key === 'service_tier') options = modelServiceTiers(model);
|
|
28
30
|
if (key === 'personality' && !model?.supportsPersonality) return [];
|
|
29
31
|
// The provider list is configured locally. Built-in OpenAI plus named providers.
|
|
@@ -3331,6 +3331,12 @@ export function injectStyles() {
|
|
|
3331
3331
|
transition: none !important;
|
|
3332
3332
|
}
|
|
3333
3333
|
}
|
|
3334
|
+
|
|
3335
|
+
/* ── Reading pass (2026-11-21) ──
|
|
3336
|
+
An answer's prose, tables and code are ../ui-output.js (it overrides the .cxp-msg-body rules above for an
|
|
3337
|
+
answer and a plan; they still style a card's body). Here: what the user wrote reads at the answer's size. */
|
|
3338
|
+
.cxp-msg-user .cxp-msg-body, .cxp-msg-user-text { font-size: var(--cxp-fs-lg); }
|
|
3339
|
+
.cxp-msg-assistant[data-phase="final_answer"] .cxp-msg-phase { color: var(--cxp-text-2); }
|
|
3334
3340
|
`;
|
|
3335
3341
|
document.head.appendChild(style);
|
|
3336
3342
|
}
|
|
@@ -4,6 +4,7 @@ import { cxpText, cxpSessionLabel } from './cdx-copy.js';
|
|
|
4
4
|
import { codexWantsRolloutPreview, rolloutPreviewApplies } from './cdx-preview.js';
|
|
5
5
|
import { mountCodexSettings } from './cdx-settings.js';
|
|
6
6
|
import { t } from '../i18n.js';
|
|
7
|
+
import { codexEffortDesc, codexEffortLabel, translatedEffortWord } from '../effort-i18n.js';
|
|
7
8
|
import { getCliState, isCliInstalling } from '../cli-status.js';
|
|
8
9
|
import { cliInstallText } from '../cli-install-view.js';
|
|
9
10
|
// ═══════════════════════════════════════════
|
|
@@ -1972,16 +1973,32 @@ function formatContextTrackerState(meta) {
|
|
|
1972
1973
|
return 'pending';
|
|
1973
1974
|
}
|
|
1974
1975
|
|
|
1976
|
+
// List-price equivalents ($/MTok) matching neural-interface/lib/assistant-pricing.js (verified 2026-11-20).
|
|
1975
1977
|
const CODEX_MODEL_PRICING = {
|
|
1978
|
+
'gpt-6.2-astra': { input: 8.00, cachedInput: 0.40, cacheWrite: 10.00, output: 40.00 },
|
|
1979
|
+
'gpt-6.2-sol': { input: 2.00, cachedInput: 0.10, cacheWrite: 2.50, output: 10.00 },
|
|
1980
|
+
'gpt-6-astra': { input: 10.00, cachedInput: 1.00, cacheWrite: 12.50, output: 50.00 },
|
|
1981
|
+
'gpt-6.1-sol': { input: 2.00, cachedInput: 0.10, cacheWrite: 2.50, output: 10.00 },
|
|
1982
|
+
'gpt-6.1-terra': { input: 1.00, cachedInput: 0.05, cacheWrite: 1.25, output: 5.00 },
|
|
1983
|
+
'gpt-6-sol': { input: 2.00, cachedInput: 0.20, cacheWrite: 2.50, output: 10.00 },
|
|
1984
|
+
'gpt-6-luna': { input: 0.10, cachedInput: 0.01, cacheWrite: 0.125, output: 0.50 },
|
|
1985
|
+
'gpt-5.6-sol': { input: 4.00, cachedInput: 0.40, cacheWrite: 5.00, output: 20.00 },
|
|
1986
|
+
'gpt-5.6-terra': { input: 2.00, cachedInput: 0.20, cacheWrite: 2.50, output: 12.00 },
|
|
1987
|
+
'gpt-5.6-luna': { input: 0.20, cachedInput: 0.02, cacheWrite: 0.25, output: 1.20 },
|
|
1988
|
+
'gpt-5.5': { input: 5.00, cachedInput: 0.50, output: 30.00 },
|
|
1989
|
+
'gpt-5.4': { input: 2.50, cachedInput: 0.25, output: 15.00 },
|
|
1990
|
+
'gpt-5.4-mini': { input: 0.75, cachedInput: 0.075, output: 4.50 },
|
|
1991
|
+
'gpt-5.3-codex': { input: 1.75, cachedInput: 0.175, output: 14.00 },
|
|
1976
1992
|
'gpt-5.2-codex': { input: 1.75, cachedInput: 0.175, output: 14.00 },
|
|
1977
1993
|
'gpt-5.1-codex-max': { input: 1.25, cachedInput: 0.125, output: 10.00 },
|
|
1978
1994
|
'gpt-5.1-codex': { input: 1.25, cachedInput: 0.125, output: 10.00 },
|
|
1979
1995
|
'gpt-5.1-codex-mini': { input: 0.25, cachedInput: 0.025, output: 2.00 },
|
|
1980
1996
|
'gpt-5-codex': { input: 1.25, cachedInput: 0.125, output: 10.00 },
|
|
1997
|
+
'chat-latest': { input: 5.00, cachedInput: 0.50, output: 30.00 },
|
|
1981
1998
|
};
|
|
1982
1999
|
|
|
1983
2000
|
function getModelPricing(model) {
|
|
1984
|
-
const key = String(model || '').trim().toLowerCase();
|
|
2001
|
+
const key = String(model || '').trim().toLowerCase().replace(/\[[^\]]*\]$/, '').replace(/^.*\//, '').replace(/-\d{8}$/, '');
|
|
1985
2002
|
return CODEX_MODEL_PRICING[key] || null;
|
|
1986
2003
|
}
|
|
1987
2004
|
|
|
@@ -2751,6 +2768,7 @@ function createTrayPill(tab) {
|
|
|
2751
2768
|
const pill = document.createElement('div');
|
|
2752
2769
|
pill.className = 'term-minimized-pill cxp-session-pill';
|
|
2753
2770
|
pill.dataset.tabId = tab.id;
|
|
2771
|
+
pill.getAutomationRunId = () => tab.automationRunId;
|
|
2754
2772
|
pill.innerHTML = `
|
|
2755
2773
|
<span class="term-minimized-pill-icon">${OPENAI_ICON}</span>
|
|
2756
2774
|
<span class="term-minimized-pill-label">${esc(tab.sessionLabel || 'New session')}</span>
|
|
@@ -3055,7 +3073,7 @@ export function closeTab(idx, { detachAutomation = false } = {}) {
|
|
|
3055
3073
|
endWorkerRunOnClose(runId, () => fetch('/api/loop/stop', {
|
|
3056
3074
|
method: 'POST',
|
|
3057
3075
|
headers: { 'Content-Type': 'application/json' },
|
|
3058
|
-
body: JSON.stringify({ runId }),
|
|
3076
|
+
body: JSON.stringify({ runId, action: 'tab_close' }),
|
|
3059
3077
|
}).catch(() => {}));
|
|
3060
3078
|
}
|
|
3061
3079
|
if (tab.automationRunId) forgetWorkerEnd(tab.automationRunId);
|
|
@@ -5976,10 +5994,10 @@ export function renderEffortMenu() {
|
|
|
5976
5994
|
item.dataset.value = option.id;
|
|
5977
5995
|
const label = document.createElement('span');
|
|
5978
5996
|
label.className = 'cxp-effort-menu-label';
|
|
5979
|
-
label.textContent = option.label;
|
|
5997
|
+
label.textContent = codexEffortLabel(option.id, option.label, cxpText);
|
|
5980
5998
|
const description = document.createElement('span');
|
|
5981
5999
|
description.className = 'cxp-effort-menu-desc';
|
|
5982
|
-
description.textContent = option.description || (option.id
|
|
6000
|
+
description.textContent = codexEffortDesc(option.id, option.description, cxpText) || (translatedEffortWord(option.id, t) ?? option.id);
|
|
5983
6001
|
item.append(label, description);
|
|
5984
6002
|
item.addEventListener('click', (event) => {
|
|
5985
6003
|
event.stopPropagation();
|
|
@@ -6105,7 +6123,7 @@ export function syncToolbarState() {
|
|
|
6105
6123
|
const options = effortOptionsForTab(tab);
|
|
6106
6124
|
const selected = options.find((option) => option.id === effort) || options[0];
|
|
6107
6125
|
effortBtn.dataset.effort = effort;
|
|
6108
|
-
effortBtn.title =
|
|
6126
|
+
effortBtn.title = `${cxpText('effort', 'Reasoning effort')}: ${(selected && codexEffortLabel(selected.id, selected.label, cxpText)) || effort}`;
|
|
6109
6127
|
effortBtn.classList.toggle('active', effort !== 'off');
|
|
6110
6128
|
const label = effortBtn.querySelector('.cxp-btn-label');
|
|
6111
6129
|
if (label) label.textContent = effort === 'off' ? cxpText('effortLabel', 'Effort') : cxpText(`effort_${effort}`, selected?.label || effort);
|
|
@@ -6290,8 +6308,9 @@ export function updateCostEstimate(tokenUsage) {
|
|
|
6290
6308
|
if (!tab) return;
|
|
6291
6309
|
const total = tokenUsage.total;
|
|
6292
6310
|
const pricing = getModelPricing(tab.model || _threadContextMeta?.model) || {
|
|
6293
|
-
input: 2.
|
|
6294
|
-
cachedInput:
|
|
6311
|
+
input: 2.00,
|
|
6312
|
+
cachedInput: 0.10,
|
|
6313
|
+
cacheWrite: 2.50,
|
|
6295
6314
|
output: 10.00,
|
|
6296
6315
|
};
|
|
6297
6316
|
const uncachedInputTokens = Number(total.inputTokens) || 0;
|
|
@@ -6299,7 +6318,8 @@ export function updateCostEstimate(tokenUsage) {
|
|
|
6299
6318
|
const cacheCreationInputTokens = Number(total.cacheCreationInputTokens) || 0;
|
|
6300
6319
|
const outputTokens = (total.outputTokens || 0) + (total.reasoningOutputTokens || 0);
|
|
6301
6320
|
tab.estimatedCost = (
|
|
6302
|
-
(
|
|
6321
|
+
(uncachedInputTokens / 1_000_000) * pricing.input
|
|
6322
|
+
+ (cacheCreationInputTokens / 1_000_000) * (pricing.cacheWrite ?? pricing.input)
|
|
6303
6323
|
+ (cachedInputTokens / 1_000_000) * pricing.cachedInput
|
|
6304
6324
|
+ (outputTokens / 1_000_000) * pricing.output
|
|
6305
6325
|
);
|
|
@@ -6338,7 +6358,7 @@ export function interruptTab(tab = activeTab()) {
|
|
|
6338
6358
|
fetch('/api/loop/stop', {
|
|
6339
6359
|
method: 'POST',
|
|
6340
6360
|
headers: { 'Content-Type': 'application/json' },
|
|
6341
|
-
body: JSON.stringify({ runId: tab.automationRunId }),
|
|
6361
|
+
body: JSON.stringify({ runId: tab.automationRunId, action: 'stop' }),
|
|
6342
6362
|
}).catch(() => {});
|
|
6343
6363
|
return withTab(tab, () => {
|
|
6344
6364
|
setRunning(false);
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { DIAGNOSTIC_BATCH, validDiagnosticEntry } from './loading-diagnostic-entry.js';
|
|
2
|
+
|
|
3
|
+
const KEY = 'synabun-loading-diagnostics-v1';
|
|
4
|
+
const CAP = 200;
|
|
5
|
+
|
|
6
|
+
// The shell passes the original fetch, before the UI installs its owner-access
|
|
7
|
+
// notifications. A diagnostic refusal must never raise a banner over the app.
|
|
8
|
+
export function createLoadingDiagnostics(page, { send = page.fetch.bind(page), early = [] } = {}) {
|
|
9
|
+
let entries = [];
|
|
10
|
+
let sent = 0;
|
|
11
|
+
let timer = null;
|
|
12
|
+
let sending = false;
|
|
13
|
+
let retryDelay = 1000;
|
|
14
|
+
// After a refused batch: one entry a request until the trail is drained, so the refused entry is found and dropped.
|
|
15
|
+
let narrow = false;
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
const saved = JSON.parse(page.sessionStorage.getItem(KEY));
|
|
19
|
+
if (Array.isArray(saved?.entries) && saved.entries.length <= CAP && saved.entries.every(validDiagnosticEntry)) {
|
|
20
|
+
entries = saved.entries;
|
|
21
|
+
if (Number.isInteger(saved.sent) && saved.sent >= 0 && saved.sent <= entries.length) sent = saved.sent;
|
|
22
|
+
}
|
|
23
|
+
} catch { /* Storage may be disabled. Delivery can still run in memory. */ }
|
|
24
|
+
|
|
25
|
+
function save() {
|
|
26
|
+
try { page.sessionStorage.setItem(KEY, JSON.stringify({ entries, sent })); } catch {}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function schedule(delay) {
|
|
30
|
+
if (timer === null && !sending && sent < entries.length) timer = page.setTimeout(flush, delay);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async function flush() {
|
|
34
|
+
timer = null;
|
|
35
|
+
const batch = [];
|
|
36
|
+
for (const entry of entries.slice(sent, sent + (narrow ? 1 : DIAGNOSTIC_BATCH))) {
|
|
37
|
+
if (batch.length && entry.pageId !== batch[0].pageId) break;
|
|
38
|
+
batch.push(entry);
|
|
39
|
+
}
|
|
40
|
+
if (!batch.length) return;
|
|
41
|
+
sending = true;
|
|
42
|
+
let delay = null;
|
|
43
|
+
const options = { credentials: 'same-origin', mode: 'same-origin', redirect: 'error', cache: 'no-store' };
|
|
44
|
+
const post = () => send('/api/client-diagnostics', {
|
|
45
|
+
...options, method: 'POST', keepalive: true, signal: AbortSignal.timeout(5000),
|
|
46
|
+
headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(batch),
|
|
47
|
+
});
|
|
48
|
+
try {
|
|
49
|
+
let response = await post();
|
|
50
|
+
if (response.status === 403 && (await response.json()).code === 'PAGE_SECRET_REQUIRED') {
|
|
51
|
+
// A tab surviving a restart can still have the previous boot's HttpOnly cookie.
|
|
52
|
+
const refresh = await send('/api/page-session', { ...options, signal: AbortSignal.timeout(5000) });
|
|
53
|
+
if (refresh.ok) response = await post();
|
|
54
|
+
}
|
|
55
|
+
if (response.status === 204) {
|
|
56
|
+
// Recording continues while the request is in flight, including evictions.
|
|
57
|
+
const last = entries.indexOf(batch.at(-1));
|
|
58
|
+
if (last >= 0) sent = last + 1;
|
|
59
|
+
if (sent >= entries.length) narrow = false;
|
|
60
|
+
else if (narrow) delay = 100;
|
|
61
|
+
save();
|
|
62
|
+
retryDelay = 1000;
|
|
63
|
+
} else if (response.status === 400) {
|
|
64
|
+
// The server can never take this batch: its validator predates an event this page records (the page's
|
|
65
|
+
// files are newer than the running server). Sending it again would hold back the whole trail; the
|
|
66
|
+
// refused entry is dropped and the rest still reach the log.
|
|
67
|
+
if (batch.length === 1) {
|
|
68
|
+
const at = entries.indexOf(batch[0]);
|
|
69
|
+
if (at >= 0) sent = at + 1;
|
|
70
|
+
save();
|
|
71
|
+
}
|
|
72
|
+
narrow = true;
|
|
73
|
+
retryDelay = 1000;
|
|
74
|
+
delay = 0;
|
|
75
|
+
} else {
|
|
76
|
+
retryDelay = Math.min(60000, retryDelay * 2);
|
|
77
|
+
}
|
|
78
|
+
} catch { retryDelay = Math.min(60000, retryDelay * 2); }
|
|
79
|
+
finally { sending = false; schedule(delay ?? retryDelay); }
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function append(entry) {
|
|
83
|
+
try {
|
|
84
|
+
if (!validDiagnosticEntry(entry)) return;
|
|
85
|
+
entries.push(entry);
|
|
86
|
+
if (entries.length > CAP) { entries.shift(); sent = Math.max(0, sent - 1); }
|
|
87
|
+
try { if (page.localStorage.getItem('synabun-diag') === '1') page.console.info('[client-diag]', entry); } catch {}
|
|
88
|
+
} catch { /* Observation must not interrupt startup or recovery. */ }
|
|
89
|
+
}
|
|
90
|
+
for (const entry of early) append(entry);
|
|
91
|
+
if (early.length) save();
|
|
92
|
+
schedule(0); // Drain entries from earlier documents even if the app module never loads.
|
|
93
|
+
return entry => { append(entry); save(); schedule(250); };
|
|
94
|
+
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import { sanitizeHtmlString } from '../assistant/asst-sanitize.js';
|
|
11
11
|
import { withCodeCopyButtons } from '../code-copy.js';
|
|
12
|
+
import { withOutputFrames } from '../output-format.js';
|
|
12
13
|
|
|
13
14
|
// ── The panel's one escaper ──
|
|
14
15
|
// Every value the panel puts into markup it builds itself (a session's title or
|
|
@@ -38,14 +39,18 @@ const plain = (text) => escapeHtml(text).replace(/\n/g, '<br>');
|
|
|
38
39
|
* Every code block carries the shared Copy button (../code-copy.js), written in
|
|
39
40
|
* after the sanitiser: a stream, a re-render and a string-keyed transcript keep
|
|
40
41
|
* it, and a model cannot write one. `codeCopy: false` leaves it out.
|
|
42
|
+
* The same way, and for the same reason, a table gets its frame and a task item,
|
|
43
|
+
* a code block's language and a diff's lines their marks (../output-format.js):
|
|
44
|
+
* the reading layer all six panels share. `frames: false` leaves them out.
|
|
41
45
|
*/
|
|
42
|
-
export function renderMarkdown(text, { parse = null, sanitize = sanitizeHtmlString, doc = globalThis.document, codeCopy = true } = {}) {
|
|
46
|
+
export function renderMarkdown(text, { parse = null, sanitize = sanitizeHtmlString, doc = globalThis.document, codeCopy = true, frames = true } = {}) {
|
|
43
47
|
const src = String(text ?? '');
|
|
44
48
|
if (typeof parse !== 'function') return plain(src);
|
|
45
49
|
try {
|
|
46
50
|
const html = sanitize(parse(src), doc);
|
|
47
51
|
if (typeof html !== 'string') return plain(src);
|
|
48
|
-
|
|
52
|
+
const shown = codeCopy ? withCodeCopyButtons(html) : html;
|
|
53
|
+
return frames ? withOutputFrames(shown) : shown;
|
|
49
54
|
} catch {
|
|
50
55
|
return plain(src);
|
|
51
56
|
}
|
|
@@ -81,7 +81,7 @@ export const CP_STYLES = `
|
|
|
81
81
|
.cp-agent-feed .msg { margin: 4px 0; }
|
|
82
82
|
.cp-agent-feed .msg-avatar { display: none; }
|
|
83
83
|
.cp-agent-feed .msg-content { margin-left: 0; }
|
|
84
|
-
.cp-agent-feed .msg-body {
|
|
84
|
+
.cp-agent-feed .msg-body { --sbo-size: 12px; --sbo-code-size: 11px; --sbo-table-size: 11px; }
|
|
85
85
|
.cp-agent-feed .tool-card { transform: scale(0.98); transform-origin: left top; }
|
|
86
86
|
.cp-agent-result { font: 10.5px/1.5 Inter, sans-serif; color: rgba(255,255,255,0.55); background: rgba(150,120,200,0.07); border-radius: 6px; padding: 6px 8px; margin: 6px 0 2px; }
|
|
87
87
|
|