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
|
@@ -78,6 +78,13 @@ export function createPanelStore() {
|
|
|
78
78
|
todos: [],
|
|
79
79
|
// What the session changed on disk (session.diff): SnapshotFileDiff[].
|
|
80
80
|
sessionDiff: [],
|
|
81
|
+
// The shell commands of the session's tool calls (shell.updated, shell:list):
|
|
82
|
+
// shellId → { id, status, command, callID, messageID, background, waited,
|
|
83
|
+
// exit, time }. A command can outlive its tool call ("in the background").
|
|
84
|
+
shells: new Map(),
|
|
85
|
+
// What each command has printed, as far as it was read (ocp-v2-shell-logic.js):
|
|
86
|
+
// shellId → { text, from, size, done, gone, error }.
|
|
87
|
+
shellOutput: new Map(),
|
|
81
88
|
|
|
82
89
|
mode: 'build',
|
|
83
90
|
agent: 'build',
|
|
@@ -112,7 +119,7 @@ export function createPanelStore() {
|
|
|
112
119
|
// `binding` counts how often the store moved to another session: an answer
|
|
113
120
|
// that was asked for under an older binding belongs to a session the panel
|
|
114
121
|
// has left (or left and came back to) and is dropped by whoever asked.
|
|
115
|
-
const _rev = { status: 0, permissions: 0, questions: 0, todos: 0, binding: 0 };
|
|
122
|
+
const _rev = { status: 0, permissions: 0, questions: 0, todos: 0, shells: 0, binding: 0 };
|
|
116
123
|
function getRevisions() { return { ..._rev }; }
|
|
117
124
|
// The binding identity on its own: it changes every time the store is bound
|
|
118
125
|
// to another session (a new one, a switch, a project change, no session),
|
|
@@ -175,7 +182,7 @@ export function createPanelStore() {
|
|
|
175
182
|
// left is gone before any listener runs, so nobody sees the new session
|
|
176
183
|
// with the old one's run state or requests.
|
|
177
184
|
_rev.binding += 1;
|
|
178
|
-
_rev.status += 1; _rev.todos += 1; _rev.permissions += 1; _rev.questions += 1;
|
|
185
|
+
_rev.status += 1; _rev.todos += 1; _rev.permissions += 1; _rev.questions += 1; _rev.shells += 1;
|
|
179
186
|
const wasRunning = _state.running;
|
|
180
187
|
_state.running = false;
|
|
181
188
|
_state.sessionStatus = { type: 'idle' };
|
|
@@ -183,6 +190,9 @@ export function createPanelStore() {
|
|
|
183
190
|
_state.autoAccept = false;
|
|
184
191
|
_state.todos = [];
|
|
185
192
|
_state.sessionDiff = [];
|
|
193
|
+
// A command belongs to the session that ran it, and so does what it printed.
|
|
194
|
+
_state.shells = new Map();
|
|
195
|
+
_state.shellOutput = new Map();
|
|
186
196
|
_state.contextGauge = createDefaultContextGauge(sessionId ? 'pending' : 'idle');
|
|
187
197
|
// A request waiting for an answer belongs to the session it was raised
|
|
188
198
|
// in. One that arrived while the next session was still being created
|
|
@@ -409,6 +419,42 @@ export function createPanelStore() {
|
|
|
409
419
|
notify({ type: 'diff:set' });
|
|
410
420
|
}
|
|
411
421
|
|
|
422
|
+
// One command changed (shell.updated): it started with its call, went on in
|
|
423
|
+
// the background, or ended. A command of another session is not this store's.
|
|
424
|
+
function upsertShell(shell) {
|
|
425
|
+
const id = shell && typeof shell.id === 'string' ? shell.id : '';
|
|
426
|
+
if (!id) return false;
|
|
427
|
+
if (shell.sessionID && _state.sessionId && shell.sessionID !== _state.sessionId) return false;
|
|
428
|
+
_rev.shells += 1;
|
|
429
|
+
_state.shells.set(id, { ..._state.shells.get(id), ...shell });
|
|
430
|
+
notify({ type: 'shell:update', shellId: id });
|
|
431
|
+
return true;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
// The server's list of the session's commands (after a reload or a reconnect):
|
|
435
|
+
// what it knows replaces what the store held, what it printed is kept.
|
|
436
|
+
function setShells(list) {
|
|
437
|
+
_rev.shells += 1;
|
|
438
|
+
const next = new Map();
|
|
439
|
+
for (const shell of Array.isArray(list) ? list : []) {
|
|
440
|
+
if (!shell || typeof shell.id !== 'string' || !shell.id) continue;
|
|
441
|
+
if (shell.sessionID && _state.sessionId && shell.sessionID !== _state.sessionId) continue;
|
|
442
|
+
next.set(shell.id, { ..._state.shells.get(shell.id), ...shell });
|
|
443
|
+
}
|
|
444
|
+
_state.shells = next;
|
|
445
|
+
notify({ type: 'shell:update', shellId: null });
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
// What a command printed, as far as it was read. Only the transcript's
|
|
449
|
+
// terminal blocks read this (they draw it themselves): no slice of the
|
|
450
|
+
// rehydrated state depends on it.
|
|
451
|
+
function setShellOutput(shellId, view) {
|
|
452
|
+
if (!shellId) return;
|
|
453
|
+
if (view) _state.shellOutput.set(shellId, view);
|
|
454
|
+
else _state.shellOutput.delete(shellId);
|
|
455
|
+
notify({ type: 'shell:output', shellId });
|
|
456
|
+
}
|
|
457
|
+
|
|
412
458
|
function setAutoAccept(value) {
|
|
413
459
|
const next = !!value;
|
|
414
460
|
if (_state.autoAccept === next) return;
|
|
@@ -661,7 +707,7 @@ export function createPanelStore() {
|
|
|
661
707
|
appendPartDelta, removePart, hydrateMessages,
|
|
662
708
|
setRunning, setSessionStatus, setCompacting,
|
|
663
709
|
setPendingPermission, setPendingPermissions, addPendingPermission, removePendingPermission,
|
|
664
|
-
setAutoAccept, setTodos, setSessionDiff,
|
|
710
|
+
setAutoAccept, setTodos, setSessionDiff, upsertShell, setShells, setShellOutput,
|
|
665
711
|
setPendingQuestions, addPendingQuestion, removePendingQuestion,
|
|
666
712
|
pushError, dismissError, clearErrors, setHealing, setKnownSessions,
|
|
667
713
|
setHelpCard,
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
7
7
|
|
|
8
8
|
import { installCodeCopy } from '../ui-code-copy.js';
|
|
9
|
+
import { installOutput } from '../ui-output.js';
|
|
9
10
|
|
|
10
11
|
const STYLE_ID = 'ocp-v2-styles';
|
|
11
12
|
|
|
@@ -748,99 +749,9 @@ body.ui-interacting .ocpv2-pill-ring > i { animation-play-state: paused; }
|
|
|
748
749
|
.ocpv2-part { display: block; }
|
|
749
750
|
.ocpv2-part + .ocpv2-part { margin-top: 6px; }
|
|
750
751
|
.ocpv2-part-text { white-space: normal; }
|
|
751
|
-
|
|
752
|
-
.
|
|
753
|
-
|
|
754
|
-
.ocpv2-part-text h4, .ocpv2-part-text h5, .ocpv2-part-text h6 {
|
|
755
|
-
margin: 0.75em 0 0.3em;
|
|
756
|
-
line-height: 1.35;
|
|
757
|
-
color: rgba(255,255,255,0.96);
|
|
758
|
-
font-weight: 600;
|
|
759
|
-
}
|
|
760
|
-
.ocpv2-part-text h1 { font-size: 16px; }
|
|
761
|
-
.ocpv2-part-text h2 { font-size: 14px; }
|
|
762
|
-
.ocpv2-part-text h3 { font-size: 13px; }
|
|
763
|
-
.ocpv2-part-text h4 { font-size: 12px; }
|
|
764
|
-
.ocpv2-part-text h5 { font-size: 11.5px; opacity: 0.92; }
|
|
765
|
-
.ocpv2-part-text h6 { font-size: 11px; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.04em; }
|
|
766
|
-
.ocpv2-part-text ul, .ocpv2-part-text ol {
|
|
767
|
-
margin: 0 0 8px 18px;
|
|
768
|
-
padding: 0;
|
|
769
|
-
}
|
|
770
|
-
.ocpv2-part-text li + li { margin-top: 4px; }
|
|
771
|
-
.ocpv2-part-text a { color: rgba(151,214,255,0.92); text-decoration: none; }
|
|
772
|
-
.ocpv2-part-text a:hover { text-decoration: underline; }
|
|
773
|
-
.ocpv2-part-text code {
|
|
774
|
-
background: rgba(255,255,255,0.05);
|
|
775
|
-
border: 1px solid rgba(255,255,255,0.06);
|
|
776
|
-
padding: 1px 5px;
|
|
777
|
-
border-radius: 4px;
|
|
778
|
-
font-size: 11.5px;
|
|
779
|
-
font-family: 'JetBrains Mono', ui-monospace, monospace;
|
|
780
|
-
}
|
|
781
|
-
.ocpv2-part-text pre {
|
|
782
|
-
background: rgba(0,0,0,0.28);
|
|
783
|
-
border: 1px solid rgba(255,255,255,0.05);
|
|
784
|
-
border-radius: 8px;
|
|
785
|
-
padding: 10px;
|
|
786
|
-
margin: 8px 0;
|
|
787
|
-
overflow-x: auto;
|
|
788
|
-
font-size: 11px;
|
|
789
|
-
line-height: 1.55;
|
|
790
|
-
white-space: pre-wrap;
|
|
791
|
-
word-break: break-word;
|
|
792
|
-
}
|
|
793
|
-
.ocpv2-part-text pre code {
|
|
794
|
-
background: none;
|
|
795
|
-
border: none;
|
|
796
|
-
padding: 0;
|
|
797
|
-
font-size: inherit;
|
|
798
|
-
}
|
|
799
|
-
.ocpv2-part-text strong { color: rgba(255,255,255,0.95); font-weight: 600; }
|
|
800
|
-
.ocpv2-part-text em { font-style: italic; color: rgba(255,255,255,0.78); }
|
|
801
|
-
.ocpv2-part-text del { opacity: 0.55; text-decoration: line-through; }
|
|
802
|
-
.ocpv2-part-text hr {
|
|
803
|
-
border: none;
|
|
804
|
-
border-top: 1px solid rgba(255,255,255,0.08);
|
|
805
|
-
margin: 12px 0;
|
|
806
|
-
}
|
|
807
|
-
.ocpv2-part-text blockquote {
|
|
808
|
-
margin: 6px 0;
|
|
809
|
-
padding: 4px 12px;
|
|
810
|
-
border-left: 3px solid rgba(232,224,220,0.25);
|
|
811
|
-
color: rgba(255,255,255,0.72);
|
|
812
|
-
background: rgba(255,255,255,0.02);
|
|
813
|
-
border-radius: 0 6px 6px 0;
|
|
814
|
-
}
|
|
815
|
-
.ocpv2-part-text blockquote p { margin: 4px 0; }
|
|
816
|
-
.ocpv2-part-text table {
|
|
817
|
-
border-collapse: collapse;
|
|
818
|
-
margin: 8px 0;
|
|
819
|
-
font-size: 11px;
|
|
820
|
-
width: 100%;
|
|
821
|
-
display: block;
|
|
822
|
-
overflow-x: auto;
|
|
823
|
-
}
|
|
824
|
-
.ocpv2-part-text thead {
|
|
825
|
-
background: rgba(255,255,255,0.04);
|
|
826
|
-
}
|
|
827
|
-
.ocpv2-part-text th,
|
|
828
|
-
.ocpv2-part-text td {
|
|
829
|
-
border: 1px solid rgba(255,255,255,0.08);
|
|
830
|
-
padding: 5px 8px;
|
|
831
|
-
text-align: left;
|
|
832
|
-
vertical-align: top;
|
|
833
|
-
}
|
|
834
|
-
.ocpv2-part-text th { font-weight: 600; color: rgba(255,255,255,0.92); }
|
|
835
|
-
.ocpv2-part-text input[type="checkbox"] {
|
|
836
|
-
margin-right: 4px;
|
|
837
|
-
vertical-align: middle;
|
|
838
|
-
}
|
|
839
|
-
.ocpv2-part-text img {
|
|
840
|
-
max-width: 100%;
|
|
841
|
-
height: auto;
|
|
842
|
-
border-radius: 6px;
|
|
843
|
-
}
|
|
752
|
+
/* An answer's prose, tables and code are the shared reading layer (../ui-output.js): one system for the six
|
|
753
|
+
side panels. A tag is never styled here again; this panel's voice (mono, 12.5px, its link blue, wrapped code)
|
|
754
|
+
is the --sbo-* values that sheet gives .ocpv2-part-text. */
|
|
844
755
|
|
|
845
756
|
/* ── Part: reasoning (CLI-style streaming thinking block) ──────────────── */
|
|
846
757
|
.ocpv2-part-reasoning {
|
|
@@ -2323,6 +2234,13 @@ img.ocpv2-tool-screenshot {
|
|
|
2323
2234
|
opacity: 0.4;
|
|
2324
2235
|
transition: opacity 0.15s;
|
|
2325
2236
|
}
|
|
2237
|
+
.ocpv2-model-mark svg {
|
|
2238
|
+
width: 1em;
|
|
2239
|
+
height: 1em;
|
|
2240
|
+
margin-inline-end: 4px;
|
|
2241
|
+
vertical-align: -0.12em;
|
|
2242
|
+
}
|
|
2243
|
+
.ocpv2-brand-link > svg { width: 14px; height: 14px; }
|
|
2326
2244
|
.ocpv2-brand-link:hover { opacity: 0.85; }
|
|
2327
2245
|
.ocpv2-brand {
|
|
2328
2246
|
width: 14px;
|
|
@@ -3435,6 +3353,46 @@ const PARITY_CSS = `
|
|
|
3435
3353
|
padding: 6px 12px;
|
|
3436
3354
|
border-top: 1px solid rgba(255,255,255,0.05);
|
|
3437
3355
|
}
|
|
3356
|
+
/* A command's output as it is printed (ocp-v2-shell.js). The block scrolls by itself, so a long test run
|
|
3357
|
+
never stretches the transcript; its colours and type are the tool output's. */
|
|
3358
|
+
.ocpv2-term { display: flex; flex-direction: column; min-width: 0; }
|
|
3359
|
+
.ocpv2-term-out {
|
|
3360
|
+
max-height: 340px;
|
|
3361
|
+
overflow: auto;
|
|
3362
|
+
overscroll-behavior: contain;
|
|
3363
|
+
tab-size: 4;
|
|
3364
|
+
}
|
|
3365
|
+
.ocpv2-term-out:focus-visible { outline: 1px solid rgba(255,255,255,0.28); outline-offset: -1px; }
|
|
3366
|
+
.ocpv2-term-note,
|
|
3367
|
+
.ocpv2-term-foot {
|
|
3368
|
+
display: flex;
|
|
3369
|
+
align-items: center;
|
|
3370
|
+
gap: 10px;
|
|
3371
|
+
padding: 6px 12px;
|
|
3372
|
+
border-top: 1px solid rgba(255,255,255,0.05);
|
|
3373
|
+
font-size: 10.5px;
|
|
3374
|
+
line-height: 1.5;
|
|
3375
|
+
color: rgba(255,255,255,0.55);
|
|
3376
|
+
}
|
|
3377
|
+
/* What the block hides is gone, whatever its own class says about display (a button of the card is a block). */
|
|
3378
|
+
.ocpv2-term [hidden] { display: none; }
|
|
3379
|
+
.ocpv2-term-note .ocpv2-tc-more,
|
|
3380
|
+
.ocpv2-term-foot .ocpv2-tc-more { margin-top: 0; flex-shrink: 0; }
|
|
3381
|
+
.ocpv2-term-state { flex: 1; min-width: 0; }
|
|
3382
|
+
.ocpv2-term[data-running="true"] .ocpv2-term-state::after {
|
|
3383
|
+
content: '';
|
|
3384
|
+
display: inline-block;
|
|
3385
|
+
width: 5px;
|
|
3386
|
+
height: 5px;
|
|
3387
|
+
margin-left: 6px;
|
|
3388
|
+
border-radius: 50%;
|
|
3389
|
+
background: rgba(232,224,220,0.75);
|
|
3390
|
+
vertical-align: middle;
|
|
3391
|
+
animation: ocpv2-term-pulse 1.2s ease-in-out infinite;
|
|
3392
|
+
}
|
|
3393
|
+
@keyframes ocpv2-term-pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
|
|
3394
|
+
@media (prefers-reduced-motion: reduce) { .ocpv2-term[data-running="true"] .ocpv2-term-state::after { animation: none; } }
|
|
3395
|
+
.ocpv2-term-foot .ocpv2-msg-action { opacity: 1; }
|
|
3438
3396
|
.ocpv2-tc-diff { white-space: pre; overflow-x: auto; }
|
|
3439
3397
|
.ocpv2-diff-line { min-height: 1.5em; }
|
|
3440
3398
|
.ocpv2-diff-add { color: rgba(140,200,160,0.85); background: rgba(140,200,160,0.04); }
|
|
@@ -3757,11 +3715,27 @@ const PARITY_CSS = `
|
|
|
3757
3715
|
}
|
|
3758
3716
|
.ocpv2-panel.ocp-cli-blocked .ocpv2-compose-btn:not(.ocpv2-compose-abort) { opacity: 0.4; cursor: not-allowed; }
|
|
3759
3717
|
.ocpv2-panel.ocp-cli-blocked .ocpv2-compose-input { opacity: 0.7; }
|
|
3718
|
+
|
|
3719
|
+
/* ── Reading pass (2026-11-21): what the agent did is legible and quiet, what it answered leads ──
|
|
3720
|
+
An answer's prose, tables and code are ../ui-output.js. This block is the rest of the transcript: the labels,
|
|
3721
|
+
the metadata and the tool rows' secondary text were 9.5–10.5px at 22–45% white. They keep their mono voice and
|
|
3722
|
+
their place; the faint text is 55% white (the style guide's muted text). Nothing moved, nothing was removed. */
|
|
3723
|
+
.ocpv2-msg-role { font-size: 10px; color: rgba(255,255,255,0.55); }
|
|
3724
|
+
.ocpv2-msg-meta { font-size: 10.5px; color: rgba(255,255,255,0.55); }
|
|
3725
|
+
.ocpv2-part-step { color: rgba(255,255,255,0.45); }
|
|
3726
|
+
.ocpv2-part-note, .ocpv2-thinking-preview, .ocpv2-tc-summary, .ocpv2-tc-meta { color: rgba(255,255,255,0.55); }
|
|
3727
|
+
.ocpv2-tc-summary, .ocpv2-tc-meta { font-size: 10.5px; }
|
|
3728
|
+
/* What the agent says right before a tool call is secondary text; its answer is primary. Colour only. */
|
|
3729
|
+
.ocpv2-msg-part-text:has(+ .ocpv2-msg-part-tool) .ocpv2-part-text { --sbo-text: rgba(255,255,255,0.72); --sbo-strong: rgba(255,255,255,0.9); }
|
|
3730
|
+
/* A touch screen has no hover: a message's actions (Copy, Undo, Fork, Retry) are always shown there. */
|
|
3731
|
+
@media (hover: none) { .ocpv2-msg-actions, .ocpv2-msg-action { opacity: 1; } }
|
|
3760
3732
|
`;
|
|
3761
3733
|
|
|
3762
3734
|
export function injectStyles() {
|
|
3763
3735
|
// The Copy button of every code block: its stylesheet and its one click listener, in this document.
|
|
3764
3736
|
installCodeCopy(document);
|
|
3737
|
+
// The reading layer of an agent's answer (prose, tables, code): one stylesheet for the six panels.
|
|
3738
|
+
installOutput(document);
|
|
3765
3739
|
const full = CSS + '\n' + PARITY_CSS + '\n' + CHILD_CSS;
|
|
3766
3740
|
const existing = document.getElementById(STYLE_ID);
|
|
3767
3741
|
if (existing) {
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
// tool this file does not know falls back to its input and output as text.
|
|
9
9
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
10
10
|
|
|
11
|
+
import { shellCardState } from './ocp-v2-shell-logic.js';
|
|
12
|
+
|
|
11
13
|
export const TOOL_OUTPUT_MAX_LINES = 24;
|
|
12
14
|
export const TOOL_OUTPUT_MAX_CHARS = 4000;
|
|
13
15
|
|
|
@@ -133,9 +135,15 @@ function diffSection(lines) {
|
|
|
133
135
|
* Everything a tool card shows.
|
|
134
136
|
* { tool, label, iconKey, status, title, meta, sections, defaultExpanded,
|
|
135
137
|
* copyText, childSessionId, attachments }
|
|
136
|
-
* sections: { kind: 'code' | 'output' | 'error' | 'diff' | 'todos', … }
|
|
138
|
+
* sections: { kind: 'code' | 'output' | 'error' | 'diff' | 'todos' | 'terminal', … }
|
|
139
|
+
* `context.shell`: the shell command of a bash call as the panel knows it live
|
|
140
|
+
* (ocp-v2-state.js `shells`), with `context.live` when its output can be read
|
|
141
|
+
* as it is printed: the card then shows a terminal block instead of the text
|
|
142
|
+
* the call returned, and says whether the command still runs. OpenCode ends a
|
|
143
|
+
* call whose command runs on in the background: the call is "completed" then,
|
|
144
|
+
* the command is not.
|
|
137
145
|
*/
|
|
138
|
-
export function toolCardView(part) {
|
|
146
|
+
export function toolCardView(part, context = {}) {
|
|
139
147
|
const state = part?.state && typeof part.state === 'object' ? part.state : {};
|
|
140
148
|
const input = state.input && typeof state.input === 'object' ? state.input : (part?.input && typeof part.input === 'object' ? part.input : {});
|
|
141
149
|
const metadata = state.metadata && typeof state.metadata === 'object' ? state.metadata : {};
|
|
@@ -165,11 +173,18 @@ export function toolCardView(part) {
|
|
|
165
173
|
const command = str(input.command);
|
|
166
174
|
view.title = oneLine(input.description) || view.title || oneLine(command);
|
|
167
175
|
if (command) view.sections.push({ kind: 'code', text: command, prompt: '$' });
|
|
168
|
-
|
|
176
|
+
const shell = context.shell && typeof context.shell === 'object' ? context.shell : null;
|
|
177
|
+
const live = shell ? shellCardState(shell) : null;
|
|
178
|
+
if (shell && context.live) view.sections.push({ kind: 'terminal', shellId: str(shell.id), text: `${shell.status}:${shell.exit ?? ''}` });
|
|
179
|
+
else addOutput(str(metadata.output) || output);
|
|
169
180
|
view.copyText = command;
|
|
181
|
+
if (live?.status) view.status = live.status;
|
|
182
|
+
const exit = typeof shell?.exit === 'number' ? shell.exit : (typeof metadata.exit === 'number' ? metadata.exit : null);
|
|
183
|
+
const note = live?.note || (exit != null && exit !== 0 ? `exit ${exit}` : '');
|
|
184
|
+
if (live?.running && Number.isFinite(start)) view.meta = '';
|
|
185
|
+
if (note) view.meta = [view.meta, note].filter(Boolean).join(' · ');
|
|
170
186
|
// A command that is running or failed is what the user is waiting on.
|
|
171
|
-
view.defaultExpanded = status !== 'completed';
|
|
172
|
-
if (typeof metadata.exit === 'number' && metadata.exit !== 0) view.meta = [view.meta, `exit ${metadata.exit}`].filter(Boolean).join(' · ');
|
|
187
|
+
view.defaultExpanded = view.status !== 'completed' || (exit != null && exit !== 0);
|
|
173
188
|
break;
|
|
174
189
|
}
|
|
175
190
|
case 'edit':
|
|
@@ -87,9 +87,11 @@ function attachmentNode(file) {
|
|
|
87
87
|
* helpers:
|
|
88
88
|
* contentBlocks(output) → a node for MCP content blocks, or null
|
|
89
89
|
* onOpenChild(sessionId) → open the sub-agent session of a task card
|
|
90
|
+
* shell → the shell command of a bash call, as the panel knows it live
|
|
91
|
+
* terminal(shellId) → the node that shows that command's output as it is printed
|
|
90
92
|
*/
|
|
91
93
|
export function renderToolCard(part, helpers = {}) {
|
|
92
|
-
const view = toolCardView(part);
|
|
94
|
+
const view = toolCardView(part, { shell: helpers.shell || null, live: typeof helpers.terminal === 'function' });
|
|
93
95
|
const callId = part.callID || part.id || `${view.tool}-${part.messageID || ''}`;
|
|
94
96
|
const expanded = _expandedByUser.has(callId) ? _expandedByUser.get(callId) : view.defaultExpanded;
|
|
95
97
|
|
|
@@ -119,6 +121,8 @@ export function renderToolCard(part, helpers = {}) {
|
|
|
119
121
|
const next = !wrap.classList.contains('ocpv2-tool-expanded');
|
|
120
122
|
_expandedByUser.set(callId, next);
|
|
121
123
|
wrap.classList.toggle('ocpv2-tool-expanded', next);
|
|
124
|
+
// A terminal block has a size only once its card is open.
|
|
125
|
+
if (next) for (const term of wrap.querySelectorAll('.ocpv2-term')) term.dispatchEvent(new Event('ocpv2-term-show'));
|
|
122
126
|
});
|
|
123
127
|
wrap.appendChild(head);
|
|
124
128
|
|
|
@@ -126,6 +130,8 @@ export function renderToolCard(part, helpers = {}) {
|
|
|
126
130
|
for (const section of view.sections) {
|
|
127
131
|
if (section.kind === 'code') {
|
|
128
132
|
body.appendChild(el('div', 'ocpv2-tool-input', section.prompt ? `${section.prompt} ${section.text}` : section.text));
|
|
133
|
+
} else if (section.kind === 'terminal') {
|
|
134
|
+
body.appendChild(helpers.terminal(section.shellId));
|
|
129
135
|
} else if (section.kind === 'output') {
|
|
130
136
|
body.appendChild(outputSection(section, helpers));
|
|
131
137
|
} else if (section.kind === 'diff') {
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
// per-provider config (reasoningEffort / thinking / thinkingConfig / etc).
|
|
11
11
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
12
12
|
|
|
13
|
+
import { t } from '../i18n.js';
|
|
14
|
+
import { translatedEffortWord } from '../effort-i18n.js';
|
|
13
15
|
import { fetchProvidersFull } from './ocp-v2-providers.js';
|
|
14
16
|
import { getDefaultStore } from './ocp-v2-state.js';
|
|
15
17
|
|
|
@@ -23,6 +25,15 @@ const STOR_VARIANTS = 'ocp-v2-model-variants'; // { "providerID/modelID": "var
|
|
|
23
25
|
const PREFERRED_ORDER = ['none', 'thinking', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max', 'ultra'];
|
|
24
26
|
const ARROW_DOWN = '▾';
|
|
25
27
|
|
|
28
|
+
// Display words (effortUi.variant.*, assistant.routes.effortWord.*). The variant NAME is what is stored and
|
|
29
|
+
// sent; nothing reads these back. A name that is not a standard effort level shows as it is.
|
|
30
|
+
function word(key, english) {
|
|
31
|
+
const path = `effortUi.variant.${key}`;
|
|
32
|
+
const value = t(path);
|
|
33
|
+
return typeof value === 'string' && value && value !== path ? value : english;
|
|
34
|
+
}
|
|
35
|
+
export function variantDisplayName(name) { return translatedEffortWord(name, t) ?? name; }
|
|
36
|
+
|
|
26
37
|
let _root = null;
|
|
27
38
|
let _dd = null;
|
|
28
39
|
let _menu = null;
|
|
@@ -44,8 +55,8 @@ export function mountVariantPicker(rootEl, store = getDefaultStore()) {
|
|
|
44
55
|
_dd = document.createElement('div');
|
|
45
56
|
_dd.id = 'ocpv2-variant-dd';
|
|
46
57
|
_dd.className = 'ocpv2-dropdown ocpv2-variant-dropdown';
|
|
47
|
-
_dd.dataset.placeholder = 'effort';
|
|
48
|
-
_dd.setAttribute('data-tooltip', 'Reasoning effort');
|
|
58
|
+
_dd.dataset.placeholder = word('placeholder', 'effort');
|
|
59
|
+
_dd.setAttribute('data-tooltip', word('tooltip', 'Reasoning effort'));
|
|
49
60
|
_dd.style.display = 'none';
|
|
50
61
|
_dd.innerHTML =
|
|
51
62
|
`<span class="ocpv2-variant-icon" aria-hidden="true">`
|
|
@@ -54,7 +65,7 @@ export function mountVariantPicker(rootEl, store = getDefaultStore()) {
|
|
|
54
65
|
+ `<path d="M9 9h6"/>`
|
|
55
66
|
+ `</svg>`
|
|
56
67
|
+ `</span>`
|
|
57
|
-
+ `<span class="ocpv2-dd-label"
|
|
68
|
+
+ `<span class="ocpv2-dd-label">${escHtml(word('placeholder', 'effort'))}</span>`
|
|
58
69
|
+ `<span class="ocpv2-dd-arrow">${ARROW_DOWN}</span>`
|
|
59
70
|
+ `<div class="ocpv2-dd-menu"></div>`;
|
|
60
71
|
_root.appendChild(_dd);
|
|
@@ -224,7 +235,7 @@ function syncFromState() {
|
|
|
224
235
|
_dd.style.display = '';
|
|
225
236
|
const v = getState().variant;
|
|
226
237
|
if (v && names.includes(v)) {
|
|
227
|
-
_label.textContent = v;
|
|
238
|
+
_label.textContent = variantDisplayName(v);
|
|
228
239
|
_dd.classList.add('has-value');
|
|
229
240
|
} else {
|
|
230
241
|
_label.textContent = _dd.dataset.placeholder || 'effort';
|
|
@@ -264,7 +275,7 @@ function paintMenu() {
|
|
|
264
275
|
// "Default" entry — clears the variant so the SDK uses its built-in default
|
|
265
276
|
const defaultOpt = document.createElement('div');
|
|
266
277
|
defaultOpt.className = 'ocpv2-dd-option' + (!current ? ' selected' : '');
|
|
267
|
-
defaultOpt.innerHTML =
|
|
278
|
+
defaultOpt.innerHTML = `<span class="ocpv2-dd-variant-name">${escHtml(word('default', 'default'))}</span><span class="ocpv2-dd-hint">${escHtml(word('sdkHint', 'SDK'))}</span>`;
|
|
268
279
|
defaultOpt.addEventListener('click', () => {
|
|
269
280
|
selectVariant(null);
|
|
270
281
|
closeMenu();
|
|
@@ -274,7 +285,7 @@ function paintMenu() {
|
|
|
274
285
|
for (const name of ordered) {
|
|
275
286
|
const opt = document.createElement('div');
|
|
276
287
|
opt.className = 'ocpv2-dd-option' + (current === name ? ' selected' : '');
|
|
277
|
-
opt.innerHTML = `<span class="ocpv2-dd-variant-name">${escHtml(name)}</span>`;
|
|
288
|
+
opt.innerHTML = `<span class="ocpv2-dd-variant-name">${escHtml(variantDisplayName(name))}</span>`;
|
|
278
289
|
opt.addEventListener('click', () => {
|
|
279
290
|
selectVariant(name);
|
|
280
291
|
closeMenu();
|
|
@@ -718,10 +718,12 @@ async function settleAsk(eventType, sessionId, requestId, response) {
|
|
|
718
718
|
return result;
|
|
719
719
|
}
|
|
720
720
|
|
|
721
|
-
|
|
721
|
+
// `force`: "Stop anyway" (offered after a second Stop that could not end a command): the turn ends even while that
|
|
722
|
+
// command may still run. A server from before it ignores the flag (a plain Stop).
|
|
723
|
+
async function abortSession(sessionId, { force = false } = {}) {
|
|
722
724
|
const pending = _asks.openAsksOf(sessionId);
|
|
723
725
|
const stored = storedAsks((owner) => owner === sessionId || knownDescendant(owner, sessionId, _parentOf));
|
|
724
|
-
const result = await request({ type: 'message:abort', sessionId });
|
|
726
|
+
const result = await request({ type: 'message:abort', sessionId, ...(force ? { force: true } : {}) });
|
|
725
727
|
if (!replyFailed(result)) {
|
|
726
728
|
// Stop can finish after a new turn has started. Clear only the requests seen when Stop was pressed.
|
|
727
729
|
for (const ask of pending) _asks.note(`${ask.kind}.replied`, { requestID: ask.id, sessionID: ask.owner });
|
|
@@ -766,6 +768,9 @@ export const api = {
|
|
|
766
768
|
sessionStatus: ({ sessionId, cwd } = {}) => gated({ type: 'session:status', sessionId, cwd }),
|
|
767
769
|
permissionList: ({ sessionId, cwd } = {}) => gated({ type: 'permission:list', sessionId, cwd }),
|
|
768
770
|
sessionTodo: ({ sessionId, cwd } = {}) => gated({ type: 'session:todo', sessionId, cwd }),
|
|
771
|
+
// The shell commands of the session's tool calls, and a page of what one printed (ocp-v2-shell-logic.js).
|
|
772
|
+
shellList: ({ sessionId, cwd } = {}) => gated({ type: 'shell:list', sessionId, cwd }),
|
|
773
|
+
shellOutput: ({ sessionId, shellId, cwd, cursor, tail, limit } = {}) => gated({ type: 'shell:output', sessionId, shellId, cwd, cursor, tail, limit }),
|
|
769
774
|
sessionRevert: ({ sessionId, messageID, partID, cwd } = {}) => gated({ type: 'session:revert', sessionId, messageID, partID, cwd }),
|
|
770
775
|
sessionUnrevert: ({ sessionId, cwd } = {}) => gated({ type: 'session:unrevert', sessionId, cwd }),
|
|
771
776
|
sessionFork: ({ sessionId, messageID, cwd } = {}) => gated({ type: 'session:fork', sessionId, messageID, cwd }),
|